diff --git a/.babelrc b/.babelrc index 46dbece..b5eb413 100644 --- a/.babelrc +++ b/.babelrc @@ -1,8 +1,10 @@ { "presets": [ ["@babel/preset-env", { + "useBuiltIns": "usage", + "corejs": "3", "targets": { - "browsers": ["> 0.25%", "not dead"] + "browsers": ["> 5%", "ie 10-11", "not dead"] } }] ], diff --git a/.eslintrc b/.eslintrc deleted file mode 100644 index e9aa945..0000000 --- a/.eslintrc +++ /dev/null @@ -1,10 +0,0 @@ -{ - "parser": "babel-eslint", - "extends": "eslint:recommended", - "env": { - "es6": true, - "browser": true, - "node": true, - "mocha": true - } -} \ No newline at end of file diff --git a/.eslintrc.js b/.eslintrc.js new file mode 100644 index 0000000..b9e417e --- /dev/null +++ b/.eslintrc.js @@ -0,0 +1,16 @@ +module.exports = { + env: { + browser: true, + }, + extends: [ + 'airbnb-base', + ], + parserOptions: { + ecmaVersion: 12, + sourceType: 'module', + }, + rules: { + 'max-len': ['warn', { code: 150 }], + }, + ignorePatterns: ['dist'], +}; diff --git a/CHANGELOG.md b/CHANGELOG.md index aa22a2f..bb3bff3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,9 @@ +## v1.0.15 (12 Aug 2021) +* fixed: Fixed black Images and type error by considering Canvas maximum size supported by different browsers [#84](https://github.com/Donaldcwl/browser-image-compression/issues/84), [#36](https://github.com/Donaldcwl/browser-image-compression/issues/36) +* fixed: IE compatibility, include polyfill with core-js@3 e.g, globalThis, Promise [#108](https://github.com/Donaldcwl/browser-image-compression/issues/108), [#110](https://github.com/Donaldcwl/browser-image-compression/issues/110) +* fixed: Test suites in few projects may have error, added extra checking on whether File and FileReader exist in the Window object [#92](https://github.com/Donaldcwl/browser-image-compression/issues/92) +* fixed: issue with export causing compile error in typescript project [#63](https://github.com/Donaldcwl/browser-image-compression/issues/63) + ## v1.0.14 (6 Jan 2021) * updated: use UZIP to compress PNG image instead of Canvas * fixed: PNG transparent background become black after compression [#84](https://github.com/Donaldcwl/browser-image-compression/issues/84), [#76](https://github.com/Donaldcwl/browser-image-compression/issues/76) @@ -8,7 +14,7 @@ * fixed: options object being altered by the compress func [#71](https://github.com/Donaldcwl/browser-image-compression/pull/71) * fixed: issue with output size of png compression [#57](https://github.com/Donaldcwl/browser-image-compression/issues/57) -## v1.0.12 (4 June 2020) +## v1.0.12 (4 Jun 2020) * fixed: issue with SSR [#58](https://github.com/Donaldcwl/browser-image-compression/issues/58) ## v1.0.11 (8 May 2020) @@ -37,10 +43,10 @@ * fixed: issue in IE browser * fixed: other issues -## v1.0.6 (5 July 2019) +## v1.0.6 (5 Jul 2019) * fixed: exif orientation do not work in some situations -## v1.0.5 (1 June 2019) +## v1.0.5 (1 Jun 2019) * added: support for cordova project that uses cordova-plugin-file * optimized: follow image exif orientation even though image do not required to compress or resize * fixed: error may throw on iPhone Safari because of OffscreenCanvas cannot get 2d context diff --git a/README.md b/README.md index f06ea00..837eed6 100644 --- a/README.md +++ b/README.md @@ -18,7 +18,7 @@ yarn add browser-image-compression ``` or use a CDN like [delivrjs]: ``` -https://cdn.jsdelivr.net/npm/browser-image-compression@1.0.14/dist/browser-image-compression.js +https://cdn.jsdelivr.net/npm/browser-image-compression@1.0.15/dist/browser-image-compression.js or https://cdn.jsdelivr.net/npm/browser-image-compression@latest/dist/browser-image-compression.js ``` @@ -42,7 +42,7 @@ or #### In html file #### ```html - + ``` ## API ## @@ -153,16 +153,6 @@ or check the "[example]" folder in this repo ## Remarks for compression to work in Web Worker The browser need to support "OffscreenCanvas" API in order to take advantage of non-blocking compression. If browser do not support "OffscreenCanvas" API, main thread is used instead. See https://developer.mozilla.org/en-US/docs/Web/API/OffscreenCanvas#browser_compatibility for browser compatibility of "OffscreenCanvas" API. -## IE support ## -Promise API is being used in this library. If you need to support browser that do not support Promise like IE. You can include the Promise polyfill in your project. - -See: https://github.com/taylorhakes/promise-polyfill - -You can include the following script to load the Promise polyfill: -```html - -``` - ## Typescript type definitions ## Typescript definitions are included in the package & referenced in the `types` section of the `package.json` @@ -174,7 +164,7 @@ Typescript definitions are included in the package & referenced in the `types` s 5. add/update test in test/ folder 6. `npm run test` 7. push to your forked repo on github -8. make a pull request to this repo +8. make a pull request to dev branch of this repo [dist]: https://github.com/Donaldcwl/browser-image-compression/tree/master/dist [example]: https://github.com/Donaldcwl/browser-image-compression/tree/master/example diff --git a/coverage/badge.svg b/coverage/badge.svg index b6ab2b7..cbfab8c 100644 --- a/coverage/badge.svg +++ b/coverage/badge.svg @@ -1 +1 @@ -Coverage: 77.68%Coverage77.68% \ No newline at end of file +Coverage: 75.77%Coverage75.77% \ No newline at end of file diff --git a/coverage/coverage-final.json b/coverage/coverage-final.json index 75bfdcf..4c10238 100644 --- a/coverage/coverage-final.json +++ b/coverage/coverage-final.json @@ -1,4 +1,6 @@ -{"D:\\Projects\\browser-image-compression\\lib\\image-compression.js": {"path":"D:\\Projects\\browser-image-compression\\lib\\image-compression.js","statementMap":{"0":{"start":{"line":29,"column":17},"end":{"line":29,"column":33}},"1":{"start":{"line":32,"column":4},"end":{"line":32,"column":19}},"2":{"start":{"line":33,"column":4},"end":{"line":33,"column":47}},"3":{"start":{"line":37,"column":4},"end":{"line":37,"column":51}},"4":{"start":{"line":38,"column":4},"end":{"line":38,"column":32}},"5":{"start":{"line":41,"column":24},"end":{"line":41,"column":50}},"6":{"start":{"line":43,"column":22},"end":{"line":43,"column":53}},"7":{"start":{"line":45,"column":2},"end":{"line":45,"column":15}},"8":{"start":{"line":48,"column":26},"end":{"line":48,"column":54}},"9":{"start":{"line":50,"column":2},"end":{"line":50,"column":15}},"10":{"start":{"line":53,"column":38},"end":{"line":53,"column":81}},"11":{"start":{"line":55,"column":2},"end":{"line":55,"column":15}},"12":{"start":{"line":58,"column":26},"end":{"line":58,"column":83}},"13":{"start":{"line":59,"column":2},"end":{"line":59,"column":15}},"14":{"start":{"line":60,"column":33},"end":{"line":60,"column":169}},"15":{"start":{"line":61,"column":2},"end":{"line":61,"column":15}},"16":{"start":{"line":63,"column":16},"end":{"line":63,"column":45}},"17":{"start":{"line":65,"column":25},"end":{"line":65,"column":54}},"18":{"start":{"line":67,"column":17},"end":{"line":67,"column":114}},"19":{"start":{"line":68,"column":2},"end":{"line":68,"column":15}},"20":{"start":{"line":70,"column":28},"end":{"line":70,"column":55}},"21":{"start":{"line":71,"column":27},"end":{"line":71,"column":52}},"22":{"start":{"line":76,"column":2},"end":{"line":80,"column":3}},"23":{"start":{"line":78,"column":4},"end":{"line":78,"column":20}},"24":{"start":{"line":79,"column":4},"end":{"line":79,"column":19}},"25":{"start":{"line":82,"column":21},"end":{"line":82,"column":30}},"26":{"start":{"line":83,"column":23},"end":{"line":83,"column":36}},"27":{"start":{"line":84,"column":20},"end":{"line":84,"column":32}},"28":{"start":{"line":87,"column":15},"end":{"line":87,"column":37}},"29":{"start":{"line":88,"column":2},"end":{"line":107,"column":3}},"30":{"start":{"line":89,"column":21},"end":{"line":89,"column":75}},"31":{"start":{"line":90,"column":22},"end":{"line":90,"column":78}},"32":{"start":{"line":93,"column":4},"end":{"line":93,"column":62}},"33":{"start":{"line":95,"column":4},"end":{"line":95,"column":52}},"34":{"start":{"line":97,"column":4},"end":{"line":97,"column":19}},"35":{"start":{"line":98,"column":4},"end":{"line":98,"column":105}},"36":{"start":{"line":100,"column":4},"end":{"line":100,"column":31}},"37":{"start":{"line":102,"column":4},"end":{"line":102,"column":22}},"38":{"start":{"line":104,"column":4},"end":{"line":104,"column":37}},"39":{"start":{"line":106,"column":4},"end":{"line":106,"column":108}},"40":{"start":{"line":109,"column":2},"end":{"line":109,"column":29}},"41":{"start":{"line":110,"column":2},"end":{"line":110,"column":32}},"42":{"start":{"line":111,"column":2},"end":{"line":111,"column":50}},"43":{"start":{"line":112,"column":2},"end":{"line":112,"column":45}},"44":{"start":{"line":113,"column":2},"end":{"line":113,"column":33}},"45":{"start":{"line":115,"column":2},"end":{"line":115,"column":18}},"46":{"start":{"line":116,"column":2},"end":{"line":116,"column":23}}},"fnMap":{"0":{"name":"compress","decl":{"start":{"line":28,"column":30},"end":{"line":28,"column":38}},"loc":{"start":{"line":28,"column":77},"end":{"line":117,"column":1}},"line":28},"1":{"name":"incProgress","decl":{"start":{"line":31,"column":11},"end":{"line":31,"column":22}},"loc":{"start":{"line":31,"column":33},"end":{"line":34,"column":3}},"line":31},"2":{"name":"setProgress","decl":{"start":{"line":36,"column":11},"end":{"line":36,"column":22}},"loc":{"start":{"line":36,"column":27},"end":{"line":39,"column":3}},"line":36}},"branchMap":{"0":{"loc":{"start":{"line":28,"column":55},"end":{"line":28,"column":75}},"type":"default-arg","locations":[{"start":{"line":28,"column":74},"end":{"line":28,"column":75}}],"line":28},"1":{"loc":{"start":{"line":31,"column":24},"end":{"line":31,"column":31}},"type":"default-arg","locations":[{"start":{"line":31,"column":30},"end":{"line":31,"column":31}}],"line":31},"2":{"loc":{"start":{"line":41,"column":24},"end":{"line":41,"column":50}},"type":"binary-expr","locations":[{"start":{"line":41,"column":24},"end":{"line":41,"column":44}},{"start":{"line":41,"column":48},"end":{"line":41,"column":50}}],"line":41},"3":{"loc":{"start":{"line":58,"column":26},"end":{"line":58,"column":83}},"type":"binary-expr","locations":[{"start":{"line":58,"column":26},"end":{"line":58,"column":49}},{"start":{"line":58,"column":53},"end":{"line":58,"column":83}}],"line":58},"4":{"loc":{"start":{"line":60,"column":33},"end":{"line":60,"column":169}},"type":"cond-expr","locations":[{"start":{"line":60,"column":72},"end":{"line":60,"column":99}},{"start":{"line":60,"column":102},"end":{"line":60,"column":169}}],"line":60},"5":{"loc":{"start":{"line":63,"column":16},"end":{"line":63,"column":45}},"type":"binary-expr","locations":[{"start":{"line":63,"column":16},"end":{"line":63,"column":38}},{"start":{"line":63,"column":42},"end":{"line":63,"column":45}}],"line":63},"6":{"loc":{"start":{"line":65,"column":25},"end":{"line":65,"column":54}},"type":"binary-expr","locations":[{"start":{"line":65,"column":25},"end":{"line":65,"column":41}},{"start":{"line":65,"column":45},"end":{"line":65,"column":54}}],"line":65},"7":{"loc":{"start":{"line":76,"column":2},"end":{"line":80,"column":3}},"type":"if","locations":[{"start":{"line":76,"column":2},"end":{"line":80,"column":3}},{"start":{"line":76,"column":2},"end":{"line":80,"column":3}}],"line":76},"8":{"loc":{"start":{"line":76,"column":6},"end":{"line":76,"column":45}},"type":"binary-expr","locations":[{"start":{"line":76,"column":6},"end":{"line":76,"column":24}},{"start":{"line":76,"column":28},"end":{"line":76,"column":45}}],"line":76},"9":{"loc":{"start":{"line":88,"column":9},"end":{"line":88,"column":85}},"type":"binary-expr","locations":[{"start":{"line":88,"column":9},"end":{"line":88,"column":26}},{"start":{"line":88,"column":31},"end":{"line":88,"column":56}},{"start":{"line":88,"column":60},"end":{"line":88,"column":84}}],"line":88},"10":{"loc":{"start":{"line":89,"column":21},"end":{"line":89,"column":75}},"type":"cond-expr","locations":[{"start":{"line":89,"column":41},"end":{"line":89,"column":60}},{"start":{"line":89,"column":63},"end":{"line":89,"column":75}}],"line":89},"11":{"loc":{"start":{"line":90,"column":22},"end":{"line":90,"column":78}},"type":"cond-expr","locations":[{"start":{"line":90,"column":42},"end":{"line":90,"column":62}},{"start":{"line":90,"column":65},"end":{"line":90,"column":78}}],"line":90}},"s":{"0":6,"1":36,"2":36,"3":8,"4":8,"5":6,"6":6,"7":6,"8":6,"9":6,"10":6,"11":6,"12":6,"13":6,"14":6,"15":6,"16":6,"17":6,"18":6,"19":6,"20":6,"21":6,"22":6,"23":5,"24":5,"25":1,"26":1,"27":1,"28":1,"29":1,"30":2,"31":2,"32":2,"33":2,"34":2,"35":2,"36":2,"37":2,"38":2,"39":2,"40":1,"41":1,"42":1,"43":1,"44":1,"45":1,"46":1},"f":{"0":6,"1":36,"2":8},"b":{"0":[6],"1":[36],"2":[6,6],"3":[6,0],"4":[0,6],"5":[6,6],"6":[6,6],"7":[5,1],"8":[6,5],"9":[3,3,1],"10":[2,0],"11":[2,0]},"_coverageSchema":"1a1c01bbd47fc00a2c39e90264f33305004495a9","hash":"a0e8b1cd43b4a5912a802eab993baa314ad5494b","contentHash":"577419880913c52e0f27e5a0f5f7309d5b01aaffa95bd4fedd607203ab50e0f8"} -,"D:\\Projects\\browser-image-compression\\lib\\index.js": {"path":"D:\\Projects\\browser-image-compression\\lib\\index.js","statementMap":{"0":{"start":{"line":35,"column":17},"end":{"line":35,"column":18}},"1":{"start":{"line":38,"column":2},"end":{"line":38,"column":67}},"2":{"start":{"line":39,"column":23},"end":{"line":39,"column":94}},"3":{"start":{"line":40,"column":2},"end":{"line":40,"column":29}},"4":{"start":{"line":41,"column":2},"end":{"line":41,"column":33}},"5":{"start":{"line":42,"column":2},"end":{"line":47,"column":3}},"6":{"start":{"line":43,"column":4},"end":{"line":43,"column":24}},"7":{"start":{"line":44,"column":4},"end":{"line":46,"column":5}},"8":{"start":{"line":45,"column":6},"end":{"line":45,"column":26}},"9":{"start":{"line":49,"column":2},"end":{"line":53,"column":3}},"10":{"start":{"line":50,"column":4},"end":{"line":50,"column":72}},"11":{"start":{"line":51,"column":9},"end":{"line":53,"column":3}},"12":{"start":{"line":52,"column":4},"end":{"line":52,"column":53}},"13":{"start":{"line":56,"column":22},"end":{"line":56,"column":99}},"14":{"start":{"line":64,"column":2},"end":{"line":77,"column":3}},"15":{"start":{"line":65,"column":4},"end":{"line":73,"column":5}},"16":{"start":{"line":68,"column":6},"end":{"line":68,"column":63}},"17":{"start":{"line":72,"column":6},"end":{"line":72,"column":52}},"18":{"start":{"line":76,"column":4},"end":{"line":76,"column":50}},"19":{"start":{"line":79,"column":2},"end":{"line":82,"column":16}},"20":{"start":{"line":80,"column":4},"end":{"line":80,"column":35}},"21":{"start":{"line":81,"column":4},"end":{"line":81,"column":51}},"22":{"start":{"line":84,"column":2},"end":{"line":84,"column":23}},"23":{"start":{"line":87,"column":0},"end":{"line":87,"column":56}},"24":{"start":{"line":88,"column":0},"end":{"line":88,"column":56}},"25":{"start":{"line":89,"column":0},"end":{"line":89,"column":38}},"26":{"start":{"line":90,"column":0},"end":{"line":90,"column":54}},"27":{"start":{"line":91,"column":0},"end":{"line":91,"column":52}},"28":{"start":{"line":92,"column":0},"end":{"line":92,"column":44}},"29":{"start":{"line":93,"column":0},"end":{"line":93,"column":56}},"30":{"start":{"line":95,"column":0},"end":{"line":95,"column":64}},"31":{"start":{"line":96,"column":0},"end":{"line":96,"column":62}},"32":{"start":{"line":97,"column":0},"end":{"line":97,"column":58}},"33":{"start":{"line":98,"column":0},"end":{"line":98,"column":72}},"34":{"start":{"line":99,"column":0},"end":{"line":99,"column":35}}},"fnMap":{"0":{"name":"imageCompression","decl":{"start":{"line":32,"column":15},"end":{"line":32,"column":31}},"loc":{"start":{"line":32,"column":48},"end":{"line":85,"column":1}},"line":32},"1":{"name":"(anonymous_1)","decl":{"start":{"line":42,"column":23},"end":{"line":42,"column":24}},"loc":{"start":{"line":42,"column":38},"end":{"line":47,"column":3}},"line":42}},"branchMap":{"0":{"loc":{"start":{"line":38,"column":22},"end":{"line":38,"column":67}},"type":"binary-expr","locations":[{"start":{"line":38,"column":22},"end":{"line":38,"column":39}},{"start":{"line":38,"column":43},"end":{"line":38,"column":67}}],"line":38},"1":{"loc":{"start":{"line":39,"column":23},"end":{"line":39,"column":94}},"type":"cond-expr","locations":[{"start":{"line":39,"column":67},"end":{"line":39,"column":87}},{"start":{"line":39,"column":90},"end":{"line":39,"column":94}}],"line":39},"2":{"loc":{"start":{"line":44,"column":4},"end":{"line":46,"column":5}},"type":"if","locations":[{"start":{"line":44,"column":4},"end":{"line":46,"column":5}},{"start":{"line":44,"column":4},"end":{"line":46,"column":5}}],"line":44},"3":{"loc":{"start":{"line":49,"column":2},"end":{"line":53,"column":3}},"type":"if","locations":[{"start":{"line":49,"column":2},"end":{"line":53,"column":3}},{"start":{"line":49,"column":2},"end":{"line":53,"column":3}}],"line":49},"4":{"loc":{"start":{"line":49,"column":8},"end":{"line":49,"column":58}},"type":"binary-expr","locations":[{"start":{"line":49,"column":8},"end":{"line":49,"column":28}},{"start":{"line":49,"column":32},"end":{"line":49,"column":58}}],"line":49},"5":{"loc":{"start":{"line":51,"column":9},"end":{"line":53,"column":3}},"type":"if","locations":[{"start":{"line":51,"column":9},"end":{"line":53,"column":3}},{"start":{"line":51,"column":9},"end":{"line":53,"column":3}}],"line":51},"6":{"loc":{"start":{"line":56,"column":22},"end":{"line":56,"column":99}},"type":"binary-expr","locations":[{"start":{"line":56,"column":22},"end":{"line":56,"column":62}},{"start":{"line":56,"column":66},"end":{"line":56,"column":99}}],"line":56},"7":{"loc":{"start":{"line":64,"column":2},"end":{"line":77,"column":3}},"type":"if","locations":[{"start":{"line":64,"column":2},"end":{"line":77,"column":3}},{"start":{"line":64,"column":2},"end":{"line":77,"column":3}}],"line":64},"8":{"loc":{"start":{"line":64,"column":6},"end":{"line":64,"column":66}},"type":"binary-expr","locations":[{"start":{"line":64,"column":6},"end":{"line":64,"column":18}},{"start":{"line":64,"column":22},"end":{"line":64,"column":50}},{"start":{"line":64,"column":54},"end":{"line":64,"column":66}}],"line":64}},"s":{"0":9,"1":9,"2":9,"3":9,"4":9,"5":9,"6":44,"7":44,"8":0,"9":9,"10":2,"11":7,"12":1,"13":6,"14":6,"15":0,"16":0,"17":0,"18":6,"19":6,"20":6,"21":6,"22":6,"23":1,"24":1,"25":1,"26":1,"27":1,"28":1,"29":1,"30":1,"31":1,"32":1,"33":1,"34":1},"f":{"0":9,"1":44},"b":{"0":[9,2],"1":[9,0],"2":[0,44],"3":[2,7],"4":[9,2],"5":[1,6],"6":[6,0],"7":[0,6],"8":[6,0,0]},"_coverageSchema":"1a1c01bbd47fc00a2c39e90264f33305004495a9","hash":"0e768961535b127ec5a2cdd0a2cf2218261a426d","contentHash":"6cedfa92008856f5e598730f1a8573bb5f4726e9830c239e274f7c769bd7893d"} -,"D:\\Projects\\browser-image-compression\\lib\\utils.js": {"path":"D:\\Projects\\browser-image-compression\\lib\\utils.js","statementMap":{"0":{"start":{"line":3,"column":18},"end":{"line":3,"column":47}},"1":{"start":{"line":6,"column":21},"end":{"line":6,"column":124}},"2":{"start":{"line":7,"column":26},"end":{"line":7,"column":113}},"3":{"start":{"line":8,"column":32},"end":{"line":8,"column":131}},"4":{"start":{"line":13,"column":2},"end":{"line":14,"column":44}},"5":{"start":{"line":14,"column":4},"end":{"line":14,"column":44}},"6":{"start":{"line":19,"column":4},"end":{"line":24,"column":63}},"7":{"start":{"line":25,"column":24},"end":{"line":25,"column":86}},"8":{"start":{"line":27,"column":26},"end":{"line":27,"column":68}},"9":{"start":{"line":28,"column":25},"end":{"line":28,"column":128}},"10":{"start":{"line":29,"column":2},"end":{"line":29,"column":38}},"11":{"start":{"line":30,"column":14},"end":{"line":30,"column":57}},"12":{"start":{"line":33,"column":2},"end":{"line":33,"column":73}},"13":{"start":{"line":34,"column":2},"end":{"line":34,"column":42}},"14":{"start":{"line":44,"column":2},"end":{"line":49,"column":4}},"15":{"start":{"line":45,"column":19},"end":{"line":45,"column":41}},"16":{"start":{"line":46,"column":4},"end":{"line":46,"column":48}},"17":{"start":{"line":46,"column":26},"end":{"line":46,"column":48}},"18":{"start":{"line":47,"column":4},"end":{"line":47,"column":37}},"19":{"start":{"line":47,"column":28},"end":{"line":47,"column":37}},"20":{"start":{"line":48,"column":4},"end":{"line":48,"column":30}},"21":{"start":{"line":61,"column":2},"end":{"line":87,"column":4}},"22":{"start":{"line":62,"column":16},"end":{"line":62,"column":34}},"23":{"start":{"line":63,"column":17},"end":{"line":63,"column":43}},"24":{"start":{"line":64,"column":17},"end":{"line":64,"column":40}},"25":{"start":{"line":65,"column":12},"end":{"line":65,"column":23}},"26":{"start":{"line":66,"column":18},"end":{"line":66,"column":35}},"27":{"start":{"line":67,"column":4},"end":{"line":69,"column":5}},"28":{"start":{"line":68,"column":6},"end":{"line":68,"column":35}},"29":{"start":{"line":70,"column":17},"end":{"line":70,"column":50}},"30":{"start":{"line":71,"column":4},"end":{"line":71,"column":24}},"31":{"start":{"line":72,"column":4},"end":{"line":72,"column":36}},"32":{"start":{"line":73,"column":4},"end":{"line":73,"column":17}},"33":{"start":{"line":97,"column":2},"end":{"line":102,"column":4}},"34":{"start":{"line":98,"column":16},"end":{"line":98,"column":27}},"35":{"start":{"line":99,"column":4},"end":{"line":99,"column":35}},"36":{"start":{"line":99,"column":23},"end":{"line":99,"column":35}},"37":{"start":{"line":100,"column":4},"end":{"line":100,"column":34}},"38":{"start":{"line":100,"column":25},"end":{"line":100,"column":34}},"39":{"start":{"line":101,"column":4},"end":{"line":101,"column":17}},"40":{"start":{"line":112,"column":24},"end":{"line":112,"column":65}},"41":{"start":{"line":113,"column":2},"end":{"line":113,"column":55}},"42":{"start":{"line":114,"column":2},"end":{"line":114,"column":15}},"43":{"start":{"line":125,"column":2},"end":{"line":130,"column":3}},"44":{"start":{"line":126,"column":4},"end":{"line":126,"column":39}},"45":{"start":{"line":128,"column":20},"end":{"line":128,"column":50}},"46":{"start":{"line":129,"column":4},"end":{"line":129,"column":34}},"47":{"start":{"line":131,"column":17},"end":{"line":131,"column":39}},"48":{"start":{"line":132,"column":2},"end":{"line":132,"column":22}},"49":{"start":{"line":147,"column":2},"end":{"line":164,"column":3}},"50":{"start":{"line":148,"column":16},"end":{"line":148,"column":39}},"51":{"start":{"line":149,"column":17},"end":{"line":149,"column":73}},"52":{"start":{"line":150,"column":16},"end":{"line":150,"column":79}},"53":{"start":{"line":151,"column":4},"end":{"line":151,"column":46}},"54":{"start":{"line":152,"column":4},"end":{"line":152,"column":24}},"55":{"start":{"line":153,"column":4},"end":{"line":153,"column":40}},"56":{"start":{"line":154,"column":9},"end":{"line":164,"column":3}},"57":{"start":{"line":155,"column":4},"end":{"line":155,"column":66}},"58":{"start":{"line":156,"column":4},"end":{"line":156,"column":24}},"59":{"start":{"line":157,"column":4},"end":{"line":157,"column":40}},"60":{"start":{"line":162,"column":20},"end":{"line":162,"column":55}},"61":{"start":{"line":163,"column":4},"end":{"line":163,"column":72}},"62":{"start":{"line":165,"column":2},"end":{"line":165,"column":13}},"63":{"start":{"line":177,"column":2},"end":{"line":214,"column":4}},"64":{"start":{"line":178,"column":19},"end":{"line":178,"column":41}},"65":{"start":{"line":179,"column":4},"end":{"line":211,"column":5}},"66":{"start":{"line":180,"column":19},"end":{"line":180,"column":48}},"67":{"start":{"line":181,"column":6},"end":{"line":183,"column":7}},"68":{"start":{"line":182,"column":8},"end":{"line":182,"column":26}},"69":{"start":{"line":184,"column":21},"end":{"line":184,"column":36}},"70":{"start":{"line":185,"column":19},"end":{"line":185,"column":20}},"71":{"start":{"line":186,"column":6},"end":{"line":209,"column":7}},"72":{"start":{"line":187,"column":8},"end":{"line":187,"column":70}},"73":{"start":{"line":187,"column":52},"end":{"line":187,"column":70}},"74":{"start":{"line":188,"column":23},"end":{"line":188,"column":52}},"75":{"start":{"line":189,"column":8},"end":{"line":189,"column":19}},"76":{"start":{"line":190,"column":8},"end":{"line":208,"column":9}},"77":{"start":{"line":191,"column":10},"end":{"line":193,"column":11}},"78":{"start":{"line":192,"column":12},"end":{"line":192,"column":30}},"79":{"start":{"line":195,"column":23},"end":{"line":195,"column":67}},"80":{"start":{"line":196,"column":10},"end":{"line":196,"column":54}},"81":{"start":{"line":197,"column":21},"end":{"line":197,"column":51}},"82":{"start":{"line":198,"column":10},"end":{"line":198,"column":21}},"83":{"start":{"line":199,"column":10},"end":{"line":203,"column":11}},"84":{"start":{"line":199,"column":23},"end":{"line":199,"column":24}},"85":{"start":{"line":200,"column":12},"end":{"line":202,"column":13}},"86":{"start":{"line":201,"column":14},"end":{"line":201,"column":75}},"87":{"start":{"line":204,"column":15},"end":{"line":208,"column":9}},"88":{"start":{"line":205,"column":10},"end":{"line":205,"column":15}},"89":{"start":{"line":207,"column":10},"end":{"line":207,"column":49}},"90":{"start":{"line":210,"column":6},"end":{"line":210,"column":24}},"91":{"start":{"line":212,"column":4},"end":{"line":212,"column":37}},"92":{"start":{"line":212,"column":28},"end":{"line":212,"column":37}},"93":{"start":{"line":213,"column":4},"end":{"line":213,"column":34}},"94":{"start":{"line":224,"column":16},"end":{"line":224,"column":28}},"95":{"start":{"line":225,"column":17},"end":{"line":225,"column":30}},"96":{"start":{"line":226,"column":27},"end":{"line":226,"column":51}},"97":{"start":{"line":228,"column":23},"end":{"line":228,"column":108}},"98":{"start":{"line":230,"column":18},"end":{"line":230,"column":24}},"99":{"start":{"line":233,"column":2},"end":{"line":245,"column":3}},"100":{"start":{"line":234,"column":4},"end":{"line":234,"column":56}},"101":{"start":{"line":235,"column":4},"end":{"line":241,"column":5}},"102":{"start":{"line":236,"column":6},"end":{"line":236,"column":40}},"103":{"start":{"line":237,"column":6},"end":{"line":237,"column":60}},"104":{"start":{"line":239,"column":6},"end":{"line":239,"column":59}},"105":{"start":{"line":240,"column":6},"end":{"line":240,"column":41}},"106":{"start":{"line":242,"column":4},"end":{"line":242,"column":66}},"107":{"start":{"line":244,"column":4},"end":{"line":244,"column":31}},"108":{"start":{"line":247,"column":2},"end":{"line":247,"column":18}},"109":{"start":{"line":259,"column":16},"end":{"line":259,"column":28}},"110":{"start":{"line":260,"column":17},"end":{"line":260,"column":30}},"111":{"start":{"line":262,"column":27},"end":{"line":262,"column":60}},"112":{"start":{"line":265,"column":2},"end":{"line":271,"column":3}},"113":{"start":{"line":266,"column":4},"end":{"line":266,"column":28}},"114":{"start":{"line":267,"column":4},"end":{"line":267,"column":28}},"115":{"start":{"line":269,"column":4},"end":{"line":269,"column":27}},"116":{"start":{"line":270,"column":4},"end":{"line":270,"column":29}},"117":{"start":{"line":274,"column":2},"end":{"line":298,"column":3}},"118":{"start":{"line":276,"column":6},"end":{"line":276,"column":42}},"119":{"start":{"line":277,"column":6},"end":{"line":277,"column":11}},"120":{"start":{"line":279,"column":6},"end":{"line":279,"column":48}},"121":{"start":{"line":280,"column":6},"end":{"line":280,"column":11}},"122":{"start":{"line":282,"column":6},"end":{"line":282,"column":43}},"123":{"start":{"line":283,"column":6},"end":{"line":283,"column":11}},"124":{"start":{"line":285,"column":6},"end":{"line":285,"column":37}},"125":{"start":{"line":286,"column":6},"end":{"line":286,"column":11}},"126":{"start":{"line":288,"column":6},"end":{"line":288,"column":43}},"127":{"start":{"line":289,"column":6},"end":{"line":289,"column":11}},"128":{"start":{"line":291,"column":6},"end":{"line":291,"column":48}},"129":{"start":{"line":292,"column":6},"end":{"line":292,"column":11}},"130":{"start":{"line":294,"column":6},"end":{"line":294,"column":42}},"131":{"start":{"line":295,"column":6},"end":{"line":295,"column":11}},"132":{"start":{"line":297,"column":6},"end":{"line":297,"column":11}},"133":{"start":{"line":300,"column":2},"end":{"line":300,"column":44}},"134":{"start":{"line":302,"column":2},"end":{"line":302,"column":29}},"135":{"start":{"line":304,"column":2},"end":{"line":304,"column":18}},"136":{"start":{"line":316,"column":2},"end":{"line":325,"column":3}},"137":{"start":{"line":317,"column":4},"end":{"line":317,"column":47}},"138":{"start":{"line":318,"column":4},"end":{"line":318,"column":33}},"139":{"start":{"line":319,"column":4},"end":{"line":321,"column":5}},"140":{"start":{"line":320,"column":6},"end":{"line":320,"column":67}},"141":{"start":{"line":323,"column":4},"end":{"line":323,"column":45}},"142":{"start":{"line":324,"column":4},"end":{"line":324,"column":33}},"143":{"start":{"line":326,"column":2},"end":{"line":326,"column":22}},"144":{"start":{"line":327,"column":2},"end":{"line":327,"column":24}},"145":{"start":{"line":330,"column":2},"end":{"line":330,"column":22}},"146":{"start":{"line":341,"column":2},"end":{"line":341,"column":18}},"147":{"start":{"line":342,"column":2},"end":{"line":342,"column":19}},"148":{"start":{"line":345,"column":0},"end":{"line":352,"column":1}},"149":{"start":{"line":347,"column":2},"end":{"line":351,"column":3}},"150":{"start":{"line":348,"column":4},"end":{"line":350,"column":33}}},"fnMap":{"0":{"name":"isAutoOrientationInBrowser","decl":{"start":{"line":12,"column":22},"end":{"line":12,"column":48}},"loc":{"start":{"line":12,"column":51},"end":{"line":35,"column":1}},"line":12},"1":{"name":"getDataUrlFromFile","decl":{"start":{"line":43,"column":16},"end":{"line":43,"column":34}},"loc":{"start":{"line":43,"column":42},"end":{"line":50,"column":1}},"line":43},"2":{"name":"(anonymous_2)","decl":{"start":{"line":44,"column":21},"end":{"line":44,"column":22}},"loc":{"start":{"line":44,"column":42},"end":{"line":49,"column":3}},"line":44},"3":{"name":"(anonymous_3)","decl":{"start":{"line":46,"column":20},"end":{"line":46,"column":21}},"loc":{"start":{"line":46,"column":26},"end":{"line":46,"column":48}},"line":46},"4":{"name":"(anonymous_4)","decl":{"start":{"line":47,"column":21},"end":{"line":47,"column":22}},"loc":{"start":{"line":47,"column":28},"end":{"line":47,"column":37}},"line":47},"5":{"name":"getFilefromDataUrl","decl":{"start":{"line":60,"column":16},"end":{"line":60,"column":34}},"loc":{"start":{"line":60,"column":82},"end":{"line":88,"column":1}},"line":60},"6":{"name":"(anonymous_6)","decl":{"start":{"line":61,"column":21},"end":{"line":61,"column":22}},"loc":{"start":{"line":61,"column":34},"end":{"line":87,"column":3}},"line":61},"7":{"name":"loadImage","decl":{"start":{"line":96,"column":16},"end":{"line":96,"column":25}},"loc":{"start":{"line":96,"column":32},"end":{"line":103,"column":1}},"line":96},"8":{"name":"(anonymous_8)","decl":{"start":{"line":97,"column":21},"end":{"line":97,"column":22}},"loc":{"start":{"line":97,"column":42},"end":{"line":102,"column":3}},"line":97},"9":{"name":"(anonymous_9)","decl":{"start":{"line":99,"column":17},"end":{"line":99,"column":18}},"loc":{"start":{"line":99,"column":23},"end":{"line":99,"column":35}},"line":99},"10":{"name":"(anonymous_10)","decl":{"start":{"line":100,"column":18},"end":{"line":100,"column":19}},"loc":{"start":{"line":100,"column":25},"end":{"line":100,"column":34}},"line":100},"11":{"name":"drawImageInCanvas","decl":{"start":{"line":111,"column":16},"end":{"line":111,"column":33}},"loc":{"start":{"line":111,"column":40},"end":{"line":115,"column":1}},"line":111},"12":{"name":"drawFileInCanvas","decl":{"start":{"line":123,"column":22},"end":{"line":123,"column":38}},"loc":{"start":{"line":123,"column":46},"end":{"line":133,"column":1}},"line":123},"13":{"name":"canvasToFile","decl":{"start":{"line":145,"column":22},"end":{"line":145,"column":34}},"loc":{"start":{"line":145,"column":95},"end":{"line":166,"column":1}},"line":145},"14":{"name":"getExifOrientation","decl":{"start":{"line":176,"column":16},"end":{"line":176,"column":34}},"loc":{"start":{"line":176,"column":42},"end":{"line":215,"column":1}},"line":176},"15":{"name":"(anonymous_15)","decl":{"start":{"line":177,"column":21},"end":{"line":177,"column":22}},"loc":{"start":{"line":177,"column":42},"end":{"line":214,"column":3}},"line":177},"16":{"name":"(anonymous_16)","decl":{"start":{"line":179,"column":20},"end":{"line":179,"column":21}},"loc":{"start":{"line":179,"column":27},"end":{"line":211,"column":5}},"line":179},"17":{"name":"(anonymous_17)","decl":{"start":{"line":212,"column":21},"end":{"line":212,"column":22}},"loc":{"start":{"line":212,"column":28},"end":{"line":212,"column":37}},"line":212},"18":{"name":"handleMaxWidthOrHeight","decl":{"start":{"line":223,"column":16},"end":{"line":223,"column":38}},"loc":{"start":{"line":223,"column":57},"end":{"line":248,"column":1}},"line":223},"19":{"name":"followExifOrientation","decl":{"start":{"line":258,"column":16},"end":{"line":258,"column":37}},"loc":{"start":{"line":258,"column":64},"end":{"line":305,"column":1}},"line":258},"20":{"name":"getNewCanvasAndCtx","decl":{"start":{"line":313,"column":16},"end":{"line":313,"column":34}},"loc":{"start":{"line":313,"column":51},"end":{"line":331,"column":1}},"line":313},"21":{"name":"cleanupCanvasMemory","decl":{"start":{"line":338,"column":16},"end":{"line":338,"column":35}},"loc":{"start":{"line":338,"column":45},"end":{"line":343,"column":1}},"line":338},"22":{"name":"(anonymous_22)","decl":{"start":{"line":347,"column":41},"end":{"line":347,"column":42}},"loc":{"start":{"line":347,"column":58},"end":{"line":351,"column":3}},"line":347}},"branchMap":{"0":{"loc":{"start":{"line":6,"column":21},"end":{"line":6,"column":124}},"type":"binary-expr","locations":[{"start":{"line":6,"column":21},"end":{"line":6,"column":30}},{"start":{"line":6,"column":34},"end":{"line":6,"column":48}},{"start":{"line":6,"column":52},"end":{"line":6,"column":74}},{"start":{"line":6,"column":78},"end":{"line":6,"column":124}}],"line":6},"1":{"loc":{"start":{"line":7,"column":26},"end":{"line":7,"column":113}},"type":"binary-expr","locations":[{"start":{"line":7,"column":26},"end":{"line":7,"column":35}},{"start":{"line":7,"column":41},"end":{"line":7,"column":53}},{"start":{"line":7,"column":57},"end":{"line":7,"column":103}},{"start":{"line":7,"column":108},"end":{"line":7,"column":112}}],"line":7},"2":{"loc":{"start":{"line":8,"column":32},"end":{"line":8,"column":131}},"type":"binary-expr","locations":[{"start":{"line":8,"column":32},"end":{"line":8,"column":41}},{"start":{"line":8,"column":47},"end":{"line":8,"column":59}},{"start":{"line":8,"column":63},"end":{"line":8,"column":115}},{"start":{"line":8,"column":120},"end":{"line":8,"column":130}}],"line":8},"3":{"loc":{"start":{"line":13,"column":2},"end":{"line":14,"column":44}},"type":"if","locations":[{"start":{"line":13,"column":2},"end":{"line":14,"column":44}},{"start":{"line":13,"column":2},"end":{"line":14,"column":44}}],"line":13},"4":{"loc":{"start":{"line":33,"column":38},"end":{"line":33,"column":73}},"type":"binary-expr","locations":[{"start":{"line":33,"column":38},"end":{"line":33,"column":53}},{"start":{"line":33,"column":57},"end":{"line":33,"column":73}}],"line":33},"5":{"loc":{"start":{"line":60,"column":55},"end":{"line":60,"column":80}},"type":"default-arg","locations":[{"start":{"line":60,"column":70},"end":{"line":60,"column":80}}],"line":60},"6":{"loc":{"start":{"line":145,"column":82},"end":{"line":145,"column":93}},"type":"default-arg","locations":[{"start":{"line":145,"column":92},"end":{"line":145,"column":93}}],"line":145},"7":{"loc":{"start":{"line":147,"column":2},"end":{"line":164,"column":3}},"type":"if","locations":[{"start":{"line":147,"column":2},"end":{"line":164,"column":3}},{"start":{"line":147,"column":2},"end":{"line":164,"column":3}}],"line":147},"8":{"loc":{"start":{"line":154,"column":9},"end":{"line":164,"column":3}},"type":"if","locations":[{"start":{"line":154,"column":9},"end":{"line":164,"column":3}},{"start":{"line":154,"column":9},"end":{"line":164,"column":3}}],"line":154},"9":{"loc":{"start":{"line":154,"column":13},"end":{"line":154,"column":87}},"type":"binary-expr","locations":[{"start":{"line":154,"column":13},"end":{"line":154,"column":50}},{"start":{"line":154,"column":54},"end":{"line":154,"column":87}}],"line":154},"10":{"loc":{"start":{"line":181,"column":6},"end":{"line":183,"column":7}},"type":"if","locations":[{"start":{"line":181,"column":6},"end":{"line":183,"column":7}},{"start":{"line":181,"column":6},"end":{"line":183,"column":7}}],"line":181},"11":{"loc":{"start":{"line":187,"column":8},"end":{"line":187,"column":70}},"type":"if","locations":[{"start":{"line":187,"column":8},"end":{"line":187,"column":70}},{"start":{"line":187,"column":8},"end":{"line":187,"column":70}}],"line":187},"12":{"loc":{"start":{"line":190,"column":8},"end":{"line":208,"column":9}},"type":"if","locations":[{"start":{"line":190,"column":8},"end":{"line":208,"column":9}},{"start":{"line":190,"column":8},"end":{"line":208,"column":9}}],"line":190},"13":{"loc":{"start":{"line":191,"column":10},"end":{"line":193,"column":11}},"type":"if","locations":[{"start":{"line":191,"column":10},"end":{"line":193,"column":11}},{"start":{"line":191,"column":10},"end":{"line":193,"column":11}}],"line":191},"14":{"loc":{"start":{"line":200,"column":12},"end":{"line":202,"column":13}},"type":"if","locations":[{"start":{"line":200,"column":12},"end":{"line":202,"column":13}},{"start":{"line":200,"column":12},"end":{"line":202,"column":13}}],"line":200},"15":{"loc":{"start":{"line":204,"column":15},"end":{"line":208,"column":9}},"type":"if","locations":[{"start":{"line":204,"column":15},"end":{"line":208,"column":9}},{"start":{"line":204,"column":15},"end":{"line":208,"column":9}}],"line":204},"16":{"loc":{"start":{"line":228,"column":23},"end":{"line":228,"column":108}},"type":"binary-expr","locations":[{"start":{"line":228,"column":23},"end":{"line":228,"column":49}},{"start":{"line":228,"column":54},"end":{"line":228,"column":78}},{"start":{"line":228,"column":82},"end":{"line":228,"column":107}}],"line":228},"17":{"loc":{"start":{"line":233,"column":2},"end":{"line":245,"column":3}},"type":"if","locations":[{"start":{"line":233,"column":2},"end":{"line":245,"column":3}},{"start":{"line":233,"column":2},"end":{"line":245,"column":3}}],"line":233},"18":{"loc":{"start":{"line":235,"column":4},"end":{"line":241,"column":5}},"type":"if","locations":[{"start":{"line":235,"column":4},"end":{"line":241,"column":5}},{"start":{"line":235,"column":4},"end":{"line":241,"column":5}}],"line":235},"19":{"loc":{"start":{"line":265,"column":2},"end":{"line":271,"column":3}},"type":"if","locations":[{"start":{"line":265,"column":2},"end":{"line":271,"column":3}},{"start":{"line":265,"column":2},"end":{"line":271,"column":3}}],"line":265},"20":{"loc":{"start":{"line":265,"column":6},"end":{"line":265,"column":48}},"type":"binary-expr","locations":[{"start":{"line":265,"column":6},"end":{"line":265,"column":25}},{"start":{"line":265,"column":29},"end":{"line":265,"column":48}}],"line":265},"21":{"loc":{"start":{"line":274,"column":2},"end":{"line":298,"column":3}},"type":"switch","locations":[{"start":{"line":275,"column":4},"end":{"line":277,"column":11}},{"start":{"line":278,"column":4},"end":{"line":280,"column":11}},{"start":{"line":281,"column":4},"end":{"line":283,"column":11}},{"start":{"line":284,"column":4},"end":{"line":286,"column":11}},{"start":{"line":287,"column":4},"end":{"line":289,"column":11}},{"start":{"line":290,"column":4},"end":{"line":292,"column":11}},{"start":{"line":293,"column":4},"end":{"line":295,"column":11}},{"start":{"line":296,"column":4},"end":{"line":297,"column":11}}],"line":274},"22":{"loc":{"start":{"line":319,"column":4},"end":{"line":321,"column":5}},"type":"if","locations":[{"start":{"line":319,"column":4},"end":{"line":321,"column":5}},{"start":{"line":319,"column":4},"end":{"line":321,"column":5}}],"line":319},"23":{"loc":{"start":{"line":345,"column":0},"end":{"line":352,"column":1}},"type":"if","locations":[{"start":{"line":345,"column":0},"end":{"line":352,"column":1}},{"start":{"line":345,"column":0},"end":{"line":352,"column":1}}],"line":345},"24":{"loc":{"start":{"line":347,"column":21},"end":{"line":351,"column":3}},"type":"binary-expr","locations":[{"start":{"line":347,"column":21},"end":{"line":347,"column":37}},{"start":{"line":347,"column":41},"end":{"line":351,"column":3}}],"line":347},"25":{"loc":{"start":{"line":348,"column":11},"end":{"line":350,"column":33}},"type":"binary-expr","locations":[{"start":{"line":348,"column":11},"end":{"line":348,"column":36}},{"start":{"line":349,"column":6},"end":{"line":349,"column":21}},{"start":{"line":350,"column":6},"end":{"line":350,"column":33}}],"line":348}},"s":{"0":1,"1":1,"2":1,"3":1,"4":6,"5":5,"6":1,"7":1,"8":1,"9":1,"10":1,"11":1,"12":1,"13":1,"14":15,"15":15,"16":15,"17":15,"18":15,"19":0,"20":15,"21":9,"22":9,"23":9,"24":9,"25":9,"26":9,"27":9,"28":11249118,"29":9,"30":9,"31":9,"32":9,"33":15,"34":15,"35":15,"36":15,"37":15,"38":0,"39":15,"40":14,"41":14,"42":14,"43":13,"44":13,"45":13,"46":13,"47":13,"48":13,"49":9,"50":3,"51":3,"52":3,"53":3,"54":3,"55":3,"56":6,"57":0,"58":0,"59":0,"60":6,"61":6,"62":9,"63":1,"64":1,"65":1,"66":1,"67":1,"68":1,"69":0,"70":0,"71":0,"72":0,"73":0,"74":0,"75":0,"76":0,"77":0,"78":0,"79":0,"80":0,"81":0,"82":0,"83":0,"84":0,"85":0,"86":0,"87":0,"88":0,"89":0,"90":0,"91":1,"92":0,"93":1,"94":6,"95":6,"96":6,"97":6,"98":6,"99":6,"100":4,"101":4,"102":2,"103":2,"104":2,"105":2,"106":4,"107":4,"108":6,"109":6,"110":6,"111":6,"112":6,"113":0,"114":0,"115":6,"116":6,"117":6,"118":0,"119":0,"120":0,"121":0,"122":0,"123":0,"124":0,"125":0,"126":0,"127":0,"128":0,"129":0,"130":0,"131":0,"132":6,"133":6,"134":6,"135":6,"136":26,"137":26,"138":0,"139":0,"140":0,"141":26,"142":26,"143":26,"144":26,"145":26,"146":18,"147":18,"148":1,"149":1,"150":0},"f":{"0":6,"1":15,"2":15,"3":15,"4":0,"5":9,"6":9,"7":15,"8":15,"9":15,"10":0,"11":14,"12":13,"13":9,"14":1,"15":1,"16":1,"17":0,"18":6,"19":6,"20":26,"21":18,"22":0},"b":{"0":[1,1,0,0],"1":[1,1,0,1],"2":[1,1,0,1],"3":[5,1],"4":[1,0],"5":[2],"6":[1],"7":[3,6],"8":[0,6],"9":[6,0],"10":[1,0],"11":[0,0],"12":[0,0],"13":[0,0],"14":[0,0],"15":[0,0],"16":[6,4,0],"17":[4,2],"18":[2,2],"19":[0,6],"20":[6,0],"21":[0,0,0,0,0,0,0,6],"22":[0,0],"23":[1,0],"24":[1,0],"25":[0,0,0]},"_coverageSchema":"1a1c01bbd47fc00a2c39e90264f33305004495a9","hash":"3cf308ec0fb37d1bd9933ad4d4604b361dabcf0d","contentHash":"2d33143e4ce5fd245e4fdd1a613bc688346c8a83ba681297c098462282394cf7"} +{"D:\\Projects\\browser-image-compression\\lib\\image-compression.js": {"path":"D:\\Projects\\browser-image-compression\\lib\\image-compression.js","statementMap":{"0":{"start":{"line":29,"column":17},"end":{"line":29,"column":33}},"1":{"start":{"line":32,"column":4},"end":{"line":32,"column":20}},"2":{"start":{"line":33,"column":4},"end":{"line":33,"column":48}},"3":{"start":{"line":37,"column":4},"end":{"line":37,"column":52}},"4":{"start":{"line":38,"column":4},"end":{"line":38,"column":33}},"5":{"start":{"line":41,"column":24},"end":{"line":41,"column":50}},"6":{"start":{"line":43,"column":22},"end":{"line":43,"column":53}},"7":{"start":{"line":45,"column":2},"end":{"line":45,"column":16}},"8":{"start":{"line":48,"column":25},"end":{"line":48,"column":53}},"9":{"start":{"line":50,"column":2},"end":{"line":50,"column":16}},"10":{"start":{"line":53,"column":38},"end":{"line":53,"column":81}},"11":{"start":{"line":55,"column":2},"end":{"line":55,"column":16}},"12":{"start":{"line":58,"column":26},"end":{"line":58,"column":83}},"13":{"start":{"line":59,"column":2},"end":{"line":59,"column":16}},"14":{"start":{"line":60,"column":33},"end":{"line":60,"column":169}},"15":{"start":{"line":61,"column":2},"end":{"line":61,"column":16}},"16":{"start":{"line":63,"column":16},"end":{"line":63,"column":45}},"17":{"start":{"line":65,"column":25},"end":{"line":65,"column":54}},"18":{"start":{"line":67,"column":19},"end":{"line":67,"column":116}},"19":{"start":{"line":68,"column":2},"end":{"line":68,"column":16}},"20":{"start":{"line":70,"column":28},"end":{"line":70,"column":55}},"21":{"start":{"line":71,"column":27},"end":{"line":71,"column":52}},"22":{"start":{"line":76,"column":2},"end":{"line":80,"column":3}},"23":{"start":{"line":78,"column":4},"end":{"line":78,"column":21}},"24":{"start":{"line":79,"column":4},"end":{"line":79,"column":20}},"25":{"start":{"line":82,"column":21},"end":{"line":82,"column":30}},"26":{"start":{"line":83,"column":23},"end":{"line":83,"column":36}},"27":{"start":{"line":84,"column":20},"end":{"line":84,"column":32}},"28":{"start":{"line":88,"column":15},"end":{"line":88,"column":37}},"29":{"start":{"line":89,"column":2},"end":{"line":109,"column":3}},"30":{"start":{"line":90,"column":21},"end":{"line":90,"column":75}},"31":{"start":{"line":91,"column":22},"end":{"line":91,"column":78}},"32":{"start":{"line":94,"column":4},"end":{"line":94,"column":63}},"33":{"start":{"line":96,"column":4},"end":{"line":96,"column":53}},"34":{"start":{"line":98,"column":4},"end":{"line":98,"column":20}},"35":{"start":{"line":100,"column":4},"end":{"line":100,"column":106}},"36":{"start":{"line":102,"column":4},"end":{"line":102,"column":32}},"37":{"start":{"line":104,"column":4},"end":{"line":104,"column":23}},"38":{"start":{"line":106,"column":4},"end":{"line":106,"column":38}},"39":{"start":{"line":108,"column":4},"end":{"line":108,"column":111}},"40":{"start":{"line":111,"column":2},"end":{"line":111,"column":30}},"41":{"start":{"line":112,"column":2},"end":{"line":112,"column":33}},"42":{"start":{"line":113,"column":2},"end":{"line":113,"column":51}},"43":{"start":{"line":114,"column":2},"end":{"line":114,"column":46}},"44":{"start":{"line":115,"column":2},"end":{"line":115,"column":34}},"45":{"start":{"line":117,"column":2},"end":{"line":117,"column":19}},"46":{"start":{"line":118,"column":2},"end":{"line":118,"column":24}}},"fnMap":{"0":{"name":"compress","decl":{"start":{"line":28,"column":30},"end":{"line":28,"column":38}},"loc":{"start":{"line":28,"column":76},"end":{"line":119,"column":1}},"line":28},"1":{"name":"incProgress","decl":{"start":{"line":31,"column":11},"end":{"line":31,"column":22}},"loc":{"start":{"line":31,"column":32},"end":{"line":34,"column":3}},"line":31},"2":{"name":"setProgress","decl":{"start":{"line":36,"column":11},"end":{"line":36,"column":22}},"loc":{"start":{"line":36,"column":26},"end":{"line":39,"column":3}},"line":36}},"branchMap":{"0":{"loc":{"start":{"line":28,"column":54},"end":{"line":28,"column":74}},"type":"default-arg","locations":[{"start":{"line":28,"column":73},"end":{"line":28,"column":74}}],"line":28},"1":{"loc":{"start":{"line":31,"column":23},"end":{"line":31,"column":30}},"type":"default-arg","locations":[{"start":{"line":31,"column":29},"end":{"line":31,"column":30}}],"line":31},"2":{"loc":{"start":{"line":41,"column":24},"end":{"line":41,"column":50}},"type":"binary-expr","locations":[{"start":{"line":41,"column":24},"end":{"line":41,"column":44}},{"start":{"line":41,"column":48},"end":{"line":41,"column":50}}],"line":41},"3":{"loc":{"start":{"line":58,"column":26},"end":{"line":58,"column":83}},"type":"binary-expr","locations":[{"start":{"line":58,"column":26},"end":{"line":58,"column":49}},{"start":{"line":58,"column":53},"end":{"line":58,"column":83}}],"line":58},"4":{"loc":{"start":{"line":60,"column":33},"end":{"line":60,"column":169}},"type":"cond-expr","locations":[{"start":{"line":60,"column":72},"end":{"line":60,"column":99}},{"start":{"line":60,"column":102},"end":{"line":60,"column":169}}],"line":60},"5":{"loc":{"start":{"line":63,"column":16},"end":{"line":63,"column":45}},"type":"binary-expr","locations":[{"start":{"line":63,"column":16},"end":{"line":63,"column":38}},{"start":{"line":63,"column":42},"end":{"line":63,"column":45}}],"line":63},"6":{"loc":{"start":{"line":65,"column":25},"end":{"line":65,"column":54}},"type":"binary-expr","locations":[{"start":{"line":65,"column":25},"end":{"line":65,"column":41}},{"start":{"line":65,"column":45},"end":{"line":65,"column":54}}],"line":65},"7":{"loc":{"start":{"line":76,"column":2},"end":{"line":80,"column":3}},"type":"if","locations":[{"start":{"line":76,"column":2},"end":{"line":80,"column":3}},{"start":{"line":76,"column":2},"end":{"line":80,"column":3}}],"line":76},"8":{"loc":{"start":{"line":76,"column":6},"end":{"line":76,"column":45}},"type":"binary-expr","locations":[{"start":{"line":76,"column":6},"end":{"line":76,"column":24}},{"start":{"line":76,"column":28},"end":{"line":76,"column":45}}],"line":76},"9":{"loc":{"start":{"line":89,"column":9},"end":{"line":89,"column":85}},"type":"binary-expr","locations":[{"start":{"line":89,"column":9},"end":{"line":89,"column":26}},{"start":{"line":89,"column":31},"end":{"line":89,"column":56}},{"start":{"line":89,"column":60},"end":{"line":89,"column":84}}],"line":89},"10":{"loc":{"start":{"line":90,"column":21},"end":{"line":90,"column":75}},"type":"cond-expr","locations":[{"start":{"line":90,"column":41},"end":{"line":90,"column":60}},{"start":{"line":90,"column":63},"end":{"line":90,"column":75}}],"line":90},"11":{"loc":{"start":{"line":91,"column":22},"end":{"line":91,"column":78}},"type":"cond-expr","locations":[{"start":{"line":91,"column":42},"end":{"line":91,"column":62}},{"start":{"line":91,"column":65},"end":{"line":91,"column":78}}],"line":91}},"s":{"0":6,"1":36,"2":36,"3":8,"4":8,"5":6,"6":6,"7":6,"8":6,"9":6,"10":6,"11":6,"12":6,"13":6,"14":6,"15":6,"16":6,"17":6,"18":6,"19":6,"20":6,"21":6,"22":6,"23":5,"24":5,"25":1,"26":1,"27":1,"28":1,"29":1,"30":2,"31":2,"32":2,"33":2,"34":2,"35":2,"36":2,"37":2,"38":2,"39":2,"40":1,"41":1,"42":1,"43":1,"44":1,"45":1,"46":1},"f":{"0":6,"1":36,"2":8},"b":{"0":[6],"1":[36],"2":[6,6],"3":[6,0],"4":[0,6],"5":[6,6],"6":[6,6],"7":[5,1],"8":[6,5],"9":[3,3,1],"10":[2,0],"11":[2,0]},"_coverageSchema":"1a1c01bbd47fc00a2c39e90264f33305004495a9","hash":"a1392aaafac18f8a642b9c2acc0a14226071ff38","contentHash":"bcff49e84e51c75d60b369064fced01917b550f3b0b2c6b227747b885b47e07b"} +,"D:\\Projects\\browser-image-compression\\lib\\index.js": {"path":"D:\\Projects\\browser-image-compression\\lib\\index.js","statementMap":{"0":{"start":{"line":38,"column":15},"end":{"line":38,"column":29}},"1":{"start":{"line":41,"column":17},"end":{"line":41,"column":18}},"2":{"start":{"line":42,"column":25},"end":{"line":42,"column":29}},"3":{"start":{"line":44,"column":2},"end":{"line":44,"column":62}},"4":{"start":{"line":45,"column":23},"end":{"line":45,"column":88}},"5":{"start":{"line":46,"column":2},"end":{"line":46,"column":27}},"6":{"start":{"line":47,"column":2},"end":{"line":52,"column":4}},"7":{"start":{"line":48,"column":4},"end":{"line":48,"column":25}},"8":{"start":{"line":49,"column":4},"end":{"line":51,"column":5}},"9":{"start":{"line":50,"column":6},"end":{"line":50,"column":27}},"10":{"start":{"line":54,"column":2},"end":{"line":58,"column":3}},"11":{"start":{"line":55,"column":4},"end":{"line":55,"column":73}},"12":{"start":{"line":56,"column":9},"end":{"line":58,"column":3}},"13":{"start":{"line":57,"column":4},"end":{"line":57,"column":54}},"14":{"start":{"line":62,"column":22},"end":{"line":62,"column":99}},"15":{"start":{"line":70,"column":2},"end":{"line":80,"column":3}},"16":{"start":{"line":71,"column":4},"end":{"line":77,"column":5}},"17":{"start":{"line":73,"column":6},"end":{"line":73,"column":61}},"18":{"start":{"line":76,"column":6},"end":{"line":76,"column":50}},"19":{"start":{"line":79,"column":4},"end":{"line":79,"column":48}},"20":{"start":{"line":82,"column":2},"end":{"line":86,"column":16}},"21":{"start":{"line":83,"column":4},"end":{"line":83,"column":36}},"22":{"start":{"line":84,"column":4},"end":{"line":84,"column":52}},"23":{"start":{"line":88,"column":2},"end":{"line":88,"column":24}},"24":{"start":{"line":91,"column":0},"end":{"line":91,"column":57}},"25":{"start":{"line":92,"column":0},"end":{"line":92,"column":57}},"26":{"start":{"line":93,"column":0},"end":{"line":93,"column":39}},"27":{"start":{"line":94,"column":0},"end":{"line":94,"column":55}},"28":{"start":{"line":95,"column":0},"end":{"line":95,"column":53}},"29":{"start":{"line":96,"column":0},"end":{"line":96,"column":45}},"30":{"start":{"line":97,"column":0},"end":{"line":97,"column":57}},"31":{"start":{"line":99,"column":0},"end":{"line":99,"column":65}},"32":{"start":{"line":100,"column":0},"end":{"line":100,"column":63}},"33":{"start":{"line":101,"column":0},"end":{"line":101,"column":59}},"34":{"start":{"line":102,"column":0},"end":{"line":102,"column":73}},"35":{"start":{"line":103,"column":0},"end":{"line":103,"column":105}},"36":{"start":{"line":104,"column":0},"end":{"line":104,"column":49}},"37":{"start":{"line":105,"column":0},"end":{"line":105,"column":36}}},"fnMap":{"0":{"name":"imageCompression","decl":{"start":{"line":37,"column":15},"end":{"line":37,"column":31}},"loc":{"start":{"line":37,"column":47},"end":{"line":89,"column":1}},"line":37},"1":{"name":"(anonymous_1)","decl":{"start":{"line":47,"column":20},"end":{"line":47,"column":21}},"loc":{"start":{"line":47,"column":35},"end":{"line":52,"column":3}},"line":47}},"branchMap":{"0":{"loc":{"start":{"line":44,"column":19},"end":{"line":44,"column":61}},"type":"binary-expr","locations":[{"start":{"line":44,"column":19},"end":{"line":44,"column":33}},{"start":{"line":44,"column":37},"end":{"line":44,"column":61}}],"line":44},"1":{"loc":{"start":{"line":45,"column":23},"end":{"line":45,"column":88}},"type":"cond-expr","locations":[{"start":{"line":45,"column":64},"end":{"line":45,"column":81}},{"start":{"line":45,"column":84},"end":{"line":45,"column":88}}],"line":45},"2":{"loc":{"start":{"line":49,"column":4},"end":{"line":51,"column":5}},"type":"if","locations":[{"start":{"line":49,"column":4},"end":{"line":51,"column":5}},{"start":{"line":49,"column":4},"end":{"line":51,"column":5}}],"line":49},"3":{"loc":{"start":{"line":54,"column":2},"end":{"line":58,"column":3}},"type":"if","locations":[{"start":{"line":54,"column":2},"end":{"line":58,"column":3}},{"start":{"line":54,"column":2},"end":{"line":58,"column":3}}],"line":54},"4":{"loc":{"start":{"line":54,"column":8},"end":{"line":54,"column":58}},"type":"binary-expr","locations":[{"start":{"line":54,"column":8},"end":{"line":54,"column":28}},{"start":{"line":54,"column":32},"end":{"line":54,"column":58}}],"line":54},"5":{"loc":{"start":{"line":56,"column":9},"end":{"line":58,"column":3}},"type":"if","locations":[{"start":{"line":56,"column":9},"end":{"line":58,"column":3}},{"start":{"line":56,"column":9},"end":{"line":58,"column":3}}],"line":56},"6":{"loc":{"start":{"line":62,"column":22},"end":{"line":62,"column":99}},"type":"binary-expr","locations":[{"start":{"line":62,"column":22},"end":{"line":62,"column":62}},{"start":{"line":62,"column":66},"end":{"line":62,"column":99}}],"line":62},"7":{"loc":{"start":{"line":70,"column":2},"end":{"line":80,"column":3}},"type":"if","locations":[{"start":{"line":70,"column":2},"end":{"line":80,"column":3}},{"start":{"line":70,"column":2},"end":{"line":80,"column":3}}],"line":70},"8":{"loc":{"start":{"line":70,"column":6},"end":{"line":70,"column":66}},"type":"binary-expr","locations":[{"start":{"line":70,"column":6},"end":{"line":70,"column":18}},{"start":{"line":70,"column":22},"end":{"line":70,"column":50}},{"start":{"line":70,"column":54},"end":{"line":70,"column":66}}],"line":70}},"s":{"0":9,"1":9,"2":9,"3":9,"4":9,"5":9,"6":9,"7":44,"8":44,"9":0,"10":9,"11":2,"12":7,"13":1,"14":6,"15":6,"16":0,"17":0,"18":0,"19":6,"20":6,"21":6,"22":6,"23":6,"24":1,"25":1,"26":1,"27":1,"28":1,"29":1,"30":1,"31":1,"32":1,"33":1,"34":1,"35":1,"36":1,"37":1},"f":{"0":9,"1":44},"b":{"0":[9,2],"1":[9,0],"2":[0,44],"3":[2,7],"4":[9,2],"5":[1,6],"6":[6,0],"7":[0,6],"8":[6,0,0]},"_coverageSchema":"1a1c01bbd47fc00a2c39e90264f33305004495a9","hash":"301b8b93b11906487323dc201af153d2a366678e","contentHash":"0a36de5ea753f4621658c7eb9ba4cb380f6546be0420ec76978ce242654a4551"} +,"D:\\Projects\\browser-image-compression\\lib\\polyfill.js": {"path":"D:\\Projects\\browser-image-compression\\lib\\polyfill.js","statementMap":{},"fnMap":{},"branchMap":{},"s":{},"f":{},"b":{},"_coverageSchema":"1a1c01bbd47fc00a2c39e90264f33305004495a9","hash":"429e9ae55e921fbb055dbd07a45c33747b0258ad","contentHash":"7eddf6e9aeec4e202e5de464152cb8bbe5b3b10f68fc9d434b70f9b921e3eb1e"} +,"D:\\Projects\\browser-image-compression\\lib\\utils.js": {"path":"D:\\Projects\\browser-image-compression\\lib\\utils.js","statementMap":{"0":{"start":{"line":4,"column":18},"end":{"line":4,"column":47}},"1":{"start":{"line":7,"column":21},"end":{"line":7,"column":124}},"2":{"start":{"line":8,"column":26},"end":{"line":8,"column":153}},"3":{"start":{"line":9,"column":32},"end":{"line":9,"column":177}},"4":{"start":{"line":20,"column":2},"end":{"line":46,"column":5}},"5":{"start":{"line":21,"column":16},"end":{"line":21,"column":34}},"6":{"start":{"line":22,"column":17},"end":{"line":22,"column":43}},"7":{"start":{"line":23,"column":17},"end":{"line":23,"column":40}},"8":{"start":{"line":24,"column":12},"end":{"line":24,"column":23}},"9":{"start":{"line":25,"column":18},"end":{"line":25,"column":35}},"10":{"start":{"line":26,"column":4},"end":{"line":28,"column":5}},"11":{"start":{"line":27,"column":6},"end":{"line":27,"column":36}},"12":{"start":{"line":29,"column":17},"end":{"line":29,"column":50}},"13":{"start":{"line":30,"column":4},"end":{"line":30,"column":25}},"14":{"start":{"line":31,"column":4},"end":{"line":31,"column":37}},"15":{"start":{"line":32,"column":4},"end":{"line":32,"column":18}},"16":{"start":{"line":56,"column":2},"end":{"line":61,"column":5}},"17":{"start":{"line":57,"column":19},"end":{"line":57,"column":41}},"18":{"start":{"line":58,"column":4},"end":{"line":58,"column":49}},"19":{"start":{"line":58,"column":26},"end":{"line":58,"column":48}},"20":{"start":{"line":59,"column":4},"end":{"line":59,"column":38}},"21":{"start":{"line":59,"column":28},"end":{"line":59,"column":37}},"22":{"start":{"line":60,"column":4},"end":{"line":60,"column":31}},"23":{"start":{"line":71,"column":2},"end":{"line":76,"column":5}},"24":{"start":{"line":72,"column":16},"end":{"line":72,"column":27}},"25":{"start":{"line":73,"column":4},"end":{"line":73,"column":36}},"26":{"start":{"line":73,"column":23},"end":{"line":73,"column":35}},"27":{"start":{"line":74,"column":4},"end":{"line":74,"column":35}},"28":{"start":{"line":74,"column":25},"end":{"line":74,"column":34}},"29":{"start":{"line":75,"column":4},"end":{"line":75,"column":18}},"30":{"start":{"line":89,"column":20},"end":{"line":89,"column":25}},"31":{"start":{"line":90,"column":2},"end":{"line":92,"column":3}},"32":{"start":{"line":91,"column":4},"end":{"line":91,"column":27}},"33":{"start":{"line":92,"column":4},"end":{"line":98,"column":3}},"34":{"start":{"line":93,"column":4},"end":{"line":93,"column":27}},"35":{"start":{"line":94,"column":9},"end":{"line":98,"column":3}},"36":{"start":{"line":95,"column":4},"end":{"line":95,"column":28}},"37":{"start":{"line":96,"column":9},"end":{"line":98,"column":3}},"38":{"start":{"line":97,"column":4},"end":{"line":97,"column":38}},"39":{"start":{"line":99,"column":2},"end":{"line":99,"column":21}},"40":{"start":{"line":114,"column":22},"end":{"line":114,"column":38}},"41":{"start":{"line":115,"column":28},"end":{"line":115,"column":54}},"42":{"start":{"line":117,"column":14},"end":{"line":117,"column":23}},"43":{"start":{"line":118,"column":15},"end":{"line":118,"column":25}},"44":{"start":{"line":119,"column":13},"end":{"line":119,"column":27}},"45":{"start":{"line":120,"column":16},"end":{"line":120,"column":64}},"46":{"start":{"line":122,"column":2},"end":{"line":134,"column":3}},"47":{"start":{"line":123,"column":26},"end":{"line":123,"column":57}},"48":{"start":{"line":124,"column":27},"end":{"line":124,"column":59}},"49":{"start":{"line":125,"column":4},"end":{"line":131,"column":5}},"50":{"start":{"line":126,"column":6},"end":{"line":126,"column":30}},"51":{"start":{"line":127,"column":6},"end":{"line":127,"column":37}},"52":{"start":{"line":129,"column":6},"end":{"line":129,"column":37}},"53":{"start":{"line":130,"column":6},"end":{"line":130,"column":28}},"54":{"start":{"line":133,"column":4},"end":{"line":133,"column":26}},"55":{"start":{"line":136,"column":2},"end":{"line":138,"column":4}},"56":{"start":{"line":150,"column":2},"end":{"line":159,"column":3}},"57":{"start":{"line":151,"column":4},"end":{"line":151,"column":48}},"58":{"start":{"line":152,"column":4},"end":{"line":152,"column":34}},"59":{"start":{"line":153,"column":4},"end":{"line":155,"column":5}},"60":{"start":{"line":154,"column":6},"end":{"line":154,"column":68}},"61":{"start":{"line":157,"column":4},"end":{"line":157,"column":46}},"62":{"start":{"line":158,"column":4},"end":{"line":158,"column":34}},"63":{"start":{"line":160,"column":2},"end":{"line":160,"column":23}},"64":{"start":{"line":161,"column":2},"end":{"line":161,"column":25}},"65":{"start":{"line":164,"column":2},"end":{"line":164,"column":23}},"66":{"start":{"line":174,"column":28},"end":{"line":174,"column":93}},"67":{"start":{"line":175,"column":24},"end":{"line":175,"column":57}},"68":{"start":{"line":176,"column":2},"end":{"line":176,"column":56}},"69":{"start":{"line":177,"column":2},"end":{"line":177,"column":16}},"70":{"start":{"line":188,"column":2},"end":{"line":193,"column":3}},"71":{"start":{"line":189,"column":4},"end":{"line":189,"column":40}},"72":{"start":{"line":191,"column":20},"end":{"line":191,"column":50}},"73":{"start":{"line":192,"column":4},"end":{"line":192,"column":35}},"74":{"start":{"line":194,"column":17},"end":{"line":194,"column":39}},"75":{"start":{"line":195,"column":2},"end":{"line":195,"column":23}},"76":{"start":{"line":210,"column":2},"end":{"line":227,"column":3}},"77":{"start":{"line":211,"column":16},"end":{"line":211,"column":39}},"78":{"start":{"line":212,"column":21},"end":{"line":212,"column":72}},"79":{"start":{"line":213,"column":16},"end":{"line":213,"column":79}},"80":{"start":{"line":214,"column":4},"end":{"line":214,"column":47}},"81":{"start":{"line":215,"column":4},"end":{"line":215,"column":25}},"82":{"start":{"line":216,"column":4},"end":{"line":216,"column":41}},"83":{"start":{"line":217,"column":9},"end":{"line":227,"column":3}},"84":{"start":{"line":218,"column":4},"end":{"line":218,"column":67}},"85":{"start":{"line":219,"column":4},"end":{"line":219,"column":25}},"86":{"start":{"line":220,"column":4},"end":{"line":220,"column":41}},"87":{"start":{"line":225,"column":20},"end":{"line":225,"column":55}},"88":{"start":{"line":226,"column":4},"end":{"line":226,"column":73}},"89":{"start":{"line":228,"column":2},"end":{"line":228,"column":14}},"90":{"start":{"line":240,"column":2},"end":{"line":240,"column":19}},"91":{"start":{"line":242,"column":2},"end":{"line":242,"column":20}},"92":{"start":{"line":248,"column":2},"end":{"line":248,"column":96}},"93":{"start":{"line":248,"column":55},"end":{"line":248,"column":96}},"94":{"start":{"line":252,"column":23},"end":{"line":257,"column":65}},"95":{"start":{"line":258,"column":24},"end":{"line":258,"column":86}},"96":{"start":{"line":260,"column":26},"end":{"line":260,"column":68}},"97":{"start":{"line":261,"column":25},"end":{"line":261,"column":128}},"98":{"start":{"line":262,"column":2},"end":{"line":262,"column":39}},"99":{"start":{"line":263,"column":14},"end":{"line":263,"column":57}},"100":{"start":{"line":266,"column":2},"end":{"line":266,"column":74}},"101":{"start":{"line":267,"column":2},"end":{"line":267,"column":43}},"102":{"start":{"line":279,"column":2},"end":{"line":316,"column":5}},"103":{"start":{"line":280,"column":19},"end":{"line":280,"column":41}},"104":{"start":{"line":281,"column":4},"end":{"line":313,"column":6}},"105":{"start":{"line":282,"column":19},"end":{"line":282,"column":48}},"106":{"start":{"line":283,"column":6},"end":{"line":285,"column":7}},"107":{"start":{"line":284,"column":8},"end":{"line":284,"column":27}},"108":{"start":{"line":286,"column":21},"end":{"line":286,"column":36}},"109":{"start":{"line":287,"column":19},"end":{"line":287,"column":20}},"110":{"start":{"line":288,"column":6},"end":{"line":311,"column":7}},"111":{"start":{"line":289,"column":8},"end":{"line":289,"column":71}},"112":{"start":{"line":289,"column":52},"end":{"line":289,"column":71}},"113":{"start":{"line":290,"column":23},"end":{"line":290,"column":52}},"114":{"start":{"line":291,"column":8},"end":{"line":291,"column":20}},"115":{"start":{"line":292,"column":8},"end":{"line":310,"column":9}},"116":{"start":{"line":293,"column":10},"end":{"line":295,"column":11}},"117":{"start":{"line":294,"column":12},"end":{"line":294,"column":31}},"118":{"start":{"line":297,"column":25},"end":{"line":297,"column":69}},"119":{"start":{"line":298,"column":10},"end":{"line":298,"column":55}},"120":{"start":{"line":299,"column":23},"end":{"line":299,"column":53}},"121":{"start":{"line":300,"column":10},"end":{"line":300,"column":22}},"122":{"start":{"line":301,"column":10},"end":{"line":305,"column":11}},"123":{"start":{"line":301,"column":23},"end":{"line":301,"column":24}},"124":{"start":{"line":302,"column":12},"end":{"line":304,"column":13}},"125":{"start":{"line":303,"column":14},"end":{"line":303,"column":76}},"126":{"start":{"line":306,"column":15},"end":{"line":310,"column":9}},"127":{"start":{"line":307,"column":10},"end":{"line":307,"column":16}},"128":{"start":{"line":309,"column":10},"end":{"line":309,"column":50}},"129":{"start":{"line":312,"column":6},"end":{"line":312,"column":25}},"130":{"start":{"line":314,"column":4},"end":{"line":314,"column":38}},"131":{"start":{"line":314,"column":28},"end":{"line":314,"column":37}},"132":{"start":{"line":315,"column":4},"end":{"line":315,"column":35}},"133":{"start":{"line":326,"column":20},"end":{"line":326,"column":26}},"134":{"start":{"line":327,"column":21},"end":{"line":327,"column":27}},"135":{"start":{"line":328,"column":31},"end":{"line":328,"column":38}},"136":{"start":{"line":330,"column":23},"end":{"line":330,"column":108}},"137":{"start":{"line":332,"column":18},"end":{"line":332,"column":24}},"138":{"start":{"line":335,"column":2},"end":{"line":347,"column":3}},"139":{"start":{"line":336,"column":4},"end":{"line":336,"column":57}},"140":{"start":{"line":337,"column":4},"end":{"line":343,"column":5}},"141":{"start":{"line":338,"column":6},"end":{"line":338,"column":41}},"142":{"start":{"line":339,"column":6},"end":{"line":339,"column":61}},"143":{"start":{"line":341,"column":6},"end":{"line":341,"column":60}},"144":{"start":{"line":342,"column":6},"end":{"line":342,"column":42}},"145":{"start":{"line":344,"column":4},"end":{"line":344,"column":67}},"146":{"start":{"line":346,"column":4},"end":{"line":346,"column":32}},"147":{"start":{"line":349,"column":2},"end":{"line":349,"column":19}},"148":{"start":{"line":361,"column":20},"end":{"line":361,"column":26}},"149":{"start":{"line":362,"column":21},"end":{"line":362,"column":27}},"150":{"start":{"line":364,"column":27},"end":{"line":364,"column":60}},"151":{"start":{"line":367,"column":2},"end":{"line":373,"column":3}},"152":{"start":{"line":368,"column":4},"end":{"line":368,"column":29}},"153":{"start":{"line":369,"column":4},"end":{"line":369,"column":29}},"154":{"start":{"line":371,"column":4},"end":{"line":371,"column":28}},"155":{"start":{"line":372,"column":4},"end":{"line":372,"column":30}},"156":{"start":{"line":376,"column":2},"end":{"line":400,"column":3}},"157":{"start":{"line":378,"column":6},"end":{"line":378,"column":43}},"158":{"start":{"line":379,"column":6},"end":{"line":379,"column":12}},"159":{"start":{"line":381,"column":6},"end":{"line":381,"column":49}},"160":{"start":{"line":382,"column":6},"end":{"line":382,"column":12}},"161":{"start":{"line":384,"column":6},"end":{"line":384,"column":44}},"162":{"start":{"line":385,"column":6},"end":{"line":385,"column":12}},"163":{"start":{"line":387,"column":6},"end":{"line":387,"column":38}},"164":{"start":{"line":388,"column":6},"end":{"line":388,"column":12}},"165":{"start":{"line":390,"column":6},"end":{"line":390,"column":44}},"166":{"start":{"line":391,"column":6},"end":{"line":391,"column":12}},"167":{"start":{"line":393,"column":6},"end":{"line":393,"column":49}},"168":{"start":{"line":394,"column":6},"end":{"line":394,"column":12}},"169":{"start":{"line":396,"column":6},"end":{"line":396,"column":43}},"170":{"start":{"line":397,"column":6},"end":{"line":397,"column":12}},"171":{"start":{"line":399,"column":6},"end":{"line":399,"column":12}},"172":{"start":{"line":402,"column":2},"end":{"line":402,"column":45}},"173":{"start":{"line":404,"column":2},"end":{"line":404,"column":30}},"174":{"start":{"line":406,"column":2},"end":{"line":406,"column":19}}},"fnMap":{"0":{"name":"getFilefromDataUrl","decl":{"start":{"line":19,"column":16},"end":{"line":19,"column":34}},"loc":{"start":{"line":19,"column":81},"end":{"line":47,"column":1}},"line":19},"1":{"name":"(anonymous_1)","decl":{"start":{"line":20,"column":21},"end":{"line":20,"column":22}},"loc":{"start":{"line":20,"column":34},"end":{"line":46,"column":3}},"line":20},"2":{"name":"getDataUrlFromFile","decl":{"start":{"line":55,"column":16},"end":{"line":55,"column":34}},"loc":{"start":{"line":55,"column":41},"end":{"line":62,"column":1}},"line":55},"3":{"name":"(anonymous_3)","decl":{"start":{"line":56,"column":21},"end":{"line":56,"column":22}},"loc":{"start":{"line":56,"column":42},"end":{"line":61,"column":3}},"line":56},"4":{"name":"(anonymous_4)","decl":{"start":{"line":58,"column":20},"end":{"line":58,"column":21}},"loc":{"start":{"line":58,"column":26},"end":{"line":58,"column":48}},"line":58},"5":{"name":"(anonymous_5)","decl":{"start":{"line":59,"column":21},"end":{"line":59,"column":22}},"loc":{"start":{"line":59,"column":28},"end":{"line":59,"column":37}},"line":59},"6":{"name":"loadImage","decl":{"start":{"line":70,"column":16},"end":{"line":70,"column":25}},"loc":{"start":{"line":70,"column":31},"end":{"line":77,"column":1}},"line":70},"7":{"name":"(anonymous_7)","decl":{"start":{"line":71,"column":21},"end":{"line":71,"column":22}},"loc":{"start":{"line":71,"column":42},"end":{"line":76,"column":3}},"line":71},"8":{"name":"(anonymous_8)","decl":{"start":{"line":73,"column":17},"end":{"line":73,"column":18}},"loc":{"start":{"line":73,"column":23},"end":{"line":73,"column":35}},"line":73},"9":{"name":"(anonymous_9)","decl":{"start":{"line":74,"column":18},"end":{"line":74,"column":19}},"loc":{"start":{"line":74,"column":25},"end":{"line":74,"column":34}},"line":74},"10":{"name":"getBrowserName","decl":{"start":{"line":88,"column":16},"end":{"line":88,"column":30}},"loc":{"start":{"line":88,"column":33},"end":{"line":100,"column":1}},"line":88},"11":{"name":"approximateBelowMaximumCanvasSizeOfBrowser","decl":{"start":{"line":113,"column":16},"end":{"line":113,"column":58}},"loc":{"start":{"line":113,"column":82},"end":{"line":139,"column":1}},"line":113},"12":{"name":"getNewCanvasAndCtx","decl":{"start":{"line":147,"column":16},"end":{"line":147,"column":34}},"loc":{"start":{"line":147,"column":50},"end":{"line":165,"column":1}},"line":147},"13":{"name":"drawImageInCanvas","decl":{"start":{"line":173,"column":16},"end":{"line":173,"column":33}},"loc":{"start":{"line":173,"column":39},"end":{"line":178,"column":1}},"line":173},"14":{"name":"drawFileInCanvas","decl":{"start":{"line":186,"column":22},"end":{"line":186,"column":38}},"loc":{"start":{"line":186,"column":45},"end":{"line":196,"column":1}},"line":186},"15":{"name":"canvasToFile","decl":{"start":{"line":208,"column":22},"end":{"line":208,"column":34}},"loc":{"start":{"line":208,"column":94},"end":{"line":229,"column":1}},"line":208},"16":{"name":"cleanupCanvasMemory","decl":{"start":{"line":236,"column":16},"end":{"line":236,"column":35}},"loc":{"start":{"line":236,"column":44},"end":{"line":243,"column":1}},"line":236},"17":{"name":"isAutoOrientationInBrowser","decl":{"start":{"line":247,"column":22},"end":{"line":247,"column":48}},"loc":{"start":{"line":247,"column":51},"end":{"line":268,"column":1}},"line":247},"18":{"name":"getExifOrientation","decl":{"start":{"line":278,"column":16},"end":{"line":278,"column":34}},"loc":{"start":{"line":278,"column":41},"end":{"line":317,"column":1}},"line":278},"19":{"name":"(anonymous_19)","decl":{"start":{"line":279,"column":21},"end":{"line":279,"column":22}},"loc":{"start":{"line":279,"column":42},"end":{"line":316,"column":3}},"line":279},"20":{"name":"(anonymous_20)","decl":{"start":{"line":281,"column":20},"end":{"line":281,"column":21}},"loc":{"start":{"line":281,"column":27},"end":{"line":313,"column":5}},"line":281},"21":{"name":"(anonymous_21)","decl":{"start":{"line":314,"column":21},"end":{"line":314,"column":22}},"loc":{"start":{"line":314,"column":28},"end":{"line":314,"column":37}},"line":314},"22":{"name":"handleMaxWidthOrHeight","decl":{"start":{"line":325,"column":16},"end":{"line":325,"column":38}},"loc":{"start":{"line":325,"column":56},"end":{"line":350,"column":1}},"line":325},"23":{"name":"followExifOrientation","decl":{"start":{"line":360,"column":16},"end":{"line":360,"column":37}},"loc":{"start":{"line":360,"column":63},"end":{"line":407,"column":1}},"line":360}},"branchMap":{"0":{"loc":{"start":{"line":7,"column":21},"end":{"line":7,"column":124}},"type":"binary-expr","locations":[{"start":{"line":7,"column":21},"end":{"line":7,"column":30}},{"start":{"line":7,"column":34},"end":{"line":7,"column":48}},{"start":{"line":7,"column":52},"end":{"line":7,"column":74}},{"start":{"line":7,"column":78},"end":{"line":7,"column":124}}],"line":7},"1":{"loc":{"start":{"line":8,"column":26},"end":{"line":8,"column":153}},"type":"binary-expr","locations":[{"start":{"line":8,"column":26},"end":{"line":8,"column":35}},{"start":{"line":8,"column":41},"end":{"line":8,"column":53}},{"start":{"line":8,"column":57},"end":{"line":8,"column":103}},{"start":{"line":8,"column":109},"end":{"line":8,"column":143}},{"start":{"line":8,"column":147},"end":{"line":8,"column":151}}],"line":8},"2":{"loc":{"start":{"line":9,"column":32},"end":{"line":9,"column":177}},"type":"binary-expr","locations":[{"start":{"line":9,"column":32},"end":{"line":9,"column":41}},{"start":{"line":9,"column":47},"end":{"line":9,"column":59}},{"start":{"line":9,"column":63},"end":{"line":9,"column":115}},{"start":{"line":9,"column":121},"end":{"line":9,"column":161}},{"start":{"line":9,"column":165},"end":{"line":9,"column":175}}],"line":9},"3":{"loc":{"start":{"line":19,"column":54},"end":{"line":19,"column":79}},"type":"default-arg","locations":[{"start":{"line":19,"column":69},"end":{"line":19,"column":79}}],"line":19},"4":{"loc":{"start":{"line":90,"column":2},"end":{"line":92,"column":3}},"type":"if","locations":[{"start":{"line":90,"column":2},"end":{"line":92,"column":3}},{"start":{"line":90,"column":2},"end":{"line":92,"column":3}}],"line":90},"5":{"loc":{"start":{"line":90,"column":6},"end":{"line":90,"column":100}},"type":"binary-expr","locations":[{"start":{"line":90,"column":6},"end":{"line":90,"column":50}},{"start":{"line":90,"column":54},"end":{"line":90,"column":100}}],"line":90},"6":{"loc":{"start":{"line":92,"column":4},"end":{"line":98,"column":3}},"type":"if","locations":[{"start":{"line":92,"column":4},"end":{"line":98,"column":3}},{"start":{"line":92,"column":4},"end":{"line":98,"column":3}}],"line":92},"7":{"loc":{"start":{"line":94,"column":9},"end":{"line":98,"column":3}},"type":"if","locations":[{"start":{"line":94,"column":9},"end":{"line":98,"column":3}},{"start":{"line":94,"column":9},"end":{"line":98,"column":3}}],"line":94},"8":{"loc":{"start":{"line":96,"column":9},"end":{"line":98,"column":3}},"type":"if","locations":[{"start":{"line":96,"column":9},"end":{"line":98,"column":3}},{"start":{"line":96,"column":9},"end":{"line":98,"column":3}}],"line":96},"9":{"loc":{"start":{"line":96,"column":13},"end":{"line":96,"column":95}},"type":"binary-expr","locations":[{"start":{"line":96,"column":14},"end":{"line":96,"column":56}},{"start":{"line":96,"column":62},"end":{"line":96,"column":94}}],"line":96},"10":{"loc":{"start":{"line":120,"column":16},"end":{"line":120,"column":64}},"type":"cond-expr","locations":[{"start":{"line":120,"column":33},"end":{"line":120,"column":47}},{"start":{"line":120,"column":50},"end":{"line":120,"column":64}}],"line":120},"11":{"loc":{"start":{"line":125,"column":4},"end":{"line":131,"column":5}},"type":"if","locations":[{"start":{"line":125,"column":4},"end":{"line":131,"column":5}},{"start":{"line":125,"column":4},"end":{"line":131,"column":5}}],"line":125},"12":{"loc":{"start":{"line":153,"column":4},"end":{"line":155,"column":5}},"type":"if","locations":[{"start":{"line":153,"column":4},"end":{"line":155,"column":5}},{"start":{"line":153,"column":4},"end":{"line":155,"column":5}}],"line":153},"13":{"loc":{"start":{"line":208,"column":81},"end":{"line":208,"column":92}},"type":"default-arg","locations":[{"start":{"line":208,"column":91},"end":{"line":208,"column":92}}],"line":208},"14":{"loc":{"start":{"line":210,"column":2},"end":{"line":227,"column":3}},"type":"if","locations":[{"start":{"line":210,"column":2},"end":{"line":227,"column":3}},{"start":{"line":210,"column":2},"end":{"line":227,"column":3}}],"line":210},"15":{"loc":{"start":{"line":217,"column":9},"end":{"line":227,"column":3}},"type":"if","locations":[{"start":{"line":217,"column":9},"end":{"line":227,"column":3}},{"start":{"line":217,"column":9},"end":{"line":227,"column":3}}],"line":217},"16":{"loc":{"start":{"line":217,"column":13},"end":{"line":217,"column":87}},"type":"binary-expr","locations":[{"start":{"line":217,"column":13},"end":{"line":217,"column":50}},{"start":{"line":217,"column":54},"end":{"line":217,"column":87}}],"line":217},"17":{"loc":{"start":{"line":248,"column":2},"end":{"line":248,"column":96}},"type":"if","locations":[{"start":{"line":248,"column":2},"end":{"line":248,"column":96}},{"start":{"line":248,"column":2},"end":{"line":248,"column":96}}],"line":248},"18":{"loc":{"start":{"line":266,"column":38},"end":{"line":266,"column":73}},"type":"binary-expr","locations":[{"start":{"line":266,"column":38},"end":{"line":266,"column":53}},{"start":{"line":266,"column":57},"end":{"line":266,"column":73}}],"line":266},"19":{"loc":{"start":{"line":283,"column":6},"end":{"line":285,"column":7}},"type":"if","locations":[{"start":{"line":283,"column":6},"end":{"line":285,"column":7}},{"start":{"line":283,"column":6},"end":{"line":285,"column":7}}],"line":283},"20":{"loc":{"start":{"line":289,"column":8},"end":{"line":289,"column":71}},"type":"if","locations":[{"start":{"line":289,"column":8},"end":{"line":289,"column":71}},{"start":{"line":289,"column":8},"end":{"line":289,"column":71}}],"line":289},"21":{"loc":{"start":{"line":292,"column":8},"end":{"line":310,"column":9}},"type":"if","locations":[{"start":{"line":292,"column":8},"end":{"line":310,"column":9}},{"start":{"line":292,"column":8},"end":{"line":310,"column":9}}],"line":292},"22":{"loc":{"start":{"line":293,"column":10},"end":{"line":295,"column":11}},"type":"if","locations":[{"start":{"line":293,"column":10},"end":{"line":295,"column":11}},{"start":{"line":293,"column":10},"end":{"line":295,"column":11}}],"line":293},"23":{"loc":{"start":{"line":302,"column":12},"end":{"line":304,"column":13}},"type":"if","locations":[{"start":{"line":302,"column":12},"end":{"line":304,"column":13}},{"start":{"line":302,"column":12},"end":{"line":304,"column":13}}],"line":302},"24":{"loc":{"start":{"line":306,"column":15},"end":{"line":310,"column":9}},"type":"if","locations":[{"start":{"line":306,"column":15},"end":{"line":310,"column":9}},{"start":{"line":306,"column":15},"end":{"line":310,"column":9}}],"line":306},"25":{"loc":{"start":{"line":330,"column":23},"end":{"line":330,"column":108}},"type":"binary-expr","locations":[{"start":{"line":330,"column":23},"end":{"line":330,"column":49}},{"start":{"line":330,"column":54},"end":{"line":330,"column":78}},{"start":{"line":330,"column":82},"end":{"line":330,"column":107}}],"line":330},"26":{"loc":{"start":{"line":335,"column":2},"end":{"line":347,"column":3}},"type":"if","locations":[{"start":{"line":335,"column":2},"end":{"line":347,"column":3}},{"start":{"line":335,"column":2},"end":{"line":347,"column":3}}],"line":335},"27":{"loc":{"start":{"line":337,"column":4},"end":{"line":343,"column":5}},"type":"if","locations":[{"start":{"line":337,"column":4},"end":{"line":343,"column":5}},{"start":{"line":337,"column":4},"end":{"line":343,"column":5}}],"line":337},"28":{"loc":{"start":{"line":367,"column":2},"end":{"line":373,"column":3}},"type":"if","locations":[{"start":{"line":367,"column":2},"end":{"line":373,"column":3}},{"start":{"line":367,"column":2},"end":{"line":373,"column":3}}],"line":367},"29":{"loc":{"start":{"line":367,"column":6},"end":{"line":367,"column":48}},"type":"binary-expr","locations":[{"start":{"line":367,"column":6},"end":{"line":367,"column":25}},{"start":{"line":367,"column":29},"end":{"line":367,"column":48}}],"line":367},"30":{"loc":{"start":{"line":376,"column":2},"end":{"line":400,"column":3}},"type":"switch","locations":[{"start":{"line":377,"column":4},"end":{"line":379,"column":12}},{"start":{"line":380,"column":4},"end":{"line":382,"column":12}},{"start":{"line":383,"column":4},"end":{"line":385,"column":12}},{"start":{"line":386,"column":4},"end":{"line":388,"column":12}},{"start":{"line":389,"column":4},"end":{"line":391,"column":12}},{"start":{"line":392,"column":4},"end":{"line":394,"column":12}},{"start":{"line":395,"column":4},"end":{"line":397,"column":12}},{"start":{"line":398,"column":4},"end":{"line":399,"column":12}}],"line":376}},"s":{"0":1,"1":1,"2":1,"3":1,"4":9,"5":9,"6":9,"7":9,"8":9,"9":9,"10":9,"11":11249118,"12":9,"13":9,"14":9,"15":9,"16":15,"17":15,"18":15,"19":15,"20":15,"21":0,"22":15,"23":15,"24":15,"25":15,"26":15,"27":15,"28":0,"29":15,"30":14,"31":14,"32":0,"33":14,"34":0,"35":14,"36":0,"37":14,"38":0,"39":14,"40":14,"41":14,"42":14,"43":14,"44":14,"45":14,"46":14,"47":0,"48":0,"49":0,"50":0,"51":0,"52":0,"53":0,"54":0,"55":14,"56":26,"57":26,"58":0,"59":0,"60":0,"61":26,"62":26,"63":26,"64":26,"65":26,"66":14,"67":14,"68":14,"69":14,"70":13,"71":13,"72":13,"73":13,"74":13,"75":13,"76":9,"77":3,"78":3,"79":3,"80":3,"81":3,"82":3,"83":6,"84":0,"85":0,"86":0,"87":6,"88":6,"89":9,"90":18,"91":18,"92":6,"93":5,"94":1,"95":1,"96":1,"97":1,"98":1,"99":1,"100":1,"101":1,"102":1,"103":1,"104":1,"105":1,"106":1,"107":1,"108":0,"109":0,"110":0,"111":0,"112":0,"113":0,"114":0,"115":0,"116":0,"117":0,"118":0,"119":0,"120":0,"121":0,"122":0,"123":0,"124":0,"125":0,"126":0,"127":0,"128":0,"129":0,"130":1,"131":0,"132":1,"133":6,"134":6,"135":6,"136":6,"137":6,"138":6,"139":4,"140":4,"141":2,"142":2,"143":2,"144":2,"145":4,"146":4,"147":6,"148":6,"149":6,"150":6,"151":6,"152":0,"153":0,"154":6,"155":6,"156":6,"157":0,"158":0,"159":0,"160":0,"161":0,"162":0,"163":0,"164":0,"165":0,"166":0,"167":0,"168":0,"169":0,"170":0,"171":6,"172":6,"173":6,"174":6},"f":{"0":9,"1":9,"2":15,"3":15,"4":15,"5":0,"6":15,"7":15,"8":15,"9":0,"10":14,"11":14,"12":26,"13":14,"14":13,"15":9,"16":18,"17":6,"18":1,"19":1,"20":1,"21":0,"22":6,"23":6},"b":{"0":[1,1,0,0],"1":[1,1,0,1,1],"2":[1,1,0,1,1],"3":[2],"4":[0,14],"5":[14,14],"6":[0,14],"7":[0,14],"8":[0,14],"9":[14,14],"10":[9,5],"11":[0,0],"12":[0,0],"13":[1],"14":[3,6],"15":[0,6],"16":[6,0],"17":[5,1],"18":[1,0],"19":[1,0],"20":[0,0],"21":[0,0],"22":[0,0],"23":[0,0],"24":[0,0],"25":[6,4,0],"26":[4,2],"27":[2,2],"28":[0,6],"29":[6,0],"30":[0,0,0,0,0,0,0,6]},"_coverageSchema":"1a1c01bbd47fc00a2c39e90264f33305004495a9","hash":"78de4c4aced513d0aafb9a2fe6803db968fec929","contentHash":"f44307d295f3e6b0e072ab555a7e41c6fefe4bfbda85561a2b1d7baa50a6f53a"} +,"D:\\Projects\\browser-image-compression\\lib\\config\\max-canvas-size.js": {"path":"D:\\Projects\\browser-image-compression\\lib\\config\\max-canvas-size.js","statementMap":{},"fnMap":{},"branchMap":{},"s":{},"f":{},"b":{},"_coverageSchema":"1a1c01bbd47fc00a2c39e90264f33305004495a9","hash":"0951626fe107b8fcc2e342a45b0b5c806ef949a9","contentHash":"68446f582c34a08db1879323eba2f52146de8ed909256cb724fca2a450163ac4"} } diff --git a/coverage/coverage-summary.json b/coverage/coverage-summary.json index 8a390b9..14573c1 100644 --- a/coverage/coverage-summary.json +++ b/coverage/coverage-summary.json @@ -1,5 +1,7 @@ -{"total": {"lines":{"total":226,"covered":179,"skipped":0,"pct":79.2},"statements":{"total":233,"covered":181,"skipped":0,"pct":77.68},"functions":{"total":28,"covered":24,"skipped":0,"pct":85.71},"branches":{"total":106,"covered":61,"skipped":0,"pct":57.55}} +{"total": {"lines":{"total":252,"covered":194,"skipped":0,"pct":76.98},"statements":{"total":260,"covered":197,"skipped":0,"pct":75.77},"functions":{"total":29,"covered":26,"skipped":0,"pct":89.66},"branches":{"total":117,"covered":71,"skipped":0,"pct":60.68}} ,"D:\\Projects\\browser-image-compression\\lib\\image-compression.js": {"lines":{"total":47,"covered":47,"skipped":0,"pct":100},"functions":{"total":3,"covered":3,"skipped":0,"pct":100},"statements":{"total":47,"covered":47,"skipped":0,"pct":100},"branches":{"total":23,"covered":19,"skipped":0,"pct":82.61}} -,"D:\\Projects\\browser-image-compression\\lib\\index.js": {"lines":{"total":35,"covered":31,"skipped":0,"pct":88.57},"functions":{"total":2,"covered":2,"skipped":0,"pct":100},"statements":{"total":35,"covered":31,"skipped":0,"pct":88.57},"branches":{"total":19,"covered":13,"skipped":0,"pct":68.42}} -,"D:\\Projects\\browser-image-compression\\lib\\utils.js": {"lines":{"total":144,"covered":101,"skipped":0,"pct":70.14},"functions":{"total":23,"covered":19,"skipped":0,"pct":82.61},"statements":{"total":151,"covered":103,"skipped":0,"pct":68.21},"branches":{"total":64,"covered":29,"skipped":0,"pct":45.31}} +,"D:\\Projects\\browser-image-compression\\lib\\index.js": {"lines":{"total":38,"covered":34,"skipped":0,"pct":89.47},"functions":{"total":2,"covered":2,"skipped":0,"pct":100},"statements":{"total":38,"covered":34,"skipped":0,"pct":89.47},"branches":{"total":19,"covered":13,"skipped":0,"pct":68.42}} +,"D:\\Projects\\browser-image-compression\\lib\\polyfill.js": {"lines":{"total":0,"covered":0,"skipped":0,"pct":100},"functions":{"total":0,"covered":0,"skipped":0,"pct":100},"statements":{"total":0,"covered":0,"skipped":0,"pct":100},"branches":{"total":0,"covered":0,"skipped":0,"pct":100}} +,"D:\\Projects\\browser-image-compression\\lib\\utils.js": {"lines":{"total":167,"covered":113,"skipped":0,"pct":67.66},"functions":{"total":24,"covered":21,"skipped":0,"pct":87.5},"statements":{"total":175,"covered":116,"skipped":0,"pct":66.29},"branches":{"total":75,"covered":39,"skipped":0,"pct":52}} +,"D:\\Projects\\browser-image-compression\\lib\\config\\max-canvas-size.js": {"lines":{"total":0,"covered":0,"skipped":0,"pct":100},"functions":{"total":0,"covered":0,"skipped":0,"pct":100},"statements":{"total":0,"covered":0,"skipped":0,"pct":100},"branches":{"total":0,"covered":0,"skipped":0,"pct":100}} } diff --git a/coverage/image-compression.js.html b/coverage/image-compression.js.html deleted file mode 100644 index 57db6e0..0000000 --- a/coverage/image-compression.js.html +++ /dev/null @@ -1,431 +0,0 @@ - - - - - - Code coverage report for image-compression.js - - - - - - - - - -
-
-

All files image-compression.js

-
- -
- 100% - Statements - 47/47 -
- - -
- 82.61% - Branches - 19/23 -
- - -
- 100% - Functions - 3/3 -
- - -
- 100% - Lines - 47/47 -
- - -
-

- Press n or j to go to the next uncovered block, b, p or k for the previous block. -

-
-
-

-
1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19 -20 -21 -22 -23 -24 -25 -26 -27 -28 -29 -30 -31 -32 -33 -34 -35 -36 -37 -38 -39 -40 -41 -42 -43 -44 -45 -46 -47 -48 -49 -50 -51 -52 -53 -54 -55 -56 -57 -58 -59 -60 -61 -62 -63 -64 -65 -66 -67 -68 -69 -70 -71 -72 -73 -74 -75 -76 -77 -78 -79 -80 -81 -82 -83 -84 -85 -86 -87 -88 -89 -90 -91 -92 -93 -94 -95 -96 -97 -98 -99 -100 -101 -102 -103 -104 -105 -106 -107 -108 -109 -110 -111 -112 -113 -114 -115 -116 -117 -118  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -6x -  -  -36x -36x -  -  -  -8x -8x -  -  -6x -  -6x -  -6x -  -  -6x -  -6x -  -  -6x -  -6x -  -  -6x -6x -6x -6x -  -6x -  -6x -  -6x -6x -  -6x -6x -  -  -  -  -6x -  -5x -5x -  -  -1x -1x -1x -  -  -1x -1x -2x -2x -  -  -2x -  -2x -  -2x -2x -  -2x -  -2x -  -2x -  -2x -  -  -1x -1x -1x -1x -1x -  -1x -1x -  - 
import {
-  canvasToFile,
-  cleanupCanvasMemory,
-  drawFileInCanvas,
-  followExifOrientation,
-  getExifOrientation,
-  getNewCanvasAndCtx,
-  handleMaxWidthOrHeight,
-  isAutoOrientationInBrowser
-} from './utils'
- 
-/**
- * Compress an image file.
- *
- * @param {File} file
- * @param {Object} options
- * @param {number} [options.maxSizeMB=Number.POSITIVE_INFINITY]
- * @param {number} [options.maxWidthOrHeight=undefined]
- * @param {boolean} [options.useWebWorker=false]
- * @param {number} [options.maxIteration=10]
- * @param {number} [options.exifOrientation] - default to be the exif orientation from the image file
- * @param {Function} [options.onProgress] - a function takes one progress argument (progress from 0 to 100)
- * @param {string} [options.fileType] - default to be the original mime type from the image file
- * @param {number} [options.initialQuality=1.0]
- * @param {number} previousProgress - for internal try catch rerunning start from previous progress
- * @returns {Promise<File | Blob>}
- */
-export default async function compress (file, options, previousProgress = 0) {
-  let progress = previousProgress
- 
-  function incProgress (inc = 5) {
-    progress += inc
-    options.onProgress(Math.min(progress, 100))
-  }
- 
-  function setProgress (p) {
-    progress = Math.min(Math.max(p, progress), 100)
-    options.onProgress(progress)
-  }
- 
-  let remainingTrials = options.maxIteration || 10
- 
-  const maxSizeByte = options.maxSizeMB * 1024 * 1024
- 
-  incProgress()
- 
-  // drawFileInCanvas
-  let [img, origCanvas] = await drawFileInCanvas(file)
- 
-  incProgress()
- 
-  // handleMaxWidthOrHeight
-  const maxWidthOrHeightFixedCanvas = handleMaxWidthOrHeight(origCanvas, options)
- 
-  incProgress()
- 
-  // exifOrientation
-  const exifOrientation = options.exifOrientation || await getExifOrientation(file)
-  incProgress()
-  const orientationFixedCanvas = (await isAutoOrientationInBrowser()) ? maxWidthOrHeightFixedCanvas : followExifOrientation(maxWidthOrHeightFixedCanvas, exifOrientation)
-  incProgress()
- 
-  let quality = options.initialQuality || 1.0
- 
-  const outputFileType = options.fileType || file.type
- 
-  let tempFile = await canvasToFile(orientationFixedCanvas, outputFileType, file.name, file.lastModified, quality)
-  incProgress()
- 
-  const origExceedMaxSize = tempFile.size > maxSizeByte
-  const sizeBecomeLarger = tempFile.size > file.size
-  // console.log('original file size', file.size)
-  // console.log('current file size', tempFile.size)
- 
-  // check if we need to compress or resize
-  if (!origExceedMaxSize && !sizeBecomeLarger) {
-    // no need to compress
-    setProgress(100)
-    return tempFile
-  }
- 
-  const sourceSize = file.size
-  const renderedSize = tempFile.size
-  let currentSize = renderedSize
-  let compressedFile
-  let newCanvas, ctx
-  let canvas = orientationFixedCanvas
-  while (remainingTrials-- && (currentSize > maxSizeByte || currentSize > sourceSize)) {
-    const newWidth = origExceedMaxSize ? canvas.width * 0.95 : canvas.width
-    const newHeight = origExceedMaxSize ? canvas.height * 0.95 : canvas.height;
-    // console.log('current width', newWidth);
-    // console.log('current height', newHeight);
-    [newCanvas, ctx] = getNewCanvasAndCtx(newWidth, newHeight)
- 
-    ctx.drawImage(canvas, 0, 0, newWidth, newHeight)
- 
-    quality *= 0.95
-    compressedFile = await canvasToFile(newCanvas, outputFileType, file.name, file.lastModified, quality)
- 
-    cleanupCanvasMemory(canvas)
- 
-    canvas = newCanvas
- 
-    currentSize = compressedFile.size
-    // console.log('currentSize', currentSize)
-    setProgress(Math.min(99, Math.floor((renderedSize - currentSize) / (renderedSize - maxSizeByte) * 100)))
-  }
- 
-  cleanupCanvasMemory(canvas)
-  cleanupCanvasMemory(newCanvas)
-  cleanupCanvasMemory(maxWidthOrHeightFixedCanvas)
-  cleanupCanvasMemory(orientationFixedCanvas)
-  cleanupCanvasMemory(origCanvas)
- 
-  setProgress(100)
-  return compressedFile
-}
- 
- -
-
- - - - - - - - - \ No newline at end of file diff --git a/coverage/index.html b/coverage/index.html index afe1618..6b6c489 100644 --- a/coverage/index.html +++ b/coverage/index.html @@ -23,30 +23,30 @@

All files

- 77.68% + 75.77% Statements - 181/233 + 197/260
- 57.55% + 60.68% Branches - 61/106 + 71/117
- 85.71% + 89.66% Functions - 24/28 + 26/29
- 79.2% + 76.98% Lines - 179/226 + 194/252
@@ -73,48 +73,33 @@

All files

- image-compression.js - -
+ lib + +
- 100% - 47/47 - 82.61% - 19/23 - 100% - 3/3 - 100% - 47/47 + 75.77% + 197/260 + 60.68% + 71/117 + 89.66% + 26/29 + 76.98% + 194/252 - index.js - -
+ lib/config + +
- 88.57% - 31/35 - 68.42% - 13/19 - 100% - 2/2 - 88.57% - 31/35 - - - - utils.js - -
- - 68.21% - 103/151 - 45.31% - 29/64 - 82.61% - 19/23 - 70.14% - 101/144 + 0% + 0/0 + 0% + 0/0 + 0% + 0/0 + 0% + 0/0 @@ -125,7 +110,7 @@

All files

diff --git a/coverage/index.js.html b/coverage/index.js.html deleted file mode 100644 index 64b7c73..0000000 --- a/coverage/index.js.html +++ /dev/null @@ -1,383 +0,0 @@ - - - - - - Code coverage report for index.js - - - - - - - - - -
-
-

All files index.js

-
- -
- 88.57% - Statements - 31/35 -
- - -
- 68.42% - Branches - 13/19 -
- - -
- 100% - Functions - 2/2 -
- - -
- 88.57% - Lines - 31/35 -
- - -
-

- Press n or j to go to the next uncovered block, b, p or k for the previous block. -

-
-
-

-
1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19 -20 -21 -22 -23 -24 -25 -26 -27 -28 -29 -30 -31 -32 -33 -34 -35 -36 -37 -38 -39 -40 -41 -42 -43 -44 -45 -46 -47 -48 -49 -50 -51 -52 -53 -54 -55 -56 -57 -58 -59 -60 -61 -62 -63 -64 -65 -66 -67 -68 -69 -70 -71 -72 -73 -74 -75 -76 -77 -78 -79 -80 -81 -82 -83 -84 -85 -86 -87 -88 -89 -90 -91 -92 -93 -94 -95 -96 -97 -98 -99 -100 -101 -102  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -9x -  -  -9x -9x -9x -9x -9x -44x -44x -  -  -  -  -9x -2x -7x -1x -  -  -  -6x -  -  -  -  -  -  -  -6x -  -  -  -  -  -  -  -  -  -  -  -6x -  -  -6x -6x -6x -  -  -6x -  -  -1x -1x -1x -1x -1x -1x -1x -  -1x -1x -1x -1x -1x -  -  - 
import compress from './image-compression'
-import {
-  canvasToFile,
-  drawFileInCanvas,
-  drawImageInCanvas,
-  getDataUrlFromFile,
-  getFilefromDataUrl,
-  loadImage,
-  getExifOrientation,
-  handleMaxWidthOrHeight,
-  followExifOrientation,
-  CustomFile,
-  cleanupCanvasMemory,
-  isAutoOrientationInBrowser
-} from './utils'
-import { compressOnWebWorker } from './web-worker'
- 
-/**
- * Compress an image file.
- *
- * @param {File} file
- * @param {Object} options - { maxSizeMB=Number.POSITIVE_INFINITY, maxWidthOrHeight, useWebWorker=false, maxIteration = 10, exifOrientation, fileType }
- * @param {number} [options.maxSizeMB=Number.POSITIVE_INFINITY]
- * @param {number} [options.maxWidthOrHeight=undefined]
- * @param {boolean} [options.useWebWorker=false]
- * @param {number} [options.maxIteration=10]
- * @param {number} [options.exifOrientation] - default to be the exif orientation from the image file
- * @param {Function} [options.onProgress] - a function takes one progress argument (progress from 0 to 100)
- * @param {string} [options.fileType] - default to be the original mime type from the image file
- * @returns {Promise<File | Blob>}
- */
-async function imageCompression (file, options) {
- 
-  let compressedFile
-  let progress = 0
-  let onProgress
- 
-  options.maxSizeMB = options.maxSizeMB || Number.POSITIVE_INFINITY
-  const useWebWorker = typeof options.useWebWorker === 'boolean' ? options.useWebWorker : true
-  delete options.useWebWorker
-  onProgress = options.onProgress
-  options.onProgress = (aProgress) => {
-    progress = aProgress
-    Iif (typeof onProgress === 'function') {
-      onProgress(progress)
-    }
-  }
- 
-  if (!(file instanceof Blob || file instanceof CustomFile)) {
-    throw new Error('The file given is not an instance of Blob or File')
-  } else if (!/^image/.test(file.type)) {
-    throw new Error('The file given is not an image')
-  }
- 
-  // try run in web worker, fall back to run in main thread
-  const inWebWorker = typeof WorkerGlobalScope !== 'undefined' && self instanceof WorkerGlobalScope
- 
-  // if ((useWebWorker && typeof Worker === 'function') || inWebWorker) {
-  //   console.log('run compression in web worker')
-  // } else {
-  //   console.log('run compression in main thread')
-  // }
- 
-  Iif (useWebWorker && typeof Worker === 'function' && !inWebWorker) {
-    try {
-      // console.log(1)
-      // "compressOnWebWorker" is kind of like a recursion to call "imageCompression" again inside web worker
-      compressedFile = await compressOnWebWorker(file, options)
-    } catch (e) {
-      // console.warn('Run compression in web worker failed:', e, ', fall back to main thread')
-      // console.log(1.5)
-      compressedFile = await compress(file, options)
-    }
-  } else {
-    // console.log(2)
-    compressedFile = await compress(file, options)
-  }
- 
-  try {
-    compressedFile.name = file.name
-    compressedFile.lastModified = file.lastModified
-  } catch (e) {}
- 
-  return compressedFile
-}
- 
-imageCompression.getDataUrlFromFile = getDataUrlFromFile
-imageCompression.getFilefromDataUrl = getFilefromDataUrl
-imageCompression.loadImage = loadImage
-imageCompression.drawImageInCanvas = drawImageInCanvas
-imageCompression.drawFileInCanvas = drawFileInCanvas
-imageCompression.canvasToFile = canvasToFile
-imageCompression.getExifOrientation = getExifOrientation
- 
-imageCompression.handleMaxWidthOrHeight = handleMaxWidthOrHeight
-imageCompression.followExifOrientation = followExifOrientation
-imageCompression.cleanupCanvasMemory = cleanupCanvasMemory
-imageCompression.isAutoOrientationInBrowser = isAutoOrientationInBrowser
-imageCompression.version = '1.0.14'
- 
-export default imageCompression
- 
- -
-
- - - - - - - - - \ No newline at end of file diff --git a/coverage/lcov-report/image-compression.js.html b/coverage/lcov-report/image-compression.js.html deleted file mode 100644 index 57db6e0..0000000 --- a/coverage/lcov-report/image-compression.js.html +++ /dev/null @@ -1,431 +0,0 @@ - - - - - - Code coverage report for image-compression.js - - - - - - - - - -
-
-

All files image-compression.js

-
- -
- 100% - Statements - 47/47 -
- - -
- 82.61% - Branches - 19/23 -
- - -
- 100% - Functions - 3/3 -
- - -
- 100% - Lines - 47/47 -
- - -
-

- Press n or j to go to the next uncovered block, b, p or k for the previous block. -

-
-
-

-
1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19 -20 -21 -22 -23 -24 -25 -26 -27 -28 -29 -30 -31 -32 -33 -34 -35 -36 -37 -38 -39 -40 -41 -42 -43 -44 -45 -46 -47 -48 -49 -50 -51 -52 -53 -54 -55 -56 -57 -58 -59 -60 -61 -62 -63 -64 -65 -66 -67 -68 -69 -70 -71 -72 -73 -74 -75 -76 -77 -78 -79 -80 -81 -82 -83 -84 -85 -86 -87 -88 -89 -90 -91 -92 -93 -94 -95 -96 -97 -98 -99 -100 -101 -102 -103 -104 -105 -106 -107 -108 -109 -110 -111 -112 -113 -114 -115 -116 -117 -118  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -6x -  -  -36x -36x -  -  -  -8x -8x -  -  -6x -  -6x -  -6x -  -  -6x -  -6x -  -  -6x -  -6x -  -  -6x -6x -6x -6x -  -6x -  -6x -  -6x -6x -  -6x -6x -  -  -  -  -6x -  -5x -5x -  -  -1x -1x -1x -  -  -1x -1x -2x -2x -  -  -2x -  -2x -  -2x -2x -  -2x -  -2x -  -2x -  -2x -  -  -1x -1x -1x -1x -1x -  -1x -1x -  - 
import {
-  canvasToFile,
-  cleanupCanvasMemory,
-  drawFileInCanvas,
-  followExifOrientation,
-  getExifOrientation,
-  getNewCanvasAndCtx,
-  handleMaxWidthOrHeight,
-  isAutoOrientationInBrowser
-} from './utils'
- 
-/**
- * Compress an image file.
- *
- * @param {File} file
- * @param {Object} options
- * @param {number} [options.maxSizeMB=Number.POSITIVE_INFINITY]
- * @param {number} [options.maxWidthOrHeight=undefined]
- * @param {boolean} [options.useWebWorker=false]
- * @param {number} [options.maxIteration=10]
- * @param {number} [options.exifOrientation] - default to be the exif orientation from the image file
- * @param {Function} [options.onProgress] - a function takes one progress argument (progress from 0 to 100)
- * @param {string} [options.fileType] - default to be the original mime type from the image file
- * @param {number} [options.initialQuality=1.0]
- * @param {number} previousProgress - for internal try catch rerunning start from previous progress
- * @returns {Promise<File | Blob>}
- */
-export default async function compress (file, options, previousProgress = 0) {
-  let progress = previousProgress
- 
-  function incProgress (inc = 5) {
-    progress += inc
-    options.onProgress(Math.min(progress, 100))
-  }
- 
-  function setProgress (p) {
-    progress = Math.min(Math.max(p, progress), 100)
-    options.onProgress(progress)
-  }
- 
-  let remainingTrials = options.maxIteration || 10
- 
-  const maxSizeByte = options.maxSizeMB * 1024 * 1024
- 
-  incProgress()
- 
-  // drawFileInCanvas
-  let [img, origCanvas] = await drawFileInCanvas(file)
- 
-  incProgress()
- 
-  // handleMaxWidthOrHeight
-  const maxWidthOrHeightFixedCanvas = handleMaxWidthOrHeight(origCanvas, options)
- 
-  incProgress()
- 
-  // exifOrientation
-  const exifOrientation = options.exifOrientation || await getExifOrientation(file)
-  incProgress()
-  const orientationFixedCanvas = (await isAutoOrientationInBrowser()) ? maxWidthOrHeightFixedCanvas : followExifOrientation(maxWidthOrHeightFixedCanvas, exifOrientation)
-  incProgress()
- 
-  let quality = options.initialQuality || 1.0
- 
-  const outputFileType = options.fileType || file.type
- 
-  let tempFile = await canvasToFile(orientationFixedCanvas, outputFileType, file.name, file.lastModified, quality)
-  incProgress()
- 
-  const origExceedMaxSize = tempFile.size > maxSizeByte
-  const sizeBecomeLarger = tempFile.size > file.size
-  // console.log('original file size', file.size)
-  // console.log('current file size', tempFile.size)
- 
-  // check if we need to compress or resize
-  if (!origExceedMaxSize && !sizeBecomeLarger) {
-    // no need to compress
-    setProgress(100)
-    return tempFile
-  }
- 
-  const sourceSize = file.size
-  const renderedSize = tempFile.size
-  let currentSize = renderedSize
-  let compressedFile
-  let newCanvas, ctx
-  let canvas = orientationFixedCanvas
-  while (remainingTrials-- && (currentSize > maxSizeByte || currentSize > sourceSize)) {
-    const newWidth = origExceedMaxSize ? canvas.width * 0.95 : canvas.width
-    const newHeight = origExceedMaxSize ? canvas.height * 0.95 : canvas.height;
-    // console.log('current width', newWidth);
-    // console.log('current height', newHeight);
-    [newCanvas, ctx] = getNewCanvasAndCtx(newWidth, newHeight)
- 
-    ctx.drawImage(canvas, 0, 0, newWidth, newHeight)
- 
-    quality *= 0.95
-    compressedFile = await canvasToFile(newCanvas, outputFileType, file.name, file.lastModified, quality)
- 
-    cleanupCanvasMemory(canvas)
- 
-    canvas = newCanvas
- 
-    currentSize = compressedFile.size
-    // console.log('currentSize', currentSize)
-    setProgress(Math.min(99, Math.floor((renderedSize - currentSize) / (renderedSize - maxSizeByte) * 100)))
-  }
- 
-  cleanupCanvasMemory(canvas)
-  cleanupCanvasMemory(newCanvas)
-  cleanupCanvasMemory(maxWidthOrHeightFixedCanvas)
-  cleanupCanvasMemory(orientationFixedCanvas)
-  cleanupCanvasMemory(origCanvas)
- 
-  setProgress(100)
-  return compressedFile
-}
- 
- -
-
- - - - - - - - - \ No newline at end of file diff --git a/coverage/lcov-report/index.html b/coverage/lcov-report/index.html index afe1618..6b6c489 100644 --- a/coverage/lcov-report/index.html +++ b/coverage/lcov-report/index.html @@ -23,30 +23,30 @@

All files

- 77.68% + 75.77% Statements - 181/233 + 197/260
- 57.55% + 60.68% Branches - 61/106 + 71/117
- 85.71% + 89.66% Functions - 24/28 + 26/29
- 79.2% + 76.98% Lines - 179/226 + 194/252
@@ -73,48 +73,33 @@

All files

- image-compression.js - -
+ lib + +
- 100% - 47/47 - 82.61% - 19/23 - 100% - 3/3 - 100% - 47/47 + 75.77% + 197/260 + 60.68% + 71/117 + 89.66% + 26/29 + 76.98% + 194/252 - index.js - -
+ lib/config + +
- 88.57% - 31/35 - 68.42% - 13/19 - 100% - 2/2 - 88.57% - 31/35 - - - - utils.js - -
- - 68.21% - 103/151 - 45.31% - 29/64 - 82.61% - 19/23 - 70.14% - 101/144 + 0% + 0/0 + 0% + 0/0 + 0% + 0/0 + 0% + 0/0 @@ -125,7 +110,7 @@

All files

diff --git a/coverage/lcov-report/index.js.html b/coverage/lcov-report/index.js.html deleted file mode 100644 index 64b7c73..0000000 --- a/coverage/lcov-report/index.js.html +++ /dev/null @@ -1,383 +0,0 @@ - - - - - - Code coverage report for index.js - - - - - - - - - -
-
-

All files index.js

-
- -
- 88.57% - Statements - 31/35 -
- - -
- 68.42% - Branches - 13/19 -
- - -
- 100% - Functions - 2/2 -
- - -
- 88.57% - Lines - 31/35 -
- - -
-

- Press n or j to go to the next uncovered block, b, p or k for the previous block. -

-
-
-

-
1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19 -20 -21 -22 -23 -24 -25 -26 -27 -28 -29 -30 -31 -32 -33 -34 -35 -36 -37 -38 -39 -40 -41 -42 -43 -44 -45 -46 -47 -48 -49 -50 -51 -52 -53 -54 -55 -56 -57 -58 -59 -60 -61 -62 -63 -64 -65 -66 -67 -68 -69 -70 -71 -72 -73 -74 -75 -76 -77 -78 -79 -80 -81 -82 -83 -84 -85 -86 -87 -88 -89 -90 -91 -92 -93 -94 -95 -96 -97 -98 -99 -100 -101 -102  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -9x -  -  -9x -9x -9x -9x -9x -44x -44x -  -  -  -  -9x -2x -7x -1x -  -  -  -6x -  -  -  -  -  -  -  -6x -  -  -  -  -  -  -  -  -  -  -  -6x -  -  -6x -6x -6x -  -  -6x -  -  -1x -1x -1x -1x -1x -1x -1x -  -1x -1x -1x -1x -1x -  -  - 
import compress from './image-compression'
-import {
-  canvasToFile,
-  drawFileInCanvas,
-  drawImageInCanvas,
-  getDataUrlFromFile,
-  getFilefromDataUrl,
-  loadImage,
-  getExifOrientation,
-  handleMaxWidthOrHeight,
-  followExifOrientation,
-  CustomFile,
-  cleanupCanvasMemory,
-  isAutoOrientationInBrowser
-} from './utils'
-import { compressOnWebWorker } from './web-worker'
- 
-/**
- * Compress an image file.
- *
- * @param {File} file
- * @param {Object} options - { maxSizeMB=Number.POSITIVE_INFINITY, maxWidthOrHeight, useWebWorker=false, maxIteration = 10, exifOrientation, fileType }
- * @param {number} [options.maxSizeMB=Number.POSITIVE_INFINITY]
- * @param {number} [options.maxWidthOrHeight=undefined]
- * @param {boolean} [options.useWebWorker=false]
- * @param {number} [options.maxIteration=10]
- * @param {number} [options.exifOrientation] - default to be the exif orientation from the image file
- * @param {Function} [options.onProgress] - a function takes one progress argument (progress from 0 to 100)
- * @param {string} [options.fileType] - default to be the original mime type from the image file
- * @returns {Promise<File | Blob>}
- */
-async function imageCompression (file, options) {
- 
-  let compressedFile
-  let progress = 0
-  let onProgress
- 
-  options.maxSizeMB = options.maxSizeMB || Number.POSITIVE_INFINITY
-  const useWebWorker = typeof options.useWebWorker === 'boolean' ? options.useWebWorker : true
-  delete options.useWebWorker
-  onProgress = options.onProgress
-  options.onProgress = (aProgress) => {
-    progress = aProgress
-    Iif (typeof onProgress === 'function') {
-      onProgress(progress)
-    }
-  }
- 
-  if (!(file instanceof Blob || file instanceof CustomFile)) {
-    throw new Error('The file given is not an instance of Blob or File')
-  } else if (!/^image/.test(file.type)) {
-    throw new Error('The file given is not an image')
-  }
- 
-  // try run in web worker, fall back to run in main thread
-  const inWebWorker = typeof WorkerGlobalScope !== 'undefined' && self instanceof WorkerGlobalScope
- 
-  // if ((useWebWorker && typeof Worker === 'function') || inWebWorker) {
-  //   console.log('run compression in web worker')
-  // } else {
-  //   console.log('run compression in main thread')
-  // }
- 
-  Iif (useWebWorker && typeof Worker === 'function' && !inWebWorker) {
-    try {
-      // console.log(1)
-      // "compressOnWebWorker" is kind of like a recursion to call "imageCompression" again inside web worker
-      compressedFile = await compressOnWebWorker(file, options)
-    } catch (e) {
-      // console.warn('Run compression in web worker failed:', e, ', fall back to main thread')
-      // console.log(1.5)
-      compressedFile = await compress(file, options)
-    }
-  } else {
-    // console.log(2)
-    compressedFile = await compress(file, options)
-  }
- 
-  try {
-    compressedFile.name = file.name
-    compressedFile.lastModified = file.lastModified
-  } catch (e) {}
- 
-  return compressedFile
-}
- 
-imageCompression.getDataUrlFromFile = getDataUrlFromFile
-imageCompression.getFilefromDataUrl = getFilefromDataUrl
-imageCompression.loadImage = loadImage
-imageCompression.drawImageInCanvas = drawImageInCanvas
-imageCompression.drawFileInCanvas = drawFileInCanvas
-imageCompression.canvasToFile = canvasToFile
-imageCompression.getExifOrientation = getExifOrientation
- 
-imageCompression.handleMaxWidthOrHeight = handleMaxWidthOrHeight
-imageCompression.followExifOrientation = followExifOrientation
-imageCompression.cleanupCanvasMemory = cleanupCanvasMemory
-imageCompression.isAutoOrientationInBrowser = isAutoOrientationInBrowser
-imageCompression.version = '1.0.14'
- 
-export default imageCompression
- 
- -
-
- - - - - - - - - \ No newline at end of file diff --git a/coverage/lcov-report/utils.js.html b/coverage/lcov-report/utils.js.html deleted file mode 100644 index 1cbd28b..0000000 --- a/coverage/lcov-report/utils.js.html +++ /dev/null @@ -1,1136 +0,0 @@ - - - - - - Code coverage report for utils.js - - - - - - - - - -
-
-

All files utils.js

-
- -
- 68.21% - Statements - 103/151 -
- - -
- 45.31% - Branches - 29/64 -
- - -
- 82.61% - Functions - 19/23 -
- - -
- 70.14% - Lines - 101/144 -
- - -
-

- Press n or j to go to the next uncovered block, b, p or k for the previous block. -

-
-
-

-
1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19 -20 -21 -22 -23 -24 -25 -26 -27 -28 -29 -30 -31 -32 -33 -34 -35 -36 -37 -38 -39 -40 -41 -42 -43 -44 -45 -46 -47 -48 -49 -50 -51 -52 -53 -54 -55 -56 -57 -58 -59 -60 -61 -62 -63 -64 -65 -66 -67 -68 -69 -70 -71 -72 -73 -74 -75 -76 -77 -78 -79 -80 -81 -82 -83 -84 -85 -86 -87 -88 -89 -90 -91 -92 -93 -94 -95 -96 -97 -98 -99 -100 -101 -102 -103 -104 -105 -106 -107 -108 -109 -110 -111 -112 -113 -114 -115 -116 -117 -118 -119 -120 -121 -122 -123 -124 -125 -126 -127 -128 -129 -130 -131 -132 -133 -134 -135 -136 -137 -138 -139 -140 -141 -142 -143 -144 -145 -146 -147 -148 -149 -150 -151 -152 -153 -154 -155 -156 -157 -158 -159 -160 -161 -162 -163 -164 -165 -166 -167 -168 -169 -170 -171 -172 -173 -174 -175 -176 -177 -178 -179 -180 -181 -182 -183 -184 -185 -186 -187 -188 -189 -190 -191 -192 -193 -194 -195 -196 -197 -198 -199 -200 -201 -202 -203 -204 -205 -206 -207 -208 -209 -210 -211 -212 -213 -214 -215 -216 -217 -218 -219 -220 -221 -222 -223 -224 -225 -226 -227 -228 -229 -230 -231 -232 -233 -234 -235 -236 -237 -238 -239 -240 -241 -242 -243 -244 -245 -246 -247 -248 -249 -250 -251 -252 -253 -254 -255 -256 -257 -258 -259 -260 -261 -262 -263 -264 -265 -266 -267 -268 -269 -270 -271 -272 -273 -274 -275 -276 -277 -278 -279 -280 -281 -282 -283 -284 -285 -286 -287 -288 -289 -290 -291 -292 -293 -294 -295 -296 -297 -298 -299 -300 -301 -302 -303 -304 -305 -306 -307 -308 -309 -310 -311 -312 -313 -314 -315 -316 -317 -318 -319 -320 -321 -322 -323 -324 -325 -326 -327 -328 -329 -330 -331 -332 -333 -334 -335 -336 -337 -338 -339 -340 -341 -342 -343 -344 -345 -346 -347 -348 -349 -350 -351 -352 -353  -  -1x -  -  -1x -1x -1x -  -  -  -  -6x -5x -  -  -  -  -1x -  -  -  -  -  -1x -  -1x -1x -1x -1x -  -  -1x -1x -  -  -  -  -  -  -  -  -  -15x -15x -15x -15x -15x -  -  -  -  -  -  -  -  -  -  -  -  -9x -9x -9x -9x -9x -9x -9x -11249118x -  -9x -9x -9x -9x -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -15x -15x -15x -15x -15x -  -  -  -  -  -  -  -  -  -  -14x -14x -14x -  -  -  -  -  -  -  -  -  -  -13x -13x -  -13x -13x -  -13x -13x -  -  -  -  -  -  -  -  -  -  -  -  -  -  -9x -3x -3x -3x -3x -3x -3x -6x -  -  -  -  -  -  -  -6x -6x -  -9x -  -  -  -  -  -  -  -  -  -  -  -1x -1x -1x -1x -1x -1x -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -1x -1x -  -  -  -  -  -  -  -  -  -  -6x -6x -6x -  -6x -  -6x -  -  -6x -4x -4x -2x -2x -  -2x -2x -  -4x -  -4x -  -  -6x -  -  -  -  -  -  -  -  -  -  -  -6x -6x -  -6x -  -  -6x -  -  -  -6x -6x -  -  -  -6x -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -6x -  -  -6x -  -6x -  -6x -  -  -  -  -  -  -  -  -  -  -  -26x -26x -  -  -  -  -  -26x -26x -  -26x -26x -  -  -26x -  -  -  -  -  -  -  -  -  -  -18x -18x -  -  -1x -  -1x -  -  -  -  -  - 
import UPNG from './UPNG'
- 
-const isBrowser = typeof window !== 'undefined' // change browser environment to support SSR
- 
-// add support for cordova-plugin-file
-const moduleMapper = isBrowser && window.cordova && window.cordova.require && window.cordova.require('cordova/modulemapper')
-export const CustomFile = isBrowser && ((moduleMapper && moduleMapper.getOriginalSymbol(window, 'File')) || File)
-export const CustomFileReader = isBrowser && ((moduleMapper && moduleMapper.getOriginalSymbol(window, 'FileReader')) || FileReader)
- 
-// Check if browser supports automatic image orientation
-// see https://github.com/blueimp/JavaScript-Load-Image/blob/1e4df707821a0afcc11ea0720ee403b8759f3881/js/load-image-orientation.js#L37-L53
-export async function isAutoOrientationInBrowser() {
-  if (isAutoOrientationInBrowser.result !== undefined)
-    return isAutoOrientationInBrowser.result
- 
-  // black 2x1 JPEG, with the following meta information set:
-  // EXIF Orientation: 6 (Rotated 90° CCW)
-  const testImageURL =
-    'data:image/jpeg;base64,/9j/4QAiRXhpZgAATU0AKgAAAAgAAQESAAMAAAABAAYAAAA' +
-    'AAAD/2wCEAAEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBA' +
-    'QEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQE' +
-    'BAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAf/AABEIAAEAAgMBEQACEQEDEQH/x' +
-    'ABKAAEAAAAAAAAAAAAAAAAAAAALEAEAAAAAAAAAAAAAAAAAAAAAAQEAAAAAAAAAAAAAAAA' +
-    'AAAAAEQEAAAAAAAAAAAAAAAAAAAAA/9oADAMBAAIRAxEAPwA/8H//2Q=='
-  const testImageFile = await getFilefromDataUrl(testImageURL, 'test.jpg', Date.now())
- 
-  const testImageCanvas = (await drawFileInCanvas(testImageFile))[1]
-  const testImageFile2 = await canvasToFile(testImageCanvas, testImageFile.type, testImageFile.name, testImageFile.lastModified)
-  cleanupCanvasMemory(testImageCanvas)
-  const img = (await drawFileInCanvas(testImageFile2))[0]
-  // console.log('img', img.width, img.height)
- 
-  isAutoOrientationInBrowser.result = img.width === 1 && img.height === 2
-  return isAutoOrientationInBrowser.result
-}
- 
-/**
- * getDataUrlFromFile
- *
- * @param {File | Blob} file
- * @returns {Promise<string>}
- */
-export function getDataUrlFromFile (file) {
-  return new Promise((resolve, reject) => {
-    const reader = new CustomFileReader()
-    reader.onload = () => resolve(reader.result)
-    reader.onerror = (e) => reject(e)
-    reader.readAsDataURL(file)
-  })
-}
- 
-/**
- * getFilefromDataUrl
- *
- * @param {string} dataUrl
- * @param {string} filename
- * @param {number} [lastModified=Date.now()]
- * @returns {Promise<File | Blob>}
- */
-export function getFilefromDataUrl (dataUrl, filename, lastModified = Date.now()) {
-  return new Promise((resolve) => {
-    const arr = dataUrl.split(',')
-    const mime = arr[0].match(/:(.*?);/)[1]
-    const bstr = globalThis.atob(arr[1])
-    let n = bstr.length
-    const u8arr = new Uint8Array(n)
-    while (n--) {
-      u8arr[n] = bstr.charCodeAt(n)
-    }
-    const file = new Blob([u8arr], { type: mime })
-    file.name = filename
-    file.lastModified = lastModified
-    resolve(file)
- 
-    // Safari has issue with File constructor not being able to POST in FormData
-    // https://github.com/Donaldcwl/browser-image-compression/issues/8
-    // https://bugs.webkit.org/show_bug.cgi?id=165081
-    // let file
-    // try {
-    //   file = new File([u8arr], filename, { type: mime }) // Edge do not support File constructor
-    // } catch (e) {
-    //   file = new Blob([u8arr], { type: mime })
-    //   file.name = filename
-    //   file.lastModified = lastModified
-    // }
-    // resolve(file)
-  })
-}
- 
-/**
- * loadImage
- *
- * @param {string} src
- * @returns {Promise<HTMLImageElement>}
- */
-export function loadImage (src) {
-  return new Promise((resolve, reject) => {
-    const img = new Image()
-    img.onload = () => resolve(img)
-    img.onerror = (e) => reject(e)
-    img.src = src
-  })
-}
- 
-/**
- * drawImageInCanvas
- *
- * @param {HTMLImageElement} img
- * @returns {HTMLCanvasElement | OffscreenCanvas}
- */
-export function drawImageInCanvas (img) {
-  const [canvas, ctx] = getNewCanvasAndCtx(img.width, img.height)
-  ctx.drawImage(img, 0, 0, canvas.width, canvas.height)
-  return canvas
-}
- 
-/**
- * drawFileInCanvas
- *
- * @param {File | Blob} file
- * @returns {Promise<[ImageBitmap | HTMLImageElement, HTMLCanvasElement | OffscreenCanvas]>}
- */
-export async function drawFileInCanvas (file) {
-  let img
-  try {
-    img = await createImageBitmap(file)
-  } catch (e) {
-    const dataUrl = await getDataUrlFromFile(file)
-    img = await loadImage(dataUrl)
-  }
-  const canvas = drawImageInCanvas(img)
-  return [img, canvas]
-}
- 
-/**
- * canvasToFile
- *
- * @param {HTMLCanvasElement | OffscreenCanvas} canvas
- * @param {string} fileType
- * @param {string} fileName
- * @param {number} fileLastModified
- * @param {number} [quality]
- * @returns {Promise<File | Blob>}
- */
-export async function canvasToFile (canvas, fileType, fileName, fileLastModified, quality = 1) {
-  let file
-  if (fileType === 'image/png') {
-    const ctx = canvas.getContext('2d')
-    const data = ctx.getImageData(0, 0, canvas.width, canvas.height).data
-    const png = UPNG.encode([data], canvas.width, canvas.height, 256 * quality)
-    file = new Blob([png], { type: fileType })
-    file.name = fileName
-    file.lastModified = fileLastModified
-  } else Iif (typeof OffscreenCanvas === 'function' && canvas instanceof OffscreenCanvas) { // checked on Win Chrome 83, MacOS Chrome 83
-    file = await canvas.convertToBlob({ type: fileType, quality })
-    file.name = fileName
-    file.lastModified = fileLastModified
-  // some browser do not support quality parameter, see: https://developer.mozilla.org/en-US/docs/Web/API/HTMLCanvasElement/toBlob
-  // } else if (typeof canvas.toBlob === 'function') {
-  //   file = await new Promise(resolve => canvas.toBlob(resolve, fileType, quality))
-  } else { // checked on Win Edge 44, Win IE 11, Win Firefox 76, MacOS Firefox 77, MacOS Safari 13.1
-    const dataUrl = canvas.toDataURL(fileType, quality)
-    file = await getFilefromDataUrl(dataUrl, fileName, fileLastModified)
-  }
-  return file
-}
- 
-/**
- * getExifOrientation
- * get image exif orientation info
- * source: https://stackoverflow.com/a/32490603/10395024
- *
- * @param {File | Blob} file
- * @returns {Promise<number>} - orientation id, see https://i.stack.imgur.com/VGsAj.gif
- */
-export function getExifOrientation (file) {
-  return new Promise((resolve, reject) => {
-    const reader = new CustomFileReader()
-    reader.onload = (e) => {
-      const view = new DataView(e.target.result)
-      Eif (view.getUint16(0, false) != 0xFFD8) {
-        return resolve(-2)
-      }
-      const length = view.byteLength
-      let offset = 2
-      while (offset < length) {
-        if (view.getUint16(offset + 2, false) <= 8) return resolve(-1)
-        const marker = view.getUint16(offset, false)
-        offset += 2
-        if (marker == 0xFFE1) {
-          if (view.getUint32(offset += 2, false) != 0x45786966) {
-            return resolve(-1)
-          }
- 
-          var little = view.getUint16(offset += 6, false) == 0x4949
-          offset += view.getUint32(offset + 4, little)
-          var tags = view.getUint16(offset, little)
-          offset += 2
-          for (var i = 0; i < tags; i++) {
-            if (view.getUint16(offset + (i * 12), little) == 0x0112) {
-              return resolve(view.getUint16(offset + (i * 12) + 8, little))
-            }
-          }
-        } else if ((marker & 0xFF00) != 0xFF00) {
-          break
-        } else {
-          offset += view.getUint16(offset, false)
-        }
-      }
-      return resolve(-1)
-    }
-    reader.onerror = (e) => reject(e)
-    reader.readAsArrayBuffer(file)
-  })
-}
- 
-/**
- *
- * @param {HTMLCanvasElement | OffscreenCanvas} canvas
- * @param options
- * @returns {HTMLCanvasElement | OffscreenCanvas}
- */
-export function handleMaxWidthOrHeight (canvas, options) {
-  const width = canvas.width
-  const height = canvas.height
-  const maxWidthOrHeight = options.maxWidthOrHeight
- 
-  const needToHandle = isFinite(maxWidthOrHeight) && (width > maxWidthOrHeight || height > maxWidthOrHeight)
- 
-  let newCanvas = canvas
-  let ctx
- 
-  if (needToHandle) {
-    [newCanvas, ctx] = getNewCanvasAndCtx(width, height)
-    if (width > height) {
-      newCanvas.width = maxWidthOrHeight
-      newCanvas.height = (height / width) * maxWidthOrHeight
-    } else {
-      newCanvas.width = (width / height) * maxWidthOrHeight
-      newCanvas.height = maxWidthOrHeight
-    }
-    ctx.drawImage(canvas, 0, 0, newCanvas.width, newCanvas.height)
- 
-    cleanupCanvasMemory(canvas)
-  }
- 
-  return newCanvas
-}
- 
-/**
- * followExifOrientation
- * source: https://stackoverflow.com/a/40867559/10395024
- *
- * @param {HTMLCanvasElement | OffscreenCanvas} canvas
- * @param {number} exifOrientation
- * @returns {HTMLCanvasElement | OffscreenCanvas} canvas
- */
-export function followExifOrientation (canvas, exifOrientation) {
-  const width = canvas.width
-  const height = canvas.height
- 
-  const [newCanvas, ctx] = getNewCanvasAndCtx(width, height)
- 
-  // set proper canvas dimensions before transform & export
-  Iif (4 < exifOrientation && exifOrientation < 9) {
-    newCanvas.width = height
-    newCanvas.height = width
-  } else {
-    newCanvas.width = width
-    newCanvas.height = height
-  }
- 
-  // transform context before drawing image
-  switch (exifOrientation) {
-    case 2:
-      ctx.transform(-1, 0, 0, 1, width, 0)
-      break
-    case 3:
-      ctx.transform(-1, 0, 0, -1, width, height)
-      break
-    case 4:
-      ctx.transform(1, 0, 0, -1, 0, height)
-      break
-    case 5:
-      ctx.transform(0, 1, 1, 0, 0, 0)
-      break
-    case 6:
-      ctx.transform(0, 1, -1, 0, height, 0)
-      break
-    case 7:
-      ctx.transform(0, -1, -1, 0, height, width)
-      break
-    case 8:
-      ctx.transform(0, -1, 1, 0, 0, width)
-      break
-    default:
-      break
-  }
- 
-  ctx.drawImage(canvas, 0, 0, width, height)
- 
-  cleanupCanvasMemory(canvas)
- 
-  return newCanvas
-}
- 
-/**
- * get new Canvas and it's context
- * @param width
- * @param height
- * @returns {[HTMLCanvasElement | OffscreenCanvas, CanvasRenderingContext2D]}
- */
-export function getNewCanvasAndCtx (width, height) {
-  let canvas
-  let ctx
-  try {
-    canvas = new OffscreenCanvas(width, height)
-    ctx = canvas.getContext('2d')
-    if (ctx === null) {
-      throw new Error('getContext of OffscreenCanvas returns null')
-    }
-  } catch (e) {
-    canvas = document.createElement('canvas')
-    ctx = canvas.getContext('2d')
-  }
-  canvas.width = width
-  canvas.height = height
-  // ctx.fillStyle = '#fff'
-  // ctx.fillRect(0, 0, width, height)
-  return [canvas, ctx]
-}
- 
-/**
- * clear Canvas memory
- * @param canvas
- * @returns null
- */
-export function cleanupCanvasMemory (canvas) {
-  // garbage clean canvas for safari
-  // ref: https://bugs.webkit.org/show_bug.cgi?id=195325
-  canvas.width = 0
-  canvas.height = 0
-}
- 
-Eif (isBrowser) {
-// Polyfill for Number.isInteger
-  Number.isInteger = Number.isInteger || function (value) {
-    return typeof value === 'number' &&
-      isFinite(value) &&
-      Math.floor(value) === value
-  }
-}
- 
- -
-
- - - - - - - - - \ No newline at end of file diff --git a/coverage/lcov-report/web-worker.js.html b/coverage/lcov-report/web-worker.js.html deleted file mode 100644 index dee4d35..0000000 --- a/coverage/lcov-report/web-worker.js.html +++ /dev/null @@ -1,294 +0,0 @@ - - - - Code coverage report for web-worker.js - - - - - - - -
-
-

- All files web-worker.js -

-
-
- 13.64% - Statements - 3/22 -
-
- 0% - Branches - 0/6 -
-
- 14.29% - Functions - 1/7 -
-
- 13.64% - Lines - 3/22 -
-
-

- Press n or j to go to the next uncovered block, b, p or k for the previous block. -

-
-
-

-
-
1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19 -20 -21 -22 -23 -24 -25 -26 -27 -28 -29 -30 -31 -32 -33 -34 -35 -36 -37 -38 -39 -40 -41 -42 -43 -44 -45 -46 -47 -48 -49 -50 -51 -52 -53 -54 -55 -56 -57 -58 -59 -60 -61 -62 -63 -64 -65 -66 -67 -68 -69 -70 -71 -72 -73 -74 -75 -76  -  -  -1x -  -  -  -1x -  -  -1x -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - 
import imageCompression from './index'
-import compress from './image-compression'
- 
-let cnt = 0
-let imageCompressionLibUrl
- 
-function createWorker (f) {
-  return new Worker(URL.createObjectURL(new Blob([`(${f})()`])))
-}
- 
-const worker = createWorker(() => {
-  self.addEventListener('message', async (e) => {
-    const { file, id, imageCompressionLibUrl, options } = e.data
-    try {
-      // console.log('[worker] importScripts', imageCompressionLibUrl)
-      importScripts(imageCompressionLibUrl)
-      // console.log('[worker] self', self)
-      const compressedFile = await imageCompression(file, options)
-      self.postMessage({ file: compressedFile, id })
-    } catch (e) {
-      // console.error('[worker] error', e)
-      self.postMessage({ error: e.message, id })
-    }
-  })
-})
- 
-function createSourceObject (str) {
-  return URL.createObjectURL(new Blob([str], { type: 'application/javascript' }))
-}
- 
-export function compressOnWebWorker (file, options) {
-  return new Promise(async (resolve, reject) => {
-    if (!imageCompressionLibUrl) {
-      imageCompressionLibUrl = createSourceObject(`
-    function imageCompression (){return (${imageCompression}).apply(null, arguments)}
-    
-    imageCompression.getDataUrlFromFile = ${imageCompression.getDataUrlFromFile}
-    imageCompression.getFilefromDataUrl = ${imageCompression.getFilefromDataUrl}
-    imageCompression.loadImage = ${imageCompression.loadImage}
-    imageCompression.drawImageInCanvas = ${imageCompression.drawImageInCanvas}
-    imageCompression.drawFileInCanvas = ${imageCompression.drawFileInCanvas}
-    imageCompression.canvasToFile = ${imageCompression.canvasToFile}
-    imageCompression.getExifOrientation = ${imageCompression.getExifOrientation}
-    imageCompression.handleMaxWidthOrHeight = ${imageCompression.handleMaxWidthOrHeight}
-    imageCompression.followExifOrientation = ${imageCompression.followExifOrientation}
-    
-    getDataUrlFromFile = imageCompression.getDataUrlFromFile
-    getFilefromDataUrl = imageCompression.getFilefromDataUrl
-    loadImage = imageCompression.loadImage
-    drawImageInCanvas = imageCompression.drawImageInCanvas
-    drawFileInCanvas = imageCompression.drawFileInCanvas
-    canvasToFile = imageCompression.canvasToFile
-    getExifOrientation = imageCompression.getExifOrientation
-    handleMaxWidthOrHeight = imageCompression.handleMaxWidthOrHeight
-    followExifOrientation = imageCompression.followExifOrientation
- 
-    function compress (){return (${compress}).apply(null, arguments)}
-    `)
-      // imageCompressionLibUrl = new URL('../dist/browser-image-compression.js', window.location.href).href
-    }
-    let id = cnt++
- 
-    function handler (e) {
-      if (e.data.id === id) {
-        worker.removeEventListener('message', handler)
-        if (e.data.error) {
-          reject(e.data.error)
-        }
-        resolve(e.data.file)
-      }
-    }
- 
-    worker.addEventListener('message', handler)
-    worker.postMessage({ file, id, imageCompressionLibUrl, options })
-  })
-}
-
-
- - - - - - - - diff --git a/coverage/lcov.info b/coverage/lcov.info index 9e1b47e..93d55aa 100644 --- a/coverage/lcov.info +++ b/coverage/lcov.info @@ -36,25 +36,25 @@ DA:79,5 DA:82,1 DA:83,1 DA:84,1 -DA:87,1 DA:88,1 -DA:89,2 +DA:89,1 DA:90,2 -DA:93,2 -DA:95,2 -DA:97,2 +DA:91,2 +DA:94,2 +DA:96,2 DA:98,2 DA:100,2 DA:102,2 DA:104,2 DA:106,2 -DA:109,1 -DA:110,1 +DA:108,2 DA:111,1 DA:112,1 DA:113,1 +DA:114,1 DA:115,1 -DA:116,1 +DA:117,1 +DA:118,1 LF:47 LH:47 BRDA:28,0,0,6 @@ -73,343 +73,400 @@ BRDA:76,7,0,5 BRDA:76,7,1,1 BRDA:76,8,0,6 BRDA:76,8,1,5 -BRDA:88,9,0,3 -BRDA:88,9,1,3 -BRDA:88,9,2,1 -BRDA:89,10,0,2 -BRDA:89,10,1,0 -BRDA:90,11,0,2 -BRDA:90,11,1,0 +BRDA:89,9,0,3 +BRDA:89,9,1,3 +BRDA:89,9,2,1 +BRDA:90,10,0,2 +BRDA:90,10,1,0 +BRDA:91,11,0,2 +BRDA:91,11,1,0 BRF:23 BRH:19 end_of_record TN: SF:lib\index.js -FN:32,imageCompression -FN:42,(anonymous_1) +FN:37,imageCompression +FN:47,(anonymous_1) FNF:2 FNH:2 FNDA:9,imageCompression FNDA:44,(anonymous_1) -DA:35,9 DA:38,9 -DA:39,9 -DA:40,9 DA:41,9 DA:42,9 -DA:43,44 -DA:44,44 -DA:45,0 -DA:49,9 -DA:50,2 -DA:51,7 -DA:52,1 -DA:56,6 -DA:64,6 -DA:65,0 -DA:68,0 -DA:72,0 -DA:76,6 +DA:44,9 +DA:45,9 +DA:46,9 +DA:47,9 +DA:48,44 +DA:49,44 +DA:50,0 +DA:54,9 +DA:55,2 +DA:56,7 +DA:57,1 +DA:62,6 +DA:70,6 +DA:71,0 +DA:73,0 +DA:76,0 DA:79,6 -DA:80,6 -DA:81,6 +DA:82,6 +DA:83,6 DA:84,6 -DA:87,1 -DA:88,1 -DA:89,1 -DA:90,1 +DA:88,6 DA:91,1 DA:92,1 DA:93,1 +DA:94,1 DA:95,1 DA:96,1 DA:97,1 -DA:98,1 DA:99,1 -LF:35 -LH:31 -BRDA:38,0,0,9 -BRDA:38,0,1,2 -BRDA:39,1,0,9 -BRDA:39,1,1,0 -BRDA:44,2,0,0 -BRDA:44,2,1,44 -BRDA:49,3,0,2 -BRDA:49,3,1,7 -BRDA:49,4,0,9 -BRDA:49,4,1,2 -BRDA:51,5,0,1 -BRDA:51,5,1,6 -BRDA:56,6,0,6 -BRDA:56,6,1,0 -BRDA:64,7,0,0 -BRDA:64,7,1,6 -BRDA:64,8,0,6 -BRDA:64,8,1,0 -BRDA:64,8,2,0 +DA:100,1 +DA:101,1 +DA:102,1 +DA:103,1 +DA:104,1 +DA:105,1 +LF:38 +LH:34 +BRDA:44,0,0,9 +BRDA:44,0,1,2 +BRDA:45,1,0,9 +BRDA:45,1,1,0 +BRDA:49,2,0,0 +BRDA:49,2,1,44 +BRDA:54,3,0,2 +BRDA:54,3,1,7 +BRDA:54,4,0,9 +BRDA:54,4,1,2 +BRDA:56,5,0,1 +BRDA:56,5,1,6 +BRDA:62,6,0,6 +BRDA:62,6,1,0 +BRDA:70,7,0,0 +BRDA:70,7,1,6 +BRDA:70,8,0,6 +BRDA:70,8,1,0 +BRDA:70,8,2,0 BRF:19 BRH:13 end_of_record TN: +SF:lib\polyfill.js +FNF:0 +FNH:0 +LF:0 +LH:0 +BRF:0 +BRH:0 +end_of_record +TN: SF:lib\utils.js -FN:12,isAutoOrientationInBrowser -FN:43,getDataUrlFromFile -FN:44,(anonymous_2) -FN:46,(anonymous_3) -FN:47,(anonymous_4) -FN:60,getFilefromDataUrl -FN:61,(anonymous_6) -FN:96,loadImage -FN:97,(anonymous_8) -FN:99,(anonymous_9) -FN:100,(anonymous_10) -FN:111,drawImageInCanvas -FN:123,drawFileInCanvas -FN:145,canvasToFile -FN:176,getExifOrientation -FN:177,(anonymous_15) -FN:179,(anonymous_16) -FN:212,(anonymous_17) -FN:223,handleMaxWidthOrHeight -FN:258,followExifOrientation -FN:313,getNewCanvasAndCtx -FN:338,cleanupCanvasMemory -FN:347,(anonymous_22) -FNF:23 -FNH:19 -FNDA:6,isAutoOrientationInBrowser +FN:19,getFilefromDataUrl +FN:20,(anonymous_1) +FN:55,getDataUrlFromFile +FN:56,(anonymous_3) +FN:58,(anonymous_4) +FN:59,(anonymous_5) +FN:70,loadImage +FN:71,(anonymous_7) +FN:73,(anonymous_8) +FN:74,(anonymous_9) +FN:88,getBrowserName +FN:113,approximateBelowMaximumCanvasSizeOfBrowser +FN:147,getNewCanvasAndCtx +FN:173,drawImageInCanvas +FN:186,drawFileInCanvas +FN:208,canvasToFile +FN:236,cleanupCanvasMemory +FN:247,isAutoOrientationInBrowser +FN:278,getExifOrientation +FN:279,(anonymous_19) +FN:281,(anonymous_20) +FN:314,(anonymous_21) +FN:325,handleMaxWidthOrHeight +FN:360,followExifOrientation +FNF:24 +FNH:21 +FNDA:9,getFilefromDataUrl +FNDA:9,(anonymous_1) FNDA:15,getDataUrlFromFile -FNDA:15,(anonymous_2) FNDA:15,(anonymous_3) -FNDA:0,(anonymous_4) -FNDA:9,getFilefromDataUrl -FNDA:9,(anonymous_6) +FNDA:15,(anonymous_4) +FNDA:0,(anonymous_5) FNDA:15,loadImage +FNDA:15,(anonymous_7) FNDA:15,(anonymous_8) -FNDA:15,(anonymous_9) -FNDA:0,(anonymous_10) +FNDA:0,(anonymous_9) +FNDA:14,getBrowserName +FNDA:14,approximateBelowMaximumCanvasSizeOfBrowser +FNDA:26,getNewCanvasAndCtx FNDA:14,drawImageInCanvas FNDA:13,drawFileInCanvas FNDA:9,canvasToFile +FNDA:18,cleanupCanvasMemory +FNDA:6,isAutoOrientationInBrowser FNDA:1,getExifOrientation -FNDA:1,(anonymous_15) -FNDA:1,(anonymous_16) -FNDA:0,(anonymous_17) +FNDA:1,(anonymous_19) +FNDA:1,(anonymous_20) +FNDA:0,(anonymous_21) FNDA:6,handleMaxWidthOrHeight FNDA:6,followExifOrientation -FNDA:26,getNewCanvasAndCtx -FNDA:18,cleanupCanvasMemory -FNDA:0,(anonymous_22) -DA:3,1 -DA:6,1 +DA:4,1 DA:7,1 DA:8,1 -DA:13,6 -DA:14,5 -DA:19,1 -DA:25,1 -DA:27,1 -DA:28,1 -DA:29,1 -DA:30,1 -DA:33,1 -DA:34,1 -DA:44,15 -DA:45,15 -DA:46,15 -DA:47,15 -DA:48,15 -DA:61,9 -DA:62,9 -DA:63,9 -DA:64,9 -DA:65,9 -DA:66,9 -DA:67,9 -DA:68,11249118 -DA:70,9 -DA:71,9 -DA:72,9 -DA:73,9 -DA:97,15 -DA:98,15 -DA:99,15 -DA:100,15 -DA:101,15 -DA:112,14 -DA:113,14 +DA:9,1 +DA:20,9 +DA:21,9 +DA:22,9 +DA:23,9 +DA:24,9 +DA:25,9 +DA:26,9 +DA:27,11249118 +DA:29,9 +DA:30,9 +DA:31,9 +DA:32,9 +DA:56,15 +DA:57,15 +DA:58,15 +DA:59,15 +DA:60,15 +DA:71,15 +DA:72,15 +DA:73,15 +DA:74,15 +DA:75,15 +DA:89,14 +DA:90,14 +DA:91,0 +DA:92,14 +DA:93,0 +DA:94,14 +DA:95,0 +DA:96,14 +DA:97,0 +DA:99,14 DA:114,14 -DA:125,13 -DA:126,13 -DA:128,13 -DA:129,13 -DA:131,13 -DA:132,13 -DA:147,9 -DA:148,3 -DA:149,3 -DA:150,3 -DA:151,3 -DA:152,3 -DA:153,3 -DA:154,6 -DA:155,0 -DA:156,0 -DA:157,0 -DA:162,6 -DA:163,6 -DA:165,9 -DA:177,1 -DA:178,1 -DA:179,1 -DA:180,1 -DA:181,1 -DA:182,1 -DA:184,0 -DA:185,0 -DA:186,0 -DA:187,0 -DA:188,0 -DA:189,0 -DA:190,0 -DA:191,0 -DA:192,0 -DA:195,0 -DA:196,0 -DA:197,0 -DA:198,0 -DA:199,0 -DA:200,0 -DA:201,0 -DA:204,0 -DA:205,0 -DA:207,0 -DA:210,0 -DA:212,1 -DA:213,1 -DA:224,6 +DA:115,14 +DA:117,14 +DA:118,14 +DA:119,14 +DA:120,14 +DA:122,14 +DA:123,0 +DA:124,0 +DA:125,0 +DA:126,0 +DA:127,0 +DA:129,0 +DA:130,0 +DA:133,0 +DA:136,14 +DA:150,26 +DA:151,26 +DA:152,0 +DA:153,0 +DA:154,0 +DA:157,26 +DA:158,26 +DA:160,26 +DA:161,26 +DA:164,26 +DA:174,14 +DA:175,14 +DA:176,14 +DA:177,14 +DA:188,13 +DA:189,13 +DA:191,13 +DA:192,13 +DA:194,13 +DA:195,13 +DA:210,9 +DA:211,3 +DA:212,3 +DA:213,3 +DA:214,3 +DA:215,3 +DA:216,3 +DA:217,6 +DA:218,0 +DA:219,0 +DA:220,0 DA:225,6 DA:226,6 -DA:228,6 -DA:230,6 -DA:233,6 -DA:234,4 -DA:235,4 -DA:236,2 -DA:237,2 -DA:239,2 -DA:240,2 -DA:242,4 -DA:244,4 -DA:247,6 -DA:259,6 -DA:260,6 -DA:262,6 -DA:265,6 -DA:266,0 -DA:267,0 -DA:269,6 -DA:270,6 -DA:274,6 -DA:276,0 -DA:277,0 -DA:279,0 -DA:280,0 -DA:282,0 -DA:283,0 -DA:285,0 +DA:228,9 +DA:240,18 +DA:242,18 +DA:248,6 +DA:252,1 +DA:258,1 +DA:260,1 +DA:261,1 +DA:262,1 +DA:263,1 +DA:266,1 +DA:267,1 +DA:279,1 +DA:280,1 +DA:281,1 +DA:282,1 +DA:283,1 +DA:284,1 DA:286,0 +DA:287,0 DA:288,0 DA:289,0 +DA:290,0 DA:291,0 DA:292,0 +DA:293,0 DA:294,0 -DA:295,0 -DA:297,6 -DA:300,6 -DA:302,6 -DA:304,6 -DA:316,26 -DA:317,26 -DA:318,0 -DA:319,0 -DA:320,0 -DA:323,26 -DA:324,26 -DA:326,26 -DA:327,26 -DA:330,26 -DA:341,18 -DA:342,18 -DA:345,1 -DA:347,1 -DA:348,0 -LF:144 -LH:101 -BRDA:6,0,0,1 -BRDA:6,0,1,1 -BRDA:6,0,2,0 -BRDA:6,0,3,0 -BRDA:7,1,0,1 -BRDA:7,1,1,1 -BRDA:7,1,2,0 -BRDA:7,1,3,1 -BRDA:8,2,0,1 -BRDA:8,2,1,1 -BRDA:8,2,2,0 -BRDA:8,2,3,1 -BRDA:13,3,0,5 -BRDA:13,3,1,1 -BRDA:33,4,0,1 -BRDA:33,4,1,0 -BRDA:60,5,0,2 -BRDA:145,6,0,1 -BRDA:147,7,0,3 -BRDA:147,7,1,6 -BRDA:154,8,0,0 -BRDA:154,8,1,6 -BRDA:154,9,0,6 -BRDA:154,9,1,0 -BRDA:181,10,0,1 -BRDA:181,10,1,0 -BRDA:187,11,0,0 -BRDA:187,11,1,0 -BRDA:190,12,0,0 -BRDA:190,12,1,0 -BRDA:191,13,0,0 -BRDA:191,13,1,0 -BRDA:200,14,0,0 -BRDA:200,14,1,0 -BRDA:204,15,0,0 -BRDA:204,15,1,0 -BRDA:228,16,0,6 -BRDA:228,16,1,4 -BRDA:228,16,2,0 -BRDA:233,17,0,4 -BRDA:233,17,1,2 -BRDA:235,18,0,2 -BRDA:235,18,1,2 -BRDA:265,19,0,0 -BRDA:265,19,1,6 -BRDA:265,20,0,6 -BRDA:265,20,1,0 -BRDA:274,21,0,0 -BRDA:274,21,1,0 -BRDA:274,21,2,0 -BRDA:274,21,3,0 -BRDA:274,21,4,0 -BRDA:274,21,5,0 -BRDA:274,21,6,0 -BRDA:274,21,7,6 -BRDA:319,22,0,0 -BRDA:319,22,1,0 -BRDA:345,23,0,1 -BRDA:345,23,1,0 -BRDA:347,24,0,1 -BRDA:347,24,1,0 -BRDA:348,25,0,0 -BRDA:348,25,1,0 -BRDA:348,25,2,0 -BRF:64 -BRH:29 +DA:297,0 +DA:298,0 +DA:299,0 +DA:300,0 +DA:301,0 +DA:302,0 +DA:303,0 +DA:306,0 +DA:307,0 +DA:309,0 +DA:312,0 +DA:314,1 +DA:315,1 +DA:326,6 +DA:327,6 +DA:328,6 +DA:330,6 +DA:332,6 +DA:335,6 +DA:336,4 +DA:337,4 +DA:338,2 +DA:339,2 +DA:341,2 +DA:342,2 +DA:344,4 +DA:346,4 +DA:349,6 +DA:361,6 +DA:362,6 +DA:364,6 +DA:367,6 +DA:368,0 +DA:369,0 +DA:371,6 +DA:372,6 +DA:376,6 +DA:378,0 +DA:379,0 +DA:381,0 +DA:382,0 +DA:384,0 +DA:385,0 +DA:387,0 +DA:388,0 +DA:390,0 +DA:391,0 +DA:393,0 +DA:394,0 +DA:396,0 +DA:397,0 +DA:399,6 +DA:402,6 +DA:404,6 +DA:406,6 +LF:167 +LH:113 +BRDA:7,0,0,1 +BRDA:7,0,1,1 +BRDA:7,0,2,0 +BRDA:7,0,3,0 +BRDA:8,1,0,1 +BRDA:8,1,1,1 +BRDA:8,1,2,0 +BRDA:8,1,3,1 +BRDA:8,1,4,1 +BRDA:9,2,0,1 +BRDA:9,2,1,1 +BRDA:9,2,2,0 +BRDA:9,2,3,1 +BRDA:9,2,4,1 +BRDA:19,3,0,2 +BRDA:90,4,0,0 +BRDA:90,4,1,14 +BRDA:90,5,0,14 +BRDA:90,5,1,14 +BRDA:92,6,0,0 +BRDA:92,6,1,14 +BRDA:94,7,0,0 +BRDA:94,7,1,14 +BRDA:96,8,0,0 +BRDA:96,8,1,14 +BRDA:96,9,0,14 +BRDA:96,9,1,14 +BRDA:120,10,0,9 +BRDA:120,10,1,5 +BRDA:125,11,0,0 +BRDA:125,11,1,0 +BRDA:153,12,0,0 +BRDA:153,12,1,0 +BRDA:208,13,0,1 +BRDA:210,14,0,3 +BRDA:210,14,1,6 +BRDA:217,15,0,0 +BRDA:217,15,1,6 +BRDA:217,16,0,6 +BRDA:217,16,1,0 +BRDA:248,17,0,5 +BRDA:248,17,1,1 +BRDA:266,18,0,1 +BRDA:266,18,1,0 +BRDA:283,19,0,1 +BRDA:283,19,1,0 +BRDA:289,20,0,0 +BRDA:289,20,1,0 +BRDA:292,21,0,0 +BRDA:292,21,1,0 +BRDA:293,22,0,0 +BRDA:293,22,1,0 +BRDA:302,23,0,0 +BRDA:302,23,1,0 +BRDA:306,24,0,0 +BRDA:306,24,1,0 +BRDA:330,25,0,6 +BRDA:330,25,1,4 +BRDA:330,25,2,0 +BRDA:335,26,0,4 +BRDA:335,26,1,2 +BRDA:337,27,0,2 +BRDA:337,27,1,2 +BRDA:367,28,0,0 +BRDA:367,28,1,6 +BRDA:367,29,0,6 +BRDA:367,29,1,0 +BRDA:376,30,0,0 +BRDA:376,30,1,0 +BRDA:376,30,2,0 +BRDA:376,30,3,0 +BRDA:376,30,4,0 +BRDA:376,30,5,0 +BRDA:376,30,6,0 +BRDA:376,30,7,6 +BRF:75 +BRH:39 +end_of_record +TN: +SF:lib\config\max-canvas-size.js +FNF:0 +FNH:0 +LF:0 +LH:0 +BRF:0 +BRH:0 end_of_record diff --git a/coverage/utils.js.html b/coverage/utils.js.html deleted file mode 100644 index 1cbd28b..0000000 --- a/coverage/utils.js.html +++ /dev/null @@ -1,1136 +0,0 @@ - - - - - - Code coverage report for utils.js - - - - - - - - - -
-
-

All files utils.js

-
- -
- 68.21% - Statements - 103/151 -
- - -
- 45.31% - Branches - 29/64 -
- - -
- 82.61% - Functions - 19/23 -
- - -
- 70.14% - Lines - 101/144 -
- - -
-

- Press n or j to go to the next uncovered block, b, p or k for the previous block. -

-
-
-

-
1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19 -20 -21 -22 -23 -24 -25 -26 -27 -28 -29 -30 -31 -32 -33 -34 -35 -36 -37 -38 -39 -40 -41 -42 -43 -44 -45 -46 -47 -48 -49 -50 -51 -52 -53 -54 -55 -56 -57 -58 -59 -60 -61 -62 -63 -64 -65 -66 -67 -68 -69 -70 -71 -72 -73 -74 -75 -76 -77 -78 -79 -80 -81 -82 -83 -84 -85 -86 -87 -88 -89 -90 -91 -92 -93 -94 -95 -96 -97 -98 -99 -100 -101 -102 -103 -104 -105 -106 -107 -108 -109 -110 -111 -112 -113 -114 -115 -116 -117 -118 -119 -120 -121 -122 -123 -124 -125 -126 -127 -128 -129 -130 -131 -132 -133 -134 -135 -136 -137 -138 -139 -140 -141 -142 -143 -144 -145 -146 -147 -148 -149 -150 -151 -152 -153 -154 -155 -156 -157 -158 -159 -160 -161 -162 -163 -164 -165 -166 -167 -168 -169 -170 -171 -172 -173 -174 -175 -176 -177 -178 -179 -180 -181 -182 -183 -184 -185 -186 -187 -188 -189 -190 -191 -192 -193 -194 -195 -196 -197 -198 -199 -200 -201 -202 -203 -204 -205 -206 -207 -208 -209 -210 -211 -212 -213 -214 -215 -216 -217 -218 -219 -220 -221 -222 -223 -224 -225 -226 -227 -228 -229 -230 -231 -232 -233 -234 -235 -236 -237 -238 -239 -240 -241 -242 -243 -244 -245 -246 -247 -248 -249 -250 -251 -252 -253 -254 -255 -256 -257 -258 -259 -260 -261 -262 -263 -264 -265 -266 -267 -268 -269 -270 -271 -272 -273 -274 -275 -276 -277 -278 -279 -280 -281 -282 -283 -284 -285 -286 -287 -288 -289 -290 -291 -292 -293 -294 -295 -296 -297 -298 -299 -300 -301 -302 -303 -304 -305 -306 -307 -308 -309 -310 -311 -312 -313 -314 -315 -316 -317 -318 -319 -320 -321 -322 -323 -324 -325 -326 -327 -328 -329 -330 -331 -332 -333 -334 -335 -336 -337 -338 -339 -340 -341 -342 -343 -344 -345 -346 -347 -348 -349 -350 -351 -352 -353  -  -1x -  -  -1x -1x -1x -  -  -  -  -6x -5x -  -  -  -  -1x -  -  -  -  -  -1x -  -1x -1x -1x -1x -  -  -1x -1x -  -  -  -  -  -  -  -  -  -15x -15x -15x -15x -15x -  -  -  -  -  -  -  -  -  -  -  -  -9x -9x -9x -9x -9x -9x -9x -11249118x -  -9x -9x -9x -9x -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -15x -15x -15x -15x -15x -  -  -  -  -  -  -  -  -  -  -14x -14x -14x -  -  -  -  -  -  -  -  -  -  -13x -13x -  -13x -13x -  -13x -13x -  -  -  -  -  -  -  -  -  -  -  -  -  -  -9x -3x -3x -3x -3x -3x -3x -6x -  -  -  -  -  -  -  -6x -6x -  -9x -  -  -  -  -  -  -  -  -  -  -  -1x -1x -1x -1x -1x -1x -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -1x -1x -  -  -  -  -  -  -  -  -  -  -6x -6x -6x -  -6x -  -6x -  -  -6x -4x -4x -2x -2x -  -2x -2x -  -4x -  -4x -  -  -6x -  -  -  -  -  -  -  -  -  -  -  -6x -6x -  -6x -  -  -6x -  -  -  -6x -6x -  -  -  -6x -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -6x -  -  -6x -  -6x -  -6x -  -  -  -  -  -  -  -  -  -  -  -26x -26x -  -  -  -  -  -26x -26x -  -26x -26x -  -  -26x -  -  -  -  -  -  -  -  -  -  -18x -18x -  -  -1x -  -1x -  -  -  -  -  - 
import UPNG from './UPNG'
- 
-const isBrowser = typeof window !== 'undefined' // change browser environment to support SSR
- 
-// add support for cordova-plugin-file
-const moduleMapper = isBrowser && window.cordova && window.cordova.require && window.cordova.require('cordova/modulemapper')
-export const CustomFile = isBrowser && ((moduleMapper && moduleMapper.getOriginalSymbol(window, 'File')) || File)
-export const CustomFileReader = isBrowser && ((moduleMapper && moduleMapper.getOriginalSymbol(window, 'FileReader')) || FileReader)
- 
-// Check if browser supports automatic image orientation
-// see https://github.com/blueimp/JavaScript-Load-Image/blob/1e4df707821a0afcc11ea0720ee403b8759f3881/js/load-image-orientation.js#L37-L53
-export async function isAutoOrientationInBrowser() {
-  if (isAutoOrientationInBrowser.result !== undefined)
-    return isAutoOrientationInBrowser.result
- 
-  // black 2x1 JPEG, with the following meta information set:
-  // EXIF Orientation: 6 (Rotated 90° CCW)
-  const testImageURL =
-    'data:image/jpeg;base64,/9j/4QAiRXhpZgAATU0AKgAAAAgAAQESAAMAAAABAAYAAAA' +
-    'AAAD/2wCEAAEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBA' +
-    'QEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQE' +
-    'BAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAf/AABEIAAEAAgMBEQACEQEDEQH/x' +
-    'ABKAAEAAAAAAAAAAAAAAAAAAAALEAEAAAAAAAAAAAAAAAAAAAAAAQEAAAAAAAAAAAAAAAA' +
-    'AAAAAEQEAAAAAAAAAAAAAAAAAAAAA/9oADAMBAAIRAxEAPwA/8H//2Q=='
-  const testImageFile = await getFilefromDataUrl(testImageURL, 'test.jpg', Date.now())
- 
-  const testImageCanvas = (await drawFileInCanvas(testImageFile))[1]
-  const testImageFile2 = await canvasToFile(testImageCanvas, testImageFile.type, testImageFile.name, testImageFile.lastModified)
-  cleanupCanvasMemory(testImageCanvas)
-  const img = (await drawFileInCanvas(testImageFile2))[0]
-  // console.log('img', img.width, img.height)
- 
-  isAutoOrientationInBrowser.result = img.width === 1 && img.height === 2
-  return isAutoOrientationInBrowser.result
-}
- 
-/**
- * getDataUrlFromFile
- *
- * @param {File | Blob} file
- * @returns {Promise<string>}
- */
-export function getDataUrlFromFile (file) {
-  return new Promise((resolve, reject) => {
-    const reader = new CustomFileReader()
-    reader.onload = () => resolve(reader.result)
-    reader.onerror = (e) => reject(e)
-    reader.readAsDataURL(file)
-  })
-}
- 
-/**
- * getFilefromDataUrl
- *
- * @param {string} dataUrl
- * @param {string} filename
- * @param {number} [lastModified=Date.now()]
- * @returns {Promise<File | Blob>}
- */
-export function getFilefromDataUrl (dataUrl, filename, lastModified = Date.now()) {
-  return new Promise((resolve) => {
-    const arr = dataUrl.split(',')
-    const mime = arr[0].match(/:(.*?);/)[1]
-    const bstr = globalThis.atob(arr[1])
-    let n = bstr.length
-    const u8arr = new Uint8Array(n)
-    while (n--) {
-      u8arr[n] = bstr.charCodeAt(n)
-    }
-    const file = new Blob([u8arr], { type: mime })
-    file.name = filename
-    file.lastModified = lastModified
-    resolve(file)
- 
-    // Safari has issue with File constructor not being able to POST in FormData
-    // https://github.com/Donaldcwl/browser-image-compression/issues/8
-    // https://bugs.webkit.org/show_bug.cgi?id=165081
-    // let file
-    // try {
-    //   file = new File([u8arr], filename, { type: mime }) // Edge do not support File constructor
-    // } catch (e) {
-    //   file = new Blob([u8arr], { type: mime })
-    //   file.name = filename
-    //   file.lastModified = lastModified
-    // }
-    // resolve(file)
-  })
-}
- 
-/**
- * loadImage
- *
- * @param {string} src
- * @returns {Promise<HTMLImageElement>}
- */
-export function loadImage (src) {
-  return new Promise((resolve, reject) => {
-    const img = new Image()
-    img.onload = () => resolve(img)
-    img.onerror = (e) => reject(e)
-    img.src = src
-  })
-}
- 
-/**
- * drawImageInCanvas
- *
- * @param {HTMLImageElement} img
- * @returns {HTMLCanvasElement | OffscreenCanvas}
- */
-export function drawImageInCanvas (img) {
-  const [canvas, ctx] = getNewCanvasAndCtx(img.width, img.height)
-  ctx.drawImage(img, 0, 0, canvas.width, canvas.height)
-  return canvas
-}
- 
-/**
- * drawFileInCanvas
- *
- * @param {File | Blob} file
- * @returns {Promise<[ImageBitmap | HTMLImageElement, HTMLCanvasElement | OffscreenCanvas]>}
- */
-export async function drawFileInCanvas (file) {
-  let img
-  try {
-    img = await createImageBitmap(file)
-  } catch (e) {
-    const dataUrl = await getDataUrlFromFile(file)
-    img = await loadImage(dataUrl)
-  }
-  const canvas = drawImageInCanvas(img)
-  return [img, canvas]
-}
- 
-/**
- * canvasToFile
- *
- * @param {HTMLCanvasElement | OffscreenCanvas} canvas
- * @param {string} fileType
- * @param {string} fileName
- * @param {number} fileLastModified
- * @param {number} [quality]
- * @returns {Promise<File | Blob>}
- */
-export async function canvasToFile (canvas, fileType, fileName, fileLastModified, quality = 1) {
-  let file
-  if (fileType === 'image/png') {
-    const ctx = canvas.getContext('2d')
-    const data = ctx.getImageData(0, 0, canvas.width, canvas.height).data
-    const png = UPNG.encode([data], canvas.width, canvas.height, 256 * quality)
-    file = new Blob([png], { type: fileType })
-    file.name = fileName
-    file.lastModified = fileLastModified
-  } else Iif (typeof OffscreenCanvas === 'function' && canvas instanceof OffscreenCanvas) { // checked on Win Chrome 83, MacOS Chrome 83
-    file = await canvas.convertToBlob({ type: fileType, quality })
-    file.name = fileName
-    file.lastModified = fileLastModified
-  // some browser do not support quality parameter, see: https://developer.mozilla.org/en-US/docs/Web/API/HTMLCanvasElement/toBlob
-  // } else if (typeof canvas.toBlob === 'function') {
-  //   file = await new Promise(resolve => canvas.toBlob(resolve, fileType, quality))
-  } else { // checked on Win Edge 44, Win IE 11, Win Firefox 76, MacOS Firefox 77, MacOS Safari 13.1
-    const dataUrl = canvas.toDataURL(fileType, quality)
-    file = await getFilefromDataUrl(dataUrl, fileName, fileLastModified)
-  }
-  return file
-}
- 
-/**
- * getExifOrientation
- * get image exif orientation info
- * source: https://stackoverflow.com/a/32490603/10395024
- *
- * @param {File | Blob} file
- * @returns {Promise<number>} - orientation id, see https://i.stack.imgur.com/VGsAj.gif
- */
-export function getExifOrientation (file) {
-  return new Promise((resolve, reject) => {
-    const reader = new CustomFileReader()
-    reader.onload = (e) => {
-      const view = new DataView(e.target.result)
-      Eif (view.getUint16(0, false) != 0xFFD8) {
-        return resolve(-2)
-      }
-      const length = view.byteLength
-      let offset = 2
-      while (offset < length) {
-        if (view.getUint16(offset + 2, false) <= 8) return resolve(-1)
-        const marker = view.getUint16(offset, false)
-        offset += 2
-        if (marker == 0xFFE1) {
-          if (view.getUint32(offset += 2, false) != 0x45786966) {
-            return resolve(-1)
-          }
- 
-          var little = view.getUint16(offset += 6, false) == 0x4949
-          offset += view.getUint32(offset + 4, little)
-          var tags = view.getUint16(offset, little)
-          offset += 2
-          for (var i = 0; i < tags; i++) {
-            if (view.getUint16(offset + (i * 12), little) == 0x0112) {
-              return resolve(view.getUint16(offset + (i * 12) + 8, little))
-            }
-          }
-        } else if ((marker & 0xFF00) != 0xFF00) {
-          break
-        } else {
-          offset += view.getUint16(offset, false)
-        }
-      }
-      return resolve(-1)
-    }
-    reader.onerror = (e) => reject(e)
-    reader.readAsArrayBuffer(file)
-  })
-}
- 
-/**
- *
- * @param {HTMLCanvasElement | OffscreenCanvas} canvas
- * @param options
- * @returns {HTMLCanvasElement | OffscreenCanvas}
- */
-export function handleMaxWidthOrHeight (canvas, options) {
-  const width = canvas.width
-  const height = canvas.height
-  const maxWidthOrHeight = options.maxWidthOrHeight
- 
-  const needToHandle = isFinite(maxWidthOrHeight) && (width > maxWidthOrHeight || height > maxWidthOrHeight)
- 
-  let newCanvas = canvas
-  let ctx
- 
-  if (needToHandle) {
-    [newCanvas, ctx] = getNewCanvasAndCtx(width, height)
-    if (width > height) {
-      newCanvas.width = maxWidthOrHeight
-      newCanvas.height = (height / width) * maxWidthOrHeight
-    } else {
-      newCanvas.width = (width / height) * maxWidthOrHeight
-      newCanvas.height = maxWidthOrHeight
-    }
-    ctx.drawImage(canvas, 0, 0, newCanvas.width, newCanvas.height)
- 
-    cleanupCanvasMemory(canvas)
-  }
- 
-  return newCanvas
-}
- 
-/**
- * followExifOrientation
- * source: https://stackoverflow.com/a/40867559/10395024
- *
- * @param {HTMLCanvasElement | OffscreenCanvas} canvas
- * @param {number} exifOrientation
- * @returns {HTMLCanvasElement | OffscreenCanvas} canvas
- */
-export function followExifOrientation (canvas, exifOrientation) {
-  const width = canvas.width
-  const height = canvas.height
- 
-  const [newCanvas, ctx] = getNewCanvasAndCtx(width, height)
- 
-  // set proper canvas dimensions before transform & export
-  Iif (4 < exifOrientation && exifOrientation < 9) {
-    newCanvas.width = height
-    newCanvas.height = width
-  } else {
-    newCanvas.width = width
-    newCanvas.height = height
-  }
- 
-  // transform context before drawing image
-  switch (exifOrientation) {
-    case 2:
-      ctx.transform(-1, 0, 0, 1, width, 0)
-      break
-    case 3:
-      ctx.transform(-1, 0, 0, -1, width, height)
-      break
-    case 4:
-      ctx.transform(1, 0, 0, -1, 0, height)
-      break
-    case 5:
-      ctx.transform(0, 1, 1, 0, 0, 0)
-      break
-    case 6:
-      ctx.transform(0, 1, -1, 0, height, 0)
-      break
-    case 7:
-      ctx.transform(0, -1, -1, 0, height, width)
-      break
-    case 8:
-      ctx.transform(0, -1, 1, 0, 0, width)
-      break
-    default:
-      break
-  }
- 
-  ctx.drawImage(canvas, 0, 0, width, height)
- 
-  cleanupCanvasMemory(canvas)
- 
-  return newCanvas
-}
- 
-/**
- * get new Canvas and it's context
- * @param width
- * @param height
- * @returns {[HTMLCanvasElement | OffscreenCanvas, CanvasRenderingContext2D]}
- */
-export function getNewCanvasAndCtx (width, height) {
-  let canvas
-  let ctx
-  try {
-    canvas = new OffscreenCanvas(width, height)
-    ctx = canvas.getContext('2d')
-    if (ctx === null) {
-      throw new Error('getContext of OffscreenCanvas returns null')
-    }
-  } catch (e) {
-    canvas = document.createElement('canvas')
-    ctx = canvas.getContext('2d')
-  }
-  canvas.width = width
-  canvas.height = height
-  // ctx.fillStyle = '#fff'
-  // ctx.fillRect(0, 0, width, height)
-  return [canvas, ctx]
-}
- 
-/**
- * clear Canvas memory
- * @param canvas
- * @returns null
- */
-export function cleanupCanvasMemory (canvas) {
-  // garbage clean canvas for safari
-  // ref: https://bugs.webkit.org/show_bug.cgi?id=195325
-  canvas.width = 0
-  canvas.height = 0
-}
- 
-Eif (isBrowser) {
-// Polyfill for Number.isInteger
-  Number.isInteger = Number.isInteger || function (value) {
-    return typeof value === 'number' &&
-      isFinite(value) &&
-      Math.floor(value) === value
-  }
-}
- 
- -
-
- - - - - - - - - \ No newline at end of file diff --git a/coverage/web-worker.js.html b/coverage/web-worker.js.html deleted file mode 100644 index dee4d35..0000000 --- a/coverage/web-worker.js.html +++ /dev/null @@ -1,294 +0,0 @@ - - - - Code coverage report for web-worker.js - - - - - - - -
-
-

- All files web-worker.js -

-
-
- 13.64% - Statements - 3/22 -
-
- 0% - Branches - 0/6 -
-
- 14.29% - Functions - 1/7 -
-
- 13.64% - Lines - 3/22 -
-
-

- Press n or j to go to the next uncovered block, b, p or k for the previous block. -

-
-
-

-
-
1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19 -20 -21 -22 -23 -24 -25 -26 -27 -28 -29 -30 -31 -32 -33 -34 -35 -36 -37 -38 -39 -40 -41 -42 -43 -44 -45 -46 -47 -48 -49 -50 -51 -52 -53 -54 -55 -56 -57 -58 -59 -60 -61 -62 -63 -64 -65 -66 -67 -68 -69 -70 -71 -72 -73 -74 -75 -76  -  -  -1x -  -  -  -1x -  -  -1x -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - 
import imageCompression from './index'
-import compress from './image-compression'
- 
-let cnt = 0
-let imageCompressionLibUrl
- 
-function createWorker (f) {
-  return new Worker(URL.createObjectURL(new Blob([`(${f})()`])))
-}
- 
-const worker = createWorker(() => {
-  self.addEventListener('message', async (e) => {
-    const { file, id, imageCompressionLibUrl, options } = e.data
-    try {
-      // console.log('[worker] importScripts', imageCompressionLibUrl)
-      importScripts(imageCompressionLibUrl)
-      // console.log('[worker] self', self)
-      const compressedFile = await imageCompression(file, options)
-      self.postMessage({ file: compressedFile, id })
-    } catch (e) {
-      // console.error('[worker] error', e)
-      self.postMessage({ error: e.message, id })
-    }
-  })
-})
- 
-function createSourceObject (str) {
-  return URL.createObjectURL(new Blob([str], { type: 'application/javascript' }))
-}
- 
-export function compressOnWebWorker (file, options) {
-  return new Promise(async (resolve, reject) => {
-    if (!imageCompressionLibUrl) {
-      imageCompressionLibUrl = createSourceObject(`
-    function imageCompression (){return (${imageCompression}).apply(null, arguments)}
-    
-    imageCompression.getDataUrlFromFile = ${imageCompression.getDataUrlFromFile}
-    imageCompression.getFilefromDataUrl = ${imageCompression.getFilefromDataUrl}
-    imageCompression.loadImage = ${imageCompression.loadImage}
-    imageCompression.drawImageInCanvas = ${imageCompression.drawImageInCanvas}
-    imageCompression.drawFileInCanvas = ${imageCompression.drawFileInCanvas}
-    imageCompression.canvasToFile = ${imageCompression.canvasToFile}
-    imageCompression.getExifOrientation = ${imageCompression.getExifOrientation}
-    imageCompression.handleMaxWidthOrHeight = ${imageCompression.handleMaxWidthOrHeight}
-    imageCompression.followExifOrientation = ${imageCompression.followExifOrientation}
-    
-    getDataUrlFromFile = imageCompression.getDataUrlFromFile
-    getFilefromDataUrl = imageCompression.getFilefromDataUrl
-    loadImage = imageCompression.loadImage
-    drawImageInCanvas = imageCompression.drawImageInCanvas
-    drawFileInCanvas = imageCompression.drawFileInCanvas
-    canvasToFile = imageCompression.canvasToFile
-    getExifOrientation = imageCompression.getExifOrientation
-    handleMaxWidthOrHeight = imageCompression.handleMaxWidthOrHeight
-    followExifOrientation = imageCompression.followExifOrientation
- 
-    function compress (){return (${compress}).apply(null, arguments)}
-    `)
-      // imageCompressionLibUrl = new URL('../dist/browser-image-compression.js', window.location.href).href
-    }
-    let id = cnt++
- 
-    function handler (e) {
-      if (e.data.id === id) {
-        worker.removeEventListener('message', handler)
-        if (e.data.error) {
-          reject(e.data.error)
-        }
-        resolve(e.data.file)
-      }
-    }
- 
-    worker.addEventListener('message', handler)
-    worker.postMessage({ file, id, imageCompressionLibUrl, options })
-  })
-}
-
-
- - - - - - - - diff --git a/dist/browser-image-compression.d.ts b/dist/browser-image-compression.d.ts index 4885a2f..d30fff7 100644 --- a/dist/browser-image-compression.d.ts +++ b/dist/browser-image-compression.d.ts @@ -36,4 +36,4 @@ declare namespace imageCompression { export as namespace imageCompression; -export = imageCompression; +export default imageCompression; diff --git a/dist/browser-image-compression.js b/dist/browser-image-compression.js index 143e439..460478d 100644 --- a/dist/browser-image-compression.js +++ b/dist/browser-image-compression.js @@ -1,9 +1,9 @@ /** * Browser Image Compression - * v1.0.14 + * v1.0.15 * by Donald * https://github.com/Donaldcwl/browser-image-compression */ -!function(e,r){"object"==typeof exports&&"undefined"!=typeof module?module.exports=r():"function"==typeof define&&define.amd?define(r):(e="undefined"!=typeof globalThis?globalThis:e||self).imageCompression=r()}(this,(function(){"use strict";function _defineProperty(e,r,t){return r in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e}function ownKeys(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);r&&(a=a.filter((function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable}))),t.push.apply(t,a)}return t}function _objectSpread2(e){for(var r=1;re.length)&&(r=e.length);for(var t=0,a=new Array(r);t>>24&255,a[t+1]=i>>>16&255,a[t+2]=i>>>8&255,a[t+3]=i>>>0&255,new Uint8Array(a.buffer,0,t+4)},UZIP.deflateRaw=function(e,r){null==r&&(r={level:6});var t=new Uint8Array(50+Math.floor(1.1*e.length)),a=UZIP.F.deflateRaw(e,t,a,r.level);return new Uint8Array(t.buffer,0,a)},UZIP.encode=function(e,r){null==r&&(r=!1);var t=0,a=UZIP.bin.writeUint,i=UZIP.bin.writeUshort,f={};for(var c in e){var s=!UZIP._noNeed(c)&&!r,l=e[c],u=UZIP.crc.crc(l,0,l.length);f[c]={cpr:s,usize:l.length,crc:u,file:s?UZIP.deflateRaw(l):l}}for(var c in f)t+=f[c].file.length+30+46+2*UZIP.bin.sizeUTF8(c);t+=22;var d=new Uint8Array(t),h=0,A=[];for(var c in f){var v=f[c];A.push(h),h=UZIP._writeHeader(d,h,c,v,0)}var p=0,U=h;for(var c in f){v=f[c];A.push(h),h=UZIP._writeHeader(d,h,c,v,1,A[p++])}var g=h-U;return a(d,h,101010256),h+=4,i(d,h+=4,p),i(d,h+=2,p),a(d,h+=2,g),a(d,h+=4,U),h+=4,h+=2,d.buffer},UZIP._noNeed=function(e){var r=e.split(".").pop().toLowerCase();return-1!="png,jpg,jpeg,zip".indexOf(r)},UZIP._writeHeader=function(e,r,t,a,i,f){var c=UZIP.bin.writeUint,s=UZIP.bin.writeUshort,l=a.file;return c(e,r,0==i?67324752:33639248),r+=4,1==i&&(r+=2),s(e,r,20),s(e,r+=2,0),s(e,r+=2,a.cpr?8:0),c(e,r+=2,0),c(e,r+=4,a.crc),c(e,r+=4,l.length),c(e,r+=4,a.usize),s(e,r+=4,UZIP.bin.sizeUTF8(t)),s(e,r+=2,0),r+=2,1==i&&(r+=2,r+=2,c(e,r+=6,f),r+=4),r+=UZIP.bin.writeUTF8(e,r,t),0==i&&(e.set(l,r),r+=l.length),r},UZIP.crc={table:function(){for(var e=new Uint32Array(256),r=0;r<256;r++){for(var t=r,a=0;a<8;a++)1&t?t=3988292384^t>>>1:t>>>=1;e[r]=t}return e}(),update:function(e,r,t,a){for(var i=0;i>>8;return e},crc:function(e,r,t){return 4294967295^UZIP.crc.update(4294967295,e,r,t)}},UZIP.adler=function(e,r,t){for(var a=1,i=0,f=r,c=r+t;f>8&255},readUint:function(e,r){return 16777216*e[r+3]+(e[r+2]<<16|e[r+1]<<8|e[r])},writeUint:function(e,r,t){e[r]=255&t,e[r+1]=t>>8&255,e[r+2]=t>>16&255,e[r+3]=t>>24&255},readASCII:function(e,r,t){for(var a="",i=0;i>6,e[r+i+1]=128|c>>0&63,i+=2;else if(0==(4294901760&c))e[r+i]=224|c>>12,e[r+i+1]=128|c>>6&63,e[r+i+2]=128|c>>0&63,i+=3;else{if(0!=(4292870144&c))throw"e";e[r+i]=240|c>>18,e[r+i+1]=128|c>>12&63,e[r+i+2]=128|c>>6&63,e[r+i+3]=128|c>>0&63,i+=4}}return i},sizeUTF8:function(e){for(var r=e.length,t=0,a=0;a>>3}var A=f.lits,v=f.strt,p=f.prev,U=0,g=0,m=0,w=0,P=0,b=0;for(h>2&&(v[b=UZIP.F._hash(e,0)]=0),l=0;l14e3||g>26697)&&h-l>100&&(d>>16,F=65535&y;if(0!=y){F=65535&y;var G=c(I=y>>>16,f.of0);f.lhst[257+G]++;var C=c(F,f.df0);f.dhst[C]++,w+=f.exb[G]+f.dxb[C],A[U]=I<<23|l-d,A[U+1]=F<<16|G<<8|C,U+=2,d=l+I}else f.lhst[e[l]]++;g++}}for(m==l&&0!=e.length||(d>>3},UZIP.F._bestMatch=function(e,r,t,a,i,f){var c=32767&r,s=t[c],l=c-s+32768&32767;if(s==c||a!=UZIP.F._hash(e,r-l))return 0;for(var u=0,d=0,h=Math.min(32767,r);l<=h&&0!=--f&&s!=c;){if(0==u||e[r+u]==e[r+u-l]){var A=UZIP.F._howLong(e,r,l);if(A>u){if(d=l,(u=A)>=i)break;l+2v&&(v=g,s=U)}}}l+=(c=s)-(s=t[c])+32768&32767}return u<<16|d},UZIP.F._howLong=function(e,r,t){if(e[r]!=e[r-t]||e[r+1]!=e[r+1-t]||e[r+2]!=e[r+2-t])return 0;var a=r,i=Math.min(e.length,r+258);for(r+=3;r>>23,Q=Z+(8388607&M);Z>16,O=T>>8&255,V=255&T;b(s,l=UZIP.F._writeLit(257+O,C,s,l),R-w.of0[O]),l+=w.exb[O],P(s,l=UZIP.F._writeLit(V,E,s,l),D-w.df0[V]),l+=w.dxb[V],Z+=R}}l=UZIP.F._writeLit(256,C,s,l)}return l},UZIP.F._copyExact=function(e,r,t,a,i){var f=i>>>3;return a[f]=t,a[f+1]=t>>>8,a[f+2]=255-a[f],a[f+3]=255-a[f+1],f+=4,a.set(new Uint8Array(e.buffer,r,t),f),i+(t+4<<3)},UZIP.F.getTrees=function(){for(var e=UZIP.F.U,r=UZIP.F._hufTree(e.lhst,e.ltree,15),t=UZIP.F._hufTree(e.dhst,e.dtree,15),a=[],i=UZIP.F._lenCodes(e.ltree,a),f=[],c=UZIP.F._lenCodes(e.dtree,f),s=0;s4&&0==e.itree[1+(e.ordr[u-1]<<1)];)u--;return[r,t,l,i,c,u,a,f]},UZIP.F.getSecond=function(e){for(var r=[],t=0;t>1)+",");return r},UZIP.F.contSize=function(e,r){for(var t=0,a=0;a15&&(UZIP.F._putsE(t,a,c,s),a+=s)}return a},UZIP.F._lenCodes=function(e,r){for(var t=e.length;2!=t&&0==e[t-1];)t-=2;for(var a=0;a>>1,138))<11?r.push(17,u-3):r.push(18,u-11),a+=2*u-2}else if(i==s&&f==i&&c==i){for(l=a+5;l+2>>1,6);r.push(16,u-3),a+=2*u-2}else r.push(i,0)}return t>>>1},UZIP.F._hufTree=function(e,r,t){var a=[],i=e.length,f=r.length,c=0;for(c=0;ct&&(UZIP.F.restrictDepth(l,t,U),U=t),c=0;cr;a++){var c=e[a].d;e[a].d=r,f+=i-(1<>>=t-r;f>0;){(c=e[a].d)=0;a--)e[a].d==r&&f<0&&(e[a].d--,f++);0!=f&&console.log("debt left")},UZIP.F._goodIndex=function(e,r){var t=0;return r[16|t]<=e&&(t|=16),r[8|t]<=e&&(t|=8),r[4|t]<=e&&(t|=4),r[2|t]<=e&&(t|=2),r[1|t]<=e&&(t|=1),t},UZIP.F._writeLit=function(e,r,t,a){return UZIP.F._putsF(t,a,r[e<<1]),a+r[1+(e<<1)]},UZIP.F.inflate=function(e,r){var t=Uint8Array;if(3==e[0]&&0==e[1])return r||new t(0);var a=UZIP.F,i=a._bitsF,f=a._bitsE,c=a._decodeTiny,s=a.makeCodes,l=a.codes2map,u=a._get17,d=a.U,h=null==r;h&&(r=new t(e.length>>>2<<3));for(var A,v,p=0,U=0,g=0,m=0,w=0,P=0,b=0,_=0,y=0;0==p;)if(p=i(e,y,1),U=i(e,y+1,2),y+=3,0!=U){if(h&&(r=UZIP.F._check(r,_+(1<<17))),1==U&&(A=d.flmap,v=d.fdmap,P=511,b=31),2==U){g=f(e,y,5)+257,m=f(e,y+5,5)+1,w=f(e,y+10,4)+4,y+=14;for(var I=0;I<38;I+=2)d.itree[I]=0,d.itree[I+1]=0;var F=1;for(I=0;IF&&(F=G)}y+=3*w,s(d.itree,F),l(d.itree,F,d.imap),A=d.lmap,v=d.dmap,y=c(d.imap,(1<>>4;if(Z>>>8==0)r[_++]=Z;else{if(256==Z)break;var x=_+Z-254;if(Z>264){var M=d.ldef[Z-257];x=_+(M>>>3)+f(e,y,7&M),y+=7&M}var R=v[u(e,y)&b];y+=15&R;var Q=R>>>4,T=d.ddef[Q],D=(T>>>4)+i(e,y,15&T);for(y+=15&T,h&&(r=UZIP.F._check(r,_+(1<<17)));_>>3),V=e[O-4]|e[O-3]<<8;h&&(r=UZIP.F._check(r,_+V)),r.set(new t(e.buffer,e.byteOffset+O,V),_),y=O+V<<3,_+=V}return r.length==_?r:r.slice(0,_)},UZIP.F._check=function(e,r){var t=e.length;if(r<=t)return e;var a=new Uint8Array(Math.max(t<<1,r));return a.set(e,0),a},UZIP.F._decodeTiny=function(e,r,t,a,i,f){for(var c=UZIP.F._bitsE,s=UZIP.F._get17,l=0;l>>4;if(d<=15)f[l]=d,l++;else{var h=0,A=0;16==d?(A=3+c(a,i,2),i+=2,h=f[l-1]):17==d?(A=3+c(a,i,3),i+=3):18==d&&(A=11+c(a,i,7),i+=7);for(var v=l+A;l>>1;fi&&(i=s),f++}for(;f>1,s=e[f+1],l=c<<4|s,u=r-s,d=e[f]<>>15-r]=l,d++}},UZIP.F.revCodes=function(e,r){for(var t=UZIP.F.U.rev15,a=15-r,i=0;i>>a}},UZIP.F._putsE=function(e,r,t){t<<=7&r;var a=r>>>3;e[a]|=t,e[a+1]|=t>>>8},UZIP.F._putsF=function(e,r,t){t<<=7&r;var a=r>>>3;e[a]|=t,e[a+1]|=t>>>8,e[a+2]|=t>>>16},UZIP.F._bitsE=function(e,r,t){return(e[r>>>3]|e[1+(r>>>3)]<<8)>>>(7&r)&(1<>>3]|e[1+(r>>>3)]<<8|e[2+(r>>>3)]<<16)>>>(7&r)&(1<>>3]|e[1+(r>>>3)]<<8|e[2+(r>>>3)]<<16)>>>(7&r)},UZIP.F._get25=function(e,r){return(e[r>>>3]|e[1+(r>>>3)]<<8|e[2+(r>>>3)]<<16|e[3+(r>>>3)]<<24)>>>(7&r)},UZIP.F.U=(r=Uint16Array,t=Uint32Array,{next_code:new r(16),bl_count:new r(16),ordr:[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],of0:[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,999,999,999],exb:[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0],ldef:new r(32),df0:[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,65535,65535],dxb:[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0],ddef:new t(32),flmap:new r(512),fltree:[],fdmap:new r(32),fdtree:[],lmap:new r(32768),ltree:[],ttree:[],dmap:new r(32768),dtree:[],imap:new r(512),itree:[],rev15:new r(32768),lhst:new t(286),dhst:new t(30),ihst:new t(19),lits:new t(15e3),strt:new r(65536),prev:new r(32768)}),function(){for(var e=UZIP.F.U,r=0;r<32768;r++){var t=r;t=(4278255360&(t=(4042322160&(t=(3435973836&(t=(2863311530&t)>>>1|(1431655765&t)<<1))>>>2|(858993459&t)<<2))>>>4|(252645135&t)<<4))>>>8|(16711935&t)<<8,e.rev15[r]=(t>>>16|t<<16)>>>17}function pushV(e,r,t){for(;0!=r--;)e.push(0,t)}for(r=0;r<32;r++)e.ldef[r]=e.of0[r]<<3|e.exb[r],e.ddef[r]=e.df0[r]<<4|e.dxb[r];pushV(e.fltree,144,8),pushV(e.fltree,112,9),pushV(e.fltree,24,7),pushV(e.fltree,8,8),UZIP.F.makeCodes(e.fltree,9),UZIP.F.codes2map(e.fltree,9,e.flmap),UZIP.F.revCodes(e.fltree,9),pushV(e.fdtree,32,5),UZIP.F.makeCodes(e.fdtree,5),UZIP.F.codes2map(e.fdtree,5,e.fdmap),UZIP.F.revCodes(e.fdtree,5),pushV(e.itree,19,0),pushV(e.ltree,286,0),pushV(e.dtree,30,0),pushV(e.ttree,320,0)}()})),UZIP=Object.freeze(Object.assign(Object.create(null),UZIP_1,{default:UZIP_1})),UPNG={},N,W,H;UPNG.toRGBA8=function(e){var r=e.width,t=e.height;if(null==e.tabs.acTL)return[UPNG.toRGBA8.decodeImage(e.data,r,t,e).buffer];var a=[];null==e.frames[0].data&&(e.frames[0].data=e.data);for(var i=r*t*4,f=new Uint8Array(i),c=new Uint8Array(i),s=new Uint8Array(i),l=0;l>3)]>>7-((7&v)<<0)&1);s[P]=b[C],s[P+1]=b[C+1],s[P+2]=b[C+2],s[P+3]=E>2)]>>6-((3&v)<<1)&3);s[P]=b[C],s[P+1]=b[C+1],s[P+2]=b[C+2],s[P+3]=E>1)]>>4-((1&v)<<2)&15);s[P]=b[C],s[P+1]=b[C+1],s[P+2]=b[C+2],s[P+3]=E>>3)]>>>7-(7&R)&1))==255*g?0:255;l[M+R]=Q<<24|B<<16|B<<8|B}else if(2==d)for(R=0;R>>2)]>>>6-((3&R)<<1)&3))==85*g?0:255;l[M+R]=Q<<24|B<<16|B<<8|B}else if(4==d)for(R=0;R>>1)]>>>4-((1&R)<<2)&15))==17*g?0:255;l[M+R]=Q<<24|B<<16|B<<8|B}else if(8==d)for(R=0;R>>2<<5));0==f;)if(f=U(e,v,1),c=U(e,v+1,2),v+=3,0!=c){if(y&&(r=H.H.W(r,A+(1<<17))),1==c&&(t=_.J,a=_.h,d=511,h=31),2==c){s=g(e,v,5)+257,l=g(e,v+5,5)+1,u=g(e,v+10,4)+4,v+=14;for(var I=1,F=0;F<38;F+=2)_.Q[F]=0,_.Q[F+1]=0;for(F=0;FI&&(I=G)}v+=3*u,w(_.Q,I),P(_.Q,I,_.u),t=_.w,a=_.d,v=m(_.u,(1<>>4;if(Z>>>8==0)r[A++]=Z;else{if(256==Z)break;var x=A+Z-254;if(Z>264){var M=_.q[Z-257];x=A+(M>>>3)+g(e,v,7&M),v+=7&M}var R=a[b(e,v)&h];v+=15&R;var Q=R>>>4,T=_.c[Q],D=(T>>>4)+U(e,v,15&T);for(v+=15&T;A>>3),V=e[O-4]|e[O-3]<<8;y&&(r=H.H.W(r,A+V)),r.set(new i(e.buffer,e.byteOffset+O,V),A),v=O+V<<3,A+=V}return r.length==A?r:r.slice(0,A)},H.H.W=function(e,r){var t=e.length;if(r<=t)return e;var a=new Uint8Array(t<<1);return a.set(e,0),a},H.H.R=function(e,r,t,a,i,f){for(var c=H.H.e,s=H.H.Z,l=0;l>>4;if(d<=15)f[l]=d,l++;else{var h=0,A=0;16==d?(A=3+c(a,i,2),i+=2,h=f[l-1]):17==d?(A=3+c(a,i,3),i+=3):18==d&&(A=11+c(a,i,7),i+=7);for(var v=l+A;l>>1;fi&&(i=s),f++}for(;f>1,s=e[f+1],l=c<<4|s,u=r-s,d=e[f]<>>15-r]=l,d++},H.H.l=function(e,r){for(var t=H.H.m.r,a=15-r,i=0;i>>a}},H.H.M=function(e,r,t){t<<=7&r;var a=r>>>3;e[a]|=t,e[a+1]|=t>>>8},H.H.I=function(e,r,t){t<<=7&r;var a=r>>>3;e[a]|=t,e[a+1]|=t>>>8,e[a+2]|=t>>>16},H.H.e=function(e,r,t){return(e[r>>>3]|e[1+(r>>>3)]<<8)>>>(7&r)&(1<>>3]|e[1+(r>>>3)]<<8|e[2+(r>>>3)]<<16)>>>(7&r)&(1<>>3]|e[1+(r>>>3)]<<8|e[2+(r>>>3)]<<16)>>>(7&r)},H.H.i=function(e,r){return(e[r>>>3]|e[1+(r>>>3)]<<8|e[2+(r>>>3)]<<16|e[3+(r>>>3)]<<24)>>>(7&r)},H.H.m=(N=Uint16Array,W=Uint32Array,{K:new N(16),j:new N(16),X:[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],S:[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,999,999,999],T:[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0],q:new N(32),p:[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,65535,65535],z:[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0],c:new W(32),J:new N(512),_:[],h:new N(32),$:[],w:new N(32768),C:[],v:[],d:new N(32768),D:[],u:new N(512),Q:[],r:new N(32768),s:new W(286),Y:new W(30),a:new W(19),t:new W(15e3),k:new N(65536),g:new N(32768)}),function(){for(var e=H.H.m,r=0;r<32768;r++){var t=r;t=(4278255360&(t=(4042322160&(t=(3435973836&(t=(2863311530&t)>>>1|(1431655765&t)<<1))>>>2|(858993459&t)<<2))>>>4|(252645135&t)<<4))>>>8|(16711935&t)<<8,e.r[r]=(t>>>16|t<<16)>>>17}function n(e,r,t){for(;0!=r--;)e.push(0,t)}for(r=0;r<32;r++)e.q[r]=e.S[r]<<3|e.T[r],e.c[r]=e.p[r]<<4|e.z[r];n(e._,144,8),n(e._,112,9),n(e._,24,7),n(e._,8,8),H.H.n(e._,9),H.H.A(e._,9,e.J),H.H.l(e._,9),n(e.$,32,5),H.H.n(e.$,5),H.H.A(e.$,5,e.h),H.H.l(e.$,5),n(e.Q,19,0),n(e.C,286,0),n(e.D,30,0),n(e.v,320,0)}(),H.H.N),UPNG.decode._readInterlace=function(e,r){for(var t=r.width,a=r.height,i=UPNG.decode._getBPP(r),f=i>>3,c=Math.ceil(t*i/8),s=new Uint8Array(a*c),l=0,u=[0,0,4,0,2,0,1],d=[0,4,0,2,0,1,0],h=[8,8,8,4,4,2,2],A=[8,8,4,4,2,2,1],v=0;v<7;){for(var p=h[v],U=A[v],g=0,m=0,w=u[v];w>3])>>7-(7&F)&1,s[y*c+(I>>3)]|=G<<7-((7&I)<<0);if(2==i)G=(G=e[F>>3])>>6-(7&F)&3,s[y*c+(I>>2)]|=G<<6-((3&I)<<1);if(4==i)G=(G=e[F>>3])>>4-(7&F)&15,s[y*c+(I>>1)]|=G<<4-((1&I)<<2);if(i>=8)for(var C=y*c+I*f,E=0;E>3)+E];F+=i,I+=U}_++,y+=p}g*m!=0&&(l+=m*(1+b)),v+=1}return s},UPNG.decode._getBPP=function(e){return[1,null,3,1,2,null,4][e.ctype]*e.depth},UPNG.decode._filterZero=function(e,r,t,a,i){var f=UPNG.decode._getBPP(r),c=Math.ceil(a*f/8),s=UPNG.decode._paeth;f=Math.ceil(f/8);var l=0,u=1,d=e[t],h=0;if(d>1&&(e[t]=[0,0,1][d-2]),3==d)for(h=f;h>>1)&255;for(var A=0;A>>1);for(;h>>1)}else{for(;h>8&255,e[r+1]=255&t},readUint:function readUint(e,r){return 16777216*e[r]+(e[r+1]<<16|e[r+2]<<8|e[r+3])},writeUint:function writeUint(e,r,t){e[r]=t>>24&255,e[r+1]=t>>16&255,e[r+2]=t>>8&255,e[r+3]=255&t},readASCII:function readASCII(e,r,t){for(var a="",i=0;i=0&&s>=0?(h=v*r+p<<2,A=(s+v)*i+c+p<<2):(h=(-s+v)*r-c+p<<2,A=v*i+p<<2),0==l)a[A]=e[h],a[A+1]=e[h+1],a[A+2]=e[h+2],a[A+3]=e[h+3];else if(1==l){var U=e[h+3]*(1/255),g=e[h]*U,m=e[h+1]*U,w=e[h+2]*U,P=a[A+3]*(1/255),b=a[A]*P,_=a[A+1]*P,y=a[A+2]*P,I=1-U,F=U+P*I,G=0==F?0:1/F;a[A+3]=255*F,a[A+0]=(g+b*I)*G,a[A+1]=(m+_*I)*G,a[A+2]=(w+y*I)*G}else if(2==l){U=e[h+3],g=e[h],m=e[h+1],w=e[h+2],P=a[A+3],b=a[A],_=a[A+1],y=a[A+2];U==P&&g==b&&m==_&&w==y?(a[A]=0,a[A+1]=0,a[A+2]=0,a[A+3]=0):(a[A]=g,a[A+1]=m,a[A+2]=w,a[A+3]=U)}else if(3==l){U=e[h+3],g=e[h],m=e[h+1],w=e[h+2],P=a[A+3],b=a[A],_=a[A+1],y=a[A+2];if(U==P&&g==b&&m==_&&w==y)continue;if(U<220&&P>20)return!1}return!0},UPNG.encode=function(e,r,t,a,i,f,c){null==a&&(a=0),null==c&&(c=!1);var s=UPNG.encode.compress(e,r,t,a,[!1,!1,!1,0,c]);return UPNG.encode.compressPNG(s,-1),UPNG.encode._main(s,r,t,i,f)},UPNG.encodeLL=function(e,r,t,a,i,f,c,s){for(var l={ctype:0+(1==a?0:2)+(0==i?0:4),depth:f,frames:[]},u=(a+i)*f,d=u*r,h=0;h1,h=!1,A=33+(d?20:0);if(null!=i.sRGB&&(A+=13),null!=i.pHYs&&(A+=21),3==e.ctype){for(var v=e.plte.length,p=0;p>>24!=255&&(h=!0);A+=8+3*v+4+(h?8+1*v+4:0)}for(var U=0;U>>8&255,y=P>>>16&255;g[u+w+0]=b,g[u+w+1]=_,g[u+w+2]=y}if(c(g,u+=3*v,f(g,u-3*v-4,3*v+4)),u+=4,h){c(g,u,v),l(g,u+=4,"tRNS"),u+=4;for(p=0;p>>24&255;c(g,u+=v,f(g,u-v-4,v+4)),u+=4}}var I=0;for(U=0;U>2,E>>2));for(v=0;vx&&R==Z[g-x])M[g]=M[g-x];else{var Q=P[R];if(null==Q&&(P[R]=Q=b.length,b.push(R),b.length>=300))break;M[g]=Q}}}var T=b.length;T<=256&&0==u&&(h=T<=2?1:T<=4?2:T<=16?4:8,h=Math.max(h,l));for(v=0;v>1)]|=L[q+j]<<4-4*(1&j);else if(2==h)for(j=0;j>2)]|=L[q+j]<<6-2*(3&j);else if(1==h)for(j=0;j>3)]|=L[q+j]<<7-1*(7&j)}O=k,d=3,z=1}else if(0==m&&1==w.length){k=new Uint8Array(x*D*3);var $=x*D;for(g=0;g<$;g++){var K,J=4*g;k[K=3*g]=O[J],k[K+1]=O[J+1],k[K+2]=O[J+2]}O=k,d=2,z=3,V=3*x}B.img=O,B.bpl=V,B.bpp=z}return{ctype:d,depth:h,plte:b,frames:w}},UPNG.encode.framize=function(e,r,t,a,i,f){for(var c=[],s=0;sF&&(F=E),CG&&(G=C))}-1==F&&(y=I=F=G=0),i&&(1==(1&y)&&y--,1==(1&I)&&I--);var B=(F-y+1)*(G-I+1);Bg&&(g=b),_m&&(m=_))}-1==g&&(p=U=g=m=0),c&&(1==(1&p)&&p--,1==(1&U)&&U--),f={x:p,y:U,width:g-p+1,height:m-U+1};var F=a[i];F.rect=f,F.blend=1,F.img=new Uint8Array(f.width*f.height*4),0==a[i-1].dispose?(UPNG._copyTile(u,r,t,F.img,f.width,f.height,-f.x,-f.y,0),UPNG.encode._prepareDiff(A,r,t,F.img,f)):UPNG._copyTile(A,r,t,F.img,f.width,f.height,-f.x,-f.y,0)},UPNG.encode._prepareDiff=function(e,r,t,a,i){UPNG._copyTile(e,r,t,a,i.width,i.height,-i.x,-i.y,2)},UPNG.encode._filterZero=function(e,r,t,a,i,f,c){var s,l=[],u=[0,1,2,3,4];-1!=f?u=[f]:(r*a>5e5||1==t)&&(u=[0]),c&&(s={level:0});for(var d=UZIP,h=0;h>1)+256&255;if(4==f)for(u=i;u>1)&255;for(u=i;u>1)&255}if(4==f){for(u=0;u>>1:t>>>=1;e[r]=t}return e}(),update:function update(e,r,t,a){for(var i=0;i>>8;return e},crc:function crc(e,r,t){return 4294967295^UPNG.crc.update(4294967295,e,r,t)}},UPNG.quantize=function(e,r){var t,a=new Uint8Array(e),i=a.slice(0),f=new Uint32Array(i.buffer),c=UPNG.quantize.getKDtree(i,r),s=c[0],l=c[1],u=UPNG.quantize.planeDst,d=a,h=f,A=d.length,v=new Uint8Array(a.length>>2);if(a.length<2e7)for(var p=0;p>2]=t.ind,h[p>>2]=t.est.rgba}else for(p=0;p>2]=t.ind,h[p>>2]=t.est.rgba}return{abuf:i.buffer,inds:v,plte:l}},UPNG.quantize.getKDtree=function(e,r,t){null==t&&(t=1e-4);var a=new Uint32Array(e.buffer),i={i0:0,i1:e.length,bst:null,est:null,tdst:0,left:null,right:null};i.bst=UPNG.quantize.stats(e,i.i0,i.i1),i.est=UPNG.quantize.estats(i.bst);for(var f=[i];f.lengthc&&(c=f[l].est.L,s=l);if(c=d||u.i1<=d)u.est.L=0;else{var h={i0:u.i0,i1:d,bst:null,est:null,tdst:0,left:null,right:null};h.bst=UPNG.quantize.stats(e,h.i0,h.i1),h.est=UPNG.quantize.estats(h.bst);var A={i0:d,i1:u.i1,bst:null,est:null,tdst:0,left:null,right:null};A.bst={R:[],m:[],N:u.bst.N-h.bst.N};for(l=0;l<16;l++)A.bst.R[l]=u.bst.R[l]-h.bst.R[l];for(l=0;l<4;l++)A.bst.m[l]=u.bst.m[l]-h.bst.m[l];A.est=UPNG.quantize.estats(A.bst),u.left=h,u.right=A,f[s]=h,f.push(A)}}f.sort((function(e,r){return r.bst.N-e.bst.N}));for(l=0;l0&&(c=e.right,s=e.left);var l=UPNG.quantize.getNearest(c,r,t,a,i);if(l.tdst<=f*f)return l;var u=UPNG.quantize.getNearest(s,r,t,a,i);return u.tdstf;)a-=4;if(t>=a)break;var s=r[t>>2];r[t>>2]=r[a>>2],r[a>>2]=s,t+=4,a-=4}for(;c(e,t,i)>f;)t-=4;return t+4},UPNG.quantize.vecDot=function(e,r,t){return e[r]*t[0]+e[r+1]*t[1]+e[r+2]*t[2]+e[r+3]*t[3]},UPNG.quantize.stats=function(e,r,t){for(var a=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],i=[0,0,0,0],f=t-r>>2,c=r;c>>0}},UPNG.M4={multVec:function multVec(e,r){return[e[0]*r[0]+e[1]*r[1]+e[2]*r[2]+e[3]*r[3],e[4]*r[0]+e[5]*r[1]+e[6]*r[2]+e[7]*r[3],e[8]*r[0]+e[9]*r[1]+e[10]*r[2]+e[11]*r[3],e[12]*r[0]+e[13]*r[1]+e[14]*r[2]+e[15]*r[3]]},dot:function dot(e,r){return e[0]*r[0]+e[1]*r[1]+e[2]*r[2]+e[3]*r[3]},sml:function sml(e,r){return[e*r[0],e*r[1],e*r[2],e*r[3]]}},UPNG.encode.concatRGBA=function(e){for(var r=0,t=0;t2&&void 0!==arguments[2]?arguments[2]:Date.now();return new Promise((function(a){for(var i=e.split(","),f=i[0].match(/:(.*?);/)[1],c=globalThis.atob(i[1]),s=c.length,l=new Uint8Array(s);s--;)l[s]=c.charCodeAt(s);var u=new Blob([l],{type:f});u.name=r,u.lastModified=t,a(u)}))}function loadImage(e){return new Promise((function(r,t){var a=new Image;a.onload=function(){return r(a)},a.onerror=function(e){return t(e)},a.src=e}))}function drawImageInCanvas(e){var r=_slicedToArray(getNewCanvasAndCtx(e.width,e.height),2),t=r[0];return r[1].drawImage(e,0,0,t.width,t.height),t}function drawFileInCanvas(e){return new Promise((function(r,t){var a,i,f=function $Try_1_Post(){try{return i=drawImageInCanvas(a),r([a,i])}catch(e){return t(e)}},c=function $Try_1_Catch(r){try{return getDataUrlFromFile(e).then((function(e){try{return loadImage(e).then((function(e){try{return a=e,f()}catch(e){return t(e)}}),t)}catch(e){return t(e)}}),t)}catch(e){return t(e)}};try{return createImageBitmap(e).then((function(e){try{return a=e,f()}catch(e){return c()}}),c)}catch(e){c()}}))}function canvasToFile(e,r,t,a){var i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:1;return new Promise((function(f,c){var s,l,u;if("image/png"===r)return l=e.getContext("2d").getImageData(0,0,e.width,e.height).data,u=UPNG.encode([l],e.width,e.height,256*i),(s=new Blob([u],{type:r})).name=t,s.lastModified=a,$If_4.call(this);{return"function"==typeof OffscreenCanvas&&e instanceof OffscreenCanvas?e.convertToBlob({type:r,quality:i}).then(function(e){try{return(s=e).name=t,s.lastModified=a,$If_5.call(this)}catch(e){return c(e)}}.bind(this),c):getFilefromDataUrl(e.toDataURL(r,i),t,a).then(function(e){try{return s=e,$If_5.call(this)}catch(e){return c(e)}}.bind(this),c);function $If_5(){return $If_4.call(this)}}function $If_4(){return f(s)}}))}function getExifOrientation(e){return new Promise((function(r,t){var a=new CustomFileReader;a.onload=function(e){var t=new DataView(e.target.result);if(65496!=t.getUint16(0,!1))return r(-2);for(var a=t.byteLength,i=2;if||i>f)){var s=_slicedToArray(getNewCanvasAndCtx(a,i),2);c=s[0],t=s[1],a>i?(c.width=f,c.height=i/a*f):(c.width=a/i*f,c.height=f),t.drawImage(e,0,0,c.width,c.height),cleanupCanvasMemory(e)}return c}function followExifOrientation(e,r){var t=e.width,a=e.height,i=_slicedToArray(getNewCanvasAndCtx(t,a),2),f=i[0],c=i[1];switch(42&&void 0!==arguments[2]?arguments[2]:0;return new Promise((function(a,i){var f,c,s,l,u,d,h,A,v,p,U,g,m,w,P,b,_,y;function incProgress(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:5;f+=e,r.onProgress(Math.min(f,100))}function setProgress(e){f=Math.min(Math.max(e,f),100),r.onProgress(f)}return f=t,c=r.maxIteration||10,s=1024*r.maxSizeMB*1024,incProgress(),drawFileInCanvas(e).then(function(t){try{var f=_slicedToArray(t,2);return f[0],l=f[1],incProgress(),u=handleMaxWidthOrHeight(l,r),incProgress(),new Promise((function(t,a){var i;if(!(i=r.exifOrientation))return getExifOrientation(e).then(function(e){try{return i=e,$If_2.call(this)}catch(e){return a(e)}}.bind(this),a);function $If_2(){return t(i)}return $If_2.call(this)})).then(function(t){try{return d=t,incProgress(),isAutoOrientationInBrowser().then(function(t){try{return h=t?u:followExifOrientation(u,d),incProgress(),A=r.initialQuality||1,v=r.fileType||e.type,canvasToFile(h,v,e.name,e.lastModified,A).then(function(r){try{{if(p=r,incProgress(),U=p.size>s,g=p.size>e.size,!U&&!g)return setProgress(100),a(p);var t;function $Loop_3(){if(c--&&(P>s||P>m)){var r,t,a=_slicedToArray(getNewCanvasAndCtx(r=U?.95*y.width:y.width,t=U?.95*y.height:y.height),2);return _=a[0],a[1].drawImage(y,0,0,r,t),A*=.95,canvasToFile(_,v,e.name,e.lastModified,A).then((function(e){try{return b=e,cleanupCanvasMemory(y),y=_,P=b.size,setProgress(Math.min(99,Math.floor((w-P)/(w-s)*100))),$Loop_3}catch(e){return i(e)}}),i)}return[1]}return m=e.size,w=p.size,P=w,y=h,(t=function(e){for(;e;){if(e.then)return void e.then(t,i);try{if(e.pop){if(e.length)return e.pop()?$Loop_3_exit.call(this):e;e=$Loop_3}else e=e.call(this)}catch(e){return i(e)}}}.bind(this))($Loop_3);function $Loop_3_exit(){return cleanupCanvasMemory(y),cleanupCanvasMemory(_),cleanupCanvasMemory(u),cleanupCanvasMemory(h),cleanupCanvasMemory(l),setProgress(100),a(b)}}}catch(e){return i(e)}}.bind(this),i)}catch(e){return i(e)}}.bind(this),i)}catch(e){return i(e)}}.bind(this),i)}catch(e){return i(e)}}.bind(this),i)}))}isBrowser&&(Number.isInteger=Number.isInteger||function(e){return"number"==typeof e&&isFinite(e)&&Math.floor(e)===e});var cnt=0,imageCompressionLibUrl,worker;function createWorker(e){return"function"==typeof e&&(e="(".concat(f,")()")),new Worker(URL.createObjectURL(new Blob([e])))}function createSourceObject(e){return URL.createObjectURL(new Blob([e],{type:"application/javascript"}))}function stringify(e){return JSON.stringify(e,(function(e,r){return"function"==typeof r?"BIC_FN:::(() => ".concat(r.toString(),")()"):r}))}function parse(o){if("string"==typeof o)return o;var result={};return Object.entries(o).forEach((function(_ref){var _ref2=_slicedToArray(_ref,2),key=_ref2[0],value=_ref2[1];if("string"==typeof value&&value.startsWith("BIC_FN:::"))try{result[key]=eval(value.replace(/^BIC_FN:::/,""))}catch(e){throw console.log(key,e),e}else result[key]=parse(value)})),result}function generateLib(){return createSourceObject("\n // reconstruct library\n function imageCompression (){return (".concat(imageCompression,").apply(null, arguments)}\n\n imageCompression.getDataUrlFromFile = ").concat(imageCompression.getDataUrlFromFile,"\n imageCompression.getFilefromDataUrl = ").concat(imageCompression.getFilefromDataUrl,"\n imageCompression.loadImage = ").concat(imageCompression.loadImage,"\n imageCompression.drawImageInCanvas = ").concat(imageCompression.drawImageInCanvas,"\n imageCompression.drawFileInCanvas = ").concat(imageCompression.drawFileInCanvas,"\n imageCompression.canvasToFile = ").concat(imageCompression.canvasToFile,"\n imageCompression.getExifOrientation = ").concat(imageCompression.getExifOrientation,"\n imageCompression.handleMaxWidthOrHeight = ").concat(imageCompression.handleMaxWidthOrHeight,"\n imageCompression.followExifOrientation = ").concat(imageCompression.followExifOrientation,"\n imageCompression.cleanupCanvasMemory = ").concat(imageCompression.cleanupCanvasMemory,"\n imageCompression.isAutoOrientationInBrowser = ").concat(imageCompression.isAutoOrientationInBrowser,"\n\n // functions / objects\n getDataUrlFromFile = imageCompression.getDataUrlFromFile\n getFilefromDataUrl = imageCompression.getFilefromDataUrl\n loadImage = imageCompression.loadImage\n drawImageInCanvas = imageCompression.drawImageInCanvas\n drawFileInCanvas = imageCompression.drawFileInCanvas\n canvasToFile = imageCompression.canvasToFile\n getExifOrientation = imageCompression.getExifOrientation\n handleMaxWidthOrHeight = imageCompression.handleMaxWidthOrHeight\n followExifOrientation = imageCompression.followExifOrientation\n cleanupCanvasMemory = imageCompression.cleanupCanvasMemory\n isAutoOrientationInBrowser = imageCompression.isAutoOrientationInBrowser\n \n getNewCanvasAndCtx = ").concat(getNewCanvasAndCtx,"\n CustomFileReader = FileReader\n CustomFile = File\n function _slicedToArray(arr, n) { return arr }\n function _typeof(a) { return typeof a }\n function compress (){return (").concat(compress,").apply(null, arguments)}\n\n // Libraries\n const parse = ").concat(parse,"\n const UPNG = {}\n UPNG.toRGBA8 = ").concat(UPNG.toRGBA8,"\n UPNG.toRGBA8.decodeImage = ").concat(UPNG.toRGBA8.decodeImage,"\n UPNG.decode = ").concat(UPNG.decode,"\n UPNG.decode._decompress = ").concat(UPNG.decode._decompress,"\n UPNG.decode._inflate = ").concat(UPNG.decode._inflate,"\n UPNG.decode._readInterlace = ").concat(UPNG.decode._readInterlace,"\n UPNG.decode._getBPP = ").concat(UPNG.decode._getBPP," \n UPNG.decode._filterZero = ").concat(UPNG.decode._filterZero,"\n UPNG.decode._paeth = ").concat(UPNG.decode._paeth,"\n UPNG.decode._IHDR = ").concat(UPNG.decode._IHDR,"\n UPNG._bin = parse(").concat(stringify(UPNG._bin),")\n UPNG._copyTile = ").concat(UPNG._copyTile,"\n UPNG.encode = ").concat(UPNG.encode,"\n UPNG.encodeLL = ").concat(UPNG.encodeLL," \n UPNG.encode._main = ").concat(UPNG.encode._main,"\n UPNG.encode.compressPNG = ").concat(UPNG.encode.compressPNG," \n UPNG.encode.compress = ").concat(UPNG.encode.compress,"\n UPNG.encode.framize = ").concat(UPNG.encode.framize," \n UPNG.encode._updateFrame = ").concat(UPNG.encode._updateFrame," \n UPNG.encode._prepareDiff = ").concat(UPNG.encode._prepareDiff," \n UPNG.encode._filterZero = ").concat(UPNG.encode._filterZero," \n UPNG.encode._filterLine = ").concat(UPNG.encode._filterLine,"\n UPNG.encode.concatRGBA = ").concat(UPNG.encode.concatRGBA,"\n UPNG.crc = parse(").concat(stringify(UPNG.crc),")\n UPNG.crc.table = ( function() {\n var tab = new Uint32Array(256);\n for (var n=0; n<256; n++) {\n var c = n;\n for (var k=0; k<8; k++) {\n if (c & 1) c = 0xedb88320 ^ (c >>> 1);\n else c = c >>> 1;\n }\n tab[n] = c; }\n return tab; })()\n UPNG.quantize = ").concat(UPNG.quantize," \n UPNG.quantize.getKDtree = ").concat(UPNG.quantize.getKDtree," \n UPNG.quantize.getNearest = ").concat(UPNG.quantize.getNearest," \n UPNG.quantize.planeDst = ").concat(UPNG.quantize.planeDst," \n UPNG.quantize.dist = ").concat(UPNG.quantize.dist," \n UPNG.quantize.splitPixels = ").concat(UPNG.quantize.splitPixels," \n UPNG.quantize.vecDot = ").concat(UPNG.quantize.vecDot," \n UPNG.quantize.stats = ").concat(UPNG.quantize.stats," \n UPNG.quantize.estats = ").concat(UPNG.quantize.estats,"\n UPNG.M4 = parse(").concat(stringify(UPNG.M4),")\n UPNG.encode.concatRGBA = ").concat(UPNG.encode.concatRGBA,'\n UPNG.inflateRaw=function(){\n var H={};H.H={};H.H.N=function(N,W){var R=Uint8Array,i=0,m=0,J=0,h=0,Q=0,X=0,u=0,w=0,d=0,v,C;\n if(N[0]==3&&N[1]==0)return W?W:new R(0);var V=H.H,n=V.b,A=V.e,l=V.R,M=V.n,I=V.A,e=V.Z,b=V.m,Z=W==null;\n if(Z)W=new R(N.length>>>2<<5);while(i==0){i=n(N,d,1);m=n(N,d+1,2);d+=3;if(m==0){if((d&7)!=0)d+=8-(d&7);\n var D=(d>>>3)+4,q=N[D-4]|N[D-3]<<8;if(Z)W=H.H.W(W,w+q);W.set(new R(N.buffer,N.byteOffset+D,q),w);d=D+q<<3;\n w+=q;continue}if(Z)W=H.H.W(W,w+(1<<17));if(m==1){v=b.J;C=b.h;X=(1<<9)-1;u=(1<<5)-1}if(m==2){J=A(N,d,5)+257;\n h=A(N,d+5,5)+1;Q=A(N,d+10,4)+4;d+=14;var E=d,j=1;for(var c=0;c<38;c+=2){b.Q[c]=0;b.Q[c+1]=0}for(var c=0;\n cj)j=K}d+=3*Q;M(b.Q,j);I(b.Q,j,b.u);v=b.w;C=b.d;\n d=l(b.u,(1<>>4;if(p>>>8==0){W[w++]=p}else if(p==256){break}else{var z=w+p-254;\n if(p>264){var _=b.q[p-257];z=w+(_>>>3)+A(N,d,_&7);d+=_&7}var $=C[e(N,d)&u];d+=$&15;var s=$>>>4,Y=b.c[s],a=(Y>>>4)+n(N,d,Y&15);\n d+=Y&15;while(w>>4;\n if(b<=15){A[I]=b;I++}else{var Z=0,m=0;if(b==16){m=3+l(V,n,2);n+=2;Z=A[I-1]}else if(b==17){m=3+l(V,n,3);\n n+=3}else if(b==18){m=11+l(V,n,7);n+=7}var J=I+m;while(I>>1;\n while(An)n=M;A++}while(A>1,I=N[l+1],e=M<<4|I,b=W-I,Z=N[l]<>>15-W;R[J]=e;Z++}}};H.H.l=function(N,W){var R=H.H.m.r,V=15-W;for(var n=0;n>>V}};H.H.M=function(N,W,R){R=R<<(W&7);var V=W>>>3;N[V]|=R;N[V+1]|=R>>>8};\n H.H.I=function(N,W,R){R=R<<(W&7);var V=W>>>3;N[V]|=R;N[V+1]|=R>>>8;N[V+2]|=R>>>16};H.H.e=function(N,W,R){return(N[W>>>3]|N[(W>>>3)+1]<<8)>>>(W&7)&(1<>>3]|N[(W>>>3)+1]<<8|N[(W>>>3)+2]<<16)>>>(W&7)&(1<>>3]|N[(W>>>3)+1]<<8|N[(W>>>3)+2]<<16)>>>(W&7)};\n H.H.i=function(N,W){return(N[W>>>3]|N[(W>>>3)+1]<<8|N[(W>>>3)+2]<<16|N[(W>>>3)+3]<<24)>>>(W&7)};H.H.m=function(){var N=Uint16Array,W=Uint32Array;\n return{K:new N(16),j:new N(16),X:[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],S:[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,999,999,999],T:[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0],q:new N(32),p:[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,65535,65535],z:[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0],c:new W(32),J:new N(512),_:[],h:new N(32),$:[],w:new N(32768),C:[],v:[],d:new N(32768),D:[],u:new N(512),Q:[],r:new N(1<<15),s:new W(286),Y:new W(30),a:new W(19),t:new W(15e3),k:new N(1<<16),g:new N(1<<15)}}();\n (function(){var N=H.H.m,W=1<<15;for(var R=0;R>>1|(V&1431655765)<<1;\n V=(V&3435973836)>>>2|(V&858993459)<<2;V=(V&4042322160)>>>4|(V&252645135)<<4;V=(V&4278255360)>>>8|(V&16711935)<<8;\n N.r[R]=(V>>>16|V<<16)>>>17}function n(A,l,M){while(l--!=0)A.push(0,M)}for(var R=0;R<32;R++){N.q[R]=N.S[R]<<3|N.T[R];\n N.c[R]=N.p[R]<<4|N.z[R]}n(N._,144,8);n(N._,255-143,9);n(N._,279-255,7);n(N._,287-279,8);H.H.n(N._,9);\n H.H.A(N._,9,N.J);H.H.l(N._,9);n(N.$,32,5);H.H.n(N.$,5);H.H.A(N.$,5,N.h);H.H.l(N.$,5);n(N.Q,19,0);n(N.C,286,0);\n n(N.D,30,0);n(N.v,320,0)}());return H.H.N}()\n \n const UZIP = {}\n UZIP["parse"] = ').concat(UZIP_1.parse,"\n UZIP._readLocal = ").concat(UZIP_1._readLocal,"\n UZIP.inflateRaw = ").concat(UZIP_1.inflateRaw,"\n UZIP.inflate = ").concat(UZIP_1.inflate,"\n UZIP.deflate = ").concat(UZIP_1.deflate,"\n UZIP.deflateRaw = ").concat(UZIP_1.deflateRaw,"\n UZIP.encode = ").concat(UZIP_1.encode,"\n UZIP._noNeed = ").concat(UZIP_1._noNeed,"\n UZIP._writeHeader = ").concat(UZIP_1._writeHeader,"\n UZIP.crc = parse(").concat(stringify(UZIP_1.crc),")\n UZIP.crc.table = ( function() {\n var tab = new Uint32Array(256);\n for (var n=0; n<256; n++) {\n var c = n;\n for (var k=0; k<8; k++) {\n if (c & 1) c = 0xedb88320 ^ (c >>> 1);\n else c = c >>> 1;\n }\n tab[n] = c; }\n return tab; })()\n \n UZIP.adler = ").concat(UZIP_1.adler,"\n UZIP.bin = parse(").concat(stringify(UZIP_1.bin),")\n UZIP.F = {}\n UZIP.F.deflateRaw = ").concat(UZIP_1.F.deflateRaw,"\n UZIP.F._bestMatch = ").concat(UZIP_1.F._bestMatch,"\n UZIP.F._howLong = ").concat(UZIP_1.F._howLong,"\n UZIP.F._hash = ").concat(UZIP_1.F._hash,"\n UZIP.saved = ").concat(UZIP_1.saved,"\n UZIP.F._writeBlock = ").concat(UZIP_1.F._writeBlock,"\n UZIP.F._copyExact = ").concat(UZIP_1.F._copyExact,"\n UZIP.F.getTrees = ").concat(UZIP_1.F.getTrees,"\n UZIP.F.getSecond = ").concat(UZIP_1.F.getSecond,"\n UZIP.F.nonZero = ").concat(UZIP_1.F.nonZero,"\n UZIP.F.contSize = ").concat(UZIP_1.F.contSize,"\n UZIP.F._codeTiny = ").concat(UZIP_1.F._codeTiny," \n UZIP.F._lenCodes = ").concat(UZIP_1.F._lenCodes," \n UZIP.F._hufTree = ").concat(UZIP_1.F._hufTree," \n UZIP.F.setDepth = ").concat(UZIP_1.F.setDepth," \n UZIP.F.restrictDepth = ").concat(UZIP_1.F.restrictDepth,"\n UZIP.F._goodIndex = ").concat(UZIP_1.F._goodIndex," \n UZIP.F._writeLit = ").concat(UZIP_1.F._writeLit," \n UZIP.F.inflate = ").concat(UZIP_1.F.inflate," \n UZIP.F._check = ").concat(UZIP_1.F._check," \n UZIP.F._decodeTiny = ").concat(UZIP_1.F._decodeTiny," \n UZIP.F._copyOut = ").concat(UZIP_1.F._copyOut," \n UZIP.F.makeCodes = ").concat(UZIP_1.F.makeCodes," \n UZIP.F.codes2map = ").concat(UZIP_1.F.codes2map," \n UZIP.F.revCodes = ").concat(UZIP_1.F.revCodes," \n\n // used only in deflate\n UZIP.F._putsE = ").concat(UZIP_1.F._putsE,"\n UZIP.F._putsF = ").concat(UZIP_1.F._putsF,"\n \n UZIP.F._bitsE = ").concat(UZIP_1.F._bitsE,"\n UZIP.F._bitsF = ").concat(UZIP_1.F._bitsF,"\n\n UZIP.F._get17 = ").concat(UZIP_1.F._get17,"\n UZIP.F._get25 = ").concat(UZIP_1.F._get25,"\n UZIP.F.U = function(){\n var u16=Uint16Array, u32=Uint32Array;\n return {\n next_code : new u16(16),\n bl_count : new u16(16),\n ordr : [ 16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15 ],\n of0 : [3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,999,999,999],\n exb : [0,0,0,0,0,0,0, 0, 1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3, 4, 4, 4, 4, 5, 5, 5, 5, 0, 0, 0, 0],\n ldef : new u16(32),\n df0 : [1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577, 65535, 65535],\n dxb : [0,0,0,0,1,1,2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8, 9, 9, 10, 10, 11, 11, 12, 12, 13, 13, 0, 0],\n ddef : new u32(32),\n flmap: new u16( 512), fltree: [],\n fdmap: new u16( 32), fdtree: [],\n lmap : new u16(32768), ltree : [], ttree:[],\n dmap : new u16(32768), dtree : [],\n imap : new u16( 512), itree : [],\n //rev9 : new u16( 512)\n rev15: new u16(1<<15),\n lhst : new u32(286), dhst : new u32( 30), ihst : new u32(19),\n lits : new u32(15000),\n strt : new u16(1<<16),\n prev : new u16(1<<15)\n };\n } ();\n\n (function(){\n var U = UZIP.F.U;\n var len = 1<<15;\n for(var i=0; i>> 1) | ((x & 0x55555555) << 1));\n x = (((x & 0xcccccccc) >>> 2) | ((x & 0x33333333) << 2));\n x = (((x & 0xf0f0f0f0) >>> 4) | ((x & 0x0f0f0f0f) << 4));\n x = (((x & 0xff00ff00) >>> 8) | ((x & 0x00ff00ff) << 8));\n U.rev15[i] = (((x >>> 16) | (x << 16)))>>>17;\n }\n \n function pushV(tgt, n, sv) { while(n--!=0) tgt.push(0,sv); }\n \n for(var i=0; i<32; i++) { U.ldef[i]=(U.of0[i]<<3)|U.exb[i]; U.ddef[i]=(U.df0[i]<<4)|U.dxb[i]; }\n \n pushV(U.fltree, 144, 8); pushV(U.fltree, 255-143, 9); pushV(U.fltree, 279-255, 7); pushV(U.fltree,287-279,8);\n /*\n var i = 0;\n for(; i<=143; i++) U.fltree.push(0,8);\n for(; i<=255; i++) U.fltree.push(0,9);\n for(; i<=279; i++) U.fltree.push(0,7);\n for(; i<=287; i++) U.fltree.push(0,8);\n */\n UZIP.F.makeCodes(U.fltree, 9);\n UZIP.F.codes2map(U.fltree, 9, U.flmap);\n UZIP.F.revCodes (U.fltree, 9)\n \n pushV(U.fdtree,32,5);\n //for(i=0;i<32; i++) U.fdtree.push(0,5);\n UZIP.F.makeCodes(U.fdtree, 5);\n UZIP.F.codes2map(U.fdtree, 5, U.fdmap);\n UZIP.F.revCodes (U.fdtree, 5)\n \n pushV(U.itree,19,0); pushV(U.ltree,286,0); pushV(U.dtree,30,0); pushV(U.ttree,320,0);\n /*\n for(var i=0; i< 19; i++) U.itree.push(0,0);\n for(var i=0; i<286; i++) U.ltree.push(0,0);\n for(var i=0; i< 30; i++) U.dtree.push(0,0);\n for(var i=0; i<320; i++) U.ttree.push(0,0);\n */\n })()\n "))}function generateWorkerScript(){return createWorker("\n let scriptImported = false\n self.addEventListener('message', async (e) => {\n const { file, id, imageCompressionLibUrl, options } = e.data\n options.onProgress = (progress) => self.postMessage({ progress, id })\n try {\n if (!scriptImported) {\n // console.log('[worker] importScripts', imageCompressionLibUrl)\n self.importScripts(imageCompressionLibUrl)\n scriptImported = true\n }\n // console.log('[worker] self', self)\n const compressedFile = await imageCompression(file, options)\n self.postMessage({ file: compressedFile, id })\n } catch (e) {\n // console.error('[worker] error', e)\n self.postMessage({ error: e.message + '\\n' + e.stack, id })\n }\n })\n ")}function compressOnWebWorker(e,r){return new Promise((function(t,a){return new Promise((function(i,f){var c=cnt++;return imageCompressionLibUrl||(imageCompressionLibUrl=generateLib()),worker||(worker=generateWorkerScript()),worker.addEventListener("message",(function handler(e){if(e.data.id===c){if(void 0!==e.data.progress)return void r.onProgress(e.data.progress);worker.removeEventListener("message",handler),e.data.error&&a(new Error(e.data.error)),t(e.data.file)}})),worker.addEventListener("error",a),worker.postMessage({file:e,id:c,imageCompressionLibUrl:imageCompressionLibUrl,options:_objectSpread2(_objectSpread2({},r),{},{onProgress:void 0})}),i()}))}))}function imageCompression(e,r){return new Promise((function(t,a){var i,f,c,s,l;if(f=0,r.maxSizeMB=r.maxSizeMB||Number.POSITIVE_INFINITY,s="boolean"!=typeof r.useWebWorker||r.useWebWorker,delete r.useWebWorker,c=r.onProgress,r.onProgress=function(e){f=e,"function"==typeof c&&c(f)},!(e instanceof Blob||e instanceof CustomFile))return a(new Error("The file given is not an instance of Blob or File"));if(!/^image/.test(e.type))return a(new Error("The file given is not an image"));if(l="undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope,!s||"function"!=typeof Worker||l)return compress(e,r).then(function(e){try{return i=e,$If_3.call(this)}catch(e){return a(e)}}.bind(this),a);var u=function(){try{return $If_3.call(this)}catch(e){return a(e)}}.bind(this),d=function $Try_1_Catch(t){try{return compress(e,r).then((function(e){try{return i=e,u()}catch(e){return a(e)}}),a)}catch(e){return a(e)}};try{return compressOnWebWorker(e,r).then((function(e){try{return i=e,u()}catch(e){return d()}}),d)}catch(e){d()}function $If_3(){try{i.name=e.name,i.lastModified=e.lastModified}catch(e){}return t(i)}}))}return imageCompression.getDataUrlFromFile=getDataUrlFromFile,imageCompression.getFilefromDataUrl=getFilefromDataUrl,imageCompression.loadImage=loadImage,imageCompression.drawImageInCanvas=drawImageInCanvas,imageCompression.drawFileInCanvas=drawFileInCanvas,imageCompression.canvasToFile=canvasToFile,imageCompression.getExifOrientation=getExifOrientation,imageCompression.handleMaxWidthOrHeight=handleMaxWidthOrHeight,imageCompression.followExifOrientation=followExifOrientation,imageCompression.cleanupCanvasMemory=cleanupCanvasMemory,imageCompression.isAutoOrientationInBrowser=isAutoOrientationInBrowser,imageCompression.version="1.0.14",imageCompression})); +!function(e,r){"object"==typeof exports&&"undefined"!=typeof module?module.exports=r():"function"==typeof define&&define.amd?define(r):(e="undefined"!=typeof globalThis?globalThis:e||self).imageCompression=r()}(this,(function(){"use strict";function ownKeys$1(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);r&&(a=a.filter((function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable}))),t.push.apply(t,a)}return t}function _objectSpread2(e){for(var r=1;re.length)&&(r=e.length);for(var t=0,a=new Array(r);t=74)&&(match=engineUserAgent.match(/Chrome\/(\d+)/),match&&(version=match[1])));var engineV8Version=version&&+version,fails=function(e){try{return!!e()}catch(e){return!0}},nativeSymbol=!!Object.getOwnPropertySymbols&&!fails((function(){var e=Symbol();return!String(e)||!(Object(e)instanceof Symbol)||!Symbol.sham&&engineV8Version&&engineV8Version<41})),useSymbolAsUid=nativeSymbol&&!Symbol.sham&&"symbol"==typeof Symbol.iterator,WellKnownSymbolsStore=shared("wks"),Symbol$1=global$1.Symbol,createWellKnownSymbol=useSymbolAsUid?Symbol$1:Symbol$1&&Symbol$1.withoutSetter||uid,wellKnownSymbol=function(e){return has$1(WellKnownSymbolsStore,e)&&(nativeSymbol||"string"==typeof WellKnownSymbolsStore[e])||(nativeSymbol&&has$1(Symbol$1,e)?WellKnownSymbolsStore[e]=Symbol$1[e]:WellKnownSymbolsStore[e]=createWellKnownSymbol("Symbol."+e)),WellKnownSymbolsStore[e]},TO_STRING_TAG$4=wellKnownSymbol("toStringTag"),test$1={};test$1[TO_STRING_TAG$4]="z";var toStringTagSupport="[object z]"===String(test$1),descriptors=!fails((function(){return 7!=Object.defineProperty({},1,{get:function(){return 7}})[1]})),isObject=function(e){return"object"==typeof e?null!==e:"function"==typeof e},document$3=global$1.document,EXISTS=isObject(document$3)&&isObject(document$3.createElement),documentCreateElement=function(e){return EXISTS?document$3.createElement(e):{}},ie8DomDefine=!descriptors&&!fails((function(){return 7!=Object.defineProperty(documentCreateElement("div"),"a",{get:function(){return 7}}).a})),anObject=function(e){if(!isObject(e))throw TypeError(String(e)+" is not an object");return e},isSymbol=useSymbolAsUid?function(e){return"symbol"==typeof e}:function(e){var r=getBuiltIn("Symbol");return"function"==typeof r&&Object(e)instanceof r},ordinaryToPrimitive=function(e,r){var t,a;if("string"===r&&"function"==typeof(t=e.toString)&&!isObject(a=t.call(e)))return a;if("function"==typeof(t=e.valueOf)&&!isObject(a=t.call(e)))return a;if("string"!==r&&"function"==typeof(t=e.toString)&&!isObject(a=t.call(e)))return a;throw TypeError("Can't convert object to primitive value")},TO_PRIMITIVE=wellKnownSymbol("toPrimitive"),toPrimitive=function(e,r){if(!isObject(e)||isSymbol(e))return e;var t,a=e[TO_PRIMITIVE];if(void 0!==a){if(void 0===r&&(r="default"),t=a.call(e,r),!isObject(t)||isSymbol(t))return t;throw TypeError("Can't convert object to primitive value")}return void 0===r&&(r="number"),ordinaryToPrimitive(e,r)},toPropertyKey=function(e){var r=toPrimitive(e,"string");return isSymbol(r)?r:String(r)},$defineProperty=Object.defineProperty,f$5=descriptors?$defineProperty:function defineProperty(e,r,t){if(anObject(e),r=toPropertyKey(r),anObject(t),ie8DomDefine)try{return $defineProperty(e,r,t)}catch(e){}if("get"in t||"set"in t)throw TypeError("Accessors not supported");return"value"in t&&(e[r]=t.value),e},objectDefineProperty={f:f$5},createPropertyDescriptor=function(e,r){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:r}},createNonEnumerableProperty=descriptors?function(e,r,t){return objectDefineProperty.f(e,r,createPropertyDescriptor(1,t))}:function(e,r,t){return e[r]=t,e},functionToString=Function.toString;"function"!=typeof sharedStore.inspectSource&&(sharedStore.inspectSource=function(e){return functionToString.call(e)});var inspectSource=sharedStore.inspectSource,WeakMap$1=global$1.WeakMap,nativeWeakMap="function"==typeof WeakMap$1&&/native code/.test(inspectSource(WeakMap$1)),keys$2=shared("keys"),sharedKey=function(e){return keys$2[e]||(keys$2[e]=uid(e))},hiddenKeys$1={},OBJECT_ALREADY_INITIALIZED="Object already initialized",WeakMap=global$1.WeakMap,set$2,get$1,has,enforce=function(e){return has(e)?get$1(e):set$2(e,{})},getterFor=function(e){return function(r){var t;if(!isObject(r)||(t=get$1(r)).type!==e)throw TypeError("Incompatible receiver, "+e+" required");return t}};if(nativeWeakMap||sharedStore.state){var store=sharedStore.state||(sharedStore.state=new WeakMap),wmget=store.get,wmhas=store.has,wmset=store.set;set$2=function(e,r){if(wmhas.call(store,e))throw new TypeError(OBJECT_ALREADY_INITIALIZED);return r.facade=e,wmset.call(store,e,r),r},get$1=function(e){return wmget.call(store,e)||{}},has=function(e){return wmhas.call(store,e)}}else{var STATE=sharedKey("state");hiddenKeys$1[STATE]=!0,set$2=function(e,r){if(has$1(e,STATE))throw new TypeError(OBJECT_ALREADY_INITIALIZED);return r.facade=e,createNonEnumerableProperty(e,STATE,r),r},get$1=function(e){return has$1(e,STATE)?e[STATE]:{}},has=function(e){return has$1(e,STATE)}}var internalState={set:set$2,get:get$1,has:has,enforce:enforce,getterFor:getterFor},redefine=createCommonjsModule((function(e){var r=internalState.get,t=internalState.enforce,a=String(String).split("String");(e.exports=function(e,r,i,s){var c,l=!!s&&!!s.unsafe,u=!!s&&!!s.enumerable,p=!!s&&!!s.noTargetGet;"function"==typeof i&&("string"!=typeof r||has$1(i,"name")||createNonEnumerableProperty(i,"name",r),(c=t(i)).source||(c.source=a.join("string"==typeof r?r:""))),e!==global$1?(l?!p&&e[r]&&(u=!0):delete e[r],u?e[r]=i:createNonEnumerableProperty(e,r,i)):u?e[r]=i:setGlobal(r,i)})(Function.prototype,"toString",(function toString(){return"function"==typeof this&&r(this).source||inspectSource(this)}))})),toString$1={}.toString,classofRaw=function(e){return toString$1.call(e).slice(8,-1)},TO_STRING_TAG$3=wellKnownSymbol("toStringTag"),CORRECT_ARGUMENTS="Arguments"==classofRaw(function(){return arguments}()),tryGet=function(e,r){try{return e[r]}catch(e){}},classof=toStringTagSupport?classofRaw:function(e){var r,t,a;return void 0===e?"Undefined":null===e?"Null":"string"==typeof(t=tryGet(r=Object(e),TO_STRING_TAG$3))?t:CORRECT_ARGUMENTS?classofRaw(r):"Object"==(a=classofRaw(r))&&"function"==typeof r.callee?"Arguments":a},objectToString=toStringTagSupport?{}.toString:function toString(){return"[object "+classof(this)+"]"};toStringTagSupport||redefine(Object.prototype,"toString",objectToString,{unsafe:!0});var $propertyIsEnumerable={}.propertyIsEnumerable,getOwnPropertyDescriptor$4=Object.getOwnPropertyDescriptor,NASHORN_BUG=getOwnPropertyDescriptor$4&&!$propertyIsEnumerable.call({1:2},1),f$4=NASHORN_BUG?function propertyIsEnumerable(e){var r=getOwnPropertyDescriptor$4(this,e);return!!r&&r.enumerable}:$propertyIsEnumerable,objectPropertyIsEnumerable={f:f$4},split="".split,indexedObject=fails((function(){return!Object("z").propertyIsEnumerable(0)}))?function(e){return"String"==classofRaw(e)?split.call(e,""):Object(e)}:Object,toIndexedObject=function(e){return indexedObject(requireObjectCoercible(e))},$getOwnPropertyDescriptor=Object.getOwnPropertyDescriptor,f$3=descriptors?$getOwnPropertyDescriptor:function getOwnPropertyDescriptor(e,r){if(e=toIndexedObject(e),r=toPropertyKey(r),ie8DomDefine)try{return $getOwnPropertyDescriptor(e,r)}catch(e){}if(has$1(e,r))return createPropertyDescriptor(!objectPropertyIsEnumerable.f.call(e,r),e[r])},objectGetOwnPropertyDescriptor={f:f$3},ceil=Math.ceil,floor$7=Math.floor,toInteger=function(e){return isNaN(e=+e)?0:(e>0?floor$7:ceil)(e)},min$6=Math.min,toLength=function(e){return e>0?min$6(toInteger(e),9007199254740991):0},max$2=Math.max,min$5=Math.min,toAbsoluteIndex=function(e,r){var t=toInteger(e);return t<0?max$2(t+r,0):min$5(t,r)},createMethod$5=function(e){return function(r,t,a){var i,s=toIndexedObject(r),c=toLength(s.length),l=toAbsoluteIndex(a,c);if(e&&t!=t){for(;c>l;)if((i=s[l++])!=i)return!0}else for(;c>l;l++)if((e||l in s)&&s[l]===t)return e||l||0;return!e&&-1}},arrayIncludes={includes:createMethod$5(!0),indexOf:createMethod$5(!1)},indexOf=arrayIncludes.indexOf,objectKeysInternal=function(e,r){var t,a=toIndexedObject(e),i=0,s=[];for(t in a)!has$1(hiddenKeys$1,t)&&has$1(a,t)&&s.push(t);for(;r.length>i;)has$1(a,t=r[i++])&&(~indexOf(s,t)||s.push(t));return s},enumBugKeys=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"],hiddenKeys=enumBugKeys.concat("length","prototype"),f$2=Object.getOwnPropertyNames||function getOwnPropertyNames(e){return objectKeysInternal(e,hiddenKeys)},objectGetOwnPropertyNames={f:f$2},f$1=Object.getOwnPropertySymbols,objectGetOwnPropertySymbols={f:f$1},ownKeys=getBuiltIn("Reflect","ownKeys")||function ownKeys(e){var r=objectGetOwnPropertyNames.f(anObject(e)),t=objectGetOwnPropertySymbols.f;return t?r.concat(t(e)):r},copyConstructorProperties=function(e,r){for(var t=ownKeys(r),a=objectDefineProperty.f,i=objectGetOwnPropertyDescriptor.f,s=0;ss;s++)if((l=callFn(e[s]))&&l instanceof Result)return l;return new Result(!1)}a=i.call(e)}for(u=a.next;!(p=u.call(a)).done;){try{l=callFn(p.value)}catch(e){throw iteratorClose(a),e}if("object"==typeof l&&l&&l instanceof Result)return l}return new Result(!1)},ITERATOR$6=wellKnownSymbol("iterator"),SAFE_CLOSING=!1;try{var called=0,iteratorWithReturn={next:function(){return{done:!!called++}},return:function(){SAFE_CLOSING=!0}};iteratorWithReturn[ITERATOR$6]=function(){return this},Array.from(iteratorWithReturn,(function(){throw 2}))}catch(e){}var checkCorrectnessOfIteration=function(e,r){if(!r&&!SAFE_CLOSING)return!1;var t=!1;try{var a={};a[ITERATOR$6]=function(){return{next:function(){return{done:t=!0}}}},e(a)}catch(e){}return t},SPECIES$5=wellKnownSymbol("species"),speciesConstructor=function(e,r){var t,a=anObject(e).constructor;return void 0===a||null==(t=anObject(a)[SPECIES$5])?r:aFunction(t)},html=getBuiltIn("document","documentElement"),engineIsIos=/(?:iphone|ipod|ipad).*applewebkit/i.test(engineUserAgent),engineIsNode="process"==classofRaw(global$1.process),set$1=global$1.setImmediate,clear=global$1.clearImmediate,process$2=global$1.process,MessageChannel=global$1.MessageChannel,Dispatch=global$1.Dispatch,counter=0,queue={},ONREADYSTATECHANGE="onreadystatechange",location,defer,channel,port;try{location=global$1.location}catch(e){}var run=function(e){if(queue.hasOwnProperty(e)){var r=queue[e];delete queue[e],r()}},runner=function(e){return function(){run(e)}},listener=function(e){run(e.data)},post=function(e){global$1.postMessage(String(e),location.protocol+"//"+location.host)};set$1&&clear||(set$1=function setImmediate(e){for(var r=[],t=arguments.length,a=1;t>a;)r.push(arguments[a++]);return queue[++counter]=function(){("function"==typeof e?e:Function(e)).apply(void 0,r)},defer(counter),counter},clear=function clearImmediate(e){delete queue[e]},engineIsNode?defer=function(e){process$2.nextTick(runner(e))}:Dispatch&&Dispatch.now?defer=function(e){Dispatch.now(runner(e))}:MessageChannel&&!engineIsIos?(channel=new MessageChannel,port=channel.port2,channel.port1.onmessage=listener,defer=functionBindContext(port.postMessage,port,1)):global$1.addEventListener&&"function"==typeof postMessage&&!global$1.importScripts&&location&&"file:"!==location.protocol&&!fails(post)?(defer=post,global$1.addEventListener("message",listener,!1)):defer=ONREADYSTATECHANGE in documentCreateElement("script")?function(e){html.appendChild(documentCreateElement("script"))[ONREADYSTATECHANGE]=function(){html.removeChild(this),run(e)}}:function(e){setTimeout(runner(e),0)});var task$1={set:set$1,clear:clear},engineIsIosPebble=/iphone|ipod|ipad/i.test(engineUserAgent)&&void 0!==global$1.Pebble,engineIsWebosWebkit=/web0s(?!.*chrome)/i.test(engineUserAgent),getOwnPropertyDescriptor$2=objectGetOwnPropertyDescriptor.f,macrotask=task$1.set,MutationObserver=global$1.MutationObserver||global$1.WebKitMutationObserver,document$2=global$1.document,process$1=global$1.process,Promise$1=global$1.Promise,queueMicrotaskDescriptor=getOwnPropertyDescriptor$2(global$1,"queueMicrotask"),queueMicrotask=queueMicrotaskDescriptor&&queueMicrotaskDescriptor.value,flush,head,last,notify$1,toggle,node,promise,then;queueMicrotask||(flush=function(){var e,r;for(engineIsNode&&(e=process$1.domain)&&e.exit();head;){r=head.fn,head=head.next;try{r()}catch(e){throw head?notify$1():last=void 0,e}}last=void 0,e&&e.enter()},engineIsIos||engineIsNode||engineIsWebosWebkit||!MutationObserver||!document$2?!engineIsIosPebble&&Promise$1&&Promise$1.resolve?(promise=Promise$1.resolve(void 0),promise.constructor=Promise$1,then=promise.then,notify$1=function(){then.call(promise,flush)}):notify$1=engineIsNode?function(){process$1.nextTick(flush)}:function(){macrotask.call(global$1,flush)}:(toggle=!0,node=document$2.createTextNode(""),new MutationObserver(flush).observe(node,{characterData:!0}),notify$1=function(){node.data=toggle=!toggle}));var microtask=queueMicrotask||function(e){var r={fn:e,next:void 0};last&&(last.next=r),head||(head=r,notify$1()),last=r},PromiseCapability=function(e){var r,t;this.promise=new e((function(e,a){if(void 0!==r||void 0!==t)throw TypeError("Bad Promise constructor");r=e,t=a})),this.resolve=aFunction(r),this.reject=aFunction(t)},f=function(e){return new PromiseCapability(e)},newPromiseCapability$1={f:f},promiseResolve=function(e,r){if(anObject(e),isObject(r)&&r.constructor===e)return r;var t=newPromiseCapability$1.f(e);return(0,t.resolve)(r),t.promise},hostReportErrors=function(e,r){var t=global$1.console;t&&t.error&&(1===arguments.length?t.error(e):t.error(e,r))},perform=function(e){try{return{error:!1,value:e()}}catch(e){return{error:!0,value:e}}},engineIsBrowser="object"==typeof window,task=task$1.set,SPECIES$4=wellKnownSymbol("species"),PROMISE="Promise",getInternalState$4=internalState.get,setInternalState$5=internalState.set,getInternalPromiseState=internalState.getterFor(PROMISE),NativePromisePrototype=nativePromiseConstructor&&nativePromiseConstructor.prototype,PromiseConstructor=nativePromiseConstructor,PromiseConstructorPrototype=NativePromisePrototype,TypeError$1=global$1.TypeError,document$1=global$1.document,process=global$1.process,newPromiseCapability=newPromiseCapability$1.f,newGenericPromiseCapability=newPromiseCapability,DISPATCH_EVENT=!!(document$1&&document$1.createEvent&&global$1.dispatchEvent),NATIVE_REJECTION_EVENT="function"==typeof PromiseRejectionEvent,UNHANDLED_REJECTION="unhandledrejection",REJECTION_HANDLED="rejectionhandled",PENDING=0,FULFILLED=1,REJECTED=2,HANDLED=1,UNHANDLED=2,SUBCLASSING=!1,Internal,OwnPromiseCapability,PromiseWrapper,nativeThen,FORCED$6=isForced_1(PROMISE,(function(){var e=inspectSource(PromiseConstructor),r=e!==String(PromiseConstructor);if(!r&&66===engineV8Version)return!0;if(engineV8Version>=51&&/native code/.test(e))return!1;var t=new PromiseConstructor((function(e){e(1)})),FakePromise=function(e){e((function(){}),(function(){}))};return(t.constructor={})[SPECIES$4]=FakePromise,!(SUBCLASSING=t.then((function(){}))instanceof FakePromise)||!r&&engineIsBrowser&&!NATIVE_REJECTION_EVENT})),INCORRECT_ITERATION=FORCED$6||!checkCorrectnessOfIteration((function(e){PromiseConstructor.all(e).catch((function(){}))})),isThenable=function(e){var r;return!(!isObject(e)||"function"!=typeof(r=e.then))&&r},notify=function(e,r){if(!e.notified){e.notified=!0;var t=e.reactions;microtask((function(){for(var a=e.value,i=e.state==FULFILLED,s=0;t.length>s;){var c,l,u,p=t[s++],d=i?p.ok:p.fail,y=p.resolve,h=p.reject,A=p.domain;try{d?(i||(e.rejection===UNHANDLED&&onHandleUnhandled(e),e.rejection=HANDLED),!0===d?c=a:(A&&A.enter(),c=d(a),A&&(A.exit(),u=!0)),c===p.promise?h(TypeError$1("Promise-chain cycle")):(l=isThenable(c))?l.call(c,y,h):y(c)):h(a)}catch(e){A&&!u&&A.exit(),h(e)}}e.reactions=[],e.notified=!1,r&&!e.rejection&&onUnhandled(e)}))}},dispatchEvent=function(e,r,t){var a,i;DISPATCH_EVENT?((a=document$1.createEvent("Event")).promise=r,a.reason=t,a.initEvent(e,!1,!0),global$1.dispatchEvent(a)):a={promise:r,reason:t},!NATIVE_REJECTION_EVENT&&(i=global$1["on"+e])?i(a):e===UNHANDLED_REJECTION&&hostReportErrors("Unhandled promise rejection",t)},onUnhandled=function(e){task.call(global$1,(function(){var r,t=e.facade,a=e.value;if(isUnhandled(e)&&(r=perform((function(){engineIsNode?process.emit("unhandledRejection",a,t):dispatchEvent(UNHANDLED_REJECTION,t,a)})),e.rejection=engineIsNode||isUnhandled(e)?UNHANDLED:HANDLED,r.error))throw r.value}))},isUnhandled=function(e){return e.rejection!==HANDLED&&!e.parent},onHandleUnhandled=function(e){task.call(global$1,(function(){var r=e.facade;engineIsNode?process.emit("rejectionHandled",r):dispatchEvent(REJECTION_HANDLED,r,e.value)}))},bind=function(e,r,t){return function(a){e(r,a,t)}},internalReject=function(e,r,t){e.done||(e.done=!0,t&&(e=t),e.value=r,e.state=REJECTED,notify(e,!0))},internalResolve=function(e,r,t){if(!e.done){e.done=!0,t&&(e=t);try{if(e.facade===r)throw TypeError$1("Promise can't be resolved itself");var a=isThenable(r);a?microtask((function(){var t={done:!1};try{a.call(r,bind(internalResolve,t,e),bind(internalReject,t,e))}catch(r){internalReject(t,r,e)}})):(e.value=r,e.state=FULFILLED,notify(e,!1))}catch(r){internalReject({done:!1},r,e)}}};if(FORCED$6&&(PromiseConstructor=function Promise(e){anInstance(this,PromiseConstructor,PROMISE),aFunction(e),Internal.call(this);var r=getInternalState$4(this);try{e(bind(internalResolve,r),bind(internalReject,r))}catch(e){internalReject(r,e)}},PromiseConstructorPrototype=PromiseConstructor.prototype,Internal=function Promise(e){setInternalState$5(this,{type:PROMISE,done:!1,notified:!1,parent:!1,reactions:[],rejection:!1,state:PENDING,value:void 0})},Internal.prototype=redefineAll(PromiseConstructorPrototype,{then:function then(e,r){var t=getInternalPromiseState(this),a=newPromiseCapability(speciesConstructor(this,PromiseConstructor));return a.ok="function"!=typeof e||e,a.fail="function"==typeof r&&r,a.domain=engineIsNode?process.domain:void 0,t.parent=!0,t.reactions.push(a),t.state!=PENDING&¬ify(t,!1),a.promise},catch:function(e){return this.then(void 0,e)}}),OwnPromiseCapability=function(){var e=new Internal,r=getInternalState$4(e);this.promise=e,this.resolve=bind(internalResolve,r),this.reject=bind(internalReject,r)},newPromiseCapability$1.f=newPromiseCapability=function(e){return e===PromiseConstructor||e===PromiseWrapper?new OwnPromiseCapability(e):newGenericPromiseCapability(e)},"function"==typeof nativePromiseConstructor&&NativePromisePrototype!==Object.prototype)){nativeThen=NativePromisePrototype.then,SUBCLASSING||(redefine(NativePromisePrototype,"then",(function then(e,r){var t=this;return new PromiseConstructor((function(e,r){nativeThen.call(t,e,r)})).then(e,r)}),{unsafe:!0}),redefine(NativePromisePrototype,"catch",PromiseConstructorPrototype.catch,{unsafe:!0}));try{delete NativePromisePrototype.constructor}catch(e){}objectSetPrototypeOf&&objectSetPrototypeOf(NativePromisePrototype,PromiseConstructorPrototype)}_export({global:!0,wrap:!0,forced:FORCED$6},{Promise:PromiseConstructor}),setToStringTag(PromiseConstructor,PROMISE,!1),setSpecies(PROMISE),PromiseWrapper=getBuiltIn(PROMISE),_export({target:PROMISE,stat:!0,forced:FORCED$6},{reject:function reject(e){var r=newPromiseCapability(this);return r.reject.call(void 0,e),r.promise}}),_export({target:PROMISE,stat:!0,forced:FORCED$6},{resolve:function resolve(e){return promiseResolve(this,e)}}),_export({target:PROMISE,stat:!0,forced:INCORRECT_ITERATION},{all:function all(e){var r=this,t=newPromiseCapability(r),a=t.resolve,i=t.reject,s=perform((function(){var t=aFunction(r.resolve),s=[],c=0,l=1;iterate(e,(function(e){var u=c++,p=!1;s.push(void 0),l++,t.call(r,e).then((function(e){p||(p=!0,s[u]=e,--l||a(s))}),i)})),--l||a(s)}));return s.error&&i(s.value),t.promise},race:function race(e){var r=this,t=newPromiseCapability(r),a=t.reject,i=perform((function(){var i=aFunction(r.resolve);iterate(e,(function(e){i.call(r,e).then(t.resolve,a)}))}));return i.error&&a(i.value),t.promise}});var inheritIfRequired=function(e,r,t){var a,i;return objectSetPrototypeOf&&"function"==typeof(a=r.constructor)&&a!==t&&isObject(i=a.prototype)&&i!==t.prototype&&objectSetPrototypeOf(e,i),e},objectKeys=Object.keys||function keys(e){return objectKeysInternal(e,enumBugKeys)},objectDefineProperties=descriptors?Object.defineProperties:function defineProperties(e,r){anObject(e);for(var t,a=objectKeys(r),i=a.length,s=0;i>s;)objectDefineProperty.f(e,t=a[s++],r[t]);return e},GT=">",LT="<",PROTOTYPE$1="prototype",SCRIPT="script",IE_PROTO$1=sharedKey("IE_PROTO"),EmptyConstructor=function(){},scriptTag=function(e){return LT+SCRIPT+GT+e+LT+"/"+SCRIPT+GT},NullProtoObjectViaActiveX=function(e){e.write(scriptTag("")),e.close();var r=e.parentWindow.Object;return e=null,r},NullProtoObjectViaIFrame=function(){var e,r=documentCreateElement("iframe"),t="java"+SCRIPT+":";if(r.style)return r.style.display="none",html.appendChild(r),r.src=String(t),(e=r.contentWindow.document).open(),e.write(scriptTag("document.F=Object")),e.close(),e.F},activeXDocument,NullProtoObject=function(){try{activeXDocument=new ActiveXObject("htmlfile")}catch(e){}NullProtoObject=document.domain&&activeXDocument?NullProtoObjectViaActiveX(activeXDocument):NullProtoObjectViaIFrame()||NullProtoObjectViaActiveX(activeXDocument);for(var e=enumBugKeys.length;e--;)delete NullProtoObject[PROTOTYPE$1][enumBugKeys[e]];return NullProtoObject()};hiddenKeys$1[IE_PROTO$1]=!0;var objectCreate=Object.create||function create(e,r){var t;return null!==e?(EmptyConstructor[PROTOTYPE$1]=anObject(e),t=new EmptyConstructor,EmptyConstructor[PROTOTYPE$1]=null,t[IE_PROTO$1]=e):t=NullProtoObject(),void 0===r?t:objectDefineProperties(t,r)},toString=function(e){if(isSymbol(e))throw TypeError("Cannot convert a Symbol value to a string");return String(e)},whitespaces="\t\n\v\f\r                 \u2028\u2029\ufeff",whitespace="["+whitespaces+"]",ltrim=RegExp("^"+whitespace+whitespace+"*"),rtrim=RegExp(whitespace+whitespace+"*$"),createMethod$4=function(e){return function(r){var t=toString(requireObjectCoercible(r));return 1&e&&(t=t.replace(ltrim,"")),2&e&&(t=t.replace(rtrim,"")),t}},stringTrim={start:createMethod$4(1),end:createMethod$4(2),trim:createMethod$4(3)},getOwnPropertyNames$1=objectGetOwnPropertyNames.f,getOwnPropertyDescriptor$1=objectGetOwnPropertyDescriptor.f,defineProperty$4=objectDefineProperty.f,trim=stringTrim.trim,NUMBER="Number",NativeNumber=global$1[NUMBER],NumberPrototype=NativeNumber.prototype,BROKEN_CLASSOF=classofRaw(objectCreate(NumberPrototype))==NUMBER,toNumber=function(e){if(isSymbol(e))throw TypeError("Cannot convert a Symbol value to a number");var r,t,a,i,s,c,l,u,p=toPrimitive(e,"number");if("string"==typeof p&&p.length>2)if(43===(r=(p=trim(p)).charCodeAt(0))||45===r){if(88===(t=p.charCodeAt(2))||120===t)return NaN}else if(48===r){switch(p.charCodeAt(1)){case 66:case 98:a=2,i=49;break;case 79:case 111:a=8,i=55;break;default:return+p}for(c=(s=p.slice(2)).length,l=0;li)return NaN;return parseInt(s,a)}return+p};if(isForced_1(NUMBER,!NativeNumber(" 0o1")||!NativeNumber("0b1")||NativeNumber("+0x1"))){for(var NumberWrapper=function Number(e){var r=arguments.length<1?0:e,t=this;return t instanceof NumberWrapper&&(BROKEN_CLASSOF?fails((function(){NumberPrototype.valueOf.call(t)})):classofRaw(t)!=NUMBER)?inheritIfRequired(new NativeNumber(toNumber(r)),t,NumberWrapper):toNumber(r)},keys$1=descriptors?getOwnPropertyNames$1(NativeNumber):"MAX_VALUE,MIN_VALUE,NaN,NEGATIVE_INFINITY,POSITIVE_INFINITY,EPSILON,isFinite,isInteger,isNaN,isSafeInteger,MAX_SAFE_INTEGER,MIN_SAFE_INTEGER,parseFloat,parseInt,isInteger,fromString,range".split(","),j$1=0,key$1;keys$1.length>j$1;j$1++)has$1(NativeNumber,key$1=keys$1[j$1])&&!has$1(NumberWrapper,key$1)&&defineProperty$4(NumberWrapper,key$1,getOwnPropertyDescriptor$1(NativeNumber,key$1));NumberWrapper.prototype=NumberPrototype,NumberPrototype.constructor=NumberWrapper,redefine(global$1,NUMBER,NumberWrapper)}var defineProperty$3=objectDefineProperty.f,FunctionPrototype=Function.prototype,FunctionPrototypeToString=FunctionPrototype.toString,nameRE=/^\s*function ([^ (]*)/,NAME$1="name";descriptors&&!(NAME$1 in FunctionPrototype)&&defineProperty$3(FunctionPrototype,NAME$1,{configurable:!0,get:function(){try{return FunctionPrototypeToString.call(this).match(nameRE)[1]}catch(e){return""}}}),_export({global:!0},{globalThis:global$1});var $assign=Object.assign,defineProperty$2=Object.defineProperty,objectAssign=!$assign||fails((function(){if(descriptors&&1!==$assign({b:1},$assign(defineProperty$2({},"a",{enumerable:!0,get:function(){defineProperty$2(this,"b",{value:3,enumerable:!1})}}),{b:2})).b)return!0;var e={},r={},t=Symbol();return e[t]=7,"abcdefghijklmnopqrst".split("").forEach((function(e){r[e]=e})),7!=$assign({},e)[t]||"abcdefghijklmnopqrst"!=objectKeys($assign({},r)).join("")}))?function assign(e,r){for(var t=toObject(e),a=arguments.length,i=1,s=objectGetOwnPropertySymbols.f,c=objectPropertyIsEnumerable.f;a>i;)for(var l,u=indexedObject(arguments[i++]),p=s?objectKeys(u).concat(s(u)):objectKeys(u),d=p.length,y=0;d>y;)l=p[y++],descriptors&&!c.call(u,l)||(t[l]=u[l]);return t}:$assign;_export({target:"Object",stat:!0,forced:Object.assign!==objectAssign},{assign:objectAssign});var path=global$1;path.Object.assign;var regexpFlags=function(){var e=anObject(this),r="";return e.global&&(r+="g"),e.ignoreCase&&(r+="i"),e.multiline&&(r+="m"),e.dotAll&&(r+="s"),e.unicode&&(r+="u"),e.sticky&&(r+="y"),r},RE=function(e,r){return RegExp(e,r)},UNSUPPORTED_Y$2=fails((function(){var e=RE("a","y");return e.lastIndex=2,null!=e.exec("abcd")})),BROKEN_CARET=fails((function(){var e=RE("^r","gy");return e.lastIndex=2,null!=e.exec("str")})),regexpStickyHelpers={UNSUPPORTED_Y:UNSUPPORTED_Y$2,BROKEN_CARET:BROKEN_CARET},regexpUnsupportedDotAll=fails((function(){var e=RegExp(".","string".charAt(0));return!(e.dotAll&&e.exec("\n")&&"s"===e.flags)})),regexpUnsupportedNcg=fails((function(){var e=RegExp("(?b)","string".charAt(5));return"b"!==e.exec("b").groups.a||"bc"!=="b".replace(e,"$c")})),getInternalState$3=internalState.get,nativeExec=RegExp.prototype.exec,nativeReplace=shared("native-string-replace",String.prototype.replace),patchedExec=nativeExec,UPDATES_LAST_INDEX_WRONG=(re1=/a/,re2=/b*/g,nativeExec.call(re1,"a"),nativeExec.call(re2,"a"),0!==re1.lastIndex||0!==re2.lastIndex),re1,re2,UNSUPPORTED_Y$1=regexpStickyHelpers.UNSUPPORTED_Y||regexpStickyHelpers.BROKEN_CARET,NPCG_INCLUDED=void 0!==/()??/.exec("")[1],PATCH=UPDATES_LAST_INDEX_WRONG||NPCG_INCLUDED||UNSUPPORTED_Y$1||regexpUnsupportedDotAll||regexpUnsupportedNcg;PATCH&&(patchedExec=function exec(e){var r,t,a,i,s,c,l,u=this,p=getInternalState$3(u),d=toString(e),y=p.raw;if(y)return y.lastIndex=u.lastIndex,r=patchedExec.call(y,d),u.lastIndex=y.lastIndex,r;var h=p.groups,A=UNSUPPORTED_Y$1&&u.sticky,g=regexpFlags.call(u),v=u.source,m=0,E=d;if(A&&(-1===(g=g.replace("y","")).indexOf("g")&&(g+="g"),E=d.slice(u.lastIndex),u.lastIndex>0&&(!u.multiline||u.multiline&&"\n"!==d.charAt(u.lastIndex-1))&&(v="(?: "+v+")",E=" "+E,m++),t=new RegExp("^(?:"+v+")",g)),NPCG_INCLUDED&&(t=new RegExp("^"+v+"$(?!\\s)",g)),UPDATES_LAST_INDEX_WRONG&&(a=u.lastIndex),i=nativeExec.call(A?t:u,E),A?i?(i.input=i.input.slice(m),i[0]=i[0].slice(m),i.index=u.lastIndex,u.lastIndex+=i[0].length):u.lastIndex=0:UPDATES_LAST_INDEX_WRONG&&i&&(u.lastIndex=u.global?i.index+i[0].length:a),NPCG_INCLUDED&&i&&i.length>1&&nativeReplace.call(i[0],t,(function(){for(s=1;s=l?e?"":void 0:(a=s.charCodeAt(c))<55296||a>56319||c+1===l||(i=s.charCodeAt(c+1))<56320||i>57343?e?s.charAt(c):a:e?s.slice(c,c+2):i-56320+(a-55296<<10)+65536}},stringMultibyte={codeAt:createMethod$3(!1),charAt:createMethod$3(!0)},charAt$1=stringMultibyte.charAt,advanceStringIndex=function(e,r,t){return r+(t?charAt$1(e,r).length:1)},regexpExecAbstract=function(e,r){var t=e.exec;if("function"==typeof t){var a=t.call(e,r);if("object"!=typeof a)throw TypeError("RegExp exec method returned something other than an Object or null");return a}if("RegExp"!==classofRaw(e))throw TypeError("RegExp#exec called on incompatible receiver");return regexpExec.call(e,r)},UNSUPPORTED_Y=regexpStickyHelpers.UNSUPPORTED_Y,arrayPush=[].push,min$4=Math.min,MAX_UINT32=4294967295,SPLIT_WORKS_WITH_OVERWRITTEN_EXEC=!fails((function(){var e=/(?:)/,r=e.exec;e.exec=function(){return r.apply(this,arguments)};var t="ab".split(e);return 2!==t.length||"a"!==t[0]||"b"!==t[1]}));fixRegexpWellKnownSymbolLogic("split",(function(e,r,t){var a;return a="c"=="abbc".split(/(b)*/)[1]||4!="test".split(/(?:)/,-1).length||2!="ab".split(/(?:ab)*/).length||4!=".".split(/(.?)(.?)/).length||".".split(/()()/).length>1||"".split(/.?/).length?function(e,t){var a=toString(requireObjectCoercible(this)),i=void 0===t?MAX_UINT32:t>>>0;if(0===i)return[];if(void 0===e)return[a];if(!isRegexp(e))return r.call(a,e,i);for(var s,c,l,u=[],p=(e.ignoreCase?"i":"")+(e.multiline?"m":"")+(e.unicode?"u":"")+(e.sticky?"y":""),d=0,y=new RegExp(e.source,p+"g");(s=regexpExec.call(y,a))&&!((c=y.lastIndex)>d&&(u.push(a.slice(d,s.index)),s.length>1&&s.index=i));)y.lastIndex===s.index&&y.lastIndex++;return d===a.length?!l&&y.test("")||u.push(""):u.push(a.slice(d)),u.length>i?u.slice(0,i):u}:"0".split(void 0,0).length?function(e,t){return void 0===e&&0===t?[]:r.call(this,e,t)}:r,[function split(r,t){var i=requireObjectCoercible(this),s=null==r?void 0:r[e];return void 0!==s?s.call(r,i,t):a.call(toString(i),r,t)},function(e,i){var s=anObject(this),c=toString(e),l=t(a,s,c,i,a!==r);if(l.done)return l.value;var u=speciesConstructor(s,RegExp),p=s.unicode,d=(s.ignoreCase?"i":"")+(s.multiline?"m":"")+(s.unicode?"u":"")+(UNSUPPORTED_Y?"g":"y"),y=new u(UNSUPPORTED_Y?"^(?:"+s.source+")":s,d),h=void 0===i?MAX_UINT32:i>>>0;if(0===h)return[];if(0===c.length)return null===regexpExecAbstract(y,c)?[c]:[];for(var A=0,g=0,v=[];g=r.length?(e.target=void 0,{value:void 0,done:!0}):"keys"==t?{value:a,done:!1}:"values"==t?{value:r[a],done:!1}:{value:[a,r[a]],done:!1}}),"values");iterators.Arguments=iterators.Array,addToUnscopables("keys"),addToUnscopables("values"),addToUnscopables("entries");var arrayBufferNative="undefined"!=typeof ArrayBuffer&&"undefined"!=typeof DataView,defineProperty$1=objectDefineProperty.f,Int8Array$3=global$1.Int8Array,Int8ArrayPrototype=Int8Array$3&&Int8Array$3.prototype,Uint8ClampedArray=global$1.Uint8ClampedArray,Uint8ClampedArrayPrototype=Uint8ClampedArray&&Uint8ClampedArray.prototype,TypedArray=Int8Array$3&&objectGetPrototypeOf(Int8Array$3),TypedArrayPrototype=Int8ArrayPrototype&&objectGetPrototypeOf(Int8ArrayPrototype),ObjectPrototype$1=Object.prototype,isPrototypeOf=ObjectPrototype$1.isPrototypeOf,TO_STRING_TAG$1=wellKnownSymbol("toStringTag"),TYPED_ARRAY_TAG=uid("TYPED_ARRAY_TAG"),TYPED_ARRAY_CONSTRUCTOR$1=uid("TYPED_ARRAY_CONSTRUCTOR"),NATIVE_ARRAY_BUFFER_VIEWS$1=arrayBufferNative&&!!objectSetPrototypeOf&&"Opera"!==classof(global$1.opera),TYPED_ARRAY_TAG_REQIRED=!1,NAME,Constructor,Prototype,TypedArrayConstructorsList={Int8Array:1,Uint8Array:1,Uint8ClampedArray:1,Int16Array:2,Uint16Array:2,Int32Array:4,Uint32Array:4,Float32Array:4,Float64Array:8},BigIntArrayConstructorsList={BigInt64Array:8,BigUint64Array:8},isView=function isView(e){if(!isObject(e))return!1;var r=classof(e);return"DataView"===r||has$1(TypedArrayConstructorsList,r)||has$1(BigIntArrayConstructorsList,r)},isTypedArray=function(e){if(!isObject(e))return!1;var r=classof(e);return has$1(TypedArrayConstructorsList,r)||has$1(BigIntArrayConstructorsList,r)},aTypedArray$m=function(e){if(isTypedArray(e))return e;throw TypeError("Target is not a typed array")},aTypedArrayConstructor$2=function(e){if(objectSetPrototypeOf&&!isPrototypeOf.call(TypedArray,e))throw TypeError("Target is not a typed array constructor");return e},exportTypedArrayMethod$n=function(e,r,t){if(descriptors){if(t)for(var a in TypedArrayConstructorsList){var i=global$1[a];if(i&&has$1(i.prototype,e))try{delete i.prototype[e]}catch(e){}}TypedArrayPrototype[e]&&!t||redefine(TypedArrayPrototype,e,t?r:NATIVE_ARRAY_BUFFER_VIEWS$1&&Int8ArrayPrototype[e]||r)}},exportTypedArrayStaticMethod=function(e,r,t){var a,i;if(descriptors){if(objectSetPrototypeOf){if(t)for(a in TypedArrayConstructorsList)if((i=global$1[a])&&has$1(i,e))try{delete i[e]}catch(e){}if(TypedArray[e]&&!t)return;try{return redefine(TypedArray,e,t?r:NATIVE_ARRAY_BUFFER_VIEWS$1&&TypedArray[e]||r)}catch(e){}}for(a in TypedArrayConstructorsList)!(i=global$1[a])||i[e]&&!t||redefine(i,e,r)}};for(NAME in TypedArrayConstructorsList)Constructor=global$1[NAME],Prototype=Constructor&&Constructor.prototype,Prototype?createNonEnumerableProperty(Prototype,TYPED_ARRAY_CONSTRUCTOR$1,Constructor):NATIVE_ARRAY_BUFFER_VIEWS$1=!1;for(NAME in BigIntArrayConstructorsList)Constructor=global$1[NAME],Prototype=Constructor&&Constructor.prototype,Prototype&&createNonEnumerableProperty(Prototype,TYPED_ARRAY_CONSTRUCTOR$1,Constructor);if((!NATIVE_ARRAY_BUFFER_VIEWS$1||"function"!=typeof TypedArray||TypedArray===Function.prototype)&&(TypedArray=function TypedArray(){throw TypeError("Incorrect invocation")},NATIVE_ARRAY_BUFFER_VIEWS$1))for(NAME in TypedArrayConstructorsList)global$1[NAME]&&objectSetPrototypeOf(global$1[NAME],TypedArray);if((!NATIVE_ARRAY_BUFFER_VIEWS$1||!TypedArrayPrototype||TypedArrayPrototype===ObjectPrototype$1)&&(TypedArrayPrototype=TypedArray.prototype,NATIVE_ARRAY_BUFFER_VIEWS$1))for(NAME in TypedArrayConstructorsList)global$1[NAME]&&objectSetPrototypeOf(global$1[NAME].prototype,TypedArrayPrototype);if(NATIVE_ARRAY_BUFFER_VIEWS$1&&objectGetPrototypeOf(Uint8ClampedArrayPrototype)!==TypedArrayPrototype&&objectSetPrototypeOf(Uint8ClampedArrayPrototype,TypedArrayPrototype),descriptors&&!has$1(TypedArrayPrototype,TO_STRING_TAG$1))for(NAME in TYPED_ARRAY_TAG_REQIRED=!0,defineProperty$1(TypedArrayPrototype,TO_STRING_TAG$1,{get:function(){return isObject(this)?this[TYPED_ARRAY_TAG]:void 0}}),TypedArrayConstructorsList)global$1[NAME]&&createNonEnumerableProperty(global$1[NAME],TYPED_ARRAY_TAG,NAME);var arrayBufferViewCore={NATIVE_ARRAY_BUFFER_VIEWS:NATIVE_ARRAY_BUFFER_VIEWS$1,TYPED_ARRAY_CONSTRUCTOR:TYPED_ARRAY_CONSTRUCTOR$1,TYPED_ARRAY_TAG:TYPED_ARRAY_TAG_REQIRED&&TYPED_ARRAY_TAG,aTypedArray:aTypedArray$m,aTypedArrayConstructor:aTypedArrayConstructor$2,exportTypedArrayMethod:exportTypedArrayMethod$n,exportTypedArrayStaticMethod:exportTypedArrayStaticMethod,isView:isView,isTypedArray:isTypedArray,TypedArray:TypedArray,TypedArrayPrototype:TypedArrayPrototype},NATIVE_ARRAY_BUFFER_VIEWS=arrayBufferViewCore.NATIVE_ARRAY_BUFFER_VIEWS,ArrayBuffer$1=global$1.ArrayBuffer,Int8Array$2=global$1.Int8Array,typedArrayConstructorsRequireWrappers=!NATIVE_ARRAY_BUFFER_VIEWS||!fails((function(){Int8Array$2(1)}))||!fails((function(){new Int8Array$2(-1)}))||!checkCorrectnessOfIteration((function(e){new Int8Array$2,new Int8Array$2(null),new Int8Array$2(1.5),new Int8Array$2(e)}),!0)||fails((function(){return 1!==new Int8Array$2(new ArrayBuffer$1(2),1,void 0).length})),toIndex=function(e){if(void 0===e)return 0;var r=toInteger(e),t=toLength(r);if(r!==t)throw RangeError("Wrong length or index");return t},abs=Math.abs,pow$1=Math.pow,floor$6=Math.floor,log=Math.log,LN2=Math.LN2,pack=function(e,r,t){var a,i,s,c=new Array(t),l=8*t-r-1,u=(1<>1,d=23===r?pow$1(2,-24)-pow$1(2,-77):0,y=e<0||0===e&&1/e<0?1:0,h=0;for((e=abs(e))!=e||e===1/0?(i=e!=e?1:0,a=u):(a=floor$6(log(e)/LN2),e*(s=pow$1(2,-a))<1&&(a--,s*=2),(e+=a+p>=1?d/s:d*pow$1(2,1-p))*s>=2&&(a++,s/=2),a+p>=u?(i=0,a=u):a+p>=1?(i=(e*s-1)*pow$1(2,r),a+=p):(i=e*pow$1(2,p-1)*pow$1(2,r),a=0));r>=8;c[h++]=255&i,i/=256,r-=8);for(a=a<0;c[h++]=255&a,a/=256,l-=8);return c[--h]|=128*y,c},unpack=function(e,r){var t,a=e.length,i=8*a-r-1,s=(1<>1,l=i-7,u=a-1,p=e[u--],d=127&p;for(p>>=7;l>0;d=256*d+e[u],u--,l-=8);for(t=d&(1<<-l)-1,d>>=-l,l+=r;l>0;t=256*t+e[u],u--,l-=8);if(0===d)d=1-c;else{if(d===s)return t?NaN:p?-1/0:1/0;t+=pow$1(2,r),d-=c}return(p?-1:1)*t*pow$1(2,d-r)},ieee754={pack:pack,unpack:unpack},arrayFill=function fill(e){for(var r=toObject(this),t=toLength(r.length),a=arguments.length,i=toAbsoluteIndex(a>1?arguments[1]:void 0,t),s=a>2?arguments[2]:void 0,c=void 0===s?t:toAbsoluteIndex(s,t);c>i;)r[i++]=e;return r},getOwnPropertyNames=objectGetOwnPropertyNames.f,defineProperty=objectDefineProperty.f,getInternalState$1=internalState.get,setInternalState$3=internalState.set,ARRAY_BUFFER="ArrayBuffer",DATA_VIEW="DataView",PROTOTYPE="prototype",WRONG_LENGTH="Wrong length",WRONG_INDEX="Wrong index",NativeArrayBuffer=global$1[ARRAY_BUFFER],$ArrayBuffer=NativeArrayBuffer,$DataView=global$1[DATA_VIEW],$DataViewPrototype=$DataView&&$DataView[PROTOTYPE],ObjectPrototype=Object.prototype,RangeError$1=global$1.RangeError,packIEEE754=ieee754.pack,unpackIEEE754=ieee754.unpack,packInt8=function(e){return[255&e]},packInt16=function(e){return[255&e,e>>8&255]},packInt32=function(e){return[255&e,e>>8&255,e>>16&255,e>>24&255]},unpackInt32=function(e){return e[3]<<24|e[2]<<16|e[1]<<8|e[0]},packFloat32=function(e){return packIEEE754(e,23,4)},packFloat64=function(e){return packIEEE754(e,52,8)},addGetter=function(e,r){defineProperty(e[PROTOTYPE],r,{get:function(){return getInternalState$1(this)[r]}})},get=function(e,r,t,a){var i=toIndex(t),s=getInternalState$1(e);if(i+r>s.byteLength)throw RangeError$1(WRONG_INDEX);var c=getInternalState$1(s.buffer).bytes,l=i+s.byteOffset,u=c.slice(l,l+r);return a?u:u.reverse()},set=function(e,r,t,a,i,s){var c=toIndex(t),l=getInternalState$1(e);if(c+r>l.byteLength)throw RangeError$1(WRONG_INDEX);for(var u=getInternalState$1(l.buffer).bytes,p=c+l.byteOffset,d=a(+i),y=0;yj;)(key=keys[j++])in $ArrayBuffer||createNonEnumerableProperty($ArrayBuffer,key,NativeArrayBuffer[key]);ArrayBufferPrototype.constructor=$ArrayBuffer}objectSetPrototypeOf&&objectGetPrototypeOf($DataViewPrototype)!==ObjectPrototype&&objectSetPrototypeOf($DataViewPrototype,ObjectPrototype);var testView=new $DataView(new $ArrayBuffer(2)),$setInt8=$DataViewPrototype.setInt8;testView.setInt8(0,2147483648),testView.setInt8(1,2147483649),!testView.getInt8(0)&&testView.getInt8(1)||redefineAll($DataViewPrototype,{setInt8:function setInt8(e,r){$setInt8.call(this,e,r<<24>>24)},setUint8:function setUint8(e,r){$setInt8.call(this,e,r<<24>>24)}},{unsafe:!0})}else $ArrayBuffer=function ArrayBuffer(e){anInstance(this,$ArrayBuffer,ARRAY_BUFFER);var r=toIndex(e);setInternalState$3(this,{bytes:arrayFill.call(new Array(r),0),byteLength:r}),descriptors||(this.byteLength=r)},$DataView=function DataView(e,r,t){anInstance(this,$DataView,DATA_VIEW),anInstance(e,$ArrayBuffer,DATA_VIEW);var a=getInternalState$1(e).byteLength,i=toInteger(r);if(i<0||i>a)throw RangeError$1("Wrong offset");if(i+(t=void 0===t?a-i:toLength(t))>a)throw RangeError$1(WRONG_LENGTH);setInternalState$3(this,{buffer:e,byteLength:t,byteOffset:i}),descriptors||(this.buffer=e,this.byteLength=t,this.byteOffset=i)},descriptors&&(addGetter($ArrayBuffer,"byteLength"),addGetter($DataView,"buffer"),addGetter($DataView,"byteLength"),addGetter($DataView,"byteOffset")),redefineAll($DataView[PROTOTYPE],{getInt8:function getInt8(e){return get(this,1,e)[0]<<24>>24},getUint8:function getUint8(e){return get(this,1,e)[0]},getInt16:function getInt16(e){var r=get(this,2,e,arguments.length>1?arguments[1]:void 0);return(r[1]<<8|r[0])<<16>>16},getUint16:function getUint16(e){var r=get(this,2,e,arguments.length>1?arguments[1]:void 0);return r[1]<<8|r[0]},getInt32:function getInt32(e){return unpackInt32(get(this,4,e,arguments.length>1?arguments[1]:void 0))},getUint32:function getUint32(e){return unpackInt32(get(this,4,e,arguments.length>1?arguments[1]:void 0))>>>0},getFloat32:function getFloat32(e){return unpackIEEE754(get(this,4,e,arguments.length>1?arguments[1]:void 0),23)},getFloat64:function getFloat64(e){return unpackIEEE754(get(this,8,e,arguments.length>1?arguments[1]:void 0),52)},setInt8:function setInt8(e,r){set(this,1,e,packInt8,r)},setUint8:function setUint8(e,r){set(this,1,e,packInt8,r)},setInt16:function setInt16(e,r){set(this,2,e,packInt16,r,arguments.length>2?arguments[2]:void 0)},setUint16:function setUint16(e,r){set(this,2,e,packInt16,r,arguments.length>2?arguments[2]:void 0)},setInt32:function setInt32(e,r){set(this,4,e,packInt32,r,arguments.length>2?arguments[2]:void 0)},setUint32:function setUint32(e,r){set(this,4,e,packInt32,r,arguments.length>2?arguments[2]:void 0)},setFloat32:function setFloat32(e,r){set(this,4,e,packFloat32,r,arguments.length>2?arguments[2]:void 0)},setFloat64:function setFloat64(e,r){set(this,8,e,packFloat64,r,arguments.length>2?arguments[2]:void 0)}});setToStringTag($ArrayBuffer,ARRAY_BUFFER),setToStringTag($DataView,DATA_VIEW);var arrayBuffer={ArrayBuffer:$ArrayBuffer,DataView:$DataView},floor$5=Math.floor,isInteger=function isInteger(e){return!isObject(e)&&isFinite(e)&&floor$5(e)===e},toPositiveInteger=function(e){var r=toInteger(e);if(r<0)throw RangeError("The argument can't be less than 0");return r},toOffset=function(e,r){var t=toPositiveInteger(e);if(t%r)throw RangeError("Wrong offset");return t},aTypedArrayConstructor$1=arrayBufferViewCore.aTypedArrayConstructor,typedArrayFrom=function from(e){var r,t,a,i,s,c,l=toObject(e),u=arguments.length,p=u>1?arguments[1]:void 0,d=void 0!==p,y=getIteratorMethod(l);if(null!=y&&!isArrayIteratorMethod(y))for(c=(s=y.call(l)).next,l=[];!(i=c.call(s)).done;)l.push(i.value);for(d&&u>2&&(p=functionBindContext(p,arguments[2],2)),t=toLength(l.length),a=new(aTypedArrayConstructor$1(this))(t),r=0;t>r;r++)a[r]=d?p(l[r],r):l[r];return a},isArray=Array.isArray||function isArray(e){return"Array"==classofRaw(e)},SPECIES$2=wellKnownSymbol("species"),arraySpeciesConstructor=function(e){var r;return isArray(e)&&("function"!=typeof(r=e.constructor)||r!==Array&&!isArray(r.prototype)?isObject(r)&&null===(r=r[SPECIES$2])&&(r=void 0):r=void 0),void 0===r?Array:r},arraySpeciesCreate=function(e,r){return new(arraySpeciesConstructor(e))(0===r?0:r)},push=[].push,createMethod$2=function(e){var r=1==e,t=2==e,a=3==e,i=4==e,s=6==e,c=7==e,l=5==e||s;return function(u,p,d,y){for(var h,A,g=toObject(u),v=indexedObject(g),m=functionBindContext(p,d,3),E=toLength(v.length),I=0,P=y||arraySpeciesCreate,T=r?P(u,E):t||c?P(u,0):void 0;E>I;I++)if((l||I in v)&&(A=m(h=v[I],I,g),e))if(r)T[I]=A;else if(A)switch(e){case 3:return!0;case 5:return h;case 6:return I;case 2:push.call(T,h)}else switch(e){case 4:return!1;case 7:push.call(T,h)}return s?-1:a||i?i:T}},arrayIteration={forEach:createMethod$2(0),map:createMethod$2(1),filter:createMethod$2(2),some:createMethod$2(3),every:createMethod$2(4),find:createMethod$2(5),findIndex:createMethod$2(6),filterReject:createMethod$2(7)},typedArrayConstructor=createCommonjsModule((function(e){var r=objectGetOwnPropertyNames.f,t=arrayIteration.forEach,a=internalState.get,i=internalState.set,s=objectDefineProperty.f,c=objectGetOwnPropertyDescriptor.f,l=Math.round,u=global$1.RangeError,p=arrayBuffer.ArrayBuffer,d=arrayBuffer.DataView,y=arrayBufferViewCore.NATIVE_ARRAY_BUFFER_VIEWS,h=arrayBufferViewCore.TYPED_ARRAY_CONSTRUCTOR,A=arrayBufferViewCore.TYPED_ARRAY_TAG,g=arrayBufferViewCore.TypedArray,v=arrayBufferViewCore.TypedArrayPrototype,m=arrayBufferViewCore.aTypedArrayConstructor,E=arrayBufferViewCore.isTypedArray,fromList=function(e,r){for(var t=0,a=r.length,i=new(m(e))(a);a>t;)i[t]=r[t++];return i},addGetter=function(e,r){s(e,r,{get:function(){return a(this)[r]}})},isArrayBuffer=function(e){var r;return e instanceof p||"ArrayBuffer"==(r=classof(e))||"SharedArrayBuffer"==r},isTypedArrayIndex=function(e,r){return E(e)&&!isSymbol(r)&&r in e&&isInteger(+r)&&r>=0},I=function getOwnPropertyDescriptor(e,r){return r=toPropertyKey(r),isTypedArrayIndex(e,r)?createPropertyDescriptor(2,e[r]):c(e,r)},P=function defineProperty(e,r,t){return r=toPropertyKey(r),!(isTypedArrayIndex(e,r)&&isObject(t)&&has$1(t,"value"))||has$1(t,"get")||has$1(t,"set")||t.configurable||has$1(t,"writable")&&!t.writable||has$1(t,"enumerable")&&!t.enumerable?s(e,r,t):(e[r]=t.value,e)};descriptors?(y||(objectGetOwnPropertyDescriptor.f=I,objectDefineProperty.f=P,addGetter(v,"buffer"),addGetter(v,"byteOffset"),addGetter(v,"byteLength"),addGetter(v,"length")),_export({target:"Object",stat:!0,forced:!y},{getOwnPropertyDescriptor:I,defineProperty:P}),e.exports=function(e,c,m){var I=e.match(/\d+$/)[0]/8,P=e+(m?"Clamped":"")+"Array",T="get"+e,b="set"+e,S=global$1[P],R=S,_=R&&R.prototype,w={},addElement=function(e,r){s(e,r,{get:function(){return function(e,r){var t=a(e);return t.view[T](r*I+t.byteOffset,!0)}(this,r)},set:function(e){return function(e,r,t){var i=a(e);m&&(t=(t=l(t))<0?0:t>255?255:255&t),i.view[b](r*I+i.byteOffset,t,!0)}(this,r,e)},enumerable:!0})};y?typedArrayConstructorsRequireWrappers&&(R=c((function(e,r,t,a){return anInstance(e,R,P),inheritIfRequired(isObject(r)?isArrayBuffer(r)?void 0!==a?new S(r,toOffset(t,I),a):void 0!==t?new S(r,toOffset(t,I)):new S(r):E(r)?fromList(R,r):typedArrayFrom.call(R,r):new S(toIndex(r)),e,R)})),objectSetPrototypeOf&&objectSetPrototypeOf(R,g),t(r(S),(function(e){e in R||createNonEnumerableProperty(R,e,S[e])})),R.prototype=_):(R=c((function(e,r,t,a){anInstance(e,R,P);var s,c,l,y=0,h=0;if(isObject(r)){if(!isArrayBuffer(r))return E(r)?fromList(R,r):typedArrayFrom.call(R,r);s=r,h=toOffset(t,I);var A=r.byteLength;if(void 0===a){if(A%I)throw u("Wrong length");if((c=A-h)<0)throw u("Wrong length")}else if((c=toLength(a)*I)+h>A)throw u("Wrong length");l=c/I}else l=toIndex(r),s=new p(c=l*I);for(i(e,{buffer:s,byteOffset:h,byteLength:c,length:l,view:new d(s)});y2?arguments[2]:void 0,l=min$3((void 0===c?a:toAbsoluteIndex(c,a))-s,a-i),u=1;for(s0;)s in t?t[i]=t[s]:delete t[i],i+=u,s+=u;return t},aTypedArray$l=arrayBufferViewCore.aTypedArray,exportTypedArrayMethod$m=arrayBufferViewCore.exportTypedArrayMethod;exportTypedArrayMethod$m("copyWithin",(function copyWithin(e,r){return arrayCopyWithin.call(aTypedArray$l(this),e,r,arguments.length>2?arguments[2]:void 0)}));var $every=arrayIteration.every,aTypedArray$k=arrayBufferViewCore.aTypedArray,exportTypedArrayMethod$l=arrayBufferViewCore.exportTypedArrayMethod;exportTypedArrayMethod$l("every",(function every(e){return $every(aTypedArray$k(this),e,arguments.length>1?arguments[1]:void 0)}));var aTypedArray$j=arrayBufferViewCore.aTypedArray,exportTypedArrayMethod$k=arrayBufferViewCore.exportTypedArrayMethod;exportTypedArrayMethod$k("fill",(function fill(e){return arrayFill.apply(aTypedArray$j(this),arguments)}));var arrayFromConstructorAndList=function(e,r){for(var t=0,a=r.length,i=new e(a);a>t;)i[t]=r[t++];return i},TYPED_ARRAY_CONSTRUCTOR=arrayBufferViewCore.TYPED_ARRAY_CONSTRUCTOR,aTypedArrayConstructor=arrayBufferViewCore.aTypedArrayConstructor,typedArraySpeciesConstructor=function(e){return aTypedArrayConstructor(speciesConstructor(e,e[TYPED_ARRAY_CONSTRUCTOR]))},typedArrayFromSpeciesAndList=function(e,r){return arrayFromConstructorAndList(typedArraySpeciesConstructor(e),r)},$filter$1=arrayIteration.filter,aTypedArray$i=arrayBufferViewCore.aTypedArray,exportTypedArrayMethod$j=arrayBufferViewCore.exportTypedArrayMethod;exportTypedArrayMethod$j("filter",(function filter(e){var r=$filter$1(aTypedArray$i(this),e,arguments.length>1?arguments[1]:void 0);return typedArrayFromSpeciesAndList(this,r)}));var $find=arrayIteration.find,aTypedArray$h=arrayBufferViewCore.aTypedArray,exportTypedArrayMethod$i=arrayBufferViewCore.exportTypedArrayMethod;exportTypedArrayMethod$i("find",(function find(e){return $find(aTypedArray$h(this),e,arguments.length>1?arguments[1]:void 0)}));var $findIndex=arrayIteration.findIndex,aTypedArray$g=arrayBufferViewCore.aTypedArray,exportTypedArrayMethod$h=arrayBufferViewCore.exportTypedArrayMethod;exportTypedArrayMethod$h("findIndex",(function findIndex(e){return $findIndex(aTypedArray$g(this),e,arguments.length>1?arguments[1]:void 0)}));var $forEach$1=arrayIteration.forEach,aTypedArray$f=arrayBufferViewCore.aTypedArray,exportTypedArrayMethod$g=arrayBufferViewCore.exportTypedArrayMethod;exportTypedArrayMethod$g("forEach",(function forEach(e){$forEach$1(aTypedArray$f(this),e,arguments.length>1?arguments[1]:void 0)}));var $includes=arrayIncludes.includes,aTypedArray$e=arrayBufferViewCore.aTypedArray,exportTypedArrayMethod$f=arrayBufferViewCore.exportTypedArrayMethod;exportTypedArrayMethod$f("includes",(function includes(e){return $includes(aTypedArray$e(this),e,arguments.length>1?arguments[1]:void 0)}));var $indexOf=arrayIncludes.indexOf,aTypedArray$d=arrayBufferViewCore.aTypedArray,exportTypedArrayMethod$e=arrayBufferViewCore.exportTypedArrayMethod;exportTypedArrayMethod$e("indexOf",(function indexOf(e){return $indexOf(aTypedArray$d(this),e,arguments.length>1?arguments[1]:void 0)}));var ITERATOR$3=wellKnownSymbol("iterator"),Uint8Array$2=global$1.Uint8Array,arrayValues=es_array_iterator.values,arrayKeys=es_array_iterator.keys,arrayEntries=es_array_iterator.entries,aTypedArray$c=arrayBufferViewCore.aTypedArray,exportTypedArrayMethod$d=arrayBufferViewCore.exportTypedArrayMethod,nativeTypedArrayIterator=Uint8Array$2&&Uint8Array$2.prototype[ITERATOR$3],CORRECT_ITER_NAME=!!nativeTypedArrayIterator&&("values"==nativeTypedArrayIterator.name||null==nativeTypedArrayIterator.name),typedArrayValues=function values(){return arrayValues.call(aTypedArray$c(this))};exportTypedArrayMethod$d("entries",(function entries(){return arrayEntries.call(aTypedArray$c(this))})),exportTypedArrayMethod$d("keys",(function keys(){return arrayKeys.call(aTypedArray$c(this))})),exportTypedArrayMethod$d("values",typedArrayValues,!CORRECT_ITER_NAME),exportTypedArrayMethod$d(ITERATOR$3,typedArrayValues,!CORRECT_ITER_NAME);var aTypedArray$b=arrayBufferViewCore.aTypedArray,exportTypedArrayMethod$c=arrayBufferViewCore.exportTypedArrayMethod,$join=[].join;exportTypedArrayMethod$c("join",(function join(e){return $join.apply(aTypedArray$b(this),arguments)}));var arrayMethodIsStrict=function(e,r){var t=[][e];return!!t&&fails((function(){t.call(null,r||function(){throw 1},1)}))},min$2=Math.min,$lastIndexOf=[].lastIndexOf,NEGATIVE_ZERO=!!$lastIndexOf&&1/[1].lastIndexOf(1,-0)<0,STRICT_METHOD$2=arrayMethodIsStrict("lastIndexOf"),FORCED$5=NEGATIVE_ZERO||!STRICT_METHOD$2,arrayLastIndexOf=FORCED$5?function lastIndexOf(e){if(NEGATIVE_ZERO)return $lastIndexOf.apply(this,arguments)||0;var r=toIndexedObject(this),t=toLength(r.length),a=t-1;for(arguments.length>1&&(a=min$2(a,toInteger(arguments[1]))),a<0&&(a=t+a);a>=0;a--)if(a in r&&r[a]===e)return a||0;return-1}:$lastIndexOf,aTypedArray$a=arrayBufferViewCore.aTypedArray,exportTypedArrayMethod$b=arrayBufferViewCore.exportTypedArrayMethod;exportTypedArrayMethod$b("lastIndexOf",(function lastIndexOf(e){return arrayLastIndexOf.apply(aTypedArray$a(this),arguments)}));var $map=arrayIteration.map,aTypedArray$9=arrayBufferViewCore.aTypedArray,exportTypedArrayMethod$a=arrayBufferViewCore.exportTypedArrayMethod;exportTypedArrayMethod$a("map",(function map(e){return $map(aTypedArray$9(this),e,arguments.length>1?arguments[1]:void 0,(function(e,r){return new(typedArraySpeciesConstructor(e))(r)}))}));var createMethod$1=function(e){return function(r,t,a,i){aFunction(t);var s=toObject(r),c=indexedObject(s),l=toLength(s.length),u=e?l-1:0,p=e?-1:1;if(a<2)for(;;){if(u in c){i=c[u],u+=p;break}if(u+=p,e?u<0:l<=u)throw TypeError("Reduce of empty array with no initial value")}for(;e?u>=0:l>u;u+=p)u in c&&(i=t(i,c[u],u,s));return i}},arrayReduce={left:createMethod$1(!1),right:createMethod$1(!0)},$reduce=arrayReduce.left,aTypedArray$8=arrayBufferViewCore.aTypedArray,exportTypedArrayMethod$9=arrayBufferViewCore.exportTypedArrayMethod;exportTypedArrayMethod$9("reduce",(function reduce(e){return $reduce(aTypedArray$8(this),e,arguments.length,arguments.length>1?arguments[1]:void 0)}));var $reduceRight=arrayReduce.right,aTypedArray$7=arrayBufferViewCore.aTypedArray,exportTypedArrayMethod$8=arrayBufferViewCore.exportTypedArrayMethod;exportTypedArrayMethod$8("reduceRight",(function reduceRight(e){return $reduceRight(aTypedArray$7(this),e,arguments.length,arguments.length>1?arguments[1]:void 0)}));var aTypedArray$6=arrayBufferViewCore.aTypedArray,exportTypedArrayMethod$7=arrayBufferViewCore.exportTypedArrayMethod,floor$4=Math.floor;exportTypedArrayMethod$7("reverse",(function reverse(){for(var e,r=aTypedArray$6(this).length,t=floor$4(r/2),a=0;a1?arguments[1]:void 0,1),t=this.length,a=toObject(e),i=toLength(a.length),s=0;if(i+r>t)throw RangeError("Wrong length");for(;si;)c[i]=t[i++];return c}),FORCED$3);var $some=arrayIteration.some,aTypedArray$3=arrayBufferViewCore.aTypedArray,exportTypedArrayMethod$4=arrayBufferViewCore.exportTypedArrayMethod;exportTypedArrayMethod$4("some",(function some(e){return $some(aTypedArray$3(this),e,arguments.length>1?arguments[1]:void 0)}));var floor$3=Math.floor,mergeSort=function(e,r){var t=e.length,a=floor$3(t/2);return t<8?insertionSort(e,r):merge(mergeSort(e.slice(0,a),r),mergeSort(e.slice(a),r),r)},insertionSort=function(e,r){for(var t,a,i=e.length,s=1;s0;)e[a]=e[--a];a!==s++&&(e[a]=t)}return e},merge=function(e,r,t){for(var a=e.length,i=r.length,s=0,c=0,l=[];s0&&1/t<0?1:-1:r>t}};exportTypedArrayMethod$3("sort",(function sort(e){if(void 0!==e&&aFunction(e),STABLE_SORT$1)return nativeSort$1.call(this,e);aTypedArray$2(this);var r,t=toLength(this.length),a=Array(t);for(r=0;r=51||!fails((function(){var r=[];return(r.constructor={})[SPECIES$1]=function(){return{foo:1}},1!==r[e](Boolean).foo}))},HAS_SPECIES_SUPPORT$1=arrayMethodHasSpeciesSupport("slice"),SPECIES=wellKnownSymbol("species"),nativeSlice=[].slice,max$1=Math.max;_export({target:"Array",proto:!0,forced:!HAS_SPECIES_SUPPORT$1},{slice:function slice(e,r){var t,a,i,s=toIndexedObject(this),c=toLength(s.length),l=toAbsoluteIndex(e,c),u=toAbsoluteIndex(void 0===r?c:r,c);if(isArray(s)&&("function"!=typeof(t=s.constructor)||t!==Array&&!isArray(t.prototype)?isObject(t)&&null===(t=t[SPECIES])&&(t=void 0):t=void 0,t===Array||void 0===t))return nativeSlice.call(s,l,u);for(a=new(void 0===t?Array:t)(max$1(u-l,0)),i=0;l1?arguments[1]:void 0)}});var TO_STRING="toString",RegExpPrototype=RegExp.prototype,nativeToString=RegExpPrototype[TO_STRING],NOT_GENERIC=fails((function(){return"/a/b"!=nativeToString.call({source:"a",flags:"b"})})),INCORRECT_NAME=nativeToString.name!=TO_STRING;(NOT_GENERIC||INCORRECT_NAME)&&redefine(RegExp.prototype,TO_STRING,(function toString$1(){var e=anObject(this),r=toString(e.source),t=e.flags;return"/"+r+"/"+toString(void 0===t&&e instanceof RegExp&&!("flags"in RegExpPrototype)?regexpFlags.call(e):t)}),{unsafe:!0});var test=[],nativeSort=test.sort,FAILS_ON_UNDEFINED=fails((function(){test.sort(void 0)})),FAILS_ON_NULL=fails((function(){test.sort(null)})),STRICT_METHOD$1=arrayMethodIsStrict("sort"),STABLE_SORT=!fails((function(){if(engineV8Version)return engineV8Version<70;if(!(engineFfVersion&&engineFfVersion>3)){if(engineIsIeOrEdge)return!0;if(engineWebkitVersion)return engineWebkitVersion<603;var e,r,t,a,i="";for(e=65;e<76;e++){switch(r=String.fromCharCode(e),e){case 66:case 69:case 70:case 72:t=3;break;case 68:case 71:t=4;break;default:t=2}for(a=0;a<47;a++)test.push({k:r+a,v:t})}for(test.sort((function(e,r){return r.v-e.v})),a=0;atoString(t)?1:-1}};_export({target:"Array",proto:!0,forced:FORCED$1},{sort:function sort(e){void 0!==e&&aFunction(e);var r=toObject(this);if(STABLE_SORT)return void 0===e?nativeSort.call(r):nativeSort.call(r,e);var t,a,i=[],s=toLength(r.length);for(a=0;a>>24&255,a[t+1]=i>>>16&255,a[t+2]=i>>>8&255,a[t+3]=i>>>0&255,new Uint8Array(a.buffer,0,t+4)},UZIP.deflateRaw=function(e,r){null==r&&(r={level:6});var t=new Uint8Array(50+Math.floor(1.1*e.length)),a=UZIP.F.deflateRaw(e,t,a,r.level);return new Uint8Array(t.buffer,0,a)},UZIP.encode=function(e,r){null==r&&(r=!1);var t=0,a=UZIP.bin.writeUint,i=UZIP.bin.writeUshort,s={};for(var c in e){var l=!UZIP._noNeed(c)&&!r,u=e[c],p=UZIP.crc.crc(u,0,u.length);s[c]={cpr:l,usize:u.length,crc:p,file:l?UZIP.deflateRaw(u):u}}for(var c in s)t+=s[c].file.length+30+46+2*UZIP.bin.sizeUTF8(c);t+=22;var d=new Uint8Array(t),y=0,h=[];for(var c in s){var A=s[c];h.push(y),y=UZIP._writeHeader(d,y,c,A,0)}var g=0,v=y;for(var c in s){A=s[c];h.push(y),y=UZIP._writeHeader(d,y,c,A,1,h[g++])}var m=y-v;return a(d,y,101010256),y+=4,i(d,y+=4,g),i(d,y+=2,g),a(d,y+=2,m),a(d,y+=4,v),y+=4,y+=2,d.buffer},UZIP._noNeed=function(e){var r=e.split(".").pop().toLowerCase();return-1!="png,jpg,jpeg,zip".indexOf(r)},UZIP._writeHeader=function(e,r,t,a,i,s){var c=UZIP.bin.writeUint,l=UZIP.bin.writeUshort,u=a.file;return c(e,r,0==i?67324752:33639248),r+=4,1==i&&(r+=2),l(e,r,20),l(e,r+=2,0),l(e,r+=2,a.cpr?8:0),c(e,r+=2,0),c(e,r+=4,a.crc),c(e,r+=4,u.length),c(e,r+=4,a.usize),l(e,r+=4,UZIP.bin.sizeUTF8(t)),l(e,r+=2,0),r+=2,1==i&&(r+=2,r+=2,c(e,r+=6,s),r+=4),r+=UZIP.bin.writeUTF8(e,r,t),0==i&&(e.set(u,r),r+=u.length),r},UZIP.crc={table:function(){for(var e=new Uint32Array(256),r=0;r<256;r++){for(var t=r,a=0;a<8;a++)1&t?t=3988292384^t>>>1:t>>>=1;e[r]=t}return e}(),update:function(e,r,t,a){for(var i=0;i>>8;return e},crc:function(e,r,t){return 4294967295^UZIP.crc.update(4294967295,e,r,t)}},UZIP.adler=function(e,r,t){for(var a=1,i=0,s=r,c=r+t;s>8&255},readUint:function(e,r){return 16777216*e[r+3]+(e[r+2]<<16|e[r+1]<<8|e[r])},writeUint:function(e,r,t){e[r]=255&t,e[r+1]=t>>8&255,e[r+2]=t>>16&255,e[r+3]=t>>24&255},readASCII:function(e,r,t){for(var a="",i=0;i>6,e[r+i+1]=128|c>>0&63,i+=2;else if(0==(4294901760&c))e[r+i]=224|c>>12,e[r+i+1]=128|c>>6&63,e[r+i+2]=128|c>>0&63,i+=3;else{if(0!=(4292870144&c))throw"e";e[r+i]=240|c>>18,e[r+i+1]=128|c>>12&63,e[r+i+2]=128|c>>6&63,e[r+i+3]=128|c>>0&63,i+=4}}return i},sizeUTF8:function(e){for(var r=e.length,t=0,a=0;a>>3}var h=s.lits,A=s.strt,g=s.prev,v=0,m=0,E=0,I=0,P=0,T=0;for(y>2&&(A[T=UZIP.F._hash(e,0)]=0),u=0;u14e3||m>26697)&&y-u>100&&(d>>16,_=65535&S;if(0!=S){_=65535&S;var w=c(R=S>>>16,s.of0);s.lhst[257+w]++;var U=c(_,s.df0);s.dhst[U]++,I+=s.exb[w]+s.dxb[U],h[v]=R<<23|u-d,h[v+1]=_<<16|w<<8|U,v+=2,d=u+R}else s.lhst[e[u]]++;m++}}for(E==u&&0!=e.length||(d>>3},UZIP.F._bestMatch=function(e,r,t,a,i,s){var c=32767&r,l=t[c],u=c-l+32768&32767;if(l==c||a!=UZIP.F._hash(e,r-u))return 0;for(var p=0,d=0,y=Math.min(32767,r);u<=y&&0!=--s&&l!=c;){if(0==p||e[r+p]==e[r+p-u]){var h=UZIP.F._howLong(e,r,u);if(h>p){if(d=u,(p=h)>=i)break;u+2A&&(A=m,l=v)}}}u+=(c=l)-(l=t[c])+32768&32767}return p<<16|d},UZIP.F._howLong=function(e,r,t){if(e[r]!=e[r-t]||e[r+1]!=e[r+1-t]||e[r+2]!=e[r+2-t])return 0;var a=r,i=Math.min(e.length,r+258);for(r+=3;r>>23,B=$+(8388607&x);$>16,V=D>>8&255,k=255&D;T(l,u=UZIP.F._writeLit(257+V,U,l,u),M-I.of0[V]),u+=I.exb[V],P(l,u=UZIP.F._writeLit(k,O,l,u),G-I.df0[k]),u+=I.dxb[k],$+=M}}u=UZIP.F._writeLit(256,U,l,u)}return u},UZIP.F._copyExact=function(e,r,t,a,i){var s=i>>>3;return a[s]=t,a[s+1]=t>>>8,a[s+2]=255-a[s],a[s+3]=255-a[s+1],s+=4,a.set(new Uint8Array(e.buffer,r,t),s),i+(t+4<<3)},UZIP.F.getTrees=function(){for(var e=UZIP.F.U,r=UZIP.F._hufTree(e.lhst,e.ltree,15),t=UZIP.F._hufTree(e.dhst,e.dtree,15),a=[],i=UZIP.F._lenCodes(e.ltree,a),s=[],c=UZIP.F._lenCodes(e.dtree,s),l=0;l4&&0==e.itree[1+(e.ordr[p-1]<<1)];)p--;return[r,t,u,i,c,p,a,s]},UZIP.F.getSecond=function(e){for(var r=[],t=0;t>1)+",");return r},UZIP.F.contSize=function(e,r){for(var t=0,a=0;a15&&(UZIP.F._putsE(t,a,c,l),a+=l)}return a},UZIP.F._lenCodes=function(e,r){for(var t=e.length;2!=t&&0==e[t-1];)t-=2;for(var a=0;a>>1,138))<11?r.push(17,p-3):r.push(18,p-11),a+=2*p-2}else if(i==l&&s==i&&c==i){for(u=a+5;u+2>>1,6);r.push(16,p-3),a+=2*p-2}else r.push(i,0)}return t>>>1},UZIP.F._hufTree=function(e,r,t){var a=[],i=e.length,s=r.length,c=0;for(c=0;ct&&(UZIP.F.restrictDepth(u,t,v),v=t),c=0;cr;a++){var c=e[a].d;e[a].d=r,s+=i-(1<>>=t-r;s>0;){(c=e[a].d)=0;a--)e[a].d==r&&s<0&&(e[a].d--,s++);0!=s&&console.log("debt left")},UZIP.F._goodIndex=function(e,r){var t=0;return r[16|t]<=e&&(t|=16),r[8|t]<=e&&(t|=8),r[4|t]<=e&&(t|=4),r[2|t]<=e&&(t|=2),r[1|t]<=e&&(t|=1),t},UZIP.F._writeLit=function(e,r,t,a){return UZIP.F._putsF(t,a,r[e<<1]),a+r[1+(e<<1)]},UZIP.F.inflate=function(e,r){var t=Uint8Array;if(3==e[0]&&0==e[1])return r||new t(0);var a=UZIP.F,i=a._bitsF,s=a._bitsE,c=a._decodeTiny,l=a.makeCodes,u=a.codes2map,p=a._get17,d=a.U,y=null==r;y&&(r=new t(e.length>>>2<<3));for(var h,A,g=0,v=0,m=0,E=0,I=0,P=0,T=0,b=0,S=0;0==g;)if(g=i(e,S,1),v=i(e,S+1,2),S+=3,0!=v){if(y&&(r=UZIP.F._check(r,b+(1<<17))),1==v&&(h=d.flmap,A=d.fdmap,P=511,T=31),2==v){m=s(e,S,5)+257,E=s(e,S+5,5)+1,I=s(e,S+10,4)+4,S+=14;for(var R=0;R<38;R+=2)d.itree[R]=0,d.itree[R+1]=0;var _=1;for(R=0;R_&&(_=w)}S+=3*I,l(d.itree,_),u(d.itree,_,d.imap),h=d.lmap,A=d.dmap,S=c(d.imap,(1<<_)-1,m+E,e,S,d.ttree);var U=a._copyOut(d.ttree,0,m,d.ltree);P=(1<>>4;if($>>>8==0)r[b++]=$;else{if(256==$)break;var L=b+$-254;if($>264){var x=d.ldef[$-257];L=b+(x>>>3)+s(e,S,7&x),S+=7&x}var M=A[p(e,S)&T];S+=15&M;var B=M>>>4,D=d.ddef[B],G=(D>>>4)+i(e,S,15&D);for(S+=15&D,y&&(r=UZIP.F._check(r,b+(1<<17)));b>>3),k=e[V-4]|e[V-3]<<8;y&&(r=UZIP.F._check(r,b+k)),r.set(new t(e.buffer,e.byteOffset+V,k),b),S=V+k<<3,b+=k}return r.length==b?r:r.slice(0,b)},UZIP.F._check=function(e,r){var t=e.length;if(r<=t)return e;var a=new Uint8Array(Math.max(t<<1,r));return a.set(e,0),a},UZIP.F._decodeTiny=function(e,r,t,a,i,s){for(var c=UZIP.F._bitsE,l=UZIP.F._get17,u=0;u>>4;if(d<=15)s[u]=d,u++;else{var y=0,h=0;16==d?(h=3+c(a,i,2),i+=2,y=s[u-1]):17==d?(h=3+c(a,i,3),i+=3):18==d&&(h=11+c(a,i,7),i+=7);for(var A=u+h;u>>1;si&&(i=l),s++}for(;s>1,l=e[s+1],u=c<<4|l,p=r-l,d=e[s]<>>15-r]=u,d++}},UZIP.F.revCodes=function(e,r){for(var t=UZIP.F.U.rev15,a=15-r,i=0;i>>a}},UZIP.F._putsE=function(e,r,t){t<<=7&r;var a=r>>>3;e[a]|=t,e[a+1]|=t>>>8},UZIP.F._putsF=function(e,r,t){t<<=7&r;var a=r>>>3;e[a]|=t,e[a+1]|=t>>>8,e[a+2]|=t>>>16},UZIP.F._bitsE=function(e,r,t){return(e[r>>>3]|e[1+(r>>>3)]<<8)>>>(7&r)&(1<>>3]|e[1+(r>>>3)]<<8|e[2+(r>>>3)]<<16)>>>(7&r)&(1<>>3]|e[1+(r>>>3)]<<8|e[2+(r>>>3)]<<16)>>>(7&r)},UZIP.F._get25=function(e,r){return(e[r>>>3]|e[1+(r>>>3)]<<8|e[2+(r>>>3)]<<16|e[3+(r>>>3)]<<24)>>>(7&r)},UZIP.F.U=(r=Uint16Array,t=Uint32Array,{next_code:new r(16),bl_count:new r(16),ordr:[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],of0:[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,999,999,999],exb:[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0],ldef:new r(32),df0:[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,65535,65535],dxb:[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0],ddef:new t(32),flmap:new r(512),fltree:[],fdmap:new r(32),fdtree:[],lmap:new r(32768),ltree:[],ttree:[],dmap:new r(32768),dtree:[],imap:new r(512),itree:[],rev15:new r(32768),lhst:new t(286),dhst:new t(30),ihst:new t(19),lits:new t(15e3),strt:new r(65536),prev:new r(32768)}),function(){for(var e=UZIP.F.U,r=0;r<32768;r++){var t=r;t=(4278255360&(t=(4042322160&(t=(3435973836&(t=(2863311530&t)>>>1|(1431655765&t)<<1))>>>2|(858993459&t)<<2))>>>4|(252645135&t)<<4))>>>8|(16711935&t)<<8,e.rev15[r]=(t>>>16|t<<16)>>>17}function pushV(e,r,t){for(;0!=r--;)e.push(0,t)}for(r=0;r<32;r++)e.ldef[r]=e.of0[r]<<3|e.exb[r],e.ddef[r]=e.df0[r]<<4|e.dxb[r];pushV(e.fltree,144,8),pushV(e.fltree,112,9),pushV(e.fltree,24,7),pushV(e.fltree,8,8),UZIP.F.makeCodes(e.fltree,9),UZIP.F.codes2map(e.fltree,9,e.flmap),UZIP.F.revCodes(e.fltree,9),pushV(e.fdtree,32,5),UZIP.F.makeCodes(e.fdtree,5),UZIP.F.codes2map(e.fdtree,5,e.fdmap),UZIP.F.revCodes(e.fdtree,5),pushV(e.itree,19,0),pushV(e.ltree,286,0),pushV(e.dtree,30,0),pushV(e.ttree,320,0)}()})),UZIP=Object.freeze(Object.assign(Object.create(null),UZIP_1,{default:UZIP_1})),UPNG={},N,W,H;UPNG.toRGBA8=function(e){var r=e.width,t=e.height;if(null==e.tabs.acTL)return[UPNG.toRGBA8.decodeImage(e.data,r,t,e).buffer];var a=[];null==e.frames[0].data&&(e.frames[0].data=e.data);for(var i=r*t*4,s=new Uint8Array(i),c=new Uint8Array(i),l=new Uint8Array(i),u=0;u>3)]>>7-((7&A)<<0)&1);l[P]=T[U],l[P+1]=T[U+1],l[P+2]=T[U+2],l[P+3]=O>2)]>>6-((3&A)<<1)&3);l[P]=T[U],l[P+1]=T[U+1],l[P+2]=T[U+2],l[P+3]=O>1)]>>4-((1&A)<<2)&15);l[P]=T[U],l[P+1]=T[U+1],l[P+2]=T[U+2],l[P+3]=O>>3)]>>>7-(7&M)&1))==255*m?0:255;u[x+M]=B<<24|C<<16|C<<8|C}else if(2==d)for(M=0;M>>2)]>>>6-((3&M)<<1)&3))==85*m?0:255;u[x+M]=B<<24|C<<16|C<<8|C}else if(4==d)for(M=0;M>>1)]>>>4-((1&M)<<2)&15))==17*m?0:255;u[x+M]=B<<24|C<<16|C<<8|C}else if(8==d)for(M=0;M>>2<<5));0==s;)if(s=v(e,A,1),c=v(e,A+1,2),A+=3,0!=c){if(S&&(r=H.H.W(r,h+(1<<17))),1==c&&(t=b.J,a=b.h,d=511,y=31),2==c){l=m(e,A,5)+257,u=m(e,A+5,5)+1,p=m(e,A+10,4)+4,A+=14;for(var R=1,_=0;_<38;_+=2)b.Q[_]=0,b.Q[_+1]=0;for(_=0;_R&&(R=w)}A+=3*p,I(b.Q,R),P(b.Q,R,b.u),t=b.w,a=b.d,A=E(b.u,(1<>>4;if($>>>8==0)r[h++]=$;else{if(256==$)break;var L=h+$-254;if($>264){var x=b.q[$-257];L=h+(x>>>3)+m(e,A,7&x),A+=7&x}var M=a[T(e,A)&y];A+=15&M;var B=M>>>4,D=b.c[B],G=(D>>>4)+v(e,A,15&D);for(A+=15&D;h>>3),k=e[V-4]|e[V-3]<<8;S&&(r=H.H.W(r,h+k)),r.set(new i(e.buffer,e.byteOffset+V,k),h),A=V+k<<3,h+=k}return r.length==h?r:r.slice(0,h)},H.H.W=function(e,r){var t=e.length;if(r<=t)return e;var a=new Uint8Array(t<<1);return a.set(e,0),a},H.H.R=function(e,r,t,a,i,s){for(var c=H.H.e,l=H.H.Z,u=0;u>>4;if(d<=15)s[u]=d,u++;else{var y=0,h=0;16==d?(h=3+c(a,i,2),i+=2,y=s[u-1]):17==d?(h=3+c(a,i,3),i+=3):18==d&&(h=11+c(a,i,7),i+=7);for(var A=u+h;u>>1;si&&(i=l),s++}for(;s>1,l=e[s+1],u=c<<4|l,p=r-l,d=e[s]<>>15-r]=u,d++},H.H.l=function(e,r){for(var t=H.H.m.r,a=15-r,i=0;i>>a}},H.H.M=function(e,r,t){t<<=7&r;var a=r>>>3;e[a]|=t,e[a+1]|=t>>>8},H.H.I=function(e,r,t){t<<=7&r;var a=r>>>3;e[a]|=t,e[a+1]|=t>>>8,e[a+2]|=t>>>16},H.H.e=function(e,r,t){return(e[r>>>3]|e[1+(r>>>3)]<<8)>>>(7&r)&(1<>>3]|e[1+(r>>>3)]<<8|e[2+(r>>>3)]<<16)>>>(7&r)&(1<>>3]|e[1+(r>>>3)]<<8|e[2+(r>>>3)]<<16)>>>(7&r)},H.H.i=function(e,r){return(e[r>>>3]|e[1+(r>>>3)]<<8|e[2+(r>>>3)]<<16|e[3+(r>>>3)]<<24)>>>(7&r)},H.H.m=(N=Uint16Array,W=Uint32Array,{K:new N(16),j:new N(16),X:[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],S:[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,999,999,999],T:[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0],q:new N(32),p:[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,65535,65535],z:[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0],c:new W(32),J:new N(512),_:[],h:new N(32),$:[],w:new N(32768),C:[],v:[],d:new N(32768),D:[],u:new N(512),Q:[],r:new N(32768),s:new W(286),Y:new W(30),a:new W(19),t:new W(15e3),k:new N(65536),g:new N(32768)}),function(){for(var e=H.H.m,r=0;r<32768;r++){var t=r;t=(4278255360&(t=(4042322160&(t=(3435973836&(t=(2863311530&t)>>>1|(1431655765&t)<<1))>>>2|(858993459&t)<<2))>>>4|(252645135&t)<<4))>>>8|(16711935&t)<<8,e.r[r]=(t>>>16|t<<16)>>>17}function n(e,r,t){for(;0!=r--;)e.push(0,t)}for(r=0;r<32;r++)e.q[r]=e.S[r]<<3|e.T[r],e.c[r]=e.p[r]<<4|e.z[r];n(e._,144,8),n(e._,112,9),n(e._,24,7),n(e._,8,8),H.H.n(e._,9),H.H.A(e._,9,e.J),H.H.l(e._,9),n(e.$,32,5),H.H.n(e.$,5),H.H.A(e.$,5,e.h),H.H.l(e.$,5),n(e.Q,19,0),n(e.C,286,0),n(e.D,30,0),n(e.v,320,0)}(),H.H.N),UPNG.decode._readInterlace=function(e,r){for(var t=r.width,a=r.height,i=UPNG.decode._getBPP(r),s=i>>3,c=Math.ceil(t*i/8),l=new Uint8Array(a*c),u=0,p=[0,0,4,0,2,0,1],d=[0,4,0,2,0,1,0],y=[8,8,8,4,4,2,2],h=[8,8,4,4,2,2,1],A=0;A<7;){for(var g=y[A],v=h[A],m=0,E=0,I=p[A];I>3])>>7-(7&_)&1,l[S*c+(R>>3)]|=w<<7-((7&R)<<0);if(2==i)w=(w=e[_>>3])>>6-(7&_)&3,l[S*c+(R>>2)]|=w<<6-((3&R)<<1);if(4==i)w=(w=e[_>>3])>>4-(7&_)&15,l[S*c+(R>>1)]|=w<<4-((1&R)<<2);if(i>=8)for(var U=S*c+R*s,O=0;O>3)+O];_+=i,R+=v}b++,S+=g}m*E!=0&&(u+=E*(1+T)),A+=1}return l},UPNG.decode._getBPP=function(e){return[1,null,3,1,2,null,4][e.ctype]*e.depth},UPNG.decode._filterZero=function(e,r,t,a,i){var s=UPNG.decode._getBPP(r),c=Math.ceil(a*s/8),l=UPNG.decode._paeth;s=Math.ceil(s/8);var u=0,p=1,d=e[t],y=0;if(d>1&&(e[t]=[0,0,1][d-2]),3==d)for(y=s;y>>1)&255;for(var h=0;h>>1);for(;y>>1)}else{for(;y>8&255,e[r+1]=255&t},readUint:function readUint(e,r){return 16777216*e[r]+(e[r+1]<<16|e[r+2]<<8|e[r+3])},writeUint:function writeUint(e,r,t){e[r]=t>>24&255,e[r+1]=t>>16&255,e[r+2]=t>>8&255,e[r+3]=255&t},readASCII:function readASCII(e,r,t){for(var a="",i=0;i=0&&l>=0?(y=A*r+g<<2,h=(l+A)*i+c+g<<2):(y=(-l+A)*r-c+g<<2,h=A*i+g<<2),0==u)a[h]=e[y],a[h+1]=e[y+1],a[h+2]=e[y+2],a[h+3]=e[y+3];else if(1==u){var v=e[y+3]*(1/255),m=e[y]*v,E=e[y+1]*v,I=e[y+2]*v,P=a[h+3]*(1/255),T=a[h]*P,b=a[h+1]*P,S=a[h+2]*P,R=1-v,_=v+P*R,w=0==_?0:1/_;a[h+3]=255*_,a[h+0]=(m+T*R)*w,a[h+1]=(E+b*R)*w,a[h+2]=(I+S*R)*w}else if(2==u){v=e[y+3],m=e[y],E=e[y+1],I=e[y+2],P=a[h+3],T=a[h],b=a[h+1],S=a[h+2];v==P&&m==T&&E==b&&I==S?(a[h]=0,a[h+1]=0,a[h+2]=0,a[h+3]=0):(a[h]=m,a[h+1]=E,a[h+2]=I,a[h+3]=v)}else if(3==u){v=e[y+3],m=e[y],E=e[y+1],I=e[y+2],P=a[h+3],T=a[h],b=a[h+1],S=a[h+2];if(v==P&&m==T&&E==b&&I==S)continue;if(v<220&&P>20)return!1}return!0},UPNG.encode=function(e,r,t,a,i,s,c){null==a&&(a=0),null==c&&(c=!1);var l=UPNG.encode.compress(e,r,t,a,[!1,!1,!1,0,c]);return UPNG.encode.compressPNG(l,-1),UPNG.encode._main(l,r,t,i,s)},UPNG.encodeLL=function(e,r,t,a,i,s,c,l){for(var u={ctype:0+(1==a?0:2)+(0==i?0:4),depth:s,frames:[]},p=(a+i)*s,d=p*r,y=0;y1,y=!1,h=33+(d?20:0);if(null!=i.sRGB&&(h+=13),null!=i.pHYs&&(h+=21),3==e.ctype){for(var A=e.plte.length,g=0;g>>24!=255&&(y=!0);h+=8+3*A+4+(y?8+1*A+4:0)}for(var v=0;v>>8&255,S=P>>>16&255;m[p+I+0]=T,m[p+I+1]=b,m[p+I+2]=S}if(c(m,p+=3*A,s(m,p-3*A-4,3*A+4)),p+=4,y){c(m,p,A),u(m,p+=4,"tRNS"),p+=4;for(g=0;g>>24&255;c(m,p+=A,s(m,p-A-4,A+4)),p+=4}}var R=0;for(v=0;v>2,O>>2));for(A=0;AL&&M==$[m-L])x[m]=x[m-L];else{var B=P[M];if(null==B&&(P[M]=B=T.length,T.push(M),T.length>=300))break;x[m]=B}}}var D=T.length;D<=256&&0==p&&(y=D<=2?1:D<=4?2:D<=16?4:8,y=Math.max(y,u));for(A=0;A>1)]|=q[z+K]<<4-4*(1&K);else if(2==y)for(K=0;K>2)]|=q[z+K]<<6-2*(3&K);else if(1==y)for(K=0;K>3)]|=q[z+K]<<7-1*(7&K)}V=Z,d=3,Y=1}else if(0==E&&1==I.length){Z=new Uint8Array(L*G*3);var X=L*G;for(m=0;m_&&(_=O),Uw&&(w=U))}-1==_&&(S=R=_=w=0),i&&(1==(1&S)&&S--,1==(1&R)&&R--);var C=(_-S+1)*(w-R+1);Cm&&(m=T),bE&&(E=b))}-1==m&&(g=v=m=E=0),c&&(1==(1&g)&&g--,1==(1&v)&&v--),s={x:g,y:v,width:m-g+1,height:E-v+1};var _=a[i];_.rect=s,_.blend=1,_.img=new Uint8Array(s.width*s.height*4),0==a[i-1].dispose?(UPNG._copyTile(p,r,t,_.img,s.width,s.height,-s.x,-s.y,0),UPNG.encode._prepareDiff(h,r,t,_.img,s)):UPNG._copyTile(h,r,t,_.img,s.width,s.height,-s.x,-s.y,0)},UPNG.encode._prepareDiff=function(e,r,t,a,i){UPNG._copyTile(e,r,t,a,i.width,i.height,-i.x,-i.y,2)},UPNG.encode._filterZero=function(e,r,t,a,i,s,c){var l,u=[],p=[0,1,2,3,4];-1!=s?p=[s]:(r*a>5e5||1==t)&&(p=[0]),c&&(l={level:0});for(var d,y=UZIP,h=0;h>1)+256&255;if(4==s)for(p=i;p>1)&255;for(p=i;p>1)&255}if(4==s){for(p=0;p>>1:t>>>=1;e[r]=t}return e}(),update:function update(e,r,t,a){for(var i=0;i>>8;return e},crc:function crc(e,r,t){return 4294967295^UPNG.crc.update(4294967295,e,r,t)}},UPNG.quantize=function(e,r){var t,a=new Uint8Array(e),i=a.slice(0),s=new Uint32Array(i.buffer),c=UPNG.quantize.getKDtree(i,r),l=c[0],u=c[1],p=UPNG.quantize.planeDst,d=a,y=s,h=d.length,A=new Uint8Array(a.length>>2);if(a.length<2e7)for(var g=0;g>2]=t.ind,y[g>>2]=t.est.rgba}else for(g=0;g>2]=t.ind,y[g>>2]=t.est.rgba}return{abuf:i.buffer,inds:A,plte:u}},UPNG.quantize.getKDtree=function(e,r,t){null==t&&(t=1e-4);var a=new Uint32Array(e.buffer),i={i0:0,i1:e.length,bst:null,est:null,tdst:0,left:null,right:null};i.bst=UPNG.quantize.stats(e,i.i0,i.i1),i.est=UPNG.quantize.estats(i.bst);for(var s=[i];s.lengthc&&(c=s[u].est.L,l=u);if(c=d||p.i1<=d)p.est.L=0;else{var y={i0:p.i0,i1:d,bst:null,est:null,tdst:0,left:null,right:null};y.bst=UPNG.quantize.stats(e,y.i0,y.i1),y.est=UPNG.quantize.estats(y.bst);var h={i0:d,i1:p.i1,bst:null,est:null,tdst:0,left:null,right:null};h.bst={R:[],m:[],N:p.bst.N-y.bst.N};for(u=0;u<16;u++)h.bst.R[u]=p.bst.R[u]-y.bst.R[u];for(u=0;u<4;u++)h.bst.m[u]=p.bst.m[u]-y.bst.m[u];h.est=UPNG.quantize.estats(h.bst),p.left=y,p.right=h,s[l]=y,s.push(h)}}s.sort((function(e,r){return r.bst.N-e.bst.N}));for(u=0;u0&&(c=e.right,l=e.left);var u=UPNG.quantize.getNearest(c,r,t,a,i);if(u.tdst<=s*s)return u;var p=UPNG.quantize.getNearest(l,r,t,a,i);return p.tdsts;)a-=4;if(t>=a)break;var l=r[t>>2];r[t>>2]=r[a>>2],r[a>>2]=l,t+=4,a-=4}for(;c(e,t,i)>s;)t-=4;return t+4},UPNG.quantize.vecDot=function(e,r,t){return e[r]*t[0]+e[r+1]*t[1]+e[r+2]*t[2]+e[r+3]*t[3]},UPNG.quantize.stats=function(e,r,t){for(var a=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],i=[0,0,0,0],s=t-r>>2,c=r;c>>0}},UPNG.M4={multVec:function multVec(e,r){return[e[0]*r[0]+e[1]*r[1]+e[2]*r[2]+e[3]*r[3],e[4]*r[0]+e[5]*r[1]+e[6]*r[2]+e[7]*r[3],e[8]*r[0]+e[9]*r[1]+e[10]*r[2]+e[11]*r[3],e[12]*r[0]+e[13]*r[1]+e[14]*r[2]+e[15]*r[3]]},dot:function dot(e,r){return e[0]*r[0]+e[1]*r[1]+e[2]*r[2]+e[3]*r[3]},sml:function sml(e,r){return[e*r[0],e*r[1],e*r[2],e*r[3]]}},UPNG.encode.concatRGBA=function(e){for(var r=0,t=0;t2&&void 0!==arguments[2]?arguments[2]:Date.now();return new Promise((function(a){for(var i=e.split(","),s=i[0].match(/:(.*?);/)[1],c=globalThis.atob(i[1]),l=c.length,u=new Uint8Array(l);l--;)u[l]=c.charCodeAt(l);var p=new Blob([u],{type:s});p.name=r,p.lastModified=t,a(p)}))}function getDataUrlFromFile(e){return new Promise((function(r,t){var a=new CustomFileReader;a.onload=function(){return r(a.result)},a.onerror=function(e){return t(e)},a.readAsDataURL(e)}))}function loadImage(e){return new Promise((function(r,t){var a=new Image;a.onload=function(){return r(a)},a.onerror=function(e){return t(e)},a.src=e}))}function getBrowserName(){var e="etc";return-1===navigator.userAgent.indexOf("Chrome")&&-1===navigator.userAgent.indexOf("Chromium")||(e="chrome"),-1!==navigator.userAgent.indexOf("Safari")?e="safari":-1!==navigator.userAgent.indexOf("Firefox")?e="firefox":-1===navigator.userAgent.indexOf("MSIE")&&!0!=!!document.documentMode||(e="internet explorer"),e}function approximateBelowMaximumCanvasSizeOfBrowser(e,r){for(var t=getBrowserName(),a=MaxCanvasSize[t],i=e,s=r,c=i*s,l=i>s?s/i:i/s;c>a*a;){var u=(a+i)/2,p=(a+s)/2;u4&&void 0!==arguments[4]?arguments[4]:1;return new Promise((function(s,c){var l,u,p;if("image/png"===r)return u=e.getContext("2d").getImageData(0,0,e.width,e.height).data,p=UPNG.encode([u],e.width,e.height,256*i),(l=new Blob([p],{type:r})).name=t,l.lastModified=a,$If_4.call(this);{return"function"==typeof OffscreenCanvas&&e instanceof OffscreenCanvas?e.convertToBlob({type:r,quality:i}).then(function(e){try{return(l=e).name=t,l.lastModified=a,$If_5.call(this)}catch(e){return c(e)}}.bind(this),c):getFilefromDataUrl(e.toDataURL(r,i),t,a).then(function(e){try{return l=e,$If_5.call(this)}catch(e){return c(e)}}.bind(this),c);function $If_5(){return $If_4.call(this)}}function $If_4(){return s(l)}}))}function cleanupCanvasMemory(e){e.width=0,e.height=0}function isAutoOrientationInBrowser(){return new Promise((function(e,r){var t,a,i,s;return void 0!==isAutoOrientationInBrowser.result?e(isAutoOrientationInBrowser.result):("data:image/jpeg;base64,/9j/4QAiRXhpZgAATU0AKgAAAAgAAQESAAMAAAABAAYAAAAAAAD/2wCEAAEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAf/AABEIAAEAAgMBEQACEQEDEQH/xABKAAEAAAAAAAAAAAAAAAAAAAALEAEAAAAAAAAAAAAAAAAAAAAAAQEAAAAAAAAAAAAAAAAAAAAAEQEAAAAAAAAAAAAAAAAAAAAA/9oADAMBAAIRAxEAPwA/8H//2Q==",getFilefromDataUrl("data:image/jpeg;base64,/9j/4QAiRXhpZgAATU0AKgAAAAgAAQESAAMAAAABAAYAAAAAAAD/2wCEAAEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAf/AABEIAAEAAgMBEQACEQEDEQH/xABKAAEAAAAAAAAAAAAAAAAAAAALEAEAAAAAAAAAAAAAAAAAAAAAAQEAAAAAAAAAAAAAAAAAAAAAEQEAAAAAAAAAAAAAAAAAAAAA/9oADAMBAAIRAxEAPwA/8H//2Q==","test.jpg",Date.now()).then((function(c){try{return drawFileInCanvas(t=c).then((function(c){try{return canvasToFile(a=c[1],t.type,t.name,t.lastModified).then((function(t){try{return i=t,cleanupCanvasMemory(a),drawFileInCanvas(i).then((function(t){try{return s=t[0],isAutoOrientationInBrowser.result=1===s.width&&2===s.height,e(isAutoOrientationInBrowser.result)}catch(e){return r(e)}}),r)}catch(e){return r(e)}}),r)}catch(e){return r(e)}}),r)}catch(e){return r(e)}}),r))}))}function getExifOrientation(e){return new Promise((function(r,t){var a=new CustomFileReader;a.onload=function(e){var t=new DataView(e.target.result);if(65496!=t.getUint16(0,!1))return r(-2);for(var a=t.byteLength,i=2;is||i>s)){var l=_slicedToArray(getNewCanvasAndCtx(a,i),2);c=l[0],t=l[1],a>i?(c.width=s,c.height=i/a*s):(c.width=a/i*s,c.height=s),t.drawImage(e,0,0,c.width,c.height),cleanupCanvasMemory(e)}return c}function followExifOrientation(e,r){var t=e.width,a=e.height,i=_slicedToArray(getNewCanvasAndCtx(t,a),2),s=i[0],c=i[1];switch(r>4&&r<9?(s.width=a,s.height=t):(s.width=t,s.height=a),r){case 2:c.transform(-1,0,0,1,t,0);break;case 3:c.transform(-1,0,0,-1,t,a);break;case 4:c.transform(1,0,0,-1,0,a);break;case 5:c.transform(0,1,1,0,0,0);break;case 6:c.transform(0,1,-1,0,a,0);break;case 7:c.transform(0,-1,-1,0,a,t);break;case 8:c.transform(0,-1,1,0,0,t)}return c.drawImage(e,0,0,t,a),cleanupCanvasMemory(e),s}function compress(e,r){var t=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;return new Promise((function(a,i){var s,c,l,u,p,d,y,h,A,g,v,m,E,I,P,T,b,S;function incProgress(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:5;s+=e,r.onProgress(Math.min(s,100))}function setProgress(e){s=Math.min(Math.max(e,s),100),r.onProgress(s)}return s=t,c=r.maxIteration||10,l=1024*r.maxSizeMB*1024,incProgress(),drawFileInCanvas(e).then(function(t){try{var s=_slicedToArray(t,2);return u=s[1],incProgress(),p=handleMaxWidthOrHeight(u,r),incProgress(),new Promise((function(t,a){var i;if(!(i=r.exifOrientation))return getExifOrientation(e).then(function(e){try{return i=e,$If_2.call(this)}catch(e){return a(e)}}.bind(this),a);function $If_2(){return t(i)}return $If_2.call(this)})).then(function(t){try{return d=t,incProgress(),isAutoOrientationInBrowser().then(function(t){try{return y=t?p:followExifOrientation(p,d),incProgress(),h=r.initialQuality||1,A=r.fileType||e.type,canvasToFile(y,A,e.name,e.lastModified,h).then(function(r){try{{if(g=r,incProgress(),v=g.size>l,m=g.size>e.size,!v&&!m)return setProgress(100),a(g);var t;function $Loop_3(){if(c--&&(P>l||P>E)){var r,t,a=_slicedToArray(getNewCanvasAndCtx(r=v?.95*S.width:S.width,t=v?.95*S.height:S.height),2);return b=a[0],a[1].drawImage(S,0,0,r,t),h*=.95,canvasToFile(b,A,e.name,e.lastModified,h).then((function(e){try{return T=e,cleanupCanvasMemory(S),S=b,P=T.size,setProgress(Math.min(99,Math.floor((I-P)/(I-l)*100))),$Loop_3}catch(e){return i(e)}}),i)}return[1]}return E=e.size,I=g.size,P=I,S=y,(t=function(e){for(;e;){if(e.then)return void e.then(t,i);try{if(e.pop){if(e.length)return e.pop()?$Loop_3_exit.call(this):e;e=$Loop_3}else e=e.call(this)}catch(e){return i(e)}}}.bind(this))($Loop_3);function $Loop_3_exit(){return cleanupCanvasMemory(S),cleanupCanvasMemory(b),cleanupCanvasMemory(p),cleanupCanvasMemory(y),cleanupCanvasMemory(u),setProgress(100),a(T)}}}catch(e){return i(e)}}.bind(this),i)}catch(e){return i(e)}}.bind(this),i)}catch(e){return i(e)}}.bind(this),i)}catch(e){return i(e)}}.bind(this),i)}))}var charAt=stringMultibyte.charAt,STRING_ITERATOR="String Iterator",setInternalState$2=internalState.set,getInternalState=internalState.getterFor(STRING_ITERATOR);defineIterator(String,"String",(function(e){setInternalState$2(this,{type:STRING_ITERATOR,string:toString(e),index:0})}),(function next(){var e,r=getInternalState(this),t=r.string,a=r.index;return a>=t.length?{value:void 0,done:!0}:(e=charAt(t,a),r.index+=e.length,{value:e,done:!1})}));var domIterables={CSSRuleList:0,CSSStyleDeclaration:0,CSSValueList:0,ClientRectList:0,DOMRectList:0,DOMStringList:0,DOMTokenList:1,DataTransferItemList:0,FileList:0,HTMLAllCollection:0,HTMLCollection:0,HTMLFormElement:0,HTMLSelectElement:0,MediaList:0,MimeTypeArray:0,NamedNodeMap:0,NodeList:1,PaintRequestList:0,Plugin:0,PluginArray:0,SVGLengthList:0,SVGNumberList:0,SVGPathSegList:0,SVGPointList:0,SVGStringList:0,SVGTransformList:0,SourceBufferList:0,StyleSheetList:0,TextTrackCueList:0,TextTrackList:0,TouchList:0},ITERATOR$2=wellKnownSymbol("iterator"),TO_STRING_TAG=wellKnownSymbol("toStringTag"),ArrayValues=es_array_iterator.values;for(var COLLECTION_NAME$1 in domIterables){var Collection$1=global$1[COLLECTION_NAME$1],CollectionPrototype$1=Collection$1&&Collection$1.prototype;if(CollectionPrototype$1){if(CollectionPrototype$1[ITERATOR$2]!==ArrayValues)try{createNonEnumerableProperty(CollectionPrototype$1,ITERATOR$2,ArrayValues)}catch(e){CollectionPrototype$1[ITERATOR$2]=ArrayValues}if(CollectionPrototype$1[TO_STRING_TAG]||createNonEnumerableProperty(CollectionPrototype$1,TO_STRING_TAG,COLLECTION_NAME$1),domIterables[COLLECTION_NAME$1])for(var METHOD_NAME in es_array_iterator)if(CollectionPrototype$1[METHOD_NAME]!==es_array_iterator[METHOD_NAME])try{createNonEnumerableProperty(CollectionPrototype$1,METHOD_NAME,es_array_iterator[METHOD_NAME])}catch(e){CollectionPrototype$1[METHOD_NAME]=es_array_iterator[METHOD_NAME]}}}var ITERATOR$1=wellKnownSymbol("iterator"),nativeUrl=!fails((function(){var e=new URL("b?a=1&b=2&c=3","http://a"),r=e.searchParams,t="";return e.pathname="c%20d",r.forEach((function(e,a){r.delete("b"),t+=a+e})),isPure&&!e.toJSON||!r.sort||"http://a/c%20d?a=1&c=3"!==e.href||"3"!==r.get("c")||"a=1"!==String(new URLSearchParams("?a=1"))||!r[ITERATOR$1]||"a"!==new URL("https://a@b").username||"b"!==new URLSearchParams(new URLSearchParams("a=b")).get("a")||"xn--e1aybc"!==new URL("http://тест").host||"#%D0%B1"!==new URL("http://a#б").hash||"a1c3"!==t||"x"!==new URL("http://x",void 0).host})),callWithSafeIterationClosing=function(e,r,t,a){try{return a?r(anObject(t)[0],t[1]):r(t)}catch(r){throw iteratorClose(e),r}},arrayFrom=function from(e){var r,t,a,i,s,c,l=toObject(e),u="function"==typeof this?this:Array,p=arguments.length,d=p>1?arguments[1]:void 0,y=void 0!==d,h=getIteratorMethod(l),A=0;if(y&&(d=functionBindContext(d,p>2?arguments[2]:void 0,2)),null==h||u==Array&&isArrayIteratorMethod(h))for(t=new u(r=toLength(l.length));r>A;A++)c=y?d(l[A],A):l[A],createProperty(t,A,c);else for(s=(i=h.call(l)).next,t=new u;!(a=s.call(i)).done;A++)c=y?callWithSafeIterationClosing(i,d,[a.value,A],!0):a.value,createProperty(t,A,c);return t.length=A,t},maxInt=2147483647,base=36,tMin=1,tMax=26,skew=38,damp=700,initialBias=72,initialN=128,delimiter="-",regexNonASCII=/[^\0-\u007E]/,regexSeparators=/[.\u3002\uFF0E\uFF61]/g,OVERFLOW_ERROR="Overflow: input needs wider integers to process",baseMinusTMin=base-tMin,floor$2=Math.floor,stringFromCharCode=String.fromCharCode,ucs2decode=function(e){for(var r=[],t=0,a=e.length;t=55296&&i<=56319&&t>1,e+=floor$2(e/r);e>baseMinusTMin*tMax>>1;a+=base)e=floor$2(e/baseMinusTMin);return floor$2(a+(baseMinusTMin+1)*e/(e+skew))},encode=function(e){var r,t,a=[],i=(e=ucs2decode(e)).length,s=initialN,c=0,l=initialBias;for(r=0;r=s&&tfloor$2((maxInt-c)/y))throw RangeError(OVERFLOW_ERROR);for(c+=(d-s)*y,s=d,r=0;rmaxInt)throw RangeError(OVERFLOW_ERROR);if(t==s){for(var h=c,A=base;;A+=base){var g=A<=l?tMin:A>=l+tMax?tMax:A-l;if(h0?arguments[0]:void 0,d=this,y=[];if(setInternalState$1(d,{type:URL_SEARCH_PARAMS,entries:y,updateURL:function(){},updateSearchParams:updateSearchParams}),void 0!==p)if(isObject(p))if("function"==typeof(e=getIteratorMethod(p)))for(t=(r=e.call(p)).next;!(a=t.call(r)).done;){if((c=(s=(i=getIterator(anObject(a.value))).next).call(i)).done||(l=s.call(i)).done||!s.call(i).done)throw TypeError("Expected sequence with length 2");y.push({key:toString(c.value),value:toString(l.value)})}else for(u in p)has$1(p,u)&&y.push({key:u,value:toString(p[u])});else parseSearchParams(y,"string"==typeof p?"?"===p.charAt(0)?p.slice(1):p:toString(p))},URLSearchParamsPrototype=URLSearchParamsConstructor.prototype;if(redefineAll(URLSearchParamsPrototype,{append:function append(e,r){validateArgumentsLength(arguments.length,2);var t=getInternalParamsState(this);t.entries.push({key:toString(e),value:toString(r)}),t.updateURL()},delete:function(e){validateArgumentsLength(arguments.length,1);for(var r=getInternalParamsState(this),t=r.entries,a=toString(e),i=0;ie.key){i.splice(r,0,e);break}r===t&&i.push(e)}a.updateURL()},forEach:function forEach(e){for(var r,t=getInternalParamsState(this).entries,a=functionBindContext(e,arguments.length>1?arguments[1]:void 0,3),i=0;i1?wrapRequestOptions(arguments[1]):{})}}),"function"==typeof NativeRequest){var RequestConstructor=function Request(e){return anInstance(this,RequestConstructor,"Request"),new NativeRequest(e,arguments.length>1?wrapRequestOptions(arguments[1]):{})};RequestPrototype.constructor=RequestConstructor,RequestConstructor.prototype=RequestPrototype,_export({global:!0,forced:!0},{Request:RequestConstructor})}}var web_urlSearchParams={URLSearchParams:URLSearchParamsConstructor,getState:getInternalParamsState},codeAt=stringMultibyte.codeAt,NativeURL=global$1.URL,URLSearchParams$1=web_urlSearchParams.URLSearchParams,getInternalSearchParamsState=web_urlSearchParams.getState,setInternalState=internalState.set,getInternalURLState=internalState.getterFor("URL"),floor$1=Math.floor,pow=Math.pow,INVALID_AUTHORITY="Invalid authority",INVALID_SCHEME="Invalid scheme",INVALID_HOST="Invalid host",INVALID_PORT="Invalid port",ALPHA=/[A-Za-z]/,ALPHANUMERIC=/[\d+-.A-Za-z]/,DIGIT=/\d/,HEX_START=/^0x/i,OCT=/^[0-7]+$/,DEC=/^\d+$/,HEX=/^[\dA-Fa-f]+$/,FORBIDDEN_HOST_CODE_POINT=/[\0\t\n\r #%/:<>?@[\\\]^|]/,FORBIDDEN_HOST_CODE_POINT_EXCLUDING_PERCENT=/[\0\t\n\r #/:<>?@[\\\]^|]/,LEADING_AND_TRAILING_C0_CONTROL_OR_SPACE=/^[\u0000-\u0020]+|[\u0000-\u0020]+$/g,TAB_AND_NEW_LINE=/[\t\n\r]/g,EOF,parseHost=function(e,r){var t,a,i;if("["==r.charAt(0)){if("]"!=r.charAt(r.length-1))return INVALID_HOST;if(!(t=parseIPv6(r.slice(1,-1))))return INVALID_HOST;e.host=t}else if(isSpecial(e)){if(r=stringPunycodeToAscii(r),FORBIDDEN_HOST_CODE_POINT.test(r))return INVALID_HOST;if(null===(t=parseIPv4(r)))return INVALID_HOST;e.host=t}else{if(FORBIDDEN_HOST_CODE_POINT_EXCLUDING_PERCENT.test(r))return INVALID_HOST;for(t="",a=arrayFrom(r),i=0;i4)return e;for(t=[],a=0;a1&&"0"==i.charAt(0)&&(s=HEX_START.test(i)?16:8,i=i.slice(8==s?1:2)),""===i)c=0;else{if(!(10==s?DEC:8==s?OCT:HEX).test(i))return e;c=parseInt(i,s)}t.push(c)}for(a=0;a=pow(256,5-r))return null}else if(c>255)return null;for(l=t.pop(),a=0;a6)return;for(a=0;char();){if(i=null,a>0){if(!("."==char()&&a<4))return;y++}if(!DIGIT.test(char()))return;for(;DIGIT.test(char());){if(s=parseInt(char(),10),null===i)i=s;else{if(0==i)return;i=10*i+s}if(i>255)return;y++}u[p]=256*u[p]+i,2!=++a&&4!=a||p++}if(4!=a)return;break}if(":"==char()){if(y++,!char())return}else if(char())return;u[p++]=r}else{if(null!==d)return;y++,d=++p}}if(null!==d)for(c=p-d,p=7;0!=p&&c>0;)l=u[p],u[p--]=u[d+c-1],u[d+--c]=l;else if(8!=p)return;return u},findLongestZeroSequence=function(e){for(var r=null,t=1,a=null,i=0,s=0;s<8;s++)0!==e[s]?(i>t&&(r=a,t=i),a=null,i=0):(null===a&&(a=s),++i);return i>t&&(r=a,t=i),r},serializeHost=function(e){var r,t,a,i;if("number"==typeof e){for(r=[],t=0;t<4;t++)r.unshift(e%256),e=floor$1(e/256);return r.join(".")}if("object"==typeof e){for(r="",a=findLongestZeroSequence(e),t=0;t<8;t++)i&&0===e[t]||(i&&(i=!1),a===t?(r+=t?":":"::",i=!0):(r+=e[t].toString(16),t<7&&(r+=":")));return"["+r+"]"}return e},C0ControlPercentEncodeSet={},fragmentPercentEncodeSet=objectAssign({},C0ControlPercentEncodeSet,{" ":1,'"':1,"<":1,">":1,"`":1}),pathPercentEncodeSet=objectAssign({},fragmentPercentEncodeSet,{"#":1,"?":1,"{":1,"}":1}),userinfoPercentEncodeSet=objectAssign({},pathPercentEncodeSet,{"/":1,":":1,";":1,"=":1,"@":1,"[":1,"\\":1,"]":1,"^":1,"|":1}),percentEncode=function(e,r){var t=codeAt(e,0);return t>32&&t<127&&!has$1(r,e)?e:encodeURIComponent(e)},specialSchemes={ftp:21,file:null,http:80,https:443,ws:80,wss:443},isSpecial=function(e){return has$1(specialSchemes,e.scheme)},includesCredentials=function(e){return""!=e.username||""!=e.password},cannotHaveUsernamePasswordPort=function(e){return!e.host||e.cannotBeABaseURL||"file"==e.scheme},isWindowsDriveLetter=function(e,r){var t;return 2==e.length&&ALPHA.test(e.charAt(0))&&(":"==(t=e.charAt(1))||!r&&"|"==t)},startsWithWindowsDriveLetter=function(e){var r;return e.length>1&&isWindowsDriveLetter(e.slice(0,2))&&(2==e.length||"/"===(r=e.charAt(2))||"\\"===r||"?"===r||"#"===r)},shortenURLsPath=function(e){var r=e.path,t=r.length;!t||"file"==e.scheme&&1==t&&isWindowsDriveLetter(r[0],!0)||r.pop()},isSingleDot=function(e){return"."===e||"%2e"===e.toLowerCase()},isDoubleDot=function(e){return".."===(e=e.toLowerCase())||"%2e."===e||".%2e"===e||"%2e%2e"===e},SCHEME_START={},SCHEME={},NO_SCHEME={},SPECIAL_RELATIVE_OR_AUTHORITY={},PATH_OR_AUTHORITY={},RELATIVE={},RELATIVE_SLASH={},SPECIAL_AUTHORITY_SLASHES={},SPECIAL_AUTHORITY_IGNORE_SLASHES={},AUTHORITY={},HOST={},HOSTNAME={},PORT={},FILE={},FILE_SLASH={},FILE_HOST={},PATH_START={},PATH={},CANNOT_BE_A_BASE_URL_PATH={},QUERY={},FRAGMENT={},parseURL=function(e,r,t,a){var i,s,c,l,u=t||SCHEME_START,p=0,d="",y=!1,h=!1,A=!1;for(t||(e.scheme="",e.username="",e.password="",e.host=null,e.port=null,e.path=[],e.query=null,e.fragment=null,e.cannotBeABaseURL=!1,r=r.replace(LEADING_AND_TRAILING_C0_CONTROL_OR_SPACE,"")),r=r.replace(TAB_AND_NEW_LINE,""),i=arrayFrom(r);p<=i.length;){switch(s=i[p],u){case SCHEME_START:if(!s||!ALPHA.test(s)){if(t)return INVALID_SCHEME;u=NO_SCHEME;continue}d+=s.toLowerCase(),u=SCHEME;break;case SCHEME:if(s&&(ALPHANUMERIC.test(s)||"+"==s||"-"==s||"."==s))d+=s.toLowerCase();else{if(":"!=s){if(t)return INVALID_SCHEME;d="",u=NO_SCHEME,p=0;continue}if(t&&(isSpecial(e)!=has$1(specialSchemes,d)||"file"==d&&(includesCredentials(e)||null!==e.port)||"file"==e.scheme&&!e.host))return;if(e.scheme=d,t)return void(isSpecial(e)&&specialSchemes[e.scheme]==e.port&&(e.port=null));d="","file"==e.scheme?u=FILE:isSpecial(e)&&a&&a.scheme==e.scheme?u=SPECIAL_RELATIVE_OR_AUTHORITY:isSpecial(e)?u=SPECIAL_AUTHORITY_SLASHES:"/"==i[p+1]?(u=PATH_OR_AUTHORITY,p++):(e.cannotBeABaseURL=!0,e.path.push(""),u=CANNOT_BE_A_BASE_URL_PATH)}break;case NO_SCHEME:if(!a||a.cannotBeABaseURL&&"#"!=s)return INVALID_SCHEME;if(a.cannotBeABaseURL&&"#"==s){e.scheme=a.scheme,e.path=a.path.slice(),e.query=a.query,e.fragment="",e.cannotBeABaseURL=!0,u=FRAGMENT;break}u="file"==a.scheme?FILE:RELATIVE;continue;case SPECIAL_RELATIVE_OR_AUTHORITY:if("/"!=s||"/"!=i[p+1]){u=RELATIVE;continue}u=SPECIAL_AUTHORITY_IGNORE_SLASHES,p++;break;case PATH_OR_AUTHORITY:if("/"==s){u=AUTHORITY;break}u=PATH;continue;case RELATIVE:if(e.scheme=a.scheme,s==EOF)e.username=a.username,e.password=a.password,e.host=a.host,e.port=a.port,e.path=a.path.slice(),e.query=a.query;else if("/"==s||"\\"==s&&isSpecial(e))u=RELATIVE_SLASH;else if("?"==s)e.username=a.username,e.password=a.password,e.host=a.host,e.port=a.port,e.path=a.path.slice(),e.query="",u=QUERY;else{if("#"!=s){e.username=a.username,e.password=a.password,e.host=a.host,e.port=a.port,e.path=a.path.slice(),e.path.pop(),u=PATH;continue}e.username=a.username,e.password=a.password,e.host=a.host,e.port=a.port,e.path=a.path.slice(),e.query=a.query,e.fragment="",u=FRAGMENT}break;case RELATIVE_SLASH:if(!isSpecial(e)||"/"!=s&&"\\"!=s){if("/"!=s){e.username=a.username,e.password=a.password,e.host=a.host,e.port=a.port,u=PATH;continue}u=AUTHORITY}else u=SPECIAL_AUTHORITY_IGNORE_SLASHES;break;case SPECIAL_AUTHORITY_SLASHES:if(u=SPECIAL_AUTHORITY_IGNORE_SLASHES,"/"!=s||"/"!=d.charAt(p+1))continue;p++;break;case SPECIAL_AUTHORITY_IGNORE_SLASHES:if("/"!=s&&"\\"!=s){u=AUTHORITY;continue}break;case AUTHORITY:if("@"==s){y&&(d="%40"+d),y=!0,c=arrayFrom(d);for(var g=0;g65535)return INVALID_PORT;e.port=isSpecial(e)&&E===specialSchemes[e.scheme]?null:E,d=""}if(t)return;u=PATH_START;continue}return INVALID_PORT}d+=s;break;case FILE:if(e.scheme="file","/"==s||"\\"==s)u=FILE_SLASH;else{if(!a||"file"!=a.scheme){u=PATH;continue}if(s==EOF)e.host=a.host,e.path=a.path.slice(),e.query=a.query;else if("?"==s)e.host=a.host,e.path=a.path.slice(),e.query="",u=QUERY;else{if("#"!=s){startsWithWindowsDriveLetter(i.slice(p).join(""))||(e.host=a.host,e.path=a.path.slice(),shortenURLsPath(e)),u=PATH;continue}e.host=a.host,e.path=a.path.slice(),e.query=a.query,e.fragment="",u=FRAGMENT}}break;case FILE_SLASH:if("/"==s||"\\"==s){u=FILE_HOST;break}a&&"file"==a.scheme&&!startsWithWindowsDriveLetter(i.slice(p).join(""))&&(isWindowsDriveLetter(a.path[0],!0)?e.path.push(a.path[0]):e.host=a.host),u=PATH;continue;case FILE_HOST:if(s==EOF||"/"==s||"\\"==s||"?"==s||"#"==s){if(!t&&isWindowsDriveLetter(d))u=PATH;else if(""==d){if(e.host="",t)return;u=PATH_START}else{if(l=parseHost(e,d))return l;if("localhost"==e.host&&(e.host=""),t)return;d="",u=PATH_START}continue}d+=s;break;case PATH_START:if(isSpecial(e)){if(u=PATH,"/"!=s&&"\\"!=s)continue}else if(t||"?"!=s)if(t||"#"!=s){if(s!=EOF&&(u=PATH,"/"!=s))continue}else e.fragment="",u=FRAGMENT;else e.query="",u=QUERY;break;case PATH:if(s==EOF||"/"==s||"\\"==s&&isSpecial(e)||!t&&("?"==s||"#"==s)){if(isDoubleDot(d)?(shortenURLsPath(e),"/"==s||"\\"==s&&isSpecial(e)||e.path.push("")):isSingleDot(d)?"/"==s||"\\"==s&&isSpecial(e)||e.path.push(""):("file"==e.scheme&&!e.path.length&&isWindowsDriveLetter(d)&&(e.host&&(e.host=""),d=d.charAt(0)+":"),e.path.push(d)),d="","file"==e.scheme&&(s==EOF||"?"==s||"#"==s))for(;e.path.length>1&&""===e.path[0];)e.path.shift();"?"==s?(e.query="",u=QUERY):"#"==s&&(e.fragment="",u=FRAGMENT)}else d+=percentEncode(s,pathPercentEncodeSet);break;case CANNOT_BE_A_BASE_URL_PATH:"?"==s?(e.query="",u=QUERY):"#"==s?(e.fragment="",u=FRAGMENT):s!=EOF&&(e.path[0]+=percentEncode(s,C0ControlPercentEncodeSet));break;case QUERY:t||"#"!=s?s!=EOF&&("'"==s&&isSpecial(e)?e.query+="%27":e.query+="#"==s?"%23":percentEncode(s,C0ControlPercentEncodeSet)):(e.fragment="",u=FRAGMENT);break;case FRAGMENT:s!=EOF&&(e.fragment+=percentEncode(s,fragmentPercentEncodeSet))}p++}},URLConstructor=function URL(e){var r,t,a=anInstance(this,URLConstructor,"URL"),i=arguments.length>1?arguments[1]:void 0,s=toString(e),c=setInternalState(a,{type:"URL"});if(void 0!==i)if(i instanceof URLConstructor)r=getInternalURLState(i);else if(t=parseURL(r={},toString(i)))throw TypeError(t);if(t=parseURL(c,s,null,r))throw TypeError(t);var l=c.searchParams=new URLSearchParams$1,u=getInternalSearchParamsState(l);u.updateSearchParams(c.query),u.updateURL=function(){c.query=String(l)||null},descriptors||(a.href=serializeURL.call(a),a.origin=getOrigin.call(a),a.protocol=getProtocol.call(a),a.username=getUsername.call(a),a.password=getPassword.call(a),a.host=getHost.call(a),a.hostname=getHostname.call(a),a.port=getPort.call(a),a.pathname=getPathname.call(a),a.search=getSearch.call(a),a.searchParams=getSearchParams.call(a),a.hash=getHash.call(a))},URLPrototype=URLConstructor.prototype,serializeURL=function(){var e=getInternalURLState(this),r=e.scheme,t=e.username,a=e.password,i=e.host,s=e.port,c=e.path,l=e.query,u=e.fragment,p=r+":";return null!==i?(p+="//",includesCredentials(e)&&(p+=t+(a?":"+a:"")+"@"),p+=serializeHost(i),null!==s&&(p+=":"+s)):"file"==r&&(p+="//"),p+=e.cannotBeABaseURL?c[0]:c.length?"/"+c.join("/"):"",null!==l&&(p+="?"+l),null!==u&&(p+="#"+u),p},getOrigin=function(){var e=getInternalURLState(this),r=e.scheme,t=e.port;if("blob"==r)try{return new URLConstructor(r.path[0]).origin}catch(e){return"null"}return"file"!=r&&isSpecial(e)?r+"://"+serializeHost(e.host)+(null!==t?":"+t:""):"null"},getProtocol=function(){return getInternalURLState(this).scheme+":"},getUsername=function(){return getInternalURLState(this).username},getPassword=function(){return getInternalURLState(this).password},getHost=function(){var e=getInternalURLState(this),r=e.host,t=e.port;return null===r?"":null===t?serializeHost(r):serializeHost(r)+":"+t},getHostname=function(){var e=getInternalURLState(this).host;return null===e?"":serializeHost(e)},getPort=function(){var e=getInternalURLState(this).port;return null===e?"":String(e)},getPathname=function(){var e=getInternalURLState(this),r=e.path;return e.cannotBeABaseURL?r[0]:r.length?"/"+r.join("/"):""},getSearch=function(){var e=getInternalURLState(this).query;return e?"?"+e:""},getSearchParams=function(){return getInternalURLState(this).searchParams},getHash=function(){var e=getInternalURLState(this).fragment;return e?"#"+e:""},accessorDescriptor=function(e,r){return{get:e,set:r,configurable:!0,enumerable:!0}};if(descriptors&&objectDefineProperties(URLPrototype,{href:accessorDescriptor(serializeURL,(function(e){var r=getInternalURLState(this),t=toString(e),a=parseURL(r,t);if(a)throw TypeError(a);getInternalSearchParamsState(r.searchParams).updateSearchParams(r.query)})),origin:accessorDescriptor(getOrigin),protocol:accessorDescriptor(getProtocol,(function(e){var r=getInternalURLState(this);parseURL(r,toString(e)+":",SCHEME_START)})),username:accessorDescriptor(getUsername,(function(e){var r=getInternalURLState(this),t=arrayFrom(toString(e));if(!cannotHaveUsernamePasswordPort(r)){r.username="";for(var a=0;a1?arguments[1]:void 0)};for(var COLLECTION_NAME in domIterables){var Collection=global$1[COLLECTION_NAME],CollectionPrototype=Collection&&Collection.prototype;if(CollectionPrototype&&CollectionPrototype.forEach!==arrayForEach)try{createNonEnumerableProperty(CollectionPrototype,"forEach",arrayForEach)}catch(e){CollectionPrototype.forEach=arrayForEach}}var propertyIsEnumerable=objectPropertyIsEnumerable.f,createMethod=function(e){return function(r){for(var t,a=toIndexedObject(r),i=objectKeys(a),s=i.length,c=0,l=[];s>c;)t=i[c++],descriptors&&!propertyIsEnumerable.call(a,t)||l.push(e?[t,a[t]]:a[t]);return l}},objectToArray={entries:createMethod(!0),values:createMethod(!1)},$entries=objectToArray.entries;_export({target:"Object",stat:!0},{entries:function entries(e){return $entries(e)}});var notARegexp=function(e){if(isRegexp(e))throw TypeError("The method doesn't accept regular expressions");return e},MATCH=wellKnownSymbol("match"),correctIsRegexpLogic=function(e){var r=/./;try{"/./"[e](r)}catch(t){try{return r[MATCH]=!1,"/./"[e](r)}catch(e){}}return!1},getOwnPropertyDescriptor=objectGetOwnPropertyDescriptor.f,$startsWith="".startsWith,min$1=Math.min,CORRECT_IS_REGEXP_LOGIC=correctIsRegexpLogic("startsWith"),MDN_POLYFILL_BUG=!(CORRECT_IS_REGEXP_LOGIC||(descriptor=getOwnPropertyDescriptor(String.prototype,"startsWith"),!descriptor||descriptor.writable)),descriptor;_export({target:"String",proto:!0,forced:!MDN_POLYFILL_BUG&&!CORRECT_IS_REGEXP_LOGIC},{startsWith:function startsWith(e){var r=toString(requireObjectCoercible(this));notARegexp(e);var t=toLength(min$1(arguments.length>1?arguments[1]:void 0,r.length)),a=toString(e);return $startsWith?$startsWith.call(r,a,t):r.slice(t,t+a.length)===a}});var floor=Math.floor,replace="".replace,SUBSTITUTION_SYMBOLS=/\$([$&'`]|\d{1,2}|<[^>]*>)/g,SUBSTITUTION_SYMBOLS_NO_NAMED=/\$([$&'`]|\d{1,2})/g,getSubstitution=function(e,r,t,a,i,s){var c=t+e.length,l=a.length,u=SUBSTITUTION_SYMBOLS_NO_NAMED;return void 0!==i&&(i=toObject(i),u=SUBSTITUTION_SYMBOLS),replace.call(s,u,(function(s,u){var p;switch(u.charAt(0)){case"$":return"$";case"&":return e;case"`":return r.slice(0,t);case"'":return r.slice(c);case"<":p=i[u.slice(1,-1)];break;default:var d=+u;if(0===d)return s;if(d>l){var y=floor(d/10);return 0===y?s:y<=l?void 0===a[y-1]?u.charAt(1):a[y-1]+u.charAt(1):s}p=a[d-1]}return void 0===p?"":p}))},REPLACE=wellKnownSymbol("replace"),max=Math.max,min=Math.min,maybeToString=function(e){return void 0===e?e:String(e)},REPLACE_KEEPS_$0="$0"==="a".replace(/./,"$0"),REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE=!!/./[REPLACE]&&""===/./[REPLACE]("a","$0"),REPLACE_SUPPORTS_NAMED_GROUPS=!fails((function(){var e=/./;return e.exec=function(){var e=[];return e.groups={a:"7"},e},"7"!=="".replace(e,"$")}));fixRegexpWellKnownSymbolLogic("replace",(function(e,r,t){var a=REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE?"$":"$0";return[function replace(e,t){var a=requireObjectCoercible(this),i=null==e?void 0:e[REPLACE];return void 0!==i?i.call(e,a,t):r.call(toString(a),e,t)},function(e,i){var s=anObject(this),c=toString(e);if("string"==typeof i&&-1===i.indexOf(a)&&-1===i.indexOf("$<")){var l=t(r,s,c,i);if(l.done)return l.value}var u="function"==typeof i;u||(i=toString(i));var p=s.global;if(p){var d=s.unicode;s.lastIndex=0}for(var y=[];;){var h=regexpExecAbstract(s,c);if(null===h)break;if(y.push(h),!p)break;""===toString(h[0])&&(s.lastIndex=advanceStringIndex(c,toLength(s.lastIndex),d))}for(var A="",g=0,v=0;v=g&&(A+=c.slice(g,E)+S,g=E+m.length)}return A+c.slice(g)}]}),!REPLACE_SUPPORTS_NAMED_GROUPS||!REPLACE_KEEPS_$0||REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE);var IS_CONCAT_SPREADABLE=wellKnownSymbol("isConcatSpreadable"),MAX_SAFE_INTEGER=9007199254740991,MAXIMUM_ALLOWED_INDEX_EXCEEDED="Maximum allowed index exceeded",IS_CONCAT_SPREADABLE_SUPPORT=engineV8Version>=51||!fails((function(){var e=[];return e[IS_CONCAT_SPREADABLE]=!1,e.concat()[0]!==e})),SPECIES_SUPPORT=arrayMethodHasSpeciesSupport("concat"),isConcatSpreadable=function(e){if(!isObject(e))return!1;var r=e[IS_CONCAT_SPREADABLE];return void 0!==r?!!r:isArray(e)},FORCED=!IS_CONCAT_SPREADABLE_SUPPORT||!SPECIES_SUPPORT;_export({target:"Array",proto:!0,forced:FORCED},{concat:function concat(e){var r,t,a,i,s,c=toObject(this),l=arraySpeciesCreate(c,0),u=0;for(r=-1,a=arguments.length;rMAX_SAFE_INTEGER)throw TypeError(MAXIMUM_ALLOWED_INDEX_EXCEEDED);for(t=0;t=MAX_SAFE_INTEGER)throw TypeError(MAXIMUM_ALLOWED_INDEX_EXCEEDED);createProperty(l,u++,s)}return l.length=u,l}});var cnt=0,imageCompressionLibUrl,worker;function createWorker(e){return"function"==typeof e&&(e="(".concat(e,")()")),new Worker(URL.createObjectURL(new Blob([e])))}function createSourceObject(e){return URL.createObjectURL(new Blob([e],{type:"application/javascript"}))}function stringify(e){return JSON.stringify(e,(function(e,r){return"function"==typeof r?"BIC_FN:::(function () { return ".concat(r.toString()," })()"):r}))}function parse(o){if("string"==typeof o)return o;var result={};return Object.entries(o).forEach((function(_ref){var _ref2=_slicedToArray(_ref,2),key=_ref2[0],value=_ref2[1];if("string"==typeof value&&value.startsWith("BIC_FN:::"))try{result[key]=eval(value.replace(/^BIC_FN:::/,""))}catch(e){throw e}else result[key]=parse(value)})),result}function generateLib(){return createSourceObject("\n // reconstruct library\n function imageCompression (){return (".concat(imageCompression,").apply(null, arguments)}\n\n imageCompression.getDataUrlFromFile = ").concat(imageCompression.getDataUrlFromFile,"\n imageCompression.getFilefromDataUrl = ").concat(imageCompression.getFilefromDataUrl,"\n imageCompression.loadImage = ").concat(imageCompression.loadImage,"\n imageCompression.drawImageInCanvas = ").concat(imageCompression.drawImageInCanvas,"\n imageCompression.drawFileInCanvas = ").concat(imageCompression.drawFileInCanvas,"\n imageCompression.canvasToFile = ").concat(imageCompression.canvasToFile,"\n imageCompression.getExifOrientation = ").concat(imageCompression.getExifOrientation,"\n imageCompression.handleMaxWidthOrHeight = ").concat(imageCompression.handleMaxWidthOrHeight,"\n imageCompression.followExifOrientation = ").concat(imageCompression.followExifOrientation,"\n imageCompression.cleanupCanvasMemory = ").concat(imageCompression.cleanupCanvasMemory,"\n imageCompression.isAutoOrientationInBrowser = ").concat(imageCompression.isAutoOrientationInBrowser,"\n imageCompression.approximateBelowMaximumCanvasSizeOfBrowser = ").concat(imageCompression.approximateBelowMaximumCanvasSizeOfBrowser,"\n imageCompression.getBrowserName = ").concat(imageCompression.getBrowserName,"\n\n // functions / objects\n getDataUrlFromFile = imageCompression.getDataUrlFromFile\n getFilefromDataUrl = imageCompression.getFilefromDataUrl\n loadImage = imageCompression.loadImage\n drawImageInCanvas = imageCompression.drawImageInCanvas\n drawFileInCanvas = imageCompression.drawFileInCanvas\n canvasToFile = imageCompression.canvasToFile\n getExifOrientation = imageCompression.getExifOrientation\n handleMaxWidthOrHeight = imageCompression.handleMaxWidthOrHeight\n followExifOrientation = imageCompression.followExifOrientation\n cleanupCanvasMemory = imageCompression.cleanupCanvasMemory\n isAutoOrientationInBrowser = imageCompression.isAutoOrientationInBrowser\n approximateBelowMaximumCanvasSizeOfBrowser = imageCompression.approximateBelowMaximumCanvasSizeOfBrowser\n getBrowserName = imageCompression.getBrowserName\n \n getNewCanvasAndCtx = ").concat(getNewCanvasAndCtx,"\n CustomFileReader = FileReader\n CustomFile = File\n MaxCanvasSize = ").concat(JSON.stringify(MaxCanvasSize),"\n function compress (){return (").concat(compress,").apply(null, arguments)}\n\n // core-js\n function _slicedToArray(arr, n) { return arr }\n function _typeof(a) { return typeof a }\n function _objectSpread2(target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i] != null ? arguments[i] : {};\n \n Object.assign(target, source)\n }\n \n return target;\n }\n\n // Libraries\n const parse = ").concat(parse,"\n const UPNG = {}\n UPNG.toRGBA8 = ").concat(UPNG.toRGBA8,"\n UPNG.toRGBA8.decodeImage = ").concat(UPNG.toRGBA8.decodeImage,"\n UPNG.decode = ").concat(UPNG.decode,"\n UPNG.decode._decompress = ").concat(UPNG.decode._decompress,"\n UPNG.decode._inflate = ").concat(UPNG.decode._inflate,"\n UPNG.decode._readInterlace = ").concat(UPNG.decode._readInterlace,"\n UPNG.decode._getBPP = ").concat(UPNG.decode._getBPP," \n UPNG.decode._filterZero = ").concat(UPNG.decode._filterZero,"\n UPNG.decode._paeth = ").concat(UPNG.decode._paeth,"\n UPNG.decode._IHDR = ").concat(UPNG.decode._IHDR,"\n UPNG._bin = parse(").concat(stringify(UPNG._bin),")\n UPNG._copyTile = ").concat(UPNG._copyTile,"\n UPNG.encode = ").concat(UPNG.encode,"\n UPNG.encodeLL = ").concat(UPNG.encodeLL," \n UPNG.encode._main = ").concat(UPNG.encode._main,"\n UPNG.encode.compressPNG = ").concat(UPNG.encode.compressPNG," \n UPNG.encode.compress = ").concat(UPNG.encode.compress,"\n UPNG.encode.framize = ").concat(UPNG.encode.framize," \n UPNG.encode._updateFrame = ").concat(UPNG.encode._updateFrame," \n UPNG.encode._prepareDiff = ").concat(UPNG.encode._prepareDiff," \n UPNG.encode._filterZero = ").concat(UPNG.encode._filterZero," \n UPNG.encode._filterLine = ").concat(UPNG.encode._filterLine,"\n UPNG.encode.concatRGBA = ").concat(UPNG.encode.concatRGBA,"\n UPNG.crc = parse(").concat(stringify(UPNG.crc),")\n UPNG.crc.table = ( function() {\n var tab = new Uint32Array(256);\n for (var n=0; n<256; n++) {\n var c = n;\n for (var k=0; k<8; k++) {\n if (c & 1) c = 0xedb88320 ^ (c >>> 1);\n else c = c >>> 1;\n }\n tab[n] = c; }\n return tab; })()\n UPNG.quantize = ").concat(UPNG.quantize," \n UPNG.quantize.getKDtree = ").concat(UPNG.quantize.getKDtree," \n UPNG.quantize.getNearest = ").concat(UPNG.quantize.getNearest," \n UPNG.quantize.planeDst = ").concat(UPNG.quantize.planeDst," \n UPNG.quantize.dist = ").concat(UPNG.quantize.dist," \n UPNG.quantize.splitPixels = ").concat(UPNG.quantize.splitPixels," \n UPNG.quantize.vecDot = ").concat(UPNG.quantize.vecDot," \n UPNG.quantize.stats = ").concat(UPNG.quantize.stats," \n UPNG.quantize.estats = ").concat(UPNG.quantize.estats,"\n UPNG.M4 = parse(").concat(stringify(UPNG.M4),")\n UPNG.encode.concatRGBA = ").concat(UPNG.encode.concatRGBA,'\n UPNG.inflateRaw=function(){\n var H={};H.H={};H.H.N=function(N,W){var R=Uint8Array,i=0,m=0,J=0,h=0,Q=0,X=0,u=0,w=0,d=0,v,C;\n if(N[0]==3&&N[1]==0)return W?W:new R(0);var V=H.H,n=V.b,A=V.e,l=V.R,M=V.n,I=V.A,e=V.Z,b=V.m,Z=W==null;\n if(Z)W=new R(N.length>>>2<<5);while(i==0){i=n(N,d,1);m=n(N,d+1,2);d+=3;if(m==0){if((d&7)!=0)d+=8-(d&7);\n var D=(d>>>3)+4,q=N[D-4]|N[D-3]<<8;if(Z)W=H.H.W(W,w+q);W.set(new R(N.buffer,N.byteOffset+D,q),w);d=D+q<<3;\n w+=q;continue}if(Z)W=H.H.W(W,w+(1<<17));if(m==1){v=b.J;C=b.h;X=(1<<9)-1;u=(1<<5)-1}if(m==2){J=A(N,d,5)+257;\n h=A(N,d+5,5)+1;Q=A(N,d+10,4)+4;d+=14;var E=d,j=1;for(var c=0;c<38;c+=2){b.Q[c]=0;b.Q[c+1]=0}for(var c=0;\n cj)j=K}d+=3*Q;M(b.Q,j);I(b.Q,j,b.u);v=b.w;C=b.d;\n d=l(b.u,(1<>>4;if(p>>>8==0){W[w++]=p}else if(p==256){break}else{var z=w+p-254;\n if(p>264){var _=b.q[p-257];z=w+(_>>>3)+A(N,d,_&7);d+=_&7}var $=C[e(N,d)&u];d+=$&15;var s=$>>>4,Y=b.c[s],a=(Y>>>4)+n(N,d,Y&15);\n d+=Y&15;while(w>>4;\n if(b<=15){A[I]=b;I++}else{var Z=0,m=0;if(b==16){m=3+l(V,n,2);n+=2;Z=A[I-1]}else if(b==17){m=3+l(V,n,3);\n n+=3}else if(b==18){m=11+l(V,n,7);n+=7}var J=I+m;while(I>>1;\n while(An)n=M;A++}while(A>1,I=N[l+1],e=M<<4|I,b=W-I,Z=N[l]<>>15-W;R[J]=e;Z++}}};H.H.l=function(N,W){var R=H.H.m.r,V=15-W;for(var n=0;n>>V}};H.H.M=function(N,W,R){R=R<<(W&7);var V=W>>>3;N[V]|=R;N[V+1]|=R>>>8};\n H.H.I=function(N,W,R){R=R<<(W&7);var V=W>>>3;N[V]|=R;N[V+1]|=R>>>8;N[V+2]|=R>>>16};H.H.e=function(N,W,R){return(N[W>>>3]|N[(W>>>3)+1]<<8)>>>(W&7)&(1<>>3]|N[(W>>>3)+1]<<8|N[(W>>>3)+2]<<16)>>>(W&7)&(1<>>3]|N[(W>>>3)+1]<<8|N[(W>>>3)+2]<<16)>>>(W&7)};\n H.H.i=function(N,W){return(N[W>>>3]|N[(W>>>3)+1]<<8|N[(W>>>3)+2]<<16|N[(W>>>3)+3]<<24)>>>(W&7)};H.H.m=function(){var N=Uint16Array,W=Uint32Array;\n return{K:new N(16),j:new N(16),X:[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],S:[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,999,999,999],T:[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0],q:new N(32),p:[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,65535,65535],z:[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0],c:new W(32),J:new N(512),_:[],h:new N(32),$:[],w:new N(32768),C:[],v:[],d:new N(32768),D:[],u:new N(512),Q:[],r:new N(1<<15),s:new W(286),Y:new W(30),a:new W(19),t:new W(15e3),k:new N(1<<16),g:new N(1<<15)}}();\n (function(){var N=H.H.m,W=1<<15;for(var R=0;R>>1|(V&1431655765)<<1;\n V=(V&3435973836)>>>2|(V&858993459)<<2;V=(V&4042322160)>>>4|(V&252645135)<<4;V=(V&4278255360)>>>8|(V&16711935)<<8;\n N.r[R]=(V>>>16|V<<16)>>>17}function n(A,l,M){while(l--!=0)A.push(0,M)}for(var R=0;R<32;R++){N.q[R]=N.S[R]<<3|N.T[R];\n N.c[R]=N.p[R]<<4|N.z[R]}n(N._,144,8);n(N._,255-143,9);n(N._,279-255,7);n(N._,287-279,8);H.H.n(N._,9);\n H.H.A(N._,9,N.J);H.H.l(N._,9);n(N.$,32,5);H.H.n(N.$,5);H.H.A(N.$,5,N.h);H.H.l(N.$,5);n(N.Q,19,0);n(N.C,286,0);\n n(N.D,30,0);n(N.v,320,0)}());return H.H.N}()\n \n const UZIP = {}\n UZIP["parse"] = ').concat(UZIP_1.parse,"\n UZIP._readLocal = ").concat(UZIP_1._readLocal,"\n UZIP.inflateRaw = ").concat(UZIP_1.inflateRaw,"\n UZIP.inflate = ").concat(UZIP_1.inflate,"\n UZIP.deflate = ").concat(UZIP_1.deflate,"\n UZIP.deflateRaw = ").concat(UZIP_1.deflateRaw,"\n UZIP.encode = ").concat(UZIP_1.encode,"\n UZIP._noNeed = ").concat(UZIP_1._noNeed,"\n UZIP._writeHeader = ").concat(UZIP_1._writeHeader,"\n UZIP.crc = parse(").concat(stringify(UZIP_1.crc),")\n UZIP.crc.table = ( function() {\n var tab = new Uint32Array(256);\n for (var n=0; n<256; n++) {\n var c = n;\n for (var k=0; k<8; k++) {\n if (c & 1) c = 0xedb88320 ^ (c >>> 1);\n else c = c >>> 1;\n }\n tab[n] = c; }\n return tab; })()\n \n UZIP.adler = ").concat(UZIP_1.adler,"\n UZIP.bin = parse(").concat(stringify(UZIP_1.bin),")\n UZIP.F = {}\n UZIP.F.deflateRaw = ").concat(UZIP_1.F.deflateRaw,"\n UZIP.F._bestMatch = ").concat(UZIP_1.F._bestMatch,"\n UZIP.F._howLong = ").concat(UZIP_1.F._howLong,"\n UZIP.F._hash = ").concat(UZIP_1.F._hash,"\n UZIP.saved = ").concat(UZIP_1.saved,"\n UZIP.F._writeBlock = ").concat(UZIP_1.F._writeBlock,"\n UZIP.F._copyExact = ").concat(UZIP_1.F._copyExact,"\n UZIP.F.getTrees = ").concat(UZIP_1.F.getTrees,"\n UZIP.F.getSecond = ").concat(UZIP_1.F.getSecond,"\n UZIP.F.nonZero = ").concat(UZIP_1.F.nonZero,"\n UZIP.F.contSize = ").concat(UZIP_1.F.contSize,"\n UZIP.F._codeTiny = ").concat(UZIP_1.F._codeTiny," \n UZIP.F._lenCodes = ").concat(UZIP_1.F._lenCodes," \n UZIP.F._hufTree = ").concat(UZIP_1.F._hufTree," \n UZIP.F.setDepth = ").concat(UZIP_1.F.setDepth," \n UZIP.F.restrictDepth = ").concat(UZIP_1.F.restrictDepth,"\n UZIP.F._goodIndex = ").concat(UZIP_1.F._goodIndex," \n UZIP.F._writeLit = ").concat(UZIP_1.F._writeLit," \n UZIP.F.inflate = ").concat(UZIP_1.F.inflate," \n UZIP.F._check = ").concat(UZIP_1.F._check," \n UZIP.F._decodeTiny = ").concat(UZIP_1.F._decodeTiny," \n UZIP.F._copyOut = ").concat(UZIP_1.F._copyOut," \n UZIP.F.makeCodes = ").concat(UZIP_1.F.makeCodes," \n UZIP.F.codes2map = ").concat(UZIP_1.F.codes2map," \n UZIP.F.revCodes = ").concat(UZIP_1.F.revCodes," \n\n // used only in deflate\n UZIP.F._putsE = ").concat(UZIP_1.F._putsE,"\n UZIP.F._putsF = ").concat(UZIP_1.F._putsF,"\n \n UZIP.F._bitsE = ").concat(UZIP_1.F._bitsE,"\n UZIP.F._bitsF = ").concat(UZIP_1.F._bitsF,"\n\n UZIP.F._get17 = ").concat(UZIP_1.F._get17,"\n UZIP.F._get25 = ").concat(UZIP_1.F._get25,"\n UZIP.F.U = function(){\n var u16=Uint16Array, u32=Uint32Array;\n return {\n next_code : new u16(16),\n bl_count : new u16(16),\n ordr : [ 16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15 ],\n of0 : [3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,999,999,999],\n exb : [0,0,0,0,0,0,0, 0, 1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3, 4, 4, 4, 4, 5, 5, 5, 5, 0, 0, 0, 0],\n ldef : new u16(32),\n df0 : [1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577, 65535, 65535],\n dxb : [0,0,0,0,1,1,2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8, 9, 9, 10, 10, 11, 11, 12, 12, 13, 13, 0, 0],\n ddef : new u32(32),\n flmap: new u16( 512), fltree: [],\n fdmap: new u16( 32), fdtree: [],\n lmap : new u16(32768), ltree : [], ttree:[],\n dmap : new u16(32768), dtree : [],\n imap : new u16( 512), itree : [],\n //rev9 : new u16( 512)\n rev15: new u16(1<<15),\n lhst : new u32(286), dhst : new u32( 30), ihst : new u32(19),\n lits : new u32(15000),\n strt : new u16(1<<16),\n prev : new u16(1<<15)\n };\n } ();\n\n (function(){\n var U = UZIP.F.U;\n var len = 1<<15;\n for(var i=0; i>> 1) | ((x & 0x55555555) << 1));\n x = (((x & 0xcccccccc) >>> 2) | ((x & 0x33333333) << 2));\n x = (((x & 0xf0f0f0f0) >>> 4) | ((x & 0x0f0f0f0f) << 4));\n x = (((x & 0xff00ff00) >>> 8) | ((x & 0x00ff00ff) << 8));\n U.rev15[i] = (((x >>> 16) | (x << 16)))>>>17;\n }\n \n function pushV(tgt, n, sv) { while(n--!=0) tgt.push(0,sv); }\n \n for(var i=0; i<32; i++) { U.ldef[i]=(U.of0[i]<<3)|U.exb[i]; U.ddef[i]=(U.df0[i]<<4)|U.dxb[i]; }\n \n pushV(U.fltree, 144, 8); pushV(U.fltree, 255-143, 9); pushV(U.fltree, 279-255, 7); pushV(U.fltree,287-279,8);\n /*\n var i = 0;\n for(; i<=143; i++) U.fltree.push(0,8);\n for(; i<=255; i++) U.fltree.push(0,9);\n for(; i<=279; i++) U.fltree.push(0,7);\n for(; i<=287; i++) U.fltree.push(0,8);\n */\n UZIP.F.makeCodes(U.fltree, 9);\n UZIP.F.codes2map(U.fltree, 9, U.flmap);\n UZIP.F.revCodes (U.fltree, 9)\n \n pushV(U.fdtree,32,5);\n //for(i=0;i<32; i++) U.fdtree.push(0,5);\n UZIP.F.makeCodes(U.fdtree, 5);\n UZIP.F.codes2map(U.fdtree, 5, U.fdmap);\n UZIP.F.revCodes (U.fdtree, 5)\n \n pushV(U.itree,19,0); pushV(U.ltree,286,0); pushV(U.dtree,30,0); pushV(U.ttree,320,0);\n /*\n for(var i=0; i< 19; i++) U.itree.push(0,0);\n for(var i=0; i<286; i++) U.ltree.push(0,0);\n for(var i=0; i< 30; i++) U.dtree.push(0,0);\n for(var i=0; i<320; i++) U.ttree.push(0,0);\n */\n })()\n "))}function generateWorkerScript(){return createWorker("\n let scriptImported = false\n self.addEventListener('message', async (e) => {\n const { file, id, imageCompressionLibUrl, options } = e.data\n options.onProgress = (progress) => self.postMessage({ progress, id })\n try {\n if (!scriptImported) {\n // console.log('[worker] importScripts', imageCompressionLibUrl)\n self.importScripts(imageCompressionLibUrl)\n scriptImported = true\n }\n // console.log('[worker] self', self)\n const compressedFile = await imageCompression(file, options)\n self.postMessage({ file: compressedFile, id })\n } catch (e) {\n // console.error('[worker] error', e)\n self.postMessage({ error: e.message + '\\n' + e.stack, id })\n }\n })\n ")}function compressOnWebWorker(e,r){return new Promise((function(t,a){return new Promise((function(i,s){var c=cnt++;return imageCompressionLibUrl||(imageCompressionLibUrl=generateLib()),worker||(worker=generateWorkerScript()),worker.addEventListener("message",(function handler(e){if(e.data.id===c){if(void 0!==e.data.progress)return void r.onProgress(e.data.progress);worker.removeEventListener("message",handler),e.data.error&&a(new Error(e.data.error)),t(e.data.file)}})),worker.addEventListener("error",a),worker.postMessage({file:e,id:c,imageCompressionLibUrl:imageCompressionLibUrl,options:_objectSpread2(_objectSpread2({},r),{},{onProgress:void 0})}),i()}))}))}function imageCompression(e,r){return new Promise((function(t,a){var i,s,c,l,u,p;if(i=_objectSpread2({},r),c=0,l=i.onProgress,i.maxSizeMB=i.maxSizeMB||Number.POSITIVE_INFINITY,u="boolean"!=typeof i.useWebWorker||i.useWebWorker,delete i.useWebWorker,i.onProgress=function(e){c=e,"function"==typeof l&&l(c)},!(e instanceof Blob||e instanceof CustomFile))return a(new Error("The file given is not an instance of Blob or File"));if(!/^image/.test(e.type))return a(new Error("The file given is not an image"));if(p="undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope,!u||"function"!=typeof Worker||p)return compress(e,i).then(function(e){try{return s=e,$If_3.call(this)}catch(e){return a(e)}}.bind(this),a);var d=function(){try{return $If_3.call(this)}catch(e){return a(e)}}.bind(this),y=function $Try_1_Catch(r){try{return compress(e,i).then((function(e){try{return s=e,d()}catch(e){return a(e)}}),a)}catch(e){return a(e)}};try{return compressOnWebWorker(e,i).then((function(e){try{return s=e,d()}catch(e){return y()}}),y)}catch(e){y()}function $If_3(){try{s.name=e.name,s.lastModified=e.lastModified}catch(e){}return t(s)}}))}return imageCompression.getDataUrlFromFile=getDataUrlFromFile,imageCompression.getFilefromDataUrl=getFilefromDataUrl,imageCompression.loadImage=loadImage,imageCompression.drawImageInCanvas=drawImageInCanvas,imageCompression.drawFileInCanvas=drawFileInCanvas,imageCompression.canvasToFile=canvasToFile,imageCompression.getExifOrientation=getExifOrientation,imageCompression.handleMaxWidthOrHeight=handleMaxWidthOrHeight,imageCompression.followExifOrientation=followExifOrientation,imageCompression.cleanupCanvasMemory=cleanupCanvasMemory,imageCompression.isAutoOrientationInBrowser=isAutoOrientationInBrowser,imageCompression.approximateBelowMaximumCanvasSizeOfBrowser=approximateBelowMaximumCanvasSizeOfBrowser,imageCompression.getBrowserName=getBrowserName,imageCompression.version="1.0.15",imageCompression})); //# sourceMappingURL=browser-image-compression.js.map diff --git a/dist/browser-image-compression.js.map b/dist/browser-image-compression.js.map index f138778..6ed8500 100644 --- a/dist/browser-image-compression.js.map +++ b/dist/browser-image-compression.js.map @@ -1 +1 @@ -{"version":3,"file":"browser-image-compression.js","sources":["../node_modules/uzip/UZIP.js","../lib/UPNG.js","../lib/utils.js","../lib/image-compression.js","../lib/web-worker.js","../lib/index.js"],"sourcesContent":["\r\n\r\nvar UZIP = {};\r\nif(typeof module == \"object\") module.exports = UZIP;\r\n\r\n\r\nUZIP[\"parse\"] = function(buf, onlyNames)\t// ArrayBuffer\r\n{\r\n\tvar rUs = UZIP.bin.readUshort, rUi = UZIP.bin.readUint, o = 0, out = {};\r\n\tvar data = new Uint8Array(buf);\r\n\tvar eocd = data.length-4;\r\n\t\r\n\twhile(rUi(data, eocd)!=0x06054b50) eocd--;\r\n\t\r\n\tvar o = eocd;\r\n\to+=4;\t// sign = 0x06054b50\r\n\to+=4; // disks = 0;\r\n\tvar cnu = rUs(data, o); o+=2;\r\n\tvar cnt = rUs(data, o); o+=2;\r\n\t\t\t\r\n\tvar csize = rUi(data, o); o+=4;\r\n\tvar coffs = rUi(data, o); o+=4;\r\n\t\r\n\to = coffs;\r\n\tfor(var i=0; i8514000) {\r\n\t\t\t//console.log(PUtils.readASCII(buf , 8514500, 500));\r\n\t\t\t//console.log(PUtils.readASCII(nbuf, 8514500, 500));\r\n\t\t}\r\n\t\tfor(var i=0; i>>4);\r\n\t//console.log(CM, CINFO,CMF,FLG);\r\n\treturn UZIP.inflateRaw(new Uint8Array(file.buffer, file.byteOffset+2, file.length-6), buf); \r\n}\r\nUZIP.deflate = function(data, opts/*, buf, off*/) {\r\n\tif(opts==null) opts={level:6};\r\n\tvar off=0, buf=new Uint8Array(50+Math.floor(data.length*1.1));\r\n\tbuf[off]=120; buf[off+1]=156; off+=2;\r\n\toff = UZIP.F.deflateRaw(data, buf, off, opts.level);\r\n\tvar crc = UZIP.adler(data, 0, data.length);\r\n\tbuf[off+0]=((crc>>>24)&255); \r\n\tbuf[off+1]=((crc>>>16)&255); \r\n\tbuf[off+2]=((crc>>> 8)&255); \r\n\tbuf[off+3]=((crc>>> 0)&255); \t\r\n\treturn new Uint8Array(buf.buffer, 0, off+4);\r\n}\r\nUZIP.deflateRaw = function(data, opts) {\r\n\tif(opts==null) opts={level:6};\r\n\tvar buf=new Uint8Array(50+Math.floor(data.length*1.1));\r\n\tvar off = UZIP.F.deflateRaw(data, buf, off, opts.level);\r\n\treturn new Uint8Array(buf.buffer, 0, off);\r\n}\r\n\r\n\r\nUZIP.encode = function(obj, noCmpr) {\r\n\tif(noCmpr==null) noCmpr=false;\r\n\tvar tot = 0, wUi = UZIP.bin.writeUint, wUs = UZIP.bin.writeUshort;\r\n\tvar zpd = {};\r\n\tfor(var p in obj) { var cpr = !UZIP._noNeed(p) && !noCmpr, buf = obj[p], crc = UZIP.crc.crc(buf,0,buf.length); \r\n\t\tzpd[p] = { cpr:cpr, usize:buf.length, crc:crc, file: (cpr ? UZIP.deflateRaw(buf) : buf) }; }\r\n\t\r\n\tfor(var p in zpd) tot += zpd[p].file.length + 30 + 46 + 2*UZIP.bin.sizeUTF8(p);\r\n\ttot += 22;\r\n\t\r\n\tvar data = new Uint8Array(tot), o = 0;\r\n\tvar fof = []\r\n\t\r\n\tfor(var p in zpd) {\r\n\t\tvar file = zpd[p]; fof.push(o);\r\n\t\to = UZIP._writeHeader(data, o, p, file, 0);\r\n\t}\r\n\tvar i=0, ioff = o;\r\n\tfor(var p in zpd) {\r\n\t\tvar file = zpd[p]; fof.push(o);\r\n\t\to = UZIP._writeHeader(data, o, p, file, 1, fof[i++]);\t\t\r\n\t}\r\n\tvar csize = o-ioff;\r\n\t\r\n\twUi(data, o, 0x06054b50); o+=4;\r\n\to += 4; // disks\r\n\twUs(data, o, i); o += 2;\r\n\twUs(data, o, i); o += 2;\t// number of c d records\r\n\twUi(data, o, csize); o += 4;\r\n\twUi(data, o, ioff ); o += 4;\r\n\to += 2;\r\n\treturn data.buffer;\r\n}\r\n// no need to compress .PNG, .ZIP, .JPEG ....\r\nUZIP._noNeed = function(fn) { var ext = fn.split(\".\").pop().toLowerCase(); return \"png,jpg,jpeg,zip\".indexOf(ext)!=-1; }\r\n\r\nUZIP._writeHeader = function(data, o, p, obj, t, roff)\r\n{\r\n\tvar wUi = UZIP.bin.writeUint, wUs = UZIP.bin.writeUshort;\r\n\tvar file = obj.file;\r\n\t\r\n\twUi(data, o, t==0 ? 0x04034b50 : 0x02014b50); o+=4; // sign\r\n\tif(t==1) o+=2; // ver made by\r\n\twUs(data, o, 20); o+=2;\t// ver\r\n\twUs(data, o, 0); o+=2; // gflip\r\n\twUs(data, o, obj.cpr?8:0); o+=2;\t// cmpr\r\n\t\t\r\n\twUi(data, o, 0); o+=4;\t// time\t\t\r\n\twUi(data, o, obj.crc); o+=4;\t// crc32\r\n\twUi(data, o, file.length); o+=4;\t// csize\r\n\twUi(data, o, obj.usize); o+=4;\t// usize\r\n\t\t\r\n\twUs(data, o, UZIP.bin.sizeUTF8(p)); o+=2;\t// nlen\r\n\twUs(data, o, 0); o+=2;\t// elen\r\n\t\r\n\tif(t==1) {\r\n\t\to += 2; // comment length\r\n\t\to += 2; // disk number\r\n\t\to += 6; // attributes\r\n\t\twUi(data, o, roff); o+=4;\t// usize\r\n\t}\r\n\tvar nlen = UZIP.bin.writeUTF8(data, o, p); o+= nlen;\t\r\n\tif(t==0) { data.set(file, o); o += file.length; }\r\n\treturn o;\r\n}\r\n\r\n\r\n\r\n\r\n\r\nUZIP.crc = {\r\n\ttable : ( function() {\r\n\t var tab = new Uint32Array(256);\r\n\t for (var n=0; n<256; n++) {\r\n\t\t\tvar c = n;\r\n\t\t\tfor (var k=0; k<8; k++) {\r\n\t\t\t\tif (c & 1) c = 0xedb88320 ^ (c >>> 1);\r\n\t\t\t\telse c = c >>> 1;\r\n\t\t\t}\r\n\t\t\ttab[n] = c; } \r\n\t\treturn tab; })(),\r\n\tupdate : function(c, buf, off, len) {\r\n\t\tfor (var i=0; i>> 8);\r\n\t\treturn c;\r\n\t},\r\n\tcrc : function(b,o,l) { return UZIP.crc.update(0xffffffff,b,o,l) ^ 0xffffffff; }\r\n}\r\nUZIP.adler = function(data,o,len) {\r\n\tvar a = 1, b = 0;\r\n\tvar off = o, end=o+len;\r\n\twhile(off>8)&255; },\r\n\treadUint : function(buff,p) { return (buff[p+3]*(256*256*256)) + ((buff[p+2]<<16) | (buff[p+1]<< 8) | buff[p]); },\r\n\twriteUint : function(buff,p,n){ buff[p]=n&255; buff[p+1]=(n>>8)&255; buff[p+2]=(n>>16)&255; buff[p+3]=(n>>24)&255; },\r\n\treadASCII : function(buff,p,l){ var s = \"\"; for(var i=0; i> 6)); buff[p+i+1] = (128|((code>> 0)&63)); i+=2; }\r\n\t\t\telse if((code&(0xffffffff-(1<<16)+1))==0) { buff[p+i] = (224|(code>>12)); buff[p+i+1] = (128|((code>> 6)&63)); buff[p+i+2] = (128|((code>>0)&63)); i+=3; }\r\n\t\t\telse if((code&(0xffffffff-(1<<21)+1))==0) { buff[p+i] = (240|(code>>18)); buff[p+i+1] = (128|((code>>12)&63)); buff[p+i+2] = (128|((code>>6)&63)); buff[p+i+3] = (128|((code>>0)&63)); i+=4; }\r\n\t\t\telse throw \"e\";\r\n\t\t}\r\n\t\treturn i;\r\n\t},\r\n\tsizeUTF8 : function(str) {\r\n\t\tvar strl = str.length, i=0;\r\n\t\tfor(var ci=0; ci>>3;\r\n\t}\r\n\r\n\tvar lits = U.lits, strt=U.strt, prev=U.prev, li=0, lc=0, bs=0, ebits=0, c=0, nc=0; // last_item, literal_count, block_start\r\n\tif(dlen>2) { nc=UZIP.F._hash(data,0); strt[nc]=0; }\r\n\tvar nmch=0,nmci=0;\r\n\t\r\n\tfor(i=0; i14000 || lc>26697) && (dlen-i)>100) {\r\n\t\t\t\tif(cvrd>>16)>>16)>(mch>>>16)) mch=0;\r\n\t\t\t}//*/\r\n\t\t\tvar len = mch>>>16, dst = mch&0xffff; //if(i-dst<0) throw \"e\";\r\n\t\t\tif(mch!=0) { \r\n\t\t\t\tvar len = mch>>>16, dst = mch&0xffff; //if(i-dst<0) throw \"e\";\r\n\t\t\t\tvar lgi = goodIndex(len, U.of0); U.lhst[257+lgi]++; \r\n\t\t\t\tvar dgi = goodIndex(dst, U.df0); U.dhst[ dgi]++; ebits += U.exb[lgi] + U.dxb[dgi]; \r\n\t\t\t\tlits[li] = (len<<23)|(i-cvrd); lits[li+1] = (dst<<16)|(lgi<<8)|dgi; li+=2;\r\n\t\t\t\tcvrd = i + len; \r\n\t\t\t}\r\n\t\t\telse {\tU.lhst[data[i]]++; }\r\n\t\t\tlc++;\r\n\t\t}\r\n\t}\r\n\tif(bs!=i || data.length==0) {\r\n\t\tif(cvrd>>3;\r\n}\r\nUZIP.F._bestMatch = function(data, i, prev, c, nice, chain) {\r\n\tvar ci = (i&0x7fff), pi=prev[ci]; \r\n\t//console.log(\"----\", i);\r\n\tvar dif = ((ci-pi + (1<<15)) & 0x7fff); if(pi==ci || c!=UZIP.F._hash(data,i-dif)) return 0;\r\n\tvar tl=0, td=0; // top length, top distance\r\n\tvar dlim = Math.min(0x7fff, i);\r\n\twhile(dif<=dlim && --chain!=0 && pi!=ci /*&& c==UZIP.F._hash(data,i-dif)*/) {\r\n\t\tif(tl==0 || (data[i+tl]==data[i+tl-dif])) {\r\n\t\t\tvar cl = UZIP.F._howLong(data, i, dif);\r\n\t\t\tif(cl>tl) { \r\n\t\t\t\ttl=cl; td=dif; if(tl>=nice) break; //* \r\n\t\t\t\tif(dif+2maxd) { maxd=curd; pi = ei; }\r\n\t\t\t\t} //*/\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tci=pi; pi = prev[ci];\r\n\t\tdif += ((ci-pi + (1<<15)) & 0x7fff);\r\n\t}\r\n\treturn (tl<<16)|td;\r\n}\r\nUZIP.F._howLong = function(data, i, dif) {\r\n\tif(data[i]!=data[i-dif] || data[i+1]!=data[i+1-dif] || data[i+2]!=data[i+2-dif]) return 0;\r\n\tvar oi=i, l = Math.min(data.length, i+258); i+=3;\r\n\t//while(i+4>>23), end = off+(qb&((1<<23)-1));\r\n\t\t\twhile(off>16), lgi=(qc>>8)&255, dgi=(qc&255);\r\n\t\t\t\tpos = UZIP.F._writeLit(257+lgi, ltree, out, pos);\r\n\t\t\t\tputsE(out, pos, len-U.of0[lgi]); pos+=U.exb[lgi];\r\n\t\t\t\t\r\n\t\t\t\tpos = UZIP.F._writeLit(dgi, dtree, out, pos);\r\n\t\t\t\tputsF(out, pos, dst-U.df0[dgi]); pos+=U.dxb[dgi]; off+=len;\r\n\t\t\t}\r\n\t\t}\r\n\t\tpos = UZIP.F._writeLit(256, ltree, out, pos);\r\n\t}\r\n\t//console.log(pos-opos, fxdSize, dynSize, cstSize);\r\n\treturn pos;\r\n}\r\nUZIP.F._copyExact = function(data,off,len,out,pos) {\r\n\tvar p8 = (pos>>>3);\r\n\tout[p8]=(len); out[p8+1]=(len>>>8); out[p8+2]=255-out[p8]; out[p8+3]=255-out[p8+1]; p8+=4;\r\n\tout.set(new Uint8Array(data.buffer, off, len), p8);\r\n\t//for(var i=0; i4 && U.itree[(U.ordr[numh-1]<<1)+1]==0) numh--;\r\n\treturn [ML, MD, MH, numl, numd, numh, lset, dset];\r\n}\r\nUZIP.F.getSecond= function(a) { var b=[]; for(var i=0; i>1)+\",\"; return b; }\r\nUZIP.F.contSize = function(tree, hst) { var s=0; for(var i=0; i15) { UZIP.F._putsE(out, pos, rst, rsl); pos+=rsl; }\r\n\t}\r\n\treturn pos;\r\n}\r\nUZIP.F._lenCodes = function(tree, set) {\r\n\tvar len=tree.length; while(len!=2 && tree[len-1]==0) len-=2; // when no distances, keep one code with length 0\r\n\tfor(var i=0; i>>1, 138);\r\n\t\t\tif(zc<11) set.push(17, zc-3);\r\n\t\t\telse set.push(18, zc-11);\r\n\t\t\ti += zc*2-2;\r\n\t\t}\r\n\t\telse if(l==prv && nxt==l && nnxt==l) {\r\n\t\t\tvar lz = i+5;\r\n\t\t\twhile(lz+2>>1, 6);\r\n\t\t\tset.push(16, zc-3);\r\n\t\t\ti += zc*2-2;\r\n\t\t}\r\n\t\telse set.push(l, 0);\r\n\t}\r\n\treturn len>>>1;\r\n}\r\nUZIP.F._hufTree = function(hst, tree, MAXL) {\r\n\tvar list=[], hl = hst.length, tl=tree.length, i=0;\r\n\tfor(i=0; iMAXL) { UZIP.F.restrictDepth(l2, MAXL, maxl); maxl = MAXL; }\r\n\tfor(i=0; iMD) { var od=dps[i].d; dps[i].d=MD; dbt+=bCost-(1<<(maxl-od)); } else break;\r\n\tdbt = dbt>>>(maxl-MD);\r\n\twhile(dbt>0) { var od=dps[i].d; if(od=0; i--) if(dps[i].d==MD && dbt<0) { dps[i].d--; dbt++; } if(dbt!=0) console.log(\"debt left\");\r\n}\r\n\r\nUZIP.F._goodIndex = function(v, arr) {\r\n\tvar i=0; if(arr[i|16]<=v) i|=16; if(arr[i|8]<=v) i|=8; if(arr[i|4]<=v) i|=4; if(arr[i|2]<=v) i|=2; if(arr[i|1]<=v) i|=1; return i;\r\n}\r\nUZIP.F._writeLit = function(ch, ltree, out, pos) {\r\n\tUZIP.F._putsF(out, pos, ltree[ch<<1]);\r\n\treturn pos+ltree[(ch<<1)+1];\r\n}\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\nUZIP.F.inflate = function(data, buf) {\r\n\tvar u8=Uint8Array;\r\n\tif(data[0]==3 && data[1]==0) return (buf ? buf : new u8(0));\r\n\tvar F=UZIP.F, bitsF = F._bitsF, bitsE = F._bitsE, decodeTiny = F._decodeTiny, makeCodes = F.makeCodes, codes2map=F.codes2map, get17 = F._get17;\r\n\tvar U = F.U;\r\n\t\r\n\tvar noBuf = (buf==null);\r\n\tif(noBuf) buf = new u8((data.length>>>2)<<3);\r\n\t\r\n\tvar BFINAL=0, BTYPE=0, HLIT=0, HDIST=0, HCLEN=0, ML=0, MD=0; \t\r\n\tvar off = 0, pos = 0;\r\n\tvar lmap, dmap;\r\n\t\r\n\twhile(BFINAL==0) {\t\t\r\n\t\tBFINAL = bitsF(data, pos , 1);\r\n\t\tBTYPE = bitsF(data, pos+1, 2); pos+=3;\r\n\t\t//console.log(BFINAL, BTYPE);\r\n\t\t\r\n\t\tif(BTYPE==0) {\r\n\t\t\tif((pos&7)!=0) pos+=8-(pos&7);\r\n\t\t\tvar p8 = (pos>>>3)+4, len = data[p8-4]|(data[p8-3]<<8); //console.log(len);//bitsF(data, pos, 16), \r\n\t\t\tif(noBuf) buf=UZIP.F._check(buf, off+len);\r\n\t\t\tbuf.set(new u8(data.buffer, data.byteOffset+p8, len), off);\r\n\t\t\t//for(var i=0; itl)tl=l; } pos+=3*HCLEN; //console.log(itree);\r\n\t\t\tmakeCodes(U.itree, tl);\r\n\t\t\tcodes2map(U.itree, tl, U.imap);\r\n\t\t\t\r\n\t\t\tlmap = U.lmap; dmap = U.dmap;\r\n\t\t\t\r\n\t\t\tpos = decodeTiny(U.imap, (1<>>24))-1; pos+=(ml&0xffffff);\r\n\t\t\tmakeCodes(U.ltree, mx0);\r\n\t\t\tcodes2map(U.ltree, mx0, lmap);\r\n\t\t\t\r\n\t\t\t//var md = decodeTiny(U.imap, (1<>>24))-1; pos+=(md&0xffffff);\r\n\t\t\tmakeCodes(U.dtree, mx1);\r\n\t\t\tcodes2map(U.dtree, mx1, dmap);\r\n\t\t}\r\n\t\t//var ooff=off, opos=pos;\r\n\t\twhile(true) {\r\n\t\t\tvar code = lmap[get17(data, pos) & ML]; pos += code&15;\r\n\t\t\tvar lit = code>>>4; //U.lhst[lit]++; \r\n\t\t\tif((lit>>>8)==0) { buf[off++] = lit; }\r\n\t\t\telse if(lit==256) { break; }\r\n\t\t\telse {\r\n\t\t\t\tvar end = off+lit-254;\r\n\t\t\t\tif(lit>264) { var ebs = U.ldef[lit-257]; end = off + (ebs>>>3) + bitsE(data, pos, ebs&7); pos += ebs&7; }\r\n\t\t\t\t//UZIP.F.dst[end-off]++;\r\n\t\t\t\t\r\n\t\t\t\tvar dcode = dmap[get17(data, pos) & MD]; pos += dcode&15;\r\n\t\t\t\tvar dlit = dcode>>>4;\r\n\t\t\t\tvar dbs = U.ddef[dlit], dst = (dbs>>>4) + bitsF(data, pos, dbs&15); pos += dbs&15;\r\n\t\t\t\t\r\n\t\t\t\t//var o0 = off-dst, stp = Math.min(end-off, dst);\r\n\t\t\t\t//if(stp>20) while(off>>3);\r\n\t}\r\n\t//console.log(UZIP.F.dst);\r\n\t//console.log(tlen, dlen, off-tlen+tcnt);\r\n\treturn buf.length==off ? buf : buf.slice(0,off);\r\n}\r\nUZIP.F._check=function(buf, len) {\r\n\tvar bl=buf.length; if(len<=bl) return buf;\r\n\tvar nbuf = new Uint8Array(Math.max(bl<<1,len)); nbuf.set(buf,0);\r\n\t//for(var i=0; i>>4; \r\n\t\tif(lit<=15) { tree[i]=lit; i++; }\r\n\t\telse {\r\n\t\t\tvar ll = 0, n = 0;\r\n\t\t\tif(lit==16) {\r\n\t\t\t\tn = (3 + bitsE(data, pos, 2)); pos += 2; ll = tree[i-1];\r\n\t\t\t}\r\n\t\t\telse if(lit==17) {\r\n\t\t\t\tn = (3 + bitsE(data, pos, 3)); pos += 3;\r\n\t\t\t}\r\n\t\t\telse if(lit==18) {\r\n\t\t\t\tn = (11 + bitsE(data, pos, 7)); pos += 7;\r\n\t\t\t}\r\n\t\t\tvar ni = i+n;\r\n\t\t\twhile(i>>1;\r\n\twhile(imx)mx=v; i++; }\r\n\twhile(i>1;\r\n\t\tvar cl = tree[i+1], val = (lit<<4)|cl; // : (0x8000 | (U.of0[lit-257]<<7) | (U.exb[lit-257]<<4) | cl);\r\n\t\tvar rest = (MAX_BITS-cl), i0 = tree[i]<>>(15-MAX_BITS);\r\n\t\twhile(i0!=i1) {\r\n\t\t\tvar p0 = r15[i0]>>>(15-MAX_BITS);\r\n\t\t\tmap[p0]=val; i0++;\r\n\t\t}\r\n\t}\r\n}\r\nUZIP.F.revCodes = function(tree, MAX_BITS) {\r\n\tvar r15 = UZIP.F.U.rev15, imb = 15-MAX_BITS;\r\n\tfor(var i=0; i>>imb; }\r\n}\r\n\r\n// used only in deflate\r\nUZIP.F._putsE= function(dt, pos, val ) { val = val<<(pos&7); var o=(pos>>>3); dt[o]|=val; dt[o+1]|=(val>>>8); }\r\nUZIP.F._putsF= function(dt, pos, val ) { val = val<<(pos&7); var o=(pos>>>3); dt[o]|=val; dt[o+1]|=(val>>>8); dt[o+2]|=(val>>>16); }\r\n\r\nUZIP.F._bitsE= function(dt, pos, length) { return ((dt[pos>>>3] | (dt[(pos>>>3)+1]<<8) )>>>(pos&7))&((1<>>3] | (dt[(pos>>>3)+1]<<8) | (dt[(pos>>>3)+2]<<16))>>>(pos&7))&((1<>>3] | (dt[(pos>>>3)+1]<<8))>>>(pos&7))&511;\r\n} */\r\nUZIP.F._get17= function(dt, pos) {\t// return at least 17 meaningful bytes\r\n\treturn (dt[pos>>>3] | (dt[(pos>>>3)+1]<<8) | (dt[(pos>>>3)+2]<<16) )>>>(pos&7);\r\n}\r\nUZIP.F._get25= function(dt, pos) {\t// return at least 17 meaningful bytes\r\n\treturn (dt[pos>>>3] | (dt[(pos>>>3)+1]<<8) | (dt[(pos>>>3)+2]<<16) | (dt[(pos>>>3)+3]<<24) )>>>(pos&7);\r\n}\r\nUZIP.F.U = function(){\r\n\tvar u16=Uint16Array, u32=Uint32Array;\r\n\treturn {\r\n\t\tnext_code : new u16(16),\r\n\t\tbl_count : new u16(16),\r\n\t\tordr : [ 16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15 ],\r\n\t\tof0 : [3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,999,999,999],\r\n\t\texb : [0,0,0,0,0,0,0, 0, 1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3, 4, 4, 4, 4, 5, 5, 5, 5, 0, 0, 0, 0],\r\n\t\tldef : new u16(32),\r\n\t\tdf0 : [1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577, 65535, 65535],\r\n\t\tdxb : [0,0,0,0,1,1,2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8, 9, 9, 10, 10, 11, 11, 12, 12, 13, 13, 0, 0],\r\n\t\tddef : new u32(32),\r\n\t\tflmap: new u16( 512), fltree: [],\r\n\t\tfdmap: new u16( 32), fdtree: [],\r\n\t\tlmap : new u16(32768), ltree : [], ttree:[],\r\n\t\tdmap : new u16(32768), dtree : [],\r\n\t\timap : new u16( 512), itree : [],\r\n\t\t//rev9 : new u16( 512)\r\n\t\trev15: new u16(1<<15),\r\n\t\tlhst : new u32(286), dhst : new u32( 30), ihst : new u32(19),\r\n\t\tlits : new u32(15000),\r\n\t\tstrt : new u16(1<<16),\r\n\t\tprev : new u16(1<<15)\r\n\t}; \r\n} ();\r\n\r\n(function(){\t\r\n\tvar U = UZIP.F.U;\r\n\tvar len = 1<<15;\r\n\tfor(var i=0; i>> 1) | ((x & 0x55555555) << 1));\r\n\t\tx = (((x & 0xcccccccc) >>> 2) | ((x & 0x33333333) << 2));\r\n\t\tx = (((x & 0xf0f0f0f0) >>> 4) | ((x & 0x0f0f0f0f) << 4));\r\n\t\tx = (((x & 0xff00ff00) >>> 8) | ((x & 0x00ff00ff) << 8));\r\n\t\tU.rev15[i] = (((x >>> 16) | (x << 16)))>>>17;\r\n\t}\r\n\t\r\n\tfunction pushV(tgt, n, sv) { while(n--!=0) tgt.push(0,sv); }\r\n\t\r\n\tfor(var i=0; i<32; i++) { U.ldef[i]=(U.of0[i]<<3)|U.exb[i]; U.ddef[i]=(U.df0[i]<<4)|U.dxb[i]; }\r\n\t\r\n\tpushV(U.fltree, 144, 8); pushV(U.fltree, 255-143, 9); pushV(U.fltree, 279-255, 7); pushV(U.fltree,287-279,8);\r\n\t/*\r\n\tvar i = 0;\r\n\tfor(; i<=143; i++) U.fltree.push(0,8);\r\n\tfor(; i<=255; i++) U.fltree.push(0,9);\r\n\tfor(; i<=279; i++) U.fltree.push(0,7);\r\n\tfor(; i<=287; i++) U.fltree.push(0,8);\r\n\t*/\r\n\tUZIP.F.makeCodes(U.fltree, 9);\r\n\tUZIP.F.codes2map(U.fltree, 9, U.flmap);\r\n\tUZIP.F.revCodes (U.fltree, 9)\r\n\t\r\n\tpushV(U.fdtree,32,5);\r\n\t//for(i=0;i<32; i++) U.fdtree.push(0,5);\r\n\tUZIP.F.makeCodes(U.fdtree, 5);\r\n\tUZIP.F.codes2map(U.fdtree, 5, U.fdmap);\r\n\tUZIP.F.revCodes (U.fdtree, 5)\r\n\t\r\n\tpushV(U.itree,19,0); pushV(U.ltree,286,0); pushV(U.dtree,30,0); pushV(U.ttree,320,0);\r\n\t/*\r\n\tfor(var i=0; i< 19; i++) U.itree.push(0,0);\r\n\tfor(var i=0; i<286; i++) U.ltree.push(0,0);\r\n\tfor(var i=0; i< 30; i++) U.dtree.push(0,0);\r\n\tfor(var i=0; i<320; i++) U.ttree.push(0,0);\r\n\t*/\r\n})()\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n","// https://github.com/photopea/UPNG.js/blob/c976240e62b0497167f8aafabd7889625f8b2016/UPNG.js\r\n\r\n// import * as pako from 'pako'\r\nimport * as UZIP from 'uzip'\r\n\r\nvar UPNG = {};\r\n\r\n\r\nUPNG.toRGBA8 = function(out)\r\n{\r\n var w = out.width, h = out.height;\r\n if(out.tabs.acTL==null) return [UPNG.toRGBA8.decodeImage(out.data, w, h, out).buffer];\r\n\r\n var frms = [];\r\n if(out.frames[0].data==null) out.frames[0].data = out.data;\r\n\r\n var len = w*h*4, img = new Uint8Array(len), empty = new Uint8Array(len), prev=new Uint8Array(len);\r\n for(var i=0; i>3)]>>(7-((i&7)<<0)))& 1), cj=3*j; bf[qi]=p[cj]; bf[qi+1]=p[cj+1]; bf[qi+2]=p[cj+2]; bf[qi+3]=(j>2)]>>(6-((i&3)<<1)))& 3), cj=3*j; bf[qi]=p[cj]; bf[qi+1]=p[cj+1]; bf[qi+2]=p[cj+2]; bf[qi+3]=(j>1)]>>(4-((i&1)<<2)))&15), cj=3*j; bf[qi]=p[cj]; bf[qi+1]=p[cj+1]; bf[qi+2]=p[cj+2]; bf[qi+3]=(j>>3)]>>>(7 -((x&7) )))& 1), al=(gr==tr*255)?0:255; bf32[to+x]=(al<<24)|(gr<<16)|(gr<<8)|gr; }\r\n else if(depth== 2) for(var x=0; x>>2)]>>>(6 -((x&3)<<1)))& 3), al=(gr==tr* 85)?0:255; bf32[to+x]=(al<<24)|(gr<<16)|(gr<<8)|gr; }\r\n else if(depth== 4) for(var x=0; x>>1)]>>>(4 -((x&1)<<2)))&15), al=(gr==tr* 17)?0:255; bf32[to+x]=(al<<24)|(gr<<16)|(gr<<8)|gr; }\r\n else if(depth== 8) for(var x=0; x>>2<<5);while(i==0){i=n(N,d,1);m=n(N,d+1,2);d+=3;if(m==0){if((d&7)!=0)d+=8-(d&7);\r\n var D=(d>>>3)+4,q=N[D-4]|N[D-3]<<8;if(Z)W=H.H.W(W,w+q);W.set(new R(N.buffer,N.byteOffset+D,q),w);d=D+q<<3;\r\n w+=q;continue}if(Z)W=H.H.W(W,w+(1<<17));if(m==1){v=b.J;C=b.h;X=(1<<9)-1;u=(1<<5)-1}if(m==2){J=A(N,d,5)+257;\r\n h=A(N,d+5,5)+1;Q=A(N,d+10,4)+4;d+=14;var E=d,j=1;for(var c=0;c<38;c+=2){b.Q[c]=0;b.Q[c+1]=0}for(var c=0;\r\n cj)j=K}d+=3*Q;M(b.Q,j);I(b.Q,j,b.u);v=b.w;C=b.d;\r\n d=l(b.u,(1<>>4;if(p>>>8==0){W[w++]=p}else if(p==256){break}else{var z=w+p-254;\r\n if(p>264){var _=b.q[p-257];z=w+(_>>>3)+A(N,d,_&7);d+=_&7}var $=C[e(N,d)&u];d+=$&15;var s=$>>>4,Y=b.c[s],a=(Y>>>4)+n(N,d,Y&15);\r\n d+=Y&15;while(w>>4;\r\n if(b<=15){A[I]=b;I++}else{var Z=0,m=0;if(b==16){m=3+l(V,n,2);n+=2;Z=A[I-1]}else if(b==17){m=3+l(V,n,3);\r\n n+=3}else if(b==18){m=11+l(V,n,7);n+=7}var J=I+m;while(I>>1;\r\n while(An)n=M;A++}while(A>1,I=N[l+1],e=M<<4|I,b=W-I,Z=N[l]<>>15-W;R[J]=e;Z++}}};H.H.l=function(N,W){var R=H.H.m.r,V=15-W;for(var n=0;n>>V}};H.H.M=function(N,W,R){R=R<<(W&7);var V=W>>>3;N[V]|=R;N[V+1]|=R>>>8};\r\n H.H.I=function(N,W,R){R=R<<(W&7);var V=W>>>3;N[V]|=R;N[V+1]|=R>>>8;N[V+2]|=R>>>16};H.H.e=function(N,W,R){return(N[W>>>3]|N[(W>>>3)+1]<<8)>>>(W&7)&(1<>>3]|N[(W>>>3)+1]<<8|N[(W>>>3)+2]<<16)>>>(W&7)&(1<>>3]|N[(W>>>3)+1]<<8|N[(W>>>3)+2]<<16)>>>(W&7)};\r\n H.H.i=function(N,W){return(N[W>>>3]|N[(W>>>3)+1]<<8|N[(W>>>3)+2]<<16|N[(W>>>3)+3]<<24)>>>(W&7)};H.H.m=function(){var N=Uint16Array,W=Uint32Array;\r\n return{K:new N(16),j:new N(16),X:[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],S:[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,999,999,999],T:[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0],q:new N(32),p:[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,65535,65535],z:[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0],c:new W(32),J:new N(512),_:[],h:new N(32),$:[],w:new N(32768),C:[],v:[],d:new N(32768),D:[],u:new N(512),Q:[],r:new N(1<<15),s:new W(286),Y:new W(30),a:new W(19),t:new W(15e3),k:new N(1<<16),g:new N(1<<15)}}();\r\n (function(){var N=H.H.m,W=1<<15;for(var R=0;R>>1|(V&1431655765)<<1;\r\n V=(V&3435973836)>>>2|(V&858993459)<<2;V=(V&4042322160)>>>4|(V&252645135)<<4;V=(V&4278255360)>>>8|(V&16711935)<<8;\r\n N.r[R]=(V>>>16|V<<16)>>>17}function n(A,l,M){while(l--!=0)A.push(0,M)}for(var R=0;R<32;R++){N.q[R]=N.S[R]<<3|N.T[R];\r\n N.c[R]=N.p[R]<<4|N.z[R]}n(N._,144,8);n(N._,255-143,9);n(N._,279-255,7);n(N._,287-279,8);H.H.n(N._,9);\r\n H.H.A(N._,9,N.J);H.H.l(N._,9);n(N.$,32,5);H.H.n(N.$,5);H.H.A(N.$,5,N.h);H.H.l(N.$,5);n(N.Q,19,0);n(N.C,286,0);\r\n n(N.D,30,0);n(N.v,320,0)}());return H.H.N}()\r\n\r\n\r\nUPNG.decode._readInterlace = function(data, out)\r\n{\r\n var w = out.width, h = out.height;\r\n var bpp = UPNG.decode._getBPP(out), cbpp = bpp>>3, bpl = Math.ceil(w*bpp/8);\r\n var img = new Uint8Array( h * bpl );\r\n var di = 0;\r\n\r\n var starting_row = [ 0, 0, 4, 0, 2, 0, 1 ];\r\n var starting_col = [ 0, 4, 0, 2, 0, 1, 0 ];\r\n var row_increment = [ 8, 8, 8, 4, 4, 2, 2 ];\r\n var col_increment = [ 8, 8, 4, 4, 2, 2, 1 ];\r\n\r\n var pass=0;\r\n while(pass<7)\r\n {\r\n var ri = row_increment[pass], ci = col_increment[pass];\r\n var sw = 0, sh = 0;\r\n var cr = starting_row[pass]; while(cr>3]; val = (val>>(7-(cdi&7)))&1;\r\n img[row*bpl + (col>>3)] |= (val << (7-((col&7)<<0)));\r\n }\r\n if(bpp==2) {\r\n var val = data[cdi>>3]; val = (val>>(6-(cdi&7)))&3;\r\n img[row*bpl + (col>>2)] |= (val << (6-((col&3)<<1)));\r\n }\r\n if(bpp==4) {\r\n var val = data[cdi>>3]; val = (val>>(4-(cdi&7)))&15;\r\n img[row*bpl + (col>>1)] |= (val << (4-((col&1)<<2)));\r\n }\r\n if(bpp>=8) {\r\n var ii = row*bpl+col*cbpp;\r\n for(var j=0; j>3)+j];\r\n }\r\n cdi+=bpp; col+=ci;\r\n }\r\n y++; row += ri;\r\n }\r\n if(sw*sh!=0) di += sh * (1 + bpll);\r\n pass = pass + 1;\r\n }\r\n return img;\r\n}\r\n\r\nUPNG.decode._getBPP = function(out) {\r\n var noc = [1,null,3,1,2,null,4][out.ctype];\r\n return noc * out.depth;\r\n}\r\n\r\nUPNG.decode._filterZero = function(data, out, off, w, h)\r\n{\r\n var bpp = UPNG.decode._getBPP(out), bpl = Math.ceil(w*bpp/8), paeth = UPNG.decode._paeth;\r\n bpp = Math.ceil(bpp/8);\r\n\r\n var i=0, di=1, type=data[off], x=0;\r\n\r\n if(type>1) data[off]=[0,0,1][type-2];\r\n if(type==3) for(x=bpp; x>>1) )&255;\r\n\r\n for(var y=0; y>>1));\r\n for(; x>>1) ); }\r\n else { for(; x>8)&255; buff[p+1] = n&255; },\r\n readUint : function(buff,p) { return (buff[p]*(256*256*256)) + ((buff[p+1]<<16) | (buff[p+2]<< 8) | buff[p+3]); },\r\n writeUint : function(buff,p,n){ buff[p]=(n>>24)&255; buff[p+1]=(n>>16)&255; buff[p+2]=(n>>8)&255; buff[p+3]=n&255; },\r\n readASCII : function(buff,p,l){ var s = \"\"; for(var i=0; i=0 && yoff>=0) { si = (y*sw+x)<<2; ti = (( yoff+y)*tw+xoff+x)<<2; }\r\n else { si = ((-yoff+y)*sw-xoff+x)<<2; ti = (y*tw+x)<<2; }\r\n\r\n if (mode==0) { tb[ti] = sb[si]; tb[ti+1] = sb[si+1]; tb[ti+2] = sb[si+2]; tb[ti+3] = sb[si+3]; }\r\n else if(mode==1) {\r\n var fa = sb[si+3]*(1/255), fr=sb[si]*fa, fg=sb[si+1]*fa, fb=sb[si+2]*fa;\r\n var ba = tb[ti+3]*(1/255), br=tb[ti]*ba, bg=tb[ti+1]*ba, bb=tb[ti+2]*ba;\r\n\r\n var ifa=1-fa, oa = fa+ba*ifa, ioa = (oa==0?0:1/oa);\r\n tb[ti+3] = 255*oa;\r\n tb[ti+0] = (fr+br*ifa)*ioa;\r\n tb[ti+1] = (fg+bg*ifa)*ioa;\r\n tb[ti+2] = (fb+bb*ifa)*ioa;\r\n }\r\n else if(mode==2){\t// copy only differences, otherwise zero\r\n var fa = sb[si+3], fr=sb[si], fg=sb[si+1], fb=sb[si+2];\r\n var ba = tb[ti+3], br=tb[ti], bg=tb[ti+1], bb=tb[ti+2];\r\n if(fa==ba && fr==br && fg==bg && fb==bb) { tb[ti]=0; tb[ti+1]=0; tb[ti+2]=0; tb[ti+3]=0; }\r\n else { tb[ti]=fr; tb[ti+1]=fg; tb[ti+2]=fb; tb[ti+3]=fa; }\r\n }\r\n else if(mode==3){\t// check if can be blended\r\n var fa = sb[si+3], fr=sb[si], fg=sb[si+1], fb=sb[si+2];\r\n var ba = tb[ti+3], br=tb[ti], bg=tb[ti+1], bb=tb[ti+2];\r\n if(fa==ba && fr==br && fg==bg && fb==bb) continue;\r\n //if(fa!=255 && ba!=0) return false;\r\n if(fa<220 && ba>20) return false;\r\n }\r\n }\r\n return true;\r\n}\r\n\r\n\r\n\r\n\r\nUPNG.encode = function(bufs, w, h, ps, dels, tabs, forbidPlte)\r\n{\r\n if(ps==null) ps=0;\r\n if(forbidPlte==null) forbidPlte = false;\r\n\r\n var nimg = UPNG.encode.compress(bufs, w, h, ps, [false, false, false, 0, forbidPlte]);\r\n UPNG.encode.compressPNG(nimg, -1);\r\n\r\n return UPNG.encode._main(nimg, w, h, dels, tabs);\r\n}\r\n\r\nUPNG.encodeLL = function(bufs, w, h, cc, ac, depth, dels, tabs) {\r\n var nimg = { ctype: 0 + (cc==1 ? 0 : 2) + (ac==0 ? 0 : 4), depth: depth, frames: [] };\r\n\r\n var time = Date.now();\r\n var bipp = (cc+ac)*depth, bipl = bipp * w;\r\n for(var i=0; i1, pltAlpha = false;\r\n\r\n var leng = 8 + (16+5+4) /*+ (9+4)*/ + (anim ? 20 : 0);\r\n if(tabs[\"sRGB\"]!=null) leng += 8+1+4;\r\n if(tabs[\"pHYs\"]!=null) leng += 8+9+4;\r\n if(nimg.ctype==3) {\r\n var dl = nimg.plte.length;\r\n for(var i=0; i>>24)!=255) pltAlpha = true;\r\n leng += (8 + dl*3 + 4) + (pltAlpha ? (8 + dl*1 + 4) : 0);\r\n }\r\n for(var j=0; j>>8)&255, b=(c>>>16)&255;\r\n data[offset+ti+0]=r; data[offset+ti+1]=g; data[offset+ti+2]=b;\r\n }\r\n offset+=dl*3;\r\n wUi(data,offset,crc(data,offset-dl*3-4,dl*3+4)); offset+=4; // crc\r\n\r\n if(pltAlpha) {\r\n wUi(data,offset, dl); offset+=4;\r\n wAs(data,offset,\"tRNS\"); offset+=4;\r\n for(var i=0; i>>24)&255;\r\n offset+=dl;\r\n wUi(data,offset,crc(data,offset-dl-4,dl+4)); offset+=4; // crc\r\n }\r\n }\r\n\r\n var fi = 0;\r\n for(var j=0; j>2, bln>>2));\r\n for(var j=0; jnw && c==img32[i-nw]) ind[i]=ind[i-nw];\r\n else {\r\n var cmc = cmap[c];\r\n if(cmc==null) { cmap[c]=cmc=plte.length; plte.push(c); if(plte.length>=300) break; }\r\n ind[i]=cmc;\r\n }\r\n }\r\n }\r\n //console.log(\"make palette\", Date.now()-time); time = Date.now();\r\n }\r\n\r\n var cc=plte.length; //console.log(\"colors:\",cc);\r\n if(cc<=256 && forbidPlte==false) {\r\n if(cc<= 2) depth=1; else if(cc<= 4) depth=2; else if(cc<=16) depth=4; else depth=8;\r\n depth = Math.max(depth, minBits);\r\n }\r\n\r\n for(var j=0; j>1)] |= (inj[ii+x]<<(4-(x&1)*4));\r\n else if(depth==2) for(var x=0; x>2)] |= (inj[ii+x]<<(6-(x&3)*2));\r\n else if(depth==1) for(var x=0; x>3)] |= (inj[ii+x]<<(7-(x&7)*1));\r\n }\r\n cimg=nimg; ctype=3; bpp=1;\r\n }\r\n else if(gotAlpha==false && frms.length==1) {\t// some next \"reduced\" frames may contain alpha for blending\r\n var nimg = new Uint8Array(nw*nh*3), area=nw*nh;\r\n for(var i=0; i palette indices\", Date.now()-time); time = Date.now();\r\n\r\n return {ctype:ctype, depth:depth, plte:plte, frames:frms };\r\n}\r\nUPNG.encode.framize = function(bufs,w,h,alwaysBlend,evenCrd,forbidPrev) {\r\n /* DISPOSE\r\n - 0 : no change\r\n - 1 : clear to transparent\r\n - 2 : retstore to content before rendering (previous frame disposed)\r\n BLEND\r\n - 0 : replace\r\n - 1 : blend\r\n */\r\n var frms = [];\r\n for(var j=0; jmax) max=x;\r\n if(ymay) may=y;\r\n }\r\n }\r\n if(max==-1) mix=miy=max=may=0;\r\n if(evenCrd) { if((mix&1)==1)mix--; if((miy&1)==1)miy--; }\r\n var sarea = (max-mix+1)*(may-miy+1);\r\n if(sareamax) max=cx;\r\n if(cymay) may=cy;\r\n }\r\n }\r\n if(max==-1) mix=miy=max=may=0;\r\n if(evenCrd) { if((mix&1)==1)mix--; if((miy&1)==1)miy--; }\r\n r = {x:mix, y:miy, width:max-mix+1, height:may-miy+1};\r\n\r\n var fr = frms[i]; fr.rect = r; fr.blend = 1; fr.img = new Uint8Array(r.width*r.height*4);\r\n if(frms[i-1].dispose==0) {\r\n UPNG._copyTile(pimg,w,h, fr.img,r.width,r.height, -r.x,-r.y, 0);\r\n UPNG.encode._prepareDiff(cimg,w,h,fr.img,r);\r\n //UPNG._copyTile(cimg,w,h, fr.img,r.width,r.height, -r.x,-r.y, 2);\r\n }\r\n else\r\n UPNG._copyTile(cimg,w,h, fr.img,r.width,r.height, -r.x,-r.y, 0);\r\n}\r\nUPNG.encode._prepareDiff = function(cimg, w,h, nimg, rec) {\r\n UPNG._copyTile(cimg,w,h, nimg,rec.width,rec.height, -rec.x,-rec.y, 2);\r\n /*\r\n var n32 = new Uint32Array(nimg.buffer);\r\n var og = new Uint8Array(rec.width*rec.height*4), o32 = new Uint32Array(og.buffer);\r\n UPNG._copyTile(cimg,w,h, og,rec.width,rec.height, -rec.x,-rec.y, 0);\r\n for(var i=4; i>>2]==o32[(i>>>2)-1]) {\r\n n32[i>>>2]=o32[i>>>2];\r\n //var j = i, c=p32[(i>>>2)-1];\r\n //while(p32[j>>>2]==c) { n32[j>>>2]=c; j+=4; }\r\n }\r\n }\r\n for(var i=nimg.length-8; i>0; i-=4) {\r\n if(nimg[i+7]!=0 && nimg[i+3]==0 && o32[i>>>2]==o32[(i>>>2)+1]) {\r\n n32[i>>>2]=o32[i>>>2];\r\n //var j = i, c=p32[(i>>>2)-1];\r\n //while(p32[j>>>2]==c) { n32[j>>>2]=c; j+=4; }\r\n }\r\n }*/\r\n}\r\n\r\nUPNG.encode._filterZero = function(img,h,bpp,bpl,data, filter, levelZero)\r\n{\r\n var fls = [], ftry=[0,1,2,3,4];\r\n if (filter!=-1) ftry=[filter];\r\n else if(h*bpl>500000 || bpp==1) ftry=[0];\r\n var opts; if(levelZero) opts={level:0};\r\n\r\n\r\n // var CMPR = (data.length>10e6 && typeof UZIP !== 'undefined') ? UZIP : pako;\r\n var CMPR = UZIP;\r\n\r\n var time = Date.now();\r\n for(var i=0; i>1) +256)&255;\r\n if(type==4) for(var x=bpp; x>1))&255;\r\n for(var x=bpp; x>1))&255; }\r\n if(type==4) { for(var x= 0; x>> 1);\r\n else c = c >>> 1;\r\n }\r\n tab[n] = c; }\r\n return tab; })(),\r\n update : function(c, buf, off, len) {\r\n for (var i=0; i>> 8);\r\n return c;\r\n },\r\n crc : function(b,o,l) { return UPNG.crc.update(0xffffffff,b,o,l) ^ 0xffffffff; }\r\n}\r\n\r\n\r\nUPNG.quantize = function(abuf, ps)\r\n{\r\n var oimg = new Uint8Array(abuf), nimg = oimg.slice(0), nimg32 = new Uint32Array(nimg.buffer);\r\n\r\n var KD = UPNG.quantize.getKDtree(nimg, ps);\r\n var root = KD[0], leafs = KD[1];\r\n\r\n var planeDst = UPNG.quantize.planeDst;\r\n var sb = oimg, tb = nimg32, len=sb.length;\r\n\r\n var inds = new Uint8Array(oimg.length>>2), nd;\r\n if(oimg.length<20e6) // precise, but slow :(\r\n for(var i=0; i>2] = nd.ind; tb[i>>2] = nd.est.rgba;\r\n }\r\n else\r\n for(var i=0; i>2] = nd.ind; tb[i>>2] = nd.est.rgba;\r\n }\r\n return { abuf:nimg.buffer, inds:inds, plte:leafs };\r\n}\r\n\r\nUPNG.quantize.getKDtree = function(nimg, ps, err) {\r\n if(err==null) err = 0.0001;\r\n var nimg32 = new Uint32Array(nimg.buffer);\r\n\r\n var root = {i0:0, i1:nimg.length, bst:null, est:null, tdst:0, left:null, right:null }; // basic statistic, extra statistic\r\n root.bst = UPNG.quantize.stats( nimg,root.i0, root.i1 ); root.est = UPNG.quantize.estats( root.bst );\r\n var leafs = [root];\r\n\r\n while(leafs.length maxL) { maxL=leafs[i].est.L; mi=i; }\r\n if(maxL=s0 || node.i1<=s0);\r\n //console.log(maxL, leafs.length, mi);\r\n if(s0wrong) { node.est.L=0; continue; }\r\n\r\n\r\n var ln = {i0:node.i0, i1:s0, bst:null, est:null, tdst:0, left:null, right:null }; ln.bst = UPNG.quantize.stats( nimg, ln.i0, ln.i1 );\r\n ln.est = UPNG.quantize.estats( ln.bst );\r\n var rn = {i0:s0, i1:node.i1, bst:null, est:null, tdst:0, left:null, right:null }; rn.bst = {R:[], m:[], N:node.bst.N-ln.bst.N};\r\n for(var i=0; i<16; i++) rn.bst.R[i] = node.bst.R[i]-ln.bst.R[i];\r\n for(var i=0; i< 4; i++) rn.bst.m[i] = node.bst.m[i]-ln.bst.m[i];\r\n rn.est = UPNG.quantize.estats( rn.bst );\r\n\r\n node.left = ln; node.right = rn;\r\n leafs[mi]=ln; leafs.push(rn);\r\n }\r\n leafs.sort(function(a,b) { return b.bst.N-a.bst.N; });\r\n for(var i=0; i0) { node0=nd.right; node1=nd.left; }\r\n\r\n var ln = UPNG.quantize.getNearest(node0, r,g,b,a);\r\n if(ln.tdst<=planeDst*planeDst) return ln;\r\n var rn = UPNG.quantize.getNearest(node1, r,g,b,a);\r\n return rn.tdst eMq) i1-=4;\r\n if(i0>=i1) break;\r\n\r\n var t = nimg32[i0>>2]; nimg32[i0>>2] = nimg32[i1>>2]; nimg32[i1>>2]=t;\r\n\r\n i0+=4; i1-=4;\r\n }\r\n while(vecDot(nimg, i0, e)>eMq) i0-=4;\r\n return i0+4;\r\n}\r\nUPNG.quantize.vecDot = function(nimg, i, e)\r\n{\r\n return nimg[i]*e[0] + nimg[i+1]*e[1] + nimg[i+2]*e[2] + nimg[i+3]*e[3];\r\n}\r\nUPNG.quantize.stats = function(nimg, i0, i1){\r\n var R = [0,0,0,0, 0,0,0,0, 0,0,0,0, 0,0,0,0];\r\n var m = [0,0,0,0];\r\n var N = (i1-i0)>>2;\r\n for(var i=i0; i>>0) };\r\n}\r\nUPNG.M4 = {\r\n multVec : function(m,v) {\r\n return [\r\n m[ 0]*v[0] + m[ 1]*v[1] + m[ 2]*v[2] + m[ 3]*v[3],\r\n m[ 4]*v[0] + m[ 5]*v[1] + m[ 6]*v[2] + m[ 7]*v[3],\r\n m[ 8]*v[0] + m[ 9]*v[1] + m[10]*v[2] + m[11]*v[3],\r\n m[12]*v[0] + m[13]*v[1] + m[14]*v[2] + m[15]*v[3]\r\n ];\r\n },\r\n dot : function(x,y) { return x[0]*y[0]+x[1]*y[1]+x[2]*y[2]+x[3]*y[3]; },\r\n sml : function(a,y) { return [a*y[0],a*y[1],a*y[2],a*y[3]]; }\r\n}\r\n\r\nUPNG.encode.concatRGBA = function(bufs) {\r\n var tlen = 0;\r\n for(var i=0; i}\r\n */\r\nexport function getDataUrlFromFile (file) {\r\n return new Promise((resolve, reject) => {\r\n const reader = new CustomFileReader()\r\n reader.onload = () => resolve(reader.result)\r\n reader.onerror = (e) => reject(e)\r\n reader.readAsDataURL(file)\r\n })\r\n}\r\n\r\n/**\r\n * getFilefromDataUrl\r\n *\r\n * @param {string} dataUrl\r\n * @param {string} filename\r\n * @param {number} [lastModified=Date.now()]\r\n * @returns {Promise}\r\n */\r\nexport function getFilefromDataUrl (dataUrl, filename, lastModified = Date.now()) {\r\n return new Promise((resolve) => {\r\n const arr = dataUrl.split(',')\r\n const mime = arr[0].match(/:(.*?);/)[1]\r\n const bstr = globalThis.atob(arr[1])\r\n let n = bstr.length\r\n const u8arr = new Uint8Array(n)\r\n while (n--) {\r\n u8arr[n] = bstr.charCodeAt(n)\r\n }\r\n const file = new Blob([u8arr], { type: mime })\r\n file.name = filename\r\n file.lastModified = lastModified\r\n resolve(file)\r\n\r\n // Safari has issue with File constructor not being able to POST in FormData\r\n // https://github.com/Donaldcwl/browser-image-compression/issues/8\r\n // https://bugs.webkit.org/show_bug.cgi?id=165081\r\n // let file\r\n // try {\r\n // file = new File([u8arr], filename, { type: mime }) // Edge do not support File constructor\r\n // } catch (e) {\r\n // file = new Blob([u8arr], { type: mime })\r\n // file.name = filename\r\n // file.lastModified = lastModified\r\n // }\r\n // resolve(file)\r\n })\r\n}\r\n\r\n/**\r\n * loadImage\r\n *\r\n * @param {string} src\r\n * @returns {Promise}\r\n */\r\nexport function loadImage (src) {\r\n return new Promise((resolve, reject) => {\r\n const img = new Image()\r\n img.onload = () => resolve(img)\r\n img.onerror = (e) => reject(e)\r\n img.src = src\r\n })\r\n}\r\n\r\n/**\r\n * drawImageInCanvas\r\n *\r\n * @param {HTMLImageElement} img\r\n * @returns {HTMLCanvasElement | OffscreenCanvas}\r\n */\r\nexport function drawImageInCanvas (img) {\r\n const [canvas, ctx] = getNewCanvasAndCtx(img.width, img.height)\r\n ctx.drawImage(img, 0, 0, canvas.width, canvas.height)\r\n return canvas\r\n}\r\n\r\n/**\r\n * drawFileInCanvas\r\n *\r\n * @param {File | Blob} file\r\n * @returns {Promise<[ImageBitmap | HTMLImageElement, HTMLCanvasElement | OffscreenCanvas]>}\r\n */\r\nexport async function drawFileInCanvas (file) {\r\n let img\r\n try {\r\n img = await createImageBitmap(file)\r\n } catch (e) {\r\n const dataUrl = await getDataUrlFromFile(file)\r\n img = await loadImage(dataUrl)\r\n }\r\n const canvas = drawImageInCanvas(img)\r\n return [img, canvas]\r\n}\r\n\r\n/**\r\n * canvasToFile\r\n *\r\n * @param {HTMLCanvasElement | OffscreenCanvas} canvas\r\n * @param {string} fileType\r\n * @param {string} fileName\r\n * @param {number} fileLastModified\r\n * @param {number} [quality]\r\n * @returns {Promise}\r\n */\r\nexport async function canvasToFile (canvas, fileType, fileName, fileLastModified, quality = 1) {\r\n let file\r\n if (fileType === 'image/png') {\r\n const ctx = canvas.getContext('2d')\r\n const data = ctx.getImageData(0, 0, canvas.width, canvas.height).data\r\n const png = UPNG.encode([data], canvas.width, canvas.height, 256 * quality)\r\n file = new Blob([png], { type: fileType })\r\n file.name = fileName\r\n file.lastModified = fileLastModified\r\n } else if (typeof OffscreenCanvas === 'function' && canvas instanceof OffscreenCanvas) { // checked on Win Chrome 83, MacOS Chrome 83\r\n file = await canvas.convertToBlob({ type: fileType, quality })\r\n file.name = fileName\r\n file.lastModified = fileLastModified\r\n // some browser do not support quality parameter, see: https://developer.mozilla.org/en-US/docs/Web/API/HTMLCanvasElement/toBlob\r\n // } else if (typeof canvas.toBlob === 'function') {\r\n // file = await new Promise(resolve => canvas.toBlob(resolve, fileType, quality))\r\n } else { // checked on Win Edge 44, Win IE 11, Win Firefox 76, MacOS Firefox 77, MacOS Safari 13.1\r\n const dataUrl = canvas.toDataURL(fileType, quality)\r\n file = await getFilefromDataUrl(dataUrl, fileName, fileLastModified)\r\n }\r\n return file\r\n}\r\n\r\n/**\r\n * getExifOrientation\r\n * get image exif orientation info\r\n * source: https://stackoverflow.com/a/32490603/10395024\r\n *\r\n * @param {File | Blob} file\r\n * @returns {Promise} - orientation id, see https://i.stack.imgur.com/VGsAj.gif\r\n */\r\nexport function getExifOrientation (file) {\r\n return new Promise((resolve, reject) => {\r\n const reader = new CustomFileReader()\r\n reader.onload = (e) => {\r\n const view = new DataView(e.target.result)\r\n if (view.getUint16(0, false) != 0xFFD8) {\r\n return resolve(-2)\r\n }\r\n const length = view.byteLength\r\n let offset = 2\r\n while (offset < length) {\r\n if (view.getUint16(offset + 2, false) <= 8) return resolve(-1)\r\n const marker = view.getUint16(offset, false)\r\n offset += 2\r\n if (marker == 0xFFE1) {\r\n if (view.getUint32(offset += 2, false) != 0x45786966) {\r\n return resolve(-1)\r\n }\r\n\r\n var little = view.getUint16(offset += 6, false) == 0x4949\r\n offset += view.getUint32(offset + 4, little)\r\n var tags = view.getUint16(offset, little)\r\n offset += 2\r\n for (var i = 0; i < tags; i++) {\r\n if (view.getUint16(offset + (i * 12), little) == 0x0112) {\r\n return resolve(view.getUint16(offset + (i * 12) + 8, little))\r\n }\r\n }\r\n } else if ((marker & 0xFF00) != 0xFF00) {\r\n break\r\n } else {\r\n offset += view.getUint16(offset, false)\r\n }\r\n }\r\n return resolve(-1)\r\n }\r\n reader.onerror = (e) => reject(e)\r\n reader.readAsArrayBuffer(file)\r\n })\r\n}\r\n\r\n/**\r\n *\r\n * @param {HTMLCanvasElement | OffscreenCanvas} canvas\r\n * @param options\r\n * @returns {HTMLCanvasElement | OffscreenCanvas}\r\n */\r\nexport function handleMaxWidthOrHeight (canvas, options) {\r\n const width = canvas.width\r\n const height = canvas.height\r\n const maxWidthOrHeight = options.maxWidthOrHeight\r\n\r\n const needToHandle = isFinite(maxWidthOrHeight) && (width > maxWidthOrHeight || height > maxWidthOrHeight)\r\n\r\n let newCanvas = canvas\r\n let ctx\r\n\r\n if (needToHandle) {\r\n [newCanvas, ctx] = getNewCanvasAndCtx(width, height)\r\n if (width > height) {\r\n newCanvas.width = maxWidthOrHeight\r\n newCanvas.height = (height / width) * maxWidthOrHeight\r\n } else {\r\n newCanvas.width = (width / height) * maxWidthOrHeight\r\n newCanvas.height = maxWidthOrHeight\r\n }\r\n ctx.drawImage(canvas, 0, 0, newCanvas.width, newCanvas.height)\r\n\r\n cleanupCanvasMemory(canvas)\r\n }\r\n\r\n return newCanvas\r\n}\r\n\r\n/**\r\n * followExifOrientation\r\n * source: https://stackoverflow.com/a/40867559/10395024\r\n *\r\n * @param {HTMLCanvasElement | OffscreenCanvas} canvas\r\n * @param {number} exifOrientation\r\n * @returns {HTMLCanvasElement | OffscreenCanvas} canvas\r\n */\r\nexport function followExifOrientation (canvas, exifOrientation) {\r\n const width = canvas.width\r\n const height = canvas.height\r\n\r\n const [newCanvas, ctx] = getNewCanvasAndCtx(width, height)\r\n\r\n // set proper canvas dimensions before transform & export\r\n if (4 < exifOrientation && exifOrientation < 9) {\r\n newCanvas.width = height\r\n newCanvas.height = width\r\n } else {\r\n newCanvas.width = width\r\n newCanvas.height = height\r\n }\r\n\r\n // transform context before drawing image\r\n switch (exifOrientation) {\r\n case 2:\r\n ctx.transform(-1, 0, 0, 1, width, 0)\r\n break\r\n case 3:\r\n ctx.transform(-1, 0, 0, -1, width, height)\r\n break\r\n case 4:\r\n ctx.transform(1, 0, 0, -1, 0, height)\r\n break\r\n case 5:\r\n ctx.transform(0, 1, 1, 0, 0, 0)\r\n break\r\n case 6:\r\n ctx.transform(0, 1, -1, 0, height, 0)\r\n break\r\n case 7:\r\n ctx.transform(0, -1, -1, 0, height, width)\r\n break\r\n case 8:\r\n ctx.transform(0, -1, 1, 0, 0, width)\r\n break\r\n default:\r\n break\r\n }\r\n\r\n ctx.drawImage(canvas, 0, 0, width, height)\r\n\r\n cleanupCanvasMemory(canvas)\r\n\r\n return newCanvas\r\n}\r\n\r\n/**\r\n * get new Canvas and it's context\r\n * @param width\r\n * @param height\r\n * @returns {[HTMLCanvasElement | OffscreenCanvas, CanvasRenderingContext2D]}\r\n */\r\nexport function getNewCanvasAndCtx (width, height) {\r\n let canvas\r\n let ctx\r\n try {\r\n canvas = new OffscreenCanvas(width, height)\r\n ctx = canvas.getContext('2d')\r\n if (ctx === null) {\r\n throw new Error('getContext of OffscreenCanvas returns null')\r\n }\r\n } catch (e) {\r\n canvas = document.createElement('canvas')\r\n ctx = canvas.getContext('2d')\r\n }\r\n canvas.width = width\r\n canvas.height = height\r\n // ctx.fillStyle = '#fff'\r\n // ctx.fillRect(0, 0, width, height)\r\n return [canvas, ctx]\r\n}\r\n\r\n/**\r\n * clear Canvas memory\r\n * @param canvas\r\n * @returns null\r\n */\r\nexport function cleanupCanvasMemory (canvas) {\r\n // garbage clean canvas for safari\r\n // ref: https://bugs.webkit.org/show_bug.cgi?id=195325\r\n canvas.width = 0\r\n canvas.height = 0\r\n}\r\n\r\nif (isBrowser) {\r\n// Polyfill for Number.isInteger\r\n Number.isInteger = Number.isInteger || function (value) {\r\n return typeof value === 'number' &&\r\n isFinite(value) &&\r\n Math.floor(value) === value\r\n }\r\n}\r\n","import {\r\n canvasToFile,\r\n cleanupCanvasMemory,\r\n drawFileInCanvas,\r\n followExifOrientation,\r\n getExifOrientation,\r\n getNewCanvasAndCtx,\r\n handleMaxWidthOrHeight,\r\n isAutoOrientationInBrowser\r\n} from './utils'\r\n\r\n/**\r\n * Compress an image file.\r\n *\r\n * @param {File} file\r\n * @param {Object} options\r\n * @param {number} [options.maxSizeMB=Number.POSITIVE_INFINITY]\r\n * @param {number} [options.maxWidthOrHeight=undefined]\r\n * @param {boolean} [options.useWebWorker=false]\r\n * @param {number} [options.maxIteration=10]\r\n * @param {number} [options.exifOrientation] - default to be the exif orientation from the image file\r\n * @param {Function} [options.onProgress] - a function takes one progress argument (progress from 0 to 100)\r\n * @param {string} [options.fileType] - default to be the original mime type from the image file\r\n * @param {number} [options.initialQuality=1.0]\r\n * @param {number} previousProgress - for internal try catch rerunning start from previous progress\r\n * @returns {Promise}\r\n */\r\nexport default async function compress (file, options, previousProgress = 0) {\r\n let progress = previousProgress\r\n\r\n function incProgress (inc = 5) {\r\n progress += inc\r\n options.onProgress(Math.min(progress, 100))\r\n }\r\n\r\n function setProgress (p) {\r\n progress = Math.min(Math.max(p, progress), 100)\r\n options.onProgress(progress)\r\n }\r\n\r\n let remainingTrials = options.maxIteration || 10\r\n\r\n const maxSizeByte = options.maxSizeMB * 1024 * 1024\r\n\r\n incProgress()\r\n\r\n // drawFileInCanvas\r\n let [img, origCanvas] = await drawFileInCanvas(file)\r\n\r\n incProgress()\r\n\r\n // handleMaxWidthOrHeight\r\n const maxWidthOrHeightFixedCanvas = handleMaxWidthOrHeight(origCanvas, options)\r\n\r\n incProgress()\r\n\r\n // exifOrientation\r\n const exifOrientation = options.exifOrientation || await getExifOrientation(file)\r\n incProgress()\r\n const orientationFixedCanvas = (await isAutoOrientationInBrowser()) ? maxWidthOrHeightFixedCanvas : followExifOrientation(maxWidthOrHeightFixedCanvas, exifOrientation)\r\n incProgress()\r\n\r\n let quality = options.initialQuality || 1.0\r\n\r\n const outputFileType = options.fileType || file.type\r\n\r\n let tempFile = await canvasToFile(orientationFixedCanvas, outputFileType, file.name, file.lastModified, quality)\r\n incProgress()\r\n\r\n const origExceedMaxSize = tempFile.size > maxSizeByte\r\n const sizeBecomeLarger = tempFile.size > file.size\r\n // console.log('original file size', file.size)\r\n // console.log('current file size', tempFile.size)\r\n\r\n // check if we need to compress or resize\r\n if (!origExceedMaxSize && !sizeBecomeLarger) {\r\n // no need to compress\r\n setProgress(100)\r\n return tempFile\r\n }\r\n\r\n const sourceSize = file.size\r\n const renderedSize = tempFile.size\r\n let currentSize = renderedSize\r\n let compressedFile\r\n let newCanvas, ctx\r\n let canvas = orientationFixedCanvas\r\n while (remainingTrials-- && (currentSize > maxSizeByte || currentSize > sourceSize)) {\r\n const newWidth = origExceedMaxSize ? canvas.width * 0.95 : canvas.width\r\n const newHeight = origExceedMaxSize ? canvas.height * 0.95 : canvas.height;\r\n // console.log('current width', newWidth);\r\n // console.log('current height', newHeight);\r\n [newCanvas, ctx] = getNewCanvasAndCtx(newWidth, newHeight)\r\n\r\n ctx.drawImage(canvas, 0, 0, newWidth, newHeight)\r\n\r\n quality *= 0.95\r\n compressedFile = await canvasToFile(newCanvas, outputFileType, file.name, file.lastModified, quality)\r\n\r\n cleanupCanvasMemory(canvas)\r\n\r\n canvas = newCanvas\r\n\r\n currentSize = compressedFile.size\r\n // console.log('currentSize', currentSize)\r\n setProgress(Math.min(99, Math.floor((renderedSize - currentSize) / (renderedSize - maxSizeByte) * 100)))\r\n }\r\n\r\n cleanupCanvasMemory(canvas)\r\n cleanupCanvasMemory(newCanvas)\r\n cleanupCanvasMemory(maxWidthOrHeightFixedCanvas)\r\n cleanupCanvasMemory(orientationFixedCanvas)\r\n cleanupCanvasMemory(origCanvas)\r\n\r\n setProgress(100)\r\n return compressedFile\r\n}\r\n","import lib from './index'\r\nimport compress from './image-compression'\r\nimport { cleanupCanvasMemory, getNewCanvasAndCtx } from './utils'\r\nimport UPNG from './UPNG'\r\nimport * as UZIP from 'uzip'\r\n\r\nlet cnt = 0\r\nlet imageCompressionLibUrl\r\nlet worker\r\n\r\nfunction createWorker (script) {\r\n if (typeof script === 'function') {\r\n script = `(${f})()`\r\n }\r\n return new Worker(URL.createObjectURL(new Blob([script])))\r\n}\r\n\r\nfunction createSourceObject (str) {\r\n // console.log('createSourceObject', str)\r\n return URL.createObjectURL(new Blob([str], { type: 'application/javascript' }))\r\n}\r\n\r\nfunction stringify(o) {\r\n return JSON.stringify(o, (key, value) => {\r\n return (typeof value === 'function' ) ? `BIC_FN:::(() => ${value.toString()})()` : value;\r\n })\r\n}\r\n\r\nfunction parse(o) {\r\n if (typeof o === 'string') return o\r\n const result = {}\r\n Object.entries(o).forEach(([key, value]) => {\r\n if (typeof value === 'string' && value.startsWith('BIC_FN:::')) {\r\n try {\r\n result[key] = eval(value.replace(/^BIC_FN:::/, ''))\r\n } catch (e) {\r\n console.log(key, e)\r\n throw e\r\n }\r\n } else {\r\n result[key] = parse(value)\r\n }\r\n })\r\n return result\r\n}\r\n\r\nfunction generateLib () {\r\n // prepare the lib to be used inside WebWorker\r\n return createSourceObject(`\r\n // reconstruct library\r\n function imageCompression (){return (${lib}).apply(null, arguments)}\r\n\r\n imageCompression.getDataUrlFromFile = ${lib.getDataUrlFromFile}\r\n imageCompression.getFilefromDataUrl = ${lib.getFilefromDataUrl}\r\n imageCompression.loadImage = ${lib.loadImage}\r\n imageCompression.drawImageInCanvas = ${lib.drawImageInCanvas}\r\n imageCompression.drawFileInCanvas = ${lib.drawFileInCanvas}\r\n imageCompression.canvasToFile = ${lib.canvasToFile}\r\n imageCompression.getExifOrientation = ${lib.getExifOrientation}\r\n imageCompression.handleMaxWidthOrHeight = ${lib.handleMaxWidthOrHeight}\r\n imageCompression.followExifOrientation = ${lib.followExifOrientation}\r\n imageCompression.cleanupCanvasMemory = ${lib.cleanupCanvasMemory}\r\n imageCompression.isAutoOrientationInBrowser = ${lib.isAutoOrientationInBrowser}\r\n\r\n // functions / objects\r\n getDataUrlFromFile = imageCompression.getDataUrlFromFile\r\n getFilefromDataUrl = imageCompression.getFilefromDataUrl\r\n loadImage = imageCompression.loadImage\r\n drawImageInCanvas = imageCompression.drawImageInCanvas\r\n drawFileInCanvas = imageCompression.drawFileInCanvas\r\n canvasToFile = imageCompression.canvasToFile\r\n getExifOrientation = imageCompression.getExifOrientation\r\n handleMaxWidthOrHeight = imageCompression.handleMaxWidthOrHeight\r\n followExifOrientation = imageCompression.followExifOrientation\r\n cleanupCanvasMemory = imageCompression.cleanupCanvasMemory\r\n isAutoOrientationInBrowser = imageCompression.isAutoOrientationInBrowser\r\n \r\n getNewCanvasAndCtx = ${getNewCanvasAndCtx}\r\n CustomFileReader = FileReader\r\n CustomFile = File\r\n function _slicedToArray(arr, n) { return arr }\r\n function _typeof(a) { return typeof a }\r\n function compress (){return (${compress}).apply(null, arguments)}\r\n\r\n // Libraries\r\n const parse = ${parse}\r\n const UPNG = {}\r\n UPNG.toRGBA8 = ${UPNG.toRGBA8}\r\n UPNG.toRGBA8.decodeImage = ${UPNG.toRGBA8.decodeImage}\r\n UPNG.decode = ${UPNG.decode}\r\n UPNG.decode._decompress = ${UPNG.decode._decompress}\r\n UPNG.decode._inflate = ${UPNG.decode._inflate}\r\n UPNG.decode._readInterlace = ${UPNG.decode._readInterlace}\r\n UPNG.decode._getBPP = ${UPNG.decode._getBPP} \r\n UPNG.decode._filterZero = ${UPNG.decode._filterZero}\r\n UPNG.decode._paeth = ${UPNG.decode._paeth}\r\n UPNG.decode._IHDR = ${UPNG.decode._IHDR}\r\n UPNG._bin = parse(${stringify(UPNG._bin)})\r\n UPNG._copyTile = ${UPNG._copyTile}\r\n UPNG.encode = ${UPNG.encode}\r\n UPNG.encodeLL = ${UPNG.encodeLL} \r\n UPNG.encode._main = ${UPNG.encode._main}\r\n UPNG.encode.compressPNG = ${UPNG.encode.compressPNG} \r\n UPNG.encode.compress = ${UPNG.encode.compress}\r\n UPNG.encode.framize = ${UPNG.encode.framize} \r\n UPNG.encode._updateFrame = ${UPNG.encode._updateFrame} \r\n UPNG.encode._prepareDiff = ${UPNG.encode._prepareDiff} \r\n UPNG.encode._filterZero = ${UPNG.encode._filterZero} \r\n UPNG.encode._filterLine = ${UPNG.encode._filterLine}\r\n UPNG.encode.concatRGBA = ${UPNG.encode.concatRGBA}\r\n UPNG.crc = parse(${stringify(UPNG.crc)})\r\n UPNG.crc.table = ( function() {\r\n var tab = new Uint32Array(256);\r\n for (var n=0; n<256; n++) {\r\n var c = n;\r\n for (var k=0; k<8; k++) {\r\n if (c & 1) c = 0xedb88320 ^ (c >>> 1);\r\n else c = c >>> 1;\r\n }\r\n tab[n] = c; }\r\n return tab; })()\r\n UPNG.quantize = ${UPNG.quantize} \r\n UPNG.quantize.getKDtree = ${UPNG.quantize.getKDtree} \r\n UPNG.quantize.getNearest = ${UPNG.quantize.getNearest} \r\n UPNG.quantize.planeDst = ${UPNG.quantize.planeDst} \r\n UPNG.quantize.dist = ${UPNG.quantize.dist} \r\n UPNG.quantize.splitPixels = ${UPNG.quantize.splitPixels} \r\n UPNG.quantize.vecDot = ${UPNG.quantize.vecDot} \r\n UPNG.quantize.stats = ${UPNG.quantize.stats} \r\n UPNG.quantize.estats = ${UPNG.quantize.estats}\r\n UPNG.M4 = parse(${stringify(UPNG.M4)})\r\n UPNG.encode.concatRGBA = ${UPNG.encode.concatRGBA}\r\n UPNG.inflateRaw=function(){\r\n var H={};H.H={};H.H.N=function(N,W){var R=Uint8Array,i=0,m=0,J=0,h=0,Q=0,X=0,u=0,w=0,d=0,v,C;\r\n if(N[0]==3&&N[1]==0)return W?W:new R(0);var V=H.H,n=V.b,A=V.e,l=V.R,M=V.n,I=V.A,e=V.Z,b=V.m,Z=W==null;\r\n if(Z)W=new R(N.length>>>2<<5);while(i==0){i=n(N,d,1);m=n(N,d+1,2);d+=3;if(m==0){if((d&7)!=0)d+=8-(d&7);\r\n var D=(d>>>3)+4,q=N[D-4]|N[D-3]<<8;if(Z)W=H.H.W(W,w+q);W.set(new R(N.buffer,N.byteOffset+D,q),w);d=D+q<<3;\r\n w+=q;continue}if(Z)W=H.H.W(W,w+(1<<17));if(m==1){v=b.J;C=b.h;X=(1<<9)-1;u=(1<<5)-1}if(m==2){J=A(N,d,5)+257;\r\n h=A(N,d+5,5)+1;Q=A(N,d+10,4)+4;d+=14;var E=d,j=1;for(var c=0;c<38;c+=2){b.Q[c]=0;b.Q[c+1]=0}for(var c=0;\r\n cj)j=K}d+=3*Q;M(b.Q,j);I(b.Q,j,b.u);v=b.w;C=b.d;\r\n d=l(b.u,(1<>>4;if(p>>>8==0){W[w++]=p}else if(p==256){break}else{var z=w+p-254;\r\n if(p>264){var _=b.q[p-257];z=w+(_>>>3)+A(N,d,_&7);d+=_&7}var $=C[e(N,d)&u];d+=$&15;var s=$>>>4,Y=b.c[s],a=(Y>>>4)+n(N,d,Y&15);\r\n d+=Y&15;while(w>>4;\r\n if(b<=15){A[I]=b;I++}else{var Z=0,m=0;if(b==16){m=3+l(V,n,2);n+=2;Z=A[I-1]}else if(b==17){m=3+l(V,n,3);\r\n n+=3}else if(b==18){m=11+l(V,n,7);n+=7}var J=I+m;while(I>>1;\r\n while(An)n=M;A++}while(A>1,I=N[l+1],e=M<<4|I,b=W-I,Z=N[l]<>>15-W;R[J]=e;Z++}}};H.H.l=function(N,W){var R=H.H.m.r,V=15-W;for(var n=0;n>>V}};H.H.M=function(N,W,R){R=R<<(W&7);var V=W>>>3;N[V]|=R;N[V+1]|=R>>>8};\r\n H.H.I=function(N,W,R){R=R<<(W&7);var V=W>>>3;N[V]|=R;N[V+1]|=R>>>8;N[V+2]|=R>>>16};H.H.e=function(N,W,R){return(N[W>>>3]|N[(W>>>3)+1]<<8)>>>(W&7)&(1<>>3]|N[(W>>>3)+1]<<8|N[(W>>>3)+2]<<16)>>>(W&7)&(1<>>3]|N[(W>>>3)+1]<<8|N[(W>>>3)+2]<<16)>>>(W&7)};\r\n H.H.i=function(N,W){return(N[W>>>3]|N[(W>>>3)+1]<<8|N[(W>>>3)+2]<<16|N[(W>>>3)+3]<<24)>>>(W&7)};H.H.m=function(){var N=Uint16Array,W=Uint32Array;\r\n return{K:new N(16),j:new N(16),X:[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],S:[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,999,999,999],T:[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0],q:new N(32),p:[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,65535,65535],z:[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0],c:new W(32),J:new N(512),_:[],h:new N(32),$:[],w:new N(32768),C:[],v:[],d:new N(32768),D:[],u:new N(512),Q:[],r:new N(1<<15),s:new W(286),Y:new W(30),a:new W(19),t:new W(15e3),k:new N(1<<16),g:new N(1<<15)}}();\r\n (function(){var N=H.H.m,W=1<<15;for(var R=0;R>>1|(V&1431655765)<<1;\r\n V=(V&3435973836)>>>2|(V&858993459)<<2;V=(V&4042322160)>>>4|(V&252645135)<<4;V=(V&4278255360)>>>8|(V&16711935)<<8;\r\n N.r[R]=(V>>>16|V<<16)>>>17}function n(A,l,M){while(l--!=0)A.push(0,M)}for(var R=0;R<32;R++){N.q[R]=N.S[R]<<3|N.T[R];\r\n N.c[R]=N.p[R]<<4|N.z[R]}n(N._,144,8);n(N._,255-143,9);n(N._,279-255,7);n(N._,287-279,8);H.H.n(N._,9);\r\n H.H.A(N._,9,N.J);H.H.l(N._,9);n(N.$,32,5);H.H.n(N.$,5);H.H.A(N.$,5,N.h);H.H.l(N.$,5);n(N.Q,19,0);n(N.C,286,0);\r\n n(N.D,30,0);n(N.v,320,0)}());return H.H.N}()\r\n \r\n const UZIP = {}\r\n UZIP[\"parse\"] = ${UZIP[\"parse\"]}\r\n UZIP._readLocal = ${UZIP._readLocal}\r\n UZIP.inflateRaw = ${UZIP.inflateRaw}\r\n UZIP.inflate = ${UZIP.inflate}\r\n UZIP.deflate = ${UZIP.deflate}\r\n UZIP.deflateRaw = ${UZIP.deflateRaw}\r\n UZIP.encode = ${UZIP.encode}\r\n UZIP._noNeed = ${UZIP._noNeed}\r\n UZIP._writeHeader = ${UZIP._writeHeader}\r\n UZIP.crc = parse(${stringify(UZIP.crc)})\r\n UZIP.crc.table = ( function() {\r\n var tab = new Uint32Array(256);\r\n for (var n=0; n<256; n++) {\r\n var c = n;\r\n for (var k=0; k<8; k++) {\r\n if (c & 1) c = 0xedb88320 ^ (c >>> 1);\r\n else c = c >>> 1;\r\n }\r\n tab[n] = c; }\r\n return tab; })()\r\n \r\n UZIP.adler = ${UZIP.adler}\r\n UZIP.bin = parse(${stringify(UZIP.bin)})\r\n UZIP.F = {}\r\n UZIP.F.deflateRaw = ${UZIP.F.deflateRaw}\r\n UZIP.F._bestMatch = ${UZIP.F._bestMatch}\r\n UZIP.F._howLong = ${UZIP.F._howLong}\r\n UZIP.F._hash = ${UZIP.F._hash}\r\n UZIP.saved = ${UZIP.saved}\r\n UZIP.F._writeBlock = ${UZIP.F._writeBlock}\r\n UZIP.F._copyExact = ${UZIP.F._copyExact}\r\n UZIP.F.getTrees = ${UZIP.F.getTrees}\r\n UZIP.F.getSecond = ${UZIP.F.getSecond}\r\n UZIP.F.nonZero = ${UZIP.F.nonZero}\r\n UZIP.F.contSize = ${UZIP.F.contSize}\r\n UZIP.F._codeTiny = ${UZIP.F._codeTiny} \r\n UZIP.F._lenCodes = ${UZIP.F._lenCodes} \r\n UZIP.F._hufTree = ${UZIP.F._hufTree} \r\n UZIP.F.setDepth = ${UZIP.F.setDepth} \r\n UZIP.F.restrictDepth = ${UZIP.F.restrictDepth}\r\n UZIP.F._goodIndex = ${UZIP.F._goodIndex} \r\n UZIP.F._writeLit = ${UZIP.F._writeLit} \r\n UZIP.F.inflate = ${UZIP.F.inflate} \r\n UZIP.F._check = ${UZIP.F._check} \r\n UZIP.F._decodeTiny = ${UZIP.F._decodeTiny} \r\n UZIP.F._copyOut = ${UZIP.F._copyOut} \r\n UZIP.F.makeCodes = ${UZIP.F.makeCodes} \r\n UZIP.F.codes2map = ${UZIP.F.codes2map} \r\n UZIP.F.revCodes = ${UZIP.F.revCodes} \r\n\r\n // used only in deflate\r\n UZIP.F._putsE = ${UZIP.F._putsE}\r\n UZIP.F._putsF = ${UZIP.F._putsF}\r\n \r\n UZIP.F._bitsE = ${UZIP.F._bitsE}\r\n UZIP.F._bitsF = ${UZIP.F._bitsF}\r\n\r\n UZIP.F._get17 = ${UZIP.F._get17}\r\n UZIP.F._get25 = ${UZIP.F._get25}\r\n UZIP.F.U = function(){\r\n var u16=Uint16Array, u32=Uint32Array;\r\n return {\r\n next_code : new u16(16),\r\n bl_count : new u16(16),\r\n ordr : [ 16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15 ],\r\n of0 : [3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,999,999,999],\r\n exb : [0,0,0,0,0,0,0, 0, 1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3, 4, 4, 4, 4, 5, 5, 5, 5, 0, 0, 0, 0],\r\n ldef : new u16(32),\r\n df0 : [1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577, 65535, 65535],\r\n dxb : [0,0,0,0,1,1,2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8, 9, 9, 10, 10, 11, 11, 12, 12, 13, 13, 0, 0],\r\n ddef : new u32(32),\r\n flmap: new u16( 512), fltree: [],\r\n fdmap: new u16( 32), fdtree: [],\r\n lmap : new u16(32768), ltree : [], ttree:[],\r\n dmap : new u16(32768), dtree : [],\r\n imap : new u16( 512), itree : [],\r\n //rev9 : new u16( 512)\r\n rev15: new u16(1<<15),\r\n lhst : new u32(286), dhst : new u32( 30), ihst : new u32(19),\r\n lits : new u32(15000),\r\n strt : new u16(1<<16),\r\n prev : new u16(1<<15)\r\n };\r\n } ();\r\n\r\n (function(){\r\n var U = UZIP.F.U;\r\n var len = 1<<15;\r\n for(var i=0; i>> 1) | ((x & 0x55555555) << 1));\r\n x = (((x & 0xcccccccc) >>> 2) | ((x & 0x33333333) << 2));\r\n x = (((x & 0xf0f0f0f0) >>> 4) | ((x & 0x0f0f0f0f) << 4));\r\n x = (((x & 0xff00ff00) >>> 8) | ((x & 0x00ff00ff) << 8));\r\n U.rev15[i] = (((x >>> 16) | (x << 16)))>>>17;\r\n }\r\n \r\n function pushV(tgt, n, sv) { while(n--!=0) tgt.push(0,sv); }\r\n \r\n for(var i=0; i<32; i++) { U.ldef[i]=(U.of0[i]<<3)|U.exb[i]; U.ddef[i]=(U.df0[i]<<4)|U.dxb[i]; }\r\n \r\n pushV(U.fltree, 144, 8); pushV(U.fltree, 255-143, 9); pushV(U.fltree, 279-255, 7); pushV(U.fltree,287-279,8);\r\n /*\r\n var i = 0;\r\n for(; i<=143; i++) U.fltree.push(0,8);\r\n for(; i<=255; i++) U.fltree.push(0,9);\r\n for(; i<=279; i++) U.fltree.push(0,7);\r\n for(; i<=287; i++) U.fltree.push(0,8);\r\n */\r\n UZIP.F.makeCodes(U.fltree, 9);\r\n UZIP.F.codes2map(U.fltree, 9, U.flmap);\r\n UZIP.F.revCodes (U.fltree, 9)\r\n \r\n pushV(U.fdtree,32,5);\r\n //for(i=0;i<32; i++) U.fdtree.push(0,5);\r\n UZIP.F.makeCodes(U.fdtree, 5);\r\n UZIP.F.codes2map(U.fdtree, 5, U.fdmap);\r\n UZIP.F.revCodes (U.fdtree, 5)\r\n \r\n pushV(U.itree,19,0); pushV(U.ltree,286,0); pushV(U.dtree,30,0); pushV(U.ttree,320,0);\r\n /*\r\n for(var i=0; i< 19; i++) U.itree.push(0,0);\r\n for(var i=0; i<286; i++) U.ltree.push(0,0);\r\n for(var i=0; i< 30; i++) U.dtree.push(0,0);\r\n for(var i=0; i<320; i++) U.ttree.push(0,0);\r\n */\r\n })()\r\n `)\r\n}\r\n\r\nfunction generateWorkerScript () {\r\n // code to be run in the WebWorker\r\n return createWorker(`\r\n let scriptImported = false\r\n self.addEventListener('message', async (e) => {\r\n const { file, id, imageCompressionLibUrl, options } = e.data\r\n options.onProgress = (progress) => self.postMessage({ progress, id })\r\n try {\r\n if (!scriptImported) {\r\n // console.log('[worker] importScripts', imageCompressionLibUrl)\r\n self.importScripts(imageCompressionLibUrl)\r\n scriptImported = true\r\n }\r\n // console.log('[worker] self', self)\r\n const compressedFile = await imageCompression(file, options)\r\n self.postMessage({ file: compressedFile, id })\r\n } catch (e) {\r\n // console.error('[worker] error', e)\r\n self.postMessage({ error: e.message + '\\\\n' + e.stack, id })\r\n }\r\n })\r\n `)\r\n}\r\n\r\nexport function compressOnWebWorker (file, options) {\r\n return new Promise(async (resolve, reject) => {\r\n let id = cnt++\r\n\r\n if (!imageCompressionLibUrl) {\r\n imageCompressionLibUrl = generateLib()\r\n }\r\n\r\n if (!worker) {\r\n worker = generateWorkerScript()\r\n }\r\n\r\n function handler (e) {\r\n if (e.data.id === id) {\r\n if (e.data.progress !== undefined) {\r\n options.onProgress(e.data.progress)\r\n return\r\n }\r\n worker.removeEventListener('message', handler)\r\n if (e.data.error) {\r\n reject(new Error(e.data.error))\r\n }\r\n resolve(e.data.file)\r\n }\r\n }\r\n\r\n worker.addEventListener('message', handler)\r\n worker.addEventListener('error', reject)\r\n\r\n worker.postMessage({\r\n file,\r\n id,\r\n imageCompressionLibUrl,\r\n options: { ...options, onProgress: undefined }\r\n })\r\n })\r\n}\r\n","import compress from './image-compression'\r\nimport {\r\n canvasToFile,\r\n drawFileInCanvas,\r\n drawImageInCanvas,\r\n getDataUrlFromFile,\r\n getFilefromDataUrl,\r\n loadImage,\r\n getExifOrientation,\r\n handleMaxWidthOrHeight,\r\n followExifOrientation,\r\n CustomFile,\r\n cleanupCanvasMemory,\r\n isAutoOrientationInBrowser\r\n} from './utils'\r\nimport { compressOnWebWorker } from './web-worker'\r\n\r\n/**\r\n * Compress an image file.\r\n *\r\n * @param {File} file\r\n * @param {Object} options - { maxSizeMB=Number.POSITIVE_INFINITY, maxWidthOrHeight, useWebWorker=false, maxIteration = 10, exifOrientation, fileType }\r\n * @param {number} [options.maxSizeMB=Number.POSITIVE_INFINITY]\r\n * @param {number} [options.maxWidthOrHeight=undefined]\r\n * @param {boolean} [options.useWebWorker=false]\r\n * @param {number} [options.maxIteration=10]\r\n * @param {number} [options.exifOrientation] - default to be the exif orientation from the image file\r\n * @param {Function} [options.onProgress] - a function takes one progress argument (progress from 0 to 100)\r\n * @param {string} [options.fileType] - default to be the original mime type from the image file\r\n * @returns {Promise}\r\n */\r\nasync function imageCompression (file, options) {\r\n\r\n let compressedFile\r\n let progress = 0\r\n let onProgress\r\n\r\n options.maxSizeMB = options.maxSizeMB || Number.POSITIVE_INFINITY\r\n const useWebWorker = typeof options.useWebWorker === 'boolean' ? options.useWebWorker : true\r\n delete options.useWebWorker\r\n onProgress = options.onProgress\r\n options.onProgress = (aProgress) => {\r\n progress = aProgress\r\n if (typeof onProgress === 'function') {\r\n onProgress(progress)\r\n }\r\n }\r\n\r\n if (!(file instanceof Blob || file instanceof CustomFile)) {\r\n throw new Error('The file given is not an instance of Blob or File')\r\n } else if (!/^image/.test(file.type)) {\r\n throw new Error('The file given is not an image')\r\n }\r\n\r\n // try run in web worker, fall back to run in main thread\r\n const inWebWorker = typeof WorkerGlobalScope !== 'undefined' && self instanceof WorkerGlobalScope\r\n\r\n // if ((useWebWorker && typeof Worker === 'function') || inWebWorker) {\r\n // console.log('run compression in web worker')\r\n // } else {\r\n // console.log('run compression in main thread')\r\n // }\r\n\r\n if (useWebWorker && typeof Worker === 'function' && !inWebWorker) {\r\n try {\r\n // console.log(1)\r\n // \"compressOnWebWorker\" is kind of like a recursion to call \"imageCompression\" again inside web worker\r\n compressedFile = await compressOnWebWorker(file, options)\r\n } catch (e) {\r\n // console.warn('Run compression in web worker failed:', e, ', fall back to main thread')\r\n // console.log(1.5)\r\n compressedFile = await compress(file, options)\r\n }\r\n } else {\r\n // console.log(2)\r\n compressedFile = await compress(file, options)\r\n }\r\n\r\n try {\r\n compressedFile.name = file.name\r\n compressedFile.lastModified = file.lastModified\r\n } catch (e) {}\r\n\r\n return compressedFile\r\n}\r\n\r\nimageCompression.getDataUrlFromFile = getDataUrlFromFile\r\nimageCompression.getFilefromDataUrl = getFilefromDataUrl\r\nimageCompression.loadImage = loadImage\r\nimageCompression.drawImageInCanvas = drawImageInCanvas\r\nimageCompression.drawFileInCanvas = drawFileInCanvas\r\nimageCompression.canvasToFile = canvasToFile\r\nimageCompression.getExifOrientation = getExifOrientation\r\n\r\nimageCompression.handleMaxWidthOrHeight = handleMaxWidthOrHeight\r\nimageCompression.followExifOrientation = followExifOrientation\r\nimageCompression.cleanupCanvasMemory = cleanupCanvasMemory\r\nimageCompression.isAutoOrientationInBrowser = isAutoOrientationInBrowser\r\nimageCompression.version = '1.0.14'\r\n\r\nexport default imageCompression\r\n"],"names":["UZIP","Uint8Array","eocd","rUi","cnu","csize","o","data","i","out","readUshort","cmpr","nlen","elen","file","inflate","inflateRaw","opts","buf","F","deflateRaw","crc","off","encode","noCmpr","wUi","obj","p","cpr","tot","ioff","t","usize","tab","k","c","table","b","end","eend","a","buff","l","s","strl","str","charCodeAt","code","ci","lvl","U","len","dlen","strt","prev","lc","_hash","cvrd","Math","min","lgi","lits","li","dst","dgi","pos","pi","dif","dlim","_howLong","td","j","ei","curd","length","MD","putsF","_putsF","BTYPE","_copyExact","o0","ltree","fltree","putsE","itree","qc","si","_writeLit","p8","_hufTree","ihst","dset","numh","ML","MH","numl","tree","set","nxt","nnxt","lz","MAXL","hst","tl","hl","list","push","l2","lit","i2","f","i0","d","restrictDepth","maxl","dps","dbt","_goodIndex","ch","u8","_bitsF","bitsE","noBuf","HLIT","_check","ordr","dmap","mx0","dtree","dlit","dcode","dbs","nbuf","lmap","_bitsE","n","mx","max_code","bl_count","MAX_BITS","next_code","rest","i1","r15","val","_putsE","dt","u16","x","tgt","sv","fdmap","pushV","h","w","img","frames","frm","rect","fw","fdata","blend","UPNG","_copyTile","frms","dispose","decode","_getBPP","ceil","ctype","qarea","area","ti","tr","ts","tb","y","s0","bpl","t0","qi","gr","to","type","dd","fr","_decompress","delay","fd","bin","readUint","tabs","offset","nz","slice","bfr","text","readUTF8","rUs","interlace","N","H","W","X","Q","v","M","S","I","_","A","q","D","R","V","Z","m","J","K","ri","pass","sh","sw","bpp","starting_row","starting_col","cdi","col","row","ii","depth","pa","pb","pc","_bin","ns","decodeURIComponent","sb","tw","oa","br","ioa","fg","bg","fa","nimg","bufs","dl","leng","cimg","plte","anim","width","wUs","_filterZero","prms","evenCrd","ilen","inds","nbufs","abuf","concatRGBA","cof","qres","img32","nw","cmc","alwaysBlend","it","mix","max","miy","may","sarea","tarea","nx","nh","ny","_prepareDiff","r","miX","miY","height","_updateFrame","cimg32","cy","ftry","fls","di","g","nd","planeDst","est","rgba","bst","root","ps","maxL","leafs","err","node","L","ln","quantize","estats","rn","left","mi","node1","getNearest","vecDot","e","m1","m2","m0","iN","M4","random","m3","Cov","sml","il","isBrowser","Date","now","result","reader","onerror","getFilefromDataUrl","resolve","dataUrl","split","arr","match","bstr","name","getImageData","fileName","tags","view","getUint16","little","canvas","maxWidthOrHeight","ctx","drawImage","newCanvas","getContext","drawFileInCanvas","cnt","imageCompressionLibUrl","script","parse","value","replace","createSourceObject","imageCompression","getDataUrlFromFile","loadImage","drawImageInCanvas","canvasToFile"],"mappings":"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"} \ No newline at end of file +{"version":3,"file":"browser-image-compression.js","sources":["../node_modules/core-js/internals/global.js","../node_modules/core-js/internals/is-pure.js","../node_modules/core-js/internals/set-global.js","../node_modules/core-js/internals/shared-store.js","../node_modules/core-js/internals/shared.js","../node_modules/core-js/internals/has.js","../node_modules/core-js/internals/uid.js","../node_modules/core-js/internals/get-built-in.js","../node_modules/core-js/internals/engine-v8-version.js","../node_modules/core-js/internals/fails.js","../node_modules/core-js/internals/well-known-symbol.js","../node_modules/core-js/internals/to-string-tag-support.js","../node_modules/core-js/internals/is-object.js","../node_modules/core-js/internals/document-create-element.js","../node_modules/core-js/internals/ie8-dom-define.js","../node_modules/core-js/internals/an-object.js","../node_modules/core-js/internals/is-symbol.js","../node_modules/core-js/internals/ordinary-to-primitive.js","../node_modules/core-js/internals/to-primitive.js","../node_modules/core-js/internals/object-define-property.js","../node_modules/core-js/internals/create-property-descriptor.js","../node_modules/core-js/internals/create-non-enumerable-property.js","../node_modules/core-js/internals/inspect-source.js","../node_modules/core-js/internals/native-weak-map.js","../node_modules/core-js/internals/hidden-keys.js","../node_modules/core-js/internals/internal-state.js","../node_modules/core-js/internals/redefine.js","../node_modules/core-js/internals/classof-raw.js","../node_modules/core-js/internals/classof.js","../node_modules/core-js/internals/object-property-is-enumerable.js","../node_modules/core-js/internals/indexed-object.js","../node_modules/core-js/internals/object-get-own-property-descriptor.js","../node_modules/core-js/internals/to-integer.js","../node_modules/core-js/internals/to-length.js","../node_modules/core-js/internals/to-absolute-index.js","../node_modules/core-js/internals/array-includes.js","../node_modules/core-js/internals/object-keys-internal.js","../node_modules/core-js/internals/copy-constructor-properties.js","../node_modules/core-js/internals/is-forced.js","../node_modules/core-js/internals/export.js","../node_modules/core-js/internals/redefine-all.js","../node_modules/core-js/internals/a-possible-prototype.js","../node_modules/core-js/internals/object-set-prototype-of.js","../node_modules/core-js/internals/set-to-string-tag.js","../node_modules/core-js/internals/set-species.js","../node_modules/core-js/internals/a-function.js","../node_modules/core-js/internals/an-instance.js","../node_modules/core-js/internals/iterators.js","../node_modules/core-js/internals/is-array-iterator-method.js","../node_modules/core-js/internals/function-bind-context.js","../node_modules/core-js/internals/get-iterator-method.js","../node_modules/core-js/internals/iterator-close.js","../node_modules/core-js/internals/iterate.js","../node_modules/core-js/internals/check-correctness-of-iteration.js","../node_modules/core-js/internals/species-constructor.js","../node_modules/core-js/internals/task.js","../node_modules/core-js/internals/microtask.js","../node_modules/core-js/internals/new-promise-capability.js","../node_modules/core-js/internals/promise-resolve.js","../node_modules/core-js/internals/host-report-errors.js","../node_modules/core-js/internals/perform.js","../node_modules/core-js/internals/engine-is-browser.js","../node_modules/core-js/modules/es.promise.js","../node_modules/core-js/internals/inherit-if-required.js","../node_modules/core-js/internals/object-create.js","../node_modules/core-js/internals/to-string.js","../node_modules/core-js/internals/string-trim.js","../node_modules/core-js/modules/es.number.constructor.js","../node_modules/core-js/modules/es.function.name.js","../node_modules/core-js/modules/es.global-this.js","../node_modules/core-js/internals/object-assign.js","../node_modules/core-js/internals/path.js","../node_modules/core-js/internals/regexp-sticky-helpers.js","../node_modules/core-js/internals/regexp-exec.js","../node_modules/core-js/modules/es.regexp.exec.js","../node_modules/core-js/internals/fix-regexp-well-known-symbol-logic.js","../node_modules/core-js/internals/string-multibyte.js","../node_modules/core-js/internals/advance-string-index.js","../node_modules/core-js/internals/regexp-exec-abstract.js","../node_modules/core-js/modules/es.string.split.js","../node_modules/core-js/modules/es.string.match.js","../node_modules/core-js/internals/add-to-unscopables.js","../node_modules/core-js/internals/correct-prototype-getter.js","../node_modules/core-js/internals/object-get-prototype-of.js","../node_modules/core-js/internals/iterators-core.js","../node_modules/core-js/internals/create-iterator-constructor.js","../node_modules/core-js/internals/define-iterator.js","../node_modules/core-js/modules/es.array.iterator.js","../node_modules/core-js/internals/array-buffer-native.js","../node_modules/core-js/internals/array-buffer-view-core.js","../node_modules/core-js/internals/typed-array-constructors-require-wrappers.js","../node_modules/core-js/internals/to-index.js","../node_modules/core-js/internals/ieee754.js","../node_modules/core-js/internals/array-fill.js","../node_modules/core-js/internals/array-buffer.js","../node_modules/core-js/internals/is-integer.js","../node_modules/core-js/internals/to-positive-integer.js","../node_modules/core-js/internals/to-offset.js","../node_modules/core-js/internals/typed-array-from.js","../node_modules/core-js/internals/array-species-constructor.js","../node_modules/core-js/internals/array-iteration.js","../node_modules/core-js/internals/typed-array-constructor.js","../node_modules/core-js/internals/array-copy-within.js","../node_modules/core-js/modules/es.typed-array.copy-within.js","../node_modules/core-js/modules/es.typed-array.every.js","../node_modules/core-js/modules/es.typed-array.fill.js","../node_modules/core-js/internals/array-from-constructor-and-list.js","../node_modules/core-js/internals/typed-array-species-constructor.js","../node_modules/core-js/modules/es.typed-array.filter.js","../node_modules/core-js/modules/es.typed-array.find.js","../node_modules/core-js/modules/es.typed-array.find-index.js","../node_modules/core-js/modules/es.typed-array.for-each.js","../node_modules/core-js/modules/es.typed-array.includes.js","../node_modules/core-js/modules/es.typed-array.index-of.js","../node_modules/core-js/modules/es.typed-array.iterator.js","../node_modules/core-js/modules/es.typed-array.join.js","../node_modules/core-js/internals/array-method-is-strict.js","../node_modules/core-js/internals/array-last-index-of.js","../node_modules/core-js/modules/es.typed-array.last-index-of.js","../node_modules/core-js/modules/es.typed-array.map.js","../node_modules/core-js/internals/array-reduce.js","../node_modules/core-js/modules/es.typed-array.reduce.js","../node_modules/core-js/modules/es.typed-array.reduce-right.js","../node_modules/core-js/modules/es.typed-array.reverse.js","../node_modules/core-js/modules/es.typed-array.set.js","../node_modules/core-js/modules/es.typed-array.slice.js","../node_modules/core-js/modules/es.typed-array.some.js","../node_modules/core-js/internals/array-sort.js","../node_modules/core-js/internals/engine-ff-version.js","../node_modules/core-js/modules/es.typed-array.sort.js","../node_modules/core-js/modules/es.typed-array.subarray.js","../node_modules/core-js/modules/es.typed-array.to-locale-string.js","../node_modules/core-js/modules/es.typed-array.to-string.js","../node_modules/core-js/internals/create-property.js","../node_modules/core-js/internals/array-method-has-species-support.js","../node_modules/core-js/modules/es.array.slice.js","../node_modules/core-js/modules/es.array.filter.js","../node_modules/core-js/modules/es.regexp.to-string.js","../node_modules/core-js/modules/es.array.sort.js","../node_modules/uzip/UZIP.js","../lib/UPNG.js","../lib/utils.js","../lib/image-compression.js","../node_modules/core-js/modules/es.string.iterator.js","../node_modules/core-js/modules/web.dom-collections.iterator.js","../node_modules/core-js/internals/native-url.js","../node_modules/core-js/internals/call-with-safe-iteration-closing.js","../node_modules/core-js/internals/array-from.js","../node_modules/core-js/internals/string-punycode-to-ascii.js","../node_modules/core-js/internals/get-iterator.js","../node_modules/core-js/modules/web.url-search-params.js","../node_modules/core-js/modules/web.url.js","../node_modules/core-js/internals/array-for-each.js","../node_modules/core-js/modules/web.dom-collections.for-each.js","../node_modules/core-js/internals/object-to-array.js","../node_modules/core-js/modules/es.object.entries.js","../node_modules/core-js/internals/not-a-regexp.js","../node_modules/core-js/modules/es.string.starts-with.js","../node_modules/core-js/internals/get-substitution.js","../node_modules/core-js/modules/es.string.replace.js","../node_modules/core-js/modules/es.array.concat.js","../lib/web-worker.js","../lib/index.js"],"sourcesContent":["var check = function (it) {\n return it && it.Math == Math && it;\n};\n\n// https://github.com/zloirock/core-js/issues/86#issuecomment-115759028\nmodule.exports =\n // eslint-disable-next-line es/no-global-this -- safe\n check(typeof globalThis == 'object' && globalThis) ||\n check(typeof window == 'object' && window) ||\n // eslint-disable-next-line no-restricted-globals -- safe\n check(typeof self == 'object' && self) ||\n check(typeof global == 'object' && global) ||\n // eslint-disable-next-line no-new-func -- fallback\n (function () { return this; })() || Function('return this')();\n","module.exports = false;\n","var global = require('../internals/global');\n\nmodule.exports = function (key, value) {\n try {\n // eslint-disable-next-line es/no-object-defineproperty -- safe\n Object.defineProperty(global, key, { value: value, configurable: true, writable: true });\n } catch (error) {\n global[key] = value;\n } return value;\n};\n","var global = require('../internals/global');\nvar setGlobal = require('../internals/set-global');\n\nvar SHARED = '__core-js_shared__';\nvar store = global[SHARED] || setGlobal(SHARED, {});\n\nmodule.exports = store;\n","var IS_PURE = require('../internals/is-pure');\nvar store = require('../internals/shared-store');\n\n(module.exports = function (key, value) {\n return store[key] || (store[key] = value !== undefined ? value : {});\n})('versions', []).push({\n version: '3.16.1',\n mode: IS_PURE ? 'pure' : 'global',\n copyright: '© 2021 Denis Pushkarev (zloirock.ru)'\n});\n","var toObject = require('../internals/to-object');\n\nvar hasOwnProperty = {}.hasOwnProperty;\n\nmodule.exports = Object.hasOwn || function hasOwn(it, key) {\n return hasOwnProperty.call(toObject(it), key);\n};\n","var id = 0;\nvar postfix = Math.random();\n\nmodule.exports = function (key) {\n return 'Symbol(' + String(key === undefined ? '' : key) + ')_' + (++id + postfix).toString(36);\n};\n","var global = require('../internals/global');\n\nvar aFunction = function (variable) {\n return typeof variable == 'function' ? variable : undefined;\n};\n\nmodule.exports = function (namespace, method) {\n return arguments.length < 2 ? aFunction(global[namespace]) : global[namespace] && global[namespace][method];\n};\n","var global = require('../internals/global');\nvar userAgent = require('../internals/engine-user-agent');\n\nvar process = global.process;\nvar Deno = global.Deno;\nvar versions = process && process.versions || Deno && Deno.version;\nvar v8 = versions && versions.v8;\nvar match, version;\n\nif (v8) {\n match = v8.split('.');\n version = match[0] < 4 ? 1 : match[0] + match[1];\n} else if (userAgent) {\n match = userAgent.match(/Edge\\/(\\d+)/);\n if (!match || match[1] >= 74) {\n match = userAgent.match(/Chrome\\/(\\d+)/);\n if (match) version = match[1];\n }\n}\n\nmodule.exports = version && +version;\n","module.exports = function (exec) {\n try {\n return !!exec();\n } catch (error) {\n return true;\n }\n};\n","var global = require('../internals/global');\nvar shared = require('../internals/shared');\nvar has = require('../internals/has');\nvar uid = require('../internals/uid');\nvar NATIVE_SYMBOL = require('../internals/native-symbol');\nvar USE_SYMBOL_AS_UID = require('../internals/use-symbol-as-uid');\n\nvar WellKnownSymbolsStore = shared('wks');\nvar Symbol = global.Symbol;\nvar createWellKnownSymbol = USE_SYMBOL_AS_UID ? Symbol : Symbol && Symbol.withoutSetter || uid;\n\nmodule.exports = function (name) {\n if (!has(WellKnownSymbolsStore, name) || !(NATIVE_SYMBOL || typeof WellKnownSymbolsStore[name] == 'string')) {\n if (NATIVE_SYMBOL && has(Symbol, name)) {\n WellKnownSymbolsStore[name] = Symbol[name];\n } else {\n WellKnownSymbolsStore[name] = createWellKnownSymbol('Symbol.' + name);\n }\n } return WellKnownSymbolsStore[name];\n};\n","var wellKnownSymbol = require('../internals/well-known-symbol');\n\nvar TO_STRING_TAG = wellKnownSymbol('toStringTag');\nvar test = {};\n\ntest[TO_STRING_TAG] = 'z';\n\nmodule.exports = String(test) === '[object z]';\n","module.exports = function (it) {\n return typeof it === 'object' ? it !== null : typeof it === 'function';\n};\n","var global = require('../internals/global');\nvar isObject = require('../internals/is-object');\n\nvar document = global.document;\n// typeof document.createElement is 'object' in old IE\nvar EXISTS = isObject(document) && isObject(document.createElement);\n\nmodule.exports = function (it) {\n return EXISTS ? document.createElement(it) : {};\n};\n","var DESCRIPTORS = require('../internals/descriptors');\nvar fails = require('../internals/fails');\nvar createElement = require('../internals/document-create-element');\n\n// Thank's IE8 for his funny defineProperty\nmodule.exports = !DESCRIPTORS && !fails(function () {\n // eslint-disable-next-line es/no-object-defineproperty -- requied for testing\n return Object.defineProperty(createElement('div'), 'a', {\n get: function () { return 7; }\n }).a != 7;\n});\n","var isObject = require('../internals/is-object');\n\nmodule.exports = function (it) {\n if (!isObject(it)) {\n throw TypeError(String(it) + ' is not an object');\n } return it;\n};\n","var getBuiltIn = require('../internals/get-built-in');\nvar USE_SYMBOL_AS_UID = require('../internals/use-symbol-as-uid');\n\nmodule.exports = USE_SYMBOL_AS_UID ? function (it) {\n return typeof it == 'symbol';\n} : function (it) {\n var $Symbol = getBuiltIn('Symbol');\n return typeof $Symbol == 'function' && Object(it) instanceof $Symbol;\n};\n","var isObject = require('../internals/is-object');\n\n// `OrdinaryToPrimitive` abstract operation\n// https://tc39.es/ecma262/#sec-ordinarytoprimitive\nmodule.exports = function (input, pref) {\n var fn, val;\n if (pref === 'string' && typeof (fn = input.toString) == 'function' && !isObject(val = fn.call(input))) return val;\n if (typeof (fn = input.valueOf) == 'function' && !isObject(val = fn.call(input))) return val;\n if (pref !== 'string' && typeof (fn = input.toString) == 'function' && !isObject(val = fn.call(input))) return val;\n throw TypeError(\"Can't convert object to primitive value\");\n};\n","var isObject = require('../internals/is-object');\nvar isSymbol = require('../internals/is-symbol');\nvar ordinaryToPrimitive = require('../internals/ordinary-to-primitive');\nvar wellKnownSymbol = require('../internals/well-known-symbol');\n\nvar TO_PRIMITIVE = wellKnownSymbol('toPrimitive');\n\n// `ToPrimitive` abstract operation\n// https://tc39.es/ecma262/#sec-toprimitive\nmodule.exports = function (input, pref) {\n if (!isObject(input) || isSymbol(input)) return input;\n var exoticToPrim = input[TO_PRIMITIVE];\n var result;\n if (exoticToPrim !== undefined) {\n if (pref === undefined) pref = 'default';\n result = exoticToPrim.call(input, pref);\n if (!isObject(result) || isSymbol(result)) return result;\n throw TypeError(\"Can't convert object to primitive value\");\n }\n if (pref === undefined) pref = 'number';\n return ordinaryToPrimitive(input, pref);\n};\n","var DESCRIPTORS = require('../internals/descriptors');\nvar IE8_DOM_DEFINE = require('../internals/ie8-dom-define');\nvar anObject = require('../internals/an-object');\nvar toPropertyKey = require('../internals/to-property-key');\n\n// eslint-disable-next-line es/no-object-defineproperty -- safe\nvar $defineProperty = Object.defineProperty;\n\n// `Object.defineProperty` method\n// https://tc39.es/ecma262/#sec-object.defineproperty\nexports.f = DESCRIPTORS ? $defineProperty : function defineProperty(O, P, Attributes) {\n anObject(O);\n P = toPropertyKey(P);\n anObject(Attributes);\n if (IE8_DOM_DEFINE) try {\n return $defineProperty(O, P, Attributes);\n } catch (error) { /* empty */ }\n if ('get' in Attributes || 'set' in Attributes) throw TypeError('Accessors not supported');\n if ('value' in Attributes) O[P] = Attributes.value;\n return O;\n};\n","module.exports = function (bitmap, value) {\n return {\n enumerable: !(bitmap & 1),\n configurable: !(bitmap & 2),\n writable: !(bitmap & 4),\n value: value\n };\n};\n","var DESCRIPTORS = require('../internals/descriptors');\nvar definePropertyModule = require('../internals/object-define-property');\nvar createPropertyDescriptor = require('../internals/create-property-descriptor');\n\nmodule.exports = DESCRIPTORS ? function (object, key, value) {\n return definePropertyModule.f(object, key, createPropertyDescriptor(1, value));\n} : function (object, key, value) {\n object[key] = value;\n return object;\n};\n","var store = require('../internals/shared-store');\n\nvar functionToString = Function.toString;\n\n// this helper broken in `core-js@3.4.1-3.4.4`, so we can't use `shared` helper\nif (typeof store.inspectSource != 'function') {\n store.inspectSource = function (it) {\n return functionToString.call(it);\n };\n}\n\nmodule.exports = store.inspectSource;\n","var global = require('../internals/global');\nvar inspectSource = require('../internals/inspect-source');\n\nvar WeakMap = global.WeakMap;\n\nmodule.exports = typeof WeakMap === 'function' && /native code/.test(inspectSource(WeakMap));\n","module.exports = {};\n","var NATIVE_WEAK_MAP = require('../internals/native-weak-map');\nvar global = require('../internals/global');\nvar isObject = require('../internals/is-object');\nvar createNonEnumerableProperty = require('../internals/create-non-enumerable-property');\nvar objectHas = require('../internals/has');\nvar shared = require('../internals/shared-store');\nvar sharedKey = require('../internals/shared-key');\nvar hiddenKeys = require('../internals/hidden-keys');\n\nvar OBJECT_ALREADY_INITIALIZED = 'Object already initialized';\nvar WeakMap = global.WeakMap;\nvar set, get, has;\n\nvar enforce = function (it) {\n return has(it) ? get(it) : set(it, {});\n};\n\nvar getterFor = function (TYPE) {\n return function (it) {\n var state;\n if (!isObject(it) || (state = get(it)).type !== TYPE) {\n throw TypeError('Incompatible receiver, ' + TYPE + ' required');\n } return state;\n };\n};\n\nif (NATIVE_WEAK_MAP || shared.state) {\n var store = shared.state || (shared.state = new WeakMap());\n var wmget = store.get;\n var wmhas = store.has;\n var wmset = store.set;\n set = function (it, metadata) {\n if (wmhas.call(store, it)) throw new TypeError(OBJECT_ALREADY_INITIALIZED);\n metadata.facade = it;\n wmset.call(store, it, metadata);\n return metadata;\n };\n get = function (it) {\n return wmget.call(store, it) || {};\n };\n has = function (it) {\n return wmhas.call(store, it);\n };\n} else {\n var STATE = sharedKey('state');\n hiddenKeys[STATE] = true;\n set = function (it, metadata) {\n if (objectHas(it, STATE)) throw new TypeError(OBJECT_ALREADY_INITIALIZED);\n metadata.facade = it;\n createNonEnumerableProperty(it, STATE, metadata);\n return metadata;\n };\n get = function (it) {\n return objectHas(it, STATE) ? it[STATE] : {};\n };\n has = function (it) {\n return objectHas(it, STATE);\n };\n}\n\nmodule.exports = {\n set: set,\n get: get,\n has: has,\n enforce: enforce,\n getterFor: getterFor\n};\n","var global = require('../internals/global');\nvar createNonEnumerableProperty = require('../internals/create-non-enumerable-property');\nvar has = require('../internals/has');\nvar setGlobal = require('../internals/set-global');\nvar inspectSource = require('../internals/inspect-source');\nvar InternalStateModule = require('../internals/internal-state');\n\nvar getInternalState = InternalStateModule.get;\nvar enforceInternalState = InternalStateModule.enforce;\nvar TEMPLATE = String(String).split('String');\n\n(module.exports = function (O, key, value, options) {\n var unsafe = options ? !!options.unsafe : false;\n var simple = options ? !!options.enumerable : false;\n var noTargetGet = options ? !!options.noTargetGet : false;\n var state;\n if (typeof value == 'function') {\n if (typeof key == 'string' && !has(value, 'name')) {\n createNonEnumerableProperty(value, 'name', key);\n }\n state = enforceInternalState(value);\n if (!state.source) {\n state.source = TEMPLATE.join(typeof key == 'string' ? key : '');\n }\n }\n if (O === global) {\n if (simple) O[key] = value;\n else setGlobal(key, value);\n return;\n } else if (!unsafe) {\n delete O[key];\n } else if (!noTargetGet && O[key]) {\n simple = true;\n }\n if (simple) O[key] = value;\n else createNonEnumerableProperty(O, key, value);\n// add fake Function#toString for correct work wrapped methods / constructors with methods like LoDash isNative\n})(Function.prototype, 'toString', function toString() {\n return typeof this == 'function' && getInternalState(this).source || inspectSource(this);\n});\n","var toString = {}.toString;\n\nmodule.exports = function (it) {\n return toString.call(it).slice(8, -1);\n};\n","var TO_STRING_TAG_SUPPORT = require('../internals/to-string-tag-support');\nvar classofRaw = require('../internals/classof-raw');\nvar wellKnownSymbol = require('../internals/well-known-symbol');\n\nvar TO_STRING_TAG = wellKnownSymbol('toStringTag');\n// ES3 wrong here\nvar CORRECT_ARGUMENTS = classofRaw(function () { return arguments; }()) == 'Arguments';\n\n// fallback for IE11 Script Access Denied error\nvar tryGet = function (it, key) {\n try {\n return it[key];\n } catch (error) { /* empty */ }\n};\n\n// getting tag from ES6+ `Object.prototype.toString`\nmodule.exports = TO_STRING_TAG_SUPPORT ? classofRaw : function (it) {\n var O, tag, result;\n return it === undefined ? 'Undefined' : it === null ? 'Null'\n // @@toStringTag case\n : typeof (tag = tryGet(O = Object(it), TO_STRING_TAG)) == 'string' ? tag\n // builtinTag case\n : CORRECT_ARGUMENTS ? classofRaw(O)\n // ES3 arguments fallback\n : (result = classofRaw(O)) == 'Object' && typeof O.callee == 'function' ? 'Arguments' : result;\n};\n","'use strict';\nvar $propertyIsEnumerable = {}.propertyIsEnumerable;\n// eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe\nvar getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;\n\n// Nashorn ~ JDK8 bug\nvar NASHORN_BUG = getOwnPropertyDescriptor && !$propertyIsEnumerable.call({ 1: 2 }, 1);\n\n// `Object.prototype.propertyIsEnumerable` method implementation\n// https://tc39.es/ecma262/#sec-object.prototype.propertyisenumerable\nexports.f = NASHORN_BUG ? function propertyIsEnumerable(V) {\n var descriptor = getOwnPropertyDescriptor(this, V);\n return !!descriptor && descriptor.enumerable;\n} : $propertyIsEnumerable;\n","var fails = require('../internals/fails');\nvar classof = require('../internals/classof-raw');\n\nvar split = ''.split;\n\n// fallback for non-array-like ES3 and non-enumerable old V8 strings\nmodule.exports = fails(function () {\n // throws an error in rhino, see https://github.com/mozilla/rhino/issues/346\n // eslint-disable-next-line no-prototype-builtins -- safe\n return !Object('z').propertyIsEnumerable(0);\n}) ? function (it) {\n return classof(it) == 'String' ? split.call(it, '') : Object(it);\n} : Object;\n","var DESCRIPTORS = require('../internals/descriptors');\nvar propertyIsEnumerableModule = require('../internals/object-property-is-enumerable');\nvar createPropertyDescriptor = require('../internals/create-property-descriptor');\nvar toIndexedObject = require('../internals/to-indexed-object');\nvar toPropertyKey = require('../internals/to-property-key');\nvar has = require('../internals/has');\nvar IE8_DOM_DEFINE = require('../internals/ie8-dom-define');\n\n// eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe\nvar $getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;\n\n// `Object.getOwnPropertyDescriptor` method\n// https://tc39.es/ecma262/#sec-object.getownpropertydescriptor\nexports.f = DESCRIPTORS ? $getOwnPropertyDescriptor : function getOwnPropertyDescriptor(O, P) {\n O = toIndexedObject(O);\n P = toPropertyKey(P);\n if (IE8_DOM_DEFINE) try {\n return $getOwnPropertyDescriptor(O, P);\n } catch (error) { /* empty */ }\n if (has(O, P)) return createPropertyDescriptor(!propertyIsEnumerableModule.f.call(O, P), O[P]);\n};\n","var ceil = Math.ceil;\nvar floor = Math.floor;\n\n// `ToInteger` abstract operation\n// https://tc39.es/ecma262/#sec-tointeger\nmodule.exports = function (argument) {\n return isNaN(argument = +argument) ? 0 : (argument > 0 ? floor : ceil)(argument);\n};\n","var toInteger = require('../internals/to-integer');\n\nvar min = Math.min;\n\n// `ToLength` abstract operation\n// https://tc39.es/ecma262/#sec-tolength\nmodule.exports = function (argument) {\n return argument > 0 ? min(toInteger(argument), 0x1FFFFFFFFFFFFF) : 0; // 2 ** 53 - 1 == 9007199254740991\n};\n","var toInteger = require('../internals/to-integer');\n\nvar max = Math.max;\nvar min = Math.min;\n\n// Helper for a popular repeating case of the spec:\n// Let integer be ? ToInteger(index).\n// If integer < 0, let result be max((length + integer), 0); else let result be min(integer, length).\nmodule.exports = function (index, length) {\n var integer = toInteger(index);\n return integer < 0 ? max(integer + length, 0) : min(integer, length);\n};\n","var toIndexedObject = require('../internals/to-indexed-object');\nvar toLength = require('../internals/to-length');\nvar toAbsoluteIndex = require('../internals/to-absolute-index');\n\n// `Array.prototype.{ indexOf, includes }` methods implementation\nvar createMethod = function (IS_INCLUDES) {\n return function ($this, el, fromIndex) {\n var O = toIndexedObject($this);\n var length = toLength(O.length);\n var index = toAbsoluteIndex(fromIndex, length);\n var value;\n // Array#includes uses SameValueZero equality algorithm\n // eslint-disable-next-line no-self-compare -- NaN check\n if (IS_INCLUDES && el != el) while (length > index) {\n value = O[index++];\n // eslint-disable-next-line no-self-compare -- NaN check\n if (value != value) return true;\n // Array#indexOf ignores holes, Array#includes - not\n } else for (;length > index; index++) {\n if ((IS_INCLUDES || index in O) && O[index] === el) return IS_INCLUDES || index || 0;\n } return !IS_INCLUDES && -1;\n };\n};\n\nmodule.exports = {\n // `Array.prototype.includes` method\n // https://tc39.es/ecma262/#sec-array.prototype.includes\n includes: createMethod(true),\n // `Array.prototype.indexOf` method\n // https://tc39.es/ecma262/#sec-array.prototype.indexof\n indexOf: createMethod(false)\n};\n","var has = require('../internals/has');\nvar toIndexedObject = require('../internals/to-indexed-object');\nvar indexOf = require('../internals/array-includes').indexOf;\nvar hiddenKeys = require('../internals/hidden-keys');\n\nmodule.exports = function (object, names) {\n var O = toIndexedObject(object);\n var i = 0;\n var result = [];\n var key;\n for (key in O) !has(hiddenKeys, key) && has(O, key) && result.push(key);\n // Don't enum bug & hidden keys\n while (names.length > i) if (has(O, key = names[i++])) {\n ~indexOf(result, key) || result.push(key);\n }\n return result;\n};\n","var has = require('../internals/has');\nvar ownKeys = require('../internals/own-keys');\nvar getOwnPropertyDescriptorModule = require('../internals/object-get-own-property-descriptor');\nvar definePropertyModule = require('../internals/object-define-property');\n\nmodule.exports = function (target, source) {\n var keys = ownKeys(source);\n var defineProperty = definePropertyModule.f;\n var getOwnPropertyDescriptor = getOwnPropertyDescriptorModule.f;\n for (var i = 0; i < keys.length; i++) {\n var key = keys[i];\n if (!has(target, key)) defineProperty(target, key, getOwnPropertyDescriptor(source, key));\n }\n};\n","var fails = require('../internals/fails');\n\nvar replacement = /#|\\.prototype\\./;\n\nvar isForced = function (feature, detection) {\n var value = data[normalize(feature)];\n return value == POLYFILL ? true\n : value == NATIVE ? false\n : typeof detection == 'function' ? fails(detection)\n : !!detection;\n};\n\nvar normalize = isForced.normalize = function (string) {\n return String(string).replace(replacement, '.').toLowerCase();\n};\n\nvar data = isForced.data = {};\nvar NATIVE = isForced.NATIVE = 'N';\nvar POLYFILL = isForced.POLYFILL = 'P';\n\nmodule.exports = isForced;\n","var global = require('../internals/global');\nvar getOwnPropertyDescriptor = require('../internals/object-get-own-property-descriptor').f;\nvar createNonEnumerableProperty = require('../internals/create-non-enumerable-property');\nvar redefine = require('../internals/redefine');\nvar setGlobal = require('../internals/set-global');\nvar copyConstructorProperties = require('../internals/copy-constructor-properties');\nvar isForced = require('../internals/is-forced');\n\n/*\n options.target - name of the target object\n options.global - target is the global object\n options.stat - export as static methods of target\n options.proto - export as prototype methods of target\n options.real - real prototype method for the `pure` version\n options.forced - export even if the native feature is available\n options.bind - bind methods to the target, required for the `pure` version\n options.wrap - wrap constructors to preventing global pollution, required for the `pure` version\n options.unsafe - use the simple assignment of property instead of delete + defineProperty\n options.sham - add a flag to not completely full polyfills\n options.enumerable - export as enumerable property\n options.noTargetGet - prevent calling a getter on target\n*/\nmodule.exports = function (options, source) {\n var TARGET = options.target;\n var GLOBAL = options.global;\n var STATIC = options.stat;\n var FORCED, target, key, targetProperty, sourceProperty, descriptor;\n if (GLOBAL) {\n target = global;\n } else if (STATIC) {\n target = global[TARGET] || setGlobal(TARGET, {});\n } else {\n target = (global[TARGET] || {}).prototype;\n }\n if (target) for (key in source) {\n sourceProperty = source[key];\n if (options.noTargetGet) {\n descriptor = getOwnPropertyDescriptor(target, key);\n targetProperty = descriptor && descriptor.value;\n } else targetProperty = target[key];\n FORCED = isForced(GLOBAL ? key : TARGET + (STATIC ? '.' : '#') + key, options.forced);\n // contained in target\n if (!FORCED && targetProperty !== undefined) {\n if (typeof sourceProperty === typeof targetProperty) continue;\n copyConstructorProperties(sourceProperty, targetProperty);\n }\n // add a flag to not completely full polyfills\n if (options.sham || (targetProperty && targetProperty.sham)) {\n createNonEnumerableProperty(sourceProperty, 'sham', true);\n }\n // extend global\n redefine(target, key, sourceProperty, options);\n }\n};\n","var redefine = require('../internals/redefine');\n\nmodule.exports = function (target, src, options) {\n for (var key in src) redefine(target, key, src[key], options);\n return target;\n};\n","var isObject = require('../internals/is-object');\n\nmodule.exports = function (it) {\n if (!isObject(it) && it !== null) {\n throw TypeError(\"Can't set \" + String(it) + ' as a prototype');\n } return it;\n};\n","/* eslint-disable no-proto -- safe */\nvar anObject = require('../internals/an-object');\nvar aPossiblePrototype = require('../internals/a-possible-prototype');\n\n// `Object.setPrototypeOf` method\n// https://tc39.es/ecma262/#sec-object.setprototypeof\n// Works with __proto__ only. Old v8 can't work with null proto objects.\n// eslint-disable-next-line es/no-object-setprototypeof -- safe\nmodule.exports = Object.setPrototypeOf || ('__proto__' in {} ? function () {\n var CORRECT_SETTER = false;\n var test = {};\n var setter;\n try {\n // eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe\n setter = Object.getOwnPropertyDescriptor(Object.prototype, '__proto__').set;\n setter.call(test, []);\n CORRECT_SETTER = test instanceof Array;\n } catch (error) { /* empty */ }\n return function setPrototypeOf(O, proto) {\n anObject(O);\n aPossiblePrototype(proto);\n if (CORRECT_SETTER) setter.call(O, proto);\n else O.__proto__ = proto;\n return O;\n };\n}() : undefined);\n","var defineProperty = require('../internals/object-define-property').f;\nvar has = require('../internals/has');\nvar wellKnownSymbol = require('../internals/well-known-symbol');\n\nvar TO_STRING_TAG = wellKnownSymbol('toStringTag');\n\nmodule.exports = function (it, TAG, STATIC) {\n if (it && !has(it = STATIC ? it : it.prototype, TO_STRING_TAG)) {\n defineProperty(it, TO_STRING_TAG, { configurable: true, value: TAG });\n }\n};\n","'use strict';\nvar getBuiltIn = require('../internals/get-built-in');\nvar definePropertyModule = require('../internals/object-define-property');\nvar wellKnownSymbol = require('../internals/well-known-symbol');\nvar DESCRIPTORS = require('../internals/descriptors');\n\nvar SPECIES = wellKnownSymbol('species');\n\nmodule.exports = function (CONSTRUCTOR_NAME) {\n var Constructor = getBuiltIn(CONSTRUCTOR_NAME);\n var defineProperty = definePropertyModule.f;\n\n if (DESCRIPTORS && Constructor && !Constructor[SPECIES]) {\n defineProperty(Constructor, SPECIES, {\n configurable: true,\n get: function () { return this; }\n });\n }\n};\n","module.exports = function (it) {\n if (typeof it != 'function') {\n throw TypeError(String(it) + ' is not a function');\n } return it;\n};\n","module.exports = function (it, Constructor, name) {\n if (!(it instanceof Constructor)) {\n throw TypeError('Incorrect ' + (name ? name + ' ' : '') + 'invocation');\n } return it;\n};\n","module.exports = {};\n","var wellKnownSymbol = require('../internals/well-known-symbol');\nvar Iterators = require('../internals/iterators');\n\nvar ITERATOR = wellKnownSymbol('iterator');\nvar ArrayPrototype = Array.prototype;\n\n// check on default Array iterator\nmodule.exports = function (it) {\n return it !== undefined && (Iterators.Array === it || ArrayPrototype[ITERATOR] === it);\n};\n","var aFunction = require('../internals/a-function');\n\n// optional / simple context binding\nmodule.exports = function (fn, that, length) {\n aFunction(fn);\n if (that === undefined) return fn;\n switch (length) {\n case 0: return function () {\n return fn.call(that);\n };\n case 1: return function (a) {\n return fn.call(that, a);\n };\n case 2: return function (a, b) {\n return fn.call(that, a, b);\n };\n case 3: return function (a, b, c) {\n return fn.call(that, a, b, c);\n };\n }\n return function (/* ...args */) {\n return fn.apply(that, arguments);\n };\n};\n","var classof = require('../internals/classof');\nvar Iterators = require('../internals/iterators');\nvar wellKnownSymbol = require('../internals/well-known-symbol');\n\nvar ITERATOR = wellKnownSymbol('iterator');\n\nmodule.exports = function (it) {\n if (it != undefined) return it[ITERATOR]\n || it['@@iterator']\n || Iterators[classof(it)];\n};\n","var anObject = require('../internals/an-object');\n\nmodule.exports = function (iterator) {\n var returnMethod = iterator['return'];\n if (returnMethod !== undefined) {\n return anObject(returnMethod.call(iterator)).value;\n }\n};\n","var anObject = require('../internals/an-object');\nvar isArrayIteratorMethod = require('../internals/is-array-iterator-method');\nvar toLength = require('../internals/to-length');\nvar bind = require('../internals/function-bind-context');\nvar getIteratorMethod = require('../internals/get-iterator-method');\nvar iteratorClose = require('../internals/iterator-close');\n\nvar Result = function (stopped, result) {\n this.stopped = stopped;\n this.result = result;\n};\n\nmodule.exports = function (iterable, unboundFunction, options) {\n var that = options && options.that;\n var AS_ENTRIES = !!(options && options.AS_ENTRIES);\n var IS_ITERATOR = !!(options && options.IS_ITERATOR);\n var INTERRUPTED = !!(options && options.INTERRUPTED);\n var fn = bind(unboundFunction, that, 1 + AS_ENTRIES + INTERRUPTED);\n var iterator, iterFn, index, length, result, next, step;\n\n var stop = function (condition) {\n if (iterator) iteratorClose(iterator);\n return new Result(true, condition);\n };\n\n var callFn = function (value) {\n if (AS_ENTRIES) {\n anObject(value);\n return INTERRUPTED ? fn(value[0], value[1], stop) : fn(value[0], value[1]);\n } return INTERRUPTED ? fn(value, stop) : fn(value);\n };\n\n if (IS_ITERATOR) {\n iterator = iterable;\n } else {\n iterFn = getIteratorMethod(iterable);\n if (typeof iterFn != 'function') throw TypeError('Target is not iterable');\n // optimisation for array iterators\n if (isArrayIteratorMethod(iterFn)) {\n for (index = 0, length = toLength(iterable.length); length > index; index++) {\n result = callFn(iterable[index]);\n if (result && result instanceof Result) return result;\n } return new Result(false);\n }\n iterator = iterFn.call(iterable);\n }\n\n next = iterator.next;\n while (!(step = next.call(iterator)).done) {\n try {\n result = callFn(step.value);\n } catch (error) {\n iteratorClose(iterator);\n throw error;\n }\n if (typeof result == 'object' && result && result instanceof Result) return result;\n } return new Result(false);\n};\n","var wellKnownSymbol = require('../internals/well-known-symbol');\n\nvar ITERATOR = wellKnownSymbol('iterator');\nvar SAFE_CLOSING = false;\n\ntry {\n var called = 0;\n var iteratorWithReturn = {\n next: function () {\n return { done: !!called++ };\n },\n 'return': function () {\n SAFE_CLOSING = true;\n }\n };\n iteratorWithReturn[ITERATOR] = function () {\n return this;\n };\n // eslint-disable-next-line es/no-array-from, no-throw-literal -- required for testing\n Array.from(iteratorWithReturn, function () { throw 2; });\n} catch (error) { /* empty */ }\n\nmodule.exports = function (exec, SKIP_CLOSING) {\n if (!SKIP_CLOSING && !SAFE_CLOSING) return false;\n var ITERATION_SUPPORT = false;\n try {\n var object = {};\n object[ITERATOR] = function () {\n return {\n next: function () {\n return { done: ITERATION_SUPPORT = true };\n }\n };\n };\n exec(object);\n } catch (error) { /* empty */ }\n return ITERATION_SUPPORT;\n};\n","var anObject = require('../internals/an-object');\nvar aFunction = require('../internals/a-function');\nvar wellKnownSymbol = require('../internals/well-known-symbol');\n\nvar SPECIES = wellKnownSymbol('species');\n\n// `SpeciesConstructor` abstract operation\n// https://tc39.es/ecma262/#sec-speciesconstructor\nmodule.exports = function (O, defaultConstructor) {\n var C = anObject(O).constructor;\n var S;\n return C === undefined || (S = anObject(C)[SPECIES]) == undefined ? defaultConstructor : aFunction(S);\n};\n","var global = require('../internals/global');\nvar fails = require('../internals/fails');\nvar bind = require('../internals/function-bind-context');\nvar html = require('../internals/html');\nvar createElement = require('../internals/document-create-element');\nvar IS_IOS = require('../internals/engine-is-ios');\nvar IS_NODE = require('../internals/engine-is-node');\n\nvar set = global.setImmediate;\nvar clear = global.clearImmediate;\nvar process = global.process;\nvar MessageChannel = global.MessageChannel;\nvar Dispatch = global.Dispatch;\nvar counter = 0;\nvar queue = {};\nvar ONREADYSTATECHANGE = 'onreadystatechange';\nvar location, defer, channel, port;\n\ntry {\n // Deno throws a ReferenceError on `location` access without `--location` flag\n location = global.location;\n} catch (error) { /* empty */ }\n\nvar run = function (id) {\n // eslint-disable-next-line no-prototype-builtins -- safe\n if (queue.hasOwnProperty(id)) {\n var fn = queue[id];\n delete queue[id];\n fn();\n }\n};\n\nvar runner = function (id) {\n return function () {\n run(id);\n };\n};\n\nvar listener = function (event) {\n run(event.data);\n};\n\nvar post = function (id) {\n // old engines have not location.origin\n global.postMessage(String(id), location.protocol + '//' + location.host);\n};\n\n// Node.js 0.9+ & IE10+ has setImmediate, otherwise:\nif (!set || !clear) {\n set = function setImmediate(fn) {\n var args = [];\n var argumentsLength = arguments.length;\n var i = 1;\n while (argumentsLength > i) args.push(arguments[i++]);\n queue[++counter] = function () {\n // eslint-disable-next-line no-new-func -- spec requirement\n (typeof fn == 'function' ? fn : Function(fn)).apply(undefined, args);\n };\n defer(counter);\n return counter;\n };\n clear = function clearImmediate(id) {\n delete queue[id];\n };\n // Node.js 0.8-\n if (IS_NODE) {\n defer = function (id) {\n process.nextTick(runner(id));\n };\n // Sphere (JS game engine) Dispatch API\n } else if (Dispatch && Dispatch.now) {\n defer = function (id) {\n Dispatch.now(runner(id));\n };\n // Browsers with MessageChannel, includes WebWorkers\n // except iOS - https://github.com/zloirock/core-js/issues/624\n } else if (MessageChannel && !IS_IOS) {\n channel = new MessageChannel();\n port = channel.port2;\n channel.port1.onmessage = listener;\n defer = bind(port.postMessage, port, 1);\n // Browsers with postMessage, skip WebWorkers\n // IE8 has postMessage, but it's sync & typeof its postMessage is 'object'\n } else if (\n global.addEventListener &&\n typeof postMessage == 'function' &&\n !global.importScripts &&\n location && location.protocol !== 'file:' &&\n !fails(post)\n ) {\n defer = post;\n global.addEventListener('message', listener, false);\n // IE8-\n } else if (ONREADYSTATECHANGE in createElement('script')) {\n defer = function (id) {\n html.appendChild(createElement('script'))[ONREADYSTATECHANGE] = function () {\n html.removeChild(this);\n run(id);\n };\n };\n // Rest old browsers\n } else {\n defer = function (id) {\n setTimeout(runner(id), 0);\n };\n }\n}\n\nmodule.exports = {\n set: set,\n clear: clear\n};\n","var global = require('../internals/global');\nvar getOwnPropertyDescriptor = require('../internals/object-get-own-property-descriptor').f;\nvar macrotask = require('../internals/task').set;\nvar IS_IOS = require('../internals/engine-is-ios');\nvar IS_IOS_PEBBLE = require('../internals/engine-is-ios-pebble');\nvar IS_WEBOS_WEBKIT = require('../internals/engine-is-webos-webkit');\nvar IS_NODE = require('../internals/engine-is-node');\n\nvar MutationObserver = global.MutationObserver || global.WebKitMutationObserver;\nvar document = global.document;\nvar process = global.process;\nvar Promise = global.Promise;\n// Node.js 11 shows ExperimentalWarning on getting `queueMicrotask`\nvar queueMicrotaskDescriptor = getOwnPropertyDescriptor(global, 'queueMicrotask');\nvar queueMicrotask = queueMicrotaskDescriptor && queueMicrotaskDescriptor.value;\n\nvar flush, head, last, notify, toggle, node, promise, then;\n\n// modern engines have queueMicrotask method\nif (!queueMicrotask) {\n flush = function () {\n var parent, fn;\n if (IS_NODE && (parent = process.domain)) parent.exit();\n while (head) {\n fn = head.fn;\n head = head.next;\n try {\n fn();\n } catch (error) {\n if (head) notify();\n else last = undefined;\n throw error;\n }\n } last = undefined;\n if (parent) parent.enter();\n };\n\n // browsers with MutationObserver, except iOS - https://github.com/zloirock/core-js/issues/339\n // also except WebOS Webkit https://github.com/zloirock/core-js/issues/898\n if (!IS_IOS && !IS_NODE && !IS_WEBOS_WEBKIT && MutationObserver && document) {\n toggle = true;\n node = document.createTextNode('');\n new MutationObserver(flush).observe(node, { characterData: true });\n notify = function () {\n node.data = toggle = !toggle;\n };\n // environments with maybe non-completely correct, but existent Promise\n } else if (!IS_IOS_PEBBLE && Promise && Promise.resolve) {\n // Promise.resolve without an argument throws an error in LG WebOS 2\n promise = Promise.resolve(undefined);\n // workaround of WebKit ~ iOS Safari 10.1 bug\n promise.constructor = Promise;\n then = promise.then;\n notify = function () {\n then.call(promise, flush);\n };\n // Node.js without promises\n } else if (IS_NODE) {\n notify = function () {\n process.nextTick(flush);\n };\n // for other environments - macrotask based on:\n // - setImmediate\n // - MessageChannel\n // - window.postMessag\n // - onreadystatechange\n // - setTimeout\n } else {\n notify = function () {\n // strange IE + webpack dev server bug - use .call(global)\n macrotask.call(global, flush);\n };\n }\n}\n\nmodule.exports = queueMicrotask || function (fn) {\n var task = { fn: fn, next: undefined };\n if (last) last.next = task;\n if (!head) {\n head = task;\n notify();\n } last = task;\n};\n","'use strict';\nvar aFunction = require('../internals/a-function');\n\nvar PromiseCapability = function (C) {\n var resolve, reject;\n this.promise = new C(function ($$resolve, $$reject) {\n if (resolve !== undefined || reject !== undefined) throw TypeError('Bad Promise constructor');\n resolve = $$resolve;\n reject = $$reject;\n });\n this.resolve = aFunction(resolve);\n this.reject = aFunction(reject);\n};\n\n// `NewPromiseCapability` abstract operation\n// https://tc39.es/ecma262/#sec-newpromisecapability\nmodule.exports.f = function (C) {\n return new PromiseCapability(C);\n};\n","var anObject = require('../internals/an-object');\nvar isObject = require('../internals/is-object');\nvar newPromiseCapability = require('../internals/new-promise-capability');\n\nmodule.exports = function (C, x) {\n anObject(C);\n if (isObject(x) && x.constructor === C) return x;\n var promiseCapability = newPromiseCapability.f(C);\n var resolve = promiseCapability.resolve;\n resolve(x);\n return promiseCapability.promise;\n};\n","var global = require('../internals/global');\n\nmodule.exports = function (a, b) {\n var console = global.console;\n if (console && console.error) {\n arguments.length === 1 ? console.error(a) : console.error(a, b);\n }\n};\n","module.exports = function (exec) {\n try {\n return { error: false, value: exec() };\n } catch (error) {\n return { error: true, value: error };\n }\n};\n","module.exports = typeof window == 'object';\n","'use strict';\nvar $ = require('../internals/export');\nvar IS_PURE = require('../internals/is-pure');\nvar global = require('../internals/global');\nvar getBuiltIn = require('../internals/get-built-in');\nvar NativePromise = require('../internals/native-promise-constructor');\nvar redefine = require('../internals/redefine');\nvar redefineAll = require('../internals/redefine-all');\nvar setPrototypeOf = require('../internals/object-set-prototype-of');\nvar setToStringTag = require('../internals/set-to-string-tag');\nvar setSpecies = require('../internals/set-species');\nvar isObject = require('../internals/is-object');\nvar aFunction = require('../internals/a-function');\nvar anInstance = require('../internals/an-instance');\nvar inspectSource = require('../internals/inspect-source');\nvar iterate = require('../internals/iterate');\nvar checkCorrectnessOfIteration = require('../internals/check-correctness-of-iteration');\nvar speciesConstructor = require('../internals/species-constructor');\nvar task = require('../internals/task').set;\nvar microtask = require('../internals/microtask');\nvar promiseResolve = require('../internals/promise-resolve');\nvar hostReportErrors = require('../internals/host-report-errors');\nvar newPromiseCapabilityModule = require('../internals/new-promise-capability');\nvar perform = require('../internals/perform');\nvar InternalStateModule = require('../internals/internal-state');\nvar isForced = require('../internals/is-forced');\nvar wellKnownSymbol = require('../internals/well-known-symbol');\nvar IS_BROWSER = require('../internals/engine-is-browser');\nvar IS_NODE = require('../internals/engine-is-node');\nvar V8_VERSION = require('../internals/engine-v8-version');\n\nvar SPECIES = wellKnownSymbol('species');\nvar PROMISE = 'Promise';\nvar getInternalState = InternalStateModule.get;\nvar setInternalState = InternalStateModule.set;\nvar getInternalPromiseState = InternalStateModule.getterFor(PROMISE);\nvar NativePromisePrototype = NativePromise && NativePromise.prototype;\nvar PromiseConstructor = NativePromise;\nvar PromiseConstructorPrototype = NativePromisePrototype;\nvar TypeError = global.TypeError;\nvar document = global.document;\nvar process = global.process;\nvar newPromiseCapability = newPromiseCapabilityModule.f;\nvar newGenericPromiseCapability = newPromiseCapability;\nvar DISPATCH_EVENT = !!(document && document.createEvent && global.dispatchEvent);\nvar NATIVE_REJECTION_EVENT = typeof PromiseRejectionEvent == 'function';\nvar UNHANDLED_REJECTION = 'unhandledrejection';\nvar REJECTION_HANDLED = 'rejectionhandled';\nvar PENDING = 0;\nvar FULFILLED = 1;\nvar REJECTED = 2;\nvar HANDLED = 1;\nvar UNHANDLED = 2;\nvar SUBCLASSING = false;\nvar Internal, OwnPromiseCapability, PromiseWrapper, nativeThen;\n\nvar FORCED = isForced(PROMISE, function () {\n var PROMISE_CONSTRUCTOR_SOURCE = inspectSource(PromiseConstructor);\n var GLOBAL_CORE_JS_PROMISE = PROMISE_CONSTRUCTOR_SOURCE !== String(PromiseConstructor);\n // V8 6.6 (Node 10 and Chrome 66) have a bug with resolving custom thenables\n // https://bugs.chromium.org/p/chromium/issues/detail?id=830565\n // We can't detect it synchronously, so just check versions\n if (!GLOBAL_CORE_JS_PROMISE && V8_VERSION === 66) return true;\n // We need Promise#finally in the pure version for preventing prototype pollution\n if (IS_PURE && !PromiseConstructorPrototype['finally']) return true;\n // We can't use @@species feature detection in V8 since it causes\n // deoptimization and performance degradation\n // https://github.com/zloirock/core-js/issues/679\n if (V8_VERSION >= 51 && /native code/.test(PROMISE_CONSTRUCTOR_SOURCE)) return false;\n // Detect correctness of subclassing with @@species support\n var promise = new PromiseConstructor(function (resolve) { resolve(1); });\n var FakePromise = function (exec) {\n exec(function () { /* empty */ }, function () { /* empty */ });\n };\n var constructor = promise.constructor = {};\n constructor[SPECIES] = FakePromise;\n SUBCLASSING = promise.then(function () { /* empty */ }) instanceof FakePromise;\n if (!SUBCLASSING) return true;\n // Unhandled rejections tracking support, NodeJS Promise without it fails @@species test\n return !GLOBAL_CORE_JS_PROMISE && IS_BROWSER && !NATIVE_REJECTION_EVENT;\n});\n\nvar INCORRECT_ITERATION = FORCED || !checkCorrectnessOfIteration(function (iterable) {\n PromiseConstructor.all(iterable)['catch'](function () { /* empty */ });\n});\n\n// helpers\nvar isThenable = function (it) {\n var then;\n return isObject(it) && typeof (then = it.then) == 'function' ? then : false;\n};\n\nvar notify = function (state, isReject) {\n if (state.notified) return;\n state.notified = true;\n var chain = state.reactions;\n microtask(function () {\n var value = state.value;\n var ok = state.state == FULFILLED;\n var index = 0;\n // variable length - can't use forEach\n while (chain.length > index) {\n var reaction = chain[index++];\n var handler = ok ? reaction.ok : reaction.fail;\n var resolve = reaction.resolve;\n var reject = reaction.reject;\n var domain = reaction.domain;\n var result, then, exited;\n try {\n if (handler) {\n if (!ok) {\n if (state.rejection === UNHANDLED) onHandleUnhandled(state);\n state.rejection = HANDLED;\n }\n if (handler === true) result = value;\n else {\n if (domain) domain.enter();\n result = handler(value); // can throw\n if (domain) {\n domain.exit();\n exited = true;\n }\n }\n if (result === reaction.promise) {\n reject(TypeError('Promise-chain cycle'));\n } else if (then = isThenable(result)) {\n then.call(result, resolve, reject);\n } else resolve(result);\n } else reject(value);\n } catch (error) {\n if (domain && !exited) domain.exit();\n reject(error);\n }\n }\n state.reactions = [];\n state.notified = false;\n if (isReject && !state.rejection) onUnhandled(state);\n });\n};\n\nvar dispatchEvent = function (name, promise, reason) {\n var event, handler;\n if (DISPATCH_EVENT) {\n event = document.createEvent('Event');\n event.promise = promise;\n event.reason = reason;\n event.initEvent(name, false, true);\n global.dispatchEvent(event);\n } else event = { promise: promise, reason: reason };\n if (!NATIVE_REJECTION_EVENT && (handler = global['on' + name])) handler(event);\n else if (name === UNHANDLED_REJECTION) hostReportErrors('Unhandled promise rejection', reason);\n};\n\nvar onUnhandled = function (state) {\n task.call(global, function () {\n var promise = state.facade;\n var value = state.value;\n var IS_UNHANDLED = isUnhandled(state);\n var result;\n if (IS_UNHANDLED) {\n result = perform(function () {\n if (IS_NODE) {\n process.emit('unhandledRejection', value, promise);\n } else dispatchEvent(UNHANDLED_REJECTION, promise, value);\n });\n // Browsers should not trigger `rejectionHandled` event if it was handled here, NodeJS - should\n state.rejection = IS_NODE || isUnhandled(state) ? UNHANDLED : HANDLED;\n if (result.error) throw result.value;\n }\n });\n};\n\nvar isUnhandled = function (state) {\n return state.rejection !== HANDLED && !state.parent;\n};\n\nvar onHandleUnhandled = function (state) {\n task.call(global, function () {\n var promise = state.facade;\n if (IS_NODE) {\n process.emit('rejectionHandled', promise);\n } else dispatchEvent(REJECTION_HANDLED, promise, state.value);\n });\n};\n\nvar bind = function (fn, state, unwrap) {\n return function (value) {\n fn(state, value, unwrap);\n };\n};\n\nvar internalReject = function (state, value, unwrap) {\n if (state.done) return;\n state.done = true;\n if (unwrap) state = unwrap;\n state.value = value;\n state.state = REJECTED;\n notify(state, true);\n};\n\nvar internalResolve = function (state, value, unwrap) {\n if (state.done) return;\n state.done = true;\n if (unwrap) state = unwrap;\n try {\n if (state.facade === value) throw TypeError(\"Promise can't be resolved itself\");\n var then = isThenable(value);\n if (then) {\n microtask(function () {\n var wrapper = { done: false };\n try {\n then.call(value,\n bind(internalResolve, wrapper, state),\n bind(internalReject, wrapper, state)\n );\n } catch (error) {\n internalReject(wrapper, error, state);\n }\n });\n } else {\n state.value = value;\n state.state = FULFILLED;\n notify(state, false);\n }\n } catch (error) {\n internalReject({ done: false }, error, state);\n }\n};\n\n// constructor polyfill\nif (FORCED) {\n // 25.4.3.1 Promise(executor)\n PromiseConstructor = function Promise(executor) {\n anInstance(this, PromiseConstructor, PROMISE);\n aFunction(executor);\n Internal.call(this);\n var state = getInternalState(this);\n try {\n executor(bind(internalResolve, state), bind(internalReject, state));\n } catch (error) {\n internalReject(state, error);\n }\n };\n PromiseConstructorPrototype = PromiseConstructor.prototype;\n // eslint-disable-next-line no-unused-vars -- required for `.length`\n Internal = function Promise(executor) {\n setInternalState(this, {\n type: PROMISE,\n done: false,\n notified: false,\n parent: false,\n reactions: [],\n rejection: false,\n state: PENDING,\n value: undefined\n });\n };\n Internal.prototype = redefineAll(PromiseConstructorPrototype, {\n // `Promise.prototype.then` method\n // https://tc39.es/ecma262/#sec-promise.prototype.then\n then: function then(onFulfilled, onRejected) {\n var state = getInternalPromiseState(this);\n var reaction = newPromiseCapability(speciesConstructor(this, PromiseConstructor));\n reaction.ok = typeof onFulfilled == 'function' ? onFulfilled : true;\n reaction.fail = typeof onRejected == 'function' && onRejected;\n reaction.domain = IS_NODE ? process.domain : undefined;\n state.parent = true;\n state.reactions.push(reaction);\n if (state.state != PENDING) notify(state, false);\n return reaction.promise;\n },\n // `Promise.prototype.catch` method\n // https://tc39.es/ecma262/#sec-promise.prototype.catch\n 'catch': function (onRejected) {\n return this.then(undefined, onRejected);\n }\n });\n OwnPromiseCapability = function () {\n var promise = new Internal();\n var state = getInternalState(promise);\n this.promise = promise;\n this.resolve = bind(internalResolve, state);\n this.reject = bind(internalReject, state);\n };\n newPromiseCapabilityModule.f = newPromiseCapability = function (C) {\n return C === PromiseConstructor || C === PromiseWrapper\n ? new OwnPromiseCapability(C)\n : newGenericPromiseCapability(C);\n };\n\n if (!IS_PURE && typeof NativePromise == 'function' && NativePromisePrototype !== Object.prototype) {\n nativeThen = NativePromisePrototype.then;\n\n if (!SUBCLASSING) {\n // make `Promise#then` return a polyfilled `Promise` for native promise-based APIs\n redefine(NativePromisePrototype, 'then', function then(onFulfilled, onRejected) {\n var that = this;\n return new PromiseConstructor(function (resolve, reject) {\n nativeThen.call(that, resolve, reject);\n }).then(onFulfilled, onRejected);\n // https://github.com/zloirock/core-js/issues/640\n }, { unsafe: true });\n\n // makes sure that native promise-based APIs `Promise#catch` properly works with patched `Promise#then`\n redefine(NativePromisePrototype, 'catch', PromiseConstructorPrototype['catch'], { unsafe: true });\n }\n\n // make `.constructor === Promise` work for native promise-based APIs\n try {\n delete NativePromisePrototype.constructor;\n } catch (error) { /* empty */ }\n\n // make `instanceof Promise` work for native promise-based APIs\n if (setPrototypeOf) {\n setPrototypeOf(NativePromisePrototype, PromiseConstructorPrototype);\n }\n }\n}\n\n$({ global: true, wrap: true, forced: FORCED }, {\n Promise: PromiseConstructor\n});\n\nsetToStringTag(PromiseConstructor, PROMISE, false, true);\nsetSpecies(PROMISE);\n\nPromiseWrapper = getBuiltIn(PROMISE);\n\n// statics\n$({ target: PROMISE, stat: true, forced: FORCED }, {\n // `Promise.reject` method\n // https://tc39.es/ecma262/#sec-promise.reject\n reject: function reject(r) {\n var capability = newPromiseCapability(this);\n capability.reject.call(undefined, r);\n return capability.promise;\n }\n});\n\n$({ target: PROMISE, stat: true, forced: IS_PURE || FORCED }, {\n // `Promise.resolve` method\n // https://tc39.es/ecma262/#sec-promise.resolve\n resolve: function resolve(x) {\n return promiseResolve(IS_PURE && this === PromiseWrapper ? PromiseConstructor : this, x);\n }\n});\n\n$({ target: PROMISE, stat: true, forced: INCORRECT_ITERATION }, {\n // `Promise.all` method\n // https://tc39.es/ecma262/#sec-promise.all\n all: function all(iterable) {\n var C = this;\n var capability = newPromiseCapability(C);\n var resolve = capability.resolve;\n var reject = capability.reject;\n var result = perform(function () {\n var $promiseResolve = aFunction(C.resolve);\n var values = [];\n var counter = 0;\n var remaining = 1;\n iterate(iterable, function (promise) {\n var index = counter++;\n var alreadyCalled = false;\n values.push(undefined);\n remaining++;\n $promiseResolve.call(C, promise).then(function (value) {\n if (alreadyCalled) return;\n alreadyCalled = true;\n values[index] = value;\n --remaining || resolve(values);\n }, reject);\n });\n --remaining || resolve(values);\n });\n if (result.error) reject(result.value);\n return capability.promise;\n },\n // `Promise.race` method\n // https://tc39.es/ecma262/#sec-promise.race\n race: function race(iterable) {\n var C = this;\n var capability = newPromiseCapability(C);\n var reject = capability.reject;\n var result = perform(function () {\n var $promiseResolve = aFunction(C.resolve);\n iterate(iterable, function (promise) {\n $promiseResolve.call(C, promise).then(capability.resolve, reject);\n });\n });\n if (result.error) reject(result.value);\n return capability.promise;\n }\n});\n","var isObject = require('../internals/is-object');\nvar setPrototypeOf = require('../internals/object-set-prototype-of');\n\n// makes subclassing work correct for wrapped built-ins\nmodule.exports = function ($this, dummy, Wrapper) {\n var NewTarget, NewTargetPrototype;\n if (\n // it can work only with native `setPrototypeOf`\n setPrototypeOf &&\n // we haven't completely correct pre-ES6 way for getting `new.target`, so use this\n typeof (NewTarget = dummy.constructor) == 'function' &&\n NewTarget !== Wrapper &&\n isObject(NewTargetPrototype = NewTarget.prototype) &&\n NewTargetPrototype !== Wrapper.prototype\n ) setPrototypeOf($this, NewTargetPrototype);\n return $this;\n};\n","/* global ActiveXObject -- old IE, WSH */\nvar anObject = require('../internals/an-object');\nvar defineProperties = require('../internals/object-define-properties');\nvar enumBugKeys = require('../internals/enum-bug-keys');\nvar hiddenKeys = require('../internals/hidden-keys');\nvar html = require('../internals/html');\nvar documentCreateElement = require('../internals/document-create-element');\nvar sharedKey = require('../internals/shared-key');\n\nvar GT = '>';\nvar LT = '<';\nvar PROTOTYPE = 'prototype';\nvar SCRIPT = 'script';\nvar IE_PROTO = sharedKey('IE_PROTO');\n\nvar EmptyConstructor = function () { /* empty */ };\n\nvar scriptTag = function (content) {\n return LT + SCRIPT + GT + content + LT + '/' + SCRIPT + GT;\n};\n\n// Create object with fake `null` prototype: use ActiveX Object with cleared prototype\nvar NullProtoObjectViaActiveX = function (activeXDocument) {\n activeXDocument.write(scriptTag(''));\n activeXDocument.close();\n var temp = activeXDocument.parentWindow.Object;\n activeXDocument = null; // avoid memory leak\n return temp;\n};\n\n// Create object with fake `null` prototype: use iframe Object with cleared prototype\nvar NullProtoObjectViaIFrame = function () {\n // Thrash, waste and sodomy: IE GC bug\n var iframe = documentCreateElement('iframe');\n var JS = 'java' + SCRIPT + ':';\n var iframeDocument;\n if (iframe.style) {\n iframe.style.display = 'none';\n html.appendChild(iframe);\n // https://github.com/zloirock/core-js/issues/475\n iframe.src = String(JS);\n iframeDocument = iframe.contentWindow.document;\n iframeDocument.open();\n iframeDocument.write(scriptTag('document.F=Object'));\n iframeDocument.close();\n return iframeDocument.F;\n }\n};\n\n// Check for document.domain and active x support\n// No need to use active x approach when document.domain is not set\n// see https://github.com/es-shims/es5-shim/issues/150\n// variation of https://github.com/kitcambridge/es5-shim/commit/4f738ac066346\n// avoid IE GC bug\nvar activeXDocument;\nvar NullProtoObject = function () {\n try {\n activeXDocument = new ActiveXObject('htmlfile');\n } catch (error) { /* ignore */ }\n NullProtoObject = document.domain && activeXDocument ?\n NullProtoObjectViaActiveX(activeXDocument) : // old IE\n NullProtoObjectViaIFrame() ||\n NullProtoObjectViaActiveX(activeXDocument); // WSH\n var length = enumBugKeys.length;\n while (length--) delete NullProtoObject[PROTOTYPE][enumBugKeys[length]];\n return NullProtoObject();\n};\n\nhiddenKeys[IE_PROTO] = true;\n\n// `Object.create` method\n// https://tc39.es/ecma262/#sec-object.create\nmodule.exports = Object.create || function create(O, Properties) {\n var result;\n if (O !== null) {\n EmptyConstructor[PROTOTYPE] = anObject(O);\n result = new EmptyConstructor();\n EmptyConstructor[PROTOTYPE] = null;\n // add \"__proto__\" for Object.getPrototypeOf polyfill\n result[IE_PROTO] = O;\n } else result = NullProtoObject();\n return Properties === undefined ? result : defineProperties(result, Properties);\n};\n","var isSymbol = require('../internals/is-symbol');\n\nmodule.exports = function (argument) {\n if (isSymbol(argument)) throw TypeError('Cannot convert a Symbol value to a string');\n return String(argument);\n};\n","var requireObjectCoercible = require('../internals/require-object-coercible');\nvar toString = require('../internals/to-string');\nvar whitespaces = require('../internals/whitespaces');\n\nvar whitespace = '[' + whitespaces + ']';\nvar ltrim = RegExp('^' + whitespace + whitespace + '*');\nvar rtrim = RegExp(whitespace + whitespace + '*$');\n\n// `String.prototype.{ trim, trimStart, trimEnd, trimLeft, trimRight }` methods implementation\nvar createMethod = function (TYPE) {\n return function ($this) {\n var string = toString(requireObjectCoercible($this));\n if (TYPE & 1) string = string.replace(ltrim, '');\n if (TYPE & 2) string = string.replace(rtrim, '');\n return string;\n };\n};\n\nmodule.exports = {\n // `String.prototype.{ trimLeft, trimStart }` methods\n // https://tc39.es/ecma262/#sec-string.prototype.trimstart\n start: createMethod(1),\n // `String.prototype.{ trimRight, trimEnd }` methods\n // https://tc39.es/ecma262/#sec-string.prototype.trimend\n end: createMethod(2),\n // `String.prototype.trim` method\n // https://tc39.es/ecma262/#sec-string.prototype.trim\n trim: createMethod(3)\n};\n","'use strict';\nvar DESCRIPTORS = require('../internals/descriptors');\nvar global = require('../internals/global');\nvar isForced = require('../internals/is-forced');\nvar redefine = require('../internals/redefine');\nvar has = require('../internals/has');\nvar classof = require('../internals/classof-raw');\nvar inheritIfRequired = require('../internals/inherit-if-required');\nvar isSymbol = require('../internals/is-symbol');\nvar toPrimitive = require('../internals/to-primitive');\nvar fails = require('../internals/fails');\nvar create = require('../internals/object-create');\nvar getOwnPropertyNames = require('../internals/object-get-own-property-names').f;\nvar getOwnPropertyDescriptor = require('../internals/object-get-own-property-descriptor').f;\nvar defineProperty = require('../internals/object-define-property').f;\nvar trim = require('../internals/string-trim').trim;\n\nvar NUMBER = 'Number';\nvar NativeNumber = global[NUMBER];\nvar NumberPrototype = NativeNumber.prototype;\n\n// Opera ~12 has broken Object#toString\nvar BROKEN_CLASSOF = classof(create(NumberPrototype)) == NUMBER;\n\n// `ToNumber` abstract operation\n// https://tc39.es/ecma262/#sec-tonumber\nvar toNumber = function (argument) {\n if (isSymbol(argument)) throw TypeError('Cannot convert a Symbol value to a number');\n var it = toPrimitive(argument, 'number');\n var first, third, radix, maxCode, digits, length, index, code;\n if (typeof it == 'string' && it.length > 2) {\n it = trim(it);\n first = it.charCodeAt(0);\n if (first === 43 || first === 45) {\n third = it.charCodeAt(2);\n if (third === 88 || third === 120) return NaN; // Number('+0x1') should be NaN, old V8 fix\n } else if (first === 48) {\n switch (it.charCodeAt(1)) {\n case 66: case 98: radix = 2; maxCode = 49; break; // fast equal of /^0b[01]+$/i\n case 79: case 111: radix = 8; maxCode = 55; break; // fast equal of /^0o[0-7]+$/i\n default: return +it;\n }\n digits = it.slice(2);\n length = digits.length;\n for (index = 0; index < length; index++) {\n code = digits.charCodeAt(index);\n // parseInt parses a string to a first unavailable symbol\n // but ToNumber should return NaN if a string contains unavailable symbols\n if (code < 48 || code > maxCode) return NaN;\n } return parseInt(digits, radix);\n }\n } return +it;\n};\n\n// `Number` constructor\n// https://tc39.es/ecma262/#sec-number-constructor\nif (isForced(NUMBER, !NativeNumber(' 0o1') || !NativeNumber('0b1') || NativeNumber('+0x1'))) {\n var NumberWrapper = function Number(value) {\n var it = arguments.length < 1 ? 0 : value;\n var dummy = this;\n return dummy instanceof NumberWrapper\n // check on 1..constructor(foo) case\n && (BROKEN_CLASSOF ? fails(function () { NumberPrototype.valueOf.call(dummy); }) : classof(dummy) != NUMBER)\n ? inheritIfRequired(new NativeNumber(toNumber(it)), dummy, NumberWrapper) : toNumber(it);\n };\n for (var keys = DESCRIPTORS ? getOwnPropertyNames(NativeNumber) : (\n // ES3:\n 'MAX_VALUE,MIN_VALUE,NaN,NEGATIVE_INFINITY,POSITIVE_INFINITY,' +\n // ES2015 (in case, if modules with ES2015 Number statics required before):\n 'EPSILON,isFinite,isInteger,isNaN,isSafeInteger,MAX_SAFE_INTEGER,' +\n 'MIN_SAFE_INTEGER,parseFloat,parseInt,isInteger,' +\n // ESNext\n 'fromString,range'\n ).split(','), j = 0, key; keys.length > j; j++) {\n if (has(NativeNumber, key = keys[j]) && !has(NumberWrapper, key)) {\n defineProperty(NumberWrapper, key, getOwnPropertyDescriptor(NativeNumber, key));\n }\n }\n NumberWrapper.prototype = NumberPrototype;\n NumberPrototype.constructor = NumberWrapper;\n redefine(global, NUMBER, NumberWrapper);\n}\n","var DESCRIPTORS = require('../internals/descriptors');\nvar defineProperty = require('../internals/object-define-property').f;\n\nvar FunctionPrototype = Function.prototype;\nvar FunctionPrototypeToString = FunctionPrototype.toString;\nvar nameRE = /^\\s*function ([^ (]*)/;\nvar NAME = 'name';\n\n// Function instances `.name` property\n// https://tc39.es/ecma262/#sec-function-instances-name\nif (DESCRIPTORS && !(NAME in FunctionPrototype)) {\n defineProperty(FunctionPrototype, NAME, {\n configurable: true,\n get: function () {\n try {\n return FunctionPrototypeToString.call(this).match(nameRE)[1];\n } catch (error) {\n return '';\n }\n }\n });\n}\n","var $ = require('../internals/export');\nvar global = require('../internals/global');\n\n// `globalThis` object\n// https://tc39.es/ecma262/#sec-globalthis\n$({ global: true }, {\n globalThis: global\n});\n","'use strict';\nvar DESCRIPTORS = require('../internals/descriptors');\nvar fails = require('../internals/fails');\nvar objectKeys = require('../internals/object-keys');\nvar getOwnPropertySymbolsModule = require('../internals/object-get-own-property-symbols');\nvar propertyIsEnumerableModule = require('../internals/object-property-is-enumerable');\nvar toObject = require('../internals/to-object');\nvar IndexedObject = require('../internals/indexed-object');\n\n// eslint-disable-next-line es/no-object-assign -- safe\nvar $assign = Object.assign;\n// eslint-disable-next-line es/no-object-defineproperty -- required for testing\nvar defineProperty = Object.defineProperty;\n\n// `Object.assign` method\n// https://tc39.es/ecma262/#sec-object.assign\nmodule.exports = !$assign || fails(function () {\n // should have correct order of operations (Edge bug)\n if (DESCRIPTORS && $assign({ b: 1 }, $assign(defineProperty({}, 'a', {\n enumerable: true,\n get: function () {\n defineProperty(this, 'b', {\n value: 3,\n enumerable: false\n });\n }\n }), { b: 2 })).b !== 1) return true;\n // should work with symbols and should have deterministic property order (V8 bug)\n var A = {};\n var B = {};\n // eslint-disable-next-line es/no-symbol -- safe\n var symbol = Symbol();\n var alphabet = 'abcdefghijklmnopqrst';\n A[symbol] = 7;\n alphabet.split('').forEach(function (chr) { B[chr] = chr; });\n return $assign({}, A)[symbol] != 7 || objectKeys($assign({}, B)).join('') != alphabet;\n}) ? function assign(target, source) { // eslint-disable-line no-unused-vars -- required for `.length`\n var T = toObject(target);\n var argumentsLength = arguments.length;\n var index = 1;\n var getOwnPropertySymbols = getOwnPropertySymbolsModule.f;\n var propertyIsEnumerable = propertyIsEnumerableModule.f;\n while (argumentsLength > index) {\n var S = IndexedObject(arguments[index++]);\n var keys = getOwnPropertySymbols ? objectKeys(S).concat(getOwnPropertySymbols(S)) : objectKeys(S);\n var length = keys.length;\n var j = 0;\n var key;\n while (length > j) {\n key = keys[j++];\n if (!DESCRIPTORS || propertyIsEnumerable.call(S, key)) T[key] = S[key];\n }\n } return T;\n} : $assign;\n","var global = require('../internals/global');\n\nmodule.exports = global;\n","var fails = require('../internals/fails');\n\n// babel-minify transpiles RegExp('a', 'y') -> /a/y and it causes SyntaxError,\nvar RE = function (s, f) {\n return RegExp(s, f);\n};\n\nexports.UNSUPPORTED_Y = fails(function () {\n var re = RE('a', 'y');\n re.lastIndex = 2;\n return re.exec('abcd') != null;\n});\n\nexports.BROKEN_CARET = fails(function () {\n // https://bugzilla.mozilla.org/show_bug.cgi?id=773687\n var re = RE('^r', 'gy');\n re.lastIndex = 2;\n return re.exec('str') != null;\n});\n","'use strict';\n/* eslint-disable regexp/no-assertion-capturing-group, regexp/no-empty-group, regexp/no-lazy-ends -- testing */\n/* eslint-disable regexp/no-useless-quantifier -- testing */\nvar toString = require('../internals/to-string');\nvar regexpFlags = require('../internals/regexp-flags');\nvar stickyHelpers = require('../internals/regexp-sticky-helpers');\nvar shared = require('../internals/shared');\nvar create = require('../internals/object-create');\nvar getInternalState = require('../internals/internal-state').get;\nvar UNSUPPORTED_DOT_ALL = require('../internals/regexp-unsupported-dot-all');\nvar UNSUPPORTED_NCG = require('../internals/regexp-unsupported-ncg');\n\nvar nativeExec = RegExp.prototype.exec;\nvar nativeReplace = shared('native-string-replace', String.prototype.replace);\n\nvar patchedExec = nativeExec;\n\nvar UPDATES_LAST_INDEX_WRONG = (function () {\n var re1 = /a/;\n var re2 = /b*/g;\n nativeExec.call(re1, 'a');\n nativeExec.call(re2, 'a');\n return re1.lastIndex !== 0 || re2.lastIndex !== 0;\n})();\n\nvar UNSUPPORTED_Y = stickyHelpers.UNSUPPORTED_Y || stickyHelpers.BROKEN_CARET;\n\n// nonparticipating capturing group, copied from es5-shim's String#split patch.\nvar NPCG_INCLUDED = /()??/.exec('')[1] !== undefined;\n\nvar PATCH = UPDATES_LAST_INDEX_WRONG || NPCG_INCLUDED || UNSUPPORTED_Y || UNSUPPORTED_DOT_ALL || UNSUPPORTED_NCG;\n\nif (PATCH) {\n // eslint-disable-next-line max-statements -- TODO\n patchedExec = function exec(string) {\n var re = this;\n var state = getInternalState(re);\n var str = toString(string);\n var raw = state.raw;\n var result, reCopy, lastIndex, match, i, object, group;\n\n if (raw) {\n raw.lastIndex = re.lastIndex;\n result = patchedExec.call(raw, str);\n re.lastIndex = raw.lastIndex;\n return result;\n }\n\n var groups = state.groups;\n var sticky = UNSUPPORTED_Y && re.sticky;\n var flags = regexpFlags.call(re);\n var source = re.source;\n var charsAdded = 0;\n var strCopy = str;\n\n if (sticky) {\n flags = flags.replace('y', '');\n if (flags.indexOf('g') === -1) {\n flags += 'g';\n }\n\n strCopy = str.slice(re.lastIndex);\n // Support anchored sticky behavior.\n if (re.lastIndex > 0 && (!re.multiline || re.multiline && str.charAt(re.lastIndex - 1) !== '\\n')) {\n source = '(?: ' + source + ')';\n strCopy = ' ' + strCopy;\n charsAdded++;\n }\n // ^(? + rx + ) is needed, in combination with some str slicing, to\n // simulate the 'y' flag.\n reCopy = new RegExp('^(?:' + source + ')', flags);\n }\n\n if (NPCG_INCLUDED) {\n reCopy = new RegExp('^' + source + '$(?!\\\\s)', flags);\n }\n if (UPDATES_LAST_INDEX_WRONG) lastIndex = re.lastIndex;\n\n match = nativeExec.call(sticky ? reCopy : re, strCopy);\n\n if (sticky) {\n if (match) {\n match.input = match.input.slice(charsAdded);\n match[0] = match[0].slice(charsAdded);\n match.index = re.lastIndex;\n re.lastIndex += match[0].length;\n } else re.lastIndex = 0;\n } else if (UPDATES_LAST_INDEX_WRONG && match) {\n re.lastIndex = re.global ? match.index + match[0].length : lastIndex;\n }\n if (NPCG_INCLUDED && match && match.length > 1) {\n // Fix browsers whose `exec` methods don't consistently return `undefined`\n // for NPCG, like IE8. NOTE: This doesn' work for /(.?)?/\n nativeReplace.call(match[0], reCopy, function () {\n for (i = 1; i < arguments.length - 2; i++) {\n if (arguments[i] === undefined) match[i] = undefined;\n }\n });\n }\n\n if (match && groups) {\n match.groups = object = create(null);\n for (i = 0; i < groups.length; i++) {\n group = groups[i];\n object[group[0]] = match[group[1]];\n }\n }\n\n return match;\n };\n}\n\nmodule.exports = patchedExec;\n","'use strict';\nvar $ = require('../internals/export');\nvar exec = require('../internals/regexp-exec');\n\n// `RegExp.prototype.exec` method\n// https://tc39.es/ecma262/#sec-regexp.prototype.exec\n$({ target: 'RegExp', proto: true, forced: /./.exec !== exec }, {\n exec: exec\n});\n","'use strict';\n// TODO: Remove from `core-js@4` since it's moved to entry points\nrequire('../modules/es.regexp.exec');\nvar redefine = require('../internals/redefine');\nvar regexpExec = require('../internals/regexp-exec');\nvar fails = require('../internals/fails');\nvar wellKnownSymbol = require('../internals/well-known-symbol');\nvar createNonEnumerableProperty = require('../internals/create-non-enumerable-property');\n\nvar SPECIES = wellKnownSymbol('species');\nvar RegExpPrototype = RegExp.prototype;\n\nmodule.exports = function (KEY, exec, FORCED, SHAM) {\n var SYMBOL = wellKnownSymbol(KEY);\n\n var DELEGATES_TO_SYMBOL = !fails(function () {\n // String methods call symbol-named RegEp methods\n var O = {};\n O[SYMBOL] = function () { return 7; };\n return ''[KEY](O) != 7;\n });\n\n var DELEGATES_TO_EXEC = DELEGATES_TO_SYMBOL && !fails(function () {\n // Symbol-named RegExp methods call .exec\n var execCalled = false;\n var re = /a/;\n\n if (KEY === 'split') {\n // We can't use real regex here since it causes deoptimization\n // and serious performance degradation in V8\n // https://github.com/zloirock/core-js/issues/306\n re = {};\n // RegExp[@@split] doesn't call the regex's exec method, but first creates\n // a new one. We need to return the patched regex when creating the new one.\n re.constructor = {};\n re.constructor[SPECIES] = function () { return re; };\n re.flags = '';\n re[SYMBOL] = /./[SYMBOL];\n }\n\n re.exec = function () { execCalled = true; return null; };\n\n re[SYMBOL]('');\n return !execCalled;\n });\n\n if (\n !DELEGATES_TO_SYMBOL ||\n !DELEGATES_TO_EXEC ||\n FORCED\n ) {\n var nativeRegExpMethod = /./[SYMBOL];\n var methods = exec(SYMBOL, ''[KEY], function (nativeMethod, regexp, str, arg2, forceStringMethod) {\n var $exec = regexp.exec;\n if ($exec === regexpExec || $exec === RegExpPrototype.exec) {\n if (DELEGATES_TO_SYMBOL && !forceStringMethod) {\n // The native String method already delegates to @@method (this\n // polyfilled function), leasing to infinite recursion.\n // We avoid it by directly calling the native @@method method.\n return { done: true, value: nativeRegExpMethod.call(regexp, str, arg2) };\n }\n return { done: true, value: nativeMethod.call(str, regexp, arg2) };\n }\n return { done: false };\n });\n\n redefine(String.prototype, KEY, methods[0]);\n redefine(RegExpPrototype, SYMBOL, methods[1]);\n }\n\n if (SHAM) createNonEnumerableProperty(RegExpPrototype[SYMBOL], 'sham', true);\n};\n","var toInteger = require('../internals/to-integer');\nvar toString = require('../internals/to-string');\nvar requireObjectCoercible = require('../internals/require-object-coercible');\n\n// `String.prototype.codePointAt` methods implementation\nvar createMethod = function (CONVERT_TO_STRING) {\n return function ($this, pos) {\n var S = toString(requireObjectCoercible($this));\n var position = toInteger(pos);\n var size = S.length;\n var first, second;\n if (position < 0 || position >= size) return CONVERT_TO_STRING ? '' : undefined;\n first = S.charCodeAt(position);\n return first < 0xD800 || first > 0xDBFF || position + 1 === size\n || (second = S.charCodeAt(position + 1)) < 0xDC00 || second > 0xDFFF\n ? CONVERT_TO_STRING ? S.charAt(position) : first\n : CONVERT_TO_STRING ? S.slice(position, position + 2) : (first - 0xD800 << 10) + (second - 0xDC00) + 0x10000;\n };\n};\n\nmodule.exports = {\n // `String.prototype.codePointAt` method\n // https://tc39.es/ecma262/#sec-string.prototype.codepointat\n codeAt: createMethod(false),\n // `String.prototype.at` method\n // https://github.com/mathiasbynens/String.prototype.at\n charAt: createMethod(true)\n};\n","'use strict';\nvar charAt = require('../internals/string-multibyte').charAt;\n\n// `AdvanceStringIndex` abstract operation\n// https://tc39.es/ecma262/#sec-advancestringindex\nmodule.exports = function (S, index, unicode) {\n return index + (unicode ? charAt(S, index).length : 1);\n};\n","var classof = require('./classof-raw');\nvar regexpExec = require('./regexp-exec');\n\n// `RegExpExec` abstract operation\n// https://tc39.es/ecma262/#sec-regexpexec\nmodule.exports = function (R, S) {\n var exec = R.exec;\n if (typeof exec === 'function') {\n var result = exec.call(R, S);\n if (typeof result !== 'object') {\n throw TypeError('RegExp exec method returned something other than an Object or null');\n }\n return result;\n }\n\n if (classof(R) !== 'RegExp') {\n throw TypeError('RegExp#exec called on incompatible receiver');\n }\n\n return regexpExec.call(R, S);\n};\n\n","'use strict';\nvar fixRegExpWellKnownSymbolLogic = require('../internals/fix-regexp-well-known-symbol-logic');\nvar isRegExp = require('../internals/is-regexp');\nvar anObject = require('../internals/an-object');\nvar requireObjectCoercible = require('../internals/require-object-coercible');\nvar speciesConstructor = require('../internals/species-constructor');\nvar advanceStringIndex = require('../internals/advance-string-index');\nvar toLength = require('../internals/to-length');\nvar toString = require('../internals/to-string');\nvar callRegExpExec = require('../internals/regexp-exec-abstract');\nvar regexpExec = require('../internals/regexp-exec');\nvar stickyHelpers = require('../internals/regexp-sticky-helpers');\nvar fails = require('../internals/fails');\n\nvar UNSUPPORTED_Y = stickyHelpers.UNSUPPORTED_Y;\nvar arrayPush = [].push;\nvar min = Math.min;\nvar MAX_UINT32 = 0xFFFFFFFF;\n\n// Chrome 51 has a buggy \"split\" implementation when RegExp#exec !== nativeExec\n// Weex JS has frozen built-in prototypes, so use try / catch wrapper\nvar SPLIT_WORKS_WITH_OVERWRITTEN_EXEC = !fails(function () {\n // eslint-disable-next-line regexp/no-empty-group -- required for testing\n var re = /(?:)/;\n var originalExec = re.exec;\n re.exec = function () { return originalExec.apply(this, arguments); };\n var result = 'ab'.split(re);\n return result.length !== 2 || result[0] !== 'a' || result[1] !== 'b';\n});\n\n// @@split logic\nfixRegExpWellKnownSymbolLogic('split', function (SPLIT, nativeSplit, maybeCallNative) {\n var internalSplit;\n if (\n 'abbc'.split(/(b)*/)[1] == 'c' ||\n // eslint-disable-next-line regexp/no-empty-group -- required for testing\n 'test'.split(/(?:)/, -1).length != 4 ||\n 'ab'.split(/(?:ab)*/).length != 2 ||\n '.'.split(/(.?)(.?)/).length != 4 ||\n // eslint-disable-next-line regexp/no-assertion-capturing-group, regexp/no-empty-group -- required for testing\n '.'.split(/()()/).length > 1 ||\n ''.split(/.?/).length\n ) {\n // based on es5-shim implementation, need to rework it\n internalSplit = function (separator, limit) {\n var string = toString(requireObjectCoercible(this));\n var lim = limit === undefined ? MAX_UINT32 : limit >>> 0;\n if (lim === 0) return [];\n if (separator === undefined) return [string];\n // If `separator` is not a regex, use native split\n if (!isRegExp(separator)) {\n return nativeSplit.call(string, separator, lim);\n }\n var output = [];\n var flags = (separator.ignoreCase ? 'i' : '') +\n (separator.multiline ? 'm' : '') +\n (separator.unicode ? 'u' : '') +\n (separator.sticky ? 'y' : '');\n var lastLastIndex = 0;\n // Make `global` and avoid `lastIndex` issues by working with a copy\n var separatorCopy = new RegExp(separator.source, flags + 'g');\n var match, lastIndex, lastLength;\n while (match = regexpExec.call(separatorCopy, string)) {\n lastIndex = separatorCopy.lastIndex;\n if (lastIndex > lastLastIndex) {\n output.push(string.slice(lastLastIndex, match.index));\n if (match.length > 1 && match.index < string.length) arrayPush.apply(output, match.slice(1));\n lastLength = match[0].length;\n lastLastIndex = lastIndex;\n if (output.length >= lim) break;\n }\n if (separatorCopy.lastIndex === match.index) separatorCopy.lastIndex++; // Avoid an infinite loop\n }\n if (lastLastIndex === string.length) {\n if (lastLength || !separatorCopy.test('')) output.push('');\n } else output.push(string.slice(lastLastIndex));\n return output.length > lim ? output.slice(0, lim) : output;\n };\n // Chakra, V8\n } else if ('0'.split(undefined, 0).length) {\n internalSplit = function (separator, limit) {\n return separator === undefined && limit === 0 ? [] : nativeSplit.call(this, separator, limit);\n };\n } else internalSplit = nativeSplit;\n\n return [\n // `String.prototype.split` method\n // https://tc39.es/ecma262/#sec-string.prototype.split\n function split(separator, limit) {\n var O = requireObjectCoercible(this);\n var splitter = separator == undefined ? undefined : separator[SPLIT];\n return splitter !== undefined\n ? splitter.call(separator, O, limit)\n : internalSplit.call(toString(O), separator, limit);\n },\n // `RegExp.prototype[@@split]` method\n // https://tc39.es/ecma262/#sec-regexp.prototype-@@split\n //\n // NOTE: This cannot be properly polyfilled in engines that don't support\n // the 'y' flag.\n function (string, limit) {\n var rx = anObject(this);\n var S = toString(string);\n var res = maybeCallNative(internalSplit, rx, S, limit, internalSplit !== nativeSplit);\n\n if (res.done) return res.value;\n\n var C = speciesConstructor(rx, RegExp);\n\n var unicodeMatching = rx.unicode;\n var flags = (rx.ignoreCase ? 'i' : '') +\n (rx.multiline ? 'm' : '') +\n (rx.unicode ? 'u' : '') +\n (UNSUPPORTED_Y ? 'g' : 'y');\n\n // ^(? + rx + ) is needed, in combination with some S slicing, to\n // simulate the 'y' flag.\n var splitter = new C(UNSUPPORTED_Y ? '^(?:' + rx.source + ')' : rx, flags);\n var lim = limit === undefined ? MAX_UINT32 : limit >>> 0;\n if (lim === 0) return [];\n if (S.length === 0) return callRegExpExec(splitter, S) === null ? [S] : [];\n var p = 0;\n var q = 0;\n var A = [];\n while (q < S.length) {\n splitter.lastIndex = UNSUPPORTED_Y ? 0 : q;\n var z = callRegExpExec(splitter, UNSUPPORTED_Y ? S.slice(q) : S);\n var e;\n if (\n z === null ||\n (e = min(toLength(splitter.lastIndex + (UNSUPPORTED_Y ? q : 0)), S.length)) === p\n ) {\n q = advanceStringIndex(S, q, unicodeMatching);\n } else {\n A.push(S.slice(p, q));\n if (A.length === lim) return A;\n for (var i = 1; i <= z.length - 1; i++) {\n A.push(z[i]);\n if (A.length === lim) return A;\n }\n q = p = e;\n }\n }\n A.push(S.slice(p));\n return A;\n }\n ];\n}, !SPLIT_WORKS_WITH_OVERWRITTEN_EXEC, UNSUPPORTED_Y);\n","'use strict';\nvar fixRegExpWellKnownSymbolLogic = require('../internals/fix-regexp-well-known-symbol-logic');\nvar anObject = require('../internals/an-object');\nvar toLength = require('../internals/to-length');\nvar toString = require('../internals/to-string');\nvar requireObjectCoercible = require('../internals/require-object-coercible');\nvar advanceStringIndex = require('../internals/advance-string-index');\nvar regExpExec = require('../internals/regexp-exec-abstract');\n\n// @@match logic\nfixRegExpWellKnownSymbolLogic('match', function (MATCH, nativeMatch, maybeCallNative) {\n return [\n // `String.prototype.match` method\n // https://tc39.es/ecma262/#sec-string.prototype.match\n function match(regexp) {\n var O = requireObjectCoercible(this);\n var matcher = regexp == undefined ? undefined : regexp[MATCH];\n return matcher !== undefined ? matcher.call(regexp, O) : new RegExp(regexp)[MATCH](toString(O));\n },\n // `RegExp.prototype[@@match]` method\n // https://tc39.es/ecma262/#sec-regexp.prototype-@@match\n function (string) {\n var rx = anObject(this);\n var S = toString(string);\n var res = maybeCallNative(nativeMatch, rx, S);\n\n if (res.done) return res.value;\n\n if (!rx.global) return regExpExec(rx, S);\n\n var fullUnicode = rx.unicode;\n rx.lastIndex = 0;\n var A = [];\n var n = 0;\n var result;\n while ((result = regExpExec(rx, S)) !== null) {\n var matchStr = toString(result[0]);\n A[n] = matchStr;\n if (matchStr === '') rx.lastIndex = advanceStringIndex(S, toLength(rx.lastIndex), fullUnicode);\n n++;\n }\n return n === 0 ? null : A;\n }\n ];\n});\n","var wellKnownSymbol = require('../internals/well-known-symbol');\nvar create = require('../internals/object-create');\nvar definePropertyModule = require('../internals/object-define-property');\n\nvar UNSCOPABLES = wellKnownSymbol('unscopables');\nvar ArrayPrototype = Array.prototype;\n\n// Array.prototype[@@unscopables]\n// https://tc39.es/ecma262/#sec-array.prototype-@@unscopables\nif (ArrayPrototype[UNSCOPABLES] == undefined) {\n definePropertyModule.f(ArrayPrototype, UNSCOPABLES, {\n configurable: true,\n value: create(null)\n });\n}\n\n// add a key to Array.prototype[@@unscopables]\nmodule.exports = function (key) {\n ArrayPrototype[UNSCOPABLES][key] = true;\n};\n","var fails = require('../internals/fails');\n\nmodule.exports = !fails(function () {\n function F() { /* empty */ }\n F.prototype.constructor = null;\n // eslint-disable-next-line es/no-object-getprototypeof -- required for testing\n return Object.getPrototypeOf(new F()) !== F.prototype;\n});\n","var has = require('../internals/has');\nvar toObject = require('../internals/to-object');\nvar sharedKey = require('../internals/shared-key');\nvar CORRECT_PROTOTYPE_GETTER = require('../internals/correct-prototype-getter');\n\nvar IE_PROTO = sharedKey('IE_PROTO');\nvar ObjectPrototype = Object.prototype;\n\n// `Object.getPrototypeOf` method\n// https://tc39.es/ecma262/#sec-object.getprototypeof\n// eslint-disable-next-line es/no-object-getprototypeof -- safe\nmodule.exports = CORRECT_PROTOTYPE_GETTER ? Object.getPrototypeOf : function (O) {\n O = toObject(O);\n if (has(O, IE_PROTO)) return O[IE_PROTO];\n if (typeof O.constructor == 'function' && O instanceof O.constructor) {\n return O.constructor.prototype;\n } return O instanceof Object ? ObjectPrototype : null;\n};\n","'use strict';\nvar fails = require('../internals/fails');\nvar getPrototypeOf = require('../internals/object-get-prototype-of');\nvar createNonEnumerableProperty = require('../internals/create-non-enumerable-property');\nvar has = require('../internals/has');\nvar wellKnownSymbol = require('../internals/well-known-symbol');\nvar IS_PURE = require('../internals/is-pure');\n\nvar ITERATOR = wellKnownSymbol('iterator');\nvar BUGGY_SAFARI_ITERATORS = false;\n\nvar returnThis = function () { return this; };\n\n// `%IteratorPrototype%` object\n// https://tc39.es/ecma262/#sec-%iteratorprototype%-object\nvar IteratorPrototype, PrototypeOfArrayIteratorPrototype, arrayIterator;\n\n/* eslint-disable es/no-array-prototype-keys -- safe */\nif ([].keys) {\n arrayIterator = [].keys();\n // Safari 8 has buggy iterators w/o `next`\n if (!('next' in arrayIterator)) BUGGY_SAFARI_ITERATORS = true;\n else {\n PrototypeOfArrayIteratorPrototype = getPrototypeOf(getPrototypeOf(arrayIterator));\n if (PrototypeOfArrayIteratorPrototype !== Object.prototype) IteratorPrototype = PrototypeOfArrayIteratorPrototype;\n }\n}\n\nvar NEW_ITERATOR_PROTOTYPE = IteratorPrototype == undefined || fails(function () {\n var test = {};\n // FF44- legacy iterators case\n return IteratorPrototype[ITERATOR].call(test) !== test;\n});\n\nif (NEW_ITERATOR_PROTOTYPE) IteratorPrototype = {};\n\n// `%IteratorPrototype%[@@iterator]()` method\n// https://tc39.es/ecma262/#sec-%iteratorprototype%-@@iterator\nif ((!IS_PURE || NEW_ITERATOR_PROTOTYPE) && !has(IteratorPrototype, ITERATOR)) {\n createNonEnumerableProperty(IteratorPrototype, ITERATOR, returnThis);\n}\n\nmodule.exports = {\n IteratorPrototype: IteratorPrototype,\n BUGGY_SAFARI_ITERATORS: BUGGY_SAFARI_ITERATORS\n};\n","'use strict';\nvar IteratorPrototype = require('../internals/iterators-core').IteratorPrototype;\nvar create = require('../internals/object-create');\nvar createPropertyDescriptor = require('../internals/create-property-descriptor');\nvar setToStringTag = require('../internals/set-to-string-tag');\nvar Iterators = require('../internals/iterators');\n\nvar returnThis = function () { return this; };\n\nmodule.exports = function (IteratorConstructor, NAME, next) {\n var TO_STRING_TAG = NAME + ' Iterator';\n IteratorConstructor.prototype = create(IteratorPrototype, { next: createPropertyDescriptor(1, next) });\n setToStringTag(IteratorConstructor, TO_STRING_TAG, false, true);\n Iterators[TO_STRING_TAG] = returnThis;\n return IteratorConstructor;\n};\n","'use strict';\nvar $ = require('../internals/export');\nvar createIteratorConstructor = require('../internals/create-iterator-constructor');\nvar getPrototypeOf = require('../internals/object-get-prototype-of');\nvar setPrototypeOf = require('../internals/object-set-prototype-of');\nvar setToStringTag = require('../internals/set-to-string-tag');\nvar createNonEnumerableProperty = require('../internals/create-non-enumerable-property');\nvar redefine = require('../internals/redefine');\nvar wellKnownSymbol = require('../internals/well-known-symbol');\nvar IS_PURE = require('../internals/is-pure');\nvar Iterators = require('../internals/iterators');\nvar IteratorsCore = require('../internals/iterators-core');\n\nvar IteratorPrototype = IteratorsCore.IteratorPrototype;\nvar BUGGY_SAFARI_ITERATORS = IteratorsCore.BUGGY_SAFARI_ITERATORS;\nvar ITERATOR = wellKnownSymbol('iterator');\nvar KEYS = 'keys';\nvar VALUES = 'values';\nvar ENTRIES = 'entries';\n\nvar returnThis = function () { return this; };\n\nmodule.exports = function (Iterable, NAME, IteratorConstructor, next, DEFAULT, IS_SET, FORCED) {\n createIteratorConstructor(IteratorConstructor, NAME, next);\n\n var getIterationMethod = function (KIND) {\n if (KIND === DEFAULT && defaultIterator) return defaultIterator;\n if (!BUGGY_SAFARI_ITERATORS && KIND in IterablePrototype) return IterablePrototype[KIND];\n switch (KIND) {\n case KEYS: return function keys() { return new IteratorConstructor(this, KIND); };\n case VALUES: return function values() { return new IteratorConstructor(this, KIND); };\n case ENTRIES: return function entries() { return new IteratorConstructor(this, KIND); };\n } return function () { return new IteratorConstructor(this); };\n };\n\n var TO_STRING_TAG = NAME + ' Iterator';\n var INCORRECT_VALUES_NAME = false;\n var IterablePrototype = Iterable.prototype;\n var nativeIterator = IterablePrototype[ITERATOR]\n || IterablePrototype['@@iterator']\n || DEFAULT && IterablePrototype[DEFAULT];\n var defaultIterator = !BUGGY_SAFARI_ITERATORS && nativeIterator || getIterationMethod(DEFAULT);\n var anyNativeIterator = NAME == 'Array' ? IterablePrototype.entries || nativeIterator : nativeIterator;\n var CurrentIteratorPrototype, methods, KEY;\n\n // fix native\n if (anyNativeIterator) {\n CurrentIteratorPrototype = getPrototypeOf(anyNativeIterator.call(new Iterable()));\n if (IteratorPrototype !== Object.prototype && CurrentIteratorPrototype.next) {\n if (!IS_PURE && getPrototypeOf(CurrentIteratorPrototype) !== IteratorPrototype) {\n if (setPrototypeOf) {\n setPrototypeOf(CurrentIteratorPrototype, IteratorPrototype);\n } else if (typeof CurrentIteratorPrototype[ITERATOR] != 'function') {\n createNonEnumerableProperty(CurrentIteratorPrototype, ITERATOR, returnThis);\n }\n }\n // Set @@toStringTag to native iterators\n setToStringTag(CurrentIteratorPrototype, TO_STRING_TAG, true, true);\n if (IS_PURE) Iterators[TO_STRING_TAG] = returnThis;\n }\n }\n\n // fix Array.prototype.{ values, @@iterator }.name in V8 / FF\n if (DEFAULT == VALUES && nativeIterator && nativeIterator.name !== VALUES) {\n INCORRECT_VALUES_NAME = true;\n defaultIterator = function values() { return nativeIterator.call(this); };\n }\n\n // define iterator\n if ((!IS_PURE || FORCED) && IterablePrototype[ITERATOR] !== defaultIterator) {\n createNonEnumerableProperty(IterablePrototype, ITERATOR, defaultIterator);\n }\n Iterators[NAME] = defaultIterator;\n\n // export additional methods\n if (DEFAULT) {\n methods = {\n values: getIterationMethod(VALUES),\n keys: IS_SET ? defaultIterator : getIterationMethod(KEYS),\n entries: getIterationMethod(ENTRIES)\n };\n if (FORCED) for (KEY in methods) {\n if (BUGGY_SAFARI_ITERATORS || INCORRECT_VALUES_NAME || !(KEY in IterablePrototype)) {\n redefine(IterablePrototype, KEY, methods[KEY]);\n }\n } else $({ target: NAME, proto: true, forced: BUGGY_SAFARI_ITERATORS || INCORRECT_VALUES_NAME }, methods);\n }\n\n return methods;\n};\n","'use strict';\nvar toIndexedObject = require('../internals/to-indexed-object');\nvar addToUnscopables = require('../internals/add-to-unscopables');\nvar Iterators = require('../internals/iterators');\nvar InternalStateModule = require('../internals/internal-state');\nvar defineIterator = require('../internals/define-iterator');\n\nvar ARRAY_ITERATOR = 'Array Iterator';\nvar setInternalState = InternalStateModule.set;\nvar getInternalState = InternalStateModule.getterFor(ARRAY_ITERATOR);\n\n// `Array.prototype.entries` method\n// https://tc39.es/ecma262/#sec-array.prototype.entries\n// `Array.prototype.keys` method\n// https://tc39.es/ecma262/#sec-array.prototype.keys\n// `Array.prototype.values` method\n// https://tc39.es/ecma262/#sec-array.prototype.values\n// `Array.prototype[@@iterator]` method\n// https://tc39.es/ecma262/#sec-array.prototype-@@iterator\n// `CreateArrayIterator` internal method\n// https://tc39.es/ecma262/#sec-createarrayiterator\nmodule.exports = defineIterator(Array, 'Array', function (iterated, kind) {\n setInternalState(this, {\n type: ARRAY_ITERATOR,\n target: toIndexedObject(iterated), // target\n index: 0, // next index\n kind: kind // kind\n });\n// `%ArrayIteratorPrototype%.next` method\n// https://tc39.es/ecma262/#sec-%arrayiteratorprototype%.next\n}, function () {\n var state = getInternalState(this);\n var target = state.target;\n var kind = state.kind;\n var index = state.index++;\n if (!target || index >= target.length) {\n state.target = undefined;\n return { value: undefined, done: true };\n }\n if (kind == 'keys') return { value: index, done: false };\n if (kind == 'values') return { value: target[index], done: false };\n return { value: [index, target[index]], done: false };\n}, 'values');\n\n// argumentsList[@@iterator] is %ArrayProto_values%\n// https://tc39.es/ecma262/#sec-createunmappedargumentsobject\n// https://tc39.es/ecma262/#sec-createmappedargumentsobject\nIterators.Arguments = Iterators.Array;\n\n// https://tc39.es/ecma262/#sec-array.prototype-@@unscopables\naddToUnscopables('keys');\naddToUnscopables('values');\naddToUnscopables('entries');\n","// eslint-disable-next-line es/no-typed-arrays -- safe\nmodule.exports = typeof ArrayBuffer !== 'undefined' && typeof DataView !== 'undefined';\n","'use strict';\nvar NATIVE_ARRAY_BUFFER = require('../internals/array-buffer-native');\nvar DESCRIPTORS = require('../internals/descriptors');\nvar global = require('../internals/global');\nvar isObject = require('../internals/is-object');\nvar has = require('../internals/has');\nvar classof = require('../internals/classof');\nvar createNonEnumerableProperty = require('../internals/create-non-enumerable-property');\nvar redefine = require('../internals/redefine');\nvar defineProperty = require('../internals/object-define-property').f;\nvar getPrototypeOf = require('../internals/object-get-prototype-of');\nvar setPrototypeOf = require('../internals/object-set-prototype-of');\nvar wellKnownSymbol = require('../internals/well-known-symbol');\nvar uid = require('../internals/uid');\n\nvar Int8Array = global.Int8Array;\nvar Int8ArrayPrototype = Int8Array && Int8Array.prototype;\nvar Uint8ClampedArray = global.Uint8ClampedArray;\nvar Uint8ClampedArrayPrototype = Uint8ClampedArray && Uint8ClampedArray.prototype;\nvar TypedArray = Int8Array && getPrototypeOf(Int8Array);\nvar TypedArrayPrototype = Int8ArrayPrototype && getPrototypeOf(Int8ArrayPrototype);\nvar ObjectPrototype = Object.prototype;\nvar isPrototypeOf = ObjectPrototype.isPrototypeOf;\n\nvar TO_STRING_TAG = wellKnownSymbol('toStringTag');\nvar TYPED_ARRAY_TAG = uid('TYPED_ARRAY_TAG');\nvar TYPED_ARRAY_CONSTRUCTOR = uid('TYPED_ARRAY_CONSTRUCTOR');\n// Fixing native typed arrays in Opera Presto crashes the browser, see #595\nvar NATIVE_ARRAY_BUFFER_VIEWS = NATIVE_ARRAY_BUFFER && !!setPrototypeOf && classof(global.opera) !== 'Opera';\nvar TYPED_ARRAY_TAG_REQIRED = false;\nvar NAME, Constructor, Prototype;\n\nvar TypedArrayConstructorsList = {\n Int8Array: 1,\n Uint8Array: 1,\n Uint8ClampedArray: 1,\n Int16Array: 2,\n Uint16Array: 2,\n Int32Array: 4,\n Uint32Array: 4,\n Float32Array: 4,\n Float64Array: 8\n};\n\nvar BigIntArrayConstructorsList = {\n BigInt64Array: 8,\n BigUint64Array: 8\n};\n\nvar isView = function isView(it) {\n if (!isObject(it)) return false;\n var klass = classof(it);\n return klass === 'DataView'\n || has(TypedArrayConstructorsList, klass)\n || has(BigIntArrayConstructorsList, klass);\n};\n\nvar isTypedArray = function (it) {\n if (!isObject(it)) return false;\n var klass = classof(it);\n return has(TypedArrayConstructorsList, klass)\n || has(BigIntArrayConstructorsList, klass);\n};\n\nvar aTypedArray = function (it) {\n if (isTypedArray(it)) return it;\n throw TypeError('Target is not a typed array');\n};\n\nvar aTypedArrayConstructor = function (C) {\n if (setPrototypeOf && !isPrototypeOf.call(TypedArray, C)) {\n throw TypeError('Target is not a typed array constructor');\n } return C;\n};\n\nvar exportTypedArrayMethod = function (KEY, property, forced) {\n if (!DESCRIPTORS) return;\n if (forced) for (var ARRAY in TypedArrayConstructorsList) {\n var TypedArrayConstructor = global[ARRAY];\n if (TypedArrayConstructor && has(TypedArrayConstructor.prototype, KEY)) try {\n delete TypedArrayConstructor.prototype[KEY];\n } catch (error) { /* empty */ }\n }\n if (!TypedArrayPrototype[KEY] || forced) {\n redefine(TypedArrayPrototype, KEY, forced ? property\n : NATIVE_ARRAY_BUFFER_VIEWS && Int8ArrayPrototype[KEY] || property);\n }\n};\n\nvar exportTypedArrayStaticMethod = function (KEY, property, forced) {\n var ARRAY, TypedArrayConstructor;\n if (!DESCRIPTORS) return;\n if (setPrototypeOf) {\n if (forced) for (ARRAY in TypedArrayConstructorsList) {\n TypedArrayConstructor = global[ARRAY];\n if (TypedArrayConstructor && has(TypedArrayConstructor, KEY)) try {\n delete TypedArrayConstructor[KEY];\n } catch (error) { /* empty */ }\n }\n if (!TypedArray[KEY] || forced) {\n // V8 ~ Chrome 49-50 `%TypedArray%` methods are non-writable non-configurable\n try {\n return redefine(TypedArray, KEY, forced ? property : NATIVE_ARRAY_BUFFER_VIEWS && TypedArray[KEY] || property);\n } catch (error) { /* empty */ }\n } else return;\n }\n for (ARRAY in TypedArrayConstructorsList) {\n TypedArrayConstructor = global[ARRAY];\n if (TypedArrayConstructor && (!TypedArrayConstructor[KEY] || forced)) {\n redefine(TypedArrayConstructor, KEY, property);\n }\n }\n};\n\nfor (NAME in TypedArrayConstructorsList) {\n Constructor = global[NAME];\n Prototype = Constructor && Constructor.prototype;\n if (Prototype) createNonEnumerableProperty(Prototype, TYPED_ARRAY_CONSTRUCTOR, Constructor);\n else NATIVE_ARRAY_BUFFER_VIEWS = false;\n}\n\nfor (NAME in BigIntArrayConstructorsList) {\n Constructor = global[NAME];\n Prototype = Constructor && Constructor.prototype;\n if (Prototype) createNonEnumerableProperty(Prototype, TYPED_ARRAY_CONSTRUCTOR, Constructor);\n}\n\n// WebKit bug - typed arrays constructors prototype is Object.prototype\nif (!NATIVE_ARRAY_BUFFER_VIEWS || typeof TypedArray != 'function' || TypedArray === Function.prototype) {\n // eslint-disable-next-line no-shadow -- safe\n TypedArray = function TypedArray() {\n throw TypeError('Incorrect invocation');\n };\n if (NATIVE_ARRAY_BUFFER_VIEWS) for (NAME in TypedArrayConstructorsList) {\n if (global[NAME]) setPrototypeOf(global[NAME], TypedArray);\n }\n}\n\nif (!NATIVE_ARRAY_BUFFER_VIEWS || !TypedArrayPrototype || TypedArrayPrototype === ObjectPrototype) {\n TypedArrayPrototype = TypedArray.prototype;\n if (NATIVE_ARRAY_BUFFER_VIEWS) for (NAME in TypedArrayConstructorsList) {\n if (global[NAME]) setPrototypeOf(global[NAME].prototype, TypedArrayPrototype);\n }\n}\n\n// WebKit bug - one more object in Uint8ClampedArray prototype chain\nif (NATIVE_ARRAY_BUFFER_VIEWS && getPrototypeOf(Uint8ClampedArrayPrototype) !== TypedArrayPrototype) {\n setPrototypeOf(Uint8ClampedArrayPrototype, TypedArrayPrototype);\n}\n\nif (DESCRIPTORS && !has(TypedArrayPrototype, TO_STRING_TAG)) {\n TYPED_ARRAY_TAG_REQIRED = true;\n defineProperty(TypedArrayPrototype, TO_STRING_TAG, { get: function () {\n return isObject(this) ? this[TYPED_ARRAY_TAG] : undefined;\n } });\n for (NAME in TypedArrayConstructorsList) if (global[NAME]) {\n createNonEnumerableProperty(global[NAME], TYPED_ARRAY_TAG, NAME);\n }\n}\n\nmodule.exports = {\n NATIVE_ARRAY_BUFFER_VIEWS: NATIVE_ARRAY_BUFFER_VIEWS,\n TYPED_ARRAY_CONSTRUCTOR: TYPED_ARRAY_CONSTRUCTOR,\n TYPED_ARRAY_TAG: TYPED_ARRAY_TAG_REQIRED && TYPED_ARRAY_TAG,\n aTypedArray: aTypedArray,\n aTypedArrayConstructor: aTypedArrayConstructor,\n exportTypedArrayMethod: exportTypedArrayMethod,\n exportTypedArrayStaticMethod: exportTypedArrayStaticMethod,\n isView: isView,\n isTypedArray: isTypedArray,\n TypedArray: TypedArray,\n TypedArrayPrototype: TypedArrayPrototype\n};\n","/* eslint-disable no-new -- required for testing */\nvar global = require('../internals/global');\nvar fails = require('../internals/fails');\nvar checkCorrectnessOfIteration = require('../internals/check-correctness-of-iteration');\nvar NATIVE_ARRAY_BUFFER_VIEWS = require('../internals/array-buffer-view-core').NATIVE_ARRAY_BUFFER_VIEWS;\n\nvar ArrayBuffer = global.ArrayBuffer;\nvar Int8Array = global.Int8Array;\n\nmodule.exports = !NATIVE_ARRAY_BUFFER_VIEWS || !fails(function () {\n Int8Array(1);\n}) || !fails(function () {\n new Int8Array(-1);\n}) || !checkCorrectnessOfIteration(function (iterable) {\n new Int8Array();\n new Int8Array(null);\n new Int8Array(1.5);\n new Int8Array(iterable);\n}, true) || fails(function () {\n // Safari (11+) bug - a reason why even Safari 13 should load a typed array polyfill\n return new Int8Array(new ArrayBuffer(2), 1, undefined).length !== 1;\n});\n","var toInteger = require('../internals/to-integer');\nvar toLength = require('../internals/to-length');\n\n// `ToIndex` abstract operation\n// https://tc39.es/ecma262/#sec-toindex\nmodule.exports = function (it) {\n if (it === undefined) return 0;\n var number = toInteger(it);\n var length = toLength(number);\n if (number !== length) throw RangeError('Wrong length or index');\n return length;\n};\n","// IEEE754 conversions based on https://github.com/feross/ieee754\nvar abs = Math.abs;\nvar pow = Math.pow;\nvar floor = Math.floor;\nvar log = Math.log;\nvar LN2 = Math.LN2;\n\nvar pack = function (number, mantissaLength, bytes) {\n var buffer = new Array(bytes);\n var exponentLength = bytes * 8 - mantissaLength - 1;\n var eMax = (1 << exponentLength) - 1;\n var eBias = eMax >> 1;\n var rt = mantissaLength === 23 ? pow(2, -24) - pow(2, -77) : 0;\n var sign = number < 0 || number === 0 && 1 / number < 0 ? 1 : 0;\n var index = 0;\n var exponent, mantissa, c;\n number = abs(number);\n // eslint-disable-next-line no-self-compare -- NaN check\n if (number != number || number === Infinity) {\n // eslint-disable-next-line no-self-compare -- NaN check\n mantissa = number != number ? 1 : 0;\n exponent = eMax;\n } else {\n exponent = floor(log(number) / LN2);\n if (number * (c = pow(2, -exponent)) < 1) {\n exponent--;\n c *= 2;\n }\n if (exponent + eBias >= 1) {\n number += rt / c;\n } else {\n number += rt * pow(2, 1 - eBias);\n }\n if (number * c >= 2) {\n exponent++;\n c /= 2;\n }\n if (exponent + eBias >= eMax) {\n mantissa = 0;\n exponent = eMax;\n } else if (exponent + eBias >= 1) {\n mantissa = (number * c - 1) * pow(2, mantissaLength);\n exponent = exponent + eBias;\n } else {\n mantissa = number * pow(2, eBias - 1) * pow(2, mantissaLength);\n exponent = 0;\n }\n }\n for (; mantissaLength >= 8; buffer[index++] = mantissa & 255, mantissa /= 256, mantissaLength -= 8);\n exponent = exponent << mantissaLength | mantissa;\n exponentLength += mantissaLength;\n for (; exponentLength > 0; buffer[index++] = exponent & 255, exponent /= 256, exponentLength -= 8);\n buffer[--index] |= sign * 128;\n return buffer;\n};\n\nvar unpack = function (buffer, mantissaLength) {\n var bytes = buffer.length;\n var exponentLength = bytes * 8 - mantissaLength - 1;\n var eMax = (1 << exponentLength) - 1;\n var eBias = eMax >> 1;\n var nBits = exponentLength - 7;\n var index = bytes - 1;\n var sign = buffer[index--];\n var exponent = sign & 127;\n var mantissa;\n sign >>= 7;\n for (; nBits > 0; exponent = exponent * 256 + buffer[index], index--, nBits -= 8);\n mantissa = exponent & (1 << -nBits) - 1;\n exponent >>= -nBits;\n nBits += mantissaLength;\n for (; nBits > 0; mantissa = mantissa * 256 + buffer[index], index--, nBits -= 8);\n if (exponent === 0) {\n exponent = 1 - eBias;\n } else if (exponent === eMax) {\n return mantissa ? NaN : sign ? -Infinity : Infinity;\n } else {\n mantissa = mantissa + pow(2, mantissaLength);\n exponent = exponent - eBias;\n } return (sign ? -1 : 1) * mantissa * pow(2, exponent - mantissaLength);\n};\n\nmodule.exports = {\n pack: pack,\n unpack: unpack\n};\n","'use strict';\nvar toObject = require('../internals/to-object');\nvar toAbsoluteIndex = require('../internals/to-absolute-index');\nvar toLength = require('../internals/to-length');\n\n// `Array.prototype.fill` method implementation\n// https://tc39.es/ecma262/#sec-array.prototype.fill\nmodule.exports = function fill(value /* , start = 0, end = @length */) {\n var O = toObject(this);\n var length = toLength(O.length);\n var argumentsLength = arguments.length;\n var index = toAbsoluteIndex(argumentsLength > 1 ? arguments[1] : undefined, length);\n var end = argumentsLength > 2 ? arguments[2] : undefined;\n var endPos = end === undefined ? length : toAbsoluteIndex(end, length);\n while (endPos > index) O[index++] = value;\n return O;\n};\n","'use strict';\nvar global = require('../internals/global');\nvar DESCRIPTORS = require('../internals/descriptors');\nvar NATIVE_ARRAY_BUFFER = require('../internals/array-buffer-native');\nvar createNonEnumerableProperty = require('../internals/create-non-enumerable-property');\nvar redefineAll = require('../internals/redefine-all');\nvar fails = require('../internals/fails');\nvar anInstance = require('../internals/an-instance');\nvar toInteger = require('../internals/to-integer');\nvar toLength = require('../internals/to-length');\nvar toIndex = require('../internals/to-index');\nvar IEEE754 = require('../internals/ieee754');\nvar getPrototypeOf = require('../internals/object-get-prototype-of');\nvar setPrototypeOf = require('../internals/object-set-prototype-of');\nvar getOwnPropertyNames = require('../internals/object-get-own-property-names').f;\nvar defineProperty = require('../internals/object-define-property').f;\nvar arrayFill = require('../internals/array-fill');\nvar setToStringTag = require('../internals/set-to-string-tag');\nvar InternalStateModule = require('../internals/internal-state');\n\nvar getInternalState = InternalStateModule.get;\nvar setInternalState = InternalStateModule.set;\nvar ARRAY_BUFFER = 'ArrayBuffer';\nvar DATA_VIEW = 'DataView';\nvar PROTOTYPE = 'prototype';\nvar WRONG_LENGTH = 'Wrong length';\nvar WRONG_INDEX = 'Wrong index';\nvar NativeArrayBuffer = global[ARRAY_BUFFER];\nvar $ArrayBuffer = NativeArrayBuffer;\nvar $DataView = global[DATA_VIEW];\nvar $DataViewPrototype = $DataView && $DataView[PROTOTYPE];\nvar ObjectPrototype = Object.prototype;\nvar RangeError = global.RangeError;\n\nvar packIEEE754 = IEEE754.pack;\nvar unpackIEEE754 = IEEE754.unpack;\n\nvar packInt8 = function (number) {\n return [number & 0xFF];\n};\n\nvar packInt16 = function (number) {\n return [number & 0xFF, number >> 8 & 0xFF];\n};\n\nvar packInt32 = function (number) {\n return [number & 0xFF, number >> 8 & 0xFF, number >> 16 & 0xFF, number >> 24 & 0xFF];\n};\n\nvar unpackInt32 = function (buffer) {\n return buffer[3] << 24 | buffer[2] << 16 | buffer[1] << 8 | buffer[0];\n};\n\nvar packFloat32 = function (number) {\n return packIEEE754(number, 23, 4);\n};\n\nvar packFloat64 = function (number) {\n return packIEEE754(number, 52, 8);\n};\n\nvar addGetter = function (Constructor, key) {\n defineProperty(Constructor[PROTOTYPE], key, { get: function () { return getInternalState(this)[key]; } });\n};\n\nvar get = function (view, count, index, isLittleEndian) {\n var intIndex = toIndex(index);\n var store = getInternalState(view);\n if (intIndex + count > store.byteLength) throw RangeError(WRONG_INDEX);\n var bytes = getInternalState(store.buffer).bytes;\n var start = intIndex + store.byteOffset;\n var pack = bytes.slice(start, start + count);\n return isLittleEndian ? pack : pack.reverse();\n};\n\nvar set = function (view, count, index, conversion, value, isLittleEndian) {\n var intIndex = toIndex(index);\n var store = getInternalState(view);\n if (intIndex + count > store.byteLength) throw RangeError(WRONG_INDEX);\n var bytes = getInternalState(store.buffer).bytes;\n var start = intIndex + store.byteOffset;\n var pack = conversion(+value);\n for (var i = 0; i < count; i++) bytes[start + i] = pack[isLittleEndian ? i : count - i - 1];\n};\n\nif (!NATIVE_ARRAY_BUFFER) {\n $ArrayBuffer = function ArrayBuffer(length) {\n anInstance(this, $ArrayBuffer, ARRAY_BUFFER);\n var byteLength = toIndex(length);\n setInternalState(this, {\n bytes: arrayFill.call(new Array(byteLength), 0),\n byteLength: byteLength\n });\n if (!DESCRIPTORS) this.byteLength = byteLength;\n };\n\n $DataView = function DataView(buffer, byteOffset, byteLength) {\n anInstance(this, $DataView, DATA_VIEW);\n anInstance(buffer, $ArrayBuffer, DATA_VIEW);\n var bufferLength = getInternalState(buffer).byteLength;\n var offset = toInteger(byteOffset);\n if (offset < 0 || offset > bufferLength) throw RangeError('Wrong offset');\n byteLength = byteLength === undefined ? bufferLength - offset : toLength(byteLength);\n if (offset + byteLength > bufferLength) throw RangeError(WRONG_LENGTH);\n setInternalState(this, {\n buffer: buffer,\n byteLength: byteLength,\n byteOffset: offset\n });\n if (!DESCRIPTORS) {\n this.buffer = buffer;\n this.byteLength = byteLength;\n this.byteOffset = offset;\n }\n };\n\n if (DESCRIPTORS) {\n addGetter($ArrayBuffer, 'byteLength');\n addGetter($DataView, 'buffer');\n addGetter($DataView, 'byteLength');\n addGetter($DataView, 'byteOffset');\n }\n\n redefineAll($DataView[PROTOTYPE], {\n getInt8: function getInt8(byteOffset) {\n return get(this, 1, byteOffset)[0] << 24 >> 24;\n },\n getUint8: function getUint8(byteOffset) {\n return get(this, 1, byteOffset)[0];\n },\n getInt16: function getInt16(byteOffset /* , littleEndian */) {\n var bytes = get(this, 2, byteOffset, arguments.length > 1 ? arguments[1] : undefined);\n return (bytes[1] << 8 | bytes[0]) << 16 >> 16;\n },\n getUint16: function getUint16(byteOffset /* , littleEndian */) {\n var bytes = get(this, 2, byteOffset, arguments.length > 1 ? arguments[1] : undefined);\n return bytes[1] << 8 | bytes[0];\n },\n getInt32: function getInt32(byteOffset /* , littleEndian */) {\n return unpackInt32(get(this, 4, byteOffset, arguments.length > 1 ? arguments[1] : undefined));\n },\n getUint32: function getUint32(byteOffset /* , littleEndian */) {\n return unpackInt32(get(this, 4, byteOffset, arguments.length > 1 ? arguments[1] : undefined)) >>> 0;\n },\n getFloat32: function getFloat32(byteOffset /* , littleEndian */) {\n return unpackIEEE754(get(this, 4, byteOffset, arguments.length > 1 ? arguments[1] : undefined), 23);\n },\n getFloat64: function getFloat64(byteOffset /* , littleEndian */) {\n return unpackIEEE754(get(this, 8, byteOffset, arguments.length > 1 ? arguments[1] : undefined), 52);\n },\n setInt8: function setInt8(byteOffset, value) {\n set(this, 1, byteOffset, packInt8, value);\n },\n setUint8: function setUint8(byteOffset, value) {\n set(this, 1, byteOffset, packInt8, value);\n },\n setInt16: function setInt16(byteOffset, value /* , littleEndian */) {\n set(this, 2, byteOffset, packInt16, value, arguments.length > 2 ? arguments[2] : undefined);\n },\n setUint16: function setUint16(byteOffset, value /* , littleEndian */) {\n set(this, 2, byteOffset, packInt16, value, arguments.length > 2 ? arguments[2] : undefined);\n },\n setInt32: function setInt32(byteOffset, value /* , littleEndian */) {\n set(this, 4, byteOffset, packInt32, value, arguments.length > 2 ? arguments[2] : undefined);\n },\n setUint32: function setUint32(byteOffset, value /* , littleEndian */) {\n set(this, 4, byteOffset, packInt32, value, arguments.length > 2 ? arguments[2] : undefined);\n },\n setFloat32: function setFloat32(byteOffset, value /* , littleEndian */) {\n set(this, 4, byteOffset, packFloat32, value, arguments.length > 2 ? arguments[2] : undefined);\n },\n setFloat64: function setFloat64(byteOffset, value /* , littleEndian */) {\n set(this, 8, byteOffset, packFloat64, value, arguments.length > 2 ? arguments[2] : undefined);\n }\n });\n} else {\n /* eslint-disable no-new -- required for testing */\n if (!fails(function () {\n NativeArrayBuffer(1);\n }) || !fails(function () {\n new NativeArrayBuffer(-1);\n }) || fails(function () {\n new NativeArrayBuffer();\n new NativeArrayBuffer(1.5);\n new NativeArrayBuffer(NaN);\n return NativeArrayBuffer.name != ARRAY_BUFFER;\n })) {\n /* eslint-enable no-new -- required for testing */\n $ArrayBuffer = function ArrayBuffer(length) {\n anInstance(this, $ArrayBuffer);\n return new NativeArrayBuffer(toIndex(length));\n };\n var ArrayBufferPrototype = $ArrayBuffer[PROTOTYPE] = NativeArrayBuffer[PROTOTYPE];\n for (var keys = getOwnPropertyNames(NativeArrayBuffer), j = 0, key; keys.length > j;) {\n if (!((key = keys[j++]) in $ArrayBuffer)) {\n createNonEnumerableProperty($ArrayBuffer, key, NativeArrayBuffer[key]);\n }\n }\n ArrayBufferPrototype.constructor = $ArrayBuffer;\n }\n\n // WebKit bug - the same parent prototype for typed arrays and data view\n if (setPrototypeOf && getPrototypeOf($DataViewPrototype) !== ObjectPrototype) {\n setPrototypeOf($DataViewPrototype, ObjectPrototype);\n }\n\n // iOS Safari 7.x bug\n var testView = new $DataView(new $ArrayBuffer(2));\n var $setInt8 = $DataViewPrototype.setInt8;\n testView.setInt8(0, 2147483648);\n testView.setInt8(1, 2147483649);\n if (testView.getInt8(0) || !testView.getInt8(1)) redefineAll($DataViewPrototype, {\n setInt8: function setInt8(byteOffset, value) {\n $setInt8.call(this, byteOffset, value << 24 >> 24);\n },\n setUint8: function setUint8(byteOffset, value) {\n $setInt8.call(this, byteOffset, value << 24 >> 24);\n }\n }, { unsafe: true });\n}\n\nsetToStringTag($ArrayBuffer, ARRAY_BUFFER);\nsetToStringTag($DataView, DATA_VIEW);\n\nmodule.exports = {\n ArrayBuffer: $ArrayBuffer,\n DataView: $DataView\n};\n","var isObject = require('../internals/is-object');\n\nvar floor = Math.floor;\n\n// `Number.isInteger` method implementation\n// https://tc39.es/ecma262/#sec-number.isinteger\nmodule.exports = function isInteger(it) {\n return !isObject(it) && isFinite(it) && floor(it) === it;\n};\n","var toInteger = require('../internals/to-integer');\n\nmodule.exports = function (it) {\n var result = toInteger(it);\n if (result < 0) throw RangeError(\"The argument can't be less than 0\");\n return result;\n};\n","var toPositiveInteger = require('../internals/to-positive-integer');\n\nmodule.exports = function (it, BYTES) {\n var offset = toPositiveInteger(it);\n if (offset % BYTES) throw RangeError('Wrong offset');\n return offset;\n};\n","var toObject = require('../internals/to-object');\nvar toLength = require('../internals/to-length');\nvar getIteratorMethod = require('../internals/get-iterator-method');\nvar isArrayIteratorMethod = require('../internals/is-array-iterator-method');\nvar bind = require('../internals/function-bind-context');\nvar aTypedArrayConstructor = require('../internals/array-buffer-view-core').aTypedArrayConstructor;\n\nmodule.exports = function from(source /* , mapfn, thisArg */) {\n var O = toObject(source);\n var argumentsLength = arguments.length;\n var mapfn = argumentsLength > 1 ? arguments[1] : undefined;\n var mapping = mapfn !== undefined;\n var iteratorMethod = getIteratorMethod(O);\n var i, length, result, step, iterator, next;\n if (iteratorMethod != undefined && !isArrayIteratorMethod(iteratorMethod)) {\n iterator = iteratorMethod.call(O);\n next = iterator.next;\n O = [];\n while (!(step = next.call(iterator)).done) {\n O.push(step.value);\n }\n }\n if (mapping && argumentsLength > 2) {\n mapfn = bind(mapfn, arguments[2], 2);\n }\n length = toLength(O.length);\n result = new (aTypedArrayConstructor(this))(length);\n for (i = 0; length > i; i++) {\n result[i] = mapping ? mapfn(O[i], i) : O[i];\n }\n return result;\n};\n","var isObject = require('../internals/is-object');\nvar isArray = require('../internals/is-array');\nvar wellKnownSymbol = require('../internals/well-known-symbol');\n\nvar SPECIES = wellKnownSymbol('species');\n\n// a part of `ArraySpeciesCreate` abstract operation\n// https://tc39.es/ecma262/#sec-arrayspeciescreate\nmodule.exports = function (originalArray) {\n var C;\n if (isArray(originalArray)) {\n C = originalArray.constructor;\n // cross-realm fallback\n if (typeof C == 'function' && (C === Array || isArray(C.prototype))) C = undefined;\n else if (isObject(C)) {\n C = C[SPECIES];\n if (C === null) C = undefined;\n }\n } return C === undefined ? Array : C;\n};\n","var bind = require('../internals/function-bind-context');\nvar IndexedObject = require('../internals/indexed-object');\nvar toObject = require('../internals/to-object');\nvar toLength = require('../internals/to-length');\nvar arraySpeciesCreate = require('../internals/array-species-create');\n\nvar push = [].push;\n\n// `Array.prototype.{ forEach, map, filter, some, every, find, findIndex, filterReject }` methods implementation\nvar createMethod = function (TYPE) {\n var IS_MAP = TYPE == 1;\n var IS_FILTER = TYPE == 2;\n var IS_SOME = TYPE == 3;\n var IS_EVERY = TYPE == 4;\n var IS_FIND_INDEX = TYPE == 6;\n var IS_FILTER_REJECT = TYPE == 7;\n var NO_HOLES = TYPE == 5 || IS_FIND_INDEX;\n return function ($this, callbackfn, that, specificCreate) {\n var O = toObject($this);\n var self = IndexedObject(O);\n var boundFunction = bind(callbackfn, that, 3);\n var length = toLength(self.length);\n var index = 0;\n var create = specificCreate || arraySpeciesCreate;\n var target = IS_MAP ? create($this, length) : IS_FILTER || IS_FILTER_REJECT ? create($this, 0) : undefined;\n var value, result;\n for (;length > index; index++) if (NO_HOLES || index in self) {\n value = self[index];\n result = boundFunction(value, index, O);\n if (TYPE) {\n if (IS_MAP) target[index] = result; // map\n else if (result) switch (TYPE) {\n case 3: return true; // some\n case 5: return value; // find\n case 6: return index; // findIndex\n case 2: push.call(target, value); // filter\n } else switch (TYPE) {\n case 4: return false; // every\n case 7: push.call(target, value); // filterReject\n }\n }\n }\n return IS_FIND_INDEX ? -1 : IS_SOME || IS_EVERY ? IS_EVERY : target;\n };\n};\n\nmodule.exports = {\n // `Array.prototype.forEach` method\n // https://tc39.es/ecma262/#sec-array.prototype.foreach\n forEach: createMethod(0),\n // `Array.prototype.map` method\n // https://tc39.es/ecma262/#sec-array.prototype.map\n map: createMethod(1),\n // `Array.prototype.filter` method\n // https://tc39.es/ecma262/#sec-array.prototype.filter\n filter: createMethod(2),\n // `Array.prototype.some` method\n // https://tc39.es/ecma262/#sec-array.prototype.some\n some: createMethod(3),\n // `Array.prototype.every` method\n // https://tc39.es/ecma262/#sec-array.prototype.every\n every: createMethod(4),\n // `Array.prototype.find` method\n // https://tc39.es/ecma262/#sec-array.prototype.find\n find: createMethod(5),\n // `Array.prototype.findIndex` method\n // https://tc39.es/ecma262/#sec-array.prototype.findIndex\n findIndex: createMethod(6),\n // `Array.prototype.filterReject` method\n // https://github.com/tc39/proposal-array-filtering\n filterReject: createMethod(7)\n};\n","'use strict';\nvar $ = require('../internals/export');\nvar global = require('../internals/global');\nvar DESCRIPTORS = require('../internals/descriptors');\nvar TYPED_ARRAYS_CONSTRUCTORS_REQUIRES_WRAPPERS = require('../internals/typed-array-constructors-require-wrappers');\nvar ArrayBufferViewCore = require('../internals/array-buffer-view-core');\nvar ArrayBufferModule = require('../internals/array-buffer');\nvar anInstance = require('../internals/an-instance');\nvar createPropertyDescriptor = require('../internals/create-property-descriptor');\nvar createNonEnumerableProperty = require('../internals/create-non-enumerable-property');\nvar isInteger = require('../internals/is-integer');\nvar toLength = require('../internals/to-length');\nvar toIndex = require('../internals/to-index');\nvar toOffset = require('../internals/to-offset');\nvar toPropertyKey = require('../internals/to-property-key');\nvar has = require('../internals/has');\nvar classof = require('../internals/classof');\nvar isObject = require('../internals/is-object');\nvar isSymbol = require('../internals/is-symbol');\nvar create = require('../internals/object-create');\nvar setPrototypeOf = require('../internals/object-set-prototype-of');\nvar getOwnPropertyNames = require('../internals/object-get-own-property-names').f;\nvar typedArrayFrom = require('../internals/typed-array-from');\nvar forEach = require('../internals/array-iteration').forEach;\nvar setSpecies = require('../internals/set-species');\nvar definePropertyModule = require('../internals/object-define-property');\nvar getOwnPropertyDescriptorModule = require('../internals/object-get-own-property-descriptor');\nvar InternalStateModule = require('../internals/internal-state');\nvar inheritIfRequired = require('../internals/inherit-if-required');\n\nvar getInternalState = InternalStateModule.get;\nvar setInternalState = InternalStateModule.set;\nvar nativeDefineProperty = definePropertyModule.f;\nvar nativeGetOwnPropertyDescriptor = getOwnPropertyDescriptorModule.f;\nvar round = Math.round;\nvar RangeError = global.RangeError;\nvar ArrayBuffer = ArrayBufferModule.ArrayBuffer;\nvar DataView = ArrayBufferModule.DataView;\nvar NATIVE_ARRAY_BUFFER_VIEWS = ArrayBufferViewCore.NATIVE_ARRAY_BUFFER_VIEWS;\nvar TYPED_ARRAY_CONSTRUCTOR = ArrayBufferViewCore.TYPED_ARRAY_CONSTRUCTOR;\nvar TYPED_ARRAY_TAG = ArrayBufferViewCore.TYPED_ARRAY_TAG;\nvar TypedArray = ArrayBufferViewCore.TypedArray;\nvar TypedArrayPrototype = ArrayBufferViewCore.TypedArrayPrototype;\nvar aTypedArrayConstructor = ArrayBufferViewCore.aTypedArrayConstructor;\nvar isTypedArray = ArrayBufferViewCore.isTypedArray;\nvar BYTES_PER_ELEMENT = 'BYTES_PER_ELEMENT';\nvar WRONG_LENGTH = 'Wrong length';\n\nvar fromList = function (C, list) {\n var index = 0;\n var length = list.length;\n var result = new (aTypedArrayConstructor(C))(length);\n while (length > index) result[index] = list[index++];\n return result;\n};\n\nvar addGetter = function (it, key) {\n nativeDefineProperty(it, key, { get: function () {\n return getInternalState(this)[key];\n } });\n};\n\nvar isArrayBuffer = function (it) {\n var klass;\n return it instanceof ArrayBuffer || (klass = classof(it)) == 'ArrayBuffer' || klass == 'SharedArrayBuffer';\n};\n\nvar isTypedArrayIndex = function (target, key) {\n return isTypedArray(target)\n && !isSymbol(key)\n && key in target\n && isInteger(+key)\n && key >= 0;\n};\n\nvar wrappedGetOwnPropertyDescriptor = function getOwnPropertyDescriptor(target, key) {\n key = toPropertyKey(key);\n return isTypedArrayIndex(target, key)\n ? createPropertyDescriptor(2, target[key])\n : nativeGetOwnPropertyDescriptor(target, key);\n};\n\nvar wrappedDefineProperty = function defineProperty(target, key, descriptor) {\n key = toPropertyKey(key);\n if (isTypedArrayIndex(target, key)\n && isObject(descriptor)\n && has(descriptor, 'value')\n && !has(descriptor, 'get')\n && !has(descriptor, 'set')\n // TODO: add validation descriptor w/o calling accessors\n && !descriptor.configurable\n && (!has(descriptor, 'writable') || descriptor.writable)\n && (!has(descriptor, 'enumerable') || descriptor.enumerable)\n ) {\n target[key] = descriptor.value;\n return target;\n } return nativeDefineProperty(target, key, descriptor);\n};\n\nif (DESCRIPTORS) {\n if (!NATIVE_ARRAY_BUFFER_VIEWS) {\n getOwnPropertyDescriptorModule.f = wrappedGetOwnPropertyDescriptor;\n definePropertyModule.f = wrappedDefineProperty;\n addGetter(TypedArrayPrototype, 'buffer');\n addGetter(TypedArrayPrototype, 'byteOffset');\n addGetter(TypedArrayPrototype, 'byteLength');\n addGetter(TypedArrayPrototype, 'length');\n }\n\n $({ target: 'Object', stat: true, forced: !NATIVE_ARRAY_BUFFER_VIEWS }, {\n getOwnPropertyDescriptor: wrappedGetOwnPropertyDescriptor,\n defineProperty: wrappedDefineProperty\n });\n\n module.exports = function (TYPE, wrapper, CLAMPED) {\n var BYTES = TYPE.match(/\\d+$/)[0] / 8;\n var CONSTRUCTOR_NAME = TYPE + (CLAMPED ? 'Clamped' : '') + 'Array';\n var GETTER = 'get' + TYPE;\n var SETTER = 'set' + TYPE;\n var NativeTypedArrayConstructor = global[CONSTRUCTOR_NAME];\n var TypedArrayConstructor = NativeTypedArrayConstructor;\n var TypedArrayConstructorPrototype = TypedArrayConstructor && TypedArrayConstructor.prototype;\n var exported = {};\n\n var getter = function (that, index) {\n var data = getInternalState(that);\n return data.view[GETTER](index * BYTES + data.byteOffset, true);\n };\n\n var setter = function (that, index, value) {\n var data = getInternalState(that);\n if (CLAMPED) value = (value = round(value)) < 0 ? 0 : value > 0xFF ? 0xFF : value & 0xFF;\n data.view[SETTER](index * BYTES + data.byteOffset, value, true);\n };\n\n var addElement = function (that, index) {\n nativeDefineProperty(that, index, {\n get: function () {\n return getter(this, index);\n },\n set: function (value) {\n return setter(this, index, value);\n },\n enumerable: true\n });\n };\n\n if (!NATIVE_ARRAY_BUFFER_VIEWS) {\n TypedArrayConstructor = wrapper(function (that, data, offset, $length) {\n anInstance(that, TypedArrayConstructor, CONSTRUCTOR_NAME);\n var index = 0;\n var byteOffset = 0;\n var buffer, byteLength, length;\n if (!isObject(data)) {\n length = toIndex(data);\n byteLength = length * BYTES;\n buffer = new ArrayBuffer(byteLength);\n } else if (isArrayBuffer(data)) {\n buffer = data;\n byteOffset = toOffset(offset, BYTES);\n var $len = data.byteLength;\n if ($length === undefined) {\n if ($len % BYTES) throw RangeError(WRONG_LENGTH);\n byteLength = $len - byteOffset;\n if (byteLength < 0) throw RangeError(WRONG_LENGTH);\n } else {\n byteLength = toLength($length) * BYTES;\n if (byteLength + byteOffset > $len) throw RangeError(WRONG_LENGTH);\n }\n length = byteLength / BYTES;\n } else if (isTypedArray(data)) {\n return fromList(TypedArrayConstructor, data);\n } else {\n return typedArrayFrom.call(TypedArrayConstructor, data);\n }\n setInternalState(that, {\n buffer: buffer,\n byteOffset: byteOffset,\n byteLength: byteLength,\n length: length,\n view: new DataView(buffer)\n });\n while (index < length) addElement(that, index++);\n });\n\n if (setPrototypeOf) setPrototypeOf(TypedArrayConstructor, TypedArray);\n TypedArrayConstructorPrototype = TypedArrayConstructor.prototype = create(TypedArrayPrototype);\n } else if (TYPED_ARRAYS_CONSTRUCTORS_REQUIRES_WRAPPERS) {\n TypedArrayConstructor = wrapper(function (dummy, data, typedArrayOffset, $length) {\n anInstance(dummy, TypedArrayConstructor, CONSTRUCTOR_NAME);\n return inheritIfRequired(function () {\n if (!isObject(data)) return new NativeTypedArrayConstructor(toIndex(data));\n if (isArrayBuffer(data)) return $length !== undefined\n ? new NativeTypedArrayConstructor(data, toOffset(typedArrayOffset, BYTES), $length)\n : typedArrayOffset !== undefined\n ? new NativeTypedArrayConstructor(data, toOffset(typedArrayOffset, BYTES))\n : new NativeTypedArrayConstructor(data);\n if (isTypedArray(data)) return fromList(TypedArrayConstructor, data);\n return typedArrayFrom.call(TypedArrayConstructor, data);\n }(), dummy, TypedArrayConstructor);\n });\n\n if (setPrototypeOf) setPrototypeOf(TypedArrayConstructor, TypedArray);\n forEach(getOwnPropertyNames(NativeTypedArrayConstructor), function (key) {\n if (!(key in TypedArrayConstructor)) {\n createNonEnumerableProperty(TypedArrayConstructor, key, NativeTypedArrayConstructor[key]);\n }\n });\n TypedArrayConstructor.prototype = TypedArrayConstructorPrototype;\n }\n\n if (TypedArrayConstructorPrototype.constructor !== TypedArrayConstructor) {\n createNonEnumerableProperty(TypedArrayConstructorPrototype, 'constructor', TypedArrayConstructor);\n }\n\n createNonEnumerableProperty(TypedArrayConstructorPrototype, TYPED_ARRAY_CONSTRUCTOR, TypedArrayConstructor);\n\n if (TYPED_ARRAY_TAG) {\n createNonEnumerableProperty(TypedArrayConstructorPrototype, TYPED_ARRAY_TAG, CONSTRUCTOR_NAME);\n }\n\n exported[CONSTRUCTOR_NAME] = TypedArrayConstructor;\n\n $({\n global: true, forced: TypedArrayConstructor != NativeTypedArrayConstructor, sham: !NATIVE_ARRAY_BUFFER_VIEWS\n }, exported);\n\n if (!(BYTES_PER_ELEMENT in TypedArrayConstructor)) {\n createNonEnumerableProperty(TypedArrayConstructor, BYTES_PER_ELEMENT, BYTES);\n }\n\n if (!(BYTES_PER_ELEMENT in TypedArrayConstructorPrototype)) {\n createNonEnumerableProperty(TypedArrayConstructorPrototype, BYTES_PER_ELEMENT, BYTES);\n }\n\n setSpecies(CONSTRUCTOR_NAME);\n };\n} else module.exports = function () { /* empty */ };\n","'use strict';\nvar toObject = require('../internals/to-object');\nvar toAbsoluteIndex = require('../internals/to-absolute-index');\nvar toLength = require('../internals/to-length');\n\nvar min = Math.min;\n\n// `Array.prototype.copyWithin` method implementation\n// https://tc39.es/ecma262/#sec-array.prototype.copywithin\n// eslint-disable-next-line es/no-array-prototype-copywithin -- safe\nmodule.exports = [].copyWithin || function copyWithin(target /* = 0 */, start /* = 0, end = @length */) {\n var O = toObject(this);\n var len = toLength(O.length);\n var to = toAbsoluteIndex(target, len);\n var from = toAbsoluteIndex(start, len);\n var end = arguments.length > 2 ? arguments[2] : undefined;\n var count = min((end === undefined ? len : toAbsoluteIndex(end, len)) - from, len - to);\n var inc = 1;\n if (from < to && to < from + count) {\n inc = -1;\n from += count - 1;\n to += count - 1;\n }\n while (count-- > 0) {\n if (from in O) O[to] = O[from];\n else delete O[to];\n to += inc;\n from += inc;\n } return O;\n};\n","'use strict';\nvar ArrayBufferViewCore = require('../internals/array-buffer-view-core');\nvar $copyWithin = require('../internals/array-copy-within');\n\nvar aTypedArray = ArrayBufferViewCore.aTypedArray;\nvar exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod;\n\n// `%TypedArray%.prototype.copyWithin` method\n// https://tc39.es/ecma262/#sec-%typedarray%.prototype.copywithin\nexportTypedArrayMethod('copyWithin', function copyWithin(target, start /* , end */) {\n return $copyWithin.call(aTypedArray(this), target, start, arguments.length > 2 ? arguments[2] : undefined);\n});\n","'use strict';\nvar ArrayBufferViewCore = require('../internals/array-buffer-view-core');\nvar $every = require('../internals/array-iteration').every;\n\nvar aTypedArray = ArrayBufferViewCore.aTypedArray;\nvar exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod;\n\n// `%TypedArray%.prototype.every` method\n// https://tc39.es/ecma262/#sec-%typedarray%.prototype.every\nexportTypedArrayMethod('every', function every(callbackfn /* , thisArg */) {\n return $every(aTypedArray(this), callbackfn, arguments.length > 1 ? arguments[1] : undefined);\n});\n","'use strict';\nvar ArrayBufferViewCore = require('../internals/array-buffer-view-core');\nvar $fill = require('../internals/array-fill');\n\nvar aTypedArray = ArrayBufferViewCore.aTypedArray;\nvar exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod;\n\n// `%TypedArray%.prototype.fill` method\n// https://tc39.es/ecma262/#sec-%typedarray%.prototype.fill\n// eslint-disable-next-line no-unused-vars -- required for `.length`\nexportTypedArrayMethod('fill', function fill(value /* , start, end */) {\n return $fill.apply(aTypedArray(this), arguments);\n});\n","module.exports = function (Constructor, list) {\n var index = 0;\n var length = list.length;\n var result = new Constructor(length);\n while (length > index) result[index] = list[index++];\n return result;\n};\n","var ArrayBufferViewCore = require('../internals/array-buffer-view-core');\nvar speciesConstructor = require('../internals/species-constructor');\n\nvar TYPED_ARRAY_CONSTRUCTOR = ArrayBufferViewCore.TYPED_ARRAY_CONSTRUCTOR;\nvar aTypedArrayConstructor = ArrayBufferViewCore.aTypedArrayConstructor;\n\n// a part of `TypedArraySpeciesCreate` abstract operation\n// https://tc39.es/ecma262/#typedarray-species-create\nmodule.exports = function (originalArray) {\n return aTypedArrayConstructor(speciesConstructor(originalArray, originalArray[TYPED_ARRAY_CONSTRUCTOR]));\n};\n","'use strict';\nvar ArrayBufferViewCore = require('../internals/array-buffer-view-core');\nvar $filter = require('../internals/array-iteration').filter;\nvar fromSpeciesAndList = require('../internals/typed-array-from-species-and-list');\n\nvar aTypedArray = ArrayBufferViewCore.aTypedArray;\nvar exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod;\n\n// `%TypedArray%.prototype.filter` method\n// https://tc39.es/ecma262/#sec-%typedarray%.prototype.filter\nexportTypedArrayMethod('filter', function filter(callbackfn /* , thisArg */) {\n var list = $filter(aTypedArray(this), callbackfn, arguments.length > 1 ? arguments[1] : undefined);\n return fromSpeciesAndList(this, list);\n});\n","'use strict';\nvar ArrayBufferViewCore = require('../internals/array-buffer-view-core');\nvar $find = require('../internals/array-iteration').find;\n\nvar aTypedArray = ArrayBufferViewCore.aTypedArray;\nvar exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod;\n\n// `%TypedArray%.prototype.find` method\n// https://tc39.es/ecma262/#sec-%typedarray%.prototype.find\nexportTypedArrayMethod('find', function find(predicate /* , thisArg */) {\n return $find(aTypedArray(this), predicate, arguments.length > 1 ? arguments[1] : undefined);\n});\n","'use strict';\nvar ArrayBufferViewCore = require('../internals/array-buffer-view-core');\nvar $findIndex = require('../internals/array-iteration').findIndex;\n\nvar aTypedArray = ArrayBufferViewCore.aTypedArray;\nvar exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod;\n\n// `%TypedArray%.prototype.findIndex` method\n// https://tc39.es/ecma262/#sec-%typedarray%.prototype.findindex\nexportTypedArrayMethod('findIndex', function findIndex(predicate /* , thisArg */) {\n return $findIndex(aTypedArray(this), predicate, arguments.length > 1 ? arguments[1] : undefined);\n});\n","'use strict';\nvar ArrayBufferViewCore = require('../internals/array-buffer-view-core');\nvar $forEach = require('../internals/array-iteration').forEach;\n\nvar aTypedArray = ArrayBufferViewCore.aTypedArray;\nvar exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod;\n\n// `%TypedArray%.prototype.forEach` method\n// https://tc39.es/ecma262/#sec-%typedarray%.prototype.foreach\nexportTypedArrayMethod('forEach', function forEach(callbackfn /* , thisArg */) {\n $forEach(aTypedArray(this), callbackfn, arguments.length > 1 ? arguments[1] : undefined);\n});\n","'use strict';\nvar ArrayBufferViewCore = require('../internals/array-buffer-view-core');\nvar $includes = require('../internals/array-includes').includes;\n\nvar aTypedArray = ArrayBufferViewCore.aTypedArray;\nvar exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod;\n\n// `%TypedArray%.prototype.includes` method\n// https://tc39.es/ecma262/#sec-%typedarray%.prototype.includes\nexportTypedArrayMethod('includes', function includes(searchElement /* , fromIndex */) {\n return $includes(aTypedArray(this), searchElement, arguments.length > 1 ? arguments[1] : undefined);\n});\n","'use strict';\nvar ArrayBufferViewCore = require('../internals/array-buffer-view-core');\nvar $indexOf = require('../internals/array-includes').indexOf;\n\nvar aTypedArray = ArrayBufferViewCore.aTypedArray;\nvar exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod;\n\n// `%TypedArray%.prototype.indexOf` method\n// https://tc39.es/ecma262/#sec-%typedarray%.prototype.indexof\nexportTypedArrayMethod('indexOf', function indexOf(searchElement /* , fromIndex */) {\n return $indexOf(aTypedArray(this), searchElement, arguments.length > 1 ? arguments[1] : undefined);\n});\n","'use strict';\nvar global = require('../internals/global');\nvar ArrayBufferViewCore = require('../internals/array-buffer-view-core');\nvar ArrayIterators = require('../modules/es.array.iterator');\nvar wellKnownSymbol = require('../internals/well-known-symbol');\n\nvar ITERATOR = wellKnownSymbol('iterator');\nvar Uint8Array = global.Uint8Array;\nvar arrayValues = ArrayIterators.values;\nvar arrayKeys = ArrayIterators.keys;\nvar arrayEntries = ArrayIterators.entries;\nvar aTypedArray = ArrayBufferViewCore.aTypedArray;\nvar exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod;\nvar nativeTypedArrayIterator = Uint8Array && Uint8Array.prototype[ITERATOR];\n\nvar CORRECT_ITER_NAME = !!nativeTypedArrayIterator\n && (nativeTypedArrayIterator.name == 'values' || nativeTypedArrayIterator.name == undefined);\n\nvar typedArrayValues = function values() {\n return arrayValues.call(aTypedArray(this));\n};\n\n// `%TypedArray%.prototype.entries` method\n// https://tc39.es/ecma262/#sec-%typedarray%.prototype.entries\nexportTypedArrayMethod('entries', function entries() {\n return arrayEntries.call(aTypedArray(this));\n});\n// `%TypedArray%.prototype.keys` method\n// https://tc39.es/ecma262/#sec-%typedarray%.prototype.keys\nexportTypedArrayMethod('keys', function keys() {\n return arrayKeys.call(aTypedArray(this));\n});\n// `%TypedArray%.prototype.values` method\n// https://tc39.es/ecma262/#sec-%typedarray%.prototype.values\nexportTypedArrayMethod('values', typedArrayValues, !CORRECT_ITER_NAME);\n// `%TypedArray%.prototype[@@iterator]` method\n// https://tc39.es/ecma262/#sec-%typedarray%.prototype-@@iterator\nexportTypedArrayMethod(ITERATOR, typedArrayValues, !CORRECT_ITER_NAME);\n","'use strict';\nvar ArrayBufferViewCore = require('../internals/array-buffer-view-core');\n\nvar aTypedArray = ArrayBufferViewCore.aTypedArray;\nvar exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod;\nvar $join = [].join;\n\n// `%TypedArray%.prototype.join` method\n// https://tc39.es/ecma262/#sec-%typedarray%.prototype.join\n// eslint-disable-next-line no-unused-vars -- required for `.length`\nexportTypedArrayMethod('join', function join(separator) {\n return $join.apply(aTypedArray(this), arguments);\n});\n","'use strict';\nvar fails = require('../internals/fails');\n\nmodule.exports = function (METHOD_NAME, argument) {\n var method = [][METHOD_NAME];\n return !!method && fails(function () {\n // eslint-disable-next-line no-useless-call,no-throw-literal -- required for testing\n method.call(null, argument || function () { throw 1; }, 1);\n });\n};\n","'use strict';\n/* eslint-disable es/no-array-prototype-lastindexof -- safe */\nvar toIndexedObject = require('../internals/to-indexed-object');\nvar toInteger = require('../internals/to-integer');\nvar toLength = require('../internals/to-length');\nvar arrayMethodIsStrict = require('../internals/array-method-is-strict');\n\nvar min = Math.min;\nvar $lastIndexOf = [].lastIndexOf;\nvar NEGATIVE_ZERO = !!$lastIndexOf && 1 / [1].lastIndexOf(1, -0) < 0;\nvar STRICT_METHOD = arrayMethodIsStrict('lastIndexOf');\nvar FORCED = NEGATIVE_ZERO || !STRICT_METHOD;\n\n// `Array.prototype.lastIndexOf` method implementation\n// https://tc39.es/ecma262/#sec-array.prototype.lastindexof\nmodule.exports = FORCED ? function lastIndexOf(searchElement /* , fromIndex = @[*-1] */) {\n // convert -0 to +0\n if (NEGATIVE_ZERO) return $lastIndexOf.apply(this, arguments) || 0;\n var O = toIndexedObject(this);\n var length = toLength(O.length);\n var index = length - 1;\n if (arguments.length > 1) index = min(index, toInteger(arguments[1]));\n if (index < 0) index = length + index;\n for (;index >= 0; index--) if (index in O && O[index] === searchElement) return index || 0;\n return -1;\n} : $lastIndexOf;\n","'use strict';\nvar ArrayBufferViewCore = require('../internals/array-buffer-view-core');\nvar $lastIndexOf = require('../internals/array-last-index-of');\n\nvar aTypedArray = ArrayBufferViewCore.aTypedArray;\nvar exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod;\n\n// `%TypedArray%.prototype.lastIndexOf` method\n// https://tc39.es/ecma262/#sec-%typedarray%.prototype.lastindexof\n// eslint-disable-next-line no-unused-vars -- required for `.length`\nexportTypedArrayMethod('lastIndexOf', function lastIndexOf(searchElement /* , fromIndex */) {\n return $lastIndexOf.apply(aTypedArray(this), arguments);\n});\n","'use strict';\nvar ArrayBufferViewCore = require('../internals/array-buffer-view-core');\nvar $map = require('../internals/array-iteration').map;\nvar typedArraySpeciesConstructor = require('../internals/typed-array-species-constructor');\n\nvar aTypedArray = ArrayBufferViewCore.aTypedArray;\nvar exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod;\n\n// `%TypedArray%.prototype.map` method\n// https://tc39.es/ecma262/#sec-%typedarray%.prototype.map\nexportTypedArrayMethod('map', function map(mapfn /* , thisArg */) {\n return $map(aTypedArray(this), mapfn, arguments.length > 1 ? arguments[1] : undefined, function (O, length) {\n return new (typedArraySpeciesConstructor(O))(length);\n });\n});\n","var aFunction = require('../internals/a-function');\nvar toObject = require('../internals/to-object');\nvar IndexedObject = require('../internals/indexed-object');\nvar toLength = require('../internals/to-length');\n\n// `Array.prototype.{ reduce, reduceRight }` methods implementation\nvar createMethod = function (IS_RIGHT) {\n return function (that, callbackfn, argumentsLength, memo) {\n aFunction(callbackfn);\n var O = toObject(that);\n var self = IndexedObject(O);\n var length = toLength(O.length);\n var index = IS_RIGHT ? length - 1 : 0;\n var i = IS_RIGHT ? -1 : 1;\n if (argumentsLength < 2) while (true) {\n if (index in self) {\n memo = self[index];\n index += i;\n break;\n }\n index += i;\n if (IS_RIGHT ? index < 0 : length <= index) {\n throw TypeError('Reduce of empty array with no initial value');\n }\n }\n for (;IS_RIGHT ? index >= 0 : length > index; index += i) if (index in self) {\n memo = callbackfn(memo, self[index], index, O);\n }\n return memo;\n };\n};\n\nmodule.exports = {\n // `Array.prototype.reduce` method\n // https://tc39.es/ecma262/#sec-array.prototype.reduce\n left: createMethod(false),\n // `Array.prototype.reduceRight` method\n // https://tc39.es/ecma262/#sec-array.prototype.reduceright\n right: createMethod(true)\n};\n","'use strict';\nvar ArrayBufferViewCore = require('../internals/array-buffer-view-core');\nvar $reduce = require('../internals/array-reduce').left;\n\nvar aTypedArray = ArrayBufferViewCore.aTypedArray;\nvar exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod;\n\n// `%TypedArray%.prototype.reduce` method\n// https://tc39.es/ecma262/#sec-%typedarray%.prototype.reduce\nexportTypedArrayMethod('reduce', function reduce(callbackfn /* , initialValue */) {\n return $reduce(aTypedArray(this), callbackfn, arguments.length, arguments.length > 1 ? arguments[1] : undefined);\n});\n","'use strict';\nvar ArrayBufferViewCore = require('../internals/array-buffer-view-core');\nvar $reduceRight = require('../internals/array-reduce').right;\n\nvar aTypedArray = ArrayBufferViewCore.aTypedArray;\nvar exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod;\n\n// `%TypedArray%.prototype.reduceRicht` method\n// https://tc39.es/ecma262/#sec-%typedarray%.prototype.reduceright\nexportTypedArrayMethod('reduceRight', function reduceRight(callbackfn /* , initialValue */) {\n return $reduceRight(aTypedArray(this), callbackfn, arguments.length, arguments.length > 1 ? arguments[1] : undefined);\n});\n","'use strict';\nvar ArrayBufferViewCore = require('../internals/array-buffer-view-core');\n\nvar aTypedArray = ArrayBufferViewCore.aTypedArray;\nvar exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod;\nvar floor = Math.floor;\n\n// `%TypedArray%.prototype.reverse` method\n// https://tc39.es/ecma262/#sec-%typedarray%.prototype.reverse\nexportTypedArrayMethod('reverse', function reverse() {\n var that = this;\n var length = aTypedArray(that).length;\n var middle = floor(length / 2);\n var index = 0;\n var value;\n while (index < middle) {\n value = that[index];\n that[index++] = that[--length];\n that[length] = value;\n } return that;\n});\n","'use strict';\nvar ArrayBufferViewCore = require('../internals/array-buffer-view-core');\nvar toLength = require('../internals/to-length');\nvar toOffset = require('../internals/to-offset');\nvar toObject = require('../internals/to-object');\nvar fails = require('../internals/fails');\n\nvar aTypedArray = ArrayBufferViewCore.aTypedArray;\nvar exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod;\n\nvar FORCED = fails(function () {\n // eslint-disable-next-line es/no-typed-arrays -- required for testing\n new Int8Array(1).set({});\n});\n\n// `%TypedArray%.prototype.set` method\n// https://tc39.es/ecma262/#sec-%typedarray%.prototype.set\nexportTypedArrayMethod('set', function set(arrayLike /* , offset */) {\n aTypedArray(this);\n var offset = toOffset(arguments.length > 1 ? arguments[1] : undefined, 1);\n var length = this.length;\n var src = toObject(arrayLike);\n var len = toLength(src.length);\n var index = 0;\n if (len + offset > length) throw RangeError('Wrong length');\n while (index < len) this[offset + index] = src[index++];\n}, FORCED);\n","'use strict';\nvar ArrayBufferViewCore = require('../internals/array-buffer-view-core');\nvar typedArraySpeciesConstructor = require('../internals/typed-array-species-constructor');\nvar fails = require('../internals/fails');\n\nvar aTypedArray = ArrayBufferViewCore.aTypedArray;\nvar exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod;\nvar $slice = [].slice;\n\nvar FORCED = fails(function () {\n // eslint-disable-next-line es/no-typed-arrays -- required for testing\n new Int8Array(1).slice();\n});\n\n// `%TypedArray%.prototype.slice` method\n// https://tc39.es/ecma262/#sec-%typedarray%.prototype.slice\nexportTypedArrayMethod('slice', function slice(start, end) {\n var list = $slice.call(aTypedArray(this), start, end);\n var C = typedArraySpeciesConstructor(this);\n var index = 0;\n var length = list.length;\n var result = new C(length);\n while (length > index) result[index] = list[index++];\n return result;\n}, FORCED);\n","'use strict';\nvar ArrayBufferViewCore = require('../internals/array-buffer-view-core');\nvar $some = require('../internals/array-iteration').some;\n\nvar aTypedArray = ArrayBufferViewCore.aTypedArray;\nvar exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod;\n\n// `%TypedArray%.prototype.some` method\n// https://tc39.es/ecma262/#sec-%typedarray%.prototype.some\nexportTypedArrayMethod('some', function some(callbackfn /* , thisArg */) {\n return $some(aTypedArray(this), callbackfn, arguments.length > 1 ? arguments[1] : undefined);\n});\n","// TODO: use something more complex like timsort?\nvar floor = Math.floor;\n\nvar mergeSort = function (array, comparefn) {\n var length = array.length;\n var middle = floor(length / 2);\n return length < 8 ? insertionSort(array, comparefn) : merge(\n mergeSort(array.slice(0, middle), comparefn),\n mergeSort(array.slice(middle), comparefn),\n comparefn\n );\n};\n\nvar insertionSort = function (array, comparefn) {\n var length = array.length;\n var i = 1;\n var element, j;\n\n while (i < length) {\n j = i;\n element = array[i];\n while (j && comparefn(array[j - 1], element) > 0) {\n array[j] = array[--j];\n }\n if (j !== i++) array[j] = element;\n } return array;\n};\n\nvar merge = function (left, right, comparefn) {\n var llength = left.length;\n var rlength = right.length;\n var lindex = 0;\n var rindex = 0;\n var result = [];\n\n while (lindex < llength || rindex < rlength) {\n if (lindex < llength && rindex < rlength) {\n result.push(comparefn(left[lindex], right[rindex]) <= 0 ? left[lindex++] : right[rindex++]);\n } else {\n result.push(lindex < llength ? left[lindex++] : right[rindex++]);\n }\n } return result;\n};\n\nmodule.exports = mergeSort;\n","var userAgent = require('../internals/engine-user-agent');\n\nvar firefox = userAgent.match(/firefox\\/(\\d+)/i);\n\nmodule.exports = !!firefox && +firefox[1];\n","'use strict';\nvar ArrayBufferViewCore = require('../internals/array-buffer-view-core');\nvar global = require('../internals/global');\nvar fails = require('../internals/fails');\nvar aFunction = require('../internals/a-function');\nvar toLength = require('../internals/to-length');\nvar internalSort = require('../internals/array-sort');\nvar FF = require('../internals/engine-ff-version');\nvar IE_OR_EDGE = require('../internals/engine-is-ie-or-edge');\nvar V8 = require('../internals/engine-v8-version');\nvar WEBKIT = require('../internals/engine-webkit-version');\n\nvar aTypedArray = ArrayBufferViewCore.aTypedArray;\nvar exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod;\nvar Uint16Array = global.Uint16Array;\nvar nativeSort = Uint16Array && Uint16Array.prototype.sort;\n\n// WebKit\nvar ACCEPT_INCORRECT_ARGUMENTS = !!nativeSort && !fails(function () {\n var array = new Uint16Array(2);\n array.sort(null);\n array.sort({});\n});\n\nvar STABLE_SORT = !!nativeSort && !fails(function () {\n // feature detection can be too slow, so check engines versions\n if (V8) return V8 < 74;\n if (FF) return FF < 67;\n if (IE_OR_EDGE) return true;\n if (WEBKIT) return WEBKIT < 602;\n\n var array = new Uint16Array(516);\n var expected = Array(516);\n var index, mod;\n\n for (index = 0; index < 516; index++) {\n mod = index % 4;\n array[index] = 515 - index;\n expected[index] = index - 2 * mod + 3;\n }\n\n array.sort(function (a, b) {\n return (a / 4 | 0) - (b / 4 | 0);\n });\n\n for (index = 0; index < 516; index++) {\n if (array[index] !== expected[index]) return true;\n }\n});\n\nvar getSortCompare = function (comparefn) {\n return function (x, y) {\n if (comparefn !== undefined) return +comparefn(x, y) || 0;\n // eslint-disable-next-line no-self-compare -- NaN check\n if (y !== y) return -1;\n // eslint-disable-next-line no-self-compare -- NaN check\n if (x !== x) return 1;\n if (x === 0 && y === 0) return 1 / x > 0 && 1 / y < 0 ? 1 : -1;\n return x > y;\n };\n};\n\n// `%TypedArray%.prototype.sort` method\n// https://tc39.es/ecma262/#sec-%typedarray%.prototype.sort\nexportTypedArrayMethod('sort', function sort(comparefn) {\n var array = this;\n if (comparefn !== undefined) aFunction(comparefn);\n if (STABLE_SORT) return nativeSort.call(array, comparefn);\n\n aTypedArray(array);\n var arrayLength = toLength(array.length);\n var items = Array(arrayLength);\n var index;\n\n for (index = 0; index < arrayLength; index++) {\n items[index] = array[index];\n }\n\n items = internalSort(array, getSortCompare(comparefn));\n\n for (index = 0; index < arrayLength; index++) {\n array[index] = items[index];\n }\n\n return array;\n}, !STABLE_SORT || ACCEPT_INCORRECT_ARGUMENTS);\n","'use strict';\nvar ArrayBufferViewCore = require('../internals/array-buffer-view-core');\nvar toLength = require('../internals/to-length');\nvar toAbsoluteIndex = require('../internals/to-absolute-index');\nvar typedArraySpeciesConstructor = require('../internals/typed-array-species-constructor');\n\nvar aTypedArray = ArrayBufferViewCore.aTypedArray;\nvar exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod;\n\n// `%TypedArray%.prototype.subarray` method\n// https://tc39.es/ecma262/#sec-%typedarray%.prototype.subarray\nexportTypedArrayMethod('subarray', function subarray(begin, end) {\n var O = aTypedArray(this);\n var length = O.length;\n var beginIndex = toAbsoluteIndex(begin, length);\n var C = typedArraySpeciesConstructor(O);\n return new C(\n O.buffer,\n O.byteOffset + beginIndex * O.BYTES_PER_ELEMENT,\n toLength((end === undefined ? length : toAbsoluteIndex(end, length)) - beginIndex)\n );\n});\n","'use strict';\nvar global = require('../internals/global');\nvar ArrayBufferViewCore = require('../internals/array-buffer-view-core');\nvar fails = require('../internals/fails');\n\nvar Int8Array = global.Int8Array;\nvar aTypedArray = ArrayBufferViewCore.aTypedArray;\nvar exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod;\nvar $toLocaleString = [].toLocaleString;\nvar $slice = [].slice;\n\n// iOS Safari 6.x fails here\nvar TO_LOCALE_STRING_BUG = !!Int8Array && fails(function () {\n $toLocaleString.call(new Int8Array(1));\n});\n\nvar FORCED = fails(function () {\n return [1, 2].toLocaleString() != new Int8Array([1, 2]).toLocaleString();\n}) || !fails(function () {\n Int8Array.prototype.toLocaleString.call([1, 2]);\n});\n\n// `%TypedArray%.prototype.toLocaleString` method\n// https://tc39.es/ecma262/#sec-%typedarray%.prototype.tolocalestring\nexportTypedArrayMethod('toLocaleString', function toLocaleString() {\n return $toLocaleString.apply(TO_LOCALE_STRING_BUG ? $slice.call(aTypedArray(this)) : aTypedArray(this), arguments);\n}, FORCED);\n","'use strict';\nvar exportTypedArrayMethod = require('../internals/array-buffer-view-core').exportTypedArrayMethod;\nvar fails = require('../internals/fails');\nvar global = require('../internals/global');\n\nvar Uint8Array = global.Uint8Array;\nvar Uint8ArrayPrototype = Uint8Array && Uint8Array.prototype || {};\nvar arrayToString = [].toString;\nvar arrayJoin = [].join;\n\nif (fails(function () { arrayToString.call({}); })) {\n arrayToString = function toString() {\n return arrayJoin.call(this);\n };\n}\n\nvar IS_NOT_ARRAY_METHOD = Uint8ArrayPrototype.toString != arrayToString;\n\n// `%TypedArray%.prototype.toString` method\n// https://tc39.es/ecma262/#sec-%typedarray%.prototype.tostring\nexportTypedArrayMethod('toString', arrayToString, IS_NOT_ARRAY_METHOD);\n","'use strict';\nvar toPropertyKey = require('../internals/to-property-key');\nvar definePropertyModule = require('../internals/object-define-property');\nvar createPropertyDescriptor = require('../internals/create-property-descriptor');\n\nmodule.exports = function (object, key, value) {\n var propertyKey = toPropertyKey(key);\n if (propertyKey in object) definePropertyModule.f(object, propertyKey, createPropertyDescriptor(0, value));\n else object[propertyKey] = value;\n};\n","var fails = require('../internals/fails');\nvar wellKnownSymbol = require('../internals/well-known-symbol');\nvar V8_VERSION = require('../internals/engine-v8-version');\n\nvar SPECIES = wellKnownSymbol('species');\n\nmodule.exports = function (METHOD_NAME) {\n // We can't use this feature detection in V8 since it causes\n // deoptimization and serious performance degradation\n // https://github.com/zloirock/core-js/issues/677\n return V8_VERSION >= 51 || !fails(function () {\n var array = [];\n var constructor = array.constructor = {};\n constructor[SPECIES] = function () {\n return { foo: 1 };\n };\n return array[METHOD_NAME](Boolean).foo !== 1;\n });\n};\n","'use strict';\nvar $ = require('../internals/export');\nvar isObject = require('../internals/is-object');\nvar isArray = require('../internals/is-array');\nvar toAbsoluteIndex = require('../internals/to-absolute-index');\nvar toLength = require('../internals/to-length');\nvar toIndexedObject = require('../internals/to-indexed-object');\nvar createProperty = require('../internals/create-property');\nvar wellKnownSymbol = require('../internals/well-known-symbol');\nvar arrayMethodHasSpeciesSupport = require('../internals/array-method-has-species-support');\n\nvar HAS_SPECIES_SUPPORT = arrayMethodHasSpeciesSupport('slice');\n\nvar SPECIES = wellKnownSymbol('species');\nvar nativeSlice = [].slice;\nvar max = Math.max;\n\n// `Array.prototype.slice` method\n// https://tc39.es/ecma262/#sec-array.prototype.slice\n// fallback for not array-like ES3 strings and DOM objects\n$({ target: 'Array', proto: true, forced: !HAS_SPECIES_SUPPORT }, {\n slice: function slice(start, end) {\n var O = toIndexedObject(this);\n var length = toLength(O.length);\n var k = toAbsoluteIndex(start, length);\n var fin = toAbsoluteIndex(end === undefined ? length : end, length);\n // inline `ArraySpeciesCreate` for usage native `Array#slice` where it's possible\n var Constructor, result, n;\n if (isArray(O)) {\n Constructor = O.constructor;\n // cross-realm fallback\n if (typeof Constructor == 'function' && (Constructor === Array || isArray(Constructor.prototype))) {\n Constructor = undefined;\n } else if (isObject(Constructor)) {\n Constructor = Constructor[SPECIES];\n if (Constructor === null) Constructor = undefined;\n }\n if (Constructor === Array || Constructor === undefined) {\n return nativeSlice.call(O, k, fin);\n }\n }\n result = new (Constructor === undefined ? Array : Constructor)(max(fin - k, 0));\n for (n = 0; k < fin; k++, n++) if (k in O) createProperty(result, n, O[k]);\n result.length = n;\n return result;\n }\n});\n","'use strict';\nvar $ = require('../internals/export');\nvar $filter = require('../internals/array-iteration').filter;\nvar arrayMethodHasSpeciesSupport = require('../internals/array-method-has-species-support');\n\nvar HAS_SPECIES_SUPPORT = arrayMethodHasSpeciesSupport('filter');\n\n// `Array.prototype.filter` method\n// https://tc39.es/ecma262/#sec-array.prototype.filter\n// with adding support of @@species\n$({ target: 'Array', proto: true, forced: !HAS_SPECIES_SUPPORT }, {\n filter: function filter(callbackfn /* , thisArg */) {\n return $filter(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined);\n }\n});\n","'use strict';\nvar redefine = require('../internals/redefine');\nvar anObject = require('../internals/an-object');\nvar $toString = require('../internals/to-string');\nvar fails = require('../internals/fails');\nvar flags = require('../internals/regexp-flags');\n\nvar TO_STRING = 'toString';\nvar RegExpPrototype = RegExp.prototype;\nvar nativeToString = RegExpPrototype[TO_STRING];\n\nvar NOT_GENERIC = fails(function () { return nativeToString.call({ source: 'a', flags: 'b' }) != '/a/b'; });\n// FF44- RegExp#toString has a wrong name\nvar INCORRECT_NAME = nativeToString.name != TO_STRING;\n\n// `RegExp.prototype.toString` method\n// https://tc39.es/ecma262/#sec-regexp.prototype.tostring\nif (NOT_GENERIC || INCORRECT_NAME) {\n redefine(RegExp.prototype, TO_STRING, function toString() {\n var R = anObject(this);\n var p = $toString(R.source);\n var rf = R.flags;\n var f = $toString(rf === undefined && R instanceof RegExp && !('flags' in RegExpPrototype) ? flags.call(R) : rf);\n return '/' + p + '/' + f;\n }, { unsafe: true });\n}\n","'use strict';\nvar $ = require('../internals/export');\nvar aFunction = require('../internals/a-function');\nvar toObject = require('../internals/to-object');\nvar toLength = require('../internals/to-length');\nvar toString = require('../internals/to-string');\nvar fails = require('../internals/fails');\nvar internalSort = require('../internals/array-sort');\nvar arrayMethodIsStrict = require('../internals/array-method-is-strict');\nvar FF = require('../internals/engine-ff-version');\nvar IE_OR_EDGE = require('../internals/engine-is-ie-or-edge');\nvar V8 = require('../internals/engine-v8-version');\nvar WEBKIT = require('../internals/engine-webkit-version');\n\nvar test = [];\nvar nativeSort = test.sort;\n\n// IE8-\nvar FAILS_ON_UNDEFINED = fails(function () {\n test.sort(undefined);\n});\n// V8 bug\nvar FAILS_ON_NULL = fails(function () {\n test.sort(null);\n});\n// Old WebKit\nvar STRICT_METHOD = arrayMethodIsStrict('sort');\n\nvar STABLE_SORT = !fails(function () {\n // feature detection can be too slow, so check engines versions\n if (V8) return V8 < 70;\n if (FF && FF > 3) return;\n if (IE_OR_EDGE) return true;\n if (WEBKIT) return WEBKIT < 603;\n\n var result = '';\n var code, chr, value, index;\n\n // generate an array with more 512 elements (Chakra and old V8 fails only in this case)\n for (code = 65; code < 76; code++) {\n chr = String.fromCharCode(code);\n\n switch (code) {\n case 66: case 69: case 70: case 72: value = 3; break;\n case 68: case 71: value = 4; break;\n default: value = 2;\n }\n\n for (index = 0; index < 47; index++) {\n test.push({ k: chr + index, v: value });\n }\n }\n\n test.sort(function (a, b) { return b.v - a.v; });\n\n for (index = 0; index < test.length; index++) {\n chr = test[index].k.charAt(0);\n if (result.charAt(result.length - 1) !== chr) result += chr;\n }\n\n return result !== 'DGBEFHACIJK';\n});\n\nvar FORCED = FAILS_ON_UNDEFINED || !FAILS_ON_NULL || !STRICT_METHOD || !STABLE_SORT;\n\nvar getSortCompare = function (comparefn) {\n return function (x, y) {\n if (y === undefined) return -1;\n if (x === undefined) return 1;\n if (comparefn !== undefined) return +comparefn(x, y) || 0;\n return toString(x) > toString(y) ? 1 : -1;\n };\n};\n\n// `Array.prototype.sort` method\n// https://tc39.es/ecma262/#sec-array.prototype.sort\n$({ target: 'Array', proto: true, forced: FORCED }, {\n sort: function sort(comparefn) {\n if (comparefn !== undefined) aFunction(comparefn);\n\n var array = toObject(this);\n\n if (STABLE_SORT) return comparefn === undefined ? nativeSort.call(array) : nativeSort.call(array, comparefn);\n\n var items = [];\n var arrayLength = toLength(array.length);\n var itemsLength, index;\n\n for (index = 0; index < arrayLength; index++) {\n if (index in array) items.push(array[index]);\n }\n\n items = internalSort(items, getSortCompare(comparefn));\n itemsLength = items.length;\n index = 0;\n\n while (index < itemsLength) array[index] = items[index++];\n while (index < arrayLength) delete array[index++];\n\n return array;\n }\n});\n","\r\n\r\nvar UZIP = {};\r\nif(typeof module == \"object\") module.exports = UZIP;\r\n\r\n\r\nUZIP[\"parse\"] = function(buf, onlyNames)\t// ArrayBuffer\r\n{\r\n\tvar rUs = UZIP.bin.readUshort, rUi = UZIP.bin.readUint, o = 0, out = {};\r\n\tvar data = new Uint8Array(buf);\r\n\tvar eocd = data.length-4;\r\n\t\r\n\twhile(rUi(data, eocd)!=0x06054b50) eocd--;\r\n\t\r\n\tvar o = eocd;\r\n\to+=4;\t// sign = 0x06054b50\r\n\to+=4; // disks = 0;\r\n\tvar cnu = rUs(data, o); o+=2;\r\n\tvar cnt = rUs(data, o); o+=2;\r\n\t\t\t\r\n\tvar csize = rUi(data, o); o+=4;\r\n\tvar coffs = rUi(data, o); o+=4;\r\n\t\r\n\to = coffs;\r\n\tfor(var i=0; i8514000) {\r\n\t\t\t//console.log(PUtils.readASCII(buf , 8514500, 500));\r\n\t\t\t//console.log(PUtils.readASCII(nbuf, 8514500, 500));\r\n\t\t}\r\n\t\tfor(var i=0; i>>4);\r\n\t//console.log(CM, CINFO,CMF,FLG);\r\n\treturn UZIP.inflateRaw(new Uint8Array(file.buffer, file.byteOffset+2, file.length-6), buf); \r\n}\r\nUZIP.deflate = function(data, opts/*, buf, off*/) {\r\n\tif(opts==null) opts={level:6};\r\n\tvar off=0, buf=new Uint8Array(50+Math.floor(data.length*1.1));\r\n\tbuf[off]=120; buf[off+1]=156; off+=2;\r\n\toff = UZIP.F.deflateRaw(data, buf, off, opts.level);\r\n\tvar crc = UZIP.adler(data, 0, data.length);\r\n\tbuf[off+0]=((crc>>>24)&255); \r\n\tbuf[off+1]=((crc>>>16)&255); \r\n\tbuf[off+2]=((crc>>> 8)&255); \r\n\tbuf[off+3]=((crc>>> 0)&255); \t\r\n\treturn new Uint8Array(buf.buffer, 0, off+4);\r\n}\r\nUZIP.deflateRaw = function(data, opts) {\r\n\tif(opts==null) opts={level:6};\r\n\tvar buf=new Uint8Array(50+Math.floor(data.length*1.1));\r\n\tvar off = UZIP.F.deflateRaw(data, buf, off, opts.level);\r\n\treturn new Uint8Array(buf.buffer, 0, off);\r\n}\r\n\r\n\r\nUZIP.encode = function(obj, noCmpr) {\r\n\tif(noCmpr==null) noCmpr=false;\r\n\tvar tot = 0, wUi = UZIP.bin.writeUint, wUs = UZIP.bin.writeUshort;\r\n\tvar zpd = {};\r\n\tfor(var p in obj) { var cpr = !UZIP._noNeed(p) && !noCmpr, buf = obj[p], crc = UZIP.crc.crc(buf,0,buf.length); \r\n\t\tzpd[p] = { cpr:cpr, usize:buf.length, crc:crc, file: (cpr ? UZIP.deflateRaw(buf) : buf) }; }\r\n\t\r\n\tfor(var p in zpd) tot += zpd[p].file.length + 30 + 46 + 2*UZIP.bin.sizeUTF8(p);\r\n\ttot += 22;\r\n\t\r\n\tvar data = new Uint8Array(tot), o = 0;\r\n\tvar fof = []\r\n\t\r\n\tfor(var p in zpd) {\r\n\t\tvar file = zpd[p]; fof.push(o);\r\n\t\to = UZIP._writeHeader(data, o, p, file, 0);\r\n\t}\r\n\tvar i=0, ioff = o;\r\n\tfor(var p in zpd) {\r\n\t\tvar file = zpd[p]; fof.push(o);\r\n\t\to = UZIP._writeHeader(data, o, p, file, 1, fof[i++]);\t\t\r\n\t}\r\n\tvar csize = o-ioff;\r\n\t\r\n\twUi(data, o, 0x06054b50); o+=4;\r\n\to += 4; // disks\r\n\twUs(data, o, i); o += 2;\r\n\twUs(data, o, i); o += 2;\t// number of c d records\r\n\twUi(data, o, csize); o += 4;\r\n\twUi(data, o, ioff ); o += 4;\r\n\to += 2;\r\n\treturn data.buffer;\r\n}\r\n// no need to compress .PNG, .ZIP, .JPEG ....\r\nUZIP._noNeed = function(fn) { var ext = fn.split(\".\").pop().toLowerCase(); return \"png,jpg,jpeg,zip\".indexOf(ext)!=-1; }\r\n\r\nUZIP._writeHeader = function(data, o, p, obj, t, roff)\r\n{\r\n\tvar wUi = UZIP.bin.writeUint, wUs = UZIP.bin.writeUshort;\r\n\tvar file = obj.file;\r\n\t\r\n\twUi(data, o, t==0 ? 0x04034b50 : 0x02014b50); o+=4; // sign\r\n\tif(t==1) o+=2; // ver made by\r\n\twUs(data, o, 20); o+=2;\t// ver\r\n\twUs(data, o, 0); o+=2; // gflip\r\n\twUs(data, o, obj.cpr?8:0); o+=2;\t// cmpr\r\n\t\t\r\n\twUi(data, o, 0); o+=4;\t// time\t\t\r\n\twUi(data, o, obj.crc); o+=4;\t// crc32\r\n\twUi(data, o, file.length); o+=4;\t// csize\r\n\twUi(data, o, obj.usize); o+=4;\t// usize\r\n\t\t\r\n\twUs(data, o, UZIP.bin.sizeUTF8(p)); o+=2;\t// nlen\r\n\twUs(data, o, 0); o+=2;\t// elen\r\n\t\r\n\tif(t==1) {\r\n\t\to += 2; // comment length\r\n\t\to += 2; // disk number\r\n\t\to += 6; // attributes\r\n\t\twUi(data, o, roff); o+=4;\t// usize\r\n\t}\r\n\tvar nlen = UZIP.bin.writeUTF8(data, o, p); o+= nlen;\t\r\n\tif(t==0) { data.set(file, o); o += file.length; }\r\n\treturn o;\r\n}\r\n\r\n\r\n\r\n\r\n\r\nUZIP.crc = {\r\n\ttable : ( function() {\r\n\t var tab = new Uint32Array(256);\r\n\t for (var n=0; n<256; n++) {\r\n\t\t\tvar c = n;\r\n\t\t\tfor (var k=0; k<8; k++) {\r\n\t\t\t\tif (c & 1) c = 0xedb88320 ^ (c >>> 1);\r\n\t\t\t\telse c = c >>> 1;\r\n\t\t\t}\r\n\t\t\ttab[n] = c; } \r\n\t\treturn tab; })(),\r\n\tupdate : function(c, buf, off, len) {\r\n\t\tfor (var i=0; i>> 8);\r\n\t\treturn c;\r\n\t},\r\n\tcrc : function(b,o,l) { return UZIP.crc.update(0xffffffff,b,o,l) ^ 0xffffffff; }\r\n}\r\nUZIP.adler = function(data,o,len) {\r\n\tvar a = 1, b = 0;\r\n\tvar off = o, end=o+len;\r\n\twhile(off>8)&255; },\r\n\treadUint : function(buff,p) { return (buff[p+3]*(256*256*256)) + ((buff[p+2]<<16) | (buff[p+1]<< 8) | buff[p]); },\r\n\twriteUint : function(buff,p,n){ buff[p]=n&255; buff[p+1]=(n>>8)&255; buff[p+2]=(n>>16)&255; buff[p+3]=(n>>24)&255; },\r\n\treadASCII : function(buff,p,l){ var s = \"\"; for(var i=0; i> 6)); buff[p+i+1] = (128|((code>> 0)&63)); i+=2; }\r\n\t\t\telse if((code&(0xffffffff-(1<<16)+1))==0) { buff[p+i] = (224|(code>>12)); buff[p+i+1] = (128|((code>> 6)&63)); buff[p+i+2] = (128|((code>>0)&63)); i+=3; }\r\n\t\t\telse if((code&(0xffffffff-(1<<21)+1))==0) { buff[p+i] = (240|(code>>18)); buff[p+i+1] = (128|((code>>12)&63)); buff[p+i+2] = (128|((code>>6)&63)); buff[p+i+3] = (128|((code>>0)&63)); i+=4; }\r\n\t\t\telse throw \"e\";\r\n\t\t}\r\n\t\treturn i;\r\n\t},\r\n\tsizeUTF8 : function(str) {\r\n\t\tvar strl = str.length, i=0;\r\n\t\tfor(var ci=0; ci>>3;\r\n\t}\r\n\r\n\tvar lits = U.lits, strt=U.strt, prev=U.prev, li=0, lc=0, bs=0, ebits=0, c=0, nc=0; // last_item, literal_count, block_start\r\n\tif(dlen>2) { nc=UZIP.F._hash(data,0); strt[nc]=0; }\r\n\tvar nmch=0,nmci=0;\r\n\t\r\n\tfor(i=0; i14000 || lc>26697) && (dlen-i)>100) {\r\n\t\t\t\tif(cvrd>>16)>>16)>(mch>>>16)) mch=0;\r\n\t\t\t}//*/\r\n\t\t\tvar len = mch>>>16, dst = mch&0xffff; //if(i-dst<0) throw \"e\";\r\n\t\t\tif(mch!=0) { \r\n\t\t\t\tvar len = mch>>>16, dst = mch&0xffff; //if(i-dst<0) throw \"e\";\r\n\t\t\t\tvar lgi = goodIndex(len, U.of0); U.lhst[257+lgi]++; \r\n\t\t\t\tvar dgi = goodIndex(dst, U.df0); U.dhst[ dgi]++; ebits += U.exb[lgi] + U.dxb[dgi]; \r\n\t\t\t\tlits[li] = (len<<23)|(i-cvrd); lits[li+1] = (dst<<16)|(lgi<<8)|dgi; li+=2;\r\n\t\t\t\tcvrd = i + len; \r\n\t\t\t}\r\n\t\t\telse {\tU.lhst[data[i]]++; }\r\n\t\t\tlc++;\r\n\t\t}\r\n\t}\r\n\tif(bs!=i || data.length==0) {\r\n\t\tif(cvrd>>3;\r\n}\r\nUZIP.F._bestMatch = function(data, i, prev, c, nice, chain) {\r\n\tvar ci = (i&0x7fff), pi=prev[ci]; \r\n\t//console.log(\"----\", i);\r\n\tvar dif = ((ci-pi + (1<<15)) & 0x7fff); if(pi==ci || c!=UZIP.F._hash(data,i-dif)) return 0;\r\n\tvar tl=0, td=0; // top length, top distance\r\n\tvar dlim = Math.min(0x7fff, i);\r\n\twhile(dif<=dlim && --chain!=0 && pi!=ci /*&& c==UZIP.F._hash(data,i-dif)*/) {\r\n\t\tif(tl==0 || (data[i+tl]==data[i+tl-dif])) {\r\n\t\t\tvar cl = UZIP.F._howLong(data, i, dif);\r\n\t\t\tif(cl>tl) { \r\n\t\t\t\ttl=cl; td=dif; if(tl>=nice) break; //* \r\n\t\t\t\tif(dif+2maxd) { maxd=curd; pi = ei; }\r\n\t\t\t\t} //*/\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tci=pi; pi = prev[ci];\r\n\t\tdif += ((ci-pi + (1<<15)) & 0x7fff);\r\n\t}\r\n\treturn (tl<<16)|td;\r\n}\r\nUZIP.F._howLong = function(data, i, dif) {\r\n\tif(data[i]!=data[i-dif] || data[i+1]!=data[i+1-dif] || data[i+2]!=data[i+2-dif]) return 0;\r\n\tvar oi=i, l = Math.min(data.length, i+258); i+=3;\r\n\t//while(i+4>>23), end = off+(qb&((1<<23)-1));\r\n\t\t\twhile(off>16), lgi=(qc>>8)&255, dgi=(qc&255);\r\n\t\t\t\tpos = UZIP.F._writeLit(257+lgi, ltree, out, pos);\r\n\t\t\t\tputsE(out, pos, len-U.of0[lgi]); pos+=U.exb[lgi];\r\n\t\t\t\t\r\n\t\t\t\tpos = UZIP.F._writeLit(dgi, dtree, out, pos);\r\n\t\t\t\tputsF(out, pos, dst-U.df0[dgi]); pos+=U.dxb[dgi]; off+=len;\r\n\t\t\t}\r\n\t\t}\r\n\t\tpos = UZIP.F._writeLit(256, ltree, out, pos);\r\n\t}\r\n\t//console.log(pos-opos, fxdSize, dynSize, cstSize);\r\n\treturn pos;\r\n}\r\nUZIP.F._copyExact = function(data,off,len,out,pos) {\r\n\tvar p8 = (pos>>>3);\r\n\tout[p8]=(len); out[p8+1]=(len>>>8); out[p8+2]=255-out[p8]; out[p8+3]=255-out[p8+1]; p8+=4;\r\n\tout.set(new Uint8Array(data.buffer, off, len), p8);\r\n\t//for(var i=0; i4 && U.itree[(U.ordr[numh-1]<<1)+1]==0) numh--;\r\n\treturn [ML, MD, MH, numl, numd, numh, lset, dset];\r\n}\r\nUZIP.F.getSecond= function(a) { var b=[]; for(var i=0; i>1)+\",\"; return b; }\r\nUZIP.F.contSize = function(tree, hst) { var s=0; for(var i=0; i15) { UZIP.F._putsE(out, pos, rst, rsl); pos+=rsl; }\r\n\t}\r\n\treturn pos;\r\n}\r\nUZIP.F._lenCodes = function(tree, set) {\r\n\tvar len=tree.length; while(len!=2 && tree[len-1]==0) len-=2; // when no distances, keep one code with length 0\r\n\tfor(var i=0; i>>1, 138);\r\n\t\t\tif(zc<11) set.push(17, zc-3);\r\n\t\t\telse set.push(18, zc-11);\r\n\t\t\ti += zc*2-2;\r\n\t\t}\r\n\t\telse if(l==prv && nxt==l && nnxt==l) {\r\n\t\t\tvar lz = i+5;\r\n\t\t\twhile(lz+2>>1, 6);\r\n\t\t\tset.push(16, zc-3);\r\n\t\t\ti += zc*2-2;\r\n\t\t}\r\n\t\telse set.push(l, 0);\r\n\t}\r\n\treturn len>>>1;\r\n}\r\nUZIP.F._hufTree = function(hst, tree, MAXL) {\r\n\tvar list=[], hl = hst.length, tl=tree.length, i=0;\r\n\tfor(i=0; iMAXL) { UZIP.F.restrictDepth(l2, MAXL, maxl); maxl = MAXL; }\r\n\tfor(i=0; iMD) { var od=dps[i].d; dps[i].d=MD; dbt+=bCost-(1<<(maxl-od)); } else break;\r\n\tdbt = dbt>>>(maxl-MD);\r\n\twhile(dbt>0) { var od=dps[i].d; if(od=0; i--) if(dps[i].d==MD && dbt<0) { dps[i].d--; dbt++; } if(dbt!=0) console.log(\"debt left\");\r\n}\r\n\r\nUZIP.F._goodIndex = function(v, arr) {\r\n\tvar i=0; if(arr[i|16]<=v) i|=16; if(arr[i|8]<=v) i|=8; if(arr[i|4]<=v) i|=4; if(arr[i|2]<=v) i|=2; if(arr[i|1]<=v) i|=1; return i;\r\n}\r\nUZIP.F._writeLit = function(ch, ltree, out, pos) {\r\n\tUZIP.F._putsF(out, pos, ltree[ch<<1]);\r\n\treturn pos+ltree[(ch<<1)+1];\r\n}\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\nUZIP.F.inflate = function(data, buf) {\r\n\tvar u8=Uint8Array;\r\n\tif(data[0]==3 && data[1]==0) return (buf ? buf : new u8(0));\r\n\tvar F=UZIP.F, bitsF = F._bitsF, bitsE = F._bitsE, decodeTiny = F._decodeTiny, makeCodes = F.makeCodes, codes2map=F.codes2map, get17 = F._get17;\r\n\tvar U = F.U;\r\n\t\r\n\tvar noBuf = (buf==null);\r\n\tif(noBuf) buf = new u8((data.length>>>2)<<3);\r\n\t\r\n\tvar BFINAL=0, BTYPE=0, HLIT=0, HDIST=0, HCLEN=0, ML=0, MD=0; \t\r\n\tvar off = 0, pos = 0;\r\n\tvar lmap, dmap;\r\n\t\r\n\twhile(BFINAL==0) {\t\t\r\n\t\tBFINAL = bitsF(data, pos , 1);\r\n\t\tBTYPE = bitsF(data, pos+1, 2); pos+=3;\r\n\t\t//console.log(BFINAL, BTYPE);\r\n\t\t\r\n\t\tif(BTYPE==0) {\r\n\t\t\tif((pos&7)!=0) pos+=8-(pos&7);\r\n\t\t\tvar p8 = (pos>>>3)+4, len = data[p8-4]|(data[p8-3]<<8); //console.log(len);//bitsF(data, pos, 16), \r\n\t\t\tif(noBuf) buf=UZIP.F._check(buf, off+len);\r\n\t\t\tbuf.set(new u8(data.buffer, data.byteOffset+p8, len), off);\r\n\t\t\t//for(var i=0; itl)tl=l; } pos+=3*HCLEN; //console.log(itree);\r\n\t\t\tmakeCodes(U.itree, tl);\r\n\t\t\tcodes2map(U.itree, tl, U.imap);\r\n\t\t\t\r\n\t\t\tlmap = U.lmap; dmap = U.dmap;\r\n\t\t\t\r\n\t\t\tpos = decodeTiny(U.imap, (1<>>24))-1; pos+=(ml&0xffffff);\r\n\t\t\tmakeCodes(U.ltree, mx0);\r\n\t\t\tcodes2map(U.ltree, mx0, lmap);\r\n\t\t\t\r\n\t\t\t//var md = decodeTiny(U.imap, (1<>>24))-1; pos+=(md&0xffffff);\r\n\t\t\tmakeCodes(U.dtree, mx1);\r\n\t\t\tcodes2map(U.dtree, mx1, dmap);\r\n\t\t}\r\n\t\t//var ooff=off, opos=pos;\r\n\t\twhile(true) {\r\n\t\t\tvar code = lmap[get17(data, pos) & ML]; pos += code&15;\r\n\t\t\tvar lit = code>>>4; //U.lhst[lit]++; \r\n\t\t\tif((lit>>>8)==0) { buf[off++] = lit; }\r\n\t\t\telse if(lit==256) { break; }\r\n\t\t\telse {\r\n\t\t\t\tvar end = off+lit-254;\r\n\t\t\t\tif(lit>264) { var ebs = U.ldef[lit-257]; end = off + (ebs>>>3) + bitsE(data, pos, ebs&7); pos += ebs&7; }\r\n\t\t\t\t//UZIP.F.dst[end-off]++;\r\n\t\t\t\t\r\n\t\t\t\tvar dcode = dmap[get17(data, pos) & MD]; pos += dcode&15;\r\n\t\t\t\tvar dlit = dcode>>>4;\r\n\t\t\t\tvar dbs = U.ddef[dlit], dst = (dbs>>>4) + bitsF(data, pos, dbs&15); pos += dbs&15;\r\n\t\t\t\t\r\n\t\t\t\t//var o0 = off-dst, stp = Math.min(end-off, dst);\r\n\t\t\t\t//if(stp>20) while(off>>3);\r\n\t}\r\n\t//console.log(UZIP.F.dst);\r\n\t//console.log(tlen, dlen, off-tlen+tcnt);\r\n\treturn buf.length==off ? buf : buf.slice(0,off);\r\n}\r\nUZIP.F._check=function(buf, len) {\r\n\tvar bl=buf.length; if(len<=bl) return buf;\r\n\tvar nbuf = new Uint8Array(Math.max(bl<<1,len)); nbuf.set(buf,0);\r\n\t//for(var i=0; i>>4; \r\n\t\tif(lit<=15) { tree[i]=lit; i++; }\r\n\t\telse {\r\n\t\t\tvar ll = 0, n = 0;\r\n\t\t\tif(lit==16) {\r\n\t\t\t\tn = (3 + bitsE(data, pos, 2)); pos += 2; ll = tree[i-1];\r\n\t\t\t}\r\n\t\t\telse if(lit==17) {\r\n\t\t\t\tn = (3 + bitsE(data, pos, 3)); pos += 3;\r\n\t\t\t}\r\n\t\t\telse if(lit==18) {\r\n\t\t\t\tn = (11 + bitsE(data, pos, 7)); pos += 7;\r\n\t\t\t}\r\n\t\t\tvar ni = i+n;\r\n\t\t\twhile(i>>1;\r\n\twhile(imx)mx=v; i++; }\r\n\twhile(i>1;\r\n\t\tvar cl = tree[i+1], val = (lit<<4)|cl; // : (0x8000 | (U.of0[lit-257]<<7) | (U.exb[lit-257]<<4) | cl);\r\n\t\tvar rest = (MAX_BITS-cl), i0 = tree[i]<>>(15-MAX_BITS);\r\n\t\twhile(i0!=i1) {\r\n\t\t\tvar p0 = r15[i0]>>>(15-MAX_BITS);\r\n\t\t\tmap[p0]=val; i0++;\r\n\t\t}\r\n\t}\r\n}\r\nUZIP.F.revCodes = function(tree, MAX_BITS) {\r\n\tvar r15 = UZIP.F.U.rev15, imb = 15-MAX_BITS;\r\n\tfor(var i=0; i>>imb; }\r\n}\r\n\r\n// used only in deflate\r\nUZIP.F._putsE= function(dt, pos, val ) { val = val<<(pos&7); var o=(pos>>>3); dt[o]|=val; dt[o+1]|=(val>>>8); }\r\nUZIP.F._putsF= function(dt, pos, val ) { val = val<<(pos&7); var o=(pos>>>3); dt[o]|=val; dt[o+1]|=(val>>>8); dt[o+2]|=(val>>>16); }\r\n\r\nUZIP.F._bitsE= function(dt, pos, length) { return ((dt[pos>>>3] | (dt[(pos>>>3)+1]<<8) )>>>(pos&7))&((1<>>3] | (dt[(pos>>>3)+1]<<8) | (dt[(pos>>>3)+2]<<16))>>>(pos&7))&((1<>>3] | (dt[(pos>>>3)+1]<<8))>>>(pos&7))&511;\r\n} */\r\nUZIP.F._get17= function(dt, pos) {\t// return at least 17 meaningful bytes\r\n\treturn (dt[pos>>>3] | (dt[(pos>>>3)+1]<<8) | (dt[(pos>>>3)+2]<<16) )>>>(pos&7);\r\n}\r\nUZIP.F._get25= function(dt, pos) {\t// return at least 17 meaningful bytes\r\n\treturn (dt[pos>>>3] | (dt[(pos>>>3)+1]<<8) | (dt[(pos>>>3)+2]<<16) | (dt[(pos>>>3)+3]<<24) )>>>(pos&7);\r\n}\r\nUZIP.F.U = function(){\r\n\tvar u16=Uint16Array, u32=Uint32Array;\r\n\treturn {\r\n\t\tnext_code : new u16(16),\r\n\t\tbl_count : new u16(16),\r\n\t\tordr : [ 16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15 ],\r\n\t\tof0 : [3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,999,999,999],\r\n\t\texb : [0,0,0,0,0,0,0, 0, 1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3, 4, 4, 4, 4, 5, 5, 5, 5, 0, 0, 0, 0],\r\n\t\tldef : new u16(32),\r\n\t\tdf0 : [1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577, 65535, 65535],\r\n\t\tdxb : [0,0,0,0,1,1,2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8, 9, 9, 10, 10, 11, 11, 12, 12, 13, 13, 0, 0],\r\n\t\tddef : new u32(32),\r\n\t\tflmap: new u16( 512), fltree: [],\r\n\t\tfdmap: new u16( 32), fdtree: [],\r\n\t\tlmap : new u16(32768), ltree : [], ttree:[],\r\n\t\tdmap : new u16(32768), dtree : [],\r\n\t\timap : new u16( 512), itree : [],\r\n\t\t//rev9 : new u16( 512)\r\n\t\trev15: new u16(1<<15),\r\n\t\tlhst : new u32(286), dhst : new u32( 30), ihst : new u32(19),\r\n\t\tlits : new u32(15000),\r\n\t\tstrt : new u16(1<<16),\r\n\t\tprev : new u16(1<<15)\r\n\t}; \r\n} ();\r\n\r\n(function(){\t\r\n\tvar U = UZIP.F.U;\r\n\tvar len = 1<<15;\r\n\tfor(var i=0; i>> 1) | ((x & 0x55555555) << 1));\r\n\t\tx = (((x & 0xcccccccc) >>> 2) | ((x & 0x33333333) << 2));\r\n\t\tx = (((x & 0xf0f0f0f0) >>> 4) | ((x & 0x0f0f0f0f) << 4));\r\n\t\tx = (((x & 0xff00ff00) >>> 8) | ((x & 0x00ff00ff) << 8));\r\n\t\tU.rev15[i] = (((x >>> 16) | (x << 16)))>>>17;\r\n\t}\r\n\t\r\n\tfunction pushV(tgt, n, sv) { while(n--!=0) tgt.push(0,sv); }\r\n\t\r\n\tfor(var i=0; i<32; i++) { U.ldef[i]=(U.of0[i]<<3)|U.exb[i]; U.ddef[i]=(U.df0[i]<<4)|U.dxb[i]; }\r\n\t\r\n\tpushV(U.fltree, 144, 8); pushV(U.fltree, 255-143, 9); pushV(U.fltree, 279-255, 7); pushV(U.fltree,287-279,8);\r\n\t/*\r\n\tvar i = 0;\r\n\tfor(; i<=143; i++) U.fltree.push(0,8);\r\n\tfor(; i<=255; i++) U.fltree.push(0,9);\r\n\tfor(; i<=279; i++) U.fltree.push(0,7);\r\n\tfor(; i<=287; i++) U.fltree.push(0,8);\r\n\t*/\r\n\tUZIP.F.makeCodes(U.fltree, 9);\r\n\tUZIP.F.codes2map(U.fltree, 9, U.flmap);\r\n\tUZIP.F.revCodes (U.fltree, 9)\r\n\t\r\n\tpushV(U.fdtree,32,5);\r\n\t//for(i=0;i<32; i++) U.fdtree.push(0,5);\r\n\tUZIP.F.makeCodes(U.fdtree, 5);\r\n\tUZIP.F.codes2map(U.fdtree, 5, U.fdmap);\r\n\tUZIP.F.revCodes (U.fdtree, 5)\r\n\t\r\n\tpushV(U.itree,19,0); pushV(U.ltree,286,0); pushV(U.dtree,30,0); pushV(U.ttree,320,0);\r\n\t/*\r\n\tfor(var i=0; i< 19; i++) U.itree.push(0,0);\r\n\tfor(var i=0; i<286; i++) U.ltree.push(0,0);\r\n\tfor(var i=0; i< 30; i++) U.dtree.push(0,0);\r\n\tfor(var i=0; i<320; i++) U.ttree.push(0,0);\r\n\t*/\r\n})()\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n","// https://github.com/photopea/UPNG.js/blob/c976240e62b0497167f8aafabd7889625f8b2016/UPNG.js\n\n// import * as pako from 'pako'\nimport * as UZIP from 'uzip';\n\nconst UPNG = {};\n\nUPNG.toRGBA8 = function (out) {\n const w = out.width; const\n h = out.height;\n if (out.tabs.acTL == null) return [UPNG.toRGBA8.decodeImage(out.data, w, h, out).buffer];\n\n const frms = [];\n if (out.frames[0].data == null) out.frames[0].data = out.data;\n\n const len = w * h * 4; const img = new Uint8Array(len); const empty = new Uint8Array(len); const\n prev = new Uint8Array(len);\n for (let i = 0; i < out.frames.length; i++) {\n const frm = out.frames[i];\n const fx = frm.rect.x; const fy = frm.rect.y; const fw = frm.rect.width; const\n fh = frm.rect.height;\n const fdata = UPNG.toRGBA8.decodeImage(frm.data, fw, fh, out);\n\n if (i != 0) for (var j = 0; j < len; j++) prev[j] = img[j];\n\n if (frm.blend == 0) UPNG._copyTile(fdata, fw, fh, img, w, h, fx, fy, 0);\n else if (frm.blend == 1) UPNG._copyTile(fdata, fw, fh, img, w, h, fx, fy, 1);\n\n frms.push(img.buffer.slice(0));\n\n if (frm.dispose == 0) {} else if (frm.dispose == 1) UPNG._copyTile(empty, fw, fh, img, w, h, fx, fy, 0);\n else if (frm.dispose == 2) for (var j = 0; j < len; j++) img[j] = prev[j];\n }\n return frms;\n};\nUPNG.toRGBA8.decodeImage = function (data, w, h, out) {\n const area = w * h; const\n bpp = UPNG.decode._getBPP(out);\n const bpl = Math.ceil(w * bpp / 8);\t// bytes per line\n\n const bf = new Uint8Array(area * 4); const\n bf32 = new Uint32Array(bf.buffer);\n const { ctype } = out;\n const { depth } = out;\n const rs = UPNG._bin.readUshort;\n\n // console.log(ctype, depth);\n const time = Date.now();\n\n if (ctype == 6) { // RGB + alpha\n const qarea = area << 2;\n if (depth == 8) for (var i = 0; i < qarea; i += 4) { bf[i] = data[i]; bf[i + 1] = data[i + 1]; bf[i + 2] = data[i + 2]; bf[i + 3] = data[i + 3]; }\n if (depth == 16) for (var i = 0; i < qarea; i++) { bf[i] = data[i << 1]; }\n } else if (ctype == 2) {\t// RGB\n const ts = out.tabs.tRNS;\n if (ts == null) {\n if (depth == 8) for (var i = 0; i < area; i++) { var ti = i * 3; bf32[i] = (255 << 24) | (data[ti + 2] << 16) | (data[ti + 1] << 8) | data[ti]; }\n if (depth == 16) for (var i = 0; i < area; i++) { var ti = i * 6; bf32[i] = (255 << 24) | (data[ti + 4] << 16) | (data[ti + 2] << 8) | data[ti]; }\n } else {\n var tr = ts[0]; const tg = ts[1]; const\n tb = ts[2];\n if (depth == 8) {\n for (var i = 0; i < area; i++) {\n var qi = i << 2; var\n ti = i * 3; bf32[i] = (255 << 24) | (data[ti + 2] << 16) | (data[ti + 1] << 8) | data[ti];\n if (data[ti] == tr && data[ti + 1] == tg && data[ti + 2] == tb) bf[qi + 3] = 0;\n }\n }\n if (depth == 16) {\n for (var i = 0; i < area; i++) {\n var qi = i << 2; var\n ti = i * 6; bf32[i] = (255 << 24) | (data[ti + 4] << 16) | (data[ti + 2] << 8) | data[ti];\n if (rs(data, ti) == tr && rs(data, ti + 2) == tg && rs(data, ti + 4) == tb) bf[qi + 3] = 0;\n }\n }\n }\n } else if (ctype == 3) {\t// palette\n const p = out.tabs.PLTE;\n const ap = out.tabs.tRNS;\n const tl = ap ? ap.length : 0;\n // console.log(p, ap);\n if (depth == 1) {\n for (var y = 0; y < h; y++) {\n var s0 = y * bpl; var\n t0 = y * w;\n for (var i = 0; i < w; i++) {\n var qi = (t0 + i) << 2; var j = ((data[s0 + (i >> 3)] >> (7 - ((i & 7) << 0))) & 1); var\n cj = 3 * j; bf[qi] = p[cj]; bf[qi + 1] = p[cj + 1]; bf[qi + 2] = p[cj + 2]; bf[qi + 3] = (j < tl) ? ap[j] : 255;\n }\n }\n }\n if (depth == 2) {\n for (var y = 0; y < h; y++) {\n var s0 = y * bpl; var\n t0 = y * w;\n for (var i = 0; i < w; i++) {\n var qi = (t0 + i) << 2; var j = ((data[s0 + (i >> 2)] >> (6 - ((i & 3) << 1))) & 3); var\n cj = 3 * j; bf[qi] = p[cj]; bf[qi + 1] = p[cj + 1]; bf[qi + 2] = p[cj + 2]; bf[qi + 3] = (j < tl) ? ap[j] : 255;\n }\n }\n }\n if (depth == 4) {\n for (var y = 0; y < h; y++) {\n var s0 = y * bpl; var\n t0 = y * w;\n for (var i = 0; i < w; i++) {\n var qi = (t0 + i) << 2; var j = ((data[s0 + (i >> 1)] >> (4 - ((i & 1) << 2))) & 15); var\n cj = 3 * j; bf[qi] = p[cj]; bf[qi + 1] = p[cj + 1]; bf[qi + 2] = p[cj + 2]; bf[qi + 3] = (j < tl) ? ap[j] : 255;\n }\n }\n }\n if (depth == 8) {\n for (var i = 0; i < area; i++) {\n var qi = i << 2; var j = data[i]; var\n cj = 3 * j; bf[qi] = p[cj]; bf[qi + 1] = p[cj + 1]; bf[qi + 2] = p[cj + 2]; bf[qi + 3] = (j < tl) ? ap[j] : 255;\n }\n }\n } else if (ctype == 4) {\t// gray + alpha\n if (depth == 8) {\n for (var i = 0; i < area; i++) {\n var qi = i << 2; var di = i << 1; var\n gr = data[di]; bf[qi] = gr; bf[qi + 1] = gr; bf[qi + 2] = gr; bf[qi + 3] = data[di + 1];\n }\n }\n if (depth == 16) {\n for (var i = 0; i < area; i++) {\n var qi = i << 2; var di = i << 2; var\n gr = data[di]; bf[qi] = gr; bf[qi + 1] = gr; bf[qi + 2] = gr; bf[qi + 3] = data[di + 2];\n }\n }\n } else if (ctype == 0) {\t// gray\n var tr = out.tabs.tRNS ? out.tabs.tRNS : -1;\n for (var y = 0; y < h; y++) {\n const off = y * bpl; const\n to = y * w;\n if (depth == 1) {\n for (var x = 0; x < w; x++) {\n var gr = 255 * ((data[off + (x >>> 3)] >>> (7 - ((x & 7)))) & 1); var\n al = (gr == tr * 255) ? 0 : 255; bf32[to + x] = (al << 24) | (gr << 16) | (gr << 8) | gr;\n }\n } else if (depth == 2) {\n for (var x = 0; x < w; x++) {\n var gr = 85 * ((data[off + (x >>> 2)] >>> (6 - ((x & 3) << 1))) & 3); var\n al = (gr == tr * 85) ? 0 : 255; bf32[to + x] = (al << 24) | (gr << 16) | (gr << 8) | gr;\n }\n } else if (depth == 4) {\n for (var x = 0; x < w; x++) {\n var gr = 17 * ((data[off + (x >>> 1)] >>> (4 - ((x & 1) << 2))) & 15); var\n al = (gr == tr * 17) ? 0 : 255; bf32[to + x] = (al << 24) | (gr << 16) | (gr << 8) | gr;\n }\n } else if (depth == 8) {\n for (var x = 0; x < w; x++) {\n var gr = data[off + x]; var\n al = (gr == tr) ? 0 : 255; bf32[to + x] = (al << 24) | (gr << 16) | (gr << 8) | gr;\n }\n } else if (depth == 16) {\n for (var x = 0; x < w; x++) {\n var gr = data[off + (x << 1)]; var\n al = (rs(data, off + (x << i)) == tr) ? 0 : 255; bf32[to + x] = (al << 24) | (gr << 16) | (gr << 8) | gr;\n }\n }\n }\n }\n // console.log(Date.now()-time);\n return bf;\n};\n\nUPNG.decode = function (buff) {\n const data = new Uint8Array(buff); let offset = 8; const bin = UPNG._bin; const rUs = bin.readUshort; const\n rUi = bin.readUint;\n const out = { tabs: {}, frames: [] };\n const dd = new Uint8Array(data.length); let\n doff = 0;\t // put all IDAT data into it\n let fd; let\n foff = 0;\t// frames\n\n const mgck = [0x89, 0x50, 0x4e, 0x47, 0x0d, 0x0a, 0x1a, 0x0a];\n for (var i = 0; i < 8; i++) if (data[i] != mgck[i]) throw 'The input is not a PNG file!';\n\n while (offset < data.length) {\n const len = bin.readUint(data, offset); offset += 4;\n const type = bin.readASCII(data, offset, 4); offset += 4;\n // console.log(type,len);\n\n if (type == 'IHDR') { UPNG.decode._IHDR(data, offset, out); } else if (type == 'CgBI') { out.tabs[type] = data.slice(offset, offset + 4); } else if (type == 'IDAT') {\n for (var i = 0; i < len; i++) dd[doff + i] = data[offset + i];\n doff += len;\n } else if (type == 'acTL') {\n out.tabs[type] = { num_frames: rUi(data, offset), num_plays: rUi(data, offset + 4) };\n fd = new Uint8Array(data.length);\n } else if (type == 'fcTL') {\n if (foff != 0) {\n var fr = out.frames[out.frames.length - 1];\n fr.data = UPNG.decode._decompress(out, fd.slice(0, foff), fr.rect.width, fr.rect.height); foff = 0;\n }\n const rct = {\n x: rUi(data, offset + 12), y: rUi(data, offset + 16), width: rUi(data, offset + 4), height: rUi(data, offset + 8),\n };\n let del = rUs(data, offset + 22); del = rUs(data, offset + 20) / (del == 0 ? 100 : del);\n const frm = {\n rect: rct, delay: Math.round(del * 1000), dispose: data[offset + 24], blend: data[offset + 25],\n };\n // console.log(frm);\n out.frames.push(frm);\n } else if (type == 'fdAT') {\n for (var i = 0; i < len - 4; i++) fd[foff + i] = data[offset + i + 4];\n foff += len - 4;\n } else if (type == 'pHYs') {\n out.tabs[type] = [bin.readUint(data, offset), bin.readUint(data, offset + 4), data[offset + 8]];\n } else if (type == 'cHRM') {\n out.tabs[type] = [];\n for (var i = 0; i < 8; i++) out.tabs[type].push(bin.readUint(data, offset + i * 4));\n } else if (type == 'tEXt' || type == 'zTXt') {\n if (out.tabs[type] == null) out.tabs[type] = {};\n var nz = bin.nextZero(data, offset);\n var keyw = bin.readASCII(data, offset, nz - offset);\n var text; var\n tl = offset + len - nz - 1;\n if (type == 'tEXt') text = bin.readASCII(data, nz + 1, tl);\n else {\n var bfr = UPNG.decode._inflate(data.slice(nz + 2, nz + 2 + tl));\n text = bin.readUTF8(bfr, 0, bfr.length);\n }\n out.tabs[type][keyw] = text;\n } else if (type == 'iTXt') {\n if (out.tabs[type] == null) out.tabs[type] = {};\n var nz = 0; let\n off = offset;\n nz = bin.nextZero(data, off);\n var keyw = bin.readASCII(data, off, nz - off); off = nz + 1;\n const cflag = data[off]; const\n cmeth = data[off + 1]; off += 2;\n nz = bin.nextZero(data, off);\n const ltag = bin.readASCII(data, off, nz - off); off = nz + 1;\n nz = bin.nextZero(data, off);\n const tkeyw = bin.readUTF8(data, off, nz - off); off = nz + 1;\n var text; var\n tl = len - (off - offset);\n if (cflag == 0) text = bin.readUTF8(data, off, tl);\n else {\n var bfr = UPNG.decode._inflate(data.slice(off, off + tl));\n text = bin.readUTF8(bfr, 0, bfr.length);\n }\n out.tabs[type][keyw] = text;\n } else if (type == 'PLTE') {\n out.tabs[type] = bin.readBytes(data, offset, len);\n } else if (type == 'hIST') {\n const pl = out.tabs.PLTE.length / 3;\n out.tabs[type] = []; for (var i = 0; i < pl; i++) out.tabs[type].push(rUs(data, offset + i * 2));\n } else if (type == 'tRNS') {\n if (out.ctype == 3) out.tabs[type] = bin.readBytes(data, offset, len);\n else if (out.ctype == 0) out.tabs[type] = rUs(data, offset);\n else if (out.ctype == 2) out.tabs[type] = [rUs(data, offset), rUs(data, offset + 2), rUs(data, offset + 4)];\n // else console.log(\"tRNS for unsupported color type\",out.ctype, len);\n } else if (type == 'gAMA') out.tabs[type] = bin.readUint(data, offset) / 100000;\n else if (type == 'sRGB') out.tabs[type] = data[offset];\n else if (type == 'bKGD') {\n if (out.ctype == 0 || out.ctype == 4) out.tabs[type] = [rUs(data, offset)];\n else if (out.ctype == 2 || out.ctype == 6) out.tabs[type] = [rUs(data, offset), rUs(data, offset + 2), rUs(data, offset + 4)];\n else if (out.ctype == 3) out.tabs[type] = data[offset];\n } else if (type == 'IEND') {\n break;\n }\n // else { log(\"unknown chunk type\", type, len); }\n offset += len;\n const crc = bin.readUint(data, offset); offset += 4;\n }\n if (foff != 0) {\n var fr = out.frames[out.frames.length - 1];\n fr.data = UPNG.decode._decompress(out, fd.slice(0, foff), fr.rect.width, fr.rect.height); foff = 0;\n }\n out.data = UPNG.decode._decompress(out, dd, out.width, out.height);\n\n delete out.compress; delete out.interlace; delete out.filter;\n return out;\n};\n\nUPNG.decode._decompress = function (out, dd, w, h) {\n var time = Date.now();\n const bpp = UPNG.decode._getBPP(out); const bpl = Math.ceil(w * bpp / 8); const\n buff = new Uint8Array((bpl + 1 + out.interlace) * h);\n if (out.tabs.CgBI) dd = UPNG.inflateRaw(dd, buff);\n else dd = UPNG.decode._inflate(dd, buff);\n // console.log(dd.length, buff.length);\n // console.log(Date.now()-time);\n\n var time = Date.now();\n if (out.interlace == 0) dd = UPNG.decode._filterZero(dd, out, 0, w, h);\n else if (out.interlace == 1) dd = UPNG.decode._readInterlace(dd, out);\n // console.log(Date.now()-time);\n return dd;\n};\n\nUPNG.decode._inflate = function (data, buff) { const out = UPNG.inflateRaw(new Uint8Array(data.buffer, 2, data.length - 6), buff); return out; };\nUPNG.inflateRaw = (function () {\n const H = {}; H.H = {}; H.H.N = function (N, W) {\n const R = Uint8Array; let i = 0; let m = 0; let J = 0; let h = 0; let Q = 0; let X = 0; let u = 0; let w = 0; let d = 0; let v; let C;\n if (N[0] == 3 && N[1] == 0) return W || new R(0); const V = H.H; const n = V.b; const A = V.e; const l = V.R; const M = V.n; const I = V.A; const e = V.Z; const b = V.m; const Z = W == null;\n if (Z)W = new R(N.length >>> 2 << 5); while (i == 0) {\n i = n(N, d, 1); m = n(N, d + 1, 2); d += 3; if (m == 0) {\n if ((d & 7) != 0)d += 8 - (d & 7);\n const D = (d >>> 3) + 4; const q = N[D - 4] | N[D - 3] << 8; if (Z)W = H.H.W(W, w + q); W.set(new R(N.buffer, N.byteOffset + D, q), w); d = D + q << 3;\n w += q; continue;\n } if (Z)W = H.H.W(W, w + (1 << 17)); if (m == 1) { v = b.J; C = b.h; X = (1 << 9) - 1; u = (1 << 5) - 1; } if (m == 2) {\n J = A(N, d, 5) + 257;\n h = A(N, d + 5, 5) + 1; Q = A(N, d + 10, 4) + 4; d += 14; const E = d; let j = 1; for (var c = 0; c < 38; c += 2) { b.Q[c] = 0; b.Q[c + 1] = 0; } for (var c = 0;\n c < Q; c++) { const K = A(N, d + c * 3, 3); b.Q[(b.X[c] << 1) + 1] = K; if (K > j)j = K; }d += 3 * Q; M(b.Q, j); I(b.Q, j, b.u); v = b.w; C = b.d;\n d = l(b.u, (1 << j) - 1, J + h, N, d, b.v); const r = V.V(b.v, 0, J, b.C); X = (1 << r) - 1; const S = V.V(b.v, J, h, b.D); u = (1 << S) - 1; M(b.C, r);\n I(b.C, r, v); M(b.D, S); I(b.D, S, C);\n } while (!0) {\n const T = v[e(N, d) & X]; d += T & 15; const p = T >>> 4; if (p >>> 8 == 0) { W[w++] = p; } else if (p == 256) { break; } else {\n let z = w + p - 254;\n if (p > 264) { const _ = b.q[p - 257]; z = w + (_ >>> 3) + A(N, d, _ & 7); d += _ & 7; } const $ = C[e(N, d) & u]; d += $ & 15; const s = $ >>> 4; const Y = b.c[s]; const a = (Y >>> 4) + n(N, d, Y & 15);\n d += Y & 15; while (w < z) { W[w] = W[w++ - a]; W[w] = W[w++ - a]; W[w] = W[w++ - a]; W[w] = W[w++ - a]; }w = z;\n }\n }\n } return W.length == w ? W : W.slice(0, w);\n };\n H.H.W = function (N, W) { const R = N.length; if (W <= R) return N; const V = new Uint8Array(R << 1); V.set(N, 0); return V; };\n H.H.R = function (N, W, R, V, n, A) {\n const l = H.H.e; const M = H.H.Z; let I = 0; while (I < R) {\n const e = N[M(V, n) & W]; n += e & 15; const b = e >>> 4;\n if (b <= 15) { A[I] = b; I++; } else {\n let Z = 0; let m = 0; if (b == 16) { m = 3 + l(V, n, 2); n += 2; Z = A[I - 1]; } else if (b == 17) {\n m = 3 + l(V, n, 3);\n n += 3;\n } else if (b == 18) { m = 11 + l(V, n, 7); n += 7; } const J = I + m; while (I < J) { A[I] = Z; I++; }\n }\n } return n;\n }; H.H.V = function (N, W, R, V) {\n let n = 0; let A = 0; const l = V.length >>> 1;\n while (A < R) { const M = N[A + W]; V[A << 1] = 0; V[(A << 1) + 1] = M; if (M > n)n = M; A++; } while (A < l) { V[A << 1] = 0; V[(A << 1) + 1] = 0; A++; } return n;\n };\n H.H.n = function (N, W) {\n const R = H.H.m; const V = N.length; let n; let A; let l; var M; let I; const e = R.j; for (var M = 0; M <= W; M++)e[M] = 0; for (M = 1; M < V; M += 2)e[N[M]]++;\n const b = R.K; n = 0; e[0] = 0; for (A = 1; A <= W; A++) { n = n + e[A - 1] << 1; b[A] = n; } for (l = 0; l < V; l += 2) {\n I = N[l + 1]; if (I != 0) {\n N[l] = b[I];\n b[I]++;\n }\n }\n }; H.H.A = function (N, W, R) {\n const V = N.length; const n = H.H.m; const A = n.r; for (let l = 0; l < V; l += 2) {\n if (N[l + 1] != 0) {\n const M = l >> 1; const I = N[l + 1]; const e = M << 4 | I; const b = W - I; let Z = N[l] << b; const m = Z + (1 << b);\n while (Z != m) { const J = A[Z] >>> 15 - W; R[J] = e; Z++; }\n }\n }\n }; H.H.l = function (N, W) {\n const R = H.H.m.r; const V = 15 - W; for (let n = 0; n < N.length;\n n += 2) { const A = N[n] << W - N[n + 1]; N[n] = R[A] >>> V; }\n }; H.H.M = function (N, W, R) { R <<= (W & 7); const V = W >>> 3; N[V] |= R; N[V + 1] |= R >>> 8; };\n H.H.I = function (N, W, R) { R <<= (W & 7); const V = W >>> 3; N[V] |= R; N[V + 1] |= R >>> 8; N[V + 2] |= R >>> 16; }; H.H.e = function (N, W, R) { return (N[W >>> 3] | N[(W >>> 3) + 1] << 8) >>> (W & 7) & (1 << R) - 1; };\n H.H.b = function (N, W, R) { return (N[W >>> 3] | N[(W >>> 3) + 1] << 8 | N[(W >>> 3) + 2] << 16) >>> (W & 7) & (1 << R) - 1; }; H.H.Z = function (N, W) { return (N[W >>> 3] | N[(W >>> 3) + 1] << 8 | N[(W >>> 3) + 2] << 16) >>> (W & 7); };\n H.H.i = function (N, W) { return (N[W >>> 3] | N[(W >>> 3) + 1] << 8 | N[(W >>> 3) + 2] << 16 | N[(W >>> 3) + 3] << 24) >>> (W & 7); }; H.H.m = (function () {\n const N = Uint16Array; const W = Uint32Array;\n return {\n K: new N(16), j: new N(16), X: [16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15], S: [3, 4, 5, 6, 7, 8, 9, 10, 11, 13, 15, 17, 19, 23, 27, 31, 35, 43, 51, 59, 67, 83, 99, 115, 131, 163, 195, 227, 258, 999, 999, 999], T: [0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3, 4, 4, 4, 4, 5, 5, 5, 5, 0, 0, 0, 0], q: new N(32), p: [1, 2, 3, 4, 5, 7, 9, 13, 17, 25, 33, 49, 65, 97, 129, 193, 257, 385, 513, 769, 1025, 1537, 2049, 3073, 4097, 6145, 8193, 12289, 16385, 24577, 65535, 65535], z: [0, 0, 0, 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8, 9, 9, 10, 10, 11, 11, 12, 12, 13, 13, 0, 0], c: new W(32), J: new N(512), _: [], h: new N(32), $: [], w: new N(32768), C: [], v: [], d: new N(32768), D: [], u: new N(512), Q: [], r: new N(1 << 15), s: new W(286), Y: new W(30), a: new W(19), t: new W(15e3), k: new N(1 << 16), g: new N(1 << 15),\n };\n }());\n (function () {\n const N = H.H.m; const W = 1 << 15; for (var R = 0; R < W; R++) {\n let V = R; V = (V & 2863311530) >>> 1 | (V & 1431655765) << 1;\n V = (V & 3435973836) >>> 2 | (V & 858993459) << 2; V = (V & 4042322160) >>> 4 | (V & 252645135) << 4; V = (V & 4278255360) >>> 8 | (V & 16711935) << 8;\n N.r[R] = (V >>> 16 | V << 16) >>> 17;\n } function n(A, l, M) { while (l-- != 0)A.push(0, M); } for (var R = 0; R < 32; R++) {\n N.q[R] = N.S[R] << 3 | N.T[R];\n N.c[R] = N.p[R] << 4 | N.z[R];\n }n(N._, 144, 8); n(N._, 255 - 143, 9); n(N._, 279 - 255, 7); n(N._, 287 - 279, 8); H.H.n(N._, 9);\n H.H.A(N._, 9, N.J); H.H.l(N._, 9); n(N.$, 32, 5); H.H.n(N.$, 5); H.H.A(N.$, 5, N.h); H.H.l(N.$, 5); n(N.Q, 19, 0); n(N.C, 286, 0);\n n(N.D, 30, 0); n(N.v, 320, 0);\n }()); return H.H.N;\n}());\n\nUPNG.decode._readInterlace = function (data, out) {\n const w = out.width; const\n h = out.height;\n const bpp = UPNG.decode._getBPP(out); const cbpp = bpp >> 3; const\n bpl = Math.ceil(w * bpp / 8);\n const img = new Uint8Array(h * bpl);\n let di = 0;\n\n const starting_row = [0, 0, 4, 0, 2, 0, 1];\n const starting_col = [0, 4, 0, 2, 0, 1, 0];\n const row_increment = [8, 8, 8, 4, 4, 2, 2];\n const col_increment = [8, 8, 4, 4, 2, 2, 1];\n\n let pass = 0;\n while (pass < 7) {\n const ri = row_increment[pass]; const\n ci = col_increment[pass];\n let sw = 0; let\n sh = 0;\n let cr = starting_row[pass]; while (cr < h) { cr += ri; sh++; }\n let cc = starting_col[pass]; while (cc < w) { cc += ci; sw++; }\n const bpll = Math.ceil(sw * bpp / 8);\n UPNG.decode._filterZero(data, out, di, sw, sh);\n\n let y = 0; let\n row = starting_row[pass];\n while (row < h) {\n let col = starting_col[pass];\n let cdi = (di + y * bpll) << 3;\n\n while (col < w) {\n if (bpp == 1) {\n var val = data[cdi >> 3]; val = (val >> (7 - (cdi & 7))) & 1;\n img[row * bpl + (col >> 3)] |= (val << (7 - ((col & 7) << 0)));\n }\n if (bpp == 2) {\n var val = data[cdi >> 3]; val = (val >> (6 - (cdi & 7))) & 3;\n img[row * bpl + (col >> 2)] |= (val << (6 - ((col & 3) << 1)));\n }\n if (bpp == 4) {\n var val = data[cdi >> 3]; val = (val >> (4 - (cdi & 7))) & 15;\n img[row * bpl + (col >> 1)] |= (val << (4 - ((col & 1) << 2)));\n }\n if (bpp >= 8) {\n const ii = row * bpl + col * cbpp;\n for (let j = 0; j < cbpp; j++) img[ii + j] = data[(cdi >> 3) + j];\n }\n cdi += bpp; col += ci;\n }\n y++; row += ri;\n }\n if (sw * sh != 0) di += sh * (1 + bpll);\n pass += 1;\n }\n return img;\n};\n\nUPNG.decode._getBPP = function (out) {\n const noc = [1, null, 3, 1, 2, null, 4][out.ctype];\n return noc * out.depth;\n};\n\nUPNG.decode._filterZero = function (data, out, off, w, h) {\n let bpp = UPNG.decode._getBPP(out); const bpl = Math.ceil(w * bpp / 8); const\n paeth = UPNG.decode._paeth;\n bpp = Math.ceil(bpp / 8);\n\n let i = 0; let di = 1; let type = data[off]; let\n x = 0;\n\n if (type > 1) data[off] = [0, 0, 1][type - 2];\n if (type == 3) for (x = bpp; x < bpl; x++) data[x + 1] = (data[x + 1] + (data[x + 1 - bpp] >>> 1)) & 255;\n\n for (let y = 0; y < h; y++) {\n i = off + y * bpl; di = i + y + 1;\n type = data[di - 1]; x = 0;\n\n if (type == 0) for (; x < bpl; x++) data[i + x] = data[di + x];\n else if (type == 1) {\n for (; x < bpp; x++) data[i + x] = data[di + x];\n for (; x < bpl; x++) data[i + x] = (data[di + x] + data[i + x - bpp]);\n } else if (type == 2) { for (; x < bpl; x++) data[i + x] = (data[di + x] + data[i + x - bpl]); } else if (type == 3) {\n for (; x < bpp; x++) data[i + x] = (data[di + x] + (data[i + x - bpl] >>> 1));\n for (; x < bpl; x++) data[i + x] = (data[di + x] + ((data[i + x - bpl] + data[i + x - bpp]) >>> 1));\n } else {\n for (; x < bpp; x++) data[i + x] = (data[di + x] + paeth(0, data[i + x - bpl], 0));\n for (; x < bpl; x++) data[i + x] = (data[di + x] + paeth(data[i + x - bpp], data[i + x - bpl], data[i + x - bpp - bpl]));\n }\n }\n return data;\n};\n\nUPNG.decode._paeth = function (a, b, c) {\n const p = a + b - c; const pa = (p - a); const pb = (p - b); const\n pc = (p - c);\n if (pa * pa <= pb * pb && pa * pa <= pc * pc) return a;\n if (pb * pb <= pc * pc) return b;\n return c;\n};\n\nUPNG.decode._IHDR = function (data, offset, out) {\n const bin = UPNG._bin;\n out.width = bin.readUint(data, offset); offset += 4;\n out.height = bin.readUint(data, offset); offset += 4;\n out.depth = data[offset]; offset++;\n out.ctype = data[offset]; offset++;\n out.compress = data[offset]; offset++;\n out.filter = data[offset]; offset++;\n out.interlace = data[offset]; offset++;\n};\n\nUPNG._bin = {\n nextZero(data, p) { while (data[p] != 0) p++; return p; },\n readUshort(buff, p) { return (buff[p] << 8) | buff[p + 1]; },\n writeUshort(buff, p, n) { buff[p] = (n >> 8) & 255; buff[p + 1] = n & 255; },\n readUint(buff, p) { return (buff[p] * (256 * 256 * 256)) + ((buff[p + 1] << 16) | (buff[p + 2] << 8) | buff[p + 3]); },\n writeUint(buff, p, n) { buff[p] = (n >> 24) & 255; buff[p + 1] = (n >> 16) & 255; buff[p + 2] = (n >> 8) & 255; buff[p + 3] = n & 255; },\n readASCII(buff, p, l) { let s = ''; for (let i = 0; i < l; i++) s += String.fromCharCode(buff[p + i]); return s; },\n writeASCII(data, p, s) { for (let i = 0; i < s.length; i++) data[p + i] = s.charCodeAt(i); },\n readBytes(buff, p, l) { const arr = []; for (let i = 0; i < l; i++) arr.push(buff[p + i]); return arr; },\n pad(n) { return n.length < 2 ? `0${n}` : n; },\n readUTF8(buff, p, l) {\n let s = '';\n let ns;\n for (let i = 0; i < l; i++) s += `%${UPNG._bin.pad(buff[p + i].toString(16))}`;\n try { ns = decodeURIComponent(s); } catch (e) { return UPNG._bin.readASCII(buff, p, l); }\n return ns;\n },\n};\nUPNG._copyTile = function (sb, sw, sh, tb, tw, th, xoff, yoff, mode) {\n const w = Math.min(sw, tw); const\n h = Math.min(sh, th);\n let si = 0; let\n ti = 0;\n for (let y = 0; y < h; y++) {\n for (let x = 0; x < w; x++) {\n if (xoff >= 0 && yoff >= 0) { si = (y * sw + x) << 2; ti = ((yoff + y) * tw + xoff + x) << 2; } else { si = ((-yoff + y) * sw - xoff + x) << 2; ti = (y * tw + x) << 2; }\n\n if (mode == 0) { tb[ti] = sb[si]; tb[ti + 1] = sb[si + 1]; tb[ti + 2] = sb[si + 2]; tb[ti + 3] = sb[si + 3]; } else if (mode == 1) {\n var fa = sb[si + 3] * (1 / 255); var fr = sb[si] * fa; var fg = sb[si + 1] * fa; var\n fb = sb[si + 2] * fa;\n var ba = tb[ti + 3] * (1 / 255); var br = tb[ti] * ba; var bg = tb[ti + 1] * ba; var\n bb = tb[ti + 2] * ba;\n\n const ifa = 1 - fa; const oa = fa + ba * ifa; const\n ioa = (oa == 0 ? 0 : 1 / oa);\n tb[ti + 3] = 255 * oa;\n tb[ti + 0] = (fr + br * ifa) * ioa;\n tb[ti + 1] = (fg + bg * ifa) * ioa;\n tb[ti + 2] = (fb + bb * ifa) * ioa;\n } else if (mode == 2) {\t// copy only differences, otherwise zero\n var fa = sb[si + 3]; var fr = sb[si]; var fg = sb[si + 1]; var\n fb = sb[si + 2];\n var ba = tb[ti + 3]; var br = tb[ti]; var bg = tb[ti + 1]; var\n bb = tb[ti + 2];\n if (fa == ba && fr == br && fg == bg && fb == bb) { tb[ti] = 0; tb[ti + 1] = 0; tb[ti + 2] = 0; tb[ti + 3] = 0; } else { tb[ti] = fr; tb[ti + 1] = fg; tb[ti + 2] = fb; tb[ti + 3] = fa; }\n } else if (mode == 3) {\t// check if can be blended\n var fa = sb[si + 3]; var fr = sb[si]; var fg = sb[si + 1]; var\n fb = sb[si + 2];\n var ba = tb[ti + 3]; var br = tb[ti]; var bg = tb[ti + 1]; var\n bb = tb[ti + 2];\n if (fa == ba && fr == br && fg == bg && fb == bb) continue;\n // if(fa!=255 && ba!=0) return false;\n if (fa < 220 && ba > 20) return false;\n }\n }\n }\n return true;\n};\n\nUPNG.encode = function (bufs, w, h, ps, dels, tabs, forbidPlte) {\n if (ps == null) ps = 0;\n if (forbidPlte == null) forbidPlte = false;\n\n const nimg = UPNG.encode.compress(bufs, w, h, ps, [false, false, false, 0, forbidPlte]);\n UPNG.encode.compressPNG(nimg, -1);\n\n return UPNG.encode._main(nimg, w, h, dels, tabs);\n};\n\nUPNG.encodeLL = function (bufs, w, h, cc, ac, depth, dels, tabs) {\n const nimg = { ctype: 0 + (cc == 1 ? 0 : 2) + (ac == 0 ? 0 : 4), depth, frames: [] };\n\n const time = Date.now();\n const bipp = (cc + ac) * depth; const\n bipl = bipp * w;\n for (let i = 0; i < bufs.length; i++) {\n nimg.frames.push({\n rect: {\n x: 0, y: 0, width: w, height: h,\n },\n img: new Uint8Array(bufs[i]),\n blend: 0,\n dispose: 1,\n bpp: Math.ceil(bipp / 8),\n bpl: Math.ceil(bipl / 8),\n });\n }\n\n UPNG.encode.compressPNG(nimg, 0, true);\n\n const out = UPNG.encode._main(nimg, w, h, dels, tabs);\n return out;\n};\n\nUPNG.encode._main = function (nimg, w, h, dels, tabs) {\n if (tabs == null) tabs = {};\n const { crc } = UPNG.crc;\n const wUi = UPNG._bin.writeUint;\n const wUs = UPNG._bin.writeUshort;\n const wAs = UPNG._bin.writeASCII;\n let offset = 8; const anim = nimg.frames.length > 1; let\n pltAlpha = false;\n\n let leng = 8 + (16 + 5 + 4) /* + (9+4) */ + (anim ? 20 : 0);\n if (tabs.sRGB != null) leng += 8 + 1 + 4;\n if (tabs.pHYs != null) leng += 8 + 9 + 4;\n if (nimg.ctype == 3) {\n var dl = nimg.plte.length;\n for (var i = 0; i < dl; i++) if ((nimg.plte[i] >>> 24) != 255) pltAlpha = true;\n leng += (8 + dl * 3 + 4) + (pltAlpha ? (8 + dl * 1 + 4) : 0);\n }\n for (var j = 0; j < nimg.frames.length; j++) {\n var fr = nimg.frames[j];\n if (anim) leng += 38;\n leng += fr.cimg.length + 12;\n if (j != 0) leng += 4;\n }\n leng += 12;\n\n const data = new Uint8Array(leng);\n const wr = [0x89, 0x50, 0x4e, 0x47, 0x0d, 0x0a, 0x1a, 0x0a];\n for (var i = 0; i < 8; i++) data[i] = wr[i];\n\n wUi(data, offset, 13); offset += 4;\n wAs(data, offset, 'IHDR'); offset += 4;\n wUi(data, offset, w); offset += 4;\n wUi(data, offset, h); offset += 4;\n data[offset] = nimg.depth; offset++; // depth\n data[offset] = nimg.ctype; offset++; // ctype\n data[offset] = 0; offset++; // compress\n data[offset] = 0; offset++; // filter\n data[offset] = 0; offset++; // interlace\n wUi(data, offset, crc(data, offset - 17, 17)); offset += 4; // crc\n\n // 13 bytes to say, that it is sRGB\n if (tabs.sRGB != null) {\n wUi(data, offset, 1); offset += 4;\n wAs(data, offset, 'sRGB'); offset += 4;\n data[offset] = tabs.sRGB; offset++;\n wUi(data, offset, crc(data, offset - 5, 5)); offset += 4; // crc\n }\n if (tabs.pHYs != null) {\n wUi(data, offset, 9); offset += 4;\n wAs(data, offset, 'pHYs'); offset += 4;\n wUi(data, offset, tabs.pHYs[0]); offset += 4;\n wUi(data, offset, tabs.pHYs[1]); offset += 4;\n data[offset] = tabs.pHYs[2];\t\t\toffset++;\n wUi(data, offset, crc(data, offset - 13, 13)); offset += 4; // crc\n }\n\n if (anim) {\n wUi(data, offset, 8); offset += 4;\n wAs(data, offset, 'acTL'); offset += 4;\n wUi(data, offset, nimg.frames.length); offset += 4;\n wUi(data, offset, tabs.loop != null ? tabs.loop : 0); offset += 4;\n wUi(data, offset, crc(data, offset - 12, 12)); offset += 4; // crc\n }\n\n if (nimg.ctype == 3) {\n var dl = nimg.plte.length;\n wUi(data, offset, dl * 3); offset += 4;\n wAs(data, offset, 'PLTE'); offset += 4;\n for (var i = 0; i < dl; i++) {\n const ti = i * 3; const c = nimg.plte[i]; const r = (c) & 255; const g = (c >>> 8) & 255; const\n b = (c >>> 16) & 255;\n data[offset + ti + 0] = r; data[offset + ti + 1] = g; data[offset + ti + 2] = b;\n }\n offset += dl * 3;\n wUi(data, offset, crc(data, offset - dl * 3 - 4, dl * 3 + 4)); offset += 4; // crc\n\n if (pltAlpha) {\n wUi(data, offset, dl); offset += 4;\n wAs(data, offset, 'tRNS'); offset += 4;\n for (var i = 0; i < dl; i++) data[offset + i] = (nimg.plte[i] >>> 24) & 255;\n offset += dl;\n wUi(data, offset, crc(data, offset - dl - 4, dl + 4)); offset += 4; // crc\n }\n }\n\n let fi = 0;\n for (var j = 0; j < nimg.frames.length; j++) {\n var fr = nimg.frames[j];\n if (anim) {\n wUi(data, offset, 26); offset += 4;\n wAs(data, offset, 'fcTL'); offset += 4;\n wUi(data, offset, fi++); offset += 4;\n wUi(data, offset, fr.rect.width); offset += 4;\n wUi(data, offset, fr.rect.height); offset += 4;\n wUi(data, offset, fr.rect.x); offset += 4;\n wUi(data, offset, fr.rect.y); offset += 4;\n wUs(data, offset, dels[j]); offset += 2;\n wUs(data, offset, 1000); offset += 2;\n data[offset] = fr.dispose; offset++;\t// dispose\n data[offset] = fr.blend; offset++;\t// blend\n wUi(data, offset, crc(data, offset - 30, 30)); offset += 4; // crc\n }\n\n const imgd = fr.cimg; var\n dl = imgd.length;\n wUi(data, offset, dl + (j == 0 ? 0 : 4)); offset += 4;\n const ioff = offset;\n wAs(data, offset, (j == 0) ? 'IDAT' : 'fdAT'); offset += 4;\n if (j != 0) { wUi(data, offset, fi++); offset += 4; }\n data.set(imgd, offset);\n offset += dl;\n wUi(data, offset, crc(data, ioff, offset - ioff)); offset += 4; // crc\n }\n\n wUi(data, offset, 0); offset += 4;\n wAs(data, offset, 'IEND'); offset += 4;\n wUi(data, offset, crc(data, offset - 4, 4)); offset += 4; // crc\n\n return data.buffer;\n};\n\nUPNG.encode.compressPNG = function (out, filter, levelZero) {\n for (let i = 0; i < out.frames.length; i++) {\n const frm = out.frames[i]; const nw = frm.rect.width; const\n nh = frm.rect.height;\n const fdata = new Uint8Array(nh * frm.bpl + nh);\n frm.cimg = UPNG.encode._filterZero(frm.img, nh, frm.bpp, frm.bpl, fdata, filter, levelZero);\n }\n};\n\nUPNG.encode.compress = function (bufs, w, h, ps, prms) // prms: onlyBlend, minBits, forbidPlte\n{\n // var time = Date.now();\n const onlyBlend = prms[0]; const evenCrd = prms[1]; const forbidPrev = prms[2]; const minBits = prms[3]; const\n forbidPlte = prms[4];\n\n let ctype = 6; let depth = 8; let\n alphaAnd = 255;\n\n for (var j = 0; j < bufs.length; j++) { // when not quantized, other frames can contain colors, that are not in an initial frame\n const img = new Uint8Array(bufs[j]); var\n ilen = img.length;\n for (var i = 0; i < ilen; i += 4) alphaAnd &= img[i + 3];\n }\n const gotAlpha = (alphaAnd != 255);\n\n // console.log(\"alpha check\", Date.now()-time); time = Date.now();\n\n // var brute = gotAlpha && forGIF;\t\t// brute : frames can only be copied, not \"blended\"\n const frms = UPNG.encode.framize(bufs, w, h, onlyBlend, evenCrd, forbidPrev);\n // console.log(\"framize\", Date.now()-time); time = Date.now();\n\n const cmap = {}; const plte = []; const\n inds = [];\n\n if (ps != 0) {\n const nbufs = []; for (var i = 0; i < frms.length; i++) nbufs.push(frms[i].img.buffer);\n\n const abuf = UPNG.encode.concatRGBA(nbufs); const\n qres = UPNG.quantize(abuf, ps); // console.log(qres);\n let cof = 0; const\n bb = new Uint8Array(qres.abuf);\n for (var i = 0; i < frms.length; i++) {\n var ti = frms[i].img; const\n bln = ti.length; inds.push(new Uint8Array(qres.inds.buffer, cof >> 2, bln >> 2));\n for (var j = 0; j < bln; j += 4) { ti[j] = bb[cof + j]; ti[j + 1] = bb[cof + j + 1]; ti[j + 2] = bb[cof + j + 2]; ti[j + 3] = bb[cof + j + 3]; } cof += bln;\n }\n\n for (var i = 0; i < qres.plte.length; i++) plte.push(qres.plte[i].est.rgba);\n // console.log(\"quantize\", Date.now()-time); time = Date.now();\n } else {\n // what if ps==0, but there are <=256 colors? we still need to detect, if the palette could be used\n for (var j = 0; j < frms.length; j++) { // when not quantized, other frames can contain colors, that are not in an initial frame\n var frm = frms[j]; const img32 = new Uint32Array(frm.img.buffer); var nw = frm.rect.width; var\n ilen = img32.length;\n const ind = new Uint8Array(ilen); inds.push(ind);\n for (var i = 0; i < ilen; i++) {\n const c = img32[i];\n if (i != 0 && c == img32[i - 1]) ind[i] = ind[i - 1];\n else if (i > nw && c == img32[i - nw]) ind[i] = ind[i - nw];\n else {\n let cmc = cmap[c];\n if (cmc == null) { cmap[c] = cmc = plte.length; plte.push(c); if (plte.length >= 300) break; }\n ind[i] = cmc;\n }\n }\n }\n // console.log(\"make palette\", Date.now()-time); time = Date.now();\n }\n\n const cc = plte.length; // console.log(\"colors:\",cc);\n if (cc <= 256 && forbidPlte == false) {\n if (cc <= 2) depth = 1; else if (cc <= 4) depth = 2; else if (cc <= 16) depth = 4; else depth = 8;\n depth = Math.max(depth, minBits);\n }\n\n for (var j = 0; j < frms.length; j++) {\n var frm = frms[j]; const nx = frm.rect.x; const ny = frm.rect.y; var nw = frm.rect.width; const\n nh = frm.rect.height;\n let cimg = frm.img; const\n cimg32 = new Uint32Array(cimg.buffer);\n let bpl = 4 * nw; let\n bpp = 4;\n if (cc <= 256 && forbidPlte == false) {\n bpl = Math.ceil(depth * nw / 8);\n var nimg = new Uint8Array(bpl * nh);\n const inj = inds[j];\n for (let y = 0; y < nh; y++) {\n var i = y * bpl; const\n ii = y * nw;\n if (depth == 8) for (var x = 0; x < nw; x++) nimg[i + (x)] = (inj[ii + x]);\n else if (depth == 4) for (var x = 0; x < nw; x++) nimg[i + (x >> 1)] |= (inj[ii + x] << (4 - (x & 1) * 4));\n else if (depth == 2) for (var x = 0; x < nw; x++) nimg[i + (x >> 2)] |= (inj[ii + x] << (6 - (x & 3) * 2));\n else if (depth == 1) for (var x = 0; x < nw; x++) nimg[i + (x >> 3)] |= (inj[ii + x] << (7 - (x & 7) * 1));\n }\n cimg = nimg; ctype = 3; bpp = 1;\n } else if (gotAlpha == false && frms.length == 1) {\t// some next \"reduced\" frames may contain alpha for blending\n var nimg = new Uint8Array(nw * nh * 3); const\n area = nw * nh;\n for (var i = 0; i < area; i++) {\n var ti = i * 3; const\n qi = i * 4; nimg[ti] = cimg[qi]; nimg[ti + 1] = cimg[qi + 1]; nimg[ti + 2] = cimg[qi + 2];\n }\n cimg = nimg; ctype = 2; bpp = 3; bpl = 3 * nw;\n }\n frm.img = cimg; frm.bpl = bpl; frm.bpp = bpp;\n }\n // console.log(\"colors => palette indices\", Date.now()-time); time = Date.now();\n\n return {\n ctype, depth, plte, frames: frms,\n };\n};\nUPNG.encode.framize = function (bufs, w, h, alwaysBlend, evenCrd, forbidPrev) {\n /* DISPOSE\n - 0 : no change\n - 1 : clear to transparent\n - 2 : retstore to content before rendering (previous frame disposed)\n BLEND\n - 0 : replace\n - 1 : blend\n */\n const frms = [];\n for (var j = 0; j < bufs.length; j++) {\n const cimg = new Uint8Array(bufs[j]); const\n cimg32 = new Uint32Array(cimg.buffer);\n var nimg;\n\n let nx = 0; let ny = 0; let nw = w; let nh = h; let\n blend = alwaysBlend ? 1 : 0;\n if (j != 0) {\n const tlim = (forbidPrev || alwaysBlend || j == 1 || frms[j - 2].dispose != 0) ? 1 : 2; let tstp = 0; let\n tarea = 1e9;\n for (let it = 0; it < tlim; it++) {\n var pimg = new Uint8Array(bufs[j - 1 - it]); const\n p32 = new Uint32Array(bufs[j - 1 - it]);\n let mix = w; let miy = h; let max = -1; let may = -1;\n for (let y = 0; y < h; y++) {\n for (let x = 0; x < w; x++) {\n var i = y * w + x;\n if (cimg32[i] != p32[i]) {\n if (x < mix) mix = x; if (x > max) max = x;\n if (y < miy) miy = y; if (y > may) may = y;\n }\n }\n }\n if (max == -1) mix = miy = max = may = 0;\n if (evenCrd) { if ((mix & 1) == 1)mix--; if ((miy & 1) == 1)miy--; }\n const sarea = (max - mix + 1) * (may - miy + 1);\n if (sarea < tarea) {\n tarea = sarea; tstp = it;\n nx = mix; ny = miy; nw = max - mix + 1; nh = may - miy + 1;\n }\n }\n\n // alwaysBlend: pokud zjistím, že blendit nelze, nastavím předchozímu snímku dispose=1. Zajistím, aby obsahoval můj obdélník.\n var pimg = new Uint8Array(bufs[j - 1 - tstp]);\n if (tstp == 1) frms[j - 1].dispose = 2;\n\n nimg = new Uint8Array(nw * nh * 4);\n UPNG._copyTile(pimg, w, h, nimg, nw, nh, -nx, -ny, 0);\n\n blend = UPNG._copyTile(cimg, w, h, nimg, nw, nh, -nx, -ny, 3) ? 1 : 0;\n if (blend == 1) {\n UPNG.encode._prepareDiff(cimg, w, h, nimg, {\n x: nx, y: ny, width: nw, height: nh,\n });\n } else UPNG._copyTile(cimg, w, h, nimg, nw, nh, -nx, -ny, 0);\n // UPNG._copyTile(cimg,w,h, nimg,nw,nh, -nx,-ny, blend==1?2:0);\n } else nimg = cimg.slice(0);\t// img may be rewritten further ... don't rewrite input\n\n frms.push({\n rect: {\n x: nx, y: ny, width: nw, height: nh,\n },\n img: nimg,\n blend,\n dispose: 0,\n });\n }\n\n if (alwaysBlend) {\n for (var j = 0; j < frms.length; j++) {\n var frm = frms[j]; if (frm.blend == 1) continue;\n const r0 = frm.rect; const\n r1 = frms[j - 1].rect;\n const miX = Math.min(r0.x, r1.x); const\n miY = Math.min(r0.y, r1.y);\n const maX = Math.max(r0.x + r0.width, r1.x + r1.width); const\n maY = Math.max(r0.y + r0.height, r1.y + r1.height);\n const r = {\n x: miX, y: miY, width: maX - miX, height: maY - miY,\n };\n\n frms[j - 1].dispose = 1;\n if (j - 1 != 0) { UPNG.encode._updateFrame(bufs, w, h, frms, j - 1, r, evenCrd); }\n UPNG.encode._updateFrame(bufs, w, h, frms, j, r, evenCrd);\n }\n }\n let area = 0;\n if (bufs.length != 1) {\n for (var i = 0; i < frms.length; i++) {\n var frm = frms[i];\n area += frm.rect.width * frm.rect.height;\n // if(i==0 || frm.blend!=1) continue;\n // var ob = new Uint8Array(\n // console.log(frm.blend, frm.dispose, frm.rect);\n }\n }\n // if(area!=0) console.log(area);\n return frms;\n};\nUPNG.encode._updateFrame = function (bufs, w, h, frms, i, r, evenCrd) {\n const U8 = Uint8Array; const\n U32 = Uint32Array;\n const pimg = new U8(bufs[i - 1]); const pimg32 = new U32(bufs[i - 1]); const\n nimg = i + 1 < bufs.length ? new U8(bufs[i + 1]) : null;\n const cimg = new U8(bufs[i]); const\n cimg32 = new U32(cimg.buffer);\n\n let mix = w; let miy = h; let max = -1; let may = -1;\n for (let y = 0; y < r.height; y++) {\n for (let x = 0; x < r.width; x++) {\n const cx = r.x + x; const\n cy = r.y + y;\n const j = cy * w + cx; const\n cc = cimg32[j];\n // no need to draw transparency, or to dispose it. Or, if writing the same color and the next one does not need transparency.\n if (cc == 0 || (frms[i - 1].dispose == 0 && pimg32[j] == cc && (nimg == null || nimg[j * 4 + 3] != 0))/**/) {} else {\n if (cx < mix) mix = cx; if (cx > max) max = cx;\n if (cy < miy) miy = cy; if (cy > may) may = cy;\n }\n }\n }\n if (max == -1) mix = miy = max = may = 0;\n if (evenCrd) { if ((mix & 1) == 1)mix--; if ((miy & 1) == 1)miy--; }\n r = {\n x: mix, y: miy, width: max - mix + 1, height: may - miy + 1,\n };\n\n const fr = frms[i]; fr.rect = r; fr.blend = 1; fr.img = new Uint8Array(r.width * r.height * 4);\n if (frms[i - 1].dispose == 0) {\n UPNG._copyTile(pimg, w, h, fr.img, r.width, r.height, -r.x, -r.y, 0);\n UPNG.encode._prepareDiff(cimg, w, h, fr.img, r);\n // UPNG._copyTile(cimg,w,h, fr.img,r.width,r.height, -r.x,-r.y, 2);\n } else { UPNG._copyTile(cimg, w, h, fr.img, r.width, r.height, -r.x, -r.y, 0); }\n};\nUPNG.encode._prepareDiff = function (cimg, w, h, nimg, rec) {\n UPNG._copyTile(cimg, w, h, nimg, rec.width, rec.height, -rec.x, -rec.y, 2);\n /*\n var n32 = new Uint32Array(nimg.buffer);\n var og = new Uint8Array(rec.width*rec.height*4), o32 = new Uint32Array(og.buffer);\n UPNG._copyTile(cimg,w,h, og,rec.width,rec.height, -rec.x,-rec.y, 0);\n for(var i=4; i>>2]==o32[(i>>>2)-1]) {\n n32[i>>>2]=o32[i>>>2];\n //var j = i, c=p32[(i>>>2)-1];\n //while(p32[j>>>2]==c) { n32[j>>>2]=c; j+=4; }\n }\n }\n for(var i=nimg.length-8; i>0; i-=4) {\n if(nimg[i+7]!=0 && nimg[i+3]==0 && o32[i>>>2]==o32[(i>>>2)+1]) {\n n32[i>>>2]=o32[i>>>2];\n //var j = i, c=p32[(i>>>2)-1];\n //while(p32[j>>>2]==c) { n32[j>>>2]=c; j+=4; }\n }\n } */\n};\n\nUPNG.encode._filterZero = function (img, h, bpp, bpl, data, filter, levelZero) {\n const fls = []; let\n ftry = [0, 1, 2, 3, 4];\n if (filter != -1) ftry = [filter];\n else if (h * bpl > 500000 || bpp == 1) ftry = [0];\n let opts; if (levelZero) opts = { level: 0 };\n\n // var CMPR = (data.length>10e6 && typeof UZIP !== 'undefined') ? UZIP : pako;\n const CMPR = UZIP;\n\n const time = Date.now();\n for (var i = 0; i < ftry.length; i++) {\n for (let y = 0; y < h; y++) UPNG.encode._filterLine(data, img, y, bpl, bpp, ftry[i]);\n // var nimg = new Uint8Array(data.length);\n // var sz = UZIP.F.deflate(data, nimg); fls.push(nimg.slice(0,sz));\n // var dfl = pako[\"deflate\"](data), dl=dfl.length-4;\n // var crc = (dfl[dl+3]<<24)|(dfl[dl+2]<<16)|(dfl[dl+1]<<8)|(dfl[dl+0]<<0);\n // console.log(crc, UZIP.adler(data,2,data.length-6));\n fls.push(CMPR.deflate(data, opts));\n }\n\n let ti; let\n tsize = 1e9;\n for (var i = 0; i < fls.length; i++) if (fls[i].length < tsize) { ti = i; tsize = fls[i].length; }\n return fls[ti];\n};\nUPNG.encode._filterLine = function (data, img, y, bpl, bpp, type) {\n const i = y * bpl; let di = i + y; const\n paeth = UPNG.decode._paeth;\n data[di] = type; di++;\n\n if (type == 0) {\n if (bpl < 500) for (var x = 0; x < bpl; x++) data[di + x] = img[i + x];\n else data.set(new Uint8Array(img.buffer, i, bpl), di);\n } else if (type == 1) {\n for (var x = 0; x < bpp; x++) data[di + x] = img[i + x];\n for (var x = bpp; x < bpl; x++) data[di + x] = (img[i + x] - img[i + x - bpp] + 256) & 255;\n } else if (y == 0) {\n for (var x = 0; x < bpp; x++) data[di + x] = img[i + x];\n\n if (type == 2) for (var x = bpp; x < bpl; x++) data[di + x] = img[i + x];\n if (type == 3) for (var x = bpp; x < bpl; x++) data[di + x] = (img[i + x] - (img[i + x - bpp] >> 1) + 256) & 255;\n if (type == 4) for (var x = bpp; x < bpl; x++) data[di + x] = (img[i + x] - paeth(img[i + x - bpp], 0, 0) + 256) & 255;\n } else {\n if (type == 2) { for (var x = 0; x < bpl; x++) data[di + x] = (img[i + x] + 256 - img[i + x - bpl]) & 255; }\n if (type == 3) {\n for (var x = 0; x < bpp; x++) data[di + x] = (img[i + x] + 256 - (img[i + x - bpl] >> 1)) & 255;\n for (var x = bpp; x < bpl; x++) data[di + x] = (img[i + x] + 256 - ((img[i + x - bpl] + img[i + x - bpp]) >> 1)) & 255;\n }\n if (type == 4) {\n for (var x = 0; x < bpp; x++) data[di + x] = (img[i + x] + 256 - paeth(0, img[i + x - bpl], 0)) & 255;\n for (var x = bpp; x < bpl; x++) data[di + x] = (img[i + x] + 256 - paeth(img[i + x - bpp], img[i + x - bpl], img[i + x - bpp - bpl])) & 255;\n }\n }\n};\n\nUPNG.crc = {\n table: (function () {\n const tab = new Uint32Array(256);\n for (let n = 0; n < 256; n++) {\n let c = n;\n for (let k = 0; k < 8; k++) {\n if (c & 1) c = 0xedb88320 ^ (c >>> 1);\n else c >>>= 1;\n }\n tab[n] = c;\n }\n return tab;\n }()),\n update(c, buf, off, len) {\n for (let i = 0; i < len; i++) c = UPNG.crc.table[(c ^ buf[off + i]) & 0xff] ^ (c >>> 8);\n return c;\n },\n crc(b, o, l) { return UPNG.crc.update(0xffffffff, b, o, l) ^ 0xffffffff; },\n};\n\nUPNG.quantize = function (abuf, ps) {\n const oimg = new Uint8Array(abuf); const nimg = oimg.slice(0); const\n nimg32 = new Uint32Array(nimg.buffer);\n\n const KD = UPNG.quantize.getKDtree(nimg, ps);\n const root = KD[0]; const\n leafs = KD[1];\n\n const { planeDst } = UPNG.quantize;\n const sb = oimg; const tb = nimg32; const\n len = sb.length;\n\n const inds = new Uint8Array(oimg.length >> 2); let\n nd;\n if (oimg.length < 20e6) // precise, but slow :(\n {\n for (var i = 0; i < len; i += 4) {\n var r = sb[i] * (1 / 255); var g = sb[i + 1] * (1 / 255); var b = sb[i + 2] * (1 / 255); var\n a = sb[i + 3] * (1 / 255);\n\n nd = UPNG.quantize.getNearest(root, r, g, b, a);\n inds[i >> 2] = nd.ind; tb[i >> 2] = nd.est.rgba;\n }\n } else {\n for (var i = 0; i < len; i += 4) {\n var r = sb[i] * (1 / 255); var g = sb[i + 1] * (1 / 255); var b = sb[i + 2] * (1 / 255); var\n a = sb[i + 3] * (1 / 255);\n\n nd = root; while (nd.left) nd = (planeDst(nd.est, r, g, b, a) <= 0) ? nd.left : nd.right;\n inds[i >> 2] = nd.ind; tb[i >> 2] = nd.est.rgba;\n }\n }\n return { abuf: nimg.buffer, inds, plte: leafs };\n};\n\nUPNG.quantize.getKDtree = function (nimg, ps, err) {\n if (err == null) err = 0.0001;\n const nimg32 = new Uint32Array(nimg.buffer);\n\n const root = {\n i0: 0, i1: nimg.length, bst: null, est: null, tdst: 0, left: null, right: null,\n }; // basic statistic, extra statistic\n root.bst = UPNG.quantize.stats(nimg, root.i0, root.i1); root.est = UPNG.quantize.estats(root.bst);\n const leafs = [root];\n\n while (leafs.length < ps) {\n let maxL = 0; let\n mi = 0;\n for (var i = 0; i < leafs.length; i++) if (leafs[i].est.L > maxL) { maxL = leafs[i].est.L; mi = i; }\n if (maxL < err) break;\n const node = leafs[mi];\n\n const s0 = UPNG.quantize.splitPixels(nimg, nimg32, node.i0, node.i1, node.est.e, node.est.eMq255);\n const s0wrong = (node.i0 >= s0 || node.i1 <= s0);\n // console.log(maxL, leafs.length, mi);\n if (s0wrong) { node.est.L = 0; continue; }\n\n const ln = {\n i0: node.i0, i1: s0, bst: null, est: null, tdst: 0, left: null, right: null,\n }; ln.bst = UPNG.quantize.stats(nimg, ln.i0, ln.i1);\n ln.est = UPNG.quantize.estats(ln.bst);\n const rn = {\n i0: s0, i1: node.i1, bst: null, est: null, tdst: 0, left: null, right: null,\n }; rn.bst = { R: [], m: [], N: node.bst.N - ln.bst.N };\n for (var i = 0; i < 16; i++) rn.bst.R[i] = node.bst.R[i] - ln.bst.R[i];\n for (var i = 0; i < 4; i++) rn.bst.m[i] = node.bst.m[i] - ln.bst.m[i];\n rn.est = UPNG.quantize.estats(rn.bst);\n\n node.left = ln; node.right = rn;\n leafs[mi] = ln; leafs.push(rn);\n }\n leafs.sort((a, b) => b.bst.N - a.bst.N);\n for (var i = 0; i < leafs.length; i++) leafs[i].ind = i;\n return [root, leafs];\n};\n\nUPNG.quantize.getNearest = function (nd, r, g, b, a) {\n if (nd.left == null) { nd.tdst = UPNG.quantize.dist(nd.est.q, r, g, b, a); return nd; }\n const planeDst = UPNG.quantize.planeDst(nd.est, r, g, b, a);\n\n let node0 = nd.left; let\n node1 = nd.right;\n if (planeDst > 0) { node0 = nd.right; node1 = nd.left; }\n\n const ln = UPNG.quantize.getNearest(node0, r, g, b, a);\n if (ln.tdst <= planeDst * planeDst) return ln;\n const rn = UPNG.quantize.getNearest(node1, r, g, b, a);\n return rn.tdst < ln.tdst ? rn : ln;\n};\nUPNG.quantize.planeDst = function (est, r, g, b, a) { const { e } = est; return e[0] * r + e[1] * g + e[2] * b + e[3] * a - est.eMq; };\nUPNG.quantize.dist = function (q, r, g, b, a) {\n const d0 = r - q[0]; const d1 = g - q[1]; const d2 = b - q[2]; const\n d3 = a - q[3]; return d0 * d0 + d1 * d1 + d2 * d2 + d3 * d3;\n};\n\nUPNG.quantize.splitPixels = function (nimg, nimg32, i0, i1, e, eMq) {\n const { vecDot } = UPNG.quantize;\n i1 -= 4;\n const shfs = 0;\n while (i0 < i1) {\n while (vecDot(nimg, i0, e) <= eMq) i0 += 4;\n while (vecDot(nimg, i1, e) > eMq) i1 -= 4;\n if (i0 >= i1) break;\n\n const t = nimg32[i0 >> 2]; nimg32[i0 >> 2] = nimg32[i1 >> 2]; nimg32[i1 >> 2] = t;\n\n i0 += 4; i1 -= 4;\n }\n while (vecDot(nimg, i0, e) > eMq) i0 -= 4;\n return i0 + 4;\n};\nUPNG.quantize.vecDot = function (nimg, i, e) {\n return nimg[i] * e[0] + nimg[i + 1] * e[1] + nimg[i + 2] * e[2] + nimg[i + 3] * e[3];\n};\nUPNG.quantize.stats = function (nimg, i0, i1) {\n const R = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0];\n const m = [0, 0, 0, 0];\n const N = (i1 - i0) >> 2;\n for (let i = i0; i < i1; i += 4) {\n const r = nimg[i] * (1 / 255); const g = nimg[i + 1] * (1 / 255); const b = nimg[i + 2] * (1 / 255); const\n a = nimg[i + 3] * (1 / 255);\n // var r = nimg[i], g = nimg[i+1], b = nimg[i+2], a = nimg[i+3];\n m[0] += r; m[1] += g; m[2] += b; m[3] += a;\n\n R[0] += r * r; R[1] += r * g; R[2] += r * b; R[3] += r * a;\n R[5] += g * g; R[6] += g * b; R[7] += g * a;\n R[10] += b * b; R[11] += b * a;\n R[15] += a * a;\n }\n R[4] = R[1]; R[8] = R[2]; R[9] = R[6]; R[12] = R[3]; R[13] = R[7]; R[14] = R[11];\n\n return { R, m, N };\n};\nUPNG.quantize.estats = function (stats) {\n const { R } = stats;\n const { m } = stats;\n const { N } = stats;\n\n // when all samples are equal, but N is large (millions), the Rj can be non-zero ( 0.0003.... - precission error)\n const m0 = m[0]; const m1 = m[1]; const m2 = m[2]; const m3 = m[3]; const\n iN = (N == 0 ? 0 : 1 / N);\n const Rj = [\n R[0] - m0 * m0 * iN, R[1] - m0 * m1 * iN, R[2] - m0 * m2 * iN, R[3] - m0 * m3 * iN,\n R[4] - m1 * m0 * iN, R[5] - m1 * m1 * iN, R[6] - m1 * m2 * iN, R[7] - m1 * m3 * iN,\n R[8] - m2 * m0 * iN, R[9] - m2 * m1 * iN, R[10] - m2 * m2 * iN, R[11] - m2 * m3 * iN,\n R[12] - m3 * m0 * iN, R[13] - m3 * m1 * iN, R[14] - m3 * m2 * iN, R[15] - m3 * m3 * iN,\n ];\n\n const A = Rj; const\n M = UPNG.M4;\n let b = [Math.random(), Math.random(), Math.random(), Math.random()]; let mi = 0; let\n tmi = 0;\n\n if (N != 0) {\n for (let i = 0; i < 16; i++) {\n b = M.multVec(A, b); tmi = Math.sqrt(M.dot(b, b)); b = M.sml(1 / tmi, b);\n if (i != 0 && Math.abs(tmi - mi) < 1e-9) break; mi = tmi;\n }\n }\n // b = [0,0,1,0]; mi=N;\n const q = [m0 * iN, m1 * iN, m2 * iN, m3 * iN];\n const eMq255 = M.dot(M.sml(255, q), b);\n\n return {\n Cov: Rj,\n q,\n e: b,\n L: mi,\n eMq255,\n eMq: M.dot(b, q),\n rgba: (((Math.round(255 * q[3]) << 24) | (Math.round(255 * q[2]) << 16) | (Math.round(255 * q[1]) << 8) | (Math.round(255 * q[0]) << 0)) >>> 0),\n };\n};\nUPNG.M4 = {\n multVec(m, v) {\n return [\n m[0] * v[0] + m[1] * v[1] + m[2] * v[2] + m[3] * v[3],\n m[4] * v[0] + m[5] * v[1] + m[6] * v[2] + m[7] * v[3],\n m[8] * v[0] + m[9] * v[1] + m[10] * v[2] + m[11] * v[3],\n m[12] * v[0] + m[13] * v[1] + m[14] * v[2] + m[15] * v[3],\n ];\n },\n dot(x, y) { return x[0] * y[0] + x[1] * y[1] + x[2] * y[2] + x[3] * y[3]; },\n sml(a, y) { return [a * y[0], a * y[1], a * y[2], a * y[3]]; },\n};\n\nUPNG.encode.concatRGBA = function (bufs) {\n let tlen = 0;\n for (var i = 0; i < bufs.length; i++) tlen += bufs[i].byteLength;\n const nimg = new Uint8Array(tlen); let\n noff = 0;\n for (var i = 0; i < bufs.length; i++) {\n const img = new Uint8Array(bufs[i]); const\n il = img.length;\n for (let j = 0; j < il; j += 4) {\n let r = img[j]; let g = img[j + 1]; let b = img[j + 2]; const\n a = img[j + 3];\n if (a == 0) r = g = b = 0;\n nimg[noff + j] = r; nimg[noff + j + 1] = g; nimg[noff + j + 2] = b; nimg[noff + j + 3] = a;\n }\n noff += il;\n }\n return nimg.buffer;\n};\n\nexport default UPNG;\n","import UPNG from './UPNG';\nimport MaxCanvasSize from './config/max-canvas-size';\n\nconst isBrowser = typeof window !== 'undefined'; // change browser environment to support SSR\n\n// add support for cordova-plugin-file\nconst moduleMapper = isBrowser && window.cordova && window.cordova.require && window.cordova.require('cordova/modulemapper');\nexport const CustomFile = isBrowser && ((moduleMapper && moduleMapper.getOriginalSymbol(window, 'File')) || (typeof window.File !== 'undefined' && File));\nexport const CustomFileReader = isBrowser && ((moduleMapper && moduleMapper.getOriginalSymbol(window, 'FileReader')) || (typeof window.FileReader !== 'undefined' && FileReader));\n\n/**\n * getFilefromDataUrl\n *\n * @param {string} dataUrl\n * @param {string} filename\n * @param {number} [lastModified=Date.now()]\n * @returns {Promise}\n */\nexport function getFilefromDataUrl(dataUrl, filename, lastModified = Date.now()) {\n return new Promise((resolve) => {\n const arr = dataUrl.split(',');\n const mime = arr[0].match(/:(.*?);/)[1];\n const bstr = globalThis.atob(arr[1]);\n let n = bstr.length;\n const u8arr = new Uint8Array(n);\n while (n--) {\n u8arr[n] = bstr.charCodeAt(n);\n }\n const file = new Blob([u8arr], { type: mime });\n file.name = filename;\n file.lastModified = lastModified;\n resolve(file);\n\n // Safari has issue with File constructor not being able to POST in FormData\n // https://github.com/Donaldcwl/browser-image-compression/issues/8\n // https://bugs.webkit.org/show_bug.cgi?id=165081\n // let file\n // try {\n // file = new File([u8arr], filename, { type: mime }) // Edge do not support File constructor\n // } catch (e) {\n // file = new Blob([u8arr], { type: mime })\n // file.name = filename\n // file.lastModified = lastModified\n // }\n // resolve(file)\n });\n}\n\n/**\n * getDataUrlFromFile\n *\n * @param {File | Blob} file\n * @returns {Promise}\n */\nexport function getDataUrlFromFile(file) {\n return new Promise((resolve, reject) => {\n const reader = new CustomFileReader();\n reader.onload = () => resolve(reader.result);\n reader.onerror = (e) => reject(e);\n reader.readAsDataURL(file);\n });\n}\n\n/**\n * loadImage\n *\n * @param {string} src\n * @returns {Promise}\n */\nexport function loadImage(src) {\n return new Promise((resolve, reject) => {\n const img = new Image();\n img.onload = () => resolve(img);\n img.onerror = (e) => reject(e);\n img.src = src;\n });\n}\n\n/**\n * getBrowserName\n *\n * Extracts the browser name from the useragent.\n *\n * ref: https://stackoverflow.com/a/26358856\n *\n * @returns {string}\n */\nexport function getBrowserName() {\n let browserName = 'etc';\n if (navigator.userAgent.indexOf('Chrome') !== -1 || navigator.userAgent.indexOf('Chromium') !== -1) {\n browserName = 'chrome';\n } if (navigator.userAgent.indexOf('Safari') !== -1) {\n browserName = 'safari';\n } else if (navigator.userAgent.indexOf('Firefox') !== -1) {\n browserName = 'firefox';\n } else if ((navigator.userAgent.indexOf('MSIE') !== -1) || (!!document.documentMode === true)) { // IF IE > 10\n browserName = 'internet explorer';\n }\n return browserName;\n}\n\n/**\n * approximateBelowCanvasMaximumSizeOfBrowser\n *\n * it uses binary search to converge below the browser's maximum Canvas size.\n *\n * ref: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/canvas#maximum_canvas_size\n *\n * @param {number} initWidth\n * @param {number} initHeight\n * @returns {object}\n */\nexport function approximateBelowMaximumCanvasSizeOfBrowser(initWidth, initHeight) {\n const browserName = getBrowserName();\n const maximumCanvasSize = MaxCanvasSize[browserName];\n\n let width = initWidth;\n let height = initHeight;\n let size = width * height;\n const ratio = width > height ? height / width : width / height;\n\n while (size > maximumCanvasSize * maximumCanvasSize) {\n const halfSizeWidth = (maximumCanvasSize + width) / 2;\n const halfSizeHeight = (maximumCanvasSize + height) / 2;\n if (halfSizeWidth < halfSizeHeight) {\n height = halfSizeHeight;\n width = halfSizeHeight * ratio;\n } else {\n height = halfSizeWidth * ratio;\n width = halfSizeWidth;\n }\n\n size = width * height;\n }\n\n return {\n width, height,\n };\n}\n\n/**\n * get new Canvas and it's context\n * @param width\n * @param height\n * @returns {[HTMLCanvasElement | OffscreenCanvas, CanvasRenderingContext2D]}\n */\nexport function getNewCanvasAndCtx(width, height) {\n let canvas;\n let ctx;\n try {\n canvas = new OffscreenCanvas(width, height);\n ctx = canvas.getContext('2d');\n if (ctx === null) {\n throw new Error('getContext of OffscreenCanvas returns null');\n }\n } catch (e) {\n canvas = document.createElement('canvas');\n ctx = canvas.getContext('2d');\n }\n canvas.width = width;\n canvas.height = height;\n // ctx.fillStyle = '#fff'\n // ctx.fillRect(0, 0, width, height)\n return [canvas, ctx];\n}\n\n/**\n * drawImageInCanvas\n *\n * @param {HTMLImageElement} img\n * @returns {HTMLCanvasElement | OffscreenCanvas}\n */\nexport function drawImageInCanvas(img) {\n const { width, height } = approximateBelowMaximumCanvasSizeOfBrowser(img.width, img.height);\n const [canvas, ctx] = getNewCanvasAndCtx(width, height);\n ctx.drawImage(img, 0, 0, canvas.width, canvas.height);\n return canvas;\n}\n\n/**\n * drawFileInCanvas\n *\n * @param {File | Blob} file\n * @returns {Promise<[ImageBitmap | HTMLImageElement, HTMLCanvasElement | OffscreenCanvas]>}\n */\nexport async function drawFileInCanvas(file) {\n let img;\n try {\n img = await createImageBitmap(file);\n } catch (e) {\n const dataUrl = await getDataUrlFromFile(file);\n img = await loadImage(dataUrl);\n }\n const canvas = drawImageInCanvas(img);\n return [img, canvas];\n}\n\n/**\n * canvasToFile\n *\n * @param {HTMLCanvasElement | OffscreenCanvas} canvas\n * @param {string} fileType\n * @param {string} fileName\n * @param {number} fileLastModified\n * @param {number} [quality]\n * @returns {Promise}\n */\nexport async function canvasToFile(canvas, fileType, fileName, fileLastModified, quality = 1) {\n let file;\n if (fileType === 'image/png') {\n const ctx = canvas.getContext('2d');\n const { data } = ctx.getImageData(0, 0, canvas.width, canvas.height);\n const png = UPNG.encode([data], canvas.width, canvas.height, 256 * quality);\n file = new Blob([png], { type: fileType });\n file.name = fileName;\n file.lastModified = fileLastModified;\n } else if (typeof OffscreenCanvas === 'function' && canvas instanceof OffscreenCanvas) { // checked on Win Chrome 83, MacOS Chrome 83\n file = await canvas.convertToBlob({ type: fileType, quality });\n file.name = fileName;\n file.lastModified = fileLastModified;\n // some browser do not support quality parameter, see: https://developer.mozilla.org/en-US/docs/Web/API/HTMLCanvasElement/toBlob\n // } else if (typeof canvas.toBlob === 'function') {\n // file = await new Promise(resolve => canvas.toBlob(resolve, fileType, quality))\n } else { // checked on Win Edge 44, Win IE 11, Win Firefox 76, MacOS Firefox 77, MacOS Safari 13.1\n const dataUrl = canvas.toDataURL(fileType, quality);\n file = await getFilefromDataUrl(dataUrl, fileName, fileLastModified);\n }\n return file;\n}\n\n/**\n * clear Canvas memory\n * @param canvas\n * @returns null\n */\nexport function cleanupCanvasMemory(canvas) {\n // garbage clean canvas for safari\n // ref: https://bugs.webkit.org/show_bug.cgi?id=195325\n // eslint-disable-next-line no-param-reassign\n canvas.width = 0;\n // eslint-disable-next-line no-param-reassign\n canvas.height = 0;\n}\n\n// Check if browser supports automatic image orientation\n// see https://github.com/blueimp/JavaScript-Load-Image/blob/1e4df707821a0afcc11ea0720ee403b8759f3881/js/load-image-orientation.js#L37-L53\nexport async function isAutoOrientationInBrowser() {\n if (isAutoOrientationInBrowser.result !== undefined) return isAutoOrientationInBrowser.result;\n\n // black 2x1 JPEG, with the following meta information set:\n // EXIF Orientation: 6 (Rotated 90° CCW)\n const testImageURL = 'data:image/jpeg;base64,/9j/4QAiRXhpZgAATU0AKgAAAAgAAQESAAMAAAABAAYAAAA'\n + 'AAAD/2wCEAAEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBA'\n + 'QEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQE'\n + 'BAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAf/AABEIAAEAAgMBEQACEQEDEQH/x'\n + 'ABKAAEAAAAAAAAAAAAAAAAAAAALEAEAAAAAAAAAAAAAAAAAAAAAAQEAAAAAAAAAAAAAAAA'\n + 'AAAAAEQEAAAAAAAAAAAAAAAAAAAAA/9oADAMBAAIRAxEAPwA/8H//2Q==';\n const testImageFile = await getFilefromDataUrl(testImageURL, 'test.jpg', Date.now());\n\n const testImageCanvas = (await drawFileInCanvas(testImageFile))[1];\n const testImageFile2 = await canvasToFile(testImageCanvas, testImageFile.type, testImageFile.name, testImageFile.lastModified);\n cleanupCanvasMemory(testImageCanvas);\n const img = (await drawFileInCanvas(testImageFile2))[0];\n // console.log('img', img.width, img.height)\n\n isAutoOrientationInBrowser.result = img.width === 1 && img.height === 2;\n return isAutoOrientationInBrowser.result;\n}\n\n/**\n * getExifOrientation\n * get image exif orientation info\n * source: https://stackoverflow.com/a/32490603/10395024\n *\n * @param {File | Blob} file\n * @returns {Promise} - orientation id, see https://i.stack.imgur.com/VGsAj.gif\n */\nexport function getExifOrientation(file) {\n return new Promise((resolve, reject) => {\n const reader = new CustomFileReader();\n reader.onload = (e) => {\n const view = new DataView(e.target.result);\n if (view.getUint16(0, false) != 0xFFD8) {\n return resolve(-2);\n }\n const length = view.byteLength;\n let offset = 2;\n while (offset < length) {\n if (view.getUint16(offset + 2, false) <= 8) return resolve(-1);\n const marker = view.getUint16(offset, false);\n offset += 2;\n if (marker == 0xFFE1) {\n if (view.getUint32(offset += 2, false) != 0x45786966) {\n return resolve(-1);\n }\n\n const little = view.getUint16(offset += 6, false) == 0x4949;\n offset += view.getUint32(offset + 4, little);\n const tags = view.getUint16(offset, little);\n offset += 2;\n for (let i = 0; i < tags; i++) {\n if (view.getUint16(offset + (i * 12), little) == 0x0112) {\n return resolve(view.getUint16(offset + (i * 12) + 8, little));\n }\n }\n } else if ((marker & 0xFF00) != 0xFF00) {\n break;\n } else {\n offset += view.getUint16(offset, false);\n }\n }\n return resolve(-1);\n };\n reader.onerror = (e) => reject(e);\n reader.readAsArrayBuffer(file);\n });\n}\n\n/**\n *\n * @param {HTMLCanvasElement | OffscreenCanvas} canvas\n * @param options\n * @returns {HTMLCanvasElement | OffscreenCanvas}\n */\nexport function handleMaxWidthOrHeight(canvas, options) {\n const { width } = canvas;\n const { height } = canvas;\n const { maxWidthOrHeight } = options;\n\n const needToHandle = isFinite(maxWidthOrHeight) && (width > maxWidthOrHeight || height > maxWidthOrHeight);\n\n let newCanvas = canvas;\n let ctx;\n\n if (needToHandle) {\n [newCanvas, ctx] = getNewCanvasAndCtx(width, height);\n if (width > height) {\n newCanvas.width = maxWidthOrHeight;\n newCanvas.height = (height / width) * maxWidthOrHeight;\n } else {\n newCanvas.width = (width / height) * maxWidthOrHeight;\n newCanvas.height = maxWidthOrHeight;\n }\n ctx.drawImage(canvas, 0, 0, newCanvas.width, newCanvas.height);\n\n cleanupCanvasMemory(canvas);\n }\n\n return newCanvas;\n}\n\n/**\n * followExifOrientation\n * source: https://stackoverflow.com/a/40867559/10395024\n *\n * @param {HTMLCanvasElement | OffscreenCanvas} canvas\n * @param {number} exifOrientation\n * @returns {HTMLCanvasElement | OffscreenCanvas} canvas\n */\nexport function followExifOrientation(canvas, exifOrientation) {\n const { width } = canvas;\n const { height } = canvas;\n\n const [newCanvas, ctx] = getNewCanvasAndCtx(width, height);\n\n // set proper canvas dimensions before transform & export\n if (exifOrientation > 4 && exifOrientation < 9) {\n newCanvas.width = height;\n newCanvas.height = width;\n } else {\n newCanvas.width = width;\n newCanvas.height = height;\n }\n\n // transform context before drawing image\n switch (exifOrientation) {\n case 2:\n ctx.transform(-1, 0, 0, 1, width, 0);\n break;\n case 3:\n ctx.transform(-1, 0, 0, -1, width, height);\n break;\n case 4:\n ctx.transform(1, 0, 0, -1, 0, height);\n break;\n case 5:\n ctx.transform(0, 1, 1, 0, 0, 0);\n break;\n case 6:\n ctx.transform(0, 1, -1, 0, height, 0);\n break;\n case 7:\n ctx.transform(0, -1, -1, 0, height, width);\n break;\n case 8:\n ctx.transform(0, -1, 1, 0, 0, width);\n break;\n default:\n break;\n }\n\n ctx.drawImage(canvas, 0, 0, width, height);\n\n cleanupCanvasMemory(canvas);\n\n return newCanvas;\n}\n","import {\n canvasToFile,\n cleanupCanvasMemory,\n drawFileInCanvas,\n followExifOrientation,\n getExifOrientation,\n getNewCanvasAndCtx,\n handleMaxWidthOrHeight,\n isAutoOrientationInBrowser,\n} from './utils';\n\n/**\n * Compress an image file.\n *\n * @param {File} file\n * @param {Object} options\n * @param {number} [options.maxSizeMB=Number.POSITIVE_INFINITY]\n * @param {number} [options.maxWidthOrHeight=undefined]\n * @param {boolean} [options.useWebWorker=false]\n * @param {number} [options.maxIteration=10]\n * @param {number} [options.exifOrientation] - default to be the exif orientation from the image file\n * @param {Function} [options.onProgress] - a function takes one progress argument (progress from 0 to 100)\n * @param {string} [options.fileType] - default to be the original mime type from the image file\n * @param {number} [options.initialQuality=1.0]\n * @param {number} previousProgress - for internal try catch rerunning start from previous progress\n * @returns {Promise}\n */\nexport default async function compress(file, options, previousProgress = 0) {\n let progress = previousProgress;\n\n function incProgress(inc = 5) {\n progress += inc;\n options.onProgress(Math.min(progress, 100));\n }\n\n function setProgress(p) {\n progress = Math.min(Math.max(p, progress), 100);\n options.onProgress(progress);\n }\n\n let remainingTrials = options.maxIteration || 10;\n\n const maxSizeByte = options.maxSizeMB * 1024 * 1024;\n\n incProgress();\n\n // drawFileInCanvas\n const [, origCanvas] = await drawFileInCanvas(file);\n\n incProgress();\n\n // handleMaxWidthOrHeight\n const maxWidthOrHeightFixedCanvas = handleMaxWidthOrHeight(origCanvas, options);\n\n incProgress();\n\n // exifOrientation\n const exifOrientation = options.exifOrientation || await getExifOrientation(file);\n incProgress();\n const orientationFixedCanvas = (await isAutoOrientationInBrowser()) ? maxWidthOrHeightFixedCanvas : followExifOrientation(maxWidthOrHeightFixedCanvas, exifOrientation);\n incProgress();\n\n let quality = options.initialQuality || 1.0;\n\n const outputFileType = options.fileType || file.type;\n\n const tempFile = await canvasToFile(orientationFixedCanvas, outputFileType, file.name, file.lastModified, quality);\n incProgress();\n\n const origExceedMaxSize = tempFile.size > maxSizeByte;\n const sizeBecomeLarger = tempFile.size > file.size;\n // console.log('original file size', file.size)\n // console.log('current file size', tempFile.size)\n\n // check if we need to compress or resize\n if (!origExceedMaxSize && !sizeBecomeLarger) {\n // no need to compress\n setProgress(100);\n return tempFile;\n }\n\n const sourceSize = file.size;\n const renderedSize = tempFile.size;\n let currentSize = renderedSize;\n let compressedFile;\n let newCanvas; let\n ctx;\n let canvas = orientationFixedCanvas;\n while (remainingTrials-- && (currentSize > maxSizeByte || currentSize > sourceSize)) {\n const newWidth = origExceedMaxSize ? canvas.width * 0.95 : canvas.width;\n const newHeight = origExceedMaxSize ? canvas.height * 0.95 : canvas.height;\n // console.log('current width', newWidth);\n // console.log('current height', newHeight);\n [newCanvas, ctx] = getNewCanvasAndCtx(newWidth, newHeight);\n\n ctx.drawImage(canvas, 0, 0, newWidth, newHeight);\n\n quality *= 0.95;\n // eslint-disable-next-line no-await-in-loop\n compressedFile = await canvasToFile(newCanvas, outputFileType, file.name, file.lastModified, quality);\n\n cleanupCanvasMemory(canvas);\n\n canvas = newCanvas;\n\n currentSize = compressedFile.size;\n // console.log('currentSize', currentSize)\n setProgress(Math.min(99, Math.floor(((renderedSize - currentSize) / (renderedSize - maxSizeByte)) * 100)));\n }\n\n cleanupCanvasMemory(canvas);\n cleanupCanvasMemory(newCanvas);\n cleanupCanvasMemory(maxWidthOrHeightFixedCanvas);\n cleanupCanvasMemory(orientationFixedCanvas);\n cleanupCanvasMemory(origCanvas);\n\n setProgress(100);\n return compressedFile;\n}\n","'use strict';\nvar charAt = require('../internals/string-multibyte').charAt;\nvar toString = require('../internals/to-string');\nvar InternalStateModule = require('../internals/internal-state');\nvar defineIterator = require('../internals/define-iterator');\n\nvar STRING_ITERATOR = 'String Iterator';\nvar setInternalState = InternalStateModule.set;\nvar getInternalState = InternalStateModule.getterFor(STRING_ITERATOR);\n\n// `String.prototype[@@iterator]` method\n// https://tc39.es/ecma262/#sec-string.prototype-@@iterator\ndefineIterator(String, 'String', function (iterated) {\n setInternalState(this, {\n type: STRING_ITERATOR,\n string: toString(iterated),\n index: 0\n });\n// `%StringIteratorPrototype%.next` method\n// https://tc39.es/ecma262/#sec-%stringiteratorprototype%.next\n}, function next() {\n var state = getInternalState(this);\n var string = state.string;\n var index = state.index;\n var point;\n if (index >= string.length) return { value: undefined, done: true };\n point = charAt(string, index);\n state.index += point.length;\n return { value: point, done: false };\n});\n","var global = require('../internals/global');\nvar DOMIterables = require('../internals/dom-iterables');\nvar ArrayIteratorMethods = require('../modules/es.array.iterator');\nvar createNonEnumerableProperty = require('../internals/create-non-enumerable-property');\nvar wellKnownSymbol = require('../internals/well-known-symbol');\n\nvar ITERATOR = wellKnownSymbol('iterator');\nvar TO_STRING_TAG = wellKnownSymbol('toStringTag');\nvar ArrayValues = ArrayIteratorMethods.values;\n\nfor (var COLLECTION_NAME in DOMIterables) {\n var Collection = global[COLLECTION_NAME];\n var CollectionPrototype = Collection && Collection.prototype;\n if (CollectionPrototype) {\n // some Chrome versions have non-configurable methods on DOMTokenList\n if (CollectionPrototype[ITERATOR] !== ArrayValues) try {\n createNonEnumerableProperty(CollectionPrototype, ITERATOR, ArrayValues);\n } catch (error) {\n CollectionPrototype[ITERATOR] = ArrayValues;\n }\n if (!CollectionPrototype[TO_STRING_TAG]) {\n createNonEnumerableProperty(CollectionPrototype, TO_STRING_TAG, COLLECTION_NAME);\n }\n if (DOMIterables[COLLECTION_NAME]) for (var METHOD_NAME in ArrayIteratorMethods) {\n // some Chrome versions have non-configurable methods on DOMTokenList\n if (CollectionPrototype[METHOD_NAME] !== ArrayIteratorMethods[METHOD_NAME]) try {\n createNonEnumerableProperty(CollectionPrototype, METHOD_NAME, ArrayIteratorMethods[METHOD_NAME]);\n } catch (error) {\n CollectionPrototype[METHOD_NAME] = ArrayIteratorMethods[METHOD_NAME];\n }\n }\n }\n}\n","var fails = require('../internals/fails');\nvar wellKnownSymbol = require('../internals/well-known-symbol');\nvar IS_PURE = require('../internals/is-pure');\n\nvar ITERATOR = wellKnownSymbol('iterator');\n\nmodule.exports = !fails(function () {\n var url = new URL('b?a=1&b=2&c=3', 'http://a');\n var searchParams = url.searchParams;\n var result = '';\n url.pathname = 'c%20d';\n searchParams.forEach(function (value, key) {\n searchParams['delete']('b');\n result += key + value;\n });\n return (IS_PURE && !url.toJSON)\n || !searchParams.sort\n || url.href !== 'http://a/c%20d?a=1&c=3'\n || searchParams.get('c') !== '3'\n || String(new URLSearchParams('?a=1')) !== 'a=1'\n || !searchParams[ITERATOR]\n // throws in Edge\n || new URL('https://a@b').username !== 'a'\n || new URLSearchParams(new URLSearchParams('a=b')).get('a') !== 'b'\n // not punycoded in Edge\n || new URL('http://тест').host !== 'xn--e1aybc'\n // not escaped in Chrome 62-\n || new URL('http://a#б').hash !== '#%D0%B1'\n // fails in Chrome 66-\n || result !== 'a1c3'\n // throws in Safari\n || new URL('http://x', undefined).host !== 'x';\n});\n","var anObject = require('../internals/an-object');\nvar iteratorClose = require('../internals/iterator-close');\n\n// call something on iterator step with safe closing on error\nmodule.exports = function (iterator, fn, value, ENTRIES) {\n try {\n return ENTRIES ? fn(anObject(value)[0], value[1]) : fn(value);\n } catch (error) {\n iteratorClose(iterator);\n throw error;\n }\n};\n","'use strict';\nvar bind = require('../internals/function-bind-context');\nvar toObject = require('../internals/to-object');\nvar callWithSafeIterationClosing = require('../internals/call-with-safe-iteration-closing');\nvar isArrayIteratorMethod = require('../internals/is-array-iterator-method');\nvar toLength = require('../internals/to-length');\nvar createProperty = require('../internals/create-property');\nvar getIteratorMethod = require('../internals/get-iterator-method');\n\n// `Array.from` method implementation\n// https://tc39.es/ecma262/#sec-array.from\nmodule.exports = function from(arrayLike /* , mapfn = undefined, thisArg = undefined */) {\n var O = toObject(arrayLike);\n var C = typeof this == 'function' ? this : Array;\n var argumentsLength = arguments.length;\n var mapfn = argumentsLength > 1 ? arguments[1] : undefined;\n var mapping = mapfn !== undefined;\n var iteratorMethod = getIteratorMethod(O);\n var index = 0;\n var length, result, step, iterator, next, value;\n if (mapping) mapfn = bind(mapfn, argumentsLength > 2 ? arguments[2] : undefined, 2);\n // if the target is not iterable or it's an array with the default iterator - use a simple case\n if (iteratorMethod != undefined && !(C == Array && isArrayIteratorMethod(iteratorMethod))) {\n iterator = iteratorMethod.call(O);\n next = iterator.next;\n result = new C();\n for (;!(step = next.call(iterator)).done; index++) {\n value = mapping ? callWithSafeIterationClosing(iterator, mapfn, [step.value, index], true) : step.value;\n createProperty(result, index, value);\n }\n } else {\n length = toLength(O.length);\n result = new C(length);\n for (;length > index; index++) {\n value = mapping ? mapfn(O[index], index) : O[index];\n createProperty(result, index, value);\n }\n }\n result.length = index;\n return result;\n};\n","'use strict';\n// based on https://github.com/bestiejs/punycode.js/blob/master/punycode.js\nvar maxInt = 2147483647; // aka. 0x7FFFFFFF or 2^31-1\nvar base = 36;\nvar tMin = 1;\nvar tMax = 26;\nvar skew = 38;\nvar damp = 700;\nvar initialBias = 72;\nvar initialN = 128; // 0x80\nvar delimiter = '-'; // '\\x2D'\nvar regexNonASCII = /[^\\0-\\u007E]/; // non-ASCII chars\nvar regexSeparators = /[.\\u3002\\uFF0E\\uFF61]/g; // RFC 3490 separators\nvar OVERFLOW_ERROR = 'Overflow: input needs wider integers to process';\nvar baseMinusTMin = base - tMin;\nvar floor = Math.floor;\nvar stringFromCharCode = String.fromCharCode;\n\n/**\n * Creates an array containing the numeric code points of each Unicode\n * character in the string. While JavaScript uses UCS-2 internally,\n * this function will convert a pair of surrogate halves (each of which\n * UCS-2 exposes as separate characters) into a single code point,\n * matching UTF-16.\n */\nvar ucs2decode = function (string) {\n var output = [];\n var counter = 0;\n var length = string.length;\n while (counter < length) {\n var value = string.charCodeAt(counter++);\n if (value >= 0xD800 && value <= 0xDBFF && counter < length) {\n // It's a high surrogate, and there is a next character.\n var extra = string.charCodeAt(counter++);\n if ((extra & 0xFC00) == 0xDC00) { // Low surrogate.\n output.push(((value & 0x3FF) << 10) + (extra & 0x3FF) + 0x10000);\n } else {\n // It's an unmatched surrogate; only append this code unit, in case the\n // next code unit is the high surrogate of a surrogate pair.\n output.push(value);\n counter--;\n }\n } else {\n output.push(value);\n }\n }\n return output;\n};\n\n/**\n * Converts a digit/integer into a basic code point.\n */\nvar digitToBasic = function (digit) {\n // 0..25 map to ASCII a..z or A..Z\n // 26..35 map to ASCII 0..9\n return digit + 22 + 75 * (digit < 26);\n};\n\n/**\n * Bias adaptation function as per section 3.4 of RFC 3492.\n * https://tools.ietf.org/html/rfc3492#section-3.4\n */\nvar adapt = function (delta, numPoints, firstTime) {\n var k = 0;\n delta = firstTime ? floor(delta / damp) : delta >> 1;\n delta += floor(delta / numPoints);\n for (; delta > baseMinusTMin * tMax >> 1; k += base) {\n delta = floor(delta / baseMinusTMin);\n }\n return floor(k + (baseMinusTMin + 1) * delta / (delta + skew));\n};\n\n/**\n * Converts a string of Unicode symbols (e.g. a domain name label) to a\n * Punycode string of ASCII-only symbols.\n */\n// eslint-disable-next-line max-statements -- TODO\nvar encode = function (input) {\n var output = [];\n\n // Convert the input in UCS-2 to an array of Unicode code points.\n input = ucs2decode(input);\n\n // Cache the length.\n var inputLength = input.length;\n\n // Initialize the state.\n var n = initialN;\n var delta = 0;\n var bias = initialBias;\n var i, currentValue;\n\n // Handle the basic code points.\n for (i = 0; i < input.length; i++) {\n currentValue = input[i];\n if (currentValue < 0x80) {\n output.push(stringFromCharCode(currentValue));\n }\n }\n\n var basicLength = output.length; // number of basic code points.\n var handledCPCount = basicLength; // number of code points that have been handled;\n\n // Finish the basic string with a delimiter unless it's empty.\n if (basicLength) {\n output.push(delimiter);\n }\n\n // Main encoding loop:\n while (handledCPCount < inputLength) {\n // All non-basic code points < n have been handled already. Find the next larger one:\n var m = maxInt;\n for (i = 0; i < input.length; i++) {\n currentValue = input[i];\n if (currentValue >= n && currentValue < m) {\n m = currentValue;\n }\n }\n\n // Increase `delta` enough to advance the decoder's state to , but guard against overflow.\n var handledCPCountPlusOne = handledCPCount + 1;\n if (m - n > floor((maxInt - delta) / handledCPCountPlusOne)) {\n throw RangeError(OVERFLOW_ERROR);\n }\n\n delta += (m - n) * handledCPCountPlusOne;\n n = m;\n\n for (i = 0; i < input.length; i++) {\n currentValue = input[i];\n if (currentValue < n && ++delta > maxInt) {\n throw RangeError(OVERFLOW_ERROR);\n }\n if (currentValue == n) {\n // Represent delta as a generalized variable-length integer.\n var q = delta;\n for (var k = base; /* no condition */; k += base) {\n var t = k <= bias ? tMin : (k >= bias + tMax ? tMax : k - bias);\n if (q < t) break;\n var qMinusT = q - t;\n var baseMinusT = base - t;\n output.push(stringFromCharCode(digitToBasic(t + qMinusT % baseMinusT)));\n q = floor(qMinusT / baseMinusT);\n }\n\n output.push(stringFromCharCode(digitToBasic(q)));\n bias = adapt(delta, handledCPCountPlusOne, handledCPCount == basicLength);\n delta = 0;\n ++handledCPCount;\n }\n }\n\n ++delta;\n ++n;\n }\n return output.join('');\n};\n\nmodule.exports = function (input) {\n var encoded = [];\n var labels = input.toLowerCase().replace(regexSeparators, '\\u002E').split('.');\n var i, label;\n for (i = 0; i < labels.length; i++) {\n label = labels[i];\n encoded.push(regexNonASCII.test(label) ? 'xn--' + encode(label) : label);\n }\n return encoded.join('.');\n};\n","var anObject = require('../internals/an-object');\nvar getIteratorMethod = require('../internals/get-iterator-method');\n\nmodule.exports = function (it) {\n var iteratorMethod = getIteratorMethod(it);\n if (typeof iteratorMethod != 'function') {\n throw TypeError(String(it) + ' is not iterable');\n } return anObject(iteratorMethod.call(it));\n};\n","'use strict';\n// TODO: in core-js@4, move /modules/ dependencies to public entries for better optimization by tools like `preset-env`\nrequire('../modules/es.array.iterator');\nvar $ = require('../internals/export');\nvar getBuiltIn = require('../internals/get-built-in');\nvar USE_NATIVE_URL = require('../internals/native-url');\nvar redefine = require('../internals/redefine');\nvar redefineAll = require('../internals/redefine-all');\nvar setToStringTag = require('../internals/set-to-string-tag');\nvar createIteratorConstructor = require('../internals/create-iterator-constructor');\nvar InternalStateModule = require('../internals/internal-state');\nvar anInstance = require('../internals/an-instance');\nvar hasOwn = require('../internals/has');\nvar bind = require('../internals/function-bind-context');\nvar classof = require('../internals/classof');\nvar anObject = require('../internals/an-object');\nvar isObject = require('../internals/is-object');\nvar $toString = require('../internals/to-string');\nvar create = require('../internals/object-create');\nvar createPropertyDescriptor = require('../internals/create-property-descriptor');\nvar getIterator = require('../internals/get-iterator');\nvar getIteratorMethod = require('../internals/get-iterator-method');\nvar wellKnownSymbol = require('../internals/well-known-symbol');\n\nvar nativeFetch = getBuiltIn('fetch');\nvar NativeRequest = getBuiltIn('Request');\nvar RequestPrototype = NativeRequest && NativeRequest.prototype;\nvar Headers = getBuiltIn('Headers');\nvar ITERATOR = wellKnownSymbol('iterator');\nvar URL_SEARCH_PARAMS = 'URLSearchParams';\nvar URL_SEARCH_PARAMS_ITERATOR = URL_SEARCH_PARAMS + 'Iterator';\nvar setInternalState = InternalStateModule.set;\nvar getInternalParamsState = InternalStateModule.getterFor(URL_SEARCH_PARAMS);\nvar getInternalIteratorState = InternalStateModule.getterFor(URL_SEARCH_PARAMS_ITERATOR);\n\nvar plus = /\\+/g;\nvar sequences = Array(4);\n\nvar percentSequence = function (bytes) {\n return sequences[bytes - 1] || (sequences[bytes - 1] = RegExp('((?:%[\\\\da-f]{2}){' + bytes + '})', 'gi'));\n};\n\nvar percentDecode = function (sequence) {\n try {\n return decodeURIComponent(sequence);\n } catch (error) {\n return sequence;\n }\n};\n\nvar deserialize = function (it) {\n var result = it.replace(plus, ' ');\n var bytes = 4;\n try {\n return decodeURIComponent(result);\n } catch (error) {\n while (bytes) {\n result = result.replace(percentSequence(bytes--), percentDecode);\n }\n return result;\n }\n};\n\nvar find = /[!'()~]|%20/g;\n\nvar replace = {\n '!': '%21',\n \"'\": '%27',\n '(': '%28',\n ')': '%29',\n '~': '%7E',\n '%20': '+'\n};\n\nvar replacer = function (match) {\n return replace[match];\n};\n\nvar serialize = function (it) {\n return encodeURIComponent(it).replace(find, replacer);\n};\n\nvar parseSearchParams = function (result, query) {\n if (query) {\n var attributes = query.split('&');\n var index = 0;\n var attribute, entry;\n while (index < attributes.length) {\n attribute = attributes[index++];\n if (attribute.length) {\n entry = attribute.split('=');\n result.push({\n key: deserialize(entry.shift()),\n value: deserialize(entry.join('='))\n });\n }\n }\n }\n};\n\nvar updateSearchParams = function (query) {\n this.entries.length = 0;\n parseSearchParams(this.entries, query);\n};\n\nvar validateArgumentsLength = function (passed, required) {\n if (passed < required) throw TypeError('Not enough arguments');\n};\n\nvar URLSearchParamsIterator = createIteratorConstructor(function Iterator(params, kind) {\n setInternalState(this, {\n type: URL_SEARCH_PARAMS_ITERATOR,\n iterator: getIterator(getInternalParamsState(params).entries),\n kind: kind\n });\n}, 'Iterator', function next() {\n var state = getInternalIteratorState(this);\n var kind = state.kind;\n var step = state.iterator.next();\n var entry = step.value;\n if (!step.done) {\n step.value = kind === 'keys' ? entry.key : kind === 'values' ? entry.value : [entry.key, entry.value];\n } return step;\n});\n\n// `URLSearchParams` constructor\n// https://url.spec.whatwg.org/#interface-urlsearchparams\nvar URLSearchParamsConstructor = function URLSearchParams(/* init */) {\n anInstance(this, URLSearchParamsConstructor, URL_SEARCH_PARAMS);\n var init = arguments.length > 0 ? arguments[0] : undefined;\n var that = this;\n var entries = [];\n var iteratorMethod, iterator, next, step, entryIterator, entryNext, first, second, key;\n\n setInternalState(that, {\n type: URL_SEARCH_PARAMS,\n entries: entries,\n updateURL: function () { /* empty */ },\n updateSearchParams: updateSearchParams\n });\n\n if (init !== undefined) {\n if (isObject(init)) {\n iteratorMethod = getIteratorMethod(init);\n if (typeof iteratorMethod === 'function') {\n iterator = iteratorMethod.call(init);\n next = iterator.next;\n while (!(step = next.call(iterator)).done) {\n entryIterator = getIterator(anObject(step.value));\n entryNext = entryIterator.next;\n if (\n (first = entryNext.call(entryIterator)).done ||\n (second = entryNext.call(entryIterator)).done ||\n !entryNext.call(entryIterator).done\n ) throw TypeError('Expected sequence with length 2');\n entries.push({ key: $toString(first.value), value: $toString(second.value) });\n }\n } else for (key in init) if (hasOwn(init, key)) entries.push({ key: key, value: $toString(init[key]) });\n } else {\n parseSearchParams(\n entries,\n typeof init === 'string' ? init.charAt(0) === '?' ? init.slice(1) : init : $toString(init)\n );\n }\n }\n};\n\nvar URLSearchParamsPrototype = URLSearchParamsConstructor.prototype;\n\nredefineAll(URLSearchParamsPrototype, {\n // `URLSearchParams.prototype.append` method\n // https://url.spec.whatwg.org/#dom-urlsearchparams-append\n append: function append(name, value) {\n validateArgumentsLength(arguments.length, 2);\n var state = getInternalParamsState(this);\n state.entries.push({ key: $toString(name), value: $toString(value) });\n state.updateURL();\n },\n // `URLSearchParams.prototype.delete` method\n // https://url.spec.whatwg.org/#dom-urlsearchparams-delete\n 'delete': function (name) {\n validateArgumentsLength(arguments.length, 1);\n var state = getInternalParamsState(this);\n var entries = state.entries;\n var key = $toString(name);\n var index = 0;\n while (index < entries.length) {\n if (entries[index].key === key) entries.splice(index, 1);\n else index++;\n }\n state.updateURL();\n },\n // `URLSearchParams.prototype.get` method\n // https://url.spec.whatwg.org/#dom-urlsearchparams-get\n get: function get(name) {\n validateArgumentsLength(arguments.length, 1);\n var entries = getInternalParamsState(this).entries;\n var key = $toString(name);\n var index = 0;\n for (; index < entries.length; index++) {\n if (entries[index].key === key) return entries[index].value;\n }\n return null;\n },\n // `URLSearchParams.prototype.getAll` method\n // https://url.spec.whatwg.org/#dom-urlsearchparams-getall\n getAll: function getAll(name) {\n validateArgumentsLength(arguments.length, 1);\n var entries = getInternalParamsState(this).entries;\n var key = $toString(name);\n var result = [];\n var index = 0;\n for (; index < entries.length; index++) {\n if (entries[index].key === key) result.push(entries[index].value);\n }\n return result;\n },\n // `URLSearchParams.prototype.has` method\n // https://url.spec.whatwg.org/#dom-urlsearchparams-has\n has: function has(name) {\n validateArgumentsLength(arguments.length, 1);\n var entries = getInternalParamsState(this).entries;\n var key = $toString(name);\n var index = 0;\n while (index < entries.length) {\n if (entries[index++].key === key) return true;\n }\n return false;\n },\n // `URLSearchParams.prototype.set` method\n // https://url.spec.whatwg.org/#dom-urlsearchparams-set\n set: function set(name, value) {\n validateArgumentsLength(arguments.length, 1);\n var state = getInternalParamsState(this);\n var entries = state.entries;\n var found = false;\n var key = $toString(name);\n var val = $toString(value);\n var index = 0;\n var entry;\n for (; index < entries.length; index++) {\n entry = entries[index];\n if (entry.key === key) {\n if (found) entries.splice(index--, 1);\n else {\n found = true;\n entry.value = val;\n }\n }\n }\n if (!found) entries.push({ key: key, value: val });\n state.updateURL();\n },\n // `URLSearchParams.prototype.sort` method\n // https://url.spec.whatwg.org/#dom-urlsearchparams-sort\n sort: function sort() {\n var state = getInternalParamsState(this);\n var entries = state.entries;\n // Array#sort is not stable in some engines\n var slice = entries.slice();\n var entry, entriesIndex, sliceIndex;\n entries.length = 0;\n for (sliceIndex = 0; sliceIndex < slice.length; sliceIndex++) {\n entry = slice[sliceIndex];\n for (entriesIndex = 0; entriesIndex < sliceIndex; entriesIndex++) {\n if (entries[entriesIndex].key > entry.key) {\n entries.splice(entriesIndex, 0, entry);\n break;\n }\n }\n if (entriesIndex === sliceIndex) entries.push(entry);\n }\n state.updateURL();\n },\n // `URLSearchParams.prototype.forEach` method\n forEach: function forEach(callback /* , thisArg */) {\n var entries = getInternalParamsState(this).entries;\n var boundFunction = bind(callback, arguments.length > 1 ? arguments[1] : undefined, 3);\n var index = 0;\n var entry;\n while (index < entries.length) {\n entry = entries[index++];\n boundFunction(entry.value, entry.key, this);\n }\n },\n // `URLSearchParams.prototype.keys` method\n keys: function keys() {\n return new URLSearchParamsIterator(this, 'keys');\n },\n // `URLSearchParams.prototype.values` method\n values: function values() {\n return new URLSearchParamsIterator(this, 'values');\n },\n // `URLSearchParams.prototype.entries` method\n entries: function entries() {\n return new URLSearchParamsIterator(this, 'entries');\n }\n}, { enumerable: true });\n\n// `URLSearchParams.prototype[@@iterator]` method\nredefine(URLSearchParamsPrototype, ITERATOR, URLSearchParamsPrototype.entries);\n\n// `URLSearchParams.prototype.toString` method\n// https://url.spec.whatwg.org/#urlsearchparams-stringification-behavior\nredefine(URLSearchParamsPrototype, 'toString', function toString() {\n var entries = getInternalParamsState(this).entries;\n var result = [];\n var index = 0;\n var entry;\n while (index < entries.length) {\n entry = entries[index++];\n result.push(serialize(entry.key) + '=' + serialize(entry.value));\n } return result.join('&');\n}, { enumerable: true });\n\nsetToStringTag(URLSearchParamsConstructor, URL_SEARCH_PARAMS);\n\n$({ global: true, forced: !USE_NATIVE_URL }, {\n URLSearchParams: URLSearchParamsConstructor\n});\n\n// Wrap `fetch` and `Request` for correct work with polyfilled `URLSearchParams`\nif (!USE_NATIVE_URL && typeof Headers == 'function') {\n var wrapRequestOptions = function (init) {\n if (isObject(init)) {\n var body = init.body;\n var headers;\n if (classof(body) === URL_SEARCH_PARAMS) {\n headers = init.headers ? new Headers(init.headers) : new Headers();\n if (!headers.has('content-type')) {\n headers.set('content-type', 'application/x-www-form-urlencoded;charset=UTF-8');\n }\n return create(init, {\n body: createPropertyDescriptor(0, String(body)),\n headers: createPropertyDescriptor(0, headers)\n });\n }\n } return init;\n };\n\n if (typeof nativeFetch == 'function') {\n $({ global: true, enumerable: true, forced: true }, {\n fetch: function fetch(input /* , init */) {\n return nativeFetch(input, arguments.length > 1 ? wrapRequestOptions(arguments[1]) : {});\n }\n });\n }\n\n if (typeof NativeRequest == 'function') {\n var RequestConstructor = function Request(input /* , init */) {\n anInstance(this, RequestConstructor, 'Request');\n return new NativeRequest(input, arguments.length > 1 ? wrapRequestOptions(arguments[1]) : {});\n };\n\n RequestPrototype.constructor = RequestConstructor;\n RequestConstructor.prototype = RequestPrototype;\n\n $({ global: true, forced: true }, {\n Request: RequestConstructor\n });\n }\n}\n\nmodule.exports = {\n URLSearchParams: URLSearchParamsConstructor,\n getState: getInternalParamsState\n};\n","'use strict';\n// TODO: in core-js@4, move /modules/ dependencies to public entries for better optimization by tools like `preset-env`\nrequire('../modules/es.string.iterator');\nvar $ = require('../internals/export');\nvar DESCRIPTORS = require('../internals/descriptors');\nvar USE_NATIVE_URL = require('../internals/native-url');\nvar global = require('../internals/global');\nvar defineProperties = require('../internals/object-define-properties');\nvar redefine = require('../internals/redefine');\nvar anInstance = require('../internals/an-instance');\nvar has = require('../internals/has');\nvar assign = require('../internals/object-assign');\nvar arrayFrom = require('../internals/array-from');\nvar codeAt = require('../internals/string-multibyte').codeAt;\nvar toASCII = require('../internals/string-punycode-to-ascii');\nvar $toString = require('../internals/to-string');\nvar setToStringTag = require('../internals/set-to-string-tag');\nvar URLSearchParamsModule = require('../modules/web.url-search-params');\nvar InternalStateModule = require('../internals/internal-state');\n\nvar NativeURL = global.URL;\nvar URLSearchParams = URLSearchParamsModule.URLSearchParams;\nvar getInternalSearchParamsState = URLSearchParamsModule.getState;\nvar setInternalState = InternalStateModule.set;\nvar getInternalURLState = InternalStateModule.getterFor('URL');\nvar floor = Math.floor;\nvar pow = Math.pow;\n\nvar INVALID_AUTHORITY = 'Invalid authority';\nvar INVALID_SCHEME = 'Invalid scheme';\nvar INVALID_HOST = 'Invalid host';\nvar INVALID_PORT = 'Invalid port';\n\nvar ALPHA = /[A-Za-z]/;\n// eslint-disable-next-line regexp/no-obscure-range -- safe\nvar ALPHANUMERIC = /[\\d+-.A-Za-z]/;\nvar DIGIT = /\\d/;\nvar HEX_START = /^0x/i;\nvar OCT = /^[0-7]+$/;\nvar DEC = /^\\d+$/;\nvar HEX = /^[\\dA-Fa-f]+$/;\n/* eslint-disable no-control-regex -- safe */\nvar FORBIDDEN_HOST_CODE_POINT = /[\\0\\t\\n\\r #%/:<>?@[\\\\\\]^|]/;\nvar FORBIDDEN_HOST_CODE_POINT_EXCLUDING_PERCENT = /[\\0\\t\\n\\r #/:<>?@[\\\\\\]^|]/;\nvar LEADING_AND_TRAILING_C0_CONTROL_OR_SPACE = /^[\\u0000-\\u0020]+|[\\u0000-\\u0020]+$/g;\nvar TAB_AND_NEW_LINE = /[\\t\\n\\r]/g;\n/* eslint-enable no-control-regex -- safe */\nvar EOF;\n\nvar parseHost = function (url, input) {\n var result, codePoints, index;\n if (input.charAt(0) == '[') {\n if (input.charAt(input.length - 1) != ']') return INVALID_HOST;\n result = parseIPv6(input.slice(1, -1));\n if (!result) return INVALID_HOST;\n url.host = result;\n // opaque host\n } else if (!isSpecial(url)) {\n if (FORBIDDEN_HOST_CODE_POINT_EXCLUDING_PERCENT.test(input)) return INVALID_HOST;\n result = '';\n codePoints = arrayFrom(input);\n for (index = 0; index < codePoints.length; index++) {\n result += percentEncode(codePoints[index], C0ControlPercentEncodeSet);\n }\n url.host = result;\n } else {\n input = toASCII(input);\n if (FORBIDDEN_HOST_CODE_POINT.test(input)) return INVALID_HOST;\n result = parseIPv4(input);\n if (result === null) return INVALID_HOST;\n url.host = result;\n }\n};\n\nvar parseIPv4 = function (input) {\n var parts = input.split('.');\n var partsLength, numbers, index, part, radix, number, ipv4;\n if (parts.length && parts[parts.length - 1] == '') {\n parts.pop();\n }\n partsLength = parts.length;\n if (partsLength > 4) return input;\n numbers = [];\n for (index = 0; index < partsLength; index++) {\n part = parts[index];\n if (part == '') return input;\n radix = 10;\n if (part.length > 1 && part.charAt(0) == '0') {\n radix = HEX_START.test(part) ? 16 : 8;\n part = part.slice(radix == 8 ? 1 : 2);\n }\n if (part === '') {\n number = 0;\n } else {\n if (!(radix == 10 ? DEC : radix == 8 ? OCT : HEX).test(part)) return input;\n number = parseInt(part, radix);\n }\n numbers.push(number);\n }\n for (index = 0; index < partsLength; index++) {\n number = numbers[index];\n if (index == partsLength - 1) {\n if (number >= pow(256, 5 - partsLength)) return null;\n } else if (number > 255) return null;\n }\n ipv4 = numbers.pop();\n for (index = 0; index < numbers.length; index++) {\n ipv4 += numbers[index] * pow(256, 3 - index);\n }\n return ipv4;\n};\n\n// eslint-disable-next-line max-statements -- TODO\nvar parseIPv6 = function (input) {\n var address = [0, 0, 0, 0, 0, 0, 0, 0];\n var pieceIndex = 0;\n var compress = null;\n var pointer = 0;\n var value, length, numbersSeen, ipv4Piece, number, swaps, swap;\n\n var char = function () {\n return input.charAt(pointer);\n };\n\n if (char() == ':') {\n if (input.charAt(1) != ':') return;\n pointer += 2;\n pieceIndex++;\n compress = pieceIndex;\n }\n while (char()) {\n if (pieceIndex == 8) return;\n if (char() == ':') {\n if (compress !== null) return;\n pointer++;\n pieceIndex++;\n compress = pieceIndex;\n continue;\n }\n value = length = 0;\n while (length < 4 && HEX.test(char())) {\n value = value * 16 + parseInt(char(), 16);\n pointer++;\n length++;\n }\n if (char() == '.') {\n if (length == 0) return;\n pointer -= length;\n if (pieceIndex > 6) return;\n numbersSeen = 0;\n while (char()) {\n ipv4Piece = null;\n if (numbersSeen > 0) {\n if (char() == '.' && numbersSeen < 4) pointer++;\n else return;\n }\n if (!DIGIT.test(char())) return;\n while (DIGIT.test(char())) {\n number = parseInt(char(), 10);\n if (ipv4Piece === null) ipv4Piece = number;\n else if (ipv4Piece == 0) return;\n else ipv4Piece = ipv4Piece * 10 + number;\n if (ipv4Piece > 255) return;\n pointer++;\n }\n address[pieceIndex] = address[pieceIndex] * 256 + ipv4Piece;\n numbersSeen++;\n if (numbersSeen == 2 || numbersSeen == 4) pieceIndex++;\n }\n if (numbersSeen != 4) return;\n break;\n } else if (char() == ':') {\n pointer++;\n if (!char()) return;\n } else if (char()) return;\n address[pieceIndex++] = value;\n }\n if (compress !== null) {\n swaps = pieceIndex - compress;\n pieceIndex = 7;\n while (pieceIndex != 0 && swaps > 0) {\n swap = address[pieceIndex];\n address[pieceIndex--] = address[compress + swaps - 1];\n address[compress + --swaps] = swap;\n }\n } else if (pieceIndex != 8) return;\n return address;\n};\n\nvar findLongestZeroSequence = function (ipv6) {\n var maxIndex = null;\n var maxLength = 1;\n var currStart = null;\n var currLength = 0;\n var index = 0;\n for (; index < 8; index++) {\n if (ipv6[index] !== 0) {\n if (currLength > maxLength) {\n maxIndex = currStart;\n maxLength = currLength;\n }\n currStart = null;\n currLength = 0;\n } else {\n if (currStart === null) currStart = index;\n ++currLength;\n }\n }\n if (currLength > maxLength) {\n maxIndex = currStart;\n maxLength = currLength;\n }\n return maxIndex;\n};\n\nvar serializeHost = function (host) {\n var result, index, compress, ignore0;\n // ipv4\n if (typeof host == 'number') {\n result = [];\n for (index = 0; index < 4; index++) {\n result.unshift(host % 256);\n host = floor(host / 256);\n } return result.join('.');\n // ipv6\n } else if (typeof host == 'object') {\n result = '';\n compress = findLongestZeroSequence(host);\n for (index = 0; index < 8; index++) {\n if (ignore0 && host[index] === 0) continue;\n if (ignore0) ignore0 = false;\n if (compress === index) {\n result += index ? ':' : '::';\n ignore0 = true;\n } else {\n result += host[index].toString(16);\n if (index < 7) result += ':';\n }\n }\n return '[' + result + ']';\n } return host;\n};\n\nvar C0ControlPercentEncodeSet = {};\nvar fragmentPercentEncodeSet = assign({}, C0ControlPercentEncodeSet, {\n ' ': 1, '\"': 1, '<': 1, '>': 1, '`': 1\n});\nvar pathPercentEncodeSet = assign({}, fragmentPercentEncodeSet, {\n '#': 1, '?': 1, '{': 1, '}': 1\n});\nvar userinfoPercentEncodeSet = assign({}, pathPercentEncodeSet, {\n '/': 1, ':': 1, ';': 1, '=': 1, '@': 1, '[': 1, '\\\\': 1, ']': 1, '^': 1, '|': 1\n});\n\nvar percentEncode = function (char, set) {\n var code = codeAt(char, 0);\n return code > 0x20 && code < 0x7F && !has(set, char) ? char : encodeURIComponent(char);\n};\n\nvar specialSchemes = {\n ftp: 21,\n file: null,\n http: 80,\n https: 443,\n ws: 80,\n wss: 443\n};\n\nvar isSpecial = function (url) {\n return has(specialSchemes, url.scheme);\n};\n\nvar includesCredentials = function (url) {\n return url.username != '' || url.password != '';\n};\n\nvar cannotHaveUsernamePasswordPort = function (url) {\n return !url.host || url.cannotBeABaseURL || url.scheme == 'file';\n};\n\nvar isWindowsDriveLetter = function (string, normalized) {\n var second;\n return string.length == 2 && ALPHA.test(string.charAt(0))\n && ((second = string.charAt(1)) == ':' || (!normalized && second == '|'));\n};\n\nvar startsWithWindowsDriveLetter = function (string) {\n var third;\n return string.length > 1 && isWindowsDriveLetter(string.slice(0, 2)) && (\n string.length == 2 ||\n ((third = string.charAt(2)) === '/' || third === '\\\\' || third === '?' || third === '#')\n );\n};\n\nvar shortenURLsPath = function (url) {\n var path = url.path;\n var pathSize = path.length;\n if (pathSize && (url.scheme != 'file' || pathSize != 1 || !isWindowsDriveLetter(path[0], true))) {\n path.pop();\n }\n};\n\nvar isSingleDot = function (segment) {\n return segment === '.' || segment.toLowerCase() === '%2e';\n};\n\nvar isDoubleDot = function (segment) {\n segment = segment.toLowerCase();\n return segment === '..' || segment === '%2e.' || segment === '.%2e' || segment === '%2e%2e';\n};\n\n// States:\nvar SCHEME_START = {};\nvar SCHEME = {};\nvar NO_SCHEME = {};\nvar SPECIAL_RELATIVE_OR_AUTHORITY = {};\nvar PATH_OR_AUTHORITY = {};\nvar RELATIVE = {};\nvar RELATIVE_SLASH = {};\nvar SPECIAL_AUTHORITY_SLASHES = {};\nvar SPECIAL_AUTHORITY_IGNORE_SLASHES = {};\nvar AUTHORITY = {};\nvar HOST = {};\nvar HOSTNAME = {};\nvar PORT = {};\nvar FILE = {};\nvar FILE_SLASH = {};\nvar FILE_HOST = {};\nvar PATH_START = {};\nvar PATH = {};\nvar CANNOT_BE_A_BASE_URL_PATH = {};\nvar QUERY = {};\nvar FRAGMENT = {};\n\n// eslint-disable-next-line max-statements -- TODO\nvar parseURL = function (url, input, stateOverride, base) {\n var state = stateOverride || SCHEME_START;\n var pointer = 0;\n var buffer = '';\n var seenAt = false;\n var seenBracket = false;\n var seenPasswordToken = false;\n var codePoints, char, bufferCodePoints, failure;\n\n if (!stateOverride) {\n url.scheme = '';\n url.username = '';\n url.password = '';\n url.host = null;\n url.port = null;\n url.path = [];\n url.query = null;\n url.fragment = null;\n url.cannotBeABaseURL = false;\n input = input.replace(LEADING_AND_TRAILING_C0_CONTROL_OR_SPACE, '');\n }\n\n input = input.replace(TAB_AND_NEW_LINE, '');\n\n codePoints = arrayFrom(input);\n\n while (pointer <= codePoints.length) {\n char = codePoints[pointer];\n switch (state) {\n case SCHEME_START:\n if (char && ALPHA.test(char)) {\n buffer += char.toLowerCase();\n state = SCHEME;\n } else if (!stateOverride) {\n state = NO_SCHEME;\n continue;\n } else return INVALID_SCHEME;\n break;\n\n case SCHEME:\n if (char && (ALPHANUMERIC.test(char) || char == '+' || char == '-' || char == '.')) {\n buffer += char.toLowerCase();\n } else if (char == ':') {\n if (stateOverride && (\n (isSpecial(url) != has(specialSchemes, buffer)) ||\n (buffer == 'file' && (includesCredentials(url) || url.port !== null)) ||\n (url.scheme == 'file' && !url.host)\n )) return;\n url.scheme = buffer;\n if (stateOverride) {\n if (isSpecial(url) && specialSchemes[url.scheme] == url.port) url.port = null;\n return;\n }\n buffer = '';\n if (url.scheme == 'file') {\n state = FILE;\n } else if (isSpecial(url) && base && base.scheme == url.scheme) {\n state = SPECIAL_RELATIVE_OR_AUTHORITY;\n } else if (isSpecial(url)) {\n state = SPECIAL_AUTHORITY_SLASHES;\n } else if (codePoints[pointer + 1] == '/') {\n state = PATH_OR_AUTHORITY;\n pointer++;\n } else {\n url.cannotBeABaseURL = true;\n url.path.push('');\n state = CANNOT_BE_A_BASE_URL_PATH;\n }\n } else if (!stateOverride) {\n buffer = '';\n state = NO_SCHEME;\n pointer = 0;\n continue;\n } else return INVALID_SCHEME;\n break;\n\n case NO_SCHEME:\n if (!base || (base.cannotBeABaseURL && char != '#')) return INVALID_SCHEME;\n if (base.cannotBeABaseURL && char == '#') {\n url.scheme = base.scheme;\n url.path = base.path.slice();\n url.query = base.query;\n url.fragment = '';\n url.cannotBeABaseURL = true;\n state = FRAGMENT;\n break;\n }\n state = base.scheme == 'file' ? FILE : RELATIVE;\n continue;\n\n case SPECIAL_RELATIVE_OR_AUTHORITY:\n if (char == '/' && codePoints[pointer + 1] == '/') {\n state = SPECIAL_AUTHORITY_IGNORE_SLASHES;\n pointer++;\n } else {\n state = RELATIVE;\n continue;\n } break;\n\n case PATH_OR_AUTHORITY:\n if (char == '/') {\n state = AUTHORITY;\n break;\n } else {\n state = PATH;\n continue;\n }\n\n case RELATIVE:\n url.scheme = base.scheme;\n if (char == EOF) {\n url.username = base.username;\n url.password = base.password;\n url.host = base.host;\n url.port = base.port;\n url.path = base.path.slice();\n url.query = base.query;\n } else if (char == '/' || (char == '\\\\' && isSpecial(url))) {\n state = RELATIVE_SLASH;\n } else if (char == '?') {\n url.username = base.username;\n url.password = base.password;\n url.host = base.host;\n url.port = base.port;\n url.path = base.path.slice();\n url.query = '';\n state = QUERY;\n } else if (char == '#') {\n url.username = base.username;\n url.password = base.password;\n url.host = base.host;\n url.port = base.port;\n url.path = base.path.slice();\n url.query = base.query;\n url.fragment = '';\n state = FRAGMENT;\n } else {\n url.username = base.username;\n url.password = base.password;\n url.host = base.host;\n url.port = base.port;\n url.path = base.path.slice();\n url.path.pop();\n state = PATH;\n continue;\n } break;\n\n case RELATIVE_SLASH:\n if (isSpecial(url) && (char == '/' || char == '\\\\')) {\n state = SPECIAL_AUTHORITY_IGNORE_SLASHES;\n } else if (char == '/') {\n state = AUTHORITY;\n } else {\n url.username = base.username;\n url.password = base.password;\n url.host = base.host;\n url.port = base.port;\n state = PATH;\n continue;\n } break;\n\n case SPECIAL_AUTHORITY_SLASHES:\n state = SPECIAL_AUTHORITY_IGNORE_SLASHES;\n if (char != '/' || buffer.charAt(pointer + 1) != '/') continue;\n pointer++;\n break;\n\n case SPECIAL_AUTHORITY_IGNORE_SLASHES:\n if (char != '/' && char != '\\\\') {\n state = AUTHORITY;\n continue;\n } break;\n\n case AUTHORITY:\n if (char == '@') {\n if (seenAt) buffer = '%40' + buffer;\n seenAt = true;\n bufferCodePoints = arrayFrom(buffer);\n for (var i = 0; i < bufferCodePoints.length; i++) {\n var codePoint = bufferCodePoints[i];\n if (codePoint == ':' && !seenPasswordToken) {\n seenPasswordToken = true;\n continue;\n }\n var encodedCodePoints = percentEncode(codePoint, userinfoPercentEncodeSet);\n if (seenPasswordToken) url.password += encodedCodePoints;\n else url.username += encodedCodePoints;\n }\n buffer = '';\n } else if (\n char == EOF || char == '/' || char == '?' || char == '#' ||\n (char == '\\\\' && isSpecial(url))\n ) {\n if (seenAt && buffer == '') return INVALID_AUTHORITY;\n pointer -= arrayFrom(buffer).length + 1;\n buffer = '';\n state = HOST;\n } else buffer += char;\n break;\n\n case HOST:\n case HOSTNAME:\n if (stateOverride && url.scheme == 'file') {\n state = FILE_HOST;\n continue;\n } else if (char == ':' && !seenBracket) {\n if (buffer == '') return INVALID_HOST;\n failure = parseHost(url, buffer);\n if (failure) return failure;\n buffer = '';\n state = PORT;\n if (stateOverride == HOSTNAME) return;\n } else if (\n char == EOF || char == '/' || char == '?' || char == '#' ||\n (char == '\\\\' && isSpecial(url))\n ) {\n if (isSpecial(url) && buffer == '') return INVALID_HOST;\n if (stateOverride && buffer == '' && (includesCredentials(url) || url.port !== null)) return;\n failure = parseHost(url, buffer);\n if (failure) return failure;\n buffer = '';\n state = PATH_START;\n if (stateOverride) return;\n continue;\n } else {\n if (char == '[') seenBracket = true;\n else if (char == ']') seenBracket = false;\n buffer += char;\n } break;\n\n case PORT:\n if (DIGIT.test(char)) {\n buffer += char;\n } else if (\n char == EOF || char == '/' || char == '?' || char == '#' ||\n (char == '\\\\' && isSpecial(url)) ||\n stateOverride\n ) {\n if (buffer != '') {\n var port = parseInt(buffer, 10);\n if (port > 0xFFFF) return INVALID_PORT;\n url.port = (isSpecial(url) && port === specialSchemes[url.scheme]) ? null : port;\n buffer = '';\n }\n if (stateOverride) return;\n state = PATH_START;\n continue;\n } else return INVALID_PORT;\n break;\n\n case FILE:\n url.scheme = 'file';\n if (char == '/' || char == '\\\\') state = FILE_SLASH;\n else if (base && base.scheme == 'file') {\n if (char == EOF) {\n url.host = base.host;\n url.path = base.path.slice();\n url.query = base.query;\n } else if (char == '?') {\n url.host = base.host;\n url.path = base.path.slice();\n url.query = '';\n state = QUERY;\n } else if (char == '#') {\n url.host = base.host;\n url.path = base.path.slice();\n url.query = base.query;\n url.fragment = '';\n state = FRAGMENT;\n } else {\n if (!startsWithWindowsDriveLetter(codePoints.slice(pointer).join(''))) {\n url.host = base.host;\n url.path = base.path.slice();\n shortenURLsPath(url);\n }\n state = PATH;\n continue;\n }\n } else {\n state = PATH;\n continue;\n } break;\n\n case FILE_SLASH:\n if (char == '/' || char == '\\\\') {\n state = FILE_HOST;\n break;\n }\n if (base && base.scheme == 'file' && !startsWithWindowsDriveLetter(codePoints.slice(pointer).join(''))) {\n if (isWindowsDriveLetter(base.path[0], true)) url.path.push(base.path[0]);\n else url.host = base.host;\n }\n state = PATH;\n continue;\n\n case FILE_HOST:\n if (char == EOF || char == '/' || char == '\\\\' || char == '?' || char == '#') {\n if (!stateOverride && isWindowsDriveLetter(buffer)) {\n state = PATH;\n } else if (buffer == '') {\n url.host = '';\n if (stateOverride) return;\n state = PATH_START;\n } else {\n failure = parseHost(url, buffer);\n if (failure) return failure;\n if (url.host == 'localhost') url.host = '';\n if (stateOverride) return;\n buffer = '';\n state = PATH_START;\n } continue;\n } else buffer += char;\n break;\n\n case PATH_START:\n if (isSpecial(url)) {\n state = PATH;\n if (char != '/' && char != '\\\\') continue;\n } else if (!stateOverride && char == '?') {\n url.query = '';\n state = QUERY;\n } else if (!stateOverride && char == '#') {\n url.fragment = '';\n state = FRAGMENT;\n } else if (char != EOF) {\n state = PATH;\n if (char != '/') continue;\n } break;\n\n case PATH:\n if (\n char == EOF || char == '/' ||\n (char == '\\\\' && isSpecial(url)) ||\n (!stateOverride && (char == '?' || char == '#'))\n ) {\n if (isDoubleDot(buffer)) {\n shortenURLsPath(url);\n if (char != '/' && !(char == '\\\\' && isSpecial(url))) {\n url.path.push('');\n }\n } else if (isSingleDot(buffer)) {\n if (char != '/' && !(char == '\\\\' && isSpecial(url))) {\n url.path.push('');\n }\n } else {\n if (url.scheme == 'file' && !url.path.length && isWindowsDriveLetter(buffer)) {\n if (url.host) url.host = '';\n buffer = buffer.charAt(0) + ':'; // normalize windows drive letter\n }\n url.path.push(buffer);\n }\n buffer = '';\n if (url.scheme == 'file' && (char == EOF || char == '?' || char == '#')) {\n while (url.path.length > 1 && url.path[0] === '') {\n url.path.shift();\n }\n }\n if (char == '?') {\n url.query = '';\n state = QUERY;\n } else if (char == '#') {\n url.fragment = '';\n state = FRAGMENT;\n }\n } else {\n buffer += percentEncode(char, pathPercentEncodeSet);\n } break;\n\n case CANNOT_BE_A_BASE_URL_PATH:\n if (char == '?') {\n url.query = '';\n state = QUERY;\n } else if (char == '#') {\n url.fragment = '';\n state = FRAGMENT;\n } else if (char != EOF) {\n url.path[0] += percentEncode(char, C0ControlPercentEncodeSet);\n } break;\n\n case QUERY:\n if (!stateOverride && char == '#') {\n url.fragment = '';\n state = FRAGMENT;\n } else if (char != EOF) {\n if (char == \"'\" && isSpecial(url)) url.query += '%27';\n else if (char == '#') url.query += '%23';\n else url.query += percentEncode(char, C0ControlPercentEncodeSet);\n } break;\n\n case FRAGMENT:\n if (char != EOF) url.fragment += percentEncode(char, fragmentPercentEncodeSet);\n break;\n }\n\n pointer++;\n }\n};\n\n// `URL` constructor\n// https://url.spec.whatwg.org/#url-class\nvar URLConstructor = function URL(url /* , base */) {\n var that = anInstance(this, URLConstructor, 'URL');\n var base = arguments.length > 1 ? arguments[1] : undefined;\n var urlString = $toString(url);\n var state = setInternalState(that, { type: 'URL' });\n var baseState, failure;\n if (base !== undefined) {\n if (base instanceof URLConstructor) baseState = getInternalURLState(base);\n else {\n failure = parseURL(baseState = {}, $toString(base));\n if (failure) throw TypeError(failure);\n }\n }\n failure = parseURL(state, urlString, null, baseState);\n if (failure) throw TypeError(failure);\n var searchParams = state.searchParams = new URLSearchParams();\n var searchParamsState = getInternalSearchParamsState(searchParams);\n searchParamsState.updateSearchParams(state.query);\n searchParamsState.updateURL = function () {\n state.query = String(searchParams) || null;\n };\n if (!DESCRIPTORS) {\n that.href = serializeURL.call(that);\n that.origin = getOrigin.call(that);\n that.protocol = getProtocol.call(that);\n that.username = getUsername.call(that);\n that.password = getPassword.call(that);\n that.host = getHost.call(that);\n that.hostname = getHostname.call(that);\n that.port = getPort.call(that);\n that.pathname = getPathname.call(that);\n that.search = getSearch.call(that);\n that.searchParams = getSearchParams.call(that);\n that.hash = getHash.call(that);\n }\n};\n\nvar URLPrototype = URLConstructor.prototype;\n\nvar serializeURL = function () {\n var url = getInternalURLState(this);\n var scheme = url.scheme;\n var username = url.username;\n var password = url.password;\n var host = url.host;\n var port = url.port;\n var path = url.path;\n var query = url.query;\n var fragment = url.fragment;\n var output = scheme + ':';\n if (host !== null) {\n output += '//';\n if (includesCredentials(url)) {\n output += username + (password ? ':' + password : '') + '@';\n }\n output += serializeHost(host);\n if (port !== null) output += ':' + port;\n } else if (scheme == 'file') output += '//';\n output += url.cannotBeABaseURL ? path[0] : path.length ? '/' + path.join('/') : '';\n if (query !== null) output += '?' + query;\n if (fragment !== null) output += '#' + fragment;\n return output;\n};\n\nvar getOrigin = function () {\n var url = getInternalURLState(this);\n var scheme = url.scheme;\n var port = url.port;\n if (scheme == 'blob') try {\n return new URLConstructor(scheme.path[0]).origin;\n } catch (error) {\n return 'null';\n }\n if (scheme == 'file' || !isSpecial(url)) return 'null';\n return scheme + '://' + serializeHost(url.host) + (port !== null ? ':' + port : '');\n};\n\nvar getProtocol = function () {\n return getInternalURLState(this).scheme + ':';\n};\n\nvar getUsername = function () {\n return getInternalURLState(this).username;\n};\n\nvar getPassword = function () {\n return getInternalURLState(this).password;\n};\n\nvar getHost = function () {\n var url = getInternalURLState(this);\n var host = url.host;\n var port = url.port;\n return host === null ? ''\n : port === null ? serializeHost(host)\n : serializeHost(host) + ':' + port;\n};\n\nvar getHostname = function () {\n var host = getInternalURLState(this).host;\n return host === null ? '' : serializeHost(host);\n};\n\nvar getPort = function () {\n var port = getInternalURLState(this).port;\n return port === null ? '' : String(port);\n};\n\nvar getPathname = function () {\n var url = getInternalURLState(this);\n var path = url.path;\n return url.cannotBeABaseURL ? path[0] : path.length ? '/' + path.join('/') : '';\n};\n\nvar getSearch = function () {\n var query = getInternalURLState(this).query;\n return query ? '?' + query : '';\n};\n\nvar getSearchParams = function () {\n return getInternalURLState(this).searchParams;\n};\n\nvar getHash = function () {\n var fragment = getInternalURLState(this).fragment;\n return fragment ? '#' + fragment : '';\n};\n\nvar accessorDescriptor = function (getter, setter) {\n return { get: getter, set: setter, configurable: true, enumerable: true };\n};\n\nif (DESCRIPTORS) {\n defineProperties(URLPrototype, {\n // `URL.prototype.href` accessors pair\n // https://url.spec.whatwg.org/#dom-url-href\n href: accessorDescriptor(serializeURL, function (href) {\n var url = getInternalURLState(this);\n var urlString = $toString(href);\n var failure = parseURL(url, urlString);\n if (failure) throw TypeError(failure);\n getInternalSearchParamsState(url.searchParams).updateSearchParams(url.query);\n }),\n // `URL.prototype.origin` getter\n // https://url.spec.whatwg.org/#dom-url-origin\n origin: accessorDescriptor(getOrigin),\n // `URL.prototype.protocol` accessors pair\n // https://url.spec.whatwg.org/#dom-url-protocol\n protocol: accessorDescriptor(getProtocol, function (protocol) {\n var url = getInternalURLState(this);\n parseURL(url, $toString(protocol) + ':', SCHEME_START);\n }),\n // `URL.prototype.username` accessors pair\n // https://url.spec.whatwg.org/#dom-url-username\n username: accessorDescriptor(getUsername, function (username) {\n var url = getInternalURLState(this);\n var codePoints = arrayFrom($toString(username));\n if (cannotHaveUsernamePasswordPort(url)) return;\n url.username = '';\n for (var i = 0; i < codePoints.length; i++) {\n url.username += percentEncode(codePoints[i], userinfoPercentEncodeSet);\n }\n }),\n // `URL.prototype.password` accessors pair\n // https://url.spec.whatwg.org/#dom-url-password\n password: accessorDescriptor(getPassword, function (password) {\n var url = getInternalURLState(this);\n var codePoints = arrayFrom($toString(password));\n if (cannotHaveUsernamePasswordPort(url)) return;\n url.password = '';\n for (var i = 0; i < codePoints.length; i++) {\n url.password += percentEncode(codePoints[i], userinfoPercentEncodeSet);\n }\n }),\n // `URL.prototype.host` accessors pair\n // https://url.spec.whatwg.org/#dom-url-host\n host: accessorDescriptor(getHost, function (host) {\n var url = getInternalURLState(this);\n if (url.cannotBeABaseURL) return;\n parseURL(url, $toString(host), HOST);\n }),\n // `URL.prototype.hostname` accessors pair\n // https://url.spec.whatwg.org/#dom-url-hostname\n hostname: accessorDescriptor(getHostname, function (hostname) {\n var url = getInternalURLState(this);\n if (url.cannotBeABaseURL) return;\n parseURL(url, $toString(hostname), HOSTNAME);\n }),\n // `URL.prototype.port` accessors pair\n // https://url.spec.whatwg.org/#dom-url-port\n port: accessorDescriptor(getPort, function (port) {\n var url = getInternalURLState(this);\n if (cannotHaveUsernamePasswordPort(url)) return;\n port = $toString(port);\n if (port == '') url.port = null;\n else parseURL(url, port, PORT);\n }),\n // `URL.prototype.pathname` accessors pair\n // https://url.spec.whatwg.org/#dom-url-pathname\n pathname: accessorDescriptor(getPathname, function (pathname) {\n var url = getInternalURLState(this);\n if (url.cannotBeABaseURL) return;\n url.path = [];\n parseURL(url, $toString(pathname), PATH_START);\n }),\n // `URL.prototype.search` accessors pair\n // https://url.spec.whatwg.org/#dom-url-search\n search: accessorDescriptor(getSearch, function (search) {\n var url = getInternalURLState(this);\n search = $toString(search);\n if (search == '') {\n url.query = null;\n } else {\n if ('?' == search.charAt(0)) search = search.slice(1);\n url.query = '';\n parseURL(url, search, QUERY);\n }\n getInternalSearchParamsState(url.searchParams).updateSearchParams(url.query);\n }),\n // `URL.prototype.searchParams` getter\n // https://url.spec.whatwg.org/#dom-url-searchparams\n searchParams: accessorDescriptor(getSearchParams),\n // `URL.prototype.hash` accessors pair\n // https://url.spec.whatwg.org/#dom-url-hash\n hash: accessorDescriptor(getHash, function (hash) {\n var url = getInternalURLState(this);\n hash = $toString(hash);\n if (hash == '') {\n url.fragment = null;\n return;\n }\n if ('#' == hash.charAt(0)) hash = hash.slice(1);\n url.fragment = '';\n parseURL(url, hash, FRAGMENT);\n })\n });\n}\n\n// `URL.prototype.toJSON` method\n// https://url.spec.whatwg.org/#dom-url-tojson\nredefine(URLPrototype, 'toJSON', function toJSON() {\n return serializeURL.call(this);\n}, { enumerable: true });\n\n// `URL.prototype.toString` method\n// https://url.spec.whatwg.org/#URL-stringification-behavior\nredefine(URLPrototype, 'toString', function toString() {\n return serializeURL.call(this);\n}, { enumerable: true });\n\nif (NativeURL) {\n var nativeCreateObjectURL = NativeURL.createObjectURL;\n var nativeRevokeObjectURL = NativeURL.revokeObjectURL;\n // `URL.createObjectURL` method\n // https://developer.mozilla.org/en-US/docs/Web/API/URL/createObjectURL\n // eslint-disable-next-line no-unused-vars -- required for `.length`\n if (nativeCreateObjectURL) redefine(URLConstructor, 'createObjectURL', function createObjectURL(blob) {\n return nativeCreateObjectURL.apply(NativeURL, arguments);\n });\n // `URL.revokeObjectURL` method\n // https://developer.mozilla.org/en-US/docs/Web/API/URL/revokeObjectURL\n // eslint-disable-next-line no-unused-vars -- required for `.length`\n if (nativeRevokeObjectURL) redefine(URLConstructor, 'revokeObjectURL', function revokeObjectURL(url) {\n return nativeRevokeObjectURL.apply(NativeURL, arguments);\n });\n}\n\nsetToStringTag(URLConstructor, 'URL');\n\n$({ global: true, forced: !USE_NATIVE_URL, sham: !DESCRIPTORS }, {\n URL: URLConstructor\n});\n","'use strict';\nvar $forEach = require('../internals/array-iteration').forEach;\nvar arrayMethodIsStrict = require('../internals/array-method-is-strict');\n\nvar STRICT_METHOD = arrayMethodIsStrict('forEach');\n\n// `Array.prototype.forEach` method implementation\n// https://tc39.es/ecma262/#sec-array.prototype.foreach\nmodule.exports = !STRICT_METHOD ? function forEach(callbackfn /* , thisArg */) {\n return $forEach(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined);\n// eslint-disable-next-line es/no-array-prototype-foreach -- safe\n} : [].forEach;\n","var global = require('../internals/global');\nvar DOMIterables = require('../internals/dom-iterables');\nvar forEach = require('../internals/array-for-each');\nvar createNonEnumerableProperty = require('../internals/create-non-enumerable-property');\n\nfor (var COLLECTION_NAME in DOMIterables) {\n var Collection = global[COLLECTION_NAME];\n var CollectionPrototype = Collection && Collection.prototype;\n // some Chrome versions have non-configurable methods on DOMTokenList\n if (CollectionPrototype && CollectionPrototype.forEach !== forEach) try {\n createNonEnumerableProperty(CollectionPrototype, 'forEach', forEach);\n } catch (error) {\n CollectionPrototype.forEach = forEach;\n }\n}\n","var DESCRIPTORS = require('../internals/descriptors');\nvar objectKeys = require('../internals/object-keys');\nvar toIndexedObject = require('../internals/to-indexed-object');\nvar propertyIsEnumerable = require('../internals/object-property-is-enumerable').f;\n\n// `Object.{ entries, values }` methods implementation\nvar createMethod = function (TO_ENTRIES) {\n return function (it) {\n var O = toIndexedObject(it);\n var keys = objectKeys(O);\n var length = keys.length;\n var i = 0;\n var result = [];\n var key;\n while (length > i) {\n key = keys[i++];\n if (!DESCRIPTORS || propertyIsEnumerable.call(O, key)) {\n result.push(TO_ENTRIES ? [key, O[key]] : O[key]);\n }\n }\n return result;\n };\n};\n\nmodule.exports = {\n // `Object.entries` method\n // https://tc39.es/ecma262/#sec-object.entries\n entries: createMethod(true),\n // `Object.values` method\n // https://tc39.es/ecma262/#sec-object.values\n values: createMethod(false)\n};\n","var $ = require('../internals/export');\nvar $entries = require('../internals/object-to-array').entries;\n\n// `Object.entries` method\n// https://tc39.es/ecma262/#sec-object.entries\n$({ target: 'Object', stat: true }, {\n entries: function entries(O) {\n return $entries(O);\n }\n});\n","var isRegExp = require('../internals/is-regexp');\n\nmodule.exports = function (it) {\n if (isRegExp(it)) {\n throw TypeError(\"The method doesn't accept regular expressions\");\n } return it;\n};\n","'use strict';\nvar $ = require('../internals/export');\nvar getOwnPropertyDescriptor = require('../internals/object-get-own-property-descriptor').f;\nvar toLength = require('../internals/to-length');\nvar toString = require('../internals/to-string');\nvar notARegExp = require('../internals/not-a-regexp');\nvar requireObjectCoercible = require('../internals/require-object-coercible');\nvar correctIsRegExpLogic = require('../internals/correct-is-regexp-logic');\nvar IS_PURE = require('../internals/is-pure');\n\n// eslint-disable-next-line es/no-string-prototype-startswith -- safe\nvar $startsWith = ''.startsWith;\nvar min = Math.min;\n\nvar CORRECT_IS_REGEXP_LOGIC = correctIsRegExpLogic('startsWith');\n// https://github.com/zloirock/core-js/pull/702\nvar MDN_POLYFILL_BUG = !IS_PURE && !CORRECT_IS_REGEXP_LOGIC && !!function () {\n var descriptor = getOwnPropertyDescriptor(String.prototype, 'startsWith');\n return descriptor && !descriptor.writable;\n}();\n\n// `String.prototype.startsWith` method\n// https://tc39.es/ecma262/#sec-string.prototype.startswith\n$({ target: 'String', proto: true, forced: !MDN_POLYFILL_BUG && !CORRECT_IS_REGEXP_LOGIC }, {\n startsWith: function startsWith(searchString /* , position = 0 */) {\n var that = toString(requireObjectCoercible(this));\n notARegExp(searchString);\n var index = toLength(min(arguments.length > 1 ? arguments[1] : undefined, that.length));\n var search = toString(searchString);\n return $startsWith\n ? $startsWith.call(that, search, index)\n : that.slice(index, index + search.length) === search;\n }\n});\n","var toObject = require('../internals/to-object');\n\nvar floor = Math.floor;\nvar replace = ''.replace;\nvar SUBSTITUTION_SYMBOLS = /\\$([$&'`]|\\d{1,2}|<[^>]*>)/g;\nvar SUBSTITUTION_SYMBOLS_NO_NAMED = /\\$([$&'`]|\\d{1,2})/g;\n\n// `GetSubstitution` abstract operation\n// https://tc39.es/ecma262/#sec-getsubstitution\nmodule.exports = function (matched, str, position, captures, namedCaptures, replacement) {\n var tailPos = position + matched.length;\n var m = captures.length;\n var symbols = SUBSTITUTION_SYMBOLS_NO_NAMED;\n if (namedCaptures !== undefined) {\n namedCaptures = toObject(namedCaptures);\n symbols = SUBSTITUTION_SYMBOLS;\n }\n return replace.call(replacement, symbols, function (match, ch) {\n var capture;\n switch (ch.charAt(0)) {\n case '$': return '$';\n case '&': return matched;\n case '`': return str.slice(0, position);\n case \"'\": return str.slice(tailPos);\n case '<':\n capture = namedCaptures[ch.slice(1, -1)];\n break;\n default: // \\d\\d?\n var n = +ch;\n if (n === 0) return match;\n if (n > m) {\n var f = floor(n / 10);\n if (f === 0) return match;\n if (f <= m) return captures[f - 1] === undefined ? ch.charAt(1) : captures[f - 1] + ch.charAt(1);\n return match;\n }\n capture = captures[n - 1];\n }\n return capture === undefined ? '' : capture;\n });\n};\n","'use strict';\nvar fixRegExpWellKnownSymbolLogic = require('../internals/fix-regexp-well-known-symbol-logic');\nvar fails = require('../internals/fails');\nvar anObject = require('../internals/an-object');\nvar toInteger = require('../internals/to-integer');\nvar toLength = require('../internals/to-length');\nvar toString = require('../internals/to-string');\nvar requireObjectCoercible = require('../internals/require-object-coercible');\nvar advanceStringIndex = require('../internals/advance-string-index');\nvar getSubstitution = require('../internals/get-substitution');\nvar regExpExec = require('../internals/regexp-exec-abstract');\nvar wellKnownSymbol = require('../internals/well-known-symbol');\n\nvar REPLACE = wellKnownSymbol('replace');\nvar max = Math.max;\nvar min = Math.min;\n\nvar maybeToString = function (it) {\n return it === undefined ? it : String(it);\n};\n\n// IE <= 11 replaces $0 with the whole match, as if it was $&\n// https://stackoverflow.com/questions/6024666/getting-ie-to-replace-a-regex-with-the-literal-string-0\nvar REPLACE_KEEPS_$0 = (function () {\n // eslint-disable-next-line regexp/prefer-escape-replacement-dollar-char -- required for testing\n return 'a'.replace(/./, '$0') === '$0';\n})();\n\n// Safari <= 13.0.3(?) substitutes nth capture where n>m with an empty string\nvar REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE = (function () {\n if (/./[REPLACE]) {\n return /./[REPLACE]('a', '$0') === '';\n }\n return false;\n})();\n\nvar REPLACE_SUPPORTS_NAMED_GROUPS = !fails(function () {\n var re = /./;\n re.exec = function () {\n var result = [];\n result.groups = { a: '7' };\n return result;\n };\n return ''.replace(re, '$') !== '7';\n});\n\n// @@replace logic\nfixRegExpWellKnownSymbolLogic('replace', function (_, nativeReplace, maybeCallNative) {\n var UNSAFE_SUBSTITUTE = REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE ? '$' : '$0';\n\n return [\n // `String.prototype.replace` method\n // https://tc39.es/ecma262/#sec-string.prototype.replace\n function replace(searchValue, replaceValue) {\n var O = requireObjectCoercible(this);\n var replacer = searchValue == undefined ? undefined : searchValue[REPLACE];\n return replacer !== undefined\n ? replacer.call(searchValue, O, replaceValue)\n : nativeReplace.call(toString(O), searchValue, replaceValue);\n },\n // `RegExp.prototype[@@replace]` method\n // https://tc39.es/ecma262/#sec-regexp.prototype-@@replace\n function (string, replaceValue) {\n var rx = anObject(this);\n var S = toString(string);\n\n if (\n typeof replaceValue === 'string' &&\n replaceValue.indexOf(UNSAFE_SUBSTITUTE) === -1 &&\n replaceValue.indexOf('$<') === -1\n ) {\n var res = maybeCallNative(nativeReplace, rx, S, replaceValue);\n if (res.done) return res.value;\n }\n\n var functionalReplace = typeof replaceValue === 'function';\n if (!functionalReplace) replaceValue = toString(replaceValue);\n\n var global = rx.global;\n if (global) {\n var fullUnicode = rx.unicode;\n rx.lastIndex = 0;\n }\n var results = [];\n while (true) {\n var result = regExpExec(rx, S);\n if (result === null) break;\n\n results.push(result);\n if (!global) break;\n\n var matchStr = toString(result[0]);\n if (matchStr === '') rx.lastIndex = advanceStringIndex(S, toLength(rx.lastIndex), fullUnicode);\n }\n\n var accumulatedResult = '';\n var nextSourcePosition = 0;\n for (var i = 0; i < results.length; i++) {\n result = results[i];\n\n var matched = toString(result[0]);\n var position = max(min(toInteger(result.index), S.length), 0);\n var captures = [];\n // NOTE: This is equivalent to\n // captures = result.slice(1).map(maybeToString)\n // but for some reason `nativeSlice.call(result, 1, result.length)` (called in\n // the slice polyfill when slicing native arrays) \"doesn't work\" in safari 9 and\n // causes a crash (https://pastebin.com/N21QzeQA) when trying to debug it.\n for (var j = 1; j < result.length; j++) captures.push(maybeToString(result[j]));\n var namedCaptures = result.groups;\n if (functionalReplace) {\n var replacerArgs = [matched].concat(captures, position, S);\n if (namedCaptures !== undefined) replacerArgs.push(namedCaptures);\n var replacement = toString(replaceValue.apply(undefined, replacerArgs));\n } else {\n replacement = getSubstitution(matched, S, position, captures, namedCaptures, replaceValue);\n }\n if (position >= nextSourcePosition) {\n accumulatedResult += S.slice(nextSourcePosition, position) + replacement;\n nextSourcePosition = position + matched.length;\n }\n }\n return accumulatedResult + S.slice(nextSourcePosition);\n }\n ];\n}, !REPLACE_SUPPORTS_NAMED_GROUPS || !REPLACE_KEEPS_$0 || REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE);\n","'use strict';\nvar $ = require('../internals/export');\nvar fails = require('../internals/fails');\nvar isArray = require('../internals/is-array');\nvar isObject = require('../internals/is-object');\nvar toObject = require('../internals/to-object');\nvar toLength = require('../internals/to-length');\nvar createProperty = require('../internals/create-property');\nvar arraySpeciesCreate = require('../internals/array-species-create');\nvar arrayMethodHasSpeciesSupport = require('../internals/array-method-has-species-support');\nvar wellKnownSymbol = require('../internals/well-known-symbol');\nvar V8_VERSION = require('../internals/engine-v8-version');\n\nvar IS_CONCAT_SPREADABLE = wellKnownSymbol('isConcatSpreadable');\nvar MAX_SAFE_INTEGER = 0x1FFFFFFFFFFFFF;\nvar MAXIMUM_ALLOWED_INDEX_EXCEEDED = 'Maximum allowed index exceeded';\n\n// We can't use this feature detection in V8 since it causes\n// deoptimization and serious performance degradation\n// https://github.com/zloirock/core-js/issues/679\nvar IS_CONCAT_SPREADABLE_SUPPORT = V8_VERSION >= 51 || !fails(function () {\n var array = [];\n array[IS_CONCAT_SPREADABLE] = false;\n return array.concat()[0] !== array;\n});\n\nvar SPECIES_SUPPORT = arrayMethodHasSpeciesSupport('concat');\n\nvar isConcatSpreadable = function (O) {\n if (!isObject(O)) return false;\n var spreadable = O[IS_CONCAT_SPREADABLE];\n return spreadable !== undefined ? !!spreadable : isArray(O);\n};\n\nvar FORCED = !IS_CONCAT_SPREADABLE_SUPPORT || !SPECIES_SUPPORT;\n\n// `Array.prototype.concat` method\n// https://tc39.es/ecma262/#sec-array.prototype.concat\n// with adding support of @@isConcatSpreadable and @@species\n$({ target: 'Array', proto: true, forced: FORCED }, {\n // eslint-disable-next-line no-unused-vars -- required for `.length`\n concat: function concat(arg) {\n var O = toObject(this);\n var A = arraySpeciesCreate(O, 0);\n var n = 0;\n var i, k, length, len, E;\n for (i = -1, length = arguments.length; i < length; i++) {\n E = i === -1 ? O : arguments[i];\n if (isConcatSpreadable(E)) {\n len = toLength(E.length);\n if (n + len > MAX_SAFE_INTEGER) throw TypeError(MAXIMUM_ALLOWED_INDEX_EXCEEDED);\n for (k = 0; k < len; k++, n++) if (k in E) createProperty(A, n, E[k]);\n } else {\n if (n >= MAX_SAFE_INTEGER) throw TypeError(MAXIMUM_ALLOWED_INDEX_EXCEEDED);\n createProperty(A, n++, E);\n }\n }\n A.length = n;\n return A;\n }\n});\n","import * as UZIP from 'uzip';\n// eslint-disable-next-line import/no-cycle\nimport lib from './index';\nimport compress from './image-compression';\nimport { getNewCanvasAndCtx } from './utils';\nimport UPNG from './UPNG';\nimport MaxCanvasSize from './config/max-canvas-size';\n\nlet cnt = 0;\nlet imageCompressionLibUrl;\nlet worker;\n\nfunction createWorker(script) {\n if (typeof script === 'function') {\n script = `(${script})()`;\n }\n return new Worker(URL.createObjectURL(new Blob([script])));\n}\n\nfunction createSourceObject(str) {\n // console.log('createSourceObject', str)\n return URL.createObjectURL(new Blob([str], { type: 'application/javascript' }));\n}\n\nfunction stringify(o) {\n return JSON.stringify(o, (key, value) => ((typeof value === 'function') ? `BIC_FN:::(function () { return ${value.toString()} })()` : value));\n}\n\nfunction parse(o) {\n if (typeof o === 'string') return o;\n const result = {};\n Object.entries(o).forEach(([key, value]) => {\n if (typeof value === 'string' && value.startsWith('BIC_FN:::')) {\n try {\n result[key] = eval(value.replace(/^BIC_FN:::/, ''));\n } catch (e) {\n // console.log(key, e);\n throw e;\n }\n } else {\n result[key] = parse(value);\n }\n });\n return result;\n}\n\nfunction generateLib() {\n // prepare the lib to be used inside WebWorker\n return createSourceObject(`\n // reconstruct library\n function imageCompression (){return (${lib}).apply(null, arguments)}\n\n imageCompression.getDataUrlFromFile = ${lib.getDataUrlFromFile}\n imageCompression.getFilefromDataUrl = ${lib.getFilefromDataUrl}\n imageCompression.loadImage = ${lib.loadImage}\n imageCompression.drawImageInCanvas = ${lib.drawImageInCanvas}\n imageCompression.drawFileInCanvas = ${lib.drawFileInCanvas}\n imageCompression.canvasToFile = ${lib.canvasToFile}\n imageCompression.getExifOrientation = ${lib.getExifOrientation}\n imageCompression.handleMaxWidthOrHeight = ${lib.handleMaxWidthOrHeight}\n imageCompression.followExifOrientation = ${lib.followExifOrientation}\n imageCompression.cleanupCanvasMemory = ${lib.cleanupCanvasMemory}\n imageCompression.isAutoOrientationInBrowser = ${lib.isAutoOrientationInBrowser}\n imageCompression.approximateBelowMaximumCanvasSizeOfBrowser = ${lib.approximateBelowMaximumCanvasSizeOfBrowser}\n imageCompression.getBrowserName = ${lib.getBrowserName}\n\n // functions / objects\n getDataUrlFromFile = imageCompression.getDataUrlFromFile\n getFilefromDataUrl = imageCompression.getFilefromDataUrl\n loadImage = imageCompression.loadImage\n drawImageInCanvas = imageCompression.drawImageInCanvas\n drawFileInCanvas = imageCompression.drawFileInCanvas\n canvasToFile = imageCompression.canvasToFile\n getExifOrientation = imageCompression.getExifOrientation\n handleMaxWidthOrHeight = imageCompression.handleMaxWidthOrHeight\n followExifOrientation = imageCompression.followExifOrientation\n cleanupCanvasMemory = imageCompression.cleanupCanvasMemory\n isAutoOrientationInBrowser = imageCompression.isAutoOrientationInBrowser\n approximateBelowMaximumCanvasSizeOfBrowser = imageCompression.approximateBelowMaximumCanvasSizeOfBrowser\n getBrowserName = imageCompression.getBrowserName\n \n getNewCanvasAndCtx = ${getNewCanvasAndCtx}\n CustomFileReader = FileReader\n CustomFile = File\n MaxCanvasSize = ${JSON.stringify(MaxCanvasSize)}\n function compress (){return (${compress}).apply(null, arguments)}\n\n // core-js\n function _slicedToArray(arr, n) { return arr }\n function _typeof(a) { return typeof a }\n function _objectSpread2(target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i] != null ? arguments[i] : {};\n \n Object.assign(target, source)\n }\n \n return target;\n }\n\n // Libraries\n const parse = ${parse}\n const UPNG = {}\n UPNG.toRGBA8 = ${UPNG.toRGBA8}\n UPNG.toRGBA8.decodeImage = ${UPNG.toRGBA8.decodeImage}\n UPNG.decode = ${UPNG.decode}\n UPNG.decode._decompress = ${UPNG.decode._decompress}\n UPNG.decode._inflate = ${UPNG.decode._inflate}\n UPNG.decode._readInterlace = ${UPNG.decode._readInterlace}\n UPNG.decode._getBPP = ${UPNG.decode._getBPP} \n UPNG.decode._filterZero = ${UPNG.decode._filterZero}\n UPNG.decode._paeth = ${UPNG.decode._paeth}\n UPNG.decode._IHDR = ${UPNG.decode._IHDR}\n UPNG._bin = parse(${stringify(UPNG._bin)})\n UPNG._copyTile = ${UPNG._copyTile}\n UPNG.encode = ${UPNG.encode}\n UPNG.encodeLL = ${UPNG.encodeLL} \n UPNG.encode._main = ${UPNG.encode._main}\n UPNG.encode.compressPNG = ${UPNG.encode.compressPNG} \n UPNG.encode.compress = ${UPNG.encode.compress}\n UPNG.encode.framize = ${UPNG.encode.framize} \n UPNG.encode._updateFrame = ${UPNG.encode._updateFrame} \n UPNG.encode._prepareDiff = ${UPNG.encode._prepareDiff} \n UPNG.encode._filterZero = ${UPNG.encode._filterZero} \n UPNG.encode._filterLine = ${UPNG.encode._filterLine}\n UPNG.encode.concatRGBA = ${UPNG.encode.concatRGBA}\n UPNG.crc = parse(${stringify(UPNG.crc)})\n UPNG.crc.table = ( function() {\n var tab = new Uint32Array(256);\n for (var n=0; n<256; n++) {\n var c = n;\n for (var k=0; k<8; k++) {\n if (c & 1) c = 0xedb88320 ^ (c >>> 1);\n else c = c >>> 1;\n }\n tab[n] = c; }\n return tab; })()\n UPNG.quantize = ${UPNG.quantize} \n UPNG.quantize.getKDtree = ${UPNG.quantize.getKDtree} \n UPNG.quantize.getNearest = ${UPNG.quantize.getNearest} \n UPNG.quantize.planeDst = ${UPNG.quantize.planeDst} \n UPNG.quantize.dist = ${UPNG.quantize.dist} \n UPNG.quantize.splitPixels = ${UPNG.quantize.splitPixels} \n UPNG.quantize.vecDot = ${UPNG.quantize.vecDot} \n UPNG.quantize.stats = ${UPNG.quantize.stats} \n UPNG.quantize.estats = ${UPNG.quantize.estats}\n UPNG.M4 = parse(${stringify(UPNG.M4)})\n UPNG.encode.concatRGBA = ${UPNG.encode.concatRGBA}\n UPNG.inflateRaw=function(){\n var H={};H.H={};H.H.N=function(N,W){var R=Uint8Array,i=0,m=0,J=0,h=0,Q=0,X=0,u=0,w=0,d=0,v,C;\n if(N[0]==3&&N[1]==0)return W?W:new R(0);var V=H.H,n=V.b,A=V.e,l=V.R,M=V.n,I=V.A,e=V.Z,b=V.m,Z=W==null;\n if(Z)W=new R(N.length>>>2<<5);while(i==0){i=n(N,d,1);m=n(N,d+1,2);d+=3;if(m==0){if((d&7)!=0)d+=8-(d&7);\n var D=(d>>>3)+4,q=N[D-4]|N[D-3]<<8;if(Z)W=H.H.W(W,w+q);W.set(new R(N.buffer,N.byteOffset+D,q),w);d=D+q<<3;\n w+=q;continue}if(Z)W=H.H.W(W,w+(1<<17));if(m==1){v=b.J;C=b.h;X=(1<<9)-1;u=(1<<5)-1}if(m==2){J=A(N,d,5)+257;\n h=A(N,d+5,5)+1;Q=A(N,d+10,4)+4;d+=14;var E=d,j=1;for(var c=0;c<38;c+=2){b.Q[c]=0;b.Q[c+1]=0}for(var c=0;\n cj)j=K}d+=3*Q;M(b.Q,j);I(b.Q,j,b.u);v=b.w;C=b.d;\n d=l(b.u,(1<>>4;if(p>>>8==0){W[w++]=p}else if(p==256){break}else{var z=w+p-254;\n if(p>264){var _=b.q[p-257];z=w+(_>>>3)+A(N,d,_&7);d+=_&7}var $=C[e(N,d)&u];d+=$&15;var s=$>>>4,Y=b.c[s],a=(Y>>>4)+n(N,d,Y&15);\n d+=Y&15;while(w>>4;\n if(b<=15){A[I]=b;I++}else{var Z=0,m=0;if(b==16){m=3+l(V,n,2);n+=2;Z=A[I-1]}else if(b==17){m=3+l(V,n,3);\n n+=3}else if(b==18){m=11+l(V,n,7);n+=7}var J=I+m;while(I>>1;\n while(An)n=M;A++}while(A>1,I=N[l+1],e=M<<4|I,b=W-I,Z=N[l]<>>15-W;R[J]=e;Z++}}};H.H.l=function(N,W){var R=H.H.m.r,V=15-W;for(var n=0;n>>V}};H.H.M=function(N,W,R){R=R<<(W&7);var V=W>>>3;N[V]|=R;N[V+1]|=R>>>8};\n H.H.I=function(N,W,R){R=R<<(W&7);var V=W>>>3;N[V]|=R;N[V+1]|=R>>>8;N[V+2]|=R>>>16};H.H.e=function(N,W,R){return(N[W>>>3]|N[(W>>>3)+1]<<8)>>>(W&7)&(1<>>3]|N[(W>>>3)+1]<<8|N[(W>>>3)+2]<<16)>>>(W&7)&(1<>>3]|N[(W>>>3)+1]<<8|N[(W>>>3)+2]<<16)>>>(W&7)};\n H.H.i=function(N,W){return(N[W>>>3]|N[(W>>>3)+1]<<8|N[(W>>>3)+2]<<16|N[(W>>>3)+3]<<24)>>>(W&7)};H.H.m=function(){var N=Uint16Array,W=Uint32Array;\n return{K:new N(16),j:new N(16),X:[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],S:[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,999,999,999],T:[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0],q:new N(32),p:[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,65535,65535],z:[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0],c:new W(32),J:new N(512),_:[],h:new N(32),$:[],w:new N(32768),C:[],v:[],d:new N(32768),D:[],u:new N(512),Q:[],r:new N(1<<15),s:new W(286),Y:new W(30),a:new W(19),t:new W(15e3),k:new N(1<<16),g:new N(1<<15)}}();\n (function(){var N=H.H.m,W=1<<15;for(var R=0;R>>1|(V&1431655765)<<1;\n V=(V&3435973836)>>>2|(V&858993459)<<2;V=(V&4042322160)>>>4|(V&252645135)<<4;V=(V&4278255360)>>>8|(V&16711935)<<8;\n N.r[R]=(V>>>16|V<<16)>>>17}function n(A,l,M){while(l--!=0)A.push(0,M)}for(var R=0;R<32;R++){N.q[R]=N.S[R]<<3|N.T[R];\n N.c[R]=N.p[R]<<4|N.z[R]}n(N._,144,8);n(N._,255-143,9);n(N._,279-255,7);n(N._,287-279,8);H.H.n(N._,9);\n H.H.A(N._,9,N.J);H.H.l(N._,9);n(N.$,32,5);H.H.n(N.$,5);H.H.A(N.$,5,N.h);H.H.l(N.$,5);n(N.Q,19,0);n(N.C,286,0);\n n(N.D,30,0);n(N.v,320,0)}());return H.H.N}()\n \n const UZIP = {}\n UZIP[\"parse\"] = ${UZIP.parse}\n UZIP._readLocal = ${UZIP._readLocal}\n UZIP.inflateRaw = ${UZIP.inflateRaw}\n UZIP.inflate = ${UZIP.inflate}\n UZIP.deflate = ${UZIP.deflate}\n UZIP.deflateRaw = ${UZIP.deflateRaw}\n UZIP.encode = ${UZIP.encode}\n UZIP._noNeed = ${UZIP._noNeed}\n UZIP._writeHeader = ${UZIP._writeHeader}\n UZIP.crc = parse(${stringify(UZIP.crc)})\n UZIP.crc.table = ( function() {\n var tab = new Uint32Array(256);\n for (var n=0; n<256; n++) {\n var c = n;\n for (var k=0; k<8; k++) {\n if (c & 1) c = 0xedb88320 ^ (c >>> 1);\n else c = c >>> 1;\n }\n tab[n] = c; }\n return tab; })()\n \n UZIP.adler = ${UZIP.adler}\n UZIP.bin = parse(${stringify(UZIP.bin)})\n UZIP.F = {}\n UZIP.F.deflateRaw = ${UZIP.F.deflateRaw}\n UZIP.F._bestMatch = ${UZIP.F._bestMatch}\n UZIP.F._howLong = ${UZIP.F._howLong}\n UZIP.F._hash = ${UZIP.F._hash}\n UZIP.saved = ${UZIP.saved}\n UZIP.F._writeBlock = ${UZIP.F._writeBlock}\n UZIP.F._copyExact = ${UZIP.F._copyExact}\n UZIP.F.getTrees = ${UZIP.F.getTrees}\n UZIP.F.getSecond = ${UZIP.F.getSecond}\n UZIP.F.nonZero = ${UZIP.F.nonZero}\n UZIP.F.contSize = ${UZIP.F.contSize}\n UZIP.F._codeTiny = ${UZIP.F._codeTiny} \n UZIP.F._lenCodes = ${UZIP.F._lenCodes} \n UZIP.F._hufTree = ${UZIP.F._hufTree} \n UZIP.F.setDepth = ${UZIP.F.setDepth} \n UZIP.F.restrictDepth = ${UZIP.F.restrictDepth}\n UZIP.F._goodIndex = ${UZIP.F._goodIndex} \n UZIP.F._writeLit = ${UZIP.F._writeLit} \n UZIP.F.inflate = ${UZIP.F.inflate} \n UZIP.F._check = ${UZIP.F._check} \n UZIP.F._decodeTiny = ${UZIP.F._decodeTiny} \n UZIP.F._copyOut = ${UZIP.F._copyOut} \n UZIP.F.makeCodes = ${UZIP.F.makeCodes} \n UZIP.F.codes2map = ${UZIP.F.codes2map} \n UZIP.F.revCodes = ${UZIP.F.revCodes} \n\n // used only in deflate\n UZIP.F._putsE = ${UZIP.F._putsE}\n UZIP.F._putsF = ${UZIP.F._putsF}\n \n UZIP.F._bitsE = ${UZIP.F._bitsE}\n UZIP.F._bitsF = ${UZIP.F._bitsF}\n\n UZIP.F._get17 = ${UZIP.F._get17}\n UZIP.F._get25 = ${UZIP.F._get25}\n UZIP.F.U = function(){\n var u16=Uint16Array, u32=Uint32Array;\n return {\n next_code : new u16(16),\n bl_count : new u16(16),\n ordr : [ 16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15 ],\n of0 : [3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,999,999,999],\n exb : [0,0,0,0,0,0,0, 0, 1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3, 4, 4, 4, 4, 5, 5, 5, 5, 0, 0, 0, 0],\n ldef : new u16(32),\n df0 : [1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577, 65535, 65535],\n dxb : [0,0,0,0,1,1,2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8, 9, 9, 10, 10, 11, 11, 12, 12, 13, 13, 0, 0],\n ddef : new u32(32),\n flmap: new u16( 512), fltree: [],\n fdmap: new u16( 32), fdtree: [],\n lmap : new u16(32768), ltree : [], ttree:[],\n dmap : new u16(32768), dtree : [],\n imap : new u16( 512), itree : [],\n //rev9 : new u16( 512)\n rev15: new u16(1<<15),\n lhst : new u32(286), dhst : new u32( 30), ihst : new u32(19),\n lits : new u32(15000),\n strt : new u16(1<<16),\n prev : new u16(1<<15)\n };\n } ();\n\n (function(){\n var U = UZIP.F.U;\n var len = 1<<15;\n for(var i=0; i>> 1) | ((x & 0x55555555) << 1));\n x = (((x & 0xcccccccc) >>> 2) | ((x & 0x33333333) << 2));\n x = (((x & 0xf0f0f0f0) >>> 4) | ((x & 0x0f0f0f0f) << 4));\n x = (((x & 0xff00ff00) >>> 8) | ((x & 0x00ff00ff) << 8));\n U.rev15[i] = (((x >>> 16) | (x << 16)))>>>17;\n }\n \n function pushV(tgt, n, sv) { while(n--!=0) tgt.push(0,sv); }\n \n for(var i=0; i<32; i++) { U.ldef[i]=(U.of0[i]<<3)|U.exb[i]; U.ddef[i]=(U.df0[i]<<4)|U.dxb[i]; }\n \n pushV(U.fltree, 144, 8); pushV(U.fltree, 255-143, 9); pushV(U.fltree, 279-255, 7); pushV(U.fltree,287-279,8);\n /*\n var i = 0;\n for(; i<=143; i++) U.fltree.push(0,8);\n for(; i<=255; i++) U.fltree.push(0,9);\n for(; i<=279; i++) U.fltree.push(0,7);\n for(; i<=287; i++) U.fltree.push(0,8);\n */\n UZIP.F.makeCodes(U.fltree, 9);\n UZIP.F.codes2map(U.fltree, 9, U.flmap);\n UZIP.F.revCodes (U.fltree, 9)\n \n pushV(U.fdtree,32,5);\n //for(i=0;i<32; i++) U.fdtree.push(0,5);\n UZIP.F.makeCodes(U.fdtree, 5);\n UZIP.F.codes2map(U.fdtree, 5, U.fdmap);\n UZIP.F.revCodes (U.fdtree, 5)\n \n pushV(U.itree,19,0); pushV(U.ltree,286,0); pushV(U.dtree,30,0); pushV(U.ttree,320,0);\n /*\n for(var i=0; i< 19; i++) U.itree.push(0,0);\n for(var i=0; i<286; i++) U.ltree.push(0,0);\n for(var i=0; i< 30; i++) U.dtree.push(0,0);\n for(var i=0; i<320; i++) U.ttree.push(0,0);\n */\n })()\n `);\n}\n\nfunction generateWorkerScript() {\n // code to be run in the WebWorker\n return createWorker(`\n let scriptImported = false\n self.addEventListener('message', async (e) => {\n const { file, id, imageCompressionLibUrl, options } = e.data\n options.onProgress = (progress) => self.postMessage({ progress, id })\n try {\n if (!scriptImported) {\n // console.log('[worker] importScripts', imageCompressionLibUrl)\n self.importScripts(imageCompressionLibUrl)\n scriptImported = true\n }\n // console.log('[worker] self', self)\n const compressedFile = await imageCompression(file, options)\n self.postMessage({ file: compressedFile, id })\n } catch (e) {\n // console.error('[worker] error', e)\n self.postMessage({ error: e.message + '\\\\n' + e.stack, id })\n }\n })\n `);\n}\n\nexport function compressOnWebWorker(file, options) {\n return new Promise(async (resolve, reject) => {\n const id = cnt++;\n\n if (!imageCompressionLibUrl) {\n imageCompressionLibUrl = generateLib();\n }\n\n if (!worker) {\n worker = generateWorkerScript();\n }\n\n function handler(e) {\n if (e.data.id === id) {\n if (e.data.progress !== undefined) {\n options.onProgress(e.data.progress);\n return;\n }\n worker.removeEventListener('message', handler);\n if (e.data.error) {\n reject(new Error(e.data.error));\n }\n resolve(e.data.file);\n }\n }\n\n worker.addEventListener('message', handler);\n worker.addEventListener('error', reject);\n\n worker.postMessage({\n file,\n id,\n imageCompressionLibUrl,\n options: { ...options, onProgress: undefined },\n });\n });\n}\n","import './polyfill';\n\nimport compress from './image-compression';\nimport {\n canvasToFile,\n drawFileInCanvas,\n drawImageInCanvas,\n getDataUrlFromFile,\n getFilefromDataUrl,\n loadImage,\n getExifOrientation,\n handleMaxWidthOrHeight,\n followExifOrientation,\n CustomFile,\n cleanupCanvasMemory,\n isAutoOrientationInBrowser,\n approximateBelowMaximumCanvasSizeOfBrowser,\n getBrowserName,\n} from './utils';\n// eslint-disable-next-line import/no-cycle\nimport { compressOnWebWorker } from './web-worker';\n\n/**\n * Compress an image file.\n *\n * @param {File} file\n * @param {Object} opts - { maxSizeMB=Number.POSITIVE_INFINITY, maxWidthOrHeight, useWebWorker=false, maxIteration = 10, exifOrientation, fileType }\n * @param {number} [options.maxSizeMB=Number.POSITIVE_INFINITY]\n * @param {number} [options.maxWidthOrHeight=undefined]\n * @param {boolean} [options.useWebWorker=false]\n * @param {number} [options.maxIteration=10]\n * @param {number} [options.exifOrientation] - default to be the exif orientation from the image file\n * @param {Function} [options.onProgress] - a function takes one progress argument (progress from 0 to 100)\n * @param {string} [options.fileType] - default to be the original mime type from the image file\n * @returns {Promise}\n */\nasync function imageCompression(file, options) {\n const opts = { ...options };\n\n let compressedFile;\n let progress = 0;\n const { onProgress } = opts;\n\n opts.maxSizeMB = opts.maxSizeMB || Number.POSITIVE_INFINITY;\n const useWebWorker = typeof opts.useWebWorker === 'boolean' ? opts.useWebWorker : true;\n delete opts.useWebWorker;\n opts.onProgress = (aProgress) => {\n progress = aProgress;\n if (typeof onProgress === 'function') {\n onProgress(progress);\n }\n };\n\n if (!(file instanceof Blob || file instanceof CustomFile)) {\n throw new Error('The file given is not an instance of Blob or File');\n } else if (!/^image/.test(file.type)) {\n throw new Error('The file given is not an image');\n }\n\n // try run in web worker, fall back to run in main thread\n // eslint-disable-next-line no-undef, no-restricted-globals\n const inWebWorker = typeof WorkerGlobalScope !== 'undefined' && self instanceof WorkerGlobalScope;\n\n // if ((useWebWorker && typeof Worker === 'function') || inWebWorker) {\n // console.log('run compression in web worker');\n // } else {\n // console.log('run compression in main thread');\n // }\n\n if (useWebWorker && typeof Worker === 'function' && !inWebWorker) {\n try {\n // \"compressOnWebWorker\" is kind of like a recursion to call \"imageCompression\" again inside web worker\n compressedFile = await compressOnWebWorker(file, opts);\n } catch (e) {\n // console.warn('Run compression in web worker failed:', e, ', fall back to main thread');\n compressedFile = await compress(file, opts);\n }\n } else {\n compressedFile = await compress(file, opts);\n }\n\n try {\n compressedFile.name = file.name;\n compressedFile.lastModified = file.lastModified;\n // eslint-disable-next-line no-empty\n } catch (e) {}\n\n return compressedFile;\n}\n\nimageCompression.getDataUrlFromFile = getDataUrlFromFile;\nimageCompression.getFilefromDataUrl = getFilefromDataUrl;\nimageCompression.loadImage = loadImage;\nimageCompression.drawImageInCanvas = drawImageInCanvas;\nimageCompression.drawFileInCanvas = drawFileInCanvas;\nimageCompression.canvasToFile = canvasToFile;\nimageCompression.getExifOrientation = getExifOrientation;\n\nimageCompression.handleMaxWidthOrHeight = handleMaxWidthOrHeight;\nimageCompression.followExifOrientation = followExifOrientation;\nimageCompression.cleanupCanvasMemory = cleanupCanvasMemory;\nimageCompression.isAutoOrientationInBrowser = isAutoOrientationInBrowser;\nimageCompression.approximateBelowMaximumCanvasSizeOfBrowser = approximateBelowMaximumCanvasSizeOfBrowser;\nimageCompression.getBrowserName = getBrowserName;\nimageCompression.version = '1.0.15';\n\nexport default imageCompression;\n"],"names":["check","it","global","SHARED","store","key","hasOwnProperty","id","postfix","Math","random","aFunction","variable","process","Deno","versions","v8","match","userAgent","exec","WellKnownSymbolsStore","Symbol","NATIVE_SYMBOL","TO_STRING_TAG","test","document","EXISTS","USE_SYMBOL_AS_UID","val","input","pref","result","undefined","$defineProperty","DESCRIPTORS","bitmap","value","functionToString","inspectSource","OBJECT_ALREADY_INITIALIZED","WeakMap","set","has","TYPE","state","NATIVE_WEAK_MAP","get","wmhas","call","wmset","metadata","objectHas","getInternalState","enforceInternalState","String","split","unsafe","options","toString","$propertyIsEnumerable","getOwnPropertyDescriptor","$getOwnPropertyDescriptor","P","ceil","floor","min","max","fromIndex","O","toIndexedObject","length","index","el","indexOf","require$$0","object","i","push","keys","defineProperty","replacement","isForced","normalize","f","targetProperty","target","noTargetGet","anObject","wellKnownSymbol","getBuiltIn","definePropertyModule","Constructor","name","ITERATOR","prototype","fn","iterator","Result","stopped","IS_ITERATOR","AS_ENTRIES","iterFn","next","error","SAFE_CLOSING","SKIP_CLOSING","clear","MessageChannel","Dispatch","counter","queue","ONREADYSTATECHANGE","location","runner","run","listener","data","argumentsLength","defer","addEventListener","importScripts","macrotask","require$$1","MutationObserver","Promise","queueMicrotaskDescriptor","queueMicrotask","head","resolve","then","promise","PromiseCapability","$$resolve","$$reject","C","console","arguments","window","task","SPECIES","PROMISE","InternalStateModule","setInternalState","getInternalPromiseState","NativePromisePrototype","PromiseConstructor","PromiseConstructorPrototype","TypeError","newPromiseCapability","newGenericPromiseCapability","DISPATCH_EVENT","NATIVE_REJECTION_EVENT","UNHANDLED_REJECTION","REJECTION_HANDLED","PENDING","FULFILLED","REJECTED","HANDLED","UNHANDLED","SUBCLASSING","Internal","FORCED","isThenable","isReject","notified","exited","reject","handler","event","reason","IS_NODE","isUnhandled","unwrap","internalReject","facade","wrapper","bind","anInstance","this","internalResolve","onFulfilled","onRejected","reaction","OwnPromiseCapability","that","capability","stat","all","alreadyCalled","dummy","GT","LT","PROTOTYPE","SCRIPT","IE_PROTO","scriptTag","content","activeXDocument","parentWindow","html","appendChild","iframe","src","open","iframeDocument","write","close","whitespace","ltrim","RegExp","rtrim","$this","string","replace","getOwnPropertyNames","require$$2","trim","require$$3","NUMBER","NativeNumber","NumberPrototype","argument","radix","digits","toNumber","NumberWrapper","FunctionPrototype","FunctionPrototypeToString","nameRE","NAME","Object","enumerable","b","B","forEach","propertyIsEnumerableModule","S","IndexedObject","j","T","$assign","nativeExec","nativeReplace","patchedExec","UPDATES_LAST_INDEX_WRONG","stickyHelpers","UNSUPPORTED_Y","NPCG_INCLUDED","UNSUPPORTED_DOT_ALL","re","str","raw","lastIndex","groups","regexpFlags","strCopy","slice","charsAdded","RegExpPrototype","SYMBOL","KEY","nativeMethod","requireObjectCoercible","position","toInteger","size","charAt","arrayPush","MAX_UINT32","limit","separator","separatorCopy","maybeCallNative","internalSplit","rx","UNSCOPABLES","ArrayPrototype","fails","CORRECT_PROTOTYPE_GETTER","BUGGY_SAFARI_ITERATORS","IteratorPrototype","PrototypeOfArrayIteratorPrototype","NEW_ITERATOR_PROTOTYPE","returnThis","IteratorConstructor","create","KEYS","VALUES","ENTRIES","KIND","DEFAULT","IterablePrototype","CurrentIteratorPrototype","methods","getIterationMethod","ARRAY_ITERATOR","Arguments","Int8Array","Int8ArrayPrototype","Uint8ClampedArray","Uint8ClampedArrayPrototype","TypedArray","TypedArrayPrototype","ObjectPrototype","isPrototypeOf","TYPED_ARRAY_TAG","TYPED_ARRAY_CONSTRUCTOR","uid","NATIVE_ARRAY_BUFFER_VIEWS","TYPED_ARRAY_TAG_REQIRED","TypedArrayConstructorsList","BigIntArrayConstructorsList","isView","klass","aTypedArray","aTypedArrayConstructor","TypedArrayConstructor","redefine","forced","number","abs","pow","log","LN2","pack","bytes","mantissaLength","exponentLength","exponent","eBias","c","rt","mantissa","unpack","buffer","sign","nBits","eMax","fill","ARRAY_BUFFER","DATA_VIEW","WRONG_LENGTH","WRONG_INDEX","NativeArrayBuffer","$ArrayBuffer","$DataView","$DataViewPrototype","RangeError","packIEEE754","unpackIEEE754","IEEE754","packInt8","packInt16","unpackInt32","packFloat32","addGetter","count","start","reverse","view","byteLength","ArrayBufferPrototype","constructor","byteOffset","setUint8","DataView","bufferLength","offset","setFloat64","toPositiveInteger","step","isArrayIteratorMethod","iteratorMethod","mapfn","toLength","originalArray","createMethod","toObject","self","boundFunction","nativeDefineProperty","nativeGetOwnPropertyDescriptor","round","ArrayBuffer","isTypedArray","fromList","isArrayBuffer","isSymbol","toPropertyKey","descriptor","CLAMPED","BYTES","CONSTRUCTOR_NAME","TypedArrayConstructorPrototype","createNonEnumerableProperty","toAbsoluteIndex","end","to","from","$every","every","list","$filter","filter","exportTypedArrayMethod","$find","find","$findIndex","findIndex","$forEach","$includes","includes","$indexOf","Uint8Array","arrayValues","arrayKeys","arrayEntries","nativeTypedArrayIterator","CORRECT_ITER_NAME","typedArrayValues","$lastIndexOf","NEGATIVE_ZERO","$map","map","callbackfn","IS_RIGHT","$reduce","left","$reduceRight","right","arrayLike","$slice","$some","some","mergeSort","comparefn","array","Uint16Array","nativeSort","ACCEPT_INCORRECT_ARGUMENTS","mod","Array","a","items","$toLocaleString","TO_LOCALE_STRING_BUG","Uint8ArrayPrototype","arrayToString","arrayJoin","HAS_SPECIES_SUPPORT","k","fin","nativeSlice","proto","TO_STRING","nativeToString","NOT_GENERIC","INCORRECT_NAME","R","p","$toString","rf","FAILS_ON_UNDEFINED","FAILS_ON_NULL","chr","code","itemsLength","arrayLength","getSortCompare","UZIP","eocd","rUi","cnu","csize","o","out","readUshort","cmpr","nlen","elen","file","inflate","inflateRaw","opts","buf","F","deflateRaw","crc","off","encode","noCmpr","wUi","obj","cpr","tot","ioff","t","usize","tab","table","eend","buff","l","s","strl","charCodeAt","ci","lvl","U","len","dlen","strt","prev","lc","_hash","cvrd","lgi","lits","li","dst","dgi","pos","pi","dif","dlim","_howLong","td","ei","curd","MD","putsF","_putsF","BTYPE","_copyExact","o0","ltree","fltree","putsE","itree","qc","si","_writeLit","p8","_hufTree","ihst","dset","numh","ML","MH","numl","tree","nxt","nnxt","lz","MAXL","hst","tl","hl","l2","lit","i2","i0","d","restrictDepth","maxl","dps","dbt","_goodIndex","ch","u8","_bitsF","bitsE","noBuf","HLIT","_check","ordr","dmap","mx0","dtree","dlit","dcode","dbs","nbuf","lmap","_bitsE","n","mx","max_code","bl_count","MAX_BITS","next_code","rest","i1","r15","_putsE","dt","u16","x","tgt","sv","fdmap","pushV","w","height","h","img","frames","fh","frm","dispose","bpp","area","bf32","ctype","depth","tabs","tRNS","ts","ti","ap","y","bf","qi","cj","t0","di","gr","al","tr","bin","readASCII","doff","num_frames","num_plays","del","fd","readUint","type","text","keyw","readUTF8","pl","PLTE","foff","bpl","interlace","CgBI","UPNG","decode","_inflate","dd","_filterZero","_readInterlace","H","N","m","Z","W","A","u","r","D","v","X","Y","e","I","V","M","starting_row","row_increment","pass","cr","cc","row","starting_col","bpll","col","cbpp","sh","_paeth","pa","pc","arr","fb","ifa","tb","fr","fg","mode","fa","sb","ba","bufs","nimg","_main","ac","_bin","wUs","wAs","dl","anim","leng","sRGB","pHYs","loop","cimg","imgd","nh","onlyBlend","inds","nbufs","cof","bln","ind","ilen","img32","inj","gotAlpha","frms","Uint32Array","nx","tlim","forbidPrev","alwaysBlend","pimg","mix","evenCrd","sarea","miY","r0","miX","_updateFrame","rect","width","U8","pimg32","cx","miy","blend","rec","ftry","paeth","oimg","nimg32","KD","quantize","getKDtree","root","nd","err","maxL","splitPixels","node","planeDst","ln","rn","getNearest","q","d0","d1","d2","g","stats","m0","Rj","m1","iN","m3","Cov","M4","noff","isBrowser","cordova","CustomFileReader","reader","readAsDataURL","getBrowserName","navigator","browserName","maximumCanvasSize","ctx","drawImageInCanvas","loadImage","fileName","lastModified","drawFileInCanvas","testImageFile2","testImageCanvas","marker","getUint16","isFinite","maxWidthOrHeight","newCanvas","STRING_ITERATOR","getterFor","Collection","COLLECTION_NAME","searchParams","iteratorClose","maxInt","base","tMin","tMax","skew","damp","initialBias","initialN","delimiter","regexNonASCII","regexSeparators","OVERFLOW_ERROR","baseMinusTMin","stringFromCharCode","extra","digitToBasic","adapt","delta","numPoints","output","nativeFetch","NativeRequest","RequestPrototype","Headers","URL_SEARCH_PARAMS","URL_SEARCH_PARAMS_ITERATOR","getInternalParamsState","getInternalIteratorState","plus","percentSequence","sequences","percentDecode","deserialize","validateArgumentsLength","kind","entries","updateSearchParams","init","URLSearchParamsPrototype","found","splice","entry","sliceIndex","entriesIndex","serialize","codeAt","NativeURL","URLSearchParams","getInternalSearchParamsState","getInternalURLState","INVALID_AUTHORITY","INVALID_SCHEME","INVALID_HOST","INVALID_PORT","ALPHA","ALPHANUMERIC","DIGIT","HEX_START","OCT","DEC","HEX","FORBIDDEN_HOST_CODE_POINT","FORBIDDEN_HOST_CODE_POINT_EXCLUDING_PERCENT","toASCII","url","host","parseIPv4","numbers","parts","pop","part","parseInt","parseIPv6","numbersSeen","pointer","pieceIndex","address","findLongestZeroSequence","ipv6","maxIndex","currLength","compress","percentEncode","specialSchemes","isSpecial","includesCredentials","username","cannotHaveUsernamePasswordPort","cannotBeABaseURL","isWindowsDriveLetter","path","isSingleDot","segment","isDoubleDot","SCHEME_START","SCHEME","NO_SCHEME","SPECIAL_RELATIVE_OR_AUTHORITY","RELATIVE","SPECIAL_AUTHORITY_SLASHES","SPECIAL_AUTHORITY_IGNORE_SLASHES","HOST","HOSTNAME","PORT","FILE_SLASH","FILE_HOST","PATH_START","PATH","CANNOT_BE_A_BASE_URL_PATH","QUERY","FRAGMENT","parseURL","scheme","password","port","query","fragment","LEADING_AND_TRAILING_C0_CONTROL_OR_SPACE","codePoints","FILE","EOF","char","codePoint","bufferCodePoints","parseHost","baseState","failure","origin","protocol","getHostname","getPort","hash","URLPrototype","serializeURL","getOrigin","getProtocol","getHost","getPathname","getSearch","href","accessorDescriptor","pathname","search","toJSON","DOMIterables","propertyIsEnumerable","$entries","$startsWith","CORRECT_IS_REGEXP_LOGIC","searchString","SUBSTITUTION_SYMBOLS","matched","tailPos","captures","REPLACE","REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE","REPLACE_SUPPORTS_NAMED_GROUPS","searchValue","res","unicode","IS_CONCAT_SPREADABLE","MAX_SAFE_INTEGER","MAXIMUM_ALLOWED_INDEX_EXCEEDED","IS_CONCAT_SPREADABLE_SUPPORT","concat","createProperty","cnt","worker","Worker","createSourceObject","inWebWorker","imageCompression","getDataUrlFromFile","getFilefromDataUrl","canvasToFile","getExifOrientation"],"mappings":"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"} \ No newline at end of file diff --git a/dist/browser-image-compression.mjs b/dist/browser-image-compression.mjs index 68d1aa0..8c10992 100644 --- a/dist/browser-image-compression.mjs +++ b/dist/browser-image-compression.mjs @@ -1,9 +1,9 @@ /** * Browser Image Compression - * v1.0.14 + * v1.0.15 * by Donald * https://github.com/Donaldcwl/browser-image-compression */ -function _defineProperty(e,r,t){return r in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e}function ownKeys(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);r&&(a=a.filter((function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable}))),t.push.apply(t,a)}return t}function _objectSpread2(e){for(var r=1;re.length)&&(r=e.length);for(var t=0,a=new Array(r);t>>24&255,a[t+1]=i>>>16&255,a[t+2]=i>>>8&255,a[t+3]=i>>>0&255,new Uint8Array(a.buffer,0,t+4)},UZIP.deflateRaw=function(e,r){null==r&&(r={level:6});var t=new Uint8Array(50+Math.floor(1.1*e.length)),a=UZIP.F.deflateRaw(e,t,a,r.level);return new Uint8Array(t.buffer,0,a)},UZIP.encode=function(e,r){null==r&&(r=!1);var t=0,a=UZIP.bin.writeUint,i=UZIP.bin.writeUshort,f={};for(var c in e){var s=!UZIP._noNeed(c)&&!r,l=e[c],u=UZIP.crc.crc(l,0,l.length);f[c]={cpr:s,usize:l.length,crc:u,file:s?UZIP.deflateRaw(l):l}}for(var c in f)t+=f[c].file.length+30+46+2*UZIP.bin.sizeUTF8(c);t+=22;var d=new Uint8Array(t),h=0,A=[];for(var c in f){var v=f[c];A.push(h),h=UZIP._writeHeader(d,h,c,v,0)}var p=0,U=h;for(var c in f){v=f[c];A.push(h),h=UZIP._writeHeader(d,h,c,v,1,A[p++])}var g=h-U;return a(d,h,101010256),h+=4,i(d,h+=4,p),i(d,h+=2,p),a(d,h+=2,g),a(d,h+=4,U),h+=4,h+=2,d.buffer},UZIP._noNeed=function(e){var r=e.split(".").pop().toLowerCase();return-1!="png,jpg,jpeg,zip".indexOf(r)},UZIP._writeHeader=function(e,r,t,a,i,f){var c=UZIP.bin.writeUint,s=UZIP.bin.writeUshort,l=a.file;return c(e,r,0==i?67324752:33639248),r+=4,1==i&&(r+=2),s(e,r,20),s(e,r+=2,0),s(e,r+=2,a.cpr?8:0),c(e,r+=2,0),c(e,r+=4,a.crc),c(e,r+=4,l.length),c(e,r+=4,a.usize),s(e,r+=4,UZIP.bin.sizeUTF8(t)),s(e,r+=2,0),r+=2,1==i&&(r+=2,r+=2,c(e,r+=6,f),r+=4),r+=UZIP.bin.writeUTF8(e,r,t),0==i&&(e.set(l,r),r+=l.length),r},UZIP.crc={table:function(){for(var e=new Uint32Array(256),r=0;r<256;r++){for(var t=r,a=0;a<8;a++)1&t?t=3988292384^t>>>1:t>>>=1;e[r]=t}return e}(),update:function(e,r,t,a){for(var i=0;i>>8;return e},crc:function(e,r,t){return 4294967295^UZIP.crc.update(4294967295,e,r,t)}},UZIP.adler=function(e,r,t){for(var a=1,i=0,f=r,c=r+t;f>8&255},readUint:function(e,r){return 16777216*e[r+3]+(e[r+2]<<16|e[r+1]<<8|e[r])},writeUint:function(e,r,t){e[r]=255&t,e[r+1]=t>>8&255,e[r+2]=t>>16&255,e[r+3]=t>>24&255},readASCII:function(e,r,t){for(var a="",i=0;i>6,e[r+i+1]=128|c>>0&63,i+=2;else if(0==(4294901760&c))e[r+i]=224|c>>12,e[r+i+1]=128|c>>6&63,e[r+i+2]=128|c>>0&63,i+=3;else{if(0!=(4292870144&c))throw"e";e[r+i]=240|c>>18,e[r+i+1]=128|c>>12&63,e[r+i+2]=128|c>>6&63,e[r+i+3]=128|c>>0&63,i+=4}}return i},sizeUTF8:function(e){for(var r=e.length,t=0,a=0;a>>3}var A=f.lits,v=f.strt,p=f.prev,U=0,g=0,m=0,w=0,P=0,b=0;for(h>2&&(v[b=UZIP.F._hash(e,0)]=0),l=0;l14e3||g>26697)&&h-l>100&&(d>>16,F=65535&y;if(0!=y){F=65535&y;var G=c(I=y>>>16,f.of0);f.lhst[257+G]++;var C=c(F,f.df0);f.dhst[C]++,w+=f.exb[G]+f.dxb[C],A[U]=I<<23|l-d,A[U+1]=F<<16|G<<8|C,U+=2,d=l+I}else f.lhst[e[l]]++;g++}}for(m==l&&0!=e.length||(d>>3},UZIP.F._bestMatch=function(e,r,t,a,i,f){var c=32767&r,s=t[c],l=c-s+32768&32767;if(s==c||a!=UZIP.F._hash(e,r-l))return 0;for(var u=0,d=0,h=Math.min(32767,r);l<=h&&0!=--f&&s!=c;){if(0==u||e[r+u]==e[r+u-l]){var A=UZIP.F._howLong(e,r,l);if(A>u){if(d=l,(u=A)>=i)break;l+2v&&(v=g,s=U)}}}l+=(c=s)-(s=t[c])+32768&32767}return u<<16|d},UZIP.F._howLong=function(e,r,t){if(e[r]!=e[r-t]||e[r+1]!=e[r+1-t]||e[r+2]!=e[r+2-t])return 0;var a=r,i=Math.min(e.length,r+258);for(r+=3;r>>23,Q=Z+(8388607&M);Z>16,O=T>>8&255,V=255&T;b(s,l=UZIP.F._writeLit(257+O,C,s,l),R-w.of0[O]),l+=w.exb[O],P(s,l=UZIP.F._writeLit(V,E,s,l),D-w.df0[V]),l+=w.dxb[V],Z+=R}}l=UZIP.F._writeLit(256,C,s,l)}return l},UZIP.F._copyExact=function(e,r,t,a,i){var f=i>>>3;return a[f]=t,a[f+1]=t>>>8,a[f+2]=255-a[f],a[f+3]=255-a[f+1],f+=4,a.set(new Uint8Array(e.buffer,r,t),f),i+(t+4<<3)},UZIP.F.getTrees=function(){for(var e=UZIP.F.U,r=UZIP.F._hufTree(e.lhst,e.ltree,15),t=UZIP.F._hufTree(e.dhst,e.dtree,15),a=[],i=UZIP.F._lenCodes(e.ltree,a),f=[],c=UZIP.F._lenCodes(e.dtree,f),s=0;s4&&0==e.itree[1+(e.ordr[u-1]<<1)];)u--;return[r,t,l,i,c,u,a,f]},UZIP.F.getSecond=function(e){for(var r=[],t=0;t>1)+",");return r},UZIP.F.contSize=function(e,r){for(var t=0,a=0;a15&&(UZIP.F._putsE(t,a,c,s),a+=s)}return a},UZIP.F._lenCodes=function(e,r){for(var t=e.length;2!=t&&0==e[t-1];)t-=2;for(var a=0;a>>1,138))<11?r.push(17,u-3):r.push(18,u-11),a+=2*u-2}else if(i==s&&f==i&&c==i){for(l=a+5;l+2>>1,6);r.push(16,u-3),a+=2*u-2}else r.push(i,0)}return t>>>1},UZIP.F._hufTree=function(e,r,t){var a=[],i=e.length,f=r.length,c=0;for(c=0;ct&&(UZIP.F.restrictDepth(l,t,U),U=t),c=0;cr;a++){var c=e[a].d;e[a].d=r,f+=i-(1<>>=t-r;f>0;){(c=e[a].d)=0;a--)e[a].d==r&&f<0&&(e[a].d--,f++);0!=f&&console.log("debt left")},UZIP.F._goodIndex=function(e,r){var t=0;return r[16|t]<=e&&(t|=16),r[8|t]<=e&&(t|=8),r[4|t]<=e&&(t|=4),r[2|t]<=e&&(t|=2),r[1|t]<=e&&(t|=1),t},UZIP.F._writeLit=function(e,r,t,a){return UZIP.F._putsF(t,a,r[e<<1]),a+r[1+(e<<1)]},UZIP.F.inflate=function(e,r){var t=Uint8Array;if(3==e[0]&&0==e[1])return r||new t(0);var a=UZIP.F,i=a._bitsF,f=a._bitsE,c=a._decodeTiny,s=a.makeCodes,l=a.codes2map,u=a._get17,d=a.U,h=null==r;h&&(r=new t(e.length>>>2<<3));for(var A,v,p=0,U=0,g=0,m=0,w=0,P=0,b=0,_=0,y=0;0==p;)if(p=i(e,y,1),U=i(e,y+1,2),y+=3,0!=U){if(h&&(r=UZIP.F._check(r,_+(1<<17))),1==U&&(A=d.flmap,v=d.fdmap,P=511,b=31),2==U){g=f(e,y,5)+257,m=f(e,y+5,5)+1,w=f(e,y+10,4)+4,y+=14;for(var I=0;I<38;I+=2)d.itree[I]=0,d.itree[I+1]=0;var F=1;for(I=0;IF&&(F=G)}y+=3*w,s(d.itree,F),l(d.itree,F,d.imap),A=d.lmap,v=d.dmap,y=c(d.imap,(1<>>4;if(Z>>>8==0)r[_++]=Z;else{if(256==Z)break;var x=_+Z-254;if(Z>264){var M=d.ldef[Z-257];x=_+(M>>>3)+f(e,y,7&M),y+=7&M}var R=v[u(e,y)&b];y+=15&R;var Q=R>>>4,T=d.ddef[Q],D=(T>>>4)+i(e,y,15&T);for(y+=15&T,h&&(r=UZIP.F._check(r,_+(1<<17)));_>>3),V=e[O-4]|e[O-3]<<8;h&&(r=UZIP.F._check(r,_+V)),r.set(new t(e.buffer,e.byteOffset+O,V),_),y=O+V<<3,_+=V}return r.length==_?r:r.slice(0,_)},UZIP.F._check=function(e,r){var t=e.length;if(r<=t)return e;var a=new Uint8Array(Math.max(t<<1,r));return a.set(e,0),a},UZIP.F._decodeTiny=function(e,r,t,a,i,f){for(var c=UZIP.F._bitsE,s=UZIP.F._get17,l=0;l>>4;if(d<=15)f[l]=d,l++;else{var h=0,A=0;16==d?(A=3+c(a,i,2),i+=2,h=f[l-1]):17==d?(A=3+c(a,i,3),i+=3):18==d&&(A=11+c(a,i,7),i+=7);for(var v=l+A;l>>1;fi&&(i=s),f++}for(;f>1,s=e[f+1],l=c<<4|s,u=r-s,d=e[f]<>>15-r]=l,d++}},UZIP.F.revCodes=function(e,r){for(var t=UZIP.F.U.rev15,a=15-r,i=0;i>>a}},UZIP.F._putsE=function(e,r,t){t<<=7&r;var a=r>>>3;e[a]|=t,e[a+1]|=t>>>8},UZIP.F._putsF=function(e,r,t){t<<=7&r;var a=r>>>3;e[a]|=t,e[a+1]|=t>>>8,e[a+2]|=t>>>16},UZIP.F._bitsE=function(e,r,t){return(e[r>>>3]|e[1+(r>>>3)]<<8)>>>(7&r)&(1<>>3]|e[1+(r>>>3)]<<8|e[2+(r>>>3)]<<16)>>>(7&r)&(1<>>3]|e[1+(r>>>3)]<<8|e[2+(r>>>3)]<<16)>>>(7&r)},UZIP.F._get25=function(e,r){return(e[r>>>3]|e[1+(r>>>3)]<<8|e[2+(r>>>3)]<<16|e[3+(r>>>3)]<<24)>>>(7&r)},UZIP.F.U=(r=Uint16Array,t=Uint32Array,{next_code:new r(16),bl_count:new r(16),ordr:[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],of0:[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,999,999,999],exb:[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0],ldef:new r(32),df0:[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,65535,65535],dxb:[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0],ddef:new t(32),flmap:new r(512),fltree:[],fdmap:new r(32),fdtree:[],lmap:new r(32768),ltree:[],ttree:[],dmap:new r(32768),dtree:[],imap:new r(512),itree:[],rev15:new r(32768),lhst:new t(286),dhst:new t(30),ihst:new t(19),lits:new t(15e3),strt:new r(65536),prev:new r(32768)}),function(){for(var e=UZIP.F.U,r=0;r<32768;r++){var t=r;t=(4278255360&(t=(4042322160&(t=(3435973836&(t=(2863311530&t)>>>1|(1431655765&t)<<1))>>>2|(858993459&t)<<2))>>>4|(252645135&t)<<4))>>>8|(16711935&t)<<8,e.rev15[r]=(t>>>16|t<<16)>>>17}function pushV(e,r,t){for(;0!=r--;)e.push(0,t)}for(r=0;r<32;r++)e.ldef[r]=e.of0[r]<<3|e.exb[r],e.ddef[r]=e.df0[r]<<4|e.dxb[r];pushV(e.fltree,144,8),pushV(e.fltree,112,9),pushV(e.fltree,24,7),pushV(e.fltree,8,8),UZIP.F.makeCodes(e.fltree,9),UZIP.F.codes2map(e.fltree,9,e.flmap),UZIP.F.revCodes(e.fltree,9),pushV(e.fdtree,32,5),UZIP.F.makeCodes(e.fdtree,5),UZIP.F.codes2map(e.fdtree,5,e.fdmap),UZIP.F.revCodes(e.fdtree,5),pushV(e.itree,19,0),pushV(e.ltree,286,0),pushV(e.dtree,30,0),pushV(e.ttree,320,0)}()})),UZIP=Object.freeze(Object.assign(Object.create(null),UZIP_1,{default:UZIP_1})),UPNG={},N,W,H;UPNG.toRGBA8=function(e){var r=e.width,t=e.height;if(null==e.tabs.acTL)return[UPNG.toRGBA8.decodeImage(e.data,r,t,e).buffer];var a=[];null==e.frames[0].data&&(e.frames[0].data=e.data);for(var i=r*t*4,f=new Uint8Array(i),c=new Uint8Array(i),s=new Uint8Array(i),l=0;l>3)]>>7-((7&v)<<0)&1);s[P]=b[C],s[P+1]=b[C+1],s[P+2]=b[C+2],s[P+3]=E>2)]>>6-((3&v)<<1)&3);s[P]=b[C],s[P+1]=b[C+1],s[P+2]=b[C+2],s[P+3]=E>1)]>>4-((1&v)<<2)&15);s[P]=b[C],s[P+1]=b[C+1],s[P+2]=b[C+2],s[P+3]=E>>3)]>>>7-(7&R)&1))==255*g?0:255;l[M+R]=Q<<24|B<<16|B<<8|B}else if(2==d)for(R=0;R>>2)]>>>6-((3&R)<<1)&3))==85*g?0:255;l[M+R]=Q<<24|B<<16|B<<8|B}else if(4==d)for(R=0;R>>1)]>>>4-((1&R)<<2)&15))==17*g?0:255;l[M+R]=Q<<24|B<<16|B<<8|B}else if(8==d)for(R=0;R>>2<<5));0==f;)if(f=U(e,v,1),c=U(e,v+1,2),v+=3,0!=c){if(y&&(r=H.H.W(r,A+(1<<17))),1==c&&(t=_.J,a=_.h,d=511,h=31),2==c){s=g(e,v,5)+257,l=g(e,v+5,5)+1,u=g(e,v+10,4)+4,v+=14;for(var I=1,F=0;F<38;F+=2)_.Q[F]=0,_.Q[F+1]=0;for(F=0;FI&&(I=G)}v+=3*u,w(_.Q,I),P(_.Q,I,_.u),t=_.w,a=_.d,v=m(_.u,(1<>>4;if(Z>>>8==0)r[A++]=Z;else{if(256==Z)break;var x=A+Z-254;if(Z>264){var M=_.q[Z-257];x=A+(M>>>3)+g(e,v,7&M),v+=7&M}var R=a[b(e,v)&h];v+=15&R;var Q=R>>>4,T=_.c[Q],D=(T>>>4)+U(e,v,15&T);for(v+=15&T;A>>3),V=e[O-4]|e[O-3]<<8;y&&(r=H.H.W(r,A+V)),r.set(new i(e.buffer,e.byteOffset+O,V),A),v=O+V<<3,A+=V}return r.length==A?r:r.slice(0,A)},H.H.W=function(e,r){var t=e.length;if(r<=t)return e;var a=new Uint8Array(t<<1);return a.set(e,0),a},H.H.R=function(e,r,t,a,i,f){for(var c=H.H.e,s=H.H.Z,l=0;l>>4;if(d<=15)f[l]=d,l++;else{var h=0,A=0;16==d?(A=3+c(a,i,2),i+=2,h=f[l-1]):17==d?(A=3+c(a,i,3),i+=3):18==d&&(A=11+c(a,i,7),i+=7);for(var v=l+A;l>>1;fi&&(i=s),f++}for(;f>1,s=e[f+1],l=c<<4|s,u=r-s,d=e[f]<>>15-r]=l,d++},H.H.l=function(e,r){for(var t=H.H.m.r,a=15-r,i=0;i>>a}},H.H.M=function(e,r,t){t<<=7&r;var a=r>>>3;e[a]|=t,e[a+1]|=t>>>8},H.H.I=function(e,r,t){t<<=7&r;var a=r>>>3;e[a]|=t,e[a+1]|=t>>>8,e[a+2]|=t>>>16},H.H.e=function(e,r,t){return(e[r>>>3]|e[1+(r>>>3)]<<8)>>>(7&r)&(1<>>3]|e[1+(r>>>3)]<<8|e[2+(r>>>3)]<<16)>>>(7&r)&(1<>>3]|e[1+(r>>>3)]<<8|e[2+(r>>>3)]<<16)>>>(7&r)},H.H.i=function(e,r){return(e[r>>>3]|e[1+(r>>>3)]<<8|e[2+(r>>>3)]<<16|e[3+(r>>>3)]<<24)>>>(7&r)},H.H.m=(N=Uint16Array,W=Uint32Array,{K:new N(16),j:new N(16),X:[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],S:[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,999,999,999],T:[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0],q:new N(32),p:[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,65535,65535],z:[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0],c:new W(32),J:new N(512),_:[],h:new N(32),$:[],w:new N(32768),C:[],v:[],d:new N(32768),D:[],u:new N(512),Q:[],r:new N(32768),s:new W(286),Y:new W(30),a:new W(19),t:new W(15e3),k:new N(65536),g:new N(32768)}),function(){for(var e=H.H.m,r=0;r<32768;r++){var t=r;t=(4278255360&(t=(4042322160&(t=(3435973836&(t=(2863311530&t)>>>1|(1431655765&t)<<1))>>>2|(858993459&t)<<2))>>>4|(252645135&t)<<4))>>>8|(16711935&t)<<8,e.r[r]=(t>>>16|t<<16)>>>17}function n(e,r,t){for(;0!=r--;)e.push(0,t)}for(r=0;r<32;r++)e.q[r]=e.S[r]<<3|e.T[r],e.c[r]=e.p[r]<<4|e.z[r];n(e._,144,8),n(e._,112,9),n(e._,24,7),n(e._,8,8),H.H.n(e._,9),H.H.A(e._,9,e.J),H.H.l(e._,9),n(e.$,32,5),H.H.n(e.$,5),H.H.A(e.$,5,e.h),H.H.l(e.$,5),n(e.Q,19,0),n(e.C,286,0),n(e.D,30,0),n(e.v,320,0)}(),H.H.N),UPNG.decode._readInterlace=function(e,r){for(var t=r.width,a=r.height,i=UPNG.decode._getBPP(r),f=i>>3,c=Math.ceil(t*i/8),s=new Uint8Array(a*c),l=0,u=[0,0,4,0,2,0,1],d=[0,4,0,2,0,1,0],h=[8,8,8,4,4,2,2],A=[8,8,4,4,2,2,1],v=0;v<7;){for(var p=h[v],U=A[v],g=0,m=0,w=u[v];w>3])>>7-(7&F)&1,s[y*c+(I>>3)]|=G<<7-((7&I)<<0);if(2==i)G=(G=e[F>>3])>>6-(7&F)&3,s[y*c+(I>>2)]|=G<<6-((3&I)<<1);if(4==i)G=(G=e[F>>3])>>4-(7&F)&15,s[y*c+(I>>1)]|=G<<4-((1&I)<<2);if(i>=8)for(var C=y*c+I*f,E=0;E>3)+E];F+=i,I+=U}_++,y+=p}g*m!=0&&(l+=m*(1+b)),v+=1}return s},UPNG.decode._getBPP=function(e){return[1,null,3,1,2,null,4][e.ctype]*e.depth},UPNG.decode._filterZero=function(e,r,t,a,i){var f=UPNG.decode._getBPP(r),c=Math.ceil(a*f/8),s=UPNG.decode._paeth;f=Math.ceil(f/8);var l=0,u=1,d=e[t],h=0;if(d>1&&(e[t]=[0,0,1][d-2]),3==d)for(h=f;h>>1)&255;for(var A=0;A>>1);for(;h>>1)}else{for(;h>8&255,e[r+1]=255&t},readUint:function readUint(e,r){return 16777216*e[r]+(e[r+1]<<16|e[r+2]<<8|e[r+3])},writeUint:function writeUint(e,r,t){e[r]=t>>24&255,e[r+1]=t>>16&255,e[r+2]=t>>8&255,e[r+3]=255&t},readASCII:function readASCII(e,r,t){for(var a="",i=0;i=0&&s>=0?(h=v*r+p<<2,A=(s+v)*i+c+p<<2):(h=(-s+v)*r-c+p<<2,A=v*i+p<<2),0==l)a[A]=e[h],a[A+1]=e[h+1],a[A+2]=e[h+2],a[A+3]=e[h+3];else if(1==l){var U=e[h+3]*(1/255),g=e[h]*U,m=e[h+1]*U,w=e[h+2]*U,P=a[A+3]*(1/255),b=a[A]*P,_=a[A+1]*P,y=a[A+2]*P,I=1-U,F=U+P*I,G=0==F?0:1/F;a[A+3]=255*F,a[A+0]=(g+b*I)*G,a[A+1]=(m+_*I)*G,a[A+2]=(w+y*I)*G}else if(2==l){U=e[h+3],g=e[h],m=e[h+1],w=e[h+2],P=a[A+3],b=a[A],_=a[A+1],y=a[A+2];U==P&&g==b&&m==_&&w==y?(a[A]=0,a[A+1]=0,a[A+2]=0,a[A+3]=0):(a[A]=g,a[A+1]=m,a[A+2]=w,a[A+3]=U)}else if(3==l){U=e[h+3],g=e[h],m=e[h+1],w=e[h+2],P=a[A+3],b=a[A],_=a[A+1],y=a[A+2];if(U==P&&g==b&&m==_&&w==y)continue;if(U<220&&P>20)return!1}return!0},UPNG.encode=function(e,r,t,a,i,f,c){null==a&&(a=0),null==c&&(c=!1);var s=UPNG.encode.compress(e,r,t,a,[!1,!1,!1,0,c]);return UPNG.encode.compressPNG(s,-1),UPNG.encode._main(s,r,t,i,f)},UPNG.encodeLL=function(e,r,t,a,i,f,c,s){for(var l={ctype:0+(1==a?0:2)+(0==i?0:4),depth:f,frames:[]},u=(a+i)*f,d=u*r,h=0;h1,h=!1,A=33+(d?20:0);if(null!=i.sRGB&&(A+=13),null!=i.pHYs&&(A+=21),3==e.ctype){for(var v=e.plte.length,p=0;p>>24!=255&&(h=!0);A+=8+3*v+4+(h?8+1*v+4:0)}for(var U=0;U>>8&255,y=P>>>16&255;g[u+w+0]=b,g[u+w+1]=_,g[u+w+2]=y}if(c(g,u+=3*v,f(g,u-3*v-4,3*v+4)),u+=4,h){c(g,u,v),l(g,u+=4,"tRNS"),u+=4;for(p=0;p>>24&255;c(g,u+=v,f(g,u-v-4,v+4)),u+=4}}var I=0;for(U=0;U>2,E>>2));for(v=0;vx&&R==Z[g-x])M[g]=M[g-x];else{var Q=P[R];if(null==Q&&(P[R]=Q=b.length,b.push(R),b.length>=300))break;M[g]=Q}}}var T=b.length;T<=256&&0==u&&(h=T<=2?1:T<=4?2:T<=16?4:8,h=Math.max(h,l));for(v=0;v>1)]|=L[q+j]<<4-4*(1&j);else if(2==h)for(j=0;j>2)]|=L[q+j]<<6-2*(3&j);else if(1==h)for(j=0;j>3)]|=L[q+j]<<7-1*(7&j)}O=k,d=3,z=1}else if(0==m&&1==w.length){k=new Uint8Array(x*D*3);var $=x*D;for(g=0;g<$;g++){var K,J=4*g;k[K=3*g]=O[J],k[K+1]=O[J+1],k[K+2]=O[J+2]}O=k,d=2,z=3,V=3*x}B.img=O,B.bpl=V,B.bpp=z}return{ctype:d,depth:h,plte:b,frames:w}},UPNG.encode.framize=function(e,r,t,a,i,f){for(var c=[],s=0;sF&&(F=E),CG&&(G=C))}-1==F&&(y=I=F=G=0),i&&(1==(1&y)&&y--,1==(1&I)&&I--);var B=(F-y+1)*(G-I+1);Bg&&(g=b),_m&&(m=_))}-1==g&&(p=U=g=m=0),c&&(1==(1&p)&&p--,1==(1&U)&&U--),f={x:p,y:U,width:g-p+1,height:m-U+1};var F=a[i];F.rect=f,F.blend=1,F.img=new Uint8Array(f.width*f.height*4),0==a[i-1].dispose?(UPNG._copyTile(u,r,t,F.img,f.width,f.height,-f.x,-f.y,0),UPNG.encode._prepareDiff(A,r,t,F.img,f)):UPNG._copyTile(A,r,t,F.img,f.width,f.height,-f.x,-f.y,0)},UPNG.encode._prepareDiff=function(e,r,t,a,i){UPNG._copyTile(e,r,t,a,i.width,i.height,-i.x,-i.y,2)},UPNG.encode._filterZero=function(e,r,t,a,i,f,c){var s,l=[],u=[0,1,2,3,4];-1!=f?u=[f]:(r*a>5e5||1==t)&&(u=[0]),c&&(s={level:0});for(var d=UZIP,h=0;h>1)+256&255;if(4==f)for(u=i;u>1)&255;for(u=i;u>1)&255}if(4==f){for(u=0;u>>1:t>>>=1;e[r]=t}return e}(),update:function update(e,r,t,a){for(var i=0;i>>8;return e},crc:function crc(e,r,t){return 4294967295^UPNG.crc.update(4294967295,e,r,t)}},UPNG.quantize=function(e,r){var t,a=new Uint8Array(e),i=a.slice(0),f=new Uint32Array(i.buffer),c=UPNG.quantize.getKDtree(i,r),s=c[0],l=c[1],u=UPNG.quantize.planeDst,d=a,h=f,A=d.length,v=new Uint8Array(a.length>>2);if(a.length<2e7)for(var p=0;p>2]=t.ind,h[p>>2]=t.est.rgba}else for(p=0;p>2]=t.ind,h[p>>2]=t.est.rgba}return{abuf:i.buffer,inds:v,plte:l}},UPNG.quantize.getKDtree=function(e,r,t){null==t&&(t=1e-4);var a=new Uint32Array(e.buffer),i={i0:0,i1:e.length,bst:null,est:null,tdst:0,left:null,right:null};i.bst=UPNG.quantize.stats(e,i.i0,i.i1),i.est=UPNG.quantize.estats(i.bst);for(var f=[i];f.lengthc&&(c=f[l].est.L,s=l);if(c=d||u.i1<=d)u.est.L=0;else{var h={i0:u.i0,i1:d,bst:null,est:null,tdst:0,left:null,right:null};h.bst=UPNG.quantize.stats(e,h.i0,h.i1),h.est=UPNG.quantize.estats(h.bst);var A={i0:d,i1:u.i1,bst:null,est:null,tdst:0,left:null,right:null};A.bst={R:[],m:[],N:u.bst.N-h.bst.N};for(l=0;l<16;l++)A.bst.R[l]=u.bst.R[l]-h.bst.R[l];for(l=0;l<4;l++)A.bst.m[l]=u.bst.m[l]-h.bst.m[l];A.est=UPNG.quantize.estats(A.bst),u.left=h,u.right=A,f[s]=h,f.push(A)}}f.sort((function(e,r){return r.bst.N-e.bst.N}));for(l=0;l0&&(c=e.right,s=e.left);var l=UPNG.quantize.getNearest(c,r,t,a,i);if(l.tdst<=f*f)return l;var u=UPNG.quantize.getNearest(s,r,t,a,i);return u.tdstf;)a-=4;if(t>=a)break;var s=r[t>>2];r[t>>2]=r[a>>2],r[a>>2]=s,t+=4,a-=4}for(;c(e,t,i)>f;)t-=4;return t+4},UPNG.quantize.vecDot=function(e,r,t){return e[r]*t[0]+e[r+1]*t[1]+e[r+2]*t[2]+e[r+3]*t[3]},UPNG.quantize.stats=function(e,r,t){for(var a=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],i=[0,0,0,0],f=t-r>>2,c=r;c>>0}},UPNG.M4={multVec:function multVec(e,r){return[e[0]*r[0]+e[1]*r[1]+e[2]*r[2]+e[3]*r[3],e[4]*r[0]+e[5]*r[1]+e[6]*r[2]+e[7]*r[3],e[8]*r[0]+e[9]*r[1]+e[10]*r[2]+e[11]*r[3],e[12]*r[0]+e[13]*r[1]+e[14]*r[2]+e[15]*r[3]]},dot:function dot(e,r){return e[0]*r[0]+e[1]*r[1]+e[2]*r[2]+e[3]*r[3]},sml:function sml(e,r){return[e*r[0],e*r[1],e*r[2],e*r[3]]}},UPNG.encode.concatRGBA=function(e){for(var r=0,t=0;t2&&void 0!==arguments[2]?arguments[2]:Date.now();return new Promise((function(a){for(var i=e.split(","),f=i[0].match(/:(.*?);/)[1],c=globalThis.atob(i[1]),s=c.length,l=new Uint8Array(s);s--;)l[s]=c.charCodeAt(s);var u=new Blob([l],{type:f});u.name=r,u.lastModified=t,a(u)}))}function loadImage(e){return new Promise((function(r,t){var a=new Image;a.onload=function(){return r(a)},a.onerror=function(e){return t(e)},a.src=e}))}function drawImageInCanvas(e){var r=_slicedToArray(getNewCanvasAndCtx(e.width,e.height),2),t=r[0];return r[1].drawImage(e,0,0,t.width,t.height),t}function drawFileInCanvas(e){return new Promise((function(r,t){var a,i,f=function $Try_1_Post(){try{return i=drawImageInCanvas(a),r([a,i])}catch(e){return t(e)}},c=function $Try_1_Catch(r){try{return getDataUrlFromFile(e).then((function(e){try{return loadImage(e).then((function(e){try{return a=e,f()}catch(e){return t(e)}}),t)}catch(e){return t(e)}}),t)}catch(e){return t(e)}};try{return createImageBitmap(e).then((function(e){try{return a=e,f()}catch(e){return c()}}),c)}catch(e){c()}}))}function canvasToFile(e,r,t,a){var i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:1;return new Promise((function(f,c){var s,l,u;if("image/png"===r)return l=e.getContext("2d").getImageData(0,0,e.width,e.height).data,u=UPNG.encode([l],e.width,e.height,256*i),(s=new Blob([u],{type:r})).name=t,s.lastModified=a,$If_4.call(this);{return"function"==typeof OffscreenCanvas&&e instanceof OffscreenCanvas?e.convertToBlob({type:r,quality:i}).then(function(e){try{return(s=e).name=t,s.lastModified=a,$If_5.call(this)}catch(e){return c(e)}}.bind(this),c):getFilefromDataUrl(e.toDataURL(r,i),t,a).then(function(e){try{return s=e,$If_5.call(this)}catch(e){return c(e)}}.bind(this),c);function $If_5(){return $If_4.call(this)}}function $If_4(){return f(s)}}))}function getExifOrientation(e){return new Promise((function(r,t){var a=new CustomFileReader;a.onload=function(e){var t=new DataView(e.target.result);if(65496!=t.getUint16(0,!1))return r(-2);for(var a=t.byteLength,i=2;if||i>f)){var s=_slicedToArray(getNewCanvasAndCtx(a,i),2);c=s[0],t=s[1],a>i?(c.width=f,c.height=i/a*f):(c.width=a/i*f,c.height=f),t.drawImage(e,0,0,c.width,c.height),cleanupCanvasMemory(e)}return c}function followExifOrientation(e,r){var t=e.width,a=e.height,i=_slicedToArray(getNewCanvasAndCtx(t,a),2),f=i[0],c=i[1];switch(42&&void 0!==arguments[2]?arguments[2]:0;return new Promise((function(a,i){var f,c,s,l,u,d,h,A,v,p,U,g,m,w,P,b,_,y;function incProgress(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:5;f+=e,r.onProgress(Math.min(f,100))}function setProgress(e){f=Math.min(Math.max(e,f),100),r.onProgress(f)}return f=t,c=r.maxIteration||10,s=1024*r.maxSizeMB*1024,incProgress(),drawFileInCanvas(e).then(function(t){try{var f=_slicedToArray(t,2);return f[0],l=f[1],incProgress(),u=handleMaxWidthOrHeight(l,r),incProgress(),new Promise((function(t,a){var i;if(!(i=r.exifOrientation))return getExifOrientation(e).then(function(e){try{return i=e,$If_2.call(this)}catch(e){return a(e)}}.bind(this),a);function $If_2(){return t(i)}return $If_2.call(this)})).then(function(t){try{return d=t,incProgress(),isAutoOrientationInBrowser().then(function(t){try{return h=t?u:followExifOrientation(u,d),incProgress(),A=r.initialQuality||1,v=r.fileType||e.type,canvasToFile(h,v,e.name,e.lastModified,A).then(function(r){try{{if(p=r,incProgress(),U=p.size>s,g=p.size>e.size,!U&&!g)return setProgress(100),a(p);var t;function $Loop_3(){if(c--&&(P>s||P>m)){var r,t,a=_slicedToArray(getNewCanvasAndCtx(r=U?.95*y.width:y.width,t=U?.95*y.height:y.height),2);return _=a[0],a[1].drawImage(y,0,0,r,t),A*=.95,canvasToFile(_,v,e.name,e.lastModified,A).then((function(e){try{return b=e,cleanupCanvasMemory(y),y=_,P=b.size,setProgress(Math.min(99,Math.floor((w-P)/(w-s)*100))),$Loop_3}catch(e){return i(e)}}),i)}return[1]}return m=e.size,w=p.size,P=w,y=h,(t=function(e){for(;e;){if(e.then)return void e.then(t,i);try{if(e.pop){if(e.length)return e.pop()?$Loop_3_exit.call(this):e;e=$Loop_3}else e=e.call(this)}catch(e){return i(e)}}}.bind(this))($Loop_3);function $Loop_3_exit(){return cleanupCanvasMemory(y),cleanupCanvasMemory(_),cleanupCanvasMemory(u),cleanupCanvasMemory(h),cleanupCanvasMemory(l),setProgress(100),a(b)}}}catch(e){return i(e)}}.bind(this),i)}catch(e){return i(e)}}.bind(this),i)}catch(e){return i(e)}}.bind(this),i)}catch(e){return i(e)}}.bind(this),i)}))}isBrowser&&(Number.isInteger=Number.isInteger||function(e){return"number"==typeof e&&isFinite(e)&&Math.floor(e)===e});var cnt=0,imageCompressionLibUrl,worker;function createWorker(e){return"function"==typeof e&&(e="(".concat(f,")()")),new Worker(URL.createObjectURL(new Blob([e])))}function createSourceObject(e){return URL.createObjectURL(new Blob([e],{type:"application/javascript"}))}function stringify(e){return JSON.stringify(e,(function(e,r){return"function"==typeof r?"BIC_FN:::(() => ".concat(r.toString(),")()"):r}))}function parse(o){if("string"==typeof o)return o;var result={};return Object.entries(o).forEach((function(_ref){var _ref2=_slicedToArray(_ref,2),key=_ref2[0],value=_ref2[1];if("string"==typeof value&&value.startsWith("BIC_FN:::"))try{result[key]=eval(value.replace(/^BIC_FN:::/,""))}catch(e){throw console.log(key,e),e}else result[key]=parse(value)})),result}function generateLib(){return createSourceObject("\n // reconstruct library\n function imageCompression (){return (".concat(imageCompression,").apply(null, arguments)}\n\n imageCompression.getDataUrlFromFile = ").concat(imageCompression.getDataUrlFromFile,"\n imageCompression.getFilefromDataUrl = ").concat(imageCompression.getFilefromDataUrl,"\n imageCompression.loadImage = ").concat(imageCompression.loadImage,"\n imageCompression.drawImageInCanvas = ").concat(imageCompression.drawImageInCanvas,"\n imageCompression.drawFileInCanvas = ").concat(imageCompression.drawFileInCanvas,"\n imageCompression.canvasToFile = ").concat(imageCompression.canvasToFile,"\n imageCompression.getExifOrientation = ").concat(imageCompression.getExifOrientation,"\n imageCompression.handleMaxWidthOrHeight = ").concat(imageCompression.handleMaxWidthOrHeight,"\n imageCompression.followExifOrientation = ").concat(imageCompression.followExifOrientation,"\n imageCompression.cleanupCanvasMemory = ").concat(imageCompression.cleanupCanvasMemory,"\n imageCompression.isAutoOrientationInBrowser = ").concat(imageCompression.isAutoOrientationInBrowser,"\n\n // functions / objects\n getDataUrlFromFile = imageCompression.getDataUrlFromFile\n getFilefromDataUrl = imageCompression.getFilefromDataUrl\n loadImage = imageCompression.loadImage\n drawImageInCanvas = imageCompression.drawImageInCanvas\n drawFileInCanvas = imageCompression.drawFileInCanvas\n canvasToFile = imageCompression.canvasToFile\n getExifOrientation = imageCompression.getExifOrientation\n handleMaxWidthOrHeight = imageCompression.handleMaxWidthOrHeight\n followExifOrientation = imageCompression.followExifOrientation\n cleanupCanvasMemory = imageCompression.cleanupCanvasMemory\n isAutoOrientationInBrowser = imageCompression.isAutoOrientationInBrowser\n \n getNewCanvasAndCtx = ").concat(getNewCanvasAndCtx,"\n CustomFileReader = FileReader\n CustomFile = File\n function _slicedToArray(arr, n) { return arr }\n function _typeof(a) { return typeof a }\n function compress (){return (").concat(compress,").apply(null, arguments)}\n\n // Libraries\n const parse = ").concat(parse,"\n const UPNG = {}\n UPNG.toRGBA8 = ").concat(UPNG.toRGBA8,"\n UPNG.toRGBA8.decodeImage = ").concat(UPNG.toRGBA8.decodeImage,"\n UPNG.decode = ").concat(UPNG.decode,"\n UPNG.decode._decompress = ").concat(UPNG.decode._decompress,"\n UPNG.decode._inflate = ").concat(UPNG.decode._inflate,"\n UPNG.decode._readInterlace = ").concat(UPNG.decode._readInterlace,"\n UPNG.decode._getBPP = ").concat(UPNG.decode._getBPP," \n UPNG.decode._filterZero = ").concat(UPNG.decode._filterZero,"\n UPNG.decode._paeth = ").concat(UPNG.decode._paeth,"\n UPNG.decode._IHDR = ").concat(UPNG.decode._IHDR,"\n UPNG._bin = parse(").concat(stringify(UPNG._bin),")\n UPNG._copyTile = ").concat(UPNG._copyTile,"\n UPNG.encode = ").concat(UPNG.encode,"\n UPNG.encodeLL = ").concat(UPNG.encodeLL," \n UPNG.encode._main = ").concat(UPNG.encode._main,"\n UPNG.encode.compressPNG = ").concat(UPNG.encode.compressPNG," \n UPNG.encode.compress = ").concat(UPNG.encode.compress,"\n UPNG.encode.framize = ").concat(UPNG.encode.framize," \n UPNG.encode._updateFrame = ").concat(UPNG.encode._updateFrame," \n UPNG.encode._prepareDiff = ").concat(UPNG.encode._prepareDiff," \n UPNG.encode._filterZero = ").concat(UPNG.encode._filterZero," \n UPNG.encode._filterLine = ").concat(UPNG.encode._filterLine,"\n UPNG.encode.concatRGBA = ").concat(UPNG.encode.concatRGBA,"\n UPNG.crc = parse(").concat(stringify(UPNG.crc),")\n UPNG.crc.table = ( function() {\n var tab = new Uint32Array(256);\n for (var n=0; n<256; n++) {\n var c = n;\n for (var k=0; k<8; k++) {\n if (c & 1) c = 0xedb88320 ^ (c >>> 1);\n else c = c >>> 1;\n }\n tab[n] = c; }\n return tab; })()\n UPNG.quantize = ").concat(UPNG.quantize," \n UPNG.quantize.getKDtree = ").concat(UPNG.quantize.getKDtree," \n UPNG.quantize.getNearest = ").concat(UPNG.quantize.getNearest," \n UPNG.quantize.planeDst = ").concat(UPNG.quantize.planeDst," \n UPNG.quantize.dist = ").concat(UPNG.quantize.dist," \n UPNG.quantize.splitPixels = ").concat(UPNG.quantize.splitPixels," \n UPNG.quantize.vecDot = ").concat(UPNG.quantize.vecDot," \n UPNG.quantize.stats = ").concat(UPNG.quantize.stats," \n UPNG.quantize.estats = ").concat(UPNG.quantize.estats,"\n UPNG.M4 = parse(").concat(stringify(UPNG.M4),")\n UPNG.encode.concatRGBA = ").concat(UPNG.encode.concatRGBA,'\n UPNG.inflateRaw=function(){\n var H={};H.H={};H.H.N=function(N,W){var R=Uint8Array,i=0,m=0,J=0,h=0,Q=0,X=0,u=0,w=0,d=0,v,C;\n if(N[0]==3&&N[1]==0)return W?W:new R(0);var V=H.H,n=V.b,A=V.e,l=V.R,M=V.n,I=V.A,e=V.Z,b=V.m,Z=W==null;\n if(Z)W=new R(N.length>>>2<<5);while(i==0){i=n(N,d,1);m=n(N,d+1,2);d+=3;if(m==0){if((d&7)!=0)d+=8-(d&7);\n var D=(d>>>3)+4,q=N[D-4]|N[D-3]<<8;if(Z)W=H.H.W(W,w+q);W.set(new R(N.buffer,N.byteOffset+D,q),w);d=D+q<<3;\n w+=q;continue}if(Z)W=H.H.W(W,w+(1<<17));if(m==1){v=b.J;C=b.h;X=(1<<9)-1;u=(1<<5)-1}if(m==2){J=A(N,d,5)+257;\n h=A(N,d+5,5)+1;Q=A(N,d+10,4)+4;d+=14;var E=d,j=1;for(var c=0;c<38;c+=2){b.Q[c]=0;b.Q[c+1]=0}for(var c=0;\n cj)j=K}d+=3*Q;M(b.Q,j);I(b.Q,j,b.u);v=b.w;C=b.d;\n d=l(b.u,(1<>>4;if(p>>>8==0){W[w++]=p}else if(p==256){break}else{var z=w+p-254;\n if(p>264){var _=b.q[p-257];z=w+(_>>>3)+A(N,d,_&7);d+=_&7}var $=C[e(N,d)&u];d+=$&15;var s=$>>>4,Y=b.c[s],a=(Y>>>4)+n(N,d,Y&15);\n d+=Y&15;while(w>>4;\n if(b<=15){A[I]=b;I++}else{var Z=0,m=0;if(b==16){m=3+l(V,n,2);n+=2;Z=A[I-1]}else if(b==17){m=3+l(V,n,3);\n n+=3}else if(b==18){m=11+l(V,n,7);n+=7}var J=I+m;while(I>>1;\n while(An)n=M;A++}while(A>1,I=N[l+1],e=M<<4|I,b=W-I,Z=N[l]<>>15-W;R[J]=e;Z++}}};H.H.l=function(N,W){var R=H.H.m.r,V=15-W;for(var n=0;n>>V}};H.H.M=function(N,W,R){R=R<<(W&7);var V=W>>>3;N[V]|=R;N[V+1]|=R>>>8};\n H.H.I=function(N,W,R){R=R<<(W&7);var V=W>>>3;N[V]|=R;N[V+1]|=R>>>8;N[V+2]|=R>>>16};H.H.e=function(N,W,R){return(N[W>>>3]|N[(W>>>3)+1]<<8)>>>(W&7)&(1<>>3]|N[(W>>>3)+1]<<8|N[(W>>>3)+2]<<16)>>>(W&7)&(1<>>3]|N[(W>>>3)+1]<<8|N[(W>>>3)+2]<<16)>>>(W&7)};\n H.H.i=function(N,W){return(N[W>>>3]|N[(W>>>3)+1]<<8|N[(W>>>3)+2]<<16|N[(W>>>3)+3]<<24)>>>(W&7)};H.H.m=function(){var N=Uint16Array,W=Uint32Array;\n return{K:new N(16),j:new N(16),X:[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],S:[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,999,999,999],T:[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0],q:new N(32),p:[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,65535,65535],z:[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0],c:new W(32),J:new N(512),_:[],h:new N(32),$:[],w:new N(32768),C:[],v:[],d:new N(32768),D:[],u:new N(512),Q:[],r:new N(1<<15),s:new W(286),Y:new W(30),a:new W(19),t:new W(15e3),k:new N(1<<16),g:new N(1<<15)}}();\n (function(){var N=H.H.m,W=1<<15;for(var R=0;R>>1|(V&1431655765)<<1;\n V=(V&3435973836)>>>2|(V&858993459)<<2;V=(V&4042322160)>>>4|(V&252645135)<<4;V=(V&4278255360)>>>8|(V&16711935)<<8;\n N.r[R]=(V>>>16|V<<16)>>>17}function n(A,l,M){while(l--!=0)A.push(0,M)}for(var R=0;R<32;R++){N.q[R]=N.S[R]<<3|N.T[R];\n N.c[R]=N.p[R]<<4|N.z[R]}n(N._,144,8);n(N._,255-143,9);n(N._,279-255,7);n(N._,287-279,8);H.H.n(N._,9);\n H.H.A(N._,9,N.J);H.H.l(N._,9);n(N.$,32,5);H.H.n(N.$,5);H.H.A(N.$,5,N.h);H.H.l(N.$,5);n(N.Q,19,0);n(N.C,286,0);\n n(N.D,30,0);n(N.v,320,0)}());return H.H.N}()\n \n const UZIP = {}\n UZIP["parse"] = ').concat(UZIP_1.parse,"\n UZIP._readLocal = ").concat(UZIP_1._readLocal,"\n UZIP.inflateRaw = ").concat(UZIP_1.inflateRaw,"\n UZIP.inflate = ").concat(UZIP_1.inflate,"\n UZIP.deflate = ").concat(UZIP_1.deflate,"\n UZIP.deflateRaw = ").concat(UZIP_1.deflateRaw,"\n UZIP.encode = ").concat(UZIP_1.encode,"\n UZIP._noNeed = ").concat(UZIP_1._noNeed,"\n UZIP._writeHeader = ").concat(UZIP_1._writeHeader,"\n UZIP.crc = parse(").concat(stringify(UZIP_1.crc),")\n UZIP.crc.table = ( function() {\n var tab = new Uint32Array(256);\n for (var n=0; n<256; n++) {\n var c = n;\n for (var k=0; k<8; k++) {\n if (c & 1) c = 0xedb88320 ^ (c >>> 1);\n else c = c >>> 1;\n }\n tab[n] = c; }\n return tab; })()\n \n UZIP.adler = ").concat(UZIP_1.adler,"\n UZIP.bin = parse(").concat(stringify(UZIP_1.bin),")\n UZIP.F = {}\n UZIP.F.deflateRaw = ").concat(UZIP_1.F.deflateRaw,"\n UZIP.F._bestMatch = ").concat(UZIP_1.F._bestMatch,"\n UZIP.F._howLong = ").concat(UZIP_1.F._howLong,"\n UZIP.F._hash = ").concat(UZIP_1.F._hash,"\n UZIP.saved = ").concat(UZIP_1.saved,"\n UZIP.F._writeBlock = ").concat(UZIP_1.F._writeBlock,"\n UZIP.F._copyExact = ").concat(UZIP_1.F._copyExact,"\n UZIP.F.getTrees = ").concat(UZIP_1.F.getTrees,"\n UZIP.F.getSecond = ").concat(UZIP_1.F.getSecond,"\n UZIP.F.nonZero = ").concat(UZIP_1.F.nonZero,"\n UZIP.F.contSize = ").concat(UZIP_1.F.contSize,"\n UZIP.F._codeTiny = ").concat(UZIP_1.F._codeTiny," \n UZIP.F._lenCodes = ").concat(UZIP_1.F._lenCodes," \n UZIP.F._hufTree = ").concat(UZIP_1.F._hufTree," \n UZIP.F.setDepth = ").concat(UZIP_1.F.setDepth," \n UZIP.F.restrictDepth = ").concat(UZIP_1.F.restrictDepth,"\n UZIP.F._goodIndex = ").concat(UZIP_1.F._goodIndex," \n UZIP.F._writeLit = ").concat(UZIP_1.F._writeLit," \n UZIP.F.inflate = ").concat(UZIP_1.F.inflate," \n UZIP.F._check = ").concat(UZIP_1.F._check," \n UZIP.F._decodeTiny = ").concat(UZIP_1.F._decodeTiny," \n UZIP.F._copyOut = ").concat(UZIP_1.F._copyOut," \n UZIP.F.makeCodes = ").concat(UZIP_1.F.makeCodes," \n UZIP.F.codes2map = ").concat(UZIP_1.F.codes2map," \n UZIP.F.revCodes = ").concat(UZIP_1.F.revCodes," \n\n // used only in deflate\n UZIP.F._putsE = ").concat(UZIP_1.F._putsE,"\n UZIP.F._putsF = ").concat(UZIP_1.F._putsF,"\n \n UZIP.F._bitsE = ").concat(UZIP_1.F._bitsE,"\n UZIP.F._bitsF = ").concat(UZIP_1.F._bitsF,"\n\n UZIP.F._get17 = ").concat(UZIP_1.F._get17,"\n UZIP.F._get25 = ").concat(UZIP_1.F._get25,"\n UZIP.F.U = function(){\n var u16=Uint16Array, u32=Uint32Array;\n return {\n next_code : new u16(16),\n bl_count : new u16(16),\n ordr : [ 16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15 ],\n of0 : [3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,999,999,999],\n exb : [0,0,0,0,0,0,0, 0, 1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3, 4, 4, 4, 4, 5, 5, 5, 5, 0, 0, 0, 0],\n ldef : new u16(32),\n df0 : [1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577, 65535, 65535],\n dxb : [0,0,0,0,1,1,2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8, 9, 9, 10, 10, 11, 11, 12, 12, 13, 13, 0, 0],\n ddef : new u32(32),\n flmap: new u16( 512), fltree: [],\n fdmap: new u16( 32), fdtree: [],\n lmap : new u16(32768), ltree : [], ttree:[],\n dmap : new u16(32768), dtree : [],\n imap : new u16( 512), itree : [],\n //rev9 : new u16( 512)\n rev15: new u16(1<<15),\n lhst : new u32(286), dhst : new u32( 30), ihst : new u32(19),\n lits : new u32(15000),\n strt : new u16(1<<16),\n prev : new u16(1<<15)\n };\n } ();\n\n (function(){\n var U = UZIP.F.U;\n var len = 1<<15;\n for(var i=0; i>> 1) | ((x & 0x55555555) << 1));\n x = (((x & 0xcccccccc) >>> 2) | ((x & 0x33333333) << 2));\n x = (((x & 0xf0f0f0f0) >>> 4) | ((x & 0x0f0f0f0f) << 4));\n x = (((x & 0xff00ff00) >>> 8) | ((x & 0x00ff00ff) << 8));\n U.rev15[i] = (((x >>> 16) | (x << 16)))>>>17;\n }\n \n function pushV(tgt, n, sv) { while(n--!=0) tgt.push(0,sv); }\n \n for(var i=0; i<32; i++) { U.ldef[i]=(U.of0[i]<<3)|U.exb[i]; U.ddef[i]=(U.df0[i]<<4)|U.dxb[i]; }\n \n pushV(U.fltree, 144, 8); pushV(U.fltree, 255-143, 9); pushV(U.fltree, 279-255, 7); pushV(U.fltree,287-279,8);\n /*\n var i = 0;\n for(; i<=143; i++) U.fltree.push(0,8);\n for(; i<=255; i++) U.fltree.push(0,9);\n for(; i<=279; i++) U.fltree.push(0,7);\n for(; i<=287; i++) U.fltree.push(0,8);\n */\n UZIP.F.makeCodes(U.fltree, 9);\n UZIP.F.codes2map(U.fltree, 9, U.flmap);\n UZIP.F.revCodes (U.fltree, 9)\n \n pushV(U.fdtree,32,5);\n //for(i=0;i<32; i++) U.fdtree.push(0,5);\n UZIP.F.makeCodes(U.fdtree, 5);\n UZIP.F.codes2map(U.fdtree, 5, U.fdmap);\n UZIP.F.revCodes (U.fdtree, 5)\n \n pushV(U.itree,19,0); pushV(U.ltree,286,0); pushV(U.dtree,30,0); pushV(U.ttree,320,0);\n /*\n for(var i=0; i< 19; i++) U.itree.push(0,0);\n for(var i=0; i<286; i++) U.ltree.push(0,0);\n for(var i=0; i< 30; i++) U.dtree.push(0,0);\n for(var i=0; i<320; i++) U.ttree.push(0,0);\n */\n })()\n "))}function generateWorkerScript(){return createWorker("\n let scriptImported = false\n self.addEventListener('message', async (e) => {\n const { file, id, imageCompressionLibUrl, options } = e.data\n options.onProgress = (progress) => self.postMessage({ progress, id })\n try {\n if (!scriptImported) {\n // console.log('[worker] importScripts', imageCompressionLibUrl)\n self.importScripts(imageCompressionLibUrl)\n scriptImported = true\n }\n // console.log('[worker] self', self)\n const compressedFile = await imageCompression(file, options)\n self.postMessage({ file: compressedFile, id })\n } catch (e) {\n // console.error('[worker] error', e)\n self.postMessage({ error: e.message + '\\n' + e.stack, id })\n }\n })\n ")}function compressOnWebWorker(e,r){return new Promise((function(t,a){return new Promise((function(i,f){var c=cnt++;return imageCompressionLibUrl||(imageCompressionLibUrl=generateLib()),worker||(worker=generateWorkerScript()),worker.addEventListener("message",(function handler(e){if(e.data.id===c){if(void 0!==e.data.progress)return void r.onProgress(e.data.progress);worker.removeEventListener("message",handler),e.data.error&&a(new Error(e.data.error)),t(e.data.file)}})),worker.addEventListener("error",a),worker.postMessage({file:e,id:c,imageCompressionLibUrl:imageCompressionLibUrl,options:_objectSpread2(_objectSpread2({},r),{},{onProgress:void 0})}),i()}))}))}function imageCompression(e,r){return new Promise((function(t,a){var i,f,c,s,l;if(f=0,r.maxSizeMB=r.maxSizeMB||Number.POSITIVE_INFINITY,s="boolean"!=typeof r.useWebWorker||r.useWebWorker,delete r.useWebWorker,c=r.onProgress,r.onProgress=function(e){f=e,"function"==typeof c&&c(f)},!(e instanceof Blob||e instanceof CustomFile))return a(new Error("The file given is not an instance of Blob or File"));if(!/^image/.test(e.type))return a(new Error("The file given is not an image"));if(l="undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope,!s||"function"!=typeof Worker||l)return compress(e,r).then(function(e){try{return i=e,$If_3.call(this)}catch(e){return a(e)}}.bind(this),a);var u=function(){try{return $If_3.call(this)}catch(e){return a(e)}}.bind(this),d=function $Try_1_Catch(t){try{return compress(e,r).then((function(e){try{return i=e,u()}catch(e){return a(e)}}),a)}catch(e){return a(e)}};try{return compressOnWebWorker(e,r).then((function(e){try{return i=e,u()}catch(e){return d()}}),d)}catch(e){d()}function $If_3(){try{i.name=e.name,i.lastModified=e.lastModified}catch(e){}return t(i)}}))}imageCompression.getDataUrlFromFile=getDataUrlFromFile,imageCompression.getFilefromDataUrl=getFilefromDataUrl,imageCompression.loadImage=loadImage,imageCompression.drawImageInCanvas=drawImageInCanvas,imageCompression.drawFileInCanvas=drawFileInCanvas,imageCompression.canvasToFile=canvasToFile,imageCompression.getExifOrientation=getExifOrientation,imageCompression.handleMaxWidthOrHeight=handleMaxWidthOrHeight,imageCompression.followExifOrientation=followExifOrientation,imageCompression.cleanupCanvasMemory=cleanupCanvasMemory,imageCompression.isAutoOrientationInBrowser=isAutoOrientationInBrowser,imageCompression.version="1.0.14";export default imageCompression; +function ownKeys$1(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);r&&(a=a.filter((function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable}))),t.push.apply(t,a)}return t}function _objectSpread2(e){for(var r=1;re.length)&&(r=e.length);for(var t=0,a=new Array(r);t=74)&&(match=engineUserAgent.match(/Chrome\/(\d+)/),match&&(version=match[1])));var engineV8Version=version&&+version,fails=function(e){try{return!!e()}catch(e){return!0}},nativeSymbol=!!Object.getOwnPropertySymbols&&!fails((function(){var e=Symbol();return!String(e)||!(Object(e)instanceof Symbol)||!Symbol.sham&&engineV8Version&&engineV8Version<41})),useSymbolAsUid=nativeSymbol&&!Symbol.sham&&"symbol"==typeof Symbol.iterator,WellKnownSymbolsStore=shared("wks"),Symbol$1=global$1.Symbol,createWellKnownSymbol=useSymbolAsUid?Symbol$1:Symbol$1&&Symbol$1.withoutSetter||uid,wellKnownSymbol=function(e){return has$1(WellKnownSymbolsStore,e)&&(nativeSymbol||"string"==typeof WellKnownSymbolsStore[e])||(nativeSymbol&&has$1(Symbol$1,e)?WellKnownSymbolsStore[e]=Symbol$1[e]:WellKnownSymbolsStore[e]=createWellKnownSymbol("Symbol."+e)),WellKnownSymbolsStore[e]},TO_STRING_TAG$4=wellKnownSymbol("toStringTag"),test$1={};test$1[TO_STRING_TAG$4]="z";var toStringTagSupport="[object z]"===String(test$1),descriptors=!fails((function(){return 7!=Object.defineProperty({},1,{get:function(){return 7}})[1]})),isObject=function(e){return"object"==typeof e?null!==e:"function"==typeof e},document$3=global$1.document,EXISTS=isObject(document$3)&&isObject(document$3.createElement),documentCreateElement=function(e){return EXISTS?document$3.createElement(e):{}},ie8DomDefine=!descriptors&&!fails((function(){return 7!=Object.defineProperty(documentCreateElement("div"),"a",{get:function(){return 7}}).a})),anObject=function(e){if(!isObject(e))throw TypeError(String(e)+" is not an object");return e},isSymbol=useSymbolAsUid?function(e){return"symbol"==typeof e}:function(e){var r=getBuiltIn("Symbol");return"function"==typeof r&&Object(e)instanceof r},ordinaryToPrimitive=function(e,r){var t,a;if("string"===r&&"function"==typeof(t=e.toString)&&!isObject(a=t.call(e)))return a;if("function"==typeof(t=e.valueOf)&&!isObject(a=t.call(e)))return a;if("string"!==r&&"function"==typeof(t=e.toString)&&!isObject(a=t.call(e)))return a;throw TypeError("Can't convert object to primitive value")},TO_PRIMITIVE=wellKnownSymbol("toPrimitive"),toPrimitive=function(e,r){if(!isObject(e)||isSymbol(e))return e;var t,a=e[TO_PRIMITIVE];if(void 0!==a){if(void 0===r&&(r="default"),t=a.call(e,r),!isObject(t)||isSymbol(t))return t;throw TypeError("Can't convert object to primitive value")}return void 0===r&&(r="number"),ordinaryToPrimitive(e,r)},toPropertyKey=function(e){var r=toPrimitive(e,"string");return isSymbol(r)?r:String(r)},$defineProperty=Object.defineProperty,f$5=descriptors?$defineProperty:function defineProperty(e,r,t){if(anObject(e),r=toPropertyKey(r),anObject(t),ie8DomDefine)try{return $defineProperty(e,r,t)}catch(e){}if("get"in t||"set"in t)throw TypeError("Accessors not supported");return"value"in t&&(e[r]=t.value),e},objectDefineProperty={f:f$5},createPropertyDescriptor=function(e,r){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:r}},createNonEnumerableProperty=descriptors?function(e,r,t){return objectDefineProperty.f(e,r,createPropertyDescriptor(1,t))}:function(e,r,t){return e[r]=t,e},functionToString=Function.toString;"function"!=typeof sharedStore.inspectSource&&(sharedStore.inspectSource=function(e){return functionToString.call(e)});var inspectSource=sharedStore.inspectSource,WeakMap$1=global$1.WeakMap,nativeWeakMap="function"==typeof WeakMap$1&&/native code/.test(inspectSource(WeakMap$1)),keys$2=shared("keys"),sharedKey=function(e){return keys$2[e]||(keys$2[e]=uid(e))},hiddenKeys$1={},OBJECT_ALREADY_INITIALIZED="Object already initialized",WeakMap=global$1.WeakMap,set$2,get$1,has,enforce=function(e){return has(e)?get$1(e):set$2(e,{})},getterFor=function(e){return function(r){var t;if(!isObject(r)||(t=get$1(r)).type!==e)throw TypeError("Incompatible receiver, "+e+" required");return t}};if(nativeWeakMap||sharedStore.state){var store=sharedStore.state||(sharedStore.state=new WeakMap),wmget=store.get,wmhas=store.has,wmset=store.set;set$2=function(e,r){if(wmhas.call(store,e))throw new TypeError(OBJECT_ALREADY_INITIALIZED);return r.facade=e,wmset.call(store,e,r),r},get$1=function(e){return wmget.call(store,e)||{}},has=function(e){return wmhas.call(store,e)}}else{var STATE=sharedKey("state");hiddenKeys$1[STATE]=!0,set$2=function(e,r){if(has$1(e,STATE))throw new TypeError(OBJECT_ALREADY_INITIALIZED);return r.facade=e,createNonEnumerableProperty(e,STATE,r),r},get$1=function(e){return has$1(e,STATE)?e[STATE]:{}},has=function(e){return has$1(e,STATE)}}var internalState={set:set$2,get:get$1,has:has,enforce:enforce,getterFor:getterFor},redefine=createCommonjsModule((function(e){var r=internalState.get,t=internalState.enforce,a=String(String).split("String");(e.exports=function(e,r,i,s){var c,l=!!s&&!!s.unsafe,u=!!s&&!!s.enumerable,p=!!s&&!!s.noTargetGet;"function"==typeof i&&("string"!=typeof r||has$1(i,"name")||createNonEnumerableProperty(i,"name",r),(c=t(i)).source||(c.source=a.join("string"==typeof r?r:""))),e!==global$1?(l?!p&&e[r]&&(u=!0):delete e[r],u?e[r]=i:createNonEnumerableProperty(e,r,i)):u?e[r]=i:setGlobal(r,i)})(Function.prototype,"toString",(function toString(){return"function"==typeof this&&r(this).source||inspectSource(this)}))})),toString$1={}.toString,classofRaw=function(e){return toString$1.call(e).slice(8,-1)},TO_STRING_TAG$3=wellKnownSymbol("toStringTag"),CORRECT_ARGUMENTS="Arguments"==classofRaw(function(){return arguments}()),tryGet=function(e,r){try{return e[r]}catch(e){}},classof=toStringTagSupport?classofRaw:function(e){var r,t,a;return void 0===e?"Undefined":null===e?"Null":"string"==typeof(t=tryGet(r=Object(e),TO_STRING_TAG$3))?t:CORRECT_ARGUMENTS?classofRaw(r):"Object"==(a=classofRaw(r))&&"function"==typeof r.callee?"Arguments":a},objectToString=toStringTagSupport?{}.toString:function toString(){return"[object "+classof(this)+"]"};toStringTagSupport||redefine(Object.prototype,"toString",objectToString,{unsafe:!0});var $propertyIsEnumerable={}.propertyIsEnumerable,getOwnPropertyDescriptor$4=Object.getOwnPropertyDescriptor,NASHORN_BUG=getOwnPropertyDescriptor$4&&!$propertyIsEnumerable.call({1:2},1),f$4=NASHORN_BUG?function propertyIsEnumerable(e){var r=getOwnPropertyDescriptor$4(this,e);return!!r&&r.enumerable}:$propertyIsEnumerable,objectPropertyIsEnumerable={f:f$4},split="".split,indexedObject=fails((function(){return!Object("z").propertyIsEnumerable(0)}))?function(e){return"String"==classofRaw(e)?split.call(e,""):Object(e)}:Object,toIndexedObject=function(e){return indexedObject(requireObjectCoercible(e))},$getOwnPropertyDescriptor=Object.getOwnPropertyDescriptor,f$3=descriptors?$getOwnPropertyDescriptor:function getOwnPropertyDescriptor(e,r){if(e=toIndexedObject(e),r=toPropertyKey(r),ie8DomDefine)try{return $getOwnPropertyDescriptor(e,r)}catch(e){}if(has$1(e,r))return createPropertyDescriptor(!objectPropertyIsEnumerable.f.call(e,r),e[r])},objectGetOwnPropertyDescriptor={f:f$3},ceil=Math.ceil,floor$7=Math.floor,toInteger=function(e){return isNaN(e=+e)?0:(e>0?floor$7:ceil)(e)},min$6=Math.min,toLength=function(e){return e>0?min$6(toInteger(e),9007199254740991):0},max$2=Math.max,min$5=Math.min,toAbsoluteIndex=function(e,r){var t=toInteger(e);return t<0?max$2(t+r,0):min$5(t,r)},createMethod$5=function(e){return function(r,t,a){var i,s=toIndexedObject(r),c=toLength(s.length),l=toAbsoluteIndex(a,c);if(e&&t!=t){for(;c>l;)if((i=s[l++])!=i)return!0}else for(;c>l;l++)if((e||l in s)&&s[l]===t)return e||l||0;return!e&&-1}},arrayIncludes={includes:createMethod$5(!0),indexOf:createMethod$5(!1)},indexOf=arrayIncludes.indexOf,objectKeysInternal=function(e,r){var t,a=toIndexedObject(e),i=0,s=[];for(t in a)!has$1(hiddenKeys$1,t)&&has$1(a,t)&&s.push(t);for(;r.length>i;)has$1(a,t=r[i++])&&(~indexOf(s,t)||s.push(t));return s},enumBugKeys=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"],hiddenKeys=enumBugKeys.concat("length","prototype"),f$2=Object.getOwnPropertyNames||function getOwnPropertyNames(e){return objectKeysInternal(e,hiddenKeys)},objectGetOwnPropertyNames={f:f$2},f$1=Object.getOwnPropertySymbols,objectGetOwnPropertySymbols={f:f$1},ownKeys=getBuiltIn("Reflect","ownKeys")||function ownKeys(e){var r=objectGetOwnPropertyNames.f(anObject(e)),t=objectGetOwnPropertySymbols.f;return t?r.concat(t(e)):r},copyConstructorProperties=function(e,r){for(var t=ownKeys(r),a=objectDefineProperty.f,i=objectGetOwnPropertyDescriptor.f,s=0;ss;s++)if((l=callFn(e[s]))&&l instanceof Result)return l;return new Result(!1)}a=i.call(e)}for(u=a.next;!(p=u.call(a)).done;){try{l=callFn(p.value)}catch(e){throw iteratorClose(a),e}if("object"==typeof l&&l&&l instanceof Result)return l}return new Result(!1)},ITERATOR$6=wellKnownSymbol("iterator"),SAFE_CLOSING=!1;try{var called=0,iteratorWithReturn={next:function(){return{done:!!called++}},return:function(){SAFE_CLOSING=!0}};iteratorWithReturn[ITERATOR$6]=function(){return this},Array.from(iteratorWithReturn,(function(){throw 2}))}catch(e){}var checkCorrectnessOfIteration=function(e,r){if(!r&&!SAFE_CLOSING)return!1;var t=!1;try{var a={};a[ITERATOR$6]=function(){return{next:function(){return{done:t=!0}}}},e(a)}catch(e){}return t},SPECIES$5=wellKnownSymbol("species"),speciesConstructor=function(e,r){var t,a=anObject(e).constructor;return void 0===a||null==(t=anObject(a)[SPECIES$5])?r:aFunction(t)},html=getBuiltIn("document","documentElement"),engineIsIos=/(?:iphone|ipod|ipad).*applewebkit/i.test(engineUserAgent),engineIsNode="process"==classofRaw(global$1.process),set$1=global$1.setImmediate,clear=global$1.clearImmediate,process$2=global$1.process,MessageChannel=global$1.MessageChannel,Dispatch=global$1.Dispatch,counter=0,queue={},ONREADYSTATECHANGE="onreadystatechange",location,defer,channel,port;try{location=global$1.location}catch(e){}var run=function(e){if(queue.hasOwnProperty(e)){var r=queue[e];delete queue[e],r()}},runner=function(e){return function(){run(e)}},listener=function(e){run(e.data)},post=function(e){global$1.postMessage(String(e),location.protocol+"//"+location.host)};set$1&&clear||(set$1=function setImmediate(e){for(var r=[],t=arguments.length,a=1;t>a;)r.push(arguments[a++]);return queue[++counter]=function(){("function"==typeof e?e:Function(e)).apply(void 0,r)},defer(counter),counter},clear=function clearImmediate(e){delete queue[e]},engineIsNode?defer=function(e){process$2.nextTick(runner(e))}:Dispatch&&Dispatch.now?defer=function(e){Dispatch.now(runner(e))}:MessageChannel&&!engineIsIos?(channel=new MessageChannel,port=channel.port2,channel.port1.onmessage=listener,defer=functionBindContext(port.postMessage,port,1)):global$1.addEventListener&&"function"==typeof postMessage&&!global$1.importScripts&&location&&"file:"!==location.protocol&&!fails(post)?(defer=post,global$1.addEventListener("message",listener,!1)):defer=ONREADYSTATECHANGE in documentCreateElement("script")?function(e){html.appendChild(documentCreateElement("script"))[ONREADYSTATECHANGE]=function(){html.removeChild(this),run(e)}}:function(e){setTimeout(runner(e),0)});var task$1={set:set$1,clear:clear},engineIsIosPebble=/iphone|ipod|ipad/i.test(engineUserAgent)&&void 0!==global$1.Pebble,engineIsWebosWebkit=/web0s(?!.*chrome)/i.test(engineUserAgent),getOwnPropertyDescriptor$2=objectGetOwnPropertyDescriptor.f,macrotask=task$1.set,MutationObserver=global$1.MutationObserver||global$1.WebKitMutationObserver,document$2=global$1.document,process$1=global$1.process,Promise$1=global$1.Promise,queueMicrotaskDescriptor=getOwnPropertyDescriptor$2(global$1,"queueMicrotask"),queueMicrotask=queueMicrotaskDescriptor&&queueMicrotaskDescriptor.value,flush,head,last,notify$1,toggle,node,promise,then;queueMicrotask||(flush=function(){var e,r;for(engineIsNode&&(e=process$1.domain)&&e.exit();head;){r=head.fn,head=head.next;try{r()}catch(e){throw head?notify$1():last=void 0,e}}last=void 0,e&&e.enter()},engineIsIos||engineIsNode||engineIsWebosWebkit||!MutationObserver||!document$2?!engineIsIosPebble&&Promise$1&&Promise$1.resolve?(promise=Promise$1.resolve(void 0),promise.constructor=Promise$1,then=promise.then,notify$1=function(){then.call(promise,flush)}):notify$1=engineIsNode?function(){process$1.nextTick(flush)}:function(){macrotask.call(global$1,flush)}:(toggle=!0,node=document$2.createTextNode(""),new MutationObserver(flush).observe(node,{characterData:!0}),notify$1=function(){node.data=toggle=!toggle}));var microtask=queueMicrotask||function(e){var r={fn:e,next:void 0};last&&(last.next=r),head||(head=r,notify$1()),last=r},PromiseCapability=function(e){var r,t;this.promise=new e((function(e,a){if(void 0!==r||void 0!==t)throw TypeError("Bad Promise constructor");r=e,t=a})),this.resolve=aFunction(r),this.reject=aFunction(t)},f=function(e){return new PromiseCapability(e)},newPromiseCapability$1={f:f},promiseResolve=function(e,r){if(anObject(e),isObject(r)&&r.constructor===e)return r;var t=newPromiseCapability$1.f(e);return(0,t.resolve)(r),t.promise},hostReportErrors=function(e,r){var t=global$1.console;t&&t.error&&(1===arguments.length?t.error(e):t.error(e,r))},perform=function(e){try{return{error:!1,value:e()}}catch(e){return{error:!0,value:e}}},engineIsBrowser="object"==typeof window,task=task$1.set,SPECIES$4=wellKnownSymbol("species"),PROMISE="Promise",getInternalState$4=internalState.get,setInternalState$5=internalState.set,getInternalPromiseState=internalState.getterFor(PROMISE),NativePromisePrototype=nativePromiseConstructor&&nativePromiseConstructor.prototype,PromiseConstructor=nativePromiseConstructor,PromiseConstructorPrototype=NativePromisePrototype,TypeError$1=global$1.TypeError,document$1=global$1.document,process=global$1.process,newPromiseCapability=newPromiseCapability$1.f,newGenericPromiseCapability=newPromiseCapability,DISPATCH_EVENT=!!(document$1&&document$1.createEvent&&global$1.dispatchEvent),NATIVE_REJECTION_EVENT="function"==typeof PromiseRejectionEvent,UNHANDLED_REJECTION="unhandledrejection",REJECTION_HANDLED="rejectionhandled",PENDING=0,FULFILLED=1,REJECTED=2,HANDLED=1,UNHANDLED=2,SUBCLASSING=!1,Internal,OwnPromiseCapability,PromiseWrapper,nativeThen,FORCED$6=isForced_1(PROMISE,(function(){var e=inspectSource(PromiseConstructor),r=e!==String(PromiseConstructor);if(!r&&66===engineV8Version)return!0;if(engineV8Version>=51&&/native code/.test(e))return!1;var t=new PromiseConstructor((function(e){e(1)})),FakePromise=function(e){e((function(){}),(function(){}))};return(t.constructor={})[SPECIES$4]=FakePromise,!(SUBCLASSING=t.then((function(){}))instanceof FakePromise)||!r&&engineIsBrowser&&!NATIVE_REJECTION_EVENT})),INCORRECT_ITERATION=FORCED$6||!checkCorrectnessOfIteration((function(e){PromiseConstructor.all(e).catch((function(){}))})),isThenable=function(e){var r;return!(!isObject(e)||"function"!=typeof(r=e.then))&&r},notify=function(e,r){if(!e.notified){e.notified=!0;var t=e.reactions;microtask((function(){for(var a=e.value,i=e.state==FULFILLED,s=0;t.length>s;){var c,l,u,p=t[s++],d=i?p.ok:p.fail,y=p.resolve,h=p.reject,A=p.domain;try{d?(i||(e.rejection===UNHANDLED&&onHandleUnhandled(e),e.rejection=HANDLED),!0===d?c=a:(A&&A.enter(),c=d(a),A&&(A.exit(),u=!0)),c===p.promise?h(TypeError$1("Promise-chain cycle")):(l=isThenable(c))?l.call(c,y,h):y(c)):h(a)}catch(e){A&&!u&&A.exit(),h(e)}}e.reactions=[],e.notified=!1,r&&!e.rejection&&onUnhandled(e)}))}},dispatchEvent=function(e,r,t){var a,i;DISPATCH_EVENT?((a=document$1.createEvent("Event")).promise=r,a.reason=t,a.initEvent(e,!1,!0),global$1.dispatchEvent(a)):a={promise:r,reason:t},!NATIVE_REJECTION_EVENT&&(i=global$1["on"+e])?i(a):e===UNHANDLED_REJECTION&&hostReportErrors("Unhandled promise rejection",t)},onUnhandled=function(e){task.call(global$1,(function(){var r,t=e.facade,a=e.value;if(isUnhandled(e)&&(r=perform((function(){engineIsNode?process.emit("unhandledRejection",a,t):dispatchEvent(UNHANDLED_REJECTION,t,a)})),e.rejection=engineIsNode||isUnhandled(e)?UNHANDLED:HANDLED,r.error))throw r.value}))},isUnhandled=function(e){return e.rejection!==HANDLED&&!e.parent},onHandleUnhandled=function(e){task.call(global$1,(function(){var r=e.facade;engineIsNode?process.emit("rejectionHandled",r):dispatchEvent(REJECTION_HANDLED,r,e.value)}))},bind=function(e,r,t){return function(a){e(r,a,t)}},internalReject=function(e,r,t){e.done||(e.done=!0,t&&(e=t),e.value=r,e.state=REJECTED,notify(e,!0))},internalResolve=function(e,r,t){if(!e.done){e.done=!0,t&&(e=t);try{if(e.facade===r)throw TypeError$1("Promise can't be resolved itself");var a=isThenable(r);a?microtask((function(){var t={done:!1};try{a.call(r,bind(internalResolve,t,e),bind(internalReject,t,e))}catch(r){internalReject(t,r,e)}})):(e.value=r,e.state=FULFILLED,notify(e,!1))}catch(r){internalReject({done:!1},r,e)}}};if(FORCED$6&&(PromiseConstructor=function Promise(e){anInstance(this,PromiseConstructor,PROMISE),aFunction(e),Internal.call(this);var r=getInternalState$4(this);try{e(bind(internalResolve,r),bind(internalReject,r))}catch(e){internalReject(r,e)}},PromiseConstructorPrototype=PromiseConstructor.prototype,Internal=function Promise(e){setInternalState$5(this,{type:PROMISE,done:!1,notified:!1,parent:!1,reactions:[],rejection:!1,state:PENDING,value:void 0})},Internal.prototype=redefineAll(PromiseConstructorPrototype,{then:function then(e,r){var t=getInternalPromiseState(this),a=newPromiseCapability(speciesConstructor(this,PromiseConstructor));return a.ok="function"!=typeof e||e,a.fail="function"==typeof r&&r,a.domain=engineIsNode?process.domain:void 0,t.parent=!0,t.reactions.push(a),t.state!=PENDING&¬ify(t,!1),a.promise},catch:function(e){return this.then(void 0,e)}}),OwnPromiseCapability=function(){var e=new Internal,r=getInternalState$4(e);this.promise=e,this.resolve=bind(internalResolve,r),this.reject=bind(internalReject,r)},newPromiseCapability$1.f=newPromiseCapability=function(e){return e===PromiseConstructor||e===PromiseWrapper?new OwnPromiseCapability(e):newGenericPromiseCapability(e)},"function"==typeof nativePromiseConstructor&&NativePromisePrototype!==Object.prototype)){nativeThen=NativePromisePrototype.then,SUBCLASSING||(redefine(NativePromisePrototype,"then",(function then(e,r){var t=this;return new PromiseConstructor((function(e,r){nativeThen.call(t,e,r)})).then(e,r)}),{unsafe:!0}),redefine(NativePromisePrototype,"catch",PromiseConstructorPrototype.catch,{unsafe:!0}));try{delete NativePromisePrototype.constructor}catch(e){}objectSetPrototypeOf&&objectSetPrototypeOf(NativePromisePrototype,PromiseConstructorPrototype)}_export({global:!0,wrap:!0,forced:FORCED$6},{Promise:PromiseConstructor}),setToStringTag(PromiseConstructor,PROMISE,!1),setSpecies(PROMISE),PromiseWrapper=getBuiltIn(PROMISE),_export({target:PROMISE,stat:!0,forced:FORCED$6},{reject:function reject(e){var r=newPromiseCapability(this);return r.reject.call(void 0,e),r.promise}}),_export({target:PROMISE,stat:!0,forced:FORCED$6},{resolve:function resolve(e){return promiseResolve(this,e)}}),_export({target:PROMISE,stat:!0,forced:INCORRECT_ITERATION},{all:function all(e){var r=this,t=newPromiseCapability(r),a=t.resolve,i=t.reject,s=perform((function(){var t=aFunction(r.resolve),s=[],c=0,l=1;iterate(e,(function(e){var u=c++,p=!1;s.push(void 0),l++,t.call(r,e).then((function(e){p||(p=!0,s[u]=e,--l||a(s))}),i)})),--l||a(s)}));return s.error&&i(s.value),t.promise},race:function race(e){var r=this,t=newPromiseCapability(r),a=t.reject,i=perform((function(){var i=aFunction(r.resolve);iterate(e,(function(e){i.call(r,e).then(t.resolve,a)}))}));return i.error&&a(i.value),t.promise}});var inheritIfRequired=function(e,r,t){var a,i;return objectSetPrototypeOf&&"function"==typeof(a=r.constructor)&&a!==t&&isObject(i=a.prototype)&&i!==t.prototype&&objectSetPrototypeOf(e,i),e},objectKeys=Object.keys||function keys(e){return objectKeysInternal(e,enumBugKeys)},objectDefineProperties=descriptors?Object.defineProperties:function defineProperties(e,r){anObject(e);for(var t,a=objectKeys(r),i=a.length,s=0;i>s;)objectDefineProperty.f(e,t=a[s++],r[t]);return e},GT=">",LT="<",PROTOTYPE$1="prototype",SCRIPT="script",IE_PROTO$1=sharedKey("IE_PROTO"),EmptyConstructor=function(){},scriptTag=function(e){return LT+SCRIPT+GT+e+LT+"/"+SCRIPT+GT},NullProtoObjectViaActiveX=function(e){e.write(scriptTag("")),e.close();var r=e.parentWindow.Object;return e=null,r},NullProtoObjectViaIFrame=function(){var e,r=documentCreateElement("iframe"),t="java"+SCRIPT+":";if(r.style)return r.style.display="none",html.appendChild(r),r.src=String(t),(e=r.contentWindow.document).open(),e.write(scriptTag("document.F=Object")),e.close(),e.F},activeXDocument,NullProtoObject=function(){try{activeXDocument=new ActiveXObject("htmlfile")}catch(e){}NullProtoObject=document.domain&&activeXDocument?NullProtoObjectViaActiveX(activeXDocument):NullProtoObjectViaIFrame()||NullProtoObjectViaActiveX(activeXDocument);for(var e=enumBugKeys.length;e--;)delete NullProtoObject[PROTOTYPE$1][enumBugKeys[e]];return NullProtoObject()};hiddenKeys$1[IE_PROTO$1]=!0;var objectCreate=Object.create||function create(e,r){var t;return null!==e?(EmptyConstructor[PROTOTYPE$1]=anObject(e),t=new EmptyConstructor,EmptyConstructor[PROTOTYPE$1]=null,t[IE_PROTO$1]=e):t=NullProtoObject(),void 0===r?t:objectDefineProperties(t,r)},toString=function(e){if(isSymbol(e))throw TypeError("Cannot convert a Symbol value to a string");return String(e)},whitespaces="\t\n\v\f\r                 \u2028\u2029\ufeff",whitespace="["+whitespaces+"]",ltrim=RegExp("^"+whitespace+whitespace+"*"),rtrim=RegExp(whitespace+whitespace+"*$"),createMethod$4=function(e){return function(r){var t=toString(requireObjectCoercible(r));return 1&e&&(t=t.replace(ltrim,"")),2&e&&(t=t.replace(rtrim,"")),t}},stringTrim={start:createMethod$4(1),end:createMethod$4(2),trim:createMethod$4(3)},getOwnPropertyNames$1=objectGetOwnPropertyNames.f,getOwnPropertyDescriptor$1=objectGetOwnPropertyDescriptor.f,defineProperty$4=objectDefineProperty.f,trim=stringTrim.trim,NUMBER="Number",NativeNumber=global$1[NUMBER],NumberPrototype=NativeNumber.prototype,BROKEN_CLASSOF=classofRaw(objectCreate(NumberPrototype))==NUMBER,toNumber=function(e){if(isSymbol(e))throw TypeError("Cannot convert a Symbol value to a number");var r,t,a,i,s,c,l,u,p=toPrimitive(e,"number");if("string"==typeof p&&p.length>2)if(43===(r=(p=trim(p)).charCodeAt(0))||45===r){if(88===(t=p.charCodeAt(2))||120===t)return NaN}else if(48===r){switch(p.charCodeAt(1)){case 66:case 98:a=2,i=49;break;case 79:case 111:a=8,i=55;break;default:return+p}for(c=(s=p.slice(2)).length,l=0;li)return NaN;return parseInt(s,a)}return+p};if(isForced_1(NUMBER,!NativeNumber(" 0o1")||!NativeNumber("0b1")||NativeNumber("+0x1"))){for(var NumberWrapper=function Number(e){var r=arguments.length<1?0:e,t=this;return t instanceof NumberWrapper&&(BROKEN_CLASSOF?fails((function(){NumberPrototype.valueOf.call(t)})):classofRaw(t)!=NUMBER)?inheritIfRequired(new NativeNumber(toNumber(r)),t,NumberWrapper):toNumber(r)},keys$1=descriptors?getOwnPropertyNames$1(NativeNumber):"MAX_VALUE,MIN_VALUE,NaN,NEGATIVE_INFINITY,POSITIVE_INFINITY,EPSILON,isFinite,isInteger,isNaN,isSafeInteger,MAX_SAFE_INTEGER,MIN_SAFE_INTEGER,parseFloat,parseInt,isInteger,fromString,range".split(","),j$1=0,key$1;keys$1.length>j$1;j$1++)has$1(NativeNumber,key$1=keys$1[j$1])&&!has$1(NumberWrapper,key$1)&&defineProperty$4(NumberWrapper,key$1,getOwnPropertyDescriptor$1(NativeNumber,key$1));NumberWrapper.prototype=NumberPrototype,NumberPrototype.constructor=NumberWrapper,redefine(global$1,NUMBER,NumberWrapper)}var defineProperty$3=objectDefineProperty.f,FunctionPrototype=Function.prototype,FunctionPrototypeToString=FunctionPrototype.toString,nameRE=/^\s*function ([^ (]*)/,NAME$1="name";descriptors&&!(NAME$1 in FunctionPrototype)&&defineProperty$3(FunctionPrototype,NAME$1,{configurable:!0,get:function(){try{return FunctionPrototypeToString.call(this).match(nameRE)[1]}catch(e){return""}}}),_export({global:!0},{globalThis:global$1});var $assign=Object.assign,defineProperty$2=Object.defineProperty,objectAssign=!$assign||fails((function(){if(descriptors&&1!==$assign({b:1},$assign(defineProperty$2({},"a",{enumerable:!0,get:function(){defineProperty$2(this,"b",{value:3,enumerable:!1})}}),{b:2})).b)return!0;var e={},r={},t=Symbol();return e[t]=7,"abcdefghijklmnopqrst".split("").forEach((function(e){r[e]=e})),7!=$assign({},e)[t]||"abcdefghijklmnopqrst"!=objectKeys($assign({},r)).join("")}))?function assign(e,r){for(var t=toObject(e),a=arguments.length,i=1,s=objectGetOwnPropertySymbols.f,c=objectPropertyIsEnumerable.f;a>i;)for(var l,u=indexedObject(arguments[i++]),p=s?objectKeys(u).concat(s(u)):objectKeys(u),d=p.length,y=0;d>y;)l=p[y++],descriptors&&!c.call(u,l)||(t[l]=u[l]);return t}:$assign;_export({target:"Object",stat:!0,forced:Object.assign!==objectAssign},{assign:objectAssign});var path=global$1;path.Object.assign;var regexpFlags=function(){var e=anObject(this),r="";return e.global&&(r+="g"),e.ignoreCase&&(r+="i"),e.multiline&&(r+="m"),e.dotAll&&(r+="s"),e.unicode&&(r+="u"),e.sticky&&(r+="y"),r},RE=function(e,r){return RegExp(e,r)},UNSUPPORTED_Y$2=fails((function(){var e=RE("a","y");return e.lastIndex=2,null!=e.exec("abcd")})),BROKEN_CARET=fails((function(){var e=RE("^r","gy");return e.lastIndex=2,null!=e.exec("str")})),regexpStickyHelpers={UNSUPPORTED_Y:UNSUPPORTED_Y$2,BROKEN_CARET:BROKEN_CARET},regexpUnsupportedDotAll=fails((function(){var e=RegExp(".","string".charAt(0));return!(e.dotAll&&e.exec("\n")&&"s"===e.flags)})),regexpUnsupportedNcg=fails((function(){var e=RegExp("(?b)","string".charAt(5));return"b"!==e.exec("b").groups.a||"bc"!=="b".replace(e,"$c")})),getInternalState$3=internalState.get,nativeExec=RegExp.prototype.exec,nativeReplace=shared("native-string-replace",String.prototype.replace),patchedExec=nativeExec,UPDATES_LAST_INDEX_WRONG=(re1=/a/,re2=/b*/g,nativeExec.call(re1,"a"),nativeExec.call(re2,"a"),0!==re1.lastIndex||0!==re2.lastIndex),re1,re2,UNSUPPORTED_Y$1=regexpStickyHelpers.UNSUPPORTED_Y||regexpStickyHelpers.BROKEN_CARET,NPCG_INCLUDED=void 0!==/()??/.exec("")[1],PATCH=UPDATES_LAST_INDEX_WRONG||NPCG_INCLUDED||UNSUPPORTED_Y$1||regexpUnsupportedDotAll||regexpUnsupportedNcg;PATCH&&(patchedExec=function exec(e){var r,t,a,i,s,c,l,u=this,p=getInternalState$3(u),d=toString(e),y=p.raw;if(y)return y.lastIndex=u.lastIndex,r=patchedExec.call(y,d),u.lastIndex=y.lastIndex,r;var h=p.groups,A=UNSUPPORTED_Y$1&&u.sticky,g=regexpFlags.call(u),v=u.source,m=0,E=d;if(A&&(-1===(g=g.replace("y","")).indexOf("g")&&(g+="g"),E=d.slice(u.lastIndex),u.lastIndex>0&&(!u.multiline||u.multiline&&"\n"!==d.charAt(u.lastIndex-1))&&(v="(?: "+v+")",E=" "+E,m++),t=new RegExp("^(?:"+v+")",g)),NPCG_INCLUDED&&(t=new RegExp("^"+v+"$(?!\\s)",g)),UPDATES_LAST_INDEX_WRONG&&(a=u.lastIndex),i=nativeExec.call(A?t:u,E),A?i?(i.input=i.input.slice(m),i[0]=i[0].slice(m),i.index=u.lastIndex,u.lastIndex+=i[0].length):u.lastIndex=0:UPDATES_LAST_INDEX_WRONG&&i&&(u.lastIndex=u.global?i.index+i[0].length:a),NPCG_INCLUDED&&i&&i.length>1&&nativeReplace.call(i[0],t,(function(){for(s=1;s=l?e?"":void 0:(a=s.charCodeAt(c))<55296||a>56319||c+1===l||(i=s.charCodeAt(c+1))<56320||i>57343?e?s.charAt(c):a:e?s.slice(c,c+2):i-56320+(a-55296<<10)+65536}},stringMultibyte={codeAt:createMethod$3(!1),charAt:createMethod$3(!0)},charAt$1=stringMultibyte.charAt,advanceStringIndex=function(e,r,t){return r+(t?charAt$1(e,r).length:1)},regexpExecAbstract=function(e,r){var t=e.exec;if("function"==typeof t){var a=t.call(e,r);if("object"!=typeof a)throw TypeError("RegExp exec method returned something other than an Object or null");return a}if("RegExp"!==classofRaw(e))throw TypeError("RegExp#exec called on incompatible receiver");return regexpExec.call(e,r)},UNSUPPORTED_Y=regexpStickyHelpers.UNSUPPORTED_Y,arrayPush=[].push,min$4=Math.min,MAX_UINT32=4294967295,SPLIT_WORKS_WITH_OVERWRITTEN_EXEC=!fails((function(){var e=/(?:)/,r=e.exec;e.exec=function(){return r.apply(this,arguments)};var t="ab".split(e);return 2!==t.length||"a"!==t[0]||"b"!==t[1]}));fixRegexpWellKnownSymbolLogic("split",(function(e,r,t){var a;return a="c"=="abbc".split(/(b)*/)[1]||4!="test".split(/(?:)/,-1).length||2!="ab".split(/(?:ab)*/).length||4!=".".split(/(.?)(.?)/).length||".".split(/()()/).length>1||"".split(/.?/).length?function(e,t){var a=toString(requireObjectCoercible(this)),i=void 0===t?MAX_UINT32:t>>>0;if(0===i)return[];if(void 0===e)return[a];if(!isRegexp(e))return r.call(a,e,i);for(var s,c,l,u=[],p=(e.ignoreCase?"i":"")+(e.multiline?"m":"")+(e.unicode?"u":"")+(e.sticky?"y":""),d=0,y=new RegExp(e.source,p+"g");(s=regexpExec.call(y,a))&&!((c=y.lastIndex)>d&&(u.push(a.slice(d,s.index)),s.length>1&&s.index=i));)y.lastIndex===s.index&&y.lastIndex++;return d===a.length?!l&&y.test("")||u.push(""):u.push(a.slice(d)),u.length>i?u.slice(0,i):u}:"0".split(void 0,0).length?function(e,t){return void 0===e&&0===t?[]:r.call(this,e,t)}:r,[function split(r,t){var i=requireObjectCoercible(this),s=null==r?void 0:r[e];return void 0!==s?s.call(r,i,t):a.call(toString(i),r,t)},function(e,i){var s=anObject(this),c=toString(e),l=t(a,s,c,i,a!==r);if(l.done)return l.value;var u=speciesConstructor(s,RegExp),p=s.unicode,d=(s.ignoreCase?"i":"")+(s.multiline?"m":"")+(s.unicode?"u":"")+(UNSUPPORTED_Y?"g":"y"),y=new u(UNSUPPORTED_Y?"^(?:"+s.source+")":s,d),h=void 0===i?MAX_UINT32:i>>>0;if(0===h)return[];if(0===c.length)return null===regexpExecAbstract(y,c)?[c]:[];for(var A=0,g=0,v=[];g=r.length?(e.target=void 0,{value:void 0,done:!0}):"keys"==t?{value:a,done:!1}:"values"==t?{value:r[a],done:!1}:{value:[a,r[a]],done:!1}}),"values");iterators.Arguments=iterators.Array,addToUnscopables("keys"),addToUnscopables("values"),addToUnscopables("entries");var arrayBufferNative="undefined"!=typeof ArrayBuffer&&"undefined"!=typeof DataView,defineProperty$1=objectDefineProperty.f,Int8Array$3=global$1.Int8Array,Int8ArrayPrototype=Int8Array$3&&Int8Array$3.prototype,Uint8ClampedArray=global$1.Uint8ClampedArray,Uint8ClampedArrayPrototype=Uint8ClampedArray&&Uint8ClampedArray.prototype,TypedArray=Int8Array$3&&objectGetPrototypeOf(Int8Array$3),TypedArrayPrototype=Int8ArrayPrototype&&objectGetPrototypeOf(Int8ArrayPrototype),ObjectPrototype$1=Object.prototype,isPrototypeOf=ObjectPrototype$1.isPrototypeOf,TO_STRING_TAG$1=wellKnownSymbol("toStringTag"),TYPED_ARRAY_TAG=uid("TYPED_ARRAY_TAG"),TYPED_ARRAY_CONSTRUCTOR$1=uid("TYPED_ARRAY_CONSTRUCTOR"),NATIVE_ARRAY_BUFFER_VIEWS$1=arrayBufferNative&&!!objectSetPrototypeOf&&"Opera"!==classof(global$1.opera),TYPED_ARRAY_TAG_REQIRED=!1,NAME,Constructor,Prototype,TypedArrayConstructorsList={Int8Array:1,Uint8Array:1,Uint8ClampedArray:1,Int16Array:2,Uint16Array:2,Int32Array:4,Uint32Array:4,Float32Array:4,Float64Array:8},BigIntArrayConstructorsList={BigInt64Array:8,BigUint64Array:8},isView=function isView(e){if(!isObject(e))return!1;var r=classof(e);return"DataView"===r||has$1(TypedArrayConstructorsList,r)||has$1(BigIntArrayConstructorsList,r)},isTypedArray=function(e){if(!isObject(e))return!1;var r=classof(e);return has$1(TypedArrayConstructorsList,r)||has$1(BigIntArrayConstructorsList,r)},aTypedArray$m=function(e){if(isTypedArray(e))return e;throw TypeError("Target is not a typed array")},aTypedArrayConstructor$2=function(e){if(objectSetPrototypeOf&&!isPrototypeOf.call(TypedArray,e))throw TypeError("Target is not a typed array constructor");return e},exportTypedArrayMethod$n=function(e,r,t){if(descriptors){if(t)for(var a in TypedArrayConstructorsList){var i=global$1[a];if(i&&has$1(i.prototype,e))try{delete i.prototype[e]}catch(e){}}TypedArrayPrototype[e]&&!t||redefine(TypedArrayPrototype,e,t?r:NATIVE_ARRAY_BUFFER_VIEWS$1&&Int8ArrayPrototype[e]||r)}},exportTypedArrayStaticMethod=function(e,r,t){var a,i;if(descriptors){if(objectSetPrototypeOf){if(t)for(a in TypedArrayConstructorsList)if((i=global$1[a])&&has$1(i,e))try{delete i[e]}catch(e){}if(TypedArray[e]&&!t)return;try{return redefine(TypedArray,e,t?r:NATIVE_ARRAY_BUFFER_VIEWS$1&&TypedArray[e]||r)}catch(e){}}for(a in TypedArrayConstructorsList)!(i=global$1[a])||i[e]&&!t||redefine(i,e,r)}};for(NAME in TypedArrayConstructorsList)Constructor=global$1[NAME],Prototype=Constructor&&Constructor.prototype,Prototype?createNonEnumerableProperty(Prototype,TYPED_ARRAY_CONSTRUCTOR$1,Constructor):NATIVE_ARRAY_BUFFER_VIEWS$1=!1;for(NAME in BigIntArrayConstructorsList)Constructor=global$1[NAME],Prototype=Constructor&&Constructor.prototype,Prototype&&createNonEnumerableProperty(Prototype,TYPED_ARRAY_CONSTRUCTOR$1,Constructor);if((!NATIVE_ARRAY_BUFFER_VIEWS$1||"function"!=typeof TypedArray||TypedArray===Function.prototype)&&(TypedArray=function TypedArray(){throw TypeError("Incorrect invocation")},NATIVE_ARRAY_BUFFER_VIEWS$1))for(NAME in TypedArrayConstructorsList)global$1[NAME]&&objectSetPrototypeOf(global$1[NAME],TypedArray);if((!NATIVE_ARRAY_BUFFER_VIEWS$1||!TypedArrayPrototype||TypedArrayPrototype===ObjectPrototype$1)&&(TypedArrayPrototype=TypedArray.prototype,NATIVE_ARRAY_BUFFER_VIEWS$1))for(NAME in TypedArrayConstructorsList)global$1[NAME]&&objectSetPrototypeOf(global$1[NAME].prototype,TypedArrayPrototype);if(NATIVE_ARRAY_BUFFER_VIEWS$1&&objectGetPrototypeOf(Uint8ClampedArrayPrototype)!==TypedArrayPrototype&&objectSetPrototypeOf(Uint8ClampedArrayPrototype,TypedArrayPrototype),descriptors&&!has$1(TypedArrayPrototype,TO_STRING_TAG$1))for(NAME in TYPED_ARRAY_TAG_REQIRED=!0,defineProperty$1(TypedArrayPrototype,TO_STRING_TAG$1,{get:function(){return isObject(this)?this[TYPED_ARRAY_TAG]:void 0}}),TypedArrayConstructorsList)global$1[NAME]&&createNonEnumerableProperty(global$1[NAME],TYPED_ARRAY_TAG,NAME);var arrayBufferViewCore={NATIVE_ARRAY_BUFFER_VIEWS:NATIVE_ARRAY_BUFFER_VIEWS$1,TYPED_ARRAY_CONSTRUCTOR:TYPED_ARRAY_CONSTRUCTOR$1,TYPED_ARRAY_TAG:TYPED_ARRAY_TAG_REQIRED&&TYPED_ARRAY_TAG,aTypedArray:aTypedArray$m,aTypedArrayConstructor:aTypedArrayConstructor$2,exportTypedArrayMethod:exportTypedArrayMethod$n,exportTypedArrayStaticMethod:exportTypedArrayStaticMethod,isView:isView,isTypedArray:isTypedArray,TypedArray:TypedArray,TypedArrayPrototype:TypedArrayPrototype},NATIVE_ARRAY_BUFFER_VIEWS=arrayBufferViewCore.NATIVE_ARRAY_BUFFER_VIEWS,ArrayBuffer$1=global$1.ArrayBuffer,Int8Array$2=global$1.Int8Array,typedArrayConstructorsRequireWrappers=!NATIVE_ARRAY_BUFFER_VIEWS||!fails((function(){Int8Array$2(1)}))||!fails((function(){new Int8Array$2(-1)}))||!checkCorrectnessOfIteration((function(e){new Int8Array$2,new Int8Array$2(null),new Int8Array$2(1.5),new Int8Array$2(e)}),!0)||fails((function(){return 1!==new Int8Array$2(new ArrayBuffer$1(2),1,void 0).length})),toIndex=function(e){if(void 0===e)return 0;var r=toInteger(e),t=toLength(r);if(r!==t)throw RangeError("Wrong length or index");return t},abs=Math.abs,pow$1=Math.pow,floor$6=Math.floor,log=Math.log,LN2=Math.LN2,pack=function(e,r,t){var a,i,s,c=new Array(t),l=8*t-r-1,u=(1<>1,d=23===r?pow$1(2,-24)-pow$1(2,-77):0,y=e<0||0===e&&1/e<0?1:0,h=0;for((e=abs(e))!=e||e===1/0?(i=e!=e?1:0,a=u):(a=floor$6(log(e)/LN2),e*(s=pow$1(2,-a))<1&&(a--,s*=2),(e+=a+p>=1?d/s:d*pow$1(2,1-p))*s>=2&&(a++,s/=2),a+p>=u?(i=0,a=u):a+p>=1?(i=(e*s-1)*pow$1(2,r),a+=p):(i=e*pow$1(2,p-1)*pow$1(2,r),a=0));r>=8;c[h++]=255&i,i/=256,r-=8);for(a=a<0;c[h++]=255&a,a/=256,l-=8);return c[--h]|=128*y,c},unpack=function(e,r){var t,a=e.length,i=8*a-r-1,s=(1<>1,l=i-7,u=a-1,p=e[u--],d=127&p;for(p>>=7;l>0;d=256*d+e[u],u--,l-=8);for(t=d&(1<<-l)-1,d>>=-l,l+=r;l>0;t=256*t+e[u],u--,l-=8);if(0===d)d=1-c;else{if(d===s)return t?NaN:p?-1/0:1/0;t+=pow$1(2,r),d-=c}return(p?-1:1)*t*pow$1(2,d-r)},ieee754={pack:pack,unpack:unpack},arrayFill=function fill(e){for(var r=toObject(this),t=toLength(r.length),a=arguments.length,i=toAbsoluteIndex(a>1?arguments[1]:void 0,t),s=a>2?arguments[2]:void 0,c=void 0===s?t:toAbsoluteIndex(s,t);c>i;)r[i++]=e;return r},getOwnPropertyNames=objectGetOwnPropertyNames.f,defineProperty=objectDefineProperty.f,getInternalState$1=internalState.get,setInternalState$3=internalState.set,ARRAY_BUFFER="ArrayBuffer",DATA_VIEW="DataView",PROTOTYPE="prototype",WRONG_LENGTH="Wrong length",WRONG_INDEX="Wrong index",NativeArrayBuffer=global$1[ARRAY_BUFFER],$ArrayBuffer=NativeArrayBuffer,$DataView=global$1[DATA_VIEW],$DataViewPrototype=$DataView&&$DataView[PROTOTYPE],ObjectPrototype=Object.prototype,RangeError$1=global$1.RangeError,packIEEE754=ieee754.pack,unpackIEEE754=ieee754.unpack,packInt8=function(e){return[255&e]},packInt16=function(e){return[255&e,e>>8&255]},packInt32=function(e){return[255&e,e>>8&255,e>>16&255,e>>24&255]},unpackInt32=function(e){return e[3]<<24|e[2]<<16|e[1]<<8|e[0]},packFloat32=function(e){return packIEEE754(e,23,4)},packFloat64=function(e){return packIEEE754(e,52,8)},addGetter=function(e,r){defineProperty(e[PROTOTYPE],r,{get:function(){return getInternalState$1(this)[r]}})},get=function(e,r,t,a){var i=toIndex(t),s=getInternalState$1(e);if(i+r>s.byteLength)throw RangeError$1(WRONG_INDEX);var c=getInternalState$1(s.buffer).bytes,l=i+s.byteOffset,u=c.slice(l,l+r);return a?u:u.reverse()},set=function(e,r,t,a,i,s){var c=toIndex(t),l=getInternalState$1(e);if(c+r>l.byteLength)throw RangeError$1(WRONG_INDEX);for(var u=getInternalState$1(l.buffer).bytes,p=c+l.byteOffset,d=a(+i),y=0;yj;)(key=keys[j++])in $ArrayBuffer||createNonEnumerableProperty($ArrayBuffer,key,NativeArrayBuffer[key]);ArrayBufferPrototype.constructor=$ArrayBuffer}objectSetPrototypeOf&&objectGetPrototypeOf($DataViewPrototype)!==ObjectPrototype&&objectSetPrototypeOf($DataViewPrototype,ObjectPrototype);var testView=new $DataView(new $ArrayBuffer(2)),$setInt8=$DataViewPrototype.setInt8;testView.setInt8(0,2147483648),testView.setInt8(1,2147483649),!testView.getInt8(0)&&testView.getInt8(1)||redefineAll($DataViewPrototype,{setInt8:function setInt8(e,r){$setInt8.call(this,e,r<<24>>24)},setUint8:function setUint8(e,r){$setInt8.call(this,e,r<<24>>24)}},{unsafe:!0})}else $ArrayBuffer=function ArrayBuffer(e){anInstance(this,$ArrayBuffer,ARRAY_BUFFER);var r=toIndex(e);setInternalState$3(this,{bytes:arrayFill.call(new Array(r),0),byteLength:r}),descriptors||(this.byteLength=r)},$DataView=function DataView(e,r,t){anInstance(this,$DataView,DATA_VIEW),anInstance(e,$ArrayBuffer,DATA_VIEW);var a=getInternalState$1(e).byteLength,i=toInteger(r);if(i<0||i>a)throw RangeError$1("Wrong offset");if(i+(t=void 0===t?a-i:toLength(t))>a)throw RangeError$1(WRONG_LENGTH);setInternalState$3(this,{buffer:e,byteLength:t,byteOffset:i}),descriptors||(this.buffer=e,this.byteLength=t,this.byteOffset=i)},descriptors&&(addGetter($ArrayBuffer,"byteLength"),addGetter($DataView,"buffer"),addGetter($DataView,"byteLength"),addGetter($DataView,"byteOffset")),redefineAll($DataView[PROTOTYPE],{getInt8:function getInt8(e){return get(this,1,e)[0]<<24>>24},getUint8:function getUint8(e){return get(this,1,e)[0]},getInt16:function getInt16(e){var r=get(this,2,e,arguments.length>1?arguments[1]:void 0);return(r[1]<<8|r[0])<<16>>16},getUint16:function getUint16(e){var r=get(this,2,e,arguments.length>1?arguments[1]:void 0);return r[1]<<8|r[0]},getInt32:function getInt32(e){return unpackInt32(get(this,4,e,arguments.length>1?arguments[1]:void 0))},getUint32:function getUint32(e){return unpackInt32(get(this,4,e,arguments.length>1?arguments[1]:void 0))>>>0},getFloat32:function getFloat32(e){return unpackIEEE754(get(this,4,e,arguments.length>1?arguments[1]:void 0),23)},getFloat64:function getFloat64(e){return unpackIEEE754(get(this,8,e,arguments.length>1?arguments[1]:void 0),52)},setInt8:function setInt8(e,r){set(this,1,e,packInt8,r)},setUint8:function setUint8(e,r){set(this,1,e,packInt8,r)},setInt16:function setInt16(e,r){set(this,2,e,packInt16,r,arguments.length>2?arguments[2]:void 0)},setUint16:function setUint16(e,r){set(this,2,e,packInt16,r,arguments.length>2?arguments[2]:void 0)},setInt32:function setInt32(e,r){set(this,4,e,packInt32,r,arguments.length>2?arguments[2]:void 0)},setUint32:function setUint32(e,r){set(this,4,e,packInt32,r,arguments.length>2?arguments[2]:void 0)},setFloat32:function setFloat32(e,r){set(this,4,e,packFloat32,r,arguments.length>2?arguments[2]:void 0)},setFloat64:function setFloat64(e,r){set(this,8,e,packFloat64,r,arguments.length>2?arguments[2]:void 0)}});setToStringTag($ArrayBuffer,ARRAY_BUFFER),setToStringTag($DataView,DATA_VIEW);var arrayBuffer={ArrayBuffer:$ArrayBuffer,DataView:$DataView},floor$5=Math.floor,isInteger=function isInteger(e){return!isObject(e)&&isFinite(e)&&floor$5(e)===e},toPositiveInteger=function(e){var r=toInteger(e);if(r<0)throw RangeError("The argument can't be less than 0");return r},toOffset=function(e,r){var t=toPositiveInteger(e);if(t%r)throw RangeError("Wrong offset");return t},aTypedArrayConstructor$1=arrayBufferViewCore.aTypedArrayConstructor,typedArrayFrom=function from(e){var r,t,a,i,s,c,l=toObject(e),u=arguments.length,p=u>1?arguments[1]:void 0,d=void 0!==p,y=getIteratorMethod(l);if(null!=y&&!isArrayIteratorMethod(y))for(c=(s=y.call(l)).next,l=[];!(i=c.call(s)).done;)l.push(i.value);for(d&&u>2&&(p=functionBindContext(p,arguments[2],2)),t=toLength(l.length),a=new(aTypedArrayConstructor$1(this))(t),r=0;t>r;r++)a[r]=d?p(l[r],r):l[r];return a},isArray=Array.isArray||function isArray(e){return"Array"==classofRaw(e)},SPECIES$2=wellKnownSymbol("species"),arraySpeciesConstructor=function(e){var r;return isArray(e)&&("function"!=typeof(r=e.constructor)||r!==Array&&!isArray(r.prototype)?isObject(r)&&null===(r=r[SPECIES$2])&&(r=void 0):r=void 0),void 0===r?Array:r},arraySpeciesCreate=function(e,r){return new(arraySpeciesConstructor(e))(0===r?0:r)},push=[].push,createMethod$2=function(e){var r=1==e,t=2==e,a=3==e,i=4==e,s=6==e,c=7==e,l=5==e||s;return function(u,p,d,y){for(var h,A,g=toObject(u),v=indexedObject(g),m=functionBindContext(p,d,3),E=toLength(v.length),I=0,P=y||arraySpeciesCreate,T=r?P(u,E):t||c?P(u,0):void 0;E>I;I++)if((l||I in v)&&(A=m(h=v[I],I,g),e))if(r)T[I]=A;else if(A)switch(e){case 3:return!0;case 5:return h;case 6:return I;case 2:push.call(T,h)}else switch(e){case 4:return!1;case 7:push.call(T,h)}return s?-1:a||i?i:T}},arrayIteration={forEach:createMethod$2(0),map:createMethod$2(1),filter:createMethod$2(2),some:createMethod$2(3),every:createMethod$2(4),find:createMethod$2(5),findIndex:createMethod$2(6),filterReject:createMethod$2(7)},typedArrayConstructor=createCommonjsModule((function(e){var r=objectGetOwnPropertyNames.f,t=arrayIteration.forEach,a=internalState.get,i=internalState.set,s=objectDefineProperty.f,c=objectGetOwnPropertyDescriptor.f,l=Math.round,u=global$1.RangeError,p=arrayBuffer.ArrayBuffer,d=arrayBuffer.DataView,y=arrayBufferViewCore.NATIVE_ARRAY_BUFFER_VIEWS,h=arrayBufferViewCore.TYPED_ARRAY_CONSTRUCTOR,A=arrayBufferViewCore.TYPED_ARRAY_TAG,g=arrayBufferViewCore.TypedArray,v=arrayBufferViewCore.TypedArrayPrototype,m=arrayBufferViewCore.aTypedArrayConstructor,E=arrayBufferViewCore.isTypedArray,fromList=function(e,r){for(var t=0,a=r.length,i=new(m(e))(a);a>t;)i[t]=r[t++];return i},addGetter=function(e,r){s(e,r,{get:function(){return a(this)[r]}})},isArrayBuffer=function(e){var r;return e instanceof p||"ArrayBuffer"==(r=classof(e))||"SharedArrayBuffer"==r},isTypedArrayIndex=function(e,r){return E(e)&&!isSymbol(r)&&r in e&&isInteger(+r)&&r>=0},I=function getOwnPropertyDescriptor(e,r){return r=toPropertyKey(r),isTypedArrayIndex(e,r)?createPropertyDescriptor(2,e[r]):c(e,r)},P=function defineProperty(e,r,t){return r=toPropertyKey(r),!(isTypedArrayIndex(e,r)&&isObject(t)&&has$1(t,"value"))||has$1(t,"get")||has$1(t,"set")||t.configurable||has$1(t,"writable")&&!t.writable||has$1(t,"enumerable")&&!t.enumerable?s(e,r,t):(e[r]=t.value,e)};descriptors?(y||(objectGetOwnPropertyDescriptor.f=I,objectDefineProperty.f=P,addGetter(v,"buffer"),addGetter(v,"byteOffset"),addGetter(v,"byteLength"),addGetter(v,"length")),_export({target:"Object",stat:!0,forced:!y},{getOwnPropertyDescriptor:I,defineProperty:P}),e.exports=function(e,c,m){var I=e.match(/\d+$/)[0]/8,P=e+(m?"Clamped":"")+"Array",T="get"+e,b="set"+e,S=global$1[P],R=S,_=R&&R.prototype,w={},addElement=function(e,r){s(e,r,{get:function(){return function(e,r){var t=a(e);return t.view[T](r*I+t.byteOffset,!0)}(this,r)},set:function(e){return function(e,r,t){var i=a(e);m&&(t=(t=l(t))<0?0:t>255?255:255&t),i.view[b](r*I+i.byteOffset,t,!0)}(this,r,e)},enumerable:!0})};y?typedArrayConstructorsRequireWrappers&&(R=c((function(e,r,t,a){return anInstance(e,R,P),inheritIfRequired(isObject(r)?isArrayBuffer(r)?void 0!==a?new S(r,toOffset(t,I),a):void 0!==t?new S(r,toOffset(t,I)):new S(r):E(r)?fromList(R,r):typedArrayFrom.call(R,r):new S(toIndex(r)),e,R)})),objectSetPrototypeOf&&objectSetPrototypeOf(R,g),t(r(S),(function(e){e in R||createNonEnumerableProperty(R,e,S[e])})),R.prototype=_):(R=c((function(e,r,t,a){anInstance(e,R,P);var s,c,l,y=0,h=0;if(isObject(r)){if(!isArrayBuffer(r))return E(r)?fromList(R,r):typedArrayFrom.call(R,r);s=r,h=toOffset(t,I);var A=r.byteLength;if(void 0===a){if(A%I)throw u("Wrong length");if((c=A-h)<0)throw u("Wrong length")}else if((c=toLength(a)*I)+h>A)throw u("Wrong length");l=c/I}else l=toIndex(r),s=new p(c=l*I);for(i(e,{buffer:s,byteOffset:h,byteLength:c,length:l,view:new d(s)});y2?arguments[2]:void 0,l=min$3((void 0===c?a:toAbsoluteIndex(c,a))-s,a-i),u=1;for(s0;)s in t?t[i]=t[s]:delete t[i],i+=u,s+=u;return t},aTypedArray$l=arrayBufferViewCore.aTypedArray,exportTypedArrayMethod$m=arrayBufferViewCore.exportTypedArrayMethod;exportTypedArrayMethod$m("copyWithin",(function copyWithin(e,r){return arrayCopyWithin.call(aTypedArray$l(this),e,r,arguments.length>2?arguments[2]:void 0)}));var $every=arrayIteration.every,aTypedArray$k=arrayBufferViewCore.aTypedArray,exportTypedArrayMethod$l=arrayBufferViewCore.exportTypedArrayMethod;exportTypedArrayMethod$l("every",(function every(e){return $every(aTypedArray$k(this),e,arguments.length>1?arguments[1]:void 0)}));var aTypedArray$j=arrayBufferViewCore.aTypedArray,exportTypedArrayMethod$k=arrayBufferViewCore.exportTypedArrayMethod;exportTypedArrayMethod$k("fill",(function fill(e){return arrayFill.apply(aTypedArray$j(this),arguments)}));var arrayFromConstructorAndList=function(e,r){for(var t=0,a=r.length,i=new e(a);a>t;)i[t]=r[t++];return i},TYPED_ARRAY_CONSTRUCTOR=arrayBufferViewCore.TYPED_ARRAY_CONSTRUCTOR,aTypedArrayConstructor=arrayBufferViewCore.aTypedArrayConstructor,typedArraySpeciesConstructor=function(e){return aTypedArrayConstructor(speciesConstructor(e,e[TYPED_ARRAY_CONSTRUCTOR]))},typedArrayFromSpeciesAndList=function(e,r){return arrayFromConstructorAndList(typedArraySpeciesConstructor(e),r)},$filter$1=arrayIteration.filter,aTypedArray$i=arrayBufferViewCore.aTypedArray,exportTypedArrayMethod$j=arrayBufferViewCore.exportTypedArrayMethod;exportTypedArrayMethod$j("filter",(function filter(e){var r=$filter$1(aTypedArray$i(this),e,arguments.length>1?arguments[1]:void 0);return typedArrayFromSpeciesAndList(this,r)}));var $find=arrayIteration.find,aTypedArray$h=arrayBufferViewCore.aTypedArray,exportTypedArrayMethod$i=arrayBufferViewCore.exportTypedArrayMethod;exportTypedArrayMethod$i("find",(function find(e){return $find(aTypedArray$h(this),e,arguments.length>1?arguments[1]:void 0)}));var $findIndex=arrayIteration.findIndex,aTypedArray$g=arrayBufferViewCore.aTypedArray,exportTypedArrayMethod$h=arrayBufferViewCore.exportTypedArrayMethod;exportTypedArrayMethod$h("findIndex",(function findIndex(e){return $findIndex(aTypedArray$g(this),e,arguments.length>1?arguments[1]:void 0)}));var $forEach$1=arrayIteration.forEach,aTypedArray$f=arrayBufferViewCore.aTypedArray,exportTypedArrayMethod$g=arrayBufferViewCore.exportTypedArrayMethod;exportTypedArrayMethod$g("forEach",(function forEach(e){$forEach$1(aTypedArray$f(this),e,arguments.length>1?arguments[1]:void 0)}));var $includes=arrayIncludes.includes,aTypedArray$e=arrayBufferViewCore.aTypedArray,exportTypedArrayMethod$f=arrayBufferViewCore.exportTypedArrayMethod;exportTypedArrayMethod$f("includes",(function includes(e){return $includes(aTypedArray$e(this),e,arguments.length>1?arguments[1]:void 0)}));var $indexOf=arrayIncludes.indexOf,aTypedArray$d=arrayBufferViewCore.aTypedArray,exportTypedArrayMethod$e=arrayBufferViewCore.exportTypedArrayMethod;exportTypedArrayMethod$e("indexOf",(function indexOf(e){return $indexOf(aTypedArray$d(this),e,arguments.length>1?arguments[1]:void 0)}));var ITERATOR$3=wellKnownSymbol("iterator"),Uint8Array$2=global$1.Uint8Array,arrayValues=es_array_iterator.values,arrayKeys=es_array_iterator.keys,arrayEntries=es_array_iterator.entries,aTypedArray$c=arrayBufferViewCore.aTypedArray,exportTypedArrayMethod$d=arrayBufferViewCore.exportTypedArrayMethod,nativeTypedArrayIterator=Uint8Array$2&&Uint8Array$2.prototype[ITERATOR$3],CORRECT_ITER_NAME=!!nativeTypedArrayIterator&&("values"==nativeTypedArrayIterator.name||null==nativeTypedArrayIterator.name),typedArrayValues=function values(){return arrayValues.call(aTypedArray$c(this))};exportTypedArrayMethod$d("entries",(function entries(){return arrayEntries.call(aTypedArray$c(this))})),exportTypedArrayMethod$d("keys",(function keys(){return arrayKeys.call(aTypedArray$c(this))})),exportTypedArrayMethod$d("values",typedArrayValues,!CORRECT_ITER_NAME),exportTypedArrayMethod$d(ITERATOR$3,typedArrayValues,!CORRECT_ITER_NAME);var aTypedArray$b=arrayBufferViewCore.aTypedArray,exportTypedArrayMethod$c=arrayBufferViewCore.exportTypedArrayMethod,$join=[].join;exportTypedArrayMethod$c("join",(function join(e){return $join.apply(aTypedArray$b(this),arguments)}));var arrayMethodIsStrict=function(e,r){var t=[][e];return!!t&&fails((function(){t.call(null,r||function(){throw 1},1)}))},min$2=Math.min,$lastIndexOf=[].lastIndexOf,NEGATIVE_ZERO=!!$lastIndexOf&&1/[1].lastIndexOf(1,-0)<0,STRICT_METHOD$2=arrayMethodIsStrict("lastIndexOf"),FORCED$5=NEGATIVE_ZERO||!STRICT_METHOD$2,arrayLastIndexOf=FORCED$5?function lastIndexOf(e){if(NEGATIVE_ZERO)return $lastIndexOf.apply(this,arguments)||0;var r=toIndexedObject(this),t=toLength(r.length),a=t-1;for(arguments.length>1&&(a=min$2(a,toInteger(arguments[1]))),a<0&&(a=t+a);a>=0;a--)if(a in r&&r[a]===e)return a||0;return-1}:$lastIndexOf,aTypedArray$a=arrayBufferViewCore.aTypedArray,exportTypedArrayMethod$b=arrayBufferViewCore.exportTypedArrayMethod;exportTypedArrayMethod$b("lastIndexOf",(function lastIndexOf(e){return arrayLastIndexOf.apply(aTypedArray$a(this),arguments)}));var $map=arrayIteration.map,aTypedArray$9=arrayBufferViewCore.aTypedArray,exportTypedArrayMethod$a=arrayBufferViewCore.exportTypedArrayMethod;exportTypedArrayMethod$a("map",(function map(e){return $map(aTypedArray$9(this),e,arguments.length>1?arguments[1]:void 0,(function(e,r){return new(typedArraySpeciesConstructor(e))(r)}))}));var createMethod$1=function(e){return function(r,t,a,i){aFunction(t);var s=toObject(r),c=indexedObject(s),l=toLength(s.length),u=e?l-1:0,p=e?-1:1;if(a<2)for(;;){if(u in c){i=c[u],u+=p;break}if(u+=p,e?u<0:l<=u)throw TypeError("Reduce of empty array with no initial value")}for(;e?u>=0:l>u;u+=p)u in c&&(i=t(i,c[u],u,s));return i}},arrayReduce={left:createMethod$1(!1),right:createMethod$1(!0)},$reduce=arrayReduce.left,aTypedArray$8=arrayBufferViewCore.aTypedArray,exportTypedArrayMethod$9=arrayBufferViewCore.exportTypedArrayMethod;exportTypedArrayMethod$9("reduce",(function reduce(e){return $reduce(aTypedArray$8(this),e,arguments.length,arguments.length>1?arguments[1]:void 0)}));var $reduceRight=arrayReduce.right,aTypedArray$7=arrayBufferViewCore.aTypedArray,exportTypedArrayMethod$8=arrayBufferViewCore.exportTypedArrayMethod;exportTypedArrayMethod$8("reduceRight",(function reduceRight(e){return $reduceRight(aTypedArray$7(this),e,arguments.length,arguments.length>1?arguments[1]:void 0)}));var aTypedArray$6=arrayBufferViewCore.aTypedArray,exportTypedArrayMethod$7=arrayBufferViewCore.exportTypedArrayMethod,floor$4=Math.floor;exportTypedArrayMethod$7("reverse",(function reverse(){for(var e,r=aTypedArray$6(this).length,t=floor$4(r/2),a=0;a1?arguments[1]:void 0,1),t=this.length,a=toObject(e),i=toLength(a.length),s=0;if(i+r>t)throw RangeError("Wrong length");for(;si;)c[i]=t[i++];return c}),FORCED$3);var $some=arrayIteration.some,aTypedArray$3=arrayBufferViewCore.aTypedArray,exportTypedArrayMethod$4=arrayBufferViewCore.exportTypedArrayMethod;exportTypedArrayMethod$4("some",(function some(e){return $some(aTypedArray$3(this),e,arguments.length>1?arguments[1]:void 0)}));var floor$3=Math.floor,mergeSort=function(e,r){var t=e.length,a=floor$3(t/2);return t<8?insertionSort(e,r):merge(mergeSort(e.slice(0,a),r),mergeSort(e.slice(a),r),r)},insertionSort=function(e,r){for(var t,a,i=e.length,s=1;s0;)e[a]=e[--a];a!==s++&&(e[a]=t)}return e},merge=function(e,r,t){for(var a=e.length,i=r.length,s=0,c=0,l=[];s0&&1/t<0?1:-1:r>t}};exportTypedArrayMethod$3("sort",(function sort(e){if(void 0!==e&&aFunction(e),STABLE_SORT$1)return nativeSort$1.call(this,e);aTypedArray$2(this);var r,t=toLength(this.length),a=Array(t);for(r=0;r=51||!fails((function(){var r=[];return(r.constructor={})[SPECIES$1]=function(){return{foo:1}},1!==r[e](Boolean).foo}))},HAS_SPECIES_SUPPORT$1=arrayMethodHasSpeciesSupport("slice"),SPECIES=wellKnownSymbol("species"),nativeSlice=[].slice,max$1=Math.max;_export({target:"Array",proto:!0,forced:!HAS_SPECIES_SUPPORT$1},{slice:function slice(e,r){var t,a,i,s=toIndexedObject(this),c=toLength(s.length),l=toAbsoluteIndex(e,c),u=toAbsoluteIndex(void 0===r?c:r,c);if(isArray(s)&&("function"!=typeof(t=s.constructor)||t!==Array&&!isArray(t.prototype)?isObject(t)&&null===(t=t[SPECIES])&&(t=void 0):t=void 0,t===Array||void 0===t))return nativeSlice.call(s,l,u);for(a=new(void 0===t?Array:t)(max$1(u-l,0)),i=0;l1?arguments[1]:void 0)}});var TO_STRING="toString",RegExpPrototype=RegExp.prototype,nativeToString=RegExpPrototype[TO_STRING],NOT_GENERIC=fails((function(){return"/a/b"!=nativeToString.call({source:"a",flags:"b"})})),INCORRECT_NAME=nativeToString.name!=TO_STRING;(NOT_GENERIC||INCORRECT_NAME)&&redefine(RegExp.prototype,TO_STRING,(function toString$1(){var e=anObject(this),r=toString(e.source),t=e.flags;return"/"+r+"/"+toString(void 0===t&&e instanceof RegExp&&!("flags"in RegExpPrototype)?regexpFlags.call(e):t)}),{unsafe:!0});var test=[],nativeSort=test.sort,FAILS_ON_UNDEFINED=fails((function(){test.sort(void 0)})),FAILS_ON_NULL=fails((function(){test.sort(null)})),STRICT_METHOD$1=arrayMethodIsStrict("sort"),STABLE_SORT=!fails((function(){if(engineV8Version)return engineV8Version<70;if(!(engineFfVersion&&engineFfVersion>3)){if(engineIsIeOrEdge)return!0;if(engineWebkitVersion)return engineWebkitVersion<603;var e,r,t,a,i="";for(e=65;e<76;e++){switch(r=String.fromCharCode(e),e){case 66:case 69:case 70:case 72:t=3;break;case 68:case 71:t=4;break;default:t=2}for(a=0;a<47;a++)test.push({k:r+a,v:t})}for(test.sort((function(e,r){return r.v-e.v})),a=0;atoString(t)?1:-1}};_export({target:"Array",proto:!0,forced:FORCED$1},{sort:function sort(e){void 0!==e&&aFunction(e);var r=toObject(this);if(STABLE_SORT)return void 0===e?nativeSort.call(r):nativeSort.call(r,e);var t,a,i=[],s=toLength(r.length);for(a=0;a>>24&255,a[t+1]=i>>>16&255,a[t+2]=i>>>8&255,a[t+3]=i>>>0&255,new Uint8Array(a.buffer,0,t+4)},UZIP.deflateRaw=function(e,r){null==r&&(r={level:6});var t=new Uint8Array(50+Math.floor(1.1*e.length)),a=UZIP.F.deflateRaw(e,t,a,r.level);return new Uint8Array(t.buffer,0,a)},UZIP.encode=function(e,r){null==r&&(r=!1);var t=0,a=UZIP.bin.writeUint,i=UZIP.bin.writeUshort,s={};for(var c in e){var l=!UZIP._noNeed(c)&&!r,u=e[c],p=UZIP.crc.crc(u,0,u.length);s[c]={cpr:l,usize:u.length,crc:p,file:l?UZIP.deflateRaw(u):u}}for(var c in s)t+=s[c].file.length+30+46+2*UZIP.bin.sizeUTF8(c);t+=22;var d=new Uint8Array(t),y=0,h=[];for(var c in s){var A=s[c];h.push(y),y=UZIP._writeHeader(d,y,c,A,0)}var g=0,v=y;for(var c in s){A=s[c];h.push(y),y=UZIP._writeHeader(d,y,c,A,1,h[g++])}var m=y-v;return a(d,y,101010256),y+=4,i(d,y+=4,g),i(d,y+=2,g),a(d,y+=2,m),a(d,y+=4,v),y+=4,y+=2,d.buffer},UZIP._noNeed=function(e){var r=e.split(".").pop().toLowerCase();return-1!="png,jpg,jpeg,zip".indexOf(r)},UZIP._writeHeader=function(e,r,t,a,i,s){var c=UZIP.bin.writeUint,l=UZIP.bin.writeUshort,u=a.file;return c(e,r,0==i?67324752:33639248),r+=4,1==i&&(r+=2),l(e,r,20),l(e,r+=2,0),l(e,r+=2,a.cpr?8:0),c(e,r+=2,0),c(e,r+=4,a.crc),c(e,r+=4,u.length),c(e,r+=4,a.usize),l(e,r+=4,UZIP.bin.sizeUTF8(t)),l(e,r+=2,0),r+=2,1==i&&(r+=2,r+=2,c(e,r+=6,s),r+=4),r+=UZIP.bin.writeUTF8(e,r,t),0==i&&(e.set(u,r),r+=u.length),r},UZIP.crc={table:function(){for(var e=new Uint32Array(256),r=0;r<256;r++){for(var t=r,a=0;a<8;a++)1&t?t=3988292384^t>>>1:t>>>=1;e[r]=t}return e}(),update:function(e,r,t,a){for(var i=0;i>>8;return e},crc:function(e,r,t){return 4294967295^UZIP.crc.update(4294967295,e,r,t)}},UZIP.adler=function(e,r,t){for(var a=1,i=0,s=r,c=r+t;s>8&255},readUint:function(e,r){return 16777216*e[r+3]+(e[r+2]<<16|e[r+1]<<8|e[r])},writeUint:function(e,r,t){e[r]=255&t,e[r+1]=t>>8&255,e[r+2]=t>>16&255,e[r+3]=t>>24&255},readASCII:function(e,r,t){for(var a="",i=0;i>6,e[r+i+1]=128|c>>0&63,i+=2;else if(0==(4294901760&c))e[r+i]=224|c>>12,e[r+i+1]=128|c>>6&63,e[r+i+2]=128|c>>0&63,i+=3;else{if(0!=(4292870144&c))throw"e";e[r+i]=240|c>>18,e[r+i+1]=128|c>>12&63,e[r+i+2]=128|c>>6&63,e[r+i+3]=128|c>>0&63,i+=4}}return i},sizeUTF8:function(e){for(var r=e.length,t=0,a=0;a>>3}var h=s.lits,A=s.strt,g=s.prev,v=0,m=0,E=0,I=0,P=0,T=0;for(y>2&&(A[T=UZIP.F._hash(e,0)]=0),u=0;u14e3||m>26697)&&y-u>100&&(d>>16,_=65535&S;if(0!=S){_=65535&S;var w=c(R=S>>>16,s.of0);s.lhst[257+w]++;var U=c(_,s.df0);s.dhst[U]++,I+=s.exb[w]+s.dxb[U],h[v]=R<<23|u-d,h[v+1]=_<<16|w<<8|U,v+=2,d=u+R}else s.lhst[e[u]]++;m++}}for(E==u&&0!=e.length||(d>>3},UZIP.F._bestMatch=function(e,r,t,a,i,s){var c=32767&r,l=t[c],u=c-l+32768&32767;if(l==c||a!=UZIP.F._hash(e,r-u))return 0;for(var p=0,d=0,y=Math.min(32767,r);u<=y&&0!=--s&&l!=c;){if(0==p||e[r+p]==e[r+p-u]){var h=UZIP.F._howLong(e,r,u);if(h>p){if(d=u,(p=h)>=i)break;u+2A&&(A=m,l=v)}}}u+=(c=l)-(l=t[c])+32768&32767}return p<<16|d},UZIP.F._howLong=function(e,r,t){if(e[r]!=e[r-t]||e[r+1]!=e[r+1-t]||e[r+2]!=e[r+2-t])return 0;var a=r,i=Math.min(e.length,r+258);for(r+=3;r>>23,B=$+(8388607&x);$>16,V=D>>8&255,k=255&D;T(l,u=UZIP.F._writeLit(257+V,U,l,u),M-I.of0[V]),u+=I.exb[V],P(l,u=UZIP.F._writeLit(k,O,l,u),G-I.df0[k]),u+=I.dxb[k],$+=M}}u=UZIP.F._writeLit(256,U,l,u)}return u},UZIP.F._copyExact=function(e,r,t,a,i){var s=i>>>3;return a[s]=t,a[s+1]=t>>>8,a[s+2]=255-a[s],a[s+3]=255-a[s+1],s+=4,a.set(new Uint8Array(e.buffer,r,t),s),i+(t+4<<3)},UZIP.F.getTrees=function(){for(var e=UZIP.F.U,r=UZIP.F._hufTree(e.lhst,e.ltree,15),t=UZIP.F._hufTree(e.dhst,e.dtree,15),a=[],i=UZIP.F._lenCodes(e.ltree,a),s=[],c=UZIP.F._lenCodes(e.dtree,s),l=0;l4&&0==e.itree[1+(e.ordr[p-1]<<1)];)p--;return[r,t,u,i,c,p,a,s]},UZIP.F.getSecond=function(e){for(var r=[],t=0;t>1)+",");return r},UZIP.F.contSize=function(e,r){for(var t=0,a=0;a15&&(UZIP.F._putsE(t,a,c,l),a+=l)}return a},UZIP.F._lenCodes=function(e,r){for(var t=e.length;2!=t&&0==e[t-1];)t-=2;for(var a=0;a>>1,138))<11?r.push(17,p-3):r.push(18,p-11),a+=2*p-2}else if(i==l&&s==i&&c==i){for(u=a+5;u+2>>1,6);r.push(16,p-3),a+=2*p-2}else r.push(i,0)}return t>>>1},UZIP.F._hufTree=function(e,r,t){var a=[],i=e.length,s=r.length,c=0;for(c=0;ct&&(UZIP.F.restrictDepth(u,t,v),v=t),c=0;cr;a++){var c=e[a].d;e[a].d=r,s+=i-(1<>>=t-r;s>0;){(c=e[a].d)=0;a--)e[a].d==r&&s<0&&(e[a].d--,s++);0!=s&&console.log("debt left")},UZIP.F._goodIndex=function(e,r){var t=0;return r[16|t]<=e&&(t|=16),r[8|t]<=e&&(t|=8),r[4|t]<=e&&(t|=4),r[2|t]<=e&&(t|=2),r[1|t]<=e&&(t|=1),t},UZIP.F._writeLit=function(e,r,t,a){return UZIP.F._putsF(t,a,r[e<<1]),a+r[1+(e<<1)]},UZIP.F.inflate=function(e,r){var t=Uint8Array;if(3==e[0]&&0==e[1])return r||new t(0);var a=UZIP.F,i=a._bitsF,s=a._bitsE,c=a._decodeTiny,l=a.makeCodes,u=a.codes2map,p=a._get17,d=a.U,y=null==r;y&&(r=new t(e.length>>>2<<3));for(var h,A,g=0,v=0,m=0,E=0,I=0,P=0,T=0,b=0,S=0;0==g;)if(g=i(e,S,1),v=i(e,S+1,2),S+=3,0!=v){if(y&&(r=UZIP.F._check(r,b+(1<<17))),1==v&&(h=d.flmap,A=d.fdmap,P=511,T=31),2==v){m=s(e,S,5)+257,E=s(e,S+5,5)+1,I=s(e,S+10,4)+4,S+=14;for(var R=0;R<38;R+=2)d.itree[R]=0,d.itree[R+1]=0;var _=1;for(R=0;R_&&(_=w)}S+=3*I,l(d.itree,_),u(d.itree,_,d.imap),h=d.lmap,A=d.dmap,S=c(d.imap,(1<<_)-1,m+E,e,S,d.ttree);var U=a._copyOut(d.ttree,0,m,d.ltree);P=(1<>>4;if($>>>8==0)r[b++]=$;else{if(256==$)break;var L=b+$-254;if($>264){var x=d.ldef[$-257];L=b+(x>>>3)+s(e,S,7&x),S+=7&x}var M=A[p(e,S)&T];S+=15&M;var B=M>>>4,D=d.ddef[B],G=(D>>>4)+i(e,S,15&D);for(S+=15&D,y&&(r=UZIP.F._check(r,b+(1<<17)));b>>3),k=e[V-4]|e[V-3]<<8;y&&(r=UZIP.F._check(r,b+k)),r.set(new t(e.buffer,e.byteOffset+V,k),b),S=V+k<<3,b+=k}return r.length==b?r:r.slice(0,b)},UZIP.F._check=function(e,r){var t=e.length;if(r<=t)return e;var a=new Uint8Array(Math.max(t<<1,r));return a.set(e,0),a},UZIP.F._decodeTiny=function(e,r,t,a,i,s){for(var c=UZIP.F._bitsE,l=UZIP.F._get17,u=0;u>>4;if(d<=15)s[u]=d,u++;else{var y=0,h=0;16==d?(h=3+c(a,i,2),i+=2,y=s[u-1]):17==d?(h=3+c(a,i,3),i+=3):18==d&&(h=11+c(a,i,7),i+=7);for(var A=u+h;u>>1;si&&(i=l),s++}for(;s>1,l=e[s+1],u=c<<4|l,p=r-l,d=e[s]<>>15-r]=u,d++}},UZIP.F.revCodes=function(e,r){for(var t=UZIP.F.U.rev15,a=15-r,i=0;i>>a}},UZIP.F._putsE=function(e,r,t){t<<=7&r;var a=r>>>3;e[a]|=t,e[a+1]|=t>>>8},UZIP.F._putsF=function(e,r,t){t<<=7&r;var a=r>>>3;e[a]|=t,e[a+1]|=t>>>8,e[a+2]|=t>>>16},UZIP.F._bitsE=function(e,r,t){return(e[r>>>3]|e[1+(r>>>3)]<<8)>>>(7&r)&(1<>>3]|e[1+(r>>>3)]<<8|e[2+(r>>>3)]<<16)>>>(7&r)&(1<>>3]|e[1+(r>>>3)]<<8|e[2+(r>>>3)]<<16)>>>(7&r)},UZIP.F._get25=function(e,r){return(e[r>>>3]|e[1+(r>>>3)]<<8|e[2+(r>>>3)]<<16|e[3+(r>>>3)]<<24)>>>(7&r)},UZIP.F.U=(r=Uint16Array,t=Uint32Array,{next_code:new r(16),bl_count:new r(16),ordr:[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],of0:[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,999,999,999],exb:[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0],ldef:new r(32),df0:[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,65535,65535],dxb:[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0],ddef:new t(32),flmap:new r(512),fltree:[],fdmap:new r(32),fdtree:[],lmap:new r(32768),ltree:[],ttree:[],dmap:new r(32768),dtree:[],imap:new r(512),itree:[],rev15:new r(32768),lhst:new t(286),dhst:new t(30),ihst:new t(19),lits:new t(15e3),strt:new r(65536),prev:new r(32768)}),function(){for(var e=UZIP.F.U,r=0;r<32768;r++){var t=r;t=(4278255360&(t=(4042322160&(t=(3435973836&(t=(2863311530&t)>>>1|(1431655765&t)<<1))>>>2|(858993459&t)<<2))>>>4|(252645135&t)<<4))>>>8|(16711935&t)<<8,e.rev15[r]=(t>>>16|t<<16)>>>17}function pushV(e,r,t){for(;0!=r--;)e.push(0,t)}for(r=0;r<32;r++)e.ldef[r]=e.of0[r]<<3|e.exb[r],e.ddef[r]=e.df0[r]<<4|e.dxb[r];pushV(e.fltree,144,8),pushV(e.fltree,112,9),pushV(e.fltree,24,7),pushV(e.fltree,8,8),UZIP.F.makeCodes(e.fltree,9),UZIP.F.codes2map(e.fltree,9,e.flmap),UZIP.F.revCodes(e.fltree,9),pushV(e.fdtree,32,5),UZIP.F.makeCodes(e.fdtree,5),UZIP.F.codes2map(e.fdtree,5,e.fdmap),UZIP.F.revCodes(e.fdtree,5),pushV(e.itree,19,0),pushV(e.ltree,286,0),pushV(e.dtree,30,0),pushV(e.ttree,320,0)}()})),UZIP=Object.freeze(Object.assign(Object.create(null),UZIP_1,{default:UZIP_1})),UPNG={},N,W,H;UPNG.toRGBA8=function(e){var r=e.width,t=e.height;if(null==e.tabs.acTL)return[UPNG.toRGBA8.decodeImage(e.data,r,t,e).buffer];var a=[];null==e.frames[0].data&&(e.frames[0].data=e.data);for(var i=r*t*4,s=new Uint8Array(i),c=new Uint8Array(i),l=new Uint8Array(i),u=0;u>3)]>>7-((7&A)<<0)&1);l[P]=T[U],l[P+1]=T[U+1],l[P+2]=T[U+2],l[P+3]=O>2)]>>6-((3&A)<<1)&3);l[P]=T[U],l[P+1]=T[U+1],l[P+2]=T[U+2],l[P+3]=O>1)]>>4-((1&A)<<2)&15);l[P]=T[U],l[P+1]=T[U+1],l[P+2]=T[U+2],l[P+3]=O>>3)]>>>7-(7&M)&1))==255*m?0:255;u[x+M]=B<<24|C<<16|C<<8|C}else if(2==d)for(M=0;M>>2)]>>>6-((3&M)<<1)&3))==85*m?0:255;u[x+M]=B<<24|C<<16|C<<8|C}else if(4==d)for(M=0;M>>1)]>>>4-((1&M)<<2)&15))==17*m?0:255;u[x+M]=B<<24|C<<16|C<<8|C}else if(8==d)for(M=0;M>>2<<5));0==s;)if(s=v(e,A,1),c=v(e,A+1,2),A+=3,0!=c){if(S&&(r=H.H.W(r,h+(1<<17))),1==c&&(t=b.J,a=b.h,d=511,y=31),2==c){l=m(e,A,5)+257,u=m(e,A+5,5)+1,p=m(e,A+10,4)+4,A+=14;for(var R=1,_=0;_<38;_+=2)b.Q[_]=0,b.Q[_+1]=0;for(_=0;_R&&(R=w)}A+=3*p,I(b.Q,R),P(b.Q,R,b.u),t=b.w,a=b.d,A=E(b.u,(1<>>4;if($>>>8==0)r[h++]=$;else{if(256==$)break;var L=h+$-254;if($>264){var x=b.q[$-257];L=h+(x>>>3)+m(e,A,7&x),A+=7&x}var M=a[T(e,A)&y];A+=15&M;var B=M>>>4,D=b.c[B],G=(D>>>4)+v(e,A,15&D);for(A+=15&D;h>>3),k=e[V-4]|e[V-3]<<8;S&&(r=H.H.W(r,h+k)),r.set(new i(e.buffer,e.byteOffset+V,k),h),A=V+k<<3,h+=k}return r.length==h?r:r.slice(0,h)},H.H.W=function(e,r){var t=e.length;if(r<=t)return e;var a=new Uint8Array(t<<1);return a.set(e,0),a},H.H.R=function(e,r,t,a,i,s){for(var c=H.H.e,l=H.H.Z,u=0;u>>4;if(d<=15)s[u]=d,u++;else{var y=0,h=0;16==d?(h=3+c(a,i,2),i+=2,y=s[u-1]):17==d?(h=3+c(a,i,3),i+=3):18==d&&(h=11+c(a,i,7),i+=7);for(var A=u+h;u>>1;si&&(i=l),s++}for(;s>1,l=e[s+1],u=c<<4|l,p=r-l,d=e[s]<>>15-r]=u,d++},H.H.l=function(e,r){for(var t=H.H.m.r,a=15-r,i=0;i>>a}},H.H.M=function(e,r,t){t<<=7&r;var a=r>>>3;e[a]|=t,e[a+1]|=t>>>8},H.H.I=function(e,r,t){t<<=7&r;var a=r>>>3;e[a]|=t,e[a+1]|=t>>>8,e[a+2]|=t>>>16},H.H.e=function(e,r,t){return(e[r>>>3]|e[1+(r>>>3)]<<8)>>>(7&r)&(1<>>3]|e[1+(r>>>3)]<<8|e[2+(r>>>3)]<<16)>>>(7&r)&(1<>>3]|e[1+(r>>>3)]<<8|e[2+(r>>>3)]<<16)>>>(7&r)},H.H.i=function(e,r){return(e[r>>>3]|e[1+(r>>>3)]<<8|e[2+(r>>>3)]<<16|e[3+(r>>>3)]<<24)>>>(7&r)},H.H.m=(N=Uint16Array,W=Uint32Array,{K:new N(16),j:new N(16),X:[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],S:[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,999,999,999],T:[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0],q:new N(32),p:[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,65535,65535],z:[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0],c:new W(32),J:new N(512),_:[],h:new N(32),$:[],w:new N(32768),C:[],v:[],d:new N(32768),D:[],u:new N(512),Q:[],r:new N(32768),s:new W(286),Y:new W(30),a:new W(19),t:new W(15e3),k:new N(65536),g:new N(32768)}),function(){for(var e=H.H.m,r=0;r<32768;r++){var t=r;t=(4278255360&(t=(4042322160&(t=(3435973836&(t=(2863311530&t)>>>1|(1431655765&t)<<1))>>>2|(858993459&t)<<2))>>>4|(252645135&t)<<4))>>>8|(16711935&t)<<8,e.r[r]=(t>>>16|t<<16)>>>17}function n(e,r,t){for(;0!=r--;)e.push(0,t)}for(r=0;r<32;r++)e.q[r]=e.S[r]<<3|e.T[r],e.c[r]=e.p[r]<<4|e.z[r];n(e._,144,8),n(e._,112,9),n(e._,24,7),n(e._,8,8),H.H.n(e._,9),H.H.A(e._,9,e.J),H.H.l(e._,9),n(e.$,32,5),H.H.n(e.$,5),H.H.A(e.$,5,e.h),H.H.l(e.$,5),n(e.Q,19,0),n(e.C,286,0),n(e.D,30,0),n(e.v,320,0)}(),H.H.N),UPNG.decode._readInterlace=function(e,r){for(var t=r.width,a=r.height,i=UPNG.decode._getBPP(r),s=i>>3,c=Math.ceil(t*i/8),l=new Uint8Array(a*c),u=0,p=[0,0,4,0,2,0,1],d=[0,4,0,2,0,1,0],y=[8,8,8,4,4,2,2],h=[8,8,4,4,2,2,1],A=0;A<7;){for(var g=y[A],v=h[A],m=0,E=0,I=p[A];I>3])>>7-(7&_)&1,l[S*c+(R>>3)]|=w<<7-((7&R)<<0);if(2==i)w=(w=e[_>>3])>>6-(7&_)&3,l[S*c+(R>>2)]|=w<<6-((3&R)<<1);if(4==i)w=(w=e[_>>3])>>4-(7&_)&15,l[S*c+(R>>1)]|=w<<4-((1&R)<<2);if(i>=8)for(var U=S*c+R*s,O=0;O>3)+O];_+=i,R+=v}b++,S+=g}m*E!=0&&(u+=E*(1+T)),A+=1}return l},UPNG.decode._getBPP=function(e){return[1,null,3,1,2,null,4][e.ctype]*e.depth},UPNG.decode._filterZero=function(e,r,t,a,i){var s=UPNG.decode._getBPP(r),c=Math.ceil(a*s/8),l=UPNG.decode._paeth;s=Math.ceil(s/8);var u=0,p=1,d=e[t],y=0;if(d>1&&(e[t]=[0,0,1][d-2]),3==d)for(y=s;y>>1)&255;for(var h=0;h>>1);for(;y>>1)}else{for(;y>8&255,e[r+1]=255&t},readUint:function readUint(e,r){return 16777216*e[r]+(e[r+1]<<16|e[r+2]<<8|e[r+3])},writeUint:function writeUint(e,r,t){e[r]=t>>24&255,e[r+1]=t>>16&255,e[r+2]=t>>8&255,e[r+3]=255&t},readASCII:function readASCII(e,r,t){for(var a="",i=0;i=0&&l>=0?(y=A*r+g<<2,h=(l+A)*i+c+g<<2):(y=(-l+A)*r-c+g<<2,h=A*i+g<<2),0==u)a[h]=e[y],a[h+1]=e[y+1],a[h+2]=e[y+2],a[h+3]=e[y+3];else if(1==u){var v=e[y+3]*(1/255),m=e[y]*v,E=e[y+1]*v,I=e[y+2]*v,P=a[h+3]*(1/255),T=a[h]*P,b=a[h+1]*P,S=a[h+2]*P,R=1-v,_=v+P*R,w=0==_?0:1/_;a[h+3]=255*_,a[h+0]=(m+T*R)*w,a[h+1]=(E+b*R)*w,a[h+2]=(I+S*R)*w}else if(2==u){v=e[y+3],m=e[y],E=e[y+1],I=e[y+2],P=a[h+3],T=a[h],b=a[h+1],S=a[h+2];v==P&&m==T&&E==b&&I==S?(a[h]=0,a[h+1]=0,a[h+2]=0,a[h+3]=0):(a[h]=m,a[h+1]=E,a[h+2]=I,a[h+3]=v)}else if(3==u){v=e[y+3],m=e[y],E=e[y+1],I=e[y+2],P=a[h+3],T=a[h],b=a[h+1],S=a[h+2];if(v==P&&m==T&&E==b&&I==S)continue;if(v<220&&P>20)return!1}return!0},UPNG.encode=function(e,r,t,a,i,s,c){null==a&&(a=0),null==c&&(c=!1);var l=UPNG.encode.compress(e,r,t,a,[!1,!1,!1,0,c]);return UPNG.encode.compressPNG(l,-1),UPNG.encode._main(l,r,t,i,s)},UPNG.encodeLL=function(e,r,t,a,i,s,c,l){for(var u={ctype:0+(1==a?0:2)+(0==i?0:4),depth:s,frames:[]},p=(a+i)*s,d=p*r,y=0;y1,y=!1,h=33+(d?20:0);if(null!=i.sRGB&&(h+=13),null!=i.pHYs&&(h+=21),3==e.ctype){for(var A=e.plte.length,g=0;g>>24!=255&&(y=!0);h+=8+3*A+4+(y?8+1*A+4:0)}for(var v=0;v>>8&255,S=P>>>16&255;m[p+I+0]=T,m[p+I+1]=b,m[p+I+2]=S}if(c(m,p+=3*A,s(m,p-3*A-4,3*A+4)),p+=4,y){c(m,p,A),u(m,p+=4,"tRNS"),p+=4;for(g=0;g>>24&255;c(m,p+=A,s(m,p-A-4,A+4)),p+=4}}var R=0;for(v=0;v>2,O>>2));for(A=0;AL&&M==$[m-L])x[m]=x[m-L];else{var B=P[M];if(null==B&&(P[M]=B=T.length,T.push(M),T.length>=300))break;x[m]=B}}}var D=T.length;D<=256&&0==p&&(y=D<=2?1:D<=4?2:D<=16?4:8,y=Math.max(y,u));for(A=0;A>1)]|=q[z+K]<<4-4*(1&K);else if(2==y)for(K=0;K>2)]|=q[z+K]<<6-2*(3&K);else if(1==y)for(K=0;K>3)]|=q[z+K]<<7-1*(7&K)}V=Z,d=3,Y=1}else if(0==E&&1==I.length){Z=new Uint8Array(L*G*3);var X=L*G;for(m=0;m_&&(_=O),Uw&&(w=U))}-1==_&&(S=R=_=w=0),i&&(1==(1&S)&&S--,1==(1&R)&&R--);var C=(_-S+1)*(w-R+1);Cm&&(m=T),bE&&(E=b))}-1==m&&(g=v=m=E=0),c&&(1==(1&g)&&g--,1==(1&v)&&v--),s={x:g,y:v,width:m-g+1,height:E-v+1};var _=a[i];_.rect=s,_.blend=1,_.img=new Uint8Array(s.width*s.height*4),0==a[i-1].dispose?(UPNG._copyTile(p,r,t,_.img,s.width,s.height,-s.x,-s.y,0),UPNG.encode._prepareDiff(h,r,t,_.img,s)):UPNG._copyTile(h,r,t,_.img,s.width,s.height,-s.x,-s.y,0)},UPNG.encode._prepareDiff=function(e,r,t,a,i){UPNG._copyTile(e,r,t,a,i.width,i.height,-i.x,-i.y,2)},UPNG.encode._filterZero=function(e,r,t,a,i,s,c){var l,u=[],p=[0,1,2,3,4];-1!=s?p=[s]:(r*a>5e5||1==t)&&(p=[0]),c&&(l={level:0});for(var d,y=UZIP,h=0;h>1)+256&255;if(4==s)for(p=i;p>1)&255;for(p=i;p>1)&255}if(4==s){for(p=0;p>>1:t>>>=1;e[r]=t}return e}(),update:function update(e,r,t,a){for(var i=0;i>>8;return e},crc:function crc(e,r,t){return 4294967295^UPNG.crc.update(4294967295,e,r,t)}},UPNG.quantize=function(e,r){var t,a=new Uint8Array(e),i=a.slice(0),s=new Uint32Array(i.buffer),c=UPNG.quantize.getKDtree(i,r),l=c[0],u=c[1],p=UPNG.quantize.planeDst,d=a,y=s,h=d.length,A=new Uint8Array(a.length>>2);if(a.length<2e7)for(var g=0;g>2]=t.ind,y[g>>2]=t.est.rgba}else for(g=0;g>2]=t.ind,y[g>>2]=t.est.rgba}return{abuf:i.buffer,inds:A,plte:u}},UPNG.quantize.getKDtree=function(e,r,t){null==t&&(t=1e-4);var a=new Uint32Array(e.buffer),i={i0:0,i1:e.length,bst:null,est:null,tdst:0,left:null,right:null};i.bst=UPNG.quantize.stats(e,i.i0,i.i1),i.est=UPNG.quantize.estats(i.bst);for(var s=[i];s.lengthc&&(c=s[u].est.L,l=u);if(c=d||p.i1<=d)p.est.L=0;else{var y={i0:p.i0,i1:d,bst:null,est:null,tdst:0,left:null,right:null};y.bst=UPNG.quantize.stats(e,y.i0,y.i1),y.est=UPNG.quantize.estats(y.bst);var h={i0:d,i1:p.i1,bst:null,est:null,tdst:0,left:null,right:null};h.bst={R:[],m:[],N:p.bst.N-y.bst.N};for(u=0;u<16;u++)h.bst.R[u]=p.bst.R[u]-y.bst.R[u];for(u=0;u<4;u++)h.bst.m[u]=p.bst.m[u]-y.bst.m[u];h.est=UPNG.quantize.estats(h.bst),p.left=y,p.right=h,s[l]=y,s.push(h)}}s.sort((function(e,r){return r.bst.N-e.bst.N}));for(u=0;u0&&(c=e.right,l=e.left);var u=UPNG.quantize.getNearest(c,r,t,a,i);if(u.tdst<=s*s)return u;var p=UPNG.quantize.getNearest(l,r,t,a,i);return p.tdsts;)a-=4;if(t>=a)break;var l=r[t>>2];r[t>>2]=r[a>>2],r[a>>2]=l,t+=4,a-=4}for(;c(e,t,i)>s;)t-=4;return t+4},UPNG.quantize.vecDot=function(e,r,t){return e[r]*t[0]+e[r+1]*t[1]+e[r+2]*t[2]+e[r+3]*t[3]},UPNG.quantize.stats=function(e,r,t){for(var a=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],i=[0,0,0,0],s=t-r>>2,c=r;c>>0}},UPNG.M4={multVec:function multVec(e,r){return[e[0]*r[0]+e[1]*r[1]+e[2]*r[2]+e[3]*r[3],e[4]*r[0]+e[5]*r[1]+e[6]*r[2]+e[7]*r[3],e[8]*r[0]+e[9]*r[1]+e[10]*r[2]+e[11]*r[3],e[12]*r[0]+e[13]*r[1]+e[14]*r[2]+e[15]*r[3]]},dot:function dot(e,r){return e[0]*r[0]+e[1]*r[1]+e[2]*r[2]+e[3]*r[3]},sml:function sml(e,r){return[e*r[0],e*r[1],e*r[2],e*r[3]]}},UPNG.encode.concatRGBA=function(e){for(var r=0,t=0;t2&&void 0!==arguments[2]?arguments[2]:Date.now();return new Promise((function(a){for(var i=e.split(","),s=i[0].match(/:(.*?);/)[1],c=globalThis.atob(i[1]),l=c.length,u=new Uint8Array(l);l--;)u[l]=c.charCodeAt(l);var p=new Blob([u],{type:s});p.name=r,p.lastModified=t,a(p)}))}function getDataUrlFromFile(e){return new Promise((function(r,t){var a=new CustomFileReader;a.onload=function(){return r(a.result)},a.onerror=function(e){return t(e)},a.readAsDataURL(e)}))}function loadImage(e){return new Promise((function(r,t){var a=new Image;a.onload=function(){return r(a)},a.onerror=function(e){return t(e)},a.src=e}))}function getBrowserName(){var e="etc";return-1===navigator.userAgent.indexOf("Chrome")&&-1===navigator.userAgent.indexOf("Chromium")||(e="chrome"),-1!==navigator.userAgent.indexOf("Safari")?e="safari":-1!==navigator.userAgent.indexOf("Firefox")?e="firefox":-1===navigator.userAgent.indexOf("MSIE")&&!0!=!!document.documentMode||(e="internet explorer"),e}function approximateBelowMaximumCanvasSizeOfBrowser(e,r){for(var t=getBrowserName(),a=MaxCanvasSize[t],i=e,s=r,c=i*s,l=i>s?s/i:i/s;c>a*a;){var u=(a+i)/2,p=(a+s)/2;u4&&void 0!==arguments[4]?arguments[4]:1;return new Promise((function(s,c){var l,u,p;if("image/png"===r)return u=e.getContext("2d").getImageData(0,0,e.width,e.height).data,p=UPNG.encode([u],e.width,e.height,256*i),(l=new Blob([p],{type:r})).name=t,l.lastModified=a,$If_4.call(this);{return"function"==typeof OffscreenCanvas&&e instanceof OffscreenCanvas?e.convertToBlob({type:r,quality:i}).then(function(e){try{return(l=e).name=t,l.lastModified=a,$If_5.call(this)}catch(e){return c(e)}}.bind(this),c):getFilefromDataUrl(e.toDataURL(r,i),t,a).then(function(e){try{return l=e,$If_5.call(this)}catch(e){return c(e)}}.bind(this),c);function $If_5(){return $If_4.call(this)}}function $If_4(){return s(l)}}))}function cleanupCanvasMemory(e){e.width=0,e.height=0}function isAutoOrientationInBrowser(){return new Promise((function(e,r){var t,a,i,s;return void 0!==isAutoOrientationInBrowser.result?e(isAutoOrientationInBrowser.result):("data:image/jpeg;base64,/9j/4QAiRXhpZgAATU0AKgAAAAgAAQESAAMAAAABAAYAAAAAAAD/2wCEAAEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAf/AABEIAAEAAgMBEQACEQEDEQH/xABKAAEAAAAAAAAAAAAAAAAAAAALEAEAAAAAAAAAAAAAAAAAAAAAAQEAAAAAAAAAAAAAAAAAAAAAEQEAAAAAAAAAAAAAAAAAAAAA/9oADAMBAAIRAxEAPwA/8H//2Q==",getFilefromDataUrl("data:image/jpeg;base64,/9j/4QAiRXhpZgAATU0AKgAAAAgAAQESAAMAAAABAAYAAAAAAAD/2wCEAAEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAf/AABEIAAEAAgMBEQACEQEDEQH/xABKAAEAAAAAAAAAAAAAAAAAAAALEAEAAAAAAAAAAAAAAAAAAAAAAQEAAAAAAAAAAAAAAAAAAAAAEQEAAAAAAAAAAAAAAAAAAAAA/9oADAMBAAIRAxEAPwA/8H//2Q==","test.jpg",Date.now()).then((function(c){try{return drawFileInCanvas(t=c).then((function(c){try{return canvasToFile(a=c[1],t.type,t.name,t.lastModified).then((function(t){try{return i=t,cleanupCanvasMemory(a),drawFileInCanvas(i).then((function(t){try{return s=t[0],isAutoOrientationInBrowser.result=1===s.width&&2===s.height,e(isAutoOrientationInBrowser.result)}catch(e){return r(e)}}),r)}catch(e){return r(e)}}),r)}catch(e){return r(e)}}),r)}catch(e){return r(e)}}),r))}))}function getExifOrientation(e){return new Promise((function(r,t){var a=new CustomFileReader;a.onload=function(e){var t=new DataView(e.target.result);if(65496!=t.getUint16(0,!1))return r(-2);for(var a=t.byteLength,i=2;is||i>s)){var l=_slicedToArray(getNewCanvasAndCtx(a,i),2);c=l[0],t=l[1],a>i?(c.width=s,c.height=i/a*s):(c.width=a/i*s,c.height=s),t.drawImage(e,0,0,c.width,c.height),cleanupCanvasMemory(e)}return c}function followExifOrientation(e,r){var t=e.width,a=e.height,i=_slicedToArray(getNewCanvasAndCtx(t,a),2),s=i[0],c=i[1];switch(r>4&&r<9?(s.width=a,s.height=t):(s.width=t,s.height=a),r){case 2:c.transform(-1,0,0,1,t,0);break;case 3:c.transform(-1,0,0,-1,t,a);break;case 4:c.transform(1,0,0,-1,0,a);break;case 5:c.transform(0,1,1,0,0,0);break;case 6:c.transform(0,1,-1,0,a,0);break;case 7:c.transform(0,-1,-1,0,a,t);break;case 8:c.transform(0,-1,1,0,0,t)}return c.drawImage(e,0,0,t,a),cleanupCanvasMemory(e),s}function compress(e,r){var t=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;return new Promise((function(a,i){var s,c,l,u,p,d,y,h,A,g,v,m,E,I,P,T,b,S;function incProgress(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:5;s+=e,r.onProgress(Math.min(s,100))}function setProgress(e){s=Math.min(Math.max(e,s),100),r.onProgress(s)}return s=t,c=r.maxIteration||10,l=1024*r.maxSizeMB*1024,incProgress(),drawFileInCanvas(e).then(function(t){try{var s=_slicedToArray(t,2);return u=s[1],incProgress(),p=handleMaxWidthOrHeight(u,r),incProgress(),new Promise((function(t,a){var i;if(!(i=r.exifOrientation))return getExifOrientation(e).then(function(e){try{return i=e,$If_2.call(this)}catch(e){return a(e)}}.bind(this),a);function $If_2(){return t(i)}return $If_2.call(this)})).then(function(t){try{return d=t,incProgress(),isAutoOrientationInBrowser().then(function(t){try{return y=t?p:followExifOrientation(p,d),incProgress(),h=r.initialQuality||1,A=r.fileType||e.type,canvasToFile(y,A,e.name,e.lastModified,h).then(function(r){try{{if(g=r,incProgress(),v=g.size>l,m=g.size>e.size,!v&&!m)return setProgress(100),a(g);var t;function $Loop_3(){if(c--&&(P>l||P>E)){var r,t,a=_slicedToArray(getNewCanvasAndCtx(r=v?.95*S.width:S.width,t=v?.95*S.height:S.height),2);return b=a[0],a[1].drawImage(S,0,0,r,t),h*=.95,canvasToFile(b,A,e.name,e.lastModified,h).then((function(e){try{return T=e,cleanupCanvasMemory(S),S=b,P=T.size,setProgress(Math.min(99,Math.floor((I-P)/(I-l)*100))),$Loop_3}catch(e){return i(e)}}),i)}return[1]}return E=e.size,I=g.size,P=I,S=y,(t=function(e){for(;e;){if(e.then)return void e.then(t,i);try{if(e.pop){if(e.length)return e.pop()?$Loop_3_exit.call(this):e;e=$Loop_3}else e=e.call(this)}catch(e){return i(e)}}}.bind(this))($Loop_3);function $Loop_3_exit(){return cleanupCanvasMemory(S),cleanupCanvasMemory(b),cleanupCanvasMemory(p),cleanupCanvasMemory(y),cleanupCanvasMemory(u),setProgress(100),a(T)}}}catch(e){return i(e)}}.bind(this),i)}catch(e){return i(e)}}.bind(this),i)}catch(e){return i(e)}}.bind(this),i)}catch(e){return i(e)}}.bind(this),i)}))}var charAt=stringMultibyte.charAt,STRING_ITERATOR="String Iterator",setInternalState$2=internalState.set,getInternalState=internalState.getterFor(STRING_ITERATOR);defineIterator(String,"String",(function(e){setInternalState$2(this,{type:STRING_ITERATOR,string:toString(e),index:0})}),(function next(){var e,r=getInternalState(this),t=r.string,a=r.index;return a>=t.length?{value:void 0,done:!0}:(e=charAt(t,a),r.index+=e.length,{value:e,done:!1})}));var domIterables={CSSRuleList:0,CSSStyleDeclaration:0,CSSValueList:0,ClientRectList:0,DOMRectList:0,DOMStringList:0,DOMTokenList:1,DataTransferItemList:0,FileList:0,HTMLAllCollection:0,HTMLCollection:0,HTMLFormElement:0,HTMLSelectElement:0,MediaList:0,MimeTypeArray:0,NamedNodeMap:0,NodeList:1,PaintRequestList:0,Plugin:0,PluginArray:0,SVGLengthList:0,SVGNumberList:0,SVGPathSegList:0,SVGPointList:0,SVGStringList:0,SVGTransformList:0,SourceBufferList:0,StyleSheetList:0,TextTrackCueList:0,TextTrackList:0,TouchList:0},ITERATOR$2=wellKnownSymbol("iterator"),TO_STRING_TAG=wellKnownSymbol("toStringTag"),ArrayValues=es_array_iterator.values;for(var COLLECTION_NAME$1 in domIterables){var Collection$1=global$1[COLLECTION_NAME$1],CollectionPrototype$1=Collection$1&&Collection$1.prototype;if(CollectionPrototype$1){if(CollectionPrototype$1[ITERATOR$2]!==ArrayValues)try{createNonEnumerableProperty(CollectionPrototype$1,ITERATOR$2,ArrayValues)}catch(e){CollectionPrototype$1[ITERATOR$2]=ArrayValues}if(CollectionPrototype$1[TO_STRING_TAG]||createNonEnumerableProperty(CollectionPrototype$1,TO_STRING_TAG,COLLECTION_NAME$1),domIterables[COLLECTION_NAME$1])for(var METHOD_NAME in es_array_iterator)if(CollectionPrototype$1[METHOD_NAME]!==es_array_iterator[METHOD_NAME])try{createNonEnumerableProperty(CollectionPrototype$1,METHOD_NAME,es_array_iterator[METHOD_NAME])}catch(e){CollectionPrototype$1[METHOD_NAME]=es_array_iterator[METHOD_NAME]}}}var ITERATOR$1=wellKnownSymbol("iterator"),nativeUrl=!fails((function(){var e=new URL("b?a=1&b=2&c=3","http://a"),r=e.searchParams,t="";return e.pathname="c%20d",r.forEach((function(e,a){r.delete("b"),t+=a+e})),isPure&&!e.toJSON||!r.sort||"http://a/c%20d?a=1&c=3"!==e.href||"3"!==r.get("c")||"a=1"!==String(new URLSearchParams("?a=1"))||!r[ITERATOR$1]||"a"!==new URL("https://a@b").username||"b"!==new URLSearchParams(new URLSearchParams("a=b")).get("a")||"xn--e1aybc"!==new URL("http://тест").host||"#%D0%B1"!==new URL("http://a#б").hash||"a1c3"!==t||"x"!==new URL("http://x",void 0).host})),callWithSafeIterationClosing=function(e,r,t,a){try{return a?r(anObject(t)[0],t[1]):r(t)}catch(r){throw iteratorClose(e),r}},arrayFrom=function from(e){var r,t,a,i,s,c,l=toObject(e),u="function"==typeof this?this:Array,p=arguments.length,d=p>1?arguments[1]:void 0,y=void 0!==d,h=getIteratorMethod(l),A=0;if(y&&(d=functionBindContext(d,p>2?arguments[2]:void 0,2)),null==h||u==Array&&isArrayIteratorMethod(h))for(t=new u(r=toLength(l.length));r>A;A++)c=y?d(l[A],A):l[A],createProperty(t,A,c);else for(s=(i=h.call(l)).next,t=new u;!(a=s.call(i)).done;A++)c=y?callWithSafeIterationClosing(i,d,[a.value,A],!0):a.value,createProperty(t,A,c);return t.length=A,t},maxInt=2147483647,base=36,tMin=1,tMax=26,skew=38,damp=700,initialBias=72,initialN=128,delimiter="-",regexNonASCII=/[^\0-\u007E]/,regexSeparators=/[.\u3002\uFF0E\uFF61]/g,OVERFLOW_ERROR="Overflow: input needs wider integers to process",baseMinusTMin=base-tMin,floor$2=Math.floor,stringFromCharCode=String.fromCharCode,ucs2decode=function(e){for(var r=[],t=0,a=e.length;t=55296&&i<=56319&&t>1,e+=floor$2(e/r);e>baseMinusTMin*tMax>>1;a+=base)e=floor$2(e/baseMinusTMin);return floor$2(a+(baseMinusTMin+1)*e/(e+skew))},encode=function(e){var r,t,a=[],i=(e=ucs2decode(e)).length,s=initialN,c=0,l=initialBias;for(r=0;r=s&&tfloor$2((maxInt-c)/y))throw RangeError(OVERFLOW_ERROR);for(c+=(d-s)*y,s=d,r=0;rmaxInt)throw RangeError(OVERFLOW_ERROR);if(t==s){for(var h=c,A=base;;A+=base){var g=A<=l?tMin:A>=l+tMax?tMax:A-l;if(h0?arguments[0]:void 0,d=this,y=[];if(setInternalState$1(d,{type:URL_SEARCH_PARAMS,entries:y,updateURL:function(){},updateSearchParams:updateSearchParams}),void 0!==p)if(isObject(p))if("function"==typeof(e=getIteratorMethod(p)))for(t=(r=e.call(p)).next;!(a=t.call(r)).done;){if((c=(s=(i=getIterator(anObject(a.value))).next).call(i)).done||(l=s.call(i)).done||!s.call(i).done)throw TypeError("Expected sequence with length 2");y.push({key:toString(c.value),value:toString(l.value)})}else for(u in p)has$1(p,u)&&y.push({key:u,value:toString(p[u])});else parseSearchParams(y,"string"==typeof p?"?"===p.charAt(0)?p.slice(1):p:toString(p))},URLSearchParamsPrototype=URLSearchParamsConstructor.prototype;if(redefineAll(URLSearchParamsPrototype,{append:function append(e,r){validateArgumentsLength(arguments.length,2);var t=getInternalParamsState(this);t.entries.push({key:toString(e),value:toString(r)}),t.updateURL()},delete:function(e){validateArgumentsLength(arguments.length,1);for(var r=getInternalParamsState(this),t=r.entries,a=toString(e),i=0;ie.key){i.splice(r,0,e);break}r===t&&i.push(e)}a.updateURL()},forEach:function forEach(e){for(var r,t=getInternalParamsState(this).entries,a=functionBindContext(e,arguments.length>1?arguments[1]:void 0,3),i=0;i1?wrapRequestOptions(arguments[1]):{})}}),"function"==typeof NativeRequest){var RequestConstructor=function Request(e){return anInstance(this,RequestConstructor,"Request"),new NativeRequest(e,arguments.length>1?wrapRequestOptions(arguments[1]):{})};RequestPrototype.constructor=RequestConstructor,RequestConstructor.prototype=RequestPrototype,_export({global:!0,forced:!0},{Request:RequestConstructor})}}var web_urlSearchParams={URLSearchParams:URLSearchParamsConstructor,getState:getInternalParamsState},codeAt=stringMultibyte.codeAt,NativeURL=global$1.URL,URLSearchParams$1=web_urlSearchParams.URLSearchParams,getInternalSearchParamsState=web_urlSearchParams.getState,setInternalState=internalState.set,getInternalURLState=internalState.getterFor("URL"),floor$1=Math.floor,pow=Math.pow,INVALID_AUTHORITY="Invalid authority",INVALID_SCHEME="Invalid scheme",INVALID_HOST="Invalid host",INVALID_PORT="Invalid port",ALPHA=/[A-Za-z]/,ALPHANUMERIC=/[\d+-.A-Za-z]/,DIGIT=/\d/,HEX_START=/^0x/i,OCT=/^[0-7]+$/,DEC=/^\d+$/,HEX=/^[\dA-Fa-f]+$/,FORBIDDEN_HOST_CODE_POINT=/[\0\t\n\r #%/:<>?@[\\\]^|]/,FORBIDDEN_HOST_CODE_POINT_EXCLUDING_PERCENT=/[\0\t\n\r #/:<>?@[\\\]^|]/,LEADING_AND_TRAILING_C0_CONTROL_OR_SPACE=/^[\u0000-\u0020]+|[\u0000-\u0020]+$/g,TAB_AND_NEW_LINE=/[\t\n\r]/g,EOF,parseHost=function(e,r){var t,a,i;if("["==r.charAt(0)){if("]"!=r.charAt(r.length-1))return INVALID_HOST;if(!(t=parseIPv6(r.slice(1,-1))))return INVALID_HOST;e.host=t}else if(isSpecial(e)){if(r=stringPunycodeToAscii(r),FORBIDDEN_HOST_CODE_POINT.test(r))return INVALID_HOST;if(null===(t=parseIPv4(r)))return INVALID_HOST;e.host=t}else{if(FORBIDDEN_HOST_CODE_POINT_EXCLUDING_PERCENT.test(r))return INVALID_HOST;for(t="",a=arrayFrom(r),i=0;i4)return e;for(t=[],a=0;a1&&"0"==i.charAt(0)&&(s=HEX_START.test(i)?16:8,i=i.slice(8==s?1:2)),""===i)c=0;else{if(!(10==s?DEC:8==s?OCT:HEX).test(i))return e;c=parseInt(i,s)}t.push(c)}for(a=0;a=pow(256,5-r))return null}else if(c>255)return null;for(l=t.pop(),a=0;a6)return;for(a=0;char();){if(i=null,a>0){if(!("."==char()&&a<4))return;y++}if(!DIGIT.test(char()))return;for(;DIGIT.test(char());){if(s=parseInt(char(),10),null===i)i=s;else{if(0==i)return;i=10*i+s}if(i>255)return;y++}u[p]=256*u[p]+i,2!=++a&&4!=a||p++}if(4!=a)return;break}if(":"==char()){if(y++,!char())return}else if(char())return;u[p++]=r}else{if(null!==d)return;y++,d=++p}}if(null!==d)for(c=p-d,p=7;0!=p&&c>0;)l=u[p],u[p--]=u[d+c-1],u[d+--c]=l;else if(8!=p)return;return u},findLongestZeroSequence=function(e){for(var r=null,t=1,a=null,i=0,s=0;s<8;s++)0!==e[s]?(i>t&&(r=a,t=i),a=null,i=0):(null===a&&(a=s),++i);return i>t&&(r=a,t=i),r},serializeHost=function(e){var r,t,a,i;if("number"==typeof e){for(r=[],t=0;t<4;t++)r.unshift(e%256),e=floor$1(e/256);return r.join(".")}if("object"==typeof e){for(r="",a=findLongestZeroSequence(e),t=0;t<8;t++)i&&0===e[t]||(i&&(i=!1),a===t?(r+=t?":":"::",i=!0):(r+=e[t].toString(16),t<7&&(r+=":")));return"["+r+"]"}return e},C0ControlPercentEncodeSet={},fragmentPercentEncodeSet=objectAssign({},C0ControlPercentEncodeSet,{" ":1,'"':1,"<":1,">":1,"`":1}),pathPercentEncodeSet=objectAssign({},fragmentPercentEncodeSet,{"#":1,"?":1,"{":1,"}":1}),userinfoPercentEncodeSet=objectAssign({},pathPercentEncodeSet,{"/":1,":":1,";":1,"=":1,"@":1,"[":1,"\\":1,"]":1,"^":1,"|":1}),percentEncode=function(e,r){var t=codeAt(e,0);return t>32&&t<127&&!has$1(r,e)?e:encodeURIComponent(e)},specialSchemes={ftp:21,file:null,http:80,https:443,ws:80,wss:443},isSpecial=function(e){return has$1(specialSchemes,e.scheme)},includesCredentials=function(e){return""!=e.username||""!=e.password},cannotHaveUsernamePasswordPort=function(e){return!e.host||e.cannotBeABaseURL||"file"==e.scheme},isWindowsDriveLetter=function(e,r){var t;return 2==e.length&&ALPHA.test(e.charAt(0))&&(":"==(t=e.charAt(1))||!r&&"|"==t)},startsWithWindowsDriveLetter=function(e){var r;return e.length>1&&isWindowsDriveLetter(e.slice(0,2))&&(2==e.length||"/"===(r=e.charAt(2))||"\\"===r||"?"===r||"#"===r)},shortenURLsPath=function(e){var r=e.path,t=r.length;!t||"file"==e.scheme&&1==t&&isWindowsDriveLetter(r[0],!0)||r.pop()},isSingleDot=function(e){return"."===e||"%2e"===e.toLowerCase()},isDoubleDot=function(e){return".."===(e=e.toLowerCase())||"%2e."===e||".%2e"===e||"%2e%2e"===e},SCHEME_START={},SCHEME={},NO_SCHEME={},SPECIAL_RELATIVE_OR_AUTHORITY={},PATH_OR_AUTHORITY={},RELATIVE={},RELATIVE_SLASH={},SPECIAL_AUTHORITY_SLASHES={},SPECIAL_AUTHORITY_IGNORE_SLASHES={},AUTHORITY={},HOST={},HOSTNAME={},PORT={},FILE={},FILE_SLASH={},FILE_HOST={},PATH_START={},PATH={},CANNOT_BE_A_BASE_URL_PATH={},QUERY={},FRAGMENT={},parseURL=function(e,r,t,a){var i,s,c,l,u=t||SCHEME_START,p=0,d="",y=!1,h=!1,A=!1;for(t||(e.scheme="",e.username="",e.password="",e.host=null,e.port=null,e.path=[],e.query=null,e.fragment=null,e.cannotBeABaseURL=!1,r=r.replace(LEADING_AND_TRAILING_C0_CONTROL_OR_SPACE,"")),r=r.replace(TAB_AND_NEW_LINE,""),i=arrayFrom(r);p<=i.length;){switch(s=i[p],u){case SCHEME_START:if(!s||!ALPHA.test(s)){if(t)return INVALID_SCHEME;u=NO_SCHEME;continue}d+=s.toLowerCase(),u=SCHEME;break;case SCHEME:if(s&&(ALPHANUMERIC.test(s)||"+"==s||"-"==s||"."==s))d+=s.toLowerCase();else{if(":"!=s){if(t)return INVALID_SCHEME;d="",u=NO_SCHEME,p=0;continue}if(t&&(isSpecial(e)!=has$1(specialSchemes,d)||"file"==d&&(includesCredentials(e)||null!==e.port)||"file"==e.scheme&&!e.host))return;if(e.scheme=d,t)return void(isSpecial(e)&&specialSchemes[e.scheme]==e.port&&(e.port=null));d="","file"==e.scheme?u=FILE:isSpecial(e)&&a&&a.scheme==e.scheme?u=SPECIAL_RELATIVE_OR_AUTHORITY:isSpecial(e)?u=SPECIAL_AUTHORITY_SLASHES:"/"==i[p+1]?(u=PATH_OR_AUTHORITY,p++):(e.cannotBeABaseURL=!0,e.path.push(""),u=CANNOT_BE_A_BASE_URL_PATH)}break;case NO_SCHEME:if(!a||a.cannotBeABaseURL&&"#"!=s)return INVALID_SCHEME;if(a.cannotBeABaseURL&&"#"==s){e.scheme=a.scheme,e.path=a.path.slice(),e.query=a.query,e.fragment="",e.cannotBeABaseURL=!0,u=FRAGMENT;break}u="file"==a.scheme?FILE:RELATIVE;continue;case SPECIAL_RELATIVE_OR_AUTHORITY:if("/"!=s||"/"!=i[p+1]){u=RELATIVE;continue}u=SPECIAL_AUTHORITY_IGNORE_SLASHES,p++;break;case PATH_OR_AUTHORITY:if("/"==s){u=AUTHORITY;break}u=PATH;continue;case RELATIVE:if(e.scheme=a.scheme,s==EOF)e.username=a.username,e.password=a.password,e.host=a.host,e.port=a.port,e.path=a.path.slice(),e.query=a.query;else if("/"==s||"\\"==s&&isSpecial(e))u=RELATIVE_SLASH;else if("?"==s)e.username=a.username,e.password=a.password,e.host=a.host,e.port=a.port,e.path=a.path.slice(),e.query="",u=QUERY;else{if("#"!=s){e.username=a.username,e.password=a.password,e.host=a.host,e.port=a.port,e.path=a.path.slice(),e.path.pop(),u=PATH;continue}e.username=a.username,e.password=a.password,e.host=a.host,e.port=a.port,e.path=a.path.slice(),e.query=a.query,e.fragment="",u=FRAGMENT}break;case RELATIVE_SLASH:if(!isSpecial(e)||"/"!=s&&"\\"!=s){if("/"!=s){e.username=a.username,e.password=a.password,e.host=a.host,e.port=a.port,u=PATH;continue}u=AUTHORITY}else u=SPECIAL_AUTHORITY_IGNORE_SLASHES;break;case SPECIAL_AUTHORITY_SLASHES:if(u=SPECIAL_AUTHORITY_IGNORE_SLASHES,"/"!=s||"/"!=d.charAt(p+1))continue;p++;break;case SPECIAL_AUTHORITY_IGNORE_SLASHES:if("/"!=s&&"\\"!=s){u=AUTHORITY;continue}break;case AUTHORITY:if("@"==s){y&&(d="%40"+d),y=!0,c=arrayFrom(d);for(var g=0;g65535)return INVALID_PORT;e.port=isSpecial(e)&&E===specialSchemes[e.scheme]?null:E,d=""}if(t)return;u=PATH_START;continue}return INVALID_PORT}d+=s;break;case FILE:if(e.scheme="file","/"==s||"\\"==s)u=FILE_SLASH;else{if(!a||"file"!=a.scheme){u=PATH;continue}if(s==EOF)e.host=a.host,e.path=a.path.slice(),e.query=a.query;else if("?"==s)e.host=a.host,e.path=a.path.slice(),e.query="",u=QUERY;else{if("#"!=s){startsWithWindowsDriveLetter(i.slice(p).join(""))||(e.host=a.host,e.path=a.path.slice(),shortenURLsPath(e)),u=PATH;continue}e.host=a.host,e.path=a.path.slice(),e.query=a.query,e.fragment="",u=FRAGMENT}}break;case FILE_SLASH:if("/"==s||"\\"==s){u=FILE_HOST;break}a&&"file"==a.scheme&&!startsWithWindowsDriveLetter(i.slice(p).join(""))&&(isWindowsDriveLetter(a.path[0],!0)?e.path.push(a.path[0]):e.host=a.host),u=PATH;continue;case FILE_HOST:if(s==EOF||"/"==s||"\\"==s||"?"==s||"#"==s){if(!t&&isWindowsDriveLetter(d))u=PATH;else if(""==d){if(e.host="",t)return;u=PATH_START}else{if(l=parseHost(e,d))return l;if("localhost"==e.host&&(e.host=""),t)return;d="",u=PATH_START}continue}d+=s;break;case PATH_START:if(isSpecial(e)){if(u=PATH,"/"!=s&&"\\"!=s)continue}else if(t||"?"!=s)if(t||"#"!=s){if(s!=EOF&&(u=PATH,"/"!=s))continue}else e.fragment="",u=FRAGMENT;else e.query="",u=QUERY;break;case PATH:if(s==EOF||"/"==s||"\\"==s&&isSpecial(e)||!t&&("?"==s||"#"==s)){if(isDoubleDot(d)?(shortenURLsPath(e),"/"==s||"\\"==s&&isSpecial(e)||e.path.push("")):isSingleDot(d)?"/"==s||"\\"==s&&isSpecial(e)||e.path.push(""):("file"==e.scheme&&!e.path.length&&isWindowsDriveLetter(d)&&(e.host&&(e.host=""),d=d.charAt(0)+":"),e.path.push(d)),d="","file"==e.scheme&&(s==EOF||"?"==s||"#"==s))for(;e.path.length>1&&""===e.path[0];)e.path.shift();"?"==s?(e.query="",u=QUERY):"#"==s&&(e.fragment="",u=FRAGMENT)}else d+=percentEncode(s,pathPercentEncodeSet);break;case CANNOT_BE_A_BASE_URL_PATH:"?"==s?(e.query="",u=QUERY):"#"==s?(e.fragment="",u=FRAGMENT):s!=EOF&&(e.path[0]+=percentEncode(s,C0ControlPercentEncodeSet));break;case QUERY:t||"#"!=s?s!=EOF&&("'"==s&&isSpecial(e)?e.query+="%27":e.query+="#"==s?"%23":percentEncode(s,C0ControlPercentEncodeSet)):(e.fragment="",u=FRAGMENT);break;case FRAGMENT:s!=EOF&&(e.fragment+=percentEncode(s,fragmentPercentEncodeSet))}p++}},URLConstructor=function URL(e){var r,t,a=anInstance(this,URLConstructor,"URL"),i=arguments.length>1?arguments[1]:void 0,s=toString(e),c=setInternalState(a,{type:"URL"});if(void 0!==i)if(i instanceof URLConstructor)r=getInternalURLState(i);else if(t=parseURL(r={},toString(i)))throw TypeError(t);if(t=parseURL(c,s,null,r))throw TypeError(t);var l=c.searchParams=new URLSearchParams$1,u=getInternalSearchParamsState(l);u.updateSearchParams(c.query),u.updateURL=function(){c.query=String(l)||null},descriptors||(a.href=serializeURL.call(a),a.origin=getOrigin.call(a),a.protocol=getProtocol.call(a),a.username=getUsername.call(a),a.password=getPassword.call(a),a.host=getHost.call(a),a.hostname=getHostname.call(a),a.port=getPort.call(a),a.pathname=getPathname.call(a),a.search=getSearch.call(a),a.searchParams=getSearchParams.call(a),a.hash=getHash.call(a))},URLPrototype=URLConstructor.prototype,serializeURL=function(){var e=getInternalURLState(this),r=e.scheme,t=e.username,a=e.password,i=e.host,s=e.port,c=e.path,l=e.query,u=e.fragment,p=r+":";return null!==i?(p+="//",includesCredentials(e)&&(p+=t+(a?":"+a:"")+"@"),p+=serializeHost(i),null!==s&&(p+=":"+s)):"file"==r&&(p+="//"),p+=e.cannotBeABaseURL?c[0]:c.length?"/"+c.join("/"):"",null!==l&&(p+="?"+l),null!==u&&(p+="#"+u),p},getOrigin=function(){var e=getInternalURLState(this),r=e.scheme,t=e.port;if("blob"==r)try{return new URLConstructor(r.path[0]).origin}catch(e){return"null"}return"file"!=r&&isSpecial(e)?r+"://"+serializeHost(e.host)+(null!==t?":"+t:""):"null"},getProtocol=function(){return getInternalURLState(this).scheme+":"},getUsername=function(){return getInternalURLState(this).username},getPassword=function(){return getInternalURLState(this).password},getHost=function(){var e=getInternalURLState(this),r=e.host,t=e.port;return null===r?"":null===t?serializeHost(r):serializeHost(r)+":"+t},getHostname=function(){var e=getInternalURLState(this).host;return null===e?"":serializeHost(e)},getPort=function(){var e=getInternalURLState(this).port;return null===e?"":String(e)},getPathname=function(){var e=getInternalURLState(this),r=e.path;return e.cannotBeABaseURL?r[0]:r.length?"/"+r.join("/"):""},getSearch=function(){var e=getInternalURLState(this).query;return e?"?"+e:""},getSearchParams=function(){return getInternalURLState(this).searchParams},getHash=function(){var e=getInternalURLState(this).fragment;return e?"#"+e:""},accessorDescriptor=function(e,r){return{get:e,set:r,configurable:!0,enumerable:!0}};if(descriptors&&objectDefineProperties(URLPrototype,{href:accessorDescriptor(serializeURL,(function(e){var r=getInternalURLState(this),t=toString(e),a=parseURL(r,t);if(a)throw TypeError(a);getInternalSearchParamsState(r.searchParams).updateSearchParams(r.query)})),origin:accessorDescriptor(getOrigin),protocol:accessorDescriptor(getProtocol,(function(e){var r=getInternalURLState(this);parseURL(r,toString(e)+":",SCHEME_START)})),username:accessorDescriptor(getUsername,(function(e){var r=getInternalURLState(this),t=arrayFrom(toString(e));if(!cannotHaveUsernamePasswordPort(r)){r.username="";for(var a=0;a1?arguments[1]:void 0)};for(var COLLECTION_NAME in domIterables){var Collection=global$1[COLLECTION_NAME],CollectionPrototype=Collection&&Collection.prototype;if(CollectionPrototype&&CollectionPrototype.forEach!==arrayForEach)try{createNonEnumerableProperty(CollectionPrototype,"forEach",arrayForEach)}catch(e){CollectionPrototype.forEach=arrayForEach}}var propertyIsEnumerable=objectPropertyIsEnumerable.f,createMethod=function(e){return function(r){for(var t,a=toIndexedObject(r),i=objectKeys(a),s=i.length,c=0,l=[];s>c;)t=i[c++],descriptors&&!propertyIsEnumerable.call(a,t)||l.push(e?[t,a[t]]:a[t]);return l}},objectToArray={entries:createMethod(!0),values:createMethod(!1)},$entries=objectToArray.entries;_export({target:"Object",stat:!0},{entries:function entries(e){return $entries(e)}});var notARegexp=function(e){if(isRegexp(e))throw TypeError("The method doesn't accept regular expressions");return e},MATCH=wellKnownSymbol("match"),correctIsRegexpLogic=function(e){var r=/./;try{"/./"[e](r)}catch(t){try{return r[MATCH]=!1,"/./"[e](r)}catch(e){}}return!1},getOwnPropertyDescriptor=objectGetOwnPropertyDescriptor.f,$startsWith="".startsWith,min$1=Math.min,CORRECT_IS_REGEXP_LOGIC=correctIsRegexpLogic("startsWith"),MDN_POLYFILL_BUG=!(CORRECT_IS_REGEXP_LOGIC||(descriptor=getOwnPropertyDescriptor(String.prototype,"startsWith"),!descriptor||descriptor.writable)),descriptor;_export({target:"String",proto:!0,forced:!MDN_POLYFILL_BUG&&!CORRECT_IS_REGEXP_LOGIC},{startsWith:function startsWith(e){var r=toString(requireObjectCoercible(this));notARegexp(e);var t=toLength(min$1(arguments.length>1?arguments[1]:void 0,r.length)),a=toString(e);return $startsWith?$startsWith.call(r,a,t):r.slice(t,t+a.length)===a}});var floor=Math.floor,replace="".replace,SUBSTITUTION_SYMBOLS=/\$([$&'`]|\d{1,2}|<[^>]*>)/g,SUBSTITUTION_SYMBOLS_NO_NAMED=/\$([$&'`]|\d{1,2})/g,getSubstitution=function(e,r,t,a,i,s){var c=t+e.length,l=a.length,u=SUBSTITUTION_SYMBOLS_NO_NAMED;return void 0!==i&&(i=toObject(i),u=SUBSTITUTION_SYMBOLS),replace.call(s,u,(function(s,u){var p;switch(u.charAt(0)){case"$":return"$";case"&":return e;case"`":return r.slice(0,t);case"'":return r.slice(c);case"<":p=i[u.slice(1,-1)];break;default:var d=+u;if(0===d)return s;if(d>l){var y=floor(d/10);return 0===y?s:y<=l?void 0===a[y-1]?u.charAt(1):a[y-1]+u.charAt(1):s}p=a[d-1]}return void 0===p?"":p}))},REPLACE=wellKnownSymbol("replace"),max=Math.max,min=Math.min,maybeToString=function(e){return void 0===e?e:String(e)},REPLACE_KEEPS_$0="$0"==="a".replace(/./,"$0"),REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE=!!/./[REPLACE]&&""===/./[REPLACE]("a","$0"),REPLACE_SUPPORTS_NAMED_GROUPS=!fails((function(){var e=/./;return e.exec=function(){var e=[];return e.groups={a:"7"},e},"7"!=="".replace(e,"$")}));fixRegexpWellKnownSymbolLogic("replace",(function(e,r,t){var a=REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE?"$":"$0";return[function replace(e,t){var a=requireObjectCoercible(this),i=null==e?void 0:e[REPLACE];return void 0!==i?i.call(e,a,t):r.call(toString(a),e,t)},function(e,i){var s=anObject(this),c=toString(e);if("string"==typeof i&&-1===i.indexOf(a)&&-1===i.indexOf("$<")){var l=t(r,s,c,i);if(l.done)return l.value}var u="function"==typeof i;u||(i=toString(i));var p=s.global;if(p){var d=s.unicode;s.lastIndex=0}for(var y=[];;){var h=regexpExecAbstract(s,c);if(null===h)break;if(y.push(h),!p)break;""===toString(h[0])&&(s.lastIndex=advanceStringIndex(c,toLength(s.lastIndex),d))}for(var A="",g=0,v=0;v=g&&(A+=c.slice(g,E)+S,g=E+m.length)}return A+c.slice(g)}]}),!REPLACE_SUPPORTS_NAMED_GROUPS||!REPLACE_KEEPS_$0||REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE);var IS_CONCAT_SPREADABLE=wellKnownSymbol("isConcatSpreadable"),MAX_SAFE_INTEGER=9007199254740991,MAXIMUM_ALLOWED_INDEX_EXCEEDED="Maximum allowed index exceeded",IS_CONCAT_SPREADABLE_SUPPORT=engineV8Version>=51||!fails((function(){var e=[];return e[IS_CONCAT_SPREADABLE]=!1,e.concat()[0]!==e})),SPECIES_SUPPORT=arrayMethodHasSpeciesSupport("concat"),isConcatSpreadable=function(e){if(!isObject(e))return!1;var r=e[IS_CONCAT_SPREADABLE];return void 0!==r?!!r:isArray(e)},FORCED=!IS_CONCAT_SPREADABLE_SUPPORT||!SPECIES_SUPPORT;_export({target:"Array",proto:!0,forced:FORCED},{concat:function concat(e){var r,t,a,i,s,c=toObject(this),l=arraySpeciesCreate(c,0),u=0;for(r=-1,a=arguments.length;rMAX_SAFE_INTEGER)throw TypeError(MAXIMUM_ALLOWED_INDEX_EXCEEDED);for(t=0;t=MAX_SAFE_INTEGER)throw TypeError(MAXIMUM_ALLOWED_INDEX_EXCEEDED);createProperty(l,u++,s)}return l.length=u,l}});var cnt=0,imageCompressionLibUrl,worker;function createWorker(e){return"function"==typeof e&&(e="(".concat(e,")()")),new Worker(URL.createObjectURL(new Blob([e])))}function createSourceObject(e){return URL.createObjectURL(new Blob([e],{type:"application/javascript"}))}function stringify(e){return JSON.stringify(e,(function(e,r){return"function"==typeof r?"BIC_FN:::(function () { return ".concat(r.toString()," })()"):r}))}function parse(o){if("string"==typeof o)return o;var result={};return Object.entries(o).forEach((function(_ref){var _ref2=_slicedToArray(_ref,2),key=_ref2[0],value=_ref2[1];if("string"==typeof value&&value.startsWith("BIC_FN:::"))try{result[key]=eval(value.replace(/^BIC_FN:::/,""))}catch(e){throw e}else result[key]=parse(value)})),result}function generateLib(){return createSourceObject("\n // reconstruct library\n function imageCompression (){return (".concat(imageCompression,").apply(null, arguments)}\n\n imageCompression.getDataUrlFromFile = ").concat(imageCompression.getDataUrlFromFile,"\n imageCompression.getFilefromDataUrl = ").concat(imageCompression.getFilefromDataUrl,"\n imageCompression.loadImage = ").concat(imageCompression.loadImage,"\n imageCompression.drawImageInCanvas = ").concat(imageCompression.drawImageInCanvas,"\n imageCompression.drawFileInCanvas = ").concat(imageCompression.drawFileInCanvas,"\n imageCompression.canvasToFile = ").concat(imageCompression.canvasToFile,"\n imageCompression.getExifOrientation = ").concat(imageCompression.getExifOrientation,"\n imageCompression.handleMaxWidthOrHeight = ").concat(imageCompression.handleMaxWidthOrHeight,"\n imageCompression.followExifOrientation = ").concat(imageCompression.followExifOrientation,"\n imageCompression.cleanupCanvasMemory = ").concat(imageCompression.cleanupCanvasMemory,"\n imageCompression.isAutoOrientationInBrowser = ").concat(imageCompression.isAutoOrientationInBrowser,"\n imageCompression.approximateBelowMaximumCanvasSizeOfBrowser = ").concat(imageCompression.approximateBelowMaximumCanvasSizeOfBrowser,"\n imageCompression.getBrowserName = ").concat(imageCompression.getBrowserName,"\n\n // functions / objects\n getDataUrlFromFile = imageCompression.getDataUrlFromFile\n getFilefromDataUrl = imageCompression.getFilefromDataUrl\n loadImage = imageCompression.loadImage\n drawImageInCanvas = imageCompression.drawImageInCanvas\n drawFileInCanvas = imageCompression.drawFileInCanvas\n canvasToFile = imageCompression.canvasToFile\n getExifOrientation = imageCompression.getExifOrientation\n handleMaxWidthOrHeight = imageCompression.handleMaxWidthOrHeight\n followExifOrientation = imageCompression.followExifOrientation\n cleanupCanvasMemory = imageCompression.cleanupCanvasMemory\n isAutoOrientationInBrowser = imageCompression.isAutoOrientationInBrowser\n approximateBelowMaximumCanvasSizeOfBrowser = imageCompression.approximateBelowMaximumCanvasSizeOfBrowser\n getBrowserName = imageCompression.getBrowserName\n \n getNewCanvasAndCtx = ").concat(getNewCanvasAndCtx,"\n CustomFileReader = FileReader\n CustomFile = File\n MaxCanvasSize = ").concat(JSON.stringify(MaxCanvasSize),"\n function compress (){return (").concat(compress,").apply(null, arguments)}\n\n // core-js\n function _slicedToArray(arr, n) { return arr }\n function _typeof(a) { return typeof a }\n function _objectSpread2(target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i] != null ? arguments[i] : {};\n \n Object.assign(target, source)\n }\n \n return target;\n }\n\n // Libraries\n const parse = ").concat(parse,"\n const UPNG = {}\n UPNG.toRGBA8 = ").concat(UPNG.toRGBA8,"\n UPNG.toRGBA8.decodeImage = ").concat(UPNG.toRGBA8.decodeImage,"\n UPNG.decode = ").concat(UPNG.decode,"\n UPNG.decode._decompress = ").concat(UPNG.decode._decompress,"\n UPNG.decode._inflate = ").concat(UPNG.decode._inflate,"\n UPNG.decode._readInterlace = ").concat(UPNG.decode._readInterlace,"\n UPNG.decode._getBPP = ").concat(UPNG.decode._getBPP," \n UPNG.decode._filterZero = ").concat(UPNG.decode._filterZero,"\n UPNG.decode._paeth = ").concat(UPNG.decode._paeth,"\n UPNG.decode._IHDR = ").concat(UPNG.decode._IHDR,"\n UPNG._bin = parse(").concat(stringify(UPNG._bin),")\n UPNG._copyTile = ").concat(UPNG._copyTile,"\n UPNG.encode = ").concat(UPNG.encode,"\n UPNG.encodeLL = ").concat(UPNG.encodeLL," \n UPNG.encode._main = ").concat(UPNG.encode._main,"\n UPNG.encode.compressPNG = ").concat(UPNG.encode.compressPNG," \n UPNG.encode.compress = ").concat(UPNG.encode.compress,"\n UPNG.encode.framize = ").concat(UPNG.encode.framize," \n UPNG.encode._updateFrame = ").concat(UPNG.encode._updateFrame," \n UPNG.encode._prepareDiff = ").concat(UPNG.encode._prepareDiff," \n UPNG.encode._filterZero = ").concat(UPNG.encode._filterZero," \n UPNG.encode._filterLine = ").concat(UPNG.encode._filterLine,"\n UPNG.encode.concatRGBA = ").concat(UPNG.encode.concatRGBA,"\n UPNG.crc = parse(").concat(stringify(UPNG.crc),")\n UPNG.crc.table = ( function() {\n var tab = new Uint32Array(256);\n for (var n=0; n<256; n++) {\n var c = n;\n for (var k=0; k<8; k++) {\n if (c & 1) c = 0xedb88320 ^ (c >>> 1);\n else c = c >>> 1;\n }\n tab[n] = c; }\n return tab; })()\n UPNG.quantize = ").concat(UPNG.quantize," \n UPNG.quantize.getKDtree = ").concat(UPNG.quantize.getKDtree," \n UPNG.quantize.getNearest = ").concat(UPNG.quantize.getNearest," \n UPNG.quantize.planeDst = ").concat(UPNG.quantize.planeDst," \n UPNG.quantize.dist = ").concat(UPNG.quantize.dist," \n UPNG.quantize.splitPixels = ").concat(UPNG.quantize.splitPixels," \n UPNG.quantize.vecDot = ").concat(UPNG.quantize.vecDot," \n UPNG.quantize.stats = ").concat(UPNG.quantize.stats," \n UPNG.quantize.estats = ").concat(UPNG.quantize.estats,"\n UPNG.M4 = parse(").concat(stringify(UPNG.M4),")\n UPNG.encode.concatRGBA = ").concat(UPNG.encode.concatRGBA,'\n UPNG.inflateRaw=function(){\n var H={};H.H={};H.H.N=function(N,W){var R=Uint8Array,i=0,m=0,J=0,h=0,Q=0,X=0,u=0,w=0,d=0,v,C;\n if(N[0]==3&&N[1]==0)return W?W:new R(0);var V=H.H,n=V.b,A=V.e,l=V.R,M=V.n,I=V.A,e=V.Z,b=V.m,Z=W==null;\n if(Z)W=new R(N.length>>>2<<5);while(i==0){i=n(N,d,1);m=n(N,d+1,2);d+=3;if(m==0){if((d&7)!=0)d+=8-(d&7);\n var D=(d>>>3)+4,q=N[D-4]|N[D-3]<<8;if(Z)W=H.H.W(W,w+q);W.set(new R(N.buffer,N.byteOffset+D,q),w);d=D+q<<3;\n w+=q;continue}if(Z)W=H.H.W(W,w+(1<<17));if(m==1){v=b.J;C=b.h;X=(1<<9)-1;u=(1<<5)-1}if(m==2){J=A(N,d,5)+257;\n h=A(N,d+5,5)+1;Q=A(N,d+10,4)+4;d+=14;var E=d,j=1;for(var c=0;c<38;c+=2){b.Q[c]=0;b.Q[c+1]=0}for(var c=0;\n cj)j=K}d+=3*Q;M(b.Q,j);I(b.Q,j,b.u);v=b.w;C=b.d;\n d=l(b.u,(1<>>4;if(p>>>8==0){W[w++]=p}else if(p==256){break}else{var z=w+p-254;\n if(p>264){var _=b.q[p-257];z=w+(_>>>3)+A(N,d,_&7);d+=_&7}var $=C[e(N,d)&u];d+=$&15;var s=$>>>4,Y=b.c[s],a=(Y>>>4)+n(N,d,Y&15);\n d+=Y&15;while(w>>4;\n if(b<=15){A[I]=b;I++}else{var Z=0,m=0;if(b==16){m=3+l(V,n,2);n+=2;Z=A[I-1]}else if(b==17){m=3+l(V,n,3);\n n+=3}else if(b==18){m=11+l(V,n,7);n+=7}var J=I+m;while(I>>1;\n while(An)n=M;A++}while(A>1,I=N[l+1],e=M<<4|I,b=W-I,Z=N[l]<>>15-W;R[J]=e;Z++}}};H.H.l=function(N,W){var R=H.H.m.r,V=15-W;for(var n=0;n>>V}};H.H.M=function(N,W,R){R=R<<(W&7);var V=W>>>3;N[V]|=R;N[V+1]|=R>>>8};\n H.H.I=function(N,W,R){R=R<<(W&7);var V=W>>>3;N[V]|=R;N[V+1]|=R>>>8;N[V+2]|=R>>>16};H.H.e=function(N,W,R){return(N[W>>>3]|N[(W>>>3)+1]<<8)>>>(W&7)&(1<>>3]|N[(W>>>3)+1]<<8|N[(W>>>3)+2]<<16)>>>(W&7)&(1<>>3]|N[(W>>>3)+1]<<8|N[(W>>>3)+2]<<16)>>>(W&7)};\n H.H.i=function(N,W){return(N[W>>>3]|N[(W>>>3)+1]<<8|N[(W>>>3)+2]<<16|N[(W>>>3)+3]<<24)>>>(W&7)};H.H.m=function(){var N=Uint16Array,W=Uint32Array;\n return{K:new N(16),j:new N(16),X:[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],S:[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,999,999,999],T:[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0],q:new N(32),p:[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,65535,65535],z:[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0],c:new W(32),J:new N(512),_:[],h:new N(32),$:[],w:new N(32768),C:[],v:[],d:new N(32768),D:[],u:new N(512),Q:[],r:new N(1<<15),s:new W(286),Y:new W(30),a:new W(19),t:new W(15e3),k:new N(1<<16),g:new N(1<<15)}}();\n (function(){var N=H.H.m,W=1<<15;for(var R=0;R>>1|(V&1431655765)<<1;\n V=(V&3435973836)>>>2|(V&858993459)<<2;V=(V&4042322160)>>>4|(V&252645135)<<4;V=(V&4278255360)>>>8|(V&16711935)<<8;\n N.r[R]=(V>>>16|V<<16)>>>17}function n(A,l,M){while(l--!=0)A.push(0,M)}for(var R=0;R<32;R++){N.q[R]=N.S[R]<<3|N.T[R];\n N.c[R]=N.p[R]<<4|N.z[R]}n(N._,144,8);n(N._,255-143,9);n(N._,279-255,7);n(N._,287-279,8);H.H.n(N._,9);\n H.H.A(N._,9,N.J);H.H.l(N._,9);n(N.$,32,5);H.H.n(N.$,5);H.H.A(N.$,5,N.h);H.H.l(N.$,5);n(N.Q,19,0);n(N.C,286,0);\n n(N.D,30,0);n(N.v,320,0)}());return H.H.N}()\n \n const UZIP = {}\n UZIP["parse"] = ').concat(UZIP_1.parse,"\n UZIP._readLocal = ").concat(UZIP_1._readLocal,"\n UZIP.inflateRaw = ").concat(UZIP_1.inflateRaw,"\n UZIP.inflate = ").concat(UZIP_1.inflate,"\n UZIP.deflate = ").concat(UZIP_1.deflate,"\n UZIP.deflateRaw = ").concat(UZIP_1.deflateRaw,"\n UZIP.encode = ").concat(UZIP_1.encode,"\n UZIP._noNeed = ").concat(UZIP_1._noNeed,"\n UZIP._writeHeader = ").concat(UZIP_1._writeHeader,"\n UZIP.crc = parse(").concat(stringify(UZIP_1.crc),")\n UZIP.crc.table = ( function() {\n var tab = new Uint32Array(256);\n for (var n=0; n<256; n++) {\n var c = n;\n for (var k=0; k<8; k++) {\n if (c & 1) c = 0xedb88320 ^ (c >>> 1);\n else c = c >>> 1;\n }\n tab[n] = c; }\n return tab; })()\n \n UZIP.adler = ").concat(UZIP_1.adler,"\n UZIP.bin = parse(").concat(stringify(UZIP_1.bin),")\n UZIP.F = {}\n UZIP.F.deflateRaw = ").concat(UZIP_1.F.deflateRaw,"\n UZIP.F._bestMatch = ").concat(UZIP_1.F._bestMatch,"\n UZIP.F._howLong = ").concat(UZIP_1.F._howLong,"\n UZIP.F._hash = ").concat(UZIP_1.F._hash,"\n UZIP.saved = ").concat(UZIP_1.saved,"\n UZIP.F._writeBlock = ").concat(UZIP_1.F._writeBlock,"\n UZIP.F._copyExact = ").concat(UZIP_1.F._copyExact,"\n UZIP.F.getTrees = ").concat(UZIP_1.F.getTrees,"\n UZIP.F.getSecond = ").concat(UZIP_1.F.getSecond,"\n UZIP.F.nonZero = ").concat(UZIP_1.F.nonZero,"\n UZIP.F.contSize = ").concat(UZIP_1.F.contSize,"\n UZIP.F._codeTiny = ").concat(UZIP_1.F._codeTiny," \n UZIP.F._lenCodes = ").concat(UZIP_1.F._lenCodes," \n UZIP.F._hufTree = ").concat(UZIP_1.F._hufTree," \n UZIP.F.setDepth = ").concat(UZIP_1.F.setDepth," \n UZIP.F.restrictDepth = ").concat(UZIP_1.F.restrictDepth,"\n UZIP.F._goodIndex = ").concat(UZIP_1.F._goodIndex," \n UZIP.F._writeLit = ").concat(UZIP_1.F._writeLit," \n UZIP.F.inflate = ").concat(UZIP_1.F.inflate," \n UZIP.F._check = ").concat(UZIP_1.F._check," \n UZIP.F._decodeTiny = ").concat(UZIP_1.F._decodeTiny," \n UZIP.F._copyOut = ").concat(UZIP_1.F._copyOut," \n UZIP.F.makeCodes = ").concat(UZIP_1.F.makeCodes," \n UZIP.F.codes2map = ").concat(UZIP_1.F.codes2map," \n UZIP.F.revCodes = ").concat(UZIP_1.F.revCodes," \n\n // used only in deflate\n UZIP.F._putsE = ").concat(UZIP_1.F._putsE,"\n UZIP.F._putsF = ").concat(UZIP_1.F._putsF,"\n \n UZIP.F._bitsE = ").concat(UZIP_1.F._bitsE,"\n UZIP.F._bitsF = ").concat(UZIP_1.F._bitsF,"\n\n UZIP.F._get17 = ").concat(UZIP_1.F._get17,"\n UZIP.F._get25 = ").concat(UZIP_1.F._get25,"\n UZIP.F.U = function(){\n var u16=Uint16Array, u32=Uint32Array;\n return {\n next_code : new u16(16),\n bl_count : new u16(16),\n ordr : [ 16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15 ],\n of0 : [3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,999,999,999],\n exb : [0,0,0,0,0,0,0, 0, 1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3, 4, 4, 4, 4, 5, 5, 5, 5, 0, 0, 0, 0],\n ldef : new u16(32),\n df0 : [1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577, 65535, 65535],\n dxb : [0,0,0,0,1,1,2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8, 9, 9, 10, 10, 11, 11, 12, 12, 13, 13, 0, 0],\n ddef : new u32(32),\n flmap: new u16( 512), fltree: [],\n fdmap: new u16( 32), fdtree: [],\n lmap : new u16(32768), ltree : [], ttree:[],\n dmap : new u16(32768), dtree : [],\n imap : new u16( 512), itree : [],\n //rev9 : new u16( 512)\n rev15: new u16(1<<15),\n lhst : new u32(286), dhst : new u32( 30), ihst : new u32(19),\n lits : new u32(15000),\n strt : new u16(1<<16),\n prev : new u16(1<<15)\n };\n } ();\n\n (function(){\n var U = UZIP.F.U;\n var len = 1<<15;\n for(var i=0; i>> 1) | ((x & 0x55555555) << 1));\n x = (((x & 0xcccccccc) >>> 2) | ((x & 0x33333333) << 2));\n x = (((x & 0xf0f0f0f0) >>> 4) | ((x & 0x0f0f0f0f) << 4));\n x = (((x & 0xff00ff00) >>> 8) | ((x & 0x00ff00ff) << 8));\n U.rev15[i] = (((x >>> 16) | (x << 16)))>>>17;\n }\n \n function pushV(tgt, n, sv) { while(n--!=0) tgt.push(0,sv); }\n \n for(var i=0; i<32; i++) { U.ldef[i]=(U.of0[i]<<3)|U.exb[i]; U.ddef[i]=(U.df0[i]<<4)|U.dxb[i]; }\n \n pushV(U.fltree, 144, 8); pushV(U.fltree, 255-143, 9); pushV(U.fltree, 279-255, 7); pushV(U.fltree,287-279,8);\n /*\n var i = 0;\n for(; i<=143; i++) U.fltree.push(0,8);\n for(; i<=255; i++) U.fltree.push(0,9);\n for(; i<=279; i++) U.fltree.push(0,7);\n for(; i<=287; i++) U.fltree.push(0,8);\n */\n UZIP.F.makeCodes(U.fltree, 9);\n UZIP.F.codes2map(U.fltree, 9, U.flmap);\n UZIP.F.revCodes (U.fltree, 9)\n \n pushV(U.fdtree,32,5);\n //for(i=0;i<32; i++) U.fdtree.push(0,5);\n UZIP.F.makeCodes(U.fdtree, 5);\n UZIP.F.codes2map(U.fdtree, 5, U.fdmap);\n UZIP.F.revCodes (U.fdtree, 5)\n \n pushV(U.itree,19,0); pushV(U.ltree,286,0); pushV(U.dtree,30,0); pushV(U.ttree,320,0);\n /*\n for(var i=0; i< 19; i++) U.itree.push(0,0);\n for(var i=0; i<286; i++) U.ltree.push(0,0);\n for(var i=0; i< 30; i++) U.dtree.push(0,0);\n for(var i=0; i<320; i++) U.ttree.push(0,0);\n */\n })()\n "))}function generateWorkerScript(){return createWorker("\n let scriptImported = false\n self.addEventListener('message', async (e) => {\n const { file, id, imageCompressionLibUrl, options } = e.data\n options.onProgress = (progress) => self.postMessage({ progress, id })\n try {\n if (!scriptImported) {\n // console.log('[worker] importScripts', imageCompressionLibUrl)\n self.importScripts(imageCompressionLibUrl)\n scriptImported = true\n }\n // console.log('[worker] self', self)\n const compressedFile = await imageCompression(file, options)\n self.postMessage({ file: compressedFile, id })\n } catch (e) {\n // console.error('[worker] error', e)\n self.postMessage({ error: e.message + '\\n' + e.stack, id })\n }\n })\n ")}function compressOnWebWorker(e,r){return new Promise((function(t,a){return new Promise((function(i,s){var c=cnt++;return imageCompressionLibUrl||(imageCompressionLibUrl=generateLib()),worker||(worker=generateWorkerScript()),worker.addEventListener("message",(function handler(e){if(e.data.id===c){if(void 0!==e.data.progress)return void r.onProgress(e.data.progress);worker.removeEventListener("message",handler),e.data.error&&a(new Error(e.data.error)),t(e.data.file)}})),worker.addEventListener("error",a),worker.postMessage({file:e,id:c,imageCompressionLibUrl:imageCompressionLibUrl,options:_objectSpread2(_objectSpread2({},r),{},{onProgress:void 0})}),i()}))}))}function imageCompression(e,r){return new Promise((function(t,a){var i,s,c,l,u,p;if(i=_objectSpread2({},r),c=0,l=i.onProgress,i.maxSizeMB=i.maxSizeMB||Number.POSITIVE_INFINITY,u="boolean"!=typeof i.useWebWorker||i.useWebWorker,delete i.useWebWorker,i.onProgress=function(e){c=e,"function"==typeof l&&l(c)},!(e instanceof Blob||e instanceof CustomFile))return a(new Error("The file given is not an instance of Blob or File"));if(!/^image/.test(e.type))return a(new Error("The file given is not an image"));if(p="undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope,!u||"function"!=typeof Worker||p)return compress(e,i).then(function(e){try{return s=e,$If_3.call(this)}catch(e){return a(e)}}.bind(this),a);var d=function(){try{return $If_3.call(this)}catch(e){return a(e)}}.bind(this),y=function $Try_1_Catch(r){try{return compress(e,i).then((function(e){try{return s=e,d()}catch(e){return a(e)}}),a)}catch(e){return a(e)}};try{return compressOnWebWorker(e,i).then((function(e){try{return s=e,d()}catch(e){return y()}}),y)}catch(e){y()}function $If_3(){try{s.name=e.name,s.lastModified=e.lastModified}catch(e){}return t(s)}}))}imageCompression.getDataUrlFromFile=getDataUrlFromFile,imageCompression.getFilefromDataUrl=getFilefromDataUrl,imageCompression.loadImage=loadImage,imageCompression.drawImageInCanvas=drawImageInCanvas,imageCompression.drawFileInCanvas=drawFileInCanvas,imageCompression.canvasToFile=canvasToFile,imageCompression.getExifOrientation=getExifOrientation,imageCompression.handleMaxWidthOrHeight=handleMaxWidthOrHeight,imageCompression.followExifOrientation=followExifOrientation,imageCompression.cleanupCanvasMemory=cleanupCanvasMemory,imageCompression.isAutoOrientationInBrowser=isAutoOrientationInBrowser,imageCompression.approximateBelowMaximumCanvasSizeOfBrowser=approximateBelowMaximumCanvasSizeOfBrowser,imageCompression.getBrowserName=getBrowserName,imageCompression.version="1.0.15";export{imageCompression as default}; //# sourceMappingURL=browser-image-compression.mjs.map diff --git a/dist/browser-image-compression.mjs.map b/dist/browser-image-compression.mjs.map index dbe6548..c84d59d 100644 --- a/dist/browser-image-compression.mjs.map +++ b/dist/browser-image-compression.mjs.map @@ -1 +1 @@ -{"version":3,"file":"browser-image-compression.mjs","sources":["../node_modules/uzip/UZIP.js","../lib/UPNG.js","../lib/utils.js","../lib/image-compression.js","../lib/web-worker.js","../lib/index.js"],"sourcesContent":["\r\n\r\nvar UZIP = {};\r\nif(typeof module == \"object\") module.exports = UZIP;\r\n\r\n\r\nUZIP[\"parse\"] = function(buf, onlyNames)\t// ArrayBuffer\r\n{\r\n\tvar rUs = UZIP.bin.readUshort, rUi = UZIP.bin.readUint, o = 0, out = {};\r\n\tvar data = new Uint8Array(buf);\r\n\tvar eocd = data.length-4;\r\n\t\r\n\twhile(rUi(data, eocd)!=0x06054b50) eocd--;\r\n\t\r\n\tvar o = eocd;\r\n\to+=4;\t// sign = 0x06054b50\r\n\to+=4; // disks = 0;\r\n\tvar cnu = rUs(data, o); o+=2;\r\n\tvar cnt = rUs(data, o); o+=2;\r\n\t\t\t\r\n\tvar csize = rUi(data, o); o+=4;\r\n\tvar coffs = rUi(data, o); o+=4;\r\n\t\r\n\to = coffs;\r\n\tfor(var i=0; i8514000) {\r\n\t\t\t//console.log(PUtils.readASCII(buf , 8514500, 500));\r\n\t\t\t//console.log(PUtils.readASCII(nbuf, 8514500, 500));\r\n\t\t}\r\n\t\tfor(var i=0; i>>4);\r\n\t//console.log(CM, CINFO,CMF,FLG);\r\n\treturn UZIP.inflateRaw(new Uint8Array(file.buffer, file.byteOffset+2, file.length-6), buf); \r\n}\r\nUZIP.deflate = function(data, opts/*, buf, off*/) {\r\n\tif(opts==null) opts={level:6};\r\n\tvar off=0, buf=new Uint8Array(50+Math.floor(data.length*1.1));\r\n\tbuf[off]=120; buf[off+1]=156; off+=2;\r\n\toff = UZIP.F.deflateRaw(data, buf, off, opts.level);\r\n\tvar crc = UZIP.adler(data, 0, data.length);\r\n\tbuf[off+0]=((crc>>>24)&255); \r\n\tbuf[off+1]=((crc>>>16)&255); \r\n\tbuf[off+2]=((crc>>> 8)&255); \r\n\tbuf[off+3]=((crc>>> 0)&255); \t\r\n\treturn new Uint8Array(buf.buffer, 0, off+4);\r\n}\r\nUZIP.deflateRaw = function(data, opts) {\r\n\tif(opts==null) opts={level:6};\r\n\tvar buf=new Uint8Array(50+Math.floor(data.length*1.1));\r\n\tvar off = UZIP.F.deflateRaw(data, buf, off, opts.level);\r\n\treturn new Uint8Array(buf.buffer, 0, off);\r\n}\r\n\r\n\r\nUZIP.encode = function(obj, noCmpr) {\r\n\tif(noCmpr==null) noCmpr=false;\r\n\tvar tot = 0, wUi = UZIP.bin.writeUint, wUs = UZIP.bin.writeUshort;\r\n\tvar zpd = {};\r\n\tfor(var p in obj) { var cpr = !UZIP._noNeed(p) && !noCmpr, buf = obj[p], crc = UZIP.crc.crc(buf,0,buf.length); \r\n\t\tzpd[p] = { cpr:cpr, usize:buf.length, crc:crc, file: (cpr ? UZIP.deflateRaw(buf) : buf) }; }\r\n\t\r\n\tfor(var p in zpd) tot += zpd[p].file.length + 30 + 46 + 2*UZIP.bin.sizeUTF8(p);\r\n\ttot += 22;\r\n\t\r\n\tvar data = new Uint8Array(tot), o = 0;\r\n\tvar fof = []\r\n\t\r\n\tfor(var p in zpd) {\r\n\t\tvar file = zpd[p]; fof.push(o);\r\n\t\to = UZIP._writeHeader(data, o, p, file, 0);\r\n\t}\r\n\tvar i=0, ioff = o;\r\n\tfor(var p in zpd) {\r\n\t\tvar file = zpd[p]; fof.push(o);\r\n\t\to = UZIP._writeHeader(data, o, p, file, 1, fof[i++]);\t\t\r\n\t}\r\n\tvar csize = o-ioff;\r\n\t\r\n\twUi(data, o, 0x06054b50); o+=4;\r\n\to += 4; // disks\r\n\twUs(data, o, i); o += 2;\r\n\twUs(data, o, i); o += 2;\t// number of c d records\r\n\twUi(data, o, csize); o += 4;\r\n\twUi(data, o, ioff ); o += 4;\r\n\to += 2;\r\n\treturn data.buffer;\r\n}\r\n// no need to compress .PNG, .ZIP, .JPEG ....\r\nUZIP._noNeed = function(fn) { var ext = fn.split(\".\").pop().toLowerCase(); return \"png,jpg,jpeg,zip\".indexOf(ext)!=-1; }\r\n\r\nUZIP._writeHeader = function(data, o, p, obj, t, roff)\r\n{\r\n\tvar wUi = UZIP.bin.writeUint, wUs = UZIP.bin.writeUshort;\r\n\tvar file = obj.file;\r\n\t\r\n\twUi(data, o, t==0 ? 0x04034b50 : 0x02014b50); o+=4; // sign\r\n\tif(t==1) o+=2; // ver made by\r\n\twUs(data, o, 20); o+=2;\t// ver\r\n\twUs(data, o, 0); o+=2; // gflip\r\n\twUs(data, o, obj.cpr?8:0); o+=2;\t// cmpr\r\n\t\t\r\n\twUi(data, o, 0); o+=4;\t// time\t\t\r\n\twUi(data, o, obj.crc); o+=4;\t// crc32\r\n\twUi(data, o, file.length); o+=4;\t// csize\r\n\twUi(data, o, obj.usize); o+=4;\t// usize\r\n\t\t\r\n\twUs(data, o, UZIP.bin.sizeUTF8(p)); o+=2;\t// nlen\r\n\twUs(data, o, 0); o+=2;\t// elen\r\n\t\r\n\tif(t==1) {\r\n\t\to += 2; // comment length\r\n\t\to += 2; // disk number\r\n\t\to += 6; // attributes\r\n\t\twUi(data, o, roff); o+=4;\t// usize\r\n\t}\r\n\tvar nlen = UZIP.bin.writeUTF8(data, o, p); o+= nlen;\t\r\n\tif(t==0) { data.set(file, o); o += file.length; }\r\n\treturn o;\r\n}\r\n\r\n\r\n\r\n\r\n\r\nUZIP.crc = {\r\n\ttable : ( function() {\r\n\t var tab = new Uint32Array(256);\r\n\t for (var n=0; n<256; n++) {\r\n\t\t\tvar c = n;\r\n\t\t\tfor (var k=0; k<8; k++) {\r\n\t\t\t\tif (c & 1) c = 0xedb88320 ^ (c >>> 1);\r\n\t\t\t\telse c = c >>> 1;\r\n\t\t\t}\r\n\t\t\ttab[n] = c; } \r\n\t\treturn tab; })(),\r\n\tupdate : function(c, buf, off, len) {\r\n\t\tfor (var i=0; i>> 8);\r\n\t\treturn c;\r\n\t},\r\n\tcrc : function(b,o,l) { return UZIP.crc.update(0xffffffff,b,o,l) ^ 0xffffffff; }\r\n}\r\nUZIP.adler = function(data,o,len) {\r\n\tvar a = 1, b = 0;\r\n\tvar off = o, end=o+len;\r\n\twhile(off>8)&255; },\r\n\treadUint : function(buff,p) { return (buff[p+3]*(256*256*256)) + ((buff[p+2]<<16) | (buff[p+1]<< 8) | buff[p]); },\r\n\twriteUint : function(buff,p,n){ buff[p]=n&255; buff[p+1]=(n>>8)&255; buff[p+2]=(n>>16)&255; buff[p+3]=(n>>24)&255; },\r\n\treadASCII : function(buff,p,l){ var s = \"\"; for(var i=0; i> 6)); buff[p+i+1] = (128|((code>> 0)&63)); i+=2; }\r\n\t\t\telse if((code&(0xffffffff-(1<<16)+1))==0) { buff[p+i] = (224|(code>>12)); buff[p+i+1] = (128|((code>> 6)&63)); buff[p+i+2] = (128|((code>>0)&63)); i+=3; }\r\n\t\t\telse if((code&(0xffffffff-(1<<21)+1))==0) { buff[p+i] = (240|(code>>18)); buff[p+i+1] = (128|((code>>12)&63)); buff[p+i+2] = (128|((code>>6)&63)); buff[p+i+3] = (128|((code>>0)&63)); i+=4; }\r\n\t\t\telse throw \"e\";\r\n\t\t}\r\n\t\treturn i;\r\n\t},\r\n\tsizeUTF8 : function(str) {\r\n\t\tvar strl = str.length, i=0;\r\n\t\tfor(var ci=0; ci>>3;\r\n\t}\r\n\r\n\tvar lits = U.lits, strt=U.strt, prev=U.prev, li=0, lc=0, bs=0, ebits=0, c=0, nc=0; // last_item, literal_count, block_start\r\n\tif(dlen>2) { nc=UZIP.F._hash(data,0); strt[nc]=0; }\r\n\tvar nmch=0,nmci=0;\r\n\t\r\n\tfor(i=0; i14000 || lc>26697) && (dlen-i)>100) {\r\n\t\t\t\tif(cvrd>>16)>>16)>(mch>>>16)) mch=0;\r\n\t\t\t}//*/\r\n\t\t\tvar len = mch>>>16, dst = mch&0xffff; //if(i-dst<0) throw \"e\";\r\n\t\t\tif(mch!=0) { \r\n\t\t\t\tvar len = mch>>>16, dst = mch&0xffff; //if(i-dst<0) throw \"e\";\r\n\t\t\t\tvar lgi = goodIndex(len, U.of0); U.lhst[257+lgi]++; \r\n\t\t\t\tvar dgi = goodIndex(dst, U.df0); U.dhst[ dgi]++; ebits += U.exb[lgi] + U.dxb[dgi]; \r\n\t\t\t\tlits[li] = (len<<23)|(i-cvrd); lits[li+1] = (dst<<16)|(lgi<<8)|dgi; li+=2;\r\n\t\t\t\tcvrd = i + len; \r\n\t\t\t}\r\n\t\t\telse {\tU.lhst[data[i]]++; }\r\n\t\t\tlc++;\r\n\t\t}\r\n\t}\r\n\tif(bs!=i || data.length==0) {\r\n\t\tif(cvrd>>3;\r\n}\r\nUZIP.F._bestMatch = function(data, i, prev, c, nice, chain) {\r\n\tvar ci = (i&0x7fff), pi=prev[ci]; \r\n\t//console.log(\"----\", i);\r\n\tvar dif = ((ci-pi + (1<<15)) & 0x7fff); if(pi==ci || c!=UZIP.F._hash(data,i-dif)) return 0;\r\n\tvar tl=0, td=0; // top length, top distance\r\n\tvar dlim = Math.min(0x7fff, i);\r\n\twhile(dif<=dlim && --chain!=0 && pi!=ci /*&& c==UZIP.F._hash(data,i-dif)*/) {\r\n\t\tif(tl==0 || (data[i+tl]==data[i+tl-dif])) {\r\n\t\t\tvar cl = UZIP.F._howLong(data, i, dif);\r\n\t\t\tif(cl>tl) { \r\n\t\t\t\ttl=cl; td=dif; if(tl>=nice) break; //* \r\n\t\t\t\tif(dif+2maxd) { maxd=curd; pi = ei; }\r\n\t\t\t\t} //*/\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tci=pi; pi = prev[ci];\r\n\t\tdif += ((ci-pi + (1<<15)) & 0x7fff);\r\n\t}\r\n\treturn (tl<<16)|td;\r\n}\r\nUZIP.F._howLong = function(data, i, dif) {\r\n\tif(data[i]!=data[i-dif] || data[i+1]!=data[i+1-dif] || data[i+2]!=data[i+2-dif]) return 0;\r\n\tvar oi=i, l = Math.min(data.length, i+258); i+=3;\r\n\t//while(i+4>>23), end = off+(qb&((1<<23)-1));\r\n\t\t\twhile(off>16), lgi=(qc>>8)&255, dgi=(qc&255);\r\n\t\t\t\tpos = UZIP.F._writeLit(257+lgi, ltree, out, pos);\r\n\t\t\t\tputsE(out, pos, len-U.of0[lgi]); pos+=U.exb[lgi];\r\n\t\t\t\t\r\n\t\t\t\tpos = UZIP.F._writeLit(dgi, dtree, out, pos);\r\n\t\t\t\tputsF(out, pos, dst-U.df0[dgi]); pos+=U.dxb[dgi]; off+=len;\r\n\t\t\t}\r\n\t\t}\r\n\t\tpos = UZIP.F._writeLit(256, ltree, out, pos);\r\n\t}\r\n\t//console.log(pos-opos, fxdSize, dynSize, cstSize);\r\n\treturn pos;\r\n}\r\nUZIP.F._copyExact = function(data,off,len,out,pos) {\r\n\tvar p8 = (pos>>>3);\r\n\tout[p8]=(len); out[p8+1]=(len>>>8); out[p8+2]=255-out[p8]; out[p8+3]=255-out[p8+1]; p8+=4;\r\n\tout.set(new Uint8Array(data.buffer, off, len), p8);\r\n\t//for(var i=0; i4 && U.itree[(U.ordr[numh-1]<<1)+1]==0) numh--;\r\n\treturn [ML, MD, MH, numl, numd, numh, lset, dset];\r\n}\r\nUZIP.F.getSecond= function(a) { var b=[]; for(var i=0; i>1)+\",\"; return b; }\r\nUZIP.F.contSize = function(tree, hst) { var s=0; for(var i=0; i15) { UZIP.F._putsE(out, pos, rst, rsl); pos+=rsl; }\r\n\t}\r\n\treturn pos;\r\n}\r\nUZIP.F._lenCodes = function(tree, set) {\r\n\tvar len=tree.length; while(len!=2 && tree[len-1]==0) len-=2; // when no distances, keep one code with length 0\r\n\tfor(var i=0; i>>1, 138);\r\n\t\t\tif(zc<11) set.push(17, zc-3);\r\n\t\t\telse set.push(18, zc-11);\r\n\t\t\ti += zc*2-2;\r\n\t\t}\r\n\t\telse if(l==prv && nxt==l && nnxt==l) {\r\n\t\t\tvar lz = i+5;\r\n\t\t\twhile(lz+2>>1, 6);\r\n\t\t\tset.push(16, zc-3);\r\n\t\t\ti += zc*2-2;\r\n\t\t}\r\n\t\telse set.push(l, 0);\r\n\t}\r\n\treturn len>>>1;\r\n}\r\nUZIP.F._hufTree = function(hst, tree, MAXL) {\r\n\tvar list=[], hl = hst.length, tl=tree.length, i=0;\r\n\tfor(i=0; iMAXL) { UZIP.F.restrictDepth(l2, MAXL, maxl); maxl = MAXL; }\r\n\tfor(i=0; iMD) { var od=dps[i].d; dps[i].d=MD; dbt+=bCost-(1<<(maxl-od)); } else break;\r\n\tdbt = dbt>>>(maxl-MD);\r\n\twhile(dbt>0) { var od=dps[i].d; if(od=0; i--) if(dps[i].d==MD && dbt<0) { dps[i].d--; dbt++; } if(dbt!=0) console.log(\"debt left\");\r\n}\r\n\r\nUZIP.F._goodIndex = function(v, arr) {\r\n\tvar i=0; if(arr[i|16]<=v) i|=16; if(arr[i|8]<=v) i|=8; if(arr[i|4]<=v) i|=4; if(arr[i|2]<=v) i|=2; if(arr[i|1]<=v) i|=1; return i;\r\n}\r\nUZIP.F._writeLit = function(ch, ltree, out, pos) {\r\n\tUZIP.F._putsF(out, pos, ltree[ch<<1]);\r\n\treturn pos+ltree[(ch<<1)+1];\r\n}\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\nUZIP.F.inflate = function(data, buf) {\r\n\tvar u8=Uint8Array;\r\n\tif(data[0]==3 && data[1]==0) return (buf ? buf : new u8(0));\r\n\tvar F=UZIP.F, bitsF = F._bitsF, bitsE = F._bitsE, decodeTiny = F._decodeTiny, makeCodes = F.makeCodes, codes2map=F.codes2map, get17 = F._get17;\r\n\tvar U = F.U;\r\n\t\r\n\tvar noBuf = (buf==null);\r\n\tif(noBuf) buf = new u8((data.length>>>2)<<3);\r\n\t\r\n\tvar BFINAL=0, BTYPE=0, HLIT=0, HDIST=0, HCLEN=0, ML=0, MD=0; \t\r\n\tvar off = 0, pos = 0;\r\n\tvar lmap, dmap;\r\n\t\r\n\twhile(BFINAL==0) {\t\t\r\n\t\tBFINAL = bitsF(data, pos , 1);\r\n\t\tBTYPE = bitsF(data, pos+1, 2); pos+=3;\r\n\t\t//console.log(BFINAL, BTYPE);\r\n\t\t\r\n\t\tif(BTYPE==0) {\r\n\t\t\tif((pos&7)!=0) pos+=8-(pos&7);\r\n\t\t\tvar p8 = (pos>>>3)+4, len = data[p8-4]|(data[p8-3]<<8); //console.log(len);//bitsF(data, pos, 16), \r\n\t\t\tif(noBuf) buf=UZIP.F._check(buf, off+len);\r\n\t\t\tbuf.set(new u8(data.buffer, data.byteOffset+p8, len), off);\r\n\t\t\t//for(var i=0; itl)tl=l; } pos+=3*HCLEN; //console.log(itree);\r\n\t\t\tmakeCodes(U.itree, tl);\r\n\t\t\tcodes2map(U.itree, tl, U.imap);\r\n\t\t\t\r\n\t\t\tlmap = U.lmap; dmap = U.dmap;\r\n\t\t\t\r\n\t\t\tpos = decodeTiny(U.imap, (1<>>24))-1; pos+=(ml&0xffffff);\r\n\t\t\tmakeCodes(U.ltree, mx0);\r\n\t\t\tcodes2map(U.ltree, mx0, lmap);\r\n\t\t\t\r\n\t\t\t//var md = decodeTiny(U.imap, (1<>>24))-1; pos+=(md&0xffffff);\r\n\t\t\tmakeCodes(U.dtree, mx1);\r\n\t\t\tcodes2map(U.dtree, mx1, dmap);\r\n\t\t}\r\n\t\t//var ooff=off, opos=pos;\r\n\t\twhile(true) {\r\n\t\t\tvar code = lmap[get17(data, pos) & ML]; pos += code&15;\r\n\t\t\tvar lit = code>>>4; //U.lhst[lit]++; \r\n\t\t\tif((lit>>>8)==0) { buf[off++] = lit; }\r\n\t\t\telse if(lit==256) { break; }\r\n\t\t\telse {\r\n\t\t\t\tvar end = off+lit-254;\r\n\t\t\t\tif(lit>264) { var ebs = U.ldef[lit-257]; end = off + (ebs>>>3) + bitsE(data, pos, ebs&7); pos += ebs&7; }\r\n\t\t\t\t//UZIP.F.dst[end-off]++;\r\n\t\t\t\t\r\n\t\t\t\tvar dcode = dmap[get17(data, pos) & MD]; pos += dcode&15;\r\n\t\t\t\tvar dlit = dcode>>>4;\r\n\t\t\t\tvar dbs = U.ddef[dlit], dst = (dbs>>>4) + bitsF(data, pos, dbs&15); pos += dbs&15;\r\n\t\t\t\t\r\n\t\t\t\t//var o0 = off-dst, stp = Math.min(end-off, dst);\r\n\t\t\t\t//if(stp>20) while(off>>3);\r\n\t}\r\n\t//console.log(UZIP.F.dst);\r\n\t//console.log(tlen, dlen, off-tlen+tcnt);\r\n\treturn buf.length==off ? buf : buf.slice(0,off);\r\n}\r\nUZIP.F._check=function(buf, len) {\r\n\tvar bl=buf.length; if(len<=bl) return buf;\r\n\tvar nbuf = new Uint8Array(Math.max(bl<<1,len)); nbuf.set(buf,0);\r\n\t//for(var i=0; i>>4; \r\n\t\tif(lit<=15) { tree[i]=lit; i++; }\r\n\t\telse {\r\n\t\t\tvar ll = 0, n = 0;\r\n\t\t\tif(lit==16) {\r\n\t\t\t\tn = (3 + bitsE(data, pos, 2)); pos += 2; ll = tree[i-1];\r\n\t\t\t}\r\n\t\t\telse if(lit==17) {\r\n\t\t\t\tn = (3 + bitsE(data, pos, 3)); pos += 3;\r\n\t\t\t}\r\n\t\t\telse if(lit==18) {\r\n\t\t\t\tn = (11 + bitsE(data, pos, 7)); pos += 7;\r\n\t\t\t}\r\n\t\t\tvar ni = i+n;\r\n\t\t\twhile(i>>1;\r\n\twhile(imx)mx=v; i++; }\r\n\twhile(i>1;\r\n\t\tvar cl = tree[i+1], val = (lit<<4)|cl; // : (0x8000 | (U.of0[lit-257]<<7) | (U.exb[lit-257]<<4) | cl);\r\n\t\tvar rest = (MAX_BITS-cl), i0 = tree[i]<>>(15-MAX_BITS);\r\n\t\twhile(i0!=i1) {\r\n\t\t\tvar p0 = r15[i0]>>>(15-MAX_BITS);\r\n\t\t\tmap[p0]=val; i0++;\r\n\t\t}\r\n\t}\r\n}\r\nUZIP.F.revCodes = function(tree, MAX_BITS) {\r\n\tvar r15 = UZIP.F.U.rev15, imb = 15-MAX_BITS;\r\n\tfor(var i=0; i>>imb; }\r\n}\r\n\r\n// used only in deflate\r\nUZIP.F._putsE= function(dt, pos, val ) { val = val<<(pos&7); var o=(pos>>>3); dt[o]|=val; dt[o+1]|=(val>>>8); }\r\nUZIP.F._putsF= function(dt, pos, val ) { val = val<<(pos&7); var o=(pos>>>3); dt[o]|=val; dt[o+1]|=(val>>>8); dt[o+2]|=(val>>>16); }\r\n\r\nUZIP.F._bitsE= function(dt, pos, length) { return ((dt[pos>>>3] | (dt[(pos>>>3)+1]<<8) )>>>(pos&7))&((1<>>3] | (dt[(pos>>>3)+1]<<8) | (dt[(pos>>>3)+2]<<16))>>>(pos&7))&((1<>>3] | (dt[(pos>>>3)+1]<<8))>>>(pos&7))&511;\r\n} */\r\nUZIP.F._get17= function(dt, pos) {\t// return at least 17 meaningful bytes\r\n\treturn (dt[pos>>>3] | (dt[(pos>>>3)+1]<<8) | (dt[(pos>>>3)+2]<<16) )>>>(pos&7);\r\n}\r\nUZIP.F._get25= function(dt, pos) {\t// return at least 17 meaningful bytes\r\n\treturn (dt[pos>>>3] | (dt[(pos>>>3)+1]<<8) | (dt[(pos>>>3)+2]<<16) | (dt[(pos>>>3)+3]<<24) )>>>(pos&7);\r\n}\r\nUZIP.F.U = function(){\r\n\tvar u16=Uint16Array, u32=Uint32Array;\r\n\treturn {\r\n\t\tnext_code : new u16(16),\r\n\t\tbl_count : new u16(16),\r\n\t\tordr : [ 16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15 ],\r\n\t\tof0 : [3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,999,999,999],\r\n\t\texb : [0,0,0,0,0,0,0, 0, 1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3, 4, 4, 4, 4, 5, 5, 5, 5, 0, 0, 0, 0],\r\n\t\tldef : new u16(32),\r\n\t\tdf0 : [1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577, 65535, 65535],\r\n\t\tdxb : [0,0,0,0,1,1,2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8, 9, 9, 10, 10, 11, 11, 12, 12, 13, 13, 0, 0],\r\n\t\tddef : new u32(32),\r\n\t\tflmap: new u16( 512), fltree: [],\r\n\t\tfdmap: new u16( 32), fdtree: [],\r\n\t\tlmap : new u16(32768), ltree : [], ttree:[],\r\n\t\tdmap : new u16(32768), dtree : [],\r\n\t\timap : new u16( 512), itree : [],\r\n\t\t//rev9 : new u16( 512)\r\n\t\trev15: new u16(1<<15),\r\n\t\tlhst : new u32(286), dhst : new u32( 30), ihst : new u32(19),\r\n\t\tlits : new u32(15000),\r\n\t\tstrt : new u16(1<<16),\r\n\t\tprev : new u16(1<<15)\r\n\t}; \r\n} ();\r\n\r\n(function(){\t\r\n\tvar U = UZIP.F.U;\r\n\tvar len = 1<<15;\r\n\tfor(var i=0; i>> 1) | ((x & 0x55555555) << 1));\r\n\t\tx = (((x & 0xcccccccc) >>> 2) | ((x & 0x33333333) << 2));\r\n\t\tx = (((x & 0xf0f0f0f0) >>> 4) | ((x & 0x0f0f0f0f) << 4));\r\n\t\tx = (((x & 0xff00ff00) >>> 8) | ((x & 0x00ff00ff) << 8));\r\n\t\tU.rev15[i] = (((x >>> 16) | (x << 16)))>>>17;\r\n\t}\r\n\t\r\n\tfunction pushV(tgt, n, sv) { while(n--!=0) tgt.push(0,sv); }\r\n\t\r\n\tfor(var i=0; i<32; i++) { U.ldef[i]=(U.of0[i]<<3)|U.exb[i]; U.ddef[i]=(U.df0[i]<<4)|U.dxb[i]; }\r\n\t\r\n\tpushV(U.fltree, 144, 8); pushV(U.fltree, 255-143, 9); pushV(U.fltree, 279-255, 7); pushV(U.fltree,287-279,8);\r\n\t/*\r\n\tvar i = 0;\r\n\tfor(; i<=143; i++) U.fltree.push(0,8);\r\n\tfor(; i<=255; i++) U.fltree.push(0,9);\r\n\tfor(; i<=279; i++) U.fltree.push(0,7);\r\n\tfor(; i<=287; i++) U.fltree.push(0,8);\r\n\t*/\r\n\tUZIP.F.makeCodes(U.fltree, 9);\r\n\tUZIP.F.codes2map(U.fltree, 9, U.flmap);\r\n\tUZIP.F.revCodes (U.fltree, 9)\r\n\t\r\n\tpushV(U.fdtree,32,5);\r\n\t//for(i=0;i<32; i++) U.fdtree.push(0,5);\r\n\tUZIP.F.makeCodes(U.fdtree, 5);\r\n\tUZIP.F.codes2map(U.fdtree, 5, U.fdmap);\r\n\tUZIP.F.revCodes (U.fdtree, 5)\r\n\t\r\n\tpushV(U.itree,19,0); pushV(U.ltree,286,0); pushV(U.dtree,30,0); pushV(U.ttree,320,0);\r\n\t/*\r\n\tfor(var i=0; i< 19; i++) U.itree.push(0,0);\r\n\tfor(var i=0; i<286; i++) U.ltree.push(0,0);\r\n\tfor(var i=0; i< 30; i++) U.dtree.push(0,0);\r\n\tfor(var i=0; i<320; i++) U.ttree.push(0,0);\r\n\t*/\r\n})()\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n","// https://github.com/photopea/UPNG.js/blob/c976240e62b0497167f8aafabd7889625f8b2016/UPNG.js\r\n\r\n// import * as pako from 'pako'\r\nimport * as UZIP from 'uzip'\r\n\r\nvar UPNG = {};\r\n\r\n\r\nUPNG.toRGBA8 = function(out)\r\n{\r\n var w = out.width, h = out.height;\r\n if(out.tabs.acTL==null) return [UPNG.toRGBA8.decodeImage(out.data, w, h, out).buffer];\r\n\r\n var frms = [];\r\n if(out.frames[0].data==null) out.frames[0].data = out.data;\r\n\r\n var len = w*h*4, img = new Uint8Array(len), empty = new Uint8Array(len), prev=new Uint8Array(len);\r\n for(var i=0; i>3)]>>(7-((i&7)<<0)))& 1), cj=3*j; bf[qi]=p[cj]; bf[qi+1]=p[cj+1]; bf[qi+2]=p[cj+2]; bf[qi+3]=(j>2)]>>(6-((i&3)<<1)))& 3), cj=3*j; bf[qi]=p[cj]; bf[qi+1]=p[cj+1]; bf[qi+2]=p[cj+2]; bf[qi+3]=(j>1)]>>(4-((i&1)<<2)))&15), cj=3*j; bf[qi]=p[cj]; bf[qi+1]=p[cj+1]; bf[qi+2]=p[cj+2]; bf[qi+3]=(j>>3)]>>>(7 -((x&7) )))& 1), al=(gr==tr*255)?0:255; bf32[to+x]=(al<<24)|(gr<<16)|(gr<<8)|gr; }\r\n else if(depth== 2) for(var x=0; x>>2)]>>>(6 -((x&3)<<1)))& 3), al=(gr==tr* 85)?0:255; bf32[to+x]=(al<<24)|(gr<<16)|(gr<<8)|gr; }\r\n else if(depth== 4) for(var x=0; x>>1)]>>>(4 -((x&1)<<2)))&15), al=(gr==tr* 17)?0:255; bf32[to+x]=(al<<24)|(gr<<16)|(gr<<8)|gr; }\r\n else if(depth== 8) for(var x=0; x>>2<<5);while(i==0){i=n(N,d,1);m=n(N,d+1,2);d+=3;if(m==0){if((d&7)!=0)d+=8-(d&7);\r\n var D=(d>>>3)+4,q=N[D-4]|N[D-3]<<8;if(Z)W=H.H.W(W,w+q);W.set(new R(N.buffer,N.byteOffset+D,q),w);d=D+q<<3;\r\n w+=q;continue}if(Z)W=H.H.W(W,w+(1<<17));if(m==1){v=b.J;C=b.h;X=(1<<9)-1;u=(1<<5)-1}if(m==2){J=A(N,d,5)+257;\r\n h=A(N,d+5,5)+1;Q=A(N,d+10,4)+4;d+=14;var E=d,j=1;for(var c=0;c<38;c+=2){b.Q[c]=0;b.Q[c+1]=0}for(var c=0;\r\n cj)j=K}d+=3*Q;M(b.Q,j);I(b.Q,j,b.u);v=b.w;C=b.d;\r\n d=l(b.u,(1<>>4;if(p>>>8==0){W[w++]=p}else if(p==256){break}else{var z=w+p-254;\r\n if(p>264){var _=b.q[p-257];z=w+(_>>>3)+A(N,d,_&7);d+=_&7}var $=C[e(N,d)&u];d+=$&15;var s=$>>>4,Y=b.c[s],a=(Y>>>4)+n(N,d,Y&15);\r\n d+=Y&15;while(w>>4;\r\n if(b<=15){A[I]=b;I++}else{var Z=0,m=0;if(b==16){m=3+l(V,n,2);n+=2;Z=A[I-1]}else if(b==17){m=3+l(V,n,3);\r\n n+=3}else if(b==18){m=11+l(V,n,7);n+=7}var J=I+m;while(I>>1;\r\n while(An)n=M;A++}while(A>1,I=N[l+1],e=M<<4|I,b=W-I,Z=N[l]<>>15-W;R[J]=e;Z++}}};H.H.l=function(N,W){var R=H.H.m.r,V=15-W;for(var n=0;n>>V}};H.H.M=function(N,W,R){R=R<<(W&7);var V=W>>>3;N[V]|=R;N[V+1]|=R>>>8};\r\n H.H.I=function(N,W,R){R=R<<(W&7);var V=W>>>3;N[V]|=R;N[V+1]|=R>>>8;N[V+2]|=R>>>16};H.H.e=function(N,W,R){return(N[W>>>3]|N[(W>>>3)+1]<<8)>>>(W&7)&(1<>>3]|N[(W>>>3)+1]<<8|N[(W>>>3)+2]<<16)>>>(W&7)&(1<>>3]|N[(W>>>3)+1]<<8|N[(W>>>3)+2]<<16)>>>(W&7)};\r\n H.H.i=function(N,W){return(N[W>>>3]|N[(W>>>3)+1]<<8|N[(W>>>3)+2]<<16|N[(W>>>3)+3]<<24)>>>(W&7)};H.H.m=function(){var N=Uint16Array,W=Uint32Array;\r\n return{K:new N(16),j:new N(16),X:[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],S:[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,999,999,999],T:[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0],q:new N(32),p:[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,65535,65535],z:[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0],c:new W(32),J:new N(512),_:[],h:new N(32),$:[],w:new N(32768),C:[],v:[],d:new N(32768),D:[],u:new N(512),Q:[],r:new N(1<<15),s:new W(286),Y:new W(30),a:new W(19),t:new W(15e3),k:new N(1<<16),g:new N(1<<15)}}();\r\n (function(){var N=H.H.m,W=1<<15;for(var R=0;R>>1|(V&1431655765)<<1;\r\n V=(V&3435973836)>>>2|(V&858993459)<<2;V=(V&4042322160)>>>4|(V&252645135)<<4;V=(V&4278255360)>>>8|(V&16711935)<<8;\r\n N.r[R]=(V>>>16|V<<16)>>>17}function n(A,l,M){while(l--!=0)A.push(0,M)}for(var R=0;R<32;R++){N.q[R]=N.S[R]<<3|N.T[R];\r\n N.c[R]=N.p[R]<<4|N.z[R]}n(N._,144,8);n(N._,255-143,9);n(N._,279-255,7);n(N._,287-279,8);H.H.n(N._,9);\r\n H.H.A(N._,9,N.J);H.H.l(N._,9);n(N.$,32,5);H.H.n(N.$,5);H.H.A(N.$,5,N.h);H.H.l(N.$,5);n(N.Q,19,0);n(N.C,286,0);\r\n n(N.D,30,0);n(N.v,320,0)}());return H.H.N}()\r\n\r\n\r\nUPNG.decode._readInterlace = function(data, out)\r\n{\r\n var w = out.width, h = out.height;\r\n var bpp = UPNG.decode._getBPP(out), cbpp = bpp>>3, bpl = Math.ceil(w*bpp/8);\r\n var img = new Uint8Array( h * bpl );\r\n var di = 0;\r\n\r\n var starting_row = [ 0, 0, 4, 0, 2, 0, 1 ];\r\n var starting_col = [ 0, 4, 0, 2, 0, 1, 0 ];\r\n var row_increment = [ 8, 8, 8, 4, 4, 2, 2 ];\r\n var col_increment = [ 8, 8, 4, 4, 2, 2, 1 ];\r\n\r\n var pass=0;\r\n while(pass<7)\r\n {\r\n var ri = row_increment[pass], ci = col_increment[pass];\r\n var sw = 0, sh = 0;\r\n var cr = starting_row[pass]; while(cr>3]; val = (val>>(7-(cdi&7)))&1;\r\n img[row*bpl + (col>>3)] |= (val << (7-((col&7)<<0)));\r\n }\r\n if(bpp==2) {\r\n var val = data[cdi>>3]; val = (val>>(6-(cdi&7)))&3;\r\n img[row*bpl + (col>>2)] |= (val << (6-((col&3)<<1)));\r\n }\r\n if(bpp==4) {\r\n var val = data[cdi>>3]; val = (val>>(4-(cdi&7)))&15;\r\n img[row*bpl + (col>>1)] |= (val << (4-((col&1)<<2)));\r\n }\r\n if(bpp>=8) {\r\n var ii = row*bpl+col*cbpp;\r\n for(var j=0; j>3)+j];\r\n }\r\n cdi+=bpp; col+=ci;\r\n }\r\n y++; row += ri;\r\n }\r\n if(sw*sh!=0) di += sh * (1 + bpll);\r\n pass = pass + 1;\r\n }\r\n return img;\r\n}\r\n\r\nUPNG.decode._getBPP = function(out) {\r\n var noc = [1,null,3,1,2,null,4][out.ctype];\r\n return noc * out.depth;\r\n}\r\n\r\nUPNG.decode._filterZero = function(data, out, off, w, h)\r\n{\r\n var bpp = UPNG.decode._getBPP(out), bpl = Math.ceil(w*bpp/8), paeth = UPNG.decode._paeth;\r\n bpp = Math.ceil(bpp/8);\r\n\r\n var i=0, di=1, type=data[off], x=0;\r\n\r\n if(type>1) data[off]=[0,0,1][type-2];\r\n if(type==3) for(x=bpp; x>>1) )&255;\r\n\r\n for(var y=0; y>>1));\r\n for(; x>>1) ); }\r\n else { for(; x>8)&255; buff[p+1] = n&255; },\r\n readUint : function(buff,p) { return (buff[p]*(256*256*256)) + ((buff[p+1]<<16) | (buff[p+2]<< 8) | buff[p+3]); },\r\n writeUint : function(buff,p,n){ buff[p]=(n>>24)&255; buff[p+1]=(n>>16)&255; buff[p+2]=(n>>8)&255; buff[p+3]=n&255; },\r\n readASCII : function(buff,p,l){ var s = \"\"; for(var i=0; i=0 && yoff>=0) { si = (y*sw+x)<<2; ti = (( yoff+y)*tw+xoff+x)<<2; }\r\n else { si = ((-yoff+y)*sw-xoff+x)<<2; ti = (y*tw+x)<<2; }\r\n\r\n if (mode==0) { tb[ti] = sb[si]; tb[ti+1] = sb[si+1]; tb[ti+2] = sb[si+2]; tb[ti+3] = sb[si+3]; }\r\n else if(mode==1) {\r\n var fa = sb[si+3]*(1/255), fr=sb[si]*fa, fg=sb[si+1]*fa, fb=sb[si+2]*fa;\r\n var ba = tb[ti+3]*(1/255), br=tb[ti]*ba, bg=tb[ti+1]*ba, bb=tb[ti+2]*ba;\r\n\r\n var ifa=1-fa, oa = fa+ba*ifa, ioa = (oa==0?0:1/oa);\r\n tb[ti+3] = 255*oa;\r\n tb[ti+0] = (fr+br*ifa)*ioa;\r\n tb[ti+1] = (fg+bg*ifa)*ioa;\r\n tb[ti+2] = (fb+bb*ifa)*ioa;\r\n }\r\n else if(mode==2){\t// copy only differences, otherwise zero\r\n var fa = sb[si+3], fr=sb[si], fg=sb[si+1], fb=sb[si+2];\r\n var ba = tb[ti+3], br=tb[ti], bg=tb[ti+1], bb=tb[ti+2];\r\n if(fa==ba && fr==br && fg==bg && fb==bb) { tb[ti]=0; tb[ti+1]=0; tb[ti+2]=0; tb[ti+3]=0; }\r\n else { tb[ti]=fr; tb[ti+1]=fg; tb[ti+2]=fb; tb[ti+3]=fa; }\r\n }\r\n else if(mode==3){\t// check if can be blended\r\n var fa = sb[si+3], fr=sb[si], fg=sb[si+1], fb=sb[si+2];\r\n var ba = tb[ti+3], br=tb[ti], bg=tb[ti+1], bb=tb[ti+2];\r\n if(fa==ba && fr==br && fg==bg && fb==bb) continue;\r\n //if(fa!=255 && ba!=0) return false;\r\n if(fa<220 && ba>20) return false;\r\n }\r\n }\r\n return true;\r\n}\r\n\r\n\r\n\r\n\r\nUPNG.encode = function(bufs, w, h, ps, dels, tabs, forbidPlte)\r\n{\r\n if(ps==null) ps=0;\r\n if(forbidPlte==null) forbidPlte = false;\r\n\r\n var nimg = UPNG.encode.compress(bufs, w, h, ps, [false, false, false, 0, forbidPlte]);\r\n UPNG.encode.compressPNG(nimg, -1);\r\n\r\n return UPNG.encode._main(nimg, w, h, dels, tabs);\r\n}\r\n\r\nUPNG.encodeLL = function(bufs, w, h, cc, ac, depth, dels, tabs) {\r\n var nimg = { ctype: 0 + (cc==1 ? 0 : 2) + (ac==0 ? 0 : 4), depth: depth, frames: [] };\r\n\r\n var time = Date.now();\r\n var bipp = (cc+ac)*depth, bipl = bipp * w;\r\n for(var i=0; i1, pltAlpha = false;\r\n\r\n var leng = 8 + (16+5+4) /*+ (9+4)*/ + (anim ? 20 : 0);\r\n if(tabs[\"sRGB\"]!=null) leng += 8+1+4;\r\n if(tabs[\"pHYs\"]!=null) leng += 8+9+4;\r\n if(nimg.ctype==3) {\r\n var dl = nimg.plte.length;\r\n for(var i=0; i>>24)!=255) pltAlpha = true;\r\n leng += (8 + dl*3 + 4) + (pltAlpha ? (8 + dl*1 + 4) : 0);\r\n }\r\n for(var j=0; j>>8)&255, b=(c>>>16)&255;\r\n data[offset+ti+0]=r; data[offset+ti+1]=g; data[offset+ti+2]=b;\r\n }\r\n offset+=dl*3;\r\n wUi(data,offset,crc(data,offset-dl*3-4,dl*3+4)); offset+=4; // crc\r\n\r\n if(pltAlpha) {\r\n wUi(data,offset, dl); offset+=4;\r\n wAs(data,offset,\"tRNS\"); offset+=4;\r\n for(var i=0; i>>24)&255;\r\n offset+=dl;\r\n wUi(data,offset,crc(data,offset-dl-4,dl+4)); offset+=4; // crc\r\n }\r\n }\r\n\r\n var fi = 0;\r\n for(var j=0; j>2, bln>>2));\r\n for(var j=0; jnw && c==img32[i-nw]) ind[i]=ind[i-nw];\r\n else {\r\n var cmc = cmap[c];\r\n if(cmc==null) { cmap[c]=cmc=plte.length; plte.push(c); if(plte.length>=300) break; }\r\n ind[i]=cmc;\r\n }\r\n }\r\n }\r\n //console.log(\"make palette\", Date.now()-time); time = Date.now();\r\n }\r\n\r\n var cc=plte.length; //console.log(\"colors:\",cc);\r\n if(cc<=256 && forbidPlte==false) {\r\n if(cc<= 2) depth=1; else if(cc<= 4) depth=2; else if(cc<=16) depth=4; else depth=8;\r\n depth = Math.max(depth, minBits);\r\n }\r\n\r\n for(var j=0; j>1)] |= (inj[ii+x]<<(4-(x&1)*4));\r\n else if(depth==2) for(var x=0; x>2)] |= (inj[ii+x]<<(6-(x&3)*2));\r\n else if(depth==1) for(var x=0; x>3)] |= (inj[ii+x]<<(7-(x&7)*1));\r\n }\r\n cimg=nimg; ctype=3; bpp=1;\r\n }\r\n else if(gotAlpha==false && frms.length==1) {\t// some next \"reduced\" frames may contain alpha for blending\r\n var nimg = new Uint8Array(nw*nh*3), area=nw*nh;\r\n for(var i=0; i palette indices\", Date.now()-time); time = Date.now();\r\n\r\n return {ctype:ctype, depth:depth, plte:plte, frames:frms };\r\n}\r\nUPNG.encode.framize = function(bufs,w,h,alwaysBlend,evenCrd,forbidPrev) {\r\n /* DISPOSE\r\n - 0 : no change\r\n - 1 : clear to transparent\r\n - 2 : retstore to content before rendering (previous frame disposed)\r\n BLEND\r\n - 0 : replace\r\n - 1 : blend\r\n */\r\n var frms = [];\r\n for(var j=0; jmax) max=x;\r\n if(ymay) may=y;\r\n }\r\n }\r\n if(max==-1) mix=miy=max=may=0;\r\n if(evenCrd) { if((mix&1)==1)mix--; if((miy&1)==1)miy--; }\r\n var sarea = (max-mix+1)*(may-miy+1);\r\n if(sareamax) max=cx;\r\n if(cymay) may=cy;\r\n }\r\n }\r\n if(max==-1) mix=miy=max=may=0;\r\n if(evenCrd) { if((mix&1)==1)mix--; if((miy&1)==1)miy--; }\r\n r = {x:mix, y:miy, width:max-mix+1, height:may-miy+1};\r\n\r\n var fr = frms[i]; fr.rect = r; fr.blend = 1; fr.img = new Uint8Array(r.width*r.height*4);\r\n if(frms[i-1].dispose==0) {\r\n UPNG._copyTile(pimg,w,h, fr.img,r.width,r.height, -r.x,-r.y, 0);\r\n UPNG.encode._prepareDiff(cimg,w,h,fr.img,r);\r\n //UPNG._copyTile(cimg,w,h, fr.img,r.width,r.height, -r.x,-r.y, 2);\r\n }\r\n else\r\n UPNG._copyTile(cimg,w,h, fr.img,r.width,r.height, -r.x,-r.y, 0);\r\n}\r\nUPNG.encode._prepareDiff = function(cimg, w,h, nimg, rec) {\r\n UPNG._copyTile(cimg,w,h, nimg,rec.width,rec.height, -rec.x,-rec.y, 2);\r\n /*\r\n var n32 = new Uint32Array(nimg.buffer);\r\n var og = new Uint8Array(rec.width*rec.height*4), o32 = new Uint32Array(og.buffer);\r\n UPNG._copyTile(cimg,w,h, og,rec.width,rec.height, -rec.x,-rec.y, 0);\r\n for(var i=4; i>>2]==o32[(i>>>2)-1]) {\r\n n32[i>>>2]=o32[i>>>2];\r\n //var j = i, c=p32[(i>>>2)-1];\r\n //while(p32[j>>>2]==c) { n32[j>>>2]=c; j+=4; }\r\n }\r\n }\r\n for(var i=nimg.length-8; i>0; i-=4) {\r\n if(nimg[i+7]!=0 && nimg[i+3]==0 && o32[i>>>2]==o32[(i>>>2)+1]) {\r\n n32[i>>>2]=o32[i>>>2];\r\n //var j = i, c=p32[(i>>>2)-1];\r\n //while(p32[j>>>2]==c) { n32[j>>>2]=c; j+=4; }\r\n }\r\n }*/\r\n}\r\n\r\nUPNG.encode._filterZero = function(img,h,bpp,bpl,data, filter, levelZero)\r\n{\r\n var fls = [], ftry=[0,1,2,3,4];\r\n if (filter!=-1) ftry=[filter];\r\n else if(h*bpl>500000 || bpp==1) ftry=[0];\r\n var opts; if(levelZero) opts={level:0};\r\n\r\n\r\n // var CMPR = (data.length>10e6 && typeof UZIP !== 'undefined') ? UZIP : pako;\r\n var CMPR = UZIP;\r\n\r\n var time = Date.now();\r\n for(var i=0; i>1) +256)&255;\r\n if(type==4) for(var x=bpp; x>1))&255;\r\n for(var x=bpp; x>1))&255; }\r\n if(type==4) { for(var x= 0; x>> 1);\r\n else c = c >>> 1;\r\n }\r\n tab[n] = c; }\r\n return tab; })(),\r\n update : function(c, buf, off, len) {\r\n for (var i=0; i>> 8);\r\n return c;\r\n },\r\n crc : function(b,o,l) { return UPNG.crc.update(0xffffffff,b,o,l) ^ 0xffffffff; }\r\n}\r\n\r\n\r\nUPNG.quantize = function(abuf, ps)\r\n{\r\n var oimg = new Uint8Array(abuf), nimg = oimg.slice(0), nimg32 = new Uint32Array(nimg.buffer);\r\n\r\n var KD = UPNG.quantize.getKDtree(nimg, ps);\r\n var root = KD[0], leafs = KD[1];\r\n\r\n var planeDst = UPNG.quantize.planeDst;\r\n var sb = oimg, tb = nimg32, len=sb.length;\r\n\r\n var inds = new Uint8Array(oimg.length>>2), nd;\r\n if(oimg.length<20e6) // precise, but slow :(\r\n for(var i=0; i>2] = nd.ind; tb[i>>2] = nd.est.rgba;\r\n }\r\n else\r\n for(var i=0; i>2] = nd.ind; tb[i>>2] = nd.est.rgba;\r\n }\r\n return { abuf:nimg.buffer, inds:inds, plte:leafs };\r\n}\r\n\r\nUPNG.quantize.getKDtree = function(nimg, ps, err) {\r\n if(err==null) err = 0.0001;\r\n var nimg32 = new Uint32Array(nimg.buffer);\r\n\r\n var root = {i0:0, i1:nimg.length, bst:null, est:null, tdst:0, left:null, right:null }; // basic statistic, extra statistic\r\n root.bst = UPNG.quantize.stats( nimg,root.i0, root.i1 ); root.est = UPNG.quantize.estats( root.bst );\r\n var leafs = [root];\r\n\r\n while(leafs.length maxL) { maxL=leafs[i].est.L; mi=i; }\r\n if(maxL=s0 || node.i1<=s0);\r\n //console.log(maxL, leafs.length, mi);\r\n if(s0wrong) { node.est.L=0; continue; }\r\n\r\n\r\n var ln = {i0:node.i0, i1:s0, bst:null, est:null, tdst:0, left:null, right:null }; ln.bst = UPNG.quantize.stats( nimg, ln.i0, ln.i1 );\r\n ln.est = UPNG.quantize.estats( ln.bst );\r\n var rn = {i0:s0, i1:node.i1, bst:null, est:null, tdst:0, left:null, right:null }; rn.bst = {R:[], m:[], N:node.bst.N-ln.bst.N};\r\n for(var i=0; i<16; i++) rn.bst.R[i] = node.bst.R[i]-ln.bst.R[i];\r\n for(var i=0; i< 4; i++) rn.bst.m[i] = node.bst.m[i]-ln.bst.m[i];\r\n rn.est = UPNG.quantize.estats( rn.bst );\r\n\r\n node.left = ln; node.right = rn;\r\n leafs[mi]=ln; leafs.push(rn);\r\n }\r\n leafs.sort(function(a,b) { return b.bst.N-a.bst.N; });\r\n for(var i=0; i0) { node0=nd.right; node1=nd.left; }\r\n\r\n var ln = UPNG.quantize.getNearest(node0, r,g,b,a);\r\n if(ln.tdst<=planeDst*planeDst) return ln;\r\n var rn = UPNG.quantize.getNearest(node1, r,g,b,a);\r\n return rn.tdst eMq) i1-=4;\r\n if(i0>=i1) break;\r\n\r\n var t = nimg32[i0>>2]; nimg32[i0>>2] = nimg32[i1>>2]; nimg32[i1>>2]=t;\r\n\r\n i0+=4; i1-=4;\r\n }\r\n while(vecDot(nimg, i0, e)>eMq) i0-=4;\r\n return i0+4;\r\n}\r\nUPNG.quantize.vecDot = function(nimg, i, e)\r\n{\r\n return nimg[i]*e[0] + nimg[i+1]*e[1] + nimg[i+2]*e[2] + nimg[i+3]*e[3];\r\n}\r\nUPNG.quantize.stats = function(nimg, i0, i1){\r\n var R = [0,0,0,0, 0,0,0,0, 0,0,0,0, 0,0,0,0];\r\n var m = [0,0,0,0];\r\n var N = (i1-i0)>>2;\r\n for(var i=i0; i>>0) };\r\n}\r\nUPNG.M4 = {\r\n multVec : function(m,v) {\r\n return [\r\n m[ 0]*v[0] + m[ 1]*v[1] + m[ 2]*v[2] + m[ 3]*v[3],\r\n m[ 4]*v[0] + m[ 5]*v[1] + m[ 6]*v[2] + m[ 7]*v[3],\r\n m[ 8]*v[0] + m[ 9]*v[1] + m[10]*v[2] + m[11]*v[3],\r\n m[12]*v[0] + m[13]*v[1] + m[14]*v[2] + m[15]*v[3]\r\n ];\r\n },\r\n dot : function(x,y) { return x[0]*y[0]+x[1]*y[1]+x[2]*y[2]+x[3]*y[3]; },\r\n sml : function(a,y) { return [a*y[0],a*y[1],a*y[2],a*y[3]]; }\r\n}\r\n\r\nUPNG.encode.concatRGBA = function(bufs) {\r\n var tlen = 0;\r\n for(var i=0; i}\r\n */\r\nexport function getDataUrlFromFile (file) {\r\n return new Promise((resolve, reject) => {\r\n const reader = new CustomFileReader()\r\n reader.onload = () => resolve(reader.result)\r\n reader.onerror = (e) => reject(e)\r\n reader.readAsDataURL(file)\r\n })\r\n}\r\n\r\n/**\r\n * getFilefromDataUrl\r\n *\r\n * @param {string} dataUrl\r\n * @param {string} filename\r\n * @param {number} [lastModified=Date.now()]\r\n * @returns {Promise}\r\n */\r\nexport function getFilefromDataUrl (dataUrl, filename, lastModified = Date.now()) {\r\n return new Promise((resolve) => {\r\n const arr = dataUrl.split(',')\r\n const mime = arr[0].match(/:(.*?);/)[1]\r\n const bstr = globalThis.atob(arr[1])\r\n let n = bstr.length\r\n const u8arr = new Uint8Array(n)\r\n while (n--) {\r\n u8arr[n] = bstr.charCodeAt(n)\r\n }\r\n const file = new Blob([u8arr], { type: mime })\r\n file.name = filename\r\n file.lastModified = lastModified\r\n resolve(file)\r\n\r\n // Safari has issue with File constructor not being able to POST in FormData\r\n // https://github.com/Donaldcwl/browser-image-compression/issues/8\r\n // https://bugs.webkit.org/show_bug.cgi?id=165081\r\n // let file\r\n // try {\r\n // file = new File([u8arr], filename, { type: mime }) // Edge do not support File constructor\r\n // } catch (e) {\r\n // file = new Blob([u8arr], { type: mime })\r\n // file.name = filename\r\n // file.lastModified = lastModified\r\n // }\r\n // resolve(file)\r\n })\r\n}\r\n\r\n/**\r\n * loadImage\r\n *\r\n * @param {string} src\r\n * @returns {Promise}\r\n */\r\nexport function loadImage (src) {\r\n return new Promise((resolve, reject) => {\r\n const img = new Image()\r\n img.onload = () => resolve(img)\r\n img.onerror = (e) => reject(e)\r\n img.src = src\r\n })\r\n}\r\n\r\n/**\r\n * drawImageInCanvas\r\n *\r\n * @param {HTMLImageElement} img\r\n * @returns {HTMLCanvasElement | OffscreenCanvas}\r\n */\r\nexport function drawImageInCanvas (img) {\r\n const [canvas, ctx] = getNewCanvasAndCtx(img.width, img.height)\r\n ctx.drawImage(img, 0, 0, canvas.width, canvas.height)\r\n return canvas\r\n}\r\n\r\n/**\r\n * drawFileInCanvas\r\n *\r\n * @param {File | Blob} file\r\n * @returns {Promise<[ImageBitmap | HTMLImageElement, HTMLCanvasElement | OffscreenCanvas]>}\r\n */\r\nexport async function drawFileInCanvas (file) {\r\n let img\r\n try {\r\n img = await createImageBitmap(file)\r\n } catch (e) {\r\n const dataUrl = await getDataUrlFromFile(file)\r\n img = await loadImage(dataUrl)\r\n }\r\n const canvas = drawImageInCanvas(img)\r\n return [img, canvas]\r\n}\r\n\r\n/**\r\n * canvasToFile\r\n *\r\n * @param {HTMLCanvasElement | OffscreenCanvas} canvas\r\n * @param {string} fileType\r\n * @param {string} fileName\r\n * @param {number} fileLastModified\r\n * @param {number} [quality]\r\n * @returns {Promise}\r\n */\r\nexport async function canvasToFile (canvas, fileType, fileName, fileLastModified, quality = 1) {\r\n let file\r\n if (fileType === 'image/png') {\r\n const ctx = canvas.getContext('2d')\r\n const data = ctx.getImageData(0, 0, canvas.width, canvas.height).data\r\n const png = UPNG.encode([data], canvas.width, canvas.height, 256 * quality)\r\n file = new Blob([png], { type: fileType })\r\n file.name = fileName\r\n file.lastModified = fileLastModified\r\n } else if (typeof OffscreenCanvas === 'function' && canvas instanceof OffscreenCanvas) { // checked on Win Chrome 83, MacOS Chrome 83\r\n file = await canvas.convertToBlob({ type: fileType, quality })\r\n file.name = fileName\r\n file.lastModified = fileLastModified\r\n // some browser do not support quality parameter, see: https://developer.mozilla.org/en-US/docs/Web/API/HTMLCanvasElement/toBlob\r\n // } else if (typeof canvas.toBlob === 'function') {\r\n // file = await new Promise(resolve => canvas.toBlob(resolve, fileType, quality))\r\n } else { // checked on Win Edge 44, Win IE 11, Win Firefox 76, MacOS Firefox 77, MacOS Safari 13.1\r\n const dataUrl = canvas.toDataURL(fileType, quality)\r\n file = await getFilefromDataUrl(dataUrl, fileName, fileLastModified)\r\n }\r\n return file\r\n}\r\n\r\n/**\r\n * getExifOrientation\r\n * get image exif orientation info\r\n * source: https://stackoverflow.com/a/32490603/10395024\r\n *\r\n * @param {File | Blob} file\r\n * @returns {Promise} - orientation id, see https://i.stack.imgur.com/VGsAj.gif\r\n */\r\nexport function getExifOrientation (file) {\r\n return new Promise((resolve, reject) => {\r\n const reader = new CustomFileReader()\r\n reader.onload = (e) => {\r\n const view = new DataView(e.target.result)\r\n if (view.getUint16(0, false) != 0xFFD8) {\r\n return resolve(-2)\r\n }\r\n const length = view.byteLength\r\n let offset = 2\r\n while (offset < length) {\r\n if (view.getUint16(offset + 2, false) <= 8) return resolve(-1)\r\n const marker = view.getUint16(offset, false)\r\n offset += 2\r\n if (marker == 0xFFE1) {\r\n if (view.getUint32(offset += 2, false) != 0x45786966) {\r\n return resolve(-1)\r\n }\r\n\r\n var little = view.getUint16(offset += 6, false) == 0x4949\r\n offset += view.getUint32(offset + 4, little)\r\n var tags = view.getUint16(offset, little)\r\n offset += 2\r\n for (var i = 0; i < tags; i++) {\r\n if (view.getUint16(offset + (i * 12), little) == 0x0112) {\r\n return resolve(view.getUint16(offset + (i * 12) + 8, little))\r\n }\r\n }\r\n } else if ((marker & 0xFF00) != 0xFF00) {\r\n break\r\n } else {\r\n offset += view.getUint16(offset, false)\r\n }\r\n }\r\n return resolve(-1)\r\n }\r\n reader.onerror = (e) => reject(e)\r\n reader.readAsArrayBuffer(file)\r\n })\r\n}\r\n\r\n/**\r\n *\r\n * @param {HTMLCanvasElement | OffscreenCanvas} canvas\r\n * @param options\r\n * @returns {HTMLCanvasElement | OffscreenCanvas}\r\n */\r\nexport function handleMaxWidthOrHeight (canvas, options) {\r\n const width = canvas.width\r\n const height = canvas.height\r\n const maxWidthOrHeight = options.maxWidthOrHeight\r\n\r\n const needToHandle = isFinite(maxWidthOrHeight) && (width > maxWidthOrHeight || height > maxWidthOrHeight)\r\n\r\n let newCanvas = canvas\r\n let ctx\r\n\r\n if (needToHandle) {\r\n [newCanvas, ctx] = getNewCanvasAndCtx(width, height)\r\n if (width > height) {\r\n newCanvas.width = maxWidthOrHeight\r\n newCanvas.height = (height / width) * maxWidthOrHeight\r\n } else {\r\n newCanvas.width = (width / height) * maxWidthOrHeight\r\n newCanvas.height = maxWidthOrHeight\r\n }\r\n ctx.drawImage(canvas, 0, 0, newCanvas.width, newCanvas.height)\r\n\r\n cleanupCanvasMemory(canvas)\r\n }\r\n\r\n return newCanvas\r\n}\r\n\r\n/**\r\n * followExifOrientation\r\n * source: https://stackoverflow.com/a/40867559/10395024\r\n *\r\n * @param {HTMLCanvasElement | OffscreenCanvas} canvas\r\n * @param {number} exifOrientation\r\n * @returns {HTMLCanvasElement | OffscreenCanvas} canvas\r\n */\r\nexport function followExifOrientation (canvas, exifOrientation) {\r\n const width = canvas.width\r\n const height = canvas.height\r\n\r\n const [newCanvas, ctx] = getNewCanvasAndCtx(width, height)\r\n\r\n // set proper canvas dimensions before transform & export\r\n if (4 < exifOrientation && exifOrientation < 9) {\r\n newCanvas.width = height\r\n newCanvas.height = width\r\n } else {\r\n newCanvas.width = width\r\n newCanvas.height = height\r\n }\r\n\r\n // transform context before drawing image\r\n switch (exifOrientation) {\r\n case 2:\r\n ctx.transform(-1, 0, 0, 1, width, 0)\r\n break\r\n case 3:\r\n ctx.transform(-1, 0, 0, -1, width, height)\r\n break\r\n case 4:\r\n ctx.transform(1, 0, 0, -1, 0, height)\r\n break\r\n case 5:\r\n ctx.transform(0, 1, 1, 0, 0, 0)\r\n break\r\n case 6:\r\n ctx.transform(0, 1, -1, 0, height, 0)\r\n break\r\n case 7:\r\n ctx.transform(0, -1, -1, 0, height, width)\r\n break\r\n case 8:\r\n ctx.transform(0, -1, 1, 0, 0, width)\r\n break\r\n default:\r\n break\r\n }\r\n\r\n ctx.drawImage(canvas, 0, 0, width, height)\r\n\r\n cleanupCanvasMemory(canvas)\r\n\r\n return newCanvas\r\n}\r\n\r\n/**\r\n * get new Canvas and it's context\r\n * @param width\r\n * @param height\r\n * @returns {[HTMLCanvasElement | OffscreenCanvas, CanvasRenderingContext2D]}\r\n */\r\nexport function getNewCanvasAndCtx (width, height) {\r\n let canvas\r\n let ctx\r\n try {\r\n canvas = new OffscreenCanvas(width, height)\r\n ctx = canvas.getContext('2d')\r\n if (ctx === null) {\r\n throw new Error('getContext of OffscreenCanvas returns null')\r\n }\r\n } catch (e) {\r\n canvas = document.createElement('canvas')\r\n ctx = canvas.getContext('2d')\r\n }\r\n canvas.width = width\r\n canvas.height = height\r\n // ctx.fillStyle = '#fff'\r\n // ctx.fillRect(0, 0, width, height)\r\n return [canvas, ctx]\r\n}\r\n\r\n/**\r\n * clear Canvas memory\r\n * @param canvas\r\n * @returns null\r\n */\r\nexport function cleanupCanvasMemory (canvas) {\r\n // garbage clean canvas for safari\r\n // ref: https://bugs.webkit.org/show_bug.cgi?id=195325\r\n canvas.width = 0\r\n canvas.height = 0\r\n}\r\n\r\nif (isBrowser) {\r\n// Polyfill for Number.isInteger\r\n Number.isInteger = Number.isInteger || function (value) {\r\n return typeof value === 'number' &&\r\n isFinite(value) &&\r\n Math.floor(value) === value\r\n }\r\n}\r\n","import {\r\n canvasToFile,\r\n cleanupCanvasMemory,\r\n drawFileInCanvas,\r\n followExifOrientation,\r\n getExifOrientation,\r\n getNewCanvasAndCtx,\r\n handleMaxWidthOrHeight,\r\n isAutoOrientationInBrowser\r\n} from './utils'\r\n\r\n/**\r\n * Compress an image file.\r\n *\r\n * @param {File} file\r\n * @param {Object} options\r\n * @param {number} [options.maxSizeMB=Number.POSITIVE_INFINITY]\r\n * @param {number} [options.maxWidthOrHeight=undefined]\r\n * @param {boolean} [options.useWebWorker=false]\r\n * @param {number} [options.maxIteration=10]\r\n * @param {number} [options.exifOrientation] - default to be the exif orientation from the image file\r\n * @param {Function} [options.onProgress] - a function takes one progress argument (progress from 0 to 100)\r\n * @param {string} [options.fileType] - default to be the original mime type from the image file\r\n * @param {number} [options.initialQuality=1.0]\r\n * @param {number} previousProgress - for internal try catch rerunning start from previous progress\r\n * @returns {Promise}\r\n */\r\nexport default async function compress (file, options, previousProgress = 0) {\r\n let progress = previousProgress\r\n\r\n function incProgress (inc = 5) {\r\n progress += inc\r\n options.onProgress(Math.min(progress, 100))\r\n }\r\n\r\n function setProgress (p) {\r\n progress = Math.min(Math.max(p, progress), 100)\r\n options.onProgress(progress)\r\n }\r\n\r\n let remainingTrials = options.maxIteration || 10\r\n\r\n const maxSizeByte = options.maxSizeMB * 1024 * 1024\r\n\r\n incProgress()\r\n\r\n // drawFileInCanvas\r\n let [img, origCanvas] = await drawFileInCanvas(file)\r\n\r\n incProgress()\r\n\r\n // handleMaxWidthOrHeight\r\n const maxWidthOrHeightFixedCanvas = handleMaxWidthOrHeight(origCanvas, options)\r\n\r\n incProgress()\r\n\r\n // exifOrientation\r\n const exifOrientation = options.exifOrientation || await getExifOrientation(file)\r\n incProgress()\r\n const orientationFixedCanvas = (await isAutoOrientationInBrowser()) ? maxWidthOrHeightFixedCanvas : followExifOrientation(maxWidthOrHeightFixedCanvas, exifOrientation)\r\n incProgress()\r\n\r\n let quality = options.initialQuality || 1.0\r\n\r\n const outputFileType = options.fileType || file.type\r\n\r\n let tempFile = await canvasToFile(orientationFixedCanvas, outputFileType, file.name, file.lastModified, quality)\r\n incProgress()\r\n\r\n const origExceedMaxSize = tempFile.size > maxSizeByte\r\n const sizeBecomeLarger = tempFile.size > file.size\r\n // console.log('original file size', file.size)\r\n // console.log('current file size', tempFile.size)\r\n\r\n // check if we need to compress or resize\r\n if (!origExceedMaxSize && !sizeBecomeLarger) {\r\n // no need to compress\r\n setProgress(100)\r\n return tempFile\r\n }\r\n\r\n const sourceSize = file.size\r\n const renderedSize = tempFile.size\r\n let currentSize = renderedSize\r\n let compressedFile\r\n let newCanvas, ctx\r\n let canvas = orientationFixedCanvas\r\n while (remainingTrials-- && (currentSize > maxSizeByte || currentSize > sourceSize)) {\r\n const newWidth = origExceedMaxSize ? canvas.width * 0.95 : canvas.width\r\n const newHeight = origExceedMaxSize ? canvas.height * 0.95 : canvas.height;\r\n // console.log('current width', newWidth);\r\n // console.log('current height', newHeight);\r\n [newCanvas, ctx] = getNewCanvasAndCtx(newWidth, newHeight)\r\n\r\n ctx.drawImage(canvas, 0, 0, newWidth, newHeight)\r\n\r\n quality *= 0.95\r\n compressedFile = await canvasToFile(newCanvas, outputFileType, file.name, file.lastModified, quality)\r\n\r\n cleanupCanvasMemory(canvas)\r\n\r\n canvas = newCanvas\r\n\r\n currentSize = compressedFile.size\r\n // console.log('currentSize', currentSize)\r\n setProgress(Math.min(99, Math.floor((renderedSize - currentSize) / (renderedSize - maxSizeByte) * 100)))\r\n }\r\n\r\n cleanupCanvasMemory(canvas)\r\n cleanupCanvasMemory(newCanvas)\r\n cleanupCanvasMemory(maxWidthOrHeightFixedCanvas)\r\n cleanupCanvasMemory(orientationFixedCanvas)\r\n cleanupCanvasMemory(origCanvas)\r\n\r\n setProgress(100)\r\n return compressedFile\r\n}\r\n","import lib from './index'\r\nimport compress from './image-compression'\r\nimport { cleanupCanvasMemory, getNewCanvasAndCtx } from './utils'\r\nimport UPNG from './UPNG'\r\nimport * as UZIP from 'uzip'\r\n\r\nlet cnt = 0\r\nlet imageCompressionLibUrl\r\nlet worker\r\n\r\nfunction createWorker (script) {\r\n if (typeof script === 'function') {\r\n script = `(${f})()`\r\n }\r\n return new Worker(URL.createObjectURL(new Blob([script])))\r\n}\r\n\r\nfunction createSourceObject (str) {\r\n // console.log('createSourceObject', str)\r\n return URL.createObjectURL(new Blob([str], { type: 'application/javascript' }))\r\n}\r\n\r\nfunction stringify(o) {\r\n return JSON.stringify(o, (key, value) => {\r\n return (typeof value === 'function' ) ? `BIC_FN:::(() => ${value.toString()})()` : value;\r\n })\r\n}\r\n\r\nfunction parse(o) {\r\n if (typeof o === 'string') return o\r\n const result = {}\r\n Object.entries(o).forEach(([key, value]) => {\r\n if (typeof value === 'string' && value.startsWith('BIC_FN:::')) {\r\n try {\r\n result[key] = eval(value.replace(/^BIC_FN:::/, ''))\r\n } catch (e) {\r\n console.log(key, e)\r\n throw e\r\n }\r\n } else {\r\n result[key] = parse(value)\r\n }\r\n })\r\n return result\r\n}\r\n\r\nfunction generateLib () {\r\n // prepare the lib to be used inside WebWorker\r\n return createSourceObject(`\r\n // reconstruct library\r\n function imageCompression (){return (${lib}).apply(null, arguments)}\r\n\r\n imageCompression.getDataUrlFromFile = ${lib.getDataUrlFromFile}\r\n imageCompression.getFilefromDataUrl = ${lib.getFilefromDataUrl}\r\n imageCompression.loadImage = ${lib.loadImage}\r\n imageCompression.drawImageInCanvas = ${lib.drawImageInCanvas}\r\n imageCompression.drawFileInCanvas = ${lib.drawFileInCanvas}\r\n imageCompression.canvasToFile = ${lib.canvasToFile}\r\n imageCompression.getExifOrientation = ${lib.getExifOrientation}\r\n imageCompression.handleMaxWidthOrHeight = ${lib.handleMaxWidthOrHeight}\r\n imageCompression.followExifOrientation = ${lib.followExifOrientation}\r\n imageCompression.cleanupCanvasMemory = ${lib.cleanupCanvasMemory}\r\n imageCompression.isAutoOrientationInBrowser = ${lib.isAutoOrientationInBrowser}\r\n\r\n // functions / objects\r\n getDataUrlFromFile = imageCompression.getDataUrlFromFile\r\n getFilefromDataUrl = imageCompression.getFilefromDataUrl\r\n loadImage = imageCompression.loadImage\r\n drawImageInCanvas = imageCompression.drawImageInCanvas\r\n drawFileInCanvas = imageCompression.drawFileInCanvas\r\n canvasToFile = imageCompression.canvasToFile\r\n getExifOrientation = imageCompression.getExifOrientation\r\n handleMaxWidthOrHeight = imageCompression.handleMaxWidthOrHeight\r\n followExifOrientation = imageCompression.followExifOrientation\r\n cleanupCanvasMemory = imageCompression.cleanupCanvasMemory\r\n isAutoOrientationInBrowser = imageCompression.isAutoOrientationInBrowser\r\n \r\n getNewCanvasAndCtx = ${getNewCanvasAndCtx}\r\n CustomFileReader = FileReader\r\n CustomFile = File\r\n function _slicedToArray(arr, n) { return arr }\r\n function _typeof(a) { return typeof a }\r\n function compress (){return (${compress}).apply(null, arguments)}\r\n\r\n // Libraries\r\n const parse = ${parse}\r\n const UPNG = {}\r\n UPNG.toRGBA8 = ${UPNG.toRGBA8}\r\n UPNG.toRGBA8.decodeImage = ${UPNG.toRGBA8.decodeImage}\r\n UPNG.decode = ${UPNG.decode}\r\n UPNG.decode._decompress = ${UPNG.decode._decompress}\r\n UPNG.decode._inflate = ${UPNG.decode._inflate}\r\n UPNG.decode._readInterlace = ${UPNG.decode._readInterlace}\r\n UPNG.decode._getBPP = ${UPNG.decode._getBPP} \r\n UPNG.decode._filterZero = ${UPNG.decode._filterZero}\r\n UPNG.decode._paeth = ${UPNG.decode._paeth}\r\n UPNG.decode._IHDR = ${UPNG.decode._IHDR}\r\n UPNG._bin = parse(${stringify(UPNG._bin)})\r\n UPNG._copyTile = ${UPNG._copyTile}\r\n UPNG.encode = ${UPNG.encode}\r\n UPNG.encodeLL = ${UPNG.encodeLL} \r\n UPNG.encode._main = ${UPNG.encode._main}\r\n UPNG.encode.compressPNG = ${UPNG.encode.compressPNG} \r\n UPNG.encode.compress = ${UPNG.encode.compress}\r\n UPNG.encode.framize = ${UPNG.encode.framize} \r\n UPNG.encode._updateFrame = ${UPNG.encode._updateFrame} \r\n UPNG.encode._prepareDiff = ${UPNG.encode._prepareDiff} \r\n UPNG.encode._filterZero = ${UPNG.encode._filterZero} \r\n UPNG.encode._filterLine = ${UPNG.encode._filterLine}\r\n UPNG.encode.concatRGBA = ${UPNG.encode.concatRGBA}\r\n UPNG.crc = parse(${stringify(UPNG.crc)})\r\n UPNG.crc.table = ( function() {\r\n var tab = new Uint32Array(256);\r\n for (var n=0; n<256; n++) {\r\n var c = n;\r\n for (var k=0; k<8; k++) {\r\n if (c & 1) c = 0xedb88320 ^ (c >>> 1);\r\n else c = c >>> 1;\r\n }\r\n tab[n] = c; }\r\n return tab; })()\r\n UPNG.quantize = ${UPNG.quantize} \r\n UPNG.quantize.getKDtree = ${UPNG.quantize.getKDtree} \r\n UPNG.quantize.getNearest = ${UPNG.quantize.getNearest} \r\n UPNG.quantize.planeDst = ${UPNG.quantize.planeDst} \r\n UPNG.quantize.dist = ${UPNG.quantize.dist} \r\n UPNG.quantize.splitPixels = ${UPNG.quantize.splitPixels} \r\n UPNG.quantize.vecDot = ${UPNG.quantize.vecDot} \r\n UPNG.quantize.stats = ${UPNG.quantize.stats} \r\n UPNG.quantize.estats = ${UPNG.quantize.estats}\r\n UPNG.M4 = parse(${stringify(UPNG.M4)})\r\n UPNG.encode.concatRGBA = ${UPNG.encode.concatRGBA}\r\n UPNG.inflateRaw=function(){\r\n var H={};H.H={};H.H.N=function(N,W){var R=Uint8Array,i=0,m=0,J=0,h=0,Q=0,X=0,u=0,w=0,d=0,v,C;\r\n if(N[0]==3&&N[1]==0)return W?W:new R(0);var V=H.H,n=V.b,A=V.e,l=V.R,M=V.n,I=V.A,e=V.Z,b=V.m,Z=W==null;\r\n if(Z)W=new R(N.length>>>2<<5);while(i==0){i=n(N,d,1);m=n(N,d+1,2);d+=3;if(m==0){if((d&7)!=0)d+=8-(d&7);\r\n var D=(d>>>3)+4,q=N[D-4]|N[D-3]<<8;if(Z)W=H.H.W(W,w+q);W.set(new R(N.buffer,N.byteOffset+D,q),w);d=D+q<<3;\r\n w+=q;continue}if(Z)W=H.H.W(W,w+(1<<17));if(m==1){v=b.J;C=b.h;X=(1<<9)-1;u=(1<<5)-1}if(m==2){J=A(N,d,5)+257;\r\n h=A(N,d+5,5)+1;Q=A(N,d+10,4)+4;d+=14;var E=d,j=1;for(var c=0;c<38;c+=2){b.Q[c]=0;b.Q[c+1]=0}for(var c=0;\r\n cj)j=K}d+=3*Q;M(b.Q,j);I(b.Q,j,b.u);v=b.w;C=b.d;\r\n d=l(b.u,(1<>>4;if(p>>>8==0){W[w++]=p}else if(p==256){break}else{var z=w+p-254;\r\n if(p>264){var _=b.q[p-257];z=w+(_>>>3)+A(N,d,_&7);d+=_&7}var $=C[e(N,d)&u];d+=$&15;var s=$>>>4,Y=b.c[s],a=(Y>>>4)+n(N,d,Y&15);\r\n d+=Y&15;while(w>>4;\r\n if(b<=15){A[I]=b;I++}else{var Z=0,m=0;if(b==16){m=3+l(V,n,2);n+=2;Z=A[I-1]}else if(b==17){m=3+l(V,n,3);\r\n n+=3}else if(b==18){m=11+l(V,n,7);n+=7}var J=I+m;while(I>>1;\r\n while(An)n=M;A++}while(A>1,I=N[l+1],e=M<<4|I,b=W-I,Z=N[l]<>>15-W;R[J]=e;Z++}}};H.H.l=function(N,W){var R=H.H.m.r,V=15-W;for(var n=0;n>>V}};H.H.M=function(N,W,R){R=R<<(W&7);var V=W>>>3;N[V]|=R;N[V+1]|=R>>>8};\r\n H.H.I=function(N,W,R){R=R<<(W&7);var V=W>>>3;N[V]|=R;N[V+1]|=R>>>8;N[V+2]|=R>>>16};H.H.e=function(N,W,R){return(N[W>>>3]|N[(W>>>3)+1]<<8)>>>(W&7)&(1<>>3]|N[(W>>>3)+1]<<8|N[(W>>>3)+2]<<16)>>>(W&7)&(1<>>3]|N[(W>>>3)+1]<<8|N[(W>>>3)+2]<<16)>>>(W&7)};\r\n H.H.i=function(N,W){return(N[W>>>3]|N[(W>>>3)+1]<<8|N[(W>>>3)+2]<<16|N[(W>>>3)+3]<<24)>>>(W&7)};H.H.m=function(){var N=Uint16Array,W=Uint32Array;\r\n return{K:new N(16),j:new N(16),X:[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],S:[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,999,999,999],T:[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0],q:new N(32),p:[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,65535,65535],z:[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0],c:new W(32),J:new N(512),_:[],h:new N(32),$:[],w:new N(32768),C:[],v:[],d:new N(32768),D:[],u:new N(512),Q:[],r:new N(1<<15),s:new W(286),Y:new W(30),a:new W(19),t:new W(15e3),k:new N(1<<16),g:new N(1<<15)}}();\r\n (function(){var N=H.H.m,W=1<<15;for(var R=0;R>>1|(V&1431655765)<<1;\r\n V=(V&3435973836)>>>2|(V&858993459)<<2;V=(V&4042322160)>>>4|(V&252645135)<<4;V=(V&4278255360)>>>8|(V&16711935)<<8;\r\n N.r[R]=(V>>>16|V<<16)>>>17}function n(A,l,M){while(l--!=0)A.push(0,M)}for(var R=0;R<32;R++){N.q[R]=N.S[R]<<3|N.T[R];\r\n N.c[R]=N.p[R]<<4|N.z[R]}n(N._,144,8);n(N._,255-143,9);n(N._,279-255,7);n(N._,287-279,8);H.H.n(N._,9);\r\n H.H.A(N._,9,N.J);H.H.l(N._,9);n(N.$,32,5);H.H.n(N.$,5);H.H.A(N.$,5,N.h);H.H.l(N.$,5);n(N.Q,19,0);n(N.C,286,0);\r\n n(N.D,30,0);n(N.v,320,0)}());return H.H.N}()\r\n \r\n const UZIP = {}\r\n UZIP[\"parse\"] = ${UZIP[\"parse\"]}\r\n UZIP._readLocal = ${UZIP._readLocal}\r\n UZIP.inflateRaw = ${UZIP.inflateRaw}\r\n UZIP.inflate = ${UZIP.inflate}\r\n UZIP.deflate = ${UZIP.deflate}\r\n UZIP.deflateRaw = ${UZIP.deflateRaw}\r\n UZIP.encode = ${UZIP.encode}\r\n UZIP._noNeed = ${UZIP._noNeed}\r\n UZIP._writeHeader = ${UZIP._writeHeader}\r\n UZIP.crc = parse(${stringify(UZIP.crc)})\r\n UZIP.crc.table = ( function() {\r\n var tab = new Uint32Array(256);\r\n for (var n=0; n<256; n++) {\r\n var c = n;\r\n for (var k=0; k<8; k++) {\r\n if (c & 1) c = 0xedb88320 ^ (c >>> 1);\r\n else c = c >>> 1;\r\n }\r\n tab[n] = c; }\r\n return tab; })()\r\n \r\n UZIP.adler = ${UZIP.adler}\r\n UZIP.bin = parse(${stringify(UZIP.bin)})\r\n UZIP.F = {}\r\n UZIP.F.deflateRaw = ${UZIP.F.deflateRaw}\r\n UZIP.F._bestMatch = ${UZIP.F._bestMatch}\r\n UZIP.F._howLong = ${UZIP.F._howLong}\r\n UZIP.F._hash = ${UZIP.F._hash}\r\n UZIP.saved = ${UZIP.saved}\r\n UZIP.F._writeBlock = ${UZIP.F._writeBlock}\r\n UZIP.F._copyExact = ${UZIP.F._copyExact}\r\n UZIP.F.getTrees = ${UZIP.F.getTrees}\r\n UZIP.F.getSecond = ${UZIP.F.getSecond}\r\n UZIP.F.nonZero = ${UZIP.F.nonZero}\r\n UZIP.F.contSize = ${UZIP.F.contSize}\r\n UZIP.F._codeTiny = ${UZIP.F._codeTiny} \r\n UZIP.F._lenCodes = ${UZIP.F._lenCodes} \r\n UZIP.F._hufTree = ${UZIP.F._hufTree} \r\n UZIP.F.setDepth = ${UZIP.F.setDepth} \r\n UZIP.F.restrictDepth = ${UZIP.F.restrictDepth}\r\n UZIP.F._goodIndex = ${UZIP.F._goodIndex} \r\n UZIP.F._writeLit = ${UZIP.F._writeLit} \r\n UZIP.F.inflate = ${UZIP.F.inflate} \r\n UZIP.F._check = ${UZIP.F._check} \r\n UZIP.F._decodeTiny = ${UZIP.F._decodeTiny} \r\n UZIP.F._copyOut = ${UZIP.F._copyOut} \r\n UZIP.F.makeCodes = ${UZIP.F.makeCodes} \r\n UZIP.F.codes2map = ${UZIP.F.codes2map} \r\n UZIP.F.revCodes = ${UZIP.F.revCodes} \r\n\r\n // used only in deflate\r\n UZIP.F._putsE = ${UZIP.F._putsE}\r\n UZIP.F._putsF = ${UZIP.F._putsF}\r\n \r\n UZIP.F._bitsE = ${UZIP.F._bitsE}\r\n UZIP.F._bitsF = ${UZIP.F._bitsF}\r\n\r\n UZIP.F._get17 = ${UZIP.F._get17}\r\n UZIP.F._get25 = ${UZIP.F._get25}\r\n UZIP.F.U = function(){\r\n var u16=Uint16Array, u32=Uint32Array;\r\n return {\r\n next_code : new u16(16),\r\n bl_count : new u16(16),\r\n ordr : [ 16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15 ],\r\n of0 : [3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,999,999,999],\r\n exb : [0,0,0,0,0,0,0, 0, 1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3, 4, 4, 4, 4, 5, 5, 5, 5, 0, 0, 0, 0],\r\n ldef : new u16(32),\r\n df0 : [1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577, 65535, 65535],\r\n dxb : [0,0,0,0,1,1,2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8, 9, 9, 10, 10, 11, 11, 12, 12, 13, 13, 0, 0],\r\n ddef : new u32(32),\r\n flmap: new u16( 512), fltree: [],\r\n fdmap: new u16( 32), fdtree: [],\r\n lmap : new u16(32768), ltree : [], ttree:[],\r\n dmap : new u16(32768), dtree : [],\r\n imap : new u16( 512), itree : [],\r\n //rev9 : new u16( 512)\r\n rev15: new u16(1<<15),\r\n lhst : new u32(286), dhst : new u32( 30), ihst : new u32(19),\r\n lits : new u32(15000),\r\n strt : new u16(1<<16),\r\n prev : new u16(1<<15)\r\n };\r\n } ();\r\n\r\n (function(){\r\n var U = UZIP.F.U;\r\n var len = 1<<15;\r\n for(var i=0; i>> 1) | ((x & 0x55555555) << 1));\r\n x = (((x & 0xcccccccc) >>> 2) | ((x & 0x33333333) << 2));\r\n x = (((x & 0xf0f0f0f0) >>> 4) | ((x & 0x0f0f0f0f) << 4));\r\n x = (((x & 0xff00ff00) >>> 8) | ((x & 0x00ff00ff) << 8));\r\n U.rev15[i] = (((x >>> 16) | (x << 16)))>>>17;\r\n }\r\n \r\n function pushV(tgt, n, sv) { while(n--!=0) tgt.push(0,sv); }\r\n \r\n for(var i=0; i<32; i++) { U.ldef[i]=(U.of0[i]<<3)|U.exb[i]; U.ddef[i]=(U.df0[i]<<4)|U.dxb[i]; }\r\n \r\n pushV(U.fltree, 144, 8); pushV(U.fltree, 255-143, 9); pushV(U.fltree, 279-255, 7); pushV(U.fltree,287-279,8);\r\n /*\r\n var i = 0;\r\n for(; i<=143; i++) U.fltree.push(0,8);\r\n for(; i<=255; i++) U.fltree.push(0,9);\r\n for(; i<=279; i++) U.fltree.push(0,7);\r\n for(; i<=287; i++) U.fltree.push(0,8);\r\n */\r\n UZIP.F.makeCodes(U.fltree, 9);\r\n UZIP.F.codes2map(U.fltree, 9, U.flmap);\r\n UZIP.F.revCodes (U.fltree, 9)\r\n \r\n pushV(U.fdtree,32,5);\r\n //for(i=0;i<32; i++) U.fdtree.push(0,5);\r\n UZIP.F.makeCodes(U.fdtree, 5);\r\n UZIP.F.codes2map(U.fdtree, 5, U.fdmap);\r\n UZIP.F.revCodes (U.fdtree, 5)\r\n \r\n pushV(U.itree,19,0); pushV(U.ltree,286,0); pushV(U.dtree,30,0); pushV(U.ttree,320,0);\r\n /*\r\n for(var i=0; i< 19; i++) U.itree.push(0,0);\r\n for(var i=0; i<286; i++) U.ltree.push(0,0);\r\n for(var i=0; i< 30; i++) U.dtree.push(0,0);\r\n for(var i=0; i<320; i++) U.ttree.push(0,0);\r\n */\r\n })()\r\n `)\r\n}\r\n\r\nfunction generateWorkerScript () {\r\n // code to be run in the WebWorker\r\n return createWorker(`\r\n let scriptImported = false\r\n self.addEventListener('message', async (e) => {\r\n const { file, id, imageCompressionLibUrl, options } = e.data\r\n options.onProgress = (progress) => self.postMessage({ progress, id })\r\n try {\r\n if (!scriptImported) {\r\n // console.log('[worker] importScripts', imageCompressionLibUrl)\r\n self.importScripts(imageCompressionLibUrl)\r\n scriptImported = true\r\n }\r\n // console.log('[worker] self', self)\r\n const compressedFile = await imageCompression(file, options)\r\n self.postMessage({ file: compressedFile, id })\r\n } catch (e) {\r\n // console.error('[worker] error', e)\r\n self.postMessage({ error: e.message + '\\\\n' + e.stack, id })\r\n }\r\n })\r\n `)\r\n}\r\n\r\nexport function compressOnWebWorker (file, options) {\r\n return new Promise(async (resolve, reject) => {\r\n let id = cnt++\r\n\r\n if (!imageCompressionLibUrl) {\r\n imageCompressionLibUrl = generateLib()\r\n }\r\n\r\n if (!worker) {\r\n worker = generateWorkerScript()\r\n }\r\n\r\n function handler (e) {\r\n if (e.data.id === id) {\r\n if (e.data.progress !== undefined) {\r\n options.onProgress(e.data.progress)\r\n return\r\n }\r\n worker.removeEventListener('message', handler)\r\n if (e.data.error) {\r\n reject(new Error(e.data.error))\r\n }\r\n resolve(e.data.file)\r\n }\r\n }\r\n\r\n worker.addEventListener('message', handler)\r\n worker.addEventListener('error', reject)\r\n\r\n worker.postMessage({\r\n file,\r\n id,\r\n imageCompressionLibUrl,\r\n options: { ...options, onProgress: undefined }\r\n })\r\n })\r\n}\r\n","import compress from './image-compression'\r\nimport {\r\n canvasToFile,\r\n drawFileInCanvas,\r\n drawImageInCanvas,\r\n getDataUrlFromFile,\r\n getFilefromDataUrl,\r\n loadImage,\r\n getExifOrientation,\r\n handleMaxWidthOrHeight,\r\n followExifOrientation,\r\n CustomFile,\r\n cleanupCanvasMemory,\r\n isAutoOrientationInBrowser\r\n} from './utils'\r\nimport { compressOnWebWorker } from './web-worker'\r\n\r\n/**\r\n * Compress an image file.\r\n *\r\n * @param {File} file\r\n * @param {Object} options - { maxSizeMB=Number.POSITIVE_INFINITY, maxWidthOrHeight, useWebWorker=false, maxIteration = 10, exifOrientation, fileType }\r\n * @param {number} [options.maxSizeMB=Number.POSITIVE_INFINITY]\r\n * @param {number} [options.maxWidthOrHeight=undefined]\r\n * @param {boolean} [options.useWebWorker=false]\r\n * @param {number} [options.maxIteration=10]\r\n * @param {number} [options.exifOrientation] - default to be the exif orientation from the image file\r\n * @param {Function} [options.onProgress] - a function takes one progress argument (progress from 0 to 100)\r\n * @param {string} [options.fileType] - default to be the original mime type from the image file\r\n * @returns {Promise}\r\n */\r\nasync function imageCompression (file, options) {\r\n\r\n let compressedFile\r\n let progress = 0\r\n let onProgress\r\n\r\n options.maxSizeMB = options.maxSizeMB || Number.POSITIVE_INFINITY\r\n const useWebWorker = typeof options.useWebWorker === 'boolean' ? options.useWebWorker : true\r\n delete options.useWebWorker\r\n onProgress = options.onProgress\r\n options.onProgress = (aProgress) => {\r\n progress = aProgress\r\n if (typeof onProgress === 'function') {\r\n onProgress(progress)\r\n }\r\n }\r\n\r\n if (!(file instanceof Blob || file instanceof CustomFile)) {\r\n throw new Error('The file given is not an instance of Blob or File')\r\n } else if (!/^image/.test(file.type)) {\r\n throw new Error('The file given is not an image')\r\n }\r\n\r\n // try run in web worker, fall back to run in main thread\r\n const inWebWorker = typeof WorkerGlobalScope !== 'undefined' && self instanceof WorkerGlobalScope\r\n\r\n // if ((useWebWorker && typeof Worker === 'function') || inWebWorker) {\r\n // console.log('run compression in web worker')\r\n // } else {\r\n // console.log('run compression in main thread')\r\n // }\r\n\r\n if (useWebWorker && typeof Worker === 'function' && !inWebWorker) {\r\n try {\r\n // console.log(1)\r\n // \"compressOnWebWorker\" is kind of like a recursion to call \"imageCompression\" again inside web worker\r\n compressedFile = await compressOnWebWorker(file, options)\r\n } catch (e) {\r\n // console.warn('Run compression in web worker failed:', e, ', fall back to main thread')\r\n // console.log(1.5)\r\n compressedFile = await compress(file, options)\r\n }\r\n } else {\r\n // console.log(2)\r\n compressedFile = await compress(file, options)\r\n }\r\n\r\n try {\r\n compressedFile.name = file.name\r\n compressedFile.lastModified = file.lastModified\r\n } catch (e) {}\r\n\r\n return compressedFile\r\n}\r\n\r\nimageCompression.getDataUrlFromFile = getDataUrlFromFile\r\nimageCompression.getFilefromDataUrl = getFilefromDataUrl\r\nimageCompression.loadImage = loadImage\r\nimageCompression.drawImageInCanvas = drawImageInCanvas\r\nimageCompression.drawFileInCanvas = drawFileInCanvas\r\nimageCompression.canvasToFile = canvasToFile\r\nimageCompression.getExifOrientation = getExifOrientation\r\n\r\nimageCompression.handleMaxWidthOrHeight = handleMaxWidthOrHeight\r\nimageCompression.followExifOrientation = followExifOrientation\r\nimageCompression.cleanupCanvasMemory = cleanupCanvasMemory\r\nimageCompression.isAutoOrientationInBrowser = isAutoOrientationInBrowser\r\nimageCompression.version = '1.0.14'\r\n\r\nexport default imageCompression\r\n"],"names":["UZIP","Uint8Array","eocd","rUi","cnu","csize","o","data","i","out","readUshort","cmpr","nlen","elen","file","inflate","inflateRaw","opts","buf","F","deflateRaw","crc","off","encode","noCmpr","wUi","obj","p","cpr","tot","ioff","t","usize","tab","k","c","table","b","end","eend","a","buff","l","s","strl","str","charCodeAt","code","ci","lvl","U","len","dlen","strt","prev","lc","_hash","cvrd","Math","min","lgi","lits","li","dst","dgi","pos","pi","dif","dlim","_howLong","td","j","ei","curd","length","MD","putsF","_putsF","BTYPE","_copyExact","o0","ltree","fltree","putsE","itree","qc","si","_writeLit","p8","_hufTree","ihst","dset","numh","ML","MH","numl","tree","set","nxt","nnxt","lz","MAXL","hst","tl","hl","list","push","l2","lit","i2","f","i0","d","restrictDepth","maxl","dps","dbt","_goodIndex","ch","u8","_bitsF","bitsE","noBuf","HLIT","_check","ordr","dmap","mx0","dtree","dlit","dcode","dbs","nbuf","lmap","_bitsE","n","mx","max_code","bl_count","MAX_BITS","next_code","rest","i1","r15","val","_putsE","dt","u16","x","tgt","sv","fdmap","pushV","h","w","img","frames","frm","rect","fw","fdata","blend","UPNG","_copyTile","frms","dispose","decode","_getBPP","ceil","ctype","qarea","area","ti","tr","ts","tb","y","s0","bpl","t0","qi","gr","to","type","dd","fr","_decompress","delay","fd","bin","readUint","tabs","offset","nz","slice","bfr","text","readUTF8","rUs","interlace","N","H","W","X","Q","v","M","S","I","_","A","q","D","R","V","Z","m","J","K","ri","pass","sh","sw","bpp","starting_row","starting_col","cdi","col","row","ii","depth","pa","pb","pc","_bin","ns","decodeURIComponent","sb","tw","oa","br","ioa","fg","bg","fa","nimg","bufs","dl","leng","cimg","plte","anim","width","wUs","_filterZero","prms","evenCrd","ilen","inds","nbufs","abuf","concatRGBA","cof","qres","img32","nw","cmc","alwaysBlend","it","mix","max","miy","may","sarea","tarea","nx","nh","ny","_prepareDiff","r","miX","miY","height","_updateFrame","cimg32","cy","ftry","fls","di","g","nd","planeDst","est","rgba","bst","root","ps","maxL","leafs","err","node","L","ln","quantize","estats","rn","left","mi","node1","getNearest","vecDot","e","m1","m2","m0","iN","M4","random","m3","Cov","sml","il","isBrowser","Date","now","result","reader","onerror","getFilefromDataUrl","resolve","dataUrl","split","arr","match","bstr","name","getImageData","fileName","tags","view","getUint16","little","canvas","maxWidthOrHeight","ctx","drawImage","newCanvas","getContext","drawFileInCanvas","cnt","imageCompressionLibUrl","script","parse","value","replace","createSourceObject","imageCompression","getDataUrlFromFile","loadImage","drawImageInCanvas","canvasToFile"],"mappings":"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"} \ No newline at end of file +{"version":3,"file":"browser-image-compression.mjs","sources":["../node_modules/core-js/internals/global.js","../node_modules/core-js/internals/is-pure.js","../node_modules/core-js/internals/set-global.js","../node_modules/core-js/internals/shared-store.js","../node_modules/core-js/internals/shared.js","../node_modules/core-js/internals/has.js","../node_modules/core-js/internals/uid.js","../node_modules/core-js/internals/get-built-in.js","../node_modules/core-js/internals/engine-v8-version.js","../node_modules/core-js/internals/fails.js","../node_modules/core-js/internals/well-known-symbol.js","../node_modules/core-js/internals/to-string-tag-support.js","../node_modules/core-js/internals/is-object.js","../node_modules/core-js/internals/document-create-element.js","../node_modules/core-js/internals/ie8-dom-define.js","../node_modules/core-js/internals/an-object.js","../node_modules/core-js/internals/is-symbol.js","../node_modules/core-js/internals/ordinary-to-primitive.js","../node_modules/core-js/internals/to-primitive.js","../node_modules/core-js/internals/object-define-property.js","../node_modules/core-js/internals/create-property-descriptor.js","../node_modules/core-js/internals/create-non-enumerable-property.js","../node_modules/core-js/internals/inspect-source.js","../node_modules/core-js/internals/native-weak-map.js","../node_modules/core-js/internals/hidden-keys.js","../node_modules/core-js/internals/internal-state.js","../node_modules/core-js/internals/redefine.js","../node_modules/core-js/internals/classof-raw.js","../node_modules/core-js/internals/classof.js","../node_modules/core-js/internals/object-property-is-enumerable.js","../node_modules/core-js/internals/indexed-object.js","../node_modules/core-js/internals/object-get-own-property-descriptor.js","../node_modules/core-js/internals/to-integer.js","../node_modules/core-js/internals/to-length.js","../node_modules/core-js/internals/to-absolute-index.js","../node_modules/core-js/internals/array-includes.js","../node_modules/core-js/internals/object-keys-internal.js","../node_modules/core-js/internals/copy-constructor-properties.js","../node_modules/core-js/internals/is-forced.js","../node_modules/core-js/internals/export.js","../node_modules/core-js/internals/redefine-all.js","../node_modules/core-js/internals/a-possible-prototype.js","../node_modules/core-js/internals/object-set-prototype-of.js","../node_modules/core-js/internals/set-to-string-tag.js","../node_modules/core-js/internals/set-species.js","../node_modules/core-js/internals/a-function.js","../node_modules/core-js/internals/an-instance.js","../node_modules/core-js/internals/iterators.js","../node_modules/core-js/internals/is-array-iterator-method.js","../node_modules/core-js/internals/function-bind-context.js","../node_modules/core-js/internals/get-iterator-method.js","../node_modules/core-js/internals/iterator-close.js","../node_modules/core-js/internals/iterate.js","../node_modules/core-js/internals/check-correctness-of-iteration.js","../node_modules/core-js/internals/species-constructor.js","../node_modules/core-js/internals/task.js","../node_modules/core-js/internals/microtask.js","../node_modules/core-js/internals/new-promise-capability.js","../node_modules/core-js/internals/promise-resolve.js","../node_modules/core-js/internals/host-report-errors.js","../node_modules/core-js/internals/perform.js","../node_modules/core-js/internals/engine-is-browser.js","../node_modules/core-js/modules/es.promise.js","../node_modules/core-js/internals/inherit-if-required.js","../node_modules/core-js/internals/object-create.js","../node_modules/core-js/internals/to-string.js","../node_modules/core-js/internals/string-trim.js","../node_modules/core-js/modules/es.number.constructor.js","../node_modules/core-js/modules/es.function.name.js","../node_modules/core-js/modules/es.global-this.js","../node_modules/core-js/internals/object-assign.js","../node_modules/core-js/internals/path.js","../node_modules/core-js/internals/regexp-sticky-helpers.js","../node_modules/core-js/internals/regexp-exec.js","../node_modules/core-js/modules/es.regexp.exec.js","../node_modules/core-js/internals/fix-regexp-well-known-symbol-logic.js","../node_modules/core-js/internals/string-multibyte.js","../node_modules/core-js/internals/advance-string-index.js","../node_modules/core-js/internals/regexp-exec-abstract.js","../node_modules/core-js/modules/es.string.split.js","../node_modules/core-js/modules/es.string.match.js","../node_modules/core-js/internals/add-to-unscopables.js","../node_modules/core-js/internals/correct-prototype-getter.js","../node_modules/core-js/internals/object-get-prototype-of.js","../node_modules/core-js/internals/iterators-core.js","../node_modules/core-js/internals/create-iterator-constructor.js","../node_modules/core-js/internals/define-iterator.js","../node_modules/core-js/modules/es.array.iterator.js","../node_modules/core-js/internals/array-buffer-native.js","../node_modules/core-js/internals/array-buffer-view-core.js","../node_modules/core-js/internals/typed-array-constructors-require-wrappers.js","../node_modules/core-js/internals/to-index.js","../node_modules/core-js/internals/ieee754.js","../node_modules/core-js/internals/array-fill.js","../node_modules/core-js/internals/array-buffer.js","../node_modules/core-js/internals/is-integer.js","../node_modules/core-js/internals/to-positive-integer.js","../node_modules/core-js/internals/to-offset.js","../node_modules/core-js/internals/typed-array-from.js","../node_modules/core-js/internals/array-species-constructor.js","../node_modules/core-js/internals/array-iteration.js","../node_modules/core-js/internals/typed-array-constructor.js","../node_modules/core-js/internals/array-copy-within.js","../node_modules/core-js/modules/es.typed-array.copy-within.js","../node_modules/core-js/modules/es.typed-array.every.js","../node_modules/core-js/modules/es.typed-array.fill.js","../node_modules/core-js/internals/array-from-constructor-and-list.js","../node_modules/core-js/internals/typed-array-species-constructor.js","../node_modules/core-js/modules/es.typed-array.filter.js","../node_modules/core-js/modules/es.typed-array.find.js","../node_modules/core-js/modules/es.typed-array.find-index.js","../node_modules/core-js/modules/es.typed-array.for-each.js","../node_modules/core-js/modules/es.typed-array.includes.js","../node_modules/core-js/modules/es.typed-array.index-of.js","../node_modules/core-js/modules/es.typed-array.iterator.js","../node_modules/core-js/modules/es.typed-array.join.js","../node_modules/core-js/internals/array-method-is-strict.js","../node_modules/core-js/internals/array-last-index-of.js","../node_modules/core-js/modules/es.typed-array.last-index-of.js","../node_modules/core-js/modules/es.typed-array.map.js","../node_modules/core-js/internals/array-reduce.js","../node_modules/core-js/modules/es.typed-array.reduce.js","../node_modules/core-js/modules/es.typed-array.reduce-right.js","../node_modules/core-js/modules/es.typed-array.reverse.js","../node_modules/core-js/modules/es.typed-array.set.js","../node_modules/core-js/modules/es.typed-array.slice.js","../node_modules/core-js/modules/es.typed-array.some.js","../node_modules/core-js/internals/array-sort.js","../node_modules/core-js/internals/engine-ff-version.js","../node_modules/core-js/modules/es.typed-array.sort.js","../node_modules/core-js/modules/es.typed-array.subarray.js","../node_modules/core-js/modules/es.typed-array.to-locale-string.js","../node_modules/core-js/modules/es.typed-array.to-string.js","../node_modules/core-js/internals/create-property.js","../node_modules/core-js/internals/array-method-has-species-support.js","../node_modules/core-js/modules/es.array.slice.js","../node_modules/core-js/modules/es.array.filter.js","../node_modules/core-js/modules/es.regexp.to-string.js","../node_modules/core-js/modules/es.array.sort.js","../node_modules/uzip/UZIP.js","../lib/UPNG.js","../lib/utils.js","../lib/image-compression.js","../node_modules/core-js/modules/es.string.iterator.js","../node_modules/core-js/modules/web.dom-collections.iterator.js","../node_modules/core-js/internals/native-url.js","../node_modules/core-js/internals/call-with-safe-iteration-closing.js","../node_modules/core-js/internals/array-from.js","../node_modules/core-js/internals/string-punycode-to-ascii.js","../node_modules/core-js/internals/get-iterator.js","../node_modules/core-js/modules/web.url-search-params.js","../node_modules/core-js/modules/web.url.js","../node_modules/core-js/internals/array-for-each.js","../node_modules/core-js/modules/web.dom-collections.for-each.js","../node_modules/core-js/internals/object-to-array.js","../node_modules/core-js/modules/es.object.entries.js","../node_modules/core-js/internals/not-a-regexp.js","../node_modules/core-js/modules/es.string.starts-with.js","../node_modules/core-js/internals/get-substitution.js","../node_modules/core-js/modules/es.string.replace.js","../node_modules/core-js/modules/es.array.concat.js","../lib/web-worker.js","../lib/index.js"],"sourcesContent":["var check = function (it) {\n return it && it.Math == Math && it;\n};\n\n// https://github.com/zloirock/core-js/issues/86#issuecomment-115759028\nmodule.exports =\n // eslint-disable-next-line es/no-global-this -- safe\n check(typeof globalThis == 'object' && globalThis) ||\n check(typeof window == 'object' && window) ||\n // eslint-disable-next-line no-restricted-globals -- safe\n check(typeof self == 'object' && self) ||\n check(typeof global == 'object' && global) ||\n // eslint-disable-next-line no-new-func -- fallback\n (function () { return this; })() || Function('return this')();\n","module.exports = false;\n","var global = require('../internals/global');\n\nmodule.exports = function (key, value) {\n try {\n // eslint-disable-next-line es/no-object-defineproperty -- safe\n Object.defineProperty(global, key, { value: value, configurable: true, writable: true });\n } catch (error) {\n global[key] = value;\n } return value;\n};\n","var global = require('../internals/global');\nvar setGlobal = require('../internals/set-global');\n\nvar SHARED = '__core-js_shared__';\nvar store = global[SHARED] || setGlobal(SHARED, {});\n\nmodule.exports = store;\n","var IS_PURE = require('../internals/is-pure');\nvar store = require('../internals/shared-store');\n\n(module.exports = function (key, value) {\n return store[key] || (store[key] = value !== undefined ? value : {});\n})('versions', []).push({\n version: '3.16.1',\n mode: IS_PURE ? 'pure' : 'global',\n copyright: '© 2021 Denis Pushkarev (zloirock.ru)'\n});\n","var toObject = require('../internals/to-object');\n\nvar hasOwnProperty = {}.hasOwnProperty;\n\nmodule.exports = Object.hasOwn || function hasOwn(it, key) {\n return hasOwnProperty.call(toObject(it), key);\n};\n","var id = 0;\nvar postfix = Math.random();\n\nmodule.exports = function (key) {\n return 'Symbol(' + String(key === undefined ? '' : key) + ')_' + (++id + postfix).toString(36);\n};\n","var global = require('../internals/global');\n\nvar aFunction = function (variable) {\n return typeof variable == 'function' ? variable : undefined;\n};\n\nmodule.exports = function (namespace, method) {\n return arguments.length < 2 ? aFunction(global[namespace]) : global[namespace] && global[namespace][method];\n};\n","var global = require('../internals/global');\nvar userAgent = require('../internals/engine-user-agent');\n\nvar process = global.process;\nvar Deno = global.Deno;\nvar versions = process && process.versions || Deno && Deno.version;\nvar v8 = versions && versions.v8;\nvar match, version;\n\nif (v8) {\n match = v8.split('.');\n version = match[0] < 4 ? 1 : match[0] + match[1];\n} else if (userAgent) {\n match = userAgent.match(/Edge\\/(\\d+)/);\n if (!match || match[1] >= 74) {\n match = userAgent.match(/Chrome\\/(\\d+)/);\n if (match) version = match[1];\n }\n}\n\nmodule.exports = version && +version;\n","module.exports = function (exec) {\n try {\n return !!exec();\n } catch (error) {\n return true;\n }\n};\n","var global = require('../internals/global');\nvar shared = require('../internals/shared');\nvar has = require('../internals/has');\nvar uid = require('../internals/uid');\nvar NATIVE_SYMBOL = require('../internals/native-symbol');\nvar USE_SYMBOL_AS_UID = require('../internals/use-symbol-as-uid');\n\nvar WellKnownSymbolsStore = shared('wks');\nvar Symbol = global.Symbol;\nvar createWellKnownSymbol = USE_SYMBOL_AS_UID ? Symbol : Symbol && Symbol.withoutSetter || uid;\n\nmodule.exports = function (name) {\n if (!has(WellKnownSymbolsStore, name) || !(NATIVE_SYMBOL || typeof WellKnownSymbolsStore[name] == 'string')) {\n if (NATIVE_SYMBOL && has(Symbol, name)) {\n WellKnownSymbolsStore[name] = Symbol[name];\n } else {\n WellKnownSymbolsStore[name] = createWellKnownSymbol('Symbol.' + name);\n }\n } return WellKnownSymbolsStore[name];\n};\n","var wellKnownSymbol = require('../internals/well-known-symbol');\n\nvar TO_STRING_TAG = wellKnownSymbol('toStringTag');\nvar test = {};\n\ntest[TO_STRING_TAG] = 'z';\n\nmodule.exports = String(test) === '[object z]';\n","module.exports = function (it) {\n return typeof it === 'object' ? it !== null : typeof it === 'function';\n};\n","var global = require('../internals/global');\nvar isObject = require('../internals/is-object');\n\nvar document = global.document;\n// typeof document.createElement is 'object' in old IE\nvar EXISTS = isObject(document) && isObject(document.createElement);\n\nmodule.exports = function (it) {\n return EXISTS ? document.createElement(it) : {};\n};\n","var DESCRIPTORS = require('../internals/descriptors');\nvar fails = require('../internals/fails');\nvar createElement = require('../internals/document-create-element');\n\n// Thank's IE8 for his funny defineProperty\nmodule.exports = !DESCRIPTORS && !fails(function () {\n // eslint-disable-next-line es/no-object-defineproperty -- requied for testing\n return Object.defineProperty(createElement('div'), 'a', {\n get: function () { return 7; }\n }).a != 7;\n});\n","var isObject = require('../internals/is-object');\n\nmodule.exports = function (it) {\n if (!isObject(it)) {\n throw TypeError(String(it) + ' is not an object');\n } return it;\n};\n","var getBuiltIn = require('../internals/get-built-in');\nvar USE_SYMBOL_AS_UID = require('../internals/use-symbol-as-uid');\n\nmodule.exports = USE_SYMBOL_AS_UID ? function (it) {\n return typeof it == 'symbol';\n} : function (it) {\n var $Symbol = getBuiltIn('Symbol');\n return typeof $Symbol == 'function' && Object(it) instanceof $Symbol;\n};\n","var isObject = require('../internals/is-object');\n\n// `OrdinaryToPrimitive` abstract operation\n// https://tc39.es/ecma262/#sec-ordinarytoprimitive\nmodule.exports = function (input, pref) {\n var fn, val;\n if (pref === 'string' && typeof (fn = input.toString) == 'function' && !isObject(val = fn.call(input))) return val;\n if (typeof (fn = input.valueOf) == 'function' && !isObject(val = fn.call(input))) return val;\n if (pref !== 'string' && typeof (fn = input.toString) == 'function' && !isObject(val = fn.call(input))) return val;\n throw TypeError(\"Can't convert object to primitive value\");\n};\n","var isObject = require('../internals/is-object');\nvar isSymbol = require('../internals/is-symbol');\nvar ordinaryToPrimitive = require('../internals/ordinary-to-primitive');\nvar wellKnownSymbol = require('../internals/well-known-symbol');\n\nvar TO_PRIMITIVE = wellKnownSymbol('toPrimitive');\n\n// `ToPrimitive` abstract operation\n// https://tc39.es/ecma262/#sec-toprimitive\nmodule.exports = function (input, pref) {\n if (!isObject(input) || isSymbol(input)) return input;\n var exoticToPrim = input[TO_PRIMITIVE];\n var result;\n if (exoticToPrim !== undefined) {\n if (pref === undefined) pref = 'default';\n result = exoticToPrim.call(input, pref);\n if (!isObject(result) || isSymbol(result)) return result;\n throw TypeError(\"Can't convert object to primitive value\");\n }\n if (pref === undefined) pref = 'number';\n return ordinaryToPrimitive(input, pref);\n};\n","var DESCRIPTORS = require('../internals/descriptors');\nvar IE8_DOM_DEFINE = require('../internals/ie8-dom-define');\nvar anObject = require('../internals/an-object');\nvar toPropertyKey = require('../internals/to-property-key');\n\n// eslint-disable-next-line es/no-object-defineproperty -- safe\nvar $defineProperty = Object.defineProperty;\n\n// `Object.defineProperty` method\n// https://tc39.es/ecma262/#sec-object.defineproperty\nexports.f = DESCRIPTORS ? $defineProperty : function defineProperty(O, P, Attributes) {\n anObject(O);\n P = toPropertyKey(P);\n anObject(Attributes);\n if (IE8_DOM_DEFINE) try {\n return $defineProperty(O, P, Attributes);\n } catch (error) { /* empty */ }\n if ('get' in Attributes || 'set' in Attributes) throw TypeError('Accessors not supported');\n if ('value' in Attributes) O[P] = Attributes.value;\n return O;\n};\n","module.exports = function (bitmap, value) {\n return {\n enumerable: !(bitmap & 1),\n configurable: !(bitmap & 2),\n writable: !(bitmap & 4),\n value: value\n };\n};\n","var DESCRIPTORS = require('../internals/descriptors');\nvar definePropertyModule = require('../internals/object-define-property');\nvar createPropertyDescriptor = require('../internals/create-property-descriptor');\n\nmodule.exports = DESCRIPTORS ? function (object, key, value) {\n return definePropertyModule.f(object, key, createPropertyDescriptor(1, value));\n} : function (object, key, value) {\n object[key] = value;\n return object;\n};\n","var store = require('../internals/shared-store');\n\nvar functionToString = Function.toString;\n\n// this helper broken in `core-js@3.4.1-3.4.4`, so we can't use `shared` helper\nif (typeof store.inspectSource != 'function') {\n store.inspectSource = function (it) {\n return functionToString.call(it);\n };\n}\n\nmodule.exports = store.inspectSource;\n","var global = require('../internals/global');\nvar inspectSource = require('../internals/inspect-source');\n\nvar WeakMap = global.WeakMap;\n\nmodule.exports = typeof WeakMap === 'function' && /native code/.test(inspectSource(WeakMap));\n","module.exports = {};\n","var NATIVE_WEAK_MAP = require('../internals/native-weak-map');\nvar global = require('../internals/global');\nvar isObject = require('../internals/is-object');\nvar createNonEnumerableProperty = require('../internals/create-non-enumerable-property');\nvar objectHas = require('../internals/has');\nvar shared = require('../internals/shared-store');\nvar sharedKey = require('../internals/shared-key');\nvar hiddenKeys = require('../internals/hidden-keys');\n\nvar OBJECT_ALREADY_INITIALIZED = 'Object already initialized';\nvar WeakMap = global.WeakMap;\nvar set, get, has;\n\nvar enforce = function (it) {\n return has(it) ? get(it) : set(it, {});\n};\n\nvar getterFor = function (TYPE) {\n return function (it) {\n var state;\n if (!isObject(it) || (state = get(it)).type !== TYPE) {\n throw TypeError('Incompatible receiver, ' + TYPE + ' required');\n } return state;\n };\n};\n\nif (NATIVE_WEAK_MAP || shared.state) {\n var store = shared.state || (shared.state = new WeakMap());\n var wmget = store.get;\n var wmhas = store.has;\n var wmset = store.set;\n set = function (it, metadata) {\n if (wmhas.call(store, it)) throw new TypeError(OBJECT_ALREADY_INITIALIZED);\n metadata.facade = it;\n wmset.call(store, it, metadata);\n return metadata;\n };\n get = function (it) {\n return wmget.call(store, it) || {};\n };\n has = function (it) {\n return wmhas.call(store, it);\n };\n} else {\n var STATE = sharedKey('state');\n hiddenKeys[STATE] = true;\n set = function (it, metadata) {\n if (objectHas(it, STATE)) throw new TypeError(OBJECT_ALREADY_INITIALIZED);\n metadata.facade = it;\n createNonEnumerableProperty(it, STATE, metadata);\n return metadata;\n };\n get = function (it) {\n return objectHas(it, STATE) ? it[STATE] : {};\n };\n has = function (it) {\n return objectHas(it, STATE);\n };\n}\n\nmodule.exports = {\n set: set,\n get: get,\n has: has,\n enforce: enforce,\n getterFor: getterFor\n};\n","var global = require('../internals/global');\nvar createNonEnumerableProperty = require('../internals/create-non-enumerable-property');\nvar has = require('../internals/has');\nvar setGlobal = require('../internals/set-global');\nvar inspectSource = require('../internals/inspect-source');\nvar InternalStateModule = require('../internals/internal-state');\n\nvar getInternalState = InternalStateModule.get;\nvar enforceInternalState = InternalStateModule.enforce;\nvar TEMPLATE = String(String).split('String');\n\n(module.exports = function (O, key, value, options) {\n var unsafe = options ? !!options.unsafe : false;\n var simple = options ? !!options.enumerable : false;\n var noTargetGet = options ? !!options.noTargetGet : false;\n var state;\n if (typeof value == 'function') {\n if (typeof key == 'string' && !has(value, 'name')) {\n createNonEnumerableProperty(value, 'name', key);\n }\n state = enforceInternalState(value);\n if (!state.source) {\n state.source = TEMPLATE.join(typeof key == 'string' ? key : '');\n }\n }\n if (O === global) {\n if (simple) O[key] = value;\n else setGlobal(key, value);\n return;\n } else if (!unsafe) {\n delete O[key];\n } else if (!noTargetGet && O[key]) {\n simple = true;\n }\n if (simple) O[key] = value;\n else createNonEnumerableProperty(O, key, value);\n// add fake Function#toString for correct work wrapped methods / constructors with methods like LoDash isNative\n})(Function.prototype, 'toString', function toString() {\n return typeof this == 'function' && getInternalState(this).source || inspectSource(this);\n});\n","var toString = {}.toString;\n\nmodule.exports = function (it) {\n return toString.call(it).slice(8, -1);\n};\n","var TO_STRING_TAG_SUPPORT = require('../internals/to-string-tag-support');\nvar classofRaw = require('../internals/classof-raw');\nvar wellKnownSymbol = require('../internals/well-known-symbol');\n\nvar TO_STRING_TAG = wellKnownSymbol('toStringTag');\n// ES3 wrong here\nvar CORRECT_ARGUMENTS = classofRaw(function () { return arguments; }()) == 'Arguments';\n\n// fallback for IE11 Script Access Denied error\nvar tryGet = function (it, key) {\n try {\n return it[key];\n } catch (error) { /* empty */ }\n};\n\n// getting tag from ES6+ `Object.prototype.toString`\nmodule.exports = TO_STRING_TAG_SUPPORT ? classofRaw : function (it) {\n var O, tag, result;\n return it === undefined ? 'Undefined' : it === null ? 'Null'\n // @@toStringTag case\n : typeof (tag = tryGet(O = Object(it), TO_STRING_TAG)) == 'string' ? tag\n // builtinTag case\n : CORRECT_ARGUMENTS ? classofRaw(O)\n // ES3 arguments fallback\n : (result = classofRaw(O)) == 'Object' && typeof O.callee == 'function' ? 'Arguments' : result;\n};\n","'use strict';\nvar $propertyIsEnumerable = {}.propertyIsEnumerable;\n// eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe\nvar getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;\n\n// Nashorn ~ JDK8 bug\nvar NASHORN_BUG = getOwnPropertyDescriptor && !$propertyIsEnumerable.call({ 1: 2 }, 1);\n\n// `Object.prototype.propertyIsEnumerable` method implementation\n// https://tc39.es/ecma262/#sec-object.prototype.propertyisenumerable\nexports.f = NASHORN_BUG ? function propertyIsEnumerable(V) {\n var descriptor = getOwnPropertyDescriptor(this, V);\n return !!descriptor && descriptor.enumerable;\n} : $propertyIsEnumerable;\n","var fails = require('../internals/fails');\nvar classof = require('../internals/classof-raw');\n\nvar split = ''.split;\n\n// fallback for non-array-like ES3 and non-enumerable old V8 strings\nmodule.exports = fails(function () {\n // throws an error in rhino, see https://github.com/mozilla/rhino/issues/346\n // eslint-disable-next-line no-prototype-builtins -- safe\n return !Object('z').propertyIsEnumerable(0);\n}) ? function (it) {\n return classof(it) == 'String' ? split.call(it, '') : Object(it);\n} : Object;\n","var DESCRIPTORS = require('../internals/descriptors');\nvar propertyIsEnumerableModule = require('../internals/object-property-is-enumerable');\nvar createPropertyDescriptor = require('../internals/create-property-descriptor');\nvar toIndexedObject = require('../internals/to-indexed-object');\nvar toPropertyKey = require('../internals/to-property-key');\nvar has = require('../internals/has');\nvar IE8_DOM_DEFINE = require('../internals/ie8-dom-define');\n\n// eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe\nvar $getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;\n\n// `Object.getOwnPropertyDescriptor` method\n// https://tc39.es/ecma262/#sec-object.getownpropertydescriptor\nexports.f = DESCRIPTORS ? $getOwnPropertyDescriptor : function getOwnPropertyDescriptor(O, P) {\n O = toIndexedObject(O);\n P = toPropertyKey(P);\n if (IE8_DOM_DEFINE) try {\n return $getOwnPropertyDescriptor(O, P);\n } catch (error) { /* empty */ }\n if (has(O, P)) return createPropertyDescriptor(!propertyIsEnumerableModule.f.call(O, P), O[P]);\n};\n","var ceil = Math.ceil;\nvar floor = Math.floor;\n\n// `ToInteger` abstract operation\n// https://tc39.es/ecma262/#sec-tointeger\nmodule.exports = function (argument) {\n return isNaN(argument = +argument) ? 0 : (argument > 0 ? floor : ceil)(argument);\n};\n","var toInteger = require('../internals/to-integer');\n\nvar min = Math.min;\n\n// `ToLength` abstract operation\n// https://tc39.es/ecma262/#sec-tolength\nmodule.exports = function (argument) {\n return argument > 0 ? min(toInteger(argument), 0x1FFFFFFFFFFFFF) : 0; // 2 ** 53 - 1 == 9007199254740991\n};\n","var toInteger = require('../internals/to-integer');\n\nvar max = Math.max;\nvar min = Math.min;\n\n// Helper for a popular repeating case of the spec:\n// Let integer be ? ToInteger(index).\n// If integer < 0, let result be max((length + integer), 0); else let result be min(integer, length).\nmodule.exports = function (index, length) {\n var integer = toInteger(index);\n return integer < 0 ? max(integer + length, 0) : min(integer, length);\n};\n","var toIndexedObject = require('../internals/to-indexed-object');\nvar toLength = require('../internals/to-length');\nvar toAbsoluteIndex = require('../internals/to-absolute-index');\n\n// `Array.prototype.{ indexOf, includes }` methods implementation\nvar createMethod = function (IS_INCLUDES) {\n return function ($this, el, fromIndex) {\n var O = toIndexedObject($this);\n var length = toLength(O.length);\n var index = toAbsoluteIndex(fromIndex, length);\n var value;\n // Array#includes uses SameValueZero equality algorithm\n // eslint-disable-next-line no-self-compare -- NaN check\n if (IS_INCLUDES && el != el) while (length > index) {\n value = O[index++];\n // eslint-disable-next-line no-self-compare -- NaN check\n if (value != value) return true;\n // Array#indexOf ignores holes, Array#includes - not\n } else for (;length > index; index++) {\n if ((IS_INCLUDES || index in O) && O[index] === el) return IS_INCLUDES || index || 0;\n } return !IS_INCLUDES && -1;\n };\n};\n\nmodule.exports = {\n // `Array.prototype.includes` method\n // https://tc39.es/ecma262/#sec-array.prototype.includes\n includes: createMethod(true),\n // `Array.prototype.indexOf` method\n // https://tc39.es/ecma262/#sec-array.prototype.indexof\n indexOf: createMethod(false)\n};\n","var has = require('../internals/has');\nvar toIndexedObject = require('../internals/to-indexed-object');\nvar indexOf = require('../internals/array-includes').indexOf;\nvar hiddenKeys = require('../internals/hidden-keys');\n\nmodule.exports = function (object, names) {\n var O = toIndexedObject(object);\n var i = 0;\n var result = [];\n var key;\n for (key in O) !has(hiddenKeys, key) && has(O, key) && result.push(key);\n // Don't enum bug & hidden keys\n while (names.length > i) if (has(O, key = names[i++])) {\n ~indexOf(result, key) || result.push(key);\n }\n return result;\n};\n","var has = require('../internals/has');\nvar ownKeys = require('../internals/own-keys');\nvar getOwnPropertyDescriptorModule = require('../internals/object-get-own-property-descriptor');\nvar definePropertyModule = require('../internals/object-define-property');\n\nmodule.exports = function (target, source) {\n var keys = ownKeys(source);\n var defineProperty = definePropertyModule.f;\n var getOwnPropertyDescriptor = getOwnPropertyDescriptorModule.f;\n for (var i = 0; i < keys.length; i++) {\n var key = keys[i];\n if (!has(target, key)) defineProperty(target, key, getOwnPropertyDescriptor(source, key));\n }\n};\n","var fails = require('../internals/fails');\n\nvar replacement = /#|\\.prototype\\./;\n\nvar isForced = function (feature, detection) {\n var value = data[normalize(feature)];\n return value == POLYFILL ? true\n : value == NATIVE ? false\n : typeof detection == 'function' ? fails(detection)\n : !!detection;\n};\n\nvar normalize = isForced.normalize = function (string) {\n return String(string).replace(replacement, '.').toLowerCase();\n};\n\nvar data = isForced.data = {};\nvar NATIVE = isForced.NATIVE = 'N';\nvar POLYFILL = isForced.POLYFILL = 'P';\n\nmodule.exports = isForced;\n","var global = require('../internals/global');\nvar getOwnPropertyDescriptor = require('../internals/object-get-own-property-descriptor').f;\nvar createNonEnumerableProperty = require('../internals/create-non-enumerable-property');\nvar redefine = require('../internals/redefine');\nvar setGlobal = require('../internals/set-global');\nvar copyConstructorProperties = require('../internals/copy-constructor-properties');\nvar isForced = require('../internals/is-forced');\n\n/*\n options.target - name of the target object\n options.global - target is the global object\n options.stat - export as static methods of target\n options.proto - export as prototype methods of target\n options.real - real prototype method for the `pure` version\n options.forced - export even if the native feature is available\n options.bind - bind methods to the target, required for the `pure` version\n options.wrap - wrap constructors to preventing global pollution, required for the `pure` version\n options.unsafe - use the simple assignment of property instead of delete + defineProperty\n options.sham - add a flag to not completely full polyfills\n options.enumerable - export as enumerable property\n options.noTargetGet - prevent calling a getter on target\n*/\nmodule.exports = function (options, source) {\n var TARGET = options.target;\n var GLOBAL = options.global;\n var STATIC = options.stat;\n var FORCED, target, key, targetProperty, sourceProperty, descriptor;\n if (GLOBAL) {\n target = global;\n } else if (STATIC) {\n target = global[TARGET] || setGlobal(TARGET, {});\n } else {\n target = (global[TARGET] || {}).prototype;\n }\n if (target) for (key in source) {\n sourceProperty = source[key];\n if (options.noTargetGet) {\n descriptor = getOwnPropertyDescriptor(target, key);\n targetProperty = descriptor && descriptor.value;\n } else targetProperty = target[key];\n FORCED = isForced(GLOBAL ? key : TARGET + (STATIC ? '.' : '#') + key, options.forced);\n // contained in target\n if (!FORCED && targetProperty !== undefined) {\n if (typeof sourceProperty === typeof targetProperty) continue;\n copyConstructorProperties(sourceProperty, targetProperty);\n }\n // add a flag to not completely full polyfills\n if (options.sham || (targetProperty && targetProperty.sham)) {\n createNonEnumerableProperty(sourceProperty, 'sham', true);\n }\n // extend global\n redefine(target, key, sourceProperty, options);\n }\n};\n","var redefine = require('../internals/redefine');\n\nmodule.exports = function (target, src, options) {\n for (var key in src) redefine(target, key, src[key], options);\n return target;\n};\n","var isObject = require('../internals/is-object');\n\nmodule.exports = function (it) {\n if (!isObject(it) && it !== null) {\n throw TypeError(\"Can't set \" + String(it) + ' as a prototype');\n } return it;\n};\n","/* eslint-disable no-proto -- safe */\nvar anObject = require('../internals/an-object');\nvar aPossiblePrototype = require('../internals/a-possible-prototype');\n\n// `Object.setPrototypeOf` method\n// https://tc39.es/ecma262/#sec-object.setprototypeof\n// Works with __proto__ only. Old v8 can't work with null proto objects.\n// eslint-disable-next-line es/no-object-setprototypeof -- safe\nmodule.exports = Object.setPrototypeOf || ('__proto__' in {} ? function () {\n var CORRECT_SETTER = false;\n var test = {};\n var setter;\n try {\n // eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe\n setter = Object.getOwnPropertyDescriptor(Object.prototype, '__proto__').set;\n setter.call(test, []);\n CORRECT_SETTER = test instanceof Array;\n } catch (error) { /* empty */ }\n return function setPrototypeOf(O, proto) {\n anObject(O);\n aPossiblePrototype(proto);\n if (CORRECT_SETTER) setter.call(O, proto);\n else O.__proto__ = proto;\n return O;\n };\n}() : undefined);\n","var defineProperty = require('../internals/object-define-property').f;\nvar has = require('../internals/has');\nvar wellKnownSymbol = require('../internals/well-known-symbol');\n\nvar TO_STRING_TAG = wellKnownSymbol('toStringTag');\n\nmodule.exports = function (it, TAG, STATIC) {\n if (it && !has(it = STATIC ? it : it.prototype, TO_STRING_TAG)) {\n defineProperty(it, TO_STRING_TAG, { configurable: true, value: TAG });\n }\n};\n","'use strict';\nvar getBuiltIn = require('../internals/get-built-in');\nvar definePropertyModule = require('../internals/object-define-property');\nvar wellKnownSymbol = require('../internals/well-known-symbol');\nvar DESCRIPTORS = require('../internals/descriptors');\n\nvar SPECIES = wellKnownSymbol('species');\n\nmodule.exports = function (CONSTRUCTOR_NAME) {\n var Constructor = getBuiltIn(CONSTRUCTOR_NAME);\n var defineProperty = definePropertyModule.f;\n\n if (DESCRIPTORS && Constructor && !Constructor[SPECIES]) {\n defineProperty(Constructor, SPECIES, {\n configurable: true,\n get: function () { return this; }\n });\n }\n};\n","module.exports = function (it) {\n if (typeof it != 'function') {\n throw TypeError(String(it) + ' is not a function');\n } return it;\n};\n","module.exports = function (it, Constructor, name) {\n if (!(it instanceof Constructor)) {\n throw TypeError('Incorrect ' + (name ? name + ' ' : '') + 'invocation');\n } return it;\n};\n","module.exports = {};\n","var wellKnownSymbol = require('../internals/well-known-symbol');\nvar Iterators = require('../internals/iterators');\n\nvar ITERATOR = wellKnownSymbol('iterator');\nvar ArrayPrototype = Array.prototype;\n\n// check on default Array iterator\nmodule.exports = function (it) {\n return it !== undefined && (Iterators.Array === it || ArrayPrototype[ITERATOR] === it);\n};\n","var aFunction = require('../internals/a-function');\n\n// optional / simple context binding\nmodule.exports = function (fn, that, length) {\n aFunction(fn);\n if (that === undefined) return fn;\n switch (length) {\n case 0: return function () {\n return fn.call(that);\n };\n case 1: return function (a) {\n return fn.call(that, a);\n };\n case 2: return function (a, b) {\n return fn.call(that, a, b);\n };\n case 3: return function (a, b, c) {\n return fn.call(that, a, b, c);\n };\n }\n return function (/* ...args */) {\n return fn.apply(that, arguments);\n };\n};\n","var classof = require('../internals/classof');\nvar Iterators = require('../internals/iterators');\nvar wellKnownSymbol = require('../internals/well-known-symbol');\n\nvar ITERATOR = wellKnownSymbol('iterator');\n\nmodule.exports = function (it) {\n if (it != undefined) return it[ITERATOR]\n || it['@@iterator']\n || Iterators[classof(it)];\n};\n","var anObject = require('../internals/an-object');\n\nmodule.exports = function (iterator) {\n var returnMethod = iterator['return'];\n if (returnMethod !== undefined) {\n return anObject(returnMethod.call(iterator)).value;\n }\n};\n","var anObject = require('../internals/an-object');\nvar isArrayIteratorMethod = require('../internals/is-array-iterator-method');\nvar toLength = require('../internals/to-length');\nvar bind = require('../internals/function-bind-context');\nvar getIteratorMethod = require('../internals/get-iterator-method');\nvar iteratorClose = require('../internals/iterator-close');\n\nvar Result = function (stopped, result) {\n this.stopped = stopped;\n this.result = result;\n};\n\nmodule.exports = function (iterable, unboundFunction, options) {\n var that = options && options.that;\n var AS_ENTRIES = !!(options && options.AS_ENTRIES);\n var IS_ITERATOR = !!(options && options.IS_ITERATOR);\n var INTERRUPTED = !!(options && options.INTERRUPTED);\n var fn = bind(unboundFunction, that, 1 + AS_ENTRIES + INTERRUPTED);\n var iterator, iterFn, index, length, result, next, step;\n\n var stop = function (condition) {\n if (iterator) iteratorClose(iterator);\n return new Result(true, condition);\n };\n\n var callFn = function (value) {\n if (AS_ENTRIES) {\n anObject(value);\n return INTERRUPTED ? fn(value[0], value[1], stop) : fn(value[0], value[1]);\n } return INTERRUPTED ? fn(value, stop) : fn(value);\n };\n\n if (IS_ITERATOR) {\n iterator = iterable;\n } else {\n iterFn = getIteratorMethod(iterable);\n if (typeof iterFn != 'function') throw TypeError('Target is not iterable');\n // optimisation for array iterators\n if (isArrayIteratorMethod(iterFn)) {\n for (index = 0, length = toLength(iterable.length); length > index; index++) {\n result = callFn(iterable[index]);\n if (result && result instanceof Result) return result;\n } return new Result(false);\n }\n iterator = iterFn.call(iterable);\n }\n\n next = iterator.next;\n while (!(step = next.call(iterator)).done) {\n try {\n result = callFn(step.value);\n } catch (error) {\n iteratorClose(iterator);\n throw error;\n }\n if (typeof result == 'object' && result && result instanceof Result) return result;\n } return new Result(false);\n};\n","var wellKnownSymbol = require('../internals/well-known-symbol');\n\nvar ITERATOR = wellKnownSymbol('iterator');\nvar SAFE_CLOSING = false;\n\ntry {\n var called = 0;\n var iteratorWithReturn = {\n next: function () {\n return { done: !!called++ };\n },\n 'return': function () {\n SAFE_CLOSING = true;\n }\n };\n iteratorWithReturn[ITERATOR] = function () {\n return this;\n };\n // eslint-disable-next-line es/no-array-from, no-throw-literal -- required for testing\n Array.from(iteratorWithReturn, function () { throw 2; });\n} catch (error) { /* empty */ }\n\nmodule.exports = function (exec, SKIP_CLOSING) {\n if (!SKIP_CLOSING && !SAFE_CLOSING) return false;\n var ITERATION_SUPPORT = false;\n try {\n var object = {};\n object[ITERATOR] = function () {\n return {\n next: function () {\n return { done: ITERATION_SUPPORT = true };\n }\n };\n };\n exec(object);\n } catch (error) { /* empty */ }\n return ITERATION_SUPPORT;\n};\n","var anObject = require('../internals/an-object');\nvar aFunction = require('../internals/a-function');\nvar wellKnownSymbol = require('../internals/well-known-symbol');\n\nvar SPECIES = wellKnownSymbol('species');\n\n// `SpeciesConstructor` abstract operation\n// https://tc39.es/ecma262/#sec-speciesconstructor\nmodule.exports = function (O, defaultConstructor) {\n var C = anObject(O).constructor;\n var S;\n return C === undefined || (S = anObject(C)[SPECIES]) == undefined ? defaultConstructor : aFunction(S);\n};\n","var global = require('../internals/global');\nvar fails = require('../internals/fails');\nvar bind = require('../internals/function-bind-context');\nvar html = require('../internals/html');\nvar createElement = require('../internals/document-create-element');\nvar IS_IOS = require('../internals/engine-is-ios');\nvar IS_NODE = require('../internals/engine-is-node');\n\nvar set = global.setImmediate;\nvar clear = global.clearImmediate;\nvar process = global.process;\nvar MessageChannel = global.MessageChannel;\nvar Dispatch = global.Dispatch;\nvar counter = 0;\nvar queue = {};\nvar ONREADYSTATECHANGE = 'onreadystatechange';\nvar location, defer, channel, port;\n\ntry {\n // Deno throws a ReferenceError on `location` access without `--location` flag\n location = global.location;\n} catch (error) { /* empty */ }\n\nvar run = function (id) {\n // eslint-disable-next-line no-prototype-builtins -- safe\n if (queue.hasOwnProperty(id)) {\n var fn = queue[id];\n delete queue[id];\n fn();\n }\n};\n\nvar runner = function (id) {\n return function () {\n run(id);\n };\n};\n\nvar listener = function (event) {\n run(event.data);\n};\n\nvar post = function (id) {\n // old engines have not location.origin\n global.postMessage(String(id), location.protocol + '//' + location.host);\n};\n\n// Node.js 0.9+ & IE10+ has setImmediate, otherwise:\nif (!set || !clear) {\n set = function setImmediate(fn) {\n var args = [];\n var argumentsLength = arguments.length;\n var i = 1;\n while (argumentsLength > i) args.push(arguments[i++]);\n queue[++counter] = function () {\n // eslint-disable-next-line no-new-func -- spec requirement\n (typeof fn == 'function' ? fn : Function(fn)).apply(undefined, args);\n };\n defer(counter);\n return counter;\n };\n clear = function clearImmediate(id) {\n delete queue[id];\n };\n // Node.js 0.8-\n if (IS_NODE) {\n defer = function (id) {\n process.nextTick(runner(id));\n };\n // Sphere (JS game engine) Dispatch API\n } else if (Dispatch && Dispatch.now) {\n defer = function (id) {\n Dispatch.now(runner(id));\n };\n // Browsers with MessageChannel, includes WebWorkers\n // except iOS - https://github.com/zloirock/core-js/issues/624\n } else if (MessageChannel && !IS_IOS) {\n channel = new MessageChannel();\n port = channel.port2;\n channel.port1.onmessage = listener;\n defer = bind(port.postMessage, port, 1);\n // Browsers with postMessage, skip WebWorkers\n // IE8 has postMessage, but it's sync & typeof its postMessage is 'object'\n } else if (\n global.addEventListener &&\n typeof postMessage == 'function' &&\n !global.importScripts &&\n location && location.protocol !== 'file:' &&\n !fails(post)\n ) {\n defer = post;\n global.addEventListener('message', listener, false);\n // IE8-\n } else if (ONREADYSTATECHANGE in createElement('script')) {\n defer = function (id) {\n html.appendChild(createElement('script'))[ONREADYSTATECHANGE] = function () {\n html.removeChild(this);\n run(id);\n };\n };\n // Rest old browsers\n } else {\n defer = function (id) {\n setTimeout(runner(id), 0);\n };\n }\n}\n\nmodule.exports = {\n set: set,\n clear: clear\n};\n","var global = require('../internals/global');\nvar getOwnPropertyDescriptor = require('../internals/object-get-own-property-descriptor').f;\nvar macrotask = require('../internals/task').set;\nvar IS_IOS = require('../internals/engine-is-ios');\nvar IS_IOS_PEBBLE = require('../internals/engine-is-ios-pebble');\nvar IS_WEBOS_WEBKIT = require('../internals/engine-is-webos-webkit');\nvar IS_NODE = require('../internals/engine-is-node');\n\nvar MutationObserver = global.MutationObserver || global.WebKitMutationObserver;\nvar document = global.document;\nvar process = global.process;\nvar Promise = global.Promise;\n// Node.js 11 shows ExperimentalWarning on getting `queueMicrotask`\nvar queueMicrotaskDescriptor = getOwnPropertyDescriptor(global, 'queueMicrotask');\nvar queueMicrotask = queueMicrotaskDescriptor && queueMicrotaskDescriptor.value;\n\nvar flush, head, last, notify, toggle, node, promise, then;\n\n// modern engines have queueMicrotask method\nif (!queueMicrotask) {\n flush = function () {\n var parent, fn;\n if (IS_NODE && (parent = process.domain)) parent.exit();\n while (head) {\n fn = head.fn;\n head = head.next;\n try {\n fn();\n } catch (error) {\n if (head) notify();\n else last = undefined;\n throw error;\n }\n } last = undefined;\n if (parent) parent.enter();\n };\n\n // browsers with MutationObserver, except iOS - https://github.com/zloirock/core-js/issues/339\n // also except WebOS Webkit https://github.com/zloirock/core-js/issues/898\n if (!IS_IOS && !IS_NODE && !IS_WEBOS_WEBKIT && MutationObserver && document) {\n toggle = true;\n node = document.createTextNode('');\n new MutationObserver(flush).observe(node, { characterData: true });\n notify = function () {\n node.data = toggle = !toggle;\n };\n // environments with maybe non-completely correct, but existent Promise\n } else if (!IS_IOS_PEBBLE && Promise && Promise.resolve) {\n // Promise.resolve without an argument throws an error in LG WebOS 2\n promise = Promise.resolve(undefined);\n // workaround of WebKit ~ iOS Safari 10.1 bug\n promise.constructor = Promise;\n then = promise.then;\n notify = function () {\n then.call(promise, flush);\n };\n // Node.js without promises\n } else if (IS_NODE) {\n notify = function () {\n process.nextTick(flush);\n };\n // for other environments - macrotask based on:\n // - setImmediate\n // - MessageChannel\n // - window.postMessag\n // - onreadystatechange\n // - setTimeout\n } else {\n notify = function () {\n // strange IE + webpack dev server bug - use .call(global)\n macrotask.call(global, flush);\n };\n }\n}\n\nmodule.exports = queueMicrotask || function (fn) {\n var task = { fn: fn, next: undefined };\n if (last) last.next = task;\n if (!head) {\n head = task;\n notify();\n } last = task;\n};\n","'use strict';\nvar aFunction = require('../internals/a-function');\n\nvar PromiseCapability = function (C) {\n var resolve, reject;\n this.promise = new C(function ($$resolve, $$reject) {\n if (resolve !== undefined || reject !== undefined) throw TypeError('Bad Promise constructor');\n resolve = $$resolve;\n reject = $$reject;\n });\n this.resolve = aFunction(resolve);\n this.reject = aFunction(reject);\n};\n\n// `NewPromiseCapability` abstract operation\n// https://tc39.es/ecma262/#sec-newpromisecapability\nmodule.exports.f = function (C) {\n return new PromiseCapability(C);\n};\n","var anObject = require('../internals/an-object');\nvar isObject = require('../internals/is-object');\nvar newPromiseCapability = require('../internals/new-promise-capability');\n\nmodule.exports = function (C, x) {\n anObject(C);\n if (isObject(x) && x.constructor === C) return x;\n var promiseCapability = newPromiseCapability.f(C);\n var resolve = promiseCapability.resolve;\n resolve(x);\n return promiseCapability.promise;\n};\n","var global = require('../internals/global');\n\nmodule.exports = function (a, b) {\n var console = global.console;\n if (console && console.error) {\n arguments.length === 1 ? console.error(a) : console.error(a, b);\n }\n};\n","module.exports = function (exec) {\n try {\n return { error: false, value: exec() };\n } catch (error) {\n return { error: true, value: error };\n }\n};\n","module.exports = typeof window == 'object';\n","'use strict';\nvar $ = require('../internals/export');\nvar IS_PURE = require('../internals/is-pure');\nvar global = require('../internals/global');\nvar getBuiltIn = require('../internals/get-built-in');\nvar NativePromise = require('../internals/native-promise-constructor');\nvar redefine = require('../internals/redefine');\nvar redefineAll = require('../internals/redefine-all');\nvar setPrototypeOf = require('../internals/object-set-prototype-of');\nvar setToStringTag = require('../internals/set-to-string-tag');\nvar setSpecies = require('../internals/set-species');\nvar isObject = require('../internals/is-object');\nvar aFunction = require('../internals/a-function');\nvar anInstance = require('../internals/an-instance');\nvar inspectSource = require('../internals/inspect-source');\nvar iterate = require('../internals/iterate');\nvar checkCorrectnessOfIteration = require('../internals/check-correctness-of-iteration');\nvar speciesConstructor = require('../internals/species-constructor');\nvar task = require('../internals/task').set;\nvar microtask = require('../internals/microtask');\nvar promiseResolve = require('../internals/promise-resolve');\nvar hostReportErrors = require('../internals/host-report-errors');\nvar newPromiseCapabilityModule = require('../internals/new-promise-capability');\nvar perform = require('../internals/perform');\nvar InternalStateModule = require('../internals/internal-state');\nvar isForced = require('../internals/is-forced');\nvar wellKnownSymbol = require('../internals/well-known-symbol');\nvar IS_BROWSER = require('../internals/engine-is-browser');\nvar IS_NODE = require('../internals/engine-is-node');\nvar V8_VERSION = require('../internals/engine-v8-version');\n\nvar SPECIES = wellKnownSymbol('species');\nvar PROMISE = 'Promise';\nvar getInternalState = InternalStateModule.get;\nvar setInternalState = InternalStateModule.set;\nvar getInternalPromiseState = InternalStateModule.getterFor(PROMISE);\nvar NativePromisePrototype = NativePromise && NativePromise.prototype;\nvar PromiseConstructor = NativePromise;\nvar PromiseConstructorPrototype = NativePromisePrototype;\nvar TypeError = global.TypeError;\nvar document = global.document;\nvar process = global.process;\nvar newPromiseCapability = newPromiseCapabilityModule.f;\nvar newGenericPromiseCapability = newPromiseCapability;\nvar DISPATCH_EVENT = !!(document && document.createEvent && global.dispatchEvent);\nvar NATIVE_REJECTION_EVENT = typeof PromiseRejectionEvent == 'function';\nvar UNHANDLED_REJECTION = 'unhandledrejection';\nvar REJECTION_HANDLED = 'rejectionhandled';\nvar PENDING = 0;\nvar FULFILLED = 1;\nvar REJECTED = 2;\nvar HANDLED = 1;\nvar UNHANDLED = 2;\nvar SUBCLASSING = false;\nvar Internal, OwnPromiseCapability, PromiseWrapper, nativeThen;\n\nvar FORCED = isForced(PROMISE, function () {\n var PROMISE_CONSTRUCTOR_SOURCE = inspectSource(PromiseConstructor);\n var GLOBAL_CORE_JS_PROMISE = PROMISE_CONSTRUCTOR_SOURCE !== String(PromiseConstructor);\n // V8 6.6 (Node 10 and Chrome 66) have a bug with resolving custom thenables\n // https://bugs.chromium.org/p/chromium/issues/detail?id=830565\n // We can't detect it synchronously, so just check versions\n if (!GLOBAL_CORE_JS_PROMISE && V8_VERSION === 66) return true;\n // We need Promise#finally in the pure version for preventing prototype pollution\n if (IS_PURE && !PromiseConstructorPrototype['finally']) return true;\n // We can't use @@species feature detection in V8 since it causes\n // deoptimization and performance degradation\n // https://github.com/zloirock/core-js/issues/679\n if (V8_VERSION >= 51 && /native code/.test(PROMISE_CONSTRUCTOR_SOURCE)) return false;\n // Detect correctness of subclassing with @@species support\n var promise = new PromiseConstructor(function (resolve) { resolve(1); });\n var FakePromise = function (exec) {\n exec(function () { /* empty */ }, function () { /* empty */ });\n };\n var constructor = promise.constructor = {};\n constructor[SPECIES] = FakePromise;\n SUBCLASSING = promise.then(function () { /* empty */ }) instanceof FakePromise;\n if (!SUBCLASSING) return true;\n // Unhandled rejections tracking support, NodeJS Promise without it fails @@species test\n return !GLOBAL_CORE_JS_PROMISE && IS_BROWSER && !NATIVE_REJECTION_EVENT;\n});\n\nvar INCORRECT_ITERATION = FORCED || !checkCorrectnessOfIteration(function (iterable) {\n PromiseConstructor.all(iterable)['catch'](function () { /* empty */ });\n});\n\n// helpers\nvar isThenable = function (it) {\n var then;\n return isObject(it) && typeof (then = it.then) == 'function' ? then : false;\n};\n\nvar notify = function (state, isReject) {\n if (state.notified) return;\n state.notified = true;\n var chain = state.reactions;\n microtask(function () {\n var value = state.value;\n var ok = state.state == FULFILLED;\n var index = 0;\n // variable length - can't use forEach\n while (chain.length > index) {\n var reaction = chain[index++];\n var handler = ok ? reaction.ok : reaction.fail;\n var resolve = reaction.resolve;\n var reject = reaction.reject;\n var domain = reaction.domain;\n var result, then, exited;\n try {\n if (handler) {\n if (!ok) {\n if (state.rejection === UNHANDLED) onHandleUnhandled(state);\n state.rejection = HANDLED;\n }\n if (handler === true) result = value;\n else {\n if (domain) domain.enter();\n result = handler(value); // can throw\n if (domain) {\n domain.exit();\n exited = true;\n }\n }\n if (result === reaction.promise) {\n reject(TypeError('Promise-chain cycle'));\n } else if (then = isThenable(result)) {\n then.call(result, resolve, reject);\n } else resolve(result);\n } else reject(value);\n } catch (error) {\n if (domain && !exited) domain.exit();\n reject(error);\n }\n }\n state.reactions = [];\n state.notified = false;\n if (isReject && !state.rejection) onUnhandled(state);\n });\n};\n\nvar dispatchEvent = function (name, promise, reason) {\n var event, handler;\n if (DISPATCH_EVENT) {\n event = document.createEvent('Event');\n event.promise = promise;\n event.reason = reason;\n event.initEvent(name, false, true);\n global.dispatchEvent(event);\n } else event = { promise: promise, reason: reason };\n if (!NATIVE_REJECTION_EVENT && (handler = global['on' + name])) handler(event);\n else if (name === UNHANDLED_REJECTION) hostReportErrors('Unhandled promise rejection', reason);\n};\n\nvar onUnhandled = function (state) {\n task.call(global, function () {\n var promise = state.facade;\n var value = state.value;\n var IS_UNHANDLED = isUnhandled(state);\n var result;\n if (IS_UNHANDLED) {\n result = perform(function () {\n if (IS_NODE) {\n process.emit('unhandledRejection', value, promise);\n } else dispatchEvent(UNHANDLED_REJECTION, promise, value);\n });\n // Browsers should not trigger `rejectionHandled` event if it was handled here, NodeJS - should\n state.rejection = IS_NODE || isUnhandled(state) ? UNHANDLED : HANDLED;\n if (result.error) throw result.value;\n }\n });\n};\n\nvar isUnhandled = function (state) {\n return state.rejection !== HANDLED && !state.parent;\n};\n\nvar onHandleUnhandled = function (state) {\n task.call(global, function () {\n var promise = state.facade;\n if (IS_NODE) {\n process.emit('rejectionHandled', promise);\n } else dispatchEvent(REJECTION_HANDLED, promise, state.value);\n });\n};\n\nvar bind = function (fn, state, unwrap) {\n return function (value) {\n fn(state, value, unwrap);\n };\n};\n\nvar internalReject = function (state, value, unwrap) {\n if (state.done) return;\n state.done = true;\n if (unwrap) state = unwrap;\n state.value = value;\n state.state = REJECTED;\n notify(state, true);\n};\n\nvar internalResolve = function (state, value, unwrap) {\n if (state.done) return;\n state.done = true;\n if (unwrap) state = unwrap;\n try {\n if (state.facade === value) throw TypeError(\"Promise can't be resolved itself\");\n var then = isThenable(value);\n if (then) {\n microtask(function () {\n var wrapper = { done: false };\n try {\n then.call(value,\n bind(internalResolve, wrapper, state),\n bind(internalReject, wrapper, state)\n );\n } catch (error) {\n internalReject(wrapper, error, state);\n }\n });\n } else {\n state.value = value;\n state.state = FULFILLED;\n notify(state, false);\n }\n } catch (error) {\n internalReject({ done: false }, error, state);\n }\n};\n\n// constructor polyfill\nif (FORCED) {\n // 25.4.3.1 Promise(executor)\n PromiseConstructor = function Promise(executor) {\n anInstance(this, PromiseConstructor, PROMISE);\n aFunction(executor);\n Internal.call(this);\n var state = getInternalState(this);\n try {\n executor(bind(internalResolve, state), bind(internalReject, state));\n } catch (error) {\n internalReject(state, error);\n }\n };\n PromiseConstructorPrototype = PromiseConstructor.prototype;\n // eslint-disable-next-line no-unused-vars -- required for `.length`\n Internal = function Promise(executor) {\n setInternalState(this, {\n type: PROMISE,\n done: false,\n notified: false,\n parent: false,\n reactions: [],\n rejection: false,\n state: PENDING,\n value: undefined\n });\n };\n Internal.prototype = redefineAll(PromiseConstructorPrototype, {\n // `Promise.prototype.then` method\n // https://tc39.es/ecma262/#sec-promise.prototype.then\n then: function then(onFulfilled, onRejected) {\n var state = getInternalPromiseState(this);\n var reaction = newPromiseCapability(speciesConstructor(this, PromiseConstructor));\n reaction.ok = typeof onFulfilled == 'function' ? onFulfilled : true;\n reaction.fail = typeof onRejected == 'function' && onRejected;\n reaction.domain = IS_NODE ? process.domain : undefined;\n state.parent = true;\n state.reactions.push(reaction);\n if (state.state != PENDING) notify(state, false);\n return reaction.promise;\n },\n // `Promise.prototype.catch` method\n // https://tc39.es/ecma262/#sec-promise.prototype.catch\n 'catch': function (onRejected) {\n return this.then(undefined, onRejected);\n }\n });\n OwnPromiseCapability = function () {\n var promise = new Internal();\n var state = getInternalState(promise);\n this.promise = promise;\n this.resolve = bind(internalResolve, state);\n this.reject = bind(internalReject, state);\n };\n newPromiseCapabilityModule.f = newPromiseCapability = function (C) {\n return C === PromiseConstructor || C === PromiseWrapper\n ? new OwnPromiseCapability(C)\n : newGenericPromiseCapability(C);\n };\n\n if (!IS_PURE && typeof NativePromise == 'function' && NativePromisePrototype !== Object.prototype) {\n nativeThen = NativePromisePrototype.then;\n\n if (!SUBCLASSING) {\n // make `Promise#then` return a polyfilled `Promise` for native promise-based APIs\n redefine(NativePromisePrototype, 'then', function then(onFulfilled, onRejected) {\n var that = this;\n return new PromiseConstructor(function (resolve, reject) {\n nativeThen.call(that, resolve, reject);\n }).then(onFulfilled, onRejected);\n // https://github.com/zloirock/core-js/issues/640\n }, { unsafe: true });\n\n // makes sure that native promise-based APIs `Promise#catch` properly works with patched `Promise#then`\n redefine(NativePromisePrototype, 'catch', PromiseConstructorPrototype['catch'], { unsafe: true });\n }\n\n // make `.constructor === Promise` work for native promise-based APIs\n try {\n delete NativePromisePrototype.constructor;\n } catch (error) { /* empty */ }\n\n // make `instanceof Promise` work for native promise-based APIs\n if (setPrototypeOf) {\n setPrototypeOf(NativePromisePrototype, PromiseConstructorPrototype);\n }\n }\n}\n\n$({ global: true, wrap: true, forced: FORCED }, {\n Promise: PromiseConstructor\n});\n\nsetToStringTag(PromiseConstructor, PROMISE, false, true);\nsetSpecies(PROMISE);\n\nPromiseWrapper = getBuiltIn(PROMISE);\n\n// statics\n$({ target: PROMISE, stat: true, forced: FORCED }, {\n // `Promise.reject` method\n // https://tc39.es/ecma262/#sec-promise.reject\n reject: function reject(r) {\n var capability = newPromiseCapability(this);\n capability.reject.call(undefined, r);\n return capability.promise;\n }\n});\n\n$({ target: PROMISE, stat: true, forced: IS_PURE || FORCED }, {\n // `Promise.resolve` method\n // https://tc39.es/ecma262/#sec-promise.resolve\n resolve: function resolve(x) {\n return promiseResolve(IS_PURE && this === PromiseWrapper ? PromiseConstructor : this, x);\n }\n});\n\n$({ target: PROMISE, stat: true, forced: INCORRECT_ITERATION }, {\n // `Promise.all` method\n // https://tc39.es/ecma262/#sec-promise.all\n all: function all(iterable) {\n var C = this;\n var capability = newPromiseCapability(C);\n var resolve = capability.resolve;\n var reject = capability.reject;\n var result = perform(function () {\n var $promiseResolve = aFunction(C.resolve);\n var values = [];\n var counter = 0;\n var remaining = 1;\n iterate(iterable, function (promise) {\n var index = counter++;\n var alreadyCalled = false;\n values.push(undefined);\n remaining++;\n $promiseResolve.call(C, promise).then(function (value) {\n if (alreadyCalled) return;\n alreadyCalled = true;\n values[index] = value;\n --remaining || resolve(values);\n }, reject);\n });\n --remaining || resolve(values);\n });\n if (result.error) reject(result.value);\n return capability.promise;\n },\n // `Promise.race` method\n // https://tc39.es/ecma262/#sec-promise.race\n race: function race(iterable) {\n var C = this;\n var capability = newPromiseCapability(C);\n var reject = capability.reject;\n var result = perform(function () {\n var $promiseResolve = aFunction(C.resolve);\n iterate(iterable, function (promise) {\n $promiseResolve.call(C, promise).then(capability.resolve, reject);\n });\n });\n if (result.error) reject(result.value);\n return capability.promise;\n }\n});\n","var isObject = require('../internals/is-object');\nvar setPrototypeOf = require('../internals/object-set-prototype-of');\n\n// makes subclassing work correct for wrapped built-ins\nmodule.exports = function ($this, dummy, Wrapper) {\n var NewTarget, NewTargetPrototype;\n if (\n // it can work only with native `setPrototypeOf`\n setPrototypeOf &&\n // we haven't completely correct pre-ES6 way for getting `new.target`, so use this\n typeof (NewTarget = dummy.constructor) == 'function' &&\n NewTarget !== Wrapper &&\n isObject(NewTargetPrototype = NewTarget.prototype) &&\n NewTargetPrototype !== Wrapper.prototype\n ) setPrototypeOf($this, NewTargetPrototype);\n return $this;\n};\n","/* global ActiveXObject -- old IE, WSH */\nvar anObject = require('../internals/an-object');\nvar defineProperties = require('../internals/object-define-properties');\nvar enumBugKeys = require('../internals/enum-bug-keys');\nvar hiddenKeys = require('../internals/hidden-keys');\nvar html = require('../internals/html');\nvar documentCreateElement = require('../internals/document-create-element');\nvar sharedKey = require('../internals/shared-key');\n\nvar GT = '>';\nvar LT = '<';\nvar PROTOTYPE = 'prototype';\nvar SCRIPT = 'script';\nvar IE_PROTO = sharedKey('IE_PROTO');\n\nvar EmptyConstructor = function () { /* empty */ };\n\nvar scriptTag = function (content) {\n return LT + SCRIPT + GT + content + LT + '/' + SCRIPT + GT;\n};\n\n// Create object with fake `null` prototype: use ActiveX Object with cleared prototype\nvar NullProtoObjectViaActiveX = function (activeXDocument) {\n activeXDocument.write(scriptTag(''));\n activeXDocument.close();\n var temp = activeXDocument.parentWindow.Object;\n activeXDocument = null; // avoid memory leak\n return temp;\n};\n\n// Create object with fake `null` prototype: use iframe Object with cleared prototype\nvar NullProtoObjectViaIFrame = function () {\n // Thrash, waste and sodomy: IE GC bug\n var iframe = documentCreateElement('iframe');\n var JS = 'java' + SCRIPT + ':';\n var iframeDocument;\n if (iframe.style) {\n iframe.style.display = 'none';\n html.appendChild(iframe);\n // https://github.com/zloirock/core-js/issues/475\n iframe.src = String(JS);\n iframeDocument = iframe.contentWindow.document;\n iframeDocument.open();\n iframeDocument.write(scriptTag('document.F=Object'));\n iframeDocument.close();\n return iframeDocument.F;\n }\n};\n\n// Check for document.domain and active x support\n// No need to use active x approach when document.domain is not set\n// see https://github.com/es-shims/es5-shim/issues/150\n// variation of https://github.com/kitcambridge/es5-shim/commit/4f738ac066346\n// avoid IE GC bug\nvar activeXDocument;\nvar NullProtoObject = function () {\n try {\n activeXDocument = new ActiveXObject('htmlfile');\n } catch (error) { /* ignore */ }\n NullProtoObject = document.domain && activeXDocument ?\n NullProtoObjectViaActiveX(activeXDocument) : // old IE\n NullProtoObjectViaIFrame() ||\n NullProtoObjectViaActiveX(activeXDocument); // WSH\n var length = enumBugKeys.length;\n while (length--) delete NullProtoObject[PROTOTYPE][enumBugKeys[length]];\n return NullProtoObject();\n};\n\nhiddenKeys[IE_PROTO] = true;\n\n// `Object.create` method\n// https://tc39.es/ecma262/#sec-object.create\nmodule.exports = Object.create || function create(O, Properties) {\n var result;\n if (O !== null) {\n EmptyConstructor[PROTOTYPE] = anObject(O);\n result = new EmptyConstructor();\n EmptyConstructor[PROTOTYPE] = null;\n // add \"__proto__\" for Object.getPrototypeOf polyfill\n result[IE_PROTO] = O;\n } else result = NullProtoObject();\n return Properties === undefined ? result : defineProperties(result, Properties);\n};\n","var isSymbol = require('../internals/is-symbol');\n\nmodule.exports = function (argument) {\n if (isSymbol(argument)) throw TypeError('Cannot convert a Symbol value to a string');\n return String(argument);\n};\n","var requireObjectCoercible = require('../internals/require-object-coercible');\nvar toString = require('../internals/to-string');\nvar whitespaces = require('../internals/whitespaces');\n\nvar whitespace = '[' + whitespaces + ']';\nvar ltrim = RegExp('^' + whitespace + whitespace + '*');\nvar rtrim = RegExp(whitespace + whitespace + '*$');\n\n// `String.prototype.{ trim, trimStart, trimEnd, trimLeft, trimRight }` methods implementation\nvar createMethod = function (TYPE) {\n return function ($this) {\n var string = toString(requireObjectCoercible($this));\n if (TYPE & 1) string = string.replace(ltrim, '');\n if (TYPE & 2) string = string.replace(rtrim, '');\n return string;\n };\n};\n\nmodule.exports = {\n // `String.prototype.{ trimLeft, trimStart }` methods\n // https://tc39.es/ecma262/#sec-string.prototype.trimstart\n start: createMethod(1),\n // `String.prototype.{ trimRight, trimEnd }` methods\n // https://tc39.es/ecma262/#sec-string.prototype.trimend\n end: createMethod(2),\n // `String.prototype.trim` method\n // https://tc39.es/ecma262/#sec-string.prototype.trim\n trim: createMethod(3)\n};\n","'use strict';\nvar DESCRIPTORS = require('../internals/descriptors');\nvar global = require('../internals/global');\nvar isForced = require('../internals/is-forced');\nvar redefine = require('../internals/redefine');\nvar has = require('../internals/has');\nvar classof = require('../internals/classof-raw');\nvar inheritIfRequired = require('../internals/inherit-if-required');\nvar isSymbol = require('../internals/is-symbol');\nvar toPrimitive = require('../internals/to-primitive');\nvar fails = require('../internals/fails');\nvar create = require('../internals/object-create');\nvar getOwnPropertyNames = require('../internals/object-get-own-property-names').f;\nvar getOwnPropertyDescriptor = require('../internals/object-get-own-property-descriptor').f;\nvar defineProperty = require('../internals/object-define-property').f;\nvar trim = require('../internals/string-trim').trim;\n\nvar NUMBER = 'Number';\nvar NativeNumber = global[NUMBER];\nvar NumberPrototype = NativeNumber.prototype;\n\n// Opera ~12 has broken Object#toString\nvar BROKEN_CLASSOF = classof(create(NumberPrototype)) == NUMBER;\n\n// `ToNumber` abstract operation\n// https://tc39.es/ecma262/#sec-tonumber\nvar toNumber = function (argument) {\n if (isSymbol(argument)) throw TypeError('Cannot convert a Symbol value to a number');\n var it = toPrimitive(argument, 'number');\n var first, third, radix, maxCode, digits, length, index, code;\n if (typeof it == 'string' && it.length > 2) {\n it = trim(it);\n first = it.charCodeAt(0);\n if (first === 43 || first === 45) {\n third = it.charCodeAt(2);\n if (third === 88 || third === 120) return NaN; // Number('+0x1') should be NaN, old V8 fix\n } else if (first === 48) {\n switch (it.charCodeAt(1)) {\n case 66: case 98: radix = 2; maxCode = 49; break; // fast equal of /^0b[01]+$/i\n case 79: case 111: radix = 8; maxCode = 55; break; // fast equal of /^0o[0-7]+$/i\n default: return +it;\n }\n digits = it.slice(2);\n length = digits.length;\n for (index = 0; index < length; index++) {\n code = digits.charCodeAt(index);\n // parseInt parses a string to a first unavailable symbol\n // but ToNumber should return NaN if a string contains unavailable symbols\n if (code < 48 || code > maxCode) return NaN;\n } return parseInt(digits, radix);\n }\n } return +it;\n};\n\n// `Number` constructor\n// https://tc39.es/ecma262/#sec-number-constructor\nif (isForced(NUMBER, !NativeNumber(' 0o1') || !NativeNumber('0b1') || NativeNumber('+0x1'))) {\n var NumberWrapper = function Number(value) {\n var it = arguments.length < 1 ? 0 : value;\n var dummy = this;\n return dummy instanceof NumberWrapper\n // check on 1..constructor(foo) case\n && (BROKEN_CLASSOF ? fails(function () { NumberPrototype.valueOf.call(dummy); }) : classof(dummy) != NUMBER)\n ? inheritIfRequired(new NativeNumber(toNumber(it)), dummy, NumberWrapper) : toNumber(it);\n };\n for (var keys = DESCRIPTORS ? getOwnPropertyNames(NativeNumber) : (\n // ES3:\n 'MAX_VALUE,MIN_VALUE,NaN,NEGATIVE_INFINITY,POSITIVE_INFINITY,' +\n // ES2015 (in case, if modules with ES2015 Number statics required before):\n 'EPSILON,isFinite,isInteger,isNaN,isSafeInteger,MAX_SAFE_INTEGER,' +\n 'MIN_SAFE_INTEGER,parseFloat,parseInt,isInteger,' +\n // ESNext\n 'fromString,range'\n ).split(','), j = 0, key; keys.length > j; j++) {\n if (has(NativeNumber, key = keys[j]) && !has(NumberWrapper, key)) {\n defineProperty(NumberWrapper, key, getOwnPropertyDescriptor(NativeNumber, key));\n }\n }\n NumberWrapper.prototype = NumberPrototype;\n NumberPrototype.constructor = NumberWrapper;\n redefine(global, NUMBER, NumberWrapper);\n}\n","var DESCRIPTORS = require('../internals/descriptors');\nvar defineProperty = require('../internals/object-define-property').f;\n\nvar FunctionPrototype = Function.prototype;\nvar FunctionPrototypeToString = FunctionPrototype.toString;\nvar nameRE = /^\\s*function ([^ (]*)/;\nvar NAME = 'name';\n\n// Function instances `.name` property\n// https://tc39.es/ecma262/#sec-function-instances-name\nif (DESCRIPTORS && !(NAME in FunctionPrototype)) {\n defineProperty(FunctionPrototype, NAME, {\n configurable: true,\n get: function () {\n try {\n return FunctionPrototypeToString.call(this).match(nameRE)[1];\n } catch (error) {\n return '';\n }\n }\n });\n}\n","var $ = require('../internals/export');\nvar global = require('../internals/global');\n\n// `globalThis` object\n// https://tc39.es/ecma262/#sec-globalthis\n$({ global: true }, {\n globalThis: global\n});\n","'use strict';\nvar DESCRIPTORS = require('../internals/descriptors');\nvar fails = require('../internals/fails');\nvar objectKeys = require('../internals/object-keys');\nvar getOwnPropertySymbolsModule = require('../internals/object-get-own-property-symbols');\nvar propertyIsEnumerableModule = require('../internals/object-property-is-enumerable');\nvar toObject = require('../internals/to-object');\nvar IndexedObject = require('../internals/indexed-object');\n\n// eslint-disable-next-line es/no-object-assign -- safe\nvar $assign = Object.assign;\n// eslint-disable-next-line es/no-object-defineproperty -- required for testing\nvar defineProperty = Object.defineProperty;\n\n// `Object.assign` method\n// https://tc39.es/ecma262/#sec-object.assign\nmodule.exports = !$assign || fails(function () {\n // should have correct order of operations (Edge bug)\n if (DESCRIPTORS && $assign({ b: 1 }, $assign(defineProperty({}, 'a', {\n enumerable: true,\n get: function () {\n defineProperty(this, 'b', {\n value: 3,\n enumerable: false\n });\n }\n }), { b: 2 })).b !== 1) return true;\n // should work with symbols and should have deterministic property order (V8 bug)\n var A = {};\n var B = {};\n // eslint-disable-next-line es/no-symbol -- safe\n var symbol = Symbol();\n var alphabet = 'abcdefghijklmnopqrst';\n A[symbol] = 7;\n alphabet.split('').forEach(function (chr) { B[chr] = chr; });\n return $assign({}, A)[symbol] != 7 || objectKeys($assign({}, B)).join('') != alphabet;\n}) ? function assign(target, source) { // eslint-disable-line no-unused-vars -- required for `.length`\n var T = toObject(target);\n var argumentsLength = arguments.length;\n var index = 1;\n var getOwnPropertySymbols = getOwnPropertySymbolsModule.f;\n var propertyIsEnumerable = propertyIsEnumerableModule.f;\n while (argumentsLength > index) {\n var S = IndexedObject(arguments[index++]);\n var keys = getOwnPropertySymbols ? objectKeys(S).concat(getOwnPropertySymbols(S)) : objectKeys(S);\n var length = keys.length;\n var j = 0;\n var key;\n while (length > j) {\n key = keys[j++];\n if (!DESCRIPTORS || propertyIsEnumerable.call(S, key)) T[key] = S[key];\n }\n } return T;\n} : $assign;\n","var global = require('../internals/global');\n\nmodule.exports = global;\n","var fails = require('../internals/fails');\n\n// babel-minify transpiles RegExp('a', 'y') -> /a/y and it causes SyntaxError,\nvar RE = function (s, f) {\n return RegExp(s, f);\n};\n\nexports.UNSUPPORTED_Y = fails(function () {\n var re = RE('a', 'y');\n re.lastIndex = 2;\n return re.exec('abcd') != null;\n});\n\nexports.BROKEN_CARET = fails(function () {\n // https://bugzilla.mozilla.org/show_bug.cgi?id=773687\n var re = RE('^r', 'gy');\n re.lastIndex = 2;\n return re.exec('str') != null;\n});\n","'use strict';\n/* eslint-disable regexp/no-assertion-capturing-group, regexp/no-empty-group, regexp/no-lazy-ends -- testing */\n/* eslint-disable regexp/no-useless-quantifier -- testing */\nvar toString = require('../internals/to-string');\nvar regexpFlags = require('../internals/regexp-flags');\nvar stickyHelpers = require('../internals/regexp-sticky-helpers');\nvar shared = require('../internals/shared');\nvar create = require('../internals/object-create');\nvar getInternalState = require('../internals/internal-state').get;\nvar UNSUPPORTED_DOT_ALL = require('../internals/regexp-unsupported-dot-all');\nvar UNSUPPORTED_NCG = require('../internals/regexp-unsupported-ncg');\n\nvar nativeExec = RegExp.prototype.exec;\nvar nativeReplace = shared('native-string-replace', String.prototype.replace);\n\nvar patchedExec = nativeExec;\n\nvar UPDATES_LAST_INDEX_WRONG = (function () {\n var re1 = /a/;\n var re2 = /b*/g;\n nativeExec.call(re1, 'a');\n nativeExec.call(re2, 'a');\n return re1.lastIndex !== 0 || re2.lastIndex !== 0;\n})();\n\nvar UNSUPPORTED_Y = stickyHelpers.UNSUPPORTED_Y || stickyHelpers.BROKEN_CARET;\n\n// nonparticipating capturing group, copied from es5-shim's String#split patch.\nvar NPCG_INCLUDED = /()??/.exec('')[1] !== undefined;\n\nvar PATCH = UPDATES_LAST_INDEX_WRONG || NPCG_INCLUDED || UNSUPPORTED_Y || UNSUPPORTED_DOT_ALL || UNSUPPORTED_NCG;\n\nif (PATCH) {\n // eslint-disable-next-line max-statements -- TODO\n patchedExec = function exec(string) {\n var re = this;\n var state = getInternalState(re);\n var str = toString(string);\n var raw = state.raw;\n var result, reCopy, lastIndex, match, i, object, group;\n\n if (raw) {\n raw.lastIndex = re.lastIndex;\n result = patchedExec.call(raw, str);\n re.lastIndex = raw.lastIndex;\n return result;\n }\n\n var groups = state.groups;\n var sticky = UNSUPPORTED_Y && re.sticky;\n var flags = regexpFlags.call(re);\n var source = re.source;\n var charsAdded = 0;\n var strCopy = str;\n\n if (sticky) {\n flags = flags.replace('y', '');\n if (flags.indexOf('g') === -1) {\n flags += 'g';\n }\n\n strCopy = str.slice(re.lastIndex);\n // Support anchored sticky behavior.\n if (re.lastIndex > 0 && (!re.multiline || re.multiline && str.charAt(re.lastIndex - 1) !== '\\n')) {\n source = '(?: ' + source + ')';\n strCopy = ' ' + strCopy;\n charsAdded++;\n }\n // ^(? + rx + ) is needed, in combination with some str slicing, to\n // simulate the 'y' flag.\n reCopy = new RegExp('^(?:' + source + ')', flags);\n }\n\n if (NPCG_INCLUDED) {\n reCopy = new RegExp('^' + source + '$(?!\\\\s)', flags);\n }\n if (UPDATES_LAST_INDEX_WRONG) lastIndex = re.lastIndex;\n\n match = nativeExec.call(sticky ? reCopy : re, strCopy);\n\n if (sticky) {\n if (match) {\n match.input = match.input.slice(charsAdded);\n match[0] = match[0].slice(charsAdded);\n match.index = re.lastIndex;\n re.lastIndex += match[0].length;\n } else re.lastIndex = 0;\n } else if (UPDATES_LAST_INDEX_WRONG && match) {\n re.lastIndex = re.global ? match.index + match[0].length : lastIndex;\n }\n if (NPCG_INCLUDED && match && match.length > 1) {\n // Fix browsers whose `exec` methods don't consistently return `undefined`\n // for NPCG, like IE8. NOTE: This doesn' work for /(.?)?/\n nativeReplace.call(match[0], reCopy, function () {\n for (i = 1; i < arguments.length - 2; i++) {\n if (arguments[i] === undefined) match[i] = undefined;\n }\n });\n }\n\n if (match && groups) {\n match.groups = object = create(null);\n for (i = 0; i < groups.length; i++) {\n group = groups[i];\n object[group[0]] = match[group[1]];\n }\n }\n\n return match;\n };\n}\n\nmodule.exports = patchedExec;\n","'use strict';\nvar $ = require('../internals/export');\nvar exec = require('../internals/regexp-exec');\n\n// `RegExp.prototype.exec` method\n// https://tc39.es/ecma262/#sec-regexp.prototype.exec\n$({ target: 'RegExp', proto: true, forced: /./.exec !== exec }, {\n exec: exec\n});\n","'use strict';\n// TODO: Remove from `core-js@4` since it's moved to entry points\nrequire('../modules/es.regexp.exec');\nvar redefine = require('../internals/redefine');\nvar regexpExec = require('../internals/regexp-exec');\nvar fails = require('../internals/fails');\nvar wellKnownSymbol = require('../internals/well-known-symbol');\nvar createNonEnumerableProperty = require('../internals/create-non-enumerable-property');\n\nvar SPECIES = wellKnownSymbol('species');\nvar RegExpPrototype = RegExp.prototype;\n\nmodule.exports = function (KEY, exec, FORCED, SHAM) {\n var SYMBOL = wellKnownSymbol(KEY);\n\n var DELEGATES_TO_SYMBOL = !fails(function () {\n // String methods call symbol-named RegEp methods\n var O = {};\n O[SYMBOL] = function () { return 7; };\n return ''[KEY](O) != 7;\n });\n\n var DELEGATES_TO_EXEC = DELEGATES_TO_SYMBOL && !fails(function () {\n // Symbol-named RegExp methods call .exec\n var execCalled = false;\n var re = /a/;\n\n if (KEY === 'split') {\n // We can't use real regex here since it causes deoptimization\n // and serious performance degradation in V8\n // https://github.com/zloirock/core-js/issues/306\n re = {};\n // RegExp[@@split] doesn't call the regex's exec method, but first creates\n // a new one. We need to return the patched regex when creating the new one.\n re.constructor = {};\n re.constructor[SPECIES] = function () { return re; };\n re.flags = '';\n re[SYMBOL] = /./[SYMBOL];\n }\n\n re.exec = function () { execCalled = true; return null; };\n\n re[SYMBOL]('');\n return !execCalled;\n });\n\n if (\n !DELEGATES_TO_SYMBOL ||\n !DELEGATES_TO_EXEC ||\n FORCED\n ) {\n var nativeRegExpMethod = /./[SYMBOL];\n var methods = exec(SYMBOL, ''[KEY], function (nativeMethod, regexp, str, arg2, forceStringMethod) {\n var $exec = regexp.exec;\n if ($exec === regexpExec || $exec === RegExpPrototype.exec) {\n if (DELEGATES_TO_SYMBOL && !forceStringMethod) {\n // The native String method already delegates to @@method (this\n // polyfilled function), leasing to infinite recursion.\n // We avoid it by directly calling the native @@method method.\n return { done: true, value: nativeRegExpMethod.call(regexp, str, arg2) };\n }\n return { done: true, value: nativeMethod.call(str, regexp, arg2) };\n }\n return { done: false };\n });\n\n redefine(String.prototype, KEY, methods[0]);\n redefine(RegExpPrototype, SYMBOL, methods[1]);\n }\n\n if (SHAM) createNonEnumerableProperty(RegExpPrototype[SYMBOL], 'sham', true);\n};\n","var toInteger = require('../internals/to-integer');\nvar toString = require('../internals/to-string');\nvar requireObjectCoercible = require('../internals/require-object-coercible');\n\n// `String.prototype.codePointAt` methods implementation\nvar createMethod = function (CONVERT_TO_STRING) {\n return function ($this, pos) {\n var S = toString(requireObjectCoercible($this));\n var position = toInteger(pos);\n var size = S.length;\n var first, second;\n if (position < 0 || position >= size) return CONVERT_TO_STRING ? '' : undefined;\n first = S.charCodeAt(position);\n return first < 0xD800 || first > 0xDBFF || position + 1 === size\n || (second = S.charCodeAt(position + 1)) < 0xDC00 || second > 0xDFFF\n ? CONVERT_TO_STRING ? S.charAt(position) : first\n : CONVERT_TO_STRING ? S.slice(position, position + 2) : (first - 0xD800 << 10) + (second - 0xDC00) + 0x10000;\n };\n};\n\nmodule.exports = {\n // `String.prototype.codePointAt` method\n // https://tc39.es/ecma262/#sec-string.prototype.codepointat\n codeAt: createMethod(false),\n // `String.prototype.at` method\n // https://github.com/mathiasbynens/String.prototype.at\n charAt: createMethod(true)\n};\n","'use strict';\nvar charAt = require('../internals/string-multibyte').charAt;\n\n// `AdvanceStringIndex` abstract operation\n// https://tc39.es/ecma262/#sec-advancestringindex\nmodule.exports = function (S, index, unicode) {\n return index + (unicode ? charAt(S, index).length : 1);\n};\n","var classof = require('./classof-raw');\nvar regexpExec = require('./regexp-exec');\n\n// `RegExpExec` abstract operation\n// https://tc39.es/ecma262/#sec-regexpexec\nmodule.exports = function (R, S) {\n var exec = R.exec;\n if (typeof exec === 'function') {\n var result = exec.call(R, S);\n if (typeof result !== 'object') {\n throw TypeError('RegExp exec method returned something other than an Object or null');\n }\n return result;\n }\n\n if (classof(R) !== 'RegExp') {\n throw TypeError('RegExp#exec called on incompatible receiver');\n }\n\n return regexpExec.call(R, S);\n};\n\n","'use strict';\nvar fixRegExpWellKnownSymbolLogic = require('../internals/fix-regexp-well-known-symbol-logic');\nvar isRegExp = require('../internals/is-regexp');\nvar anObject = require('../internals/an-object');\nvar requireObjectCoercible = require('../internals/require-object-coercible');\nvar speciesConstructor = require('../internals/species-constructor');\nvar advanceStringIndex = require('../internals/advance-string-index');\nvar toLength = require('../internals/to-length');\nvar toString = require('../internals/to-string');\nvar callRegExpExec = require('../internals/regexp-exec-abstract');\nvar regexpExec = require('../internals/regexp-exec');\nvar stickyHelpers = require('../internals/regexp-sticky-helpers');\nvar fails = require('../internals/fails');\n\nvar UNSUPPORTED_Y = stickyHelpers.UNSUPPORTED_Y;\nvar arrayPush = [].push;\nvar min = Math.min;\nvar MAX_UINT32 = 0xFFFFFFFF;\n\n// Chrome 51 has a buggy \"split\" implementation when RegExp#exec !== nativeExec\n// Weex JS has frozen built-in prototypes, so use try / catch wrapper\nvar SPLIT_WORKS_WITH_OVERWRITTEN_EXEC = !fails(function () {\n // eslint-disable-next-line regexp/no-empty-group -- required for testing\n var re = /(?:)/;\n var originalExec = re.exec;\n re.exec = function () { return originalExec.apply(this, arguments); };\n var result = 'ab'.split(re);\n return result.length !== 2 || result[0] !== 'a' || result[1] !== 'b';\n});\n\n// @@split logic\nfixRegExpWellKnownSymbolLogic('split', function (SPLIT, nativeSplit, maybeCallNative) {\n var internalSplit;\n if (\n 'abbc'.split(/(b)*/)[1] == 'c' ||\n // eslint-disable-next-line regexp/no-empty-group -- required for testing\n 'test'.split(/(?:)/, -1).length != 4 ||\n 'ab'.split(/(?:ab)*/).length != 2 ||\n '.'.split(/(.?)(.?)/).length != 4 ||\n // eslint-disable-next-line regexp/no-assertion-capturing-group, regexp/no-empty-group -- required for testing\n '.'.split(/()()/).length > 1 ||\n ''.split(/.?/).length\n ) {\n // based on es5-shim implementation, need to rework it\n internalSplit = function (separator, limit) {\n var string = toString(requireObjectCoercible(this));\n var lim = limit === undefined ? MAX_UINT32 : limit >>> 0;\n if (lim === 0) return [];\n if (separator === undefined) return [string];\n // If `separator` is not a regex, use native split\n if (!isRegExp(separator)) {\n return nativeSplit.call(string, separator, lim);\n }\n var output = [];\n var flags = (separator.ignoreCase ? 'i' : '') +\n (separator.multiline ? 'm' : '') +\n (separator.unicode ? 'u' : '') +\n (separator.sticky ? 'y' : '');\n var lastLastIndex = 0;\n // Make `global` and avoid `lastIndex` issues by working with a copy\n var separatorCopy = new RegExp(separator.source, flags + 'g');\n var match, lastIndex, lastLength;\n while (match = regexpExec.call(separatorCopy, string)) {\n lastIndex = separatorCopy.lastIndex;\n if (lastIndex > lastLastIndex) {\n output.push(string.slice(lastLastIndex, match.index));\n if (match.length > 1 && match.index < string.length) arrayPush.apply(output, match.slice(1));\n lastLength = match[0].length;\n lastLastIndex = lastIndex;\n if (output.length >= lim) break;\n }\n if (separatorCopy.lastIndex === match.index) separatorCopy.lastIndex++; // Avoid an infinite loop\n }\n if (lastLastIndex === string.length) {\n if (lastLength || !separatorCopy.test('')) output.push('');\n } else output.push(string.slice(lastLastIndex));\n return output.length > lim ? output.slice(0, lim) : output;\n };\n // Chakra, V8\n } else if ('0'.split(undefined, 0).length) {\n internalSplit = function (separator, limit) {\n return separator === undefined && limit === 0 ? [] : nativeSplit.call(this, separator, limit);\n };\n } else internalSplit = nativeSplit;\n\n return [\n // `String.prototype.split` method\n // https://tc39.es/ecma262/#sec-string.prototype.split\n function split(separator, limit) {\n var O = requireObjectCoercible(this);\n var splitter = separator == undefined ? undefined : separator[SPLIT];\n return splitter !== undefined\n ? splitter.call(separator, O, limit)\n : internalSplit.call(toString(O), separator, limit);\n },\n // `RegExp.prototype[@@split]` method\n // https://tc39.es/ecma262/#sec-regexp.prototype-@@split\n //\n // NOTE: This cannot be properly polyfilled in engines that don't support\n // the 'y' flag.\n function (string, limit) {\n var rx = anObject(this);\n var S = toString(string);\n var res = maybeCallNative(internalSplit, rx, S, limit, internalSplit !== nativeSplit);\n\n if (res.done) return res.value;\n\n var C = speciesConstructor(rx, RegExp);\n\n var unicodeMatching = rx.unicode;\n var flags = (rx.ignoreCase ? 'i' : '') +\n (rx.multiline ? 'm' : '') +\n (rx.unicode ? 'u' : '') +\n (UNSUPPORTED_Y ? 'g' : 'y');\n\n // ^(? + rx + ) is needed, in combination with some S slicing, to\n // simulate the 'y' flag.\n var splitter = new C(UNSUPPORTED_Y ? '^(?:' + rx.source + ')' : rx, flags);\n var lim = limit === undefined ? MAX_UINT32 : limit >>> 0;\n if (lim === 0) return [];\n if (S.length === 0) return callRegExpExec(splitter, S) === null ? [S] : [];\n var p = 0;\n var q = 0;\n var A = [];\n while (q < S.length) {\n splitter.lastIndex = UNSUPPORTED_Y ? 0 : q;\n var z = callRegExpExec(splitter, UNSUPPORTED_Y ? S.slice(q) : S);\n var e;\n if (\n z === null ||\n (e = min(toLength(splitter.lastIndex + (UNSUPPORTED_Y ? q : 0)), S.length)) === p\n ) {\n q = advanceStringIndex(S, q, unicodeMatching);\n } else {\n A.push(S.slice(p, q));\n if (A.length === lim) return A;\n for (var i = 1; i <= z.length - 1; i++) {\n A.push(z[i]);\n if (A.length === lim) return A;\n }\n q = p = e;\n }\n }\n A.push(S.slice(p));\n return A;\n }\n ];\n}, !SPLIT_WORKS_WITH_OVERWRITTEN_EXEC, UNSUPPORTED_Y);\n","'use strict';\nvar fixRegExpWellKnownSymbolLogic = require('../internals/fix-regexp-well-known-symbol-logic');\nvar anObject = require('../internals/an-object');\nvar toLength = require('../internals/to-length');\nvar toString = require('../internals/to-string');\nvar requireObjectCoercible = require('../internals/require-object-coercible');\nvar advanceStringIndex = require('../internals/advance-string-index');\nvar regExpExec = require('../internals/regexp-exec-abstract');\n\n// @@match logic\nfixRegExpWellKnownSymbolLogic('match', function (MATCH, nativeMatch, maybeCallNative) {\n return [\n // `String.prototype.match` method\n // https://tc39.es/ecma262/#sec-string.prototype.match\n function match(regexp) {\n var O = requireObjectCoercible(this);\n var matcher = regexp == undefined ? undefined : regexp[MATCH];\n return matcher !== undefined ? matcher.call(regexp, O) : new RegExp(regexp)[MATCH](toString(O));\n },\n // `RegExp.prototype[@@match]` method\n // https://tc39.es/ecma262/#sec-regexp.prototype-@@match\n function (string) {\n var rx = anObject(this);\n var S = toString(string);\n var res = maybeCallNative(nativeMatch, rx, S);\n\n if (res.done) return res.value;\n\n if (!rx.global) return regExpExec(rx, S);\n\n var fullUnicode = rx.unicode;\n rx.lastIndex = 0;\n var A = [];\n var n = 0;\n var result;\n while ((result = regExpExec(rx, S)) !== null) {\n var matchStr = toString(result[0]);\n A[n] = matchStr;\n if (matchStr === '') rx.lastIndex = advanceStringIndex(S, toLength(rx.lastIndex), fullUnicode);\n n++;\n }\n return n === 0 ? null : A;\n }\n ];\n});\n","var wellKnownSymbol = require('../internals/well-known-symbol');\nvar create = require('../internals/object-create');\nvar definePropertyModule = require('../internals/object-define-property');\n\nvar UNSCOPABLES = wellKnownSymbol('unscopables');\nvar ArrayPrototype = Array.prototype;\n\n// Array.prototype[@@unscopables]\n// https://tc39.es/ecma262/#sec-array.prototype-@@unscopables\nif (ArrayPrototype[UNSCOPABLES] == undefined) {\n definePropertyModule.f(ArrayPrototype, UNSCOPABLES, {\n configurable: true,\n value: create(null)\n });\n}\n\n// add a key to Array.prototype[@@unscopables]\nmodule.exports = function (key) {\n ArrayPrototype[UNSCOPABLES][key] = true;\n};\n","var fails = require('../internals/fails');\n\nmodule.exports = !fails(function () {\n function F() { /* empty */ }\n F.prototype.constructor = null;\n // eslint-disable-next-line es/no-object-getprototypeof -- required for testing\n return Object.getPrototypeOf(new F()) !== F.prototype;\n});\n","var has = require('../internals/has');\nvar toObject = require('../internals/to-object');\nvar sharedKey = require('../internals/shared-key');\nvar CORRECT_PROTOTYPE_GETTER = require('../internals/correct-prototype-getter');\n\nvar IE_PROTO = sharedKey('IE_PROTO');\nvar ObjectPrototype = Object.prototype;\n\n// `Object.getPrototypeOf` method\n// https://tc39.es/ecma262/#sec-object.getprototypeof\n// eslint-disable-next-line es/no-object-getprototypeof -- safe\nmodule.exports = CORRECT_PROTOTYPE_GETTER ? Object.getPrototypeOf : function (O) {\n O = toObject(O);\n if (has(O, IE_PROTO)) return O[IE_PROTO];\n if (typeof O.constructor == 'function' && O instanceof O.constructor) {\n return O.constructor.prototype;\n } return O instanceof Object ? ObjectPrototype : null;\n};\n","'use strict';\nvar fails = require('../internals/fails');\nvar getPrototypeOf = require('../internals/object-get-prototype-of');\nvar createNonEnumerableProperty = require('../internals/create-non-enumerable-property');\nvar has = require('../internals/has');\nvar wellKnownSymbol = require('../internals/well-known-symbol');\nvar IS_PURE = require('../internals/is-pure');\n\nvar ITERATOR = wellKnownSymbol('iterator');\nvar BUGGY_SAFARI_ITERATORS = false;\n\nvar returnThis = function () { return this; };\n\n// `%IteratorPrototype%` object\n// https://tc39.es/ecma262/#sec-%iteratorprototype%-object\nvar IteratorPrototype, PrototypeOfArrayIteratorPrototype, arrayIterator;\n\n/* eslint-disable es/no-array-prototype-keys -- safe */\nif ([].keys) {\n arrayIterator = [].keys();\n // Safari 8 has buggy iterators w/o `next`\n if (!('next' in arrayIterator)) BUGGY_SAFARI_ITERATORS = true;\n else {\n PrototypeOfArrayIteratorPrototype = getPrototypeOf(getPrototypeOf(arrayIterator));\n if (PrototypeOfArrayIteratorPrototype !== Object.prototype) IteratorPrototype = PrototypeOfArrayIteratorPrototype;\n }\n}\n\nvar NEW_ITERATOR_PROTOTYPE = IteratorPrototype == undefined || fails(function () {\n var test = {};\n // FF44- legacy iterators case\n return IteratorPrototype[ITERATOR].call(test) !== test;\n});\n\nif (NEW_ITERATOR_PROTOTYPE) IteratorPrototype = {};\n\n// `%IteratorPrototype%[@@iterator]()` method\n// https://tc39.es/ecma262/#sec-%iteratorprototype%-@@iterator\nif ((!IS_PURE || NEW_ITERATOR_PROTOTYPE) && !has(IteratorPrototype, ITERATOR)) {\n createNonEnumerableProperty(IteratorPrototype, ITERATOR, returnThis);\n}\n\nmodule.exports = {\n IteratorPrototype: IteratorPrototype,\n BUGGY_SAFARI_ITERATORS: BUGGY_SAFARI_ITERATORS\n};\n","'use strict';\nvar IteratorPrototype = require('../internals/iterators-core').IteratorPrototype;\nvar create = require('../internals/object-create');\nvar createPropertyDescriptor = require('../internals/create-property-descriptor');\nvar setToStringTag = require('../internals/set-to-string-tag');\nvar Iterators = require('../internals/iterators');\n\nvar returnThis = function () { return this; };\n\nmodule.exports = function (IteratorConstructor, NAME, next) {\n var TO_STRING_TAG = NAME + ' Iterator';\n IteratorConstructor.prototype = create(IteratorPrototype, { next: createPropertyDescriptor(1, next) });\n setToStringTag(IteratorConstructor, TO_STRING_TAG, false, true);\n Iterators[TO_STRING_TAG] = returnThis;\n return IteratorConstructor;\n};\n","'use strict';\nvar $ = require('../internals/export');\nvar createIteratorConstructor = require('../internals/create-iterator-constructor');\nvar getPrototypeOf = require('../internals/object-get-prototype-of');\nvar setPrototypeOf = require('../internals/object-set-prototype-of');\nvar setToStringTag = require('../internals/set-to-string-tag');\nvar createNonEnumerableProperty = require('../internals/create-non-enumerable-property');\nvar redefine = require('../internals/redefine');\nvar wellKnownSymbol = require('../internals/well-known-symbol');\nvar IS_PURE = require('../internals/is-pure');\nvar Iterators = require('../internals/iterators');\nvar IteratorsCore = require('../internals/iterators-core');\n\nvar IteratorPrototype = IteratorsCore.IteratorPrototype;\nvar BUGGY_SAFARI_ITERATORS = IteratorsCore.BUGGY_SAFARI_ITERATORS;\nvar ITERATOR = wellKnownSymbol('iterator');\nvar KEYS = 'keys';\nvar VALUES = 'values';\nvar ENTRIES = 'entries';\n\nvar returnThis = function () { return this; };\n\nmodule.exports = function (Iterable, NAME, IteratorConstructor, next, DEFAULT, IS_SET, FORCED) {\n createIteratorConstructor(IteratorConstructor, NAME, next);\n\n var getIterationMethod = function (KIND) {\n if (KIND === DEFAULT && defaultIterator) return defaultIterator;\n if (!BUGGY_SAFARI_ITERATORS && KIND in IterablePrototype) return IterablePrototype[KIND];\n switch (KIND) {\n case KEYS: return function keys() { return new IteratorConstructor(this, KIND); };\n case VALUES: return function values() { return new IteratorConstructor(this, KIND); };\n case ENTRIES: return function entries() { return new IteratorConstructor(this, KIND); };\n } return function () { return new IteratorConstructor(this); };\n };\n\n var TO_STRING_TAG = NAME + ' Iterator';\n var INCORRECT_VALUES_NAME = false;\n var IterablePrototype = Iterable.prototype;\n var nativeIterator = IterablePrototype[ITERATOR]\n || IterablePrototype['@@iterator']\n || DEFAULT && IterablePrototype[DEFAULT];\n var defaultIterator = !BUGGY_SAFARI_ITERATORS && nativeIterator || getIterationMethod(DEFAULT);\n var anyNativeIterator = NAME == 'Array' ? IterablePrototype.entries || nativeIterator : nativeIterator;\n var CurrentIteratorPrototype, methods, KEY;\n\n // fix native\n if (anyNativeIterator) {\n CurrentIteratorPrototype = getPrototypeOf(anyNativeIterator.call(new Iterable()));\n if (IteratorPrototype !== Object.prototype && CurrentIteratorPrototype.next) {\n if (!IS_PURE && getPrototypeOf(CurrentIteratorPrototype) !== IteratorPrototype) {\n if (setPrototypeOf) {\n setPrototypeOf(CurrentIteratorPrototype, IteratorPrototype);\n } else if (typeof CurrentIteratorPrototype[ITERATOR] != 'function') {\n createNonEnumerableProperty(CurrentIteratorPrototype, ITERATOR, returnThis);\n }\n }\n // Set @@toStringTag to native iterators\n setToStringTag(CurrentIteratorPrototype, TO_STRING_TAG, true, true);\n if (IS_PURE) Iterators[TO_STRING_TAG] = returnThis;\n }\n }\n\n // fix Array.prototype.{ values, @@iterator }.name in V8 / FF\n if (DEFAULT == VALUES && nativeIterator && nativeIterator.name !== VALUES) {\n INCORRECT_VALUES_NAME = true;\n defaultIterator = function values() { return nativeIterator.call(this); };\n }\n\n // define iterator\n if ((!IS_PURE || FORCED) && IterablePrototype[ITERATOR] !== defaultIterator) {\n createNonEnumerableProperty(IterablePrototype, ITERATOR, defaultIterator);\n }\n Iterators[NAME] = defaultIterator;\n\n // export additional methods\n if (DEFAULT) {\n methods = {\n values: getIterationMethod(VALUES),\n keys: IS_SET ? defaultIterator : getIterationMethod(KEYS),\n entries: getIterationMethod(ENTRIES)\n };\n if (FORCED) for (KEY in methods) {\n if (BUGGY_SAFARI_ITERATORS || INCORRECT_VALUES_NAME || !(KEY in IterablePrototype)) {\n redefine(IterablePrototype, KEY, methods[KEY]);\n }\n } else $({ target: NAME, proto: true, forced: BUGGY_SAFARI_ITERATORS || INCORRECT_VALUES_NAME }, methods);\n }\n\n return methods;\n};\n","'use strict';\nvar toIndexedObject = require('../internals/to-indexed-object');\nvar addToUnscopables = require('../internals/add-to-unscopables');\nvar Iterators = require('../internals/iterators');\nvar InternalStateModule = require('../internals/internal-state');\nvar defineIterator = require('../internals/define-iterator');\n\nvar ARRAY_ITERATOR = 'Array Iterator';\nvar setInternalState = InternalStateModule.set;\nvar getInternalState = InternalStateModule.getterFor(ARRAY_ITERATOR);\n\n// `Array.prototype.entries` method\n// https://tc39.es/ecma262/#sec-array.prototype.entries\n// `Array.prototype.keys` method\n// https://tc39.es/ecma262/#sec-array.prototype.keys\n// `Array.prototype.values` method\n// https://tc39.es/ecma262/#sec-array.prototype.values\n// `Array.prototype[@@iterator]` method\n// https://tc39.es/ecma262/#sec-array.prototype-@@iterator\n// `CreateArrayIterator` internal method\n// https://tc39.es/ecma262/#sec-createarrayiterator\nmodule.exports = defineIterator(Array, 'Array', function (iterated, kind) {\n setInternalState(this, {\n type: ARRAY_ITERATOR,\n target: toIndexedObject(iterated), // target\n index: 0, // next index\n kind: kind // kind\n });\n// `%ArrayIteratorPrototype%.next` method\n// https://tc39.es/ecma262/#sec-%arrayiteratorprototype%.next\n}, function () {\n var state = getInternalState(this);\n var target = state.target;\n var kind = state.kind;\n var index = state.index++;\n if (!target || index >= target.length) {\n state.target = undefined;\n return { value: undefined, done: true };\n }\n if (kind == 'keys') return { value: index, done: false };\n if (kind == 'values') return { value: target[index], done: false };\n return { value: [index, target[index]], done: false };\n}, 'values');\n\n// argumentsList[@@iterator] is %ArrayProto_values%\n// https://tc39.es/ecma262/#sec-createunmappedargumentsobject\n// https://tc39.es/ecma262/#sec-createmappedargumentsobject\nIterators.Arguments = Iterators.Array;\n\n// https://tc39.es/ecma262/#sec-array.prototype-@@unscopables\naddToUnscopables('keys');\naddToUnscopables('values');\naddToUnscopables('entries');\n","// eslint-disable-next-line es/no-typed-arrays -- safe\nmodule.exports = typeof ArrayBuffer !== 'undefined' && typeof DataView !== 'undefined';\n","'use strict';\nvar NATIVE_ARRAY_BUFFER = require('../internals/array-buffer-native');\nvar DESCRIPTORS = require('../internals/descriptors');\nvar global = require('../internals/global');\nvar isObject = require('../internals/is-object');\nvar has = require('../internals/has');\nvar classof = require('../internals/classof');\nvar createNonEnumerableProperty = require('../internals/create-non-enumerable-property');\nvar redefine = require('../internals/redefine');\nvar defineProperty = require('../internals/object-define-property').f;\nvar getPrototypeOf = require('../internals/object-get-prototype-of');\nvar setPrototypeOf = require('../internals/object-set-prototype-of');\nvar wellKnownSymbol = require('../internals/well-known-symbol');\nvar uid = require('../internals/uid');\n\nvar Int8Array = global.Int8Array;\nvar Int8ArrayPrototype = Int8Array && Int8Array.prototype;\nvar Uint8ClampedArray = global.Uint8ClampedArray;\nvar Uint8ClampedArrayPrototype = Uint8ClampedArray && Uint8ClampedArray.prototype;\nvar TypedArray = Int8Array && getPrototypeOf(Int8Array);\nvar TypedArrayPrototype = Int8ArrayPrototype && getPrototypeOf(Int8ArrayPrototype);\nvar ObjectPrototype = Object.prototype;\nvar isPrototypeOf = ObjectPrototype.isPrototypeOf;\n\nvar TO_STRING_TAG = wellKnownSymbol('toStringTag');\nvar TYPED_ARRAY_TAG = uid('TYPED_ARRAY_TAG');\nvar TYPED_ARRAY_CONSTRUCTOR = uid('TYPED_ARRAY_CONSTRUCTOR');\n// Fixing native typed arrays in Opera Presto crashes the browser, see #595\nvar NATIVE_ARRAY_BUFFER_VIEWS = NATIVE_ARRAY_BUFFER && !!setPrototypeOf && classof(global.opera) !== 'Opera';\nvar TYPED_ARRAY_TAG_REQIRED = false;\nvar NAME, Constructor, Prototype;\n\nvar TypedArrayConstructorsList = {\n Int8Array: 1,\n Uint8Array: 1,\n Uint8ClampedArray: 1,\n Int16Array: 2,\n Uint16Array: 2,\n Int32Array: 4,\n Uint32Array: 4,\n Float32Array: 4,\n Float64Array: 8\n};\n\nvar BigIntArrayConstructorsList = {\n BigInt64Array: 8,\n BigUint64Array: 8\n};\n\nvar isView = function isView(it) {\n if (!isObject(it)) return false;\n var klass = classof(it);\n return klass === 'DataView'\n || has(TypedArrayConstructorsList, klass)\n || has(BigIntArrayConstructorsList, klass);\n};\n\nvar isTypedArray = function (it) {\n if (!isObject(it)) return false;\n var klass = classof(it);\n return has(TypedArrayConstructorsList, klass)\n || has(BigIntArrayConstructorsList, klass);\n};\n\nvar aTypedArray = function (it) {\n if (isTypedArray(it)) return it;\n throw TypeError('Target is not a typed array');\n};\n\nvar aTypedArrayConstructor = function (C) {\n if (setPrototypeOf && !isPrototypeOf.call(TypedArray, C)) {\n throw TypeError('Target is not a typed array constructor');\n } return C;\n};\n\nvar exportTypedArrayMethod = function (KEY, property, forced) {\n if (!DESCRIPTORS) return;\n if (forced) for (var ARRAY in TypedArrayConstructorsList) {\n var TypedArrayConstructor = global[ARRAY];\n if (TypedArrayConstructor && has(TypedArrayConstructor.prototype, KEY)) try {\n delete TypedArrayConstructor.prototype[KEY];\n } catch (error) { /* empty */ }\n }\n if (!TypedArrayPrototype[KEY] || forced) {\n redefine(TypedArrayPrototype, KEY, forced ? property\n : NATIVE_ARRAY_BUFFER_VIEWS && Int8ArrayPrototype[KEY] || property);\n }\n};\n\nvar exportTypedArrayStaticMethod = function (KEY, property, forced) {\n var ARRAY, TypedArrayConstructor;\n if (!DESCRIPTORS) return;\n if (setPrototypeOf) {\n if (forced) for (ARRAY in TypedArrayConstructorsList) {\n TypedArrayConstructor = global[ARRAY];\n if (TypedArrayConstructor && has(TypedArrayConstructor, KEY)) try {\n delete TypedArrayConstructor[KEY];\n } catch (error) { /* empty */ }\n }\n if (!TypedArray[KEY] || forced) {\n // V8 ~ Chrome 49-50 `%TypedArray%` methods are non-writable non-configurable\n try {\n return redefine(TypedArray, KEY, forced ? property : NATIVE_ARRAY_BUFFER_VIEWS && TypedArray[KEY] || property);\n } catch (error) { /* empty */ }\n } else return;\n }\n for (ARRAY in TypedArrayConstructorsList) {\n TypedArrayConstructor = global[ARRAY];\n if (TypedArrayConstructor && (!TypedArrayConstructor[KEY] || forced)) {\n redefine(TypedArrayConstructor, KEY, property);\n }\n }\n};\n\nfor (NAME in TypedArrayConstructorsList) {\n Constructor = global[NAME];\n Prototype = Constructor && Constructor.prototype;\n if (Prototype) createNonEnumerableProperty(Prototype, TYPED_ARRAY_CONSTRUCTOR, Constructor);\n else NATIVE_ARRAY_BUFFER_VIEWS = false;\n}\n\nfor (NAME in BigIntArrayConstructorsList) {\n Constructor = global[NAME];\n Prototype = Constructor && Constructor.prototype;\n if (Prototype) createNonEnumerableProperty(Prototype, TYPED_ARRAY_CONSTRUCTOR, Constructor);\n}\n\n// WebKit bug - typed arrays constructors prototype is Object.prototype\nif (!NATIVE_ARRAY_BUFFER_VIEWS || typeof TypedArray != 'function' || TypedArray === Function.prototype) {\n // eslint-disable-next-line no-shadow -- safe\n TypedArray = function TypedArray() {\n throw TypeError('Incorrect invocation');\n };\n if (NATIVE_ARRAY_BUFFER_VIEWS) for (NAME in TypedArrayConstructorsList) {\n if (global[NAME]) setPrototypeOf(global[NAME], TypedArray);\n }\n}\n\nif (!NATIVE_ARRAY_BUFFER_VIEWS || !TypedArrayPrototype || TypedArrayPrototype === ObjectPrototype) {\n TypedArrayPrototype = TypedArray.prototype;\n if (NATIVE_ARRAY_BUFFER_VIEWS) for (NAME in TypedArrayConstructorsList) {\n if (global[NAME]) setPrototypeOf(global[NAME].prototype, TypedArrayPrototype);\n }\n}\n\n// WebKit bug - one more object in Uint8ClampedArray prototype chain\nif (NATIVE_ARRAY_BUFFER_VIEWS && getPrototypeOf(Uint8ClampedArrayPrototype) !== TypedArrayPrototype) {\n setPrototypeOf(Uint8ClampedArrayPrototype, TypedArrayPrototype);\n}\n\nif (DESCRIPTORS && !has(TypedArrayPrototype, TO_STRING_TAG)) {\n TYPED_ARRAY_TAG_REQIRED = true;\n defineProperty(TypedArrayPrototype, TO_STRING_TAG, { get: function () {\n return isObject(this) ? this[TYPED_ARRAY_TAG] : undefined;\n } });\n for (NAME in TypedArrayConstructorsList) if (global[NAME]) {\n createNonEnumerableProperty(global[NAME], TYPED_ARRAY_TAG, NAME);\n }\n}\n\nmodule.exports = {\n NATIVE_ARRAY_BUFFER_VIEWS: NATIVE_ARRAY_BUFFER_VIEWS,\n TYPED_ARRAY_CONSTRUCTOR: TYPED_ARRAY_CONSTRUCTOR,\n TYPED_ARRAY_TAG: TYPED_ARRAY_TAG_REQIRED && TYPED_ARRAY_TAG,\n aTypedArray: aTypedArray,\n aTypedArrayConstructor: aTypedArrayConstructor,\n exportTypedArrayMethod: exportTypedArrayMethod,\n exportTypedArrayStaticMethod: exportTypedArrayStaticMethod,\n isView: isView,\n isTypedArray: isTypedArray,\n TypedArray: TypedArray,\n TypedArrayPrototype: TypedArrayPrototype\n};\n","/* eslint-disable no-new -- required for testing */\nvar global = require('../internals/global');\nvar fails = require('../internals/fails');\nvar checkCorrectnessOfIteration = require('../internals/check-correctness-of-iteration');\nvar NATIVE_ARRAY_BUFFER_VIEWS = require('../internals/array-buffer-view-core').NATIVE_ARRAY_BUFFER_VIEWS;\n\nvar ArrayBuffer = global.ArrayBuffer;\nvar Int8Array = global.Int8Array;\n\nmodule.exports = !NATIVE_ARRAY_BUFFER_VIEWS || !fails(function () {\n Int8Array(1);\n}) || !fails(function () {\n new Int8Array(-1);\n}) || !checkCorrectnessOfIteration(function (iterable) {\n new Int8Array();\n new Int8Array(null);\n new Int8Array(1.5);\n new Int8Array(iterable);\n}, true) || fails(function () {\n // Safari (11+) bug - a reason why even Safari 13 should load a typed array polyfill\n return new Int8Array(new ArrayBuffer(2), 1, undefined).length !== 1;\n});\n","var toInteger = require('../internals/to-integer');\nvar toLength = require('../internals/to-length');\n\n// `ToIndex` abstract operation\n// https://tc39.es/ecma262/#sec-toindex\nmodule.exports = function (it) {\n if (it === undefined) return 0;\n var number = toInteger(it);\n var length = toLength(number);\n if (number !== length) throw RangeError('Wrong length or index');\n return length;\n};\n","// IEEE754 conversions based on https://github.com/feross/ieee754\nvar abs = Math.abs;\nvar pow = Math.pow;\nvar floor = Math.floor;\nvar log = Math.log;\nvar LN2 = Math.LN2;\n\nvar pack = function (number, mantissaLength, bytes) {\n var buffer = new Array(bytes);\n var exponentLength = bytes * 8 - mantissaLength - 1;\n var eMax = (1 << exponentLength) - 1;\n var eBias = eMax >> 1;\n var rt = mantissaLength === 23 ? pow(2, -24) - pow(2, -77) : 0;\n var sign = number < 0 || number === 0 && 1 / number < 0 ? 1 : 0;\n var index = 0;\n var exponent, mantissa, c;\n number = abs(number);\n // eslint-disable-next-line no-self-compare -- NaN check\n if (number != number || number === Infinity) {\n // eslint-disable-next-line no-self-compare -- NaN check\n mantissa = number != number ? 1 : 0;\n exponent = eMax;\n } else {\n exponent = floor(log(number) / LN2);\n if (number * (c = pow(2, -exponent)) < 1) {\n exponent--;\n c *= 2;\n }\n if (exponent + eBias >= 1) {\n number += rt / c;\n } else {\n number += rt * pow(2, 1 - eBias);\n }\n if (number * c >= 2) {\n exponent++;\n c /= 2;\n }\n if (exponent + eBias >= eMax) {\n mantissa = 0;\n exponent = eMax;\n } else if (exponent + eBias >= 1) {\n mantissa = (number * c - 1) * pow(2, mantissaLength);\n exponent = exponent + eBias;\n } else {\n mantissa = number * pow(2, eBias - 1) * pow(2, mantissaLength);\n exponent = 0;\n }\n }\n for (; mantissaLength >= 8; buffer[index++] = mantissa & 255, mantissa /= 256, mantissaLength -= 8);\n exponent = exponent << mantissaLength | mantissa;\n exponentLength += mantissaLength;\n for (; exponentLength > 0; buffer[index++] = exponent & 255, exponent /= 256, exponentLength -= 8);\n buffer[--index] |= sign * 128;\n return buffer;\n};\n\nvar unpack = function (buffer, mantissaLength) {\n var bytes = buffer.length;\n var exponentLength = bytes * 8 - mantissaLength - 1;\n var eMax = (1 << exponentLength) - 1;\n var eBias = eMax >> 1;\n var nBits = exponentLength - 7;\n var index = bytes - 1;\n var sign = buffer[index--];\n var exponent = sign & 127;\n var mantissa;\n sign >>= 7;\n for (; nBits > 0; exponent = exponent * 256 + buffer[index], index--, nBits -= 8);\n mantissa = exponent & (1 << -nBits) - 1;\n exponent >>= -nBits;\n nBits += mantissaLength;\n for (; nBits > 0; mantissa = mantissa * 256 + buffer[index], index--, nBits -= 8);\n if (exponent === 0) {\n exponent = 1 - eBias;\n } else if (exponent === eMax) {\n return mantissa ? NaN : sign ? -Infinity : Infinity;\n } else {\n mantissa = mantissa + pow(2, mantissaLength);\n exponent = exponent - eBias;\n } return (sign ? -1 : 1) * mantissa * pow(2, exponent - mantissaLength);\n};\n\nmodule.exports = {\n pack: pack,\n unpack: unpack\n};\n","'use strict';\nvar toObject = require('../internals/to-object');\nvar toAbsoluteIndex = require('../internals/to-absolute-index');\nvar toLength = require('../internals/to-length');\n\n// `Array.prototype.fill` method implementation\n// https://tc39.es/ecma262/#sec-array.prototype.fill\nmodule.exports = function fill(value /* , start = 0, end = @length */) {\n var O = toObject(this);\n var length = toLength(O.length);\n var argumentsLength = arguments.length;\n var index = toAbsoluteIndex(argumentsLength > 1 ? arguments[1] : undefined, length);\n var end = argumentsLength > 2 ? arguments[2] : undefined;\n var endPos = end === undefined ? length : toAbsoluteIndex(end, length);\n while (endPos > index) O[index++] = value;\n return O;\n};\n","'use strict';\nvar global = require('../internals/global');\nvar DESCRIPTORS = require('../internals/descriptors');\nvar NATIVE_ARRAY_BUFFER = require('../internals/array-buffer-native');\nvar createNonEnumerableProperty = require('../internals/create-non-enumerable-property');\nvar redefineAll = require('../internals/redefine-all');\nvar fails = require('../internals/fails');\nvar anInstance = require('../internals/an-instance');\nvar toInteger = require('../internals/to-integer');\nvar toLength = require('../internals/to-length');\nvar toIndex = require('../internals/to-index');\nvar IEEE754 = require('../internals/ieee754');\nvar getPrototypeOf = require('../internals/object-get-prototype-of');\nvar setPrototypeOf = require('../internals/object-set-prototype-of');\nvar getOwnPropertyNames = require('../internals/object-get-own-property-names').f;\nvar defineProperty = require('../internals/object-define-property').f;\nvar arrayFill = require('../internals/array-fill');\nvar setToStringTag = require('../internals/set-to-string-tag');\nvar InternalStateModule = require('../internals/internal-state');\n\nvar getInternalState = InternalStateModule.get;\nvar setInternalState = InternalStateModule.set;\nvar ARRAY_BUFFER = 'ArrayBuffer';\nvar DATA_VIEW = 'DataView';\nvar PROTOTYPE = 'prototype';\nvar WRONG_LENGTH = 'Wrong length';\nvar WRONG_INDEX = 'Wrong index';\nvar NativeArrayBuffer = global[ARRAY_BUFFER];\nvar $ArrayBuffer = NativeArrayBuffer;\nvar $DataView = global[DATA_VIEW];\nvar $DataViewPrototype = $DataView && $DataView[PROTOTYPE];\nvar ObjectPrototype = Object.prototype;\nvar RangeError = global.RangeError;\n\nvar packIEEE754 = IEEE754.pack;\nvar unpackIEEE754 = IEEE754.unpack;\n\nvar packInt8 = function (number) {\n return [number & 0xFF];\n};\n\nvar packInt16 = function (number) {\n return [number & 0xFF, number >> 8 & 0xFF];\n};\n\nvar packInt32 = function (number) {\n return [number & 0xFF, number >> 8 & 0xFF, number >> 16 & 0xFF, number >> 24 & 0xFF];\n};\n\nvar unpackInt32 = function (buffer) {\n return buffer[3] << 24 | buffer[2] << 16 | buffer[1] << 8 | buffer[0];\n};\n\nvar packFloat32 = function (number) {\n return packIEEE754(number, 23, 4);\n};\n\nvar packFloat64 = function (number) {\n return packIEEE754(number, 52, 8);\n};\n\nvar addGetter = function (Constructor, key) {\n defineProperty(Constructor[PROTOTYPE], key, { get: function () { return getInternalState(this)[key]; } });\n};\n\nvar get = function (view, count, index, isLittleEndian) {\n var intIndex = toIndex(index);\n var store = getInternalState(view);\n if (intIndex + count > store.byteLength) throw RangeError(WRONG_INDEX);\n var bytes = getInternalState(store.buffer).bytes;\n var start = intIndex + store.byteOffset;\n var pack = bytes.slice(start, start + count);\n return isLittleEndian ? pack : pack.reverse();\n};\n\nvar set = function (view, count, index, conversion, value, isLittleEndian) {\n var intIndex = toIndex(index);\n var store = getInternalState(view);\n if (intIndex + count > store.byteLength) throw RangeError(WRONG_INDEX);\n var bytes = getInternalState(store.buffer).bytes;\n var start = intIndex + store.byteOffset;\n var pack = conversion(+value);\n for (var i = 0; i < count; i++) bytes[start + i] = pack[isLittleEndian ? i : count - i - 1];\n};\n\nif (!NATIVE_ARRAY_BUFFER) {\n $ArrayBuffer = function ArrayBuffer(length) {\n anInstance(this, $ArrayBuffer, ARRAY_BUFFER);\n var byteLength = toIndex(length);\n setInternalState(this, {\n bytes: arrayFill.call(new Array(byteLength), 0),\n byteLength: byteLength\n });\n if (!DESCRIPTORS) this.byteLength = byteLength;\n };\n\n $DataView = function DataView(buffer, byteOffset, byteLength) {\n anInstance(this, $DataView, DATA_VIEW);\n anInstance(buffer, $ArrayBuffer, DATA_VIEW);\n var bufferLength = getInternalState(buffer).byteLength;\n var offset = toInteger(byteOffset);\n if (offset < 0 || offset > bufferLength) throw RangeError('Wrong offset');\n byteLength = byteLength === undefined ? bufferLength - offset : toLength(byteLength);\n if (offset + byteLength > bufferLength) throw RangeError(WRONG_LENGTH);\n setInternalState(this, {\n buffer: buffer,\n byteLength: byteLength,\n byteOffset: offset\n });\n if (!DESCRIPTORS) {\n this.buffer = buffer;\n this.byteLength = byteLength;\n this.byteOffset = offset;\n }\n };\n\n if (DESCRIPTORS) {\n addGetter($ArrayBuffer, 'byteLength');\n addGetter($DataView, 'buffer');\n addGetter($DataView, 'byteLength');\n addGetter($DataView, 'byteOffset');\n }\n\n redefineAll($DataView[PROTOTYPE], {\n getInt8: function getInt8(byteOffset) {\n return get(this, 1, byteOffset)[0] << 24 >> 24;\n },\n getUint8: function getUint8(byteOffset) {\n return get(this, 1, byteOffset)[0];\n },\n getInt16: function getInt16(byteOffset /* , littleEndian */) {\n var bytes = get(this, 2, byteOffset, arguments.length > 1 ? arguments[1] : undefined);\n return (bytes[1] << 8 | bytes[0]) << 16 >> 16;\n },\n getUint16: function getUint16(byteOffset /* , littleEndian */) {\n var bytes = get(this, 2, byteOffset, arguments.length > 1 ? arguments[1] : undefined);\n return bytes[1] << 8 | bytes[0];\n },\n getInt32: function getInt32(byteOffset /* , littleEndian */) {\n return unpackInt32(get(this, 4, byteOffset, arguments.length > 1 ? arguments[1] : undefined));\n },\n getUint32: function getUint32(byteOffset /* , littleEndian */) {\n return unpackInt32(get(this, 4, byteOffset, arguments.length > 1 ? arguments[1] : undefined)) >>> 0;\n },\n getFloat32: function getFloat32(byteOffset /* , littleEndian */) {\n return unpackIEEE754(get(this, 4, byteOffset, arguments.length > 1 ? arguments[1] : undefined), 23);\n },\n getFloat64: function getFloat64(byteOffset /* , littleEndian */) {\n return unpackIEEE754(get(this, 8, byteOffset, arguments.length > 1 ? arguments[1] : undefined), 52);\n },\n setInt8: function setInt8(byteOffset, value) {\n set(this, 1, byteOffset, packInt8, value);\n },\n setUint8: function setUint8(byteOffset, value) {\n set(this, 1, byteOffset, packInt8, value);\n },\n setInt16: function setInt16(byteOffset, value /* , littleEndian */) {\n set(this, 2, byteOffset, packInt16, value, arguments.length > 2 ? arguments[2] : undefined);\n },\n setUint16: function setUint16(byteOffset, value /* , littleEndian */) {\n set(this, 2, byteOffset, packInt16, value, arguments.length > 2 ? arguments[2] : undefined);\n },\n setInt32: function setInt32(byteOffset, value /* , littleEndian */) {\n set(this, 4, byteOffset, packInt32, value, arguments.length > 2 ? arguments[2] : undefined);\n },\n setUint32: function setUint32(byteOffset, value /* , littleEndian */) {\n set(this, 4, byteOffset, packInt32, value, arguments.length > 2 ? arguments[2] : undefined);\n },\n setFloat32: function setFloat32(byteOffset, value /* , littleEndian */) {\n set(this, 4, byteOffset, packFloat32, value, arguments.length > 2 ? arguments[2] : undefined);\n },\n setFloat64: function setFloat64(byteOffset, value /* , littleEndian */) {\n set(this, 8, byteOffset, packFloat64, value, arguments.length > 2 ? arguments[2] : undefined);\n }\n });\n} else {\n /* eslint-disable no-new -- required for testing */\n if (!fails(function () {\n NativeArrayBuffer(1);\n }) || !fails(function () {\n new NativeArrayBuffer(-1);\n }) || fails(function () {\n new NativeArrayBuffer();\n new NativeArrayBuffer(1.5);\n new NativeArrayBuffer(NaN);\n return NativeArrayBuffer.name != ARRAY_BUFFER;\n })) {\n /* eslint-enable no-new -- required for testing */\n $ArrayBuffer = function ArrayBuffer(length) {\n anInstance(this, $ArrayBuffer);\n return new NativeArrayBuffer(toIndex(length));\n };\n var ArrayBufferPrototype = $ArrayBuffer[PROTOTYPE] = NativeArrayBuffer[PROTOTYPE];\n for (var keys = getOwnPropertyNames(NativeArrayBuffer), j = 0, key; keys.length > j;) {\n if (!((key = keys[j++]) in $ArrayBuffer)) {\n createNonEnumerableProperty($ArrayBuffer, key, NativeArrayBuffer[key]);\n }\n }\n ArrayBufferPrototype.constructor = $ArrayBuffer;\n }\n\n // WebKit bug - the same parent prototype for typed arrays and data view\n if (setPrototypeOf && getPrototypeOf($DataViewPrototype) !== ObjectPrototype) {\n setPrototypeOf($DataViewPrototype, ObjectPrototype);\n }\n\n // iOS Safari 7.x bug\n var testView = new $DataView(new $ArrayBuffer(2));\n var $setInt8 = $DataViewPrototype.setInt8;\n testView.setInt8(0, 2147483648);\n testView.setInt8(1, 2147483649);\n if (testView.getInt8(0) || !testView.getInt8(1)) redefineAll($DataViewPrototype, {\n setInt8: function setInt8(byteOffset, value) {\n $setInt8.call(this, byteOffset, value << 24 >> 24);\n },\n setUint8: function setUint8(byteOffset, value) {\n $setInt8.call(this, byteOffset, value << 24 >> 24);\n }\n }, { unsafe: true });\n}\n\nsetToStringTag($ArrayBuffer, ARRAY_BUFFER);\nsetToStringTag($DataView, DATA_VIEW);\n\nmodule.exports = {\n ArrayBuffer: $ArrayBuffer,\n DataView: $DataView\n};\n","var isObject = require('../internals/is-object');\n\nvar floor = Math.floor;\n\n// `Number.isInteger` method implementation\n// https://tc39.es/ecma262/#sec-number.isinteger\nmodule.exports = function isInteger(it) {\n return !isObject(it) && isFinite(it) && floor(it) === it;\n};\n","var toInteger = require('../internals/to-integer');\n\nmodule.exports = function (it) {\n var result = toInteger(it);\n if (result < 0) throw RangeError(\"The argument can't be less than 0\");\n return result;\n};\n","var toPositiveInteger = require('../internals/to-positive-integer');\n\nmodule.exports = function (it, BYTES) {\n var offset = toPositiveInteger(it);\n if (offset % BYTES) throw RangeError('Wrong offset');\n return offset;\n};\n","var toObject = require('../internals/to-object');\nvar toLength = require('../internals/to-length');\nvar getIteratorMethod = require('../internals/get-iterator-method');\nvar isArrayIteratorMethod = require('../internals/is-array-iterator-method');\nvar bind = require('../internals/function-bind-context');\nvar aTypedArrayConstructor = require('../internals/array-buffer-view-core').aTypedArrayConstructor;\n\nmodule.exports = function from(source /* , mapfn, thisArg */) {\n var O = toObject(source);\n var argumentsLength = arguments.length;\n var mapfn = argumentsLength > 1 ? arguments[1] : undefined;\n var mapping = mapfn !== undefined;\n var iteratorMethod = getIteratorMethod(O);\n var i, length, result, step, iterator, next;\n if (iteratorMethod != undefined && !isArrayIteratorMethod(iteratorMethod)) {\n iterator = iteratorMethod.call(O);\n next = iterator.next;\n O = [];\n while (!(step = next.call(iterator)).done) {\n O.push(step.value);\n }\n }\n if (mapping && argumentsLength > 2) {\n mapfn = bind(mapfn, arguments[2], 2);\n }\n length = toLength(O.length);\n result = new (aTypedArrayConstructor(this))(length);\n for (i = 0; length > i; i++) {\n result[i] = mapping ? mapfn(O[i], i) : O[i];\n }\n return result;\n};\n","var isObject = require('../internals/is-object');\nvar isArray = require('../internals/is-array');\nvar wellKnownSymbol = require('../internals/well-known-symbol');\n\nvar SPECIES = wellKnownSymbol('species');\n\n// a part of `ArraySpeciesCreate` abstract operation\n// https://tc39.es/ecma262/#sec-arrayspeciescreate\nmodule.exports = function (originalArray) {\n var C;\n if (isArray(originalArray)) {\n C = originalArray.constructor;\n // cross-realm fallback\n if (typeof C == 'function' && (C === Array || isArray(C.prototype))) C = undefined;\n else if (isObject(C)) {\n C = C[SPECIES];\n if (C === null) C = undefined;\n }\n } return C === undefined ? Array : C;\n};\n","var bind = require('../internals/function-bind-context');\nvar IndexedObject = require('../internals/indexed-object');\nvar toObject = require('../internals/to-object');\nvar toLength = require('../internals/to-length');\nvar arraySpeciesCreate = require('../internals/array-species-create');\n\nvar push = [].push;\n\n// `Array.prototype.{ forEach, map, filter, some, every, find, findIndex, filterReject }` methods implementation\nvar createMethod = function (TYPE) {\n var IS_MAP = TYPE == 1;\n var IS_FILTER = TYPE == 2;\n var IS_SOME = TYPE == 3;\n var IS_EVERY = TYPE == 4;\n var IS_FIND_INDEX = TYPE == 6;\n var IS_FILTER_REJECT = TYPE == 7;\n var NO_HOLES = TYPE == 5 || IS_FIND_INDEX;\n return function ($this, callbackfn, that, specificCreate) {\n var O = toObject($this);\n var self = IndexedObject(O);\n var boundFunction = bind(callbackfn, that, 3);\n var length = toLength(self.length);\n var index = 0;\n var create = specificCreate || arraySpeciesCreate;\n var target = IS_MAP ? create($this, length) : IS_FILTER || IS_FILTER_REJECT ? create($this, 0) : undefined;\n var value, result;\n for (;length > index; index++) if (NO_HOLES || index in self) {\n value = self[index];\n result = boundFunction(value, index, O);\n if (TYPE) {\n if (IS_MAP) target[index] = result; // map\n else if (result) switch (TYPE) {\n case 3: return true; // some\n case 5: return value; // find\n case 6: return index; // findIndex\n case 2: push.call(target, value); // filter\n } else switch (TYPE) {\n case 4: return false; // every\n case 7: push.call(target, value); // filterReject\n }\n }\n }\n return IS_FIND_INDEX ? -1 : IS_SOME || IS_EVERY ? IS_EVERY : target;\n };\n};\n\nmodule.exports = {\n // `Array.prototype.forEach` method\n // https://tc39.es/ecma262/#sec-array.prototype.foreach\n forEach: createMethod(0),\n // `Array.prototype.map` method\n // https://tc39.es/ecma262/#sec-array.prototype.map\n map: createMethod(1),\n // `Array.prototype.filter` method\n // https://tc39.es/ecma262/#sec-array.prototype.filter\n filter: createMethod(2),\n // `Array.prototype.some` method\n // https://tc39.es/ecma262/#sec-array.prototype.some\n some: createMethod(3),\n // `Array.prototype.every` method\n // https://tc39.es/ecma262/#sec-array.prototype.every\n every: createMethod(4),\n // `Array.prototype.find` method\n // https://tc39.es/ecma262/#sec-array.prototype.find\n find: createMethod(5),\n // `Array.prototype.findIndex` method\n // https://tc39.es/ecma262/#sec-array.prototype.findIndex\n findIndex: createMethod(6),\n // `Array.prototype.filterReject` method\n // https://github.com/tc39/proposal-array-filtering\n filterReject: createMethod(7)\n};\n","'use strict';\nvar $ = require('../internals/export');\nvar global = require('../internals/global');\nvar DESCRIPTORS = require('../internals/descriptors');\nvar TYPED_ARRAYS_CONSTRUCTORS_REQUIRES_WRAPPERS = require('../internals/typed-array-constructors-require-wrappers');\nvar ArrayBufferViewCore = require('../internals/array-buffer-view-core');\nvar ArrayBufferModule = require('../internals/array-buffer');\nvar anInstance = require('../internals/an-instance');\nvar createPropertyDescriptor = require('../internals/create-property-descriptor');\nvar createNonEnumerableProperty = require('../internals/create-non-enumerable-property');\nvar isInteger = require('../internals/is-integer');\nvar toLength = require('../internals/to-length');\nvar toIndex = require('../internals/to-index');\nvar toOffset = require('../internals/to-offset');\nvar toPropertyKey = require('../internals/to-property-key');\nvar has = require('../internals/has');\nvar classof = require('../internals/classof');\nvar isObject = require('../internals/is-object');\nvar isSymbol = require('../internals/is-symbol');\nvar create = require('../internals/object-create');\nvar setPrototypeOf = require('../internals/object-set-prototype-of');\nvar getOwnPropertyNames = require('../internals/object-get-own-property-names').f;\nvar typedArrayFrom = require('../internals/typed-array-from');\nvar forEach = require('../internals/array-iteration').forEach;\nvar setSpecies = require('../internals/set-species');\nvar definePropertyModule = require('../internals/object-define-property');\nvar getOwnPropertyDescriptorModule = require('../internals/object-get-own-property-descriptor');\nvar InternalStateModule = require('../internals/internal-state');\nvar inheritIfRequired = require('../internals/inherit-if-required');\n\nvar getInternalState = InternalStateModule.get;\nvar setInternalState = InternalStateModule.set;\nvar nativeDefineProperty = definePropertyModule.f;\nvar nativeGetOwnPropertyDescriptor = getOwnPropertyDescriptorModule.f;\nvar round = Math.round;\nvar RangeError = global.RangeError;\nvar ArrayBuffer = ArrayBufferModule.ArrayBuffer;\nvar DataView = ArrayBufferModule.DataView;\nvar NATIVE_ARRAY_BUFFER_VIEWS = ArrayBufferViewCore.NATIVE_ARRAY_BUFFER_VIEWS;\nvar TYPED_ARRAY_CONSTRUCTOR = ArrayBufferViewCore.TYPED_ARRAY_CONSTRUCTOR;\nvar TYPED_ARRAY_TAG = ArrayBufferViewCore.TYPED_ARRAY_TAG;\nvar TypedArray = ArrayBufferViewCore.TypedArray;\nvar TypedArrayPrototype = ArrayBufferViewCore.TypedArrayPrototype;\nvar aTypedArrayConstructor = ArrayBufferViewCore.aTypedArrayConstructor;\nvar isTypedArray = ArrayBufferViewCore.isTypedArray;\nvar BYTES_PER_ELEMENT = 'BYTES_PER_ELEMENT';\nvar WRONG_LENGTH = 'Wrong length';\n\nvar fromList = function (C, list) {\n var index = 0;\n var length = list.length;\n var result = new (aTypedArrayConstructor(C))(length);\n while (length > index) result[index] = list[index++];\n return result;\n};\n\nvar addGetter = function (it, key) {\n nativeDefineProperty(it, key, { get: function () {\n return getInternalState(this)[key];\n } });\n};\n\nvar isArrayBuffer = function (it) {\n var klass;\n return it instanceof ArrayBuffer || (klass = classof(it)) == 'ArrayBuffer' || klass == 'SharedArrayBuffer';\n};\n\nvar isTypedArrayIndex = function (target, key) {\n return isTypedArray(target)\n && !isSymbol(key)\n && key in target\n && isInteger(+key)\n && key >= 0;\n};\n\nvar wrappedGetOwnPropertyDescriptor = function getOwnPropertyDescriptor(target, key) {\n key = toPropertyKey(key);\n return isTypedArrayIndex(target, key)\n ? createPropertyDescriptor(2, target[key])\n : nativeGetOwnPropertyDescriptor(target, key);\n};\n\nvar wrappedDefineProperty = function defineProperty(target, key, descriptor) {\n key = toPropertyKey(key);\n if (isTypedArrayIndex(target, key)\n && isObject(descriptor)\n && has(descriptor, 'value')\n && !has(descriptor, 'get')\n && !has(descriptor, 'set')\n // TODO: add validation descriptor w/o calling accessors\n && !descriptor.configurable\n && (!has(descriptor, 'writable') || descriptor.writable)\n && (!has(descriptor, 'enumerable') || descriptor.enumerable)\n ) {\n target[key] = descriptor.value;\n return target;\n } return nativeDefineProperty(target, key, descriptor);\n};\n\nif (DESCRIPTORS) {\n if (!NATIVE_ARRAY_BUFFER_VIEWS) {\n getOwnPropertyDescriptorModule.f = wrappedGetOwnPropertyDescriptor;\n definePropertyModule.f = wrappedDefineProperty;\n addGetter(TypedArrayPrototype, 'buffer');\n addGetter(TypedArrayPrototype, 'byteOffset');\n addGetter(TypedArrayPrototype, 'byteLength');\n addGetter(TypedArrayPrototype, 'length');\n }\n\n $({ target: 'Object', stat: true, forced: !NATIVE_ARRAY_BUFFER_VIEWS }, {\n getOwnPropertyDescriptor: wrappedGetOwnPropertyDescriptor,\n defineProperty: wrappedDefineProperty\n });\n\n module.exports = function (TYPE, wrapper, CLAMPED) {\n var BYTES = TYPE.match(/\\d+$/)[0] / 8;\n var CONSTRUCTOR_NAME = TYPE + (CLAMPED ? 'Clamped' : '') + 'Array';\n var GETTER = 'get' + TYPE;\n var SETTER = 'set' + TYPE;\n var NativeTypedArrayConstructor = global[CONSTRUCTOR_NAME];\n var TypedArrayConstructor = NativeTypedArrayConstructor;\n var TypedArrayConstructorPrototype = TypedArrayConstructor && TypedArrayConstructor.prototype;\n var exported = {};\n\n var getter = function (that, index) {\n var data = getInternalState(that);\n return data.view[GETTER](index * BYTES + data.byteOffset, true);\n };\n\n var setter = function (that, index, value) {\n var data = getInternalState(that);\n if (CLAMPED) value = (value = round(value)) < 0 ? 0 : value > 0xFF ? 0xFF : value & 0xFF;\n data.view[SETTER](index * BYTES + data.byteOffset, value, true);\n };\n\n var addElement = function (that, index) {\n nativeDefineProperty(that, index, {\n get: function () {\n return getter(this, index);\n },\n set: function (value) {\n return setter(this, index, value);\n },\n enumerable: true\n });\n };\n\n if (!NATIVE_ARRAY_BUFFER_VIEWS) {\n TypedArrayConstructor = wrapper(function (that, data, offset, $length) {\n anInstance(that, TypedArrayConstructor, CONSTRUCTOR_NAME);\n var index = 0;\n var byteOffset = 0;\n var buffer, byteLength, length;\n if (!isObject(data)) {\n length = toIndex(data);\n byteLength = length * BYTES;\n buffer = new ArrayBuffer(byteLength);\n } else if (isArrayBuffer(data)) {\n buffer = data;\n byteOffset = toOffset(offset, BYTES);\n var $len = data.byteLength;\n if ($length === undefined) {\n if ($len % BYTES) throw RangeError(WRONG_LENGTH);\n byteLength = $len - byteOffset;\n if (byteLength < 0) throw RangeError(WRONG_LENGTH);\n } else {\n byteLength = toLength($length) * BYTES;\n if (byteLength + byteOffset > $len) throw RangeError(WRONG_LENGTH);\n }\n length = byteLength / BYTES;\n } else if (isTypedArray(data)) {\n return fromList(TypedArrayConstructor, data);\n } else {\n return typedArrayFrom.call(TypedArrayConstructor, data);\n }\n setInternalState(that, {\n buffer: buffer,\n byteOffset: byteOffset,\n byteLength: byteLength,\n length: length,\n view: new DataView(buffer)\n });\n while (index < length) addElement(that, index++);\n });\n\n if (setPrototypeOf) setPrototypeOf(TypedArrayConstructor, TypedArray);\n TypedArrayConstructorPrototype = TypedArrayConstructor.prototype = create(TypedArrayPrototype);\n } else if (TYPED_ARRAYS_CONSTRUCTORS_REQUIRES_WRAPPERS) {\n TypedArrayConstructor = wrapper(function (dummy, data, typedArrayOffset, $length) {\n anInstance(dummy, TypedArrayConstructor, CONSTRUCTOR_NAME);\n return inheritIfRequired(function () {\n if (!isObject(data)) return new NativeTypedArrayConstructor(toIndex(data));\n if (isArrayBuffer(data)) return $length !== undefined\n ? new NativeTypedArrayConstructor(data, toOffset(typedArrayOffset, BYTES), $length)\n : typedArrayOffset !== undefined\n ? new NativeTypedArrayConstructor(data, toOffset(typedArrayOffset, BYTES))\n : new NativeTypedArrayConstructor(data);\n if (isTypedArray(data)) return fromList(TypedArrayConstructor, data);\n return typedArrayFrom.call(TypedArrayConstructor, data);\n }(), dummy, TypedArrayConstructor);\n });\n\n if (setPrototypeOf) setPrototypeOf(TypedArrayConstructor, TypedArray);\n forEach(getOwnPropertyNames(NativeTypedArrayConstructor), function (key) {\n if (!(key in TypedArrayConstructor)) {\n createNonEnumerableProperty(TypedArrayConstructor, key, NativeTypedArrayConstructor[key]);\n }\n });\n TypedArrayConstructor.prototype = TypedArrayConstructorPrototype;\n }\n\n if (TypedArrayConstructorPrototype.constructor !== TypedArrayConstructor) {\n createNonEnumerableProperty(TypedArrayConstructorPrototype, 'constructor', TypedArrayConstructor);\n }\n\n createNonEnumerableProperty(TypedArrayConstructorPrototype, TYPED_ARRAY_CONSTRUCTOR, TypedArrayConstructor);\n\n if (TYPED_ARRAY_TAG) {\n createNonEnumerableProperty(TypedArrayConstructorPrototype, TYPED_ARRAY_TAG, CONSTRUCTOR_NAME);\n }\n\n exported[CONSTRUCTOR_NAME] = TypedArrayConstructor;\n\n $({\n global: true, forced: TypedArrayConstructor != NativeTypedArrayConstructor, sham: !NATIVE_ARRAY_BUFFER_VIEWS\n }, exported);\n\n if (!(BYTES_PER_ELEMENT in TypedArrayConstructor)) {\n createNonEnumerableProperty(TypedArrayConstructor, BYTES_PER_ELEMENT, BYTES);\n }\n\n if (!(BYTES_PER_ELEMENT in TypedArrayConstructorPrototype)) {\n createNonEnumerableProperty(TypedArrayConstructorPrototype, BYTES_PER_ELEMENT, BYTES);\n }\n\n setSpecies(CONSTRUCTOR_NAME);\n };\n} else module.exports = function () { /* empty */ };\n","'use strict';\nvar toObject = require('../internals/to-object');\nvar toAbsoluteIndex = require('../internals/to-absolute-index');\nvar toLength = require('../internals/to-length');\n\nvar min = Math.min;\n\n// `Array.prototype.copyWithin` method implementation\n// https://tc39.es/ecma262/#sec-array.prototype.copywithin\n// eslint-disable-next-line es/no-array-prototype-copywithin -- safe\nmodule.exports = [].copyWithin || function copyWithin(target /* = 0 */, start /* = 0, end = @length */) {\n var O = toObject(this);\n var len = toLength(O.length);\n var to = toAbsoluteIndex(target, len);\n var from = toAbsoluteIndex(start, len);\n var end = arguments.length > 2 ? arguments[2] : undefined;\n var count = min((end === undefined ? len : toAbsoluteIndex(end, len)) - from, len - to);\n var inc = 1;\n if (from < to && to < from + count) {\n inc = -1;\n from += count - 1;\n to += count - 1;\n }\n while (count-- > 0) {\n if (from in O) O[to] = O[from];\n else delete O[to];\n to += inc;\n from += inc;\n } return O;\n};\n","'use strict';\nvar ArrayBufferViewCore = require('../internals/array-buffer-view-core');\nvar $copyWithin = require('../internals/array-copy-within');\n\nvar aTypedArray = ArrayBufferViewCore.aTypedArray;\nvar exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod;\n\n// `%TypedArray%.prototype.copyWithin` method\n// https://tc39.es/ecma262/#sec-%typedarray%.prototype.copywithin\nexportTypedArrayMethod('copyWithin', function copyWithin(target, start /* , end */) {\n return $copyWithin.call(aTypedArray(this), target, start, arguments.length > 2 ? arguments[2] : undefined);\n});\n","'use strict';\nvar ArrayBufferViewCore = require('../internals/array-buffer-view-core');\nvar $every = require('../internals/array-iteration').every;\n\nvar aTypedArray = ArrayBufferViewCore.aTypedArray;\nvar exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod;\n\n// `%TypedArray%.prototype.every` method\n// https://tc39.es/ecma262/#sec-%typedarray%.prototype.every\nexportTypedArrayMethod('every', function every(callbackfn /* , thisArg */) {\n return $every(aTypedArray(this), callbackfn, arguments.length > 1 ? arguments[1] : undefined);\n});\n","'use strict';\nvar ArrayBufferViewCore = require('../internals/array-buffer-view-core');\nvar $fill = require('../internals/array-fill');\n\nvar aTypedArray = ArrayBufferViewCore.aTypedArray;\nvar exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod;\n\n// `%TypedArray%.prototype.fill` method\n// https://tc39.es/ecma262/#sec-%typedarray%.prototype.fill\n// eslint-disable-next-line no-unused-vars -- required for `.length`\nexportTypedArrayMethod('fill', function fill(value /* , start, end */) {\n return $fill.apply(aTypedArray(this), arguments);\n});\n","module.exports = function (Constructor, list) {\n var index = 0;\n var length = list.length;\n var result = new Constructor(length);\n while (length > index) result[index] = list[index++];\n return result;\n};\n","var ArrayBufferViewCore = require('../internals/array-buffer-view-core');\nvar speciesConstructor = require('../internals/species-constructor');\n\nvar TYPED_ARRAY_CONSTRUCTOR = ArrayBufferViewCore.TYPED_ARRAY_CONSTRUCTOR;\nvar aTypedArrayConstructor = ArrayBufferViewCore.aTypedArrayConstructor;\n\n// a part of `TypedArraySpeciesCreate` abstract operation\n// https://tc39.es/ecma262/#typedarray-species-create\nmodule.exports = function (originalArray) {\n return aTypedArrayConstructor(speciesConstructor(originalArray, originalArray[TYPED_ARRAY_CONSTRUCTOR]));\n};\n","'use strict';\nvar ArrayBufferViewCore = require('../internals/array-buffer-view-core');\nvar $filter = require('../internals/array-iteration').filter;\nvar fromSpeciesAndList = require('../internals/typed-array-from-species-and-list');\n\nvar aTypedArray = ArrayBufferViewCore.aTypedArray;\nvar exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod;\n\n// `%TypedArray%.prototype.filter` method\n// https://tc39.es/ecma262/#sec-%typedarray%.prototype.filter\nexportTypedArrayMethod('filter', function filter(callbackfn /* , thisArg */) {\n var list = $filter(aTypedArray(this), callbackfn, arguments.length > 1 ? arguments[1] : undefined);\n return fromSpeciesAndList(this, list);\n});\n","'use strict';\nvar ArrayBufferViewCore = require('../internals/array-buffer-view-core');\nvar $find = require('../internals/array-iteration').find;\n\nvar aTypedArray = ArrayBufferViewCore.aTypedArray;\nvar exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod;\n\n// `%TypedArray%.prototype.find` method\n// https://tc39.es/ecma262/#sec-%typedarray%.prototype.find\nexportTypedArrayMethod('find', function find(predicate /* , thisArg */) {\n return $find(aTypedArray(this), predicate, arguments.length > 1 ? arguments[1] : undefined);\n});\n","'use strict';\nvar ArrayBufferViewCore = require('../internals/array-buffer-view-core');\nvar $findIndex = require('../internals/array-iteration').findIndex;\n\nvar aTypedArray = ArrayBufferViewCore.aTypedArray;\nvar exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod;\n\n// `%TypedArray%.prototype.findIndex` method\n// https://tc39.es/ecma262/#sec-%typedarray%.prototype.findindex\nexportTypedArrayMethod('findIndex', function findIndex(predicate /* , thisArg */) {\n return $findIndex(aTypedArray(this), predicate, arguments.length > 1 ? arguments[1] : undefined);\n});\n","'use strict';\nvar ArrayBufferViewCore = require('../internals/array-buffer-view-core');\nvar $forEach = require('../internals/array-iteration').forEach;\n\nvar aTypedArray = ArrayBufferViewCore.aTypedArray;\nvar exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod;\n\n// `%TypedArray%.prototype.forEach` method\n// https://tc39.es/ecma262/#sec-%typedarray%.prototype.foreach\nexportTypedArrayMethod('forEach', function forEach(callbackfn /* , thisArg */) {\n $forEach(aTypedArray(this), callbackfn, arguments.length > 1 ? arguments[1] : undefined);\n});\n","'use strict';\nvar ArrayBufferViewCore = require('../internals/array-buffer-view-core');\nvar $includes = require('../internals/array-includes').includes;\n\nvar aTypedArray = ArrayBufferViewCore.aTypedArray;\nvar exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod;\n\n// `%TypedArray%.prototype.includes` method\n// https://tc39.es/ecma262/#sec-%typedarray%.prototype.includes\nexportTypedArrayMethod('includes', function includes(searchElement /* , fromIndex */) {\n return $includes(aTypedArray(this), searchElement, arguments.length > 1 ? arguments[1] : undefined);\n});\n","'use strict';\nvar ArrayBufferViewCore = require('../internals/array-buffer-view-core');\nvar $indexOf = require('../internals/array-includes').indexOf;\n\nvar aTypedArray = ArrayBufferViewCore.aTypedArray;\nvar exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod;\n\n// `%TypedArray%.prototype.indexOf` method\n// https://tc39.es/ecma262/#sec-%typedarray%.prototype.indexof\nexportTypedArrayMethod('indexOf', function indexOf(searchElement /* , fromIndex */) {\n return $indexOf(aTypedArray(this), searchElement, arguments.length > 1 ? arguments[1] : undefined);\n});\n","'use strict';\nvar global = require('../internals/global');\nvar ArrayBufferViewCore = require('../internals/array-buffer-view-core');\nvar ArrayIterators = require('../modules/es.array.iterator');\nvar wellKnownSymbol = require('../internals/well-known-symbol');\n\nvar ITERATOR = wellKnownSymbol('iterator');\nvar Uint8Array = global.Uint8Array;\nvar arrayValues = ArrayIterators.values;\nvar arrayKeys = ArrayIterators.keys;\nvar arrayEntries = ArrayIterators.entries;\nvar aTypedArray = ArrayBufferViewCore.aTypedArray;\nvar exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod;\nvar nativeTypedArrayIterator = Uint8Array && Uint8Array.prototype[ITERATOR];\n\nvar CORRECT_ITER_NAME = !!nativeTypedArrayIterator\n && (nativeTypedArrayIterator.name == 'values' || nativeTypedArrayIterator.name == undefined);\n\nvar typedArrayValues = function values() {\n return arrayValues.call(aTypedArray(this));\n};\n\n// `%TypedArray%.prototype.entries` method\n// https://tc39.es/ecma262/#sec-%typedarray%.prototype.entries\nexportTypedArrayMethod('entries', function entries() {\n return arrayEntries.call(aTypedArray(this));\n});\n// `%TypedArray%.prototype.keys` method\n// https://tc39.es/ecma262/#sec-%typedarray%.prototype.keys\nexportTypedArrayMethod('keys', function keys() {\n return arrayKeys.call(aTypedArray(this));\n});\n// `%TypedArray%.prototype.values` method\n// https://tc39.es/ecma262/#sec-%typedarray%.prototype.values\nexportTypedArrayMethod('values', typedArrayValues, !CORRECT_ITER_NAME);\n// `%TypedArray%.prototype[@@iterator]` method\n// https://tc39.es/ecma262/#sec-%typedarray%.prototype-@@iterator\nexportTypedArrayMethod(ITERATOR, typedArrayValues, !CORRECT_ITER_NAME);\n","'use strict';\nvar ArrayBufferViewCore = require('../internals/array-buffer-view-core');\n\nvar aTypedArray = ArrayBufferViewCore.aTypedArray;\nvar exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod;\nvar $join = [].join;\n\n// `%TypedArray%.prototype.join` method\n// https://tc39.es/ecma262/#sec-%typedarray%.prototype.join\n// eslint-disable-next-line no-unused-vars -- required for `.length`\nexportTypedArrayMethod('join', function join(separator) {\n return $join.apply(aTypedArray(this), arguments);\n});\n","'use strict';\nvar fails = require('../internals/fails');\n\nmodule.exports = function (METHOD_NAME, argument) {\n var method = [][METHOD_NAME];\n return !!method && fails(function () {\n // eslint-disable-next-line no-useless-call,no-throw-literal -- required for testing\n method.call(null, argument || function () { throw 1; }, 1);\n });\n};\n","'use strict';\n/* eslint-disable es/no-array-prototype-lastindexof -- safe */\nvar toIndexedObject = require('../internals/to-indexed-object');\nvar toInteger = require('../internals/to-integer');\nvar toLength = require('../internals/to-length');\nvar arrayMethodIsStrict = require('../internals/array-method-is-strict');\n\nvar min = Math.min;\nvar $lastIndexOf = [].lastIndexOf;\nvar NEGATIVE_ZERO = !!$lastIndexOf && 1 / [1].lastIndexOf(1, -0) < 0;\nvar STRICT_METHOD = arrayMethodIsStrict('lastIndexOf');\nvar FORCED = NEGATIVE_ZERO || !STRICT_METHOD;\n\n// `Array.prototype.lastIndexOf` method implementation\n// https://tc39.es/ecma262/#sec-array.prototype.lastindexof\nmodule.exports = FORCED ? function lastIndexOf(searchElement /* , fromIndex = @[*-1] */) {\n // convert -0 to +0\n if (NEGATIVE_ZERO) return $lastIndexOf.apply(this, arguments) || 0;\n var O = toIndexedObject(this);\n var length = toLength(O.length);\n var index = length - 1;\n if (arguments.length > 1) index = min(index, toInteger(arguments[1]));\n if (index < 0) index = length + index;\n for (;index >= 0; index--) if (index in O && O[index] === searchElement) return index || 0;\n return -1;\n} : $lastIndexOf;\n","'use strict';\nvar ArrayBufferViewCore = require('../internals/array-buffer-view-core');\nvar $lastIndexOf = require('../internals/array-last-index-of');\n\nvar aTypedArray = ArrayBufferViewCore.aTypedArray;\nvar exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod;\n\n// `%TypedArray%.prototype.lastIndexOf` method\n// https://tc39.es/ecma262/#sec-%typedarray%.prototype.lastindexof\n// eslint-disable-next-line no-unused-vars -- required for `.length`\nexportTypedArrayMethod('lastIndexOf', function lastIndexOf(searchElement /* , fromIndex */) {\n return $lastIndexOf.apply(aTypedArray(this), arguments);\n});\n","'use strict';\nvar ArrayBufferViewCore = require('../internals/array-buffer-view-core');\nvar $map = require('../internals/array-iteration').map;\nvar typedArraySpeciesConstructor = require('../internals/typed-array-species-constructor');\n\nvar aTypedArray = ArrayBufferViewCore.aTypedArray;\nvar exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod;\n\n// `%TypedArray%.prototype.map` method\n// https://tc39.es/ecma262/#sec-%typedarray%.prototype.map\nexportTypedArrayMethod('map', function map(mapfn /* , thisArg */) {\n return $map(aTypedArray(this), mapfn, arguments.length > 1 ? arguments[1] : undefined, function (O, length) {\n return new (typedArraySpeciesConstructor(O))(length);\n });\n});\n","var aFunction = require('../internals/a-function');\nvar toObject = require('../internals/to-object');\nvar IndexedObject = require('../internals/indexed-object');\nvar toLength = require('../internals/to-length');\n\n// `Array.prototype.{ reduce, reduceRight }` methods implementation\nvar createMethod = function (IS_RIGHT) {\n return function (that, callbackfn, argumentsLength, memo) {\n aFunction(callbackfn);\n var O = toObject(that);\n var self = IndexedObject(O);\n var length = toLength(O.length);\n var index = IS_RIGHT ? length - 1 : 0;\n var i = IS_RIGHT ? -1 : 1;\n if (argumentsLength < 2) while (true) {\n if (index in self) {\n memo = self[index];\n index += i;\n break;\n }\n index += i;\n if (IS_RIGHT ? index < 0 : length <= index) {\n throw TypeError('Reduce of empty array with no initial value');\n }\n }\n for (;IS_RIGHT ? index >= 0 : length > index; index += i) if (index in self) {\n memo = callbackfn(memo, self[index], index, O);\n }\n return memo;\n };\n};\n\nmodule.exports = {\n // `Array.prototype.reduce` method\n // https://tc39.es/ecma262/#sec-array.prototype.reduce\n left: createMethod(false),\n // `Array.prototype.reduceRight` method\n // https://tc39.es/ecma262/#sec-array.prototype.reduceright\n right: createMethod(true)\n};\n","'use strict';\nvar ArrayBufferViewCore = require('../internals/array-buffer-view-core');\nvar $reduce = require('../internals/array-reduce').left;\n\nvar aTypedArray = ArrayBufferViewCore.aTypedArray;\nvar exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod;\n\n// `%TypedArray%.prototype.reduce` method\n// https://tc39.es/ecma262/#sec-%typedarray%.prototype.reduce\nexportTypedArrayMethod('reduce', function reduce(callbackfn /* , initialValue */) {\n return $reduce(aTypedArray(this), callbackfn, arguments.length, arguments.length > 1 ? arguments[1] : undefined);\n});\n","'use strict';\nvar ArrayBufferViewCore = require('../internals/array-buffer-view-core');\nvar $reduceRight = require('../internals/array-reduce').right;\n\nvar aTypedArray = ArrayBufferViewCore.aTypedArray;\nvar exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod;\n\n// `%TypedArray%.prototype.reduceRicht` method\n// https://tc39.es/ecma262/#sec-%typedarray%.prototype.reduceright\nexportTypedArrayMethod('reduceRight', function reduceRight(callbackfn /* , initialValue */) {\n return $reduceRight(aTypedArray(this), callbackfn, arguments.length, arguments.length > 1 ? arguments[1] : undefined);\n});\n","'use strict';\nvar ArrayBufferViewCore = require('../internals/array-buffer-view-core');\n\nvar aTypedArray = ArrayBufferViewCore.aTypedArray;\nvar exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod;\nvar floor = Math.floor;\n\n// `%TypedArray%.prototype.reverse` method\n// https://tc39.es/ecma262/#sec-%typedarray%.prototype.reverse\nexportTypedArrayMethod('reverse', function reverse() {\n var that = this;\n var length = aTypedArray(that).length;\n var middle = floor(length / 2);\n var index = 0;\n var value;\n while (index < middle) {\n value = that[index];\n that[index++] = that[--length];\n that[length] = value;\n } return that;\n});\n","'use strict';\nvar ArrayBufferViewCore = require('../internals/array-buffer-view-core');\nvar toLength = require('../internals/to-length');\nvar toOffset = require('../internals/to-offset');\nvar toObject = require('../internals/to-object');\nvar fails = require('../internals/fails');\n\nvar aTypedArray = ArrayBufferViewCore.aTypedArray;\nvar exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod;\n\nvar FORCED = fails(function () {\n // eslint-disable-next-line es/no-typed-arrays -- required for testing\n new Int8Array(1).set({});\n});\n\n// `%TypedArray%.prototype.set` method\n// https://tc39.es/ecma262/#sec-%typedarray%.prototype.set\nexportTypedArrayMethod('set', function set(arrayLike /* , offset */) {\n aTypedArray(this);\n var offset = toOffset(arguments.length > 1 ? arguments[1] : undefined, 1);\n var length = this.length;\n var src = toObject(arrayLike);\n var len = toLength(src.length);\n var index = 0;\n if (len + offset > length) throw RangeError('Wrong length');\n while (index < len) this[offset + index] = src[index++];\n}, FORCED);\n","'use strict';\nvar ArrayBufferViewCore = require('../internals/array-buffer-view-core');\nvar typedArraySpeciesConstructor = require('../internals/typed-array-species-constructor');\nvar fails = require('../internals/fails');\n\nvar aTypedArray = ArrayBufferViewCore.aTypedArray;\nvar exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod;\nvar $slice = [].slice;\n\nvar FORCED = fails(function () {\n // eslint-disable-next-line es/no-typed-arrays -- required for testing\n new Int8Array(1).slice();\n});\n\n// `%TypedArray%.prototype.slice` method\n// https://tc39.es/ecma262/#sec-%typedarray%.prototype.slice\nexportTypedArrayMethod('slice', function slice(start, end) {\n var list = $slice.call(aTypedArray(this), start, end);\n var C = typedArraySpeciesConstructor(this);\n var index = 0;\n var length = list.length;\n var result = new C(length);\n while (length > index) result[index] = list[index++];\n return result;\n}, FORCED);\n","'use strict';\nvar ArrayBufferViewCore = require('../internals/array-buffer-view-core');\nvar $some = require('../internals/array-iteration').some;\n\nvar aTypedArray = ArrayBufferViewCore.aTypedArray;\nvar exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod;\n\n// `%TypedArray%.prototype.some` method\n// https://tc39.es/ecma262/#sec-%typedarray%.prototype.some\nexportTypedArrayMethod('some', function some(callbackfn /* , thisArg */) {\n return $some(aTypedArray(this), callbackfn, arguments.length > 1 ? arguments[1] : undefined);\n});\n","// TODO: use something more complex like timsort?\nvar floor = Math.floor;\n\nvar mergeSort = function (array, comparefn) {\n var length = array.length;\n var middle = floor(length / 2);\n return length < 8 ? insertionSort(array, comparefn) : merge(\n mergeSort(array.slice(0, middle), comparefn),\n mergeSort(array.slice(middle), comparefn),\n comparefn\n );\n};\n\nvar insertionSort = function (array, comparefn) {\n var length = array.length;\n var i = 1;\n var element, j;\n\n while (i < length) {\n j = i;\n element = array[i];\n while (j && comparefn(array[j - 1], element) > 0) {\n array[j] = array[--j];\n }\n if (j !== i++) array[j] = element;\n } return array;\n};\n\nvar merge = function (left, right, comparefn) {\n var llength = left.length;\n var rlength = right.length;\n var lindex = 0;\n var rindex = 0;\n var result = [];\n\n while (lindex < llength || rindex < rlength) {\n if (lindex < llength && rindex < rlength) {\n result.push(comparefn(left[lindex], right[rindex]) <= 0 ? left[lindex++] : right[rindex++]);\n } else {\n result.push(lindex < llength ? left[lindex++] : right[rindex++]);\n }\n } return result;\n};\n\nmodule.exports = mergeSort;\n","var userAgent = require('../internals/engine-user-agent');\n\nvar firefox = userAgent.match(/firefox\\/(\\d+)/i);\n\nmodule.exports = !!firefox && +firefox[1];\n","'use strict';\nvar ArrayBufferViewCore = require('../internals/array-buffer-view-core');\nvar global = require('../internals/global');\nvar fails = require('../internals/fails');\nvar aFunction = require('../internals/a-function');\nvar toLength = require('../internals/to-length');\nvar internalSort = require('../internals/array-sort');\nvar FF = require('../internals/engine-ff-version');\nvar IE_OR_EDGE = require('../internals/engine-is-ie-or-edge');\nvar V8 = require('../internals/engine-v8-version');\nvar WEBKIT = require('../internals/engine-webkit-version');\n\nvar aTypedArray = ArrayBufferViewCore.aTypedArray;\nvar exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod;\nvar Uint16Array = global.Uint16Array;\nvar nativeSort = Uint16Array && Uint16Array.prototype.sort;\n\n// WebKit\nvar ACCEPT_INCORRECT_ARGUMENTS = !!nativeSort && !fails(function () {\n var array = new Uint16Array(2);\n array.sort(null);\n array.sort({});\n});\n\nvar STABLE_SORT = !!nativeSort && !fails(function () {\n // feature detection can be too slow, so check engines versions\n if (V8) return V8 < 74;\n if (FF) return FF < 67;\n if (IE_OR_EDGE) return true;\n if (WEBKIT) return WEBKIT < 602;\n\n var array = new Uint16Array(516);\n var expected = Array(516);\n var index, mod;\n\n for (index = 0; index < 516; index++) {\n mod = index % 4;\n array[index] = 515 - index;\n expected[index] = index - 2 * mod + 3;\n }\n\n array.sort(function (a, b) {\n return (a / 4 | 0) - (b / 4 | 0);\n });\n\n for (index = 0; index < 516; index++) {\n if (array[index] !== expected[index]) return true;\n }\n});\n\nvar getSortCompare = function (comparefn) {\n return function (x, y) {\n if (comparefn !== undefined) return +comparefn(x, y) || 0;\n // eslint-disable-next-line no-self-compare -- NaN check\n if (y !== y) return -1;\n // eslint-disable-next-line no-self-compare -- NaN check\n if (x !== x) return 1;\n if (x === 0 && y === 0) return 1 / x > 0 && 1 / y < 0 ? 1 : -1;\n return x > y;\n };\n};\n\n// `%TypedArray%.prototype.sort` method\n// https://tc39.es/ecma262/#sec-%typedarray%.prototype.sort\nexportTypedArrayMethod('sort', function sort(comparefn) {\n var array = this;\n if (comparefn !== undefined) aFunction(comparefn);\n if (STABLE_SORT) return nativeSort.call(array, comparefn);\n\n aTypedArray(array);\n var arrayLength = toLength(array.length);\n var items = Array(arrayLength);\n var index;\n\n for (index = 0; index < arrayLength; index++) {\n items[index] = array[index];\n }\n\n items = internalSort(array, getSortCompare(comparefn));\n\n for (index = 0; index < arrayLength; index++) {\n array[index] = items[index];\n }\n\n return array;\n}, !STABLE_SORT || ACCEPT_INCORRECT_ARGUMENTS);\n","'use strict';\nvar ArrayBufferViewCore = require('../internals/array-buffer-view-core');\nvar toLength = require('../internals/to-length');\nvar toAbsoluteIndex = require('../internals/to-absolute-index');\nvar typedArraySpeciesConstructor = require('../internals/typed-array-species-constructor');\n\nvar aTypedArray = ArrayBufferViewCore.aTypedArray;\nvar exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod;\n\n// `%TypedArray%.prototype.subarray` method\n// https://tc39.es/ecma262/#sec-%typedarray%.prototype.subarray\nexportTypedArrayMethod('subarray', function subarray(begin, end) {\n var O = aTypedArray(this);\n var length = O.length;\n var beginIndex = toAbsoluteIndex(begin, length);\n var C = typedArraySpeciesConstructor(O);\n return new C(\n O.buffer,\n O.byteOffset + beginIndex * O.BYTES_PER_ELEMENT,\n toLength((end === undefined ? length : toAbsoluteIndex(end, length)) - beginIndex)\n );\n});\n","'use strict';\nvar global = require('../internals/global');\nvar ArrayBufferViewCore = require('../internals/array-buffer-view-core');\nvar fails = require('../internals/fails');\n\nvar Int8Array = global.Int8Array;\nvar aTypedArray = ArrayBufferViewCore.aTypedArray;\nvar exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod;\nvar $toLocaleString = [].toLocaleString;\nvar $slice = [].slice;\n\n// iOS Safari 6.x fails here\nvar TO_LOCALE_STRING_BUG = !!Int8Array && fails(function () {\n $toLocaleString.call(new Int8Array(1));\n});\n\nvar FORCED = fails(function () {\n return [1, 2].toLocaleString() != new Int8Array([1, 2]).toLocaleString();\n}) || !fails(function () {\n Int8Array.prototype.toLocaleString.call([1, 2]);\n});\n\n// `%TypedArray%.prototype.toLocaleString` method\n// https://tc39.es/ecma262/#sec-%typedarray%.prototype.tolocalestring\nexportTypedArrayMethod('toLocaleString', function toLocaleString() {\n return $toLocaleString.apply(TO_LOCALE_STRING_BUG ? $slice.call(aTypedArray(this)) : aTypedArray(this), arguments);\n}, FORCED);\n","'use strict';\nvar exportTypedArrayMethod = require('../internals/array-buffer-view-core').exportTypedArrayMethod;\nvar fails = require('../internals/fails');\nvar global = require('../internals/global');\n\nvar Uint8Array = global.Uint8Array;\nvar Uint8ArrayPrototype = Uint8Array && Uint8Array.prototype || {};\nvar arrayToString = [].toString;\nvar arrayJoin = [].join;\n\nif (fails(function () { arrayToString.call({}); })) {\n arrayToString = function toString() {\n return arrayJoin.call(this);\n };\n}\n\nvar IS_NOT_ARRAY_METHOD = Uint8ArrayPrototype.toString != arrayToString;\n\n// `%TypedArray%.prototype.toString` method\n// https://tc39.es/ecma262/#sec-%typedarray%.prototype.tostring\nexportTypedArrayMethod('toString', arrayToString, IS_NOT_ARRAY_METHOD);\n","'use strict';\nvar toPropertyKey = require('../internals/to-property-key');\nvar definePropertyModule = require('../internals/object-define-property');\nvar createPropertyDescriptor = require('../internals/create-property-descriptor');\n\nmodule.exports = function (object, key, value) {\n var propertyKey = toPropertyKey(key);\n if (propertyKey in object) definePropertyModule.f(object, propertyKey, createPropertyDescriptor(0, value));\n else object[propertyKey] = value;\n};\n","var fails = require('../internals/fails');\nvar wellKnownSymbol = require('../internals/well-known-symbol');\nvar V8_VERSION = require('../internals/engine-v8-version');\n\nvar SPECIES = wellKnownSymbol('species');\n\nmodule.exports = function (METHOD_NAME) {\n // We can't use this feature detection in V8 since it causes\n // deoptimization and serious performance degradation\n // https://github.com/zloirock/core-js/issues/677\n return V8_VERSION >= 51 || !fails(function () {\n var array = [];\n var constructor = array.constructor = {};\n constructor[SPECIES] = function () {\n return { foo: 1 };\n };\n return array[METHOD_NAME](Boolean).foo !== 1;\n });\n};\n","'use strict';\nvar $ = require('../internals/export');\nvar isObject = require('../internals/is-object');\nvar isArray = require('../internals/is-array');\nvar toAbsoluteIndex = require('../internals/to-absolute-index');\nvar toLength = require('../internals/to-length');\nvar toIndexedObject = require('../internals/to-indexed-object');\nvar createProperty = require('../internals/create-property');\nvar wellKnownSymbol = require('../internals/well-known-symbol');\nvar arrayMethodHasSpeciesSupport = require('../internals/array-method-has-species-support');\n\nvar HAS_SPECIES_SUPPORT = arrayMethodHasSpeciesSupport('slice');\n\nvar SPECIES = wellKnownSymbol('species');\nvar nativeSlice = [].slice;\nvar max = Math.max;\n\n// `Array.prototype.slice` method\n// https://tc39.es/ecma262/#sec-array.prototype.slice\n// fallback for not array-like ES3 strings and DOM objects\n$({ target: 'Array', proto: true, forced: !HAS_SPECIES_SUPPORT }, {\n slice: function slice(start, end) {\n var O = toIndexedObject(this);\n var length = toLength(O.length);\n var k = toAbsoluteIndex(start, length);\n var fin = toAbsoluteIndex(end === undefined ? length : end, length);\n // inline `ArraySpeciesCreate` for usage native `Array#slice` where it's possible\n var Constructor, result, n;\n if (isArray(O)) {\n Constructor = O.constructor;\n // cross-realm fallback\n if (typeof Constructor == 'function' && (Constructor === Array || isArray(Constructor.prototype))) {\n Constructor = undefined;\n } else if (isObject(Constructor)) {\n Constructor = Constructor[SPECIES];\n if (Constructor === null) Constructor = undefined;\n }\n if (Constructor === Array || Constructor === undefined) {\n return nativeSlice.call(O, k, fin);\n }\n }\n result = new (Constructor === undefined ? Array : Constructor)(max(fin - k, 0));\n for (n = 0; k < fin; k++, n++) if (k in O) createProperty(result, n, O[k]);\n result.length = n;\n return result;\n }\n});\n","'use strict';\nvar $ = require('../internals/export');\nvar $filter = require('../internals/array-iteration').filter;\nvar arrayMethodHasSpeciesSupport = require('../internals/array-method-has-species-support');\n\nvar HAS_SPECIES_SUPPORT = arrayMethodHasSpeciesSupport('filter');\n\n// `Array.prototype.filter` method\n// https://tc39.es/ecma262/#sec-array.prototype.filter\n// with adding support of @@species\n$({ target: 'Array', proto: true, forced: !HAS_SPECIES_SUPPORT }, {\n filter: function filter(callbackfn /* , thisArg */) {\n return $filter(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined);\n }\n});\n","'use strict';\nvar redefine = require('../internals/redefine');\nvar anObject = require('../internals/an-object');\nvar $toString = require('../internals/to-string');\nvar fails = require('../internals/fails');\nvar flags = require('../internals/regexp-flags');\n\nvar TO_STRING = 'toString';\nvar RegExpPrototype = RegExp.prototype;\nvar nativeToString = RegExpPrototype[TO_STRING];\n\nvar NOT_GENERIC = fails(function () { return nativeToString.call({ source: 'a', flags: 'b' }) != '/a/b'; });\n// FF44- RegExp#toString has a wrong name\nvar INCORRECT_NAME = nativeToString.name != TO_STRING;\n\n// `RegExp.prototype.toString` method\n// https://tc39.es/ecma262/#sec-regexp.prototype.tostring\nif (NOT_GENERIC || INCORRECT_NAME) {\n redefine(RegExp.prototype, TO_STRING, function toString() {\n var R = anObject(this);\n var p = $toString(R.source);\n var rf = R.flags;\n var f = $toString(rf === undefined && R instanceof RegExp && !('flags' in RegExpPrototype) ? flags.call(R) : rf);\n return '/' + p + '/' + f;\n }, { unsafe: true });\n}\n","'use strict';\nvar $ = require('../internals/export');\nvar aFunction = require('../internals/a-function');\nvar toObject = require('../internals/to-object');\nvar toLength = require('../internals/to-length');\nvar toString = require('../internals/to-string');\nvar fails = require('../internals/fails');\nvar internalSort = require('../internals/array-sort');\nvar arrayMethodIsStrict = require('../internals/array-method-is-strict');\nvar FF = require('../internals/engine-ff-version');\nvar IE_OR_EDGE = require('../internals/engine-is-ie-or-edge');\nvar V8 = require('../internals/engine-v8-version');\nvar WEBKIT = require('../internals/engine-webkit-version');\n\nvar test = [];\nvar nativeSort = test.sort;\n\n// IE8-\nvar FAILS_ON_UNDEFINED = fails(function () {\n test.sort(undefined);\n});\n// V8 bug\nvar FAILS_ON_NULL = fails(function () {\n test.sort(null);\n});\n// Old WebKit\nvar STRICT_METHOD = arrayMethodIsStrict('sort');\n\nvar STABLE_SORT = !fails(function () {\n // feature detection can be too slow, so check engines versions\n if (V8) return V8 < 70;\n if (FF && FF > 3) return;\n if (IE_OR_EDGE) return true;\n if (WEBKIT) return WEBKIT < 603;\n\n var result = '';\n var code, chr, value, index;\n\n // generate an array with more 512 elements (Chakra and old V8 fails only in this case)\n for (code = 65; code < 76; code++) {\n chr = String.fromCharCode(code);\n\n switch (code) {\n case 66: case 69: case 70: case 72: value = 3; break;\n case 68: case 71: value = 4; break;\n default: value = 2;\n }\n\n for (index = 0; index < 47; index++) {\n test.push({ k: chr + index, v: value });\n }\n }\n\n test.sort(function (a, b) { return b.v - a.v; });\n\n for (index = 0; index < test.length; index++) {\n chr = test[index].k.charAt(0);\n if (result.charAt(result.length - 1) !== chr) result += chr;\n }\n\n return result !== 'DGBEFHACIJK';\n});\n\nvar FORCED = FAILS_ON_UNDEFINED || !FAILS_ON_NULL || !STRICT_METHOD || !STABLE_SORT;\n\nvar getSortCompare = function (comparefn) {\n return function (x, y) {\n if (y === undefined) return -1;\n if (x === undefined) return 1;\n if (comparefn !== undefined) return +comparefn(x, y) || 0;\n return toString(x) > toString(y) ? 1 : -1;\n };\n};\n\n// `Array.prototype.sort` method\n// https://tc39.es/ecma262/#sec-array.prototype.sort\n$({ target: 'Array', proto: true, forced: FORCED }, {\n sort: function sort(comparefn) {\n if (comparefn !== undefined) aFunction(comparefn);\n\n var array = toObject(this);\n\n if (STABLE_SORT) return comparefn === undefined ? nativeSort.call(array) : nativeSort.call(array, comparefn);\n\n var items = [];\n var arrayLength = toLength(array.length);\n var itemsLength, index;\n\n for (index = 0; index < arrayLength; index++) {\n if (index in array) items.push(array[index]);\n }\n\n items = internalSort(items, getSortCompare(comparefn));\n itemsLength = items.length;\n index = 0;\n\n while (index < itemsLength) array[index] = items[index++];\n while (index < arrayLength) delete array[index++];\n\n return array;\n }\n});\n","\r\n\r\nvar UZIP = {};\r\nif(typeof module == \"object\") module.exports = UZIP;\r\n\r\n\r\nUZIP[\"parse\"] = function(buf, onlyNames)\t// ArrayBuffer\r\n{\r\n\tvar rUs = UZIP.bin.readUshort, rUi = UZIP.bin.readUint, o = 0, out = {};\r\n\tvar data = new Uint8Array(buf);\r\n\tvar eocd = data.length-4;\r\n\t\r\n\twhile(rUi(data, eocd)!=0x06054b50) eocd--;\r\n\t\r\n\tvar o = eocd;\r\n\to+=4;\t// sign = 0x06054b50\r\n\to+=4; // disks = 0;\r\n\tvar cnu = rUs(data, o); o+=2;\r\n\tvar cnt = rUs(data, o); o+=2;\r\n\t\t\t\r\n\tvar csize = rUi(data, o); o+=4;\r\n\tvar coffs = rUi(data, o); o+=4;\r\n\t\r\n\to = coffs;\r\n\tfor(var i=0; i8514000) {\r\n\t\t\t//console.log(PUtils.readASCII(buf , 8514500, 500));\r\n\t\t\t//console.log(PUtils.readASCII(nbuf, 8514500, 500));\r\n\t\t}\r\n\t\tfor(var i=0; i>>4);\r\n\t//console.log(CM, CINFO,CMF,FLG);\r\n\treturn UZIP.inflateRaw(new Uint8Array(file.buffer, file.byteOffset+2, file.length-6), buf); \r\n}\r\nUZIP.deflate = function(data, opts/*, buf, off*/) {\r\n\tif(opts==null) opts={level:6};\r\n\tvar off=0, buf=new Uint8Array(50+Math.floor(data.length*1.1));\r\n\tbuf[off]=120; buf[off+1]=156; off+=2;\r\n\toff = UZIP.F.deflateRaw(data, buf, off, opts.level);\r\n\tvar crc = UZIP.adler(data, 0, data.length);\r\n\tbuf[off+0]=((crc>>>24)&255); \r\n\tbuf[off+1]=((crc>>>16)&255); \r\n\tbuf[off+2]=((crc>>> 8)&255); \r\n\tbuf[off+3]=((crc>>> 0)&255); \t\r\n\treturn new Uint8Array(buf.buffer, 0, off+4);\r\n}\r\nUZIP.deflateRaw = function(data, opts) {\r\n\tif(opts==null) opts={level:6};\r\n\tvar buf=new Uint8Array(50+Math.floor(data.length*1.1));\r\n\tvar off = UZIP.F.deflateRaw(data, buf, off, opts.level);\r\n\treturn new Uint8Array(buf.buffer, 0, off);\r\n}\r\n\r\n\r\nUZIP.encode = function(obj, noCmpr) {\r\n\tif(noCmpr==null) noCmpr=false;\r\n\tvar tot = 0, wUi = UZIP.bin.writeUint, wUs = UZIP.bin.writeUshort;\r\n\tvar zpd = {};\r\n\tfor(var p in obj) { var cpr = !UZIP._noNeed(p) && !noCmpr, buf = obj[p], crc = UZIP.crc.crc(buf,0,buf.length); \r\n\t\tzpd[p] = { cpr:cpr, usize:buf.length, crc:crc, file: (cpr ? UZIP.deflateRaw(buf) : buf) }; }\r\n\t\r\n\tfor(var p in zpd) tot += zpd[p].file.length + 30 + 46 + 2*UZIP.bin.sizeUTF8(p);\r\n\ttot += 22;\r\n\t\r\n\tvar data = new Uint8Array(tot), o = 0;\r\n\tvar fof = []\r\n\t\r\n\tfor(var p in zpd) {\r\n\t\tvar file = zpd[p]; fof.push(o);\r\n\t\to = UZIP._writeHeader(data, o, p, file, 0);\r\n\t}\r\n\tvar i=0, ioff = o;\r\n\tfor(var p in zpd) {\r\n\t\tvar file = zpd[p]; fof.push(o);\r\n\t\to = UZIP._writeHeader(data, o, p, file, 1, fof[i++]);\t\t\r\n\t}\r\n\tvar csize = o-ioff;\r\n\t\r\n\twUi(data, o, 0x06054b50); o+=4;\r\n\to += 4; // disks\r\n\twUs(data, o, i); o += 2;\r\n\twUs(data, o, i); o += 2;\t// number of c d records\r\n\twUi(data, o, csize); o += 4;\r\n\twUi(data, o, ioff ); o += 4;\r\n\to += 2;\r\n\treturn data.buffer;\r\n}\r\n// no need to compress .PNG, .ZIP, .JPEG ....\r\nUZIP._noNeed = function(fn) { var ext = fn.split(\".\").pop().toLowerCase(); return \"png,jpg,jpeg,zip\".indexOf(ext)!=-1; }\r\n\r\nUZIP._writeHeader = function(data, o, p, obj, t, roff)\r\n{\r\n\tvar wUi = UZIP.bin.writeUint, wUs = UZIP.bin.writeUshort;\r\n\tvar file = obj.file;\r\n\t\r\n\twUi(data, o, t==0 ? 0x04034b50 : 0x02014b50); o+=4; // sign\r\n\tif(t==1) o+=2; // ver made by\r\n\twUs(data, o, 20); o+=2;\t// ver\r\n\twUs(data, o, 0); o+=2; // gflip\r\n\twUs(data, o, obj.cpr?8:0); o+=2;\t// cmpr\r\n\t\t\r\n\twUi(data, o, 0); o+=4;\t// time\t\t\r\n\twUi(data, o, obj.crc); o+=4;\t// crc32\r\n\twUi(data, o, file.length); o+=4;\t// csize\r\n\twUi(data, o, obj.usize); o+=4;\t// usize\r\n\t\t\r\n\twUs(data, o, UZIP.bin.sizeUTF8(p)); o+=2;\t// nlen\r\n\twUs(data, o, 0); o+=2;\t// elen\r\n\t\r\n\tif(t==1) {\r\n\t\to += 2; // comment length\r\n\t\to += 2; // disk number\r\n\t\to += 6; // attributes\r\n\t\twUi(data, o, roff); o+=4;\t// usize\r\n\t}\r\n\tvar nlen = UZIP.bin.writeUTF8(data, o, p); o+= nlen;\t\r\n\tif(t==0) { data.set(file, o); o += file.length; }\r\n\treturn o;\r\n}\r\n\r\n\r\n\r\n\r\n\r\nUZIP.crc = {\r\n\ttable : ( function() {\r\n\t var tab = new Uint32Array(256);\r\n\t for (var n=0; n<256; n++) {\r\n\t\t\tvar c = n;\r\n\t\t\tfor (var k=0; k<8; k++) {\r\n\t\t\t\tif (c & 1) c = 0xedb88320 ^ (c >>> 1);\r\n\t\t\t\telse c = c >>> 1;\r\n\t\t\t}\r\n\t\t\ttab[n] = c; } \r\n\t\treturn tab; })(),\r\n\tupdate : function(c, buf, off, len) {\r\n\t\tfor (var i=0; i>> 8);\r\n\t\treturn c;\r\n\t},\r\n\tcrc : function(b,o,l) { return UZIP.crc.update(0xffffffff,b,o,l) ^ 0xffffffff; }\r\n}\r\nUZIP.adler = function(data,o,len) {\r\n\tvar a = 1, b = 0;\r\n\tvar off = o, end=o+len;\r\n\twhile(off>8)&255; },\r\n\treadUint : function(buff,p) { return (buff[p+3]*(256*256*256)) + ((buff[p+2]<<16) | (buff[p+1]<< 8) | buff[p]); },\r\n\twriteUint : function(buff,p,n){ buff[p]=n&255; buff[p+1]=(n>>8)&255; buff[p+2]=(n>>16)&255; buff[p+3]=(n>>24)&255; },\r\n\treadASCII : function(buff,p,l){ var s = \"\"; for(var i=0; i> 6)); buff[p+i+1] = (128|((code>> 0)&63)); i+=2; }\r\n\t\t\telse if((code&(0xffffffff-(1<<16)+1))==0) { buff[p+i] = (224|(code>>12)); buff[p+i+1] = (128|((code>> 6)&63)); buff[p+i+2] = (128|((code>>0)&63)); i+=3; }\r\n\t\t\telse if((code&(0xffffffff-(1<<21)+1))==0) { buff[p+i] = (240|(code>>18)); buff[p+i+1] = (128|((code>>12)&63)); buff[p+i+2] = (128|((code>>6)&63)); buff[p+i+3] = (128|((code>>0)&63)); i+=4; }\r\n\t\t\telse throw \"e\";\r\n\t\t}\r\n\t\treturn i;\r\n\t},\r\n\tsizeUTF8 : function(str) {\r\n\t\tvar strl = str.length, i=0;\r\n\t\tfor(var ci=0; ci>>3;\r\n\t}\r\n\r\n\tvar lits = U.lits, strt=U.strt, prev=U.prev, li=0, lc=0, bs=0, ebits=0, c=0, nc=0; // last_item, literal_count, block_start\r\n\tif(dlen>2) { nc=UZIP.F._hash(data,0); strt[nc]=0; }\r\n\tvar nmch=0,nmci=0;\r\n\t\r\n\tfor(i=0; i14000 || lc>26697) && (dlen-i)>100) {\r\n\t\t\t\tif(cvrd>>16)>>16)>(mch>>>16)) mch=0;\r\n\t\t\t}//*/\r\n\t\t\tvar len = mch>>>16, dst = mch&0xffff; //if(i-dst<0) throw \"e\";\r\n\t\t\tif(mch!=0) { \r\n\t\t\t\tvar len = mch>>>16, dst = mch&0xffff; //if(i-dst<0) throw \"e\";\r\n\t\t\t\tvar lgi = goodIndex(len, U.of0); U.lhst[257+lgi]++; \r\n\t\t\t\tvar dgi = goodIndex(dst, U.df0); U.dhst[ dgi]++; ebits += U.exb[lgi] + U.dxb[dgi]; \r\n\t\t\t\tlits[li] = (len<<23)|(i-cvrd); lits[li+1] = (dst<<16)|(lgi<<8)|dgi; li+=2;\r\n\t\t\t\tcvrd = i + len; \r\n\t\t\t}\r\n\t\t\telse {\tU.lhst[data[i]]++; }\r\n\t\t\tlc++;\r\n\t\t}\r\n\t}\r\n\tif(bs!=i || data.length==0) {\r\n\t\tif(cvrd>>3;\r\n}\r\nUZIP.F._bestMatch = function(data, i, prev, c, nice, chain) {\r\n\tvar ci = (i&0x7fff), pi=prev[ci]; \r\n\t//console.log(\"----\", i);\r\n\tvar dif = ((ci-pi + (1<<15)) & 0x7fff); if(pi==ci || c!=UZIP.F._hash(data,i-dif)) return 0;\r\n\tvar tl=0, td=0; // top length, top distance\r\n\tvar dlim = Math.min(0x7fff, i);\r\n\twhile(dif<=dlim && --chain!=0 && pi!=ci /*&& c==UZIP.F._hash(data,i-dif)*/) {\r\n\t\tif(tl==0 || (data[i+tl]==data[i+tl-dif])) {\r\n\t\t\tvar cl = UZIP.F._howLong(data, i, dif);\r\n\t\t\tif(cl>tl) { \r\n\t\t\t\ttl=cl; td=dif; if(tl>=nice) break; //* \r\n\t\t\t\tif(dif+2maxd) { maxd=curd; pi = ei; }\r\n\t\t\t\t} //*/\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tci=pi; pi = prev[ci];\r\n\t\tdif += ((ci-pi + (1<<15)) & 0x7fff);\r\n\t}\r\n\treturn (tl<<16)|td;\r\n}\r\nUZIP.F._howLong = function(data, i, dif) {\r\n\tif(data[i]!=data[i-dif] || data[i+1]!=data[i+1-dif] || data[i+2]!=data[i+2-dif]) return 0;\r\n\tvar oi=i, l = Math.min(data.length, i+258); i+=3;\r\n\t//while(i+4>>23), end = off+(qb&((1<<23)-1));\r\n\t\t\twhile(off>16), lgi=(qc>>8)&255, dgi=(qc&255);\r\n\t\t\t\tpos = UZIP.F._writeLit(257+lgi, ltree, out, pos);\r\n\t\t\t\tputsE(out, pos, len-U.of0[lgi]); pos+=U.exb[lgi];\r\n\t\t\t\t\r\n\t\t\t\tpos = UZIP.F._writeLit(dgi, dtree, out, pos);\r\n\t\t\t\tputsF(out, pos, dst-U.df0[dgi]); pos+=U.dxb[dgi]; off+=len;\r\n\t\t\t}\r\n\t\t}\r\n\t\tpos = UZIP.F._writeLit(256, ltree, out, pos);\r\n\t}\r\n\t//console.log(pos-opos, fxdSize, dynSize, cstSize);\r\n\treturn pos;\r\n}\r\nUZIP.F._copyExact = function(data,off,len,out,pos) {\r\n\tvar p8 = (pos>>>3);\r\n\tout[p8]=(len); out[p8+1]=(len>>>8); out[p8+2]=255-out[p8]; out[p8+3]=255-out[p8+1]; p8+=4;\r\n\tout.set(new Uint8Array(data.buffer, off, len), p8);\r\n\t//for(var i=0; i4 && U.itree[(U.ordr[numh-1]<<1)+1]==0) numh--;\r\n\treturn [ML, MD, MH, numl, numd, numh, lset, dset];\r\n}\r\nUZIP.F.getSecond= function(a) { var b=[]; for(var i=0; i>1)+\",\"; return b; }\r\nUZIP.F.contSize = function(tree, hst) { var s=0; for(var i=0; i15) { UZIP.F._putsE(out, pos, rst, rsl); pos+=rsl; }\r\n\t}\r\n\treturn pos;\r\n}\r\nUZIP.F._lenCodes = function(tree, set) {\r\n\tvar len=tree.length; while(len!=2 && tree[len-1]==0) len-=2; // when no distances, keep one code with length 0\r\n\tfor(var i=0; i>>1, 138);\r\n\t\t\tif(zc<11) set.push(17, zc-3);\r\n\t\t\telse set.push(18, zc-11);\r\n\t\t\ti += zc*2-2;\r\n\t\t}\r\n\t\telse if(l==prv && nxt==l && nnxt==l) {\r\n\t\t\tvar lz = i+5;\r\n\t\t\twhile(lz+2>>1, 6);\r\n\t\t\tset.push(16, zc-3);\r\n\t\t\ti += zc*2-2;\r\n\t\t}\r\n\t\telse set.push(l, 0);\r\n\t}\r\n\treturn len>>>1;\r\n}\r\nUZIP.F._hufTree = function(hst, tree, MAXL) {\r\n\tvar list=[], hl = hst.length, tl=tree.length, i=0;\r\n\tfor(i=0; iMAXL) { UZIP.F.restrictDepth(l2, MAXL, maxl); maxl = MAXL; }\r\n\tfor(i=0; iMD) { var od=dps[i].d; dps[i].d=MD; dbt+=bCost-(1<<(maxl-od)); } else break;\r\n\tdbt = dbt>>>(maxl-MD);\r\n\twhile(dbt>0) { var od=dps[i].d; if(od=0; i--) if(dps[i].d==MD && dbt<0) { dps[i].d--; dbt++; } if(dbt!=0) console.log(\"debt left\");\r\n}\r\n\r\nUZIP.F._goodIndex = function(v, arr) {\r\n\tvar i=0; if(arr[i|16]<=v) i|=16; if(arr[i|8]<=v) i|=8; if(arr[i|4]<=v) i|=4; if(arr[i|2]<=v) i|=2; if(arr[i|1]<=v) i|=1; return i;\r\n}\r\nUZIP.F._writeLit = function(ch, ltree, out, pos) {\r\n\tUZIP.F._putsF(out, pos, ltree[ch<<1]);\r\n\treturn pos+ltree[(ch<<1)+1];\r\n}\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\nUZIP.F.inflate = function(data, buf) {\r\n\tvar u8=Uint8Array;\r\n\tif(data[0]==3 && data[1]==0) return (buf ? buf : new u8(0));\r\n\tvar F=UZIP.F, bitsF = F._bitsF, bitsE = F._bitsE, decodeTiny = F._decodeTiny, makeCodes = F.makeCodes, codes2map=F.codes2map, get17 = F._get17;\r\n\tvar U = F.U;\r\n\t\r\n\tvar noBuf = (buf==null);\r\n\tif(noBuf) buf = new u8((data.length>>>2)<<3);\r\n\t\r\n\tvar BFINAL=0, BTYPE=0, HLIT=0, HDIST=0, HCLEN=0, ML=0, MD=0; \t\r\n\tvar off = 0, pos = 0;\r\n\tvar lmap, dmap;\r\n\t\r\n\twhile(BFINAL==0) {\t\t\r\n\t\tBFINAL = bitsF(data, pos , 1);\r\n\t\tBTYPE = bitsF(data, pos+1, 2); pos+=3;\r\n\t\t//console.log(BFINAL, BTYPE);\r\n\t\t\r\n\t\tif(BTYPE==0) {\r\n\t\t\tif((pos&7)!=0) pos+=8-(pos&7);\r\n\t\t\tvar p8 = (pos>>>3)+4, len = data[p8-4]|(data[p8-3]<<8); //console.log(len);//bitsF(data, pos, 16), \r\n\t\t\tif(noBuf) buf=UZIP.F._check(buf, off+len);\r\n\t\t\tbuf.set(new u8(data.buffer, data.byteOffset+p8, len), off);\r\n\t\t\t//for(var i=0; itl)tl=l; } pos+=3*HCLEN; //console.log(itree);\r\n\t\t\tmakeCodes(U.itree, tl);\r\n\t\t\tcodes2map(U.itree, tl, U.imap);\r\n\t\t\t\r\n\t\t\tlmap = U.lmap; dmap = U.dmap;\r\n\t\t\t\r\n\t\t\tpos = decodeTiny(U.imap, (1<>>24))-1; pos+=(ml&0xffffff);\r\n\t\t\tmakeCodes(U.ltree, mx0);\r\n\t\t\tcodes2map(U.ltree, mx0, lmap);\r\n\t\t\t\r\n\t\t\t//var md = decodeTiny(U.imap, (1<>>24))-1; pos+=(md&0xffffff);\r\n\t\t\tmakeCodes(U.dtree, mx1);\r\n\t\t\tcodes2map(U.dtree, mx1, dmap);\r\n\t\t}\r\n\t\t//var ooff=off, opos=pos;\r\n\t\twhile(true) {\r\n\t\t\tvar code = lmap[get17(data, pos) & ML]; pos += code&15;\r\n\t\t\tvar lit = code>>>4; //U.lhst[lit]++; \r\n\t\t\tif((lit>>>8)==0) { buf[off++] = lit; }\r\n\t\t\telse if(lit==256) { break; }\r\n\t\t\telse {\r\n\t\t\t\tvar end = off+lit-254;\r\n\t\t\t\tif(lit>264) { var ebs = U.ldef[lit-257]; end = off + (ebs>>>3) + bitsE(data, pos, ebs&7); pos += ebs&7; }\r\n\t\t\t\t//UZIP.F.dst[end-off]++;\r\n\t\t\t\t\r\n\t\t\t\tvar dcode = dmap[get17(data, pos) & MD]; pos += dcode&15;\r\n\t\t\t\tvar dlit = dcode>>>4;\r\n\t\t\t\tvar dbs = U.ddef[dlit], dst = (dbs>>>4) + bitsF(data, pos, dbs&15); pos += dbs&15;\r\n\t\t\t\t\r\n\t\t\t\t//var o0 = off-dst, stp = Math.min(end-off, dst);\r\n\t\t\t\t//if(stp>20) while(off>>3);\r\n\t}\r\n\t//console.log(UZIP.F.dst);\r\n\t//console.log(tlen, dlen, off-tlen+tcnt);\r\n\treturn buf.length==off ? buf : buf.slice(0,off);\r\n}\r\nUZIP.F._check=function(buf, len) {\r\n\tvar bl=buf.length; if(len<=bl) return buf;\r\n\tvar nbuf = new Uint8Array(Math.max(bl<<1,len)); nbuf.set(buf,0);\r\n\t//for(var i=0; i>>4; \r\n\t\tif(lit<=15) { tree[i]=lit; i++; }\r\n\t\telse {\r\n\t\t\tvar ll = 0, n = 0;\r\n\t\t\tif(lit==16) {\r\n\t\t\t\tn = (3 + bitsE(data, pos, 2)); pos += 2; ll = tree[i-1];\r\n\t\t\t}\r\n\t\t\telse if(lit==17) {\r\n\t\t\t\tn = (3 + bitsE(data, pos, 3)); pos += 3;\r\n\t\t\t}\r\n\t\t\telse if(lit==18) {\r\n\t\t\t\tn = (11 + bitsE(data, pos, 7)); pos += 7;\r\n\t\t\t}\r\n\t\t\tvar ni = i+n;\r\n\t\t\twhile(i>>1;\r\n\twhile(imx)mx=v; i++; }\r\n\twhile(i>1;\r\n\t\tvar cl = tree[i+1], val = (lit<<4)|cl; // : (0x8000 | (U.of0[lit-257]<<7) | (U.exb[lit-257]<<4) | cl);\r\n\t\tvar rest = (MAX_BITS-cl), i0 = tree[i]<>>(15-MAX_BITS);\r\n\t\twhile(i0!=i1) {\r\n\t\t\tvar p0 = r15[i0]>>>(15-MAX_BITS);\r\n\t\t\tmap[p0]=val; i0++;\r\n\t\t}\r\n\t}\r\n}\r\nUZIP.F.revCodes = function(tree, MAX_BITS) {\r\n\tvar r15 = UZIP.F.U.rev15, imb = 15-MAX_BITS;\r\n\tfor(var i=0; i>>imb; }\r\n}\r\n\r\n// used only in deflate\r\nUZIP.F._putsE= function(dt, pos, val ) { val = val<<(pos&7); var o=(pos>>>3); dt[o]|=val; dt[o+1]|=(val>>>8); }\r\nUZIP.F._putsF= function(dt, pos, val ) { val = val<<(pos&7); var o=(pos>>>3); dt[o]|=val; dt[o+1]|=(val>>>8); dt[o+2]|=(val>>>16); }\r\n\r\nUZIP.F._bitsE= function(dt, pos, length) { return ((dt[pos>>>3] | (dt[(pos>>>3)+1]<<8) )>>>(pos&7))&((1<>>3] | (dt[(pos>>>3)+1]<<8) | (dt[(pos>>>3)+2]<<16))>>>(pos&7))&((1<>>3] | (dt[(pos>>>3)+1]<<8))>>>(pos&7))&511;\r\n} */\r\nUZIP.F._get17= function(dt, pos) {\t// return at least 17 meaningful bytes\r\n\treturn (dt[pos>>>3] | (dt[(pos>>>3)+1]<<8) | (dt[(pos>>>3)+2]<<16) )>>>(pos&7);\r\n}\r\nUZIP.F._get25= function(dt, pos) {\t// return at least 17 meaningful bytes\r\n\treturn (dt[pos>>>3] | (dt[(pos>>>3)+1]<<8) | (dt[(pos>>>3)+2]<<16) | (dt[(pos>>>3)+3]<<24) )>>>(pos&7);\r\n}\r\nUZIP.F.U = function(){\r\n\tvar u16=Uint16Array, u32=Uint32Array;\r\n\treturn {\r\n\t\tnext_code : new u16(16),\r\n\t\tbl_count : new u16(16),\r\n\t\tordr : [ 16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15 ],\r\n\t\tof0 : [3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,999,999,999],\r\n\t\texb : [0,0,0,0,0,0,0, 0, 1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3, 4, 4, 4, 4, 5, 5, 5, 5, 0, 0, 0, 0],\r\n\t\tldef : new u16(32),\r\n\t\tdf0 : [1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577, 65535, 65535],\r\n\t\tdxb : [0,0,0,0,1,1,2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8, 9, 9, 10, 10, 11, 11, 12, 12, 13, 13, 0, 0],\r\n\t\tddef : new u32(32),\r\n\t\tflmap: new u16( 512), fltree: [],\r\n\t\tfdmap: new u16( 32), fdtree: [],\r\n\t\tlmap : new u16(32768), ltree : [], ttree:[],\r\n\t\tdmap : new u16(32768), dtree : [],\r\n\t\timap : new u16( 512), itree : [],\r\n\t\t//rev9 : new u16( 512)\r\n\t\trev15: new u16(1<<15),\r\n\t\tlhst : new u32(286), dhst : new u32( 30), ihst : new u32(19),\r\n\t\tlits : new u32(15000),\r\n\t\tstrt : new u16(1<<16),\r\n\t\tprev : new u16(1<<15)\r\n\t}; \r\n} ();\r\n\r\n(function(){\t\r\n\tvar U = UZIP.F.U;\r\n\tvar len = 1<<15;\r\n\tfor(var i=0; i>> 1) | ((x & 0x55555555) << 1));\r\n\t\tx = (((x & 0xcccccccc) >>> 2) | ((x & 0x33333333) << 2));\r\n\t\tx = (((x & 0xf0f0f0f0) >>> 4) | ((x & 0x0f0f0f0f) << 4));\r\n\t\tx = (((x & 0xff00ff00) >>> 8) | ((x & 0x00ff00ff) << 8));\r\n\t\tU.rev15[i] = (((x >>> 16) | (x << 16)))>>>17;\r\n\t}\r\n\t\r\n\tfunction pushV(tgt, n, sv) { while(n--!=0) tgt.push(0,sv); }\r\n\t\r\n\tfor(var i=0; i<32; i++) { U.ldef[i]=(U.of0[i]<<3)|U.exb[i]; U.ddef[i]=(U.df0[i]<<4)|U.dxb[i]; }\r\n\t\r\n\tpushV(U.fltree, 144, 8); pushV(U.fltree, 255-143, 9); pushV(U.fltree, 279-255, 7); pushV(U.fltree,287-279,8);\r\n\t/*\r\n\tvar i = 0;\r\n\tfor(; i<=143; i++) U.fltree.push(0,8);\r\n\tfor(; i<=255; i++) U.fltree.push(0,9);\r\n\tfor(; i<=279; i++) U.fltree.push(0,7);\r\n\tfor(; i<=287; i++) U.fltree.push(0,8);\r\n\t*/\r\n\tUZIP.F.makeCodes(U.fltree, 9);\r\n\tUZIP.F.codes2map(U.fltree, 9, U.flmap);\r\n\tUZIP.F.revCodes (U.fltree, 9)\r\n\t\r\n\tpushV(U.fdtree,32,5);\r\n\t//for(i=0;i<32; i++) U.fdtree.push(0,5);\r\n\tUZIP.F.makeCodes(U.fdtree, 5);\r\n\tUZIP.F.codes2map(U.fdtree, 5, U.fdmap);\r\n\tUZIP.F.revCodes (U.fdtree, 5)\r\n\t\r\n\tpushV(U.itree,19,0); pushV(U.ltree,286,0); pushV(U.dtree,30,0); pushV(U.ttree,320,0);\r\n\t/*\r\n\tfor(var i=0; i< 19; i++) U.itree.push(0,0);\r\n\tfor(var i=0; i<286; i++) U.ltree.push(0,0);\r\n\tfor(var i=0; i< 30; i++) U.dtree.push(0,0);\r\n\tfor(var i=0; i<320; i++) U.ttree.push(0,0);\r\n\t*/\r\n})()\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n","// https://github.com/photopea/UPNG.js/blob/c976240e62b0497167f8aafabd7889625f8b2016/UPNG.js\n\n// import * as pako from 'pako'\nimport * as UZIP from 'uzip';\n\nconst UPNG = {};\n\nUPNG.toRGBA8 = function (out) {\n const w = out.width; const\n h = out.height;\n if (out.tabs.acTL == null) return [UPNG.toRGBA8.decodeImage(out.data, w, h, out).buffer];\n\n const frms = [];\n if (out.frames[0].data == null) out.frames[0].data = out.data;\n\n const len = w * h * 4; const img = new Uint8Array(len); const empty = new Uint8Array(len); const\n prev = new Uint8Array(len);\n for (let i = 0; i < out.frames.length; i++) {\n const frm = out.frames[i];\n const fx = frm.rect.x; const fy = frm.rect.y; const fw = frm.rect.width; const\n fh = frm.rect.height;\n const fdata = UPNG.toRGBA8.decodeImage(frm.data, fw, fh, out);\n\n if (i != 0) for (var j = 0; j < len; j++) prev[j] = img[j];\n\n if (frm.blend == 0) UPNG._copyTile(fdata, fw, fh, img, w, h, fx, fy, 0);\n else if (frm.blend == 1) UPNG._copyTile(fdata, fw, fh, img, w, h, fx, fy, 1);\n\n frms.push(img.buffer.slice(0));\n\n if (frm.dispose == 0) {} else if (frm.dispose == 1) UPNG._copyTile(empty, fw, fh, img, w, h, fx, fy, 0);\n else if (frm.dispose == 2) for (var j = 0; j < len; j++) img[j] = prev[j];\n }\n return frms;\n};\nUPNG.toRGBA8.decodeImage = function (data, w, h, out) {\n const area = w * h; const\n bpp = UPNG.decode._getBPP(out);\n const bpl = Math.ceil(w * bpp / 8);\t// bytes per line\n\n const bf = new Uint8Array(area * 4); const\n bf32 = new Uint32Array(bf.buffer);\n const { ctype } = out;\n const { depth } = out;\n const rs = UPNG._bin.readUshort;\n\n // console.log(ctype, depth);\n const time = Date.now();\n\n if (ctype == 6) { // RGB + alpha\n const qarea = area << 2;\n if (depth == 8) for (var i = 0; i < qarea; i += 4) { bf[i] = data[i]; bf[i + 1] = data[i + 1]; bf[i + 2] = data[i + 2]; bf[i + 3] = data[i + 3]; }\n if (depth == 16) for (var i = 0; i < qarea; i++) { bf[i] = data[i << 1]; }\n } else if (ctype == 2) {\t// RGB\n const ts = out.tabs.tRNS;\n if (ts == null) {\n if (depth == 8) for (var i = 0; i < area; i++) { var ti = i * 3; bf32[i] = (255 << 24) | (data[ti + 2] << 16) | (data[ti + 1] << 8) | data[ti]; }\n if (depth == 16) for (var i = 0; i < area; i++) { var ti = i * 6; bf32[i] = (255 << 24) | (data[ti + 4] << 16) | (data[ti + 2] << 8) | data[ti]; }\n } else {\n var tr = ts[0]; const tg = ts[1]; const\n tb = ts[2];\n if (depth == 8) {\n for (var i = 0; i < area; i++) {\n var qi = i << 2; var\n ti = i * 3; bf32[i] = (255 << 24) | (data[ti + 2] << 16) | (data[ti + 1] << 8) | data[ti];\n if (data[ti] == tr && data[ti + 1] == tg && data[ti + 2] == tb) bf[qi + 3] = 0;\n }\n }\n if (depth == 16) {\n for (var i = 0; i < area; i++) {\n var qi = i << 2; var\n ti = i * 6; bf32[i] = (255 << 24) | (data[ti + 4] << 16) | (data[ti + 2] << 8) | data[ti];\n if (rs(data, ti) == tr && rs(data, ti + 2) == tg && rs(data, ti + 4) == tb) bf[qi + 3] = 0;\n }\n }\n }\n } else if (ctype == 3) {\t// palette\n const p = out.tabs.PLTE;\n const ap = out.tabs.tRNS;\n const tl = ap ? ap.length : 0;\n // console.log(p, ap);\n if (depth == 1) {\n for (var y = 0; y < h; y++) {\n var s0 = y * bpl; var\n t0 = y * w;\n for (var i = 0; i < w; i++) {\n var qi = (t0 + i) << 2; var j = ((data[s0 + (i >> 3)] >> (7 - ((i & 7) << 0))) & 1); var\n cj = 3 * j; bf[qi] = p[cj]; bf[qi + 1] = p[cj + 1]; bf[qi + 2] = p[cj + 2]; bf[qi + 3] = (j < tl) ? ap[j] : 255;\n }\n }\n }\n if (depth == 2) {\n for (var y = 0; y < h; y++) {\n var s0 = y * bpl; var\n t0 = y * w;\n for (var i = 0; i < w; i++) {\n var qi = (t0 + i) << 2; var j = ((data[s0 + (i >> 2)] >> (6 - ((i & 3) << 1))) & 3); var\n cj = 3 * j; bf[qi] = p[cj]; bf[qi + 1] = p[cj + 1]; bf[qi + 2] = p[cj + 2]; bf[qi + 3] = (j < tl) ? ap[j] : 255;\n }\n }\n }\n if (depth == 4) {\n for (var y = 0; y < h; y++) {\n var s0 = y * bpl; var\n t0 = y * w;\n for (var i = 0; i < w; i++) {\n var qi = (t0 + i) << 2; var j = ((data[s0 + (i >> 1)] >> (4 - ((i & 1) << 2))) & 15); var\n cj = 3 * j; bf[qi] = p[cj]; bf[qi + 1] = p[cj + 1]; bf[qi + 2] = p[cj + 2]; bf[qi + 3] = (j < tl) ? ap[j] : 255;\n }\n }\n }\n if (depth == 8) {\n for (var i = 0; i < area; i++) {\n var qi = i << 2; var j = data[i]; var\n cj = 3 * j; bf[qi] = p[cj]; bf[qi + 1] = p[cj + 1]; bf[qi + 2] = p[cj + 2]; bf[qi + 3] = (j < tl) ? ap[j] : 255;\n }\n }\n } else if (ctype == 4) {\t// gray + alpha\n if (depth == 8) {\n for (var i = 0; i < area; i++) {\n var qi = i << 2; var di = i << 1; var\n gr = data[di]; bf[qi] = gr; bf[qi + 1] = gr; bf[qi + 2] = gr; bf[qi + 3] = data[di + 1];\n }\n }\n if (depth == 16) {\n for (var i = 0; i < area; i++) {\n var qi = i << 2; var di = i << 2; var\n gr = data[di]; bf[qi] = gr; bf[qi + 1] = gr; bf[qi + 2] = gr; bf[qi + 3] = data[di + 2];\n }\n }\n } else if (ctype == 0) {\t// gray\n var tr = out.tabs.tRNS ? out.tabs.tRNS : -1;\n for (var y = 0; y < h; y++) {\n const off = y * bpl; const\n to = y * w;\n if (depth == 1) {\n for (var x = 0; x < w; x++) {\n var gr = 255 * ((data[off + (x >>> 3)] >>> (7 - ((x & 7)))) & 1); var\n al = (gr == tr * 255) ? 0 : 255; bf32[to + x] = (al << 24) | (gr << 16) | (gr << 8) | gr;\n }\n } else if (depth == 2) {\n for (var x = 0; x < w; x++) {\n var gr = 85 * ((data[off + (x >>> 2)] >>> (6 - ((x & 3) << 1))) & 3); var\n al = (gr == tr * 85) ? 0 : 255; bf32[to + x] = (al << 24) | (gr << 16) | (gr << 8) | gr;\n }\n } else if (depth == 4) {\n for (var x = 0; x < w; x++) {\n var gr = 17 * ((data[off + (x >>> 1)] >>> (4 - ((x & 1) << 2))) & 15); var\n al = (gr == tr * 17) ? 0 : 255; bf32[to + x] = (al << 24) | (gr << 16) | (gr << 8) | gr;\n }\n } else if (depth == 8) {\n for (var x = 0; x < w; x++) {\n var gr = data[off + x]; var\n al = (gr == tr) ? 0 : 255; bf32[to + x] = (al << 24) | (gr << 16) | (gr << 8) | gr;\n }\n } else if (depth == 16) {\n for (var x = 0; x < w; x++) {\n var gr = data[off + (x << 1)]; var\n al = (rs(data, off + (x << i)) == tr) ? 0 : 255; bf32[to + x] = (al << 24) | (gr << 16) | (gr << 8) | gr;\n }\n }\n }\n }\n // console.log(Date.now()-time);\n return bf;\n};\n\nUPNG.decode = function (buff) {\n const data = new Uint8Array(buff); let offset = 8; const bin = UPNG._bin; const rUs = bin.readUshort; const\n rUi = bin.readUint;\n const out = { tabs: {}, frames: [] };\n const dd = new Uint8Array(data.length); let\n doff = 0;\t // put all IDAT data into it\n let fd; let\n foff = 0;\t// frames\n\n const mgck = [0x89, 0x50, 0x4e, 0x47, 0x0d, 0x0a, 0x1a, 0x0a];\n for (var i = 0; i < 8; i++) if (data[i] != mgck[i]) throw 'The input is not a PNG file!';\n\n while (offset < data.length) {\n const len = bin.readUint(data, offset); offset += 4;\n const type = bin.readASCII(data, offset, 4); offset += 4;\n // console.log(type,len);\n\n if (type == 'IHDR') { UPNG.decode._IHDR(data, offset, out); } else if (type == 'CgBI') { out.tabs[type] = data.slice(offset, offset + 4); } else if (type == 'IDAT') {\n for (var i = 0; i < len; i++) dd[doff + i] = data[offset + i];\n doff += len;\n } else if (type == 'acTL') {\n out.tabs[type] = { num_frames: rUi(data, offset), num_plays: rUi(data, offset + 4) };\n fd = new Uint8Array(data.length);\n } else if (type == 'fcTL') {\n if (foff != 0) {\n var fr = out.frames[out.frames.length - 1];\n fr.data = UPNG.decode._decompress(out, fd.slice(0, foff), fr.rect.width, fr.rect.height); foff = 0;\n }\n const rct = {\n x: rUi(data, offset + 12), y: rUi(data, offset + 16), width: rUi(data, offset + 4), height: rUi(data, offset + 8),\n };\n let del = rUs(data, offset + 22); del = rUs(data, offset + 20) / (del == 0 ? 100 : del);\n const frm = {\n rect: rct, delay: Math.round(del * 1000), dispose: data[offset + 24], blend: data[offset + 25],\n };\n // console.log(frm);\n out.frames.push(frm);\n } else if (type == 'fdAT') {\n for (var i = 0; i < len - 4; i++) fd[foff + i] = data[offset + i + 4];\n foff += len - 4;\n } else if (type == 'pHYs') {\n out.tabs[type] = [bin.readUint(data, offset), bin.readUint(data, offset + 4), data[offset + 8]];\n } else if (type == 'cHRM') {\n out.tabs[type] = [];\n for (var i = 0; i < 8; i++) out.tabs[type].push(bin.readUint(data, offset + i * 4));\n } else if (type == 'tEXt' || type == 'zTXt') {\n if (out.tabs[type] == null) out.tabs[type] = {};\n var nz = bin.nextZero(data, offset);\n var keyw = bin.readASCII(data, offset, nz - offset);\n var text; var\n tl = offset + len - nz - 1;\n if (type == 'tEXt') text = bin.readASCII(data, nz + 1, tl);\n else {\n var bfr = UPNG.decode._inflate(data.slice(nz + 2, nz + 2 + tl));\n text = bin.readUTF8(bfr, 0, bfr.length);\n }\n out.tabs[type][keyw] = text;\n } else if (type == 'iTXt') {\n if (out.tabs[type] == null) out.tabs[type] = {};\n var nz = 0; let\n off = offset;\n nz = bin.nextZero(data, off);\n var keyw = bin.readASCII(data, off, nz - off); off = nz + 1;\n const cflag = data[off]; const\n cmeth = data[off + 1]; off += 2;\n nz = bin.nextZero(data, off);\n const ltag = bin.readASCII(data, off, nz - off); off = nz + 1;\n nz = bin.nextZero(data, off);\n const tkeyw = bin.readUTF8(data, off, nz - off); off = nz + 1;\n var text; var\n tl = len - (off - offset);\n if (cflag == 0) text = bin.readUTF8(data, off, tl);\n else {\n var bfr = UPNG.decode._inflate(data.slice(off, off + tl));\n text = bin.readUTF8(bfr, 0, bfr.length);\n }\n out.tabs[type][keyw] = text;\n } else if (type == 'PLTE') {\n out.tabs[type] = bin.readBytes(data, offset, len);\n } else if (type == 'hIST') {\n const pl = out.tabs.PLTE.length / 3;\n out.tabs[type] = []; for (var i = 0; i < pl; i++) out.tabs[type].push(rUs(data, offset + i * 2));\n } else if (type == 'tRNS') {\n if (out.ctype == 3) out.tabs[type] = bin.readBytes(data, offset, len);\n else if (out.ctype == 0) out.tabs[type] = rUs(data, offset);\n else if (out.ctype == 2) out.tabs[type] = [rUs(data, offset), rUs(data, offset + 2), rUs(data, offset + 4)];\n // else console.log(\"tRNS for unsupported color type\",out.ctype, len);\n } else if (type == 'gAMA') out.tabs[type] = bin.readUint(data, offset) / 100000;\n else if (type == 'sRGB') out.tabs[type] = data[offset];\n else if (type == 'bKGD') {\n if (out.ctype == 0 || out.ctype == 4) out.tabs[type] = [rUs(data, offset)];\n else if (out.ctype == 2 || out.ctype == 6) out.tabs[type] = [rUs(data, offset), rUs(data, offset + 2), rUs(data, offset + 4)];\n else if (out.ctype == 3) out.tabs[type] = data[offset];\n } else if (type == 'IEND') {\n break;\n }\n // else { log(\"unknown chunk type\", type, len); }\n offset += len;\n const crc = bin.readUint(data, offset); offset += 4;\n }\n if (foff != 0) {\n var fr = out.frames[out.frames.length - 1];\n fr.data = UPNG.decode._decompress(out, fd.slice(0, foff), fr.rect.width, fr.rect.height); foff = 0;\n }\n out.data = UPNG.decode._decompress(out, dd, out.width, out.height);\n\n delete out.compress; delete out.interlace; delete out.filter;\n return out;\n};\n\nUPNG.decode._decompress = function (out, dd, w, h) {\n var time = Date.now();\n const bpp = UPNG.decode._getBPP(out); const bpl = Math.ceil(w * bpp / 8); const\n buff = new Uint8Array((bpl + 1 + out.interlace) * h);\n if (out.tabs.CgBI) dd = UPNG.inflateRaw(dd, buff);\n else dd = UPNG.decode._inflate(dd, buff);\n // console.log(dd.length, buff.length);\n // console.log(Date.now()-time);\n\n var time = Date.now();\n if (out.interlace == 0) dd = UPNG.decode._filterZero(dd, out, 0, w, h);\n else if (out.interlace == 1) dd = UPNG.decode._readInterlace(dd, out);\n // console.log(Date.now()-time);\n return dd;\n};\n\nUPNG.decode._inflate = function (data, buff) { const out = UPNG.inflateRaw(new Uint8Array(data.buffer, 2, data.length - 6), buff); return out; };\nUPNG.inflateRaw = (function () {\n const H = {}; H.H = {}; H.H.N = function (N, W) {\n const R = Uint8Array; let i = 0; let m = 0; let J = 0; let h = 0; let Q = 0; let X = 0; let u = 0; let w = 0; let d = 0; let v; let C;\n if (N[0] == 3 && N[1] == 0) return W || new R(0); const V = H.H; const n = V.b; const A = V.e; const l = V.R; const M = V.n; const I = V.A; const e = V.Z; const b = V.m; const Z = W == null;\n if (Z)W = new R(N.length >>> 2 << 5); while (i == 0) {\n i = n(N, d, 1); m = n(N, d + 1, 2); d += 3; if (m == 0) {\n if ((d & 7) != 0)d += 8 - (d & 7);\n const D = (d >>> 3) + 4; const q = N[D - 4] | N[D - 3] << 8; if (Z)W = H.H.W(W, w + q); W.set(new R(N.buffer, N.byteOffset + D, q), w); d = D + q << 3;\n w += q; continue;\n } if (Z)W = H.H.W(W, w + (1 << 17)); if (m == 1) { v = b.J; C = b.h; X = (1 << 9) - 1; u = (1 << 5) - 1; } if (m == 2) {\n J = A(N, d, 5) + 257;\n h = A(N, d + 5, 5) + 1; Q = A(N, d + 10, 4) + 4; d += 14; const E = d; let j = 1; for (var c = 0; c < 38; c += 2) { b.Q[c] = 0; b.Q[c + 1] = 0; } for (var c = 0;\n c < Q; c++) { const K = A(N, d + c * 3, 3); b.Q[(b.X[c] << 1) + 1] = K; if (K > j)j = K; }d += 3 * Q; M(b.Q, j); I(b.Q, j, b.u); v = b.w; C = b.d;\n d = l(b.u, (1 << j) - 1, J + h, N, d, b.v); const r = V.V(b.v, 0, J, b.C); X = (1 << r) - 1; const S = V.V(b.v, J, h, b.D); u = (1 << S) - 1; M(b.C, r);\n I(b.C, r, v); M(b.D, S); I(b.D, S, C);\n } while (!0) {\n const T = v[e(N, d) & X]; d += T & 15; const p = T >>> 4; if (p >>> 8 == 0) { W[w++] = p; } else if (p == 256) { break; } else {\n let z = w + p - 254;\n if (p > 264) { const _ = b.q[p - 257]; z = w + (_ >>> 3) + A(N, d, _ & 7); d += _ & 7; } const $ = C[e(N, d) & u]; d += $ & 15; const s = $ >>> 4; const Y = b.c[s]; const a = (Y >>> 4) + n(N, d, Y & 15);\n d += Y & 15; while (w < z) { W[w] = W[w++ - a]; W[w] = W[w++ - a]; W[w] = W[w++ - a]; W[w] = W[w++ - a]; }w = z;\n }\n }\n } return W.length == w ? W : W.slice(0, w);\n };\n H.H.W = function (N, W) { const R = N.length; if (W <= R) return N; const V = new Uint8Array(R << 1); V.set(N, 0); return V; };\n H.H.R = function (N, W, R, V, n, A) {\n const l = H.H.e; const M = H.H.Z; let I = 0; while (I < R) {\n const e = N[M(V, n) & W]; n += e & 15; const b = e >>> 4;\n if (b <= 15) { A[I] = b; I++; } else {\n let Z = 0; let m = 0; if (b == 16) { m = 3 + l(V, n, 2); n += 2; Z = A[I - 1]; } else if (b == 17) {\n m = 3 + l(V, n, 3);\n n += 3;\n } else if (b == 18) { m = 11 + l(V, n, 7); n += 7; } const J = I + m; while (I < J) { A[I] = Z; I++; }\n }\n } return n;\n }; H.H.V = function (N, W, R, V) {\n let n = 0; let A = 0; const l = V.length >>> 1;\n while (A < R) { const M = N[A + W]; V[A << 1] = 0; V[(A << 1) + 1] = M; if (M > n)n = M; A++; } while (A < l) { V[A << 1] = 0; V[(A << 1) + 1] = 0; A++; } return n;\n };\n H.H.n = function (N, W) {\n const R = H.H.m; const V = N.length; let n; let A; let l; var M; let I; const e = R.j; for (var M = 0; M <= W; M++)e[M] = 0; for (M = 1; M < V; M += 2)e[N[M]]++;\n const b = R.K; n = 0; e[0] = 0; for (A = 1; A <= W; A++) { n = n + e[A - 1] << 1; b[A] = n; } for (l = 0; l < V; l += 2) {\n I = N[l + 1]; if (I != 0) {\n N[l] = b[I];\n b[I]++;\n }\n }\n }; H.H.A = function (N, W, R) {\n const V = N.length; const n = H.H.m; const A = n.r; for (let l = 0; l < V; l += 2) {\n if (N[l + 1] != 0) {\n const M = l >> 1; const I = N[l + 1]; const e = M << 4 | I; const b = W - I; let Z = N[l] << b; const m = Z + (1 << b);\n while (Z != m) { const J = A[Z] >>> 15 - W; R[J] = e; Z++; }\n }\n }\n }; H.H.l = function (N, W) {\n const R = H.H.m.r; const V = 15 - W; for (let n = 0; n < N.length;\n n += 2) { const A = N[n] << W - N[n + 1]; N[n] = R[A] >>> V; }\n }; H.H.M = function (N, W, R) { R <<= (W & 7); const V = W >>> 3; N[V] |= R; N[V + 1] |= R >>> 8; };\n H.H.I = function (N, W, R) { R <<= (W & 7); const V = W >>> 3; N[V] |= R; N[V + 1] |= R >>> 8; N[V + 2] |= R >>> 16; }; H.H.e = function (N, W, R) { return (N[W >>> 3] | N[(W >>> 3) + 1] << 8) >>> (W & 7) & (1 << R) - 1; };\n H.H.b = function (N, W, R) { return (N[W >>> 3] | N[(W >>> 3) + 1] << 8 | N[(W >>> 3) + 2] << 16) >>> (W & 7) & (1 << R) - 1; }; H.H.Z = function (N, W) { return (N[W >>> 3] | N[(W >>> 3) + 1] << 8 | N[(W >>> 3) + 2] << 16) >>> (W & 7); };\n H.H.i = function (N, W) { return (N[W >>> 3] | N[(W >>> 3) + 1] << 8 | N[(W >>> 3) + 2] << 16 | N[(W >>> 3) + 3] << 24) >>> (W & 7); }; H.H.m = (function () {\n const N = Uint16Array; const W = Uint32Array;\n return {\n K: new N(16), j: new N(16), X: [16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15], S: [3, 4, 5, 6, 7, 8, 9, 10, 11, 13, 15, 17, 19, 23, 27, 31, 35, 43, 51, 59, 67, 83, 99, 115, 131, 163, 195, 227, 258, 999, 999, 999], T: [0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3, 4, 4, 4, 4, 5, 5, 5, 5, 0, 0, 0, 0], q: new N(32), p: [1, 2, 3, 4, 5, 7, 9, 13, 17, 25, 33, 49, 65, 97, 129, 193, 257, 385, 513, 769, 1025, 1537, 2049, 3073, 4097, 6145, 8193, 12289, 16385, 24577, 65535, 65535], z: [0, 0, 0, 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8, 9, 9, 10, 10, 11, 11, 12, 12, 13, 13, 0, 0], c: new W(32), J: new N(512), _: [], h: new N(32), $: [], w: new N(32768), C: [], v: [], d: new N(32768), D: [], u: new N(512), Q: [], r: new N(1 << 15), s: new W(286), Y: new W(30), a: new W(19), t: new W(15e3), k: new N(1 << 16), g: new N(1 << 15),\n };\n }());\n (function () {\n const N = H.H.m; const W = 1 << 15; for (var R = 0; R < W; R++) {\n let V = R; V = (V & 2863311530) >>> 1 | (V & 1431655765) << 1;\n V = (V & 3435973836) >>> 2 | (V & 858993459) << 2; V = (V & 4042322160) >>> 4 | (V & 252645135) << 4; V = (V & 4278255360) >>> 8 | (V & 16711935) << 8;\n N.r[R] = (V >>> 16 | V << 16) >>> 17;\n } function n(A, l, M) { while (l-- != 0)A.push(0, M); } for (var R = 0; R < 32; R++) {\n N.q[R] = N.S[R] << 3 | N.T[R];\n N.c[R] = N.p[R] << 4 | N.z[R];\n }n(N._, 144, 8); n(N._, 255 - 143, 9); n(N._, 279 - 255, 7); n(N._, 287 - 279, 8); H.H.n(N._, 9);\n H.H.A(N._, 9, N.J); H.H.l(N._, 9); n(N.$, 32, 5); H.H.n(N.$, 5); H.H.A(N.$, 5, N.h); H.H.l(N.$, 5); n(N.Q, 19, 0); n(N.C, 286, 0);\n n(N.D, 30, 0); n(N.v, 320, 0);\n }()); return H.H.N;\n}());\n\nUPNG.decode._readInterlace = function (data, out) {\n const w = out.width; const\n h = out.height;\n const bpp = UPNG.decode._getBPP(out); const cbpp = bpp >> 3; const\n bpl = Math.ceil(w * bpp / 8);\n const img = new Uint8Array(h * bpl);\n let di = 0;\n\n const starting_row = [0, 0, 4, 0, 2, 0, 1];\n const starting_col = [0, 4, 0, 2, 0, 1, 0];\n const row_increment = [8, 8, 8, 4, 4, 2, 2];\n const col_increment = [8, 8, 4, 4, 2, 2, 1];\n\n let pass = 0;\n while (pass < 7) {\n const ri = row_increment[pass]; const\n ci = col_increment[pass];\n let sw = 0; let\n sh = 0;\n let cr = starting_row[pass]; while (cr < h) { cr += ri; sh++; }\n let cc = starting_col[pass]; while (cc < w) { cc += ci; sw++; }\n const bpll = Math.ceil(sw * bpp / 8);\n UPNG.decode._filterZero(data, out, di, sw, sh);\n\n let y = 0; let\n row = starting_row[pass];\n while (row < h) {\n let col = starting_col[pass];\n let cdi = (di + y * bpll) << 3;\n\n while (col < w) {\n if (bpp == 1) {\n var val = data[cdi >> 3]; val = (val >> (7 - (cdi & 7))) & 1;\n img[row * bpl + (col >> 3)] |= (val << (7 - ((col & 7) << 0)));\n }\n if (bpp == 2) {\n var val = data[cdi >> 3]; val = (val >> (6 - (cdi & 7))) & 3;\n img[row * bpl + (col >> 2)] |= (val << (6 - ((col & 3) << 1)));\n }\n if (bpp == 4) {\n var val = data[cdi >> 3]; val = (val >> (4 - (cdi & 7))) & 15;\n img[row * bpl + (col >> 1)] |= (val << (4 - ((col & 1) << 2)));\n }\n if (bpp >= 8) {\n const ii = row * bpl + col * cbpp;\n for (let j = 0; j < cbpp; j++) img[ii + j] = data[(cdi >> 3) + j];\n }\n cdi += bpp; col += ci;\n }\n y++; row += ri;\n }\n if (sw * sh != 0) di += sh * (1 + bpll);\n pass += 1;\n }\n return img;\n};\n\nUPNG.decode._getBPP = function (out) {\n const noc = [1, null, 3, 1, 2, null, 4][out.ctype];\n return noc * out.depth;\n};\n\nUPNG.decode._filterZero = function (data, out, off, w, h) {\n let bpp = UPNG.decode._getBPP(out); const bpl = Math.ceil(w * bpp / 8); const\n paeth = UPNG.decode._paeth;\n bpp = Math.ceil(bpp / 8);\n\n let i = 0; let di = 1; let type = data[off]; let\n x = 0;\n\n if (type > 1) data[off] = [0, 0, 1][type - 2];\n if (type == 3) for (x = bpp; x < bpl; x++) data[x + 1] = (data[x + 1] + (data[x + 1 - bpp] >>> 1)) & 255;\n\n for (let y = 0; y < h; y++) {\n i = off + y * bpl; di = i + y + 1;\n type = data[di - 1]; x = 0;\n\n if (type == 0) for (; x < bpl; x++) data[i + x] = data[di + x];\n else if (type == 1) {\n for (; x < bpp; x++) data[i + x] = data[di + x];\n for (; x < bpl; x++) data[i + x] = (data[di + x] + data[i + x - bpp]);\n } else if (type == 2) { for (; x < bpl; x++) data[i + x] = (data[di + x] + data[i + x - bpl]); } else if (type == 3) {\n for (; x < bpp; x++) data[i + x] = (data[di + x] + (data[i + x - bpl] >>> 1));\n for (; x < bpl; x++) data[i + x] = (data[di + x] + ((data[i + x - bpl] + data[i + x - bpp]) >>> 1));\n } else {\n for (; x < bpp; x++) data[i + x] = (data[di + x] + paeth(0, data[i + x - bpl], 0));\n for (; x < bpl; x++) data[i + x] = (data[di + x] + paeth(data[i + x - bpp], data[i + x - bpl], data[i + x - bpp - bpl]));\n }\n }\n return data;\n};\n\nUPNG.decode._paeth = function (a, b, c) {\n const p = a + b - c; const pa = (p - a); const pb = (p - b); const\n pc = (p - c);\n if (pa * pa <= pb * pb && pa * pa <= pc * pc) return a;\n if (pb * pb <= pc * pc) return b;\n return c;\n};\n\nUPNG.decode._IHDR = function (data, offset, out) {\n const bin = UPNG._bin;\n out.width = bin.readUint(data, offset); offset += 4;\n out.height = bin.readUint(data, offset); offset += 4;\n out.depth = data[offset]; offset++;\n out.ctype = data[offset]; offset++;\n out.compress = data[offset]; offset++;\n out.filter = data[offset]; offset++;\n out.interlace = data[offset]; offset++;\n};\n\nUPNG._bin = {\n nextZero(data, p) { while (data[p] != 0) p++; return p; },\n readUshort(buff, p) { return (buff[p] << 8) | buff[p + 1]; },\n writeUshort(buff, p, n) { buff[p] = (n >> 8) & 255; buff[p + 1] = n & 255; },\n readUint(buff, p) { return (buff[p] * (256 * 256 * 256)) + ((buff[p + 1] << 16) | (buff[p + 2] << 8) | buff[p + 3]); },\n writeUint(buff, p, n) { buff[p] = (n >> 24) & 255; buff[p + 1] = (n >> 16) & 255; buff[p + 2] = (n >> 8) & 255; buff[p + 3] = n & 255; },\n readASCII(buff, p, l) { let s = ''; for (let i = 0; i < l; i++) s += String.fromCharCode(buff[p + i]); return s; },\n writeASCII(data, p, s) { for (let i = 0; i < s.length; i++) data[p + i] = s.charCodeAt(i); },\n readBytes(buff, p, l) { const arr = []; for (let i = 0; i < l; i++) arr.push(buff[p + i]); return arr; },\n pad(n) { return n.length < 2 ? `0${n}` : n; },\n readUTF8(buff, p, l) {\n let s = '';\n let ns;\n for (let i = 0; i < l; i++) s += `%${UPNG._bin.pad(buff[p + i].toString(16))}`;\n try { ns = decodeURIComponent(s); } catch (e) { return UPNG._bin.readASCII(buff, p, l); }\n return ns;\n },\n};\nUPNG._copyTile = function (sb, sw, sh, tb, tw, th, xoff, yoff, mode) {\n const w = Math.min(sw, tw); const\n h = Math.min(sh, th);\n let si = 0; let\n ti = 0;\n for (let y = 0; y < h; y++) {\n for (let x = 0; x < w; x++) {\n if (xoff >= 0 && yoff >= 0) { si = (y * sw + x) << 2; ti = ((yoff + y) * tw + xoff + x) << 2; } else { si = ((-yoff + y) * sw - xoff + x) << 2; ti = (y * tw + x) << 2; }\n\n if (mode == 0) { tb[ti] = sb[si]; tb[ti + 1] = sb[si + 1]; tb[ti + 2] = sb[si + 2]; tb[ti + 3] = sb[si + 3]; } else if (mode == 1) {\n var fa = sb[si + 3] * (1 / 255); var fr = sb[si] * fa; var fg = sb[si + 1] * fa; var\n fb = sb[si + 2] * fa;\n var ba = tb[ti + 3] * (1 / 255); var br = tb[ti] * ba; var bg = tb[ti + 1] * ba; var\n bb = tb[ti + 2] * ba;\n\n const ifa = 1 - fa; const oa = fa + ba * ifa; const\n ioa = (oa == 0 ? 0 : 1 / oa);\n tb[ti + 3] = 255 * oa;\n tb[ti + 0] = (fr + br * ifa) * ioa;\n tb[ti + 1] = (fg + bg * ifa) * ioa;\n tb[ti + 2] = (fb + bb * ifa) * ioa;\n } else if (mode == 2) {\t// copy only differences, otherwise zero\n var fa = sb[si + 3]; var fr = sb[si]; var fg = sb[si + 1]; var\n fb = sb[si + 2];\n var ba = tb[ti + 3]; var br = tb[ti]; var bg = tb[ti + 1]; var\n bb = tb[ti + 2];\n if (fa == ba && fr == br && fg == bg && fb == bb) { tb[ti] = 0; tb[ti + 1] = 0; tb[ti + 2] = 0; tb[ti + 3] = 0; } else { tb[ti] = fr; tb[ti + 1] = fg; tb[ti + 2] = fb; tb[ti + 3] = fa; }\n } else if (mode == 3) {\t// check if can be blended\n var fa = sb[si + 3]; var fr = sb[si]; var fg = sb[si + 1]; var\n fb = sb[si + 2];\n var ba = tb[ti + 3]; var br = tb[ti]; var bg = tb[ti + 1]; var\n bb = tb[ti + 2];\n if (fa == ba && fr == br && fg == bg && fb == bb) continue;\n // if(fa!=255 && ba!=0) return false;\n if (fa < 220 && ba > 20) return false;\n }\n }\n }\n return true;\n};\n\nUPNG.encode = function (bufs, w, h, ps, dels, tabs, forbidPlte) {\n if (ps == null) ps = 0;\n if (forbidPlte == null) forbidPlte = false;\n\n const nimg = UPNG.encode.compress(bufs, w, h, ps, [false, false, false, 0, forbidPlte]);\n UPNG.encode.compressPNG(nimg, -1);\n\n return UPNG.encode._main(nimg, w, h, dels, tabs);\n};\n\nUPNG.encodeLL = function (bufs, w, h, cc, ac, depth, dels, tabs) {\n const nimg = { ctype: 0 + (cc == 1 ? 0 : 2) + (ac == 0 ? 0 : 4), depth, frames: [] };\n\n const time = Date.now();\n const bipp = (cc + ac) * depth; const\n bipl = bipp * w;\n for (let i = 0; i < bufs.length; i++) {\n nimg.frames.push({\n rect: {\n x: 0, y: 0, width: w, height: h,\n },\n img: new Uint8Array(bufs[i]),\n blend: 0,\n dispose: 1,\n bpp: Math.ceil(bipp / 8),\n bpl: Math.ceil(bipl / 8),\n });\n }\n\n UPNG.encode.compressPNG(nimg, 0, true);\n\n const out = UPNG.encode._main(nimg, w, h, dels, tabs);\n return out;\n};\n\nUPNG.encode._main = function (nimg, w, h, dels, tabs) {\n if (tabs == null) tabs = {};\n const { crc } = UPNG.crc;\n const wUi = UPNG._bin.writeUint;\n const wUs = UPNG._bin.writeUshort;\n const wAs = UPNG._bin.writeASCII;\n let offset = 8; const anim = nimg.frames.length > 1; let\n pltAlpha = false;\n\n let leng = 8 + (16 + 5 + 4) /* + (9+4) */ + (anim ? 20 : 0);\n if (tabs.sRGB != null) leng += 8 + 1 + 4;\n if (tabs.pHYs != null) leng += 8 + 9 + 4;\n if (nimg.ctype == 3) {\n var dl = nimg.plte.length;\n for (var i = 0; i < dl; i++) if ((nimg.plte[i] >>> 24) != 255) pltAlpha = true;\n leng += (8 + dl * 3 + 4) + (pltAlpha ? (8 + dl * 1 + 4) : 0);\n }\n for (var j = 0; j < nimg.frames.length; j++) {\n var fr = nimg.frames[j];\n if (anim) leng += 38;\n leng += fr.cimg.length + 12;\n if (j != 0) leng += 4;\n }\n leng += 12;\n\n const data = new Uint8Array(leng);\n const wr = [0x89, 0x50, 0x4e, 0x47, 0x0d, 0x0a, 0x1a, 0x0a];\n for (var i = 0; i < 8; i++) data[i] = wr[i];\n\n wUi(data, offset, 13); offset += 4;\n wAs(data, offset, 'IHDR'); offset += 4;\n wUi(data, offset, w); offset += 4;\n wUi(data, offset, h); offset += 4;\n data[offset] = nimg.depth; offset++; // depth\n data[offset] = nimg.ctype; offset++; // ctype\n data[offset] = 0; offset++; // compress\n data[offset] = 0; offset++; // filter\n data[offset] = 0; offset++; // interlace\n wUi(data, offset, crc(data, offset - 17, 17)); offset += 4; // crc\n\n // 13 bytes to say, that it is sRGB\n if (tabs.sRGB != null) {\n wUi(data, offset, 1); offset += 4;\n wAs(data, offset, 'sRGB'); offset += 4;\n data[offset] = tabs.sRGB; offset++;\n wUi(data, offset, crc(data, offset - 5, 5)); offset += 4; // crc\n }\n if (tabs.pHYs != null) {\n wUi(data, offset, 9); offset += 4;\n wAs(data, offset, 'pHYs'); offset += 4;\n wUi(data, offset, tabs.pHYs[0]); offset += 4;\n wUi(data, offset, tabs.pHYs[1]); offset += 4;\n data[offset] = tabs.pHYs[2];\t\t\toffset++;\n wUi(data, offset, crc(data, offset - 13, 13)); offset += 4; // crc\n }\n\n if (anim) {\n wUi(data, offset, 8); offset += 4;\n wAs(data, offset, 'acTL'); offset += 4;\n wUi(data, offset, nimg.frames.length); offset += 4;\n wUi(data, offset, tabs.loop != null ? tabs.loop : 0); offset += 4;\n wUi(data, offset, crc(data, offset - 12, 12)); offset += 4; // crc\n }\n\n if (nimg.ctype == 3) {\n var dl = nimg.plte.length;\n wUi(data, offset, dl * 3); offset += 4;\n wAs(data, offset, 'PLTE'); offset += 4;\n for (var i = 0; i < dl; i++) {\n const ti = i * 3; const c = nimg.plte[i]; const r = (c) & 255; const g = (c >>> 8) & 255; const\n b = (c >>> 16) & 255;\n data[offset + ti + 0] = r; data[offset + ti + 1] = g; data[offset + ti + 2] = b;\n }\n offset += dl * 3;\n wUi(data, offset, crc(data, offset - dl * 3 - 4, dl * 3 + 4)); offset += 4; // crc\n\n if (pltAlpha) {\n wUi(data, offset, dl); offset += 4;\n wAs(data, offset, 'tRNS'); offset += 4;\n for (var i = 0; i < dl; i++) data[offset + i] = (nimg.plte[i] >>> 24) & 255;\n offset += dl;\n wUi(data, offset, crc(data, offset - dl - 4, dl + 4)); offset += 4; // crc\n }\n }\n\n let fi = 0;\n for (var j = 0; j < nimg.frames.length; j++) {\n var fr = nimg.frames[j];\n if (anim) {\n wUi(data, offset, 26); offset += 4;\n wAs(data, offset, 'fcTL'); offset += 4;\n wUi(data, offset, fi++); offset += 4;\n wUi(data, offset, fr.rect.width); offset += 4;\n wUi(data, offset, fr.rect.height); offset += 4;\n wUi(data, offset, fr.rect.x); offset += 4;\n wUi(data, offset, fr.rect.y); offset += 4;\n wUs(data, offset, dels[j]); offset += 2;\n wUs(data, offset, 1000); offset += 2;\n data[offset] = fr.dispose; offset++;\t// dispose\n data[offset] = fr.blend; offset++;\t// blend\n wUi(data, offset, crc(data, offset - 30, 30)); offset += 4; // crc\n }\n\n const imgd = fr.cimg; var\n dl = imgd.length;\n wUi(data, offset, dl + (j == 0 ? 0 : 4)); offset += 4;\n const ioff = offset;\n wAs(data, offset, (j == 0) ? 'IDAT' : 'fdAT'); offset += 4;\n if (j != 0) { wUi(data, offset, fi++); offset += 4; }\n data.set(imgd, offset);\n offset += dl;\n wUi(data, offset, crc(data, ioff, offset - ioff)); offset += 4; // crc\n }\n\n wUi(data, offset, 0); offset += 4;\n wAs(data, offset, 'IEND'); offset += 4;\n wUi(data, offset, crc(data, offset - 4, 4)); offset += 4; // crc\n\n return data.buffer;\n};\n\nUPNG.encode.compressPNG = function (out, filter, levelZero) {\n for (let i = 0; i < out.frames.length; i++) {\n const frm = out.frames[i]; const nw = frm.rect.width; const\n nh = frm.rect.height;\n const fdata = new Uint8Array(nh * frm.bpl + nh);\n frm.cimg = UPNG.encode._filterZero(frm.img, nh, frm.bpp, frm.bpl, fdata, filter, levelZero);\n }\n};\n\nUPNG.encode.compress = function (bufs, w, h, ps, prms) // prms: onlyBlend, minBits, forbidPlte\n{\n // var time = Date.now();\n const onlyBlend = prms[0]; const evenCrd = prms[1]; const forbidPrev = prms[2]; const minBits = prms[3]; const\n forbidPlte = prms[4];\n\n let ctype = 6; let depth = 8; let\n alphaAnd = 255;\n\n for (var j = 0; j < bufs.length; j++) { // when not quantized, other frames can contain colors, that are not in an initial frame\n const img = new Uint8Array(bufs[j]); var\n ilen = img.length;\n for (var i = 0; i < ilen; i += 4) alphaAnd &= img[i + 3];\n }\n const gotAlpha = (alphaAnd != 255);\n\n // console.log(\"alpha check\", Date.now()-time); time = Date.now();\n\n // var brute = gotAlpha && forGIF;\t\t// brute : frames can only be copied, not \"blended\"\n const frms = UPNG.encode.framize(bufs, w, h, onlyBlend, evenCrd, forbidPrev);\n // console.log(\"framize\", Date.now()-time); time = Date.now();\n\n const cmap = {}; const plte = []; const\n inds = [];\n\n if (ps != 0) {\n const nbufs = []; for (var i = 0; i < frms.length; i++) nbufs.push(frms[i].img.buffer);\n\n const abuf = UPNG.encode.concatRGBA(nbufs); const\n qres = UPNG.quantize(abuf, ps); // console.log(qres);\n let cof = 0; const\n bb = new Uint8Array(qres.abuf);\n for (var i = 0; i < frms.length; i++) {\n var ti = frms[i].img; const\n bln = ti.length; inds.push(new Uint8Array(qres.inds.buffer, cof >> 2, bln >> 2));\n for (var j = 0; j < bln; j += 4) { ti[j] = bb[cof + j]; ti[j + 1] = bb[cof + j + 1]; ti[j + 2] = bb[cof + j + 2]; ti[j + 3] = bb[cof + j + 3]; } cof += bln;\n }\n\n for (var i = 0; i < qres.plte.length; i++) plte.push(qres.plte[i].est.rgba);\n // console.log(\"quantize\", Date.now()-time); time = Date.now();\n } else {\n // what if ps==0, but there are <=256 colors? we still need to detect, if the palette could be used\n for (var j = 0; j < frms.length; j++) { // when not quantized, other frames can contain colors, that are not in an initial frame\n var frm = frms[j]; const img32 = new Uint32Array(frm.img.buffer); var nw = frm.rect.width; var\n ilen = img32.length;\n const ind = new Uint8Array(ilen); inds.push(ind);\n for (var i = 0; i < ilen; i++) {\n const c = img32[i];\n if (i != 0 && c == img32[i - 1]) ind[i] = ind[i - 1];\n else if (i > nw && c == img32[i - nw]) ind[i] = ind[i - nw];\n else {\n let cmc = cmap[c];\n if (cmc == null) { cmap[c] = cmc = plte.length; plte.push(c); if (plte.length >= 300) break; }\n ind[i] = cmc;\n }\n }\n }\n // console.log(\"make palette\", Date.now()-time); time = Date.now();\n }\n\n const cc = plte.length; // console.log(\"colors:\",cc);\n if (cc <= 256 && forbidPlte == false) {\n if (cc <= 2) depth = 1; else if (cc <= 4) depth = 2; else if (cc <= 16) depth = 4; else depth = 8;\n depth = Math.max(depth, minBits);\n }\n\n for (var j = 0; j < frms.length; j++) {\n var frm = frms[j]; const nx = frm.rect.x; const ny = frm.rect.y; var nw = frm.rect.width; const\n nh = frm.rect.height;\n let cimg = frm.img; const\n cimg32 = new Uint32Array(cimg.buffer);\n let bpl = 4 * nw; let\n bpp = 4;\n if (cc <= 256 && forbidPlte == false) {\n bpl = Math.ceil(depth * nw / 8);\n var nimg = new Uint8Array(bpl * nh);\n const inj = inds[j];\n for (let y = 0; y < nh; y++) {\n var i = y * bpl; const\n ii = y * nw;\n if (depth == 8) for (var x = 0; x < nw; x++) nimg[i + (x)] = (inj[ii + x]);\n else if (depth == 4) for (var x = 0; x < nw; x++) nimg[i + (x >> 1)] |= (inj[ii + x] << (4 - (x & 1) * 4));\n else if (depth == 2) for (var x = 0; x < nw; x++) nimg[i + (x >> 2)] |= (inj[ii + x] << (6 - (x & 3) * 2));\n else if (depth == 1) for (var x = 0; x < nw; x++) nimg[i + (x >> 3)] |= (inj[ii + x] << (7 - (x & 7) * 1));\n }\n cimg = nimg; ctype = 3; bpp = 1;\n } else if (gotAlpha == false && frms.length == 1) {\t// some next \"reduced\" frames may contain alpha for blending\n var nimg = new Uint8Array(nw * nh * 3); const\n area = nw * nh;\n for (var i = 0; i < area; i++) {\n var ti = i * 3; const\n qi = i * 4; nimg[ti] = cimg[qi]; nimg[ti + 1] = cimg[qi + 1]; nimg[ti + 2] = cimg[qi + 2];\n }\n cimg = nimg; ctype = 2; bpp = 3; bpl = 3 * nw;\n }\n frm.img = cimg; frm.bpl = bpl; frm.bpp = bpp;\n }\n // console.log(\"colors => palette indices\", Date.now()-time); time = Date.now();\n\n return {\n ctype, depth, plte, frames: frms,\n };\n};\nUPNG.encode.framize = function (bufs, w, h, alwaysBlend, evenCrd, forbidPrev) {\n /* DISPOSE\n - 0 : no change\n - 1 : clear to transparent\n - 2 : retstore to content before rendering (previous frame disposed)\n BLEND\n - 0 : replace\n - 1 : blend\n */\n const frms = [];\n for (var j = 0; j < bufs.length; j++) {\n const cimg = new Uint8Array(bufs[j]); const\n cimg32 = new Uint32Array(cimg.buffer);\n var nimg;\n\n let nx = 0; let ny = 0; let nw = w; let nh = h; let\n blend = alwaysBlend ? 1 : 0;\n if (j != 0) {\n const tlim = (forbidPrev || alwaysBlend || j == 1 || frms[j - 2].dispose != 0) ? 1 : 2; let tstp = 0; let\n tarea = 1e9;\n for (let it = 0; it < tlim; it++) {\n var pimg = new Uint8Array(bufs[j - 1 - it]); const\n p32 = new Uint32Array(bufs[j - 1 - it]);\n let mix = w; let miy = h; let max = -1; let may = -1;\n for (let y = 0; y < h; y++) {\n for (let x = 0; x < w; x++) {\n var i = y * w + x;\n if (cimg32[i] != p32[i]) {\n if (x < mix) mix = x; if (x > max) max = x;\n if (y < miy) miy = y; if (y > may) may = y;\n }\n }\n }\n if (max == -1) mix = miy = max = may = 0;\n if (evenCrd) { if ((mix & 1) == 1)mix--; if ((miy & 1) == 1)miy--; }\n const sarea = (max - mix + 1) * (may - miy + 1);\n if (sarea < tarea) {\n tarea = sarea; tstp = it;\n nx = mix; ny = miy; nw = max - mix + 1; nh = may - miy + 1;\n }\n }\n\n // alwaysBlend: pokud zjistím, že blendit nelze, nastavím předchozímu snímku dispose=1. Zajistím, aby obsahoval můj obdélník.\n var pimg = new Uint8Array(bufs[j - 1 - tstp]);\n if (tstp == 1) frms[j - 1].dispose = 2;\n\n nimg = new Uint8Array(nw * nh * 4);\n UPNG._copyTile(pimg, w, h, nimg, nw, nh, -nx, -ny, 0);\n\n blend = UPNG._copyTile(cimg, w, h, nimg, nw, nh, -nx, -ny, 3) ? 1 : 0;\n if (blend == 1) {\n UPNG.encode._prepareDiff(cimg, w, h, nimg, {\n x: nx, y: ny, width: nw, height: nh,\n });\n } else UPNG._copyTile(cimg, w, h, nimg, nw, nh, -nx, -ny, 0);\n // UPNG._copyTile(cimg,w,h, nimg,nw,nh, -nx,-ny, blend==1?2:0);\n } else nimg = cimg.slice(0);\t// img may be rewritten further ... don't rewrite input\n\n frms.push({\n rect: {\n x: nx, y: ny, width: nw, height: nh,\n },\n img: nimg,\n blend,\n dispose: 0,\n });\n }\n\n if (alwaysBlend) {\n for (var j = 0; j < frms.length; j++) {\n var frm = frms[j]; if (frm.blend == 1) continue;\n const r0 = frm.rect; const\n r1 = frms[j - 1].rect;\n const miX = Math.min(r0.x, r1.x); const\n miY = Math.min(r0.y, r1.y);\n const maX = Math.max(r0.x + r0.width, r1.x + r1.width); const\n maY = Math.max(r0.y + r0.height, r1.y + r1.height);\n const r = {\n x: miX, y: miY, width: maX - miX, height: maY - miY,\n };\n\n frms[j - 1].dispose = 1;\n if (j - 1 != 0) { UPNG.encode._updateFrame(bufs, w, h, frms, j - 1, r, evenCrd); }\n UPNG.encode._updateFrame(bufs, w, h, frms, j, r, evenCrd);\n }\n }\n let area = 0;\n if (bufs.length != 1) {\n for (var i = 0; i < frms.length; i++) {\n var frm = frms[i];\n area += frm.rect.width * frm.rect.height;\n // if(i==0 || frm.blend!=1) continue;\n // var ob = new Uint8Array(\n // console.log(frm.blend, frm.dispose, frm.rect);\n }\n }\n // if(area!=0) console.log(area);\n return frms;\n};\nUPNG.encode._updateFrame = function (bufs, w, h, frms, i, r, evenCrd) {\n const U8 = Uint8Array; const\n U32 = Uint32Array;\n const pimg = new U8(bufs[i - 1]); const pimg32 = new U32(bufs[i - 1]); const\n nimg = i + 1 < bufs.length ? new U8(bufs[i + 1]) : null;\n const cimg = new U8(bufs[i]); const\n cimg32 = new U32(cimg.buffer);\n\n let mix = w; let miy = h; let max = -1; let may = -1;\n for (let y = 0; y < r.height; y++) {\n for (let x = 0; x < r.width; x++) {\n const cx = r.x + x; const\n cy = r.y + y;\n const j = cy * w + cx; const\n cc = cimg32[j];\n // no need to draw transparency, or to dispose it. Or, if writing the same color and the next one does not need transparency.\n if (cc == 0 || (frms[i - 1].dispose == 0 && pimg32[j] == cc && (nimg == null || nimg[j * 4 + 3] != 0))/**/) {} else {\n if (cx < mix) mix = cx; if (cx > max) max = cx;\n if (cy < miy) miy = cy; if (cy > may) may = cy;\n }\n }\n }\n if (max == -1) mix = miy = max = may = 0;\n if (evenCrd) { if ((mix & 1) == 1)mix--; if ((miy & 1) == 1)miy--; }\n r = {\n x: mix, y: miy, width: max - mix + 1, height: may - miy + 1,\n };\n\n const fr = frms[i]; fr.rect = r; fr.blend = 1; fr.img = new Uint8Array(r.width * r.height * 4);\n if (frms[i - 1].dispose == 0) {\n UPNG._copyTile(pimg, w, h, fr.img, r.width, r.height, -r.x, -r.y, 0);\n UPNG.encode._prepareDiff(cimg, w, h, fr.img, r);\n // UPNG._copyTile(cimg,w,h, fr.img,r.width,r.height, -r.x,-r.y, 2);\n } else { UPNG._copyTile(cimg, w, h, fr.img, r.width, r.height, -r.x, -r.y, 0); }\n};\nUPNG.encode._prepareDiff = function (cimg, w, h, nimg, rec) {\n UPNG._copyTile(cimg, w, h, nimg, rec.width, rec.height, -rec.x, -rec.y, 2);\n /*\n var n32 = new Uint32Array(nimg.buffer);\n var og = new Uint8Array(rec.width*rec.height*4), o32 = new Uint32Array(og.buffer);\n UPNG._copyTile(cimg,w,h, og,rec.width,rec.height, -rec.x,-rec.y, 0);\n for(var i=4; i>>2]==o32[(i>>>2)-1]) {\n n32[i>>>2]=o32[i>>>2];\n //var j = i, c=p32[(i>>>2)-1];\n //while(p32[j>>>2]==c) { n32[j>>>2]=c; j+=4; }\n }\n }\n for(var i=nimg.length-8; i>0; i-=4) {\n if(nimg[i+7]!=0 && nimg[i+3]==0 && o32[i>>>2]==o32[(i>>>2)+1]) {\n n32[i>>>2]=o32[i>>>2];\n //var j = i, c=p32[(i>>>2)-1];\n //while(p32[j>>>2]==c) { n32[j>>>2]=c; j+=4; }\n }\n } */\n};\n\nUPNG.encode._filterZero = function (img, h, bpp, bpl, data, filter, levelZero) {\n const fls = []; let\n ftry = [0, 1, 2, 3, 4];\n if (filter != -1) ftry = [filter];\n else if (h * bpl > 500000 || bpp == 1) ftry = [0];\n let opts; if (levelZero) opts = { level: 0 };\n\n // var CMPR = (data.length>10e6 && typeof UZIP !== 'undefined') ? UZIP : pako;\n const CMPR = UZIP;\n\n const time = Date.now();\n for (var i = 0; i < ftry.length; i++) {\n for (let y = 0; y < h; y++) UPNG.encode._filterLine(data, img, y, bpl, bpp, ftry[i]);\n // var nimg = new Uint8Array(data.length);\n // var sz = UZIP.F.deflate(data, nimg); fls.push(nimg.slice(0,sz));\n // var dfl = pako[\"deflate\"](data), dl=dfl.length-4;\n // var crc = (dfl[dl+3]<<24)|(dfl[dl+2]<<16)|(dfl[dl+1]<<8)|(dfl[dl+0]<<0);\n // console.log(crc, UZIP.adler(data,2,data.length-6));\n fls.push(CMPR.deflate(data, opts));\n }\n\n let ti; let\n tsize = 1e9;\n for (var i = 0; i < fls.length; i++) if (fls[i].length < tsize) { ti = i; tsize = fls[i].length; }\n return fls[ti];\n};\nUPNG.encode._filterLine = function (data, img, y, bpl, bpp, type) {\n const i = y * bpl; let di = i + y; const\n paeth = UPNG.decode._paeth;\n data[di] = type; di++;\n\n if (type == 0) {\n if (bpl < 500) for (var x = 0; x < bpl; x++) data[di + x] = img[i + x];\n else data.set(new Uint8Array(img.buffer, i, bpl), di);\n } else if (type == 1) {\n for (var x = 0; x < bpp; x++) data[di + x] = img[i + x];\n for (var x = bpp; x < bpl; x++) data[di + x] = (img[i + x] - img[i + x - bpp] + 256) & 255;\n } else if (y == 0) {\n for (var x = 0; x < bpp; x++) data[di + x] = img[i + x];\n\n if (type == 2) for (var x = bpp; x < bpl; x++) data[di + x] = img[i + x];\n if (type == 3) for (var x = bpp; x < bpl; x++) data[di + x] = (img[i + x] - (img[i + x - bpp] >> 1) + 256) & 255;\n if (type == 4) for (var x = bpp; x < bpl; x++) data[di + x] = (img[i + x] - paeth(img[i + x - bpp], 0, 0) + 256) & 255;\n } else {\n if (type == 2) { for (var x = 0; x < bpl; x++) data[di + x] = (img[i + x] + 256 - img[i + x - bpl]) & 255; }\n if (type == 3) {\n for (var x = 0; x < bpp; x++) data[di + x] = (img[i + x] + 256 - (img[i + x - bpl] >> 1)) & 255;\n for (var x = bpp; x < bpl; x++) data[di + x] = (img[i + x] + 256 - ((img[i + x - bpl] + img[i + x - bpp]) >> 1)) & 255;\n }\n if (type == 4) {\n for (var x = 0; x < bpp; x++) data[di + x] = (img[i + x] + 256 - paeth(0, img[i + x - bpl], 0)) & 255;\n for (var x = bpp; x < bpl; x++) data[di + x] = (img[i + x] + 256 - paeth(img[i + x - bpp], img[i + x - bpl], img[i + x - bpp - bpl])) & 255;\n }\n }\n};\n\nUPNG.crc = {\n table: (function () {\n const tab = new Uint32Array(256);\n for (let n = 0; n < 256; n++) {\n let c = n;\n for (let k = 0; k < 8; k++) {\n if (c & 1) c = 0xedb88320 ^ (c >>> 1);\n else c >>>= 1;\n }\n tab[n] = c;\n }\n return tab;\n }()),\n update(c, buf, off, len) {\n for (let i = 0; i < len; i++) c = UPNG.crc.table[(c ^ buf[off + i]) & 0xff] ^ (c >>> 8);\n return c;\n },\n crc(b, o, l) { return UPNG.crc.update(0xffffffff, b, o, l) ^ 0xffffffff; },\n};\n\nUPNG.quantize = function (abuf, ps) {\n const oimg = new Uint8Array(abuf); const nimg = oimg.slice(0); const\n nimg32 = new Uint32Array(nimg.buffer);\n\n const KD = UPNG.quantize.getKDtree(nimg, ps);\n const root = KD[0]; const\n leafs = KD[1];\n\n const { planeDst } = UPNG.quantize;\n const sb = oimg; const tb = nimg32; const\n len = sb.length;\n\n const inds = new Uint8Array(oimg.length >> 2); let\n nd;\n if (oimg.length < 20e6) // precise, but slow :(\n {\n for (var i = 0; i < len; i += 4) {\n var r = sb[i] * (1 / 255); var g = sb[i + 1] * (1 / 255); var b = sb[i + 2] * (1 / 255); var\n a = sb[i + 3] * (1 / 255);\n\n nd = UPNG.quantize.getNearest(root, r, g, b, a);\n inds[i >> 2] = nd.ind; tb[i >> 2] = nd.est.rgba;\n }\n } else {\n for (var i = 0; i < len; i += 4) {\n var r = sb[i] * (1 / 255); var g = sb[i + 1] * (1 / 255); var b = sb[i + 2] * (1 / 255); var\n a = sb[i + 3] * (1 / 255);\n\n nd = root; while (nd.left) nd = (planeDst(nd.est, r, g, b, a) <= 0) ? nd.left : nd.right;\n inds[i >> 2] = nd.ind; tb[i >> 2] = nd.est.rgba;\n }\n }\n return { abuf: nimg.buffer, inds, plte: leafs };\n};\n\nUPNG.quantize.getKDtree = function (nimg, ps, err) {\n if (err == null) err = 0.0001;\n const nimg32 = new Uint32Array(nimg.buffer);\n\n const root = {\n i0: 0, i1: nimg.length, bst: null, est: null, tdst: 0, left: null, right: null,\n }; // basic statistic, extra statistic\n root.bst = UPNG.quantize.stats(nimg, root.i0, root.i1); root.est = UPNG.quantize.estats(root.bst);\n const leafs = [root];\n\n while (leafs.length < ps) {\n let maxL = 0; let\n mi = 0;\n for (var i = 0; i < leafs.length; i++) if (leafs[i].est.L > maxL) { maxL = leafs[i].est.L; mi = i; }\n if (maxL < err) break;\n const node = leafs[mi];\n\n const s0 = UPNG.quantize.splitPixels(nimg, nimg32, node.i0, node.i1, node.est.e, node.est.eMq255);\n const s0wrong = (node.i0 >= s0 || node.i1 <= s0);\n // console.log(maxL, leafs.length, mi);\n if (s0wrong) { node.est.L = 0; continue; }\n\n const ln = {\n i0: node.i0, i1: s0, bst: null, est: null, tdst: 0, left: null, right: null,\n }; ln.bst = UPNG.quantize.stats(nimg, ln.i0, ln.i1);\n ln.est = UPNG.quantize.estats(ln.bst);\n const rn = {\n i0: s0, i1: node.i1, bst: null, est: null, tdst: 0, left: null, right: null,\n }; rn.bst = { R: [], m: [], N: node.bst.N - ln.bst.N };\n for (var i = 0; i < 16; i++) rn.bst.R[i] = node.bst.R[i] - ln.bst.R[i];\n for (var i = 0; i < 4; i++) rn.bst.m[i] = node.bst.m[i] - ln.bst.m[i];\n rn.est = UPNG.quantize.estats(rn.bst);\n\n node.left = ln; node.right = rn;\n leafs[mi] = ln; leafs.push(rn);\n }\n leafs.sort((a, b) => b.bst.N - a.bst.N);\n for (var i = 0; i < leafs.length; i++) leafs[i].ind = i;\n return [root, leafs];\n};\n\nUPNG.quantize.getNearest = function (nd, r, g, b, a) {\n if (nd.left == null) { nd.tdst = UPNG.quantize.dist(nd.est.q, r, g, b, a); return nd; }\n const planeDst = UPNG.quantize.planeDst(nd.est, r, g, b, a);\n\n let node0 = nd.left; let\n node1 = nd.right;\n if (planeDst > 0) { node0 = nd.right; node1 = nd.left; }\n\n const ln = UPNG.quantize.getNearest(node0, r, g, b, a);\n if (ln.tdst <= planeDst * planeDst) return ln;\n const rn = UPNG.quantize.getNearest(node1, r, g, b, a);\n return rn.tdst < ln.tdst ? rn : ln;\n};\nUPNG.quantize.planeDst = function (est, r, g, b, a) { const { e } = est; return e[0] * r + e[1] * g + e[2] * b + e[3] * a - est.eMq; };\nUPNG.quantize.dist = function (q, r, g, b, a) {\n const d0 = r - q[0]; const d1 = g - q[1]; const d2 = b - q[2]; const\n d3 = a - q[3]; return d0 * d0 + d1 * d1 + d2 * d2 + d3 * d3;\n};\n\nUPNG.quantize.splitPixels = function (nimg, nimg32, i0, i1, e, eMq) {\n const { vecDot } = UPNG.quantize;\n i1 -= 4;\n const shfs = 0;\n while (i0 < i1) {\n while (vecDot(nimg, i0, e) <= eMq) i0 += 4;\n while (vecDot(nimg, i1, e) > eMq) i1 -= 4;\n if (i0 >= i1) break;\n\n const t = nimg32[i0 >> 2]; nimg32[i0 >> 2] = nimg32[i1 >> 2]; nimg32[i1 >> 2] = t;\n\n i0 += 4; i1 -= 4;\n }\n while (vecDot(nimg, i0, e) > eMq) i0 -= 4;\n return i0 + 4;\n};\nUPNG.quantize.vecDot = function (nimg, i, e) {\n return nimg[i] * e[0] + nimg[i + 1] * e[1] + nimg[i + 2] * e[2] + nimg[i + 3] * e[3];\n};\nUPNG.quantize.stats = function (nimg, i0, i1) {\n const R = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0];\n const m = [0, 0, 0, 0];\n const N = (i1 - i0) >> 2;\n for (let i = i0; i < i1; i += 4) {\n const r = nimg[i] * (1 / 255); const g = nimg[i + 1] * (1 / 255); const b = nimg[i + 2] * (1 / 255); const\n a = nimg[i + 3] * (1 / 255);\n // var r = nimg[i], g = nimg[i+1], b = nimg[i+2], a = nimg[i+3];\n m[0] += r; m[1] += g; m[2] += b; m[3] += a;\n\n R[0] += r * r; R[1] += r * g; R[2] += r * b; R[3] += r * a;\n R[5] += g * g; R[6] += g * b; R[7] += g * a;\n R[10] += b * b; R[11] += b * a;\n R[15] += a * a;\n }\n R[4] = R[1]; R[8] = R[2]; R[9] = R[6]; R[12] = R[3]; R[13] = R[7]; R[14] = R[11];\n\n return { R, m, N };\n};\nUPNG.quantize.estats = function (stats) {\n const { R } = stats;\n const { m } = stats;\n const { N } = stats;\n\n // when all samples are equal, but N is large (millions), the Rj can be non-zero ( 0.0003.... - precission error)\n const m0 = m[0]; const m1 = m[1]; const m2 = m[2]; const m3 = m[3]; const\n iN = (N == 0 ? 0 : 1 / N);\n const Rj = [\n R[0] - m0 * m0 * iN, R[1] - m0 * m1 * iN, R[2] - m0 * m2 * iN, R[3] - m0 * m3 * iN,\n R[4] - m1 * m0 * iN, R[5] - m1 * m1 * iN, R[6] - m1 * m2 * iN, R[7] - m1 * m3 * iN,\n R[8] - m2 * m0 * iN, R[9] - m2 * m1 * iN, R[10] - m2 * m2 * iN, R[11] - m2 * m3 * iN,\n R[12] - m3 * m0 * iN, R[13] - m3 * m1 * iN, R[14] - m3 * m2 * iN, R[15] - m3 * m3 * iN,\n ];\n\n const A = Rj; const\n M = UPNG.M4;\n let b = [Math.random(), Math.random(), Math.random(), Math.random()]; let mi = 0; let\n tmi = 0;\n\n if (N != 0) {\n for (let i = 0; i < 16; i++) {\n b = M.multVec(A, b); tmi = Math.sqrt(M.dot(b, b)); b = M.sml(1 / tmi, b);\n if (i != 0 && Math.abs(tmi - mi) < 1e-9) break; mi = tmi;\n }\n }\n // b = [0,0,1,0]; mi=N;\n const q = [m0 * iN, m1 * iN, m2 * iN, m3 * iN];\n const eMq255 = M.dot(M.sml(255, q), b);\n\n return {\n Cov: Rj,\n q,\n e: b,\n L: mi,\n eMq255,\n eMq: M.dot(b, q),\n rgba: (((Math.round(255 * q[3]) << 24) | (Math.round(255 * q[2]) << 16) | (Math.round(255 * q[1]) << 8) | (Math.round(255 * q[0]) << 0)) >>> 0),\n };\n};\nUPNG.M4 = {\n multVec(m, v) {\n return [\n m[0] * v[0] + m[1] * v[1] + m[2] * v[2] + m[3] * v[3],\n m[4] * v[0] + m[5] * v[1] + m[6] * v[2] + m[7] * v[3],\n m[8] * v[0] + m[9] * v[1] + m[10] * v[2] + m[11] * v[3],\n m[12] * v[0] + m[13] * v[1] + m[14] * v[2] + m[15] * v[3],\n ];\n },\n dot(x, y) { return x[0] * y[0] + x[1] * y[1] + x[2] * y[2] + x[3] * y[3]; },\n sml(a, y) { return [a * y[0], a * y[1], a * y[2], a * y[3]]; },\n};\n\nUPNG.encode.concatRGBA = function (bufs) {\n let tlen = 0;\n for (var i = 0; i < bufs.length; i++) tlen += bufs[i].byteLength;\n const nimg = new Uint8Array(tlen); let\n noff = 0;\n for (var i = 0; i < bufs.length; i++) {\n const img = new Uint8Array(bufs[i]); const\n il = img.length;\n for (let j = 0; j < il; j += 4) {\n let r = img[j]; let g = img[j + 1]; let b = img[j + 2]; const\n a = img[j + 3];\n if (a == 0) r = g = b = 0;\n nimg[noff + j] = r; nimg[noff + j + 1] = g; nimg[noff + j + 2] = b; nimg[noff + j + 3] = a;\n }\n noff += il;\n }\n return nimg.buffer;\n};\n\nexport default UPNG;\n","import UPNG from './UPNG';\nimport MaxCanvasSize from './config/max-canvas-size';\n\nconst isBrowser = typeof window !== 'undefined'; // change browser environment to support SSR\n\n// add support for cordova-plugin-file\nconst moduleMapper = isBrowser && window.cordova && window.cordova.require && window.cordova.require('cordova/modulemapper');\nexport const CustomFile = isBrowser && ((moduleMapper && moduleMapper.getOriginalSymbol(window, 'File')) || (typeof window.File !== 'undefined' && File));\nexport const CustomFileReader = isBrowser && ((moduleMapper && moduleMapper.getOriginalSymbol(window, 'FileReader')) || (typeof window.FileReader !== 'undefined' && FileReader));\n\n/**\n * getFilefromDataUrl\n *\n * @param {string} dataUrl\n * @param {string} filename\n * @param {number} [lastModified=Date.now()]\n * @returns {Promise}\n */\nexport function getFilefromDataUrl(dataUrl, filename, lastModified = Date.now()) {\n return new Promise((resolve) => {\n const arr = dataUrl.split(',');\n const mime = arr[0].match(/:(.*?);/)[1];\n const bstr = globalThis.atob(arr[1]);\n let n = bstr.length;\n const u8arr = new Uint8Array(n);\n while (n--) {\n u8arr[n] = bstr.charCodeAt(n);\n }\n const file = new Blob([u8arr], { type: mime });\n file.name = filename;\n file.lastModified = lastModified;\n resolve(file);\n\n // Safari has issue with File constructor not being able to POST in FormData\n // https://github.com/Donaldcwl/browser-image-compression/issues/8\n // https://bugs.webkit.org/show_bug.cgi?id=165081\n // let file\n // try {\n // file = new File([u8arr], filename, { type: mime }) // Edge do not support File constructor\n // } catch (e) {\n // file = new Blob([u8arr], { type: mime })\n // file.name = filename\n // file.lastModified = lastModified\n // }\n // resolve(file)\n });\n}\n\n/**\n * getDataUrlFromFile\n *\n * @param {File | Blob} file\n * @returns {Promise}\n */\nexport function getDataUrlFromFile(file) {\n return new Promise((resolve, reject) => {\n const reader = new CustomFileReader();\n reader.onload = () => resolve(reader.result);\n reader.onerror = (e) => reject(e);\n reader.readAsDataURL(file);\n });\n}\n\n/**\n * loadImage\n *\n * @param {string} src\n * @returns {Promise}\n */\nexport function loadImage(src) {\n return new Promise((resolve, reject) => {\n const img = new Image();\n img.onload = () => resolve(img);\n img.onerror = (e) => reject(e);\n img.src = src;\n });\n}\n\n/**\n * getBrowserName\n *\n * Extracts the browser name from the useragent.\n *\n * ref: https://stackoverflow.com/a/26358856\n *\n * @returns {string}\n */\nexport function getBrowserName() {\n let browserName = 'etc';\n if (navigator.userAgent.indexOf('Chrome') !== -1 || navigator.userAgent.indexOf('Chromium') !== -1) {\n browserName = 'chrome';\n } if (navigator.userAgent.indexOf('Safari') !== -1) {\n browserName = 'safari';\n } else if (navigator.userAgent.indexOf('Firefox') !== -1) {\n browserName = 'firefox';\n } else if ((navigator.userAgent.indexOf('MSIE') !== -1) || (!!document.documentMode === true)) { // IF IE > 10\n browserName = 'internet explorer';\n }\n return browserName;\n}\n\n/**\n * approximateBelowCanvasMaximumSizeOfBrowser\n *\n * it uses binary search to converge below the browser's maximum Canvas size.\n *\n * ref: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/canvas#maximum_canvas_size\n *\n * @param {number} initWidth\n * @param {number} initHeight\n * @returns {object}\n */\nexport function approximateBelowMaximumCanvasSizeOfBrowser(initWidth, initHeight) {\n const browserName = getBrowserName();\n const maximumCanvasSize = MaxCanvasSize[browserName];\n\n let width = initWidth;\n let height = initHeight;\n let size = width * height;\n const ratio = width > height ? height / width : width / height;\n\n while (size > maximumCanvasSize * maximumCanvasSize) {\n const halfSizeWidth = (maximumCanvasSize + width) / 2;\n const halfSizeHeight = (maximumCanvasSize + height) / 2;\n if (halfSizeWidth < halfSizeHeight) {\n height = halfSizeHeight;\n width = halfSizeHeight * ratio;\n } else {\n height = halfSizeWidth * ratio;\n width = halfSizeWidth;\n }\n\n size = width * height;\n }\n\n return {\n width, height,\n };\n}\n\n/**\n * get new Canvas and it's context\n * @param width\n * @param height\n * @returns {[HTMLCanvasElement | OffscreenCanvas, CanvasRenderingContext2D]}\n */\nexport function getNewCanvasAndCtx(width, height) {\n let canvas;\n let ctx;\n try {\n canvas = new OffscreenCanvas(width, height);\n ctx = canvas.getContext('2d');\n if (ctx === null) {\n throw new Error('getContext of OffscreenCanvas returns null');\n }\n } catch (e) {\n canvas = document.createElement('canvas');\n ctx = canvas.getContext('2d');\n }\n canvas.width = width;\n canvas.height = height;\n // ctx.fillStyle = '#fff'\n // ctx.fillRect(0, 0, width, height)\n return [canvas, ctx];\n}\n\n/**\n * drawImageInCanvas\n *\n * @param {HTMLImageElement} img\n * @returns {HTMLCanvasElement | OffscreenCanvas}\n */\nexport function drawImageInCanvas(img) {\n const { width, height } = approximateBelowMaximumCanvasSizeOfBrowser(img.width, img.height);\n const [canvas, ctx] = getNewCanvasAndCtx(width, height);\n ctx.drawImage(img, 0, 0, canvas.width, canvas.height);\n return canvas;\n}\n\n/**\n * drawFileInCanvas\n *\n * @param {File | Blob} file\n * @returns {Promise<[ImageBitmap | HTMLImageElement, HTMLCanvasElement | OffscreenCanvas]>}\n */\nexport async function drawFileInCanvas(file) {\n let img;\n try {\n img = await createImageBitmap(file);\n } catch (e) {\n const dataUrl = await getDataUrlFromFile(file);\n img = await loadImage(dataUrl);\n }\n const canvas = drawImageInCanvas(img);\n return [img, canvas];\n}\n\n/**\n * canvasToFile\n *\n * @param {HTMLCanvasElement | OffscreenCanvas} canvas\n * @param {string} fileType\n * @param {string} fileName\n * @param {number} fileLastModified\n * @param {number} [quality]\n * @returns {Promise}\n */\nexport async function canvasToFile(canvas, fileType, fileName, fileLastModified, quality = 1) {\n let file;\n if (fileType === 'image/png') {\n const ctx = canvas.getContext('2d');\n const { data } = ctx.getImageData(0, 0, canvas.width, canvas.height);\n const png = UPNG.encode([data], canvas.width, canvas.height, 256 * quality);\n file = new Blob([png], { type: fileType });\n file.name = fileName;\n file.lastModified = fileLastModified;\n } else if (typeof OffscreenCanvas === 'function' && canvas instanceof OffscreenCanvas) { // checked on Win Chrome 83, MacOS Chrome 83\n file = await canvas.convertToBlob({ type: fileType, quality });\n file.name = fileName;\n file.lastModified = fileLastModified;\n // some browser do not support quality parameter, see: https://developer.mozilla.org/en-US/docs/Web/API/HTMLCanvasElement/toBlob\n // } else if (typeof canvas.toBlob === 'function') {\n // file = await new Promise(resolve => canvas.toBlob(resolve, fileType, quality))\n } else { // checked on Win Edge 44, Win IE 11, Win Firefox 76, MacOS Firefox 77, MacOS Safari 13.1\n const dataUrl = canvas.toDataURL(fileType, quality);\n file = await getFilefromDataUrl(dataUrl, fileName, fileLastModified);\n }\n return file;\n}\n\n/**\n * clear Canvas memory\n * @param canvas\n * @returns null\n */\nexport function cleanupCanvasMemory(canvas) {\n // garbage clean canvas for safari\n // ref: https://bugs.webkit.org/show_bug.cgi?id=195325\n // eslint-disable-next-line no-param-reassign\n canvas.width = 0;\n // eslint-disable-next-line no-param-reassign\n canvas.height = 0;\n}\n\n// Check if browser supports automatic image orientation\n// see https://github.com/blueimp/JavaScript-Load-Image/blob/1e4df707821a0afcc11ea0720ee403b8759f3881/js/load-image-orientation.js#L37-L53\nexport async function isAutoOrientationInBrowser() {\n if (isAutoOrientationInBrowser.result !== undefined) return isAutoOrientationInBrowser.result;\n\n // black 2x1 JPEG, with the following meta information set:\n // EXIF Orientation: 6 (Rotated 90° CCW)\n const testImageURL = 'data:image/jpeg;base64,/9j/4QAiRXhpZgAATU0AKgAAAAgAAQESAAMAAAABAAYAAAA'\n + 'AAAD/2wCEAAEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBA'\n + 'QEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQE'\n + 'BAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAf/AABEIAAEAAgMBEQACEQEDEQH/x'\n + 'ABKAAEAAAAAAAAAAAAAAAAAAAALEAEAAAAAAAAAAAAAAAAAAAAAAQEAAAAAAAAAAAAAAAA'\n + 'AAAAAEQEAAAAAAAAAAAAAAAAAAAAA/9oADAMBAAIRAxEAPwA/8H//2Q==';\n const testImageFile = await getFilefromDataUrl(testImageURL, 'test.jpg', Date.now());\n\n const testImageCanvas = (await drawFileInCanvas(testImageFile))[1];\n const testImageFile2 = await canvasToFile(testImageCanvas, testImageFile.type, testImageFile.name, testImageFile.lastModified);\n cleanupCanvasMemory(testImageCanvas);\n const img = (await drawFileInCanvas(testImageFile2))[0];\n // console.log('img', img.width, img.height)\n\n isAutoOrientationInBrowser.result = img.width === 1 && img.height === 2;\n return isAutoOrientationInBrowser.result;\n}\n\n/**\n * getExifOrientation\n * get image exif orientation info\n * source: https://stackoverflow.com/a/32490603/10395024\n *\n * @param {File | Blob} file\n * @returns {Promise} - orientation id, see https://i.stack.imgur.com/VGsAj.gif\n */\nexport function getExifOrientation(file) {\n return new Promise((resolve, reject) => {\n const reader = new CustomFileReader();\n reader.onload = (e) => {\n const view = new DataView(e.target.result);\n if (view.getUint16(0, false) != 0xFFD8) {\n return resolve(-2);\n }\n const length = view.byteLength;\n let offset = 2;\n while (offset < length) {\n if (view.getUint16(offset + 2, false) <= 8) return resolve(-1);\n const marker = view.getUint16(offset, false);\n offset += 2;\n if (marker == 0xFFE1) {\n if (view.getUint32(offset += 2, false) != 0x45786966) {\n return resolve(-1);\n }\n\n const little = view.getUint16(offset += 6, false) == 0x4949;\n offset += view.getUint32(offset + 4, little);\n const tags = view.getUint16(offset, little);\n offset += 2;\n for (let i = 0; i < tags; i++) {\n if (view.getUint16(offset + (i * 12), little) == 0x0112) {\n return resolve(view.getUint16(offset + (i * 12) + 8, little));\n }\n }\n } else if ((marker & 0xFF00) != 0xFF00) {\n break;\n } else {\n offset += view.getUint16(offset, false);\n }\n }\n return resolve(-1);\n };\n reader.onerror = (e) => reject(e);\n reader.readAsArrayBuffer(file);\n });\n}\n\n/**\n *\n * @param {HTMLCanvasElement | OffscreenCanvas} canvas\n * @param options\n * @returns {HTMLCanvasElement | OffscreenCanvas}\n */\nexport function handleMaxWidthOrHeight(canvas, options) {\n const { width } = canvas;\n const { height } = canvas;\n const { maxWidthOrHeight } = options;\n\n const needToHandle = isFinite(maxWidthOrHeight) && (width > maxWidthOrHeight || height > maxWidthOrHeight);\n\n let newCanvas = canvas;\n let ctx;\n\n if (needToHandle) {\n [newCanvas, ctx] = getNewCanvasAndCtx(width, height);\n if (width > height) {\n newCanvas.width = maxWidthOrHeight;\n newCanvas.height = (height / width) * maxWidthOrHeight;\n } else {\n newCanvas.width = (width / height) * maxWidthOrHeight;\n newCanvas.height = maxWidthOrHeight;\n }\n ctx.drawImage(canvas, 0, 0, newCanvas.width, newCanvas.height);\n\n cleanupCanvasMemory(canvas);\n }\n\n return newCanvas;\n}\n\n/**\n * followExifOrientation\n * source: https://stackoverflow.com/a/40867559/10395024\n *\n * @param {HTMLCanvasElement | OffscreenCanvas} canvas\n * @param {number} exifOrientation\n * @returns {HTMLCanvasElement | OffscreenCanvas} canvas\n */\nexport function followExifOrientation(canvas, exifOrientation) {\n const { width } = canvas;\n const { height } = canvas;\n\n const [newCanvas, ctx] = getNewCanvasAndCtx(width, height);\n\n // set proper canvas dimensions before transform & export\n if (exifOrientation > 4 && exifOrientation < 9) {\n newCanvas.width = height;\n newCanvas.height = width;\n } else {\n newCanvas.width = width;\n newCanvas.height = height;\n }\n\n // transform context before drawing image\n switch (exifOrientation) {\n case 2:\n ctx.transform(-1, 0, 0, 1, width, 0);\n break;\n case 3:\n ctx.transform(-1, 0, 0, -1, width, height);\n break;\n case 4:\n ctx.transform(1, 0, 0, -1, 0, height);\n break;\n case 5:\n ctx.transform(0, 1, 1, 0, 0, 0);\n break;\n case 6:\n ctx.transform(0, 1, -1, 0, height, 0);\n break;\n case 7:\n ctx.transform(0, -1, -1, 0, height, width);\n break;\n case 8:\n ctx.transform(0, -1, 1, 0, 0, width);\n break;\n default:\n break;\n }\n\n ctx.drawImage(canvas, 0, 0, width, height);\n\n cleanupCanvasMemory(canvas);\n\n return newCanvas;\n}\n","import {\n canvasToFile,\n cleanupCanvasMemory,\n drawFileInCanvas,\n followExifOrientation,\n getExifOrientation,\n getNewCanvasAndCtx,\n handleMaxWidthOrHeight,\n isAutoOrientationInBrowser,\n} from './utils';\n\n/**\n * Compress an image file.\n *\n * @param {File} file\n * @param {Object} options\n * @param {number} [options.maxSizeMB=Number.POSITIVE_INFINITY]\n * @param {number} [options.maxWidthOrHeight=undefined]\n * @param {boolean} [options.useWebWorker=false]\n * @param {number} [options.maxIteration=10]\n * @param {number} [options.exifOrientation] - default to be the exif orientation from the image file\n * @param {Function} [options.onProgress] - a function takes one progress argument (progress from 0 to 100)\n * @param {string} [options.fileType] - default to be the original mime type from the image file\n * @param {number} [options.initialQuality=1.0]\n * @param {number} previousProgress - for internal try catch rerunning start from previous progress\n * @returns {Promise}\n */\nexport default async function compress(file, options, previousProgress = 0) {\n let progress = previousProgress;\n\n function incProgress(inc = 5) {\n progress += inc;\n options.onProgress(Math.min(progress, 100));\n }\n\n function setProgress(p) {\n progress = Math.min(Math.max(p, progress), 100);\n options.onProgress(progress);\n }\n\n let remainingTrials = options.maxIteration || 10;\n\n const maxSizeByte = options.maxSizeMB * 1024 * 1024;\n\n incProgress();\n\n // drawFileInCanvas\n const [, origCanvas] = await drawFileInCanvas(file);\n\n incProgress();\n\n // handleMaxWidthOrHeight\n const maxWidthOrHeightFixedCanvas = handleMaxWidthOrHeight(origCanvas, options);\n\n incProgress();\n\n // exifOrientation\n const exifOrientation = options.exifOrientation || await getExifOrientation(file);\n incProgress();\n const orientationFixedCanvas = (await isAutoOrientationInBrowser()) ? maxWidthOrHeightFixedCanvas : followExifOrientation(maxWidthOrHeightFixedCanvas, exifOrientation);\n incProgress();\n\n let quality = options.initialQuality || 1.0;\n\n const outputFileType = options.fileType || file.type;\n\n const tempFile = await canvasToFile(orientationFixedCanvas, outputFileType, file.name, file.lastModified, quality);\n incProgress();\n\n const origExceedMaxSize = tempFile.size > maxSizeByte;\n const sizeBecomeLarger = tempFile.size > file.size;\n // console.log('original file size', file.size)\n // console.log('current file size', tempFile.size)\n\n // check if we need to compress or resize\n if (!origExceedMaxSize && !sizeBecomeLarger) {\n // no need to compress\n setProgress(100);\n return tempFile;\n }\n\n const sourceSize = file.size;\n const renderedSize = tempFile.size;\n let currentSize = renderedSize;\n let compressedFile;\n let newCanvas; let\n ctx;\n let canvas = orientationFixedCanvas;\n while (remainingTrials-- && (currentSize > maxSizeByte || currentSize > sourceSize)) {\n const newWidth = origExceedMaxSize ? canvas.width * 0.95 : canvas.width;\n const newHeight = origExceedMaxSize ? canvas.height * 0.95 : canvas.height;\n // console.log('current width', newWidth);\n // console.log('current height', newHeight);\n [newCanvas, ctx] = getNewCanvasAndCtx(newWidth, newHeight);\n\n ctx.drawImage(canvas, 0, 0, newWidth, newHeight);\n\n quality *= 0.95;\n // eslint-disable-next-line no-await-in-loop\n compressedFile = await canvasToFile(newCanvas, outputFileType, file.name, file.lastModified, quality);\n\n cleanupCanvasMemory(canvas);\n\n canvas = newCanvas;\n\n currentSize = compressedFile.size;\n // console.log('currentSize', currentSize)\n setProgress(Math.min(99, Math.floor(((renderedSize - currentSize) / (renderedSize - maxSizeByte)) * 100)));\n }\n\n cleanupCanvasMemory(canvas);\n cleanupCanvasMemory(newCanvas);\n cleanupCanvasMemory(maxWidthOrHeightFixedCanvas);\n cleanupCanvasMemory(orientationFixedCanvas);\n cleanupCanvasMemory(origCanvas);\n\n setProgress(100);\n return compressedFile;\n}\n","'use strict';\nvar charAt = require('../internals/string-multibyte').charAt;\nvar toString = require('../internals/to-string');\nvar InternalStateModule = require('../internals/internal-state');\nvar defineIterator = require('../internals/define-iterator');\n\nvar STRING_ITERATOR = 'String Iterator';\nvar setInternalState = InternalStateModule.set;\nvar getInternalState = InternalStateModule.getterFor(STRING_ITERATOR);\n\n// `String.prototype[@@iterator]` method\n// https://tc39.es/ecma262/#sec-string.prototype-@@iterator\ndefineIterator(String, 'String', function (iterated) {\n setInternalState(this, {\n type: STRING_ITERATOR,\n string: toString(iterated),\n index: 0\n });\n// `%StringIteratorPrototype%.next` method\n// https://tc39.es/ecma262/#sec-%stringiteratorprototype%.next\n}, function next() {\n var state = getInternalState(this);\n var string = state.string;\n var index = state.index;\n var point;\n if (index >= string.length) return { value: undefined, done: true };\n point = charAt(string, index);\n state.index += point.length;\n return { value: point, done: false };\n});\n","var global = require('../internals/global');\nvar DOMIterables = require('../internals/dom-iterables');\nvar ArrayIteratorMethods = require('../modules/es.array.iterator');\nvar createNonEnumerableProperty = require('../internals/create-non-enumerable-property');\nvar wellKnownSymbol = require('../internals/well-known-symbol');\n\nvar ITERATOR = wellKnownSymbol('iterator');\nvar TO_STRING_TAG = wellKnownSymbol('toStringTag');\nvar ArrayValues = ArrayIteratorMethods.values;\n\nfor (var COLLECTION_NAME in DOMIterables) {\n var Collection = global[COLLECTION_NAME];\n var CollectionPrototype = Collection && Collection.prototype;\n if (CollectionPrototype) {\n // some Chrome versions have non-configurable methods on DOMTokenList\n if (CollectionPrototype[ITERATOR] !== ArrayValues) try {\n createNonEnumerableProperty(CollectionPrototype, ITERATOR, ArrayValues);\n } catch (error) {\n CollectionPrototype[ITERATOR] = ArrayValues;\n }\n if (!CollectionPrototype[TO_STRING_TAG]) {\n createNonEnumerableProperty(CollectionPrototype, TO_STRING_TAG, COLLECTION_NAME);\n }\n if (DOMIterables[COLLECTION_NAME]) for (var METHOD_NAME in ArrayIteratorMethods) {\n // some Chrome versions have non-configurable methods on DOMTokenList\n if (CollectionPrototype[METHOD_NAME] !== ArrayIteratorMethods[METHOD_NAME]) try {\n createNonEnumerableProperty(CollectionPrototype, METHOD_NAME, ArrayIteratorMethods[METHOD_NAME]);\n } catch (error) {\n CollectionPrototype[METHOD_NAME] = ArrayIteratorMethods[METHOD_NAME];\n }\n }\n }\n}\n","var fails = require('../internals/fails');\nvar wellKnownSymbol = require('../internals/well-known-symbol');\nvar IS_PURE = require('../internals/is-pure');\n\nvar ITERATOR = wellKnownSymbol('iterator');\n\nmodule.exports = !fails(function () {\n var url = new URL('b?a=1&b=2&c=3', 'http://a');\n var searchParams = url.searchParams;\n var result = '';\n url.pathname = 'c%20d';\n searchParams.forEach(function (value, key) {\n searchParams['delete']('b');\n result += key + value;\n });\n return (IS_PURE && !url.toJSON)\n || !searchParams.sort\n || url.href !== 'http://a/c%20d?a=1&c=3'\n || searchParams.get('c') !== '3'\n || String(new URLSearchParams('?a=1')) !== 'a=1'\n || !searchParams[ITERATOR]\n // throws in Edge\n || new URL('https://a@b').username !== 'a'\n || new URLSearchParams(new URLSearchParams('a=b')).get('a') !== 'b'\n // not punycoded in Edge\n || new URL('http://тест').host !== 'xn--e1aybc'\n // not escaped in Chrome 62-\n || new URL('http://a#б').hash !== '#%D0%B1'\n // fails in Chrome 66-\n || result !== 'a1c3'\n // throws in Safari\n || new URL('http://x', undefined).host !== 'x';\n});\n","var anObject = require('../internals/an-object');\nvar iteratorClose = require('../internals/iterator-close');\n\n// call something on iterator step with safe closing on error\nmodule.exports = function (iterator, fn, value, ENTRIES) {\n try {\n return ENTRIES ? fn(anObject(value)[0], value[1]) : fn(value);\n } catch (error) {\n iteratorClose(iterator);\n throw error;\n }\n};\n","'use strict';\nvar bind = require('../internals/function-bind-context');\nvar toObject = require('../internals/to-object');\nvar callWithSafeIterationClosing = require('../internals/call-with-safe-iteration-closing');\nvar isArrayIteratorMethod = require('../internals/is-array-iterator-method');\nvar toLength = require('../internals/to-length');\nvar createProperty = require('../internals/create-property');\nvar getIteratorMethod = require('../internals/get-iterator-method');\n\n// `Array.from` method implementation\n// https://tc39.es/ecma262/#sec-array.from\nmodule.exports = function from(arrayLike /* , mapfn = undefined, thisArg = undefined */) {\n var O = toObject(arrayLike);\n var C = typeof this == 'function' ? this : Array;\n var argumentsLength = arguments.length;\n var mapfn = argumentsLength > 1 ? arguments[1] : undefined;\n var mapping = mapfn !== undefined;\n var iteratorMethod = getIteratorMethod(O);\n var index = 0;\n var length, result, step, iterator, next, value;\n if (mapping) mapfn = bind(mapfn, argumentsLength > 2 ? arguments[2] : undefined, 2);\n // if the target is not iterable or it's an array with the default iterator - use a simple case\n if (iteratorMethod != undefined && !(C == Array && isArrayIteratorMethod(iteratorMethod))) {\n iterator = iteratorMethod.call(O);\n next = iterator.next;\n result = new C();\n for (;!(step = next.call(iterator)).done; index++) {\n value = mapping ? callWithSafeIterationClosing(iterator, mapfn, [step.value, index], true) : step.value;\n createProperty(result, index, value);\n }\n } else {\n length = toLength(O.length);\n result = new C(length);\n for (;length > index; index++) {\n value = mapping ? mapfn(O[index], index) : O[index];\n createProperty(result, index, value);\n }\n }\n result.length = index;\n return result;\n};\n","'use strict';\n// based on https://github.com/bestiejs/punycode.js/blob/master/punycode.js\nvar maxInt = 2147483647; // aka. 0x7FFFFFFF or 2^31-1\nvar base = 36;\nvar tMin = 1;\nvar tMax = 26;\nvar skew = 38;\nvar damp = 700;\nvar initialBias = 72;\nvar initialN = 128; // 0x80\nvar delimiter = '-'; // '\\x2D'\nvar regexNonASCII = /[^\\0-\\u007E]/; // non-ASCII chars\nvar regexSeparators = /[.\\u3002\\uFF0E\\uFF61]/g; // RFC 3490 separators\nvar OVERFLOW_ERROR = 'Overflow: input needs wider integers to process';\nvar baseMinusTMin = base - tMin;\nvar floor = Math.floor;\nvar stringFromCharCode = String.fromCharCode;\n\n/**\n * Creates an array containing the numeric code points of each Unicode\n * character in the string. While JavaScript uses UCS-2 internally,\n * this function will convert a pair of surrogate halves (each of which\n * UCS-2 exposes as separate characters) into a single code point,\n * matching UTF-16.\n */\nvar ucs2decode = function (string) {\n var output = [];\n var counter = 0;\n var length = string.length;\n while (counter < length) {\n var value = string.charCodeAt(counter++);\n if (value >= 0xD800 && value <= 0xDBFF && counter < length) {\n // It's a high surrogate, and there is a next character.\n var extra = string.charCodeAt(counter++);\n if ((extra & 0xFC00) == 0xDC00) { // Low surrogate.\n output.push(((value & 0x3FF) << 10) + (extra & 0x3FF) + 0x10000);\n } else {\n // It's an unmatched surrogate; only append this code unit, in case the\n // next code unit is the high surrogate of a surrogate pair.\n output.push(value);\n counter--;\n }\n } else {\n output.push(value);\n }\n }\n return output;\n};\n\n/**\n * Converts a digit/integer into a basic code point.\n */\nvar digitToBasic = function (digit) {\n // 0..25 map to ASCII a..z or A..Z\n // 26..35 map to ASCII 0..9\n return digit + 22 + 75 * (digit < 26);\n};\n\n/**\n * Bias adaptation function as per section 3.4 of RFC 3492.\n * https://tools.ietf.org/html/rfc3492#section-3.4\n */\nvar adapt = function (delta, numPoints, firstTime) {\n var k = 0;\n delta = firstTime ? floor(delta / damp) : delta >> 1;\n delta += floor(delta / numPoints);\n for (; delta > baseMinusTMin * tMax >> 1; k += base) {\n delta = floor(delta / baseMinusTMin);\n }\n return floor(k + (baseMinusTMin + 1) * delta / (delta + skew));\n};\n\n/**\n * Converts a string of Unicode symbols (e.g. a domain name label) to a\n * Punycode string of ASCII-only symbols.\n */\n// eslint-disable-next-line max-statements -- TODO\nvar encode = function (input) {\n var output = [];\n\n // Convert the input in UCS-2 to an array of Unicode code points.\n input = ucs2decode(input);\n\n // Cache the length.\n var inputLength = input.length;\n\n // Initialize the state.\n var n = initialN;\n var delta = 0;\n var bias = initialBias;\n var i, currentValue;\n\n // Handle the basic code points.\n for (i = 0; i < input.length; i++) {\n currentValue = input[i];\n if (currentValue < 0x80) {\n output.push(stringFromCharCode(currentValue));\n }\n }\n\n var basicLength = output.length; // number of basic code points.\n var handledCPCount = basicLength; // number of code points that have been handled;\n\n // Finish the basic string with a delimiter unless it's empty.\n if (basicLength) {\n output.push(delimiter);\n }\n\n // Main encoding loop:\n while (handledCPCount < inputLength) {\n // All non-basic code points < n have been handled already. Find the next larger one:\n var m = maxInt;\n for (i = 0; i < input.length; i++) {\n currentValue = input[i];\n if (currentValue >= n && currentValue < m) {\n m = currentValue;\n }\n }\n\n // Increase `delta` enough to advance the decoder's state to , but guard against overflow.\n var handledCPCountPlusOne = handledCPCount + 1;\n if (m - n > floor((maxInt - delta) / handledCPCountPlusOne)) {\n throw RangeError(OVERFLOW_ERROR);\n }\n\n delta += (m - n) * handledCPCountPlusOne;\n n = m;\n\n for (i = 0; i < input.length; i++) {\n currentValue = input[i];\n if (currentValue < n && ++delta > maxInt) {\n throw RangeError(OVERFLOW_ERROR);\n }\n if (currentValue == n) {\n // Represent delta as a generalized variable-length integer.\n var q = delta;\n for (var k = base; /* no condition */; k += base) {\n var t = k <= bias ? tMin : (k >= bias + tMax ? tMax : k - bias);\n if (q < t) break;\n var qMinusT = q - t;\n var baseMinusT = base - t;\n output.push(stringFromCharCode(digitToBasic(t + qMinusT % baseMinusT)));\n q = floor(qMinusT / baseMinusT);\n }\n\n output.push(stringFromCharCode(digitToBasic(q)));\n bias = adapt(delta, handledCPCountPlusOne, handledCPCount == basicLength);\n delta = 0;\n ++handledCPCount;\n }\n }\n\n ++delta;\n ++n;\n }\n return output.join('');\n};\n\nmodule.exports = function (input) {\n var encoded = [];\n var labels = input.toLowerCase().replace(regexSeparators, '\\u002E').split('.');\n var i, label;\n for (i = 0; i < labels.length; i++) {\n label = labels[i];\n encoded.push(regexNonASCII.test(label) ? 'xn--' + encode(label) : label);\n }\n return encoded.join('.');\n};\n","var anObject = require('../internals/an-object');\nvar getIteratorMethod = require('../internals/get-iterator-method');\n\nmodule.exports = function (it) {\n var iteratorMethod = getIteratorMethod(it);\n if (typeof iteratorMethod != 'function') {\n throw TypeError(String(it) + ' is not iterable');\n } return anObject(iteratorMethod.call(it));\n};\n","'use strict';\n// TODO: in core-js@4, move /modules/ dependencies to public entries for better optimization by tools like `preset-env`\nrequire('../modules/es.array.iterator');\nvar $ = require('../internals/export');\nvar getBuiltIn = require('../internals/get-built-in');\nvar USE_NATIVE_URL = require('../internals/native-url');\nvar redefine = require('../internals/redefine');\nvar redefineAll = require('../internals/redefine-all');\nvar setToStringTag = require('../internals/set-to-string-tag');\nvar createIteratorConstructor = require('../internals/create-iterator-constructor');\nvar InternalStateModule = require('../internals/internal-state');\nvar anInstance = require('../internals/an-instance');\nvar hasOwn = require('../internals/has');\nvar bind = require('../internals/function-bind-context');\nvar classof = require('../internals/classof');\nvar anObject = require('../internals/an-object');\nvar isObject = require('../internals/is-object');\nvar $toString = require('../internals/to-string');\nvar create = require('../internals/object-create');\nvar createPropertyDescriptor = require('../internals/create-property-descriptor');\nvar getIterator = require('../internals/get-iterator');\nvar getIteratorMethod = require('../internals/get-iterator-method');\nvar wellKnownSymbol = require('../internals/well-known-symbol');\n\nvar nativeFetch = getBuiltIn('fetch');\nvar NativeRequest = getBuiltIn('Request');\nvar RequestPrototype = NativeRequest && NativeRequest.prototype;\nvar Headers = getBuiltIn('Headers');\nvar ITERATOR = wellKnownSymbol('iterator');\nvar URL_SEARCH_PARAMS = 'URLSearchParams';\nvar URL_SEARCH_PARAMS_ITERATOR = URL_SEARCH_PARAMS + 'Iterator';\nvar setInternalState = InternalStateModule.set;\nvar getInternalParamsState = InternalStateModule.getterFor(URL_SEARCH_PARAMS);\nvar getInternalIteratorState = InternalStateModule.getterFor(URL_SEARCH_PARAMS_ITERATOR);\n\nvar plus = /\\+/g;\nvar sequences = Array(4);\n\nvar percentSequence = function (bytes) {\n return sequences[bytes - 1] || (sequences[bytes - 1] = RegExp('((?:%[\\\\da-f]{2}){' + bytes + '})', 'gi'));\n};\n\nvar percentDecode = function (sequence) {\n try {\n return decodeURIComponent(sequence);\n } catch (error) {\n return sequence;\n }\n};\n\nvar deserialize = function (it) {\n var result = it.replace(plus, ' ');\n var bytes = 4;\n try {\n return decodeURIComponent(result);\n } catch (error) {\n while (bytes) {\n result = result.replace(percentSequence(bytes--), percentDecode);\n }\n return result;\n }\n};\n\nvar find = /[!'()~]|%20/g;\n\nvar replace = {\n '!': '%21',\n \"'\": '%27',\n '(': '%28',\n ')': '%29',\n '~': '%7E',\n '%20': '+'\n};\n\nvar replacer = function (match) {\n return replace[match];\n};\n\nvar serialize = function (it) {\n return encodeURIComponent(it).replace(find, replacer);\n};\n\nvar parseSearchParams = function (result, query) {\n if (query) {\n var attributes = query.split('&');\n var index = 0;\n var attribute, entry;\n while (index < attributes.length) {\n attribute = attributes[index++];\n if (attribute.length) {\n entry = attribute.split('=');\n result.push({\n key: deserialize(entry.shift()),\n value: deserialize(entry.join('='))\n });\n }\n }\n }\n};\n\nvar updateSearchParams = function (query) {\n this.entries.length = 0;\n parseSearchParams(this.entries, query);\n};\n\nvar validateArgumentsLength = function (passed, required) {\n if (passed < required) throw TypeError('Not enough arguments');\n};\n\nvar URLSearchParamsIterator = createIteratorConstructor(function Iterator(params, kind) {\n setInternalState(this, {\n type: URL_SEARCH_PARAMS_ITERATOR,\n iterator: getIterator(getInternalParamsState(params).entries),\n kind: kind\n });\n}, 'Iterator', function next() {\n var state = getInternalIteratorState(this);\n var kind = state.kind;\n var step = state.iterator.next();\n var entry = step.value;\n if (!step.done) {\n step.value = kind === 'keys' ? entry.key : kind === 'values' ? entry.value : [entry.key, entry.value];\n } return step;\n});\n\n// `URLSearchParams` constructor\n// https://url.spec.whatwg.org/#interface-urlsearchparams\nvar URLSearchParamsConstructor = function URLSearchParams(/* init */) {\n anInstance(this, URLSearchParamsConstructor, URL_SEARCH_PARAMS);\n var init = arguments.length > 0 ? arguments[0] : undefined;\n var that = this;\n var entries = [];\n var iteratorMethod, iterator, next, step, entryIterator, entryNext, first, second, key;\n\n setInternalState(that, {\n type: URL_SEARCH_PARAMS,\n entries: entries,\n updateURL: function () { /* empty */ },\n updateSearchParams: updateSearchParams\n });\n\n if (init !== undefined) {\n if (isObject(init)) {\n iteratorMethod = getIteratorMethod(init);\n if (typeof iteratorMethod === 'function') {\n iterator = iteratorMethod.call(init);\n next = iterator.next;\n while (!(step = next.call(iterator)).done) {\n entryIterator = getIterator(anObject(step.value));\n entryNext = entryIterator.next;\n if (\n (first = entryNext.call(entryIterator)).done ||\n (second = entryNext.call(entryIterator)).done ||\n !entryNext.call(entryIterator).done\n ) throw TypeError('Expected sequence with length 2');\n entries.push({ key: $toString(first.value), value: $toString(second.value) });\n }\n } else for (key in init) if (hasOwn(init, key)) entries.push({ key: key, value: $toString(init[key]) });\n } else {\n parseSearchParams(\n entries,\n typeof init === 'string' ? init.charAt(0) === '?' ? init.slice(1) : init : $toString(init)\n );\n }\n }\n};\n\nvar URLSearchParamsPrototype = URLSearchParamsConstructor.prototype;\n\nredefineAll(URLSearchParamsPrototype, {\n // `URLSearchParams.prototype.append` method\n // https://url.spec.whatwg.org/#dom-urlsearchparams-append\n append: function append(name, value) {\n validateArgumentsLength(arguments.length, 2);\n var state = getInternalParamsState(this);\n state.entries.push({ key: $toString(name), value: $toString(value) });\n state.updateURL();\n },\n // `URLSearchParams.prototype.delete` method\n // https://url.spec.whatwg.org/#dom-urlsearchparams-delete\n 'delete': function (name) {\n validateArgumentsLength(arguments.length, 1);\n var state = getInternalParamsState(this);\n var entries = state.entries;\n var key = $toString(name);\n var index = 0;\n while (index < entries.length) {\n if (entries[index].key === key) entries.splice(index, 1);\n else index++;\n }\n state.updateURL();\n },\n // `URLSearchParams.prototype.get` method\n // https://url.spec.whatwg.org/#dom-urlsearchparams-get\n get: function get(name) {\n validateArgumentsLength(arguments.length, 1);\n var entries = getInternalParamsState(this).entries;\n var key = $toString(name);\n var index = 0;\n for (; index < entries.length; index++) {\n if (entries[index].key === key) return entries[index].value;\n }\n return null;\n },\n // `URLSearchParams.prototype.getAll` method\n // https://url.spec.whatwg.org/#dom-urlsearchparams-getall\n getAll: function getAll(name) {\n validateArgumentsLength(arguments.length, 1);\n var entries = getInternalParamsState(this).entries;\n var key = $toString(name);\n var result = [];\n var index = 0;\n for (; index < entries.length; index++) {\n if (entries[index].key === key) result.push(entries[index].value);\n }\n return result;\n },\n // `URLSearchParams.prototype.has` method\n // https://url.spec.whatwg.org/#dom-urlsearchparams-has\n has: function has(name) {\n validateArgumentsLength(arguments.length, 1);\n var entries = getInternalParamsState(this).entries;\n var key = $toString(name);\n var index = 0;\n while (index < entries.length) {\n if (entries[index++].key === key) return true;\n }\n return false;\n },\n // `URLSearchParams.prototype.set` method\n // https://url.spec.whatwg.org/#dom-urlsearchparams-set\n set: function set(name, value) {\n validateArgumentsLength(arguments.length, 1);\n var state = getInternalParamsState(this);\n var entries = state.entries;\n var found = false;\n var key = $toString(name);\n var val = $toString(value);\n var index = 0;\n var entry;\n for (; index < entries.length; index++) {\n entry = entries[index];\n if (entry.key === key) {\n if (found) entries.splice(index--, 1);\n else {\n found = true;\n entry.value = val;\n }\n }\n }\n if (!found) entries.push({ key: key, value: val });\n state.updateURL();\n },\n // `URLSearchParams.prototype.sort` method\n // https://url.spec.whatwg.org/#dom-urlsearchparams-sort\n sort: function sort() {\n var state = getInternalParamsState(this);\n var entries = state.entries;\n // Array#sort is not stable in some engines\n var slice = entries.slice();\n var entry, entriesIndex, sliceIndex;\n entries.length = 0;\n for (sliceIndex = 0; sliceIndex < slice.length; sliceIndex++) {\n entry = slice[sliceIndex];\n for (entriesIndex = 0; entriesIndex < sliceIndex; entriesIndex++) {\n if (entries[entriesIndex].key > entry.key) {\n entries.splice(entriesIndex, 0, entry);\n break;\n }\n }\n if (entriesIndex === sliceIndex) entries.push(entry);\n }\n state.updateURL();\n },\n // `URLSearchParams.prototype.forEach` method\n forEach: function forEach(callback /* , thisArg */) {\n var entries = getInternalParamsState(this).entries;\n var boundFunction = bind(callback, arguments.length > 1 ? arguments[1] : undefined, 3);\n var index = 0;\n var entry;\n while (index < entries.length) {\n entry = entries[index++];\n boundFunction(entry.value, entry.key, this);\n }\n },\n // `URLSearchParams.prototype.keys` method\n keys: function keys() {\n return new URLSearchParamsIterator(this, 'keys');\n },\n // `URLSearchParams.prototype.values` method\n values: function values() {\n return new URLSearchParamsIterator(this, 'values');\n },\n // `URLSearchParams.prototype.entries` method\n entries: function entries() {\n return new URLSearchParamsIterator(this, 'entries');\n }\n}, { enumerable: true });\n\n// `URLSearchParams.prototype[@@iterator]` method\nredefine(URLSearchParamsPrototype, ITERATOR, URLSearchParamsPrototype.entries);\n\n// `URLSearchParams.prototype.toString` method\n// https://url.spec.whatwg.org/#urlsearchparams-stringification-behavior\nredefine(URLSearchParamsPrototype, 'toString', function toString() {\n var entries = getInternalParamsState(this).entries;\n var result = [];\n var index = 0;\n var entry;\n while (index < entries.length) {\n entry = entries[index++];\n result.push(serialize(entry.key) + '=' + serialize(entry.value));\n } return result.join('&');\n}, { enumerable: true });\n\nsetToStringTag(URLSearchParamsConstructor, URL_SEARCH_PARAMS);\n\n$({ global: true, forced: !USE_NATIVE_URL }, {\n URLSearchParams: URLSearchParamsConstructor\n});\n\n// Wrap `fetch` and `Request` for correct work with polyfilled `URLSearchParams`\nif (!USE_NATIVE_URL && typeof Headers == 'function') {\n var wrapRequestOptions = function (init) {\n if (isObject(init)) {\n var body = init.body;\n var headers;\n if (classof(body) === URL_SEARCH_PARAMS) {\n headers = init.headers ? new Headers(init.headers) : new Headers();\n if (!headers.has('content-type')) {\n headers.set('content-type', 'application/x-www-form-urlencoded;charset=UTF-8');\n }\n return create(init, {\n body: createPropertyDescriptor(0, String(body)),\n headers: createPropertyDescriptor(0, headers)\n });\n }\n } return init;\n };\n\n if (typeof nativeFetch == 'function') {\n $({ global: true, enumerable: true, forced: true }, {\n fetch: function fetch(input /* , init */) {\n return nativeFetch(input, arguments.length > 1 ? wrapRequestOptions(arguments[1]) : {});\n }\n });\n }\n\n if (typeof NativeRequest == 'function') {\n var RequestConstructor = function Request(input /* , init */) {\n anInstance(this, RequestConstructor, 'Request');\n return new NativeRequest(input, arguments.length > 1 ? wrapRequestOptions(arguments[1]) : {});\n };\n\n RequestPrototype.constructor = RequestConstructor;\n RequestConstructor.prototype = RequestPrototype;\n\n $({ global: true, forced: true }, {\n Request: RequestConstructor\n });\n }\n}\n\nmodule.exports = {\n URLSearchParams: URLSearchParamsConstructor,\n getState: getInternalParamsState\n};\n","'use strict';\n// TODO: in core-js@4, move /modules/ dependencies to public entries for better optimization by tools like `preset-env`\nrequire('../modules/es.string.iterator');\nvar $ = require('../internals/export');\nvar DESCRIPTORS = require('../internals/descriptors');\nvar USE_NATIVE_URL = require('../internals/native-url');\nvar global = require('../internals/global');\nvar defineProperties = require('../internals/object-define-properties');\nvar redefine = require('../internals/redefine');\nvar anInstance = require('../internals/an-instance');\nvar has = require('../internals/has');\nvar assign = require('../internals/object-assign');\nvar arrayFrom = require('../internals/array-from');\nvar codeAt = require('../internals/string-multibyte').codeAt;\nvar toASCII = require('../internals/string-punycode-to-ascii');\nvar $toString = require('../internals/to-string');\nvar setToStringTag = require('../internals/set-to-string-tag');\nvar URLSearchParamsModule = require('../modules/web.url-search-params');\nvar InternalStateModule = require('../internals/internal-state');\n\nvar NativeURL = global.URL;\nvar URLSearchParams = URLSearchParamsModule.URLSearchParams;\nvar getInternalSearchParamsState = URLSearchParamsModule.getState;\nvar setInternalState = InternalStateModule.set;\nvar getInternalURLState = InternalStateModule.getterFor('URL');\nvar floor = Math.floor;\nvar pow = Math.pow;\n\nvar INVALID_AUTHORITY = 'Invalid authority';\nvar INVALID_SCHEME = 'Invalid scheme';\nvar INVALID_HOST = 'Invalid host';\nvar INVALID_PORT = 'Invalid port';\n\nvar ALPHA = /[A-Za-z]/;\n// eslint-disable-next-line regexp/no-obscure-range -- safe\nvar ALPHANUMERIC = /[\\d+-.A-Za-z]/;\nvar DIGIT = /\\d/;\nvar HEX_START = /^0x/i;\nvar OCT = /^[0-7]+$/;\nvar DEC = /^\\d+$/;\nvar HEX = /^[\\dA-Fa-f]+$/;\n/* eslint-disable no-control-regex -- safe */\nvar FORBIDDEN_HOST_CODE_POINT = /[\\0\\t\\n\\r #%/:<>?@[\\\\\\]^|]/;\nvar FORBIDDEN_HOST_CODE_POINT_EXCLUDING_PERCENT = /[\\0\\t\\n\\r #/:<>?@[\\\\\\]^|]/;\nvar LEADING_AND_TRAILING_C0_CONTROL_OR_SPACE = /^[\\u0000-\\u0020]+|[\\u0000-\\u0020]+$/g;\nvar TAB_AND_NEW_LINE = /[\\t\\n\\r]/g;\n/* eslint-enable no-control-regex -- safe */\nvar EOF;\n\nvar parseHost = function (url, input) {\n var result, codePoints, index;\n if (input.charAt(0) == '[') {\n if (input.charAt(input.length - 1) != ']') return INVALID_HOST;\n result = parseIPv6(input.slice(1, -1));\n if (!result) return INVALID_HOST;\n url.host = result;\n // opaque host\n } else if (!isSpecial(url)) {\n if (FORBIDDEN_HOST_CODE_POINT_EXCLUDING_PERCENT.test(input)) return INVALID_HOST;\n result = '';\n codePoints = arrayFrom(input);\n for (index = 0; index < codePoints.length; index++) {\n result += percentEncode(codePoints[index], C0ControlPercentEncodeSet);\n }\n url.host = result;\n } else {\n input = toASCII(input);\n if (FORBIDDEN_HOST_CODE_POINT.test(input)) return INVALID_HOST;\n result = parseIPv4(input);\n if (result === null) return INVALID_HOST;\n url.host = result;\n }\n};\n\nvar parseIPv4 = function (input) {\n var parts = input.split('.');\n var partsLength, numbers, index, part, radix, number, ipv4;\n if (parts.length && parts[parts.length - 1] == '') {\n parts.pop();\n }\n partsLength = parts.length;\n if (partsLength > 4) return input;\n numbers = [];\n for (index = 0; index < partsLength; index++) {\n part = parts[index];\n if (part == '') return input;\n radix = 10;\n if (part.length > 1 && part.charAt(0) == '0') {\n radix = HEX_START.test(part) ? 16 : 8;\n part = part.slice(radix == 8 ? 1 : 2);\n }\n if (part === '') {\n number = 0;\n } else {\n if (!(radix == 10 ? DEC : radix == 8 ? OCT : HEX).test(part)) return input;\n number = parseInt(part, radix);\n }\n numbers.push(number);\n }\n for (index = 0; index < partsLength; index++) {\n number = numbers[index];\n if (index == partsLength - 1) {\n if (number >= pow(256, 5 - partsLength)) return null;\n } else if (number > 255) return null;\n }\n ipv4 = numbers.pop();\n for (index = 0; index < numbers.length; index++) {\n ipv4 += numbers[index] * pow(256, 3 - index);\n }\n return ipv4;\n};\n\n// eslint-disable-next-line max-statements -- TODO\nvar parseIPv6 = function (input) {\n var address = [0, 0, 0, 0, 0, 0, 0, 0];\n var pieceIndex = 0;\n var compress = null;\n var pointer = 0;\n var value, length, numbersSeen, ipv4Piece, number, swaps, swap;\n\n var char = function () {\n return input.charAt(pointer);\n };\n\n if (char() == ':') {\n if (input.charAt(1) != ':') return;\n pointer += 2;\n pieceIndex++;\n compress = pieceIndex;\n }\n while (char()) {\n if (pieceIndex == 8) return;\n if (char() == ':') {\n if (compress !== null) return;\n pointer++;\n pieceIndex++;\n compress = pieceIndex;\n continue;\n }\n value = length = 0;\n while (length < 4 && HEX.test(char())) {\n value = value * 16 + parseInt(char(), 16);\n pointer++;\n length++;\n }\n if (char() == '.') {\n if (length == 0) return;\n pointer -= length;\n if (pieceIndex > 6) return;\n numbersSeen = 0;\n while (char()) {\n ipv4Piece = null;\n if (numbersSeen > 0) {\n if (char() == '.' && numbersSeen < 4) pointer++;\n else return;\n }\n if (!DIGIT.test(char())) return;\n while (DIGIT.test(char())) {\n number = parseInt(char(), 10);\n if (ipv4Piece === null) ipv4Piece = number;\n else if (ipv4Piece == 0) return;\n else ipv4Piece = ipv4Piece * 10 + number;\n if (ipv4Piece > 255) return;\n pointer++;\n }\n address[pieceIndex] = address[pieceIndex] * 256 + ipv4Piece;\n numbersSeen++;\n if (numbersSeen == 2 || numbersSeen == 4) pieceIndex++;\n }\n if (numbersSeen != 4) return;\n break;\n } else if (char() == ':') {\n pointer++;\n if (!char()) return;\n } else if (char()) return;\n address[pieceIndex++] = value;\n }\n if (compress !== null) {\n swaps = pieceIndex - compress;\n pieceIndex = 7;\n while (pieceIndex != 0 && swaps > 0) {\n swap = address[pieceIndex];\n address[pieceIndex--] = address[compress + swaps - 1];\n address[compress + --swaps] = swap;\n }\n } else if (pieceIndex != 8) return;\n return address;\n};\n\nvar findLongestZeroSequence = function (ipv6) {\n var maxIndex = null;\n var maxLength = 1;\n var currStart = null;\n var currLength = 0;\n var index = 0;\n for (; index < 8; index++) {\n if (ipv6[index] !== 0) {\n if (currLength > maxLength) {\n maxIndex = currStart;\n maxLength = currLength;\n }\n currStart = null;\n currLength = 0;\n } else {\n if (currStart === null) currStart = index;\n ++currLength;\n }\n }\n if (currLength > maxLength) {\n maxIndex = currStart;\n maxLength = currLength;\n }\n return maxIndex;\n};\n\nvar serializeHost = function (host) {\n var result, index, compress, ignore0;\n // ipv4\n if (typeof host == 'number') {\n result = [];\n for (index = 0; index < 4; index++) {\n result.unshift(host % 256);\n host = floor(host / 256);\n } return result.join('.');\n // ipv6\n } else if (typeof host == 'object') {\n result = '';\n compress = findLongestZeroSequence(host);\n for (index = 0; index < 8; index++) {\n if (ignore0 && host[index] === 0) continue;\n if (ignore0) ignore0 = false;\n if (compress === index) {\n result += index ? ':' : '::';\n ignore0 = true;\n } else {\n result += host[index].toString(16);\n if (index < 7) result += ':';\n }\n }\n return '[' + result + ']';\n } return host;\n};\n\nvar C0ControlPercentEncodeSet = {};\nvar fragmentPercentEncodeSet = assign({}, C0ControlPercentEncodeSet, {\n ' ': 1, '\"': 1, '<': 1, '>': 1, '`': 1\n});\nvar pathPercentEncodeSet = assign({}, fragmentPercentEncodeSet, {\n '#': 1, '?': 1, '{': 1, '}': 1\n});\nvar userinfoPercentEncodeSet = assign({}, pathPercentEncodeSet, {\n '/': 1, ':': 1, ';': 1, '=': 1, '@': 1, '[': 1, '\\\\': 1, ']': 1, '^': 1, '|': 1\n});\n\nvar percentEncode = function (char, set) {\n var code = codeAt(char, 0);\n return code > 0x20 && code < 0x7F && !has(set, char) ? char : encodeURIComponent(char);\n};\n\nvar specialSchemes = {\n ftp: 21,\n file: null,\n http: 80,\n https: 443,\n ws: 80,\n wss: 443\n};\n\nvar isSpecial = function (url) {\n return has(specialSchemes, url.scheme);\n};\n\nvar includesCredentials = function (url) {\n return url.username != '' || url.password != '';\n};\n\nvar cannotHaveUsernamePasswordPort = function (url) {\n return !url.host || url.cannotBeABaseURL || url.scheme == 'file';\n};\n\nvar isWindowsDriveLetter = function (string, normalized) {\n var second;\n return string.length == 2 && ALPHA.test(string.charAt(0))\n && ((second = string.charAt(1)) == ':' || (!normalized && second == '|'));\n};\n\nvar startsWithWindowsDriveLetter = function (string) {\n var third;\n return string.length > 1 && isWindowsDriveLetter(string.slice(0, 2)) && (\n string.length == 2 ||\n ((third = string.charAt(2)) === '/' || third === '\\\\' || third === '?' || third === '#')\n );\n};\n\nvar shortenURLsPath = function (url) {\n var path = url.path;\n var pathSize = path.length;\n if (pathSize && (url.scheme != 'file' || pathSize != 1 || !isWindowsDriveLetter(path[0], true))) {\n path.pop();\n }\n};\n\nvar isSingleDot = function (segment) {\n return segment === '.' || segment.toLowerCase() === '%2e';\n};\n\nvar isDoubleDot = function (segment) {\n segment = segment.toLowerCase();\n return segment === '..' || segment === '%2e.' || segment === '.%2e' || segment === '%2e%2e';\n};\n\n// States:\nvar SCHEME_START = {};\nvar SCHEME = {};\nvar NO_SCHEME = {};\nvar SPECIAL_RELATIVE_OR_AUTHORITY = {};\nvar PATH_OR_AUTHORITY = {};\nvar RELATIVE = {};\nvar RELATIVE_SLASH = {};\nvar SPECIAL_AUTHORITY_SLASHES = {};\nvar SPECIAL_AUTHORITY_IGNORE_SLASHES = {};\nvar AUTHORITY = {};\nvar HOST = {};\nvar HOSTNAME = {};\nvar PORT = {};\nvar FILE = {};\nvar FILE_SLASH = {};\nvar FILE_HOST = {};\nvar PATH_START = {};\nvar PATH = {};\nvar CANNOT_BE_A_BASE_URL_PATH = {};\nvar QUERY = {};\nvar FRAGMENT = {};\n\n// eslint-disable-next-line max-statements -- TODO\nvar parseURL = function (url, input, stateOverride, base) {\n var state = stateOverride || SCHEME_START;\n var pointer = 0;\n var buffer = '';\n var seenAt = false;\n var seenBracket = false;\n var seenPasswordToken = false;\n var codePoints, char, bufferCodePoints, failure;\n\n if (!stateOverride) {\n url.scheme = '';\n url.username = '';\n url.password = '';\n url.host = null;\n url.port = null;\n url.path = [];\n url.query = null;\n url.fragment = null;\n url.cannotBeABaseURL = false;\n input = input.replace(LEADING_AND_TRAILING_C0_CONTROL_OR_SPACE, '');\n }\n\n input = input.replace(TAB_AND_NEW_LINE, '');\n\n codePoints = arrayFrom(input);\n\n while (pointer <= codePoints.length) {\n char = codePoints[pointer];\n switch (state) {\n case SCHEME_START:\n if (char && ALPHA.test(char)) {\n buffer += char.toLowerCase();\n state = SCHEME;\n } else if (!stateOverride) {\n state = NO_SCHEME;\n continue;\n } else return INVALID_SCHEME;\n break;\n\n case SCHEME:\n if (char && (ALPHANUMERIC.test(char) || char == '+' || char == '-' || char == '.')) {\n buffer += char.toLowerCase();\n } else if (char == ':') {\n if (stateOverride && (\n (isSpecial(url) != has(specialSchemes, buffer)) ||\n (buffer == 'file' && (includesCredentials(url) || url.port !== null)) ||\n (url.scheme == 'file' && !url.host)\n )) return;\n url.scheme = buffer;\n if (stateOverride) {\n if (isSpecial(url) && specialSchemes[url.scheme] == url.port) url.port = null;\n return;\n }\n buffer = '';\n if (url.scheme == 'file') {\n state = FILE;\n } else if (isSpecial(url) && base && base.scheme == url.scheme) {\n state = SPECIAL_RELATIVE_OR_AUTHORITY;\n } else if (isSpecial(url)) {\n state = SPECIAL_AUTHORITY_SLASHES;\n } else if (codePoints[pointer + 1] == '/') {\n state = PATH_OR_AUTHORITY;\n pointer++;\n } else {\n url.cannotBeABaseURL = true;\n url.path.push('');\n state = CANNOT_BE_A_BASE_URL_PATH;\n }\n } else if (!stateOverride) {\n buffer = '';\n state = NO_SCHEME;\n pointer = 0;\n continue;\n } else return INVALID_SCHEME;\n break;\n\n case NO_SCHEME:\n if (!base || (base.cannotBeABaseURL && char != '#')) return INVALID_SCHEME;\n if (base.cannotBeABaseURL && char == '#') {\n url.scheme = base.scheme;\n url.path = base.path.slice();\n url.query = base.query;\n url.fragment = '';\n url.cannotBeABaseURL = true;\n state = FRAGMENT;\n break;\n }\n state = base.scheme == 'file' ? FILE : RELATIVE;\n continue;\n\n case SPECIAL_RELATIVE_OR_AUTHORITY:\n if (char == '/' && codePoints[pointer + 1] == '/') {\n state = SPECIAL_AUTHORITY_IGNORE_SLASHES;\n pointer++;\n } else {\n state = RELATIVE;\n continue;\n } break;\n\n case PATH_OR_AUTHORITY:\n if (char == '/') {\n state = AUTHORITY;\n break;\n } else {\n state = PATH;\n continue;\n }\n\n case RELATIVE:\n url.scheme = base.scheme;\n if (char == EOF) {\n url.username = base.username;\n url.password = base.password;\n url.host = base.host;\n url.port = base.port;\n url.path = base.path.slice();\n url.query = base.query;\n } else if (char == '/' || (char == '\\\\' && isSpecial(url))) {\n state = RELATIVE_SLASH;\n } else if (char == '?') {\n url.username = base.username;\n url.password = base.password;\n url.host = base.host;\n url.port = base.port;\n url.path = base.path.slice();\n url.query = '';\n state = QUERY;\n } else if (char == '#') {\n url.username = base.username;\n url.password = base.password;\n url.host = base.host;\n url.port = base.port;\n url.path = base.path.slice();\n url.query = base.query;\n url.fragment = '';\n state = FRAGMENT;\n } else {\n url.username = base.username;\n url.password = base.password;\n url.host = base.host;\n url.port = base.port;\n url.path = base.path.slice();\n url.path.pop();\n state = PATH;\n continue;\n } break;\n\n case RELATIVE_SLASH:\n if (isSpecial(url) && (char == '/' || char == '\\\\')) {\n state = SPECIAL_AUTHORITY_IGNORE_SLASHES;\n } else if (char == '/') {\n state = AUTHORITY;\n } else {\n url.username = base.username;\n url.password = base.password;\n url.host = base.host;\n url.port = base.port;\n state = PATH;\n continue;\n } break;\n\n case SPECIAL_AUTHORITY_SLASHES:\n state = SPECIAL_AUTHORITY_IGNORE_SLASHES;\n if (char != '/' || buffer.charAt(pointer + 1) != '/') continue;\n pointer++;\n break;\n\n case SPECIAL_AUTHORITY_IGNORE_SLASHES:\n if (char != '/' && char != '\\\\') {\n state = AUTHORITY;\n continue;\n } break;\n\n case AUTHORITY:\n if (char == '@') {\n if (seenAt) buffer = '%40' + buffer;\n seenAt = true;\n bufferCodePoints = arrayFrom(buffer);\n for (var i = 0; i < bufferCodePoints.length; i++) {\n var codePoint = bufferCodePoints[i];\n if (codePoint == ':' && !seenPasswordToken) {\n seenPasswordToken = true;\n continue;\n }\n var encodedCodePoints = percentEncode(codePoint, userinfoPercentEncodeSet);\n if (seenPasswordToken) url.password += encodedCodePoints;\n else url.username += encodedCodePoints;\n }\n buffer = '';\n } else if (\n char == EOF || char == '/' || char == '?' || char == '#' ||\n (char == '\\\\' && isSpecial(url))\n ) {\n if (seenAt && buffer == '') return INVALID_AUTHORITY;\n pointer -= arrayFrom(buffer).length + 1;\n buffer = '';\n state = HOST;\n } else buffer += char;\n break;\n\n case HOST:\n case HOSTNAME:\n if (stateOverride && url.scheme == 'file') {\n state = FILE_HOST;\n continue;\n } else if (char == ':' && !seenBracket) {\n if (buffer == '') return INVALID_HOST;\n failure = parseHost(url, buffer);\n if (failure) return failure;\n buffer = '';\n state = PORT;\n if (stateOverride == HOSTNAME) return;\n } else if (\n char == EOF || char == '/' || char == '?' || char == '#' ||\n (char == '\\\\' && isSpecial(url))\n ) {\n if (isSpecial(url) && buffer == '') return INVALID_HOST;\n if (stateOverride && buffer == '' && (includesCredentials(url) || url.port !== null)) return;\n failure = parseHost(url, buffer);\n if (failure) return failure;\n buffer = '';\n state = PATH_START;\n if (stateOverride) return;\n continue;\n } else {\n if (char == '[') seenBracket = true;\n else if (char == ']') seenBracket = false;\n buffer += char;\n } break;\n\n case PORT:\n if (DIGIT.test(char)) {\n buffer += char;\n } else if (\n char == EOF || char == '/' || char == '?' || char == '#' ||\n (char == '\\\\' && isSpecial(url)) ||\n stateOverride\n ) {\n if (buffer != '') {\n var port = parseInt(buffer, 10);\n if (port > 0xFFFF) return INVALID_PORT;\n url.port = (isSpecial(url) && port === specialSchemes[url.scheme]) ? null : port;\n buffer = '';\n }\n if (stateOverride) return;\n state = PATH_START;\n continue;\n } else return INVALID_PORT;\n break;\n\n case FILE:\n url.scheme = 'file';\n if (char == '/' || char == '\\\\') state = FILE_SLASH;\n else if (base && base.scheme == 'file') {\n if (char == EOF) {\n url.host = base.host;\n url.path = base.path.slice();\n url.query = base.query;\n } else if (char == '?') {\n url.host = base.host;\n url.path = base.path.slice();\n url.query = '';\n state = QUERY;\n } else if (char == '#') {\n url.host = base.host;\n url.path = base.path.slice();\n url.query = base.query;\n url.fragment = '';\n state = FRAGMENT;\n } else {\n if (!startsWithWindowsDriveLetter(codePoints.slice(pointer).join(''))) {\n url.host = base.host;\n url.path = base.path.slice();\n shortenURLsPath(url);\n }\n state = PATH;\n continue;\n }\n } else {\n state = PATH;\n continue;\n } break;\n\n case FILE_SLASH:\n if (char == '/' || char == '\\\\') {\n state = FILE_HOST;\n break;\n }\n if (base && base.scheme == 'file' && !startsWithWindowsDriveLetter(codePoints.slice(pointer).join(''))) {\n if (isWindowsDriveLetter(base.path[0], true)) url.path.push(base.path[0]);\n else url.host = base.host;\n }\n state = PATH;\n continue;\n\n case FILE_HOST:\n if (char == EOF || char == '/' || char == '\\\\' || char == '?' || char == '#') {\n if (!stateOverride && isWindowsDriveLetter(buffer)) {\n state = PATH;\n } else if (buffer == '') {\n url.host = '';\n if (stateOverride) return;\n state = PATH_START;\n } else {\n failure = parseHost(url, buffer);\n if (failure) return failure;\n if (url.host == 'localhost') url.host = '';\n if (stateOverride) return;\n buffer = '';\n state = PATH_START;\n } continue;\n } else buffer += char;\n break;\n\n case PATH_START:\n if (isSpecial(url)) {\n state = PATH;\n if (char != '/' && char != '\\\\') continue;\n } else if (!stateOverride && char == '?') {\n url.query = '';\n state = QUERY;\n } else if (!stateOverride && char == '#') {\n url.fragment = '';\n state = FRAGMENT;\n } else if (char != EOF) {\n state = PATH;\n if (char != '/') continue;\n } break;\n\n case PATH:\n if (\n char == EOF || char == '/' ||\n (char == '\\\\' && isSpecial(url)) ||\n (!stateOverride && (char == '?' || char == '#'))\n ) {\n if (isDoubleDot(buffer)) {\n shortenURLsPath(url);\n if (char != '/' && !(char == '\\\\' && isSpecial(url))) {\n url.path.push('');\n }\n } else if (isSingleDot(buffer)) {\n if (char != '/' && !(char == '\\\\' && isSpecial(url))) {\n url.path.push('');\n }\n } else {\n if (url.scheme == 'file' && !url.path.length && isWindowsDriveLetter(buffer)) {\n if (url.host) url.host = '';\n buffer = buffer.charAt(0) + ':'; // normalize windows drive letter\n }\n url.path.push(buffer);\n }\n buffer = '';\n if (url.scheme == 'file' && (char == EOF || char == '?' || char == '#')) {\n while (url.path.length > 1 && url.path[0] === '') {\n url.path.shift();\n }\n }\n if (char == '?') {\n url.query = '';\n state = QUERY;\n } else if (char == '#') {\n url.fragment = '';\n state = FRAGMENT;\n }\n } else {\n buffer += percentEncode(char, pathPercentEncodeSet);\n } break;\n\n case CANNOT_BE_A_BASE_URL_PATH:\n if (char == '?') {\n url.query = '';\n state = QUERY;\n } else if (char == '#') {\n url.fragment = '';\n state = FRAGMENT;\n } else if (char != EOF) {\n url.path[0] += percentEncode(char, C0ControlPercentEncodeSet);\n } break;\n\n case QUERY:\n if (!stateOverride && char == '#') {\n url.fragment = '';\n state = FRAGMENT;\n } else if (char != EOF) {\n if (char == \"'\" && isSpecial(url)) url.query += '%27';\n else if (char == '#') url.query += '%23';\n else url.query += percentEncode(char, C0ControlPercentEncodeSet);\n } break;\n\n case FRAGMENT:\n if (char != EOF) url.fragment += percentEncode(char, fragmentPercentEncodeSet);\n break;\n }\n\n pointer++;\n }\n};\n\n// `URL` constructor\n// https://url.spec.whatwg.org/#url-class\nvar URLConstructor = function URL(url /* , base */) {\n var that = anInstance(this, URLConstructor, 'URL');\n var base = arguments.length > 1 ? arguments[1] : undefined;\n var urlString = $toString(url);\n var state = setInternalState(that, { type: 'URL' });\n var baseState, failure;\n if (base !== undefined) {\n if (base instanceof URLConstructor) baseState = getInternalURLState(base);\n else {\n failure = parseURL(baseState = {}, $toString(base));\n if (failure) throw TypeError(failure);\n }\n }\n failure = parseURL(state, urlString, null, baseState);\n if (failure) throw TypeError(failure);\n var searchParams = state.searchParams = new URLSearchParams();\n var searchParamsState = getInternalSearchParamsState(searchParams);\n searchParamsState.updateSearchParams(state.query);\n searchParamsState.updateURL = function () {\n state.query = String(searchParams) || null;\n };\n if (!DESCRIPTORS) {\n that.href = serializeURL.call(that);\n that.origin = getOrigin.call(that);\n that.protocol = getProtocol.call(that);\n that.username = getUsername.call(that);\n that.password = getPassword.call(that);\n that.host = getHost.call(that);\n that.hostname = getHostname.call(that);\n that.port = getPort.call(that);\n that.pathname = getPathname.call(that);\n that.search = getSearch.call(that);\n that.searchParams = getSearchParams.call(that);\n that.hash = getHash.call(that);\n }\n};\n\nvar URLPrototype = URLConstructor.prototype;\n\nvar serializeURL = function () {\n var url = getInternalURLState(this);\n var scheme = url.scheme;\n var username = url.username;\n var password = url.password;\n var host = url.host;\n var port = url.port;\n var path = url.path;\n var query = url.query;\n var fragment = url.fragment;\n var output = scheme + ':';\n if (host !== null) {\n output += '//';\n if (includesCredentials(url)) {\n output += username + (password ? ':' + password : '') + '@';\n }\n output += serializeHost(host);\n if (port !== null) output += ':' + port;\n } else if (scheme == 'file') output += '//';\n output += url.cannotBeABaseURL ? path[0] : path.length ? '/' + path.join('/') : '';\n if (query !== null) output += '?' + query;\n if (fragment !== null) output += '#' + fragment;\n return output;\n};\n\nvar getOrigin = function () {\n var url = getInternalURLState(this);\n var scheme = url.scheme;\n var port = url.port;\n if (scheme == 'blob') try {\n return new URLConstructor(scheme.path[0]).origin;\n } catch (error) {\n return 'null';\n }\n if (scheme == 'file' || !isSpecial(url)) return 'null';\n return scheme + '://' + serializeHost(url.host) + (port !== null ? ':' + port : '');\n};\n\nvar getProtocol = function () {\n return getInternalURLState(this).scheme + ':';\n};\n\nvar getUsername = function () {\n return getInternalURLState(this).username;\n};\n\nvar getPassword = function () {\n return getInternalURLState(this).password;\n};\n\nvar getHost = function () {\n var url = getInternalURLState(this);\n var host = url.host;\n var port = url.port;\n return host === null ? ''\n : port === null ? serializeHost(host)\n : serializeHost(host) + ':' + port;\n};\n\nvar getHostname = function () {\n var host = getInternalURLState(this).host;\n return host === null ? '' : serializeHost(host);\n};\n\nvar getPort = function () {\n var port = getInternalURLState(this).port;\n return port === null ? '' : String(port);\n};\n\nvar getPathname = function () {\n var url = getInternalURLState(this);\n var path = url.path;\n return url.cannotBeABaseURL ? path[0] : path.length ? '/' + path.join('/') : '';\n};\n\nvar getSearch = function () {\n var query = getInternalURLState(this).query;\n return query ? '?' + query : '';\n};\n\nvar getSearchParams = function () {\n return getInternalURLState(this).searchParams;\n};\n\nvar getHash = function () {\n var fragment = getInternalURLState(this).fragment;\n return fragment ? '#' + fragment : '';\n};\n\nvar accessorDescriptor = function (getter, setter) {\n return { get: getter, set: setter, configurable: true, enumerable: true };\n};\n\nif (DESCRIPTORS) {\n defineProperties(URLPrototype, {\n // `URL.prototype.href` accessors pair\n // https://url.spec.whatwg.org/#dom-url-href\n href: accessorDescriptor(serializeURL, function (href) {\n var url = getInternalURLState(this);\n var urlString = $toString(href);\n var failure = parseURL(url, urlString);\n if (failure) throw TypeError(failure);\n getInternalSearchParamsState(url.searchParams).updateSearchParams(url.query);\n }),\n // `URL.prototype.origin` getter\n // https://url.spec.whatwg.org/#dom-url-origin\n origin: accessorDescriptor(getOrigin),\n // `URL.prototype.protocol` accessors pair\n // https://url.spec.whatwg.org/#dom-url-protocol\n protocol: accessorDescriptor(getProtocol, function (protocol) {\n var url = getInternalURLState(this);\n parseURL(url, $toString(protocol) + ':', SCHEME_START);\n }),\n // `URL.prototype.username` accessors pair\n // https://url.spec.whatwg.org/#dom-url-username\n username: accessorDescriptor(getUsername, function (username) {\n var url = getInternalURLState(this);\n var codePoints = arrayFrom($toString(username));\n if (cannotHaveUsernamePasswordPort(url)) return;\n url.username = '';\n for (var i = 0; i < codePoints.length; i++) {\n url.username += percentEncode(codePoints[i], userinfoPercentEncodeSet);\n }\n }),\n // `URL.prototype.password` accessors pair\n // https://url.spec.whatwg.org/#dom-url-password\n password: accessorDescriptor(getPassword, function (password) {\n var url = getInternalURLState(this);\n var codePoints = arrayFrom($toString(password));\n if (cannotHaveUsernamePasswordPort(url)) return;\n url.password = '';\n for (var i = 0; i < codePoints.length; i++) {\n url.password += percentEncode(codePoints[i], userinfoPercentEncodeSet);\n }\n }),\n // `URL.prototype.host` accessors pair\n // https://url.spec.whatwg.org/#dom-url-host\n host: accessorDescriptor(getHost, function (host) {\n var url = getInternalURLState(this);\n if (url.cannotBeABaseURL) return;\n parseURL(url, $toString(host), HOST);\n }),\n // `URL.prototype.hostname` accessors pair\n // https://url.spec.whatwg.org/#dom-url-hostname\n hostname: accessorDescriptor(getHostname, function (hostname) {\n var url = getInternalURLState(this);\n if (url.cannotBeABaseURL) return;\n parseURL(url, $toString(hostname), HOSTNAME);\n }),\n // `URL.prototype.port` accessors pair\n // https://url.spec.whatwg.org/#dom-url-port\n port: accessorDescriptor(getPort, function (port) {\n var url = getInternalURLState(this);\n if (cannotHaveUsernamePasswordPort(url)) return;\n port = $toString(port);\n if (port == '') url.port = null;\n else parseURL(url, port, PORT);\n }),\n // `URL.prototype.pathname` accessors pair\n // https://url.spec.whatwg.org/#dom-url-pathname\n pathname: accessorDescriptor(getPathname, function (pathname) {\n var url = getInternalURLState(this);\n if (url.cannotBeABaseURL) return;\n url.path = [];\n parseURL(url, $toString(pathname), PATH_START);\n }),\n // `URL.prototype.search` accessors pair\n // https://url.spec.whatwg.org/#dom-url-search\n search: accessorDescriptor(getSearch, function (search) {\n var url = getInternalURLState(this);\n search = $toString(search);\n if (search == '') {\n url.query = null;\n } else {\n if ('?' == search.charAt(0)) search = search.slice(1);\n url.query = '';\n parseURL(url, search, QUERY);\n }\n getInternalSearchParamsState(url.searchParams).updateSearchParams(url.query);\n }),\n // `URL.prototype.searchParams` getter\n // https://url.spec.whatwg.org/#dom-url-searchparams\n searchParams: accessorDescriptor(getSearchParams),\n // `URL.prototype.hash` accessors pair\n // https://url.spec.whatwg.org/#dom-url-hash\n hash: accessorDescriptor(getHash, function (hash) {\n var url = getInternalURLState(this);\n hash = $toString(hash);\n if (hash == '') {\n url.fragment = null;\n return;\n }\n if ('#' == hash.charAt(0)) hash = hash.slice(1);\n url.fragment = '';\n parseURL(url, hash, FRAGMENT);\n })\n });\n}\n\n// `URL.prototype.toJSON` method\n// https://url.spec.whatwg.org/#dom-url-tojson\nredefine(URLPrototype, 'toJSON', function toJSON() {\n return serializeURL.call(this);\n}, { enumerable: true });\n\n// `URL.prototype.toString` method\n// https://url.spec.whatwg.org/#URL-stringification-behavior\nredefine(URLPrototype, 'toString', function toString() {\n return serializeURL.call(this);\n}, { enumerable: true });\n\nif (NativeURL) {\n var nativeCreateObjectURL = NativeURL.createObjectURL;\n var nativeRevokeObjectURL = NativeURL.revokeObjectURL;\n // `URL.createObjectURL` method\n // https://developer.mozilla.org/en-US/docs/Web/API/URL/createObjectURL\n // eslint-disable-next-line no-unused-vars -- required for `.length`\n if (nativeCreateObjectURL) redefine(URLConstructor, 'createObjectURL', function createObjectURL(blob) {\n return nativeCreateObjectURL.apply(NativeURL, arguments);\n });\n // `URL.revokeObjectURL` method\n // https://developer.mozilla.org/en-US/docs/Web/API/URL/revokeObjectURL\n // eslint-disable-next-line no-unused-vars -- required for `.length`\n if (nativeRevokeObjectURL) redefine(URLConstructor, 'revokeObjectURL', function revokeObjectURL(url) {\n return nativeRevokeObjectURL.apply(NativeURL, arguments);\n });\n}\n\nsetToStringTag(URLConstructor, 'URL');\n\n$({ global: true, forced: !USE_NATIVE_URL, sham: !DESCRIPTORS }, {\n URL: URLConstructor\n});\n","'use strict';\nvar $forEach = require('../internals/array-iteration').forEach;\nvar arrayMethodIsStrict = require('../internals/array-method-is-strict');\n\nvar STRICT_METHOD = arrayMethodIsStrict('forEach');\n\n// `Array.prototype.forEach` method implementation\n// https://tc39.es/ecma262/#sec-array.prototype.foreach\nmodule.exports = !STRICT_METHOD ? function forEach(callbackfn /* , thisArg */) {\n return $forEach(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined);\n// eslint-disable-next-line es/no-array-prototype-foreach -- safe\n} : [].forEach;\n","var global = require('../internals/global');\nvar DOMIterables = require('../internals/dom-iterables');\nvar forEach = require('../internals/array-for-each');\nvar createNonEnumerableProperty = require('../internals/create-non-enumerable-property');\n\nfor (var COLLECTION_NAME in DOMIterables) {\n var Collection = global[COLLECTION_NAME];\n var CollectionPrototype = Collection && Collection.prototype;\n // some Chrome versions have non-configurable methods on DOMTokenList\n if (CollectionPrototype && CollectionPrototype.forEach !== forEach) try {\n createNonEnumerableProperty(CollectionPrototype, 'forEach', forEach);\n } catch (error) {\n CollectionPrototype.forEach = forEach;\n }\n}\n","var DESCRIPTORS = require('../internals/descriptors');\nvar objectKeys = require('../internals/object-keys');\nvar toIndexedObject = require('../internals/to-indexed-object');\nvar propertyIsEnumerable = require('../internals/object-property-is-enumerable').f;\n\n// `Object.{ entries, values }` methods implementation\nvar createMethod = function (TO_ENTRIES) {\n return function (it) {\n var O = toIndexedObject(it);\n var keys = objectKeys(O);\n var length = keys.length;\n var i = 0;\n var result = [];\n var key;\n while (length > i) {\n key = keys[i++];\n if (!DESCRIPTORS || propertyIsEnumerable.call(O, key)) {\n result.push(TO_ENTRIES ? [key, O[key]] : O[key]);\n }\n }\n return result;\n };\n};\n\nmodule.exports = {\n // `Object.entries` method\n // https://tc39.es/ecma262/#sec-object.entries\n entries: createMethod(true),\n // `Object.values` method\n // https://tc39.es/ecma262/#sec-object.values\n values: createMethod(false)\n};\n","var $ = require('../internals/export');\nvar $entries = require('../internals/object-to-array').entries;\n\n// `Object.entries` method\n// https://tc39.es/ecma262/#sec-object.entries\n$({ target: 'Object', stat: true }, {\n entries: function entries(O) {\n return $entries(O);\n }\n});\n","var isRegExp = require('../internals/is-regexp');\n\nmodule.exports = function (it) {\n if (isRegExp(it)) {\n throw TypeError(\"The method doesn't accept regular expressions\");\n } return it;\n};\n","'use strict';\nvar $ = require('../internals/export');\nvar getOwnPropertyDescriptor = require('../internals/object-get-own-property-descriptor').f;\nvar toLength = require('../internals/to-length');\nvar toString = require('../internals/to-string');\nvar notARegExp = require('../internals/not-a-regexp');\nvar requireObjectCoercible = require('../internals/require-object-coercible');\nvar correctIsRegExpLogic = require('../internals/correct-is-regexp-logic');\nvar IS_PURE = require('../internals/is-pure');\n\n// eslint-disable-next-line es/no-string-prototype-startswith -- safe\nvar $startsWith = ''.startsWith;\nvar min = Math.min;\n\nvar CORRECT_IS_REGEXP_LOGIC = correctIsRegExpLogic('startsWith');\n// https://github.com/zloirock/core-js/pull/702\nvar MDN_POLYFILL_BUG = !IS_PURE && !CORRECT_IS_REGEXP_LOGIC && !!function () {\n var descriptor = getOwnPropertyDescriptor(String.prototype, 'startsWith');\n return descriptor && !descriptor.writable;\n}();\n\n// `String.prototype.startsWith` method\n// https://tc39.es/ecma262/#sec-string.prototype.startswith\n$({ target: 'String', proto: true, forced: !MDN_POLYFILL_BUG && !CORRECT_IS_REGEXP_LOGIC }, {\n startsWith: function startsWith(searchString /* , position = 0 */) {\n var that = toString(requireObjectCoercible(this));\n notARegExp(searchString);\n var index = toLength(min(arguments.length > 1 ? arguments[1] : undefined, that.length));\n var search = toString(searchString);\n return $startsWith\n ? $startsWith.call(that, search, index)\n : that.slice(index, index + search.length) === search;\n }\n});\n","var toObject = require('../internals/to-object');\n\nvar floor = Math.floor;\nvar replace = ''.replace;\nvar SUBSTITUTION_SYMBOLS = /\\$([$&'`]|\\d{1,2}|<[^>]*>)/g;\nvar SUBSTITUTION_SYMBOLS_NO_NAMED = /\\$([$&'`]|\\d{1,2})/g;\n\n// `GetSubstitution` abstract operation\n// https://tc39.es/ecma262/#sec-getsubstitution\nmodule.exports = function (matched, str, position, captures, namedCaptures, replacement) {\n var tailPos = position + matched.length;\n var m = captures.length;\n var symbols = SUBSTITUTION_SYMBOLS_NO_NAMED;\n if (namedCaptures !== undefined) {\n namedCaptures = toObject(namedCaptures);\n symbols = SUBSTITUTION_SYMBOLS;\n }\n return replace.call(replacement, symbols, function (match, ch) {\n var capture;\n switch (ch.charAt(0)) {\n case '$': return '$';\n case '&': return matched;\n case '`': return str.slice(0, position);\n case \"'\": return str.slice(tailPos);\n case '<':\n capture = namedCaptures[ch.slice(1, -1)];\n break;\n default: // \\d\\d?\n var n = +ch;\n if (n === 0) return match;\n if (n > m) {\n var f = floor(n / 10);\n if (f === 0) return match;\n if (f <= m) return captures[f - 1] === undefined ? ch.charAt(1) : captures[f - 1] + ch.charAt(1);\n return match;\n }\n capture = captures[n - 1];\n }\n return capture === undefined ? '' : capture;\n });\n};\n","'use strict';\nvar fixRegExpWellKnownSymbolLogic = require('../internals/fix-regexp-well-known-symbol-logic');\nvar fails = require('../internals/fails');\nvar anObject = require('../internals/an-object');\nvar toInteger = require('../internals/to-integer');\nvar toLength = require('../internals/to-length');\nvar toString = require('../internals/to-string');\nvar requireObjectCoercible = require('../internals/require-object-coercible');\nvar advanceStringIndex = require('../internals/advance-string-index');\nvar getSubstitution = require('../internals/get-substitution');\nvar regExpExec = require('../internals/regexp-exec-abstract');\nvar wellKnownSymbol = require('../internals/well-known-symbol');\n\nvar REPLACE = wellKnownSymbol('replace');\nvar max = Math.max;\nvar min = Math.min;\n\nvar maybeToString = function (it) {\n return it === undefined ? it : String(it);\n};\n\n// IE <= 11 replaces $0 with the whole match, as if it was $&\n// https://stackoverflow.com/questions/6024666/getting-ie-to-replace-a-regex-with-the-literal-string-0\nvar REPLACE_KEEPS_$0 = (function () {\n // eslint-disable-next-line regexp/prefer-escape-replacement-dollar-char -- required for testing\n return 'a'.replace(/./, '$0') === '$0';\n})();\n\n// Safari <= 13.0.3(?) substitutes nth capture where n>m with an empty string\nvar REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE = (function () {\n if (/./[REPLACE]) {\n return /./[REPLACE]('a', '$0') === '';\n }\n return false;\n})();\n\nvar REPLACE_SUPPORTS_NAMED_GROUPS = !fails(function () {\n var re = /./;\n re.exec = function () {\n var result = [];\n result.groups = { a: '7' };\n return result;\n };\n return ''.replace(re, '$') !== '7';\n});\n\n// @@replace logic\nfixRegExpWellKnownSymbolLogic('replace', function (_, nativeReplace, maybeCallNative) {\n var UNSAFE_SUBSTITUTE = REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE ? '$' : '$0';\n\n return [\n // `String.prototype.replace` method\n // https://tc39.es/ecma262/#sec-string.prototype.replace\n function replace(searchValue, replaceValue) {\n var O = requireObjectCoercible(this);\n var replacer = searchValue == undefined ? undefined : searchValue[REPLACE];\n return replacer !== undefined\n ? replacer.call(searchValue, O, replaceValue)\n : nativeReplace.call(toString(O), searchValue, replaceValue);\n },\n // `RegExp.prototype[@@replace]` method\n // https://tc39.es/ecma262/#sec-regexp.prototype-@@replace\n function (string, replaceValue) {\n var rx = anObject(this);\n var S = toString(string);\n\n if (\n typeof replaceValue === 'string' &&\n replaceValue.indexOf(UNSAFE_SUBSTITUTE) === -1 &&\n replaceValue.indexOf('$<') === -1\n ) {\n var res = maybeCallNative(nativeReplace, rx, S, replaceValue);\n if (res.done) return res.value;\n }\n\n var functionalReplace = typeof replaceValue === 'function';\n if (!functionalReplace) replaceValue = toString(replaceValue);\n\n var global = rx.global;\n if (global) {\n var fullUnicode = rx.unicode;\n rx.lastIndex = 0;\n }\n var results = [];\n while (true) {\n var result = regExpExec(rx, S);\n if (result === null) break;\n\n results.push(result);\n if (!global) break;\n\n var matchStr = toString(result[0]);\n if (matchStr === '') rx.lastIndex = advanceStringIndex(S, toLength(rx.lastIndex), fullUnicode);\n }\n\n var accumulatedResult = '';\n var nextSourcePosition = 0;\n for (var i = 0; i < results.length; i++) {\n result = results[i];\n\n var matched = toString(result[0]);\n var position = max(min(toInteger(result.index), S.length), 0);\n var captures = [];\n // NOTE: This is equivalent to\n // captures = result.slice(1).map(maybeToString)\n // but for some reason `nativeSlice.call(result, 1, result.length)` (called in\n // the slice polyfill when slicing native arrays) \"doesn't work\" in safari 9 and\n // causes a crash (https://pastebin.com/N21QzeQA) when trying to debug it.\n for (var j = 1; j < result.length; j++) captures.push(maybeToString(result[j]));\n var namedCaptures = result.groups;\n if (functionalReplace) {\n var replacerArgs = [matched].concat(captures, position, S);\n if (namedCaptures !== undefined) replacerArgs.push(namedCaptures);\n var replacement = toString(replaceValue.apply(undefined, replacerArgs));\n } else {\n replacement = getSubstitution(matched, S, position, captures, namedCaptures, replaceValue);\n }\n if (position >= nextSourcePosition) {\n accumulatedResult += S.slice(nextSourcePosition, position) + replacement;\n nextSourcePosition = position + matched.length;\n }\n }\n return accumulatedResult + S.slice(nextSourcePosition);\n }\n ];\n}, !REPLACE_SUPPORTS_NAMED_GROUPS || !REPLACE_KEEPS_$0 || REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE);\n","'use strict';\nvar $ = require('../internals/export');\nvar fails = require('../internals/fails');\nvar isArray = require('../internals/is-array');\nvar isObject = require('../internals/is-object');\nvar toObject = require('../internals/to-object');\nvar toLength = require('../internals/to-length');\nvar createProperty = require('../internals/create-property');\nvar arraySpeciesCreate = require('../internals/array-species-create');\nvar arrayMethodHasSpeciesSupport = require('../internals/array-method-has-species-support');\nvar wellKnownSymbol = require('../internals/well-known-symbol');\nvar V8_VERSION = require('../internals/engine-v8-version');\n\nvar IS_CONCAT_SPREADABLE = wellKnownSymbol('isConcatSpreadable');\nvar MAX_SAFE_INTEGER = 0x1FFFFFFFFFFFFF;\nvar MAXIMUM_ALLOWED_INDEX_EXCEEDED = 'Maximum allowed index exceeded';\n\n// We can't use this feature detection in V8 since it causes\n// deoptimization and serious performance degradation\n// https://github.com/zloirock/core-js/issues/679\nvar IS_CONCAT_SPREADABLE_SUPPORT = V8_VERSION >= 51 || !fails(function () {\n var array = [];\n array[IS_CONCAT_SPREADABLE] = false;\n return array.concat()[0] !== array;\n});\n\nvar SPECIES_SUPPORT = arrayMethodHasSpeciesSupport('concat');\n\nvar isConcatSpreadable = function (O) {\n if (!isObject(O)) return false;\n var spreadable = O[IS_CONCAT_SPREADABLE];\n return spreadable !== undefined ? !!spreadable : isArray(O);\n};\n\nvar FORCED = !IS_CONCAT_SPREADABLE_SUPPORT || !SPECIES_SUPPORT;\n\n// `Array.prototype.concat` method\n// https://tc39.es/ecma262/#sec-array.prototype.concat\n// with adding support of @@isConcatSpreadable and @@species\n$({ target: 'Array', proto: true, forced: FORCED }, {\n // eslint-disable-next-line no-unused-vars -- required for `.length`\n concat: function concat(arg) {\n var O = toObject(this);\n var A = arraySpeciesCreate(O, 0);\n var n = 0;\n var i, k, length, len, E;\n for (i = -1, length = arguments.length; i < length; i++) {\n E = i === -1 ? O : arguments[i];\n if (isConcatSpreadable(E)) {\n len = toLength(E.length);\n if (n + len > MAX_SAFE_INTEGER) throw TypeError(MAXIMUM_ALLOWED_INDEX_EXCEEDED);\n for (k = 0; k < len; k++, n++) if (k in E) createProperty(A, n, E[k]);\n } else {\n if (n >= MAX_SAFE_INTEGER) throw TypeError(MAXIMUM_ALLOWED_INDEX_EXCEEDED);\n createProperty(A, n++, E);\n }\n }\n A.length = n;\n return A;\n }\n});\n","import * as UZIP from 'uzip';\n// eslint-disable-next-line import/no-cycle\nimport lib from './index';\nimport compress from './image-compression';\nimport { getNewCanvasAndCtx } from './utils';\nimport UPNG from './UPNG';\nimport MaxCanvasSize from './config/max-canvas-size';\n\nlet cnt = 0;\nlet imageCompressionLibUrl;\nlet worker;\n\nfunction createWorker(script) {\n if (typeof script === 'function') {\n script = `(${script})()`;\n }\n return new Worker(URL.createObjectURL(new Blob([script])));\n}\n\nfunction createSourceObject(str) {\n // console.log('createSourceObject', str)\n return URL.createObjectURL(new Blob([str], { type: 'application/javascript' }));\n}\n\nfunction stringify(o) {\n return JSON.stringify(o, (key, value) => ((typeof value === 'function') ? `BIC_FN:::(function () { return ${value.toString()} })()` : value));\n}\n\nfunction parse(o) {\n if (typeof o === 'string') return o;\n const result = {};\n Object.entries(o).forEach(([key, value]) => {\n if (typeof value === 'string' && value.startsWith('BIC_FN:::')) {\n try {\n result[key] = eval(value.replace(/^BIC_FN:::/, ''));\n } catch (e) {\n // console.log(key, e);\n throw e;\n }\n } else {\n result[key] = parse(value);\n }\n });\n return result;\n}\n\nfunction generateLib() {\n // prepare the lib to be used inside WebWorker\n return createSourceObject(`\n // reconstruct library\n function imageCompression (){return (${lib}).apply(null, arguments)}\n\n imageCompression.getDataUrlFromFile = ${lib.getDataUrlFromFile}\n imageCompression.getFilefromDataUrl = ${lib.getFilefromDataUrl}\n imageCompression.loadImage = ${lib.loadImage}\n imageCompression.drawImageInCanvas = ${lib.drawImageInCanvas}\n imageCompression.drawFileInCanvas = ${lib.drawFileInCanvas}\n imageCompression.canvasToFile = ${lib.canvasToFile}\n imageCompression.getExifOrientation = ${lib.getExifOrientation}\n imageCompression.handleMaxWidthOrHeight = ${lib.handleMaxWidthOrHeight}\n imageCompression.followExifOrientation = ${lib.followExifOrientation}\n imageCompression.cleanupCanvasMemory = ${lib.cleanupCanvasMemory}\n imageCompression.isAutoOrientationInBrowser = ${lib.isAutoOrientationInBrowser}\n imageCompression.approximateBelowMaximumCanvasSizeOfBrowser = ${lib.approximateBelowMaximumCanvasSizeOfBrowser}\n imageCompression.getBrowserName = ${lib.getBrowserName}\n\n // functions / objects\n getDataUrlFromFile = imageCompression.getDataUrlFromFile\n getFilefromDataUrl = imageCompression.getFilefromDataUrl\n loadImage = imageCompression.loadImage\n drawImageInCanvas = imageCompression.drawImageInCanvas\n drawFileInCanvas = imageCompression.drawFileInCanvas\n canvasToFile = imageCompression.canvasToFile\n getExifOrientation = imageCompression.getExifOrientation\n handleMaxWidthOrHeight = imageCompression.handleMaxWidthOrHeight\n followExifOrientation = imageCompression.followExifOrientation\n cleanupCanvasMemory = imageCompression.cleanupCanvasMemory\n isAutoOrientationInBrowser = imageCompression.isAutoOrientationInBrowser\n approximateBelowMaximumCanvasSizeOfBrowser = imageCompression.approximateBelowMaximumCanvasSizeOfBrowser\n getBrowserName = imageCompression.getBrowserName\n \n getNewCanvasAndCtx = ${getNewCanvasAndCtx}\n CustomFileReader = FileReader\n CustomFile = File\n MaxCanvasSize = ${JSON.stringify(MaxCanvasSize)}\n function compress (){return (${compress}).apply(null, arguments)}\n\n // core-js\n function _slicedToArray(arr, n) { return arr }\n function _typeof(a) { return typeof a }\n function _objectSpread2(target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i] != null ? arguments[i] : {};\n \n Object.assign(target, source)\n }\n \n return target;\n }\n\n // Libraries\n const parse = ${parse}\n const UPNG = {}\n UPNG.toRGBA8 = ${UPNG.toRGBA8}\n UPNG.toRGBA8.decodeImage = ${UPNG.toRGBA8.decodeImage}\n UPNG.decode = ${UPNG.decode}\n UPNG.decode._decompress = ${UPNG.decode._decompress}\n UPNG.decode._inflate = ${UPNG.decode._inflate}\n UPNG.decode._readInterlace = ${UPNG.decode._readInterlace}\n UPNG.decode._getBPP = ${UPNG.decode._getBPP} \n UPNG.decode._filterZero = ${UPNG.decode._filterZero}\n UPNG.decode._paeth = ${UPNG.decode._paeth}\n UPNG.decode._IHDR = ${UPNG.decode._IHDR}\n UPNG._bin = parse(${stringify(UPNG._bin)})\n UPNG._copyTile = ${UPNG._copyTile}\n UPNG.encode = ${UPNG.encode}\n UPNG.encodeLL = ${UPNG.encodeLL} \n UPNG.encode._main = ${UPNG.encode._main}\n UPNG.encode.compressPNG = ${UPNG.encode.compressPNG} \n UPNG.encode.compress = ${UPNG.encode.compress}\n UPNG.encode.framize = ${UPNG.encode.framize} \n UPNG.encode._updateFrame = ${UPNG.encode._updateFrame} \n UPNG.encode._prepareDiff = ${UPNG.encode._prepareDiff} \n UPNG.encode._filterZero = ${UPNG.encode._filterZero} \n UPNG.encode._filterLine = ${UPNG.encode._filterLine}\n UPNG.encode.concatRGBA = ${UPNG.encode.concatRGBA}\n UPNG.crc = parse(${stringify(UPNG.crc)})\n UPNG.crc.table = ( function() {\n var tab = new Uint32Array(256);\n for (var n=0; n<256; n++) {\n var c = n;\n for (var k=0; k<8; k++) {\n if (c & 1) c = 0xedb88320 ^ (c >>> 1);\n else c = c >>> 1;\n }\n tab[n] = c; }\n return tab; })()\n UPNG.quantize = ${UPNG.quantize} \n UPNG.quantize.getKDtree = ${UPNG.quantize.getKDtree} \n UPNG.quantize.getNearest = ${UPNG.quantize.getNearest} \n UPNG.quantize.planeDst = ${UPNG.quantize.planeDst} \n UPNG.quantize.dist = ${UPNG.quantize.dist} \n UPNG.quantize.splitPixels = ${UPNG.quantize.splitPixels} \n UPNG.quantize.vecDot = ${UPNG.quantize.vecDot} \n UPNG.quantize.stats = ${UPNG.quantize.stats} \n UPNG.quantize.estats = ${UPNG.quantize.estats}\n UPNG.M4 = parse(${stringify(UPNG.M4)})\n UPNG.encode.concatRGBA = ${UPNG.encode.concatRGBA}\n UPNG.inflateRaw=function(){\n var H={};H.H={};H.H.N=function(N,W){var R=Uint8Array,i=0,m=0,J=0,h=0,Q=0,X=0,u=0,w=0,d=0,v,C;\n if(N[0]==3&&N[1]==0)return W?W:new R(0);var V=H.H,n=V.b,A=V.e,l=V.R,M=V.n,I=V.A,e=V.Z,b=V.m,Z=W==null;\n if(Z)W=new R(N.length>>>2<<5);while(i==0){i=n(N,d,1);m=n(N,d+1,2);d+=3;if(m==0){if((d&7)!=0)d+=8-(d&7);\n var D=(d>>>3)+4,q=N[D-4]|N[D-3]<<8;if(Z)W=H.H.W(W,w+q);W.set(new R(N.buffer,N.byteOffset+D,q),w);d=D+q<<3;\n w+=q;continue}if(Z)W=H.H.W(W,w+(1<<17));if(m==1){v=b.J;C=b.h;X=(1<<9)-1;u=(1<<5)-1}if(m==2){J=A(N,d,5)+257;\n h=A(N,d+5,5)+1;Q=A(N,d+10,4)+4;d+=14;var E=d,j=1;for(var c=0;c<38;c+=2){b.Q[c]=0;b.Q[c+1]=0}for(var c=0;\n cj)j=K}d+=3*Q;M(b.Q,j);I(b.Q,j,b.u);v=b.w;C=b.d;\n d=l(b.u,(1<>>4;if(p>>>8==0){W[w++]=p}else if(p==256){break}else{var z=w+p-254;\n if(p>264){var _=b.q[p-257];z=w+(_>>>3)+A(N,d,_&7);d+=_&7}var $=C[e(N,d)&u];d+=$&15;var s=$>>>4,Y=b.c[s],a=(Y>>>4)+n(N,d,Y&15);\n d+=Y&15;while(w>>4;\n if(b<=15){A[I]=b;I++}else{var Z=0,m=0;if(b==16){m=3+l(V,n,2);n+=2;Z=A[I-1]}else if(b==17){m=3+l(V,n,3);\n n+=3}else if(b==18){m=11+l(V,n,7);n+=7}var J=I+m;while(I>>1;\n while(An)n=M;A++}while(A>1,I=N[l+1],e=M<<4|I,b=W-I,Z=N[l]<>>15-W;R[J]=e;Z++}}};H.H.l=function(N,W){var R=H.H.m.r,V=15-W;for(var n=0;n>>V}};H.H.M=function(N,W,R){R=R<<(W&7);var V=W>>>3;N[V]|=R;N[V+1]|=R>>>8};\n H.H.I=function(N,W,R){R=R<<(W&7);var V=W>>>3;N[V]|=R;N[V+1]|=R>>>8;N[V+2]|=R>>>16};H.H.e=function(N,W,R){return(N[W>>>3]|N[(W>>>3)+1]<<8)>>>(W&7)&(1<>>3]|N[(W>>>3)+1]<<8|N[(W>>>3)+2]<<16)>>>(W&7)&(1<>>3]|N[(W>>>3)+1]<<8|N[(W>>>3)+2]<<16)>>>(W&7)};\n H.H.i=function(N,W){return(N[W>>>3]|N[(W>>>3)+1]<<8|N[(W>>>3)+2]<<16|N[(W>>>3)+3]<<24)>>>(W&7)};H.H.m=function(){var N=Uint16Array,W=Uint32Array;\n return{K:new N(16),j:new N(16),X:[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],S:[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,999,999,999],T:[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0],q:new N(32),p:[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,65535,65535],z:[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0],c:new W(32),J:new N(512),_:[],h:new N(32),$:[],w:new N(32768),C:[],v:[],d:new N(32768),D:[],u:new N(512),Q:[],r:new N(1<<15),s:new W(286),Y:new W(30),a:new W(19),t:new W(15e3),k:new N(1<<16),g:new N(1<<15)}}();\n (function(){var N=H.H.m,W=1<<15;for(var R=0;R>>1|(V&1431655765)<<1;\n V=(V&3435973836)>>>2|(V&858993459)<<2;V=(V&4042322160)>>>4|(V&252645135)<<4;V=(V&4278255360)>>>8|(V&16711935)<<8;\n N.r[R]=(V>>>16|V<<16)>>>17}function n(A,l,M){while(l--!=0)A.push(0,M)}for(var R=0;R<32;R++){N.q[R]=N.S[R]<<3|N.T[R];\n N.c[R]=N.p[R]<<4|N.z[R]}n(N._,144,8);n(N._,255-143,9);n(N._,279-255,7);n(N._,287-279,8);H.H.n(N._,9);\n H.H.A(N._,9,N.J);H.H.l(N._,9);n(N.$,32,5);H.H.n(N.$,5);H.H.A(N.$,5,N.h);H.H.l(N.$,5);n(N.Q,19,0);n(N.C,286,0);\n n(N.D,30,0);n(N.v,320,0)}());return H.H.N}()\n \n const UZIP = {}\n UZIP[\"parse\"] = ${UZIP.parse}\n UZIP._readLocal = ${UZIP._readLocal}\n UZIP.inflateRaw = ${UZIP.inflateRaw}\n UZIP.inflate = ${UZIP.inflate}\n UZIP.deflate = ${UZIP.deflate}\n UZIP.deflateRaw = ${UZIP.deflateRaw}\n UZIP.encode = ${UZIP.encode}\n UZIP._noNeed = ${UZIP._noNeed}\n UZIP._writeHeader = ${UZIP._writeHeader}\n UZIP.crc = parse(${stringify(UZIP.crc)})\n UZIP.crc.table = ( function() {\n var tab = new Uint32Array(256);\n for (var n=0; n<256; n++) {\n var c = n;\n for (var k=0; k<8; k++) {\n if (c & 1) c = 0xedb88320 ^ (c >>> 1);\n else c = c >>> 1;\n }\n tab[n] = c; }\n return tab; })()\n \n UZIP.adler = ${UZIP.adler}\n UZIP.bin = parse(${stringify(UZIP.bin)})\n UZIP.F = {}\n UZIP.F.deflateRaw = ${UZIP.F.deflateRaw}\n UZIP.F._bestMatch = ${UZIP.F._bestMatch}\n UZIP.F._howLong = ${UZIP.F._howLong}\n UZIP.F._hash = ${UZIP.F._hash}\n UZIP.saved = ${UZIP.saved}\n UZIP.F._writeBlock = ${UZIP.F._writeBlock}\n UZIP.F._copyExact = ${UZIP.F._copyExact}\n UZIP.F.getTrees = ${UZIP.F.getTrees}\n UZIP.F.getSecond = ${UZIP.F.getSecond}\n UZIP.F.nonZero = ${UZIP.F.nonZero}\n UZIP.F.contSize = ${UZIP.F.contSize}\n UZIP.F._codeTiny = ${UZIP.F._codeTiny} \n UZIP.F._lenCodes = ${UZIP.F._lenCodes} \n UZIP.F._hufTree = ${UZIP.F._hufTree} \n UZIP.F.setDepth = ${UZIP.F.setDepth} \n UZIP.F.restrictDepth = ${UZIP.F.restrictDepth}\n UZIP.F._goodIndex = ${UZIP.F._goodIndex} \n UZIP.F._writeLit = ${UZIP.F._writeLit} \n UZIP.F.inflate = ${UZIP.F.inflate} \n UZIP.F._check = ${UZIP.F._check} \n UZIP.F._decodeTiny = ${UZIP.F._decodeTiny} \n UZIP.F._copyOut = ${UZIP.F._copyOut} \n UZIP.F.makeCodes = ${UZIP.F.makeCodes} \n UZIP.F.codes2map = ${UZIP.F.codes2map} \n UZIP.F.revCodes = ${UZIP.F.revCodes} \n\n // used only in deflate\n UZIP.F._putsE = ${UZIP.F._putsE}\n UZIP.F._putsF = ${UZIP.F._putsF}\n \n UZIP.F._bitsE = ${UZIP.F._bitsE}\n UZIP.F._bitsF = ${UZIP.F._bitsF}\n\n UZIP.F._get17 = ${UZIP.F._get17}\n UZIP.F._get25 = ${UZIP.F._get25}\n UZIP.F.U = function(){\n var u16=Uint16Array, u32=Uint32Array;\n return {\n next_code : new u16(16),\n bl_count : new u16(16),\n ordr : [ 16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15 ],\n of0 : [3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,999,999,999],\n exb : [0,0,0,0,0,0,0, 0, 1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3, 4, 4, 4, 4, 5, 5, 5, 5, 0, 0, 0, 0],\n ldef : new u16(32),\n df0 : [1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577, 65535, 65535],\n dxb : [0,0,0,0,1,1,2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8, 9, 9, 10, 10, 11, 11, 12, 12, 13, 13, 0, 0],\n ddef : new u32(32),\n flmap: new u16( 512), fltree: [],\n fdmap: new u16( 32), fdtree: [],\n lmap : new u16(32768), ltree : [], ttree:[],\n dmap : new u16(32768), dtree : [],\n imap : new u16( 512), itree : [],\n //rev9 : new u16( 512)\n rev15: new u16(1<<15),\n lhst : new u32(286), dhst : new u32( 30), ihst : new u32(19),\n lits : new u32(15000),\n strt : new u16(1<<16),\n prev : new u16(1<<15)\n };\n } ();\n\n (function(){\n var U = UZIP.F.U;\n var len = 1<<15;\n for(var i=0; i>> 1) | ((x & 0x55555555) << 1));\n x = (((x & 0xcccccccc) >>> 2) | ((x & 0x33333333) << 2));\n x = (((x & 0xf0f0f0f0) >>> 4) | ((x & 0x0f0f0f0f) << 4));\n x = (((x & 0xff00ff00) >>> 8) | ((x & 0x00ff00ff) << 8));\n U.rev15[i] = (((x >>> 16) | (x << 16)))>>>17;\n }\n \n function pushV(tgt, n, sv) { while(n--!=0) tgt.push(0,sv); }\n \n for(var i=0; i<32; i++) { U.ldef[i]=(U.of0[i]<<3)|U.exb[i]; U.ddef[i]=(U.df0[i]<<4)|U.dxb[i]; }\n \n pushV(U.fltree, 144, 8); pushV(U.fltree, 255-143, 9); pushV(U.fltree, 279-255, 7); pushV(U.fltree,287-279,8);\n /*\n var i = 0;\n for(; i<=143; i++) U.fltree.push(0,8);\n for(; i<=255; i++) U.fltree.push(0,9);\n for(; i<=279; i++) U.fltree.push(0,7);\n for(; i<=287; i++) U.fltree.push(0,8);\n */\n UZIP.F.makeCodes(U.fltree, 9);\n UZIP.F.codes2map(U.fltree, 9, U.flmap);\n UZIP.F.revCodes (U.fltree, 9)\n \n pushV(U.fdtree,32,5);\n //for(i=0;i<32; i++) U.fdtree.push(0,5);\n UZIP.F.makeCodes(U.fdtree, 5);\n UZIP.F.codes2map(U.fdtree, 5, U.fdmap);\n UZIP.F.revCodes (U.fdtree, 5)\n \n pushV(U.itree,19,0); pushV(U.ltree,286,0); pushV(U.dtree,30,0); pushV(U.ttree,320,0);\n /*\n for(var i=0; i< 19; i++) U.itree.push(0,0);\n for(var i=0; i<286; i++) U.ltree.push(0,0);\n for(var i=0; i< 30; i++) U.dtree.push(0,0);\n for(var i=0; i<320; i++) U.ttree.push(0,0);\n */\n })()\n `);\n}\n\nfunction generateWorkerScript() {\n // code to be run in the WebWorker\n return createWorker(`\n let scriptImported = false\n self.addEventListener('message', async (e) => {\n const { file, id, imageCompressionLibUrl, options } = e.data\n options.onProgress = (progress) => self.postMessage({ progress, id })\n try {\n if (!scriptImported) {\n // console.log('[worker] importScripts', imageCompressionLibUrl)\n self.importScripts(imageCompressionLibUrl)\n scriptImported = true\n }\n // console.log('[worker] self', self)\n const compressedFile = await imageCompression(file, options)\n self.postMessage({ file: compressedFile, id })\n } catch (e) {\n // console.error('[worker] error', e)\n self.postMessage({ error: e.message + '\\\\n' + e.stack, id })\n }\n })\n `);\n}\n\nexport function compressOnWebWorker(file, options) {\n return new Promise(async (resolve, reject) => {\n const id = cnt++;\n\n if (!imageCompressionLibUrl) {\n imageCompressionLibUrl = generateLib();\n }\n\n if (!worker) {\n worker = generateWorkerScript();\n }\n\n function handler(e) {\n if (e.data.id === id) {\n if (e.data.progress !== undefined) {\n options.onProgress(e.data.progress);\n return;\n }\n worker.removeEventListener('message', handler);\n if (e.data.error) {\n reject(new Error(e.data.error));\n }\n resolve(e.data.file);\n }\n }\n\n worker.addEventListener('message', handler);\n worker.addEventListener('error', reject);\n\n worker.postMessage({\n file,\n id,\n imageCompressionLibUrl,\n options: { ...options, onProgress: undefined },\n });\n });\n}\n","import './polyfill';\n\nimport compress from './image-compression';\nimport {\n canvasToFile,\n drawFileInCanvas,\n drawImageInCanvas,\n getDataUrlFromFile,\n getFilefromDataUrl,\n loadImage,\n getExifOrientation,\n handleMaxWidthOrHeight,\n followExifOrientation,\n CustomFile,\n cleanupCanvasMemory,\n isAutoOrientationInBrowser,\n approximateBelowMaximumCanvasSizeOfBrowser,\n getBrowserName,\n} from './utils';\n// eslint-disable-next-line import/no-cycle\nimport { compressOnWebWorker } from './web-worker';\n\n/**\n * Compress an image file.\n *\n * @param {File} file\n * @param {Object} opts - { maxSizeMB=Number.POSITIVE_INFINITY, maxWidthOrHeight, useWebWorker=false, maxIteration = 10, exifOrientation, fileType }\n * @param {number} [options.maxSizeMB=Number.POSITIVE_INFINITY]\n * @param {number} [options.maxWidthOrHeight=undefined]\n * @param {boolean} [options.useWebWorker=false]\n * @param {number} [options.maxIteration=10]\n * @param {number} [options.exifOrientation] - default to be the exif orientation from the image file\n * @param {Function} [options.onProgress] - a function takes one progress argument (progress from 0 to 100)\n * @param {string} [options.fileType] - default to be the original mime type from the image file\n * @returns {Promise}\n */\nasync function imageCompression(file, options) {\n const opts = { ...options };\n\n let compressedFile;\n let progress = 0;\n const { onProgress } = opts;\n\n opts.maxSizeMB = opts.maxSizeMB || Number.POSITIVE_INFINITY;\n const useWebWorker = typeof opts.useWebWorker === 'boolean' ? opts.useWebWorker : true;\n delete opts.useWebWorker;\n opts.onProgress = (aProgress) => {\n progress = aProgress;\n if (typeof onProgress === 'function') {\n onProgress(progress);\n }\n };\n\n if (!(file instanceof Blob || file instanceof CustomFile)) {\n throw new Error('The file given is not an instance of Blob or File');\n } else if (!/^image/.test(file.type)) {\n throw new Error('The file given is not an image');\n }\n\n // try run in web worker, fall back to run in main thread\n // eslint-disable-next-line no-undef, no-restricted-globals\n const inWebWorker = typeof WorkerGlobalScope !== 'undefined' && self instanceof WorkerGlobalScope;\n\n // if ((useWebWorker && typeof Worker === 'function') || inWebWorker) {\n // console.log('run compression in web worker');\n // } else {\n // console.log('run compression in main thread');\n // }\n\n if (useWebWorker && typeof Worker === 'function' && !inWebWorker) {\n try {\n // \"compressOnWebWorker\" is kind of like a recursion to call \"imageCompression\" again inside web worker\n compressedFile = await compressOnWebWorker(file, opts);\n } catch (e) {\n // console.warn('Run compression in web worker failed:', e, ', fall back to main thread');\n compressedFile = await compress(file, opts);\n }\n } else {\n compressedFile = await compress(file, opts);\n }\n\n try {\n compressedFile.name = file.name;\n compressedFile.lastModified = file.lastModified;\n // eslint-disable-next-line no-empty\n } catch (e) {}\n\n return compressedFile;\n}\n\nimageCompression.getDataUrlFromFile = getDataUrlFromFile;\nimageCompression.getFilefromDataUrl = getFilefromDataUrl;\nimageCompression.loadImage = loadImage;\nimageCompression.drawImageInCanvas = drawImageInCanvas;\nimageCompression.drawFileInCanvas = drawFileInCanvas;\nimageCompression.canvasToFile = canvasToFile;\nimageCompression.getExifOrientation = getExifOrientation;\n\nimageCompression.handleMaxWidthOrHeight = handleMaxWidthOrHeight;\nimageCompression.followExifOrientation = followExifOrientation;\nimageCompression.cleanupCanvasMemory = cleanupCanvasMemory;\nimageCompression.isAutoOrientationInBrowser = isAutoOrientationInBrowser;\nimageCompression.approximateBelowMaximumCanvasSizeOfBrowser = approximateBelowMaximumCanvasSizeOfBrowser;\nimageCompression.getBrowserName = getBrowserName;\nimageCompression.version = '1.0.15';\n\nexport default imageCompression;\n"],"names":["check","it","global","SHARED","store","key","hasOwnProperty","id","postfix","Math","random","aFunction","variable","process","Deno","versions","v8","match","userAgent","exec","WellKnownSymbolsStore","Symbol","NATIVE_SYMBOL","TO_STRING_TAG","test","document","EXISTS","USE_SYMBOL_AS_UID","val","input","pref","result","undefined","$defineProperty","DESCRIPTORS","bitmap","value","functionToString","inspectSource","OBJECT_ALREADY_INITIALIZED","WeakMap","set","has","TYPE","state","NATIVE_WEAK_MAP","get","wmhas","call","wmset","metadata","objectHas","getInternalState","enforceInternalState","String","split","unsafe","options","toString","$propertyIsEnumerable","getOwnPropertyDescriptor","$getOwnPropertyDescriptor","P","ceil","floor","min","max","fromIndex","O","toIndexedObject","length","index","el","indexOf","require$$0","object","i","push","keys","defineProperty","replacement","isForced","normalize","f","targetProperty","target","noTargetGet","anObject","wellKnownSymbol","getBuiltIn","definePropertyModule","Constructor","name","ITERATOR","prototype","fn","iterator","Result","stopped","IS_ITERATOR","AS_ENTRIES","iterFn","next","error","SAFE_CLOSING","SKIP_CLOSING","clear","MessageChannel","Dispatch","counter","queue","ONREADYSTATECHANGE","location","runner","run","listener","data","argumentsLength","defer","addEventListener","importScripts","macrotask","require$$1","MutationObserver","Promise","queueMicrotaskDescriptor","queueMicrotask","head","resolve","then","promise","PromiseCapability","$$resolve","$$reject","C","console","arguments","window","task","SPECIES","PROMISE","InternalStateModule","setInternalState","getInternalPromiseState","NativePromisePrototype","PromiseConstructor","PromiseConstructorPrototype","TypeError","newPromiseCapability","newGenericPromiseCapability","DISPATCH_EVENT","NATIVE_REJECTION_EVENT","UNHANDLED_REJECTION","REJECTION_HANDLED","PENDING","FULFILLED","REJECTED","HANDLED","UNHANDLED","SUBCLASSING","Internal","FORCED","isThenable","isReject","notified","exited","reject","handler","event","reason","IS_NODE","isUnhandled","unwrap","internalReject","facade","wrapper","bind","anInstance","this","internalResolve","onFulfilled","onRejected","reaction","OwnPromiseCapability","that","$","capability","stat","all","alreadyCalled","dummy","GT","LT","PROTOTYPE","SCRIPT","IE_PROTO","scriptTag","content","activeXDocument","parentWindow","html","appendChild","iframe","src","open","iframeDocument","write","close","whitespace","ltrim","RegExp","rtrim","$this","string","replace","getOwnPropertyNames","require$$2","trim","require$$3","NUMBER","NativeNumber","NumberPrototype","argument","radix","digits","toNumber","NumberWrapper","FunctionPrototype","FunctionPrototypeToString","nameRE","NAME","Object","enumerable","b","B","forEach","propertyIsEnumerableModule","S","IndexedObject","j","T","$assign","nativeExec","nativeReplace","patchedExec","UPDATES_LAST_INDEX_WRONG","stickyHelpers","UNSUPPORTED_Y","NPCG_INCLUDED","UNSUPPORTED_DOT_ALL","re","str","raw","lastIndex","groups","regexpFlags","strCopy","slice","charsAdded","RegExpPrototype","SYMBOL","KEY","nativeMethod","requireObjectCoercible","position","toInteger","size","charAt","arrayPush","MAX_UINT32","limit","separator","separatorCopy","maybeCallNative","internalSplit","rx","UNSCOPABLES","ArrayPrototype","fails","CORRECT_PROTOTYPE_GETTER","BUGGY_SAFARI_ITERATORS","IteratorPrototype","PrototypeOfArrayIteratorPrototype","NEW_ITERATOR_PROTOTYPE","returnThis","IteratorConstructor","create","KEYS","VALUES","ENTRIES","KIND","DEFAULT","IterablePrototype","CurrentIteratorPrototype","methods","getIterationMethod","ARRAY_ITERATOR","Iterators","Arguments","Int8Array","Int8ArrayPrototype","Uint8ClampedArray","Uint8ClampedArrayPrototype","TypedArray","TypedArrayPrototype","ObjectPrototype","isPrototypeOf","TYPED_ARRAY_TAG","TYPED_ARRAY_CONSTRUCTOR","uid","NATIVE_ARRAY_BUFFER_VIEWS","TYPED_ARRAY_TAG_REQIRED","TypedArrayConstructorsList","BigIntArrayConstructorsList","isView","klass","aTypedArray","aTypedArrayConstructor","TypedArrayConstructor","redefine","forced","number","abs","pow","log","LN2","pack","bytes","mantissaLength","exponentLength","exponent","eBias","c","rt","mantissa","unpack","buffer","sign","nBits","eMax","fill","ARRAY_BUFFER","DATA_VIEW","WRONG_LENGTH","WRONG_INDEX","NativeArrayBuffer","$ArrayBuffer","$DataView","$DataViewPrototype","RangeError","packIEEE754","unpackIEEE754","IEEE754","packInt8","packInt16","unpackInt32","packFloat32","addGetter","count","start","reverse","view","byteLength","ArrayBufferPrototype","constructor","byteOffset","setUint8","DataView","bufferLength","offset","setFloat64","toPositiveInteger","step","isArrayIteratorMethod","iteratorMethod","mapfn","toLength","originalArray","createMethod","toObject","self","boundFunction","nativeDefineProperty","nativeGetOwnPropertyDescriptor","round","ArrayBuffer","isTypedArray","fromList","isArrayBuffer","isSymbol","toPropertyKey","descriptor","CLAMPED","BYTES","CONSTRUCTOR_NAME","TypedArrayConstructorPrototype","createNonEnumerableProperty","toAbsoluteIndex","end","to","from","$every","every","list","$filter","filter","exportTypedArrayMethod","$find","find","$findIndex","findIndex","$forEach","$includes","includes","$indexOf","Uint8Array","arrayValues","arrayKeys","arrayEntries","nativeTypedArrayIterator","CORRECT_ITER_NAME","typedArrayValues","$lastIndexOf","NEGATIVE_ZERO","$map","map","callbackfn","IS_RIGHT","$reduce","left","$reduceRight","right","arrayLike","$slice","$some","some","mergeSort","comparefn","array","Uint16Array","nativeSort","ACCEPT_INCORRECT_ARGUMENTS","mod","Array","a","items","$toLocaleString","TO_LOCALE_STRING_BUG","Uint8ArrayPrototype","arrayToString","arrayJoin","HAS_SPECIES_SUPPORT","k","fin","nativeSlice","proto","TO_STRING","nativeToString","NOT_GENERIC","INCORRECT_NAME","R","p","$toString","rf","FAILS_ON_UNDEFINED","FAILS_ON_NULL","chr","code","itemsLength","arrayLength","getSortCompare","UZIP","eocd","rUi","cnu","csize","o","out","readUshort","cmpr","nlen","elen","file","inflate","inflateRaw","opts","buf","F","deflateRaw","crc","off","encode","noCmpr","wUi","obj","cpr","tot","ioff","t","usize","tab","table","eend","buff","l","s","strl","charCodeAt","ci","lvl","U","len","dlen","strt","prev","lc","_hash","cvrd","lgi","lits","li","dst","dgi","pos","pi","dif","dlim","_howLong","td","ei","curd","MD","putsF","_putsF","BTYPE","_copyExact","o0","ltree","fltree","putsE","itree","qc","si","_writeLit","p8","_hufTree","ihst","dset","numh","ML","MH","numl","tree","nxt","nnxt","lz","MAXL","hst","tl","hl","l2","lit","i2","i0","d","restrictDepth","maxl","dps","dbt","_goodIndex","ch","u8","_bitsF","bitsE","noBuf","HLIT","_check","ordr","dmap","mx0","dtree","dlit","dcode","dbs","nbuf","lmap","_bitsE","n","mx","max_code","bl_count","MAX_BITS","next_code","rest","i1","r15","_putsE","dt","u16","x","tgt","sv","fdmap","pushV","w","height","h","img","frames","fh","frm","dispose","bpp","area","bf32","ctype","depth","tabs","tRNS","ts","ti","ap","y","bf","qi","cj","t0","di","gr","al","tr","bin","readASCII","doff","num_frames","num_plays","del","fd","readUint","type","text","keyw","readUTF8","pl","PLTE","foff","bpl","interlace","CgBI","UPNG","decode","_inflate","dd","_filterZero","_readInterlace","H","N","m","Z","W","A","u","r","D","v","X","Y","e","I","V","M","starting_row","row_increment","pass","cr","cc","row","starting_col","bpll","col","cbpp","sh","_paeth","pa","pc","arr","fb","ifa","tb","fr","fg","mode","fa","sb","ba","bufs","nimg","_main","ac","_bin","wUs","wAs","dl","anim","leng","sRGB","pHYs","loop","cimg","imgd","nh","onlyBlend","inds","nbufs","cof","bln","ind","ilen","img32","inj","gotAlpha","frms","Uint32Array","nx","tlim","forbidPrev","alwaysBlend","pimg","mix","evenCrd","sarea","miY","r0","miX","_updateFrame","rect","width","U8","pimg32","cx","miy","blend","rec","ftry","paeth","oimg","nimg32","KD","quantize","getKDtree","root","nd","err","maxL","splitPixels","node","planeDst","ln","rn","getNearest","q","d0","d1","d2","g","stats","m0","Rj","m1","iN","m3","Cov","M4","noff","isBrowser","cordova","CustomFileReader","reader","readAsDataURL","getBrowserName","navigator","browserName","maximumCanvasSize","ctx","drawImageInCanvas","loadImage","fileName","lastModified","drawFileInCanvas","testImageFile2","testImageCanvas","marker","getUint16","isFinite","maxWidthOrHeight","newCanvas","STRING_ITERATOR","getterFor","Collection","COLLECTION_NAME","searchParams","iteratorClose","maxInt","base","tMin","tMax","skew","damp","initialBias","initialN","delimiter","regexNonASCII","regexSeparators","OVERFLOW_ERROR","baseMinusTMin","stringFromCharCode","extra","digitToBasic","adapt","delta","numPoints","output","nativeFetch","NativeRequest","RequestPrototype","Headers","URL_SEARCH_PARAMS","URL_SEARCH_PARAMS_ITERATOR","getInternalParamsState","getInternalIteratorState","plus","percentSequence","sequences","percentDecode","deserialize","validateArgumentsLength","kind","entries","updateSearchParams","init","URLSearchParamsPrototype","found","splice","entry","sliceIndex","entriesIndex","serialize","codeAt","NativeURL","URLSearchParams","getInternalSearchParamsState","getInternalURLState","INVALID_AUTHORITY","INVALID_SCHEME","INVALID_HOST","INVALID_PORT","ALPHA","ALPHANUMERIC","DIGIT","HEX_START","OCT","DEC","HEX","FORBIDDEN_HOST_CODE_POINT","FORBIDDEN_HOST_CODE_POINT_EXCLUDING_PERCENT","toASCII","url","host","parseIPv4","numbers","parts","pop","part","parseInt","parseIPv6","numbersSeen","pointer","pieceIndex","address","findLongestZeroSequence","ipv6","maxIndex","currLength","compress","percentEncode","specialSchemes","isSpecial","includesCredentials","username","cannotHaveUsernamePasswordPort","cannotBeABaseURL","isWindowsDriveLetter","path","isSingleDot","segment","isDoubleDot","SCHEME_START","SCHEME","NO_SCHEME","SPECIAL_RELATIVE_OR_AUTHORITY","RELATIVE","SPECIAL_AUTHORITY_SLASHES","SPECIAL_AUTHORITY_IGNORE_SLASHES","HOST","HOSTNAME","PORT","FILE_SLASH","FILE_HOST","PATH_START","PATH","CANNOT_BE_A_BASE_URL_PATH","QUERY","FRAGMENT","parseURL","scheme","password","port","query","fragment","LEADING_AND_TRAILING_C0_CONTROL_OR_SPACE","codePoints","FILE","EOF","char","codePoint","bufferCodePoints","parseHost","baseState","failure","origin","protocol","getHostname","getPort","hash","URLPrototype","serializeURL","getOrigin","getProtocol","getHost","getPathname","getSearch","href","accessorDescriptor","pathname","search","toJSON","DOMIterables","propertyIsEnumerable","$entries","$startsWith","CORRECT_IS_REGEXP_LOGIC","searchString","SUBSTITUTION_SYMBOLS","matched","tailPos","captures","REPLACE","REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE","REPLACE_SUPPORTS_NAMED_GROUPS","searchValue","res","unicode","IS_CONCAT_SPREADABLE","MAX_SAFE_INTEGER","MAXIMUM_ALLOWED_INDEX_EXCEEDED","IS_CONCAT_SPREADABLE_SUPPORT","concat","createProperty","cnt","worker","Worker","createSourceObject","inWebWorker","imageCompression","getDataUrlFromFile","getFilefromDataUrl","canvasToFile","getExifOrientation"],"mappings":"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"} \ No newline at end of file diff --git a/example/Webpack App/index.html b/example/Webpack App/index.html new file mode 100644 index 0000000..b3e8d4e --- /dev/null +++ b/example/Webpack App/index.html @@ -0,0 +1,10 @@ + + + + + Getting Started + + + + + \ No newline at end of file diff --git a/example/Webpack App/package.json b/example/Webpack App/package.json new file mode 100644 index 0000000..a3f4aa6 --- /dev/null +++ b/example/Webpack App/package.json @@ -0,0 +1,19 @@ +{ + "name": "webpack-demo", + "version": "1.0.0", + "main": "index.js", + "license": "MIT", + "private": true, + "scripts": { + "test": "echo \"Error: no test specified\" && exit 1", + "build": "webpack" + }, + "devDependencies": { + "html-webpack-plugin": "^5.3.1", + "webpack": "^5.38.1", + "webpack-cli": "^4.7.2" + }, + "dependencies": { + "browser-image-compression": "^1.0.14" + } +} diff --git a/example/Webpack App/src/index.js b/example/Webpack App/src/index.js new file mode 100644 index 0000000..5a7511c --- /dev/null +++ b/example/Webpack App/src/index.js @@ -0,0 +1,3 @@ +import imageCompression from 'browser-image-compression'; + +console.log('imageCompression', imageCompression.version); \ No newline at end of file diff --git a/example/Webpack App/webpack.config.js b/example/Webpack App/webpack.config.js new file mode 100644 index 0000000..7e3b959 --- /dev/null +++ b/example/Webpack App/webpack.config.js @@ -0,0 +1,12 @@ +const HtmlWebpackPlugin = require('html-webpack-plugin'); +const path = require('path'); + +module.exports = { + mode: 'production', + entry: './src/index.js', + output: { + filename: 'main.js', + path: path.resolve(__dirname, 'dist'), + }, + plugins: [new HtmlWebpackPlugin()], +}; diff --git a/example/basic.html b/example/basic.html index fc36dd1..4c68236 100644 --- a/example/basic.html +++ b/example/basic.html @@ -51,8 +51,7 @@ - - + diff --git a/lib/UPNG.js b/lib/UPNG.js index f43802e..44cdfb1 100644 --- a/lib/UPNG.js +++ b/lib/UPNG.js @@ -1,671 +1,816 @@ // https://github.com/photopea/UPNG.js/blob/c976240e62b0497167f8aafabd7889625f8b2016/UPNG.js // import * as pako from 'pako' -import * as UZIP from 'uzip' +import * as UZIP from 'uzip'; -var UPNG = {}; +const UPNG = {}; +UPNG.toRGBA8 = function (out) { + const w = out.width; const + h = out.height; + if (out.tabs.acTL == null) return [UPNG.toRGBA8.decodeImage(out.data, w, h, out).buffer]; -UPNG.toRGBA8 = function(out) -{ - var w = out.width, h = out.height; - if(out.tabs.acTL==null) return [UPNG.toRGBA8.decodeImage(out.data, w, h, out).buffer]; - - var frms = []; - if(out.frames[0].data==null) out.frames[0].data = out.data; + const frms = []; + if (out.frames[0].data == null) out.frames[0].data = out.data; - var len = w*h*4, img = new Uint8Array(len), empty = new Uint8Array(len), prev=new Uint8Array(len); - for(var i=0; i> 3)] >> (7 - ((i & 7) << 0))) & 1); var + cj = 3 * j; bf[qi] = p[cj]; bf[qi + 1] = p[cj + 1]; bf[qi + 2] = p[cj + 2]; bf[qi + 3] = (j < tl) ? ap[j] : 255; + } + } } - } - else if(ctype==3) { // palette - var p=out.tabs["PLTE"], ap=out.tabs["tRNS"], tl=ap?ap.length:0; - //console.log(p, ap); - if(depth==1) for(var y=0; y>3)]>>(7-((i&7)<<0)))& 1), cj=3*j; bf[qi]=p[cj]; bf[qi+1]=p[cj+1]; bf[qi+2]=p[cj+2]; bf[qi+3]=(j> 2)] >> (6 - ((i & 3) << 1))) & 3); var + cj = 3 * j; bf[qi] = p[cj]; bf[qi + 1] = p[cj + 1]; bf[qi + 2] = p[cj + 2]; bf[qi + 3] = (j < tl) ? ap[j] : 255; + } + } } - if(depth==2) for(var y=0; y>2)]>>(6-((i&3)<<1)))& 3), cj=3*j; bf[qi]=p[cj]; bf[qi+1]=p[cj+1]; bf[qi+2]=p[cj+2]; bf[qi+3]=(j> 1)] >> (4 - ((i & 1) << 2))) & 15); var + cj = 3 * j; bf[qi] = p[cj]; bf[qi + 1] = p[cj + 1]; bf[qi + 2] = p[cj + 2]; bf[qi + 3] = (j < tl) ? ap[j] : 255; + } + } } - if(depth==4) for(var y=0; y>1)]>>(4-((i&1)<<2)))&15), cj=3*j; bf[qi]=p[cj]; bf[qi+1]=p[cj+1]; bf[qi+2]=p[cj+2]; bf[qi+3]=(j>>3)]>>>(7 -((x&7) )))& 1), al=(gr==tr*255)?0:255; bf32[to+x]=(al<<24)|(gr<<16)|(gr<<8)|gr; } - else if(depth== 2) for(var x=0; x>>2)]>>>(6 -((x&3)<<1)))& 3), al=(gr==tr* 85)?0:255; bf32[to+x]=(al<<24)|(gr<<16)|(gr<<8)|gr; } - else if(depth== 4) for(var x=0; x>>1)]>>>(4 -((x&1)<<2)))&15), al=(gr==tr* 17)?0:255; bf32[to+x]=(al<<24)|(gr<<16)|(gr<<8)|gr; } - else if(depth== 8) for(var x=0; x>> 3)] >>> (7 - ((x & 7)))) & 1); var + al = (gr == tr * 255) ? 0 : 255; bf32[to + x] = (al << 24) | (gr << 16) | (gr << 8) | gr; + } + } else if (depth == 2) { + for (var x = 0; x < w; x++) { + var gr = 85 * ((data[off + (x >>> 2)] >>> (6 - ((x & 3) << 1))) & 3); var + al = (gr == tr * 85) ? 0 : 255; bf32[to + x] = (al << 24) | (gr << 16) | (gr << 8) | gr; + } + } else if (depth == 4) { + for (var x = 0; x < w; x++) { + var gr = 17 * ((data[off + (x >>> 1)] >>> (4 - ((x & 1) << 2))) & 15); var + al = (gr == tr * 17) ? 0 : 255; bf32[to + x] = (al << 24) | (gr << 16) | (gr << 8) | gr; + } + } else if (depth == 8) { + for (var x = 0; x < w; x++) { + var gr = data[off + x]; var + al = (gr == tr) ? 0 : 255; bf32[to + x] = (al << 24) | (gr << 16) | (gr << 8) | gr; + } + } else if (depth == 16) { + for (var x = 0; x < w; x++) { + var gr = data[off + (x << 1)]; var + al = (rs(data, off + (x << i)) == tr) ? 0 : 255; bf32[to + x] = (al << 24) | (gr << 16) | (gr << 8) | gr; + } + } } } - //console.log(Date.now()-time); + // console.log(Date.now()-time); return bf; -} - - - -UPNG.decode = function(buff) -{ - var data = new Uint8Array(buff), offset = 8, bin = UPNG._bin, rUs = bin.readUshort, rUi = bin.readUint; - var out = {tabs:{}, frames:[]}; - var dd = new Uint8Array(data.length), doff = 0; // put all IDAT data into it - var fd, foff = 0; // frames - - var mgck = [0x89, 0x50, 0x4e, 0x47, 0x0d, 0x0a, 0x1a, 0x0a]; - for(var i=0; i<8; i++) if(data[i]!=mgck[i]) throw "The input is not a PNG file!"; - - while(offset>>2<<5);while(i==0){i=n(N,d,1);m=n(N,d+1,2);d+=3;if(m==0){if((d&7)!=0)d+=8-(d&7); - var D=(d>>>3)+4,q=N[D-4]|N[D-3]<<8;if(Z)W=H.H.W(W,w+q);W.set(new R(N.buffer,N.byteOffset+D,q),w);d=D+q<<3; - w+=q;continue}if(Z)W=H.H.W(W,w+(1<<17));if(m==1){v=b.J;C=b.h;X=(1<<9)-1;u=(1<<5)-1}if(m==2){J=A(N,d,5)+257; - h=A(N,d+5,5)+1;Q=A(N,d+10,4)+4;d+=14;var E=d,j=1;for(var c=0;c<38;c+=2){b.Q[c]=0;b.Q[c+1]=0}for(var c=0; - cj)j=K}d+=3*Q;M(b.Q,j);I(b.Q,j,b.u);v=b.w;C=b.d; - d=l(b.u,(1<>>4;if(p>>>8==0){W[w++]=p}else if(p==256){break}else{var z=w+p-254; - if(p>264){var _=b.q[p-257];z=w+(_>>>3)+A(N,d,_&7);d+=_&7}var $=C[e(N,d)&u];d+=$&15;var s=$>>>4,Y=b.c[s],a=(Y>>>4)+n(N,d,Y&15); - d+=Y&15;while(w>>4; - if(b<=15){A[I]=b;I++}else{var Z=0,m=0;if(b==16){m=3+l(V,n,2);n+=2;Z=A[I-1]}else if(b==17){m=3+l(V,n,3); - n+=3}else if(b==18){m=11+l(V,n,7);n+=7}var J=I+m;while(I>>1; - while(An)n=M;A++}while(A>1,I=N[l+1],e=M<<4|I,b=W-I,Z=N[l]<>>15-W;R[J]=e;Z++}}};H.H.l=function(N,W){var R=H.H.m.r,V=15-W;for(var n=0;n>>V}};H.H.M=function(N,W,R){R=R<<(W&7);var V=W>>>3;N[V]|=R;N[V+1]|=R>>>8}; - H.H.I=function(N,W,R){R=R<<(W&7);var V=W>>>3;N[V]|=R;N[V+1]|=R>>>8;N[V+2]|=R>>>16};H.H.e=function(N,W,R){return(N[W>>>3]|N[(W>>>3)+1]<<8)>>>(W&7)&(1<>>3]|N[(W>>>3)+1]<<8|N[(W>>>3)+2]<<16)>>>(W&7)&(1<>>3]|N[(W>>>3)+1]<<8|N[(W>>>3)+2]<<16)>>>(W&7)}; - H.H.i=function(N,W){return(N[W>>>3]|N[(W>>>3)+1]<<8|N[(W>>>3)+2]<<16|N[(W>>>3)+3]<<24)>>>(W&7)};H.H.m=function(){var N=Uint16Array,W=Uint32Array; - return{K:new N(16),j:new N(16),X:[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],S:[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,999,999,999],T:[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0],q:new N(32),p:[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,65535,65535],z:[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0],c:new W(32),J:new N(512),_:[],h:new N(32),$:[],w:new N(32768),C:[],v:[],d:new N(32768),D:[],u:new N(512),Q:[],r:new N(1<<15),s:new W(286),Y:new W(30),a:new W(19),t:new W(15e3),k:new N(1<<16),g:new N(1<<15)}}(); - (function(){var N=H.H.m,W=1<<15;for(var R=0;R>>1|(V&1431655765)<<1; - V=(V&3435973836)>>>2|(V&858993459)<<2;V=(V&4042322160)>>>4|(V&252645135)<<4;V=(V&4278255360)>>>8|(V&16711935)<<8; - N.r[R]=(V>>>16|V<<16)>>>17}function n(A,l,M){while(l--!=0)A.push(0,M)}for(var R=0;R<32;R++){N.q[R]=N.S[R]<<3|N.T[R]; - N.c[R]=N.p[R]<<4|N.z[R]}n(N._,144,8);n(N._,255-143,9);n(N._,279-255,7);n(N._,287-279,8);H.H.n(N._,9); - H.H.A(N._,9,N.J);H.H.l(N._,9);n(N.$,32,5);H.H.n(N.$,5);H.H.A(N.$,5,N.h);H.H.l(N.$,5);n(N.Q,19,0);n(N.C,286,0); - n(N.D,30,0);n(N.v,320,0)}());return H.H.N}() - - -UPNG.decode._readInterlace = function(data, out) -{ - var w = out.width, h = out.height; - var bpp = UPNG.decode._getBPP(out), cbpp = bpp>>3, bpl = Math.ceil(w*bpp/8); - var img = new Uint8Array( h * bpl ); - var di = 0; - - var starting_row = [ 0, 0, 4, 0, 2, 0, 1 ]; - var starting_col = [ 0, 4, 0, 2, 0, 1, 0 ]; - var row_increment = [ 8, 8, 8, 4, 4, 2, 2 ]; - var col_increment = [ 8, 8, 4, 4, 2, 2, 1 ]; - - var pass=0; - while(pass<7) - { - var ri = row_increment[pass], ci = col_increment[pass]; - var sw = 0, sh = 0; - var cr = starting_row[pass]; while(cr>> 2 << 5); while (i == 0) { + i = n(N, d, 1); m = n(N, d + 1, 2); d += 3; if (m == 0) { + if ((d & 7) != 0)d += 8 - (d & 7); + const D = (d >>> 3) + 4; const q = N[D - 4] | N[D - 3] << 8; if (Z)W = H.H.W(W, w + q); W.set(new R(N.buffer, N.byteOffset + D, q), w); d = D + q << 3; + w += q; continue; + } if (Z)W = H.H.W(W, w + (1 << 17)); if (m == 1) { v = b.J; C = b.h; X = (1 << 9) - 1; u = (1 << 5) - 1; } if (m == 2) { + J = A(N, d, 5) + 257; + h = A(N, d + 5, 5) + 1; Q = A(N, d + 10, 4) + 4; d += 14; const E = d; let j = 1; for (var c = 0; c < 38; c += 2) { b.Q[c] = 0; b.Q[c + 1] = 0; } for (var c = 0; + c < Q; c++) { const K = A(N, d + c * 3, 3); b.Q[(b.X[c] << 1) + 1] = K; if (K > j)j = K; }d += 3 * Q; M(b.Q, j); I(b.Q, j, b.u); v = b.w; C = b.d; + d = l(b.u, (1 << j) - 1, J + h, N, d, b.v); const r = V.V(b.v, 0, J, b.C); X = (1 << r) - 1; const S = V.V(b.v, J, h, b.D); u = (1 << S) - 1; M(b.C, r); + I(b.C, r, v); M(b.D, S); I(b.D, S, C); + } while (!0) { + const T = v[e(N, d) & X]; d += T & 15; const p = T >>> 4; if (p >>> 8 == 0) { W[w++] = p; } else if (p == 256) { break; } else { + let z = w + p - 254; + if (p > 264) { const _ = b.q[p - 257]; z = w + (_ >>> 3) + A(N, d, _ & 7); d += _ & 7; } const $ = C[e(N, d) & u]; d += $ & 15; const s = $ >>> 4; const Y = b.c[s]; const a = (Y >>> 4) + n(N, d, Y & 15); + d += Y & 15; while (w < z) { W[w] = W[w++ - a]; W[w] = W[w++ - a]; W[w] = W[w++ - a]; W[w] = W[w++ - a]; }w = z; + } + } + } return W.length == w ? W : W.slice(0, w); + }; + H.H.W = function (N, W) { const R = N.length; if (W <= R) return N; const V = new Uint8Array(R << 1); V.set(N, 0); return V; }; + H.H.R = function (N, W, R, V, n, A) { + const l = H.H.e; const M = H.H.Z; let I = 0; while (I < R) { + const e = N[M(V, n) & W]; n += e & 15; const b = e >>> 4; + if (b <= 15) { A[I] = b; I++; } else { + let Z = 0; let m = 0; if (b == 16) { m = 3 + l(V, n, 2); n += 2; Z = A[I - 1]; } else if (b == 17) { + m = 3 + l(V, n, 3); + n += 3; + } else if (b == 18) { m = 11 + l(V, n, 7); n += 7; } const J = I + m; while (I < J) { A[I] = Z; I++; } + } + } return n; + }; H.H.V = function (N, W, R, V) { + let n = 0; let A = 0; const l = V.length >>> 1; + while (A < R) { const M = N[A + W]; V[A << 1] = 0; V[(A << 1) + 1] = M; if (M > n)n = M; A++; } while (A < l) { V[A << 1] = 0; V[(A << 1) + 1] = 0; A++; } return n; + }; + H.H.n = function (N, W) { + const R = H.H.m; const V = N.length; let n; let A; let l; var M; let I; const e = R.j; for (var M = 0; M <= W; M++)e[M] = 0; for (M = 1; M < V; M += 2)e[N[M]]++; + const b = R.K; n = 0; e[0] = 0; for (A = 1; A <= W; A++) { n = n + e[A - 1] << 1; b[A] = n; } for (l = 0; l < V; l += 2) { + I = N[l + 1]; if (I != 0) { + N[l] = b[I]; + b[I]++; + } + } + }; H.H.A = function (N, W, R) { + const V = N.length; const n = H.H.m; const A = n.r; for (let l = 0; l < V; l += 2) { + if (N[l + 1] != 0) { + const M = l >> 1; const I = N[l + 1]; const e = M << 4 | I; const b = W - I; let Z = N[l] << b; const m = Z + (1 << b); + while (Z != m) { const J = A[Z] >>> 15 - W; R[J] = e; Z++; } + } + } + }; H.H.l = function (N, W) { + const R = H.H.m.r; const V = 15 - W; for (let n = 0; n < N.length; + n += 2) { const A = N[n] << W - N[n + 1]; N[n] = R[A] >>> V; } + }; H.H.M = function (N, W, R) { R <<= (W & 7); const V = W >>> 3; N[V] |= R; N[V + 1] |= R >>> 8; }; + H.H.I = function (N, W, R) { R <<= (W & 7); const V = W >>> 3; N[V] |= R; N[V + 1] |= R >>> 8; N[V + 2] |= R >>> 16; }; H.H.e = function (N, W, R) { return (N[W >>> 3] | N[(W >>> 3) + 1] << 8) >>> (W & 7) & (1 << R) - 1; }; + H.H.b = function (N, W, R) { return (N[W >>> 3] | N[(W >>> 3) + 1] << 8 | N[(W >>> 3) + 2] << 16) >>> (W & 7) & (1 << R) - 1; }; H.H.Z = function (N, W) { return (N[W >>> 3] | N[(W >>> 3) + 1] << 8 | N[(W >>> 3) + 2] << 16) >>> (W & 7); }; + H.H.i = function (N, W) { return (N[W >>> 3] | N[(W >>> 3) + 1] << 8 | N[(W >>> 3) + 2] << 16 | N[(W >>> 3) + 3] << 24) >>> (W & 7); }; H.H.m = (function () { + const N = Uint16Array; const W = Uint32Array; + return { + K: new N(16), j: new N(16), X: [16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15], S: [3, 4, 5, 6, 7, 8, 9, 10, 11, 13, 15, 17, 19, 23, 27, 31, 35, 43, 51, 59, 67, 83, 99, 115, 131, 163, 195, 227, 258, 999, 999, 999], T: [0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3, 4, 4, 4, 4, 5, 5, 5, 5, 0, 0, 0, 0], q: new N(32), p: [1, 2, 3, 4, 5, 7, 9, 13, 17, 25, 33, 49, 65, 97, 129, 193, 257, 385, 513, 769, 1025, 1537, 2049, 3073, 4097, 6145, 8193, 12289, 16385, 24577, 65535, 65535], z: [0, 0, 0, 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8, 9, 9, 10, 10, 11, 11, 12, 12, 13, 13, 0, 0], c: new W(32), J: new N(512), _: [], h: new N(32), $: [], w: new N(32768), C: [], v: [], d: new N(32768), D: [], u: new N(512), Q: [], r: new N(1 << 15), s: new W(286), Y: new W(30), a: new W(19), t: new W(15e3), k: new N(1 << 16), g: new N(1 << 15), + }; + }()); + (function () { + const N = H.H.m; const W = 1 << 15; for (var R = 0; R < W; R++) { + let V = R; V = (V & 2863311530) >>> 1 | (V & 1431655765) << 1; + V = (V & 3435973836) >>> 2 | (V & 858993459) << 2; V = (V & 4042322160) >>> 4 | (V & 252645135) << 4; V = (V & 4278255360) >>> 8 | (V & 16711935) << 8; + N.r[R] = (V >>> 16 | V << 16) >>> 17; + } function n(A, l, M) { while (l-- != 0)A.push(0, M); } for (var R = 0; R < 32; R++) { + N.q[R] = N.S[R] << 3 | N.T[R]; + N.c[R] = N.p[R] << 4 | N.z[R]; + }n(N._, 144, 8); n(N._, 255 - 143, 9); n(N._, 279 - 255, 7); n(N._, 287 - 279, 8); H.H.n(N._, 9); + H.H.A(N._, 9, N.J); H.H.l(N._, 9); n(N.$, 32, 5); H.H.n(N.$, 5); H.H.A(N.$, 5, N.h); H.H.l(N.$, 5); n(N.Q, 19, 0); n(N.C, 286, 0); + n(N.D, 30, 0); n(N.v, 320, 0); + }()); return H.H.N; +}()); + +UPNG.decode._readInterlace = function (data, out) { + const w = out.width; const + h = out.height; + const bpp = UPNG.decode._getBPP(out); const cbpp = bpp >> 3; const + bpl = Math.ceil(w * bpp / 8); + const img = new Uint8Array(h * bpl); + let di = 0; + + const starting_row = [0, 0, 4, 0, 2, 0, 1]; + const starting_col = [0, 4, 0, 2, 0, 1, 0]; + const row_increment = [8, 8, 8, 4, 4, 2, 2]; + const col_increment = [8, 8, 4, 4, 2, 2, 1]; + + let pass = 0; + while (pass < 7) { + const ri = row_increment[pass]; const + ci = col_increment[pass]; + let sw = 0; let + sh = 0; + let cr = starting_row[pass]; while (cr < h) { cr += ri; sh++; } + let cc = starting_col[pass]; while (cc < w) { cc += ci; sw++; } + const bpll = Math.ceil(sw * bpp / 8); UPNG.decode._filterZero(data, out, di, sw, sh); - var y=0, row = starting_row[pass]; - while(row>3]; val = (val>>(7-(cdi&7)))&1; - img[row*bpl + (col>>3)] |= (val << (7-((col&7)<<0))); + let y = 0; let + row = starting_row[pass]; + while (row < h) { + let col = starting_col[pass]; + let cdi = (di + y * bpll) << 3; + + while (col < w) { + if (bpp == 1) { + var val = data[cdi >> 3]; val = (val >> (7 - (cdi & 7))) & 1; + img[row * bpl + (col >> 3)] |= (val << (7 - ((col & 7) << 0))); } - if(bpp==2) { - var val = data[cdi>>3]; val = (val>>(6-(cdi&7)))&3; - img[row*bpl + (col>>2)] |= (val << (6-((col&3)<<1))); + if (bpp == 2) { + var val = data[cdi >> 3]; val = (val >> (6 - (cdi & 7))) & 3; + img[row * bpl + (col >> 2)] |= (val << (6 - ((col & 3) << 1))); } - if(bpp==4) { - var val = data[cdi>>3]; val = (val>>(4-(cdi&7)))&15; - img[row*bpl + (col>>1)] |= (val << (4-((col&1)<<2))); + if (bpp == 4) { + var val = data[cdi >> 3]; val = (val >> (4 - (cdi & 7))) & 15; + img[row * bpl + (col >> 1)] |= (val << (4 - ((col & 1) << 2))); } - if(bpp>=8) { - var ii = row*bpl+col*cbpp; - for(var j=0; j>3)+j]; + if (bpp >= 8) { + const ii = row * bpl + col * cbpp; + for (let j = 0; j < cbpp; j++) img[ii + j] = data[(cdi >> 3) + j]; } - cdi+=bpp; col+=ci; + cdi += bpp; col += ci; } - y++; row += ri; + y++; row += ri; } - if(sw*sh!=0) di += sh * (1 + bpll); - pass = pass + 1; + if (sw * sh != 0) di += sh * (1 + bpll); + pass += 1; } return img; -} +}; -UPNG.decode._getBPP = function(out) { - var noc = [1,null,3,1,2,null,4][out.ctype]; +UPNG.decode._getBPP = function (out) { + const noc = [1, null, 3, 1, 2, null, 4][out.ctype]; return noc * out.depth; -} - -UPNG.decode._filterZero = function(data, out, off, w, h) -{ - var bpp = UPNG.decode._getBPP(out), bpl = Math.ceil(w*bpp/8), paeth = UPNG.decode._paeth; - bpp = Math.ceil(bpp/8); - - var i=0, di=1, type=data[off], x=0; - - if(type>1) data[off]=[0,0,1][type-2]; - if(type==3) for(x=bpp; x>>1) )&255; - - for(var y=0; y>>1)); - for(; x>>1) ); } - else { for(; x 1) data[off] = [0, 0, 1][type - 2]; + if (type == 3) for (x = bpp; x < bpl; x++) data[x + 1] = (data[x + 1] + (data[x + 1 - bpp] >>> 1)) & 255; + + for (let y = 0; y < h; y++) { + i = off + y * bpl; di = i + y + 1; + type = data[di - 1]; x = 0; + + if (type == 0) for (; x < bpl; x++) data[i + x] = data[di + x]; + else if (type == 1) { + for (; x < bpp; x++) data[i + x] = data[di + x]; + for (; x < bpl; x++) data[i + x] = (data[di + x] + data[i + x - bpp]); + } else if (type == 2) { for (; x < bpl; x++) data[i + x] = (data[di + x] + data[i + x - bpl]); } else if (type == 3) { + for (; x < bpp; x++) data[i + x] = (data[di + x] + (data[i + x - bpl] >>> 1)); + for (; x < bpl; x++) data[i + x] = (data[di + x] + ((data[i + x - bpl] + data[i + x - bpp]) >>> 1)); + } else { + for (; x < bpp; x++) data[i + x] = (data[di + x] + paeth(0, data[i + x - bpl], 0)); + for (; x < bpl; x++) data[i + x] = (data[di + x] + paeth(data[i + x - bpp], data[i + x - bpl], data[i + x - bpp - bpl])); + } } return data; -} +}; -UPNG.decode._paeth = function(a,b,c) -{ - var p = a+b-c, pa = (p-a), pb = (p-b), pc = (p-c); - if (pa*pa <= pb*pb && pa*pa <= pc*pc) return a; - else if (pb*pb <= pc*pc) return b; +UPNG.decode._paeth = function (a, b, c) { + const p = a + b - c; const pa = (p - a); const pb = (p - b); const + pc = (p - c); + if (pa * pa <= pb * pb && pa * pa <= pc * pc) return a; + if (pb * pb <= pc * pc) return b; return c; -} - -UPNG.decode._IHDR = function(data, offset, out) -{ - var bin = UPNG._bin; - out.width = bin.readUint(data, offset); offset += 4; - out.height = bin.readUint(data, offset); offset += 4; - out.depth = data[offset]; offset++; - out.ctype = data[offset]; offset++; - out.compress = data[offset]; offset++; - out.filter = data[offset]; offset++; - out.interlace = data[offset]; offset++; -} +}; + +UPNG.decode._IHDR = function (data, offset, out) { + const bin = UPNG._bin; + out.width = bin.readUint(data, offset); offset += 4; + out.height = bin.readUint(data, offset); offset += 4; + out.depth = data[offset]; offset++; + out.ctype = data[offset]; offset++; + out.compress = data[offset]; offset++; + out.filter = data[offset]; offset++; + out.interlace = data[offset]; offset++; +}; UPNG._bin = { - nextZero : function(data,p) { while(data[p]!=0) p++; return p; }, - readUshort : function(buff,p) { return (buff[p]<< 8) | buff[p+1]; }, - writeUshort: function(buff,p,n){ buff[p] = (n>>8)&255; buff[p+1] = n&255; }, - readUint : function(buff,p) { return (buff[p]*(256*256*256)) + ((buff[p+1]<<16) | (buff[p+2]<< 8) | buff[p+3]); }, - writeUint : function(buff,p,n){ buff[p]=(n>>24)&255; buff[p+1]=(n>>16)&255; buff[p+2]=(n>>8)&255; buff[p+3]=n&255; }, - readASCII : function(buff,p,l){ var s = ""; for(var i=0; i=0 && yoff>=0) { si = (y*sw+x)<<2; ti = (( yoff+y)*tw+xoff+x)<<2; } - else { si = ((-yoff+y)*sw-xoff+x)<<2; ti = (y*tw+x)<<2; } - - if (mode==0) { tb[ti] = sb[si]; tb[ti+1] = sb[si+1]; tb[ti+2] = sb[si+2]; tb[ti+3] = sb[si+3]; } - else if(mode==1) { - var fa = sb[si+3]*(1/255), fr=sb[si]*fa, fg=sb[si+1]*fa, fb=sb[si+2]*fa; - var ba = tb[ti+3]*(1/255), br=tb[ti]*ba, bg=tb[ti+1]*ba, bb=tb[ti+2]*ba; - - var ifa=1-fa, oa = fa+ba*ifa, ioa = (oa==0?0:1/oa); - tb[ti+3] = 255*oa; - tb[ti+0] = (fr+br*ifa)*ioa; - tb[ti+1] = (fg+bg*ifa)*ioa; - tb[ti+2] = (fb+bb*ifa)*ioa; - } - else if(mode==2){ // copy only differences, otherwise zero - var fa = sb[si+3], fr=sb[si], fg=sb[si+1], fb=sb[si+2]; - var ba = tb[ti+3], br=tb[ti], bg=tb[ti+1], bb=tb[ti+2]; - if(fa==ba && fr==br && fg==bg && fb==bb) { tb[ti]=0; tb[ti+1]=0; tb[ti+2]=0; tb[ti+3]=0; } - else { tb[ti]=fr; tb[ti+1]=fg; tb[ti+2]=fb; tb[ti+3]=fa; } - } - else if(mode==3){ // check if can be blended - var fa = sb[si+3], fr=sb[si], fg=sb[si+1], fb=sb[si+2]; - var ba = tb[ti+3], br=tb[ti], bg=tb[ti+1], bb=tb[ti+2]; - if(fa==ba && fr==br && fg==bg && fb==bb) continue; - //if(fa!=255 && ba!=0) return false; - if(fa<220 && ba>20) return false; + nextZero(data, p) { while (data[p] != 0) p++; return p; }, + readUshort(buff, p) { return (buff[p] << 8) | buff[p + 1]; }, + writeUshort(buff, p, n) { buff[p] = (n >> 8) & 255; buff[p + 1] = n & 255; }, + readUint(buff, p) { return (buff[p] * (256 * 256 * 256)) + ((buff[p + 1] << 16) | (buff[p + 2] << 8) | buff[p + 3]); }, + writeUint(buff, p, n) { buff[p] = (n >> 24) & 255; buff[p + 1] = (n >> 16) & 255; buff[p + 2] = (n >> 8) & 255; buff[p + 3] = n & 255; }, + readASCII(buff, p, l) { let s = ''; for (let i = 0; i < l; i++) s += String.fromCharCode(buff[p + i]); return s; }, + writeASCII(data, p, s) { for (let i = 0; i < s.length; i++) data[p + i] = s.charCodeAt(i); }, + readBytes(buff, p, l) { const arr = []; for (let i = 0; i < l; i++) arr.push(buff[p + i]); return arr; }, + pad(n) { return n.length < 2 ? `0${n}` : n; }, + readUTF8(buff, p, l) { + let s = ''; + let ns; + for (let i = 0; i < l; i++) s += `%${UPNG._bin.pad(buff[p + i].toString(16))}`; + try { ns = decodeURIComponent(s); } catch (e) { return UPNG._bin.readASCII(buff, p, l); } + return ns; + }, +}; +UPNG._copyTile = function (sb, sw, sh, tb, tw, th, xoff, yoff, mode) { + const w = Math.min(sw, tw); const + h = Math.min(sh, th); + let si = 0; let + ti = 0; + for (let y = 0; y < h; y++) { + for (let x = 0; x < w; x++) { + if (xoff >= 0 && yoff >= 0) { si = (y * sw + x) << 2; ti = ((yoff + y) * tw + xoff + x) << 2; } else { si = ((-yoff + y) * sw - xoff + x) << 2; ti = (y * tw + x) << 2; } + + if (mode == 0) { tb[ti] = sb[si]; tb[ti + 1] = sb[si + 1]; tb[ti + 2] = sb[si + 2]; tb[ti + 3] = sb[si + 3]; } else if (mode == 1) { + var fa = sb[si + 3] * (1 / 255); var fr = sb[si] * fa; var fg = sb[si + 1] * fa; var + fb = sb[si + 2] * fa; + var ba = tb[ti + 3] * (1 / 255); var br = tb[ti] * ba; var bg = tb[ti + 1] * ba; var + bb = tb[ti + 2] * ba; + + const ifa = 1 - fa; const oa = fa + ba * ifa; const + ioa = (oa == 0 ? 0 : 1 / oa); + tb[ti + 3] = 255 * oa; + tb[ti + 0] = (fr + br * ifa) * ioa; + tb[ti + 1] = (fg + bg * ifa) * ioa; + tb[ti + 2] = (fb + bb * ifa) * ioa; + } else if (mode == 2) { // copy only differences, otherwise zero + var fa = sb[si + 3]; var fr = sb[si]; var fg = sb[si + 1]; var + fb = sb[si + 2]; + var ba = tb[ti + 3]; var br = tb[ti]; var bg = tb[ti + 1]; var + bb = tb[ti + 2]; + if (fa == ba && fr == br && fg == bg && fb == bb) { tb[ti] = 0; tb[ti + 1] = 0; tb[ti + 2] = 0; tb[ti + 3] = 0; } else { tb[ti] = fr; tb[ti + 1] = fg; tb[ti + 2] = fb; tb[ti + 3] = fa; } + } else if (mode == 3) { // check if can be blended + var fa = sb[si + 3]; var fr = sb[si]; var fg = sb[si + 1]; var + fb = sb[si + 2]; + var ba = tb[ti + 3]; var br = tb[ti]; var bg = tb[ti + 1]; var + bb = tb[ti + 2]; + if (fa == ba && fr == br && fg == bg && fb == bb) continue; + // if(fa!=255 && ba!=0) return false; + if (fa < 220 && ba > 20) return false; } } + } return true; -} +}; +UPNG.encode = function (bufs, w, h, ps, dels, tabs, forbidPlte) { + if (ps == null) ps = 0; + if (forbidPlte == null) forbidPlte = false; - - -UPNG.encode = function(bufs, w, h, ps, dels, tabs, forbidPlte) -{ - if(ps==null) ps=0; - if(forbidPlte==null) forbidPlte = false; - - var nimg = UPNG.encode.compress(bufs, w, h, ps, [false, false, false, 0, forbidPlte]); + const nimg = UPNG.encode.compress(bufs, w, h, ps, [false, false, false, 0, forbidPlte]); UPNG.encode.compressPNG(nimg, -1); return UPNG.encode._main(nimg, w, h, dels, tabs); -} - -UPNG.encodeLL = function(bufs, w, h, cc, ac, depth, dels, tabs) { - var nimg = { ctype: 0 + (cc==1 ? 0 : 2) + (ac==0 ? 0 : 4), depth: depth, frames: [] }; - - var time = Date.now(); - var bipp = (cc+ac)*depth, bipl = bipp * w; - for(var i=0; i1, pltAlpha = false; - - var leng = 8 + (16+5+4) /*+ (9+4)*/ + (anim ? 20 : 0); - if(tabs["sRGB"]!=null) leng += 8+1+4; - if(tabs["pHYs"]!=null) leng += 8+9+4; - if(nimg.ctype==3) { +}; + +UPNG.encode._main = function (nimg, w, h, dels, tabs) { + if (tabs == null) tabs = {}; + const { crc } = UPNG.crc; + const wUi = UPNG._bin.writeUint; + const wUs = UPNG._bin.writeUshort; + const wAs = UPNG._bin.writeASCII; + let offset = 8; const anim = nimg.frames.length > 1; let + pltAlpha = false; + + let leng = 8 + (16 + 5 + 4) /* + (9+4) */ + (anim ? 20 : 0); + if (tabs.sRGB != null) leng += 8 + 1 + 4; + if (tabs.pHYs != null) leng += 8 + 9 + 4; + if (nimg.ctype == 3) { var dl = nimg.plte.length; - for(var i=0; i>>24)!=255) pltAlpha = true; - leng += (8 + dl*3 + 4) + (pltAlpha ? (8 + dl*1 + 4) : 0); + for (var i = 0; i < dl; i++) if ((nimg.plte[i] >>> 24) != 255) pltAlpha = true; + leng += (8 + dl * 3 + 4) + (pltAlpha ? (8 + dl * 1 + 4) : 0); } - for(var j=0; j>>8)&255, b=(c>>>16)&255; - data[offset+ti+0]=r; data[offset+ti+1]=g; data[offset+ti+2]=b; + wUi(data, offset, dl * 3); offset += 4; + wAs(data, offset, 'PLTE'); offset += 4; + for (var i = 0; i < dl; i++) { + const ti = i * 3; const c = nimg.plte[i]; const r = (c) & 255; const g = (c >>> 8) & 255; const + b = (c >>> 16) & 255; + data[offset + ti + 0] = r; data[offset + ti + 1] = g; data[offset + ti + 2] = b; } - offset+=dl*3; - wUi(data,offset,crc(data,offset-dl*3-4,dl*3+4)); offset+=4; // crc - - if(pltAlpha) { - wUi(data,offset, dl); offset+=4; - wAs(data,offset,"tRNS"); offset+=4; - for(var i=0; i>>24)&255; - offset+=dl; - wUi(data,offset,crc(data,offset-dl-4,dl+4)); offset+=4; // crc + offset += dl * 3; + wUi(data, offset, crc(data, offset - dl * 3 - 4, dl * 3 + 4)); offset += 4; // crc + + if (pltAlpha) { + wUi(data, offset, dl); offset += 4; + wAs(data, offset, 'tRNS'); offset += 4; + for (var i = 0; i < dl; i++) data[offset + i] = (nimg.plte[i] >>> 24) & 255; + offset += dl; + wUi(data, offset, crc(data, offset - dl - 4, dl + 4)); offset += 4; // crc } } - var fi = 0; - for(var j=0; j>2, bln>>2)); - for(var j=0; j> 2, bln >> 2)); + for (var j = 0; j < bln; j += 4) { ti[j] = bb[cof + j]; ti[j + 1] = bb[cof + j + 1]; ti[j + 2] = bb[cof + j + 2]; ti[j + 3] = bb[cof + j + 3]; } cof += bln; + } - for(var i=0; inw && c==img32[i-nw]) ind[i]=ind[i-nw]; + for (var j = 0; j < frms.length; j++) { // when not quantized, other frames can contain colors, that are not in an initial frame + var frm = frms[j]; const img32 = new Uint32Array(frm.img.buffer); var nw = frm.rect.width; var + ilen = img32.length; + const ind = new Uint8Array(ilen); inds.push(ind); + for (var i = 0; i < ilen; i++) { + const c = img32[i]; + if (i != 0 && c == img32[i - 1]) ind[i] = ind[i - 1]; + else if (i > nw && c == img32[i - nw]) ind[i] = ind[i - nw]; else { - var cmc = cmap[c]; - if(cmc==null) { cmap[c]=cmc=plte.length; plte.push(c); if(plte.length>=300) break; } - ind[i]=cmc; + let cmc = cmap[c]; + if (cmc == null) { cmap[c] = cmc = plte.length; plte.push(c); if (plte.length >= 300) break; } + ind[i] = cmc; } } } - //console.log("make palette", Date.now()-time); time = Date.now(); + // console.log("make palette", Date.now()-time); time = Date.now(); } - var cc=plte.length; //console.log("colors:",cc); - if(cc<=256 && forbidPlte==false) { - if(cc<= 2) depth=1; else if(cc<= 4) depth=2; else if(cc<=16) depth=4; else depth=8; - depth = Math.max(depth, minBits); + const cc = plte.length; // console.log("colors:",cc); + if (cc <= 256 && forbidPlte == false) { + if (cc <= 2) depth = 1; else if (cc <= 4) depth = 2; else if (cc <= 16) depth = 4; else depth = 8; + depth = Math.max(depth, minBits); } - for(var j=0; j>1)] |= (inj[ii+x]<<(4-(x&1)*4)); - else if(depth==2) for(var x=0; x>2)] |= (inj[ii+x]<<(6-(x&3)*2)); - else if(depth==1) for(var x=0; x>3)] |= (inj[ii+x]<<(7-(x&7)*1)); + for (var j = 0; j < frms.length; j++) { + var frm = frms[j]; const nx = frm.rect.x; const ny = frm.rect.y; var nw = frm.rect.width; const + nh = frm.rect.height; + let cimg = frm.img; const + cimg32 = new Uint32Array(cimg.buffer); + let bpl = 4 * nw; let + bpp = 4; + if (cc <= 256 && forbidPlte == false) { + bpl = Math.ceil(depth * nw / 8); + var nimg = new Uint8Array(bpl * nh); + const inj = inds[j]; + for (let y = 0; y < nh; y++) { + var i = y * bpl; const + ii = y * nw; + if (depth == 8) for (var x = 0; x < nw; x++) nimg[i + (x)] = (inj[ii + x]); + else if (depth == 4) for (var x = 0; x < nw; x++) nimg[i + (x >> 1)] |= (inj[ii + x] << (4 - (x & 1) * 4)); + else if (depth == 2) for (var x = 0; x < nw; x++) nimg[i + (x >> 2)] |= (inj[ii + x] << (6 - (x & 3) * 2)); + else if (depth == 1) for (var x = 0; x < nw; x++) nimg[i + (x >> 3)] |= (inj[ii + x] << (7 - (x & 7) * 1)); } - cimg=nimg; ctype=3; bpp=1; - } - else if(gotAlpha==false && frms.length==1) { // some next "reduced" frames may contain alpha for blending - var nimg = new Uint8Array(nw*nh*3), area=nw*nh; - for(var i=0; i palette indices", Date.now()-time); time = Date.now(); + // console.log("colors => palette indices", Date.now()-time); time = Date.now(); - return {ctype:ctype, depth:depth, plte:plte, frames:frms }; -} -UPNG.encode.framize = function(bufs,w,h,alwaysBlend,evenCrd,forbidPrev) { + return { + ctype, depth, plte, frames: frms, + }; +}; +UPNG.encode.framize = function (bufs, w, h, alwaysBlend, evenCrd, forbidPrev) { /* DISPOSE - 0 : no change - 1 : clear to transparent @@ -674,106 +819,133 @@ UPNG.encode.framize = function(bufs,w,h,alwaysBlend,evenCrd,forbidPrev) { - 0 : replace - 1 : blend */ - var frms = []; - for(var j=0; jmax) max=x; - if(ymay) may=y; + let nx = 0; let ny = 0; let nw = w; let nh = h; let + blend = alwaysBlend ? 1 : 0; + if (j != 0) { + const tlim = (forbidPrev || alwaysBlend || j == 1 || frms[j - 2].dispose != 0) ? 1 : 2; let tstp = 0; let + tarea = 1e9; + for (let it = 0; it < tlim; it++) { + var pimg = new Uint8Array(bufs[j - 1 - it]); const + p32 = new Uint32Array(bufs[j - 1 - it]); + let mix = w; let miy = h; let max = -1; let may = -1; + for (let y = 0; y < h; y++) { + for (let x = 0; x < w; x++) { + var i = y * w + x; + if (cimg32[i] != p32[i]) { + if (x < mix) mix = x; if (x > max) max = x; + if (y < miy) miy = y; if (y > may) may = y; + } } } - if(max==-1) mix=miy=max=may=0; - if(evenCrd) { if((mix&1)==1)mix--; if((miy&1)==1)miy--; } - var sarea = (max-mix+1)*(may-miy+1); - if(sareamax) max=cx; - if(cymay) may=cy; +}; +UPNG.encode._updateFrame = function (bufs, w, h, frms, i, r, evenCrd) { + const U8 = Uint8Array; const + U32 = Uint32Array; + const pimg = new U8(bufs[i - 1]); const pimg32 = new U32(bufs[i - 1]); const + nimg = i + 1 < bufs.length ? new U8(bufs[i + 1]) : null; + const cimg = new U8(bufs[i]); const + cimg32 = new U32(cimg.buffer); + + let mix = w; let miy = h; let max = -1; let may = -1; + for (let y = 0; y < r.height; y++) { + for (let x = 0; x < r.width; x++) { + const cx = r.x + x; const + cy = r.y + y; + const j = cy * w + cx; const + cc = cimg32[j]; + // no need to draw transparency, or to dispose it. Or, if writing the same color and the next one does not need transparency. + if (cc == 0 || (frms[i - 1].dispose == 0 && pimg32[j] == cc && (nimg == null || nimg[j * 4 + 3] != 0))/**/) {} else { + if (cx < mix) mix = cx; if (cx > max) max = cx; + if (cy < miy) miy = cy; if (cy > may) may = cy; + } } } - if(max==-1) mix=miy=max=may=0; - if(evenCrd) { if((mix&1)==1)mix--; if((miy&1)==1)miy--; } - r = {x:mix, y:miy, width:max-mix+1, height:may-miy+1}; - - var fr = frms[i]; fr.rect = r; fr.blend = 1; fr.img = new Uint8Array(r.width*r.height*4); - if(frms[i-1].dispose==0) { - UPNG._copyTile(pimg,w,h, fr.img,r.width,r.height, -r.x,-r.y, 0); - UPNG.encode._prepareDiff(cimg,w,h,fr.img,r); - //UPNG._copyTile(cimg,w,h, fr.img,r.width,r.height, -r.x,-r.y, 2); - } - else - UPNG._copyTile(cimg,w,h, fr.img,r.width,r.height, -r.x,-r.y, 0); -} -UPNG.encode._prepareDiff = function(cimg, w,h, nimg, rec) { - UPNG._copyTile(cimg,w,h, nimg,rec.width,rec.height, -rec.x,-rec.y, 2); + if (max == -1) mix = miy = max = may = 0; + if (evenCrd) { if ((mix & 1) == 1)mix--; if ((miy & 1) == 1)miy--; } + r = { + x: mix, y: miy, width: max - mix + 1, height: may - miy + 1, + }; + + const fr = frms[i]; fr.rect = r; fr.blend = 1; fr.img = new Uint8Array(r.width * r.height * 4); + if (frms[i - 1].dispose == 0) { + UPNG._copyTile(pimg, w, h, fr.img, r.width, r.height, -r.x, -r.y, 0); + UPNG.encode._prepareDiff(cimg, w, h, fr.img, r); + // UPNG._copyTile(cimg,w,h, fr.img,r.width,r.height, -r.x,-r.y, 2); + } else { UPNG._copyTile(cimg, w, h, fr.img, r.width, r.height, -r.x, -r.y, 0); } +}; +UPNG.encode._prepareDiff = function (cimg, w, h, nimg, rec) { + UPNG._copyTile(cimg, w, h, nimg, rec.width, rec.height, -rec.x, -rec.y, 2); /* var n32 = new Uint32Array(nimg.buffer); var og = new Uint8Array(rec.width*rec.height*4), o32 = new Uint32Array(og.buffer); @@ -791,257 +963,288 @@ UPNG.encode._prepareDiff = function(cimg, w,h, nimg, rec) { //var j = i, c=p32[(i>>>2)-1]; //while(p32[j>>>2]==c) { n32[j>>>2]=c; j+=4; } } - }*/ -} - -UPNG.encode._filterZero = function(img,h,bpp,bpl,data, filter, levelZero) -{ - var fls = [], ftry=[0,1,2,3,4]; - if (filter!=-1) ftry=[filter]; - else if(h*bpl>500000 || bpp==1) ftry=[0]; - var opts; if(levelZero) opts={level:0}; + } */ +}; +UPNG.encode._filterZero = function (img, h, bpp, bpl, data, filter, levelZero) { + const fls = []; let + ftry = [0, 1, 2, 3, 4]; + if (filter != -1) ftry = [filter]; + else if (h * bpl > 500000 || bpp == 1) ftry = [0]; + let opts; if (levelZero) opts = { level: 0 }; // var CMPR = (data.length>10e6 && typeof UZIP !== 'undefined') ? UZIP : pako; - var CMPR = UZIP; - - var time = Date.now(); - for(var i=0; i>1) +256)&255; - if(type==4) for(var x=bpp; x>1))&255; - for(var x=bpp; x>1))&255; } - if(type==4) { for(var x= 0; x> 1) + 256) & 255; + if (type == 4) for (var x = bpp; x < bpl; x++) data[di + x] = (img[i + x] - paeth(img[i + x - bpp], 0, 0) + 256) & 255; + } else { + if (type == 2) { for (var x = 0; x < bpl; x++) data[di + x] = (img[i + x] + 256 - img[i + x - bpl]) & 255; } + if (type == 3) { + for (var x = 0; x < bpp; x++) data[di + x] = (img[i + x] + 256 - (img[i + x - bpl] >> 1)) & 255; + for (var x = bpp; x < bpl; x++) data[di + x] = (img[i + x] + 256 - ((img[i + x - bpl] + img[i + x - bpp]) >> 1)) & 255; + } + if (type == 4) { + for (var x = 0; x < bpp; x++) data[di + x] = (img[i + x] + 256 - paeth(0, img[i + x - bpl], 0)) & 255; + for (var x = bpp; x < bpl; x++) data[di + x] = (img[i + x] + 256 - paeth(img[i + x - bpp], img[i + x - bpl], img[i + x - bpp - bpl])) & 255; + } } -} +}; UPNG.crc = { - table : ( function() { - var tab = new Uint32Array(256); - for (var n=0; n<256; n++) { - var c = n; - for (var k=0; k<8; k++) { - if (c & 1) c = 0xedb88320 ^ (c >>> 1); - else c = c >>> 1; + table: (function () { + const tab = new Uint32Array(256); + for (let n = 0; n < 256; n++) { + let c = n; + for (let k = 0; k < 8; k++) { + if (c & 1) c = 0xedb88320 ^ (c >>> 1); + else c >>>= 1; } - tab[n] = c; } - return tab; })(), - update : function(c, buf, off, len) { - for (var i=0; i>> 8); + tab[n] = c; + } + return tab; + }()), + update(c, buf, off, len) { + for (let i = 0; i < len; i++) c = UPNG.crc.table[(c ^ buf[off + i]) & 0xff] ^ (c >>> 8); return c; }, - crc : function(b,o,l) { return UPNG.crc.update(0xffffffff,b,o,l) ^ 0xffffffff; } -} + crc(b, o, l) { return UPNG.crc.update(0xffffffff, b, o, l) ^ 0xffffffff; }, +}; +UPNG.quantize = function (abuf, ps) { + const oimg = new Uint8Array(abuf); const nimg = oimg.slice(0); const + nimg32 = new Uint32Array(nimg.buffer); -UPNG.quantize = function(abuf, ps) -{ - var oimg = new Uint8Array(abuf), nimg = oimg.slice(0), nimg32 = new Uint32Array(nimg.buffer); + const KD = UPNG.quantize.getKDtree(nimg, ps); + const root = KD[0]; const + leafs = KD[1]; - var KD = UPNG.quantize.getKDtree(nimg, ps); - var root = KD[0], leafs = KD[1]; + const { planeDst } = UPNG.quantize; + const sb = oimg; const tb = nimg32; const + len = sb.length; - var planeDst = UPNG.quantize.planeDst; - var sb = oimg, tb = nimg32, len=sb.length; - - var inds = new Uint8Array(oimg.length>>2), nd; - if(oimg.length<20e6) // precise, but slow :( - for(var i=0; i> 2); let + nd; + if (oimg.length < 20e6) // precise, but slow :( + { + for (var i = 0; i < len; i += 4) { + var r = sb[i] * (1 / 255); var g = sb[i + 1] * (1 / 255); var b = sb[i + 2] * (1 / 255); var + a = sb[i + 3] * (1 / 255); nd = UPNG.quantize.getNearest(root, r, g, b, a); - inds[i>>2] = nd.ind; tb[i>>2] = nd.est.rgba; + inds[i >> 2] = nd.ind; tb[i >> 2] = nd.est.rgba; } - else - for(var i=0; i>2] = nd.ind; tb[i>>2] = nd.est.rgba; + nd = root; while (nd.left) nd = (planeDst(nd.est, r, g, b, a) <= 0) ? nd.left : nd.right; + inds[i >> 2] = nd.ind; tb[i >> 2] = nd.est.rgba; } - return { abuf:nimg.buffer, inds:inds, plte:leafs }; -} - -UPNG.quantize.getKDtree = function(nimg, ps, err) { - if(err==null) err = 0.0001; - var nimg32 = new Uint32Array(nimg.buffer); - - var root = {i0:0, i1:nimg.length, bst:null, est:null, tdst:0, left:null, right:null }; // basic statistic, extra statistic - root.bst = UPNG.quantize.stats( nimg,root.i0, root.i1 ); root.est = UPNG.quantize.estats( root.bst ); - var leafs = [root]; - - while(leafs.length maxL) { maxL=leafs[i].est.L; mi=i; } - if(maxL=s0 || node.i1<=s0); - //console.log(maxL, leafs.length, mi); - if(s0wrong) { node.est.L=0; continue; } - - - var ln = {i0:node.i0, i1:s0, bst:null, est:null, tdst:0, left:null, right:null }; ln.bst = UPNG.quantize.stats( nimg, ln.i0, ln.i1 ); - ln.est = UPNG.quantize.estats( ln.bst ); - var rn = {i0:s0, i1:node.i1, bst:null, est:null, tdst:0, left:null, right:null }; rn.bst = {R:[], m:[], N:node.bst.N-ln.bst.N}; - for(var i=0; i<16; i++) rn.bst.R[i] = node.bst.R[i]-ln.bst.R[i]; - for(var i=0; i< 4; i++) rn.bst.m[i] = node.bst.m[i]-ln.bst.m[i]; - rn.est = UPNG.quantize.estats( rn.bst ); - - node.left = ln; node.right = rn; - leafs[mi]=ln; leafs.push(rn); } - leafs.sort(function(a,b) { return b.bst.N-a.bst.N; }); - for(var i=0; i maxL) { maxL = leafs[i].est.L; mi = i; } + if (maxL < err) break; + const node = leafs[mi]; + + const s0 = UPNG.quantize.splitPixels(nimg, nimg32, node.i0, node.i1, node.est.e, node.est.eMq255); + const s0wrong = (node.i0 >= s0 || node.i1 <= s0); + // console.log(maxL, leafs.length, mi); + if (s0wrong) { node.est.L = 0; continue; } + + const ln = { + i0: node.i0, i1: s0, bst: null, est: null, tdst: 0, left: null, right: null, + }; ln.bst = UPNG.quantize.stats(nimg, ln.i0, ln.i1); + ln.est = UPNG.quantize.estats(ln.bst); + const rn = { + i0: s0, i1: node.i1, bst: null, est: null, tdst: 0, left: null, right: null, + }; rn.bst = { R: [], m: [], N: node.bst.N - ln.bst.N }; + for (var i = 0; i < 16; i++) rn.bst.R[i] = node.bst.R[i] - ln.bst.R[i]; + for (var i = 0; i < 4; i++) rn.bst.m[i] = node.bst.m[i] - ln.bst.m[i]; + rn.est = UPNG.quantize.estats(rn.bst); + + node.left = ln; node.right = rn; + leafs[mi] = ln; leafs.push(rn); + } + leafs.sort((a, b) => b.bst.N - a.bst.N); + for (var i = 0; i < leafs.length; i++) leafs[i].ind = i; return [root, leafs]; -} - -UPNG.quantize.getNearest = function(nd, r,g,b,a) -{ - if(nd.left==null) { nd.tdst = UPNG.quantize.dist(nd.est.q,r,g,b,a); return nd; } - var planeDst = UPNG.quantize.planeDst(nd.est,r,g,b,a); - - var node0 = nd.left, node1 = nd.right; - if(planeDst>0) { node0=nd.right; node1=nd.left; } - - var ln = UPNG.quantize.getNearest(node0, r,g,b,a); - if(ln.tdst<=planeDst*planeDst) return ln; - var rn = UPNG.quantize.getNearest(node1, r,g,b,a); - return rn.tdst eMq) i1-=4; - if(i0>=i1) break; - - var t = nimg32[i0>>2]; nimg32[i0>>2] = nimg32[i1>>2]; nimg32[i1>>2]=t; - - i0+=4; i1-=4; +}; + +UPNG.quantize.getNearest = function (nd, r, g, b, a) { + if (nd.left == null) { nd.tdst = UPNG.quantize.dist(nd.est.q, r, g, b, a); return nd; } + const planeDst = UPNG.quantize.planeDst(nd.est, r, g, b, a); + + let node0 = nd.left; let + node1 = nd.right; + if (planeDst > 0) { node0 = nd.right; node1 = nd.left; } + + const ln = UPNG.quantize.getNearest(node0, r, g, b, a); + if (ln.tdst <= planeDst * planeDst) return ln; + const rn = UPNG.quantize.getNearest(node1, r, g, b, a); + return rn.tdst < ln.tdst ? rn : ln; +}; +UPNG.quantize.planeDst = function (est, r, g, b, a) { const { e } = est; return e[0] * r + e[1] * g + e[2] * b + e[3] * a - est.eMq; }; +UPNG.quantize.dist = function (q, r, g, b, a) { + const d0 = r - q[0]; const d1 = g - q[1]; const d2 = b - q[2]; const + d3 = a - q[3]; return d0 * d0 + d1 * d1 + d2 * d2 + d3 * d3; +}; + +UPNG.quantize.splitPixels = function (nimg, nimg32, i0, i1, e, eMq) { + const { vecDot } = UPNG.quantize; + i1 -= 4; + const shfs = 0; + while (i0 < i1) { + while (vecDot(nimg, i0, e) <= eMq) i0 += 4; + while (vecDot(nimg, i1, e) > eMq) i1 -= 4; + if (i0 >= i1) break; + + const t = nimg32[i0 >> 2]; nimg32[i0 >> 2] = nimg32[i1 >> 2]; nimg32[i1 >> 2] = t; + + i0 += 4; i1 -= 4; } - while(vecDot(nimg, i0, e)>eMq) i0-=4; - return i0+4; -} -UPNG.quantize.vecDot = function(nimg, i, e) -{ - return nimg[i]*e[0] + nimg[i+1]*e[1] + nimg[i+2]*e[2] + nimg[i+3]*e[3]; -} -UPNG.quantize.stats = function(nimg, i0, i1){ - var R = [0,0,0,0, 0,0,0,0, 0,0,0,0, 0,0,0,0]; - var m = [0,0,0,0]; - var N = (i1-i0)>>2; - for(var i=i0; i eMq) i0 -= 4; + return i0 + 4; +}; +UPNG.quantize.vecDot = function (nimg, i, e) { + return nimg[i] * e[0] + nimg[i + 1] * e[1] + nimg[i + 2] * e[2] + nimg[i + 3] * e[3]; +}; +UPNG.quantize.stats = function (nimg, i0, i1) { + const R = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]; + const m = [0, 0, 0, 0]; + const N = (i1 - i0) >> 2; + for (let i = i0; i < i1; i += 4) { + const r = nimg[i] * (1 / 255); const g = nimg[i + 1] * (1 / 255); const b = nimg[i + 2] * (1 / 255); const + a = nimg[i + 3] * (1 / 255); + // var r = nimg[i], g = nimg[i+1], b = nimg[i+2], a = nimg[i+3]; + m[0] += r; m[1] += g; m[2] += b; m[3] += a; + + R[0] += r * r; R[1] += r * g; R[2] += r * b; R[3] += r * a; + R[5] += g * g; R[6] += g * b; R[7] += g * a; + R[10] += b * b; R[11] += b * a; + R[15] += a * a; } - R[4]=R[1]; R[8]=R[2]; R[9]=R[6]; R[12]=R[3]; R[13]=R[7]; R[14]=R[11]; + R[4] = R[1]; R[8] = R[2]; R[9] = R[6]; R[12] = R[3]; R[13] = R[7]; R[14] = R[11]; - return {R:R, m:m, N:N}; -} -UPNG.quantize.estats = function(stats){ - var R = stats.R, m = stats.m, N = stats.N; + return { R, m, N }; +}; +UPNG.quantize.estats = function (stats) { + const { R } = stats; + const { m } = stats; + const { N } = stats; // when all samples are equal, but N is large (millions), the Rj can be non-zero ( 0.0003.... - precission error) - var m0 = m[0], m1 = m[1], m2 = m[2], m3 = m[3], iN = (N==0 ? 0 : 1/N); - var Rj = [ - R[ 0] - m0*m0*iN, R[ 1] - m0*m1*iN, R[ 2] - m0*m2*iN, R[ 3] - m0*m3*iN, - R[ 4] - m1*m0*iN, R[ 5] - m1*m1*iN, R[ 6] - m1*m2*iN, R[ 7] - m1*m3*iN, - R[ 8] - m2*m0*iN, R[ 9] - m2*m1*iN, R[10] - m2*m2*iN, R[11] - m2*m3*iN, - R[12] - m3*m0*iN, R[13] - m3*m1*iN, R[14] - m3*m2*iN, R[15] - m3*m3*iN + const m0 = m[0]; const m1 = m[1]; const m2 = m[2]; const m3 = m[3]; const + iN = (N == 0 ? 0 : 1 / N); + const Rj = [ + R[0] - m0 * m0 * iN, R[1] - m0 * m1 * iN, R[2] - m0 * m2 * iN, R[3] - m0 * m3 * iN, + R[4] - m1 * m0 * iN, R[5] - m1 * m1 * iN, R[6] - m1 * m2 * iN, R[7] - m1 * m3 * iN, + R[8] - m2 * m0 * iN, R[9] - m2 * m1 * iN, R[10] - m2 * m2 * iN, R[11] - m2 * m3 * iN, + R[12] - m3 * m0 * iN, R[13] - m3 * m1 * iN, R[14] - m3 * m2 * iN, R[15] - m3 * m3 * iN, ]; - var A = Rj, M = UPNG.M4; - var b = [Math.random(),Math.random(),Math.random(),Math.random()], mi = 0, tmi = 0; + const A = Rj; const + M = UPNG.M4; + let b = [Math.random(), Math.random(), Math.random(), Math.random()]; let mi = 0; let + tmi = 0; - if(N!=0) - for(var i=0; i<16; i++) { - b = M.multVec(A, b); tmi = Math.sqrt(M.dot(b,b)); b = M.sml(1/tmi, b); - if(i!=0 && Math.abs(tmi-mi)<1e-9) break; mi = tmi; + if (N != 0) { + for (let i = 0; i < 16; i++) { + b = M.multVec(A, b); tmi = Math.sqrt(M.dot(b, b)); b = M.sml(1 / tmi, b); + if (i != 0 && Math.abs(tmi - mi) < 1e-9) break; mi = tmi; } - //b = [0,0,1,0]; mi=N; - var q = [m0*iN, m1*iN, m2*iN, m3*iN]; - var eMq255 = M.dot(M.sml(255,q),b); - - return { Cov:Rj, q:q, e:b, L:mi, eMq255:eMq255, eMq : M.dot(b,q), - rgba: (((Math.round(255*q[3])<<24) | (Math.round(255*q[2])<<16) | (Math.round(255*q[1])<<8) | (Math.round(255*q[0])<<0))>>>0) }; -} + } + // b = [0,0,1,0]; mi=N; + const q = [m0 * iN, m1 * iN, m2 * iN, m3 * iN]; + const eMq255 = M.dot(M.sml(255, q), b); + + return { + Cov: Rj, + q, + e: b, + L: mi, + eMq255, + eMq: M.dot(b, q), + rgba: (((Math.round(255 * q[3]) << 24) | (Math.round(255 * q[2]) << 16) | (Math.round(255 * q[1]) << 8) | (Math.round(255 * q[0]) << 0)) >>> 0), + }; +}; UPNG.M4 = { - multVec : function(m,v) { + multVec(m, v) { return [ - m[ 0]*v[0] + m[ 1]*v[1] + m[ 2]*v[2] + m[ 3]*v[3], - m[ 4]*v[0] + m[ 5]*v[1] + m[ 6]*v[2] + m[ 7]*v[3], - m[ 8]*v[0] + m[ 9]*v[1] + m[10]*v[2] + m[11]*v[3], - m[12]*v[0] + m[13]*v[1] + m[14]*v[2] + m[15]*v[3] + m[0] * v[0] + m[1] * v[1] + m[2] * v[2] + m[3] * v[3], + m[4] * v[0] + m[5] * v[1] + m[6] * v[2] + m[7] * v[3], + m[8] * v[0] + m[9] * v[1] + m[10] * v[2] + m[11] * v[3], + m[12] * v[0] + m[13] * v[1] + m[14] * v[2] + m[15] * v[3], ]; }, - dot : function(x,y) { return x[0]*y[0]+x[1]*y[1]+x[2]*y[2]+x[3]*y[3]; }, - sml : function(a,y) { return [a*y[0],a*y[1],a*y[2],a*y[3]]; } -} - -UPNG.encode.concatRGBA = function(bufs) { - var tlen = 0; - for(var i=0; i} */ -export default async function compress (file, options, previousProgress = 0) { - let progress = previousProgress +export default async function compress(file, options, previousProgress = 0) { + let progress = previousProgress; - function incProgress (inc = 5) { - progress += inc - options.onProgress(Math.min(progress, 100)) + function incProgress(inc = 5) { + progress += inc; + options.onProgress(Math.min(progress, 100)); } - function setProgress (p) { - progress = Math.min(Math.max(p, progress), 100) - options.onProgress(progress) + function setProgress(p) { + progress = Math.min(Math.max(p, progress), 100); + options.onProgress(progress); } - let remainingTrials = options.maxIteration || 10 + let remainingTrials = options.maxIteration || 10; - const maxSizeByte = options.maxSizeMB * 1024 * 1024 + const maxSizeByte = options.maxSizeMB * 1024 * 1024; - incProgress() + incProgress(); // drawFileInCanvas - let [img, origCanvas] = await drawFileInCanvas(file) + const [, origCanvas] = await drawFileInCanvas(file); - incProgress() + incProgress(); // handleMaxWidthOrHeight - const maxWidthOrHeightFixedCanvas = handleMaxWidthOrHeight(origCanvas, options) + const maxWidthOrHeightFixedCanvas = handleMaxWidthOrHeight(origCanvas, options); - incProgress() + incProgress(); // exifOrientation - const exifOrientation = options.exifOrientation || await getExifOrientation(file) - incProgress() - const orientationFixedCanvas = (await isAutoOrientationInBrowser()) ? maxWidthOrHeightFixedCanvas : followExifOrientation(maxWidthOrHeightFixedCanvas, exifOrientation) - incProgress() + const exifOrientation = options.exifOrientation || await getExifOrientation(file); + incProgress(); + const orientationFixedCanvas = (await isAutoOrientationInBrowser()) ? maxWidthOrHeightFixedCanvas : followExifOrientation(maxWidthOrHeightFixedCanvas, exifOrientation); + incProgress(); - let quality = options.initialQuality || 1.0 + let quality = options.initialQuality || 1.0; - const outputFileType = options.fileType || file.type + const outputFileType = options.fileType || file.type; - let tempFile = await canvasToFile(orientationFixedCanvas, outputFileType, file.name, file.lastModified, quality) - incProgress() + const tempFile = await canvasToFile(orientationFixedCanvas, outputFileType, file.name, file.lastModified, quality); + incProgress(); - const origExceedMaxSize = tempFile.size > maxSizeByte - const sizeBecomeLarger = tempFile.size > file.size + const origExceedMaxSize = tempFile.size > maxSizeByte; + const sizeBecomeLarger = tempFile.size > file.size; // console.log('original file size', file.size) // console.log('current file size', tempFile.size) // check if we need to compress or resize if (!origExceedMaxSize && !sizeBecomeLarger) { // no need to compress - setProgress(100) - return tempFile + setProgress(100); + return tempFile; } - const sourceSize = file.size - const renderedSize = tempFile.size - let currentSize = renderedSize - let compressedFile - let newCanvas, ctx - let canvas = orientationFixedCanvas + const sourceSize = file.size; + const renderedSize = tempFile.size; + let currentSize = renderedSize; + let compressedFile; + let newCanvas; let + ctx; + let canvas = orientationFixedCanvas; while (remainingTrials-- && (currentSize > maxSizeByte || currentSize > sourceSize)) { - const newWidth = origExceedMaxSize ? canvas.width * 0.95 : canvas.width + const newWidth = origExceedMaxSize ? canvas.width * 0.95 : canvas.width; const newHeight = origExceedMaxSize ? canvas.height * 0.95 : canvas.height; // console.log('current width', newWidth); // console.log('current height', newHeight); - [newCanvas, ctx] = getNewCanvasAndCtx(newWidth, newHeight) + [newCanvas, ctx] = getNewCanvasAndCtx(newWidth, newHeight); - ctx.drawImage(canvas, 0, 0, newWidth, newHeight) + ctx.drawImage(canvas, 0, 0, newWidth, newHeight); - quality *= 0.95 - compressedFile = await canvasToFile(newCanvas, outputFileType, file.name, file.lastModified, quality) + quality *= 0.95; + // eslint-disable-next-line no-await-in-loop + compressedFile = await canvasToFile(newCanvas, outputFileType, file.name, file.lastModified, quality); - cleanupCanvasMemory(canvas) + cleanupCanvasMemory(canvas); - canvas = newCanvas + canvas = newCanvas; - currentSize = compressedFile.size + currentSize = compressedFile.size; // console.log('currentSize', currentSize) - setProgress(Math.min(99, Math.floor((renderedSize - currentSize) / (renderedSize - maxSizeByte) * 100))) + setProgress(Math.min(99, Math.floor(((renderedSize - currentSize) / (renderedSize - maxSizeByte)) * 100))); } - cleanupCanvasMemory(canvas) - cleanupCanvasMemory(newCanvas) - cleanupCanvasMemory(maxWidthOrHeightFixedCanvas) - cleanupCanvasMemory(orientationFixedCanvas) - cleanupCanvasMemory(origCanvas) + cleanupCanvasMemory(canvas); + cleanupCanvasMemory(newCanvas); + cleanupCanvasMemory(maxWidthOrHeightFixedCanvas); + cleanupCanvasMemory(orientationFixedCanvas); + cleanupCanvasMemory(origCanvas); - setProgress(100) - return compressedFile + setProgress(100); + return compressedFile; } diff --git a/lib/index.js b/lib/index.js index e091ac8..41373df 100644 --- a/lib/index.js +++ b/lib/index.js @@ -1,4 +1,6 @@ -import compress from './image-compression' +import './polyfill'; + +import compress from './image-compression'; import { canvasToFile, drawFileInCanvas, @@ -11,15 +13,18 @@ import { followExifOrientation, CustomFile, cleanupCanvasMemory, - isAutoOrientationInBrowser -} from './utils' -import { compressOnWebWorker } from './web-worker' + isAutoOrientationInBrowser, + approximateBelowMaximumCanvasSizeOfBrowser, + getBrowserName, +} from './utils'; +// eslint-disable-next-line import/no-cycle +import { compressOnWebWorker } from './web-worker'; /** * Compress an image file. * * @param {File} file - * @param {Object} options - { maxSizeMB=Number.POSITIVE_INFINITY, maxWidthOrHeight, useWebWorker=false, maxIteration = 10, exifOrientation, fileType } + * @param {Object} opts - { maxSizeMB=Number.POSITIVE_INFINITY, maxWidthOrHeight, useWebWorker=false, maxIteration = 10, exifOrientation, fileType } * @param {number} [options.maxSizeMB=Number.POSITIVE_INFINITY] * @param {number} [options.maxWidthOrHeight=undefined] * @param {boolean} [options.useWebWorker=false] @@ -29,73 +34,74 @@ import { compressOnWebWorker } from './web-worker' * @param {string} [options.fileType] - default to be the original mime type from the image file * @returns {Promise} */ -async function imageCompression (file, options) { +async function imageCompression(file, options) { + const opts = { ...options }; - let compressedFile - let progress = 0 - let onProgress + let compressedFile; + let progress = 0; + const { onProgress } = opts; - options.maxSizeMB = options.maxSizeMB || Number.POSITIVE_INFINITY - const useWebWorker = typeof options.useWebWorker === 'boolean' ? options.useWebWorker : true - delete options.useWebWorker - onProgress = options.onProgress - options.onProgress = (aProgress) => { - progress = aProgress + opts.maxSizeMB = opts.maxSizeMB || Number.POSITIVE_INFINITY; + const useWebWorker = typeof opts.useWebWorker === 'boolean' ? opts.useWebWorker : true; + delete opts.useWebWorker; + opts.onProgress = (aProgress) => { + progress = aProgress; if (typeof onProgress === 'function') { - onProgress(progress) + onProgress(progress); } - } + }; if (!(file instanceof Blob || file instanceof CustomFile)) { - throw new Error('The file given is not an instance of Blob or File') + throw new Error('The file given is not an instance of Blob or File'); } else if (!/^image/.test(file.type)) { - throw new Error('The file given is not an image') + throw new Error('The file given is not an image'); } // try run in web worker, fall back to run in main thread - const inWebWorker = typeof WorkerGlobalScope !== 'undefined' && self instanceof WorkerGlobalScope + // eslint-disable-next-line no-undef, no-restricted-globals + const inWebWorker = typeof WorkerGlobalScope !== 'undefined' && self instanceof WorkerGlobalScope; // if ((useWebWorker && typeof Worker === 'function') || inWebWorker) { - // console.log('run compression in web worker') + // console.log('run compression in web worker'); // } else { - // console.log('run compression in main thread') + // console.log('run compression in main thread'); // } if (useWebWorker && typeof Worker === 'function' && !inWebWorker) { try { - // console.log(1) // "compressOnWebWorker" is kind of like a recursion to call "imageCompression" again inside web worker - compressedFile = await compressOnWebWorker(file, options) + compressedFile = await compressOnWebWorker(file, opts); } catch (e) { - // console.warn('Run compression in web worker failed:', e, ', fall back to main thread') - // console.log(1.5) - compressedFile = await compress(file, options) + // console.warn('Run compression in web worker failed:', e, ', fall back to main thread'); + compressedFile = await compress(file, opts); } } else { - // console.log(2) - compressedFile = await compress(file, options) + compressedFile = await compress(file, opts); } try { - compressedFile.name = file.name - compressedFile.lastModified = file.lastModified + compressedFile.name = file.name; + compressedFile.lastModified = file.lastModified; + // eslint-disable-next-line no-empty } catch (e) {} - return compressedFile + return compressedFile; } -imageCompression.getDataUrlFromFile = getDataUrlFromFile -imageCompression.getFilefromDataUrl = getFilefromDataUrl -imageCompression.loadImage = loadImage -imageCompression.drawImageInCanvas = drawImageInCanvas -imageCompression.drawFileInCanvas = drawFileInCanvas -imageCompression.canvasToFile = canvasToFile -imageCompression.getExifOrientation = getExifOrientation +imageCompression.getDataUrlFromFile = getDataUrlFromFile; +imageCompression.getFilefromDataUrl = getFilefromDataUrl; +imageCompression.loadImage = loadImage; +imageCompression.drawImageInCanvas = drawImageInCanvas; +imageCompression.drawFileInCanvas = drawFileInCanvas; +imageCompression.canvasToFile = canvasToFile; +imageCompression.getExifOrientation = getExifOrientation; -imageCompression.handleMaxWidthOrHeight = handleMaxWidthOrHeight -imageCompression.followExifOrientation = followExifOrientation -imageCompression.cleanupCanvasMemory = cleanupCanvasMemory -imageCompression.isAutoOrientationInBrowser = isAutoOrientationInBrowser -imageCompression.version = '1.0.14' +imageCompression.handleMaxWidthOrHeight = handleMaxWidthOrHeight; +imageCompression.followExifOrientation = followExifOrientation; +imageCompression.cleanupCanvasMemory = cleanupCanvasMemory; +imageCompression.isAutoOrientationInBrowser = isAutoOrientationInBrowser; +imageCompression.approximateBelowMaximumCanvasSizeOfBrowser = approximateBelowMaximumCanvasSizeOfBrowser; +imageCompression.getBrowserName = getBrowserName; +imageCompression.version = '1.0.15'; -export default imageCompression +export default imageCompression; diff --git a/lib/polyfill.js b/lib/polyfill.js new file mode 100644 index 0000000..d172355 --- /dev/null +++ b/lib/polyfill.js @@ -0,0 +1,2 @@ +import 'core-js/es/global-this'; +import 'core-js/es/object/assign'; diff --git a/lib/utils.js b/lib/utils.js index 5312c4f..b0d93e9 100644 --- a/lib/utils.js +++ b/lib/utils.js @@ -1,55 +1,12 @@ -import UPNG from './UPNG' -import Bowser from "bowser"; -import MaxCanvasSize from './config/max-canvas-size' +import UPNG from './UPNG'; +import MaxCanvasSize from './config/max-canvas-size'; -const isBrowser = typeof window !== 'undefined' // change browser environment to support SSR +const isBrowser = typeof window !== 'undefined'; // change browser environment to support SSR // add support for cordova-plugin-file -const moduleMapper = isBrowser && window.cordova && window.cordova.require && window.cordova.require('cordova/modulemapper') -export const CustomFile = isBrowser && ((moduleMapper && moduleMapper.getOriginalSymbol(window, 'File')) || File) -export const CustomFileReader = isBrowser && ((moduleMapper && moduleMapper.getOriginalSymbol(window, 'FileReader')) || FileReader) - -// Check if browser supports automatic image orientation -// see https://github.com/blueimp/JavaScript-Load-Image/blob/1e4df707821a0afcc11ea0720ee403b8759f3881/js/load-image-orientation.js#L37-L53 -export async function isAutoOrientationInBrowser() { - if (isAutoOrientationInBrowser.result !== undefined) - return isAutoOrientationInBrowser.result - - // black 2x1 JPEG, with the following meta information set: - // EXIF Orientation: 6 (Rotated 90° CCW) - const testImageURL = - 'data:image/jpeg;base64,/9j/4QAiRXhpZgAATU0AKgAAAAgAAQESAAMAAAABAAYAAAA' + - 'AAAD/2wCEAAEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBA' + - 'QEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQE' + - 'BAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAf/AABEIAAEAAgMBEQACEQEDEQH/x' + - 'ABKAAEAAAAAAAAAAAAAAAAAAAALEAEAAAAAAAAAAAAAAAAAAAAAAQEAAAAAAAAAAAAAAAA' + - 'AAAAAEQEAAAAAAAAAAAAAAAAAAAAA/9oADAMBAAIRAxEAPwA/8H//2Q==' - const testImageFile = await getFilefromDataUrl(testImageURL, 'test.jpg', Date.now()) - - const testImageCanvas = (await drawFileInCanvas(testImageFile))[1] - const testImageFile2 = await canvasToFile(testImageCanvas, testImageFile.type, testImageFile.name, testImageFile.lastModified) - cleanupCanvasMemory(testImageCanvas) - const img = (await drawFileInCanvas(testImageFile2))[0] - // console.log('img', img.width, img.height) - - isAutoOrientationInBrowser.result = img.width === 1 && img.height === 2 - return isAutoOrientationInBrowser.result -} - -/** - * getDataUrlFromFile - * - * @param {File | Blob} file - * @returns {Promise} - */ -export function getDataUrlFromFile (file) { - return new Promise((resolve, reject) => { - const reader = new CustomFileReader() - reader.onload = () => resolve(reader.result) - reader.onerror = (e) => reject(e) - reader.readAsDataURL(file) - }) -} +const moduleMapper = isBrowser && window.cordova && window.cordova.require && window.cordova.require('cordova/modulemapper'); +export const CustomFile = isBrowser && ((moduleMapper && moduleMapper.getOriginalSymbol(window, 'File')) || (typeof window.File !== 'undefined' && File)); +export const CustomFileReader = isBrowser && ((moduleMapper && moduleMapper.getOriginalSymbol(window, 'FileReader')) || (typeof window.FileReader !== 'undefined' && FileReader)); /** * getFilefromDataUrl @@ -59,20 +16,20 @@ export function getDataUrlFromFile (file) { * @param {number} [lastModified=Date.now()] * @returns {Promise} */ -export function getFilefromDataUrl (dataUrl, filename, lastModified = Date.now()) { +export function getFilefromDataUrl(dataUrl, filename, lastModified = Date.now()) { return new Promise((resolve) => { - const arr = dataUrl.split(',') - const mime = arr[0].match(/:(.*?);/)[1] - const bstr = globalThis.atob(arr[1]) - let n = bstr.length - const u8arr = new Uint8Array(n) + const arr = dataUrl.split(','); + const mime = arr[0].match(/:(.*?);/)[1]; + const bstr = globalThis.atob(arr[1]); + let n = bstr.length; + const u8arr = new Uint8Array(n); while (n--) { - u8arr[n] = bstr.charCodeAt(n) + u8arr[n] = bstr.charCodeAt(n); } - const file = new Blob([u8arr], { type: mime }) - file.name = filename - file.lastModified = lastModified - resolve(file) + const file = new Blob([u8arr], { type: mime }); + file.name = filename; + file.lastModified = lastModified; + resolve(file); // Safari has issue with File constructor not being able to POST in FormData // https://github.com/Donaldcwl/browser-image-compression/issues/8 @@ -86,7 +43,22 @@ export function getFilefromDataUrl (dataUrl, filename, lastModified = Date.now() // file.lastModified = lastModified // } // resolve(file) - }) + }); +} + +/** + * getDataUrlFromFile + * + * @param {File | Blob} file + * @returns {Promise} + */ +export function getDataUrlFromFile(file) { + return new Promise((resolve, reject) => { + const reader = new CustomFileReader(); + reader.onload = () => resolve(reader.result); + reader.onerror = (e) => reject(e); + reader.readAsDataURL(file); + }); } /** @@ -95,13 +67,36 @@ export function getFilefromDataUrl (dataUrl, filename, lastModified = Date.now() * @param {string} src * @returns {Promise} */ -export function loadImage (src) { +export function loadImage(src) { return new Promise((resolve, reject) => { - const img = new Image() - img.onload = () => resolve(img) - img.onerror = (e) => reject(e) - img.src = src - }) + const img = new Image(); + img.onload = () => resolve(img); + img.onerror = (e) => reject(e); + img.src = src; + }); +} + +/** + * getBrowserName + * + * Extracts the browser name from the useragent. + * + * ref: https://stackoverflow.com/a/26358856 + * + * @returns {string} + */ +export function getBrowserName() { + let browserName = 'etc'; + if (navigator.userAgent.indexOf('Chrome') !== -1 || navigator.userAgent.indexOf('Chromium') !== -1) { + browserName = 'chrome'; + } if (navigator.userAgent.indexOf('Safari') !== -1) { + browserName = 'safari'; + } else if (navigator.userAgent.indexOf('Firefox') !== -1) { + browserName = 'firefox'; + } else if ((navigator.userAgent.indexOf('MSIE') !== -1) || (!!document.documentMode === true)) { // IF IE > 10 + browserName = 'internet explorer'; + } + return browserName; } /** @@ -115,32 +110,58 @@ export function loadImage (src) { * @param {number} initHeight * @returns {object} */ -function approximateBelowMaximumCanvasSizeOfBrowser(initWidth, initHeight) { - const browserName = getBrowserName() - const maximumCanvasSize = MaxCanvasSize[browserName] +export function approximateBelowMaximumCanvasSizeOfBrowser(initWidth, initHeight) { + const browserName = getBrowserName(); + const maximumCanvasSize = MaxCanvasSize[browserName]; let width = initWidth; - let height = initHeight - let size = width * height - const ratio = width > height ? height / width : width / height + let height = initHeight; + let size = width * height; + const ratio = width > height ? height / width : width / height; - while(size > maximumCanvasSize * maximumCanvasSize) { + while (size > maximumCanvasSize * maximumCanvasSize) { const halfSizeWidth = (maximumCanvasSize + width) / 2; const halfSizeHeight = (maximumCanvasSize + height) / 2; - if(halfSizeWidth < halfSizeHeight) { - height = halfSizeHeight - width = halfSizeHeight * ratio + if (halfSizeWidth < halfSizeHeight) { + height = halfSizeHeight; + width = halfSizeHeight * ratio; } else { - height = halfSizeWidth * ratio - width = halfSizeWidth + height = halfSizeWidth * ratio; + width = halfSizeWidth; } - size = width * height + size = width * height; } return { - width, height + width, height, + }; +} + +/** + * get new Canvas and it's context + * @param width + * @param height + * @returns {[HTMLCanvasElement | OffscreenCanvas, CanvasRenderingContext2D]} + */ +export function getNewCanvasAndCtx(width, height) { + let canvas; + let ctx; + try { + canvas = new OffscreenCanvas(width, height); + ctx = canvas.getContext('2d'); + if (ctx === null) { + throw new Error('getContext of OffscreenCanvas returns null'); + } + } catch (e) { + canvas = document.createElement('canvas'); + ctx = canvas.getContext('2d'); } + canvas.width = width; + canvas.height = height; + // ctx.fillStyle = '#fff' + // ctx.fillRect(0, 0, width, height) + return [canvas, ctx]; } /** @@ -149,11 +170,11 @@ function approximateBelowMaximumCanvasSizeOfBrowser(initWidth, initHeight) { * @param {HTMLImageElement} img * @returns {HTMLCanvasElement | OffscreenCanvas} */ -export function drawImageInCanvas (img) { - const {width, height} = approximateBelowMaximumCanvasSizeOfBrowser(img.width, img.height) - const [canvas, ctx] = getNewCanvasAndCtx(width, height) - ctx.drawImage(img, 0, 0, canvas.width, canvas.height) - return canvas +export function drawImageInCanvas(img) { + const { width, height } = approximateBelowMaximumCanvasSizeOfBrowser(img.width, img.height); + const [canvas, ctx] = getNewCanvasAndCtx(width, height); + ctx.drawImage(img, 0, 0, canvas.width, canvas.height); + return canvas; } /** @@ -162,16 +183,16 @@ export function drawImageInCanvas (img) { * @param {File | Blob} file * @returns {Promise<[ImageBitmap | HTMLImageElement, HTMLCanvasElement | OffscreenCanvas]>} */ -export async function drawFileInCanvas (file) { - let img +export async function drawFileInCanvas(file) { + let img; try { - img = await createImageBitmap(file) + img = await createImageBitmap(file); } catch (e) { - const dataUrl = await getDataUrlFromFile(file) - img = await loadImage(dataUrl) + const dataUrl = await getDataUrlFromFile(file); + img = await loadImage(dataUrl); } - const canvas = drawImageInCanvas(img) - return [img, canvas] + const canvas = drawImageInCanvas(img); + return [img, canvas]; } /** @@ -184,27 +205,66 @@ export async function drawFileInCanvas (file) { * @param {number} [quality] * @returns {Promise} */ -export async function canvasToFile (canvas, fileType, fileName, fileLastModified, quality = 1) { - let file +export async function canvasToFile(canvas, fileType, fileName, fileLastModified, quality = 1) { + let file; if (fileType === 'image/png') { - const ctx = canvas.getContext('2d') - const data = ctx.getImageData(0, 0, canvas.width, canvas.height).data - const png = UPNG.encode([data], canvas.width, canvas.height, 256 * quality) - file = new Blob([png], { type: fileType }) - file.name = fileName - file.lastModified = fileLastModified + const ctx = canvas.getContext('2d'); + const { data } = ctx.getImageData(0, 0, canvas.width, canvas.height); + const png = UPNG.encode([data], canvas.width, canvas.height, 256 * quality); + file = new Blob([png], { type: fileType }); + file.name = fileName; + file.lastModified = fileLastModified; } else if (typeof OffscreenCanvas === 'function' && canvas instanceof OffscreenCanvas) { // checked on Win Chrome 83, MacOS Chrome 83 - file = await canvas.convertToBlob({ type: fileType, quality }) - file.name = fileName - file.lastModified = fileLastModified + file = await canvas.convertToBlob({ type: fileType, quality }); + file.name = fileName; + file.lastModified = fileLastModified; // some browser do not support quality parameter, see: https://developer.mozilla.org/en-US/docs/Web/API/HTMLCanvasElement/toBlob // } else if (typeof canvas.toBlob === 'function') { // file = await new Promise(resolve => canvas.toBlob(resolve, fileType, quality)) } else { // checked on Win Edge 44, Win IE 11, Win Firefox 76, MacOS Firefox 77, MacOS Safari 13.1 - const dataUrl = canvas.toDataURL(fileType, quality) - file = await getFilefromDataUrl(dataUrl, fileName, fileLastModified) + const dataUrl = canvas.toDataURL(fileType, quality); + file = await getFilefromDataUrl(dataUrl, fileName, fileLastModified); } - return file + return file; +} + +/** + * clear Canvas memory + * @param canvas + * @returns null + */ +export function cleanupCanvasMemory(canvas) { + // garbage clean canvas for safari + // ref: https://bugs.webkit.org/show_bug.cgi?id=195325 + // eslint-disable-next-line no-param-reassign + canvas.width = 0; + // eslint-disable-next-line no-param-reassign + canvas.height = 0; +} + +// Check if browser supports automatic image orientation +// see https://github.com/blueimp/JavaScript-Load-Image/blob/1e4df707821a0afcc11ea0720ee403b8759f3881/js/load-image-orientation.js#L37-L53 +export async function isAutoOrientationInBrowser() { + if (isAutoOrientationInBrowser.result !== undefined) return isAutoOrientationInBrowser.result; + + // black 2x1 JPEG, with the following meta information set: + // EXIF Orientation: 6 (Rotated 90° CCW) + const testImageURL = 'data:image/jpeg;base64,/9j/4QAiRXhpZgAATU0AKgAAAAgAAQESAAMAAAABAAYAAAA' + + 'AAAD/2wCEAAEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBA' + + 'QEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQE' + + 'BAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAf/AABEIAAEAAgMBEQACEQEDEQH/x' + + 'ABKAAEAAAAAAAAAAAAAAAAAAAALEAEAAAAAAAAAAAAAAAAAAAAAAQEAAAAAAAAAAAAAAAA' + + 'AAAAAEQEAAAAAAAAAAAAAAAAAAAAA/9oADAMBAAIRAxEAPwA/8H//2Q=='; + const testImageFile = await getFilefromDataUrl(testImageURL, 'test.jpg', Date.now()); + + const testImageCanvas = (await drawFileInCanvas(testImageFile))[1]; + const testImageFile2 = await canvasToFile(testImageCanvas, testImageFile.type, testImageFile.name, testImageFile.lastModified); + cleanupCanvasMemory(testImageCanvas); + const img = (await drawFileInCanvas(testImageFile2))[0]; + // console.log('img', img.width, img.height) + + isAutoOrientationInBrowser.result = img.width === 1 && img.height === 2; + return isAutoOrientationInBrowser.result; } /** @@ -215,45 +275,45 @@ export async function canvasToFile (canvas, fileType, fileName, fileLastModified * @param {File | Blob} file * @returns {Promise} - orientation id, see https://i.stack.imgur.com/VGsAj.gif */ -export function getExifOrientation (file) { +export function getExifOrientation(file) { return new Promise((resolve, reject) => { - const reader = new CustomFileReader() + const reader = new CustomFileReader(); reader.onload = (e) => { - const view = new DataView(e.target.result) + const view = new DataView(e.target.result); if (view.getUint16(0, false) != 0xFFD8) { - return resolve(-2) + return resolve(-2); } - const length = view.byteLength - let offset = 2 + const length = view.byteLength; + let offset = 2; while (offset < length) { - if (view.getUint16(offset + 2, false) <= 8) return resolve(-1) - const marker = view.getUint16(offset, false) - offset += 2 + if (view.getUint16(offset + 2, false) <= 8) return resolve(-1); + const marker = view.getUint16(offset, false); + offset += 2; if (marker == 0xFFE1) { if (view.getUint32(offset += 2, false) != 0x45786966) { - return resolve(-1) + return resolve(-1); } - var little = view.getUint16(offset += 6, false) == 0x4949 - offset += view.getUint32(offset + 4, little) - var tags = view.getUint16(offset, little) - offset += 2 - for (var i = 0; i < tags; i++) { + const little = view.getUint16(offset += 6, false) == 0x4949; + offset += view.getUint32(offset + 4, little); + const tags = view.getUint16(offset, little); + offset += 2; + for (let i = 0; i < tags; i++) { if (view.getUint16(offset + (i * 12), little) == 0x0112) { - return resolve(view.getUint16(offset + (i * 12) + 8, little)) + return resolve(view.getUint16(offset + (i * 12) + 8, little)); } } } else if ((marker & 0xFF00) != 0xFF00) { - break + break; } else { - offset += view.getUint16(offset, false) + offset += view.getUint16(offset, false); } } - return resolve(-1) - } - reader.onerror = (e) => reject(e) - reader.readAsArrayBuffer(file) - }) + return resolve(-1); + }; + reader.onerror = (e) => reject(e); + reader.readAsArrayBuffer(file); + }); } /** @@ -262,31 +322,31 @@ export function getExifOrientation (file) { * @param options * @returns {HTMLCanvasElement | OffscreenCanvas} */ -export function handleMaxWidthOrHeight (canvas, options) { - const width = canvas.width - const height = canvas.height - const maxWidthOrHeight = options.maxWidthOrHeight +export function handleMaxWidthOrHeight(canvas, options) { + const { width } = canvas; + const { height } = canvas; + const { maxWidthOrHeight } = options; - const needToHandle = isFinite(maxWidthOrHeight) && (width > maxWidthOrHeight || height > maxWidthOrHeight) + const needToHandle = isFinite(maxWidthOrHeight) && (width > maxWidthOrHeight || height > maxWidthOrHeight); - let newCanvas = canvas - let ctx + let newCanvas = canvas; + let ctx; if (needToHandle) { - [newCanvas, ctx] = getNewCanvasAndCtx(width, height) + [newCanvas, ctx] = getNewCanvasAndCtx(width, height); if (width > height) { - newCanvas.width = maxWidthOrHeight - newCanvas.height = (height / width) * maxWidthOrHeight + newCanvas.width = maxWidthOrHeight; + newCanvas.height = (height / width) * maxWidthOrHeight; } else { - newCanvas.width = (width / height) * maxWidthOrHeight - newCanvas.height = maxWidthOrHeight + newCanvas.width = (width / height) * maxWidthOrHeight; + newCanvas.height = maxWidthOrHeight; } - ctx.drawImage(canvas, 0, 0, newCanvas.width, newCanvas.height) + ctx.drawImage(canvas, 0, 0, newCanvas.width, newCanvas.height); - cleanupCanvasMemory(canvas) + cleanupCanvasMemory(canvas); } - return newCanvas + return newCanvas; } /** @@ -297,115 +357,51 @@ export function handleMaxWidthOrHeight (canvas, options) { * @param {number} exifOrientation * @returns {HTMLCanvasElement | OffscreenCanvas} canvas */ -export function followExifOrientation (canvas, exifOrientation) { - const width = canvas.width - const height = canvas.height +export function followExifOrientation(canvas, exifOrientation) { + const { width } = canvas; + const { height } = canvas; - const [newCanvas, ctx] = getNewCanvasAndCtx(width, height) + const [newCanvas, ctx] = getNewCanvasAndCtx(width, height); // set proper canvas dimensions before transform & export - if (4 < exifOrientation && exifOrientation < 9) { - newCanvas.width = height - newCanvas.height = width + if (exifOrientation > 4 && exifOrientation < 9) { + newCanvas.width = height; + newCanvas.height = width; } else { - newCanvas.width = width - newCanvas.height = height + newCanvas.width = width; + newCanvas.height = height; } // transform context before drawing image switch (exifOrientation) { case 2: - ctx.transform(-1, 0, 0, 1, width, 0) - break + ctx.transform(-1, 0, 0, 1, width, 0); + break; case 3: - ctx.transform(-1, 0, 0, -1, width, height) - break + ctx.transform(-1, 0, 0, -1, width, height); + break; case 4: - ctx.transform(1, 0, 0, -1, 0, height) - break + ctx.transform(1, 0, 0, -1, 0, height); + break; case 5: - ctx.transform(0, 1, 1, 0, 0, 0) - break + ctx.transform(0, 1, 1, 0, 0, 0); + break; case 6: - ctx.transform(0, 1, -1, 0, height, 0) - break + ctx.transform(0, 1, -1, 0, height, 0); + break; case 7: - ctx.transform(0, -1, -1, 0, height, width) - break + ctx.transform(0, -1, -1, 0, height, width); + break; case 8: - ctx.transform(0, -1, 1, 0, 0, width) - break + ctx.transform(0, -1, 1, 0, 0, width); + break; default: - break - } - - ctx.drawImage(canvas, 0, 0, width, height) - - cleanupCanvasMemory(canvas) - - return newCanvas -} - -/** - * get new Canvas and it's context - * @param width - * @param height - * @returns {[HTMLCanvasElement | OffscreenCanvas, CanvasRenderingContext2D]} - */ -export function getNewCanvasAndCtx (width, height) { - let canvas - let ctx - try { - canvas = new OffscreenCanvas(width, height) - ctx = canvas.getContext('2d') - if (ctx === null) { - throw new Error('getContext of OffscreenCanvas returns null') - } - } catch (e) { - canvas = document.createElement('canvas') - ctx = canvas.getContext('2d') + break; } - canvas.width = width - canvas.height = height - // ctx.fillStyle = '#fff' - // ctx.fillRect(0, 0, width, height) - return [canvas, ctx] -} - -/** - * clear Canvas memory - * @param canvas - * @returns null - */ -export function cleanupCanvasMemory (canvas) { - // garbage clean canvas for safari - // ref: https://bugs.webkit.org/show_bug.cgi?id=195325 - canvas.width = 0 - canvas.height = 0 -} -if (isBrowser) { -// Polyfill for Number.isInteger - Number.isInteger = Number.isInteger || function (value) { - return typeof value === 'number' && - isFinite(value) && - Math.floor(value) === value - } -} + ctx.drawImage(canvas, 0, 0, width, height); -/** - * getBrowserName - * - * Extracts the browser name from the useragent. - * - * @returns {string} - */ -export function getBrowserName() { - const browserName = Bowser.parse(globalThis.navigator.userAgent).browser.name || '' - const lowerCasedBrowserName = browserName.toLowerCase() - if(['chrome', 'safari', 'firefox'].includes(lowerCasedBrowserName)) { - return lowerCasedBrowserName - } + cleanupCanvasMemory(canvas); - return 'etc' + return newCanvas; } diff --git a/lib/web-worker.js b/lib/web-worker.js index 8d60d37..7ff4472 100644 --- a/lib/web-worker.js +++ b/lib/web-worker.js @@ -1,50 +1,50 @@ -import lib from './index' -import compress from './image-compression' -import { cleanupCanvasMemory, getNewCanvasAndCtx } from './utils' -import UPNG from './UPNG' -import * as UZIP from 'uzip' +import * as UZIP from 'uzip'; +// eslint-disable-next-line import/no-cycle +import lib from './index'; +import compress from './image-compression'; +import { getNewCanvasAndCtx } from './utils'; +import UPNG from './UPNG'; +import MaxCanvasSize from './config/max-canvas-size'; -let cnt = 0 -let imageCompressionLibUrl -let worker +let cnt = 0; +let imageCompressionLibUrl; +let worker; -function createWorker (script) { +function createWorker(script) { if (typeof script === 'function') { - script = `(${f})()` + script = `(${script})()`; } - return new Worker(URL.createObjectURL(new Blob([script]))) + return new Worker(URL.createObjectURL(new Blob([script]))); } -function createSourceObject (str) { +function createSourceObject(str) { // console.log('createSourceObject', str) - return URL.createObjectURL(new Blob([str], { type: 'application/javascript' })) + return URL.createObjectURL(new Blob([str], { type: 'application/javascript' })); } function stringify(o) { - return JSON.stringify(o, (key, value) => { - return (typeof value === 'function' ) ? `BIC_FN:::(() => ${value.toString()})()` : value; - }) + return JSON.stringify(o, (key, value) => ((typeof value === 'function') ? `BIC_FN:::(function () { return ${value.toString()} })()` : value)); } function parse(o) { - if (typeof o === 'string') return o - const result = {} + if (typeof o === 'string') return o; + const result = {}; Object.entries(o).forEach(([key, value]) => { if (typeof value === 'string' && value.startsWith('BIC_FN:::')) { try { - result[key] = eval(value.replace(/^BIC_FN:::/, '')) + result[key] = eval(value.replace(/^BIC_FN:::/, '')); } catch (e) { - console.log(key, e) - throw e + // console.log(key, e); + throw e; } } else { - result[key] = parse(value) + result[key] = parse(value); } - }) - return result + }); + return result; } -function generateLib () { +function generateLib() { // prepare the lib to be used inside WebWorker return createSourceObject(` // reconstruct library @@ -61,6 +61,8 @@ function generateLib () { imageCompression.followExifOrientation = ${lib.followExifOrientation} imageCompression.cleanupCanvasMemory = ${lib.cleanupCanvasMemory} imageCompression.isAutoOrientationInBrowser = ${lib.isAutoOrientationInBrowser} + imageCompression.approximateBelowMaximumCanvasSizeOfBrowser = ${lib.approximateBelowMaximumCanvasSizeOfBrowser} + imageCompression.getBrowserName = ${lib.getBrowserName} // functions / objects getDataUrlFromFile = imageCompression.getDataUrlFromFile @@ -74,13 +76,27 @@ function generateLib () { followExifOrientation = imageCompression.followExifOrientation cleanupCanvasMemory = imageCompression.cleanupCanvasMemory isAutoOrientationInBrowser = imageCompression.isAutoOrientationInBrowser + approximateBelowMaximumCanvasSizeOfBrowser = imageCompression.approximateBelowMaximumCanvasSizeOfBrowser + getBrowserName = imageCompression.getBrowserName getNewCanvasAndCtx = ${getNewCanvasAndCtx} CustomFileReader = FileReader CustomFile = File + MaxCanvasSize = ${JSON.stringify(MaxCanvasSize)} + function compress (){return (${compress}).apply(null, arguments)} + + // core-js function _slicedToArray(arr, n) { return arr } function _typeof(a) { return typeof a } - function compress (){return (${compress}).apply(null, arguments)} + function _objectSpread2(target) { + for (var i = 1; i < arguments.length; i++) { + var source = arguments[i] != null ? arguments[i] : {}; + + Object.assign(target, source) + } + + return target; + } // Libraries const parse = ${parse} @@ -164,7 +180,7 @@ function generateLib () { n(N.D,30,0);n(N.v,320,0)}());return H.H.N}() const UZIP = {} - UZIP["parse"] = ${UZIP["parse"]} + UZIP["parse"] = ${UZIP.parse} UZIP._readLocal = ${UZIP._readLocal} UZIP.inflateRaw = ${UZIP.inflateRaw} UZIP.inflate = ${UZIP.inflate} @@ -291,10 +307,10 @@ function generateLib () { for(var i=0; i<320; i++) U.ttree.push(0,0); */ })() - `) + `); } -function generateWorkerScript () { +function generateWorkerScript() { // code to be run in the WebWorker return createWorker(` let scriptImported = false @@ -315,43 +331,43 @@ function generateWorkerScript () { self.postMessage({ error: e.message + '\\n' + e.stack, id }) } }) - `) + `); } -export function compressOnWebWorker (file, options) { +export function compressOnWebWorker(file, options) { return new Promise(async (resolve, reject) => { - let id = cnt++ + const id = cnt++; if (!imageCompressionLibUrl) { - imageCompressionLibUrl = generateLib() + imageCompressionLibUrl = generateLib(); } if (!worker) { - worker = generateWorkerScript() + worker = generateWorkerScript(); } - function handler (e) { + function handler(e) { if (e.data.id === id) { if (e.data.progress !== undefined) { - options.onProgress(e.data.progress) - return + options.onProgress(e.data.progress); + return; } - worker.removeEventListener('message', handler) + worker.removeEventListener('message', handler); if (e.data.error) { - reject(new Error(e.data.error)) + reject(new Error(e.data.error)); } - resolve(e.data.file) + resolve(e.data.file); } } - worker.addEventListener('message', handler) - worker.addEventListener('error', reject) + worker.addEventListener('message', handler); + worker.addEventListener('error', reject); worker.postMessage({ file, id, imageCompressionLibUrl, - options: { ...options, onProgress: undefined } - }) - }) + options: { ...options, onProgress: undefined }, + }); + }); } diff --git a/package.json b/package.json index ee60f0b..2c43a31 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "browser-image-compression", - "version": "1.0.14", + "version": "1.0.15", "description": "Compress images in the browser", "main": "dist/browser-image-compression.js", "module": "dist/browser-image-compression.mjs", @@ -15,7 +15,8 @@ "posttest": "npm run coverage-badges", "test:watch": "cross-env NODE_ENV=test nyc mocha -w", "prepublishOnly": "npm test && npm run build", - "coverage-badges": "make-coverage-badge" + "coverage-badges": "make-coverage-badge", + "commit": "cz" }, "homepage": "https://github.com/Donaldcwl/browser-image-compression#readme", "repository": { @@ -39,7 +40,8 @@ ], "dependencies": { "bowser": "^2.11.0", - "uzip": "0.20201231.0" + "uzip": "0.20201231.0", + "core-js": "^3.16.1" }, "devDependencies": { "@babel/core": "^7.2.2", @@ -48,13 +50,15 @@ "@babel/register": "^7.0.0", "@rollup/plugin-commonjs": "^17.0.0", "@rollup/plugin-node-resolve": "^11.0.1", - "babel-eslint": "^10.0.1", "babel-plugin-istanbul": "^6.0.0", - "canvas": "^2.3.1", + "canvas": "2.6.1", "chai": "^4.1.0", "chai-as-promised": "^7.1.1", "cross-env": "^7.0.2", - "eslint": "^6.8.0", + "cz-conventional-changelog": "3.3.0", + "eslint": "^7.32.0", + "eslint-config-airbnb-base": "^14.2.1", + "eslint-plugin-import": "^2.22.1", "istanbul": "^0.4.5", "jsdom": "^15.1.1", "make-coverage-badge": "^1.0.1", @@ -67,5 +71,10 @@ "rollup-plugin-nodent": "^0.2.2", "rollup-plugin-terser": "^5.0.0", "rollup-plugin-uglify": "^6.0.2" + }, + "config": { + "commitizen": { + "path": "./node_modules/cz-conventional-changelog" + } } } diff --git a/rollup.config.js b/rollup.config.js index 0119f2f..50369f1 100644 --- a/rollup.config.js +++ b/rollup.config.js @@ -1,26 +1,25 @@ -import babel from 'rollup-plugin-babel' -import { terser } from 'rollup-plugin-terser' -import nodent from 'rollup-plugin-nodent' -import license from 'rollup-plugin-license' -import copy from 'rollup-plugin-copy' -import { nodeResolve } from '@rollup/plugin-node-resolve' -import commonjs from '@rollup/plugin-commonjs' -import path from 'path' +import babel from 'rollup-plugin-babel'; +import { terser } from 'rollup-plugin-terser'; +import nodent from 'rollup-plugin-nodent'; +import license from 'rollup-plugin-license'; +import copy from 'rollup-plugin-copy'; +import { nodeResolve } from '@rollup/plugin-node-resolve'; +import commonjs from '@rollup/plugin-commonjs'; +import path from 'path'; + +const pkg = require('./package.json'); -const pkg = require('./package.json') const notExternal = [ - // 'pako', 'uzip', - 'bowser', -] -const external = Object.keys(pkg.dependencies).filter(value => !notExternal.includes(value)) +]; +const external = Object.keys(pkg.dependencies).filter((value) => !notExternal.includes(value)); -let plugins = [ +const plugins = [ nodent({ noRuntime: true, promises: true }), babel(), terser({ keep_fnames: true, - mangle: { reserved: ['CustomFile', 'CustomFileReader', 'UPNG', 'UZIP', 'bowser'] } + mangle: { reserved: ['CustomFile', 'CustomFileReader', 'UPNG', 'UZIP'] }, }), license({ sourcemap: true, @@ -28,17 +27,17 @@ let plugins = [ }), copy({ targets: [ - { src: 'lib/index.d.ts', dest: path.dirname(pkg.types) , rename: path.basename(pkg.types) } - ] + { src: 'lib/index.d.ts', dest: path.dirname(pkg.types), rename: path.basename(pkg.types) }, + ], }), nodeResolve(), - commonjs() -] + commonjs(), +]; export default { input: 'lib/index.js', - plugins: plugins, - external: external, + plugins, + external, output: [ { file: pkg.main, @@ -46,21 +45,17 @@ export default { format: 'umd', sourcemap: true, globals: { - // pako: 'pako', uzip: 'UZIP', - bowser: 'bowser' - } + }, }, { file: pkg.module, format: 'es', sourcemap: true, globals: { - // pako: 'pako', uzip: 'UZIP', - bowser: 'bowser' - } + }, }, - ] -} + ], +}; diff --git a/test/index.spec.js b/test/index.spec.js index d8ae19d..75d8c8d 100644 --- a/test/index.spec.js +++ b/test/index.spec.js @@ -1,212 +1,209 @@ -import fs from 'fs' -import path from 'path' -import chai, { expect } from 'chai' -import chaiAsPromised from 'chai-as-promised' -import imageCompression from '../lib' - -const { drawImageInCanvas, getDataUrlFromFile, getFilefromDataUrl, loadImage, getExifOrientation, drawFileInCanvas } = imageCompression - -const IMAGE_DIR = './example' -const JPG_NAME = '178440.jpg' -const JPG_PATH = path.join(IMAGE_DIR, JPG_NAME) -const JPG_FILE = fs.readFileSync(JPG_PATH) -const PNG_NAME = 'sonic.png' -const PNG_PATH = path.join(IMAGE_DIR, PNG_NAME) -const PNG_FILE = fs.readFileSync(PNG_PATH) -const base64String = 'data:image/jpeg;base64,' + Buffer.from(JPG_FILE).toString('base64') -const base64String2 = 'data:image/png;base64,' + Buffer.from(PNG_FILE).toString('base64'); - -chai.use(chaiAsPromised) +import fs from 'fs'; +import path from 'path'; +import chai, { expect } from 'chai'; +import chaiAsPromised from 'chai-as-promised'; +import imageCompression from '../lib'; + +const { + drawImageInCanvas, getDataUrlFromFile, getFilefromDataUrl, loadImage, getExifOrientation, drawFileInCanvas, +} = imageCompression; + +const IMAGE_DIR = './example'; +const JPG_NAME = '178440.jpg'; +const JPG_PATH = path.join(IMAGE_DIR, JPG_NAME); +const JPG_FILE = fs.readFileSync(JPG_PATH); +const PNG_NAME = 'sonic.png'; +const PNG_PATH = path.join(IMAGE_DIR, PNG_NAME); +const PNG_FILE = fs.readFileSync(PNG_PATH); +const base64String = `data:image/jpeg;base64,${Buffer.from(JPG_FILE).toString('base64')}`; +const base64String2 = `data:image/png;base64,${Buffer.from(PNG_FILE).toString('base64')}`; + +chai.use(chaiAsPromised); describe('Tests', function () { - this.timeout(30000) + this.timeout(30000); beforeEach(() => { - }) + }); it('get File from jpg base64', async () => { - const file = await getFilefromDataUrl(base64String, JPG_PATH) - expect(file.type).to.equal('image/jpeg') - expect(file.size).to.equal(2001612) - expect(file).to.be.an.instanceof(Blob) - }) + const file = await getFilefromDataUrl(base64String, JPG_PATH); + expect(file.type).to.equal('image/jpeg'); + expect(file.size).to.equal(2001612); + expect(file).to.be.an.instanceof(Blob); + }); it('get base64 from jpg file', async () => { - const file = new File([JPG_FILE], JPG_NAME, { type: 'image/jpeg' }) - const base64 = await getDataUrlFromFile(file) - expect(base64).to.equal(base64String) - }) + const file = new File([JPG_FILE], JPG_NAME, { type: 'image/jpeg' }); + const base64 = await getDataUrlFromFile(file); + expect(base64).to.equal(base64String); + }); it('get File from png base64', async () => { - const file = await getFilefromDataUrl(base64String2, PNG_PATH) - expect(file.type).to.equal('image/png') - expect(file.size).to.equal(2304210) - expect(file).to.be.an.instanceof(Blob) - }) + const file = await getFilefromDataUrl(base64String2, PNG_PATH); + expect(file.type).to.equal('image/png'); + expect(file.size).to.equal(2304210); + expect(file).to.be.an.instanceof(Blob); + }); it('get base64 from png file', async () => { - const file = new File([PNG_FILE], PNG_NAME, { type: 'image/png' }) - const base64 = await getDataUrlFromFile(file) - expect(base64).to.equal(base64String2) - }) + const file = new File([PNG_FILE], PNG_NAME, { type: 'image/png' }); + const base64 = await getDataUrlFromFile(file); + expect(base64).to.equal(base64String2); + }); it('load image', async () => { - const img = await loadImage(base64String) - expect(img).to.be.an.instanceof(Image) - expect(img.src).to.equal(base64String) - }) + const img = await loadImage(base64String); + expect(img).to.be.an.instanceof(Image); + expect(img.src).to.equal(base64String); + }); it('draw image in canvas', async () => { - const img = await loadImage(base64String) - const canvas = await drawImageInCanvas(img) - expect(canvas).to.be.an.instanceof(HTMLCanvasElement) - expect(canvas.width).to.be.a('number') - expect(canvas.height).to.be.a('number') - expect(canvas.getContext).to.be.a('function') - }) + const img = await loadImage(base64String); + const canvas = await drawImageInCanvas(img); + expect(canvas).to.be.an.instanceof(HTMLCanvasElement); + expect(canvas.width).to.be.a('number'); + expect(canvas.height).to.be.a('number'); + expect(canvas.getContext).to.be.a('function'); + }); it('draw file in canvas', async () => { - const file = new File([JPG_FILE], JPG_NAME, { type: 'image/jpeg' }) + const file = new File([JPG_FILE], JPG_NAME, { type: 'image/jpeg' }); - const [img, canvas] = await drawFileInCanvas(file) + const [img, canvas] = await drawFileInCanvas(file); // expect(img).to.satisfy((c) => c instanceof HTMLImageElement || c instanceof ImageBitmap) - expect(img).to.be.an.instanceof(HTMLImageElement) - expect(canvas).to.be.an.instanceof(HTMLCanvasElement) - expect(canvas.width).to.be.a('number') - expect(canvas.height).to.be.a('number') - expect(canvas.getContext).to.be.a('function') - }) + expect(img).to.be.an.instanceof(HTMLImageElement); + expect(canvas).to.be.an.instanceof(HTMLCanvasElement); + expect(canvas.width).to.be.a('number'); + expect(canvas.height).to.be.a('number'); + expect(canvas.getContext).to.be.a('function'); + }); it('compress jpg image file', async () => { - const file = new File([JPG_FILE], JPG_NAME, { type: 'image/jpeg' }) + const file = new File([JPG_FILE], JPG_NAME, { type: 'image/jpeg' }); - const maxSizeMB = 1 - const maxSizeByte = maxSizeMB * 1024 * 1024 + const maxSizeMB = 1; + const maxSizeByte = maxSizeMB * 1024 * 1024; - const compressedFile = await imageCompression(file, { maxSizeMB, useWebWorker: false, exifOrientation: -2 }) - expect(compressedFile.size).to.be.at.most(maxSizeByte) - }) + const compressedFile = await imageCompression(file, { maxSizeMB, useWebWorker: false, exifOrientation: -2 }); + expect(compressedFile.size).to.be.at.most(maxSizeByte); + }); it('resize jpg image file', async () => { - const file = new File([JPG_FILE], JPG_NAME, { type: 'image/jpeg' }) + const file = new File([JPG_FILE], JPG_NAME, { type: 'image/jpeg' }); - const maxWidthOrHeight = 720 + const maxWidthOrHeight = 720; - const compressedFile = await imageCompression(file, { maxWidthOrHeight, useWebWorker: false, exifOrientation: -2 }) + const compressedFile = await imageCompression(file, { maxWidthOrHeight, useWebWorker: false, exifOrientation: -2 }); - const temp = await drawFileInCanvas(compressedFile) - const img = temp[0] - expect(img.width).to.be.at.most(maxWidthOrHeight) - expect(img.height).to.be.at.most(maxWidthOrHeight) - - }) + const temp = await drawFileInCanvas(compressedFile); + const img = temp[0]; + expect(img.width).to.be.at.most(maxWidthOrHeight); + expect(img.height).to.be.at.most(maxWidthOrHeight); + }); it('compress and resize jpg image file', async () => { - const file = new File([JPG_FILE], JPG_NAME, { type: 'image/jpeg' }) + const file = new File([JPG_FILE], JPG_NAME, { type: 'image/jpeg' }); - const maxSizeMB = 1 - const maxSizeByte = maxSizeMB * 1024 * 1024 - const maxWidthOrHeight = 720 + const maxSizeMB = 1; + const maxSizeByte = maxSizeMB * 1024 * 1024; + const maxWidthOrHeight = 720; const compressedFile = await imageCompression(file, { maxSizeMB, maxWidthOrHeight, useWebWorker: false, - exifOrientation: -2 - }) - - expect(compressedFile.size).to.be.at.most(maxSizeByte) + exifOrientation: -2, + }); - const temp = await drawFileInCanvas(compressedFile) - const img = temp[0] - expect(img.width).to.be.at.most(maxWidthOrHeight) - expect(img.height).to.be.at.most(maxWidthOrHeight) + expect(compressedFile.size).to.be.at.most(maxSizeByte); - }) + const temp = await drawFileInCanvas(compressedFile); + const img = temp[0]; + expect(img.width).to.be.at.most(maxWidthOrHeight); + expect(img.height).to.be.at.most(maxWidthOrHeight); + }); it('compress png image file', async () => { - const file = new File([PNG_FILE], PNG_NAME, { type: 'image/png' }) + const file = new File([PNG_FILE], PNG_NAME, { type: 'image/png' }); - const maxSizeMB = 1 - const maxSizeByte = maxSizeMB * 1024 * 1024 + const maxSizeMB = 1; + const maxSizeByte = maxSizeMB * 1024 * 1024; - const compressedFile = await imageCompression(file, { maxSizeMB, useWebWorker: false, exifOrientation: -2 }) - expect(compressedFile.size).to.be.at.most(maxSizeByte) - }) + const compressedFile = await imageCompression(file, { maxSizeMB, useWebWorker: false, exifOrientation: -2 }); + expect(compressedFile.size).to.be.at.most(maxSizeByte); + }); it('resize png image file', async () => { - const file = new File([PNG_FILE], PNG_NAME, { type: 'image/png' }) + const file = new File([PNG_FILE], PNG_NAME, { type: 'image/png' }); - const maxWidthOrHeight = 720 + const maxWidthOrHeight = 720; - const compressedFile = await imageCompression(file, { maxWidthOrHeight, useWebWorker: false, exifOrientation: -2 }) + const compressedFile = await imageCompression(file, { maxWidthOrHeight, useWebWorker: false, exifOrientation: -2 }); - const temp = await drawFileInCanvas(compressedFile) + const temp = await drawFileInCanvas(compressedFile); - const img = temp[0] - expect(img.width).to.be.at.most(maxWidthOrHeight) - expect(img.height).to.be.at.most(maxWidthOrHeight) - - }) + const img = temp[0]; + expect(img.width).to.be.at.most(maxWidthOrHeight); + expect(img.height).to.be.at.most(maxWidthOrHeight); + }); it('compress and resize png image file', async () => { - const file = new File([PNG_FILE], PNG_NAME, { type: 'image/png' }) + const file = new File([PNG_FILE], PNG_NAME, { type: 'image/png' }); - const maxSizeMB = 1 - const maxSizeByte = maxSizeMB * 1024 * 1024 - const maxWidthOrHeight = 720 + const maxSizeMB = 1; + const maxSizeByte = maxSizeMB * 1024 * 1024; + const maxWidthOrHeight = 720; const compressedFile = await imageCompression(file, { maxSizeMB, maxWidthOrHeight, useWebWorker: false, - exifOrientation: -2 - }) - - expect(compressedFile.size).to.be.at.most(maxSizeByte) + exifOrientation: -2, + }); - const temp = await drawFileInCanvas(compressedFile) + expect(compressedFile.size).to.be.at.most(maxSizeByte); - const img = temp[0] - expect(img.width).to.be.at.most(maxWidthOrHeight) - expect(img.height).to.be.at.most(maxWidthOrHeight) + const temp = await drawFileInCanvas(compressedFile); - }) + const img = temp[0]; + expect(img.width).to.be.at.most(maxWidthOrHeight); + expect(img.height).to.be.at.most(maxWidthOrHeight); + }); it('fails if wrong file provided', async () => { - const file = undefined + const file = undefined; - const maxSizeMB = 1 + const maxSizeMB = 1; return expect(imageCompression(file, { maxSizeMB, - useWebWorker: false - })).to.eventually.rejectedWith(/not an instance of/) - }) + useWebWorker: false, + })).to.eventually.rejectedWith(/not an instance of/); + }); it('fails if wrong file provided 2', async () => { - const file = { type: '' } + const file = { type: '' }; - const maxSizeMB = 1 + const maxSizeMB = 1; return expect(imageCompression(file, { maxSizeMB, - useWebWorker: false - })).to.eventually.rejectedWith(/not an instance of/) - }) + useWebWorker: false, + })).to.eventually.rejectedWith(/not an instance of/); + }); it('fails if wrong file type provided', async () => { - const file = new File(['What is the meaning of life the universe and everything?'], 'text.txt', { type: 'text/plain' }) + const file = new File(['What is the meaning of life the universe and everything?'], 'text.txt', { type: 'text/plain' }); - const maxSizeMB = 1 - await expect(imageCompression(file, { maxSizeMB, useWebWorker: false })).to.eventually.rejectedWith(/not an image/) - }) + const maxSizeMB = 1; + await expect(imageCompression(file, { maxSizeMB, useWebWorker: false })).to.eventually.rejectedWith(/not an image/); + }); it('get the image orientation from Exif', async () => { - const file = new File(JPG_FILE, JPG_NAME) - const orientation = await getExifOrientation(file) - expect(orientation).to.equal(-2) - }) + const file = new File(JPG_FILE, JPG_NAME); + const orientation = await getExifOrientation(file); + expect(orientation).to.equal(-2); + }); afterEach(() => { - }) - -}) + }); +}); diff --git a/test/setup_jsdom.js b/test/setup_jsdom.js index 0c3b9b6..5ab3cce 100644 --- a/test/setup_jsdom.js +++ b/test/setup_jsdom.js @@ -1,16 +1,17 @@ -const jsdom = require('jsdom') -const { JSDOM } = jsdom +const jsdom = require('jsdom'); -const { window } = new JSDOM('', { resources: 'usable' }) +const { JSDOM } = jsdom; + +const { window } = new JSDOM('', { resources: 'usable' }); if (typeof window.Worker === 'undefined') { - window.Worker = function () {} + window.Worker = function () {}; } -global.window = window -const KEYS = ['document', 'navigator', 'Blob', 'File', 'URL', 'Worker', 'FileReader', 'atob', 'Uint8Array', 'Image', 'HTMLCanvasElement', 'HTMLImageElement'] -KEYS.forEach(key => global[key] = window[key]) +global.window = window; +const KEYS = ['document', 'navigator', 'Blob', 'File', 'URL', 'Worker', 'FileReader', 'atob', 'Uint8Array', 'Image', 'HTMLCanvasElement', 'HTMLImageElement']; +KEYS.forEach((key) => global[key] = window[key]); if (typeof window.URL.createObjectURL === 'undefined') { - Object.defineProperty(window.URL, 'createObjectURL', { value: () => {} }) + Object.defineProperty(window.URL, 'createObjectURL', { value: () => {} }); } diff --git a/yarn.lock b/yarn.lock index 9f32e37..bb6819d 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2,377 +2,426 @@ # yarn lockfile v1 -"@babel/code-frame@^7.0.0", "@babel/code-frame@^7.10.4", "@babel/code-frame@^7.12.11", "@babel/code-frame@^7.5.5": +"@babel/code-frame@7.12.11": version "7.12.11" resolved "https://registry.yarnpkg.com/@babel/code-frame/-/code-frame-7.12.11.tgz#f4ad435aa263db935b8f10f2c552d23fb716a63f" integrity sha512-Zt1yodBx1UcyiePMSkWnU4hPqhwq7hGi2nFL1LeA3EUl+q2LQx16MISgJ0+z7dnmgvP9QtIleuETGOiOH1RcIw== dependencies: "@babel/highlight" "^7.10.4" -"@babel/compat-data@^7.12.5", "@babel/compat-data@^7.12.7": - version "7.12.7" - resolved "https://registry.yarnpkg.com/@babel/compat-data/-/compat-data-7.12.7.tgz#9329b4782a7d6bbd7eef57e11addf91ee3ef1e41" - integrity sha512-YaxPMGs/XIWtYqrdEOZOCPsVWfEoriXopnsz3/i7apYPXQ3698UFhS6dVT1KN5qOsWmVgw/FOrmQgpRaZayGsw== +"@babel/code-frame@^7.0.0", "@babel/code-frame@^7.14.5", "@babel/code-frame@^7.5.5": + version "7.14.5" + resolved "https://registry.yarnpkg.com/@babel/code-frame/-/code-frame-7.14.5.tgz#23b08d740e83f49c5e59945fbf1b43e80bbf4edb" + integrity sha512-9pzDqyc6OLDaqe+zbACgFkb6fKMNG6CObKpnYXChRsvYGyEdc7CA2BaqeOM+vOtCS5ndmJicPJhKAwYRI6UfFw== + dependencies: + "@babel/highlight" "^7.14.5" + +"@babel/compat-data@^7.13.11", "@babel/compat-data@^7.14.7", "@babel/compat-data@^7.15.0": + version "7.15.0" + resolved "https://registry.yarnpkg.com/@babel/compat-data/-/compat-data-7.15.0.tgz#2dbaf8b85334796cafbb0f5793a90a2fc010b176" + integrity sha512-0NqAC1IJE0S0+lL1SWFMxMkz1pKCNCjI4tr2Zx4LJSXxCLAdr6KyArnY+sno5m3yH9g737ygOyPABDsnXkpxiA== "@babel/core@^7.2.2", "@babel/core@^7.7.5": - version "7.12.10" - resolved "https://registry.yarnpkg.com/@babel/core/-/core-7.12.10.tgz#b79a2e1b9f70ed3d84bbfb6d8c4ef825f606bccd" - integrity sha512-eTAlQKq65zHfkHZV0sIVODCPGVgoo1HdBlbSLi9CqOzuZanMv2ihzY+4paiKr1mH+XmYESMAmJ/dpZ68eN6d8w== - dependencies: - "@babel/code-frame" "^7.10.4" - "@babel/generator" "^7.12.10" - "@babel/helper-module-transforms" "^7.12.1" - "@babel/helpers" "^7.12.5" - "@babel/parser" "^7.12.10" - "@babel/template" "^7.12.7" - "@babel/traverse" "^7.12.10" - "@babel/types" "^7.12.10" + version "7.15.0" + resolved "https://registry.yarnpkg.com/@babel/core/-/core-7.15.0.tgz#749e57c68778b73ad8082775561f67f5196aafa8" + integrity sha512-tXtmTminrze5HEUPn/a0JtOzzfp0nk+UEXQ/tqIJo3WDGypl/2OFQEMll/zSFU8f/lfmfLXvTaORHF3cfXIQMw== + dependencies: + "@babel/code-frame" "^7.14.5" + "@babel/generator" "^7.15.0" + "@babel/helper-compilation-targets" "^7.15.0" + "@babel/helper-module-transforms" "^7.15.0" + "@babel/helpers" "^7.14.8" + "@babel/parser" "^7.15.0" + "@babel/template" "^7.14.5" + "@babel/traverse" "^7.15.0" + "@babel/types" "^7.15.0" convert-source-map "^1.7.0" debug "^4.1.0" - gensync "^1.0.0-beta.1" + gensync "^1.0.0-beta.2" json5 "^2.1.2" - lodash "^4.17.19" - semver "^5.4.1" + semver "^6.3.0" source-map "^0.5.0" -"@babel/generator@^7.12.10", "@babel/generator@^7.12.11": - version "7.12.11" - resolved "https://registry.yarnpkg.com/@babel/generator/-/generator-7.12.11.tgz#98a7df7b8c358c9a37ab07a24056853016aba3af" - integrity sha512-Ggg6WPOJtSi8yYQvLVjG8F/TlpWDlKx0OpS4Kt+xMQPs5OaGYWy+v1A+1TvxI6sAMGZpKWWoAQ1DaeQbImlItA== +"@babel/generator@^7.15.0": + version "7.15.0" + resolved "https://registry.yarnpkg.com/@babel/generator/-/generator-7.15.0.tgz#a7d0c172e0d814974bad5aa77ace543b97917f15" + integrity sha512-eKl4XdMrbpYvuB505KTta4AV9g+wWzmVBW69tX0H2NwKVKd2YJbKgyK6M8j/rgLbmHOYJn6rUklV677nOyJrEQ== dependencies: - "@babel/types" "^7.12.11" + "@babel/types" "^7.15.0" jsesc "^2.5.1" source-map "^0.5.0" -"@babel/helper-annotate-as-pure@^7.10.4": - version "7.12.10" - resolved "https://registry.yarnpkg.com/@babel/helper-annotate-as-pure/-/helper-annotate-as-pure-7.12.10.tgz#54ab9b000e60a93644ce17b3f37d313aaf1d115d" - integrity sha512-XplmVbC1n+KY6jL8/fgLVXXUauDIB+lD5+GsQEh6F6GBF1dq1qy4DP4yXWzDKcoqXB3X58t61e85Fitoww4JVQ== +"@babel/helper-annotate-as-pure@^7.14.5": + version "7.14.5" + resolved "https://registry.yarnpkg.com/@babel/helper-annotate-as-pure/-/helper-annotate-as-pure-7.14.5.tgz#7bf478ec3b71726d56a8ca5775b046fc29879e61" + integrity sha512-EivH9EgBIb+G8ij1B2jAwSH36WnGvkQSEC6CkX/6v6ZFlw5fVOHvsgGF4uiEHO2GzMvunZb6tDLQEQSdrdocrA== dependencies: - "@babel/types" "^7.12.10" + "@babel/types" "^7.14.5" -"@babel/helper-builder-binary-assignment-operator-visitor@^7.10.4": - version "7.10.4" - resolved "https://registry.yarnpkg.com/@babel/helper-builder-binary-assignment-operator-visitor/-/helper-builder-binary-assignment-operator-visitor-7.10.4.tgz#bb0b75f31bf98cbf9ff143c1ae578b87274ae1a3" - integrity sha512-L0zGlFrGWZK4PbT8AszSfLTM5sDU1+Az/En9VrdT8/LmEiJt4zXt+Jve9DCAnQcbqDhCI+29y/L93mrDzddCcg== +"@babel/helper-builder-binary-assignment-operator-visitor@^7.14.5": + version "7.14.5" + resolved "https://registry.yarnpkg.com/@babel/helper-builder-binary-assignment-operator-visitor/-/helper-builder-binary-assignment-operator-visitor-7.14.5.tgz#b939b43f8c37765443a19ae74ad8b15978e0a191" + integrity sha512-YTA/Twn0vBXDVGJuAX6PwW7x5zQei1luDDo2Pl6q1qZ7hVNl0RZrhHCQG/ArGpR29Vl7ETiB8eJyrvpuRp300w== dependencies: - "@babel/helper-explode-assignable-expression" "^7.10.4" - "@babel/types" "^7.10.4" + "@babel/helper-explode-assignable-expression" "^7.14.5" + "@babel/types" "^7.14.5" -"@babel/helper-compilation-targets@^7.12.5": - version "7.12.5" - resolved "https://registry.yarnpkg.com/@babel/helper-compilation-targets/-/helper-compilation-targets-7.12.5.tgz#cb470c76198db6a24e9dbc8987275631e5d29831" - integrity sha512-+qH6NrscMolUlzOYngSBMIOQpKUGPPsc61Bu5W10mg84LxZ7cmvnBHzARKbDoFxVvqqAbj6Tg6N7bSrWSPXMyw== +"@babel/helper-compilation-targets@^7.13.0", "@babel/helper-compilation-targets@^7.14.5", "@babel/helper-compilation-targets@^7.15.0": + version "7.15.0" + resolved "https://registry.yarnpkg.com/@babel/helper-compilation-targets/-/helper-compilation-targets-7.15.0.tgz#973df8cbd025515f3ff25db0c05efc704fa79818" + integrity sha512-h+/9t0ncd4jfZ8wsdAsoIxSa61qhBYlycXiHWqJaQBCXAhDCMbPRSMTGnZIkkmt1u4ag+UQmuqcILwqKzZ4N2A== dependencies: - "@babel/compat-data" "^7.12.5" - "@babel/helper-validator-option" "^7.12.1" - browserslist "^4.14.5" - semver "^5.5.0" + "@babel/compat-data" "^7.15.0" + "@babel/helper-validator-option" "^7.14.5" + browserslist "^4.16.6" + semver "^6.3.0" -"@babel/helper-create-class-features-plugin@^7.12.1": - version "7.12.1" - resolved "https://registry.yarnpkg.com/@babel/helper-create-class-features-plugin/-/helper-create-class-features-plugin-7.12.1.tgz#3c45998f431edd4a9214c5f1d3ad1448a6137f6e" - integrity sha512-hkL++rWeta/OVOBTRJc9a5Azh5mt5WgZUGAKMD8JM141YsE08K//bp1unBBieO6rUKkIPyUE0USQ30jAy3Sk1w== +"@babel/helper-create-class-features-plugin@^7.14.5": + version "7.15.0" + resolved "https://registry.yarnpkg.com/@babel/helper-create-class-features-plugin/-/helper-create-class-features-plugin-7.15.0.tgz#c9a137a4d137b2d0e2c649acf536d7ba1a76c0f7" + integrity sha512-MdmDXgvTIi4heDVX/e9EFfeGpugqm9fobBVg/iioE8kueXrOHdRDe36FAY7SnE9xXLVeYCoJR/gdrBEIHRC83Q== dependencies: - "@babel/helper-function-name" "^7.10.4" - "@babel/helper-member-expression-to-functions" "^7.12.1" - "@babel/helper-optimise-call-expression" "^7.10.4" - "@babel/helper-replace-supers" "^7.12.1" - "@babel/helper-split-export-declaration" "^7.10.4" + "@babel/helper-annotate-as-pure" "^7.14.5" + "@babel/helper-function-name" "^7.14.5" + "@babel/helper-member-expression-to-functions" "^7.15.0" + "@babel/helper-optimise-call-expression" "^7.14.5" + "@babel/helper-replace-supers" "^7.15.0" + "@babel/helper-split-export-declaration" "^7.14.5" -"@babel/helper-create-regexp-features-plugin@^7.12.1": - version "7.12.7" - resolved "https://registry.yarnpkg.com/@babel/helper-create-regexp-features-plugin/-/helper-create-regexp-features-plugin-7.12.7.tgz#2084172e95443fa0a09214ba1bb328f9aea1278f" - integrity sha512-idnutvQPdpbduutvi3JVfEgcVIHooQnhvhx0Nk9isOINOIGYkZea1Pk2JlJRiUnMefrlvr0vkByATBY/mB4vjQ== +"@babel/helper-create-regexp-features-plugin@^7.14.5": + version "7.14.5" + resolved "https://registry.yarnpkg.com/@babel/helper-create-regexp-features-plugin/-/helper-create-regexp-features-plugin-7.14.5.tgz#c7d5ac5e9cf621c26057722fb7a8a4c5889358c4" + integrity sha512-TLawwqpOErY2HhWbGJ2nZT5wSkR192QpN+nBg1THfBfftrlvOh+WbhrxXCH4q4xJ9Gl16BGPR/48JA+Ryiho/A== dependencies: - "@babel/helper-annotate-as-pure" "^7.10.4" + "@babel/helper-annotate-as-pure" "^7.14.5" regexpu-core "^4.7.1" -"@babel/helper-define-map@^7.10.4": - version "7.10.5" - resolved "https://registry.yarnpkg.com/@babel/helper-define-map/-/helper-define-map-7.10.5.tgz#b53c10db78a640800152692b13393147acb9bb30" - integrity sha512-fMw4kgFB720aQFXSVaXr79pjjcW5puTCM16+rECJ/plGS+zByelE8l9nCpV1GibxTnFVmUuYG9U8wYfQHdzOEQ== - dependencies: - "@babel/helper-function-name" "^7.10.4" - "@babel/types" "^7.10.5" - lodash "^4.17.19" - -"@babel/helper-explode-assignable-expression@^7.10.4": - version "7.12.1" - resolved "https://registry.yarnpkg.com/@babel/helper-explode-assignable-expression/-/helper-explode-assignable-expression-7.12.1.tgz#8006a466695c4ad86a2a5f2fb15b5f2c31ad5633" - integrity sha512-dmUwH8XmlrUpVqgtZ737tK88v07l840z9j3OEhCLwKTkjlvKpfqXVIZ0wpK3aeOxspwGrf/5AP5qLx4rO3w5rA== - dependencies: - "@babel/types" "^7.12.1" - -"@babel/helper-function-name@^7.10.4", "@babel/helper-function-name@^7.12.11": - version "7.12.11" - resolved "https://registry.yarnpkg.com/@babel/helper-function-name/-/helper-function-name-7.12.11.tgz#1fd7738aee5dcf53c3ecff24f1da9c511ec47b42" - integrity sha512-AtQKjtYNolKNi6nNNVLQ27CP6D9oFR6bq/HPYSizlzbp7uC1M59XJe8L+0uXjbIaZaUJF99ruHqVGiKXU/7ybA== - dependencies: - "@babel/helper-get-function-arity" "^7.12.10" - "@babel/template" "^7.12.7" - "@babel/types" "^7.12.11" - -"@babel/helper-get-function-arity@^7.12.10": - version "7.12.10" - resolved "https://registry.yarnpkg.com/@babel/helper-get-function-arity/-/helper-get-function-arity-7.12.10.tgz#b158817a3165b5faa2047825dfa61970ddcc16cf" - integrity sha512-mm0n5BPjR06wh9mPQaDdXWDoll/j5UpCAPl1x8fS71GHm7HA6Ua2V4ylG1Ju8lvcTOietbPNNPaSilKj+pj+Ag== - dependencies: - "@babel/types" "^7.12.10" - -"@babel/helper-hoist-variables@^7.10.4": - version "7.10.4" - resolved "https://registry.yarnpkg.com/@babel/helper-hoist-variables/-/helper-hoist-variables-7.10.4.tgz#d49b001d1d5a68ca5e6604dda01a6297f7c9381e" - integrity sha512-wljroF5PgCk2juF69kanHVs6vrLwIPNp6DLD+Lrl3hoQ3PpPPikaDRNFA+0t81NOoMt2DL6WW/mdU8k4k6ZzuA== - dependencies: - "@babel/types" "^7.10.4" - -"@babel/helper-member-expression-to-functions@^7.12.1", "@babel/helper-member-expression-to-functions@^7.12.7": - version "7.12.7" - resolved "https://registry.yarnpkg.com/@babel/helper-member-expression-to-functions/-/helper-member-expression-to-functions-7.12.7.tgz#aa77bd0396ec8114e5e30787efa78599d874a855" - integrity sha512-DCsuPyeWxeHgh1Dus7APn7iza42i/qXqiFPWyBDdOFtvS581JQePsc1F/nD+fHrcswhLlRc2UpYS1NwERxZhHw== - dependencies: - "@babel/types" "^7.12.7" - -"@babel/helper-module-imports@^7.0.0", "@babel/helper-module-imports@^7.12.1", "@babel/helper-module-imports@^7.12.5": - version "7.12.5" - resolved "https://registry.yarnpkg.com/@babel/helper-module-imports/-/helper-module-imports-7.12.5.tgz#1bfc0229f794988f76ed0a4d4e90860850b54dfb" - integrity sha512-SR713Ogqg6++uexFRORf/+nPXMmWIn80TALu0uaFb+iQIUoR7bOC7zBWyzBs5b3tBBJXuyD0cRu1F15GyzjOWA== - dependencies: - "@babel/types" "^7.12.5" - -"@babel/helper-module-transforms@^7.12.1": - version "7.12.1" - resolved "https://registry.yarnpkg.com/@babel/helper-module-transforms/-/helper-module-transforms-7.12.1.tgz#7954fec71f5b32c48e4b303b437c34453fd7247c" - integrity sha512-QQzehgFAZ2bbISiCpmVGfiGux8YVFXQ0abBic2Envhej22DVXV9nCFaS5hIQbkyo1AdGb+gNME2TSh3hYJVV/w== - dependencies: - "@babel/helper-module-imports" "^7.12.1" - "@babel/helper-replace-supers" "^7.12.1" - "@babel/helper-simple-access" "^7.12.1" - "@babel/helper-split-export-declaration" "^7.11.0" - "@babel/helper-validator-identifier" "^7.10.4" - "@babel/template" "^7.10.4" - "@babel/traverse" "^7.12.1" - "@babel/types" "^7.12.1" - lodash "^4.17.19" - -"@babel/helper-optimise-call-expression@^7.10.4", "@babel/helper-optimise-call-expression@^7.12.10": - version "7.12.10" - resolved "https://registry.yarnpkg.com/@babel/helper-optimise-call-expression/-/helper-optimise-call-expression-7.12.10.tgz#94ca4e306ee11a7dd6e9f42823e2ac6b49881e2d" - integrity sha512-4tpbU0SrSTjjt65UMWSrUOPZTsgvPgGG4S8QSTNHacKzpS51IVWGDj0yCwyeZND/i+LSN2g/O63jEXEWm49sYQ== - dependencies: - "@babel/types" "^7.12.10" - -"@babel/helper-plugin-utils@^7.0.0", "@babel/helper-plugin-utils@^7.10.4", "@babel/helper-plugin-utils@^7.8.0", "@babel/helper-plugin-utils@^7.8.3": - version "7.10.4" - resolved "https://registry.yarnpkg.com/@babel/helper-plugin-utils/-/helper-plugin-utils-7.10.4.tgz#2f75a831269d4f677de49986dff59927533cf375" - integrity sha512-O4KCvQA6lLiMU9l2eawBPMf1xPP8xPfB3iEQw150hOVTqj/rfXz0ThTb4HEzqQfs2Bmo5Ay8BzxfzVtBrr9dVg== - -"@babel/helper-remap-async-to-generator@^7.12.1": - version "7.12.1" - resolved "https://registry.yarnpkg.com/@babel/helper-remap-async-to-generator/-/helper-remap-async-to-generator-7.12.1.tgz#8c4dbbf916314f6047dc05e6a2217074238347fd" - integrity sha512-9d0KQCRM8clMPcDwo8SevNs+/9a8yWVVmaE80FGJcEP8N1qToREmWEGnBn8BUlJhYRFz6fqxeRL1sl5Ogsed7A== - dependencies: - "@babel/helper-annotate-as-pure" "^7.10.4" - "@babel/helper-wrap-function" "^7.10.4" - "@babel/types" "^7.12.1" - -"@babel/helper-replace-supers@^7.12.1": - version "7.12.11" - resolved "https://registry.yarnpkg.com/@babel/helper-replace-supers/-/helper-replace-supers-7.12.11.tgz#ea511658fc66c7908f923106dd88e08d1997d60d" - integrity sha512-q+w1cqmhL7R0FNzth/PLLp2N+scXEK/L2AHbXUyydxp828F4FEa5WcVoqui9vFRiHDQErj9Zof8azP32uGVTRA== +"@babel/helper-define-polyfill-provider@^0.2.2": + version "0.2.3" + resolved "https://registry.yarnpkg.com/@babel/helper-define-polyfill-provider/-/helper-define-polyfill-provider-0.2.3.tgz#0525edec5094653a282688d34d846e4c75e9c0b6" + integrity sha512-RH3QDAfRMzj7+0Nqu5oqgO5q9mFtQEVvCRsi8qCEfzLR9p2BHfn5FzhSB2oj1fF7I2+DcTORkYaQ6aTR9Cofew== dependencies: - "@babel/helper-member-expression-to-functions" "^7.12.7" - "@babel/helper-optimise-call-expression" "^7.12.10" - "@babel/traverse" "^7.12.10" - "@babel/types" "^7.12.11" + "@babel/helper-compilation-targets" "^7.13.0" + "@babel/helper-module-imports" "^7.12.13" + "@babel/helper-plugin-utils" "^7.13.0" + "@babel/traverse" "^7.13.0" + debug "^4.1.1" + lodash.debounce "^4.0.8" + resolve "^1.14.2" + semver "^6.1.2" -"@babel/helper-simple-access@^7.12.1": - version "7.12.1" - resolved "https://registry.yarnpkg.com/@babel/helper-simple-access/-/helper-simple-access-7.12.1.tgz#32427e5aa61547d38eb1e6eaf5fd1426fdad9136" - integrity sha512-OxBp7pMrjVewSSC8fXDFrHrBcJATOOFssZwv16F3/6Xtc138GHybBfPbm9kfiqQHKhYQrlamWILwlDCeyMFEaA== +"@babel/helper-explode-assignable-expression@^7.14.5": + version "7.14.5" + resolved "https://registry.yarnpkg.com/@babel/helper-explode-assignable-expression/-/helper-explode-assignable-expression-7.14.5.tgz#8aa72e708205c7bb643e45c73b4386cdf2a1f645" + integrity sha512-Htb24gnGJdIGT4vnRKMdoXiOIlqOLmdiUYpAQ0mYfgVT/GDm8GOYhgi4GL+hMKrkiPRohO4ts34ELFsGAPQLDQ== dependencies: - "@babel/types" "^7.12.1" - -"@babel/helper-skip-transparent-expression-wrappers@^7.12.1": - version "7.12.1" - resolved "https://registry.yarnpkg.com/@babel/helper-skip-transparent-expression-wrappers/-/helper-skip-transparent-expression-wrappers-7.12.1.tgz#462dc63a7e435ade8468385c63d2b84cce4b3cbf" - integrity sha512-Mf5AUuhG1/OCChOJ/HcADmvcHM42WJockombn8ATJG3OnyiSxBK/Mm5x78BQWvmtXZKHgbjdGL2kin/HOLlZGA== + "@babel/types" "^7.14.5" + +"@babel/helper-function-name@^7.14.5": + version "7.14.5" + resolved "https://registry.yarnpkg.com/@babel/helper-function-name/-/helper-function-name-7.14.5.tgz#89e2c474972f15d8e233b52ee8c480e2cfcd50c4" + integrity sha512-Gjna0AsXWfFvrAuX+VKcN/aNNWonizBj39yGwUzVDVTlMYJMK2Wp6xdpy72mfArFq5uK+NOuexfzZlzI1z9+AQ== dependencies: - "@babel/types" "^7.12.1" + "@babel/helper-get-function-arity" "^7.14.5" + "@babel/template" "^7.14.5" + "@babel/types" "^7.14.5" -"@babel/helper-split-export-declaration@^7.10.4", "@babel/helper-split-export-declaration@^7.11.0", "@babel/helper-split-export-declaration@^7.12.11": - version "7.12.11" - resolved "https://registry.yarnpkg.com/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.12.11.tgz#1b4cc424458643c47d37022223da33d76ea4603a" - integrity sha512-LsIVN8j48gHgwzfocYUSkO/hjYAOJqlpJEc7tGXcIm4cubjVUf8LGW6eWRyxEu7gA25q02p0rQUWoCI33HNS5g== +"@babel/helper-get-function-arity@^7.14.5": + version "7.14.5" + resolved "https://registry.yarnpkg.com/@babel/helper-get-function-arity/-/helper-get-function-arity-7.14.5.tgz#25fbfa579b0937eee1f3b805ece4ce398c431815" + integrity sha512-I1Db4Shst5lewOM4V+ZKJzQ0JGGaZ6VY1jYvMghRjqs6DWgxLCIyFt30GlnKkfUeFLpJt2vzbMVEXVSXlIFYUg== dependencies: - "@babel/types" "^7.12.11" - -"@babel/helper-validator-identifier@^7.10.4", "@babel/helper-validator-identifier@^7.12.11": - version "7.12.11" - resolved "https://registry.yarnpkg.com/@babel/helper-validator-identifier/-/helper-validator-identifier-7.12.11.tgz#c9a1f021917dcb5ccf0d4e453e399022981fc9ed" - integrity sha512-np/lG3uARFybkoHokJUmf1QfEvRVCPbmQeUQpKow5cQ3xWrV9i3rUHodKDJPQfTVX61qKi+UdYk8kik84n7XOw== + "@babel/types" "^7.14.5" + +"@babel/helper-hoist-variables@^7.14.5": + version "7.14.5" + resolved "https://registry.yarnpkg.com/@babel/helper-hoist-variables/-/helper-hoist-variables-7.14.5.tgz#e0dd27c33a78e577d7c8884916a3e7ef1f7c7f8d" + integrity sha512-R1PXiz31Uc0Vxy4OEOm07x0oSjKAdPPCh3tPivn/Eo8cvz6gveAeuyUUPB21Hoiif0uoPQSSdhIPS3352nvdyQ== + dependencies: + "@babel/types" "^7.14.5" -"@babel/helper-validator-option@^7.12.1", "@babel/helper-validator-option@^7.12.11": - version "7.12.11" - resolved "https://registry.yarnpkg.com/@babel/helper-validator-option/-/helper-validator-option-7.12.11.tgz#d66cb8b7a3e7fe4c6962b32020a131ecf0847f4f" - integrity sha512-TBFCyj939mFSdeX7U7DDj32WtzYY7fDcalgq8v3fBZMNOJQNn7nOYzMaUCiPxPYfCup69mtIpqlKgMZLvQ8Xhw== +"@babel/helper-member-expression-to-functions@^7.15.0": + version "7.15.0" + resolved "https://registry.yarnpkg.com/@babel/helper-member-expression-to-functions/-/helper-member-expression-to-functions-7.15.0.tgz#0ddaf5299c8179f27f37327936553e9bba60990b" + integrity sha512-Jq8H8U2kYiafuj2xMTPQwkTBnEEdGKpT35lJEQsRRjnG0LW3neucsaMWLgKcwu3OHKNeYugfw+Z20BXBSEs2Lg== + dependencies: + "@babel/types" "^7.15.0" + +"@babel/helper-module-imports@^7.0.0", "@babel/helper-module-imports@^7.12.13", "@babel/helper-module-imports@^7.14.5": + version "7.14.5" + resolved "https://registry.yarnpkg.com/@babel/helper-module-imports/-/helper-module-imports-7.14.5.tgz#6d1a44df6a38c957aa7c312da076429f11b422f3" + integrity sha512-SwrNHu5QWS84XlHwGYPDtCxcA0hrSlL2yhWYLgeOc0w7ccOl2qv4s/nARI0aYZW+bSwAL5CukeXA47B/1NKcnQ== + dependencies: + "@babel/types" "^7.14.5" + +"@babel/helper-module-transforms@^7.14.5", "@babel/helper-module-transforms@^7.15.0": + version "7.15.0" + resolved "https://registry.yarnpkg.com/@babel/helper-module-transforms/-/helper-module-transforms-7.15.0.tgz#679275581ea056373eddbe360e1419ef23783b08" + integrity sha512-RkGiW5Rer7fpXv9m1B3iHIFDZdItnO2/BLfWVW/9q7+KqQSDY5kUfQEbzdXM1MVhJGcugKV7kRrNVzNxmk7NBg== + dependencies: + "@babel/helper-module-imports" "^7.14.5" + "@babel/helper-replace-supers" "^7.15.0" + "@babel/helper-simple-access" "^7.14.8" + "@babel/helper-split-export-declaration" "^7.14.5" + "@babel/helper-validator-identifier" "^7.14.9" + "@babel/template" "^7.14.5" + "@babel/traverse" "^7.15.0" + "@babel/types" "^7.15.0" + +"@babel/helper-optimise-call-expression@^7.14.5": + version "7.14.5" + resolved "https://registry.yarnpkg.com/@babel/helper-optimise-call-expression/-/helper-optimise-call-expression-7.14.5.tgz#f27395a8619e0665b3f0364cddb41c25d71b499c" + integrity sha512-IqiLIrODUOdnPU9/F8ib1Fx2ohlgDhxnIDU7OEVi+kAbEZcyiF7BLU8W6PfvPi9LzztjS7kcbzbmL7oG8kD6VA== + dependencies: + "@babel/types" "^7.14.5" + +"@babel/helper-plugin-utils@^7.0.0", "@babel/helper-plugin-utils@^7.10.4", "@babel/helper-plugin-utils@^7.12.13", "@babel/helper-plugin-utils@^7.13.0", "@babel/helper-plugin-utils@^7.14.5", "@babel/helper-plugin-utils@^7.8.0", "@babel/helper-plugin-utils@^7.8.3": + version "7.14.5" + resolved "https://registry.yarnpkg.com/@babel/helper-plugin-utils/-/helper-plugin-utils-7.14.5.tgz#5ac822ce97eec46741ab70a517971e443a70c5a9" + integrity sha512-/37qQCE3K0vvZKwoK4XU/irIJQdIfCJuhU5eKnNxpFDsOkgFaUAwbv+RYw6eYgsC0E4hS7r5KqGULUogqui0fQ== + +"@babel/helper-remap-async-to-generator@^7.14.5": + version "7.14.5" + resolved "https://registry.yarnpkg.com/@babel/helper-remap-async-to-generator/-/helper-remap-async-to-generator-7.14.5.tgz#51439c913612958f54a987a4ffc9ee587a2045d6" + integrity sha512-rLQKdQU+HYlxBwQIj8dk4/0ENOUEhA/Z0l4hN8BexpvmSMN9oA9EagjnhnDpNsRdWCfjwa4mn/HyBXO9yhQP6A== + dependencies: + "@babel/helper-annotate-as-pure" "^7.14.5" + "@babel/helper-wrap-function" "^7.14.5" + "@babel/types" "^7.14.5" + +"@babel/helper-replace-supers@^7.14.5", "@babel/helper-replace-supers@^7.15.0": + version "7.15.0" + resolved "https://registry.yarnpkg.com/@babel/helper-replace-supers/-/helper-replace-supers-7.15.0.tgz#ace07708f5bf746bf2e6ba99572cce79b5d4e7f4" + integrity sha512-6O+eWrhx+HEra/uJnifCwhwMd6Bp5+ZfZeJwbqUTuqkhIT6YcRhiZCOOFChRypOIe0cV46kFrRBlm+t5vHCEaA== + dependencies: + "@babel/helper-member-expression-to-functions" "^7.15.0" + "@babel/helper-optimise-call-expression" "^7.14.5" + "@babel/traverse" "^7.15.0" + "@babel/types" "^7.15.0" + +"@babel/helper-simple-access@^7.14.8": + version "7.14.8" + resolved "https://registry.yarnpkg.com/@babel/helper-simple-access/-/helper-simple-access-7.14.8.tgz#82e1fec0644a7e775c74d305f212c39f8fe73924" + integrity sha512-TrFN4RHh9gnWEU+s7JloIho2T76GPwRHhdzOWLqTrMnlas8T9O7ec+oEDNsRXndOmru9ymH9DFrEOxpzPoSbdg== + dependencies: + "@babel/types" "^7.14.8" + +"@babel/helper-skip-transparent-expression-wrappers@^7.14.5": + version "7.14.5" + resolved "https://registry.yarnpkg.com/@babel/helper-skip-transparent-expression-wrappers/-/helper-skip-transparent-expression-wrappers-7.14.5.tgz#96f486ac050ca9f44b009fbe5b7d394cab3a0ee4" + integrity sha512-dmqZB7mrb94PZSAOYtr+ZN5qt5owZIAgqtoTuqiFbHFtxgEcmQlRJVI+bO++fciBunXtB6MK7HrzrfcAzIz2NQ== + dependencies: + "@babel/types" "^7.14.5" + +"@babel/helper-split-export-declaration@^7.14.5": + version "7.14.5" + resolved "https://registry.yarnpkg.com/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.14.5.tgz#22b23a54ef51c2b7605d851930c1976dd0bc693a" + integrity sha512-hprxVPu6e5Kdp2puZUmvOGjaLv9TCe58E/Fl6hRq4YiVQxIcNvuq6uTM2r1mT/oPskuS9CgR+I94sqAYv0NGKA== + dependencies: + "@babel/types" "^7.14.5" + +"@babel/helper-validator-identifier@^7.14.5", "@babel/helper-validator-identifier@^7.14.9": + version "7.14.9" + resolved "https://registry.yarnpkg.com/@babel/helper-validator-identifier/-/helper-validator-identifier-7.14.9.tgz#6654d171b2024f6d8ee151bf2509699919131d48" + integrity sha512-pQYxPY0UP6IHISRitNe8bsijHex4TWZXi2HwKVsjPiltzlhse2znVcm9Ace510VT1kxIHjGJCZZQBX2gJDbo0g== + +"@babel/helper-validator-option@^7.14.5": + version "7.14.5" + resolved "https://registry.yarnpkg.com/@babel/helper-validator-option/-/helper-validator-option-7.14.5.tgz#6e72a1fff18d5dfcb878e1e62f1a021c4b72d5a3" + integrity sha512-OX8D5eeX4XwcroVW45NMvoYaIuFI+GQpA2a8Gi+X/U/cDUIRsV37qQfF905F0htTRCREQIB4KqPeaveRJUl3Ow== + +"@babel/helper-wrap-function@^7.14.5": + version "7.14.5" + resolved "https://registry.yarnpkg.com/@babel/helper-wrap-function/-/helper-wrap-function-7.14.5.tgz#5919d115bf0fe328b8a5d63bcb610f51601f2bff" + integrity sha512-YEdjTCq+LNuNS1WfxsDCNpgXkJaIyqco6DAelTUjT4f2KIWC1nBcaCaSdHTBqQVLnTBexBcVcFhLSU1KnYuePQ== + dependencies: + "@babel/helper-function-name" "^7.14.5" + "@babel/template" "^7.14.5" + "@babel/traverse" "^7.14.5" + "@babel/types" "^7.14.5" + +"@babel/helpers@^7.14.8": + version "7.14.8" + resolved "https://registry.yarnpkg.com/@babel/helpers/-/helpers-7.14.8.tgz#839f88f463025886cff7f85a35297007e2da1b77" + integrity sha512-ZRDmI56pnV+p1dH6d+UN6GINGz7Krps3+270qqI9UJ4wxYThfAIcI5i7j5vXC4FJ3Wap+S9qcebxeYiqn87DZw== + dependencies: + "@babel/template" "^7.14.5" + "@babel/traverse" "^7.14.8" + "@babel/types" "^7.14.8" + +"@babel/highlight@^7.10.4", "@babel/highlight@^7.14.5": + version "7.14.5" + resolved "https://registry.yarnpkg.com/@babel/highlight/-/highlight-7.14.5.tgz#6861a52f03966405001f6aa534a01a24d99e8cd9" + integrity sha512-qf9u2WFWVV0MppaL877j2dBtQIDgmidgjGk5VIMw3OadXvYaXn66U1BFlH2t4+t3i+8PhedppRv+i40ABzd+gg== + dependencies: + "@babel/helper-validator-identifier" "^7.14.5" + chalk "^2.0.0" + js-tokens "^4.0.0" -"@babel/helper-wrap-function@^7.10.4": - version "7.12.3" - resolved "https://registry.yarnpkg.com/@babel/helper-wrap-function/-/helper-wrap-function-7.12.3.tgz#3332339fc4d1fbbf1c27d7958c27d34708e990d9" - integrity sha512-Cvb8IuJDln3rs6tzjW3Y8UeelAOdnpB8xtQ4sme2MSZ9wOxrbThporC0y/EtE16VAtoyEfLM404Xr1e0OOp+ow== - dependencies: - "@babel/helper-function-name" "^7.10.4" - "@babel/template" "^7.10.4" - "@babel/traverse" "^7.10.4" - "@babel/types" "^7.10.4" +"@babel/parser@^7.14.5", "@babel/parser@^7.15.0": + version "7.15.2" + resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.15.2.tgz#08d4ffcf90d211bf77e7cc7154c6f02d468d2b1d" + integrity sha512-bMJXql1Ss8lFnvr11TZDH4ArtwlAS5NG9qBmdiFW2UHHm6MVoR+GDc5XE2b9K938cyjc9O6/+vjjcffLDtfuDg== -"@babel/helpers@^7.12.5": - version "7.12.5" - resolved "https://registry.yarnpkg.com/@babel/helpers/-/helpers-7.12.5.tgz#1a1ba4a768d9b58310eda516c449913fe647116e" - integrity sha512-lgKGMQlKqA8meJqKsW6rUnc4MdUk35Ln0ATDqdM1a/UpARODdI4j5Y5lVfUScnSNkJcdCRAaWkspykNoFg9sJA== +"@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining@^7.14.5": + version "7.14.5" + resolved "https://registry.yarnpkg.com/@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining/-/plugin-bugfix-v8-spread-parameters-in-optional-chaining-7.14.5.tgz#4b467302e1548ed3b1be43beae2cc9cf45e0bb7e" + integrity sha512-ZoJS2XCKPBfTmL122iP6NM9dOg+d4lc9fFk3zxc8iDjvt8Pk4+TlsHSKhIPf6X+L5ORCdBzqMZDjL/WHj7WknQ== dependencies: - "@babel/template" "^7.10.4" - "@babel/traverse" "^7.12.5" - "@babel/types" "^7.12.5" + "@babel/helper-plugin-utils" "^7.14.5" + "@babel/helper-skip-transparent-expression-wrappers" "^7.14.5" + "@babel/plugin-proposal-optional-chaining" "^7.14.5" -"@babel/highlight@^7.10.4": - version "7.10.4" - resolved "https://registry.yarnpkg.com/@babel/highlight/-/highlight-7.10.4.tgz#7d1bdfd65753538fabe6c38596cdb76d9ac60143" - integrity sha512-i6rgnR/YgPEQzZZnbTHHuZdlE8qyoBNalD6F+q4vAFlcMEcqmkoG+mPqJYJCo63qPf74+Y1UZsl3l6f7/RIkmA== +"@babel/plugin-proposal-async-generator-functions@^7.14.9": + version "7.14.9" + resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-async-generator-functions/-/plugin-proposal-async-generator-functions-7.14.9.tgz#7028dc4fa21dc199bbacf98b39bab1267d0eaf9a" + integrity sha512-d1lnh+ZnKrFKwtTYdw320+sQWCTwgkB9fmUhNXRADA4akR6wLjaruSGnIEUjpt9HCOwTr4ynFTKu19b7rFRpmw== dependencies: - "@babel/helper-validator-identifier" "^7.10.4" - chalk "^2.0.0" - js-tokens "^4.0.0" - -"@babel/parser@^7.12.10", "@babel/parser@^7.12.11", "@babel/parser@^7.12.7", "@babel/parser@^7.7.0": - version "7.12.11" - resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.12.11.tgz#9ce3595bcd74bc5c466905e86c535b8b25011e79" - integrity sha512-N3UxG+uuF4CMYoNj8AhnbAcJF0PiuJ9KHuy1lQmkYsxTer/MAH9UBNHsBoAX/4s6NvlDD047No8mYVGGzLL4hg== + "@babel/helper-plugin-utils" "^7.14.5" + "@babel/helper-remap-async-to-generator" "^7.14.5" + "@babel/plugin-syntax-async-generators" "^7.8.4" -"@babel/plugin-proposal-async-generator-functions@^7.12.1": - version "7.12.12" - resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-async-generator-functions/-/plugin-proposal-async-generator-functions-7.12.12.tgz#04b8f24fd4532008ab4e79f788468fd5a8476566" - integrity sha512-nrz9y0a4xmUrRq51bYkWJIO5SBZyG2ys2qinHsN0zHDHVsUaModrkpyWWWXfGqYQmOL3x9sQIcTNN/pBGpo09A== +"@babel/plugin-proposal-class-properties@^7.14.5": + version "7.14.5" + resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-class-properties/-/plugin-proposal-class-properties-7.14.5.tgz#40d1ee140c5b1e31a350f4f5eed945096559b42e" + integrity sha512-q/PLpv5Ko4dVc1LYMpCY7RVAAO4uk55qPwrIuJ5QJ8c6cVuAmhu7I/49JOppXL6gXf7ZHzpRVEUZdYoPLM04Gg== dependencies: - "@babel/helper-plugin-utils" "^7.10.4" - "@babel/helper-remap-async-to-generator" "^7.12.1" - "@babel/plugin-syntax-async-generators" "^7.8.0" + "@babel/helper-create-class-features-plugin" "^7.14.5" + "@babel/helper-plugin-utils" "^7.14.5" -"@babel/plugin-proposal-class-properties@^7.12.1": - version "7.12.1" - resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-class-properties/-/plugin-proposal-class-properties-7.12.1.tgz#a082ff541f2a29a4821065b8add9346c0c16e5de" - integrity sha512-cKp3dlQsFsEs5CWKnN7BnSHOd0EOW8EKpEjkoz1pO2E5KzIDNV9Ros1b0CnmbVgAGXJubOYVBOGCT1OmJwOI7w== +"@babel/plugin-proposal-class-static-block@^7.14.5": + version "7.14.5" + resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-class-static-block/-/plugin-proposal-class-static-block-7.14.5.tgz#158e9e10d449c3849ef3ecde94a03d9f1841b681" + integrity sha512-KBAH5ksEnYHCegqseI5N9skTdxgJdmDoAOc0uXa+4QMYKeZD0w5IARh4FMlTNtaHhbB8v+KzMdTgxMMzsIy6Yg== dependencies: - "@babel/helper-create-class-features-plugin" "^7.12.1" - "@babel/helper-plugin-utils" "^7.10.4" + "@babel/helper-create-class-features-plugin" "^7.14.5" + "@babel/helper-plugin-utils" "^7.14.5" + "@babel/plugin-syntax-class-static-block" "^7.14.5" -"@babel/plugin-proposal-dynamic-import@^7.12.1": - version "7.12.1" - resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-dynamic-import/-/plugin-proposal-dynamic-import-7.12.1.tgz#43eb5c2a3487ecd98c5c8ea8b5fdb69a2749b2dc" - integrity sha512-a4rhUSZFuq5W8/OO8H7BL5zspjnc1FLd9hlOxIK/f7qG4a0qsqk8uvF/ywgBA8/OmjsapjpvaEOYItfGG1qIvQ== +"@babel/plugin-proposal-dynamic-import@^7.14.5": + version "7.14.5" + resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-dynamic-import/-/plugin-proposal-dynamic-import-7.14.5.tgz#0c6617df461c0c1f8fff3b47cd59772360101d2c" + integrity sha512-ExjiNYc3HDN5PXJx+bwC50GIx/KKanX2HiggnIUAYedbARdImiCU4RhhHfdf0Kd7JNXGpsBBBCOm+bBVy3Gb0g== dependencies: - "@babel/helper-plugin-utils" "^7.10.4" - "@babel/plugin-syntax-dynamic-import" "^7.8.0" + "@babel/helper-plugin-utils" "^7.14.5" + "@babel/plugin-syntax-dynamic-import" "^7.8.3" -"@babel/plugin-proposal-export-namespace-from@^7.12.1": - version "7.12.1" - resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-export-namespace-from/-/plugin-proposal-export-namespace-from-7.12.1.tgz#8b9b8f376b2d88f5dd774e4d24a5cc2e3679b6d4" - integrity sha512-6CThGf0irEkzujYS5LQcjBx8j/4aQGiVv7J9+2f7pGfxqyKh3WnmVJYW3hdrQjyksErMGBPQrCnHfOtna+WLbw== +"@babel/plugin-proposal-export-namespace-from@^7.14.5": + version "7.14.5" + resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-export-namespace-from/-/plugin-proposal-export-namespace-from-7.14.5.tgz#dbad244310ce6ccd083072167d8cea83a52faf76" + integrity sha512-g5POA32bXPMmSBu5Dx/iZGLGnKmKPc5AiY7qfZgurzrCYgIztDlHFbznSNCoQuv57YQLnQfaDi7dxCtLDIdXdA== dependencies: - "@babel/helper-plugin-utils" "^7.10.4" + "@babel/helper-plugin-utils" "^7.14.5" "@babel/plugin-syntax-export-namespace-from" "^7.8.3" -"@babel/plugin-proposal-json-strings@^7.12.1": - version "7.12.1" - resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-json-strings/-/plugin-proposal-json-strings-7.12.1.tgz#d45423b517714eedd5621a9dfdc03fa9f4eb241c" - integrity sha512-GoLDUi6U9ZLzlSda2Df++VSqDJg3CG+dR0+iWsv6XRw1rEq+zwt4DirM9yrxW6XWaTpmai1cWJLMfM8qQJf+yw== +"@babel/plugin-proposal-json-strings@^7.14.5": + version "7.14.5" + resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-json-strings/-/plugin-proposal-json-strings-7.14.5.tgz#38de60db362e83a3d8c944ac858ddf9f0c2239eb" + integrity sha512-NSq2fczJYKVRIsUJyNxrVUMhB27zb7N7pOFGQOhBKJrChbGcgEAqyZrmZswkPk18VMurEeJAaICbfm57vUeTbQ== dependencies: - "@babel/helper-plugin-utils" "^7.10.4" - "@babel/plugin-syntax-json-strings" "^7.8.0" + "@babel/helper-plugin-utils" "^7.14.5" + "@babel/plugin-syntax-json-strings" "^7.8.3" -"@babel/plugin-proposal-logical-assignment-operators@^7.12.1": - version "7.12.1" - resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-logical-assignment-operators/-/plugin-proposal-logical-assignment-operators-7.12.1.tgz#f2c490d36e1b3c9659241034a5d2cd50263a2751" - integrity sha512-k8ZmVv0JU+4gcUGeCDZOGd0lCIamU/sMtIiX3UWnUc5yzgq6YUGyEolNYD+MLYKfSzgECPcqetVcJP9Afe/aCA== +"@babel/plugin-proposal-logical-assignment-operators@^7.14.5": + version "7.14.5" + resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-logical-assignment-operators/-/plugin-proposal-logical-assignment-operators-7.14.5.tgz#6e6229c2a99b02ab2915f82571e0cc646a40c738" + integrity sha512-YGn2AvZAo9TwyhlLvCCWxD90Xq8xJ4aSgaX3G5D/8DW94L8aaT+dS5cSP+Z06+rCJERGSr9GxMBZ601xoc2taw== dependencies: - "@babel/helper-plugin-utils" "^7.10.4" + "@babel/helper-plugin-utils" "^7.14.5" "@babel/plugin-syntax-logical-assignment-operators" "^7.10.4" -"@babel/plugin-proposal-nullish-coalescing-operator@^7.12.1": - version "7.12.1" - resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-nullish-coalescing-operator/-/plugin-proposal-nullish-coalescing-operator-7.12.1.tgz#3ed4fff31c015e7f3f1467f190dbe545cd7b046c" - integrity sha512-nZY0ESiaQDI1y96+jk6VxMOaL4LPo/QDHBqL+SF3/vl6dHkTwHlOI8L4ZwuRBHgakRBw5zsVylel7QPbbGuYgg== +"@babel/plugin-proposal-nullish-coalescing-operator@^7.14.5": + version "7.14.5" + resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-nullish-coalescing-operator/-/plugin-proposal-nullish-coalescing-operator-7.14.5.tgz#ee38589ce00e2cc59b299ec3ea406fcd3a0fdaf6" + integrity sha512-gun/SOnMqjSb98Nkaq2rTKMwervfdAoz6NphdY0vTfuzMfryj+tDGb2n6UkDKwez+Y8PZDhE3D143v6Gepp4Hg== dependencies: - "@babel/helper-plugin-utils" "^7.10.4" - "@babel/plugin-syntax-nullish-coalescing-operator" "^7.8.0" + "@babel/helper-plugin-utils" "^7.14.5" + "@babel/plugin-syntax-nullish-coalescing-operator" "^7.8.3" -"@babel/plugin-proposal-numeric-separator@^7.12.7": - version "7.12.7" - resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-numeric-separator/-/plugin-proposal-numeric-separator-7.12.7.tgz#8bf253de8139099fea193b297d23a9d406ef056b" - integrity sha512-8c+uy0qmnRTeukiGsjLGy6uVs/TFjJchGXUeBqlG4VWYOdJWkhhVPdQ3uHwbmalfJwv2JsV0qffXP4asRfL2SQ== +"@babel/plugin-proposal-numeric-separator@^7.14.5": + version "7.14.5" + resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-numeric-separator/-/plugin-proposal-numeric-separator-7.14.5.tgz#83631bf33d9a51df184c2102a069ac0c58c05f18" + integrity sha512-yiclALKe0vyZRZE0pS6RXgjUOt87GWv6FYa5zqj15PvhOGFO69R5DusPlgK/1K5dVnCtegTiWu9UaBSrLLJJBg== dependencies: - "@babel/helper-plugin-utils" "^7.10.4" + "@babel/helper-plugin-utils" "^7.14.5" "@babel/plugin-syntax-numeric-separator" "^7.10.4" -"@babel/plugin-proposal-object-rest-spread@^7.12.1": - version "7.12.1" - resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-object-rest-spread/-/plugin-proposal-object-rest-spread-7.12.1.tgz#def9bd03cea0f9b72283dac0ec22d289c7691069" - integrity sha512-s6SowJIjzlhx8o7lsFx5zmY4At6CTtDvgNQDdPzkBQucle58A6b/TTeEBYtyDgmcXjUTM+vE8YOGHZzzbc/ioA== - dependencies: - "@babel/helper-plugin-utils" "^7.10.4" - "@babel/plugin-syntax-object-rest-spread" "^7.8.0" - "@babel/plugin-transform-parameters" "^7.12.1" - -"@babel/plugin-proposal-optional-catch-binding@^7.12.1": - version "7.12.1" - resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-optional-catch-binding/-/plugin-proposal-optional-catch-binding-7.12.1.tgz#ccc2421af64d3aae50b558a71cede929a5ab2942" - integrity sha512-hFvIjgprh9mMw5v42sJWLI1lzU5L2sznP805zeT6rySVRA0Y18StRhDqhSxlap0oVgItRsB6WSROp4YnJTJz0g== - dependencies: - "@babel/helper-plugin-utils" "^7.10.4" - "@babel/plugin-syntax-optional-catch-binding" "^7.8.0" - -"@babel/plugin-proposal-optional-chaining@^7.12.7": - version "7.12.7" - resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-optional-chaining/-/plugin-proposal-optional-chaining-7.12.7.tgz#e02f0ea1b5dc59d401ec16fb824679f683d3303c" - integrity sha512-4ovylXZ0PWmwoOvhU2vhnzVNnm88/Sm9nx7V8BPgMvAzn5zDou3/Awy0EjglyubVHasJj+XCEkr/r1X3P5elCA== - dependencies: - "@babel/helper-plugin-utils" "^7.10.4" - "@babel/helper-skip-transparent-expression-wrappers" "^7.12.1" - "@babel/plugin-syntax-optional-chaining" "^7.8.0" - -"@babel/plugin-proposal-private-methods@^7.12.1": - version "7.12.1" - resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-private-methods/-/plugin-proposal-private-methods-7.12.1.tgz#86814f6e7a21374c980c10d38b4493e703f4a389" - integrity sha512-mwZ1phvH7/NHK6Kf8LP7MYDogGV+DKB1mryFOEwx5EBNQrosvIczzZFTUmWaeujd5xT6G1ELYWUz3CutMhjE1w== - dependencies: - "@babel/helper-create-class-features-plugin" "^7.12.1" - "@babel/helper-plugin-utils" "^7.10.4" - -"@babel/plugin-proposal-unicode-property-regex@^7.12.1", "@babel/plugin-proposal-unicode-property-regex@^7.4.4": - version "7.12.1" - resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-unicode-property-regex/-/plugin-proposal-unicode-property-regex-7.12.1.tgz#2a183958d417765b9eae334f47758e5d6a82e072" - integrity sha512-MYq+l+PvHuw/rKUz1at/vb6nCnQ2gmJBNaM62z0OgH7B2W1D9pvkpYtlti9bGtizNIU1K3zm4bZF9F91efVY0w== - dependencies: - "@babel/helper-create-regexp-features-plugin" "^7.12.1" - "@babel/helper-plugin-utils" "^7.10.4" - -"@babel/plugin-syntax-async-generators@^7.8.0": +"@babel/plugin-proposal-object-rest-spread@^7.14.7": + version "7.14.7" + resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-object-rest-spread/-/plugin-proposal-object-rest-spread-7.14.7.tgz#5920a2b3df7f7901df0205974c0641b13fd9d363" + integrity sha512-082hsZz+sVabfmDWo1Oct1u1AgbKbUAyVgmX4otIc7bdsRgHBXwTwb3DpDmD4Eyyx6DNiuz5UAATT655k+kL5g== + dependencies: + "@babel/compat-data" "^7.14.7" + "@babel/helper-compilation-targets" "^7.14.5" + "@babel/helper-plugin-utils" "^7.14.5" + "@babel/plugin-syntax-object-rest-spread" "^7.8.3" + "@babel/plugin-transform-parameters" "^7.14.5" + +"@babel/plugin-proposal-optional-catch-binding@^7.14.5": + version "7.14.5" + resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-optional-catch-binding/-/plugin-proposal-optional-catch-binding-7.14.5.tgz#939dd6eddeff3a67fdf7b3f044b5347262598c3c" + integrity sha512-3Oyiixm0ur7bzO5ybNcZFlmVsygSIQgdOa7cTfOYCMY+wEPAYhZAJxi3mixKFCTCKUhQXuCTtQ1MzrpL3WT8ZQ== + dependencies: + "@babel/helper-plugin-utils" "^7.14.5" + "@babel/plugin-syntax-optional-catch-binding" "^7.8.3" + +"@babel/plugin-proposal-optional-chaining@^7.14.5": + version "7.14.5" + resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-optional-chaining/-/plugin-proposal-optional-chaining-7.14.5.tgz#fa83651e60a360e3f13797eef00b8d519695b603" + integrity sha512-ycz+VOzo2UbWNI1rQXxIuMOzrDdHGrI23fRiz/Si2R4kv2XZQ1BK8ccdHwehMKBlcH/joGW/tzrUmo67gbJHlQ== + dependencies: + "@babel/helper-plugin-utils" "^7.14.5" + "@babel/helper-skip-transparent-expression-wrappers" "^7.14.5" + "@babel/plugin-syntax-optional-chaining" "^7.8.3" + +"@babel/plugin-proposal-private-methods@^7.14.5": + version "7.14.5" + resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-private-methods/-/plugin-proposal-private-methods-7.14.5.tgz#37446495996b2945f30f5be5b60d5e2aa4f5792d" + integrity sha512-838DkdUA1u+QTCplatfq4B7+1lnDa/+QMI89x5WZHBcnNv+47N8QEj2k9I2MUU9xIv8XJ4XvPCviM/Dj7Uwt9g== + dependencies: + "@babel/helper-create-class-features-plugin" "^7.14.5" + "@babel/helper-plugin-utils" "^7.14.5" + +"@babel/plugin-proposal-private-property-in-object@^7.14.5": + version "7.14.5" + resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-private-property-in-object/-/plugin-proposal-private-property-in-object-7.14.5.tgz#9f65a4d0493a940b4c01f8aa9d3f1894a587f636" + integrity sha512-62EyfyA3WA0mZiF2e2IV9mc9Ghwxcg8YTu8BS4Wss4Y3PY725OmS9M0qLORbJwLqFtGh+jiE4wAmocK2CTUK2Q== + dependencies: + "@babel/helper-annotate-as-pure" "^7.14.5" + "@babel/helper-create-class-features-plugin" "^7.14.5" + "@babel/helper-plugin-utils" "^7.14.5" + "@babel/plugin-syntax-private-property-in-object" "^7.14.5" + +"@babel/plugin-proposal-unicode-property-regex@^7.14.5", "@babel/plugin-proposal-unicode-property-regex@^7.4.4": + version "7.14.5" + resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-unicode-property-regex/-/plugin-proposal-unicode-property-regex-7.14.5.tgz#0f95ee0e757a5d647f378daa0eca7e93faa8bbe8" + integrity sha512-6axIeOU5LnY471KenAB9vI8I5j7NQ2d652hIYwVyRfgaZT5UpiqFKCuVXCDMSrU+3VFafnu2c5m3lrWIlr6A5Q== + dependencies: + "@babel/helper-create-regexp-features-plugin" "^7.14.5" + "@babel/helper-plugin-utils" "^7.14.5" + +"@babel/plugin-syntax-async-generators@^7.8.4": version "7.8.4" resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-async-generators/-/plugin-syntax-async-generators-7.8.4.tgz#a983fb1aeb2ec3f6ed042a210f640e90e786fe0d" integrity sha512-tycmZxkGfZaxhMRbXlPXuVFpdWlXpir2W4AMhSJgRKzk/eDlIXOhb2LHWoLpDF7TEHylV5zNhykX6KAgHJmTNw== dependencies: "@babel/helper-plugin-utils" "^7.8.0" -"@babel/plugin-syntax-class-properties@^7.12.1": - version "7.12.1" - resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-class-properties/-/plugin-syntax-class-properties-7.12.1.tgz#bcb297c5366e79bebadef509549cd93b04f19978" - integrity sha512-U40A76x5gTwmESz+qiqssqmeEsKvcSyvtgktrm0uzcARAmM9I1jR221f6Oq+GmHrcD+LvZDag1UTOTe2fL3TeA== +"@babel/plugin-syntax-class-properties@^7.12.13": + version "7.12.13" + resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-class-properties/-/plugin-syntax-class-properties-7.12.13.tgz#b5c987274c4a3a82b89714796931a6b53544ae10" + integrity sha512-fm4idjKla0YahUNgFNLCB0qySdsoPiZP3iQE3rky0mBUtMZ23yDJ9SJdg6dXTSDnulOVqiF3Hgr9nbXvXTQZYA== dependencies: - "@babel/helper-plugin-utils" "^7.10.4" + "@babel/helper-plugin-utils" "^7.12.13" + +"@babel/plugin-syntax-class-static-block@^7.14.5": + version "7.14.5" + resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-class-static-block/-/plugin-syntax-class-static-block-7.14.5.tgz#195df89b146b4b78b3bf897fd7a257c84659d406" + integrity sha512-b+YyPmr6ldyNnM6sqYeMWE+bgJcJpO6yS4QD7ymxgH34GBPNDM/THBh8iunyvKIZztiwLH4CJZ0RxTk9emgpjw== + dependencies: + "@babel/helper-plugin-utils" "^7.14.5" -"@babel/plugin-syntax-dynamic-import@^7.8.0": +"@babel/plugin-syntax-dynamic-import@^7.8.3": version "7.8.3" resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-dynamic-import/-/plugin-syntax-dynamic-import-7.8.3.tgz#62bf98b2da3cd21d626154fc96ee5b3cb68eacb3" integrity sha512-5gdGbFon+PszYzqs83S3E5mpi7/y/8M9eC90MRTZfduQOYW76ig6SOSPNe41IG5LoP3FGBn2N0RjVDSQiS94kQ== @@ -386,7 +435,7 @@ dependencies: "@babel/helper-plugin-utils" "^7.8.3" -"@babel/plugin-syntax-json-strings@^7.8.0": +"@babel/plugin-syntax-json-strings@^7.8.3": version "7.8.3" resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-json-strings/-/plugin-syntax-json-strings-7.8.3.tgz#01ca21b668cd8218c9e640cb6dd88c5412b2c96a" integrity sha512-lY6kdGpWHvjoe2vk4WrAapEuBR69EMxZl+RoGRhrFGNYVK8mOPAW8VfbT/ZgrFbXlDNiiaxQnAtgVCZ6jv30EA== @@ -400,7 +449,7 @@ dependencies: "@babel/helper-plugin-utils" "^7.10.4" -"@babel/plugin-syntax-nullish-coalescing-operator@^7.8.0": +"@babel/plugin-syntax-nullish-coalescing-operator@^7.8.3": version "7.8.3" resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-nullish-coalescing-operator/-/plugin-syntax-nullish-coalescing-operator-7.8.3.tgz#167ed70368886081f74b5c36c65a88c03b66d1a9" integrity sha512-aSff4zPII1u2QD7y+F8oDsz19ew4IGEJg9SVW+bqwpwtfFleiQDMdzA/R+UlWDzfnHFCxxleFT0PMIrR36XLNQ== @@ -414,282 +463,288 @@ dependencies: "@babel/helper-plugin-utils" "^7.10.4" -"@babel/plugin-syntax-object-rest-spread@^7.8.0": +"@babel/plugin-syntax-object-rest-spread@^7.8.3": version "7.8.3" resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-object-rest-spread/-/plugin-syntax-object-rest-spread-7.8.3.tgz#60e225edcbd98a640332a2e72dd3e66f1af55871" integrity sha512-XoqMijGZb9y3y2XskN+P1wUGiVwWZ5JmoDRwx5+3GmEplNyVM2s2Dg8ILFQm8rWM48orGy5YpI5Bl8U1y7ydlA== dependencies: "@babel/helper-plugin-utils" "^7.8.0" -"@babel/plugin-syntax-optional-catch-binding@^7.8.0": +"@babel/plugin-syntax-optional-catch-binding@^7.8.3": version "7.8.3" resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-optional-catch-binding/-/plugin-syntax-optional-catch-binding-7.8.3.tgz#6111a265bcfb020eb9efd0fdfd7d26402b9ed6c1" integrity sha512-6VPD0Pc1lpTqw0aKoeRTMiB+kWhAoT24PA+ksWSBrFtl5SIRVpZlwN3NNPQjehA2E/91FV3RjLWoVTglWcSV3Q== dependencies: "@babel/helper-plugin-utils" "^7.8.0" -"@babel/plugin-syntax-optional-chaining@^7.8.0": +"@babel/plugin-syntax-optional-chaining@^7.8.3": version "7.8.3" resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-optional-chaining/-/plugin-syntax-optional-chaining-7.8.3.tgz#4f69c2ab95167e0180cd5336613f8c5788f7d48a" integrity sha512-KoK9ErH1MBlCPxV0VANkXW2/dw4vlbGDrFgz8bmUsBGYkFRcbRwMh6cIJubdPrkxRwuGdtCk0v/wPTKbQgBjkg== dependencies: "@babel/helper-plugin-utils" "^7.8.0" -"@babel/plugin-syntax-top-level-await@^7.12.1": - version "7.12.1" - resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-top-level-await/-/plugin-syntax-top-level-await-7.12.1.tgz#dd6c0b357ac1bb142d98537450a319625d13d2a0" - integrity sha512-i7ooMZFS+a/Om0crxZodrTzNEPJHZrlMVGMTEpFAj6rYY/bKCddB0Dk/YxfPuYXOopuhKk/e1jV6h+WUU9XN3A== +"@babel/plugin-syntax-private-property-in-object@^7.14.5": + version "7.14.5" + resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-private-property-in-object/-/plugin-syntax-private-property-in-object-7.14.5.tgz#0dc6671ec0ea22b6e94a1114f857970cd39de1ad" + integrity sha512-0wVnp9dxJ72ZUJDV27ZfbSj6iHLoytYZmh3rFcxNnvsJF3ktkzLDZPy/mA17HGsaQT3/DQsWYX1f1QGWkCoVUg== dependencies: - "@babel/helper-plugin-utils" "^7.10.4" + "@babel/helper-plugin-utils" "^7.14.5" -"@babel/plugin-transform-arrow-functions@^7.12.1": - version "7.12.1" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-arrow-functions/-/plugin-transform-arrow-functions-7.12.1.tgz#8083ffc86ac8e777fbe24b5967c4b2521f3cb2b3" - integrity sha512-5QB50qyN44fzzz4/qxDPQMBCTHgxg3n0xRBLJUmBlLoU/sFvxVWGZF/ZUfMVDQuJUKXaBhbupxIzIfZ6Fwk/0A== +"@babel/plugin-syntax-top-level-await@^7.14.5": + version "7.14.5" + resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-top-level-await/-/plugin-syntax-top-level-await-7.14.5.tgz#c1cfdadc35a646240001f06138247b741c34d94c" + integrity sha512-hx++upLv5U1rgYfwe1xBQUhRmU41NEvpUvrp8jkrSCdvGSnM5/qdRMtylJ6PG5OFkBaHkbTAKTnd3/YyESRHFw== dependencies: - "@babel/helper-plugin-utils" "^7.10.4" + "@babel/helper-plugin-utils" "^7.14.5" -"@babel/plugin-transform-async-to-generator@^7.12.1": - version "7.12.1" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-async-to-generator/-/plugin-transform-async-to-generator-7.12.1.tgz#3849a49cc2a22e9743cbd6b52926d30337229af1" - integrity sha512-SDtqoEcarK1DFlRJ1hHRY5HvJUj5kX4qmtpMAm2QnhOlyuMC4TMdCRgW6WXpv93rZeYNeLP22y8Aq2dbcDRM1A== +"@babel/plugin-transform-arrow-functions@^7.14.5": + version "7.14.5" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-arrow-functions/-/plugin-transform-arrow-functions-7.14.5.tgz#f7187d9588a768dd080bf4c9ffe117ea62f7862a" + integrity sha512-KOnO0l4+tD5IfOdi4x8C1XmEIRWUjNRV8wc6K2vz/3e8yAOoZZvsRXRRIF/yo/MAOFb4QjtAw9xSxMXbSMRy8A== dependencies: - "@babel/helper-module-imports" "^7.12.1" - "@babel/helper-plugin-utils" "^7.10.4" - "@babel/helper-remap-async-to-generator" "^7.12.1" + "@babel/helper-plugin-utils" "^7.14.5" -"@babel/plugin-transform-block-scoped-functions@^7.12.1": - version "7.12.1" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-block-scoped-functions/-/plugin-transform-block-scoped-functions-7.12.1.tgz#f2a1a365bde2b7112e0a6ded9067fdd7c07905d9" - integrity sha512-5OpxfuYnSgPalRpo8EWGPzIYf0lHBWORCkj5M0oLBwHdlux9Ri36QqGW3/LR13RSVOAoUUMzoPI/jpE4ABcHoA== +"@babel/plugin-transform-async-to-generator@^7.14.5": + version "7.14.5" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-async-to-generator/-/plugin-transform-async-to-generator-7.14.5.tgz#72c789084d8f2094acb945633943ef8443d39e67" + integrity sha512-szkbzQ0mNk0rpu76fzDdqSyPu0MuvpXgC+6rz5rpMb5OIRxdmHfQxrktL8CYolL2d8luMCZTR0DpIMIdL27IjA== dependencies: - "@babel/helper-plugin-utils" "^7.10.4" + "@babel/helper-module-imports" "^7.14.5" + "@babel/helper-plugin-utils" "^7.14.5" + "@babel/helper-remap-async-to-generator" "^7.14.5" -"@babel/plugin-transform-block-scoping@^7.12.11": - version "7.12.12" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-block-scoping/-/plugin-transform-block-scoping-7.12.12.tgz#d93a567a152c22aea3b1929bb118d1d0a175cdca" - integrity sha512-VOEPQ/ExOVqbukuP7BYJtI5ZxxsmegTwzZ04j1aF0dkSypGo9XpDHuOrABsJu+ie+penpSJheDJ11x1BEZNiyQ== +"@babel/plugin-transform-block-scoped-functions@^7.14.5": + version "7.14.5" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-block-scoped-functions/-/plugin-transform-block-scoped-functions-7.14.5.tgz#e48641d999d4bc157a67ef336aeb54bc44fd3ad4" + integrity sha512-dtqWqdWZ5NqBX3KzsVCWfQI3A53Ft5pWFCT2eCVUftWZgjc5DpDponbIF1+c+7cSGk2wN0YK7HGL/ezfRbpKBQ== dependencies: - "@babel/helper-plugin-utils" "^7.10.4" + "@babel/helper-plugin-utils" "^7.14.5" -"@babel/plugin-transform-classes@^7.12.1": - version "7.12.1" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-classes/-/plugin-transform-classes-7.12.1.tgz#65e650fcaddd3d88ddce67c0f834a3d436a32db6" - integrity sha512-/74xkA7bVdzQTBeSUhLLJgYIcxw/dpEpCdRDiHgPJ3Mv6uC11UhjpOhl72CgqbBCmt1qtssCyB2xnJm1+PFjog== +"@babel/plugin-transform-block-scoping@^7.14.5": + version "7.14.5" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-block-scoping/-/plugin-transform-block-scoping-7.14.5.tgz#8cc63e61e50f42e078e6f09be775a75f23ef9939" + integrity sha512-LBYm4ZocNgoCqyxMLoOnwpsmQ18HWTQvql64t3GvMUzLQrNoV1BDG0lNftC8QKYERkZgCCT/7J5xWGObGAyHDw== dependencies: - "@babel/helper-annotate-as-pure" "^7.10.4" - "@babel/helper-define-map" "^7.10.4" - "@babel/helper-function-name" "^7.10.4" - "@babel/helper-optimise-call-expression" "^7.10.4" - "@babel/helper-plugin-utils" "^7.10.4" - "@babel/helper-replace-supers" "^7.12.1" - "@babel/helper-split-export-declaration" "^7.10.4" + "@babel/helper-plugin-utils" "^7.14.5" + +"@babel/plugin-transform-classes@^7.14.9": + version "7.14.9" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-classes/-/plugin-transform-classes-7.14.9.tgz#2a391ffb1e5292710b00f2e2c210e1435e7d449f" + integrity sha512-NfZpTcxU3foGWbl4wxmZ35mTsYJy8oQocbeIMoDAGGFarAmSQlL+LWMkDx/tj6pNotpbX3rltIA4dprgAPOq5A== + dependencies: + "@babel/helper-annotate-as-pure" "^7.14.5" + "@babel/helper-function-name" "^7.14.5" + "@babel/helper-optimise-call-expression" "^7.14.5" + "@babel/helper-plugin-utils" "^7.14.5" + "@babel/helper-replace-supers" "^7.14.5" + "@babel/helper-split-export-declaration" "^7.14.5" globals "^11.1.0" -"@babel/plugin-transform-computed-properties@^7.12.1": - version "7.12.1" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-computed-properties/-/plugin-transform-computed-properties-7.12.1.tgz#d68cf6c9b7f838a8a4144badbe97541ea0904852" - integrity sha512-vVUOYpPWB7BkgUWPo4C44mUQHpTZXakEqFjbv8rQMg7TC6S6ZhGZ3otQcRH6u7+adSlE5i0sp63eMC/XGffrzg== +"@babel/plugin-transform-computed-properties@^7.14.5": + version "7.14.5" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-computed-properties/-/plugin-transform-computed-properties-7.14.5.tgz#1b9d78987420d11223d41195461cc43b974b204f" + integrity sha512-pWM+E4283UxaVzLb8UBXv4EIxMovU4zxT1OPnpHJcmnvyY9QbPPTKZfEj31EUvG3/EQRbYAGaYEUZ4yWOBC2xg== dependencies: - "@babel/helper-plugin-utils" "^7.10.4" + "@babel/helper-plugin-utils" "^7.14.5" -"@babel/plugin-transform-destructuring@^7.12.1": - version "7.12.1" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-destructuring/-/plugin-transform-destructuring-7.12.1.tgz#b9a570fe0d0a8d460116413cb4f97e8e08b2f847" - integrity sha512-fRMYFKuzi/rSiYb2uRLiUENJOKq4Gnl+6qOv5f8z0TZXg3llUwUhsNNwrwaT/6dUhJTzNpBr+CUvEWBtfNY1cw== +"@babel/plugin-transform-destructuring@^7.14.7": + version "7.14.7" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-destructuring/-/plugin-transform-destructuring-7.14.7.tgz#0ad58ed37e23e22084d109f185260835e5557576" + integrity sha512-0mDE99nK+kVh3xlc5vKwB6wnP9ecuSj+zQCa/n0voENtP/zymdT4HH6QEb65wjjcbqr1Jb/7z9Qp7TF5FtwYGw== dependencies: - "@babel/helper-plugin-utils" "^7.10.4" + "@babel/helper-plugin-utils" "^7.14.5" -"@babel/plugin-transform-dotall-regex@^7.12.1", "@babel/plugin-transform-dotall-regex@^7.4.4": - version "7.12.1" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-dotall-regex/-/plugin-transform-dotall-regex-7.12.1.tgz#a1d16c14862817b6409c0a678d6f9373ca9cd975" - integrity sha512-B2pXeRKoLszfEW7J4Hg9LoFaWEbr/kzo3teWHmtFCszjRNa/b40f9mfeqZsIDLLt/FjwQ6pz/Gdlwy85xNckBA== +"@babel/plugin-transform-dotall-regex@^7.14.5", "@babel/plugin-transform-dotall-regex@^7.4.4": + version "7.14.5" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-dotall-regex/-/plugin-transform-dotall-regex-7.14.5.tgz#2f6bf76e46bdf8043b4e7e16cf24532629ba0c7a" + integrity sha512-loGlnBdj02MDsFaHhAIJzh7euK89lBrGIdM9EAtHFo6xKygCUGuuWe07o1oZVk287amtW1n0808sQM99aZt3gw== dependencies: - "@babel/helper-create-regexp-features-plugin" "^7.12.1" - "@babel/helper-plugin-utils" "^7.10.4" + "@babel/helper-create-regexp-features-plugin" "^7.14.5" + "@babel/helper-plugin-utils" "^7.14.5" -"@babel/plugin-transform-duplicate-keys@^7.12.1": - version "7.12.1" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-duplicate-keys/-/plugin-transform-duplicate-keys-7.12.1.tgz#745661baba295ac06e686822797a69fbaa2ca228" - integrity sha512-iRght0T0HztAb/CazveUpUQrZY+aGKKaWXMJ4uf9YJtqxSUe09j3wteztCUDRHs+SRAL7yMuFqUsLoAKKzgXjw== +"@babel/plugin-transform-duplicate-keys@^7.14.5": + version "7.14.5" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-duplicate-keys/-/plugin-transform-duplicate-keys-7.14.5.tgz#365a4844881bdf1501e3a9f0270e7f0f91177954" + integrity sha512-iJjbI53huKbPDAsJ8EmVmvCKeeq21bAze4fu9GBQtSLqfvzj2oRuHVx4ZkDwEhg1htQ+5OBZh/Ab0XDf5iBZ7A== dependencies: - "@babel/helper-plugin-utils" "^7.10.4" + "@babel/helper-plugin-utils" "^7.14.5" -"@babel/plugin-transform-exponentiation-operator@^7.12.1": - version "7.12.1" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-exponentiation-operator/-/plugin-transform-exponentiation-operator-7.12.1.tgz#b0f2ed356ba1be1428ecaf128ff8a24f02830ae0" - integrity sha512-7tqwy2bv48q+c1EHbXK0Zx3KXd2RVQp6OC7PbwFNt/dPTAV3Lu5sWtWuAj8owr5wqtWnqHfl2/mJlUmqkChKug== +"@babel/plugin-transform-exponentiation-operator@^7.14.5": + version "7.14.5" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-exponentiation-operator/-/plugin-transform-exponentiation-operator-7.14.5.tgz#5154b8dd6a3dfe6d90923d61724bd3deeb90b493" + integrity sha512-jFazJhMBc9D27o9jDnIE5ZErI0R0m7PbKXVq77FFvqFbzvTMuv8jaAwLZ5PviOLSFttqKIW0/wxNSDbjLk0tYA== dependencies: - "@babel/helper-builder-binary-assignment-operator-visitor" "^7.10.4" - "@babel/helper-plugin-utils" "^7.10.4" + "@babel/helper-builder-binary-assignment-operator-visitor" "^7.14.5" + "@babel/helper-plugin-utils" "^7.14.5" -"@babel/plugin-transform-for-of@^7.12.1": - version "7.12.1" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-for-of/-/plugin-transform-for-of-7.12.1.tgz#07640f28867ed16f9511c99c888291f560921cfa" - integrity sha512-Zaeq10naAsuHo7heQvyV0ptj4dlZJwZgNAtBYBnu5nNKJoW62m0zKcIEyVECrUKErkUkg6ajMy4ZfnVZciSBhg== +"@babel/plugin-transform-for-of@^7.14.5": + version "7.14.5" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-for-of/-/plugin-transform-for-of-7.14.5.tgz#dae384613de8f77c196a8869cbf602a44f7fc0eb" + integrity sha512-CfmqxSUZzBl0rSjpoQSFoR9UEj3HzbGuGNL21/iFTmjb5gFggJp3ph0xR1YBhexmLoKRHzgxuFvty2xdSt6gTA== dependencies: - "@babel/helper-plugin-utils" "^7.10.4" + "@babel/helper-plugin-utils" "^7.14.5" -"@babel/plugin-transform-function-name@^7.12.1": - version "7.12.1" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-function-name/-/plugin-transform-function-name-7.12.1.tgz#2ec76258c70fe08c6d7da154003a480620eba667" - integrity sha512-JF3UgJUILoFrFMEnOJLJkRHSk6LUSXLmEFsA23aR2O5CSLUxbeUX1IZ1YQ7Sn0aXb601Ncwjx73a+FVqgcljVw== +"@babel/plugin-transform-function-name@^7.14.5": + version "7.14.5" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-function-name/-/plugin-transform-function-name-7.14.5.tgz#e81c65ecb900746d7f31802f6bed1f52d915d6f2" + integrity sha512-vbO6kv0fIzZ1GpmGQuvbwwm+O4Cbm2NrPzwlup9+/3fdkuzo1YqOZcXw26+YUJB84Ja7j9yURWposEHLYwxUfQ== dependencies: - "@babel/helper-function-name" "^7.10.4" - "@babel/helper-plugin-utils" "^7.10.4" + "@babel/helper-function-name" "^7.14.5" + "@babel/helper-plugin-utils" "^7.14.5" -"@babel/plugin-transform-literals@^7.12.1": - version "7.12.1" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-literals/-/plugin-transform-literals-7.12.1.tgz#d73b803a26b37017ddf9d3bb8f4dc58bfb806f57" - integrity sha512-+PxVGA+2Ag6uGgL0A5f+9rklOnnMccwEBzwYFL3EUaKuiyVnUipyXncFcfjSkbimLrODoqki1U9XxZzTvfN7IQ== +"@babel/plugin-transform-literals@^7.14.5": + version "7.14.5" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-literals/-/plugin-transform-literals-7.14.5.tgz#41d06c7ff5d4d09e3cf4587bd3ecf3930c730f78" + integrity sha512-ql33+epql2F49bi8aHXxvLURHkxJbSmMKl9J5yHqg4PLtdE6Uc48CH1GS6TQvZ86eoB/ApZXwm7jlA+B3kra7A== dependencies: - "@babel/helper-plugin-utils" "^7.10.4" + "@babel/helper-plugin-utils" "^7.14.5" -"@babel/plugin-transform-member-expression-literals@^7.12.1": - version "7.12.1" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-member-expression-literals/-/plugin-transform-member-expression-literals-7.12.1.tgz#496038602daf1514a64d43d8e17cbb2755e0c3ad" - integrity sha512-1sxePl6z9ad0gFMB9KqmYofk34flq62aqMt9NqliS/7hPEpURUCMbyHXrMPlo282iY7nAvUB1aQd5mg79UD9Jg== +"@babel/plugin-transform-member-expression-literals@^7.14.5": + version "7.14.5" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-member-expression-literals/-/plugin-transform-member-expression-literals-7.14.5.tgz#b39cd5212a2bf235a617d320ec2b48bcc091b8a7" + integrity sha512-WkNXxH1VXVTKarWFqmso83xl+2V3Eo28YY5utIkbsmXoItO8Q3aZxN4BTS2k0hz9dGUloHK26mJMyQEYfkn/+Q== dependencies: - "@babel/helper-plugin-utils" "^7.10.4" + "@babel/helper-plugin-utils" "^7.14.5" -"@babel/plugin-transform-modules-amd@^7.12.1": - version "7.12.1" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-modules-amd/-/plugin-transform-modules-amd-7.12.1.tgz#3154300b026185666eebb0c0ed7f8415fefcf6f9" - integrity sha512-tDW8hMkzad5oDtzsB70HIQQRBiTKrhfgwC/KkJeGsaNFTdWhKNt/BiE8c5yj19XiGyrxpbkOfH87qkNg1YGlOQ== +"@babel/plugin-transform-modules-amd@^7.14.5": + version "7.14.5" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-modules-amd/-/plugin-transform-modules-amd-7.14.5.tgz#4fd9ce7e3411cb8b83848480b7041d83004858f7" + integrity sha512-3lpOU8Vxmp3roC4vzFpSdEpGUWSMsHFreTWOMMLzel2gNGfHE5UWIh/LN6ghHs2xurUp4jRFYMUIZhuFbody1g== dependencies: - "@babel/helper-module-transforms" "^7.12.1" - "@babel/helper-plugin-utils" "^7.10.4" + "@babel/helper-module-transforms" "^7.14.5" + "@babel/helper-plugin-utils" "^7.14.5" babel-plugin-dynamic-import-node "^2.3.3" -"@babel/plugin-transform-modules-commonjs@^7.12.1": - version "7.12.1" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-modules-commonjs/-/plugin-transform-modules-commonjs-7.12.1.tgz#fa403124542636c786cf9b460a0ffbb48a86e648" - integrity sha512-dY789wq6l0uLY8py9c1B48V8mVL5gZh/+PQ5ZPrylPYsnAvnEMjqsUXkuoDVPeVK+0VyGar+D08107LzDQ6pag== +"@babel/plugin-transform-modules-commonjs@^7.15.0": + version "7.15.0" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-modules-commonjs/-/plugin-transform-modules-commonjs-7.15.0.tgz#3305896e5835f953b5cdb363acd9e8c2219a5281" + integrity sha512-3H/R9s8cXcOGE8kgMlmjYYC9nqr5ELiPkJn4q0mypBrjhYQoc+5/Maq69vV4xRPWnkzZuwJPf5rArxpB/35Cig== dependencies: - "@babel/helper-module-transforms" "^7.12.1" - "@babel/helper-plugin-utils" "^7.10.4" - "@babel/helper-simple-access" "^7.12.1" + "@babel/helper-module-transforms" "^7.15.0" + "@babel/helper-plugin-utils" "^7.14.5" + "@babel/helper-simple-access" "^7.14.8" babel-plugin-dynamic-import-node "^2.3.3" -"@babel/plugin-transform-modules-systemjs@^7.12.1": - version "7.12.1" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-modules-systemjs/-/plugin-transform-modules-systemjs-7.12.1.tgz#663fea620d593c93f214a464cd399bf6dc683086" - integrity sha512-Hn7cVvOavVh8yvW6fLwveFqSnd7rbQN3zJvoPNyNaQSvgfKmDBO9U1YL9+PCXGRlZD9tNdWTy5ACKqMuzyn32Q== +"@babel/plugin-transform-modules-systemjs@^7.14.5": + version "7.14.5" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-modules-systemjs/-/plugin-transform-modules-systemjs-7.14.5.tgz#c75342ef8b30dcde4295d3401aae24e65638ed29" + integrity sha512-mNMQdvBEE5DcMQaL5LbzXFMANrQjd2W7FPzg34Y4yEz7dBgdaC+9B84dSO+/1Wba98zoDbInctCDo4JGxz1VYA== dependencies: - "@babel/helper-hoist-variables" "^7.10.4" - "@babel/helper-module-transforms" "^7.12.1" - "@babel/helper-plugin-utils" "^7.10.4" - "@babel/helper-validator-identifier" "^7.10.4" + "@babel/helper-hoist-variables" "^7.14.5" + "@babel/helper-module-transforms" "^7.14.5" + "@babel/helper-plugin-utils" "^7.14.5" + "@babel/helper-validator-identifier" "^7.14.5" babel-plugin-dynamic-import-node "^2.3.3" -"@babel/plugin-transform-modules-umd@^7.12.1": - version "7.12.1" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-modules-umd/-/plugin-transform-modules-umd-7.12.1.tgz#eb5a218d6b1c68f3d6217b8fa2cc82fec6547902" - integrity sha512-aEIubCS0KHKM0zUos5fIoQm+AZUMt1ZvMpqz0/H5qAQ7vWylr9+PLYurT+Ic7ID/bKLd4q8hDovaG3Zch2uz5Q== +"@babel/plugin-transform-modules-umd@^7.14.5": + version "7.14.5" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-modules-umd/-/plugin-transform-modules-umd-7.14.5.tgz#fb662dfee697cce274a7cda525190a79096aa6e0" + integrity sha512-RfPGoagSngC06LsGUYyM9QWSXZ8MysEjDJTAea1lqRjNECE3y0qIJF/qbvJxc4oA4s99HumIMdXOrd+TdKaAAA== dependencies: - "@babel/helper-module-transforms" "^7.12.1" - "@babel/helper-plugin-utils" "^7.10.4" + "@babel/helper-module-transforms" "^7.14.5" + "@babel/helper-plugin-utils" "^7.14.5" -"@babel/plugin-transform-named-capturing-groups-regex@^7.12.1": - version "7.12.1" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-named-capturing-groups-regex/-/plugin-transform-named-capturing-groups-regex-7.12.1.tgz#b407f5c96be0d9f5f88467497fa82b30ac3e8753" - integrity sha512-tB43uQ62RHcoDp9v2Nsf+dSM8sbNodbEicbQNA53zHz8pWUhsgHSJCGpt7daXxRydjb0KnfmB+ChXOv3oADp1Q== +"@babel/plugin-transform-named-capturing-groups-regex@^7.14.9": + version "7.14.9" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-named-capturing-groups-regex/-/plugin-transform-named-capturing-groups-regex-7.14.9.tgz#c68f5c5d12d2ebaba3762e57c2c4f6347a46e7b2" + integrity sha512-l666wCVYO75mlAtGFfyFwnWmIXQm3kSH0C3IRnJqWcZbWkoihyAdDhFm2ZWaxWTqvBvhVFfJjMRQ0ez4oN1yYA== dependencies: - "@babel/helper-create-regexp-features-plugin" "^7.12.1" + "@babel/helper-create-regexp-features-plugin" "^7.14.5" -"@babel/plugin-transform-new-target@^7.12.1": - version "7.12.1" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-new-target/-/plugin-transform-new-target-7.12.1.tgz#80073f02ee1bb2d365c3416490e085c95759dec0" - integrity sha512-+eW/VLcUL5L9IvJH7rT1sT0CzkdUTvPrXC2PXTn/7z7tXLBuKvezYbGdxD5WMRoyvyaujOq2fWoKl869heKjhw== +"@babel/plugin-transform-new-target@^7.14.5": + version "7.14.5" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-new-target/-/plugin-transform-new-target-7.14.5.tgz#31bdae8b925dc84076ebfcd2a9940143aed7dbf8" + integrity sha512-Nx054zovz6IIRWEB49RDRuXGI4Gy0GMgqG0cII9L3MxqgXz/+rgII+RU58qpo4g7tNEx1jG7rRVH4ihZoP4esQ== dependencies: - "@babel/helper-plugin-utils" "^7.10.4" + "@babel/helper-plugin-utils" "^7.14.5" -"@babel/plugin-transform-object-super@^7.12.1": - version "7.12.1" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-object-super/-/plugin-transform-object-super-7.12.1.tgz#4ea08696b8d2e65841d0c7706482b048bed1066e" - integrity sha512-AvypiGJH9hsquNUn+RXVcBdeE3KHPZexWRdimhuV59cSoOt5kFBmqlByorAeUlGG2CJWd0U+4ZtNKga/TB0cAw== +"@babel/plugin-transform-object-super@^7.14.5": + version "7.14.5" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-object-super/-/plugin-transform-object-super-7.14.5.tgz#d0b5faeac9e98597a161a9cf78c527ed934cdc45" + integrity sha512-MKfOBWzK0pZIrav9z/hkRqIk/2bTv9qvxHzPQc12RcVkMOzpIKnFCNYJip00ssKWYkd8Sf5g0Wr7pqJ+cmtuFg== dependencies: - "@babel/helper-plugin-utils" "^7.10.4" - "@babel/helper-replace-supers" "^7.12.1" + "@babel/helper-plugin-utils" "^7.14.5" + "@babel/helper-replace-supers" "^7.14.5" -"@babel/plugin-transform-parameters@^7.12.1": - version "7.12.1" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-parameters/-/plugin-transform-parameters-7.12.1.tgz#d2e963b038771650c922eff593799c96d853255d" - integrity sha512-xq9C5EQhdPK23ZeCdMxl8bbRnAgHFrw5EOC3KJUsSylZqdkCaFEXxGSBuTSObOpiiHHNyb82es8M1QYgfQGfNg== +"@babel/plugin-transform-parameters@^7.14.5": + version "7.14.5" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-parameters/-/plugin-transform-parameters-7.14.5.tgz#49662e86a1f3ddccac6363a7dfb1ff0a158afeb3" + integrity sha512-Tl7LWdr6HUxTmzQtzuU14SqbgrSKmaR77M0OKyq4njZLQTPfOvzblNKyNkGwOfEFCEx7KeYHQHDI0P3F02IVkA== dependencies: - "@babel/helper-plugin-utils" "^7.10.4" + "@babel/helper-plugin-utils" "^7.14.5" -"@babel/plugin-transform-property-literals@^7.12.1": - version "7.12.1" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-property-literals/-/plugin-transform-property-literals-7.12.1.tgz#41bc81200d730abb4456ab8b3fbd5537b59adecd" - integrity sha512-6MTCR/mZ1MQS+AwZLplX4cEySjCpnIF26ToWo942nqn8hXSm7McaHQNeGx/pt7suI1TWOWMfa/NgBhiqSnX0cQ== +"@babel/plugin-transform-property-literals@^7.14.5": + version "7.14.5" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-property-literals/-/plugin-transform-property-literals-7.14.5.tgz#0ddbaa1f83db3606f1cdf4846fa1dfb473458b34" + integrity sha512-r1uilDthkgXW8Z1vJz2dKYLV1tuw2xsbrp3MrZmD99Wh9vsfKoob+JTgri5VUb/JqyKRXotlOtwgu4stIYCmnw== dependencies: - "@babel/helper-plugin-utils" "^7.10.4" + "@babel/helper-plugin-utils" "^7.14.5" -"@babel/plugin-transform-regenerator@^7.12.1": - version "7.12.1" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-regenerator/-/plugin-transform-regenerator-7.12.1.tgz#5f0a28d842f6462281f06a964e88ba8d7ab49753" - integrity sha512-gYrHqs5itw6i4PflFX3OdBPMQdPbF4bj2REIUxlMRUFk0/ZOAIpDFuViuxPjUL7YC8UPnf+XG7/utJvqXdPKng== +"@babel/plugin-transform-regenerator@^7.14.5": + version "7.14.5" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-regenerator/-/plugin-transform-regenerator-7.14.5.tgz#9676fd5707ed28f522727c5b3c0aa8544440b04f" + integrity sha512-NVIY1W3ITDP5xQl50NgTKlZ0GrotKtLna08/uGY6ErQt6VEQZXla86x/CTddm5gZdcr+5GSsvMeTmWA5Ii6pkg== dependencies: regenerator-transform "^0.14.2" -"@babel/plugin-transform-reserved-words@^7.12.1": - version "7.12.1" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-reserved-words/-/plugin-transform-reserved-words-7.12.1.tgz#6fdfc8cc7edcc42b36a7c12188c6787c873adcd8" - integrity sha512-pOnUfhyPKvZpVyBHhSBoX8vfA09b7r00Pmm1sH+29ae2hMTKVmSp4Ztsr8KBKjLjx17H0eJqaRC3bR2iThM54A== +"@babel/plugin-transform-reserved-words@^7.14.5": + version "7.14.5" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-reserved-words/-/plugin-transform-reserved-words-7.14.5.tgz#c44589b661cfdbef8d4300dcc7469dffa92f8304" + integrity sha512-cv4F2rv1nD4qdexOGsRQXJrOcyb5CrgjUH9PKrrtyhSDBNWGxd0UIitjyJiWagS+EbUGjG++22mGH1Pub8D6Vg== dependencies: - "@babel/helper-plugin-utils" "^7.10.4" + "@babel/helper-plugin-utils" "^7.14.5" -"@babel/plugin-transform-shorthand-properties@^7.12.1": - version "7.12.1" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-shorthand-properties/-/plugin-transform-shorthand-properties-7.12.1.tgz#0bf9cac5550fce0cfdf043420f661d645fdc75e3" - integrity sha512-GFZS3c/MhX1OusqB1MZ1ct2xRzX5ppQh2JU1h2Pnfk88HtFTM+TWQqJNfwkmxtPQtb/s1tk87oENfXJlx7rSDw== +"@babel/plugin-transform-shorthand-properties@^7.14.5": + version "7.14.5" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-shorthand-properties/-/plugin-transform-shorthand-properties-7.14.5.tgz#97f13855f1409338d8cadcbaca670ad79e091a58" + integrity sha512-xLucks6T1VmGsTB+GWK5Pl9Jl5+nRXD1uoFdA5TSO6xtiNjtXTjKkmPdFXVLGlK5A2/or/wQMKfmQ2Y0XJfn5g== dependencies: - "@babel/helper-plugin-utils" "^7.10.4" + "@babel/helper-plugin-utils" "^7.14.5" -"@babel/plugin-transform-spread@^7.12.1": - version "7.12.1" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-spread/-/plugin-transform-spread-7.12.1.tgz#527f9f311be4ec7fdc2b79bb89f7bf884b3e1e1e" - integrity sha512-vuLp8CP0BE18zVYjsEBZ5xoCecMK6LBMMxYzJnh01rxQRvhNhH1csMMmBfNo5tGpGO+NhdSNW2mzIvBu3K1fng== +"@babel/plugin-transform-spread@^7.14.6": + version "7.14.6" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-spread/-/plugin-transform-spread-7.14.6.tgz#6bd40e57fe7de94aa904851963b5616652f73144" + integrity sha512-Zr0x0YroFJku7n7+/HH3A2eIrGMjbmAIbJSVv0IZ+t3U2WUQUA64S/oeied2e+MaGSjmt4alzBCsK9E8gh+fag== dependencies: - "@babel/helper-plugin-utils" "^7.10.4" - "@babel/helper-skip-transparent-expression-wrappers" "^7.12.1" + "@babel/helper-plugin-utils" "^7.14.5" + "@babel/helper-skip-transparent-expression-wrappers" "^7.14.5" -"@babel/plugin-transform-sticky-regex@^7.12.7": - version "7.12.7" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-sticky-regex/-/plugin-transform-sticky-regex-7.12.7.tgz#560224613ab23987453948ed21d0b0b193fa7fad" - integrity sha512-VEiqZL5N/QvDbdjfYQBhruN0HYjSPjC4XkeqW4ny/jNtH9gcbgaqBIXYEZCNnESMAGs0/K/R7oFGMhOyu/eIxg== +"@babel/plugin-transform-sticky-regex@^7.14.5": + version "7.14.5" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-sticky-regex/-/plugin-transform-sticky-regex-7.14.5.tgz#5b617542675e8b7761294381f3c28c633f40aeb9" + integrity sha512-Z7F7GyvEMzIIbwnziAZmnSNpdijdr4dWt+FJNBnBLz5mwDFkqIXU9wmBcWWad3QeJF5hMTkRe4dAq2sUZiG+8A== dependencies: - "@babel/helper-plugin-utils" "^7.10.4" + "@babel/helper-plugin-utils" "^7.14.5" -"@babel/plugin-transform-template-literals@^7.12.1": - version "7.12.1" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-template-literals/-/plugin-transform-template-literals-7.12.1.tgz#b43ece6ed9a79c0c71119f576d299ef09d942843" - integrity sha512-b4Zx3KHi+taXB1dVRBhVJtEPi9h1THCeKmae2qP0YdUHIFhVjtpqqNfxeVAa1xeHVhAy4SbHxEwx5cltAu5apw== +"@babel/plugin-transform-template-literals@^7.14.5": + version "7.14.5" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-template-literals/-/plugin-transform-template-literals-7.14.5.tgz#a5f2bc233937d8453885dc736bdd8d9ffabf3d93" + integrity sha512-22btZeURqiepOfuy/VkFr+zStqlujWaarpMErvay7goJS6BWwdd6BY9zQyDLDa4x2S3VugxFb162IZ4m/S/+Gg== dependencies: - "@babel/helper-plugin-utils" "^7.10.4" + "@babel/helper-plugin-utils" "^7.14.5" -"@babel/plugin-transform-typeof-symbol@^7.12.10": - version "7.12.10" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-typeof-symbol/-/plugin-transform-typeof-symbol-7.12.10.tgz#de01c4c8f96580bd00f183072b0d0ecdcf0dec4b" - integrity sha512-JQ6H8Rnsogh//ijxspCjc21YPd3VLVoYtAwv3zQmqAt8YGYUtdo5usNhdl4b9/Vir2kPFZl6n1h0PfUz4hJhaA== +"@babel/plugin-transform-typeof-symbol@^7.14.5": + version "7.14.5" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-typeof-symbol/-/plugin-transform-typeof-symbol-7.14.5.tgz#39af2739e989a2bd291bf6b53f16981423d457d4" + integrity sha512-lXzLD30ffCWseTbMQzrvDWqljvZlHkXU+CnseMhkMNqU1sASnCsz3tSzAaH3vCUXb9PHeUb90ZT1BdFTm1xxJw== dependencies: - "@babel/helper-plugin-utils" "^7.10.4" + "@babel/helper-plugin-utils" "^7.14.5" -"@babel/plugin-transform-unicode-escapes@^7.12.1": - version "7.12.1" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-unicode-escapes/-/plugin-transform-unicode-escapes-7.12.1.tgz#5232b9f81ccb07070b7c3c36c67a1b78f1845709" - integrity sha512-I8gNHJLIc7GdApm7wkVnStWssPNbSRMPtgHdmH3sRM1zopz09UWPS4x5V4n1yz/MIWTVnJ9sp6IkuXdWM4w+2Q== +"@babel/plugin-transform-unicode-escapes@^7.14.5": + version "7.14.5" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-unicode-escapes/-/plugin-transform-unicode-escapes-7.14.5.tgz#9d4bd2a681e3c5d7acf4f57fa9e51175d91d0c6b" + integrity sha512-crTo4jATEOjxj7bt9lbYXcBAM3LZaUrbP2uUdxb6WIorLmjNKSpHfIybgY4B8SRpbf8tEVIWH3Vtm7ayCrKocA== dependencies: - "@babel/helper-plugin-utils" "^7.10.4" + "@babel/helper-plugin-utils" "^7.14.5" -"@babel/plugin-transform-unicode-regex@^7.12.1": - version "7.12.1" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-unicode-regex/-/plugin-transform-unicode-regex-7.12.1.tgz#cc9661f61390db5c65e3febaccefd5c6ac3faecb" - integrity sha512-SqH4ClNngh/zGwHZOOQMTD+e8FGWexILV+ePMyiDJttAWRh5dhDL8rcl5lSgU3Huiq6Zn6pWTMvdPAb21Dwdyg== +"@babel/plugin-transform-unicode-regex@^7.14.5": + version "7.14.5" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-unicode-regex/-/plugin-transform-unicode-regex-7.14.5.tgz#4cd09b6c8425dd81255c7ceb3fb1836e7414382e" + integrity sha512-UygduJpC5kHeCiRw/xDVzC+wj8VaYSoKl5JNVmbP7MadpNinAm3SvZCxZ42H37KZBKztz46YC73i9yV34d0Tzw== dependencies: - "@babel/helper-create-regexp-features-plugin" "^7.12.1" - "@babel/helper-plugin-utils" "^7.10.4" + "@babel/helper-create-regexp-features-plugin" "^7.14.5" + "@babel/helper-plugin-utils" "^7.14.5" "@babel/polyfill@^7.2.5": version "7.12.1" @@ -700,78 +755,85 @@ regenerator-runtime "^0.13.4" "@babel/preset-env@^7.3.1": - version "7.12.11" - resolved "https://registry.yarnpkg.com/@babel/preset-env/-/preset-env-7.12.11.tgz#55d5f7981487365c93dbbc84507b1c7215e857f9" - integrity sha512-j8Tb+KKIXKYlDBQyIOy4BLxzv1NUOwlHfZ74rvW+Z0Gp4/cI2IMDPBWAgWceGcE7aep9oL/0K9mlzlMGxA8yNw== - dependencies: - "@babel/compat-data" "^7.12.7" - "@babel/helper-compilation-targets" "^7.12.5" - "@babel/helper-module-imports" "^7.12.5" - "@babel/helper-plugin-utils" "^7.10.4" - "@babel/helper-validator-option" "^7.12.11" - "@babel/plugin-proposal-async-generator-functions" "^7.12.1" - "@babel/plugin-proposal-class-properties" "^7.12.1" - "@babel/plugin-proposal-dynamic-import" "^7.12.1" - "@babel/plugin-proposal-export-namespace-from" "^7.12.1" - "@babel/plugin-proposal-json-strings" "^7.12.1" - "@babel/plugin-proposal-logical-assignment-operators" "^7.12.1" - "@babel/plugin-proposal-nullish-coalescing-operator" "^7.12.1" - "@babel/plugin-proposal-numeric-separator" "^7.12.7" - "@babel/plugin-proposal-object-rest-spread" "^7.12.1" - "@babel/plugin-proposal-optional-catch-binding" "^7.12.1" - "@babel/plugin-proposal-optional-chaining" "^7.12.7" - "@babel/plugin-proposal-private-methods" "^7.12.1" - "@babel/plugin-proposal-unicode-property-regex" "^7.12.1" - "@babel/plugin-syntax-async-generators" "^7.8.0" - "@babel/plugin-syntax-class-properties" "^7.12.1" - "@babel/plugin-syntax-dynamic-import" "^7.8.0" + version "7.15.0" + resolved "https://registry.yarnpkg.com/@babel/preset-env/-/preset-env-7.15.0.tgz#e2165bf16594c9c05e52517a194bf6187d6fe464" + integrity sha512-FhEpCNFCcWW3iZLg0L2NPE9UerdtsCR6ZcsGHUX6Om6kbCQeL5QZDqFDmeNHC6/fy6UH3jEge7K4qG5uC9In0Q== + dependencies: + "@babel/compat-data" "^7.15.0" + "@babel/helper-compilation-targets" "^7.15.0" + "@babel/helper-plugin-utils" "^7.14.5" + "@babel/helper-validator-option" "^7.14.5" + "@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining" "^7.14.5" + "@babel/plugin-proposal-async-generator-functions" "^7.14.9" + "@babel/plugin-proposal-class-properties" "^7.14.5" + "@babel/plugin-proposal-class-static-block" "^7.14.5" + "@babel/plugin-proposal-dynamic-import" "^7.14.5" + "@babel/plugin-proposal-export-namespace-from" "^7.14.5" + "@babel/plugin-proposal-json-strings" "^7.14.5" + "@babel/plugin-proposal-logical-assignment-operators" "^7.14.5" + "@babel/plugin-proposal-nullish-coalescing-operator" "^7.14.5" + "@babel/plugin-proposal-numeric-separator" "^7.14.5" + "@babel/plugin-proposal-object-rest-spread" "^7.14.7" + "@babel/plugin-proposal-optional-catch-binding" "^7.14.5" + "@babel/plugin-proposal-optional-chaining" "^7.14.5" + "@babel/plugin-proposal-private-methods" "^7.14.5" + "@babel/plugin-proposal-private-property-in-object" "^7.14.5" + "@babel/plugin-proposal-unicode-property-regex" "^7.14.5" + "@babel/plugin-syntax-async-generators" "^7.8.4" + "@babel/plugin-syntax-class-properties" "^7.12.13" + "@babel/plugin-syntax-class-static-block" "^7.14.5" + "@babel/plugin-syntax-dynamic-import" "^7.8.3" "@babel/plugin-syntax-export-namespace-from" "^7.8.3" - "@babel/plugin-syntax-json-strings" "^7.8.0" + "@babel/plugin-syntax-json-strings" "^7.8.3" "@babel/plugin-syntax-logical-assignment-operators" "^7.10.4" - "@babel/plugin-syntax-nullish-coalescing-operator" "^7.8.0" + "@babel/plugin-syntax-nullish-coalescing-operator" "^7.8.3" "@babel/plugin-syntax-numeric-separator" "^7.10.4" - "@babel/plugin-syntax-object-rest-spread" "^7.8.0" - "@babel/plugin-syntax-optional-catch-binding" "^7.8.0" - "@babel/plugin-syntax-optional-chaining" "^7.8.0" - "@babel/plugin-syntax-top-level-await" "^7.12.1" - "@babel/plugin-transform-arrow-functions" "^7.12.1" - "@babel/plugin-transform-async-to-generator" "^7.12.1" - "@babel/plugin-transform-block-scoped-functions" "^7.12.1" - "@babel/plugin-transform-block-scoping" "^7.12.11" - "@babel/plugin-transform-classes" "^7.12.1" - "@babel/plugin-transform-computed-properties" "^7.12.1" - "@babel/plugin-transform-destructuring" "^7.12.1" - "@babel/plugin-transform-dotall-regex" "^7.12.1" - "@babel/plugin-transform-duplicate-keys" "^7.12.1" - "@babel/plugin-transform-exponentiation-operator" "^7.12.1" - "@babel/plugin-transform-for-of" "^7.12.1" - "@babel/plugin-transform-function-name" "^7.12.1" - "@babel/plugin-transform-literals" "^7.12.1" - "@babel/plugin-transform-member-expression-literals" "^7.12.1" - "@babel/plugin-transform-modules-amd" "^7.12.1" - "@babel/plugin-transform-modules-commonjs" "^7.12.1" - "@babel/plugin-transform-modules-systemjs" "^7.12.1" - "@babel/plugin-transform-modules-umd" "^7.12.1" - "@babel/plugin-transform-named-capturing-groups-regex" "^7.12.1" - "@babel/plugin-transform-new-target" "^7.12.1" - "@babel/plugin-transform-object-super" "^7.12.1" - "@babel/plugin-transform-parameters" "^7.12.1" - "@babel/plugin-transform-property-literals" "^7.12.1" - "@babel/plugin-transform-regenerator" "^7.12.1" - "@babel/plugin-transform-reserved-words" "^7.12.1" - "@babel/plugin-transform-shorthand-properties" "^7.12.1" - "@babel/plugin-transform-spread" "^7.12.1" - "@babel/plugin-transform-sticky-regex" "^7.12.7" - "@babel/plugin-transform-template-literals" "^7.12.1" - "@babel/plugin-transform-typeof-symbol" "^7.12.10" - "@babel/plugin-transform-unicode-escapes" "^7.12.1" - "@babel/plugin-transform-unicode-regex" "^7.12.1" - "@babel/preset-modules" "^0.1.3" - "@babel/types" "^7.12.11" - core-js-compat "^3.8.0" - semver "^5.5.0" - -"@babel/preset-modules@^0.1.3": + "@babel/plugin-syntax-object-rest-spread" "^7.8.3" + "@babel/plugin-syntax-optional-catch-binding" "^7.8.3" + "@babel/plugin-syntax-optional-chaining" "^7.8.3" + "@babel/plugin-syntax-private-property-in-object" "^7.14.5" + "@babel/plugin-syntax-top-level-await" "^7.14.5" + "@babel/plugin-transform-arrow-functions" "^7.14.5" + "@babel/plugin-transform-async-to-generator" "^7.14.5" + "@babel/plugin-transform-block-scoped-functions" "^7.14.5" + "@babel/plugin-transform-block-scoping" "^7.14.5" + "@babel/plugin-transform-classes" "^7.14.9" + "@babel/plugin-transform-computed-properties" "^7.14.5" + "@babel/plugin-transform-destructuring" "^7.14.7" + "@babel/plugin-transform-dotall-regex" "^7.14.5" + "@babel/plugin-transform-duplicate-keys" "^7.14.5" + "@babel/plugin-transform-exponentiation-operator" "^7.14.5" + "@babel/plugin-transform-for-of" "^7.14.5" + "@babel/plugin-transform-function-name" "^7.14.5" + "@babel/plugin-transform-literals" "^7.14.5" + "@babel/plugin-transform-member-expression-literals" "^7.14.5" + "@babel/plugin-transform-modules-amd" "^7.14.5" + "@babel/plugin-transform-modules-commonjs" "^7.15.0" + "@babel/plugin-transform-modules-systemjs" "^7.14.5" + "@babel/plugin-transform-modules-umd" "^7.14.5" + "@babel/plugin-transform-named-capturing-groups-regex" "^7.14.9" + "@babel/plugin-transform-new-target" "^7.14.5" + "@babel/plugin-transform-object-super" "^7.14.5" + "@babel/plugin-transform-parameters" "^7.14.5" + "@babel/plugin-transform-property-literals" "^7.14.5" + "@babel/plugin-transform-regenerator" "^7.14.5" + "@babel/plugin-transform-reserved-words" "^7.14.5" + "@babel/plugin-transform-shorthand-properties" "^7.14.5" + "@babel/plugin-transform-spread" "^7.14.6" + "@babel/plugin-transform-sticky-regex" "^7.14.5" + "@babel/plugin-transform-template-literals" "^7.14.5" + "@babel/plugin-transform-typeof-symbol" "^7.14.5" + "@babel/plugin-transform-unicode-escapes" "^7.14.5" + "@babel/plugin-transform-unicode-regex" "^7.14.5" + "@babel/preset-modules" "^0.1.4" + "@babel/types" "^7.15.0" + babel-plugin-polyfill-corejs2 "^0.2.2" + babel-plugin-polyfill-corejs3 "^0.2.2" + babel-plugin-polyfill-regenerator "^0.2.2" + core-js-compat "^3.16.0" + semver "^6.3.0" + +"@babel/preset-modules@^0.1.4": version "0.1.4" resolved "https://registry.yarnpkg.com/@babel/preset-modules/-/preset-modules-0.1.4.tgz#362f2b68c662842970fdb5e254ffc8fc1c2e415e" integrity sha512-J36NhwnfdzpmH41M1DrnkkgAqhZaqr/NBdPfQ677mLzlaXo+oDiv1deyCDtgAhz8p328otdob0Du7+xgHGZbKg== @@ -783,55 +845,118 @@ esutils "^2.0.2" "@babel/register@^7.0.0": - version "7.12.10" - resolved "https://registry.yarnpkg.com/@babel/register/-/register-7.12.10.tgz#19b87143f17128af4dbe7af54c735663b3999f60" - integrity sha512-EvX/BvMMJRAA3jZgILWgbsrHwBQvllC5T8B29McyME8DvkdOxk4ujESfrMvME8IHSDvWXrmMXxPvA/lx2gqPLQ== + version "7.14.5" + resolved "https://registry.yarnpkg.com/@babel/register/-/register-7.14.5.tgz#d0eac615065d9c2f1995842f85d6e56c345f3233" + integrity sha512-TjJpGz/aDjFGWsItRBQMOFTrmTI9tr79CHOK+KIvLeCkbxuOAk2M5QHjvruIMGoo9OuccMh5euplPzc5FjAKGg== dependencies: + clone-deep "^4.0.1" find-cache-dir "^2.0.0" - lodash "^4.17.19" make-dir "^2.1.0" pirates "^4.0.0" source-map-support "^0.5.16" "@babel/runtime@^7.8.4": - version "7.12.5" - resolved "https://registry.yarnpkg.com/@babel/runtime/-/runtime-7.12.5.tgz#410e7e487441e1b360c29be715d870d9b985882e" - integrity sha512-plcc+hbExy3McchJCEQG3knOsuh3HH+Prx1P6cLIkET/0dLuQDEnrT+s27Axgc9bqfsmNUNHfscgMUdBpC9xfg== + version "7.14.8" + resolved "https://registry.yarnpkg.com/@babel/runtime/-/runtime-7.14.8.tgz#7119a56f421018852694290b9f9148097391b446" + integrity sha512-twj3L8Og5SaCRCErB4x4ajbvBIVV77CGeFglHpeg5WC5FF8TZzBWXtTJ4MqaD9QszLYTtr+IsaAL2rEUevb+eg== dependencies: regenerator-runtime "^0.13.4" -"@babel/template@^7.10.4", "@babel/template@^7.12.7": - version "7.12.7" - resolved "https://registry.yarnpkg.com/@babel/template/-/template-7.12.7.tgz#c817233696018e39fbb6c491d2fb684e05ed43bc" - integrity sha512-GkDzmHS6GV7ZeXfJZ0tLRBhZcMcY0/Lnb+eEbXDBfCAcZCjrZKe6p3J4we/D24O9Y8enxWAg1cWwof59yLh2ow== - dependencies: - "@babel/code-frame" "^7.10.4" - "@babel/parser" "^7.12.7" - "@babel/types" "^7.12.7" - -"@babel/traverse@^7.10.4", "@babel/traverse@^7.12.1", "@babel/traverse@^7.12.10", "@babel/traverse@^7.12.5", "@babel/traverse@^7.7.0": - version "7.12.12" - resolved "https://registry.yarnpkg.com/@babel/traverse/-/traverse-7.12.12.tgz#d0cd87892704edd8da002d674bc811ce64743376" - integrity sha512-s88i0X0lPy45RrLM8b9mz8RPH5FqO9G9p7ti59cToE44xFm1Q+Pjh5Gq4SXBbtb88X7Uy7pexeqRIQDDMNkL0w== - dependencies: - "@babel/code-frame" "^7.12.11" - "@babel/generator" "^7.12.11" - "@babel/helper-function-name" "^7.12.11" - "@babel/helper-split-export-declaration" "^7.12.11" - "@babel/parser" "^7.12.11" - "@babel/types" "^7.12.12" +"@babel/template@^7.14.5": + version "7.14.5" + resolved "https://registry.yarnpkg.com/@babel/template/-/template-7.14.5.tgz#a9bc9d8b33354ff6e55a9c60d1109200a68974f4" + integrity sha512-6Z3Po85sfxRGachLULUhOmvAaOo7xCvqGQtxINai2mEGPFm6pQ4z5QInFnUrRpfoSV60BnjyF5F3c+15fxFV1g== + dependencies: + "@babel/code-frame" "^7.14.5" + "@babel/parser" "^7.14.5" + "@babel/types" "^7.14.5" + +"@babel/traverse@^7.13.0", "@babel/traverse@^7.14.5", "@babel/traverse@^7.14.8", "@babel/traverse@^7.15.0": + version "7.15.0" + resolved "https://registry.yarnpkg.com/@babel/traverse/-/traverse-7.15.0.tgz#4cca838fd1b2a03283c1f38e141f639d60b3fc98" + integrity sha512-392d8BN0C9eVxVWd8H6x9WfipgVH5IaIoLp23334Sc1vbKKWINnvwRpb4us0xtPaCumlwbTtIYNA0Dv/32sVFw== + dependencies: + "@babel/code-frame" "^7.14.5" + "@babel/generator" "^7.15.0" + "@babel/helper-function-name" "^7.14.5" + "@babel/helper-hoist-variables" "^7.14.5" + "@babel/helper-split-export-declaration" "^7.14.5" + "@babel/parser" "^7.15.0" + "@babel/types" "^7.15.0" debug "^4.1.0" globals "^11.1.0" + +"@babel/types@^7.14.5", "@babel/types@^7.14.8", "@babel/types@^7.15.0", "@babel/types@^7.4.4": + version "7.15.0" + resolved "https://registry.yarnpkg.com/@babel/types/-/types-7.15.0.tgz#61af11f2286c4e9c69ca8deb5f4375a73c72dcbd" + integrity sha512-OBvfqnllOIdX4ojTHpwZbpvz4j3EWyjkZEdmjH0/cgsd6QOdSgU8rLSk6ard/pcW7rlmjdVSX/AWOaORR1uNOQ== + dependencies: + "@babel/helper-validator-identifier" "^7.14.9" + to-fast-properties "^2.0.0" + +"@commitlint/execute-rule@^13.0.0": + version "13.0.0" + resolved "https://registry.yarnpkg.com/@commitlint/execute-rule/-/execute-rule-13.0.0.tgz#7823303b82b5d86dac46e67cfa005f4433476981" + integrity sha512-lBz2bJhNAgkkU/rFMAw3XBNujbxhxlaFHY3lfKB/MxpAa+pIfmWB3ig9i1VKe0wCvujk02O0WiMleNaRn2KJqw== + +"@commitlint/load@>6.1.1": + version "13.1.0" + resolved "https://registry.yarnpkg.com/@commitlint/load/-/load-13.1.0.tgz#d6c9b547551f2216586d6c1964d93f92e7b04277" + integrity sha512-zlZbjJCWnWmBOSwTXis8H7I6pYk6JbDwOCuARA6B9Y/qt2PD+NCo0E/7EuaaFoxjHl+o56QR5QttuMBrf+BJzg== + dependencies: + "@commitlint/execute-rule" "^13.0.0" + "@commitlint/resolve-extends" "^13.0.0" + "@commitlint/types" "^13.1.0" + chalk "^4.0.0" + cosmiconfig "^7.0.0" lodash "^4.17.19" + resolve-from "^5.0.0" -"@babel/types@^7.10.4", "@babel/types@^7.10.5", "@babel/types@^7.12.1", "@babel/types@^7.12.10", "@babel/types@^7.12.11", "@babel/types@^7.12.12", "@babel/types@^7.12.5", "@babel/types@^7.12.7", "@babel/types@^7.4.4", "@babel/types@^7.7.0": - version "7.12.12" - resolved "https://registry.yarnpkg.com/@babel/types/-/types-7.12.12.tgz#4608a6ec313abbd87afa55004d373ad04a96c299" - integrity sha512-lnIX7piTxOH22xE7fDXDbSHg9MM1/6ORnafpJmov5rs0kX5g4BZxeXNJLXsMRiO0U5Rb8/FvMS6xlTnTHvxonQ== +"@commitlint/resolve-extends@^13.0.0": + version "13.0.0" + resolved "https://registry.yarnpkg.com/@commitlint/resolve-extends/-/resolve-extends-13.0.0.tgz#a38fcd2474483bf9ec6e1e901b27b8a23abe7d73" + integrity sha512-1SyaE+UOsYTkQlTPUOoj4NwxQhGFtYildVS/d0TJuK8a9uAJLw7bhCLH2PEeH5cC2D1do4Eqhx/3bLDrSLH3hg== dependencies: - "@babel/helper-validator-identifier" "^7.12.11" + import-fresh "^3.0.0" lodash "^4.17.19" - to-fast-properties "^2.0.0" + resolve-from "^5.0.0" + resolve-global "^1.0.0" + +"@commitlint/types@^13.1.0": + version "13.1.0" + resolved "https://registry.yarnpkg.com/@commitlint/types/-/types-13.1.0.tgz#12cfb6e932372b1816af8900e2d10694add28191" + integrity sha512-zcVjuT+OfKt8h91vhBxt05RMcTGEx6DM7Q9QZeuMbXFk6xgbsSEDMMapbJPA1bCZ81fa/1OQBijSYPrKvtt06g== + dependencies: + chalk "^4.0.0" + +"@eslint/eslintrc@^0.4.3": + version "0.4.3" + resolved "https://registry.yarnpkg.com/@eslint/eslintrc/-/eslintrc-0.4.3.tgz#9e42981ef035beb3dd49add17acb96e8ff6f394c" + integrity sha512-J6KFFz5QCYUJq3pf0mjEcCJVERbzv71PUIDczuh9JkwGEzced6CO5ADLHB1rbf/+oPBtoPfMYNOpGDzCANlbXw== + dependencies: + ajv "^6.12.4" + debug "^4.1.1" + espree "^7.3.0" + globals "^13.9.0" + ignore "^4.0.6" + import-fresh "^3.2.1" + js-yaml "^3.13.1" + minimatch "^3.0.4" + strip-json-comments "^3.1.1" + +"@humanwhocodes/config-array@^0.5.0": + version "0.5.0" + resolved "https://registry.yarnpkg.com/@humanwhocodes/config-array/-/config-array-0.5.0.tgz#1407967d4c6eecd7388f83acf1eaf4d0c6e58ef9" + integrity sha512-FagtKFz74XrTl7y6HCzQpwDfXP0yhxe9lHLD1UZxjvZIcbyRz8zTFF/yYNfSfzU414eDwZ1SrO0Qvtyf+wFMQg== + dependencies: + "@humanwhocodes/object-schema" "^1.2.0" + debug "^4.1.1" + minimatch "^3.0.4" + +"@humanwhocodes/object-schema@^1.2.0": + version "1.2.0" + resolved "https://registry.yarnpkg.com/@humanwhocodes/object-schema/-/object-schema-1.2.0.tgz#87de7af9c231826fdd68ac7258f77c429e0e5fcf" + integrity sha512-wdppn25U8z/2yiaT6YGquE6X8sSv7hNMWSXYSSU1jGv/yd6XqjXgTDJ8KP4NgjTXfJ3GbRjeeb8RTV7a/VpM+w== "@istanbuljs/load-nyc-config@^1.0.0": version "1.1.0" @@ -845,35 +970,35 @@ resolve-from "^5.0.0" "@istanbuljs/schema@^0.1.2": - version "0.1.2" - resolved "https://registry.yarnpkg.com/@istanbuljs/schema/-/schema-0.1.2.tgz#26520bf09abe4a5644cd5414e37125a8954241dd" - integrity sha512-tsAQNx32a8CoFhjhijUIhI4kccIAgmGhy8LZMZgGfmXcpMbPRUqn5LWmgRttILi6yeGmBJd2xsPkFMs0PzgPCw== + version "0.1.3" + resolved "https://registry.yarnpkg.com/@istanbuljs/schema/-/schema-0.1.3.tgz#e45e384e4b8ec16bce2fd903af78450f6bf7ec98" + integrity sha512-ZXRY4jNvVgSVQ8DL3LTcakaAtXwTVUxE81hslsyD2AtoXW/wVob10HkOJ1X/pAlcI7D+2YoZKg5do8G/w6RYgA== -"@nodelib/fs.scandir@2.1.4": - version "2.1.4" - resolved "https://registry.yarnpkg.com/@nodelib/fs.scandir/-/fs.scandir-2.1.4.tgz#d4b3549a5db5de2683e0c1071ab4f140904bbf69" - integrity sha512-33g3pMJk3bg5nXbL/+CY6I2eJDzZAni49PfJnL5fghPTggPvBd/pFNSgJsdAgWptuFu7qq/ERvOYFlhvsLTCKA== +"@nodelib/fs.scandir@2.1.5": + version "2.1.5" + resolved "https://registry.yarnpkg.com/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz#7619c2eb21b25483f6d167548b4cfd5a7488c3d5" + integrity sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g== dependencies: - "@nodelib/fs.stat" "2.0.4" + "@nodelib/fs.stat" "2.0.5" run-parallel "^1.1.9" -"@nodelib/fs.stat@2.0.4", "@nodelib/fs.stat@^2.0.2": - version "2.0.4" - resolved "https://registry.yarnpkg.com/@nodelib/fs.stat/-/fs.stat-2.0.4.tgz#a3f2dd61bab43b8db8fa108a121cfffe4c676655" - integrity sha512-IYlHJA0clt2+Vg7bccq+TzRdJvv19c2INqBSsoOLp1je7xjtr7J26+WXR72MCdvU9q1qTzIWDfhMf+DRvQJK4Q== +"@nodelib/fs.stat@2.0.5", "@nodelib/fs.stat@^2.0.2": + version "2.0.5" + resolved "https://registry.yarnpkg.com/@nodelib/fs.stat/-/fs.stat-2.0.5.tgz#5bd262af94e9d25bd1e71b05deed44876a222e8b" + integrity sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A== "@nodelib/fs.walk@^1.2.3": - version "1.2.6" - resolved "https://registry.yarnpkg.com/@nodelib/fs.walk/-/fs.walk-1.2.6.tgz#cce9396b30aa5afe9e3756608f5831adcb53d063" - integrity sha512-8Broas6vTtW4GIXTAHDoE32hnN2M5ykgCpWGbuXHQ15vEMqr23pB76e/GZcYsZCHALv50ktd24qhEyKr6wBtow== + version "1.2.8" + resolved "https://registry.yarnpkg.com/@nodelib/fs.walk/-/fs.walk-1.2.8.tgz#e95737e8bb6746ddedf69c556953494f196fe69a" + integrity sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg== dependencies: - "@nodelib/fs.scandir" "2.1.4" + "@nodelib/fs.scandir" "2.1.5" fastq "^1.6.0" "@rollup/plugin-commonjs@^17.0.0": - version "17.0.0" - resolved "https://registry.yarnpkg.com/@rollup/plugin-commonjs/-/plugin-commonjs-17.0.0.tgz#2ae2228354cf0fbba6cf9f06f30b2c66a974324c" - integrity sha512-/omBIJG1nHQc+bgkYDuLpb/V08QyutP9amOrJRUSlYJZP+b/68gM//D8sxJe3Yry2QnYIr3QjR3x4AlxJEN3GA== + version "17.1.0" + resolved "https://registry.yarnpkg.com/@rollup/plugin-commonjs/-/plugin-commonjs-17.1.0.tgz#757ec88737dffa8aa913eb392fade2e45aef2a2d" + integrity sha512-PoMdXCw0ZyvjpCMT5aV4nkL0QywxP29sODQsSGeDpr/oI49Qq9tRtAsb/LbYbDzFlOydVEqHmmZWFtXJEAX9ew== dependencies: "@rollup/pluginutils" "^3.1.0" commondir "^1.0.1" @@ -884,9 +1009,9 @@ resolve "^1.17.0" "@rollup/plugin-node-resolve@^11.0.1": - version "11.0.1" - resolved "https://registry.yarnpkg.com/@rollup/plugin-node-resolve/-/plugin-node-resolve-11.0.1.tgz#d3765eec4bccf960801439a999382aed2dca959b" - integrity sha512-ltlsj/4Bhwwhb+Nb5xCz/6vieuEj2/BAkkqVIKmZwC7pIdl8srmgmglE4S0jFlZa32K4qvdQ6NHdmpRKD/LwoQ== + version "11.2.1" + resolved "https://registry.yarnpkg.com/@rollup/plugin-node-resolve/-/plugin-node-resolve-11.2.1.tgz#82aa59397a29cd4e13248b106e6a4a1880362a60" + integrity sha512-yc2n43jcqVyGE2sqV5/YCmocy9ArjVAP/BeXyTtADTBBX6V0e5UMqwO8CdQ0kzjb6zu5P1qMzsScCMRvE9OlVg== dependencies: "@rollup/pluginutils" "^3.1.0" "@types/resolve" "1.17.1" @@ -905,9 +1030,9 @@ picomatch "^2.2.2" "@types/estree@*": - version "0.0.45" - resolved "https://registry.yarnpkg.com/@types/estree/-/estree-0.0.45.tgz#e9387572998e5ecdac221950dab3e8c3b16af884" - integrity sha512-jnqIUKDUqJbDIUxm0Uj7bnlMnRm1T/eZ9N+AVMqhPgzrba2GhGG5o/jCTwmdPK709nEZsGoMzXEDUjcXHa3W0g== + version "0.0.50" + resolved "https://registry.yarnpkg.com/@types/estree/-/estree-0.0.50.tgz#1e0caa9364d3fccd2931c3ed96fdbeaa5d4cca83" + integrity sha512-C6N5s2ZFtuZRj54k2/zyRhNDjJwwcViAM3Nbm8zjBpbqAdZ00mr0CFxvSKeO8Y/e03WVFLpQMdHYVfUd6SB+Hw== "@types/estree@0.0.39": version "0.0.39" @@ -915,29 +1040,34 @@ integrity sha512-EYNwp3bU+98cpU4lAWYYL7Zz+2gryWH1qbdDTidVd6hkiR6weksdbMadyXKXNPEkQFhXM+hVO9ZygomHXp+AIw== "@types/fs-extra@^8.0.1": - version "8.1.1" - resolved "https://registry.yarnpkg.com/@types/fs-extra/-/fs-extra-8.1.1.tgz#1e49f22d09aa46e19b51c0b013cb63d0d923a068" - integrity sha512-TcUlBem321DFQzBNuz8p0CLLKp0VvF/XH9E4KHNmgwyp4E3AfgI5cjiIVZWlbfThBop2qxFIh4+LeY6hVWWZ2w== + version "8.1.2" + resolved "https://registry.yarnpkg.com/@types/fs-extra/-/fs-extra-8.1.2.tgz#7125cc2e4bdd9bd2fc83005ffdb1d0ba00cca61f" + integrity sha512-SvSrYXfWSc7R4eqnOzbQF4TZmfpNSM9FrSWLU3EUnWBuyZqNBOrv1B1JA3byUDPUl9z4Ab3jeZG2eDdySlgNMg== dependencies: "@types/node" "*" "@types/glob@^7.1.1": - version "7.1.3" - resolved "https://registry.yarnpkg.com/@types/glob/-/glob-7.1.3.tgz#e6ba80f36b7daad2c685acd9266382e68985c183" - integrity sha512-SEYeGAIQIQX8NN6LDKprLjbrd5dARM5EXsd8GI/A5l0apYI1fGMWgPHSe4ZKL4eozlAyI+doUE9XbYS4xCkQ1w== + version "7.1.4" + resolved "https://registry.yarnpkg.com/@types/glob/-/glob-7.1.4.tgz#ea59e21d2ee5c517914cb4bc8e4153b99e566672" + integrity sha512-w+LsMxKyYQm347Otw+IfBXOv9UWVjpHpCDdbBMt8Kz/xbvCYNjP+0qPh91Km3iKfSRLBB0P7fAMf0KHrPu+MyA== dependencies: "@types/minimatch" "*" "@types/node" "*" "@types/minimatch@*": - version "3.0.3" - resolved "https://registry.yarnpkg.com/@types/minimatch/-/minimatch-3.0.3.tgz#3dca0e3f33b200fc7d1139c0cd96c1268cadfd9d" - integrity sha512-tHq6qdbT9U1IRSGf14CL0pUlULksvY9OZ+5eEgl1N7t+OA3tGvNpxJCzuKQlsNgCVwbAs670L1vcVQi8j9HjnA== + version "3.0.5" + resolved "https://registry.yarnpkg.com/@types/minimatch/-/minimatch-3.0.5.tgz#1001cc5e6a3704b83c236027e77f2f58ea010f40" + integrity sha512-Klz949h02Gz2uZCMGwDUSDS1YBlTdDDgbWHi+81l29tQALUtvz4rAYi5uoVhE5Lagoq6DeqAUlbrHvW/mXDgdQ== "@types/node@*": - version "14.14.20" - resolved "https://registry.yarnpkg.com/@types/node/-/node-14.14.20.tgz#f7974863edd21d1f8a494a73e8e2b3658615c340" - integrity sha512-Y93R97Ouif9JEOWPIUyU+eyIdyRqQR0I8Ez1dzku4hDx34NWh4HbtIc3WNzwB1Y9ULvNGeu5B8h8bVL5cAk4/A== + version "16.4.13" + resolved "https://registry.yarnpkg.com/@types/node/-/node-16.4.13.tgz#7dfd9c14661edc65cccd43a29eb454174642370d" + integrity sha512-bLL69sKtd25w7p1nvg9pigE4gtKVpGTPojBFLMkGHXuUgap2sLqQt2qUnqmVCDfzGUL0DRNZP+1prIZJbMeAXg== + +"@types/parse-json@^4.0.0": + version "4.0.0" + resolved "https://registry.yarnpkg.com/@types/parse-json/-/parse-json-4.0.0.tgz#2f8bb441434d163b35fb8ffdccd7138927ffb8c0" + integrity sha512-//oorEZjL6sbPcKUaCdIGlIUeH26mgzimjBB77G6XRgnDl/L5wOnpyBGRe/Mmf5CVW3PwEBE1NjiMZ/ssFh4wA== "@types/resolve@1.17.1": version "1.17.1" @@ -981,10 +1111,10 @@ acorn-globals@^4.3.2: acorn "^6.0.1" acorn-walk "^6.0.1" -acorn-jsx@^5.2.0: - version "5.3.1" - resolved "https://registry.yarnpkg.com/acorn-jsx/-/acorn-jsx-5.3.1.tgz#fc8661e11b7ac1539c47dbfea2e72b3af34d267b" - integrity sha512-K0Ptm/47OKfQRpNQ2J/oIN/3QYiK6FwW+eJbILhsdxh2WTLdl+30o8aGdTbm5JbffpFFAg/g+zi1E+jvJha5ng== +acorn-jsx@^5.3.1: + version "5.3.2" + resolved "https://registry.yarnpkg.com/acorn-jsx/-/acorn-jsx-5.3.2.tgz#7ed5bb55908b3b2f1bc55c6af1653bada7f07937" + integrity sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ== acorn-walk@^6.0.1: version "6.2.0" @@ -1001,7 +1131,7 @@ acorn@^6.0.1: resolved "https://registry.yarnpkg.com/acorn/-/acorn-6.4.2.tgz#35866fd710528e92de10cf06016498e47e39e1e6" integrity sha512-XtGIhXwF8YM8bJhGxG5kXgjkEuNGLTkoYqVE+KMR+aspr4KGYmKYg7yUe3KghyQ9yheNwLnjmzh/7+gfDBmHCQ== -acorn@^7.1.0, acorn@^7.1.1: +acorn@^7.1.0, acorn@^7.4.0: version "7.4.1" resolved "https://registry.yarnpkg.com/acorn/-/acorn-7.4.1.tgz#feaed255973d2e77555b83dbc08851a6c63520fa" integrity sha512-nQyp0o1/mNdbTO1PO6kHkwSrmgZ0MT/jCCpNiwbUjGoRN4dlBhqJtoQuCnEOKzgTVwg0ZWiCoQy6SxMebQVh8A== @@ -1014,7 +1144,7 @@ aggregate-error@^3.0.0: clean-stack "^2.0.0" indent-string "^4.0.0" -ajv@^6.10.0, ajv@^6.10.2, ajv@^6.12.3: +ajv@^6.10.0, ajv@^6.12.3, ajv@^6.12.4: version "6.12.6" resolved "https://registry.yarnpkg.com/ajv/-/ajv-6.12.6.tgz#baf5a62e802b07d977034586f8c3baf5adf26df4" integrity sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g== @@ -1024,6 +1154,16 @@ ajv@^6.10.0, ajv@^6.10.2, ajv@^6.12.3: json-schema-traverse "^0.4.1" uri-js "^4.2.2" +ajv@^8.0.1: + version "8.6.2" + resolved "https://registry.yarnpkg.com/ajv/-/ajv-8.6.2.tgz#2fb45e0e5fcbc0813326c1c3da535d1881bb0571" + integrity sha512-9807RlWAgT564wT+DjeyU5OFMPjmzxVobvDFmNAhY+5zD6A2ly3jDp6sgnfyDtlIQ+7H97oc/DGCzzfu9rjw9w== + dependencies: + fast-deep-equal "^3.1.1" + json-schema-traverse "^1.0.0" + require-from-string "^2.0.2" + uri-js "^4.2.2" + amdefine@>=0.0.4: version "1.0.1" resolved "https://registry.yarnpkg.com/amdefine/-/amdefine-1.0.1.tgz#4a5282ac164729e93619bcfd3ad151f817ce91f5" @@ -1034,12 +1174,15 @@ ansi-colors@3.2.3: resolved "https://registry.yarnpkg.com/ansi-colors/-/ansi-colors-3.2.3.tgz#57d35b8686e851e2cc04c403f1c00203976a1813" integrity sha512-LEHHyuhlPY3TmuUYMh2oz89lTShfvgbmzaBcxve9t/9Wuy7Dwf4yoAKcND7KFT1HAQfqZ12qtc+DUrBMeKF9nw== -ansi-escapes@^4.2.1: - version "4.3.1" - resolved "https://registry.yarnpkg.com/ansi-escapes/-/ansi-escapes-4.3.1.tgz#a5c47cc43181f1f38ffd7076837700d395522a61" - integrity sha512-JWF7ocqNrp8u9oqpgV+wH5ftbt+cfvv+PTjOvKLT3AdYly/LmORARfEVT1iyjwN+4MqE5UmVKoAdIBqeoCHgLA== - dependencies: - type-fest "^0.11.0" +ansi-colors@^4.1.1: + version "4.1.1" + resolved "https://registry.yarnpkg.com/ansi-colors/-/ansi-colors-4.1.1.tgz#cbb9ae256bf750af1eab344f229aa27fe94ba348" + integrity sha512-JoX0apGbHaUJBNl6yF+p6JAFYZ666/hhCGKN5t9QFjbJQKUU/g8MNbFDbvfrgKXvI1QpZplPOnwIo99lX/AAmA== + +ansi-escapes@^3.2.0: + version "3.2.0" + resolved "https://registry.yarnpkg.com/ansi-escapes/-/ansi-escapes-3.2.0.tgz#8780b98ff9dbf5638152d1f1fe5c1d7b4442976b" + integrity sha512-cBhpre4ma+U0T1oM5fXg7Dy1Jw7zzwv7lt/GoCpr+hDQJoYnKVPLL4dCvSEFMmQurOQvSrwT7SL/DAlhBI97RQ== ansi-regex@^2.0.0: version "2.1.1" @@ -1076,9 +1219,9 @@ ansi-styles@^4.0.0, ansi-styles@^4.1.0: color-convert "^2.0.1" anymatch@~3.1.1: - version "3.1.1" - resolved "https://registry.yarnpkg.com/anymatch/-/anymatch-3.1.1.tgz#c55ecf02185e2469259399310c173ce31233b142" - integrity sha512-mM8522psRCqzV+6LhomX5wgp25YVibjh8Wj23I5RPkPppSVSjyKD2A2mBJmWGa+KN7f2D6LNh9jkBCeyLktzjg== + version "3.1.2" + resolved "https://registry.yarnpkg.com/anymatch/-/anymatch-3.1.2.tgz#c0557c096af32f106198f4f4e2a383537e378716" + integrity sha512-P43ePfOAIupkguHUycrc4qJ9kz8ZiuOUijaETwX7THt0Y/GNK7v0aa8rY816xWjZ7rJdA5XdMcpVFTKMq+RvWg== dependencies: normalize-path "^3.0.0" picomatch "^2.0.4" @@ -1125,11 +1268,31 @@ array-find-index@^1.0.2: resolved "https://registry.yarnpkg.com/array-find-index/-/array-find-index-1.0.2.tgz#df010aa1287e164bbda6f9723b0a96a1ec4187a1" integrity sha1-3wEKoSh+Fku9pvlyOwqWoexBh6E= +array-includes@^3.1.3: + version "3.1.3" + resolved "https://registry.yarnpkg.com/array-includes/-/array-includes-3.1.3.tgz#c7f619b382ad2afaf5326cddfdc0afc61af7690a" + integrity sha512-gcem1KlBU7c9rB+Rq8/3PPKsK2kjqeEBa3bD5kkQo4nYlOHQCJqIJFqBXDEfwaRuYTT4E+FxA9xez7Gf/e3Q7A== + dependencies: + call-bind "^1.0.2" + define-properties "^1.1.3" + es-abstract "^1.18.0-next.2" + get-intrinsic "^1.1.1" + is-string "^1.0.5" + array-union@^2.1.0: version "2.1.0" resolved "https://registry.yarnpkg.com/array-union/-/array-union-2.1.0.tgz#b798420adbeb1de828d84acd8a2e23d3efe85e8d" integrity sha512-HGyxoOTYUyCM6stUe6EJgnd4EoewAI7zMdfqO+kGjnlZmBDz/cR5pf8r/cR4Wq60sL/p0IkcjUEEPwS3GFrIyw== +array.prototype.flat@^1.2.4: + version "1.2.4" + resolved "https://registry.yarnpkg.com/array.prototype.flat/-/array.prototype.flat-1.2.4.tgz#6ef638b43312bd401b4c6199fdec7e2dc9e9a123" + integrity sha512-4470Xi3GAPAjZqFcljX2xzckv1qeKPizoNkiS0+O4IoPR2ZNpcjE0pkhdihlDouK+x6QOast26B4Q/O9DJnwSg== + dependencies: + call-bind "^1.0.0" + define-properties "^1.1.3" + es-abstract "^1.18.0-next.1" + asn1@~0.2.3: version "0.2.4" resolved "https://registry.yarnpkg.com/asn1/-/asn1-0.2.4.tgz#8d2475dfab553bb33e77b54e59e880bb8ce23136" @@ -1147,10 +1310,10 @@ assertion-error@^1.1.0: resolved "https://registry.yarnpkg.com/assertion-error/-/assertion-error-1.1.0.tgz#e60b6b0e8f301bd97e5375215bda406c85118c0b" integrity sha512-jgsaNduz+ndvGyFt3uSuWqvy4lCnIJiovtouQN5JZHOKCS2QuhEdbcQHFhVksz2N2U9hXJo8odG7ETyWlEeuDw== -astral-regex@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/astral-regex/-/astral-regex-1.0.0.tgz#6c8c3fb827dd43ee3918f27b82782ab7658a6fd9" - integrity sha512-+Ryf6g3BKoRc7jfp7ad8tM4TtMiaWvbF/1/sQcZPkkS7ag3D5nMBCe2UfOTONtAkaG0tO0ij3C5Lwmf1EiyjHg== +astral-regex@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/astral-regex/-/astral-regex-2.0.0.tgz#483143c567aeed4785759c0865786dc77d7d2e31" + integrity sha512-Z7tMw1ytTXt5jqMcOP+OQteU1VuNK9Y02uuJtKQ1Sv69jXQKKg5cibLwGJow8yzZP+eAc18EmLGPal0bp36rvQ== async@1.x: version "1.5.2" @@ -1172,18 +1335,6 @@ aws4@^1.8.0: resolved "https://registry.yarnpkg.com/aws4/-/aws4-1.11.0.tgz#d61f46d83b2519250e2784daf5b09479a8b41c59" integrity sha512-xh1Rl34h6Fi1DC2WWKfxUTVqRsNnr6LsKz2+hfwDxQJWmrx8+c7ylaqBMcHfl1U1r2dsifOvKX3LQuLNZ+XSvA== -babel-eslint@^10.0.1: - version "10.1.0" - resolved "https://registry.yarnpkg.com/babel-eslint/-/babel-eslint-10.1.0.tgz#6968e568a910b78fb3779cdd8b6ac2f479943232" - integrity sha512-ifWaTHQ0ce+448CYop8AdrQiBsGrnC+bMgfyKFdi6EsPLTAWG+QfyDeM6OH+FmWnKvEq5NnBMLvlBUPKQZoDSg== - dependencies: - "@babel/code-frame" "^7.0.0" - "@babel/parser" "^7.7.0" - "@babel/traverse" "^7.7.0" - "@babel/types" "^7.7.0" - eslint-visitor-keys "^1.0.0" - resolve "^1.12.0" - babel-plugin-dynamic-import-node@^2.3.3: version "2.3.3" resolved "https://registry.yarnpkg.com/babel-plugin-dynamic-import-node/-/babel-plugin-dynamic-import-node-2.3.3.tgz#84fda19c976ec5c6defef57f9427b3def66e17a3" @@ -1202,10 +1353,34 @@ babel-plugin-istanbul@^6.0.0: istanbul-lib-instrument "^4.0.0" test-exclude "^6.0.0" +babel-plugin-polyfill-corejs2@^0.2.2: + version "0.2.2" + resolved "https://registry.yarnpkg.com/babel-plugin-polyfill-corejs2/-/babel-plugin-polyfill-corejs2-0.2.2.tgz#e9124785e6fd94f94b618a7954e5693053bf5327" + integrity sha512-kISrENsJ0z5dNPq5eRvcctITNHYXWOA4DUZRFYCz3jYCcvTb/A546LIddmoGNMVYg2U38OyFeNosQwI9ENTqIQ== + dependencies: + "@babel/compat-data" "^7.13.11" + "@babel/helper-define-polyfill-provider" "^0.2.2" + semver "^6.1.1" + +babel-plugin-polyfill-corejs3@^0.2.2: + version "0.2.4" + resolved "https://registry.yarnpkg.com/babel-plugin-polyfill-corejs3/-/babel-plugin-polyfill-corejs3-0.2.4.tgz#68cb81316b0e8d9d721a92e0009ec6ecd4cd2ca9" + integrity sha512-z3HnJE5TY/j4EFEa/qpQMSbcUJZ5JQi+3UFjXzn6pQCmIKc5Ug5j98SuYyH+m4xQnvKlMDIW4plLfgyVnd0IcQ== + dependencies: + "@babel/helper-define-polyfill-provider" "^0.2.2" + core-js-compat "^3.14.0" + +babel-plugin-polyfill-regenerator@^0.2.2: + version "0.2.2" + resolved "https://registry.yarnpkg.com/babel-plugin-polyfill-regenerator/-/babel-plugin-polyfill-regenerator-0.2.2.tgz#b310c8d642acada348c1fa3b3e6ce0e851bee077" + integrity sha512-Goy5ghsc21HgPDFtzRkSirpZVW35meGoTmTOb2bxqdl60ghub4xOidgNTHaZfQ2FaxQsKmwvXtOAkcIS4SMBWg== + dependencies: + "@babel/helper-define-polyfill-provider" "^0.2.2" + balanced-match@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/balanced-match/-/balanced-match-1.0.0.tgz#89b4d199ab2bee49de164ea02b89ce462d71b767" - integrity sha1-ibTRmasr7kneFk6gK4nORi1xt2c= + version "1.0.2" + resolved "https://registry.yarnpkg.com/balanced-match/-/balanced-match-1.0.2.tgz#e83e3a7e3f300b34cb9d87f615fa0cbf357690ee" + integrity sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw== bcrypt-pbkdf@^1.0.0: version "1.0.2" @@ -1215,9 +1390,9 @@ bcrypt-pbkdf@^1.0.0: tweetnacl "^0.14.3" binary-extensions@^2.0.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/binary-extensions/-/binary-extensions-2.1.0.tgz#30fa40c9e7fe07dbc895678cd287024dea241dd9" - integrity sha512-1Yj8h9Q+QDF5FzhMs/c9+6UntbD5MkRfRwac8DoEm9ZfUBZ7tZ55YcGVAzEe4bXsdQHEk+s9S5wsOKVdZrw0tQ== + version "2.2.0" + resolved "https://registry.yarnpkg.com/binary-extensions/-/binary-extensions-2.2.0.tgz#75f502eeaf9ffde42fc98829645be4ea76bd9e2d" + integrity sha512-jDctJ/IVQbZoJykoeHbhXpOlNBqGNcwXJKJog42E5HDPUwQTSdjCHdihjj0DlnheQ7blbT6dHOafNAiS8ooQKA== bowser@^2.11.0: version "2.11.0" @@ -1249,27 +1424,32 @@ browser-stdout@1.3.1: resolved "https://registry.yarnpkg.com/browser-stdout/-/browser-stdout-1.3.1.tgz#baa559ee14ced73452229bad7326467c61fabd60" integrity sha512-qhAVI1+Av2X7qelOfAIYwXONood6XlZE/fXaBSmW/T5SzLAmCgzi+eiWE7fUvbHaeNBQH13UftjpXxsfLkMpgw== -browserslist@^4.14.5, browserslist@^4.16.0: - version "4.16.6" - resolved "https://registry.yarnpkg.com/browserslist/-/browserslist-4.16.6.tgz#d7901277a5a88e554ed305b183ec9b0c08f66fa2" - integrity sha512-Wspk/PqO+4W9qp5iUTJsa1B/QrYn1keNCcEP5OvP7WBwT4KaDly0uONYmC6Xa3Z5IqnUgS0KcgLYu1l74x0ZXQ== +browserslist@^4.16.6, browserslist@^4.16.7: + version "4.16.7" + resolved "https://registry.yarnpkg.com/browserslist/-/browserslist-4.16.7.tgz#108b0d1ef33c4af1b587c54f390e7041178e4335" + integrity sha512-7I4qVwqZltJ7j37wObBe3SoTz+nS8APaNcrBOlgoirb6/HbEU2XxW/LpUDTCngM6iauwFqmRTuOMfyKnFGY5JA== dependencies: - caniuse-lite "^1.0.30001219" + caniuse-lite "^1.0.30001248" colorette "^1.2.2" - electron-to-chromium "^1.3.723" + electron-to-chromium "^1.3.793" escalade "^3.1.1" - node-releases "^1.1.71" + node-releases "^1.1.73" buffer-from@^1.0.0: - version "1.1.1" - resolved "https://registry.yarnpkg.com/buffer-from/-/buffer-from-1.1.1.tgz#32713bc028f75c02fdb710d7c7bcec1f2c6070ef" - integrity sha512-MQcXEUbCKtEo7bhqEs6560Hyd4XaovZlO/k9V3hjVUF/zwW7KBVdSK4gIt/bzwS9MbR5qob+F5jusZsb0YQK2A== + version "1.1.2" + resolved "https://registry.yarnpkg.com/buffer-from/-/buffer-from-1.1.2.tgz#2b146a6fd72e80b4f55d255f35ed59a3a9a41bd5" + integrity sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ== builtin-modules@^3.1.0: version "3.2.0" resolved "https://registry.yarnpkg.com/builtin-modules/-/builtin-modules-3.2.0.tgz#45d5db99e7ee5e6bc4f362e008bf917ab5049887" integrity sha512-lGzLKcioL90C7wMczpkY0n/oART3MbBa8R9OFGE1rJxoVI86u4WAGfEk8Wjv10eKSyTHVGkSo3bvBylCEtk7LA== +cachedir@2.2.0: + version "2.2.0" + resolved "https://registry.yarnpkg.com/cachedir/-/cachedir-2.2.0.tgz#19afa4305e05d79e417566882e0c8f960f62ff0e" + integrity sha512-VvxA0xhNqIIfg0V9AmJkDg91DaJwryutH5rVEZAhcNi4iJFj9f+QxmAjgK1LT9I8OgToX27fypX6/MeCXVbBjQ== + caching-transform@^4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/caching-transform/-/caching-transform-4.0.0.tgz#00d297a4206d71e2163c39eaffa8157ac0651f0f" @@ -1280,13 +1460,13 @@ caching-transform@^4.0.0: package-hash "^4.0.0" write-file-atomic "^3.0.0" -call-bind@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/call-bind/-/call-bind-1.0.0.tgz#24127054bb3f9bdcb4b1fb82418186072f77b8ce" - integrity sha512-AEXsYIyyDY3MCzbwdhzG3Jx1R0J2wetQyUynn6dYHAO+bg8l1k7jwZtRv4ryryFs7EP+NDlikJlVe59jr0cM2w== +call-bind@^1.0.0, call-bind@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/call-bind/-/call-bind-1.0.2.tgz#b1d4e89e688119c3c9a903ad30abb2f6a919be3c" + integrity sha512-7O+FbCihrB5WGbFYesctwmTKae6rOiIzmz1icreWJ+0aA7LJfuqhEso2T9ncpcFtzMQtzXf2QGGueWJGTYsqrA== dependencies: function-bind "^1.1.1" - get-intrinsic "^1.0.0" + get-intrinsic "^1.0.2" callsites@^3.0.0: version "3.1.0" @@ -1298,12 +1478,12 @@ camelcase@^5.0.0, camelcase@^5.3.1: resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-5.3.1.tgz#e3c9b31569e106811df242f715725a1f4c494320" integrity sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg== -caniuse-lite@^1.0.30001219: - version "1.0.30001228" - resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001228.tgz#bfdc5942cd3326fa51ee0b42fbef4da9d492a7fa" - integrity sha512-QQmLOGJ3DEgokHbMSA8cj2a+geXqmnpyOFT0lhQV6P3/YOJvGDEwoedcwxEQ30gJIwIIunHIicunJ2rzK5gB2A== +caniuse-lite@^1.0.30001248: + version "1.0.30001249" + resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001249.tgz#90a330057f8ff75bfe97a94d047d5e14fabb2ee8" + integrity sha512-vcX4U8lwVXPdqzPWi6cAJ3FnQaqXbBqy/GZseKNQzRj37J7qZdGcBtxq/QLFNLLlfsoXLUdHw8Iwenri86Tagw== -canvas@^2.3.1: +canvas@2.6.1: version "2.6.1" resolved "https://registry.yarnpkg.com/canvas/-/canvas-2.6.1.tgz#0d087dd4d60f5a5a9efa202757270abea8bef89e" integrity sha512-S98rKsPcuhfTcYbtF53UIJhcbgIAK533d1kJKMwsMwAIFgfd58MOyxRud3kktlzWiEkFliaJtvyZCBtud/XVEA== @@ -1325,18 +1505,18 @@ chai-as-promised@^7.1.1: check-error "^1.0.2" chai@^4.1.0: - version "4.2.0" - resolved "https://registry.yarnpkg.com/chai/-/chai-4.2.0.tgz#760aa72cf20e3795e84b12877ce0e83737aa29e5" - integrity sha512-XQU3bhBukrOsQCuwZndwGcCVQHyZi53fQ6Ys1Fym7E4olpIqqZZhhoFJoaKVvV17lWQoXYwgWN2nF5crA8J2jw== + version "4.3.4" + resolved "https://registry.yarnpkg.com/chai/-/chai-4.3.4.tgz#b55e655b31e1eac7099be4c08c21964fce2e6c49" + integrity sha512-yS5H68VYOCtN1cjfwumDSuzn/9c+yza4f3reKXlE5rUg7SFcCEy90gJvydNgOYtblyf4Zi6jIWRnXOgErta0KA== dependencies: assertion-error "^1.1.0" check-error "^1.0.2" deep-eql "^3.0.1" get-func-name "^2.0.0" - pathval "^1.1.0" + pathval "^1.1.1" type-detect "^4.0.5" -chalk@^2.0.0, chalk@^2.1.0, chalk@^2.4.2: +chalk@^2.0.0, chalk@^2.4.1, chalk@^2.4.2: version "2.4.2" resolved "https://registry.yarnpkg.com/chalk/-/chalk-2.4.2.tgz#cd42541677a54333cf541a49108c1432b44c9424" integrity sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ== @@ -1345,10 +1525,10 @@ chalk@^2.0.0, chalk@^2.1.0, chalk@^2.4.2: escape-string-regexp "^1.0.5" supports-color "^5.3.0" -chalk@^4.1.0: - version "4.1.0" - resolved "https://registry.yarnpkg.com/chalk/-/chalk-4.1.0.tgz#4e14870a618d9e2edd97dd8345fd9d9dc315646a" - integrity sha512-qwx12AxXe2Q5xQ43Ac//I6v5aXTipYrSESdOgzrN+9XjgEpyjpKuvSGaN4qE93f7TQTlerQQ8S+EQ0EyDoVL1A== +chalk@^4.0.0: + version "4.1.2" + resolved "https://registry.yarnpkg.com/chalk/-/chalk-4.1.2.tgz#aac4e2b7734a740867aeb16bf02aad556a1e7a01" + integrity sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA== dependencies: ansi-styles "^4.1.0" supports-color "^7.1.0" @@ -1378,7 +1558,7 @@ chokidar@3.3.0: optionalDependencies: fsevents "~2.1.1" -chownr@^1.1.1: +chownr@^1.1.4: version "1.1.4" resolved "https://registry.yarnpkg.com/chownr/-/chownr-1.1.4.tgz#6fc9d7b42d32a583596337666e7d08084da2cc6b" integrity sha512-jJ0bqzaylmJtVnNgzTeSOs8DPavpbYgEr/b0YL8/2GO3xJEhInFmhKMUnEJQjZumK7KXGFhUy89PrsJWlakBVg== @@ -1388,17 +1568,17 @@ clean-stack@^2.0.0: resolved "https://registry.yarnpkg.com/clean-stack/-/clean-stack-2.2.0.tgz#ee8472dbb129e727b31e8a10a427dee9dfe4008b" integrity sha512-4diC9HaTE+KRAMWhDhrGOECgWZxoevMc5TlkObMqNSsVU62PYzXZ/SMTjzyGAFF1YusgxGcSWTEXBhp0CPwQ1A== -cli-cursor@^3.1.0: - version "3.1.0" - resolved "https://registry.yarnpkg.com/cli-cursor/-/cli-cursor-3.1.0.tgz#264305a7ae490d1d03bf0c9ba7c925d1753af307" - integrity sha512-I/zHAwsKf9FqGoXM4WWRACob9+SNukZTd94DWF57E4toouRulbCxcUh6RKUEOQlYTHJnzkPMySvPNaaSLNfLZw== +cli-cursor@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/cli-cursor/-/cli-cursor-2.1.0.tgz#b35dac376479facc3e94747d41d0d0f5238ffcb5" + integrity sha1-s12sN2R5+sw+lHR9QdDQ9SOP/LU= dependencies: - restore-cursor "^3.1.0" + restore-cursor "^2.0.0" -cli-width@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/cli-width/-/cli-width-3.0.0.tgz#a2f48437a2caa9a22436e794bf071ec9e61cedf6" - integrity sha512-FxqpkPPwu1HjuN93Omfm4h8uIanXofW0RxVEW3k5RKx+mJJYSthzNhp32Kzxxy3YAEZ/Dc/EWN1vZRY0+kOhbw== +cli-width@^2.0.0: + version "2.2.1" + resolved "https://registry.yarnpkg.com/cli-width/-/cli-width-2.2.1.tgz#b0433d0b4e9c847ef18868a4ef16fd5fc8271c48" + integrity sha512-GRMWDxpOB6Dgk2E5Uo+3eEBvtOOlimMmpbFiKuLFnQzYDavtLFY3K5ona41jgN/WdRZtG7utuVSVTL4HbZHGkw== cliui@^5.0.0: version "5.0.0" @@ -1418,6 +1598,15 @@ cliui@^6.0.0: strip-ansi "^6.0.0" wrap-ansi "^6.2.0" +clone-deep@^4.0.1: + version "4.0.1" + resolved "https://registry.yarnpkg.com/clone-deep/-/clone-deep-4.0.1.tgz#c19fd9bdbbf85942b4fd979c84dcf7d5f07c2387" + integrity sha512-neHB9xuzh/wk0dIHweyAXv2aPGZIVk3pLMe+/RNzINf17fe0OG96QroktYAUm7SM1PBnzTabaLboqqxDyMU+SQ== + dependencies: + is-plain-object "^2.0.4" + kind-of "^6.0.2" + shallow-clone "^3.0.0" + code-point-at@^1.0.0: version "1.1.0" resolved "https://registry.yarnpkg.com/code-point-at/-/code-point-at-1.1.0.tgz#0d070b4d043a5bea33a2f1a40e2edb3d9a4ccf77" @@ -1448,9 +1637,9 @@ color-name@~1.1.4: integrity sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA== colorette@^1.1.0, colorette@^1.2.2: - version "1.2.2" - resolved "https://registry.yarnpkg.com/colorette/-/colorette-1.2.2.tgz#cbcc79d5e99caea2dbf10eb3a26fd8b3e6acfa94" - integrity sha512-MKGMzyfeuutC/ZJ1cba9NqcNpfeqMUcYmyF1ZFY6/Cn7CNSAKx6a+s48sqLqyAiZuaP2TcqMhoo+dlwFnVxT9w== + version "1.3.0" + resolved "https://registry.yarnpkg.com/colorette/-/colorette-1.3.0.tgz#ff45d2f0edb244069d3b772adeb04fed38d0a0af" + integrity sha512-ecORCqbSFP7Wm8Y6lyqMJjexBQqXSF7SSeaTyGGphogUjBlFP9m9o08wy86HL2uB7fMTxtOUzLMk7ogKcxMg1w== combined-stream@^1.0.6, combined-stream@~1.0.6: version "1.0.8" @@ -1469,6 +1658,26 @@ commenting@1.1.0: resolved "https://registry.yarnpkg.com/commenting/-/commenting-1.1.0.tgz#fae14345c6437b8554f30bc6aa6c1e1633033590" integrity sha512-YeNK4tavZwtH7jEgK1ZINXzLKm6DZdEMfsaaieOsCAN0S8vsY7UeuO3Q7d/M018EFgE+IeUAuBOKkFccBZsUZA== +commitizen@^4.0.3: + version "4.2.4" + resolved "https://registry.yarnpkg.com/commitizen/-/commitizen-4.2.4.tgz#a3e5b36bd7575f6bf6e7aa19dbbf06b0d8f37165" + integrity sha512-LlZChbDzg3Ir3O2S7jSo/cgWp5/QwylQVr59K4xayVq8S4/RdKzSyJkghAiZZHfhh5t4pxunUoyeg0ml1q/7aw== + dependencies: + cachedir "2.2.0" + cz-conventional-changelog "3.2.0" + dedent "0.7.0" + detect-indent "6.0.0" + find-node-modules "^2.1.2" + find-root "1.1.0" + fs-extra "8.1.0" + glob "7.1.4" + inquirer "6.5.2" + is-utf8 "^0.2.1" + lodash "^4.17.20" + minimist "1.2.5" + strip-bom "4.0.0" + strip-json-comments "3.0.1" + commondir@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/commondir/-/commondir-1.0.1.tgz#ddd800da0c66127393cca5950ea968a3aaf1253b" @@ -1479,24 +1688,34 @@ concat-map@0.0.1: resolved "https://registry.yarnpkg.com/concat-map/-/concat-map-0.0.1.tgz#d8a96bd77fd68df7793a73036a3ba0d5405d477b" integrity sha1-2Klr13/Wjfd5OnMDajug1UBdR3s= +confusing-browser-globals@^1.0.10: + version "1.0.10" + resolved "https://registry.yarnpkg.com/confusing-browser-globals/-/confusing-browser-globals-1.0.10.tgz#30d1e7f3d1b882b25ec4933d1d1adac353d20a59" + integrity sha512-gNld/3lySHwuhaVluJUKLePYirM3QNCKzVxqAdhJII9/WXKVX5PURzMVJspS1jTslSqjeuG4KMVTSouit5YPHA== + console-control-strings@^1.0.0, console-control-strings@~1.1.0: version "1.1.0" resolved "https://registry.yarnpkg.com/console-control-strings/-/console-control-strings-1.1.0.tgz#3d7cf4464db6446ea644bf4b39507f9851008e8e" integrity sha1-PXz0Rk22RG6mRL9LOVB/mFEAjo4= +conventional-commit-types@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/conventional-commit-types/-/conventional-commit-types-3.0.0.tgz#7c9214e58eae93e85dd66dbfbafe7e4fffa2365b" + integrity sha512-SmmCYnOniSsAa9GqWOeLqc179lfr5TRu5b4QFDkbsrJ5TZjPJx85wtOr3zn+1dbeNiXDKGPbZ72IKbPhLXh/Lg== + convert-source-map@^1.7.0: - version "1.7.0" - resolved "https://registry.yarnpkg.com/convert-source-map/-/convert-source-map-1.7.0.tgz#17a2cb882d7f77d3490585e2ce6c524424a3a442" - integrity sha512-4FJkXzKXEDB1snCFZlLP4gpC3JILicCpGbzG9f9G7tGqGCzETQ2hWPrcinA9oU4wtf2biUaEH5065UnMeR33oA== + version "1.8.0" + resolved "https://registry.yarnpkg.com/convert-source-map/-/convert-source-map-1.8.0.tgz#f3373c32d21b4d780dd8004514684fb791ca4369" + integrity sha512-+OQdjP49zViI/6i7nIJpA8rAl4sV/JdPfU9nZs3VqOwGIgizICvuN2ru6fMd+4llL0tar18UYJXfZ/TWtmhUjA== dependencies: safe-buffer "~5.1.1" -core-js-compat@^3.8.0: - version "3.8.2" - resolved "https://registry.yarnpkg.com/core-js-compat/-/core-js-compat-3.8.2.tgz#3717f51f6c3d2ebba8cbf27619b57160029d1d4c" - integrity sha512-LO8uL9lOIyRRrQmZxHZFl1RV+ZbcsAkFWTktn5SmH40WgLtSNYN4m4W2v9ONT147PxBY/XrRhrWq8TlvObyUjQ== +core-js-compat@^3.14.0, core-js-compat@^3.16.0: + version "3.16.1" + resolved "https://registry.yarnpkg.com/core-js-compat/-/core-js-compat-3.16.1.tgz#c44b7caa2dcb94b673a98f27eee1c8312f55bc2d" + integrity sha512-NHXQXvRbd4nxp9TEmooTJLUf94ySUG6+DSsscBpTftN1lQLQ4LjnWvc7AoIo4UjDsFF3hB8Uh5LLCRRdaiT5MQ== dependencies: - browserslist "^4.16.0" + browserslist "^4.16.7" semver "7.0.0" core-js@^2.6.5: @@ -1504,11 +1723,27 @@ core-js@^2.6.5: resolved "https://registry.yarnpkg.com/core-js/-/core-js-2.6.12.tgz#d9333dfa7b065e347cc5682219d6f690859cc2ec" integrity sha512-Kb2wC0fvsWfQrgk8HU5lW6U/Lcs8+9aaYcy4ZFc6DDlo4nZ7n70dEgE5rtR0oG6ufKDUnrwfWL1mXR5ljDatrQ== +core-js@^3.16.1: + version "3.16.1" + resolved "https://registry.yarnpkg.com/core-js/-/core-js-3.16.1.tgz#f4485ce5c9f3c6a7cb18fa80488e08d362097249" + integrity sha512-AAkP8i35EbefU+JddyWi12AWE9f2N/qr/pwnDtWz4nyUIBGMJPX99ANFFRSw6FefM374lDujdtLDyhN2A/btHw== + core-util-is@1.0.2, core-util-is@~1.0.0: version "1.0.2" resolved "https://registry.yarnpkg.com/core-util-is/-/core-util-is-1.0.2.tgz#b5fd54220aa2bc5ab57aab7140c940754503c1a7" integrity sha1-tf1UIgqivFq1eqtxQMlAdUUDwac= +cosmiconfig@^7.0.0: + version "7.0.0" + resolved "https://registry.yarnpkg.com/cosmiconfig/-/cosmiconfig-7.0.0.tgz#ef9b44d773959cae63ddecd122de23853b60f8d3" + integrity sha512-pondGvTuVYDk++upghXJabWzL6Kxu6f26ljFw64Swq9v6sQPUL3EUlVDV56diOjpCayKihL6hVe8exIACU4XcA== + dependencies: + "@types/parse-json" "^4.0.0" + import-fresh "^3.2.1" + parse-json "^5.0.0" + path-type "^4.0.0" + yaml "^1.10.0" + cross-env@^7.0.2: version "7.0.3" resolved "https://registry.yarnpkg.com/cross-env/-/cross-env-7.0.3.tgz#865264b29677dc015ba8418918965dd232fc54cf" @@ -1516,18 +1751,7 @@ cross-env@^7.0.2: dependencies: cross-spawn "^7.0.1" -cross-spawn@^6.0.5: - version "6.0.5" - resolved "https://registry.yarnpkg.com/cross-spawn/-/cross-spawn-6.0.5.tgz#4a5ec7c64dfae22c3a14124dbacdee846d80cbc4" - integrity sha512-eTVLrBSt7fjbDygz805pMnstIs2VTBNkRm0qxZd+M7A5XDdxVRWO5MxGBXZhjY4cqLYLdtrGqRf8mBPmzwSpWQ== - dependencies: - nice-try "^1.0.4" - path-key "^2.0.1" - semver "^5.5.0" - shebang-command "^1.2.0" - which "^1.2.9" - -cross-spawn@^7.0.0, cross-spawn@^7.0.1: +cross-spawn@^7.0.0, cross-spawn@^7.0.1, cross-spawn@^7.0.2: version "7.0.3" resolved "https://registry.yarnpkg.com/cross-spawn/-/cross-spawn-7.0.3.tgz#f73a85b9d5d41d045551c177e2882d4ac85728a6" integrity sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w== @@ -1553,6 +1777,34 @@ cssstyle@^2.0.0: dependencies: cssom "~0.3.6" +cz-conventional-changelog@3.2.0: + version "3.2.0" + resolved "https://registry.yarnpkg.com/cz-conventional-changelog/-/cz-conventional-changelog-3.2.0.tgz#6aef1f892d64113343d7e455529089ac9f20e477" + integrity sha512-yAYxeGpVi27hqIilG1nh4A9Bnx4J3Ov+eXy4koL3drrR+IO9GaWPsKjik20ht608Asqi8TQPf0mczhEeyAtMzg== + dependencies: + chalk "^2.4.1" + commitizen "^4.0.3" + conventional-commit-types "^3.0.0" + lodash.map "^4.5.1" + longest "^2.0.1" + word-wrap "^1.0.3" + optionalDependencies: + "@commitlint/load" ">6.1.1" + +cz-conventional-changelog@3.3.0: + version "3.3.0" + resolved "https://registry.yarnpkg.com/cz-conventional-changelog/-/cz-conventional-changelog-3.3.0.tgz#9246947c90404149b3fe2cf7ee91acad3b7d22d2" + integrity sha512-U466fIzU5U22eES5lTNiNbZ+d8dfcHcssH4o7QsdWaCcRs/feIPCxKYSWkYBNs5mny7MvEfwpTLWjvbm94hecw== + dependencies: + chalk "^2.4.1" + commitizen "^4.0.3" + conventional-commit-types "^3.0.0" + lodash.map "^4.5.1" + longest "^2.0.1" + word-wrap "^1.0.3" + optionalDependencies: + "@commitlint/load" ">6.1.1" + dashdash@^1.12.0: version "1.14.1" resolved "https://registry.yarnpkg.com/dashdash/-/dashdash-1.14.1.tgz#853cfa0f7cbe2fed5de20326b8dd581035f6e2f0" @@ -1576,7 +1828,14 @@ debug@3.2.6: dependencies: ms "^2.1.1" -debug@^3.2.6: +debug@^2.6.9: + version "2.6.9" + resolved "https://registry.yarnpkg.com/debug/-/debug-2.6.9.tgz#5d128515df134ff327e90a4c93f4e077a536341f" + integrity sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA== + dependencies: + ms "2.0.0" + +debug@^3.2.6, debug@^3.2.7: version "3.2.7" resolved "https://registry.yarnpkg.com/debug/-/debug-3.2.7.tgz#72580b7e9145fb39b6676f9c5e5fb100b934179a" integrity sha512-CFjzYYAi4ThfiQvizrFQevTTXHtnCqWfe7x1AhgEscTz6ZbLbfoLRLPugTQyBth6f8ZERVUSyWHFD/7Wu4t1XQ== @@ -1584,9 +1843,9 @@ debug@^3.2.6: ms "^2.1.1" debug@^4.0.1, debug@^4.1.0, debug@^4.1.1: - version "4.3.1" - resolved "https://registry.yarnpkg.com/debug/-/debug-4.3.1.tgz#f0d229c505e0c6d8c49ac553d1b13dc183f6b2ee" - integrity sha512-doEwdvm4PCeK4K3RQN2ZC2BYUBaxwLARCqZmMjtF8a51J2Rb0xpVloFRnCODwqjpwnAoao4pelN8l3RJdv3gRQ== + version "4.3.2" + resolved "https://registry.yarnpkg.com/debug/-/debug-4.3.2.tgz#f0a49c18ac8779e31d4a0c6029dfb76873c7428b" + integrity sha512-mOp8wKcvj7XxC78zLgw/ZA+6TSgkoE2C/ienthhRD298T7UNwAg9diBpLRxC0mOezLl4B0xV7M0cCO6P/O0Xhw== dependencies: ms "2.1.2" @@ -1602,6 +1861,11 @@ decompress-response@^4.2.0: dependencies: mimic-response "^2.0.0" +dedent@0.7.0: + version "0.7.0" + resolved "https://registry.yarnpkg.com/dedent/-/dedent-0.7.0.tgz#2495ddbaf6eb874abb0e1be9df22d2e5a544326c" + integrity sha1-JJXduvbrh0q7Dhvp3yLS5aVEMmw= + deep-eql@^3.0.1: version "3.0.1" resolved "https://registry.yarnpkg.com/deep-eql/-/deep-eql-3.0.1.tgz#dfc9404400ad1c8fe023e7da1df1c147c4b444df" @@ -1614,7 +1878,7 @@ deep-extend@^0.6.0: resolved "https://registry.yarnpkg.com/deep-extend/-/deep-extend-0.6.0.tgz#c4fa7c95404a17a9c3e8ca7e1537312b736330ac" integrity sha512-LOHxIOaPYdHlJRtCQfDIVZtfw/ufM8+rVj649RIHzcm/vGwQRXFt6OPqIFWsm2XEMrNIEtWR64sY1LEKD2vAOA== -deep-is@~0.1.3: +deep-is@^0.1.3, deep-is@~0.1.3: version "0.1.3" resolved "https://registry.yarnpkg.com/deep-is/-/deep-is-0.1.3.tgz#b369d6fb5dbc13eecf524f91b070feedc357cf34" integrity sha1-s2nW+128E+7PUk+RsHD+7cNXzzQ= @@ -1648,6 +1912,16 @@ delegates@^1.0.0: resolved "https://registry.yarnpkg.com/delegates/-/delegates-1.0.0.tgz#84c6e159b81904fdca59a0ef44cd870d31250f9a" integrity sha1-hMbhWbgZBP3KWaDvRM2HDTElD5o= +detect-file@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/detect-file/-/detect-file-1.0.0.tgz#f0d66d03672a825cb1b73bdb3fe62310c8e552b7" + integrity sha1-8NZtA2cqglyxtzvbP+YjEMjlUrc= + +detect-indent@6.0.0: + version "6.0.0" + resolved "https://registry.yarnpkg.com/detect-indent/-/detect-indent-6.0.0.tgz#0abd0f549f69fc6659a254fe96786186b6f528fd" + integrity sha512-oSyFlqaTHCItVRGK5RmrmjB+CmaMOW7IaNA/kdxqhoa6d17j/5ce9O9eWXmV/KEdRwqpQA+Vqe8a8Bsybu4YnA== + detect-libc@^1.0.2: version "1.0.3" resolved "https://registry.yarnpkg.com/detect-libc/-/detect-libc-1.0.3.tgz#fa137c4bd698edf55cd5cd02ac559f91a4c4ba9b" @@ -1665,6 +1939,13 @@ dir-glob@^3.0.1: dependencies: path-type "^4.0.0" +doctrine@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/doctrine/-/doctrine-2.1.0.tgz#5cd01fc101621b42c4cd7f5d1a66243716d3f39d" + integrity sha512-35mSku4ZXK0vfCuHEDAwt55dg2jNajHZ1odvF+8SSr82EsZY4QmXfuWso8oEd8zRhVObSN18aM0CjSdoBX7zIw== + dependencies: + esutils "^2.0.2" + doctrine@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/doctrine/-/doctrine-3.0.0.tgz#addebead72a6574db783639dc87a121773973961" @@ -1687,10 +1968,10 @@ ecc-jsbn@~0.1.1: jsbn "~0.1.0" safer-buffer "^2.1.0" -electron-to-chromium@^1.3.723: - version "1.3.737" - resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.3.737.tgz#196f2e9656f4f3c31930750e1899c091b72d36b5" - integrity sha512-P/B84AgUSQXaum7a8m11HUsYL8tj9h/Pt5f7Hg7Ty6bm5DxlFq+e5+ouHUoNQMsKDJ7u4yGfI8mOErCmSH9wyg== +electron-to-chromium@^1.3.793: + version "1.3.801" + resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.3.801.tgz#f41c588e408ad1a4f794f91f38aa94a89c492f51" + integrity sha512-xapG8ekC+IAHtJrGBMQSImNuN+dm+zl7UP1YbhvTkwQn8zf/yYuoxfTSAEiJ9VDD+kjvXaAhNDPSxJ+VImtAJA== emoji-regex@^7.0.1: version "7.0.3" @@ -1702,23 +1983,42 @@ emoji-regex@^8.0.0: resolved "https://registry.yarnpkg.com/emoji-regex/-/emoji-regex-8.0.0.tgz#e818fd69ce5ccfcb404594f842963bf53164cc37" integrity sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A== -es-abstract@^1.18.0-next.1: - version "1.18.0-next.1" - resolved "https://registry.yarnpkg.com/es-abstract/-/es-abstract-1.18.0-next.1.tgz#6e3a0a4bda717e5023ab3b8e90bec36108d22c68" - integrity sha512-I4UGspA0wpZXWENrdA0uHbnhte683t3qT/1VFH9aX2dA5PPSf6QW5HHXf5HImaqPmjXaVeVk4RGWnaylmV7uAA== +enquirer@^2.3.5: + version "2.3.6" + resolved "https://registry.yarnpkg.com/enquirer/-/enquirer-2.3.6.tgz#2a7fe5dd634a1e4125a975ec994ff5456dc3734d" + integrity sha512-yjNnPr315/FjS4zIsUxYguYUPP2e1NK4d7E7ZOLiyYCcbFBiTMyID+2wvm2w6+pZ/odMA7cRkjhsPbltwBOrLg== + dependencies: + ansi-colors "^4.1.1" + +error-ex@^1.3.1: + version "1.3.2" + resolved "https://registry.yarnpkg.com/error-ex/-/error-ex-1.3.2.tgz#b4ac40648107fdcdcfae242f428bea8a14d4f1bf" + integrity sha512-7dFHNmqeFSEt2ZBsCriorKnn3Z2pj+fd9kmI6QoWw4//DL+icEBfc0U7qJCisqrTsKTjw4fNFy2pW9OqStD84g== + dependencies: + is-arrayish "^0.2.1" + +es-abstract@^1.18.0-next.1, es-abstract@^1.18.0-next.2, es-abstract@^1.18.2: + version "1.18.5" + resolved "https://registry.yarnpkg.com/es-abstract/-/es-abstract-1.18.5.tgz#9b10de7d4c206a3581fd5b2124233e04db49ae19" + integrity sha512-DDggyJLoS91CkJjgauM5c0yZMjiD1uK3KcaCeAmffGwZ+ODWzOkPN4QwRbsK5DOFf06fywmyLci3ZD8jLGhVYA== dependencies: + call-bind "^1.0.2" es-to-primitive "^1.2.1" function-bind "^1.1.1" + get-intrinsic "^1.1.1" has "^1.0.3" - has-symbols "^1.0.1" - is-callable "^1.2.2" - is-negative-zero "^2.0.0" - is-regex "^1.1.1" - object-inspect "^1.8.0" + has-symbols "^1.0.2" + internal-slot "^1.0.3" + is-callable "^1.2.3" + is-negative-zero "^2.0.1" + is-regex "^1.1.3" + is-string "^1.0.6" + object-inspect "^1.11.0" object-keys "^1.1.1" - object.assign "^4.1.1" - string.prototype.trimend "^1.0.1" - string.prototype.trimstart "^1.0.1" + object.assign "^4.1.2" + string.prototype.trimend "^1.0.4" + string.prototype.trimstart "^1.0.4" + unbox-primitive "^1.0.1" es-to-primitive@^1.2.1: version "1.2.1" @@ -1744,6 +2044,11 @@ escape-string-regexp@1.0.5, escape-string-regexp@^1.0.5: resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz#1b61c0562190a8dff6ae3bb2cf0200ca130b86d4" integrity sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ= +escape-string-regexp@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz#14ba83a5d373e3d311e5afca29cf5bfad965bf34" + integrity sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA== + escodegen@1.8.x: version "1.8.1" resolved "https://registry.yarnpkg.com/escodegen/-/escodegen-1.8.1.tgz#5a5b53af4693110bebb0867aa3430dd3b70a1018" @@ -1768,7 +2073,53 @@ escodegen@^1.11.1: optionalDependencies: source-map "~0.6.1" -eslint-scope@^5.0.0: +eslint-config-airbnb-base@^14.2.1: + version "14.2.1" + resolved "https://registry.yarnpkg.com/eslint-config-airbnb-base/-/eslint-config-airbnb-base-14.2.1.tgz#8a2eb38455dc5a312550193b319cdaeef042cd1e" + integrity sha512-GOrQyDtVEc1Xy20U7vsB2yAoB4nBlfH5HZJeatRXHleO+OS5Ot+MWij4Dpltw4/DyIkqUfqz1epfhVR5XWWQPA== + dependencies: + confusing-browser-globals "^1.0.10" + object.assign "^4.1.2" + object.entries "^1.1.2" + +eslint-import-resolver-node@^0.3.5: + version "0.3.5" + resolved "https://registry.yarnpkg.com/eslint-import-resolver-node/-/eslint-import-resolver-node-0.3.5.tgz#939bbb0f74e179e757ca87f7a4a890dabed18ac4" + integrity sha512-XMoPKjSpXbkeJ7ZZ9icLnJMTY5Mc1kZbCakHquaFsXPpyWOwK0TK6CODO+0ca54UoM9LKOxyUNnoVZRl8TeaAg== + dependencies: + debug "^3.2.7" + resolve "^1.20.0" + +eslint-module-utils@^2.6.2: + version "2.6.2" + resolved "https://registry.yarnpkg.com/eslint-module-utils/-/eslint-module-utils-2.6.2.tgz#94e5540dd15fe1522e8ffa3ec8db3b7fa7e7a534" + integrity sha512-QG8pcgThYOuqxupd06oYTZoNOGaUdTY1PqK+oS6ElF6vs4pBdk/aYxFVQQXzcrAqp9m7cl7lb2ubazX+g16k2Q== + dependencies: + debug "^3.2.7" + pkg-dir "^2.0.0" + +eslint-plugin-import@^2.22.1: + version "2.24.0" + resolved "https://registry.yarnpkg.com/eslint-plugin-import/-/eslint-plugin-import-2.24.0.tgz#697ffd263e24da5e84e03b282f5fb62251777177" + integrity sha512-Kc6xqT9hiYi2cgybOc0I2vC9OgAYga5o/rAFinam/yF/t5uBqxQbauNPMC6fgb640T/89P0gFoO27FOilJ/Cqg== + dependencies: + array-includes "^3.1.3" + array.prototype.flat "^1.2.4" + debug "^2.6.9" + doctrine "^2.1.0" + eslint-import-resolver-node "^0.3.5" + eslint-module-utils "^2.6.2" + find-up "^2.0.0" + has "^1.0.3" + is-core-module "^2.4.0" + minimatch "^3.0.4" + object.values "^1.1.3" + pkg-up "^2.0.0" + read-pkg-up "^3.0.0" + resolve "^1.20.0" + tsconfig-paths "^3.9.0" + +eslint-scope@^5.1.1: version "5.1.1" resolved "https://registry.yarnpkg.com/eslint-scope/-/eslint-scope-5.1.1.tgz#e786e59a66cb92b3f6c1fb0d508aab174848f48c" integrity sha512-2NxwbF/hZ0KpepYN0cNbo+FN6XoK7GaHlQhgx/hIZl6Va0bF45RQOOwhLIy8lQDbuCiadSLCBnH2CFYquit5bw== @@ -1776,69 +2127,77 @@ eslint-scope@^5.0.0: esrecurse "^4.3.0" estraverse "^4.1.1" -eslint-utils@^1.4.3: - version "1.4.3" - resolved "https://registry.yarnpkg.com/eslint-utils/-/eslint-utils-1.4.3.tgz#74fec7c54d0776b6f67e0251040b5806564e981f" - integrity sha512-fbBN5W2xdY45KulGXmLHZ3c3FHfVYmKg0IrAKGOkT/464PQsx2UeIzfz1RmEci+KLm1bBaAzZAh8+/E+XAeZ8Q== +eslint-utils@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/eslint-utils/-/eslint-utils-2.1.0.tgz#d2de5e03424e707dc10c74068ddedae708741b27" + integrity sha512-w94dQYoauyvlDc43XnGB8lU3Zt713vNChgt4EWwhXAP2XkBvndfxF0AgIqKOOasjPIPzj9JqgwkwbCYD0/V3Zg== dependencies: eslint-visitor-keys "^1.1.0" -eslint-visitor-keys@^1.0.0, eslint-visitor-keys@^1.1.0: +eslint-visitor-keys@^1.1.0, eslint-visitor-keys@^1.3.0: version "1.3.0" resolved "https://registry.yarnpkg.com/eslint-visitor-keys/-/eslint-visitor-keys-1.3.0.tgz#30ebd1ef7c2fdff01c3a4f151044af25fab0523e" integrity sha512-6J72N8UNa462wa/KFODt/PJ3IU60SDpC3QXC1Hjc1BXXpfL2C9R5+AU7jhe0F6GREqVMh4Juu+NY7xn+6dipUQ== -eslint@^6.8.0: - version "6.8.0" - resolved "https://registry.yarnpkg.com/eslint/-/eslint-6.8.0.tgz#62262d6729739f9275723824302fb227c8c93ffb" - integrity sha512-K+Iayyo2LtyYhDSYwz5D5QdWw0hCacNzyq1Y821Xna2xSJj7cijoLLYmLxTQgcgZ9mC61nryMy9S7GRbYpI5Ig== +eslint-visitor-keys@^2.0.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/eslint-visitor-keys/-/eslint-visitor-keys-2.1.0.tgz#f65328259305927392c938ed44eb0a5c9b2bd303" + integrity sha512-0rSmRBzXgDzIsD6mGdJgevzgezI534Cer5L/vyMX0kHzT/jiB43jRhd9YUlMGYLQy2zprNmoT8qasCGtY+QaKw== + +eslint@^7.32.0: + version "7.32.0" + resolved "https://registry.yarnpkg.com/eslint/-/eslint-7.32.0.tgz#c6d328a14be3fb08c8d1d21e12c02fdb7a2a812d" + integrity sha512-VHZ8gX+EDfz+97jGcgyGCyRia/dPOd6Xh9yPv8Bl1+SoaIwD+a/vlrOmGRUyOYu7MwUhc7CxqeaDZU13S4+EpA== dependencies: - "@babel/code-frame" "^7.0.0" + "@babel/code-frame" "7.12.11" + "@eslint/eslintrc" "^0.4.3" + "@humanwhocodes/config-array" "^0.5.0" ajv "^6.10.0" - chalk "^2.1.0" - cross-spawn "^6.0.5" + chalk "^4.0.0" + cross-spawn "^7.0.2" debug "^4.0.1" doctrine "^3.0.0" - eslint-scope "^5.0.0" - eslint-utils "^1.4.3" - eslint-visitor-keys "^1.1.0" - espree "^6.1.2" - esquery "^1.0.1" + enquirer "^2.3.5" + escape-string-regexp "^4.0.0" + eslint-scope "^5.1.1" + eslint-utils "^2.1.0" + eslint-visitor-keys "^2.0.0" + espree "^7.3.1" + esquery "^1.4.0" esutils "^2.0.2" - file-entry-cache "^5.0.1" + fast-deep-equal "^3.1.3" + file-entry-cache "^6.0.1" functional-red-black-tree "^1.0.1" - glob-parent "^5.0.0" - globals "^12.1.0" + glob-parent "^5.1.2" + globals "^13.6.0" ignore "^4.0.6" import-fresh "^3.0.0" imurmurhash "^0.1.4" - inquirer "^7.0.0" is-glob "^4.0.0" js-yaml "^3.13.1" json-stable-stringify-without-jsonify "^1.0.1" - levn "^0.3.0" - lodash "^4.17.14" + levn "^0.4.1" + lodash.merge "^4.6.2" minimatch "^3.0.4" - mkdirp "^0.5.1" natural-compare "^1.4.0" - optionator "^0.8.3" + optionator "^0.9.1" progress "^2.0.0" - regexpp "^2.0.1" - semver "^6.1.2" - strip-ansi "^5.2.0" - strip-json-comments "^3.0.1" - table "^5.2.3" + regexpp "^3.1.0" + semver "^7.2.1" + strip-ansi "^6.0.0" + strip-json-comments "^3.1.0" + table "^6.0.9" text-table "^0.2.0" v8-compile-cache "^2.0.3" -espree@^6.1.2: - version "6.2.1" - resolved "https://registry.yarnpkg.com/espree/-/espree-6.2.1.tgz#77fc72e1fd744a2052c20f38a5b575832e82734a" - integrity sha512-ysCxRQY3WaXJz9tdbWOwuWr5Y/XrPTGX9Kiz3yoUXwW0VZ4w30HTkQLaGx/+ttFjF8i+ACbArnB4ce68a9m5hw== +espree@^7.3.0, espree@^7.3.1: + version "7.3.1" + resolved "https://registry.yarnpkg.com/espree/-/espree-7.3.1.tgz#f2df330b752c6f55019f8bd89b7660039c1bbbb6" + integrity sha512-v3JCNCE64umkFpmkFGqzVKsOT0tN1Zr+ueqLZfpV1Ob8e+CEgPWa+OxCoGH3tnhimMKIaBm4m/vaRpJ/krRz2g== dependencies: - acorn "^7.1.1" - acorn-jsx "^5.2.0" - eslint-visitor-keys "^1.1.0" + acorn "^7.4.0" + acorn-jsx "^5.3.1" + eslint-visitor-keys "^1.3.0" esprima@2.7.x, esprima@^2.7.1: version "2.7.3" @@ -1850,10 +2209,10 @@ esprima@^4.0.0, esprima@^4.0.1: resolved "https://registry.yarnpkg.com/esprima/-/esprima-4.0.1.tgz#13b04cdb3e6c5d19df91ab6987a8695619b0aa71" integrity sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A== -esquery@^1.0.1: - version "1.3.1" - resolved "https://registry.yarnpkg.com/esquery/-/esquery-1.3.1.tgz#b78b5828aa8e214e29fb74c4d5b752e1c033da57" - integrity sha512-olpvt9QG0vniUBZspVRN6lwB7hOZoTRtT+jzR+tS4ffYx2mzbw+z0XCOk44aaLYKApNX5nMm+E+P6o25ip/DHQ== +esquery@^1.4.0: + version "1.4.0" + resolved "https://registry.yarnpkg.com/esquery/-/esquery-1.4.0.tgz#2148ffc38b82e8c7057dfed48425b3e61f0f24a5" + integrity sha512-cCDispWt5vHHtwMY2YrAQ4ibFkAL8RbH5YGBnZBc90MolvvfkkQcJro/aZiAQUlQ3qgrYS6D6v8Gc5G5CQsc9w== dependencies: estraverse "^5.1.0" @@ -1899,6 +2258,13 @@ esutils@^2.0.2: resolved "https://registry.yarnpkg.com/esutils/-/esutils-2.0.3.tgz#74d2eb4de0b8da1293711910d50775b9b710ef64" integrity sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g== +expand-tilde@^2.0.0, expand-tilde@^2.0.2: + version "2.0.2" + resolved "https://registry.yarnpkg.com/expand-tilde/-/expand-tilde-2.0.2.tgz#97e801aa052df02454de46b02bf621642cdc8502" + integrity sha1-l+gBqgUt8CRU3kawK/YhZCzchQI= + dependencies: + homedir-polyfill "^1.0.1" + extend@~3.0.2: version "3.0.2" resolved "https://registry.yarnpkg.com/extend/-/extend-3.0.2.tgz#f8b1136b4071fbd8eb140aff858b1019ec2915fa" @@ -1923,53 +2289,52 @@ extsprintf@^1.2.0: resolved "https://registry.yarnpkg.com/extsprintf/-/extsprintf-1.4.0.tgz#e2689f8f356fad62cca65a3a91c5df5f9551692f" integrity sha1-4mifjzVvrWLMplo6kcXfX5VRaS8= -fast-deep-equal@^3.1.1: +fast-deep-equal@^3.1.1, fast-deep-equal@^3.1.3: version "3.1.3" resolved "https://registry.yarnpkg.com/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz#3a7d56b559d6cbc3eb512325244e619a65c6c525" integrity sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q== fast-glob@^3.0.3: - version "3.2.4" - resolved "https://registry.yarnpkg.com/fast-glob/-/fast-glob-3.2.4.tgz#d20aefbf99579383e7f3cc66529158c9b98554d3" - integrity sha512-kr/Oo6PX51265qeuCYsyGypiO5uJFgBS0jksyG7FUeCyQzNwYnzrNIMR1NXfkZXsMYXYLRAHgISHBz8gQcxKHQ== + version "3.2.7" + resolved "https://registry.yarnpkg.com/fast-glob/-/fast-glob-3.2.7.tgz#fd6cb7a2d7e9aa7a7846111e85a196d6b2f766a1" + integrity sha512-rYGMRwip6lUMvYD3BTScMwT1HtAs2d71SMv66Vrxs0IekGZEjhM0pcMfjQPnknBt2zeCwQMEupiN02ZP4DiT1Q== dependencies: "@nodelib/fs.stat" "^2.0.2" "@nodelib/fs.walk" "^1.2.3" - glob-parent "^5.1.0" + glob-parent "^5.1.2" merge2 "^1.3.0" - micromatch "^4.0.2" - picomatch "^2.2.1" + micromatch "^4.0.4" fast-json-stable-stringify@^2.0.0: version "2.1.0" resolved "https://registry.yarnpkg.com/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz#874bf69c6f404c2b5d99c481341399fd55892633" integrity sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw== -fast-levenshtein@~2.0.6: +fast-levenshtein@^2.0.6, fast-levenshtein@~2.0.6: version "2.0.6" resolved "https://registry.yarnpkg.com/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz#3d8a5c66883a16a30ca8643e851f19baa7797917" integrity sha1-PYpcZog6FqMMqGQ+hR8Zuqd5eRc= fastq@^1.6.0: - version "1.10.0" - resolved "https://registry.yarnpkg.com/fastq/-/fastq-1.10.0.tgz#74dbefccade964932cdf500473ef302719c652bb" - integrity sha512-NL2Qc5L3iQEsyYzweq7qfgy5OtXCmGzGvhElGEd/SoFWEMOEczNh5s5ocaF01HDetxz+p8ecjNPA6cZxxIHmzA== + version "1.11.1" + resolved "https://registry.yarnpkg.com/fastq/-/fastq-1.11.1.tgz#5d8175aae17db61947f8b162cfc7f63264d22807" + integrity sha512-HOnr8Mc60eNYl1gzwp6r5RoUyAn5/glBolUzP/Ez6IFVPMPirxn/9phgL6zhOtaTy7ISwPvQ+wT+hfcRZh/bzw== dependencies: reusify "^1.0.4" -figures@^3.0.0: - version "3.2.0" - resolved "https://registry.yarnpkg.com/figures/-/figures-3.2.0.tgz#625c18bd293c604dc4a8ddb2febf0c88341746af" - integrity sha512-yaduQFRKLXYOGgEn6AZau90j3ggSOyiqXU0F9JZfeXYhNa+Jk4X+s45A2zg5jns87GAFa34BBm2kXw4XpNcbdg== +figures@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/figures/-/figures-2.0.0.tgz#3ab1a2d2a62c8bfb431a0c94cb797a2fce27c962" + integrity sha1-OrGi0qYsi/tDGgyUy3l6L84nyWI= dependencies: escape-string-regexp "^1.0.5" -file-entry-cache@^5.0.1: - version "5.0.1" - resolved "https://registry.yarnpkg.com/file-entry-cache/-/file-entry-cache-5.0.1.tgz#ca0f6efa6dd3d561333fb14515065c2fafdf439c" - integrity sha512-bCg29ictuBaKUwwArK4ouCaqDgLZcysCFLmM/Yn/FDoqndh/9vNuQfXRDvTuXKLxfD/JtZQGKFT8MGcJBK644g== +file-entry-cache@^6.0.1: + version "6.0.1" + resolved "https://registry.yarnpkg.com/file-entry-cache/-/file-entry-cache-6.0.1.tgz#211b2dd9659cb0394b073e7323ac3c933d522027" + integrity sha512-7Gps/XWymbLk2QLYK4NzpMOrYjMhdIxXuIvy2QBsLE6ljuodKvdkWs/cpyJJ3CVIVpH0Oi1Hvg1ovbMzLdFBBg== dependencies: - flat-cache "^2.0.1" + flat-cache "^3.0.4" fill-range@^7.0.1: version "7.0.1" @@ -1996,6 +2361,19 @@ find-cache-dir@^3.2.0: make-dir "^3.0.2" pkg-dir "^4.1.0" +find-node-modules@^2.1.2: + version "2.1.2" + resolved "https://registry.yarnpkg.com/find-node-modules/-/find-node-modules-2.1.2.tgz#57565a3455baf671b835bc6b2134a9b938b9c53c" + integrity sha512-x+3P4mbtRPlSiVE1Qco0Z4YLU8WFiFcuWTf3m75OV9Uzcfs2Bg+O9N+r/K0AnmINBW06KpfqKwYJbFlFq4qNug== + dependencies: + findup-sync "^4.0.0" + merge "^2.1.0" + +find-root@1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/find-root/-/find-root-1.1.0.tgz#abcfc8ba76f708c42a97b3d685b7e9450bfb9ce4" + integrity sha512-NKfW6bec6GfKc0SGx1e07QZY9PE99u0Bft/0rzSD5k3sO/vwkVUpDUKVm5Gpp5Ue3YfShPFTX2070tDs5kB9Ng== + find-up@3.0.0, find-up@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/find-up/-/find-up-3.0.0.tgz#49169f1d7993430646da61ecc5ae355c21c97b73" @@ -2003,6 +2381,13 @@ find-up@3.0.0, find-up@^3.0.0: dependencies: locate-path "^3.0.0" +find-up@^2.0.0, find-up@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/find-up/-/find-up-2.1.0.tgz#45d1b7e506c717ddd482775a2b77920a3c0c57a7" + integrity sha1-RdG35QbHF93UgndaK3eSCjwMV6c= + dependencies: + locate-path "^2.0.0" + find-up@^4.0.0, find-up@^4.1.0: version "4.1.0" resolved "https://registry.yarnpkg.com/find-up/-/find-up-4.1.0.tgz#97afe7d6cdc0bc5928584b7c8d7b16e8a9aa5d19" @@ -2011,14 +2396,23 @@ find-up@^4.0.0, find-up@^4.1.0: locate-path "^5.0.0" path-exists "^4.0.0" -flat-cache@^2.0.1: - version "2.0.1" - resolved "https://registry.yarnpkg.com/flat-cache/-/flat-cache-2.0.1.tgz#5d296d6f04bda44a4630a301413bdbc2ec085ec0" - integrity sha512-LoQe6yDuUMDzQAEH8sgmh4Md6oZnc/7PjtwjNFSzveXqSHt6ka9fPBuso7IGf9Rz4uqnSnWiFH2B/zj24a5ReA== +findup-sync@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/findup-sync/-/findup-sync-4.0.0.tgz#956c9cdde804052b881b428512905c4a5f2cdef0" + integrity sha512-6jvvn/12IC4quLBL1KNokxC7wWTvYncaVUYSoxWw7YykPLuRrnv4qdHcSOywOI5RpkOVGeQRtWM8/q+G6W6qfQ== dependencies: - flatted "^2.0.0" - rimraf "2.6.3" - write "1.0.3" + detect-file "^1.0.0" + is-glob "^4.0.0" + micromatch "^4.0.2" + resolve-dir "^1.0.1" + +flat-cache@^3.0.4: + version "3.0.4" + resolved "https://registry.yarnpkg.com/flat-cache/-/flat-cache-3.0.4.tgz#61b0338302b2fe9f957dcc32fc2a87f1c3048b11" + integrity sha512-dm9s5Pw7Jc0GvMYbshN6zchCA9RgQlzzEZX3vylR9IqFfS8XciblUXOKfW6SiuJ0e13eDYZoZV5wdrev7P3Nwg== + dependencies: + flatted "^3.1.0" + rimraf "^3.0.2" flat@^4.1.0: version "4.1.1" @@ -2027,10 +2421,10 @@ flat@^4.1.0: dependencies: is-buffer "~2.0.3" -flatted@^2.0.0: - version "2.0.2" - resolved "https://registry.yarnpkg.com/flatted/-/flatted-2.0.2.tgz#4575b21e2bcee7434aa9be662f4b7b5f9c2b5138" - integrity sha512-r5wGx7YeOwNWNlCA0wQ86zKyDLMQr+/RB8xy74M4hTphfmjlijTSSXGuH8rnvKZnfT9i+75zmd8jcKdMR4O6jA== +flatted@^3.1.0: + version "3.2.2" + resolved "https://registry.yarnpkg.com/flatted/-/flatted-3.2.2.tgz#64bfed5cb68fe3ca78b3eb214ad97b63bedce561" + integrity sha512-JaTY/wtrcSyvXJl4IMFHPKyFur1sE9AUqc0QnhOaJ0CxHtAoIV8pYDzeEfAaNEtGkOfq4gr3LBFmdXW5mOQFnA== foreground-child@^2.0.0: version "2.0.0" @@ -2059,7 +2453,7 @@ fromentries@^1.2.0: resolved "https://registry.yarnpkg.com/fromentries/-/fromentries-1.3.2.tgz#e4bca6808816bf8f93b52750f1127f5a6fd86e3a" integrity sha512-cHEpEQHUg0f8XdtZCc2ZAhrHzKzT0MrFUTcvx+hfxYu7rGMDc5SKoXFh+n4YigxsHXRzc6OrCshdR1bWH6HHyg== -fs-extra@^8.1.0: +fs-extra@8.1.0, fs-extra@^8.1.0: version "8.1.0" resolved "https://registry.yarnpkg.com/fs-extra/-/fs-extra-8.1.0.tgz#49d43c45a88cd9677668cb7be1b46efdb8d2e1c0" integrity sha512-yhlQgA6mnOJUKOsRUFsgJdQCvkKhcz8tlZG5HBQfReYZy46OwLcY+Zia0mtdHsOo9y/hP+CxMN0TU9QxoOtG4g== @@ -2068,7 +2462,7 @@ fs-extra@^8.1.0: jsonfile "^4.0.0" universalify "^0.1.0" -fs-minipass@^1.2.5: +fs-minipass@^1.2.7: version "1.2.7" resolved "https://registry.yarnpkg.com/fs-minipass/-/fs-minipass-1.2.7.tgz#ccff8570841e7fe4265693da88936c55aed7f7c7" integrity sha512-GWSSJGFy4e9GUeCcbIkED+bgAoFyj7XF1mV8rma3QW4NIqX9Kyx79N/PF61H5udOV3aY1IaMLs6pGbH71nlCTA== @@ -2080,11 +2474,16 @@ fs.realpath@^1.0.0: resolved "https://registry.yarnpkg.com/fs.realpath/-/fs.realpath-1.0.0.tgz#1504ad2523158caa40db4a2787cb01411994ea4f" integrity sha1-FQStJSMVjKpA20onh8sBQRmU6k8= -fsevents@~2.1.1, fsevents@~2.1.2: +fsevents@~2.1.1: version "2.1.3" resolved "https://registry.yarnpkg.com/fsevents/-/fsevents-2.1.3.tgz#fb738703ae8d2f9fe900c33836ddebee8b97f23e" integrity sha512-Auw9a4AxqWpa9GUfj370BMPzzyncfBABW8Mab7BGWBYDj4Isgq+cDKtx0i6u9jcX9pQDnswsaaOTgTmA5pEjuQ== +fsevents@~2.3.2: + version "2.3.2" + resolved "https://registry.yarnpkg.com/fsevents/-/fsevents-2.3.2.tgz#8a526f78b8fdf4623b709e0b975c52c24c02fd1a" + integrity sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA== + function-bind@^1.1.1: version "1.1.1" resolved "https://registry.yarnpkg.com/function-bind/-/function-bind-1.1.1.tgz#a56899d3ea3c9bab874bb9773b7c5ede92f4895d" @@ -2109,7 +2508,7 @@ gauge@~2.7.3: strip-ansi "^3.0.1" wide-align "^1.1.0" -gensync@^1.0.0-beta.1: +gensync@^1.0.0-beta.2: version "1.0.0-beta.2" resolved "https://registry.yarnpkg.com/gensync/-/gensync-1.0.0-beta.2.tgz#32a6ee76c3d7f52d46b2b1ae5d93fea8580a25e0" integrity sha512-3hN7NaskYvMDLQY55gnW3NQ+mesEAepTqlg+VEbj7zzqEMBVNhzcGYYeqFo/TlYz6eQiFcp1HcsCZO+nGgS8zg== @@ -2124,10 +2523,10 @@ get-func-name@^2.0.0: resolved "https://registry.yarnpkg.com/get-func-name/-/get-func-name-2.0.0.tgz#ead774abee72e20409433a066366023dd6887a41" integrity sha1-6td0q+5y4gQJQzoGY2YCPdaIekE= -get-intrinsic@^1.0.0: - version "1.0.2" - resolved "https://registry.yarnpkg.com/get-intrinsic/-/get-intrinsic-1.0.2.tgz#6820da226e50b24894e08859469dc68361545d49" - integrity sha512-aeX0vrFm21ILl3+JpFFRNe9aUvp6VFZb2/CTbgLb8j75kOhvoNYjt9d8KA/tJG4gSo8nzEDedRl0h7vDmBYRVg== +get-intrinsic@^1.0.2, get-intrinsic@^1.1.0, get-intrinsic@^1.1.1: + version "1.1.1" + resolved "https://registry.yarnpkg.com/get-intrinsic/-/get-intrinsic-1.1.1.tgz#15f59f376f855c446963948f0d24cd3637b4abc6" + integrity sha512-kWZrnVM42QCiEA2Ig1bG8zjoIMOgxWwYCEeNdwY6Tv/cOSeGpcoX4pXHfKUxNKVoArnrEr2e9srnAxxGIraS9Q== dependencies: function-bind "^1.1.1" has "^1.0.3" @@ -2145,7 +2544,7 @@ getpass@^0.1.1: dependencies: assert-plus "^1.0.0" -glob-parent@^5.0.0, glob-parent@^5.1.0, glob-parent@~5.1.0: +glob-parent@^5.1.2, glob-parent@~5.1.0: version "5.1.2" resolved "https://registry.yarnpkg.com/glob-parent/-/glob-parent-5.1.2.tgz#869832c58034fe68a4093c17dc15e8340d8401c4" integrity sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow== @@ -2164,10 +2563,22 @@ glob@7.1.3: once "^1.3.0" path-is-absolute "^1.0.0" -glob@7.1.6, glob@^7.1.3, glob@^7.1.4, glob@^7.1.6: - version "7.1.6" - resolved "https://registry.yarnpkg.com/glob/-/glob-7.1.6.tgz#141f33b81a7c2492e125594307480c46679278a6" - integrity sha512-LwaxwyZ72Lk7vZINtNNrywX0ZuLyStrdDtabefZKAY5ZGJhVtgdznluResxNmPitE0SAO+O26sWTHeKSI2wMBA== +glob@7.1.4: + version "7.1.4" + resolved "https://registry.yarnpkg.com/glob/-/glob-7.1.4.tgz#aa608a2f6c577ad357e1ae5a5c26d9a8d1969255" + integrity sha512-hkLPepehmnKk41pUGm3sYxoFs/umurYfYJCerbXEyFIWcAzvpipAgVkBqqT9RBKMGjnq6kMuyYwha6csxbiM1A== + dependencies: + fs.realpath "^1.0.0" + inflight "^1.0.4" + inherits "2" + minimatch "^3.0.4" + once "^1.3.0" + path-is-absolute "^1.0.0" + +glob@7.1.7, glob@^7.1.3, glob@^7.1.4, glob@^7.1.6: + version "7.1.7" + resolved "https://registry.yarnpkg.com/glob/-/glob-7.1.7.tgz#3b193e9233f01d42d0b3f78294bbeeb418f94a90" + integrity sha512-OvD9ENzPLbegENnYP5UUfJIirTg4+XwMWGaQfQTY0JenxNvvIKP3U3/tAQSPIu/lHxXYSZmpXlUHeqAIdKzBLQ== dependencies: fs.realpath "^1.0.0" inflight "^1.0.4" @@ -2187,17 +2598,44 @@ glob@^5.0.15: once "^1.3.0" path-is-absolute "^1.0.0" +global-dirs@^0.1.1: + version "0.1.1" + resolved "https://registry.yarnpkg.com/global-dirs/-/global-dirs-0.1.1.tgz#b319c0dd4607f353f3be9cca4c72fc148c49f445" + integrity sha1-sxnA3UYH81PzvpzKTHL8FIxJ9EU= + dependencies: + ini "^1.3.4" + +global-modules@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/global-modules/-/global-modules-1.0.0.tgz#6d770f0eb523ac78164d72b5e71a8877265cc3ea" + integrity sha512-sKzpEkf11GpOFuw0Zzjzmt4B4UZwjOcG757PPvrfhxcLFbq0wpsgpOqxpxtxFiCG4DtG93M6XRVbF2oGdev7bg== + dependencies: + global-prefix "^1.0.1" + is-windows "^1.0.1" + resolve-dir "^1.0.0" + +global-prefix@^1.0.1: + version "1.0.2" + resolved "https://registry.yarnpkg.com/global-prefix/-/global-prefix-1.0.2.tgz#dbf743c6c14992593c655568cb66ed32c0122ebe" + integrity sha1-2/dDxsFJklk8ZVVoy2btMsASLr4= + dependencies: + expand-tilde "^2.0.2" + homedir-polyfill "^1.0.1" + ini "^1.3.4" + is-windows "^1.0.1" + which "^1.2.14" + globals@^11.1.0: version "11.12.0" resolved "https://registry.yarnpkg.com/globals/-/globals-11.12.0.tgz#ab8795338868a0babd8525758018c2a7eb95c42e" integrity sha512-WOBp/EEGUiIsJSp7wcv/y6MO+lV9UoncWqxuFfm8eBwzWNgyfBd6Gz+IeKQ9jCmyhoH99g15M3T+QaVHFjizVA== -globals@^12.1.0: - version "12.4.0" - resolved "https://registry.yarnpkg.com/globals/-/globals-12.4.0.tgz#a18813576a41b00a24a97e7f815918c2e19925f8" - integrity sha512-BWICuzzDvDoH54NHKCseDanAhE3CeDorgDL5MT6LMXXj2WCnd9UC2szdk4AWLfjdgNBCXLUanXYcpBBKOSWGwg== +globals@^13.6.0, globals@^13.9.0: + version "13.10.0" + resolved "https://registry.yarnpkg.com/globals/-/globals-13.10.0.tgz#60ba56c3ac2ca845cfbf4faeca727ad9dd204676" + integrity sha512-piHC3blgLGFjvOuMmWZX60f+na1lXFDhQXBf1UYp2fXPXqvEUbOhNwi6BsQ0bQishwedgnjkwv1d9zKf+MWw3g== dependencies: - type-fest "^0.8.1" + type-fest "^0.20.2" globby@10.0.1: version "10.0.1" @@ -2213,10 +2651,10 @@ globby@10.0.1: merge2 "^1.2.3" slash "^3.0.0" -graceful-fs@^4.1.15, graceful-fs@^4.1.6, graceful-fs@^4.2.0: - version "4.2.4" - resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.2.4.tgz#2256bde14d3632958c465ebc96dc467ca07a29fb" - integrity sha512-WjKPNJF79dtJAVniUlGGWHYGz2jWxT6VhN/4m1NdkbZ2nOsEF+cI1Edgql5zCRhs/VsQYRvrXctxktVXZUkixw== +graceful-fs@^4.1.15, graceful-fs@^4.1.2, graceful-fs@^4.1.6, graceful-fs@^4.2.0: + version "4.2.8" + resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.2.8.tgz#e412b8d33f5e006593cbd3cee6df9f2cebbe802a" + integrity sha512-qkIilPUYcNhJpd33n0GBXTB1MMPp14TxEsEs0pTrsSVucApsYzW5V+Q8Qxhik6KU3evy+qkAAowTByymK0avdg== growl@1.10.5: version "1.10.5" @@ -2248,6 +2686,11 @@ har-validator@~5.1.3: ajv "^6.12.3" har-schema "^2.0.0" +has-bigints@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/has-bigints/-/has-bigints-1.0.1.tgz#64fe6acb020673e3b78db035a5af69aa9d07b113" + integrity sha512-LSBS2LjbNBTf6287JEbEzvJgftkF5qFkmCo9hDRpAzKhUOlJ+hx8dd4USs00SgsUNwc4617J9ki5YtEClM2ffA== + has-flag@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/has-flag/-/has-flag-1.0.0.tgz#9d9e793165ce017a00f00418c43f942a7b1d11fa" @@ -2263,10 +2706,17 @@ has-flag@^4.0.0: resolved "https://registry.yarnpkg.com/has-flag/-/has-flag-4.0.0.tgz#944771fd9c81c81265c4d6941860da06bb59479b" integrity sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ== -has-symbols@^1.0.0, has-symbols@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/has-symbols/-/has-symbols-1.0.1.tgz#9f5214758a44196c406d9bd76cebf81ec2dd31e8" - integrity sha512-PLcsoqu++dmEIZB+6totNFKq/7Do+Z0u4oT0zKOJNl3lYK6vGwwu2hjHs+68OEZbTjiUE9bgOABXbP/GvrS0Kg== +has-symbols@^1.0.0, has-symbols@^1.0.1, has-symbols@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/has-symbols/-/has-symbols-1.0.2.tgz#165d3070c00309752a1236a479331e3ac56f1423" + integrity sha512-chXa79rL/UC2KlX17jo3vRGz0azaWEx5tGqZg5pO3NUyEJVB17dMruQlzCCOfUvElghKcm5194+BCRvi2Rv/Gw== + +has-tostringtag@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/has-tostringtag/-/has-tostringtag-1.0.0.tgz#7e133818a7d394734f941e73c3d3f9291e658b25" + integrity sha512-kFjcSNhnlGV1kyoGk7OXKSawH5JOb/LzUc5w9B02hOTO0dfFRjbHQKvg1d6cf3HbeUmtU9VbbV3qzZ2Teh97WQ== + dependencies: + has-symbols "^1.0.2" has-unicode@^2.0.0: version "2.0.1" @@ -2293,6 +2743,18 @@ he@1.2.0: resolved "https://registry.yarnpkg.com/he/-/he-1.2.0.tgz#84ae65fa7eafb165fddb61566ae14baf05664f0f" integrity sha512-F/1DnUGPopORZi0ni+CvrCgHQ5FyEAHRLSApuYWMmrbSwoN2Mn/7k+Gl38gJnR7yyDZk6WLXwiGod1JOWNDKGw== +homedir-polyfill@^1.0.1: + version "1.0.3" + resolved "https://registry.yarnpkg.com/homedir-polyfill/-/homedir-polyfill-1.0.3.tgz#743298cef4e5af3e194161fbadcc2151d3a058e8" + integrity sha512-eSmmWE5bZTK2Nou4g0AI3zZ9rswp7GRKoKXS1BLUkvPviOqs4YTN1djQIqrXy9k5gEtdLPy86JjRwsNM9tnDcA== + dependencies: + parse-passwd "^1.0.0" + +hosted-git-info@^2.1.4: + version "2.8.9" + resolved "https://registry.yarnpkg.com/hosted-git-info/-/hosted-git-info-2.8.9.tgz#dffc0bf9a21c02209090f2aa69429e1414daf3f9" + integrity sha512-mxIDAb9Lsm6DoOJ7xH+5+X4y1LU/4Hi50L9C5sIswK3JzULS4bwk1FvjdBgvYR4bzT4tuUQiC15FE2f5HbLvYw== + html-encoding-sniffer@^1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/html-encoding-sniffer/-/html-encoding-sniffer-1.0.2.tgz#e70d84b94da53aa375e11fe3a351be6642ca46f8" @@ -2322,9 +2784,9 @@ iconv-lite@0.4.24, iconv-lite@^0.4.24, iconv-lite@^0.4.4: safer-buffer ">= 2.1.2 < 3" ignore-walk@^3.0.1: - version "3.0.3" - resolved "https://registry.yarnpkg.com/ignore-walk/-/ignore-walk-3.0.3.tgz#017e2447184bfeade7c238e4aefdd1e8f95b1e37" - integrity sha512-m7o6xuOaT1aqheYHKf8W6J5pYH85ZI9w077erOzLje3JsB1gkafkAhHHY19dqjulgIZHFm32Cp5uNZgcQqdJKw== + version "3.0.4" + resolved "https://registry.yarnpkg.com/ignore-walk/-/ignore-walk-3.0.4.tgz#c9a09f69b7c7b479a5d74ac1a3c0d4236d2a6335" + integrity sha512-PY6Ii8o1jMRA1z4F2hRkH/xN59ox43DavKvD3oDpfurRlOJyAHpifIwpbdv1n4jt4ov0jSpw3kQ4GhJnpBL6WQ== dependencies: minimatch "^3.0.4" @@ -2338,7 +2800,7 @@ ignore@^5.1.1: resolved "https://registry.yarnpkg.com/ignore/-/ignore-5.1.8.tgz#f150a8b50a34289b33e22f5889abd4d8016f0e57" integrity sha512-BMpfD7PpiETpBl/A6S498BaIJ6Y/ABT93ETbby2fP00v4EbvPBXWEoaR1UBPKs3iR53pJY7EtZk5KACI57i1Uw== -import-fresh@^3.0.0: +import-fresh@^3.0.0, import-fresh@^3.2.1: version "3.3.0" resolved "https://registry.yarnpkg.com/import-fresh/-/import-fresh-3.3.0.tgz#37162c25fcb9ebaa2e6e53d5b4d88ce17d9e0c2b" integrity sha512-veYYhQa+D1QBKznvhUHxb8faxlrwUnxseDAbAp457E0wLNio2bOSKnjYDhMj+YiAq61xrMGhQk9iXVk5FzgQMw== @@ -2369,35 +2831,54 @@ inherits@2, inherits@~2.0.3: resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.4.tgz#0fa2c64f932917c3433a0ded55363aae37416b7c" integrity sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ== -ini@~1.3.0: +ini@^1.3.4, ini@~1.3.0: version "1.3.8" resolved "https://registry.yarnpkg.com/ini/-/ini-1.3.8.tgz#a29da425b48806f34767a4efce397269af28432c" integrity sha512-JV/yugV2uzW5iMRSiZAyDtQd+nxtUnjeLt0acNdw98kKLrvuRVyB80tsREOE7yvGVgalhZ6RNXCmEHkUKBKxew== -inquirer@^7.0.0: - version "7.3.3" - resolved "https://registry.yarnpkg.com/inquirer/-/inquirer-7.3.3.tgz#04d176b2af04afc157a83fd7c100e98ee0aad003" - integrity sha512-JG3eIAj5V9CwcGvuOmoo6LB9kbAYT8HXffUl6memuszlwDC/qvFAJw49XJ5NROSFNPxp3iQg1GqkFhaY/CR0IA== +inquirer@6.5.2: + version "6.5.2" + resolved "https://registry.yarnpkg.com/inquirer/-/inquirer-6.5.2.tgz#ad50942375d036d327ff528c08bd5fab089928ca" + integrity sha512-cntlB5ghuB0iuO65Ovoi8ogLHiWGs/5yNrtUcKjFhSSiVeAIVpD7koaSU9RM8mpXw5YDi9RdYXGQMaOURB7ycQ== dependencies: - ansi-escapes "^4.2.1" - chalk "^4.1.0" - cli-cursor "^3.1.0" - cli-width "^3.0.0" + ansi-escapes "^3.2.0" + chalk "^2.4.2" + cli-cursor "^2.1.0" + cli-width "^2.0.0" external-editor "^3.0.3" - figures "^3.0.0" - lodash "^4.17.19" - mute-stream "0.0.8" - run-async "^2.4.0" - rxjs "^6.6.0" - string-width "^4.1.0" - strip-ansi "^6.0.0" + figures "^2.0.0" + lodash "^4.17.12" + mute-stream "0.0.7" + run-async "^2.2.0" + rxjs "^6.4.0" + string-width "^2.1.0" + strip-ansi "^5.1.0" through "^2.3.6" +internal-slot@^1.0.3: + version "1.0.3" + resolved "https://registry.yarnpkg.com/internal-slot/-/internal-slot-1.0.3.tgz#7347e307deeea2faac2ac6205d4bc7d34967f59c" + integrity sha512-O0DB1JC/sPyZl7cIo78n5dR7eUSwwpYPiXRhTzNxZVAMUuB8vlnRFyLxdrVToks6XPLVnFfbzaVd5WLjhgg+vA== + dependencies: + get-intrinsic "^1.1.0" + has "^1.0.3" + side-channel "^1.0.4" + ip-regex@^2.1.0: version "2.1.0" resolved "https://registry.yarnpkg.com/ip-regex/-/ip-regex-2.1.0.tgz#fa78bf5d2e6913c911ce9f819ee5146bb6d844e9" integrity sha1-+ni/XS5pE8kRzp+BnuUUa7bYROk= +is-arrayish@^0.2.1: + version "0.2.1" + resolved "https://registry.yarnpkg.com/is-arrayish/-/is-arrayish-0.2.1.tgz#77c99840527aa8ecb1a8ba697b80645a7a926a9d" + integrity sha1-d8mYQFJ6qOyxqLppe4BkWnqSap0= + +is-bigint@^1.0.1: + version "1.0.3" + resolved "https://registry.yarnpkg.com/is-bigint/-/is-bigint-1.0.3.tgz#fc9d9e364210480675653ddaea0518528d49a581" + integrity sha512-ZU538ajmYJmzysE5yU4Y7uIrPQ2j704u+hXFiIPQExpqzzUbpe5jCPdTfmz7jXRxZdvjY3KZ3ZNenoXQovX+Dg== + is-binary-path@~2.1.0: version "2.1.0" resolved "https://registry.yarnpkg.com/is-binary-path/-/is-binary-path-2.1.0.tgz#ea1f7f3b80f064236e83470f86c09c254fb45b09" @@ -2405,27 +2886,37 @@ is-binary-path@~2.1.0: dependencies: binary-extensions "^2.0.0" +is-boolean-object@^1.1.0: + version "1.1.2" + resolved "https://registry.yarnpkg.com/is-boolean-object/-/is-boolean-object-1.1.2.tgz#5c6dc200246dd9321ae4b885a114bb1f75f63719" + integrity sha512-gDYaKHJmnj4aWxyj6YHyXVpdQawtVLHU5cb+eztPGczf6cjuTdwve5ZIEfgXqH4e57An1D1AKf8CZ3kYrQRqYA== + dependencies: + call-bind "^1.0.2" + has-tostringtag "^1.0.0" + is-buffer@~2.0.3: version "2.0.5" resolved "https://registry.yarnpkg.com/is-buffer/-/is-buffer-2.0.5.tgz#ebc252e400d22ff8d77fa09888821a24a658c191" integrity sha512-i2R6zNFDwgEHJyQUtJEk0XFi1i0dPFn/oqjK3/vPCcDeJvW5NQ83V8QbicfF1SupOaB0h8ntgBC2YiE7dfyctQ== -is-callable@^1.1.4, is-callable@^1.2.2: - version "1.2.2" - resolved "https://registry.yarnpkg.com/is-callable/-/is-callable-1.2.2.tgz#c7c6715cd22d4ddb48d3e19970223aceabb080d9" - integrity sha512-dnMqspv5nU3LoewK2N/y7KLtxtakvTuaCsU9FU50/QDmdbHNy/4/JuRtMHqRU22o3q+W89YQndQEeCVwK+3qrA== +is-callable@^1.1.4, is-callable@^1.2.3: + version "1.2.4" + resolved "https://registry.yarnpkg.com/is-callable/-/is-callable-1.2.4.tgz#47301d58dd0259407865547853df6d61fe471945" + integrity sha512-nsuwtxZfMX67Oryl9LCQ+upnC0Z0BgpwntpS89m1H/TLF0zNfzfLMV/9Wa/6MZsj0acpEjAO0KF1xT6ZdLl95w== -is-core-module@^2.1.0: - version "2.2.0" - resolved "https://registry.yarnpkg.com/is-core-module/-/is-core-module-2.2.0.tgz#97037ef3d52224d85163f5597b2b63d9afed981a" - integrity sha512-XRAfAdyyY5F5cOXn7hYQDqh2Xmii+DEfIcQGxK/uNwMHhIkPWO0g8msXcbzLe+MpGoR951MlqM/2iIlU4vKDdQ== +is-core-module@^2.2.0, is-core-module@^2.4.0: + version "2.5.0" + resolved "https://registry.yarnpkg.com/is-core-module/-/is-core-module-2.5.0.tgz#f754843617c70bfd29b7bd87327400cda5c18491" + integrity sha512-TXCMSDsEHMEEZ6eCA8rwRDbLu55MRGmrctljsBX/2v1d9/GzqHOxW5c5oPSgrUt2vBFXebu9rGqckXGPWOlYpg== dependencies: has "^1.0.3" is-date-object@^1.0.1: - version "1.0.2" - resolved "https://registry.yarnpkg.com/is-date-object/-/is-date-object-1.0.2.tgz#bda736f2cd8fd06d32844e7743bfa7494c3bfd7e" - integrity sha512-USlDT524woQ08aoZFzh3/Z6ch9Y/EWXEHQ/AaRN0SkKq4t2Jw2R2339tSXmwuVoY7LLlBCbOIlx2myP/L5zk0g== + version "1.0.5" + resolved "https://registry.yarnpkg.com/is-date-object/-/is-date-object-1.0.5.tgz#0841d5536e724c25597bf6ea62e1bd38298df31f" + integrity sha512-9YQaSxsAiSwcvS33MBk3wTCVnWK+HhF8VZR2jRxehM16QcVOdHqPn4VPHmRK4lSr38n9JriurInLcP90xsYNfQ== + dependencies: + has-tostringtag "^1.0.0" is-extglob@^2.1.1: version "2.1.1" @@ -2461,16 +2952,30 @@ is-module@^1.0.0: resolved "https://registry.yarnpkg.com/is-module/-/is-module-1.0.0.tgz#3258fb69f78c14d5b815d664336b4cffb6441591" integrity sha1-Mlj7afeMFNW4FdZkM2tM/7ZEFZE= -is-negative-zero@^2.0.0: +is-negative-zero@^2.0.1: version "2.0.1" resolved "https://registry.yarnpkg.com/is-negative-zero/-/is-negative-zero-2.0.1.tgz#3de746c18dda2319241a53675908d8f766f11c24" integrity sha512-2z6JzQvZRa9A2Y7xC6dQQm4FSTSTNWjKIYYTt4246eMTJmIo0Q+ZyOsU66X8lxK1AbB92dFeglPLrhwpeRKO6w== +is-number-object@^1.0.4: + version "1.0.6" + resolved "https://registry.yarnpkg.com/is-number-object/-/is-number-object-1.0.6.tgz#6a7aaf838c7f0686a50b4553f7e54a96494e89f0" + integrity sha512-bEVOqiRcvo3zO1+G2lVMy+gkkEm9Yh7cDMRusKKu5ZJKPUYSJwICTKZrNKHA2EbSP0Tu0+6B/emsYNHZyn6K8g== + dependencies: + has-tostringtag "^1.0.0" + is-number@^7.0.0: version "7.0.0" resolved "https://registry.yarnpkg.com/is-number/-/is-number-7.0.0.tgz#7535345b896734d5f80c4d06c50955527a14f12b" integrity sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng== +is-plain-object@^2.0.4: + version "2.0.4" + resolved "https://registry.yarnpkg.com/is-plain-object/-/is-plain-object-2.0.4.tgz#2c163b3fafb1b606d9d17928f05c2a1c38e07677" + integrity sha512-h5PpgXkWitc38BBMYawTYMWJHFZJVnBquFE57xFpjB8pJFiF6gZ+bU+WyI/yqXiFR5mdLsgYNaPe8uao6Uv9Og== + dependencies: + isobject "^3.0.1" + is-plain-object@^3.0.0: version "3.0.1" resolved "https://registry.yarnpkg.com/is-plain-object/-/is-plain-object-3.0.1.tgz#662d92d24c0aa4302407b0d45d21f2251c85f85b" @@ -2483,31 +2988,44 @@ is-reference@^1.2.1: dependencies: "@types/estree" "*" -is-regex@^1.1.1: - version "1.1.1" - resolved "https://registry.yarnpkg.com/is-regex/-/is-regex-1.1.1.tgz#c6f98aacc546f6cec5468a07b7b153ab564a57b9" - integrity sha512-1+QkEcxiLlB7VEyFtyBg94e08OAsvq7FUBgApTq/w2ymCLyKJgDPsybBENVtA7XCQEgEXxKPonG+mvYRxh/LIg== +is-regex@^1.1.3: + version "1.1.4" + resolved "https://registry.yarnpkg.com/is-regex/-/is-regex-1.1.4.tgz#eef5663cd59fa4c0ae339505323df6854bb15958" + integrity sha512-kvRdxDsxZjhzUX07ZnLydzS1TU/TJlTUHHY4YLL87e37oUA49DfkLqgy+VjFocowy29cKvcSiu+kIv728jTTVg== dependencies: - has-symbols "^1.0.1" + call-bind "^1.0.2" + has-tostringtag "^1.0.0" is-stream@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/is-stream/-/is-stream-2.0.0.tgz#bde9c32680d6fae04129d6ac9d921ce7815f78e3" - integrity sha512-XCoy+WlUr7d1+Z8GgSuXmpuUFC9fOhRXglJMx+dwLKTkL44Cjd4W1Z5P+BQZpr+cR93aGP4S/s7Ftw6Nd/kiEw== + version "2.0.1" + resolved "https://registry.yarnpkg.com/is-stream/-/is-stream-2.0.1.tgz#fac1e3d53b97ad5a9d0ae9cef2389f5810a5c077" + integrity sha512-hFoiJiTl63nn+kstHGBtewWSKnQLpyb155KHheA1l39uvtO9nWIop1p3udqPcUd/xbF1VLMO4n7OI6p7RbngDg== -is-symbol@^1.0.2: - version "1.0.3" - resolved "https://registry.yarnpkg.com/is-symbol/-/is-symbol-1.0.3.tgz#38e1014b9e6329be0de9d24a414fd7441ec61937" - integrity sha512-OwijhaRSgqvhm/0ZdAcXNZt9lYdKFpcRDT5ULUuYXPoT794UNOdU+gpT6Rzo7b4V2HUl/op6GqY894AZwv9faQ== +is-string@^1.0.5, is-string@^1.0.6: + version "1.0.7" + resolved "https://registry.yarnpkg.com/is-string/-/is-string-1.0.7.tgz#0dd12bf2006f255bb58f695110eff7491eebc0fd" + integrity sha512-tE2UXzivje6ofPW7l23cjDOMa09gb7xlAqG6jG5ej6uPV32TlWP3NKPigtaGeHNu9fohccRYvIiZMfOOnOYUtg== dependencies: - has-symbols "^1.0.1" + has-tostringtag "^1.0.0" + +is-symbol@^1.0.2, is-symbol@^1.0.3: + version "1.0.4" + resolved "https://registry.yarnpkg.com/is-symbol/-/is-symbol-1.0.4.tgz#a6dac93b635b063ca6872236de88910a57af139c" + integrity sha512-C/CPBqKWnvdcxqIARxyOh4v1UUEOCHpgDa0WYgpKDFMszcrPcffg5uhwSgPCLD2WWxmq6isisz87tzT01tuGhg== + dependencies: + has-symbols "^1.0.2" is-typedarray@^1.0.0, is-typedarray@~1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/is-typedarray/-/is-typedarray-1.0.0.tgz#e479c80858df0c1b11ddda6940f96011fcda4a9a" integrity sha1-5HnICFjfDBsR3dppQPlgEfzaSpo= -is-windows@^1.0.2: +is-utf8@^0.2.1: + version "0.2.1" + resolved "https://registry.yarnpkg.com/is-utf8/-/is-utf8-0.2.1.tgz#4b0da1442104d1b336340e80797e865cf39f7d72" + integrity sha1-Sw2hRCEE0bM2NA6AeX6GXPOffXI= + +is-windows@^1.0.1, is-windows@^1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/is-windows/-/is-windows-1.0.2.tgz#d1850eb9791ecd18e6182ce12a30f396634bb19d" integrity sha512-eXK1UInq2bPmjyX6e3VHIzMLobc4J94i4AWn+Hpq3OU5KkrRC96OAcR3PRJ/pGu6m8TRnBHP9dkXQVsT/COVIA== @@ -2522,6 +3040,11 @@ isexe@^2.0.0: resolved "https://registry.yarnpkg.com/isexe/-/isexe-2.0.0.tgz#e8fbf374dc556ff8947a10dcb0572d633f2cfa10" integrity sha1-6PvzdNxVb/iUehDcsFctYz8s+hA= +isobject@^3.0.1: + version "3.0.1" + resolved "https://registry.yarnpkg.com/isobject/-/isobject-3.0.1.tgz#4e431e92b11a9731636aa1f9c8d1ccbcfdab78df" + integrity sha1-TkMekrEalzFjaqH5yNHMvP2reN8= + isstream@~0.1.2: version "0.1.2" resolved "https://registry.yarnpkg.com/isstream/-/isstream-0.1.2.tgz#47e63f7af55afa6f92e1500e690eb8b8529c099a" @@ -2684,11 +3207,26 @@ jsesc@~0.5.0: resolved "https://registry.yarnpkg.com/jsesc/-/jsesc-0.5.0.tgz#e7dee66e35d6fc16f710fe91d5cf69f70f08911d" integrity sha1-597mbjXW/Bb3EP6R1c9p9w8IkR0= +json-parse-better-errors@^1.0.1: + version "1.0.2" + resolved "https://registry.yarnpkg.com/json-parse-better-errors/-/json-parse-better-errors-1.0.2.tgz#bb867cfb3450e69107c131d1c514bab3dc8bcaa9" + integrity sha512-mrqyZKfX5EhL7hvqcV6WG1yYjnjeuYDzDhhcAAUrq8Po85NBQBJP+ZDUT75qZQ98IkUoBqdkExkukOU7Ts2wrw== + +json-parse-even-better-errors@^2.3.0: + version "2.3.1" + resolved "https://registry.yarnpkg.com/json-parse-even-better-errors/-/json-parse-even-better-errors-2.3.1.tgz#7c47805a94319928e05777405dc12e1f7a4ee02d" + integrity sha512-xyFwyhro/JEof6Ghe2iz2NcXoj2sloNsWr/XsERDK/oiPCfaNhl5ONfp+jQdAZRQQ0IJWNzH9zIZF7li91kh2w== + json-schema-traverse@^0.4.1: version "0.4.1" resolved "https://registry.yarnpkg.com/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz#69f6a87d9513ab8bb8fe63bdb0979c448e684660" integrity sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg== +json-schema-traverse@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/json-schema-traverse/-/json-schema-traverse-1.0.0.tgz#ae7bcb3656ab77a73ba5c49bf654f38e6b6860e2" + integrity sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug== + json-schema@0.2.3: version "0.2.3" resolved "https://registry.yarnpkg.com/json-schema/-/json-schema-0.2.3.tgz#b480c892e59a2f05954ce727bd3f2a4e882f9e13" @@ -2704,10 +3242,10 @@ json-stringify-safe@~5.0.1: resolved "https://registry.yarnpkg.com/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz#1296a2d58fd45f19a0f6ce01d65701e2c735b6eb" integrity sha1-Epai1Y/UXxmg9s4B1lcB4sc1tus= -json5@^2.1.2: - version "2.1.3" - resolved "https://registry.yarnpkg.com/json5/-/json5-2.1.3.tgz#c9b0f7fa9233bfe5807fe66fcf3a5617ed597d43" - integrity sha512-KXPvOm8K9IJKFM0bmdn8QXh7udDh1g/giieX0NLCaMnb4hEiVFqnop2ImTXCc5e0/oHz3LTqmHGtExn5hfMkOA== +json5@^2.1.2, json5@^2.2.0: + version "2.2.0" + resolved "https://registry.yarnpkg.com/json5/-/json5-2.2.0.tgz#2dfefe720c6ba525d9ebd909950f0515316c89a3" + integrity sha512-f+8cldu7X/y7RAJurMEJmdoKXGB/X550w2Nr3tTbezL6RwEE/iMcm+tZnXeoZtKuOq6ft8+CqzEkrIgx1fPoQA== dependencies: minimist "^1.2.5" @@ -2728,7 +3266,20 @@ jsprim@^1.2.2: json-schema "0.2.3" verror "1.10.0" -levn@^0.3.0, levn@~0.3.0: +kind-of@^6.0.2: + version "6.0.3" + resolved "https://registry.yarnpkg.com/kind-of/-/kind-of-6.0.3.tgz#07c05034a6c349fa06e24fa35aa76db4580ce4dd" + integrity sha512-dcS1ul+9tmeD95T+x28/ehLgd9mENa3LsvDTtzm3vyBEO7RPptvAD+t44WVXaUjTBRcrpFeFlC8WCruUR456hw== + +levn@^0.4.1: + version "0.4.1" + resolved "https://registry.yarnpkg.com/levn/-/levn-0.4.1.tgz#ae4562c007473b932a6200d403268dd2fffc6ade" + integrity sha512-+bT2uH4E5LGE7h/n3evcS/sQlJXCpIp6ym8OWJ5eV6+67Dsql/LaaT7qJBAt2rzfoa/5QBGBhxDix1dMt2kQKQ== + dependencies: + prelude-ls "^1.2.1" + type-check "~0.4.0" + +levn@~0.3.0: version "0.3.0" resolved "https://registry.yarnpkg.com/levn/-/levn-0.3.0.tgz#3b09924edf9f083c0490fdd4c0bc4421e04764ee" integrity sha1-OwmSTt+fCDwEkP3UwLxEIeBHZO4= @@ -2736,6 +3287,29 @@ levn@^0.3.0, levn@~0.3.0: prelude-ls "~1.1.2" type-check "~0.3.2" +lines-and-columns@^1.1.6: + version "1.1.6" + resolved "https://registry.yarnpkg.com/lines-and-columns/-/lines-and-columns-1.1.6.tgz#1c00c743b433cd0a4e80758f7b64a57440d9ff00" + integrity sha1-HADHQ7QzzQpOgHWPe2SldEDZ/wA= + +load-json-file@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/load-json-file/-/load-json-file-4.0.0.tgz#2f5f45ab91e33216234fd53adab668eb4ec0993b" + integrity sha1-L19Fq5HjMhYjT9U62rZo607AmTs= + dependencies: + graceful-fs "^4.1.2" + parse-json "^4.0.0" + pify "^3.0.0" + strip-bom "^3.0.0" + +locate-path@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/locate-path/-/locate-path-2.0.0.tgz#2b568b265eec944c6d9c0de9c3dbbbca0354cd8e" + integrity sha1-K1aLJl7slExtnA3pw9u7ygNUzY4= + dependencies: + p-locate "^2.0.0" + path-exists "^3.0.0" + locate-path@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/locate-path/-/locate-path-3.0.0.tgz#dbec3b3ab759758071b58fe59fc41871af21400e" @@ -2751,25 +3325,45 @@ locate-path@^5.0.0: dependencies: p-locate "^4.1.0" +lodash.clonedeep@^4.5.0: + version "4.5.0" + resolved "https://registry.yarnpkg.com/lodash.clonedeep/-/lodash.clonedeep-4.5.0.tgz#e23f3f9c4f8fbdde872529c1071857a086e5ccef" + integrity sha1-4j8/nE+Pvd6HJSnBBxhXoIblzO8= + +lodash.debounce@^4.0.8: + version "4.0.8" + resolved "https://registry.yarnpkg.com/lodash.debounce/-/lodash.debounce-4.0.8.tgz#82d79bff30a67c4005ffd5e2515300ad9ca4d7af" + integrity sha1-gteb/zCmfEAF/9XiUVMArZyk168= + lodash.flattendeep@^4.4.0: version "4.4.0" resolved "https://registry.yarnpkg.com/lodash.flattendeep/-/lodash.flattendeep-4.4.0.tgz#fb030917f86a3134e5bc9bec0d69e0013ddfedb2" integrity sha1-+wMJF/hqMTTlvJvsDWngAT3f7bI= +lodash.map@^4.5.1: + version "4.6.0" + resolved "https://registry.yarnpkg.com/lodash.map/-/lodash.map-4.6.0.tgz#771ec7839e3473d9c4cde28b19394c3562f4f6d3" + integrity sha1-dx7Hg540c9nEzeKLGTlMNWL09tM= + +lodash.merge@^4.6.2: + version "4.6.2" + resolved "https://registry.yarnpkg.com/lodash.merge/-/lodash.merge-4.6.2.tgz#558aa53b43b661e1925a0afdfa36a9a1085fe57a" + integrity sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ== + lodash.sortby@^4.7.0: version "4.7.0" resolved "https://registry.yarnpkg.com/lodash.sortby/-/lodash.sortby-4.7.0.tgz#edd14c824e2cc9c1e0b0a1b42bb5210516a42438" integrity sha1-7dFMgk4sycHgsKG0K7UhBRakJDg= -lodash@4.17.19: - version "4.17.19" - resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.19.tgz#e48ddedbe30b3321783c5b4301fbd353bc1e4a4b" - integrity sha512-JNvd8XER9GQX0v2qJgsaN/mzFCNA5BRe/j8JN9d+tWyGLSodKQHKFicdwNYzWwI3wjRnaKPsGj1XkBjx/F96DQ== +lodash.truncate@^4.4.2: + version "4.4.2" + resolved "https://registry.yarnpkg.com/lodash.truncate/-/lodash.truncate-4.4.2.tgz#5a350da0b1113b837ecfffd5812cbe58d6eae193" + integrity sha1-WjUNoLERO4N+z//VgSy+WNbq4ZM= -lodash@^4.17.14, lodash@^4.17.15, lodash@^4.17.19: - version "4.17.20" - resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.20.tgz#b44a9b6297bcb698f1c51a3545a2b3b368d59c52" - integrity sha512-PlhdFcillOINfeV7Ni6oF1TAEayyZBoZ8bcshTHqOYJYlrqzRK5hagpagky5o4HfCzzd1TRkXPMFq6cKk9rGmA== +lodash@4.17.21, lodash@^4.17.12, lodash@^4.17.15, lodash@^4.17.19, lodash@^4.17.20: + version "4.17.21" + resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.21.tgz#679591c564c3bffaae8454cf0b3df370c3d6911c" + integrity sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg== log-symbols@3.0.0: version "3.0.0" @@ -2778,6 +3372,18 @@ log-symbols@3.0.0: dependencies: chalk "^2.4.2" +longest@^2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/longest/-/longest-2.0.1.tgz#781e183296aa94f6d4d916dc335d0d17aefa23f8" + integrity sha1-eB4YMpaqlPbU2RbcM10NF676I/g= + +lru-cache@^6.0.0: + version "6.0.0" + resolved "https://registry.yarnpkg.com/lru-cache/-/lru-cache-6.0.0.tgz#6d6fe6570ebd96aaf90fcad1dafa3b2566db3a94" + integrity sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA== + dependencies: + yallist "^4.0.0" + magic-string@0.25.7, magic-string@^0.25.7: version "0.25.7" resolved "https://registry.yarnpkg.com/magic-string/-/magic-string-0.25.7.tgz#3f497d6fd34c669c6798dcb821f2ef31f5445051" @@ -2817,30 +3423,35 @@ merge2@^1.2.3, merge2@^1.3.0: resolved "https://registry.yarnpkg.com/merge2/-/merge2-1.4.1.tgz#4368892f885e907455a6fd7dc55c0c9d404990ae" integrity sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg== -micromatch@^4.0.2: - version "4.0.2" - resolved "https://registry.yarnpkg.com/micromatch/-/micromatch-4.0.2.tgz#4fcb0999bf9fbc2fcbdd212f6d629b9a56c39259" - integrity sha512-y7FpHSbMUMoyPbYUSzO6PaZ6FyRnQOpHuKwbo1G+Knck95XVU4QAiKdGEnj5wwoS7PlOgthX/09u5iFJ+aYf5Q== +merge@^2.1.0: + version "2.1.1" + resolved "https://registry.yarnpkg.com/merge/-/merge-2.1.1.tgz#59ef4bf7e0b3e879186436e8481c06a6c162ca98" + integrity sha512-jz+Cfrg9GWOZbQAnDQ4hlVnQky+341Yk5ru8bZSe6sIDTCIg8n9i/u7hSQGSVOF3C7lH6mGtqjkiT9G4wFLL0w== + +micromatch@^4.0.2, micromatch@^4.0.4: + version "4.0.4" + resolved "https://registry.yarnpkg.com/micromatch/-/micromatch-4.0.4.tgz#896d519dfe9db25fce94ceb7a500919bf881ebf9" + integrity sha512-pRmzw/XUcwXGpD9aI9q/0XOwLNygjETJ8y0ao0wdqprrzDa4YnxLcz7fQRZr8voh8V10kGhABbNcHVk5wHgWwg== dependencies: braces "^3.0.1" - picomatch "^2.0.5" + picomatch "^2.2.3" -mime-db@1.45.0: - version "1.45.0" - resolved "https://registry.yarnpkg.com/mime-db/-/mime-db-1.45.0.tgz#cceeda21ccd7c3a745eba2decd55d4b73e7879ea" - integrity sha512-CkqLUxUk15hofLoLyljJSrukZi8mAtgd+yE5uO4tqRZsdsAJKv0O+rFMhVDRJgozy+yG6md5KwuXhD4ocIoP+w== +mime-db@1.49.0: + version "1.49.0" + resolved "https://registry.yarnpkg.com/mime-db/-/mime-db-1.49.0.tgz#f3dfde60c99e9cf3bc9701d687778f537001cbed" + integrity sha512-CIc8j9URtOVApSFCQIF+VBkX1RwXp/oMMOrqdyXSBXq5RWNEsRfyj1kiRnQgmNXmHxPoFIxOroKA3zcU9P+nAA== mime-types@^2.1.12, mime-types@~2.1.19: - version "2.1.28" - resolved "https://registry.yarnpkg.com/mime-types/-/mime-types-2.1.28.tgz#1160c4757eab2c5363888e005273ecf79d2a0ecd" - integrity sha512-0TO2yJ5YHYr7M2zzT7gDU1tbwHxEUWBCLt0lscSNpcdAfFyJOVEpRYNS7EXVcTLNj/25QO8gulHC5JtTzSE2UQ== + version "2.1.32" + resolved "https://registry.yarnpkg.com/mime-types/-/mime-types-2.1.32.tgz#1d00e89e7de7fe02008db61001d9e02852670fd5" + integrity sha512-hJGaVS4G4c9TSMYh2n6SQAGrC4RnfU+daP8G7cSCmaqNjiOoUY0VHCMS42pxnQmVF1GWwFhbHWn3RIxCqTmZ9A== dependencies: - mime-db "1.45.0" + mime-db "1.49.0" -mimic-fn@^2.1.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/mimic-fn/-/mimic-fn-2.1.0.tgz#7ed2c2ccccaf84d3ffcb7a69b57711fc2083401b" - integrity sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg== +mimic-fn@^1.0.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/mimic-fn/-/mimic-fn-1.2.0.tgz#820c86a39334640e99516928bd03fca88057d022" + integrity sha512-jf84uxzwiuiIVKiOLpfYk7N46TSy8ubTonmneY9vrpHNAnp0QBt2BxWV9dO3/j+BoVAb+a5G6YDPW3M5HOdMWQ== mimic-response@^2.0.0: version "2.1.0" @@ -2859,12 +3470,12 @@ minimist@0.0.8: resolved "https://registry.yarnpkg.com/minimist/-/minimist-0.0.8.tgz#857fcabfc3397d2625b8228262e86aa7a011b05d" integrity sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0= -minimist@^1.2.0, minimist@^1.2.5: +minimist@1.2.5, minimist@^1.2.0, minimist@^1.2.5: version "1.2.5" resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.2.5.tgz#67d66014b66a6a8aaa0c083c5fd58df4e4e97602" integrity sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw== -minipass@^2.6.0, minipass@^2.8.6, minipass@^2.9.0: +minipass@^2.6.0, minipass@^2.9.0: version "2.9.0" resolved "https://registry.yarnpkg.com/minipass/-/minipass-2.9.0.tgz#e713762e7d3e32fed803115cf93e04bca9fcc9a6" integrity sha512-wxfUjg9WebH+CUDX/CdbRlh5SmfZiy/hpkxaRI16Y9W56Pa75sWgd/rvFilSgrauD9NyFymP/+JFV3KwzIsJeg== @@ -2872,7 +3483,7 @@ minipass@^2.6.0, minipass@^2.8.6, minipass@^2.9.0: safe-buffer "^5.1.2" yallist "^3.0.0" -minizlib@^1.2.1: +minizlib@^1.3.3: version "1.3.3" resolved "https://registry.yarnpkg.com/minizlib/-/minizlib-1.3.3.tgz#2290de96818a34c29551c8a8d301216bd65a861d" integrity sha512-6ZYMOEnmVsdCeTJVE0W9ZD+pVnE8h9Hma/iOwwRDsdQoePpoX56/8B6z3P9VNwppJuBKNRuFDRNRqRWexT9G9Q== @@ -2886,7 +3497,7 @@ mkdirp@0.5.1: dependencies: minimist "0.0.8" -mkdirp@0.5.x, mkdirp@^0.5.0, mkdirp@^0.5.1: +mkdirp@0.5.x, mkdirp@^0.5.1, mkdirp@^0.5.5: version "0.5.5" resolved "https://registry.yarnpkg.com/mkdirp/-/mkdirp-0.5.5.tgz#d91cefd62d1436ca0f41620e251288d420099def" integrity sha512-NKmAlESf6jMGym1++R0Ra7wvhV+wFW63FaSOFPwRahvea0gMUcGUhVeAg/0BC0wiv9ih5NYPB1Wn1UEI1/L+xQ== @@ -2928,16 +3539,21 @@ mocha@7.1.0: yargs-parser "13.1.1" yargs-unparser "1.6.0" -moment@2.27.0: - version "2.27.0" - resolved "https://registry.yarnpkg.com/moment/-/moment-2.27.0.tgz#8bff4e3e26a236220dfe3e36de756b6ebaa0105d" - integrity sha512-al0MUK7cpIcglMv3YF13qSgdAIqxHTO7brRtaz3DlSULbqfazqkc5kEjNrLDOM7fsjshoFIihnU8snrP7zUvhQ== +moment@2.29.1: + version "2.29.1" + resolved "https://registry.yarnpkg.com/moment/-/moment-2.29.1.tgz#b2be769fa31940be9eeea6469c075e35006fa3d3" + integrity sha512-kHmoybcPV8Sqy59DwNDY3Jefr64lK/by/da0ViFcuA4DH0vQg5Q6Ze5VimxkfQNSC+Mls/Kx53s7TjP1RhFEDQ== mri@1.1.4: version "1.1.4" resolved "https://registry.yarnpkg.com/mri/-/mri-1.1.4.tgz#7cb1dd1b9b40905f1fac053abe25b6720f44744a" integrity sha512-6y7IjGPm8AzlvoUrwAaw1tLnUBudaS3752vcd8JtrpGGQn+rXIe63LFVHm/YMwtqAuh+LJPCFdlLYPWM1nYn6w== +ms@2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/ms/-/ms-2.0.0.tgz#5608aeadfc00be6c2901df5f9861788de0d597c8" + integrity sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g= + ms@2.1.1: version "2.1.1" resolved "https://registry.yarnpkg.com/ms/-/ms-2.1.1.tgz#30a5864eb3ebb0a66f2ebe6d727af06a09d86e0a" @@ -2953,15 +3569,15 @@ ms@^2.1.1: resolved "https://registry.yarnpkg.com/ms/-/ms-2.1.3.tgz#574c8138ce1d2b5861f0b44579dbadd60c6615b2" integrity sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA== -mute-stream@0.0.8: - version "0.0.8" - resolved "https://registry.yarnpkg.com/mute-stream/-/mute-stream-0.0.8.tgz#1630c42b2251ff81e2a283de96a5497ea92e5e0d" - integrity sha512-nnbWWOkoWyUsTjKrhgD0dcz22mdkSnpYqbEjIm2nhwhuxlSkpywJmBo8h0ZqJdkp73mb90SssHkN4rsRaBAfAA== +mute-stream@0.0.7: + version "0.0.7" + resolved "https://registry.yarnpkg.com/mute-stream/-/mute-stream-0.0.7.tgz#3075ce93bc21b8fab43e1bc4da7e8115ed1e7bab" + integrity sha1-MHXOk7whuPq0PhvE2n6BFe0ee6s= nan@^2.14.0: - version "2.14.2" - resolved "https://registry.yarnpkg.com/nan/-/nan-2.14.2.tgz#f5376400695168f4cc694ac9393d0c9585eeea19" - integrity sha512-M2ufzIiINKCuDfBSAUr1vWQ+vuVcA9kqx8JJUsbQi6yf1uGRyb7HfpdfUr5qLXf3B/t8dPvcjhKMmlfnP47EzQ== + version "2.15.0" + resolved "https://registry.yarnpkg.com/nan/-/nan-2.15.0.tgz#3f34a473ff18e15c1b5626b62903b5ad6e665fee" + integrity sha512-8ZtvEnA2c5aYCZYd1cvgdnU6cqwixRoYg70xPLWUws5ORTa/lnw+u4amixRS/Ac5U5mQVgp9pnlSUnbNWFaWZQ== natural-compare@^1.4.0: version "1.4.0" @@ -2969,9 +3585,9 @@ natural-compare@^1.4.0: integrity sha1-Sr6/7tdUHywnrPspvbvRXI1bpPc= needle@^2.2.1: - version "2.5.2" - resolved "https://registry.yarnpkg.com/needle/-/needle-2.5.2.tgz#cf1a8fce382b5a280108bba90a14993c00e4010a" - integrity sha512-LbRIwS9BfkPvNwNHlsA41Q29kL2L/6VaOJ0qisM5lLWsTV3nP15abO5ITL6L81zqFhzjRKDAYjpcBcwM0AVvLQ== + version "2.8.0" + resolved "https://registry.yarnpkg.com/needle/-/needle-2.8.0.tgz#1c8ef9c1a2c29dcc1e83d73809d7bc681c80a048" + integrity sha512-ZTq6WYkN/3782H1393me3utVYdq2XyqNUFBsprEE3VMAT0+hP/cItpnITpqsY6ep2yeFE4Tqtqwc74VqUlUYtw== dependencies: debug "^3.2.6" iconv-lite "^0.4.4" @@ -2982,11 +3598,6 @@ neo-async@^2.6.0: resolved "https://registry.yarnpkg.com/neo-async/-/neo-async-2.6.2.tgz#b4aafb93e3aeb2d8174ca53cf163ab7d7308305f" integrity sha512-Yd3UES5mWCSqR+qNT93S3UoYUkqAZ9lLg8a7g9rimsWmYGK8cVToA4/sF3RrshdyV3sAGMXVUmpMYOw+dLpOuw== -nice-try@^1.0.4: - version "1.0.5" - resolved "https://registry.yarnpkg.com/nice-try/-/nice-try-1.0.5.tgz#a3378a7696ce7d223e88fc9b764bd7ef1089e366" - integrity sha512-1nh45deeb5olNY7eX82BkPO7SSxR5SSYJiPTrTdFUVYwAl8CKMA5N9PjTYkHiRjisVcxcQ1HXdLhx2qxxJzLNQ== - node-environment-flags@1.0.6: version "1.0.6" resolved "https://registry.yarnpkg.com/node-environment-flags/-/node-environment-flags-1.0.6.tgz#a30ac13621f6f7d674260a54dede048c3982c088" @@ -3023,10 +3634,10 @@ node-preload@^0.2.1: dependencies: process-on-spawn "^1.0.0" -node-releases@^1.1.71: - version "1.1.72" - resolved "https://registry.yarnpkg.com/node-releases/-/node-releases-1.1.72.tgz#14802ab6b1039a79a0c7d662b610a5bbd76eacbe" - integrity sha512-LLUo+PpH3dU6XizX3iVoubUNheF/owjXCZZ5yACDxNnPtgFuludV1ZL3ayK1kVep42Rmm0+R9/Y60NQbZ2bifw== +node-releases@^1.1.73: + version "1.1.73" + resolved "https://registry.yarnpkg.com/node-releases/-/node-releases-1.1.73.tgz#dd4e81ddd5277ff846b80b52bb40c49edf7a7b20" + integrity sha512-uW7fodD6pyW2FZNZnp/Z3hvWKeEW1Y8R1+1CnErE8cXFXzl5blBOoVB41CvMer6P6Q0S5FXDwcHgFd1Wj0U9zg== nodent-compiler@^3.1.6: version "3.2.13" @@ -3058,15 +3669,25 @@ nopt@^4.0.1: abbrev "1" osenv "^0.1.4" +normalize-package-data@^2.3.2: + version "2.5.0" + resolved "https://registry.yarnpkg.com/normalize-package-data/-/normalize-package-data-2.5.0.tgz#e66db1838b200c1dfc233225d12cb36520e234a8" + integrity sha512-/5CMN3T0R4XTj4DcGaexo+roZSdSFW/0AOOTROrjxzCG1wrWXEsGbRKevjlIL+ZDE4sZlJr5ED4YW0yqmkK+eA== + dependencies: + hosted-git-info "^2.1.4" + resolve "^1.10.0" + semver "2 || 3 || 4 || 5" + validate-npm-package-license "^3.0.1" + normalize-path@^3.0.0, normalize-path@~3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/normalize-path/-/normalize-path-3.0.0.tgz#0dcd69ff23a1c9b11fd0978316644a0388216a65" integrity sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA== npm-bundled@^1.0.1: - version "1.1.1" - resolved "https://registry.yarnpkg.com/npm-bundled/-/npm-bundled-1.1.1.tgz#1edd570865a94cdb1bc8220775e29466c9fb234b" - integrity sha512-gqkfgGePhTpAEgUsGEgcq1rqPXA+tv/aVBlgEzfXwA1yiUJF7xtEt3CtVwOjNYQOVknDk0F20w58Fnm3EtG0fA== + version "1.1.2" + resolved "https://registry.yarnpkg.com/npm-bundled/-/npm-bundled-1.1.2.tgz#944c78789bd739035b70baa2ca5cc32b8d860bc1" + integrity sha512-x5DHup0SuyQcmL3s7Rx/YQ8sbw/Hzg0rj48eN0dV7hf5cmQq5PXIeioroH3raV1QC1yh3uTYuMThvEQF3iKgGQ== dependencies: npm-normalize-package-bin "^1.0.1" @@ -3147,10 +3768,10 @@ object-assign@^4.1.0: resolved "https://registry.yarnpkg.com/object-assign/-/object-assign-4.1.1.tgz#2109adc7965887cfc05cbbd442cac8bfbb360863" integrity sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM= -object-inspect@^1.8.0: - version "1.9.0" - resolved "https://registry.yarnpkg.com/object-inspect/-/object-inspect-1.9.0.tgz#c90521d74e1127b67266ded3394ad6116986533a" - integrity sha512-i3Bp9iTqwhaLZBxGkRfo5ZbE07BQRT7MGu8+nNgwW9ItGp1TzCTw2DLEoWwjClxBjOFI/hWljTAmYGCEwmtnOw== +object-inspect@^1.11.0, object-inspect@^1.9.0: + version "1.11.0" + resolved "https://registry.yarnpkg.com/object-inspect/-/object-inspect-1.11.0.tgz#9dceb146cedd4148a0d9e51ab88d34cf509922b1" + integrity sha512-jp7ikS6Sd3GxQfZJPyH3cjcbJF6GZPClgdV+EFygjFLQ5FmW/dRUnTd9PQ9k0JhoNDabWFbpF1yCdSWCC6gexg== object-keys@^1.0.11, object-keys@^1.0.12, object-keys@^1.1.1: version "1.1.1" @@ -3167,7 +3788,7 @@ object.assign@4.1.0: has-symbols "^1.0.0" object-keys "^1.0.11" -object.assign@^4.1.0, object.assign@^4.1.1: +object.assign@^4.1.0, object.assign@^4.1.2: version "4.1.2" resolved "https://registry.yarnpkg.com/object.assign/-/object.assign-4.1.2.tgz#0ed54a342eceb37b38ff76eb831a0e788cb63940" integrity sha512-ixT2L5THXsApyiUPYKmW+2EHpXXe5Ii3M+f4e+aJFAHao5amFRW6J0OO6c/LU8Be47utCx2GL89hxGB6XSmKuQ== @@ -3177,14 +3798,32 @@ object.assign@^4.1.0, object.assign@^4.1.1: has-symbols "^1.0.1" object-keys "^1.1.1" +object.entries@^1.1.2: + version "1.1.4" + resolved "https://registry.yarnpkg.com/object.entries/-/object.entries-1.1.4.tgz#43ccf9a50bc5fd5b649d45ab1a579f24e088cafd" + integrity sha512-h4LWKWE+wKQGhtMjZEBud7uLGhqyLwj8fpHOarZhD2uY3C9cRtk57VQ89ke3moByLXMedqs3XCHzyb4AmA2DjA== + dependencies: + call-bind "^1.0.2" + define-properties "^1.1.3" + es-abstract "^1.18.2" + object.getownpropertydescriptors@^2.0.3: - version "2.1.1" - resolved "https://registry.yarnpkg.com/object.getownpropertydescriptors/-/object.getownpropertydescriptors-2.1.1.tgz#0dfda8d108074d9c563e80490c883b6661091544" - integrity sha512-6DtXgZ/lIZ9hqx4GtZETobXLR/ZLaa0aqV0kzbn80Rf8Z2e/XFnhA0I7p07N2wH8bBBltr2xQPi6sbKWAY2Eng== + version "2.1.2" + resolved "https://registry.yarnpkg.com/object.getownpropertydescriptors/-/object.getownpropertydescriptors-2.1.2.tgz#1bd63aeacf0d5d2d2f31b5e393b03a7c601a23f7" + integrity sha512-WtxeKSzfBjlzL+F9b7M7hewDzMwy+C8NRssHd1YrNlzHzIDrXcXiNOMrezdAEM4UXixgV+vvnyBeN7Rygl2ttQ== dependencies: - call-bind "^1.0.0" + call-bind "^1.0.2" define-properties "^1.1.3" - es-abstract "^1.18.0-next.1" + es-abstract "^1.18.0-next.2" + +object.values@^1.1.3: + version "1.1.4" + resolved "https://registry.yarnpkg.com/object.values/-/object.values-1.1.4.tgz#0d273762833e816b693a637d30073e7051535b30" + integrity sha512-TnGo7j4XSnKQoK3MfvkzqKCi0nVe/D9I9IjwTNYdb/fxYHpjrluHVOgw0AF6jrRFGMPHdfuidR09tIDiIvnaSg== + dependencies: + call-bind "^1.0.2" + define-properties "^1.1.3" + es-abstract "^1.18.2" once@1.x, once@^1.3.0, once@^1.3.1: version "1.4.0" @@ -3193,14 +3832,14 @@ once@1.x, once@^1.3.0, once@^1.3.1: dependencies: wrappy "1" -onetime@^5.1.0: - version "5.1.2" - resolved "https://registry.yarnpkg.com/onetime/-/onetime-5.1.2.tgz#d0e96ebb56b07476df1dd9c4806e5237985ca45e" - integrity sha512-kbpaSSGJTWdAY5KPVeMOKXSrPtr8C8C7wodJbcsd51jRnmD+GZu8Y0VoU6Dm5Z4vWr0Ig/1NKuWRKf7j5aaYSg== +onetime@^2.0.0: + version "2.0.1" + resolved "https://registry.yarnpkg.com/onetime/-/onetime-2.0.1.tgz#067428230fd67443b2794b22bba528b6867962d4" + integrity sha1-BnQoIw/WdEOyeUsiu6UotoZ5YtQ= dependencies: - mimic-fn "^2.1.0" + mimic-fn "^1.0.0" -optionator@^0.8.1, optionator@^0.8.3: +optionator@^0.8.1: version "0.8.3" resolved "https://registry.yarnpkg.com/optionator/-/optionator-0.8.3.tgz#84fa1d036fe9d3c7e21d99884b601167ec8fb495" integrity sha512-+IW9pACdk3XWmmTXG8m3upGUJst5XRGzxMRjXzAuJ1XnIFNvfhjjIuYkDvysnPQ7qzqVzLt78BCruntqRhWQbA== @@ -3212,6 +3851,18 @@ optionator@^0.8.1, optionator@^0.8.3: type-check "~0.3.2" word-wrap "~1.2.3" +optionator@^0.9.1: + version "0.9.1" + resolved "https://registry.yarnpkg.com/optionator/-/optionator-0.9.1.tgz#4f236a6373dae0566a6d43e1326674f50c291499" + integrity sha512-74RlY5FCnhq4jRxVUPKDaRwrVNXMqsGsiW6AJw4XK8hmtm10wC0ypZBLw5IIp85NZMr91+qd1RvvENwg7jjRFw== + dependencies: + deep-is "^0.1.3" + fast-levenshtein "^2.0.6" + levn "^0.4.1" + prelude-ls "^1.2.1" + type-check "^0.4.0" + word-wrap "^1.2.3" + os-homedir@^1.0.0: version "1.0.2" resolved "https://registry.yarnpkg.com/os-homedir/-/os-homedir-1.0.2.tgz#ffbc4988336e0e833de0c168c7ef152121aa7fb3" @@ -3230,6 +3881,13 @@ osenv@^0.1.4: os-homedir "^1.0.0" os-tmpdir "^1.0.0" +p-limit@^1.1.0: + version "1.3.0" + resolved "https://registry.yarnpkg.com/p-limit/-/p-limit-1.3.0.tgz#b86bd5f0c25690911c7590fcbfc2010d54b3ccb8" + integrity sha512-vvcXsLAJ9Dr5rQOPk7toZQZJApBl2K4J6dANSsEuh6QI41JYcsS/qhTGa9ErIUUgK3WNQoJYvylxvjqmiqEA9Q== + dependencies: + p-try "^1.0.0" + p-limit@^2.0.0, p-limit@^2.2.0: version "2.3.0" resolved "https://registry.yarnpkg.com/p-limit/-/p-limit-2.3.0.tgz#3dd33c647a214fdfffd835933eb086da0dc21db1" @@ -3237,6 +3895,13 @@ p-limit@^2.0.0, p-limit@^2.2.0: dependencies: p-try "^2.0.0" +p-locate@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/p-locate/-/p-locate-2.0.0.tgz#20a0103b222a70c8fd39cc2e580680f3dde5ec43" + integrity sha1-IKAQOyIqcMj9OcwuWAaA893l7EM= + dependencies: + p-limit "^1.1.0" + p-locate@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/p-locate/-/p-locate-3.0.0.tgz#322d69a05c0264b25997d9f40cd8a891ab0064a4" @@ -3258,6 +3923,11 @@ p-map@^3.0.0: dependencies: aggregate-error "^3.0.0" +p-try@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/p-try/-/p-try-1.0.0.tgz#cbc79cdbaf8fd4228e13f621f2b1a237c1b207b3" + integrity sha1-y8ec26+P1CKOE/Yh8rGiN8GyB7M= + p-try@^2.0.0: version "2.2.0" resolved "https://registry.yarnpkg.com/p-try/-/p-try-2.2.0.tgz#cb2868540e313d61de58fafbe35ce9004d5540e6" @@ -3273,10 +3943,10 @@ package-hash@^4.0.0: lodash.flattendeep "^4.4.0" release-zalgo "^1.0.0" -package-name-regex@1.0.8: - version "1.0.8" - resolved "https://registry.yarnpkg.com/package-name-regex/-/package-name-regex-1.0.8.tgz#4b8388cace6cc415f462ab4a269583d9a2d9f131" - integrity sha512-g3vB2J62dLqf4m50VM4tJUC4sixw3JB+Igd0cF3P/gJhAvmvsmFEV2eWZTeLbwfkKEWTf3+gwQ2C6JFFRxWHEQ== +package-name-regex@2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/package-name-regex/-/package-name-regex-2.0.1.tgz#69e5e5412a7d5367d3cb965da6c4e480e5e9ffa4" + integrity sha512-U+K6/cuwHwr/8pUQrpNpKOIFSdS/EluTRSmtn92mug1UiPcff4t9AHs36e2xXJtpEtRfbg+JOj3Y/GLX+mzT6w== parent-module@^1.0.0: version "1.0.1" @@ -3285,6 +3955,29 @@ parent-module@^1.0.0: dependencies: callsites "^3.0.0" +parse-json@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/parse-json/-/parse-json-4.0.0.tgz#be35f5425be1f7f6c747184f98a788cb99477ee0" + integrity sha1-vjX1Qlvh9/bHRxhPmKeIy5lHfuA= + dependencies: + error-ex "^1.3.1" + json-parse-better-errors "^1.0.1" + +parse-json@^5.0.0: + version "5.2.0" + resolved "https://registry.yarnpkg.com/parse-json/-/parse-json-5.2.0.tgz#c76fc66dee54231c962b22bcc8a72cf2f99753cd" + integrity sha512-ayCKvm/phCGxOkYRSCM82iDwct8/EonSEgCSxWxD7ve6jHggsFl4fZVQBPRNgQoKiuV/odhFrGzQXZwbifC8Rg== + dependencies: + "@babel/code-frame" "^7.0.0" + error-ex "^1.3.1" + json-parse-even-better-errors "^2.3.0" + lines-and-columns "^1.1.6" + +parse-passwd@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/parse-passwd/-/parse-passwd-1.0.0.tgz#6d5b934a456993b23d37f40a382d6f1666a8e5c6" + integrity sha1-bVuTSkVpk7I9N/QKOC1vFmao5cY= + parse5@5.1.0: version "5.1.0" resolved "https://registry.yarnpkg.com/parse5/-/parse5-5.1.0.tgz#c59341c9723f414c452975564c7c00a68d58acd2" @@ -3305,40 +3998,47 @@ path-is-absolute@^1.0.0: resolved "https://registry.yarnpkg.com/path-is-absolute/-/path-is-absolute-1.0.1.tgz#174b9268735534ffbc7ace6bf53a5a9e1b5c5f5f" integrity sha1-F0uSaHNVNP+8es5r9TpanhtcX18= -path-key@^2.0.1: - version "2.0.1" - resolved "https://registry.yarnpkg.com/path-key/-/path-key-2.0.1.tgz#411cadb574c5a140d3a4b1910d40d80cc9f40b40" - integrity sha1-QRyttXTFoUDTpLGRDUDYDMn0C0A= - path-key@^3.1.0: version "3.1.1" resolved "https://registry.yarnpkg.com/path-key/-/path-key-3.1.1.tgz#581f6ade658cbba65a0d3380de7753295054f375" integrity sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q== path-parse@^1.0.6: - version "1.0.6" - resolved "https://registry.yarnpkg.com/path-parse/-/path-parse-1.0.6.tgz#d62dbb5679405d72c4737ec58600e9ddcf06d24c" - integrity sha512-GSmOT2EbHrINBf9SR7CDELwlJ8AENk3Qn7OikK4nFYAu3Ote2+JYNVvkpAEQm3/TLNEJFD/xZJjzyxg3KBWOzw== + version "1.0.7" + resolved "https://registry.yarnpkg.com/path-parse/-/path-parse-1.0.7.tgz#fbc114b60ca42b30d9daf5858e4bd68bbedb6735" + integrity sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw== + +path-type@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/path-type/-/path-type-3.0.0.tgz#cef31dc8e0a1a3bb0d105c0cd97cf3bf47f4e36f" + integrity sha512-T2ZUsdZFHgA3u4e5PfPbjd7HDDpxPnQb5jN0SrDsjNSuVXHJqtwTnWqG0B1jZrgmJ/7lj1EmVIByWt1gxGkWvg== + dependencies: + pify "^3.0.0" path-type@^4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/path-type/-/path-type-4.0.0.tgz#84ed01c0a7ba380afe09d90a8c180dcd9d03043b" integrity sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw== -pathval@^1.1.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/pathval/-/pathval-1.1.0.tgz#b942e6d4bde653005ef6b71361def8727d0645e0" - integrity sha1-uULm1L3mUwBe9rcTYd74cn0GReA= +pathval@^1.1.1: + version "1.1.1" + resolved "https://registry.yarnpkg.com/pathval/-/pathval-1.1.1.tgz#8534e77a77ce7ac5a2512ea21e0fdb8fcf6c3d8d" + integrity sha512-Dp6zGqpTdETdR63lehJYPeIOqpiNBNtc7BpWSLrOje7UaIsE5aY92r/AunQA7rsXvet3lrJ3JnZX29UPTKXyKQ== performance-now@^2.1.0: version "2.1.0" resolved "https://registry.yarnpkg.com/performance-now/-/performance-now-2.1.0.tgz#6309f4e0e5fa913ec1c69307ae364b4b377c9e7b" integrity sha1-Ywn04OX6kT7BxpMHrjZLSzd8nns= -picomatch@^2.0.4, picomatch@^2.0.5, picomatch@^2.2.1, picomatch@^2.2.2: - version "2.2.2" - resolved "https://registry.yarnpkg.com/picomatch/-/picomatch-2.2.2.tgz#21f333e9b6b8eaff02468f5146ea406d345f4dad" - integrity sha512-q0M/9eZHzmr0AulXyPwNfZjtwZ/RBZlbN3K3CErVrk50T2ASYI7Bye0EvekFY3IP1Nt2DHu0re+V2ZHIpMkuWg== +picomatch@^2.0.4, picomatch@^2.2.2, picomatch@^2.2.3: + version "2.3.0" + resolved "https://registry.yarnpkg.com/picomatch/-/picomatch-2.3.0.tgz#f1f061de8f6a4bf022892e2d128234fb98302972" + integrity sha512-lY1Q/PiJGC2zOv/z391WOTD+Z02bCgsFfvxoXXf6h7kv9o+WmsmzYqrAwY63sNgOxE4xEdq0WyUnXfKeBrSvYw== + +pify@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/pify/-/pify-3.0.0.tgz#e5a4acd2c101fdf3d9a4d07f0dbc4db49dd28176" + integrity sha1-5aSs0sEB/fPZpNB/DbxNtJ3SgXY= pify@^4.0.1: version "4.0.1" @@ -3352,6 +4052,13 @@ pirates@^4.0.0: dependencies: node-modules-regexp "^1.0.0" +pkg-dir@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/pkg-dir/-/pkg-dir-2.0.0.tgz#f6d5d1109e19d63edf428e0bd57e12777615334b" + integrity sha1-9tXREJ4Z1j7fQo4L1X4Sd3YVM0s= + dependencies: + find-up "^2.1.0" + pkg-dir@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/pkg-dir/-/pkg-dir-3.0.0.tgz#2749020f239ed990881b1f71210d51eb6523bea3" @@ -3366,11 +4073,23 @@ pkg-dir@^4.1.0: dependencies: find-up "^4.0.0" +pkg-up@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/pkg-up/-/pkg-up-2.0.0.tgz#c819ac728059a461cab1c3889a2be3c49a004d7f" + integrity sha1-yBmscoBZpGHKscOImivjxJoATX8= + dependencies: + find-up "^2.1.0" + pn@^1.1.0: version "1.1.0" resolved "https://registry.yarnpkg.com/pn/-/pn-1.1.0.tgz#e2f4cef0e219f463c179ab37463e4e1ecdccbafb" integrity sha512-2qHaIQr2VLRFoxe2nASzsV6ef4yOOH+Fi9FBOVH6cqeSgUnoyySPZkxzLuzd+RYOQTRpROA0ztTMqxROKSb/nA== +prelude-ls@^1.2.1: + version "1.2.1" + resolved "https://registry.yarnpkg.com/prelude-ls/-/prelude-ls-1.2.1.tgz#debc6489d7a6e6b0e7611888cec880337d316396" + integrity sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g== + prelude-ls@~1.1.2: version "1.1.2" resolved "https://registry.yarnpkg.com/prelude-ls/-/prelude-ls-1.1.2.tgz#21932a549f5e52ffd9a827f570e04be62a97da54" @@ -3408,6 +4127,11 @@ qs@~6.5.2: resolved "https://registry.yarnpkg.com/qs/-/qs-6.5.2.tgz#cb3ae806e8740444584ef154ce8ee98d403f3e36" integrity sha512-N5ZAX4/LxJmF+7wN74pUD6qAh9/wnvdQcjq9TZjevvXzSUo7bfmw91saqMjzGS2xq91/odN2dW/WOl7qQHNDGA== +queue-microtask@^1.2.2: + version "1.2.3" + resolved "https://registry.yarnpkg.com/queue-microtask/-/queue-microtask-1.2.3.tgz#4929228bbc724dfac43e0efb058caf7b6cfb6243" + integrity sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A== + randombytes@^2.1.0: version "2.1.0" resolved "https://registry.yarnpkg.com/randombytes/-/randombytes-2.1.0.tgz#df6f84372f0270dc65cdf6291349ab7a473d4f2a" @@ -3425,6 +4149,23 @@ rc@^1.2.7: minimist "^1.2.0" strip-json-comments "~2.0.1" +read-pkg-up@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/read-pkg-up/-/read-pkg-up-3.0.0.tgz#3ed496685dba0f8fe118d0691dc51f4a1ff96f07" + integrity sha1-PtSWaF26D4/hGNBpHcUfSh/5bwc= + dependencies: + find-up "^2.0.0" + read-pkg "^3.0.0" + +read-pkg@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/read-pkg/-/read-pkg-3.0.0.tgz#9cbc686978fee65d16c00e2b19c237fcf6e38389" + integrity sha1-nLxoaXj+5l0WwA4rGcI3/Pbjg4k= + dependencies: + load-json-file "^4.0.0" + normalize-package-data "^2.3.2" + path-type "^3.0.0" + readable-stream@^2.0.6: version "2.3.7" resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-2.3.7.tgz#1eca1cf711aef814c04f62252a36a62f6cb23b57" @@ -3458,9 +4199,9 @@ regenerate@^1.4.0: integrity sha512-zrceR/XhGYU/d/opr2EKO7aRHUeiBI8qjtfHqADTwZd6Szfy16la6kqD0MIUs5z5hx6AaKa+PixpPrR289+I0A== regenerator-runtime@^0.13.4: - version "0.13.7" - resolved "https://registry.yarnpkg.com/regenerator-runtime/-/regenerator-runtime-0.13.7.tgz#cac2dacc8a1ea675feaabaeb8ae833898ae46f55" - integrity sha512-a54FxoJDIr27pgf7IgeQGxmqUNYrcV338lf/6gH456HZ/PhX+5BcwHXG9ajESmwe6WRO0tAzRUrRmNONWgkrew== + version "0.13.9" + resolved "https://registry.yarnpkg.com/regenerator-runtime/-/regenerator-runtime-0.13.9.tgz#8925742a98ffd90814988d7566ad30ca3b263b52" + integrity sha512-p3VT+cOEgxFsRRA9X4lkI1E+k2/CtnKtU4gcxyaCUreilL/vqI6CdZ3wxVUx3UOUg+gnUOQQcRI7BmSI656MYA== regenerator-transform@^0.14.2: version "0.14.5" @@ -3469,10 +4210,10 @@ regenerator-transform@^0.14.2: dependencies: "@babel/runtime" "^7.8.4" -regexpp@^2.0.1: - version "2.0.1" - resolved "https://registry.yarnpkg.com/regexpp/-/regexpp-2.0.1.tgz#8d19d31cf632482b589049f8281f93dbcba4d07f" - integrity sha512-lv0M6+TkDVniA3aD1Eg0DVpfU/booSu7Eev3TDO/mZKHBfVjgCGTV4t4buppESEYDtkArYFOxTJWv6S5C+iaNw== +regexpp@^3.1.0: + version "3.2.0" + resolved "https://registry.yarnpkg.com/regexpp/-/regexpp-3.2.0.tgz#0425a2768d8f23bad70ca4b90461fa2f1213e1b2" + integrity sha512-pq2bWo9mVD43nbts2wGv17XLiNLya+GklZ8kaDLV2Z08gDCsGpnKn9BFMepvWuHCbyVvY7J5o5+BVvoQbmlJLg== regexpu-core@^4.7.1: version "4.7.1" @@ -3492,9 +4233,9 @@ regjsgen@^0.5.1: integrity sha512-OFFT3MfrH90xIW8OOSyUrk6QHD5E9JOTeGodiJeBS3J6IwlgzJMNE/1bZklWz5oTg+9dCMyEetclvCVXOPoN3A== regjsparser@^0.6.4: - version "0.6.4" - resolved "https://registry.yarnpkg.com/regjsparser/-/regjsparser-0.6.4.tgz#a769f8684308401a66e9b529d2436ff4d0666272" - integrity sha512-64O87/dPDgfk8/RQqC4gkZoGyyWFIEUTTh80CU6CWuK5vkCGyekIx+oKcEIYtP/RAxSQltCZHCNu/mdd7fqlJw== + version "0.6.9" + resolved "https://registry.yarnpkg.com/regjsparser/-/regjsparser-0.6.9.tgz#b489eef7c9a2ce43727627011429cf833a7183e6" + integrity sha512-ZqbNRz1SNjLAiYuwY0zoXW8Ne675IX5q+YHioAGbCw4X96Mjl2+dcX9B2ciaeyYjViDAfvIjFpQjJgLttTEERQ== dependencies: jsesc "~0.5.0" @@ -3552,11 +4293,24 @@ require-directory@^2.1.1: resolved "https://registry.yarnpkg.com/require-directory/-/require-directory-2.1.1.tgz#8c64ad5fd30dab1c976e2344ffe7f792a6a6df42" integrity sha1-jGStX9MNqxyXbiNE/+f3kqam30I= +require-from-string@^2.0.2: + version "2.0.2" + resolved "https://registry.yarnpkg.com/require-from-string/-/require-from-string-2.0.2.tgz#89a7fdd938261267318eafe14f9c32e598c36909" + integrity sha512-Xf0nWe6RseziFMu+Ap9biiUbmplq6S9/p+7w7YXP/JBHhrUDDUhwa+vANyubuqfZWTveU//DYVGsDG7RKL/vEw== + require-main-filename@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/require-main-filename/-/require-main-filename-2.0.0.tgz#d0b329ecc7cc0f61649f62215be69af54aa8989b" integrity sha512-NKN5kMDylKuldxYLSUfrbo5Tuzh4hd+2E8NPPX02mZtn1VuREQToYe/ZdlJy+J3uCpfaiGF05e7B8W0iXbQHmg== +resolve-dir@^1.0.0, resolve-dir@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/resolve-dir/-/resolve-dir-1.0.1.tgz#79a40644c362be82f26effe739c9bb5382046f43" + integrity sha1-eaQGRMNivoLybv/nOcm7U4IEb0M= + dependencies: + expand-tilde "^2.0.0" + global-modules "^1.0.0" + resolve-from@^4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/resolve-from/-/resolve-from-4.0.0.tgz#4abcd852ad32dd7baabfe9b40e00a36db5f392e6" @@ -3567,25 +4321,32 @@ resolve-from@^5.0.0: resolved "https://registry.yarnpkg.com/resolve-from/-/resolve-from-5.0.0.tgz#c35225843df8f776df21c57557bc087e9dfdfc69" integrity sha512-qYg9KP24dD5qka9J47d0aVky0N+b4fTU89LN9iDnjB5waksiC49rvMB0PrUJQGoTmH50XPiqOvAjDfaijGxYZw== +resolve-global@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/resolve-global/-/resolve-global-1.0.0.tgz#a2a79df4af2ca3f49bf77ef9ddacd322dad19255" + integrity sha512-zFa12V4OLtT5XUX/Q4VLvTfBf+Ok0SPc1FNGM/z9ctUdiU618qwKpWnd0CHs3+RqROfyEg/DhuHbMWYqcgljEw== + dependencies: + global-dirs "^0.1.1" + resolve@1.1.x: version "1.1.7" resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.1.7.tgz#203114d82ad2c5ed9e8e0411b3932875e889e97b" integrity sha1-IDEU2CrSxe2ejgQRs5ModeiJ6Xs= -resolve@^1.12.0, resolve@^1.17.0, resolve@^1.19.0: - version "1.19.0" - resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.19.0.tgz#1af5bf630409734a067cae29318aac7fa29a267c" - integrity sha512-rArEXAgsBG4UgRGcynxWIWKFvh/XZCcS8UJdHhwy91zwAvCZIbcs+vAbflgBnNjYMs/i/i+/Ux6IZhML1yPvxg== +resolve@^1.10.0, resolve@^1.14.2, resolve@^1.17.0, resolve@^1.19.0, resolve@^1.20.0: + version "1.20.0" + resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.20.0.tgz#629a013fb3f70755d6f0b7935cc1c2c5378b1975" + integrity sha512-wENBPt4ySzg4ybFQW2TT1zMQucPK95HSh/nq2CFTZVOGut2+pQvSsgtda4d26YrYcr067wjbmzOG8byDPBX63A== dependencies: - is-core-module "^2.1.0" + is-core-module "^2.2.0" path-parse "^1.0.6" -restore-cursor@^3.1.0: - version "3.1.0" - resolved "https://registry.yarnpkg.com/restore-cursor/-/restore-cursor-3.1.0.tgz#39f67c54b3a7a58cea5236d95cf0034239631f7e" - integrity sha512-l+sSefzHpj5qimhFSE5a8nufZYAM3sBSVMAPtYkmC+4EH2anSGaEMXSD0izRQbu9nfyQ9y5JrVmp7E8oZrUjvA== +restore-cursor@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/restore-cursor/-/restore-cursor-2.0.0.tgz#9f7ee287f82fd326d4fd162923d62129eee0dfaf" + integrity sha1-n37ih/gv0ybU/RYpI9YhKe7g368= dependencies: - onetime "^5.1.0" + onetime "^2.0.0" signal-exit "^3.0.2" reusify@^1.0.4: @@ -3593,13 +4354,6 @@ reusify@^1.0.4: resolved "https://registry.yarnpkg.com/reusify/-/reusify-1.0.4.tgz#90da382b1e126efc02146e90845a88db12925d76" integrity sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw== -rimraf@2.6.3: - version "2.6.3" - resolved "https://registry.yarnpkg.com/rimraf/-/rimraf-2.6.3.tgz#b2d104fe0d8fb27cf9e0a1cda8262dd3833c6cab" - integrity sha512-mwqeW5XsA2qAejG46gYdENaxXjx9onRNCfn7L0duuP4hCuTIi/QO7PDK07KJfp1d+izWPrzEJDcSqBa0OZQriA== - dependencies: - glob "^7.1.3" - rimraf@^2.6.1: version "2.7.1" resolved "https://registry.yarnpkg.com/rimraf/-/rimraf-2.7.1.tgz#35797f13a7fdadc566142c29d4f07ccad483e3ec" @@ -3607,7 +4361,7 @@ rimraf@^2.6.1: dependencies: glob "^7.1.3" -rimraf@^3.0.0: +rimraf@^3.0.0, rimraf@^3.0.2: version "3.0.2" resolved "https://registry.yarnpkg.com/rimraf/-/rimraf-3.0.2.tgz#f1a5402ba6220ad52cc1282bac1ae3aa49fd061a" integrity sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA== @@ -3623,9 +4377,9 @@ rollup-plugin-babel@^4.3.2: rollup-pluginutils "^2.8.1" rollup-plugin-copy@^3.3.0: - version "3.3.0" - resolved "https://registry.yarnpkg.com/rollup-plugin-copy/-/rollup-plugin-copy-3.3.0.tgz#5ba230047f86b9f703a29288f242948a5580e7b9" - integrity sha512-euDjCUSBXZa06nqnwCNADbkAcYDfzwowfZQkto9K/TFhiH+QG7I4PUsEMwM9tDgomGWJc//z7KLW8t+tZwxADA== + version "3.4.0" + resolved "https://registry.yarnpkg.com/rollup-plugin-copy/-/rollup-plugin-copy-3.4.0.tgz#f1228a3ffb66ffad8606e2f3fb7ff23141ed3286" + integrity sha512-rGUmYYsYsceRJRqLVlE9FivJMxJ7X6jDlP79fmFkL8sJs7VVMSVyA2yfyL+PGyO/vJs4A87hwhgVfz61njI+uQ== dependencies: "@types/fs-extra" "^8.0.1" colorette "^1.1.0" @@ -3634,19 +4388,19 @@ rollup-plugin-copy@^3.3.0: is-plain-object "^3.0.0" rollup-plugin-license@^2.0.0: - version "2.2.0" - resolved "https://registry.yarnpkg.com/rollup-plugin-license/-/rollup-plugin-license-2.2.0.tgz#0d19139bbe44dda500fbf15530af07c91949e348" - integrity sha512-xXb1vviEwlJMX+VGUSsglcMA/Rh9d2QzEm94awy4FlnsPqGrXoTYYGOR3UXR6gYIxiJFkr7qmkKF/NXfre/y8g== + version "2.5.0" + resolved "https://registry.yarnpkg.com/rollup-plugin-license/-/rollup-plugin-license-2.5.0.tgz#9c0ba9b3562564c555b48142c420af80a9909f32" + integrity sha512-HUjGV+i1tRxi/zL4WpeNCLJZfEJBbCcDmwGJCjKBvcLDIK6VNW1JmYKjSJJOqJjNqRIvKt6/BLSQB9RwNDLtQw== dependencies: commenting "1.1.0" - glob "7.1.6" - lodash "4.17.19" + glob "7.1.7" + lodash "4.17.21" magic-string "0.25.7" mkdirp "1.0.4" - moment "2.27.0" - package-name-regex "1.0.8" + moment "2.29.1" + package-name-regex "2.0.1" spdx-expression-validate "2.0.0" - spdx-satisfies "5.0.0" + spdx-satisfies "5.0.1" rollup-plugin-nodent@^0.2.2: version "0.2.2" @@ -3686,30 +4440,32 @@ rollup-pluginutils@^2.0.1, rollup-pluginutils@^2.8.1, rollup-pluginutils@^2.8.2: estree-walker "^0.6.1" rollup@^2.8.0: - version "2.35.1" - resolved "https://registry.yarnpkg.com/rollup/-/rollup-2.35.1.tgz#e6bc8d10893556a638066f89e8c97f422d03968c" - integrity sha512-q5KxEyWpprAIcainhVy6HfRttD9kutQpHbeqDTWnqAFNJotiojetK6uqmcydNMymBEtC4I8bCYR+J3mTMqeaUA== + version "2.56.2" + resolved "https://registry.yarnpkg.com/rollup/-/rollup-2.56.2.tgz#a045ff3f6af53ee009b5f5016ca3da0329e5470f" + integrity sha512-s8H00ZsRi29M2/lGdm1u8DJpJ9ML8SUOpVVBd33XNeEeL3NVaTiUcSBHzBdF3eAyR0l7VSpsuoVUGrRHq7aPwQ== optionalDependencies: - fsevents "~2.1.2" + fsevents "~2.3.2" -run-async@^2.4.0: +run-async@^2.2.0: version "2.4.1" resolved "https://registry.yarnpkg.com/run-async/-/run-async-2.4.1.tgz#8440eccf99ea3e70bd409d49aab88e10c189a455" integrity sha512-tvVnVv01b8c1RrA6Ep7JkStj85Guv/YrMcwqYQnwjsAS2cTmmPGBBjAjpCW7RrSodNSoE2/qg9O4bceNvUuDgQ== run-parallel@^1.1.9: - version "1.1.10" - resolved "https://registry.yarnpkg.com/run-parallel/-/run-parallel-1.1.10.tgz#60a51b2ae836636c81377df16cb107351bcd13ef" - integrity sha512-zb/1OuZ6flOlH6tQyMPUrE3x3Ulxjlo9WIVXR4yVYi4H9UXQaeIsPbLn2R3O3vQCnDKkAl2qHiuocKKX4Tz/Sw== + version "1.2.0" + resolved "https://registry.yarnpkg.com/run-parallel/-/run-parallel-1.2.0.tgz#66d1368da7bdf921eb9d95bd1a9229e7f21a43ee" + integrity sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA== + dependencies: + queue-microtask "^1.2.2" -rxjs@^6.6.0: - version "6.6.3" - resolved "https://registry.yarnpkg.com/rxjs/-/rxjs-6.6.3.tgz#8ca84635c4daa900c0d3967a6ee7ac60271ee552" - integrity sha512-trsQc+xYYXZ3urjOiJOuCOa5N3jAZ3eiSpQB5hIT8zGlL2QfnHLJ2r7GMkBGuIausdJN1OneaI6gQlsqNHHmZQ== +rxjs@^6.4.0: + version "6.6.7" + resolved "https://registry.yarnpkg.com/rxjs/-/rxjs-6.6.7.tgz#90ac018acabf491bf65044235d5863c4dab804c9" + integrity sha512-hTdwr+7yYNIT5n4AMYp85KA6yw2Va0FLa3Rguvbpa4W3I5xynaBZo41cM3XM+4Q6fRMj3sBYIR1VAmZMXYJvRQ== dependencies: tslib "^1.9.0" -safe-buffer@^5.0.1, safe-buffer@^5.1.0, safe-buffer@^5.1.2: +safe-buffer@^5.0.1, safe-buffer@^5.1.0, safe-buffer@^5.1.2, safe-buffer@^5.2.1: version "5.2.1" resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.2.1.tgz#1eaf9fa9bdb1fdd4ec75f58f9cdb4e6b7827eec6" integrity sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ== @@ -3736,21 +4492,28 @@ saxes@^3.1.9: dependencies: xmlchars "^2.1.1" +"semver@2 || 3 || 4 || 5", semver@^5.3.0, semver@^5.6.0, semver@^5.7.0: + version "5.7.1" + resolved "https://registry.yarnpkg.com/semver/-/semver-5.7.1.tgz#a954f931aeba508d307bbf069eff0c01c96116f7" + integrity sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ== + semver@7.0.0: version "7.0.0" resolved "https://registry.yarnpkg.com/semver/-/semver-7.0.0.tgz#5f3ca35761e47e05b206c6daff2cf814f0316b8e" integrity sha512-+GB6zVA9LWh6zovYQLALHwv5rb2PHGlJi3lfiqIHxR0uuwCgefcOJc59v9fv1w8GbStwxuuqqAjI9NMAOOgq1A== -semver@^5.3.0, semver@^5.4.1, semver@^5.5.0, semver@^5.6.0, semver@^5.7.0: - version "5.7.1" - resolved "https://registry.yarnpkg.com/semver/-/semver-5.7.1.tgz#a954f931aeba508d307bbf069eff0c01c96116f7" - integrity sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ== - -semver@^6.0.0, semver@^6.1.2, semver@^6.3.0: +semver@^6.0.0, semver@^6.1.1, semver@^6.1.2, semver@^6.3.0: version "6.3.0" resolved "https://registry.yarnpkg.com/semver/-/semver-6.3.0.tgz#ee0a64c8af5e8ceea67687b133761e1becbd1d3d" integrity sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw== +semver@^7.2.1: + version "7.3.5" + resolved "https://registry.yarnpkg.com/semver/-/semver-7.3.5.tgz#0b621c879348d8998e4b0e4be94b3f12e6018ef7" + integrity sha512-PoeGJYh8HK4BTO/a9Tf6ZG3veo/A7ZVsYrSA6J8ny9nb3B1VrpkuN+z9OE5wfE5p6H4LchYZsegiQgbJD94ZFQ== + dependencies: + lru-cache "^6.0.0" + serialize-javascript@^2.1.2: version "2.1.2" resolved "https://registry.yarnpkg.com/serialize-javascript/-/serialize-javascript-2.1.2.tgz#ecec53b0e0317bdc95ef76ab7074b7384785fa61" @@ -3768,12 +4531,12 @@ set-blocking@^2.0.0, set-blocking@~2.0.0: resolved "https://registry.yarnpkg.com/set-blocking/-/set-blocking-2.0.0.tgz#045f9782d011ae9a6803ddd382b24392b3d890f7" integrity sha1-BF+XgtARrppoA93TgrJDkrPYkPc= -shebang-command@^1.2.0: - version "1.2.0" - resolved "https://registry.yarnpkg.com/shebang-command/-/shebang-command-1.2.0.tgz#44aac65b695b03398968c39f363fee5deafdf1ea" - integrity sha1-RKrGW2lbAzmJaMOfNj/uXer98eo= +shallow-clone@^3.0.0: + version "3.0.1" + resolved "https://registry.yarnpkg.com/shallow-clone/-/shallow-clone-3.0.1.tgz#8f2981ad92531f55035b01fb230769a40e02efa3" + integrity sha512-/6KqX+GVUdqPuPPd2LxDDxzX6CAbjJehAAOKlNpqqUpAqPM6HeL8f+o3a+JsyGjn2lv0WY8UsTgUJjU9Ok55NA== dependencies: - shebang-regex "^1.0.0" + kind-of "^6.0.2" shebang-command@^2.0.0: version "2.0.0" @@ -3782,16 +4545,20 @@ shebang-command@^2.0.0: dependencies: shebang-regex "^3.0.0" -shebang-regex@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/shebang-regex/-/shebang-regex-1.0.0.tgz#da42f49740c0b42db2ca9728571cb190c98efea3" - integrity sha1-2kL0l0DAtC2yypcoVxyxkMmO/qM= - shebang-regex@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/shebang-regex/-/shebang-regex-3.0.0.tgz#ae16f1644d873ecad843b0307b143362d4c42172" integrity sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A== +side-channel@^1.0.4: + version "1.0.4" + resolved "https://registry.yarnpkg.com/side-channel/-/side-channel-1.0.4.tgz#efce5c8fdc104ee751b25c58d4290011fa5ea2cf" + integrity sha512-q5XPytqFEIKHkGdiMIrY10mvLRvnQh42/+GoBlFW3b2LXLE2xxJpZFdm94we0BaoV3RwJyGqg5wS7epxTv0Zvw== + dependencies: + call-bind "^1.0.0" + get-intrinsic "^1.0.2" + object-inspect "^1.9.0" + signal-exit@^3.0.0, signal-exit@^3.0.2: version "3.0.3" resolved "https://registry.yarnpkg.com/signal-exit/-/signal-exit-3.0.3.tgz#a1410c2edd8f077b08b4e253c8eacfcaf057461c" @@ -3816,14 +4583,14 @@ slash@^3.0.0: resolved "https://registry.yarnpkg.com/slash/-/slash-3.0.0.tgz#6539be870c165adbd5240220dbe361f1bc4d4634" integrity sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q== -slice-ansi@^2.1.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/slice-ansi/-/slice-ansi-2.1.0.tgz#cacd7693461a637a5788d92a7dd4fba068e81636" - integrity sha512-Qu+VC3EwYLldKa1fCxuuvULvSJOKEgk9pi8dZeCVK7TqBfUNTH4sFkk4joj8afVSfAYgJoSOetjx9QWOJ5mYoQ== +slice-ansi@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/slice-ansi/-/slice-ansi-4.0.0.tgz#500e8dd0fd55b05815086255b3195adf2a45fe6b" + integrity sha512-qMCMfhY040cVHT43K9BFygqYbUPFZKHOg7K73mtTWJRb8pyP3fzf4Ixd5SzdEJQ6MRUg/WBnOLxghZtKKurENQ== dependencies: - ansi-styles "^3.2.0" - astral-regex "^1.0.0" - is-fullwidth-code-point "^2.0.0" + ansi-styles "^4.0.0" + astral-regex "^2.0.0" + is-fullwidth-code-point "^3.0.0" source-map-support@^0.5.16, source-map-support@~0.5.12: version "0.5.19" @@ -3876,6 +4643,14 @@ spdx-compare@^1.0.0: spdx-expression-parse "^3.0.0" spdx-ranges "^2.0.0" +spdx-correct@^3.0.0: + version "3.1.1" + resolved "https://registry.yarnpkg.com/spdx-correct/-/spdx-correct-3.1.1.tgz#dece81ac9c1e6713e5f7d1b6f17d468fa53d89a9" + integrity sha512-cOYcUWwhCuHCXi49RhFRCyJEK3iPj1Ziz9DpViV3tbZOwXD49QzIN3MpOLJNxh2qwq2lJJZaKMVw9qNi4jTC0w== + dependencies: + spdx-expression-parse "^3.0.0" + spdx-license-ids "^3.0.0" + spdx-exceptions@^2.1.0: version "2.3.0" resolved "https://registry.yarnpkg.com/spdx-exceptions/-/spdx-exceptions-2.3.0.tgz#3f28ce1a77a00372683eade4a433183527a2163d" @@ -3897,19 +4672,19 @@ spdx-expression-validate@2.0.0: spdx-expression-parse "^3.0.0" spdx-license-ids@^3.0.0: - version "3.0.7" - resolved "https://registry.yarnpkg.com/spdx-license-ids/-/spdx-license-ids-3.0.7.tgz#e9c18a410e5ed7e12442a549fbd8afa767038d65" - integrity sha512-U+MTEOO0AiDzxwFvoa4JVnMV6mZlJKk2sBLt90s7G0Gd0Mlknc7kxEn3nuDPNZRta7O2uy8oLcZLVT+4sqNZHQ== + version "3.0.10" + resolved "https://registry.yarnpkg.com/spdx-license-ids/-/spdx-license-ids-3.0.10.tgz#0d9becccde7003d6c658d487dd48a32f0bf3014b" + integrity sha512-oie3/+gKf7QtpitB0LYLETe+k8SifzsX4KixvpOsbI6S0kRiRQ5MKOio8eMSAKQ17N06+wdEOXRiId+zOxo0hA== spdx-ranges@^2.0.0: version "2.1.1" resolved "https://registry.yarnpkg.com/spdx-ranges/-/spdx-ranges-2.1.1.tgz#87573927ba51e92b3f4550ab60bfc83dd07bac20" integrity sha512-mcdpQFV7UDAgLpXEE/jOMqvK4LBoO0uTQg0uvXUewmEFhpiZx5yJSZITHB8w1ZahKdhfZqP5GPEOKLyEq5p8XA== -spdx-satisfies@5.0.0: - version "5.0.0" - resolved "https://registry.yarnpkg.com/spdx-satisfies/-/spdx-satisfies-5.0.0.tgz#d740b8f14caeada36fb307629dee87146970a256" - integrity sha512-/hGhwh20BeGmkA+P/lm06RvXD94JduwNxtx/oX3B5ClPt1/u/m5MCaDNo1tV3Y9laLkQr/NRde63b9lLMhlNfw== +spdx-satisfies@5.0.1: + version "5.0.1" + resolved "https://registry.yarnpkg.com/spdx-satisfies/-/spdx-satisfies-5.0.1.tgz#9feeb2524686c08e5f7933c16248d4fdf07ed6a6" + integrity sha512-Nwor6W6gzFp8XX4neaKQ7ChV4wmpSh2sSDemMFSzHxpTw460jxFYeOn+jq4ybnSSw/5sc3pjka9MQPouksQNpw== dependencies: spdx-compare "^1.0.0" spdx-expression-parse "^3.0.0" @@ -3949,7 +4724,7 @@ string-width@^1.0.1: is-fullwidth-code-point "^1.0.0" strip-ansi "^3.0.0" -"string-width@^1.0.2 || 2": +"string-width@^1.0.2 || 2", string-width@^2.1.0: version "2.1.1" resolved "https://registry.yarnpkg.com/string-width/-/string-width-2.1.1.tgz#ab93f27a8dc13d28cac815c462143a6d9012ae9e" integrity sha512-nOqH59deCq9SRHlxq1Aw85Jnt4w6KvLKqWVik6oA9ZklXLNIOlqg4F2yrT1MVaTjAqvVwdfeZ7w7aCvJD7ugkw== @@ -3967,28 +4742,28 @@ string-width@^3.0.0, string-width@^3.1.0: strip-ansi "^5.1.0" string-width@^4.1.0, string-width@^4.2.0: - version "4.2.0" - resolved "https://registry.yarnpkg.com/string-width/-/string-width-4.2.0.tgz#952182c46cc7b2c313d1596e623992bd163b72b5" - integrity sha512-zUz5JD+tgqtuDjMhwIg5uFVV3dtqZ9yQJlZVfq4I01/K5Paj5UHj7VyrQOJvzawSVlKpObApbfD0Ed6yJc+1eg== + version "4.2.2" + resolved "https://registry.yarnpkg.com/string-width/-/string-width-4.2.2.tgz#dafd4f9559a7585cfba529c6a0a4f73488ebd4c5" + integrity sha512-XBJbT3N4JhVumXE0eoLU9DCjcaF92KLNqTmFCnG1pf8duUxFGwtP6AD6nkjw9a3IdiRtL3E2w3JDiE/xi3vOeA== dependencies: emoji-regex "^8.0.0" is-fullwidth-code-point "^3.0.0" strip-ansi "^6.0.0" -string.prototype.trimend@^1.0.1: - version "1.0.3" - resolved "https://registry.yarnpkg.com/string.prototype.trimend/-/string.prototype.trimend-1.0.3.tgz#a22bd53cca5c7cf44d7c9d5c732118873d6cd18b" - integrity sha512-ayH0pB+uf0U28CtjlLvL7NaohvR1amUvVZk+y3DYb0Ey2PUV5zPkkKy9+U1ndVEIXO8hNg18eIv9Jntbii+dKw== +string.prototype.trimend@^1.0.4: + version "1.0.4" + resolved "https://registry.yarnpkg.com/string.prototype.trimend/-/string.prototype.trimend-1.0.4.tgz#e75ae90c2942c63504686c18b287b4a0b1a45f80" + integrity sha512-y9xCjw1P23Awk8EvTpcyL2NIr1j7wJ39f+k6lvRnSMz+mz9CGz9NYPelDk42kOz6+ql8xjfK8oYzy3jAP5QU5A== dependencies: - call-bind "^1.0.0" + call-bind "^1.0.2" define-properties "^1.1.3" -string.prototype.trimstart@^1.0.1: - version "1.0.3" - resolved "https://registry.yarnpkg.com/string.prototype.trimstart/-/string.prototype.trimstart-1.0.3.tgz#9b4cb590e123bb36564401d59824298de50fd5aa" - integrity sha512-oBIBUy5lea5tt0ovtOFiEQaBkoBBkyJhZXzJYrSmDo5IUUqbOPvVezuRs/agBIdZ2p2Eo1FD6bD9USyBLfl3xg== +string.prototype.trimstart@^1.0.4: + version "1.0.4" + resolved "https://registry.yarnpkg.com/string.prototype.trimstart/-/string.prototype.trimstart-1.0.4.tgz#b36399af4ab2999b4c9c648bd7a3fb2bb26feeed" + integrity sha512-jh6e984OBfvxS50tdY2nRZnoC5/mLFKOREQfw8t5yytkoUsJRNxvI/E39qu1sD0OtWI3OC0XgKSmcWwziwYuZw== dependencies: - call-bind "^1.0.0" + call-bind "^1.0.2" define-properties "^1.1.3" string_decoder@~1.1.1: @@ -4026,17 +4801,27 @@ strip-ansi@^6.0.0: dependencies: ansi-regex "^5.0.0" -strip-bom@^4.0.0: +strip-bom@4.0.0, strip-bom@^4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/strip-bom/-/strip-bom-4.0.0.tgz#9c3505c1db45bcedca3d9cf7a16f5c5aa3901878" integrity sha512-3xurFv5tEgii33Zi8Jtp55wEIILR9eh34FAW00PZf+JnSsTmV/ioewSgQl97JHvgjoRGwPShsWm+IdrxB35d0w== +strip-bom@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/strip-bom/-/strip-bom-3.0.0.tgz#2334c18e9c759f7bdd56fdef7e9ae3d588e68ed3" + integrity sha1-IzTBjpx1n3vdVv3vfprj1YjmjtM= + strip-json-comments@2.0.1, strip-json-comments@~2.0.1: version "2.0.1" resolved "https://registry.yarnpkg.com/strip-json-comments/-/strip-json-comments-2.0.1.tgz#3c531942e908c2697c0ec344858c286c7ca0a60a" integrity sha1-PFMZQukIwml8DsNEhYwobHygpgo= -strip-json-comments@^3.0.1: +strip-json-comments@3.0.1: + version "3.0.1" + resolved "https://registry.yarnpkg.com/strip-json-comments/-/strip-json-comments-3.0.1.tgz#85713975a91fb87bf1b305cca77395e40d2a64a7" + integrity sha512-VTyMAUfdm047mwKl+u79WIdrZxtFtn+nBxHeb844XBQ9uMNTuTHdx2hc5RiAJYqwTj3wc/xe5HLSdJSkJ+WfZw== + +strip-json-comments@^3.1.0, strip-json-comments@^3.1.1: version "3.1.1" resolved "https://registry.yarnpkg.com/strip-json-comments/-/strip-json-comments-3.1.1.tgz#31f1281b3832630434831c310c01cccda8cbe006" integrity sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig== @@ -4081,28 +4866,30 @@ symbol-tree@^3.2.2: resolved "https://registry.yarnpkg.com/symbol-tree/-/symbol-tree-3.2.4.tgz#430637d248ba77e078883951fb9aa0eed7c63fa2" integrity sha512-9QNk5KwDF+Bvz+PyObkmSYjI5ksVUYtjW7AU22r2NKcfLJcXp96hkDWU3+XndOsUb+AQ9QhfzfCT2O+CNWT5Tw== -table@^5.2.3: - version "5.4.6" - resolved "https://registry.yarnpkg.com/table/-/table-5.4.6.tgz#1292d19500ce3f86053b05f0e8e7e4a3bb21079e" - integrity sha512-wmEc8m4fjnob4gt5riFRtTu/6+4rSe12TpAELNSqHMfF3IqnA+CH37USM6/YR3qRZv7e56kAEAtd6nKZaxe0Ug== +table@^6.0.9: + version "6.7.1" + resolved "https://registry.yarnpkg.com/table/-/table-6.7.1.tgz#ee05592b7143831a8c94f3cee6aae4c1ccef33e2" + integrity sha512-ZGum47Yi6KOOFDE8m223td53ath2enHcYLgOCjGr5ngu8bdIARQk6mN/wRMv4yMRcHnCSnHbCEha4sobQx5yWg== dependencies: - ajv "^6.10.2" - lodash "^4.17.14" - slice-ansi "^2.1.0" - string-width "^3.0.0" + ajv "^8.0.1" + lodash.clonedeep "^4.5.0" + lodash.truncate "^4.4.2" + slice-ansi "^4.0.0" + string-width "^4.2.0" + strip-ansi "^6.0.0" tar@^4: - version "4.4.13" - resolved "https://registry.yarnpkg.com/tar/-/tar-4.4.13.tgz#43b364bc52888d555298637b10d60790254ab525" - integrity sha512-w2VwSrBoHa5BsSyH+KxEqeQBAllHhccyMFVHtGtdMpF4W7IRWfZjFiQceJPChOeTsSDVUpER2T8FA93pr0L+QA== - dependencies: - chownr "^1.1.1" - fs-minipass "^1.2.5" - minipass "^2.8.6" - minizlib "^1.2.1" - mkdirp "^0.5.0" - safe-buffer "^5.1.2" - yallist "^3.0.3" + version "4.4.16" + resolved "https://registry.yarnpkg.com/tar/-/tar-4.4.16.tgz#4a48b3c025e77d9d0c788f038a09b91c594d326d" + integrity sha512-gOVUT/KWPkGFZQmCRDVFNUWBl7niIo/PRR7lzrIqtZpit+st54lGROuVjc6zEQM9FhH+dJfQIl+9F0k8GNXg5g== + dependencies: + chownr "^1.1.4" + fs-minipass "^1.2.7" + minipass "^2.9.0" + minizlib "^1.3.3" + mkdirp "^0.5.5" + safe-buffer "^5.2.1" + yallist "^3.1.1" terser@^4.6.2: version "4.8.0" @@ -4175,6 +4962,15 @@ tr46@^1.0.1: dependencies: punycode "^2.1.0" +tsconfig-paths@^3.9.0: + version "3.10.1" + resolved "https://registry.yarnpkg.com/tsconfig-paths/-/tsconfig-paths-3.10.1.tgz#79ae67a68c15289fdf5c51cb74f397522d795ed7" + integrity sha512-rETidPDgCpltxF7MjBZlAFPUHv5aHH2MymyPvh+vEyWAED4Eb/WeMbsnD/JDr4OKPOA1TssDHgIcpTN5Kh0p6Q== + dependencies: + json5 "^2.2.0" + minimist "^1.2.0" + strip-bom "^3.0.0" + tslib@^1.9.0: version "1.14.1" resolved "https://registry.yarnpkg.com/tslib/-/tslib-1.14.1.tgz#cf2d38bdc34a134bcaf1091c41f6619e2f672d00" @@ -4192,6 +4988,13 @@ tweetnacl@^0.14.3, tweetnacl@~0.14.0: resolved "https://registry.yarnpkg.com/tweetnacl/-/tweetnacl-0.14.5.tgz#5ae68177f192d4456269d108afa93ff8743f4f64" integrity sha1-WuaBd/GS1EViadEIr6k/+HQ/T2Q= +type-check@^0.4.0, type-check@~0.4.0: + version "0.4.0" + resolved "https://registry.yarnpkg.com/type-check/-/type-check-0.4.0.tgz#07b8203bfa7056c0657050e3ccd2c37730bab8f1" + integrity sha512-XleUoc9uwGXqjWwXaUTZAmzMcFZ5858QA2vvx1Ur5xIcixXIP+8LnFDgRplU30us6teqdlskFfu+ae4K79Ooew== + dependencies: + prelude-ls "^1.2.1" + type-check@~0.3.2: version "0.3.2" resolved "https://registry.yarnpkg.com/type-check/-/type-check-0.3.2.tgz#5884cab512cf1d355e3fb784f30804b2b520db72" @@ -4204,12 +5007,12 @@ type-detect@^4.0.0, type-detect@^4.0.5: resolved "https://registry.yarnpkg.com/type-detect/-/type-detect-4.0.8.tgz#7646fb5f18871cfbb7749e69bd39a6388eb7450c" integrity sha512-0fr/mIH1dlO+x7TlcMy+bIDqKPsw/70tVyeHW787goQjhmqaZe10uwLujubK9q9Lg6Fiho1KUKDYz0Z7k7g5/g== -type-fest@^0.11.0: - version "0.11.0" - resolved "https://registry.yarnpkg.com/type-fest/-/type-fest-0.11.0.tgz#97abf0872310fed88a5c466b25681576145e33f1" - integrity sha512-OdjXJxnCN1AvyLSzeKIgXTXxV+99ZuXl3Hpo9XpJAv9MBcHrrJOQ5kV7ypXOuQie+AmWG25hLbiKdwYTifzcfQ== +type-fest@^0.20.2: + version "0.20.2" + resolved "https://registry.yarnpkg.com/type-fest/-/type-fest-0.20.2.tgz#1bf207f4b28f91583666cb5fbd327887301cd5f4" + integrity sha512-Ne+eE4r0/iWnpAxD852z3A+N0Bt5RN//NjJwRd2VFHEmrywxf5vsZlh4R6lixl6B+wz/8d+maTSAkN1FIkI3LQ== -type-fest@^0.8.0, type-fest@^0.8.1: +type-fest@^0.8.0: version "0.8.1" resolved "https://registry.yarnpkg.com/type-fest/-/type-fest-0.8.1.tgz#09e249ebde851d3b1e48d27c105444667f17b83d" integrity sha512-4dbzIzqvjtgiM5rw1k5rEHtBANKmdudhGyBEajN01fEyhaAIhsoKNy6y7+IN93IfpFtwY9iqi7kD+xwKhQsNJA== @@ -4221,15 +5024,20 @@ typedarray-to-buffer@^3.1.5: dependencies: is-typedarray "^1.0.0" -uglify-js@^3.1.4: - version "3.13.5" - resolved "https://registry.yarnpkg.com/uglify-js/-/uglify-js-3.13.5.tgz#5d71d6dbba64cf441f32929b1efce7365bb4f113" - integrity sha512-xtB8yEqIkn7zmOyS2zUNBsYCBRhDkvlNxMMY2smuJ/qA8NCHeQvKCF3i9Z4k8FJH4+PJvZRtMrPynfZ75+CSZw== +uglify-js@^3.1.4, uglify-js@^3.4.9: + version "3.14.1" + resolved "https://registry.yarnpkg.com/uglify-js/-/uglify-js-3.14.1.tgz#e2cb9fe34db9cb4cf7e35d1d26dfea28e09a7d06" + integrity sha512-JhS3hmcVaXlp/xSo3PKY5R0JqKs5M3IV+exdLHW99qKvKivPO4Z8qbej6mte17SOPqAOVMjt/XGgWacnFSzM3g== -uglify-js@^3.4.9: - version "3.12.4" - resolved "https://registry.yarnpkg.com/uglify-js/-/uglify-js-3.12.4.tgz#93de48bb76bb3ec0fc36563f871ba46e2ee5c7ee" - integrity sha512-L5i5jg/SHkEqzN18gQMTWsZk3KelRsfD1wUVNqtq0kzqWQqcJjyL8yc1o8hJgRrWqrAl2mUFbhfznEIoi7zi2A== +unbox-primitive@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/unbox-primitive/-/unbox-primitive-1.0.1.tgz#085e215625ec3162574dc8859abee78a59b14471" + integrity sha512-tZU/3NqK3dA5gpE1KtyiJUrEB0lxnGkMFHptJ7q6ewdZ8s12QrODwNbhIJStmJkd1QDXa1NRA8aF2A1zk/Ypyw== + dependencies: + function-bind "^1.1.1" + has-bigints "^1.0.1" + has-symbols "^1.0.2" + which-boxed-primitive "^1.0.2" unicode-canonical-property-names-ecmascript@^1.0.4: version "1.0.4" @@ -4260,9 +5068,9 @@ universalify@^0.1.0: integrity sha512-rBJeI5CXAlmy1pV+617WB9J63U6XcazHHF2f2dbJix4XzpUF0RS3Zbj0FGIOCAva5P/d/GBOYaACQ1w+0azUkg== uri-js@^4.2.2: - version "4.4.0" - resolved "https://registry.yarnpkg.com/uri-js/-/uri-js-4.4.0.tgz#aa714261de793e8a82347a7bcc9ce74e86f28602" - integrity sha512-B0yRTzYdUCCn9n+F4+Gh4yIDtMQcaJsmYBDsTSG8g/OejKBodLQ2IHfN3bM7jUsRXndopT7OIXWdYqc1fjmV6g== + version "4.4.1" + resolved "https://registry.yarnpkg.com/uri-js/-/uri-js-4.4.1.tgz#9b1a52595225859e55f669d928f88c6c57f2a77e" + integrity sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg== dependencies: punycode "^2.1.0" @@ -4282,9 +5090,17 @@ uzip@0.20201231.0: integrity sha512-OZeJfZP+R0z9D6TmBgLq2LHzSSptGMGDGigGiEe0pr8UBe/7fdflgHlHBNDASTXB5jnFuxHpNaJywSg8YFeGng== v8-compile-cache@^2.0.3: - version "2.2.0" - resolved "https://registry.yarnpkg.com/v8-compile-cache/-/v8-compile-cache-2.2.0.tgz#9471efa3ef9128d2f7c6a7ca39c4dd6b5055b132" - integrity sha512-gTpR5XQNKFwOd4clxfnhaqvfqMpqEwr4tOtCyz4MtYZX2JYhfr1JvBFKdS+7K/9rfpZR3VLX+YWBbKoxCgS43Q== + version "2.3.0" + resolved "https://registry.yarnpkg.com/v8-compile-cache/-/v8-compile-cache-2.3.0.tgz#2de19618c66dc247dcfb6f99338035d8245a2cee" + integrity sha512-l8lCEmLcLYZh4nbunNZvQCJc5pv7+RCwa8q/LdUx8u7lsWvPDKmpodJAJNwkAhJC//dFY48KuIEmjtd4RViDrA== + +validate-npm-package-license@^3.0.1: + version "3.0.4" + resolved "https://registry.yarnpkg.com/validate-npm-package-license/-/validate-npm-package-license-3.0.4.tgz#fc91f6b9c7ba15c857f4cb2c5defeec39d4f410a" + integrity sha512-DpKm2Ui/xN7/HQKCtpZxoRWBhZ9Z0kqtygG8XCgNQ8ZlDnxuQmWhj566j8fN4Cu3/JmbhsDo7fcAJq4s9h27Ew== + dependencies: + spdx-correct "^3.0.0" + spdx-expression-parse "^3.0.0" verror@1.10.0: version "1.10.0" @@ -4337,12 +5153,23 @@ whatwg-url@^7.0.0: tr46 "^1.0.1" webidl-conversions "^4.0.2" +which-boxed-primitive@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/which-boxed-primitive/-/which-boxed-primitive-1.0.2.tgz#13757bc89b209b049fe5d86430e21cf40a89a8e6" + integrity sha512-bwZdv0AKLpplFY2KZRX6TvyuN7ojjr7lwkg6ml0roIy9YeuSr7JS372qlNW18UQYzgYK9ziGcerWqZOmEn9VNg== + dependencies: + is-bigint "^1.0.1" + is-boolean-object "^1.1.0" + is-number-object "^1.0.4" + is-string "^1.0.5" + is-symbol "^1.0.3" + which-module@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/which-module/-/which-module-2.0.0.tgz#d9ef07dce77b9902b8a3a8fa4b31c3e3f7e6e87a" integrity sha1-2e8H3Od7mQK4o6j6SzHD4/fm6Ho= -which@1.3.1, which@^1.1.1, which@^1.2.9: +which@1.3.1, which@^1.1.1, which@^1.2.14: version "1.3.1" resolved "https://registry.yarnpkg.com/which/-/which-1.3.1.tgz#a45043d54f5805316da8d62f9f50918d3da70b0a" integrity sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ== @@ -4363,7 +5190,7 @@ wide-align@1.1.3, wide-align@^1.1.0: dependencies: string-width "^1.0.2 || 2" -word-wrap@~1.2.3: +word-wrap@^1.0.3, word-wrap@^1.2.3, word-wrap@~1.2.3: version "1.2.3" resolved "https://registry.yarnpkg.com/word-wrap/-/word-wrap-1.2.3.tgz#610636f6b1f703891bd34771ccb17fb93b47079c" integrity sha512-Hz/mrNwitNRh/HUAtM/VT/5VH+ygD6DV7mYKZAtHOrbs8U7lvPS6xf7EJKMF0uW1KJCl0H701g3ZGus+muE5vQ== @@ -4406,17 +5233,10 @@ write-file-atomic@^3.0.0: signal-exit "^3.0.2" typedarray-to-buffer "^3.1.5" -write@1.0.3: - version "1.0.3" - resolved "https://registry.yarnpkg.com/write/-/write-1.0.3.tgz#0800e14523b923a387e415123c865616aae0f5c3" - integrity sha512-/lg70HAjtkUgWPVZhZcm+T4hkL8Zbtp1nFNOn3lRrxnlv50SRBv7cR7RqR+GMsd3hUXy9hWBo4CHTbFTcOYwig== - dependencies: - mkdirp "^0.5.1" - ws@^7.0.0: - version "7.4.6" - resolved "https://registry.yarnpkg.com/ws/-/ws-7.4.6.tgz#5654ca8ecdeee47c33a9a4bf6d28e2be2980377c" - integrity sha512-YmhHDO4MzaDLB+M9ym/mDA5z0naX8j7SIlT8f8z+I0VtzsRbekxEutHSme7NPS2qE8StCYQNUnfWdXta/Yu85A== + version "7.5.3" + resolved "https://registry.yarnpkg.com/ws/-/ws-7.5.3.tgz#160835b63c7d97bfab418fc1b8a9fced2ac01a74" + integrity sha512-kQ/dHIzuLrS6Je9+uv81ueZomEwH0qVYstcAQ4/Z93K8zeko9gtAbttJWzoC5ukqXY1PpoouV3+VSOqEAFt5wg== xml-name-validator@^3.0.0: version "3.0.0" @@ -4429,15 +5249,25 @@ xmlchars@^2.1.1: integrity sha512-JZnDKK8B0RCDw84FNdDAIpZK+JuJw+s7Lz8nksI7SIuU3UXJJslUthsi+uWBUYOwPFwW7W7PRLRfUKpxjtjFCw== y18n@^4.0.0: - version "4.0.1" - resolved "https://registry.yarnpkg.com/y18n/-/y18n-4.0.1.tgz#8db2b83c31c5d75099bb890b23f3094891e247d4" - integrity sha512-wNcy4NvjMYL8gogWWYAO7ZFWFfHcbdbE57tZO8e4cbpj8tfUcwrwqSl3ad8HxpYWCdXcJUCeKKZS62Av1affwQ== + version "4.0.3" + resolved "https://registry.yarnpkg.com/y18n/-/y18n-4.0.3.tgz#b5f259c82cd6e336921efd7bfd8bf560de9eeedf" + integrity sha512-JKhqTOwSrqNA1NY5lSztJ1GrBiUodLMmIZuLiDaMRJ+itFd+ABVE8XBjOvIWL+rSqNDC74LCSFmlb/U4UZ4hJQ== -yallist@^3.0.0, yallist@^3.0.3: +yallist@^3.0.0, yallist@^3.1.1: version "3.1.1" resolved "https://registry.yarnpkg.com/yallist/-/yallist-3.1.1.tgz#dbb7daf9bfd8bac9ab45ebf602b8cbad0d5d08fd" integrity sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g== +yallist@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/yallist/-/yallist-4.0.0.tgz#9bb92790d9c0effec63be73519e11a35019a3a72" + integrity sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A== + +yaml@^1.10.0: + version "1.10.2" + resolved "https://registry.yarnpkg.com/yaml/-/yaml-1.10.2.tgz#2301c5ffbf12b467de8da2333a459e29e7920e4b" + integrity sha512-r3vXyErRCYJ7wg28yvBY5VSoAF8ZvlcW9/BwUzEtUsjvX/DKs24dIkuwjtuprwJJHsbyUbLApepYTR1BN4uHrg== + yargs-parser@13.1.1: version "13.1.1" resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-13.1.1.tgz#d26058532aa06d365fe091f6a1fc06b2f7e5eca0"