diff --git a/CNAME b/CNAME new file mode 100644 index 00000000..76faa377 --- /dev/null +++ b/CNAME @@ -0,0 +1 @@ +sequencer.publiclab.org diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md deleted file mode 100644 index 13d1fc14..00000000 --- a/CONTRIBUTING.md +++ /dev/null @@ -1,481 +0,0 @@ -Contributing to Image Sequencer -=== - -Happily accepting pull requests; to edit the core library, modify files in `./src/`. To build, run `npm install` followed by `grunt build`. - -On ARM based devices, the `gl` module may require some libraries to be re-installed: - -`sudo apt-get install -y build-essential xserver-xorg-dev libxext-dev libxi-dev libglu1-mesa-dev libglew-dev pkg-config` -- see https://github.com/stackgl/headless-gl#ubuntudebian for more. - -Most contribution (we imagine) would be in the form of API-compatible modules, which need not be directly included. - -## Jump To - -* [README.md](https://github.com/publiclab/image-sequencer) -* [Contributing Modules](#contributing-modules) -* [Info File](#info-file) -* [Ideas](#Contribution-ideas) -* [Grunt Tasks](#grunt-tasks) -* [UI Helper Methods](#ui-helper-methods) -* [Scripts](#scripts) - -**** - -## Contribution-ideas - -See [this issue](https://github.com/publiclab/image-sequencer/issues/118) for a range of ideas for new contributions and links to possibly helpful libraries, or you can solve an [existing issue](https://github.com/publiclab/image-sequencer/labels/module). Also see the [new features issues list](https://github.com/publiclab/image-sequencer/labels/new-feature). - -### Bugs - -If you find a bug please list it here, and help us develop Image Sequencer by [opening an issue](https://github.com/publiclab/image-sequencer/issues/new)! - -**** - -## Contributing modules - -Most contributions can happen in modules, rather than to core library code. Modules and their [corresponding info files](#info-file) are included into the library in this file: https://github.com/publiclab/image-sequencer/blob/main/src/Modules.js#L5-L7 - -Module names, descriptions, and parameters are set in the `info.json` file -- [see below](#info-file). - -Any module must follow this basic format: - -```js -module.exports = function ModuleName(options,UI) { - - var output; - // Module requirements have been simplified in version 3, see https://github.com/publiclab/image-sequencer/blob/master/CONTRIBUTING.md#contributing-modules - - function draw(input,callback) { - - var output = function(input){ - /* do something with the input */ - return input; - } - - this.output = output(input); // run the output and assign it to this.output - callback(); - } - - return { - options: options, - draw: draw, - output: output, - UI: UI - } -} -``` - -Image Sequencer modules are designed to be run either in the browser or in a Node.js environment. For dynamically loaded modules, that means that any uses of `require()` to include an external library must be compiled using a system like `browserify` or `webpack` to ensure browser compatibility. An example of this can be found here: - -https://github.com/tech4gt/image-sequencer - -### Browser/node compatibility - -If you wish to offer a module without browser-compatibility, please indicate this in the returned `info` object as: - -module.exports = [ - ModuleName, - { only: ['node'] } -]; - -If you believe that full cross-compatibility is possible, but need help, please open an issue on your module's issue tracker requesting assistance (and potentially link to it from an inline comment or the module description). - -Any Independent Module Must follow this basic format -```js -function ModuleName(options,UI) { - - var output; - - function draw(input,callback) { - - var output = function(input){ - /* do something with the input */ - return input; - } - - this.output = output(input); // run the output and assign it to this.output - callback(); - } - - return { - options: options, - draw: draw, - output: output, - UI: UI - }; -} - - module.exports = [ModuleName,{ - "name": "ModuleName", - "description": "", - "inputs": { - // inputs here - } - /* Info can be defined here or imported from a json file */ - // require('./info.json') This only works in node - // In a module compiled with browserify or webpack, a require() can be used to - // load a standard info.json file. - ]; -``` -### Running a browser-only module in node -If your module has browser specific code or you are consuming a dependency which does the `gl-context` api. We designed this api especially for webl based modules but since it runs the module in a headless browser, ti supports all browser specific APIs. - -The api must be used in the following format -```js -var step = this; - - if (!options.inBrowser) { - require('../_nomodule/gl-context')(input, callback, step, options); - } - else { - /* Browser specific code */ - } -``` - -### options - -The object `options` stores some important information. This is how you can accept -input from users. If you require a variable "x" from the user and the user passes -it in, you will be able to access it as `options.x`. - -Options also has some in-built properties. The `options.inBrowser` boolean denotes -whether your module is being run on a browser. - -### draw() - -To add a module to Image Sequencer, it must have a `draw` method; you can wrap an existing module to add them: - -* `module.draw(input, callback)` - -The `draw` method should accept an `input` parameter, which will be an object of the form: - -```js -input = { - src: "datauri of an image here", - format: "jpeg/png/etc", - // utility functions - getPixels: "function to get Image pixels. Wrapper around https://npmjs.com/get-pixels", - savePixels: "function to save Image pixels. Wrapper around https://npmjs.com/save-pixels", - lodash: "wrapper around lodash library, https://github.com/lodash", - dataUriToBuffer: "wrapper around https://www.npmjs.com/package/data-uri-to-buffer", - pixelManipulation: "general purpose pixel manipulation API, see https://github.com/publiclab/image-sequencer/blob/master/src/modules/_nomodule/PixelManipulation.js" -} -``` -For example usage of pixelManipulation see https://github.com/publiclab/image-sequencer/blob/main/src/modules/Invert/Module.js - -**The module is included in the browser inside a script tag and since the code runs directly in the browser if any other module is required apart from the apis available on the input object, it should be either bundled with the module code and imported in es6 format or the module code must be browserified before distribution for browser** - -The draw method is run every time the step is `run` using `sequencer.run()`. -So any calculations must go **into** the `draw()` method's definition. - -What is not in the draw method, but is in the `module.exports` is executed only -when the step is added. So whatever external npm modules are to be loaded, or -constant definitions must be done **outside** the `draw()` method's definition. - -`draw()` receives two arguments - `input` and `callback` : -* `input` is an object which is essentially the output of the previous step. - ```js - input = { - src: "<$DataURL>", - format: "" - } - ``` -* `callback` is a function which is responsible to tell the sequencer that the step has been "drawn". - -When you have done your calculations and produced an image output, you are required to set `this.output` to an object similar to what the input object was, call `callback()`, and set `options.step.output` equal to the output DataURL - -* `progressObj` is an optional additional Object that can be passed in the format `draw(input, callback, progressObj)`, which handles the progress output; see [Progress reporting](#progress-reporting) below. - -### UI Methods - -The module is responsible for emitting various events for the UI to capture. - -There are four events in all: - -* `UI.onSetup(options.step)` must be emitted when the module is added. So it must be emitted outside the draw method's definition as shown above. -* `UI.onDraw(options.step)` must be emitted whenever the `draw()` method is called. So it should ideally be the first line of the definition of the `draw` method. -* `UI.onComplete(options.step)` must be emitted whenever the output of a draw call -is ready. An argument, that is the DataURL of the output image must be passed in. -* `UI.onRemove(options.step)` is emitted automatically and the module should not emit it. -* `UI.notify(msg,id)` must be emmited when a notification has to be produced. - -### Name and description - -For display in the web-based demo UI, set the `name` and `description` fields in the `info.json` file for the module. - -## Info file - -All module folders must have an `info.json` file which looks like the following: - -```json -{ - "name": "Name of Module to be displayed", - "description": "Optional longer text explanation of the module's function", - "url": "Optional link to module's source code or documentation", - "inputs": { - "var1": { - "type": "text", - "default": "default value" - } - }, - "outputs": { - "out1": { - "type": "text" - } - } -} -``` - -Types may be one of "text", "integer", "float", "select". -Integer and Float types should also specify minimum and maximum values like this: - -```json -"var1": { - "type": "integer", - "min": 0, - "max": 4, - "default": 1 -} -``` - -Similarly, "Select" type inputs should have a `values` array. - -Also, A module may have output values. These must be defined as shown above. - -### Progress reporting - -The default "loading spinner" can be optionally overriden with a custom progress object to draw progress on the CLI, following is a basic module format for the same: - -```js -module.exports = function ModuleName(options,UI) { - - var output; - - function draw(input,callback,progressObj) { - - /* If you wish to supply your own progress bar you need to override progressObj */ - progressObj.stop() // Stop the current progress spinner - - progressObj.overrideFlag = true; // Tell image sequencer that you will supply your own progressBar - - /* Override the object and give your own progress Bar */ - progressObj = /* Your own progress Object */ - - var output = function(input){ - /* do something with the input */ - return input; - }; - - this.output = output(); - callback(); - } - - return { - options: options, - draw: draw, - output: output, - UI: UI - } -} -``` - -The `progressObj` parameter of `draw()` is not consumed unless a custom progress bar needs to be drawn, for which this default spinner should be stopped with `progressObj.stop()` and image-sequencer is informed about the custom progress bar with `progressObj.overrideFlag = true;` following which this object can be overriden with custom progress object. - - -### Module example - -See existing module `channel` for an example: https://github.com/publiclab/image-sequencer/blob/main/src/modules/Channel/Module.js - -The `channel` module is included into the core modules here: https://github.com/publiclab/image-sequencer/blob/main/src/Modules.js#L5-L7 - -For help integrating, please open an issue. - -## Meta Module - -IMAGE SEQUENCER supports "meta modules" -- modules made of other modules. The syntax and structure of these meta modules is very similar to standard modules. Sequencer can also genarate meta modules dynamically with the function `createMetaModule` which can be called in the following ways - -```js - -/* Mapping function is a function which gets the inputs of the module as argument -* and returns an array with steps mapped to their options -* See https://github.com/publiclab/image-sequencer/blob/main/src/modules/Colorbar/Module.js for example -*/ - -/* Module options is an object with the following keys -* infoJson: the info.json object for the module -*/ -sequencer.createMetaModule(mappingFunction,moduleOptions) - -/* createMetaModule returns an array of module function and info just like normal -* modules. These can also be loaded into sequencer dynamically like other modules -*/ -``` - -A Meta module can also be contributed like a normal module with an info and a Module.js. A basic Meta module shall follow the following format - - -```js -// Module.js - module.exports = require('../../util/createMetaModule.js')( - function mapFunction(options) { - - return [ - { 'name': 'module-name', 'options': {} }, - { 'name': 'module-name', 'options': {} }, - ]; - }, { - infoJson: require('./info.json') - } -)[0]; -``` - -```json -// Info -{ - "name": "meta-moduleName", - "description": "", - "inputs": { - } -} -``` - -```js -//index.js -module.exports = [ - require('./Module.js'), - require('./info.json') -] -``` - -All of the above can also be combined together to form a single file module. - -```js - -// MetaModule.js -module.exports = - sequencer.createMetaModule( - function mapFunction(options) { - - return [ - { 'name': 'module-name', 'options': {} }, - { 'name': 'module-name', 'options': {} }, - ]; - }, { - infoJson: { - "name": "meta-moduleName", - "description": "", - "inputs": { - } - } - }); -``` - -## Linting - -We are now using `eslint` and `husky` to help lint and format our code each time we commit. Eslint defines coding standards and helps in cleaning up the code. To run eslint for checking errors globally or within a specific file run: - -``` -npx eslint . - -npx eslint -``` -And to fix those errors globally or in a file, run these in your terminal: -``` -npx eslint . --fix - -npx eslint --fix -``` -Be sure to not include the angular brackets(<>). - -Husky ensures automation of the above steps with git-hooks(eg. git add,git commit..). However we don't want to check and fix changes of the entire codebase with each commit and that the fixes made by eslint appear unstaged and require us to commit them again and that is where lint-staged helps. - -If we want `husky` to not verify the commit and push it anyway, use `git commit -m "message" --no-verify.` - -## Grunt Tasks - -This repository has different grunt tasks for different uses. The source code is in the [Gruntfile](https://github.com/publiclab/image-sequencer/blob/main/Gruntfile.js). - -The following command is used for running the tasks: `grunt [task-name]`. Here `[task-name]` should be replaced by the name of the task to be run. To run the default task run `grunt` without any options. - -#### Tasks -1. **compile**: Compiles/Browserifies the dist files in `/dist/image-sequencer.js` and `/dist/image-sequencer-ui.js`. -2. **build**: Compiles the files as in the **compile** task and minifies/uglifies dist files in `/dist/image-sequencer.min.js` and `/dist/image-sequencer-ui.min.js`. -3. **watch**: Checks for any changes in the source code and runs the **compile** task if any changes are found. -4. **serve**: Compiles the dist files as in the **compile** task and starts a local server on `localhost:3000` to host the demo site in `/examples/` directory. Also runs the **watch** task. -5. **production**: Compiles and minifies dist files in `/dist/image-sequencer.js` and `/dist/image-sequencer-ui.js` without the `.min.js` extension to include minified files in the demo site. This script should only be used in production mode while deploying. -6. **default**: Runs the **watch** task as default. - -## UI Helper Methods - -### scopeQuery - -###### Path: `/examples/lib/scopeQuery.js` - -The method returns a scoped `jQuery` object which only searches for elements inside a given scope (a DOM element). - -To use the method, -* import the `scopeSelector` and `scopeSelectorAll` methods from `lib/scopeQuery.js` -* call the methods with scope as a parameter - -```js -var scopeQuery = require('./scopeQuery'); - -var $step = scopeQuery.scopeSelector(scope), - $stepAll = scopeQuery.scopeSelectorAll(scope); -``` -This will return an object with a constructor which returns a `jQuery` object (from inside the scope) but with new `elem` and `elemAll` methods. - -#### Methods of the Returned Object -* `elem()`: Selects an element inside the scope. -* `elemAll()`: Selects all the instances of a given element inside the scope. -* `getScope()`: Returns the scope as a DOM element. -* `getDomElem()`: Returns the scoped element as a DOM element instead of a jquery object. - -#### Example - -```js -//The scope is a div element with id=“container“ and there are three divs in it -//with ids „1“, „2“, and „3“, and all of them have a „child“ class attribute - -var $step = require('./scopeQuery').scopeSelector(document.getElementById('container')); - -$step('#1'); // returns the div element with id=“1“ -$step('#1').hide().elemAll('.child').fadeOut(); // abruptly hides the div element with id=“1“ and fades out all other div elements -``` - -These two methods are chainable and will always return elements from inside the scope. - -#### Usage - -Instead of using - -```js -$(step.ui.querySelector('query')).show().hide(); -$(step.ui.querySelectorAll('q2')).show().hide(); -``` -The following code can be used - -```js -$step('query').show().hide(); -$stepAll('q2').show().hide(); -``` - -## Scripts -The following shell scripts are present in the `scripts/` directory. - -- `update-gh-pages`: This script can be used to update the `gh-pages` branch of this repo or a fork. - This script is not meant to be used directly as it runs in the current working directory. - If you run it on your primary local clone, it can **delete** the local changes. This script is made to be used in a github action - or in a temporary directory via another script, such as `update-demo`. - - Arguments: - 1. Repo(to use as upstream) url in the form username/repo (default: publiclab/image-sequencer) NOTE: Github only - 2. Branch to pull from eg: main or stable (default: stable) - 3. CNAME URL (default: none) - 4. Set the fourth argument to anything to bypass the warning. You will have to set this argument if you want to run this script in another script without needing - user interaction, such as in a github action. - -- `update-demo`: A safe, interactive script that can be used to update the `gh-pages` branch of any image-sequencer fork. - This script is safe to use directly because it separately clones the repo in a temporary directory. - - Arguments: None since it is a an *interactive* script, ie it asks the user for input. diff --git a/dist/image-sequencer-ui.js b/dist/image-sequencer-ui.js new file mode 100644 index 00000000..a74a5b62 --- /dev/null +++ b/dist/image-sequencer-ui.js @@ -0,0 +1 @@ +require=function(){return function e(t,r,n){function i(a,o){if(!r[a]){if(!t[a]){var u="function"==typeof require&&require;if(!o&&u)return u(a,!0);if(s)return s(a,!0);var l=new Error("Cannot find module '"+a+"'");throw l.code="MODULE_NOT_FOUND",l}var c=r[a]={exports:{}};t[a][0].call(c.exports,function(e){return i(t[a][1][e]||e)},c,c.exports,e,t,r,n)}return r[a].exports}for(var s="function"==typeof require&&require,a=0;a'+t[n].name+"");r.append(''),r.selectize(e)}sequencer=ImageSequencer(),options={sortField:"text",openOnFocus:!1,onInitialize:function(){this.$control.on("click",()=>{this.ignoreFocusOpen=!0,setTimeout(()=>{this.ignoreFocusOpen=!1},50)})},onFocus:function(){this.ignoreFocusOpen||this.open()}},l.getLatestVersionNumber(function(e){console.log("The latest NPM version number for Image Sequencer (from GitHub) is v"+e)}),console.log("The local version number for Image Sequencer is v"+l.getLocalVersionNumber()),$("#version-number-text").text("Image Sequencer v"+l.getLocalVersionNumber()),$("#version-number-top-right").text("v"+l.getLocalVersionNumber()),e(options),$(window).on("scroll",function(e,t){var r=$("body").scrollTop()>20||$(":root").scrollTop()>20;$("#move-up").css({display:r?"block":"none"})}),$("#move-up").on("click",function(){$("body").animate({scrollTop:0}),$(":root").animate({scrollTop:0})}),sequencer.setUI(a(sequencer));var t=n(sequencer);o.getUrlHashParameter("src")?sequencer.loadImage(o.getUrlHashParameter("src"),t.onLoad):sequencer.loadImage("images/tulips.png",t.onLoad);function r(){var t=window.prompt("Please give a name to your sequence... (Saved sequence will only be available in this browser).");t&&(t+=" (local)",sequencer.saveSequence(t,sequencer.toString()),sequencer.loadModules(),$(".savesequencemsg").fadeIn(),setTimeout(function(){$(".savesequencemsg").fadeOut()},3e3),e())}$("#addStep select").on("change",t.selectNewStepUi),$("#addStep #add-step-btn").on("click",t.addStepUi),$("#resetButton").on("click",function(){confirm("Do you want to reset the sequence?")&&(window.location.hash="",location.reload())}),$(".radio-group .radio").on("click",function(){$(this).parent().find(".radio").removeClass("selected"),$(this).addClass("selected"),newStep=$(this).attr("data-value"),$("#addStep select").val(newStep),t.selectNewStepUi(newStep),t.addStepUi(newStep),$(this).removeClass("selected")}),$("body").on("click","button.remove",t.removeStepUi),$("#saveButton").on("click",function(){let e=$("#selectSaveOption option:selected").val();var t;"save-image"==e?$(".download-btn:last()").trigger("click"):"save-gif"==e?function(){let e=p();gifshot.createGIF(e,function(e){d(e.image)})}():"save-seq"==e?r():"save-pdf"==e?(t=function(){let e=document.getElementsByClassName("step-thumbnail");return e[e.length-1].getAttribute("src")}(),sequencer.getImageDimensions(t,function(e){if(c(t)){let r=e.width,n=e.height;const i=new jsPDF({orientation:n>r?"portrait":"landscape",unit:"px",format:[n,r]});i.addImage(t,0,0,i.internal.pageSize.getWidth(),i.internal.pageSize.getHeight()),i.save("index.pdf")}else console.log("GIFs cannot be converted to PDF")})):"save-to-publiclab.org"==e&&function(){e=$("img")[sequencer.steps.length-1].src,t=Date.now(),$("body").append('
'),f=$("#postToPL"+t)[0],f.datauri_main_image.value=e,window.open("","postToPLWindow"),f.submit();var e,t}()});let h=!1;function p(){let e=document.getElementsByClassName("step-thumbnail");for(var t=[],r=0;r';try{let e=p();gifshot.createGIF(e,function(e){if(!e.error){var r=e.image,n=document.createElement("img");n.id="gif_element",n.src=r;let s=$("#js-download-gif-modal");$("#js-download-as-gif-button").one("click",function(){d(r),s.modal("hide")});var i=document.getElementById("js-download-modal-gif-container");i.innerHTML="",i.appendChild(n),s.modal(),t.disabled=!1,t.innerHTML="View GIF",h=!1}})}catch(e){console.error(e),t.disabled=!1,t.innerHTML="View GIF",h=!1}}}),sequencer.setInputStep({dropZoneSelector:"#dropzone",fileInputSelector:"#fileInput",takePhotoSelector:"#take-photo",onLoad:function(e){var t=e.target,r=sequencer.steps[0];s(sequencer);r.output.src=t.result,sequencer.run({index:0}),void 0!==r.options?r.options.step.imgElement.src=t.result:r.imgElement.src=t.result,u.updatePreviews(t.result,document.querySelector("#addStep")),a(sequencer).updateDimensions(r)},onTakePhoto:function(e){var t=sequencer.steps[0];t.output.src=e,sequencer.run({index:0}),void 0!==t.options?t.options.step.imgElement.src=e:t.imgElement.src=e,u.updatePreviews(e,document.querySelector("#addStep")),a(sequencer).updateDimensions(t)}}),i(),o.getUrlHashParameter("src")?u.updatePreviews(o.getUrlHashParameter("src"),document.querySelector("#addStep")):u.updatePreviews("images/tulips.png",document.querySelector("#addStep"))}},{"../src/util/isGif":172,"./lib/cache.js":2,"./lib/defaultHtmlSequencerUi.js":3,"./lib/defaultHtmlStepUi.js":4,"./lib/insertPreview.js":5,"./lib/intermediateHtmlStepUi.js":6,"./lib/urlHash.js":9,"./lib/versionManagement.js":10}],2:[function(e,t,r){t.exports=function(){let e;if($("#reload").on("click",function(){e.postMessage({action:"skipWaiting"})}),"serviceWorker"in navigator){let t;navigator.serviceWorker.register("sw.js",{scope:"/examples/"}).then(function(t){return new Promise(function(r,n){t.addEventListener("updatefound",()=>{if(!(e=t.installing))return n(new Error("error in installing service worker"));e.addEventListener("statechange",()=>{switch(e.state){case"installed":navigator.serviceWorker.controller&&($("#update-prompt-modal").addClass("show"),$("#reload").on("click",e=>(e.preventDefault(),console.log("New Service Worker Installed Successfully"),location.reload(),r())));break;case"redundant":return n(new Error("installing new service worker now became redundant"))}})})})}).catch(e=>{console.log("Failed In Registering Service Worker: ",e)}),navigator.serviceWorker.addEventListener("controllerchange",function(){t||(window.location.reload(),t=!0)})}"serviceWorker"in navigator&&caches.keys().then(function(e){e.forEach(function(e){$("#clear-cache").append(" "+e)})});$("#clear-cache").click(function(){"serviceWorker"in navigator&&caches.keys().then(function(e){return Promise.all(e.map(function(e){return caches.delete(e)}))}),location.reload()})}},{}],3:[function(e,t,r){var n=e("./urlHash.js");insertPreview=e("./insertPreview.js"),t.exports=function(e,t){var r=(t=t||{}).addStepSel=t.addStepSel||"#addStep",i=t.removeStepSel=t.removeStepSel||"button.remove";function s(){var t=n.getUrlHashParameter("steps");t&&(e.importString(t),e.run({index:0})),n.setUrlHashParameter("steps",sequencer.toString())}function a(){sequencer.steps.length<2?$(" #save-seq").prop("disabled",!0):$(" #save-seq").prop("disabled",!1)}return t.selectStepSel=t.selectStepSel||"#selectStep",{onLoad:function(){s(),"none"===$("#selectStep").val()&&$(r+" #add-step-btn").prop("disabled",!0),a()},importStepsFromUrlHash:s,selectNewStepUi:function(){var t=$(r+" select").val();t&&$(r+" .info").html(e.modulesInfo(t).description),$(r+" #add-step-btn").prop("disabled",!1)},removeStepUi:function(){var e=$(i).index(this)+1;sequencer.steps.length==e+1&&(console.log("inside"),insertPreview.updatePreviews(sequencer.steps[e-1].output.src,document.querySelector("#addStep"))),sequencer.removeSteps(e).run({index:e-1}),n.setUrlHashParameter("steps",sequencer.toString()),a()},addStepUi:function(){if(""!=$(r+" select").val()){var i;i="string"!=typeof arguments[0]?$(r+" select option").html().toLowerCase().split(" ").join("-"):arguments[0];var s=1;sequencer.sequences[i]?s=sequencer.sequences[i].length:sequencer.modules[i][1].length&&(s=sequencer.modules[i][1].length),e.addSteps(i,t).run({index:e.steps.length-s-1}),$(r+" .info").html("Select a new module to add to your sequence."),$(r+" select").val("none"),a(),n.setUrlHashParameter("steps",e.toString())}else alert("Please Select a Step to Proceed")}}}},{"./insertPreview.js":5,"./urlHash.js":9}],4:[function(e,t,r){const n=e("./intermediateHtmlStepUi.js"),i=e("./urlHash.js"),s=e("lodash"),a=e("./insertPreview.js");function o(e,t){var r=(t=t||{}).stepsEl||document.querySelector("#steps");t.selectStepSel=t.selectStepSel||"#selectStep";function o(t){e.getImageDimensions(t.imgElement.src,function(e){t.ui.querySelector("."+t.name).attributes["data-original-title"].value=`

Image Width: ${e.width} px
Image Height: ${e.height} px
${isGIF(t.output)?`Frames: ${e.frames}`:""}

`})}function u(e){var t=$(e.imgElement);let r="20",n="20";const i=$('button[name="Custom-Coordinates"]');t.click(function(e){r=e.offsetX,n=e.offsetY,i.click(function(){$('input[name="x"]').val(r),$('input[name="y"]').val(n)})}),t.mousemove(function(e){var r=document.createElement("canvas");r.width=t.width(),r.height=t.height();var n=r.getContext("2d");n.drawImage(this,0,0);var i=$(this).offset(),s=e.pageX-i.left,a=e.pageY-i.top,o=n.getImageData(s,a,1,1);t[0].title="rgb: "+o.data[0]+","+o.data[1]+","+o.data[2]})}function l(e,t){if(0==$("#"+t).length){var r=document.createElement("span");r.innerHTML=' '+e,r.id=t,r.classList.add("notification"),$("body").append(r)}$("#"+t).fadeIn(500).delay(200).fadeOut(500)}return{getPreview:function(){return step.imgElement},onSetup:function(t,a){t.options&&t.options.description&&(t.description=t.options.description);let o="";t.moduleInfo&&(o=t.moduleInfo["docs-link"]||""),t.ui=' ';var c=n(e,t),h=new DOMParser;t.ui=h.parseFromString(t.ui,"text/html"),t.ui=t.ui.querySelector("div.container-fluid"),t.$step=scopeQuery.scopeSelector(t.ui),t.$stepAll=scopeQuery.scopeSelectorAll(t.ui);let{$step:p,$stepAll:f}=t;if(t.linkElements=t.ui.querySelectorAll("a"),t.imgElement=p("a img.img-thumbnail")[0],e.modulesInfo().hasOwnProperty(t.name)){var d=e.modulesInfo(t.name).inputs,g=e.modulesInfo(t.name).outputs,m=Object.assign(d,g);for(var _ in m){var x=d.hasOwnProperty(_),y="",b=x?mapHtmlTypes(d[_]):{};if(x)if("select"==b.type.toLowerCase()){for(var T in y+='"}else{let e=t.options[_]||b.default;"color-picker"==b.id?y+='
':"button"===b.type?y='
click to select coordinates
':(y=''+e+"":y+='">')}else y+='';var v=document.createElement("div");v.className="row",v.setAttribute("name",_);var E=d[_].desc||_;v.innerHTML="
"+y+"
",p("div.details").append(v)}p("div.panel-footer").append('
Press apply to see changes
'),p("div.panel-footer").prepend(' ')}function A(e,t,r){var n=!(isNaN(t)||isNaN(e)?e===t:e-t==0);return w=(S+=r?n?0:-1:n?1:0)>0,p(".btn-save").prop("disabled",!w),n}"load-image"!=t.name?(p("div.trash-container").prepend(h.parseFromString('
',"text/html").querySelector("div")),f(".remove").on("click",function(){l("Step Removed","remove-notification")}),p(".insert-step").on("click",function(){c.insertStep(t.ID)}),a.index==e.steps.length?(r.appendChild(t.ui),$("#steps .step-container:nth-last-child(1) .insert-step").prop("disabled",!0),$("#steps .step-container:nth-last-child(2)")&&$("#steps .step-container:nth-last-child(2) .insert-step").prop("disabled",!1)):r.insertBefore(t.ui,$(r).children()[a.index]),e.steps.length>0?$("#load-image .insert-step").prop("disabled",!1):$("#load-image .insert-step").prop("disabled",!0)):($("#load-image").append(t.ui),p("div.panel-footer").prepend('\n '),p(".insert-step").on("click",function(){c.insertStep(t.ID)})),p(".toggle").on("click",()=>{p(".toggleIcon").toggleClass("rotated"),f(".cal").collapse("toggle")}),$(t.imgElement).on("mousemove",s.debounce(()=>u(t),150)),$(t.imgElement).on("click",e=>{e.preventDefault()}),f("#color-picker").colorpicker();var S=0,w=!1;p(".input-form").on("submit",function(r){r.preventDefault(),w&&(p("div.details").find("input,select").each(function(e,r){$(r).data("initValue",$(r).val()).data("hasChangedBefore",!1),t.options[$(r).attr("name")]=$(r).val()}),e.run({index:t.index-1}),i.setUrlHashParameter("steps",e.toString()),p(".btn-save").prop("disabled",!0),w=!1,S=0)}),f(".target").each(function(e,t){$(t).data("initValue",$(t).val()).data("hasChangedBefore",!1).on("input change",function(){$(this).focus().data("hasChangedBefore",A($(this).val(),$(this).data("initValue"),$(this).data("hasChangedBefore")))})}),f(".color-picker-target").each(function(e,t){$(t).data("initValue",$(t).val()).data("hasChangedBefore",!1).on("input change",function(){$(this).data("hasChangedBefore",A($(this).val(),$(this).data("initValue"),$(this).data("hasChangedBefore")))})}),$('input[type="range"]').on("input",function(){$(this).next().html($(this).val())})},onComplete:function(t){let{$step:r,$stepAll:n}=t;r("img").show(),n(".load-spin").hide(),r(".load").hide(),n(".download-btn").off("click"),t.imgElement.src="load-image"==t.name?t.output.src:t.output;var i=r(".img-thumbnail").getDomElem();for(let e=0;e{var e=document.createElement("a");e.setAttribute("download",t.name+"."+t.imgElement.src.split("/")[1].split(";")[0]),e.style.display="none",document.body.appendChild(e);var r=function(e){let t=e.split(","),r=t[0].match(/:(.*?);/)[1],n=atob(t[1]),i=n.length,s=new Uint8Array(i);for(;i--;)s[i]=n.charCodeAt(i);return new Blob([s],{type:r})}(t.output),n=URL.createObjectURL(r);e.setAttribute("href",n),e.click()}),e.modulesInfo().hasOwnProperty(t.name)){var s=e.modulesInfo(t.name).inputs,u=e.modulesInfo(t.name).outputs;for(var l in s)void 0!==t.options[l]&&("input"===s[l].type.toLowerCase()&&r('div[name="'+l+'"] input').val(t.options[l]).data("initValue",t.options[l]),"select"===s[l].type.toLowerCase()&&r('div[name="'+l+'"] select').val(String(t.options[l])).data("initValue",t.options[l]));for(var l in u)void 0!==t[l]&&r('div[name="'+l+'"] input').val(t[l])}$(function(){$('[data-toggle="tooltip"]').tooltip(),o(t)}),"load-image"===t.name?a.updatePreviews(t.output.src,document.querySelector("#addStep")):a.updatePreviews(t.output,document.querySelector("#addStep")),t.useWasm&&t.wasmSuccess?r(".wasm-tooltip").fadeIn():r(".wasm-tooltip").fadeOut()},onRemove:function(t){t.ui.remove(),$("#steps .step-container:nth-last-child(1) .insert-step").prop("disabled",!0),e.steps.length-1>1?$("#load-image .insert-step").prop("disabled",!1):$("#load-image .insert-step").prop("disabled",!0),$(t.imgElement).imgAreaSelect({remove:!0})},onDraw:function({$step:e,$stepAll:t}){e(".load").show(),e("img").hide(),t(".load-spin").show()},notify:l,imageHover:u,updateDimensions:o}}mapHtmlTypes=e("./mapHtmltypes"),scopeQuery=e("./scopeQuery"),isGIF=e("../../src/util/isGif"),"undefined"==typeof window&&(t.exports={DefaultHtmlStepUi:o}),t.exports=o},{"../../src/util/isGif":172,"./insertPreview.js":5,"./intermediateHtmlStepUi.js":6,"./mapHtmltypes":7,"./scopeQuery":8,"./urlHash.js":9,lodash:168}],5:[function(e,t,r){function n(e,t,r,n){var i=ImageSequencer();function s(t){var r=document.createElement("img");r.classList.add("img-thumbnail"),r.classList.add("no-border"),r.src=t,$(r).css("max-width","200%"),$(r).css("transform","translateX(-20%)"),$(n.querySelector(".radio-group")).find(".radio").each(function(){$(this).attr("data-value")===e&&($(this).find("img").remove(),$(this).append(r))})}"resize"===e?s(r):i.loadImage(r,function(){"crop"===e?i.addSteps(e,t).run(s):i.addSteps(e,{[e]:t}).run(s)})}t.exports={generatePreview:n,updatePreviews:function(e,t){$(t).find("img").remove();var r={resize:"125%",brightness:"175",saturation:"0.5",rotate:90,contrast:90,crop:{x:0,y:0,w:"50%",h:"50%",noUI:!0}},i=new Image;i.onload=function(){var s=i.height,a=i.width;let o=80/s*100;o=Math.max(80/a*100,o),o=Math.ceil(o),ImageSequencer().loadImage(e,function(){this.addSteps("resize",{resize:o+"%"}),this.run(e=>{Object.keys(r).forEach(function(i,s){n(i,Object.values(r)[s],e,t)})})})},i.src=e}}},{}],6:[function(e,t,r){var n=e("./urlHash.js"),i=e("./insertPreview.js");t.exports=function(e,t,r){var s=function(e,t=function(){}){e(".insertDiv").collapse("toggle"),"none"!=e(".insert-text").css("display")?e(".insert-text").fadeToggle(200,function(){e(".no-insert-text").fadeToggle(200,t)}):e(".no-insert-text").fadeToggle(200,function(){e(".insert-text").fadeToggle(200,t)})};function a(t,r,i){s(r),r(".insertDiv").removeClass("insertDiv"),e.insertSteps(t+1,i).run({index:t}),n.setUrlHashParameter("steps",e.toString())}return insertStep=function(r){const n=t.$step;t.$stepAll;var o=e.modulesInfo(),u='

Select a new module to add to your sequence.

Resize

Brightness

Contrast

Saturation

Rotate

Crop

';u=(new DOMParser).parseFromString(u,"text/html").querySelector("div"),n(".insertDiv").length>0?s(n):(t.ui.querySelector("div.step").insertAdjacentElement("afterend",u),s(n,function(){"load-image"===t.name?i.updatePreviews(t.output.src,n(".insertDiv").getDomElem()):i.updatePreviews(t.output,n(".insertDiv").getDomElem())})),n(".insertDiv .close-insert-box").off("click").on("click",function(){s(n),n(".insertDiv").removeClass("insertDiv")});var l=n(".insert-step-select");for(var c in l.html(""),o)o[c]&&o[c].name&&l.append('");l.selectize({sortField:"text"}),$(".insertDiv .radio-group .radio").on("click",function(){var e=$(this).attr("data-value");a($(n(".insertDiv").parents()[3]).prevAll().length,n,e)}),n(".insertDiv .add-step-btn").on("click",function(){var e=l.val();a($(n(".insertDiv").parents()[3]).prevAll().length,n,e)})},{insertStep:insertStep}}},{"./insertPreview.js":5,"./urlHash.js":9}],7:[function(e,t,r){t.exports=function(e){var t;switch(e.type.toLowerCase()){case"integer":"range"==(t=void 0!=e.min?"range":"number")&&(e.step=e.step||1);break;case"string":t="text";break;case"select":t="select";break;case"percentage":t="number";break;case"float":"range"==(t=void 0!=e.min?"range":"text")&&(e.step=e.step||.1);break;case"coordinate-input":t="button";break;default:t="text"}var r=Object.assign({},e);return r.type=t,r}},{}],8:[function(e,t,r){function n(e){return function(t){var r=$(e.querySelector(t));return r.elem=function(t){return new n(e)(t)},r.elemAll=function(t){return new i(e)(t)},r.getDomElem=function(e=0){return r[e]},r.getScope=(()=>e),r}}function i(e){return function(t){var r=$(e.querySelectorAll(t));return r.elem=function(t){return new n(e)(t)},r.elemAll=function(t){return new i(e)(t)},r.getDomElem=function(e=0){return r[e]},r.getScope=(()=>e),r}}t.exports={scopeSelector:function(e){return n(e)},scopeSelectorAll:function(e){return i(e)}}},{}],9:[function(e,t,r){function n(){var e=window.location.hash;e&&(e=e.split("#")[1]);var t={};return e.split("&").forEach(function(e,r){""!=(e=e.split("="))[0]&&(t[e[0]]=e[1])}),t}function i(e){var t=Object.keys(e),r=Object.values(e),n=[];t.forEach(function(e,i){""!=e&&n.push(t[i]+"="+r[i])});var i=n.join("&");window.location.hash=i}t.exports={getUrlHashParameter:function(e){return n()[e]},setUrlHashParameter:function(e,t){var r=n();r[e]=t,i(r)},getUrlHashParameters:n,setUrlHashParameters:i}},{}],10:[function(e,t,r){const n=e("../../package.json");t.exports={getLatestVersionNumber:function(e){var t=n.homepage,r=new XMLHttpRequest;r.onreadystatechange=function(){if(4==r.readyState&&200==r.status){var t=JSON.parse(this.responseText).version;e&&e(t)}},r.open("GET",t+"/package.json",!0),r.send()},getLocalVersionNumber:function(){return n.version}}},{"../../package.json":171}],11:[function(e,t,r){var n,i;n=this,i=function(e){"use strict";var t={3:"abstract boolean byte char class double enum export extends final float goto implements import int interface long native package private protected public short static super synchronized throws transient volatile",5:"class enum extends super const export import",6:"enum",strict:"implements interface let package private protected public static yield",strictBind:"eval arguments"},r="break case catch continue debugger default do else finally for function if return switch throw try var while with null true false instanceof typeof void delete new in this",n={5:r,"5module":r+" export import",6:r+" const class extends export import super"},i=/^in(stanceof)?$/,s="ªµºÀ-ÖØ-öø-ˁˆ-ˑˠ-ˤˬˮͰ-ʹͶͷͺ-ͽͿΆΈ-ΊΌΎ-ΡΣ-ϵϷ-ҁҊ-ԯԱ-Ֆՙՠ-ֈא-תׯ-ײؠ-يٮٯٱ-ۓەۥۦۮۯۺ-ۼۿܐܒ-ܯݍ-ޥޱߊ-ߪߴߵߺࠀ-ࠕࠚࠤࠨࡀ-ࡘࡠ-ࡪࢠ-ࢴࢶ-ࣇऄ-हऽॐक़-ॡॱ-ঀঅ-ঌএঐও-নপ-রলশ-হঽৎড়ঢ়য়-ৡৰৱৼਅ-ਊਏਐਓ-ਨਪ-ਰਲਲ਼ਵਸ਼ਸਹਖ਼-ੜਫ਼ੲ-ੴઅ-ઍએ-ઑઓ-નપ-રલળવ-હઽૐૠૡૹଅ-ଌଏଐଓ-ନପ-ରଲଳଵ-ହଽଡ଼ଢ଼ୟ-ୡୱஃஅ-ஊஎ-ஐஒ-கஙசஜஞடணதந-பம-ஹௐఅ-ఌఎ-ఐఒ-నప-హఽౘ-ౚౠౡಀಅ-ಌಎ-ಐಒ-ನಪ-ಳವ-ಹಽೞೠೡೱೲഄ-ഌഎ-ഐഒ-ഺഽൎൔ-ൖൟ-ൡൺ-ൿඅ-ඖක-නඳ-රලව-ෆก-ะาำเ-ๆກຂຄຆ-ຊຌ-ຣລວ-ະາຳຽເ-ໄໆໜ-ໟༀཀ-ཇཉ-ཬྈ-ྌက-ဪဿၐ-ၕၚ-ၝၡၥၦၮ-ၰၵ-ႁႎႠ-ჅჇჍა-ჺჼ-ቈቊ-ቍቐ-ቖቘቚ-ቝበ-ኈኊ-ኍነ-ኰኲ-ኵኸ-ኾዀዂ-ዅወ-ዖዘ-ጐጒ-ጕጘ-ፚᎀ-ᎏᎠ-Ᏽᏸ-ᏽᐁ-ᙬᙯ-ᙿᚁ-ᚚᚠ-ᛪᛮ-ᛸᜀ-ᜌᜎ-ᜑᜠ-ᜱᝀ-ᝑᝠ-ᝬᝮ-ᝰក-ឳៗៜᠠ-ᡸᢀ-ᢨᢪᢰ-ᣵᤀ-ᤞᥐ-ᥭᥰ-ᥴᦀ-ᦫᦰ-ᧉᨀ-ᨖᨠ-ᩔᪧᬅ-ᬳᭅ-ᭋᮃ-ᮠᮮᮯᮺ-ᯥᰀ-ᰣᱍ-ᱏᱚ-ᱽᲀ-ᲈᲐ-ᲺᲽ-Ჿᳩ-ᳬᳮ-ᳳᳵᳶᳺᴀ-ᶿḀ-ἕἘ-Ἕἠ-ὅὈ-Ὅὐ-ὗὙὛὝὟ-ώᾀ-ᾴᾶ-ᾼιῂ-ῄῆ-ῌῐ-ΐῖ-Ίῠ-Ῥῲ-ῴῶ-ῼⁱⁿₐ-ₜℂℇℊ-ℓℕ℘-ℝℤΩℨK-ℹℼ-ℿⅅ-ⅉⅎⅠ-ↈⰀ-Ⱞⰰ-ⱞⱠ-ⳤⳫ-ⳮⳲⳳⴀ-ⴥⴧⴭⴰ-ⵧⵯⶀ-ⶖⶠ-ⶦⶨ-ⶮⶰ-ⶶⶸ-ⶾⷀ-ⷆⷈ-ⷎⷐ-ⷖⷘ-ⷞ々-〇〡-〩〱-〵〸-〼ぁ-ゖ゛-ゟァ-ヺー-ヿㄅ-ㄯㄱ-ㆎㆠ-ㆿㇰ-ㇿ㐀-䶿一-鿼ꀀ-ꒌꓐ-ꓽꔀ-ꘌꘐ-ꘟꘪꘫꙀ-ꙮꙿ-ꚝꚠ-ꛯꜗ-ꜟꜢ-ꞈꞋ-ꞿꟂ-ꟊꟵ-ꠁꠃ-ꠅꠇ-ꠊꠌ-ꠢꡀ-ꡳꢂ-ꢳꣲ-ꣷꣻꣽꣾꤊ-ꤥꤰ-ꥆꥠ-ꥼꦄ-ꦲꧏꧠ-ꧤꧦ-ꧯꧺ-ꧾꨀ-ꨨꩀ-ꩂꩄ-ꩋꩠ-ꩶꩺꩾ-ꪯꪱꪵꪶꪹ-ꪽꫀꫂꫛ-ꫝꫠ-ꫪꫲ-ꫴꬁ-ꬆꬉ-ꬎꬑ-ꬖꬠ-ꬦꬨ-ꬮꬰ-ꭚꭜ-ꭩꭰ-ꯢ가-힣ힰ-ퟆퟋ-ퟻ豈-舘並-龎ff-stﬓ-ﬗיִײַ-ﬨשׁ-זּטּ-לּמּנּסּףּפּצּ-ﮱﯓ-ﴽﵐ-ﶏﶒ-ﷇﷰ-ﷻﹰ-ﹴﹶ-ﻼA-Za-zヲ-하-ᅦᅧ-ᅬᅭ-ᅲᅳ-ᅵ",a="‌‍·̀-ͯ·҃-֑҇-ׇֽֿׁׂׅׄؐ-ًؚ-٩ٰۖ-ۜ۟-۪ۤۧۨ-ۭ۰-۹ܑܰ-݊ަ-ް߀-߉߫-߽߳ࠖ-࠙ࠛ-ࠣࠥ-ࠧࠩ-࡙࠭-࡛࣓-ࣣ࣡-ःऺ-़ा-ॏ॑-ॗॢॣ०-९ঁ-ঃ়া-ৄেৈো-্ৗৢৣ০-৯৾ਁ-ਃ਼ਾ-ੂੇੈੋ-੍ੑ੦-ੱੵઁ-ઃ઼ા-ૅે-ૉો-્ૢૣ૦-૯ૺ-૿ଁ-ଃ଼ା-ୄେୈୋ-୍୕-ୗୢୣ୦-୯ஂா-ூெ-ைொ-்ௗ௦-௯ఀ-ఄా-ౄె-ైొ-్ౕౖౢౣ౦-౯ಁ-ಃ಼ಾ-ೄೆ-ೈೊ-್ೕೖೢೣ೦-೯ഀ-ഃ഻഼ാ-ൄെ-ൈൊ-്ൗൢൣ൦-൯ඁ-ඃ්ා-ුූෘ-ෟ෦-෯ෲෳัิ-ฺ็-๎๐-๙ັິ-ຼ່-ໍ໐-໙༘༙༠-༩༹༵༷༾༿ཱ-྄྆྇ྍ-ྗྙ-ྼ࿆ါ-ှ၀-၉ၖ-ၙၞ-ၠၢ-ၤၧ-ၭၱ-ၴႂ-ႍႏ-ႝ፝-፟፩-፱ᜒ-᜔ᜲ-᜴ᝒᝓᝲᝳ឴-៓៝០-៩᠋-᠍᠐-᠙ᢩᤠ-ᤫᤰ-᤻᥆-᥏᧐-᧚ᨗ-ᨛᩕ-ᩞ᩠-᩿᩼-᪉᪐-᪙᪰-᪽ᪿᫀᬀ-ᬄ᬴-᭄᭐-᭙᭫-᭳ᮀ-ᮂᮡ-ᮭ᮰-᮹᯦-᯳ᰤ-᰷᱀-᱉᱐-᱙᳐-᳔᳒-᳨᳭᳴᳷-᳹᷀-᷹᷻-᷿‿⁀⁔⃐-⃥⃜⃡-⃰⳯-⵿⳱ⷠ-〪ⷿ-゙゚〯꘠-꘩꙯ꙴ-꙽ꚞꚟ꛰꛱ꠂ꠆ꠋꠣ-ꠧ꠬ꢀꢁꢴ-ꣅ꣐-꣙꣠-꣱ꣿ-꤉ꤦ-꤭ꥇ-꥓ꦀ-ꦃ꦳-꧀꧐-꧙ꧥ꧰-꧹ꨩ-ꨶꩃꩌꩍ꩐-꩙ꩻ-ꩽꪰꪲ-ꪴꪷꪸꪾ꪿꫁ꫫ-ꫯꫵ꫶ꯣ-ꯪ꯬꯭꯰-꯹ﬞ︀-️︠-︯︳︴﹍-﹏0-9_",o=new RegExp("["+s+"]"),u=new RegExp("["+s+a+"]");s=a=null;var l=[0,11,2,25,2,18,2,1,2,14,3,13,35,122,70,52,268,28,4,48,48,31,14,29,6,37,11,29,3,35,5,7,2,4,43,157,19,35,5,35,5,39,9,51,157,310,10,21,11,7,153,5,3,0,2,43,2,1,4,0,3,22,11,22,10,30,66,18,2,1,11,21,11,25,71,55,7,1,65,0,16,3,2,2,2,28,43,28,4,28,36,7,2,27,28,53,11,21,11,18,14,17,111,72,56,50,14,50,14,35,349,41,7,1,79,28,11,0,9,21,107,20,28,22,13,52,76,44,33,24,27,35,30,0,3,0,9,34,4,0,13,47,15,3,22,0,2,0,36,17,2,24,85,6,2,0,2,3,2,14,2,9,8,46,39,7,3,1,3,21,2,6,2,1,2,4,4,0,19,0,13,4,159,52,19,3,21,2,31,47,21,1,2,0,185,46,42,3,37,47,21,0,60,42,14,0,72,26,230,43,117,63,32,7,3,0,3,7,2,1,2,23,16,0,2,0,95,7,3,38,17,0,2,0,29,0,11,39,8,0,22,0,12,45,20,0,35,56,264,8,2,36,18,0,50,29,113,6,2,1,2,37,22,0,26,5,2,1,2,31,15,0,328,18,190,0,80,921,103,110,18,195,2749,1070,4050,582,8634,568,8,30,114,29,19,47,17,3,32,20,6,18,689,63,129,74,6,0,67,12,65,1,2,0,29,6135,9,1237,43,8,8952,286,50,2,18,3,9,395,2309,106,6,12,4,8,8,9,5991,84,2,70,2,1,3,0,3,1,3,3,2,11,2,0,2,6,2,64,2,3,3,7,2,6,2,27,2,3,2,4,2,0,4,6,2,339,3,24,2,24,2,30,2,24,2,30,2,24,2,30,2,24,2,30,2,24,2,7,2357,44,11,6,17,0,370,43,1301,196,60,67,8,0,1205,3,2,26,2,1,2,0,3,0,2,9,2,3,2,0,2,0,7,0,5,0,2,0,2,0,2,2,2,1,2,0,3,0,2,0,2,0,2,0,2,0,2,1,2,0,3,3,2,6,2,3,2,3,2,0,2,9,2,16,6,2,2,4,2,16,4421,42717,35,4148,12,221,3,5761,15,7472,3104,541,1507,4938],c=[509,0,227,0,150,4,294,9,1368,2,2,1,6,3,41,2,5,0,166,1,574,3,9,9,370,1,154,10,176,2,54,14,32,9,16,3,46,10,54,9,7,2,37,13,2,9,6,1,45,0,13,2,49,13,9,3,2,11,83,11,7,0,161,11,6,9,7,3,56,1,2,6,3,1,3,2,10,0,11,1,3,6,4,4,193,17,10,9,5,0,82,19,13,9,214,6,3,8,28,1,83,16,16,9,82,12,9,9,84,14,5,9,243,14,166,9,71,5,2,1,3,3,2,0,2,1,13,9,120,6,3,6,4,0,29,9,41,6,2,3,9,0,10,10,47,15,406,7,2,7,17,9,57,21,2,13,123,5,4,0,2,1,2,6,2,0,9,9,49,4,2,1,2,4,9,9,330,3,19306,9,135,4,60,6,26,9,1014,0,2,54,8,3,82,0,12,1,19628,1,5319,4,4,5,9,7,3,6,31,3,149,2,1418,49,513,54,5,49,9,0,15,0,23,4,2,14,1361,6,2,16,3,6,2,1,2,4,262,6,10,9,419,13,1495,6,110,6,6,9,4759,9,787719,239];function h(e,t){for(var r=65536,n=0;ne)return!1;if((r+=t[n+1])>=e)return!0}}function p(e,t){return e<65?36===e:e<91||(e<97?95===e:e<123||(e<=65535?e>=170&&o.test(String.fromCharCode(e)):!1!==t&&h(e,l)))}function f(e,t){return e<48?36===e:e<58||!(e<65)&&(e<91||(e<97?95===e:e<123||(e<=65535?e>=170&&u.test(String.fromCharCode(e)):!1!==t&&(h(e,l)||h(e,c)))))}var d=function(e,t){void 0===t&&(t={}),this.label=e,this.keyword=t.keyword,this.beforeExpr=!!t.beforeExpr,this.startsExpr=!!t.startsExpr,this.isLoop=!!t.isLoop,this.isAssign=!!t.isAssign,this.prefix=!!t.prefix,this.postfix=!!t.postfix,this.binop=t.binop||null,this.updateContext=null};function g(e,t){return new d(e,{beforeExpr:!0,binop:t})}var m={beforeExpr:!0},_={startsExpr:!0},x={};function y(e,t){return void 0===t&&(t={}),t.keyword=e,x[e]=new d(e,t)}var b={num:new d("num",_),regexp:new d("regexp",_),string:new d("string",_),name:new d("name",_),eof:new d("eof"),bracketL:new d("[",{beforeExpr:!0,startsExpr:!0}),bracketR:new d("]"),braceL:new d("{",{beforeExpr:!0,startsExpr:!0}),braceR:new d("}"),parenL:new d("(",{beforeExpr:!0,startsExpr:!0}),parenR:new d(")"),comma:new d(",",m),semi:new d(";",m),colon:new d(":",m),dot:new d("."),question:new d("?",m),questionDot:new d("?."),arrow:new d("=>",m),template:new d("template"),invalidTemplate:new d("invalidTemplate"),ellipsis:new d("...",m),backQuote:new d("`",_),dollarBraceL:new d("${",{beforeExpr:!0,startsExpr:!0}),eq:new d("=",{beforeExpr:!0,isAssign:!0}),assign:new d("_=",{beforeExpr:!0,isAssign:!0}),incDec:new d("++/--",{prefix:!0,postfix:!0,startsExpr:!0}),prefix:new d("!/~",{beforeExpr:!0,prefix:!0,startsExpr:!0}),logicalOR:g("||",1),logicalAND:g("&&",2),bitwiseOR:g("|",3),bitwiseXOR:g("^",4),bitwiseAND:g("&",5),equality:g("==/!=/===/!==",6),relational:g("/<=/>=",7),bitShift:g("<>/>>>",8),plusMin:new d("+/-",{beforeExpr:!0,binop:9,prefix:!0,startsExpr:!0}),modulo:g("%",10),star:g("*",10),slash:g("/",10),starstar:new d("**",{beforeExpr:!0}),coalesce:g("??",1),_break:y("break"),_case:y("case",m),_catch:y("catch"),_continue:y("continue"),_debugger:y("debugger"),_default:y("default",m),_do:y("do",{isLoop:!0,beforeExpr:!0}),_else:y("else",m),_finally:y("finally"),_for:y("for",{isLoop:!0}),_function:y("function",_),_if:y("if"),_return:y("return",m),_switch:y("switch"),_throw:y("throw",m),_try:y("try"),_var:y("var"),_const:y("const"),_while:y("while",{isLoop:!0}),_with:y("with"),_new:y("new",{beforeExpr:!0,startsExpr:!0}),_this:y("this",_),_super:y("super",_),_class:y("class",_),_extends:y("extends",m),_export:y("export"),_import:y("import",_),_null:y("null",_),_true:y("true",_),_false:y("false",_),_in:y("in",{beforeExpr:!0,binop:7}),_instanceof:y("instanceof",{beforeExpr:!0,binop:7}),_typeof:y("typeof",{beforeExpr:!0,prefix:!0,startsExpr:!0}),_void:y("void",{beforeExpr:!0,prefix:!0,startsExpr:!0}),_delete:y("delete",{beforeExpr:!0,prefix:!0,startsExpr:!0})},T=/\r\n?|\n|\u2028|\u2029/,v=new RegExp(T.source,"g");function E(e,t){return 10===e||13===e||!t&&(8232===e||8233===e)}var A=/[\u1680\u2000-\u200a\u202f\u205f\u3000\ufeff]/,S=/(?:\s|\/\/.*|\/\*[^]*?\*\/)*/g,w=Object.prototype,I=w.hasOwnProperty,L=w.toString;function R(e,t){return I.call(e,t)}var D=Array.isArray||function(e){return"[object Array]"===L.call(e)};function k(e){return new RegExp("^(?:"+e.replace(/ /g,"|")+")$")}var C=function(e,t){this.line=e,this.column=t};C.prototype.offset=function(e){return new C(this.line,this.column+e)};var N=function(e,t,r){this.start=t,this.end=r,null!==e.sourceFile&&(this.source=e.sourceFile)};function O(e,t){for(var r=1,n=0;;){v.lastIndex=n;var i=v.exec(e);if(!(i&&i.index=2015&&(t.ecmaVersion-=2009),null==t.allowReserved&&(t.allowReserved=t.ecmaVersion<5),D(t.onToken)){var n=t.onToken;t.onToken=function(e){return n.push(e)}}return D(t.onComment)&&(t.onComment=function(e,t){return function(r,n,i,s,a,o){var u={type:r?"Block":"Line",value:n,start:i,end:s};e.locations&&(u.loc=new N(this,a,o)),e.ranges&&(u.range=[i,s]),t.push(u)}}(t,t.onComment)),t}var V=2,U=1|V,P=4,$=8;function B(e,t){return V|(e?P:0)|(t?$:0)}var G=function(e,r,i){this.options=e=M(e),this.sourceFile=e.sourceFile,this.keywords=k(n[e.ecmaVersion>=6?6:"module"===e.sourceType?"5module":5]);var s="";if(!0!==e.allowReserved){for(var a=e.ecmaVersion;!(s=t[a]);a--);"module"===e.sourceType&&(s+=" await")}this.reservedWords=k(s);var o=(s?s+" ":"")+t.strict;this.reservedWordsStrict=k(o),this.reservedWordsStrictBind=k(o+" "+t.strictBind),this.input=String(r),this.containsEsc=!1,i?(this.pos=i,this.lineStart=this.input.lastIndexOf("\n",i-1)+1,this.curLine=this.input.slice(0,this.lineStart).split(T).length):(this.pos=this.lineStart=0,this.curLine=1),this.type=b.eof,this.value=null,this.start=this.end=this.pos,this.startLoc=this.endLoc=this.curPosition(),this.lastTokEndLoc=this.lastTokStartLoc=null,this.lastTokStart=this.lastTokEnd=this.pos,this.context=this.initialContext(),this.exprAllowed=!0,this.inModule="module"===e.sourceType,this.strict=this.inModule||this.strictDirective(this.pos),this.potentialArrowAt=-1,this.yieldPos=this.awaitPos=this.awaitIdentPos=0,this.labels=[],this.undefinedExports={},0===this.pos&&e.allowHashBang&&"#!"===this.input.slice(0,2)&&this.skipLineComment(2),this.scopeStack=[],this.enterScope(1),this.regexpState=null},z={inFunction:{configurable:!0},inGenerator:{configurable:!0},inAsync:{configurable:!0},allowSuper:{configurable:!0},allowDirectSuper:{configurable:!0},treatFunctionsAsVar:{configurable:!0}};G.prototype.parse=function(){var e=this.options.program||this.startNode();return this.nextToken(),this.parseTopLevel(e)},z.inFunction.get=function(){return(this.currentVarScope().flags&V)>0},z.inGenerator.get=function(){return(this.currentVarScope().flags&$)>0},z.inAsync.get=function(){return(this.currentVarScope().flags&P)>0},z.allowSuper.get=function(){return(64&this.currentThisScope().flags)>0},z.allowDirectSuper.get=function(){return(128&this.currentThisScope().flags)>0},z.treatFunctionsAsVar.get=function(){return this.treatFunctionsAsVarInScope(this.currentScope())},G.prototype.inNonArrowFunction=function(){return(this.currentThisScope().flags&V)>0},G.extend=function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];for(var r=this,n=0;n=,?^&]/.test(i)||"!"===i&&"="===this.input.charAt(n+1))}e+=t[0].length,S.lastIndex=e,e+=S.exec(this.input)[0].length,";"===this.input[e]&&e++}},K.eat=function(e){return this.type===e&&(this.next(),!0)},K.isContextual=function(e){return this.type===b.name&&this.value===e&&!this.containsEsc},K.eatContextual=function(e){return!!this.isContextual(e)&&(this.next(),!0)},K.expectContextual=function(e){this.eatContextual(e)||this.unexpected()},K.canInsertSemicolon=function(){return this.type===b.eof||this.type===b.braceR||T.test(this.input.slice(this.lastTokEnd,this.start))},K.insertSemicolon=function(){if(this.canInsertSemicolon())return this.options.onInsertedSemicolon&&this.options.onInsertedSemicolon(this.lastTokEnd,this.lastTokEndLoc),!0},K.semicolon=function(){this.eat(b.semi)||this.insertSemicolon()||this.unexpected()},K.afterTrailingComma=function(e,t){if(this.type===e)return this.options.onTrailingComma&&this.options.onTrailingComma(this.lastTokStart,this.lastTokStartLoc),t||this.next(),!0},K.expect=function(e){this.eat(e)||this.unexpected()},K.unexpected=function(e){this.raise(null!=e?e:this.start,"Unexpected token")},K.checkPatternErrors=function(e,t){if(e){e.trailingComma>-1&&this.raiseRecoverable(e.trailingComma,"Comma is not permitted after the rest element");var r=t?e.parenthesizedAssign:e.parenthesizedBind;r>-1&&this.raiseRecoverable(r,"Parenthesized pattern")}},K.checkExpressionErrors=function(e,t){if(!e)return!1;var r=e.shorthandAssign,n=e.doubleProto;if(!t)return r>=0||n>=0;r>=0&&this.raise(r,"Shorthand property assignments are valid only in destructuring patterns"),n>=0&&this.raiseRecoverable(n,"Redefinition of __proto__ property")},K.checkYieldAwaitInDefaultParams=function(){this.yieldPos&&(!this.awaitPos||this.yieldPos=6&&this.unexpected(),this.parseFunctionStatement(s,!1,!e);case b._class:return e&&this.unexpected(),this.parseClass(s,!0);case b._if:return this.parseIfStatement(s);case b._return:return this.parseReturnStatement(s);case b._switch:return this.parseSwitchStatement(s);case b._throw:return this.parseThrowStatement(s);case b._try:return this.parseTryStatement(s);case b._const:case b._var:return n=n||this.value,e&&"var"!==n&&this.unexpected(),this.parseVarStatement(s,n);case b._while:return this.parseWhileStatement(s);case b._with:return this.parseWithStatement(s);case b.braceL:return this.parseBlock(!0,s);case b.semi:return this.parseEmptyStatement(s);case b._export:case b._import:if(this.options.ecmaVersion>10&&i===b._import){S.lastIndex=this.pos;var a=S.exec(this.input),o=this.pos+a[0].length,u=this.input.charCodeAt(o);if(40===u||46===u)return this.parseExpressionStatement(s,this.parseExpression())}return this.options.allowImportExportEverywhere||(t||this.raise(this.start,"'import' and 'export' may only appear at the top level"),this.inModule||this.raise(this.start,"'import' and 'export' may appear only with 'sourceType: module'")),i===b._import?this.parseImport(s):this.parseExport(s,r);default:if(this.isAsyncFunction())return e&&this.unexpected(),this.next(),this.parseFunctionStatement(s,!0,!e);var l=this.value,c=this.parseExpression();return i===b.name&&"Identifier"===c.type&&this.eat(b.colon)?this.parseLabeledStatement(s,l,c,e):this.parseExpressionStatement(s,c)}},H.parseBreakContinueStatement=function(e,t){var r="break"===t;this.next(),this.eat(b.semi)||this.insertSemicolon()?e.label=null:this.type!==b.name?this.unexpected():(e.label=this.parseIdent(),this.semicolon());for(var n=0;n=6?this.eat(b.semi):this.semicolon(),this.finishNode(e,"DoWhileStatement")},H.parseForStatement=function(e){this.next();var t=this.options.ecmaVersion>=9&&(this.inAsync||!this.inFunction&&this.options.allowAwaitOutsideFunction)&&this.eatContextual("await")?this.lastTokStart:-1;if(this.labels.push(X),this.enterScope(0),this.expect(b.parenL),this.type===b.semi)return t>-1&&this.unexpected(t),this.parseFor(e,null);var r=this.isLet();if(this.type===b._var||this.type===b._const||r){var n=this.startNode(),i=r?"let":this.value;return this.next(),this.parseVar(n,!0,i),this.finishNode(n,"VariableDeclaration"),(this.type===b._in||this.options.ecmaVersion>=6&&this.isContextual("of"))&&1===n.declarations.length?(this.options.ecmaVersion>=9&&(this.type===b._in?t>-1&&this.unexpected(t):e.await=t>-1),this.parseForIn(e,n)):(t>-1&&this.unexpected(t),this.parseFor(e,n))}var s=new j,a=this.parseExpression(!0,s);return this.type===b._in||this.options.ecmaVersion>=6&&this.isContextual("of")?(this.options.ecmaVersion>=9&&(this.type===b._in?t>-1&&this.unexpected(t):e.await=t>-1),this.toAssignable(a,!1,s),this.checkLVal(a),this.parseForIn(e,a)):(this.checkExpressionErrors(s,!0),t>-1&&this.unexpected(t),this.parseFor(e,a))},H.parseFunctionStatement=function(e,t,r){return this.next(),this.parseFunction(e,Z|(r?0:J),!1,t)},H.parseIfStatement=function(e){return this.next(),e.test=this.parseParenExpression(),e.consequent=this.parseStatement("if"),e.alternate=this.eat(b._else)?this.parseStatement("if"):null,this.finishNode(e,"IfStatement")},H.parseReturnStatement=function(e){return this.inFunction||this.options.allowReturnOutsideFunction||this.raise(this.start,"'return' outside of function"),this.next(),this.eat(b.semi)||this.insertSemicolon()?e.argument=null:(e.argument=this.parseExpression(),this.semicolon()),this.finishNode(e,"ReturnStatement")},H.parseSwitchStatement=function(e){var t;this.next(),e.discriminant=this.parseParenExpression(),e.cases=[],this.expect(b.braceL),this.labels.push(q),this.enterScope(0);for(var r=!1;this.type!==b.braceR;)if(this.type===b._case||this.type===b._default){var n=this.type===b._case;t&&this.finishNode(t,"SwitchCase"),e.cases.push(t=this.startNode()),t.consequent=[],this.next(),n?t.test=this.parseExpression():(r&&this.raiseRecoverable(this.lastTokStart,"Multiple default clauses"),r=!0,t.test=null),this.expect(b.colon)}else t||this.unexpected(),t.consequent.push(this.parseStatement(null));return this.exitScope(),t&&this.finishNode(t,"SwitchCase"),this.next(),this.labels.pop(),this.finishNode(e,"SwitchStatement")},H.parseThrowStatement=function(e){return this.next(),T.test(this.input.slice(this.lastTokEnd,this.start))&&this.raise(this.lastTokEnd,"Illegal newline after throw"),e.argument=this.parseExpression(),this.semicolon(),this.finishNode(e,"ThrowStatement")};var Y=[];H.parseTryStatement=function(e){if(this.next(),e.block=this.parseBlock(),e.handler=null,this.type===b._catch){var t=this.startNode();if(this.next(),this.eat(b.parenL)){t.param=this.parseBindingAtom();var r="Identifier"===t.param.type;this.enterScope(r?32:0),this.checkLVal(t.param,r?4:2),this.expect(b.parenR)}else this.options.ecmaVersion<10&&this.unexpected(),t.param=null,this.enterScope(0);t.body=this.parseBlock(!1),this.exitScope(),e.handler=this.finishNode(t,"CatchClause")}return e.finalizer=this.eat(b._finally)?this.parseBlock():null,e.handler||e.finalizer||this.raise(e.start,"Missing catch or finally clause"),this.finishNode(e,"TryStatement")},H.parseVarStatement=function(e,t){return this.next(),this.parseVar(e,!1,t),this.semicolon(),this.finishNode(e,"VariableDeclaration")},H.parseWhileStatement=function(e){return this.next(),e.test=this.parseParenExpression(),this.labels.push(X),e.body=this.parseStatement("while"),this.labels.pop(),this.finishNode(e,"WhileStatement")},H.parseWithStatement=function(e){return this.strict&&this.raise(this.start,"'with' in strict mode"),this.next(),e.object=this.parseParenExpression(),e.body=this.parseStatement("with"),this.finishNode(e,"WithStatement")},H.parseEmptyStatement=function(e){return this.next(),this.finishNode(e,"EmptyStatement")},H.parseLabeledStatement=function(e,t,r,n){for(var i=0,s=this.labels;i=0;o--){var u=this.labels[o];if(u.statementStart!==e.start)break;u.statementStart=this.start,u.kind=a}return this.labels.push({name:t,kind:a,statementStart:this.start}),e.body=this.parseStatement(n?-1===n.indexOf("label")?n+"label":n:"label"),this.labels.pop(),e.label=r,this.finishNode(e,"LabeledStatement")},H.parseExpressionStatement=function(e,t){return e.expression=t,this.semicolon(),this.finishNode(e,"ExpressionStatement")},H.parseBlock=function(e,t,r){for(void 0===e&&(e=!0),void 0===t&&(t=this.startNode()),t.body=[],this.expect(b.braceL),e&&this.enterScope(0);this.type!==b.braceR;){var n=this.parseStatement(null);t.body.push(n)}return r&&(this.strict=!1),this.next(),e&&this.exitScope(),this.finishNode(t,"BlockStatement")},H.parseFor=function(e,t){return e.init=t,this.expect(b.semi),e.test=this.type===b.semi?null:this.parseExpression(),this.expect(b.semi),e.update=this.type===b.parenR?null:this.parseExpression(),this.expect(b.parenR),e.body=this.parseStatement("for"),this.exitScope(),this.labels.pop(),this.finishNode(e,"ForStatement")},H.parseForIn=function(e,t){var r=this.type===b._in;return this.next(),"VariableDeclaration"===t.type&&null!=t.declarations[0].init&&(!r||this.options.ecmaVersion<8||this.strict||"var"!==t.kind||"Identifier"!==t.declarations[0].id.type)?this.raise(t.start,(r?"for-in":"for-of")+" loop variable declaration may not have an initializer"):"AssignmentPattern"===t.type&&this.raise(t.start,"Invalid left-hand side in for-loop"),e.left=t,e.right=r?this.parseExpression():this.parseMaybeAssign(),this.expect(b.parenR),e.body=this.parseStatement("for"),this.exitScope(),this.labels.pop(),this.finishNode(e,r?"ForInStatement":"ForOfStatement")},H.parseVar=function(e,t,r){for(e.declarations=[],e.kind=r;;){var n=this.startNode();if(this.parseVarId(n,r),this.eat(b.eq)?n.init=this.parseMaybeAssign(t):"const"!==r||this.type===b._in||this.options.ecmaVersion>=6&&this.isContextual("of")?"Identifier"===n.id.type||t&&(this.type===b._in||this.isContextual("of"))?n.init=null:this.raise(this.lastTokEnd,"Complex binding patterns require an initialization value"):this.unexpected(),e.declarations.push(this.finishNode(n,"VariableDeclarator")),!this.eat(b.comma))break}return e},H.parseVarId=function(e,t){e.id=this.parseBindingAtom(),this.checkLVal(e.id,"var"===t?1:2,!1)};var Z=1,J=2;H.parseFunction=function(e,t,r,n){this.initFunction(e),(this.options.ecmaVersion>=9||this.options.ecmaVersion>=6&&!n)&&(this.type===b.star&&t&J&&this.unexpected(),e.generator=this.eat(b.star)),this.options.ecmaVersion>=8&&(e.async=!!n),t&Z&&(e.id=4&t&&this.type!==b.name?null:this.parseIdent(),!e.id||t&J||this.checkLVal(e.id,this.strict||e.generator||e.async?this.treatFunctionsAsVar?1:2:3));var i=this.yieldPos,s=this.awaitPos,a=this.awaitIdentPos;return this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0,this.enterScope(B(e.async,e.generator)),t&Z||(e.id=this.type===b.name?this.parseIdent():null),this.parseFunctionParams(e),this.parseFunctionBody(e,r,!1),this.yieldPos=i,this.awaitPos=s,this.awaitIdentPos=a,this.finishNode(e,t&Z?"FunctionDeclaration":"FunctionExpression")},H.parseFunctionParams=function(e){this.expect(b.parenL),e.params=this.parseBindingList(b.parenR,!1,this.options.ecmaVersion>=8),this.checkYieldAwaitInDefaultParams()},H.parseClass=function(e,t){this.next();var r=this.strict;this.strict=!0,this.parseClassId(e,t),this.parseClassSuper(e);var n=this.startNode(),i=!1;for(n.body=[],this.expect(b.braceL);this.type!==b.braceR;){var s=this.parseClassElement(null!==e.superClass);s&&(n.body.push(s),"MethodDefinition"===s.type&&"constructor"===s.kind&&(i&&this.raise(s.start,"Duplicate constructor in the same class"),i=!0))}return this.strict=r,this.next(),e.body=this.finishNode(n,"ClassBody"),this.finishNode(e,t?"ClassDeclaration":"ClassExpression")},H.parseClassElement=function(e){var t=this;if(this.eat(b.semi))return null;var r=this.startNode(),n=function(e,n){void 0===n&&(n=!1);var i=t.start,s=t.startLoc;return!!t.eatContextual(e)&&(!(t.type===b.parenL||n&&t.canInsertSemicolon())||(r.key&&t.unexpected(),r.computed=!1,r.key=t.startNodeAt(i,s),r.key.name=e,t.finishNode(r.key,"Identifier"),!1))};r.kind="method",r.static=n("static");var i=this.eat(b.star),s=!1;i||(this.options.ecmaVersion>=8&&n("async",!0)?(s=!0,i=this.options.ecmaVersion>=9&&this.eat(b.star)):n("get")?r.kind="get":n("set")&&(r.kind="set")),r.key||this.parsePropertyName(r);var a=r.key,o=!1;return r.computed||r.static||!("Identifier"===a.type&&"constructor"===a.name||"Literal"===a.type&&"constructor"===a.value)?r.static&&"Identifier"===a.type&&"prototype"===a.name&&this.raise(a.start,"Classes may not have a static property named prototype"):("method"!==r.kind&&this.raise(a.start,"Constructor can't have get/set modifier"),i&&this.raise(a.start,"Constructor can't be a generator"),s&&this.raise(a.start,"Constructor can't be an async method"),r.kind="constructor",o=e),this.parseClassMethod(r,i,s,o),"get"===r.kind&&0!==r.value.params.length&&this.raiseRecoverable(r.value.start,"getter should have no params"),"set"===r.kind&&1!==r.value.params.length&&this.raiseRecoverable(r.value.start,"setter should have exactly one param"),"set"===r.kind&&"RestElement"===r.value.params[0].type&&this.raiseRecoverable(r.value.params[0].start,"Setter cannot use rest params"),r},H.parseClassMethod=function(e,t,r,n){return e.value=this.parseMethod(t,r,n),this.finishNode(e,"MethodDefinition")},H.parseClassId=function(e,t){this.type===b.name?(e.id=this.parseIdent(),t&&this.checkLVal(e.id,2,!1)):(!0===t&&this.unexpected(),e.id=null)},H.parseClassSuper=function(e){e.superClass=this.eat(b._extends)?this.parseExprSubscripts():null},H.parseExport=function(e,t){if(this.next(),this.eat(b.star))return this.options.ecmaVersion>=11&&(this.eatContextual("as")?(e.exported=this.parseIdent(!0),this.checkExport(t,e.exported.name,this.lastTokStart)):e.exported=null),this.expectContextual("from"),this.type!==b.string&&this.unexpected(),e.source=this.parseExprAtom(),this.semicolon(),this.finishNode(e,"ExportAllDeclaration");if(this.eat(b._default)){var r;if(this.checkExport(t,"default",this.lastTokStart),this.type===b._function||(r=this.isAsyncFunction())){var n=this.startNode();this.next(),r&&this.next(),e.declaration=this.parseFunction(n,4|Z,!1,r)}else if(this.type===b._class){var i=this.startNode();e.declaration=this.parseClass(i,"nullableID")}else e.declaration=this.parseMaybeAssign(),this.semicolon();return this.finishNode(e,"ExportDefaultDeclaration")}if(this.shouldParseExportStatement())e.declaration=this.parseStatement(null),"VariableDeclaration"===e.declaration.type?this.checkVariableExport(t,e.declaration.declarations):this.checkExport(t,e.declaration.id.name,e.declaration.id.start),e.specifiers=[],e.source=null;else{if(e.declaration=null,e.specifiers=this.parseExportSpecifiers(t),this.eatContextual("from"))this.type!==b.string&&this.unexpected(),e.source=this.parseExprAtom();else{for(var s=0,a=e.specifiers;s=6&&e)switch(e.type){case"Identifier":this.inAsync&&"await"===e.name&&this.raise(e.start,"Cannot use 'await' as identifier inside an async function");break;case"ObjectPattern":case"ArrayPattern":case"RestElement":break;case"ObjectExpression":e.type="ObjectPattern",r&&this.checkPatternErrors(r,!0);for(var n=0,i=e.properties;n=8&&!s&&"async"===a.name&&!this.canInsertSemicolon()&&this.eat(b._function))return this.parseFunction(this.startNodeAt(n,i),0,!1,!0);if(r&&!this.canInsertSemicolon()){if(this.eat(b.arrow))return this.parseArrowExpression(this.startNodeAt(n,i),[a],!1);if(this.options.ecmaVersion>=8&&"async"===a.name&&this.type===b.name&&!s)return a=this.parseIdent(!1),!this.canInsertSemicolon()&&this.eat(b.arrow)||this.unexpected(),this.parseArrowExpression(this.startNodeAt(n,i),[a],!0)}return a;case b.regexp:var o=this.value;return(t=this.parseLiteral(o.value)).regex={pattern:o.pattern,flags:o.flags},t;case b.num:case b.string:return this.parseLiteral(this.value);case b._null:case b._true:case b._false:return(t=this.startNode()).value=this.type===b._null?null:this.type===b._true,t.raw=this.type.keyword,this.next(),this.finishNode(t,"Literal");case b.parenL:var u=this.start,l=this.parseParenAndDistinguishExpression(r);return e&&(e.parenthesizedAssign<0&&!this.isSimpleAssignTarget(l)&&(e.parenthesizedAssign=u),e.parenthesizedBind<0&&(e.parenthesizedBind=u)),l;case b.bracketL:return t=this.startNode(),this.next(),t.elements=this.parseExprList(b.bracketR,!0,!0,e),this.finishNode(t,"ArrayExpression");case b.braceL:return this.parseObj(!1,e);case b._function:return t=this.startNode(),this.next(),this.parseFunction(t,0);case b._class:return this.parseClass(this.startNode(),!1);case b._new:return this.parseNew();case b.backQuote:return this.parseTemplate();case b._import:return this.options.ecmaVersion>=11?this.parseExprImport():this.unexpected();default:this.unexpected()}},ee.parseExprImport=function(){var e=this.startNode();this.containsEsc&&this.raiseRecoverable(this.start,"Escape sequence in keyword import");var t=this.parseIdent(!0);switch(this.type){case b.parenL:return this.parseDynamicImport(e);case b.dot:return e.meta=t,this.parseImportMeta(e);default:this.unexpected()}},ee.parseDynamicImport=function(e){if(this.next(),e.source=this.parseMaybeAssign(),!this.eat(b.parenR)){var t=this.start;this.eat(b.comma)&&this.eat(b.parenR)?this.raiseRecoverable(t,"Trailing comma is not allowed in import()"):this.unexpected(t)}return this.finishNode(e,"ImportExpression")},ee.parseImportMeta=function(e){this.next();var t=this.containsEsc;return e.property=this.parseIdent(!0),"meta"!==e.property.name&&this.raiseRecoverable(e.property.start,"The only valid meta property for import is 'import.meta'"),t&&this.raiseRecoverable(e.start,"'import.meta' must not contain escaped characters"),"module"!==this.options.sourceType&&this.raiseRecoverable(e.start,"Cannot use 'import.meta' outside a module"),this.finishNode(e,"MetaProperty")},ee.parseLiteral=function(e){var t=this.startNode();return t.value=e,t.raw=this.input.slice(this.start,this.end),110===t.raw.charCodeAt(t.raw.length-1)&&(t.bigint=t.raw.slice(0,-1).replace(/_/g,"")),this.next(),this.finishNode(t,"Literal")},ee.parseParenExpression=function(){this.expect(b.parenL);var e=this.parseExpression();return this.expect(b.parenR),e},ee.parseParenAndDistinguishExpression=function(e){var t,r=this.start,n=this.startLoc,i=this.options.ecmaVersion>=8;if(this.options.ecmaVersion>=6){this.next();var s,a=this.start,o=this.startLoc,u=[],l=!0,c=!1,h=new j,p=this.yieldPos,f=this.awaitPos;for(this.yieldPos=0,this.awaitPos=0;this.type!==b.parenR;){if(l?l=!1:this.expect(b.comma),i&&this.afterTrailingComma(b.parenR,!0)){c=!0;break}if(this.type===b.ellipsis){s=this.start,u.push(this.parseParenItem(this.parseRestBinding())),this.type===b.comma&&this.raise(this.start,"Comma is not permitted after the rest element");break}u.push(this.parseMaybeAssign(!1,h,this.parseParenItem))}var d=this.start,g=this.startLoc;if(this.expect(b.parenR),e&&!this.canInsertSemicolon()&&this.eat(b.arrow))return this.checkPatternErrors(h,!1),this.checkYieldAwaitInDefaultParams(),this.yieldPos=p,this.awaitPos=f,this.parseParenArrowList(r,n,u);u.length&&!c||this.unexpected(this.lastTokStart),s&&this.unexpected(s),this.checkExpressionErrors(h,!0),this.yieldPos=p||this.yieldPos,this.awaitPos=f||this.awaitPos,u.length>1?((t=this.startNodeAt(a,o)).expressions=u,this.finishNodeAt(t,"SequenceExpression",d,g)):t=u[0]}else t=this.parseParenExpression();if(this.options.preserveParens){var m=this.startNodeAt(r,n);return m.expression=t,this.finishNode(m,"ParenthesizedExpression")}return t},ee.parseParenItem=function(e){return e},ee.parseParenArrowList=function(e,t,r){return this.parseArrowExpression(this.startNodeAt(e,t),r)};var te=[];ee.parseNew=function(){this.containsEsc&&this.raiseRecoverable(this.start,"Escape sequence in keyword new");var e=this.startNode(),t=this.parseIdent(!0);if(this.options.ecmaVersion>=6&&this.eat(b.dot)){e.meta=t;var r=this.containsEsc;return e.property=this.parseIdent(!0),"target"!==e.property.name&&this.raiseRecoverable(e.property.start,"The only valid meta property for new is 'new.target'"),r&&this.raiseRecoverable(e.start,"'new.target' must not contain escaped characters"),this.inNonArrowFunction()||this.raiseRecoverable(e.start,"'new.target' can only be used in functions"),this.finishNode(e,"MetaProperty")}var n=this.start,i=this.startLoc,s=this.type===b._import;return e.callee=this.parseSubscripts(this.parseExprAtom(),n,i,!0),s&&"ImportExpression"===e.callee.type&&this.raise(n,"Cannot use new with import()"),this.eat(b.parenL)?e.arguments=this.parseExprList(b.parenR,this.options.ecmaVersion>=8,!1):e.arguments=te,this.finishNode(e,"NewExpression")},ee.parseTemplateElement=function(e){var t=e.isTagged,r=this.startNode();return this.type===b.invalidTemplate?(t||this.raiseRecoverable(this.start,"Bad escape sequence in untagged template literal"),r.value={raw:this.value,cooked:null}):r.value={raw:this.input.slice(this.start,this.end).replace(/\r\n?/g,"\n"),cooked:this.value},this.next(),r.tail=this.type===b.backQuote,this.finishNode(r,"TemplateElement")},ee.parseTemplate=function(e){void 0===e&&(e={});var t=e.isTagged;void 0===t&&(t=!1);var r=this.startNode();this.next(),r.expressions=[];var n=this.parseTemplateElement({isTagged:t});for(r.quasis=[n];!n.tail;)this.type===b.eof&&this.raise(this.pos,"Unterminated template literal"),this.expect(b.dollarBraceL),r.expressions.push(this.parseExpression()),this.expect(b.braceR),r.quasis.push(n=this.parseTemplateElement({isTagged:t}));return this.next(),this.finishNode(r,"TemplateLiteral")},ee.isAsyncProp=function(e){return!e.computed&&"Identifier"===e.key.type&&"async"===e.key.name&&(this.type===b.name||this.type===b.num||this.type===b.string||this.type===b.bracketL||this.type.keyword||this.options.ecmaVersion>=9&&this.type===b.star)&&!T.test(this.input.slice(this.lastTokEnd,this.start))},ee.parseObj=function(e,t){var r=this.startNode(),n=!0,i={};for(r.properties=[],this.next();!this.eat(b.braceR);){if(n)n=!1;else if(this.expect(b.comma),this.options.ecmaVersion>=5&&this.afterTrailingComma(b.braceR))break;var s=this.parseProperty(e,t);e||this.checkPropClash(s,i,t),r.properties.push(s)}return this.finishNode(r,e?"ObjectPattern":"ObjectExpression")},ee.parseProperty=function(e,t){var r,n,i,s,a=this.startNode();if(this.options.ecmaVersion>=9&&this.eat(b.ellipsis))return e?(a.argument=this.parseIdent(!1),this.type===b.comma&&this.raise(this.start,"Comma is not permitted after the rest element"),this.finishNode(a,"RestElement")):(this.type===b.parenL&&t&&(t.parenthesizedAssign<0&&(t.parenthesizedAssign=this.start),t.parenthesizedBind<0&&(t.parenthesizedBind=this.start)),a.argument=this.parseMaybeAssign(!1,t),this.type===b.comma&&t&&t.trailingComma<0&&(t.trailingComma=this.start),this.finishNode(a,"SpreadElement"));this.options.ecmaVersion>=6&&(a.method=!1,a.shorthand=!1,(e||t)&&(i=this.start,s=this.startLoc),e||(r=this.eat(b.star)));var o=this.containsEsc;return this.parsePropertyName(a),!e&&!o&&this.options.ecmaVersion>=8&&!r&&this.isAsyncProp(a)?(n=!0,r=this.options.ecmaVersion>=9&&this.eat(b.star),this.parsePropertyName(a,t)):n=!1,this.parsePropertyValue(a,e,r,n,i,s,t,o),this.finishNode(a,"Property")},ee.parsePropertyValue=function(e,t,r,n,i,s,a,o){if((r||n)&&this.type===b.colon&&this.unexpected(),this.eat(b.colon))e.value=t?this.parseMaybeDefault(this.start,this.startLoc):this.parseMaybeAssign(!1,a),e.kind="init";else if(this.options.ecmaVersion>=6&&this.type===b.parenL)t&&this.unexpected(),e.kind="init",e.method=!0,e.value=this.parseMethod(r,n);else if(t||o||!(this.options.ecmaVersion>=5)||e.computed||"Identifier"!==e.key.type||"get"!==e.key.name&&"set"!==e.key.name||this.type===b.comma||this.type===b.braceR||this.type===b.eq)this.options.ecmaVersion>=6&&!e.computed&&"Identifier"===e.key.type?((r||n)&&this.unexpected(),this.checkUnreserved(e.key),"await"!==e.key.name||this.awaitIdentPos||(this.awaitIdentPos=i),e.kind="init",t?e.value=this.parseMaybeDefault(i,s,e.key):this.type===b.eq&&a?(a.shorthandAssign<0&&(a.shorthandAssign=this.start),e.value=this.parseMaybeDefault(i,s,e.key)):e.value=e.key,e.shorthand=!0):this.unexpected();else{(r||n)&&this.unexpected(),e.kind=e.key.name,this.parsePropertyName(e),e.value=this.parseMethod(!1);var u="get"===e.kind?0:1;if(e.value.params.length!==u){var l=e.value.start;"get"===e.kind?this.raiseRecoverable(l,"getter should have no params"):this.raiseRecoverable(l,"setter should have exactly one param")}else"set"===e.kind&&"RestElement"===e.value.params[0].type&&this.raiseRecoverable(e.value.params[0].start,"Setter cannot use rest params")}},ee.parsePropertyName=function(e){if(this.options.ecmaVersion>=6){if(this.eat(b.bracketL))return e.computed=!0,e.key=this.parseMaybeAssign(),this.expect(b.bracketR),e.key;e.computed=!1}return e.key=this.type===b.num||this.type===b.string?this.parseExprAtom():this.parseIdent("never"!==this.options.allowReserved)},ee.initFunction=function(e){e.id=null,this.options.ecmaVersion>=6&&(e.generator=e.expression=!1),this.options.ecmaVersion>=8&&(e.async=!1)},ee.parseMethod=function(e,t,r){var n=this.startNode(),i=this.yieldPos,s=this.awaitPos,a=this.awaitIdentPos;return this.initFunction(n),this.options.ecmaVersion>=6&&(n.generator=e),this.options.ecmaVersion>=8&&(n.async=!!t),this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0,this.enterScope(64|B(t,n.generator)|(r?128:0)),this.expect(b.parenL),n.params=this.parseBindingList(b.parenR,!1,this.options.ecmaVersion>=8),this.checkYieldAwaitInDefaultParams(),this.parseFunctionBody(n,!1,!0),this.yieldPos=i,this.awaitPos=s,this.awaitIdentPos=a,this.finishNode(n,"FunctionExpression")},ee.parseArrowExpression=function(e,t,r){var n=this.yieldPos,i=this.awaitPos,s=this.awaitIdentPos;return this.enterScope(16|B(r,!1)),this.initFunction(e),this.options.ecmaVersion>=8&&(e.async=!!r),this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0,e.params=this.toAssignableList(t,!0),this.parseFunctionBody(e,!0,!1),this.yieldPos=n,this.awaitPos=i,this.awaitIdentPos=s,this.finishNode(e,"ArrowFunctionExpression")},ee.parseFunctionBody=function(e,t,r){var n=t&&this.type!==b.braceL,i=this.strict,s=!1;if(n)e.body=this.parseMaybeAssign(),e.expression=!0,this.checkParams(e,!1);else{var a=this.options.ecmaVersion>=7&&!this.isSimpleParamList(e.params);i&&!a||(s=this.strictDirective(this.end))&&a&&this.raiseRecoverable(e.start,"Illegal 'use strict' directive in function with non-simple parameter list");var o=this.labels;this.labels=[],s&&(this.strict=!0),this.checkParams(e,!i&&!s&&!t&&!r&&this.isSimpleParamList(e.params)),this.strict&&e.id&&this.checkLVal(e.id,5),e.body=this.parseBlock(!1,void 0,s&&!i),e.expression=!1,this.adaptDirectivePrologue(e.body.body),this.labels=o}this.exitScope()},ee.isSimpleParamList=function(e){for(var t=0,r=e;t-1||i.functions.indexOf(e)>-1||i.var.indexOf(e)>-1,i.lexical.push(e),this.inModule&&1&i.flags&&delete this.undefinedExports[e]}else if(4===t){this.currentScope().lexical.push(e)}else if(3===t){var s=this.currentScope();n=this.treatFunctionsAsVar?s.lexical.indexOf(e)>-1:s.lexical.indexOf(e)>-1||s.var.indexOf(e)>-1,s.functions.push(e)}else for(var a=this.scopeStack.length-1;a>=0;--a){var o=this.scopeStack[a];if(o.lexical.indexOf(e)>-1&&!(32&o.flags&&o.lexical[0]===e)||!this.treatFunctionsAsVarInScope(o)&&o.functions.indexOf(e)>-1){n=!0;break}if(o.var.push(e),this.inModule&&1&o.flags&&delete this.undefinedExports[e],o.flags&U)break}n&&this.raiseRecoverable(r,"Identifier '"+e+"' has already been declared")},ne.checkLocalExport=function(e){-1===this.scopeStack[0].lexical.indexOf(e.name)&&-1===this.scopeStack[0].var.indexOf(e.name)&&(this.undefinedExports[e.name]=e)},ne.currentScope=function(){return this.scopeStack[this.scopeStack.length-1]},ne.currentVarScope=function(){for(var e=this.scopeStack.length-1;;e--){var t=this.scopeStack[e];if(t.flags&U)return t}},ne.currentThisScope=function(){for(var e=this.scopeStack.length-1;;e--){var t=this.scopeStack[e];if(t.flags&U&&!(16&t.flags))return t}};var ie=function(e,t,r){this.type="",this.start=t,this.end=0,e.options.locations&&(this.loc=new N(e,r)),e.options.directSourceFile&&(this.sourceFile=e.options.directSourceFile),e.options.ranges&&(this.range=[t,0])},se=G.prototype;function ae(e,t,r,n){return e.type=t,e.end=r,this.options.locations&&(e.loc.end=n),this.options.ranges&&(e.range[1]=r),e}se.startNode=function(){return new ie(this,this.start,this.startLoc)},se.startNodeAt=function(e,t){return new ie(this,e,t)},se.finishNode=function(e,t){return ae.call(this,e,t,this.lastTokEnd,this.lastTokEndLoc)},se.finishNodeAt=function(e,t,r,n){return ae.call(this,e,t,r,n)};var oe=function(e,t,r,n,i){this.token=e,this.isExpr=!!t,this.preserveSpace=!!r,this.override=n,this.generator=!!i},ue={b_stat:new oe("{",!1),b_expr:new oe("{",!0),b_tmpl:new oe("${",!1),p_stat:new oe("(",!1),p_expr:new oe("(",!0),q_tmpl:new oe("`",!0,!0,function(e){return e.tryReadTemplateToken()}),f_stat:new oe("function",!1),f_expr:new oe("function",!0),f_expr_gen:new oe("function",!0,!1,null,!0),f_gen:new oe("function",!1,!1,null,!0)},le=G.prototype;le.initialContext=function(){return[ue.b_stat]},le.braceIsBlock=function(e){var t=this.curContext();return t===ue.f_expr||t===ue.f_stat||(e!==b.colon||t!==ue.b_stat&&t!==ue.b_expr?e===b._return||e===b.name&&this.exprAllowed?T.test(this.input.slice(this.lastTokEnd,this.start)):e===b._else||e===b.semi||e===b.eof||e===b.parenR||e===b.arrow||(e===b.braceL?t===ue.b_stat:e!==b._var&&e!==b._const&&e!==b.name&&!this.exprAllowed):!t.isExpr)},le.inGeneratorContext=function(){for(var e=this.context.length-1;e>=1;e--){var t=this.context[e];if("function"===t.token)return t.generator}return!1},le.updateContext=function(e){var t,r=this.type;r.keyword&&e===b.dot?this.exprAllowed=!1:(t=r.updateContext)?t.call(this,e):this.exprAllowed=r.beforeExpr},b.parenR.updateContext=b.braceR.updateContext=function(){if(1!==this.context.length){var e=this.context.pop();e===ue.b_stat&&"function"===this.curContext().token&&(e=this.context.pop()),this.exprAllowed=!e.isExpr}else this.exprAllowed=!0},b.braceL.updateContext=function(e){this.context.push(this.braceIsBlock(e)?ue.b_stat:ue.b_expr),this.exprAllowed=!0},b.dollarBraceL.updateContext=function(){this.context.push(ue.b_tmpl),this.exprAllowed=!0},b.parenL.updateContext=function(e){var t=e===b._if||e===b._for||e===b._with||e===b._while;this.context.push(t?ue.p_stat:ue.p_expr),this.exprAllowed=!0},b.incDec.updateContext=function(){},b._function.updateContext=b._class.updateContext=function(e){!e.beforeExpr||e===b.semi||e===b._else||e===b._return&&T.test(this.input.slice(this.lastTokEnd,this.start))||(e===b.colon||e===b.braceL)&&this.curContext()===ue.b_stat?this.context.push(ue.f_stat):this.context.push(ue.f_expr),this.exprAllowed=!1},b.backQuote.updateContext=function(){this.curContext()===ue.q_tmpl?this.context.pop():this.context.push(ue.q_tmpl),this.exprAllowed=!1},b.star.updateContext=function(e){if(e===b._function){var t=this.context.length-1;this.context[t]===ue.f_expr?this.context[t]=ue.f_expr_gen:this.context[t]=ue.f_gen}this.exprAllowed=!0},b.name.updateContext=function(e){var t=!1;this.options.ecmaVersion>=6&&e!==b.dot&&("of"===this.value&&!this.exprAllowed||"yield"===this.value&&this.inGeneratorContext())&&(t=!0),this.exprAllowed=t};var ce="ASCII ASCII_Hex_Digit AHex Alphabetic Alpha Any Assigned Bidi_Control Bidi_C Bidi_Mirrored Bidi_M Case_Ignorable CI Cased Changes_When_Casefolded CWCF Changes_When_Casemapped CWCM Changes_When_Lowercased CWL Changes_When_NFKC_Casefolded CWKCF Changes_When_Titlecased CWT Changes_When_Uppercased CWU Dash Default_Ignorable_Code_Point DI Deprecated Dep Diacritic Dia Emoji Emoji_Component Emoji_Modifier Emoji_Modifier_Base Emoji_Presentation Extender Ext Grapheme_Base Gr_Base Grapheme_Extend Gr_Ext Hex_Digit Hex IDS_Binary_Operator IDSB IDS_Trinary_Operator IDST ID_Continue IDC ID_Start IDS Ideographic Ideo Join_Control Join_C Logical_Order_Exception LOE Lowercase Lower Math Noncharacter_Code_Point NChar Pattern_Syntax Pat_Syn Pattern_White_Space Pat_WS Quotation_Mark QMark Radical Regional_Indicator RI Sentence_Terminal STerm Soft_Dotted SD Terminal_Punctuation Term Unified_Ideograph UIdeo Uppercase Upper Variation_Selector VS White_Space space XID_Continue XIDC XID_Start XIDS",he=ce+" Extended_Pictographic",pe={9:ce,10:he,11:"ASCII ASCII_Hex_Digit AHex Alphabetic Alpha Any Assigned Bidi_Control Bidi_C Bidi_Mirrored Bidi_M Case_Ignorable CI Cased Changes_When_Casefolded CWCF Changes_When_Casemapped CWCM Changes_When_Lowercased CWL Changes_When_NFKC_Casefolded CWKCF Changes_When_Titlecased CWT Changes_When_Uppercased CWU Dash Default_Ignorable_Code_Point DI Deprecated Dep Diacritic Dia Emoji Emoji_Component Emoji_Modifier Emoji_Modifier_Base Emoji_Presentation Extender Ext Grapheme_Base Gr_Base Grapheme_Extend Gr_Ext Hex_Digit Hex IDS_Binary_Operator IDSB IDS_Trinary_Operator IDST ID_Continue IDC ID_Start IDS Ideographic Ideo Join_Control Join_C Logical_Order_Exception LOE Lowercase Lower Math Noncharacter_Code_Point NChar Pattern_Syntax Pat_Syn Pattern_White_Space Pat_WS Quotation_Mark QMark Radical Regional_Indicator RI Sentence_Terminal STerm Soft_Dotted SD Terminal_Punctuation Term Unified_Ideograph UIdeo Uppercase Upper Variation_Selector VS White_Space space XID_Continue XIDC XID_Start XIDS Extended_Pictographic"},fe="Cased_Letter LC Close_Punctuation Pe Connector_Punctuation Pc Control Cc cntrl Currency_Symbol Sc Dash_Punctuation Pd Decimal_Number Nd digit Enclosing_Mark Me Final_Punctuation Pf Format Cf Initial_Punctuation Pi Letter L Letter_Number Nl Line_Separator Zl Lowercase_Letter Ll Mark M Combining_Mark Math_Symbol Sm Modifier_Letter Lm Modifier_Symbol Sk Nonspacing_Mark Mn Number N Open_Punctuation Ps Other C Other_Letter Lo Other_Number No Other_Punctuation Po Other_Symbol So Paragraph_Separator Zp Private_Use Co Punctuation P punct Separator Z Space_Separator Zs Spacing_Mark Mc Surrogate Cs Symbol S Titlecase_Letter Lt Unassigned Cn Uppercase_Letter Lu",de="Adlam Adlm Ahom Ahom Anatolian_Hieroglyphs Hluw Arabic Arab Armenian Armn Avestan Avst Balinese Bali Bamum Bamu Bassa_Vah Bass Batak Batk Bengali Beng Bhaiksuki Bhks Bopomofo Bopo Brahmi Brah Braille Brai Buginese Bugi Buhid Buhd Canadian_Aboriginal Cans Carian Cari Caucasian_Albanian Aghb Chakma Cakm Cham Cham Cherokee Cher Common Zyyy Coptic Copt Qaac Cuneiform Xsux Cypriot Cprt Cyrillic Cyrl Deseret Dsrt Devanagari Deva Duployan Dupl Egyptian_Hieroglyphs Egyp Elbasan Elba Ethiopic Ethi Georgian Geor Glagolitic Glag Gothic Goth Grantha Gran Greek Grek Gujarati Gujr Gurmukhi Guru Han Hani Hangul Hang Hanunoo Hano Hatran Hatr Hebrew Hebr Hiragana Hira Imperial_Aramaic Armi Inherited Zinh Qaai Inscriptional_Pahlavi Phli Inscriptional_Parthian Prti Javanese Java Kaithi Kthi Kannada Knda Katakana Kana Kayah_Li Kali Kharoshthi Khar Khmer Khmr Khojki Khoj Khudawadi Sind Lao Laoo Latin Latn Lepcha Lepc Limbu Limb Linear_A Lina Linear_B Linb Lisu Lisu Lycian Lyci Lydian Lydi Mahajani Mahj Malayalam Mlym Mandaic Mand Manichaean Mani Marchen Marc Masaram_Gondi Gonm Meetei_Mayek Mtei Mende_Kikakui Mend Meroitic_Cursive Merc Meroitic_Hieroglyphs Mero Miao Plrd Modi Modi Mongolian Mong Mro Mroo Multani Mult Myanmar Mymr Nabataean Nbat New_Tai_Lue Talu Newa Newa Nko Nkoo Nushu Nshu Ogham Ogam Ol_Chiki Olck Old_Hungarian Hung Old_Italic Ital Old_North_Arabian Narb Old_Permic Perm Old_Persian Xpeo Old_South_Arabian Sarb Old_Turkic Orkh Oriya Orya Osage Osge Osmanya Osma Pahawh_Hmong Hmng Palmyrene Palm Pau_Cin_Hau Pauc Phags_Pa Phag Phoenician Phnx Psalter_Pahlavi Phlp Rejang Rjng Runic Runr Samaritan Samr Saurashtra Saur Sharada Shrd Shavian Shaw Siddham Sidd SignWriting Sgnw Sinhala Sinh Sora_Sompeng Sora Soyombo Soyo Sundanese Sund Syloti_Nagri Sylo Syriac Syrc Tagalog Tglg Tagbanwa Tagb Tai_Le Tale Tai_Tham Lana Tai_Viet Tavt Takri Takr Tamil Taml Tangut Tang Telugu Telu Thaana Thaa Thai Thai Tibetan Tibt Tifinagh Tfng Tirhuta Tirh Ugaritic Ugar Vai Vaii Warang_Citi Wara Yi Yiii Zanabazar_Square Zanb",ge=de+" Dogra Dogr Gunjala_Gondi Gong Hanifi_Rohingya Rohg Makasar Maka Medefaidrin Medf Old_Sogdian Sogo Sogdian Sogd",me={9:de,10:ge,11:"Adlam Adlm Ahom Ahom Anatolian_Hieroglyphs Hluw Arabic Arab Armenian Armn Avestan Avst Balinese Bali Bamum Bamu Bassa_Vah Bass Batak Batk Bengali Beng Bhaiksuki Bhks Bopomofo Bopo Brahmi Brah Braille Brai Buginese Bugi Buhid Buhd Canadian_Aboriginal Cans Carian Cari Caucasian_Albanian Aghb Chakma Cakm Cham Cham Cherokee Cher Common Zyyy Coptic Copt Qaac Cuneiform Xsux Cypriot Cprt Cyrillic Cyrl Deseret Dsrt Devanagari Deva Duployan Dupl Egyptian_Hieroglyphs Egyp Elbasan Elba Ethiopic Ethi Georgian Geor Glagolitic Glag Gothic Goth Grantha Gran Greek Grek Gujarati Gujr Gurmukhi Guru Han Hani Hangul Hang Hanunoo Hano Hatran Hatr Hebrew Hebr Hiragana Hira Imperial_Aramaic Armi Inherited Zinh Qaai Inscriptional_Pahlavi Phli Inscriptional_Parthian Prti Javanese Java Kaithi Kthi Kannada Knda Katakana Kana Kayah_Li Kali Kharoshthi Khar Khmer Khmr Khojki Khoj Khudawadi Sind Lao Laoo Latin Latn Lepcha Lepc Limbu Limb Linear_A Lina Linear_B Linb Lisu Lisu Lycian Lyci Lydian Lydi Mahajani Mahj Malayalam Mlym Mandaic Mand Manichaean Mani Marchen Marc Masaram_Gondi Gonm Meetei_Mayek Mtei Mende_Kikakui Mend Meroitic_Cursive Merc Meroitic_Hieroglyphs Mero Miao Plrd Modi Modi Mongolian Mong Mro Mroo Multani Mult Myanmar Mymr Nabataean Nbat New_Tai_Lue Talu Newa Newa Nko Nkoo Nushu Nshu Ogham Ogam Ol_Chiki Olck Old_Hungarian Hung Old_Italic Ital Old_North_Arabian Narb Old_Permic Perm Old_Persian Xpeo Old_South_Arabian Sarb Old_Turkic Orkh Oriya Orya Osage Osge Osmanya Osma Pahawh_Hmong Hmng Palmyrene Palm Pau_Cin_Hau Pauc Phags_Pa Phag Phoenician Phnx Psalter_Pahlavi Phlp Rejang Rjng Runic Runr Samaritan Samr Saurashtra Saur Sharada Shrd Shavian Shaw Siddham Sidd SignWriting Sgnw Sinhala Sinh Sora_Sompeng Sora Soyombo Soyo Sundanese Sund Syloti_Nagri Sylo Syriac Syrc Tagalog Tglg Tagbanwa Tagb Tai_Le Tale Tai_Tham Lana Tai_Viet Tavt Takri Takr Tamil Taml Tangut Tang Telugu Telu Thaana Thaa Thai Thai Tibetan Tibt Tifinagh Tfng Tirhuta Tirh Ugaritic Ugar Vai Vaii Warang_Citi Wara Yi Yiii Zanabazar_Square Zanb Dogra Dogr Gunjala_Gondi Gong Hanifi_Rohingya Rohg Makasar Maka Medefaidrin Medf Old_Sogdian Sogo Sogdian Sogd Elymaic Elym Nandinagari Nand Nyiakeng_Puachue_Hmong Hmnp Wancho Wcho"},_e={};function xe(e){var t=_e[e]={binary:k(pe[e]+" "+fe),nonBinary:{General_Category:k(fe),Script:k(me[e])}};t.nonBinary.Script_Extensions=t.nonBinary.Script,t.nonBinary.gc=t.nonBinary.General_Category,t.nonBinary.sc=t.nonBinary.Script,t.nonBinary.scx=t.nonBinary.Script_Extensions}xe(9),xe(10),xe(11);var ye=G.prototype,be=function(e){this.parser=e,this.validFlags="gim"+(e.options.ecmaVersion>=6?"uy":"")+(e.options.ecmaVersion>=9?"s":""),this.unicodeProperties=_e[e.options.ecmaVersion>=11?11:e.options.ecmaVersion],this.source="",this.flags="",this.start=0,this.switchU=!1,this.switchN=!1,this.pos=0,this.lastIntValue=0,this.lastStringValue="",this.lastAssertionIsQuantifiable=!1,this.numCapturingParens=0,this.maxBackReference=0,this.groupNames=[],this.backReferenceNames=[]};function Te(e){return e<=65535?String.fromCharCode(e):(e-=65536,String.fromCharCode(55296+(e>>10),56320+(1023&e)))}function ve(e){return 36===e||e>=40&&e<=43||46===e||63===e||e>=91&&e<=94||e>=123&&e<=125}function Ee(e){return e>=65&&e<=90||e>=97&&e<=122}function Ae(e){return Ee(e)||95===e}function Se(e){return Ae(e)||we(e)}function we(e){return e>=48&&e<=57}function Ie(e){return e>=48&&e<=57||e>=65&&e<=70||e>=97&&e<=102}function Le(e){return e>=65&&e<=70?e-65+10:e>=97&&e<=102?e-97+10:e-48}function Re(e){return e>=48&&e<=55}be.prototype.reset=function(e,t,r){var n=-1!==r.indexOf("u");this.start=0|e,this.source=t+"",this.flags=r,this.switchU=n&&this.parser.options.ecmaVersion>=6,this.switchN=n&&this.parser.options.ecmaVersion>=9},be.prototype.raise=function(e){this.parser.raiseRecoverable(this.start,"Invalid regular expression: /"+this.source+"/: "+e)},be.prototype.at=function(e,t){void 0===t&&(t=!1);var r=this.source,n=r.length;if(e>=n)return-1;var i=r.charCodeAt(e);if(!t&&!this.switchU||i<=55295||i>=57344||e+1>=n)return i;var s=r.charCodeAt(e+1);return s>=56320&&s<=57343?(i<<10)+s-56613888:i},be.prototype.nextIndex=function(e,t){void 0===t&&(t=!1);var r=this.source,n=r.length;if(e>=n)return n;var i,s=r.charCodeAt(e);return!t&&!this.switchU||s<=55295||s>=57344||e+1>=n||(i=r.charCodeAt(e+1))<56320||i>57343?e+1:e+2},be.prototype.current=function(e){return void 0===e&&(e=!1),this.at(this.pos,e)},be.prototype.lookahead=function(e){return void 0===e&&(e=!1),this.at(this.nextIndex(this.pos,e),e)},be.prototype.advance=function(e){void 0===e&&(e=!1),this.pos=this.nextIndex(this.pos,e)},be.prototype.eat=function(e,t){return void 0===t&&(t=!1),this.current(t)===e&&(this.advance(t),!0)},ye.validateRegExpFlags=function(e){for(var t=e.validFlags,r=e.flags,n=0;n-1&&this.raise(e.start,"Duplicate regular expression flag")}},ye.validateRegExpPattern=function(e){this.regexp_pattern(e),!e.switchN&&this.options.ecmaVersion>=9&&e.groupNames.length>0&&(e.switchN=!0,this.regexp_pattern(e))},ye.regexp_pattern=function(e){e.pos=0,e.lastIntValue=0,e.lastStringValue="",e.lastAssertionIsQuantifiable=!1,e.numCapturingParens=0,e.maxBackReference=0,e.groupNames.length=0,e.backReferenceNames.length=0,this.regexp_disjunction(e),e.pos!==e.source.length&&(e.eat(41)&&e.raise("Unmatched ')'"),(e.eat(93)||e.eat(125))&&e.raise("Lone quantifier brackets")),e.maxBackReference>e.numCapturingParens&&e.raise("Invalid escape");for(var t=0,r=e.backReferenceNames;t=9&&(r=e.eat(60)),e.eat(61)||e.eat(33))return this.regexp_disjunction(e),e.eat(41)||e.raise("Unterminated group"),e.lastAssertionIsQuantifiable=!r,!0}return e.pos=t,!1},ye.regexp_eatQuantifier=function(e,t){return void 0===t&&(t=!1),!!this.regexp_eatQuantifierPrefix(e,t)&&(e.eat(63),!0)},ye.regexp_eatQuantifierPrefix=function(e,t){return e.eat(42)||e.eat(43)||e.eat(63)||this.regexp_eatBracedQuantifier(e,t)},ye.regexp_eatBracedQuantifier=function(e,t){var r=e.pos;if(e.eat(123)){var n=0,i=-1;if(this.regexp_eatDecimalDigits(e)&&(n=e.lastIntValue,e.eat(44)&&this.regexp_eatDecimalDigits(e)&&(i=e.lastIntValue),e.eat(125)))return-1!==i&&i=9?this.regexp_groupSpecifier(e):63===e.current()&&e.raise("Invalid group"),this.regexp_disjunction(e),e.eat(41))return e.numCapturingParens+=1,!0;e.raise("Unterminated group")}return!1},ye.regexp_eatExtendedAtom=function(e){return e.eat(46)||this.regexp_eatReverseSolidusAtomEscape(e)||this.regexp_eatCharacterClass(e)||this.regexp_eatUncapturingGroup(e)||this.regexp_eatCapturingGroup(e)||this.regexp_eatInvalidBracedQuantifier(e)||this.regexp_eatExtendedPatternCharacter(e)},ye.regexp_eatInvalidBracedQuantifier=function(e){return this.regexp_eatBracedQuantifier(e,!0)&&e.raise("Nothing to repeat"),!1},ye.regexp_eatSyntaxCharacter=function(e){var t=e.current();return!!ve(t)&&(e.lastIntValue=t,e.advance(),!0)},ye.regexp_eatPatternCharacters=function(e){for(var t=e.pos,r=0;-1!==(r=e.current())&&!ve(r);)e.advance();return e.pos!==t},ye.regexp_eatExtendedPatternCharacter=function(e){var t=e.current();return!(-1===t||36===t||t>=40&&t<=43||46===t||63===t||91===t||94===t||124===t)&&(e.advance(),!0)},ye.regexp_groupSpecifier=function(e){if(e.eat(63)){if(this.regexp_eatGroupName(e))return-1!==e.groupNames.indexOf(e.lastStringValue)&&e.raise("Duplicate capture group name"),void e.groupNames.push(e.lastStringValue);e.raise("Invalid group")}},ye.regexp_eatGroupName=function(e){if(e.lastStringValue="",e.eat(60)){if(this.regexp_eatRegExpIdentifierName(e)&&e.eat(62))return!0;e.raise("Invalid capture group name")}return!1},ye.regexp_eatRegExpIdentifierName=function(e){if(e.lastStringValue="",this.regexp_eatRegExpIdentifierStart(e)){for(e.lastStringValue+=Te(e.lastIntValue);this.regexp_eatRegExpIdentifierPart(e);)e.lastStringValue+=Te(e.lastIntValue);return!0}return!1},ye.regexp_eatRegExpIdentifierStart=function(e){var t=e.pos,r=this.options.ecmaVersion>=11,n=e.current(r);return e.advance(r),92===n&&this.regexp_eatRegExpUnicodeEscapeSequence(e,r)&&(n=e.lastIntValue),function(e){return p(e,!0)||36===e||95===e}(n)?(e.lastIntValue=n,!0):(e.pos=t,!1)},ye.regexp_eatRegExpIdentifierPart=function(e){var t=e.pos,r=this.options.ecmaVersion>=11,n=e.current(r);return e.advance(r),92===n&&this.regexp_eatRegExpUnicodeEscapeSequence(e,r)&&(n=e.lastIntValue),function(e){return f(e,!0)||36===e||95===e||8204===e||8205===e}(n)?(e.lastIntValue=n,!0):(e.pos=t,!1)},ye.regexp_eatAtomEscape=function(e){return!!(this.regexp_eatBackReference(e)||this.regexp_eatCharacterClassEscape(e)||this.regexp_eatCharacterEscape(e)||e.switchN&&this.regexp_eatKGroupName(e))||(e.switchU&&(99===e.current()&&e.raise("Invalid unicode escape"),e.raise("Invalid escape")),!1)},ye.regexp_eatBackReference=function(e){var t=e.pos;if(this.regexp_eatDecimalEscape(e)){var r=e.lastIntValue;if(e.switchU)return r>e.maxBackReference&&(e.maxBackReference=r),!0;if(r<=e.numCapturingParens)return!0;e.pos=t}return!1},ye.regexp_eatKGroupName=function(e){if(e.eat(107)){if(this.regexp_eatGroupName(e))return e.backReferenceNames.push(e.lastStringValue),!0;e.raise("Invalid named reference")}return!1},ye.regexp_eatCharacterEscape=function(e){return this.regexp_eatControlEscape(e)||this.regexp_eatCControlLetter(e)||this.regexp_eatZero(e)||this.regexp_eatHexEscapeSequence(e)||this.regexp_eatRegExpUnicodeEscapeSequence(e,!1)||!e.switchU&&this.regexp_eatLegacyOctalEscapeSequence(e)||this.regexp_eatIdentityEscape(e)},ye.regexp_eatCControlLetter=function(e){var t=e.pos;if(e.eat(99)){if(this.regexp_eatControlLetter(e))return!0;e.pos=t}return!1},ye.regexp_eatZero=function(e){return 48===e.current()&&!we(e.lookahead())&&(e.lastIntValue=0,e.advance(),!0)},ye.regexp_eatControlEscape=function(e){var t=e.current();return 116===t?(e.lastIntValue=9,e.advance(),!0):110===t?(e.lastIntValue=10,e.advance(),!0):118===t?(e.lastIntValue=11,e.advance(),!0):102===t?(e.lastIntValue=12,e.advance(),!0):114===t&&(e.lastIntValue=13,e.advance(),!0)},ye.regexp_eatControlLetter=function(e){var t=e.current();return!!Ee(t)&&(e.lastIntValue=t%32,e.advance(),!0)},ye.regexp_eatRegExpUnicodeEscapeSequence=function(e,t){void 0===t&&(t=!1);var r,n=e.pos,i=t||e.switchU;if(e.eat(117)){if(this.regexp_eatFixedHexDigits(e,4)){var s=e.lastIntValue;if(i&&s>=55296&&s<=56319){var a=e.pos;if(e.eat(92)&&e.eat(117)&&this.regexp_eatFixedHexDigits(e,4)){var o=e.lastIntValue;if(o>=56320&&o<=57343)return e.lastIntValue=1024*(s-55296)+(o-56320)+65536,!0}e.pos=a,e.lastIntValue=s}return!0}if(i&&e.eat(123)&&this.regexp_eatHexDigits(e)&&e.eat(125)&&((r=e.lastIntValue)>=0&&r<=1114111))return!0;i&&e.raise("Invalid unicode escape"),e.pos=n}return!1},ye.regexp_eatIdentityEscape=function(e){if(e.switchU)return!!this.regexp_eatSyntaxCharacter(e)||!!e.eat(47)&&(e.lastIntValue=47,!0);var t=e.current();return!(99===t||e.switchN&&107===t)&&(e.lastIntValue=t,e.advance(),!0)},ye.regexp_eatDecimalEscape=function(e){e.lastIntValue=0;var t=e.current();if(t>=49&&t<=57){do{e.lastIntValue=10*e.lastIntValue+(t-48),e.advance()}while((t=e.current())>=48&&t<=57);return!0}return!1},ye.regexp_eatCharacterClassEscape=function(e){var t=e.current();if(function(e){return 100===e||68===e||115===e||83===e||119===e||87===e}(t))return e.lastIntValue=-1,e.advance(),!0;if(e.switchU&&this.options.ecmaVersion>=9&&(80===t||112===t)){if(e.lastIntValue=-1,e.advance(),e.eat(123)&&this.regexp_eatUnicodePropertyValueExpression(e)&&e.eat(125))return!0;e.raise("Invalid property name")}return!1},ye.regexp_eatUnicodePropertyValueExpression=function(e){var t=e.pos;if(this.regexp_eatUnicodePropertyName(e)&&e.eat(61)){var r=e.lastStringValue;if(this.regexp_eatUnicodePropertyValue(e)){var n=e.lastStringValue;return this.regexp_validateUnicodePropertyNameAndValue(e,r,n),!0}}if(e.pos=t,this.regexp_eatLoneUnicodePropertyNameOrValue(e)){var i=e.lastStringValue;return this.regexp_validateUnicodePropertyNameOrValue(e,i),!0}return!1},ye.regexp_validateUnicodePropertyNameAndValue=function(e,t,r){R(e.unicodeProperties.nonBinary,t)||e.raise("Invalid property name"),e.unicodeProperties.nonBinary[t].test(r)||e.raise("Invalid property value")},ye.regexp_validateUnicodePropertyNameOrValue=function(e,t){e.unicodeProperties.binary.test(t)||e.raise("Invalid property name")},ye.regexp_eatUnicodePropertyName=function(e){var t=0;for(e.lastStringValue="";Ae(t=e.current());)e.lastStringValue+=Te(t),e.advance();return""!==e.lastStringValue},ye.regexp_eatUnicodePropertyValue=function(e){var t=0;for(e.lastStringValue="";Se(t=e.current());)e.lastStringValue+=Te(t),e.advance();return""!==e.lastStringValue},ye.regexp_eatLoneUnicodePropertyNameOrValue=function(e){return this.regexp_eatUnicodePropertyValue(e)},ye.regexp_eatCharacterClass=function(e){if(e.eat(91)){if(e.eat(94),this.regexp_classRanges(e),e.eat(93))return!0;e.raise("Unterminated character class")}return!1},ye.regexp_classRanges=function(e){for(;this.regexp_eatClassAtom(e);){var t=e.lastIntValue;if(e.eat(45)&&this.regexp_eatClassAtom(e)){var r=e.lastIntValue;!e.switchU||-1!==t&&-1!==r||e.raise("Invalid character class"),-1!==t&&-1!==r&&t>r&&e.raise("Range out of order in character class")}}},ye.regexp_eatClassAtom=function(e){var t=e.pos;if(e.eat(92)){if(this.regexp_eatClassEscape(e))return!0;if(e.switchU){var r=e.current();(99===r||Re(r))&&e.raise("Invalid class escape"),e.raise("Invalid escape")}e.pos=t}var n=e.current();return 93!==n&&(e.lastIntValue=n,e.advance(),!0)},ye.regexp_eatClassEscape=function(e){var t=e.pos;if(e.eat(98))return e.lastIntValue=8,!0;if(e.switchU&&e.eat(45))return e.lastIntValue=45,!0;if(!e.switchU&&e.eat(99)){if(this.regexp_eatClassControlLetter(e))return!0;e.pos=t}return this.regexp_eatCharacterClassEscape(e)||this.regexp_eatCharacterEscape(e)},ye.regexp_eatClassControlLetter=function(e){var t=e.current();return!(!we(t)&&95!==t)&&(e.lastIntValue=t%32,e.advance(),!0)},ye.regexp_eatHexEscapeSequence=function(e){var t=e.pos;if(e.eat(120)){if(this.regexp_eatFixedHexDigits(e,2))return!0;e.switchU&&e.raise("Invalid escape"),e.pos=t}return!1},ye.regexp_eatDecimalDigits=function(e){var t=e.pos,r=0;for(e.lastIntValue=0;we(r=e.current());)e.lastIntValue=10*e.lastIntValue+(r-48),e.advance();return e.pos!==t},ye.regexp_eatHexDigits=function(e){var t=e.pos,r=0;for(e.lastIntValue=0;Ie(r=e.current());)e.lastIntValue=16*e.lastIntValue+Le(r),e.advance();return e.pos!==t},ye.regexp_eatLegacyOctalEscapeSequence=function(e){if(this.regexp_eatOctalDigit(e)){var t=e.lastIntValue;if(this.regexp_eatOctalDigit(e)){var r=e.lastIntValue;t<=3&&this.regexp_eatOctalDigit(e)?e.lastIntValue=64*t+8*r+e.lastIntValue:e.lastIntValue=8*t+r}else e.lastIntValue=t;return!0}return!1},ye.regexp_eatOctalDigit=function(e){var t=e.current();return Re(t)?(e.lastIntValue=t-48,e.advance(),!0):(e.lastIntValue=0,!1)},ye.regexp_eatFixedHexDigits=function(e,t){var r=e.pos;e.lastIntValue=0;for(var n=0;n>10),56320+(1023&e)))}ke.next=function(e){!e&&this.type.keyword&&this.containsEsc&&this.raiseRecoverable(this.start,"Escape sequence in keyword "+this.type.keyword),this.options.onToken&&this.options.onToken(new De(this)),this.lastTokEnd=this.end,this.lastTokStart=this.start,this.lastTokEndLoc=this.endLoc,this.lastTokStartLoc=this.startLoc,this.nextToken()},ke.getToken=function(){return this.next(),new De(this)},"undefined"!=typeof Symbol&&(ke[Symbol.iterator]=function(){var e=this;return{next:function(){var t=e.getToken();return{done:t.type===b.eof,value:t}}}}),ke.curContext=function(){return this.context[this.context.length-1]},ke.nextToken=function(){var e=this.curContext();return e&&e.preserveSpace||this.skipSpace(),this.start=this.pos,this.options.locations&&(this.startLoc=this.curPosition()),this.pos>=this.input.length?this.finishToken(b.eof):e.override?e.override(this):void this.readToken(this.fullCharCodeAtPos())},ke.readToken=function(e){return p(e,this.options.ecmaVersion>=6)||92===e?this.readWord():this.getTokenFromCode(e)},ke.fullCharCodeAtPos=function(){var e=this.input.charCodeAt(this.pos);return e<=55295||e>=57344?e:(e<<10)+this.input.charCodeAt(this.pos+1)-56613888},ke.skipBlockComment=function(){var e,t=this.options.onComment&&this.curPosition(),r=this.pos,n=this.input.indexOf("*/",this.pos+=2);if(-1===n&&this.raise(this.pos-2,"Unterminated comment"),this.pos=n+2,this.options.locations)for(v.lastIndex=r;(e=v.exec(this.input))&&e.index8&&e<14||e>=5760&&A.test(String.fromCharCode(e))))break e;++this.pos}}},ke.finishToken=function(e,t){this.end=this.pos,this.options.locations&&(this.endLoc=this.curPosition());var r=this.type;this.type=e,this.value=t,this.updateContext(r)},ke.readToken_dot=function(){var e=this.input.charCodeAt(this.pos+1);if(e>=48&&e<=57)return this.readNumber(!0);var t=this.input.charCodeAt(this.pos+2);return this.options.ecmaVersion>=6&&46===e&&46===t?(this.pos+=3,this.finishToken(b.ellipsis)):(++this.pos,this.finishToken(b.dot))},ke.readToken_slash=function(){var e=this.input.charCodeAt(this.pos+1);return this.exprAllowed?(++this.pos,this.readRegexp()):61===e?this.finishOp(b.assign,2):this.finishOp(b.slash,1)},ke.readToken_mult_modulo_exp=function(e){var t=this.input.charCodeAt(this.pos+1),r=1,n=42===e?b.star:b.modulo;return this.options.ecmaVersion>=7&&42===e&&42===t&&(++r,n=b.starstar,t=this.input.charCodeAt(this.pos+2)),61===t?this.finishOp(b.assign,r+1):this.finishOp(n,r)},ke.readToken_pipe_amp=function(e){var t=this.input.charCodeAt(this.pos+1);if(t===e){if(this.options.ecmaVersion>=12)if(61===this.input.charCodeAt(this.pos+2))return this.finishOp(b.assign,3);return this.finishOp(124===e?b.logicalOR:b.logicalAND,2)}return 61===t?this.finishOp(b.assign,2):this.finishOp(124===e?b.bitwiseOR:b.bitwiseAND,1)},ke.readToken_caret=function(){return 61===this.input.charCodeAt(this.pos+1)?this.finishOp(b.assign,2):this.finishOp(b.bitwiseXOR,1)},ke.readToken_plus_min=function(e){var t=this.input.charCodeAt(this.pos+1);return t===e?45!==t||this.inModule||62!==this.input.charCodeAt(this.pos+2)||0!==this.lastTokEnd&&!T.test(this.input.slice(this.lastTokEnd,this.pos))?this.finishOp(b.incDec,2):(this.skipLineComment(3),this.skipSpace(),this.nextToken()):61===t?this.finishOp(b.assign,2):this.finishOp(b.plusMin,1)},ke.readToken_lt_gt=function(e){var t=this.input.charCodeAt(this.pos+1),r=1;return t===e?(r=62===e&&62===this.input.charCodeAt(this.pos+2)?3:2,61===this.input.charCodeAt(this.pos+r)?this.finishOp(b.assign,r+1):this.finishOp(b.bitShift,r)):33!==t||60!==e||this.inModule||45!==this.input.charCodeAt(this.pos+2)||45!==this.input.charCodeAt(this.pos+3)?(61===t&&(r=2),this.finishOp(b.relational,r)):(this.skipLineComment(4),this.skipSpace(),this.nextToken())},ke.readToken_eq_excl=function(e){var t=this.input.charCodeAt(this.pos+1);return 61===t?this.finishOp(b.equality,61===this.input.charCodeAt(this.pos+2)?3:2):61===e&&62===t&&this.options.ecmaVersion>=6?(this.pos+=2,this.finishToken(b.arrow)):this.finishOp(61===e?b.eq:b.prefix,1)},ke.readToken_question=function(){var e=this.options.ecmaVersion;if(e>=11){var t=this.input.charCodeAt(this.pos+1);if(46===t){var r=this.input.charCodeAt(this.pos+2);if(r<48||r>57)return this.finishOp(b.questionDot,2)}if(63===t){if(e>=12)if(61===this.input.charCodeAt(this.pos+2))return this.finishOp(b.assign,3);return this.finishOp(b.coalesce,2)}}return this.finishOp(b.question,1)},ke.getTokenFromCode=function(e){switch(e){case 46:return this.readToken_dot();case 40:return++this.pos,this.finishToken(b.parenL);case 41:return++this.pos,this.finishToken(b.parenR);case 59:return++this.pos,this.finishToken(b.semi);case 44:return++this.pos,this.finishToken(b.comma);case 91:return++this.pos,this.finishToken(b.bracketL);case 93:return++this.pos,this.finishToken(b.bracketR);case 123:return++this.pos,this.finishToken(b.braceL);case 125:return++this.pos,this.finishToken(b.braceR);case 58:return++this.pos,this.finishToken(b.colon);case 96:if(this.options.ecmaVersion<6)break;return++this.pos,this.finishToken(b.backQuote);case 48:var t=this.input.charCodeAt(this.pos+1);if(120===t||88===t)return this.readRadixNumber(16);if(this.options.ecmaVersion>=6){if(111===t||79===t)return this.readRadixNumber(8);if(98===t||66===t)return this.readRadixNumber(2)}case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57:return this.readNumber(!1);case 34:case 39:return this.readString(e);case 47:return this.readToken_slash();case 37:case 42:return this.readToken_mult_modulo_exp(e);case 124:case 38:return this.readToken_pipe_amp(e);case 94:return this.readToken_caret();case 43:case 45:return this.readToken_plus_min(e);case 60:case 62:return this.readToken_lt_gt(e);case 61:case 33:return this.readToken_eq_excl(e);case 63:return this.readToken_question();case 126:return this.finishOp(b.prefix,1)}this.raise(this.pos,"Unexpected character '"+Ne(e)+"'")},ke.finishOp=function(e,t){var r=this.input.slice(this.pos,this.pos+t);return this.pos+=t,this.finishToken(e,r)},ke.readRegexp=function(){for(var e,t,r=this.pos;;){this.pos>=this.input.length&&this.raise(r,"Unterminated regular expression");var n=this.input.charAt(this.pos);if(T.test(n)&&this.raise(r,"Unterminated regular expression"),e)e=!1;else{if("["===n)t=!0;else if("]"===n&&t)t=!1;else if("/"===n&&!t)break;e="\\"===n}++this.pos}var i=this.input.slice(r,this.pos);++this.pos;var s=this.pos,a=this.readWord1();this.containsEsc&&this.unexpected(s);var o=this.regexpState||(this.regexpState=new be(this));o.reset(r,i,a),this.validateRegExpFlags(o),this.validateRegExpPattern(o);var u=null;try{u=new RegExp(i,a)}catch(e){}return this.finishToken(b.regexp,{pattern:i,flags:a,value:u})},ke.readInt=function(e,t,r){for(var n=this.options.ecmaVersion>=12&&void 0===t,i=r&&48===this.input.charCodeAt(this.pos),s=this.pos,a=0,o=0,u=0,l=null==t?1/0:t;u=97?c-97+10:c>=65?c-65+10:c>=48&&c<=57?c-48:1/0)>=e)break;o=c,a=a*e+h}}return n&&95===o&&this.raiseRecoverable(this.pos-1,"Numeric separator is not allowed at the last of digits"),this.pos===s||null!=t&&this.pos-s!==t?null:a},ke.readRadixNumber=function(e){var t=this.pos;this.pos+=2;var r=this.readInt(e);return null==r&&this.raise(this.start+2,"Expected number in radix "+e),this.options.ecmaVersion>=11&&110===this.input.charCodeAt(this.pos)?(r=Ce(this.input.slice(t,this.pos)),++this.pos):p(this.fullCharCodeAtPos())&&this.raise(this.pos,"Identifier directly after number"),this.finishToken(b.num,r)},ke.readNumber=function(e){var t=this.pos;e||null!==this.readInt(10,void 0,!0)||this.raise(t,"Invalid number");var r=this.pos-t>=2&&48===this.input.charCodeAt(t);r&&this.strict&&this.raise(t,"Invalid number");var n=this.input.charCodeAt(this.pos);if(!r&&!e&&this.options.ecmaVersion>=11&&110===n){var i=Ce(this.input.slice(t,this.pos));return++this.pos,p(this.fullCharCodeAtPos())&&this.raise(this.pos,"Identifier directly after number"),this.finishToken(b.num,i)}r&&/[89]/.test(this.input.slice(t,this.pos))&&(r=!1),46!==n||r||(++this.pos,this.readInt(10),n=this.input.charCodeAt(this.pos)),69!==n&&101!==n||r||(43!==(n=this.input.charCodeAt(++this.pos))&&45!==n||++this.pos,null===this.readInt(10)&&this.raise(t,"Invalid number")),p(this.fullCharCodeAtPos())&&this.raise(this.pos,"Identifier directly after number");var s,a=(s=this.input.slice(t,this.pos),r?parseInt(s,8):parseFloat(s.replace(/_/g,"")));return this.finishToken(b.num,a)},ke.readCodePoint=function(){var e;if(123===this.input.charCodeAt(this.pos)){this.options.ecmaVersion<6&&this.unexpected();var t=++this.pos;e=this.readHexChar(this.input.indexOf("}",this.pos)-this.pos),++this.pos,e>1114111&&this.invalidStringToken(t,"Code point out of bounds")}else e=this.readHexChar(4);return e},ke.readString=function(e){for(var t="",r=++this.pos;;){this.pos>=this.input.length&&this.raise(this.start,"Unterminated string constant");var n=this.input.charCodeAt(this.pos);if(n===e)break;92===n?(t+=this.input.slice(r,this.pos),t+=this.readEscapedChar(!1),r=this.pos):(E(n,this.options.ecmaVersion>=10)&&this.raise(this.start,"Unterminated string constant"),++this.pos)}return t+=this.input.slice(r,this.pos++),this.finishToken(b.string,t)};var Oe={};ke.tryReadTemplateToken=function(){this.inTemplateElement=!0;try{this.readTmplToken()}catch(e){if(e!==Oe)throw e;this.readInvalidTemplateToken()}this.inTemplateElement=!1},ke.invalidStringToken=function(e,t){if(this.inTemplateElement&&this.options.ecmaVersion>=9)throw Oe;this.raise(e,t)},ke.readTmplToken=function(){for(var e="",t=this.pos;;){this.pos>=this.input.length&&this.raise(this.start,"Unterminated template");var r=this.input.charCodeAt(this.pos);if(96===r||36===r&&123===this.input.charCodeAt(this.pos+1))return this.pos!==this.start||this.type!==b.template&&this.type!==b.invalidTemplate?(e+=this.input.slice(t,this.pos),this.finishToken(b.template,e)):36===r?(this.pos+=2,this.finishToken(b.dollarBraceL)):(++this.pos,this.finishToken(b.backQuote));if(92===r)e+=this.input.slice(t,this.pos),e+=this.readEscapedChar(!0),t=this.pos;else if(E(r)){switch(e+=this.input.slice(t,this.pos),++this.pos,r){case 13:10===this.input.charCodeAt(this.pos)&&++this.pos;case 10:e+="\n";break;default:e+=String.fromCharCode(r)}this.options.locations&&(++this.curLine,this.lineStart=this.pos),t=this.pos}else++this.pos}},ke.readInvalidTemplateToken=function(){for(;this.pos=48&&t<=55){var n=this.input.substr(this.pos-1,3).match(/^[0-7]+/)[0],i=parseInt(n,8);return i>255&&(n=n.slice(0,-1),i=parseInt(n,8)),this.pos+=n.length-1,t=this.input.charCodeAt(this.pos),"0"===n&&56!==t&&57!==t||!this.strict&&!e||this.invalidStringToken(this.pos-1-n.length,e?"Octal literal in template string":"Octal literal in strict mode"),String.fromCharCode(i)}return E(t)?"":String.fromCharCode(t)}},ke.readHexChar=function(e){var t=this.pos,r=this.readInt(16,e);return null===r&&this.invalidStringToken(t,"Bad character escape sequence"),r},ke.readWord1=function(){this.containsEsc=!1;for(var e="",t=!0,r=this.pos,n=this.options.ecmaVersion>=6;this.pos0?n-4:n,h=0;h>16&255,o[u++]=t>>8&255,o[u++]=255&t;2===a&&(t=i[e.charCodeAt(h)]<<2|i[e.charCodeAt(h+1)]>>4,o[u++]=255&t);1===a&&(t=i[e.charCodeAt(h)]<<10|i[e.charCodeAt(h+1)]<<4|i[e.charCodeAt(h+2)]>>2,o[u++]=t>>8&255,o[u++]=255&t);return o},r.fromByteArray=function(e){for(var t,r=e.length,i=r%3,s=[],a=0,o=r-i;ao?o:a+16383));1===i?(t=e[r-1],s.push(n[t>>2]+n[t<<4&63]+"==")):2===i&&(t=(e[r-2]<<8)+e[r-1],s.push(n[t>>10]+n[t>>4&63]+n[t<<2&63]+"="));return s.join("")};for(var n=[],i=[],s="undefined"!=typeof Uint8Array?Uint8Array:Array,a="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",o=0,u=a.length;o0)throw new Error("Invalid string. Length must be a multiple of 4");var r=e.indexOf("=");return-1===r&&(r=t),[r,r===t?0:4-r%4]}function c(e,t,r){for(var i,s,a=[],o=t;o>18&63]+n[s>>12&63]+n[s>>6&63]+n[63&s]);return a.join("")}i["-".charCodeAt(0)]=62,i["_".charCodeAt(0)]=63},{}],13:[function(e,t,r){(function(n,i){var s=e("fs"),a=e("path"),o=e("file-uri-to-path"),u=a.join,l=a.dirname,c=s.accessSync&&function(e){try{s.accessSync(e)}catch(e){return!1}return!0}||s.existsSync||a.existsSync,h={arrow:n.env.NODE_BINDINGS_ARROW||" → ",compiled:n.env.NODE_BINDINGS_COMPILED_DIR||"compiled",platform:n.platform,arch:n.arch,nodePreGyp:"node-v"+n.versions.modules+"-"+n.platform+"-"+n.arch,version:n.versions.node,bindings:"bindings.node",try:[["module_root","build","bindings"],["module_root","build","Debug","bindings"],["module_root","build","Release","bindings"],["module_root","out","Debug","bindings"],["module_root","Debug","bindings"],["module_root","out","Release","bindings"],["module_root","Release","bindings"],["module_root","build","default","bindings"],["module_root","compiled","version","platform","arch","bindings"],["module_root","addon-build","release","install-root","bindings"],["module_root","addon-build","debug","install-root","bindings"],["module_root","addon-build","default","install-root","bindings"],["module_root","lib","binding","nodePreGyp","bindings"]]};t.exports=r=function(t){"string"==typeof t?t={bindings:t}:t||(t={}),Object.keys(h).map(function(e){e in t||(t[e]=h[e])}),t.module_root||(t.module_root=r.getRoot(r.getFileName())),".node"!=a.extname(t.bindings)&&(t.bindings+=".node");for(var n,i,s,o="function"==typeof __webpack_require__?__non_webpack_require__:e,l=[],c=0,p=t.try.length;c0)-(e<0)},r.abs=function(e){var t=e>>31;return(e^t)-t},r.min=function(e,t){return t^(e^t)&-(e65535)<<4,t|=r=((e>>>=t)>255)<<3,t|=r=((e>>>=r)>15)<<2,(t|=r=((e>>>=r)>3)<<1)|(e>>>=r)>>1},r.log10=function(e){return e>=1e9?9:e>=1e8?8:e>=1e7?7:e>=1e6?6:e>=1e5?5:e>=1e4?4:e>=1e3?3:e>=100?2:e>=10?1:0},r.popCount=function(e){return 16843009*((e=(858993459&(e-=e>>>1&1431655765))+(e>>>2&858993459))+(e>>>4)&252645135)>>>24},r.countTrailingZeros=n,r.nextPow2=function(e){return e+=0===e,--e,e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,(e|=e>>>16)+1},r.prevPow2=function(e){return e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,(e|=e>>>16)-(e>>>1)},r.parity=function(e){return e^=e>>>16,e^=e>>>8,e^=e>>>4,27030>>>(e&=15)&1};var i=new Array(256);!function(e){for(var t=0;t<256;++t){var r=t,n=t,i=7;for(r>>>=1;r;r>>>=1)n<<=1,n|=1&r,--i;e[t]=n<>>8&255]<<16|i[e>>>16&255]<<8|i[e>>>24&255]},r.interleave2=function(e,t){return(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e&=65535)|e<<8))|e<<4))|e<<2))|e<<1))|(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t&=65535)|t<<8))|t<<4))|t<<2))|t<<1))<<1},r.deinterleave2=function(e,t){return(e=65535&((e=16711935&((e=252645135&((e=858993459&((e=e>>>t&1431655765)|e>>>1))|e>>>2))|e>>>4))|e>>>16))<<16>>16},r.interleave3=function(e,t,r){return e=1227133513&((e=3272356035&((e=251719695&((e=4278190335&((e&=1023)|e<<16))|e<<8))|e<<4))|e<<2),(e|=(t=1227133513&((t=3272356035&((t=251719695&((t=4278190335&((t&=1023)|t<<16))|t<<8))|t<<4))|t<<2))<<1)|(r=1227133513&((r=3272356035&((r=251719695&((r=4278190335&((r&=1023)|r<<16))|r<<8))|r<<4))|r<<2))<<2},r.deinterleave3=function(e,t){return(e=1023&((e=4278190335&((e=251719695&((e=3272356035&((e=e>>>t&1227133513)|e>>>2))|e>>>4))|e>>>8))|e>>>16))<<22>>22},r.nextCombination=function(e){var t=e|e-1;return t+1|(~t&-~t)-1>>>n(e)+1}},{}],15:[function(e,t,r){var n=e("path").sep||"/";t.exports=function(e){if("string"!=typeof e||e.length<=7||"file://"!=e.substring(0,7))throw new TypeError("must pass in a file:// URI to convert to a file path");var t=decodeURI(e.substring(7)),r=t.indexOf("/"),i=t.substring(0,r),s=t.substring(r+1);"localhost"==i&&(i="");i&&(i=n+n+i);s=s.replace(/^(.+)\|/,"$1:"),"\\"==n&&(s=s.replace(/\//g,"\\"));/^.+\:/.test(s)||(s=n+s);return i+s}},{path:169}],16:[function(e,t,r){function n(e,t={}){const{contextName:r="gl",throwGetError:n,useTrackablePrimitives:o,readPixelsFile:u,recording:l=[],variables:c={},onReadPixels:h,onUnrecognizedArgumentLookup:p}=t,f=new Proxy(e,{get:function(t,f){switch(f){case"addComment":return S;case"checkThrowError":return w;case"getReadPixelsVariableName":return m;case"insertVariable":return T;case"reset":return b;case"setIndent":return E;case"toString":return y;case"getContextVariableName":return L}if("function"==typeof e[f])return function(){switch(f){case"getError":return n?l.push(`${x}if (${r}.getError() !== ${r}.NONE) throw new Error('error');`):l.push(`${x}${r}.getError();`),e.getError();case"getExtension":{const t=`${r}Variables${d.length}`;l.push(`${x}const ${t} = ${r}.getExtension('${arguments[0]}');`);const n=e.getExtension(arguments[0]);if(n&&"object"==typeof n){const e=i(n,{getEntity:v,useTrackablePrimitives:o,recording:l,contextName:t,contextVariables:d,variables:c,indent:x,onUnrecognizedArgumentLookup:p});return d.push(e),e}return d.push(null),n}case"readPixels":const t=d.indexOf(arguments[6]);let a;if(-1===t){const e=function(e){if(c)for(const t in c)if(c[t]===e)return t;return null}(arguments[6]);e?(a=e,l.push(`${x}${e}`)):(a=`${r}Variable${d.length}`,d.push(arguments[6]),l.push(`${x}const ${a} = new ${arguments[6].constructor.name}(${arguments[6].length});`))}else a=`${r}Variable${t}`;m=a;const g=[arguments[0],arguments[1],arguments[2],arguments[3],v(arguments[4]),v(arguments[5]),a];return l.push(`${x}${r}.readPixels(${g.join(", ")});`),u&&function(e,t){const n=`${r}Variable${d.length}`,i=`imageDatum${_}`;l.push(`${x}let ${i} = ["P3\\n# ${u}.ppm\\n", ${e}, ' ', ${t}, "\\n255\\n"].join("");`),l.push(`${x}for (let i = 0; i < ${i}.length; i += 4) {`),l.push(`${x} ${i} += ${n}[i] + ' ' + ${n}[i + 1] + ' ' + ${n}[i + 2] + ' ';`),l.push(`${x}}`),l.push(`${x}if (typeof require !== "undefined") {`),l.push(`${x} require('fs').writeFileSync('./${u}.ppm', ${i});`),l.push(`${x}}`),_++}(arguments[2],arguments[3]),h&&h(a,g),e.readPixels.apply(e,arguments);case"drawBuffers":return l.push(`${x}${r}.drawBuffers([${s(arguments[0],{contextName:r,contextVariables:d,getEntity:v,addVariable:A,variables:c,onUnrecognizedArgumentLookup:p})}]);`),e.drawBuffers(arguments[0])}let t=e[f].apply(e,arguments);switch(typeof t){case"undefined":return void l.push(`${x}${I(f,arguments)};`);case"number":case"boolean":if(o&&-1===d.indexOf(a(t))){l.push(`${x}const ${r}Variable${d.length} = ${I(f,arguments)};`),d.push(t=a(t));break}default:null===t?l.push(`${I(f,arguments)};`):l.push(`${x}const ${r}Variable${d.length} = ${I(f,arguments)};`),d.push(t)}return t};return g[e[f]]=f,e[f]}}),d=[],g={};let m,_=0,x="";return f;function y(){return l.join("\n")}function b(){for(;l.length>0;)l.pop()}function T(e,t){c[e]=t}function v(e){const t=g[e];return t?r+"."+t:e}function E(e){x=" ".repeat(e)}function A(e,t){const n=`${r}Variable${d.length}`;return l.push(`${x}const ${n} = ${t};`),d.push(e),n}function S(e){l.push(`${x}// ${e}`)}function w(){l.push(`${x}(() => {\n${x}const error = ${r}.getError();\n${x}if (error !== ${r}.NONE) {\n${x} const names = Object.getOwnPropertyNames(gl);\n${x} for (let i = 0; i < names.length; i++) {\n${x} const name = names[i];\n${x} if (${r}[name] === error) {\n${x} throw new Error('${r} threw ' + name);\n${x} }\n${x} }\n${x}}\n${x}})();`)}function I(e,t){return`${r}.${e}(${s(t,{contextName:r,contextVariables:d,getEntity:v,addVariable:A,variables:c,onUnrecognizedArgumentLookup:p})})`}function L(e){const t=d.indexOf(e);return-1!==t?`${r}Variable${t}`:null}}function i(e,t){const r=new Proxy(e,{get:function(t,r){if("function"==typeof t[r])return function(){switch(r){case"drawBuffersWEBGL":return c.push(`${p}${i}.drawBuffersWEBGL([${s(arguments[0],{contextName:i,contextVariables:o,getEntity:d,addVariable:m,variables:h,onUnrecognizedArgumentLookup:f})}]);`),e.drawBuffersWEBGL(arguments[0])}let t=e[r].apply(e,arguments);switch(typeof t){case"undefined":return void c.push(`${p}${g(r,arguments)};`);case"number":case"boolean":l&&-1===o.indexOf(a(t))?(c.push(`${p}const ${i}Variable${o.length} = ${g(r,arguments)};`),o.push(t=a(t))):(c.push(`${p}const ${i}Variable${o.length} = ${g(r,arguments)};`),o.push(t));break;default:null===t?c.push(`${g(r,arguments)};`):c.push(`${p}const ${i}Variable${o.length} = ${g(r,arguments)};`),o.push(t)}return t};return n[e[r]]=r,e[r]}}),n={},{contextName:i,contextVariables:o,getEntity:u,useTrackablePrimitives:l,recording:c,variables:h,indent:p,onUnrecognizedArgumentLookup:f}=t;return r;function d(e){return n.hasOwnProperty(e)?`${i}.${n[e]}`:u(e)}function g(e,t){return`${i}.${e}(${s(t,{contextName:i,contextVariables:o,getEntity:d,addVariable:m,variables:h,onUnrecognizedArgumentLookup:f})})`}function m(e,t){const r=`${i}Variable${o.length}`;return o.push(e),c.push(`${p}const ${r} = ${t};`),r}}function s(e,t){const{variables:r,onUnrecognizedArgumentLookup:n}=t;return Array.from(e).map(e=>{const i=function(e){if(r)for(const t in r)if(r.hasOwnProperty(t)&&r[t]===e)return t;if(n)return n(e);return null}(e);return i||function(e,t){const{contextName:r,contextVariables:n,getEntity:i,addVariable:s,onUnrecognizedArgumentLookup:a}=t;if(void 0===e)return"undefined";if(null===e)return"null";const o=n.indexOf(e);if(o>-1)return`${r}Variable${o}`;switch(e.constructor.name){case"String":const t=/\n/.test(e),r=/'/.test(e),n=/"/.test(e);return t?"`"+e+"`":r&&!n?'"'+e+'"':"'"+e+"'";case"Number":case"Boolean":return i(e);case"Array":return s(e,`new ${e.constructor.name}([${Array.from(e).join(",")}])`);case"Float32Array":case"Uint8Array":case"Uint16Array":case"Int32Array":return s(e,`new ${e.constructor.name}(${JSON.stringify(Array.from(e))})`);default:if(a){const t=a(e);if(t)return t}throw new Error(`unrecognized argument type ${e.constructor.name}`)}}(e,t)}).join(", ")}function a(e){return new e.constructor(e)}void 0!==t&&(t.exports={glWiretap:n,glExtensionWiretap:i}),"undefined"!=typeof window&&(n.glExtensionWiretap=i,window.glWiretap=n)},{}],17:[function(e,t,r){"undefined"!=typeof WebGLRenderingContext?t.exports=e("./src/javascript/browser-index"):t.exports=e("./src/javascript/node-index")},{"./src/javascript/browser-index":19,"./src/javascript/node-index":33}],18:[function(e,t,r){t.exports={name:"gl",version:"4.9.0",description:"Creates a WebGL context without a window",main:"index.js",directories:{test:"test"},browser:"browser_index.js",engines:{node:">=8.0.0"},scripts:{test:"standard | snazzy && tape test/*.js | faucet",rebuild:"node-gyp rebuild --verbose",prebuild:"prebuild --all --strip",install:"prebuild-install || node-gyp rebuild"},dependencies:{bindings:"^1.5.0","bit-twiddle":"^1.0.2","glsl-tokenizer":"^2.0.2",nan:"^2.14.1","node-abi":"^2.18.0","node-gyp":"^7.1.0","prebuild-install":"^5.3.5"},devDependencies:{"angle-normals":"^1.0.0",bunny:"^1.0.1",faucet:"0.0.1","gl-conformance":"^2.0.9",prebuild:"^10.0.1",snazzy:"^8.0.0",standard:"^14.3.4",tape:"^5.0.1"},repository:{type:"git",url:"git://github.com/stackgl/headless-gl.git"},keywords:["webgl","opengl","gl","headless","server","gpgpu"],author:"Mikola Lysenko",license:"BSD-2-Clause",gypfile:!0}},{}],19:[function(e,t,r){t.exports=function(e,t,r){if(t|=0,!((e|=0)>0&&t>0))return null;const n=document.createElement("canvas");if(!n)return null;let i;n.width=e,n.height=t;try{i=n.getContext("webgl",r)}catch(e){try{i=n.getContext("experimental-webgl",r)}catch(e){return null}}const s=i.getExtension,a={destroy:function(){const e=s.call(i,"WEBGL_lose_context");e&&e.loseContext()}},o={resize:function(e,t){n.width=e,n.height=t}},u=i.getSupportedExtensions().slice();return u.push("STACKGL_destroy_context","STACKGL_resize_drawingbuffer"),i.getSupportedExtensions=function(){return u.slice()},i.getExtension=function(e){const t=e.toLowerCase();return"stackgl_resize_drawingbuffer"===t?o:"stackgl_destroy_context"===t?a:s.call(i,e)},i||null}},{}],20:[function(e,t,r){const{gl:n}=e("../native-gl"),{vertexCount:i}=e("../utils");class s{constructor(e){this.VERTEX_ATTRIB_ARRAY_DIVISOR_ANGLE=35070,this.ctx=e,this._drawArraysInstanced=n._drawArraysInstanced.bind(e),this._drawElementsInstanced=n._drawElementsInstanced.bind(e),this._vertexAttribDivisor=n._vertexAttribDivisor.bind(e)}drawArraysInstancedANGLE(e,t,r,s){const{ctx:a}=this;if(e|=0,r|=0,s|=0,(t|=0)<0||r<0||s<0)return void a.setError(n.INVALID_VALUE);if(!a._checkStencilState())return;const o=i(e,r);if(o<0)return void a.setError(n.INVALID_ENUM);if(!a._framebufferOk())return;if(0===r||0===s)return;let u=t;return r>0&&(u=r+t-1>>>0),this.checkInstancedVertexAttribState(u,s)?this._drawArraysInstanced(e,t,o,s):void 0}drawElementsInstancedANGLE(e,t,r,i,s){const{ctx:a}=this;if(e|=0,r|=0,i|=0,s|=0,(t|=0)<0||i<0||s<0)return void a.setError(n.INVALID_VALUE);if(!a._checkStencilState())return;const o=a._vertexObjectState._elementArrayBufferBinding;if(!o)return void a.setError(n.INVALID_OPERATION);let u=null,l=i;if(r===n.UNSIGNED_SHORT){if(l%2)return void a.setError(n.INVALID_OPERATION);l>>=1,u=new Uint16Array(o._elements.buffer)}else if(a._extensions.oes_element_index_uint&&r===n.UNSIGNED_INT){if(l%4)return void a.setError(n.INVALID_OPERATION);l>>=2,u=new Uint32Array(o._elements.buffer)}else{if(r!==n.UNSIGNED_BYTE)return void a.setError(n.INVALID_ENUM);u=o._elements}let c=t;switch(e){case n.TRIANGLES:t%3&&(c-=t%3);break;case n.LINES:t%2&&(c-=t%2);break;case n.POINTS:break;case n.LINE_LOOP:case n.LINE_STRIP:if(t<2)return void a.setError(n.INVALID_OPERATION);break;case n.TRIANGLE_FAN:case n.TRIANGLE_STRIP:if(t<3)return void a.setError(n.INVALID_OPERATION);break;default:return void a.setError(n.INVALID_ENUM)}if(!a._framebufferOk())return;if(0===t||0===s)return void this.checkInstancedVertexAttribState(0,0);if(t+l>>>0>u.length)return void a.setError(n.INVALID_OPERATION);let h=-1;for(let e=l;e0&&this._drawElementsInstanced(e,c,r,i,s)}vertexAttribDivisorANGLE(e,t){const{ctx:r}=this;e|=0,(t|=0)<0||e<0||e>=r._vertexObjectState._attribs.length?r.setError(n.INVALID_VALUE):(r._vertexObjectState._attribs[e]._divisor=t,this._vertexAttribDivisor(e,t))}checkInstancedVertexAttribState(e,t){const{ctx:r}=this,i=r._activeProgram;if(!i)return r.setError(n.INVALID_OPERATION),!1;const s=r._vertexObjectState._attribs;let a=!1;for(let o=0;o=0){if(!s)return r.setError(n.INVALID_OPERATION),!1;let i=0;if(0===u._divisor?(a=!0,i=u._pointerStride*e+u._pointerSize+u._pointerOffset):i=u._pointerStride*(Math.ceil(t/u._divisor)-1)+u._pointerSize+u._pointerOffset,i>s._size)return r.setError(n.INVALID_OPERATION),!1}}}return!!a||(r.setError(n.INVALID_OPERATION),!1)}}t.exports={ANGLEInstancedArrays:s,getANGLEInstancedArrays:function(e){return new s(e)}}},{"../native-gl":32,"../utils":34}],21:[function(e,t,r){class n{constructor(){this.MIN_EXT=32775,this.MAX_EXT=32776}}t.exports={getEXTBlendMinMax:function(e){let t=null;const r=e.getSupportedExtensions();return r&&r.indexOf("EXT_blend_minmax")>=0&&(t=new n),t},EXTBlendMinMax:n}},{}],22:[function(e,t,r){class n{constructor(){this.TEXTURE_MAX_ANISOTROPY_EXT=34046,this.MAX_TEXTURE_MAX_ANISOTROPY_EXT=34047}}t.exports={getEXTTextureFilterAnisotropic:function(e){let t=null;const r=e.getSupportedExtensions();return r&&r.indexOf("EXT_texture_filter_anisotropic")>=0&&(t=new n),t},EXTTextureFilterAnisotropic:n}},{}],23:[function(e,t,r){class n{}t.exports={getOESElementIndexUint:function(e){let t=null;const r=e.getSupportedExtensions();return r&&r.indexOf("OES_element_index_uint")>=0&&(t=new n),t},OESElementIndexUint:n}},{}],24:[function(e,t,r){class n{constructor(){this.FRAGMENT_SHADER_DERIVATIVE_HINT_OES=35723}}t.exports={getOESStandardDerivatives:function(e){let t=null;const r=e.getSupportedExtensions();return r&&r.indexOf("OES_standard_derivatives")>=0&&(t=new n),t},OESStandardDerivatives:n}},{}],25:[function(e,t,r){class n{}t.exports={getOESTextureFloatLinear:function(e){let t=null;const r=e.getSupportedExtensions();return r&&r.indexOf("OES_texture_float_linear")>=0&&(t=new n),t},OESTextureFloatLinear:n}},{}],26:[function(e,t,r){class n{}t.exports={getOESTextureFloat:function(e){let t=null;const r=e.getSupportedExtensions();return r&&r.indexOf("OES_texture_float")>=0&&(t=new n),t},OESTextureFloat:n}},{}],27:[function(e,t,r){const{Linkable:n}=e("../linkable"),{gl:i}=e("../native-gl"),{checkObject:s}=e("../utils"),{WebGLVertexArrayObjectState:a}=e("../webgl-vertex-attribute");class o extends n{constructor(e,t,r){super(e),this._ctx=t,this._ext=r,this._vertexState=new a(t)}_performDelete(){this._vertexState.cleanUp(),delete this._vertexState,delete this._ext._vaos[this._],i.deleteVertexArrayOES.call(this._ctx,0|this._)}}class u{constructor(e){this.VERTEX_ARRAY_BINDING_OES=34229,this._ctx=e,this._vaos={},this._activeVertexArrayObject=null}createVertexArrayOES(){const{_ctx:e}=this,t=i.createVertexArrayOES.call(e);if(t<=0)return null;const r=new o(t,e,this);return this._vaos[t]=r,r}deleteVertexArrayOES(e){const{_ctx:t}=this;if(!s(e))throw new TypeError("deleteVertexArrayOES(WebGLVertexArrayObjectOES)");e instanceof o&&t._checkOwns(e)?e._pendingDelete||(this._activeVertexArrayObject===e&&this.bindVertexArrayOES(null),e._pendingDelete=!0,e._checkDelete()):t.setError(i.INVALID_OPERATION)}bindVertexArrayOES(e){const{_ctx:t,_activeVertexArrayObject:r}=this;if(!s(e))throw new TypeError("bindVertexArrayOES(WebGLVertexArrayObjectOES)");if(e){if(e instanceof o&&e._pendingDelete)return void t.setError(i.INVALID_OPERATION);if(!t._checkWrapper(e,o))return;i.bindVertexArrayOES.call(t,e._)}else e=null,i.bindVertexArrayOES.call(t,null);r!==e&&(r&&(r._refCount-=1,r._checkDelete()),e&&(e._refCount+=1)),t._vertexObjectState=null===e?t._defaultVertexObjectState:e._vertexState,this._activeVertexArrayObject=e}isVertexArrayOES(e){const{_ctx:t}=this;return!!t._isObject(e,"isVertexArrayOES",o)&&i.isVertexArrayOES.call(t,0|e._)}}t.exports={WebGLVertexArrayObjectOES:o,OESVertexArrayObject:u,getOESVertexArrayObject:function(e){const t=e.getSupportedExtensions();return t&&t.indexOf("OES_vertex_array_object")>=0?new u(e):null}}},{"../linkable":31,"../native-gl":32,"../utils":34,"../webgl-vertex-attribute":48}],28:[function(e,t,r){class n{constructor(e){this.destroy=e.destroy.bind(e)}}t.exports={getSTACKGLDestroyContext:function(e){return new n(e)},STACKGLDestroyContext:n}},{}],29:[function(e,t,r){class n{constructor(e){this.resize=e.resize.bind(e)}}t.exports={getSTACKGLResizeDrawingBuffer:function(e){return new n(e)},STACKGLResizeDrawingBuffer:n}},{}],30:[function(e,t,r){const{gl:n}=e("../native-gl");class i{constructor(e){this.ctx=e;const t=e.getSupportedExtensions();if(t&&t.indexOf("WEBGL_draw_buffers")>=0){Object.assign(this,e.extWEBGL_draw_buffers()),this._buffersState=[e.BACK],this._maxDrawBuffers=e._getParameterDirect(this.MAX_DRAW_BUFFERS_WEBGL),this._ALL_ATTACHMENTS=[],this._ALL_COLOR_ATTACHMENTS=[];const t=[this.COLOR_ATTACHMENT0_WEBGL,this.COLOR_ATTACHMENT1_WEBGL,this.COLOR_ATTACHMENT2_WEBGL,this.COLOR_ATTACHMENT3_WEBGL,this.COLOR_ATTACHMENT4_WEBGL,this.COLOR_ATTACHMENT5_WEBGL,this.COLOR_ATTACHMENT6_WEBGL,this.COLOR_ATTACHMENT7_WEBGL,this.COLOR_ATTACHMENT8_WEBGL,this.COLOR_ATTACHMENT9_WEBGL,this.COLOR_ATTACHMENT10_WEBGL,this.COLOR_ATTACHMENT11_WEBGL,this.COLOR_ATTACHMENT12_WEBGL,this.COLOR_ATTACHMENT13_WEBGL,this.COLOR_ATTACHMENT14_WEBGL,this.COLOR_ATTACHMENT15_WEBGL];for(;this._ALL_ATTACHMENTS.length1)return void t.setError(n.INVALID_OPERATION);for(let r=0;rn.NONE)return void t.setError(n.INVALID_OPERATION)}this._buffersState=e,t.drawBuffersWEBGL(e)}}}t.exports={getWebGLDrawBuffers:function(e){const t=e.getSupportedExtensions();return t&&t.indexOf("WEBGL_draw_buffers")>=0?new i(e):null},WebGLDrawBuffers:i}},{"../native-gl":32}],31:[function(e,t,r){t.exports={Linkable:class{constructor(e){this._=e,this._references=[],this._refCount=0,this._pendingDelete=!1,this._binding=0}_link(e){return this._references.push(e),e._refCount+=1,!0}_unlink(e){let t=this._references.indexOf(e);if(t<0)return!1;for(;t>=0;)this._references[t]=this._references[this._references.length-1],this._references.pop(),e._refCount-=1,e._checkDelete(),t=this._references.indexOf(e);return!0}_linked(e){return this._references.indexOf(e)>=0}_checkDelete(){if(this._refCount<=0&&this._pendingDelete&&0!==this._){for(;this._references.length>0;)this._unlink(this._references[0]);this._performDelete(),this._=0}}_performDelete(){}}}},{}],32:[function(e,t,r){(function(r){const n=e("bindings")("webgl"),{WebGLRenderingContext:i}=n;r.on("exit",n.cleanup);const s=i.prototype;delete s["1.0.0"],delete i["1.0.0"],t.exports={gl:s,NativeWebGL:n,NativeWebGLRenderingContext:i}}).call(this,e("_process"))},{_process:170,bindings:13}],33:[function(e,t,r){const n=e("bit-twiddle"),{WebGLContextAttributes:i}=e("./webgl-context-attributes"),{WebGLRenderingContext:s,wrapContext:a}=e("./webgl-rendering-context"),{WebGLTextureUnit:o}=e("./webgl-texture-unit"),{WebGLVertexArrayObjectState:u,WebGLVertexArrayGlobalState:l}=e("./webgl-vertex-attribute");let c=0;function h(e,t,r){return e&&"object"==typeof e&&t in e?!!e[t]:r}t.exports=function(e,t,r){if(t|=0,!((e|=0)>0&&t>0))return null;const p=new i(h(r,"alpha",!0),h(r,"depth",!0),h(r,"stencil",!1),!1,h(r,"premultipliedAlpha",!0),h(r,"preserveDrawingBuffer",!1),h(r,"preferLowPowerToHighPerformance",!1),h(r,"failIfMajorPerformanceCaveat",!1));let f;p.premultipliedAlpha=p.premultipliedAlpha&&p.alpha;try{f=new s(1,1,p.alpha,p.depth,p.stencil,p.antialias,p.premultipliedAlpha,p.preserveDrawingBuffer,p.preferLowPowerToHighPerformance,p.failIfMajorPerformanceCaveat)}catch(e){}if(!f)return null;f.drawingBufferWidth=e,f.drawingBufferHeight=t,f._=c++,f._contextAttributes=p,f._extensions={},f._programs={},f._shaders={},f._buffers={},f._textures={},f._framebuffers={},f._renderbuffers={},f._activeProgram=null,f._activeFramebuffer=null,f._activeRenderbuffer=null,f._checkStencil=!1,f._stencilState=!0;const d=f.getParameter(f.MAX_COMBINED_TEXTURE_IMAGE_UNITS);f._textureUnits=new Array(d);for(let e=0;ethis._maxTextureSize||r>this._maxTextureSize||n>this._maxTextureLevel)return this.setError(a.INVALID_VALUE),!1}else{if(!this._validCubeTarget(e))return this.setError(a.INVALID_ENUM),!1;if(t>this._maxCubeMapSize||r>this._maxCubeMapSize||n>this._maxCubeMapLevel)return this.setError(a.INVALID_VALUE),!1}return!0}_checkLocation(e){return e instanceof z?e._program._ctx===this&&e._linkCount===e._program._linkCount||(this.setError(a.INVALID_OPERATION),!1):(this.setError(a.INVALID_VALUE),!1)}_checkLocationActive(e){return!!e&&(!!this._checkLocation(e)&&(e._program===this._activeProgram||(this.setError(a.INVALID_OPERATION),!1)))}_checkOwns(e){return"object"==typeof e&&e._ctx===this}_checkShaderSource(e){const t=e._source,r=i(t);let n=!1;const s=[];for(let e=0;e=0){let t=0;if((t=i._divisor?i._pointerSize+i._pointerOffset:i._pointerStride*e+i._pointerSize+i._pointerOffset)>r._size)return this.setError(a.INVALID_OPERATION),!1}}}return!0}_checkVertexIndex(e){return!(e<0||e>=this._vertexObjectState._attribs.length)||(this.setError(a.INVALID_VALUE),!1)}_computePixelSize(e,t){const r=E(t);if(0===r)return this.setError(a.INVALID_ENUM),0;switch(e){case a.UNSIGNED_BYTE:return r;case a.UNSIGNED_SHORT_5_6_5:if(t!==a.RGB){this.setError(a.INVALID_OPERATION);break}return 2;case a.UNSIGNED_SHORT_4_4_4_4:case a.UNSIGNED_SHORT_5_5_5_1:if(t!==a.RGBA){this.setError(a.INVALID_OPERATION);break}return 2;case a.FLOAT:return 1}return this.setError(a.INVALID_ENUM),0}_computeRowStride(e,t){let r=e*t;return r%this._unpackAlignment&&(r+=this._unpackAlignment-r%this._unpackAlignment),r}_fixupLink(e){if(!super.getProgramParameter(e._,a.LINK_STATUS))return e._linkInfoLog=super.getProgramInfoLog(e),!1;const t=this.getProgramParameter(e,a.ACTIVE_ATTRIBUTES),r=new Array(t);e._attributes.length=t;for(let n=0;nW)return e._linkInfoLog="attribute "+r[t]+" is too long",!1;for(let n=0;nK)return e._linkInfoLog="uniform "+e._uniforms[t].name+" is too long",!1;return e._linkInfoLog="",!0}_framebufferOk(){const e=this._activeFramebuffer;return!e||this._preCheckFramebufferStatus(e)===a.FRAMEBUFFER_COMPLETE||(this.setError(a.INVALID_FRAMEBUFFER_OPERATION),!1)}_getActiveBuffer(e){return e===a.ARRAY_BUFFER?this._vertexGlobalState._arrayBufferBinding:e===a.ELEMENT_ARRAY_BUFFER?this._vertexObjectState._elementArrayBufferBinding:null}_getActiveTextureUnit(){return this._textureUnits[this._activeTextureUnit]}_getActiveTexture(e){const t=this._getActiveTextureUnit();return e===a.TEXTURE_2D?t._bind2D:e===a.TEXTURE_CUBE_MAP?t._bindCube:null}_getAttachments(){return this._extensions.webgl_draw_buffers?this._extensions.webgl_draw_buffers._ALL_ATTACHMENTS:j}_getColorAttachments(){return this._extensions.webgl_draw_buffers?this._extensions.webgl_draw_buffers._ALL_COLOR_ATTACHMENTS:H}_getParameterDirect(e){return super.getParameter(e)}_getTexImage(e){const t=this._getActiveTextureUnit();return e===a.TEXTURE_2D?t._bind2D:N(e)?t._bindCube:(this.setError(a.INVALID_ENUM),null)}_preCheckFramebufferStatus(e){const t=e._attachments,r=[],n=[],i=t[a.DEPTH_ATTACHMENT],s=t[a.DEPTH_STENCIL_ATTACHMENT],o=t[a.STENCIL_ATTACHMENT];if(s&&(o||i)||o&&i)return a.FRAMEBUFFER_UNSUPPORTED;const u=this._getColorAttachments();let l=0;for(const e in t)t[e]&&-1!==u.indexOf(1*e)&&l++;if(0===l)return a.FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT;if(s instanceof G)return a.FRAMEBUFFER_UNSUPPORTED;if(s instanceof P){if(s._format!==a.DEPTH_STENCIL)return a.FRAMEBUFFER_INCOMPLETE_ATTACHMENT;r.push(s._width),n.push(s._height)}if(i instanceof G)return a.FRAMEBUFFER_UNSUPPORTED;if(i instanceof P){if(i._format!==a.DEPTH_COMPONENT16)return a.FRAMEBUFFER_INCOMPLETE_ATTACHMENT;r.push(i._width),n.push(i._height)}if(o instanceof G)return a.FRAMEBUFFER_UNSUPPORTED;if(o instanceof P){if(o._format!==a.STENCIL_INDEX8)return a.FRAMEBUFFER_INCOMPLETE_ATTACHMENT;r.push(o._width),n.push(o._height)}let c=!1;for(let i=0;i256)}_validTextureTarget(e){return e===a.TEXTURE_2D||e===a.TEXTURE_CUBE_MAP}_verifyTextureCompleteness(e,t,r){const n=this._getActiveTextureUnit();let i=null;if(e===a.TEXTURE_2D?i=n._bind2D:this._validCubeTarget(e)&&(i=n._bindCube),this._extensions.oes_texture_float&&!this._extensions.oes_texture_float_linear&&i&&i._type===a.FLOAT&&(t===a.TEXTURE_MAG_FILTER||t===a.TEXTURE_MIN_FILTER)&&(r===a.LINEAR||r===a.LINEAR_MIPMAP_NEAREST||r===a.NEAREST_MIPMAP_LINEAR||r===a.LINEAR_MIPMAP_LINEAR))return i._complete=!1,void this.bindTexture(e,i);i&&!1===i._complete&&(i._complete=!0,this.bindTexture(e,i))}_wrapShader(e,t){return!this._extensions.oes_standard_derivatives&&/#ifdef\s+GL_OES_standard_derivatives/.test(t)&&(t="#undef GL_OES_standard_derivatives\n"+t),this._extensions.webgl_draw_buffers?t:"#define gl_MaxDrawBuffers 1\n"+t}_beginAttrib0Hack(){super.bindBuffer(a.ARRAY_BUFFER,this._attrib0Buffer._),super.bufferData(a.ARRAY_BUFFER,this._vertexGlobalState._attribs[0]._data,a.STREAM_DRAW),super.enableVertexAttribArray(0),super.vertexAttribPointer(0,4,a.FLOAT,!1,0,0),super._vertexAttribDivisor(0,1)}_endAttrib0Hack(){const e=this._vertexObjectState._attribs[0];e._pointerBuffer?super.bindBuffer(a.ARRAY_BUFFER,e._pointerBuffer._):super.bindBuffer(a.ARRAY_BUFFER,0),super.vertexAttribPointer(0,e._inputSize,e._pointerType,e._pointerNormal,e._inputStride,e._pointerOffset),super._vertexAttribDivisor(0,e._divisor),super.disableVertexAttribArray(0),this._vertexGlobalState._arrayBufferBinding?super.bindBuffer(a.ARRAY_BUFFER,this._vertexGlobalState._arrayBufferBinding._):super.bindBuffer(a.ARRAY_BUFFER,0)}activeTexture(e){const t=(e|=0)-a.TEXTURE0;if(t>=0&&tW)this.setError(a.INVALID_VALUE);else if(/^_?webgl_a/.test(r))this.setError(a.INVALID_OPERATION);else if(this._checkWrapper(e,U))return super.bindAttribLocation(0|e._,0|t,r)}bindFramebuffer(e,t){if(!T(t))throw new TypeError("bindFramebuffer(GLenum, WebGLFramebuffer)");if(e!==a.FRAMEBUFFER)return void this.setError(a.INVALID_ENUM);if(t){if(t._pendingDelete)return;if(!this._checkWrapper(t,F))return;super.bindFramebuffer(a.FRAMEBUFFER,0|t._)}else super.bindFramebuffer(a.FRAMEBUFFER,this._drawingBuffer._framebuffer);const r=this._activeFramebuffer;r!==t&&(r&&(r._refCount-=1,r._checkDelete()),t&&(t._refCount+=1)),this._activeFramebuffer=t,t&&this._updateFramebufferAttachments(t)}bindBuffer(e,t){if(e|=0,!T(t))throw new TypeError("bindBuffer(GLenum, WebGLBuffer)");if(e===a.ARRAY_BUFFER||e===a.ELEMENT_ARRAY_BUFFER){if(t){if(t._pendingDelete)return;if(!this._checkWrapper(t,M))return;if(t._binding&&t._binding!==e)return void this.setError(a.INVALID_OPERATION);t._binding=0|e,super.bindBuffer(e,0|t._)}else t=null,super.bindBuffer(e,0);e===a.ARRAY_BUFFER?this._vertexGlobalState.setArrayBuffer(t):this._vertexObjectState.setElementArrayBuffer(t)}else this.setError(a.INVALID_ENUM)}bindRenderbuffer(e,t){if(!T(t))throw new TypeError("bindRenderbuffer(GLenum, WebGLRenderbuffer)");if(e!==a.RENDERBUFFER)return void this.setError(a.INVALID_ENUM);if(t){if(t._pendingDelete)return;if(!this._checkWrapper(t,P))return;super.bindRenderbuffer(0|e,0|t._)}else super.bindRenderbuffer(0|e,0);const r=this._activeRenderbuffer;r!==t&&(r&&(r._refCount-=1,r._checkDelete()),t&&(t._refCount+=1)),this._activeRenderbuffer=t}bindTexture(e,t){if(e|=0,!T(t))throw new TypeError("bindTexture(GLenum, WebGLTexture)");if(!this._validTextureTarget(e))return void this.setError(a.INVALID_ENUM);let r=0;if(t){if(t instanceof G&&t._pendingDelete)return;if(!this._checkWrapper(t,G))return;if(t._binding&&t._binding!==e)return void this.setError(a.INVALID_OPERATION);t._binding=e,t._complete&&(r=0|t._)}else t=null;this._saveError(),super.bindTexture(e,r);const n=this.getError();if(this._restoreError(n),n!==a.NO_ERROR)return;const i=this._getActiveTextureUnit(),s=this._getActiveTexture(e);s!==t&&(s&&(s._refCount-=1,s._checkDelete()),t&&(t._refCount+=1)),e===a.TEXTURE_2D?i._bind2D=t:e===a.TEXTURE_CUBE_MAP&&(i._bindCube=t)}blendColor(e,t,r,n){return super.blendColor(+e,+t,+r,+n)}blendEquation(e){if(e|=0,this._validBlendMode(e))return super.blendEquation(e);this.setError(a.INVALID_ENUM)}blendEquationSeparate(e,t){if(e|=0,t|=0,this._validBlendMode(e)&&this._validBlendMode(t))return super.blendEquationSeparate(e,t);this.setError(a.INVALID_ENUM)}createBuffer(){const e=super.createBuffer();if(e<=0)return null;const t=new M(e,this);return this._buffers[e]=t,t}createFramebuffer(){const e=super.createFramebuffer();if(e<=0)return null;const t=new F(e,this);return this._framebuffers[e]=t,t}createProgram(){const e=super.createProgram();if(e<=0)return null;const t=new U(e,this);return this._programs[e]=t,t}createRenderbuffer(){const e=super.createRenderbuffer();if(e<=0)return null;const t=new P(e,this);return this._renderbuffers[e]=t,t}createTexture(){const e=super.createTexture();if(e<=0)return null;const t=new G(e,this);return this._textures[e]=t,t}getContextAttributes(){return this._contextAttributes}getExtension(e){const t=e.toLowerCase();if(t in this._extensions)return this._extensions[t];const r=X[t]?X[t](this):null;return r&&(this._extensions[t]=r),r}getSupportedExtensions(){const e=["ANGLE_instanced_arrays","STACKGL_resize_drawingbuffer","STACKGL_destroy_context"],t=super.getSupportedExtensions();return t.indexOf("GL_OES_element_index_uint")>=0&&e.push("OES_element_index_uint"),t.indexOf("GL_OES_standard_derivatives")>=0&&e.push("OES_standard_derivatives"),t.indexOf("GL_OES_texture_float")>=0&&e.push("OES_texture_float"),t.indexOf("GL_OES_texture_float_linear")>=0&&e.push("OES_texture_float_linear"),t.indexOf("EXT_draw_buffers")>=0&&e.push("WEBGL_draw_buffers"),t.indexOf("EXT_blend_minmax")>=0&&e.push("EXT_blend_minmax"),t.indexOf("EXT_texture_filter_anisotropic")>=0&&e.push("EXT_texture_filter_anisotropic"),t.indexOf("GL_OES_vertex_array_object")>=0&&e.push("OES_vertex_array_object"),e}setError(e){u.setError.call(this,0|e)}blendFunc(e,t){e|=0,t|=0,this._validBlendFunc(e)&&this._validBlendFunc(t)?this._isConstantBlendFunc(e)&&this._isConstantBlendFunc(t)?this.setError(a.INVALID_OPERATION):super.blendFunc(e,t):this.setError(a.INVALID_ENUM)}blendFuncSeparate(e,t,r,n){e|=0,t|=0,r|=0,n|=0,this._validBlendFunc(e)&&this._validBlendFunc(t)&&this._validBlendFunc(r)&&this._validBlendFunc(n)?this._isConstantBlendFunc(e)&&this._isConstantBlendFunc(t)||this._isConstantBlendFunc(r)&&this._isConstantBlendFunc(n)?this.setError(a.INVALID_OPERATION):super.blendFuncSeparate(e,t,r,n):this.setError(a.INVALID_ENUM)}bufferData(e,t,r){if(e|=0,(r|=0)!==a.STREAM_DRAW&&r!==a.STATIC_DRAW&&r!==a.DYNAMIC_DRAW)return void this.setError(a.INVALID_ENUM);if(e!==a.ARRAY_BUFFER&&e!==a.ELEMENT_ARRAY_BUFFER)return void this.setError(a.INVALID_ENUM);const n=this._getActiveBuffer(e);if(n)if("object"==typeof t){let i=null;if(R(t))i=D(t);else{if(!(t instanceof ArrayBuffer))return void this.setError(a.INVALID_VALUE);i=new Uint8Array(t)}this._saveError(),super.bufferData(e,i,r);const s=this.getError();if(this._restoreError(s),s!==a.NO_ERROR)return;n._size=i.length,e===a.ELEMENT_ARRAY_BUFFER&&(n._elements=new Uint8Array(i))}else if("number"==typeof t){const i=0|t;if(i<0)return void this.setError(a.INVALID_VALUE);this._saveError(),super.bufferData(e,i,r);const s=this.getError();if(this._restoreError(s),s!==a.NO_ERROR)return;n._size=i,e===a.ELEMENT_ARRAY_BUFFER&&(n._elements=new Uint8Array(i))}else this.setError(a.INVALID_VALUE);else this.setError(a.INVALID_OPERATION)}bufferSubData(e,t,r){if(t|=0,(e|=0)!==a.ARRAY_BUFFER&&e!==a.ELEMENT_ARRAY_BUFFER)return void this.setError(a.INVALID_ENUM);if(null===r)return;if(!r||"object"!=typeof r)return void this.setError(a.INVALID_VALUE);const n=this._getActiveBuffer(e);if(!n)return void this.setError(a.INVALID_OPERATION);if(t<0||t>=n._size)return void this.setError(a.INVALID_VALUE);let i=null;if(R(r))i=D(r);else{if(!(r instanceof ArrayBuffer))return void this.setError(a.INVALID_VALUE);i=new Uint8Array(r)}t+i.length>n._size?this.setError(a.INVALID_VALUE):(e===a.ELEMENT_ARRAY_BUFFER&&n._elements.set(i,t),super.bufferSubData(e,t,i))}checkFramebufferStatus(e){if(e!==a.FRAMEBUFFER)return this.setError(a.INVALID_ENUM),0;const t=this._activeFramebuffer;return t?this._preCheckFramebufferStatus(t):a.FRAMEBUFFER_COMPLETE}clear(e){if(this._framebufferOk())return super.clear(0|e)}clearColor(e,t,r,n){return super.clearColor(+e,+t,+r,+n)}clearDepth(e){return super.clearDepth(+e)}clearStencil(e){return this._checkStencil=!1,super.clearStencil(0|e)}colorMask(e,t,r,n){return super.colorMask(!!e,!!t,!!r,!!n)}compileShader(e){if(!T(e))throw new TypeError("compileShader(WebGLShader)");if(this._checkWrapper(e,$)&&this._checkShaderSource(e)){const t=this.getError();super.compileShader(0|e._);const r=this.getError();e._compileStatus=!!super.getShaderParameter(0|e._,a.COMPILE_STATUS),e._compileInfo=super.getShaderInfoLog(0|e._),this.getError(),this.setError(t||r)}}copyTexImage2D(e,t,r,i,s,o,u,l){e|=0,t|=0,r|=0,i|=0,s|=0,o|=0,u|=0,l|=0;const c=this._getTexImage(e);if(!c)return void this.setError(a.INVALID_OPERATION);if(r!==a.RGBA&&r!==a.RGB&&r!==a.ALPHA&&r!==a.LUMINANCE&&r!==a.LUMINANCE_ALPHA)return void this.setError(a.INVALID_ENUM);if(t<0||o<0||u<0||0!==l)return void this.setError(a.INVALID_VALUE);if(t>0&&(!n.isPow2(o)||!n.isPow2(u)))return void this.setError(a.INVALID_VALUE);this._saveError(),super.copyTexImage2D(e,t,r,i,s,o,u,l);const h=this.getError();this._restoreError(h),h===a.NO_ERROR&&(c._levelWidth[t]=o,c._levelHeight[t]=u,c._format=a.RGBA,c._type=a.UNSIGNED_BYTE)}copyTexSubImage2D(e,t,r,n,i,s,o,u){e|=0,t|=0,r|=0,n|=0,i|=0,s|=0,o|=0,u|=0,this._getTexImage(e)?o<0||u<0||r<0||n<0||t<0?this.setError(a.INVALID_VALUE):super.copyTexSubImage2D(e,t,r,n,i,s,o,u):this.setError(a.INVALID_OPERATION)}cullFace(e){return super.cullFace(0|e)}createShader(e){if((e|=0)!==a.FRAGMENT_SHADER&&e!==a.VERTEX_SHADER)return this.setError(a.INVALID_ENUM),null;const t=super.createShader(e);if(t<0)return null;const r=new $(t,this,e);return this._shaders[t]=r,r}deleteProgram(e){return this._deleteLinkable("deleteProgram",e,U)}deleteShader(e){return this._deleteLinkable("deleteShader",e,$)}_deleteLinkable(e,t,r){if(!T(t))throw new TypeError(e+"("+r.name+")");if(t instanceof r&&this._checkOwns(t))return t._pendingDelete=!0,void t._checkDelete();this.setError(a.INVALID_OPERATION)}deleteBuffer(e){if(!T(e)||null!==e&&!(e instanceof M))throw new TypeError("deleteBuffer(WebGLBuffer)");e instanceof M&&this._checkOwns(e)?(this._vertexGlobalState._arrayBufferBinding===e&&this.bindBuffer(a.ARRAY_BUFFER,null),this._vertexObjectState._elementArrayBufferBinding===e&&this.bindBuffer(a.ELEMENT_ARRAY_BUFFER,null),this._vertexObjectState===this._defaultVertexObjectState&&this._vertexObjectState.releaseArrayBuffer(e),e._pendingDelete=!0,e._checkDelete()):this.setError(a.INVALID_OPERATION)}deleteFramebuffer(e){if(!T(e))throw new TypeError("deleteFramebuffer(WebGLFramebuffer)");e instanceof F&&this._checkOwns(e)?(this._activeFramebuffer===e&&this.bindFramebuffer(a.FRAMEBUFFER,null),e._pendingDelete=!0,e._checkDelete()):this.setError(a.INVALID_OPERATION)}deleteRenderbuffer(e){if(!T(e))throw new TypeError("deleteRenderbuffer(WebGLRenderbuffer)");if(!(e instanceof P&&this._checkOwns(e)))return void this.setError(a.INVALID_OPERATION);this._activeRenderbuffer===e&&this.bindRenderbuffer(a.RENDERBUFFER,null);const t=this._activeFramebuffer;this._tryDetachFramebuffer(t,e),e._pendingDelete=!0,e._checkDelete()}deleteTexture(e){if(!T(e))throw new TypeError("deleteTexture(WebGLTexture)");if(!(e instanceof G))return;if(!this._checkOwns(e))return void this.setError(a.INVALID_OPERATION);const t=this._activeTextureUnit;for(let t=0;t=this._vertexObjectState._attribs.length?this.setError(a.INVALID_VALUE):(super.disableVertexAttribArray(e),this._vertexObjectState._attribs[e]._isPointer=!1)}drawArrays(e,t,r){if(e|=0,r|=0,(t|=0)<0||r<0)return void this.setError(a.INVALID_VALUE);if(!this._checkStencilState())return;const n=L(e,r);if(n<0)return void this.setError(a.INVALID_ENUM);if(!this._framebufferOk())return;if(0===r)return;let i=t;if(r>0&&(i=r+t-1>>>0),this._checkVertexAttribState(i)){if(this._vertexObjectState._attribs[0]._isPointer||this._extensions.webgl_draw_buffers&&this._extensions.webgl_draw_buffers._buffersState&&this._extensions.webgl_draw_buffers._buffersState.length>0)return super.drawArrays(e,t,n);this._beginAttrib0Hack(),super._drawArraysInstanced(e,t,n,1),this._endAttrib0Hack()}}drawElements(e,t,r,n){if(e|=0,r|=0,n|=0,(t|=0)<0||n<0)return void this.setError(a.INVALID_VALUE);if(!this._checkStencilState())return;const i=this._vertexObjectState._elementArrayBufferBinding;if(!i)return void this.setError(a.INVALID_OPERATION);let s=null,o=n;if(r===a.UNSIGNED_SHORT){if(o%2)return void this.setError(a.INVALID_OPERATION);o>>=1,s=new Uint16Array(i._elements.buffer)}else if(this._extensions.oes_element_index_uint&&r===a.UNSIGNED_INT){if(o%4)return void this.setError(a.INVALID_OPERATION);o>>=2,s=new Uint32Array(i._elements.buffer)}else{if(r!==a.UNSIGNED_BYTE)return void this.setError(a.INVALID_ENUM);s=i._elements}let u=t;switch(e){case a.TRIANGLES:t%3&&(u-=t%3);break;case a.LINES:t%2&&(u-=t%2);break;case a.POINTS:break;case a.LINE_LOOP:case a.LINE_STRIP:if(t<2)return void this.setError(a.INVALID_OPERATION);break;case a.TRIANGLE_FAN:case a.TRIANGLE_STRIP:if(t<3)return void this.setError(a.INVALID_OPERATION);break;default:return void this.setError(a.INVALID_ENUM)}if(!this._framebufferOk())return;if(0===t)return void this._checkVertexAttribState(0);if(t+o>>>0>s.length)return void this.setError(a.INVALID_OPERATION);let l=-1;for(let e=o;e0){if(this._vertexObjectState._attribs[0]._isPointer)return super.drawElements(e,u,r,n);this._beginAttrib0Hack(),super._drawElementsInstanced(e,u,r,n,1),this._endAttrib0Hack()}}enable(e){e|=0,super.enable(e)}enableVertexAttribArray(e){(e|=0)<0||e>=this._vertexObjectState._attribs.length?this.setError(a.INVALID_VALUE):(super.enableVertexAttribArray(e),this._vertexObjectState._attribs[e]._isPointer=!0)}finish(){return super.finish()}flush(){return super.flush()}framebufferRenderbuffer(e,t,r,n){if(e|=0,t|=0,r|=0,!T(n))throw new TypeError("framebufferRenderbuffer(GLenum, GLenum, GLenum, WebGLRenderbuffer)");if(e!==a.FRAMEBUFFER||!this._validFramebufferAttachment(t)||r!==a.RENDERBUFFER)return void this.setError(a.INVALID_ENUM);const i=this._activeFramebuffer;i?n&&!this._checkWrapper(n,P)||(i._setAttachment(n,t),this._updateFramebufferAttachments(i)):this.setError(a.INVALID_OPERATION)}framebufferTexture2D(e,t,r,n,i){if(e|=0,t|=0,r|=0,i|=0,!T(n))throw new TypeError("framebufferTexture2D(GLenum, GLenum, GLenum, WebGLTexture, GLint)");if(e!==a.FRAMEBUFFER||!this._validFramebufferAttachment(t))return void this.setError(a.INVALID_ENUM);if(0!==i)return void this.setError(a.INVALID_VALUE);if(n&&!this._checkWrapper(n,G))return;if(r===a.TEXTURE_2D){if(n&&n._binding!==a.TEXTURE_2D)return void this.setError(a.INVALID_OPERATION)}else{if(!this._validCubeTarget(r))return void this.setError(a.INVALID_ENUM);if(n&&n._binding!==a.TEXTURE_CUBE_MAP)return void this.setError(a.INVALID_OPERATION)}const s=this._activeFramebuffer;s?(s._attachmentLevel[t]=i,s._attachmentFace[t]=r,s._setAttachment(n,t),this._updateFramebufferAttachments(s)):this.setError(a.INVALID_OPERATION)}frontFace(e){return super.frontFace(0|e)}generateMipmap(e){return 0|super.generateMipmap(0|e)}getActiveAttrib(e,t){if(!T(e))throw new TypeError("getActiveAttrib(WebGLProgram)");if(e){if(this._checkWrapper(e,U)){const r=super.getActiveAttrib(0|e._,0|t);if(r)return new O(r)}}else this.setError(a.INVALID_VALUE);return null}getActiveUniform(e,t){if(!T(e))throw new TypeError("getActiveUniform(WebGLProgram, GLint)");if(e){if(this._checkWrapper(e,U)){const r=super.getActiveUniform(0|e._,0|t);if(r)return new O(r)}}else this.setError(a.INVALID_VALUE);return null}getAttachedShaders(e){if(!T(e)||"object"==typeof e&&null!==e&&!(e instanceof U))throw new TypeError("getAttachedShaders(WebGLProgram)");if(e){if(this._checkWrapper(e,U)){const t=super.getAttachedShaders(0|e._);if(!t)return null;const r=new Array(t.length);for(let e=0;eW)this.setError(a.INVALID_VALUE);else if(this._checkWrapper(e,U))return super.getAttribLocation(0|e._,t+"");return-1}getParameter(e){switch(e|=0){case a.ARRAY_BUFFER_BINDING:return this._vertexGlobalState._arrayBufferBinding;case a.ELEMENT_ARRAY_BUFFER_BINDING:return this._vertexObjectState._elementArrayBufferBinding;case a.CURRENT_PROGRAM:return this._activeProgram;case a.FRAMEBUFFER_BINDING:return this._activeFramebuffer;case a.RENDERBUFFER_BINDING:return this._activeRenderbuffer;case a.TEXTURE_BINDING_2D:return this._getActiveTextureUnit()._bind2D;case a.TEXTURE_BINDING_CUBE_MAP:return this._getActiveTextureUnit()._bindCube;case a.VERSION:return"WebGL 1.0 stack-gl "+s;case a.VENDOR:return"stack-gl";case a.RENDERER:return"ANGLE";case a.SHADING_LANGUAGE_VERSION:return"WebGL GLSL ES 1.0 stack-gl";case a.COMPRESSED_TEXTURE_FORMATS:return new Uint32Array(0);case a.MAX_VIEWPORT_DIMS:case a.SCISSOR_BOX:case a.VIEWPORT:return new Int32Array(super.getParameter(e));case a.ALIASED_LINE_WIDTH_RANGE:case a.ALIASED_POINT_SIZE_RANGE:case a.DEPTH_RANGE:case a.BLEND_COLOR:case a.COLOR_CLEAR_VALUE:return new Float32Array(super.getParameter(e));case a.COLOR_WRITEMASK:return super.getParameter(e);case a.DEPTH_CLEAR_VALUE:case a.LINE_WIDTH:case a.POLYGON_OFFSET_FACTOR:case a.POLYGON_OFFSET_UNITS:case a.SAMPLE_COVERAGE_VALUE:return+super.getParameter(e);case a.BLEND:case a.CULL_FACE:case a.DEPTH_TEST:case a.DEPTH_WRITEMASK:case a.DITHER:case a.POLYGON_OFFSET_FILL:case a.SAMPLE_COVERAGE_INVERT:case a.SCISSOR_TEST:case a.STENCIL_TEST:case a.UNPACK_FLIP_Y_WEBGL:case a.UNPACK_PREMULTIPLY_ALPHA_WEBGL:return!!super.getParameter(e);case a.ACTIVE_TEXTURE:case a.ALPHA_BITS:case a.BLEND_DST_ALPHA:case a.BLEND_DST_RGB:case a.BLEND_EQUATION_ALPHA:case a.BLEND_EQUATION_RGB:case a.BLEND_SRC_ALPHA:case a.BLEND_SRC_RGB:case a.BLUE_BITS:case a.CULL_FACE_MODE:case a.DEPTH_BITS:case a.DEPTH_FUNC:case a.FRONT_FACE:case a.GENERATE_MIPMAP_HINT:case a.GREEN_BITS:case a.MAX_COMBINED_TEXTURE_IMAGE_UNITS:case a.MAX_CUBE_MAP_TEXTURE_SIZE:case a.MAX_FRAGMENT_UNIFORM_VECTORS:case a.MAX_RENDERBUFFER_SIZE:case a.MAX_TEXTURE_IMAGE_UNITS:case a.MAX_TEXTURE_SIZE:case a.MAX_VARYING_VECTORS:case a.MAX_VERTEX_ATTRIBS:case a.MAX_VERTEX_TEXTURE_IMAGE_UNITS:case a.MAX_VERTEX_UNIFORM_VECTORS:case a.PACK_ALIGNMENT:case a.RED_BITS:case a.SAMPLE_BUFFERS:case a.SAMPLES:case a.STENCIL_BACK_FAIL:case a.STENCIL_BACK_FUNC:case a.STENCIL_BACK_PASS_DEPTH_FAIL:case a.STENCIL_BACK_PASS_DEPTH_PASS:case a.STENCIL_BACK_REF:case a.STENCIL_BACK_VALUE_MASK:case a.STENCIL_BACK_WRITEMASK:case a.STENCIL_BITS:case a.STENCIL_CLEAR_VALUE:case a.STENCIL_FAIL:case a.STENCIL_FUNC:case a.STENCIL_PASS_DEPTH_FAIL:case a.STENCIL_PASS_DEPTH_PASS:case a.STENCIL_REF:case a.STENCIL_VALUE_MASK:case a.STENCIL_WRITEMASK:case a.SUBPIXEL_BITS:case a.UNPACK_ALIGNMENT:case a.UNPACK_COLORSPACE_CONVERSION_WEBGL:return 0|super.getParameter(e);case a.IMPLEMENTATION_COLOR_READ_FORMAT:case a.IMPLEMENTATION_COLOR_READ_TYPE:return super.getParameter(e);default:if(this._extensions.webgl_draw_buffers){const t=this._extensions.webgl_draw_buffers;switch(e){case t.DRAW_BUFFER0_WEBGL:case t.DRAW_BUFFER1_WEBGL:case t.DRAW_BUFFER2_WEBGL:case t.DRAW_BUFFER3_WEBGL:case t.DRAW_BUFFER4_WEBGL:case t.DRAW_BUFFER5_WEBGL:case t.DRAW_BUFFER6_WEBGL:case t.DRAW_BUFFER7_WEBGL:case t.DRAW_BUFFER8_WEBGL:case t.DRAW_BUFFER9_WEBGL:case t.DRAW_BUFFER10_WEBGL:case t.DRAW_BUFFER11_WEBGL:case t.DRAW_BUFFER12_WEBGL:case t.DRAW_BUFFER13_WEBGL:case t.DRAW_BUFFER14_WEBGL:case t.DRAW_BUFFER15_WEBGL:return 1===t._buffersState.length&&t._buffersState[0]===a.BACK?a.BACK:super.getParameter(e);case t.MAX_DRAW_BUFFERS_WEBGL:case t.MAX_COLOR_ATTACHMENTS_WEBGL:return super.getParameter(e)}}return this._extensions.oes_standard_derivatives&&e===this._extensions.oes_standard_derivatives.FRAGMENT_SHADER_DERIVATIVE_HINT_OES?super.getParameter(e):this._extensions.ext_texture_filter_anisotropic&&e===this._extensions.ext_texture_filter_anisotropic.MAX_TEXTURE_MAX_ANISOTROPY_EXT?super.getParameter(e):this._extensions.oes_vertex_array_object&&e===this._extensions.oes_vertex_array_object.VERTEX_ARRAY_BINDING_OES?this._extensions.oes_vertex_array_object._activeVertexArrayObject:(this.setError(a.INVALID_ENUM),null)}}getShaderPrecisionFormat(e,t){if(t|=0,(e|=0)!==a.FRAGMENT_SHADER&&e!==a.VERTEX_SHADER||t!==a.LOW_FLOAT&&t!==a.MEDIUM_FLOAT&&t!==a.HIGH_FLOAT&&t!==a.LOW_INT&&t!==a.MEDIUM_INT&&t!==a.HIGH_INT)return void this.setError(a.INVALID_ENUM);const r=super.getShaderPrecisionFormat(e,t);return r?new B(r):null}getBufferParameter(e,t){if(t|=0,(e|=0)!==a.ARRAY_BUFFER&&e!==a.ELEMENT_ARRAY_BUFFER)return this.setError(a.INVALID_ENUM),null;switch(t){case a.BUFFER_SIZE:case a.BUFFER_USAGE:return super.getBufferParameter(0|e,0|t);default:return this.setError(a.INVALID_ENUM),null}}getError(){return super.getError()}getFramebufferAttachmentParameter(e,t,r){if(t|=0,r|=0,(e|=0)!==a.FRAMEBUFFER||!this._validFramebufferAttachment(t))return this.setError(a.INVALID_ENUM),null;const n=this._activeFramebuffer;if(!n)return this.setError(a.INVALID_OPERATION),null;const i=n._attachments[t];if(null===i){if(r===a.FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE)return a.NONE}else if(i instanceof G)switch(r){case a.FRAMEBUFFER_ATTACHMENT_OBJECT_NAME:return i;case a.FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE:return a.TEXTURE;case a.FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL:return n._attachmentLevel[t];case a.FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE:{const e=n._attachmentFace[t];return e===a.TEXTURE_2D?0:e}}else if(i instanceof P)switch(r){case a.FRAMEBUFFER_ATTACHMENT_OBJECT_NAME:return i;case a.FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE:return a.RENDERBUFFER}return this.setError(a.INVALID_ENUM),null}getProgramParameter(e,t){if(t|=0,!T(e))throw new TypeError("getProgramParameter(WebGLProgram, GLenum)");if(this._checkWrapper(e,U)){switch(t){case a.DELETE_STATUS:return e._pendingDelete;case a.LINK_STATUS:return e._linkStatus;case a.VALIDATE_STATUS:return!!super.getProgramParameter(e._,t);case a.ATTACHED_SHADERS:case a.ACTIVE_ATTRIBUTES:case a.ACTIVE_UNIFORMS:return super.getProgramParameter(e._,t)}this.setError(a.INVALID_ENUM)}return null}getProgramInfoLog(e){if(!T(e))throw new TypeError("getProgramInfoLog(WebGLProgram)");return this._checkWrapper(e,U)?e._linkInfoLog:null}getRenderbufferParameter(e,t){if(t|=0,(e|=0)!==a.RENDERBUFFER)return this.setError(a.INVALID_ENUM),null;const r=this._activeRenderbuffer;if(!r)return this.setError(a.INVALID_OPERATION),null;switch(t){case a.RENDERBUFFER_INTERNAL_FORMAT:return r._format;case a.RENDERBUFFER_WIDTH:return r._width;case a.RENDERBUFFER_HEIGHT:return r._height;case a.RENDERBUFFER_SIZE:case a.RENDERBUFFER_RED_SIZE:case a.RENDERBUFFER_GREEN_SIZE:case a.RENDERBUFFER_BLUE_SIZE:case a.RENDERBUFFER_ALPHA_SIZE:case a.RENDERBUFFER_DEPTH_SIZE:case a.RENDERBUFFER_STENCIL_SIZE:return super.getRenderbufferParameter(e,t)}return this.setError(a.INVALID_ENUM),null}getShaderParameter(e,t){if(t|=0,!T(e))throw new TypeError("getShaderParameter(WebGLShader, GLenum)");if(this._checkWrapper(e,$)){switch(t){case a.DELETE_STATUS:return e._pendingDelete;case a.COMPILE_STATUS:return e._compileStatus;case a.SHADER_TYPE:return e._type}this.setError(a.INVALID_ENUM)}return null}getShaderInfoLog(e){if(!T(e))throw new TypeError("getShaderInfoLog(WebGLShader)");return this._checkWrapper(e,$)?e._compileInfo:null}getShaderSource(e){if(!T(e))throw new TypeError("Input to getShaderSource must be an object");return this._checkWrapper(e,$)?e._source:null}getTexParameter(e,t){if(e|=0,t|=0,!this._checkTextureTarget(e))return null;const r=this._getActiveTextureUnit();if(e===a.TEXTURE_2D&&!r._bind2D||e===a.TEXTURE_CUBE_MAP&&!r._bindCube)return this.setError(a.INVALID_OPERATION),null;switch(t){case a.TEXTURE_MAG_FILTER:case a.TEXTURE_MIN_FILTER:case a.TEXTURE_WRAP_S:case a.TEXTURE_WRAP_T:return super.getTexParameter(e,t)}return this._extensions.ext_texture_filter_anisotropic&&t===this._extensions.ext_texture_filter_anisotropic.TEXTURE_MAX_ANISOTROPY_EXT?super.getTexParameter(e,t):(this.setError(a.INVALID_ENUM),null)}getUniform(e,t){if(!T(e)||!T(t))throw new TypeError("getUniform(WebGLProgram, WebGLUniformLocation)");if(!e)return this.setError(a.INVALID_VALUE),null;if(!t)return null;if(this._checkWrapper(e,U)){if(!v(e,t))return this.setError(a.INVALID_OPERATION),null;const r=super.getUniform(0|e._,0|t._);if(!r)return null;switch(t._activeInfo.type){case a.FLOAT:return r[0];case a.FLOAT_VEC2:return new Float32Array(r.slice(0,2));case a.FLOAT_VEC3:return new Float32Array(r.slice(0,3));case a.FLOAT_VEC4:return new Float32Array(r.slice(0,4));case a.INT:return 0|r[0];case a.INT_VEC2:return new Int32Array(r.slice(0,2));case a.INT_VEC3:return new Int32Array(r.slice(0,3));case a.INT_VEC4:return new Int32Array(r.slice(0,4));case a.BOOL:return!!r[0];case a.BOOL_VEC2:return[!!r[0],!!r[1]];case a.BOOL_VEC3:return[!!r[0],!!r[1],!!r[2]];case a.BOOL_VEC4:return[!!r[0],!!r[1],!!r[2],!!r[3]];case a.FLOAT_MAT2:return new Float32Array(r.slice(0,4));case a.FLOAT_MAT3:return new Float32Array(r.slice(0,9));case a.FLOAT_MAT4:return new Float32Array(r.slice(0,16));case a.SAMPLER_2D:case a.SAMPLER_CUBE:return 0|r[0];default:return null}}return null}getUniformLocation(e,t){if(!T(e))throw new TypeError("getUniformLocation(WebGLProgram, String)");if(A(t+="")){if(this._checkWrapper(e,U)){const r=super.getUniformLocation(0|e._,t);if(r>=0){let n=t;/\[\d+\]$/.test(t)&&(n=t.replace(/\[\d+\]$/,"[0]"));let i=null;for(let t=0;t=i.size)return null}return s}}return null}this.setError(a.INVALID_VALUE)}getVertexAttrib(e,t){if(t|=0,(e|=0)<0||e>=this._vertexObjectState._attribs.length)return this.setError(a.INVALID_VALUE),null;const r=this._vertexObjectState._attribs[e],n=this._vertexGlobalState._attribs[e]._data,i=this._extensions.angle_instanced_arrays;if(i&&t===i.VERTEX_ATTRIB_ARRAY_DIVISOR_ANGLE)return r._divisor;switch(t){case a.VERTEX_ATTRIB_ARRAY_BUFFER_BINDING:return r._pointerBuffer;case a.VERTEX_ATTRIB_ARRAY_ENABLED:return r._isPointer;case a.VERTEX_ATTRIB_ARRAY_SIZE:return r._inputSize;case a.VERTEX_ATTRIB_ARRAY_STRIDE:return r._inputStride;case a.VERTEX_ATTRIB_ARRAY_TYPE:return r._pointerType;case a.VERTEX_ATTRIB_ARRAY_NORMALIZED:return r._pointerNormal;case a.CURRENT_VERTEX_ATTRIB:return new Float32Array(n);default:return this.setError(a.INVALID_ENUM),null}}getVertexAttribOffset(e,t){return t|=0,(e|=0)<0||e>=this._vertexObjectState._attribs.length?(this.setError(a.INVALID_VALUE),null):t===a.VERTEX_ATTRIB_ARRAY_POINTER?this._vertexObjectState._attribs[e]._pointerOffset:(this.setError(a.INVALID_ENUM),null)}hint(e,t){if(t|=0,(e|=0)===a.GENERATE_MIPMAP_HINT||this._extensions.oes_standard_derivatives&&e===this._extensions.oes_standard_derivatives.FRAGMENT_SHADER_DERIVATIVE_HINT_OES){if(t===a.FASTEST||t===a.NICEST||t===a.DONT_CARE)return super.hint(e,t);this.setError(a.INVALID_ENUM)}else this.setError(a.INVALID_ENUM)}isBuffer(e){return!!this._isObject(e,"isBuffer",M)&&super.isBuffer(0|e._)}isFramebuffer(e){return!!this._isObject(e,"isFramebuffer",F)&&super.isFramebuffer(0|e._)}isProgram(e){return!!this._isObject(e,"isProgram",U)&&super.isProgram(0|e._)}isRenderbuffer(e){return!!this._isObject(e,"isRenderbuffer",P)&&super.isRenderbuffer(0|e._)}isShader(e){return!!this._isObject(e,"isShader",$)&&super.isShader(0|e._)}isTexture(e){return!!this._isObject(e,"isTexture",G)&&super.isTexture(0|e._)}isEnabled(e){return super.isEnabled(0|e)}lineWidth(e){if(!isNaN(e))return super.lineWidth(+e);this.setError(a.INVALID_VALUE)}linkProgram(e){if(!T(e))throw new TypeError("linkProgram(WebGLProgram)");if(this._checkWrapper(e,U)){e._linkCount+=1,e._attributes=[];const t=this.getError();super.linkProgram(0|e._);const r=this.getError();r===a.NO_ERROR&&(e._linkStatus=this._fixupLink(e)),this.getError(),this.setError(t||r)}}pixelStorei(e,t){if(t|=0,(e|=0)===a.UNPACK_ALIGNMENT){if(1!==t&&2!==t&&4!==t&&8!==t)return void this.setError(a.INVALID_VALUE);this._unpackAlignment=t}else if(e===a.PACK_ALIGNMENT){if(1!==t&&2!==t&&4!==t&&8!==t)return void this.setError(a.INVALID_VALUE);this._packAlignment=t}else if(e===a.UNPACK_COLORSPACE_CONVERSION_WEBGL&&t!==a.NONE&&t!==a.BROWSER_DEFAULT_WEBGL)return void this.setError(a.INVALID_VALUE);return super.pixelStorei(e,t)}polygonOffset(e,t){return super.polygonOffset(+e,+t)}readPixels(e,t,r,n,i,s,o){if(e|=0,t|=0,r|=0,n|=0,this._extensions.oes_texture_float&&s===a.FLOAT&&i===a.RGBA);else{if(i===a.RGB||i===a.ALPHA||s!==a.UNSIGNED_BYTE)return void this.setError(a.INVALID_OPERATION);if(i!==a.RGBA)return void this.setError(a.INVALID_ENUM);if(r<0||n<0||!(o instanceof Uint8Array))return void this.setError(a.INVALID_VALUE)}if(!this._framebufferOk())return;let u=4*r;u%this._packAlignment!=0&&(u+=this._packAlignment-u%this._packAlignment);const l=u*(n-1)+4*r;if(l<=0)return;if(o.length=c||e+r<=0||t>=h||t+n<=0)for(let e=0;ec||t<0||t+n>h){for(let e=0;ec&&(o=c-a);let l=t,f=n;t<0&&(f+=t,l=0),l+n>h&&(f=h-l);let d=4*o;if(d%this._packAlignment!=0&&(d+=this._packAlignment-d%this._packAlignment),o>0&&f>0){const r=new Uint8Array(d*f);super.readPixels(a,l,o,f,i,s,r);const n=4*(a-e)+(l-t)*u;for(let e=0;e0&&t>0))throw new Error("Invalid surface dimensions");e===this.drawingBufferWidth&&t===this.drawingBufferHeight||(this._resizeDrawingBuffer(e,t),this.drawingBufferWidth=e,this.drawingBufferHeight=t)}sampleCoverage(e,t){return super.sampleCoverage(+e,!!t)}scissor(e,t,r,n){return super.scissor(0|e,0|t,0|r,0|n)}shaderSource(e,t){if(!T(e))throw new TypeError("shaderSource(WebGLShader, String)");e&&(t||"string"==typeof t)&&A(t+="")?this._checkWrapper(e,$)&&(super.shaderSource(0|e._,this._wrapShader(e._type,t)),e._source=t):this.setError(a.INVALID_VALUE)}stencilFunc(e,t,r){return this._checkStencil=!0,super.stencilFunc(0|e,0|t,0|r)}stencilFuncSeparate(e,t,r,n){return this._checkStencil=!0,super.stencilFuncSeparate(0|e,0|t,0|r,0|n)}stencilMask(e){return this._checkStencil=!0,super.stencilMask(0|e)}stencilMaskSeparate(e,t){return this._checkStencil=!0,super.stencilMaskSeparate(0|e,0|t)}stencilOp(e,t,r){return this._checkStencil=!0,super.stencilOp(0|e,0|t,0|r)}stencilOpSeparate(e,t,r,n){return this._checkStencil=!0,super.stencilOpSeparate(0|e,0|t,0|r,0|n)}texImage2D(e,t,r,n,i,s,o,u,l){if(6===arguments.length){if(u=i,o=n,null==(l=I(l=s)))throw new TypeError("texImage2D(GLenum, GLint, GLenum, GLint, GLenum, GLenum, ImageData | HTMLImageElement | HTMLCanvasElement | HTMLVideoElement)");n=l.width,i=l.height,l=l.data}if(e|=0,t|=0,r|=0,n|=0,i|=0,s|=0,o|=0,u|=0,"object"!=typeof l&&void 0!==l)throw new TypeError("texImage2D(GLenum, GLint, GLenum, GLint, GLint, GLint, GLenum, GLenum, Uint8Array)");if(!C(o)||!C(r))return void this.setError(a.INVALID_ENUM);if(u===a.FLOAT&&!this._extensions.oes_texture_float)return void this.setError(a.INVALID_ENUM);const c=this._getTexImage(e);if(!c||o!==r)return void this.setError(a.INVALID_OPERATION);const h=this._computePixelSize(u,o);if(0===h)return;if(!this._checkDimensions(e,n,i,t))return;const p=k(l),f=this._computeRowStride(n,h)*i;if(p&&p.length=this._vertexObjectState._attribs.length||1!==t&&2!==t&&3!==t&&4!==t)return void this.setError(a.INVALID_VALUE);if(null===this._vertexGlobalState._arrayBufferBinding)return void this.setError(a.INVALID_OPERATION);const o=S(r);0!==o&&r!==a.INT&&r!==a.UNSIGNED_INT?i>255||i<0?this.setError(a.INVALID_VALUE):i%o==0&&s%o==0?(super.vertexAttribPointer(e,t,r,n,i,s),this._vertexObjectState.setVertexAttribPointer(this._vertexGlobalState._arrayBufferBinding,e,t*o,s,i||t*o,r,n,i,t)):this.setError(a.INVALID_OPERATION):this.setError(a.INVALID_ENUM)}viewport(e,t,r,n){return super.viewport(0|e,0|t,0|r,0|n)}_allocateDrawingBuffer(e,t){this._drawingBuffer=new V(super.createFramebuffer(),super.createTexture(),super.createRenderbuffer()),this._resizeDrawingBuffer(e,t)}isContextLost(){return!1}compressedTexImage2D(){}compressedTexSubImage2D(){}_checkUniformValid(e,t,r,n,i){if(!T(e))throw new TypeError(`${r}(WebGLUniformLocation, ...)`);if(!e)return!1;if(this._checkLocationActive(e)){const r=e._activeInfo.type;if(r===a.SAMPLER_2D||r===a.SAMPLER_CUBE){if(1!==n)return void this.setError(a.INVALID_VALUE);if("i"!==i)return void this.setError(a.INVALID_OPERATION);if(t<0||t>=this._textureUnits.length)return this.setError(a.INVALID_VALUE),!1}return!(w(r)>n)||(this.setError(a.INVALID_OPERATION),!1)}return!1}_checkUniformValueValid(e,t,r,n,i){if(!T(e)||!T(t))throw new TypeError(`${r}v(WebGLUniformLocation, Array)`);if(!e)return!1;if(!this._checkLocationActive(e))return!1;if("object"!=typeof t||!t||"number"!=typeof t.length)throw new TypeError(`Second argument to ${r} must be array`);return w(e._activeInfo.type)>n?(this.setError(a.INVALID_OPERATION),!1):t.length>=n&&t.length%n==0?!!e._array||(t.length===n||(this.setError(a.INVALID_OPERATION),!1)):(this.setError(a.INVALID_VALUE),!1)}uniform1f(e,t){this._checkUniformValid(e,t,"uniform1f",1,"f")&&super.uniform1f(0|e._,t)}uniform1fv(e,t){if(this._checkUniformValueValid(e,t,"uniform1fv",1,"f"))if(e._array){const r=e._array;for(let e=0;ee.drawingBufferWidth,set(t){e.drawingBufferWidth=t}},drawingBufferHeight:{get:()=>e.drawingBufferHeight,set(t){e.drawingBufferHeight=t}}}),t}}},{"../../package.json":18,"./extensions/angle-instanced-arrays":20,"./extensions/ext-blend-minmax":21,"./extensions/ext-texture-filter-anisotropic":22,"./extensions/oes-element-index-unit":23,"./extensions/oes-standard-derivatives":24,"./extensions/oes-texture-float":26,"./extensions/oes-texture-float-linear":25,"./extensions/oes-vertex-array-object":27,"./extensions/stackgl-destroy-context":28,"./extensions/stackgl-resize-drawing-buffer":29,"./extensions/webgl-draw-buffers":30,"./native-gl":32,"./utils":34,"./webgl-active-info":35,"./webgl-buffer":36,"./webgl-drawing-buffer-wrapper":38,"./webgl-framebuffer":39,"./webgl-program":40,"./webgl-renderbuffer":41,"./webgl-shader":44,"./webgl-shader-precision-format":43,"./webgl-texture":46,"./webgl-uniform-location":47,"bit-twiddle":14,"glsl-tokenizer/string":55}],43:[function(e,t,r){t.exports={WebGLShaderPrecisionFormat:class{constructor(e){this.rangeMin=e.rangeMin,this.rangeMax=e.rangeMax,this.precision=e.precision}}}},{}],44:[function(e,t,r){const{gl:n}=e("./native-gl"),{Linkable:i}=e("./linkable");t.exports={WebGLShader:class extends i{constructor(e,t,r){super(e),this._type=r,this._ctx=t,this._source="",this._compileStatus=!1,this._compileInfo=""}_performDelete(){const e=this._ctx;delete e._shaders[0|this._],n.deleteShader.call(e,0|this._)}}}},{"./linkable":31,"./native-gl":32}],45:[function(e,t,r){t.exports={WebGLTextureUnit:class{constructor(e,t){this._ctx=e,this._idx=t,this._mode=0,this._bind2D=null,this._bindCube=null}}}},{}],46:[function(e,t,r){const{Linkable:n}=e("./linkable"),{gl:i}=e("./native-gl");t.exports={WebGLTexture:class extends n{constructor(e,t){super(e),this._ctx=t,this._binding=0,this._levelWidth=new Int32Array(32),this._levelHeight=new Int32Array(32),this._format=0,this._type=0,this._complete=!0}_performDelete(){const e=this._ctx;delete e._textures[0|this._],i.deleteTexture.call(e,0|this._)}}}},{"./linkable":31,"./native-gl":32}],47:[function(e,t,r){t.exports={WebGLUniformLocation:class{constructor(e,t,r){this._=e,this._program=t,this._linkCount=t._linkCount,this._activeInfo=r,this._array=null}}}},{}],48:[function(e,t,r){const{gl:n}=e("./native-gl"),{WebGLBuffer:i}=e("./webgl-buffer");class s{constructor(e,t){this._ctx=e,this._idx=t,this._clear()}_clear(){this._isPointer=!1,this._pointerBuffer=null,this._pointerOffset=0,this._pointerSize=0,this._pointerStride=0,this._pointerType=n.FLOAT,this._pointerNormal=!1,this._divisor=0,this._inputSize=4,this._inputStride=0}}class a{constructor(e){this._idx=e,this._data=new Float32Array([0,0,0,1])}}t.exports={WebGLVertexArrayObjectAttribute:s,WebGLVertexArrayGlobalAttribute:a,WebGLVertexArrayObjectState:class{constructor(e){const t=e.getParameter(e.MAX_VERTEX_ATTRIBS);this._attribs=new Array(t);for(let r=0;r0)continue;r=e.slice(0,1).join("")}return P(r),k+=r.length,(I=I.slice(r.length)).length}}function j(){return/[^a-fA-F0-9]/.test(t)?(P(I.join("")),w=u,A):(I.push(t),r=t,A+1)}function H(){return"."===t?(I.push(t),w=g,r=t,A+1):/[eE]/.test(t)?(I.push(t),w=g,r=t,A+1):"x"===t&&1===I.length&&"0"===I[0]?(w=T,I.push(t),r=t,A+1):/[^\d]/.test(t)?(P(I.join("")),w=u,A):(I.push(t),r=t,A+1)}function X(){return"f"===t&&(I.push(t),r=t,A+=1),/[eE]/.test(t)?(I.push(t),r=t,A+1):("-"!==t&&"+"!==t||!/[eE]/.test(r))&&/[^\d]/.test(t)?(P(I.join("")),w=u,A):(I.push(t),r=t,A+1)}function q(){if(/[^\d\w_]/.test(t)){var e=I.join("");return w=U[e]?x:V[e]?_:m,P(I.join("")),w=u,A}return I.push(t),r=t,A+1}};var n=e("./lib/literals"),i=e("./lib/operators"),s=e("./lib/builtins"),a=e("./lib/literals-300es"),o=e("./lib/builtins-300es"),u=999,l=9999,c=0,h=1,p=2,f=3,d=4,g=5,m=6,_=7,x=8,y=9,b=10,T=11,v=["block-comment","line-comment","preprocessor","operator","integer","float","ident","builtin","keyword","whitespace","eof","integer"]},{"./lib/builtins":51,"./lib/builtins-300es":50,"./lib/literals":53,"./lib/literals-300es":52,"./lib/operators":54}],50:[function(e,t,r){var n=e("./builtins");n=n.slice().filter(function(e){return!/^(gl\_|texture)/.test(e)}),t.exports=n.concat(["gl_VertexID","gl_InstanceID","gl_Position","gl_PointSize","gl_FragCoord","gl_FrontFacing","gl_FragDepth","gl_PointCoord","gl_MaxVertexAttribs","gl_MaxVertexUniformVectors","gl_MaxVertexOutputVectors","gl_MaxFragmentInputVectors","gl_MaxVertexTextureImageUnits","gl_MaxCombinedTextureImageUnits","gl_MaxTextureImageUnits","gl_MaxFragmentUniformVectors","gl_MaxDrawBuffers","gl_MinProgramTexelOffset","gl_MaxProgramTexelOffset","gl_DepthRangeParameters","gl_DepthRange","trunc","round","roundEven","isnan","isinf","floatBitsToInt","floatBitsToUint","intBitsToFloat","uintBitsToFloat","packSnorm2x16","unpackSnorm2x16","packUnorm2x16","unpackUnorm2x16","packHalf2x16","unpackHalf2x16","outerProduct","transpose","determinant","inverse","texture","textureSize","textureProj","textureLod","textureOffset","texelFetch","texelFetchOffset","textureProjOffset","textureLodOffset","textureProjLod","textureProjLodOffset","textureGrad","textureGradOffset","textureProjGrad","textureProjGradOffset"])},{"./builtins":51}],51:[function(e,t,r){t.exports=["abs","acos","all","any","asin","atan","ceil","clamp","cos","cross","dFdx","dFdy","degrees","distance","dot","equal","exp","exp2","faceforward","floor","fract","gl_BackColor","gl_BackLightModelProduct","gl_BackLightProduct","gl_BackMaterial","gl_BackSecondaryColor","gl_ClipPlane","gl_ClipVertex","gl_Color","gl_DepthRange","gl_DepthRangeParameters","gl_EyePlaneQ","gl_EyePlaneR","gl_EyePlaneS","gl_EyePlaneT","gl_Fog","gl_FogCoord","gl_FogFragCoord","gl_FogParameters","gl_FragColor","gl_FragCoord","gl_FragData","gl_FragDepth","gl_FragDepthEXT","gl_FrontColor","gl_FrontFacing","gl_FrontLightModelProduct","gl_FrontLightProduct","gl_FrontMaterial","gl_FrontSecondaryColor","gl_LightModel","gl_LightModelParameters","gl_LightModelProducts","gl_LightProducts","gl_LightSource","gl_LightSourceParameters","gl_MaterialParameters","gl_MaxClipPlanes","gl_MaxCombinedTextureImageUnits","gl_MaxDrawBuffers","gl_MaxFragmentUniformComponents","gl_MaxLights","gl_MaxTextureCoords","gl_MaxTextureImageUnits","gl_MaxTextureUnits","gl_MaxVaryingFloats","gl_MaxVertexAttribs","gl_MaxVertexTextureImageUnits","gl_MaxVertexUniformComponents","gl_ModelViewMatrix","gl_ModelViewMatrixInverse","gl_ModelViewMatrixInverseTranspose","gl_ModelViewMatrixTranspose","gl_ModelViewProjectionMatrix","gl_ModelViewProjectionMatrixInverse","gl_ModelViewProjectionMatrixInverseTranspose","gl_ModelViewProjectionMatrixTranspose","gl_MultiTexCoord0","gl_MultiTexCoord1","gl_MultiTexCoord2","gl_MultiTexCoord3","gl_MultiTexCoord4","gl_MultiTexCoord5","gl_MultiTexCoord6","gl_MultiTexCoord7","gl_Normal","gl_NormalMatrix","gl_NormalScale","gl_ObjectPlaneQ","gl_ObjectPlaneR","gl_ObjectPlaneS","gl_ObjectPlaneT","gl_Point","gl_PointCoord","gl_PointParameters","gl_PointSize","gl_Position","gl_ProjectionMatrix","gl_ProjectionMatrixInverse","gl_ProjectionMatrixInverseTranspose","gl_ProjectionMatrixTranspose","gl_SecondaryColor","gl_TexCoord","gl_TextureEnvColor","gl_TextureMatrix","gl_TextureMatrixInverse","gl_TextureMatrixInverseTranspose","gl_TextureMatrixTranspose","gl_Vertex","greaterThan","greaterThanEqual","inversesqrt","length","lessThan","lessThanEqual","log","log2","matrixCompMult","max","min","mix","mod","normalize","not","notEqual","pow","radians","reflect","refract","sign","sin","smoothstep","sqrt","step","tan","texture2D","texture2DLod","texture2DProj","texture2DProjLod","textureCube","textureCubeLod","texture2DLodEXT","texture2DProjLodEXT","textureCubeLodEXT","texture2DGradEXT","texture2DProjGradEXT","textureCubeGradEXT"]},{}],52:[function(e,t,r){var n=e("./literals");t.exports=n.slice().concat(["layout","centroid","smooth","case","mat2x2","mat2x3","mat2x4","mat3x2","mat3x3","mat3x4","mat4x2","mat4x3","mat4x4","uvec2","uvec3","uvec4","samplerCubeShadow","sampler2DArray","sampler2DArrayShadow","isampler2D","isampler3D","isamplerCube","isampler2DArray","usampler2D","usampler3D","usamplerCube","usampler2DArray","coherent","restrict","readonly","writeonly","resource","atomic_uint","noperspective","patch","sample","subroutine","common","partition","active","filter","image1D","image2D","image3D","imageCube","iimage1D","iimage2D","iimage3D","iimageCube","uimage1D","uimage2D","uimage3D","uimageCube","image1DArray","image2DArray","iimage1DArray","iimage2DArray","uimage1DArray","uimage2DArray","image1DShadow","image2DShadow","image1DArrayShadow","image2DArrayShadow","imageBuffer","iimageBuffer","uimageBuffer","sampler1DArray","sampler1DArrayShadow","isampler1D","isampler1DArray","usampler1D","usampler1DArray","isampler2DRect","usampler2DRect","samplerBuffer","isamplerBuffer","usamplerBuffer","sampler2DMS","isampler2DMS","usampler2DMS","sampler2DMSArray","isampler2DMSArray","usampler2DMSArray"])},{"./literals":53}],53:[function(e,t,r){t.exports=["precision","highp","mediump","lowp","attribute","const","uniform","varying","break","continue","do","for","while","if","else","in","out","inout","float","int","uint","void","bool","true","false","discard","return","mat2","mat3","mat4","vec2","vec3","vec4","ivec2","ivec3","ivec4","bvec2","bvec3","bvec4","sampler1D","sampler2D","sampler3D","samplerCube","sampler1DShadow","sampler2DShadow","struct","asm","class","union","enum","typedef","template","this","packed","goto","switch","default","inline","noinline","volatile","public","static","extern","external","interface","long","short","double","half","fixed","unsigned","input","output","hvec2","hvec3","hvec4","dvec2","dvec3","dvec4","fvec2","fvec3","fvec4","sampler2DRect","sampler3DRect","sampler2DRectShadow","sizeof","cast","namespace","using"]},{}],54:[function(e,t,r){t.exports=["<<=",">>=","++","--","<<",">>","<=",">=","==","!=","&&","||","+=","-=","*=","/=","%=","&=","^^","^=","|=","(",")","[","]",".","!","~","*","/","%","+","-","<",">","&","^","|","?",":","=",",",";","{","}"]},{}],55:[function(e,t,r){var n=e("./index");t.exports=function(e,t){var r=n(t),i=[];return i=(i=i.concat(r(e))).concat(r(null))}},{"./index":49}],56:[function(e,t,r){function n(e){const t=new Array(e.length);for(let r=0;r{e.output=a(t),e.graphical&&s(e)}),e.toJSON=(()=>{throw new Error("Not usable with gpuMock")}),e.setConstants=(t=>(e.constants=t,e)),e.setGraphical=(t=>(e.graphical=t,e)),e.setCanvas=(t=>(e.canvas=t,e)),e.setContext=(t=>(e.context=t,e)),e.destroy=(()=>{}),e.validateSettings=(()=>{}),e.graphical&&e.output&&s(e),e.exec=function(){return new Promise((t,r)=>{try{t(e.apply(e,arguments))}catch(e){r(e)}})},e.getPixels=(t=>{const{x:r,y:n}=e.output;return t?function(e,t,r){const n=r/2|0,i=4*t,s=new Uint8ClampedArray(4*t),a=e.slice(0);for(let e=0;ee,r=["setWarnVarUsage","setArgumentTypes","setTactic","setOptimizeFloatMemory","setDebug","setLoopMaxIterations","setConstantTypes","setFunctions","setNativeFunctions","setInjectedNative","setPipeline","setPrecision","setOutputToTexture","setImmutable","setStrictIntegers","setDynamicOutput","setHardcodeConstants","setDynamicArguments","setUseLegacyEncoder","setWarnVarUsage","addSubKernel"];for(let n=0;n0&&t.push(", "),t.push("user_"),t.push(r)}t.push(") {\n")}for(let r=0;r0&&t.push(r.join(""),";\n"),t.push(`for (let ${e}=0;${e}0&&t.push(`if (!${n.join("")}) break;\n`),t.push(s.join("")),t.push(`\n${i.join("")};`),t.push("}\n")}return t}astWhileStatement(e,t){if("WhileStatement"!==e.type)throw this.astErrorOutput("Invalid while statement",e);return t.push("for (let i = 0; i < LOOP_MAX; i++) {"),t.push("if ("),this.astGeneric(e.test,t),t.push(") {\n"),this.astGeneric(e.body,t),t.push("} else {\n"),t.push("break;\n"),t.push("}\n"),t.push("}\n"),t}astDoWhileStatement(e,t){if("DoWhileStatement"!==e.type)throw this.astErrorOutput("Invalid while statement",e);return t.push("for (let i = 0; i < LOOP_MAX; i++) {"),this.astGeneric(e.body,t),t.push("if (!"),this.astGeneric(e.test,t),t.push(") {\n"),t.push("break;\n"),t.push("}\n"),t.push("}\n"),t}astAssignmentExpression(e,t){const r=this.getDeclaration(e.left);if(r&&!r.assignable)throw this.astErrorOutput(`Variable ${e.left.name} is not assignable here`,e);return this.astGeneric(e.left,t),t.push(e.operator),this.astGeneric(e.right,t),t}astBlockStatement(e,t){if(this.isState("loop-body")){this.pushState("block-body");for(let r=0;r0&&t.push(",");const n=r[e],i=this.getDeclaration(n.id);i.valueType||(i.valueType=this.getType(n.init)),this.astGeneric(n,t)}return this.isState("in-for-loop-init")||t.push(";"),t}astIfStatement(e,t){return t.push("if ("),this.astGeneric(e.test,t),t.push(")"),"BlockStatement"===e.consequent.type?this.astGeneric(e.consequent,t):(t.push(" {\n"),this.astGeneric(e.consequent,t),t.push("\n}\n")),e.alternate&&(t.push("else "),"BlockStatement"===e.alternate.type||"IfStatement"===e.alternate.type?this.astGeneric(e.alternate,t):(t.push(" {\n"),this.astGeneric(e.alternate,t),t.push("\n}\n"))),t}astSwitchStatement(e,t){const{discriminant:r,cases:n}=e;t.push("switch ("),this.astGeneric(r,t),t.push(") {\n");for(let e=0;e0&&(this.astGeneric(n[e].consequent,t),t.push("break;\n"))):(t.push("default:\n"),this.astGeneric(n[e].consequent,t),n[e].consequent&&n[e].consequent.length>0&&t.push("break;\n"));t.push("\n}")}astThisExpression(e,t){return t.push("_this"),t}astMemberExpression(e,t){const{signature:r,type:n,property:i,xProperty:s,yProperty:a,zProperty:o,name:u,origin:l}=this.getMemberExpressionDetails(e);switch(r){case"this.thread.value":return t.push(`_this.thread.${u}`),t;case"this.output.value":switch(u){case"x":t.push("outputX");break;case"y":t.push("outputY");break;case"z":t.push("outputZ");break;default:throw this.astErrorOutput("Unexpected expression",e)}return t;case"value":throw this.astErrorOutput("Unexpected expression",e);case"value[]":case"value[][]":case"value[][][]":case"value.value":if("Math"===l)return t.push(Math[u]),t;switch(i){case"r":return t.push(`user_${u}[0]`),t;case"g":return t.push(`user_${u}[1]`),t;case"b":return t.push(`user_${u}[2]`),t;case"a":return t.push(`user_${u}[3]`),t}break;case"this.constants.value":case"this.constants.value[]":case"this.constants.value[][]":case"this.constants.value[][][]":break;case"fn()[]":return this.astGeneric(e.object,t),t.push("["),this.astGeneric(e.property,t),t.push("]"),t;case"fn()[][]":return this.astGeneric(e.object.object,t),t.push("["),this.astGeneric(e.object.property,t),t.push("]"),t.push("["),this.astGeneric(e.property,t),t.push("]"),t;default:throw this.astErrorOutput("Unexpected expression",e)}if(!e.computed)switch(n){case"Number":case"Integer":case"Float":case"Boolean":return t.push(`${l}_${u}`),t}const c=`${l}_${u}`;switch(n){case"Array(2)":case"Array(3)":case"Array(4)":case"Matrix(2)":case"Matrix(3)":case"Matrix(4)":case"HTMLImageArray":case"ArrayTexture(1)":case"ArrayTexture(2)":case"ArrayTexture(3)":case"ArrayTexture(4)":case"HTMLImage":default:let e,r;if("constants"===l){const t=this.constants[u];e=(r="Input"===this.constantTypes[u])?t.size:null}else e=(r=this.isInput(u))?this.argumentSizes[this.argumentNames.indexOf(u)]:null;t.push(`${c}`),o&&a?r?(t.push("[("),this.astGeneric(o,t),t.push(`*${this.dynamicArguments?"(outputY * outputX)":e[1]*e[0]})+(`),this.astGeneric(a,t),t.push(`*${this.dynamicArguments?"outputX":e[0]})+`),this.astGeneric(s,t),t.push("]")):(t.push("["),this.astGeneric(o,t),t.push("]"),t.push("["),this.astGeneric(a,t),t.push("]"),t.push("["),this.astGeneric(s,t),t.push("]")):a?r?(t.push("[("),this.astGeneric(a,t),t.push(`*${this.dynamicArguments?"outputX":e[0]})+`),this.astGeneric(s,t),t.push("]")):(t.push("["),this.astGeneric(a,t),t.push("]"),t.push("["),this.astGeneric(s,t),t.push("]")):void 0!==s&&(t.push("["),this.astGeneric(s,t),t.push("]"))}return t}astCallExpression(e,t){if("CallExpression"!==e.type)throw this.astErrorOutput("Unknown CallExpression",e);let r=this.astMemberExpressionUnroll(e.callee);this.calledFunctions.indexOf(r)<0&&this.calledFunctions.push(r),this.isAstMathFunction(e),this.onFunctionCall&&this.onFunctionCall(this.name,r,e.arguments),t.push(r),t.push("(");const n=this.lookupFunctionArgumentTypes(r)||[];for(let i=0;i0&&t.push(", "),this.astGeneric(s,t)}return t.push(")"),t}astArrayExpression(e,t){const r=this.getType(e),n=e.elements.length,i=[];for(let t=0;t{switch(t){case"_colorData":return"_colorData";case"_imageData":return"_imageData";case"output":return"output";case"thread":return"this.thread"}return JSON.stringify(e[t])},findDependency:(e,t)=>null}),o=n.flattenFunctionToString((a?"function ":"")+e.getPixels.toString(),{thisLookup:t=>{switch(t){case"_colorData":return"_colorData";case"_imageData":return"_imageData";case"output":return"output";case"thread":return"this.thread"}return JSON.stringify(e[t])},findDependency:()=>null});i.push(" _imageData,"," _colorData,",` color: ${t},`),s.push(` kernel.getPixels = ${o};`)}const o=[],u=Object.keys(e.constantTypes);for(let t=0;t"this"===t?(a?"function ":"")+e[r].toString():null,thisLookup:e=>{switch(e){case"canvas":return;case"context":return"context"}}});s.push(t),i.push(" _mediaTo2DArray,"),i.push(" _imageTo3DArray,")}else if(-1!==e.argumentTypes.indexOf("HTMLImage")||-1!==o.indexOf("HTMLImage")){const t=n.flattenFunctionToString((a?"function ":"")+e._mediaTo2DArray.toString(),{findDependency:(e,t)=>null,thisLookup:e=>{switch(e){case"canvas":return"settings.canvas";case"context":return"settings.context"}throw new Error("unhandled thisLookup")}});s.push(t),i.push(" _mediaTo2DArray,")}return`function(settings) {\n${r.join("\n")}\n for (const p in _constantTypes) {\n if (!_constantTypes.hasOwnProperty(p)) continue;\n const type = _constantTypes[p];\n switch (type) {\n case 'Number':\n case 'Integer':\n case 'Float':\n case 'Boolean':\n case 'Array(2)':\n case 'Array(3)':\n case 'Array(4)':\n case 'Matrix(2)':\n case 'Matrix(3)':\n case 'Matrix(4)':\n if (incomingConstants.hasOwnProperty(p)) {\n console.warn('constant ' + p + ' of type ' + type + ' cannot be resigned');\n }\n continue;\n }\n if (!incomingConstants.hasOwnProperty(p)) {\n throw new Error('constant ' + p + ' not found');\n }\n _constants[p] = incomingConstants[p];\n }\n const kernel = (function() {\n${e._kernelString}\n })\n .apply({ ${i.join("\n")} });\n ${s.join("\n")}\n return kernel;\n}`}}},{"../../utils":164}],60:[function(e,t,r){const{Kernel:n}=e("../kernel"),{FunctionBuilder:i}=e("../function-builder"),{CPUFunctionNode:s}=e("./function-node"),{utils:a}=e("../../utils"),{cpuKernelString:o}=e("./kernel-string");t.exports={CPUKernel:class extends n{static getFeatures(){return this.features}static get features(){return Object.freeze({kernelMap:!0,isIntegerDivisionAccurate:!0})}static get isSupported(){return!0}static isContextMatch(e){return!1}static get mode(){return"cpu"}static nativeFunctionArguments(){return null}static nativeFunctionReturnType(){throw new Error(`Looking up native function return type not supported on ${this.name}`)}static combineKernels(e){return e}static getSignature(e,t){return"cpu"+(t.length>0?":"+t.join(","):"")}constructor(e,t){super(e,t),this.mergeSettings(e.settings||t),this._imageData=null,this._colorData=null,this._kernelString=null,this._prependedString=[],this.thread={x:0,y:0,z:0},this.translatedSources=null}initCanvas(){return"undefined"!=typeof document?document.createElement("canvas"):"undefined"!=typeof OffscreenCanvas?new OffscreenCanvas(0,0):void 0}initContext(){return this.canvas?this.canvas.getContext("2d"):null}initPlugins(e){return[]}validateSettings(e){if(!this.output||0===this.output.length){if(1!==e.length)throw new Error("Auto output only supported for kernels with only one input");const t=a.getVariableType(e[0],this.strictIntegers);if("Array"===t)this.output=a.getDimensions(t);else{if("NumberTexture"!==t&&"ArrayTexture(4)"!==t)throw new Error("Auto output not supported for input type: "+t);this.output=e[0].output}}if(this.graphical&&2!==this.output.length)throw new Error("Output must have 2 dimensions on graphical mode");this.checkOutput()}translateSource(){if(this.leadingReturnStatement=this.output.length>1?"resultX[x] = ":"result[x] = ",this.subKernels){const e=[];for(let t=0;t1?`resultX_${r}[x] = subKernelResult_${r};\n`:`result_${r}[x] = subKernelResult_${r};\n`)}this.followingReturnStatement=e.join("")}const e=i.fromKernel(this,s);this.translatedSources=e.getPrototypes("kernel"),this.graphical||this.returnType||(this.returnType=e.getKernelResultType())}build(){if(this.built)return;if(this.setupConstants(),this.setupArguments(arguments),this.validateSettings(arguments),this.translateSource(),this.graphical){const{canvas:e,output:t}=this;if(!e)throw new Error("no canvas available for using graphical output");const r=t[0],n=t[1]||1;e.width=r,e.height=n,this._imageData=this.context.createImageData(r,n),this._colorData=new Uint8ClampedArray(r*n*4)}const e=this.getKernelString();this.kernelString=e,this.debug&&(console.log("Function output:"),console.log(e));try{this.run=new Function([],e).bind(this)()}catch(e){console.error("An error occurred compiling the javascript: ",e)}this.buildSignature(arguments),this.built=!0}color(e,t,r,n){void 0===n&&(n=1),e=Math.floor(255*e),t=Math.floor(255*t),r=Math.floor(255*r),n=Math.floor(255*n);const i=this.output[0],s=this.output[1],a=this.thread.x+(s-this.thread.y-1)*i;this._colorData[4*a+0]=e,this._colorData[4*a+1]=t,this._colorData[4*a+2]=r,this._colorData[4*a+3]=n}getKernelString(){if(null!==this._kernelString)return this._kernelString;let e=null,{translatedSources:t}=this;return t.length>1?t=t.filter(t=>/^function/.test(t)?t:(e=t,!1)):e=t.shift(),this._kernelString=` const LOOP_MAX = ${this._getLoopMaxString()};\n ${this.injectedNative||""}\n const _this = this;\n ${this._resultKernelHeader()}\n ${this._processConstants()}\n return (${this.argumentNames.map(e=>"user_"+e).join(", ")}) => {\n ${this._prependedString.join("")}\n ${this._earlyThrows()}\n ${this._processArguments()}\n ${this.graphical?this._graphicalKernelBody(e):this._resultKernelBody(e)}\n ${t.length>0?t.join("\n"):""}\n };`}toString(){return o(this)}_getLoopMaxString(){return this.loopMaxIterations?` ${parseInt(this.loopMaxIterations)};`:" 1000;"}_processConstants(){if(!this.constants)return"";const e=[];for(let t in this.constants)switch(this.constantTypes[t]){case"HTMLCanvas":case"OffscreenCanvas":case"HTMLImage":case"ImageBitmap":case"ImageData":case"HTMLVideo":e.push(` const constants_${t} = this._mediaTo2DArray(this.constants.${t});\n`);break;case"HTMLImageArray":e.push(` const constants_${t} = this._imageTo3DArray(this.constants.${t});\n`);break;case"Input":e.push(` const constants_${t} = this.constants.${t}.value;\n`);break;default:e.push(` const constants_${t} = this.constants.${t};\n`)}return e.join("")}_earlyThrows(){if(this.graphical)return"";if(this.immutable)return"";if(!this.pipeline)return"";const e=[];for(let t=0;t`user_${n} === result_${e.name}`).join(" || ");t.push(`user_${n} === result${i?` || ${i}`:""}`)}return`if (${t.join(" || ")}) throw new Error('Source and destination arrays are the same. Use immutable = true');`}_processArguments(){const e=[];for(let t=0;t0?e.width:e.videoWidth,n=e.height>0?e.height:e.videoHeight;t.width=0;e--){const t=a[e]=new Array(r);for(let e=0;e`const result_${e.name} = new ${t}(outputX);\n`).join(" ")}\n ${this._mapSubKernels(e=>`let subKernelResult_${e.name};\n`).join(" ")}\n for (let x = 0; x < outputX; x++) {\n this.thread.x = x;\n this.thread.y = 0;\n this.thread.z = 0;\n ${e}\n }`}_mutableKernel1DResults(){const e=this._getKernelResultTypeConstructorString();return` const outputX = _this.output[0];\n const result = new ${e}(outputX);\n ${this._mapSubKernels(t=>`const result_${t.name} = new ${e}(outputX);\n`).join(" ")}\n ${this._mapSubKernels(e=>`let subKernelResult_${e.name};\n`).join(" ")}`}_resultMutableKernel1DLoop(e){return` const outputX = _this.output[0];\n for (let x = 0; x < outputX; x++) {\n this.thread.x = x;\n this.thread.y = 0;\n this.thread.z = 0;\n ${e}\n }`}_resultImmutableKernel2DLoop(e){const t=this._getKernelResultTypeConstructorString();return` const outputX = _this.output[0];\n const outputY = _this.output[1];\n const result = new Array(outputY);\n ${this._mapSubKernels(e=>`const result_${e.name} = new Array(outputY);\n`).join(" ")}\n ${this._mapSubKernels(e=>`let subKernelResult_${e.name};\n`).join(" ")}\n for (let y = 0; y < outputY; y++) {\n this.thread.z = 0;\n this.thread.y = y;\n const resultX = result[y] = new ${t}(outputX);\n ${this._mapSubKernels(e=>`const resultX_${e.name} = result_${e.name}[y] = new ${t}(outputX);\n`).join("")}\n for (let x = 0; x < outputX; x++) {\n this.thread.x = x;\n ${e}\n }\n }`}_mutableKernel2DResults(){const e=this._getKernelResultTypeConstructorString();return` const outputX = _this.output[0];\n const outputY = _this.output[1];\n const result = new Array(outputY);\n ${this._mapSubKernels(e=>`const result_${e.name} = new Array(outputY);\n`).join(" ")}\n ${this._mapSubKernels(e=>`let subKernelResult_${e.name};\n`).join(" ")}\n for (let y = 0; y < outputY; y++) {\n const resultX = result[y] = new ${e}(outputX);\n ${this._mapSubKernels(t=>`const resultX_${t.name} = result_${t.name}[y] = new ${e}(outputX);\n`).join("")}\n }`}_resultMutableKernel2DLoop(e){const t=this._getKernelResultTypeConstructorString();return` const outputX = _this.output[0];\n const outputY = _this.output[1];\n for (let y = 0; y < outputY; y++) {\n this.thread.z = 0;\n this.thread.y = y;\n const resultX = result[y];\n ${this._mapSubKernels(e=>`const resultX_${e.name} = result_${e.name}[y] = new ${t}(outputX);\n`).join("")}\n for (let x = 0; x < outputX; x++) {\n this.thread.x = x;\n ${e}\n }\n }`}_graphicalKernel2DLoop(e){return` const outputX = _this.output[0];\n const outputY = _this.output[1];\n for (let y = 0; y < outputY; y++) {\n this.thread.z = 0;\n this.thread.y = y;\n for (let x = 0; x < outputX; x++) {\n this.thread.x = x;\n ${e}\n }\n }`}_resultImmutableKernel3DLoop(e){const t=this._getKernelResultTypeConstructorString();return` const outputX = _this.output[0];\n const outputY = _this.output[1];\n const outputZ = _this.output[2];\n const result = new Array(outputZ);\n ${this._mapSubKernels(e=>`const result_${e.name} = new Array(outputZ);\n`).join(" ")}\n ${this._mapSubKernels(e=>`let subKernelResult_${e.name};\n`).join(" ")}\n for (let z = 0; z < outputZ; z++) {\n this.thread.z = z;\n const resultY = result[z] = new Array(outputY);\n ${this._mapSubKernels(e=>`const resultY_${e.name} = result_${e.name}[z] = new Array(outputY);\n`).join(" ")}\n for (let y = 0; y < outputY; y++) {\n this.thread.y = y;\n const resultX = resultY[y] = new ${t}(outputX);\n ${this._mapSubKernels(e=>`const resultX_${e.name} = resultY_${e.name}[y] = new ${t}(outputX);\n`).join(" ")}\n for (let x = 0; x < outputX; x++) {\n this.thread.x = x;\n ${e}\n }\n }\n }`}_mutableKernel3DResults(){const e=this._getKernelResultTypeConstructorString();return` const outputX = _this.output[0];\n const outputY = _this.output[1];\n const outputZ = _this.output[2];\n const result = new Array(outputZ);\n ${this._mapSubKernels(e=>`const result_${e.name} = new Array(outputZ);\n`).join(" ")}\n ${this._mapSubKernels(e=>`let subKernelResult_${e.name};\n`).join(" ")}\n for (let z = 0; z < outputZ; z++) {\n const resultY = result[z] = new Array(outputY);\n ${this._mapSubKernels(e=>`const resultY_${e.name} = result_${e.name}[z] = new Array(outputY);\n`).join(" ")}\n for (let y = 0; y < outputY; y++) {\n const resultX = resultY[y] = new ${e}(outputX);\n ${this._mapSubKernels(t=>`const resultX_${t.name} = resultY_${t.name}[y] = new ${e}(outputX);\n`).join(" ")}\n }\n }`}_resultMutableKernel3DLoop(e){return` const outputX = _this.output[0];\n const outputY = _this.output[1];\n const outputZ = _this.output[2];\n for (let z = 0; z < outputZ; z++) {\n this.thread.z = z;\n const resultY = result[z];\n for (let y = 0; y < outputY; y++) {\n this.thread.y = y;\n const resultX = resultY[y];\n for (let x = 0; x < outputX; x++) {\n this.thread.x = x;\n ${e}\n }\n }\n }`}_kernelOutput(){return this.subKernels?`\n return {\n result: result,\n ${this.subKernels.map(e=>`${e.property}: result_${e.name}`).join(",\n ")}\n };`:"\n return result;"}_mapSubKernels(e){return null===this.subKernels?[""]:this.subKernels.map(e)}destroy(e){e&&delete this.canvas}static destroyContext(e){}toJSON(){const e=super.toJSON();return e.functionNodes=i.fromKernel(this,s).toJSON(),e}setOutput(e){super.setOutput(e);const[t,r]=this.output;this.graphical&&(this._imageData=this.context.createImageData(t,r),this._colorData=new Uint8ClampedArray(t*r*4))}prependString(e){if(this._kernelString)throw new Error("Kernel already built");this._prependedString.push(e)}hasPrependString(e){return this._prependedString.indexOf(e)>-1}}}},{"../../utils":164,"../function-builder":61,"../kernel":88,"./function-node":58,"./kernel-string":59}],61:[function(e,t,r){class n{static fromKernel(e,t,r){const{kernelArguments:i,kernelConstants:s,argumentNames:a,argumentSizes:o,argumentBitRatios:u,constants:l,constantBitRatios:c,debug:h,loopMaxIterations:p,nativeFunctions:f,output:d,optimizeFloatMemory:g,precision:m,plugins:_,source:x,subKernels:y,functions:b,leadingReturnStatement:T,followingReturnStatement:v,dynamicArguments:E,dynamicOutput:A}=e,S=new Array(i.length),w={};for(let e=0;eG.needsArgumentType(e,t),L=(e,t,r)=>{G.assignArgumentType(e,t,r)},R=(e,t,r)=>G.lookupReturnType(e,t,r),D=e=>G.lookupFunctionArgumentTypes(e),k=(e,t)=>G.lookupFunctionArgumentName(e,t),C=(e,t)=>G.lookupFunctionArgumentBitRatio(e,t),N=(e,t,r,n)=>{G.assignArgumentType(e,t,r,n)},O=(e,t,r,n)=>{G.assignArgumentBitRatio(e,t,r,n)},F=(e,t,r)=>{G.trackFunctionCall(e,t,r)},M=(e,r)=>{const n=[];for(let t=0;tnew t(e.source,{returnType:e.returnType,argumentTypes:e.argumentTypes,output:d,plugins:_,constants:l,constantTypes:w,constantBitRatios:c,optimizeFloatMemory:g,precision:m,lookupReturnType:R,lookupFunctionArgumentTypes:D,lookupFunctionArgumentName:k,lookupFunctionArgumentBitRatio:C,needsArgumentType:I,assignArgumentType:L,triggerImplyArgumentType:N,triggerImplyArgumentBitRatio:O,onFunctionCall:F,onNestedFunction:M})));let B=null;y&&(B=y.map(e=>{const{name:r,source:n}=e;return new t(n,Object.assign({},V,{name:r,isSubKernel:!0,isRootKernel:!1}))}));const G=new n({kernel:e,rootNode:P,functionNodes:$,nativeFunctions:f,subKernelNodes:B});return G}constructor(e){if(e=e||{},this.kernel=e.kernel,this.rootNode=e.rootNode,this.functionNodes=e.functionNodes||[],this.subKernelNodes=e.subKernelNodes||[],this.nativeFunctions=e.nativeFunctions||[],this.functionMap={},this.nativeFunctionNames=[],this.lookupChain=[],this.functionNodeDependencies={},this.functionCalls={},this.rootNode&&(this.functionMap.kernel=this.rootNode),this.functionNodes)for(let e=0;e-1){const r=t.indexOf(e);if(-1===r)t.push(e);else{const e=t.splice(r,1)[0];t.push(e)}return t}const r=this.functionMap[e];if(r){const n=t.indexOf(e);if(-1===n){t.push(e),r.toString();for(let e=0;e-1){t.push(this.nativeFunctions[i].source);continue}const s=this.functionMap[n];s&&t.push(s.toString())}return t}toJSON(){return this.traceFunctionCalls(this.rootNode.name).reverse().map(e=>{const t=this.nativeFunctions.indexOf(e);if(t>-1)return{name:e,source:this.nativeFunctions[t].source};if(this.functionMap[e])return this.functionMap[e].toJSON();throw new Error(`function ${e} not found`)})}fromJSON(e,t){this.functionMap={};for(let r=0;r0){const i=t.arguments;for(let t=0;t0&&this.argumentTypes.length!==this.argumentNames.length)throw new Error(`argumentTypes count of ${this.argumentTypes.length} exceeds ${this.argumentNames.length}`);if(this.output.length<1)throw new Error("this.output is not big enough")}isIdentifierConstant(e){return!!this.constants&&this.constants.hasOwnProperty(e)}isInput(e){return"Input"===this.argumentTypes[this.argumentNames.indexOf(e)]}pushState(e){this.states.push(e)}popState(e){if(this.state!==e)throw new Error(`Cannot popState ${e} when in ${this.state}`);this.states.pop()}isState(e){return this.state===e}get state(){return this.states[this.states.length-1]}astMemberExpressionUnroll(e){if("Identifier"===e.type)return e.name;if("ThisExpression"===e.type)return"this";if("MemberExpression"===e.type&&e.object&&e.property)return e.object.hasOwnProperty("name")&&"Math"!==e.object.name?this.astMemberExpressionUnroll(e.property):this.astMemberExpressionUnroll(e.object)+"."+this.astMemberExpressionUnroll(e.property);if(e.hasOwnProperty("expressions")){const t=e.expressions[0];if("Literal"===t.type&&0===t.value&&2===e.expressions.length)return this.astMemberExpressionUnroll(e.expressions[1])}throw this.astErrorOutput("Unknown astMemberExpressionUnroll",e)}getJsAST(e){if(this.ast)return this.ast;if("object"==typeof this.source)return this.traceFunctionAST(this.source),this.ast=this.source;if(null===(e=e||n))throw new Error("Missing JS to AST parser");const t=Object.freeze(e.parse(`const parser_${this.name} = ${this.source};`,{locations:!0})),r=t.body[0].declarations[0].init;if(this.traceFunctionAST(r),!t)throw new Error("Failed to parse JS code");return this.ast=r}traceFunctionAST(e){const{contexts:t,declarations:r,functions:n,identifiers:i,functionCalls:a}=new s(e);this.contexts=t,this.identifiers=i,this.functionCalls=a,this.functions=n;for(let e=0;e":case"<":return"Boolean";case"&":case"|":case"^":case"<<":case">>":case">>>":return"Integer"}const r=this.getType(e.left);if(this.isState("skip-literal-correction"))return r;if("LiteralInteger"===r){const t=this.getType(e.right);return"LiteralInteger"===t?e.left.value%1==0?"Integer":"Float":t}return a[r]||r;case"UpdateExpression":return this.getType(e.argument);case"UnaryExpression":return"~"===e.operator?"Integer":this.getType(e.argument);case"VariableDeclaration":{const t=e.declarations;let r;for(let e=0;e-1}isAstMathFunction(e){return"CallExpression"===e.type&&e.callee&&"MemberExpression"===e.callee.type&&e.callee.object&&"Identifier"===e.callee.object.type&&"Math"===e.callee.object.name&&e.callee.property&&"Identifier"===e.callee.property.type&&["abs","acos","acosh","asin","asinh","atan","atan2","atanh","cbrt","ceil","clz32","cos","cosh","expm1","exp","floor","fround","imul","log","log2","log10","log1p","max","min","pow","random","round","sign","sin","sinh","sqrt","tan","tanh","trunc"].indexOf(e.callee.property.name)>-1}isAstVariable(e){return"Identifier"===e.type||"MemberExpression"===e.type}isSafe(e){return this.isSafeDependencies(this.getDependencies(e))}isSafeDependencies(e){return!e||!e.every||e.every(e=>e.isSafe)}getDependencies(e,t,r){if(t||(t=[]),!e)return null;if(Array.isArray(e)){for(let n=0;n-1/0&&e.value<1/0&&!isNaN(e.value)});break;case"VariableDeclarator":return this.getDependencies(e.init,t,r);case"Identifier":const n=this.getDeclaration(e);if(n)t.push({name:e.name,origin:"declaration",isSafe:!r&&this.isSafeDependencies(n.dependencies)});else if(this.argumentNames.indexOf(e.name)>-1)t.push({name:e.name,origin:"argument",isSafe:!1});else if(this.strictTypingChecking)throw new Error(`Cannot find identifier origin "${e.name}"`);break;case"FunctionDeclaration":return this.getDependencies(e.body.body[e.body.body.length-1],t,r);case"ReturnStatement":return this.getDependencies(e.argument,t);case"BinaryExpression":case"LogicalExpression":return r="/"===e.operator||"*"===e.operator,this.getDependencies(e.left,t,r),this.getDependencies(e.right,t,r),t;case"UnaryExpression":case"UpdateExpression":return this.getDependencies(e.argument,t,r);case"VariableDeclaration":return this.getDependencies(e.declarations,t,r);case"ArrayExpression":return t.push({origin:"declaration",isSafe:!0}),t;case"CallExpression":return t.push({origin:"function",isSafe:!0}),t;case"MemberExpression":const i=this.getMemberExpressionDetails(e);switch(i.signature){case"value[]":this.getDependencies(e.object,t,r);break;case"value[][]":this.getDependencies(e.object.object,t,r);break;case"value[][][]":this.getDependencies(e.object.object.object,t,r);break;case"this.output.value":this.dynamicOutput&&t.push({name:i.name,origin:"output",isSafe:!1})}if(i)return i.property&&this.getDependencies(i.property,t,r),i.xProperty&&this.getDependencies(i.xProperty,t,r),i.yProperty&&this.getDependencies(i.yProperty,t,r),i.zProperty&&this.getDependencies(i.zProperty,t,r),t;case"SequenceExpression":return this.getDependencies(e.expressions,t,r);default:throw this.astErrorOutput(`Unhandled type ${e.type} in getDependencies`,e)}return t}getVariableSignature(e,t){if(!this.isAstVariable(e))throw new Error(`ast of type "${e.type}" is not a variable signature`);if("Identifier"===e.type)return"value";const r=[];for(;e;)e.computed?r.push("[]"):"ThisExpression"===e.type?r.unshift("this"):e.property&&e.property.name?"x"===e.property.name||"y"===e.property.name||"z"===e.property.name?r.unshift(t?"."+e.property.name:".value"):"constants"===e.property.name||"thread"===e.property.name||"output"===e.property.name?r.unshift("."+e.property.name):r.unshift(t?"."+e.property.name:".value"):e.name?r.unshift(t?e.name:"value"):e.callee&&e.callee.name?r.unshift(t?e.callee.name+"()":"fn()"):e.elements?r.unshift("[]"):r.unshift("unknown"),e=e.object;const n=r.join("");return t?n:["value","value[]","value[][]","value[][][]","value[][][][]","value.value","value.thread.value","this.thread.value","this.output.value","this.constants.value","this.constants.value[]","this.constants.value[][]","this.constants.value[][][]","this.constants.value[][][][]","fn()[]","fn()[][]","fn()[][][]","[][]"].indexOf(n)>-1?n:null}build(){return this.toString().length>0}astGeneric(e,t){if(null===e)throw this.astErrorOutput("NULL ast",e);if(Array.isArray(e)){for(let r=0;r0?n[n.length-1]:0;return new Error(`${e} on line ${n.length}, position ${s.length}:\n ${r}`)}astDebuggerStatement(e,t){return t}astConditionalExpression(e,t){if("ConditionalExpression"!==e.type)throw this.astErrorOutput("Not a conditional expression",e);return t.push("("),this.astGeneric(e.test,t),t.push("?"),this.astGeneric(e.consequent,t),t.push(":"),this.astGeneric(e.alternate,t),t.push(")"),t}astFunction(e,t){throw new Error(`"astFunction" not defined on ${this.constructor.name}`)}astFunctionDeclaration(e,t){return this.isChildFunction(e)?t:this.astFunction(e,t)}astFunctionExpression(e,t){return this.isChildFunction(e)?t:this.astFunction(e,t)}isChildFunction(e){for(let t=0;t1?t.push("(",n.join(","),")"):t.push(n[0]),t}astUnaryExpression(e,t){return this.checkAndUpconvertBitwiseUnary(e,t)?t:(e.prefix?(t.push(e.operator),this.astGeneric(e.argument,t)):(this.astGeneric(e.argument,t),t.push(e.operator)),t)}checkAndUpconvertBitwiseUnary(e,t){}astUpdateExpression(e,t){return e.prefix?(t.push(e.operator),this.astGeneric(e.argument,t)):(this.astGeneric(e.argument,t),t.push(e.operator)),t}astLogicalExpression(e,t){return t.push("("),this.astGeneric(e.left,t),t.push(e.operator),this.astGeneric(e.right,t),t.push(")"),t}astMemberExpression(e,t){return t}astCallExpression(e,t){return t}astArrayExpression(e,t){return t}getMemberExpressionDetails(e){if("MemberExpression"!==e.type)throw this.astErrorOutput(`Expression ${e.type} not a MemberExpression`,e);let t=null,r=null;const n=this.getVariableSignature(e);switch(n){case"value":return null;case"value.thread.value":case"this.thread.value":case"this.output.value":return{signature:n,type:"Integer",name:e.property.name};case"value[]":if("string"!=typeof e.object.name)throw this.astErrorOutput("Unexpected expression",e);return{name:t=e.object.name,origin:"user",signature:n,type:this.getVariableType(e.object),xProperty:e.property};case"value[][]":if("string"!=typeof e.object.object.name)throw this.astErrorOutput("Unexpected expression",e);return{name:t=e.object.object.name,origin:"user",signature:n,type:this.getVariableType(e.object.object),yProperty:e.object.property,xProperty:e.property};case"value[][][]":if("string"!=typeof e.object.object.object.name)throw this.astErrorOutput("Unexpected expression",e);return{name:t=e.object.object.object.name,origin:"user",signature:n,type:this.getVariableType(e.object.object.object),zProperty:e.object.object.property,yProperty:e.object.property,xProperty:e.property};case"value[][][][]":if("string"!=typeof e.object.object.object.object.name)throw this.astErrorOutput("Unexpected expression",e);return{name:t=e.object.object.object.object.name,origin:"user",signature:n,type:this.getVariableType(e.object.object.object.object),zProperty:e.object.object.property,yProperty:e.object.property,xProperty:e.property};case"value.value":if("string"!=typeof e.property.name)throw this.astErrorOutput("Unexpected expression",e);if(this.isAstMathVariable(e))return{name:t=e.property.name,origin:"Math",type:"Number",signature:n};switch(e.property.name){case"r":case"g":case"b":case"a":return{name:t=e.object.name,property:e.property.name,origin:"user",signature:n,type:"Number"};default:throw this.astErrorOutput("Unexpected expression",e)}case"this.constants.value":if("string"!=typeof e.property.name)throw this.astErrorOutput("Unexpected expression",e);if(t=e.property.name,!(r=this.getConstantType(t)))throw this.astErrorOutput("Constant has no type",e);return{name:t,type:r,origin:"constants",signature:n};case"this.constants.value[]":if("string"!=typeof e.object.property.name)throw this.astErrorOutput("Unexpected expression",e);if(t=e.object.property.name,!(r=this.getConstantType(t)))throw this.astErrorOutput("Constant has no type",e);return{name:t,type:r,origin:"constants",signature:n,xProperty:e.property};case"this.constants.value[][]":if("string"!=typeof e.object.object.property.name)throw this.astErrorOutput("Unexpected expression",e);if(t=e.object.object.property.name,!(r=this.getConstantType(t)))throw this.astErrorOutput("Constant has no type",e);return{name:t,type:r,origin:"constants",signature:n,yProperty:e.object.property,xProperty:e.property};case"this.constants.value[][][]":if("string"!=typeof e.object.object.object.property.name)throw this.astErrorOutput("Unexpected expression",e);if(t=e.object.object.object.property.name,!(r=this.getConstantType(t)))throw this.astErrorOutput("Constant has no type",e);return{name:t,type:r,origin:"constants",signature:n,zProperty:e.object.object.property,yProperty:e.object.property,xProperty:e.property};case"fn()[]":case"fn()[][]":case"[][]":return{signature:n,property:e.property};default:throw this.astErrorOutput("Unexpected expression",e)}}findIdentifierOrigin(e){const t=[this.ast];for(;t.length>0;){const r=t[0];if("VariableDeclarator"===r.type&&r.id&&r.id.name&&r.id.name===e.name)return r;if(t.shift(),r.argument)t.push(r.argument);else if(r.body)t.push(r.body);else if(r.declarations)t.push(r.declarations);else if(Array.isArray(r))for(let e=0;e0;){const e=t.pop();if("ReturnStatement"===e.type)return e;if("FunctionDeclaration"!==e.type)if(e.argument)t.push(e.argument);else if(e.body)t.push(e.body);else if(e.declarations)t.push(e.declarations);else if(Array.isArray(e))for(let r=0;r0?e[e.length-1]:null}const s={trackIdentifiers:"trackIdentifiers",memberExpression:"memberExpression",inForLoopInit:"inForLoopInit"};t.exports={FunctionTracer:class{constructor(e){this.runningContexts=[],this.functionContexts=[],this.contexts=[],this.functionCalls=[],this.declarations=[],this.identifiers=[],this.functions=[],this.returnStatements=[],this.trackedIdentifiers=null,this.states=[],this.newFunctionContext(),this.scan(e)}isState(e){return this.states[this.states.length-1]===e}hasState(e){return this.states.indexOf(e)>-1}pushState(e){this.states.push(e)}popState(e){if(!this.isState(e))throw new Error(`Cannot pop the non-active state "${e}"`);this.states.pop()}get currentFunctionContext(){return i(this.functionContexts)}get currentContext(){return i(this.runningContexts)}newFunctionContext(){const e={"@contextType":"function"};this.contexts.push(e),this.functionContexts.push(e)}newContext(e){const t=Object.assign({"@contextType":"const/let"},this.currentContext);this.contexts.push(t),this.runningContexts.push(t),e();const{currentFunctionContext:r}=this;for(const e in r)r.hasOwnProperty(e)&&!t.hasOwnProperty(e)&&(t[e]=r[e]);return this.runningContexts.pop(),t}useFunctionContext(e){const t=i(this.functionContexts);this.runningContexts.push(t),e(),this.runningContexts.pop()}getIdentifiers(e){const t=this.trackedIdentifiers=[];return this.pushState(s.trackIdentifiers),e(),this.trackedIdentifiers=null,this.popState(s.trackIdentifiers),t}getDeclaration(e){const{currentContext:t,currentFunctionContext:r,runningContexts:n}=this,i=t[e]||r[e]||null;if(!i&&t===r&&n.length>0){const t=n[n.length-2];if(t[e])return t[e]}return i}scan(e){if(e)if(Array.isArray(e))for(let t=0;t{this.scan(e.body)});break;case"BlockStatement":this.newContext(()=>{this.scan(e.body)});break;case"AssignmentExpression":case"LogicalExpression":case"BinaryExpression":this.scan(e.left),this.scan(e.right);break;case"UpdateExpression":if("++"===e.operator){const t=this.getDeclaration(e.argument.name);t&&(t.suggestedType="Integer")}this.scan(e.argument);break;case"UnaryExpression":this.scan(e.argument);break;case"VariableDeclaration":"var"===e.kind?this.useFunctionContext(()=>{e.declarations=n.normalizeDeclarations(e),this.scan(e.declarations)}):(e.declarations=n.normalizeDeclarations(e),this.scan(e.declarations));break;case"VariableDeclarator":{const{currentContext:t}=this,r=this.hasState(s.inForLoopInit),n={ast:e,context:t,name:e.id.name,origin:"declaration",inForLoopInit:r,inForLoopTest:null,assignable:t===this.currentFunctionContext||!r&&!t.hasOwnProperty(e.id.name),suggestedType:null,valueType:null,dependencies:null,isSafe:null};t[e.id.name]||(t[e.id.name]=n),this.declarations.push(n),this.scan(e.id),this.scan(e.init);break}case"FunctionExpression":case"FunctionDeclaration":0===this.runningContexts.length?this.scan(e.body):this.functions.push(e);break;case"IfStatement":this.scan(e.test),this.scan(e.consequent),e.alternate&&this.scan(e.alternate);break;case"ForStatement":{let t;const r=this.newContext(()=>{this.pushState(s.inForLoopInit),this.scan(e.init),this.popState(s.inForLoopInit),t=this.getIdentifiers(()=>{this.scan(e.test)}),this.scan(e.update),this.newContext(()=>{this.scan(e.body)})});if(t)for(const e in r)"@contextType"!==e&&t.indexOf(e)>-1&&(r[e].inForLoopTest=!0);break}case"DoWhileStatement":case"WhileStatement":this.newContext(()=>{this.scan(e.body),this.scan(e.test)});break;case"Identifier":this.isState(s.trackIdentifiers)&&this.trackedIdentifiers.push(e.name),this.identifiers.push({context:this.currentContext,declaration:this.getDeclaration(e.name),ast:e});break;case"ReturnStatement":this.returnStatements.push(e),this.scan(e.argument);break;case"MemberExpression":this.pushState(s.memberExpression),this.scan(e.object),this.scan(e.property),this.popState(s.memberExpression);break;case"ExpressionStatement":this.scan(e.expression);break;case"SequenceExpression":this.scan(e.expressions);break;case"CallExpression":this.functionCalls.push({context:this.currentContext,ast:e}),this.scan(e.arguments);break;case"ArrayExpression":this.scan(e.elements);break;case"ConditionalExpression":this.scan(e.test),this.scan(e.alternate),this.scan(e.consequent);break;case"SwitchStatement":this.scan(e.discriminant),this.scan(e.cases);break;case"SwitchCase":this.scan(e.test),this.scan(e.consequent);break;case"ThisExpression":case"Literal":case"DebuggerStatement":case"EmptyStatement":case"BreakStatement":case"ContinueStatement":break;default:throw new Error(`unhandled type "${e.type}"`)}}}}},{"../utils":164}],64:[function(e,t,r){const{glWiretap:n}=e("gl-wiretap"),{utils:i}=e("../../utils");function s(e){return e.toString().replace("=>","").replace(/^function /,"").replace(/utils[.]/g,"/*utils.*/")}function a(e,t){const r="single"===t.precision?e:`new Float32Array(${e}.buffer)`;return t.output[2]?`renderOutput(${r}, ${t.output[0]}, ${t.output[1]}, ${t.output[2]})`:t.output[1]?`renderOutput(${r}, ${t.output[0]}, ${t.output[1]})`:`renderOutput(${r}, ${t.output[0]})`}function o(e,t,r){const n=e.toArray.toString(),s=!/^function/.test(n);return`() => {\n function framebuffer() { return ${r}; };\n ${i.flattenFunctionToString(`${s?"function ":""}${n}`,{findDependency:(t,r)=>{if("utils"===t)return`const ${r} = ${i[r].toString()};`;if("this"===t)return"framebuffer"===r?"":`${s?"function ":""}${e[r].toString()}`;throw new Error("unhandled fromObject")},thisLookup:(r,n)=>{if("texture"===r)return t;if("context"===r)return n?null:"gl";if(e.hasOwnProperty(r))return JSON.stringify(e[r]);throw new Error(`unhandled thisLookup ${r}`)}})}\n return toArray();\n }`}function u(e,t,r,n,i){if(null===e)return null;if(null===t)return null;switch(typeof e){case"boolean":case"number":return null}if("undefined"!=typeof HTMLImageElement&&e instanceof HTMLImageElement)for(let i=0;i{switch(typeof e){case"boolean":return new Boolean(e);case"number":return new Number(e);default:return e}}):null;const h=[],p=n(r.context,{useTrackablePrimitives:!0,onReadPixels:e=>{if(O.subKernels){if(f){const t=O.subKernels[d++].property;h.push(` result${isNaN(t)?"."+t:`[${t}]`} = ${a(e,O)};`)}else h.push(` const result = { result: ${a(e,O)} };`),f=!0;d===O.subKernels.length&&h.push(" return result;")}else e?h.push(` return ${a(e,O)};`):h.push(" return null;")},onUnrecognizedArgumentLookup:e=>{const t=u(e,O.kernelArguments,[],p);if(t)return t;const r=u(e,O.kernelConstants,T?Object.keys(T).map(e=>T[e]):[],p);return r||null}});let f=!1,d=0;const{source:g,canvas:m,output:_,pipeline:x,graphical:y,loopMaxIterations:b,constants:T,optimizeFloatMemory:v,precision:E,fixIntegerDivisionAccuracy:A,functions:S,nativeFunctions:w,subKernels:I,immutable:L,argumentTypes:R,constantTypes:D,kernelArguments:k,kernelConstants:C,tactic:N}=r,O=new e(g,{canvas:m,context:p,checkContext:!1,output:_,pipeline:x,graphical:y,loopMaxIterations:b,constants:T,optimizeFloatMemory:v,precision:E,fixIntegerDivisionAccuracy:A,functions:S,nativeFunctions:w,subKernels:I,immutable:L,argumentTypes:R,constantTypes:D,tactic:N});let F=[];if(p.setIndent(2),O.build.apply(O,t),F.push(p.toString()),p.reset(),O.kernelArguments.forEach((e,r)=>{switch(e.type){case"Integer":case"Boolean":case"Number":case"Float":case"Array":case"Array(2)":case"Array(3)":case"Array(4)":case"HTMLCanvas":case"HTMLImage":case"HTMLVideo":p.insertVariable(`uploadValue_${e.name}`,e.uploadValue);break;case"HTMLImageArray":for(let n=0;ne.varName).join(", ")}) {`),p.setIndent(4),O.run.apply(O,t),O.renderKernels?O.renderKernels():O.renderOutput&&O.renderOutput(),F.push(" /** start setup uploads for kernel values **/"),O.kernelArguments.forEach(e=>{F.push(" "+e.getStringValueHandler().split("\n").join("\n "))}),F.push(" /** end setup uploads for kernel values **/"),F.push(p.toString()),O.renderOutput===O.renderTexture){p.reset();const e=p.getContextVariableName(O.framebuffer);if(O.renderKernels){const t=O.renderKernels(),r=p.getContextVariableName(O.texture.texture);F.push(` return {\n result: {\n texture: ${r},\n type: '${t.result.type}',\n toArray: ${o(t.result,r,e)}\n },`);const{subKernels:n,mappedTextures:i}=O;for(let r=0;r"utils"===e?`const ${t} = ${i[t].toString()};`:null,thisLookup:t=>{if("context"===t)return null;if(e.hasOwnProperty(t))return JSON.stringify(e[t]);throw new Error(`unhandled thisLookup ${t}`)}})}(O)),F.push(" innerKernel.getPixels = getPixels;")),F.push(" return innerKernel;");let M=[];return C.forEach(e=>{M.push(`${e.getStringValueHandler()}`)}),`function kernel(settings) {\n const { context, constants } = settings;\n ${M.join("")}\n ${l||""}\n${F.join("\n")}\n}`}}},{"../../utils":164,"gl-wiretap":16}],65:[function(e,t,r){const{Kernel:n}=e("../kernel"),{utils:i}=e("../../utils"),{GLTextureArray2Float:s}=e("./texture/array-2-float"),{GLTextureArray2Float2D:a}=e("./texture/array-2-float-2d"),{GLTextureArray2Float3D:o}=e("./texture/array-2-float-3d"),{GLTextureArray3Float:u}=e("./texture/array-3-float"),{GLTextureArray3Float2D:l}=e("./texture/array-3-float-2d"),{GLTextureArray3Float3D:c}=e("./texture/array-3-float-3d"),{GLTextureArray4Float:h}=e("./texture/array-4-float"),{GLTextureArray4Float2D:p}=e("./texture/array-4-float-2d"),{GLTextureArray4Float3D:f}=e("./texture/array-4-float-3d"),{GLTextureFloat:d}=e("./texture/float"),{GLTextureFloat2D:g}=e("./texture/float-2d"),{GLTextureFloat3D:m}=e("./texture/float-3d"),{GLTextureMemoryOptimized:_}=e("./texture/memory-optimized"),{GLTextureMemoryOptimized2D:x}=e("./texture/memory-optimized-2d"),{GLTextureMemoryOptimized3D:y}=e("./texture/memory-optimized-3d"),{GLTextureUnsigned:b}=e("./texture/unsigned"),{GLTextureUnsigned2D:T}=e("./texture/unsigned-2d"),{GLTextureUnsigned3D:v}=e("./texture/unsigned-3d"),{GLTextureGraphical:E}=e("./texture/graphical");const A={int:"Integer",float:"Number",vec2:"Array(2)",vec3:"Array(3)",vec4:"Array(4)"};t.exports={GLKernel:class extends n{static get mode(){return"gpu"}static getIsFloatRead(){const e=new this("function kernelFunction() {\n return 1;\n }",{context:this.testContext,canvas:this.testCanvas,validate:!1,output:[1],precision:"single",returnType:"Number",tactic:"speed"});e.build(),e.run();const t=e.renderOutput();return e.destroy(!0),1===t[0]}static getIsIntegerDivisionAccurate(){const e=new this(function(e,t){return e[this.thread.x]/t[this.thread.x]}.toString(),{context:this.testContext,canvas:this.testCanvas,validate:!1,output:[2],returnType:"Number",precision:"unsigned",tactic:"speed"}),t=[[6,6030401],[3,3991]];e.build.apply(e,t),e.run.apply(e,t);const r=e.renderOutput();return e.destroy(!0),2===r[0]&&1511===r[1]}static getIsSpeedTacticSupported(){const e=new this(function(e){return e[this.thread.x]}.toString(),{context:this.testContext,canvas:this.testCanvas,validate:!1,output:[4],returnType:"Number",precision:"unsigned",tactic:"speed"}),t=[[0,1,2,3]];e.build.apply(e,t),e.run.apply(e,t);const r=e.renderOutput();return e.destroy(!0),0===Math.round(r[0])&&1===Math.round(r[1])&&2===Math.round(r[2])&&3===Math.round(r[3])}static get testCanvas(){throw new Error(`"testCanvas" not defined on ${this.name}`)}static get testContext(){throw new Error(`"testContext" not defined on ${this.name}`)}static getFeatures(){const e=this.testContext,t=this.getIsDrawBuffers();return Object.freeze({isFloatRead:this.getIsFloatRead(),isIntegerDivisionAccurate:this.getIsIntegerDivisionAccurate(),isSpeedTacticSupported:this.getIsSpeedTacticSupported(),isTextureFloat:this.getIsTextureFloat(),isDrawBuffers:t,kernelMap:t,channelCount:this.getChannelCount(),maxTextureSize:this.getMaxTextureSize(),lowIntPrecision:e.getShaderPrecisionFormat(e.FRAGMENT_SHADER,e.LOW_INT),lowFloatPrecision:e.getShaderPrecisionFormat(e.FRAGMENT_SHADER,e.LOW_FLOAT),mediumIntPrecision:e.getShaderPrecisionFormat(e.FRAGMENT_SHADER,e.MEDIUM_INT),mediumFloatPrecision:e.getShaderPrecisionFormat(e.FRAGMENT_SHADER,e.MEDIUM_FLOAT),highIntPrecision:e.getShaderPrecisionFormat(e.FRAGMENT_SHADER,e.HIGH_INT),highFloatPrecision:e.getShaderPrecisionFormat(e.FRAGMENT_SHADER,e.HIGH_FLOAT)})}static setupFeatureChecks(){throw new Error(`"setupFeatureChecks" not defined on ${this.name}`)}static getSignature(e,t){return e.getVariablePrecisionString()+(t.length>0?":"+t.join(","):"")}setFixIntegerDivisionAccuracy(e){return this.fixIntegerDivisionAccuracy=e,this}setPrecision(e){return this.precision=e,this}setFloatTextures(e){return i.warnDeprecated("method","setFloatTextures","setOptimizeFloatMemory"),this.floatTextures=e,this}static nativeFunctionArguments(e){const t=[],r=[],n=[],i=/^[a-zA-Z_]/,s=/[a-zA-Z_0-9]/;let a=0,o=null,u=null;for(;a0?n[n.length-1]:null;if("FUNCTION_ARGUMENTS"!==h||"/"!==l||"*"!==c)if("MULTI_LINE_COMMENT"!==h||"*"!==l||"/"!==c)if("FUNCTION_ARGUMENTS"!==h||"/"!==l||"/"!==c)if("COMMENT"!==h||"\n"!==l)if(null!==h||"("!==l){if("FUNCTION_ARGUMENTS"===h){if(")"===l){n.pop();break}if("f"===l&&"l"===c&&"o"===e[a+2]&&"a"===e[a+3]&&"t"===e[a+4]&&" "===e[a+5]){n.push("DECLARE_VARIABLE"),u="float",o="",a+=6;continue}if("i"===l&&"n"===c&&"t"===e[a+2]&&" "===e[a+3]){n.push("DECLARE_VARIABLE"),u="int",o="",a+=4;continue}if("v"===l&&"e"===c&&"c"===e[a+2]&&"2"===e[a+3]&&" "===e[a+4]){n.push("DECLARE_VARIABLE"),u="vec2",o="",a+=5;continue}if("v"===l&&"e"===c&&"c"===e[a+2]&&"3"===e[a+3]&&" "===e[a+4]){n.push("DECLARE_VARIABLE"),u="vec3",o="",a+=5;continue}if("v"===l&&"e"===c&&"c"===e[a+2]&&"4"===e[a+3]&&" "===e[a+4]){n.push("DECLARE_VARIABLE"),u="vec4",o="",a+=5;continue}}else if("DECLARE_VARIABLE"===h){if(""===o){if(" "===l){a++;continue}if(!i.test(l))throw new Error("variable name is not expected string")}o+=l,s.test(c)||(n.pop(),r.push(o),t.push(A[u]))}a++}else n.push("FUNCTION_ARGUMENTS"),a++;else n.pop(),a++;else n.push("COMMENT"),a+=2;else n.pop(),a+=2;else n.push("MULTI_LINE_COMMENT"),a+=2}if(n.length>0)throw new Error("GLSL function was not parsable");return{argumentNames:r,argumentTypes:t}}static nativeFunctionReturnType(e){return A[e.match(/int|float|vec[2-4]/)[0]]}static combineKernels(e,t){e.apply(null,arguments);const{texSize:r,context:n,threadDim:s}=t.texSize;let a;if("single"===t.precision){const e=r[0],t=Math.ceil(r[1]/4);a=new Float32Array(e*t*4*4),n.readPixels(0,0,e,4*t,n.RGBA,n.FLOAT,a)}else{const e=new Uint8Array(r[0]*r[1]*4);n.readPixels(0,0,r[0],r[1],n.RGBA,n.UNSIGNED_BYTE,e),a=new Float32Array(e.buffer)}return a=a.subarray(0,s[0]*s[1]*s[2]),1===t.output.length?a:2===t.output.length?i.splitArray(a,t.output[0]):3===t.output.length?i.splitArray(a,t.output[0]*t.output[1]).map(function(e){return i.splitArray(e,t.output[0])}):void 0}constructor(e,t){super(e,t),this.transferValues=null,this.formatValues=null,this.TextureConstructor=null,this.renderOutput=null,this.renderRawOutput=null,this.texSize=null,this.translatedSource=null,this.compiledFragmentShader=null,this.compiledVertexShader=null,this.switchingKernels=null,this._textureSwitched=null,this._mappedTextureSwitched=null}checkTextureSize(){const{features:e}=this.constructor;if(this.texSize[0]>e.maxTextureSize||this.texSize[1]>e.maxTextureSize)throw new Error(`Texture size [${this.texSize[0]},${this.texSize[1]}] generated by kernel is larger than supported size [${e.maxTextureSize},${e.maxTextureSize}]`)}translateSource(){throw new Error(`"translateSource" not defined on ${this.constructor.name}`)}pickRenderStrategy(e){if(this.graphical)return this.renderRawOutput=this.readPackedPixelsToUint8Array,this.transferValues=(e=>e),this.TextureConstructor=E,null;if("unsigned"===this.precision)if(this.renderRawOutput=this.readPackedPixelsToUint8Array,this.transferValues=this.readPackedPixelsToFloat32Array,this.pipeline)switch(this.renderOutput=this.renderTexture,null!==this.subKernels&&(this.renderKernels=this.renderKernelsToTextures),this.returnType){case"LiteralInteger":case"Float":case"Number":case"Integer":return this.output[2]>0?(this.TextureConstructor=v,null):this.output[1]>0?(this.TextureConstructor=T,null):(this.TextureConstructor=b,null);case"Array(2)":case"Array(3)":case"Array(4)":return this.requestFallback(e)}else switch(null!==this.subKernels&&(this.renderKernels=this.renderKernelsToArrays),this.returnType){case"LiteralInteger":case"Float":case"Number":case"Integer":return this.renderOutput=this.renderValues,this.output[2]>0?(this.TextureConstructor=v,this.formatValues=i.erect3DPackedFloat,null):this.output[1]>0?(this.TextureConstructor=T,this.formatValues=i.erect2DPackedFloat,null):(this.TextureConstructor=b,this.formatValues=i.erectPackedFloat,null);case"Array(2)":case"Array(3)":case"Array(4)":return this.requestFallback(e)}else{if("single"!==this.precision)throw new Error(`unhandled precision of "${this.precision}"`);if(this.renderRawOutput=this.readFloatPixelsToFloat32Array,this.transferValues=this.readFloatPixelsToFloat32Array,this.pipeline)switch(this.renderOutput=this.renderTexture,null!==this.subKernels&&(this.renderKernels=this.renderKernelsToTextures),this.returnType){case"LiteralInteger":case"Float":case"Number":case"Integer":return this.optimizeFloatMemory?this.output[2]>0?(this.TextureConstructor=y,null):this.output[1]>0?(this.TextureConstructor=x,null):(this.TextureConstructor=_,null):this.output[2]>0?(this.TextureConstructor=m,null):this.output[1]>0?(this.TextureConstructor=g,null):(this.TextureConstructor=d,null);case"Array(2)":return this.output[2]>0?(this.TextureConstructor=o,null):this.output[1]>0?(this.TextureConstructor=a,null):(this.TextureConstructor=s,null);case"Array(3)":return this.output[2]>0?(this.TextureConstructor=c,null):this.output[1]>0?(this.TextureConstructor=l,null):(this.TextureConstructor=u,null);case"Array(4)":return this.output[2]>0?(this.TextureConstructor=f,null):this.output[1]>0?(this.TextureConstructor=p,null):(this.TextureConstructor=h,null)}if(this.renderOutput=this.renderValues,null!==this.subKernels&&(this.renderKernels=this.renderKernelsToArrays),this.optimizeFloatMemory)switch(this.returnType){case"LiteralInteger":case"Float":case"Number":case"Integer":return this.output[2]>0?(this.TextureConstructor=y,this.formatValues=i.erectMemoryOptimized3DFloat,null):this.output[1]>0?(this.TextureConstructor=x,this.formatValues=i.erectMemoryOptimized2DFloat,null):(this.TextureConstructor=_,this.formatValues=i.erectMemoryOptimizedFloat,null);case"Array(2)":return this.output[2]>0?(this.TextureConstructor=o,this.formatValues=i.erect3DArray2,null):this.output[1]>0?(this.TextureConstructor=a,this.formatValues=i.erect2DArray2,null):(this.TextureConstructor=s,this.formatValues=i.erectArray2,null);case"Array(3)":return this.output[2]>0?(this.TextureConstructor=c,this.formatValues=i.erect3DArray3,null):this.output[1]>0?(this.TextureConstructor=l,this.formatValues=i.erect2DArray3,null):(this.TextureConstructor=u,this.formatValues=i.erectArray3,null);case"Array(4)":return this.output[2]>0?(this.TextureConstructor=f,this.formatValues=i.erect3DArray4,null):this.output[1]>0?(this.TextureConstructor=p,this.formatValues=i.erect2DArray4,null):(this.TextureConstructor=h,this.formatValues=i.erectArray4,null)}else switch(this.returnType){case"LiteralInteger":case"Float":case"Number":case"Integer":return this.output[2]>0?(this.TextureConstructor=m,this.formatValues=i.erect3DFloat,null):this.output[1]>0?(this.TextureConstructor=g,this.formatValues=i.erect2DFloat,null):(this.TextureConstructor=d,this.formatValues=i.erectFloat,null);case"Array(2)":return this.output[2]>0?(this.TextureConstructor=o,this.formatValues=i.erect3DArray2,null):this.output[1]>0?(this.TextureConstructor=a,this.formatValues=i.erect2DArray2,null):(this.TextureConstructor=s,this.formatValues=i.erectArray2,null);case"Array(3)":return this.output[2]>0?(this.TextureConstructor=c,this.formatValues=i.erect3DArray3,null):this.output[1]>0?(this.TextureConstructor=l,this.formatValues=i.erect2DArray3,null):(this.TextureConstructor=u,this.formatValues=i.erectArray3,null);case"Array(4)":return this.output[2]>0?(this.TextureConstructor=f,this.formatValues=i.erect3DArray4,null):this.output[1]>0?(this.TextureConstructor=p,this.formatValues=i.erect2DArray4,null):(this.TextureConstructor=h,this.formatValues=i.erectArray4,null)}}throw new Error(`unhandled return type "${this.returnType}"`)}getKernelString(){throw new Error("abstract method call")}getMainResultTexture(){switch(this.returnType){case"LiteralInteger":case"Float":case"Integer":case"Number":return this.getMainResultNumberTexture();case"Array(2)":return this.getMainResultArray2Texture();case"Array(3)":return this.getMainResultArray3Texture();case"Array(4)":return this.getMainResultArray4Texture();default:throw new Error(`unhandled returnType type ${this.returnType}`)}}getMainResultKernelNumberTexture(){throw new Error("abstract method call")}getMainResultSubKernelNumberTexture(){throw new Error("abstract method call")}getMainResultKernelArray2Texture(){throw new Error("abstract method call")}getMainResultSubKernelArray2Texture(){throw new Error("abstract method call")}getMainResultKernelArray3Texture(){throw new Error("abstract method call")}getMainResultSubKernelArray3Texture(){throw new Error("abstract method call")}getMainResultKernelArray4Texture(){throw new Error("abstract method call")}getMainResultSubKernelArray4Texture(){throw new Error("abstract method call")}getMainResultGraphical(){throw new Error("abstract method call")}getMainResultMemoryOptimizedFloats(){throw new Error("abstract method call")}getMainResultPackedPixels(){throw new Error("abstract method call")}getMainResultString(){return this.graphical?this.getMainResultGraphical():"single"===this.precision?this.optimizeFloatMemory?this.getMainResultMemoryOptimizedFloats():this.getMainResultTexture():this.getMainResultPackedPixels()}getMainResultNumberTexture(){return i.linesToString(this.getMainResultKernelNumberTexture())+i.linesToString(this.getMainResultSubKernelNumberTexture())}getMainResultArray2Texture(){return i.linesToString(this.getMainResultKernelArray2Texture())+i.linesToString(this.getMainResultSubKernelArray2Texture())}getMainResultArray3Texture(){return i.linesToString(this.getMainResultKernelArray3Texture())+i.linesToString(this.getMainResultSubKernelArray3Texture())}getMainResultArray4Texture(){return i.linesToString(this.getMainResultKernelArray4Texture())+i.linesToString(this.getMainResultSubKernelArray4Texture())}getFloatTacticDeclaration(){return`precision ${this.getVariablePrecisionString(this.texSize,this.tactic)} float;\n`}getIntTacticDeclaration(){return`precision ${this.getVariablePrecisionString(this.texSize,this.tactic,!0)} int;\n`}getSampler2DTacticDeclaration(){return`precision ${this.getVariablePrecisionString(this.texSize,this.tactic)} sampler2D;\n`}getSampler2DArrayTacticDeclaration(){return`precision ${this.getVariablePrecisionString(this.texSize,this.tactic)} sampler2DArray;\n`}renderTexture(){return this.immutable?this.texture.clone():this.texture}readPackedPixelsToUint8Array(){if("unsigned"!==this.precision)throw new Error('Requires this.precision to be "unsigned"');const{texSize:e,context:t}=this,r=new Uint8Array(e[0]*e[1]*4);return t.readPixels(0,0,e[0],e[1],t.RGBA,t.UNSIGNED_BYTE,r),r}readPackedPixelsToFloat32Array(){return new Float32Array(this.readPackedPixelsToUint8Array().buffer)}readFloatPixelsToFloat32Array(){if("single"!==this.precision)throw new Error('Requires this.precision to be "single"');const{texSize:e,context:t}=this,r=e[0],n=e[1],i=new Float32Array(r*n*4);return t.readPixels(0,0,r,n,t.RGBA,t.FLOAT,i),i}getPixels(e){const{context:t,output:r}=this,[n,s]=r,a=new Uint8Array(n*s*4);return t.readPixels(0,0,n,s,t.RGBA,t.UNSIGNED_BYTE,a),new Uint8ClampedArray((e?a:i.flipPixels(a,n,s)).buffer)}renderKernelsToArrays(){const e={result:this.renderOutput()};for(let t=0;t0){for(let e=0;e0){const{mappedTextures:r}=this;for(let n=0;n1&&(this.newTexture(),!0)}cloneTexture(){this.texture._refs--;const{context:e,size:t,texture:r,kernel:n}=this;n.debug&&console.warn("cloning internal texture"),e.bindFramebuffer(e.FRAMEBUFFER,this.framebuffer()),i(e,r),e.framebufferTexture2D(e.FRAMEBUFFER,e.COLOR_ATTACHMENT0,e.TEXTURE_2D,r,0);const s=e.createTexture();i(e,s),e.texImage2D(e.TEXTURE_2D,0,this.internalFormat,t[0],t[1],0,this.textureFormat,this.textureType,null),e.copyTexSubImage2D(e.TEXTURE_2D,0,0,0,0,0,t[0],t[1]),s._refs=1,this.texture=s}newTexture(){this.texture._refs--;const e=this.context,t=this.size;this.kernel.debug&&console.warn("new internal texture");const r=e.createTexture();i(e,r),e.texImage2D(e.TEXTURE_2D,0,this.internalFormat,t[0],t[1],0,this.textureFormat,this.textureType,null),r._refs=1,this.texture=r}clear(){if(this.texture._refs){this.texture._refs--;const e=this.context,t=this.texture=e.createTexture();i(e,t);const r=this.size;t._refs=1,e.texImage2D(e.TEXTURE_2D,0,this.internalFormat,r[0],r[1],0,this.textureFormat,this.textureType,null)}const{context:e,texture:t}=this;e.bindFramebuffer(e.FRAMEBUFFER,this.framebuffer()),e.bindTexture(e.TEXTURE_2D,t),i(e,t),e.framebufferTexture2D(e.FRAMEBUFFER,e.COLOR_ATTACHMENT0,e.TEXTURE_2D,t,0),e.clearColor(0,0,0,0),e.clear(e.COLOR_BUFFER_BIT|e.DEPTH_BUFFER_BIT)}delete(){this._deleted||(this._deleted=!0,this.texture._refs&&(this.texture._refs--,this.texture._refs)||this.context.deleteTexture(this.texture))}framebuffer(){return this._framebuffer||(this._framebuffer=this.kernel.getRawValueFramebuffer(this.size[0],this.size[1])),this._framebuffer}}}},{"../../../texture":163}],80:[function(e,t,r){const{utils:n}=e("../../../utils"),{GLTextureFloat:i}=e("./float");t.exports={GLTextureMemoryOptimized2D:class extends i{constructor(e){super(e),this.type="MemoryOptimizedNumberTexture"}toArray(){return n.erectMemoryOptimized2DFloat(this.renderValues(),this.output[0],this.output[1])}}}},{"../../../utils":164,"./float":77}],81:[function(e,t,r){const{utils:n}=e("../../../utils"),{GLTextureFloat:i}=e("./float");t.exports={GLTextureMemoryOptimized3D:class extends i{constructor(e){super(e),this.type="MemoryOptimizedNumberTexture"}toArray(){return n.erectMemoryOptimized3DFloat(this.renderValues(),this.output[0],this.output[1],this.output[2])}}}},{"../../../utils":164,"./float":77}],82:[function(e,t,r){const{utils:n}=e("../../../utils"),{GLTextureFloat:i}=e("./float");t.exports={GLTextureMemoryOptimized:class extends i{constructor(e){super(e),this.type="MemoryOptimizedNumberTexture"}toArray(){return n.erectMemoryOptimizedFloat(this.renderValues(),this.output[0])}}}},{"../../../utils":164,"./float":77}],83:[function(e,t,r){const{utils:n}=e("../../../utils"),{GLTextureUnsigned:i}=e("./unsigned");t.exports={GLTextureUnsigned2D:class extends i{constructor(e){super(e),this.type="NumberTexture"}toArray(){return n.erect2DPackedFloat(this.renderValues(),this.output[0],this.output[1])}}}},{"../../../utils":164,"./unsigned":85}],84:[function(e,t,r){const{utils:n}=e("../../../utils"),{GLTextureUnsigned:i}=e("./unsigned");t.exports={GLTextureUnsigned3D:class extends i{constructor(e){super(e),this.type="NumberTexture"}toArray(){return n.erect3DPackedFloat(this.renderValues(),this.output[0],this.output[1],this.output[2])}}}},{"../../../utils":164,"./unsigned":85}],85:[function(e,t,r){const{utils:n}=e("../../../utils"),{GLTexture:i}=e("./index");t.exports={GLTextureUnsigned:class extends i{get textureType(){return this.context.UNSIGNED_BYTE}constructor(e){super(e),this.type="NumberTexture"}renderRawOutput(){const{context:e}=this;e.bindFramebuffer(e.FRAMEBUFFER,this.framebuffer()),e.framebufferTexture2D(e.FRAMEBUFFER,e.COLOR_ATTACHMENT0,e.TEXTURE_2D,this.texture,0);const t=new Uint8Array(this.size[0]*this.size[1]*4);return e.readPixels(0,0,this.size[0],this.size[1],e.RGBA,e.UNSIGNED_BYTE,t),t}renderValues(){return this._deleted?null:new Float32Array(this.renderRawOutput().buffer)}toArray(){return n.erectPackedFloat(this.renderValues(),this.output[0])}}}},{"../../../utils":164,"./index":79}],86:[function(e,t,r){const n=e("gl"),{WebGLKernel:i}=e("../web-gl/kernel"),{glKernelString:s}=e("../gl/kernel-string");let a=null,o=null,u=null,l=null,c=null;t.exports={HeadlessGLKernel:class extends i{static get isSupported(){return null!==a?a:(this.setupFeatureChecks(),a=null!==u)}static setupFeatureChecks(){if(o=null,l=null,"function"==typeof n)try{if(!(u=n(2,2,{preserveDrawingBuffer:!0}))||!u.getExtension)return;l={STACKGL_resize_drawingbuffer:u.getExtension("STACKGL_resize_drawingbuffer"),STACKGL_destroy_context:u.getExtension("STACKGL_destroy_context"),OES_texture_float:u.getExtension("OES_texture_float"),OES_texture_float_linear:u.getExtension("OES_texture_float_linear"),OES_element_index_uint:u.getExtension("OES_element_index_uint"),WEBGL_draw_buffers:u.getExtension("WEBGL_draw_buffers"),WEBGL_color_buffer_float:u.getExtension("WEBGL_color_buffer_float")},c=this.getFeatures()}catch(e){console.warn(e)}}static isContextMatch(e){try{return"ANGLE"===e.getParameter(e.RENDERER)}catch(e){return!1}}static getIsTextureFloat(){return Boolean(l.OES_texture_float)}static getIsDrawBuffers(){return Boolean(l.WEBGL_draw_buffers)}static getChannelCount(){return l.WEBGL_draw_buffers?u.getParameter(l.WEBGL_draw_buffers.MAX_DRAW_BUFFERS_WEBGL):1}static getMaxTextureSize(){return u.getParameter(u.MAX_TEXTURE_SIZE)}static get testCanvas(){return o}static get testContext(){return u}static get features(){return c}initCanvas(){return{}}initContext(){return n(2,2,{preserveDrawingBuffer:!0})}initExtensions(){this.extensions={STACKGL_resize_drawingbuffer:this.context.getExtension("STACKGL_resize_drawingbuffer"),STACKGL_destroy_context:this.context.getExtension("STACKGL_destroy_context"),OES_texture_float:this.context.getExtension("OES_texture_float"),OES_texture_float_linear:this.context.getExtension("OES_texture_float_linear"),OES_element_index_uint:this.context.getExtension("OES_element_index_uint"),WEBGL_draw_buffers:this.context.getExtension("WEBGL_draw_buffers")}}build(){super.build.apply(this,arguments),this.fallbackRequested||this.extensions.STACKGL_resize_drawingbuffer.resize(this.maxTexSize[0],this.maxTexSize[1])}destroyExtensions(){this.extensions.STACKGL_resize_drawingbuffer=null,this.extensions.STACKGL_destroy_context=null,this.extensions.OES_texture_float=null,this.extensions.OES_texture_float_linear=null,this.extensions.OES_element_index_uint=null,this.extensions.WEBGL_draw_buffers=null}static destroyContext(e){const t=e.getExtension("STACKGL_destroy_context");t&&t.destroy&&t.destroy()}toString(){return s(this.constructor,arguments,this,"const gl = context || require('gl')(1, 1);\n"," if (!context) { gl.getExtension('STACKGL_destroy_context').destroy(); }\n")}setOutput(e){return super.setOutput(e),this.graphical&&this.extensions.STACKGL_resize_drawingbuffer&&this.extensions.STACKGL_resize_drawingbuffer.resize(this.maxTexSize[0],this.maxTexSize[1]),this}}}},{"../gl/kernel-string":64,"../web-gl/kernel":122,gl:17}],87:[function(e,t,r){t.exports={KernelValue:class{constructor(e,t){const{name:r,kernel:n,context:i,checkContext:s,onRequestContextHandle:a,onUpdateValueMismatch:o,origin:u,strictIntegers:l,type:c,tactic:h}=t;if(!r)throw new Error("name not set");if(!c)throw new Error("type not set");if(!u)throw new Error("origin not set");if("user"!==u&&"constants"!==u)throw new Error(`origin must be "user" or "constants" value is "${u}"`);if(!a)throw new Error("onRequestContextHandle is not set");this.name=r,this.origin=u,this.tactic=h,this.varName="constants"===u?`constants.${r}`:r,this.kernel=n,this.strictIntegers=l,this.type=e.type||c,this.size=e.size||null,this.index=null,this.context=i,this.checkContext=null===s||void 0===s||s,this.contextHandle=null,this.onRequestContextHandle=a,this.onUpdateValueMismatch=o,this.forceUploadEachRun=null}get id(){return`${this.origin}_${name}`}getSource(){throw new Error(`"getSource" not defined on ${this.constructor.name}`)}updateValue(e){throw new Error(`"updateValue" not defined on ${this.constructor.name}`)}}}},{}],88:[function(e,t,r){const{utils:n}=e("../utils"),{Input:i}=e("../input");t.exports={Kernel:class{static get isSupported(){throw new Error(`"isSupported" not implemented on ${this.name}`)}static isContextMatch(e){throw new Error(`"isContextMatch" not implemented on ${this.name}`)}static getFeatures(){throw new Error(`"getFeatures" not implemented on ${this.name}`)}static destroyContext(e){throw new Error(`"destroyContext" called on ${this.name}`)}static nativeFunctionArguments(){throw new Error(`"nativeFunctionArguments" called on ${this.name}`)}static nativeFunctionReturnType(){throw new Error(`"nativeFunctionReturnType" called on ${this.name}`)}static combineKernels(){throw new Error(`"combineKernels" called on ${this.name}`)}constructor(e,t){if("object"!=typeof e){if("string"!=typeof e)throw new Error("source not a string");if(!n.isFunctionString(e))throw new Error("source not a function string")}this.useLegacyEncoder=!1,this.fallbackRequested=!1,this.onRequestFallback=null,this.argumentNames="string"==typeof e?n.getArgumentNamesFromString(e):null,this.argumentTypes=null,this.argumentSizes=null,this.argumentBitRatios=null,this.kernelArguments=null,this.kernelConstants=null,this.forceUploadKernelConstants=null,this.source=e,this.output=null,this.debug=!1,this.graphical=!1,this.loopMaxIterations=0,this.constants=null,this.constantTypes=null,this.constantBitRatios=null,this.dynamicArguments=!1,this.dynamicOutput=!1,this.canvas=null,this.context=null,this.checkContext=null,this.gpu=null,this.functions=null,this.nativeFunctions=null,this.injectedNative=null,this.subKernels=null,this.validate=!0,this.immutable=!1,this.pipeline=!1,this.precision=null,this.tactic=null,this.plugins=null,this.returnType=null,this.leadingReturnStatement=null,this.followingReturnStatement=null,this.optimizeFloatMemory=null,this.strictIntegers=!1,this.fixIntegerDivisionAccuracy=null,this.built=!1,this.signature=null}mergeSettings(e){for(let t in e)if(e.hasOwnProperty(t)&&this.hasOwnProperty(t)){switch(t){case"output":if(!Array.isArray(e.output)){this.setOutput(e.output);continue}break;case"functions":this.functions=[];for(let t=0;te.name):null,returnType:this.returnType}}}buildSignature(e){const t=this.constructor;this.signature=t.getSignature(this,t.getArgumentTypes(this,e))}static getArgumentTypes(e,t){const r=new Array(t.length);for(let i=0;it.argumentTypes[e])||[]:t.argumentTypes||[],{name:n.getFunctionNameFromString(r)||null,source:r,argumentTypes:i,returnType:t.returnType||null}}onActivate(e){}}}},{"../input":160,"../utils":164}],89:[function(e,t,r){const n=`__HEADER__;\n__FLOAT_TACTIC_DECLARATION__;\n__INT_TACTIC_DECLARATION__;\n__SAMPLER_2D_TACTIC_DECLARATION__;\n\nconst int LOOP_MAX = __LOOP_MAX__;\n\n__PLUGINS__;\n__CONSTANTS__;\n\nvarying vec2 vTexCoord;\n\nfloat acosh(float x) {\n return log(x + sqrt(x * x - 1.0));\n}\n\nfloat sinh(float x) {\n return (pow(${Math.E}, x) - pow(${Math.E}, -x)) / 2.0;\n}\n\nfloat asinh(float x) {\n return log(x + sqrt(x * x + 1.0));\n}\n\nfloat atan2(float v1, float v2) {\n if (v1 == 0.0 || v2 == 0.0) return 0.0;\n return atan(v1 / v2);\n}\n\nfloat atanh(float x) {\n x = (x + 1.0) / (x - 1.0);\n if (x < 0.0) {\n return 0.5 * log(-x);\n }\n return 0.5 * log(x);\n}\n\nfloat cbrt(float x) {\n if (x >= 0.0) {\n return pow(x, 1.0 / 3.0);\n } else {\n return -pow(x, 1.0 / 3.0);\n }\n}\n\nfloat cosh(float x) {\n return (pow(${Math.E}, x) + pow(${Math.E}, -x)) / 2.0; \n}\n\nfloat expm1(float x) {\n return pow(${Math.E}, x) - 1.0; \n}\n\nfloat fround(highp float x) {\n return x;\n}\n\nfloat imul(float v1, float v2) {\n return float(int(v1) * int(v2));\n}\n\nfloat log10(float x) {\n return log2(x) * (1.0 / log2(10.0));\n}\n\nfloat log1p(float x) {\n return log(1.0 + x);\n}\n\nfloat _pow(float v1, float v2) {\n if (v2 == 0.0) return 1.0;\n return pow(v1, v2);\n}\n\nfloat tanh(float x) {\n float e = exp(2.0 * x);\n return (e - 1.0) / (e + 1.0);\n}\n\nfloat trunc(float x) {\n if (x >= 0.0) {\n return floor(x); \n } else {\n return ceil(x);\n }\n}\n\nvec4 _round(vec4 x) {\n return floor(x + 0.5);\n}\n\nfloat _round(float x) {\n return floor(x + 0.5);\n}\n\nconst int BIT_COUNT = 32;\nint modi(int x, int y) {\n return x - y * (x / y);\n}\n\nint bitwiseOr(int a, int b) {\n int result = 0;\n int n = 1;\n \n for (int i = 0; i < BIT_COUNT; i++) {\n if ((modi(a, 2) == 1) || (modi(b, 2) == 1)) {\n result += n;\n }\n a = a / 2;\n b = b / 2;\n n = n * 2;\n if(!(a > 0 || b > 0)) {\n break;\n }\n }\n return result;\n}\nint bitwiseXOR(int a, int b) {\n int result = 0;\n int n = 1;\n \n for (int i = 0; i < BIT_COUNT; i++) {\n if ((modi(a, 2) == 1) != (modi(b, 2) == 1)) {\n result += n;\n }\n a = a / 2;\n b = b / 2;\n n = n * 2;\n if(!(a > 0 || b > 0)) {\n break;\n }\n }\n return result;\n}\nint bitwiseAnd(int a, int b) {\n int result = 0;\n int n = 1;\n for (int i = 0; i < BIT_COUNT; i++) {\n if ((modi(a, 2) == 1) && (modi(b, 2) == 1)) {\n result += n;\n }\n a = a / 2;\n b = b / 2;\n n = n * 2;\n if(!(a > 0 && b > 0)) {\n break;\n }\n }\n return result;\n}\nint bitwiseNot(int a) {\n int result = 0;\n int n = 1;\n \n for (int i = 0; i < BIT_COUNT; i++) {\n if (modi(a, 2) == 0) {\n result += n; \n }\n a = a / 2;\n n = n * 2;\n }\n return result;\n}\nint bitwiseZeroFillLeftShift(int n, int shift) {\n int maxBytes = BIT_COUNT;\n for (int i = 0; i < BIT_COUNT; i++) {\n if (maxBytes >= n) {\n break;\n }\n maxBytes *= 2;\n }\n for (int i = 0; i < BIT_COUNT; i++) {\n if (i >= shift) {\n break;\n }\n n *= 2;\n }\n\n int result = 0;\n int byteVal = 1;\n for (int i = 0; i < BIT_COUNT; i++) {\n if (i >= maxBytes) break;\n if (modi(n, 2) > 0) { result += byteVal; }\n n = int(n / 2);\n byteVal *= 2;\n }\n return result;\n}\n\nint bitwiseSignedRightShift(int num, int shifts) {\n return int(floor(float(num) / pow(2.0, float(shifts))));\n}\n\nint bitwiseZeroFillRightShift(int n, int shift) {\n int maxBytes = BIT_COUNT;\n for (int i = 0; i < BIT_COUNT; i++) {\n if (maxBytes >= n) {\n break;\n }\n maxBytes *= 2;\n }\n for (int i = 0; i < BIT_COUNT; i++) {\n if (i >= shift) {\n break;\n }\n n /= 2;\n }\n int result = 0;\n int byteVal = 1;\n for (int i = 0; i < BIT_COUNT; i++) {\n if (i >= maxBytes) break;\n if (modi(n, 2) > 0) { result += byteVal; }\n n = int(n / 2);\n byteVal *= 2;\n }\n return result;\n}\n\nvec2 integerMod(vec2 x, float y) {\n vec2 res = floor(mod(x, y));\n return res * step(1.0 - floor(y), -res);\n}\n\nvec3 integerMod(vec3 x, float y) {\n vec3 res = floor(mod(x, y));\n return res * step(1.0 - floor(y), -res);\n}\n\nvec4 integerMod(vec4 x, vec4 y) {\n vec4 res = floor(mod(x, y));\n return res * step(1.0 - floor(y), -res);\n}\n\nfloat integerMod(float x, float y) {\n float res = floor(mod(x, y));\n return res * (res > floor(y) - 1.0 ? 0.0 : 1.0);\n}\n\nint integerMod(int x, int y) {\n return x - (y * int(x / y));\n}\n\n__DIVIDE_WITH_INTEGER_CHECK__;\n\n// Here be dragons!\n// DO NOT OPTIMIZE THIS CODE\n// YOU WILL BREAK SOMETHING ON SOMEBODY'S MACHINE\n// LEAVE IT AS IT IS, LEST YOU WASTE YOUR OWN TIME\nconst vec2 MAGIC_VEC = vec2(1.0, -256.0);\nconst vec4 SCALE_FACTOR = vec4(1.0, 256.0, 65536.0, 0.0);\nconst vec4 SCALE_FACTOR_INV = vec4(1.0, 0.00390625, 0.0000152587890625, 0.0); // 1, 1/256, 1/65536\nfloat decode32(vec4 texel) {\n __DECODE32_ENDIANNESS__;\n texel *= 255.0;\n vec2 gte128;\n gte128.x = texel.b >= 128.0 ? 1.0 : 0.0;\n gte128.y = texel.a >= 128.0 ? 1.0 : 0.0;\n float exponent = 2.0 * texel.a - 127.0 + dot(gte128, MAGIC_VEC);\n float res = exp2(_round(exponent));\n texel.b = texel.b - 128.0 * gte128.x;\n res = dot(texel, SCALE_FACTOR) * exp2(_round(exponent-23.0)) + res;\n res *= gte128.y * -2.0 + 1.0;\n return res;\n}\n\nfloat decode16(vec4 texel, int index) {\n int channel = integerMod(index, 2);\n if (channel == 0) return texel.r * 255.0 + texel.g * 65280.0;\n if (channel == 1) return texel.b * 255.0 + texel.a * 65280.0;\n return 0.0;\n}\n\nfloat decode8(vec4 texel, int index) {\n int channel = integerMod(index, 4);\n if (channel == 0) return texel.r * 255.0;\n if (channel == 1) return texel.g * 255.0;\n if (channel == 2) return texel.b * 255.0;\n if (channel == 3) return texel.a * 255.0;\n return 0.0;\n}\n\nvec4 legacyEncode32(float f) {\n float F = abs(f);\n float sign = f < 0.0 ? 1.0 : 0.0;\n float exponent = floor(log2(F));\n float mantissa = (exp2(-exponent) * F);\n // exponent += floor(log2(mantissa));\n vec4 texel = vec4(F * exp2(23.0-exponent)) * SCALE_FACTOR_INV;\n texel.rg = integerMod(texel.rg, 256.0);\n texel.b = integerMod(texel.b, 128.0);\n texel.a = exponent*0.5 + 63.5;\n texel.ba += vec2(integerMod(exponent+127.0, 2.0), sign) * 128.0;\n texel = floor(texel);\n texel *= 0.003921569; // 1/255\n __ENCODE32_ENDIANNESS__;\n return texel;\n}\n\n// https://github.com/gpujs/gpu.js/wiki/Encoder-details\nvec4 encode32(float value) {\n if (value == 0.0) return vec4(0, 0, 0, 0);\n\n float exponent;\n float mantissa;\n vec4 result;\n float sgn;\n\n sgn = step(0.0, -value);\n value = abs(value);\n\n exponent = floor(log2(value));\n\n mantissa = value*pow(2.0, -exponent)-1.0;\n exponent = exponent+127.0;\n result = vec4(0,0,0,0);\n\n result.a = floor(exponent/2.0);\n exponent = exponent - result.a*2.0;\n result.a = result.a + 128.0*sgn;\n\n result.b = floor(mantissa * 128.0);\n mantissa = mantissa - result.b / 128.0;\n result.b = result.b + exponent*128.0;\n\n result.g = floor(mantissa*32768.0);\n mantissa = mantissa - result.g/32768.0;\n\n result.r = floor(mantissa*8388608.0);\n return result/255.0;\n}\n// Dragons end here\n\nint index;\nivec3 threadId;\n\nivec3 indexTo3D(int idx, ivec3 texDim) {\n int z = int(idx / (texDim.x * texDim.y));\n idx -= z * int(texDim.x * texDim.y);\n int y = int(idx / texDim.x);\n int x = int(integerMod(idx, texDim.x));\n return ivec3(x, y, z);\n}\n\nfloat get32(sampler2D tex, ivec2 texSize, ivec3 texDim, int z, int y, int x) {\n int index = x + texDim.x * (y + texDim.y * z);\n int w = texSize.x;\n vec2 st = vec2(float(integerMod(index, w)), float(index / w)) + 0.5;\n vec4 texel = texture2D(tex, st / vec2(texSize));\n return decode32(texel);\n}\n\nfloat get16(sampler2D tex, ivec2 texSize, ivec3 texDim, int z, int y, int x) {\n int index = x + texDim.x * (y + texDim.y * z);\n int w = texSize.x * 2;\n vec2 st = vec2(float(integerMod(index, w)), float(index / w)) + 0.5;\n vec4 texel = texture2D(tex, st / vec2(texSize.x * 2, texSize.y));\n return decode16(texel, index);\n}\n\nfloat get8(sampler2D tex, ivec2 texSize, ivec3 texDim, int z, int y, int x) {\n int index = x + texDim.x * (y + texDim.y * z);\n int w = texSize.x * 4;\n vec2 st = vec2(float(integerMod(index, w)), float(index / w)) + 0.5;\n vec4 texel = texture2D(tex, st / vec2(texSize.x * 4, texSize.y));\n return decode8(texel, index);\n}\n\nfloat getMemoryOptimized32(sampler2D tex, ivec2 texSize, ivec3 texDim, int z, int y, int x) {\n int index = x + texDim.x * (y + texDim.y * z);\n int channel = integerMod(index, 4);\n index = index / 4;\n int w = texSize.x;\n vec2 st = vec2(float(integerMod(index, w)), float(index / w)) + 0.5;\n vec4 texel = texture2D(tex, st / vec2(texSize));\n if (channel == 0) return texel.r;\n if (channel == 1) return texel.g;\n if (channel == 2) return texel.b;\n if (channel == 3) return texel.a;\n return 0.0;\n}\n\nvec4 getImage2D(sampler2D tex, ivec2 texSize, ivec3 texDim, int z, int y, int x) {\n int index = x + texDim.x * (y + texDim.y * z);\n int w = texSize.x;\n vec2 st = vec2(float(integerMod(index, w)), float(index / w)) + 0.5;\n return texture2D(tex, st / vec2(texSize));\n}\n\nfloat getFloatFromSampler2D(sampler2D tex, ivec2 texSize, ivec3 texDim, int z, int y, int x) {\n vec4 result = getImage2D(tex, texSize, texDim, z, y, x);\n return result[0];\n}\n\nvec2 getVec2FromSampler2D(sampler2D tex, ivec2 texSize, ivec3 texDim, int z, int y, int x) {\n vec4 result = getImage2D(tex, texSize, texDim, z, y, x);\n return vec2(result[0], result[1]);\n}\n\nvec2 getMemoryOptimizedVec2(sampler2D tex, ivec2 texSize, ivec3 texDim, int z, int y, int x) {\n int index = x + (texDim.x * (y + (texDim.y * z)));\n int channel = integerMod(index, 2);\n index = index / 2;\n int w = texSize.x;\n vec2 st = vec2(float(integerMod(index, w)), float(index / w)) + 0.5;\n vec4 texel = texture2D(tex, st / vec2(texSize));\n if (channel == 0) return vec2(texel.r, texel.g);\n if (channel == 1) return vec2(texel.b, texel.a);\n return vec2(0.0, 0.0);\n}\n\nvec3 getVec3FromSampler2D(sampler2D tex, ivec2 texSize, ivec3 texDim, int z, int y, int x) {\n vec4 result = getImage2D(tex, texSize, texDim, z, y, x);\n return vec3(result[0], result[1], result[2]);\n}\n\nvec3 getMemoryOptimizedVec3(sampler2D tex, ivec2 texSize, ivec3 texDim, int z, int y, int x) {\n int fieldIndex = 3 * (x + texDim.x * (y + texDim.y * z));\n int vectorIndex = fieldIndex / 4;\n int vectorOffset = fieldIndex - vectorIndex * 4;\n int readY = vectorIndex / texSize.x;\n int readX = vectorIndex - readY * texSize.x;\n vec4 tex1 = texture2D(tex, (vec2(readX, readY) + 0.5) / vec2(texSize));\n \n if (vectorOffset == 0) {\n return tex1.xyz;\n } else if (vectorOffset == 1) {\n return tex1.yzw;\n } else {\n readX++;\n if (readX >= texSize.x) {\n readX = 0;\n readY++;\n }\n vec4 tex2 = texture2D(tex, vec2(readX, readY) / vec2(texSize));\n if (vectorOffset == 2) {\n return vec3(tex1.z, tex1.w, tex2.x);\n } else {\n return vec3(tex1.w, tex2.x, tex2.y);\n }\n }\n}\n\nvec4 getVec4FromSampler2D(sampler2D tex, ivec2 texSize, ivec3 texDim, int z, int y, int x) {\n return getImage2D(tex, texSize, texDim, z, y, x);\n}\n\nvec4 getMemoryOptimizedVec4(sampler2D tex, ivec2 texSize, ivec3 texDim, int z, int y, int x) {\n int index = x + texDim.x * (y + texDim.y * z);\n int channel = integerMod(index, 2);\n int w = texSize.x;\n vec2 st = vec2(float(integerMod(index, w)), float(index / w)) + 0.5;\n vec4 texel = texture2D(tex, st / vec2(texSize));\n return vec4(texel.r, texel.g, texel.b, texel.a);\n}\n\nvec4 actualColor;\nvoid color(float r, float g, float b, float a) {\n actualColor = vec4(r,g,b,a);\n}\n\nvoid color(float r, float g, float b) {\n color(r,g,b,1.0);\n}\n\nvoid color(sampler2D image) {\n actualColor = texture2D(image, vTexCoord);\n}\n\nfloat modulo(float number, float divisor) {\n if (number < 0.0) {\n number = abs(number);\n if (divisor < 0.0) {\n divisor = abs(divisor);\n }\n return -mod(number, divisor);\n }\n if (divisor < 0.0) {\n divisor = abs(divisor);\n }\n return mod(number, divisor);\n}\n\n__INJECTED_NATIVE__;\n__MAIN_CONSTANTS__;\n__MAIN_ARGUMENTS__;\n__KERNEL__;\n\nvoid main(void) {\n index = int(vTexCoord.s * float(uTexSize.x)) + int(vTexCoord.t * float(uTexSize.y)) * uTexSize.x;\n __MAIN_RESULT__;\n}`;t.exports={fragmentShader:n}},{}],90:[function(e,t,r){const{utils:n}=e("../../utils"),{FunctionNode:i}=e("../function-node");const s={Array:"sampler2D","Array(2)":"vec2","Array(3)":"vec3","Array(4)":"vec4","Matrix(2)":"mat2","Matrix(3)":"mat3","Matrix(4)":"mat4",Array2D:"sampler2D",Array3D:"sampler2D",Boolean:"bool",Float:"float",Input:"sampler2D",Integer:"int",Number:"float",LiteralInteger:"float",NumberTexture:"sampler2D",MemoryOptimizedNumberTexture:"sampler2D","ArrayTexture(1)":"sampler2D","ArrayTexture(2)":"sampler2D","ArrayTexture(3)":"sampler2D","ArrayTexture(4)":"sampler2D",HTMLVideo:"sampler2D",HTMLCanvas:"sampler2D",OffscreenCanvas:"sampler2D",HTMLImage:"sampler2D",ImageBitmap:"sampler2D",ImageData:"sampler2D",HTMLImageArray:"sampler2DArray"},a={"===":"==","!==":"!="};t.exports={WebGLFunctionNode:class extends i{constructor(e,t){super(e,t),t&&t.hasOwnProperty("fixIntegerDivisionAccuracy")&&(this.fixIntegerDivisionAccuracy=t.fixIntegerDivisionAccuracy)}astConditionalExpression(e,t){if("ConditionalExpression"!==e.type)throw this.astErrorOutput("Not a conditional expression",e);const r=this.getType(e.consequent),n=this.getType(e.alternate);return null===r&&null===n?(t.push("if ("),this.astGeneric(e.test,t),t.push(") {"),this.astGeneric(e.consequent,t),t.push(";"),t.push("} else {"),this.astGeneric(e.alternate,t),t.push(";"),t.push("}"),t):(t.push("("),this.astGeneric(e.test,t),t.push("?"),this.astGeneric(e.consequent,t),t.push(":"),this.astGeneric(e.alternate,t),t.push(")"),t)}astFunction(e,t){if(this.isRootKernel)t.push("void");else{this.returnType||this.findLastReturn()&&(this.returnType=this.getType(e.body),"LiteralInteger"===this.returnType&&(this.returnType="Number"));const{returnType:r}=this;if(r){const e=s[r];if(!e)throw new Error(`unknown type ${r}`);t.push(e)}else t.push("void")}if(t.push(" "),t.push(this.name),t.push("("),!this.isRootKernel)for(let r=0;r0&&t.push(", ");let a=this.argumentTypes[this.argumentNames.indexOf(i)];if(!a)throw this.astErrorOutput(`Unknown argument ${i} type`,e);"LiteralInteger"===a&&(this.argumentTypes[r]=a="Number");const o=s[a];if(!o)throw this.astErrorOutput("Unexpected expression",e);const u=n.sanitizeName(i);"sampler2D"===o||"sampler2DArray"===o?t.push(`${o} user_${u},ivec2 user_${u}Size,ivec3 user_${u}Dim`):t.push(`${o} user_${u}`)}t.push(") {\n");for(let r=0;r"===e.operator||"<"===e.operator&&"Literal"===e.right.type)&&!Number.isInteger(e.right.value)){this.pushState("building-float"),this.castValueToFloat(e.left,t),t.push(a[e.operator]||e.operator),this.astGeneric(e.right,t),this.popState("building-float");break}if(this.pushState("building-integer"),this.astGeneric(e.left,t),t.push(a[e.operator]||e.operator),this.pushState("casting-to-integer"),"Literal"===e.right.type){const r=[];if(this.astGeneric(e.right,r),"Integer"!==this.getType(e.right))throw this.astErrorOutput("Unhandled binary expression with literal",e);t.push(r.join(""))}else t.push("int("),this.astGeneric(e.right,t),t.push(")");this.popState("casting-to-integer"),this.popState("building-integer");break;case"Integer & LiteralInteger":this.pushState("building-integer"),this.astGeneric(e.left,t),t.push(a[e.operator]||e.operator),this.castLiteralToInteger(e.right,t),this.popState("building-integer");break;case"Number & Integer":this.pushState("building-float"),this.astGeneric(e.left,t),t.push(a[e.operator]||e.operator),this.castValueToFloat(e.right,t),this.popState("building-float");break;case"Float & LiteralInteger":case"Number & LiteralInteger":this.pushState("building-float"),this.astGeneric(e.left,t),t.push(a[e.operator]||e.operator),this.castLiteralToFloat(e.right,t),this.popState("building-float");break;case"LiteralInteger & Float":case"LiteralInteger & Number":this.isState("casting-to-integer")?(this.pushState("building-integer"),this.castLiteralToInteger(e.left,t),t.push(a[e.operator]||e.operator),this.castValueToInteger(e.right,t),this.popState("building-integer")):(this.pushState("building-float"),this.astGeneric(e.left,t),t.push(a[e.operator]||e.operator),this.pushState("casting-to-float"),this.astGeneric(e.right,t),this.popState("casting-to-float"),this.popState("building-float"));break;case"LiteralInteger & Integer":this.pushState("building-integer"),this.castLiteralToInteger(e.left,t),t.push(a[e.operator]||e.operator),this.astGeneric(e.right,t),this.popState("building-integer");break;case"Boolean & Boolean":this.pushState("building-boolean"),this.astGeneric(e.left,t),t.push(a[e.operator]||e.operator),this.astGeneric(e.right,t),this.popState("building-boolean");break;case"Float & Integer":this.pushState("building-float"),this.astGeneric(e.left,t),t.push(a[e.operator]||e.operator),this.castValueToFloat(e.right,t),this.popState("building-float");break;default:throw this.astErrorOutput(`Unhandled binary expression between ${i}`,e)}return t.push(")"),t}checkAndUpconvertOperator(e,t){const r=this.checkAndUpconvertBitwiseOperators(e,t);if(r)return r;const n={"%":this.fixIntegerDivisionAccuracy?"integerCorrectionModulo":"modulo","**":"pow"}[e.operator];if(!n)return null;switch(t.push(n),t.push("("),this.getType(e.left)){case"Integer":this.castValueToFloat(e.left,t);break;case"LiteralInteger":this.castLiteralToFloat(e.left,t);break;default:this.astGeneric(e.left,t)}switch(t.push(","),this.getType(e.right)){case"Integer":this.castValueToFloat(e.right,t);break;case"LiteralInteger":this.castLiteralToFloat(e.right,t);break;default:this.astGeneric(e.right,t)}return t.push(")"),t}checkAndUpconvertBitwiseOperators(e,t){const r={"&":"bitwiseAnd","|":"bitwiseOr","^":"bitwiseXOR","<<":"bitwiseZeroFillLeftShift",">>":"bitwiseSignedRightShift",">>>":"bitwiseZeroFillRightShift"}[e.operator];if(!r)return null;switch(t.push(r),t.push("("),this.getType(e.left)){case"Number":case"Float":this.castValueToInteger(e.left,t);break;case"LiteralInteger":this.castLiteralToInteger(e.left,t);break;default:this.astGeneric(e.left,t)}switch(t.push(","),this.getType(e.right)){case"Number":case"Float":this.castValueToInteger(e.right,t);break;case"LiteralInteger":this.castLiteralToInteger(e.right,t);break;default:this.astGeneric(e.right,t)}return t.push(")"),t}checkAndUpconvertBitwiseUnary(e,t){const r={"~":"bitwiseNot"}[e.operator];if(!r)return null;switch(t.push(r),t.push("("),this.getType(e.argument)){case"Number":case"Float":this.castValueToInteger(e.argument,t);break;case"LiteralInteger":this.castLiteralToInteger(e.argument,t);break;default:this.astGeneric(e.argument,t)}return t.push(")"),t}castLiteralToInteger(e,t){return this.pushState("casting-to-integer"),this.astGeneric(e,t),this.popState("casting-to-integer"),t}castLiteralToFloat(e,t){return this.pushState("casting-to-float"),this.astGeneric(e,t),this.popState("casting-to-float"),t}castValueToInteger(e,t){return this.pushState("casting-to-integer"),t.push("int("),this.astGeneric(e,t),t.push(")"),this.popState("casting-to-integer"),t}castValueToFloat(e,t){return this.pushState("casting-to-float"),t.push("float("),this.astGeneric(e,t),t.push(")"),this.popState("casting-to-float"),t}astIdentifierExpression(e,t){if("Identifier"!==e.type)throw this.astErrorOutput("IdentifierExpression - not an Identifier",e);const r=this.getType(e),i=n.sanitizeName(e.name);return"Infinity"===e.name?t.push("3.402823466e+38"):"Boolean"===r&&this.argumentNames.indexOf(i)>-1?t.push(`bool(user_${i})`):t.push(`user_${i}`),t}astForStatement(e,t){if("ForStatement"!==e.type)throw this.astErrorOutput("Invalid for statement",e);const r=[],n=[],i=[],s=[];let a=null;if(e.init){const{declarations:t}=e.init;t.length>1&&(a=!1),this.astGeneric(e.init,r);for(let e=0;e0&&t.push(r.join(""),"\n"),t.push(`for (int ${e}=0;${e}0&&t.push(`if (!${n.join("")}) break;\n`),t.push(s.join("")),t.push(`\n${i.join("")};`),t.push("}\n")}return t}astWhileStatement(e,t){if("WhileStatement"!==e.type)throw this.astErrorOutput("Invalid while statement",e);const r=this.getInternalVariableName("safeI");return t.push(`for (int ${r}=0;${r}0&&o.push(u.join(",")),i.push(o.join(";")),t.push(i.join("")),t.push(";"),t}astIfStatement(e,t){return t.push("if ("),this.astGeneric(e.test,t),t.push(")"),"BlockStatement"===e.consequent.type?this.astGeneric(e.consequent,t):(t.push(" {\n"),this.astGeneric(e.consequent,t),t.push("\n}\n")),e.alternate&&(t.push("else "),"BlockStatement"===e.alternate.type||"IfStatement"===e.alternate.type?this.astGeneric(e.alternate,t):(t.push(" {\n"),this.astGeneric(e.alternate,t),t.push("\n}\n"))),t}astSwitchStatement(e,t){if("SwitchStatement"!==e.type)throw this.astErrorOutput("Invalid switch statement",e);const{discriminant:r,cases:n}=e,i=this.getType(r),s=`switchDiscriminant${this.astKey(e,"_")}`;switch(i){case"Float":case"Number":t.push(`float ${s} = `),this.astGeneric(r,t),t.push(";\n");break;case"Integer":t.push(`int ${s} = `),this.astGeneric(r,t),t.push(";\n")}if(1===n.length&&!n[0].test)return this.astGeneric(n[0].consequent,t),t;let a=!1,o=[],u=!1,l=!1;for(let e=0;ee+1){u=!0,this.astGeneric(n[e].consequent,o);continue}t.push(" else {\n")}this.astGeneric(n[e].consequent,t),t.push("\n}")}return u&&(t.push(" else {"),t.push(o.join("")),t.push("}")),t}astThisExpression(e,t){return t.push("this"),t}astMemberExpression(e,t){const{property:r,name:i,signature:s,origin:a,type:o,xProperty:u,yProperty:l,zProperty:c}=this.getMemberExpressionDetails(e);switch(s){case"value.thread.value":case"this.thread.value":if("x"!==i&&"y"!==i&&"z"!==i)throw this.astErrorOutput("Unexpected expression, expected `this.thread.x`, `this.thread.y`, or `this.thread.z`",e);return t.push(`threadId.${i}`),t;case"this.output.value":if(this.dynamicOutput)switch(i){case"x":this.isState("casting-to-float")?t.push("float(uOutputDim.x)"):t.push("uOutputDim.x");break;case"y":this.isState("casting-to-float")?t.push("float(uOutputDim.y)"):t.push("uOutputDim.y");break;case"z":this.isState("casting-to-float")?t.push("float(uOutputDim.z)"):t.push("uOutputDim.z");break;default:throw this.astErrorOutput("Unexpected expression",e)}else switch(i){case"x":this.isState("casting-to-integer")?t.push(this.output[0]):t.push(this.output[0],".0");break;case"y":this.isState("casting-to-integer")?t.push(this.output[1]):t.push(this.output[1],".0");break;case"z":this.isState("casting-to-integer")?t.push(this.output[2]):t.push(this.output[2],".0");break;default:throw this.astErrorOutput("Unexpected expression",e)}return t;case"value":throw this.astErrorOutput("Unexpected expression",e);case"value[]":case"value[][]":case"value[][][]":case"value[][][][]":case"value.value":if("Math"===a)return t.push(Math[i]),t;const l=n.sanitizeName(i);switch(r){case"r":return t.push(`user_${l}.r`),t;case"g":return t.push(`user_${l}.g`),t;case"b":return t.push(`user_${l}.b`),t;case"a":return t.push(`user_${l}.a`),t}break;case"this.constants.value":if(void 0===u)switch(o){case"Array(2)":case"Array(3)":case"Array(4)":return t.push(`constants_${n.sanitizeName(i)}`),t}case"this.constants.value[]":case"this.constants.value[][]":case"this.constants.value[][][]":case"this.constants.value[][][][]":break;case"fn()[]":return this.astCallExpression(e.object,t),t.push("["),t.push(this.memberExpressionPropertyMarkup(r)),t.push("]"),t;case"fn()[][]":return this.astCallExpression(e.object.object,t),t.push("["),t.push(this.memberExpressionPropertyMarkup(e.object.property)),t.push("]"),t.push("["),t.push(this.memberExpressionPropertyMarkup(e.property)),t.push("]"),t;case"[][]":return this.astArrayExpression(e.object,t),t.push("["),t.push(this.memberExpressionPropertyMarkup(r)),t.push("]"),t;default:throw this.astErrorOutput("Unexpected expression",e)}if(!1===e.computed)switch(o){case"Number":case"Integer":case"Float":case"Boolean":return t.push(`${a}_${n.sanitizeName(i)}`),t}const h=`${a}_${n.sanitizeName(i)}`;switch(o){case"Array(2)":case"Array(3)":case"Array(4)":this.astGeneric(e.object,t),t.push("["),t.push(this.memberExpressionPropertyMarkup(u)),t.push("]");break;case"HTMLImageArray":t.push(`getImage3D(${h}, ${h}Size, ${h}Dim, `),this.memberExpressionXYZ(u,l,c,t),t.push(")");break;case"ArrayTexture(1)":t.push(`getFloatFromSampler2D(${h}, ${h}Size, ${h}Dim, `),this.memberExpressionXYZ(u,l,c,t),t.push(")");break;case"Array1D(2)":case"Array2D(2)":case"Array3D(2)":t.push(`getMemoryOptimizedVec2(${h}, ${h}Size, ${h}Dim, `),this.memberExpressionXYZ(u,l,c,t),t.push(")");break;case"ArrayTexture(2)":t.push(`getVec2FromSampler2D(${h}, ${h}Size, ${h}Dim, `),this.memberExpressionXYZ(u,l,c,t),t.push(")");break;case"Array1D(3)":case"Array2D(3)":case"Array3D(3)":t.push(`getMemoryOptimizedVec3(${h}, ${h}Size, ${h}Dim, `),this.memberExpressionXYZ(u,l,c,t),t.push(")");break;case"ArrayTexture(3)":t.push(`getVec3FromSampler2D(${h}, ${h}Size, ${h}Dim, `),this.memberExpressionXYZ(u,l,c,t),t.push(")");break;case"Array1D(4)":case"Array2D(4)":case"Array3D(4)":t.push(`getMemoryOptimizedVec4(${h}, ${h}Size, ${h}Dim, `),this.memberExpressionXYZ(u,l,c,t),t.push(")");break;case"ArrayTexture(4)":case"HTMLCanvas":case"OffscreenCanvas":case"HTMLImage":case"ImageBitmap":case"ImageData":case"HTMLVideo":t.push(`getVec4FromSampler2D(${h}, ${h}Size, ${h}Dim, `),this.memberExpressionXYZ(u,l,c,t),t.push(")");break;case"NumberTexture":case"Array":case"Array2D":case"Array3D":case"Array4D":case"Input":case"Number":case"Float":case"Integer":if("single"===this.precision)t.push(`getMemoryOptimized32(${h}, ${h}Size, ${h}Dim, `),this.memberExpressionXYZ(u,l,c,t),t.push(")");else{const e="user"===a?this.lookupFunctionArgumentBitRatio(this.name,i):this.constantBitRatios[i];switch(e){case 1:t.push(`get8(${h}, ${h}Size, ${h}Dim, `);break;case 2:t.push(`get16(${h}, ${h}Size, ${h}Dim, `);break;case 4:case 0:t.push(`get32(${h}, ${h}Size, ${h}Dim, `);break;default:throw new Error(`unhandled bit ratio of ${e}`)}this.memberExpressionXYZ(u,l,c,t),t.push(")")}break;case"MemoryOptimizedNumberTexture":t.push(`getMemoryOptimized32(${h}, ${h}Size, ${h}Dim, `),this.memberExpressionXYZ(u,l,c,t),t.push(")");break;case"Matrix(2)":case"Matrix(3)":case"Matrix(4)":t.push(`${h}[${this.memberExpressionPropertyMarkup(l)}]`),l&&t.push(`[${this.memberExpressionPropertyMarkup(u)}]`);break;default:throw new Error(`unhandled member expression "${o}"`)}return t}astCallExpression(e,t){if(!e.callee)throw this.astErrorOutput("Unknown CallExpression",e);let r=null;const i=this.isAstMathFunction(e);if(!(r=i||e.callee.object&&"ThisExpression"===e.callee.object.type?e.callee.property.name:"SequenceExpression"!==e.callee.type||"Literal"!==e.callee.expressions[0].type||isNaN(e.callee.expressions[0].raw)?e.callee.name:e.callee.expressions[1].property.name))throw this.astErrorOutput("Unhandled function, couldn't find name",e);switch(r){case"pow":r="_pow";break;case"round":r="_round"}if(this.calledFunctions.indexOf(r)<0&&this.calledFunctions.push(r),"random"===r&&this.plugins&&this.plugins.length>0)for(let e=0;e0&&t.push(", "),i){case"Integer":this.castValueToFloat(n,t);break;default:this.astGeneric(n,t)}}else{const i=this.lookupFunctionArgumentTypes(r)||[];for(let s=0;s0&&t.push(", ");const u=this.getType(a);switch(o||(this.triggerImplyArgumentType(r,s,u,this),o=u),u){case"Boolean":this.astGeneric(a,t);continue;case"Number":case"Float":if("Integer"===o){t.push("int("),this.astGeneric(a,t),t.push(")");continue}if("Number"===o||"Float"===o){this.astGeneric(a,t);continue}if("LiteralInteger"===o){this.castLiteralToFloat(a,t);continue}break;case"Integer":if("Number"===o||"Float"===o){t.push("float("),this.astGeneric(a,t),t.push(")");continue}if("Integer"===o){this.astGeneric(a,t);continue}break;case"LiteralInteger":if("Integer"===o){this.castLiteralToInteger(a,t);continue}if("Number"===o||"Float"===o){this.castLiteralToFloat(a,t);continue}if("LiteralInteger"===o){this.astGeneric(a,t);continue}break;case"Array(2)":case"Array(3)":case"Array(4)":if(o===u){if("Identifier"===a.type)t.push(`user_${n.sanitizeName(a.name)}`);else{if("ArrayExpression"!==a.type&&"MemberExpression"!==a.type&&"CallExpression"!==a.type)throw this.astErrorOutput(`Unhandled argument type ${a.type}`,e);this.astGeneric(a,t)}continue}break;case"HTMLCanvas":case"OffscreenCanvas":case"HTMLImage":case"ImageBitmap":case"ImageData":case"HTMLImageArray":case"HTMLVideo":case"ArrayTexture(1)":case"ArrayTexture(2)":case"ArrayTexture(3)":case"ArrayTexture(4)":case"Array":case"Input":if(o===u){if("Identifier"!==a.type)throw this.astErrorOutput(`Unhandled argument type ${a.type}`,e);this.triggerImplyArgumentBitRatio(this.name,a.name,r,s);const i=n.sanitizeName(a.name);t.push(`user_${i},user_${i}Size,user_${i}Dim`);continue}}throw this.astErrorOutput(`Unhandled argument combination of ${u} and ${o} for argument named "${a.name}"`,e)}}return t.push(")"),t}astArrayExpression(e,t){const r=this.getType(e),n=e.elements.length;switch(r){case"Matrix(2)":case"Matrix(3)":case"Matrix(4)":t.push(`mat${n}(`);break;default:t.push(`vec${n}(`)}for(let r=0;r0&&t.push(", ");const n=e.elements[r];this.astGeneric(n,t)}return t.push(")"),t}memberExpressionXYZ(e,t,r,n){return r?n.push(this.memberExpressionPropertyMarkup(r),", "):n.push("0, "),t?n.push(this.memberExpressionPropertyMarkup(t),", "):n.push("0, "),n.push(this.memberExpressionPropertyMarkup(e)),n}memberExpressionPropertyMarkup(e){if(!e)throw new Error("Property not set");const t=[];switch(this.getType(e)){case"Number":case"Float":this.castValueToInteger(e,t);break;case"LiteralInteger":this.castLiteralToInteger(e,t);break;default:this.astGeneric(e,t)}return t.join("")}}}},{"../../utils":164,"../function-node":62}],91:[function(e,t,r){const{WebGLKernelValueBoolean:n}=e("./kernel-value/boolean"),{WebGLKernelValueFloat:i}=e("./kernel-value/float"),{WebGLKernelValueInteger:s}=e("./kernel-value/integer"),{WebGLKernelValueHTMLImage:a}=e("./kernel-value/html-image"),{WebGLKernelValueDynamicHTMLImage:o}=e("./kernel-value/dynamic-html-image"),{WebGLKernelValueHTMLVideo:u}=e("./kernel-value/html-video"),{WebGLKernelValueDynamicHTMLVideo:l}=e("./kernel-value/dynamic-html-video"),{WebGLKernelValueSingleInput:c}=e("./kernel-value/single-input"),{WebGLKernelValueDynamicSingleInput:h}=e("./kernel-value/dynamic-single-input"),{WebGLKernelValueUnsignedInput:p}=e("./kernel-value/unsigned-input"),{WebGLKernelValueDynamicUnsignedInput:f}=e("./kernel-value/dynamic-unsigned-input"),{WebGLKernelValueMemoryOptimizedNumberTexture:d}=e("./kernel-value/memory-optimized-number-texture"),{WebGLKernelValueDynamicMemoryOptimizedNumberTexture:g}=e("./kernel-value/dynamic-memory-optimized-number-texture"),{WebGLKernelValueNumberTexture:m}=e("./kernel-value/number-texture"),{WebGLKernelValueDynamicNumberTexture:_}=e("./kernel-value/dynamic-number-texture"),{WebGLKernelValueSingleArray:x}=e("./kernel-value/single-array"),{WebGLKernelValueDynamicSingleArray:y}=e("./kernel-value/dynamic-single-array"),{WebGLKernelValueSingleArray1DI:b}=e("./kernel-value/single-array1d-i"),{WebGLKernelValueDynamicSingleArray1DI:T}=e("./kernel-value/dynamic-single-array1d-i"),{WebGLKernelValueSingleArray2DI:v}=e("./kernel-value/single-array2d-i"),{WebGLKernelValueDynamicSingleArray2DI:E}=e("./kernel-value/dynamic-single-array2d-i"),{WebGLKernelValueSingleArray3DI:A}=e("./kernel-value/single-array3d-i"),{WebGLKernelValueDynamicSingleArray3DI:S}=e("./kernel-value/dynamic-single-array3d-i"),{WebGLKernelValueArray2:w}=e("./kernel-value/array2"),{WebGLKernelValueArray3:I}=e("./kernel-value/array3"),{WebGLKernelValueArray4:L}=e("./kernel-value/array4"),{WebGLKernelValueUnsignedArray:R}=e("./kernel-value/unsigned-array"),{WebGLKernelValueDynamicUnsignedArray:D}=e("./kernel-value/dynamic-unsigned-array"),k={unsigned:{dynamic:{Boolean:n,Integer:s,Float:i,Array:D,"Array(2)":w,"Array(3)":I,"Array(4)":L,"Array1D(2)":!1,"Array1D(3)":!1,"Array1D(4)":!1,"Array2D(2)":!1,"Array2D(3)":!1,"Array2D(4)":!1,"Array3D(2)":!1,"Array3D(3)":!1,"Array3D(4)":!1,Input:f,NumberTexture:_,"ArrayTexture(1)":_,"ArrayTexture(2)":_,"ArrayTexture(3)":_,"ArrayTexture(4)":_,MemoryOptimizedNumberTexture:g,HTMLCanvas:o,OffscreenCanvas:o,HTMLImage:o,ImageBitmap:o,ImageData:o,HTMLImageArray:!1,HTMLVideo:l},static:{Boolean:n,Float:i,Integer:s,Array:R,"Array(2)":w,"Array(3)":I,"Array(4)":L,"Array1D(2)":!1,"Array1D(3)":!1,"Array1D(4)":!1,"Array2D(2)":!1,"Array2D(3)":!1,"Array2D(4)":!1,"Array3D(2)":!1,"Array3D(3)":!1,"Array3D(4)":!1,Input:p,NumberTexture:m,"ArrayTexture(1)":m,"ArrayTexture(2)":m,"ArrayTexture(3)":m,"ArrayTexture(4)":m,MemoryOptimizedNumberTexture:d,HTMLCanvas:a,OffscreenCanvas:a,HTMLImage:a,ImageBitmap:a,ImageData:a,HTMLImageArray:!1,HTMLVideo:u}},single:{dynamic:{Boolean:n,Integer:s,Float:i,Array:y,"Array(2)":w,"Array(3)":I,"Array(4)":L,"Array1D(2)":T,"Array1D(3)":T,"Array1D(4)":T,"Array2D(2)":E,"Array2D(3)":E,"Array2D(4)":E,"Array3D(2)":S,"Array3D(3)":S,"Array3D(4)":S,Input:h,NumberTexture:_,"ArrayTexture(1)":_,"ArrayTexture(2)":_,"ArrayTexture(3)":_,"ArrayTexture(4)":_,MemoryOptimizedNumberTexture:g,HTMLCanvas:o,OffscreenCanvas:o,HTMLImage:o,ImageBitmap:o,ImageData:o,HTMLImageArray:!1,HTMLVideo:l},static:{Boolean:n,Float:i,Integer:s,Array:x,"Array(2)":w,"Array(3)":I,"Array(4)":L,"Array1D(2)":b,"Array1D(3)":b,"Array1D(4)":b,"Array2D(2)":v,"Array2D(3)":v,"Array2D(4)":v,"Array3D(2)":A,"Array3D(3)":A,"Array3D(4)":A,Input:c,NumberTexture:m,"ArrayTexture(1)":m,"ArrayTexture(2)":m,"ArrayTexture(3)":m,"ArrayTexture(4)":m,MemoryOptimizedNumberTexture:d,HTMLCanvas:a,OffscreenCanvas:a,HTMLImage:a,ImageBitmap:a,ImageData:a,HTMLImageArray:!1,HTMLVideo:u}}};t.exports={lookupKernelValueType:function(e,t,r,n){if(!e)throw new Error("type missing");if(!t)throw new Error("dynamic missing");if(!r)throw new Error("precision missing");n.type&&(e=n.type);const i=k[r][t];if(!1===i[e])return null;if(void 0===i[e])throw new Error(`Could not find a KernelValue for ${e}`);return i[e]},kernelValueMaps:k}},{"./kernel-value/array2":93,"./kernel-value/array3":94,"./kernel-value/array4":95,"./kernel-value/boolean":96,"./kernel-value/dynamic-html-image":97,"./kernel-value/dynamic-html-video":98,"./kernel-value/dynamic-memory-optimized-number-texture":99,"./kernel-value/dynamic-number-texture":100,"./kernel-value/dynamic-single-array":101,"./kernel-value/dynamic-single-array1d-i":102,"./kernel-value/dynamic-single-array2d-i":103,"./kernel-value/dynamic-single-array3d-i":104,"./kernel-value/dynamic-single-input":105,"./kernel-value/dynamic-unsigned-array":106,"./kernel-value/dynamic-unsigned-input":107,"./kernel-value/float":108,"./kernel-value/html-image":109,"./kernel-value/html-video":110,"./kernel-value/integer":112,"./kernel-value/memory-optimized-number-texture":113,"./kernel-value/number-texture":114,"./kernel-value/single-array":115,"./kernel-value/single-array1d-i":116,"./kernel-value/single-array2d-i":117,"./kernel-value/single-array3d-i":118,"./kernel-value/single-input":119,"./kernel-value/unsigned-array":120,"./kernel-value/unsigned-input":121}],92:[function(e,t,r){const{WebGLKernelValue:n}=e("./index"),{Input:i}=e("../../../input");t.exports={WebGLKernelArray:class extends n{checkSize(e,t){if(!this.kernel.validate)return;const{maxTextureSize:r}=this.kernel.constructor.features;if(e>r||t>r)throw e>t?new Error(`Argument texture width of ${e} larger than maximum size of ${r} for your GPU`):ee===n.name)&&t.push(n)}return t}initExtensions(){this.extensions={OES_texture_float:this.context.getExtension("OES_texture_float"),OES_texture_float_linear:this.context.getExtension("OES_texture_float_linear"),OES_element_index_uint:this.context.getExtension("OES_element_index_uint"),WEBGL_draw_buffers:this.context.getExtension("WEBGL_draw_buffers"),WEBGL_color_buffer_float:this.context.getExtension("WEBGL_color_buffer_float")}}validateSettings(e){if(!this.validate)return void(this.texSize=a.getKernelTextureSize({optimizeFloatMemory:this.optimizeFloatMemory,precision:this.precision},this.output));const{features:t}=this.constructor;if(!0===this.optimizeFloatMemory&&!t.isTextureFloat)throw new Error("Float textures are not supported");if("single"===this.precision&&!t.isFloatRead)throw new Error("Single precision not supported");if(!this.graphical&&null===this.precision&&t.isTextureFloat&&(this.precision=t.isFloatRead?"single":"unsigned"),this.subKernels&&this.subKernels.length>0&&!this.extensions.WEBGL_draw_buffers)throw new Error("could not instantiate draw buffers extension");if(null===this.fixIntegerDivisionAccuracy?this.fixIntegerDivisionAccuracy=!t.isIntegerDivisionAccurate:this.fixIntegerDivisionAccuracy&&t.isIntegerDivisionAccurate&&(this.fixIntegerDivisionAccuracy=!1),this.checkOutput(),!this.output||0===this.output.length){if(1!==e.length)throw new Error("Auto output only supported for kernels with only one input");const t=a.getVariableType(e[0],this.strictIntegers);switch(t){case"Array":this.output=a.getDimensions(t);break;case"NumberTexture":case"MemoryOptimizedNumberTexture":case"ArrayTexture(1)":case"ArrayTexture(2)":case"ArrayTexture(3)":case"ArrayTexture(4)":this.output=e[0].output;break;default:throw new Error("Auto output not supported for input type: "+t)}}if(this.graphical){if(2!==this.output.length)throw new Error("Output must have 2 dimensions on graphical mode");return"precision"===this.precision&&(this.precision="unsigned",console.warn("Cannot use graphical mode and single precision at the same time")),void(this.texSize=a.clone(this.output))}null===this.precision&&t.isTextureFloat&&(this.precision="single"),this.texSize=a.getKernelTextureSize({optimizeFloatMemory:this.optimizeFloatMemory,precision:this.precision},this.output),this.checkTextureSize()}updateMaxTexSize(){const{texSize:e,canvas:t}=this;if(null===this.maxTexSize){let r=x.indexOf(t);-1===r&&(r=x.length,x.push(t),y[r]=[e[0],e[1]]),this.maxTexSize=y[r]}this.maxTexSize[0]this.argumentNames.length)throw new Error("too many arguments for kernel");const{context:r}=this;let n=0;const i=()=>this.createTexture(),s=()=>this.constantTextureCount+n++,o=e=>{this.switchKernels({type:"argumentMismatch",needed:e})},u=()=>r.TEXTURE0+this.constantTextureCount+this.argumentTextureCount++;for(let n=0;nthis.createTexture(),onRequestIndex:()=>n++,onRequestContextHandle:()=>t.TEXTURE0+this.constantTextureCount++});this.constantBitRatios[i]=l.bitRatio,this.kernelConstants.push(l),l.setup(),l.forceUploadEachRun&&this.forceUploadKernelConstants.push(l)}}build(){if(this.built)return;if(this.initExtensions(),this.validateSettings(arguments),this.setupConstants(arguments),this.fallbackRequested)return;if(this.setupArguments(arguments),this.fallbackRequested)return;this.updateMaxTexSize(),this.translateSource();const e=this.pickRenderStrategy(arguments);if(e)return e;const{texSize:t,context:r,canvas:n}=this;r.enable(r.SCISSOR_TEST),this.pipeline&&this.precision,r.viewport(0,0,this.maxTexSize[0],this.maxTexSize[1]),n.width=this.maxTexSize[0],n.height=this.maxTexSize[1];const i=this.threadDim=Array.from(this.output);for(;i.length<3;)i.push(1);const s=this.getVertexShader(arguments),a=r.createShader(r.VERTEX_SHADER);r.shaderSource(a,s),r.compileShader(a),this.vertShader=a;const o=this.getFragmentShader(arguments),u=r.createShader(r.FRAGMENT_SHADER);if(r.shaderSource(u,o),r.compileShader(u),this.fragShader=u,this.debug&&(console.log("GLSL Shader Output:"),console.log(o)),!r.getShaderParameter(a,r.COMPILE_STATUS))throw new Error("Error compiling vertex shader: "+r.getShaderInfoLog(a));if(!r.getShaderParameter(u,r.COMPILE_STATUS))throw new Error("Error compiling fragment shader: "+r.getShaderInfoLog(u));const l=this.program=r.createProgram();r.attachShader(l,a),r.attachShader(l,u),r.linkProgram(l),this.framebuffer=r.createFramebuffer(),this.framebuffer.width=t[0],this.framebuffer.height=t[1],this.rawValueFramebuffers={};const c=new Float32Array([-1,-1,1,-1,-1,1,1,1]),h=new Float32Array([0,0,1,0,0,1,1,1]),p=c.byteLength;let f=this.buffer;f?r.bindBuffer(r.ARRAY_BUFFER,f):(f=this.buffer=r.createBuffer(),r.bindBuffer(r.ARRAY_BUFFER,f),r.bufferData(r.ARRAY_BUFFER,c.byteLength+h.byteLength,r.STATIC_DRAW)),r.bufferSubData(r.ARRAY_BUFFER,0,c),r.bufferSubData(r.ARRAY_BUFFER,p,h);const d=r.getAttribLocation(this.program,"aPos");r.enableVertexAttribArray(d),r.vertexAttribPointer(d,2,r.FLOAT,!1,0,0);const g=r.getAttribLocation(this.program,"aTexCoord");r.enableVertexAttribArray(g),r.vertexAttribPointer(g,2,r.FLOAT,!1,0,p),r.bindFramebuffer(r.FRAMEBUFFER,this.framebuffer);let m=0;r.useProgram(this.program);for(let e in this.constants)this.kernelConstants[m++].updateValue(this.constants[e]);this._setupOutputTexture(),null!==this.subKernels&&this.subKernels.length>0&&(this._mappedTextureSwitched={},this._setupSubOutputTextures()),this.buildSignature(arguments),this.built=!0}translateSource(){const e=i.fromKernel(this,s,{fixIntegerDivisionAccuracy:this.fixIntegerDivisionAccuracy});this.translatedSource=e.getPrototypeString("kernel"),this.setupReturnTypes(e)}setupReturnTypes(e){if(this.graphical||this.returnType||(this.returnType=e.getKernelResultType()),this.subKernels&&this.subKernels.length>0)for(let t=0;te.source&&this.source.match(e.functionMatch)?e.source:"").join("\n"):"\n"}_getConstantsString(){const e=[],{threadDim:t,texSize:r}=this;return this.dynamicOutput?e.push("uniform ivec3 uOutputDim","uniform ivec2 uTexSize"):e.push(`ivec3 uOutputDim = ivec3(${t[0]}, ${t[1]}, ${t[2]})`,`ivec2 uTexSize = ivec2(${r[0]}, ${r[1]})`),a.linesToString(e)}_getTextureCoordinate(){const e=this.subKernels;return null===e||e.length<1?"varying vec2 vTexCoord;\n":"out vec2 vTexCoord;\n"}_getDecode32EndiannessString(){return"LE"===this.endianness?"":" texel.rgba = texel.abgr;\n"}_getEncode32EndiannessString(){return"LE"===this.endianness?"":" texel.rgba = texel.abgr;\n"}_getDivideWithIntegerCheckString(){return this.fixIntegerDivisionAccuracy?"float divWithIntCheck(float x, float y) {\n if (floor(x) == x && floor(y) == y && integerMod(x, y) == 0.0) {\n return float(int(x) / int(y));\n }\n return x / y;\n}\n\nfloat integerCorrectionModulo(float number, float divisor) {\n if (number < 0.0) {\n number = abs(number);\n if (divisor < 0.0) {\n divisor = abs(divisor);\n }\n return -(number - (divisor * floor(divWithIntCheck(number, divisor))));\n }\n if (divisor < 0.0) {\n divisor = abs(divisor);\n }\n return number - (divisor * floor(divWithIntCheck(number, divisor)));\n}":""}_getMainArgumentsString(e){const t=[],{argumentNames:r}=this;for(let n=0;n{if(t.hasOwnProperty(r))return t[r];throw`unhandled artifact ${r}`})}getFragmentShader(e){return null!==this.compiledFragmentShader?this.compiledFragmentShader:this.compiledFragmentShader=this.replaceArtifacts(this.constructor.fragmentShader,this._getFragShaderArtifactMap(e))}getVertexShader(e){return null!==this.compiledVertexShader?this.compiledVertexShader:this.compiledVertexShader=this.replaceArtifacts(this.constructor.vertexShader,this._getVertShaderArtifactMap(e))}toString(){const e=a.linesToString(["const gl = context"]);return c(this.constructor,arguments,this,e)}destroy(e){if(!this.context)return;this.buffer&&this.context.deleteBuffer(this.buffer),this.framebuffer&&this.context.deleteFramebuffer(this.framebuffer);for(const e in this.rawValueFramebuffers){for(const t in this.rawValueFramebuffers[e])this.context.deleteFramebuffer(this.rawValueFramebuffers[e][t]),delete this.rawValueFramebuffers[e][t];delete this.rawValueFramebuffers[e]}if(this.vertShader&&this.context.deleteShader(this.vertShader),this.fragShader&&this.context.deleteShader(this.fragShader),this.program&&this.context.deleteProgram(this.program),this.texture){this.texture.delete();const e=this.textureCache.indexOf(this.texture.texture);e>-1&&this.textureCache.splice(e,1),this.texture=null}if(this.mappedTextures&&this.mappedTextures.length){for(let e=0;e-1&&this.textureCache.splice(r,1)}this.mappedTextures=null}if(this.kernelArguments)for(let e=0;e0;){const e=this.textureCache.pop();this.context.deleteTexture(e)}if(e){const e=x.indexOf(this.canvas);e>=0&&(x[e]=null,y[e]=null)}if(this.destroyExtensions(),delete this.context,delete this.canvas,!this.gpu)return;const t=this.gpu.kernels.indexOf(this);-1!==t&&this.gpu.kernels.splice(t,1)}destroyExtensions(){this.extensions.OES_texture_float=null,this.extensions.OES_texture_float_linear=null,this.extensions.OES_element_index_uint=null,this.extensions.WEBGL_draw_buffers=null}static destroyContext(e){const t=e.getExtension("WEBGL_lose_context");t&&t.loseContext()}toJSON(){const e=super.toJSON();return e.functionNodes=i.fromKernel(this,s).toJSON(),e.settings.threadDim=this.threadDim,e}}}},{"../../plugins/math-random-uniformly-distributed":162,"../../utils":164,"../function-builder":61,"../gl/kernel":65,"../gl/kernel-string":64,"./fragment-shader":89,"./function-node":90,"./kernel-value-maps":91,"./vertex-shader":123}],123:[function(e,t,r){t.exports={vertexShader:"__FLOAT_TACTIC_DECLARATION__;\n__INT_TACTIC_DECLARATION__;\n__SAMPLER_2D_TACTIC_DECLARATION__;\n\nattribute vec2 aPos;\nattribute vec2 aTexCoord;\n\nvarying vec2 vTexCoord;\nuniform vec2 ratio;\n\nvoid main(void) {\n gl_Position = vec4((aPos + vec2(1)) * ratio + vec2(-1), 0, 1);\n vTexCoord = aTexCoord;\n}"}},{}],124:[function(e,t,r){const n=`#version 300 es\n__HEADER__;\n__FLOAT_TACTIC_DECLARATION__;\n__INT_TACTIC_DECLARATION__;\n__SAMPLER_2D_TACTIC_DECLARATION__;\n__SAMPLER_2D_ARRAY_TACTIC_DECLARATION__;\n\nconst int LOOP_MAX = __LOOP_MAX__;\n\n__PLUGINS__;\n__CONSTANTS__;\n\nin vec2 vTexCoord;\n\nfloat atan2(float v1, float v2) {\n if (v1 == 0.0 || v2 == 0.0) return 0.0;\n return atan(v1 / v2);\n}\n\nfloat cbrt(float x) {\n if (x >= 0.0) {\n return pow(x, 1.0 / 3.0);\n } else {\n return -pow(x, 1.0 / 3.0);\n }\n}\n\nfloat expm1(float x) {\n return pow(${Math.E}, x) - 1.0; \n}\n\nfloat fround(highp float x) {\n return x;\n}\n\nfloat imul(float v1, float v2) {\n return float(int(v1) * int(v2));\n}\n\nfloat log10(float x) {\n return log2(x) * (1.0 / log2(10.0));\n}\n\nfloat log1p(float x) {\n return log(1.0 + x);\n}\n\nfloat _pow(float v1, float v2) {\n if (v2 == 0.0) return 1.0;\n return pow(v1, v2);\n}\n\nfloat _round(float x) {\n return floor(x + 0.5);\n}\n\n\nconst int BIT_COUNT = 32;\nint modi(int x, int y) {\n return x - y * (x / y);\n}\n\nint bitwiseOr(int a, int b) {\n int result = 0;\n int n = 1;\n \n for (int i = 0; i < BIT_COUNT; i++) {\n if ((modi(a, 2) == 1) || (modi(b, 2) == 1)) {\n result += n;\n }\n a = a / 2;\n b = b / 2;\n n = n * 2;\n if(!(a > 0 || b > 0)) {\n break;\n }\n }\n return result;\n}\nint bitwiseXOR(int a, int b) {\n int result = 0;\n int n = 1;\n \n for (int i = 0; i < BIT_COUNT; i++) {\n if ((modi(a, 2) == 1) != (modi(b, 2) == 1)) {\n result += n;\n }\n a = a / 2;\n b = b / 2;\n n = n * 2;\n if(!(a > 0 || b > 0)) {\n break;\n }\n }\n return result;\n}\nint bitwiseAnd(int a, int b) {\n int result = 0;\n int n = 1;\n for (int i = 0; i < BIT_COUNT; i++) {\n if ((modi(a, 2) == 1) && (modi(b, 2) == 1)) {\n result += n;\n }\n a = a / 2;\n b = b / 2;\n n = n * 2;\n if(!(a > 0 && b > 0)) {\n break;\n }\n }\n return result;\n}\nint bitwiseNot(int a) {\n int result = 0;\n int n = 1;\n \n for (int i = 0; i < BIT_COUNT; i++) {\n if (modi(a, 2) == 0) {\n result += n; \n }\n a = a / 2;\n n = n * 2;\n }\n return result;\n}\nint bitwiseZeroFillLeftShift(int n, int shift) {\n int maxBytes = BIT_COUNT;\n for (int i = 0; i < BIT_COUNT; i++) {\n if (maxBytes >= n) {\n break;\n }\n maxBytes *= 2;\n }\n for (int i = 0; i < BIT_COUNT; i++) {\n if (i >= shift) {\n break;\n }\n n *= 2;\n }\n\n int result = 0;\n int byteVal = 1;\n for (int i = 0; i < BIT_COUNT; i++) {\n if (i >= maxBytes) break;\n if (modi(n, 2) > 0) { result += byteVal; }\n n = int(n / 2);\n byteVal *= 2;\n }\n return result;\n}\n\nint bitwiseSignedRightShift(int num, int shifts) {\n return int(floor(float(num) / pow(2.0, float(shifts))));\n}\n\nint bitwiseZeroFillRightShift(int n, int shift) {\n int maxBytes = BIT_COUNT;\n for (int i = 0; i < BIT_COUNT; i++) {\n if (maxBytes >= n) {\n break;\n }\n maxBytes *= 2;\n }\n for (int i = 0; i < BIT_COUNT; i++) {\n if (i >= shift) {\n break;\n }\n n /= 2;\n }\n int result = 0;\n int byteVal = 1;\n for (int i = 0; i < BIT_COUNT; i++) {\n if (i >= maxBytes) break;\n if (modi(n, 2) > 0) { result += byteVal; }\n n = int(n / 2);\n byteVal *= 2;\n }\n return result;\n}\n\nvec2 integerMod(vec2 x, float y) {\n vec2 res = floor(mod(x, y));\n return res * step(1.0 - floor(y), -res);\n}\n\nvec3 integerMod(vec3 x, float y) {\n vec3 res = floor(mod(x, y));\n return res * step(1.0 - floor(y), -res);\n}\n\nvec4 integerMod(vec4 x, vec4 y) {\n vec4 res = floor(mod(x, y));\n return res * step(1.0 - floor(y), -res);\n}\n\nfloat integerMod(float x, float y) {\n float res = floor(mod(x, y));\n return res * (res > floor(y) - 1.0 ? 0.0 : 1.0);\n}\n\nint integerMod(int x, int y) {\n return x - (y * int(x/y));\n}\n\n__DIVIDE_WITH_INTEGER_CHECK__;\n\n// Here be dragons!\n// DO NOT OPTIMIZE THIS CODE\n// YOU WILL BREAK SOMETHING ON SOMEBODY'S MACHINE\n// LEAVE IT AS IT IS, LEST YOU WASTE YOUR OWN TIME\nconst vec2 MAGIC_VEC = vec2(1.0, -256.0);\nconst vec4 SCALE_FACTOR = vec4(1.0, 256.0, 65536.0, 0.0);\nconst vec4 SCALE_FACTOR_INV = vec4(1.0, 0.00390625, 0.0000152587890625, 0.0); // 1, 1/256, 1/65536\nfloat decode32(vec4 texel) {\n __DECODE32_ENDIANNESS__;\n texel *= 255.0;\n vec2 gte128;\n gte128.x = texel.b >= 128.0 ? 1.0 : 0.0;\n gte128.y = texel.a >= 128.0 ? 1.0 : 0.0;\n float exponent = 2.0 * texel.a - 127.0 + dot(gte128, MAGIC_VEC);\n float res = exp2(round(exponent));\n texel.b = texel.b - 128.0 * gte128.x;\n res = dot(texel, SCALE_FACTOR) * exp2(round(exponent-23.0)) + res;\n res *= gte128.y * -2.0 + 1.0;\n return res;\n}\n\nfloat decode16(vec4 texel, int index) {\n int channel = integerMod(index, 2);\n return texel[channel*2] * 255.0 + texel[channel*2 + 1] * 65280.0;\n}\n\nfloat decode8(vec4 texel, int index) {\n int channel = integerMod(index, 4);\n return texel[channel] * 255.0;\n}\n\nvec4 legacyEncode32(float f) {\n float F = abs(f);\n float sign = f < 0.0 ? 1.0 : 0.0;\n float exponent = floor(log2(F));\n float mantissa = (exp2(-exponent) * F);\n // exponent += floor(log2(mantissa));\n vec4 texel = vec4(F * exp2(23.0-exponent)) * SCALE_FACTOR_INV;\n texel.rg = integerMod(texel.rg, 256.0);\n texel.b = integerMod(texel.b, 128.0);\n texel.a = exponent*0.5 + 63.5;\n texel.ba += vec2(integerMod(exponent+127.0, 2.0), sign) * 128.0;\n texel = floor(texel);\n texel *= 0.003921569; // 1/255\n __ENCODE32_ENDIANNESS__;\n return texel;\n}\n\n// https://github.com/gpujs/gpu.js/wiki/Encoder-details\nvec4 encode32(float value) {\n if (value == 0.0) return vec4(0, 0, 0, 0);\n\n float exponent;\n float mantissa;\n vec4 result;\n float sgn;\n\n sgn = step(0.0, -value);\n value = abs(value);\n\n exponent = floor(log2(value));\n\n mantissa = value*pow(2.0, -exponent)-1.0;\n exponent = exponent+127.0;\n result = vec4(0,0,0,0);\n\n result.a = floor(exponent/2.0);\n exponent = exponent - result.a*2.0;\n result.a = result.a + 128.0*sgn;\n\n result.b = floor(mantissa * 128.0);\n mantissa = mantissa - result.b / 128.0;\n result.b = result.b + exponent*128.0;\n\n result.g = floor(mantissa*32768.0);\n mantissa = mantissa - result.g/32768.0;\n\n result.r = floor(mantissa*8388608.0);\n return result/255.0;\n}\n// Dragons end here\n\nint index;\nivec3 threadId;\n\nivec3 indexTo3D(int idx, ivec3 texDim) {\n int z = int(idx / (texDim.x * texDim.y));\n idx -= z * int(texDim.x * texDim.y);\n int y = int(idx / texDim.x);\n int x = int(integerMod(idx, texDim.x));\n return ivec3(x, y, z);\n}\n\nfloat get32(sampler2D tex, ivec2 texSize, ivec3 texDim, int z, int y, int x) {\n int index = x + texDim.x * (y + texDim.y * z);\n int w = texSize.x;\n vec2 st = vec2(float(integerMod(index, w)), float(index / w)) + 0.5;\n vec4 texel = texture(tex, st / vec2(texSize));\n return decode32(texel);\n}\n\nfloat get16(sampler2D tex, ivec2 texSize, ivec3 texDim, int z, int y, int x) {\n int index = x + (texDim.x * (y + (texDim.y * z)));\n int w = texSize.x * 2;\n vec2 st = vec2(float(integerMod(index, w)), float(index / w)) + 0.5;\n vec4 texel = texture(tex, st / vec2(texSize.x * 2, texSize.y));\n return decode16(texel, index);\n}\n\nfloat get8(sampler2D tex, ivec2 texSize, ivec3 texDim, int z, int y, int x) {\n int index = x + (texDim.x * (y + (texDim.y * z)));\n int w = texSize.x * 4;\n vec2 st = vec2(float(integerMod(index, w)), float(index / w)) + 0.5;\n vec4 texel = texture(tex, st / vec2(texSize.x * 4, texSize.y));\n return decode8(texel, index);\n}\n\nfloat getMemoryOptimized32(sampler2D tex, ivec2 texSize, ivec3 texDim, int z, int y, int x) {\n int index = x + (texDim.x * (y + (texDim.y * z)));\n int channel = integerMod(index, 4);\n index = index / 4;\n int w = texSize.x;\n vec2 st = vec2(float(integerMod(index, w)), float(index / w)) + 0.5;\n index = index / 4;\n vec4 texel = texture(tex, st / vec2(texSize));\n return texel[channel];\n}\n\nvec4 getImage2D(sampler2D tex, ivec2 texSize, ivec3 texDim, int z, int y, int x) {\n int index = x + texDim.x * (y + texDim.y * z);\n int w = texSize.x;\n vec2 st = vec2(float(integerMod(index, w)), float(index / w)) + 0.5;\n return texture(tex, st / vec2(texSize));\n}\n\nvec4 getImage3D(sampler2DArray tex, ivec2 texSize, ivec3 texDim, int z, int y, int x) {\n int index = x + texDim.x * (y + texDim.y * z);\n int w = texSize.x;\n vec2 st = vec2(float(integerMod(index, w)), float(index / w)) + 0.5;\n return texture(tex, vec3(st / vec2(texSize), z));\n}\n\nfloat getFloatFromSampler2D(sampler2D tex, ivec2 texSize, ivec3 texDim, int z, int y, int x) {\n vec4 result = getImage2D(tex, texSize, texDim, z, y, x);\n return result[0];\n}\n\nvec2 getVec2FromSampler2D(sampler2D tex, ivec2 texSize, ivec3 texDim, int z, int y, int x) {\n vec4 result = getImage2D(tex, texSize, texDim, z, y, x);\n return vec2(result[0], result[1]);\n}\n\nvec2 getMemoryOptimizedVec2(sampler2D tex, ivec2 texSize, ivec3 texDim, int z, int y, int x) {\n int index = x + texDim.x * (y + texDim.y * z);\n int channel = integerMod(index, 2);\n index = index / 2;\n int w = texSize.x;\n vec2 st = vec2(float(integerMod(index, w)), float(index / w)) + 0.5;\n vec4 texel = texture(tex, st / vec2(texSize));\n if (channel == 0) return vec2(texel.r, texel.g);\n if (channel == 1) return vec2(texel.b, texel.a);\n return vec2(0.0, 0.0);\n}\n\nvec3 getVec3FromSampler2D(sampler2D tex, ivec2 texSize, ivec3 texDim, int z, int y, int x) {\n vec4 result = getImage2D(tex, texSize, texDim, z, y, x);\n return vec3(result[0], result[1], result[2]);\n}\n\nvec3 getMemoryOptimizedVec3(sampler2D tex, ivec2 texSize, ivec3 texDim, int z, int y, int x) {\n int fieldIndex = 3 * (x + texDim.x * (y + texDim.y * z));\n int vectorIndex = fieldIndex / 4;\n int vectorOffset = fieldIndex - vectorIndex * 4;\n int readY = vectorIndex / texSize.x;\n int readX = vectorIndex - readY * texSize.x;\n vec4 tex1 = texture(tex, (vec2(readX, readY) + 0.5) / vec2(texSize));\n\n if (vectorOffset == 0) {\n return tex1.xyz;\n } else if (vectorOffset == 1) {\n return tex1.yzw;\n } else {\n readX++;\n if (readX >= texSize.x) {\n readX = 0;\n readY++;\n }\n vec4 tex2 = texture(tex, vec2(readX, readY) / vec2(texSize));\n if (vectorOffset == 2) {\n return vec3(tex1.z, tex1.w, tex2.x);\n } else {\n return vec3(tex1.w, tex2.x, tex2.y);\n }\n }\n}\n\nvec4 getVec4FromSampler2D(sampler2D tex, ivec2 texSize, ivec3 texDim, int z, int y, int x) {\n return getImage2D(tex, texSize, texDim, z, y, x);\n}\n\nvec4 getMemoryOptimizedVec4(sampler2D tex, ivec2 texSize, ivec3 texDim, int z, int y, int x) {\n int index = x + texDim.x * (y + texDim.y * z);\n int channel = integerMod(index, 2);\n int w = texSize.x;\n vec2 st = vec2(float(integerMod(index, w)), float(index / w)) + 0.5;\n vec4 texel = texture(tex, st / vec2(texSize));\n return vec4(texel.r, texel.g, texel.b, texel.a);\n}\n\nvec4 actualColor;\nvoid color(float r, float g, float b, float a) {\n actualColor = vec4(r,g,b,a);\n}\n\nvoid color(float r, float g, float b) {\n color(r,g,b,1.0);\n}\n\nfloat modulo(float number, float divisor) {\n if (number < 0.0) {\n number = abs(number);\n if (divisor < 0.0) {\n divisor = abs(divisor);\n }\n return -mod(number, divisor);\n }\n if (divisor < 0.0) {\n divisor = abs(divisor);\n }\n return mod(number, divisor);\n}\n\n__INJECTED_NATIVE__;\n__MAIN_CONSTANTS__;\n__MAIN_ARGUMENTS__;\n__KERNEL__;\n\nvoid main(void) {\n index = int(vTexCoord.s * float(uTexSize.x)) + int(vTexCoord.t * float(uTexSize.y)) * uTexSize.x;\n __MAIN_RESULT__;\n}`;t.exports={fragmentShader:n}},{}],125:[function(e,t,r){const{utils:n}=e("../../utils"),{WebGLFunctionNode:i}=e("../web-gl/function-node");t.exports={WebGL2FunctionNode:class extends i{astIdentifierExpression(e,t){if("Identifier"!==e.type)throw this.astErrorOutput("IdentifierExpression - not an Identifier",e);const r=this.getType(e),i=n.sanitizeName(e.name);return"Infinity"===e.name?t.push("intBitsToFloat(2139095039)"):"Boolean"===r&&this.argumentNames.indexOf(i)>-1?t.push(`bool(user_${i})`):t.push(`user_${i}`),t}}}},{"../../utils":164,"../web-gl/function-node":90}],126:[function(e,t,r){const{WebGL2KernelValueBoolean:n}=e("./kernel-value/boolean"),{WebGL2KernelValueFloat:i}=e("./kernel-value/float"),{WebGL2KernelValueInteger:s}=e("./kernel-value/integer"),{WebGL2KernelValueHTMLImage:a}=e("./kernel-value/html-image"),{WebGL2KernelValueDynamicHTMLImage:o}=e("./kernel-value/dynamic-html-image"),{WebGL2KernelValueHTMLImageArray:u}=e("./kernel-value/html-image-array"),{WebGL2KernelValueDynamicHTMLImageArray:l}=e("./kernel-value/dynamic-html-image-array"),{WebGL2KernelValueHTMLVideo:c}=e("./kernel-value/html-video"),{WebGL2KernelValueDynamicHTMLVideo:h}=e("./kernel-value/dynamic-html-video"),{WebGL2KernelValueSingleInput:p}=e("./kernel-value/single-input"),{WebGL2KernelValueDynamicSingleInput:f}=e("./kernel-value/dynamic-single-input"),{WebGL2KernelValueUnsignedInput:d}=e("./kernel-value/unsigned-input"),{WebGL2KernelValueDynamicUnsignedInput:g}=e("./kernel-value/dynamic-unsigned-input"),{WebGL2KernelValueMemoryOptimizedNumberTexture:m}=e("./kernel-value/memory-optimized-number-texture"),{WebGL2KernelValueDynamicMemoryOptimizedNumberTexture:_}=e("./kernel-value/dynamic-memory-optimized-number-texture"),{WebGL2KernelValueNumberTexture:x}=e("./kernel-value/number-texture"),{WebGL2KernelValueDynamicNumberTexture:y}=e("./kernel-value/dynamic-number-texture"),{WebGL2KernelValueSingleArray:b}=e("./kernel-value/single-array"),{WebGL2KernelValueDynamicSingleArray:T}=e("./kernel-value/dynamic-single-array"),{WebGL2KernelValueSingleArray1DI:v}=e("./kernel-value/single-array1d-i"),{WebGL2KernelValueDynamicSingleArray1DI:E}=e("./kernel-value/dynamic-single-array1d-i"),{WebGL2KernelValueSingleArray2DI:A}=e("./kernel-value/single-array2d-i"),{WebGL2KernelValueDynamicSingleArray2DI:S}=e("./kernel-value/dynamic-single-array2d-i"),{WebGL2KernelValueSingleArray3DI:w}=e("./kernel-value/single-array3d-i"),{WebGL2KernelValueDynamicSingleArray3DI:I}=e("./kernel-value/dynamic-single-array3d-i"),{WebGL2KernelValueArray2:L}=e("./kernel-value/array2"),{WebGL2KernelValueArray3:R}=e("./kernel-value/array3"),{WebGL2KernelValueArray4:D}=e("./kernel-value/array4"),{WebGL2KernelValueUnsignedArray:k}=e("./kernel-value/unsigned-array"),{WebGL2KernelValueDynamicUnsignedArray:C}=e("./kernel-value/dynamic-unsigned-array"),N={unsigned:{dynamic:{Boolean:n,Integer:s,Float:i,Array:C,"Array(2)":L,"Array(3)":R,"Array(4)":D,"Array1D(2)":!1,"Array1D(3)":!1,"Array1D(4)":!1,"Array2D(2)":!1,"Array2D(3)":!1,"Array2D(4)":!1,"Array3D(2)":!1,"Array3D(3)":!1,"Array3D(4)":!1,Input:g,NumberTexture:y,"ArrayTexture(1)":y,"ArrayTexture(2)":y,"ArrayTexture(3)":y,"ArrayTexture(4)":y,MemoryOptimizedNumberTexture:_,HTMLCanvas:o,OffscreenCanvas:o,HTMLImage:o,ImageBitmap:o,ImageData:o,HTMLImageArray:l,HTMLVideo:h},static:{Boolean:n,Float:i,Integer:s,Array:k,"Array(2)":L,"Array(3)":R,"Array(4)":D,"Array1D(2)":!1,"Array1D(3)":!1,"Array1D(4)":!1,"Array2D(2)":!1,"Array2D(3)":!1,"Array2D(4)":!1,"Array3D(2)":!1,"Array3D(3)":!1,"Array3D(4)":!1,Input:d,NumberTexture:x,"ArrayTexture(1)":x,"ArrayTexture(2)":x,"ArrayTexture(3)":x,"ArrayTexture(4)":x,MemoryOptimizedNumberTexture:_,HTMLCanvas:a,OffscreenCanvas:a,HTMLImage:a,ImageBitmap:a,ImageData:a,HTMLImageArray:u,HTMLVideo:c}},single:{dynamic:{Boolean:n,Integer:s,Float:i,Array:T,"Array(2)":L,"Array(3)":R,"Array(4)":D,"Array1D(2)":E,"Array1D(3)":E,"Array1D(4)":E,"Array2D(2)":S,"Array2D(3)":S,"Array2D(4)":S,"Array3D(2)":I,"Array3D(3)":I,"Array3D(4)":I,Input:f,NumberTexture:y,"ArrayTexture(1)":y,"ArrayTexture(2)":y,"ArrayTexture(3)":y,"ArrayTexture(4)":y,MemoryOptimizedNumberTexture:_,HTMLCanvas:o,OffscreenCanvas:o,HTMLImage:o,ImageBitmap:o,ImageData:o,HTMLImageArray:l,HTMLVideo:h},static:{Boolean:n,Float:i,Integer:s,Array:b,"Array(2)":L,"Array(3)":R,"Array(4)":D,"Array1D(2)":v,"Array1D(3)":v,"Array1D(4)":v,"Array2D(2)":A,"Array2D(3)":A,"Array2D(4)":A,"Array3D(2)":w,"Array3D(3)":w,"Array3D(4)":w,Input:p,NumberTexture:x,"ArrayTexture(1)":x,"ArrayTexture(2)":x,"ArrayTexture(3)":x,"ArrayTexture(4)":x,MemoryOptimizedNumberTexture:m,HTMLCanvas:a,OffscreenCanvas:a,HTMLImage:a,ImageBitmap:a,ImageData:a,HTMLImageArray:u,HTMLVideo:c}}};t.exports={kernelValueMaps:N,lookupKernelValueType:function(e,t,r,n){if(!e)throw new Error("type missing");if(!t)throw new Error("dynamic missing");if(!r)throw new Error("precision missing");n.type&&(e=n.type);const i=N[r][t];if(!1===i[e])return null;if(void 0===i[e])throw new Error(`Could not find a KernelValue for ${e}`);return i[e]}}},{"./kernel-value/array2":127,"./kernel-value/array3":128,"./kernel-value/array4":129,"./kernel-value/boolean":130,"./kernel-value/dynamic-html-image":132,"./kernel-value/dynamic-html-image-array":131,"./kernel-value/dynamic-html-video":133,"./kernel-value/dynamic-memory-optimized-number-texture":134,"./kernel-value/dynamic-number-texture":135,"./kernel-value/dynamic-single-array":136,"./kernel-value/dynamic-single-array1d-i":137,"./kernel-value/dynamic-single-array2d-i":138,"./kernel-value/dynamic-single-array3d-i":139,"./kernel-value/dynamic-single-input":140,"./kernel-value/dynamic-unsigned-array":141,"./kernel-value/dynamic-unsigned-input":142,"./kernel-value/float":143,"./kernel-value/html-image":145,"./kernel-value/html-image-array":144,"./kernel-value/html-video":146,"./kernel-value/integer":147,"./kernel-value/memory-optimized-number-texture":148,"./kernel-value/number-texture":149,"./kernel-value/single-array":150,"./kernel-value/single-array1d-i":151,"./kernel-value/single-array2d-i":152,"./kernel-value/single-array3d-i":153,"./kernel-value/single-input":154,"./kernel-value/unsigned-array":155,"./kernel-value/unsigned-input":156}],127:[function(e,t,r){const{WebGLKernelValueArray2:n}=e("../../web-gl/kernel-value/array2");t.exports={WebGL2KernelValueArray2:class extends n{}}},{"../../web-gl/kernel-value/array2":93}],128:[function(e,t,r){const{WebGLKernelValueArray3:n}=e("../../web-gl/kernel-value/array3");t.exports={WebGL2KernelValueArray3:class extends n{}}},{"../../web-gl/kernel-value/array3":94}],129:[function(e,t,r){const{WebGLKernelValueArray4:n}=e("../../web-gl/kernel-value/array4");t.exports={WebGL2KernelValueArray4:class extends n{}}},{"../../web-gl/kernel-value/array4":95}],130:[function(e,t,r){const{WebGLKernelValueBoolean:n}=e("../../web-gl/kernel-value/boolean");t.exports={WebGL2KernelValueBoolean:class extends n{}}},{"../../web-gl/kernel-value/boolean":96}],131:[function(e,t,r){const{utils:n}=e("../../../utils"),{WebGL2KernelValueHTMLImageArray:i}=e("./html-image-array");t.exports={WebGL2KernelValueDynamicHTMLImageArray:class extends i{getSource(){const e=this.getVariablePrecisionString();return n.linesToString([`uniform ${e} sampler2DArray ${this.id}`,`uniform ${e} ivec2 ${this.sizeId}`,`uniform ${e} ivec3 ${this.dimensionsId}`])}updateValue(e){const{width:t,height:r}=e[0];this.checkSize(t,r),this.dimensions=[t,r,e.length],this.textureSize=[t,r],this.kernel.setUniform3iv(this.dimensionsId,this.dimensions),this.kernel.setUniform2iv(this.sizeId,this.textureSize),super.updateValue(e)}}}},{"../../../utils":164,"./html-image-array":144}],132:[function(e,t,r){const{utils:n}=e("../../../utils"),{WebGLKernelValueDynamicHTMLImage:i}=e("../../web-gl/kernel-value/dynamic-html-image");t.exports={WebGL2KernelValueDynamicHTMLImage:class extends i{getSource(){const e=this.getVariablePrecisionString();return n.linesToString([`uniform ${e} sampler2D ${this.id}`,`uniform ${e} ivec2 ${this.sizeId}`,`uniform ${e} ivec3 ${this.dimensionsId}`])}}}},{"../../../utils":164,"../../web-gl/kernel-value/dynamic-html-image":97}],133:[function(e,t,r){const{utils:n}=e("../../../utils"),{WebGL2KernelValueDynamicHTMLImage:i}=e("./dynamic-html-image");t.exports={WebGL2KernelValueDynamicHTMLVideo:class extends i{}}},{"../../../utils":164,"./dynamic-html-image":132}],134:[function(e,t,r){const{utils:n}=e("../../../utils"),{WebGLKernelValueDynamicMemoryOptimizedNumberTexture:i}=e("../../web-gl/kernel-value/dynamic-memory-optimized-number-texture");t.exports={WebGL2KernelValueDynamicMemoryOptimizedNumberTexture:class extends i{getSource(){return n.linesToString([`uniform sampler2D ${this.id}`,`uniform ivec2 ${this.sizeId}`,`uniform ivec3 ${this.dimensionsId}`])}}}},{"../../../utils":164,"../../web-gl/kernel-value/dynamic-memory-optimized-number-texture":99}],135:[function(e,t,r){const{utils:n}=e("../../../utils"),{WebGLKernelValueDynamicNumberTexture:i}=e("../../web-gl/kernel-value/dynamic-number-texture");t.exports={WebGL2KernelValueDynamicNumberTexture:class extends i{getSource(){const e=this.getVariablePrecisionString();return n.linesToString([`uniform ${e} sampler2D ${this.id}`,`uniform ${e} ivec2 ${this.sizeId}`,`uniform ${e} ivec3 ${this.dimensionsId}`])}}}},{"../../../utils":164,"../../web-gl/kernel-value/dynamic-number-texture":100}],136:[function(e,t,r){const{utils:n}=e("../../../utils"),{WebGL2KernelValueSingleArray:i}=e("../../web-gl2/kernel-value/single-array");t.exports={WebGL2KernelValueDynamicSingleArray:class extends i{getSource(){const e=this.getVariablePrecisionString();return n.linesToString([`uniform ${e} sampler2D ${this.id}`,`uniform ${e} ivec2 ${this.sizeId}`,`uniform ${e} ivec3 ${this.dimensionsId}`])}updateValue(e){this.dimensions=n.getDimensions(e,!0),this.textureSize=n.getMemoryOptimizedFloatTextureSize(this.dimensions,this.bitRatio),this.uploadArrayLength=this.textureSize[0]*this.textureSize[1]*this.bitRatio,this.checkSize(this.textureSize[0],this.textureSize[1]),this.uploadValue=new Float32Array(this.uploadArrayLength),this.kernel.setUniform3iv(this.dimensionsId,this.dimensions),this.kernel.setUniform2iv(this.sizeId,this.textureSize),super.updateValue(e)}}}},{"../../../utils":164,"../../web-gl2/kernel-value/single-array":150}],137:[function(e,t,r){const{utils:n}=e("../../../utils"),{WebGL2KernelValueSingleArray1DI:i}=e("../../web-gl2/kernel-value/single-array1d-i");t.exports={WebGL2KernelValueDynamicSingleArray1DI:class extends i{getSource(){const e=this.getVariablePrecisionString();return n.linesToString([`uniform ${e} sampler2D ${this.id}`,`uniform ${e} ivec2 ${this.sizeId}`,`uniform ${e} ivec3 ${this.dimensionsId}`])}updateValue(e){this.setShape(e),this.kernel.setUniform3iv(this.dimensionsId,this.dimensions),this.kernel.setUniform2iv(this.sizeId,this.textureSize),super.updateValue(e)}}}},{"../../../utils":164,"../../web-gl2/kernel-value/single-array1d-i":151}],138:[function(e,t,r){const{utils:n}=e("../../../utils"),{WebGL2KernelValueSingleArray2DI:i}=e("../../web-gl2/kernel-value/single-array2d-i");t.exports={WebGL2KernelValueDynamicSingleArray2DI:class extends i{getSource(){const e=this.getVariablePrecisionString();return n.linesToString([`uniform ${e} sampler2D ${this.id}`,`uniform ${e} ivec2 ${this.sizeId}`,`uniform ${e} ivec3 ${this.dimensionsId}`])}updateValue(e){this.setShape(e),this.kernel.setUniform3iv(this.dimensionsId,this.dimensions),this.kernel.setUniform2iv(this.sizeId,this.textureSize),super.updateValue(e)}}}},{"../../../utils":164,"../../web-gl2/kernel-value/single-array2d-i":152}],139:[function(e,t,r){const{utils:n}=e("../../../utils"),{WebGL2KernelValueSingleArray3DI:i}=e("../../web-gl2/kernel-value/single-array3d-i");t.exports={WebGL2KernelValueDynamicSingleArray3DI:class extends i{getSource(){const e=this.getVariablePrecisionString();return n.linesToString([`uniform ${e} sampler2D ${this.id}`,`uniform ${e} ivec2 ${this.sizeId}`,`uniform ${e} ivec3 ${this.dimensionsId}`])}updateValue(e){this.setShape(e),this.kernel.setUniform3iv(this.dimensionsId,this.dimensions),this.kernel.setUniform2iv(this.sizeId,this.textureSize),super.updateValue(e)}}}},{"../../../utils":164,"../../web-gl2/kernel-value/single-array3d-i":153}],140:[function(e,t,r){const{utils:n}=e("../../../utils"),{WebGL2KernelValueSingleInput:i}=e("../../web-gl2/kernel-value/single-input");t.exports={WebGL2KernelValueDynamicSingleInput:class extends i{getSource(){const e=this.getVariablePrecisionString();return n.linesToString([`uniform ${e} sampler2D ${this.id}`,`uniform ${e} ivec2 ${this.sizeId}`,`uniform ${e} ivec3 ${this.dimensionsId}`])}updateValue(e){let[t,r,i]=e.size;this.dimensions=new Int32Array([t||1,r||1,i||1]),this.textureSize=n.getMemoryOptimizedFloatTextureSize(this.dimensions,this.bitRatio),this.uploadArrayLength=this.textureSize[0]*this.textureSize[1]*this.bitRatio,this.checkSize(this.textureSize[0],this.textureSize[1]),this.uploadValue=new Float32Array(this.uploadArrayLength),this.kernel.setUniform3iv(this.dimensionsId,this.dimensions),this.kernel.setUniform2iv(this.sizeId,this.textureSize),super.updateValue(e)}}}},{"../../../utils":164,"../../web-gl2/kernel-value/single-input":154}],141:[function(e,t,r){const{utils:n}=e("../../../utils"),{WebGLKernelValueDynamicUnsignedArray:i}=e("../../web-gl/kernel-value/dynamic-unsigned-array");t.exports={WebGL2KernelValueDynamicUnsignedArray:class extends i{getSource(){const e=this.getVariablePrecisionString();return n.linesToString([`uniform ${e} sampler2D ${this.id}`,`uniform ${e} ivec2 ${this.sizeId}`,`uniform ${e} ivec3 ${this.dimensionsId}`])}}}},{"../../../utils":164,"../../web-gl/kernel-value/dynamic-unsigned-array":106}],142:[function(e,t,r){const{utils:n}=e("../../../utils"),{WebGLKernelValueDynamicUnsignedInput:i}=e("../../web-gl/kernel-value/dynamic-unsigned-input");t.exports={WebGL2KernelValueDynamicUnsignedInput:class extends i{getSource(){const e=this.getVariablePrecisionString();return n.linesToString([`uniform ${e} sampler2D ${this.id}`,`uniform ${e} ivec2 ${this.sizeId}`,`uniform ${e} ivec3 ${this.dimensionsId}`])}}}},{"../../../utils":164,"../../web-gl/kernel-value/dynamic-unsigned-input":107}],143:[function(e,t,r){const{utils:n}=e("../../../utils"),{WebGLKernelValueFloat:i}=e("../../web-gl/kernel-value/float");t.exports={WebGL2KernelValueFloat:class extends i{}}},{"../../../utils":164,"../../web-gl/kernel-value/float":108}],144:[function(e,t,r){const{utils:n}=e("../../../utils"),{WebGLKernelArray:i}=e("../../web-gl/kernel-value/array");t.exports={WebGL2KernelValueHTMLImageArray:class extends i{constructor(e,t){super(e,t),this.checkSize(e[0].width,e[0].height),this.dimensions=[e[0].width,e[0].height,e.length],this.textureSize=[e[0].width,e[0].height]}defineTexture(){const{context:e}=this;e.activeTexture(this.contextHandle),e.bindTexture(e.TEXTURE_2D_ARRAY,this.texture),e.texParameteri(e.TEXTURE_2D_ARRAY,e.TEXTURE_MAG_FILTER,e.NEAREST),e.texParameteri(e.TEXTURE_2D_ARRAY,e.TEXTURE_MIN_FILTER,e.NEAREST)}getStringValueHandler(){return`const uploadValue_${this.name} = ${this.varName};\n`}getSource(){const e=this.getVariablePrecisionString();return n.linesToString([`uniform ${e} sampler2DArray ${this.id}`,`${e} ivec2 ${this.sizeId} = ivec2(${this.textureSize[0]}, ${this.textureSize[1]})`,`${e} ivec3 ${this.dimensionsId} = ivec3(${this.dimensions[0]}, ${this.dimensions[1]}, ${this.dimensions[2]})`])}updateValue(e){const{context:t}=this;t.activeTexture(this.contextHandle),t.bindTexture(t.TEXTURE_2D_ARRAY,this.texture),t.pixelStorei(t.UNPACK_FLIP_Y_WEBGL,!0),t.texImage3D(t.TEXTURE_2D_ARRAY,0,t.RGBA,e[0].width,e[0].height,e.length,0,t.RGBA,t.UNSIGNED_BYTE,null);for(let r=0;re.isSupported)}static get isKernelMapSupported(){return h.some(e=>e.isSupported&&e.features.kernelMap)}static get isOffscreenCanvasSupported(){return"undefined"!=typeof Worker&&"undefined"!=typeof OffscreenCanvas||"undefined"!=typeof importScripts}static get isWebGLSupported(){return l.isSupported}static get isWebGL2Supported(){return u.isSupported}static get isHeadlessGLSupported(){return o.isSupported}static get isCanvasSupported(){return"undefined"!=typeof HTMLCanvasElement}static get isGPUHTMLImageArraySupported(){return u.isSupported}static get isSinglePrecisionSupported(){return h.some(e=>e.isSupported&&e.features.isFloatRead&&e.features.isTextureFloat)}constructor(e){if(e=e||{},this.canvas=e.canvas||null,this.context=e.context||null,this.mode=e.mode,this.Kernel=null,this.kernels=[],this.functions=[],this.nativeFunctions=[],this.injectedNative=null,"dev"!==this.mode){if(this.chooseKernel(),e.functions)for(let t=0;tt.argumentTypes[e]));const l=Object.assign({context:this.context,canvas:this.canvas,functions:this.functions,nativeFunctions:this.nativeFunctions,injectedNative:this.injectedNative,gpu:this,validate:d,onRequestFallback:u,onRequestSwitchKernel:function t(n,i,a){a.debug&&console.warn("Switching kernels");let o=null;if(a.signature&&!s[a.signature]&&(s[a.signature]=a),a.dynamicOutput)for(let e=n.length-1;e>=0;e--){const t=n[e];"outputPrecisionMismatch"===t.type&&(o=t.needed)}const l=a.constructor,c=l.getArgumentTypes(a,i),h=l.getSignature(a,c),f=s[h];if(f)return f.onActivate(a),f;const g=s[h]=new l(e,{argumentTypes:c,constantTypes:a.constantTypes,graphical:a.graphical,loopMaxIterations:a.loopMaxIterations,constants:a.constants,dynamicOutput:a.dynamicOutput,dynamicArgument:a.dynamicArguments,context:a.context,canvas:a.canvas,output:o||a.output,precision:a.precision,pipeline:a.pipeline,immutable:a.immutable,optimizeFloatMemory:a.optimizeFloatMemory,fixIntegerDivisionAccuracy:a.fixIntegerDivisionAccuracy,functions:a.functions,nativeFunctions:a.nativeFunctions,injectedNative:a.injectedNative,subKernels:a.subKernels,strictIntegers:a.strictIntegers,debug:a.debug,gpu:a.gpu,validate:d,returnType:a.returnType,tactic:a.tactic,onRequestFallback:u,onRequestSwitchKernel:t,texture:a.texture,mappedTextures:a.mappedTextures,drawBuffersMap:a.drawBuffersMap});return g.build.apply(g,i),p.replaceKernel(g),r.push(g),g}},o),h=new this.Kernel(e,l),p=c(h);return this.canvas||(this.canvas=h.canvas),this.context||(this.context=h.context),r.push(h),p}createKernelMap(){let e,t;const r=typeof arguments[arguments.length-2];if("function"===r||"string"===r?(e=arguments[arguments.length-2],t=arguments[arguments.length-1]):e=arguments[arguments.length-1],"dev"!==this.mode&&(!this.Kernel.isSupported||!this.Kernel.features.kernelMap)&&this.mode&&p.indexOf(this.mode)<0)throw new Error(`kernelMap not supported on ${this.Kernel.name}`);const n=g(t);if(t&&"object"==typeof t.argumentTypes&&(n.argumentTypes=Object.keys(t.argumentTypes).map(e=>t.argumentTypes[e])),Array.isArray(arguments[0])){n.subKernels=[];const e=arguments[0];for(let t=0;t0)throw new Error('Cannot call "addNativeFunction" after "createKernels" has been called.');return this.nativeFunctions.push(Object.assign({name:e,source:t},r)),this}injectNative(e){return this.injectedNative=e,this}destroy(){return new Promise((e,t)=>{this.kernels||e(),setTimeout(()=>{try{for(let e=0;et.kernel[i]),t.__defineSetter__(i,e=>{t.kernel[i]=e})))}t.kernel=e}t.exports={kernelRunShortcut:function(e){let t=function(){return e.build.apply(e,arguments),(t=function(){let t=e.run.apply(e,arguments);if(e.switchingKernels){const n=e.resetSwitchingKernels(),i=e.onRequestSwitchKernel(n,arguments,e);r.kernel=e=i,t=i.run.apply(i,arguments)}return e.renderKernels?e.renderKernels():e.renderOutput?e.renderOutput():t}).apply(e,arguments)};const r=function(){return t.apply(e,arguments)};return r.exec=function(){return new Promise((e,r)=>{try{e(t.apply(this,arguments))}catch(e){r(e)}})},r.replaceKernel=function(t){i(e=t,r)},i(e,r),r}}},{"./utils":164}],162:[function(e,t,r){const n={name:"math-random-uniformly-distributed",onBeforeRun:e=>{e.setUniform1f("randomSeed1",Math.random()),e.setUniform1f("randomSeed2",Math.random())},functionMatch:"Math.random()",functionReplace:"nrand(vTexCoord)",functionReturnType:"Number",source:"// https://www.shadertoy.com/view/4t2SDh\n//note: uniformly distributed, normalized rand, [0,1]\nhighp float randomSeedShift = 1.0;\nhighp float slide = 1.0;\nuniform highp float randomSeed1;\nuniform highp float randomSeed2;\n\nhighp float nrand(highp vec2 n) {\n highp float result = fract(sin(dot((n.xy + 1.0) * vec2(randomSeed1 * slide, randomSeed2 * randomSeedShift), vec2(12.9898, 78.233))) * 43758.5453);\n randomSeedShift = result;\n if (randomSeedShift > 0.5) {\n slide += 0.00009; \n } else {\n slide += 0.0009;\n }\n return result;\n}"};t.exports=n},{}],163:[function(e,t,r){t.exports={Texture:class{constructor(e){const{texture:t,size:r,dimensions:n,output:i,context:s,type:a="NumberTexture",kernel:o,internalFormat:u,textureFormat:l}=e;if(!i)throw new Error('settings property "output" required.');if(!s)throw new Error('settings property "context" required.');if(!t)throw new Error('settings property "texture" required.');if(!o)throw new Error('settings property "kernel" required.');this.texture=t,t._refs?t._refs++:t._refs=1,this.size=r,this.dimensions=n,this.output=i,this.context=s,this.kernel=o,this.type=a,this._deleted=!1,this.internalFormat=u,this.textureFormat=l}toArray(){throw new Error(`Not implemented on ${this.constructor.name}`)}clone(){throw new Error(`Not implemented on ${this.constructor.name}`)}delete(){throw new Error(`Not implemented on ${this.constructor.name}`)}clear(){throw new Error(`Not implemented on ${this.constructor.name}`)}}}},{}],164:[function(e,t,r){const n=e("acorn"),{Input:i}=e("./input"),{Texture:s}=e("./texture"),a=/function ([^(]*)/,o=/((\/\/.*$)|(\/\*[\s\S]*?\*\/))/gm,u=/([^\s,]+)/g,l={systemEndianness:()=>f,getSystemEndianness(){const e=new ArrayBuffer(4),t=new Uint32Array(e),r=new Uint8Array(e);if(t[0]=3735928559,239===r[0])return"LE";if(222===r[0])return"BE";throw new Error("unknown endianness")},isFunction:e=>"function"==typeof e,isFunctionString:e=>"string"==typeof e&&"function"===e.slice(0,"function".length).toLowerCase(),getFunctionNameFromString(e){const t=a.exec(e);return t&&0!==t.length?t[1].trim():null},getFunctionBodyFromString:e=>e.substring(e.indexOf("{")+1,e.lastIndexOf("}")),getArgumentNamesFromString(e){const t=e.replace(o,"");let r=t.slice(t.indexOf("(")+1,t.indexOf(")")).match(u);return null===r&&(r=[]),r},clone(e){if(null===e||"object"!=typeof e||e.hasOwnProperty("isActiveClone"))return e;const t=e.constructor();for(let r in e)Object.prototype.hasOwnProperty.call(e,r)&&(e.isActiveClone=null,t[r]=l.clone(e[r]),delete e.isActiveClone);return t},isArray:e=>!isNaN(e.length),getVariableType(e,t){if(l.isArray(e))return e.length>0&&"IMG"===e[0].nodeName?"HTMLImageArray":"Array";switch(e.constructor){case Boolean:return"Boolean";case Number:return t&&Number.isInteger(e)?"Integer":"Float";case s:return e.type;case i:return"Input";case OffscreenCanvas:return"OffscreenCanvas";case ImageBitmap:return"ImageBitmap";case ImageData:return"ImageData"}switch(e.nodeName){case"IMG":case"CANVAS":return"HTMLImage";case"VIDEO":return"HTMLVideo"}return e.hasOwnProperty("type")?e.type:"Unknown"},getKernelTextureSize(e,t){let[r,n,i]=t,s=(r||1)*(n||1)*(i||1);return e.optimizeFloatMemory&&"single"===e.precision&&(r=s=Math.ceil(s/4)),n>1&&r*n===s?new Int32Array([r,n]):l.closestSquareDimensions(s)},closestSquareDimensions(e){const t=Math.sqrt(e);let r=Math.ceil(t),n=Math.floor(t);for(;r*nMath.floor((e+t-1)/t)*t,getDimensions(e,t){let r;if(l.isArray(e)){const t=[];let n=e;for(;l.isArray(n);)t.push(n.length),n=n[0];r=t.reverse()}else if(e instanceof s)r=e.output;else{if(!(e instanceof i))throw new Error(`Unknown dimensions of ${e}`);r=e.size}if(t)for(r=Array.from(r);r.length<3;)r.push(1);return new Int32Array(r)},flatten2dArrayTo(e,t){let r=0;for(let n=0;ne.length>0?e.join(";\n")+";\n":"\n",warnDeprecated(e,t,r){r?console.warn(`You are using a deprecated ${e} "${t}". It has been replaced with "${r}". Fixing, but please upgrade as it will soon be removed.`):console.warn(`You are using a deprecated ${e} "${t}". It has been removed. Fixing, but please upgrade as it will soon be removed.`)},flipPixels:(e,t,r)=>{const n=r/2|0,i=4*t,s=new Uint8ClampedArray(4*t),a=e.slice(0);for(let e=0;ee.subarray(0,t),erect2DPackedFloat:(e,t,r)=>{const n=new Array(r);for(let i=0;i{const i=new Array(n);for(let s=0;se.subarray(0,t),erectMemoryOptimized2DFloat:(e,t,r)=>{const n=new Array(r);for(let i=0;i{const i=new Array(n);for(let s=0;s{const r=new Float32Array(t);let n=0;for(let i=0;i{const n=new Array(r);let i=0;for(let s=0;s{const i=new Array(n);let s=0;for(let a=0;a{const r=new Array(t),n=4*t;let i=0;for(let t=0;t{const n=new Array(r),i=4*t;for(let s=0;s{const i=4*t,s=new Array(n);for(let a=0;a{const r=new Array(t),n=4*t;let i=0;for(let t=0;t{const n=4*t,i=new Array(r);for(let s=0;s{const i=4*t,s=new Array(n);for(let a=0;a{const r=new Array(e),n=4*t;let i=0;for(let t=0;t{const n=4*t,i=new Array(r);for(let s=0;s{const i=4*t,s=new Array(n);for(let a=0;a{const{findDependency:r,thisLookup:i,doNotDefine:s}=t;let a=t.flattened;a||(a=t.flattened={});const o=[];let u=0;const c=function e(t){if(Array.isArray(t)){const r=[];for(let n=0;nnull!==e);return n.length<1?"":`${t.kind} ${n.join(",")}`;case"VariableDeclarator":return t.init.object&&"ThisExpression"===t.init.object.type?i(t.init.property.name,!0)?`${t.id.name} = ${e(t.init)}`:null:`${t.id.name} = ${e(t.init)}`;case"CallExpression":if("subarray"===t.callee.property.name)return`${e(t.callee.object)}.${e(t.callee.property)}(${t.arguments.map(t=>e(t)).join(", ")})`;if("gl"===t.callee.object.name||"context"===t.callee.object.name)return`${e(t.callee.object)}.${e(t.callee.property)}(${t.arguments.map(t=>e(t)).join(", ")})`;if("ThisExpression"===t.callee.object.type)return o.push(r("this",t.callee.property.name)),`${t.callee.property.name}(${t.arguments.map(t=>e(t)).join(", ")})`;if(t.callee.object.name){const n=r(t.callee.object.name,t.callee.property.name);return null===n?`${t.callee.object.name}.${t.callee.property.name}(${t.arguments.map(t=>e(t)).join(", ")})`:(o.push(n),`${t.callee.property.name}(${t.arguments.map(t=>e(t)).join(", ")})`)}if("MemberExpression"===t.callee.object.type)return`${e(t.callee.object)}.${t.callee.property.name}(${t.arguments.map(t=>e(t)).join(", ")})`;throw new Error("unknown ast.callee");case"ReturnStatement":return`return ${e(t.argument)}`;case"BinaryExpression":return`(${e(t.left)}${t.operator}${e(t.right)})`;case"UnaryExpression":return t.prefix?`${t.operator} ${e(t.argument)}`:`${e(t.argument)} ${t.operator}`;case"ExpressionStatement":return`${e(t.expression)}`;case"SequenceExpression":return`(${e(t.expressions)})`;case"ArrowFunctionExpression":return`(${t.params.map(e).join(", ")}) => ${e(t.body)}`;case"Literal":return t.raw;case"Identifier":return t.name;case"MemberExpression":return"ThisExpression"===t.object.type?i(t.property.name):t.computed?`${e(t.object)}[${e(t.property)}]`:e(t.object)+"."+e(t.property);case"ThisExpression":return"this";case"NewExpression":return`new ${e(t.callee)}(${t.arguments.map(t=>e(t)).join(", ")})`;case"ForStatement":return`for (${e(t.init)};${e(t.test)};${e(t.update)}) ${e(t.body)}`;case"AssignmentExpression":return`${e(t.left)}${t.operator}${e(t.right)}`;case"UpdateExpression":return`${e(t.argument)}${t.operator}`;case"IfStatement":return`if (${e(t.test)}) ${e(t.consequent)}`;case"ThrowStatement":return`throw ${e(t.argument)}`;case"ObjectPattern":return t.properties.map(e).join(", ");case"ArrayPattern":return t.elements.map(e).join(", ");case"DebuggerStatement":return"debugger;";case"ConditionalExpression":return`${e(t.test)}?${e(t.consequent)}:${e(t.alternate)}`;case"Property":if("init"===t.kind)return e(t.key)}throw new Error(`unhandled ast.type of ${t.type}`)}(n.parse(e));if(o.length>0){const e=[];for(let r=0;r{if("VariableDeclaration"!==e.type)throw new Error('Ast is not of type "VariableDeclaration"');const t=[];for(let r=0;r{const r=e.createKernel(function(e){return 255*e[this.thread.y][this.thread.x].r},{output:[t.width,t.height],precision:"unsigned",argumentTypes:{a:"HTMLImage"}}),n=e.createKernel(function(e){return 255*e[this.thread.y][this.thread.x].g},{output:[t.width,t.height],precision:"unsigned",argumentTypes:{a:"HTMLImage"}}),i=e.createKernel(function(e){return 255*e[this.thread.y][this.thread.x].b},{output:[t.width,t.height],precision:"unsigned",argumentTypes:{a:"HTMLImage"}}),s=e.createKernel(function(e){return 255*e[this.thread.y][this.thread.x].a},{output:[t.width,t.height],precision:"unsigned",argumentTypes:{a:"HTMLImage"}}),a=[r(t),n(t),i(t),s(t)];return a.rKernel=r,a.gKernel=n,a.bKernel=i,a.aKernel=s,a.gpu=e,a},splitRGBAToCanvases:(e,t,r,n)=>{const i=e.createKernel(function(e){const t=e[this.thread.y][this.thread.x];this.color(t.r/255,0,0,255)},{output:[r,n],graphical:!0,argumentTypes:{v:"Array2D(4)"}});i(t);const s=e.createKernel(function(e){const t=e[this.thread.y][this.thread.x];this.color(0,t.g/255,0,255)},{output:[r,n],graphical:!0,argumentTypes:{v:"Array2D(4)"}});s(t);const a=e.createKernel(function(e){const t=e[this.thread.y][this.thread.x];this.color(0,0,t.b/255,255)},{output:[r,n],graphical:!0,argumentTypes:{v:"Array2D(4)"}});a(t);const o=e.createKernel(function(e){const t=e[this.thread.y][this.thread.x];this.color(255,255,255,t.a/255)},{output:[r,n],graphical:!0,argumentTypes:{v:"Array2D(4)"}});return o(t),[i.canvas,s.canvas,a.canvas,o.canvas]},getMinifySafeName:e=>{try{const t=n.parse(`const value = ${e.toString()}`),{init:r}=t.body[0].declarations[0];return r.body.name||r.body.body[0].argument.name}catch(e){throw new Error("Unrecognized function type. Please use `() => yourFunctionVariableHere` or function() { return yourFunctionVariableHere; }")}},sanitizeName:function(e){return c.test(e)&&(e=e.replace(c,"S_S")),h.test(e)?e=e.replace(h,"U_U"):p.test(e)&&(e=e.replace(p,"u_u")),e}},c=/\$/,h=/__/,p=/_/,f=l.getSystemEndianness();t.exports={utils:l}},{"./input":160,"./texture":163,acorn:11}],165:[function(e,t,r){},{}],166:[function(e,t,r){"use strict";var n=e("base64-js"),i=e("ieee754");r.Buffer=o,r.SlowBuffer=function(e){+e!=e&&(e=0);return o.alloc(+e)},r.INSPECT_MAX_BYTES=50;var s=2147483647;function a(e){if(e>s)throw new RangeError("Invalid typed array length");var t=new Uint8Array(e);return t.__proto__=o.prototype,t}function o(e,t,r){if("number"==typeof e){if("string"==typeof t)throw new Error("If encoding is specified then the first argument must be a string");return c(e)}return u(e,t,r)}function u(e,t,r){if("number"==typeof e)throw new TypeError('"value" argument must not be a number');return $(e)?function(e,t,r){if(t<0||e.byteLength=s)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+s.toString(16)+" bytes");return 0|e}function f(e,t){if(o.isBuffer(e))return e.length;if(B(e)||$(e))return e.byteLength;"string"!=typeof e&&(e=""+e);var r=e.length;if(0===r)return 0;for(var n=!1;;)switch(t){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":case void 0:return V(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return U(e).length;default:if(n)return V(e).length;t=(""+t).toLowerCase(),n=!0}}function d(e,t,r){var n=e[t];e[t]=e[r],e[r]=n}function g(e,t,r,n,i){if(0===e.length)return-1;if("string"==typeof r?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),G(r=+r)&&(r=i?0:e.length-1),r<0&&(r=e.length+r),r>=e.length){if(i)return-1;r=e.length-1}else if(r<0){if(!i)return-1;r=0}if("string"==typeof t&&(t=o.from(t,n)),o.isBuffer(t))return 0===t.length?-1:m(e,t,r,n,i);if("number"==typeof t)return t&=255,"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(e,t,r):Uint8Array.prototype.lastIndexOf.call(e,t,r):m(e,[t],r,n,i);throw new TypeError("val must be string, number or Buffer")}function m(e,t,r,n,i){var s,a=1,o=e.length,u=t.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(e.length<2||t.length<2)return-1;a=2,o/=2,u/=2,r/=2}function l(e,t){return 1===a?e[t]:e.readUInt16BE(t*a)}if(i){var c=-1;for(s=r;so&&(r=o-u),s=r;s>=0;s--){for(var h=!0,p=0;pi&&(n=i):n=i;var s=t.length;if(s%2!=0)throw new TypeError("Invalid hex string");n>s/2&&(n=s/2);for(var a=0;a>8,i=r%256,s.push(i),s.push(n);return s}(t,e.length-r),e,r,n)}function E(e,t,r){return 0===t&&r===e.length?n.fromByteArray(e):n.fromByteArray(e.slice(t,r))}function A(e,t,r){r=Math.min(e.length,r);for(var n=[],i=t;i239?4:l>223?3:l>191?2:1;if(i+h<=r)switch(h){case 1:l<128&&(c=l);break;case 2:128==(192&(s=e[i+1]))&&(u=(31&l)<<6|63&s)>127&&(c=u);break;case 3:s=e[i+1],a=e[i+2],128==(192&s)&&128==(192&a)&&(u=(15&l)<<12|(63&s)<<6|63&a)>2047&&(u<55296||u>57343)&&(c=u);break;case 4:s=e[i+1],a=e[i+2],o=e[i+3],128==(192&s)&&128==(192&a)&&128==(192&o)&&(u=(15&l)<<18|(63&s)<<12|(63&a)<<6|63&o)>65535&&u<1114112&&(c=u)}null===c?(c=65533,h=1):c>65535&&(c-=65536,n.push(c>>>10&1023|55296),c=56320|1023&c),n.push(c),i+=h}return function(e){var t=e.length;if(t<=S)return String.fromCharCode.apply(String,e);var r="",n=0;for(;nthis.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if((r>>>=0)<=(t>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":return L(this,t,r);case"utf8":case"utf-8":return A(this,t,r);case"ascii":return w(this,t,r);case"latin1":case"binary":return I(this,t,r);case"base64":return E(this,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return R(this,t,r);default:if(n)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),n=!0}}.apply(this,arguments)},o.prototype.equals=function(e){if(!o.isBuffer(e))throw new TypeError("Argument must be a Buffer");return this===e||0===o.compare(this,e)},o.prototype.inspect=function(){var e="",t=r.INSPECT_MAX_BYTES;return this.length>0&&(e=this.toString("hex",0,t).match(/.{2}/g).join(" "),this.length>t&&(e+=" ... ")),""},o.prototype.compare=function(e,t,r,n,i){if(!o.isBuffer(e))throw new TypeError("Argument must be a Buffer");if(void 0===t&&(t=0),void 0===r&&(r=e?e.length:0),void 0===n&&(n=0),void 0===i&&(i=this.length),t<0||r>e.length||n<0||i>this.length)throw new RangeError("out of range index");if(n>=i&&t>=r)return 0;if(n>=i)return-1;if(t>=r)return 1;if(t>>>=0,r>>>=0,n>>>=0,i>>>=0,this===e)return 0;for(var s=i-n,a=r-t,u=Math.min(s,a),l=this.slice(n,i),c=e.slice(t,r),h=0;h>>=0,isFinite(r)?(r>>>=0,void 0===n&&(n="utf8")):(n=r,r=void 0)}var i=this.length-t;if((void 0===r||r>i)&&(r=i),e.length>0&&(r<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");for(var s=!1;;)switch(n){case"hex":return _(this,e,t,r);case"utf8":case"utf-8":return x(this,e,t,r);case"ascii":return y(this,e,t,r);case"latin1":case"binary":return b(this,e,t,r);case"base64":return T(this,e,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return v(this,e,t,r);default:if(s)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),s=!0}},o.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var S=4096;function w(e,t,r){var n="";r=Math.min(e.length,r);for(var i=t;in)&&(r=n);for(var i="",s=t;sr)throw new RangeError("Trying to access beyond buffer length")}function k(e,t,r,n,i,s){if(!o.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>i||te.length)throw new RangeError("Index out of range")}function C(e,t,r,n,i,s){if(r+n>e.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function N(e,t,r,n,s){return t=+t,r>>>=0,s||C(e,0,r,4),i.write(e,t,r,n,23,4),r+4}function O(e,t,r,n,s){return t=+t,r>>>=0,s||C(e,0,r,8),i.write(e,t,r,n,52,8),r+8}o.prototype.slice=function(e,t){var r=this.length;e=~~e,t=void 0===t?r:~~t,e<0?(e+=r)<0&&(e=0):e>r&&(e=r),t<0?(t+=r)<0&&(t=0):t>r&&(t=r),t>>=0,t>>>=0,r||D(e,t,this.length);for(var n=this[e],i=1,s=0;++s>>=0,t>>>=0,r||D(e,t,this.length);for(var n=this[e+--t],i=1;t>0&&(i*=256);)n+=this[e+--t]*i;return n},o.prototype.readUInt8=function(e,t){return e>>>=0,t||D(e,1,this.length),this[e]},o.prototype.readUInt16LE=function(e,t){return e>>>=0,t||D(e,2,this.length),this[e]|this[e+1]<<8},o.prototype.readUInt16BE=function(e,t){return e>>>=0,t||D(e,2,this.length),this[e]<<8|this[e+1]},o.prototype.readUInt32LE=function(e,t){return e>>>=0,t||D(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},o.prototype.readUInt32BE=function(e,t){return e>>>=0,t||D(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},o.prototype.readIntLE=function(e,t,r){e>>>=0,t>>>=0,r||D(e,t,this.length);for(var n=this[e],i=1,s=0;++s=(i*=128)&&(n-=Math.pow(2,8*t)),n},o.prototype.readIntBE=function(e,t,r){e>>>=0,t>>>=0,r||D(e,t,this.length);for(var n=t,i=1,s=this[e+--n];n>0&&(i*=256);)s+=this[e+--n]*i;return s>=(i*=128)&&(s-=Math.pow(2,8*t)),s},o.prototype.readInt8=function(e,t){return e>>>=0,t||D(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},o.prototype.readInt16LE=function(e,t){e>>>=0,t||D(e,2,this.length);var r=this[e]|this[e+1]<<8;return 32768&r?4294901760|r:r},o.prototype.readInt16BE=function(e,t){e>>>=0,t||D(e,2,this.length);var r=this[e+1]|this[e]<<8;return 32768&r?4294901760|r:r},o.prototype.readInt32LE=function(e,t){return e>>>=0,t||D(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},o.prototype.readInt32BE=function(e,t){return e>>>=0,t||D(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},o.prototype.readFloatLE=function(e,t){return e>>>=0,t||D(e,4,this.length),i.read(this,e,!0,23,4)},o.prototype.readFloatBE=function(e,t){return e>>>=0,t||D(e,4,this.length),i.read(this,e,!1,23,4)},o.prototype.readDoubleLE=function(e,t){return e>>>=0,t||D(e,8,this.length),i.read(this,e,!0,52,8)},o.prototype.readDoubleBE=function(e,t){return e>>>=0,t||D(e,8,this.length),i.read(this,e,!1,52,8)},o.prototype.writeUIntLE=function(e,t,r,n){(e=+e,t>>>=0,r>>>=0,n)||k(this,e,t,r,Math.pow(2,8*r)-1,0);var i=1,s=0;for(this[t]=255&e;++s>>=0,r>>>=0,n)||k(this,e,t,r,Math.pow(2,8*r)-1,0);var i=r-1,s=1;for(this[t+i]=255&e;--i>=0&&(s*=256);)this[t+i]=e/s&255;return t+r},o.prototype.writeUInt8=function(e,t,r){return e=+e,t>>>=0,r||k(this,e,t,1,255,0),this[t]=255&e,t+1},o.prototype.writeUInt16LE=function(e,t,r){return e=+e,t>>>=0,r||k(this,e,t,2,65535,0),this[t]=255&e,this[t+1]=e>>>8,t+2},o.prototype.writeUInt16BE=function(e,t,r){return e=+e,t>>>=0,r||k(this,e,t,2,65535,0),this[t]=e>>>8,this[t+1]=255&e,t+2},o.prototype.writeUInt32LE=function(e,t,r){return e=+e,t>>>=0,r||k(this,e,t,4,4294967295,0),this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e,t+4},o.prototype.writeUInt32BE=function(e,t,r){return e=+e,t>>>=0,r||k(this,e,t,4,4294967295,0),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},o.prototype.writeIntLE=function(e,t,r,n){if(e=+e,t>>>=0,!n){var i=Math.pow(2,8*r-1);k(this,e,t,r,i-1,-i)}var s=0,a=1,o=0;for(this[t]=255&e;++s>0)-o&255;return t+r},o.prototype.writeIntBE=function(e,t,r,n){if(e=+e,t>>>=0,!n){var i=Math.pow(2,8*r-1);k(this,e,t,r,i-1,-i)}var s=r-1,a=1,o=0;for(this[t+s]=255&e;--s>=0&&(a*=256);)e<0&&0===o&&0!==this[t+s+1]&&(o=1),this[t+s]=(e/a>>0)-o&255;return t+r},o.prototype.writeInt8=function(e,t,r){return e=+e,t>>>=0,r||k(this,e,t,1,127,-128),e<0&&(e=255+e+1),this[t]=255&e,t+1},o.prototype.writeInt16LE=function(e,t,r){return e=+e,t>>>=0,r||k(this,e,t,2,32767,-32768),this[t]=255&e,this[t+1]=e>>>8,t+2},o.prototype.writeInt16BE=function(e,t,r){return e=+e,t>>>=0,r||k(this,e,t,2,32767,-32768),this[t]=e>>>8,this[t+1]=255&e,t+2},o.prototype.writeInt32LE=function(e,t,r){return e=+e,t>>>=0,r||k(this,e,t,4,2147483647,-2147483648),this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24,t+4},o.prototype.writeInt32BE=function(e,t,r){return e=+e,t>>>=0,r||k(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},o.prototype.writeFloatLE=function(e,t,r){return N(this,e,t,!0,r)},o.prototype.writeFloatBE=function(e,t,r){return N(this,e,t,!1,r)},o.prototype.writeDoubleLE=function(e,t,r){return O(this,e,t,!0,r)},o.prototype.writeDoubleBE=function(e,t,r){return O(this,e,t,!1,r)},o.prototype.copy=function(e,t,r,n){if(r||(r=0),n||0===n||(n=this.length),t>=e.length&&(t=e.length),t||(t=0),n>0&&n=this.length)throw new RangeError("sourceStart out of bounds");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),e.length-t=0;--i)e[i+t]=this[i+r];else if(s<1e3)for(i=0;i>>=0,r=void 0===r?this.length:r>>>0,e||(e=0),"number"==typeof e)for(s=t;s55295&&r<57344){if(!i){if(r>56319){(t-=3)>-1&&s.push(239,191,189);continue}if(a+1===n){(t-=3)>-1&&s.push(239,191,189);continue}i=r;continue}if(r<56320){(t-=3)>-1&&s.push(239,191,189),i=r;continue}r=65536+(i-55296<<10|r-56320)}else i&&(t-=3)>-1&&s.push(239,191,189);if(i=null,r<128){if((t-=1)<0)break;s.push(r)}else if(r<2048){if((t-=2)<0)break;s.push(r>>6|192,63&r|128)}else if(r<65536){if((t-=3)<0)break;s.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;s.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return s}function U(e){return n.toByteArray(function(e){if((e=e.trim().replace(F,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function P(e,t,r,n){for(var i=0;i=t.length||i>=e.length);++i)t[i+r]=e[i];return i}function $(e){return e instanceof ArrayBuffer||null!=e&&null!=e.constructor&&"ArrayBuffer"===e.constructor.name&&"number"==typeof e.byteLength}function B(e){return"function"==typeof ArrayBuffer.isView&&ArrayBuffer.isView(e)}function G(e){return e!=e}},{"base64-js":12,ieee754:167}],167:[function(e,t,r){r.read=function(e,t,r,n,i){var s,a,o=8*i-n-1,u=(1<>1,c=-7,h=r?i-1:0,p=r?-1:1,f=e[t+h];for(h+=p,s=f&(1<<-c)-1,f>>=-c,c+=o;c>0;s=256*s+e[t+h],h+=p,c-=8);for(a=s&(1<<-c)-1,s>>=-c,c+=n;c>0;a=256*a+e[t+h],h+=p,c-=8);if(0===s)s=1-l;else{if(s===u)return a?NaN:1/0*(f?-1:1);a+=Math.pow(2,n),s-=l}return(f?-1:1)*a*Math.pow(2,s-n)},r.write=function(e,t,r,n,i,s){var a,o,u,l=8*s-i-1,c=(1<>1,p=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,f=n?0:s-1,d=n?1:-1,g=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(o=isNaN(t)?1:0,a=c):(a=Math.floor(Math.log(t)/Math.LN2),t*(u=Math.pow(2,-a))<1&&(a--,u*=2),(t+=a+h>=1?p/u:p*Math.pow(2,1-h))*u>=2&&(a++,u/=2),a+h>=c?(o=0,a=c):a+h>=1?(o=(t*u-1)*Math.pow(2,i),a+=h):(o=t*Math.pow(2,h-1)*Math.pow(2,i),a=0));i>=8;e[r+f]=255&o,f+=d,o/=256,i-=8);for(a=a<0;e[r+f]=255&a,f+=d,a/=256,l-=8);e[r+f-d]|=128*g}},{}],168:[function(e,t,r){(function(e){(function(){var n,i=200,s="Unsupported core-js use. Try https://npms.io/search?q=ponyfill.",a="Expected a function",o="Invalid `variable` option passed into `_.template`",u="__lodash_hash_undefined__",l=500,c="__lodash_placeholder__",h=1,p=2,f=4,d=1,g=2,m=1,_=2,x=4,y=8,b=16,T=32,v=64,E=128,A=256,S=512,w=30,I="...",L=800,R=16,D=1,k=2,C=1/0,N=9007199254740991,O=1.7976931348623157e308,F=NaN,M=4294967295,V=M-1,U=M>>>1,P=[["ary",E],["bind",m],["bindKey",_],["curry",y],["curryRight",b],["flip",S],["partial",T],["partialRight",v],["rearg",A]],$="[object Arguments]",B="[object Array]",G="[object AsyncFunction]",z="[object Boolean]",K="[object Date]",W="[object DOMException]",j="[object Error]",H="[object Function]",X="[object GeneratorFunction]",q="[object Map]",Y="[object Number]",Z="[object Null]",J="[object Object]",Q="[object Proxy]",ee="[object RegExp]",te="[object Set]",re="[object String]",ne="[object Symbol]",ie="[object Undefined]",se="[object WeakMap]",ae="[object WeakSet]",oe="[object ArrayBuffer]",ue="[object DataView]",le="[object Float32Array]",ce="[object Float64Array]",he="[object Int8Array]",pe="[object Int16Array]",fe="[object Int32Array]",de="[object Uint8Array]",ge="[object Uint8ClampedArray]",me="[object Uint16Array]",_e="[object Uint32Array]",xe=/\b__p \+= '';/g,ye=/\b(__p \+=) '' \+/g,be=/(__e\(.*?\)|\b__t\)) \+\n'';/g,Te=/&(?:amp|lt|gt|quot|#39);/g,ve=/[&<>"']/g,Ee=RegExp(Te.source),Ae=RegExp(ve.source),Se=/<%-([\s\S]+?)%>/g,we=/<%([\s\S]+?)%>/g,Ie=/<%=([\s\S]+?)%>/g,Le=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Re=/^\w*$/,De=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,ke=/[\\^$.*+?()[\]{}|]/g,Ce=RegExp(ke.source),Ne=/^\s+/,Oe=/\s/,Fe=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,Me=/\{\n\/\* \[wrapped with (.+)\] \*/,Ve=/,? & /,Ue=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,Pe=/[()=,{}\[\]\/\s]/,$e=/\\(\\)?/g,Be=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,Ge=/\w*$/,ze=/^[-+]0x[0-9a-f]+$/i,Ke=/^0b[01]+$/i,We=/^\[object .+?Constructor\]$/,je=/^0o[0-7]+$/i,He=/^(?:0|[1-9]\d*)$/,Xe=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,qe=/($^)/,Ye=/['\n\r\u2028\u2029\\]/g,Ze="\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff",Je="\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",Qe="[\\ud800-\\udfff]",et="["+Je+"]",tt="["+Ze+"]",rt="\\d+",nt="[\\u2700-\\u27bf]",it="[a-z\\xdf-\\xf6\\xf8-\\xff]",st="[^\\ud800-\\udfff"+Je+rt+"\\u2700-\\u27bfa-z\\xdf-\\xf6\\xf8-\\xffA-Z\\xc0-\\xd6\\xd8-\\xde]",at="\\ud83c[\\udffb-\\udfff]",ot="[^\\ud800-\\udfff]",ut="(?:\\ud83c[\\udde6-\\uddff]){2}",lt="[\\ud800-\\udbff][\\udc00-\\udfff]",ct="[A-Z\\xc0-\\xd6\\xd8-\\xde]",ht="(?:"+it+"|"+st+")",pt="(?:"+ct+"|"+st+")",ft="(?:"+tt+"|"+at+")"+"?",dt="[\\ufe0e\\ufe0f]?"+ft+("(?:\\u200d(?:"+[ot,ut,lt].join("|")+")[\\ufe0e\\ufe0f]?"+ft+")*"),gt="(?:"+[nt,ut,lt].join("|")+")"+dt,mt="(?:"+[ot+tt+"?",tt,ut,lt,Qe].join("|")+")",_t=RegExp("['’]","g"),xt=RegExp(tt,"g"),yt=RegExp(at+"(?="+at+")|"+mt+dt,"g"),bt=RegExp([ct+"?"+it+"+(?:['’](?:d|ll|m|re|s|t|ve))?(?="+[et,ct,"$"].join("|")+")",pt+"+(?:['’](?:D|LL|M|RE|S|T|VE))?(?="+[et,ct+ht,"$"].join("|")+")",ct+"?"+ht+"+(?:['’](?:d|ll|m|re|s|t|ve))?",ct+"+(?:['’](?:D|LL|M|RE|S|T|VE))?","\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])","\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",rt,gt].join("|"),"g"),Tt=RegExp("[\\u200d\\ud800-\\udfff"+Ze+"\\ufe0e\\ufe0f]"),vt=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,Et=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],At=-1,St={};St[le]=St[ce]=St[he]=St[pe]=St[fe]=St[de]=St[ge]=St[me]=St[_e]=!0,St[$]=St[B]=St[oe]=St[z]=St[ue]=St[K]=St[j]=St[H]=St[q]=St[Y]=St[J]=St[ee]=St[te]=St[re]=St[se]=!1;var wt={};wt[$]=wt[B]=wt[oe]=wt[ue]=wt[z]=wt[K]=wt[le]=wt[ce]=wt[he]=wt[pe]=wt[fe]=wt[q]=wt[Y]=wt[J]=wt[ee]=wt[te]=wt[re]=wt[ne]=wt[de]=wt[ge]=wt[me]=wt[_e]=!0,wt[j]=wt[H]=wt[se]=!1;var It={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},Lt=parseFloat,Rt=parseInt,Dt="object"==typeof e&&e&&e.Object===Object&&e,kt="object"==typeof self&&self&&self.Object===Object&&self,Ct=Dt||kt||Function("return this")(),Nt="object"==typeof r&&r&&!r.nodeType&&r,Ot=Nt&&"object"==typeof t&&t&&!t.nodeType&&t,Ft=Ot&&Ot.exports===Nt,Mt=Ft&&Dt.process,Vt=function(){try{var e=Ot&&Ot.require&&Ot.require("util").types;return e||Mt&&Mt.binding&&Mt.binding("util")}catch(e){}}(),Ut=Vt&&Vt.isArrayBuffer,Pt=Vt&&Vt.isDate,$t=Vt&&Vt.isMap,Bt=Vt&&Vt.isRegExp,Gt=Vt&&Vt.isSet,zt=Vt&&Vt.isTypedArray;function Kt(e,t,r){switch(r.length){case 0:return e.call(t);case 1:return e.call(t,r[0]);case 2:return e.call(t,r[0],r[1]);case 3:return e.call(t,r[0],r[1],r[2])}return e.apply(t,r)}function Wt(e,t,r,n){for(var i=-1,s=null==e?0:e.length;++i-1}function Zt(e,t,r){for(var n=-1,i=null==e?0:e.length;++n-1;);return r}function br(e,t){for(var r=e.length;r--&&ar(t,e[r],0)>-1;);return r}var Tr=hr({"À":"A","Á":"A","Â":"A","Ã":"A","Ä":"A","Å":"A","à":"a","á":"a","â":"a","ã":"a","ä":"a","å":"a","Ç":"C","ç":"c","Ð":"D","ð":"d","È":"E","É":"E","Ê":"E","Ë":"E","è":"e","é":"e","ê":"e","ë":"e","Ì":"I","Í":"I","Î":"I","Ï":"I","ì":"i","í":"i","î":"i","ï":"i","Ñ":"N","ñ":"n","Ò":"O","Ó":"O","Ô":"O","Õ":"O","Ö":"O","Ø":"O","ò":"o","ó":"o","ô":"o","õ":"o","ö":"o","ø":"o","Ù":"U","Ú":"U","Û":"U","Ü":"U","ù":"u","ú":"u","û":"u","ü":"u","Ý":"Y","ý":"y","ÿ":"y","Æ":"Ae","æ":"ae","Þ":"Th","þ":"th","ß":"ss","Ā":"A","Ă":"A","Ą":"A","ā":"a","ă":"a","ą":"a","Ć":"C","Ĉ":"C","Ċ":"C","Č":"C","ć":"c","ĉ":"c","ċ":"c","č":"c","Ď":"D","Đ":"D","ď":"d","đ":"d","Ē":"E","Ĕ":"E","Ė":"E","Ę":"E","Ě":"E","ē":"e","ĕ":"e","ė":"e","ę":"e","ě":"e","Ĝ":"G","Ğ":"G","Ġ":"G","Ģ":"G","ĝ":"g","ğ":"g","ġ":"g","ģ":"g","Ĥ":"H","Ħ":"H","ĥ":"h","ħ":"h","Ĩ":"I","Ī":"I","Ĭ":"I","Į":"I","İ":"I","ĩ":"i","ī":"i","ĭ":"i","į":"i","ı":"i","Ĵ":"J","ĵ":"j","Ķ":"K","ķ":"k","ĸ":"k","Ĺ":"L","Ļ":"L","Ľ":"L","Ŀ":"L","Ł":"L","ĺ":"l","ļ":"l","ľ":"l","ŀ":"l","ł":"l","Ń":"N","Ņ":"N","Ň":"N","Ŋ":"N","ń":"n","ņ":"n","ň":"n","ŋ":"n","Ō":"O","Ŏ":"O","Ő":"O","ō":"o","ŏ":"o","ő":"o","Ŕ":"R","Ŗ":"R","Ř":"R","ŕ":"r","ŗ":"r","ř":"r","Ś":"S","Ŝ":"S","Ş":"S","Š":"S","ś":"s","ŝ":"s","ş":"s","š":"s","Ţ":"T","Ť":"T","Ŧ":"T","ţ":"t","ť":"t","ŧ":"t","Ũ":"U","Ū":"U","Ŭ":"U","Ů":"U","Ű":"U","Ų":"U","ũ":"u","ū":"u","ŭ":"u","ů":"u","ű":"u","ų":"u","Ŵ":"W","ŵ":"w","Ŷ":"Y","ŷ":"y","Ÿ":"Y","Ź":"Z","Ż":"Z","Ž":"Z","ź":"z","ż":"z","ž":"z","IJ":"IJ","ij":"ij","Œ":"Oe","œ":"oe","ʼn":"'n","ſ":"s"}),vr=hr({"&":"&","<":"<",">":">",'"':""","'":"'"});function Er(e){return"\\"+It[e]}function Ar(e){return Tt.test(e)}function Sr(e){var t=-1,r=Array(e.size);return e.forEach(function(e,n){r[++t]=[n,e]}),r}function wr(e,t){return function(r){return e(t(r))}}function Ir(e,t){for(var r=-1,n=e.length,i=0,s=[];++r",""":'"',"'":"'"});var Or=function e(t){var r,Oe=(t=null==t?Ct:Or.defaults(Ct.Object(),t,Or.pick(Ct,Et))).Array,Ze=t.Date,Je=t.Error,Qe=t.Function,et=t.Math,tt=t.Object,rt=t.RegExp,nt=t.String,it=t.TypeError,st=Oe.prototype,at=Qe.prototype,ot=tt.prototype,ut=t["__core-js_shared__"],lt=at.toString,ct=ot.hasOwnProperty,ht=0,pt=(r=/[^.]+$/.exec(ut&&ut.keys&&ut.keys.IE_PROTO||""))?"Symbol(src)_1."+r:"",ft=ot.toString,dt=lt.call(tt),gt=Ct._,mt=rt("^"+lt.call(ct).replace(ke,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),yt=Ft?t.Buffer:n,Tt=t.Symbol,It=t.Uint8Array,Dt=yt?yt.allocUnsafe:n,kt=wr(tt.getPrototypeOf,tt),Nt=tt.create,Ot=ot.propertyIsEnumerable,Mt=st.splice,Vt=Tt?Tt.isConcatSpreadable:n,nr=Tt?Tt.iterator:n,hr=Tt?Tt.toStringTag:n,Fr=function(){try{var e=$s(tt,"defineProperty");return e({},"",{}),e}catch(e){}}(),Mr=t.clearTimeout!==Ct.clearTimeout&&t.clearTimeout,Vr=Ze&&Ze.now!==Ct.Date.now&&Ze.now,Ur=t.setTimeout!==Ct.setTimeout&&t.setTimeout,Pr=et.ceil,$r=et.floor,Br=tt.getOwnPropertySymbols,Gr=yt?yt.isBuffer:n,zr=t.isFinite,Kr=st.join,Wr=wr(tt.keys,tt),jr=et.max,Hr=et.min,Xr=Ze.now,qr=t.parseInt,Yr=et.random,Zr=st.reverse,Jr=$s(t,"DataView"),Qr=$s(t,"Map"),en=$s(t,"Promise"),tn=$s(t,"Set"),rn=$s(t,"WeakMap"),nn=$s(tt,"create"),sn=rn&&new rn,an={},on=pa(Jr),un=pa(Qr),ln=pa(en),cn=pa(tn),hn=pa(rn),pn=Tt?Tt.prototype:n,fn=pn?pn.valueOf:n,dn=pn?pn.toString:n;function gn(e){if(Do(e)&&!yo(e)&&!(e instanceof yn)){if(e instanceof xn)return e;if(ct.call(e,"__wrapped__"))return fa(e)}return new xn(e)}var mn=function(){function e(){}return function(t){if(!Ro(t))return{};if(Nt)return Nt(t);e.prototype=t;var r=new e;return e.prototype=n,r}}();function _n(){}function xn(e,t){this.__wrapped__=e,this.__actions__=[],this.__chain__=!!t,this.__index__=0,this.__values__=n}function yn(e){this.__wrapped__=e,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=M,this.__views__=[]}function bn(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t=t?e:t)),e}function Vn(e,t,r,i,s,a){var o,u=t&h,l=t&p,c=t&f;if(r&&(o=s?r(e,i,s,a):r(e)),o!==n)return o;if(!Ro(e))return e;var d=yo(e);if(d){if(o=function(e){var t=e.length,r=new e.constructor(t);return t&&"string"==typeof e[0]&&ct.call(e,"index")&&(r.index=e.index,r.input=e.input),r}(e),!u)return is(e,o)}else{var g=zs(e),m=g==H||g==X;if(Eo(e))return Ji(e,u);if(g==J||g==$||m&&!s){if(o=l||m?{}:Ws(e),!u)return l?function(e,t){return ss(e,Gs(e),t)}(e,function(e,t){return e&&ss(t,ou(t),e)}(o,e)):function(e,t){return ss(e,Bs(e),t)}(e,Nn(o,e))}else{if(!wt[g])return s?e:{};o=function(e,t,r){var n,i,s,a=e.constructor;switch(t){case oe:return Qi(e);case z:case K:return new a(+e);case ue:return function(e,t){var r=t?Qi(e.buffer):e.buffer;return new e.constructor(r,e.byteOffset,e.byteLength)}(e,r);case le:case ce:case he:case pe:case fe:case de:case ge:case me:case _e:return es(e,r);case q:return new a;case Y:case re:return new a(e);case ee:return(s=new(i=e).constructor(i.source,Ge.exec(i))).lastIndex=i.lastIndex,s;case te:return new a;case ne:return n=e,fn?tt(fn.call(n)):{}}}(e,g,u)}}a||(a=new An);var _=a.get(e);if(_)return _;a.set(e,o),Fo(e)?e.forEach(function(n){o.add(Vn(n,t,r,n,e,a))}):ko(e)&&e.forEach(function(n,i){o.set(i,Vn(n,t,r,i,e,a))});var x=d?n:(c?l?Ns:Cs:l?ou:au)(e);return jt(x||e,function(n,i){x&&(n=e[i=n]),Dn(o,i,Vn(n,t,r,i,e,a))}),o}function Un(e,t,r){var i=r.length;if(null==e)return!i;for(e=tt(e);i--;){var s=r[i],a=t[s],o=e[s];if(o===n&&!(s in e)||!a(o))return!1}return!0}function Pn(e,t,r){if("function"!=typeof e)throw new it(a);return sa(function(){e.apply(n,r)},t)}function $n(e,t,r,n){var s=-1,a=Yt,o=!0,u=e.length,l=[],c=t.length;if(!u)return l;r&&(t=Jt(t,mr(r))),n?(a=Zt,o=!1):t.length>=i&&(a=xr,o=!1,t=new En(t));e:for(;++s-1},Tn.prototype.set=function(e,t){var r=this.__data__,n=kn(r,e);return n<0?(++this.size,r.push([e,t])):r[n][1]=t,this},vn.prototype.clear=function(){this.size=0,this.__data__={hash:new bn,map:new(Qr||Tn),string:new bn}},vn.prototype.delete=function(e){var t=Us(this,e).delete(e);return this.size-=t?1:0,t},vn.prototype.get=function(e){return Us(this,e).get(e)},vn.prototype.has=function(e){return Us(this,e).has(e)},vn.prototype.set=function(e,t){var r=Us(this,e),n=r.size;return r.set(e,t),this.size+=r.size==n?0:1,this},En.prototype.add=En.prototype.push=function(e){return this.__data__.set(e,u),this},En.prototype.has=function(e){return this.__data__.has(e)},An.prototype.clear=function(){this.__data__=new Tn,this.size=0},An.prototype.delete=function(e){var t=this.__data__,r=t.delete(e);return this.size=t.size,r},An.prototype.get=function(e){return this.__data__.get(e)},An.prototype.has=function(e){return this.__data__.has(e)},An.prototype.set=function(e,t){var r=this.__data__;if(r instanceof Tn){var n=r.__data__;if(!Qr||n.length0&&r(o)?t>1?jn(o,t-1,r,n,i):Qt(i,o):n||(i[i.length]=o)}return i}var Hn=ls(),Xn=ls(!0);function qn(e,t){return e&&Hn(e,t,au)}function Yn(e,t){return e&&Xn(e,t,au)}function Zn(e,t){return qt(t,function(t){return wo(e[t])})}function Jn(e,t){for(var r=0,i=(t=Xi(t,e)).length;null!=e&&rt}function ri(e,t){return null!=e&&ct.call(e,t)}function ni(e,t){return null!=e&&t in tt(e)}function ii(e,t,r){for(var i=r?Zt:Yt,s=e[0].length,a=e.length,o=a,u=Oe(a),l=1/0,c=[];o--;){var h=e[o];o&&t&&(h=Jt(h,mr(t))),l=Hr(h.length,l),u[o]=!r&&(t||s>=120&&h.length>=120)?new En(o&&h):n}h=e[0];var p=-1,f=u[0];e:for(;++p=o)return u;var l=r[n];return u*("desc"==l?-1:1)}}return e.index-t.index}(e,t,r)})}function bi(e,t,r){for(var n=-1,i=t.length,s={};++n-1;)o!==e&&Mt.call(o,u,1),Mt.call(e,u,1);return e}function vi(e,t){for(var r=e?t.length:0,n=r-1;r--;){var i=t[r];if(r==n||i!==s){var s=i;Hs(i)?Mt.call(e,i,1):$i(e,i)}}return e}function Ei(e,t){return e+$r(Yr()*(t-e+1))}function Ai(e,t){var r="";if(!e||t<1||t>N)return r;do{t%2&&(r+=e),(t=$r(t/2))&&(e+=e)}while(t);return r}function Si(e,t){return aa(ta(e,t,Cu),e+"")}function wi(e){return wn(gu(e))}function Ii(e,t){var r=gu(e);return la(r,Mn(t,0,r.length))}function Li(e,t,r,i){if(!Ro(e))return e;for(var s=-1,a=(t=Xi(t,e)).length,o=a-1,u=e;null!=u&&++si?0:i+t),(r=r>i?i:r)<0&&(r+=i),i=t>r?0:r-t>>>0,t>>>=0;for(var s=Oe(i);++n>>1,a=e[s];null!==a&&!Vo(a)&&(r?a<=t:a=i){var c=t?null:As(e);if(c)return Lr(c);o=!1,s=xr,l=new En}else l=t?[]:u;e:for(;++n=i?e:Ci(e,t,r)}var Zi=Mr||function(e){return Ct.clearTimeout(e)};function Ji(e,t){if(t)return e.slice();var r=e.length,n=Dt?Dt(r):new e.constructor(r);return e.copy(n),n}function Qi(e){var t=new e.constructor(e.byteLength);return new It(t).set(new It(e)),t}function es(e,t){var r=t?Qi(e.buffer):e.buffer;return new e.constructor(r,e.byteOffset,e.length)}function ts(e,t){if(e!==t){var r=e!==n,i=null===e,s=e==e,a=Vo(e),o=t!==n,u=null===t,l=t==t,c=Vo(t);if(!u&&!c&&!a&&e>t||a&&o&&l&&!u&&!c||i&&o&&l||!r&&l||!s)return 1;if(!i&&!a&&!c&&e1?r[s-1]:n,o=s>2?r[2]:n;for(a=e.length>3&&"function"==typeof a?(s--,a):n,o&&Xs(r[0],r[1],o)&&(a=s<3?n:a,s=1),t=tt(t);++i-1?s[a?t[o]:o]:n}}function ds(e){return ks(function(t){var r=t.length,i=r,s=xn.prototype.thru;for(e&&t.reverse();i--;){var o=t[i];if("function"!=typeof o)throw new it(a);if(s&&!u&&"wrapper"==Fs(o))var u=new xn([],!0)}for(i=u?i:r;++i1&&y.reverse(),h&&l<_&&(y.length=l),this&&this!==Ct&&this instanceof m&&(S=x||ps(S)),S.apply(A,y)}}function ms(e,t){return function(r,n){return function(e,t,r,n){return qn(e,function(e,i,s){t(n,r(e),i,s)}),n}(r,e,t(n),{})}}function _s(e,t){return function(r,i){var s;if(r===n&&i===n)return t;if(r!==n&&(s=r),i!==n){if(s===n)return i;"string"==typeof r||"string"==typeof i?(r=Ui(r),i=Ui(i)):(r=Vi(r),i=Vi(i)),s=e(r,i)}return s}}function xs(e){return ks(function(t){return t=Jt(t,mr(Vs())),Si(function(r){var n=this;return e(t,function(e){return Kt(e,n,r)})})})}function ys(e,t){var r=(t=t===n?" ":Ui(t)).length;if(r<2)return r?Ai(t,e):t;var i=Ai(t,Pr(e/Dr(t)));return Ar(t)?Yi(kr(i),0,e).join(""):i.slice(0,e)}function bs(e){return function(t,r,i){return i&&"number"!=typeof i&&Xs(t,r,i)&&(r=i=n),t=Go(t),r===n?(r=t,t=0):r=Go(r),function(e,t,r,n){for(var i=-1,s=jr(Pr((t-e)/(r||1)),0),a=Oe(s);s--;)a[n?s:++i]=e,e+=r;return a}(t,r,i=i===n?tu))return!1;var c=a.get(e),h=a.get(t);if(c&&h)return c==t&&h==e;var p=-1,f=!0,m=r&g?new En:n;for(a.set(e,t),a.set(t,e);++p-1&&e%1==0&&e1?"& ":"")+t[n],t=t.join(r>2?", ":" "),e.replace(Fe,"{\n/* [wrapped with "+t+"] */\n")}(n,function(e,t){return jt(P,function(r){var n="_."+r[0];t&r[1]&&!Yt(e,n)&&e.push(n)}),e.sort()}(function(e){var t=e.match(Me);return t?t[1].split(Ve):[]}(n),r)))}function ua(e){var t=0,r=0;return function(){var i=Xr(),s=R-(i-r);if(r=i,s>0){if(++t>=L)return arguments[0]}else t=0;return e.apply(n,arguments)}}function la(e,t){var r=-1,i=e.length,s=i-1;for(t=t===n?i:t;++r1?e[t-1]:n;return Na(e,r="function"==typeof r?(e.pop(),r):n)});function $a(e){var t=gn(e);return t.__chain__=!0,t}function Ba(e,t){return t(e)}var Ga=ks(function(e){var t=e.length,r=t?e[0]:0,i=this.__wrapped__,s=function(t){return Fn(t,e)};return!(t>1||this.__actions__.length)&&i instanceof yn&&Hs(r)?((i=i.slice(r,+r+(t?1:0))).__actions__.push({func:Ba,args:[s],thisArg:n}),new xn(i,this.__chain__).thru(function(e){return t&&!e.length&&e.push(n),e})):this.thru(s)});var za=as(function(e,t,r){ct.call(e,r)?++e[r]:On(e,r,1)});var Ka=fs(_a),Wa=fs(xa);function ja(e,t){return(yo(e)?jt:Bn)(e,Vs(t,3))}function Ha(e,t){return(yo(e)?Ht:Gn)(e,Vs(t,3))}var Xa=as(function(e,t,r){ct.call(e,r)?e[r].push(t):On(e,r,[t])});var qa=Si(function(e,t,r){var n=-1,i="function"==typeof t,s=To(e)?Oe(e.length):[];return Bn(e,function(e){s[++n]=i?Kt(t,e,r):si(e,t,r)}),s}),Ya=as(function(e,t,r){On(e,r,t)});function Za(e,t){return(yo(e)?Jt:di)(e,Vs(t,3))}var Ja=as(function(e,t,r){e[r?0:1].push(t)},function(){return[[],[]]});var Qa=Si(function(e,t){if(null==e)return[];var r=t.length;return r>1&&Xs(e,t[0],t[1])?t=[]:r>2&&Xs(t[0],t[1],t[2])&&(t=[t[0]]),yi(e,jn(t,1),[])}),eo=Vr||function(){return Ct.Date.now()};function to(e,t,r){return t=r?n:t,t=e&&null==t?e.length:t,ws(e,E,n,n,n,n,t)}function ro(e,t){var r;if("function"!=typeof t)throw new it(a);return e=zo(e),function(){return--e>0&&(r=t.apply(this,arguments)),e<=1&&(t=n),r}}var no=Si(function(e,t,r){var n=m;if(r.length){var i=Ir(r,Ms(no));n|=T}return ws(e,n,t,r,i)}),io=Si(function(e,t,r){var n=m|_;if(r.length){var i=Ir(r,Ms(io));n|=T}return ws(t,n,e,r,i)});function so(e,t,r){var i,s,o,u,l,c,h=0,p=!1,f=!1,d=!0;if("function"!=typeof e)throw new it(a);function g(t){var r=i,a=s;return i=s=n,h=t,u=e.apply(a,r)}function m(e){var r=e-c;return c===n||r>=t||r<0||f&&e-h>=o}function _(){var e=eo();if(m(e))return x(e);l=sa(_,function(e){var r=t-(e-c);return f?Hr(r,o-(e-h)):r}(e))}function x(e){return l=n,d&&i?g(e):(i=s=n,u)}function y(){var e=eo(),r=m(e);if(i=arguments,s=this,c=e,r){if(l===n)return function(e){return h=e,l=sa(_,t),p?g(e):u}(c);if(f)return Zi(l),l=sa(_,t),g(c)}return l===n&&(l=sa(_,t)),u}return t=Wo(t)||0,Ro(r)&&(p=!!r.leading,o=(f="maxWait"in r)?jr(Wo(r.maxWait)||0,t):o,d="trailing"in r?!!r.trailing:d),y.cancel=function(){l!==n&&Zi(l),h=0,i=c=s=l=n},y.flush=function(){return l===n?u:x(eo())},y}var ao=Si(function(e,t){return Pn(e,1,t)}),oo=Si(function(e,t,r){return Pn(e,Wo(t)||0,r)});function uo(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw new it(a);var r=function(){var n=arguments,i=t?t.apply(this,n):n[0],s=r.cache;if(s.has(i))return s.get(i);var a=e.apply(this,n);return r.cache=s.set(i,a)||s,a};return r.cache=new(uo.Cache||vn),r}function lo(e){if("function"!=typeof e)throw new it(a);return function(){var t=arguments;switch(t.length){case 0:return!e.call(this);case 1:return!e.call(this,t[0]);case 2:return!e.call(this,t[0],t[1]);case 3:return!e.call(this,t[0],t[1],t[2])}return!e.apply(this,t)}}uo.Cache=vn;var co=qi(function(e,t){var r=(t=1==t.length&&yo(t[0])?Jt(t[0],mr(Vs())):Jt(jn(t,1),mr(Vs()))).length;return Si(function(n){for(var i=-1,s=Hr(n.length,r);++i=t}),xo=ai(function(){return arguments}())?ai:function(e){return Do(e)&&ct.call(e,"callee")&&!Ot.call(e,"callee")},yo=Oe.isArray,bo=Ut?mr(Ut):function(e){return Do(e)&&ei(e)==oe};function To(e){return null!=e&&Lo(e.length)&&!wo(e)}function vo(e){return Do(e)&&To(e)}var Eo=Gr||Wu,Ao=Pt?mr(Pt):function(e){return Do(e)&&ei(e)==K};function So(e){if(!Do(e))return!1;var t=ei(e);return t==j||t==W||"string"==typeof e.message&&"string"==typeof e.name&&!No(e)}function wo(e){if(!Ro(e))return!1;var t=ei(e);return t==H||t==X||t==G||t==Q}function Io(e){return"number"==typeof e&&e==zo(e)}function Lo(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=N}function Ro(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}function Do(e){return null!=e&&"object"==typeof e}var ko=$t?mr($t):function(e){return Do(e)&&zs(e)==q};function Co(e){return"number"==typeof e||Do(e)&&ei(e)==Y}function No(e){if(!Do(e)||ei(e)!=J)return!1;var t=kt(e);if(null===t)return!0;var r=ct.call(t,"constructor")&&t.constructor;return"function"==typeof r&&r instanceof r&<.call(r)==dt}var Oo=Bt?mr(Bt):function(e){return Do(e)&&ei(e)==ee};var Fo=Gt?mr(Gt):function(e){return Do(e)&&zs(e)==te};function Mo(e){return"string"==typeof e||!yo(e)&&Do(e)&&ei(e)==re}function Vo(e){return"symbol"==typeof e||Do(e)&&ei(e)==ne}var Uo=zt?mr(zt):function(e){return Do(e)&&Lo(e.length)&&!!St[ei(e)]};var Po=Ts(fi),$o=Ts(function(e,t){return e<=t});function Bo(e){if(!e)return[];if(To(e))return Mo(e)?kr(e):is(e);if(nr&&e[nr])return function(e){for(var t,r=[];!(t=e.next()).done;)r.push(t.value);return r}(e[nr]());var t=zs(e);return(t==q?Sr:t==te?Lr:gu)(e)}function Go(e){return e?(e=Wo(e))===C||e===-C?(e<0?-1:1)*O:e==e?e:0:0===e?e:0}function zo(e){var t=Go(e),r=t%1;return t==t?r?t-r:t:0}function Ko(e){return e?Mn(zo(e),0,M):0}function Wo(e){if("number"==typeof e)return e;if(Vo(e))return F;if(Ro(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=Ro(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=gr(e);var r=Ke.test(e);return r||je.test(e)?Rt(e.slice(2),r?2:8):ze.test(e)?F:+e}function jo(e){return ss(e,ou(e))}function Ho(e){return null==e?"":Ui(e)}var Xo=os(function(e,t){if(Js(t)||To(t))ss(t,au(t),e);else for(var r in t)ct.call(t,r)&&Dn(e,r,t[r])}),qo=os(function(e,t){ss(t,ou(t),e)}),Yo=os(function(e,t,r,n){ss(t,ou(t),e,n)}),Zo=os(function(e,t,r,n){ss(t,au(t),e,n)}),Jo=ks(Fn);var Qo=Si(function(e,t){e=tt(e);var r=-1,i=t.length,s=i>2?t[2]:n;for(s&&Xs(t[0],t[1],s)&&(i=1);++r1),t}),ss(e,Ns(e),r),n&&(r=Vn(r,h|p|f,Rs));for(var i=t.length;i--;)$i(r,t[i]);return r});var hu=ks(function(e,t){return null==e?{}:function(e,t){return bi(e,t,function(t,r){return ru(e,r)})}(e,t)});function pu(e,t){if(null==e)return{};var r=Jt(Ns(e),function(e){return[e]});return t=Vs(t),bi(e,r,function(e,r){return t(e,r[0])})}var fu=Ss(au),du=Ss(ou);function gu(e){return null==e?[]:_r(e,au(e))}var mu=hs(function(e,t,r){return t=t.toLowerCase(),e+(r?_u(t):t)});function _u(e){return Su(Ho(e).toLowerCase())}function xu(e){return(e=Ho(e))&&e.replace(Xe,Tr).replace(xt,"")}var yu=hs(function(e,t,r){return e+(r?"-":"")+t.toLowerCase()}),bu=hs(function(e,t,r){return e+(r?" ":"")+t.toLowerCase()}),Tu=cs("toLowerCase");var vu=hs(function(e,t,r){return e+(r?"_":"")+t.toLowerCase()});var Eu=hs(function(e,t,r){return e+(r?" ":"")+Su(t)});var Au=hs(function(e,t,r){return e+(r?" ":"")+t.toUpperCase()}),Su=cs("toUpperCase");function wu(e,t,r){return e=Ho(e),(t=r?n:t)===n?function(e){return vt.test(e)}(e)?function(e){return e.match(bt)||[]}(e):function(e){return e.match(Ue)||[]}(e):e.match(t)||[]}var Iu=Si(function(e,t){try{return Kt(e,n,t)}catch(e){return So(e)?e:new Je(e)}}),Lu=ks(function(e,t){return jt(t,function(t){t=ha(t),On(e,t,no(e[t],e))}),e});function Ru(e){return function(){return e}}var Du=ds(),ku=ds(!0);function Cu(e){return e}function Nu(e){return ci("function"==typeof e?e:Vn(e,h))}var Ou=Si(function(e,t){return function(r){return si(r,e,t)}}),Fu=Si(function(e,t){return function(r){return si(e,r,t)}});function Mu(e,t,r){var n=au(t),i=Zn(t,n);null!=r||Ro(t)&&(i.length||!n.length)||(r=t,t=e,e=this,i=Zn(t,au(t)));var s=!(Ro(r)&&"chain"in r&&!r.chain),a=wo(e);return jt(i,function(r){var n=t[r];e[r]=n,a&&(e.prototype[r]=function(){var t=this.__chain__;if(s||t){var r=e(this.__wrapped__);return(r.__actions__=is(this.__actions__)).push({func:n,args:arguments,thisArg:e}),r.__chain__=t,r}return n.apply(e,Qt([this.value()],arguments))})}),e}function Vu(){}var Uu=xs(Jt),Pu=xs(Xt),$u=xs(rr);function Bu(e){return qs(e)?cr(ha(e)):function(e){return function(t){return Jn(t,e)}}(e)}var Gu=bs(),zu=bs(!0);function Ku(){return[]}function Wu(){return!1}var ju=_s(function(e,t){return e+t},0),Hu=Es("ceil"),Xu=_s(function(e,t){return e/t},1),qu=Es("floor");var Yu,Zu=_s(function(e,t){return e*t},1),Ju=Es("round"),Qu=_s(function(e,t){return e-t},0);return gn.after=function(e,t){if("function"!=typeof t)throw new it(a);return e=zo(e),function(){if(--e<1)return t.apply(this,arguments)}},gn.ary=to,gn.assign=Xo,gn.assignIn=qo,gn.assignInWith=Yo,gn.assignWith=Zo,gn.at=Jo,gn.before=ro,gn.bind=no,gn.bindAll=Lu,gn.bindKey=io,gn.castArray=function(){if(!arguments.length)return[];var e=arguments[0];return yo(e)?e:[e]},gn.chain=$a,gn.chunk=function(e,t,r){t=(r?Xs(e,t,r):t===n)?1:jr(zo(t),0);var i=null==e?0:e.length;if(!i||t<1)return[];for(var s=0,a=0,o=Oe(Pr(i/t));ss?0:s+r),(i=i===n||i>s?s:zo(i))<0&&(i+=s),i=r>i?0:Ko(i);r>>0)?(e=Ho(e))&&("string"==typeof t||null!=t&&!Oo(t))&&!(t=Ui(t))&&Ar(e)?Yi(kr(e),0,r):e.split(t,r):[]},gn.spread=function(e,t){if("function"!=typeof e)throw new it(a);return t=null==t?0:jr(zo(t),0),Si(function(r){var n=r[t],i=Yi(r,0,t);return n&&Qt(i,n),Kt(e,this,i)})},gn.tail=function(e){var t=null==e?0:e.length;return t?Ci(e,1,t):[]},gn.take=function(e,t,r){return e&&e.length?Ci(e,0,(t=r||t===n?1:zo(t))<0?0:t):[]},gn.takeRight=function(e,t,r){var i=null==e?0:e.length;return i?Ci(e,(t=i-(t=r||t===n?1:zo(t)))<0?0:t,i):[]},gn.takeRightWhile=function(e,t){return e&&e.length?Gi(e,Vs(t,3),!1,!0):[]},gn.takeWhile=function(e,t){return e&&e.length?Gi(e,Vs(t,3)):[]},gn.tap=function(e,t){return t(e),e},gn.throttle=function(e,t,r){var n=!0,i=!0;if("function"!=typeof e)throw new it(a);return Ro(r)&&(n="leading"in r?!!r.leading:n,i="trailing"in r?!!r.trailing:i),so(e,t,{leading:n,maxWait:t,trailing:i})},gn.thru=Ba,gn.toArray=Bo,gn.toPairs=fu,gn.toPairsIn=du,gn.toPath=function(e){return yo(e)?Jt(e,ha):Vo(e)?[e]:is(ca(Ho(e)))},gn.toPlainObject=jo,gn.transform=function(e,t,r){var n=yo(e),i=n||Eo(e)||Uo(e);if(t=Vs(t,4),null==r){var s=e&&e.constructor;r=i?n?new s:[]:Ro(e)&&wo(s)?mn(kt(e)):{}}return(i?jt:qn)(e,function(e,n,i){return t(r,e,n,i)}),r},gn.unary=function(e){return to(e,1)},gn.union=Ra,gn.unionBy=Da,gn.unionWith=ka,gn.uniq=function(e){return e&&e.length?Pi(e):[]},gn.uniqBy=function(e,t){return e&&e.length?Pi(e,Vs(t,2)):[]},gn.uniqWith=function(e,t){return t="function"==typeof t?t:n,e&&e.length?Pi(e,n,t):[]},gn.unset=function(e,t){return null==e||$i(e,t)},gn.unzip=Ca,gn.unzipWith=Na,gn.update=function(e,t,r){return null==e?e:Bi(e,t,Hi(r))},gn.updateWith=function(e,t,r,i){return i="function"==typeof i?i:n,null==e?e:Bi(e,t,Hi(r),i)},gn.values=gu,gn.valuesIn=function(e){return null==e?[]:_r(e,ou(e))},gn.without=Oa,gn.words=wu,gn.wrap=function(e,t){return ho(Hi(t),e)},gn.xor=Fa,gn.xorBy=Ma,gn.xorWith=Va,gn.zip=Ua,gn.zipObject=function(e,t){return Wi(e||[],t||[],Dn)},gn.zipObjectDeep=function(e,t){return Wi(e||[],t||[],Li)},gn.zipWith=Pa,gn.entries=fu,gn.entriesIn=du,gn.extend=qo,gn.extendWith=Yo,Mu(gn,gn),gn.add=ju,gn.attempt=Iu,gn.camelCase=mu,gn.capitalize=_u,gn.ceil=Hu,gn.clamp=function(e,t,r){return r===n&&(r=t,t=n),r!==n&&(r=(r=Wo(r))==r?r:0),t!==n&&(t=(t=Wo(t))==t?t:0),Mn(Wo(e),t,r)},gn.clone=function(e){return Vn(e,f)},gn.cloneDeep=function(e){return Vn(e,h|f)},gn.cloneDeepWith=function(e,t){return Vn(e,h|f,t="function"==typeof t?t:n)},gn.cloneWith=function(e,t){return Vn(e,f,t="function"==typeof t?t:n)},gn.conformsTo=function(e,t){return null==t||Un(e,t,au(t))},gn.deburr=xu,gn.defaultTo=function(e,t){return null==e||e!=e?t:e},gn.divide=Xu,gn.endsWith=function(e,t,r){e=Ho(e),t=Ui(t);var i=e.length,s=r=r===n?i:Mn(zo(r),0,i);return(r-=t.length)>=0&&e.slice(r,s)==t},gn.eq=go,gn.escape=function(e){return(e=Ho(e))&&Ae.test(e)?e.replace(ve,vr):e},gn.escapeRegExp=function(e){return(e=Ho(e))&&Ce.test(e)?e.replace(ke,"\\$&"):e},gn.every=function(e,t,r){var i=yo(e)?Xt:zn;return r&&Xs(e,t,r)&&(t=n),i(e,Vs(t,3))},gn.find=Ka,gn.findIndex=_a,gn.findKey=function(e,t){return ir(e,Vs(t,3),qn)},gn.findLast=Wa,gn.findLastIndex=xa,gn.findLastKey=function(e,t){return ir(e,Vs(t,3),Yn)},gn.floor=qu,gn.forEach=ja,gn.forEachRight=Ha,gn.forIn=function(e,t){return null==e?e:Hn(e,Vs(t,3),ou)},gn.forInRight=function(e,t){return null==e?e:Xn(e,Vs(t,3),ou)},gn.forOwn=function(e,t){return e&&qn(e,Vs(t,3))},gn.forOwnRight=function(e,t){return e&&Yn(e,Vs(t,3))},gn.get=tu,gn.gt=mo,gn.gte=_o,gn.has=function(e,t){return null!=e&&Ks(e,t,ri)},gn.hasIn=ru,gn.head=ba,gn.identity=Cu,gn.includes=function(e,t,r,n){e=To(e)?e:gu(e),r=r&&!n?zo(r):0;var i=e.length;return r<0&&(r=jr(i+r,0)),Mo(e)?r<=i&&e.indexOf(t,r)>-1:!!i&&ar(e,t,r)>-1},gn.indexOf=function(e,t,r){var n=null==e?0:e.length;if(!n)return-1;var i=null==r?0:zo(r);return i<0&&(i=jr(n+i,0)),ar(e,t,i)},gn.inRange=function(e,t,r){return t=Go(t),r===n?(r=t,t=0):r=Go(r),function(e,t,r){return e>=Hr(t,r)&&e=-N&&e<=N},gn.isSet=Fo,gn.isString=Mo,gn.isSymbol=Vo,gn.isTypedArray=Uo,gn.isUndefined=function(e){return e===n},gn.isWeakMap=function(e){return Do(e)&&zs(e)==se},gn.isWeakSet=function(e){return Do(e)&&ei(e)==ae},gn.join=function(e,t){return null==e?"":Kr.call(e,t)},gn.kebabCase=yu,gn.last=Aa,gn.lastIndexOf=function(e,t,r){var i=null==e?0:e.length;if(!i)return-1;var s=i;return r!==n&&(s=(s=zo(r))<0?jr(i+s,0):Hr(s,i-1)),t==t?function(e,t,r){for(var n=r+1;n--;)if(e[n]===t)return n;return n}(e,t,s):sr(e,ur,s,!0)},gn.lowerCase=bu,gn.lowerFirst=Tu,gn.lt=Po,gn.lte=$o,gn.max=function(e){return e&&e.length?Kn(e,Cu,ti):n},gn.maxBy=function(e,t){return e&&e.length?Kn(e,Vs(t,2),ti):n},gn.mean=function(e){return lr(e,Cu)},gn.meanBy=function(e,t){return lr(e,Vs(t,2))},gn.min=function(e){return e&&e.length?Kn(e,Cu,fi):n},gn.minBy=function(e,t){return e&&e.length?Kn(e,Vs(t,2),fi):n},gn.stubArray=Ku,gn.stubFalse=Wu,gn.stubObject=function(){return{}},gn.stubString=function(){return""},gn.stubTrue=function(){return!0},gn.multiply=Zu,gn.nth=function(e,t){return e&&e.length?xi(e,zo(t)):n},gn.noConflict=function(){return Ct._===this&&(Ct._=gt),this},gn.noop=Vu,gn.now=eo,gn.pad=function(e,t,r){e=Ho(e);var n=(t=zo(t))?Dr(e):0;if(!t||n>=t)return e;var i=(t-n)/2;return ys($r(i),r)+e+ys(Pr(i),r)},gn.padEnd=function(e,t,r){e=Ho(e);var n=(t=zo(t))?Dr(e):0;return t&&nt){var i=e;e=t,t=i}if(r||e%1||t%1){var s=Yr();return Hr(e+s*(t-e+Lt("1e-"+((s+"").length-1))),t)}return Ei(e,t)},gn.reduce=function(e,t,r){var n=yo(e)?er:pr,i=arguments.length<3;return n(e,Vs(t,4),r,i,Bn)},gn.reduceRight=function(e,t,r){var n=yo(e)?tr:pr,i=arguments.length<3;return n(e,Vs(t,4),r,i,Gn)},gn.repeat=function(e,t,r){return t=(r?Xs(e,t,r):t===n)?1:zo(t),Ai(Ho(e),t)},gn.replace=function(){var e=arguments,t=Ho(e[0]);return e.length<3?t:t.replace(e[1],e[2])},gn.result=function(e,t,r){var i=-1,s=(t=Xi(t,e)).length;for(s||(s=1,e=n);++iN)return[];var r=M,n=Hr(e,M);t=Vs(t),e-=M;for(var i=dr(n,t);++r=a)return e;var u=r-Dr(i);if(u<1)return i;var l=o?Yi(o,0,u).join(""):e.slice(0,u);if(s===n)return l+i;if(o&&(u+=l.length-u),Oo(s)){if(e.slice(u).search(s)){var c,h=l;for(s.global||(s=rt(s.source,Ho(Ge.exec(s))+"g")),s.lastIndex=0;c=s.exec(h);)var p=c.index;l=l.slice(0,p===n?u:p)}}else if(e.indexOf(Ui(s),u)!=u){var f=l.lastIndexOf(s);f>-1&&(l=l.slice(0,f))}return l+i},gn.unescape=function(e){return(e=Ho(e))&&Ee.test(e)?e.replace(Te,Nr):e},gn.uniqueId=function(e){var t=++ht;return Ho(e)+t},gn.upperCase=Au,gn.upperFirst=Su,gn.each=ja,gn.eachRight=Ha,gn.first=ba,Mu(gn,(Yu={},qn(gn,function(e,t){ct.call(gn.prototype,t)||(Yu[t]=e)}),Yu),{chain:!1}),gn.VERSION="4.17.21",jt(["bind","bindKey","curry","curryRight","partial","partialRight"],function(e){gn[e].placeholder=gn}),jt(["drop","take"],function(e,t){yn.prototype[e]=function(r){r=r===n?1:jr(zo(r),0);var i=this.__filtered__&&!t?new yn(this):this.clone();return i.__filtered__?i.__takeCount__=Hr(r,i.__takeCount__):i.__views__.push({size:Hr(r,M),type:e+(i.__dir__<0?"Right":"")}),i},yn.prototype[e+"Right"]=function(t){return this.reverse()[e](t).reverse()}}),jt(["filter","map","takeWhile"],function(e,t){var r=t+1,n=r==D||3==r;yn.prototype[e]=function(e){var t=this.clone();return t.__iteratees__.push({iteratee:Vs(e,3),type:r}),t.__filtered__=t.__filtered__||n,t}}),jt(["head","last"],function(e,t){var r="take"+(t?"Right":"");yn.prototype[e]=function(){return this[r](1).value()[0]}}),jt(["initial","tail"],function(e,t){var r="drop"+(t?"":"Right");yn.prototype[e]=function(){return this.__filtered__?new yn(this):this[r](1)}}),yn.prototype.compact=function(){return this.filter(Cu)},yn.prototype.find=function(e){return this.filter(e).head()},yn.prototype.findLast=function(e){return this.reverse().find(e)},yn.prototype.invokeMap=Si(function(e,t){return"function"==typeof e?new yn(this):this.map(function(r){return si(r,e,t)})}),yn.prototype.reject=function(e){return this.filter(lo(Vs(e)))},yn.prototype.slice=function(e,t){e=zo(e);var r=this;return r.__filtered__&&(e>0||t<0)?new yn(r):(e<0?r=r.takeRight(-e):e&&(r=r.drop(e)),t!==n&&(r=(t=zo(t))<0?r.dropRight(-t):r.take(t-e)),r)},yn.prototype.takeRightWhile=function(e){return this.reverse().takeWhile(e).reverse()},yn.prototype.toArray=function(){return this.take(M)},qn(yn.prototype,function(e,t){var r=/^(?:filter|find|map|reject)|While$/.test(t),i=/^(?:head|last)$/.test(t),s=gn[i?"take"+("last"==t?"Right":""):t],a=i||/^find/.test(t);s&&(gn.prototype[t]=function(){var t=this.__wrapped__,o=i?[1]:arguments,u=t instanceof yn,l=o[0],c=u||yo(t),h=function(e){var t=s.apply(gn,Qt([e],o));return i&&p?t[0]:t};c&&r&&"function"==typeof l&&1!=l.length&&(u=c=!1);var p=this.__chain__,f=!!this.__actions__.length,d=a&&!p,g=u&&!f;if(!a&&c){t=g?t:new yn(this);var m=e.apply(t,o);return m.__actions__.push({func:Ba,args:[h],thisArg:n}),new xn(m,p)}return d&&g?e.apply(this,o):(m=this.thru(h),d?i?m.value()[0]:m.value():m)})}),jt(["pop","push","shift","sort","splice","unshift"],function(e){var t=st[e],r=/^(?:push|sort|unshift)$/.test(e)?"tap":"thru",n=/^(?:pop|shift)$/.test(e);gn.prototype[e]=function(){var e=arguments;if(n&&!this.__chain__){var i=this.value();return t.apply(yo(i)?i:[],e)}return this[r](function(r){return t.apply(yo(r)?r:[],e)})}}),qn(yn.prototype,function(e,t){var r=gn[t];if(r){var n=r.name+"";ct.call(an,n)||(an[n]=[]),an[n].push({name:t,func:r})}}),an[gs(n,_).name]=[{name:"wrapper",func:n}],yn.prototype.clone=function(){var e=new yn(this.__wrapped__);return e.__actions__=is(this.__actions__),e.__dir__=this.__dir__,e.__filtered__=this.__filtered__,e.__iteratees__=is(this.__iteratees__),e.__takeCount__=this.__takeCount__,e.__views__=is(this.__views__),e},yn.prototype.reverse=function(){if(this.__filtered__){var e=new yn(this);e.__dir__=-1,e.__filtered__=!0}else(e=this.clone()).__dir__*=-1;return e},yn.prototype.value=function(){var e=this.__wrapped__.value(),t=this.__dir__,r=yo(e),n=t<0,i=r?e.length:0,s=function(e,t,r){for(var n=-1,i=r.length;++n=this.__values__.length;return{done:e,value:e?n:this.__values__[this.__index__++]}},gn.prototype.plant=function(e){for(var t,r=this;r instanceof _n;){var i=fa(r);i.__index__=0,i.__values__=n,t?s.__wrapped__=i:t=i;var s=i;r=r.__wrapped__}return s.__wrapped__=e,t},gn.prototype.reverse=function(){var e=this.__wrapped__;if(e instanceof yn){var t=e;return this.__actions__.length&&(t=new yn(this)),(t=t.reverse()).__actions__.push({func:Ba,args:[La],thisArg:n}),new xn(t,this.__chain__)}return this.thru(La)},gn.prototype.toJSON=gn.prototype.valueOf=gn.prototype.value=function(){return zi(this.__wrapped__,this.__actions__)},gn.prototype.first=gn.prototype.head,nr&&(gn.prototype[nr]=function(){return this}),gn}();"function"==typeof define&&"object"==typeof define.amd&&define.amd?(Ct._=Or,define(function(){return Or})):Ot?((Ot.exports=Or)._=Or,Nt._=Or):Ct._=Or}).call(this)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],169:[function(e,t,r){(function(e){function t(e,t){for(var r=0,n=e.length-1;n>=0;n--){var i=e[n];"."===i?e.splice(n,1):".."===i?(e.splice(n,1),r++):r&&(e.splice(n,1),r--)}if(t)for(;r--;r)e.unshift("..");return e}function n(e,t){if(e.filter)return e.filter(t);for(var r=[],n=0;n=-1&&!i;s--){var a=s>=0?arguments[s]:e.cwd();if("string"!=typeof a)throw new TypeError("Arguments to path.resolve must be strings");a&&(r=a+"/"+r,i="/"===a.charAt(0))}return r=t(n(r.split("/"),function(e){return!!e}),!i).join("/"),(i?"/":"")+r||"."},r.normalize=function(e){var s=r.isAbsolute(e),a="/"===i(e,-1);return(e=t(n(e.split("/"),function(e){return!!e}),!s).join("/"))||s||(e="."),e&&a&&(e+="/"),(s?"/":"")+e},r.isAbsolute=function(e){return"/"===e.charAt(0)},r.join=function(){var e=Array.prototype.slice.call(arguments,0);return r.normalize(n(e,function(e,t){if("string"!=typeof e)throw new TypeError("Arguments to path.join must be strings");return e}).join("/"))},r.relative=function(e,t){function n(e){for(var t=0;t=0&&""===e[r];r--);return t>r?[]:e.slice(t,r-t+1)}e=r.resolve(e).substr(1),t=r.resolve(t).substr(1);for(var i=n(e.split("/")),s=n(t.split("/")),a=Math.min(i.length,s.length),o=a,u=0;u=1;--s)if(47===(t=e.charCodeAt(s))){if(!i){n=s;break}}else i=!1;return-1===n?r?"/":".":r&&1===n?"/":e.slice(0,n)},r.basename=function(e,t){var r=function(e){"string"!=typeof e&&(e+="");var t,r=0,n=-1,i=!0;for(t=e.length-1;t>=0;--t)if(47===e.charCodeAt(t)){if(!i){r=t+1;break}}else-1===n&&(i=!1,n=t+1);return-1===n?"":e.slice(r,n)}(e);return t&&r.substr(-1*t.length)===t&&(r=r.substr(0,r.length-t.length)),r},r.extname=function(e){"string"!=typeof e&&(e+="");for(var t=-1,r=0,n=-1,i=!0,s=0,a=e.length-1;a>=0;--a){var o=e.charCodeAt(a);if(47!==o)-1===n&&(i=!1,n=a+1),46===o?-1===t?t=a:1!==s&&(s=1):-1!==t&&(s=-1);else if(!i){r=a+1;break}}return-1===t||-1===n||0===s||1===s&&t===n-1&&t===r+1?"":e.slice(t,n)};var i="b"==="ab".substr(-1)?function(e,t,r){return e.substr(t,r)}:function(e,t,r){return t<0&&(t=e.length+t),e.substr(t,r)}}).call(this,e("_process"))},{_process:170}],170:[function(e,t,r){var n,i,s=t.exports={};function a(){throw new Error("setTimeout has not been defined")}function o(){throw new Error("clearTimeout has not been defined")}function u(e){if(n===setTimeout)return setTimeout(e,0);if((n===a||!n)&&setTimeout)return n=setTimeout,setTimeout(e,0);try{return n(e,0)}catch(t){try{return n.call(null,e,0)}catch(t){return n.call(this,e,0)}}}!function(){try{n="function"==typeof setTimeout?setTimeout:a}catch(e){n=a}try{i="function"==typeof clearTimeout?clearTimeout:o}catch(e){i=o}}();var l,c=[],h=!1,p=-1;function f(){h&&l&&(h=!1,l.length?c=l.concat(c):p=-1,c.length&&d())}function d(){if(!h){var e=u(f);h=!0;for(var t=c.length;t;){for(l=c,c=[];++p1)for(var r=1;r10||10===n&&i>=10}).call(this,e("_process"))},{_process:452}],3:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});const n=e("./providers/async"),i=e("./providers/sync"),s=e("./settings");function o(e={}){return e instanceof s.default?e:new s.default(e)}r.Settings=s.default,r.scandir=function(e,t,r){if("function"==typeof t)return n.read(e,o(),t);n.read(e,o(t),r)},r.scandirSync=function(e,t){const r=o(t);return i.read(e,r)}},{"./providers/async":4,"./providers/sync":5,"./settings":6}],4:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});const n=e("@nodelib/fs.stat"),i=e("run-parallel"),s=e("../constants"),o=e("../utils/index");function a(e,t,r){t.fs.readdir(e,{withFileTypes:!0},(n,s)=>{if(n)return l(r,n);const a=s.map(r=>({dirent:r,name:r.name,path:`${e}${t.pathSegmentSeparator}${r.name}`}));if(!t.followSymbolicLinks)return c(r,a);const u=a.map(e=>(function(e,t){return r=>{if(!e.dirent.isSymbolicLink())return r(null,e);t.fs.stat(e.path,(n,i)=>n?t.throwErrorOnBrokenSymbolicLink?r(n):r(null,e):(e.dirent=o.fs.createDirentFromStats(e.name,i),r(null,e)))}})(e,t));i(u,(e,t)=>{if(e)return l(r,e);c(r,t)})})}function u(e,t,r){t.fs.readdir(e,(s,a)=>{if(s)return l(r,s);const u=a.map(r=>`${e}${t.pathSegmentSeparator}${r}`),h=u.map(e=>r=>n.stat(e,t.fsStatSettings,r));i(h,(e,n)=>{if(e)return l(r,e);const i=[];for(let e=0;e{const n={dirent:r,name:r.name,path:`${e}${t.pathSegmentSeparator}${r.name}`};if(n.dirent.isSymbolicLink()&&t.followSymbolicLinks)try{const e=t.fs.statSync(n.path);n.dirent=s.fs.createDirentFromStats(n.name,e)}catch(e){if(t.throwErrorOnBrokenSymbolicLink)throw e}return n})}function a(e,t){return t.fs.readdirSync(e).map(r=>{const i=`${e}${t.pathSegmentSeparator}${r}`,o=n.statSync(i,t.fsStatSettings),a={name:r,path:i,dirent:s.fs.createDirentFromStats(r,o)};return t.stats&&(a.stats=o),a})}r.read=function(e,t){return!t.stats&&i.IS_SUPPORT_READDIR_WITH_FILE_TYPES?o(e,t):a(e,t)},r.readdirWithFileTypes=o,r.readdir=a},{"../constants":2,"../utils/index":8,"@nodelib/fs.stat":10}],6:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});const n=e("path"),i=e("@nodelib/fs.stat"),s=e("./adapters/fs");r.default=class{constructor(e={}){this._options=e,this.followSymbolicLinks=this._getValue(this._options.followSymbolicLinks,!1),this.fs=s.createFileSystemAdapter(this._options.fs),this.pathSegmentSeparator=this._getValue(this._options.pathSegmentSeparator,n.sep),this.stats=this._getValue(this._options.stats,!1),this.throwErrorOnBrokenSymbolicLink=this._getValue(this._options.throwErrorOnBrokenSymbolicLink,!0),this.fsStatSettings=new i.Settings({followSymbolicLink:this.followSymbolicLinks,fs:this.fs,throwErrorOnBrokenSymbolicLink:this.throwErrorOnBrokenSymbolicLink})}_getValue(e,t){return void 0===e?t:e}}},{"./adapters/fs":1,"@nodelib/fs.stat":10,path:397}],7:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});class n{constructor(e,t){this.name=e,this.isBlockDevice=t.isBlockDevice.bind(t),this.isCharacterDevice=t.isCharacterDevice.bind(t),this.isDirectory=t.isDirectory.bind(t),this.isFIFO=t.isFIFO.bind(t),this.isFile=t.isFile.bind(t),this.isSocket=t.isSocket.bind(t),this.isSymbolicLink=t.isSymbolicLink.bind(t)}}r.createDirentFromStats=function(e,t){return new n(e,t)}},{}],8:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});const n=e("./fs");r.fs=n},{"./fs":7}],9:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});const n=e("fs");r.FILE_SYSTEM_ADAPTER={lstat:n.lstat,stat:n.stat,lstatSync:n.lstatSync,statSync:n.statSync},r.createFileSystemAdapter=function(e){return e?Object.assign({},r.FILE_SYSTEM_ADAPTER,e):r.FILE_SYSTEM_ADAPTER}},{fs:290}],10:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});const n=e("./providers/async"),i=e("./providers/sync"),s=e("./settings");function o(e={}){return e instanceof s.default?e:new s.default(e)}r.Settings=s.default,r.stat=function(e,t,r){if("function"==typeof t)return n.read(e,o(),t);n.read(e,o(t),r)},r.statSync=function(e,t){const r=o(t);return i.read(e,r)}},{"./providers/async":11,"./providers/sync":12,"./settings":13}],11:[function(e,t,r){"use strict";function n(e,t){e(t)}function i(e,t){e(null,t)}Object.defineProperty(r,"__esModule",{value:!0}),r.read=function(e,t,r){t.fs.lstat(e,(s,o)=>s?n(r,s):o.isSymbolicLink()&&t.followSymbolicLink?void t.fs.stat(e,(e,s)=>{if(e)return t.throwErrorOnBrokenSymbolicLink?n(r,e):i(r,o);t.markSymbolicLink&&(s.isSymbolicLink=(()=>!0)),i(r,s)}):i(r,o))}},{}],12:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.read=function(e,t){const r=t.fs.lstatSync(e);if(!r.isSymbolicLink()||!t.followSymbolicLink)return r;try{const n=t.fs.statSync(e);return t.markSymbolicLink&&(n.isSymbolicLink=(()=>!0)),n}catch(e){if(!t.throwErrorOnBrokenSymbolicLink)return r;throw e}}},{}],13:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});const n=e("./adapters/fs");r.default=class{constructor(e={}){this._options=e,this.followSymbolicLink=this._getValue(this._options.followSymbolicLink,!0),this.fs=n.createFileSystemAdapter(this._options.fs),this.markSymbolicLink=this._getValue(this._options.markSymbolicLink,!1),this.throwErrorOnBrokenSymbolicLink=this._getValue(this._options.throwErrorOnBrokenSymbolicLink,!0)}_getValue(e,t){return void 0===e?t:e}}},{"./adapters/fs":9}],14:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});const n=e("./providers/async"),i=e("./providers/stream"),s=e("./providers/sync"),o=e("./settings");function a(e={}){return e instanceof o.default?e:new o.default(e)}r.Settings=o.default,r.walk=function(e,t,r){if("function"==typeof t)return new n.default(e,a()).read(t);new n.default(e,a(t)).read(r)},r.walkSync=function(e,t){const r=a(t);return new s.default(e,r).read()},r.walkStream=function(e,t){const r=a(t);return new i.default(e,r).read()}},{"./providers/async":15,"./providers/stream":16,"./providers/sync":17,"./settings":22}],15:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});const n=e("../readers/async");r.default=class{constructor(e,t){this._root=e,this._settings=t,this._reader=new n.default(this._root,this._settings),this._storage=new Set}read(e){this._reader.onError(t=>{!function(e,t){e(t)}(e,t)}),this._reader.onEntry(e=>{this._storage.add(e)}),this._reader.onEnd(()=>{!function(e,t){e(null,t)}(e,Array.from(this._storage))}),this._reader.read()}}},{"../readers/async":18}],16:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});const n=e("stream"),i=e("../readers/async");r.default=class{constructor(e,t){this._root=e,this._settings=t,this._reader=new i.default(this._root,this._settings),this._stream=new n.Readable({objectMode:!0,read:()=>{},destroy:this._reader.destroy.bind(this._reader)})}read(){return this._reader.onError(e=>{this._stream.emit("error",e)}),this._reader.onEntry(e=>{this._stream.push(e)}),this._reader.onEnd(()=>{this._stream.push(null)}),this._reader.read(),this._stream}}},{"../readers/async":18,stream:518}],17:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});const n=e("../readers/sync");r.default=class{constructor(e,t){this._root=e,this._settings=t,this._reader=new n.default(this._root,this._settings)}read(){return this._reader.read()}}},{"../readers/sync":21}],18:[function(e,t,r){(function(t){"use strict";Object.defineProperty(r,"__esModule",{value:!0});const n=e("events"),i=e("@nodelib/fs.scandir"),s=e("fastq"),o=e("./common"),a=e("./reader");r.default=class extends a.default{constructor(e,t){super(e,t),this._settings=t,this._scandir=i.scandir,this._emitter=new n.EventEmitter,this._queue=s(this._worker.bind(this),this._settings.concurrency),this._isFatalError=!1,this._isDestroyed=!1,this._queue.drain=(()=>{this._isFatalError||this._emitter.emit("end")})}read(){return this._isFatalError=!1,this._isDestroyed=!1,t(()=>{this._pushToQueue(this._root,this._settings.basePath)}),this._emitter}destroy(){if(this._isDestroyed)throw new Error("The reader is already destroyed");this._isDestroyed=!0,this._queue.killAndDrain()}onEntry(e){this._emitter.on("entry",e)}onError(e){this._emitter.once("error",e)}onEnd(e){this._emitter.once("end",e)}_pushToQueue(e,t){const r={dir:e,base:t};this._queue.push(r,e=>{e&&this._handleError(e)})}_worker(e,t){this._scandir(e.dir,this._settings.fsScandirSettings,(r,n)=>{if(r)return t(r,void 0);for(const t of n)this._handleEntry(t,e.base);t(null,void 0)})}_handleError(e){o.isFatalError(this._settings,e)&&(this._isFatalError=!0,this._isDestroyed=!0,this._emitter.emit("error",e))}_handleEntry(e,t){if(this._isDestroyed||this._isFatalError)return;const r=e.path;void 0!==t&&(e.path=o.joinPathSegments(t,e.name,this._settings.pathSegmentSeparator)),o.isAppliedFilter(this._settings.entryFilter,e)&&this._emitEntry(e),e.dirent.isDirectory()&&o.isAppliedFilter(this._settings.deepFilter,e)&&this._pushToQueue(r,e.path)}_emitEntry(e){this._emitter.emit("entry",e)}}}).call(this,e("timers").setImmediate)},{"./common":19,"./reader":20,"@nodelib/fs.scandir":3,events:292,fastq:95,timers:529}],19:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.isFatalError=function(e,t){return null===e.errorFilter||!e.errorFilter(t)},r.isAppliedFilter=function(e,t){return null===e||e(t)},r.replacePathSegmentSeparator=function(e,t){return e.split(/[\\\/]/).join(t)},r.joinPathSegments=function(e,t,r){return""===e?t:e+r+t}},{}],20:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});const n=e("./common");r.default=class{constructor(e,t){this._root=e,this._settings=t,this._root=n.replacePathSegmentSeparator(e,t.pathSegmentSeparator)}}},{"./common":19}],21:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});const n=e("@nodelib/fs.scandir"),i=e("./common"),s=e("./reader");r.default=class extends s.default{constructor(){super(...arguments),this._scandir=n.scandirSync,this._storage=new Set,this._queue=new Set}read(){return this._pushToQueue(this._root,this._settings.basePath),this._handleQueue(),Array.from(this._storage)}_pushToQueue(e,t){this._queue.add({dir:e,base:t})}_handleQueue(){for(const e of this._queue.values())this._handleDirectory(e.dir,e.base)}_handleDirectory(e,t){try{const r=this._scandir(e,this._settings.fsScandirSettings);for(const e of r)this._handleEntry(e,t)}catch(e){this._handleError(e)}}_handleError(e){if(i.isFatalError(this._settings,e))throw e}_handleEntry(e,t){const r=e.path;void 0!==t&&(e.path=i.joinPathSegments(t,e.name,this._settings.pathSegmentSeparator)),i.isAppliedFilter(this._settings.entryFilter,e)&&this._pushToStorage(e),e.dirent.isDirectory()&&i.isAppliedFilter(this._settings.deepFilter,e)&&this._pushToQueue(r,e.path)}_pushToStorage(e){this._storage.add(e)}}},{"./common":19,"./reader":20,"@nodelib/fs.scandir":3}],22:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});const n=e("path"),i=e("@nodelib/fs.scandir");r.default=class{constructor(e={}){this._options=e,this.basePath=this._getValue(this._options.basePath,void 0),this.concurrency=this._getValue(this._options.concurrency,1/0),this.deepFilter=this._getValue(this._options.deepFilter,null),this.entryFilter=this._getValue(this._options.entryFilter,null),this.errorFilter=this._getValue(this._options.errorFilter,null),this.pathSegmentSeparator=this._getValue(this._options.pathSegmentSeparator,n.sep),this.fsScandirSettings=new i.Settings({followSymbolicLinks:this._options.followSymbolicLinks,fs:this._options.fs,pathSegmentSeparator:this._options.pathSegmentSeparator,stats:this._options.stats,throwErrorOnBrokenSymbolicLink:this._options.throwErrorOnBrokenSymbolicLink})}_getValue(e,t){return void 0===e?t:e}}},{"@nodelib/fs.scandir":3,path:397}],23:[function(e,t,r){var n,i;n=this,i=function(e){"use strict";var t={3:"abstract boolean byte char class double enum export extends final float goto implements import int interface long native package private protected public short static super synchronized throws transient volatile",5:"class enum extends super const export import",6:"enum",strict:"implements interface let package private protected public static yield",strictBind:"eval arguments"},r="break case catch continue debugger default do else finally for function if return switch throw try var while with null true false instanceof typeof void delete new in this",n={5:r,"5module":r+" export import",6:r+" const class extends export import super"},i=/^in(stanceof)?$/,s="ªµºÀ-ÖØ-öø-ˁˆ-ˑˠ-ˤˬˮͰ-ʹͶͷͺ-ͽͿΆΈ-ΊΌΎ-ΡΣ-ϵϷ-ҁҊ-ԯԱ-Ֆՙՠ-ֈא-תׯ-ײؠ-يٮٯٱ-ۓەۥۦۮۯۺ-ۼۿܐܒ-ܯݍ-ޥޱߊ-ߪߴߵߺࠀ-ࠕࠚࠤࠨࡀ-ࡘࡠ-ࡪࢠ-ࢴࢶ-ࣇऄ-हऽॐक़-ॡॱ-ঀঅ-ঌএঐও-নপ-রলশ-হঽৎড়ঢ়য়-ৡৰৱৼਅ-ਊਏਐਓ-ਨਪ-ਰਲਲ਼ਵਸ਼ਸਹਖ਼-ੜਫ਼ੲ-ੴઅ-ઍએ-ઑઓ-નપ-રલળવ-હઽૐૠૡૹଅ-ଌଏଐଓ-ନପ-ରଲଳଵ-ହଽଡ଼ଢ଼ୟ-ୡୱஃஅ-ஊஎ-ஐஒ-கஙசஜஞடணதந-பம-ஹௐఅ-ఌఎ-ఐఒ-నప-హఽౘ-ౚౠౡಀಅ-ಌಎ-ಐಒ-ನಪ-ಳವ-ಹಽೞೠೡೱೲഄ-ഌഎ-ഐഒ-ഺഽൎൔ-ൖൟ-ൡൺ-ൿඅ-ඖක-නඳ-රලව-ෆก-ะาำเ-ๆກຂຄຆ-ຊຌ-ຣລວ-ະາຳຽເ-ໄໆໜ-ໟༀཀ-ཇཉ-ཬྈ-ྌက-ဪဿၐ-ၕၚ-ၝၡၥၦၮ-ၰၵ-ႁႎႠ-ჅჇჍა-ჺჼ-ቈቊ-ቍቐ-ቖቘቚ-ቝበ-ኈኊ-ኍነ-ኰኲ-ኵኸ-ኾዀዂ-ዅወ-ዖዘ-ጐጒ-ጕጘ-ፚᎀ-ᎏᎠ-Ᏽᏸ-ᏽᐁ-ᙬᙯ-ᙿᚁ-ᚚᚠ-ᛪᛮ-ᛸᜀ-ᜌᜎ-ᜑᜠ-ᜱᝀ-ᝑᝠ-ᝬᝮ-ᝰក-ឳៗៜᠠ-ᡸᢀ-ᢨᢪᢰ-ᣵᤀ-ᤞᥐ-ᥭᥰ-ᥴᦀ-ᦫᦰ-ᧉᨀ-ᨖᨠ-ᩔᪧᬅ-ᬳᭅ-ᭋᮃ-ᮠᮮᮯᮺ-ᯥᰀ-ᰣᱍ-ᱏᱚ-ᱽᲀ-ᲈᲐ-ᲺᲽ-Ჿᳩ-ᳬᳮ-ᳳᳵᳶᳺᴀ-ᶿḀ-ἕἘ-Ἕἠ-ὅὈ-Ὅὐ-ὗὙὛὝὟ-ώᾀ-ᾴᾶ-ᾼιῂ-ῄῆ-ῌῐ-ΐῖ-Ίῠ-Ῥῲ-ῴῶ-ῼⁱⁿₐ-ₜℂℇℊ-ℓℕ℘-ℝℤΩℨK-ℹℼ-ℿⅅ-ⅉⅎⅠ-ↈⰀ-Ⱞⰰ-ⱞⱠ-ⳤⳫ-ⳮⳲⳳⴀ-ⴥⴧⴭⴰ-ⵧⵯⶀ-ⶖⶠ-ⶦⶨ-ⶮⶰ-ⶶⶸ-ⶾⷀ-ⷆⷈ-ⷎⷐ-ⷖⷘ-ⷞ々-〇〡-〩〱-〵〸-〼ぁ-ゖ゛-ゟァ-ヺー-ヿㄅ-ㄯㄱ-ㆎㆠ-ㆿㇰ-ㇿ㐀-䶿一-鿼ꀀ-ꒌꓐ-ꓽꔀ-ꘌꘐ-ꘟꘪꘫꙀ-ꙮꙿ-ꚝꚠ-ꛯꜗ-ꜟꜢ-ꞈꞋ-ꞿꟂ-ꟊꟵ-ꠁꠃ-ꠅꠇ-ꠊꠌ-ꠢꡀ-ꡳꢂ-ꢳꣲ-ꣷꣻꣽꣾꤊ-ꤥꤰ-ꥆꥠ-ꥼꦄ-ꦲꧏꧠ-ꧤꧦ-ꧯꧺ-ꧾꨀ-ꨨꩀ-ꩂꩄ-ꩋꩠ-ꩶꩺꩾ-ꪯꪱꪵꪶꪹ-ꪽꫀꫂꫛ-ꫝꫠ-ꫪꫲ-ꫴꬁ-ꬆꬉ-ꬎꬑ-ꬖꬠ-ꬦꬨ-ꬮꬰ-ꭚꭜ-ꭩꭰ-ꯢ가-힣ힰ-ퟆퟋ-ퟻ豈-舘並-龎ff-stﬓ-ﬗיִײַ-ﬨשׁ-זּטּ-לּמּנּסּףּפּצּ-ﮱﯓ-ﴽﵐ-ﶏﶒ-ﷇﷰ-ﷻﹰ-ﹴﹶ-ﻼA-Za-zヲ-하-ᅦᅧ-ᅬᅭ-ᅲᅳ-ᅵ",o="‌‍·̀-ͯ·҃-֑҇-ׇֽֿׁׂׅׄؐ-ًؚ-٩ٰۖ-ۜ۟-۪ۤۧۨ-ۭ۰-۹ܑܰ-݊ަ-ް߀-߉߫-߽߳ࠖ-࠙ࠛ-ࠣࠥ-ࠧࠩ-࡙࠭-࡛࣓-ࣣ࣡-ःऺ-़ा-ॏ॑-ॗॢॣ०-९ঁ-ঃ়া-ৄেৈো-্ৗৢৣ০-৯৾ਁ-ਃ਼ਾ-ੂੇੈੋ-੍ੑ੦-ੱੵઁ-ઃ઼ા-ૅે-ૉો-્ૢૣ૦-૯ૺ-૿ଁ-ଃ଼ା-ୄେୈୋ-୍୕-ୗୢୣ୦-୯ஂா-ூெ-ைொ-்ௗ௦-௯ఀ-ఄా-ౄె-ైొ-్ౕౖౢౣ౦-౯ಁ-ಃ಼ಾ-ೄೆ-ೈೊ-್ೕೖೢೣ೦-೯ഀ-ഃ഻഼ാ-ൄെ-ൈൊ-്ൗൢൣ൦-൯ඁ-ඃ්ා-ුූෘ-ෟ෦-෯ෲෳัิ-ฺ็-๎๐-๙ັິ-ຼ່-ໍ໐-໙༘༙༠-༩༹༵༷༾༿ཱ-྄྆྇ྍ-ྗྙ-ྼ࿆ါ-ှ၀-၉ၖ-ၙၞ-ၠၢ-ၤၧ-ၭၱ-ၴႂ-ႍႏ-ႝ፝-፟፩-፱ᜒ-᜔ᜲ-᜴ᝒᝓᝲᝳ឴-៓៝០-៩᠋-᠍᠐-᠙ᢩᤠ-ᤫᤰ-᤻᥆-᥏᧐-᧚ᨗ-ᨛᩕ-ᩞ᩠-᩿᩼-᪉᪐-᪙᪰-᪽ᪿᫀᬀ-ᬄ᬴-᭄᭐-᭙᭫-᭳ᮀ-ᮂᮡ-ᮭ᮰-᮹᯦-᯳ᰤ-᰷᱀-᱉᱐-᱙᳐-᳔᳒-᳨᳭᳴᳷-᳹᷀-᷹᷻-᷿‿⁀⁔⃐-⃥⃜⃡-⃰⳯-⵿⳱ⷠ-〪ⷿ-゙゚〯꘠-꘩꙯ꙴ-꙽ꚞꚟ꛰꛱ꠂ꠆ꠋꠣ-ꠧ꠬ꢀꢁꢴ-ꣅ꣐-꣙꣠-꣱ꣿ-꤉ꤦ-꤭ꥇ-꥓ꦀ-ꦃ꦳-꧀꧐-꧙ꧥ꧰-꧹ꨩ-ꨶꩃꩌꩍ꩐-꩙ꩻ-ꩽꪰꪲ-ꪴꪷꪸꪾ꪿꫁ꫫ-ꫯꫵ꫶ꯣ-ꯪ꯬꯭꯰-꯹ﬞ︀-️︠-︯︳︴﹍-﹏0-9_",a=new RegExp("["+s+"]"),u=new RegExp("["+s+o+"]");s=o=null;var l=[0,11,2,25,2,18,2,1,2,14,3,13,35,122,70,52,268,28,4,48,48,31,14,29,6,37,11,29,3,35,5,7,2,4,43,157,19,35,5,35,5,39,9,51,157,310,10,21,11,7,153,5,3,0,2,43,2,1,4,0,3,22,11,22,10,30,66,18,2,1,11,21,11,25,71,55,7,1,65,0,16,3,2,2,2,28,43,28,4,28,36,7,2,27,28,53,11,21,11,18,14,17,111,72,56,50,14,50,14,35,349,41,7,1,79,28,11,0,9,21,107,20,28,22,13,52,76,44,33,24,27,35,30,0,3,0,9,34,4,0,13,47,15,3,22,0,2,0,36,17,2,24,85,6,2,0,2,3,2,14,2,9,8,46,39,7,3,1,3,21,2,6,2,1,2,4,4,0,19,0,13,4,159,52,19,3,21,2,31,47,21,1,2,0,185,46,42,3,37,47,21,0,60,42,14,0,72,26,230,43,117,63,32,7,3,0,3,7,2,1,2,23,16,0,2,0,95,7,3,38,17,0,2,0,29,0,11,39,8,0,22,0,12,45,20,0,35,56,264,8,2,36,18,0,50,29,113,6,2,1,2,37,22,0,26,5,2,1,2,31,15,0,328,18,190,0,80,921,103,110,18,195,2749,1070,4050,582,8634,568,8,30,114,29,19,47,17,3,32,20,6,18,689,63,129,74,6,0,67,12,65,1,2,0,29,6135,9,1237,43,8,8952,286,50,2,18,3,9,395,2309,106,6,12,4,8,8,9,5991,84,2,70,2,1,3,0,3,1,3,3,2,11,2,0,2,6,2,64,2,3,3,7,2,6,2,27,2,3,2,4,2,0,4,6,2,339,3,24,2,24,2,30,2,24,2,30,2,24,2,30,2,24,2,30,2,24,2,7,2357,44,11,6,17,0,370,43,1301,196,60,67,8,0,1205,3,2,26,2,1,2,0,3,0,2,9,2,3,2,0,2,0,7,0,5,0,2,0,2,0,2,2,2,1,2,0,3,0,2,0,2,0,2,0,2,0,2,1,2,0,3,3,2,6,2,3,2,3,2,0,2,9,2,16,6,2,2,4,2,16,4421,42717,35,4148,12,221,3,5761,15,7472,3104,541,1507,4938],c=[509,0,227,0,150,4,294,9,1368,2,2,1,6,3,41,2,5,0,166,1,574,3,9,9,370,1,154,10,176,2,54,14,32,9,16,3,46,10,54,9,7,2,37,13,2,9,6,1,45,0,13,2,49,13,9,3,2,11,83,11,7,0,161,11,6,9,7,3,56,1,2,6,3,1,3,2,10,0,11,1,3,6,4,4,193,17,10,9,5,0,82,19,13,9,214,6,3,8,28,1,83,16,16,9,82,12,9,9,84,14,5,9,243,14,166,9,71,5,2,1,3,3,2,0,2,1,13,9,120,6,3,6,4,0,29,9,41,6,2,3,9,0,10,10,47,15,406,7,2,7,17,9,57,21,2,13,123,5,4,0,2,1,2,6,2,0,9,9,49,4,2,1,2,4,9,9,330,3,19306,9,135,4,60,6,26,9,1014,0,2,54,8,3,82,0,12,1,19628,1,5319,4,4,5,9,7,3,6,31,3,149,2,1418,49,513,54,5,49,9,0,15,0,23,4,2,14,1361,6,2,16,3,6,2,1,2,4,262,6,10,9,419,13,1495,6,110,6,6,9,4759,9,787719,239];function h(e,t){for(var r=65536,n=0;ne)return!1;if((r+=t[n+1])>=e)return!0}}function p(e,t){return e<65?36===e:e<91||(e<97?95===e:e<123||(e<=65535?e>=170&&a.test(String.fromCharCode(e)):!1!==t&&h(e,l)))}function f(e,t){return e<48?36===e:e<58||!(e<65)&&(e<91||(e<97?95===e:e<123||(e<=65535?e>=170&&u.test(String.fromCharCode(e)):!1!==t&&(h(e,l)||h(e,c)))))}var d=function(e,t){void 0===t&&(t={}),this.label=e,this.keyword=t.keyword,this.beforeExpr=!!t.beforeExpr,this.startsExpr=!!t.startsExpr,this.isLoop=!!t.isLoop,this.isAssign=!!t.isAssign,this.prefix=!!t.prefix,this.postfix=!!t.postfix,this.binop=t.binop||null,this.updateContext=null};function m(e,t){return new d(e,{beforeExpr:!0,binop:t})}var g={beforeExpr:!0},v={startsExpr:!0},y={};function _(e,t){return void 0===t&&(t={}),t.keyword=e,y[e]=new d(e,t)}var b={num:new d("num",v),regexp:new d("regexp",v),string:new d("string",v),name:new d("name",v),eof:new d("eof"),bracketL:new d("[",{beforeExpr:!0,startsExpr:!0}),bracketR:new d("]"),braceL:new d("{",{beforeExpr:!0,startsExpr:!0}),braceR:new d("}"),parenL:new d("(",{beforeExpr:!0,startsExpr:!0}),parenR:new d(")"),comma:new d(",",g),semi:new d(";",g),colon:new d(":",g),dot:new d("."),question:new d("?",g),questionDot:new d("?."),arrow:new d("=>",g),template:new d("template"),invalidTemplate:new d("invalidTemplate"),ellipsis:new d("...",g),backQuote:new d("`",v),dollarBraceL:new d("${",{beforeExpr:!0,startsExpr:!0}),eq:new d("=",{beforeExpr:!0,isAssign:!0}),assign:new d("_=",{beforeExpr:!0,isAssign:!0}),incDec:new d("++/--",{prefix:!0,postfix:!0,startsExpr:!0}),prefix:new d("!/~",{beforeExpr:!0,prefix:!0,startsExpr:!0}),logicalOR:m("||",1),logicalAND:m("&&",2),bitwiseOR:m("|",3),bitwiseXOR:m("^",4),bitwiseAND:m("&",5),equality:m("==/!=/===/!==",6),relational:m("/<=/>=",7),bitShift:m("<>/>>>",8),plusMin:new d("+/-",{beforeExpr:!0,binop:9,prefix:!0,startsExpr:!0}),modulo:m("%",10),star:m("*",10),slash:m("/",10),starstar:new d("**",{beforeExpr:!0}),coalesce:m("??",1),_break:_("break"),_case:_("case",g),_catch:_("catch"),_continue:_("continue"),_debugger:_("debugger"),_default:_("default",g),_do:_("do",{isLoop:!0,beforeExpr:!0}),_else:_("else",g),_finally:_("finally"),_for:_("for",{isLoop:!0}),_function:_("function",v),_if:_("if"),_return:_("return",g),_switch:_("switch"),_throw:_("throw",g),_try:_("try"),_var:_("var"),_const:_("const"),_while:_("while",{isLoop:!0}),_with:_("with"),_new:_("new",{beforeExpr:!0,startsExpr:!0}),_this:_("this",v),_super:_("super",v),_class:_("class",v),_extends:_("extends",g),_export:_("export"),_import:_("import",v),_null:_("null",v),_true:_("true",v),_false:_("false",v),_in:_("in",{beforeExpr:!0,binop:7}),_instanceof:_("instanceof",{beforeExpr:!0,binop:7}),_typeof:_("typeof",{beforeExpr:!0,prefix:!0,startsExpr:!0}),_void:_("void",{beforeExpr:!0,prefix:!0,startsExpr:!0}),_delete:_("delete",{beforeExpr:!0,prefix:!0,startsExpr:!0})},x=/\r\n?|\n|\u2028|\u2029/,w=new RegExp(x.source,"g");function E(e,t){return 10===e||13===e||!t&&(8232===e||8233===e)}var T=/[\u1680\u2000-\u200a\u202f\u205f\u3000\ufeff]/,A=/(?:\s|\/\/.*|\/\*[^]*?\*\/)*/g,S=Object.prototype,k=S.hasOwnProperty,C=S.toString;function I(e,t){return k.call(e,t)}var R=Array.isArray||function(e){return"[object Array]"===C.call(e)};function O(e){return new RegExp("^(?:"+e.replace(/ /g,"|")+")$")}var L=function(e,t){this.line=e,this.column=t};L.prototype.offset=function(e){return new L(this.line,this.column+e)};var P=function(e,t,r){this.start=t,this.end=r,null!==e.sourceFile&&(this.source=e.sourceFile)};function M(e,t){for(var r=1,n=0;;){w.lastIndex=n;var i=w.exec(e);if(!(i&&i.index=2015&&(t.ecmaVersion-=2009),null==t.allowReserved&&(t.allowReserved=t.ecmaVersion<5),R(t.onToken)){var n=t.onToken;t.onToken=function(e){return n.push(e)}}return R(t.onComment)&&(t.onComment=function(e,t){return function(r,n,i,s,o,a){var u={type:r?"Block":"Line",value:n,start:i,end:s};e.locations&&(u.loc=new P(this,o,a)),e.ranges&&(u.range=[i,s]),t.push(u)}}(t,t.onComment)),t}var D=2,F=1|D,j=4,U=8;function $(e,t){return D|(e?j:0)|(t?U:0)}var V=function(e,r,i){this.options=e=N(e),this.sourceFile=e.sourceFile,this.keywords=O(n[e.ecmaVersion>=6?6:"module"===e.sourceType?"5module":5]);var s="";if(!0!==e.allowReserved){for(var o=e.ecmaVersion;!(s=t[o]);o--);"module"===e.sourceType&&(s+=" await")}this.reservedWords=O(s);var a=(s?s+" ":"")+t.strict;this.reservedWordsStrict=O(a),this.reservedWordsStrictBind=O(a+" "+t.strictBind),this.input=String(r),this.containsEsc=!1,i?(this.pos=i,this.lineStart=this.input.lastIndexOf("\n",i-1)+1,this.curLine=this.input.slice(0,this.lineStart).split(x).length):(this.pos=this.lineStart=0,this.curLine=1),this.type=b.eof,this.value=null,this.start=this.end=this.pos,this.startLoc=this.endLoc=this.curPosition(),this.lastTokEndLoc=this.lastTokStartLoc=null,this.lastTokStart=this.lastTokEnd=this.pos,this.context=this.initialContext(),this.exprAllowed=!0,this.inModule="module"===e.sourceType,this.strict=this.inModule||this.strictDirective(this.pos),this.potentialArrowAt=-1,this.yieldPos=this.awaitPos=this.awaitIdentPos=0,this.labels=[],this.undefinedExports={},0===this.pos&&e.allowHashBang&&"#!"===this.input.slice(0,2)&&this.skipLineComment(2),this.scopeStack=[],this.enterScope(1),this.regexpState=null},G={inFunction:{configurable:!0},inGenerator:{configurable:!0},inAsync:{configurable:!0},allowSuper:{configurable:!0},allowDirectSuper:{configurable:!0},treatFunctionsAsVar:{configurable:!0}};V.prototype.parse=function(){var e=this.options.program||this.startNode();return this.nextToken(),this.parseTopLevel(e)},G.inFunction.get=function(){return(this.currentVarScope().flags&D)>0},G.inGenerator.get=function(){return(this.currentVarScope().flags&U)>0},G.inAsync.get=function(){return(this.currentVarScope().flags&j)>0},G.allowSuper.get=function(){return(64&this.currentThisScope().flags)>0},G.allowDirectSuper.get=function(){return(128&this.currentThisScope().flags)>0},G.treatFunctionsAsVar.get=function(){return this.treatFunctionsAsVarInScope(this.currentScope())},V.prototype.inNonArrowFunction=function(){return(this.currentThisScope().flags&D)>0},V.extend=function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];for(var r=this,n=0;n=,?^&]/.test(i)||"!"===i&&"="===this.input.charAt(n+1))}e+=t[0].length,A.lastIndex=e,e+=A.exec(this.input)[0].length,";"===this.input[e]&&e++}},z.eat=function(e){return this.type===e&&(this.next(),!0)},z.isContextual=function(e){return this.type===b.name&&this.value===e&&!this.containsEsc},z.eatContextual=function(e){return!!this.isContextual(e)&&(this.next(),!0)},z.expectContextual=function(e){this.eatContextual(e)||this.unexpected()},z.canInsertSemicolon=function(){return this.type===b.eof||this.type===b.braceR||x.test(this.input.slice(this.lastTokEnd,this.start))},z.insertSemicolon=function(){if(this.canInsertSemicolon())return this.options.onInsertedSemicolon&&this.options.onInsertedSemicolon(this.lastTokEnd,this.lastTokEndLoc),!0},z.semicolon=function(){this.eat(b.semi)||this.insertSemicolon()||this.unexpected()},z.afterTrailingComma=function(e,t){if(this.type===e)return this.options.onTrailingComma&&this.options.onTrailingComma(this.lastTokStart,this.lastTokStartLoc),t||this.next(),!0},z.expect=function(e){this.eat(e)||this.unexpected()},z.unexpected=function(e){this.raise(null!=e?e:this.start,"Unexpected token")},z.checkPatternErrors=function(e,t){if(e){e.trailingComma>-1&&this.raiseRecoverable(e.trailingComma,"Comma is not permitted after the rest element");var r=t?e.parenthesizedAssign:e.parenthesizedBind;r>-1&&this.raiseRecoverable(r,"Parenthesized pattern")}},z.checkExpressionErrors=function(e,t){if(!e)return!1;var r=e.shorthandAssign,n=e.doubleProto;if(!t)return r>=0||n>=0;r>=0&&this.raise(r,"Shorthand property assignments are valid only in destructuring patterns"),n>=0&&this.raiseRecoverable(n,"Redefinition of __proto__ property")},z.checkYieldAwaitInDefaultParams=function(){this.yieldPos&&(!this.awaitPos||this.yieldPos=6&&this.unexpected(),this.parseFunctionStatement(s,!1,!e);case b._class:return e&&this.unexpected(),this.parseClass(s,!0);case b._if:return this.parseIfStatement(s);case b._return:return this.parseReturnStatement(s);case b._switch:return this.parseSwitchStatement(s);case b._throw:return this.parseThrowStatement(s);case b._try:return this.parseTryStatement(s);case b._const:case b._var:return n=n||this.value,e&&"var"!==n&&this.unexpected(),this.parseVarStatement(s,n);case b._while:return this.parseWhileStatement(s);case b._with:return this.parseWithStatement(s);case b.braceL:return this.parseBlock(!0,s);case b.semi:return this.parseEmptyStatement(s);case b._export:case b._import:if(this.options.ecmaVersion>10&&i===b._import){A.lastIndex=this.pos;var o=A.exec(this.input),a=this.pos+o[0].length,u=this.input.charCodeAt(a);if(40===u||46===u)return this.parseExpressionStatement(s,this.parseExpression())}return this.options.allowImportExportEverywhere||(t||this.raise(this.start,"'import' and 'export' may only appear at the top level"),this.inModule||this.raise(this.start,"'import' and 'export' may appear only with 'sourceType: module'")),i===b._import?this.parseImport(s):this.parseExport(s,r);default:if(this.isAsyncFunction())return e&&this.unexpected(),this.next(),this.parseFunctionStatement(s,!0,!e);var l=this.value,c=this.parseExpression();return i===b.name&&"Identifier"===c.type&&this.eat(b.colon)?this.parseLabeledStatement(s,l,c,e):this.parseExpressionStatement(s,c)}},K.parseBreakContinueStatement=function(e,t){var r="break"===t;this.next(),this.eat(b.semi)||this.insertSemicolon()?e.label=null:this.type!==b.name?this.unexpected():(e.label=this.parseIdent(),this.semicolon());for(var n=0;n=6?this.eat(b.semi):this.semicolon(),this.finishNode(e,"DoWhileStatement")},K.parseForStatement=function(e){this.next();var t=this.options.ecmaVersion>=9&&(this.inAsync||!this.inFunction&&this.options.allowAwaitOutsideFunction)&&this.eatContextual("await")?this.lastTokStart:-1;if(this.labels.push(q),this.enterScope(0),this.expect(b.parenL),this.type===b.semi)return t>-1&&this.unexpected(t),this.parseFor(e,null);var r=this.isLet();if(this.type===b._var||this.type===b._const||r){var n=this.startNode(),i=r?"let":this.value;return this.next(),this.parseVar(n,!0,i),this.finishNode(n,"VariableDeclaration"),(this.type===b._in||this.options.ecmaVersion>=6&&this.isContextual("of"))&&1===n.declarations.length?(this.options.ecmaVersion>=9&&(this.type===b._in?t>-1&&this.unexpected(t):e.await=t>-1),this.parseForIn(e,n)):(t>-1&&this.unexpected(t),this.parseFor(e,n))}var s=new H,o=this.parseExpression(!0,s);return this.type===b._in||this.options.ecmaVersion>=6&&this.isContextual("of")?(this.options.ecmaVersion>=9&&(this.type===b._in?t>-1&&this.unexpected(t):e.await=t>-1),this.toAssignable(o,!1,s),this.checkLVal(o),this.parseForIn(e,o)):(this.checkExpressionErrors(s,!0),t>-1&&this.unexpected(t),this.parseFor(e,o))},K.parseFunctionStatement=function(e,t,r){return this.next(),this.parseFunction(e,Z|(r?0:J),!1,t)},K.parseIfStatement=function(e){return this.next(),e.test=this.parseParenExpression(),e.consequent=this.parseStatement("if"),e.alternate=this.eat(b._else)?this.parseStatement("if"):null,this.finishNode(e,"IfStatement")},K.parseReturnStatement=function(e){return this.inFunction||this.options.allowReturnOutsideFunction||this.raise(this.start,"'return' outside of function"),this.next(),this.eat(b.semi)||this.insertSemicolon()?e.argument=null:(e.argument=this.parseExpression(),this.semicolon()),this.finishNode(e,"ReturnStatement")},K.parseSwitchStatement=function(e){var t;this.next(),e.discriminant=this.parseParenExpression(),e.cases=[],this.expect(b.braceL),this.labels.push(X),this.enterScope(0);for(var r=!1;this.type!==b.braceR;)if(this.type===b._case||this.type===b._default){var n=this.type===b._case;t&&this.finishNode(t,"SwitchCase"),e.cases.push(t=this.startNode()),t.consequent=[],this.next(),n?t.test=this.parseExpression():(r&&this.raiseRecoverable(this.lastTokStart,"Multiple default clauses"),r=!0,t.test=null),this.expect(b.colon)}else t||this.unexpected(),t.consequent.push(this.parseStatement(null));return this.exitScope(),t&&this.finishNode(t,"SwitchCase"),this.next(),this.labels.pop(),this.finishNode(e,"SwitchStatement")},K.parseThrowStatement=function(e){return this.next(),x.test(this.input.slice(this.lastTokEnd,this.start))&&this.raise(this.lastTokEnd,"Illegal newline after throw"),e.argument=this.parseExpression(),this.semicolon(),this.finishNode(e,"ThrowStatement")};var Y=[];K.parseTryStatement=function(e){if(this.next(),e.block=this.parseBlock(),e.handler=null,this.type===b._catch){var t=this.startNode();if(this.next(),this.eat(b.parenL)){t.param=this.parseBindingAtom();var r="Identifier"===t.param.type;this.enterScope(r?32:0),this.checkLVal(t.param,r?4:2),this.expect(b.parenR)}else this.options.ecmaVersion<10&&this.unexpected(),t.param=null,this.enterScope(0);t.body=this.parseBlock(!1),this.exitScope(),e.handler=this.finishNode(t,"CatchClause")}return e.finalizer=this.eat(b._finally)?this.parseBlock():null,e.handler||e.finalizer||this.raise(e.start,"Missing catch or finally clause"),this.finishNode(e,"TryStatement")},K.parseVarStatement=function(e,t){return this.next(),this.parseVar(e,!1,t),this.semicolon(),this.finishNode(e,"VariableDeclaration")},K.parseWhileStatement=function(e){return this.next(),e.test=this.parseParenExpression(),this.labels.push(q),e.body=this.parseStatement("while"),this.labels.pop(),this.finishNode(e,"WhileStatement")},K.parseWithStatement=function(e){return this.strict&&this.raise(this.start,"'with' in strict mode"),this.next(),e.object=this.parseParenExpression(),e.body=this.parseStatement("with"),this.finishNode(e,"WithStatement")},K.parseEmptyStatement=function(e){return this.next(),this.finishNode(e,"EmptyStatement")},K.parseLabeledStatement=function(e,t,r,n){for(var i=0,s=this.labels;i=0;a--){var u=this.labels[a];if(u.statementStart!==e.start)break;u.statementStart=this.start,u.kind=o}return this.labels.push({name:t,kind:o,statementStart:this.start}),e.body=this.parseStatement(n?-1===n.indexOf("label")?n+"label":n:"label"),this.labels.pop(),e.label=r,this.finishNode(e,"LabeledStatement")},K.parseExpressionStatement=function(e,t){return e.expression=t,this.semicolon(),this.finishNode(e,"ExpressionStatement")},K.parseBlock=function(e,t,r){for(void 0===e&&(e=!0),void 0===t&&(t=this.startNode()),t.body=[],this.expect(b.braceL),e&&this.enterScope(0);this.type!==b.braceR;){var n=this.parseStatement(null);t.body.push(n)}return r&&(this.strict=!1),this.next(),e&&this.exitScope(),this.finishNode(t,"BlockStatement")},K.parseFor=function(e,t){return e.init=t,this.expect(b.semi),e.test=this.type===b.semi?null:this.parseExpression(),this.expect(b.semi),e.update=this.type===b.parenR?null:this.parseExpression(),this.expect(b.parenR),e.body=this.parseStatement("for"),this.exitScope(),this.labels.pop(),this.finishNode(e,"ForStatement")},K.parseForIn=function(e,t){var r=this.type===b._in;return this.next(),"VariableDeclaration"===t.type&&null!=t.declarations[0].init&&(!r||this.options.ecmaVersion<8||this.strict||"var"!==t.kind||"Identifier"!==t.declarations[0].id.type)?this.raise(t.start,(r?"for-in":"for-of")+" loop variable declaration may not have an initializer"):"AssignmentPattern"===t.type&&this.raise(t.start,"Invalid left-hand side in for-loop"),e.left=t,e.right=r?this.parseExpression():this.parseMaybeAssign(),this.expect(b.parenR),e.body=this.parseStatement("for"),this.exitScope(),this.labels.pop(),this.finishNode(e,r?"ForInStatement":"ForOfStatement")},K.parseVar=function(e,t,r){for(e.declarations=[],e.kind=r;;){var n=this.startNode();if(this.parseVarId(n,r),this.eat(b.eq)?n.init=this.parseMaybeAssign(t):"const"!==r||this.type===b._in||this.options.ecmaVersion>=6&&this.isContextual("of")?"Identifier"===n.id.type||t&&(this.type===b._in||this.isContextual("of"))?n.init=null:this.raise(this.lastTokEnd,"Complex binding patterns require an initialization value"):this.unexpected(),e.declarations.push(this.finishNode(n,"VariableDeclarator")),!this.eat(b.comma))break}return e},K.parseVarId=function(e,t){e.id=this.parseBindingAtom(),this.checkLVal(e.id,"var"===t?1:2,!1)};var Z=1,J=2;K.parseFunction=function(e,t,r,n){this.initFunction(e),(this.options.ecmaVersion>=9||this.options.ecmaVersion>=6&&!n)&&(this.type===b.star&&t&J&&this.unexpected(),e.generator=this.eat(b.star)),this.options.ecmaVersion>=8&&(e.async=!!n),t&Z&&(e.id=4&t&&this.type!==b.name?null:this.parseIdent(),!e.id||t&J||this.checkLVal(e.id,this.strict||e.generator||e.async?this.treatFunctionsAsVar?1:2:3));var i=this.yieldPos,s=this.awaitPos,o=this.awaitIdentPos;return this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0,this.enterScope($(e.async,e.generator)),t&Z||(e.id=this.type===b.name?this.parseIdent():null),this.parseFunctionParams(e),this.parseFunctionBody(e,r,!1),this.yieldPos=i,this.awaitPos=s,this.awaitIdentPos=o,this.finishNode(e,t&Z?"FunctionDeclaration":"FunctionExpression")},K.parseFunctionParams=function(e){this.expect(b.parenL),e.params=this.parseBindingList(b.parenR,!1,this.options.ecmaVersion>=8),this.checkYieldAwaitInDefaultParams()},K.parseClass=function(e,t){this.next();var r=this.strict;this.strict=!0,this.parseClassId(e,t),this.parseClassSuper(e);var n=this.startNode(),i=!1;for(n.body=[],this.expect(b.braceL);this.type!==b.braceR;){var s=this.parseClassElement(null!==e.superClass);s&&(n.body.push(s),"MethodDefinition"===s.type&&"constructor"===s.kind&&(i&&this.raise(s.start,"Duplicate constructor in the same class"),i=!0))}return this.strict=r,this.next(),e.body=this.finishNode(n,"ClassBody"),this.finishNode(e,t?"ClassDeclaration":"ClassExpression")},K.parseClassElement=function(e){var t=this;if(this.eat(b.semi))return null;var r=this.startNode(),n=function(e,n){void 0===n&&(n=!1);var i=t.start,s=t.startLoc;return!!t.eatContextual(e)&&(!(t.type===b.parenL||n&&t.canInsertSemicolon())||(r.key&&t.unexpected(),r.computed=!1,r.key=t.startNodeAt(i,s),r.key.name=e,t.finishNode(r.key,"Identifier"),!1))};r.kind="method",r.static=n("static");var i=this.eat(b.star),s=!1;i||(this.options.ecmaVersion>=8&&n("async",!0)?(s=!0,i=this.options.ecmaVersion>=9&&this.eat(b.star)):n("get")?r.kind="get":n("set")&&(r.kind="set")),r.key||this.parsePropertyName(r);var o=r.key,a=!1;return r.computed||r.static||!("Identifier"===o.type&&"constructor"===o.name||"Literal"===o.type&&"constructor"===o.value)?r.static&&"Identifier"===o.type&&"prototype"===o.name&&this.raise(o.start,"Classes may not have a static property named prototype"):("method"!==r.kind&&this.raise(o.start,"Constructor can't have get/set modifier"),i&&this.raise(o.start,"Constructor can't be a generator"),s&&this.raise(o.start,"Constructor can't be an async method"),r.kind="constructor",a=e),this.parseClassMethod(r,i,s,a),"get"===r.kind&&0!==r.value.params.length&&this.raiseRecoverable(r.value.start,"getter should have no params"),"set"===r.kind&&1!==r.value.params.length&&this.raiseRecoverable(r.value.start,"setter should have exactly one param"),"set"===r.kind&&"RestElement"===r.value.params[0].type&&this.raiseRecoverable(r.value.params[0].start,"Setter cannot use rest params"),r},K.parseClassMethod=function(e,t,r,n){return e.value=this.parseMethod(t,r,n),this.finishNode(e,"MethodDefinition")},K.parseClassId=function(e,t){this.type===b.name?(e.id=this.parseIdent(),t&&this.checkLVal(e.id,2,!1)):(!0===t&&this.unexpected(),e.id=null)},K.parseClassSuper=function(e){e.superClass=this.eat(b._extends)?this.parseExprSubscripts():null},K.parseExport=function(e,t){if(this.next(),this.eat(b.star))return this.options.ecmaVersion>=11&&(this.eatContextual("as")?(e.exported=this.parseIdent(!0),this.checkExport(t,e.exported.name,this.lastTokStart)):e.exported=null),this.expectContextual("from"),this.type!==b.string&&this.unexpected(),e.source=this.parseExprAtom(),this.semicolon(),this.finishNode(e,"ExportAllDeclaration");if(this.eat(b._default)){var r;if(this.checkExport(t,"default",this.lastTokStart),this.type===b._function||(r=this.isAsyncFunction())){var n=this.startNode();this.next(),r&&this.next(),e.declaration=this.parseFunction(n,4|Z,!1,r)}else if(this.type===b._class){var i=this.startNode();e.declaration=this.parseClass(i,"nullableID")}else e.declaration=this.parseMaybeAssign(),this.semicolon();return this.finishNode(e,"ExportDefaultDeclaration")}if(this.shouldParseExportStatement())e.declaration=this.parseStatement(null),"VariableDeclaration"===e.declaration.type?this.checkVariableExport(t,e.declaration.declarations):this.checkExport(t,e.declaration.id.name,e.declaration.id.start),e.specifiers=[],e.source=null;else{if(e.declaration=null,e.specifiers=this.parseExportSpecifiers(t),this.eatContextual("from"))this.type!==b.string&&this.unexpected(),e.source=this.parseExprAtom();else{for(var s=0,o=e.specifiers;s=6&&e)switch(e.type){case"Identifier":this.inAsync&&"await"===e.name&&this.raise(e.start,"Cannot use 'await' as identifier inside an async function");break;case"ObjectPattern":case"ArrayPattern":case"RestElement":break;case"ObjectExpression":e.type="ObjectPattern",r&&this.checkPatternErrors(r,!0);for(var n=0,i=e.properties;n=8&&!s&&"async"===o.name&&!this.canInsertSemicolon()&&this.eat(b._function))return this.parseFunction(this.startNodeAt(n,i),0,!1,!0);if(r&&!this.canInsertSemicolon()){if(this.eat(b.arrow))return this.parseArrowExpression(this.startNodeAt(n,i),[o],!1);if(this.options.ecmaVersion>=8&&"async"===o.name&&this.type===b.name&&!s)return o=this.parseIdent(!1),!this.canInsertSemicolon()&&this.eat(b.arrow)||this.unexpected(),this.parseArrowExpression(this.startNodeAt(n,i),[o],!0)}return o;case b.regexp:var a=this.value;return(t=this.parseLiteral(a.value)).regex={pattern:a.pattern,flags:a.flags},t;case b.num:case b.string:return this.parseLiteral(this.value);case b._null:case b._true:case b._false:return(t=this.startNode()).value=this.type===b._null?null:this.type===b._true,t.raw=this.type.keyword,this.next(),this.finishNode(t,"Literal");case b.parenL:var u=this.start,l=this.parseParenAndDistinguishExpression(r);return e&&(e.parenthesizedAssign<0&&!this.isSimpleAssignTarget(l)&&(e.parenthesizedAssign=u),e.parenthesizedBind<0&&(e.parenthesizedBind=u)),l;case b.bracketL:return t=this.startNode(),this.next(),t.elements=this.parseExprList(b.bracketR,!0,!0,e),this.finishNode(t,"ArrayExpression");case b.braceL:return this.parseObj(!1,e);case b._function:return t=this.startNode(),this.next(),this.parseFunction(t,0);case b._class:return this.parseClass(this.startNode(),!1);case b._new:return this.parseNew();case b.backQuote:return this.parseTemplate();case b._import:return this.options.ecmaVersion>=11?this.parseExprImport():this.unexpected();default:this.unexpected()}},ee.parseExprImport=function(){var e=this.startNode();this.containsEsc&&this.raiseRecoverable(this.start,"Escape sequence in keyword import");var t=this.parseIdent(!0);switch(this.type){case b.parenL:return this.parseDynamicImport(e);case b.dot:return e.meta=t,this.parseImportMeta(e);default:this.unexpected()}},ee.parseDynamicImport=function(e){if(this.next(),e.source=this.parseMaybeAssign(),!this.eat(b.parenR)){var t=this.start;this.eat(b.comma)&&this.eat(b.parenR)?this.raiseRecoverable(t,"Trailing comma is not allowed in import()"):this.unexpected(t)}return this.finishNode(e,"ImportExpression")},ee.parseImportMeta=function(e){this.next();var t=this.containsEsc;return e.property=this.parseIdent(!0),"meta"!==e.property.name&&this.raiseRecoverable(e.property.start,"The only valid meta property for import is 'import.meta'"),t&&this.raiseRecoverable(e.start,"'import.meta' must not contain escaped characters"),"module"!==this.options.sourceType&&this.raiseRecoverable(e.start,"Cannot use 'import.meta' outside a module"),this.finishNode(e,"MetaProperty")},ee.parseLiteral=function(e){var t=this.startNode();return t.value=e,t.raw=this.input.slice(this.start,this.end),110===t.raw.charCodeAt(t.raw.length-1)&&(t.bigint=t.raw.slice(0,-1).replace(/_/g,"")),this.next(),this.finishNode(t,"Literal")},ee.parseParenExpression=function(){this.expect(b.parenL);var e=this.parseExpression();return this.expect(b.parenR),e},ee.parseParenAndDistinguishExpression=function(e){var t,r=this.start,n=this.startLoc,i=this.options.ecmaVersion>=8;if(this.options.ecmaVersion>=6){this.next();var s,o=this.start,a=this.startLoc,u=[],l=!0,c=!1,h=new H,p=this.yieldPos,f=this.awaitPos;for(this.yieldPos=0,this.awaitPos=0;this.type!==b.parenR;){if(l?l=!1:this.expect(b.comma),i&&this.afterTrailingComma(b.parenR,!0)){c=!0;break}if(this.type===b.ellipsis){s=this.start,u.push(this.parseParenItem(this.parseRestBinding())),this.type===b.comma&&this.raise(this.start,"Comma is not permitted after the rest element");break}u.push(this.parseMaybeAssign(!1,h,this.parseParenItem))}var d=this.start,m=this.startLoc;if(this.expect(b.parenR),e&&!this.canInsertSemicolon()&&this.eat(b.arrow))return this.checkPatternErrors(h,!1),this.checkYieldAwaitInDefaultParams(),this.yieldPos=p,this.awaitPos=f,this.parseParenArrowList(r,n,u);u.length&&!c||this.unexpected(this.lastTokStart),s&&this.unexpected(s),this.checkExpressionErrors(h,!0),this.yieldPos=p||this.yieldPos,this.awaitPos=f||this.awaitPos,u.length>1?((t=this.startNodeAt(o,a)).expressions=u,this.finishNodeAt(t,"SequenceExpression",d,m)):t=u[0]}else t=this.parseParenExpression();if(this.options.preserveParens){var g=this.startNodeAt(r,n);return g.expression=t,this.finishNode(g,"ParenthesizedExpression")}return t},ee.parseParenItem=function(e){return e},ee.parseParenArrowList=function(e,t,r){return this.parseArrowExpression(this.startNodeAt(e,t),r)};var te=[];ee.parseNew=function(){this.containsEsc&&this.raiseRecoverable(this.start,"Escape sequence in keyword new");var e=this.startNode(),t=this.parseIdent(!0);if(this.options.ecmaVersion>=6&&this.eat(b.dot)){e.meta=t;var r=this.containsEsc;return e.property=this.parseIdent(!0),"target"!==e.property.name&&this.raiseRecoverable(e.property.start,"The only valid meta property for new is 'new.target'"),r&&this.raiseRecoverable(e.start,"'new.target' must not contain escaped characters"),this.inNonArrowFunction()||this.raiseRecoverable(e.start,"'new.target' can only be used in functions"),this.finishNode(e,"MetaProperty")}var n=this.start,i=this.startLoc,s=this.type===b._import;return e.callee=this.parseSubscripts(this.parseExprAtom(),n,i,!0),s&&"ImportExpression"===e.callee.type&&this.raise(n,"Cannot use new with import()"),this.eat(b.parenL)?e.arguments=this.parseExprList(b.parenR,this.options.ecmaVersion>=8,!1):e.arguments=te,this.finishNode(e,"NewExpression")},ee.parseTemplateElement=function(e){var t=e.isTagged,r=this.startNode();return this.type===b.invalidTemplate?(t||this.raiseRecoverable(this.start,"Bad escape sequence in untagged template literal"),r.value={raw:this.value,cooked:null}):r.value={raw:this.input.slice(this.start,this.end).replace(/\r\n?/g,"\n"),cooked:this.value},this.next(),r.tail=this.type===b.backQuote,this.finishNode(r,"TemplateElement")},ee.parseTemplate=function(e){void 0===e&&(e={});var t=e.isTagged;void 0===t&&(t=!1);var r=this.startNode();this.next(),r.expressions=[];var n=this.parseTemplateElement({isTagged:t});for(r.quasis=[n];!n.tail;)this.type===b.eof&&this.raise(this.pos,"Unterminated template literal"),this.expect(b.dollarBraceL),r.expressions.push(this.parseExpression()),this.expect(b.braceR),r.quasis.push(n=this.parseTemplateElement({isTagged:t}));return this.next(),this.finishNode(r,"TemplateLiteral")},ee.isAsyncProp=function(e){return!e.computed&&"Identifier"===e.key.type&&"async"===e.key.name&&(this.type===b.name||this.type===b.num||this.type===b.string||this.type===b.bracketL||this.type.keyword||this.options.ecmaVersion>=9&&this.type===b.star)&&!x.test(this.input.slice(this.lastTokEnd,this.start))},ee.parseObj=function(e,t){var r=this.startNode(),n=!0,i={};for(r.properties=[],this.next();!this.eat(b.braceR);){if(n)n=!1;else if(this.expect(b.comma),this.options.ecmaVersion>=5&&this.afterTrailingComma(b.braceR))break;var s=this.parseProperty(e,t);e||this.checkPropClash(s,i,t),r.properties.push(s)}return this.finishNode(r,e?"ObjectPattern":"ObjectExpression")},ee.parseProperty=function(e,t){var r,n,i,s,o=this.startNode();if(this.options.ecmaVersion>=9&&this.eat(b.ellipsis))return e?(o.argument=this.parseIdent(!1),this.type===b.comma&&this.raise(this.start,"Comma is not permitted after the rest element"),this.finishNode(o,"RestElement")):(this.type===b.parenL&&t&&(t.parenthesizedAssign<0&&(t.parenthesizedAssign=this.start),t.parenthesizedBind<0&&(t.parenthesizedBind=this.start)),o.argument=this.parseMaybeAssign(!1,t),this.type===b.comma&&t&&t.trailingComma<0&&(t.trailingComma=this.start),this.finishNode(o,"SpreadElement"));this.options.ecmaVersion>=6&&(o.method=!1,o.shorthand=!1,(e||t)&&(i=this.start,s=this.startLoc),e||(r=this.eat(b.star)));var a=this.containsEsc;return this.parsePropertyName(o),!e&&!a&&this.options.ecmaVersion>=8&&!r&&this.isAsyncProp(o)?(n=!0,r=this.options.ecmaVersion>=9&&this.eat(b.star),this.parsePropertyName(o,t)):n=!1,this.parsePropertyValue(o,e,r,n,i,s,t,a),this.finishNode(o,"Property")},ee.parsePropertyValue=function(e,t,r,n,i,s,o,a){if((r||n)&&this.type===b.colon&&this.unexpected(),this.eat(b.colon))e.value=t?this.parseMaybeDefault(this.start,this.startLoc):this.parseMaybeAssign(!1,o),e.kind="init";else if(this.options.ecmaVersion>=6&&this.type===b.parenL)t&&this.unexpected(),e.kind="init",e.method=!0,e.value=this.parseMethod(r,n);else if(t||a||!(this.options.ecmaVersion>=5)||e.computed||"Identifier"!==e.key.type||"get"!==e.key.name&&"set"!==e.key.name||this.type===b.comma||this.type===b.braceR||this.type===b.eq)this.options.ecmaVersion>=6&&!e.computed&&"Identifier"===e.key.type?((r||n)&&this.unexpected(),this.checkUnreserved(e.key),"await"!==e.key.name||this.awaitIdentPos||(this.awaitIdentPos=i),e.kind="init",t?e.value=this.parseMaybeDefault(i,s,e.key):this.type===b.eq&&o?(o.shorthandAssign<0&&(o.shorthandAssign=this.start),e.value=this.parseMaybeDefault(i,s,e.key)):e.value=e.key,e.shorthand=!0):this.unexpected();else{(r||n)&&this.unexpected(),e.kind=e.key.name,this.parsePropertyName(e),e.value=this.parseMethod(!1);var u="get"===e.kind?0:1;if(e.value.params.length!==u){var l=e.value.start;"get"===e.kind?this.raiseRecoverable(l,"getter should have no params"):this.raiseRecoverable(l,"setter should have exactly one param")}else"set"===e.kind&&"RestElement"===e.value.params[0].type&&this.raiseRecoverable(e.value.params[0].start,"Setter cannot use rest params")}},ee.parsePropertyName=function(e){if(this.options.ecmaVersion>=6){if(this.eat(b.bracketL))return e.computed=!0,e.key=this.parseMaybeAssign(),this.expect(b.bracketR),e.key;e.computed=!1}return e.key=this.type===b.num||this.type===b.string?this.parseExprAtom():this.parseIdent("never"!==this.options.allowReserved)},ee.initFunction=function(e){e.id=null,this.options.ecmaVersion>=6&&(e.generator=e.expression=!1),this.options.ecmaVersion>=8&&(e.async=!1)},ee.parseMethod=function(e,t,r){var n=this.startNode(),i=this.yieldPos,s=this.awaitPos,o=this.awaitIdentPos;return this.initFunction(n),this.options.ecmaVersion>=6&&(n.generator=e),this.options.ecmaVersion>=8&&(n.async=!!t),this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0,this.enterScope(64|$(t,n.generator)|(r?128:0)),this.expect(b.parenL),n.params=this.parseBindingList(b.parenR,!1,this.options.ecmaVersion>=8),this.checkYieldAwaitInDefaultParams(),this.parseFunctionBody(n,!1,!0),this.yieldPos=i,this.awaitPos=s,this.awaitIdentPos=o,this.finishNode(n,"FunctionExpression")},ee.parseArrowExpression=function(e,t,r){var n=this.yieldPos,i=this.awaitPos,s=this.awaitIdentPos;return this.enterScope(16|$(r,!1)),this.initFunction(e),this.options.ecmaVersion>=8&&(e.async=!!r),this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0,e.params=this.toAssignableList(t,!0),this.parseFunctionBody(e,!0,!1),this.yieldPos=n,this.awaitPos=i,this.awaitIdentPos=s,this.finishNode(e,"ArrowFunctionExpression")},ee.parseFunctionBody=function(e,t,r){var n=t&&this.type!==b.braceL,i=this.strict,s=!1;if(n)e.body=this.parseMaybeAssign(),e.expression=!0,this.checkParams(e,!1);else{var o=this.options.ecmaVersion>=7&&!this.isSimpleParamList(e.params);i&&!o||(s=this.strictDirective(this.end))&&o&&this.raiseRecoverable(e.start,"Illegal 'use strict' directive in function with non-simple parameter list");var a=this.labels;this.labels=[],s&&(this.strict=!0),this.checkParams(e,!i&&!s&&!t&&!r&&this.isSimpleParamList(e.params)),this.strict&&e.id&&this.checkLVal(e.id,5),e.body=this.parseBlock(!1,void 0,s&&!i),e.expression=!1,this.adaptDirectivePrologue(e.body.body),this.labels=a}this.exitScope()},ee.isSimpleParamList=function(e){for(var t=0,r=e;t-1||i.functions.indexOf(e)>-1||i.var.indexOf(e)>-1,i.lexical.push(e),this.inModule&&1&i.flags&&delete this.undefinedExports[e]}else if(4===t){this.currentScope().lexical.push(e)}else if(3===t){var s=this.currentScope();n=this.treatFunctionsAsVar?s.lexical.indexOf(e)>-1:s.lexical.indexOf(e)>-1||s.var.indexOf(e)>-1,s.functions.push(e)}else for(var o=this.scopeStack.length-1;o>=0;--o){var a=this.scopeStack[o];if(a.lexical.indexOf(e)>-1&&!(32&a.flags&&a.lexical[0]===e)||!this.treatFunctionsAsVarInScope(a)&&a.functions.indexOf(e)>-1){n=!0;break}if(a.var.push(e),this.inModule&&1&a.flags&&delete this.undefinedExports[e],a.flags&F)break}n&&this.raiseRecoverable(r,"Identifier '"+e+"' has already been declared")},ne.checkLocalExport=function(e){-1===this.scopeStack[0].lexical.indexOf(e.name)&&-1===this.scopeStack[0].var.indexOf(e.name)&&(this.undefinedExports[e.name]=e)},ne.currentScope=function(){return this.scopeStack[this.scopeStack.length-1]},ne.currentVarScope=function(){for(var e=this.scopeStack.length-1;;e--){var t=this.scopeStack[e];if(t.flags&F)return t}},ne.currentThisScope=function(){for(var e=this.scopeStack.length-1;;e--){var t=this.scopeStack[e];if(t.flags&F&&!(16&t.flags))return t}};var ie=function(e,t,r){this.type="",this.start=t,this.end=0,e.options.locations&&(this.loc=new P(e,r)),e.options.directSourceFile&&(this.sourceFile=e.options.directSourceFile),e.options.ranges&&(this.range=[t,0])},se=V.prototype;function oe(e,t,r,n){return e.type=t,e.end=r,this.options.locations&&(e.loc.end=n),this.options.ranges&&(e.range[1]=r),e}se.startNode=function(){return new ie(this,this.start,this.startLoc)},se.startNodeAt=function(e,t){return new ie(this,e,t)},se.finishNode=function(e,t){return oe.call(this,e,t,this.lastTokEnd,this.lastTokEndLoc)},se.finishNodeAt=function(e,t,r,n){return oe.call(this,e,t,r,n)};var ae=function(e,t,r,n,i){this.token=e,this.isExpr=!!t,this.preserveSpace=!!r,this.override=n,this.generator=!!i},ue={b_stat:new ae("{",!1),b_expr:new ae("{",!0),b_tmpl:new ae("${",!1),p_stat:new ae("(",!1),p_expr:new ae("(",!0),q_tmpl:new ae("`",!0,!0,function(e){return e.tryReadTemplateToken()}),f_stat:new ae("function",!1),f_expr:new ae("function",!0),f_expr_gen:new ae("function",!0,!1,null,!0),f_gen:new ae("function",!1,!1,null,!0)},le=V.prototype;le.initialContext=function(){return[ue.b_stat]},le.braceIsBlock=function(e){var t=this.curContext();return t===ue.f_expr||t===ue.f_stat||(e!==b.colon||t!==ue.b_stat&&t!==ue.b_expr?e===b._return||e===b.name&&this.exprAllowed?x.test(this.input.slice(this.lastTokEnd,this.start)):e===b._else||e===b.semi||e===b.eof||e===b.parenR||e===b.arrow||(e===b.braceL?t===ue.b_stat:e!==b._var&&e!==b._const&&e!==b.name&&!this.exprAllowed):!t.isExpr)},le.inGeneratorContext=function(){for(var e=this.context.length-1;e>=1;e--){var t=this.context[e];if("function"===t.token)return t.generator}return!1},le.updateContext=function(e){var t,r=this.type;r.keyword&&e===b.dot?this.exprAllowed=!1:(t=r.updateContext)?t.call(this,e):this.exprAllowed=r.beforeExpr},b.parenR.updateContext=b.braceR.updateContext=function(){if(1!==this.context.length){var e=this.context.pop();e===ue.b_stat&&"function"===this.curContext().token&&(e=this.context.pop()),this.exprAllowed=!e.isExpr}else this.exprAllowed=!0},b.braceL.updateContext=function(e){this.context.push(this.braceIsBlock(e)?ue.b_stat:ue.b_expr),this.exprAllowed=!0},b.dollarBraceL.updateContext=function(){this.context.push(ue.b_tmpl),this.exprAllowed=!0},b.parenL.updateContext=function(e){var t=e===b._if||e===b._for||e===b._with||e===b._while;this.context.push(t?ue.p_stat:ue.p_expr),this.exprAllowed=!0},b.incDec.updateContext=function(){},b._function.updateContext=b._class.updateContext=function(e){!e.beforeExpr||e===b.semi||e===b._else||e===b._return&&x.test(this.input.slice(this.lastTokEnd,this.start))||(e===b.colon||e===b.braceL)&&this.curContext()===ue.b_stat?this.context.push(ue.f_stat):this.context.push(ue.f_expr),this.exprAllowed=!1},b.backQuote.updateContext=function(){this.curContext()===ue.q_tmpl?this.context.pop():this.context.push(ue.q_tmpl),this.exprAllowed=!1},b.star.updateContext=function(e){if(e===b._function){var t=this.context.length-1;this.context[t]===ue.f_expr?this.context[t]=ue.f_expr_gen:this.context[t]=ue.f_gen}this.exprAllowed=!0},b.name.updateContext=function(e){var t=!1;this.options.ecmaVersion>=6&&e!==b.dot&&("of"===this.value&&!this.exprAllowed||"yield"===this.value&&this.inGeneratorContext())&&(t=!0),this.exprAllowed=t};var ce="ASCII ASCII_Hex_Digit AHex Alphabetic Alpha Any Assigned Bidi_Control Bidi_C Bidi_Mirrored Bidi_M Case_Ignorable CI Cased Changes_When_Casefolded CWCF Changes_When_Casemapped CWCM Changes_When_Lowercased CWL Changes_When_NFKC_Casefolded CWKCF Changes_When_Titlecased CWT Changes_When_Uppercased CWU Dash Default_Ignorable_Code_Point DI Deprecated Dep Diacritic Dia Emoji Emoji_Component Emoji_Modifier Emoji_Modifier_Base Emoji_Presentation Extender Ext Grapheme_Base Gr_Base Grapheme_Extend Gr_Ext Hex_Digit Hex IDS_Binary_Operator IDSB IDS_Trinary_Operator IDST ID_Continue IDC ID_Start IDS Ideographic Ideo Join_Control Join_C Logical_Order_Exception LOE Lowercase Lower Math Noncharacter_Code_Point NChar Pattern_Syntax Pat_Syn Pattern_White_Space Pat_WS Quotation_Mark QMark Radical Regional_Indicator RI Sentence_Terminal STerm Soft_Dotted SD Terminal_Punctuation Term Unified_Ideograph UIdeo Uppercase Upper Variation_Selector VS White_Space space XID_Continue XIDC XID_Start XIDS",he=ce+" Extended_Pictographic",pe={9:ce,10:he,11:"ASCII ASCII_Hex_Digit AHex Alphabetic Alpha Any Assigned Bidi_Control Bidi_C Bidi_Mirrored Bidi_M Case_Ignorable CI Cased Changes_When_Casefolded CWCF Changes_When_Casemapped CWCM Changes_When_Lowercased CWL Changes_When_NFKC_Casefolded CWKCF Changes_When_Titlecased CWT Changes_When_Uppercased CWU Dash Default_Ignorable_Code_Point DI Deprecated Dep Diacritic Dia Emoji Emoji_Component Emoji_Modifier Emoji_Modifier_Base Emoji_Presentation Extender Ext Grapheme_Base Gr_Base Grapheme_Extend Gr_Ext Hex_Digit Hex IDS_Binary_Operator IDSB IDS_Trinary_Operator IDST ID_Continue IDC ID_Start IDS Ideographic Ideo Join_Control Join_C Logical_Order_Exception LOE Lowercase Lower Math Noncharacter_Code_Point NChar Pattern_Syntax Pat_Syn Pattern_White_Space Pat_WS Quotation_Mark QMark Radical Regional_Indicator RI Sentence_Terminal STerm Soft_Dotted SD Terminal_Punctuation Term Unified_Ideograph UIdeo Uppercase Upper Variation_Selector VS White_Space space XID_Continue XIDC XID_Start XIDS Extended_Pictographic"},fe="Cased_Letter LC Close_Punctuation Pe Connector_Punctuation Pc Control Cc cntrl Currency_Symbol Sc Dash_Punctuation Pd Decimal_Number Nd digit Enclosing_Mark Me Final_Punctuation Pf Format Cf Initial_Punctuation Pi Letter L Letter_Number Nl Line_Separator Zl Lowercase_Letter Ll Mark M Combining_Mark Math_Symbol Sm Modifier_Letter Lm Modifier_Symbol Sk Nonspacing_Mark Mn Number N Open_Punctuation Ps Other C Other_Letter Lo Other_Number No Other_Punctuation Po Other_Symbol So Paragraph_Separator Zp Private_Use Co Punctuation P punct Separator Z Space_Separator Zs Spacing_Mark Mc Surrogate Cs Symbol S Titlecase_Letter Lt Unassigned Cn Uppercase_Letter Lu",de="Adlam Adlm Ahom Ahom Anatolian_Hieroglyphs Hluw Arabic Arab Armenian Armn Avestan Avst Balinese Bali Bamum Bamu Bassa_Vah Bass Batak Batk Bengali Beng Bhaiksuki Bhks Bopomofo Bopo Brahmi Brah Braille Brai Buginese Bugi Buhid Buhd Canadian_Aboriginal Cans Carian Cari Caucasian_Albanian Aghb Chakma Cakm Cham Cham Cherokee Cher Common Zyyy Coptic Copt Qaac Cuneiform Xsux Cypriot Cprt Cyrillic Cyrl Deseret Dsrt Devanagari Deva Duployan Dupl Egyptian_Hieroglyphs Egyp Elbasan Elba Ethiopic Ethi Georgian Geor Glagolitic Glag Gothic Goth Grantha Gran Greek Grek Gujarati Gujr Gurmukhi Guru Han Hani Hangul Hang Hanunoo Hano Hatran Hatr Hebrew Hebr Hiragana Hira Imperial_Aramaic Armi Inherited Zinh Qaai Inscriptional_Pahlavi Phli Inscriptional_Parthian Prti Javanese Java Kaithi Kthi Kannada Knda Katakana Kana Kayah_Li Kali Kharoshthi Khar Khmer Khmr Khojki Khoj Khudawadi Sind Lao Laoo Latin Latn Lepcha Lepc Limbu Limb Linear_A Lina Linear_B Linb Lisu Lisu Lycian Lyci Lydian Lydi Mahajani Mahj Malayalam Mlym Mandaic Mand Manichaean Mani Marchen Marc Masaram_Gondi Gonm Meetei_Mayek Mtei Mende_Kikakui Mend Meroitic_Cursive Merc Meroitic_Hieroglyphs Mero Miao Plrd Modi Modi Mongolian Mong Mro Mroo Multani Mult Myanmar Mymr Nabataean Nbat New_Tai_Lue Talu Newa Newa Nko Nkoo Nushu Nshu Ogham Ogam Ol_Chiki Olck Old_Hungarian Hung Old_Italic Ital Old_North_Arabian Narb Old_Permic Perm Old_Persian Xpeo Old_South_Arabian Sarb Old_Turkic Orkh Oriya Orya Osage Osge Osmanya Osma Pahawh_Hmong Hmng Palmyrene Palm Pau_Cin_Hau Pauc Phags_Pa Phag Phoenician Phnx Psalter_Pahlavi Phlp Rejang Rjng Runic Runr Samaritan Samr Saurashtra Saur Sharada Shrd Shavian Shaw Siddham Sidd SignWriting Sgnw Sinhala Sinh Sora_Sompeng Sora Soyombo Soyo Sundanese Sund Syloti_Nagri Sylo Syriac Syrc Tagalog Tglg Tagbanwa Tagb Tai_Le Tale Tai_Tham Lana Tai_Viet Tavt Takri Takr Tamil Taml Tangut Tang Telugu Telu Thaana Thaa Thai Thai Tibetan Tibt Tifinagh Tfng Tirhuta Tirh Ugaritic Ugar Vai Vaii Warang_Citi Wara Yi Yiii Zanabazar_Square Zanb",me=de+" Dogra Dogr Gunjala_Gondi Gong Hanifi_Rohingya Rohg Makasar Maka Medefaidrin Medf Old_Sogdian Sogo Sogdian Sogd",ge={9:de,10:me,11:"Adlam Adlm Ahom Ahom Anatolian_Hieroglyphs Hluw Arabic Arab Armenian Armn Avestan Avst Balinese Bali Bamum Bamu Bassa_Vah Bass Batak Batk Bengali Beng Bhaiksuki Bhks Bopomofo Bopo Brahmi Brah Braille Brai Buginese Bugi Buhid Buhd Canadian_Aboriginal Cans Carian Cari Caucasian_Albanian Aghb Chakma Cakm Cham Cham Cherokee Cher Common Zyyy Coptic Copt Qaac Cuneiform Xsux Cypriot Cprt Cyrillic Cyrl Deseret Dsrt Devanagari Deva Duployan Dupl Egyptian_Hieroglyphs Egyp Elbasan Elba Ethiopic Ethi Georgian Geor Glagolitic Glag Gothic Goth Grantha Gran Greek Grek Gujarati Gujr Gurmukhi Guru Han Hani Hangul Hang Hanunoo Hano Hatran Hatr Hebrew Hebr Hiragana Hira Imperial_Aramaic Armi Inherited Zinh Qaai Inscriptional_Pahlavi Phli Inscriptional_Parthian Prti Javanese Java Kaithi Kthi Kannada Knda Katakana Kana Kayah_Li Kali Kharoshthi Khar Khmer Khmr Khojki Khoj Khudawadi Sind Lao Laoo Latin Latn Lepcha Lepc Limbu Limb Linear_A Lina Linear_B Linb Lisu Lisu Lycian Lyci Lydian Lydi Mahajani Mahj Malayalam Mlym Mandaic Mand Manichaean Mani Marchen Marc Masaram_Gondi Gonm Meetei_Mayek Mtei Mende_Kikakui Mend Meroitic_Cursive Merc Meroitic_Hieroglyphs Mero Miao Plrd Modi Modi Mongolian Mong Mro Mroo Multani Mult Myanmar Mymr Nabataean Nbat New_Tai_Lue Talu Newa Newa Nko Nkoo Nushu Nshu Ogham Ogam Ol_Chiki Olck Old_Hungarian Hung Old_Italic Ital Old_North_Arabian Narb Old_Permic Perm Old_Persian Xpeo Old_South_Arabian Sarb Old_Turkic Orkh Oriya Orya Osage Osge Osmanya Osma Pahawh_Hmong Hmng Palmyrene Palm Pau_Cin_Hau Pauc Phags_Pa Phag Phoenician Phnx Psalter_Pahlavi Phlp Rejang Rjng Runic Runr Samaritan Samr Saurashtra Saur Sharada Shrd Shavian Shaw Siddham Sidd SignWriting Sgnw Sinhala Sinh Sora_Sompeng Sora Soyombo Soyo Sundanese Sund Syloti_Nagri Sylo Syriac Syrc Tagalog Tglg Tagbanwa Tagb Tai_Le Tale Tai_Tham Lana Tai_Viet Tavt Takri Takr Tamil Taml Tangut Tang Telugu Telu Thaana Thaa Thai Thai Tibetan Tibt Tifinagh Tfng Tirhuta Tirh Ugaritic Ugar Vai Vaii Warang_Citi Wara Yi Yiii Zanabazar_Square Zanb Dogra Dogr Gunjala_Gondi Gong Hanifi_Rohingya Rohg Makasar Maka Medefaidrin Medf Old_Sogdian Sogo Sogdian Sogd Elymaic Elym Nandinagari Nand Nyiakeng_Puachue_Hmong Hmnp Wancho Wcho"},ve={};function ye(e){var t=ve[e]={binary:O(pe[e]+" "+fe),nonBinary:{General_Category:O(fe),Script:O(ge[e])}};t.nonBinary.Script_Extensions=t.nonBinary.Script,t.nonBinary.gc=t.nonBinary.General_Category,t.nonBinary.sc=t.nonBinary.Script,t.nonBinary.scx=t.nonBinary.Script_Extensions}ye(9),ye(10),ye(11);var _e=V.prototype,be=function(e){this.parser=e,this.validFlags="gim"+(e.options.ecmaVersion>=6?"uy":"")+(e.options.ecmaVersion>=9?"s":""),this.unicodeProperties=ve[e.options.ecmaVersion>=11?11:e.options.ecmaVersion],this.source="",this.flags="",this.start=0,this.switchU=!1,this.switchN=!1,this.pos=0,this.lastIntValue=0,this.lastStringValue="",this.lastAssertionIsQuantifiable=!1,this.numCapturingParens=0,this.maxBackReference=0,this.groupNames=[],this.backReferenceNames=[]};function xe(e){return e<=65535?String.fromCharCode(e):(e-=65536,String.fromCharCode(55296+(e>>10),56320+(1023&e)))}function we(e){return 36===e||e>=40&&e<=43||46===e||63===e||e>=91&&e<=94||e>=123&&e<=125}function Ee(e){return e>=65&&e<=90||e>=97&&e<=122}function Te(e){return Ee(e)||95===e}function Ae(e){return Te(e)||Se(e)}function Se(e){return e>=48&&e<=57}function ke(e){return e>=48&&e<=57||e>=65&&e<=70||e>=97&&e<=102}function Ce(e){return e>=65&&e<=70?e-65+10:e>=97&&e<=102?e-97+10:e-48}function Ie(e){return e>=48&&e<=55}be.prototype.reset=function(e,t,r){var n=-1!==r.indexOf("u");this.start=0|e,this.source=t+"",this.flags=r,this.switchU=n&&this.parser.options.ecmaVersion>=6,this.switchN=n&&this.parser.options.ecmaVersion>=9},be.prototype.raise=function(e){this.parser.raiseRecoverable(this.start,"Invalid regular expression: /"+this.source+"/: "+e)},be.prototype.at=function(e,t){void 0===t&&(t=!1);var r=this.source,n=r.length;if(e>=n)return-1;var i=r.charCodeAt(e);if(!t&&!this.switchU||i<=55295||i>=57344||e+1>=n)return i;var s=r.charCodeAt(e+1);return s>=56320&&s<=57343?(i<<10)+s-56613888:i},be.prototype.nextIndex=function(e,t){void 0===t&&(t=!1);var r=this.source,n=r.length;if(e>=n)return n;var i,s=r.charCodeAt(e);return!t&&!this.switchU||s<=55295||s>=57344||e+1>=n||(i=r.charCodeAt(e+1))<56320||i>57343?e+1:e+2},be.prototype.current=function(e){return void 0===e&&(e=!1),this.at(this.pos,e)},be.prototype.lookahead=function(e){return void 0===e&&(e=!1),this.at(this.nextIndex(this.pos,e),e)},be.prototype.advance=function(e){void 0===e&&(e=!1),this.pos=this.nextIndex(this.pos,e)},be.prototype.eat=function(e,t){return void 0===t&&(t=!1),this.current(t)===e&&(this.advance(t),!0)},_e.validateRegExpFlags=function(e){for(var t=e.validFlags,r=e.flags,n=0;n-1&&this.raise(e.start,"Duplicate regular expression flag")}},_e.validateRegExpPattern=function(e){this.regexp_pattern(e),!e.switchN&&this.options.ecmaVersion>=9&&e.groupNames.length>0&&(e.switchN=!0,this.regexp_pattern(e))},_e.regexp_pattern=function(e){e.pos=0,e.lastIntValue=0,e.lastStringValue="",e.lastAssertionIsQuantifiable=!1,e.numCapturingParens=0,e.maxBackReference=0,e.groupNames.length=0,e.backReferenceNames.length=0,this.regexp_disjunction(e),e.pos!==e.source.length&&(e.eat(41)&&e.raise("Unmatched ')'"),(e.eat(93)||e.eat(125))&&e.raise("Lone quantifier brackets")),e.maxBackReference>e.numCapturingParens&&e.raise("Invalid escape");for(var t=0,r=e.backReferenceNames;t=9&&(r=e.eat(60)),e.eat(61)||e.eat(33))return this.regexp_disjunction(e),e.eat(41)||e.raise("Unterminated group"),e.lastAssertionIsQuantifiable=!r,!0}return e.pos=t,!1},_e.regexp_eatQuantifier=function(e,t){return void 0===t&&(t=!1),!!this.regexp_eatQuantifierPrefix(e,t)&&(e.eat(63),!0)},_e.regexp_eatQuantifierPrefix=function(e,t){return e.eat(42)||e.eat(43)||e.eat(63)||this.regexp_eatBracedQuantifier(e,t)},_e.regexp_eatBracedQuantifier=function(e,t){var r=e.pos;if(e.eat(123)){var n=0,i=-1;if(this.regexp_eatDecimalDigits(e)&&(n=e.lastIntValue,e.eat(44)&&this.regexp_eatDecimalDigits(e)&&(i=e.lastIntValue),e.eat(125)))return-1!==i&&i=9?this.regexp_groupSpecifier(e):63===e.current()&&e.raise("Invalid group"),this.regexp_disjunction(e),e.eat(41))return e.numCapturingParens+=1,!0;e.raise("Unterminated group")}return!1},_e.regexp_eatExtendedAtom=function(e){return e.eat(46)||this.regexp_eatReverseSolidusAtomEscape(e)||this.regexp_eatCharacterClass(e)||this.regexp_eatUncapturingGroup(e)||this.regexp_eatCapturingGroup(e)||this.regexp_eatInvalidBracedQuantifier(e)||this.regexp_eatExtendedPatternCharacter(e)},_e.regexp_eatInvalidBracedQuantifier=function(e){return this.regexp_eatBracedQuantifier(e,!0)&&e.raise("Nothing to repeat"),!1},_e.regexp_eatSyntaxCharacter=function(e){var t=e.current();return!!we(t)&&(e.lastIntValue=t,e.advance(),!0)},_e.regexp_eatPatternCharacters=function(e){for(var t=e.pos,r=0;-1!==(r=e.current())&&!we(r);)e.advance();return e.pos!==t},_e.regexp_eatExtendedPatternCharacter=function(e){var t=e.current();return!(-1===t||36===t||t>=40&&t<=43||46===t||63===t||91===t||94===t||124===t)&&(e.advance(),!0)},_e.regexp_groupSpecifier=function(e){if(e.eat(63)){if(this.regexp_eatGroupName(e))return-1!==e.groupNames.indexOf(e.lastStringValue)&&e.raise("Duplicate capture group name"),void e.groupNames.push(e.lastStringValue);e.raise("Invalid group")}},_e.regexp_eatGroupName=function(e){if(e.lastStringValue="",e.eat(60)){if(this.regexp_eatRegExpIdentifierName(e)&&e.eat(62))return!0;e.raise("Invalid capture group name")}return!1},_e.regexp_eatRegExpIdentifierName=function(e){if(e.lastStringValue="",this.regexp_eatRegExpIdentifierStart(e)){for(e.lastStringValue+=xe(e.lastIntValue);this.regexp_eatRegExpIdentifierPart(e);)e.lastStringValue+=xe(e.lastIntValue);return!0}return!1},_e.regexp_eatRegExpIdentifierStart=function(e){var t=e.pos,r=this.options.ecmaVersion>=11,n=e.current(r);return e.advance(r),92===n&&this.regexp_eatRegExpUnicodeEscapeSequence(e,r)&&(n=e.lastIntValue),function(e){return p(e,!0)||36===e||95===e}(n)?(e.lastIntValue=n,!0):(e.pos=t,!1)},_e.regexp_eatRegExpIdentifierPart=function(e){var t=e.pos,r=this.options.ecmaVersion>=11,n=e.current(r);return e.advance(r),92===n&&this.regexp_eatRegExpUnicodeEscapeSequence(e,r)&&(n=e.lastIntValue),function(e){return f(e,!0)||36===e||95===e||8204===e||8205===e}(n)?(e.lastIntValue=n,!0):(e.pos=t,!1)},_e.regexp_eatAtomEscape=function(e){return!!(this.regexp_eatBackReference(e)||this.regexp_eatCharacterClassEscape(e)||this.regexp_eatCharacterEscape(e)||e.switchN&&this.regexp_eatKGroupName(e))||(e.switchU&&(99===e.current()&&e.raise("Invalid unicode escape"),e.raise("Invalid escape")),!1)},_e.regexp_eatBackReference=function(e){var t=e.pos;if(this.regexp_eatDecimalEscape(e)){var r=e.lastIntValue;if(e.switchU)return r>e.maxBackReference&&(e.maxBackReference=r),!0;if(r<=e.numCapturingParens)return!0;e.pos=t}return!1},_e.regexp_eatKGroupName=function(e){if(e.eat(107)){if(this.regexp_eatGroupName(e))return e.backReferenceNames.push(e.lastStringValue),!0;e.raise("Invalid named reference")}return!1},_e.regexp_eatCharacterEscape=function(e){return this.regexp_eatControlEscape(e)||this.regexp_eatCControlLetter(e)||this.regexp_eatZero(e)||this.regexp_eatHexEscapeSequence(e)||this.regexp_eatRegExpUnicodeEscapeSequence(e,!1)||!e.switchU&&this.regexp_eatLegacyOctalEscapeSequence(e)||this.regexp_eatIdentityEscape(e)},_e.regexp_eatCControlLetter=function(e){var t=e.pos;if(e.eat(99)){if(this.regexp_eatControlLetter(e))return!0;e.pos=t}return!1},_e.regexp_eatZero=function(e){return 48===e.current()&&!Se(e.lookahead())&&(e.lastIntValue=0,e.advance(),!0)},_e.regexp_eatControlEscape=function(e){var t=e.current();return 116===t?(e.lastIntValue=9,e.advance(),!0):110===t?(e.lastIntValue=10,e.advance(),!0):118===t?(e.lastIntValue=11,e.advance(),!0):102===t?(e.lastIntValue=12,e.advance(),!0):114===t&&(e.lastIntValue=13,e.advance(),!0)},_e.regexp_eatControlLetter=function(e){var t=e.current();return!!Ee(t)&&(e.lastIntValue=t%32,e.advance(),!0)},_e.regexp_eatRegExpUnicodeEscapeSequence=function(e,t){void 0===t&&(t=!1);var r,n=e.pos,i=t||e.switchU;if(e.eat(117)){if(this.regexp_eatFixedHexDigits(e,4)){var s=e.lastIntValue;if(i&&s>=55296&&s<=56319){var o=e.pos;if(e.eat(92)&&e.eat(117)&&this.regexp_eatFixedHexDigits(e,4)){var a=e.lastIntValue;if(a>=56320&&a<=57343)return e.lastIntValue=1024*(s-55296)+(a-56320)+65536,!0}e.pos=o,e.lastIntValue=s}return!0}if(i&&e.eat(123)&&this.regexp_eatHexDigits(e)&&e.eat(125)&&((r=e.lastIntValue)>=0&&r<=1114111))return!0;i&&e.raise("Invalid unicode escape"),e.pos=n}return!1},_e.regexp_eatIdentityEscape=function(e){if(e.switchU)return!!this.regexp_eatSyntaxCharacter(e)||!!e.eat(47)&&(e.lastIntValue=47,!0);var t=e.current();return!(99===t||e.switchN&&107===t)&&(e.lastIntValue=t,e.advance(),!0)},_e.regexp_eatDecimalEscape=function(e){e.lastIntValue=0;var t=e.current();if(t>=49&&t<=57){do{e.lastIntValue=10*e.lastIntValue+(t-48),e.advance()}while((t=e.current())>=48&&t<=57);return!0}return!1},_e.regexp_eatCharacterClassEscape=function(e){var t=e.current();if(function(e){return 100===e||68===e||115===e||83===e||119===e||87===e}(t))return e.lastIntValue=-1,e.advance(),!0;if(e.switchU&&this.options.ecmaVersion>=9&&(80===t||112===t)){if(e.lastIntValue=-1,e.advance(),e.eat(123)&&this.regexp_eatUnicodePropertyValueExpression(e)&&e.eat(125))return!0;e.raise("Invalid property name")}return!1},_e.regexp_eatUnicodePropertyValueExpression=function(e){var t=e.pos;if(this.regexp_eatUnicodePropertyName(e)&&e.eat(61)){var r=e.lastStringValue;if(this.regexp_eatUnicodePropertyValue(e)){var n=e.lastStringValue;return this.regexp_validateUnicodePropertyNameAndValue(e,r,n),!0}}if(e.pos=t,this.regexp_eatLoneUnicodePropertyNameOrValue(e)){var i=e.lastStringValue;return this.regexp_validateUnicodePropertyNameOrValue(e,i),!0}return!1},_e.regexp_validateUnicodePropertyNameAndValue=function(e,t,r){I(e.unicodeProperties.nonBinary,t)||e.raise("Invalid property name"),e.unicodeProperties.nonBinary[t].test(r)||e.raise("Invalid property value")},_e.regexp_validateUnicodePropertyNameOrValue=function(e,t){e.unicodeProperties.binary.test(t)||e.raise("Invalid property name")},_e.regexp_eatUnicodePropertyName=function(e){var t=0;for(e.lastStringValue="";Te(t=e.current());)e.lastStringValue+=xe(t),e.advance();return""!==e.lastStringValue},_e.regexp_eatUnicodePropertyValue=function(e){var t=0;for(e.lastStringValue="";Ae(t=e.current());)e.lastStringValue+=xe(t),e.advance();return""!==e.lastStringValue},_e.regexp_eatLoneUnicodePropertyNameOrValue=function(e){return this.regexp_eatUnicodePropertyValue(e)},_e.regexp_eatCharacterClass=function(e){if(e.eat(91)){if(e.eat(94),this.regexp_classRanges(e),e.eat(93))return!0;e.raise("Unterminated character class")}return!1},_e.regexp_classRanges=function(e){for(;this.regexp_eatClassAtom(e);){var t=e.lastIntValue;if(e.eat(45)&&this.regexp_eatClassAtom(e)){var r=e.lastIntValue;!e.switchU||-1!==t&&-1!==r||e.raise("Invalid character class"),-1!==t&&-1!==r&&t>r&&e.raise("Range out of order in character class")}}},_e.regexp_eatClassAtom=function(e){var t=e.pos;if(e.eat(92)){if(this.regexp_eatClassEscape(e))return!0;if(e.switchU){var r=e.current();(99===r||Ie(r))&&e.raise("Invalid class escape"),e.raise("Invalid escape")}e.pos=t}var n=e.current();return 93!==n&&(e.lastIntValue=n,e.advance(),!0)},_e.regexp_eatClassEscape=function(e){var t=e.pos;if(e.eat(98))return e.lastIntValue=8,!0;if(e.switchU&&e.eat(45))return e.lastIntValue=45,!0;if(!e.switchU&&e.eat(99)){if(this.regexp_eatClassControlLetter(e))return!0;e.pos=t}return this.regexp_eatCharacterClassEscape(e)||this.regexp_eatCharacterEscape(e)},_e.regexp_eatClassControlLetter=function(e){var t=e.current();return!(!Se(t)&&95!==t)&&(e.lastIntValue=t%32,e.advance(),!0)},_e.regexp_eatHexEscapeSequence=function(e){var t=e.pos;if(e.eat(120)){if(this.regexp_eatFixedHexDigits(e,2))return!0;e.switchU&&e.raise("Invalid escape"),e.pos=t}return!1},_e.regexp_eatDecimalDigits=function(e){var t=e.pos,r=0;for(e.lastIntValue=0;Se(r=e.current());)e.lastIntValue=10*e.lastIntValue+(r-48),e.advance();return e.pos!==t},_e.regexp_eatHexDigits=function(e){var t=e.pos,r=0;for(e.lastIntValue=0;ke(r=e.current());)e.lastIntValue=16*e.lastIntValue+Ce(r),e.advance();return e.pos!==t},_e.regexp_eatLegacyOctalEscapeSequence=function(e){if(this.regexp_eatOctalDigit(e)){var t=e.lastIntValue;if(this.regexp_eatOctalDigit(e)){var r=e.lastIntValue;t<=3&&this.regexp_eatOctalDigit(e)?e.lastIntValue=64*t+8*r+e.lastIntValue:e.lastIntValue=8*t+r}else e.lastIntValue=t;return!0}return!1},_e.regexp_eatOctalDigit=function(e){var t=e.current();return Ie(t)?(e.lastIntValue=t-48,e.advance(),!0):(e.lastIntValue=0,!1)},_e.regexp_eatFixedHexDigits=function(e,t){var r=e.pos;e.lastIntValue=0;for(var n=0;n>10),56320+(1023&e)))}Oe.next=function(e){!e&&this.type.keyword&&this.containsEsc&&this.raiseRecoverable(this.start,"Escape sequence in keyword "+this.type.keyword),this.options.onToken&&this.options.onToken(new Re(this)),this.lastTokEnd=this.end,this.lastTokStart=this.start,this.lastTokEndLoc=this.endLoc,this.lastTokStartLoc=this.startLoc,this.nextToken()},Oe.getToken=function(){return this.next(),new Re(this)},"undefined"!=typeof Symbol&&(Oe[Symbol.iterator]=function(){var e=this;return{next:function(){var t=e.getToken();return{done:t.type===b.eof,value:t}}}}),Oe.curContext=function(){return this.context[this.context.length-1]},Oe.nextToken=function(){var e=this.curContext();return e&&e.preserveSpace||this.skipSpace(),this.start=this.pos,this.options.locations&&(this.startLoc=this.curPosition()),this.pos>=this.input.length?this.finishToken(b.eof):e.override?e.override(this):void this.readToken(this.fullCharCodeAtPos())},Oe.readToken=function(e){return p(e,this.options.ecmaVersion>=6)||92===e?this.readWord():this.getTokenFromCode(e)},Oe.fullCharCodeAtPos=function(){var e=this.input.charCodeAt(this.pos);return e<=55295||e>=57344?e:(e<<10)+this.input.charCodeAt(this.pos+1)-56613888},Oe.skipBlockComment=function(){var e,t=this.options.onComment&&this.curPosition(),r=this.pos,n=this.input.indexOf("*/",this.pos+=2);if(-1===n&&this.raise(this.pos-2,"Unterminated comment"),this.pos=n+2,this.options.locations)for(w.lastIndex=r;(e=w.exec(this.input))&&e.index8&&e<14||e>=5760&&T.test(String.fromCharCode(e))))break e;++this.pos}}},Oe.finishToken=function(e,t){this.end=this.pos,this.options.locations&&(this.endLoc=this.curPosition());var r=this.type;this.type=e,this.value=t,this.updateContext(r)},Oe.readToken_dot=function(){var e=this.input.charCodeAt(this.pos+1);if(e>=48&&e<=57)return this.readNumber(!0);var t=this.input.charCodeAt(this.pos+2);return this.options.ecmaVersion>=6&&46===e&&46===t?(this.pos+=3,this.finishToken(b.ellipsis)):(++this.pos,this.finishToken(b.dot))},Oe.readToken_slash=function(){var e=this.input.charCodeAt(this.pos+1);return this.exprAllowed?(++this.pos,this.readRegexp()):61===e?this.finishOp(b.assign,2):this.finishOp(b.slash,1)},Oe.readToken_mult_modulo_exp=function(e){var t=this.input.charCodeAt(this.pos+1),r=1,n=42===e?b.star:b.modulo;return this.options.ecmaVersion>=7&&42===e&&42===t&&(++r,n=b.starstar,t=this.input.charCodeAt(this.pos+2)),61===t?this.finishOp(b.assign,r+1):this.finishOp(n,r)},Oe.readToken_pipe_amp=function(e){var t=this.input.charCodeAt(this.pos+1);if(t===e){if(this.options.ecmaVersion>=12)if(61===this.input.charCodeAt(this.pos+2))return this.finishOp(b.assign,3);return this.finishOp(124===e?b.logicalOR:b.logicalAND,2)}return 61===t?this.finishOp(b.assign,2):this.finishOp(124===e?b.bitwiseOR:b.bitwiseAND,1)},Oe.readToken_caret=function(){return 61===this.input.charCodeAt(this.pos+1)?this.finishOp(b.assign,2):this.finishOp(b.bitwiseXOR,1)},Oe.readToken_plus_min=function(e){var t=this.input.charCodeAt(this.pos+1);return t===e?45!==t||this.inModule||62!==this.input.charCodeAt(this.pos+2)||0!==this.lastTokEnd&&!x.test(this.input.slice(this.lastTokEnd,this.pos))?this.finishOp(b.incDec,2):(this.skipLineComment(3),this.skipSpace(),this.nextToken()):61===t?this.finishOp(b.assign,2):this.finishOp(b.plusMin,1)},Oe.readToken_lt_gt=function(e){var t=this.input.charCodeAt(this.pos+1),r=1;return t===e?(r=62===e&&62===this.input.charCodeAt(this.pos+2)?3:2,61===this.input.charCodeAt(this.pos+r)?this.finishOp(b.assign,r+1):this.finishOp(b.bitShift,r)):33!==t||60!==e||this.inModule||45!==this.input.charCodeAt(this.pos+2)||45!==this.input.charCodeAt(this.pos+3)?(61===t&&(r=2),this.finishOp(b.relational,r)):(this.skipLineComment(4),this.skipSpace(),this.nextToken())},Oe.readToken_eq_excl=function(e){var t=this.input.charCodeAt(this.pos+1);return 61===t?this.finishOp(b.equality,61===this.input.charCodeAt(this.pos+2)?3:2):61===e&&62===t&&this.options.ecmaVersion>=6?(this.pos+=2,this.finishToken(b.arrow)):this.finishOp(61===e?b.eq:b.prefix,1)},Oe.readToken_question=function(){var e=this.options.ecmaVersion;if(e>=11){var t=this.input.charCodeAt(this.pos+1);if(46===t){var r=this.input.charCodeAt(this.pos+2);if(r<48||r>57)return this.finishOp(b.questionDot,2)}if(63===t){if(e>=12)if(61===this.input.charCodeAt(this.pos+2))return this.finishOp(b.assign,3);return this.finishOp(b.coalesce,2)}}return this.finishOp(b.question,1)},Oe.getTokenFromCode=function(e){switch(e){case 46:return this.readToken_dot();case 40:return++this.pos,this.finishToken(b.parenL);case 41:return++this.pos,this.finishToken(b.parenR);case 59:return++this.pos,this.finishToken(b.semi);case 44:return++this.pos,this.finishToken(b.comma);case 91:return++this.pos,this.finishToken(b.bracketL);case 93:return++this.pos,this.finishToken(b.bracketR);case 123:return++this.pos,this.finishToken(b.braceL);case 125:return++this.pos,this.finishToken(b.braceR);case 58:return++this.pos,this.finishToken(b.colon);case 96:if(this.options.ecmaVersion<6)break;return++this.pos,this.finishToken(b.backQuote);case 48:var t=this.input.charCodeAt(this.pos+1);if(120===t||88===t)return this.readRadixNumber(16);if(this.options.ecmaVersion>=6){if(111===t||79===t)return this.readRadixNumber(8);if(98===t||66===t)return this.readRadixNumber(2)}case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57:return this.readNumber(!1);case 34:case 39:return this.readString(e);case 47:return this.readToken_slash();case 37:case 42:return this.readToken_mult_modulo_exp(e);case 124:case 38:return this.readToken_pipe_amp(e);case 94:return this.readToken_caret();case 43:case 45:return this.readToken_plus_min(e);case 60:case 62:return this.readToken_lt_gt(e);case 61:case 33:return this.readToken_eq_excl(e);case 63:return this.readToken_question();case 126:return this.finishOp(b.prefix,1)}this.raise(this.pos,"Unexpected character '"+Pe(e)+"'")},Oe.finishOp=function(e,t){var r=this.input.slice(this.pos,this.pos+t);return this.pos+=t,this.finishToken(e,r)},Oe.readRegexp=function(){for(var e,t,r=this.pos;;){this.pos>=this.input.length&&this.raise(r,"Unterminated regular expression");var n=this.input.charAt(this.pos);if(x.test(n)&&this.raise(r,"Unterminated regular expression"),e)e=!1;else{if("["===n)t=!0;else if("]"===n&&t)t=!1;else if("/"===n&&!t)break;e="\\"===n}++this.pos}var i=this.input.slice(r,this.pos);++this.pos;var s=this.pos,o=this.readWord1();this.containsEsc&&this.unexpected(s);var a=this.regexpState||(this.regexpState=new be(this));a.reset(r,i,o),this.validateRegExpFlags(a),this.validateRegExpPattern(a);var u=null;try{u=new RegExp(i,o)}catch(e){}return this.finishToken(b.regexp,{pattern:i,flags:o,value:u})},Oe.readInt=function(e,t,r){for(var n=this.options.ecmaVersion>=12&&void 0===t,i=r&&48===this.input.charCodeAt(this.pos),s=this.pos,o=0,a=0,u=0,l=null==t?1/0:t;u=97?c-97+10:c>=65?c-65+10:c>=48&&c<=57?c-48:1/0)>=e)break;a=c,o=o*e+h}}return n&&95===a&&this.raiseRecoverable(this.pos-1,"Numeric separator is not allowed at the last of digits"),this.pos===s||null!=t&&this.pos-s!==t?null:o},Oe.readRadixNumber=function(e){var t=this.pos;this.pos+=2;var r=this.readInt(e);return null==r&&this.raise(this.start+2,"Expected number in radix "+e),this.options.ecmaVersion>=11&&110===this.input.charCodeAt(this.pos)?(r=Le(this.input.slice(t,this.pos)),++this.pos):p(this.fullCharCodeAtPos())&&this.raise(this.pos,"Identifier directly after number"),this.finishToken(b.num,r)},Oe.readNumber=function(e){var t=this.pos;e||null!==this.readInt(10,void 0,!0)||this.raise(t,"Invalid number");var r=this.pos-t>=2&&48===this.input.charCodeAt(t);r&&this.strict&&this.raise(t,"Invalid number");var n=this.input.charCodeAt(this.pos);if(!r&&!e&&this.options.ecmaVersion>=11&&110===n){var i=Le(this.input.slice(t,this.pos));return++this.pos,p(this.fullCharCodeAtPos())&&this.raise(this.pos,"Identifier directly after number"),this.finishToken(b.num,i)}r&&/[89]/.test(this.input.slice(t,this.pos))&&(r=!1),46!==n||r||(++this.pos,this.readInt(10),n=this.input.charCodeAt(this.pos)),69!==n&&101!==n||r||(43!==(n=this.input.charCodeAt(++this.pos))&&45!==n||++this.pos,null===this.readInt(10)&&this.raise(t,"Invalid number")),p(this.fullCharCodeAtPos())&&this.raise(this.pos,"Identifier directly after number");var s,o=(s=this.input.slice(t,this.pos),r?parseInt(s,8):parseFloat(s.replace(/_/g,"")));return this.finishToken(b.num,o)},Oe.readCodePoint=function(){var e;if(123===this.input.charCodeAt(this.pos)){this.options.ecmaVersion<6&&this.unexpected();var t=++this.pos;e=this.readHexChar(this.input.indexOf("}",this.pos)-this.pos),++this.pos,e>1114111&&this.invalidStringToken(t,"Code point out of bounds")}else e=this.readHexChar(4);return e},Oe.readString=function(e){for(var t="",r=++this.pos;;){this.pos>=this.input.length&&this.raise(this.start,"Unterminated string constant");var n=this.input.charCodeAt(this.pos);if(n===e)break;92===n?(t+=this.input.slice(r,this.pos),t+=this.readEscapedChar(!1),r=this.pos):(E(n,this.options.ecmaVersion>=10)&&this.raise(this.start,"Unterminated string constant"),++this.pos)}return t+=this.input.slice(r,this.pos++),this.finishToken(b.string,t)};var Me={};Oe.tryReadTemplateToken=function(){this.inTemplateElement=!0;try{this.readTmplToken()}catch(e){if(e!==Me)throw e;this.readInvalidTemplateToken()}this.inTemplateElement=!1},Oe.invalidStringToken=function(e,t){if(this.inTemplateElement&&this.options.ecmaVersion>=9)throw Me;this.raise(e,t)},Oe.readTmplToken=function(){for(var e="",t=this.pos;;){this.pos>=this.input.length&&this.raise(this.start,"Unterminated template");var r=this.input.charCodeAt(this.pos);if(96===r||36===r&&123===this.input.charCodeAt(this.pos+1))return this.pos!==this.start||this.type!==b.template&&this.type!==b.invalidTemplate?(e+=this.input.slice(t,this.pos),this.finishToken(b.template,e)):36===r?(this.pos+=2,this.finishToken(b.dollarBraceL)):(++this.pos,this.finishToken(b.backQuote));if(92===r)e+=this.input.slice(t,this.pos),e+=this.readEscapedChar(!0),t=this.pos;else if(E(r)){switch(e+=this.input.slice(t,this.pos),++this.pos,r){case 13:10===this.input.charCodeAt(this.pos)&&++this.pos;case 10:e+="\n";break;default:e+=String.fromCharCode(r)}this.options.locations&&(++this.curLine,this.lineStart=this.pos),t=this.pos}else++this.pos}},Oe.readInvalidTemplateToken=function(){for(;this.pos=48&&t<=55){var n=this.input.substr(this.pos-1,3).match(/^[0-7]+/)[0],i=parseInt(n,8);return i>255&&(n=n.slice(0,-1),i=parseInt(n,8)),this.pos+=n.length-1,t=this.input.charCodeAt(this.pos),"0"===n&&56!==t&&57!==t||!this.strict&&!e||this.invalidStringToken(this.pos-1-n.length,e?"Octal literal in template string":"Octal literal in strict mode"),String.fromCharCode(i)}return E(t)?"":String.fromCharCode(t)}},Oe.readHexChar=function(e){var t=this.pos,r=this.readInt(16,e);return null===r&&this.invalidStringToken(t,"Bad character escape sequence"),r},Oe.readWord1=function(){this.containsEsc=!1;for(var e="",t=!0,r=this.pos,n=this.options.ecmaVersion>=6;this.pos[...new Set([].concat(...e))])},{}],26:[function(e,t,r){"use strict";function n(e,t,r){e instanceof RegExp&&(e=i(e,r)),t instanceof RegExp&&(t=i(t,r));var n=s(e,t,r);return n&&{start:n[0],end:n[1],pre:r.slice(0,n[0]),body:r.slice(n[0]+e.length,n[1]),post:r.slice(n[1]+t.length)}}function i(e,t){var r=t.match(e);return r?r[0]:null}function s(e,t,r){var n,i,s,o,a,u=r.indexOf(e),l=r.indexOf(t,u+1),c=u;if(u>=0&&l>0){for(n=[],s=r.length;c>=0&&!a;)c==u?(n.push(c),u=r.indexOf(e,c+1)):1==n.length?a=[n.pop(),l]:((i=n.pop())=0?u:l;n.length&&(a=[s,o])}return a}t.exports=n,n.range=s},{}],27:[function(e,t,r){var n=e("file-system"),i=e("path"),s=e("ajax-request");function o(e,t){var r=i.extname(e).substr(1);return"svg"===(r=r||"png")&&(r="svg+xml"),"data:image/"+r+";base64,"+t.toString("base64")}function a(e){var t=e.match(/^data:image\/([\w+]+);base64,([\s\S]+)/),r={jpeg:"jpg","svg+xml":"svg"};if(!t)throw new Error("image base64 data error");return{extname:"."+(r[t[1]]?r[t[1]]:t[1]),base64:t[2]}}r.base64=function(e,t){t||(t=util.noop),n.readFile(e,function(r,n){if(r)return t(r);t(null,o(e,n))})},r.base64Sync=function(e){return o(e,n.readFileSync(e))},r.requestBase64=function(e,t){s({url:e,isBuffer:!0},function(e,r,n){if(e)return t(e);var i="data:"+r.headers["content-type"]+";base64,"+n.toString("base64");t(e,r,i)})},r.img=function(e,t,r,s){var o=a(e),u=i.join(t,r+o.extname);n.writeFile(u,o.base64,{encoding:"base64"},function(e){s(e,u)})},r.imgSync=function(e,t,r){var s=a(e),o=i.join(t,r+s.extname);return n.writeFileSync(o,s.base64,{encoding:"base64"}),o}},{"ajax-request":24,"file-system":97,path:397}],28:[function(e,t,r){"use strict";r.byteLength=function(e){var t=l(e),r=t[0],n=t[1];return 3*(r+n)/4-n},r.toByteArray=function(e){for(var t,r=l(e),n=r[0],o=r[1],a=new s(function(e,t,r){return 3*(t+r)/4-r}(0,n,o)),u=0,c=o>0?n-4:n,h=0;h>16&255,a[u++]=t>>8&255,a[u++]=255&t;2===o&&(t=i[e.charCodeAt(h)]<<2|i[e.charCodeAt(h+1)]>>4,a[u++]=255&t);1===o&&(t=i[e.charCodeAt(h)]<<10|i[e.charCodeAt(h+1)]<<4|i[e.charCodeAt(h+2)]>>2,a[u++]=t>>8&255,a[u++]=255&t);return a},r.fromByteArray=function(e){for(var t,r=e.length,i=r%3,s=[],o=0,a=r-i;oa?a:o+16383));1===i?(t=e[r-1],s.push(n[t>>2]+n[t<<4&63]+"==")):2===i&&(t=(e[r-2]<<8)+e[r-1],s.push(n[t>>10]+n[t>>4&63]+n[t<<2&63]+"="));return s.join("")};for(var n=[],i=[],s="undefined"!=typeof Uint8Array?Uint8Array:Array,o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",a=0,u=o.length;a0)throw new Error("Invalid string. Length must be a multiple of 4");var r=e.indexOf("=");return-1===r&&(r=t),[r,r===t?0:4-r%4]}function c(e,t,r){for(var i,s,o=[],a=t;a>18&63]+n[s>>12&63]+n[s>>6&63]+n[63&s]);return o.join("")}i["-".charCodeAt(0)]=62,i["_".charCodeAt(0)]=63},{}],29:[function(e,t,r){"use strict";const n=e("fs"),i=e("path"),s=e("url"),o=e("pify"),a=e("import-lazy")(e),u=a("bin-check"),l=a("bin-version-check"),c=a("download"),h=a("os-filter-obj"),p=o(n.stat),f=o(n.chmod);t.exports=class{constructor(e={}){this.options=e,this.options.strip<=0?this.options.strip=0:this.options.strip||(this.options.strip=1)}src(e,t,r){return 0===arguments.length?this._src:(this._src=this._src||[],this._src.push({url:e,os:t,arch:r}),this)}dest(e){return 0===arguments.length?this._dest:(this._dest=e,this)}use(e){return 0===arguments.length?this._use:(this._use=e,this)}version(e){return 0===arguments.length?this._version:(this._version=e,this)}path(){return i.join(this.dest(),this.use())}run(e=["--version"]){return this.findExisting().then(()=>{if(!this.options.skipCheck)return this.runCheck(e)})}runCheck(e){return u(this.path(),e).then(e=>{if(!e)throw new Error(`The \`${this.path()}\` binary doesn't seem to work correctly`);return this.version()?l(this.path(),this.version()):Promise.resolve()})}findExisting(){return p(this.path()).catch(e=>e&&"ENOENT"===e.code?this.download():Promise.reject(e))}download(){const e=h(this.src()||[]),t=[];return 0===e.length?Promise.reject(new Error("No binary found matching your system. It's probably not supported.")):(e.forEach(e=>t.push(e.url)),Promise.all(t.map(e=>c(e,this.dest(),{extract:!0,strip:this.options.strip}))).then(t=>{const r=t.map((t,r)=>{if(Array.isArray(t))return t.map(e=>e.path);const n=s.parse(e[r].url);return i.parse(n.pathname).base}).reduce((e,t)=>(Array.isArray(t)?e.push(...t):e.push(t),e),[]);return Promise.all(r.map(e=>f(i.join(this.dest(),e),493)))}))}}},{fs:290,"import-lazy":346,path:397,pify:30,url:534}],30:[function(e,t,r){"use strict";const n=(e,t)=>(function(...r){return new(0,t.promiseModule)((n,i)=>{t.multiArgs?r.push((...e)=>{t.errorFirst?e[0]?i(e):(e.shift(),n(e)):n(e)}):t.errorFirst?r.push((e,t)=>{e?i(e):n(t)}):r.push(n),e.apply(this,r)})});t.exports=((e,t)=>{t=Object.assign({exclude:[/.+(Sync|Stream)$/],errorFirst:!0,promiseModule:Promise},t);const r=typeof e;if(null===e||"object"!==r&&"function"!==r)throw new TypeError(`Expected \`input\` to be a \`Function\` or \`Object\`, got \`${null===e?"null":r}\``);const i=e=>{const r=t=>"string"==typeof t?e===t:t.test(e);return t.include?t.include.some(r):!t.exclude.some(r)};let s;s="function"===r?function(...r){return t.excludeMain?e(...r):n(e,t).apply(this,r)}:Object.create(Object.getPrototypeOf(e));for(const r in e){const o=e[r];s[r]="function"==typeof o&&i(r)?n(o,t):o}return s})},{}],31:[function(e,t,r){(function(n,i){var s=e("fs"),o=e("path"),a=e("file-uri-to-path"),u=o.join,l=o.dirname,c=s.accessSync&&function(e){try{s.accessSync(e)}catch(e){return!1}return!0}||s.existsSync||o.existsSync,h={arrow:n.env.NODE_BINDINGS_ARROW||" → ",compiled:n.env.NODE_BINDINGS_COMPILED_DIR||"compiled",platform:n.platform,arch:n.arch,nodePreGyp:"node-v"+n.versions.modules+"-"+n.platform+"-"+n.arch,version:n.versions.node,bindings:"bindings.node",try:[["module_root","build","bindings"],["module_root","build","Debug","bindings"],["module_root","build","Release","bindings"],["module_root","out","Debug","bindings"],["module_root","Debug","bindings"],["module_root","out","Release","bindings"],["module_root","Release","bindings"],["module_root","build","default","bindings"],["module_root","compiled","version","platform","arch","bindings"],["module_root","addon-build","release","install-root","bindings"],["module_root","addon-build","debug","install-root","bindings"],["module_root","addon-build","default","install-root","bindings"],["module_root","lib","binding","nodePreGyp","bindings"]]};t.exports=r=function(t){"string"==typeof t?t={bindings:t}:t||(t={}),Object.keys(h).map(function(e){e in t||(t[e]=h[e])}),t.module_root||(t.module_root=r.getRoot(r.getFileName())),".node"!=o.extname(t.bindings)&&(t.bindings+=".node");for(var n,i,s,a="function"==typeof __webpack_require__?__non_webpack_require__:e,l=[],c=0,p=t.try.length;c0)-(e<0)},r.abs=function(e){var t=e>>31;return(e^t)-t},r.min=function(e,t){return t^(e^t)&-(e65535)<<4,t|=r=((e>>>=t)>255)<<3,t|=r=((e>>>=r)>15)<<2,(t|=r=((e>>>=r)>3)<<1)|(e>>>=r)>>1},r.log10=function(e){return e>=1e9?9:e>=1e8?8:e>=1e7?7:e>=1e6?6:e>=1e5?5:e>=1e4?4:e>=1e3?3:e>=100?2:e>=10?1:0},r.popCount=function(e){return 16843009*((e=(858993459&(e-=e>>>1&1431655765))+(e>>>2&858993459))+(e>>>4)&252645135)>>>24},r.countTrailingZeros=n,r.nextPow2=function(e){return e+=0===e,--e,e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,(e|=e>>>16)+1},r.prevPow2=function(e){return e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,(e|=e>>>16)-(e>>>1)},r.parity=function(e){return e^=e>>>16,e^=e>>>8,e^=e>>>4,27030>>>(e&=15)&1};var i=new Array(256);!function(e){for(var t=0;t<256;++t){var r=t,n=t,i=7;for(r>>>=1;r;r>>>=1)n<<=1,n|=1&r,--i;e[t]=n<>>8&255]<<16|i[e>>>16&255]<<8|i[e>>>24&255]},r.interleave2=function(e,t){return(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e&=65535)|e<<8))|e<<4))|e<<2))|e<<1))|(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t&=65535)|t<<8))|t<<4))|t<<2))|t<<1))<<1},r.deinterleave2=function(e,t){return(e=65535&((e=16711935&((e=252645135&((e=858993459&((e=e>>>t&1431655765)|e>>>1))|e>>>2))|e>>>4))|e>>>16))<<16>>16},r.interleave3=function(e,t,r){return e=1227133513&((e=3272356035&((e=251719695&((e=4278190335&((e&=1023)|e<<16))|e<<8))|e<<4))|e<<2),(e|=(t=1227133513&((t=3272356035&((t=251719695&((t=4278190335&((t&=1023)|t<<16))|t<<8))|t<<4))|t<<2))<<1)|(r=1227133513&((r=3272356035&((r=251719695&((r=4278190335&((r&=1023)|r<<16))|r<<8))|r<<4))|r<<2))<<2},r.deinterleave3=function(e,t){return(e=1023&((e=4278190335&((e=251719695&((e=3272356035&((e=e>>>t&1227133513)|e>>>2))|e>>>4))|e>>>8))|e>>>16))<<22>>22},r.nextCombination=function(e){var t=e|e-1;return t+1|(~t&-~t)-1>>>n(e)+1}},{}],33:[function(e,t,r){(function(e,n,i){!function(e){if("object"==typeof r&&void 0!==t)t.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var i;"undefined"!=typeof window?i=window:void 0!==n?i=n:"undefined"!=typeof self&&(i=self),i.Promise=e()}}(function(){var t,r,s;return function e(t,r,n){function i(o,a){if(!r[o]){if(!t[o]){var u="function"==typeof _dereq_&&_dereq_;if(!a&&u)return u(o,!0);if(s)return s(o,!0);var l=new Error("Cannot find module '"+o+"'");throw l.code="MODULE_NOT_FOUND",l}var c=r[o]={exports:{}};t[o][0].call(c.exports,function(e){var r=t[o][1][e];return i(r||e)},c,c.exports,e,t,r,n)}return r[o].exports}for(var s="function"==typeof _dereq_&&_dereq_,o=0;o0;)f(e)}function f(e){var t=e.shift();if("function"!=typeof t)t._settlePromises();else{var r=e.shift(),n=e.shift();t.call(r,n)}}u.prototype.setScheduler=function(e){var t=this._schedule;return this._schedule=e,this._customScheduler=!0,t},u.prototype.hasCustomScheduler=function(){return this._customScheduler},u.prototype.enableTrampoline=function(){this._trampolineEnabled=!0},u.prototype.disableTrampolineIfNecessary=function(){a.hasDevTools&&(this._trampolineEnabled=!1)},u.prototype.haveItemsQueued=function(){return this._isTickUsed||this._haveDrainedQueues},u.prototype.fatalError=function(t,r){r?(e.stderr.write("Fatal "+(t instanceof Error?t.stack:t)+"\n"),e.exit(2)):this.throwLater(t)},u.prototype.throwLater=function(e,t){if(1===arguments.length&&(t=e,e=function(){throw t}),"undefined"!=typeof setTimeout)setTimeout(function(){e(t)},0);else try{this._schedule(function(){e(t)})}catch(e){throw new Error("No async scheduler available\n\n See http://goo.gl/MqrFmX\n")}},a.hasDevTools?(u.prototype.invokeLater=function(e,t,r){this._trampolineEnabled?l.call(this,e,t,r):this._schedule(function(){setTimeout(function(){e.call(t,r)},100)})},u.prototype.invoke=function(e,t,r){this._trampolineEnabled?c.call(this,e,t,r):this._schedule(function(){e.call(t,r)})},u.prototype.settlePromises=function(e){this._trampolineEnabled?h.call(this,e):this._schedule(function(){e._settlePromises()})}):(u.prototype.invokeLater=l,u.prototype.invoke=c,u.prototype.settlePromises=h),u.prototype._drainQueues=function(){p(this._normalQueue),this._reset(),this._haveDrainedQueues=!0,p(this._lateQueue)},u.prototype._queueTick=function(){this._isTickUsed||(this._isTickUsed=!0,this._schedule(this.drainQueues))},u.prototype._reset=function(){this._isTickUsed=!1},r.exports=u,r.exports.firstLineError=i},{"./queue":26,"./schedule":29,"./util":36}],3:[function(e,t,r){"use strict";t.exports=function(e,t,r,n){var i=!1,s=function(e,t){this._reject(t)},o=function(e,t){t.promiseRejectionQueued=!0,t.bindingPromise._then(s,s,null,this,e)},a=function(e,t){0==(50397184&this._bitField)&&this._resolveCallback(t.target)},u=function(e,t){t.promiseRejectionQueued||this._reject(e)};e.prototype.bind=function(s){i||(i=!0,e.prototype._propagateFrom=n.propagateFromFunction(),e.prototype._boundValue=n.boundValueFunction());var l=r(s),c=new e(t);c._propagateFrom(this,1);var h=this._target();if(c._setBoundTo(l),l instanceof e){var p={promiseRejectionQueued:!1,promise:c,target:h,bindingPromise:l};h._then(t,o,void 0,c,p),l._then(a,u,void 0,c,p),c._setOnCancel(l)}else c._resolveCallback(h);return c},e.prototype._setBoundTo=function(e){void 0!==e?(this._bitField=2097152|this._bitField,this._boundTo=e):this._bitField=-2097153&this._bitField},e.prototype._isBound=function(){return 2097152==(2097152&this._bitField)},e.bind=function(t,r){return e.resolve(r).bind(t)}}},{}],4:[function(e,t,r){"use strict";var n;"undefined"!=typeof Promise&&(n=Promise);var i=e("./promise")();i.noConflict=function(){try{Promise===i&&(Promise=n)}catch(e){}return i},t.exports=i},{"./promise":22}],5:[function(e,t,r){"use strict";var n=Object.create;if(n){var i=n(null),s=n(null);i[" size"]=s[" size"]=0}t.exports=function(t){var r,n=e("./util"),i=n.canEvaluate;n.isIdentifier;function s(e,r){var i;if(null!=e&&(i=e[r]),"function"!=typeof i){var s="Object "+n.classString(e)+" has no method '"+n.toString(r)+"'";throw new t.TypeError(s)}return i}function o(e){return s(e,this.pop()).apply(e,this)}function a(e){return e[this]}function u(e){var t=+this;return t<0&&(t=Math.max(0,t+e.length)),e[t]}t.prototype.call=function(e){var t=[].slice.call(arguments,1);return t.push(e),this._then(o,void 0,void 0,t,void 0)},t.prototype.get=function(e){var t;if("number"==typeof e)t=u;else if(i){var n=r(e);t=null!==n?n:a}else t=a;return this._then(t,void 0,void 0,e,void 0)}}},{"./util":36}],6:[function(e,t,r){"use strict";t.exports=function(t,r,n,i){var s=e("./util"),o=s.tryCatch,a=s.errorObj,u=t._async;t.prototype.break=t.prototype.cancel=function(){if(!i.cancellation())return this._warn("cancellation is disabled");for(var e=this,t=e;e._isCancellable();){if(!e._cancelBy(t)){t._isFollowing()?t._followee().cancel():t._cancelBranched();break}var r=e._cancellationParent;if(null==r||!r._isCancellable()){e._isFollowing()?e._followee().cancel():e._cancelBranched();break}e._isFollowing()&&e._followee().cancel(),e._setWillBeCancelled(),t=e,e=r}},t.prototype._branchHasCancelled=function(){this._branchesRemainingToCancel--},t.prototype._enoughBranchesHaveCancelled=function(){return void 0===this._branchesRemainingToCancel||this._branchesRemainingToCancel<=0},t.prototype._cancelBy=function(e){return e===this?(this._branchesRemainingToCancel=0,this._invokeOnCancel(),!0):(this._branchHasCancelled(),!!this._enoughBranchesHaveCancelled()&&(this._invokeOnCancel(),!0))},t.prototype._cancelBranched=function(){this._enoughBranchesHaveCancelled()&&this._cancel()},t.prototype._cancel=function(){this._isCancellable()&&(this._setCancelled(),u.invoke(this._cancelPromises,this,void 0))},t.prototype._cancelPromises=function(){this._length()>0&&this._settlePromises()},t.prototype._unsetOnCancel=function(){this._onCancelField=void 0},t.prototype._isCancellable=function(){return this.isPending()&&!this._isCancelled()},t.prototype.isCancellable=function(){return this.isPending()&&!this.isCancelled()},t.prototype._doInvokeOnCancel=function(e,t){if(s.isArray(e))for(var r=0;r=0)return r[e]}return e.prototype._promiseCreated=function(){},e.prototype._pushContext=function(){},e.prototype._popContext=function(){return null},e._peekContext=e.prototype._peekContext=function(){},n.prototype._pushContext=function(){void 0!==this._trace&&(this._trace._promiseCreated=null,r.push(this._trace))},n.prototype._popContext=function(){if(void 0!==this._trace){var e=r.pop(),t=e._promiseCreated;return e._promiseCreated=null,t}return null},n.CapturedTrace=null,n.create=function(){if(t)return new n},n.deactivateLongStackTraces=function(){},n.activateLongStackTraces=function(){var r=e.prototype._pushContext,s=e.prototype._popContext,o=e._peekContext,a=e.prototype._peekContext,u=e.prototype._promiseCreated;n.deactivateLongStackTraces=function(){e.prototype._pushContext=r,e.prototype._popContext=s,e._peekContext=o,e.prototype._peekContext=a,e.prototype._promiseCreated=u,t=!1},t=!0,e.prototype._pushContext=n.prototype._pushContext,e.prototype._popContext=n.prototype._popContext,e._peekContext=e.prototype._peekContext=i,e.prototype._promiseCreated=function(){var e=this._peekContext();e&&null==e._promiseCreated&&(e._promiseCreated=this)}},n}},{}],9:[function(t,r,n){"use strict";r.exports=function(r,n){var i,s,o,a=r._getDomain,u=r._async,l=t("./errors").Warning,c=t("./util"),h=t("./es5"),p=c.canAttachTrace,f=/[\\\/]bluebird[\\\/]js[\\\/](release|debug|instrumented)/,d=/\((?:timers\.js):\d+:\d+\)/,m=/[\/<\(](.+?):(\d+):(\d+)\)?\s*$/,g=null,v=null,y=!1,_=!(0==c.env("BLUEBIRD_DEBUG")),b=!(0==c.env("BLUEBIRD_WARNINGS")||!_&&!c.env("BLUEBIRD_WARNINGS")),x=!(0==c.env("BLUEBIRD_LONG_STACK_TRACES")||!_&&!c.env("BLUEBIRD_LONG_STACK_TRACES")),w=0!=c.env("BLUEBIRD_W_FORGOTTEN_RETURN")&&(b||!!c.env("BLUEBIRD_W_FORGOTTEN_RETURN"));r.prototype.suppressUnhandledRejections=function(){var e=this._target();e._bitField=-1048577&e._bitField|524288},r.prototype._ensurePossibleRejectionHandled=function(){if(0==(524288&this._bitField)){this._setRejectionIsUnhandled();var e=this;setTimeout(function(){e._notifyUnhandledRejection()},1)}},r.prototype._notifyUnhandledRejectionIsHandled=function(){W("rejectionHandled",i,void 0,this)},r.prototype._setReturnedNonUndefined=function(){this._bitField=268435456|this._bitField},r.prototype._returnedNonUndefined=function(){return 0!=(268435456&this._bitField)},r.prototype._notifyUnhandledRejection=function(){if(this._isRejectionUnhandled()){var e=this._settledValue();this._setUnhandledRejectionIsNotified(),W("unhandledRejection",s,e,this)}},r.prototype._setUnhandledRejectionIsNotified=function(){this._bitField=262144|this._bitField},r.prototype._unsetUnhandledRejectionIsNotified=function(){this._bitField=-262145&this._bitField},r.prototype._isUnhandledRejectionNotified=function(){return(262144&this._bitField)>0},r.prototype._setRejectionIsUnhandled=function(){this._bitField=1048576|this._bitField},r.prototype._unsetRejectionIsUnhandled=function(){this._bitField=-1048577&this._bitField,this._isUnhandledRejectionNotified()&&(this._unsetUnhandledRejectionIsNotified(),this._notifyUnhandledRejectionIsHandled())},r.prototype._isRejectionUnhandled=function(){return(1048576&this._bitField)>0},r.prototype._warn=function(e,t,r){return $(e,t,r||this)},r.onPossiblyUnhandledRejection=function(e){var t=a();s="function"==typeof e?null===t?e:c.domainBind(t,e):void 0},r.onUnhandledRejectionHandled=function(e){var t=a();i="function"==typeof e?null===t?e:c.domainBind(t,e):void 0};var E=function(){};r.longStackTraces=function(){if(u.haveItemsQueued()&&!Q.longStackTraces)throw new Error("cannot enable long stack traces after promises have been created\n\n See http://goo.gl/MqrFmX\n");if(!Q.longStackTraces&&K()){var e=r.prototype._captureStackTrace,t=r.prototype._attachExtraTrace,i=r.prototype._dereferenceTrace;Q.longStackTraces=!0,E=function(){if(u.haveItemsQueued()&&!Q.longStackTraces)throw new Error("cannot enable long stack traces after promises have been created\n\n See http://goo.gl/MqrFmX\n");r.prototype._captureStackTrace=e,r.prototype._attachExtraTrace=t,r.prototype._dereferenceTrace=i,n.deactivateLongStackTraces(),u.enableTrampoline(),Q.longStackTraces=!1},r.prototype._captureStackTrace=F,r.prototype._attachExtraTrace=j,r.prototype._dereferenceTrace=U,n.activateLongStackTraces(),u.disableTrampolineIfNecessary()}},r.hasLongStackTraces=function(){return Q.longStackTraces&&K()};var T=function(){try{if("function"==typeof CustomEvent){var e=new CustomEvent("CustomEvent");return c.global.dispatchEvent(e),function(e,t){var r={detail:t,cancelable:!0};h.defineProperty(r,"promise",{value:t.promise}),h.defineProperty(r,"reason",{value:t.reason});var n=new CustomEvent(e.toLowerCase(),r);return!c.global.dispatchEvent(n)}}if("function"==typeof Event){e=new Event("CustomEvent");return c.global.dispatchEvent(e),function(e,t){var r=new Event(e.toLowerCase(),{cancelable:!0});return r.detail=t,h.defineProperty(r,"promise",{value:t.promise}),h.defineProperty(r,"reason",{value:t.reason}),!c.global.dispatchEvent(r)}}return(e=document.createEvent("CustomEvent")).initCustomEvent("testingtheevent",!1,!0,{}),c.global.dispatchEvent(e),function(e,t){var r=document.createEvent("CustomEvent");return r.initCustomEvent(e.toLowerCase(),!1,!0,t),!c.global.dispatchEvent(r)}}catch(e){}return function(){return!1}}(),A=c.isNode?function(){return e.emit.apply(e,arguments)}:c.global?function(e){var t="on"+e.toLowerCase(),r=c.global[t];return!!r&&(r.apply(c.global,[].slice.call(arguments,1)),!0)}:function(){return!1};function S(e,t){return{promise:t}}var k={promiseCreated:S,promiseFulfilled:S,promiseRejected:S,promiseResolved:S,promiseCancelled:S,promiseChained:function(e,t,r){return{promise:t,child:r}},warning:function(e,t){return{warning:t}},unhandledRejection:function(e,t,r){return{reason:t,promise:r}},rejectionHandled:S},C=function(e){var t=!1;try{t=A.apply(null,arguments)}catch(e){u.throwLater(e),t=!0}var r=!1;try{r=T(e,k[e].apply(null,arguments))}catch(e){u.throwLater(e),r=!0}return r||t};function I(){return!1}function R(e,t,r){var n=this;try{e(t,r,function(e){if("function"!=typeof e)throw new TypeError("onCancel must be a function, got: "+c.toString(e));n._attachCancellationCallback(e)})}catch(e){return e}}function O(e){if(!this._isCancellable())return this;var t=this._onCancel();void 0!==t?c.isArray(t)?t.push(e):this._setOnCancel([t,e]):this._setOnCancel(e)}function L(){return this._onCancelField}function P(e){this._onCancelField=e}function M(){this._cancellationParent=void 0,this._onCancelField=void 0}function B(e,t){if(0!=(1&t)){this._cancellationParent=e;var r=e._branchesRemainingToCancel;void 0===r&&(r=0),e._branchesRemainingToCancel=r+1}0!=(2&t)&&e._isBound()&&this._setBoundTo(e._boundTo)}r.config=function(e){if("longStackTraces"in(e=Object(e))&&(e.longStackTraces?r.longStackTraces():!e.longStackTraces&&r.hasLongStackTraces()&&E()),"warnings"in e){var t=e.warnings;Q.warnings=!!t,w=Q.warnings,c.isObject(t)&&"wForgottenReturn"in t&&(w=!!t.wForgottenReturn)}if("cancellation"in e&&e.cancellation&&!Q.cancellation){if(u.haveItemsQueued())throw new Error("cannot enable cancellation after promises are in use");r.prototype._clearCancellationData=M,r.prototype._propagateFrom=B,r.prototype._onCancel=L,r.prototype._setOnCancel=P,r.prototype._attachCancellationCallback=O,r.prototype._execute=R,N=B,Q.cancellation=!0}return"monitoring"in e&&(e.monitoring&&!Q.monitoring?(Q.monitoring=!0,r.prototype._fireEvent=C):!e.monitoring&&Q.monitoring&&(Q.monitoring=!1,r.prototype._fireEvent=I)),r},r.prototype._fireEvent=I,r.prototype._execute=function(e,t,r){try{e(t,r)}catch(e){return e}},r.prototype._onCancel=function(){},r.prototype._setOnCancel=function(e){},r.prototype._attachCancellationCallback=function(e){},r.prototype._captureStackTrace=function(){},r.prototype._attachExtraTrace=function(){},r.prototype._dereferenceTrace=function(){},r.prototype._clearCancellationData=function(){},r.prototype._propagateFrom=function(e,t){};var N=function(e,t){0!=(2&t)&&e._isBound()&&this._setBoundTo(e._boundTo)};function D(){var e=this._boundTo;return void 0!==e&&e instanceof r?e.isFulfilled()?e.value():void 0:e}function F(){this._trace=new Z(this._peekContext())}function j(e,t){if(p(e)){var r=this._trace;if(void 0!==r&&t&&(r=r._parent),void 0!==r)r.attachExtraTrace(e);else if(!e.__stackCleaned__){var n=G(e);c.notEnumerableProp(e,"stack",n.message+"\n"+n.stack.join("\n")),c.notEnumerableProp(e,"__stackCleaned__",!0)}}}function U(){this._trace=void 0}function $(e,t,n){if(Q.warnings){var i,s=new l(e);if(t)n._attachExtraTrace(s);else if(Q.longStackTraces&&(i=r._peekContext()))i.attachExtraTrace(s);else{var o=G(s);s.stack=o.message+"\n"+o.stack.join("\n")}C("warning",s)||z(s,"",!0)}}function V(e){for(var t=[],r=0;r0?function(e){for(var t=e.stack.replace(/\s+$/g,"").split("\n"),r=0;r0&&"SyntaxError"!=e.name&&(t=t.slice(r)),t}(e):[" (No stack trace)"],{message:r,stack:"SyntaxError"==e.name?t:V(t)}}function z(e,t,r){if("undefined"!=typeof console){var n;if(c.isObject(e)){var i=e.stack;n=t+v(i,e)}else n=t+String(e);"function"==typeof o?o(n,r):"function"!=typeof console.log&&"object"!=typeof console.log||console.log(n)}}function W(e,t,r,n){var i=!1;try{"function"==typeof t&&(i=!0,"rejectionHandled"===e?t(n):t(r,n))}catch(e){u.throwLater(e)}"unhandledRejection"===e?C(e,r,n)||i||z(r,"Unhandled rejection "):C(e,n)}function H(e){var t;if("function"==typeof e)t="[function "+(e.name||"anonymous")+"]";else{t=e&&"function"==typeof e.toString?e.toString():c.toString(e);if(/\[object [a-zA-Z0-9$_]+\]/.test(t))try{t=JSON.stringify(e)}catch(e){}0===t.length&&(t="(empty array)")}return"(<"+function(e){if(e.length<41)return e;return e.substr(0,38)+"..."}(t)+">, no stack trace)"}function K(){return"function"==typeof J}var q=function(){return!1},X=/[\/<\(]([^:\/]+):(\d+):(?:\d+)\)?\s*$/;function Y(e){var t=e.match(X);if(t)return{fileName:t[1],line:parseInt(t[2],10)}}function Z(e){this._parent=e,this._promisesCreated=0;var t=this._length=1+(void 0===e?0:e._length);J(this,Z),t>32&&this.uncycle()}c.inherits(Z,Error),n.CapturedTrace=Z,Z.prototype.uncycle=function(){var e=this._length;if(!(e<2)){for(var t=[],r={},n=0,i=this;void 0!==i;++n)t.push(i),i=i._parent;for(n=(e=this._length=n)-1;n>=0;--n){var s=t[n].stack;void 0===r[s]&&(r[s]=n)}for(n=0;n0&&(t[o-1]._parent=void 0,t[o-1]._length=1),t[n]._parent=void 0,t[n]._length=1;var a=n>0?t[n-1]:this;o=0;--l)t[l]._length=u,u++;return}}}},Z.prototype.attachExtraTrace=function(e){if(!e.__stackCleaned__){this.uncycle();for(var t=G(e),r=t.message,n=[t.stack],i=this;void 0!==i;)n.push(V(i.stack.split("\n"))),i=i._parent;!function(e){for(var t=e[0],r=1;r=0;--a)if(n[a]===s){o=a;break}for(a=o;a>=0;--a){var u=n[a];if(t[i]!==u)break;t.pop(),i--}t=n}}(n),function(e){for(var t=0;t=0)return g=/@/,v=t,y=!0,function(e){e.stack=(new Error).stack};try{throw new Error}catch(e){n="stack"in e}return"stack"in i||!n||"number"!=typeof Error.stackTraceLimit?(v=function(e,t){return"string"==typeof e?e:"object"!=typeof t&&"function"!=typeof t||void 0===t.name||void 0===t.message?H(t):t.toString()},null):(g=e,v=t,function(e){Error.stackTraceLimit+=6;try{throw new Error}catch(t){e.stack=t.stack}Error.stackTraceLimit-=6})}();"undefined"!=typeof console&&void 0!==console.warn&&(o=function(e){console.warn(e)},c.isNode&&e.stderr.isTTY?o=function(e,t){var r=t?"":"";console.warn(r+e+"\n")}:c.isNode||"string"!=typeof(new Error).stack||(o=function(e,t){console.warn("%c"+e,t?"color: darkorange":"color: red")}));var Q={warnings:b,longStackTraces:!1,cancellation:!1,monitoring:!1};return x&&r.longStackTraces(),{longStackTraces:function(){return Q.longStackTraces},warnings:function(){return Q.warnings},cancellation:function(){return Q.cancellation},monitoring:function(){return Q.monitoring},propagateFromFunction:function(){return N},boundValueFunction:function(){return D},checkForgottenReturns:function(e,t,r,n,i){if(void 0===e&&null!==t&&w){if(void 0!==i&&i._returnedNonUndefined())return;if(0==(65535&n._bitField))return;r&&(r+=" ");var s="",o="";if(t._trace){for(var a=t._trace.stack.split("\n"),u=V(a),l=u.length-1;l>=0;--l){var c=u[l];if(!d.test(c)){var h=c.match(m);h&&(s="at "+h[1]+":"+h[2]+":"+h[3]+" ");break}}if(u.length>0){var p=u[0];for(l=0;l0&&(o="\n"+a[l-1]);break}}}var f="a promise was created in a "+r+"handler "+s+"but was not returned from it, see http://goo.gl/rRqMUw"+o;n._warn(f,!0,t)}},setBounds:function(e,t){if(K()){for(var r,n,i=e.stack.split("\n"),s=t.stack.split("\n"),o=-1,a=-1,u=0;u=a||(q=function(e){if(f.test(e))return!0;var t=Y(e);return!!(t&&t.fileName===r&&o<=t.line&&t.line<=a)})}},warn:$,deprecated:function(e,t){var r=e+" is deprecated and will be removed in a future version.";return t&&(r+=" Use "+t+" instead."),$(r)},CapturedTrace:Z,fireDomEvent:T,fireGlobalEvent:A}}},{"./errors":12,"./es5":13,"./util":36}],10:[function(e,t,r){"use strict";t.exports=function(e){function t(){return this.value}function r(){throw this.reason}e.prototype.return=e.prototype.thenReturn=function(r){return r instanceof e&&r.suppressUnhandledRejections(),this._then(t,void 0,void 0,{value:r},void 0)},e.prototype.throw=e.prototype.thenThrow=function(e){return this._then(r,void 0,void 0,{reason:e},void 0)},e.prototype.catchThrow=function(e){if(arguments.length<=1)return this._then(void 0,r,void 0,{reason:e},void 0);var t=arguments[1];return this.caught(e,function(){throw t})},e.prototype.catchReturn=function(r){if(arguments.length<=1)return r instanceof e&&r.suppressUnhandledRejections(),this._then(void 0,t,void 0,{value:r},void 0);var n=arguments[1];n instanceof e&&n.suppressUnhandledRejections();return this.caught(r,function(){return n})}}},{}],11:[function(e,t,r){"use strict";t.exports=function(e,t){var r=e.reduce,n=e.all;function i(){return n(this)}e.prototype.each=function(e){return r(this,e,t,0)._then(i,void 0,void 0,this,void 0)},e.prototype.mapSeries=function(e){return r(this,e,t,t)},e.each=function(e,n){return r(e,n,t,0)._then(i,void 0,void 0,e,void 0)},e.mapSeries=function(e,n){return r(e,n,t,t)}}},{}],12:[function(e,t,r){"use strict";var n,i,s=e("./es5"),o=s.freeze,a=e("./util"),u=a.inherits,l=a.notEnumerableProp;function c(e,t){function r(n){if(!(this instanceof r))return new r(n);l(this,"message","string"==typeof n?n:t),l(this,"name",e),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):Error.call(this)}return u(r,Error),r}var h=c("Warning","warning"),p=c("CancellationError","cancellation error"),f=c("TimeoutError","timeout error"),d=c("AggregateError","aggregate error");try{n=TypeError,i=RangeError}catch(e){n=c("TypeError","type error"),i=c("RangeError","range error")}for(var m="join pop push shift unshift slice filter forEach some every map indexOf lastIndexOf reduce reduceRight sort reverse".split(" "),g=0;g1?e.cancelPromise._reject(t):e.cancelPromise._cancel(),e.cancelPromise=null,!0)}function h(){return f.call(this,this.promise._target()._settledValue())}function p(e){if(!c(this,e))return o.e=e,o}function f(e){var i=this.promise,a=this.handler;if(!this.called){this.called=!0;var u=this.isFinallyHandler()?a.call(i._boundValue()):a.call(i._boundValue(),e);if(u===n)return u;if(void 0!==u){i._setReturnedNonUndefined();var f=r(u,i);if(f instanceof t){if(null!=this.cancelPromise){if(f._isCancelled()){var d=new s("late cancellation observer");return i._attachExtraTrace(d),o.e=d,o}f.isPending()&&f._attachCancellationCallback(new l(this))}return f._then(h,p,void 0,this,void 0)}}}return i.isRejected()?(c(this),o.e=e,o):(c(this),e)}return u.prototype.isFinallyHandler=function(){return 0===this.type},l.prototype._resultCancelled=function(){c(this.finallyHandler)},t.prototype._passThrough=function(e,t,r,n){return"function"!=typeof e?this.then():this._then(r,n,void 0,new u(this,t,e),void 0)},t.prototype.lastly=t.prototype.finally=function(e){return this._passThrough(e,0,f,f)},t.prototype.tap=function(e){return this._passThrough(e,1,f)},t.prototype.tapCatch=function(e){var r=arguments.length;if(1===r)return this._passThrough(e,1,void 0,f);var n,s=new Array(r-1),o=0;for(n=0;n0&&"function"==typeof arguments[t]&&(e=arguments[t]);var n=[].slice.call(arguments);e&&n.pop();var i=new r(n).promise();return void 0!==e?i.spread(e):i}}},{"./util":36}],18:[function(e,t,r){"use strict";t.exports=function(t,r,n,i,s,o){var a=t._getDomain,u=e("./util"),l=u.tryCatch,c=u.errorObj,h=t._async;function p(e,t,r,n){this.constructor$(e),this._promise._captureStackTrace();var i=a();this._callback=null===i?t:u.domainBind(i,t),this._preservedValues=n===s?new Array(this.length()):null,this._limit=r,this._inFlight=0,this._queue=[],h.invoke(this._asyncInit,this,void 0)}function f(e,r,i,s){if("function"!=typeof r)return n("expecting a function but got "+u.classString(r));var o=0;if(void 0!==i){if("object"!=typeof i||null===i)return t.reject(new TypeError("options argument must be an object but it is "+u.classString(i)));if("number"!=typeof i.concurrency)return t.reject(new TypeError("'concurrency' must be a number but it is "+u.classString(i.concurrency)));o=i.concurrency}return new p(e,r,o="number"==typeof o&&isFinite(o)&&o>=1?o:0,s).promise()}u.inherits(p,r),p.prototype._asyncInit=function(){this._init$(void 0,-2)},p.prototype._init=function(){},p.prototype._promiseFulfilled=function(e,r){var n=this._values,s=this.length(),a=this._preservedValues,u=this._limit;if(r<0){if(n[r=-1*r-1]=e,u>=1&&(this._inFlight--,this._drainQueue(),this._isResolved()))return!0}else{if(u>=1&&this._inFlight>=u)return n[r]=e,this._queue.push(r),!1;null!==a&&(a[r]=e);var h=this._promise,p=this._callback,f=h._boundValue();h._pushContext();var d=l(p).call(f,e,r,s),m=h._popContext();if(o.checkForgottenReturns(d,m,null!==a?"Promise.filter":"Promise.map",h),d===c)return this._reject(d.e),!0;var g=i(d,this._promise);if(g instanceof t){var v=(g=g._target())._bitField;if(0==(50397184&v))return u>=1&&this._inFlight++,n[r]=g,g._proxy(this,-1*(r+1)),!1;if(0==(33554432&v))return 0!=(16777216&v)?(this._reject(g._reason()),!0):(this._cancel(),!0);d=g._value()}n[r]=d}return++this._totalResolved>=s&&(null!==a?this._filter(n,a):this._resolve(n),!0)},p.prototype._drainQueue=function(){for(var e=this._queue,t=this._limit,r=this._values;e.length>0&&this._inFlight1){s.deprecated("calling Promise.try with more than 1 argument");var l=arguments[1],c=arguments[2];n=o.isArray(l)?a(e).apply(c,l):a(e).call(c,l)}else n=a(e)();var h=u._popContext();return s.checkForgottenReturns(n,h,"Promise.try",u),u._resolveFromSyncValue(n),u},t.prototype._resolveFromSyncValue=function(e){e===o.errorObj?this._rejectCallback(e.e,!1):this._resolveCallback(e,!0)}}},{"./util":36}],20:[function(e,t,r){"use strict";var n=e("./util"),i=n.maybeWrapAsError,s=e("./errors").OperationalError,o=e("./es5");var a=/^(?:name|message|stack|cause)$/;function u(e){var t;if(function(e){return e instanceof Error&&o.getPrototypeOf(e)===Error.prototype}(e)){(t=new s(e)).name=e.name,t.message=e.message,t.stack=e.stack;for(var r=o.keys(e),i=0;i1){var r,n=new Array(t-1),i=0;for(r=0;r0&&"function"!=typeof e&&"function"!=typeof t){var r=".then() only accepts functions but was passed: "+l.classString(e);arguments.length>1&&(r+=", "+l.classString(t)),this._warn(r)}return this._then(e,t,void 0,void 0,void 0)},I.prototype.done=function(e,t){this._then(e,t,void 0,void 0,void 0)._setIsFinal()},I.prototype.spread=function(e){return"function"!=typeof e?s("expecting a function but got "+l.classString(e)):this.all()._then(e,void 0,void 0,v,void 0)},I.prototype.toJSON=function(){var e={isFulfilled:!1,isRejected:!1,fulfillmentValue:void 0,rejectionReason:void 0};return this.isFulfilled()?(e.fulfillmentValue=this.value(),e.isFulfilled=!0):this.isRejected()&&(e.rejectionReason=this.reason(),e.isRejected=!0),e},I.prototype.all=function(){return arguments.length>0&&this._warn(".all() was passed arguments but it does not take any"),new b(this).promise()},I.prototype.error=function(e){return this.caught(l.originatesFromRejection,e)},I.getNewLibraryCopy=r.exports,I.is=function(e){return e instanceof I},I.fromNode=I.fromCallback=function(e){var t=new I(g);t._captureStackTrace();var r=arguments.length>1&&!!Object(arguments[1]).multiArgs,n=C(e)(S(t,r));return n===k&&t._rejectCallback(n.e,!0),t._isFateSealed()||t._setAsyncGuaranteed(),t},I.all=function(e){return new b(e).promise()},I.cast=function(e){var t=_(e);return t instanceof I||((t=new I(g))._captureStackTrace(),t._setFulfilled(),t._rejectionHandler0=e),t},I.resolve=I.fulfilled=I.cast,I.reject=I.rejected=function(e){var t=new I(g);return t._captureStackTrace(),t._rejectCallback(e,!0),t},I.setScheduler=function(e){if("function"!=typeof e)throw new d("expecting a function but got "+l.classString(e));return p.setScheduler(e)},I.prototype._then=function(e,t,r,n,i){var s=void 0!==i,o=s?i:new I(g),u=this._target(),c=u._bitField;s||(o._propagateFrom(this,3),o._captureStackTrace(),void 0===n&&0!=(2097152&this._bitField)&&(n=0!=(50397184&c)?this._boundValue():u===this?void 0:this._boundTo),this._fireEvent("promiseChained",this,o));var h=a();if(0!=(50397184&c)){var f,d,v=u._settlePromiseCtx;0!=(33554432&c)?(d=u._rejectionHandler0,f=e):0!=(16777216&c)?(d=u._fulfillmentHandler0,f=t,u._unsetRejectionIsUnhandled()):(v=u._settlePromiseLateCancellationObserver,d=new m("late cancellation observer"),u._attachExtraTrace(d),f=t),p.invoke(v,u,{handler:null===h?f:"function"==typeof f&&l.domainBind(h,f),promise:o,receiver:n,value:d})}else u._addCallbacks(e,t,o,n,h);return o},I.prototype._length=function(){return 65535&this._bitField},I.prototype._isFateSealed=function(){return 0!=(117506048&this._bitField)},I.prototype._isFollowing=function(){return 67108864==(67108864&this._bitField)},I.prototype._setLength=function(e){this._bitField=-65536&this._bitField|65535&e},I.prototype._setFulfilled=function(){this._bitField=33554432|this._bitField,this._fireEvent("promiseFulfilled",this)},I.prototype._setRejected=function(){this._bitField=16777216|this._bitField,this._fireEvent("promiseRejected",this)},I.prototype._setFollowing=function(){this._bitField=67108864|this._bitField,this._fireEvent("promiseResolved",this)},I.prototype._setIsFinal=function(){this._bitField=4194304|this._bitField},I.prototype._isFinal=function(){return(4194304&this._bitField)>0},I.prototype._unsetCancelled=function(){this._bitField=-65537&this._bitField},I.prototype._setCancelled=function(){this._bitField=65536|this._bitField,this._fireEvent("promiseCancelled",this)},I.prototype._setWillBeCancelled=function(){this._bitField=8388608|this._bitField},I.prototype._setAsyncGuaranteed=function(){p.hasCustomScheduler()||(this._bitField=134217728|this._bitField)},I.prototype._receiverAt=function(e){var t=0===e?this._receiver0:this[4*e-4+3];if(t!==u)return void 0===t&&this._isBound()?this._boundValue():t},I.prototype._promiseAt=function(e){return this[4*e-4+2]},I.prototype._fulfillmentHandlerAt=function(e){return this[4*e-4+0]},I.prototype._rejectionHandlerAt=function(e){return this[4*e-4+1]},I.prototype._boundValue=function(){},I.prototype._migrateCallback0=function(e){e._bitField;var t=e._fulfillmentHandler0,r=e._rejectionHandler0,n=e._promise0,i=e._receiverAt(0);void 0===i&&(i=u),this._addCallbacks(t,r,n,i,null)},I.prototype._migrateCallbackAt=function(e,t){var r=e._fulfillmentHandlerAt(t),n=e._rejectionHandlerAt(t),i=e._promiseAt(t),s=e._receiverAt(t);void 0===s&&(s=u),this._addCallbacks(r,n,i,s,null)},I.prototype._addCallbacks=function(e,t,r,n,i){var s=this._length();if(s>=65531&&(s=0,this._setLength(0)),0===s)this._promise0=r,this._receiver0=n,"function"==typeof e&&(this._fulfillmentHandler0=null===i?e:l.domainBind(i,e)),"function"==typeof t&&(this._rejectionHandler0=null===i?t:l.domainBind(i,t));else{var o=4*s-4;this[o+2]=r,this[o+3]=n,"function"==typeof e&&(this[o+0]=null===i?e:l.domainBind(i,e)),"function"==typeof t&&(this[o+1]=null===i?t:l.domainBind(i,t))}return this._setLength(s+1),s},I.prototype._proxy=function(e,t){this._addCallbacks(void 0,void 0,t,e,null)},I.prototype._resolveCallback=function(e,t){if(0==(117506048&this._bitField)){if(e===this)return this._rejectCallback(n(),!1);var r=_(e,this);if(!(r instanceof I))return this._fulfill(e);t&&this._propagateFrom(r,2);var i=r._target();if(i!==this){var s=i._bitField;if(0==(50397184&s)){var o=this._length();o>0&&i._migrateCallback0(this);for(var a=1;a>>16)){if(e===this){var r=n();return this._attachExtraTrace(r),this._reject(r)}this._setFulfilled(),this._rejectionHandler0=e,(65535&t)>0&&(0!=(134217728&t)?this._settlePromises():p.settlePromises(this),this._dereferenceTrace())}},I.prototype._reject=function(e){var t=this._bitField;if(!((117506048&t)>>>16)){if(this._setRejected(),this._fulfillmentHandler0=e,this._isFinal())return p.fatalError(e,l.isNode);(65535&t)>0?p.settlePromises(this):this._ensurePossibleRejectionHandled()}},I.prototype._fulfillPromises=function(e,t){for(var r=1;r0){if(0!=(16842752&e)){var r=this._fulfillmentHandler0;this._settlePromise0(this._rejectionHandler0,r,e),this._rejectPromises(t,r)}else{var n=this._rejectionHandler0;this._settlePromise0(this._fulfillmentHandler0,n,e),this._fulfillPromises(t,n)}this._setLength(0)}this._clearCancellationData()},I.prototype._settledValue=function(){var e=this._bitField;return 0!=(33554432&e)?this._rejectionHandler0:0!=(16777216&e)?this._fulfillmentHandler0:void 0},I.defer=I.pending=function(){return E.deprecated("Promise.defer","new Promise"),{promise:new I(g),resolve:R,reject:O}},l.notEnumerableProp(I,"_makeSelfResolutionError",n),t("./method")(I,g,_,s,E),t("./bind")(I,g,_,E),t("./cancel")(I,b,s,E),t("./direct_resolve")(I),t("./synchronous_inspection")(I),t("./join")(I,b,_,g,p,a),I.Promise=I,I.version="3.5.3",t("./map.js")(I,b,s,_,g,E),t("./call_get.js")(I),t("./using.js")(I,s,_,w,g,E),t("./timers.js")(I,g,E),t("./generators.js")(I,s,g,_,o,E),t("./nodeify.js")(I),t("./promisify.js")(I,g),t("./props.js")(I,b,_,s),t("./race.js")(I,g,_,s),t("./reduce.js")(I,b,s,_,g,E),t("./settle.js")(I,b,E),t("./some.js")(I,b,s),t("./filter.js")(I,g),t("./each.js")(I,g),t("./any.js")(I),l.toFastProperties(I),l.toFastProperties(I.prototype),L({a:1}),L({b:2}),L({c:3}),L(1),L(function(){}),L(void 0),L(!1),L(new I(g)),E.setBounds(h.firstLineError,l.lastLineError),I}},{"./any.js":1,"./async":2,"./bind":3,"./call_get.js":5,"./cancel":6,"./catch_filter":7,"./context":8,"./debuggability":9,"./direct_resolve":10,"./each.js":11,"./errors":12,"./es5":13,"./filter.js":14,"./finally":15,"./generators.js":16,"./join":17,"./map.js":18,"./method":19,"./nodeback":20,"./nodeify.js":21,"./promise_array":23,"./promisify.js":24,"./props.js":25,"./race.js":27,"./reduce.js":28,"./settle.js":30,"./some.js":31,"./synchronous_inspection":32,"./thenables":33,"./timers.js":34,"./using.js":35,"./util":36}],23:[function(e,t,r){"use strict";t.exports=function(t,r,n,i,s){var o=e("./util");o.isArray;function a(e){var n=this._promise=new t(r);e instanceof t&&n._propagateFrom(e,3),n._setOnCancel(this),this._values=e,this._length=0,this._totalResolved=0,this._init(void 0,-2)}return o.inherits(a,s),a.prototype.length=function(){return this._length},a.prototype.promise=function(){return this._promise},a.prototype._init=function e(r,s){var a=n(this._values,this._promise);if(a instanceof t){var u=(a=a._target())._bitField;if(this._values=a,0==(50397184&u))return this._promise._setAsyncGuaranteed(),a._then(e,this._reject,void 0,this,s);if(0==(33554432&u))return 0!=(16777216&u)?this._reject(a._reason()):this._cancel();a=a._value()}if(null!==(a=o.asArray(a)))0!==a.length?this._iterate(a):-5===s?this._resolveEmptyArray():this._resolve(function(e){switch(e){case-2:return[];case-3:return{};case-6:return new Map}}(s));else{var l=i("expecting an array or an iterable object but got "+o.classString(a)).reason();this._promise._rejectCallback(l,!1)}},a.prototype._iterate=function(e){var r=this.getActualLength(e.length);this._length=r,this._values=this.shouldCopyValues()?new Array(r):this._values;for(var i=this._promise,s=!1,o=null,a=0;a=this._length&&(this._resolve(this._values),!0)},a.prototype._promiseCancelled=function(){return this._cancel(),!0},a.prototype._promiseRejected=function(e){return this._totalResolved++,this._reject(e),!0},a.prototype._resultCancelled=function(){if(!this._isResolved()){var e=this._values;if(this._cancel(),e instanceof t)e.cancel();else for(var r=0;r=this._length){var r;if(this._isMap)r=function(e){for(var t=new s,r=e.length/2|0,n=0;n>1},t.prototype.props=function(){return h(this)},t.props=function(e){return h(e)}}},{"./es5":13,"./util":36}],26:[function(e,t,r){"use strict";function n(e){this._capacity=e,this._length=0,this._front=0}n.prototype._willBeOverCapacity=function(e){return this._capacity=this._length&&(this._resolve(this._values),!0)},s.prototype._promiseFulfilled=function(e,t){var r=new i;return r._bitField=33554432,r._settledValueField=e,this._promiseResolved(t,r)},s.prototype._promiseRejected=function(e,t){var r=new i;return r._bitField=16777216,r._settledValueField=e,this._promiseResolved(t,r)},t.settle=function(e){return n.deprecated(".settle()",".reflect()"),new s(e).promise()},t.prototype.settle=function(){return t.settle(this)}}},{"./util":36}],31:[function(e,t,r){"use strict";t.exports=function(t,r,n){var i=e("./util"),s=e("./errors").RangeError,o=e("./errors").AggregateError,a=i.isArray,u={};function l(e){this.constructor$(e),this._howMany=0,this._unwrap=!1,this._initialized=!1}function c(e,t){if((0|t)!==t||t<0)return n("expecting a positive integer\n\n See http://goo.gl/MqrFmX\n");var r=new l(e),i=r.promise();return r.setHowMany(t),r.init(),i}i.inherits(l,r),l.prototype._init=function(){if(this._initialized)if(0!==this._howMany){this._init$(void 0,-5);var e=a(this._values);!this._isResolved()&&e&&this._howMany>this._canPossiblyFulfill()&&this._reject(this._getRangeError(this.length()))}else this._resolve([])},l.prototype.init=function(){this._initialized=!0,this._init()},l.prototype.setUnwrap=function(){this._unwrap=!0},l.prototype.howMany=function(){return this._howMany},l.prototype.setHowMany=function(e){this._howMany=e},l.prototype._promiseFulfilled=function(e){return this._addFulfilled(e),this._fulfilled()===this.howMany()&&(this._values.length=this.howMany(),1===this.howMany()&&this._unwrap?this._resolve(this._values[0]):this._resolve(this._values),!0)},l.prototype._promiseRejected=function(e){return this._addRejected(e),this._checkOutcome()},l.prototype._promiseCancelled=function(){return this._values instanceof t||null==this._values?this._cancel():(this._addRejected(u),this._checkOutcome())},l.prototype._checkOutcome=function(){if(this.howMany()>this._canPossiblyFulfill()){for(var e=new o,t=this.length();t0?this._reject(e):this._cancel(),!0}return!1},l.prototype._fulfilled=function(){return this._totalResolved},l.prototype._rejected=function(){return this._values.length-this.length()},l.prototype._addRejected=function(e){this._values.push(e)},l.prototype._addFulfilled=function(e){this._values[this._totalResolved++]=e},l.prototype._canPossiblyFulfill=function(){return this.length()-this._rejected()},l.prototype._getRangeError=function(e){var t="Input array must contain at least "+this._howMany+" items but contains only "+e+" items";return new s(t)},l.prototype._resolveEmptyArray=function(){this._reject(this._getRangeError(0))},t.some=function(e,t){return c(e,t)},t.prototype.some=function(e){return c(this,e)},t._SomePromiseArray=l}},{"./errors":12,"./util":36}],32:[function(e,t,r){"use strict";t.exports=function(e){function t(e){void 0!==e?(e=e._target(),this._bitField=e._bitField,this._settledValueField=e._isFateSealed()?e._settledValue():void 0):(this._bitField=0,this._settledValueField=void 0)}t.prototype._settledValue=function(){return this._settledValueField};var r=t.prototype.value=function(){if(!this.isFulfilled())throw new TypeError("cannot get fulfillment value of a non-fulfilled promise\n\n See http://goo.gl/MqrFmX\n");return this._settledValue()},n=t.prototype.error=t.prototype.reason=function(){if(!this.isRejected())throw new TypeError("cannot get rejection reason of a non-rejected promise\n\n See http://goo.gl/MqrFmX\n");return this._settledValue()},i=t.prototype.isFulfilled=function(){return 0!=(33554432&this._bitField)},s=t.prototype.isRejected=function(){return 0!=(16777216&this._bitField)},o=t.prototype.isPending=function(){return 0==(50397184&this._bitField)},a=t.prototype.isResolved=function(){return 0!=(50331648&this._bitField)};t.prototype.isCancelled=function(){return 0!=(8454144&this._bitField)},e.prototype.__isCancelled=function(){return 65536==(65536&this._bitField)},e.prototype._isCancelled=function(){return this._target().__isCancelled()},e.prototype.isCancelled=function(){return 0!=(8454144&this._target()._bitField)},e.prototype.isPending=function(){return o.call(this._target())},e.prototype.isRejected=function(){return s.call(this._target())},e.prototype.isFulfilled=function(){return i.call(this._target())},e.prototype.isResolved=function(){return a.call(this._target())},e.prototype.value=function(){return r.call(this._target())},e.prototype.reason=function(){var e=this._target();return e._unsetRejectionIsUnhandled(),n.call(e)},e.prototype._value=function(){return this._settledValue()},e.prototype._reason=function(){return this._unsetRejectionIsUnhandled(),this._settledValue()},e.PromiseInspection=t}},{}],33:[function(e,t,r){"use strict";t.exports=function(t,r){var n=e("./util"),i=n.errorObj,s=n.isObject;var o={}.hasOwnProperty;return function(e,a){if(s(e)){if(e instanceof t)return e;var u=function(e){try{return function(e){return e.then}(e)}catch(e){return i.e=e,i}}(e);if(u===i){a&&a._pushContext();var l=t.reject(u.e);return a&&a._popContext(),l}if("function"==typeof u)return function(e){try{return o.call(e,"_promise0")}catch(e){return!1}}(e)?(l=new t(r),e._then(l._fulfill,l._reject,void 0,l,null),l):function(e,s,o){var a=new t(r),u=a;o&&o._pushContext(),a._captureStackTrace(),o&&o._popContext();var l=!0,c=n.tryCatch(s).call(e,function(e){a&&(a._resolveCallback(e),a=null)},function(e){a&&(a._rejectCallback(e,l,!0),a=null)});return l=!1,a&&c===i&&(a._rejectCallback(c.e,!0,!0),a=null),u}(e,u,a)}return e}}},{"./util":36}],34:[function(e,t,r){"use strict";t.exports=function(t,r,n){var i=e("./util"),s=t.TimeoutError;function o(e){this.handle=e}o.prototype._resultCancelled=function(){clearTimeout(this.handle)};var a=function(e){return u(+this).thenReturn(e)},u=t.delay=function(e,i){var s,u;return void 0!==i?(s=t.resolve(i)._then(a,null,null,e,void 0),n.cancellation()&&i instanceof t&&s._setOnCancel(i)):(s=new t(r),u=setTimeout(function(){s._fulfill()},+e),n.cancellation()&&s._setOnCancel(new o(u)),s._captureStackTrace()),s._setAsyncGuaranteed(),s};t.prototype.delay=function(e){return u(e,this)};function l(e){return clearTimeout(this.handle),e}function c(e){throw clearTimeout(this.handle),e}t.prototype.timeout=function(e,t){var r,a;e=+e;var u=new o(setTimeout(function(){r.isPending()&&function(e,t,r){var n;n="string"!=typeof t?t instanceof Error?t:new s("operation timed out"):new s(t),i.markAsOriginatingFromRejection(n),e._attachExtraTrace(n),e._reject(n),null!=r&&r.cancel()}(r,t,a)},e));return n.cancellation()?(a=this.then(),(r=a._then(l,c,void 0,u,void 0))._setOnCancel(u)):r=this._then(l,c,void 0,u,void 0),r}}},{"./util":36}],35:[function(e,t,r){"use strict";t.exports=function(t,r,n,i,s,o){var a=e("./util"),u=e("./errors").TypeError,l=e("./util").inherits,c=a.errorObj,h=a.tryCatch,p={};function f(e){setTimeout(function(){throw e},0)}function d(e,r){var i=0,o=e.length,a=new t(s);return function s(){if(i>=o)return a._fulfill();var u=function(e){var t=n(e);return t!==e&&"function"==typeof e._isDisposable&&"function"==typeof e._getDisposer&&e._isDisposable()&&t._setDisposable(e._getDisposer()),t}(e[i++]);if(u instanceof t&&u._isDisposable()){try{u=n(u._getDisposer().tryDispose(r),e.promise)}catch(e){return f(e)}if(u instanceof t)return u._then(s,f,null,null,null)}s()}(),a}function m(e,t,r){this._data=e,this._promise=t,this._context=r}function g(e,t,r){this.constructor$(e,t,r)}function v(e){return m.isDisposer(e)?(this.resources[this.index]._setDisposable(e),e.promise()):e}function y(e){this.length=e,this.promise=null,this[e-1]=null}m.prototype.data=function(){return this._data},m.prototype.promise=function(){return this._promise},m.prototype.resource=function(){return this.promise().isFulfilled()?this.promise().value():p},m.prototype.tryDispose=function(e){var t=this.resource(),r=this._context;void 0!==r&&r._pushContext();var n=t!==p?this.doDispose(t,e):null;return void 0!==r&&r._popContext(),this._promise._unsetDisposable(),this._data=null,n},m.isDisposer=function(e){return null!=e&&"function"==typeof e.resource&&"function"==typeof e.tryDispose},l(g,m),g.prototype.doDispose=function(e,t){return this.data().call(e,e,t)},y.prototype._resultCancelled=function(){for(var e=this.length,r=0;r0},t.prototype._getDisposer=function(){return this._disposer},t.prototype._unsetDisposable=function(){this._bitField=-131073&this._bitField,this._disposer=void 0},t.prototype.disposer=function(e){if("function"==typeof e)return new g(e,this,i());throw new u}}},{"./errors":12,"./util":36}],36:[function(t,r,i){"use strict";var s=t("./es5"),o="undefined"==typeof navigator,a={e:{}},u,l="undefined"!=typeof self?self:"undefined"!=typeof window?window:void 0!==n?n:void 0!==this?this:null;function c(){try{var e=u;return u=null,e.apply(this,arguments)}catch(e){return a.e=e,a}}function h(e){return u=e,c}var p=function(e,t){var r={}.hasOwnProperty;function n(){for(var n in this.constructor=e,this.constructor$=t,t.prototype)r.call(t.prototype,n)&&"$"!==n.charAt(n.length-1)&&(this[n+"$"]=t.prototype[n])}return n.prototype=t.prototype,e.prototype=new n,e.prototype};function f(e){return null==e||!0===e||!1===e||"string"==typeof e||"number"==typeof e}function d(e){return"function"==typeof e||"object"==typeof e&&null!==e}function m(e){return f(e)?new Error(k(e)):e}function g(e,t){var r,n=e.length,i=new Array(n+1);for(r=0;r1,n=t.length>0&&!(1===t.length&&"constructor"===t[0]),i=x.test(e+"")&&s.names(e).length>0;if(r||n||i)return!0}return!1}catch(e){return!1}}function E(e){function t(){}t.prototype=e;var r=new t;function n(){return typeof r.foo}return n(),n(),e}var T=/^[a-z$_][a-z$_0-9]*$/i;function A(e){return T.test(e)}function S(e,t,r){for(var n=new Array(e),i=0;i10||G[0]>0),V.isNode&&V.toFastProperties(e);try{throw new Error}catch(e){V.lastLineError=e}r.exports=V},{"./es5":13}]},{},[4])(4)}),"undefined"!=typeof window&&null!==window?window.P=window.Promise:"undefined"!=typeof self&&null!==self&&(self.P=self.Promise)}).call(this,e("_process"),"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{},e("timers").setImmediate)},{_process:452,timers:529}],34:[function(e,t,r){var n=e("concat-map"),i=e("balanced-match");t.exports=function(e){if(!e)return[];"{}"===e.substr(0,2)&&(e="\\{\\}"+e.substr(2));return function e(t,r){var s=[];var o=i("{","}",t);if(!o||/\$$/.test(o.pre))return[t];var u=/^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(o.body);var l=/^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(o.body);var h=u||l;var g=o.body.indexOf(",")>=0;if(!h&&!g)return o.post.match(/,.*\}/)?(t=o.pre+"{"+o.body+a+o.post,e(t)):[t];var v;if(h)v=o.body.split(/\.\./);else if(1===(v=function e(t){if(!t)return[""];var r=[];var n=i("{","}",t);if(!n)return t.split(",");var s=n.pre;var o=n.body;var a=n.post;var u=s.split(",");u[u.length-1]+="{"+o+"}";var l=e(a);a.length&&(u[u.length-1]+=l.shift(),u.push.apply(u,l));r.push.apply(r,u);return r}(o.body)).length&&1===(v=e(v[0],!1).map(p)).length){var y=o.post.length?e(o.post,!1):[""];return y.map(function(e){return o.pre+v[0]+e})}var _=o.pre;var y=o.post.length?e(o.post,!1):[""];var b;if(h){var x=c(v[0]),w=c(v[1]),E=Math.max(v[0].length,v[1].length),T=3==v.length?Math.abs(c(v[2])):1,A=d,S=w0){var O=new Array(R+1).join("0");I=C<0?"-"+O+I.slice(1):O+I}}b.push(I)}}else b=n(v,function(t){return e(t,!1)});for(var L=0;L=t}},{"balanced-match":26,"concat-map":38}],35:[function(e,t,r){},{}],36:[function(e,t,r){t.exports={100:"Continue",101:"Switching Protocols",102:"Processing",200:"OK",201:"Created",202:"Accepted",203:"Non-Authoritative Information",204:"No Content",205:"Reset Content",206:"Partial Content",207:"Multi-Status",208:"Already Reported",226:"IM Used",300:"Multiple Choices",301:"Moved Permanently",302:"Found",303:"See Other",304:"Not Modified",305:"Use Proxy",307:"Temporary Redirect",308:"Permanent Redirect",400:"Bad Request",401:"Unauthorized",402:"Payment Required",403:"Forbidden",404:"Not Found",405:"Method Not Allowed",406:"Not Acceptable",407:"Proxy Authentication Required",408:"Request Timeout",409:"Conflict",410:"Gone",411:"Length Required",412:"Precondition Failed",413:"Payload Too Large",414:"URI Too Long",415:"Unsupported Media Type",416:"Range Not Satisfiable",417:"Expectation Failed",418:"I'm a teapot",421:"Misdirected Request",422:"Unprocessable Entity",423:"Locked",424:"Failed Dependency",425:"Unordered Collection",426:"Upgrade Required",428:"Precondition Required",429:"Too Many Requests",431:"Request Header Fields Too Large",451:"Unavailable For Legal Reasons",500:"Internal Server Error",501:"Not Implemented",502:"Bad Gateway",503:"Service Unavailable",504:"Gateway Timeout",505:"HTTP Version Not Supported",506:"Variant Also Negotiates",507:"Insufficient Storage",508:"Loop Detected",509:"Bandwidth Limit Exceeded",510:"Not Extended",511:"Network Authentication Required"}},{}],37:[function(e,t,r){var n,i;n=this,i=function(){"use strict";function e(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function t(t){for(var r=1;r0&&e<1/0},h=Array.prototype.slice;var p=/^image\/.+$/;function f(e){return p.test(e)}var d=String.fromCharCode;var m=l.btoa;function g(e){var t,r=new DataView(e);try{var n,i,s;if(255===r.getUint8(0)&&216===r.getUint8(1))for(var o=r.byteLength,a=2;a+1=8&&(s=u+c)}}}if(s){var h,p,f=r.getUint16(s,n);for(p=0;p1&&void 0!==arguments[1]?arguments[1]:1e11;return v.test(e)?Math.round(e*t)/t:e}function _(e){var t=e.aspectRatio,r=e.height,n=e.width,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"none",s=c(n),o=c(r);if(s&&o){var a=r*t;("contain"===i||"none"===i)&&a>n||"cover"===i&&a1||!w?(o.url=function(e,t){for(var r,n=[],i=new Uint8Array(e);i.length>0;)n.push(d.apply(null,(r=i.subarray(0,8192),Array.from?Array.from(r):h.call(r)))),i=i.subarray(8192);return"data:".concat(t,";base64,").concat(m(n.join("")))}(n,s),u>1&&i(o,function(e){var t=0,r=1,n=1;switch(e){case 2:r=-1;break;case 3:t=-180;break;case 4:n=-1;break;case 5:t=90,n=-1;break;case 6:t=90;break;case 7:t=90,r=-1;break;case 8:t=-90}return{rotate:t,scaleX:r,scaleY:n}}(u))):o.url=w.createObjectURL(t)}else o.url=n;e.load(o)},o.onabort=function(){e.fail(new Error("Aborted to read the image with FileReader."))},o.onerror=function(){e.fail(new Error("Failed to read the image with FileReader."))},o.onloadend=function(){e.reader=null},a?o.readAsArrayBuffer(t):o.readAsDataURL(t)}else this.fail(new Error("The current browser does not support image compression."));else this.fail(new Error("The first argument must be an image File or Blob object."))}else this.fail(new Error("The first argument must be a File or Blob object."))}},{key:"load",value:function(e){var r=this,n=this.file,i=this.image;i.onload=function(){r.draw(t(t({},e),{},{naturalWidth:i.naturalWidth,naturalHeight:i.naturalHeight}))},i.onabort=function(){r.fail(new Error("Aborted to load the image."))},i.onerror=function(){r.fail(new Error("Failed to load the image."))},l.navigator&&/(?:iPad|iPhone|iPod).*?AppleWebKit/i.test(l.navigator.userAgent)&&(i.crossOrigin="anonymous"),i.alt=n.name,i.src=e.url}},{key:"draw",value:function(e){var t=this,r=e.naturalWidth,n=e.naturalHeight,i=e.rotate,s=void 0===i?0:i,o=e.scaleX,u=void 0===o?1:o,l=e.scaleY,h=void 0===l?1:l,p=this.file,d=this.image,m=this.options,g=document.createElement("canvas"),v=g.getContext("2d"),b=Math.abs(s)%180==90,x=("contain"===m.resize||"cover"===m.resize)&&c(m.width)&&c(m.height),w=Math.max(m.maxWidth,0)||1/0,E=Math.max(m.maxHeight,0)||1/0,T=Math.max(m.minWidth,0)||0,A=Math.max(m.minHeight,0)||0,S=r/n,k=m.width,C=m.height;if(b){var I=[E,w];w=I[0],E=I[1];var R=[A,T];T=R[0],A=R[1];var O=[C,k];k=O[0],C=O[1]}x&&(S=k/C);var L=_({aspectRatio:S,width:w,height:E},"contain");w=L.width,E=L.height;var P=_({aspectRatio:S,width:T,height:A},"cover");if(T=P.width,A=P.height,x){var M=_({aspectRatio:S,width:k,height:C},m.resize);k=M.width,C=M.height}else{var B=_({aspectRatio:S,width:k,height:C}),N=B.width;k=void 0===N?r:N;var D=B.height;C=void 0===D?n:D}var F=-(k=Math.floor(y(Math.min(Math.max(k,T),w))))/2,j=-(C=Math.floor(y(Math.min(Math.max(C,A),E))))/2,U=k,$=C,V=[];if(x){var G,z,W,H,K=_({aspectRatio:S,width:r,height:n},{contain:"cover",cover:"contain"}[m.resize]);W=K.width,H=K.height,G=(r-W)/2,z=(n-H)/2,V.push(G,z,W,H)}if(V.push(F,j,U,$),b){var q=[C,k];k=q[0],C=q[1]}g.width=k,g.height=C,f(m.mimeType)||(m.mimeType=p.type);var X="transparent";if(p.size>m.convertSize&&m.convertTypes.indexOf(m.mimeType)>=0&&(m.mimeType="image/jpeg"),"image/jpeg"===m.mimeType&&(X="#fff"),v.fillStyle=X,v.fillRect(0,0,k,C),m.beforeDraw&&m.beforeDraw.call(this,v,g),!this.aborted&&(v.save(),v.translate(k/2,C/2),v.rotate(s*Math.PI/180),v.scale(u,h),v.drawImage.apply(v,[d].concat(V)),v.restore(),m.drew&&m.drew.call(this,v,g),!this.aborted)){var Y=function(e){t.aborted||t.done({naturalWidth:r,naturalHeight:n,result:e})};g.toBlob?g.toBlob(Y,m.mimeType,m.quality):Y(a(g.toDataURL(m.mimeType,m.quality)))}}},{key:"done",value:function(e){var t,r,n=e.naturalWidth,i=e.naturalHeight,s=e.result,o=this.file,a=this.image,u=this.options;if(w&&!u.checkOrientation&&w.revokeObjectURL(a.src),s)if(u.strict&&s.size>o.size&&u.mimeType===o.type&&!(u.width>n||u.height>i||u.minWidth>n||u.minHeight>i||u.maxWidth0?d(e):b(e)}(e,t);else if(t.objectMode||n&&n.length>0)if(t.ended&&!o){var u=new Error("stream.push() after EOF");e.emit("error",u)}else if(t.endEmitted&&o){u=new Error("stream.unshift() after end event");e.emit("error",u)}else!t.decoder||o||s||(n=t.decoder.write(n)),t.length+=t.objectMode?1:n.length,o?t.buffer.unshift(n):(t.reading=!1,t.buffer.push(n)),t.needReadable&&d(e),function(e,t){t.readingMore||(t.readingMore=!0,r.nextTick(function(){!function(e,t){var r=t.length;for(;!t.reading&&!t.flowing&&!t.ended&&t.lengtht.highWaterMark&&(t.highWaterMark=function(e){if(e>=p)e=p;else{e--;for(var t=1;t<32;t<<=1)e|=e>>t;e++}return e}(e)),e>t.length?t.ended?t.length:(t.needReadable=!0,0):e)}function d(e){var t=e._readableState;t.needReadable=!1,t.emittedReadable||(t.emittedReadable=!0,t.sync?r.nextTick(function(){m(e)}):m(e))}function m(e){e.emit("readable")}function g(e){var t,r=e._readableState;function n(e,n,i){!1===e.write(t)&&r.awaitDrain++}for(r.awaitDrain=0;r.pipesCount&&null!==(t=e.read());)if(1===r.pipesCount?n(r.pipes):x(r.pipes,n),e.emit("data",t),r.awaitDrain>0)return;if(0===r.pipesCount)return r.flowing=!1,void(s.listenerCount(e,"data")>0&&y(e));r.ranOut=!0}function v(){this._readableState.ranOut&&(this._readableState.ranOut=!1,g(this))}function y(e,t){if(e._readableState.flowing)throw new Error("Cannot switch to old mode now.");var n=t||!1,i=!1;e.readable=!0,e.pipe=a.prototype.pipe,e.on=e.addListener=a.prototype.on,e.on("readable",function(){var t;for(i=!0;!n&&null!==(t=e.read());)e.emit("data",t);null===t&&(i=!1,e._readableState.needReadable=!0)}),e.pause=function(){n=!0,this.emit("pause")},e.resume=function(){n=!1,i?r.nextTick(function(){e.emit("readable")}):this.read(0),this.emit("resume")},e.emit("readable")}function _(e,t){var r,n=t.buffer,s=t.length,o=!!t.decoder,a=!!t.objectMode;if(0===n.length)return null;if(0===s)r=null;else if(a)r=n.shift();else if(!e||e>=s)r=o?n.join(""):i.concat(n,s),n.length=0;else{if(e0)throw new Error("endReadable called on non-empty stream");!t.endEmitted&&t.calledRead&&(t.ended=!0,r.nextTick(function(){t.endEmitted||0!==t.length||(t.endEmitted=!0,e.readable=!1,e.emit("end"))}))}function x(e,t){for(var r=0,n=e.length;r0)&&(t.emittedReadable=!1),0===e&&t.needReadable&&(t.length>=t.highWaterMark||t.ended))return d(this),null;if(0===(e=f(e,t))&&t.ended)return r=null,t.length>0&&t.decoder&&(r=_(e,t),t.length-=r.length),0===t.length&&b(this),r;var i=t.needReadable;return t.length-e<=t.highWaterMark&&(i=!0),(t.ended||t.reading)&&(i=!1),i&&(t.reading=!0,t.sync=!0,0===t.length&&(t.needReadable=!0),this._read(t.highWaterMark),t.sync=!1),i&&!t.reading&&(e=f(n,t)),null===(r=e>0?_(e,t):null)&&(t.needReadable=!0,e=0),t.length-=e,0!==t.length||t.ended||(t.needReadable=!0),t.ended&&!t.endEmitted&&0===t.length&&b(this),r},c.prototype._read=function(e){this.emit("error",new Error("not implemented"))},c.prototype.pipe=function(e,t){var i=this,o=this._readableState;switch(o.pipesCount){case 0:o.pipes=e;break;case 1:o.pipes=[o.pipes,e];break;default:o.pipes.push(e)}o.pipesCount+=1;var a=(!t||!1!==t.end)&&e!==r.stdout&&e!==r.stderr?l:h;function u(e){e===i&&h()}function l(){e.end()}o.endEmitted?r.nextTick(a):i.once("end",a),e.on("unpipe",u);var c=function(e){return function(){var t=e._readableState;t.awaitDrain--,0===t.awaitDrain&&g(e)}}(i);function h(){e.removeListener("close",f),e.removeListener("finish",d),e.removeListener("drain",c),e.removeListener("error",p),e.removeListener("unpipe",u),i.removeListener("end",l),i.removeListener("end",h),e._writableState&&!e._writableState.needDrain||c()}function p(t){m(),e.removeListener("error",p),0===s.listenerCount(e,"error")&&e.emit("error",t)}function f(){e.removeListener("finish",d),m()}function d(){e.removeListener("close",f),m()}function m(){i.unpipe(e)}return e.on("drain",c),e._events&&e._events.error?n(e._events.error)?e._events.error.unshift(p):e._events.error=[p,e._events.error]:e.on("error",p),e.once("close",f),e.once("finish",d),e.emit("pipe",i),o.flowing||(this.on("readable",v),o.flowing=!0,r.nextTick(function(){g(i)})),e},c.prototype.unpipe=function(e){var t=this._readableState;if(0===t.pipesCount)return this;if(1===t.pipesCount)return e&&e!==t.pipes?this:(e||(e=t.pipes),t.pipes=null,t.pipesCount=0,this.removeListener("readable",v),t.flowing=!1,e&&e.emit("unpipe",this),this);if(!e){var r=t.pipes,n=t.pipesCount;t.pipes=null,t.pipesCount=0,this.removeListener("readable",v),t.flowing=!1;for(var i=0;i0)throw new Error("cwise: pre() block may not reference array args");if(i0)throw new Error("cwise: post() block may not reference array args")}else if("scalar"===s)t.scalarArgs.push(i),t.shimArgs.push("scalar"+i);else if("index"===s){if(t.indexArgs.push(i),i0)throw new Error("cwise: pre() block may not reference array index");if(i0)throw new Error("cwise: post() block may not reference array index")}else if("shape"===s){if(t.shapeArgs.push(i),ir.length)throw new Error("cwise: Too many arguments in pre() block");if(t.body.args.length>r.length)throw new Error("cwise: Too many arguments in body() block");if(t.post.args.length>r.length)throw new Error("cwise: Too many arguments in post() block");return t.debug=!!e.printCode||!!e.debug,t.funcName=e.funcName||"cwise",t.blockSize=e.blockSize||64,n(t)}},{"./lib/thunk.js":50}],49:[function(e,t,r){"use strict";var n=e("uniq");function i(e,t,r){var n,i,s=e.length,o=t.arrayArgs.length,a=t.indexArgs.length>0,u=[],l=[],c=0,h=0;for(n=0;n0&&u.push("var "+l.join(",")),n=s-1;n>=0;--n)c=e[n],u.push(["for(i",n,"=0;i",n,"0&&u.push(["index[",h,"]-=s",h].join("")),u.push(["++index[",c,"]"].join(""))),u.push("}")}return u.join("\n")}function s(e,t,r){for(var n=e.body,i=[],s=[],o=0;o0&&y.push("shape=SS.slice(0)"),e.indexArgs.length>0){var _=new Array(r);for(u=0;u0&&v.push("var "+y.join(",")),u=0;u3&&v.push(s(e.pre,e,a));var E=s(e.body,e,a),T=function(e){for(var t=0,r=e[0].length;t0,l=[],c=0;c0;){"].join("")),l.push(["if(j",c,"<",a,"){"].join("")),l.push(["s",t[c],"=j",c].join("")),l.push(["j",c,"=0"].join("")),l.push(["}else{s",t[c],"=",a].join("")),l.push(["j",c,"-=",a,"}"].join("")),u&&l.push(["index[",t[c],"]=j",c].join(""));for(c=0;c3&&v.push(s(e.post,e,a)),e.debug&&console.log("-----Generated cwise routine for ",t,":\n"+v.join("\n")+"\n----------");var A=[e.funcName||"unnamed","_cwise_loop_",o[0].join("s"),"m",T,function(e){for(var t=new Array(e.length),r=!0,n=0;n0&&(r=r&&t[n]===t[n-1])}return r?t[0]:t.join("")}(a)].join("");return new Function(["function ",A,"(",g.join(","),"){",v.join("\n"),"} return ",A].join(""))()}},{uniq:532}],50:[function(e,t,r){"use strict";var n=e("./compile.js");t.exports=function(e){var t=["'use strict'","var CACHED={}"],r=[],i=e.funcName+"_cwise_thunk";t.push(["return function ",i,"(",e.shimArgs.join(","),"){"].join(""));for(var s=[],o=[],a=[["array",e.arrayArgs[0],".shape.slice(",Math.max(0,e.arrayBlockIndices[0]),e.arrayBlockIndices[0]<0?","+e.arrayBlockIndices[0]+")":")"].join("")],u=[],l=[],c=0;c0&&(u.push("array"+e.arrayArgs[0]+".shape.length===array"+h+".shape.length+"+(Math.abs(e.arrayBlockIndices[0])-Math.abs(e.arrayBlockIndices[c]))),l.push("array"+e.arrayArgs[0]+".shape[shapeIndex+"+Math.max(0,e.arrayBlockIndices[0])+"]===array"+h+".shape[shapeIndex+"+Math.max(0,e.arrayBlockIndices[c])+"]"))}for(e.arrayArgs.length>1&&(t.push("if (!("+u.join(" && ")+")) throw new Error('cwise: Arrays do not all have the same dimensionality!')"),t.push("for(var shapeIndex=array"+e.arrayArgs[0]+".shape.length-"+Math.abs(e.arrayBlockIndices[0])+"; shapeIndex--\x3e0;) {"),t.push("if (!("+l.join(" && ")+")) throw new Error('cwise: Arrays do not all have the same shape!')"),t.push("}")),c=0;ch)&&(s[u]=h,f.push(u,h),i[u]=a));if(void 0!==r&&void 0===s[r]){var d=["Could not find a path from ",t," to ",r,"."].join("");throw new Error(d)}return i},extract_shortest_path_from_predecessor_list:function(e,t){for(var r=[],n=t;n;)r.push(n),e[n],n=e[n];return r.reverse(),r},find_path:function(e,t,r){var i=n.single_source_shortest_paths(e,t,r);return n.extract_shortest_path_from_predecessor_list(i,r)},PriorityQueue:{make:function(e){var t,r=n.PriorityQueue,i={};for(t in e=e||{},r)r.hasOwnProperty(t)&&(i[t]=r[t]);return i.queue=[],i.sorter=e.sorter||r.default_sorter,i},default_sorter:function(e,t){return e.cost-t.cost},push:function(e,t){var r={value:e,cost:t};this.queue.push(r),this.queue.sort(this.sorter)},pop:function(){return this.queue.shift()},empty:function(){return 0===this.queue.length}}};void 0!==t&&(t.exports=n)},{}],53:[function(e,t,r){(function(r){"use strict";const n=e("path"),i=e("path-type"),s=e=>e.length>1?`{${e.join(",")}}`:e[0],o=(e,t)=>{const r="!"===e[0]?e.slice(1):e;return n.isAbsolute(r)?r:n.join(t,r)},a=(e,t)=>{if(t.files&&!Array.isArray(t.files))throw new TypeError(`Expected \`files\` to be of type \`Array\` but received type \`${typeof t.files}\``);if(t.extensions&&!Array.isArray(t.extensions))throw new TypeError(`Expected \`extensions\` to be of type \`Array\` but received type \`${typeof t.extensions}\``);return t.files&&t.extensions?t.files.map(r=>n.posix.join(e,((e,t)=>n.extname(e)?`**/${e}`:`**/${e}.${s(t)}`)(r,t.extensions))):t.files?t.files.map(t=>n.posix.join(e,`**/${t}`)):t.extensions?[n.posix.join(e,`**/*.${s(t.extensions)}`)]:[n.posix.join(e,"**")]};t.exports=(async(e,t)=>{if("string"!=typeof(t={cwd:r.cwd(),...t}).cwd)throw new TypeError(`Expected \`cwd\` to be of type \`string\` but received type \`${typeof t.cwd}\``);const n=await Promise.all([].concat(e).map(async e=>{return await i.isDirectory(o(e,t.cwd))?a(e,t):e}));return[].concat.apply([],n)}),t.exports.sync=((e,t)=>{if("string"!=typeof(t={cwd:r.cwd(),...t}).cwd)throw new TypeError(`Expected \`cwd\` to be of type \`string\` but received type \`${typeof t.cwd}\``);const n=[].concat(e).map(e=>i.isDirectorySync(o(e,t.cwd))?a(e,t):e);return[].concat.apply([],n)})}).call(this,e("_process"))},{_process:452,path:397,"path-type":54}],54:[function(e,t,r){"use strict";const{promisify:n}=e("util"),i=e("fs");async function s(e,t,r){if("string"!=typeof r)throw new TypeError(`Expected a string, got ${typeof r}`);try{return(await n(i[e])(r))[t]()}catch(e){if("ENOENT"===e.code)return!1;throw e}}function o(e,t,r){if("string"!=typeof r)throw new TypeError(`Expected a string, got ${typeof r}`);try{return i[e](r)[t]()}catch(e){if("ENOENT"===e.code)return!1;throw e}}r.isFile=s.bind(null,"stat","isFile"),r.isDirectory=s.bind(null,"stat","isDirectory"),r.isSymlink=s.bind(null,"lstat","isSymbolicLink"),r.isFileSync=o.bind(null,"statSync","isFile"),r.isDirectorySync=o.bind(null,"statSync","isDirectory"),r.isSymlinkSync=o.bind(null,"lstatSync","isSymbolicLink")},{fs:290,util:538}],55:[function(e,t,r){"use strict";t.exports=function(e){for(var t=[],r=e.length,n=0;n=55296&&i<=56319&&r>n+1){var s=e.charCodeAt(n+1);s>=56320&&s<=57343&&(i=1024*(i-55296)+s-56320+65536,n+=1)}i<128?t.push(i):i<2048?(t.push(i>>6|192),t.push(63&i|128)):i<55296||i>=57344&&i<65536?(t.push(i>>12|224),t.push(i>>6&63|128),t.push(63&i|128)):i>=65536&&i<=1114111?(t.push(i>>18|240),t.push(i>>12&63|128),t.push(i>>6&63|128),t.push(63&i|128)):t.push(239,191,189)}return new Uint8Array(t).buffer}},{}],56:[function(e,t,r){var n=e("once"),i=function(){},s=function(e,t,r){if("function"==typeof t)return s(e,null,t);t||(t={}),r=n(r||i);var o=e._writableState,a=e._readableState,u=t.readable||!1!==t.readable&&e.readable,l=t.writable||!1!==t.writable&&e.writable,c=function(){e.writable||h()},h=function(){l=!1,u||r.call(e)},p=function(){u=!1,l||r.call(e)},f=function(t){r.call(e,t?new Error("exited with error code: "+t):null)},d=function(t){r.call(e,t)},m=function(){return(!u||a&&a.ended)&&(!l||o&&o.ended)?void 0:r.call(e,new Error("premature close"))},g=function(){e.req.on("finish",h)};return!function(e){return e.setHeader&&"function"==typeof e.abort}(e)?l&&!o&&(e.on("end",c),e.on("close",c)):(e.on("complete",h),e.on("abort",m),e.req?g():e.on("request",g)),function(e){return e.stdio&&Array.isArray(e.stdio)&&3===e.stdio.length}(e)&&e.on("exit",f),e.on("end",p),e.on("finish",h),!1!==t.error&&e.on("error",d),e.on("close",m),function(){e.removeListener("complete",h),e.removeListener("abort",m),e.removeListener("request",g),e.req&&e.req.removeListener("finish",h),e.removeListener("end",c),e.removeListener("close",c),e.removeListener("finish",h),e.removeListener("exit",f),e.removeListener("end",p),e.removeListener("error",d),e.removeListener("close",m)}};t.exports=s},{once:392}],57:[function(e,t,r){(function(r){"use strict";const n=e("fs"),i=e("execa"),s=e("p-finally"),o=e("pify"),a=e("rimraf"),u=e("tempfile"),l=o(n),c=o(a),h=Symbol("inputPath"),p=Symbol("outputPath");t.exports=(e=>{if(e=Object.assign({},e),!r.isBuffer(e.input))return Promise.reject(new Error("Input is required"));if("string"!=typeof e.bin)return Promise.reject(new Error("Binary is required"));if(!Array.isArray(e.args))return Promise.reject(new Error("Arguments are required"));const t=e.inputPath||u(),n=e.outputPath||u();e.args=e.args.map(e=>e===h?t:e===p?n:e);const o=l.writeFile(t,e.input).then(()=>i(e.bin,e.args)).then(()=>l.readFile(n));return s(o,()=>Promise.all([c(t),c(n)]))}),t.exports.input=h,t.exports.output=p}).call(this,{isBuffer:e("../is-buffer/index.js")})},{"../is-buffer/index.js":350,execa:66,fs:290,"p-finally":395,pify:71,rimraf:508,tempfile:527}],58:[function(e,t,r){"use strict";var n=e("child_process"),i=e("./lib/parse"),s=e("./lib/enoent"),o=n.spawnSync;function a(e,t,r){var o,a;return o=i(e,t,r),a=n.spawn(o.command,o.args,o.options),s.hookChildProcess(a,o),a}t.exports=a,t.exports.spawn=a,t.exports.sync=function(t,r,n){var a,u;if(!o)try{o=e("spawn-sync")}catch(e){throw new Error("In order to use spawnSync on node 0.10 or older, you must install spawn-sync:\n\n npm install spawn-sync --save")}return a=i(t,r,n),(u=o(a.command,a.args,a.options)).error=u.error||s.verifyENOENTSync(u.status,a),u},t.exports._parse=i,t.exports._enoent=s},{"./lib/enoent":59,"./lib/parse":60,child_process:290,"spawn-sync":517}],59:[function(e,t,r){(function(r){"use strict";var n="win32"===r.platform,i=e("./util/resolveCommand"),s=0===r.version.indexOf("v0.10.");function o(e,t){var r;return(r=new Error(t+" "+e+" ENOENT")).code=r.errno="ENOENT",r.syscall=t+" "+e,r}function a(e,t){return n&&1===e&&!t.file?o(t.original,"spawn"):null}t.exports.hookChildProcess=function(e,t){var r;n&&(r=e.emit,e.emit=function(n,i){var s;return"exit"===n&&(s=a(i,t))?r.call(e,"error",s):r.apply(e,arguments)})},t.exports.verifyENOENT=a,t.exports.verifyENOENTSync=function(e,t){return n&&1===e&&!t.file?o(t.original,"spawnSync"):s&&-1===e&&(t.file=n?t.file:i(t.original),!t.file)?o(t.original,"spawnSync"):null},t.exports.notFoundError=o}).call(this,e("_process"))},{"./util/resolveCommand":65,_process:452}],60:[function(e,t,r){(function(r){"use strict";var n=e("./util/resolveCommand"),i=e("./util/hasEmptyArgumentBug"),s=e("./util/escapeArgument"),o=e("./util/escapeCommand"),a=e("./util/readShebang"),u="win32"===r.platform,l=/\.(?:com|exe)$/i,c=parseInt(r.version.substr(1).split(".")[0],10)>=6||4===parseInt(r.version.substr(1).split(".")[0],10)&&parseInt(r.version.substr(1).split(".")[1],10)>=8;t.exports=function(e,t,h){var p;return t&&!Array.isArray(t)&&(h=t,t=null),p={command:e,args:t=t?t.slice(0):[],options:h=h||{},file:void 0,original:e},h.shell?function(e){var t;return c?e:(t=[e.command].concat(e.args).join(" "),u?(e.command="string"==typeof e.options.shell?e.options.shell:r.env.comspec||"cmd.exe",e.args=["/d","/s","/c",'"'+t+'"'],e.options.windowsVerbatimArguments=!0):("string"==typeof e.options.shell?e.command=e.options.shell:"android"===r.platform?e.command="/system/bin/sh":e.command="/bin/sh",e.args=["-c",t]),e)}(p):function(e){var t,c,h;return u?(e.file=n(e.command),e.file=e.file||n(e.command,!0),(t=e.file&&a(e.file))?(e.args.unshift(e.file),e.command=t,c=i||!l.test(n(t)||n(t,!0))):c=i||!l.test(e.file),c&&(h="echo"!==e.command,e.command=o(e.command),e.args=e.args.map(function(e){return s(e,h)}),e.args=["/d","/s","/c",'"'+e.command+(e.args.length?" "+e.args.join(" "):"")+'"'],e.command=r.env.comspec||"cmd.exe",e.options.windowsVerbatimArguments=!0),e):e}(p)}}).call(this,e("_process"))},{"./util/escapeArgument":61,"./util/escapeCommand":62,"./util/hasEmptyArgumentBug":63,"./util/readShebang":64,"./util/resolveCommand":65,_process:452}],61:[function(e,t,r){"use strict";t.exports=function(e,t){return e=""+e,e=t?'"'+(e=(e=e.replace(/(\\*)"/g,'$1$1\\"')).replace(/(\\*)$/,"$1$1"))+'"':e.replace(/([()%!^<>&|;,"'\s])/g,"^$1")}},{}],62:[function(e,t,r){"use strict";var n=e("./escapeArgument");t.exports=function(e){return/^[a-z0-9_-]+$/i.test(e)?e:n(e,!0)}},{"./escapeArgument":61}],63:[function(e,t,r){(function(e){"use strict";var r;t.exports="win32"===e.platform&&0===(r=e.version.substr(1).split(".").map(function(e){return parseInt(e,10)}))[0]&&r[1]<12}).call(this,e("_process"))},{_process:452}],64:[function(e,t,r){(function(r){"use strict";var n=e("fs"),i=e("lru-cache"),s=e("shebang-command"),o=new i({max:50,maxAge:3e4});t.exports=function(e){var t,i,a;if(o.has(e))return o.get(e);t=new r(150);try{i=n.openSync(e,"r"),n.readSync(i,t,0,150,0),n.closeSync(i)}catch(e){}return a=s(t.toString()),o.set(e,a),a}}).call(this,e("buffer").Buffer)},{buffer:291,fs:290,"lru-cache":366,"shebang-command":512}],65:[function(e,t,r){(function(r){"use strict";var n=e("path"),i=e("which"),s=new(e("lru-cache"))({max:50,maxAge:3e4});t.exports=function(e,t){var o;if(t=!!t,o=s.get(e+"!"+t),s.has(e))return s.get(e);try{o=t?i.sync(e,{pathExt:n.delimiter+(r.env.PATHEXT||"")}):i.sync(e)}catch(e){}return s.set(e+"!"+t,o),o}}).call(this,e("_process"))},{_process:452,"lru-cache":366,path:397,which:545}],66:[function(e,t,r){(function(r){"use strict";const n=e("child_process"),i=e("util"),s=e("cross-spawn"),o=e("strip-eof"),a=e("npm-run-path"),u=e("is-stream"),l=e("get-stream"),c=e("p-finally"),h=e("signal-exit"),p=e("./lib/errname"),f=e("./lib/stdio"),d=1e7;function m(e,t,n){let i;return n&&n.env&&!1!==n.extendEnv&&(n.env=Object.assign({},r.env,n.env)),n&&!0===n.__winShell?(delete n.__winShell,i={command:e,args:t,options:n,file:e,original:e}):i=s._parse(e,t,n),(n=Object.assign({maxBuffer:d,stripEof:!0,preferLocal:!0,localDir:i.options.cwd||r.cwd(),encoding:"utf8",reject:!0,cleanup:!0},i.options)).stdio=f(n),n.preferLocal&&(n.env=a.env(Object.assign({},n,{cwd:n.localDir}))),{cmd:i.command,args:i.args,opts:n,parsed:i}}function g(e,t){return t&&e.stripEof&&(t=o(t)),t}function v(e,t,n){let i="/bin/sh",s=["-c",t];return n=Object.assign({},n),"win32"===r.platform&&(n.__winShell=!0,i=r.env.comspec||"cmd.exe",s=["/s","/c",`"${t}"`],n.windowsVerbatimArguments=!0),n.shell&&(i=n.shell,delete n.shell),e(i,s,n)}function y(e,t,r,n){if(!e[t])return null;let i;return(i=r?l(e[t],{encoding:r,maxBuffer:n}):l.buffer(e[t],{maxBuffer:n})).catch(e=>{throw e.stream=t,e.message=`${t} ${e.message}`,e})}t.exports=((e,t,r)=>{let i=e;Array.isArray(t)&&t.length>0&&(i+=" "+t.join(" "));const o=m(e,t,r),a=o.opts.encoding,l=o.opts.maxBuffer;let f,d;try{f=n.spawn(o.cmd,o.args,o.opts)}catch(e){return Promise.reject(e)}o.opts.cleanup&&(d=h(()=>{f.kill()}));let v=null,_=!1;const b=()=>{v&&(clearTimeout(v),v=null)};o.opts.timeout>0&&(v=setTimeout(()=>{v=null,_=!0,f.kill(o.opts.killSignal)},o.opts.timeout));const x=new Promise(e=>{f.on("exit",(t,r)=>{b(),e({code:t,signal:r})}),f.on("error",t=>{b(),e({err:t})}),f.stdin&&f.stdin.on("error",t=>{b(),e({err:t})})});const w=c(Promise.all([x,y(f,"stdout",a,l),y(f,"stderr",a,l)]).then(e=>{const t=e[0],r=e[1],n=e[2];let s=t.err;const a=t.code,u=t.signal;if(d&&d(),s||0!==a||null!==u){if(!s){let e="";Array.isArray(o.opts.stdio)?("inherit"!==o.opts.stdio[2]&&(e+=e.length>0?n:`\n${n}`),"inherit"!==o.opts.stdio[1]&&(e+=`\n${r}`)):"inherit"!==o.opts.stdio&&(e=`\n${n}${r}`),(s=new Error(`Command failed: ${i}${e}`)).code=a<0?p(a):a}if(s.killed=s.killed||f.killed,s.stdout=r,s.stderr=n,s.failed=!0,s.signal=u||null,s.cmd=i,s.timedOut=_,!o.opts.reject)return s;throw s}return{stdout:g(o.opts,r),stderr:g(o.opts,n),code:0,failed:!1,killed:!1,signal:null,cmd:i,timedOut:!1}}),function(){f.stdout&&f.stdout.destroy(),f.stderr&&f.stderr.destroy()});return s._enoent.hookChildProcess(f,o.parsed),function(e,t){const r=t.input;null!==r&&void 0!==r&&(u(r)?r.pipe(e.stdin):e.stdin.end(r))}(f,o.opts),f.then=w.then.bind(w),f.catch=w.catch.bind(w),f}),t.exports.stdout=function(){return t.exports.apply(null,arguments).then(e=>e.stdout)},t.exports.stderr=function(){return t.exports.apply(null,arguments).then(e=>e.stderr)},t.exports.shell=((e,r)=>v(t.exports,e,r)),t.exports.sync=((e,t,r)=>{const i=m(e,t,r);if(u(i.opts.input))throw new TypeError("The `input` option cannot be a stream in sync mode");const s=n.spawnSync(i.cmd,i.args,i.opts);if(s.error||0!==s.status)throw s.error||new Error(""===s.stderr?s.stdout:s.stderr);return s.stdout=g(i.opts,s.stdout),s.stderr=g(i.opts,s.stderr),s}),t.exports.shellSync=((e,r)=>v(t.exports.sync,e,r)),t.exports.spawn=i.deprecate(t.exports,"execa.spawn() is deprecated. Use execa() instead.")}).call(this,e("_process"))},{"./lib/errname":67,"./lib/stdio":68,_process:452,child_process:290,"cross-spawn":58,"get-stream":70,"is-stream":355,"npm-run-path":390,"p-finally":395,"signal-exit":514,"strip-eof":524,util:538}],67:[function(e,t,r){(function(e){"use strict";let r;try{if("function"!=typeof(r=e.binding("uv")).errname)throw new TypeError("uv.errname is not a function")}catch(e){console.error("execa/lib/errname: unable to establish process.binding('uv')",e),r=null}function n(e,t){if(e)return e.errname(t);if(!(t<0))throw new Error("err >= 0");return`Unknown system error ${t}`}t.exports=(e=>n(r,e)),t.exports.__test__=n}).call(this,e("_process"))},{_process:452}],68:[function(e,t,r){"use strict";const n=["stdin","stdout","stderr"];t.exports=(e=>{if(!e)return null;if(e.stdio&&(e=>n.some(t=>Boolean(e[t])))(e))throw new Error(`It's not possible to provide \`stdio\` in combination with one of ${n.map(e=>`\`${e}\``).join(", ")}`);if("string"==typeof e.stdio)return e.stdio;const t=e.stdio||[];if(!Array.isArray(t))throw new TypeError(`Expected \`stdio\` to be of type \`string\` or \`Array\`, got \`${typeof t}\``);const r=[],i=Math.max(t.length,n.length);for(let s=0;s{const t=(e=Object.assign({},e)).array;let i=e.encoding;const s="buffer"===i;let o=!1;t?o=!(i||s):i=i||"utf8",s&&(i=null);let a=0;const u=[],l=new n({objectMode:o});return i&&l.setEncoding(i),l.on("data",e=>{u.push(e),o?a=u.length:a+=e.length}),l.getBufferedValue=(()=>t?u:s?r.concat(u,a):u.join("")),l.getBufferedLength=(()=>a),l})}).call(this,e("buffer").Buffer)},{buffer:291,stream:518}],70:[function(e,t,r){"use strict";const n=e("./buffer-stream");function i(e,t){if(!e)return Promise.reject(new Error("Expected a stream"));const r=(t=Object.assign({maxBuffer:1/0},t)).maxBuffer;let i,s;const o=new Promise((o,a)=>{const u=e=>{e&&(e.bufferedData=i.getBufferedValue()),a(e)};i=n(t),e.once("error",u),e.pipe(i),i.on("data",()=>{i.getBufferedLength()>r&&a(new Error("maxBuffer exceeded"))}),i.once("error",u),i.on("end",o),s=(()=>{e.unpipe&&e.unpipe(i)})});return o.then(s,s),o.then(()=>i.getBufferedValue())}t.exports=i,t.exports.buffer=((e,t)=>i(e,Object.assign({},t,{encoding:"buffer"}))),t.exports.array=((e,t)=>i(e,Object.assign({},t,{array:!0})))},{"./buffer-stream":69}],71:[function(e,t,r){"use strict";const n=(e,t)=>(function(){const r=t.promiseModule,n=new Array(arguments.length);for(let e=0;e{t.errorFirst?n.push(function(e,n){if(t.multiArgs){const t=new Array(arguments.length-1);for(let e=1;e{t=Object.assign({exclude:[/.+(Sync|Stream)$/],errorFirst:!0,promiseModule:Promise},t);const r=e=>{const r=t=>"string"==typeof t?e===t:t.test(e);return t.include?t.include.some(r):!t.exclude.some(r)};let i;i="function"==typeof e?function(){return t.excludeMain?e.apply(this,arguments):n(e,t).apply(this,arguments)}:Object.create(Object.getPrototypeOf(e));for(const s in e){const o=e[s];i[s]="function"==typeof o&&r(s)?n(o,t):o}return i})},{}],72:[function(e,t,r){var n,i;n=this,i=function(e){"use strict";var t="INUMBER",r="IOP1",n="IOP2",i="IOP3",s="IVAR",o="IVARNAME",a="IFUNCALL",u="IFUNDEF",l="IEXPR",c="IEXPREVAL",h="IMEMBER",p="IENDSTATEMENT",f="IARRAY";function d(e,t){this.type=e,this.value=void 0!==t&&null!==t?t:0}function m(e){return new d(r,e)}function g(e){return new d(n,e)}function v(e){return new d(i,e)}function y(e,d,m){var g,v,w,E,T,A,S=[];if(b(e))return x(e,m);for(var k=e.length,C=0;C0;)T.unshift(x(S.pop(),m));if(!(E=S.pop()).apply||!E.call)throw new Error(E+" is not a function");S.push(E.apply(void 0,T))}else if(R===u)S.push(function(){for(var e=S.pop(),t=[],r=I.value;r-- >0;)t.unshift(S.pop());var n=S.pop(),i=function(){for(var r=Object.assign({},m),n=0,i=t.length;n0;)T.unshift(S.pop());S.push(T)}}if(S.length>1)throw new Error("invalid Expression (parity)");return 0===S[0]?0:x(S[0],m)}function _(e,t,r){return b(e)?e:{type:c,value:function(r){return y(e.value,t,r)}}}function b(e){return e&&e.type===c}function x(e,t){return b(e)?e.value(t):e}function w(e,c){for(var d,m,g,v,y,_,b=[],x=0;x0;)y.unshift(b.pop());v=b.pop(),b.push(v+"("+y.join(", ")+")")}else if(A===u){for(m=b.pop(),_=T.value,y=[];_-- >0;)y.unshift(b.pop());d=b.pop(),c?b.push("("+d+" = function("+y.join(", ")+") { return "+m+" })"):b.push("("+d+"("+y.join(", ")+") = "+m+")")}else if(A===h)d=b.pop(),b.push(d+"."+T.value);else if(A===f){for(_=T.value,y=[];_-- >0;)y.unshift(b.pop());b.push("["+y.join(", ")+"]")}else if(A===l)b.push("("+w(T.value,c)+")");else if(A!==p)throw new Error("invalid Expression")}return b.length>1&&(b=c?[b.join(",")]:[b.join(";")]),String(b[0])}function E(e){return"string"==typeof e?JSON.stringify(e).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029"):e}function T(e,t){for(var r=0;r1)v=b.pop(),g=b.pop(),_=c[E.value],E=new d(t,_(g.value,v.value)),b.push(E);else if(T===i&&b.length>2)y=b.pop(),v=b.pop(),g=b.pop(),"?"===E.value?b.push(g.value?v.value:y.value):(_=p[E.value],E=new d(t,_(g.value,v.value,y.value)),b.push(E));else if(T===r&&b.length>0)g=b.pop(),_=u[E.value],E=new d(t,_(g.value)),b.push(E);else if(T===l){for(;b.length>0;)x.push(b.shift());x.push(new d(l,e(E.value,u,c,p,m)))}else if(T===h&&b.length>0)g=b.pop(),b.push(new d(t,g.value[E.value]));else{for(;b.length>0;)x.push(b.shift());x.push(E)}}for(;b.length>0;)x.push(b.shift());return x}(this.tokens,this.unaryOps,this.binaryOps,this.ternaryOps,e),this.parser)},S.prototype.substitute=function(e,t){return t instanceof S||(t=this.parser.parse(String(t))),new S(function e(t,o,a){for(var u=[],c=0;c=this.expression.length?this.newToken("TEOF","EOF"):this.isWhitespace()||this.isComment()?this.next():this.isRadixInteger()||this.isNumber()||this.isOperator()||this.isString()||this.isParen()||this.isBracket()||this.isComma()||this.isSemicolon()||this.isNamedOp()||this.isConst()||this.isName()?this.current:void this.parseError('Unknown character "'+this.expression.charAt(this.pos)+'"')},R.prototype.isString=function(){var e=!1,t=this.pos,r=this.expression.charAt(t);if("'"===r||'"'===r)for(var n=this.expression.indexOf(r,t+1);n>=0&&this.pos"9")))break}if(t>e){var n=this.expression.substring(e,t);if(n in this.consts)return this.current=this.newToken("TNUMBER",this.consts[n]),this.pos+=n.length,!0}return!1},R.prototype.isNamedOp=function(){for(var e=this.pos,t=e;t"9")))break}if(t>e){var n=this.expression.substring(e,t);if(this.isOperatorEnabled(n)&&(n in this.binaryOps||n in this.unaryOps||n in this.ternaryOps))return this.current=this.newToken(k,n),this.pos+=n.length,!0}return!1},R.prototype.isName=function(){for(var e=this.pos,t=e,r=!1;t"9"))break}else r=!0}if(r){var i=this.expression.substring(e,t);return this.current=this.newToken("TNAME",i),this.pos+=i.length,!0}return!1},R.prototype.isWhitespace=function(){for(var e=!1,t=this.expression.charAt(this.pos);!(" "!==t&&"\t"!==t&&"\n"!==t&&"\r"!==t||(e=!0,this.pos++,this.pos>=this.expression.length));)t=this.expression.charAt(this.pos);return e};var O=/^[0-9a-f]{4}$/i;function L(e,t,r){this.parser=e,this.tokens=t,this.current=null,this.nextToken=null,this.next(),this.savedCurrent=null,this.savedNextToken=null,this.allowMemberAccess=!1!==r.allowMemberAccess}R.prototype.unescape=function(e){var t=e.indexOf("\\");if(t<0)return e;for(var r=e.substring(0,t);t>=0;){var n=e.charAt(++t);switch(n){case"'":r+="'";break;case'"':r+='"';break;case"\\":r+="\\";break;case"/":r+="/";break;case"b":r+="\b";break;case"f":r+="\f";break;case"n":r+="\n";break;case"r":r+="\r";break;case"t":r+="\t";break;case"u":var i=e.substring(t+1,t+5);O.test(i)||this.parseError("Illegal escape sequence: \\u"+i),r+=String.fromCharCode(parseInt(i,16)),t+=4;break;default:throw this.parseError('Illegal escape sequence: "\\'+n+'"')}++t;var s=e.indexOf("\\",t);r+=e.substring(t,s<0?e.length:s),t=s}return r},R.prototype.isComment=function(){return"/"===this.expression.charAt(this.pos)&&"*"===this.expression.charAt(this.pos+1)&&(this.pos=this.expression.indexOf("*/",this.pos)+2,1===this.pos&&(this.pos=this.expression.length),!0)},R.prototype.isRadixInteger=function(){var e,t,r=this.pos;if(r>=this.expression.length-2||"0"!==this.expression.charAt(r))return!1;if(++r,"x"===this.expression.charAt(r))e=16,t=/^[0-9a-f]$/i,++r;else{if("b"!==this.expression.charAt(r))return!1;e=2,t=/^[01]$/i,++r}for(var n=!1,i=r;r="0"&&e<="9"||!s&&"."===e);)"."===e?s=!0:o=!0,r++,t=o;if(t&&(i=r),"e"===e||"E"===e){r++;for(var a=!0,u=!1;r="0"&&e<="9"))break;u=!0,a=!1}else a=!1;r++}u||(r=i)}return t?(this.current=this.newToken("TNUMBER",parseFloat(this.expression.substring(n,r))),this.pos=r):this.pos=i,t},R.prototype.isOperator=function(){var e=this.pos,t=this.expression.charAt(this.pos);if("+"===t||"-"===t||"*"===t||"/"===t||"%"===t||"^"===t||"?"===t||":"===t||"."===t)this.current=this.newToken(k,t);else if("∙"===t||"•"===t)this.current=this.newToken(k,"*");else if(">"===t)"="===this.expression.charAt(this.pos+1)?(this.current=this.newToken(k,">="),this.pos++):this.current=this.newToken(k,">");else if("<"===t)"="===this.expression.charAt(this.pos+1)?(this.current=this.newToken(k,"<="),this.pos++):this.current=this.newToken(k,"<");else if("|"===t){if("|"!==this.expression.charAt(this.pos+1))return!1;this.current=this.newToken(k,"||"),this.pos++}else if("="===t)"="===this.expression.charAt(this.pos+1)?(this.current=this.newToken(k,"=="),this.pos++):this.current=this.newToken(k,t);else{if("!"!==t)return!1;"="===this.expression.charAt(this.pos+1)?(this.current=this.newToken(k,"!="),this.pos++):this.current=this.newToken(k,t)}return this.pos++,!!this.isOperatorEnabled(this.current.value)||(this.pos=e,!1)},R.prototype.isOperatorEnabled=function(e){return this.parser.isOperatorEnabled(e)},R.prototype.getCoordinates=function(){var e,t=0,r=-1;do{t++,e=this.pos-r,r=this.expression.indexOf("\n",r+1)}while(r>=0&&r=",">","in"];L.prototype.parseComparison=function(e){for(this.parseAddSub(e);this.accept(k,P);){var t=this.current;this.parseAddSub(e),e.push(g(t.value))}};var M=["+","-","||"];L.prototype.parseAddSub=function(e){for(this.parseTerm(e);this.accept(k,M);){var t=this.current;this.parseTerm(e),e.push(g(t.value))}};var B=["*","/","%"];function N(e,t){return Number(e)+Number(t)}function D(e,t){return e-t}function F(e,t){return e*t}function j(e,t){return e/t}function U(e,t){return e%t}function $(e,t){return Array.isArray(e)&&Array.isArray(t)?e.concat(t):""+e+t}function V(e,t){return e===t}function G(e,t){return e!==t}function z(e,t){return e>t}function W(e,t){return e=t}function K(e,t){return e<=t}function q(e,t){return Boolean(e&&t)}function X(e,t){return Boolean(e||t)}function Y(e,t){return T(t,e)}function Z(e){return(Math.exp(e)-Math.exp(-e))/2}function J(e){return(Math.exp(e)+Math.exp(-e))/2}function Q(e){return e===1/0?1:e===-1/0?-1:(Math.exp(e)-Math.exp(-e))/(Math.exp(e)+Math.exp(-e))}function ee(e){return e===-1/0?e:Math.log(e+Math.sqrt(e*e+1))}function te(e){return Math.log(e+Math.sqrt(e*e-1))}function re(e){return Math.log((1+e)/(1-e))/2}function ne(e){return Math.log(e)*Math.LOG10E}function ie(e){return-e}function se(e){return!e}function oe(e){return e<0?Math.ceil(e):Math.floor(e)}function ae(e){return Math.random()*(e||1)}function ue(e){return he(e+1)}L.prototype.parseTerm=function(e){for(this.parseFactor(e);this.accept(k,B);){var t=this.current;this.parseFactor(e),e.push(g(t.value))}},L.prototype.parseFactor=function(e){var t=this.tokens.unaryOps;if(this.save(),this.accept(k,function(e){return e.value in t})){if("-"!==this.current.value&&"+"!==this.current.value){if(this.nextToken.type===C&&"("===this.nextToken.value)return this.restore(),void this.parseExponential(e);if("TSEMICOLON"===this.nextToken.type||"TCOMMA"===this.nextToken.type||"TEOF"===this.nextToken.type||this.nextToken.type===C&&")"===this.nextToken.value)return this.restore(),void this.parseAtom(e)}var r=this.current;this.parseFactor(e),e.push(m(r.value))}else this.parseExponential(e)},L.prototype.parseExponential=function(e){for(this.parsePostfixExpression(e);this.accept(k,"^");)this.parseFactor(e),e.push(g("^"))},L.prototype.parsePostfixExpression=function(e){for(this.parseFunctionCall(e);this.accept(k,"!");)e.push(m("!"))},L.prototype.parseFunctionCall=function(e){var t=this.tokens.unaryOps;if(this.accept(k,function(e){return e.value in t})){var r=this.current;this.parseAtom(e),e.push(m(r.value))}else for(this.parseMemberExpression(e);this.accept(C,"(");)if(this.accept(C,")"))e.push(new d(a,0));else{var n=this.parseArgumentList(e);e.push(new d(a,n))}},L.prototype.parseArgumentList=function(e){for(var t=0;!this.accept(C,")");)for(this.parseExpression(e),++t;this.accept("TCOMMA");)this.parseExpression(e),++t;return t},L.prototype.parseMemberExpression=function(e){for(this.parseAtom(e);this.accept(k,".")||this.accept("TBRACKET","[");){var t=this.current;if("."===t.value){if(!this.allowMemberAccess)throw new Error('unexpected ".", member access is not permitted');this.expect("TNAME"),e.push(new d(h,this.current.value))}else{if("["!==t.value)throw new Error("unexpected symbol: "+t.value);if(!this.tokens.isOperatorEnabled("["))throw new Error('unexpected "[]", arrays are disabled');this.parseExpression(e),this.expect("TBRACKET","]"),e.push(g("["))}}};var le=4.7421875,ce=[.9999999999999971,57.15623566586292,-59.59796035547549,14.136097974741746,-.4919138160976202,3399464998481189e-20,4652362892704858e-20,-9837447530487956e-20,.0001580887032249125,-.00021026444172410488,.00021743961811521265,-.0001643181065367639,8441822398385275e-20,-26190838401581408e-21,36899182659531625e-22];function he(e){var t,r;if(function(e){return isFinite(e)&&e===Math.round(e)}(e)){if(e<=0)return isFinite(e)?1/0:NaN;if(e>171)return 1/0;for(var n=e-2,i=e-1;n>1;)i*=n,n--;return 0===i&&(i=1),i}if(e<.5)return Math.PI/(Math.sin(Math.PI*e)*he(1-e));if(e>=171.35)return 1/0;if(e>85){var s=e*e,o=s*e,a=o*e,u=a*e;return Math.sqrt(2*Math.PI/e)*Math.pow(e/Math.E,e)*(1+1/(12*e)+1/(288*s)-139/(51840*o)-571/(2488320*a)+163879/(209018880*u)+5246819/(75246796800*u*e))}--e,r=ce[0];for(var l=1;l0?(n=i/t)*n:i}return t===1/0?1/0:t*Math.sqrt(e)}function de(e,t,r){return e?t:r}function me(e,t){return void 0===t||0==+t?Math.round(e):(e=+e,t=-+t,isNaN(e)||"number"!=typeof t||t%1!=0?NaN:(e=e.toString().split("e"),+((e=(e=Math.round(+(e[0]+"e"+(e[1]?+e[1]-t:-t)))).toString().split("e"))[0]+"e"+(e[1]?+e[1]+t:t))))}function ge(e,t,r){return r&&(r[e]=t),t}function ve(e,t){return e[0|t]}function ye(e){return 1===arguments.length&&Array.isArray(e)?Math.max.apply(Math,e):Math.max.apply(Math,arguments)}function _e(e){return 1===arguments.length&&Array.isArray(e)?Math.min.apply(Math,e):Math.min.apply(Math,arguments)}function be(e,t){if("function"!=typeof e)throw new Error("First argument to map is not a function");if(!Array.isArray(t))throw new Error("Second argument to map is not an array");return t.map(function(t,r){return e(t,r)})}function xe(e,t,r){if("function"!=typeof e)throw new Error("First argument to fold is not a function");if(!Array.isArray(r))throw new Error("Second argument to fold is not an array");return r.reduce(function(t,r,n){return e(t,r,n)},t)}function we(e,t){if("function"!=typeof e)throw new Error("First argument to filter is not a function");if(!Array.isArray(t))throw new Error("Second argument to filter is not an array");return t.filter(function(t,r){return e(t,r)})}function Ee(e,t){if(!Array.isArray(t)&&"string"!=typeof t)throw new Error("Second argument to indexOf is not a string or array");return t.indexOf(e)}function Te(e,t){if(!Array.isArray(t))throw new Error("Second argument to join is not an array");return t.join(e)}function Ae(e){return(e>0)-(e<0)||+e}var Se=1/3;function ke(e){return e<0?-Math.pow(-e,Se):Math.pow(e,Se)}function Ce(e){return Math.exp(e)-1}function Ie(e){return Math.log(1+e)}function Re(e){return Math.log(e)/Math.LN2}function Oe(e){this.options=e||{},this.unaryOps={sin:Math.sin,cos:Math.cos,tan:Math.tan,asin:Math.asin,acos:Math.acos,atan:Math.atan,sinh:Math.sinh||Z,cosh:Math.cosh||J,tanh:Math.tanh||Q,asinh:Math.asinh||ee,acosh:Math.acosh||te,atanh:Math.atanh||re,sqrt:Math.sqrt,cbrt:Math.cbrt||ke,log:Math.log,log2:Math.log2||Re,ln:Math.log,lg:Math.log10||ne,log10:Math.log10||ne,expm1:Math.expm1||Ce,log1p:Math.log1p||Ie,abs:Math.abs,ceil:Math.ceil,floor:Math.floor,round:Math.round,trunc:Math.trunc||oe,"-":ie,"+":Number,exp:Math.exp,not:se,length:pe,"!":ue,sign:Math.sign||Ae},this.binaryOps={"+":N,"-":D,"*":F,"/":j,"%":U,"^":Math.pow,"||":$,"==":V,"!=":G,">":z,"<":W,">=":H,"<=":K,and:q,or:X,in:Y,"=":ge,"[":ve},this.ternaryOps={"?":de},this.functions={random:ae,fac:ue,min:_e,max:ye,hypot:Math.hypot||fe,pyt:Math.hypot||fe,pow:Math.pow,atan2:Math.atan2,if:de,gamma:he,roundTo:me,map:be,fold:xe,filter:we,indexOf:Ee,join:Te},this.consts={E:Math.E,PI:Math.PI,true:!0,false:!1}}Oe.prototype.parse=function(e){var t=[],r=new L(this,new R(this,e),{allowMemberAccess:this.options.allowMemberAccess});return r.parseExpression(t),r.expect("TEOF","EOF"),new S(t,this)},Oe.prototype.evaluate=function(e,t){return this.parse(e).evaluate(t)};var Le=new Oe;Oe.parse=function(e){return Le.parse(e)},Oe.evaluate=function(e,t){return Le.parse(e).evaluate(t)};var Pe={"+":"add","-":"subtract","*":"multiply","/":"divide","%":"remainder","^":"power","!":"factorial","<":"comparison",">":"comparison","<=":"comparison",">=":"comparison","==":"comparison","!=":"comparison","||":"concatenate",and:"logical",or:"logical",not:"logical","?":"conditional",":":"conditional","=":"assignment","[":"array","()=":"fndef"};Oe.prototype.isOperatorEnabled=function(e){var t=function(e){return Pe.hasOwnProperty(e)?Pe[e]:e}(e),r=this.options.operators||{};return!(t in r&&!r[t])};var Me={Parser:Oe,Expression:S};e.Expression=S,e.Parser=Oe,e.default=Me,Object.defineProperty(e,"__esModule",{value:!0})},"object"==typeof r&&void 0!==t?i(r):"function"==typeof define&&define.amd?define(["exports"],i):i((n=n||self).exprEval={})},{}],73:[function(e,t,r){"use strict";var n=e("is-glob"),i=e("path").posix.dirname,s="win32"===e("os").platform(),o=/\\/g,a=/[\{\[].*[\/]*.*[\}\]]$/,u=/(^|[^\\])([\{\[]|\([^\)]+$)/,l=/\\([\*\?\|\[\]\(\)\{\}])/g;t.exports=function(e){s&&e.indexOf("/")<0&&(e=e.replace(o,"/")),a.test(e)&&(e+="/"),e+="a";do{e=i(e)}while(n(e)||u.test(e));return e.replace(l,"$1")}},{"is-glob":352,os:293,path:397}],74:[function(e,t,r){"use strict";const n=e("./managers/tasks"),i=e("./providers/async"),s=e("./providers/stream"),o=e("./providers/sync"),a=e("./settings"),u=e("./utils/index");function l(e,t){try{h(e)}catch(e){return Promise.reject(e)}const r=c(e,i.default,t);return Promise.all(r).then(u.array.flatten)}function c(e,t,r){const i=[].concat(e),s=new a.default(r),o=n.generate(i,s),u=new t(s);return o.map(u.read,u)}function h(e){if(![].concat(e).every(p))throw new TypeError("Patterns must be a string or an array of strings")}function p(e){return"string"==typeof e}!function(e){e.sync=function(e,t){h(e);const r=c(e,o.default,t);return u.array.flatten(r)},e.stream=function(e,t){h(e);const r=c(e,s.default,t);return u.stream.merge(r)},e.generateTasks=function(e,t){h(e);const r=[].concat(e),i=new a.default(t);return n.generate(r,i)}}(l||(l={})),t.exports=l},{"./managers/tasks":75,"./providers/async":76,"./providers/stream":81,"./providers/sync":82,"./settings":87,"./utils/index":91}],75:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});const n=e("../utils/index");function i(e,t,r){const n=a(e);if("."in n){return[l(".",e,t,r)]}return u(n,t,r)}function s(e){return n.pattern.getPositivePatterns(e)}function o(e,t){return n.pattern.getNegativePatterns(e).concat(t).map(n.pattern.convertToPositivePattern)}function a(e){return e.reduce((e,t)=>{const r=n.pattern.getBaseDirectory(t);return r in e?e[r].push(t):e[r]=[t],e},{})}function u(e,t,r){return Object.keys(e).map(n=>l(n,e[n],t,r))}function l(e,t,r,i){return{dynamic:i,positive:t,negative:r,base:e,patterns:[].concat(t,r.map(n.pattern.convertToNegativePattern))}}r.generate=function(e,t){const r=s(e),a=o(e,t.ignore),u=t.caseSensitiveMatch?r.filter(n.pattern.isStaticPattern):[],l=t.caseSensitiveMatch?r.filter(n.pattern.isDynamicPattern):r,c=i(u,a,!1),h=i(l,a,!0);return c.concat(h)},r.convertPatternsToTasks=i,r.getPositivePatterns=s,r.getNegativePatternsAsPositive=o,r.groupPatternsByBaseDirectory=a,r.convertPatternGroupsToTasks=u,r.convertPatternGroupToTask=l},{"../utils/index":91}],76:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});const n=e("../readers/stream"),i=e("./provider");r.default=class extends i.default{constructor(){super(...arguments),this._reader=new n.default(this._settings)}read(e){const t=this._getRootDirectory(e),r=this._getReaderOptions(e),n=[];return new Promise((i,s)=>{const o=this.api(t,e,r);o.once("error",s),o.on("data",e=>n.push(r.transform(e))),o.once("end",()=>i(n))})}api(e,t,r){return t.dynamic?this._reader.dynamic(e,r):this._reader.static(t.patterns,r)}}},{"../readers/stream":85,"./provider":80}],77:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});const n=e("../../utils/index");r.default=class{constructor(e,t){this._settings=e,this._micromatchOptions=t}getFilter(e,t,r){const n=this._getMaxPatternDepth(t),i=this._getNegativePatternsRe(r);return t=>this._filter(e,t,i,n)}_getMaxPatternDepth(e){return e.some(n.pattern.hasGlobStar)?1/0:n.pattern.getMaxNaivePatternsDepth(e)}_getNegativePatternsRe(e){const t=e.filter(n.pattern.isAffectDepthOfReadingPattern);return n.pattern.convertPatternsToRe(t,this._micromatchOptions)}_filter(e,t,r,n){const i=this._getEntryDepth(e,t.path);return!this._isSkippedByDeep(i)&&!this._isSkippedByMaxPatternDepth(i,n)&&!this._isSkippedSymbolicLink(t)&&!this._isSkippedDotDirectory(t)&&this._isSkippedByNegativePatterns(t,r)}_getEntryDepth(e,t){const r=e.split("/").length;return t.split("/").length-(""===e?0:r)}_isSkippedByDeep(e){return e>=this._settings.deep}_isSkippedByMaxPatternDepth(e,t){return!this._settings.baseNameMatch&&t!==1/0&&e>t}_isSkippedSymbolicLink(e){return!this._settings.followSymbolicLinks&&e.dirent.isSymbolicLink()}_isSkippedDotDirectory(e){return!this._settings.dot&&e.name.startsWith(".")}_isSkippedByNegativePatterns(e,t){return!n.pattern.matchAny(e.path,t)}}},{"../../utils/index":91}],78:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});const n=e("../../utils/index");r.default=class{constructor(e,t){this._settings=e,this._micromatchOptions=t,this.index=new Map}getFilter(e,t){const r=n.pattern.convertPatternsToRe(e,this._micromatchOptions),i=n.pattern.convertPatternsToRe(t,this._micromatchOptions);return e=>this._filter(e,r,i)}_filter(e,t,r){if(this._settings.unique){if(this._isDuplicateEntry(e))return!1;this._createIndexRecord(e)}if(this._onlyFileFilter(e)||this._onlyDirectoryFilter(e))return!1;if(this._isSkippedByAbsoluteNegativePatterns(e,r))return!1;const n=this._settings.baseNameMatch?e.name:e.path;return this._isMatchToPatterns(n,t)&&!this._isMatchToPatterns(e.path,r)}_isDuplicateEntry(e){return this.index.has(e.path)}_createIndexRecord(e){this.index.set(e.path,void 0)}_onlyFileFilter(e){return this._settings.onlyFiles&&!e.dirent.isFile()}_onlyDirectoryFilter(e){return this._settings.onlyDirectories&&!e.dirent.isDirectory()}_isSkippedByAbsoluteNegativePatterns(e,t){if(!this._settings.absolute)return!1;const r=n.path.makeAbsolute(this._settings.cwd,e.path);return this._isMatchToPatterns(r,t)}_isMatchToPatterns(e,t){return n.pattern.matchAny(e,t)}}},{"../../utils/index":91}],79:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});const n=e("../../utils/index");r.default=class{constructor(e){this._settings=e}getFilter(){return e=>this._isNonFatalError(e)}_isNonFatalError(e){return n.errno.isEnoentCodeError(e)||this._settings.suppressErrors}}},{"../../utils/index":91}],80:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});const n=e("path"),i=e("./filters/deep"),s=e("./filters/entry"),o=e("./filters/error"),a=e("./transformers/entry");r.default=class{constructor(e){this._settings=e,this.errorFilter=new o.default(this._settings),this.entryFilter=new s.default(this._settings,this._getMicromatchOptions()),this.deepFilter=new i.default(this._settings,this._getMicromatchOptions()),this.entryTransformer=new a.default(this._settings)}_getRootDirectory(e){return n.resolve(this._settings.cwd,e.base)}_getReaderOptions(e){const t="."===e.base?"":e.base;return{basePath:t,pathSegmentSeparator:"/",concurrency:this._settings.concurrency,deepFilter:this.deepFilter.getFilter(t,e.positive,e.negative),entryFilter:this.entryFilter.getFilter(e.positive,e.negative),errorFilter:this.errorFilter.getFilter(),followSymbolicLinks:this._settings.followSymbolicLinks,fs:this._settings.fs,stats:this._settings.stats,throwErrorOnBrokenSymbolicLink:this._settings.throwErrorOnBrokenSymbolicLink,transform:this.entryTransformer.getTransformer()}}_getMicromatchOptions(){return{dot:this._settings.dot,matchBase:this._settings.baseNameMatch,nobrace:!this._settings.braceExpansion,nocase:!this._settings.caseSensitiveMatch,noext:!this._settings.extglob,noglobstar:!this._settings.globstar,posix:!0}}}},{"./filters/deep":77,"./filters/entry":78,"./filters/error":79,"./transformers/entry":83,path:397}],81:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});const n=e("stream"),i=e("../readers/stream"),s=e("./provider");r.default=class extends s.default{constructor(){super(...arguments),this._reader=new i.default(this._settings)}read(e){const t=this._getRootDirectory(e),r=this._getReaderOptions(e),i=this.api(t,e,r),s=new n.Readable({objectMode:!0,read:()=>{}});return i.once("error",e=>s.emit("error",e)).on("data",e=>s.emit("data",r.transform(e))).once("end",()=>s.emit("end")),s}api(e,t,r){return t.dynamic?this._reader.dynamic(e,r):this._reader.static(t.patterns,r)}}},{"../readers/stream":85,"./provider":80,stream:518}],82:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});const n=e("../readers/sync"),i=e("./provider");r.default=class extends i.default{constructor(){super(...arguments),this._reader=new n.default(this._settings)}read(e){const t=this._getRootDirectory(e),r=this._getReaderOptions(e);return this.api(t,e,r).map(r.transform)}api(e,t,r){return t.dynamic?this._reader.dynamic(e,r):this._reader.static(t.patterns,r)}}},{"../readers/sync":86,"./provider":80}],83:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});const n=e("../../utils/index");r.default=class{constructor(e){this._settings=e}getTransformer(){return e=>this._transform(e)}_transform(e){let t=e.path;return this._settings.absolute&&(t=n.path.makeAbsolute(this._settings.cwd,t),t=n.path.unixify(t)),this._settings.markDirectories&&e.dirent.isDirectory()&&(t+="/"),this._settings.objectMode?Object.assign({},e,{path:t}):t}}},{"../../utils/index":91}],84:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});const n=e("path"),i=e("@nodelib/fs.stat"),s=e("../utils/index");r.default=class{constructor(e){this._settings=e,this._fsStatSettings=new i.Settings({followSymbolicLink:this._settings.followSymbolicLinks,fs:this._settings.fs,throwErrorOnBrokenSymbolicLink:this._settings.followSymbolicLinks})}_getFullEntryPath(e){return n.resolve(this._settings.cwd,e)}_makeEntry(e,t){const r={name:t,path:t,dirent:s.fs.createDirentFromStats(t,e)};return this._settings.stats&&(r.stats=e),r}_isFatalError(e){return!s.errno.isEnoentCodeError(e)&&!this._settings.suppressErrors}}},{"../utils/index":91,"@nodelib/fs.stat":10,path:397}],85:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});const n=e("stream"),i=e("@nodelib/fs.stat"),s=e("@nodelib/fs.walk"),o=e("./reader");r.default=class extends o.default{constructor(){super(...arguments),this._walkStream=s.walkStream,this._stat=i.stat}dynamic(e,t){return this._walkStream(e,t)}static(e,t){const r=e.map(this._getFullEntryPath,this),i=new n.PassThrough({objectMode:!0});i._write=((n,s,o)=>this._getEntry(r[n],e[n],t).then(e=>{null!==e&&t.entryFilter(e)&&i.push(e),n===r.length-1&&i.end(),o()}).catch(o));for(let e=0;ethis._makeEntry(e,t)).catch(e=>{if(r.errorFilter(e))return null;throw e})}_getStat(e){return new Promise((t,r)=>{this._stat(e,this._fsStatSettings,(e,n)=>{e?r(e):t(n)})})}}},{"./reader":84,"@nodelib/fs.stat":10,"@nodelib/fs.walk":14,stream:518}],86:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});const n=e("@nodelib/fs.stat"),i=e("@nodelib/fs.walk"),s=e("./reader");r.default=class extends s.default{constructor(){super(...arguments),this._walkSync=i.walkSync,this._statSync=n.statSync}dynamic(e,t){return this._walkSync(e,t)}static(e,t){const r=[];for(const n of e){const e=this._getFullEntryPath(n),i=this._getEntry(e,n,t);null!==i&&t.entryFilter(i)&&r.push(i)}return r}_getEntry(e,t,r){try{const n=this._getStat(e);return this._makeEntry(n,t)}catch(e){if(r.errorFilter(e))return null;throw e}}_getStat(e){return this._statSync(e,this._fsStatSettings)}}},{"./reader":84,"@nodelib/fs.stat":10,"@nodelib/fs.walk":14}],87:[function(e,t,r){(function(t){"use strict";Object.defineProperty(r,"__esModule",{value:!0});const n=e("fs"),i=e("os").cpus().length;r.DEFAULT_FILE_SYSTEM_ADAPTER={lstat:n.lstat,lstatSync:n.lstatSync,stat:n.stat,statSync:n.statSync,readdir:n.readdir,readdirSync:n.readdirSync};r.default=class{constructor(e={}){this._options=e,this.absolute=this._getValue(this._options.absolute,!1),this.baseNameMatch=this._getValue(this._options.baseNameMatch,!1),this.braceExpansion=this._getValue(this._options.braceExpansion,!0),this.caseSensitiveMatch=this._getValue(this._options.caseSensitiveMatch,!0),this.concurrency=this._getValue(this._options.concurrency,i),this.cwd=this._getValue(this._options.cwd,t.cwd()),this.deep=this._getValue(this._options.deep,1/0),this.dot=this._getValue(this._options.dot,!1),this.extglob=this._getValue(this._options.extglob,!0),this.followSymbolicLinks=this._getValue(this._options.followSymbolicLinks,!0),this.fs=this._getFileSystemMethods(this._options.fs),this.globstar=this._getValue(this._options.globstar,!0),this.ignore=this._getValue(this._options.ignore,[]),this.markDirectories=this._getValue(this._options.markDirectories,!1),this.objectMode=this._getValue(this._options.objectMode,!1),this.onlyDirectories=this._getValue(this._options.onlyDirectories,!1),this.onlyFiles=this._getValue(this._options.onlyFiles,!0),this.stats=this._getValue(this._options.stats,!1),this.suppressErrors=this._getValue(this._options.suppressErrors,!1),this.throwErrorOnBrokenSymbolicLink=this._getValue(this._options.throwErrorOnBrokenSymbolicLink,!1),this.unique=this._getValue(this._options.unique,!0),this.onlyDirectories&&(this.onlyFiles=!1),this.stats&&(this.objectMode=!0)}_getValue(e,t){return void 0===e?t:e}_getFileSystemMethods(e={}){return Object.assign({},r.DEFAULT_FILE_SYSTEM_ADAPTER,e)}}}).call(this,e("_process"))},{_process:452,fs:290,os:293}],88:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.flatten=function(e){return e.reduce((e,t)=>[].concat(e,t),[])}},{}],89:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.isEnoentCodeError=function(e){return"ENOENT"===e.code}},{}],90:[function(e,t,r){arguments[4][7][0].apply(r,arguments)},{dup:7}],91:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});const n=e("./array");r.array=n;const i=e("./errno");r.errno=i;const s=e("./fs");r.fs=s;const o=e("./path");r.path=o;const a=e("./pattern");r.pattern=a;const u=e("./stream");r.stream=u},{"./array":88,"./errno":89,"./fs":90,"./path":92,"./pattern":93,"./stream":94}],92:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});const n=e("path");r.unixify=function(e){return e.replace(/\\/g,"/")},r.makeAbsolute=function(e,t){return n.resolve(e,t)}},{path:397}],93:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});const n=e("path"),i=e("glob-parent"),s=e("is-glob"),o=e("micromatch"),a="**";function u(e){return!l(e)}function l(e){return s(e,{strict:!1})}function c(e){return e.startsWith("!")&&"("!==e[1]}function h(e){return!c(e)}function p(e){return i(e)}function f(e){return e.endsWith("/"+a)}function d(e){const t=p(e),r=e.split("/").length,n=t.split("/").length;return"."===t?r-n:r-n-1}function m(e,t){return o.makeRe(e,t)}r.isStaticPattern=u,r.isDynamicPattern=l,r.convertToPositivePattern=function(e){return c(e)?e.slice(1):e},r.convertToNegativePattern=function(e){return"!"+e},r.isNegativePattern=c,r.isPositivePattern=h,r.getNegativePatterns=function(e){return e.filter(c)},r.getPositivePatterns=function(e){return e.filter(h)},r.getBaseDirectory=p,r.hasGlobStar=function(e){return-1!==e.indexOf(a)},r.endsWithSlashGlobStar=f,r.isAffectDepthOfReadingPattern=function(e){const t=n.basename(e);return f(e)||u(t)},r.getNaiveDepth=d,r.getMaxNaivePatternsDepth=function(e){return e.reduce((e,t)=>{const r=d(t);return r>e?r:e},0)},r.makeRe=m,r.convertPatternsToRe=function(e,t){return e.map(e=>m(e,t))},r.matchAny=function(e,t){const r=e.replace(/^\.[\\\/]/,"");return t.some(e=>e.test(r))}},{"glob-parent":73,"is-glob":352,micromatch:371,path:397}],94:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});const n=e("merge2");r.merge=function(e){const t=n(e);return e.forEach(e=>{e.once("error",e=>t.emit("error",e))}),t}},{merge2:370}],95:[function(e,t,r){"use strict";var n=e("reusify");function i(){}function s(){this.value=null,this.callback=i,this.next=null,this.release=i,this.context=null;var e=this;this.worked=function(t,r){var n=e.callback;e.value=null,e.callback=i,n.call(e.context,t,r),e.release(e)}}t.exports=function(e,t,r){"function"==typeof e&&(r=t,t=e,e=null);var o=n(s),a=null,u=null,l=0,c={push:function(r,n){var s=o.get();s.context=e,s.release=h,s.value=r,s.callback=n||i,l===c.concurrency||c.paused?u?(u.next=s,u=s):(a=s,u=s,c.saturated()):(l++,t.call(e,s.value,s.worked))},drain:i,saturated:i,pause:function(){c.paused=!0},paused:!1,concurrency:r,running:function(){return l},resume:function(){if(c.paused){c.paused=!1;for(var e=0;e{if(!(e instanceof Uint8Array||e instanceof ArrayBuffer||Buffer.isBuffer(e)))throw new TypeError(`Expected the \`input\` argument to be of type \`Uint8Array\` or \`Buffer\` or \`ArrayBuffer\`, got \`${typeof e}\``);const t=e instanceof Uint8Array?e:new Uint8Array(e);if(!(t&&t.length>1))return;const r=(e,r)=>{r={offset:0,...r};for(let n=0;nr(stringToBytes(e),t);if(r([255,216,255]))return{ext:"jpg",mime:"image/jpeg"};if(r([137,80,78,71,13,10,26,10])){const e=33,r=t.findIndex((r,n)=>n>=e&&73===t[n]&&68===t[n+1]&&65===t[n+2]&&84===t[n+3]),n=t.subarray(e,r);return n.findIndex((e,t)=>97===n[t]&&99===n[t+1]&&84===n[t+2]&&76===n[t+3])>=0?{ext:"apng",mime:"image/apng"}:{ext:"png",mime:"image/png"}}if(r([71,73,70]))return{ext:"gif",mime:"image/gif"};if(r([87,69,66,80],{offset:8}))return{ext:"webp",mime:"image/webp"};if(r([70,76,73,70]))return{ext:"flif",mime:"image/flif"};if((r([73,73,42,0])||r([77,77,0,42]))&&r([67,82],{offset:8}))return{ext:"cr2",mime:"image/x-canon-cr2"};if(r([73,73,82,79,8,0,0,0,24]))return{ext:"orf",mime:"image/x-olympus-orf"};if(r([73,73,42,0])&&(r([16,251,134,1],{offset:4})||r([8,0,0,0],{offset:4}))&&r([0,254,0,4,0,1,0,0,0,1,0,0,0,3,1],{offset:9}))return{ext:"arw",mime:"image/x-sony-arw"};if(r([73,73,42,0,8,0,0,0])&&(r([45,0,254,0],{offset:8})||r([39,0,254,0],{offset:8})))return{ext:"dng",mime:"image/x-adobe-dng"};if(r([73,73,42,0])&&r([28,0,254,0],{offset:8}))return{ext:"nef",mime:"image/x-nikon-nef"};if(r([73,73,85,0,24,0,0,0,136,231,116,216]))return{ext:"rw2",mime:"image/x-panasonic-rw2"};if(n("FUJIFILMCCD-RAW"))return{ext:"raf",mime:"image/x-fujifilm-raf"};if(r([73,73,42,0])||r([77,77,0,42]))return{ext:"tif",mime:"image/tiff"};if(r([66,77]))return{ext:"bmp",mime:"image/bmp"};if(r([73,73,188]))return{ext:"jxr",mime:"image/vnd.ms-photo"};if(r([56,66,80,83]))return{ext:"psd",mime:"image/vnd.adobe.photoshop"};const i=[80,75,3,4];if(r(i)){if(r([109,105,109,101,116,121,112,101,97,112,112,108,105,99,97,116,105,111,110,47,101,112,117,98,43,122,105,112],{offset:30}))return{ext:"epub",mime:"application/epub+zip"};if(r(xpiZipFilename,{offset:30}))return{ext:"xpi",mime:"application/x-xpinstall"};if(n("mimetypeapplication/vnd.oasis.opendocument.text",{offset:30}))return{ext:"odt",mime:"application/vnd.oasis.opendocument.text"};if(n("mimetypeapplication/vnd.oasis.opendocument.spreadsheet",{offset:30}))return{ext:"ods",mime:"application/vnd.oasis.opendocument.spreadsheet"};if(n("mimetypeapplication/vnd.oasis.opendocument.presentation",{offset:30}))return{ext:"odp",mime:"application/vnd.oasis.opendocument.presentation"};let e,s=0,o=!1;do{const a=s+30;if(o||(o=r(oxmlContentTypes,{offset:a})||r(oxmlRels,{offset:a})),e||(n("word/",{offset:a})?e={ext:"docx",mime:"application/vnd.openxmlformats-officedocument.wordprocessingml.document"}:n("ppt/",{offset:a})?e={ext:"pptx",mime:"application/vnd.openxmlformats-officedocument.presentationml.presentation"}:n("xl/",{offset:a})&&(e={ext:"xlsx",mime:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"})),o&&e)return e;s=multiByteIndexOf(t,i,a)}while(s>=0);if(e)return e}if(r([80,75])&&(3===t[2]||5===t[2]||7===t[2])&&(4===t[3]||6===t[3]||8===t[3]))return{ext:"zip",mime:"application/zip"};if(r([48,48,48,48,48,48],{offset:148,mask:[248,248,248,248,248,248]})&&tarHeaderChecksumMatches(t))return{ext:"tar",mime:"application/x-tar"};if(r([82,97,114,33,26,7])&&(0===t[6]||1===t[6]))return{ext:"rar",mime:"application/x-rar-compressed"};if(r([31,139,8]))return{ext:"gz",mime:"application/gzip"};if(r([66,90,104]))return{ext:"bz2",mime:"application/x-bzip2"};if(r([55,122,188,175,39,28]))return{ext:"7z",mime:"application/x-7z-compressed"};if(r([120,1]))return{ext:"dmg",mime:"application/x-apple-diskimage"};if(r([102,114,101,101],{offset:4})||r([109,100,97,116],{offset:4})||r([109,111,111,118],{offset:4})||r([119,105,100,101],{offset:4}))return{ext:"mov",mime:"video/quicktime"};if(n("ftyp",{offset:4})&&0!=(96&t[8])){const e=uint8ArrayUtf8ByteString(t,8,12).replace("\0"," ").trim();switch(e){case"mif1":return{ext:"heic",mime:"image/heif"};case"msf1":return{ext:"heic",mime:"image/heif-sequence"};case"heic":case"heix":return{ext:"heic",mime:"image/heic"};case"hevc":case"hevx":return{ext:"heic",mime:"image/heic-sequence"};case"qt":return{ext:"mov",mime:"video/quicktime"};case"M4V":case"M4VH":case"M4VP":return{ext:"m4v",mime:"video/x-m4v"};case"M4P":return{ext:"m4p",mime:"video/mp4"};case"M4B":return{ext:"m4b",mime:"audio/mp4"};case"M4A":return{ext:"m4a",mime:"audio/x-m4a"};case"F4V":return{ext:"f4v",mime:"video/mp4"};case"F4P":return{ext:"f4p",mime:"video/mp4"};case"F4A":return{ext:"f4a",mime:"audio/mp4"};case"F4B":return{ext:"f4b",mime:"audio/mp4"};default:return e.startsWith("3g")?e.startsWith("3g2")?{ext:"3g2",mime:"video/3gpp2"}:{ext:"3gp",mime:"video/3gpp"}:{ext:"mp4",mime:"video/mp4"}}}if(r([77,84,104,100]))return{ext:"mid",mime:"audio/midi"};if(r([26,69,223,163])){const e=t.subarray(4,4100),r=e.findIndex((e,t,r)=>66===r[t]&&130===r[t+1]);if(-1!==r){const t=r+3,n=r=>[...r].every((r,n)=>e[t+n]===r.charCodeAt(0));if(n("matroska"))return{ext:"mkv",mime:"video/x-matroska"};if(n("webm"))return{ext:"webm",mime:"video/webm"}}}if(r([82,73,70,70])){if(r([65,86,73],{offset:8}))return{ext:"avi",mime:"video/vnd.avi"};if(r([87,65,86,69],{offset:8}))return{ext:"wav",mime:"audio/vnd.wave"};if(r([81,76,67,77],{offset:8}))return{ext:"qcp",mime:"audio/qcelp"}}if(r([48,38,178,117,142,102,207,17,166,217])){let e=30;do{const n=readUInt64LE(t,e+16);if(r([145,7,220,183,183,169,207,17,142,230,0,192,12,32,83,101],{offset:e})){if(r([64,158,105,248,77,91,207,17,168,253,0,128,95,92,68,43],{offset:e+24}))return{ext:"wma",mime:"audio/x-ms-wma"};if(r([192,239,25,188,77,91,207,17,168,253,0,128,95,92,68,43],{offset:e+24}))return{ext:"wmv",mime:"video/x-ms-asf"};break}e+=n}while(e+24<=t.length);return{ext:"asf",mime:"application/vnd.ms-asf"}}if(r([0,0,1,186])||r([0,0,1,179]))return{ext:"mpg",mime:"video/mpeg"};for(let e=0;e<2&&enew Promise((resolve,reject)=>{const stream=eval("require")("stream");readableStream.on("error",reject),readableStream.once("readable",()=>{const e=new stream.PassThrough,t=readableStream.read(module.exports.minimumBytes)||readableStream.read();try{e.fileType=fileType(t)}catch(e){reject(e)}readableStream.unshift(t),stream.pipeline?resolve(stream.pipeline(readableStream,e,()=>{})):resolve(readableStream.pipe(e))})})),Object.defineProperty(fileType,"extensions",{get:()=>new Set(supported.extensions)}),Object.defineProperty(fileType,"mimeTypes",{get:()=>new Set(supported.mimeTypes)})}).call(this,{isBuffer:require("../is-buffer/index.js")})},{"../is-buffer/index.js":350,"./supported":99,"./util":100}],99:[function(e,t,r){"use strict";t.exports={extensions:["jpg","png","apng","gif","webp","flif","cr2","orf","arw","dng","nef","rw2","raf","tif","bmp","jxr","psd","zip","tar","rar","gz","bz2","7z","dmg","mp4","mid","mkv","webm","mov","avi","mpg","mp2","mp3","m4a","oga","ogg","ogv","opus","flac","wav","spx","amr","pdf","epub","exe","swf","rtf","wasm","woff","woff2","eot","ttf","otf","ico","flv","ps","xz","sqlite","nes","crx","xpi","cab","deb","ar","rpm","Z","lz","msi","mxf","mts","blend","bpg","docx","pptx","xlsx","3gp","3g2","jp2","jpm","jpx","mj2","aif","qcp","odt","ods","odp","xml","mobi","heic","cur","ktx","ape","wv","wmv","wma","dcm","ics","glb","pcap","dsf","lnk","alias","voc","ac3","m4v","m4p","m4b","f4v","f4p","f4b","f4a","mie","asf","ogm","ogx","mpc","arrow","shp"],mimeTypes:["image/jpeg","image/png","image/gif","image/webp","image/flif","image/x-canon-cr2","image/tiff","image/bmp","image/vnd.ms-photo","image/vnd.adobe.photoshop","application/epub+zip","application/x-xpinstall","application/vnd.oasis.opendocument.text","application/vnd.oasis.opendocument.spreadsheet","application/vnd.oasis.opendocument.presentation","application/vnd.openxmlformats-officedocument.wordprocessingml.document","application/vnd.openxmlformats-officedocument.presentationml.presentation","application/vnd.openxmlformats-officedocument.spreadsheetml.sheet","application/zip","application/x-tar","application/x-rar-compressed","application/gzip","application/x-bzip2","application/x-7z-compressed","application/x-apple-diskimage","application/x-apache-arrow","video/mp4","audio/midi","video/x-matroska","video/webm","video/quicktime","video/vnd.avi","audio/vnd.wave","audio/qcelp","audio/x-ms-wma","video/x-ms-asf","application/vnd.ms-asf","video/mpeg","video/3gpp","audio/mpeg","audio/mp4","audio/opus","video/ogg","audio/ogg","application/ogg","audio/x-flac","audio/ape","audio/wavpack","audio/amr","application/pdf","application/x-msdownload","application/x-shockwave-flash","application/rtf","application/wasm","font/woff","font/woff2","application/vnd.ms-fontobject","font/ttf","font/otf","image/x-icon","video/x-flv","application/postscript","application/x-xz","application/x-sqlite3","application/x-nintendo-nes-rom","application/x-google-chrome-extension","application/vnd.ms-cab-compressed","application/x-deb","application/x-unix-archive","application/x-rpm","application/x-compress","application/x-lzip","application/x-msi","application/x-mie","application/mxf","video/mp2t","application/x-blender","image/bpg","image/jp2","image/jpx","image/jpm","image/mj2","audio/aiff","application/xml","application/x-mobipocket-ebook","image/heif","image/heif-sequence","image/heic","image/heic-sequence","image/ktx","application/dicom","audio/x-musepack","text/calendar","model/gltf-binary","application/vnd.tcpdump.pcap","audio/x-dsf","application/x.ms.shortcut","application/x.apple.alias","audio/x-voc","audio/vnd.dolby.dd-raw","audio/x-m4a","image/apng","image/x-olympus-orf","image/x-sony-arw","image/x-adobe-dng","image/x-nikon-nef","image/x-panasonic-rw2","image/x-fujifilm-raf","video/x-m4v","video/3gpp2","application/x-esri-shape"]}},{}],100:[function(e,t,r){(function(e){"use strict";r.stringToBytes=(e=>[...e].map(e=>e.charCodeAt(0)));const t=(e,t,r)=>String.fromCharCode(...e.slice(t,r));r.readUInt64LE=((e,t=0)=>{let r=e[t],n=1,i=0;for(;++i<8;)n*=256,r+=e[t+i]*n;return r}),r.tarHeaderChecksumMatches=(e=>{if(e.length<512)return!1;let r=256,n=0;for(let t=0;t<148;t++){const i=e[t];r+=i,n+=128&i}for(let t=156;t<512;t++){const i=e[t];r+=i,n+=128&i}const i=parseInt(t(e,148,154),8);return i===r||i===r-(n<<1)}),r.multiByteIndexOf=((t,r,n=0)=>{if(e&&e.isBuffer(t))return t.indexOf(e.from(r),n);const i=(e,t,r)=>{for(let n=1;n=0;){if(i(t,r,s))return s;s=t.indexOf(r[0],s+1)}return-1}),r.uint8ArrayUtf8ByteString=t}).call(this,e("buffer").Buffer)},{buffer:291}],101:[function(e,t,r){var n=e("path").sep||"/";t.exports=function(e){if("string"!=typeof e||e.length<=7||"file://"!=e.substring(0,7))throw new TypeError("must pass in a file:// URI to convert to a file path");var t=decodeURI(e.substring(7)),r=t.indexOf("/"),i=t.substring(0,r),s=t.substring(r+1);"localhost"==i&&(i="");i&&(i=n+n+i);s=s.replace(/^(.+)\|/,"$1:"),"\\"==n&&(s=s.replace(/\//g,"\\"));/^.+\:/.test(s)||(s=n+s);return i+s}},{path:397}],102:[function(e,t,r){var n=function(t){(t=t||{}).width=t.width||800,t.height=t.height||600;var r=t.model||{vertex:[-1,-1,0,1,-1,0,1,1,0,-1,1,0],indices:[0,1,2,0,2,3,2,1,0,3,2,0],textureCoords:[0,0,1,0,1,1,0,1]},n=t.lens||{a:1,b:1,Fx:0,Fy:0,scale:1.5},i=t.fov||{x:1,y:1},s=t.image||"images/barrel-distortion.png",o=function(e){var t=document.querySelector(e);if(null==t)throw new Error("there is no canvas on this page");for(var r=["webgl","experimental-webgl","webkit-3d","moz-webgl"],n=0;n 0.99 || vMapping.x < 0.01 || vMapping.y > 0.99 || vMapping.y < 0.01){\n\t\ttexture = vec4(0.0, 0.0, 0.0, 1.0);\n\t} \n\tgl_FragColor = texture;\n}\n"},{}],105:[function(e,t,r){t.exports="#ifdef GL_ES\nprecision highp float;\n#endif\nuniform vec4 uLens;\nuniform vec2 uFov;\nuniform sampler2D uSampler;\nvarying vec3 vPosition;\nvarying vec2 vTextureCoord;\nvec2 TextureCoord2GLCoord(vec2 textureCoord) {\n\treturn (textureCoord - vec2(0.5, 0.5)) * 2.0;\n}\nvec2 GLCoord2TextureCoord(vec2 glCoord) {\n\treturn glCoord / 2.0 + vec2(0.5, 0.5);\n}\nvoid main(void){\n\tfloat correctionRadius = 0.5;\n\tfloat distance = sqrt(vPosition.x * vPosition.x + vPosition.y * vPosition.y) / correctionRadius;\n\tfloat theta = 1.0;\n\tif(distance != 0.0){\n\t\ttheta = atan(distance);\n\t}\n\tvec2 vMapping = theta * vPosition.xy;\n\tvMapping = GLCoord2TextureCoord(vMapping);\n\t\t\n\tvec4 texture = texture2D(uSampler, vMapping);\n\tif(vMapping.x > 0.99 || vMapping.x < 0.01 || vMapping.y > 0.99 || vMapping.y < 0.01){\n\t\ttexture = vec4(0.0, 0.0, 0.0, 1.0);\n\t} \n\tgl_FragColor = texture;\n}\n"},{}],106:[function(e,t,r){t.exports="#ifdef GL_ES\nprecision highp float;\n#endif\nuniform vec3 uLensS;\nuniform vec2 uLensF;\nuniform vec2 uFov;\nuniform sampler2D uSampler;\nvarying vec3 vPosition;\nvarying vec2 vTextureCoord;\nvec2 GLCoord2TextureCoord(vec2 glCoord) {\n\treturn glCoord * vec2(1.0, -1.0)/ 2.0 + vec2(0.5, 0.5);\n}\nvoid main(void){\n\tfloat scale = uLensS.z;\n\tvec3 vPos = vPosition;\n\tfloat Fx = uLensF.x;\n\tfloat Fy = uLensF.y;\n\tvec2 vMapping = vPos.xy;\n\tvMapping.x = vMapping.x + ((pow(vPos.y, 2.0)/scale)*vPos.x/scale)*-Fx;\n\tvMapping.y = vMapping.y + ((pow(vPos.x, 2.0)/scale)*vPos.y/scale)*-Fy;\n\tvMapping = vMapping * uLensS.xy;\n\tvMapping = GLCoord2TextureCoord(vMapping/scale);\n\tvec4 texture = texture2D(uSampler, vMapping);\n\tif(vMapping.x > 0.99 || vMapping.x < 0.01 || vMapping.y > 0.99 || vMapping.y < 0.01){\n\t\ttexture = vec4(0.0, 0.0, 0.0, 1.0);\n\t}\n\tgl_FragColor = texture;\n}\n"},{}],107:[function(e,t,r){t.exports="#ifdef GL_ES\nprecision highp float;\n#endif\nuniform vec4 uLens;\nuniform vec2 uFov;\nuniform sampler2D uSampler;\nvarying vec3 vPosition;\nvarying vec2 vTextureCoord;\nvec2 TextureCoord2GLCoord(vec2 textureCoord) {\n\treturn (textureCoord - vec2(0.5, 0.5)) * 2.0;\n}\nvec2 GLCoord2TextureCoord(vec2 glCoord) {\n\treturn glCoord / 2.0 + vec2(0.5, 0.5);\n}\nvoid main(void){\n\tvec2 vMapping = vec2(vTextureCoord.x, 1.0 - vTextureCoord.y);\n\tvMapping = TextureCoord2GLCoord(vMapping);\n\t//TODO insert Code\n\tfloat F = uLens.x/ uLens.w;\n\tfloat seta = length(vMapping) / F;\n\tvMapping = sin(seta) * F / length(vMapping) * vMapping;\n\tvMapping *= uLens.w * 1.414;\n\tvMapping = GLCoord2TextureCoord(vMapping);\n\tvec4 texture = texture2D(uSampler, vMapping);\n\tif(vMapping.x > 0.99 || vMapping.x < 0.01 || vMapping.y > 0.99 || vMapping.y < 0.01){\n\t\ttexture = vec4(0.0, 0.0, 0.0, 1.0);\n\t} \n\tgl_FragColor = texture;\n}\n"},{}],108:[function(e,t,r){t.exports="#ifdef GL_ES\nprecision highp float;\n#endif\nuniform vec4 uLens;\nuniform vec2 uFov;\nuniform sampler2D uSampler;\nvarying vec3 vPosition;\nvarying vec2 vTextureCoord;\nvec2 TextureCoord2GLCoord(vec2 textureCoord) {\n\treturn (textureCoord - vec2(0.5, 0.5)) * 2.0;\n}\nvec2 GLCoord2TextureCoord(vec2 glCoord) {\n\treturn glCoord / 2.0 + vec2(0.5, 0.5);\n}\nvoid main(void){\n\tvec2 vMapping = vec2(vTextureCoord.x, 1.0 - vTextureCoord.y);\n\tvMapping = TextureCoord2GLCoord(vMapping);\n\t//TOD insert Code\n\tfloat F = uLens.x/ uLens.w;\n\tfloat seta = length(vMapping) / F;\n\tvMapping = sin(seta) * F / length(vMapping) * vMapping;\n\tvMapping *= uLens.w * 1.414;\n\tvMapping = GLCoord2TextureCoord(vMapping);\n\tvec4 texture = texture2D(uSampler, vMapping);\n\tif(vMapping.x > 0.99 || vMapping.x < 0.01 || vMapping.y > 0.99 || vMapping.y < 0.01){\n\t\ttexture = vec4(0.0, 0.0, 0.0, 1.0);\n\t} \n\tgl_FragColor = texture;\n}\n"},{}],109:[function(e,t,r){t.exports="#ifdef GL_ES\nprecision highp float;\n#endif\nattribute vec3 aVertexPosition;\nattribute vec2 aTextureCoord;\nvarying vec3 vPosition;\nvarying vec2 vTextureCoord;\nvoid main(void){\n\tvPosition = aVertexPosition;\n\tvTextureCoord = aTextureCoord;\n\tgl_Position = vec4(vPosition,1.0);\n}\n"},{}],110:[function(e,t,r){(function(r){t.exports=c,c.realpath=c,c.sync=h,c.realpathSync=h,c.monkeypatch=function(){n.realpath=c,n.realpathSync=h},c.unmonkeypatch=function(){n.realpath=i,n.realpathSync=s};var n=e("fs"),i=n.realpath,s=n.realpathSync,o=r.version,a=/^v[0-5]\./.test(o),u=e("./old.js");function l(e){return e&&"realpath"===e.syscall&&("ELOOP"===e.code||"ENOMEM"===e.code||"ENAMETOOLONG"===e.code)}function c(e,t,r){if(a)return i(e,t,r);"function"==typeof t&&(r=t,t=null),i(e,t,function(n,i){l(n)?u.realpath(e,t,r):r(n,i)})}function h(e,t){if(a)return s(e,t);try{return s(e,t)}catch(r){if(l(r))return u.realpathSync(e,t);throw r}}}).call(this,e("_process"))},{"./old.js":111,_process:452,fs:290}],111:[function(e,t,r){(function(t){var n=e("path"),i="win32"===t.platform,s=e("fs"),o=t.env.NODE_DEBUG&&/fs/.test(t.env.NODE_DEBUG);function a(e){return"function"==typeof e?e:function(){var e;if(o){var r=new Error;e=function(e){e&&(r.message=e.message,n(e=r))}}else e=n;return e;function n(e){if(e){if(t.throwDeprecation)throw e;if(!t.noDeprecation){var r="fs: missing callback "+(e.stack||e.message);t.traceDeprecation?console.trace(r):console.error(r)}}}}()}n.normalize;if(i)var u=/(.*?)(?:[\/\\]+|$)/g;else u=/(.*?)(?:[\/]+|$)/g;if(i)var l=/^(?:[a-zA-Z]:|[\\\/]{2}[^\\\/]+[\\\/][^\\\/]+)?[\\\/]*/;else l=/^[\/]*/;r.realpathSync=function(e,t){if(e=n.resolve(e),t&&Object.prototype.hasOwnProperty.call(t,e))return t[e];var r,o,a,c,h=e,p={},f={};function d(){var t=l.exec(e);r=t[0].length,o=t[0],a=t[0],c="",i&&!f[a]&&(s.lstatSync(a),f[a]=!0)}for(d();r=e.length)return r&&(r[d]=e),o(null,e);u.lastIndex=c;var n=u.exec(e);return f=h,h+=n[0],p=f+n[1],c=u.lastIndex,g[p]||r&&r[p]===p?t.nextTick(y):r&&Object.prototype.hasOwnProperty.call(r,p)?x(r[p]):s.lstat(p,_)}function _(e,n){if(e)return o(e);if(!n.isSymbolicLink())return g[p]=!0,r&&(r[p]=p),t.nextTick(y);if(!i){var a=n.dev.toString(32)+":"+n.ino.toString(32);if(m.hasOwnProperty(a))return b(null,m[a],p)}s.stat(p,function(e){if(e)return o(e);s.readlink(p,function(e,t){i||(m[a]=t),b(e,t)})})}function b(e,t,i){if(e)return o(e);var s=n.resolve(f,t);r&&(r[i]=s),x(s)}function x(t){e=n.resolve(t,e.slice(c)),v()}v()}}).call(this,e("_process"))},{_process:452,fs:290,path:397}],112:[function(e,t,r){(function(r,n){"use strict";var i=e("path"),s=e("ndarray"),o=e("omggif").GifReader,a=(e("ndarray-pack"),e("through"),e("data-uri-to-buffer"));function u(e,t){var r;try{r=new o(e)}catch(e){return void t(e)}if(r.numFrames()>0){var n=[r.numFrames(),r.height,r.width,4],i=new Uint8Array(n[0]*n[1]*n[2]*n[3]),a=s(i,n);try{for(var u=0;u=0&&(this.dispose=e)},u.prototype.setRepeat=function(e){this.repeat=e},u.prototype.setTransparent=function(e){this.transparent=e},u.prototype.analyzeImage=function(e){this.setImagePixels(this.removeAlphaChannel(e)),this.analyzePixels()},u.prototype.writeImageInfo=function(){this.firstFrame&&(this.writeLSD(),this.writePalette(),this.repeat>=0&&this.writeNetscapeExt()),this.writeGraphicCtrlExt(),this.writeImageDesc(),this.firstFrame||this.writePalette(),this.firstFrame=!1},u.prototype.outputImage=function(){this.writePixels()},u.prototype.addFrame=function(e){this.emit("frame#start"),this.analyzeImage(e),this.writeImageInfo(),this.outputImage(),this.emit("frame#stop")},u.prototype.finish=function(){this.emit("finish#start"),this.writeByte(59),this.emit("finish#stop")},u.prototype.setQuality=function(e){e<1&&(e=1),this.sample=e},u.prototype.writeHeader=function(){this.emit("writeHeader#start"),this.writeUTFBytes("GIF89a"),this.emit("writeHeader#stop")},u.prototype.analyzePixels=function(){var e=this.pixels.length/3;this.indexedPixels=new Uint8Array(e);var t=new s(this.pixels,this.sample);t.buildColormap(),this.colorTab=t.getColormap();for(var r=0,n=0;n>16,r=(65280&e)>>8,n=255&e,i=0,s=16777216,o=this.colorTab.length,a=0;a=0&&(t=7&dispose),t<<=2,this.writeByte(0|t|e),this.writeShort(this.delay),this.writeByte(this.transIndex),this.writeByte(0)},u.prototype.writeImageDesc=function(){this.writeByte(44),this.writeShort(0),this.writeShort(0),this.writeShort(this.width),this.writeShort(this.height),this.firstFrame?this.writeByte(0):this.writeByte(128|this.palSize)},u.prototype.writeLSD=function(){this.writeShort(this.width),this.writeShort(this.height),this.writeByte(240|this.palSize),this.writeByte(0),this.writeByte(0)},u.prototype.writeNetscapeExt=function(){this.writeByte(33),this.writeByte(255),this.writeByte(11),this.writeUTFBytes("NETSCAPE2.0"),this.writeByte(3),this.writeByte(1),this.writeShort(this.repeat),this.writeByte(0)},u.prototype.writePalette=function(){this.writeBytes(this.colorTab);for(var e=768-this.colorTab.length,t=0;t>8&255)},u.prototype.writePixels=function(){new o(this.width,this.height,this.indexedPixels,this.colorDepth).encode(this)},u.prototype.stream=function(){return this},u.ByteCapacitor=a,t.exports=u}).call(this,e("buffer").Buffer)},{"./LZWEncoder.js":115,"./TypedNeuQuant.js":116,assert:284,buffer:291,events:292,"readable-stream":122,util:538}],115:[function(e,t,r){var n=-1,i=12,s=5003,o=[0,1,3,7,15,31,63,127,255,511,1023,2047,4095,8191,16383,32767,65535];t.exports=function(e,t,r,a){var u,l,c,h,p,f,d,m,g,v=Math.max(2,a),y=new Uint8Array(256),_=new Int32Array(s),b=new Int32Array(s),x=0,w=0,E=!1;function T(e,t){y[l++]=e,l>=254&&k(t)}function A(e){S(s),w=m+2,E=!0,R(m,e)}function S(e){for(var t=0;t0&&(e.writeByte(l),e.writeBytes(y,0,l),l=0)}function C(e){return(1<0?u|=e<=8;)T(255&u,t),u>>=8,x-=8;if((w>c||E)&&(E?(c=C(f=d),E=!1):c=++f==i?1<0;)T(255&u,t),u>>=8,x-=8;k(t)}}this.encode=function(r){r.writeByte(v),h=e*t,p=0,function(e,t){var r,o,a,u,h,p,v;for(E=!1,c=C(f=d=e),g=1+(m=1<=0){h=p-a,0===a&&(h=1);do{if((a-=h)<0&&(a+=p),_[a]===r){u=b[a];continue e}}while(_[a]>=0)}R(u,t),u=o,w<1<>c,p=u<>3)*(1<l;)u=k[f++],hl&&((a=r[p--])[0]-=u*(a[0]-n)/y,a[1]-=u*(a[1]-s)/y,a[2]-=u*(a[2]-o)/y)}function R(e,t,n){var s,u,f,d,m,g=~(1<<31),v=g,y=-1,_=y;for(s=0;s>a-o))>c,S[s]-=m,A[s]+=m<>3),e=0;e>f;for(S<=1&&(S=0),r=0;r=c&&(O-=c),r++,0===y&&(y=1),r%y==0)for(T-=T/h,(S=(A-=A/m)>>f)<=1&&(S=0),l=0;l>=o,r[e][1]>>=o,r[e][2]>>=o,r[e][3]=e}(),function(){var e,t,n,o,a,u,l=0,c=0;for(e=0;e>1,t=l+1;t>1,t=l+1;t<256;t++)T[t]=s}()},this.getColormap=function(){for(var e=[],t=[],n=0;n=0;)c=u?c=i:(c++,a<0&&(a=-a),(s=o[0]-e)<0&&(s=-s),(a+=s)=0&&((a=t-(o=r[h])[1])>=u?h=-1:(h--,a<0&&(a=-a),(s=o[0]-e)<0&&(s=-s),(a+=s)0)if(t.ended&&!s){var a=new Error("stream.push() after EOF");e.emit("error",a)}else if(t.endEmitted&&s){a=new Error("stream.unshift() after end event");e.emit("error",a)}else!t.decoder||s||i||(n=t.decoder.write(n)),s||(t.reading=!1),t.flowing&&0===t.length&&!t.sync?(e.emit("data",n),e.read(0)):(t.length+=t.objectMode?1:n.length,s?t.buffer.unshift(n):t.buffer.push(n),t.needReadable&&m(e)),function(e,t){t.readingMore||(t.readingMore=!0,r.nextTick(function(){!function(e,t){var r=t.length;for(;!t.reading&&!t.flowing&&!t.ended&&t.lengtht.highWaterMark&&(t.highWaterMark=function(e){if(e>=f)e=f;else{e--;for(var t=1;t<32;t<<=1)e|=e>>t;e++}return e}(e)),e>t.length?t.ended?t.length:(t.needReadable=!0,0):e)}function m(e){var t=e._readableState;t.needReadable=!1,t.emittedReadable||(l("emitReadable",t.flowing),t.emittedReadable=!0,t.sync?r.nextTick(function(){g(e)}):g(e))}function g(e){l("emit readable"),e.emit("readable"),v(e)}function v(e){var t=e._readableState;if(l("flow",t.flowing),t.flowing)do{var r=e.read()}while(null!==r&&t.flowing)}function y(e,t){var r,n=t.buffer,s=t.length,o=!!t.decoder,a=!!t.objectMode;if(0===n.length)return null;if(0===s)r=null;else if(a)r=n.shift();else if(!e||e>=s)r=o?n.join(""):i.concat(n,s),n.length=0;else{if(e0)throw new Error("endReadable called on non-empty stream");t.endEmitted||(t.ended=!0,r.nextTick(function(){t.endEmitted||0!==t.length||(t.endEmitted=!0,e.readable=!1,e.emit("end"))}))}h.prototype.read=function(e){l("read",e);var t=this._readableState,r=e;if((!u.isNumber(e)||e>0)&&(t.emittedReadable=!1),0===e&&t.needReadable&&(t.length>=t.highWaterMark||t.ended))return l("read: emitReadable",t.length,t.ended),0===t.length&&t.ended?_(this):m(this),null;if(0===(e=d(e,t))&&t.ended)return 0===t.length&&_(this),null;var n,i=t.needReadable;return l("need readable",i),(0===t.length||t.length-e0?y(e,t):null,u.isNull(n)&&(t.needReadable=!0,e=0),t.length-=e,0!==t.length||t.ended||(t.needReadable=!0),r!==e&&t.ended&&0===t.length&&_(this),u.isNull(n)||this.emit("data",n),n},h.prototype._read=function(e){this.emit("error",new Error("not implemented"))},h.prototype.pipe=function(e,t){var i=this,o=this._readableState;switch(o.pipesCount){case 0:o.pipes=e;break;case 1:o.pipes=[o.pipes,e];break;default:o.pipes.push(e)}o.pipesCount+=1,l("pipe count=%d opts=%j",o.pipesCount,t);var a=(!t||!1!==t.end)&&e!==r.stdout&&e!==r.stderr?c:p;function u(e){l("onunpipe"),e===i&&p()}function c(){l("onend"),e.end()}o.endEmitted?r.nextTick(a):i.once("end",a),e.on("unpipe",u);var h=function(e){return function(){var t=e._readableState;l("pipeOnDrain",t.awaitDrain),t.awaitDrain&&t.awaitDrain--,0===t.awaitDrain&&s.listenerCount(e,"data")&&(t.flowing=!0,v(e))}}(i);function p(){l("cleanup"),e.removeListener("close",m),e.removeListener("finish",g),e.removeListener("drain",h),e.removeListener("error",d),e.removeListener("unpipe",u),i.removeListener("end",c),i.removeListener("end",p),i.removeListener("data",f),!o.awaitDrain||e._writableState&&!e._writableState.needDrain||h()}function f(t){l("ondata"),!1===e.write(t)&&(l("false write response, pause",i._readableState.awaitDrain),i._readableState.awaitDrain++,i.pause())}function d(t){l("onerror",t),y(),e.removeListener("error",d),0===s.listenerCount(e,"error")&&e.emit("error",t)}function m(){e.removeListener("finish",g),y()}function g(){l("onfinish"),e.removeListener("close",m),y()}function y(){l("unpipe"),i.unpipe(e)}return e.on("drain",h),i.on("data",f),e._events&&e._events.error?n(e._events.error)?e._events.error.unshift(d):e._events.error=[d,e._events.error]:e.on("error",d),e.once("close",m),e.once("finish",g),e.emit("pipe",i),o.flowing||(l("pipe resume"),i.resume()),e},h.prototype.unpipe=function(e){var t=this._readableState;if(0===t.pipesCount)return this;if(1===t.pipesCount)return e&&e!==t.pipes?this:(e||(e=t.pipes),t.pipes=null,t.pipesCount=0,t.flowing=!1,e&&e.emit("unpipe",this),this);if(!e){var r=t.pipes,n=t.pipesCount;t.pipes=null,t.pipesCount=0,t.flowing=!1;for(var i=0;i1){for(var r=[],n=0;n=t?e.call():n.value=i(s)}),n},Blob:e.Blob||e.BlobBuilder||e.WebKitBlobBuilder||e.MozBlobBuilder||e.MSBlobBuilder,btoa:(o=e.btoa||function(e){for(var t="",r=0,n=e.length,i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",s=void 0,o=void 0,a=void 0,u=void 0,l=void 0,c=void 0,h=void 0;r>2,l=(3&s)<<4|(o=e.charCodeAt(r++))>>4,c=(15&o)<<2|(a=e.charCodeAt(r++))>>6,h=63&a,isNaN(o)?c=h=64:isNaN(a)&&(h=64),t=t+i.charAt(u)+i.charAt(l)+i.charAt(c)+i.charAt(h);return t},o?o.bind(e):u.noop),isObject:function(e){return e&&"[object Object]"===Object.prototype.toString.call(e)},isEmptyObject:function(e){return u.isObject(e)&&!Object.keys(e).length},isArray:function(e){return e&&Array.isArray(e)},isFunction:function(e){return e&&"function"==typeof e},isElement:function(e){return e&&1===e.nodeType},isString:function(e){return"string"==typeof e||"[object String]"===Object.prototype.toString.call(e)},isSupported:{canvas:function(){var e=n.createElement("canvas");return e&&e.getContext&&e.getContext("2d")},webworkers:function(){return e.Worker},blob:function(){return u.Blob},Uint8Array:function(){return e.Uint8Array},Uint32Array:function(){return e.Uint32Array},videoCodecs:function(){var e=n.createElement("video"),t={mp4:!1,h264:!1,ogv:!1,ogg:!1,webm:!1};try{e&&e.canPlayType&&(t.mp4=""!==e.canPlayType('video/mp4; codecs="mp4v.20.8"'),t.h264=""!==(e.canPlayType('video/mp4; codecs="avc1.42E01E"')||e.canPlayType('video/mp4; codecs="avc1.42E01E, mp4a.40.2"')),t.ogv=""!==e.canPlayType('video/ogg; codecs="theora"'),t.ogg=""!==e.canPlayType('video/ogg; codecs="theora"'),t.webm=-1!==e.canPlayType('video/webm; codecs="vp8, vorbis"'))}catch(e){}return t}()},noop:function(){},each:function(e,t){var r=void 0,n=void 0;if(u.isArray(e))for(r=-1,n=e.length;++r0&&arguments[0]!==s?arguments[0]:{};if(!n.body||!1===e.resizeFont)return e.fontSize;var t=e.text,r=e.gifWidth,i=parseInt(e.fontSize,10),o=parseInt(e.minFontSize,10),a=n.createElement("div"),u=n.createElement("span");for(a.setAttribute("width",r),a.appendChild(u),u.innerHTML=t,u.style.fontSize=i+"px",u.style.textIndent="-9999px",u.style.visibility="hidden",n.body.appendChild(u);u.offsetWidth>r&&i>=o;)u.style.fontSize=--i+"px";return n.body.removeChild(u),i+"px"},webWorkerError:!1},l=Object.freeze({default:u}),c={validate:function(e){e=u.isObject(e)?e:{};var t={};return u.each(c.validators,function(r,n){var i=n.errorCode;if(!e[i]&&!n.condition)return(t=n).error=!0,!1}),delete t.condition,t},isValid:function(e){var t=!0!==c.validate(e).error;return t},validators:[{condition:u.isFunction(u.getUserMedia),errorCode:"getUserMedia",errorMsg:"The getUserMedia API is not supported in your browser"},{condition:u.isSupported.canvas(),errorCode:"canvas",errorMsg:"Canvas elements are not supported in your browser"},{condition:u.isSupported.webworkers(),errorCode:"webworkers",errorMsg:"The Web Workers API is not supported in your browser"},{condition:u.isFunction(u.URL),errorCode:"window.URL",errorMsg:"The window.URL API is not supported in your browser"},{condition:u.isSupported.blob(),errorCode:"window.Blob",errorMsg:"The window.Blob File API is not supported in your browser"},{condition:u.isSupported.Uint8Array(),errorCode:"window.Uint8Array",errorMsg:"The window.Uint8Array function constructor is not supported in your browser"},{condition:u.isSupported.Uint32Array(),errorCode:"window.Uint32Array",errorMsg:"The window.Uint32Array function constructor is not supported in your browser"}],messages:{videoCodecs:{errorCode:"videocodec",errorMsg:"The video codec you are trying to use is not supported in your browser"}}},h=Object.freeze({default:c}),p=function(){},f={sampleInterval:10,numWorkers:2,filter:"",gifWidth:200,gifHeight:200,interval:.1,numFrames:10,frameDuration:1,keepCameraOn:!1,images:[],video:null,webcamVideoElement:null,cameraStream:null,text:"",fontWeight:"normal",fontSize:"16px",minFontSize:"10px",resizeFont:!1,fontFamily:"sans-serif",fontColor:"#ffffff",textAlign:"center",textBaseline:"bottom",textXCoordinate:null,textYCoordinate:null,progressCallback:p,completeCallback:p,saveRenderingContexts:!1,savedRenderingContexts:[],crossOrigin:"Anonymous"},d=Object.freeze({default:f});function m(){return c.isValid()}function g(){var e,t,r,n,i,s=256,o=499,a=491,u=487,l=503,c=3*l,h=s-1,p=4,f=100,d=16,m=1<>v,_=m<>3)*(1<s&&(c=s),a=t+1,u=t-1,p=1;al;){if(h=I[p++],al){f=i[u--];try{f[0]-=h*(f[0]-r)/A|0,f[1]-=h*(f[1]-n)/A|0,f[2]-=h*(f[2]-o)/A|0}catch(e){}}}}function O(e,t,r,n,s){var o=i[t],a=e/E;o[0]-=a*(o[0]-r)|0,o[1]-=a*(o[1]-n)|0,o[2]-=a*(o[2]-s)|0}function L(e,t,r){var n,o,a,u,l,c,h,f,m,b;for(m=f=~(1<<31),h=c=-1,n=0;n>d-p))>v,C[n]-=l,k[n]+=l<=0;)n=l?n=s:(n++,a<0&&(a=-a),(u=c[0]-e)<0&&(u=-u),(a+=u)=0&&((a=t-(c=i[o])[1])>=l?o=-1:(o--,a<0&&(a=-a),(u=c[0]-e)<0&&(u=-u),(a+=u)>b)<=1&&(v=0),i=0;i=P&&(C-=r),i++,0===A&&(A=1),i%A==0)for(y-=y/e,(v=(g-=g/w)>>b)<=1&&(v=0),s=0;s>=p,i[e][1]>>=p,i[e][2]>>=p,i[e][3]=e}(),function(){var e,t,r,n,o,a,u,l;for(u=0,l=0,e=0;e>1,t=u+1;t>1,t=u+1;t<256;t++)S[t]=h}(),function(){for(var e=[],t=new Array(s),r=0;r65535||r>65535)throw"Width/Height invalid.";e[i++]=71,e[i++]=73,e[i++]=70,e[i++]=56,e[i++]=57,e[i++]=97;if(e[i++]=255&t,e[i++]=t>>8&255,e[i++]=255&r,e[i++]=r>>8&255,e[i++]=0|(null!==a?128:0),e[i++]=0,e[i++]=0,null!==o){if(o<0||o>65535)throw"Loop count invalid.";e[i++]=33,e[i++]=255,e[i++]=11,e[i++]=78,e[i++]=69,e[i++]=84,e[i++]=83,e[i++]=67,e[i++]=65,e[i++]=80,e[i++]=69,e[i++]=50,e[i++]=46,e[i++]=48,e[i++]=3,e[i++]=1,e[i++]=255&o,e[i++]=o>>8&255,e[i++]=0}var u=!1;this.addFrame=function(t,r,n,o,l,c){if(!0===u&&(--i,u=!1),c=c===s?{}:c,t<0||r<0||t>65535||r>65535)throw"x/y invalid.";if(n<=0||o<=0||n>65535||o>65535)throw"Width/Height invalid.";if(l.length256||t&t-1)throw"Invalid code/color length, must be power of 2 and 2 .. 256.";return t}(p),d=0;f>>=1;)++d;f=1<3)throw"Disposal out of range.";var v=!1,y=0;if(c.transparent!==s&&null!==c.transparent&&(v=!0,(y=c.transparent)<0||y>=f))throw"Transparent color index.";if((0!==g||v||0!==m)&&(e[i++]=33,e[i++]=249,e[i++]=4,e[i++]=g<<2|(!0===v?1:0),e[i++]=255&m,e[i++]=m>>8&255,e[i++]=y,e[i++]=0),e[i++]=44,e[i++]=255&t,e[i++]=t>>8&255,e[i++]=255&r,e[i++]=r>>8&255,e[i++]=255&n,e[i++]=n>>8&255,e[i++]=255&o,e[i++]=o>>8&255,e[i++]=!0===h?128|d-1:0,!0===h)for(var _=0,b=p.length;_>16&255,e[i++]=x>>8&255,e[i++]=255&x}i=function(e,t,r,n){e[t++]=r;var i=t++,o=1<=r;)e[t++]=255&p,p>>=8,h-=8,t===i+256&&(e[i]=255,i=t++)}function d(e){p|=e<=8;)e[t++]=255&p,p>>=8,h-=8,t===i+256&&(e[i]=255,i=t++);4096===l?(d(o),l=u+1,c=r+1,g={}):(l>=1<0&&arguments[0]!==s?arguments[0]:{}).data;delete a.data,a.pixels=Array.prototype.slice.call(e.pixels),a.palette=Array.prototype.slice.call(e.palette),a.done=!0,a.beingProcessed=!1,t.freeWorker(u),t.onFrameFinished(n)};(a=o[e]).beingProcessed||a.done?this.onFrameFinished():(a.sampleInterval=i,a.beingProcessed=!0,a.gifshot=!0,(u=this.getWorker())?(u.onmessage=l,u.postMessage(a)):l({data:t.workerMethods.run(a)}))},startRendering:function(e){this.onRenderCompleteCallback=e;for(var t=0;t=0&&this.processFrame(e)},generateGIF:function(e,t){var r=[],n={loop:this.repeat},i=this.options,s=i.interval,o=i.frameDuration,a=!!i.images.length,l=i.gifHeight,c=i.gifWidth,h=new y(r,c,l,n),p=this.onRenderProgressCallback,f=a?100*s:0,d=void 0;this.generatingGIF=!0,u.each(e,function(t,r){var n=r.palette;p(.75+.25*r.position*1/e.length);for(var i=0;i0&&arguments[0]!==s?arguments[0]:{},t=this.frames,r=e.data;this.frames.push({data:r,width:e.width,height:e.height,palette:null,dithering:null,done:!1,beingProcessed:!1,position:t.length})},onRenderProgress:function(e){this.onRenderProgressCallback=e},isRendering:function(){return this.generatingGIF},getBase64GIF:function(e){var t=this;t.startRendering(function(r){t.destroyWorkers(),u.requestTimeout(function(){e(r)},0)})},destroyWorkers:function(){if(!this.workerError){var e=this.workers;u.each(e,function(e,t){var r=t.worker,n=t.objectUrl;r.terminate(),u.URL.revokeObjectURL(n)})}}};var x=function(){},w={getGIF:function(){var e=arguments.length>0&&arguments[0]!==s?arguments[0]:{},t=arguments[1];t=u.isFunction(t)?t:x;var r=n.createElement("canvas"),i=void 0,o=!!e.images.length,a=e.cameraStream,l=e.crop,c=e.filter,h=e.fontColor,p=e.fontFamily,f=e.fontWeight,d=e.keepCameraOn,m=(e.numWorkers,e.progressCallback),g=e.saveRenderingContexts,v=e.savedRenderingContexts,y=e.text,_=e.textAlign,w=e.textBaseline,E=e.videoElement,T=e.videoHeight,A=e.videoWidth,S=e.webcamVideoElement,k=Number(e.gifWidth),C=Number(e.gifHeight),I=Number(e.interval),R=(Number(e.sampleInterval),o?0:1e3*I),O=[],L=v.length?v.length:e.numFrames,P=L,M=new b(e),B=u.getFontSize(e),N=e.textXCoordinate?e.textXCoordinate:"left"===_?1:"right"===_?k:k/2,D=e.textYCoordinate?e.textYCoordinate:"top"===w?1:"center"===w?C/2:C,F=f+" "+B+" "+p,j=l?Math.floor(l.scaledWidth/2):0,U=l?A-l.scaledWidth:0,$=l?Math.floor(l.scaledHeight/2):0,V=l?T-l.scaledHeight:0;L=L!==s?L:10,I=I!==s?I:.1,r.width=k,r.height=C,i=r.getContext("2d"),function e(){v.length||0!==E.currentTime?function e(){var r=P-1;function n(){var n;g&&O.push(i.getImageData(0,0,k,C)),y&&(i.font=F,i.fillStyle=h,i.textAlign=_,i.textBaseline=w,i.fillText(y,N,D)),n=i.getImageData(0,0,k,C),M.addFrameImageData(n),m((L-(P=r))/L),r>0&&u.requestTimeout(e,R),P||M.getBase64GIF(function(e){t({error:!1,errorCode:"",errorMsg:"",image:e,cameraStream:a,videoElement:E,webcamVideoElement:S,savedRenderingContexts:O,keepCameraOn:d})})}v.length?(i.putImageData(v[L-P],0,0),n()):function e(){try{U>A&&(U=A),V>T&&(V=T),j<0&&(j=0),$<0&&($=0),i.filter=c,i.drawImage(E,j,$,U,V,0,0,k,C),n()}catch(t){if("NS_ERROR_NOT_AVAILABLE"!==t.name)throw t;u.requestTimeout(e,100)}}()}():u.requestTimeout(e,100)}()},getCropDimensions:function(){var e=arguments.length>0&&arguments[0]!==s?arguments[0]:{},t=e.videoWidth,r=e.videoHeight,n=e.gifWidth,i=e.gifHeight,o={width:0,height:0,scaledWidth:0,scaledHeight:0};return t>r?(o.width=Math.round(t*(i/r))-n,o.scaledWidth=Math.round(o.width*(r/i))):(o.height=Math.round(r*(n/t))-i,o.scaledHeight=Math.round(o.height*(t/n))),o}},E={loadedData:!1,defaultVideoDimensions:{width:640,height:480},findVideoSize:function e(t){e.attempts=e.attempts||0;var r=t.cameraStream,n=t.completedCallback,i=t.videoElement;i&&(i.videoWidth>0&&i.videoHeight>0?(i.removeEventListener("loadeddata",E.findVideoSize),n({videoElement:i,cameraStream:r,videoWidth:i.videoWidth,videoHeight:i.videoHeight})):e.attempts<10?(e.attempts+=1,u.requestTimeout(function(){E.findVideoSize(t)},400)):n({videoElement:i,cameraStream:r,videoWidth:E.defaultVideoDimensions.width,videoHeight:E.defaultVideoDimensions.height}))},onStreamingTimeout:function(e){u.isFunction(e)&&e({error:!0,errorCode:"getUserMedia",errorMsg:"There was an issue with the getUserMedia API - Timed out while trying to start streaming",image:null,cameraStream:{}})},stream:function(e){var t=u.isArray(e.existingVideo)?e.existingVideo[0]:e.existingVideo,r=e.cameraStream,n=e.completedCallback,i=e.streamedCallback,s=e.videoElement;if(u.isFunction(i)&&i(),t){if(u.isString(t))s.src=t,s.innerHTML='';else if(t instanceof Blob){try{s.src=u.URL.createObjectURL(t)}catch(e){}s.innerHTML=''}}else if(s.mozSrcObject)s.mozSrcObject=r;else if(u.URL)try{s.srcObject=r,s.src=u.URL.createObjectURL(r)}catch(e){s.srcObject=r}s.play(),u.requestTimeout(function e(){e.count=e.count||0,!0===E.loadedData?(E.findVideoSize({videoElement:s,cameraStream:r,completedCallback:n}),E.loadedData=!1):(e.count+=1)>10?E.findVideoSize({videoElement:s,cameraStream:r,completedCallback:n}):e()},0)},startStreaming:function(e){var t=u.isFunction(e.error)?e.error:u.noop,r=u.isFunction(e.streamed)?e.streamed:u.noop,i=u.isFunction(e.completed)?e.completed:u.noop,s=e.crossOrigin,o=e.existingVideo,a=e.lastCameraStream,l=e.options,c=e.webcamVideoElement,h=u.isElement(o)?o:c||n.createElement("video");s&&(h.crossOrigin=l.crossOrigin),h.autoplay=!0,h.loop=!0,h.muted=!0,h.addEventListener("loadeddata",function(e){E.loadedData=!0,l.offset&&(h.currentTime=l.offset)}),o?E.stream({videoElement:h,existingVideo:o,completedCallback:i}):a?E.stream({videoElement:h,cameraStream:a,streamedCallback:r,completedCallback:i}):u.getUserMedia({video:!0},function(e){E.stream({videoElement:h,cameraStream:e,streamedCallback:r,completedCallback:i})},t)},startVideoStreaming:function(e){var t=arguments.length>1&&arguments[1]!==s?arguments[1]:{},r=t.timeout!==s?t.timeout:0,n=t.callback,i=t.webcamVideoElement,o=void 0;r>0&&(o=u.requestTimeout(function(){E.onStreamingTimeout(n)},1e4)),E.startStreaming({error:function(){n({error:!0,errorCode:"getUserMedia",errorMsg:"There was an issue with the getUserMedia API - the user probably denied permission",image:null,cameraStream:{}})},streamed:function(){clearTimeout(o)},completed:function(){var t=arguments.length>0&&arguments[0]!==s?arguments[0]:{},r=t.cameraStream,n=t.videoElement,i=t.videoHeight,o=t.videoWidth;e({cameraStream:r,videoElement:n,videoHeight:i,videoWidth:o})},lastCameraStream:t.lastCameraStream,webcamVideoElement:i,crossOrigin:t.crossOrigin,options:t})},stopVideoStreaming:function(e){var t=e=u.isObject(e)?e:{},r=t.keepCameraOn,n=t.videoElement,i=t.webcamVideoElement,s=e.cameraStream||{},o=s.getTracks&&s.getTracks()||[],a=!!o.length,l=o[0];!r&&a&&u.isFunction(l.stop)&&l.stop(),u.isElement(n)&&!i&&(n.pause(),u.isFunction(u.URL.revokeObjectURL)&&!u.webWorkerError&&n.src&&u.URL.revokeObjectURL(n.src),u.removeElement(n))}};function T(e){e=u.isObject(e)?e:{},E.stopVideoStreaming(e)}function A(e,t){var r=e.options||{},i=r.images,s=r.video,o=Number(r.gifWidth),a=Number(r.gifHeight),l=(Number(r.numFrames),e.cameraStream),c=e.videoElement,h=e.videoWidth,p=e.videoHeight,f=w.getCropDimensions({videoWidth:h,videoHeight:p,gifHeight:a,gifWidth:o}),d=t;r.crop=f,r.videoElement=c,r.videoWidth=h,r.videoHeight=p,r.cameraStream=l,u.isElement(c)&&(c.width=o+f.width,c.height=a+f.height,r.webcamVideoElement||(u.setCSSAttr(c,{position:"fixed",opacity:"0"}),n.body.appendChild(c)),c.play(),w.getGIF(r,function(e){i&&i.length||s&&s.length||T(e),d(e)}))}function S(e,t){if(t=u.isFunction(e)?e:t,e=u.isObject(e)?e:{},u.isFunction(t)){var r=u.mergeOptions(f,e)||{},i=e.cameraStream,o=r.images,a=o?o.length:0,l=r.video,h=r.webcamVideoElement;r=u.mergeOptions(r,{gifWidth:Math.floor(r.gifWidth),gifHeight:Math.floor(r.gifHeight)}),a?function(){var e=arguments.length>0&&arguments[0]!==s?arguments[0]:{},t=e.callback,r=e.images,i=e.options,o=e.imagesLength,a=c.validate({getUserMedia:!0,"window.URL":!0}),l=[],h=0,p=void 0,f=void 0;if(a.error)return t(a);function d(){u.each(l,function(e,t){t&&(t.text?f.addFrame(t.img,i,t.text):f.addFrame(t,i))}),function(e,t){e.getBase64GIF(function(e){t({error:!1,errorCode:"",errorMsg:"",image:e})})}(f,t)}f=new b(i),u.each(r,function(e,r){var s=r;r.src&&(s=s.src),u.isElement(s)?(i.crossOrigin&&(s.crossOrigin=i.crossOrigin),l[e]=s,(h+=1)===o&&d()):u.isString(s)&&(p=new Image,i.crossOrigin&&(p.crossOrigin=i.crossOrigin),function(n){r.text&&(n.text=r.text),n.onerror=function(e){var r=void 0;if(0==--o)return(r={}).error="None of the requested images was capable of being retrieved",t(r)},n.onload=function(t){r.text?l[e]={img:n,text:n.text}:l[e]=n,(h+=1)===o&&d(),u.removeElement(n)},n.src=s}(p),u.setCSSAttr(p,{position:"fixed",opacity:"0"}),n.body.appendChild(p))})}({images:o,imagesLength:a,callback:t,options:r}):l?function(){var e=arguments.length>0&&arguments[0]!==s?arguments[0]:{},t=e.callback,r=e.existingVideo,n=e.options,i=c.validate({getUserMedia:!0,"window.URL":!0}),o=void 0,a=void 0;if(i.error)return t(i);if(u.isElement(r)&&r.src){if(a=r.src,o=u.getExtension(a),!u.isSupported.videoCodecs[o])return t(c.messages.videoCodecs)}else u.isArray(r)&&u.each(r,function(e,t){if(o=t instanceof Blob?t.type.substr(t.type.lastIndexOf("/")+1,t.length):t.substr(t.lastIndexOf(".")+1,t.length),u.isSupported.videoCodecs[o])return r=t,!1});E.startStreaming({completed:function(e){e.options=n||{},A(e,t)},existingVideo:r,crossOrigin:n.crossOrigin,options:n})}({existingVideo:l,callback:t,options:r}):function(){var e=arguments.length>0&&arguments[0]!==s?arguments[0]:{},t=e.callback,r=e.lastCameraStream,n=e.options,i=e.webcamVideoElement;if(!m())return t(c.validate());n.savedRenderingContexts.length?w.getGIF(n,function(e){t(e)}):E.startVideoStreaming(function(){var e=arguments.length>0&&arguments[0]!==s?arguments[0]:{};e.options=n||{},A(e,t)},{lastCameraStream:r,callback:t,webcamVideoElement:i,crossOrigin:n.crossOrigin})}({lastCameraStream:i,callback:t,webcamVideoElement:h,options:r})}}var k={utils:l,error:h,defaultOptions:d,createGIF:S,takeSnapShot:function(e,t){if(t=u.isFunction(e)?e:t,e=u.isObject(e)?e:{},u.isFunction(t)){var r=u.mergeOptions(f,e);S(u.mergeOptions(r,{interval:.1,numFrames:1,gifWidth:Math.floor(r.gifWidth),gifHeight:Math.floor(r.gifHeight)}),t)}},stopVideoStreaming:T,isSupported:function(){return c.isValid()},isWebCamGIFSupported:m,isExistingVideoGIFSupported:function(e){var t=!1;if(u.isArray(e)&&e.length){if(u.each(e,function(e,r){u.isSupported.videoCodecs[r]&&(t=!0)}),!t)return!1}else if(u.isString(e)&&e.length&&!u.isSupported.videoCodecs[e])return!1;return c.isValid({getUserMedia:!0})},isExistingImagesGIFSupported:function(){return c.isValid({getUserMedia:!0})},VERSION:"0.4.5"};"function"==typeof define&&define.amd?define([],function(){return k}):void 0!==r?t.exports=k:e.gifshot=k}("undefined"!=typeof window?window:{},"undefined"!=typeof document?document:{createElement:function(){}},"undefined"!=typeof window?window.navigator:{})},{}],124:[function(e,t,r){function n(e,t={}){const{contextName:r="gl",throwGetError:n,useTrackablePrimitives:a,readPixelsFile:u,recording:l=[],variables:c={},onReadPixels:h,onUnrecognizedArgumentLookup:p}=t,f=new Proxy(e,{get:function(t,f){switch(f){case"addComment":return A;case"checkThrowError":return S;case"getReadPixelsVariableName":return g;case"insertVariable":return x;case"reset":return b;case"setIndent":return E;case"toString":return _;case"getContextVariableName":return C}if("function"==typeof e[f])return function(){switch(f){case"getError":return n?l.push(`${y}if (${r}.getError() !== ${r}.NONE) throw new Error('error');`):l.push(`${y}${r}.getError();`),e.getError();case"getExtension":{const t=`${r}Variables${d.length}`;l.push(`${y}const ${t} = ${r}.getExtension('${arguments[0]}');`);const n=e.getExtension(arguments[0]);if(n&&"object"==typeof n){const e=i(n,{getEntity:w,useTrackablePrimitives:a,recording:l,contextName:t,contextVariables:d,variables:c,indent:y,onUnrecognizedArgumentLookup:p});return d.push(e),e}return d.push(null),n}case"readPixels":const t=d.indexOf(arguments[6]);let o;if(-1===t){const e=function(e){if(c)for(const t in c)if(c[t]===e)return t;return null}(arguments[6]);e?(o=e,l.push(`${y}${e}`)):(o=`${r}Variable${d.length}`,d.push(arguments[6]),l.push(`${y}const ${o} = new ${arguments[6].constructor.name}(${arguments[6].length});`))}else o=`${r}Variable${t}`;g=o;const m=[arguments[0],arguments[1],arguments[2],arguments[3],w(arguments[4]),w(arguments[5]),o];return l.push(`${y}${r}.readPixels(${m.join(", ")});`),u&&function(e,t){const n=`${r}Variable${d.length}`,i=`imageDatum${v}`;l.push(`${y}let ${i} = ["P3\\n# ${u}.ppm\\n", ${e}, ' ', ${t}, "\\n255\\n"].join("");`),l.push(`${y}for (let i = 0; i < ${i}.length; i += 4) {`),l.push(`${y} ${i} += ${n}[i] + ' ' + ${n}[i + 1] + ' ' + ${n}[i + 2] + ' ';`),l.push(`${y}}`),l.push(`${y}if (typeof require !== "undefined") {`),l.push(`${y} require('fs').writeFileSync('./${u}.ppm', ${i});`),l.push(`${y}}`),v++}(arguments[2],arguments[3]),h&&h(o,m),e.readPixels.apply(e,arguments);case"drawBuffers":return l.push(`${y}${r}.drawBuffers([${s(arguments[0],{contextName:r,contextVariables:d,getEntity:w,addVariable:T,variables:c,onUnrecognizedArgumentLookup:p})}]);`),e.drawBuffers(arguments[0])}let t=e[f].apply(e,arguments);switch(typeof t){case"undefined":return void l.push(`${y}${k(f,arguments)};`);case"number":case"boolean":if(a&&-1===d.indexOf(o(t))){l.push(`${y}const ${r}Variable${d.length} = ${k(f,arguments)};`),d.push(t=o(t));break}default:null===t?l.push(`${k(f,arguments)};`):l.push(`${y}const ${r}Variable${d.length} = ${k(f,arguments)};`),d.push(t)}return t};return m[e[f]]=f,e[f]}}),d=[],m={};let g,v=0,y="";return f;function _(){return l.join("\n")}function b(){for(;l.length>0;)l.pop()}function x(e,t){c[e]=t}function w(e){const t=m[e];return t?r+"."+t:e}function E(e){y=" ".repeat(e)}function T(e,t){const n=`${r}Variable${d.length}`;return l.push(`${y}const ${n} = ${t};`),d.push(e),n}function A(e){l.push(`${y}// ${e}`)}function S(){l.push(`${y}(() => {\n${y}const error = ${r}.getError();\n${y}if (error !== ${r}.NONE) {\n${y} const names = Object.getOwnPropertyNames(gl);\n${y} for (let i = 0; i < names.length; i++) {\n${y} const name = names[i];\n${y} if (${r}[name] === error) {\n${y} throw new Error('${r} threw ' + name);\n${y} }\n${y} }\n${y}}\n${y}})();`)}function k(e,t){return`${r}.${e}(${s(t,{contextName:r,contextVariables:d,getEntity:w,addVariable:T,variables:c,onUnrecognizedArgumentLookup:p})})`}function C(e){const t=d.indexOf(e);return-1!==t?`${r}Variable${t}`:null}}function i(e,t){const r=new Proxy(e,{get:function(t,r){if("function"==typeof t[r])return function(){switch(r){case"drawBuffersWEBGL":return c.push(`${p}${i}.drawBuffersWEBGL([${s(arguments[0],{contextName:i,contextVariables:a,getEntity:d,addVariable:g,variables:h,onUnrecognizedArgumentLookup:f})}]);`),e.drawBuffersWEBGL(arguments[0])}let t=e[r].apply(e,arguments);switch(typeof t){case"undefined":return void c.push(`${p}${m(r,arguments)};`);case"number":case"boolean":l&&-1===a.indexOf(o(t))?(c.push(`${p}const ${i}Variable${a.length} = ${m(r,arguments)};`),a.push(t=o(t))):(c.push(`${p}const ${i}Variable${a.length} = ${m(r,arguments)};`),a.push(t));break;default:null===t?c.push(`${m(r,arguments)};`):c.push(`${p}const ${i}Variable${a.length} = ${m(r,arguments)};`),a.push(t)}return t};return n[e[r]]=r,e[r]}}),n={},{contextName:i,contextVariables:a,getEntity:u,useTrackablePrimitives:l,recording:c,variables:h,indent:p,onUnrecognizedArgumentLookup:f}=t;return r;function d(e){return n.hasOwnProperty(e)?`${i}.${n[e]}`:u(e)}function m(e,t){return`${i}.${e}(${s(t,{contextName:i,contextVariables:a,getEntity:d,addVariable:g,variables:h,onUnrecognizedArgumentLookup:f})})`}function g(e,t){const r=`${i}Variable${a.length}`;return a.push(e),c.push(`${p}const ${r} = ${t};`),r}}function s(e,t){const{variables:r,onUnrecognizedArgumentLookup:n}=t;return Array.from(e).map(e=>{const i=function(e){if(r)for(const t in r)if(r.hasOwnProperty(t)&&r[t]===e)return t;if(n)return n(e);return null}(e);return i||function(e,t){const{contextName:r,contextVariables:n,getEntity:i,addVariable:s,onUnrecognizedArgumentLookup:o}=t;if(void 0===e)return"undefined";if(null===e)return"null";const a=n.indexOf(e);if(a>-1)return`${r}Variable${a}`;switch(e.constructor.name){case"String":const t=/\n/.test(e),r=/'/.test(e),n=/"/.test(e);return t?"`"+e+"`":r&&!n?'"'+e+'"':"'"+e+"'";case"Number":case"Boolean":return i(e);case"Array":return s(e,`new ${e.constructor.name}([${Array.from(e).join(",")}])`);case"Float32Array":case"Uint8Array":case"Uint16Array":case"Int32Array":return s(e,`new ${e.constructor.name}(${JSON.stringify(Array.from(e))})`);default:if(o){const t=o(e);if(t)return t}throw new Error(`unrecognized argument type ${e.constructor.name}`)}}(e,t)}).join(", ")}function o(e){return new e.constructor(e)}void 0!==t&&(t.exports={glWiretap:n,glExtensionWiretap:i}),"undefined"!=typeof window&&(n.glExtensionWiretap=i,window.glWiretap=n)},{}],125:[function(e,t,r){"undefined"!=typeof WebGLRenderingContext?t.exports=e("./src/javascript/browser-index"):t.exports=e("./src/javascript/node-index")},{"./src/javascript/browser-index":127,"./src/javascript/node-index":141}],126:[function(e,t,r){t.exports={name:"gl",version:"4.9.0",description:"Creates a WebGL context without a window",main:"index.js",directories:{test:"test"},browser:"browser_index.js",engines:{node:">=8.0.0"},scripts:{test:"standard | snazzy && tape test/*.js | faucet",rebuild:"node-gyp rebuild --verbose",prebuild:"prebuild --all --strip",install:"prebuild-install || node-gyp rebuild"},dependencies:{bindings:"^1.5.0","bit-twiddle":"^1.0.2","glsl-tokenizer":"^2.0.2",nan:"^2.14.1","node-abi":"^2.18.0","node-gyp":"^7.1.0","prebuild-install":"^5.3.5"},devDependencies:{"angle-normals":"^1.0.0",bunny:"^1.0.1",faucet:"0.0.1","gl-conformance":"^2.0.9",prebuild:"^10.0.1",snazzy:"^8.0.0",standard:"^14.3.4",tape:"^5.0.1"},repository:{type:"git",url:"git://github.com/stackgl/headless-gl.git"},keywords:["webgl","opengl","gl","headless","server","gpgpu"],author:"Mikola Lysenko",license:"BSD-2-Clause",gypfile:!0}},{}],127:[function(e,t,r){t.exports=function(e,t,r){if(t|=0,!((e|=0)>0&&t>0))return null;const n=document.createElement("canvas");if(!n)return null;let i;n.width=e,n.height=t;try{i=n.getContext("webgl",r)}catch(e){try{i=n.getContext("experimental-webgl",r)}catch(e){return null}}const s=i.getExtension,o={destroy:function(){const e=s.call(i,"WEBGL_lose_context");e&&e.loseContext()}},a={resize:function(e,t){n.width=e,n.height=t}},u=i.getSupportedExtensions().slice();return u.push("STACKGL_destroy_context","STACKGL_resize_drawingbuffer"),i.getSupportedExtensions=function(){return u.slice()},i.getExtension=function(e){const t=e.toLowerCase();return"stackgl_resize_drawingbuffer"===t?a:"stackgl_destroy_context"===t?o:s.call(i,e)},i||null}},{}],128:[function(e,t,r){const{gl:n}=e("../native-gl"),{vertexCount:i}=e("../utils");class s{constructor(e){this.VERTEX_ATTRIB_ARRAY_DIVISOR_ANGLE=35070,this.ctx=e,this._drawArraysInstanced=n._drawArraysInstanced.bind(e),this._drawElementsInstanced=n._drawElementsInstanced.bind(e),this._vertexAttribDivisor=n._vertexAttribDivisor.bind(e)}drawArraysInstancedANGLE(e,t,r,s){const{ctx:o}=this;if(e|=0,r|=0,s|=0,(t|=0)<0||r<0||s<0)return void o.setError(n.INVALID_VALUE);if(!o._checkStencilState())return;const a=i(e,r);if(a<0)return void o.setError(n.INVALID_ENUM);if(!o._framebufferOk())return;if(0===r||0===s)return;let u=t;return r>0&&(u=r+t-1>>>0),this.checkInstancedVertexAttribState(u,s)?this._drawArraysInstanced(e,t,a,s):void 0}drawElementsInstancedANGLE(e,t,r,i,s){const{ctx:o}=this;if(e|=0,r|=0,i|=0,s|=0,(t|=0)<0||i<0||s<0)return void o.setError(n.INVALID_VALUE);if(!o._checkStencilState())return;const a=o._vertexObjectState._elementArrayBufferBinding;if(!a)return void o.setError(n.INVALID_OPERATION);let u=null,l=i;if(r===n.UNSIGNED_SHORT){if(l%2)return void o.setError(n.INVALID_OPERATION);l>>=1,u=new Uint16Array(a._elements.buffer)}else if(o._extensions.oes_element_index_uint&&r===n.UNSIGNED_INT){if(l%4)return void o.setError(n.INVALID_OPERATION);l>>=2,u=new Uint32Array(a._elements.buffer)}else{if(r!==n.UNSIGNED_BYTE)return void o.setError(n.INVALID_ENUM);u=a._elements}let c=t;switch(e){case n.TRIANGLES:t%3&&(c-=t%3);break;case n.LINES:t%2&&(c-=t%2);break;case n.POINTS:break;case n.LINE_LOOP:case n.LINE_STRIP:if(t<2)return void o.setError(n.INVALID_OPERATION);break;case n.TRIANGLE_FAN:case n.TRIANGLE_STRIP:if(t<3)return void o.setError(n.INVALID_OPERATION);break;default:return void o.setError(n.INVALID_ENUM)}if(!o._framebufferOk())return;if(0===t||0===s)return void this.checkInstancedVertexAttribState(0,0);if(t+l>>>0>u.length)return void o.setError(n.INVALID_OPERATION);let h=-1;for(let e=l;e0&&this._drawElementsInstanced(e,c,r,i,s)}vertexAttribDivisorANGLE(e,t){const{ctx:r}=this;e|=0,(t|=0)<0||e<0||e>=r._vertexObjectState._attribs.length?r.setError(n.INVALID_VALUE):(r._vertexObjectState._attribs[e]._divisor=t,this._vertexAttribDivisor(e,t))}checkInstancedVertexAttribState(e,t){const{ctx:r}=this,i=r._activeProgram;if(!i)return r.setError(n.INVALID_OPERATION),!1;const s=r._vertexObjectState._attribs;let o=!1;for(let a=0;a=0){if(!s)return r.setError(n.INVALID_OPERATION),!1;let i=0;if(0===u._divisor?(o=!0,i=u._pointerStride*e+u._pointerSize+u._pointerOffset):i=u._pointerStride*(Math.ceil(t/u._divisor)-1)+u._pointerSize+u._pointerOffset,i>s._size)return r.setError(n.INVALID_OPERATION),!1}}}return!!o||(r.setError(n.INVALID_OPERATION),!1)}}t.exports={ANGLEInstancedArrays:s,getANGLEInstancedArrays:function(e){return new s(e)}}},{"../native-gl":140,"../utils":142}],129:[function(e,t,r){class n{constructor(){this.MIN_EXT=32775,this.MAX_EXT=32776}}t.exports={getEXTBlendMinMax:function(e){let t=null;const r=e.getSupportedExtensions();return r&&r.indexOf("EXT_blend_minmax")>=0&&(t=new n),t},EXTBlendMinMax:n}},{}],130:[function(e,t,r){class n{constructor(){this.TEXTURE_MAX_ANISOTROPY_EXT=34046,this.MAX_TEXTURE_MAX_ANISOTROPY_EXT=34047}}t.exports={getEXTTextureFilterAnisotropic:function(e){let t=null;const r=e.getSupportedExtensions();return r&&r.indexOf("EXT_texture_filter_anisotropic")>=0&&(t=new n),t},EXTTextureFilterAnisotropic:n}},{}],131:[function(e,t,r){class n{}t.exports={getOESElementIndexUint:function(e){let t=null;const r=e.getSupportedExtensions();return r&&r.indexOf("OES_element_index_uint")>=0&&(t=new n),t},OESElementIndexUint:n}},{}],132:[function(e,t,r){class n{constructor(){this.FRAGMENT_SHADER_DERIVATIVE_HINT_OES=35723}}t.exports={getOESStandardDerivatives:function(e){let t=null;const r=e.getSupportedExtensions();return r&&r.indexOf("OES_standard_derivatives")>=0&&(t=new n),t},OESStandardDerivatives:n}},{}],133:[function(e,t,r){class n{}t.exports={getOESTextureFloatLinear:function(e){let t=null;const r=e.getSupportedExtensions();return r&&r.indexOf("OES_texture_float_linear")>=0&&(t=new n),t},OESTextureFloatLinear:n}},{}],134:[function(e,t,r){class n{}t.exports={getOESTextureFloat:function(e){let t=null;const r=e.getSupportedExtensions();return r&&r.indexOf("OES_texture_float")>=0&&(t=new n),t},OESTextureFloat:n}},{}],135:[function(e,t,r){const{Linkable:n}=e("../linkable"),{gl:i}=e("../native-gl"),{checkObject:s}=e("../utils"),{WebGLVertexArrayObjectState:o}=e("../webgl-vertex-attribute");class a extends n{constructor(e,t,r){super(e),this._ctx=t,this._ext=r,this._vertexState=new o(t)}_performDelete(){this._vertexState.cleanUp(),delete this._vertexState,delete this._ext._vaos[this._],i.deleteVertexArrayOES.call(this._ctx,0|this._)}}class u{constructor(e){this.VERTEX_ARRAY_BINDING_OES=34229,this._ctx=e,this._vaos={},this._activeVertexArrayObject=null}createVertexArrayOES(){const{_ctx:e}=this,t=i.createVertexArrayOES.call(e);if(t<=0)return null;const r=new a(t,e,this);return this._vaos[t]=r,r}deleteVertexArrayOES(e){const{_ctx:t}=this;if(!s(e))throw new TypeError("deleteVertexArrayOES(WebGLVertexArrayObjectOES)");e instanceof a&&t._checkOwns(e)?e._pendingDelete||(this._activeVertexArrayObject===e&&this.bindVertexArrayOES(null),e._pendingDelete=!0,e._checkDelete()):t.setError(i.INVALID_OPERATION)}bindVertexArrayOES(e){const{_ctx:t,_activeVertexArrayObject:r}=this;if(!s(e))throw new TypeError("bindVertexArrayOES(WebGLVertexArrayObjectOES)");if(e){if(e instanceof a&&e._pendingDelete)return void t.setError(i.INVALID_OPERATION);if(!t._checkWrapper(e,a))return;i.bindVertexArrayOES.call(t,e._)}else e=null,i.bindVertexArrayOES.call(t,null);r!==e&&(r&&(r._refCount-=1,r._checkDelete()),e&&(e._refCount+=1)),t._vertexObjectState=null===e?t._defaultVertexObjectState:e._vertexState,this._activeVertexArrayObject=e}isVertexArrayOES(e){const{_ctx:t}=this;return!!t._isObject(e,"isVertexArrayOES",a)&&i.isVertexArrayOES.call(t,0|e._)}}t.exports={WebGLVertexArrayObjectOES:a,OESVertexArrayObject:u,getOESVertexArrayObject:function(e){const t=e.getSupportedExtensions();return t&&t.indexOf("OES_vertex_array_object")>=0?new u(e):null}}},{"../linkable":139,"../native-gl":140,"../utils":142,"../webgl-vertex-attribute":156}],136:[function(e,t,r){class n{constructor(e){this.destroy=e.destroy.bind(e)}}t.exports={getSTACKGLDestroyContext:function(e){return new n(e)},STACKGLDestroyContext:n}},{}],137:[function(e,t,r){class n{constructor(e){this.resize=e.resize.bind(e)}}t.exports={getSTACKGLResizeDrawingBuffer:function(e){return new n(e)},STACKGLResizeDrawingBuffer:n}},{}],138:[function(e,t,r){const{gl:n}=e("../native-gl");class i{constructor(e){this.ctx=e;const t=e.getSupportedExtensions();if(t&&t.indexOf("WEBGL_draw_buffers")>=0){Object.assign(this,e.extWEBGL_draw_buffers()),this._buffersState=[e.BACK],this._maxDrawBuffers=e._getParameterDirect(this.MAX_DRAW_BUFFERS_WEBGL),this._ALL_ATTACHMENTS=[],this._ALL_COLOR_ATTACHMENTS=[];const t=[this.COLOR_ATTACHMENT0_WEBGL,this.COLOR_ATTACHMENT1_WEBGL,this.COLOR_ATTACHMENT2_WEBGL,this.COLOR_ATTACHMENT3_WEBGL,this.COLOR_ATTACHMENT4_WEBGL,this.COLOR_ATTACHMENT5_WEBGL,this.COLOR_ATTACHMENT6_WEBGL,this.COLOR_ATTACHMENT7_WEBGL,this.COLOR_ATTACHMENT8_WEBGL,this.COLOR_ATTACHMENT9_WEBGL,this.COLOR_ATTACHMENT10_WEBGL,this.COLOR_ATTACHMENT11_WEBGL,this.COLOR_ATTACHMENT12_WEBGL,this.COLOR_ATTACHMENT13_WEBGL,this.COLOR_ATTACHMENT14_WEBGL,this.COLOR_ATTACHMENT15_WEBGL];for(;this._ALL_ATTACHMENTS.length1)return void t.setError(n.INVALID_OPERATION);for(let r=0;rn.NONE)return void t.setError(n.INVALID_OPERATION)}this._buffersState=e,t.drawBuffersWEBGL(e)}}}t.exports={getWebGLDrawBuffers:function(e){const t=e.getSupportedExtensions();return t&&t.indexOf("WEBGL_draw_buffers")>=0?new i(e):null},WebGLDrawBuffers:i}},{"../native-gl":140}],139:[function(e,t,r){t.exports={Linkable:class{constructor(e){this._=e,this._references=[],this._refCount=0,this._pendingDelete=!1,this._binding=0}_link(e){return this._references.push(e),e._refCount+=1,!0}_unlink(e){let t=this._references.indexOf(e);if(t<0)return!1;for(;t>=0;)this._references[t]=this._references[this._references.length-1],this._references.pop(),e._refCount-=1,e._checkDelete(),t=this._references.indexOf(e);return!0}_linked(e){return this._references.indexOf(e)>=0}_checkDelete(){if(this._refCount<=0&&this._pendingDelete&&0!==this._){for(;this._references.length>0;)this._unlink(this._references[0]);this._performDelete(),this._=0}}_performDelete(){}}}},{}],140:[function(e,t,r){(function(r){const n=e("bindings")("webgl"),{WebGLRenderingContext:i}=n;r.on("exit",n.cleanup);const s=i.prototype;delete s["1.0.0"],delete i["1.0.0"],t.exports={gl:s,NativeWebGL:n,NativeWebGLRenderingContext:i}}).call(this,e("_process"))},{_process:452,bindings:31}],141:[function(e,t,r){const n=e("bit-twiddle"),{WebGLContextAttributes:i}=e("./webgl-context-attributes"),{WebGLRenderingContext:s,wrapContext:o}=e("./webgl-rendering-context"),{WebGLTextureUnit:a}=e("./webgl-texture-unit"),{WebGLVertexArrayObjectState:u,WebGLVertexArrayGlobalState:l}=e("./webgl-vertex-attribute");let c=0;function h(e,t,r){return e&&"object"==typeof e&&t in e?!!e[t]:r}t.exports=function(e,t,r){if(t|=0,!((e|=0)>0&&t>0))return null;const p=new i(h(r,"alpha",!0),h(r,"depth",!0),h(r,"stencil",!1),!1,h(r,"premultipliedAlpha",!0),h(r,"preserveDrawingBuffer",!1),h(r,"preferLowPowerToHighPerformance",!1),h(r,"failIfMajorPerformanceCaveat",!1));let f;p.premultipliedAlpha=p.premultipliedAlpha&&p.alpha;try{f=new s(1,1,p.alpha,p.depth,p.stencil,p.antialias,p.premultipliedAlpha,p.preserveDrawingBuffer,p.preferLowPowerToHighPerformance,p.failIfMajorPerformanceCaveat)}catch(e){}if(!f)return null;f.drawingBufferWidth=e,f.drawingBufferHeight=t,f._=c++,f._contextAttributes=p,f._extensions={},f._programs={},f._shaders={},f._buffers={},f._textures={},f._framebuffers={},f._renderbuffers={},f._activeProgram=null,f._activeFramebuffer=null,f._activeRenderbuffer=null,f._checkStencil=!1,f._stencilState=!0;const d=f.getParameter(f.MAX_COMBINED_TEXTURE_IMAGE_UNITS);f._textureUnits=new Array(d);for(let e=0;ethis._maxTextureSize||r>this._maxTextureSize||n>this._maxTextureLevel)return this.setError(o.INVALID_VALUE),!1}else{if(!this._validCubeTarget(e))return this.setError(o.INVALID_ENUM),!1;if(t>this._maxCubeMapSize||r>this._maxCubeMapSize||n>this._maxCubeMapLevel)return this.setError(o.INVALID_VALUE),!1}return!0}_checkLocation(e){return e instanceof G?e._program._ctx===this&&e._linkCount===e._program._linkCount||(this.setError(o.INVALID_OPERATION),!1):(this.setError(o.INVALID_VALUE),!1)}_checkLocationActive(e){return!!e&&(!!this._checkLocation(e)&&(e._program===this._activeProgram||(this.setError(o.INVALID_OPERATION),!1)))}_checkOwns(e){return"object"==typeof e&&e._ctx===this}_checkShaderSource(e){const t=e._source,r=i(t);let n=!1;const s=[];for(let e=0;e=0){let t=0;if((t=i._divisor?i._pointerSize+i._pointerOffset:i._pointerStride*e+i._pointerSize+i._pointerOffset)>r._size)return this.setError(o.INVALID_OPERATION),!1}}}return!0}_checkVertexIndex(e){return!(e<0||e>=this._vertexObjectState._attribs.length)||(this.setError(o.INVALID_VALUE),!1)}_computePixelSize(e,t){const r=E(t);if(0===r)return this.setError(o.INVALID_ENUM),0;switch(e){case o.UNSIGNED_BYTE:return r;case o.UNSIGNED_SHORT_5_6_5:if(t!==o.RGB){this.setError(o.INVALID_OPERATION);break}return 2;case o.UNSIGNED_SHORT_4_4_4_4:case o.UNSIGNED_SHORT_5_5_5_1:if(t!==o.RGBA){this.setError(o.INVALID_OPERATION);break}return 2;case o.FLOAT:return 1}return this.setError(o.INVALID_ENUM),0}_computeRowStride(e,t){let r=e*t;return r%this._unpackAlignment&&(r+=this._unpackAlignment-r%this._unpackAlignment),r}_fixupLink(e){if(!super.getProgramParameter(e._,o.LINK_STATUS))return e._linkInfoLog=super.getProgramInfoLog(e),!1;const t=this.getProgramParameter(e,o.ACTIVE_ATTRIBUTES),r=new Array(t);e._attributes.length=t;for(let n=0;nW)return e._linkInfoLog="attribute "+r[t]+" is too long",!1;for(let n=0;nz)return e._linkInfoLog="uniform "+e._uniforms[t].name+" is too long",!1;return e._linkInfoLog="",!0}_framebufferOk(){const e=this._activeFramebuffer;return!e||this._preCheckFramebufferStatus(e)===o.FRAMEBUFFER_COMPLETE||(this.setError(o.INVALID_FRAMEBUFFER_OPERATION),!1)}_getActiveBuffer(e){return e===o.ARRAY_BUFFER?this._vertexGlobalState._arrayBufferBinding:e===o.ELEMENT_ARRAY_BUFFER?this._vertexObjectState._elementArrayBufferBinding:null}_getActiveTextureUnit(){return this._textureUnits[this._activeTextureUnit]}_getActiveTexture(e){const t=this._getActiveTextureUnit();return e===o.TEXTURE_2D?t._bind2D:e===o.TEXTURE_CUBE_MAP?t._bindCube:null}_getAttachments(){return this._extensions.webgl_draw_buffers?this._extensions.webgl_draw_buffers._ALL_ATTACHMENTS:H}_getColorAttachments(){return this._extensions.webgl_draw_buffers?this._extensions.webgl_draw_buffers._ALL_COLOR_ATTACHMENTS:K}_getParameterDirect(e){return super.getParameter(e)}_getTexImage(e){const t=this._getActiveTextureUnit();return e===o.TEXTURE_2D?t._bind2D:P(e)?t._bindCube:(this.setError(o.INVALID_ENUM),null)}_preCheckFramebufferStatus(e){const t=e._attachments,r=[],n=[],i=t[o.DEPTH_ATTACHMENT],s=t[o.DEPTH_STENCIL_ATTACHMENT],a=t[o.STENCIL_ATTACHMENT];if(s&&(a||i)||a&&i)return o.FRAMEBUFFER_UNSUPPORTED;const u=this._getColorAttachments();let l=0;for(const e in t)t[e]&&-1!==u.indexOf(1*e)&&l++;if(0===l)return o.FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT;if(s instanceof V)return o.FRAMEBUFFER_UNSUPPORTED;if(s instanceof j){if(s._format!==o.DEPTH_STENCIL)return o.FRAMEBUFFER_INCOMPLETE_ATTACHMENT;r.push(s._width),n.push(s._height)}if(i instanceof V)return o.FRAMEBUFFER_UNSUPPORTED;if(i instanceof j){if(i._format!==o.DEPTH_COMPONENT16)return o.FRAMEBUFFER_INCOMPLETE_ATTACHMENT;r.push(i._width),n.push(i._height)}if(a instanceof V)return o.FRAMEBUFFER_UNSUPPORTED;if(a instanceof j){if(a._format!==o.STENCIL_INDEX8)return o.FRAMEBUFFER_INCOMPLETE_ATTACHMENT;r.push(a._width),n.push(a._height)}let c=!1;for(let i=0;i256)}_validTextureTarget(e){return e===o.TEXTURE_2D||e===o.TEXTURE_CUBE_MAP}_verifyTextureCompleteness(e,t,r){const n=this._getActiveTextureUnit();let i=null;if(e===o.TEXTURE_2D?i=n._bind2D:this._validCubeTarget(e)&&(i=n._bindCube),this._extensions.oes_texture_float&&!this._extensions.oes_texture_float_linear&&i&&i._type===o.FLOAT&&(t===o.TEXTURE_MAG_FILTER||t===o.TEXTURE_MIN_FILTER)&&(r===o.LINEAR||r===o.LINEAR_MIPMAP_NEAREST||r===o.NEAREST_MIPMAP_LINEAR||r===o.LINEAR_MIPMAP_LINEAR))return i._complete=!1,void this.bindTexture(e,i);i&&!1===i._complete&&(i._complete=!0,this.bindTexture(e,i))}_wrapShader(e,t){return!this._extensions.oes_standard_derivatives&&/#ifdef\s+GL_OES_standard_derivatives/.test(t)&&(t="#undef GL_OES_standard_derivatives\n"+t),this._extensions.webgl_draw_buffers?t:"#define gl_MaxDrawBuffers 1\n"+t}_beginAttrib0Hack(){super.bindBuffer(o.ARRAY_BUFFER,this._attrib0Buffer._),super.bufferData(o.ARRAY_BUFFER,this._vertexGlobalState._attribs[0]._data,o.STREAM_DRAW),super.enableVertexAttribArray(0),super.vertexAttribPointer(0,4,o.FLOAT,!1,0,0),super._vertexAttribDivisor(0,1)}_endAttrib0Hack(){const e=this._vertexObjectState._attribs[0];e._pointerBuffer?super.bindBuffer(o.ARRAY_BUFFER,e._pointerBuffer._):super.bindBuffer(o.ARRAY_BUFFER,0),super.vertexAttribPointer(0,e._inputSize,e._pointerType,e._pointerNormal,e._inputStride,e._pointerOffset),super._vertexAttribDivisor(0,e._divisor),super.disableVertexAttribArray(0),this._vertexGlobalState._arrayBufferBinding?super.bindBuffer(o.ARRAY_BUFFER,this._vertexGlobalState._arrayBufferBinding._):super.bindBuffer(o.ARRAY_BUFFER,0)}activeTexture(e){const t=(e|=0)-o.TEXTURE0;if(t>=0&&tW)this.setError(o.INVALID_VALUE);else if(/^_?webgl_a/.test(r))this.setError(o.INVALID_OPERATION);else if(this._checkWrapper(e,F))return super.bindAttribLocation(0|e._,0|t,r)}bindFramebuffer(e,t){if(!x(t))throw new TypeError("bindFramebuffer(GLenum, WebGLFramebuffer)");if(e!==o.FRAMEBUFFER)return void this.setError(o.INVALID_ENUM);if(t){if(t._pendingDelete)return;if(!this._checkWrapper(t,B))return;super.bindFramebuffer(o.FRAMEBUFFER,0|t._)}else super.bindFramebuffer(o.FRAMEBUFFER,this._drawingBuffer._framebuffer);const r=this._activeFramebuffer;r!==t&&(r&&(r._refCount-=1,r._checkDelete()),t&&(t._refCount+=1)),this._activeFramebuffer=t,t&&this._updateFramebufferAttachments(t)}bindBuffer(e,t){if(e|=0,!x(t))throw new TypeError("bindBuffer(GLenum, WebGLBuffer)");if(e===o.ARRAY_BUFFER||e===o.ELEMENT_ARRAY_BUFFER){if(t){if(t._pendingDelete)return;if(!this._checkWrapper(t,N))return;if(t._binding&&t._binding!==e)return void this.setError(o.INVALID_OPERATION);t._binding=0|e,super.bindBuffer(e,0|t._)}else t=null,super.bindBuffer(e,0);e===o.ARRAY_BUFFER?this._vertexGlobalState.setArrayBuffer(t):this._vertexObjectState.setElementArrayBuffer(t)}else this.setError(o.INVALID_ENUM)}bindRenderbuffer(e,t){if(!x(t))throw new TypeError("bindRenderbuffer(GLenum, WebGLRenderbuffer)");if(e!==o.RENDERBUFFER)return void this.setError(o.INVALID_ENUM);if(t){if(t._pendingDelete)return;if(!this._checkWrapper(t,j))return;super.bindRenderbuffer(0|e,0|t._)}else super.bindRenderbuffer(0|e,0);const r=this._activeRenderbuffer;r!==t&&(r&&(r._refCount-=1,r._checkDelete()),t&&(t._refCount+=1)),this._activeRenderbuffer=t}bindTexture(e,t){if(e|=0,!x(t))throw new TypeError("bindTexture(GLenum, WebGLTexture)");if(!this._validTextureTarget(e))return void this.setError(o.INVALID_ENUM);let r=0;if(t){if(t instanceof V&&t._pendingDelete)return;if(!this._checkWrapper(t,V))return;if(t._binding&&t._binding!==e)return void this.setError(o.INVALID_OPERATION);t._binding=e,t._complete&&(r=0|t._)}else t=null;this._saveError(),super.bindTexture(e,r);const n=this.getError();if(this._restoreError(n),n!==o.NO_ERROR)return;const i=this._getActiveTextureUnit(),s=this._getActiveTexture(e);s!==t&&(s&&(s._refCount-=1,s._checkDelete()),t&&(t._refCount+=1)),e===o.TEXTURE_2D?i._bind2D=t:e===o.TEXTURE_CUBE_MAP&&(i._bindCube=t)}blendColor(e,t,r,n){return super.blendColor(+e,+t,+r,+n)}blendEquation(e){if(e|=0,this._validBlendMode(e))return super.blendEquation(e);this.setError(o.INVALID_ENUM)}blendEquationSeparate(e,t){if(e|=0,t|=0,this._validBlendMode(e)&&this._validBlendMode(t))return super.blendEquationSeparate(e,t);this.setError(o.INVALID_ENUM)}createBuffer(){const e=super.createBuffer();if(e<=0)return null;const t=new N(e,this);return this._buffers[e]=t,t}createFramebuffer(){const e=super.createFramebuffer();if(e<=0)return null;const t=new B(e,this);return this._framebuffers[e]=t,t}createProgram(){const e=super.createProgram();if(e<=0)return null;const t=new F(e,this);return this._programs[e]=t,t}createRenderbuffer(){const e=super.createRenderbuffer();if(e<=0)return null;const t=new j(e,this);return this._renderbuffers[e]=t,t}createTexture(){const e=super.createTexture();if(e<=0)return null;const t=new V(e,this);return this._textures[e]=t,t}getContextAttributes(){return this._contextAttributes}getExtension(e){const t=e.toLowerCase();if(t in this._extensions)return this._extensions[t];const r=q[t]?q[t](this):null;return r&&(this._extensions[t]=r),r}getSupportedExtensions(){const e=["ANGLE_instanced_arrays","STACKGL_resize_drawingbuffer","STACKGL_destroy_context"],t=super.getSupportedExtensions();return t.indexOf("GL_OES_element_index_uint")>=0&&e.push("OES_element_index_uint"),t.indexOf("GL_OES_standard_derivatives")>=0&&e.push("OES_standard_derivatives"),t.indexOf("GL_OES_texture_float")>=0&&e.push("OES_texture_float"),t.indexOf("GL_OES_texture_float_linear")>=0&&e.push("OES_texture_float_linear"),t.indexOf("EXT_draw_buffers")>=0&&e.push("WEBGL_draw_buffers"),t.indexOf("EXT_blend_minmax")>=0&&e.push("EXT_blend_minmax"),t.indexOf("EXT_texture_filter_anisotropic")>=0&&e.push("EXT_texture_filter_anisotropic"),t.indexOf("GL_OES_vertex_array_object")>=0&&e.push("OES_vertex_array_object"),e}setError(e){u.setError.call(this,0|e)}blendFunc(e,t){e|=0,t|=0,this._validBlendFunc(e)&&this._validBlendFunc(t)?this._isConstantBlendFunc(e)&&this._isConstantBlendFunc(t)?this.setError(o.INVALID_OPERATION):super.blendFunc(e,t):this.setError(o.INVALID_ENUM)}blendFuncSeparate(e,t,r,n){e|=0,t|=0,r|=0,n|=0,this._validBlendFunc(e)&&this._validBlendFunc(t)&&this._validBlendFunc(r)&&this._validBlendFunc(n)?this._isConstantBlendFunc(e)&&this._isConstantBlendFunc(t)||this._isConstantBlendFunc(r)&&this._isConstantBlendFunc(n)?this.setError(o.INVALID_OPERATION):super.blendFuncSeparate(e,t,r,n):this.setError(o.INVALID_ENUM)}bufferData(e,t,r){if(e|=0,(r|=0)!==o.STREAM_DRAW&&r!==o.STATIC_DRAW&&r!==o.DYNAMIC_DRAW)return void this.setError(o.INVALID_ENUM);if(e!==o.ARRAY_BUFFER&&e!==o.ELEMENT_ARRAY_BUFFER)return void this.setError(o.INVALID_ENUM);const n=this._getActiveBuffer(e);if(n)if("object"==typeof t){let i=null;if(I(t))i=R(t);else{if(!(t instanceof ArrayBuffer))return void this.setError(o.INVALID_VALUE);i=new Uint8Array(t)}this._saveError(),super.bufferData(e,i,r);const s=this.getError();if(this._restoreError(s),s!==o.NO_ERROR)return;n._size=i.length,e===o.ELEMENT_ARRAY_BUFFER&&(n._elements=new Uint8Array(i))}else if("number"==typeof t){const i=0|t;if(i<0)return void this.setError(o.INVALID_VALUE);this._saveError(),super.bufferData(e,i,r);const s=this.getError();if(this._restoreError(s),s!==o.NO_ERROR)return;n._size=i,e===o.ELEMENT_ARRAY_BUFFER&&(n._elements=new Uint8Array(i))}else this.setError(o.INVALID_VALUE);else this.setError(o.INVALID_OPERATION)}bufferSubData(e,t,r){if(t|=0,(e|=0)!==o.ARRAY_BUFFER&&e!==o.ELEMENT_ARRAY_BUFFER)return void this.setError(o.INVALID_ENUM);if(null===r)return;if(!r||"object"!=typeof r)return void this.setError(o.INVALID_VALUE);const n=this._getActiveBuffer(e);if(!n)return void this.setError(o.INVALID_OPERATION);if(t<0||t>=n._size)return void this.setError(o.INVALID_VALUE);let i=null;if(I(r))i=R(r);else{if(!(r instanceof ArrayBuffer))return void this.setError(o.INVALID_VALUE);i=new Uint8Array(r)}t+i.length>n._size?this.setError(o.INVALID_VALUE):(e===o.ELEMENT_ARRAY_BUFFER&&n._elements.set(i,t),super.bufferSubData(e,t,i))}checkFramebufferStatus(e){if(e!==o.FRAMEBUFFER)return this.setError(o.INVALID_ENUM),0;const t=this._activeFramebuffer;return t?this._preCheckFramebufferStatus(t):o.FRAMEBUFFER_COMPLETE}clear(e){if(this._framebufferOk())return super.clear(0|e)}clearColor(e,t,r,n){return super.clearColor(+e,+t,+r,+n)}clearDepth(e){return super.clearDepth(+e)}clearStencil(e){return this._checkStencil=!1,super.clearStencil(0|e)}colorMask(e,t,r,n){return super.colorMask(!!e,!!t,!!r,!!n)}compileShader(e){if(!x(e))throw new TypeError("compileShader(WebGLShader)");if(this._checkWrapper(e,U)&&this._checkShaderSource(e)){const t=this.getError();super.compileShader(0|e._);const r=this.getError();e._compileStatus=!!super.getShaderParameter(0|e._,o.COMPILE_STATUS),e._compileInfo=super.getShaderInfoLog(0|e._),this.getError(),this.setError(t||r)}}copyTexImage2D(e,t,r,i,s,a,u,l){e|=0,t|=0,r|=0,i|=0,s|=0,a|=0,u|=0,l|=0;const c=this._getTexImage(e);if(!c)return void this.setError(o.INVALID_OPERATION);if(r!==o.RGBA&&r!==o.RGB&&r!==o.ALPHA&&r!==o.LUMINANCE&&r!==o.LUMINANCE_ALPHA)return void this.setError(o.INVALID_ENUM);if(t<0||a<0||u<0||0!==l)return void this.setError(o.INVALID_VALUE);if(t>0&&(!n.isPow2(a)||!n.isPow2(u)))return void this.setError(o.INVALID_VALUE);this._saveError(),super.copyTexImage2D(e,t,r,i,s,a,u,l);const h=this.getError();this._restoreError(h),h===o.NO_ERROR&&(c._levelWidth[t]=a,c._levelHeight[t]=u,c._format=o.RGBA,c._type=o.UNSIGNED_BYTE)}copyTexSubImage2D(e,t,r,n,i,s,a,u){e|=0,t|=0,r|=0,n|=0,i|=0,s|=0,a|=0,u|=0,this._getTexImage(e)?a<0||u<0||r<0||n<0||t<0?this.setError(o.INVALID_VALUE):super.copyTexSubImage2D(e,t,r,n,i,s,a,u):this.setError(o.INVALID_OPERATION)}cullFace(e){return super.cullFace(0|e)}createShader(e){if((e|=0)!==o.FRAGMENT_SHADER&&e!==o.VERTEX_SHADER)return this.setError(o.INVALID_ENUM),null;const t=super.createShader(e);if(t<0)return null;const r=new U(t,this,e);return this._shaders[t]=r,r}deleteProgram(e){return this._deleteLinkable("deleteProgram",e,F)}deleteShader(e){return this._deleteLinkable("deleteShader",e,U)}_deleteLinkable(e,t,r){if(!x(t))throw new TypeError(e+"("+r.name+")");if(t instanceof r&&this._checkOwns(t))return t._pendingDelete=!0,void t._checkDelete();this.setError(o.INVALID_OPERATION)}deleteBuffer(e){if(!x(e)||null!==e&&!(e instanceof N))throw new TypeError("deleteBuffer(WebGLBuffer)");e instanceof N&&this._checkOwns(e)?(this._vertexGlobalState._arrayBufferBinding===e&&this.bindBuffer(o.ARRAY_BUFFER,null),this._vertexObjectState._elementArrayBufferBinding===e&&this.bindBuffer(o.ELEMENT_ARRAY_BUFFER,null),this._vertexObjectState===this._defaultVertexObjectState&&this._vertexObjectState.releaseArrayBuffer(e),e._pendingDelete=!0,e._checkDelete()):this.setError(o.INVALID_OPERATION)}deleteFramebuffer(e){if(!x(e))throw new TypeError("deleteFramebuffer(WebGLFramebuffer)");e instanceof B&&this._checkOwns(e)?(this._activeFramebuffer===e&&this.bindFramebuffer(o.FRAMEBUFFER,null),e._pendingDelete=!0,e._checkDelete()):this.setError(o.INVALID_OPERATION)}deleteRenderbuffer(e){if(!x(e))throw new TypeError("deleteRenderbuffer(WebGLRenderbuffer)");if(!(e instanceof j&&this._checkOwns(e)))return void this.setError(o.INVALID_OPERATION);this._activeRenderbuffer===e&&this.bindRenderbuffer(o.RENDERBUFFER,null);const t=this._activeFramebuffer;this._tryDetachFramebuffer(t,e),e._pendingDelete=!0,e._checkDelete()}deleteTexture(e){if(!x(e))throw new TypeError("deleteTexture(WebGLTexture)");if(!(e instanceof V))return;if(!this._checkOwns(e))return void this.setError(o.INVALID_OPERATION);const t=this._activeTextureUnit;for(let t=0;t=this._vertexObjectState._attribs.length?this.setError(o.INVALID_VALUE):(super.disableVertexAttribArray(e),this._vertexObjectState._attribs[e]._isPointer=!1)}drawArrays(e,t,r){if(e|=0,r|=0,(t|=0)<0||r<0)return void this.setError(o.INVALID_VALUE);if(!this._checkStencilState())return;const n=C(e,r);if(n<0)return void this.setError(o.INVALID_ENUM);if(!this._framebufferOk())return;if(0===r)return;let i=t;if(r>0&&(i=r+t-1>>>0),this._checkVertexAttribState(i)){if(this._vertexObjectState._attribs[0]._isPointer||this._extensions.webgl_draw_buffers&&this._extensions.webgl_draw_buffers._buffersState&&this._extensions.webgl_draw_buffers._buffersState.length>0)return super.drawArrays(e,t,n);this._beginAttrib0Hack(),super._drawArraysInstanced(e,t,n,1),this._endAttrib0Hack()}}drawElements(e,t,r,n){if(e|=0,r|=0,n|=0,(t|=0)<0||n<0)return void this.setError(o.INVALID_VALUE);if(!this._checkStencilState())return;const i=this._vertexObjectState._elementArrayBufferBinding;if(!i)return void this.setError(o.INVALID_OPERATION);let s=null,a=n;if(r===o.UNSIGNED_SHORT){if(a%2)return void this.setError(o.INVALID_OPERATION);a>>=1,s=new Uint16Array(i._elements.buffer)}else if(this._extensions.oes_element_index_uint&&r===o.UNSIGNED_INT){if(a%4)return void this.setError(o.INVALID_OPERATION);a>>=2,s=new Uint32Array(i._elements.buffer)}else{if(r!==o.UNSIGNED_BYTE)return void this.setError(o.INVALID_ENUM);s=i._elements}let u=t;switch(e){case o.TRIANGLES:t%3&&(u-=t%3);break;case o.LINES:t%2&&(u-=t%2);break;case o.POINTS:break;case o.LINE_LOOP:case o.LINE_STRIP:if(t<2)return void this.setError(o.INVALID_OPERATION);break;case o.TRIANGLE_FAN:case o.TRIANGLE_STRIP:if(t<3)return void this.setError(o.INVALID_OPERATION);break;default:return void this.setError(o.INVALID_ENUM)}if(!this._framebufferOk())return;if(0===t)return void this._checkVertexAttribState(0);if(t+a>>>0>s.length)return void this.setError(o.INVALID_OPERATION);let l=-1;for(let e=a;e0){if(this._vertexObjectState._attribs[0]._isPointer)return super.drawElements(e,u,r,n);this._beginAttrib0Hack(),super._drawElementsInstanced(e,u,r,n,1),this._endAttrib0Hack()}}enable(e){e|=0,super.enable(e)}enableVertexAttribArray(e){(e|=0)<0||e>=this._vertexObjectState._attribs.length?this.setError(o.INVALID_VALUE):(super.enableVertexAttribArray(e),this._vertexObjectState._attribs[e]._isPointer=!0)}finish(){return super.finish()}flush(){return super.flush()}framebufferRenderbuffer(e,t,r,n){if(e|=0,t|=0,r|=0,!x(n))throw new TypeError("framebufferRenderbuffer(GLenum, GLenum, GLenum, WebGLRenderbuffer)");if(e!==o.FRAMEBUFFER||!this._validFramebufferAttachment(t)||r!==o.RENDERBUFFER)return void this.setError(o.INVALID_ENUM);const i=this._activeFramebuffer;i?n&&!this._checkWrapper(n,j)||(i._setAttachment(n,t),this._updateFramebufferAttachments(i)):this.setError(o.INVALID_OPERATION)}framebufferTexture2D(e,t,r,n,i){if(e|=0,t|=0,r|=0,i|=0,!x(n))throw new TypeError("framebufferTexture2D(GLenum, GLenum, GLenum, WebGLTexture, GLint)");if(e!==o.FRAMEBUFFER||!this._validFramebufferAttachment(t))return void this.setError(o.INVALID_ENUM);if(0!==i)return void this.setError(o.INVALID_VALUE);if(n&&!this._checkWrapper(n,V))return;if(r===o.TEXTURE_2D){if(n&&n._binding!==o.TEXTURE_2D)return void this.setError(o.INVALID_OPERATION)}else{if(!this._validCubeTarget(r))return void this.setError(o.INVALID_ENUM);if(n&&n._binding!==o.TEXTURE_CUBE_MAP)return void this.setError(o.INVALID_OPERATION)}const s=this._activeFramebuffer;s?(s._attachmentLevel[t]=i,s._attachmentFace[t]=r,s._setAttachment(n,t),this._updateFramebufferAttachments(s)):this.setError(o.INVALID_OPERATION)}frontFace(e){return super.frontFace(0|e)}generateMipmap(e){return 0|super.generateMipmap(0|e)}getActiveAttrib(e,t){if(!x(e))throw new TypeError("getActiveAttrib(WebGLProgram)");if(e){if(this._checkWrapper(e,F)){const r=super.getActiveAttrib(0|e._,0|t);if(r)return new M(r)}}else this.setError(o.INVALID_VALUE);return null}getActiveUniform(e,t){if(!x(e))throw new TypeError("getActiveUniform(WebGLProgram, GLint)");if(e){if(this._checkWrapper(e,F)){const r=super.getActiveUniform(0|e._,0|t);if(r)return new M(r)}}else this.setError(o.INVALID_VALUE);return null}getAttachedShaders(e){if(!x(e)||"object"==typeof e&&null!==e&&!(e instanceof F))throw new TypeError("getAttachedShaders(WebGLProgram)");if(e){if(this._checkWrapper(e,F)){const t=super.getAttachedShaders(0|e._);if(!t)return null;const r=new Array(t.length);for(let e=0;eW)this.setError(o.INVALID_VALUE);else if(this._checkWrapper(e,F))return super.getAttribLocation(0|e._,t+"");return-1}getParameter(e){switch(e|=0){case o.ARRAY_BUFFER_BINDING:return this._vertexGlobalState._arrayBufferBinding;case o.ELEMENT_ARRAY_BUFFER_BINDING:return this._vertexObjectState._elementArrayBufferBinding;case o.CURRENT_PROGRAM:return this._activeProgram;case o.FRAMEBUFFER_BINDING:return this._activeFramebuffer;case o.RENDERBUFFER_BINDING:return this._activeRenderbuffer;case o.TEXTURE_BINDING_2D:return this._getActiveTextureUnit()._bind2D;case o.TEXTURE_BINDING_CUBE_MAP:return this._getActiveTextureUnit()._bindCube;case o.VERSION:return"WebGL 1.0 stack-gl "+s;case o.VENDOR:return"stack-gl";case o.RENDERER:return"ANGLE";case o.SHADING_LANGUAGE_VERSION:return"WebGL GLSL ES 1.0 stack-gl";case o.COMPRESSED_TEXTURE_FORMATS:return new Uint32Array(0);case o.MAX_VIEWPORT_DIMS:case o.SCISSOR_BOX:case o.VIEWPORT:return new Int32Array(super.getParameter(e));case o.ALIASED_LINE_WIDTH_RANGE:case o.ALIASED_POINT_SIZE_RANGE:case o.DEPTH_RANGE:case o.BLEND_COLOR:case o.COLOR_CLEAR_VALUE:return new Float32Array(super.getParameter(e));case o.COLOR_WRITEMASK:return super.getParameter(e);case o.DEPTH_CLEAR_VALUE:case o.LINE_WIDTH:case o.POLYGON_OFFSET_FACTOR:case o.POLYGON_OFFSET_UNITS:case o.SAMPLE_COVERAGE_VALUE:return+super.getParameter(e);case o.BLEND:case o.CULL_FACE:case o.DEPTH_TEST:case o.DEPTH_WRITEMASK:case o.DITHER:case o.POLYGON_OFFSET_FILL:case o.SAMPLE_COVERAGE_INVERT:case o.SCISSOR_TEST:case o.STENCIL_TEST:case o.UNPACK_FLIP_Y_WEBGL:case o.UNPACK_PREMULTIPLY_ALPHA_WEBGL:return!!super.getParameter(e);case o.ACTIVE_TEXTURE:case o.ALPHA_BITS:case o.BLEND_DST_ALPHA:case o.BLEND_DST_RGB:case o.BLEND_EQUATION_ALPHA:case o.BLEND_EQUATION_RGB:case o.BLEND_SRC_ALPHA:case o.BLEND_SRC_RGB:case o.BLUE_BITS:case o.CULL_FACE_MODE:case o.DEPTH_BITS:case o.DEPTH_FUNC:case o.FRONT_FACE:case o.GENERATE_MIPMAP_HINT:case o.GREEN_BITS:case o.MAX_COMBINED_TEXTURE_IMAGE_UNITS:case o.MAX_CUBE_MAP_TEXTURE_SIZE:case o.MAX_FRAGMENT_UNIFORM_VECTORS:case o.MAX_RENDERBUFFER_SIZE:case o.MAX_TEXTURE_IMAGE_UNITS:case o.MAX_TEXTURE_SIZE:case o.MAX_VARYING_VECTORS:case o.MAX_VERTEX_ATTRIBS:case o.MAX_VERTEX_TEXTURE_IMAGE_UNITS:case o.MAX_VERTEX_UNIFORM_VECTORS:case o.PACK_ALIGNMENT:case o.RED_BITS:case o.SAMPLE_BUFFERS:case o.SAMPLES:case o.STENCIL_BACK_FAIL:case o.STENCIL_BACK_FUNC:case o.STENCIL_BACK_PASS_DEPTH_FAIL:case o.STENCIL_BACK_PASS_DEPTH_PASS:case o.STENCIL_BACK_REF:case o.STENCIL_BACK_VALUE_MASK:case o.STENCIL_BACK_WRITEMASK:case o.STENCIL_BITS:case o.STENCIL_CLEAR_VALUE:case o.STENCIL_FAIL:case o.STENCIL_FUNC:case o.STENCIL_PASS_DEPTH_FAIL:case o.STENCIL_PASS_DEPTH_PASS:case o.STENCIL_REF:case o.STENCIL_VALUE_MASK:case o.STENCIL_WRITEMASK:case o.SUBPIXEL_BITS:case o.UNPACK_ALIGNMENT:case o.UNPACK_COLORSPACE_CONVERSION_WEBGL:return 0|super.getParameter(e);case o.IMPLEMENTATION_COLOR_READ_FORMAT:case o.IMPLEMENTATION_COLOR_READ_TYPE:return super.getParameter(e);default:if(this._extensions.webgl_draw_buffers){const t=this._extensions.webgl_draw_buffers;switch(e){case t.DRAW_BUFFER0_WEBGL:case t.DRAW_BUFFER1_WEBGL:case t.DRAW_BUFFER2_WEBGL:case t.DRAW_BUFFER3_WEBGL:case t.DRAW_BUFFER4_WEBGL:case t.DRAW_BUFFER5_WEBGL:case t.DRAW_BUFFER6_WEBGL:case t.DRAW_BUFFER7_WEBGL:case t.DRAW_BUFFER8_WEBGL:case t.DRAW_BUFFER9_WEBGL:case t.DRAW_BUFFER10_WEBGL:case t.DRAW_BUFFER11_WEBGL:case t.DRAW_BUFFER12_WEBGL:case t.DRAW_BUFFER13_WEBGL:case t.DRAW_BUFFER14_WEBGL:case t.DRAW_BUFFER15_WEBGL:return 1===t._buffersState.length&&t._buffersState[0]===o.BACK?o.BACK:super.getParameter(e);case t.MAX_DRAW_BUFFERS_WEBGL:case t.MAX_COLOR_ATTACHMENTS_WEBGL:return super.getParameter(e)}}return this._extensions.oes_standard_derivatives&&e===this._extensions.oes_standard_derivatives.FRAGMENT_SHADER_DERIVATIVE_HINT_OES?super.getParameter(e):this._extensions.ext_texture_filter_anisotropic&&e===this._extensions.ext_texture_filter_anisotropic.MAX_TEXTURE_MAX_ANISOTROPY_EXT?super.getParameter(e):this._extensions.oes_vertex_array_object&&e===this._extensions.oes_vertex_array_object.VERTEX_ARRAY_BINDING_OES?this._extensions.oes_vertex_array_object._activeVertexArrayObject:(this.setError(o.INVALID_ENUM),null)}}getShaderPrecisionFormat(e,t){if(t|=0,(e|=0)!==o.FRAGMENT_SHADER&&e!==o.VERTEX_SHADER||t!==o.LOW_FLOAT&&t!==o.MEDIUM_FLOAT&&t!==o.HIGH_FLOAT&&t!==o.LOW_INT&&t!==o.MEDIUM_INT&&t!==o.HIGH_INT)return void this.setError(o.INVALID_ENUM);const r=super.getShaderPrecisionFormat(e,t);return r?new $(r):null}getBufferParameter(e,t){if(t|=0,(e|=0)!==o.ARRAY_BUFFER&&e!==o.ELEMENT_ARRAY_BUFFER)return this.setError(o.INVALID_ENUM),null;switch(t){case o.BUFFER_SIZE:case o.BUFFER_USAGE:return super.getBufferParameter(0|e,0|t);default:return this.setError(o.INVALID_ENUM),null}}getError(){return super.getError()}getFramebufferAttachmentParameter(e,t,r){if(t|=0,r|=0,(e|=0)!==o.FRAMEBUFFER||!this._validFramebufferAttachment(t))return this.setError(o.INVALID_ENUM),null;const n=this._activeFramebuffer;if(!n)return this.setError(o.INVALID_OPERATION),null;const i=n._attachments[t];if(null===i){if(r===o.FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE)return o.NONE}else if(i instanceof V)switch(r){case o.FRAMEBUFFER_ATTACHMENT_OBJECT_NAME:return i;case o.FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE:return o.TEXTURE;case o.FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL:return n._attachmentLevel[t];case o.FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE:{const e=n._attachmentFace[t];return e===o.TEXTURE_2D?0:e}}else if(i instanceof j)switch(r){case o.FRAMEBUFFER_ATTACHMENT_OBJECT_NAME:return i;case o.FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE:return o.RENDERBUFFER}return this.setError(o.INVALID_ENUM),null}getProgramParameter(e,t){if(t|=0,!x(e))throw new TypeError("getProgramParameter(WebGLProgram, GLenum)");if(this._checkWrapper(e,F)){switch(t){case o.DELETE_STATUS:return e._pendingDelete;case o.LINK_STATUS:return e._linkStatus;case o.VALIDATE_STATUS:return!!super.getProgramParameter(e._,t);case o.ATTACHED_SHADERS:case o.ACTIVE_ATTRIBUTES:case o.ACTIVE_UNIFORMS:return super.getProgramParameter(e._,t)}this.setError(o.INVALID_ENUM)}return null}getProgramInfoLog(e){if(!x(e))throw new TypeError("getProgramInfoLog(WebGLProgram)");return this._checkWrapper(e,F)?e._linkInfoLog:null}getRenderbufferParameter(e,t){if(t|=0,(e|=0)!==o.RENDERBUFFER)return this.setError(o.INVALID_ENUM),null;const r=this._activeRenderbuffer;if(!r)return this.setError(o.INVALID_OPERATION),null;switch(t){case o.RENDERBUFFER_INTERNAL_FORMAT:return r._format;case o.RENDERBUFFER_WIDTH:return r._width;case o.RENDERBUFFER_HEIGHT:return r._height;case o.RENDERBUFFER_SIZE:case o.RENDERBUFFER_RED_SIZE:case o.RENDERBUFFER_GREEN_SIZE:case o.RENDERBUFFER_BLUE_SIZE:case o.RENDERBUFFER_ALPHA_SIZE:case o.RENDERBUFFER_DEPTH_SIZE:case o.RENDERBUFFER_STENCIL_SIZE:return super.getRenderbufferParameter(e,t)}return this.setError(o.INVALID_ENUM),null}getShaderParameter(e,t){if(t|=0,!x(e))throw new TypeError("getShaderParameter(WebGLShader, GLenum)");if(this._checkWrapper(e,U)){switch(t){case o.DELETE_STATUS:return e._pendingDelete;case o.COMPILE_STATUS:return e._compileStatus;case o.SHADER_TYPE:return e._type}this.setError(o.INVALID_ENUM)}return null}getShaderInfoLog(e){if(!x(e))throw new TypeError("getShaderInfoLog(WebGLShader)");return this._checkWrapper(e,U)?e._compileInfo:null}getShaderSource(e){if(!x(e))throw new TypeError("Input to getShaderSource must be an object");return this._checkWrapper(e,U)?e._source:null}getTexParameter(e,t){if(e|=0,t|=0,!this._checkTextureTarget(e))return null;const r=this._getActiveTextureUnit();if(e===o.TEXTURE_2D&&!r._bind2D||e===o.TEXTURE_CUBE_MAP&&!r._bindCube)return this.setError(o.INVALID_OPERATION),null;switch(t){case o.TEXTURE_MAG_FILTER:case o.TEXTURE_MIN_FILTER:case o.TEXTURE_WRAP_S:case o.TEXTURE_WRAP_T:return super.getTexParameter(e,t)}return this._extensions.ext_texture_filter_anisotropic&&t===this._extensions.ext_texture_filter_anisotropic.TEXTURE_MAX_ANISOTROPY_EXT?super.getTexParameter(e,t):(this.setError(o.INVALID_ENUM),null)}getUniform(e,t){if(!x(e)||!x(t))throw new TypeError("getUniform(WebGLProgram, WebGLUniformLocation)");if(!e)return this.setError(o.INVALID_VALUE),null;if(!t)return null;if(this._checkWrapper(e,F)){if(!w(e,t))return this.setError(o.INVALID_OPERATION),null;const r=super.getUniform(0|e._,0|t._);if(!r)return null;switch(t._activeInfo.type){case o.FLOAT:return r[0];case o.FLOAT_VEC2:return new Float32Array(r.slice(0,2));case o.FLOAT_VEC3:return new Float32Array(r.slice(0,3));case o.FLOAT_VEC4:return new Float32Array(r.slice(0,4));case o.INT:return 0|r[0];case o.INT_VEC2:return new Int32Array(r.slice(0,2));case o.INT_VEC3:return new Int32Array(r.slice(0,3));case o.INT_VEC4:return new Int32Array(r.slice(0,4));case o.BOOL:return!!r[0];case o.BOOL_VEC2:return[!!r[0],!!r[1]];case o.BOOL_VEC3:return[!!r[0],!!r[1],!!r[2]];case o.BOOL_VEC4:return[!!r[0],!!r[1],!!r[2],!!r[3]];case o.FLOAT_MAT2:return new Float32Array(r.slice(0,4));case o.FLOAT_MAT3:return new Float32Array(r.slice(0,9));case o.FLOAT_MAT4:return new Float32Array(r.slice(0,16));case o.SAMPLER_2D:case o.SAMPLER_CUBE:return 0|r[0];default:return null}}return null}getUniformLocation(e,t){if(!x(e))throw new TypeError("getUniformLocation(WebGLProgram, String)");if(T(t+="")){if(this._checkWrapper(e,F)){const r=super.getUniformLocation(0|e._,t);if(r>=0){let n=t;/\[\d+\]$/.test(t)&&(n=t.replace(/\[\d+\]$/,"[0]"));let i=null;for(let t=0;t=i.size)return null}return s}}return null}this.setError(o.INVALID_VALUE)}getVertexAttrib(e,t){if(t|=0,(e|=0)<0||e>=this._vertexObjectState._attribs.length)return this.setError(o.INVALID_VALUE),null;const r=this._vertexObjectState._attribs[e],n=this._vertexGlobalState._attribs[e]._data,i=this._extensions.angle_instanced_arrays;if(i&&t===i.VERTEX_ATTRIB_ARRAY_DIVISOR_ANGLE)return r._divisor;switch(t){case o.VERTEX_ATTRIB_ARRAY_BUFFER_BINDING:return r._pointerBuffer;case o.VERTEX_ATTRIB_ARRAY_ENABLED:return r._isPointer;case o.VERTEX_ATTRIB_ARRAY_SIZE:return r._inputSize;case o.VERTEX_ATTRIB_ARRAY_STRIDE:return r._inputStride;case o.VERTEX_ATTRIB_ARRAY_TYPE:return r._pointerType;case o.VERTEX_ATTRIB_ARRAY_NORMALIZED:return r._pointerNormal;case o.CURRENT_VERTEX_ATTRIB:return new Float32Array(n);default:return this.setError(o.INVALID_ENUM),null}}getVertexAttribOffset(e,t){return t|=0,(e|=0)<0||e>=this._vertexObjectState._attribs.length?(this.setError(o.INVALID_VALUE),null):t===o.VERTEX_ATTRIB_ARRAY_POINTER?this._vertexObjectState._attribs[e]._pointerOffset:(this.setError(o.INVALID_ENUM),null)}hint(e,t){if(t|=0,(e|=0)===o.GENERATE_MIPMAP_HINT||this._extensions.oes_standard_derivatives&&e===this._extensions.oes_standard_derivatives.FRAGMENT_SHADER_DERIVATIVE_HINT_OES){if(t===o.FASTEST||t===o.NICEST||t===o.DONT_CARE)return super.hint(e,t);this.setError(o.INVALID_ENUM)}else this.setError(o.INVALID_ENUM)}isBuffer(e){return!!this._isObject(e,"isBuffer",N)&&super.isBuffer(0|e._)}isFramebuffer(e){return!!this._isObject(e,"isFramebuffer",B)&&super.isFramebuffer(0|e._)}isProgram(e){return!!this._isObject(e,"isProgram",F)&&super.isProgram(0|e._)}isRenderbuffer(e){return!!this._isObject(e,"isRenderbuffer",j)&&super.isRenderbuffer(0|e._)}isShader(e){return!!this._isObject(e,"isShader",U)&&super.isShader(0|e._)}isTexture(e){return!!this._isObject(e,"isTexture",V)&&super.isTexture(0|e._)}isEnabled(e){return super.isEnabled(0|e)}lineWidth(e){if(!isNaN(e))return super.lineWidth(+e);this.setError(o.INVALID_VALUE)}linkProgram(e){if(!x(e))throw new TypeError("linkProgram(WebGLProgram)");if(this._checkWrapper(e,F)){e._linkCount+=1,e._attributes=[];const t=this.getError();super.linkProgram(0|e._);const r=this.getError();r===o.NO_ERROR&&(e._linkStatus=this._fixupLink(e)),this.getError(),this.setError(t||r)}}pixelStorei(e,t){if(t|=0,(e|=0)===o.UNPACK_ALIGNMENT){if(1!==t&&2!==t&&4!==t&&8!==t)return void this.setError(o.INVALID_VALUE);this._unpackAlignment=t}else if(e===o.PACK_ALIGNMENT){if(1!==t&&2!==t&&4!==t&&8!==t)return void this.setError(o.INVALID_VALUE);this._packAlignment=t}else if(e===o.UNPACK_COLORSPACE_CONVERSION_WEBGL&&t!==o.NONE&&t!==o.BROWSER_DEFAULT_WEBGL)return void this.setError(o.INVALID_VALUE);return super.pixelStorei(e,t)}polygonOffset(e,t){return super.polygonOffset(+e,+t)}readPixels(e,t,r,n,i,s,a){if(e|=0,t|=0,r|=0,n|=0,this._extensions.oes_texture_float&&s===o.FLOAT&&i===o.RGBA);else{if(i===o.RGB||i===o.ALPHA||s!==o.UNSIGNED_BYTE)return void this.setError(o.INVALID_OPERATION);if(i!==o.RGBA)return void this.setError(o.INVALID_ENUM);if(r<0||n<0||!(a instanceof Uint8Array))return void this.setError(o.INVALID_VALUE)}if(!this._framebufferOk())return;let u=4*r;u%this._packAlignment!=0&&(u+=this._packAlignment-u%this._packAlignment);const l=u*(n-1)+4*r;if(l<=0)return;if(a.length=c||e+r<=0||t>=h||t+n<=0)for(let e=0;ec||t<0||t+n>h){for(let e=0;ec&&(a=c-o);let l=t,f=n;t<0&&(f+=t,l=0),l+n>h&&(f=h-l);let d=4*a;if(d%this._packAlignment!=0&&(d+=this._packAlignment-d%this._packAlignment),a>0&&f>0){const r=new Uint8Array(d*f);super.readPixels(o,l,a,f,i,s,r);const n=4*(o-e)+(l-t)*u;for(let e=0;e0&&t>0))throw new Error("Invalid surface dimensions");e===this.drawingBufferWidth&&t===this.drawingBufferHeight||(this._resizeDrawingBuffer(e,t),this.drawingBufferWidth=e,this.drawingBufferHeight=t)}sampleCoverage(e,t){return super.sampleCoverage(+e,!!t)}scissor(e,t,r,n){return super.scissor(0|e,0|t,0|r,0|n)}shaderSource(e,t){if(!x(e))throw new TypeError("shaderSource(WebGLShader, String)");e&&(t||"string"==typeof t)&&T(t+="")?this._checkWrapper(e,U)&&(super.shaderSource(0|e._,this._wrapShader(e._type,t)),e._source=t):this.setError(o.INVALID_VALUE)}stencilFunc(e,t,r){return this._checkStencil=!0,super.stencilFunc(0|e,0|t,0|r)}stencilFuncSeparate(e,t,r,n){return this._checkStencil=!0,super.stencilFuncSeparate(0|e,0|t,0|r,0|n)}stencilMask(e){return this._checkStencil=!0,super.stencilMask(0|e)}stencilMaskSeparate(e,t){return this._checkStencil=!0,super.stencilMaskSeparate(0|e,0|t)}stencilOp(e,t,r){return this._checkStencil=!0,super.stencilOp(0|e,0|t,0|r)}stencilOpSeparate(e,t,r,n){return this._checkStencil=!0,super.stencilOpSeparate(0|e,0|t,0|r,0|n)}texImage2D(e,t,r,n,i,s,a,u,l){if(6===arguments.length){if(u=i,a=n,null==(l=k(l=s)))throw new TypeError("texImage2D(GLenum, GLint, GLenum, GLint, GLenum, GLenum, ImageData | HTMLImageElement | HTMLCanvasElement | HTMLVideoElement)");n=l.width,i=l.height,l=l.data}if(e|=0,t|=0,r|=0,n|=0,i|=0,s|=0,a|=0,u|=0,"object"!=typeof l&&void 0!==l)throw new TypeError("texImage2D(GLenum, GLint, GLenum, GLint, GLint, GLint, GLenum, GLenum, Uint8Array)");if(!L(a)||!L(r))return void this.setError(o.INVALID_ENUM);if(u===o.FLOAT&&!this._extensions.oes_texture_float)return void this.setError(o.INVALID_ENUM);const c=this._getTexImage(e);if(!c||a!==r)return void this.setError(o.INVALID_OPERATION);const h=this._computePixelSize(u,a);if(0===h)return;if(!this._checkDimensions(e,n,i,t))return;const p=O(l),f=this._computeRowStride(n,h)*i;if(p&&p.length=this._vertexObjectState._attribs.length||1!==t&&2!==t&&3!==t&&4!==t)return void this.setError(o.INVALID_VALUE);if(null===this._vertexGlobalState._arrayBufferBinding)return void this.setError(o.INVALID_OPERATION);const a=A(r);0!==a&&r!==o.INT&&r!==o.UNSIGNED_INT?i>255||i<0?this.setError(o.INVALID_VALUE):i%a==0&&s%a==0?(super.vertexAttribPointer(e,t,r,n,i,s),this._vertexObjectState.setVertexAttribPointer(this._vertexGlobalState._arrayBufferBinding,e,t*a,s,i||t*a,r,n,i,t)):this.setError(o.INVALID_OPERATION):this.setError(o.INVALID_ENUM)}viewport(e,t,r,n){return super.viewport(0|e,0|t,0|r,0|n)}_allocateDrawingBuffer(e,t){this._drawingBuffer=new D(super.createFramebuffer(),super.createTexture(),super.createRenderbuffer()),this._resizeDrawingBuffer(e,t)}isContextLost(){return!1}compressedTexImage2D(){}compressedTexSubImage2D(){}_checkUniformValid(e,t,r,n,i){if(!x(e))throw new TypeError(`${r}(WebGLUniformLocation, ...)`);if(!e)return!1;if(this._checkLocationActive(e)){const r=e._activeInfo.type;if(r===o.SAMPLER_2D||r===o.SAMPLER_CUBE){if(1!==n)return void this.setError(o.INVALID_VALUE);if("i"!==i)return void this.setError(o.INVALID_OPERATION);if(t<0||t>=this._textureUnits.length)return this.setError(o.INVALID_VALUE),!1}return!(S(r)>n)||(this.setError(o.INVALID_OPERATION),!1)}return!1}_checkUniformValueValid(e,t,r,n,i){if(!x(e)||!x(t))throw new TypeError(`${r}v(WebGLUniformLocation, Array)`);if(!e)return!1;if(!this._checkLocationActive(e))return!1;if("object"!=typeof t||!t||"number"!=typeof t.length)throw new TypeError(`Second argument to ${r} must be array`);return S(e._activeInfo.type)>n?(this.setError(o.INVALID_OPERATION),!1):t.length>=n&&t.length%n==0?!!e._array||(t.length===n||(this.setError(o.INVALID_OPERATION),!1)):(this.setError(o.INVALID_VALUE),!1)}uniform1f(e,t){this._checkUniformValid(e,t,"uniform1f",1,"f")&&super.uniform1f(0|e._,t)}uniform1fv(e,t){if(this._checkUniformValueValid(e,t,"uniform1fv",1,"f"))if(e._array){const r=e._array;for(let e=0;ee.drawingBufferWidth,set(t){e.drawingBufferWidth=t}},drawingBufferHeight:{get:()=>e.drawingBufferHeight,set(t){e.drawingBufferHeight=t}}}),t}}},{"../../package.json":126,"./extensions/angle-instanced-arrays":128,"./extensions/ext-blend-minmax":129,"./extensions/ext-texture-filter-anisotropic":130,"./extensions/oes-element-index-unit":131,"./extensions/oes-standard-derivatives":132,"./extensions/oes-texture-float":134,"./extensions/oes-texture-float-linear":133,"./extensions/oes-vertex-array-object":135,"./extensions/stackgl-destroy-context":136,"./extensions/stackgl-resize-drawing-buffer":137,"./extensions/webgl-draw-buffers":138,"./native-gl":140,"./utils":142,"./webgl-active-info":143,"./webgl-buffer":144,"./webgl-drawing-buffer-wrapper":146,"./webgl-framebuffer":147,"./webgl-program":148,"./webgl-renderbuffer":149,"./webgl-shader":152,"./webgl-shader-precision-format":151,"./webgl-texture":154,"./webgl-uniform-location":155,"bit-twiddle":32,"glsl-tokenizer/string":170}],151:[function(e,t,r){t.exports={WebGLShaderPrecisionFormat:class{constructor(e){this.rangeMin=e.rangeMin,this.rangeMax=e.rangeMax,this.precision=e.precision}}}},{}],152:[function(e,t,r){const{gl:n}=e("./native-gl"),{Linkable:i}=e("./linkable");t.exports={WebGLShader:class extends i{constructor(e,t,r){super(e),this._type=r,this._ctx=t,this._source="",this._compileStatus=!1,this._compileInfo=""}_performDelete(){const e=this._ctx;delete e._shaders[0|this._],n.deleteShader.call(e,0|this._)}}}},{"./linkable":139,"./native-gl":140}],153:[function(e,t,r){t.exports={WebGLTextureUnit:class{constructor(e,t){this._ctx=e,this._idx=t,this._mode=0,this._bind2D=null,this._bindCube=null}}}},{}],154:[function(e,t,r){const{Linkable:n}=e("./linkable"),{gl:i}=e("./native-gl");t.exports={WebGLTexture:class extends n{constructor(e,t){super(e),this._ctx=t,this._binding=0,this._levelWidth=new Int32Array(32),this._levelHeight=new Int32Array(32),this._format=0,this._type=0,this._complete=!0}_performDelete(){const e=this._ctx;delete e._textures[0|this._],i.deleteTexture.call(e,0|this._)}}}},{"./linkable":139,"./native-gl":140}],155:[function(e,t,r){t.exports={WebGLUniformLocation:class{constructor(e,t,r){this._=e,this._program=t,this._linkCount=t._linkCount,this._activeInfo=r,this._array=null}}}},{}],156:[function(e,t,r){const{gl:n}=e("./native-gl"),{WebGLBuffer:i}=e("./webgl-buffer");class s{constructor(e,t){this._ctx=e,this._idx=t,this._clear()}_clear(){this._isPointer=!1,this._pointerBuffer=null,this._pointerOffset=0,this._pointerSize=0,this._pointerStride=0,this._pointerType=n.FLOAT,this._pointerNormal=!1,this._divisor=0,this._inputSize=4,this._inputStride=0}}class o{constructor(e){this._idx=e,this._data=new Float32Array([0,0,0,1])}}t.exports={WebGLVertexArrayObjectAttribute:s,WebGLVertexArrayGlobalAttribute:o,WebGLVertexArrayObjectState:class{constructor(e){const t=e.getParameter(e.MAX_VERTEX_ATTRIBS);this._attribs=new Array(t);for(let r=0;rt;t++)o.call(this,F.denoise,{exponent:Math.max(0,e),texSize:[this.width,this.height]});return this}function _(t,r){return F.brightnessContrast=F.brightnessContrast||new $(null,"uniform sampler2D texture;uniform float brightness;uniform float contrast;varying vec2 texCoord;void main(){vec4 color=texture2D(texture,texCoord);color.rgb+=brightness;if(contrast>0.0){color.rgb=(color.rgb-0.5)/(1.0-contrast)+0.5;}else{color.rgb=(color.rgb-0.5)*(1.0+contrast)+0.5;}gl_FragColor=color;}"),o.call(this,F.brightnessContrast,{brightness:e(-1,t,1),contrast:e(-1,r,1)}),this}function b(t){t=new f(t);for(var r=[],n=0;256>n;n++)r.push(e(0,Math.floor(256*t.interpolate(n/255)),255));return r}function x(e,t,r){e=b(e),1==arguments.length?t=r=e:(t=b(t),r=b(r));for(var n=[],i=0;256>i;i++)n.splice(n.length,0,e[i],t[i],r[i],255);return this._.extraTexture.initFromBytes(256,1,n),this._.extraTexture.use(1),F.curves=F.curves||new $(null,"uniform sampler2D texture;uniform sampler2D map;varying vec2 texCoord;void main(){vec4 color=texture2D(texture,texCoord);color.r=texture2D(map,vec2(color.r)).r;color.g=texture2D(map,vec2(color.g)).g;color.b=texture2D(map,vec2(color.b)).b;gl_FragColor=color;}"),F.curves.textures({map:1}),o.call(this,F.curves,{}),this}function w(e,t){return F.unsharpMask=F.unsharpMask||new $(null,"uniform sampler2D blurredTexture;uniform sampler2D originalTexture;uniform float strength;uniform float threshold;varying vec2 texCoord;void main(){vec4 blurred=texture2D(blurredTexture,texCoord);vec4 original=texture2D(originalTexture,texCoord);gl_FragColor=mix(blurred,original,1.0+strength);}"),this._.extraTexture.ensureFormat(this._.texture),this._.texture.use(),this._.extraTexture.drawTo(function(){$.getDefaultShader().drawRect()}),this._.extraTexture.use(1),this.triangleBlur(e),F.unsharpMask.textures({originalTexture:1}),o.call(this,F.unsharpMask,{strength:t}),this._.extraTexture.unuse(1),this}function E(t){return F.sepia=F.sepia||new $(null,"uniform sampler2D texture;uniform float amount;varying vec2 texCoord;void main(){vec4 color=texture2D(texture,texCoord);float r=color.r;float g=color.g;float b=color.b;color.r=min(1.0,(r*(1.0-(0.607*amount)))+(g*(0.769*amount))+(b*(0.189*amount)));color.g=min(1.0,(r*0.349*amount)+(g*(1.0-(0.314*amount)))+(b*0.168*amount));color.b=min(1.0,(r*0.272*amount)+(g*0.534*amount)+(b*(1.0-(0.869*amount))));gl_FragColor=color;}"),o.call(this,F.sepia,{amount:e(0,t,1)}),this}function T(t,r){return F.hueSaturation=F.hueSaturation||new $(null,"uniform sampler2D texture;uniform float hue;uniform float saturation;varying vec2 texCoord;void main(){vec4 color=texture2D(texture,texCoord);float angle=hue*3.14159265;float s=sin(angle),c=cos(angle);vec3 weights=(vec3(2.0*c,-sqrt(3.0)*s-c,sqrt(3.0)*s-c)+1.0)/3.0;float len=length(color.rgb);color.rgb=vec3(dot(color.rgb,weights.xyz),dot(color.rgb,weights.zxy),dot(color.rgb,weights.yzx));float average=(color.r+color.g+color.b)/3.0;if(saturation>0.0){color.rgb+=(average-color.rgb)*(1.0-1.0/(1.001-saturation));}else{color.rgb+=(average-color.rgb)*(-saturation);}gl_FragColor=color;}"),o.call(this,F.hueSaturation,{hue:e(-1,t,1),saturation:e(-1,r,1)}),this}function A(e,t,r){return F.zoomBlur=F.zoomBlur||new $(null,"uniform sampler2D texture;uniform vec2 center;uniform float strength;uniform vec2 texSize;varying vec2 texCoord;"+V+"void main(){vec4 color=vec4(0.0);float total=0.0;vec2 toCenter=center-texCoord*texSize;float offset=random(vec3(12.9898,78.233,151.7182),0.0);for(float t=0.0;t<=40.0;t++){float percent=(t+offset)/40.0;float weight=4.0*(percent-percent*percent);vec4 sample=texture2D(texture,texCoord+toCenter*percent*strength/texSize);sample.rgb*=sample.a;color+=sample*weight;total+=weight;}gl_FragColor=color/total;gl_FragColor.rgb/=gl_FragColor.a+0.00001;}"),o.call(this,F.zoomBlur,{center:[e,t],strength:r,texSize:[this.width,this.height]}),this}function S(e,t,r,n,i,s){F.tiltShift=F.tiltShift||new $(null,"uniform sampler2D texture;uniform float blurRadius;uniform float gradientRadius;uniform vec2 start;uniform vec2 end;uniform vec2 delta;uniform vec2 texSize;varying vec2 texCoord;"+V+"void main(){vec4 color=vec4(0.0);float total=0.0;float offset=random(vec3(12.9898,78.233,151.7182),0.0);vec2 normal=normalize(vec2(start.y-end.y,end.x-start.x));float radius=smoothstep(0.0,1.0,abs(dot(texCoord*texSize-start,normal))/gradientRadius)*blurRadius;for(float t=-30.0;t<=30.0;t++){float percent=(t+offset-0.5)/30.0;float weight=1.0-abs(percent);vec4 sample=texture2D(texture,texCoord+delta/texSize*percent*radius);sample.rgb*=sample.a;color+=sample*weight;total+=weight;}gl_FragColor=color/total;gl_FragColor.rgb/=gl_FragColor.a+0.00001;}");var a=r-e,u=n-t,l=Math.sqrt(a*a+u*u);return o.call(this,F.tiltShift,{blurRadius:i,gradientRadius:s,start:[e,t],end:[r,n],delta:[a/l,u/l],texSize:[this.width,this.height]}),o.call(this,F.tiltShift,{blurRadius:i,gradientRadius:s,start:[e,t],end:[r,n],delta:[-u/l,a/l],texSize:[this.width,this.height]}),this}function k(t,r,n){F.lensBlurPrePass=F.lensBlurPrePass||new $(null,"uniform sampler2D texture;uniform float power;varying vec2 texCoord;void main(){vec4 color=texture2D(texture,texCoord);color=pow(color,vec4(power));gl_FragColor=vec4(color);}");var i="uniform sampler2D texture0;uniform sampler2D texture1;uniform vec2 delta0;uniform vec2 delta1;uniform float power;varying vec2 texCoord;"+V+"vec4 sample(vec2 delta){float offset=random(vec3(delta,151.7182),0.0);vec4 color=vec4(0.0);float total=0.0;for(float t=0.0;t<=30.0;t++){float percent=(t+offset)/30.0;color+=texture2D(texture0,texCoord+delta*percent);total+=1.0;}return color/total;}";F.lensBlur0=F.lensBlur0||new $(null,i+"void main(){gl_FragColor=sample(delta0);}"),F.lensBlur1=F.lensBlur1||new $(null,i+"void main(){gl_FragColor=(sample(delta0)+sample(delta1))*0.5;}"),F.lensBlur2=F.lensBlur2||new $(null,i+"void main(){vec4 color=(sample(delta0)+2.0*texture2D(texture1,texCoord))/3.0;gl_FragColor=pow(color,vec4(power));}").textures({texture1:1});i=[];for(var s=0;3>s;s++){var a=n+2*s*Math.PI/3;i.push([t*Math.sin(a)/this.width,t*Math.cos(a)/this.height])}return t=Math.pow(10,e(-1,r,1)),o.call(this,F.lensBlurPrePass,{power:t}),this._.extraTexture.ensureFormat(this._.texture),o.call(this,F.lensBlur0,{delta0:i[0]},this._.texture,this._.extraTexture),o.call(this,F.lensBlur1,{delta0:i[1],delta1:i[2]},this._.extraTexture,this._.extraTexture),o.call(this,F.lensBlur0,{delta0:i[1]}),this._.extraTexture.use(1),o.call(this,F.lensBlur2,{power:1/t,delta0:i[2]}),this}function C(e){return F.triangleBlur=F.triangleBlur||new $(null,"uniform sampler2D texture;uniform vec2 delta;varying vec2 texCoord;"+V+"void main(){vec4 color=vec4(0.0);float total=0.0;float offset=random(vec3(12.9898,78.233,151.7182),0.0);for(float t=-30.0;t<=30.0;t++){float percent=(t+offset-0.5)/30.0;float weight=1.0-abs(percent);vec4 sample=texture2D(texture,texCoord+delta*percent);sample.rgb*=sample.a;color+=sample*weight;total+=weight;}gl_FragColor=color/total;gl_FragColor.rgb/=gl_FragColor.a+0.00001;}"),o.call(this,F.triangleBlur,{delta:[e/this.width,0]}),o.call(this,F.triangleBlur,{delta:[0,e/this.height]}),this}function I(e){return F.edgeWork1=F.edgeWork1||new $(null,"uniform sampler2D texture;uniform vec2 delta;varying vec2 texCoord;"+V+"void main(){vec2 color=vec2(0.0);vec2 total=vec2(0.0);float offset=random(vec3(12.9898,78.233,151.7182),0.0);for(float t=-30.0;t<=30.0;t++){float percent=(t+offset-0.5)/30.0;float weight=1.0-abs(percent);vec3 sample=texture2D(texture,texCoord+delta*percent).rgb;float average=(sample.r+sample.g+sample.b)/3.0;color.x+=average*weight;total.x+=weight;if(abs(t)<15.0){weight=weight*2.0-1.0;color.y+=average*weight;total.y+=weight;}}gl_FragColor=vec4(color/total,0.0,1.0);}"),F.edgeWork2=F.edgeWork2||new $(null,"uniform sampler2D texture;uniform vec2 delta;varying vec2 texCoord;"+V+"void main(){vec2 color=vec2(0.0);vec2 total=vec2(0.0);float offset=random(vec3(12.9898,78.233,151.7182),0.0);for(float t=-30.0;t<=30.0;t++){float percent=(t+offset-0.5)/30.0;float weight=1.0-abs(percent);vec2 sample=texture2D(texture,texCoord+delta*percent).xy;color.x+=sample.x*weight;total.x+=weight;if(abs(t)<15.0){weight=weight*2.0-1.0;color.y+=sample.y*weight;total.y+=weight;}}float c=clamp(10000.0*(color.y/total.y-color.x/total.x)+0.5,0.0,1.0);gl_FragColor=vec4(c,c,c,1.0);}"),o.call(this,F.edgeWork1,{delta:[e/this.width,0]}),o.call(this,F.edgeWork2,{delta:[0,e/this.height]}),this}function R(e,t,r){return F.hexagonalPixelate=F.hexagonalPixelate||new $(null,"uniform sampler2D texture;uniform vec2 center;uniform float scale;uniform vec2 texSize;varying vec2 texCoord;void main(){vec2 tex=(texCoord*texSize-center)/scale;tex.y/=0.866025404;tex.x-=tex.y*0.5;vec2 a;if(tex.x+tex.y-floor(tex.x)-floor(tex.y)<1.0)a=vec2(floor(tex.x),floor(tex.y));else a=vec2(ceil(tex.x),ceil(tex.y));vec2 b=vec2(ceil(tex.x),floor(tex.y));vec2 c=vec2(floor(tex.x),ceil(tex.y));vec3 TEX=vec3(tex.x,tex.y,1.0-tex.x-tex.y);vec3 A=vec3(a.x,a.y,1.0-a.x-a.y);vec3 B=vec3(b.x,b.y,1.0-b.x-b.y);vec3 C=vec3(c.x,c.y,1.0-c.x-c.y);float alen=length(TEX-A);float blen=length(TEX-B);float clen=length(TEX-C);vec2 choice;if(alen0.0){coord*=mix(1.0,smoothstep(0.0,radius/distance,percent),strength*0.75);}else{coord*=mix(1.0,pow(percent,1.0+strength*0.75)*radius/distance,1.0-percent);}}coord+=center;"),o.call(this,F.bulgePinch,{radius:n,strength:e(-1,i,1),center:[t,r],texSize:[this.width,this.height]}),this}function D(e,t){var r=h.apply(null,t),n=h.apply(null,e);r=p(r);return this.matrixWarp([r[0]*n[0]+r[1]*n[3]+r[2]*n[6],r[0]*n[1]+r[1]*n[4]+r[2]*n[7],r[0]*n[2]+r[1]*n[5]+r[2]*n[8],r[3]*n[0]+r[4]*n[3]+r[5]*n[6],r[3]*n[1]+r[4]*n[4]+r[5]*n[7],r[3]*n[2]+r[4]*n[5]+r[5]*n[8],r[6]*n[0]+r[7]*n[3]+r[8]*n[6],r[6]*n[1]+r[7]*n[4]+r[8]*n[7],r[6]*n[2]+r[7]*n[5]+r[8]*n[8]])}var F,j={};!function(){try{var e=document.createElement("canvas").getContext("experimental-webgl")}catch(e){}if(e&&-1===e.getSupportedExtensions().indexOf("OES_texture_float_linear")&&function(e){if(!e.getExtension("OES_texture_float"))return!1;var t=e.createFramebuffer(),r=e.createTexture();e.bindTexture(e.TEXTURE_2D,r),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MAG_FILTER,e.NEAREST),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MIN_FILTER,e.NEAREST),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_S,e.CLAMP_TO_EDGE),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_T,e.CLAMP_TO_EDGE),e.texImage2D(e.TEXTURE_2D,0,e.RGBA,1,1,0,e.RGBA,e.UNSIGNED_BYTE,null),e.bindFramebuffer(e.FRAMEBUFFER,t),e.framebufferTexture2D(e.FRAMEBUFFER,e.COLOR_ATTACHMENT0,e.TEXTURE_2D,r,0),t=e.createTexture(),e.bindTexture(e.TEXTURE_2D,t),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MAG_FILTER,e.LINEAR),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MIN_FILTER,e.LINEAR),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_S,e.CLAMP_TO_EDGE),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_T,e.CLAMP_TO_EDGE),e.texImage2D(e.TEXTURE_2D,0,e.RGBA,2,2,0,e.RGBA,e.FLOAT,new Float32Array([2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0])),r=e.createProgram();var n=e.createShader(e.VERTEX_SHADER),i=e.createShader(e.FRAGMENT_SHADER);return e.shaderSource(n,"attribute vec2 vertex;void main(){gl_Position=vec4(vertex,0.0,1.0);}"),e.shaderSource(i,"uniform sampler2D texture;void main(){gl_FragColor=texture2D(texture,vec2(0.5));}"),e.compileShader(n),e.compileShader(i),e.attachShader(r,n),e.attachShader(r,i),e.linkProgram(r),n=e.createBuffer(),e.bindBuffer(e.ARRAY_BUFFER,n),e.bufferData(e.ARRAY_BUFFER,new Float32Array([0,0]),e.STREAM_DRAW),e.enableVertexAttribArray(0),e.vertexAttribPointer(0,2,e.FLOAT,!1,0,0),n=new Uint8Array(4),e.useProgram(r),e.viewport(0,0,1,1),e.bindTexture(e.TEXTURE_2D,t),e.drawArrays(e.POINTS,0,1),e.readPixels(0,0,1,1,e.RGBA,e.UNSIGNED_BYTE,n),127===n[0]||128===n[0]}(e)){var t=WebGLRenderingContext.prototype.getExtension,r=WebGLRenderingContext.prototype.getSupportedExtensions;WebGLRenderingContext.prototype.getExtension=function(e){return"OES_texture_float_linear"===e?(void 0===this.$OES_texture_float_linear$&&Object.defineProperty(this,"$OES_texture_float_linear$",{enumerable:!1,configurable:!1,writable:!1,value:new function(){}}),e=this.$OES_texture_float_linear$):e=t.call(this,e),e},WebGLRenderingContext.prototype.getSupportedExtensions=function(){var e=r.call(this);return-1===e.indexOf("OES_texture_float_linear")&&e.push("OES_texture_float_linear"),e}}}(),j.canvas=function(){var e=document.createElement("canvas");try{F=e.getContext("experimental-webgl",{premultipliedAlpha:!1})}catch(e){F=null}if(!F)throw"This browser does not support WebGL";return e._={gl:F,isInitialized:!1,texture:null,spareTexture:null,flippedShader:null},e.texture=c(r),e.draw=c(i),e.update=c(s),e.replace=c(a),e.contents=c(u),e.getPixelArray=c(l),e.brightnessContrast=c(_),e.hexagonalPixelate=c(R),e.hueSaturation=c(T),e.colorHalftone=c(O),e.triangleBlur=c(C),e.unsharpMask=c(w),e.perspective=c(D),e.matrixWarp=c(M),e.bulgePinch=c(N),e.tiltShift=c(S),e.dotScreen=c(P),e.edgeWork=c(I),e.lensBlur=c(k),e.zoomBlur=c(A),e.noise=c(m),e.denoise=c(y),e.curves=c(x),e.swirl=c(B),e.ink=c(L),e.vignette=c(v),e.vibrance=c(g),e.sepia=c(E),e},j.splineInterpolate=b;var U=function(){function e(e,t,r,n){this.gl=F,this.id=F.createTexture(),this.width=e,this.height=t,this.format=r,this.type=n,F.bindTexture(F.TEXTURE_2D,this.id),F.texParameteri(F.TEXTURE_2D,F.TEXTURE_MAG_FILTER,F.LINEAR),F.texParameteri(F.TEXTURE_2D,F.TEXTURE_MIN_FILTER,F.LINEAR),F.texParameteri(F.TEXTURE_2D,F.TEXTURE_WRAP_S,F.CLAMP_TO_EDGE),F.texParameteri(F.TEXTURE_2D,F.TEXTURE_WRAP_T,F.CLAMP_TO_EDGE),e&&t&&F.texImage2D(F.TEXTURE_2D,0,this.format,e,t,0,this.format,this.type,null)}function t(e){return null==r&&(r=document.createElement("canvas")),r.width=e.width,r.height=e.height,(e=r.getContext("2d")).clearRect(0,0,r.width,r.height),e}e.fromElement=function(t){var r=new e(0,0,F.RGBA,F.UNSIGNED_BYTE);return r.loadContentsOf(t),r},e.prototype.loadContentsOf=function(e){this.width=e.width||e.videoWidth,this.height=e.height||e.videoHeight,F.bindTexture(F.TEXTURE_2D,this.id),F.texImage2D(F.TEXTURE_2D,0,this.format,this.format,this.type,e)},e.prototype.initFromBytes=function(e,t,r){this.width=e,this.height=t,this.format=F.RGBA,this.type=F.UNSIGNED_BYTE,F.bindTexture(F.TEXTURE_2D,this.id),F.texImage2D(F.TEXTURE_2D,0,F.RGBA,e,t,0,F.RGBA,this.type,new Uint8Array(r))},e.prototype.destroy=function(){F.deleteTexture(this.id),this.id=null},e.prototype.use=function(e){F.activeTexture(F.TEXTURE0+(e||0)),F.bindTexture(F.TEXTURE_2D,this.id)},e.prototype.unuse=function(e){F.activeTexture(F.TEXTURE0+(e||0)),F.bindTexture(F.TEXTURE_2D,null)},e.prototype.ensureFormat=function(e,t,r,n){if(1==arguments.length){var i=arguments[0];e=i.width,t=i.height,r=i.format,n=i.type}e==this.width&&t==this.height&&r==this.format&&n==this.type||(this.width=e,this.height=t,this.format=r,this.type=n,F.bindTexture(F.TEXTURE_2D,this.id),F.texImage2D(F.TEXTURE_2D,0,this.format,e,t,0,this.format,this.type,null))},e.prototype.drawTo=function(e){if(F.framebuffer=F.framebuffer||F.createFramebuffer(),F.bindFramebuffer(F.FRAMEBUFFER,F.framebuffer),F.framebufferTexture2D(F.FRAMEBUFFER,F.COLOR_ATTACHMENT0,F.TEXTURE_2D,this.id,0),F.checkFramebufferStatus(F.FRAMEBUFFER)!==F.FRAMEBUFFER_COMPLETE)throw Error("incomplete framebuffer");F.viewport(0,0,this.width,this.height),e(),F.bindFramebuffer(F.FRAMEBUFFER,null)};var r=null;return e.prototype.fillUsingCanvas=function(e){return e(t(this)),this.format=F.RGBA,this.type=F.UNSIGNED_BYTE,F.bindTexture(F.TEXTURE_2D,this.id),F.texImage2D(F.TEXTURE_2D,0,F.RGBA,F.RGBA,F.UNSIGNED_BYTE,r),this},e.prototype.toImage=function(e){this.use(),$.getDefaultShader().drawRect();var n=4*this.width*this.height,i=new Uint8Array(n),s=t(this),o=s.createImageData(this.width,this.height);F.readPixels(0,0,this.width,this.height,F.RGBA,F.UNSIGNED_BYTE,i);for(var a=0;a>1;this.xa[n]>e?r=n:t=n}n=this.xa[r]-this.xa[t];var i=(this.xa[r]-e)/n;return e=(e-this.xa[t])/n,i*this.ya[t]+e*this.ya[r]+((i*i*i-i)*this.y2[t]+(e*e*e-e)*this.y2[r])*n*n/6};var $=function(){function e(e,t){var r=F.createShader(e);if(F.shaderSource(r,t),F.compileShader(r),!F.getShaderParameter(r,F.COMPILE_STATUS))throw"compile error: "+F.getShaderInfoLog(r);return r}function t(t,i){if(this.texCoordAttribute=this.vertexAttribute=null,this.program=F.createProgram(),t=t||r,i="precision highp float;"+(i=i||n),F.attachShader(this.program,e(F.VERTEX_SHADER,t)),F.attachShader(this.program,e(F.FRAGMENT_SHADER,i)),F.linkProgram(this.program),!F.getProgramParameter(this.program,F.LINK_STATUS))throw"link error: "+F.getProgramInfoLog(this.program)}var r="attribute vec2 vertex;attribute vec2 _texCoord;varying vec2 texCoord;void main(){texCoord=_texCoord;gl_Position=vec4(vertex*2.0-1.0,0.0,1.0);}",n="uniform sampler2D texture;varying vec2 texCoord;void main(){gl_FragColor=texture2D(texture,texCoord);}";return t.prototype.destroy=function(){F.deleteProgram(this.program),this.program=null},t.prototype.uniforms=function(e){for(var t in F.useProgram(this.program),e)if(e.hasOwnProperty(t)){var r=F.getUniformLocation(this.program,t);if(null!==r){var n=e[t];if("[object Array]"==Object.prototype.toString.call(n))switch(n.length){case 1:F.uniform1fv(r,new Float32Array(n));break;case 2:F.uniform2fv(r,new Float32Array(n));break;case 3:F.uniform3fv(r,new Float32Array(n));break;case 4:F.uniform4fv(r,new Float32Array(n));break;case 9:F.uniformMatrix3fv(r,!1,new Float32Array(n));break;case 16:F.uniformMatrix4fv(r,!1,new Float32Array(n));break;default:throw"dont't know how to load uniform \""+t+'" of length '+n.length}else{if("[object Number]"!=Object.prototype.toString.call(n))throw'attempted to set uniform "'+t+'" to invalid value '+(n||"undefined").toString();F.uniform1f(r,n)}}}return this},t.prototype.textures=function(e){for(var t in F.useProgram(this.program),e)e.hasOwnProperty(t)&&F.uniform1i(F.getUniformLocation(this.program,t),e[t]);return this},t.prototype.drawRect=function(e,t,r,n){var i=F.getParameter(F.VIEWPORT);t=void 0!==t?(t-i[1])/i[3]:0,e=void 0!==e?(e-i[0])/i[2]:0,r=void 0!==r?(r-i[0])/i[2]:1,n=void 0!==n?(n-i[1])/i[3]:1,null==F.vertexBuffer&&(F.vertexBuffer=F.createBuffer()),F.bindBuffer(F.ARRAY_BUFFER,F.vertexBuffer),F.bufferData(F.ARRAY_BUFFER,new Float32Array([e,t,e,n,r,t,r,n]),F.STATIC_DRAW),null==F.texCoordBuffer&&(F.texCoordBuffer=F.createBuffer(),F.bindBuffer(F.ARRAY_BUFFER,F.texCoordBuffer),F.bufferData(F.ARRAY_BUFFER,new Float32Array([0,0,0,1,1,0,1,1]),F.STATIC_DRAW)),null==this.vertexAttribute&&(this.vertexAttribute=F.getAttribLocation(this.program,"vertex"),F.enableVertexAttribArray(this.vertexAttribute)),null==this.texCoordAttribute&&(this.texCoordAttribute=F.getAttribLocation(this.program,"_texCoord"),F.enableVertexAttribArray(this.texCoordAttribute)),F.useProgram(this.program),F.bindBuffer(F.ARRAY_BUFFER,F.vertexBuffer),F.vertexAttribPointer(this.vertexAttribute,2,F.FLOAT,!1,0,0),F.bindBuffer(F.ARRAY_BUFFER,F.texCoordBuffer),F.vertexAttribPointer(this.texCoordAttribute,2,F.FLOAT,!1,0,0),F.drawArrays(F.TRIANGLE_STRIP,0,4)},t.getDefaultShader=function(){return F.defaultShader=F.defaultShader||new t,F.defaultShader},t}(),V="float random(vec3 scale,float seed){return fract(sin(dot(gl_FragCoord.xyz+seed,scale))*43758.5453+seed);}";return j}();"object"==typeof t?t.exports=n:window.fx=n},{}],158:[function(e,t,r){(function(r){"use strict";const{promisify:n}=e("util"),i=e("fs"),s=e("path"),o=e("fast-glob"),a=e("ignore"),u=e("slash"),l=["**/node_modules/**","**/flow-typed/**","**/coverage/**","**/.git"],c=n(i.readFile),h=(e,t)=>{const r=u(s.relative(t.cwd,s.dirname(t.fileName)));return e.split(/\r?\n/).filter(Boolean).filter(e=>!e.startsWith("#")).map((e=>t=>t.startsWith("!")?"!"+s.posix.join(e,t.slice(1)):s.posix.join(e,t))(r))},p=e=>e.reduce((e,t)=>(e.add(h(t.content,{cwd:t.cwd,fileName:t.filePath})),e),a()),f=(e,t)=>r=>e.ignores(u(s.relative(t,((e,t)=>{if(s.isAbsolute(t)){if(t.startsWith(e))return t;throw new Error(`Path ${t} is not in cwd ${e}`)}return s.join(e,t)})(t,r)))),d=({ignore:e=[],cwd:t=r.cwd()}={})=>({ignore:e,cwd:t});t.exports=(async e=>{e=d(e);const t=await o("**/.gitignore",{ignore:l.concat(e.ignore),cwd:e.cwd}),r=await Promise.all(t.map(t=>(async(e,t)=>{const r=s.join(t,e);return{cwd:t,filePath:r,content:await c(r,"utf8")}})(t,e.cwd))),n=p(r);return f(n,e.cwd)}),t.exports.sync=(e=>{e=d(e);const t=o.sync("**/.gitignore",{ignore:l.concat(e.ignore),cwd:e.cwd}).map(t=>((e,t)=>{const r=s.join(t,e);return{cwd:t,filePath:r,content:i.readFileSync(r,"utf8")}})(t,e.cwd)),r=p(t);return f(r,e.cwd)})}).call(this,e("_process"))},{_process:452,"fast-glob":74,fs:290,ignore:310,path:397,slash:516,util:538}],159:[function(e,t,r){"use strict";const n=e("fs"),i=e("array-union"),s=e("merge2"),o=e("glob"),a=e("fast-glob"),u=e("dir-glob"),l=e("./gitignore"),{FilterStream:c,UniqueStream:h}=e("./stream-utils"),p=()=>!1,f=e=>"!"===e[0],d=(e,t)=>{(e=>{if(!e.every(e=>"string"==typeof e))throw new TypeError("Patterns must be a string or an array of strings")})(e=i([].concat(e))),((e={})=>{if(!e.cwd)return;let t;try{t=n.statSync(e.cwd)}catch(e){return}if(!t.isDirectory())throw new Error("The `cwd` option must be a path to a directory")})(t);const r=[];t={ignore:[],expandDirectories:!0,...t};for(const[n,i]of e.entries()){if(f(i))continue;const s=e.slice(n).filter(f).map(e=>e.slice(1)),o={...t,ignore:t.ignore.concat(s)};r.push({pattern:i,options:o})}return r},m=(e,t)=>e.options.expandDirectories?((e,t)=>{let r={};return e.options.cwd&&(r.cwd=e.options.cwd),Array.isArray(e.options.expandDirectories)?r={...r,files:e.options.expandDirectories}:"object"==typeof e.options.expandDirectories&&(r={...r,...e.options.expandDirectories}),t(e.pattern,r)})(e,t):[e.pattern],g=e=>e&&e.gitignore?l.sync({cwd:e.cwd,ignore:e.ignore}):p,v=e=>t=>{const{options:r}=e;return r.ignore&&Array.isArray(r.ignore)&&r.expandDirectories&&(r.ignore=u.sync(r.ignore)),{pattern:t,options:r}};t.exports=(async(e,t)=>{const r=d(e,t),[s,o]=await Promise.all([(async()=>t&&t.gitignore?l({cwd:t.cwd,ignore:t.ignore}):p)(),(async()=>{const e=await Promise.all(r.map(async e=>{const t=await m(e,u);return Promise.all(t.map(v(e)))}));return i(...e)})()]),c=await Promise.all(o.map(e=>a(e.pattern,e.options)));return i(...c).filter(e=>!s((e=>e.stats instanceof n.Stats?e.path:e)(e)))}),t.exports.sync=((e,t)=>{const r=d(e,t).reduce((e,t)=>{const r=m(t,u.sync).map(v(t));return e.concat(r)},[]),n=g(t);return r.reduce((e,t)=>i(e,a.sync(t.pattern,t.options)),[]).filter(e=>!n(e))}),t.exports.stream=((e,t)=>{const r=d(e,t).reduce((e,t)=>{const r=m(t,u.sync).map(v(t));return e.concat(r)},[]),n=g(t),i=new c(e=>!n(e)),o=new h;return s(r.map(e=>a.stream(e.pattern,e.options))).pipe(i).pipe(o)}),t.exports.generateGlobTasks=d,t.exports.hasMagic=((e,t)=>[].concat(e).some(e=>o.hasMagic(e,t))),t.exports.gitignore=l},{"./gitignore":158,"./stream-utils":163,"array-union":25,"dir-glob":53,"fast-glob":74,fs:290,glob:161,merge2:370}],160:[function(e,t,r){(function(t){function n(e,t){return Object.prototype.hasOwnProperty.call(e,t)}r.alphasort=l,r.alphasorti=u,r.setopts=function(e,r,s){s||(s={});if(s.matchBase&&-1===r.indexOf("/")){if(s.noglobstar)throw new Error("base matching requires globstar");r="**/"+r}e.silent=!!s.silent,e.pattern=r,e.strict=!1!==s.strict,e.realpath=!!s.realpath,e.realpathCache=s.realpathCache||Object.create(null),e.follow=!!s.follow,e.dot=!!s.dot,e.mark=!!s.mark,e.nodir=!!s.nodir,e.nodir&&(e.mark=!0);e.sync=!!s.sync,e.nounique=!!s.nounique,e.nonull=!!s.nonull,e.nosort=!!s.nosort,e.nocase=!!s.nocase,e.stat=!!s.stat,e.noprocess=!!s.noprocess,e.absolute=!!s.absolute,e.maxLength=s.maxLength||1/0,e.cache=s.cache||Object.create(null),e.statCache=s.statCache||Object.create(null),e.symlinks=s.symlinks||Object.create(null),function(e,t){e.ignore=t.ignore||[],Array.isArray(e.ignore)||(e.ignore=[e.ignore]);e.ignore.length&&(e.ignore=e.ignore.map(c))}(e,s),e.changedCwd=!1;var u=t.cwd();n(s,"cwd")?(e.cwd=i.resolve(s.cwd),e.changedCwd=e.cwd!==u):e.cwd=u;e.root=s.root||i.resolve(e.cwd,"/"),e.root=i.resolve(e.root),"win32"===t.platform&&(e.root=e.root.replace(/\\/g,"/"));e.cwdAbs=o(e.cwd)?e.cwd:h(e,e.cwd),"win32"===t.platform&&(e.cwdAbs=e.cwdAbs.replace(/\\/g,"/"));e.nomount=!!s.nomount,s.nonegate=!0,s.nocomment=!0,e.minimatch=new a(r,s),e.options=e.minimatch.options},r.ownProp=n,r.makeAbs=h,r.finish=function(e){for(var t=e.nounique,r=t?[]:Object.create(null),n=0,i=e.matches.length;n1)return!0;for(var i=0;ithis.maxLength)return t();if(!this.stat&&d(this.cache,r)){var s=this.cache[r];if(Array.isArray(s)&&(s="DIR"),!i||"DIR"===s)return t(null,s);if(i&&"FILE"===s)return t()}var o=this.statCache[r];if(void 0!==o){if(!1===o)return t(null,o);var a=o.isDirectory()?"DIR":"FILE";return i&&"FILE"===a?t():t(null,a,o)}var u=this,l=m("stat\0"+r,function(i,s){if(s&&s.isSymbolicLink())return n.stat(r,function(n,i){n?u._stat2(e,r,null,s,t):u._stat2(e,r,n,i,t)});u._stat2(e,r,i,s,t)});l&&n.lstat(r,l)},x.prototype._stat2=function(e,t,r,n,i){if(r&&("ENOENT"===r.code||"ENOTDIR"===r.code))return this.statCache[t]=!1,i();var s="/"===e.slice(-1);if(this.statCache[t]=n,"/"===t.slice(-1)&&n&&!n.isDirectory())return i(null,!1,n);var o=!0;return n&&(o=n.isDirectory()?"DIR":"FILE"),this.cache[t]=this.cache[t]||o,s&&"FILE"===o?i():i(null,o,n)}}).call(this,e("_process"))},{"./common.js":160,"./sync.js":162,_process:452,assert:284,events:292,fs:290,"fs.realpath":110,inflight:347,inherits:348,minimatch:385,once:392,path:397,"path-is-absolute":398,util:538}],162:[function(e,t,r){(function(r){t.exports=d,d.GlobSync=m;var n=e("fs"),i=e("fs.realpath"),s=e("minimatch"),o=(s.Minimatch,e("./glob.js").Glob,e("util"),e("path")),a=e("assert"),u=e("path-is-absolute"),l=e("./common.js"),c=(l.alphasort,l.alphasorti,l.setopts),h=l.ownProp,p=l.childrenIgnored,f=l.isIgnored;function d(e,t){if("function"==typeof t||3===arguments.length)throw new TypeError("callback provided to sync glob\nSee: https://github.com/isaacs/node-glob/issues/167");return new m(e,t).found}function m(e,t){if(!e)throw new Error("must provide pattern");if("function"==typeof t||3===arguments.length)throw new TypeError("callback provided to sync glob\nSee: https://github.com/isaacs/node-glob/issues/167");if(!(this instanceof m))return new m(e,t);if(c(this,e,t),this.noprocess)return this;var r=this.minimatch.set.length;this.matches=new Array(r);for(var n=0;nthis.maxLength)return!1;if(!this.stat&&h(this.cache,t)){var i=this.cache[t];if(Array.isArray(i)&&(i="DIR"),!r||"DIR"===i)return i;if(r&&"FILE"===i)return!1}var s=this.statCache[t];if(!s){var o;try{o=n.lstatSync(t)}catch(e){if(e&&("ENOENT"===e.code||"ENOTDIR"===e.code))return this.statCache[t]=!1,!1}if(o&&o.isSymbolicLink())try{s=n.statSync(t)}catch(e){s=o}else s=o}this.statCache[t]=s;i=!0;return s&&(i=s.isDirectory()?"DIR":"FILE"),this.cache[t]=this.cache[t]||i,(!r||"FILE"!==i)&&i},m.prototype._mark=function(e){return l.mark(this,e)},m.prototype._makeAbs=function(e){return l.makeAbs(this,e)}}).call(this,e("_process"))},{"./common.js":160,"./glob.js":161,_process:452,assert:284,fs:290,"fs.realpath":110,minimatch:385,path:397,"path-is-absolute":398,util:538}],163:[function(e,t,r){"use strict";const{Transform:n}=e("stream");class i extends n{constructor(){super({objectMode:!0})}}t.exports={FilterStream:class extends i{constructor(e){super(),this._filter=e}_transform(e,t,r){this._filter(e)&&this.push(e),r()}},UniqueStream:class extends i{constructor(){super(),this._pushed=new Set}_transform(e,t,r){this._pushed.has(e)||(this.push(e),this._pushed.add(e)),r()}}}},{stream:518}],164:[function(e,t,r){t.exports=function(e){var t,r,E,T=0,A=0,S=u,k=[],C=[],I=1,R=0,O=0,L=!1,P=!1,M="",B=s,N=n;"300 es"===(e=e||{}).version&&(B=a,N=o);for(var D={},F={},T=0;T0)continue;r=e.slice(0,1).join("")}return j(r),O+=r.length,(k=k.slice(r.length)).length}}function H(){return/[^a-fA-F0-9]/.test(t)?(j(k.join("")),S=u,T):(k.push(t),r=t,T+1)}function K(){return"."===t?(k.push(t),S=m,r=t,T+1):/[eE]/.test(t)?(k.push(t),S=m,r=t,T+1):"x"===t&&1===k.length&&"0"===k[0]?(S=x,k.push(t),r=t,T+1):/[^\d]/.test(t)?(j(k.join("")),S=u,T):(k.push(t),r=t,T+1)}function q(){return"f"===t&&(k.push(t),r=t,T+=1),/[eE]/.test(t)?(k.push(t),r=t,T+1):("-"!==t&&"+"!==t||!/[eE]/.test(r))&&/[^\d]/.test(t)?(j(k.join("")),S=u,T):(k.push(t),r=t,T+1)}function X(){if(/[^\d\w_]/.test(t)){var e=k.join("");return S=F[e]?y:D[e]?v:g,j(k.join("")),S=u,T}return k.push(t),r=t,T+1}};var n=e("./lib/literals"),i=e("./lib/operators"),s=e("./lib/builtins"),o=e("./lib/literals-300es"),a=e("./lib/builtins-300es"),u=999,l=9999,c=0,h=1,p=2,f=3,d=4,m=5,g=6,v=7,y=8,_=9,b=10,x=11,w=["block-comment","line-comment","preprocessor","operator","integer","float","ident","builtin","keyword","whitespace","eof","integer"]},{"./lib/builtins":166,"./lib/builtins-300es":165,"./lib/literals":168,"./lib/literals-300es":167,"./lib/operators":169}],165:[function(e,t,r){var n=e("./builtins");n=n.slice().filter(function(e){return!/^(gl\_|texture)/.test(e)}),t.exports=n.concat(["gl_VertexID","gl_InstanceID","gl_Position","gl_PointSize","gl_FragCoord","gl_FrontFacing","gl_FragDepth","gl_PointCoord","gl_MaxVertexAttribs","gl_MaxVertexUniformVectors","gl_MaxVertexOutputVectors","gl_MaxFragmentInputVectors","gl_MaxVertexTextureImageUnits","gl_MaxCombinedTextureImageUnits","gl_MaxTextureImageUnits","gl_MaxFragmentUniformVectors","gl_MaxDrawBuffers","gl_MinProgramTexelOffset","gl_MaxProgramTexelOffset","gl_DepthRangeParameters","gl_DepthRange","trunc","round","roundEven","isnan","isinf","floatBitsToInt","floatBitsToUint","intBitsToFloat","uintBitsToFloat","packSnorm2x16","unpackSnorm2x16","packUnorm2x16","unpackUnorm2x16","packHalf2x16","unpackHalf2x16","outerProduct","transpose","determinant","inverse","texture","textureSize","textureProj","textureLod","textureOffset","texelFetch","texelFetchOffset","textureProjOffset","textureLodOffset","textureProjLod","textureProjLodOffset","textureGrad","textureGradOffset","textureProjGrad","textureProjGradOffset"])},{"./builtins":166}],166:[function(e,t,r){t.exports=["abs","acos","all","any","asin","atan","ceil","clamp","cos","cross","dFdx","dFdy","degrees","distance","dot","equal","exp","exp2","faceforward","floor","fract","gl_BackColor","gl_BackLightModelProduct","gl_BackLightProduct","gl_BackMaterial","gl_BackSecondaryColor","gl_ClipPlane","gl_ClipVertex","gl_Color","gl_DepthRange","gl_DepthRangeParameters","gl_EyePlaneQ","gl_EyePlaneR","gl_EyePlaneS","gl_EyePlaneT","gl_Fog","gl_FogCoord","gl_FogFragCoord","gl_FogParameters","gl_FragColor","gl_FragCoord","gl_FragData","gl_FragDepth","gl_FragDepthEXT","gl_FrontColor","gl_FrontFacing","gl_FrontLightModelProduct","gl_FrontLightProduct","gl_FrontMaterial","gl_FrontSecondaryColor","gl_LightModel","gl_LightModelParameters","gl_LightModelProducts","gl_LightProducts","gl_LightSource","gl_LightSourceParameters","gl_MaterialParameters","gl_MaxClipPlanes","gl_MaxCombinedTextureImageUnits","gl_MaxDrawBuffers","gl_MaxFragmentUniformComponents","gl_MaxLights","gl_MaxTextureCoords","gl_MaxTextureImageUnits","gl_MaxTextureUnits","gl_MaxVaryingFloats","gl_MaxVertexAttribs","gl_MaxVertexTextureImageUnits","gl_MaxVertexUniformComponents","gl_ModelViewMatrix","gl_ModelViewMatrixInverse","gl_ModelViewMatrixInverseTranspose","gl_ModelViewMatrixTranspose","gl_ModelViewProjectionMatrix","gl_ModelViewProjectionMatrixInverse","gl_ModelViewProjectionMatrixInverseTranspose","gl_ModelViewProjectionMatrixTranspose","gl_MultiTexCoord0","gl_MultiTexCoord1","gl_MultiTexCoord2","gl_MultiTexCoord3","gl_MultiTexCoord4","gl_MultiTexCoord5","gl_MultiTexCoord6","gl_MultiTexCoord7","gl_Normal","gl_NormalMatrix","gl_NormalScale","gl_ObjectPlaneQ","gl_ObjectPlaneR","gl_ObjectPlaneS","gl_ObjectPlaneT","gl_Point","gl_PointCoord","gl_PointParameters","gl_PointSize","gl_Position","gl_ProjectionMatrix","gl_ProjectionMatrixInverse","gl_ProjectionMatrixInverseTranspose","gl_ProjectionMatrixTranspose","gl_SecondaryColor","gl_TexCoord","gl_TextureEnvColor","gl_TextureMatrix","gl_TextureMatrixInverse","gl_TextureMatrixInverseTranspose","gl_TextureMatrixTranspose","gl_Vertex","greaterThan","greaterThanEqual","inversesqrt","length","lessThan","lessThanEqual","log","log2","matrixCompMult","max","min","mix","mod","normalize","not","notEqual","pow","radians","reflect","refract","sign","sin","smoothstep","sqrt","step","tan","texture2D","texture2DLod","texture2DProj","texture2DProjLod","textureCube","textureCubeLod","texture2DLodEXT","texture2DProjLodEXT","textureCubeLodEXT","texture2DGradEXT","texture2DProjGradEXT","textureCubeGradEXT"]},{}],167:[function(e,t,r){var n=e("./literals");t.exports=n.slice().concat(["layout","centroid","smooth","case","mat2x2","mat2x3","mat2x4","mat3x2","mat3x3","mat3x4","mat4x2","mat4x3","mat4x4","uvec2","uvec3","uvec4","samplerCubeShadow","sampler2DArray","sampler2DArrayShadow","isampler2D","isampler3D","isamplerCube","isampler2DArray","usampler2D","usampler3D","usamplerCube","usampler2DArray","coherent","restrict","readonly","writeonly","resource","atomic_uint","noperspective","patch","sample","subroutine","common","partition","active","filter","image1D","image2D","image3D","imageCube","iimage1D","iimage2D","iimage3D","iimageCube","uimage1D","uimage2D","uimage3D","uimageCube","image1DArray","image2DArray","iimage1DArray","iimage2DArray","uimage1DArray","uimage2DArray","image1DShadow","image2DShadow","image1DArrayShadow","image2DArrayShadow","imageBuffer","iimageBuffer","uimageBuffer","sampler1DArray","sampler1DArrayShadow","isampler1D","isampler1DArray","usampler1D","usampler1DArray","isampler2DRect","usampler2DRect","samplerBuffer","isamplerBuffer","usamplerBuffer","sampler2DMS","isampler2DMS","usampler2DMS","sampler2DMSArray","isampler2DMSArray","usampler2DMSArray"])},{"./literals":168}],168:[function(e,t,r){t.exports=["precision","highp","mediump","lowp","attribute","const","uniform","varying","break","continue","do","for","while","if","else","in","out","inout","float","int","uint","void","bool","true","false","discard","return","mat2","mat3","mat4","vec2","vec3","vec4","ivec2","ivec3","ivec4","bvec2","bvec3","bvec4","sampler1D","sampler2D","sampler3D","samplerCube","sampler1DShadow","sampler2DShadow","struct","asm","class","union","enum","typedef","template","this","packed","goto","switch","default","inline","noinline","volatile","public","static","extern","external","interface","long","short","double","half","fixed","unsigned","input","output","hvec2","hvec3","hvec4","dvec2","dvec3","dvec4","fvec2","fvec3","fvec4","sampler2DRect","sampler3DRect","sampler2DRectShadow","sizeof","cast","namespace","using"]},{}],169:[function(e,t,r){t.exports=["<<=",">>=","++","--","<<",">>","<=",">=","==","!=","&&","||","+=","-=","*=","/=","%=","&=","^^","^=","|=","(",")","[","]",".","!","~","*","/","%","+","-","<",">","&","^","|","?",":","=",",",";","{","}"]},{}],170:[function(e,t,r){var n=e("./index");t.exports=function(e,t){var r=n(t),i=[];return i=(i=i.concat(r(e))).concat(r(null))}},{"./index":164}],171:[function(e,t,r){function n(e){const t=new Array(e.length);for(let r=0;r{e.output=o(t),e.graphical&&s(e)}),e.toJSON=(()=>{throw new Error("Not usable with gpuMock")}),e.setConstants=(t=>(e.constants=t,e)),e.setGraphical=(t=>(e.graphical=t,e)),e.setCanvas=(t=>(e.canvas=t,e)),e.setContext=(t=>(e.context=t,e)),e.destroy=(()=>{}),e.validateSettings=(()=>{}),e.graphical&&e.output&&s(e),e.exec=function(){return new Promise((t,r)=>{try{t(e.apply(e,arguments))}catch(e){r(e)}})},e.getPixels=(t=>{const{x:r,y:n}=e.output;return t?function(e,t,r){const n=r/2|0,i=4*t,s=new Uint8ClampedArray(4*t),o=e.slice(0);for(let e=0;ee,r=["setWarnVarUsage","setArgumentTypes","setTactic","setOptimizeFloatMemory","setDebug","setLoopMaxIterations","setConstantTypes","setFunctions","setNativeFunctions","setInjectedNative","setPipeline","setPrecision","setOutputToTexture","setImmutable","setStrictIntegers","setDynamicOutput","setHardcodeConstants","setDynamicArguments","setUseLegacyEncoder","setWarnVarUsage","addSubKernel"];for(let n=0;n0&&t.push(", "),t.push("user_"),t.push(r)}t.push(") {\n")}for(let r=0;r0&&t.push(r.join(""),";\n"),t.push(`for (let ${e}=0;${e}0&&t.push(`if (!${n.join("")}) break;\n`),t.push(s.join("")),t.push(`\n${i.join("")};`),t.push("}\n")}return t}astWhileStatement(e,t){if("WhileStatement"!==e.type)throw this.astErrorOutput("Invalid while statement",e);return t.push("for (let i = 0; i < LOOP_MAX; i++) {"),t.push("if ("),this.astGeneric(e.test,t),t.push(") {\n"),this.astGeneric(e.body,t),t.push("} else {\n"),t.push("break;\n"),t.push("}\n"),t.push("}\n"),t}astDoWhileStatement(e,t){if("DoWhileStatement"!==e.type)throw this.astErrorOutput("Invalid while statement",e);return t.push("for (let i = 0; i < LOOP_MAX; i++) {"),this.astGeneric(e.body,t),t.push("if (!"),this.astGeneric(e.test,t),t.push(") {\n"),t.push("break;\n"),t.push("}\n"),t.push("}\n"),t}astAssignmentExpression(e,t){const r=this.getDeclaration(e.left);if(r&&!r.assignable)throw this.astErrorOutput(`Variable ${e.left.name} is not assignable here`,e);return this.astGeneric(e.left,t),t.push(e.operator),this.astGeneric(e.right,t),t}astBlockStatement(e,t){if(this.isState("loop-body")){this.pushState("block-body");for(let r=0;r0&&t.push(",");const n=r[e],i=this.getDeclaration(n.id);i.valueType||(i.valueType=this.getType(n.init)),this.astGeneric(n,t)}return this.isState("in-for-loop-init")||t.push(";"),t}astIfStatement(e,t){return t.push("if ("),this.astGeneric(e.test,t),t.push(")"),"BlockStatement"===e.consequent.type?this.astGeneric(e.consequent,t):(t.push(" {\n"),this.astGeneric(e.consequent,t),t.push("\n}\n")),e.alternate&&(t.push("else "),"BlockStatement"===e.alternate.type||"IfStatement"===e.alternate.type?this.astGeneric(e.alternate,t):(t.push(" {\n"),this.astGeneric(e.alternate,t),t.push("\n}\n"))),t}astSwitchStatement(e,t){const{discriminant:r,cases:n}=e;t.push("switch ("),this.astGeneric(r,t),t.push(") {\n");for(let e=0;e0&&(this.astGeneric(n[e].consequent,t),t.push("break;\n"))):(t.push("default:\n"),this.astGeneric(n[e].consequent,t),n[e].consequent&&n[e].consequent.length>0&&t.push("break;\n"));t.push("\n}")}astThisExpression(e,t){return t.push("_this"),t}astMemberExpression(e,t){const{signature:r,type:n,property:i,xProperty:s,yProperty:o,zProperty:a,name:u,origin:l}=this.getMemberExpressionDetails(e);switch(r){case"this.thread.value":return t.push(`_this.thread.${u}`),t;case"this.output.value":switch(u){case"x":t.push("outputX");break;case"y":t.push("outputY");break;case"z":t.push("outputZ");break;default:throw this.astErrorOutput("Unexpected expression",e)}return t;case"value":throw this.astErrorOutput("Unexpected expression",e);case"value[]":case"value[][]":case"value[][][]":case"value.value":if("Math"===l)return t.push(Math[u]),t;switch(i){case"r":return t.push(`user_${u}[0]`),t;case"g":return t.push(`user_${u}[1]`),t;case"b":return t.push(`user_${u}[2]`),t;case"a":return t.push(`user_${u}[3]`),t}break;case"this.constants.value":case"this.constants.value[]":case"this.constants.value[][]":case"this.constants.value[][][]":break;case"fn()[]":return this.astGeneric(e.object,t),t.push("["),this.astGeneric(e.property,t),t.push("]"),t;case"fn()[][]":return this.astGeneric(e.object.object,t),t.push("["),this.astGeneric(e.object.property,t),t.push("]"),t.push("["),this.astGeneric(e.property,t),t.push("]"),t;default:throw this.astErrorOutput("Unexpected expression",e)}if(!e.computed)switch(n){case"Number":case"Integer":case"Float":case"Boolean":return t.push(`${l}_${u}`),t}const c=`${l}_${u}`;switch(n){case"Array(2)":case"Array(3)":case"Array(4)":case"Matrix(2)":case"Matrix(3)":case"Matrix(4)":case"HTMLImageArray":case"ArrayTexture(1)":case"ArrayTexture(2)":case"ArrayTexture(3)":case"ArrayTexture(4)":case"HTMLImage":default:let e,r;if("constants"===l){const t=this.constants[u];e=(r="Input"===this.constantTypes[u])?t.size:null}else e=(r=this.isInput(u))?this.argumentSizes[this.argumentNames.indexOf(u)]:null;t.push(`${c}`),a&&o?r?(t.push("[("),this.astGeneric(a,t),t.push(`*${this.dynamicArguments?"(outputY * outputX)":e[1]*e[0]})+(`),this.astGeneric(o,t),t.push(`*${this.dynamicArguments?"outputX":e[0]})+`),this.astGeneric(s,t),t.push("]")):(t.push("["),this.astGeneric(a,t),t.push("]"),t.push("["),this.astGeneric(o,t),t.push("]"),t.push("["),this.astGeneric(s,t),t.push("]")):o?r?(t.push("[("),this.astGeneric(o,t),t.push(`*${this.dynamicArguments?"outputX":e[0]})+`),this.astGeneric(s,t),t.push("]")):(t.push("["),this.astGeneric(o,t),t.push("]"),t.push("["),this.astGeneric(s,t),t.push("]")):void 0!==s&&(t.push("["),this.astGeneric(s,t),t.push("]"))}return t}astCallExpression(e,t){if("CallExpression"!==e.type)throw this.astErrorOutput("Unknown CallExpression",e);let r=this.astMemberExpressionUnroll(e.callee);this.calledFunctions.indexOf(r)<0&&this.calledFunctions.push(r),this.isAstMathFunction(e),this.onFunctionCall&&this.onFunctionCall(this.name,r,e.arguments),t.push(r),t.push("(");const n=this.lookupFunctionArgumentTypes(r)||[];for(let i=0;i0&&t.push(", "),this.astGeneric(s,t)}return t.push(")"),t}astArrayExpression(e,t){const r=this.getType(e),n=e.elements.length,i=[];for(let t=0;t{switch(t){case"_colorData":return"_colorData";case"_imageData":return"_imageData";case"output":return"output";case"thread":return"this.thread"}return JSON.stringify(e[t])},findDependency:(e,t)=>null}),a=n.flattenFunctionToString((o?"function ":"")+e.getPixels.toString(),{thisLookup:t=>{switch(t){case"_colorData":return"_colorData";case"_imageData":return"_imageData";case"output":return"output";case"thread":return"this.thread"}return JSON.stringify(e[t])},findDependency:()=>null});i.push(" _imageData,"," _colorData,",` color: ${t},`),s.push(` kernel.getPixels = ${a};`)}const a=[],u=Object.keys(e.constantTypes);for(let t=0;t"this"===t?(o?"function ":"")+e[r].toString():null,thisLookup:e=>{switch(e){case"canvas":return;case"context":return"context"}}});s.push(t),i.push(" _mediaTo2DArray,"),i.push(" _imageTo3DArray,")}else if(-1!==e.argumentTypes.indexOf("HTMLImage")||-1!==a.indexOf("HTMLImage")){const t=n.flattenFunctionToString((o?"function ":"")+e._mediaTo2DArray.toString(),{findDependency:(e,t)=>null,thisLookup:e=>{switch(e){case"canvas":return"settings.canvas";case"context":return"settings.context"}throw new Error("unhandled thisLookup")}});s.push(t),i.push(" _mediaTo2DArray,")}return`function(settings) {\n${r.join("\n")}\n for (const p in _constantTypes) {\n if (!_constantTypes.hasOwnProperty(p)) continue;\n const type = _constantTypes[p];\n switch (type) {\n case 'Number':\n case 'Integer':\n case 'Float':\n case 'Boolean':\n case 'Array(2)':\n case 'Array(3)':\n case 'Array(4)':\n case 'Matrix(2)':\n case 'Matrix(3)':\n case 'Matrix(4)':\n if (incomingConstants.hasOwnProperty(p)) {\n console.warn('constant ' + p + ' of type ' + type + ' cannot be resigned');\n }\n continue;\n }\n if (!incomingConstants.hasOwnProperty(p)) {\n throw new Error('constant ' + p + ' not found');\n }\n _constants[p] = incomingConstants[p];\n }\n const kernel = (function() {\n${e._kernelString}\n })\n .apply({ ${i.join("\n")} });\n ${s.join("\n")}\n return kernel;\n}`}}},{"../../utils":279}],175:[function(e,t,r){const{Kernel:n}=e("../kernel"),{FunctionBuilder:i}=e("../function-builder"),{CPUFunctionNode:s}=e("./function-node"),{utils:o}=e("../../utils"),{cpuKernelString:a}=e("./kernel-string");t.exports={CPUKernel:class extends n{static getFeatures(){return this.features}static get features(){return Object.freeze({kernelMap:!0,isIntegerDivisionAccurate:!0})}static get isSupported(){return!0}static isContextMatch(e){return!1}static get mode(){return"cpu"}static nativeFunctionArguments(){return null}static nativeFunctionReturnType(){throw new Error(`Looking up native function return type not supported on ${this.name}`)}static combineKernels(e){return e}static getSignature(e,t){return"cpu"+(t.length>0?":"+t.join(","):"")}constructor(e,t){super(e,t),this.mergeSettings(e.settings||t),this._imageData=null,this._colorData=null,this._kernelString=null,this._prependedString=[],this.thread={x:0,y:0,z:0},this.translatedSources=null}initCanvas(){return"undefined"!=typeof document?document.createElement("canvas"):"undefined"!=typeof OffscreenCanvas?new OffscreenCanvas(0,0):void 0}initContext(){return this.canvas?this.canvas.getContext("2d"):null}initPlugins(e){return[]}validateSettings(e){if(!this.output||0===this.output.length){if(1!==e.length)throw new Error("Auto output only supported for kernels with only one input");const t=o.getVariableType(e[0],this.strictIntegers);if("Array"===t)this.output=o.getDimensions(t);else{if("NumberTexture"!==t&&"ArrayTexture(4)"!==t)throw new Error("Auto output not supported for input type: "+t);this.output=e[0].output}}if(this.graphical&&2!==this.output.length)throw new Error("Output must have 2 dimensions on graphical mode");this.checkOutput()}translateSource(){if(this.leadingReturnStatement=this.output.length>1?"resultX[x] = ":"result[x] = ",this.subKernels){const e=[];for(let t=0;t1?`resultX_${r}[x] = subKernelResult_${r};\n`:`result_${r}[x] = subKernelResult_${r};\n`)}this.followingReturnStatement=e.join("")}const e=i.fromKernel(this,s);this.translatedSources=e.getPrototypes("kernel"),this.graphical||this.returnType||(this.returnType=e.getKernelResultType())}build(){if(this.built)return;if(this.setupConstants(),this.setupArguments(arguments),this.validateSettings(arguments),this.translateSource(),this.graphical){const{canvas:e,output:t}=this;if(!e)throw new Error("no canvas available for using graphical output");const r=t[0],n=t[1]||1;e.width=r,e.height=n,this._imageData=this.context.createImageData(r,n),this._colorData=new Uint8ClampedArray(r*n*4)}const e=this.getKernelString();this.kernelString=e,this.debug&&(console.log("Function output:"),console.log(e));try{this.run=new Function([],e).bind(this)()}catch(e){console.error("An error occurred compiling the javascript: ",e)}this.buildSignature(arguments),this.built=!0}color(e,t,r,n){void 0===n&&(n=1),e=Math.floor(255*e),t=Math.floor(255*t),r=Math.floor(255*r),n=Math.floor(255*n);const i=this.output[0],s=this.output[1],o=this.thread.x+(s-this.thread.y-1)*i;this._colorData[4*o+0]=e,this._colorData[4*o+1]=t,this._colorData[4*o+2]=r,this._colorData[4*o+3]=n}getKernelString(){if(null!==this._kernelString)return this._kernelString;let e=null,{translatedSources:t}=this;return t.length>1?t=t.filter(t=>/^function/.test(t)?t:(e=t,!1)):e=t.shift(),this._kernelString=` const LOOP_MAX = ${this._getLoopMaxString()};\n ${this.injectedNative||""}\n const _this = this;\n ${this._resultKernelHeader()}\n ${this._processConstants()}\n return (${this.argumentNames.map(e=>"user_"+e).join(", ")}) => {\n ${this._prependedString.join("")}\n ${this._earlyThrows()}\n ${this._processArguments()}\n ${this.graphical?this._graphicalKernelBody(e):this._resultKernelBody(e)}\n ${t.length>0?t.join("\n"):""}\n };`}toString(){return a(this)}_getLoopMaxString(){return this.loopMaxIterations?` ${parseInt(this.loopMaxIterations)};`:" 1000;"}_processConstants(){if(!this.constants)return"";const e=[];for(let t in this.constants)switch(this.constantTypes[t]){case"HTMLCanvas":case"OffscreenCanvas":case"HTMLImage":case"ImageBitmap":case"ImageData":case"HTMLVideo":e.push(` const constants_${t} = this._mediaTo2DArray(this.constants.${t});\n`);break;case"HTMLImageArray":e.push(` const constants_${t} = this._imageTo3DArray(this.constants.${t});\n`);break;case"Input":e.push(` const constants_${t} = this.constants.${t}.value;\n`);break;default:e.push(` const constants_${t} = this.constants.${t};\n`)}return e.join("")}_earlyThrows(){if(this.graphical)return"";if(this.immutable)return"";if(!this.pipeline)return"";const e=[];for(let t=0;t`user_${n} === result_${e.name}`).join(" || ");t.push(`user_${n} === result${i?` || ${i}`:""}`)}return`if (${t.join(" || ")}) throw new Error('Source and destination arrays are the same. Use immutable = true');`}_processArguments(){const e=[];for(let t=0;t0?e.width:e.videoWidth,n=e.height>0?e.height:e.videoHeight;t.width=0;e--){const t=o[e]=new Array(r);for(let e=0;e`const result_${e.name} = new ${t}(outputX);\n`).join(" ")}\n ${this._mapSubKernels(e=>`let subKernelResult_${e.name};\n`).join(" ")}\n for (let x = 0; x < outputX; x++) {\n this.thread.x = x;\n this.thread.y = 0;\n this.thread.z = 0;\n ${e}\n }`}_mutableKernel1DResults(){const e=this._getKernelResultTypeConstructorString();return` const outputX = _this.output[0];\n const result = new ${e}(outputX);\n ${this._mapSubKernels(t=>`const result_${t.name} = new ${e}(outputX);\n`).join(" ")}\n ${this._mapSubKernels(e=>`let subKernelResult_${e.name};\n`).join(" ")}`}_resultMutableKernel1DLoop(e){return` const outputX = _this.output[0];\n for (let x = 0; x < outputX; x++) {\n this.thread.x = x;\n this.thread.y = 0;\n this.thread.z = 0;\n ${e}\n }`}_resultImmutableKernel2DLoop(e){const t=this._getKernelResultTypeConstructorString();return` const outputX = _this.output[0];\n const outputY = _this.output[1];\n const result = new Array(outputY);\n ${this._mapSubKernels(e=>`const result_${e.name} = new Array(outputY);\n`).join(" ")}\n ${this._mapSubKernels(e=>`let subKernelResult_${e.name};\n`).join(" ")}\n for (let y = 0; y < outputY; y++) {\n this.thread.z = 0;\n this.thread.y = y;\n const resultX = result[y] = new ${t}(outputX);\n ${this._mapSubKernels(e=>`const resultX_${e.name} = result_${e.name}[y] = new ${t}(outputX);\n`).join("")}\n for (let x = 0; x < outputX; x++) {\n this.thread.x = x;\n ${e}\n }\n }`}_mutableKernel2DResults(){const e=this._getKernelResultTypeConstructorString();return` const outputX = _this.output[0];\n const outputY = _this.output[1];\n const result = new Array(outputY);\n ${this._mapSubKernels(e=>`const result_${e.name} = new Array(outputY);\n`).join(" ")}\n ${this._mapSubKernels(e=>`let subKernelResult_${e.name};\n`).join(" ")}\n for (let y = 0; y < outputY; y++) {\n const resultX = result[y] = new ${e}(outputX);\n ${this._mapSubKernels(t=>`const resultX_${t.name} = result_${t.name}[y] = new ${e}(outputX);\n`).join("")}\n }`}_resultMutableKernel2DLoop(e){const t=this._getKernelResultTypeConstructorString();return` const outputX = _this.output[0];\n const outputY = _this.output[1];\n for (let y = 0; y < outputY; y++) {\n this.thread.z = 0;\n this.thread.y = y;\n const resultX = result[y];\n ${this._mapSubKernels(e=>`const resultX_${e.name} = result_${e.name}[y] = new ${t}(outputX);\n`).join("")}\n for (let x = 0; x < outputX; x++) {\n this.thread.x = x;\n ${e}\n }\n }`}_graphicalKernel2DLoop(e){return` const outputX = _this.output[0];\n const outputY = _this.output[1];\n for (let y = 0; y < outputY; y++) {\n this.thread.z = 0;\n this.thread.y = y;\n for (let x = 0; x < outputX; x++) {\n this.thread.x = x;\n ${e}\n }\n }`}_resultImmutableKernel3DLoop(e){const t=this._getKernelResultTypeConstructorString();return` const outputX = _this.output[0];\n const outputY = _this.output[1];\n const outputZ = _this.output[2];\n const result = new Array(outputZ);\n ${this._mapSubKernels(e=>`const result_${e.name} = new Array(outputZ);\n`).join(" ")}\n ${this._mapSubKernels(e=>`let subKernelResult_${e.name};\n`).join(" ")}\n for (let z = 0; z < outputZ; z++) {\n this.thread.z = z;\n const resultY = result[z] = new Array(outputY);\n ${this._mapSubKernels(e=>`const resultY_${e.name} = result_${e.name}[z] = new Array(outputY);\n`).join(" ")}\n for (let y = 0; y < outputY; y++) {\n this.thread.y = y;\n const resultX = resultY[y] = new ${t}(outputX);\n ${this._mapSubKernels(e=>`const resultX_${e.name} = resultY_${e.name}[y] = new ${t}(outputX);\n`).join(" ")}\n for (let x = 0; x < outputX; x++) {\n this.thread.x = x;\n ${e}\n }\n }\n }`}_mutableKernel3DResults(){const e=this._getKernelResultTypeConstructorString();return` const outputX = _this.output[0];\n const outputY = _this.output[1];\n const outputZ = _this.output[2];\n const result = new Array(outputZ);\n ${this._mapSubKernels(e=>`const result_${e.name} = new Array(outputZ);\n`).join(" ")}\n ${this._mapSubKernels(e=>`let subKernelResult_${e.name};\n`).join(" ")}\n for (let z = 0; z < outputZ; z++) {\n const resultY = result[z] = new Array(outputY);\n ${this._mapSubKernels(e=>`const resultY_${e.name} = result_${e.name}[z] = new Array(outputY);\n`).join(" ")}\n for (let y = 0; y < outputY; y++) {\n const resultX = resultY[y] = new ${e}(outputX);\n ${this._mapSubKernels(t=>`const resultX_${t.name} = resultY_${t.name}[y] = new ${e}(outputX);\n`).join(" ")}\n }\n }`}_resultMutableKernel3DLoop(e){return` const outputX = _this.output[0];\n const outputY = _this.output[1];\n const outputZ = _this.output[2];\n for (let z = 0; z < outputZ; z++) {\n this.thread.z = z;\n const resultY = result[z];\n for (let y = 0; y < outputY; y++) {\n this.thread.y = y;\n const resultX = resultY[y];\n for (let x = 0; x < outputX; x++) {\n this.thread.x = x;\n ${e}\n }\n }\n }`}_kernelOutput(){return this.subKernels?`\n return {\n result: result,\n ${this.subKernels.map(e=>`${e.property}: result_${e.name}`).join(",\n ")}\n };`:"\n return result;"}_mapSubKernels(e){return null===this.subKernels?[""]:this.subKernels.map(e)}destroy(e){e&&delete this.canvas}static destroyContext(e){}toJSON(){const e=super.toJSON();return e.functionNodes=i.fromKernel(this,s).toJSON(),e}setOutput(e){super.setOutput(e);const[t,r]=this.output;this.graphical&&(this._imageData=this.context.createImageData(t,r),this._colorData=new Uint8ClampedArray(t*r*4))}prependString(e){if(this._kernelString)throw new Error("Kernel already built");this._prependedString.push(e)}hasPrependString(e){return this._prependedString.indexOf(e)>-1}}}},{"../../utils":279,"../function-builder":176,"../kernel":203,"./function-node":173,"./kernel-string":174}],176:[function(e,t,r){class n{static fromKernel(e,t,r){const{kernelArguments:i,kernelConstants:s,argumentNames:o,argumentSizes:a,argumentBitRatios:u,constants:l,constantBitRatios:c,debug:h,loopMaxIterations:p,nativeFunctions:f,output:d,optimizeFloatMemory:m,precision:g,plugins:v,source:y,subKernels:_,functions:b,leadingReturnStatement:x,followingReturnStatement:w,dynamicArguments:E,dynamicOutput:T}=e,A=new Array(i.length),S={};for(let e=0;eV.needsArgumentType(e,t),C=(e,t,r)=>{V.assignArgumentType(e,t,r)},I=(e,t,r)=>V.lookupReturnType(e,t,r),R=e=>V.lookupFunctionArgumentTypes(e),O=(e,t)=>V.lookupFunctionArgumentName(e,t),L=(e,t)=>V.lookupFunctionArgumentBitRatio(e,t),P=(e,t,r,n)=>{V.assignArgumentType(e,t,r,n)},M=(e,t,r,n)=>{V.assignArgumentBitRatio(e,t,r,n)},B=(e,t,r)=>{V.trackFunctionCall(e,t,r)},N=(e,r)=>{const n=[];for(let t=0;tnew t(e.source,{returnType:e.returnType,argumentTypes:e.argumentTypes,output:d,plugins:v,constants:l,constantTypes:S,constantBitRatios:c,optimizeFloatMemory:m,precision:g,lookupReturnType:I,lookupFunctionArgumentTypes:R,lookupFunctionArgumentName:O,lookupFunctionArgumentBitRatio:L,needsArgumentType:k,assignArgumentType:C,triggerImplyArgumentType:P,triggerImplyArgumentBitRatio:M,onFunctionCall:B,onNestedFunction:N})));let $=null;_&&($=_.map(e=>{const{name:r,source:n}=e;return new t(n,Object.assign({},D,{name:r,isSubKernel:!0,isRootKernel:!1}))}));const V=new n({kernel:e,rootNode:j,functionNodes:U,nativeFunctions:f,subKernelNodes:$});return V}constructor(e){if(e=e||{},this.kernel=e.kernel,this.rootNode=e.rootNode,this.functionNodes=e.functionNodes||[],this.subKernelNodes=e.subKernelNodes||[],this.nativeFunctions=e.nativeFunctions||[],this.functionMap={},this.nativeFunctionNames=[],this.lookupChain=[],this.functionNodeDependencies={},this.functionCalls={},this.rootNode&&(this.functionMap.kernel=this.rootNode),this.functionNodes)for(let e=0;e-1){const r=t.indexOf(e);if(-1===r)t.push(e);else{const e=t.splice(r,1)[0];t.push(e)}return t}const r=this.functionMap[e];if(r){const n=t.indexOf(e);if(-1===n){t.push(e),r.toString();for(let e=0;e-1){t.push(this.nativeFunctions[i].source);continue}const s=this.functionMap[n];s&&t.push(s.toString())}return t}toJSON(){return this.traceFunctionCalls(this.rootNode.name).reverse().map(e=>{const t=this.nativeFunctions.indexOf(e);if(t>-1)return{name:e,source:this.nativeFunctions[t].source};if(this.functionMap[e])return this.functionMap[e].toJSON();throw new Error(`function ${e} not found`)})}fromJSON(e,t){this.functionMap={};for(let r=0;r0){const i=t.arguments;for(let t=0;t0&&this.argumentTypes.length!==this.argumentNames.length)throw new Error(`argumentTypes count of ${this.argumentTypes.length} exceeds ${this.argumentNames.length}`);if(this.output.length<1)throw new Error("this.output is not big enough")}isIdentifierConstant(e){return!!this.constants&&this.constants.hasOwnProperty(e)}isInput(e){return"Input"===this.argumentTypes[this.argumentNames.indexOf(e)]}pushState(e){this.states.push(e)}popState(e){if(this.state!==e)throw new Error(`Cannot popState ${e} when in ${this.state}`);this.states.pop()}isState(e){return this.state===e}get state(){return this.states[this.states.length-1]}astMemberExpressionUnroll(e){if("Identifier"===e.type)return e.name;if("ThisExpression"===e.type)return"this";if("MemberExpression"===e.type&&e.object&&e.property)return e.object.hasOwnProperty("name")&&"Math"!==e.object.name?this.astMemberExpressionUnroll(e.property):this.astMemberExpressionUnroll(e.object)+"."+this.astMemberExpressionUnroll(e.property);if(e.hasOwnProperty("expressions")){const t=e.expressions[0];if("Literal"===t.type&&0===t.value&&2===e.expressions.length)return this.astMemberExpressionUnroll(e.expressions[1])}throw this.astErrorOutput("Unknown astMemberExpressionUnroll",e)}getJsAST(e){if(this.ast)return this.ast;if("object"==typeof this.source)return this.traceFunctionAST(this.source),this.ast=this.source;if(null===(e=e||n))throw new Error("Missing JS to AST parser");const t=Object.freeze(e.parse(`const parser_${this.name} = ${this.source};`,{locations:!0})),r=t.body[0].declarations[0].init;if(this.traceFunctionAST(r),!t)throw new Error("Failed to parse JS code");return this.ast=r}traceFunctionAST(e){const{contexts:t,declarations:r,functions:n,identifiers:i,functionCalls:o}=new s(e);this.contexts=t,this.identifiers=i,this.functionCalls=o,this.functions=n;for(let e=0;e":case"<":return"Boolean";case"&":case"|":case"^":case"<<":case">>":case">>>":return"Integer"}const r=this.getType(e.left);if(this.isState("skip-literal-correction"))return r;if("LiteralInteger"===r){const t=this.getType(e.right);return"LiteralInteger"===t?e.left.value%1==0?"Integer":"Float":t}return o[r]||r;case"UpdateExpression":return this.getType(e.argument);case"UnaryExpression":return"~"===e.operator?"Integer":this.getType(e.argument);case"VariableDeclaration":{const t=e.declarations;let r;for(let e=0;e-1}isAstMathFunction(e){return"CallExpression"===e.type&&e.callee&&"MemberExpression"===e.callee.type&&e.callee.object&&"Identifier"===e.callee.object.type&&"Math"===e.callee.object.name&&e.callee.property&&"Identifier"===e.callee.property.type&&["abs","acos","acosh","asin","asinh","atan","atan2","atanh","cbrt","ceil","clz32","cos","cosh","expm1","exp","floor","fround","imul","log","log2","log10","log1p","max","min","pow","random","round","sign","sin","sinh","sqrt","tan","tanh","trunc"].indexOf(e.callee.property.name)>-1}isAstVariable(e){return"Identifier"===e.type||"MemberExpression"===e.type}isSafe(e){return this.isSafeDependencies(this.getDependencies(e))}isSafeDependencies(e){return!e||!e.every||e.every(e=>e.isSafe)}getDependencies(e,t,r){if(t||(t=[]),!e)return null;if(Array.isArray(e)){for(let n=0;n-1/0&&e.value<1/0&&!isNaN(e.value)});break;case"VariableDeclarator":return this.getDependencies(e.init,t,r);case"Identifier":const n=this.getDeclaration(e);if(n)t.push({name:e.name,origin:"declaration",isSafe:!r&&this.isSafeDependencies(n.dependencies)});else if(this.argumentNames.indexOf(e.name)>-1)t.push({name:e.name,origin:"argument",isSafe:!1});else if(this.strictTypingChecking)throw new Error(`Cannot find identifier origin "${e.name}"`);break;case"FunctionDeclaration":return this.getDependencies(e.body.body[e.body.body.length-1],t,r);case"ReturnStatement":return this.getDependencies(e.argument,t);case"BinaryExpression":case"LogicalExpression":return r="/"===e.operator||"*"===e.operator,this.getDependencies(e.left,t,r),this.getDependencies(e.right,t,r),t;case"UnaryExpression":case"UpdateExpression":return this.getDependencies(e.argument,t,r);case"VariableDeclaration":return this.getDependencies(e.declarations,t,r);case"ArrayExpression":return t.push({origin:"declaration",isSafe:!0}),t;case"CallExpression":return t.push({origin:"function",isSafe:!0}),t;case"MemberExpression":const i=this.getMemberExpressionDetails(e);switch(i.signature){case"value[]":this.getDependencies(e.object,t,r);break;case"value[][]":this.getDependencies(e.object.object,t,r);break;case"value[][][]":this.getDependencies(e.object.object.object,t,r);break;case"this.output.value":this.dynamicOutput&&t.push({name:i.name,origin:"output",isSafe:!1})}if(i)return i.property&&this.getDependencies(i.property,t,r),i.xProperty&&this.getDependencies(i.xProperty,t,r),i.yProperty&&this.getDependencies(i.yProperty,t,r),i.zProperty&&this.getDependencies(i.zProperty,t,r),t;case"SequenceExpression":return this.getDependencies(e.expressions,t,r);default:throw this.astErrorOutput(`Unhandled type ${e.type} in getDependencies`,e)}return t}getVariableSignature(e,t){if(!this.isAstVariable(e))throw new Error(`ast of type "${e.type}" is not a variable signature`);if("Identifier"===e.type)return"value";const r=[];for(;e;)e.computed?r.push("[]"):"ThisExpression"===e.type?r.unshift("this"):e.property&&e.property.name?"x"===e.property.name||"y"===e.property.name||"z"===e.property.name?r.unshift(t?"."+e.property.name:".value"):"constants"===e.property.name||"thread"===e.property.name||"output"===e.property.name?r.unshift("."+e.property.name):r.unshift(t?"."+e.property.name:".value"):e.name?r.unshift(t?e.name:"value"):e.callee&&e.callee.name?r.unshift(t?e.callee.name+"()":"fn()"):e.elements?r.unshift("[]"):r.unshift("unknown"),e=e.object;const n=r.join("");return t?n:["value","value[]","value[][]","value[][][]","value[][][][]","value.value","value.thread.value","this.thread.value","this.output.value","this.constants.value","this.constants.value[]","this.constants.value[][]","this.constants.value[][][]","this.constants.value[][][][]","fn()[]","fn()[][]","fn()[][][]","[][]"].indexOf(n)>-1?n:null}build(){return this.toString().length>0}astGeneric(e,t){if(null===e)throw this.astErrorOutput("NULL ast",e);if(Array.isArray(e)){for(let r=0;r0?n[n.length-1]:0;return new Error(`${e} on line ${n.length}, position ${s.length}:\n ${r}`)}astDebuggerStatement(e,t){return t}astConditionalExpression(e,t){if("ConditionalExpression"!==e.type)throw this.astErrorOutput("Not a conditional expression",e);return t.push("("),this.astGeneric(e.test,t),t.push("?"),this.astGeneric(e.consequent,t),t.push(":"),this.astGeneric(e.alternate,t),t.push(")"),t}astFunction(e,t){throw new Error(`"astFunction" not defined on ${this.constructor.name}`)}astFunctionDeclaration(e,t){return this.isChildFunction(e)?t:this.astFunction(e,t)}astFunctionExpression(e,t){return this.isChildFunction(e)?t:this.astFunction(e,t)}isChildFunction(e){for(let t=0;t1?t.push("(",n.join(","),")"):t.push(n[0]),t}astUnaryExpression(e,t){return this.checkAndUpconvertBitwiseUnary(e,t)?t:(e.prefix?(t.push(e.operator),this.astGeneric(e.argument,t)):(this.astGeneric(e.argument,t),t.push(e.operator)),t)}checkAndUpconvertBitwiseUnary(e,t){}astUpdateExpression(e,t){return e.prefix?(t.push(e.operator),this.astGeneric(e.argument,t)):(this.astGeneric(e.argument,t),t.push(e.operator)),t}astLogicalExpression(e,t){return t.push("("),this.astGeneric(e.left,t),t.push(e.operator),this.astGeneric(e.right,t),t.push(")"),t}astMemberExpression(e,t){return t}astCallExpression(e,t){return t}astArrayExpression(e,t){return t}getMemberExpressionDetails(e){if("MemberExpression"!==e.type)throw this.astErrorOutput(`Expression ${e.type} not a MemberExpression`,e);let t=null,r=null;const n=this.getVariableSignature(e);switch(n){case"value":return null;case"value.thread.value":case"this.thread.value":case"this.output.value":return{signature:n,type:"Integer",name:e.property.name};case"value[]":if("string"!=typeof e.object.name)throw this.astErrorOutput("Unexpected expression",e);return{name:t=e.object.name,origin:"user",signature:n,type:this.getVariableType(e.object),xProperty:e.property};case"value[][]":if("string"!=typeof e.object.object.name)throw this.astErrorOutput("Unexpected expression",e);return{name:t=e.object.object.name,origin:"user",signature:n,type:this.getVariableType(e.object.object),yProperty:e.object.property,xProperty:e.property};case"value[][][]":if("string"!=typeof e.object.object.object.name)throw this.astErrorOutput("Unexpected expression",e);return{name:t=e.object.object.object.name,origin:"user",signature:n,type:this.getVariableType(e.object.object.object),zProperty:e.object.object.property,yProperty:e.object.property,xProperty:e.property};case"value[][][][]":if("string"!=typeof e.object.object.object.object.name)throw this.astErrorOutput("Unexpected expression",e);return{name:t=e.object.object.object.object.name,origin:"user",signature:n,type:this.getVariableType(e.object.object.object.object),zProperty:e.object.object.property,yProperty:e.object.property,xProperty:e.property};case"value.value":if("string"!=typeof e.property.name)throw this.astErrorOutput("Unexpected expression",e);if(this.isAstMathVariable(e))return{name:t=e.property.name,origin:"Math",type:"Number",signature:n};switch(e.property.name){case"r":case"g":case"b":case"a":return{name:t=e.object.name,property:e.property.name,origin:"user",signature:n,type:"Number"};default:throw this.astErrorOutput("Unexpected expression",e)}case"this.constants.value":if("string"!=typeof e.property.name)throw this.astErrorOutput("Unexpected expression",e);if(t=e.property.name,!(r=this.getConstantType(t)))throw this.astErrorOutput("Constant has no type",e);return{name:t,type:r,origin:"constants",signature:n};case"this.constants.value[]":if("string"!=typeof e.object.property.name)throw this.astErrorOutput("Unexpected expression",e);if(t=e.object.property.name,!(r=this.getConstantType(t)))throw this.astErrorOutput("Constant has no type",e);return{name:t,type:r,origin:"constants",signature:n,xProperty:e.property};case"this.constants.value[][]":if("string"!=typeof e.object.object.property.name)throw this.astErrorOutput("Unexpected expression",e);if(t=e.object.object.property.name,!(r=this.getConstantType(t)))throw this.astErrorOutput("Constant has no type",e);return{name:t,type:r,origin:"constants",signature:n,yProperty:e.object.property,xProperty:e.property};case"this.constants.value[][][]":if("string"!=typeof e.object.object.object.property.name)throw this.astErrorOutput("Unexpected expression",e);if(t=e.object.object.object.property.name,!(r=this.getConstantType(t)))throw this.astErrorOutput("Constant has no type",e);return{name:t,type:r,origin:"constants",signature:n,zProperty:e.object.object.property,yProperty:e.object.property,xProperty:e.property};case"fn()[]":case"fn()[][]":case"[][]":return{signature:n,property:e.property};default:throw this.astErrorOutput("Unexpected expression",e)}}findIdentifierOrigin(e){const t=[this.ast];for(;t.length>0;){const r=t[0];if("VariableDeclarator"===r.type&&r.id&&r.id.name&&r.id.name===e.name)return r;if(t.shift(),r.argument)t.push(r.argument);else if(r.body)t.push(r.body);else if(r.declarations)t.push(r.declarations);else if(Array.isArray(r))for(let e=0;e0;){const e=t.pop();if("ReturnStatement"===e.type)return e;if("FunctionDeclaration"!==e.type)if(e.argument)t.push(e.argument);else if(e.body)t.push(e.body);else if(e.declarations)t.push(e.declarations);else if(Array.isArray(e))for(let r=0;r0?e[e.length-1]:null}const s={trackIdentifiers:"trackIdentifiers",memberExpression:"memberExpression",inForLoopInit:"inForLoopInit"};t.exports={FunctionTracer:class{constructor(e){this.runningContexts=[],this.functionContexts=[],this.contexts=[],this.functionCalls=[],this.declarations=[],this.identifiers=[],this.functions=[],this.returnStatements=[],this.trackedIdentifiers=null,this.states=[],this.newFunctionContext(),this.scan(e)}isState(e){return this.states[this.states.length-1]===e}hasState(e){return this.states.indexOf(e)>-1}pushState(e){this.states.push(e)}popState(e){if(!this.isState(e))throw new Error(`Cannot pop the non-active state "${e}"`);this.states.pop()}get currentFunctionContext(){return i(this.functionContexts)}get currentContext(){return i(this.runningContexts)}newFunctionContext(){const e={"@contextType":"function"};this.contexts.push(e),this.functionContexts.push(e)}newContext(e){const t=Object.assign({"@contextType":"const/let"},this.currentContext);this.contexts.push(t),this.runningContexts.push(t),e();const{currentFunctionContext:r}=this;for(const e in r)r.hasOwnProperty(e)&&!t.hasOwnProperty(e)&&(t[e]=r[e]);return this.runningContexts.pop(),t}useFunctionContext(e){const t=i(this.functionContexts);this.runningContexts.push(t),e(),this.runningContexts.pop()}getIdentifiers(e){const t=this.trackedIdentifiers=[];return this.pushState(s.trackIdentifiers),e(),this.trackedIdentifiers=null,this.popState(s.trackIdentifiers),t}getDeclaration(e){const{currentContext:t,currentFunctionContext:r,runningContexts:n}=this,i=t[e]||r[e]||null;if(!i&&t===r&&n.length>0){const t=n[n.length-2];if(t[e])return t[e]}return i}scan(e){if(e)if(Array.isArray(e))for(let t=0;t{this.scan(e.body)});break;case"BlockStatement":this.newContext(()=>{this.scan(e.body)});break;case"AssignmentExpression":case"LogicalExpression":case"BinaryExpression":this.scan(e.left),this.scan(e.right);break;case"UpdateExpression":if("++"===e.operator){const t=this.getDeclaration(e.argument.name);t&&(t.suggestedType="Integer")}this.scan(e.argument);break;case"UnaryExpression":this.scan(e.argument);break;case"VariableDeclaration":"var"===e.kind?this.useFunctionContext(()=>{e.declarations=n.normalizeDeclarations(e),this.scan(e.declarations)}):(e.declarations=n.normalizeDeclarations(e),this.scan(e.declarations));break;case"VariableDeclarator":{const{currentContext:t}=this,r=this.hasState(s.inForLoopInit),n={ast:e,context:t,name:e.id.name,origin:"declaration",inForLoopInit:r,inForLoopTest:null,assignable:t===this.currentFunctionContext||!r&&!t.hasOwnProperty(e.id.name),suggestedType:null,valueType:null,dependencies:null,isSafe:null};t[e.id.name]||(t[e.id.name]=n),this.declarations.push(n),this.scan(e.id),this.scan(e.init);break}case"FunctionExpression":case"FunctionDeclaration":0===this.runningContexts.length?this.scan(e.body):this.functions.push(e);break;case"IfStatement":this.scan(e.test),this.scan(e.consequent),e.alternate&&this.scan(e.alternate);break;case"ForStatement":{let t;const r=this.newContext(()=>{this.pushState(s.inForLoopInit),this.scan(e.init),this.popState(s.inForLoopInit),t=this.getIdentifiers(()=>{this.scan(e.test)}),this.scan(e.update),this.newContext(()=>{this.scan(e.body)})});if(t)for(const e in r)"@contextType"!==e&&t.indexOf(e)>-1&&(r[e].inForLoopTest=!0);break}case"DoWhileStatement":case"WhileStatement":this.newContext(()=>{this.scan(e.body),this.scan(e.test)});break;case"Identifier":this.isState(s.trackIdentifiers)&&this.trackedIdentifiers.push(e.name),this.identifiers.push({context:this.currentContext,declaration:this.getDeclaration(e.name),ast:e});break;case"ReturnStatement":this.returnStatements.push(e),this.scan(e.argument);break;case"MemberExpression":this.pushState(s.memberExpression),this.scan(e.object),this.scan(e.property),this.popState(s.memberExpression);break;case"ExpressionStatement":this.scan(e.expression);break;case"SequenceExpression":this.scan(e.expressions);break;case"CallExpression":this.functionCalls.push({context:this.currentContext,ast:e}),this.scan(e.arguments);break;case"ArrayExpression":this.scan(e.elements);break;case"ConditionalExpression":this.scan(e.test),this.scan(e.alternate),this.scan(e.consequent);break;case"SwitchStatement":this.scan(e.discriminant),this.scan(e.cases);break;case"SwitchCase":this.scan(e.test),this.scan(e.consequent);break;case"ThisExpression":case"Literal":case"DebuggerStatement":case"EmptyStatement":case"BreakStatement":case"ContinueStatement":break;default:throw new Error(`unhandled type "${e.type}"`)}}}}},{"../utils":279}],179:[function(e,t,r){const{glWiretap:n}=e("gl-wiretap"),{utils:i}=e("../../utils");function s(e){return e.toString().replace("=>","").replace(/^function /,"").replace(/utils[.]/g,"/*utils.*/")}function o(e,t){const r="single"===t.precision?e:`new Float32Array(${e}.buffer)`;return t.output[2]?`renderOutput(${r}, ${t.output[0]}, ${t.output[1]}, ${t.output[2]})`:t.output[1]?`renderOutput(${r}, ${t.output[0]}, ${t.output[1]})`:`renderOutput(${r}, ${t.output[0]})`}function a(e,t,r){const n=e.toArray.toString(),s=!/^function/.test(n);return`() => {\n function framebuffer() { return ${r}; };\n ${i.flattenFunctionToString(`${s?"function ":""}${n}`,{findDependency:(t,r)=>{if("utils"===t)return`const ${r} = ${i[r].toString()};`;if("this"===t)return"framebuffer"===r?"":`${s?"function ":""}${e[r].toString()}`;throw new Error("unhandled fromObject")},thisLookup:(r,n)=>{if("texture"===r)return t;if("context"===r)return n?null:"gl";if(e.hasOwnProperty(r))return JSON.stringify(e[r]);throw new Error(`unhandled thisLookup ${r}`)}})}\n return toArray();\n }`}function u(e,t,r,n,i){if(null===e)return null;if(null===t)return null;switch(typeof e){case"boolean":case"number":return null}if("undefined"!=typeof HTMLImageElement&&e instanceof HTMLImageElement)for(let i=0;i{switch(typeof e){case"boolean":return new Boolean(e);case"number":return new Number(e);default:return e}}):null;const h=[],p=n(r.context,{useTrackablePrimitives:!0,onReadPixels:e=>{if(M.subKernels){if(f){const t=M.subKernels[d++].property;h.push(` result${isNaN(t)?"."+t:`[${t}]`} = ${o(e,M)};`)}else h.push(` const result = { result: ${o(e,M)} };`),f=!0;d===M.subKernels.length&&h.push(" return result;")}else e?h.push(` return ${o(e,M)};`):h.push(" return null;")},onUnrecognizedArgumentLookup:e=>{const t=u(e,M.kernelArguments,[],p);if(t)return t;const r=u(e,M.kernelConstants,x?Object.keys(x).map(e=>x[e]):[],p);return r||null}});let f=!1,d=0;const{source:m,canvas:g,output:v,pipeline:y,graphical:_,loopMaxIterations:b,constants:x,optimizeFloatMemory:w,precision:E,fixIntegerDivisionAccuracy:T,functions:A,nativeFunctions:S,subKernels:k,immutable:C,argumentTypes:I,constantTypes:R,kernelArguments:O,kernelConstants:L,tactic:P}=r,M=new e(m,{canvas:g,context:p,checkContext:!1,output:v,pipeline:y,graphical:_,loopMaxIterations:b,constants:x,optimizeFloatMemory:w,precision:E,fixIntegerDivisionAccuracy:T,functions:A,nativeFunctions:S,subKernels:k,immutable:C,argumentTypes:I,constantTypes:R,tactic:P});let B=[];if(p.setIndent(2),M.build.apply(M,t),B.push(p.toString()),p.reset(),M.kernelArguments.forEach((e,r)=>{switch(e.type){case"Integer":case"Boolean":case"Number":case"Float":case"Array":case"Array(2)":case"Array(3)":case"Array(4)":case"HTMLCanvas":case"HTMLImage":case"HTMLVideo":p.insertVariable(`uploadValue_${e.name}`,e.uploadValue);break;case"HTMLImageArray":for(let n=0;ne.varName).join(", ")}) {`),p.setIndent(4),M.run.apply(M,t),M.renderKernels?M.renderKernels():M.renderOutput&&M.renderOutput(),B.push(" /** start setup uploads for kernel values **/"),M.kernelArguments.forEach(e=>{B.push(" "+e.getStringValueHandler().split("\n").join("\n "))}),B.push(" /** end setup uploads for kernel values **/"),B.push(p.toString()),M.renderOutput===M.renderTexture){p.reset();const e=p.getContextVariableName(M.framebuffer);if(M.renderKernels){const t=M.renderKernels(),r=p.getContextVariableName(M.texture.texture);B.push(` return {\n result: {\n texture: ${r},\n type: '${t.result.type}',\n toArray: ${a(t.result,r,e)}\n },`);const{subKernels:n,mappedTextures:i}=M;for(let r=0;r"utils"===e?`const ${t} = ${i[t].toString()};`:null,thisLookup:t=>{if("context"===t)return null;if(e.hasOwnProperty(t))return JSON.stringify(e[t]);throw new Error(`unhandled thisLookup ${t}`)}})}(M)),B.push(" innerKernel.getPixels = getPixels;")),B.push(" return innerKernel;");let N=[];return L.forEach(e=>{N.push(`${e.getStringValueHandler()}`)}),`function kernel(settings) {\n const { context, constants } = settings;\n ${N.join("")}\n ${l||""}\n${B.join("\n")}\n}`}}},{"../../utils":279,"gl-wiretap":124}],180:[function(e,t,r){const{Kernel:n}=e("../kernel"),{utils:i}=e("../../utils"),{GLTextureArray2Float:s}=e("./texture/array-2-float"),{GLTextureArray2Float2D:o}=e("./texture/array-2-float-2d"),{GLTextureArray2Float3D:a}=e("./texture/array-2-float-3d"),{GLTextureArray3Float:u}=e("./texture/array-3-float"),{GLTextureArray3Float2D:l}=e("./texture/array-3-float-2d"),{GLTextureArray3Float3D:c}=e("./texture/array-3-float-3d"),{GLTextureArray4Float:h}=e("./texture/array-4-float"),{GLTextureArray4Float2D:p}=e("./texture/array-4-float-2d"),{GLTextureArray4Float3D:f}=e("./texture/array-4-float-3d"),{GLTextureFloat:d}=e("./texture/float"),{GLTextureFloat2D:m}=e("./texture/float-2d"),{GLTextureFloat3D:g}=e("./texture/float-3d"),{GLTextureMemoryOptimized:v}=e("./texture/memory-optimized"),{GLTextureMemoryOptimized2D:y}=e("./texture/memory-optimized-2d"),{GLTextureMemoryOptimized3D:_}=e("./texture/memory-optimized-3d"),{GLTextureUnsigned:b}=e("./texture/unsigned"),{GLTextureUnsigned2D:x}=e("./texture/unsigned-2d"),{GLTextureUnsigned3D:w}=e("./texture/unsigned-3d"),{GLTextureGraphical:E}=e("./texture/graphical");const T={int:"Integer",float:"Number",vec2:"Array(2)",vec3:"Array(3)",vec4:"Array(4)"};t.exports={GLKernel:class extends n{static get mode(){return"gpu"}static getIsFloatRead(){const e=new this("function kernelFunction() {\n return 1;\n }",{context:this.testContext,canvas:this.testCanvas,validate:!1,output:[1],precision:"single",returnType:"Number",tactic:"speed"});e.build(),e.run();const t=e.renderOutput();return e.destroy(!0),1===t[0]}static getIsIntegerDivisionAccurate(){const e=new this(function(e,t){return e[this.thread.x]/t[this.thread.x]}.toString(),{context:this.testContext,canvas:this.testCanvas,validate:!1,output:[2],returnType:"Number",precision:"unsigned",tactic:"speed"}),t=[[6,6030401],[3,3991]];e.build.apply(e,t),e.run.apply(e,t);const r=e.renderOutput();return e.destroy(!0),2===r[0]&&1511===r[1]}static getIsSpeedTacticSupported(){const e=new this(function(e){return e[this.thread.x]}.toString(),{context:this.testContext,canvas:this.testCanvas,validate:!1,output:[4],returnType:"Number",precision:"unsigned",tactic:"speed"}),t=[[0,1,2,3]];e.build.apply(e,t),e.run.apply(e,t);const r=e.renderOutput();return e.destroy(!0),0===Math.round(r[0])&&1===Math.round(r[1])&&2===Math.round(r[2])&&3===Math.round(r[3])}static get testCanvas(){throw new Error(`"testCanvas" not defined on ${this.name}`)}static get testContext(){throw new Error(`"testContext" not defined on ${this.name}`)}static getFeatures(){const e=this.testContext,t=this.getIsDrawBuffers();return Object.freeze({isFloatRead:this.getIsFloatRead(),isIntegerDivisionAccurate:this.getIsIntegerDivisionAccurate(),isSpeedTacticSupported:this.getIsSpeedTacticSupported(),isTextureFloat:this.getIsTextureFloat(),isDrawBuffers:t,kernelMap:t,channelCount:this.getChannelCount(),maxTextureSize:this.getMaxTextureSize(),lowIntPrecision:e.getShaderPrecisionFormat(e.FRAGMENT_SHADER,e.LOW_INT),lowFloatPrecision:e.getShaderPrecisionFormat(e.FRAGMENT_SHADER,e.LOW_FLOAT),mediumIntPrecision:e.getShaderPrecisionFormat(e.FRAGMENT_SHADER,e.MEDIUM_INT),mediumFloatPrecision:e.getShaderPrecisionFormat(e.FRAGMENT_SHADER,e.MEDIUM_FLOAT),highIntPrecision:e.getShaderPrecisionFormat(e.FRAGMENT_SHADER,e.HIGH_INT),highFloatPrecision:e.getShaderPrecisionFormat(e.FRAGMENT_SHADER,e.HIGH_FLOAT)})}static setupFeatureChecks(){throw new Error(`"setupFeatureChecks" not defined on ${this.name}`)}static getSignature(e,t){return e.getVariablePrecisionString()+(t.length>0?":"+t.join(","):"")}setFixIntegerDivisionAccuracy(e){return this.fixIntegerDivisionAccuracy=e,this}setPrecision(e){return this.precision=e,this}setFloatTextures(e){return i.warnDeprecated("method","setFloatTextures","setOptimizeFloatMemory"),this.floatTextures=e,this}static nativeFunctionArguments(e){const t=[],r=[],n=[],i=/^[a-zA-Z_]/,s=/[a-zA-Z_0-9]/;let o=0,a=null,u=null;for(;o0?n[n.length-1]:null;if("FUNCTION_ARGUMENTS"!==h||"/"!==l||"*"!==c)if("MULTI_LINE_COMMENT"!==h||"*"!==l||"/"!==c)if("FUNCTION_ARGUMENTS"!==h||"/"!==l||"/"!==c)if("COMMENT"!==h||"\n"!==l)if(null!==h||"("!==l){if("FUNCTION_ARGUMENTS"===h){if(")"===l){n.pop();break}if("f"===l&&"l"===c&&"o"===e[o+2]&&"a"===e[o+3]&&"t"===e[o+4]&&" "===e[o+5]){n.push("DECLARE_VARIABLE"),u="float",a="",o+=6;continue}if("i"===l&&"n"===c&&"t"===e[o+2]&&" "===e[o+3]){n.push("DECLARE_VARIABLE"),u="int",a="",o+=4;continue}if("v"===l&&"e"===c&&"c"===e[o+2]&&"2"===e[o+3]&&" "===e[o+4]){n.push("DECLARE_VARIABLE"),u="vec2",a="",o+=5;continue}if("v"===l&&"e"===c&&"c"===e[o+2]&&"3"===e[o+3]&&" "===e[o+4]){n.push("DECLARE_VARIABLE"),u="vec3",a="",o+=5;continue}if("v"===l&&"e"===c&&"c"===e[o+2]&&"4"===e[o+3]&&" "===e[o+4]){n.push("DECLARE_VARIABLE"),u="vec4",a="",o+=5;continue}}else if("DECLARE_VARIABLE"===h){if(""===a){if(" "===l){o++;continue}if(!i.test(l))throw new Error("variable name is not expected string")}a+=l,s.test(c)||(n.pop(),r.push(a),t.push(T[u]))}o++}else n.push("FUNCTION_ARGUMENTS"),o++;else n.pop(),o++;else n.push("COMMENT"),o+=2;else n.pop(),o+=2;else n.push("MULTI_LINE_COMMENT"),o+=2}if(n.length>0)throw new Error("GLSL function was not parsable");return{argumentNames:r,argumentTypes:t}}static nativeFunctionReturnType(e){return T[e.match(/int|float|vec[2-4]/)[0]]}static combineKernels(e,t){e.apply(null,arguments);const{texSize:r,context:n,threadDim:s}=t.texSize;let o;if("single"===t.precision){const e=r[0],t=Math.ceil(r[1]/4);o=new Float32Array(e*t*4*4),n.readPixels(0,0,e,4*t,n.RGBA,n.FLOAT,o)}else{const e=new Uint8Array(r[0]*r[1]*4);n.readPixels(0,0,r[0],r[1],n.RGBA,n.UNSIGNED_BYTE,e),o=new Float32Array(e.buffer)}return o=o.subarray(0,s[0]*s[1]*s[2]),1===t.output.length?o:2===t.output.length?i.splitArray(o,t.output[0]):3===t.output.length?i.splitArray(o,t.output[0]*t.output[1]).map(function(e){return i.splitArray(e,t.output[0])}):void 0}constructor(e,t){super(e,t),this.transferValues=null,this.formatValues=null,this.TextureConstructor=null,this.renderOutput=null,this.renderRawOutput=null,this.texSize=null,this.translatedSource=null,this.compiledFragmentShader=null,this.compiledVertexShader=null,this.switchingKernels=null,this._textureSwitched=null,this._mappedTextureSwitched=null}checkTextureSize(){const{features:e}=this.constructor;if(this.texSize[0]>e.maxTextureSize||this.texSize[1]>e.maxTextureSize)throw new Error(`Texture size [${this.texSize[0]},${this.texSize[1]}] generated by kernel is larger than supported size [${e.maxTextureSize},${e.maxTextureSize}]`)}translateSource(){throw new Error(`"translateSource" not defined on ${this.constructor.name}`)}pickRenderStrategy(e){if(this.graphical)return this.renderRawOutput=this.readPackedPixelsToUint8Array,this.transferValues=(e=>e),this.TextureConstructor=E,null;if("unsigned"===this.precision)if(this.renderRawOutput=this.readPackedPixelsToUint8Array,this.transferValues=this.readPackedPixelsToFloat32Array,this.pipeline)switch(this.renderOutput=this.renderTexture,null!==this.subKernels&&(this.renderKernels=this.renderKernelsToTextures),this.returnType){case"LiteralInteger":case"Float":case"Number":case"Integer":return this.output[2]>0?(this.TextureConstructor=w,null):this.output[1]>0?(this.TextureConstructor=x,null):(this.TextureConstructor=b,null);case"Array(2)":case"Array(3)":case"Array(4)":return this.requestFallback(e)}else switch(null!==this.subKernels&&(this.renderKernels=this.renderKernelsToArrays),this.returnType){case"LiteralInteger":case"Float":case"Number":case"Integer":return this.renderOutput=this.renderValues,this.output[2]>0?(this.TextureConstructor=w,this.formatValues=i.erect3DPackedFloat,null):this.output[1]>0?(this.TextureConstructor=x,this.formatValues=i.erect2DPackedFloat,null):(this.TextureConstructor=b,this.formatValues=i.erectPackedFloat,null);case"Array(2)":case"Array(3)":case"Array(4)":return this.requestFallback(e)}else{if("single"!==this.precision)throw new Error(`unhandled precision of "${this.precision}"`);if(this.renderRawOutput=this.readFloatPixelsToFloat32Array,this.transferValues=this.readFloatPixelsToFloat32Array,this.pipeline)switch(this.renderOutput=this.renderTexture,null!==this.subKernels&&(this.renderKernels=this.renderKernelsToTextures),this.returnType){case"LiteralInteger":case"Float":case"Number":case"Integer":return this.optimizeFloatMemory?this.output[2]>0?(this.TextureConstructor=_,null):this.output[1]>0?(this.TextureConstructor=y,null):(this.TextureConstructor=v,null):this.output[2]>0?(this.TextureConstructor=g,null):this.output[1]>0?(this.TextureConstructor=m,null):(this.TextureConstructor=d,null);case"Array(2)":return this.output[2]>0?(this.TextureConstructor=a,null):this.output[1]>0?(this.TextureConstructor=o,null):(this.TextureConstructor=s,null);case"Array(3)":return this.output[2]>0?(this.TextureConstructor=c,null):this.output[1]>0?(this.TextureConstructor=l,null):(this.TextureConstructor=u,null);case"Array(4)":return this.output[2]>0?(this.TextureConstructor=f,null):this.output[1]>0?(this.TextureConstructor=p,null):(this.TextureConstructor=h,null)}if(this.renderOutput=this.renderValues,null!==this.subKernels&&(this.renderKernels=this.renderKernelsToArrays),this.optimizeFloatMemory)switch(this.returnType){case"LiteralInteger":case"Float":case"Number":case"Integer":return this.output[2]>0?(this.TextureConstructor=_,this.formatValues=i.erectMemoryOptimized3DFloat,null):this.output[1]>0?(this.TextureConstructor=y,this.formatValues=i.erectMemoryOptimized2DFloat,null):(this.TextureConstructor=v,this.formatValues=i.erectMemoryOptimizedFloat,null);case"Array(2)":return this.output[2]>0?(this.TextureConstructor=a,this.formatValues=i.erect3DArray2,null):this.output[1]>0?(this.TextureConstructor=o,this.formatValues=i.erect2DArray2,null):(this.TextureConstructor=s,this.formatValues=i.erectArray2,null);case"Array(3)":return this.output[2]>0?(this.TextureConstructor=c,this.formatValues=i.erect3DArray3,null):this.output[1]>0?(this.TextureConstructor=l,this.formatValues=i.erect2DArray3,null):(this.TextureConstructor=u,this.formatValues=i.erectArray3,null);case"Array(4)":return this.output[2]>0?(this.TextureConstructor=f,this.formatValues=i.erect3DArray4,null):this.output[1]>0?(this.TextureConstructor=p,this.formatValues=i.erect2DArray4,null):(this.TextureConstructor=h,this.formatValues=i.erectArray4,null)}else switch(this.returnType){case"LiteralInteger":case"Float":case"Number":case"Integer":return this.output[2]>0?(this.TextureConstructor=g,this.formatValues=i.erect3DFloat,null):this.output[1]>0?(this.TextureConstructor=m,this.formatValues=i.erect2DFloat,null):(this.TextureConstructor=d,this.formatValues=i.erectFloat,null);case"Array(2)":return this.output[2]>0?(this.TextureConstructor=a,this.formatValues=i.erect3DArray2,null):this.output[1]>0?(this.TextureConstructor=o,this.formatValues=i.erect2DArray2,null):(this.TextureConstructor=s,this.formatValues=i.erectArray2,null);case"Array(3)":return this.output[2]>0?(this.TextureConstructor=c,this.formatValues=i.erect3DArray3,null):this.output[1]>0?(this.TextureConstructor=l,this.formatValues=i.erect2DArray3,null):(this.TextureConstructor=u,this.formatValues=i.erectArray3,null);case"Array(4)":return this.output[2]>0?(this.TextureConstructor=f,this.formatValues=i.erect3DArray4,null):this.output[1]>0?(this.TextureConstructor=p,this.formatValues=i.erect2DArray4,null):(this.TextureConstructor=h,this.formatValues=i.erectArray4,null)}}throw new Error(`unhandled return type "${this.returnType}"`)}getKernelString(){throw new Error("abstract method call")}getMainResultTexture(){switch(this.returnType){case"LiteralInteger":case"Float":case"Integer":case"Number":return this.getMainResultNumberTexture();case"Array(2)":return this.getMainResultArray2Texture();case"Array(3)":return this.getMainResultArray3Texture();case"Array(4)":return this.getMainResultArray4Texture();default:throw new Error(`unhandled returnType type ${this.returnType}`)}}getMainResultKernelNumberTexture(){throw new Error("abstract method call")}getMainResultSubKernelNumberTexture(){throw new Error("abstract method call")}getMainResultKernelArray2Texture(){throw new Error("abstract method call")}getMainResultSubKernelArray2Texture(){throw new Error("abstract method call")}getMainResultKernelArray3Texture(){throw new Error("abstract method call")}getMainResultSubKernelArray3Texture(){throw new Error("abstract method call")}getMainResultKernelArray4Texture(){throw new Error("abstract method call")}getMainResultSubKernelArray4Texture(){throw new Error("abstract method call")}getMainResultGraphical(){throw new Error("abstract method call")}getMainResultMemoryOptimizedFloats(){throw new Error("abstract method call")}getMainResultPackedPixels(){throw new Error("abstract method call")}getMainResultString(){return this.graphical?this.getMainResultGraphical():"single"===this.precision?this.optimizeFloatMemory?this.getMainResultMemoryOptimizedFloats():this.getMainResultTexture():this.getMainResultPackedPixels()}getMainResultNumberTexture(){return i.linesToString(this.getMainResultKernelNumberTexture())+i.linesToString(this.getMainResultSubKernelNumberTexture())}getMainResultArray2Texture(){return i.linesToString(this.getMainResultKernelArray2Texture())+i.linesToString(this.getMainResultSubKernelArray2Texture())}getMainResultArray3Texture(){return i.linesToString(this.getMainResultKernelArray3Texture())+i.linesToString(this.getMainResultSubKernelArray3Texture())}getMainResultArray4Texture(){return i.linesToString(this.getMainResultKernelArray4Texture())+i.linesToString(this.getMainResultSubKernelArray4Texture())}getFloatTacticDeclaration(){return`precision ${this.getVariablePrecisionString(this.texSize,this.tactic)} float;\n`}getIntTacticDeclaration(){return`precision ${this.getVariablePrecisionString(this.texSize,this.tactic,!0)} int;\n`}getSampler2DTacticDeclaration(){return`precision ${this.getVariablePrecisionString(this.texSize,this.tactic)} sampler2D;\n`}getSampler2DArrayTacticDeclaration(){return`precision ${this.getVariablePrecisionString(this.texSize,this.tactic)} sampler2DArray;\n`}renderTexture(){return this.immutable?this.texture.clone():this.texture}readPackedPixelsToUint8Array(){if("unsigned"!==this.precision)throw new Error('Requires this.precision to be "unsigned"');const{texSize:e,context:t}=this,r=new Uint8Array(e[0]*e[1]*4);return t.readPixels(0,0,e[0],e[1],t.RGBA,t.UNSIGNED_BYTE,r),r}readPackedPixelsToFloat32Array(){return new Float32Array(this.readPackedPixelsToUint8Array().buffer)}readFloatPixelsToFloat32Array(){if("single"!==this.precision)throw new Error('Requires this.precision to be "single"');const{texSize:e,context:t}=this,r=e[0],n=e[1],i=new Float32Array(r*n*4);return t.readPixels(0,0,r,n,t.RGBA,t.FLOAT,i),i}getPixels(e){const{context:t,output:r}=this,[n,s]=r,o=new Uint8Array(n*s*4);return t.readPixels(0,0,n,s,t.RGBA,t.UNSIGNED_BYTE,o),new Uint8ClampedArray((e?o:i.flipPixels(o,n,s)).buffer)}renderKernelsToArrays(){const e={result:this.renderOutput()};for(let t=0;t0){for(let e=0;e0){const{mappedTextures:r}=this;for(let n=0;n1&&(this.newTexture(),!0)}cloneTexture(){this.texture._refs--;const{context:e,size:t,texture:r,kernel:n}=this;n.debug&&console.warn("cloning internal texture"),e.bindFramebuffer(e.FRAMEBUFFER,this.framebuffer()),i(e,r),e.framebufferTexture2D(e.FRAMEBUFFER,e.COLOR_ATTACHMENT0,e.TEXTURE_2D,r,0);const s=e.createTexture();i(e,s),e.texImage2D(e.TEXTURE_2D,0,this.internalFormat,t[0],t[1],0,this.textureFormat,this.textureType,null),e.copyTexSubImage2D(e.TEXTURE_2D,0,0,0,0,0,t[0],t[1]),s._refs=1,this.texture=s}newTexture(){this.texture._refs--;const e=this.context,t=this.size;this.kernel.debug&&console.warn("new internal texture");const r=e.createTexture();i(e,r),e.texImage2D(e.TEXTURE_2D,0,this.internalFormat,t[0],t[1],0,this.textureFormat,this.textureType,null),r._refs=1,this.texture=r}clear(){if(this.texture._refs){this.texture._refs--;const e=this.context,t=this.texture=e.createTexture();i(e,t);const r=this.size;t._refs=1,e.texImage2D(e.TEXTURE_2D,0,this.internalFormat,r[0],r[1],0,this.textureFormat,this.textureType,null)}const{context:e,texture:t}=this;e.bindFramebuffer(e.FRAMEBUFFER,this.framebuffer()),e.bindTexture(e.TEXTURE_2D,t),i(e,t),e.framebufferTexture2D(e.FRAMEBUFFER,e.COLOR_ATTACHMENT0,e.TEXTURE_2D,t,0),e.clearColor(0,0,0,0),e.clear(e.COLOR_BUFFER_BIT|e.DEPTH_BUFFER_BIT)}delete(){this._deleted||(this._deleted=!0,this.texture._refs&&(this.texture._refs--,this.texture._refs)||this.context.deleteTexture(this.texture))}framebuffer(){return this._framebuffer||(this._framebuffer=this.kernel.getRawValueFramebuffer(this.size[0],this.size[1])),this._framebuffer}}}},{"../../../texture":278}],195:[function(e,t,r){const{utils:n}=e("../../../utils"),{GLTextureFloat:i}=e("./float");t.exports={GLTextureMemoryOptimized2D:class extends i{constructor(e){super(e),this.type="MemoryOptimizedNumberTexture"}toArray(){return n.erectMemoryOptimized2DFloat(this.renderValues(),this.output[0],this.output[1])}}}},{"../../../utils":279,"./float":192}],196:[function(e,t,r){const{utils:n}=e("../../../utils"),{GLTextureFloat:i}=e("./float");t.exports={GLTextureMemoryOptimized3D:class extends i{constructor(e){super(e),this.type="MemoryOptimizedNumberTexture"}toArray(){return n.erectMemoryOptimized3DFloat(this.renderValues(),this.output[0],this.output[1],this.output[2])}}}},{"../../../utils":279,"./float":192}],197:[function(e,t,r){const{utils:n}=e("../../../utils"),{GLTextureFloat:i}=e("./float");t.exports={GLTextureMemoryOptimized:class extends i{constructor(e){super(e),this.type="MemoryOptimizedNumberTexture"}toArray(){return n.erectMemoryOptimizedFloat(this.renderValues(),this.output[0])}}}},{"../../../utils":279,"./float":192}],198:[function(e,t,r){const{utils:n}=e("../../../utils"),{GLTextureUnsigned:i}=e("./unsigned");t.exports={GLTextureUnsigned2D:class extends i{constructor(e){super(e),this.type="NumberTexture"}toArray(){return n.erect2DPackedFloat(this.renderValues(),this.output[0],this.output[1])}}}},{"../../../utils":279,"./unsigned":200}],199:[function(e,t,r){const{utils:n}=e("../../../utils"),{GLTextureUnsigned:i}=e("./unsigned");t.exports={GLTextureUnsigned3D:class extends i{constructor(e){super(e),this.type="NumberTexture"}toArray(){return n.erect3DPackedFloat(this.renderValues(),this.output[0],this.output[1],this.output[2])}}}},{"../../../utils":279,"./unsigned":200}],200:[function(e,t,r){const{utils:n}=e("../../../utils"),{GLTexture:i}=e("./index");t.exports={GLTextureUnsigned:class extends i{get textureType(){return this.context.UNSIGNED_BYTE}constructor(e){super(e),this.type="NumberTexture"}renderRawOutput(){const{context:e}=this;e.bindFramebuffer(e.FRAMEBUFFER,this.framebuffer()),e.framebufferTexture2D(e.FRAMEBUFFER,e.COLOR_ATTACHMENT0,e.TEXTURE_2D,this.texture,0);const t=new Uint8Array(this.size[0]*this.size[1]*4);return e.readPixels(0,0,this.size[0],this.size[1],e.RGBA,e.UNSIGNED_BYTE,t),t}renderValues(){return this._deleted?null:new Float32Array(this.renderRawOutput().buffer)}toArray(){return n.erectPackedFloat(this.renderValues(),this.output[0])}}}},{"../../../utils":279,"./index":194}],201:[function(e,t,r){const n=e("gl"),{WebGLKernel:i}=e("../web-gl/kernel"),{glKernelString:s}=e("../gl/kernel-string");let o=null,a=null,u=null,l=null,c=null;t.exports={HeadlessGLKernel:class extends i{static get isSupported(){return null!==o?o:(this.setupFeatureChecks(),o=null!==u)}static setupFeatureChecks(){if(a=null,l=null,"function"==typeof n)try{if(!(u=n(2,2,{preserveDrawingBuffer:!0}))||!u.getExtension)return;l={STACKGL_resize_drawingbuffer:u.getExtension("STACKGL_resize_drawingbuffer"),STACKGL_destroy_context:u.getExtension("STACKGL_destroy_context"),OES_texture_float:u.getExtension("OES_texture_float"),OES_texture_float_linear:u.getExtension("OES_texture_float_linear"),OES_element_index_uint:u.getExtension("OES_element_index_uint"),WEBGL_draw_buffers:u.getExtension("WEBGL_draw_buffers"),WEBGL_color_buffer_float:u.getExtension("WEBGL_color_buffer_float")},c=this.getFeatures()}catch(e){console.warn(e)}}static isContextMatch(e){try{return"ANGLE"===e.getParameter(e.RENDERER)}catch(e){return!1}}static getIsTextureFloat(){return Boolean(l.OES_texture_float)}static getIsDrawBuffers(){return Boolean(l.WEBGL_draw_buffers)}static getChannelCount(){return l.WEBGL_draw_buffers?u.getParameter(l.WEBGL_draw_buffers.MAX_DRAW_BUFFERS_WEBGL):1}static getMaxTextureSize(){return u.getParameter(u.MAX_TEXTURE_SIZE)}static get testCanvas(){return a}static get testContext(){return u}static get features(){return c}initCanvas(){return{}}initContext(){return n(2,2,{preserveDrawingBuffer:!0})}initExtensions(){this.extensions={STACKGL_resize_drawingbuffer:this.context.getExtension("STACKGL_resize_drawingbuffer"),STACKGL_destroy_context:this.context.getExtension("STACKGL_destroy_context"),OES_texture_float:this.context.getExtension("OES_texture_float"),OES_texture_float_linear:this.context.getExtension("OES_texture_float_linear"),OES_element_index_uint:this.context.getExtension("OES_element_index_uint"),WEBGL_draw_buffers:this.context.getExtension("WEBGL_draw_buffers")}}build(){super.build.apply(this,arguments),this.fallbackRequested||this.extensions.STACKGL_resize_drawingbuffer.resize(this.maxTexSize[0],this.maxTexSize[1])}destroyExtensions(){this.extensions.STACKGL_resize_drawingbuffer=null,this.extensions.STACKGL_destroy_context=null,this.extensions.OES_texture_float=null,this.extensions.OES_texture_float_linear=null,this.extensions.OES_element_index_uint=null,this.extensions.WEBGL_draw_buffers=null}static destroyContext(e){const t=e.getExtension("STACKGL_destroy_context");t&&t.destroy&&t.destroy()}toString(){return s(this.constructor,arguments,this,"const gl = context || require('gl')(1, 1);\n"," if (!context) { gl.getExtension('STACKGL_destroy_context').destroy(); }\n")}setOutput(e){return super.setOutput(e),this.graphical&&this.extensions.STACKGL_resize_drawingbuffer&&this.extensions.STACKGL_resize_drawingbuffer.resize(this.maxTexSize[0],this.maxTexSize[1]),this}}}},{"../gl/kernel-string":179,"../web-gl/kernel":237,gl:125}],202:[function(e,t,r){t.exports={KernelValue:class{constructor(e,t){const{name:r,kernel:n,context:i,checkContext:s,onRequestContextHandle:o,onUpdateValueMismatch:a,origin:u,strictIntegers:l,type:c,tactic:h}=t;if(!r)throw new Error("name not set");if(!c)throw new Error("type not set");if(!u)throw new Error("origin not set");if("user"!==u&&"constants"!==u)throw new Error(`origin must be "user" or "constants" value is "${u}"`);if(!o)throw new Error("onRequestContextHandle is not set");this.name=r,this.origin=u,this.tactic=h,this.varName="constants"===u?`constants.${r}`:r,this.kernel=n,this.strictIntegers=l,this.type=e.type||c,this.size=e.size||null,this.index=null,this.context=i,this.checkContext=null===s||void 0===s||s,this.contextHandle=null,this.onRequestContextHandle=o,this.onUpdateValueMismatch=a,this.forceUploadEachRun=null}get id(){return`${this.origin}_${name}`}getSource(){throw new Error(`"getSource" not defined on ${this.constructor.name}`)}updateValue(e){throw new Error(`"updateValue" not defined on ${this.constructor.name}`)}}}},{}],203:[function(e,t,r){const{utils:n}=e("../utils"),{Input:i}=e("../input");t.exports={Kernel:class{static get isSupported(){throw new Error(`"isSupported" not implemented on ${this.name}`)}static isContextMatch(e){throw new Error(`"isContextMatch" not implemented on ${this.name}`)}static getFeatures(){throw new Error(`"getFeatures" not implemented on ${this.name}`)}static destroyContext(e){throw new Error(`"destroyContext" called on ${this.name}`)}static nativeFunctionArguments(){throw new Error(`"nativeFunctionArguments" called on ${this.name}`)}static nativeFunctionReturnType(){throw new Error(`"nativeFunctionReturnType" called on ${this.name}`)}static combineKernels(){throw new Error(`"combineKernels" called on ${this.name}`)}constructor(e,t){if("object"!=typeof e){if("string"!=typeof e)throw new Error("source not a string");if(!n.isFunctionString(e))throw new Error("source not a function string")}this.useLegacyEncoder=!1,this.fallbackRequested=!1,this.onRequestFallback=null,this.argumentNames="string"==typeof e?n.getArgumentNamesFromString(e):null,this.argumentTypes=null,this.argumentSizes=null,this.argumentBitRatios=null,this.kernelArguments=null,this.kernelConstants=null,this.forceUploadKernelConstants=null,this.source=e,this.output=null,this.debug=!1,this.graphical=!1,this.loopMaxIterations=0,this.constants=null,this.constantTypes=null,this.constantBitRatios=null,this.dynamicArguments=!1,this.dynamicOutput=!1,this.canvas=null,this.context=null,this.checkContext=null,this.gpu=null,this.functions=null,this.nativeFunctions=null,this.injectedNative=null,this.subKernels=null,this.validate=!0,this.immutable=!1,this.pipeline=!1,this.precision=null,this.tactic=null,this.plugins=null,this.returnType=null,this.leadingReturnStatement=null,this.followingReturnStatement=null,this.optimizeFloatMemory=null,this.strictIntegers=!1,this.fixIntegerDivisionAccuracy=null,this.built=!1,this.signature=null}mergeSettings(e){for(let t in e)if(e.hasOwnProperty(t)&&this.hasOwnProperty(t)){switch(t){case"output":if(!Array.isArray(e.output)){this.setOutput(e.output);continue}break;case"functions":this.functions=[];for(let t=0;te.name):null,returnType:this.returnType}}}buildSignature(e){const t=this.constructor;this.signature=t.getSignature(this,t.getArgumentTypes(this,e))}static getArgumentTypes(e,t){const r=new Array(t.length);for(let i=0;it.argumentTypes[e])||[]:t.argumentTypes||[],{name:n.getFunctionNameFromString(r)||null,source:r,argumentTypes:i,returnType:t.returnType||null}}onActivate(e){}}}},{"../input":275,"../utils":279}],204:[function(e,t,r){const n=`__HEADER__;\n__FLOAT_TACTIC_DECLARATION__;\n__INT_TACTIC_DECLARATION__;\n__SAMPLER_2D_TACTIC_DECLARATION__;\n\nconst int LOOP_MAX = __LOOP_MAX__;\n\n__PLUGINS__;\n__CONSTANTS__;\n\nvarying vec2 vTexCoord;\n\nfloat acosh(float x) {\n return log(x + sqrt(x * x - 1.0));\n}\n\nfloat sinh(float x) {\n return (pow(${Math.E}, x) - pow(${Math.E}, -x)) / 2.0;\n}\n\nfloat asinh(float x) {\n return log(x + sqrt(x * x + 1.0));\n}\n\nfloat atan2(float v1, float v2) {\n if (v1 == 0.0 || v2 == 0.0) return 0.0;\n return atan(v1 / v2);\n}\n\nfloat atanh(float x) {\n x = (x + 1.0) / (x - 1.0);\n if (x < 0.0) {\n return 0.5 * log(-x);\n }\n return 0.5 * log(x);\n}\n\nfloat cbrt(float x) {\n if (x >= 0.0) {\n return pow(x, 1.0 / 3.0);\n } else {\n return -pow(x, 1.0 / 3.0);\n }\n}\n\nfloat cosh(float x) {\n return (pow(${Math.E}, x) + pow(${Math.E}, -x)) / 2.0; \n}\n\nfloat expm1(float x) {\n return pow(${Math.E}, x) - 1.0; \n}\n\nfloat fround(highp float x) {\n return x;\n}\n\nfloat imul(float v1, float v2) {\n return float(int(v1) * int(v2));\n}\n\nfloat log10(float x) {\n return log2(x) * (1.0 / log2(10.0));\n}\n\nfloat log1p(float x) {\n return log(1.0 + x);\n}\n\nfloat _pow(float v1, float v2) {\n if (v2 == 0.0) return 1.0;\n return pow(v1, v2);\n}\n\nfloat tanh(float x) {\n float e = exp(2.0 * x);\n return (e - 1.0) / (e + 1.0);\n}\n\nfloat trunc(float x) {\n if (x >= 0.0) {\n return floor(x); \n } else {\n return ceil(x);\n }\n}\n\nvec4 _round(vec4 x) {\n return floor(x + 0.5);\n}\n\nfloat _round(float x) {\n return floor(x + 0.5);\n}\n\nconst int BIT_COUNT = 32;\nint modi(int x, int y) {\n return x - y * (x / y);\n}\n\nint bitwiseOr(int a, int b) {\n int result = 0;\n int n = 1;\n \n for (int i = 0; i < BIT_COUNT; i++) {\n if ((modi(a, 2) == 1) || (modi(b, 2) == 1)) {\n result += n;\n }\n a = a / 2;\n b = b / 2;\n n = n * 2;\n if(!(a > 0 || b > 0)) {\n break;\n }\n }\n return result;\n}\nint bitwiseXOR(int a, int b) {\n int result = 0;\n int n = 1;\n \n for (int i = 0; i < BIT_COUNT; i++) {\n if ((modi(a, 2) == 1) != (modi(b, 2) == 1)) {\n result += n;\n }\n a = a / 2;\n b = b / 2;\n n = n * 2;\n if(!(a > 0 || b > 0)) {\n break;\n }\n }\n return result;\n}\nint bitwiseAnd(int a, int b) {\n int result = 0;\n int n = 1;\n for (int i = 0; i < BIT_COUNT; i++) {\n if ((modi(a, 2) == 1) && (modi(b, 2) == 1)) {\n result += n;\n }\n a = a / 2;\n b = b / 2;\n n = n * 2;\n if(!(a > 0 && b > 0)) {\n break;\n }\n }\n return result;\n}\nint bitwiseNot(int a) {\n int result = 0;\n int n = 1;\n \n for (int i = 0; i < BIT_COUNT; i++) {\n if (modi(a, 2) == 0) {\n result += n; \n }\n a = a / 2;\n n = n * 2;\n }\n return result;\n}\nint bitwiseZeroFillLeftShift(int n, int shift) {\n int maxBytes = BIT_COUNT;\n for (int i = 0; i < BIT_COUNT; i++) {\n if (maxBytes >= n) {\n break;\n }\n maxBytes *= 2;\n }\n for (int i = 0; i < BIT_COUNT; i++) {\n if (i >= shift) {\n break;\n }\n n *= 2;\n }\n\n int result = 0;\n int byteVal = 1;\n for (int i = 0; i < BIT_COUNT; i++) {\n if (i >= maxBytes) break;\n if (modi(n, 2) > 0) { result += byteVal; }\n n = int(n / 2);\n byteVal *= 2;\n }\n return result;\n}\n\nint bitwiseSignedRightShift(int num, int shifts) {\n return int(floor(float(num) / pow(2.0, float(shifts))));\n}\n\nint bitwiseZeroFillRightShift(int n, int shift) {\n int maxBytes = BIT_COUNT;\n for (int i = 0; i < BIT_COUNT; i++) {\n if (maxBytes >= n) {\n break;\n }\n maxBytes *= 2;\n }\n for (int i = 0; i < BIT_COUNT; i++) {\n if (i >= shift) {\n break;\n }\n n /= 2;\n }\n int result = 0;\n int byteVal = 1;\n for (int i = 0; i < BIT_COUNT; i++) {\n if (i >= maxBytes) break;\n if (modi(n, 2) > 0) { result += byteVal; }\n n = int(n / 2);\n byteVal *= 2;\n }\n return result;\n}\n\nvec2 integerMod(vec2 x, float y) {\n vec2 res = floor(mod(x, y));\n return res * step(1.0 - floor(y), -res);\n}\n\nvec3 integerMod(vec3 x, float y) {\n vec3 res = floor(mod(x, y));\n return res * step(1.0 - floor(y), -res);\n}\n\nvec4 integerMod(vec4 x, vec4 y) {\n vec4 res = floor(mod(x, y));\n return res * step(1.0 - floor(y), -res);\n}\n\nfloat integerMod(float x, float y) {\n float res = floor(mod(x, y));\n return res * (res > floor(y) - 1.0 ? 0.0 : 1.0);\n}\n\nint integerMod(int x, int y) {\n return x - (y * int(x / y));\n}\n\n__DIVIDE_WITH_INTEGER_CHECK__;\n\n// Here be dragons!\n// DO NOT OPTIMIZE THIS CODE\n// YOU WILL BREAK SOMETHING ON SOMEBODY'S MACHINE\n// LEAVE IT AS IT IS, LEST YOU WASTE YOUR OWN TIME\nconst vec2 MAGIC_VEC = vec2(1.0, -256.0);\nconst vec4 SCALE_FACTOR = vec4(1.0, 256.0, 65536.0, 0.0);\nconst vec4 SCALE_FACTOR_INV = vec4(1.0, 0.00390625, 0.0000152587890625, 0.0); // 1, 1/256, 1/65536\nfloat decode32(vec4 texel) {\n __DECODE32_ENDIANNESS__;\n texel *= 255.0;\n vec2 gte128;\n gte128.x = texel.b >= 128.0 ? 1.0 : 0.0;\n gte128.y = texel.a >= 128.0 ? 1.0 : 0.0;\n float exponent = 2.0 * texel.a - 127.0 + dot(gte128, MAGIC_VEC);\n float res = exp2(_round(exponent));\n texel.b = texel.b - 128.0 * gte128.x;\n res = dot(texel, SCALE_FACTOR) * exp2(_round(exponent-23.0)) + res;\n res *= gte128.y * -2.0 + 1.0;\n return res;\n}\n\nfloat decode16(vec4 texel, int index) {\n int channel = integerMod(index, 2);\n if (channel == 0) return texel.r * 255.0 + texel.g * 65280.0;\n if (channel == 1) return texel.b * 255.0 + texel.a * 65280.0;\n return 0.0;\n}\n\nfloat decode8(vec4 texel, int index) {\n int channel = integerMod(index, 4);\n if (channel == 0) return texel.r * 255.0;\n if (channel == 1) return texel.g * 255.0;\n if (channel == 2) return texel.b * 255.0;\n if (channel == 3) return texel.a * 255.0;\n return 0.0;\n}\n\nvec4 legacyEncode32(float f) {\n float F = abs(f);\n float sign = f < 0.0 ? 1.0 : 0.0;\n float exponent = floor(log2(F));\n float mantissa = (exp2(-exponent) * F);\n // exponent += floor(log2(mantissa));\n vec4 texel = vec4(F * exp2(23.0-exponent)) * SCALE_FACTOR_INV;\n texel.rg = integerMod(texel.rg, 256.0);\n texel.b = integerMod(texel.b, 128.0);\n texel.a = exponent*0.5 + 63.5;\n texel.ba += vec2(integerMod(exponent+127.0, 2.0), sign) * 128.0;\n texel = floor(texel);\n texel *= 0.003921569; // 1/255\n __ENCODE32_ENDIANNESS__;\n return texel;\n}\n\n// https://github.com/gpujs/gpu.js/wiki/Encoder-details\nvec4 encode32(float value) {\n if (value == 0.0) return vec4(0, 0, 0, 0);\n\n float exponent;\n float mantissa;\n vec4 result;\n float sgn;\n\n sgn = step(0.0, -value);\n value = abs(value);\n\n exponent = floor(log2(value));\n\n mantissa = value*pow(2.0, -exponent)-1.0;\n exponent = exponent+127.0;\n result = vec4(0,0,0,0);\n\n result.a = floor(exponent/2.0);\n exponent = exponent - result.a*2.0;\n result.a = result.a + 128.0*sgn;\n\n result.b = floor(mantissa * 128.0);\n mantissa = mantissa - result.b / 128.0;\n result.b = result.b + exponent*128.0;\n\n result.g = floor(mantissa*32768.0);\n mantissa = mantissa - result.g/32768.0;\n\n result.r = floor(mantissa*8388608.0);\n return result/255.0;\n}\n// Dragons end here\n\nint index;\nivec3 threadId;\n\nivec3 indexTo3D(int idx, ivec3 texDim) {\n int z = int(idx / (texDim.x * texDim.y));\n idx -= z * int(texDim.x * texDim.y);\n int y = int(idx / texDim.x);\n int x = int(integerMod(idx, texDim.x));\n return ivec3(x, y, z);\n}\n\nfloat get32(sampler2D tex, ivec2 texSize, ivec3 texDim, int z, int y, int x) {\n int index = x + texDim.x * (y + texDim.y * z);\n int w = texSize.x;\n vec2 st = vec2(float(integerMod(index, w)), float(index / w)) + 0.5;\n vec4 texel = texture2D(tex, st / vec2(texSize));\n return decode32(texel);\n}\n\nfloat get16(sampler2D tex, ivec2 texSize, ivec3 texDim, int z, int y, int x) {\n int index = x + texDim.x * (y + texDim.y * z);\n int w = texSize.x * 2;\n vec2 st = vec2(float(integerMod(index, w)), float(index / w)) + 0.5;\n vec4 texel = texture2D(tex, st / vec2(texSize.x * 2, texSize.y));\n return decode16(texel, index);\n}\n\nfloat get8(sampler2D tex, ivec2 texSize, ivec3 texDim, int z, int y, int x) {\n int index = x + texDim.x * (y + texDim.y * z);\n int w = texSize.x * 4;\n vec2 st = vec2(float(integerMod(index, w)), float(index / w)) + 0.5;\n vec4 texel = texture2D(tex, st / vec2(texSize.x * 4, texSize.y));\n return decode8(texel, index);\n}\n\nfloat getMemoryOptimized32(sampler2D tex, ivec2 texSize, ivec3 texDim, int z, int y, int x) {\n int index = x + texDim.x * (y + texDim.y * z);\n int channel = integerMod(index, 4);\n index = index / 4;\n int w = texSize.x;\n vec2 st = vec2(float(integerMod(index, w)), float(index / w)) + 0.5;\n vec4 texel = texture2D(tex, st / vec2(texSize));\n if (channel == 0) return texel.r;\n if (channel == 1) return texel.g;\n if (channel == 2) return texel.b;\n if (channel == 3) return texel.a;\n return 0.0;\n}\n\nvec4 getImage2D(sampler2D tex, ivec2 texSize, ivec3 texDim, int z, int y, int x) {\n int index = x + texDim.x * (y + texDim.y * z);\n int w = texSize.x;\n vec2 st = vec2(float(integerMod(index, w)), float(index / w)) + 0.5;\n return texture2D(tex, st / vec2(texSize));\n}\n\nfloat getFloatFromSampler2D(sampler2D tex, ivec2 texSize, ivec3 texDim, int z, int y, int x) {\n vec4 result = getImage2D(tex, texSize, texDim, z, y, x);\n return result[0];\n}\n\nvec2 getVec2FromSampler2D(sampler2D tex, ivec2 texSize, ivec3 texDim, int z, int y, int x) {\n vec4 result = getImage2D(tex, texSize, texDim, z, y, x);\n return vec2(result[0], result[1]);\n}\n\nvec2 getMemoryOptimizedVec2(sampler2D tex, ivec2 texSize, ivec3 texDim, int z, int y, int x) {\n int index = x + (texDim.x * (y + (texDim.y * z)));\n int channel = integerMod(index, 2);\n index = index / 2;\n int w = texSize.x;\n vec2 st = vec2(float(integerMod(index, w)), float(index / w)) + 0.5;\n vec4 texel = texture2D(tex, st / vec2(texSize));\n if (channel == 0) return vec2(texel.r, texel.g);\n if (channel == 1) return vec2(texel.b, texel.a);\n return vec2(0.0, 0.0);\n}\n\nvec3 getVec3FromSampler2D(sampler2D tex, ivec2 texSize, ivec3 texDim, int z, int y, int x) {\n vec4 result = getImage2D(tex, texSize, texDim, z, y, x);\n return vec3(result[0], result[1], result[2]);\n}\n\nvec3 getMemoryOptimizedVec3(sampler2D tex, ivec2 texSize, ivec3 texDim, int z, int y, int x) {\n int fieldIndex = 3 * (x + texDim.x * (y + texDim.y * z));\n int vectorIndex = fieldIndex / 4;\n int vectorOffset = fieldIndex - vectorIndex * 4;\n int readY = vectorIndex / texSize.x;\n int readX = vectorIndex - readY * texSize.x;\n vec4 tex1 = texture2D(tex, (vec2(readX, readY) + 0.5) / vec2(texSize));\n \n if (vectorOffset == 0) {\n return tex1.xyz;\n } else if (vectorOffset == 1) {\n return tex1.yzw;\n } else {\n readX++;\n if (readX >= texSize.x) {\n readX = 0;\n readY++;\n }\n vec4 tex2 = texture2D(tex, vec2(readX, readY) / vec2(texSize));\n if (vectorOffset == 2) {\n return vec3(tex1.z, tex1.w, tex2.x);\n } else {\n return vec3(tex1.w, tex2.x, tex2.y);\n }\n }\n}\n\nvec4 getVec4FromSampler2D(sampler2D tex, ivec2 texSize, ivec3 texDim, int z, int y, int x) {\n return getImage2D(tex, texSize, texDim, z, y, x);\n}\n\nvec4 getMemoryOptimizedVec4(sampler2D tex, ivec2 texSize, ivec3 texDim, int z, int y, int x) {\n int index = x + texDim.x * (y + texDim.y * z);\n int channel = integerMod(index, 2);\n int w = texSize.x;\n vec2 st = vec2(float(integerMod(index, w)), float(index / w)) + 0.5;\n vec4 texel = texture2D(tex, st / vec2(texSize));\n return vec4(texel.r, texel.g, texel.b, texel.a);\n}\n\nvec4 actualColor;\nvoid color(float r, float g, float b, float a) {\n actualColor = vec4(r,g,b,a);\n}\n\nvoid color(float r, float g, float b) {\n color(r,g,b,1.0);\n}\n\nvoid color(sampler2D image) {\n actualColor = texture2D(image, vTexCoord);\n}\n\nfloat modulo(float number, float divisor) {\n if (number < 0.0) {\n number = abs(number);\n if (divisor < 0.0) {\n divisor = abs(divisor);\n }\n return -mod(number, divisor);\n }\n if (divisor < 0.0) {\n divisor = abs(divisor);\n }\n return mod(number, divisor);\n}\n\n__INJECTED_NATIVE__;\n__MAIN_CONSTANTS__;\n__MAIN_ARGUMENTS__;\n__KERNEL__;\n\nvoid main(void) {\n index = int(vTexCoord.s * float(uTexSize.x)) + int(vTexCoord.t * float(uTexSize.y)) * uTexSize.x;\n __MAIN_RESULT__;\n}`;t.exports={fragmentShader:n}},{}],205:[function(e,t,r){const{utils:n}=e("../../utils"),{FunctionNode:i}=e("../function-node");const s={Array:"sampler2D","Array(2)":"vec2","Array(3)":"vec3","Array(4)":"vec4","Matrix(2)":"mat2","Matrix(3)":"mat3","Matrix(4)":"mat4",Array2D:"sampler2D",Array3D:"sampler2D",Boolean:"bool",Float:"float",Input:"sampler2D",Integer:"int",Number:"float",LiteralInteger:"float",NumberTexture:"sampler2D",MemoryOptimizedNumberTexture:"sampler2D","ArrayTexture(1)":"sampler2D","ArrayTexture(2)":"sampler2D","ArrayTexture(3)":"sampler2D","ArrayTexture(4)":"sampler2D",HTMLVideo:"sampler2D",HTMLCanvas:"sampler2D",OffscreenCanvas:"sampler2D",HTMLImage:"sampler2D",ImageBitmap:"sampler2D",ImageData:"sampler2D",HTMLImageArray:"sampler2DArray"},o={"===":"==","!==":"!="};t.exports={WebGLFunctionNode:class extends i{constructor(e,t){super(e,t),t&&t.hasOwnProperty("fixIntegerDivisionAccuracy")&&(this.fixIntegerDivisionAccuracy=t.fixIntegerDivisionAccuracy)}astConditionalExpression(e,t){if("ConditionalExpression"!==e.type)throw this.astErrorOutput("Not a conditional expression",e);const r=this.getType(e.consequent),n=this.getType(e.alternate);return null===r&&null===n?(t.push("if ("),this.astGeneric(e.test,t),t.push(") {"),this.astGeneric(e.consequent,t),t.push(";"),t.push("} else {"),this.astGeneric(e.alternate,t),t.push(";"),t.push("}"),t):(t.push("("),this.astGeneric(e.test,t),t.push("?"),this.astGeneric(e.consequent,t),t.push(":"),this.astGeneric(e.alternate,t),t.push(")"),t)}astFunction(e,t){if(this.isRootKernel)t.push("void");else{this.returnType||this.findLastReturn()&&(this.returnType=this.getType(e.body),"LiteralInteger"===this.returnType&&(this.returnType="Number"));const{returnType:r}=this;if(r){const e=s[r];if(!e)throw new Error(`unknown type ${r}`);t.push(e)}else t.push("void")}if(t.push(" "),t.push(this.name),t.push("("),!this.isRootKernel)for(let r=0;r0&&t.push(", ");let o=this.argumentTypes[this.argumentNames.indexOf(i)];if(!o)throw this.astErrorOutput(`Unknown argument ${i} type`,e);"LiteralInteger"===o&&(this.argumentTypes[r]=o="Number");const a=s[o];if(!a)throw this.astErrorOutput("Unexpected expression",e);const u=n.sanitizeName(i);"sampler2D"===a||"sampler2DArray"===a?t.push(`${a} user_${u},ivec2 user_${u}Size,ivec3 user_${u}Dim`):t.push(`${a} user_${u}`)}t.push(") {\n");for(let r=0;r"===e.operator||"<"===e.operator&&"Literal"===e.right.type)&&!Number.isInteger(e.right.value)){this.pushState("building-float"),this.castValueToFloat(e.left,t),t.push(o[e.operator]||e.operator),this.astGeneric(e.right,t),this.popState("building-float");break}if(this.pushState("building-integer"),this.astGeneric(e.left,t),t.push(o[e.operator]||e.operator),this.pushState("casting-to-integer"),"Literal"===e.right.type){const r=[];if(this.astGeneric(e.right,r),"Integer"!==this.getType(e.right))throw this.astErrorOutput("Unhandled binary expression with literal",e);t.push(r.join(""))}else t.push("int("),this.astGeneric(e.right,t),t.push(")");this.popState("casting-to-integer"),this.popState("building-integer");break;case"Integer & LiteralInteger":this.pushState("building-integer"),this.astGeneric(e.left,t),t.push(o[e.operator]||e.operator),this.castLiteralToInteger(e.right,t),this.popState("building-integer");break;case"Number & Integer":this.pushState("building-float"),this.astGeneric(e.left,t),t.push(o[e.operator]||e.operator),this.castValueToFloat(e.right,t),this.popState("building-float");break;case"Float & LiteralInteger":case"Number & LiteralInteger":this.pushState("building-float"),this.astGeneric(e.left,t),t.push(o[e.operator]||e.operator),this.castLiteralToFloat(e.right,t),this.popState("building-float");break;case"LiteralInteger & Float":case"LiteralInteger & Number":this.isState("casting-to-integer")?(this.pushState("building-integer"),this.castLiteralToInteger(e.left,t),t.push(o[e.operator]||e.operator),this.castValueToInteger(e.right,t),this.popState("building-integer")):(this.pushState("building-float"),this.astGeneric(e.left,t),t.push(o[e.operator]||e.operator),this.pushState("casting-to-float"),this.astGeneric(e.right,t),this.popState("casting-to-float"),this.popState("building-float"));break;case"LiteralInteger & Integer":this.pushState("building-integer"),this.castLiteralToInteger(e.left,t),t.push(o[e.operator]||e.operator),this.astGeneric(e.right,t),this.popState("building-integer");break;case"Boolean & Boolean":this.pushState("building-boolean"),this.astGeneric(e.left,t),t.push(o[e.operator]||e.operator),this.astGeneric(e.right,t),this.popState("building-boolean");break;case"Float & Integer":this.pushState("building-float"),this.astGeneric(e.left,t),t.push(o[e.operator]||e.operator),this.castValueToFloat(e.right,t),this.popState("building-float");break;default:throw this.astErrorOutput(`Unhandled binary expression between ${i}`,e)}return t.push(")"),t}checkAndUpconvertOperator(e,t){const r=this.checkAndUpconvertBitwiseOperators(e,t);if(r)return r;const n={"%":this.fixIntegerDivisionAccuracy?"integerCorrectionModulo":"modulo","**":"pow"}[e.operator];if(!n)return null;switch(t.push(n),t.push("("),this.getType(e.left)){case"Integer":this.castValueToFloat(e.left,t);break;case"LiteralInteger":this.castLiteralToFloat(e.left,t);break;default:this.astGeneric(e.left,t)}switch(t.push(","),this.getType(e.right)){case"Integer":this.castValueToFloat(e.right,t);break;case"LiteralInteger":this.castLiteralToFloat(e.right,t);break;default:this.astGeneric(e.right,t)}return t.push(")"),t}checkAndUpconvertBitwiseOperators(e,t){const r={"&":"bitwiseAnd","|":"bitwiseOr","^":"bitwiseXOR","<<":"bitwiseZeroFillLeftShift",">>":"bitwiseSignedRightShift",">>>":"bitwiseZeroFillRightShift"}[e.operator];if(!r)return null;switch(t.push(r),t.push("("),this.getType(e.left)){case"Number":case"Float":this.castValueToInteger(e.left,t);break;case"LiteralInteger":this.castLiteralToInteger(e.left,t);break;default:this.astGeneric(e.left,t)}switch(t.push(","),this.getType(e.right)){case"Number":case"Float":this.castValueToInteger(e.right,t);break;case"LiteralInteger":this.castLiteralToInteger(e.right,t);break;default:this.astGeneric(e.right,t)}return t.push(")"),t}checkAndUpconvertBitwiseUnary(e,t){const r={"~":"bitwiseNot"}[e.operator];if(!r)return null;switch(t.push(r),t.push("("),this.getType(e.argument)){case"Number":case"Float":this.castValueToInteger(e.argument,t);break;case"LiteralInteger":this.castLiteralToInteger(e.argument,t);break;default:this.astGeneric(e.argument,t)}return t.push(")"),t}castLiteralToInteger(e,t){return this.pushState("casting-to-integer"),this.astGeneric(e,t),this.popState("casting-to-integer"),t}castLiteralToFloat(e,t){return this.pushState("casting-to-float"),this.astGeneric(e,t),this.popState("casting-to-float"),t}castValueToInteger(e,t){return this.pushState("casting-to-integer"),t.push("int("),this.astGeneric(e,t),t.push(")"),this.popState("casting-to-integer"),t}castValueToFloat(e,t){return this.pushState("casting-to-float"),t.push("float("),this.astGeneric(e,t),t.push(")"),this.popState("casting-to-float"),t}astIdentifierExpression(e,t){if("Identifier"!==e.type)throw this.astErrorOutput("IdentifierExpression - not an Identifier",e);const r=this.getType(e),i=n.sanitizeName(e.name);return"Infinity"===e.name?t.push("3.402823466e+38"):"Boolean"===r&&this.argumentNames.indexOf(i)>-1?t.push(`bool(user_${i})`):t.push(`user_${i}`),t}astForStatement(e,t){if("ForStatement"!==e.type)throw this.astErrorOutput("Invalid for statement",e);const r=[],n=[],i=[],s=[];let o=null;if(e.init){const{declarations:t}=e.init;t.length>1&&(o=!1),this.astGeneric(e.init,r);for(let e=0;e0&&t.push(r.join(""),"\n"),t.push(`for (int ${e}=0;${e}0&&t.push(`if (!${n.join("")}) break;\n`),t.push(s.join("")),t.push(`\n${i.join("")};`),t.push("}\n")}return t}astWhileStatement(e,t){if("WhileStatement"!==e.type)throw this.astErrorOutput("Invalid while statement",e);const r=this.getInternalVariableName("safeI");return t.push(`for (int ${r}=0;${r}0&&a.push(u.join(",")),i.push(a.join(";")),t.push(i.join("")),t.push(";"),t}astIfStatement(e,t){return t.push("if ("),this.astGeneric(e.test,t),t.push(")"),"BlockStatement"===e.consequent.type?this.astGeneric(e.consequent,t):(t.push(" {\n"),this.astGeneric(e.consequent,t),t.push("\n}\n")),e.alternate&&(t.push("else "),"BlockStatement"===e.alternate.type||"IfStatement"===e.alternate.type?this.astGeneric(e.alternate,t):(t.push(" {\n"),this.astGeneric(e.alternate,t),t.push("\n}\n"))),t}astSwitchStatement(e,t){if("SwitchStatement"!==e.type)throw this.astErrorOutput("Invalid switch statement",e);const{discriminant:r,cases:n}=e,i=this.getType(r),s=`switchDiscriminant${this.astKey(e,"_")}`;switch(i){case"Float":case"Number":t.push(`float ${s} = `),this.astGeneric(r,t),t.push(";\n");break;case"Integer":t.push(`int ${s} = `),this.astGeneric(r,t),t.push(";\n")}if(1===n.length&&!n[0].test)return this.astGeneric(n[0].consequent,t),t;let o=!1,a=[],u=!1,l=!1;for(let e=0;ee+1){u=!0,this.astGeneric(n[e].consequent,a);continue}t.push(" else {\n")}this.astGeneric(n[e].consequent,t),t.push("\n}")}return u&&(t.push(" else {"),t.push(a.join("")),t.push("}")),t}astThisExpression(e,t){return t.push("this"),t}astMemberExpression(e,t){const{property:r,name:i,signature:s,origin:o,type:a,xProperty:u,yProperty:l,zProperty:c}=this.getMemberExpressionDetails(e);switch(s){case"value.thread.value":case"this.thread.value":if("x"!==i&&"y"!==i&&"z"!==i)throw this.astErrorOutput("Unexpected expression, expected `this.thread.x`, `this.thread.y`, or `this.thread.z`",e);return t.push(`threadId.${i}`),t;case"this.output.value":if(this.dynamicOutput)switch(i){case"x":this.isState("casting-to-float")?t.push("float(uOutputDim.x)"):t.push("uOutputDim.x");break;case"y":this.isState("casting-to-float")?t.push("float(uOutputDim.y)"):t.push("uOutputDim.y");break;case"z":this.isState("casting-to-float")?t.push("float(uOutputDim.z)"):t.push("uOutputDim.z");break;default:throw this.astErrorOutput("Unexpected expression",e)}else switch(i){case"x":this.isState("casting-to-integer")?t.push(this.output[0]):t.push(this.output[0],".0");break;case"y":this.isState("casting-to-integer")?t.push(this.output[1]):t.push(this.output[1],".0");break;case"z":this.isState("casting-to-integer")?t.push(this.output[2]):t.push(this.output[2],".0");break;default:throw this.astErrorOutput("Unexpected expression",e)}return t;case"value":throw this.astErrorOutput("Unexpected expression",e);case"value[]":case"value[][]":case"value[][][]":case"value[][][][]":case"value.value":if("Math"===o)return t.push(Math[i]),t;const l=n.sanitizeName(i);switch(r){case"r":return t.push(`user_${l}.r`),t;case"g":return t.push(`user_${l}.g`),t;case"b":return t.push(`user_${l}.b`),t;case"a":return t.push(`user_${l}.a`),t}break;case"this.constants.value":if(void 0===u)switch(a){case"Array(2)":case"Array(3)":case"Array(4)":return t.push(`constants_${n.sanitizeName(i)}`),t}case"this.constants.value[]":case"this.constants.value[][]":case"this.constants.value[][][]":case"this.constants.value[][][][]":break;case"fn()[]":return this.astCallExpression(e.object,t),t.push("["),t.push(this.memberExpressionPropertyMarkup(r)),t.push("]"),t;case"fn()[][]":return this.astCallExpression(e.object.object,t),t.push("["),t.push(this.memberExpressionPropertyMarkup(e.object.property)),t.push("]"),t.push("["),t.push(this.memberExpressionPropertyMarkup(e.property)),t.push("]"),t;case"[][]":return this.astArrayExpression(e.object,t),t.push("["),t.push(this.memberExpressionPropertyMarkup(r)),t.push("]"),t;default:throw this.astErrorOutput("Unexpected expression",e)}if(!1===e.computed)switch(a){case"Number":case"Integer":case"Float":case"Boolean":return t.push(`${o}_${n.sanitizeName(i)}`),t}const h=`${o}_${n.sanitizeName(i)}`;switch(a){case"Array(2)":case"Array(3)":case"Array(4)":this.astGeneric(e.object,t),t.push("["),t.push(this.memberExpressionPropertyMarkup(u)),t.push("]");break;case"HTMLImageArray":t.push(`getImage3D(${h}, ${h}Size, ${h}Dim, `),this.memberExpressionXYZ(u,l,c,t),t.push(")");break;case"ArrayTexture(1)":t.push(`getFloatFromSampler2D(${h}, ${h}Size, ${h}Dim, `),this.memberExpressionXYZ(u,l,c,t),t.push(")");break;case"Array1D(2)":case"Array2D(2)":case"Array3D(2)":t.push(`getMemoryOptimizedVec2(${h}, ${h}Size, ${h}Dim, `),this.memberExpressionXYZ(u,l,c,t),t.push(")");break;case"ArrayTexture(2)":t.push(`getVec2FromSampler2D(${h}, ${h}Size, ${h}Dim, `),this.memberExpressionXYZ(u,l,c,t),t.push(")");break;case"Array1D(3)":case"Array2D(3)":case"Array3D(3)":t.push(`getMemoryOptimizedVec3(${h}, ${h}Size, ${h}Dim, `),this.memberExpressionXYZ(u,l,c,t),t.push(")");break;case"ArrayTexture(3)":t.push(`getVec3FromSampler2D(${h}, ${h}Size, ${h}Dim, `),this.memberExpressionXYZ(u,l,c,t),t.push(")");break;case"Array1D(4)":case"Array2D(4)":case"Array3D(4)":t.push(`getMemoryOptimizedVec4(${h}, ${h}Size, ${h}Dim, `),this.memberExpressionXYZ(u,l,c,t),t.push(")");break;case"ArrayTexture(4)":case"HTMLCanvas":case"OffscreenCanvas":case"HTMLImage":case"ImageBitmap":case"ImageData":case"HTMLVideo":t.push(`getVec4FromSampler2D(${h}, ${h}Size, ${h}Dim, `),this.memberExpressionXYZ(u,l,c,t),t.push(")");break;case"NumberTexture":case"Array":case"Array2D":case"Array3D":case"Array4D":case"Input":case"Number":case"Float":case"Integer":if("single"===this.precision)t.push(`getMemoryOptimized32(${h}, ${h}Size, ${h}Dim, `),this.memberExpressionXYZ(u,l,c,t),t.push(")");else{const e="user"===o?this.lookupFunctionArgumentBitRatio(this.name,i):this.constantBitRatios[i];switch(e){case 1:t.push(`get8(${h}, ${h}Size, ${h}Dim, `);break;case 2:t.push(`get16(${h}, ${h}Size, ${h}Dim, `);break;case 4:case 0:t.push(`get32(${h}, ${h}Size, ${h}Dim, `);break;default:throw new Error(`unhandled bit ratio of ${e}`)}this.memberExpressionXYZ(u,l,c,t),t.push(")")}break;case"MemoryOptimizedNumberTexture":t.push(`getMemoryOptimized32(${h}, ${h}Size, ${h}Dim, `),this.memberExpressionXYZ(u,l,c,t),t.push(")");break;case"Matrix(2)":case"Matrix(3)":case"Matrix(4)":t.push(`${h}[${this.memberExpressionPropertyMarkup(l)}]`),l&&t.push(`[${this.memberExpressionPropertyMarkup(u)}]`);break;default:throw new Error(`unhandled member expression "${a}"`)}return t}astCallExpression(e,t){if(!e.callee)throw this.astErrorOutput("Unknown CallExpression",e);let r=null;const i=this.isAstMathFunction(e);if(!(r=i||e.callee.object&&"ThisExpression"===e.callee.object.type?e.callee.property.name:"SequenceExpression"!==e.callee.type||"Literal"!==e.callee.expressions[0].type||isNaN(e.callee.expressions[0].raw)?e.callee.name:e.callee.expressions[1].property.name))throw this.astErrorOutput("Unhandled function, couldn't find name",e);switch(r){case"pow":r="_pow";break;case"round":r="_round"}if(this.calledFunctions.indexOf(r)<0&&this.calledFunctions.push(r),"random"===r&&this.plugins&&this.plugins.length>0)for(let e=0;e0&&t.push(", "),i){case"Integer":this.castValueToFloat(n,t);break;default:this.astGeneric(n,t)}}else{const i=this.lookupFunctionArgumentTypes(r)||[];for(let s=0;s0&&t.push(", ");const u=this.getType(o);switch(a||(this.triggerImplyArgumentType(r,s,u,this),a=u),u){case"Boolean":this.astGeneric(o,t);continue;case"Number":case"Float":if("Integer"===a){t.push("int("),this.astGeneric(o,t),t.push(")");continue}if("Number"===a||"Float"===a){this.astGeneric(o,t);continue}if("LiteralInteger"===a){this.castLiteralToFloat(o,t);continue}break;case"Integer":if("Number"===a||"Float"===a){t.push("float("),this.astGeneric(o,t),t.push(")");continue}if("Integer"===a){this.astGeneric(o,t);continue}break;case"LiteralInteger":if("Integer"===a){this.castLiteralToInteger(o,t);continue}if("Number"===a||"Float"===a){this.castLiteralToFloat(o,t);continue}if("LiteralInteger"===a){this.astGeneric(o,t);continue}break;case"Array(2)":case"Array(3)":case"Array(4)":if(a===u){if("Identifier"===o.type)t.push(`user_${n.sanitizeName(o.name)}`);else{if("ArrayExpression"!==o.type&&"MemberExpression"!==o.type&&"CallExpression"!==o.type)throw this.astErrorOutput(`Unhandled argument type ${o.type}`,e);this.astGeneric(o,t)}continue}break;case"HTMLCanvas":case"OffscreenCanvas":case"HTMLImage":case"ImageBitmap":case"ImageData":case"HTMLImageArray":case"HTMLVideo":case"ArrayTexture(1)":case"ArrayTexture(2)":case"ArrayTexture(3)":case"ArrayTexture(4)":case"Array":case"Input":if(a===u){if("Identifier"!==o.type)throw this.astErrorOutput(`Unhandled argument type ${o.type}`,e);this.triggerImplyArgumentBitRatio(this.name,o.name,r,s);const i=n.sanitizeName(o.name);t.push(`user_${i},user_${i}Size,user_${i}Dim`);continue}}throw this.astErrorOutput(`Unhandled argument combination of ${u} and ${a} for argument named "${o.name}"`,e)}}return t.push(")"),t}astArrayExpression(e,t){const r=this.getType(e),n=e.elements.length;switch(r){case"Matrix(2)":case"Matrix(3)":case"Matrix(4)":t.push(`mat${n}(`);break;default:t.push(`vec${n}(`)}for(let r=0;r0&&t.push(", ");const n=e.elements[r];this.astGeneric(n,t)}return t.push(")"),t}memberExpressionXYZ(e,t,r,n){return r?n.push(this.memberExpressionPropertyMarkup(r),", "):n.push("0, "),t?n.push(this.memberExpressionPropertyMarkup(t),", "):n.push("0, "),n.push(this.memberExpressionPropertyMarkup(e)),n}memberExpressionPropertyMarkup(e){if(!e)throw new Error("Property not set");const t=[];switch(this.getType(e)){case"Number":case"Float":this.castValueToInteger(e,t);break;case"LiteralInteger":this.castLiteralToInteger(e,t);break;default:this.astGeneric(e,t)}return t.join("")}}}},{"../../utils":279,"../function-node":177}],206:[function(e,t,r){const{WebGLKernelValueBoolean:n}=e("./kernel-value/boolean"),{WebGLKernelValueFloat:i}=e("./kernel-value/float"),{WebGLKernelValueInteger:s}=e("./kernel-value/integer"),{WebGLKernelValueHTMLImage:o}=e("./kernel-value/html-image"),{WebGLKernelValueDynamicHTMLImage:a}=e("./kernel-value/dynamic-html-image"),{WebGLKernelValueHTMLVideo:u}=e("./kernel-value/html-video"),{WebGLKernelValueDynamicHTMLVideo:l}=e("./kernel-value/dynamic-html-video"),{WebGLKernelValueSingleInput:c}=e("./kernel-value/single-input"),{WebGLKernelValueDynamicSingleInput:h}=e("./kernel-value/dynamic-single-input"),{WebGLKernelValueUnsignedInput:p}=e("./kernel-value/unsigned-input"),{WebGLKernelValueDynamicUnsignedInput:f}=e("./kernel-value/dynamic-unsigned-input"),{WebGLKernelValueMemoryOptimizedNumberTexture:d}=e("./kernel-value/memory-optimized-number-texture"),{WebGLKernelValueDynamicMemoryOptimizedNumberTexture:m}=e("./kernel-value/dynamic-memory-optimized-number-texture"),{WebGLKernelValueNumberTexture:g}=e("./kernel-value/number-texture"),{WebGLKernelValueDynamicNumberTexture:v}=e("./kernel-value/dynamic-number-texture"),{WebGLKernelValueSingleArray:y}=e("./kernel-value/single-array"),{WebGLKernelValueDynamicSingleArray:_}=e("./kernel-value/dynamic-single-array"),{WebGLKernelValueSingleArray1DI:b}=e("./kernel-value/single-array1d-i"),{WebGLKernelValueDynamicSingleArray1DI:x}=e("./kernel-value/dynamic-single-array1d-i"),{WebGLKernelValueSingleArray2DI:w}=e("./kernel-value/single-array2d-i"),{WebGLKernelValueDynamicSingleArray2DI:E}=e("./kernel-value/dynamic-single-array2d-i"),{WebGLKernelValueSingleArray3DI:T}=e("./kernel-value/single-array3d-i"),{WebGLKernelValueDynamicSingleArray3DI:A}=e("./kernel-value/dynamic-single-array3d-i"),{WebGLKernelValueArray2:S}=e("./kernel-value/array2"),{WebGLKernelValueArray3:k}=e("./kernel-value/array3"),{WebGLKernelValueArray4:C}=e("./kernel-value/array4"),{WebGLKernelValueUnsignedArray:I}=e("./kernel-value/unsigned-array"),{WebGLKernelValueDynamicUnsignedArray:R}=e("./kernel-value/dynamic-unsigned-array"),O={unsigned:{dynamic:{Boolean:n,Integer:s,Float:i,Array:R,"Array(2)":S,"Array(3)":k,"Array(4)":C,"Array1D(2)":!1,"Array1D(3)":!1,"Array1D(4)":!1,"Array2D(2)":!1,"Array2D(3)":!1,"Array2D(4)":!1,"Array3D(2)":!1,"Array3D(3)":!1,"Array3D(4)":!1,Input:f,NumberTexture:v,"ArrayTexture(1)":v,"ArrayTexture(2)":v,"ArrayTexture(3)":v,"ArrayTexture(4)":v,MemoryOptimizedNumberTexture:m,HTMLCanvas:a,OffscreenCanvas:a,HTMLImage:a,ImageBitmap:a,ImageData:a,HTMLImageArray:!1,HTMLVideo:l},static:{Boolean:n,Float:i,Integer:s,Array:I,"Array(2)":S,"Array(3)":k,"Array(4)":C,"Array1D(2)":!1,"Array1D(3)":!1,"Array1D(4)":!1,"Array2D(2)":!1,"Array2D(3)":!1,"Array2D(4)":!1,"Array3D(2)":!1,"Array3D(3)":!1,"Array3D(4)":!1,Input:p,NumberTexture:g,"ArrayTexture(1)":g,"ArrayTexture(2)":g,"ArrayTexture(3)":g,"ArrayTexture(4)":g,MemoryOptimizedNumberTexture:d,HTMLCanvas:o,OffscreenCanvas:o,HTMLImage:o,ImageBitmap:o,ImageData:o,HTMLImageArray:!1,HTMLVideo:u}},single:{dynamic:{Boolean:n,Integer:s,Float:i,Array:_,"Array(2)":S,"Array(3)":k,"Array(4)":C,"Array1D(2)":x,"Array1D(3)":x,"Array1D(4)":x,"Array2D(2)":E,"Array2D(3)":E,"Array2D(4)":E,"Array3D(2)":A,"Array3D(3)":A,"Array3D(4)":A,Input:h,NumberTexture:v,"ArrayTexture(1)":v,"ArrayTexture(2)":v,"ArrayTexture(3)":v,"ArrayTexture(4)":v,MemoryOptimizedNumberTexture:m,HTMLCanvas:a,OffscreenCanvas:a,HTMLImage:a,ImageBitmap:a,ImageData:a,HTMLImageArray:!1,HTMLVideo:l},static:{Boolean:n,Float:i,Integer:s,Array:y,"Array(2)":S,"Array(3)":k,"Array(4)":C,"Array1D(2)":b,"Array1D(3)":b,"Array1D(4)":b,"Array2D(2)":w,"Array2D(3)":w,"Array2D(4)":w,"Array3D(2)":T,"Array3D(3)":T,"Array3D(4)":T,Input:c,NumberTexture:g,"ArrayTexture(1)":g,"ArrayTexture(2)":g,"ArrayTexture(3)":g,"ArrayTexture(4)":g,MemoryOptimizedNumberTexture:d,HTMLCanvas:o,OffscreenCanvas:o,HTMLImage:o,ImageBitmap:o,ImageData:o,HTMLImageArray:!1,HTMLVideo:u}}};t.exports={lookupKernelValueType:function(e,t,r,n){if(!e)throw new Error("type missing");if(!t)throw new Error("dynamic missing");if(!r)throw new Error("precision missing");n.type&&(e=n.type);const i=O[r][t];if(!1===i[e])return null;if(void 0===i[e])throw new Error(`Could not find a KernelValue for ${e}`);return i[e]},kernelValueMaps:O}},{"./kernel-value/array2":208,"./kernel-value/array3":209,"./kernel-value/array4":210,"./kernel-value/boolean":211,"./kernel-value/dynamic-html-image":212,"./kernel-value/dynamic-html-video":213,"./kernel-value/dynamic-memory-optimized-number-texture":214,"./kernel-value/dynamic-number-texture":215,"./kernel-value/dynamic-single-array":216,"./kernel-value/dynamic-single-array1d-i":217,"./kernel-value/dynamic-single-array2d-i":218,"./kernel-value/dynamic-single-array3d-i":219,"./kernel-value/dynamic-single-input":220,"./kernel-value/dynamic-unsigned-array":221,"./kernel-value/dynamic-unsigned-input":222,"./kernel-value/float":223,"./kernel-value/html-image":224,"./kernel-value/html-video":225,"./kernel-value/integer":227,"./kernel-value/memory-optimized-number-texture":228,"./kernel-value/number-texture":229,"./kernel-value/single-array":230,"./kernel-value/single-array1d-i":231,"./kernel-value/single-array2d-i":232,"./kernel-value/single-array3d-i":233,"./kernel-value/single-input":234,"./kernel-value/unsigned-array":235,"./kernel-value/unsigned-input":236}],207:[function(e,t,r){const{WebGLKernelValue:n}=e("./index"),{Input:i}=e("../../../input");t.exports={WebGLKernelArray:class extends n{checkSize(e,t){if(!this.kernel.validate)return;const{maxTextureSize:r}=this.kernel.constructor.features;if(e>r||t>r)throw e>t?new Error(`Argument texture width of ${e} larger than maximum size of ${r} for your GPU`):ee===n.name)&&t.push(n)}return t}initExtensions(){this.extensions={OES_texture_float:this.context.getExtension("OES_texture_float"),OES_texture_float_linear:this.context.getExtension("OES_texture_float_linear"),OES_element_index_uint:this.context.getExtension("OES_element_index_uint"),WEBGL_draw_buffers:this.context.getExtension("WEBGL_draw_buffers"),WEBGL_color_buffer_float:this.context.getExtension("WEBGL_color_buffer_float")}}validateSettings(e){if(!this.validate)return void(this.texSize=o.getKernelTextureSize({optimizeFloatMemory:this.optimizeFloatMemory,precision:this.precision},this.output));const{features:t}=this.constructor;if(!0===this.optimizeFloatMemory&&!t.isTextureFloat)throw new Error("Float textures are not supported");if("single"===this.precision&&!t.isFloatRead)throw new Error("Single precision not supported");if(!this.graphical&&null===this.precision&&t.isTextureFloat&&(this.precision=t.isFloatRead?"single":"unsigned"),this.subKernels&&this.subKernels.length>0&&!this.extensions.WEBGL_draw_buffers)throw new Error("could not instantiate draw buffers extension");if(null===this.fixIntegerDivisionAccuracy?this.fixIntegerDivisionAccuracy=!t.isIntegerDivisionAccurate:this.fixIntegerDivisionAccuracy&&t.isIntegerDivisionAccurate&&(this.fixIntegerDivisionAccuracy=!1),this.checkOutput(),!this.output||0===this.output.length){if(1!==e.length)throw new Error("Auto output only supported for kernels with only one input");const t=o.getVariableType(e[0],this.strictIntegers);switch(t){case"Array":this.output=o.getDimensions(t);break;case"NumberTexture":case"MemoryOptimizedNumberTexture":case"ArrayTexture(1)":case"ArrayTexture(2)":case"ArrayTexture(3)":case"ArrayTexture(4)":this.output=e[0].output;break;default:throw new Error("Auto output not supported for input type: "+t)}}if(this.graphical){if(2!==this.output.length)throw new Error("Output must have 2 dimensions on graphical mode");return"precision"===this.precision&&(this.precision="unsigned",console.warn("Cannot use graphical mode and single precision at the same time")),void(this.texSize=o.clone(this.output))}null===this.precision&&t.isTextureFloat&&(this.precision="single"),this.texSize=o.getKernelTextureSize({optimizeFloatMemory:this.optimizeFloatMemory,precision:this.precision},this.output),this.checkTextureSize()}updateMaxTexSize(){const{texSize:e,canvas:t}=this;if(null===this.maxTexSize){let r=y.indexOf(t);-1===r&&(r=y.length,y.push(t),_[r]=[e[0],e[1]]),this.maxTexSize=_[r]}this.maxTexSize[0]this.argumentNames.length)throw new Error("too many arguments for kernel");const{context:r}=this;let n=0;const i=()=>this.createTexture(),s=()=>this.constantTextureCount+n++,a=e=>{this.switchKernels({type:"argumentMismatch",needed:e})},u=()=>r.TEXTURE0+this.constantTextureCount+this.argumentTextureCount++;for(let n=0;nthis.createTexture(),onRequestIndex:()=>n++,onRequestContextHandle:()=>t.TEXTURE0+this.constantTextureCount++});this.constantBitRatios[i]=l.bitRatio,this.kernelConstants.push(l),l.setup(),l.forceUploadEachRun&&this.forceUploadKernelConstants.push(l)}}build(){if(this.built)return;if(this.initExtensions(),this.validateSettings(arguments),this.setupConstants(arguments),this.fallbackRequested)return;if(this.setupArguments(arguments),this.fallbackRequested)return;this.updateMaxTexSize(),this.translateSource();const e=this.pickRenderStrategy(arguments);if(e)return e;const{texSize:t,context:r,canvas:n}=this;r.enable(r.SCISSOR_TEST),this.pipeline&&this.precision,r.viewport(0,0,this.maxTexSize[0],this.maxTexSize[1]),n.width=this.maxTexSize[0],n.height=this.maxTexSize[1];const i=this.threadDim=Array.from(this.output);for(;i.length<3;)i.push(1);const s=this.getVertexShader(arguments),o=r.createShader(r.VERTEX_SHADER);r.shaderSource(o,s),r.compileShader(o),this.vertShader=o;const a=this.getFragmentShader(arguments),u=r.createShader(r.FRAGMENT_SHADER);if(r.shaderSource(u,a),r.compileShader(u),this.fragShader=u,this.debug&&(console.log("GLSL Shader Output:"),console.log(a)),!r.getShaderParameter(o,r.COMPILE_STATUS))throw new Error("Error compiling vertex shader: "+r.getShaderInfoLog(o));if(!r.getShaderParameter(u,r.COMPILE_STATUS))throw new Error("Error compiling fragment shader: "+r.getShaderInfoLog(u));const l=this.program=r.createProgram();r.attachShader(l,o),r.attachShader(l,u),r.linkProgram(l),this.framebuffer=r.createFramebuffer(),this.framebuffer.width=t[0],this.framebuffer.height=t[1],this.rawValueFramebuffers={};const c=new Float32Array([-1,-1,1,-1,-1,1,1,1]),h=new Float32Array([0,0,1,0,0,1,1,1]),p=c.byteLength;let f=this.buffer;f?r.bindBuffer(r.ARRAY_BUFFER,f):(f=this.buffer=r.createBuffer(),r.bindBuffer(r.ARRAY_BUFFER,f),r.bufferData(r.ARRAY_BUFFER,c.byteLength+h.byteLength,r.STATIC_DRAW)),r.bufferSubData(r.ARRAY_BUFFER,0,c),r.bufferSubData(r.ARRAY_BUFFER,p,h);const d=r.getAttribLocation(this.program,"aPos");r.enableVertexAttribArray(d),r.vertexAttribPointer(d,2,r.FLOAT,!1,0,0);const m=r.getAttribLocation(this.program,"aTexCoord");r.enableVertexAttribArray(m),r.vertexAttribPointer(m,2,r.FLOAT,!1,0,p),r.bindFramebuffer(r.FRAMEBUFFER,this.framebuffer);let g=0;r.useProgram(this.program);for(let e in this.constants)this.kernelConstants[g++].updateValue(this.constants[e]);this._setupOutputTexture(),null!==this.subKernels&&this.subKernels.length>0&&(this._mappedTextureSwitched={},this._setupSubOutputTextures()),this.buildSignature(arguments),this.built=!0}translateSource(){const e=i.fromKernel(this,s,{fixIntegerDivisionAccuracy:this.fixIntegerDivisionAccuracy});this.translatedSource=e.getPrototypeString("kernel"),this.setupReturnTypes(e)}setupReturnTypes(e){if(this.graphical||this.returnType||(this.returnType=e.getKernelResultType()),this.subKernels&&this.subKernels.length>0)for(let t=0;te.source&&this.source.match(e.functionMatch)?e.source:"").join("\n"):"\n"}_getConstantsString(){const e=[],{threadDim:t,texSize:r}=this;return this.dynamicOutput?e.push("uniform ivec3 uOutputDim","uniform ivec2 uTexSize"):e.push(`ivec3 uOutputDim = ivec3(${t[0]}, ${t[1]}, ${t[2]})`,`ivec2 uTexSize = ivec2(${r[0]}, ${r[1]})`),o.linesToString(e)}_getTextureCoordinate(){const e=this.subKernels;return null===e||e.length<1?"varying vec2 vTexCoord;\n":"out vec2 vTexCoord;\n"}_getDecode32EndiannessString(){return"LE"===this.endianness?"":" texel.rgba = texel.abgr;\n"}_getEncode32EndiannessString(){return"LE"===this.endianness?"":" texel.rgba = texel.abgr;\n"}_getDivideWithIntegerCheckString(){return this.fixIntegerDivisionAccuracy?"float divWithIntCheck(float x, float y) {\n if (floor(x) == x && floor(y) == y && integerMod(x, y) == 0.0) {\n return float(int(x) / int(y));\n }\n return x / y;\n}\n\nfloat integerCorrectionModulo(float number, float divisor) {\n if (number < 0.0) {\n number = abs(number);\n if (divisor < 0.0) {\n divisor = abs(divisor);\n }\n return -(number - (divisor * floor(divWithIntCheck(number, divisor))));\n }\n if (divisor < 0.0) {\n divisor = abs(divisor);\n }\n return number - (divisor * floor(divWithIntCheck(number, divisor)));\n}":""}_getMainArgumentsString(e){const t=[],{argumentNames:r}=this;for(let n=0;n{if(t.hasOwnProperty(r))return t[r];throw`unhandled artifact ${r}`})}getFragmentShader(e){return null!==this.compiledFragmentShader?this.compiledFragmentShader:this.compiledFragmentShader=this.replaceArtifacts(this.constructor.fragmentShader,this._getFragShaderArtifactMap(e))}getVertexShader(e){return null!==this.compiledVertexShader?this.compiledVertexShader:this.compiledVertexShader=this.replaceArtifacts(this.constructor.vertexShader,this._getVertShaderArtifactMap(e))}toString(){const e=o.linesToString(["const gl = context"]);return c(this.constructor,arguments,this,e)}destroy(e){if(!this.context)return;this.buffer&&this.context.deleteBuffer(this.buffer),this.framebuffer&&this.context.deleteFramebuffer(this.framebuffer);for(const e in this.rawValueFramebuffers){for(const t in this.rawValueFramebuffers[e])this.context.deleteFramebuffer(this.rawValueFramebuffers[e][t]),delete this.rawValueFramebuffers[e][t];delete this.rawValueFramebuffers[e]}if(this.vertShader&&this.context.deleteShader(this.vertShader),this.fragShader&&this.context.deleteShader(this.fragShader),this.program&&this.context.deleteProgram(this.program),this.texture){this.texture.delete();const e=this.textureCache.indexOf(this.texture.texture);e>-1&&this.textureCache.splice(e,1),this.texture=null}if(this.mappedTextures&&this.mappedTextures.length){for(let e=0;e-1&&this.textureCache.splice(r,1)}this.mappedTextures=null}if(this.kernelArguments)for(let e=0;e0;){const e=this.textureCache.pop();this.context.deleteTexture(e)}if(e){const e=y.indexOf(this.canvas);e>=0&&(y[e]=null,_[e]=null)}if(this.destroyExtensions(),delete this.context,delete this.canvas,!this.gpu)return;const t=this.gpu.kernels.indexOf(this);-1!==t&&this.gpu.kernels.splice(t,1)}destroyExtensions(){this.extensions.OES_texture_float=null,this.extensions.OES_texture_float_linear=null,this.extensions.OES_element_index_uint=null,this.extensions.WEBGL_draw_buffers=null}static destroyContext(e){const t=e.getExtension("WEBGL_lose_context");t&&t.loseContext()}toJSON(){const e=super.toJSON();return e.functionNodes=i.fromKernel(this,s).toJSON(),e.settings.threadDim=this.threadDim,e}}}},{"../../plugins/math-random-uniformly-distributed":277,"../../utils":279,"../function-builder":176,"../gl/kernel":180,"../gl/kernel-string":179,"./fragment-shader":204,"./function-node":205,"./kernel-value-maps":206,"./vertex-shader":238}],238:[function(e,t,r){t.exports={vertexShader:"__FLOAT_TACTIC_DECLARATION__;\n__INT_TACTIC_DECLARATION__;\n__SAMPLER_2D_TACTIC_DECLARATION__;\n\nattribute vec2 aPos;\nattribute vec2 aTexCoord;\n\nvarying vec2 vTexCoord;\nuniform vec2 ratio;\n\nvoid main(void) {\n gl_Position = vec4((aPos + vec2(1)) * ratio + vec2(-1), 0, 1);\n vTexCoord = aTexCoord;\n}"}},{}],239:[function(e,t,r){const n=`#version 300 es\n__HEADER__;\n__FLOAT_TACTIC_DECLARATION__;\n__INT_TACTIC_DECLARATION__;\n__SAMPLER_2D_TACTIC_DECLARATION__;\n__SAMPLER_2D_ARRAY_TACTIC_DECLARATION__;\n\nconst int LOOP_MAX = __LOOP_MAX__;\n\n__PLUGINS__;\n__CONSTANTS__;\n\nin vec2 vTexCoord;\n\nfloat atan2(float v1, float v2) {\n if (v1 == 0.0 || v2 == 0.0) return 0.0;\n return atan(v1 / v2);\n}\n\nfloat cbrt(float x) {\n if (x >= 0.0) {\n return pow(x, 1.0 / 3.0);\n } else {\n return -pow(x, 1.0 / 3.0);\n }\n}\n\nfloat expm1(float x) {\n return pow(${Math.E}, x) - 1.0; \n}\n\nfloat fround(highp float x) {\n return x;\n}\n\nfloat imul(float v1, float v2) {\n return float(int(v1) * int(v2));\n}\n\nfloat log10(float x) {\n return log2(x) * (1.0 / log2(10.0));\n}\n\nfloat log1p(float x) {\n return log(1.0 + x);\n}\n\nfloat _pow(float v1, float v2) {\n if (v2 == 0.0) return 1.0;\n return pow(v1, v2);\n}\n\nfloat _round(float x) {\n return floor(x + 0.5);\n}\n\n\nconst int BIT_COUNT = 32;\nint modi(int x, int y) {\n return x - y * (x / y);\n}\n\nint bitwiseOr(int a, int b) {\n int result = 0;\n int n = 1;\n \n for (int i = 0; i < BIT_COUNT; i++) {\n if ((modi(a, 2) == 1) || (modi(b, 2) == 1)) {\n result += n;\n }\n a = a / 2;\n b = b / 2;\n n = n * 2;\n if(!(a > 0 || b > 0)) {\n break;\n }\n }\n return result;\n}\nint bitwiseXOR(int a, int b) {\n int result = 0;\n int n = 1;\n \n for (int i = 0; i < BIT_COUNT; i++) {\n if ((modi(a, 2) == 1) != (modi(b, 2) == 1)) {\n result += n;\n }\n a = a / 2;\n b = b / 2;\n n = n * 2;\n if(!(a > 0 || b > 0)) {\n break;\n }\n }\n return result;\n}\nint bitwiseAnd(int a, int b) {\n int result = 0;\n int n = 1;\n for (int i = 0; i < BIT_COUNT; i++) {\n if ((modi(a, 2) == 1) && (modi(b, 2) == 1)) {\n result += n;\n }\n a = a / 2;\n b = b / 2;\n n = n * 2;\n if(!(a > 0 && b > 0)) {\n break;\n }\n }\n return result;\n}\nint bitwiseNot(int a) {\n int result = 0;\n int n = 1;\n \n for (int i = 0; i < BIT_COUNT; i++) {\n if (modi(a, 2) == 0) {\n result += n; \n }\n a = a / 2;\n n = n * 2;\n }\n return result;\n}\nint bitwiseZeroFillLeftShift(int n, int shift) {\n int maxBytes = BIT_COUNT;\n for (int i = 0; i < BIT_COUNT; i++) {\n if (maxBytes >= n) {\n break;\n }\n maxBytes *= 2;\n }\n for (int i = 0; i < BIT_COUNT; i++) {\n if (i >= shift) {\n break;\n }\n n *= 2;\n }\n\n int result = 0;\n int byteVal = 1;\n for (int i = 0; i < BIT_COUNT; i++) {\n if (i >= maxBytes) break;\n if (modi(n, 2) > 0) { result += byteVal; }\n n = int(n / 2);\n byteVal *= 2;\n }\n return result;\n}\n\nint bitwiseSignedRightShift(int num, int shifts) {\n return int(floor(float(num) / pow(2.0, float(shifts))));\n}\n\nint bitwiseZeroFillRightShift(int n, int shift) {\n int maxBytes = BIT_COUNT;\n for (int i = 0; i < BIT_COUNT; i++) {\n if (maxBytes >= n) {\n break;\n }\n maxBytes *= 2;\n }\n for (int i = 0; i < BIT_COUNT; i++) {\n if (i >= shift) {\n break;\n }\n n /= 2;\n }\n int result = 0;\n int byteVal = 1;\n for (int i = 0; i < BIT_COUNT; i++) {\n if (i >= maxBytes) break;\n if (modi(n, 2) > 0) { result += byteVal; }\n n = int(n / 2);\n byteVal *= 2;\n }\n return result;\n}\n\nvec2 integerMod(vec2 x, float y) {\n vec2 res = floor(mod(x, y));\n return res * step(1.0 - floor(y), -res);\n}\n\nvec3 integerMod(vec3 x, float y) {\n vec3 res = floor(mod(x, y));\n return res * step(1.0 - floor(y), -res);\n}\n\nvec4 integerMod(vec4 x, vec4 y) {\n vec4 res = floor(mod(x, y));\n return res * step(1.0 - floor(y), -res);\n}\n\nfloat integerMod(float x, float y) {\n float res = floor(mod(x, y));\n return res * (res > floor(y) - 1.0 ? 0.0 : 1.0);\n}\n\nint integerMod(int x, int y) {\n return x - (y * int(x/y));\n}\n\n__DIVIDE_WITH_INTEGER_CHECK__;\n\n// Here be dragons!\n// DO NOT OPTIMIZE THIS CODE\n// YOU WILL BREAK SOMETHING ON SOMEBODY'S MACHINE\n// LEAVE IT AS IT IS, LEST YOU WASTE YOUR OWN TIME\nconst vec2 MAGIC_VEC = vec2(1.0, -256.0);\nconst vec4 SCALE_FACTOR = vec4(1.0, 256.0, 65536.0, 0.0);\nconst vec4 SCALE_FACTOR_INV = vec4(1.0, 0.00390625, 0.0000152587890625, 0.0); // 1, 1/256, 1/65536\nfloat decode32(vec4 texel) {\n __DECODE32_ENDIANNESS__;\n texel *= 255.0;\n vec2 gte128;\n gte128.x = texel.b >= 128.0 ? 1.0 : 0.0;\n gte128.y = texel.a >= 128.0 ? 1.0 : 0.0;\n float exponent = 2.0 * texel.a - 127.0 + dot(gte128, MAGIC_VEC);\n float res = exp2(round(exponent));\n texel.b = texel.b - 128.0 * gte128.x;\n res = dot(texel, SCALE_FACTOR) * exp2(round(exponent-23.0)) + res;\n res *= gte128.y * -2.0 + 1.0;\n return res;\n}\n\nfloat decode16(vec4 texel, int index) {\n int channel = integerMod(index, 2);\n return texel[channel*2] * 255.0 + texel[channel*2 + 1] * 65280.0;\n}\n\nfloat decode8(vec4 texel, int index) {\n int channel = integerMod(index, 4);\n return texel[channel] * 255.0;\n}\n\nvec4 legacyEncode32(float f) {\n float F = abs(f);\n float sign = f < 0.0 ? 1.0 : 0.0;\n float exponent = floor(log2(F));\n float mantissa = (exp2(-exponent) * F);\n // exponent += floor(log2(mantissa));\n vec4 texel = vec4(F * exp2(23.0-exponent)) * SCALE_FACTOR_INV;\n texel.rg = integerMod(texel.rg, 256.0);\n texel.b = integerMod(texel.b, 128.0);\n texel.a = exponent*0.5 + 63.5;\n texel.ba += vec2(integerMod(exponent+127.0, 2.0), sign) * 128.0;\n texel = floor(texel);\n texel *= 0.003921569; // 1/255\n __ENCODE32_ENDIANNESS__;\n return texel;\n}\n\n// https://github.com/gpujs/gpu.js/wiki/Encoder-details\nvec4 encode32(float value) {\n if (value == 0.0) return vec4(0, 0, 0, 0);\n\n float exponent;\n float mantissa;\n vec4 result;\n float sgn;\n\n sgn = step(0.0, -value);\n value = abs(value);\n\n exponent = floor(log2(value));\n\n mantissa = value*pow(2.0, -exponent)-1.0;\n exponent = exponent+127.0;\n result = vec4(0,0,0,0);\n\n result.a = floor(exponent/2.0);\n exponent = exponent - result.a*2.0;\n result.a = result.a + 128.0*sgn;\n\n result.b = floor(mantissa * 128.0);\n mantissa = mantissa - result.b / 128.0;\n result.b = result.b + exponent*128.0;\n\n result.g = floor(mantissa*32768.0);\n mantissa = mantissa - result.g/32768.0;\n\n result.r = floor(mantissa*8388608.0);\n return result/255.0;\n}\n// Dragons end here\n\nint index;\nivec3 threadId;\n\nivec3 indexTo3D(int idx, ivec3 texDim) {\n int z = int(idx / (texDim.x * texDim.y));\n idx -= z * int(texDim.x * texDim.y);\n int y = int(idx / texDim.x);\n int x = int(integerMod(idx, texDim.x));\n return ivec3(x, y, z);\n}\n\nfloat get32(sampler2D tex, ivec2 texSize, ivec3 texDim, int z, int y, int x) {\n int index = x + texDim.x * (y + texDim.y * z);\n int w = texSize.x;\n vec2 st = vec2(float(integerMod(index, w)), float(index / w)) + 0.5;\n vec4 texel = texture(tex, st / vec2(texSize));\n return decode32(texel);\n}\n\nfloat get16(sampler2D tex, ivec2 texSize, ivec3 texDim, int z, int y, int x) {\n int index = x + (texDim.x * (y + (texDim.y * z)));\n int w = texSize.x * 2;\n vec2 st = vec2(float(integerMod(index, w)), float(index / w)) + 0.5;\n vec4 texel = texture(tex, st / vec2(texSize.x * 2, texSize.y));\n return decode16(texel, index);\n}\n\nfloat get8(sampler2D tex, ivec2 texSize, ivec3 texDim, int z, int y, int x) {\n int index = x + (texDim.x * (y + (texDim.y * z)));\n int w = texSize.x * 4;\n vec2 st = vec2(float(integerMod(index, w)), float(index / w)) + 0.5;\n vec4 texel = texture(tex, st / vec2(texSize.x * 4, texSize.y));\n return decode8(texel, index);\n}\n\nfloat getMemoryOptimized32(sampler2D tex, ivec2 texSize, ivec3 texDim, int z, int y, int x) {\n int index = x + (texDim.x * (y + (texDim.y * z)));\n int channel = integerMod(index, 4);\n index = index / 4;\n int w = texSize.x;\n vec2 st = vec2(float(integerMod(index, w)), float(index / w)) + 0.5;\n index = index / 4;\n vec4 texel = texture(tex, st / vec2(texSize));\n return texel[channel];\n}\n\nvec4 getImage2D(sampler2D tex, ivec2 texSize, ivec3 texDim, int z, int y, int x) {\n int index = x + texDim.x * (y + texDim.y * z);\n int w = texSize.x;\n vec2 st = vec2(float(integerMod(index, w)), float(index / w)) + 0.5;\n return texture(tex, st / vec2(texSize));\n}\n\nvec4 getImage3D(sampler2DArray tex, ivec2 texSize, ivec3 texDim, int z, int y, int x) {\n int index = x + texDim.x * (y + texDim.y * z);\n int w = texSize.x;\n vec2 st = vec2(float(integerMod(index, w)), float(index / w)) + 0.5;\n return texture(tex, vec3(st / vec2(texSize), z));\n}\n\nfloat getFloatFromSampler2D(sampler2D tex, ivec2 texSize, ivec3 texDim, int z, int y, int x) {\n vec4 result = getImage2D(tex, texSize, texDim, z, y, x);\n return result[0];\n}\n\nvec2 getVec2FromSampler2D(sampler2D tex, ivec2 texSize, ivec3 texDim, int z, int y, int x) {\n vec4 result = getImage2D(tex, texSize, texDim, z, y, x);\n return vec2(result[0], result[1]);\n}\n\nvec2 getMemoryOptimizedVec2(sampler2D tex, ivec2 texSize, ivec3 texDim, int z, int y, int x) {\n int index = x + texDim.x * (y + texDim.y * z);\n int channel = integerMod(index, 2);\n index = index / 2;\n int w = texSize.x;\n vec2 st = vec2(float(integerMod(index, w)), float(index / w)) + 0.5;\n vec4 texel = texture(tex, st / vec2(texSize));\n if (channel == 0) return vec2(texel.r, texel.g);\n if (channel == 1) return vec2(texel.b, texel.a);\n return vec2(0.0, 0.0);\n}\n\nvec3 getVec3FromSampler2D(sampler2D tex, ivec2 texSize, ivec3 texDim, int z, int y, int x) {\n vec4 result = getImage2D(tex, texSize, texDim, z, y, x);\n return vec3(result[0], result[1], result[2]);\n}\n\nvec3 getMemoryOptimizedVec3(sampler2D tex, ivec2 texSize, ivec3 texDim, int z, int y, int x) {\n int fieldIndex = 3 * (x + texDim.x * (y + texDim.y * z));\n int vectorIndex = fieldIndex / 4;\n int vectorOffset = fieldIndex - vectorIndex * 4;\n int readY = vectorIndex / texSize.x;\n int readX = vectorIndex - readY * texSize.x;\n vec4 tex1 = texture(tex, (vec2(readX, readY) + 0.5) / vec2(texSize));\n\n if (vectorOffset == 0) {\n return tex1.xyz;\n } else if (vectorOffset == 1) {\n return tex1.yzw;\n } else {\n readX++;\n if (readX >= texSize.x) {\n readX = 0;\n readY++;\n }\n vec4 tex2 = texture(tex, vec2(readX, readY) / vec2(texSize));\n if (vectorOffset == 2) {\n return vec3(tex1.z, tex1.w, tex2.x);\n } else {\n return vec3(tex1.w, tex2.x, tex2.y);\n }\n }\n}\n\nvec4 getVec4FromSampler2D(sampler2D tex, ivec2 texSize, ivec3 texDim, int z, int y, int x) {\n return getImage2D(tex, texSize, texDim, z, y, x);\n}\n\nvec4 getMemoryOptimizedVec4(sampler2D tex, ivec2 texSize, ivec3 texDim, int z, int y, int x) {\n int index = x + texDim.x * (y + texDim.y * z);\n int channel = integerMod(index, 2);\n int w = texSize.x;\n vec2 st = vec2(float(integerMod(index, w)), float(index / w)) + 0.5;\n vec4 texel = texture(tex, st / vec2(texSize));\n return vec4(texel.r, texel.g, texel.b, texel.a);\n}\n\nvec4 actualColor;\nvoid color(float r, float g, float b, float a) {\n actualColor = vec4(r,g,b,a);\n}\n\nvoid color(float r, float g, float b) {\n color(r,g,b,1.0);\n}\n\nfloat modulo(float number, float divisor) {\n if (number < 0.0) {\n number = abs(number);\n if (divisor < 0.0) {\n divisor = abs(divisor);\n }\n return -mod(number, divisor);\n }\n if (divisor < 0.0) {\n divisor = abs(divisor);\n }\n return mod(number, divisor);\n}\n\n__INJECTED_NATIVE__;\n__MAIN_CONSTANTS__;\n__MAIN_ARGUMENTS__;\n__KERNEL__;\n\nvoid main(void) {\n index = int(vTexCoord.s * float(uTexSize.x)) + int(vTexCoord.t * float(uTexSize.y)) * uTexSize.x;\n __MAIN_RESULT__;\n}`;t.exports={fragmentShader:n}},{}],240:[function(e,t,r){const{utils:n}=e("../../utils"),{WebGLFunctionNode:i}=e("../web-gl/function-node");t.exports={WebGL2FunctionNode:class extends i{astIdentifierExpression(e,t){if("Identifier"!==e.type)throw this.astErrorOutput("IdentifierExpression - not an Identifier",e);const r=this.getType(e),i=n.sanitizeName(e.name);return"Infinity"===e.name?t.push("intBitsToFloat(2139095039)"):"Boolean"===r&&this.argumentNames.indexOf(i)>-1?t.push(`bool(user_${i})`):t.push(`user_${i}`),t}}}},{"../../utils":279,"../web-gl/function-node":205}],241:[function(e,t,r){const{WebGL2KernelValueBoolean:n}=e("./kernel-value/boolean"),{WebGL2KernelValueFloat:i}=e("./kernel-value/float"),{WebGL2KernelValueInteger:s}=e("./kernel-value/integer"),{WebGL2KernelValueHTMLImage:o}=e("./kernel-value/html-image"),{WebGL2KernelValueDynamicHTMLImage:a}=e("./kernel-value/dynamic-html-image"),{WebGL2KernelValueHTMLImageArray:u}=e("./kernel-value/html-image-array"),{WebGL2KernelValueDynamicHTMLImageArray:l}=e("./kernel-value/dynamic-html-image-array"),{WebGL2KernelValueHTMLVideo:c}=e("./kernel-value/html-video"),{WebGL2KernelValueDynamicHTMLVideo:h}=e("./kernel-value/dynamic-html-video"),{WebGL2KernelValueSingleInput:p}=e("./kernel-value/single-input"),{WebGL2KernelValueDynamicSingleInput:f}=e("./kernel-value/dynamic-single-input"),{WebGL2KernelValueUnsignedInput:d}=e("./kernel-value/unsigned-input"),{WebGL2KernelValueDynamicUnsignedInput:m}=e("./kernel-value/dynamic-unsigned-input"),{WebGL2KernelValueMemoryOptimizedNumberTexture:g}=e("./kernel-value/memory-optimized-number-texture"),{WebGL2KernelValueDynamicMemoryOptimizedNumberTexture:v}=e("./kernel-value/dynamic-memory-optimized-number-texture"),{WebGL2KernelValueNumberTexture:y}=e("./kernel-value/number-texture"),{WebGL2KernelValueDynamicNumberTexture:_}=e("./kernel-value/dynamic-number-texture"),{WebGL2KernelValueSingleArray:b}=e("./kernel-value/single-array"),{WebGL2KernelValueDynamicSingleArray:x}=e("./kernel-value/dynamic-single-array"),{WebGL2KernelValueSingleArray1DI:w}=e("./kernel-value/single-array1d-i"),{WebGL2KernelValueDynamicSingleArray1DI:E}=e("./kernel-value/dynamic-single-array1d-i"),{WebGL2KernelValueSingleArray2DI:T}=e("./kernel-value/single-array2d-i"),{WebGL2KernelValueDynamicSingleArray2DI:A}=e("./kernel-value/dynamic-single-array2d-i"),{WebGL2KernelValueSingleArray3DI:S}=e("./kernel-value/single-array3d-i"),{WebGL2KernelValueDynamicSingleArray3DI:k}=e("./kernel-value/dynamic-single-array3d-i"),{WebGL2KernelValueArray2:C}=e("./kernel-value/array2"),{WebGL2KernelValueArray3:I}=e("./kernel-value/array3"),{WebGL2KernelValueArray4:R}=e("./kernel-value/array4"),{WebGL2KernelValueUnsignedArray:O}=e("./kernel-value/unsigned-array"),{WebGL2KernelValueDynamicUnsignedArray:L}=e("./kernel-value/dynamic-unsigned-array"),P={unsigned:{dynamic:{Boolean:n,Integer:s,Float:i,Array:L,"Array(2)":C,"Array(3)":I,"Array(4)":R,"Array1D(2)":!1,"Array1D(3)":!1,"Array1D(4)":!1,"Array2D(2)":!1,"Array2D(3)":!1,"Array2D(4)":!1,"Array3D(2)":!1,"Array3D(3)":!1,"Array3D(4)":!1,Input:m,NumberTexture:_,"ArrayTexture(1)":_,"ArrayTexture(2)":_,"ArrayTexture(3)":_,"ArrayTexture(4)":_,MemoryOptimizedNumberTexture:v,HTMLCanvas:a,OffscreenCanvas:a,HTMLImage:a,ImageBitmap:a,ImageData:a,HTMLImageArray:l,HTMLVideo:h},static:{Boolean:n,Float:i,Integer:s,Array:O,"Array(2)":C,"Array(3)":I,"Array(4)":R,"Array1D(2)":!1,"Array1D(3)":!1,"Array1D(4)":!1,"Array2D(2)":!1,"Array2D(3)":!1,"Array2D(4)":!1,"Array3D(2)":!1,"Array3D(3)":!1,"Array3D(4)":!1,Input:d,NumberTexture:y,"ArrayTexture(1)":y,"ArrayTexture(2)":y,"ArrayTexture(3)":y,"ArrayTexture(4)":y,MemoryOptimizedNumberTexture:v,HTMLCanvas:o,OffscreenCanvas:o,HTMLImage:o,ImageBitmap:o,ImageData:o,HTMLImageArray:u,HTMLVideo:c}},single:{dynamic:{Boolean:n,Integer:s,Float:i,Array:x,"Array(2)":C,"Array(3)":I,"Array(4)":R,"Array1D(2)":E,"Array1D(3)":E,"Array1D(4)":E,"Array2D(2)":A,"Array2D(3)":A,"Array2D(4)":A,"Array3D(2)":k,"Array3D(3)":k,"Array3D(4)":k,Input:f,NumberTexture:_,"ArrayTexture(1)":_,"ArrayTexture(2)":_,"ArrayTexture(3)":_,"ArrayTexture(4)":_,MemoryOptimizedNumberTexture:v,HTMLCanvas:a,OffscreenCanvas:a,HTMLImage:a,ImageBitmap:a,ImageData:a,HTMLImageArray:l,HTMLVideo:h},static:{Boolean:n,Float:i,Integer:s,Array:b,"Array(2)":C,"Array(3)":I,"Array(4)":R,"Array1D(2)":w,"Array1D(3)":w,"Array1D(4)":w,"Array2D(2)":T,"Array2D(3)":T,"Array2D(4)":T,"Array3D(2)":S,"Array3D(3)":S,"Array3D(4)":S,Input:p,NumberTexture:y,"ArrayTexture(1)":y,"ArrayTexture(2)":y,"ArrayTexture(3)":y,"ArrayTexture(4)":y,MemoryOptimizedNumberTexture:g,HTMLCanvas:o,OffscreenCanvas:o,HTMLImage:o,ImageBitmap:o,ImageData:o,HTMLImageArray:u,HTMLVideo:c}}};t.exports={kernelValueMaps:P,lookupKernelValueType:function(e,t,r,n){if(!e)throw new Error("type missing");if(!t)throw new Error("dynamic missing");if(!r)throw new Error("precision missing");n.type&&(e=n.type);const i=P[r][t];if(!1===i[e])return null;if(void 0===i[e])throw new Error(`Could not find a KernelValue for ${e}`);return i[e]}}},{"./kernel-value/array2":242,"./kernel-value/array3":243,"./kernel-value/array4":244,"./kernel-value/boolean":245,"./kernel-value/dynamic-html-image":247,"./kernel-value/dynamic-html-image-array":246,"./kernel-value/dynamic-html-video":248,"./kernel-value/dynamic-memory-optimized-number-texture":249,"./kernel-value/dynamic-number-texture":250,"./kernel-value/dynamic-single-array":251,"./kernel-value/dynamic-single-array1d-i":252,"./kernel-value/dynamic-single-array2d-i":253,"./kernel-value/dynamic-single-array3d-i":254,"./kernel-value/dynamic-single-input":255,"./kernel-value/dynamic-unsigned-array":256,"./kernel-value/dynamic-unsigned-input":257,"./kernel-value/float":258,"./kernel-value/html-image":260,"./kernel-value/html-image-array":259,"./kernel-value/html-video":261,"./kernel-value/integer":262,"./kernel-value/memory-optimized-number-texture":263,"./kernel-value/number-texture":264,"./kernel-value/single-array":265,"./kernel-value/single-array1d-i":266,"./kernel-value/single-array2d-i":267,"./kernel-value/single-array3d-i":268,"./kernel-value/single-input":269,"./kernel-value/unsigned-array":270,"./kernel-value/unsigned-input":271}],242:[function(e,t,r){const{WebGLKernelValueArray2:n}=e("../../web-gl/kernel-value/array2");t.exports={WebGL2KernelValueArray2:class extends n{}}},{"../../web-gl/kernel-value/array2":208}],243:[function(e,t,r){const{WebGLKernelValueArray3:n}=e("../../web-gl/kernel-value/array3");t.exports={WebGL2KernelValueArray3:class extends n{}}},{"../../web-gl/kernel-value/array3":209}],244:[function(e,t,r){const{WebGLKernelValueArray4:n}=e("../../web-gl/kernel-value/array4");t.exports={WebGL2KernelValueArray4:class extends n{}}},{"../../web-gl/kernel-value/array4":210}],245:[function(e,t,r){const{WebGLKernelValueBoolean:n}=e("../../web-gl/kernel-value/boolean");t.exports={WebGL2KernelValueBoolean:class extends n{}}},{"../../web-gl/kernel-value/boolean":211}],246:[function(e,t,r){const{utils:n}=e("../../../utils"),{WebGL2KernelValueHTMLImageArray:i}=e("./html-image-array");t.exports={WebGL2KernelValueDynamicHTMLImageArray:class extends i{getSource(){const e=this.getVariablePrecisionString();return n.linesToString([`uniform ${e} sampler2DArray ${this.id}`,`uniform ${e} ivec2 ${this.sizeId}`,`uniform ${e} ivec3 ${this.dimensionsId}`])}updateValue(e){const{width:t,height:r}=e[0];this.checkSize(t,r),this.dimensions=[t,r,e.length],this.textureSize=[t,r],this.kernel.setUniform3iv(this.dimensionsId,this.dimensions),this.kernel.setUniform2iv(this.sizeId,this.textureSize),super.updateValue(e)}}}},{"../../../utils":279,"./html-image-array":259}],247:[function(e,t,r){const{utils:n}=e("../../../utils"),{WebGLKernelValueDynamicHTMLImage:i}=e("../../web-gl/kernel-value/dynamic-html-image");t.exports={WebGL2KernelValueDynamicHTMLImage:class extends i{getSource(){const e=this.getVariablePrecisionString();return n.linesToString([`uniform ${e} sampler2D ${this.id}`,`uniform ${e} ivec2 ${this.sizeId}`,`uniform ${e} ivec3 ${this.dimensionsId}`])}}}},{"../../../utils":279,"../../web-gl/kernel-value/dynamic-html-image":212}],248:[function(e,t,r){const{utils:n}=e("../../../utils"),{WebGL2KernelValueDynamicHTMLImage:i}=e("./dynamic-html-image");t.exports={WebGL2KernelValueDynamicHTMLVideo:class extends i{}}},{"../../../utils":279,"./dynamic-html-image":247}],249:[function(e,t,r){const{utils:n}=e("../../../utils"),{WebGLKernelValueDynamicMemoryOptimizedNumberTexture:i}=e("../../web-gl/kernel-value/dynamic-memory-optimized-number-texture");t.exports={WebGL2KernelValueDynamicMemoryOptimizedNumberTexture:class extends i{getSource(){return n.linesToString([`uniform sampler2D ${this.id}`,`uniform ivec2 ${this.sizeId}`,`uniform ivec3 ${this.dimensionsId}`])}}}},{"../../../utils":279,"../../web-gl/kernel-value/dynamic-memory-optimized-number-texture":214}],250:[function(e,t,r){const{utils:n}=e("../../../utils"),{WebGLKernelValueDynamicNumberTexture:i}=e("../../web-gl/kernel-value/dynamic-number-texture");t.exports={WebGL2KernelValueDynamicNumberTexture:class extends i{getSource(){const e=this.getVariablePrecisionString();return n.linesToString([`uniform ${e} sampler2D ${this.id}`,`uniform ${e} ivec2 ${this.sizeId}`,`uniform ${e} ivec3 ${this.dimensionsId}`])}}}},{"../../../utils":279,"../../web-gl/kernel-value/dynamic-number-texture":215}],251:[function(e,t,r){const{utils:n}=e("../../../utils"),{WebGL2KernelValueSingleArray:i}=e("../../web-gl2/kernel-value/single-array");t.exports={WebGL2KernelValueDynamicSingleArray:class extends i{getSource(){const e=this.getVariablePrecisionString();return n.linesToString([`uniform ${e} sampler2D ${this.id}`,`uniform ${e} ivec2 ${this.sizeId}`,`uniform ${e} ivec3 ${this.dimensionsId}`])}updateValue(e){this.dimensions=n.getDimensions(e,!0),this.textureSize=n.getMemoryOptimizedFloatTextureSize(this.dimensions,this.bitRatio),this.uploadArrayLength=this.textureSize[0]*this.textureSize[1]*this.bitRatio,this.checkSize(this.textureSize[0],this.textureSize[1]),this.uploadValue=new Float32Array(this.uploadArrayLength),this.kernel.setUniform3iv(this.dimensionsId,this.dimensions),this.kernel.setUniform2iv(this.sizeId,this.textureSize),super.updateValue(e)}}}},{"../../../utils":279,"../../web-gl2/kernel-value/single-array":265}],252:[function(e,t,r){const{utils:n}=e("../../../utils"),{WebGL2KernelValueSingleArray1DI:i}=e("../../web-gl2/kernel-value/single-array1d-i");t.exports={WebGL2KernelValueDynamicSingleArray1DI:class extends i{getSource(){const e=this.getVariablePrecisionString();return n.linesToString([`uniform ${e} sampler2D ${this.id}`,`uniform ${e} ivec2 ${this.sizeId}`,`uniform ${e} ivec3 ${this.dimensionsId}`])}updateValue(e){this.setShape(e),this.kernel.setUniform3iv(this.dimensionsId,this.dimensions),this.kernel.setUniform2iv(this.sizeId,this.textureSize),super.updateValue(e)}}}},{"../../../utils":279,"../../web-gl2/kernel-value/single-array1d-i":266}],253:[function(e,t,r){const{utils:n}=e("../../../utils"),{WebGL2KernelValueSingleArray2DI:i}=e("../../web-gl2/kernel-value/single-array2d-i");t.exports={WebGL2KernelValueDynamicSingleArray2DI:class extends i{getSource(){const e=this.getVariablePrecisionString();return n.linesToString([`uniform ${e} sampler2D ${this.id}`,`uniform ${e} ivec2 ${this.sizeId}`,`uniform ${e} ivec3 ${this.dimensionsId}`])}updateValue(e){this.setShape(e),this.kernel.setUniform3iv(this.dimensionsId,this.dimensions),this.kernel.setUniform2iv(this.sizeId,this.textureSize),super.updateValue(e)}}}},{"../../../utils":279,"../../web-gl2/kernel-value/single-array2d-i":267}],254:[function(e,t,r){const{utils:n}=e("../../../utils"),{WebGL2KernelValueSingleArray3DI:i}=e("../../web-gl2/kernel-value/single-array3d-i");t.exports={WebGL2KernelValueDynamicSingleArray3DI:class extends i{getSource(){const e=this.getVariablePrecisionString();return n.linesToString([`uniform ${e} sampler2D ${this.id}`,`uniform ${e} ivec2 ${this.sizeId}`,`uniform ${e} ivec3 ${this.dimensionsId}`])}updateValue(e){this.setShape(e),this.kernel.setUniform3iv(this.dimensionsId,this.dimensions),this.kernel.setUniform2iv(this.sizeId,this.textureSize),super.updateValue(e)}}}},{"../../../utils":279,"../../web-gl2/kernel-value/single-array3d-i":268}],255:[function(e,t,r){const{utils:n}=e("../../../utils"),{WebGL2KernelValueSingleInput:i}=e("../../web-gl2/kernel-value/single-input");t.exports={WebGL2KernelValueDynamicSingleInput:class extends i{getSource(){const e=this.getVariablePrecisionString();return n.linesToString([`uniform ${e} sampler2D ${this.id}`,`uniform ${e} ivec2 ${this.sizeId}`,`uniform ${e} ivec3 ${this.dimensionsId}`])}updateValue(e){let[t,r,i]=e.size;this.dimensions=new Int32Array([t||1,r||1,i||1]),this.textureSize=n.getMemoryOptimizedFloatTextureSize(this.dimensions,this.bitRatio),this.uploadArrayLength=this.textureSize[0]*this.textureSize[1]*this.bitRatio,this.checkSize(this.textureSize[0],this.textureSize[1]),this.uploadValue=new Float32Array(this.uploadArrayLength),this.kernel.setUniform3iv(this.dimensionsId,this.dimensions),this.kernel.setUniform2iv(this.sizeId,this.textureSize),super.updateValue(e)}}}},{"../../../utils":279,"../../web-gl2/kernel-value/single-input":269}],256:[function(e,t,r){const{utils:n}=e("../../../utils"),{WebGLKernelValueDynamicUnsignedArray:i}=e("../../web-gl/kernel-value/dynamic-unsigned-array");t.exports={WebGL2KernelValueDynamicUnsignedArray:class extends i{getSource(){const e=this.getVariablePrecisionString();return n.linesToString([`uniform ${e} sampler2D ${this.id}`,`uniform ${e} ivec2 ${this.sizeId}`,`uniform ${e} ivec3 ${this.dimensionsId}`])}}}},{"../../../utils":279,"../../web-gl/kernel-value/dynamic-unsigned-array":221}],257:[function(e,t,r){const{utils:n}=e("../../../utils"),{WebGLKernelValueDynamicUnsignedInput:i}=e("../../web-gl/kernel-value/dynamic-unsigned-input");t.exports={WebGL2KernelValueDynamicUnsignedInput:class extends i{getSource(){const e=this.getVariablePrecisionString();return n.linesToString([`uniform ${e} sampler2D ${this.id}`,`uniform ${e} ivec2 ${this.sizeId}`,`uniform ${e} ivec3 ${this.dimensionsId}`])}}}},{"../../../utils":279,"../../web-gl/kernel-value/dynamic-unsigned-input":222}],258:[function(e,t,r){const{utils:n}=e("../../../utils"),{WebGLKernelValueFloat:i}=e("../../web-gl/kernel-value/float");t.exports={WebGL2KernelValueFloat:class extends i{}}},{"../../../utils":279,"../../web-gl/kernel-value/float":223}],259:[function(e,t,r){const{utils:n}=e("../../../utils"),{WebGLKernelArray:i}=e("../../web-gl/kernel-value/array");t.exports={WebGL2KernelValueHTMLImageArray:class extends i{constructor(e,t){super(e,t),this.checkSize(e[0].width,e[0].height),this.dimensions=[e[0].width,e[0].height,e.length],this.textureSize=[e[0].width,e[0].height]}defineTexture(){const{context:e}=this;e.activeTexture(this.contextHandle),e.bindTexture(e.TEXTURE_2D_ARRAY,this.texture),e.texParameteri(e.TEXTURE_2D_ARRAY,e.TEXTURE_MAG_FILTER,e.NEAREST),e.texParameteri(e.TEXTURE_2D_ARRAY,e.TEXTURE_MIN_FILTER,e.NEAREST)}getStringValueHandler(){return`const uploadValue_${this.name} = ${this.varName};\n`}getSource(){const e=this.getVariablePrecisionString();return n.linesToString([`uniform ${e} sampler2DArray ${this.id}`,`${e} ivec2 ${this.sizeId} = ivec2(${this.textureSize[0]}, ${this.textureSize[1]})`,`${e} ivec3 ${this.dimensionsId} = ivec3(${this.dimensions[0]}, ${this.dimensions[1]}, ${this.dimensions[2]})`])}updateValue(e){const{context:t}=this;t.activeTexture(this.contextHandle),t.bindTexture(t.TEXTURE_2D_ARRAY,this.texture),t.pixelStorei(t.UNPACK_FLIP_Y_WEBGL,!0),t.texImage3D(t.TEXTURE_2D_ARRAY,0,t.RGBA,e[0].width,e[0].height,e.length,0,t.RGBA,t.UNSIGNED_BYTE,null);for(let r=0;re.isSupported)}static get isKernelMapSupported(){return h.some(e=>e.isSupported&&e.features.kernelMap)}static get isOffscreenCanvasSupported(){return"undefined"!=typeof Worker&&"undefined"!=typeof OffscreenCanvas||"undefined"!=typeof importScripts}static get isWebGLSupported(){return l.isSupported}static get isWebGL2Supported(){return u.isSupported}static get isHeadlessGLSupported(){return a.isSupported}static get isCanvasSupported(){return"undefined"!=typeof HTMLCanvasElement}static get isGPUHTMLImageArraySupported(){return u.isSupported}static get isSinglePrecisionSupported(){return h.some(e=>e.isSupported&&e.features.isFloatRead&&e.features.isTextureFloat)}constructor(e){if(e=e||{},this.canvas=e.canvas||null,this.context=e.context||null,this.mode=e.mode,this.Kernel=null,this.kernels=[],this.functions=[],this.nativeFunctions=[],this.injectedNative=null,"dev"!==this.mode){if(this.chooseKernel(),e.functions)for(let t=0;tt.argumentTypes[e]));const l=Object.assign({context:this.context,canvas:this.canvas,functions:this.functions,nativeFunctions:this.nativeFunctions,injectedNative:this.injectedNative,gpu:this,validate:d,onRequestFallback:u,onRequestSwitchKernel:function t(n,i,o){o.debug&&console.warn("Switching kernels");let a=null;if(o.signature&&!s[o.signature]&&(s[o.signature]=o),o.dynamicOutput)for(let e=n.length-1;e>=0;e--){const t=n[e];"outputPrecisionMismatch"===t.type&&(a=t.needed)}const l=o.constructor,c=l.getArgumentTypes(o,i),h=l.getSignature(o,c),f=s[h];if(f)return f.onActivate(o),f;const m=s[h]=new l(e,{argumentTypes:c,constantTypes:o.constantTypes,graphical:o.graphical,loopMaxIterations:o.loopMaxIterations,constants:o.constants,dynamicOutput:o.dynamicOutput,dynamicArgument:o.dynamicArguments,context:o.context,canvas:o.canvas,output:a||o.output,precision:o.precision,pipeline:o.pipeline,immutable:o.immutable,optimizeFloatMemory:o.optimizeFloatMemory,fixIntegerDivisionAccuracy:o.fixIntegerDivisionAccuracy,functions:o.functions,nativeFunctions:o.nativeFunctions,injectedNative:o.injectedNative,subKernels:o.subKernels,strictIntegers:o.strictIntegers,debug:o.debug,gpu:o.gpu,validate:d,returnType:o.returnType,tactic:o.tactic,onRequestFallback:u,onRequestSwitchKernel:t,texture:o.texture,mappedTextures:o.mappedTextures,drawBuffersMap:o.drawBuffersMap});return m.build.apply(m,i),p.replaceKernel(m),r.push(m),m}},a),h=new this.Kernel(e,l),p=c(h);return this.canvas||(this.canvas=h.canvas),this.context||(this.context=h.context),r.push(h),p}createKernelMap(){let e,t;const r=typeof arguments[arguments.length-2];if("function"===r||"string"===r?(e=arguments[arguments.length-2],t=arguments[arguments.length-1]):e=arguments[arguments.length-1],"dev"!==this.mode&&(!this.Kernel.isSupported||!this.Kernel.features.kernelMap)&&this.mode&&p.indexOf(this.mode)<0)throw new Error(`kernelMap not supported on ${this.Kernel.name}`);const n=m(t);if(t&&"object"==typeof t.argumentTypes&&(n.argumentTypes=Object.keys(t.argumentTypes).map(e=>t.argumentTypes[e])),Array.isArray(arguments[0])){n.subKernels=[];const e=arguments[0];for(let t=0;t0)throw new Error('Cannot call "addNativeFunction" after "createKernels" has been called.');return this.nativeFunctions.push(Object.assign({name:e,source:t},r)),this}injectNative(e){return this.injectedNative=e,this}destroy(){return new Promise((e,t)=>{this.kernels||e(),setTimeout(()=>{try{for(let e=0;et.kernel[i]),t.__defineSetter__(i,e=>{t.kernel[i]=e})))}t.kernel=e}t.exports={kernelRunShortcut:function(e){let t=function(){return e.build.apply(e,arguments),(t=function(){let t=e.run.apply(e,arguments);if(e.switchingKernels){const n=e.resetSwitchingKernels(),i=e.onRequestSwitchKernel(n,arguments,e);r.kernel=e=i,t=i.run.apply(i,arguments)}return e.renderKernels?e.renderKernels():e.renderOutput?e.renderOutput():t}).apply(e,arguments)};const r=function(){return t.apply(e,arguments)};return r.exec=function(){return new Promise((e,r)=>{try{e(t.apply(this,arguments))}catch(e){r(e)}})},r.replaceKernel=function(t){i(e=t,r)},i(e,r),r}}},{"./utils":279}],277:[function(e,t,r){const n={name:"math-random-uniformly-distributed",onBeforeRun:e=>{e.setUniform1f("randomSeed1",Math.random()),e.setUniform1f("randomSeed2",Math.random())},functionMatch:"Math.random()",functionReplace:"nrand(vTexCoord)",functionReturnType:"Number",source:"// https://www.shadertoy.com/view/4t2SDh\n//note: uniformly distributed, normalized rand, [0,1]\nhighp float randomSeedShift = 1.0;\nhighp float slide = 1.0;\nuniform highp float randomSeed1;\nuniform highp float randomSeed2;\n\nhighp float nrand(highp vec2 n) {\n highp float result = fract(sin(dot((n.xy + 1.0) * vec2(randomSeed1 * slide, randomSeed2 * randomSeedShift), vec2(12.9898, 78.233))) * 43758.5453);\n randomSeedShift = result;\n if (randomSeedShift > 0.5) {\n slide += 0.00009; \n } else {\n slide += 0.0009;\n }\n return result;\n}"};t.exports=n},{}],278:[function(e,t,r){t.exports={Texture:class{constructor(e){const{texture:t,size:r,dimensions:n,output:i,context:s,type:o="NumberTexture",kernel:a,internalFormat:u,textureFormat:l}=e;if(!i)throw new Error('settings property "output" required.');if(!s)throw new Error('settings property "context" required.');if(!t)throw new Error('settings property "texture" required.');if(!a)throw new Error('settings property "kernel" required.');this.texture=t,t._refs?t._refs++:t._refs=1,this.size=r,this.dimensions=n,this.output=i,this.context=s,this.kernel=a,this.type=o,this._deleted=!1,this.internalFormat=u,this.textureFormat=l}toArray(){throw new Error(`Not implemented on ${this.constructor.name}`)}clone(){throw new Error(`Not implemented on ${this.constructor.name}`)}delete(){throw new Error(`Not implemented on ${this.constructor.name}`)}clear(){throw new Error(`Not implemented on ${this.constructor.name}`)}}}},{}],279:[function(e,t,r){const n=e("acorn"),{Input:i}=e("./input"),{Texture:s}=e("./texture"),o=/function ([^(]*)/,a=/((\/\/.*$)|(\/\*[\s\S]*?\*\/))/gm,u=/([^\s,]+)/g,l={systemEndianness:()=>f,getSystemEndianness(){const e=new ArrayBuffer(4),t=new Uint32Array(e),r=new Uint8Array(e);if(t[0]=3735928559,239===r[0])return"LE";if(222===r[0])return"BE";throw new Error("unknown endianness")},isFunction:e=>"function"==typeof e,isFunctionString:e=>"string"==typeof e&&"function"===e.slice(0,"function".length).toLowerCase(),getFunctionNameFromString(e){const t=o.exec(e);return t&&0!==t.length?t[1].trim():null},getFunctionBodyFromString:e=>e.substring(e.indexOf("{")+1,e.lastIndexOf("}")),getArgumentNamesFromString(e){const t=e.replace(a,"");let r=t.slice(t.indexOf("(")+1,t.indexOf(")")).match(u);return null===r&&(r=[]),r},clone(e){if(null===e||"object"!=typeof e||e.hasOwnProperty("isActiveClone"))return e;const t=e.constructor();for(let r in e)Object.prototype.hasOwnProperty.call(e,r)&&(e.isActiveClone=null,t[r]=l.clone(e[r]),delete e.isActiveClone);return t},isArray:e=>!isNaN(e.length),getVariableType(e,t){if(l.isArray(e))return e.length>0&&"IMG"===e[0].nodeName?"HTMLImageArray":"Array";switch(e.constructor){case Boolean:return"Boolean";case Number:return t&&Number.isInteger(e)?"Integer":"Float";case s:return e.type;case i:return"Input";case OffscreenCanvas:return"OffscreenCanvas";case ImageBitmap:return"ImageBitmap";case ImageData:return"ImageData"}switch(e.nodeName){case"IMG":case"CANVAS":return"HTMLImage";case"VIDEO":return"HTMLVideo"}return e.hasOwnProperty("type")?e.type:"Unknown"},getKernelTextureSize(e,t){let[r,n,i]=t,s=(r||1)*(n||1)*(i||1);return e.optimizeFloatMemory&&"single"===e.precision&&(r=s=Math.ceil(s/4)),n>1&&r*n===s?new Int32Array([r,n]):l.closestSquareDimensions(s)},closestSquareDimensions(e){const t=Math.sqrt(e);let r=Math.ceil(t),n=Math.floor(t);for(;r*nMath.floor((e+t-1)/t)*t,getDimensions(e,t){let r;if(l.isArray(e)){const t=[];let n=e;for(;l.isArray(n);)t.push(n.length),n=n[0];r=t.reverse()}else if(e instanceof s)r=e.output;else{if(!(e instanceof i))throw new Error(`Unknown dimensions of ${e}`);r=e.size}if(t)for(r=Array.from(r);r.length<3;)r.push(1);return new Int32Array(r)},flatten2dArrayTo(e,t){let r=0;for(let n=0;ne.length>0?e.join(";\n")+";\n":"\n",warnDeprecated(e,t,r){r?console.warn(`You are using a deprecated ${e} "${t}". It has been replaced with "${r}". Fixing, but please upgrade as it will soon be removed.`):console.warn(`You are using a deprecated ${e} "${t}". It has been removed. Fixing, but please upgrade as it will soon be removed.`)},flipPixels:(e,t,r)=>{const n=r/2|0,i=4*t,s=new Uint8ClampedArray(4*t),o=e.slice(0);for(let e=0;ee.subarray(0,t),erect2DPackedFloat:(e,t,r)=>{const n=new Array(r);for(let i=0;i{const i=new Array(n);for(let s=0;se.subarray(0,t),erectMemoryOptimized2DFloat:(e,t,r)=>{const n=new Array(r);for(let i=0;i{const i=new Array(n);for(let s=0;s{const r=new Float32Array(t);let n=0;for(let i=0;i{const n=new Array(r);let i=0;for(let s=0;s{const i=new Array(n);let s=0;for(let o=0;o{const r=new Array(t),n=4*t;let i=0;for(let t=0;t{const n=new Array(r),i=4*t;for(let s=0;s{const i=4*t,s=new Array(n);for(let o=0;o{const r=new Array(t),n=4*t;let i=0;for(let t=0;t{const n=4*t,i=new Array(r);for(let s=0;s{const i=4*t,s=new Array(n);for(let o=0;o{const r=new Array(e),n=4*t;let i=0;for(let t=0;t{const n=4*t,i=new Array(r);for(let s=0;s{const i=4*t,s=new Array(n);for(let o=0;o{const{findDependency:r,thisLookup:i,doNotDefine:s}=t;let o=t.flattened;o||(o=t.flattened={});const a=[];let u=0;const c=function e(t){if(Array.isArray(t)){const r=[];for(let n=0;nnull!==e);return n.length<1?"":`${t.kind} ${n.join(",")}`;case"VariableDeclarator":return t.init.object&&"ThisExpression"===t.init.object.type?i(t.init.property.name,!0)?`${t.id.name} = ${e(t.init)}`:null:`${t.id.name} = ${e(t.init)}`;case"CallExpression":if("subarray"===t.callee.property.name)return`${e(t.callee.object)}.${e(t.callee.property)}(${t.arguments.map(t=>e(t)).join(", ")})`;if("gl"===t.callee.object.name||"context"===t.callee.object.name)return`${e(t.callee.object)}.${e(t.callee.property)}(${t.arguments.map(t=>e(t)).join(", ")})`;if("ThisExpression"===t.callee.object.type)return a.push(r("this",t.callee.property.name)),`${t.callee.property.name}(${t.arguments.map(t=>e(t)).join(", ")})`;if(t.callee.object.name){const n=r(t.callee.object.name,t.callee.property.name);return null===n?`${t.callee.object.name}.${t.callee.property.name}(${t.arguments.map(t=>e(t)).join(", ")})`:(a.push(n),`${t.callee.property.name}(${t.arguments.map(t=>e(t)).join(", ")})`)}if("MemberExpression"===t.callee.object.type)return`${e(t.callee.object)}.${t.callee.property.name}(${t.arguments.map(t=>e(t)).join(", ")})`;throw new Error("unknown ast.callee");case"ReturnStatement":return`return ${e(t.argument)}`;case"BinaryExpression":return`(${e(t.left)}${t.operator}${e(t.right)})`;case"UnaryExpression":return t.prefix?`${t.operator} ${e(t.argument)}`:`${e(t.argument)} ${t.operator}`;case"ExpressionStatement":return`${e(t.expression)}`;case"SequenceExpression":return`(${e(t.expressions)})`;case"ArrowFunctionExpression":return`(${t.params.map(e).join(", ")}) => ${e(t.body)}`;case"Literal":return t.raw;case"Identifier":return t.name;case"MemberExpression":return"ThisExpression"===t.object.type?i(t.property.name):t.computed?`${e(t.object)}[${e(t.property)}]`:e(t.object)+"."+e(t.property);case"ThisExpression":return"this";case"NewExpression":return`new ${e(t.callee)}(${t.arguments.map(t=>e(t)).join(", ")})`;case"ForStatement":return`for (${e(t.init)};${e(t.test)};${e(t.update)}) ${e(t.body)}`;case"AssignmentExpression":return`${e(t.left)}${t.operator}${e(t.right)}`;case"UpdateExpression":return`${e(t.argument)}${t.operator}`;case"IfStatement":return`if (${e(t.test)}) ${e(t.consequent)}`;case"ThrowStatement":return`throw ${e(t.argument)}`;case"ObjectPattern":return t.properties.map(e).join(", ");case"ArrayPattern":return t.elements.map(e).join(", ");case"DebuggerStatement":return"debugger;";case"ConditionalExpression":return`${e(t.test)}?${e(t.consequent)}:${e(t.alternate)}`;case"Property":if("init"===t.kind)return e(t.key)}throw new Error(`unhandled ast.type of ${t.type}`)}(n.parse(e));if(a.length>0){const e=[];for(let r=0;r{if("VariableDeclaration"!==e.type)throw new Error('Ast is not of type "VariableDeclaration"');const t=[];for(let r=0;r{const r=e.createKernel(function(e){return 255*e[this.thread.y][this.thread.x].r},{output:[t.width,t.height],precision:"unsigned",argumentTypes:{a:"HTMLImage"}}),n=e.createKernel(function(e){return 255*e[this.thread.y][this.thread.x].g},{output:[t.width,t.height],precision:"unsigned",argumentTypes:{a:"HTMLImage"}}),i=e.createKernel(function(e){return 255*e[this.thread.y][this.thread.x].b},{output:[t.width,t.height],precision:"unsigned",argumentTypes:{a:"HTMLImage"}}),s=e.createKernel(function(e){return 255*e[this.thread.y][this.thread.x].a},{output:[t.width,t.height],precision:"unsigned",argumentTypes:{a:"HTMLImage"}}),o=[r(t),n(t),i(t),s(t)];return o.rKernel=r,o.gKernel=n,o.bKernel=i,o.aKernel=s,o.gpu=e,o},splitRGBAToCanvases:(e,t,r,n)=>{const i=e.createKernel(function(e){const t=e[this.thread.y][this.thread.x];this.color(t.r/255,0,0,255)},{output:[r,n],graphical:!0,argumentTypes:{v:"Array2D(4)"}});i(t);const s=e.createKernel(function(e){const t=e[this.thread.y][this.thread.x];this.color(0,t.g/255,0,255)},{output:[r,n],graphical:!0,argumentTypes:{v:"Array2D(4)"}});s(t);const o=e.createKernel(function(e){const t=e[this.thread.y][this.thread.x];this.color(0,0,t.b/255,255)},{output:[r,n],graphical:!0,argumentTypes:{v:"Array2D(4)"}});o(t);const a=e.createKernel(function(e){const t=e[this.thread.y][this.thread.x];this.color(255,255,255,t.a/255)},{output:[r,n],graphical:!0,argumentTypes:{v:"Array2D(4)"}});return a(t),[i.canvas,s.canvas,o.canvas,a.canvas]},getMinifySafeName:e=>{try{const t=n.parse(`const value = ${e.toString()}`),{init:r}=t.body[0].declarations[0];return r.body.name||r.body.body[0].argument.name}catch(e){throw new Error("Unrecognized function type. Please use `() => yourFunctionVariableHere` or function() { return yourFunctionVariableHere; }")}},sanitizeName:function(e){return c.test(e)&&(e=e.replace(c,"S_S")),h.test(e)?e=e.replace(h,"U_U"):p.test(e)&&(e=e.replace(p,"u_u")),e}},c=/\$/,h=/__/,p=/_/,f=l.getSystemEndianness();t.exports={utils:l}},{"./input":275,"./texture":278,acorn:23}],280:[function(e,t,r){"use strict";t.exports=function(e){if(null===e||"object"!=typeof e)return e;if(e instanceof Object)var t={__proto__:n(e)};else var t=Object.create(null);return Object.getOwnPropertyNames(e).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(e,r))}),t};var n=Object.getPrototypeOf||function(e){return e.__proto__}},{}],281:[function(e,t,r){(function(r,n){var i,s,o=e("fs"),a=e("./polyfills.js"),u=e("./legacy-streams.js"),l=e("./clone.js"),c=e("util");function h(e,t){Object.defineProperty(e,i,{get:function(){return t}})}"function"==typeof Symbol&&"function"==typeof Symbol.for?(i=Symbol.for("graceful-fs.queue"),s=Symbol.for("graceful-fs.previous")):(i="___graceful-fs.queue",s="___graceful-fs.previous");var p,f=function(){};if(c.debuglog?f=c.debuglog("gfs4"):/\bgfs4\b/i.test(r.env.NODE_DEBUG||"")&&(f=function(){var e=c.format.apply(c,arguments);e="GFS4: "+e.split(/\n/).join("\nGFS4: "),console.error(e)}),!o[i]){var d=n[i]||[];h(o,d),o.close=function(e){function t(t,r){return e.call(o,t,function(e){e||v(),"function"==typeof r&&r.apply(this,arguments)})}return Object.defineProperty(t,s,{value:e}),t}(o.close),o.closeSync=function(e){function t(t){e.apply(o,arguments),v()}return Object.defineProperty(t,s,{value:e}),t}(o.closeSync),/\bgfs4\b/i.test(r.env.NODE_DEBUG||"")&&r.on("exit",function(){f(o[i]),e("assert").equal(o[i].length,0)})}function m(e){a(e),e.gracefulify=m,e.createReadStream=function(t,r){return new e.ReadStream(t,r)},e.createWriteStream=function(t,r){return new e.WriteStream(t,r)};var t=e.readFile;e.readFile=function(e,r,n){"function"==typeof r&&(n=r,r=null);return function e(r,n,i,s){return t(r,n,function(t){!t||"EMFILE"!==t.code&&"ENFILE"!==t.code?"function"==typeof i&&i.apply(this,arguments):g([e,[r,n,i],t,s||Date.now(),Date.now()])})}(e,r,n)};var n=e.writeFile;e.writeFile=function(e,t,r,i){"function"==typeof r&&(i=r,r=null);return function e(t,r,i,s,o){return n(t,r,i,function(n){!n||"EMFILE"!==n.code&&"ENFILE"!==n.code?"function"==typeof s&&s.apply(this,arguments):g([e,[t,r,i,s],n,o||Date.now(),Date.now()])})}(e,t,r,i)};var i=e.appendFile;i&&(e.appendFile=function(e,t,r,n){"function"==typeof r&&(n=r,r=null);return function e(t,r,n,s,o){return i(t,r,n,function(i){!i||"EMFILE"!==i.code&&"ENFILE"!==i.code?"function"==typeof s&&s.apply(this,arguments):g([e,[t,r,n,s],i,o||Date.now(),Date.now()])})}(e,t,r,n)});var s=e.copyFile;s&&(e.copyFile=function(e,t,r,n){"function"==typeof r&&(n=r,r=0);return function e(t,r,n,i,o){return s(t,r,n,function(s){!s||"EMFILE"!==s.code&&"ENFILE"!==s.code?"function"==typeof i&&i.apply(this,arguments):g([e,[t,r,n,i],s,o||Date.now(),Date.now()])})}(e,t,r,n)});var o=e.readdir;if(e.readdir=function(e,t,r){"function"==typeof t&&(r=t,t=null);return function e(t,r,n,i){return o(t,r,function(s,o){!s||"EMFILE"!==s.code&&"ENFILE"!==s.code?(o&&o.sort&&o.sort(),"function"==typeof n&&n.call(this,s,o)):g([e,[t,r,n],s,i||Date.now(),Date.now()])})}(e,t,r)},"v0.8"===r.version.substr(0,4)){var l=u(e);d=l.ReadStream,v=l.WriteStream}var c=e.ReadStream;c&&(d.prototype=Object.create(c.prototype),d.prototype.open=function(){var e=this;_(e.path,e.flags,e.mode,function(t,r){t?(e.autoClose&&e.destroy(),e.emit("error",t)):(e.fd=r,e.emit("open",r),e.read())})});var h=e.WriteStream;h&&(v.prototype=Object.create(h.prototype),v.prototype.open=function(){var e=this;_(e.path,e.flags,e.mode,function(t,r){t?(e.destroy(),e.emit("error",t)):(e.fd=r,e.emit("open",r))})}),Object.defineProperty(e,"ReadStream",{get:function(){return d},set:function(e){d=e},enumerable:!0,configurable:!0}),Object.defineProperty(e,"WriteStream",{get:function(){return v},set:function(e){v=e},enumerable:!0,configurable:!0});var p=d;Object.defineProperty(e,"FileReadStream",{get:function(){return p},set:function(e){p=e},enumerable:!0,configurable:!0});var f=v;function d(e,t){return this instanceof d?(c.apply(this,arguments),this):d.apply(Object.create(d.prototype),arguments)}function v(e,t){return this instanceof v?(h.apply(this,arguments),this):v.apply(Object.create(v.prototype),arguments)}Object.defineProperty(e,"FileWriteStream",{get:function(){return f},set:function(e){f=e},enumerable:!0,configurable:!0});var y=e.open;function _(e,t,r,n){return"function"==typeof r&&(n=r,r=null),function e(t,r,n,i,s){return y(t,r,n,function(o,a){!o||"EMFILE"!==o.code&&"ENFILE"!==o.code?"function"==typeof i&&i.apply(this,arguments):g([e,[t,r,n,i],o,s||Date.now(),Date.now()])})}(e,t,r,n)}return e.open=_,e}function g(e){f("ENQUEUE",e[0].name,e[1]),o[i].push(e),y()}function v(){for(var e=Date.now(),t=0;t2&&(o[i][t][3]=e,o[i][t][4]=e);y()}function y(){if(clearTimeout(p),p=void 0,0!==o[i].length){var e=o[i].shift(),t=e[0],r=e[1],n=e[2],s=e[3],a=e[4];if(void 0===s)f("RETRY",t.name,r),t.apply(null,r);else if(Date.now()-s>=6e4){f("TIMEOUT",t.name,r);var u=r.pop();"function"==typeof u&&u.call(null,n)}else{var l=Date.now()-a,c=Math.max(a-s,1);l>=Math.min(1.2*c,100)?(f("RETRY",t.name,r),t.apply(null,r.concat([s]))):o[i].push(e)}void 0===p&&(p=setTimeout(y,0))}}n[i]||h(n,o[i]),t.exports=m(l(o)),r.env.TEST_GRACEFUL_FS_GLOBAL_PATCH&&!o.__patched&&(t.exports=m(o),o.__patched=!0)}).call(this,e("_process"),"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"./clone.js":280,"./legacy-streams.js":282,"./polyfills.js":283,_process:452,assert:284,fs:290,util:538}],282:[function(e,t,r){(function(r){var n=e("stream").Stream;t.exports=function(e){return{ReadStream:function t(i,s){if(!(this instanceof t))return new t(i,s);n.call(this);var o=this;this.path=i;this.fd=null;this.readable=!0;this.paused=!1;this.flags="r";this.mode=438;this.bufferSize=65536;s=s||{};var a=Object.keys(s);for(var u=0,l=a.length;uthis.end)throw new Error("start must be <= end");this.pos=this.start}if(null!==this.fd)return void r.nextTick(function(){o._read()});e.open(this.path,this.flags,this.mode,function(e,t){if(e)return o.emit("error",e),void(o.readable=!1);o.fd=t,o.emit("open",t),o._read()})},WriteStream:function t(r,i){if(!(this instanceof t))return new t(r,i);n.call(this);this.path=r;this.fd=null;this.writable=!0;this.flags="w";this.encoding="binary";this.mode=438;this.bytesWritten=0;i=i||{};var s=Object.keys(i);for(var o=0,a=s.length;o= zero");this.pos=this.start}this.busy=!1;this._queue=[];null===this.fd&&(this._open=e.open,this._queue.push([this._open,this.path,this.flags,this.mode,void 0]),this.flush())}}}}).call(this,e("_process"))},{_process:452,stream:518}],283:[function(e,t,r){(function(r){var n=e("constants"),i=r.cwd,s=null,o=r.env.GRACEFUL_FS_PLATFORM||r.platform;r.cwd=function(){return s||(s=i.call(r)),s};try{r.cwd()}catch(e){}if("function"==typeof r.chdir){var a=r.chdir;r.chdir=function(e){s=null,a.call(r,e)},Object.setPrototypeOf&&Object.setPrototypeOf(r.chdir,a)}t.exports=function(e){n.hasOwnProperty("O_SYMLINK")&&r.version.match(/^v0\.6\.[0-2]|^v0\.5\./)&&function(e){e.lchmod=function(t,r,i){e.open(t,n.O_WRONLY|n.O_SYMLINK,r,function(t,n){t?i&&i(t):e.fchmod(n,r,function(t){e.close(n,function(e){i&&i(t||e)})})})},e.lchmodSync=function(t,r){var i,s=e.openSync(t,n.O_WRONLY|n.O_SYMLINK,r),o=!0;try{i=e.fchmodSync(s,r),o=!1}finally{if(o)try{e.closeSync(s)}catch(e){}else e.closeSync(s)}return i}}(e);e.lutimes||function(e){n.hasOwnProperty("O_SYMLINK")?(e.lutimes=function(t,r,i,s){e.open(t,n.O_SYMLINK,function(t,n){t?s&&s(t):e.futimes(n,r,i,function(t){e.close(n,function(e){s&&s(t||e)})})})},e.lutimesSync=function(t,r,i){var s,o=e.openSync(t,n.O_SYMLINK),a=!0;try{s=e.futimesSync(o,r,i),a=!1}finally{if(a)try{e.closeSync(o)}catch(e){}else e.closeSync(o)}return s}):(e.lutimes=function(e,t,n,i){i&&r.nextTick(i)},e.lutimesSync=function(){})}(e);e.chown=a(e.chown),e.fchown=a(e.fchown),e.lchown=a(e.lchown),e.chmod=i(e.chmod),e.fchmod=i(e.fchmod),e.lchmod=i(e.lchmod),e.chownSync=u(e.chownSync),e.fchownSync=u(e.fchownSync),e.lchownSync=u(e.lchownSync),e.chmodSync=s(e.chmodSync),e.fchmodSync=s(e.fchmodSync),e.lchmodSync=s(e.lchmodSync),e.stat=l(e.stat),e.fstat=l(e.fstat),e.lstat=l(e.lstat),e.statSync=c(e.statSync),e.fstatSync=c(e.fstatSync),e.lstatSync=c(e.lstatSync),e.lchmod||(e.lchmod=function(e,t,n){n&&r.nextTick(n)},e.lchmodSync=function(){});e.lchown||(e.lchown=function(e,t,n,i){i&&r.nextTick(i)},e.lchownSync=function(){});"win32"===o&&(e.rename=(t=e.rename,function(r,n,i){var s=Date.now(),o=0;t(r,n,function a(u){if(u&&("EACCES"===u.code||"EPERM"===u.code)&&Date.now()-s<6e4)return setTimeout(function(){e.stat(n,function(e,s){e&&"ENOENT"===e.code?t(r,n,a):i(u)})},o),void(o<100&&(o+=10));i&&i(u)})}));var t;function i(t){return t?function(r,n,i){return t.call(e,r,n,function(e){h(e)&&(e=null),i&&i.apply(this,arguments)})}:t}function s(t){return t?function(r,n){try{return t.call(e,r,n)}catch(e){if(!h(e))throw e}}:t}function a(t){return t?function(r,n,i,s){return t.call(e,r,n,i,function(e){h(e)&&(e=null),s&&s.apply(this,arguments)})}:t}function u(t){return t?function(r,n,i){try{return t.call(e,r,n,i)}catch(e){if(!h(e))throw e}}:t}function l(t){return t?function(r,n,i){function s(e,t){t&&(t.uid<0&&(t.uid+=4294967296),t.gid<0&&(t.gid+=4294967296)),i&&i.apply(this,arguments)}return"function"==typeof n&&(i=n,n=null),n?t.call(e,r,n,s):t.call(e,r,s)}:t}function c(t){return t?function(r,n){var i=n?t.call(e,r,n):t.call(e,r);return i&&(i.uid<0&&(i.uid+=4294967296),i.gid<0&&(i.gid+=4294967296)),i}:t}function h(e){if(!e)return!0;if("ENOSYS"===e.code)return!0;var t=!r.getuid||0!==r.getuid();return!(!t||"EINVAL"!==e.code&&"EPERM"!==e.code)}e.read=function(t){function r(r,n,i,s,o,a){var u;if(a&&"function"==typeof a){var l=0;u=function(c,h,p){if(c&&"EAGAIN"===c.code&&l<10)return l++,t.call(e,r,n,i,s,o,u);a.apply(this,arguments)}}return t.call(e,r,n,i,s,o,u)}return Object.setPrototypeOf&&Object.setPrototypeOf(r,t),r}(e.read),e.readSync=(p=e.readSync,function(t,r,n,i,s){for(var o=0;;)try{return p.call(e,t,r,n,i,s)}catch(e){if("EAGAIN"===e.code&&o<10){o++;continue}throw e}});var p}}).call(this,e("_process"))},{_process:452,constants:39}],284:[function(e,t,r){(function(r){"use strict";function n(e,t){if(e===t)return 0;for(var r=e.length,n=t.length,i=0,s=Math.min(r,n);i=0;l--)if(c[l]!==h[l])return!1;for(l=c.length-1;l>=0;l--)if(u=c[l],!y(e[u],t[u],r,n))return!1;return!0}(e,t,r,o))}return r?e===t:e==t}function _(e){return"[object Arguments]"==Object.prototype.toString.call(e)}function b(e,t){if(!e||!t)return!1;if("[object RegExp]"==Object.prototype.toString.call(t))return t.test(e);try{if(e instanceof t)return!0}catch(e){}return!Error.isPrototypeOf(t)&&!0===t.call({},e)}function x(e,t,r,n){var i;if("function"!=typeof t)throw new TypeError('"block" argument must be a function');"string"==typeof r&&(n=r,r=null),i=function(e){var t;try{e()}catch(e){t=e}return t}(t),n=(r&&r.name?" ("+r.name+").":".")+(n?" "+n:"."),e&&!i&&g(i,r,"Missing expected exception"+n);var o="string"==typeof n,a=!e&&s.isError(i),u=!e&&i&&!r;if((a&&o&&b(i,r)||u)&&g(i,r,"Got unwanted exception"+n),e&&i&&r&&!b(i,r)||!e&&i)throw i}h.AssertionError=function(e){var t;this.name="AssertionError",this.actual=e.actual,this.expected=e.expected,this.operator=e.operator,e.message?(this.message=e.message,this.generatedMessage=!1):(this.message=d(m((t=this).actual),128)+" "+t.operator+" "+d(m(t.expected),128),this.generatedMessage=!0);var r=e.stackStartFunction||g;if(Error.captureStackTrace)Error.captureStackTrace(this,r);else{var n=new Error;if(n.stack){var i=n.stack,s=f(r),o=i.indexOf("\n"+s);if(o>=0){var a=i.indexOf("\n",o+1);i=i.substring(a+1)}this.stack=i}}},s.inherits(h.AssertionError,Error),h.fail=g,h.ok=v,h.equal=function(e,t,r){e!=t&&g(e,t,r,"==",h.equal)},h.notEqual=function(e,t,r){e==t&&g(e,t,r,"!=",h.notEqual)},h.deepEqual=function(e,t,r){y(e,t,!1)||g(e,t,r,"deepEqual",h.deepEqual)},h.deepStrictEqual=function(e,t,r){y(e,t,!0)||g(e,t,r,"deepStrictEqual",h.deepStrictEqual)},h.notDeepEqual=function(e,t,r){y(e,t,!1)&&g(e,t,r,"notDeepEqual",h.notDeepEqual)},h.notDeepStrictEqual=function e(t,r,n){y(t,r,!0)&&g(t,r,n,"notDeepStrictEqual",e)},h.strictEqual=function(e,t,r){e!==t&&g(e,t,r,"===",h.strictEqual)},h.notStrictEqual=function(e,t,r){e===t&&g(e,t,r,"!==",h.notStrictEqual)},h.throws=function(e,t,r){x(!0,e,t,r)},h.doesNotThrow=function(e,t,r){x(!1,e,t,r)},h.ifError=function(e){if(e)throw e};var w=Object.keys||function(e){var t=[];for(var r in e)o.call(e,r)&&t.push(r);return t}}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"util/":287}],285:[function(e,t,r){"function"==typeof Object.create?t.exports=function(e,t){e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}})}:t.exports=function(e,t){e.super_=t;var r=function(){};r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e}},{}],286:[function(e,t,r){t.exports=function(e){return e&&"object"==typeof e&&"function"==typeof e.copy&&"function"==typeof e.fill&&"function"==typeof e.readUInt8}},{}],287:[function(e,t,r){(function(t,n){var i=/%[sdj%]/g;r.format=function(e){if(!v(e)){for(var t=[],r=0;r=s)return e;switch(e){case"%s":return String(n[r++]);case"%d":return Number(n[r++]);case"%j":try{return JSON.stringify(n[r++])}catch(e){return"[Circular]"}default:return e}}),u=n[r];r=3&&(n.depth=arguments[2]),arguments.length>=4&&(n.colors=arguments[3]),d(t)?n.showHidden=t:t&&r._extend(n,t),y(n.showHidden)&&(n.showHidden=!1),y(n.depth)&&(n.depth=2),y(n.colors)&&(n.colors=!1),y(n.customInspect)&&(n.customInspect=!0),n.colors&&(n.stylize=u),c(n,e,n.depth)}function u(e,t){var r=a.styles[t];return r?"["+a.colors[r][0]+"m"+e+"["+a.colors[r][1]+"m":e}function l(e,t){return e}function c(e,t,n){if(e.customInspect&&t&&E(t.inspect)&&t.inspect!==r.inspect&&(!t.constructor||t.constructor.prototype!==t)){var i=t.inspect(n,e);return v(i)||(i=c(e,i,n)),i}var s=function(e,t){if(y(t))return e.stylize("undefined","undefined");if(v(t)){var r="'"+JSON.stringify(t).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return e.stylize(r,"string")}if(g(t))return e.stylize(""+t,"number");if(d(t))return e.stylize(""+t,"boolean");if(m(t))return e.stylize("null","null")}(e,t);if(s)return s;var o=Object.keys(t),a=function(e){var t={};return e.forEach(function(e,r){t[e]=!0}),t}(o);if(e.showHidden&&(o=Object.getOwnPropertyNames(t)),w(t)&&(o.indexOf("message")>=0||o.indexOf("description")>=0))return h(t);if(0===o.length){if(E(t)){var u=t.name?": "+t.name:"";return e.stylize("[Function"+u+"]","special")}if(_(t))return e.stylize(RegExp.prototype.toString.call(t),"regexp");if(x(t))return e.stylize(Date.prototype.toString.call(t),"date");if(w(t))return h(t)}var l,b="",T=!1,A=["{","}"];(f(t)&&(T=!0,A=["[","]"]),E(t))&&(b=" [Function"+(t.name?": "+t.name:"")+"]");return _(t)&&(b=" "+RegExp.prototype.toString.call(t)),x(t)&&(b=" "+Date.prototype.toUTCString.call(t)),w(t)&&(b=" "+h(t)),0!==o.length||T&&0!=t.length?n<0?_(t)?e.stylize(RegExp.prototype.toString.call(t),"regexp"):e.stylize("[Object]","special"):(e.seen.push(t),l=T?function(e,t,r,n,i){for(var s=[],o=0,a=t.length;o=0&&0,e+t.replace(/\u001b\[\d\d?m/g,"").length+1},0)>60)return r[0]+(""===t?"":t+"\n ")+" "+e.join(",\n ")+" "+r[1];return r[0]+t+" "+e.join(", ")+" "+r[1]}(l,b,A)):A[0]+b+A[1]}function h(e){return"["+Error.prototype.toString.call(e)+"]"}function p(e,t,r,n,i,s){var o,a,u;if((u=Object.getOwnPropertyDescriptor(t,i)||{value:t[i]}).get?a=u.set?e.stylize("[Getter/Setter]","special"):e.stylize("[Getter]","special"):u.set&&(a=e.stylize("[Setter]","special")),k(n,i)||(o="["+i+"]"),a||(e.seen.indexOf(u.value)<0?(a=m(r)?c(e,u.value,null):c(e,u.value,r-1)).indexOf("\n")>-1&&(a=s?a.split("\n").map(function(e){return" "+e}).join("\n").substr(2):"\n"+a.split("\n").map(function(e){return" "+e}).join("\n")):a=e.stylize("[Circular]","special")),y(o)){if(s&&i.match(/^\d+$/))return a;(o=JSON.stringify(""+i)).match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(o=o.substr(1,o.length-2),o=e.stylize(o,"name")):(o=o.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),o=e.stylize(o,"string"))}return o+": "+a}function f(e){return Array.isArray(e)}function d(e){return"boolean"==typeof e}function m(e){return null===e}function g(e){return"number"==typeof e}function v(e){return"string"==typeof e}function y(e){return void 0===e}function _(e){return b(e)&&"[object RegExp]"===T(e)}function b(e){return"object"==typeof e&&null!==e}function x(e){return b(e)&&"[object Date]"===T(e)}function w(e){return b(e)&&("[object Error]"===T(e)||e instanceof Error)}function E(e){return"function"==typeof e}function T(e){return Object.prototype.toString.call(e)}function A(e){return e<10?"0"+e.toString(10):e.toString(10)}r.debuglog=function(e){if(y(s)&&(s=t.env.NODE_DEBUG||""),e=e.toUpperCase(),!o[e])if(new RegExp("\\b"+e+"\\b","i").test(s)){var n=t.pid;o[e]=function(){var t=r.format.apply(r,arguments);console.error("%s %d: %s",e,n,t)}}else o[e]=function(){};return o[e]},r.inspect=a,a.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]},a.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"},r.isArray=f,r.isBoolean=d,r.isNull=m,r.isNullOrUndefined=function(e){return null==e},r.isNumber=g,r.isString=v,r.isSymbol=function(e){return"symbol"==typeof e},r.isUndefined=y,r.isRegExp=_,r.isObject=b,r.isDate=x,r.isError=w,r.isFunction=E,r.isPrimitive=function(e){return null===e||"boolean"==typeof e||"number"==typeof e||"string"==typeof e||"symbol"==typeof e||void 0===e},r.isBuffer=e("./support/isBuffer");var S=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function k(e,t){return Object.prototype.hasOwnProperty.call(e,t)}r.log=function(){var e,t;console.log("%s - %s",(e=new Date,t=[A(e.getHours()),A(e.getMinutes()),A(e.getSeconds())].join(":"),[e.getDate(),S[e.getMonth()],t].join(" ")),r.format.apply(r,arguments))},r.inherits=e("inherits"),r._extend=function(e,t){if(!t||!b(t))return e;for(var r=Object.keys(t),n=r.length;n--;)e[r[n]]=t[r[n]];return e}}).call(this,e("_process"),"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"./support/isBuffer":286,_process:452,inherits:285}],288:[function(e,t,r){(function(t,n){"use strict";var i=e("assert"),s=e("pako/lib/zlib/zstream"),o=e("pako/lib/zlib/deflate.js"),a=e("pako/lib/zlib/inflate.js"),u=e("pako/lib/zlib/constants");for(var l in u)r[l]=u[l];r.NONE=0,r.DEFLATE=1,r.INFLATE=2,r.GZIP=3,r.GUNZIP=4,r.DEFLATERAW=5,r.INFLATERAW=6,r.UNZIP=7;function c(e){if("number"!=typeof e||er.UNZIP)throw new TypeError("Bad argument");this.dictionary=null,this.err=0,this.flush=0,this.init_done=!1,this.level=0,this.memLevel=0,this.mode=e,this.strategy=0,this.windowBits=0,this.write_in_progress=!1,this.pending_close=!1,this.gzip_id_bytes_read=0}c.prototype.close=function(){this.write_in_progress?this.pending_close=!0:(this.pending_close=!1,i(this.init_done,"close before init"),i(this.mode<=r.UNZIP),this.mode===r.DEFLATE||this.mode===r.GZIP||this.mode===r.DEFLATERAW?o.deflateEnd(this.strm):this.mode!==r.INFLATE&&this.mode!==r.GUNZIP&&this.mode!==r.INFLATERAW&&this.mode!==r.UNZIP||a.inflateEnd(this.strm),this.mode=r.NONE,this.dictionary=null)},c.prototype.write=function(e,t,r,n,i,s,o){return this._write(!0,e,t,r,n,i,s,o)},c.prototype.writeSync=function(e,t,r,n,i,s,o){return this._write(!1,e,t,r,n,i,s,o)},c.prototype._write=function(e,s,o,a,u,l,c,h){if(i.equal(arguments.length,8),i(this.init_done,"write before init"),i(this.mode!==r.NONE,"already finalized"),i.equal(!1,this.write_in_progress,"write already in progress"),i.equal(!1,this.pending_close,"close is pending"),this.write_in_progress=!0,i.equal(!1,void 0===s,"must provide flush value"),this.write_in_progress=!0,s!==r.Z_NO_FLUSH&&s!==r.Z_PARTIAL_FLUSH&&s!==r.Z_SYNC_FLUSH&&s!==r.Z_FULL_FLUSH&&s!==r.Z_FINISH&&s!==r.Z_BLOCK)throw new Error("Invalid flush value");if(null==o&&(o=n.alloc(0),u=0,a=0),this.strm.avail_in=u,this.strm.input=o,this.strm.next_in=a,this.strm.avail_out=h,this.strm.output=l,this.strm.next_out=c,this.flush=s,!e)return this._process(),this._checkError()?this._afterSync():void 0;var p=this;return t.nextTick(function(){p._process(),p._after()}),this},c.prototype._afterSync=function(){var e=this.strm.avail_out,t=this.strm.avail_in;return this.write_in_progress=!1,[t,e]},c.prototype._process=function(){var e=null;switch(this.mode){case r.DEFLATE:case r.GZIP:case r.DEFLATERAW:this.err=o.deflate(this.strm,this.flush);break;case r.UNZIP:switch(this.strm.avail_in>0&&(e=this.strm.next_in),this.gzip_id_bytes_read){case 0:if(null===e)break;if(31!==this.strm.input[e]){this.mode=r.INFLATE;break}if(this.gzip_id_bytes_read=1,e++,1===this.strm.avail_in)break;case 1:if(null===e)break;139===this.strm.input[e]?(this.gzip_id_bytes_read=2,this.mode=r.GUNZIP):this.mode=r.INFLATE;break;default:throw new Error("invalid number of gzip magic number bytes read")}case r.INFLATE:case r.GUNZIP:case r.INFLATERAW:for(this.err=a.inflate(this.strm,this.flush),this.err===r.Z_NEED_DICT&&this.dictionary&&(this.err=a.inflateSetDictionary(this.strm,this.dictionary),this.err===r.Z_OK?this.err=a.inflate(this.strm,this.flush):this.err===r.Z_DATA_ERROR&&(this.err=r.Z_NEED_DICT));this.strm.avail_in>0&&this.mode===r.GUNZIP&&this.err===r.Z_STREAM_END&&0!==this.strm.next_in[0];)this.reset(),this.err=a.inflate(this.strm,this.flush);break;default:throw new Error("Unknown mode "+this.mode)}},c.prototype._checkError=function(){switch(this.err){case r.Z_OK:case r.Z_BUF_ERROR:if(0!==this.strm.avail_out&&this.flush===r.Z_FINISH)return this._error("unexpected end of file"),!1;break;case r.Z_STREAM_END:break;case r.Z_NEED_DICT:return null==this.dictionary?this._error("Missing dictionary"):this._error("Bad dictionary"),!1;default:return this._error("Zlib error"),!1}return!0},c.prototype._after=function(){if(this._checkError()){var e=this.strm.avail_out,t=this.strm.avail_in;this.write_in_progress=!1,this.callback(t,e),this.pending_close&&this.close()}},c.prototype._error=function(e){this.strm.msg&&(e=this.strm.msg),this.onerror(e,this.err),this.write_in_progress=!1,this.pending_close&&this.close()},c.prototype.init=function(e,t,n,s,o){i(4===arguments.length||5===arguments.length,"init(windowBits, level, memLevel, strategy, [dictionary])"),i(e>=8&&e<=15,"invalid windowBits"),i(t>=-1&&t<=9,"invalid compression level"),i(n>=1&&n<=9,"invalid memlevel"),i(s===r.Z_FILTERED||s===r.Z_HUFFMAN_ONLY||s===r.Z_RLE||s===r.Z_FIXED||s===r.Z_DEFAULT_STRATEGY,"invalid strategy"),this._init(t,e,n,s,o),this._setDictionary()},c.prototype.params=function(){throw new Error("deflateParams Not supported")},c.prototype.reset=function(){this._reset(),this._setDictionary()},c.prototype._init=function(e,t,n,i,u){switch(this.level=e,this.windowBits=t,this.memLevel=n,this.strategy=i,this.flush=r.Z_NO_FLUSH,this.err=r.Z_OK,this.mode!==r.GZIP&&this.mode!==r.GUNZIP||(this.windowBits+=16),this.mode===r.UNZIP&&(this.windowBits+=32),this.mode!==r.DEFLATERAW&&this.mode!==r.INFLATERAW||(this.windowBits=-1*this.windowBits),this.strm=new s,this.mode){case r.DEFLATE:case r.GZIP:case r.DEFLATERAW:this.err=o.deflateInit2(this.strm,this.level,r.Z_DEFLATED,this.windowBits,this.memLevel,this.strategy);break;case r.INFLATE:case r.GUNZIP:case r.INFLATERAW:case r.UNZIP:this.err=a.inflateInit2(this.strm,this.windowBits);break;default:throw new Error("Unknown mode "+this.mode)}this.err!==r.Z_OK&&this._error("Init error"),this.dictionary=u,this.write_in_progress=!1,this.init_done=!0},c.prototype._setDictionary=function(){if(null!=this.dictionary){switch(this.err=r.Z_OK,this.mode){case r.DEFLATE:case r.DEFLATERAW:this.err=o.deflateSetDictionary(this.strm,this.dictionary)}this.err!==r.Z_OK&&this._error("Failed to set dictionary")}},c.prototype._reset=function(){switch(this.err=r.Z_OK,this.mode){case r.DEFLATE:case r.DEFLATERAW:case r.GZIP:this.err=o.deflateReset(this.strm);break;case r.INFLATE:case r.INFLATERAW:case r.GUNZIP:this.err=a.inflateReset(this.strm)}this.err!==r.Z_OK&&this._error("Failed to reset stream")},r.Zlib=c}).call(this,e("_process"),e("buffer").Buffer)},{_process:452,assert:284,buffer:291,"pako/lib/zlib/constants":296,"pako/lib/zlib/deflate.js":298,"pako/lib/zlib/inflate.js":300,"pako/lib/zlib/zstream":304}],289:[function(e,t,r){(function(t){"use strict";var n=e("buffer").Buffer,i=e("stream").Transform,s=e("./binding"),o=e("util"),a=e("assert").ok,u=e("buffer").kMaxLength,l="Cannot create final Buffer. It would be larger than 0x"+u.toString(16)+" bytes";s.Z_MIN_WINDOWBITS=8,s.Z_MAX_WINDOWBITS=15,s.Z_DEFAULT_WINDOWBITS=15,s.Z_MIN_CHUNK=64,s.Z_MAX_CHUNK=1/0,s.Z_DEFAULT_CHUNK=16384,s.Z_MIN_MEMLEVEL=1,s.Z_MAX_MEMLEVEL=9,s.Z_DEFAULT_MEMLEVEL=8,s.Z_MIN_LEVEL=-1,s.Z_MAX_LEVEL=9,s.Z_DEFAULT_LEVEL=s.Z_DEFAULT_COMPRESSION;for(var c=Object.keys(s),h=0;h=u?o=new RangeError(l):t=n.concat(i,s),i=[],e.close(),r(o,t)}e.on("error",function(t){e.removeListener("end",a),e.removeListener("readable",o),r(t)}),e.on("end",a),e.end(t),o()}function y(e,t){if("string"==typeof t&&(t=n.from(t)),!n.isBuffer(t))throw new TypeError("Not a string or buffer");var r=e._finishFlushFlag;return e._processChunk(t,r)}function _(e){if(!(this instanceof _))return new _(e);k.call(this,e,s.DEFLATE)}function b(e){if(!(this instanceof b))return new b(e);k.call(this,e,s.INFLATE)}function x(e){if(!(this instanceof x))return new x(e);k.call(this,e,s.GZIP)}function w(e){if(!(this instanceof w))return new w(e);k.call(this,e,s.GUNZIP)}function E(e){if(!(this instanceof E))return new E(e);k.call(this,e,s.DEFLATERAW)}function T(e){if(!(this instanceof T))return new T(e);k.call(this,e,s.INFLATERAW)}function A(e){if(!(this instanceof A))return new A(e);k.call(this,e,s.UNZIP)}function S(e){return e===s.Z_NO_FLUSH||e===s.Z_PARTIAL_FLUSH||e===s.Z_SYNC_FLUSH||e===s.Z_FULL_FLUSH||e===s.Z_FINISH||e===s.Z_BLOCK}function k(e,t){var o=this;if(this._opts=e=e||{},this._chunkSize=e.chunkSize||r.Z_DEFAULT_CHUNK,i.call(this,e),e.flush&&!S(e.flush))throw new Error("Invalid flush flag: "+e.flush);if(e.finishFlush&&!S(e.finishFlush))throw new Error("Invalid flush flag: "+e.finishFlush);if(this._flushFlag=e.flush||s.Z_NO_FLUSH,this._finishFlushFlag=void 0!==e.finishFlush?e.finishFlush:s.Z_FINISH,e.chunkSize&&(e.chunkSizer.Z_MAX_CHUNK))throw new Error("Invalid chunk size: "+e.chunkSize);if(e.windowBits&&(e.windowBitsr.Z_MAX_WINDOWBITS))throw new Error("Invalid windowBits: "+e.windowBits);if(e.level&&(e.levelr.Z_MAX_LEVEL))throw new Error("Invalid compression level: "+e.level);if(e.memLevel&&(e.memLevelr.Z_MAX_MEMLEVEL))throw new Error("Invalid memLevel: "+e.memLevel);if(e.strategy&&e.strategy!=r.Z_FILTERED&&e.strategy!=r.Z_HUFFMAN_ONLY&&e.strategy!=r.Z_RLE&&e.strategy!=r.Z_FIXED&&e.strategy!=r.Z_DEFAULT_STRATEGY)throw new Error("Invalid strategy: "+e.strategy);if(e.dictionary&&!n.isBuffer(e.dictionary))throw new Error("Invalid dictionary: it should be a Buffer instance");this._handle=new s.Zlib(t);var a=this;this._hadError=!1,this._handle.onerror=function(e,t){C(a),a._hadError=!0;var n=new Error(e);n.errno=t,n.code=r.codes[t],a.emit("error",n)};var u=r.Z_DEFAULT_COMPRESSION;"number"==typeof e.level&&(u=e.level);var l=r.Z_DEFAULT_STRATEGY;"number"==typeof e.strategy&&(l=e.strategy),this._handle.init(e.windowBits||r.Z_DEFAULT_WINDOWBITS,u,e.memLevel||r.Z_DEFAULT_MEMLEVEL,l,e.dictionary),this._buffer=n.allocUnsafe(this._chunkSize),this._offset=0,this._level=u,this._strategy=l,this.once("end",this.close),Object.defineProperty(this,"_closed",{get:function(){return!o._handle},configurable:!0,enumerable:!0})}function C(e,r){r&&t.nextTick(r),e._handle&&(e._handle.close(),e._handle=null)}function I(e){e.emit("close")}Object.defineProperty(r,"codes",{enumerable:!0,value:Object.freeze(f),writable:!1}),r.Deflate=_,r.Inflate=b,r.Gzip=x,r.Gunzip=w,r.DeflateRaw=E,r.InflateRaw=T,r.Unzip=A,r.createDeflate=function(e){return new _(e)},r.createInflate=function(e){return new b(e)},r.createDeflateRaw=function(e){return new E(e)},r.createInflateRaw=function(e){return new T(e)},r.createGzip=function(e){return new x(e)},r.createGunzip=function(e){return new w(e)},r.createUnzip=function(e){return new A(e)},r.deflate=function(e,t,r){return"function"==typeof t&&(r=t,t={}),v(new _(t),e,r)},r.deflateSync=function(e,t){return y(new _(t),e)},r.gzip=function(e,t,r){return"function"==typeof t&&(r=t,t={}),v(new x(t),e,r)},r.gzipSync=function(e,t){return y(new x(t),e)},r.deflateRaw=function(e,t,r){return"function"==typeof t&&(r=t,t={}),v(new E(t),e,r)},r.deflateRawSync=function(e,t){return y(new E(t),e)},r.unzip=function(e,t,r){return"function"==typeof t&&(r=t,t={}),v(new A(t),e,r)},r.unzipSync=function(e,t){return y(new A(t),e)},r.inflate=function(e,t,r){return"function"==typeof t&&(r=t,t={}),v(new b(t),e,r)},r.inflateSync=function(e,t){return y(new b(t),e)},r.gunzip=function(e,t,r){return"function"==typeof t&&(r=t,t={}),v(new w(t),e,r)},r.gunzipSync=function(e,t){return y(new w(t),e)},r.inflateRaw=function(e,t,r){return"function"==typeof t&&(r=t,t={}),v(new T(t),e,r)},r.inflateRawSync=function(e,t){return y(new T(t),e)},o.inherits(k,i),k.prototype.params=function(e,n,i){if(er.Z_MAX_LEVEL)throw new RangeError("Invalid compression level: "+e);if(n!=r.Z_FILTERED&&n!=r.Z_HUFFMAN_ONLY&&n!=r.Z_RLE&&n!=r.Z_FIXED&&n!=r.Z_DEFAULT_STRATEGY)throw new TypeError("Invalid strategy: "+n);if(this._level!==e||this._strategy!==n){var o=this;this.flush(s.Z_SYNC_FLUSH,function(){a(o._handle,"zlib binding closed"),o._handle.params(e,n),o._hadError||(o._level=e,o._strategy=n,i&&i())})}else t.nextTick(i)},k.prototype.reset=function(){return a(this._handle,"zlib binding closed"),this._handle.reset()},k.prototype._flush=function(e){this._transform(n.alloc(0),"",e)},k.prototype.flush=function(e,r){var i=this,o=this._writableState;("function"==typeof e||void 0===e&&!r)&&(r=e,e=s.Z_FULL_FLUSH),o.ended?r&&t.nextTick(r):o.ending?r&&this.once("end",r):o.needDrain?r&&this.once("drain",function(){return i.flush(e,r)}):(this._flushFlag=e,this.write(n.alloc(0),"",r))},k.prototype.close=function(e){C(this,e),t.nextTick(I,this)},k.prototype._transform=function(e,t,r){var i,o=this._writableState,a=(o.ending||o.ended)&&(!e||o.length===e.length);return null===e||n.isBuffer(e)?this._handle?(a?i=this._finishFlushFlag:(i=this._flushFlag,e.length>=o.length&&(this._flushFlag=this._opts.flush||s.Z_NO_FLUSH)),void this._processChunk(e,i,r)):r(new Error("zlib binding closed")):r(new Error("invalid input"))},k.prototype._processChunk=function(e,t,r){var i=e&&e.length,s=this._chunkSize-this._offset,o=0,c=this,h="function"==typeof r;if(!h){var p,f=[],d=0;this.on("error",function(e){p=e}),a(this._handle,"zlib binding closed");do{var m=this._handle.writeSync(t,e,o,i,this._buffer,this._offset,s)}while(!this._hadError&&y(m[0],m[1]));if(this._hadError)throw p;if(d>=u)throw C(this),new RangeError(l);var g=n.concat(f,d);return C(this),g}a(this._handle,"zlib binding closed");var v=this._handle.write(t,e,o,i,this._buffer,this._offset,s);function y(u,l){if(this&&(this.buffer=null,this.callback=null),!c._hadError){var p=s-l;if(a(p>=0,"have should not go down"),p>0){var m=c._buffer.slice(c._offset,c._offset+p);c._offset+=p,h?c.push(m):(f.push(m),d+=m.length)}if((0===l||c._offset>=c._chunkSize)&&(s=c._chunkSize,c._offset=0,c._buffer=n.allocUnsafe(c._chunkSize)),0===l){if(o+=i-u,i=u,!h)return!0;var g=c._handle.write(t,e,o,i,c._buffer,c._offset,c._chunkSize);return g.callback=y,void(g.buffer=e)}if(!h)return!1;r()}}v.buffer=e,v.callback=y},o.inherits(_,k),o.inherits(b,k),o.inherits(x,k),o.inherits(w,k),o.inherits(E,k),o.inherits(T,k),o.inherits(A,k)}).call(this,e("_process"))},{"./binding":288,_process:452,assert:284,buffer:291,stream:518,util:538}],290:[function(e,t,r){arguments[4][35][0].apply(r,arguments)},{dup:35}],291:[function(e,t,r){"use strict";var n=e("base64-js"),i=e("ieee754");r.Buffer=a,r.SlowBuffer=function(e){+e!=e&&(e=0);return a.alloc(+e)},r.INSPECT_MAX_BYTES=50;var s=2147483647;function o(e){if(e>s)throw new RangeError("Invalid typed array length");var t=new Uint8Array(e);return t.__proto__=a.prototype,t}function a(e,t,r){if("number"==typeof e){if("string"==typeof t)throw new Error("If encoding is specified then the first argument must be a string");return c(e)}return u(e,t,r)}function u(e,t,r){if("number"==typeof e)throw new TypeError('"value" argument must not be a number');return U(e)?function(e,t,r){if(t<0||e.byteLength=s)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+s.toString(16)+" bytes");return 0|e}function f(e,t){if(a.isBuffer(e))return e.length;if($(e)||U(e))return e.byteLength;"string"!=typeof e&&(e=""+e);var r=e.length;if(0===r)return 0;for(var n=!1;;)switch(t){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":case void 0:return D(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return F(e).length;default:if(n)return D(e).length;t=(""+t).toLowerCase(),n=!0}}function d(e,t,r){var n=e[t];e[t]=e[r],e[r]=n}function m(e,t,r,n,i){if(0===e.length)return-1;if("string"==typeof r?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),V(r=+r)&&(r=i?0:e.length-1),r<0&&(r=e.length+r),r>=e.length){if(i)return-1;r=e.length-1}else if(r<0){if(!i)return-1;r=0}if("string"==typeof t&&(t=a.from(t,n)),a.isBuffer(t))return 0===t.length?-1:g(e,t,r,n,i);if("number"==typeof t)return t&=255,"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(e,t,r):Uint8Array.prototype.lastIndexOf.call(e,t,r):g(e,[t],r,n,i);throw new TypeError("val must be string, number or Buffer")}function g(e,t,r,n,i){var s,o=1,a=e.length,u=t.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(e.length<2||t.length<2)return-1;o=2,a/=2,u/=2,r/=2}function l(e,t){return 1===o?e[t]:e.readUInt16BE(t*o)}if(i){var c=-1;for(s=r;sa&&(r=a-u),s=r;s>=0;s--){for(var h=!0,p=0;pi&&(n=i):n=i;var s=t.length;if(s%2!=0)throw new TypeError("Invalid hex string");n>s/2&&(n=s/2);for(var o=0;o>8,i=r%256,s.push(i),s.push(n);return s}(t,e.length-r),e,r,n)}function E(e,t,r){return 0===t&&r===e.length?n.fromByteArray(e):n.fromByteArray(e.slice(t,r))}function T(e,t,r){r=Math.min(e.length,r);for(var n=[],i=t;i239?4:l>223?3:l>191?2:1;if(i+h<=r)switch(h){case 1:l<128&&(c=l);break;case 2:128==(192&(s=e[i+1]))&&(u=(31&l)<<6|63&s)>127&&(c=u);break;case 3:s=e[i+1],o=e[i+2],128==(192&s)&&128==(192&o)&&(u=(15&l)<<12|(63&s)<<6|63&o)>2047&&(u<55296||u>57343)&&(c=u);break;case 4:s=e[i+1],o=e[i+2],a=e[i+3],128==(192&s)&&128==(192&o)&&128==(192&a)&&(u=(15&l)<<18|(63&s)<<12|(63&o)<<6|63&a)>65535&&u<1114112&&(c=u)}null===c?(c=65533,h=1):c>65535&&(c-=65536,n.push(c>>>10&1023|55296),c=56320|1023&c),n.push(c),i+=h}return function(e){var t=e.length;if(t<=A)return String.fromCharCode.apply(String,e);var r="",n=0;for(;nthis.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if((r>>>=0)<=(t>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":return C(this,t,r);case"utf8":case"utf-8":return T(this,t,r);case"ascii":return S(this,t,r);case"latin1":case"binary":return k(this,t,r);case"base64":return E(this,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return I(this,t,r);default:if(n)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),n=!0}}.apply(this,arguments)},a.prototype.equals=function(e){if(!a.isBuffer(e))throw new TypeError("Argument must be a Buffer");return this===e||0===a.compare(this,e)},a.prototype.inspect=function(){var e="",t=r.INSPECT_MAX_BYTES;return this.length>0&&(e=this.toString("hex",0,t).match(/.{2}/g).join(" "),this.length>t&&(e+=" ... ")),""},a.prototype.compare=function(e,t,r,n,i){if(!a.isBuffer(e))throw new TypeError("Argument must be a Buffer");if(void 0===t&&(t=0),void 0===r&&(r=e?e.length:0),void 0===n&&(n=0),void 0===i&&(i=this.length),t<0||r>e.length||n<0||i>this.length)throw new RangeError("out of range index");if(n>=i&&t>=r)return 0;if(n>=i)return-1;if(t>=r)return 1;if(t>>>=0,r>>>=0,n>>>=0,i>>>=0,this===e)return 0;for(var s=i-n,o=r-t,u=Math.min(s,o),l=this.slice(n,i),c=e.slice(t,r),h=0;h>>=0,isFinite(r)?(r>>>=0,void 0===n&&(n="utf8")):(n=r,r=void 0)}var i=this.length-t;if((void 0===r||r>i)&&(r=i),e.length>0&&(r<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");for(var s=!1;;)switch(n){case"hex":return v(this,e,t,r);case"utf8":case"utf-8":return y(this,e,t,r);case"ascii":return _(this,e,t,r);case"latin1":case"binary":return b(this,e,t,r);case"base64":return x(this,e,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return w(this,e,t,r);default:if(s)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),s=!0}},a.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var A=4096;function S(e,t,r){var n="";r=Math.min(e.length,r);for(var i=t;in)&&(r=n);for(var i="",s=t;sr)throw new RangeError("Trying to access beyond buffer length")}function O(e,t,r,n,i,s){if(!a.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>i||te.length)throw new RangeError("Index out of range")}function L(e,t,r,n,i,s){if(r+n>e.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function P(e,t,r,n,s){return t=+t,r>>>=0,s||L(e,0,r,4),i.write(e,t,r,n,23,4),r+4}function M(e,t,r,n,s){return t=+t,r>>>=0,s||L(e,0,r,8),i.write(e,t,r,n,52,8),r+8}a.prototype.slice=function(e,t){var r=this.length;e=~~e,t=void 0===t?r:~~t,e<0?(e+=r)<0&&(e=0):e>r&&(e=r),t<0?(t+=r)<0&&(t=0):t>r&&(t=r),t>>=0,t>>>=0,r||R(e,t,this.length);for(var n=this[e],i=1,s=0;++s>>=0,t>>>=0,r||R(e,t,this.length);for(var n=this[e+--t],i=1;t>0&&(i*=256);)n+=this[e+--t]*i;return n},a.prototype.readUInt8=function(e,t){return e>>>=0,t||R(e,1,this.length),this[e]},a.prototype.readUInt16LE=function(e,t){return e>>>=0,t||R(e,2,this.length),this[e]|this[e+1]<<8},a.prototype.readUInt16BE=function(e,t){return e>>>=0,t||R(e,2,this.length),this[e]<<8|this[e+1]},a.prototype.readUInt32LE=function(e,t){return e>>>=0,t||R(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},a.prototype.readUInt32BE=function(e,t){return e>>>=0,t||R(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},a.prototype.readIntLE=function(e,t,r){e>>>=0,t>>>=0,r||R(e,t,this.length);for(var n=this[e],i=1,s=0;++s=(i*=128)&&(n-=Math.pow(2,8*t)),n},a.prototype.readIntBE=function(e,t,r){e>>>=0,t>>>=0,r||R(e,t,this.length);for(var n=t,i=1,s=this[e+--n];n>0&&(i*=256);)s+=this[e+--n]*i;return s>=(i*=128)&&(s-=Math.pow(2,8*t)),s},a.prototype.readInt8=function(e,t){return e>>>=0,t||R(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},a.prototype.readInt16LE=function(e,t){e>>>=0,t||R(e,2,this.length);var r=this[e]|this[e+1]<<8;return 32768&r?4294901760|r:r},a.prototype.readInt16BE=function(e,t){e>>>=0,t||R(e,2,this.length);var r=this[e+1]|this[e]<<8;return 32768&r?4294901760|r:r},a.prototype.readInt32LE=function(e,t){return e>>>=0,t||R(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},a.prototype.readInt32BE=function(e,t){return e>>>=0,t||R(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},a.prototype.readFloatLE=function(e,t){return e>>>=0,t||R(e,4,this.length),i.read(this,e,!0,23,4)},a.prototype.readFloatBE=function(e,t){return e>>>=0,t||R(e,4,this.length),i.read(this,e,!1,23,4)},a.prototype.readDoubleLE=function(e,t){return e>>>=0,t||R(e,8,this.length),i.read(this,e,!0,52,8)},a.prototype.readDoubleBE=function(e,t){return e>>>=0,t||R(e,8,this.length),i.read(this,e,!1,52,8)},a.prototype.writeUIntLE=function(e,t,r,n){(e=+e,t>>>=0,r>>>=0,n)||O(this,e,t,r,Math.pow(2,8*r)-1,0);var i=1,s=0;for(this[t]=255&e;++s>>=0,r>>>=0,n)||O(this,e,t,r,Math.pow(2,8*r)-1,0);var i=r-1,s=1;for(this[t+i]=255&e;--i>=0&&(s*=256);)this[t+i]=e/s&255;return t+r},a.prototype.writeUInt8=function(e,t,r){return e=+e,t>>>=0,r||O(this,e,t,1,255,0),this[t]=255&e,t+1},a.prototype.writeUInt16LE=function(e,t,r){return e=+e,t>>>=0,r||O(this,e,t,2,65535,0),this[t]=255&e,this[t+1]=e>>>8,t+2},a.prototype.writeUInt16BE=function(e,t,r){return e=+e,t>>>=0,r||O(this,e,t,2,65535,0),this[t]=e>>>8,this[t+1]=255&e,t+2},a.prototype.writeUInt32LE=function(e,t,r){return e=+e,t>>>=0,r||O(this,e,t,4,4294967295,0),this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e,t+4},a.prototype.writeUInt32BE=function(e,t,r){return e=+e,t>>>=0,r||O(this,e,t,4,4294967295,0),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},a.prototype.writeIntLE=function(e,t,r,n){if(e=+e,t>>>=0,!n){var i=Math.pow(2,8*r-1);O(this,e,t,r,i-1,-i)}var s=0,o=1,a=0;for(this[t]=255&e;++s>0)-a&255;return t+r},a.prototype.writeIntBE=function(e,t,r,n){if(e=+e,t>>>=0,!n){var i=Math.pow(2,8*r-1);O(this,e,t,r,i-1,-i)}var s=r-1,o=1,a=0;for(this[t+s]=255&e;--s>=0&&(o*=256);)e<0&&0===a&&0!==this[t+s+1]&&(a=1),this[t+s]=(e/o>>0)-a&255;return t+r},a.prototype.writeInt8=function(e,t,r){return e=+e,t>>>=0,r||O(this,e,t,1,127,-128),e<0&&(e=255+e+1),this[t]=255&e,t+1},a.prototype.writeInt16LE=function(e,t,r){return e=+e,t>>>=0,r||O(this,e,t,2,32767,-32768),this[t]=255&e,this[t+1]=e>>>8,t+2},a.prototype.writeInt16BE=function(e,t,r){return e=+e,t>>>=0,r||O(this,e,t,2,32767,-32768),this[t]=e>>>8,this[t+1]=255&e,t+2},a.prototype.writeInt32LE=function(e,t,r){return e=+e,t>>>=0,r||O(this,e,t,4,2147483647,-2147483648),this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24,t+4},a.prototype.writeInt32BE=function(e,t,r){return e=+e,t>>>=0,r||O(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},a.prototype.writeFloatLE=function(e,t,r){return P(this,e,t,!0,r)},a.prototype.writeFloatBE=function(e,t,r){return P(this,e,t,!1,r)},a.prototype.writeDoubleLE=function(e,t,r){return M(this,e,t,!0,r)},a.prototype.writeDoubleBE=function(e,t,r){return M(this,e,t,!1,r)},a.prototype.copy=function(e,t,r,n){if(r||(r=0),n||0===n||(n=this.length),t>=e.length&&(t=e.length),t||(t=0),n>0&&n=this.length)throw new RangeError("sourceStart out of bounds");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),e.length-t=0;--i)e[i+t]=this[i+r];else if(s<1e3)for(i=0;i>>=0,r=void 0===r?this.length:r>>>0,e||(e=0),"number"==typeof e)for(s=t;s55295&&r<57344){if(!i){if(r>56319){(t-=3)>-1&&s.push(239,191,189);continue}if(o+1===n){(t-=3)>-1&&s.push(239,191,189);continue}i=r;continue}if(r<56320){(t-=3)>-1&&s.push(239,191,189),i=r;continue}r=65536+(i-55296<<10|r-56320)}else i&&(t-=3)>-1&&s.push(239,191,189);if(i=null,r<128){if((t-=1)<0)break;s.push(r)}else if(r<2048){if((t-=2)<0)break;s.push(r>>6|192,63&r|128)}else if(r<65536){if((t-=3)<0)break;s.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;s.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return s}function F(e){return n.toByteArray(function(e){if((e=e.trim().replace(B,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function j(e,t,r,n){for(var i=0;i=t.length||i>=e.length);++i)t[i+r]=e[i];return i}function U(e){return e instanceof ArrayBuffer||null!=e&&null!=e.constructor&&"ArrayBuffer"===e.constructor.name&&"number"==typeof e.byteLength}function $(e){return"function"==typeof ArrayBuffer.isView&&ArrayBuffer.isView(e)}function V(e){return e!=e}},{"base64-js":28,ieee754:309}],292:[function(e,t,r){var n=Object.create||function(e){var t=function(){};return t.prototype=e,new t},i=Object.keys||function(e){var t=[];for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.push(r);return r},s=Function.prototype.bind||function(e){var t=this;return function(){return t.apply(e,arguments)}};function o(){this._events&&Object.prototype.hasOwnProperty.call(this,"_events")||(this._events=n(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0}t.exports=o,o.EventEmitter=o,o.prototype._events=void 0,o.prototype._maxListeners=void 0;var a,u=10;try{var l={};Object.defineProperty&&Object.defineProperty(l,"x",{value:0}),a=0===l.x}catch(e){a=!1}function c(e){return void 0===e._maxListeners?o.defaultMaxListeners:e._maxListeners}function h(e,t,r,i){var s,o,a;if("function"!=typeof r)throw new TypeError('"listener" argument must be a function');if((o=e._events)?(o.newListener&&(e.emit("newListener",t,r.listener?r.listener:r),o=e._events),a=o[t]):(o=e._events=n(null),e._eventsCount=0),a){if("function"==typeof a?a=o[t]=i?[r,a]:[a,r]:i?a.unshift(r):a.push(r),!a.warned&&(s=c(e))&&s>0&&a.length>s){a.warned=!0;var u=new Error("Possible EventEmitter memory leak detected. "+a.length+' "'+String(t)+'" listeners added. Use emitter.setMaxListeners() to increase limit.');u.name="MaxListenersExceededWarning",u.emitter=e,u.type=t,u.count=a.length,"object"==typeof console&&console.warn&&console.warn("%s: %s",u.name,u.message)}}else a=o[t]=r,++e._eventsCount;return e}function p(){if(!this.fired)switch(this.target.removeListener(this.type,this.wrapFn),this.fired=!0,arguments.length){case 0:return this.listener.call(this.target);case 1:return this.listener.call(this.target,arguments[0]);case 2:return this.listener.call(this.target,arguments[0],arguments[1]);case 3:return this.listener.call(this.target,arguments[0],arguments[1],arguments[2]);default:for(var e=new Array(arguments.length),t=0;t1&&(t=arguments[1]),t instanceof Error)throw t;var u=new Error('Unhandled "error" event. ('+t+")");throw u.context=t,u}if(!(r=o[e]))return!1;var l="function"==typeof r;switch(n=arguments.length){case 1:!function(e,t,r){if(t)e.call(r);else for(var n=e.length,i=g(e,n),s=0;s=0;o--)if(r[o]===t||r[o].listener===t){a=r[o].listener,s=o;break}if(s<0)return this;0===s?r.shift():function(e,t){for(var r=t,n=r+1,i=e.length;n=0;s--)this.removeListener(e,t[s]);return this},o.prototype.listeners=function(e){return d(this,e,!0)},o.prototype.rawListeners=function(e){return d(this,e,!1)},o.listenerCount=function(e,t){return"function"==typeof e.listenerCount?e.listenerCount(t):m.call(e,t)},o.prototype.listenerCount=m,o.prototype.eventNames=function(){return this._eventsCount>0?Reflect.ownKeys(this._events):[]}},{}],293:[function(e,t,r){r.endianness=function(){return"LE"},r.hostname=function(){return"undefined"!=typeof location?location.hostname:""},r.loadavg=function(){return[]},r.uptime=function(){return 0},r.freemem=function(){return Number.MAX_VALUE},r.totalmem=function(){return Number.MAX_VALUE},r.cpus=function(){return[]},r.type=function(){return"Browser"},r.release=function(){return"undefined"!=typeof navigator?navigator.appVersion:""},r.networkInterfaces=r.getNetworkInterfaces=function(){return{}},r.arch=function(){return"javascript"},r.platform=function(){return"browser"},r.tmpdir=r.tmpDir=function(){return"/tmp"},r.EOL="\n",r.homedir=function(){return"/"}},{}],294:[function(e,t,r){"use strict";var n="undefined"!=typeof Uint8Array&&"undefined"!=typeof Uint16Array&&"undefined"!=typeof Int32Array;function i(e,t){return Object.prototype.hasOwnProperty.call(e,t)}r.assign=function(e){for(var t=Array.prototype.slice.call(arguments,1);t.length;){var r=t.shift();if(r){if("object"!=typeof r)throw new TypeError(r+"must be non-object");for(var n in r)i(r,n)&&(e[n]=r[n])}}return e},r.shrinkBuf=function(e,t){return e.length===t?e:e.subarray?e.subarray(0,t):(e.length=t,e)};var s={arraySet:function(e,t,r,n,i){if(t.subarray&&e.subarray)e.set(t.subarray(r,r+n),i);else for(var s=0;s>>16&65535|0,o=0;0!==r;){r-=o=r>2e3?2e3:r;do{s=s+(i=i+t[n++]|0)|0}while(--o);i%=65521,s%=65521}return i|s<<16|0}},{}],296:[function(e,t,r){"use strict";t.exports={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8}},{}],297:[function(e,t,r){"use strict";var n=function(){for(var e,t=[],r=0;r<256;r++){e=r;for(var n=0;n<8;n++)e=1&e?3988292384^e>>>1:e>>>1;t[r]=e}return t}();t.exports=function(e,t,r,i){var s=n,o=i+r;e^=-1;for(var a=i;a>>8^s[255&(e^t[a])];return-1^e}},{}],298:[function(e,t,r){"use strict";var n,i=e("../utils/common"),s=e("./trees"),o=e("./adler32"),a=e("./crc32"),u=e("./messages"),l=0,c=1,h=3,p=4,f=5,d=0,m=1,g=-2,v=-3,y=-5,_=-1,b=1,x=2,w=3,E=4,T=0,A=2,S=8,k=9,C=15,I=8,R=286,O=30,L=19,P=2*R+1,M=15,B=3,N=258,D=N+B+1,F=32,j=42,U=69,$=73,V=91,G=103,z=113,W=666,H=1,K=2,q=3,X=4,Y=3;function Z(e,t){return e.msg=u[t],t}function J(e){return(e<<1)-(e>4?9:0)}function Q(e){for(var t=e.length;--t>=0;)e[t]=0}function ee(e){var t=e.state,r=t.pending;r>e.avail_out&&(r=e.avail_out),0!==r&&(i.arraySet(e.output,t.pending_buf,t.pending_out,r,e.next_out),e.next_out+=r,t.pending_out+=r,e.total_out+=r,e.avail_out-=r,t.pending-=r,0===t.pending&&(t.pending_out=0))}function te(e,t){s._tr_flush_block(e,e.block_start>=0?e.block_start:-1,e.strstart-e.block_start,t),e.block_start=e.strstart,ee(e.strm)}function re(e,t){e.pending_buf[e.pending++]=t}function ne(e,t){e.pending_buf[e.pending++]=t>>>8&255,e.pending_buf[e.pending++]=255&t}function ie(e,t){var r,n,i=e.max_chain_length,s=e.strstart,o=e.prev_length,a=e.nice_match,u=e.strstart>e.w_size-D?e.strstart-(e.w_size-D):0,l=e.window,c=e.w_mask,h=e.prev,p=e.strstart+N,f=l[s+o-1],d=l[s+o];e.prev_length>=e.good_match&&(i>>=2),a>e.lookahead&&(a=e.lookahead);do{if(l[(r=t)+o]===d&&l[r+o-1]===f&&l[r]===l[s]&&l[++r]===l[s+1]){s+=2,r++;do{}while(l[++s]===l[++r]&&l[++s]===l[++r]&&l[++s]===l[++r]&&l[++s]===l[++r]&&l[++s]===l[++r]&&l[++s]===l[++r]&&l[++s]===l[++r]&&l[++s]===l[++r]&&so){if(e.match_start=t,o=n,n>=a)break;f=l[s+o-1],d=l[s+o]}}}while((t=h[t&c])>u&&0!=--i);return o<=e.lookahead?o:e.lookahead}function se(e){var t,r,n,s,u,l,c,h,p,f,d=e.w_size;do{if(s=e.window_size-e.lookahead-e.strstart,e.strstart>=d+(d-D)){i.arraySet(e.window,e.window,d,d,0),e.match_start-=d,e.strstart-=d,e.block_start-=d,t=r=e.hash_size;do{n=e.head[--t],e.head[t]=n>=d?n-d:0}while(--r);t=r=d;do{n=e.prev[--t],e.prev[t]=n>=d?n-d:0}while(--r);s+=d}if(0===e.strm.avail_in)break;if(l=e.strm,c=e.window,h=e.strstart+e.lookahead,p=s,f=void 0,(f=l.avail_in)>p&&(f=p),r=0===f?0:(l.avail_in-=f,i.arraySet(c,l.input,l.next_in,f,h),1===l.state.wrap?l.adler=o(l.adler,c,f,h):2===l.state.wrap&&(l.adler=a(l.adler,c,f,h)),l.next_in+=f,l.total_in+=f,f),e.lookahead+=r,e.lookahead+e.insert>=B)for(u=e.strstart-e.insert,e.ins_h=e.window[u],e.ins_h=(e.ins_h<=B&&(e.ins_h=(e.ins_h<=B)if(n=s._tr_tally(e,e.strstart-e.match_start,e.match_length-B),e.lookahead-=e.match_length,e.match_length<=e.max_lazy_match&&e.lookahead>=B){e.match_length--;do{e.strstart++,e.ins_h=(e.ins_h<=B&&(e.ins_h=(e.ins_h<4096)&&(e.match_length=B-1)),e.prev_length>=B&&e.match_length<=e.prev_length){i=e.strstart+e.lookahead-B,n=s._tr_tally(e,e.strstart-1-e.prev_match,e.prev_length-B),e.lookahead-=e.prev_length-1,e.prev_length-=2;do{++e.strstart<=i&&(e.ins_h=(e.ins_h<15&&(a=2,n-=16),s<1||s>k||r!==S||n<8||n>15||t<0||t>9||o<0||o>E)return Z(e,g);8===n&&(n=9);var u=new function(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=S,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new i.Buf16(2*P),this.dyn_dtree=new i.Buf16(2*(2*O+1)),this.bl_tree=new i.Buf16(2*(2*L+1)),Q(this.dyn_ltree),Q(this.dyn_dtree),Q(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new i.Buf16(M+1),this.heap=new i.Buf16(2*R+1),Q(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new i.Buf16(2*R+1),Q(this.depth),this.l_buf=0,this.lit_bufsize=0,this.last_lit=0,this.d_buf=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0};return e.state=u,u.strm=e,u.wrap=a,u.gzhead=null,u.w_bits=n,u.w_size=1<e.pending_buf_size-5&&(r=e.pending_buf_size-5);;){if(e.lookahead<=1){if(se(e),0===e.lookahead&&t===l)return H;if(0===e.lookahead)break}e.strstart+=e.lookahead,e.lookahead=0;var n=e.block_start+r;if((0===e.strstart||e.strstart>=n)&&(e.lookahead=e.strstart-n,e.strstart=n,te(e,!1),0===e.strm.avail_out))return H;if(e.strstart-e.block_start>=e.w_size-D&&(te(e,!1),0===e.strm.avail_out))return H}return e.insert=0,t===p?(te(e,!0),0===e.strm.avail_out?q:X):(e.strstart>e.block_start&&(te(e,!1),e.strm.avail_out),H)}),new ue(4,4,8,4,oe),new ue(4,5,16,8,oe),new ue(4,6,32,32,oe),new ue(4,4,16,16,ae),new ue(8,16,32,32,ae),new ue(8,16,128,128,ae),new ue(8,32,128,256,ae),new ue(32,128,258,1024,ae),new ue(32,258,258,4096,ae)],r.deflateInit=function(e,t){return he(e,t,S,C,I,T)},r.deflateInit2=he,r.deflateReset=ce,r.deflateResetKeep=le,r.deflateSetHeader=function(e,t){return e&&e.state?2!==e.state.wrap?g:(e.state.gzhead=t,d):g},r.deflate=function(e,t){var r,i,o,u;if(!e||!e.state||t>f||t<0)return e?Z(e,g):g;if(i=e.state,!e.output||!e.input&&0!==e.avail_in||i.status===W&&t!==p)return Z(e,0===e.avail_out?y:g);if(i.strm=e,r=i.last_flush,i.last_flush=t,i.status===j)if(2===i.wrap)e.adler=0,re(i,31),re(i,139),re(i,8),i.gzhead?(re(i,(i.gzhead.text?1:0)+(i.gzhead.hcrc?2:0)+(i.gzhead.extra?4:0)+(i.gzhead.name?8:0)+(i.gzhead.comment?16:0)),re(i,255&i.gzhead.time),re(i,i.gzhead.time>>8&255),re(i,i.gzhead.time>>16&255),re(i,i.gzhead.time>>24&255),re(i,9===i.level?2:i.strategy>=x||i.level<2?4:0),re(i,255&i.gzhead.os),i.gzhead.extra&&i.gzhead.extra.length&&(re(i,255&i.gzhead.extra.length),re(i,i.gzhead.extra.length>>8&255)),i.gzhead.hcrc&&(e.adler=a(e.adler,i.pending_buf,i.pending,0)),i.gzindex=0,i.status=U):(re(i,0),re(i,0),re(i,0),re(i,0),re(i,0),re(i,9===i.level?2:i.strategy>=x||i.level<2?4:0),re(i,Y),i.status=z);else{var v=S+(i.w_bits-8<<4)<<8;v|=(i.strategy>=x||i.level<2?0:i.level<6?1:6===i.level?2:3)<<6,0!==i.strstart&&(v|=F),v+=31-v%31,i.status=z,ne(i,v),0!==i.strstart&&(ne(i,e.adler>>>16),ne(i,65535&e.adler)),e.adler=1}if(i.status===U)if(i.gzhead.extra){for(o=i.pending;i.gzindex<(65535&i.gzhead.extra.length)&&(i.pending!==i.pending_buf_size||(i.gzhead.hcrc&&i.pending>o&&(e.adler=a(e.adler,i.pending_buf,i.pending-o,o)),ee(e),o=i.pending,i.pending!==i.pending_buf_size));)re(i,255&i.gzhead.extra[i.gzindex]),i.gzindex++;i.gzhead.hcrc&&i.pending>o&&(e.adler=a(e.adler,i.pending_buf,i.pending-o,o)),i.gzindex===i.gzhead.extra.length&&(i.gzindex=0,i.status=$)}else i.status=$;if(i.status===$)if(i.gzhead.name){o=i.pending;do{if(i.pending===i.pending_buf_size&&(i.gzhead.hcrc&&i.pending>o&&(e.adler=a(e.adler,i.pending_buf,i.pending-o,o)),ee(e),o=i.pending,i.pending===i.pending_buf_size)){u=1;break}u=i.gzindexo&&(e.adler=a(e.adler,i.pending_buf,i.pending-o,o)),0===u&&(i.gzindex=0,i.status=V)}else i.status=V;if(i.status===V)if(i.gzhead.comment){o=i.pending;do{if(i.pending===i.pending_buf_size&&(i.gzhead.hcrc&&i.pending>o&&(e.adler=a(e.adler,i.pending_buf,i.pending-o,o)),ee(e),o=i.pending,i.pending===i.pending_buf_size)){u=1;break}u=i.gzindexo&&(e.adler=a(e.adler,i.pending_buf,i.pending-o,o)),0===u&&(i.status=G)}else i.status=G;if(i.status===G&&(i.gzhead.hcrc?(i.pending+2>i.pending_buf_size&&ee(e),i.pending+2<=i.pending_buf_size&&(re(i,255&e.adler),re(i,e.adler>>8&255),e.adler=0,i.status=z)):i.status=z),0!==i.pending){if(ee(e),0===e.avail_out)return i.last_flush=-1,d}else if(0===e.avail_in&&J(t)<=J(r)&&t!==p)return Z(e,y);if(i.status===W&&0!==e.avail_in)return Z(e,y);if(0!==e.avail_in||0!==i.lookahead||t!==l&&i.status!==W){var _=i.strategy===x?function(e,t){for(var r;;){if(0===e.lookahead&&(se(e),0===e.lookahead)){if(t===l)return H;break}if(e.match_length=0,r=s._tr_tally(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++,r&&(te(e,!1),0===e.strm.avail_out))return H}return e.insert=0,t===p?(te(e,!0),0===e.strm.avail_out?q:X):e.last_lit&&(te(e,!1),0===e.strm.avail_out)?H:K}(i,t):i.strategy===w?function(e,t){for(var r,n,i,o,a=e.window;;){if(e.lookahead<=N){if(se(e),e.lookahead<=N&&t===l)return H;if(0===e.lookahead)break}if(e.match_length=0,e.lookahead>=B&&e.strstart>0&&(n=a[i=e.strstart-1])===a[++i]&&n===a[++i]&&n===a[++i]){o=e.strstart+N;do{}while(n===a[++i]&&n===a[++i]&&n===a[++i]&&n===a[++i]&&n===a[++i]&&n===a[++i]&&n===a[++i]&&n===a[++i]&&ie.lookahead&&(e.match_length=e.lookahead)}if(e.match_length>=B?(r=s._tr_tally(e,1,e.match_length-B),e.lookahead-=e.match_length,e.strstart+=e.match_length,e.match_length=0):(r=s._tr_tally(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++),r&&(te(e,!1),0===e.strm.avail_out))return H}return e.insert=0,t===p?(te(e,!0),0===e.strm.avail_out?q:X):e.last_lit&&(te(e,!1),0===e.strm.avail_out)?H:K}(i,t):n[i.level].func(i,t);if(_!==q&&_!==X||(i.status=W),_===H||_===q)return 0===e.avail_out&&(i.last_flush=-1),d;if(_===K&&(t===c?s._tr_align(i):t!==f&&(s._tr_stored_block(i,0,0,!1),t===h&&(Q(i.head),0===i.lookahead&&(i.strstart=0,i.block_start=0,i.insert=0))),ee(e),0===e.avail_out))return i.last_flush=-1,d}return t!==p?d:i.wrap<=0?m:(2===i.wrap?(re(i,255&e.adler),re(i,e.adler>>8&255),re(i,e.adler>>16&255),re(i,e.adler>>24&255),re(i,255&e.total_in),re(i,e.total_in>>8&255),re(i,e.total_in>>16&255),re(i,e.total_in>>24&255)):(ne(i,e.adler>>>16),ne(i,65535&e.adler)),ee(e),i.wrap>0&&(i.wrap=-i.wrap),0!==i.pending?d:m)},r.deflateEnd=function(e){var t;return e&&e.state?(t=e.state.status)!==j&&t!==U&&t!==$&&t!==V&&t!==G&&t!==z&&t!==W?Z(e,g):(e.state=null,t===z?Z(e,v):d):g},r.deflateSetDictionary=function(e,t){var r,n,s,a,u,l,c,h,p=t.length;if(!e||!e.state)return g;if(2===(a=(r=e.state).wrap)||1===a&&r.status!==j||r.lookahead)return g;for(1===a&&(e.adler=o(e.adler,t,p,0)),r.wrap=0,p>=r.w_size&&(0===a&&(Q(r.head),r.strstart=0,r.block_start=0,r.insert=0),h=new i.Buf8(r.w_size),i.arraySet(h,t,p-r.w_size,r.w_size,0),t=h,p=r.w_size),u=e.avail_in,l=e.next_in,c=e.input,e.avail_in=p,e.next_in=0,e.input=t,se(r);r.lookahead>=B;){n=r.strstart,s=r.lookahead-(B-1);do{r.ins_h=(r.ins_h<>>=b=_>>>24,d-=b,0===(b=_>>>16&255))S[s++]=65535&_;else{if(!(16&b)){if(0==(64&b)){_=m[(65535&_)+(f&(1<>>=b,d-=b),d<15&&(f+=A[n++]<>>=b=_>>>24,d-=b,!(16&(b=_>>>16&255))){if(0==(64&b)){_=g[(65535&_)+(f&(1<u){e.msg="invalid distance too far back",r.mode=30;break e}if(f>>>=b,d-=b,w>(b=s-o)){if((b=w-b)>c&&r.sane){e.msg="invalid distance too far back",r.mode=30;break e}if(E=0,T=p,0===h){if(E+=l-b,b2;)S[s++]=T[E++],S[s++]=T[E++],S[s++]=T[E++],x-=3;x&&(S[s++]=T[E++],x>1&&(S[s++]=T[E++]))}else{E=s-w;do{S[s++]=S[E++],S[s++]=S[E++],S[s++]=S[E++],x-=3}while(x>2);x&&(S[s++]=S[E++],x>1&&(S[s++]=S[E++]))}break}}break}}while(n>3,f&=(1<<(d-=x<<3))-1,e.next_in=n,e.next_out=s,e.avail_in=n>>24&255)+(e>>>8&65280)+((65280&e)<<8)+((255&e)<<24)}function ie(e){var t;return e&&e.state?(t=e.state,e.total_in=e.total_out=t.total=0,e.msg="",t.wrap&&(e.adler=1&t.wrap),t.mode=w,t.last=0,t.havedict=0,t.dmax=32768,t.head=null,t.hold=0,t.bits=0,t.lencode=t.lendyn=new n.Buf32(ee),t.distcode=t.distdyn=new n.Buf32(te),t.sane=1,t.back=-1,d):v}function se(e){var t;return e&&e.state?((t=e.state).wsize=0,t.whave=0,t.wnext=0,ie(e)):v}function oe(e,t){var r,n;return e&&e.state?(n=e.state,t<0?(r=0,t=-t):(r=1+(t>>4),t<48&&(t&=15)),t&&(t<8||t>15)?v:(null!==n.window&&n.wbits!==t&&(n.window=null),n.wrap=r,n.wbits=t,se(e))):v}function ae(e,t){var r,i;return e?(i=new function(){this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new n.Buf16(320),this.work=new n.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0},e.state=i,i.window=null,(r=oe(e,t))!==d&&(e.state=null),r):v}var ue,le,ce=!0;function he(e){if(ce){var t;for(ue=new n.Buf32(512),le=new n.Buf32(32),t=0;t<144;)e.lens[t++]=8;for(;t<256;)e.lens[t++]=9;for(;t<280;)e.lens[t++]=7;for(;t<288;)e.lens[t++]=8;for(a(l,e.lens,0,288,ue,0,e.work,{bits:9}),t=0;t<32;)e.lens[t++]=5;a(c,e.lens,0,32,le,0,e.work,{bits:5}),ce=!1}e.lencode=ue,e.lenbits=9,e.distcode=le,e.distbits=5}function pe(e,t,r,i){var s,o=e.state;return null===o.window&&(o.wsize=1<=o.wsize?(n.arraySet(o.window,t,r-o.wsize,o.wsize,0),o.wnext=0,o.whave=o.wsize):((s=o.wsize-o.wnext)>i&&(s=i),n.arraySet(o.window,t,r-i,s,o.wnext),(i-=s)?(n.arraySet(o.window,t,r-i,i,0),o.wnext=i,o.whave=o.wsize):(o.wnext+=s,o.wnext===o.wsize&&(o.wnext=0),o.whave>>8&255,r.check=s(r.check,ke,2,0),ae=0,ue=0,r.mode=E;break}if(r.flags=0,r.head&&(r.head.done=!1),!(1&r.wrap)||(((255&ae)<<8)+(ae>>8))%31){e.msg="incorrect header check",r.mode=Z;break}if((15&ae)!==x){e.msg="unknown compression method",r.mode=Z;break}if(ue-=4,we=8+(15&(ae>>>=4)),0===r.wbits)r.wbits=we;else if(we>r.wbits){e.msg="invalid window size",r.mode=Z;break}r.dmax=1<>8&1),512&r.flags&&(ke[0]=255&ae,ke[1]=ae>>>8&255,r.check=s(r.check,ke,2,0)),ae=0,ue=0,r.mode=T;case T:for(;ue<32;){if(0===se)break e;se--,ae+=ee[re++]<>>8&255,ke[2]=ae>>>16&255,ke[3]=ae>>>24&255,r.check=s(r.check,ke,4,0)),ae=0,ue=0,r.mode=A;case A:for(;ue<16;){if(0===se)break e;se--,ae+=ee[re++]<>8),512&r.flags&&(ke[0]=255&ae,ke[1]=ae>>>8&255,r.check=s(r.check,ke,2,0)),ae=0,ue=0,r.mode=S;case S:if(1024&r.flags){for(;ue<16;){if(0===se)break e;se--,ae+=ee[re++]<>>8&255,r.check=s(r.check,ke,2,0)),ae=0,ue=0}else r.head&&(r.head.extra=null);r.mode=k;case k:if(1024&r.flags&&((fe=r.length)>se&&(fe=se),fe&&(r.head&&(we=r.head.extra_len-r.length,r.head.extra||(r.head.extra=new Array(r.head.extra_len)),n.arraySet(r.head.extra,ee,re,fe,we)),512&r.flags&&(r.check=s(r.check,ee,fe,re)),se-=fe,re+=fe,r.length-=fe),r.length))break e;r.length=0,r.mode=C;case C:if(2048&r.flags){if(0===se)break e;fe=0;do{we=ee[re+fe++],r.head&&we&&r.length<65536&&(r.head.name+=String.fromCharCode(we))}while(we&&fe>9&1,r.head.done=!0),e.adler=r.check=0,r.mode=P;break;case O:for(;ue<32;){if(0===se)break e;se--,ae+=ee[re++]<>>=7&ue,ue-=7&ue,r.mode=q;break}for(;ue<3;){if(0===se)break e;se--,ae+=ee[re++]<>>=1)){case 0:r.mode=B;break;case 1:if(he(r),r.mode=$,t===f){ae>>>=2,ue-=2;break e}break;case 2:r.mode=F;break;case 3:e.msg="invalid block type",r.mode=Z}ae>>>=2,ue-=2;break;case B:for(ae>>>=7&ue,ue-=7&ue;ue<32;){if(0===se)break e;se--,ae+=ee[re++]<>>16^65535)){e.msg="invalid stored block lengths",r.mode=Z;break}if(r.length=65535&ae,ae=0,ue=0,r.mode=N,t===f)break e;case N:r.mode=D;case D:if(fe=r.length){if(fe>se&&(fe=se),fe>oe&&(fe=oe),0===fe)break e;n.arraySet(te,ee,re,fe,ie),se-=fe,re+=fe,oe-=fe,ie+=fe,r.length-=fe;break}r.mode=P;break;case F:for(;ue<14;){if(0===se)break e;se--,ae+=ee[re++]<>>=5,ue-=5,r.ndist=1+(31&ae),ae>>>=5,ue-=5,r.ncode=4+(15&ae),ae>>>=4,ue-=4,r.nlen>286||r.ndist>30){e.msg="too many length or distance symbols",r.mode=Z;break}r.have=0,r.mode=j;case j:for(;r.have>>=3,ue-=3}for(;r.have<19;)r.lens[Ce[r.have++]]=0;if(r.lencode=r.lendyn,r.lenbits=7,Te={bits:r.lenbits},Ee=a(u,r.lens,0,19,r.lencode,0,r.work,Te),r.lenbits=Te.bits,Ee){e.msg="invalid code lengths set",r.mode=Z;break}r.have=0,r.mode=U;case U:for(;r.have>>16&255,ye=65535&Se,!((ge=Se>>>24)<=ue);){if(0===se)break e;se--,ae+=ee[re++]<>>=ge,ue-=ge,r.lens[r.have++]=ye;else{if(16===ye){for(Ae=ge+2;ue>>=ge,ue-=ge,0===r.have){e.msg="invalid bit length repeat",r.mode=Z;break}we=r.lens[r.have-1],fe=3+(3&ae),ae>>>=2,ue-=2}else if(17===ye){for(Ae=ge+3;ue>>=ge)),ae>>>=3,ue-=3}else{for(Ae=ge+7;ue>>=ge)),ae>>>=7,ue-=7}if(r.have+fe>r.nlen+r.ndist){e.msg="invalid bit length repeat",r.mode=Z;break}for(;fe--;)r.lens[r.have++]=we}}if(r.mode===Z)break;if(0===r.lens[256]){e.msg="invalid code -- missing end-of-block",r.mode=Z;break}if(r.lenbits=9,Te={bits:r.lenbits},Ee=a(l,r.lens,0,r.nlen,r.lencode,0,r.work,Te),r.lenbits=Te.bits,Ee){e.msg="invalid literal/lengths set",r.mode=Z;break}if(r.distbits=6,r.distcode=r.distdyn,Te={bits:r.distbits},Ee=a(c,r.lens,r.nlen,r.ndist,r.distcode,0,r.work,Te),r.distbits=Te.bits,Ee){e.msg="invalid distances set",r.mode=Z;break}if(r.mode=$,t===f)break e;case $:r.mode=V;case V:if(se>=6&&oe>=258){e.next_out=ie,e.avail_out=oe,e.next_in=re,e.avail_in=se,r.hold=ae,r.bits=ue,o(e,ce),ie=e.next_out,te=e.output,oe=e.avail_out,re=e.next_in,ee=e.input,se=e.avail_in,ae=r.hold,ue=r.bits,r.mode===P&&(r.back=-1);break}for(r.back=0;ve=(Se=r.lencode[ae&(1<>>16&255,ye=65535&Se,!((ge=Se>>>24)<=ue);){if(0===se)break e;se--,ae+=ee[re++]<>_e)])>>>16&255,ye=65535&Se,!(_e+(ge=Se>>>24)<=ue);){if(0===se)break e;se--,ae+=ee[re++]<>>=_e,ue-=_e,r.back+=_e}if(ae>>>=ge,ue-=ge,r.back+=ge,r.length=ye,0===ve){r.mode=K;break}if(32&ve){r.back=-1,r.mode=P;break}if(64&ve){e.msg="invalid literal/length code",r.mode=Z;break}r.extra=15&ve,r.mode=G;case G:if(r.extra){for(Ae=r.extra;ue>>=r.extra,ue-=r.extra,r.back+=r.extra}r.was=r.length,r.mode=z;case z:for(;ve=(Se=r.distcode[ae&(1<>>16&255,ye=65535&Se,!((ge=Se>>>24)<=ue);){if(0===se)break e;se--,ae+=ee[re++]<>_e)])>>>16&255,ye=65535&Se,!(_e+(ge=Se>>>24)<=ue);){if(0===se)break e;se--,ae+=ee[re++]<>>=_e,ue-=_e,r.back+=_e}if(ae>>>=ge,ue-=ge,r.back+=ge,64&ve){e.msg="invalid distance code",r.mode=Z;break}r.offset=ye,r.extra=15&ve,r.mode=W;case W:if(r.extra){for(Ae=r.extra;ue>>=r.extra,ue-=r.extra,r.back+=r.extra}if(r.offset>r.dmax){e.msg="invalid distance too far back",r.mode=Z;break}r.mode=H;case H:if(0===oe)break e;if(fe=ce-oe,r.offset>fe){if((fe=r.offset-fe)>r.whave&&r.sane){e.msg="invalid distance too far back",r.mode=Z;break}fe>r.wnext?(fe-=r.wnext,de=r.wsize-fe):de=r.wnext-fe,fe>r.length&&(fe=r.length),me=r.window}else me=te,de=ie-r.offset,fe=r.length;fe>oe&&(fe=oe),oe-=fe,r.length-=fe;do{te[ie++]=me[de++]}while(--fe);0===r.length&&(r.mode=V);break;case K:if(0===oe)break e;te[ie++]=r.length,oe--,r.mode=V;break;case q:if(r.wrap){for(;ue<32;){if(0===se)break e;se--,ae|=ee[re++]<=1&&0===B[S];S--);if(k>S&&(k=S),0===S)return l[c++]=20971520,l[c++]=20971520,p.bits=1,0;for(A=1;A0&&(0===e||1!==S))return-1;for(N[1]=0,E=1;E<15;E++)N[E+1]=N[E]+B[E];for(T=0;T852||2===e&&O>592)return 1;for(;;){_=E-I,h[T]y?(b=D[F+h[T]],x=P[M+h[T]]):(b=96,x=0),f=1<>I)+(d-=f)]=_<<24|b<<16|x|0}while(0!==d);for(f=1<>=1;if(0!==f?(L&=f-1,L+=f):L=0,T++,0==--B[E]){if(E===S)break;E=t[r+h[T]]}if(E>k&&(L&g)!==m){for(0===I&&(I=k),v+=A,R=1<<(C=E-I);C+I852||2===e&&O>592)return 1;l[m=L&g]=k<<24|C<<16|v-c|0}}return 0!==L&&(l[v+L]=E-I<<24|64<<16|0),p.bits=k,0}},{"../utils/common":294}],302:[function(e,t,r){"use strict";t.exports={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"}},{}],303:[function(e,t,r){"use strict";var n=e("../utils/common"),i=4,s=0,o=1,a=2;function u(e){for(var t=e.length;--t>=0;)e[t]=0}var l=0,c=1,h=2,p=29,f=256,d=f+1+p,m=30,g=19,v=2*d+1,y=15,_=16,b=7,x=256,w=16,E=17,T=18,A=[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],S=[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],k=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7],C=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],I=new Array(2*(d+2));u(I);var R=new Array(2*m);u(R);var O=new Array(512);u(O);var L=new Array(256);u(L);var P=new Array(p);u(P);var M,B,N,D=new Array(m);function F(e,t,r,n,i){this.static_tree=e,this.extra_bits=t,this.extra_base=r,this.elems=n,this.max_length=i,this.has_stree=e&&e.length}function j(e,t){this.dyn_tree=e,this.max_code=0,this.stat_desc=t}function U(e){return e<256?O[e]:O[256+(e>>>7)]}function $(e,t){e.pending_buf[e.pending++]=255&t,e.pending_buf[e.pending++]=t>>>8&255}function V(e,t,r){e.bi_valid>_-r?(e.bi_buf|=t<>_-e.bi_valid,e.bi_valid+=r-_):(e.bi_buf|=t<>>=1,r<<=1}while(--t>0);return r>>>1}function W(e,t,r){var n,i,s=new Array(y+1),o=0;for(n=1;n<=y;n++)s[n]=o=o+r[n-1]<<1;for(i=0;i<=t;i++){var a=e[2*i+1];0!==a&&(e[2*i]=z(s[a]++,a))}}function H(e){var t;for(t=0;t8?$(e,e.bi_buf):e.bi_valid>0&&(e.pending_buf[e.pending++]=e.bi_buf),e.bi_buf=0,e.bi_valid=0}function q(e,t,r,n){var i=2*t,s=2*r;return e[i]>1;r>=1;r--)X(e,s,r);i=u;do{r=e.heap[1],e.heap[1]=e.heap[e.heap_len--],X(e,s,1),n=e.heap[1],e.heap[--e.heap_max]=r,e.heap[--e.heap_max]=n,s[2*i]=s[2*r]+s[2*n],e.depth[i]=(e.depth[r]>=e.depth[n]?e.depth[r]:e.depth[n])+1,s[2*r+1]=s[2*n+1]=i,e.heap[1]=i++,X(e,s,1)}while(e.heap_len>=2);e.heap[--e.heap_max]=e.heap[1],function(e,t){var r,n,i,s,o,a,u=t.dyn_tree,l=t.max_code,c=t.stat_desc.static_tree,h=t.stat_desc.has_stree,p=t.stat_desc.extra_bits,f=t.stat_desc.extra_base,d=t.stat_desc.max_length,m=0;for(s=0;s<=y;s++)e.bl_count[s]=0;for(u[2*e.heap[e.heap_max]+1]=0,r=e.heap_max+1;rd&&(s=d,m++),u[2*n+1]=s,n>l||(e.bl_count[s]++,o=0,n>=f&&(o=p[n-f]),a=u[2*n],e.opt_len+=a*(s+o),h&&(e.static_len+=a*(c[2*n+1]+o)));if(0!==m){do{for(s=d-1;0===e.bl_count[s];)s--;e.bl_count[s]--,e.bl_count[s+1]+=2,e.bl_count[d]--,m-=2}while(m>0);for(s=d;0!==s;s--)for(n=e.bl_count[s];0!==n;)(i=e.heap[--r])>l||(u[2*i+1]!==s&&(e.opt_len+=(s-u[2*i+1])*u[2*i],u[2*i+1]=s),n--)}}(e,t),W(s,l,e.bl_count)}function J(e,t,r){var n,i,s=-1,o=t[1],a=0,u=7,l=4;for(0===o&&(u=138,l=3),t[2*(r+1)+1]=65535,n=0;n<=r;n++)i=o,o=t[2*(n+1)+1],++a>=7;n0?(e.strm.data_type===a&&(e.strm.data_type=function(e){var t,r=4093624447;for(t=0;t<=31;t++,r>>>=1)if(1&r&&0!==e.dyn_ltree[2*t])return s;if(0!==e.dyn_ltree[18]||0!==e.dyn_ltree[20]||0!==e.dyn_ltree[26])return o;for(t=32;t=3&&0===e.bl_tree[2*C[t]+1];t--);return e.opt_len+=3*(t+1)+5+5+4,t}(e),u=e.opt_len+3+7>>>3,(l=e.static_len+3+7>>>3)<=u&&(u=l)):u=l=r+5,r+4<=u&&-1!==t?te(e,t,r,n):e.strategy===i||l===u?(V(e,(c<<1)+(n?1:0),3),Y(e,I,R)):(V(e,(h<<1)+(n?1:0),3),function(e,t,r,n){var i;for(V(e,t-257,5),V(e,r-1,5),V(e,n-4,4),i=0;i>>8&255,e.pending_buf[e.d_buf+2*e.last_lit+1]=255&t,e.pending_buf[e.l_buf+e.last_lit]=255&r,e.last_lit++,0===t?e.dyn_ltree[2*r]++:(e.matches++,t--,e.dyn_ltree[2*(L[r]+f+1)]++,e.dyn_dtree[2*U(t)]++),e.last_lit===e.lit_bufsize-1},r._tr_align=function(e){V(e,c<<1,3),G(e,x,I),function(e){16===e.bi_valid?($(e,e.bi_buf),e.bi_buf=0,e.bi_valid=0):e.bi_valid>=8&&(e.pending_buf[e.pending++]=255&e.bi_buf,e.bi_buf>>=8,e.bi_valid-=8)}(e)}},{"../utils/common":294}],304:[function(e,t,r){"use strict";t.exports=function(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}},{}],305:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.SIGNALS=void 0;r.SIGNALS=[{name:"SIGHUP",number:1,action:"terminate",description:"Terminal closed",standard:"posix"},{name:"SIGINT",number:2,action:"terminate",description:"User interruption with CTRL-C",standard:"ansi"},{name:"SIGQUIT",number:3,action:"core",description:"User interruption with CTRL-\\",standard:"posix"},{name:"SIGILL",number:4,action:"core",description:"Invalid machine instruction",standard:"ansi"},{name:"SIGTRAP",number:5,action:"core",description:"Debugger breakpoint",standard:"posix"},{name:"SIGABRT",number:6,action:"core",description:"Aborted",standard:"ansi"},{name:"SIGIOT",number:6,action:"core",description:"Aborted",standard:"bsd"},{name:"SIGBUS",number:7,action:"core",description:"Bus error due to misaligned, non-existing address or paging error",standard:"bsd"},{name:"SIGEMT",number:7,action:"terminate",description:"Command should be emulated but is not implemented",standard:"other"},{name:"SIGFPE",number:8,action:"core",description:"Floating point arithmetic error",standard:"ansi"},{name:"SIGKILL",number:9,action:"terminate",description:"Forced termination",standard:"posix",forced:!0},{name:"SIGUSR1",number:10,action:"terminate",description:"Application-specific signal",standard:"posix"},{name:"SIGSEGV",number:11,action:"core",description:"Segmentation fault",standard:"ansi"},{name:"SIGUSR2",number:12,action:"terminate",description:"Application-specific signal",standard:"posix"},{name:"SIGPIPE",number:13,action:"terminate",description:"Broken pipe or socket",standard:"posix"},{name:"SIGALRM",number:14,action:"terminate",description:"Timeout or timer",standard:"posix"},{name:"SIGTERM",number:15,action:"terminate",description:"Termination",standard:"ansi"},{name:"SIGSTKFLT",number:16,action:"terminate",description:"Stack is empty or overflowed",standard:"other"},{name:"SIGCHLD",number:17,action:"ignore",description:"Child process terminated, paused or unpaused",standard:"posix"},{name:"SIGCLD",number:17,action:"ignore",description:"Child process terminated, paused or unpaused",standard:"other"},{name:"SIGCONT",number:18,action:"unpause",description:"Unpaused",standard:"posix",forced:!0},{name:"SIGSTOP",number:19,action:"pause",description:"Paused",standard:"posix",forced:!0},{name:"SIGTSTP",number:20,action:"pause",description:'Paused using CTRL-Z or "suspend"',standard:"posix"},{name:"SIGTTIN",number:21,action:"pause",description:"Background process cannot read terminal input",standard:"posix"},{name:"SIGBREAK",number:21,action:"terminate",description:"User interruption with CTRL-BREAK",standard:"other"},{name:"SIGTTOU",number:22,action:"pause",description:"Background process cannot write to terminal output",standard:"posix"},{name:"SIGURG",number:23,action:"ignore",description:"Socket received out-of-band data",standard:"bsd"},{name:"SIGXCPU",number:24,action:"core",description:"Process timed out",standard:"bsd"},{name:"SIGXFSZ",number:25,action:"core",description:"File too big",standard:"bsd"},{name:"SIGVTALRM",number:26,action:"terminate",description:"Timeout or timer",standard:"bsd"},{name:"SIGPROF",number:27,action:"terminate",description:"Timeout or timer",standard:"bsd"},{name:"SIGWINCH",number:28,action:"ignore",description:"Terminal window size changed",standard:"bsd"},{name:"SIGIO",number:29,action:"terminate",description:"I/O is available",standard:"other"},{name:"SIGPOLL",number:29,action:"terminate",description:"Watched event",standard:"other"},{name:"SIGINFO",number:29,action:"ignore",description:"Request for process information",standard:"other"},{name:"SIGPWR",number:30,action:"terminate",description:"Device running out of power",standard:"systemv"},{name:"SIGSYS",number:31,action:"core",description:"Invalid system call",standard:"other"},{name:"SIGUNUSED",number:31,action:"terminate",description:"Invalid system call",standard:"other"}]},{}],306:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.signalsByNumber=r.signalsByName=void 0;var n=e("os"),i=e("./signals.js"),s=e("./realtime.js");const o=function(e,{name:t,number:r,description:n,supported:i,action:s,forced:o,standard:a}){return{...e,[t]:{name:t,number:r,description:n,supported:i,action:s,forced:o,standard:a}}},a=(0,i.getSignals)().reduce(o,{});r.signalsByName=a;const u=function(e,t){const r=l(e,t);if(void 0===r)return{};const{name:n,description:i,supported:s,action:o,forced:a,standard:u}=r;return{[e]:{name:n,number:e,description:i,supported:s,action:o,forced:a,standard:u}}},l=function(e,t){const r=t.find(({name:t})=>n.constants.signals[t]===e);return void 0!==r?r:t.find(t=>t.number===e)},c=function(){const e=(0,i.getSignals)(),t=s.SIGRTMAX+1,r=Array.from({length:t},(t,r)=>u(r,e));return Object.assign({},...r)}();r.signalsByNumber=c},{"./realtime.js":307,"./signals.js":308,os:293}],307:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.SIGRTMAX=r.getRealtimeSignals=void 0;r.getRealtimeSignals=function(){const e=s-i+1;return Array.from({length:e},n)};const n=function(e,t){return{name:`SIGRT${t+1}`,number:i+t,action:"terminate",description:"Application-specific signal (realtime)",standard:"posix"}},i=34,s=64;r.SIGRTMAX=s},{}],308:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.getSignals=void 0;var n=e("os"),i=e("./core.js"),s=e("./realtime.js");r.getSignals=function(){const e=(0,s.getRealtimeSignals)();return[...i.SIGNALS,...e].map(o)};const o=function({name:e,number:t,description:r,action:i,forced:s=!1,standard:o}){const{signals:{[e]:a}}=n.constants,u=void 0!==a;return{name:e,number:u?a:t,description:r,supported:u,action:i,forced:s,standard:o}}},{"./core.js":305,"./realtime.js":307,os:293}],309:[function(e,t,r){r.read=function(e,t,r,n,i){var s,o,a=8*i-n-1,u=(1<>1,c=-7,h=r?i-1:0,p=r?-1:1,f=e[t+h];for(h+=p,s=f&(1<<-c)-1,f>>=-c,c+=a;c>0;s=256*s+e[t+h],h+=p,c-=8);for(o=s&(1<<-c)-1,s>>=-c,c+=n;c>0;o=256*o+e[t+h],h+=p,c-=8);if(0===s)s=1-l;else{if(s===u)return o?NaN:1/0*(f?-1:1);o+=Math.pow(2,n),s-=l}return(f?-1:1)*o*Math.pow(2,s-n)},r.write=function(e,t,r,n,i,s){var o,a,u,l=8*s-i-1,c=(1<>1,p=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,f=n?0:s-1,d=n?1:-1,m=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(a=isNaN(t)?1:0,o=c):(o=Math.floor(Math.log(t)/Math.LN2),t*(u=Math.pow(2,-o))<1&&(o--,u*=2),(t+=o+h>=1?p/u:p*Math.pow(2,1-h))*u>=2&&(o++,u/=2),o+h>=c?(a=0,o=c):o+h>=1?(a=(t*u-1)*Math.pow(2,i),o+=h):(a=t*Math.pow(2,h-1)*Math.pow(2,i),o=0));i>=8;e[r+f]=255&a,f+=d,a/=256,i-=8);for(o=o<0;e[r+f]=255&o,f+=d,o/=256,l-=8);e[r+f-d]|=128*m}},{}],310:[function(e,t,r){(function(e){function r(e){return Array.isArray(e)?e:[e]}const n=/^\s+$/,i=/^\\!/,s=/^\\#/,o=/\r?\n/g,a=/^\.*\/|^\.+$/,u="/",l="undefined"!=typeof Symbol?Symbol.for("node-ignore"):"node-ignore",c=(e,t,r)=>Object.defineProperty(e,t,{value:r}),h=/([0-z])-([0-z])/g,p=()=>!1,f=[[/\\?\s+$/,e=>0===e.indexOf("\\")?" ":""],[/\\\s/g,()=>" "],[/[\\$.|*+(){^]/g,e=>`\\${e}`],[/(?!\\)\?/g,()=>"[^/]"],[/^\//,()=>"^"],[/\//g,()=>"\\/"],[/^\^*\\\*\\\*\\\//,()=>"^(?:.*\\/)?"],[/^(?=[^^])/,function(){return/\/(?!$)/.test(this)?"^":"(?:^|\\/)"}],[/\\\/\\\*\\\*(?=\\\/|$)/g,(e,t,r)=>t+6`${t}[^\\/]*`],[/\\\\\\(?=[$.|*+(){^])/g,()=>"\\"],[/\\\\/g,()=>"\\"],[/(\\)?\[([^\]/]*?)(\\*)($|\])/g,(e,t,r,n,i)=>"\\"===t?`\\[${r}${(e=>{const{length:t}=e;return e.slice(0,t-t%2)})(n)}${i}`:"]"===i&&n.length%2==0?`[${(e=>e.replace(h,(e,t,r)=>t.charCodeAt(0)<=r.charCodeAt(0)?e:""))(r)}${n}]`:"[]"],[/(?:[^*])$/,e=>/\/$/.test(e)?`${e}$`:`${e}(?=$|\\/$)`],[/(\^|\\\/)?\\\*$/,(e,t)=>{return`${t?`${t}[^/]+`:"[^/]*"}(?=$|\\/$)`}]],d=Object.create(null),m=e=>"string"==typeof e,g=e=>e&&m(e)&&!n.test(e)&&0!==e.indexOf("#"),v=e=>e.split(o);const y=(e,t)=>{const r=e;let n=!1;return 0===e.indexOf("!")&&(n=!0,e=e.substr(1)),new class{constructor(e,t,r,n){this.origin=e,this.pattern=t,this.negative=r,this.regex=n}}(r,e=e.replace(i,"!").replace(s,"#"),n,((e,t)=>{let r=d[e];return r||(r=f.reduce((t,r)=>t.replace(r[0],r[1].bind(e)),e),d[e]=r),t?new RegExp(r,"i"):new RegExp(r)})(e,t))},_=(e,t)=>{throw new t(e)},b=(e,t,r)=>{if(!m(e))return r(`path must be a string, but got \`${t}\``,TypeError);if(!e)return r("path must not be empty",TypeError);if(b.isNotRelative(e)){return r(`path should be a ${"`path.relative()`d"} string, but got "${t}"`,RangeError)}return!0},x=e=>a.test(e);b.isNotRelative=x,b.convert=(e=>e);const w=e=>new class{constructor({ignorecase:e=!0,ignoreCase:t=e,allowRelativePaths:r=!1}={}){c(this,l,!0),this._rules=[],this._ignoreCase=t,this._allowRelativePaths=r,this._initCache()}_initCache(){this._ignoreCache=Object.create(null),this._testCache=Object.create(null)}_addPattern(e){if(e&&e[l])return this._rules=this._rules.concat(e._rules),void(this._added=!0);if(g(e)){const t=y(e,this._ignoreCase);this._added=!0,this._rules.push(t)}}add(e){return this._added=!1,r(m(e)?v(e):e).forEach(this._addPattern,this),this._added&&this._initCache(),this}addPattern(e){return this.add(e)}_testOne(e,t){let r=!1,n=!1;return this._rules.forEach(i=>{const{negative:s}=i;n===s&&r!==n||s&&!r&&!n&&!t||i.regex.test(e)&&(r=!s,n=s)}),{ignored:r,unignored:n}}_test(e,t,r,n){const i=e&&b.convert(e);return b(i,e,this._allowRelativePaths?p:_),this._t(i,t,r,n)}_t(e,t,r,n){if(e in t)return t[e];if(n||(n=e.split(u)),n.pop(),!n.length)return t[e]=this._testOne(e,r);const i=this._t(n.join(u)+u,t,r,n);return t[e]=i.ignored?i:this._testOne(e,r)}ignores(e){return this._test(e,this._ignoreCache,!1).ignored}createFilter(){return e=>!this.ignores(e)}filter(e){return r(e).filter(this.createFilter())}test(e){return this._test(e,this._testCache,!0)}}(e);if(w.isPathValid=(e=>b(e&&b.convert(e),e,p)),w.default=w,t.exports=w,void 0!==e&&(e.env&&e.env.IGNORE_TEST_WIN32||"win32"===e.platform)){const e=e=>/^\\\\\?\\/.test(e)||/["<>|\u0000-\u001F]+/u.test(e)?e:e.replace(/\\/g,"/");b.convert=e;const t=/^[a-z]:\//i;b.isNotRelative=(e=>t.test(e)||x(e))}}).call(this,e("_process"))},{_process:452}],311:[function(e,t,r){"use strict";var n=e("underscore"),i=t.exports={Bitmap:e("./lib/bitmap")};n.extend(i,e("./lib/enums"))},{"./lib/bitmap":312,"./lib/enums":313,underscore:531}],312:[function(e,t,r){(function(r){"use strict";var n=e("fs"),i=(e("underscore"),e("bluebird")),s=e("jpeg-js"),o=e("pngjs").PNG,a=e("./enums"),u=e("./utils"),l=e("./resize"),c={r:0,g:0,b:0,a:0},h=t.exports=function(e){e&&(e instanceof h?this._data={data:new r(e.data.data),width:e.width,height:e.height}:e.data?this._data=e:e.width&&e.height&&(this._data={data:new r(4*e.width*e.height),width:e.width,height:e.height},e.color&&this._fill(e.color)))};h.prototype={get width(){return this._data.width},get height(){return this._data.height},attach:function(e){var t=this._data;return this._data=e,t},detach:function(){var e=this._data;return delete this._data,e},_deduceFileType:function(e){if(!e)throw new Error("Can't determine image type");switch(e.substr(-4).toLowerCase()){case".jpg":return a.ImageType.JPG;case".png":return a.ImageType.PNG}if(".jpeg"==e.substr(-5).toLowerCase())return a.ImageType.JPG;throw new Error("Can't recognise image type: "+e)},_readStream:function(e){var t=i.defer(),n=[];return e.on("data",function(e){n.push(e)}),e.on("end",function(){var e=r.concat(n);t.resolve(e)}),e.on("error",function(e){t.reject(e)}),t.promise},_readPNG:function(e){var t=i.defer(),r=new o({filterType:4});return r.on("parsed",function(){t.resolve(r)}),r.on("error",function(e){t.reject(e)}),e.pipe(r),t.promise},_parseOptions:function(e,t){return"number"==typeof(e=e||{})&&(e={type:e}),e.type=e.type||this._deduceFileType(t),e},read:function(e,t){var r=this;switch((t=this._parseOptions(t)).type){case a.ImageType.JPG:return this._readStream(e).then(function(e){r._data=s.decode(e)});case a.ImageType.PNG:return this._readPNG(e).then(function(e){r._data={data:e.data,width:e.width,height:e.height}});default:return i.reject(new Error("Not supported: ImageType "+t.type))}},readFile:function(e,t){var r=this;return u.fs.exists(e).then(function(i){if(i){t=r._parseOptions(t,e);var s=n.createReadStream(e);return r.read(s,t)}throw new Error("File Not Found: "+e)})},write:function(e,t){t=this._parseOptions(t);var r=i.defer();try{switch(e.on("finish",function(){r.resolve()}),e.on("error",function(e){r.reject(e)}),t.type){case a.ImageType.JPG:var n=s.encode(this._data,t.quality||90).data;e.write(n),e.end();break;case a.ImageType.PNG:var u=new o;u.width=this.width,u.height=this.height,u.data=this._data.data,u.on("end",function(){r.resolve()}),u.on("error",function(e){r.reject(e)}),u.pack().pipe(e);break;default:throw new Error("Not supported: ImageType "+t.type)}}catch(e){r.reject(e)}return r.promise},writeFile:function(e,t){t=this._parseOptions(t,e);var r=n.createWriteStream(e);return this.write(r,t)},clone:function(){return new h({width:this.width,height:this.height,data:new r(this._data.data)})},setPixel:function(e,t,r,n,i,s){if(void 0===n){var o=r;r=o.r,n=o.g,i=o.b,s=o.a}void 0===s&&(s=255);var a=4*(t*this.width+e),u=this._data.data;u[a++]=r,u[a++]=n,u[a++]=i,u[a++]=s},getPixel:function(e,t,r){var n=4*(t*this.width+e);r=r||{};var i=this._data.data;return r.r=i[n++],r.g=i[n++],r.b=i[n++],r.a=i[n++],r},negative:function(){for(var e=new h({width:this.width,height:this.height}),t=this.width*this.height,r=this._data.data,n=e._data.data,i=0,s=0,o=0;o-1&&I-1&&R=0&&R>=0?x[N]:D)+F*(g=I=0?x[N+4]:D),$=(1-F)*(v=I>=0&&R0?o:0)-(c>0?4:0)]+2*a[f-(l>0?o:0)]+1*a[f-(l>0?o:0)+(c0?4:0)]+4*a[f]+2*a[f+(c0?4:0)]+2*a[f+(l0?s[w-4]:2*s[w]-s[w+4],T=s[w],A=s[w+4],S=$0?m[w-4*p]:2*m[w]-m[w+4*p],R=m[w],O=m[w+4*p],L=j1)for(g=0;g0&&!e[o-1];)o--;s.push({children:[],index:0});var a,u=s[0];for(r=0;r0;)u=s.pop();for(u.index++,s.push(u);s.length<=r;)s.push(a={children:[],index:0}),u.children[u.index]=a.children,u=a;i++}r+10)return f>>--d&1;if(255==(f=t[r++])){var e=t[r++];if(e)throw"unexpected marker: "+(f<<8|e).toString(16)}return d=7,f>>>7}function g(e){for(var t,r=e;null!==(t=m());){if("number"==typeof(r=r[t]))return r;if("object"!=typeof r)throw"invalid huffman sequence"}return null}function v(e){for(var t=0;e>0;){var r=m();if(null===r)return;t=t<<1|r,e--}return t}function y(e){var t=v(e);return t>=1<0)_--;else for(var n=o,i=a;n<=i;){var s=g(t.huffmanTableAC),u=15&s,c=s>>4;if(0!==u)r[e[n+=c]]=y(u)*(1<>4,0===h)s<15?(_=v(s)+(1<>4;if(0!==a)r[e[s+=u]]=y(a),s++;else{if(u<15)break;s+=16}}};var O,L,P,M,B=0;for(L=1==R?i[0].blocksPerLine*i[0].blocksPerColumn:c*n.mcusPerColumn,s||(s=L);B=65488&&O<=65495))break;r+=2}return r-p}function p(e,l){var c,h,p=[],f=l.blocksPerLine,d=l.blocksPerColumn,m=f<<3,g=new Int32Array(64),v=new Uint8Array(64);function y(e,c,h){var p,f,d,m,g,v,y,_,b,x,w=l.quantizationTable,E=h;for(x=0;x<64;x++)E[x]=e[x]*w[x];for(x=0;x<8;++x){var T=8*x;0!=E[1+T]||0!=E[2+T]||0!=E[3+T]||0!=E[4+T]||0!=E[5+T]||0!=E[6+T]||0!=E[7+T]?(p=a*E[0+T]+128>>8,f=a*E[4+T]+128>>8,d=E[2+T],m=E[6+T],g=u*(E[1+T]-E[7+T])+128>>8,_=u*(E[1+T]+E[7+T])+128>>8,v=E[3+T]<<4,y=E[5+T]<<4,b=p-f+1>>1,p=p+f+1>>1,f=b,b=d*o+m*s+128>>8,d=d*s-m*o+128>>8,m=b,b=g-y+1>>1,g=g+y+1>>1,y=b,b=_+v+1>>1,v=_-v+1>>1,_=b,b=p-m+1>>1,p=p+m+1>>1,m=b,b=f-d+1>>1,f=f+d+1>>1,d=b,b=g*i+_*n+2048>>12,g=g*n-_*i+2048>>12,_=b,b=v*r+y*t+2048>>12,v=v*t-y*r+2048>>12,y=b,E[0+T]=p+_,E[7+T]=p-_,E[1+T]=f+y,E[6+T]=f-y,E[2+T]=d+v,E[5+T]=d-v,E[3+T]=m+g,E[4+T]=m-g):(b=a*E[0+T]+512>>10,E[0+T]=b,E[1+T]=b,E[2+T]=b,E[3+T]=b,E[4+T]=b,E[5+T]=b,E[6+T]=b,E[7+T]=b)}for(x=0;x<8;++x){var A=x;0!=E[8+A]||0!=E[16+A]||0!=E[24+A]||0!=E[32+A]||0!=E[40+A]||0!=E[48+A]||0!=E[56+A]?(p=a*E[0+A]+2048>>12,f=a*E[32+A]+2048>>12,d=E[16+A],m=E[48+A],g=u*(E[8+A]-E[56+A])+2048>>12,_=u*(E[8+A]+E[56+A])+2048>>12,v=E[24+A],y=E[40+A],b=p-f+1>>1,p=p+f+1>>1,f=b,b=d*o+m*s+2048>>12,d=d*s-m*o+2048>>12,m=b,b=g-y+1>>1,g=g+y+1>>1,y=b,b=_+v+1>>1,v=_-v+1>>1,_=b,b=p-m+1>>1,p=p+m+1>>1,m=b,b=f-d+1>>1,f=f+d+1>>1,d=b,b=g*i+_*n+2048>>12,g=g*n-_*i+2048>>12,_=b,b=v*r+y*t+2048>>12,v=v*t-y*r+2048>>12,y=b,E[0+A]=p+_,E[56+A]=p-_,E[8+A]=f+y,E[48+A]=f-y,E[16+A]=d+v,E[40+A]=d-v,E[24+A]=m+g,E[32+A]=m-g):(b=a*h[x+0]+8192>>14,E[0+A]=b,E[8+A]=b,E[16+A]=b,E[24+A]=b,E[32+A]=b,E[40+A]=b,E[48+A]=b,E[56+A]=b)}for(x=0;x<64;++x){var S=128+(E[x]+8>>4);c[x]=S<0?0:S>255?255:S}}for(var _=0;_255?255:e}return l.prototype={load:function(e){var t=new XMLHttpRequest;t.open("GET",e,!0),t.responseType="arraybuffer",t.onload=function(){var e=new Uint8Array(t.response||t.mozResponseArrayBuffer);this.parse(e),this.onload&&this.onload()}.bind(this),t.send(null)},parse:function(t){var r=0;t.length;function n(){var e=t[r]<<8|t[r+1];return r+=2,e}function i(){var e=n(),i=t.subarray(r,r+e-2);return r+=i.length,i}function s(e){var t,r,n=0,i=0;for(r in e.components)e.components.hasOwnProperty(r)&&(n<(t=e.components[r]).h&&(n=t.h),i>4==0)for($=0;$<64;$++){x[e[$]]=t[r++]}else{if(b>>4!=1)throw"DQT: invalid table spec";for($=0;$<64;$++){x[e[$]]=n()}}f[15&b]=x}break;case 65472:case 65473:case 65474:n(),(o={}).extended=65473===v,o.progressive=65474===v,o.precision=t[r++],o.scanLines=n(),o.samplesPerLine=n(),o.components={},o.componentsOrder=[];var w,E=t[r++];for(j=0;j>4,A=15&t[r+1],S=t[r+2];o.componentsOrder.push(w),o.components[w]={h:T,v:A,quantizationIdx:S},r+=3}s(o),d.push(o);break;case 65476:var k=n();for(j=2;j>4==0?g:m)[15&C]=c(I,O)}break;case 65501:n(),a=n();break;case 65498:n();var L=t[r++],P=[];for(j=0;j>4],V.huffmanTableAC=m[15&M],P.push(V)}var B=t[r++],N=t[r++],D=t[r++],F=h(t,r,o,P,a,B,N,D>>4,15&D);r+=F;break;default:if(255==t[r-3]&&t[r-2]>=192&&t[r-2]<=254){r-=3;break}throw"unknown JPEG marker "+v.toString(16)}v=n()}if(1!=d.length)throw"only single frame JPEGs supported";for(var j=0;j=0;)t&1<>8&255),B(255&e)}function D(e,t,r,n,i){var s,o=i[0],a=i[240];for(var u=function(e,t){var r,n,i,s,o,a,u,l,c,h,p=0;for(c=0;c<8;++c){r=e[p],n=e[p+1],i=e[p+2],s=e[p+3],o=e[p+4],a=e[p+5],u=e[p+6];var f=r+(l=e[p+7]),m=r-l,g=n+u,v=n-u,y=i+a,_=i-a,b=s+o,x=s-o,w=f+b,E=f-b,T=g+y,A=g-y;e[p]=w+T,e[p+4]=w-T;var S=.707106781*(A+E);e[p+2]=E+S,e[p+6]=E-S;var k=.382683433*((w=x+_)-(A=v+m)),C=.5411961*w+k,I=1.306562965*A+k,R=.707106781*(T=_+v),O=m+R,L=m-R;e[p+5]=L+C,e[p+3]=L-C,e[p+1]=O+I,e[p+7]=O-I,p+=8}for(p=0,c=0;c<8;++c){r=e[p],n=e[p+8],i=e[p+16],s=e[p+24],o=e[p+32],a=e[p+40],u=e[p+48];var P=r+(l=e[p+56]),M=r-l,B=n+u,N=n-u,D=i+a,F=i-a,j=s+o,U=s-o,$=P+j,V=P-j,G=B+D,z=B-D;e[p]=$+G,e[p+32]=$-G;var W=.707106781*(z+V);e[p+16]=V+W,e[p+48]=V-W;var H=.382683433*(($=U+F)-(z=N+M)),K=.5411961*$+H,q=1.306562965*z+H,X=.707106781*(G=F+N),Y=M+X,Z=M-X;e[p+40]=Z+K,e[p+24]=Z-K,e[p+8]=Y+q,e[p+56]=Y-q,p++}for(c=0;c<64;++c)h=e[c]*t[c],d[c]=h>0?h+.5|0:h-.5|0;return d}(e,t),l=0;l<64;++l)m[T[l]]=u[l];var c=m[0]-r;r=m[0],0==c?M(n[0]):(M(n[f[s=32767+c]]),M(p[s]));for(var h=63;h>0&&0==m[h];h--);if(0==h)return M(o),r;for(var g,v=1;v<=h;){for(var y=v;0==m[v]&&v<=h;++v);var _=v-y;if(_>=16){g=_>>4;for(var b=1;b<=g;++b)M(a);_&=15}s=32767+m[v],M(i[(_<<4)+f[s]]),M(p[s]),v++}return 63!=h&&M(o),r}function F(e){if(e<=0&&(e=1),e>100&&(e=100),o!=e){(function(e){for(var t=[16,11,10,16,24,40,51,61,12,12,14,19,26,58,60,55,14,13,16,24,40,57,69,56,14,17,22,29,51,87,80,62,18,22,37,56,68,109,103,77,24,35,55,64,81,104,113,92,49,64,78,87,103,121,120,101,72,92,95,98,112,100,103,99],r=0;r<64;r++){var n=a((t[r]*e+50)/100);n<1?n=1:n>255&&(n=255),u[T[r]]=n}for(var i=[17,18,24,47,99,99,99,99,18,21,26,66,99,99,99,99,24,26,56,99,99,99,99,99,47,66,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99],s=0;s<64;s++){var o=a((i[s]*e+50)/100);o<1?o=1:o>255&&(o=255),l[T[s]]=o}for(var p=[1,1.387039845,1.306562965,1.175875602,1,.785694958,.5411961,.275899379],f=0,d=0;d<8;d++)for(var m=0;m<8;m++)c[f]=1/(u[T[f]]*p[d]*p[m]*8),h[f]=1/(l[T[f]]*p[d]*p[m]*8),f++})(e<50?Math.floor(5e3/e):Math.floor(200-2*e)),o=e}}this.encode=function(t,o){(new Date).getTime();o&&F(o),g=new Array,v=0,y=7,N(65496),N(65504),N(16),B(74),B(70),B(73),B(70),B(0),B(1),B(1),B(0),N(1),N(1),B(0),B(0),function(){N(65499),N(132),B(0);for(var e=0;e<64;e++)B(u[e]);B(1);for(var t=0;t<64;t++)B(l[t])}(),function(e,t){N(65472),N(17),B(8),N(t),N(e),B(3),B(1),B(17),B(0),B(2),B(17),B(1),B(3),B(17),B(1)}(t.width,t.height),function(){N(65476),N(418),B(0);for(var e=0;e<16;e++)B(A[e+1]);for(var t=0;t<=11;t++)B(S[t]);B(16);for(var r=0;r<16;r++)B(k[r+1]);for(var n=0;n<=161;n++)B(C[n]);B(1);for(var i=0;i<16;i++)B(I[i+1]);for(var s=0;s<=11;s++)B(R[s]);B(17);for(var o=0;o<16;o++)B(O[o+1]);for(var a=0;a<=161;a++)B(L[a])}(),N(65498),N(12),B(3),B(1),B(0),B(2),B(17),B(3),B(17),B(0),B(63),B(0);var a=0,p=0,f=0;v=0,y=7,this.encode.displayName="_encode_";for(var d,m,w,T,P,j,U,$,V,G=t.data,z=t.width,W=t.height,H=4*z,K=0;K>3)*H+(U=4*(7&V)),K+$>=W&&(j-=H*(K+1+$-W)),d+U>=H&&(j-=d+U-H+4),m=G[j++],w=G[j++],T=G[j++],_[V]=(E[m]+E[w+256>>0]+E[T+512>>0]>>16)-128,b[V]=(E[m+768>>0]+E[w+1024>>0]+E[T+1280>>0]>>16)-128,x[V]=(E[m+1280>>0]+E[w+1536>>0]+E[T+1792>>0]>>16)-128;a=D(_,c,a,r,i),p=D(b,h,p,n,s),f=D(x,h,f,n,s),d+=32}K+=8}if(y>=0){var q=[];q[1]=y+1,q[0]=(1<>0]=38470*e,E[e+512>>0]=7471*e+32768,E[e+768>>0]=-11059*e,E[e+1024>>0]=-21709*e,E[e+1280>>0]=32768*e+8421375,E[e+1536>>0]=-27439*e,E[e+1792>>0]=-5329*e}(),F(t),(new Date).getTime()}()}t.exports=function(e,t){void 0===t&&(t=50);return{data:new r(t).encode(e,t),width:e.width,height:e.height}}}).call(this,e("buffer").Buffer)},{buffer:291}],319:[function(e,t,r){(function(r){"use strict";const n=e("exec-buffer"),i=e("is-jpg"),s=e("jpegtran-bin");t.exports=(e=>t=>{if(e={...e},!r.isBuffer(t))return Promise.reject(new TypeError("Expected a buffer"));if(!i(t))return Promise.resolve(t);const o=["-copy","none"];return e.progressive&&o.push("-progressive"),e.arithmetic?o.push("-arithmetic"):o.push("-optimize"),o.push("-outfile",n.output,n.input),n({input:t,bin:s,args:o}).catch(e=>{throw e.message=e.stderr||e.message,e})})}).call(this,{isBuffer:e("../is-buffer/index.js")})},{"../is-buffer/index.js":350,"exec-buffer":57,"is-jpg":353,"jpegtran-bin":320}],320:[function(e,t,r){"use strict";t.exports=e("./lib").path()},{"./lib":321}],321:[function(e,t,r){(function(r,n){"use strict";const i=e("path"),s=e("bin-wrapper"),o=`https://raw.githubusercontent.com/imagemin/jpegtran-bin/v${e("../package.json").version}/vendor/`;t.exports=(new s).src(`${o}macos/jpegtran`,"darwin").src(`${o}linux/x86/jpegtran`,"linux","x86").src(`${o}linux/x64/jpegtran`,"linux","x64").src(`${o}freebsd/x86/jpegtran`,"freebsd","x86").src(`${o}freebsd/x64/jpegtran`,"freebsd","x64").src(`${o}sunos/x86/jpegtran`,"sunos","x86").src(`${o}sunos/x64/jpegtran`,"sunos","x64").src(`${o}win/x86/jpegtran.exe`,"win32","x86").src(`${o}win/x64/jpegtran.exe`,"win32","x64").src(`${o}win/x86/libjpeg-62.dll`,"win32","x86").src(`${o}win/x64/libjpeg-62.dll`,"win32","x64").dest(i.join(n,"../vendor")).use("win32"===r.platform?"jpegtran.exe":"jpegtran")}).call(this,e("_process"),"/node_modules/imagemin-jpegtran/node_modules/jpegtran-bin/lib")},{"../package.json":322,_process:452,"bin-wrapper":29,path:397}],322:[function(e,t,r){t.exports={name:"jpegtran-bin",version:"5.0.2",description:"jpegtran (part of libjpeg-turbo) bin-wrapper that makes it seamlessly available as a local dependency",license:"MIT",repository:"imagemin/jpegtran-bin",author:{name:"Sindre Sorhus",email:"sindresorhus@gmail.com",url:"sindresorhus.com"},maintainers:[{name:"Kevin Mårtensson",email:"kevinmartensson@gmail.com",url:"github.com/kevva"},{name:"Shinnosuke Watanabe",url:"github.com/shinnn"}],bin:{jpegtran:"cli.js"},engines:{node:">=10"},scripts:{postinstall:"node lib/install.js",test:"xo && ava --timeout=120s"},files:["index.js","cli.js","lib","test","vendor/source"],keywords:["imagemin","compress","image","img","jpeg","jpg","minify","optimize","jpegtran"],dependencies:{"bin-build":"^3.0.0","bin-wrapper":"^4.0.0",logalot:"^2.0.0"},devDependencies:{ava:"^3.8.0","bin-check":"^4.0.1","compare-size":"^3.0.0",execa:"^4.0.0",tempy:"^0.5.0",xo:"^0.30.0"}}},{}],323:[function(e,t,r){(function(r){"use strict";const n=e("execa"),i=e("is-png"),s=e("is-stream"),o=e("pngquant-bin"),a=e("ow"),u=(e={})=>t=>{const u=r.isBuffer(t);if(!u&&!s(t))return Promise.reject(new TypeError(`Expected a Buffer or Stream, got ${typeof t}`));if(u&&!i(t))return Promise.resolve(t);const l=["-"];if(void 0!==e.speed&&(a(e.speed,a.number.integer.inRange(1,11)),l.push("--speed",e.speed)),void 0!==e.strip&&(a(e.strip,a.boolean),e.strip&&l.push("--strip")),void 0!==e.quality){a(e.quality,a.array.length(2).ofType(a.number.inRange(0,1)));const[t,r]=e.quality;l.push("--quality",`${Math.round(100*t)}-${Math.round(100*r)}`)}void 0!==e.dithering&&(a(e.dithering,a.any(a.number.inRange(0,1),a.boolean.false)),"number"==typeof e.dithering?l.push(`--floyd=${e.dithering}`):!1===e.dithering&&l.push("--ordered")),void 0!==e.posterize&&(a(e.posterize,a.number),l.push("--posterize",e.posterize)),void 0!==e.verbose&&(a(e.verbose,a.boolean),l.push("--verbose"));const c=n(o,l,{encoding:null,maxBuffer:1/0,input:t}),h=c.then(e=>e.stdout).catch(e=>{if(99===e.exitCode)return t;throw e.message=e.stderr||e.message,e});return c.stdout.then=h.then.bind(h),c.stdout.catch=h.catch.bind(h),c.stdout};t.exports=u,t.exports.default=u}).call(this,{isBuffer:e("../is-buffer/index.js")})},{"../is-buffer/index.js":350,execa:330,"is-png":354,"is-stream":339,ow:394,"pngquant-bin":449}],324:[function(e,t,r){"use strict";const n=e("child_process"),i=e("./lib/parse"),s=e("./lib/enoent");function o(e,t,r){const o=i(e,t,r),a=n.spawn(o.command,o.args,o.options);return s.hookChildProcess(a,o),a}t.exports=o,t.exports.spawn=o,t.exports.sync=function(e,t,r){const o=i(e,t,r),a=n.spawnSync(o.command,o.args,o.options);return a.error=a.error||s.verifyENOENTSync(a.status,o),a},t.exports._parse=i,t.exports._enoent=s},{"./lib/enoent":325,"./lib/parse":326,child_process:290}],325:[function(e,t,r){(function(e){"use strict";const r="win32"===e.platform;function n(e,t){return Object.assign(new Error(`${t} ${e.command} ENOENT`),{code:"ENOENT",errno:"ENOENT",syscall:`${t} ${e.command}`,path:e.command,spawnargs:e.args})}function i(e,t){return r&&1===e&&!t.file?n(t.original,"spawn"):null}t.exports={hookChildProcess:function(e,t){if(!r)return;const n=e.emit;e.emit=function(r,s){if("exit"===r){const r=i(s,t);if(r)return n.call(e,"error",r)}return n.apply(e,arguments)}},verifyENOENT:i,verifyENOENTSync:function(e,t){return r&&1===e&&!t.file?n(t.original,"spawnSync"):null},notFoundError:n}}).call(this,e("_process"))},{_process:452}],326:[function(e,t,r){(function(r){"use strict";const n=e("path"),i=e("./util/resolveCommand"),s=e("./util/escape"),o=e("./util/readShebang"),a="win32"===r.platform,u=/\.(?:com|exe)$/i,l=/node_modules[\\/].bin[\\/][^\\/]+\.cmd$/i;function c(e){if(!a)return e;const t=function(e){e.file=i(e);const t=e.file&&o(e.file);return t?(e.args.unshift(e.file),e.command=t,i(e)):e.file}(e),c=!u.test(t);if(e.options.forceShell||c){const i=l.test(t);e.command=n.normalize(e.command),e.command=s.command(e.command),e.args=e.args.map(e=>s.argument(e,i));const o=[e.command].concat(e.args).join(" ");e.args=["/d","/s","/c",`"${o}"`],e.command=r.env.comspec||"cmd.exe",e.options.windowsVerbatimArguments=!0}return e}t.exports=function(e,t,r){t&&!Array.isArray(t)&&(r=t,t=null);const n={command:e,args:t=t?t.slice(0):[],options:r=Object.assign({},r),file:void 0,original:{command:e,args:t}};return r.shell?n:c(n)}}).call(this,e("_process"))},{"./util/escape":327,"./util/readShebang":328,"./util/resolveCommand":329,_process:452,path:397}],327:[function(e,t,r){"use strict";const n=/([()\][%!^"`<>&|;, *?])/g;t.exports.command=function(e){return e=e.replace(n,"^$1")},t.exports.argument=function(e,t){return e=(e=`"${e=(e=(e=`${e}`).replace(/(\\*)"/g,'$1$1\\"')).replace(/(\\*)$/,"$1$1")}"`).replace(n,"^$1"),t&&(e=e.replace(n,"^$1")),e}},{}],328:[function(e,t,r){(function(r){"use strict";const n=e("fs"),i=e("shebang-command");t.exports=function(e){const t=r.alloc(150);let s;try{s=n.openSync(e,"r"),n.readSync(s,t,0,150,0),n.closeSync(s)}catch(e){}return i(t.toString())}}).call(this,e("buffer").Buffer)},{buffer:291,fs:290,"shebang-command":342}],329:[function(e,t,r){(function(r){"use strict";const n=e("path"),i=e("which"),s=e("path-key");function o(e,t){const o=e.options.env||r.env,a=r.cwd(),u=null!=e.options.cwd,l=u&&void 0!==r.chdir&&!r.chdir.disabled;if(l)try{r.chdir(e.options.cwd)}catch(e){}let c;try{c=i.sync(e.command,{path:o[s({env:o})],pathExt:t?n.delimiter:void 0})}catch(e){}finally{l&&r.chdir(a)}return c&&(c=n.resolve(u?e.options.cwd:"",c)),c}t.exports=function(e){return o(e)||o(e,!0)}}).call(this,e("_process"))},{_process:452,path:397,"path-key":341,which:344}],330:[function(e,t,r){(function(r,n){"use strict";const i=e("path"),s=e("child_process"),o=e("cross-spawn"),a=e("strip-final-newline"),u=e("npm-run-path"),l=e("onetime"),c=e("./lib/error"),h=e("./lib/stdio"),{spawnedKill:p,spawnedCancel:f,setupTimeout:d,setExitHandler:m}=e("./lib/kill"),{handleInput:g,getSpawnedResult:v,makeAllStream:y,validateInputSync:_}=e("./lib/stream.js"),{mergePromise:b,getSpawnedPromise:x}=e("./lib/promise.js"),{joinCommand:w,parseCommand:E}=e("./lib/command.js"),T=(e,t,r={})=>{const s=o._parse(e,t,r);return e=s.command,t=s.args,(r={maxBuffer:1e8,buffer:!0,stripFinalNewline:!0,extendEnv:!0,preferLocal:!1,localDir:(r=s.options).cwd||n.cwd(),execPath:n.execPath,encoding:"utf8",reject:!0,cleanup:!0,all:!1,windowsHide:!0,...r}).env=(({env:e,extendEnv:t,preferLocal:r,localDir:i,execPath:s})=>{const o=t?{...n.env,...e}:e;return r?u.env({env:o,cwd:i,execPath:s}):o})(r),r.stdio=h(r),"win32"===n.platform&&"cmd"===i.basename(e,".exe")&&t.unshift("/q"),{file:e,args:t,options:r,parsed:s}},A=(e,t,n)=>"string"==typeof t||r.isBuffer(t)?e.stripFinalNewline?a(t):t:void 0===n?void 0:"",S=(e,t,r)=>{const n=T(e,t,r),i=w(e,t);let a;try{a=s.spawn(n.file,n.args,n.options)}catch(e){const t=new s.ChildProcess,r=Promise.reject(c({error:e,stdout:"",stderr:"",all:"",command:i,parsed:n,timedOut:!1,isCanceled:!1,killed:!1}));return b(t,r)}const u=x(a),h=d(a,n.options,u),_=m(a,n.options,h),E={isCanceled:!1};a.kill=p.bind(null,a.kill.bind(a)),a.cancel=f.bind(null,a,E);const S=l(async()=>{const[{error:e,exitCode:t,signal:r,timedOut:s},o,u,l]=await v(a,n.options,_),h=A(n.options,o),p=A(n.options,u),f=A(n.options,l);if(e||0!==t||null!==r){const o=c({error:e,exitCode:t,signal:r,stdout:h,stderr:p,all:f,command:i,parsed:n,timedOut:s,isCanceled:E.isCanceled,killed:a.killed});if(!n.options.reject)return o;throw o}return{command:i,exitCode:0,stdout:h,stderr:p,all:f,failed:!1,timedOut:!1,isCanceled:!1,killed:!1}});return o._enoent.hookChildProcess(a,n.parsed),g(a,n.options.input),a.all=y(a,n.options),b(a,S)};t.exports=S,t.exports.sync=((e,t,r)=>{const n=T(e,t,r),i=w(e,t);let o;_(n.options);try{o=s.spawnSync(n.file,n.args,n.options)}catch(e){throw c({error:e,stdout:"",stderr:"",all:"",command:i,parsed:n,timedOut:!1,isCanceled:!1,killed:!1})}const a=A(n.options,o.stdout,o.error),u=A(n.options,o.stderr,o.error);if(o.error||0!==o.status||null!==o.signal){const e=c({stdout:a,stderr:u,error:o.error,signal:o.signal,exitCode:o.status,command:i,parsed:n,timedOut:o.error&&"ETIMEDOUT"===o.error.code,isCanceled:!1,killed:null!==o.signal});if(!n.options.reject)return e;throw e}return{command:i,exitCode:0,stdout:a,stderr:u,failed:!1,timedOut:!1,isCanceled:!1,killed:!1}}),t.exports.command=((e,t)=>{const[r,...n]=E(e);return S(r,n,t)}),t.exports.commandSync=((e,t)=>{const[r,...n]=E(e);return S.sync(r,n,t)}),t.exports.node=((e,t,r={})=>{t&&!Array.isArray(t)&&"object"==typeof t&&(r=t,t=[]);const i=h.node(r),s=n.execArgv.filter(e=>!e.startsWith("--inspect")),{nodePath:o=n.execPath,nodeOptions:a=s}=r;return S(o,[...a,e,...Array.isArray(t)?t:[]],{...r,stdin:void 0,stdout:void 0,stderr:void 0,stdio:i,shell:!1})})}).call(this,{isBuffer:e("../../../is-buffer/index.js")},e("_process"))},{"../../../is-buffer/index.js":350,"./lib/command.js":331,"./lib/error":332,"./lib/kill":333,"./lib/promise.js":334,"./lib/stdio":335,"./lib/stream.js":336,_process:452,child_process:290,"cross-spawn":324,"npm-run-path":340,onetime:393,path:397,"strip-final-newline":525}],331:[function(e,t,r){"use strict";const n=/ +/g;t.exports={joinCommand:(e,t=[])=>Array.isArray(t)?[e,...t].join(" "):e,parseCommand:e=>{const t=[];for(const r of e.trim().split(n)){const e=t[t.length-1];e&&e.endsWith("\\")?t[t.length-1]=`${e.slice(0,-1)} ${r}`:t.push(r)}return t}}},{}],332:[function(e,t,r){"use strict";const{signalsByName:n}=e("human-signals");t.exports=(({stdout:e,stderr:t,all:r,error:i,signal:s,exitCode:o,command:a,timedOut:u,isCanceled:l,killed:c,parsed:{options:{timeout:h}}})=>{o=null===o?void 0:o;const p=void 0===(s=null===s?void 0:s)?void 0:n[s].description,f=`Command ${(({timedOut:e,timeout:t,errorCode:r,signal:n,signalDescription:i,exitCode:s,isCanceled:o})=>e?`timed out after ${t} milliseconds`:o?"was canceled":void 0!==r?`failed with ${r}`:void 0!==n?`was killed with ${n} (${i})`:void 0!==s?`failed with exit code ${s}`:"failed")({timedOut:u,timeout:h,errorCode:i&&i.code,signal:s,signalDescription:p,exitCode:o,isCanceled:l})}: ${a}`,d="[object Error]"===Object.prototype.toString.call(i),m=d?`${f}\n${i.message}`:f,g=[m,t,e].filter(Boolean).join("\n");return d?(i.originalMessage=i.message,i.message=g):i=new Error(g),i.shortMessage=m,i.command=a,i.exitCode=o,i.signal=s,i.signalDescription=p,i.stdout=e,i.stderr=t,void 0!==r&&(i.all=r),"bufferedData"in i&&delete i.bufferedData,i.failed=!0,i.timedOut=Boolean(u),i.isCanceled=l,i.killed=c&&!u,i})},{"human-signals":306}],333:[function(e,t,r){"use strict";const n=e("os"),i=e("signal-exit"),s=(e,t,r,n)=>{if(!o(t,r,n))return;const i=u(r),s=setTimeout(()=>{e("SIGKILL")},i);s.unref&&s.unref()},o=(e,{forceKillAfterTimeout:t},r)=>a(e)&&!1!==t&&r,a=e=>e===n.constants.signals.SIGTERM||"string"==typeof e&&"SIGTERM"===e.toUpperCase(),u=({forceKillAfterTimeout:e=!0})=>{if(!0===e)return 5e3;if(!Number.isFinite(e)||e<0)throw new TypeError(`Expected the \`forceKillAfterTimeout\` option to be a non-negative integer, got \`${e}\` (${typeof e})`);return e};var l,c;t.exports={spawnedKill:(e,t="SIGTERM",r={})=>{const n=e(t);return s(e,t,r,n),n},spawnedCancel:(e,t)=>{e.kill()&&(t.isCanceled=!0)},setupTimeout:(e,{timeout:t,killSignal:r="SIGTERM"},n)=>{if(0===t||void 0===t)return n;if(!Number.isFinite(t)||t<0)throw new TypeError(`Expected the \`timeout\` option to be a non-negative integer, got \`${t}\` (${typeof t})`);let i;const s=new Promise((n,s)=>{i=setTimeout(()=>{l=r,s=s,e.kill(l),s(Object.assign(new Error("Timed out"),{timedOut:!0,signal:l}))},t)}),o=n.finally(()=>{clearTimeout(i)});return Promise.race([s,o])},setExitHandler:async(e,{cleanup:t,detached:r},n)=>{if(!t||r)return n;const s=i(()=>{e.kill()});return n.finally(()=>{s()})}}},{os:293,"signal-exit":514}],334:[function(e,t,r){"use strict";const n=(async()=>{})().constructor.prototype,i=["then","catch","finally"].map(e=>[e,Reflect.getOwnPropertyDescriptor(n,e)]);t.exports={mergePromise:(e,t)=>{for(const[r,n]of i){const i="function"==typeof t?(...e)=>Reflect.apply(n.value,t(),e):n.value.bind(t);Reflect.defineProperty(e,r,{...n,value:i})}return e},getSpawnedPromise:e=>new Promise((t,r)=>{e.on("exit",(e,r)=>{t({exitCode:e,signal:r})}),e.on("error",e=>{r(e)}),e.stdin&&e.stdin.on("error",e=>{r(e)})})}},{}],335:[function(e,t,r){"use strict";const n=["stdin","stdout","stderr"],i=e=>{if(!e)return;const{stdio:t}=e;if(void 0===t)return n.map(t=>e[t]);if((e=>n.some(t=>void 0!==e[t]))(e))throw new Error(`It's not possible to provide \`stdio\` in combination with one of ${n.map(e=>`\`${e}\``).join(", ")}`);if("string"==typeof t)return t;if(!Array.isArray(t))throw new TypeError(`Expected \`stdio\` to be of type \`string\` or \`Array\`, got \`${typeof t}\``);const r=Math.max(t.length,n.length);return Array.from({length:r},(e,r)=>t[r])};t.exports=i,t.exports.node=(e=>{const t=i(e);return"ipc"===t?"ipc":void 0===t||"string"==typeof t?[t,t,t,"ipc"]:t.includes("ipc")?t:[...t,"ipc"]})},{}],336:[function(e,t,r){"use strict";const n=e("is-stream"),i=e("get-stream"),s=e("merge-stream"),o=async(e,t)=>{if(e){e.destroy();try{return await t}catch(e){return e.bufferedData}}},a=(e,{encoding:t,buffer:r,maxBuffer:n})=>{if(e&&r)return t?i(e,{encoding:t,maxBuffer:n}):i.buffer(e,{maxBuffer:n})};t.exports={handleInput:(e,t)=>{void 0!==t&&void 0!==e.stdin&&(n(t)?t.pipe(e.stdin):e.stdin.end(t))},makeAllStream:(e,{all:t})=>{if(!t||!e.stdout&&!e.stderr)return;const r=s();return e.stdout&&r.add(e.stdout),e.stderr&&r.add(e.stderr),r},getSpawnedResult:async({stdout:e,stderr:t,all:r},{encoding:n,buffer:i,maxBuffer:s},u)=>{const l=a(e,{encoding:n,buffer:i,maxBuffer:s}),c=a(t,{encoding:n,buffer:i,maxBuffer:s}),h=a(r,{encoding:n,buffer:i,maxBuffer:2*s});try{return await Promise.all([u,l,c,h])}catch(n){return Promise.all([{error:n,signal:n.signal,timedOut:n.timedOut},o(e,l),o(t,c),o(r,h)])}},validateInputSync:({input:e})=>{if(n(e))throw new TypeError("The `input` option cannot be a stream in sync mode")}}},{"get-stream":338,"is-stream":339,"merge-stream":369}],337:[function(e,t,r){(function(r){"use strict";const{PassThrough:n}=e("stream");t.exports=(e=>{e={...e};const{array:t}=e;let{encoding:i}=e;const s="buffer"===i;let o=!1;t?o=!(i||s):i=i||"utf8",s&&(i=null);const a=new n({objectMode:o});i&&a.setEncoding(i);let u=0;const l=[];return a.on("data",e=>{l.push(e),o?u=l.length:u+=e.length}),a.getBufferedValue=(()=>t?l:s?r.concat(l,u):l.join("")),a.getBufferedLength=(()=>u),a})}).call(this,e("buffer").Buffer)},{buffer:291,stream:518}],338:[function(e,t,r){"use strict";const{constants:n}=e("buffer"),i=e("pump"),s=e("./buffer-stream");class o extends Error{constructor(){super("maxBuffer exceeded"),this.name="MaxBufferError"}}async function a(e,t){if(!e)return Promise.reject(new Error("Expected a stream"));t={maxBuffer:1/0,...t};const{maxBuffer:r}=t;let a;return await new Promise((u,l)=>{const c=e=>{e&&a.getBufferedLength()<=n.MAX_LENGTH&&(e.bufferedData=a.getBufferedValue()),l(e)};(a=i(e,s(t),e=>{e?c(e):u()})).on("data",()=>{a.getBufferedLength()>r&&c(new o)})}),a.getBufferedValue()}t.exports=a,t.exports.default=a,t.exports.buffer=((e,t)=>a(e,{...t,encoding:"buffer"})),t.exports.array=((e,t)=>a(e,{...t,array:!0})),t.exports.MaxBufferError=o},{"./buffer-stream":337,buffer:291,pump:455}],339:[function(e,t,r){"use strict";const n=e=>null!==e&&"object"==typeof e&&"function"==typeof e.pipe;n.writable=(e=>n(e)&&!1!==e.writable&&"function"==typeof e._write&&"object"==typeof e._writableState),n.readable=(e=>n(e)&&!1!==e.readable&&"function"==typeof e._read&&"object"==typeof e._readableState),n.duplex=(e=>n.writable(e)&&n.readable(e)),n.transform=(e=>n.duplex(e)&&"function"==typeof e._transform&&"object"==typeof e._transformState),t.exports=n},{}],340:[function(e,t,r){(function(r){"use strict";const n=e("path"),i=e("path-key"),s=e=>{let t;e={cwd:r.cwd(),path:r.env[i()],execPath:r.execPath,...e};let s=n.resolve(e.cwd);const o=[];for(;t!==s;)o.push(n.join(s,"node_modules/.bin")),t=s,s=n.resolve(s,"..");const a=n.resolve(e.cwd,e.execPath,"..");return o.push(a),o.concat(e.path).join(n.delimiter)};t.exports=s,t.exports.default=s,t.exports.env=(e=>{const n={...(e={env:r.env,...e}).env},s=i({env:n});return e.path=n[s],n[s]=t.exports(e),n})}).call(this,e("_process"))},{_process:452,path:397,"path-key":341}],341:[function(e,t,r){(function(e){"use strict";const r=(t={})=>{const r=t.env||e.env;return"win32"!==(t.platform||e.platform)?"PATH":Object.keys(r).reverse().find(e=>"PATH"===e.toUpperCase())||"Path"};t.exports=r,t.exports.default=r}).call(this,e("_process"))},{_process:452}],342:[function(e,t,r){"use strict";const n=e("shebang-regex");t.exports=((e="")=>{const t=e.match(n);if(!t)return null;const[r,i]=t[0].replace(/#! ?/,"").split(" "),s=r.split("/").pop();return"env"===s?i:i?`${s} ${i}`:s})},{"shebang-regex":343}],343:[function(e,t,r){"use strict";t.exports=/^#!(.*)/},{}],344:[function(e,t,r){(function(r){const n="win32"===r.platform||"cygwin"===r.env.OSTYPE||"msys"===r.env.OSTYPE,i=e("path"),s=n?";":":",o=e("isexe"),a=e=>Object.assign(new Error(`not found: ${e}`),{code:"ENOENT"}),u=(e,t)=>{const i=t.colon||s,o=e.match(/\//)||n&&e.match(/\\/)?[""]:[...n?[r.cwd()]:[],...(t.path||r.env.PATH||"").split(i)],a=n?t.pathExt||r.env.PATHEXT||".EXE;.CMD;.BAT;.COM":"",u=n?a.split(i):[""];return n&&-1!==e.indexOf(".")&&""!==u[0]&&u.unshift(""),{pathEnv:o,pathExt:u,pathExtExe:a}},l=(e,t,r)=>{"function"==typeof t&&(r=t,t={}),t||(t={});const{pathEnv:n,pathExt:s,pathExtExe:l}=u(e,t),c=[],h=r=>new Promise((s,o)=>{if(r===n.length)return t.all&&c.length?s(c):o(a(e));const u=n[r],l=/^".*"$/.test(u)?u.slice(1,-1):u,h=i.join(l,e),f=!l&&/^\.[\\\/]/.test(e)?e.slice(0,2)+h:h;s(p(f,r,0))}),p=(e,r,n)=>new Promise((i,a)=>{if(n===s.length)return i(h(r+1));const u=s[n];o(e+u,{pathExt:l},(s,o)=>{if(!s&&o){if(!t.all)return i(e+u);c.push(e+u)}return i(p(e,r,n+1))})});return r?h(0).then(e=>r(null,e),r):h(0)};t.exports=l,l.sync=((e,t)=>{t=t||{};const{pathEnv:r,pathExt:n,pathExtExe:s}=u(e,t),l=[];for(let a=0;a{if(!Array.isArray(e))throw new TypeError(`Expected an \`Array\`, got \`${typeof e}\``);const n=t?await a(e,{onlyFiles:!0}):e;return Promise.all(n.filter(e=>h.not(i.basename(e))).map(async t=>{try{return await(async(e,{destination:t,plugins:r=[]})=>{if(r&&!Array.isArray(r))throw new TypeError("The `plugins` option should be an `Array`");let n=await p(e);n=await(r.length>0?l(...r)(n):n);let s=t?i.join(t,i.basename(e)):void 0;const a={data:n,sourcePath:e,destinationPath:s=o(n)&&"webp"===o(n).ext?c(s,".webp"):s};return s?(await u(i.dirname(a.destinationPath)),await f(a.destinationPath,a.data),a):a})(t,r)}catch(t){throw t.message=`Error occurred when handling file: ${e}\n\n${t.stack}`,t}}))}),t.exports.buffer=(async(e,{plugins:t=[]}={})=>{if(!r.isBuffer(e))throw new TypeError(`Expected a \`Buffer\`, got \`${typeof e}\``);return 0===t.length?e:l(...t)(e)})}).call(this,{isBuffer:e("../is-buffer/index.js")})},{"../is-buffer/index.js":350,"file-type":98,globby:159,"graceful-fs":281,junk:364,"make-dir":367,"p-pipe":396,path:397,"replace-ext":503,util:538}],346:[function(e,t,r){"use strict";const n=(e,t,r)=>void 0===e?t(r):e;t.exports=(e=>t=>{let r;return new Proxy(function(){},{get:(i,s)=>(r=n(r,e,t),Reflect.get(r,s)),apply:(i,s,o)=>(r=n(r,e,t),Reflect.apply(r,s,o)),construct:(i,s)=>(r=n(r,e,t),Reflect.construct(r,s))})})},{}],347:[function(e,t,r){(function(r){var n=e("wrappy"),i=Object.create(null),s=e("once");t.exports=n(function(e,t){return i[e]?(i[e].push(t),null):(i[e]=[t],function(e){return s(function t(){var n=i[e],s=n.length,o=function(e){for(var t=e.length,r=[],n=0;ns?(n.splice(0,s),r.nextTick(function(){t.apply(null,o)})):delete i[e]}})}(e))})}).call(this,e("_process"))},{_process:452,once:392,wrappy:546}],348:[function(e,t,r){arguments[4][285][0].apply(r,arguments)},{dup:285}],349:[function(e,t,r){"use strict";t.exports=function(e){for(var t=new Array(e),r=0;r!(!e||e.length<3)&&(255===e[0]&&216===e[1]&&255===e[2]))},{}],354:[function(e,t,r){"use strict";t.exports=(e=>!(!e||e.length<8)&&(137===e[0]&&80===e[1]&&78===e[2]&&71===e[3]&&13===e[4]&&10===e[5]&&26===e[6]&&10===e[7]))},{}],355:[function(e,t,r){"use strict";var n=t.exports=function(e){return null!==e&&"object"==typeof e&&"function"==typeof e.pipe};n.writable=function(e){return n(e)&&!1!==e.writable&&"function"==typeof e._write&&"object"==typeof e._writableState},n.readable=function(e){return n(e)&&!1!==e.readable&&"function"==typeof e._read&&"object"==typeof e._readableState},n.duplex=function(e){return n.writable(e)&&n.readable(e)},n.transform=function(e){return n.duplex(e)&&"function"==typeof e._transform&&"object"==typeof e._transformState}},{}],356:[function(e,t,r){t.exports=Array.isArray||function(e){return"[object Array]"==Object.prototype.toString.call(e)}},{}],357:[function(e,t,r){(function(r,n){var i;e("fs");function s(e,t,r){if("function"==typeof t&&(r=t,t={}),!r){if("function"!=typeof Promise)throw new TypeError("callback not provided");return new Promise(function(r,n){s(e,t||{},function(e,t){e?n(e):r(t)})})}i(e,t||{},function(e,n){e&&("EACCES"===e.code||t&&t.ignoreErrors)&&(e=null,n=!1),r(e,n)})}i="win32"===r.platform||n.TESTING_WINDOWS?e("./windows.js"):e("./mode.js"),t.exports=s,s.sync=function(e,t){try{return i.sync(e,t||{})}catch(e){if(t&&t.ignoreErrors||"EACCES"===e.code)return!1;throw e}}}).call(this,e("_process"),"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"./mode.js":358,"./windows.js":359,_process:452,fs:290}],358:[function(e,t,r){(function(r){t.exports=i,i.sync=function(e,t){return s(n.statSync(e),t)};var n=e("fs");function i(e,t,r){n.stat(e,function(e,n){r(e,!e&&s(n,t))})}function s(e,t){return e.isFile()&&function(e,t){var n=e.mode,i=e.uid,s=e.gid,o=void 0!==t.uid?t.uid:r.getuid&&r.getuid(),a=void 0!==t.gid?t.gid:r.getgid&&r.getgid(),u=parseInt("100",8),l=parseInt("010",8),c=parseInt("001",8);return n&c||n&l&&s===a||n&u&&i===o||n&(u|l)&&0===o}(e,t)}}).call(this,e("_process"))},{_process:452,fs:290}],359:[function(e,t,r){(function(r){t.exports=s,s.sync=function(e,t){return i(n.statSync(e),e,t)};var n=e("fs");function i(e,t,n){return!(!e.isSymbolicLink()&&!e.isFile())&&function(e,t){var n=void 0!==t.pathExt?t.pathExt:r.env.PATHEXT;if(!n)return!0;if(-1!==(n=n.split(";")).indexOf(""))return!0;for(var i=0;i0&&!e[o-1];)o--;s.push({children:[],index:0});var a,u=s[0];for(r=0;r0;){if(0===s.length)throw new Error("Could not recreate Huffman Table");u=s.pop()}for(u.index++,s.push(u);s.length<=r;)s.push(a={children:[],index:0}),u.children[u.index]=a.children,u=a;i++}r+10)return d>>--m&1;if(255==(d=t[r++])){var e=t[r++];if(e)throw new Error("unexpected marker: "+(d<<8|e).toString(16))}return m=7,d>>>7}function v(e){for(var t,r=e;null!==(t=g());){if("number"==typeof(r=r[t]))return r;if("object"!=typeof r)throw new Error("invalid huffman sequence")}return null}function y(e){for(var t=0;e>0;){var r=g();if(null===r)return;t=t<<1|r,e--}return t}function _(e){var t=y(e);return t>=1<0)b--;else for(var n=o,i=a;n<=i;){var s=v(t.huffmanTableAC),u=15&s,c=s>>4;if(0!==u)r[e[n+=c]]=_(u)*(1<>4,0===p)s<15?(b=y(s)+(1<>4;if(0!==a)r[e[s+=u]]=_(a),s++;else{if(u<15)break;s+=16}}};var L,P,M,B,N=0;for(P=1==O?i[0].blocksPerLine*i[0].blocksPerColumn:h*n.mcusPerColumn,s||(s=P);N=65488&&L<=65495))break;r+=2}return r-f}function p(e,l){var c,h,p=[],f=l.blocksPerLine,d=l.blocksPerColumn,m=f<<3,v=new Int32Array(64),y=new Uint8Array(64);function _(e,c,h){var p,f,d,m,g,v,y,_,b,x,w=l.quantizationTable,E=h;for(x=0;x<64;x++)E[x]=e[x]*w[x];for(x=0;x<8;++x){var T=8*x;0!=E[1+T]||0!=E[2+T]||0!=E[3+T]||0!=E[4+T]||0!=E[5+T]||0!=E[6+T]||0!=E[7+T]?(p=a*E[0+T]+128>>8,f=a*E[4+T]+128>>8,d=E[2+T],m=E[6+T],g=u*(E[1+T]-E[7+T])+128>>8,_=u*(E[1+T]+E[7+T])+128>>8,v=E[3+T]<<4,y=E[5+T]<<4,b=p-f+1>>1,p=p+f+1>>1,f=b,b=d*o+m*s+128>>8,d=d*s-m*o+128>>8,m=b,b=g-y+1>>1,g=g+y+1>>1,y=b,b=_+v+1>>1,v=_-v+1>>1,_=b,b=p-m+1>>1,p=p+m+1>>1,m=b,b=f-d+1>>1,f=f+d+1>>1,d=b,b=g*i+_*n+2048>>12,g=g*n-_*i+2048>>12,_=b,b=v*r+y*t+2048>>12,v=v*t-y*r+2048>>12,y=b,E[0+T]=p+_,E[7+T]=p-_,E[1+T]=f+y,E[6+T]=f-y,E[2+T]=d+v,E[5+T]=d-v,E[3+T]=m+g,E[4+T]=m-g):(b=a*E[0+T]+512>>10,E[0+T]=b,E[1+T]=b,E[2+T]=b,E[3+T]=b,E[4+T]=b,E[5+T]=b,E[6+T]=b,E[7+T]=b)}for(x=0;x<8;++x){var A=x;0!=E[8+A]||0!=E[16+A]||0!=E[24+A]||0!=E[32+A]||0!=E[40+A]||0!=E[48+A]||0!=E[56+A]?(p=a*E[0+A]+2048>>12,f=a*E[32+A]+2048>>12,d=E[16+A],m=E[48+A],g=u*(E[8+A]-E[56+A])+2048>>12,_=u*(E[8+A]+E[56+A])+2048>>12,v=E[24+A],y=E[40+A],b=p-f+1>>1,p=p+f+1>>1,f=b,b=d*o+m*s+2048>>12,d=d*s-m*o+2048>>12,m=b,b=g-y+1>>1,g=g+y+1>>1,y=b,b=_+v+1>>1,v=_-v+1>>1,_=b,b=p-m+1>>1,p=p+m+1>>1,m=b,b=f-d+1>>1,f=f+d+1>>1,d=b,b=g*i+_*n+2048>>12,g=g*n-_*i+2048>>12,_=b,b=v*r+y*t+2048>>12,v=v*t-y*r+2048>>12,y=b,E[0+A]=p+_,E[56+A]=p-_,E[8+A]=f+y,E[48+A]=f-y,E[16+A]=d+v,E[40+A]=d-v,E[24+A]=m+g,E[32+A]=m-g):(b=a*h[x+0]+8192>>14,E[0+A]=b,E[8+A]=b,E[16+A]=b,E[24+A]=b,E[32+A]=b,E[40+A]=b,E[48+A]=b,E[56+A]=b)}for(x=0;x<64;++x){var S=128+(E[x]+8>>4);c[x]=S<0?0:S>255?255:S}}g(m*d*8);for(var b=0;b255?255:e}l.prototype={load:function(e){var t=new XMLHttpRequest;t.open("GET",e,!0),t.responseType="arraybuffer",t.onload=function(){var e=new Uint8Array(t.response||t.mozResponseArrayBuffer);this.parse(e),this.onload&&this.onload()}.bind(this),t.send(null)},parse:function(t){var r=1e3*this.opts.maxResolutionInMP*1e3,n=0;t.length;function i(){var e=t[n]<<8|t[n+1];return n+=2,e}function s(){var e=i(),r=t.subarray(n,n+e-2);return n+=r.length,r}function o(e){var t,r,n=0,i=0;for(r in e.components)e.components.hasOwnProperty(r)&&(n<(t=e.components[r]).h&&(n=t.h),i>4==0)for(K=0;K<64;K++){A[e[K]]=t[n++]}else{if(T>>4!=1)throw new Error("DQT: invalid table spec");for(K=0;K<64;K++){A[e[K]]=i()}}d[15&T]=A}break;case 65472:case 65473:case 65474:i(),(a={}).extended=65473===_,a.progressive=65474===_,a.precision=t[n++],a.scanLines=i(),a.samplesPerLine=i(),a.components={},a.componentsOrder=[];var S=a.scanLines*a.samplesPerLine;if(S>r){var k=Math.ceil((S-r)/1e6);throw new Error(`maxResolutionInMP limit exceeded by ${k}MP`)}var C,I=t[n++];for(W=0;W>4,O=15&t[n+1],L=t[n+2];a.componentsOrder.push(C),a.components[C]={h:R,v:O,quantizationIdx:L},n+=3}o(a),m.push(a);break;case 65476:var P=i();for(W=2;W>4==0?y:v)[15&M]=c(B,D)}break;case 65501:i(),u=i();break;case 65500:i(),i();break;case 65498:i();var F=t[n++],j=[];for(W=0;W>4],q.huffmanTableAC=v[15&U],j.push(q)}var $=t[n++],V=t[n++],G=t[n++],z=h(t,n,a,j,u,$,V,G>>4,15&G,this.opts);n+=z;break;case 65535:255!==t[n]&&n--;break;default:if(255==t[n-3]&&t[n-2]>=192&&t[n-2]<=254){n-=3;break}if(224===_||225==_){if(-1!==b)throw new Error(`first unknown JPEG marker at offset ${b.toString(16)}, second unknown JPEG marker ${_.toString(16)} at offset ${(n-1).toString(16)}`);b=n-1;const e=i();if(255===t[n+e-2]){n+=e-2;break}}throw new Error("unknown JPEG marker "+_.toString(16))}_=i()}if(1!=m.length)throw new Error("only single frame JPEGs supported");for(var W=0;Wm){var r=Math.ceil((t-m)/1024/1024);throw new Error(`maxMemoryUsageInMB limit exceeded by at least ${r}MB`)}d=t}return l.resetMaxMemoryUsage=function(e){d=0,m=e},l.getBytesAllocated=function(){return d},l.requestMemoryAllocation=g,l}();function n(t,n={}){var i={...{colorTransform:void 0,useTArray:!1,formatAsRGBA:!0,tolerantDecoding:!0,maxResolutionInMP:100,maxMemoryUsageInMB:512},...n},s=new Uint8Array(t),o=new r;o.opts=i,r.resetMaxMemoryUsage(1024*i.maxMemoryUsageInMB*1024),o.parse(s);var a=i.formatAsRGBA?4:3,u=o.width*o.height*a;try{r.requestMemoryAllocation(u);var l={width:o.width,height:o.height,exifBuffer:o.exifBuffer,data:i.useTArray?new Uint8Array(u):e.alloc(u)};o.comments.length>0&&(l.comments=o.comments)}catch(e){throw e instanceof RangeError?new Error("Could not allocate enough memory for the image. Required: "+u):e}return o.copyToImageData(l,i.formatAsRGBA),l}void 0!==t?t.exports=n:"undefined"!=typeof window&&(window["jpeg-js"]=window["jpeg-js"]||{},window["jpeg-js"].decode=n)}).call(this,e("buffer").Buffer)},{buffer:291}],362:[function(e,t,r){(function(e){function r(r){Math.round;var n,i,s,o,a,u=Math.floor,l=new Array(64),c=new Array(64),h=new Array(64),p=new Array(64),f=new Array(65535),d=new Array(65535),m=new Array(64),g=new Array(64),v=[],y=0,_=7,b=new Array(64),x=new Array(64),w=new Array(64),E=new Array(256),T=new Array(2048),A=[0,1,5,6,14,15,27,28,2,4,7,13,16,26,29,42,3,8,12,17,25,30,41,43,9,11,18,24,31,40,44,53,10,19,23,32,39,45,52,54,20,22,33,38,46,51,55,60,21,34,37,47,50,56,59,61,35,36,48,49,57,58,62,63],S=[0,0,1,5,1,1,1,1,1,1,0,0,0,0,0,0,0],k=[0,1,2,3,4,5,6,7,8,9,10,11],C=[0,0,2,1,3,3,2,4,3,5,5,4,4,0,0,1,125],I=[1,2,3,0,4,17,5,18,33,49,65,6,19,81,97,7,34,113,20,50,129,145,161,8,35,66,177,193,21,82,209,240,36,51,98,114,130,9,10,22,23,24,25,26,37,38,39,40,41,42,52,53,54,55,56,57,58,67,68,69,70,71,72,73,74,83,84,85,86,87,88,89,90,99,100,101,102,103,104,105,106,115,116,117,118,119,120,121,122,131,132,133,134,135,136,137,138,146,147,148,149,150,151,152,153,154,162,163,164,165,166,167,168,169,170,178,179,180,181,182,183,184,185,186,194,195,196,197,198,199,200,201,202,210,211,212,213,214,215,216,217,218,225,226,227,228,229,230,231,232,233,234,241,242,243,244,245,246,247,248,249,250],R=[0,0,3,1,1,1,1,1,1,1,1,1,0,0,0,0,0],O=[0,1,2,3,4,5,6,7,8,9,10,11],L=[0,0,2,1,2,4,4,3,4,7,5,4,4,0,1,2,119],P=[0,1,2,3,17,4,5,33,49,6,18,65,81,7,97,113,19,34,50,129,8,20,66,145,161,177,193,9,35,51,82,240,21,98,114,209,10,22,36,52,225,37,241,23,24,25,26,38,39,40,41,42,53,54,55,56,57,58,67,68,69,70,71,72,73,74,83,84,85,86,87,88,89,90,99,100,101,102,103,104,105,106,115,116,117,118,119,120,121,122,130,131,132,133,134,135,136,137,138,146,147,148,149,150,151,152,153,154,162,163,164,165,166,167,168,169,170,178,179,180,181,182,183,184,185,186,194,195,196,197,198,199,200,201,202,210,211,212,213,214,215,216,217,218,226,227,228,229,230,231,232,233,234,242,243,244,245,246,247,248,249,250];function M(e,t){for(var r=0,n=0,i=new Array,s=1;s<=16;s++){for(var o=1;o<=e[s];o++)i[t[n]]=[],i[t[n]][0]=r,i[t[n]][1]=s,n++,r++;r*=2}return i}function B(e){for(var t=e[0],r=e[1]-1;r>=0;)t&1<>8&255),N(255&e)}function F(e,t,r,n,i){for(var s,o=i[0],a=i[240],u=function(e,t){var r,n,i,s,o,a,u,l,c,h,p=0;for(c=0;c<8;++c){r=e[p],n=e[p+1],i=e[p+2],s=e[p+3],o=e[p+4],a=e[p+5],u=e[p+6];var f=r+(l=e[p+7]),d=r-l,g=n+u,v=n-u,y=i+a,_=i-a,b=s+o,x=s-o,w=f+b,E=f-b,T=g+y,A=g-y;e[p]=w+T,e[p+4]=w-T;var S=.707106781*(A+E);e[p+2]=E+S,e[p+6]=E-S;var k=.382683433*((w=x+_)-(A=v+d)),C=.5411961*w+k,I=1.306562965*A+k,R=.707106781*(T=_+v),O=d+R,L=d-R;e[p+5]=L+C,e[p+3]=L-C,e[p+1]=O+I,e[p+7]=O-I,p+=8}for(p=0,c=0;c<8;++c){r=e[p],n=e[p+8],i=e[p+16],s=e[p+24],o=e[p+32],a=e[p+40],u=e[p+48];var P=r+(l=e[p+56]),M=r-l,B=n+u,N=n-u,D=i+a,F=i-a,j=s+o,U=s-o,$=P+j,V=P-j,G=B+D,z=B-D;e[p]=$+G,e[p+32]=$-G;var W=.707106781*(z+V);e[p+16]=V+W,e[p+48]=V-W;var H=.382683433*(($=U+F)-(z=N+M)),K=.5411961*$+H,q=1.306562965*z+H,X=.707106781*(G=F+N),Y=M+X,Z=M-X;e[p+40]=Z+K,e[p+24]=Z-K,e[p+8]=Y+q,e[p+56]=Y-q,p++}for(c=0;c<64;++c)h=e[c]*t[c],m[c]=h>0?h+.5|0:h-.5|0;return m}(e,t),l=0;l<64;++l)g[A[l]]=u[l];var c=g[0]-r;r=g[0],0==c?B(n[0]):(B(n[d[s=32767+c]]),B(f[s]));for(var h=63;h>0&&0==g[h];h--);if(0==h)return B(o),r;for(var p,v=1;v<=h;){for(var y=v;0==g[v]&&v<=h;++v);var _=v-y;if(_>=16){p=_>>4;for(var b=1;b<=p;++b)B(a);_&=15}s=32767+g[v],B(i[(_<<4)+d[s]]),B(f[s]),v++}return 63!=h&&B(o),r}function j(e){if(e<=0&&(e=1),e>100&&(e=100),a!=e){(function(e){for(var t=[16,11,10,16,24,40,51,61,12,12,14,19,26,58,60,55,14,13,16,24,40,57,69,56,14,17,22,29,51,87,80,62,18,22,37,56,68,109,103,77,24,35,55,64,81,104,113,92,49,64,78,87,103,121,120,101,72,92,95,98,112,100,103,99],r=0;r<64;r++){var n=u((t[r]*e+50)/100);n<1?n=1:n>255&&(n=255),l[A[r]]=n}for(var i=[17,18,24,47,99,99,99,99,18,21,26,66,99,99,99,99,24,26,56,99,99,99,99,99,47,66,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99],s=0;s<64;s++){var o=u((i[s]*e+50)/100);o<1?o=1:o>255&&(o=255),c[A[s]]=o}for(var a=[1,1.387039845,1.306562965,1.175875602,1,.785694958,.5411961,.275899379],f=0,d=0;d<8;d++)for(var m=0;m<8;m++)h[f]=1/(l[A[f]]*a[d]*a[m]*8),p[f]=1/(c[A[f]]*a[d]*a[m]*8),f++})(e<50?Math.floor(5e3/e):Math.floor(200-2*e)),a=e}}this.encode=function(r,a){(new Date).getTime();a&&j(a),v=new Array,y=0,_=7,D(65496),D(65504),D(16),N(74),N(70),N(73),N(70),N(0),N(1),N(1),N(0),D(1),D(1),N(0),N(0),function(e){if(e){D(65505),69===e[0]&&120===e[1]&&105===e[2]&&102===e[3]?D(e.length+2):(D(e.length+5+2),N(69),N(120),N(105),N(102),N(0));for(var t=0;t>3)*K+($=4*(7&G)),q+V>=H&&(U-=K*(q+1+V-H)),m+$>=K&&(U-=m+$-K+4),g=z[U++],E=z[U++],A=z[U++],b[G]=(T[g]+T[E+256>>0]+T[A+512>>0]>>16)-128,x[G]=(T[g+768>>0]+T[E+1024>>0]+T[A+1280>>0]>>16)-128,w[G]=(T[g+1280>>0]+T[E+1536>>0]+T[A+1792>>0]>>16)-128;u=F(b,h,u,n,s),f=F(x,p,f,i,o),d=F(w,p,d,i,o),m+=32}q+=8}if(_>=0){var X=[];X[1]=_+1,X[0]=(1<<_+1)-1,B(X)}return D(65497),void 0===t?new Uint8Array(v):e.from(v)},function(){(new Date).getTime();r||(r=50),function(){for(var e=String.fromCharCode,t=0;t<256;t++)E[t]=e(t)}(),n=M(S,k),i=M(R,O),s=M(C,I),o=M(L,P),function(){for(var e=1,t=2,r=1;r<=15;r++){for(var n=e;n>0]=38470*e,T[e+512>>0]=7471*e+32768,T[e+768>>0]=-11059*e,T[e+1024>>0]=-21709*e,T[e+1280>>0]=32768*e+8421375,T[e+1536>>0]=-27439*e,T[e+1792>>0]=-5329*e}(),j(r),(new Date).getTime()}()}function n(e,t){return void 0===t&&(t=50),{data:new r(t).encode(e,t),width:e.width,height:e.height}}void 0!==t?t.exports=n:"undefined"!=typeof window&&(window["jpeg-js"]=window["jpeg-js"]||{},window["jpeg-js"].encode=n)}).call(this,e("buffer").Buffer)},{buffer:291}],363:[function(e,t,r){var n,i;n="undefined"!=typeof self?self:this,i=function(){return function(e){var t={};function r(n){if(t[n])return t[n].exports;var i=t[n]={i:n,l:!1,exports:{}};return e[n].call(i.exports,i,i.exports,r),i.l=!0,i.exports}return r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{configurable:!1,enumerable:!0,get:n})},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=3)}([function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=function(){function e(e,t){this.width=t,this.height=e.length/t,this.data=e}return e.createEmpty=function(t,r){return new e(new Uint8ClampedArray(t*r),t)},e.prototype.get=function(e,t){return!(e<0||e>=this.width||t<0||t>=this.height)&&!!this.data[t*this.width+e]},e.prototype.set=function(e,t,r){this.data[t*this.width+e]=r?1:0},e.prototype.setRegion=function(e,t,r,n,i){for(var s=t;s=this.size&&(i=(i^this.primitive)&this.size-1);for(s=0;s1&&0===t[0]){for(var n=1;ns.length&&(i=(r=[s,i])[0],s=r[1]);for(var o=new Uint8ClampedArray(s.length),a=s.length-i.length,u=0;ur?r:e}var a=function(){function e(e,t){this.width=e,this.data=new Uint8ClampedArray(e*t)}return e.prototype.get=function(e,t){return this.data[t*this.width+e]},e.prototype.set=function(e,t,r){this.data[t*this.width+e]=r},e}();t.binarize=function(e,t,r,u){if(e.length!==t*r*4)throw new Error("Malformed data passed to binarizer.");for(var l=new a(t,r),c=0;c0&&_>0)){var A=(v.get(_,y-1)+2*v.get(_-1,y)+v.get(_-1,y-1))/4;x6&&(r.setRegion(t-11,0,3,6,!0),r.setRegion(0,t-11,6,3,!0)),r}(t),a=[],l=0,h=0,p=!0,f=s-1;f>0;f-=2){6===f&&f--;for(var d=0;d=0;i--)for(var s=t-9;s>=t-11;s--)n=u(e.get(s,i),n);var l=0;for(s=5;s>=0;s--)for(i=t-9;i>=t-11;i--)l=u(e.get(s,i),l);for(var c,h=1/0,p=0,f=o.VERSIONS;p=0;n--)6!==n&&(t=u(e.get(8,n),t));var i=e.height,s=0;for(n=i-1;n>=i-7;n--)s=u(e.get(8,n),s);for(r=i-8;r1){var c=n.ecBlocks[0].numBlocks,h=n.ecBlocks[1].numBlocks;for(a=0;a0;)for(var p=0,f=i;p=3;){if((l=e.readBits(10))>=1e3)throw new Error("Invalid numeric value above 999");var o=Math.floor(l/100),a=Math.floor(l/10)%10,u=l%10;r.push(48+o,48+a,48+u),n+=o.toString()+a.toString()+u.toString(),s-=3}if(2===s){if((l=e.readBits(7))>=100)throw new Error("Invalid numeric value above 99");o=Math.floor(l/10),a=l%10;r.push(48+o,48+a),n+=o.toString()+a.toString()}else if(1===s){var l;if((l=e.readBits(4))>=10)throw new Error("Invalid numeric value above 9");r.push(48+l),n+=l.toString()}return{bytes:r,text:n}}!function(e){e.Numeric="numeric",e.Alphanumeric="alphanumeric",e.Byte="byte",e.Kanji="kanji",e.ECI="eci"}(n=t.Mode||(t.Mode={})),function(e){e[e.Terminator=0]="Terminator",e[e.Numeric=1]="Numeric",e[e.Alphanumeric=2]="Alphanumeric",e[e.Byte=4]="Byte",e[e.Kanji=8]="Kanji",e[e.ECI=7]="ECI"}(i||(i={}));var u=["0","1","2","3","4","5","6","7","8","9","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"," ","$","%","*","+","-",".","/",":"];function l(e,t){for(var r=[],n="",i=[9,11,13][t],s=e.readBits(i);s>=2;){var o=e.readBits(11),a=Math.floor(o/45),l=o%45;r.push(u[a].charCodeAt(0),u[l].charCodeAt(0)),n+=u[a]+u[l],s-=2}if(1===s){a=e.readBits(6);r.push(u[a].charCodeAt(0)),n+=u[a]}return{bytes:r,text:n}}function c(e,t){for(var r=[],n="",i=[8,16,16][t],s=e.readBits(i),o=0;o>8,255&l),n+=String.fromCharCode(o.shiftJISTable[l])}return{bytes:r,text:n}}t.decode=function(e,t){for(var r,o,u,p,f=new s.BitStream(e),d=t<=9?0:t<=26?1:2,m={text:"",bytes:[],chunks:[],version:t};f.available()>=4;){var g=f.readBits(4);if(g===i.Terminator)return m;if(g===i.ECI)0===f.readBits(1)?m.chunks.push({type:n.ECI,assignmentNumber:f.readBits(7)}):0===f.readBits(1)?m.chunks.push({type:n.ECI,assignmentNumber:f.readBits(14)}):0===f.readBits(1)?m.chunks.push({type:n.ECI,assignmentNumber:f.readBits(21)}):m.chunks.push({type:n.ECI,assignmentNumber:-1});else if(g===i.Numeric){var v=a(f,d);m.text+=v.text,(r=m.bytes).push.apply(r,v.bytes),m.chunks.push({type:n.Numeric,text:v.text})}else if(g===i.Alphanumeric){var y=l(f,d);m.text+=y.text,(o=m.bytes).push.apply(o,y.bytes),m.chunks.push({type:n.Alphanumeric,text:y.text})}else if(g===i.Byte){var _=c(f,d);m.text+=_.text,(u=m.bytes).push.apply(u,_.bytes),m.chunks.push({type:n.Byte,bytes:_.bytes,text:_.text})}else if(g===i.Kanji){var b=h(f,d);m.text+=b.text,(p=m.bytes).push.apply(p,b.bytes),m.chunks.push({type:n.Kanji,bytes:b.bytes,text:b.text})}}if(0===f.available()||0===f.readBits(f.available()))return m}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=function(){function e(e){this.byteOffset=0,this.bitOffset=0,this.bytes=e}return e.prototype.readBits=function(e){if(e<1||e>32||e>this.available())throw new Error("Cannot read "+e.toString()+" bits");var t=0;if(this.bitOffset>0){var r=8-this.bitOffset,n=e>8-n<<(s=r-n);t=(this.bytes[this.byteOffset]&i)>>s,e-=n,this.bitOffset+=n,8===this.bitOffset&&(this.bitOffset=0,this.byteOffset++)}if(e>0){for(;e>=8;)t=t<<8|255&this.bytes[this.byteOffset],this.byteOffset++,e-=8;if(e>0){var s;i=255>>(s=8-e)<>s,this.bitOffset+=e}}return t},e.prototype.available=function(){return 8*(this.bytes.length-this.byteOffset)-this.bitOffset},e}();t.BitStream=n},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.shiftJISTable={32:32,33:33,34:34,35:35,36:36,37:37,38:38,39:39,40:40,41:41,42:42,43:43,44:44,45:45,46:46,47:47,48:48,49:49,50:50,51:51,52:52,53:53,54:54,55:55,56:56,57:57,58:58,59:59,60:60,61:61,62:62,63:63,64:64,65:65,66:66,67:67,68:68,69:69,70:70,71:71,72:72,73:73,74:74,75:75,76:76,77:77,78:78,79:79,80:80,81:81,82:82,83:83,84:84,85:85,86:86,87:87,88:88,89:89,90:90,91:91,92:165,93:93,94:94,95:95,96:96,97:97,98:98,99:99,100:100,101:101,102:102,103:103,104:104,105:105,106:106,107:107,108:108,109:109,110:110,111:111,112:112,113:113,114:114,115:115,116:116,117:117,118:118,119:119,120:120,121:121,122:122,123:123,124:124,125:125,126:8254,33088:12288,33089:12289,33090:12290,33091:65292,33092:65294,33093:12539,33094:65306,33095:65307,33096:65311,33097:65281,33098:12443,33099:12444,33100:180,33101:65344,33102:168,33103:65342,33104:65507,33105:65343,33106:12541,33107:12542,33108:12445,33109:12446,33110:12291,33111:20189,33112:12293,33113:12294,33114:12295,33115:12540,33116:8213,33117:8208,33118:65295,33119:92,33120:12316,33121:8214,33122:65372,33123:8230,33124:8229,33125:8216,33126:8217,33127:8220,33128:8221,33129:65288,33130:65289,33131:12308,33132:12309,33133:65339,33134:65341,33135:65371,33136:65373,33137:12296,33138:12297,33139:12298,33140:12299,33141:12300,33142:12301,33143:12302,33144:12303,33145:12304,33146:12305,33147:65291,33148:8722,33149:177,33150:215,33152:247,33153:65309,33154:8800,33155:65308,33156:65310,33157:8806,33158:8807,33159:8734,33160:8756,33161:9794,33162:9792,33163:176,33164:8242,33165:8243,33166:8451,33167:65509,33168:65284,33169:162,33170:163,33171:65285,33172:65283,33173:65286,33174:65290,33175:65312,33176:167,33177:9734,33178:9733,33179:9675,33180:9679,33181:9678,33182:9671,33183:9670,33184:9633,33185:9632,33186:9651,33187:9650,33188:9661,33189:9660,33190:8251,33191:12306,33192:8594,33193:8592,33194:8593,33195:8595,33196:12307,33208:8712,33209:8715,33210:8838,33211:8839,33212:8834,33213:8835,33214:8746,33215:8745,33224:8743,33225:8744,33226:172,33227:8658,33228:8660,33229:8704,33230:8707,33242:8736,33243:8869,33244:8978,33245:8706,33246:8711,33247:8801,33248:8786,33249:8810,33250:8811,33251:8730,33252:8765,33253:8733,33254:8757,33255:8747,33256:8748,33264:8491,33265:8240,33266:9839,33267:9837,33268:9834,33269:8224,33270:8225,33271:182,33276:9711,33359:65296,33360:65297,33361:65298,33362:65299,33363:65300,33364:65301,33365:65302,33366:65303,33367:65304,33368:65305,33376:65313,33377:65314,33378:65315,33379:65316,33380:65317,33381:65318,33382:65319,33383:65320,33384:65321,33385:65322,33386:65323,33387:65324,33388:65325,33389:65326,33390:65327,33391:65328,33392:65329,33393:65330,33394:65331,33395:65332,33396:65333,33397:65334,33398:65335,33399:65336,33400:65337,33401:65338,33409:65345,33410:65346,33411:65347,33412:65348,33413:65349,33414:65350,33415:65351,33416:65352,33417:65353,33418:65354,33419:65355,33420:65356,33421:65357,33422:65358,33423:65359,33424:65360,33425:65361,33426:65362,33427:65363,33428:65364,33429:65365,33430:65366,33431:65367,33432:65368,33433:65369,33434:65370,33439:12353,33440:12354,33441:12355,33442:12356,33443:12357,33444:12358,33445:12359,33446:12360,33447:12361,33448:12362,33449:12363,33450:12364,33451:12365,33452:12366,33453:12367,33454:12368,33455:12369,33456:12370,33457:12371,33458:12372,33459:12373,33460:12374,33461:12375,33462:12376,33463:12377,33464:12378,33465:12379,33466:12380,33467:12381,33468:12382,33469:12383,33470:12384,33471:12385,33472:12386,33473:12387,33474:12388,33475:12389,33476:12390,33477:12391,33478:12392,33479:12393,33480:12394,33481:12395,33482:12396,33483:12397,33484:12398,33485:12399,33486:12400,33487:12401,33488:12402,33489:12403,33490:12404,33491:12405,33492:12406,33493:12407,33494:12408,33495:12409,33496:12410,33497:12411,33498:12412,33499:12413,33500:12414,33501:12415,33502:12416,33503:12417,33504:12418,33505:12419,33506:12420,33507:12421,33508:12422,33509:12423,33510:12424,33511:12425,33512:12426,33513:12427,33514:12428,33515:12429,33516:12430,33517:12431,33518:12432,33519:12433,33520:12434,33521:12435,33600:12449,33601:12450,33602:12451,33603:12452,33604:12453,33605:12454,33606:12455,33607:12456,33608:12457,33609:12458,33610:12459,33611:12460,33612:12461,33613:12462,33614:12463,33615:12464,33616:12465,33617:12466,33618:12467,33619:12468,33620:12469,33621:12470,33622:12471,33623:12472,33624:12473,33625:12474,33626:12475,33627:12476,33628:12477,33629:12478,33630:12479,33631:12480,33632:12481,33633:12482,33634:12483,33635:12484,33636:12485,33637:12486,33638:12487,33639:12488,33640:12489,33641:12490,33642:12491,33643:12492,33644:12493,33645:12494,33646:12495,33647:12496,33648:12497,33649:12498,33650:12499,33651:12500,33652:12501,33653:12502,33654:12503,33655:12504,33656:12505,33657:12506,33658:12507,33659:12508,33660:12509,33661:12510,33662:12511,33664:12512,33665:12513,33666:12514,33667:12515,33668:12516,33669:12517,33670:12518,33671:12519,33672:12520,33673:12521,33674:12522,33675:12523,33676:12524,33677:12525,33678:12526,33679:12527,33680:12528,33681:12529,33682:12530,33683:12531,33684:12532,33685:12533,33686:12534,33695:913,33696:914,33697:915,33698:916,33699:917,33700:918,33701:919,33702:920,33703:921,33704:922,33705:923,33706:924,33707:925,33708:926,33709:927,33710:928,33711:929,33712:931,33713:932,33714:933,33715:934,33716:935,33717:936,33718:937,33727:945,33728:946,33729:947,33730:948,33731:949,33732:950,33733:951,33734:952,33735:953,33736:954,33737:955,33738:956,33739:957,33740:958,33741:959,33742:960,33743:961,33744:963,33745:964,33746:965,33747:966,33748:967,33749:968,33750:969,33856:1040,33857:1041,33858:1042,33859:1043,33860:1044,33861:1045,33862:1025,33863:1046,33864:1047,33865:1048,33866:1049,33867:1050,33868:1051,33869:1052,33870:1053,33871:1054,33872:1055,33873:1056,33874:1057,33875:1058,33876:1059,33877:1060,33878:1061,33879:1062,33880:1063,33881:1064,33882:1065,33883:1066,33884:1067,33885:1068,33886:1069,33887:1070,33888:1071,33904:1072,33905:1073,33906:1074,33907:1075,33908:1076,33909:1077,33910:1105,33911:1078,33912:1079,33913:1080,33914:1081,33915:1082,33916:1083,33917:1084,33918:1085,33920:1086,33921:1087,33922:1088,33923:1089,33924:1090,33925:1091,33926:1092,33927:1093,33928:1094,33929:1095,33930:1096,33931:1097,33932:1098,33933:1099,33934:1100,33935:1101,33936:1102,33937:1103,33951:9472,33952:9474,33953:9484,33954:9488,33955:9496,33956:9492,33957:9500,33958:9516,33959:9508,33960:9524,33961:9532,33962:9473,33963:9475,33964:9487,33965:9491,33966:9499,33967:9495,33968:9507,33969:9523,33970:9515,33971:9531,33972:9547,33973:9504,33974:9519,33975:9512,33976:9527,33977:9535,33978:9501,33979:9520,33980:9509,33981:9528,33982:9538,34975:20124,34976:21782,34977:23043,34978:38463,34979:21696,34980:24859,34981:25384,34982:23030,34983:36898,34984:33909,34985:33564,34986:31312,34987:24746,34988:25569,34989:28197,34990:26093,34991:33894,34992:33446,34993:39925,34994:26771,34995:22311,34996:26017,34997:25201,34998:23451,34999:22992,35000:34427,35001:39156,35002:32098,35003:32190,35004:39822,35005:25110,35006:31903,35007:34999,35008:23433,35009:24245,35010:25353,35011:26263,35012:26696,35013:38343,35014:38797,35015:26447,35016:20197,35017:20234,35018:20301,35019:20381,35020:20553,35021:22258,35022:22839,35023:22996,35024:23041,35025:23561,35026:24799,35027:24847,35028:24944,35029:26131,35030:26885,35031:28858,35032:30031,35033:30064,35034:31227,35035:32173,35036:32239,35037:32963,35038:33806,35039:34915,35040:35586,35041:36949,35042:36986,35043:21307,35044:20117,35045:20133,35046:22495,35047:32946,35048:37057,35049:30959,35050:19968,35051:22769,35052:28322,35053:36920,35054:31282,35055:33576,35056:33419,35057:39983,35058:20801,35059:21360,35060:21693,35061:21729,35062:22240,35063:23035,35064:24341,35065:39154,35066:28139,35067:32996,35068:34093,35136:38498,35137:38512,35138:38560,35139:38907,35140:21515,35141:21491,35142:23431,35143:28879,35144:32701,35145:36802,35146:38632,35147:21359,35148:40284,35149:31418,35150:19985,35151:30867,35152:33276,35153:28198,35154:22040,35155:21764,35156:27421,35157:34074,35158:39995,35159:23013,35160:21417,35161:28006,35162:29916,35163:38287,35164:22082,35165:20113,35166:36939,35167:38642,35168:33615,35169:39180,35170:21473,35171:21942,35172:23344,35173:24433,35174:26144,35175:26355,35176:26628,35177:27704,35178:27891,35179:27945,35180:29787,35181:30408,35182:31310,35183:38964,35184:33521,35185:34907,35186:35424,35187:37613,35188:28082,35189:30123,35190:30410,35191:39365,35192:24742,35193:35585,35194:36234,35195:38322,35196:27022,35197:21421,35198:20870,35200:22290,35201:22576,35202:22852,35203:23476,35204:24310,35205:24616,35206:25513,35207:25588,35208:27839,35209:28436,35210:28814,35211:28948,35212:29017,35213:29141,35214:29503,35215:32257,35216:33398,35217:33489,35218:34199,35219:36960,35220:37467,35221:40219,35222:22633,35223:26044,35224:27738,35225:29989,35226:20985,35227:22830,35228:22885,35229:24448,35230:24540,35231:25276,35232:26106,35233:27178,35234:27431,35235:27572,35236:29579,35237:32705,35238:35158,35239:40236,35240:40206,35241:40644,35242:23713,35243:27798,35244:33659,35245:20740,35246:23627,35247:25014,35248:33222,35249:26742,35250:29281,35251:20057,35252:20474,35253:21368,35254:24681,35255:28201,35256:31311,35257:38899,35258:19979,35259:21270,35260:20206,35261:20309,35262:20285,35263:20385,35264:20339,35265:21152,35266:21487,35267:22025,35268:22799,35269:23233,35270:23478,35271:23521,35272:31185,35273:26247,35274:26524,35275:26550,35276:27468,35277:27827,35278:28779,35279:29634,35280:31117,35281:31166,35282:31292,35283:31623,35284:33457,35285:33499,35286:33540,35287:33655,35288:33775,35289:33747,35290:34662,35291:35506,35292:22057,35293:36008,35294:36838,35295:36942,35296:38686,35297:34442,35298:20420,35299:23784,35300:25105,35301:29273,35302:30011,35303:33253,35304:33469,35305:34558,35306:36032,35307:38597,35308:39187,35309:39381,35310:20171,35311:20250,35312:35299,35313:22238,35314:22602,35315:22730,35316:24315,35317:24555,35318:24618,35319:24724,35320:24674,35321:25040,35322:25106,35323:25296,35324:25913,35392:39745,35393:26214,35394:26800,35395:28023,35396:28784,35397:30028,35398:30342,35399:32117,35400:33445,35401:34809,35402:38283,35403:38542,35404:35997,35405:20977,35406:21182,35407:22806,35408:21683,35409:23475,35410:23830,35411:24936,35412:27010,35413:28079,35414:30861,35415:33995,35416:34903,35417:35442,35418:37799,35419:39608,35420:28012,35421:39336,35422:34521,35423:22435,35424:26623,35425:34510,35426:37390,35427:21123,35428:22151,35429:21508,35430:24275,35431:25313,35432:25785,35433:26684,35434:26680,35435:27579,35436:29554,35437:30906,35438:31339,35439:35226,35440:35282,35441:36203,35442:36611,35443:37101,35444:38307,35445:38548,35446:38761,35447:23398,35448:23731,35449:27005,35450:38989,35451:38990,35452:25499,35453:31520,35454:27179,35456:27263,35457:26806,35458:39949,35459:28511,35460:21106,35461:21917,35462:24688,35463:25324,35464:27963,35465:28167,35466:28369,35467:33883,35468:35088,35469:36676,35470:19988,35471:39993,35472:21494,35473:26907,35474:27194,35475:38788,35476:26666,35477:20828,35478:31427,35479:33970,35480:37340,35481:37772,35482:22107,35483:40232,35484:26658,35485:33541,35486:33841,35487:31909,35488:21e3,35489:33477,35490:29926,35491:20094,35492:20355,35493:20896,35494:23506,35495:21002,35496:21208,35497:21223,35498:24059,35499:21914,35500:22570,35501:23014,35502:23436,35503:23448,35504:23515,35505:24178,35506:24185,35507:24739,35508:24863,35509:24931,35510:25022,35511:25563,35512:25954,35513:26577,35514:26707,35515:26874,35516:27454,35517:27475,35518:27735,35519:28450,35520:28567,35521:28485,35522:29872,35523:29976,35524:30435,35525:30475,35526:31487,35527:31649,35528:31777,35529:32233,35530:32566,35531:32752,35532:32925,35533:33382,35534:33694,35535:35251,35536:35532,35537:36011,35538:36996,35539:37969,35540:38291,35541:38289,35542:38306,35543:38501,35544:38867,35545:39208,35546:33304,35547:20024,35548:21547,35549:23736,35550:24012,35551:29609,35552:30284,35553:30524,35554:23721,35555:32747,35556:36107,35557:38593,35558:38929,35559:38996,35560:39e3,35561:20225,35562:20238,35563:21361,35564:21916,35565:22120,35566:22522,35567:22855,35568:23305,35569:23492,35570:23696,35571:24076,35572:24190,35573:24524,35574:25582,35575:26426,35576:26071,35577:26082,35578:26399,35579:26827,35580:26820,35648:27231,35649:24112,35650:27589,35651:27671,35652:27773,35653:30079,35654:31048,35655:23395,35656:31232,35657:32e3,35658:24509,35659:35215,35660:35352,35661:36020,35662:36215,35663:36556,35664:36637,35665:39138,35666:39438,35667:39740,35668:20096,35669:20605,35670:20736,35671:22931,35672:23452,35673:25135,35674:25216,35675:25836,35676:27450,35677:29344,35678:30097,35679:31047,35680:32681,35681:34811,35682:35516,35683:35696,35684:25516,35685:33738,35686:38816,35687:21513,35688:21507,35689:21931,35690:26708,35691:27224,35692:35440,35693:30759,35694:26485,35695:40653,35696:21364,35697:23458,35698:33050,35699:34384,35700:36870,35701:19992,35702:20037,35703:20167,35704:20241,35705:21450,35706:21560,35707:23470,35708:24339,35709:24613,35710:25937,35712:26429,35713:27714,35714:27762,35715:27875,35716:28792,35717:29699,35718:31350,35719:31406,35720:31496,35721:32026,35722:31998,35723:32102,35724:26087,35725:29275,35726:21435,35727:23621,35728:24040,35729:25298,35730:25312,35731:25369,35732:28192,35733:34394,35734:35377,35735:36317,35736:37624,35737:28417,35738:31142,35739:39770,35740:20136,35741:20139,35742:20140,35743:20379,35744:20384,35745:20689,35746:20807,35747:31478,35748:20849,35749:20982,35750:21332,35751:21281,35752:21375,35753:21483,35754:21932,35755:22659,35756:23777,35757:24375,35758:24394,35759:24623,35760:24656,35761:24685,35762:25375,35763:25945,35764:27211,35765:27841,35766:29378,35767:29421,35768:30703,35769:33016,35770:33029,35771:33288,35772:34126,35773:37111,35774:37857,35775:38911,35776:39255,35777:39514,35778:20208,35779:20957,35780:23597,35781:26241,35782:26989,35783:23616,35784:26354,35785:26997,35786:29577,35787:26704,35788:31873,35789:20677,35790:21220,35791:22343,35792:24062,35793:37670,35794:26020,35795:27427,35796:27453,35797:29748,35798:31105,35799:31165,35800:31563,35801:32202,35802:33465,35803:33740,35804:34943,35805:35167,35806:35641,35807:36817,35808:37329,35809:21535,35810:37504,35811:20061,35812:20534,35813:21477,35814:21306,35815:29399,35816:29590,35817:30697,35818:33510,35819:36527,35820:39366,35821:39368,35822:39378,35823:20855,35824:24858,35825:34398,35826:21936,35827:31354,35828:20598,35829:23507,35830:36935,35831:38533,35832:20018,35833:27355,35834:37351,35835:23633,35836:23624,35904:25496,35905:31391,35906:27795,35907:38772,35908:36705,35909:31402,35910:29066,35911:38536,35912:31874,35913:26647,35914:32368,35915:26705,35916:37740,35917:21234,35918:21531,35919:34219,35920:35347,35921:32676,35922:36557,35923:37089,35924:21350,35925:34952,35926:31041,35927:20418,35928:20670,35929:21009,35930:20804,35931:21843,35932:22317,35933:29674,35934:22411,35935:22865,35936:24418,35937:24452,35938:24693,35939:24950,35940:24935,35941:25001,35942:25522,35943:25658,35944:25964,35945:26223,35946:26690,35947:28179,35948:30054,35949:31293,35950:31995,35951:32076,35952:32153,35953:32331,35954:32619,35955:33550,35956:33610,35957:34509,35958:35336,35959:35427,35960:35686,35961:36605,35962:38938,35963:40335,35964:33464,35965:36814,35966:39912,35968:21127,35969:25119,35970:25731,35971:28608,35972:38553,35973:26689,35974:20625,35975:27424,35976:27770,35977:28500,35978:31348,35979:32080,35980:34880,35981:35363,35982:26376,35983:20214,35984:20537,35985:20518,35986:20581,35987:20860,35988:21048,35989:21091,35990:21927,35991:22287,35992:22533,35993:23244,35994:24314,35995:25010,35996:25080,35997:25331,35998:25458,35999:26908,36000:27177,36001:29309,36002:29356,36003:29486,36004:30740,36005:30831,36006:32121,36007:30476,36008:32937,36009:35211,36010:35609,36011:36066,36012:36562,36013:36963,36014:37749,36015:38522,36016:38997,36017:39443,36018:40568,36019:20803,36020:21407,36021:21427,36022:24187,36023:24358,36024:28187,36025:28304,36026:29572,36027:29694,36028:32067,36029:33335,36030:35328,36031:35578,36032:38480,36033:20046,36034:20491,36035:21476,36036:21628,36037:22266,36038:22993,36039:23396,36040:24049,36041:24235,36042:24359,36043:25144,36044:25925,36045:26543,36046:28246,36047:29392,36048:31946,36049:34996,36050:32929,36051:32993,36052:33776,36053:34382,36054:35463,36055:36328,36056:37431,36057:38599,36058:39015,36059:40723,36060:20116,36061:20114,36062:20237,36063:21320,36064:21577,36065:21566,36066:23087,36067:24460,36068:24481,36069:24735,36070:26791,36071:27278,36072:29786,36073:30849,36074:35486,36075:35492,36076:35703,36077:37264,36078:20062,36079:39881,36080:20132,36081:20348,36082:20399,36083:20505,36084:20502,36085:20809,36086:20844,36087:21151,36088:21177,36089:21246,36090:21402,36091:21475,36092:21521,36160:21518,36161:21897,36162:22353,36163:22434,36164:22909,36165:23380,36166:23389,36167:23439,36168:24037,36169:24039,36170:24055,36171:24184,36172:24195,36173:24218,36174:24247,36175:24344,36176:24658,36177:24908,36178:25239,36179:25304,36180:25511,36181:25915,36182:26114,36183:26179,36184:26356,36185:26477,36186:26657,36187:26775,36188:27083,36189:27743,36190:27946,36191:28009,36192:28207,36193:28317,36194:30002,36195:30343,36196:30828,36197:31295,36198:31968,36199:32005,36200:32024,36201:32094,36202:32177,36203:32789,36204:32771,36205:32943,36206:32945,36207:33108,36208:33167,36209:33322,36210:33618,36211:34892,36212:34913,36213:35611,36214:36002,36215:36092,36216:37066,36217:37237,36218:37489,36219:30783,36220:37628,36221:38308,36222:38477,36224:38917,36225:39321,36226:39640,36227:40251,36228:21083,36229:21163,36230:21495,36231:21512,36232:22741,36233:25335,36234:28640,36235:35946,36236:36703,36237:40633,36238:20811,36239:21051,36240:21578,36241:22269,36242:31296,36243:37239,36244:40288,36245:40658,36246:29508,36247:28425,36248:33136,36249:29969,36250:24573,36251:24794,36252:39592,36253:29403,36254:36796,36255:27492,36256:38915,36257:20170,36258:22256,36259:22372,36260:22718,36261:23130,36262:24680,36263:25031,36264:26127,36265:26118,36266:26681,36267:26801,36268:28151,36269:30165,36270:32058,36271:33390,36272:39746,36273:20123,36274:20304,36275:21449,36276:21766,36277:23919,36278:24038,36279:24046,36280:26619,36281:27801,36282:29811,36283:30722,36284:35408,36285:37782,36286:35039,36287:22352,36288:24231,36289:25387,36290:20661,36291:20652,36292:20877,36293:26368,36294:21705,36295:22622,36296:22971,36297:23472,36298:24425,36299:25165,36300:25505,36301:26685,36302:27507,36303:28168,36304:28797,36305:37319,36306:29312,36307:30741,36308:30758,36309:31085,36310:25998,36311:32048,36312:33756,36313:35009,36314:36617,36315:38555,36316:21092,36317:22312,36318:26448,36319:32618,36320:36001,36321:20916,36322:22338,36323:38442,36324:22586,36325:27018,36326:32948,36327:21682,36328:23822,36329:22524,36330:30869,36331:40442,36332:20316,36333:21066,36334:21643,36335:25662,36336:26152,36337:26388,36338:26613,36339:31364,36340:31574,36341:32034,36342:37679,36343:26716,36344:39853,36345:31545,36346:21273,36347:20874,36348:21047,36416:23519,36417:25334,36418:25774,36419:25830,36420:26413,36421:27578,36422:34217,36423:38609,36424:30352,36425:39894,36426:25420,36427:37638,36428:39851,36429:30399,36430:26194,36431:19977,36432:20632,36433:21442,36434:23665,36435:24808,36436:25746,36437:25955,36438:26719,36439:29158,36440:29642,36441:29987,36442:31639,36443:32386,36444:34453,36445:35715,36446:36059,36447:37240,36448:39184,36449:26028,36450:26283,36451:27531,36452:20181,36453:20180,36454:20282,36455:20351,36456:21050,36457:21496,36458:21490,36459:21987,36460:22235,36461:22763,36462:22987,36463:22985,36464:23039,36465:23376,36466:23629,36467:24066,36468:24107,36469:24535,36470:24605,36471:25351,36472:25903,36473:23388,36474:26031,36475:26045,36476:26088,36477:26525,36478:27490,36480:27515,36481:27663,36482:29509,36483:31049,36484:31169,36485:31992,36486:32025,36487:32043,36488:32930,36489:33026,36490:33267,36491:35222,36492:35422,36493:35433,36494:35430,36495:35468,36496:35566,36497:36039,36498:36060,36499:38604,36500:39164,36501:27503,36502:20107,36503:20284,36504:20365,36505:20816,36506:23383,36507:23546,36508:24904,36509:25345,36510:26178,36511:27425,36512:28363,36513:27835,36514:29246,36515:29885,36516:30164,36517:30913,36518:31034,36519:32780,36520:32819,36521:33258,36522:33940,36523:36766,36524:27728,36525:40575,36526:24335,36527:35672,36528:40235,36529:31482,36530:36600,36531:23437,36532:38635,36533:19971,36534:21489,36535:22519,36536:22833,36537:23241,36538:23460,36539:24713,36540:28287,36541:28422,36542:30142,36543:36074,36544:23455,36545:34048,36546:31712,36547:20594,36548:26612,36549:33437,36550:23649,36551:34122,36552:32286,36553:33294,36554:20889,36555:23556,36556:25448,36557:36198,36558:26012,36559:29038,36560:31038,36561:32023,36562:32773,36563:35613,36564:36554,36565:36974,36566:34503,36567:37034,36568:20511,36569:21242,36570:23610,36571:26451,36572:28796,36573:29237,36574:37196,36575:37320,36576:37675,36577:33509,36578:23490,36579:24369,36580:24825,36581:20027,36582:21462,36583:23432,36584:25163,36585:26417,36586:27530,36587:29417,36588:29664,36589:31278,36590:33131,36591:36259,36592:37202,36593:39318,36594:20754,36595:21463,36596:21610,36597:23551,36598:25480,36599:27193,36600:32172,36601:38656,36602:22234,36603:21454,36604:21608,36672:23447,36673:23601,36674:24030,36675:20462,36676:24833,36677:25342,36678:27954,36679:31168,36680:31179,36681:32066,36682:32333,36683:32722,36684:33261,36685:33311,36686:33936,36687:34886,36688:35186,36689:35728,36690:36468,36691:36655,36692:36913,36693:37195,36694:37228,36695:38598,36696:37276,36697:20160,36698:20303,36699:20805,36700:21313,36701:24467,36702:25102,36703:26580,36704:27713,36705:28171,36706:29539,36707:32294,36708:37325,36709:37507,36710:21460,36711:22809,36712:23487,36713:28113,36714:31069,36715:32302,36716:31899,36717:22654,36718:29087,36719:20986,36720:34899,36721:36848,36722:20426,36723:23803,36724:26149,36725:30636,36726:31459,36727:33308,36728:39423,36729:20934,36730:24490,36731:26092,36732:26991,36733:27529,36734:28147,36736:28310,36737:28516,36738:30462,36739:32020,36740:24033,36741:36981,36742:37255,36743:38918,36744:20966,36745:21021,36746:25152,36747:26257,36748:26329,36749:28186,36750:24246,36751:32210,36752:32626,36753:26360,36754:34223,36755:34295,36756:35576,36757:21161,36758:21465,36759:22899,36760:24207,36761:24464,36762:24661,36763:37604,36764:38500,36765:20663,36766:20767,36767:21213,36768:21280,36769:21319,36770:21484,36771:21736,36772:21830,36773:21809,36774:22039,36775:22888,36776:22974,36777:23100,36778:23477,36779:23558,36780:23567,36781:23569,36782:23578,36783:24196,36784:24202,36785:24288,36786:24432,36787:25215,36788:25220,36789:25307,36790:25484,36791:25463,36792:26119,36793:26124,36794:26157,36795:26230,36796:26494,36797:26786,36798:27167,36799:27189,36800:27836,36801:28040,36802:28169,36803:28248,36804:28988,36805:28966,36806:29031,36807:30151,36808:30465,36809:30813,36810:30977,36811:31077,36812:31216,36813:31456,36814:31505,36815:31911,36816:32057,36817:32918,36818:33750,36819:33931,36820:34121,36821:34909,36822:35059,36823:35359,36824:35388,36825:35412,36826:35443,36827:35937,36828:36062,36829:37284,36830:37478,36831:37758,36832:37912,36833:38556,36834:38808,36835:19978,36836:19976,36837:19998,36838:20055,36839:20887,36840:21104,36841:22478,36842:22580,36843:22732,36844:23330,36845:24120,36846:24773,36847:25854,36848:26465,36849:26454,36850:27972,36851:29366,36852:30067,36853:31331,36854:33976,36855:35698,36856:37304,36857:37664,36858:22065,36859:22516,36860:39166,36928:25325,36929:26893,36930:27542,36931:29165,36932:32340,36933:32887,36934:33394,36935:35302,36936:39135,36937:34645,36938:36785,36939:23611,36940:20280,36941:20449,36942:20405,36943:21767,36944:23072,36945:23517,36946:23529,36947:24515,36948:24910,36949:25391,36950:26032,36951:26187,36952:26862,36953:27035,36954:28024,36955:28145,36956:30003,36957:30137,36958:30495,36959:31070,36960:31206,36961:32051,36962:33251,36963:33455,36964:34218,36965:35242,36966:35386,36967:36523,36968:36763,36969:36914,36970:37341,36971:38663,36972:20154,36973:20161,36974:20995,36975:22645,36976:22764,36977:23563,36978:29978,36979:23613,36980:33102,36981:35338,36982:36805,36983:38499,36984:38765,36985:31525,36986:35535,36987:38920,36988:37218,36989:22259,36990:21416,36992:36887,36993:21561,36994:22402,36995:24101,36996:25512,36997:27700,36998:28810,36999:30561,37000:31883,37001:32736,37002:34928,37003:36930,37004:37204,37005:37648,37006:37656,37007:38543,37008:29790,37009:39620,37010:23815,37011:23913,37012:25968,37013:26530,37014:36264,37015:38619,37016:25454,37017:26441,37018:26905,37019:33733,37020:38935,37021:38592,37022:35070,37023:28548,37024:25722,37025:23544,37026:19990,37027:28716,37028:30045,37029:26159,37030:20932,37031:21046,37032:21218,37033:22995,37034:24449,37035:24615,37036:25104,37037:25919,37038:25972,37039:26143,37040:26228,37041:26866,37042:26646,37043:27491,37044:28165,37045:29298,37046:29983,37047:30427,37048:31934,37049:32854,37050:22768,37051:35069,37052:35199,37053:35488,37054:35475,37055:35531,37056:36893,37057:37266,37058:38738,37059:38745,37060:25993,37061:31246,37062:33030,37063:38587,37064:24109,37065:24796,37066:25114,37067:26021,37068:26132,37069:26512,37070:30707,37071:31309,37072:31821,37073:32318,37074:33034,37075:36012,37076:36196,37077:36321,37078:36447,37079:30889,37080:20999,37081:25305,37082:25509,37083:25666,37084:25240,37085:35373,37086:31363,37087:31680,37088:35500,37089:38634,37090:32118,37091:33292,37092:34633,37093:20185,37094:20808,37095:21315,37096:21344,37097:23459,37098:23554,37099:23574,37100:24029,37101:25126,37102:25159,37103:25776,37104:26643,37105:26676,37106:27849,37107:27973,37108:27927,37109:26579,37110:28508,37111:29006,37112:29053,37113:26059,37114:31359,37115:31661,37116:32218,37184:32330,37185:32680,37186:33146,37187:33307,37188:33337,37189:34214,37190:35438,37191:36046,37192:36341,37193:36984,37194:36983,37195:37549,37196:37521,37197:38275,37198:39854,37199:21069,37200:21892,37201:28472,37202:28982,37203:20840,37204:31109,37205:32341,37206:33203,37207:31950,37208:22092,37209:22609,37210:23720,37211:25514,37212:26366,37213:26365,37214:26970,37215:29401,37216:30095,37217:30094,37218:30990,37219:31062,37220:31199,37221:31895,37222:32032,37223:32068,37224:34311,37225:35380,37226:38459,37227:36961,37228:40736,37229:20711,37230:21109,37231:21452,37232:21474,37233:20489,37234:21930,37235:22766,37236:22863,37237:29245,37238:23435,37239:23652,37240:21277,37241:24803,37242:24819,37243:25436,37244:25475,37245:25407,37246:25531,37248:25805,37249:26089,37250:26361,37251:24035,37252:27085,37253:27133,37254:28437,37255:29157,37256:20105,37257:30185,37258:30456,37259:31379,37260:31967,37261:32207,37262:32156,37263:32865,37264:33609,37265:33624,37266:33900,37267:33980,37268:34299,37269:35013,37270:36208,37271:36865,37272:36973,37273:37783,37274:38684,37275:39442,37276:20687,37277:22679,37278:24974,37279:33235,37280:34101,37281:36104,37282:36896,37283:20419,37284:20596,37285:21063,37286:21363,37287:24687,37288:25417,37289:26463,37290:28204,37291:36275,37292:36895,37293:20439,37294:23646,37295:36042,37296:26063,37297:32154,37298:21330,37299:34966,37300:20854,37301:25539,37302:23384,37303:23403,37304:23562,37305:25613,37306:26449,37307:36956,37308:20182,37309:22810,37310:22826,37311:27760,37312:35409,37313:21822,37314:22549,37315:22949,37316:24816,37317:25171,37318:26561,37319:33333,37320:26965,37321:38464,37322:39364,37323:39464,37324:20307,37325:22534,37326:23550,37327:32784,37328:23729,37329:24111,37330:24453,37331:24608,37332:24907,37333:25140,37334:26367,37335:27888,37336:28382,37337:32974,37338:33151,37339:33492,37340:34955,37341:36024,37342:36864,37343:36910,37344:38538,37345:40667,37346:39899,37347:20195,37348:21488,37349:22823,37350:31532,37351:37261,37352:38988,37353:40441,37354:28381,37355:28711,37356:21331,37357:21828,37358:23429,37359:25176,37360:25246,37361:25299,37362:27810,37363:28655,37364:29730,37365:35351,37366:37944,37367:28609,37368:35582,37369:33592,37370:20967,37371:34552,37372:21482,37440:21481,37441:20294,37442:36948,37443:36784,37444:22890,37445:33073,37446:24061,37447:31466,37448:36799,37449:26842,37450:35895,37451:29432,37452:40008,37453:27197,37454:35504,37455:20025,37456:21336,37457:22022,37458:22374,37459:25285,37460:25506,37461:26086,37462:27470,37463:28129,37464:28251,37465:28845,37466:30701,37467:31471,37468:31658,37469:32187,37470:32829,37471:32966,37472:34507,37473:35477,37474:37723,37475:22243,37476:22727,37477:24382,37478:26029,37479:26262,37480:27264,37481:27573,37482:30007,37483:35527,37484:20516,37485:30693,37486:22320,37487:24347,37488:24677,37489:26234,37490:27744,37491:30196,37492:31258,37493:32622,37494:33268,37495:34584,37496:36933,37497:39347,37498:31689,37499:30044,37500:31481,37501:31569,37502:33988,37504:36880,37505:31209,37506:31378,37507:33590,37508:23265,37509:30528,37510:20013,37511:20210,37512:23449,37513:24544,37514:25277,37515:26172,37516:26609,37517:27880,37518:34411,37519:34935,37520:35387,37521:37198,37522:37619,37523:39376,37524:27159,37525:28710,37526:29482,37527:33511,37528:33879,37529:36015,37530:19969,37531:20806,37532:20939,37533:21899,37534:23541,37535:24086,37536:24115,37537:24193,37538:24340,37539:24373,37540:24427,37541:24500,37542:25074,37543:25361,37544:26274,37545:26397,37546:28526,37547:29266,37548:30010,37549:30522,37550:32884,37551:33081,37552:33144,37553:34678,37554:35519,37555:35548,37556:36229,37557:36339,37558:37530,37559:38263,37560:38914,37561:40165,37562:21189,37563:25431,37564:30452,37565:26389,37566:27784,37567:29645,37568:36035,37569:37806,37570:38515,37571:27941,37572:22684,37573:26894,37574:27084,37575:36861,37576:37786,37577:30171,37578:36890,37579:22618,37580:26626,37581:25524,37582:27131,37583:20291,37584:28460,37585:26584,37586:36795,37587:34086,37588:32180,37589:37716,37590:26943,37591:28528,37592:22378,37593:22775,37594:23340,37595:32044,37596:29226,37597:21514,37598:37347,37599:40372,37600:20141,37601:20302,37602:20572,37603:20597,37604:21059,37605:35998,37606:21576,37607:22564,37608:23450,37609:24093,37610:24213,37611:24237,37612:24311,37613:24351,37614:24716,37615:25269,37616:25402,37617:25552,37618:26799,37619:27712,37620:30855,37621:31118,37622:31243,37623:32224,37624:33351,37625:35330,37626:35558,37627:36420,37628:36883,37696:37048,37697:37165,37698:37336,37699:40718,37700:27877,37701:25688,37702:25826,37703:25973,37704:28404,37705:30340,37706:31515,37707:36969,37708:37841,37709:28346,37710:21746,37711:24505,37712:25764,37713:36685,37714:36845,37715:37444,37716:20856,37717:22635,37718:22825,37719:23637,37720:24215,37721:28155,37722:32399,37723:29980,37724:36028,37725:36578,37726:39003,37727:28857,37728:20253,37729:27583,37730:28593,37731:3e4,37732:38651,37733:20814,37734:21520,37735:22581,37736:22615,37737:22956,37738:23648,37739:24466,37740:26007,37741:26460,37742:28193,37743:30331,37744:33759,37745:36077,37746:36884,37747:37117,37748:37709,37749:30757,37750:30778,37751:21162,37752:24230,37753:22303,37754:22900,37755:24594,37756:20498,37757:20826,37758:20908,37760:20941,37761:20992,37762:21776,37763:22612,37764:22616,37765:22871,37766:23445,37767:23798,37768:23947,37769:24764,37770:25237,37771:25645,37772:26481,37773:26691,37774:26812,37775:26847,37776:30423,37777:28120,37778:28271,37779:28059,37780:28783,37781:29128,37782:24403,37783:30168,37784:31095,37785:31561,37786:31572,37787:31570,37788:31958,37789:32113,37790:21040,37791:33891,37792:34153,37793:34276,37794:35342,37795:35588,37796:35910,37797:36367,37798:36867,37799:36879,37800:37913,37801:38518,37802:38957,37803:39472,37804:38360,37805:20685,37806:21205,37807:21516,37808:22530,37809:23566,37810:24999,37811:25758,37812:27934,37813:30643,37814:31461,37815:33012,37816:33796,37817:36947,37818:37509,37819:23776,37820:40199,37821:21311,37822:24471,37823:24499,37824:28060,37825:29305,37826:30563,37827:31167,37828:31716,37829:27602,37830:29420,37831:35501,37832:26627,37833:27233,37834:20984,37835:31361,37836:26932,37837:23626,37838:40182,37839:33515,37840:23493,37841:37193,37842:28702,37843:22136,37844:23663,37845:24775,37846:25958,37847:27788,37848:35930,37849:36929,37850:38931,37851:21585,37852:26311,37853:37389,37854:22856,37855:37027,37856:20869,37857:20045,37858:20970,37859:34201,37860:35598,37861:28760,37862:25466,37863:37707,37864:26978,37865:39348,37866:32260,37867:30071,37868:21335,37869:26976,37870:36575,37871:38627,37872:27741,37873:20108,37874:23612,37875:24336,37876:36841,37877:21250,37878:36049,37879:32905,37880:34425,37881:24319,37882:26085,37883:20083,37884:20837,37952:22914,37953:23615,37954:38894,37955:20219,37956:22922,37957:24525,37958:35469,37959:28641,37960:31152,37961:31074,37962:23527,37963:33905,37964:29483,37965:29105,37966:24180,37967:24565,37968:25467,37969:25754,37970:29123,37971:31896,37972:20035,37973:24316,37974:20043,37975:22492,37976:22178,37977:24745,37978:28611,37979:32013,37980:33021,37981:33075,37982:33215,37983:36786,37984:35223,37985:34468,37986:24052,37987:25226,37988:25773,37989:35207,37990:26487,37991:27874,37992:27966,37993:29750,37994:30772,37995:23110,37996:32629,37997:33453,37998:39340,37999:20467,38000:24259,38001:25309,38002:25490,38003:25943,38004:26479,38005:30403,38006:29260,38007:32972,38008:32954,38009:36649,38010:37197,38011:20493,38012:22521,38013:23186,38014:26757,38016:26995,38017:29028,38018:29437,38019:36023,38020:22770,38021:36064,38022:38506,38023:36889,38024:34687,38025:31204,38026:30695,38027:33833,38028:20271,38029:21093,38030:21338,38031:25293,38032:26575,38033:27850,38034:30333,38035:31636,38036:31893,38037:33334,38038:34180,38039:36843,38040:26333,38041:28448,38042:29190,38043:32283,38044:33707,38045:39361,38046:40614,38047:20989,38048:31665,38049:30834,38050:31672,38051:32903,38052:31560,38053:27368,38054:24161,38055:32908,38056:30033,38057:30048,38058:20843,38059:37474,38060:28300,38061:30330,38062:37271,38063:39658,38064:20240,38065:32624,38066:25244,38067:31567,38068:38309,38069:40169,38070:22138,38071:22617,38072:34532,38073:38588,38074:20276,38075:21028,38076:21322,38077:21453,38078:21467,38079:24070,38080:25644,38081:26001,38082:26495,38083:27710,38084:27726,38085:29256,38086:29359,38087:29677,38088:30036,38089:32321,38090:33324,38091:34281,38092:36009,38093:31684,38094:37318,38095:29033,38096:38930,38097:39151,38098:25405,38099:26217,38100:30058,38101:30436,38102:30928,38103:34115,38104:34542,38105:21290,38106:21329,38107:21542,38108:22915,38109:24199,38110:24444,38111:24754,38112:25161,38113:25209,38114:25259,38115:26e3,38116:27604,38117:27852,38118:30130,38119:30382,38120:30865,38121:31192,38122:32203,38123:32631,38124:32933,38125:34987,38126:35513,38127:36027,38128:36991,38129:38750,38130:39131,38131:27147,38132:31800,38133:20633,38134:23614,38135:24494,38136:26503,38137:27608,38138:29749,38139:30473,38140:32654,38208:40763,38209:26570,38210:31255,38211:21305,38212:30091,38213:39661,38214:24422,38215:33181,38216:33777,38217:32920,38218:24380,38219:24517,38220:30050,38221:31558,38222:36924,38223:26727,38224:23019,38225:23195,38226:32016,38227:30334,38228:35628,38229:20469,38230:24426,38231:27161,38232:27703,38233:28418,38234:29922,38235:31080,38236:34920,38237:35413,38238:35961,38239:24287,38240:25551,38241:30149,38242:31186,38243:33495,38244:37672,38245:37618,38246:33948,38247:34541,38248:39981,38249:21697,38250:24428,38251:25996,38252:27996,38253:28693,38254:36007,38255:36051,38256:38971,38257:25935,38258:29942,38259:19981,38260:20184,38261:22496,38262:22827,38263:23142,38264:23500,38265:20904,38266:24067,38267:24220,38268:24598,38269:25206,38270:25975,38272:26023,38273:26222,38274:28014,38275:29238,38276:31526,38277:33104,38278:33178,38279:33433,38280:35676,38281:36e3,38282:36070,38283:36212,38284:38428,38285:38468,38286:20398,38287:25771,38288:27494,38289:33310,38290:33889,38291:34154,38292:37096,38293:23553,38294:26963,38295:39080,38296:33914,38297:34135,38298:20239,38299:21103,38300:24489,38301:24133,38302:26381,38303:31119,38304:33145,38305:35079,38306:35206,38307:28149,38308:24343,38309:25173,38310:27832,38311:20175,38312:29289,38313:39826,38314:20998,38315:21563,38316:22132,38317:22707,38318:24996,38319:25198,38320:28954,38321:22894,38322:31881,38323:31966,38324:32027,38325:38640,38326:25991,38327:32862,38328:19993,38329:20341,38330:20853,38331:22592,38332:24163,38333:24179,38334:24330,38335:26564,38336:20006,38337:34109,38338:38281,38339:38491,38340:31859,38341:38913,38342:20731,38343:22721,38344:30294,38345:30887,38346:21029,38347:30629,38348:34065,38349:31622,38350:20559,38351:22793,38352:29255,38353:31687,38354:32232,38355:36794,38356:36820,38357:36941,38358:20415,38359:21193,38360:23081,38361:24321,38362:38829,38363:20445,38364:33303,38365:37610,38366:22275,38367:25429,38368:27497,38369:29995,38370:35036,38371:36628,38372:31298,38373:21215,38374:22675,38375:24917,38376:25098,38377:26286,38378:27597,38379:31807,38380:33769,38381:20515,38382:20472,38383:21253,38384:21574,38385:22577,38386:22857,38387:23453,38388:23792,38389:23791,38390:23849,38391:24214,38392:25265,38393:25447,38394:25918,38395:26041,38396:26379,38464:27861,38465:27873,38466:28921,38467:30770,38468:32299,38469:32990,38470:33459,38471:33804,38472:34028,38473:34562,38474:35090,38475:35370,38476:35914,38477:37030,38478:37586,38479:39165,38480:40179,38481:40300,38482:20047,38483:20129,38484:20621,38485:21078,38486:22346,38487:22952,38488:24125,38489:24536,38490:24537,38491:25151,38492:26292,38493:26395,38494:26576,38495:26834,38496:20882,38497:32033,38498:32938,38499:33192,38500:35584,38501:35980,38502:36031,38503:37502,38504:38450,38505:21536,38506:38956,38507:21271,38508:20693,38509:21340,38510:22696,38511:25778,38512:26420,38513:29287,38514:30566,38515:31302,38516:37350,38517:21187,38518:27809,38519:27526,38520:22528,38521:24140,38522:22868,38523:26412,38524:32763,38525:20961,38526:30406,38528:25705,38529:30952,38530:39764,38531:40635,38532:22475,38533:22969,38534:26151,38535:26522,38536:27598,38537:21737,38538:27097,38539:24149,38540:33180,38541:26517,38542:39850,38543:26622,38544:40018,38545:26717,38546:20134,38547:20451,38548:21448,38549:25273,38550:26411,38551:27819,38552:36804,38553:20397,38554:32365,38555:40639,38556:19975,38557:24930,38558:28288,38559:28459,38560:34067,38561:21619,38562:26410,38563:39749,38564:24051,38565:31637,38566:23724,38567:23494,38568:34588,38569:28234,38570:34001,38571:31252,38572:33032,38573:22937,38574:31885,38575:27665,38576:30496,38577:21209,38578:22818,38579:28961,38580:29279,38581:30683,38582:38695,38583:40289,38584:26891,38585:23167,38586:23064,38587:20901,38588:21517,38589:21629,38590:26126,38591:30431,38592:36855,38593:37528,38594:40180,38595:23018,38596:29277,38597:28357,38598:20813,38599:26825,38600:32191,38601:32236,38602:38754,38603:40634,38604:25720,38605:27169,38606:33538,38607:22916,38608:23391,38609:27611,38610:29467,38611:30450,38612:32178,38613:32791,38614:33945,38615:20786,38616:26408,38617:40665,38618:30446,38619:26466,38620:21247,38621:39173,38622:23588,38623:25147,38624:31870,38625:36016,38626:21839,38627:24758,38628:32011,38629:38272,38630:21249,38631:20063,38632:20918,38633:22812,38634:29242,38635:32822,38636:37326,38637:24357,38638:30690,38639:21380,38640:24441,38641:32004,38642:34220,38643:35379,38644:36493,38645:38742,38646:26611,38647:34222,38648:37971,38649:24841,38650:24840,38651:27833,38652:30290,38720:35565,38721:36664,38722:21807,38723:20305,38724:20778,38725:21191,38726:21451,38727:23461,38728:24189,38729:24736,38730:24962,38731:25558,38732:26377,38733:26586,38734:28263,38735:28044,38736:29494,38737:29495,38738:30001,38739:31056,38740:35029,38741:35480,38742:36938,38743:37009,38744:37109,38745:38596,38746:34701,38747:22805,38748:20104,38749:20313,38750:19982,38751:35465,38752:36671,38753:38928,38754:20653,38755:24188,38756:22934,38757:23481,38758:24248,38759:25562,38760:25594,38761:25793,38762:26332,38763:26954,38764:27096,38765:27915,38766:28342,38767:29076,38768:29992,38769:31407,38770:32650,38771:32768,38772:33865,38773:33993,38774:35201,38775:35617,38776:36362,38777:36965,38778:38525,38779:39178,38780:24958,38781:25233,38782:27442,38784:27779,38785:28020,38786:32716,38787:32764,38788:28096,38789:32645,38790:34746,38791:35064,38792:26469,38793:33713,38794:38972,38795:38647,38796:27931,38797:32097,38798:33853,38799:37226,38800:20081,38801:21365,38802:23888,38803:27396,38804:28651,38805:34253,38806:34349,38807:35239,38808:21033,38809:21519,38810:23653,38811:26446,38812:26792,38813:29702,38814:29827,38815:30178,38816:35023,38817:35041,38818:37324,38819:38626,38820:38520,38821:24459,38822:29575,38823:31435,38824:33870,38825:25504,38826:30053,38827:21129,38828:27969,38829:28316,38830:29705,38831:30041,38832:30827,38833:31890,38834:38534,38835:31452,38836:40845,38837:20406,38838:24942,38839:26053,38840:34396,38841:20102,38842:20142,38843:20698,38844:20001,38845:20940,38846:23534,38847:26009,38848:26753,38849:28092,38850:29471,38851:30274,38852:30637,38853:31260,38854:31975,38855:33391,38856:35538,38857:36988,38858:37327,38859:38517,38860:38936,38861:21147,38862:32209,38863:20523,38864:21400,38865:26519,38866:28107,38867:29136,38868:29747,38869:33256,38870:36650,38871:38563,38872:40023,38873:40607,38874:29792,38875:22593,38876:28057,38877:32047,38878:39006,38879:20196,38880:20278,38881:20363,38882:20919,38883:21169,38884:23994,38885:24604,38886:29618,38887:31036,38888:33491,38889:37428,38890:38583,38891:38646,38892:38666,38893:40599,38894:40802,38895:26278,38896:27508,38897:21015,38898:21155,38899:28872,38900:35010,38901:24265,38902:24651,38903:24976,38904:28451,38905:29001,38906:31806,38907:32244,38908:32879,38976:34030,38977:36899,38978:37676,38979:21570,38980:39791,38981:27347,38982:28809,38983:36034,38984:36335,38985:38706,38986:21172,38987:23105,38988:24266,38989:24324,38990:26391,38991:27004,38992:27028,38993:28010,38994:28431,38995:29282,38996:29436,38997:31725,38998:32769,38999:32894,39000:34635,39001:37070,39002:20845,39003:40595,39004:31108,39005:32907,39006:37682,39007:35542,39008:20525,39009:21644,39010:35441,39011:27498,39012:36036,39013:33031,39014:24785,39015:26528,39016:40434,39017:20121,39018:20120,39019:39952,39020:35435,39021:34241,39022:34152,39023:26880,39024:28286,39025:30871,39026:33109,39071:24332,39072:19984,39073:19989,39074:20010,39075:20017,39076:20022,39077:20028,39078:20031,39079:20034,39080:20054,39081:20056,39082:20098,39083:20101,39084:35947,39085:20106,39086:33298,39087:24333,39088:20110,39089:20126,39090:20127,39091:20128,39092:20130,39093:20144,39094:20147,39095:20150,39096:20174,39097:20173,39098:20164,39099:20166,39100:20162,39101:20183,39102:20190,39103:20205,39104:20191,39105:20215,39106:20233,39107:20314,39108:20272,39109:20315,39110:20317,39111:20311,39112:20295,39113:20342,39114:20360,39115:20367,39116:20376,39117:20347,39118:20329,39119:20336,39120:20369,39121:20335,39122:20358,39123:20374,39124:20760,39125:20436,39126:20447,39127:20430,39128:20440,39129:20443,39130:20433,39131:20442,39132:20432,39133:20452,39134:20453,39135:20506,39136:20520,39137:20500,39138:20522,39139:20517,39140:20485,39141:20252,39142:20470,39143:20513,39144:20521,39145:20524,39146:20478,39147:20463,39148:20497,39149:20486,39150:20547,39151:20551,39152:26371,39153:20565,39154:20560,39155:20552,39156:20570,39157:20566,39158:20588,39159:20600,39160:20608,39161:20634,39162:20613,39163:20660,39164:20658,39232:20681,39233:20682,39234:20659,39235:20674,39236:20694,39237:20702,39238:20709,39239:20717,39240:20707,39241:20718,39242:20729,39243:20725,39244:20745,39245:20737,39246:20738,39247:20758,39248:20757,39249:20756,39250:20762,39251:20769,39252:20794,39253:20791,39254:20796,39255:20795,39256:20799,39257:20800,39258:20818,39259:20812,39260:20820,39261:20834,39262:31480,39263:20841,39264:20842,39265:20846,39266:20864,39267:20866,39268:22232,39269:20876,39270:20873,39271:20879,39272:20881,39273:20883,39274:20885,39275:20886,39276:20900,39277:20902,39278:20898,39279:20905,39280:20906,39281:20907,39282:20915,39283:20913,39284:20914,39285:20912,39286:20917,39287:20925,39288:20933,39289:20937,39290:20955,39291:20960,39292:34389,39293:20969,39294:20973,39296:20976,39297:20981,39298:20990,39299:20996,39300:21003,39301:21012,39302:21006,39303:21031,39304:21034,39305:21038,39306:21043,39307:21049,39308:21071,39309:21060,39310:21067,39311:21068,39312:21086,39313:21076,39314:21098,39315:21108,39316:21097,39317:21107,39318:21119,39319:21117,39320:21133,39321:21140,39322:21138,39323:21105,39324:21128,39325:21137,39326:36776,39327:36775,39328:21164,39329:21165,39330:21180,39331:21173,39332:21185,39333:21197,39334:21207,39335:21214,39336:21219,39337:21222,39338:39149,39339:21216,39340:21235,39341:21237,39342:21240,39343:21241,39344:21254,39345:21256,39346:30008,39347:21261,39348:21264,39349:21263,39350:21269,39351:21274,39352:21283,39353:21295,39354:21297,39355:21299,39356:21304,39357:21312,39358:21318,39359:21317,39360:19991,39361:21321,39362:21325,39363:20950,39364:21342,39365:21353,39366:21358,39367:22808,39368:21371,39369:21367,39370:21378,39371:21398,39372:21408,39373:21414,39374:21413,39375:21422,39376:21424,39377:21430,39378:21443,39379:31762,39380:38617,39381:21471,39382:26364,39383:29166,39384:21486,39385:21480,39386:21485,39387:21498,39388:21505,39389:21565,39390:21568,39391:21548,39392:21549,39393:21564,39394:21550,39395:21558,39396:21545,39397:21533,39398:21582,39399:21647,39400:21621,39401:21646,39402:21599,39403:21617,39404:21623,39405:21616,39406:21650,39407:21627,39408:21632,39409:21622,39410:21636,39411:21648,39412:21638,39413:21703,39414:21666,39415:21688,39416:21669,39417:21676,39418:21700,39419:21704,39420:21672,39488:21675,39489:21698,39490:21668,39491:21694,39492:21692,39493:21720,39494:21733,39495:21734,39496:21775,39497:21780,39498:21757,39499:21742,39500:21741,39501:21754,39502:21730,39503:21817,39504:21824,39505:21859,39506:21836,39507:21806,39508:21852,39509:21829,39510:21846,39511:21847,39512:21816,39513:21811,39514:21853,39515:21913,39516:21888,39517:21679,39518:21898,39519:21919,39520:21883,39521:21886,39522:21912,39523:21918,39524:21934,39525:21884,39526:21891,39527:21929,39528:21895,39529:21928,39530:21978,39531:21957,39532:21983,39533:21956,39534:21980,39535:21988,39536:21972,39537:22036,39538:22007,39539:22038,39540:22014,39541:22013,39542:22043,39543:22009,39544:22094,39545:22096,39546:29151,39547:22068,39548:22070,39549:22066,39550:22072,39552:22123,39553:22116,39554:22063,39555:22124,39556:22122,39557:22150,39558:22144,39559:22154,39560:22176,39561:22164,39562:22159,39563:22181,39564:22190,39565:22198,39566:22196,39567:22210,39568:22204,39569:22209,39570:22211,39571:22208,39572:22216,39573:22222,39574:22225,39575:22227,39576:22231,39577:22254,39578:22265,39579:22272,39580:22271,39581:22276,39582:22281,39583:22280,39584:22283,39585:22285,39586:22291,39587:22296,39588:22294,39589:21959,39590:22300,39591:22310,39592:22327,39593:22328,39594:22350,39595:22331,39596:22336,39597:22351,39598:22377,39599:22464,39600:22408,39601:22369,39602:22399,39603:22409,39604:22419,39605:22432,39606:22451,39607:22436,39608:22442,39609:22448,39610:22467,39611:22470,39612:22484,39613:22482,39614:22483,39615:22538,39616:22486,39617:22499,39618:22539,39619:22553,39620:22557,39621:22642,39622:22561,39623:22626,39624:22603,39625:22640,39626:27584,39627:22610,39628:22589,39629:22649,39630:22661,39631:22713,39632:22687,39633:22699,39634:22714,39635:22750,39636:22715,39637:22712,39638:22702,39639:22725,39640:22739,39641:22737,39642:22743,39643:22745,39644:22744,39645:22757,39646:22748,39647:22756,39648:22751,39649:22767,39650:22778,39651:22777,39652:22779,39653:22780,39654:22781,39655:22786,39656:22794,39657:22800,39658:22811,39659:26790,39660:22821,39661:22828,39662:22829,39663:22834,39664:22840,39665:22846,39666:31442,39667:22869,39668:22864,39669:22862,39670:22874,39671:22872,39672:22882,39673:22880,39674:22887,39675:22892,39676:22889,39744:22904,39745:22913,39746:22941,39747:20318,39748:20395,39749:22947,39750:22962,39751:22982,39752:23016,39753:23004,39754:22925,39755:23001,39756:23002,39757:23077,39758:23071,39759:23057,39760:23068,39761:23049,39762:23066,39763:23104,39764:23148,39765:23113,39766:23093,39767:23094,39768:23138,39769:23146,39770:23194,39771:23228,39772:23230,39773:23243,39774:23234,39775:23229,39776:23267,39777:23255,39778:23270,39779:23273,39780:23254,39781:23290,39782:23291,39783:23308,39784:23307,39785:23318,39786:23346,39787:23248,39788:23338,39789:23350,39790:23358,39791:23363,39792:23365,39793:23360,39794:23377,39795:23381,39796:23386,39797:23387,39798:23397,39799:23401,39800:23408,39801:23411,39802:23413,39803:23416,39804:25992,39805:23418,39806:23424,39808:23427,39809:23462,39810:23480,39811:23491,39812:23495,39813:23497,39814:23508,39815:23504,39816:23524,39817:23526,39818:23522,39819:23518,39820:23525,39821:23531,39822:23536,39823:23542,39824:23539,39825:23557,39826:23559,39827:23560,39828:23565,39829:23571,39830:23584,39831:23586,39832:23592,39833:23608,39834:23609,39835:23617,39836:23622,39837:23630,39838:23635,39839:23632,39840:23631,39841:23409,39842:23660,39843:23662,39844:20066,39845:23670,39846:23673,39847:23692,39848:23697,39849:23700,39850:22939,39851:23723,39852:23739,39853:23734,39854:23740,39855:23735,39856:23749,39857:23742,39858:23751,39859:23769,39860:23785,39861:23805,39862:23802,39863:23789,39864:23948,39865:23786,39866:23819,39867:23829,39868:23831,39869:23900,39870:23839,39871:23835,39872:23825,39873:23828,39874:23842,39875:23834,39876:23833,39877:23832,39878:23884,39879:23890,39880:23886,39881:23883,39882:23916,39883:23923,39884:23926,39885:23943,39886:23940,39887:23938,39888:23970,39889:23965,39890:23980,39891:23982,39892:23997,39893:23952,39894:23991,39895:23996,39896:24009,39897:24013,39898:24019,39899:24018,39900:24022,39901:24027,39902:24043,39903:24050,39904:24053,39905:24075,39906:24090,39907:24089,39908:24081,39909:24091,39910:24118,39911:24119,39912:24132,39913:24131,39914:24128,39915:24142,39916:24151,39917:24148,39918:24159,39919:24162,39920:24164,39921:24135,39922:24181,39923:24182,39924:24186,39925:40636,39926:24191,39927:24224,39928:24257,39929:24258,39930:24264,39931:24272,39932:24271,40000:24278,40001:24291,40002:24285,40003:24282,40004:24283,40005:24290,40006:24289,40007:24296,40008:24297,40009:24300,40010:24305,40011:24307,40012:24304,40013:24308,40014:24312,40015:24318,40016:24323,40017:24329,40018:24413,40019:24412,40020:24331,40021:24337,40022:24342,40023:24361,40024:24365,40025:24376,40026:24385,40027:24392,40028:24396,40029:24398,40030:24367,40031:24401,40032:24406,40033:24407,40034:24409,40035:24417,40036:24429,40037:24435,40038:24439,40039:24451,40040:24450,40041:24447,40042:24458,40043:24456,40044:24465,40045:24455,40046:24478,40047:24473,40048:24472,40049:24480,40050:24488,40051:24493,40052:24508,40053:24534,40054:24571,40055:24548,40056:24568,40057:24561,40058:24541,40059:24755,40060:24575,40061:24609,40062:24672,40064:24601,40065:24592,40066:24617,40067:24590,40068:24625,40069:24603,40070:24597,40071:24619,40072:24614,40073:24591,40074:24634,40075:24666,40076:24641,40077:24682,40078:24695,40079:24671,40080:24650,40081:24646,40082:24653,40083:24675,40084:24643,40085:24676,40086:24642,40087:24684,40088:24683,40089:24665,40090:24705,40091:24717,40092:24807,40093:24707,40094:24730,40095:24708,40096:24731,40097:24726,40098:24727,40099:24722,40100:24743,40101:24715,40102:24801,40103:24760,40104:24800,40105:24787,40106:24756,40107:24560,40108:24765,40109:24774,40110:24757,40111:24792,40112:24909,40113:24853,40114:24838,40115:24822,40116:24823,40117:24832,40118:24820,40119:24826,40120:24835,40121:24865,40122:24827,40123:24817,40124:24845,40125:24846,40126:24903,40127:24894,40128:24872,40129:24871,40130:24906,40131:24895,40132:24892,40133:24876,40134:24884,40135:24893,40136:24898,40137:24900,40138:24947,40139:24951,40140:24920,40141:24921,40142:24922,40143:24939,40144:24948,40145:24943,40146:24933,40147:24945,40148:24927,40149:24925,40150:24915,40151:24949,40152:24985,40153:24982,40154:24967,40155:25004,40156:24980,40157:24986,40158:24970,40159:24977,40160:25003,40161:25006,40162:25036,40163:25034,40164:25033,40165:25079,40166:25032,40167:25027,40168:25030,40169:25018,40170:25035,40171:32633,40172:25037,40173:25062,40174:25059,40175:25078,40176:25082,40177:25076,40178:25087,40179:25085,40180:25084,40181:25086,40182:25088,40183:25096,40184:25097,40185:25101,40186:25100,40187:25108,40188:25115,40256:25118,40257:25121,40258:25130,40259:25134,40260:25136,40261:25138,40262:25139,40263:25153,40264:25166,40265:25182,40266:25187,40267:25179,40268:25184,40269:25192,40270:25212,40271:25218,40272:25225,40273:25214,40274:25234,40275:25235,40276:25238,40277:25300,40278:25219,40279:25236,40280:25303,40281:25297,40282:25275,40283:25295,40284:25343,40285:25286,40286:25812,40287:25288,40288:25308,40289:25292,40290:25290,40291:25282,40292:25287,40293:25243,40294:25289,40295:25356,40296:25326,40297:25329,40298:25383,40299:25346,40300:25352,40301:25327,40302:25333,40303:25424,40304:25406,40305:25421,40306:25628,40307:25423,40308:25494,40309:25486,40310:25472,40311:25515,40312:25462,40313:25507,40314:25487,40315:25481,40316:25503,40317:25525,40318:25451,40320:25449,40321:25534,40322:25577,40323:25536,40324:25542,40325:25571,40326:25545,40327:25554,40328:25590,40329:25540,40330:25622,40331:25652,40332:25606,40333:25619,40334:25638,40335:25654,40336:25885,40337:25623,40338:25640,40339:25615,40340:25703,40341:25711,40342:25718,40343:25678,40344:25898,40345:25749,40346:25747,40347:25765,40348:25769,40349:25736,40350:25788,40351:25818,40352:25810,40353:25797,40354:25799,40355:25787,40356:25816,40357:25794,40358:25841,40359:25831,40360:33289,40361:25824,40362:25825,40363:25260,40364:25827,40365:25839,40366:25900,40367:25846,40368:25844,40369:25842,40370:25850,40371:25856,40372:25853,40373:25880,40374:25884,40375:25861,40376:25892,40377:25891,40378:25899,40379:25908,40380:25909,40381:25911,40382:25910,40383:25912,40384:30027,40385:25928,40386:25942,40387:25941,40388:25933,40389:25944,40390:25950,40391:25949,40392:25970,40393:25976,40394:25986,40395:25987,40396:35722,40397:26011,40398:26015,40399:26027,40400:26039,40401:26051,40402:26054,40403:26049,40404:26052,40405:26060,40406:26066,40407:26075,40408:26073,40409:26080,40410:26081,40411:26097,40412:26482,40413:26122,40414:26115,40415:26107,40416:26483,40417:26165,40418:26166,40419:26164,40420:26140,40421:26191,40422:26180,40423:26185,40424:26177,40425:26206,40426:26205,40427:26212,40428:26215,40429:26216,40430:26207,40431:26210,40432:26224,40433:26243,40434:26248,40435:26254,40436:26249,40437:26244,40438:26264,40439:26269,40440:26305,40441:26297,40442:26313,40443:26302,40444:26300,40512:26308,40513:26296,40514:26326,40515:26330,40516:26336,40517:26175,40518:26342,40519:26345,40520:26352,40521:26357,40522:26359,40523:26383,40524:26390,40525:26398,40526:26406,40527:26407,40528:38712,40529:26414,40530:26431,40531:26422,40532:26433,40533:26424,40534:26423,40535:26438,40536:26462,40537:26464,40538:26457,40539:26467,40540:26468,40541:26505,40542:26480,40543:26537,40544:26492,40545:26474,40546:26508,40547:26507,40548:26534,40549:26529,40550:26501,40551:26551,40552:26607,40553:26548,40554:26604,40555:26547,40556:26601,40557:26552,40558:26596,40559:26590,40560:26589,40561:26594,40562:26606,40563:26553,40564:26574,40565:26566,40566:26599,40567:27292,40568:26654,40569:26694,40570:26665,40571:26688,40572:26701,40573:26674,40574:26702,40576:26803,40577:26667,40578:26713,40579:26723,40580:26743,40581:26751,40582:26783,40583:26767,40584:26797,40585:26772,40586:26781,40587:26779,40588:26755,40589:27310,40590:26809,40591:26740,40592:26805,40593:26784,40594:26810,40595:26895,40596:26765,40597:26750,40598:26881,40599:26826,40600:26888,40601:26840,40602:26914,40603:26918,40604:26849,40605:26892,40606:26829,40607:26836,40608:26855,40609:26837,40610:26934,40611:26898,40612:26884,40613:26839,40614:26851,40615:26917,40616:26873,40617:26848,40618:26863,40619:26920,40620:26922,40621:26906,40622:26915,40623:26913,40624:26822,40625:27001,40626:26999,40627:26972,40628:27e3,40629:26987,40630:26964,40631:27006,40632:26990,40633:26937,40634:26996,40635:26941,40636:26969,40637:26928,40638:26977,40639:26974,40640:26973,40641:27009,40642:26986,40643:27058,40644:27054,40645:27088,40646:27071,40647:27073,40648:27091,40649:27070,40650:27086,40651:23528,40652:27082,40653:27101,40654:27067,40655:27075,40656:27047,40657:27182,40658:27025,40659:27040,40660:27036,40661:27029,40662:27060,40663:27102,40664:27112,40665:27138,40666:27163,40667:27135,40668:27402,40669:27129,40670:27122,40671:27111,40672:27141,40673:27057,40674:27166,40675:27117,40676:27156,40677:27115,40678:27146,40679:27154,40680:27329,40681:27171,40682:27155,40683:27204,40684:27148,40685:27250,40686:27190,40687:27256,40688:27207,40689:27234,40690:27225,40691:27238,40692:27208,40693:27192,40694:27170,40695:27280,40696:27277,40697:27296,40698:27268,40699:27298,40700:27299,40768:27287,40769:34327,40770:27323,40771:27331,40772:27330,40773:27320,40774:27315,40775:27308,40776:27358,40777:27345,40778:27359,40779:27306,40780:27354,40781:27370,40782:27387,40783:27397,40784:34326,40785:27386,40786:27410,40787:27414,40788:39729,40789:27423,40790:27448,40791:27447,40792:30428,40793:27449,40794:39150,40795:27463,40796:27459,40797:27465,40798:27472,40799:27481,40800:27476,40801:27483,40802:27487,40803:27489,40804:27512,40805:27513,40806:27519,40807:27520,40808:27524,40809:27523,40810:27533,40811:27544,40812:27541,40813:27550,40814:27556,40815:27562,40816:27563,40817:27567,40818:27570,40819:27569,40820:27571,40821:27575,40822:27580,40823:27590,40824:27595,40825:27603,40826:27615,40827:27628,40828:27627,40829:27635,40830:27631,40832:40638,40833:27656,40834:27667,40835:27668,40836:27675,40837:27684,40838:27683,40839:27742,40840:27733,40841:27746,40842:27754,40843:27778,40844:27789,40845:27802,40846:27777,40847:27803,40848:27774,40849:27752,40850:27763,40851:27794,40852:27792,40853:27844,40854:27889,40855:27859,40856:27837,40857:27863,40858:27845,40859:27869,40860:27822,40861:27825,40862:27838,40863:27834,40864:27867,40865:27887,40866:27865,40867:27882,40868:27935,40869:34893,40870:27958,40871:27947,40872:27965,40873:27960,40874:27929,40875:27957,40876:27955,40877:27922,40878:27916,40879:28003,40880:28051,40881:28004,40882:27994,40883:28025,40884:27993,40885:28046,40886:28053,40887:28644,40888:28037,40889:28153,40890:28181,40891:28170,40892:28085,40893:28103,40894:28134,40895:28088,40896:28102,40897:28140,40898:28126,40899:28108,40900:28136,40901:28114,40902:28101,40903:28154,40904:28121,40905:28132,40906:28117,40907:28138,40908:28142,40909:28205,40910:28270,40911:28206,40912:28185,40913:28274,40914:28255,40915:28222,40916:28195,40917:28267,40918:28203,40919:28278,40920:28237,40921:28191,40922:28227,40923:28218,40924:28238,40925:28196,40926:28415,40927:28189,40928:28216,40929:28290,40930:28330,40931:28312,40932:28361,40933:28343,40934:28371,40935:28349,40936:28335,40937:28356,40938:28338,40939:28372,40940:28373,40941:28303,40942:28325,40943:28354,40944:28319,40945:28481,40946:28433,40947:28748,40948:28396,40949:28408,40950:28414,40951:28479,40952:28402,40953:28465,40954:28399,40955:28466,40956:28364,161:65377,162:65378,163:65379,164:65380,165:65381,166:65382,167:65383,168:65384,169:65385,170:65386,171:65387,172:65388,173:65389,174:65390,175:65391,176:65392,177:65393,178:65394,179:65395,180:65396,181:65397,182:65398,183:65399,184:65400,185:65401,186:65402,187:65403,188:65404,189:65405,190:65406,191:65407,192:65408,193:65409,194:65410,195:65411,196:65412,197:65413,198:65414,199:65415,200:65416,201:65417,202:65418,203:65419,204:65420,205:65421,206:65422,207:65423,208:65424,209:65425,210:65426,211:65427,212:65428,213:65429,214:65430,215:65431,216:65432,217:65433,218:65434,219:65435,220:65436,221:65437,222:65438,223:65439,57408:28478,57409:28435,57410:28407,57411:28550,57412:28538,57413:28536,57414:28545,57415:28544,57416:28527,57417:28507,57418:28659,57419:28525,57420:28546,57421:28540,57422:28504,57423:28558,57424:28561,57425:28610,57426:28518,57427:28595,57428:28579,57429:28577,57430:28580,57431:28601,57432:28614,57433:28586,57434:28639,57435:28629,57436:28652,57437:28628,57438:28632,57439:28657,57440:28654,57441:28635,57442:28681,57443:28683,57444:28666,57445:28689,57446:28673,57447:28687,57448:28670,57449:28699,57450:28698,57451:28532,57452:28701,57453:28696,57454:28703,57455:28720,57456:28734,57457:28722,57458:28753,57459:28771,57460:28825,57461:28818,57462:28847,57463:28913,57464:28844,57465:28856,57466:28851,57467:28846,57468:28895,57469:28875,57470:28893,57472:28889,57473:28937,57474:28925,57475:28956,57476:28953,57477:29029,57478:29013,57479:29064,57480:29030,57481:29026,57482:29004,57483:29014,57484:29036,57485:29071,57486:29179,57487:29060,57488:29077,57489:29096,57490:29100,57491:29143,57492:29113,57493:29118,57494:29138,57495:29129,57496:29140,57497:29134,57498:29152,57499:29164,57500:29159,57501:29173,57502:29180,57503:29177,57504:29183,57505:29197,57506:29200,57507:29211,57508:29224,57509:29229,57510:29228,57511:29232,57512:29234,57513:29243,57514:29244,57515:29247,57516:29248,57517:29254,57518:29259,57519:29272,57520:29300,57521:29310,57522:29314,57523:29313,57524:29319,57525:29330,57526:29334,57527:29346,57528:29351,57529:29369,57530:29362,57531:29379,57532:29382,57533:29380,57534:29390,57535:29394,57536:29410,57537:29408,57538:29409,57539:29433,57540:29431,57541:20495,57542:29463,57543:29450,57544:29468,57545:29462,57546:29469,57547:29492,57548:29487,57549:29481,57550:29477,57551:29502,57552:29518,57553:29519,57554:40664,57555:29527,57556:29546,57557:29544,57558:29552,57559:29560,57560:29557,57561:29563,57562:29562,57563:29640,57564:29619,57565:29646,57566:29627,57567:29632,57568:29669,57569:29678,57570:29662,57571:29858,57572:29701,57573:29807,57574:29733,57575:29688,57576:29746,57577:29754,57578:29781,57579:29759,57580:29791,57581:29785,57582:29761,57583:29788,57584:29801,57585:29808,57586:29795,57587:29802,57588:29814,57589:29822,57590:29835,57591:29854,57592:29863,57593:29898,57594:29903,57595:29908,57596:29681,57664:29920,57665:29923,57666:29927,57667:29929,57668:29934,57669:29938,57670:29936,57671:29937,57672:29944,57673:29943,57674:29956,57675:29955,57676:29957,57677:29964,57678:29966,57679:29965,57680:29973,57681:29971,57682:29982,57683:29990,57684:29996,57685:30012,57686:30020,57687:30029,57688:30026,57689:30025,57690:30043,57691:30022,57692:30042,57693:30057,57694:30052,57695:30055,57696:30059,57697:30061,57698:30072,57699:30070,57700:30086,57701:30087,57702:30068,57703:30090,57704:30089,57705:30082,57706:30100,57707:30106,57708:30109,57709:30117,57710:30115,57711:30146,57712:30131,57713:30147,57714:30133,57715:30141,57716:30136,57717:30140,57718:30129,57719:30157,57720:30154,57721:30162,57722:30169,57723:30179,57724:30174,57725:30206,57726:30207,57728:30204,57729:30209,57730:30192,57731:30202,57732:30194,57733:30195,57734:30219,57735:30221,57736:30217,57737:30239,57738:30247,57739:30240,57740:30241,57741:30242,57742:30244,57743:30260,57744:30256,57745:30267,57746:30279,57747:30280,57748:30278,57749:30300,57750:30296,57751:30305,57752:30306,57753:30312,57754:30313,57755:30314,57756:30311,57757:30316,57758:30320,57759:30322,57760:30326,57761:30328,57762:30332,57763:30336,57764:30339,57765:30344,57766:30347,57767:30350,57768:30358,57769:30355,57770:30361,57771:30362,57772:30384,57773:30388,57774:30392,57775:30393,57776:30394,57777:30402,57778:30413,57779:30422,57780:30418,57781:30430,57782:30433,57783:30437,57784:30439,57785:30442,57786:34351,57787:30459,57788:30472,57789:30471,57790:30468,57791:30505,57792:30500,57793:30494,57794:30501,57795:30502,57796:30491,57797:30519,57798:30520,57799:30535,57800:30554,57801:30568,57802:30571,57803:30555,57804:30565,57805:30591,57806:30590,57807:30585,57808:30606,57809:30603,57810:30609,57811:30624,57812:30622,57813:30640,57814:30646,57815:30649,57816:30655,57817:30652,57818:30653,57819:30651,57820:30663,57821:30669,57822:30679,57823:30682,57824:30684,57825:30691,57826:30702,57827:30716,57828:30732,57829:30738,57830:31014,57831:30752,57832:31018,57833:30789,57834:30862,57835:30836,57836:30854,57837:30844,57838:30874,57839:30860,57840:30883,57841:30901,57842:30890,57843:30895,57844:30929,57845:30918,57846:30923,57847:30932,57848:30910,57849:30908,57850:30917,57851:30922,57852:30956,57920:30951,57921:30938,57922:30973,57923:30964,57924:30983,57925:30994,57926:30993,57927:31001,57928:31020,57929:31019,57930:31040,57931:31072,57932:31063,57933:31071,57934:31066,57935:31061,57936:31059,57937:31098,57938:31103,57939:31114,57940:31133,57941:31143,57942:40779,57943:31146,57944:31150,57945:31155,57946:31161,57947:31162,57948:31177,57949:31189,57950:31207,57951:31212,57952:31201,57953:31203,57954:31240,57955:31245,57956:31256,57957:31257,57958:31264,57959:31263,57960:31104,57961:31281,57962:31291,57963:31294,57964:31287,57965:31299,57966:31319,57967:31305,57968:31329,57969:31330,57970:31337,57971:40861,57972:31344,57973:31353,57974:31357,57975:31368,57976:31383,57977:31381,57978:31384,57979:31382,57980:31401,57981:31432,57982:31408,57984:31414,57985:31429,57986:31428,57987:31423,57988:36995,57989:31431,57990:31434,57991:31437,57992:31439,57993:31445,57994:31443,57995:31449,57996:31450,57997:31453,57998:31457,57999:31458,58000:31462,58001:31469,58002:31472,58003:31490,58004:31503,58005:31498,58006:31494,58007:31539,58008:31512,58009:31513,58010:31518,58011:31541,58012:31528,58013:31542,58014:31568,58015:31610,58016:31492,58017:31565,58018:31499,58019:31564,58020:31557,58021:31605,58022:31589,58023:31604,58024:31591,58025:31600,58026:31601,58027:31596,58028:31598,58029:31645,58030:31640,58031:31647,58032:31629,58033:31644,58034:31642,58035:31627,58036:31634,58037:31631,58038:31581,58039:31641,58040:31691,58041:31681,58042:31692,58043:31695,58044:31668,58045:31686,58046:31709,58047:31721,58048:31761,58049:31764,58050:31718,58051:31717,58052:31840,58053:31744,58054:31751,58055:31763,58056:31731,58057:31735,58058:31767,58059:31757,58060:31734,58061:31779,58062:31783,58063:31786,58064:31775,58065:31799,58066:31787,58067:31805,58068:31820,58069:31811,58070:31828,58071:31823,58072:31808,58073:31824,58074:31832,58075:31839,58076:31844,58077:31830,58078:31845,58079:31852,58080:31861,58081:31875,58082:31888,58083:31908,58084:31917,58085:31906,58086:31915,58087:31905,58088:31912,58089:31923,58090:31922,58091:31921,58092:31918,58093:31929,58094:31933,58095:31936,58096:31941,58097:31938,58098:31960,58099:31954,58100:31964,58101:31970,58102:39739,58103:31983,58104:31986,58105:31988,58106:31990,58107:31994,58108:32006,58176:32002,58177:32028,58178:32021,58179:32010,58180:32069,58181:32075,58182:32046,58183:32050,58184:32063,58185:32053,58186:32070,58187:32115,58188:32086,58189:32078,58190:32114,58191:32104,58192:32110,58193:32079,58194:32099,58195:32147,58196:32137,58197:32091,58198:32143,58199:32125,58200:32155,58201:32186,58202:32174,58203:32163,58204:32181,58205:32199,58206:32189,58207:32171,58208:32317,58209:32162,58210:32175,58211:32220,58212:32184,58213:32159,58214:32176,58215:32216,58216:32221,58217:32228,58218:32222,58219:32251,58220:32242,58221:32225,58222:32261,58223:32266,58224:32291,58225:32289,58226:32274,58227:32305,58228:32287,58229:32265,58230:32267,58231:32290,58232:32326,58233:32358,58234:32315,58235:32309,58236:32313,58237:32323,58238:32311,58240:32306,58241:32314,58242:32359,58243:32349,58244:32342,58245:32350,58246:32345,58247:32346,58248:32377,58249:32362,58250:32361,58251:32380,58252:32379,58253:32387,58254:32213,58255:32381,58256:36782,58257:32383,58258:32392,58259:32393,58260:32396,58261:32402,58262:32400,58263:32403,58264:32404,58265:32406,58266:32398,58267:32411,58268:32412,58269:32568,58270:32570,58271:32581,58272:32588,58273:32589,58274:32590,58275:32592,58276:32593,58277:32597,58278:32596,58279:32600,58280:32607,58281:32608,58282:32616,58283:32617,58284:32615,58285:32632,58286:32642,58287:32646,58288:32643,58289:32648,58290:32647,58291:32652,58292:32660,58293:32670,58294:32669,58295:32666,58296:32675,58297:32687,58298:32690,58299:32697,58300:32686,58301:32694,58302:32696,58303:35697,58304:32709,58305:32710,58306:32714,58307:32725,58308:32724,58309:32737,58310:32742,58311:32745,58312:32755,58313:32761,58314:39132,58315:32774,58316:32772,58317:32779,58318:32786,58319:32792,58320:32793,58321:32796,58322:32801,58323:32808,58324:32831,58325:32827,58326:32842,58327:32838,58328:32850,58329:32856,58330:32858,58331:32863,58332:32866,58333:32872,58334:32883,58335:32882,58336:32880,58337:32886,58338:32889,58339:32893,58340:32895,58341:32900,58342:32902,58343:32901,58344:32923,58345:32915,58346:32922,58347:32941,58348:20880,58349:32940,58350:32987,58351:32997,58352:32985,58353:32989,58354:32964,58355:32986,58356:32982,58357:33033,58358:33007,58359:33009,58360:33051,58361:33065,58362:33059,58363:33071,58364:33099,58432:38539,58433:33094,58434:33086,58435:33107,58436:33105,58437:33020,58438:33137,58439:33134,58440:33125,58441:33126,58442:33140,58443:33155,58444:33160,58445:33162,58446:33152,58447:33154,58448:33184,58449:33173,58450:33188,58451:33187,58452:33119,58453:33171,58454:33193,58455:33200,58456:33205,58457:33214,58458:33208,58459:33213,58460:33216,58461:33218,58462:33210,58463:33225,58464:33229,58465:33233,58466:33241,58467:33240,58468:33224,58469:33242,58470:33247,58471:33248,58472:33255,58473:33274,58474:33275,58475:33278,58476:33281,58477:33282,58478:33285,58479:33287,58480:33290,58481:33293,58482:33296,58483:33302,58484:33321,58485:33323,58486:33336,58487:33331,58488:33344,58489:33369,58490:33368,58491:33373,58492:33370,58493:33375,58494:33380,58496:33378,58497:33384,58498:33386,58499:33387,58500:33326,58501:33393,58502:33399,58503:33400,58504:33406,58505:33421,58506:33426,58507:33451,58508:33439,58509:33467,58510:33452,58511:33505,58512:33507,58513:33503,58514:33490,58515:33524,58516:33523,58517:33530,58518:33683,58519:33539,58520:33531,58521:33529,58522:33502,58523:33542,58524:33500,58525:33545,58526:33497,58527:33589,58528:33588,58529:33558,58530:33586,58531:33585,58532:33600,58533:33593,58534:33616,58535:33605,58536:33583,58537:33579,58538:33559,58539:33560,58540:33669,58541:33690,58542:33706,58543:33695,58544:33698,58545:33686,58546:33571,58547:33678,58548:33671,58549:33674,58550:33660,58551:33717,58552:33651,58553:33653,58554:33696,58555:33673,58556:33704,58557:33780,58558:33811,58559:33771,58560:33742,58561:33789,58562:33795,58563:33752,58564:33803,58565:33729,58566:33783,58567:33799,58568:33760,58569:33778,58570:33805,58571:33826,58572:33824,58573:33725,58574:33848,58575:34054,58576:33787,58577:33901,58578:33834,58579:33852,58580:34138,58581:33924,58582:33911,58583:33899,58584:33965,58585:33902,58586:33922,58587:33897,58588:33862,58589:33836,58590:33903,58591:33913,58592:33845,58593:33994,58594:33890,58595:33977,58596:33983,58597:33951,58598:34009,58599:33997,58600:33979,58601:34010,58602:34e3,58603:33985,58604:33990,58605:34006,58606:33953,58607:34081,58608:34047,58609:34036,58610:34071,58611:34072,58612:34092,58613:34079,58614:34069,58615:34068,58616:34044,58617:34112,58618:34147,58619:34136,58620:34120,58688:34113,58689:34306,58690:34123,58691:34133,58692:34176,58693:34212,58694:34184,58695:34193,58696:34186,58697:34216,58698:34157,58699:34196,58700:34203,58701:34282,58702:34183,58703:34204,58704:34167,58705:34174,58706:34192,58707:34249,58708:34234,58709:34255,58710:34233,58711:34256,58712:34261,58713:34269,58714:34277,58715:34268,58716:34297,58717:34314,58718:34323,58719:34315,58720:34302,58721:34298,58722:34310,58723:34338,58724:34330,58725:34352,58726:34367,58727:34381,58728:20053,58729:34388,58730:34399,58731:34407,58732:34417,58733:34451,58734:34467,58735:34473,58736:34474,58737:34443,58738:34444,58739:34486,58740:34479,58741:34500,58742:34502,58743:34480,58744:34505,58745:34851,58746:34475,58747:34516,58748:34526,58749:34537,58750:34540,58752:34527,58753:34523,58754:34543,58755:34578,58756:34566,58757:34568,58758:34560,58759:34563,58760:34555,58761:34577,58762:34569,58763:34573,58764:34553,58765:34570,58766:34612,58767:34623,58768:34615,58769:34619,58770:34597,58771:34601,58772:34586,58773:34656,58774:34655,58775:34680,58776:34636,58777:34638,58778:34676,58779:34647,58780:34664,58781:34670,58782:34649,58783:34643,58784:34659,58785:34666,58786:34821,58787:34722,58788:34719,58789:34690,58790:34735,58791:34763,58792:34749,58793:34752,58794:34768,58795:38614,58796:34731,58797:34756,58798:34739,58799:34759,58800:34758,58801:34747,58802:34799,58803:34802,58804:34784,58805:34831,58806:34829,58807:34814,58808:34806,58809:34807,58810:34830,58811:34770,58812:34833,58813:34838,58814:34837,58815:34850,58816:34849,58817:34865,58818:34870,58819:34873,58820:34855,58821:34875,58822:34884,58823:34882,58824:34898,58825:34905,58826:34910,58827:34914,58828:34923,58829:34945,58830:34942,58831:34974,58832:34933,58833:34941,58834:34997,58835:34930,58836:34946,58837:34967,58838:34962,58839:34990,58840:34969,58841:34978,58842:34957,58843:34980,58844:34992,58845:35007,58846:34993,58847:35011,58848:35012,58849:35028,58850:35032,58851:35033,58852:35037,58853:35065,58854:35074,58855:35068,58856:35060,58857:35048,58858:35058,58859:35076,58860:35084,58861:35082,58862:35091,58863:35139,58864:35102,58865:35109,58866:35114,58867:35115,58868:35137,58869:35140,58870:35131,58871:35126,58872:35128,58873:35148,58874:35101,58875:35168,58876:35166,58944:35174,58945:35172,58946:35181,58947:35178,58948:35183,58949:35188,58950:35191,58951:35198,58952:35203,58953:35208,58954:35210,58955:35219,58956:35224,58957:35233,58958:35241,58959:35238,58960:35244,58961:35247,58962:35250,58963:35258,58964:35261,58965:35263,58966:35264,58967:35290,58968:35292,58969:35293,58970:35303,58971:35316,58972:35320,58973:35331,58974:35350,58975:35344,58976:35340,58977:35355,58978:35357,58979:35365,58980:35382,58981:35393,58982:35419,58983:35410,58984:35398,58985:35400,58986:35452,58987:35437,58988:35436,58989:35426,58990:35461,58991:35458,58992:35460,58993:35496,58994:35489,58995:35473,58996:35493,58997:35494,58998:35482,58999:35491,59000:35524,59001:35533,59002:35522,59003:35546,59004:35563,59005:35571,59006:35559,59008:35556,59009:35569,59010:35604,59011:35552,59012:35554,59013:35575,59014:35550,59015:35547,59016:35596,59017:35591,59018:35610,59019:35553,59020:35606,59021:35600,59022:35607,59023:35616,59024:35635,59025:38827,59026:35622,59027:35627,59028:35646,59029:35624,59030:35649,59031:35660,59032:35663,59033:35662,59034:35657,59035:35670,59036:35675,59037:35674,59038:35691,59039:35679,59040:35692,59041:35695,59042:35700,59043:35709,59044:35712,59045:35724,59046:35726,59047:35730,59048:35731,59049:35734,59050:35737,59051:35738,59052:35898,59053:35905,59054:35903,59055:35912,59056:35916,59057:35918,59058:35920,59059:35925,59060:35938,59061:35948,59062:35960,59063:35962,59064:35970,59065:35977,59066:35973,59067:35978,59068:35981,59069:35982,59070:35988,59071:35964,59072:35992,59073:25117,59074:36013,59075:36010,59076:36029,59077:36018,59078:36019,59079:36014,59080:36022,59081:36040,59082:36033,59083:36068,59084:36067,59085:36058,59086:36093,59087:36090,59088:36091,59089:36100,59090:36101,59091:36106,59092:36103,59093:36111,59094:36109,59095:36112,59096:40782,59097:36115,59098:36045,59099:36116,59100:36118,59101:36199,59102:36205,59103:36209,59104:36211,59105:36225,59106:36249,59107:36290,59108:36286,59109:36282,59110:36303,59111:36314,59112:36310,59113:36300,59114:36315,59115:36299,59116:36330,59117:36331,59118:36319,59119:36323,59120:36348,59121:36360,59122:36361,59123:36351,59124:36381,59125:36382,59126:36368,59127:36383,59128:36418,59129:36405,59130:36400,59131:36404,59132:36426,59200:36423,59201:36425,59202:36428,59203:36432,59204:36424,59205:36441,59206:36452,59207:36448,59208:36394,59209:36451,59210:36437,59211:36470,59212:36466,59213:36476,59214:36481,59215:36487,59216:36485,59217:36484,59218:36491,59219:36490,59220:36499,59221:36497,59222:36500,59223:36505,59224:36522,59225:36513,59226:36524,59227:36528,59228:36550,59229:36529,59230:36542,59231:36549,59232:36552,59233:36555,59234:36571,59235:36579,59236:36604,59237:36603,59238:36587,59239:36606,59240:36618,59241:36613,59242:36629,59243:36626,59244:36633,59245:36627,59246:36636,59247:36639,59248:36635,59249:36620,59250:36646,59251:36659,59252:36667,59253:36665,59254:36677,59255:36674,59256:36670,59257:36684,59258:36681,59259:36678,59260:36686,59261:36695,59262:36700,59264:36706,59265:36707,59266:36708,59267:36764,59268:36767,59269:36771,59270:36781,59271:36783,59272:36791,59273:36826,59274:36837,59275:36834,59276:36842,59277:36847,59278:36999,59279:36852,59280:36869,59281:36857,59282:36858,59283:36881,59284:36885,59285:36897,59286:36877,59287:36894,59288:36886,59289:36875,59290:36903,59291:36918,59292:36917,59293:36921,59294:36856,59295:36943,59296:36944,59297:36945,59298:36946,59299:36878,59300:36937,59301:36926,59302:36950,59303:36952,59304:36958,59305:36968,59306:36975,59307:36982,59308:38568,59309:36978,59310:36994,59311:36989,59312:36993,59313:36992,59314:37002,59315:37001,59316:37007,59317:37032,59318:37039,59319:37041,59320:37045,59321:37090,59322:37092,59323:25160,59324:37083,59325:37122,59326:37138,59327:37145,59328:37170,59329:37168,59330:37194,59331:37206,59332:37208,59333:37219,59334:37221,59335:37225,59336:37235,59337:37234,59338:37259,59339:37257,59340:37250,59341:37282,59342:37291,59343:37295,59344:37290,59345:37301,59346:37300,59347:37306,59348:37312,59349:37313,59350:37321,59351:37323,59352:37328,59353:37334,59354:37343,59355:37345,59356:37339,59357:37372,59358:37365,59359:37366,59360:37406,59361:37375,59362:37396,59363:37420,59364:37397,59365:37393,59366:37470,59367:37463,59368:37445,59369:37449,59370:37476,59371:37448,59372:37525,59373:37439,59374:37451,59375:37456,59376:37532,59377:37526,59378:37523,59379:37531,59380:37466,59381:37583,59382:37561,59383:37559,59384:37609,59385:37647,59386:37626,59387:37700,59388:37678,59456:37657,59457:37666,59458:37658,59459:37667,59460:37690,59461:37685,59462:37691,59463:37724,59464:37728,59465:37756,59466:37742,59467:37718,59468:37808,59469:37804,59470:37805,59471:37780,59472:37817,59473:37846,59474:37847,59475:37864,59476:37861,59477:37848,59478:37827,59479:37853,59480:37840,59481:37832,59482:37860,59483:37914,59484:37908,59485:37907,59486:37891,59487:37895,59488:37904,59489:37942,59490:37931,59491:37941,59492:37921,59493:37946,59494:37953,59495:37970,59496:37956,59497:37979,59498:37984,59499:37986,59500:37982,59501:37994,59502:37417,59503:38e3,59504:38005,59505:38007,59506:38013,59507:37978,59508:38012,59509:38014,59510:38017,59511:38015,59512:38274,59513:38279,59514:38282,59515:38292,59516:38294,59517:38296,59518:38297,59520:38304,59521:38312,59522:38311,59523:38317,59524:38332,59525:38331,59526:38329,59527:38334,59528:38346,59529:28662,59530:38339,59531:38349,59532:38348,59533:38357,59534:38356,59535:38358,59536:38364,59537:38369,59538:38373,59539:38370,59540:38433,59541:38440,59542:38446,59543:38447,59544:38466,59545:38476,59546:38479,59547:38475,59548:38519,59549:38492,59550:38494,59551:38493,59552:38495,59553:38502,59554:38514,59555:38508,59556:38541,59557:38552,59558:38549,59559:38551,59560:38570,59561:38567,59562:38577,59563:38578,59564:38576,59565:38580,59566:38582,59567:38584,59568:38585,59569:38606,59570:38603,59571:38601,59572:38605,59573:35149,59574:38620,59575:38669,59576:38613,59577:38649,59578:38660,59579:38662,59580:38664,59581:38675,59582:38670,59583:38673,59584:38671,59585:38678,59586:38681,59587:38692,59588:38698,59589:38704,59590:38713,59591:38717,59592:38718,59593:38724,59594:38726,59595:38728,59596:38722,59597:38729,59598:38748,59599:38752,59600:38756,59601:38758,59602:38760,59603:21202,59604:38763,59605:38769,59606:38777,59607:38789,59608:38780,59609:38785,59610:38778,59611:38790,59612:38795,59613:38799,59614:38800,59615:38812,59616:38824,59617:38822,59618:38819,59619:38835,59620:38836,59621:38851,59622:38854,59623:38856,59624:38859,59625:38876,59626:38893,59627:40783,59628:38898,59629:31455,59630:38902,59631:38901,59632:38927,59633:38924,59634:38968,59635:38948,59636:38945,59637:38967,59638:38973,59639:38982,59640:38991,59641:38987,59642:39019,59643:39023,59644:39024,59712:39025,59713:39028,59714:39027,59715:39082,59716:39087,59717:39089,59718:39094,59719:39108,59720:39107,59721:39110,59722:39145,59723:39147,59724:39171,59725:39177,59726:39186,59727:39188,59728:39192,59729:39201,59730:39197,59731:39198,59732:39204,59733:39200,59734:39212,59735:39214,59736:39229,59737:39230,59738:39234,59739:39241,59740:39237,59741:39248,59742:39243,59743:39249,59744:39250,59745:39244,59746:39253,59747:39319,59748:39320,59749:39333,59750:39341,59751:39342,59752:39356,59753:39391,59754:39387,59755:39389,59756:39384,59757:39377,59758:39405,59759:39406,59760:39409,59761:39410,59762:39419,59763:39416,59764:39425,59765:39439,59766:39429,59767:39394,59768:39449,59769:39467,59770:39479,59771:39493,59772:39490,59773:39488,59774:39491,59776:39486,59777:39509,59778:39501,59779:39515,59780:39511,59781:39519,59782:39522,59783:39525,59784:39524,59785:39529,59786:39531,59787:39530,59788:39597,59789:39600,59790:39612,59791:39616,59792:39631,59793:39633,59794:39635,59795:39636,59796:39646,59797:39647,59798:39650,59799:39651,59800:39654,59801:39663,59802:39659,59803:39662,59804:39668,59805:39665,59806:39671,59807:39675,59808:39686,59809:39704,59810:39706,59811:39711,59812:39714,59813:39715,59814:39717,59815:39719,59816:39720,59817:39721,59818:39722,59819:39726,59820:39727,59821:39730,59822:39748,59823:39747,59824:39759,59825:39757,59826:39758,59827:39761,59828:39768,59829:39796,59830:39827,59831:39811,59832:39825,59833:39830,59834:39831,59835:39839,59836:39840,59837:39848,59838:39860,59839:39872,59840:39882,59841:39865,59842:39878,59843:39887,59844:39889,59845:39890,59846:39907,59847:39906,59848:39908,59849:39892,59850:39905,59851:39994,59852:39922,59853:39921,59854:39920,59855:39957,59856:39956,59857:39945,59858:39955,59859:39948,59860:39942,59861:39944,59862:39954,59863:39946,59864:39940,59865:39982,59866:39963,59867:39973,59868:39972,59869:39969,59870:39984,59871:40007,59872:39986,59873:40006,59874:39998,59875:40026,59876:40032,59877:40039,59878:40054,59879:40056,59880:40167,59881:40172,59882:40176,59883:40201,59884:40200,59885:40171,59886:40195,59887:40198,59888:40234,59889:40230,59890:40367,59891:40227,59892:40223,59893:40260,59894:40213,59895:40210,59896:40257,59897:40255,59898:40254,59899:40262,59900:40264,59968:40285,59969:40286,59970:40292,59971:40273,59972:40272,59973:40281,59974:40306,59975:40329,59976:40327,59977:40363,59978:40303,59979:40314,59980:40346,59981:40356,59982:40361,59983:40370,59984:40388,59985:40385,59986:40379,59987:40376,59988:40378,59989:40390,59990:40399,59991:40386,59992:40409,59993:40403,59994:40440,59995:40422,59996:40429,59997:40431,59998:40445,59999:40474,60000:40475,60001:40478,60002:40565,60003:40569,60004:40573,60005:40577,60006:40584,60007:40587,60008:40588,60009:40594,60010:40597,60011:40593,60012:40605,60013:40613,60014:40617,60015:40632,60016:40618,60017:40621,60018:38753,60019:40652,60020:40654,60021:40655,60022:40656,60023:40660,60024:40668,60025:40670,60026:40669,60027:40672,60028:40677,60029:40680,60030:40687,60032:40692,60033:40694,60034:40695,60035:40697,60036:40699,60037:40700,60038:40701,60039:40711,60040:40712,60041:30391,60042:40725,60043:40737,60044:40748,60045:40766,60046:40778,60047:40786,60048:40788,60049:40803,60050:40799,60051:40800,60052:40801,60053:40806,60054:40807,60055:40812,60056:40810,60057:40823,60058:40818,60059:40822,60060:40853,60061:40860,60062:40864,60063:22575,60064:27079,60065:36953,60066:29796,60067:20956,60068:29081}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(1),i=r(2);t.decode=function(e,t){var r=new Uint8ClampedArray(e.length);r.set(e);for(var s=new n.default(285,256,0),o=new i.default(s,r),a=new Uint8ClampedArray(t),u=!1,l=0;l=n/2;){var l=s,c=a;if(a=u,(s=o).isZero())return null;o=l;for(var h=e.zero,p=s.getCoefficient(s.degree()),f=e.inverse(p);o.degree()>=s.degree()&&!o.isZero();){var d=o.degree()-s.degree(),m=e.multiply(o.getCoefficient(o.degree()),f);h=h.addOrSubtract(e.buildMonomial(d,m)),o=o.addOrSubtract(s.multiplyByMonomial(d,m))}if(u=h.multiplyPoly(a).addOrSubtract(c),o.degree()>=s.degree())return null}var g=u.getCoefficient(0);if(0===g)return null;var v=e.inverse(g);return[u.multiply(v),o.multiply(v)]}(s,s.buildMonomial(t,1),h,t);if(null===p)return null;var f=function(e,t){var r=t.degree();if(1===r)return[t.getCoefficient(1)];for(var n=new Array(r),i=0,s=1;sMath.abs(t.x-e.x);c?(i=Math.floor(e.y),s=Math.floor(e.x),a=Math.floor(t.y),u=Math.floor(t.x)):(i=Math.floor(e.x),s=Math.floor(e.y),a=Math.floor(t.x),u=Math.floor(t.y));for(var h=Math.abs(a-i),p=Math.abs(u-s),f=Math.floor(-h/2),d=i0){if(y===u)break;y+=m,f-=h}}for(var x=[],w=0;w=15&&v.length?v[0]:g,dimension:u}}t.locate=function(e){for(var t=[],r=[],u=[],l=[],c=function(n){for(var o=0,c=!1,h=[0,0,0,0,0],p=function(t){var u=e.get(t,n);if(u===c)o++;else{h=[h[1],h[2],h[3],h[4],o],o=1,c=u;var p=a(h)/7,f=Math.abs(h[0]-p)=e.bottom.startX&&v<=e.bottom.endX||g>=e.bottom.startX&&v<=e.bottom.endX||v<=e.bottom.startX&&g>=e.bottom.endX&&h[2]/(e.bottom.endX-e.bottom.startX)i})).length>0?_[0].bottom=y:r.push({top:y,bottom:y})}if(m){var _,b=t-h[4],x=b-h[3];y={startX:x,y:n,endX:b},(_=l.filter(function(e){return x>=e.bottom.startX&&x<=e.bottom.endX||b>=e.bottom.startX&&x<=e.bottom.endX||x<=e.bottom.startX&&b>=e.bottom.endX&&h[2]/(e.bottom.endX-e.bottom.startX)i})).length>0?_[0].bottom=y:l.push({top:y,bottom:y})}}},f=-1;f<=e.width;f++)p(f);t.push.apply(t,r.filter(function(e){return e.bottom.y!==n&&e.bottom.y-e.top.y>=2})),r=r.filter(function(e){return e.bottom.y===n}),u.push.apply(u,l.filter(function(e){return e.bottom.y!==n})),l=l.filter(function(e){return e.bottom.y===n})},d=0;d<=e.height;d++)c(d);t.push.apply(t,r.filter(function(e){return e.bottom.y-e.top.y>=2})),u.push.apply(u,l);var m=t.filter(function(e){return e.bottom.y-e.top.y>=2}).map(function(t){var r=(t.top.startX+t.top.endX+t.bottom.startX+t.bottom.endX)/4,n=(t.top.y+t.bottom.y+1)/2;if(e.get(Math.round(r),Math.round(n))){var i=[t.top.endX-t.top.startX,t.bottom.endX-t.bottom.startX,t.bottom.y-t.top.y+1],s=a(i)/i.length;return{score:h({x:Math.round(r),y:Math.round(n)},[1,1,3,1,1],e),x:r,y:n,size:s}}}).filter(function(e){return!!e}).sort(function(e,t){return e.score-t.score}).map(function(e,t,r){if(t>n)return null;var i=r.filter(function(e,r){return t!==r}).map(function(t){return{x:t.x,y:t.y,score:t.score+Math.pow(t.size-e.size,2)/e.size,size:t.size}}).sort(function(e,t){return e.score-t.score});if(i.length<2)return null;var s=e.score+i[0].score+i[1].score;return{points:[e].concat(i.slice(0,2)),score:s}}).filter(function(e){return!!e}).sort(function(e,t){return e.score-t.score});if(0===m.length)return null;var g=function(e,t,r){var n,i,s,a,u,l,c,h=o(e,t),p=o(t,r),f=o(e,r);return p>=h&&p>=f?(u=(n=[t,e,r])[0],l=n[1],c=n[2]):f>=p&&f>=h?(u=(i=[e,t,r])[0],l=i[1],c=i[2]):(u=(s=[e,r,t])[0],l=s[1],c=s[2]),(c.x-l.x)*(u.y-l.y)-(c.y-l.y)*(u.x-l.x)<0&&(u=(a=[c,u])[0],c=a[1]),{bottomLeft:u,topLeft:l,topRight:c}}(m[0].points[0],m[0].points[1],m[0].points[2]),v=g.topRight,y=g.topLeft,_=g.bottomLeft,b=f(e,u,v,y,_),x=[];b&&x.push({alignmentPattern:{x:b.alignmentPattern.x,y:b.alignmentPattern.y},bottomLeft:{x:_.x,y:_.y},dimension:b.dimension,topLeft:{x:y.x,y:y.y},topRight:{x:v.x,y:v.y}});var w=p(e,v),E=p(e,y),T=p(e,_),A=f(e,u,w,E,T);return A&&x.push({alignmentPattern:{x:A.alignmentPattern.x,y:A.alignmentPattern.y},bottomLeft:{x:T.x,y:T.y},topLeft:{x:E.x,y:E.y},topRight:{x:w.x,y:w.y},dimension:A.dimension}),0===x.length?null:x}}]).default},"object"==typeof r&&"object"==typeof t?t.exports=i():"function"==typeof define&&define.amd?define([],i):"object"==typeof r?r.jsQR=i():n.jsQR=i()},{}],364:[function(e,t,r){"use strict";r.re=(()=>{throw new Error("`junk.re` was renamed to `junk.regex`")}),r.regex=new RegExp(["^npm-debug\\.log$","^\\..*\\.swp$","^\\.DS_Store$","^\\.AppleDouble$","^\\.LSOverride$","^Icon\\r$","^\\._.*","^\\.Spotlight-V100(?:$|\\/)","\\.Trashes","^__MACOSX$","~$","^Thumbs\\.db$","^ehthumbs\\.db$","^Desktop\\.ini$","@eaDir$"].join("|")),r.is=(e=>r.regex.test(e)),r.not=(e=>!r.is(e)),r.default=t.exports},{}],365:[function(e,t,r){(function(e){(function(){var n,i=200,s="Unsupported core-js use. Try https://npms.io/search?q=ponyfill.",o="Expected a function",a="Invalid `variable` option passed into `_.template`",u="__lodash_hash_undefined__",l=500,c="__lodash_placeholder__",h=1,p=2,f=4,d=1,m=2,g=1,v=2,y=4,_=8,b=16,x=32,w=64,E=128,T=256,A=512,S=30,k="...",C=800,I=16,R=1,O=2,L=1/0,P=9007199254740991,M=1.7976931348623157e308,B=NaN,N=4294967295,D=N-1,F=N>>>1,j=[["ary",E],["bind",g],["bindKey",v],["curry",_],["curryRight",b],["flip",A],["partial",x],["partialRight",w],["rearg",T]],U="[object Arguments]",$="[object Array]",V="[object AsyncFunction]",G="[object Boolean]",z="[object Date]",W="[object DOMException]",H="[object Error]",K="[object Function]",q="[object GeneratorFunction]",X="[object Map]",Y="[object Number]",Z="[object Null]",J="[object Object]",Q="[object Proxy]",ee="[object RegExp]",te="[object Set]",re="[object String]",ne="[object Symbol]",ie="[object Undefined]",se="[object WeakMap]",oe="[object WeakSet]",ae="[object ArrayBuffer]",ue="[object DataView]",le="[object Float32Array]",ce="[object Float64Array]",he="[object Int8Array]",pe="[object Int16Array]",fe="[object Int32Array]",de="[object Uint8Array]",me="[object Uint8ClampedArray]",ge="[object Uint16Array]",ve="[object Uint32Array]",ye=/\b__p \+= '';/g,_e=/\b(__p \+=) '' \+/g,be=/(__e\(.*?\)|\b__t\)) \+\n'';/g,xe=/&(?:amp|lt|gt|quot|#39);/g,we=/[&<>"']/g,Ee=RegExp(xe.source),Te=RegExp(we.source),Ae=/<%-([\s\S]+?)%>/g,Se=/<%([\s\S]+?)%>/g,ke=/<%=([\s\S]+?)%>/g,Ce=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Ie=/^\w*$/,Re=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Oe=/[\\^$.*+?()[\]{}|]/g,Le=RegExp(Oe.source),Pe=/^\s+/,Me=/\s/,Be=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,Ne=/\{\n\/\* \[wrapped with (.+)\] \*/,De=/,? & /,Fe=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,je=/[()=,{}\[\]\/\s]/,Ue=/\\(\\)?/g,$e=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,Ve=/\w*$/,Ge=/^[-+]0x[0-9a-f]+$/i,ze=/^0b[01]+$/i,We=/^\[object .+?Constructor\]$/,He=/^0o[0-7]+$/i,Ke=/^(?:0|[1-9]\d*)$/,qe=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,Xe=/($^)/,Ye=/['\n\r\u2028\u2029\\]/g,Ze="\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff",Je="\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",Qe="[\\ud800-\\udfff]",et="["+Je+"]",tt="["+Ze+"]",rt="\\d+",nt="[\\u2700-\\u27bf]",it="[a-z\\xdf-\\xf6\\xf8-\\xff]",st="[^\\ud800-\\udfff"+Je+rt+"\\u2700-\\u27bfa-z\\xdf-\\xf6\\xf8-\\xffA-Z\\xc0-\\xd6\\xd8-\\xde]",ot="\\ud83c[\\udffb-\\udfff]",at="[^\\ud800-\\udfff]",ut="(?:\\ud83c[\\udde6-\\uddff]){2}",lt="[\\ud800-\\udbff][\\udc00-\\udfff]",ct="[A-Z\\xc0-\\xd6\\xd8-\\xde]",ht="(?:"+it+"|"+st+")",pt="(?:"+ct+"|"+st+")",ft="(?:"+tt+"|"+ot+")"+"?",dt="[\\ufe0e\\ufe0f]?"+ft+("(?:\\u200d(?:"+[at,ut,lt].join("|")+")[\\ufe0e\\ufe0f]?"+ft+")*"),mt="(?:"+[nt,ut,lt].join("|")+")"+dt,gt="(?:"+[at+tt+"?",tt,ut,lt,Qe].join("|")+")",vt=RegExp("['’]","g"),yt=RegExp(tt,"g"),_t=RegExp(ot+"(?="+ot+")|"+gt+dt,"g"),bt=RegExp([ct+"?"+it+"+(?:['’](?:d|ll|m|re|s|t|ve))?(?="+[et,ct,"$"].join("|")+")",pt+"+(?:['’](?:D|LL|M|RE|S|T|VE))?(?="+[et,ct+ht,"$"].join("|")+")",ct+"?"+ht+"+(?:['’](?:d|ll|m|re|s|t|ve))?",ct+"+(?:['’](?:D|LL|M|RE|S|T|VE))?","\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])","\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",rt,mt].join("|"),"g"),xt=RegExp("[\\u200d\\ud800-\\udfff"+Ze+"\\ufe0e\\ufe0f]"),wt=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,Et=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],Tt=-1,At={};At[le]=At[ce]=At[he]=At[pe]=At[fe]=At[de]=At[me]=At[ge]=At[ve]=!0,At[U]=At[$]=At[ae]=At[G]=At[ue]=At[z]=At[H]=At[K]=At[X]=At[Y]=At[J]=At[ee]=At[te]=At[re]=At[se]=!1;var St={};St[U]=St[$]=St[ae]=St[ue]=St[G]=St[z]=St[le]=St[ce]=St[he]=St[pe]=St[fe]=St[X]=St[Y]=St[J]=St[ee]=St[te]=St[re]=St[ne]=St[de]=St[me]=St[ge]=St[ve]=!0,St[H]=St[K]=St[se]=!1;var kt={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},Ct=parseFloat,It=parseInt,Rt="object"==typeof e&&e&&e.Object===Object&&e,Ot="object"==typeof self&&self&&self.Object===Object&&self,Lt=Rt||Ot||Function("return this")(),Pt="object"==typeof r&&r&&!r.nodeType&&r,Mt=Pt&&"object"==typeof t&&t&&!t.nodeType&&t,Bt=Mt&&Mt.exports===Pt,Nt=Bt&&Rt.process,Dt=function(){try{var e=Mt&&Mt.require&&Mt.require("util").types;return e||Nt&&Nt.binding&&Nt.binding("util")}catch(e){}}(),Ft=Dt&&Dt.isArrayBuffer,jt=Dt&&Dt.isDate,Ut=Dt&&Dt.isMap,$t=Dt&&Dt.isRegExp,Vt=Dt&&Dt.isSet,Gt=Dt&&Dt.isTypedArray;function zt(e,t,r){switch(r.length){case 0:return e.call(t);case 1:return e.call(t,r[0]);case 2:return e.call(t,r[0],r[1]);case 3:return e.call(t,r[0],r[1],r[2])}return e.apply(t,r)}function Wt(e,t,r,n){for(var i=-1,s=null==e?0:e.length;++i-1}function Zt(e,t,r){for(var n=-1,i=null==e?0:e.length;++n-1;);return r}function br(e,t){for(var r=e.length;r--&&or(t,e[r],0)>-1;);return r}var xr=hr({"À":"A","Á":"A","Â":"A","Ã":"A","Ä":"A","Å":"A","à":"a","á":"a","â":"a","ã":"a","ä":"a","å":"a","Ç":"C","ç":"c","Ð":"D","ð":"d","È":"E","É":"E","Ê":"E","Ë":"E","è":"e","é":"e","ê":"e","ë":"e","Ì":"I","Í":"I","Î":"I","Ï":"I","ì":"i","í":"i","î":"i","ï":"i","Ñ":"N","ñ":"n","Ò":"O","Ó":"O","Ô":"O","Õ":"O","Ö":"O","Ø":"O","ò":"o","ó":"o","ô":"o","õ":"o","ö":"o","ø":"o","Ù":"U","Ú":"U","Û":"U","Ü":"U","ù":"u","ú":"u","û":"u","ü":"u","Ý":"Y","ý":"y","ÿ":"y","Æ":"Ae","æ":"ae","Þ":"Th","þ":"th","ß":"ss","Ā":"A","Ă":"A","Ą":"A","ā":"a","ă":"a","ą":"a","Ć":"C","Ĉ":"C","Ċ":"C","Č":"C","ć":"c","ĉ":"c","ċ":"c","č":"c","Ď":"D","Đ":"D","ď":"d","đ":"d","Ē":"E","Ĕ":"E","Ė":"E","Ę":"E","Ě":"E","ē":"e","ĕ":"e","ė":"e","ę":"e","ě":"e","Ĝ":"G","Ğ":"G","Ġ":"G","Ģ":"G","ĝ":"g","ğ":"g","ġ":"g","ģ":"g","Ĥ":"H","Ħ":"H","ĥ":"h","ħ":"h","Ĩ":"I","Ī":"I","Ĭ":"I","Į":"I","İ":"I","ĩ":"i","ī":"i","ĭ":"i","į":"i","ı":"i","Ĵ":"J","ĵ":"j","Ķ":"K","ķ":"k","ĸ":"k","Ĺ":"L","Ļ":"L","Ľ":"L","Ŀ":"L","Ł":"L","ĺ":"l","ļ":"l","ľ":"l","ŀ":"l","ł":"l","Ń":"N","Ņ":"N","Ň":"N","Ŋ":"N","ń":"n","ņ":"n","ň":"n","ŋ":"n","Ō":"O","Ŏ":"O","Ő":"O","ō":"o","ŏ":"o","ő":"o","Ŕ":"R","Ŗ":"R","Ř":"R","ŕ":"r","ŗ":"r","ř":"r","Ś":"S","Ŝ":"S","Ş":"S","Š":"S","ś":"s","ŝ":"s","ş":"s","š":"s","Ţ":"T","Ť":"T","Ŧ":"T","ţ":"t","ť":"t","ŧ":"t","Ũ":"U","Ū":"U","Ŭ":"U","Ů":"U","Ű":"U","Ų":"U","ũ":"u","ū":"u","ŭ":"u","ů":"u","ű":"u","ų":"u","Ŵ":"W","ŵ":"w","Ŷ":"Y","ŷ":"y","Ÿ":"Y","Ź":"Z","Ż":"Z","Ž":"Z","ź":"z","ż":"z","ž":"z","IJ":"IJ","ij":"ij","Œ":"Oe","œ":"oe","ʼn":"'n","ſ":"s"}),wr=hr({"&":"&","<":"<",">":">",'"':""","'":"'"});function Er(e){return"\\"+kt[e]}function Tr(e){return xt.test(e)}function Ar(e){var t=-1,r=Array(e.size);return e.forEach(function(e,n){r[++t]=[n,e]}),r}function Sr(e,t){return function(r){return e(t(r))}}function kr(e,t){for(var r=-1,n=e.length,i=0,s=[];++r",""":'"',"'":"'"});var Mr=function e(t){var r,Me=(t=null==t?Lt:Mr.defaults(Lt.Object(),t,Mr.pick(Lt,Et))).Array,Ze=t.Date,Je=t.Error,Qe=t.Function,et=t.Math,tt=t.Object,rt=t.RegExp,nt=t.String,it=t.TypeError,st=Me.prototype,ot=Qe.prototype,at=tt.prototype,ut=t["__core-js_shared__"],lt=ot.toString,ct=at.hasOwnProperty,ht=0,pt=(r=/[^.]+$/.exec(ut&&ut.keys&&ut.keys.IE_PROTO||""))?"Symbol(src)_1."+r:"",ft=at.toString,dt=lt.call(tt),mt=Lt._,gt=rt("^"+lt.call(ct).replace(Oe,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),_t=Bt?t.Buffer:n,xt=t.Symbol,kt=t.Uint8Array,Rt=_t?_t.allocUnsafe:n,Ot=Sr(tt.getPrototypeOf,tt),Pt=tt.create,Mt=at.propertyIsEnumerable,Nt=st.splice,Dt=xt?xt.isConcatSpreadable:n,nr=xt?xt.iterator:n,hr=xt?xt.toStringTag:n,Br=function(){try{var e=Us(tt,"defineProperty");return e({},"",{}),e}catch(e){}}(),Nr=t.clearTimeout!==Lt.clearTimeout&&t.clearTimeout,Dr=Ze&&Ze.now!==Lt.Date.now&&Ze.now,Fr=t.setTimeout!==Lt.setTimeout&&t.setTimeout,jr=et.ceil,Ur=et.floor,$r=tt.getOwnPropertySymbols,Vr=_t?_t.isBuffer:n,Gr=t.isFinite,zr=st.join,Wr=Sr(tt.keys,tt),Hr=et.max,Kr=et.min,qr=Ze.now,Xr=t.parseInt,Yr=et.random,Zr=st.reverse,Jr=Us(t,"DataView"),Qr=Us(t,"Map"),en=Us(t,"Promise"),tn=Us(t,"Set"),rn=Us(t,"WeakMap"),nn=Us(tt,"create"),sn=rn&&new rn,on={},an=po(Jr),un=po(Qr),ln=po(en),cn=po(tn),hn=po(rn),pn=xt?xt.prototype:n,fn=pn?pn.valueOf:n,dn=pn?pn.toString:n;function mn(e){if(Ra(e)&&!_a(e)&&!(e instanceof _n)){if(e instanceof yn)return e;if(ct.call(e,"__wrapped__"))return fo(e)}return new yn(e)}var gn=function(){function e(){}return function(t){if(!Ia(t))return{};if(Pt)return Pt(t);e.prototype=t;var r=new e;return e.prototype=n,r}}();function vn(){}function yn(e,t){this.__wrapped__=e,this.__actions__=[],this.__chain__=!!t,this.__index__=0,this.__values__=n}function _n(e){this.__wrapped__=e,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=N,this.__views__=[]}function bn(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t=t?e:t)),e}function Dn(e,t,r,i,s,o){var a,u=t&h,l=t&p,c=t&f;if(r&&(a=s?r(e,i,s,o):r(e)),a!==n)return a;if(!Ia(e))return e;var d=_a(e);if(d){if(a=function(e){var t=e.length,r=new e.constructor(t);return t&&"string"==typeof e[0]&&ct.call(e,"index")&&(r.index=e.index,r.input=e.input),r}(e),!u)return is(e,a)}else{var m=Gs(e),g=m==K||m==q;if(Ea(e))return Ji(e,u);if(m==J||m==U||g&&!s){if(a=l||g?{}:Ws(e),!u)return l?function(e,t){return ss(e,Vs(e),t)}(e,function(e,t){return e&&ss(t,au(t),e)}(a,e)):function(e,t){return ss(e,$s(e),t)}(e,Pn(a,e))}else{if(!St[m])return s?e:{};a=function(e,t,r){var n,i,s,o=e.constructor;switch(t){case ae:return Qi(e);case G:case z:return new o(+e);case ue:return function(e,t){var r=t?Qi(e.buffer):e.buffer;return new e.constructor(r,e.byteOffset,e.byteLength)}(e,r);case le:case ce:case he:case pe:case fe:case de:case me:case ge:case ve:return es(e,r);case X:return new o;case Y:case re:return new o(e);case ee:return(s=new(i=e).constructor(i.source,Ve.exec(i))).lastIndex=i.lastIndex,s;case te:return new o;case ne:return n=e,fn?tt(fn.call(n)):{}}}(e,m,u)}}o||(o=new Tn);var v=o.get(e);if(v)return v;o.set(e,a),Ba(e)?e.forEach(function(n){a.add(Dn(n,t,r,n,e,o))}):Oa(e)&&e.forEach(function(n,i){a.set(i,Dn(n,t,r,i,e,o))});var y=d?n:(c?l?Ps:Ls:l?au:ou)(e);return Ht(y||e,function(n,i){y&&(n=e[i=n]),Rn(a,i,Dn(n,t,r,i,e,o))}),a}function Fn(e,t,r){var i=r.length;if(null==e)return!i;for(e=tt(e);i--;){var s=r[i],o=t[s],a=e[s];if(a===n&&!(s in e)||!o(a))return!1}return!0}function jn(e,t,r){if("function"!=typeof e)throw new it(o);return so(function(){e.apply(n,r)},t)}function Un(e,t,r,n){var s=-1,o=Yt,a=!0,u=e.length,l=[],c=t.length;if(!u)return l;r&&(t=Jt(t,gr(r))),n?(o=Zt,a=!1):t.length>=i&&(o=yr,a=!1,t=new En(t));e:for(;++s-1},xn.prototype.set=function(e,t){var r=this.__data__,n=On(r,e);return n<0?(++this.size,r.push([e,t])):r[n][1]=t,this},wn.prototype.clear=function(){this.size=0,this.__data__={hash:new bn,map:new(Qr||xn),string:new bn}},wn.prototype.delete=function(e){var t=Fs(this,e).delete(e);return this.size-=t?1:0,t},wn.prototype.get=function(e){return Fs(this,e).get(e)},wn.prototype.has=function(e){return Fs(this,e).has(e)},wn.prototype.set=function(e,t){var r=Fs(this,e),n=r.size;return r.set(e,t),this.size+=r.size==n?0:1,this},En.prototype.add=En.prototype.push=function(e){return this.__data__.set(e,u),this},En.prototype.has=function(e){return this.__data__.has(e)},Tn.prototype.clear=function(){this.__data__=new xn,this.size=0},Tn.prototype.delete=function(e){var t=this.__data__,r=t.delete(e);return this.size=t.size,r},Tn.prototype.get=function(e){return this.__data__.get(e)},Tn.prototype.has=function(e){return this.__data__.has(e)},Tn.prototype.set=function(e,t){var r=this.__data__;if(r instanceof xn){var n=r.__data__;if(!Qr||n.length0&&r(a)?t>1?Hn(a,t-1,r,n,i):Qt(i,a):n||(i[i.length]=a)}return i}var Kn=ls(),qn=ls(!0);function Xn(e,t){return e&&Kn(e,t,ou)}function Yn(e,t){return e&&qn(e,t,ou)}function Zn(e,t){return Xt(t,function(t){return Sa(e[t])})}function Jn(e,t){for(var r=0,i=(t=qi(t,e)).length;null!=e&&rt}function ri(e,t){return null!=e&&ct.call(e,t)}function ni(e,t){return null!=e&&t in tt(e)}function ii(e,t,r){for(var i=r?Zt:Yt,s=e[0].length,o=e.length,a=o,u=Me(o),l=1/0,c=[];a--;){var h=e[a];a&&t&&(h=Jt(h,gr(t))),l=Kr(h.length,l),u[a]=!r&&(t||s>=120&&h.length>=120)?new En(a&&h):n}h=e[0];var p=-1,f=u[0];e:for(;++p=a)return u;var l=r[n];return u*("desc"==l?-1:1)}}return e.index-t.index}(e,t,r)})}function bi(e,t,r){for(var n=-1,i=t.length,s={};++n-1;)a!==e&&Nt.call(a,u,1),Nt.call(e,u,1);return e}function wi(e,t){for(var r=e?t.length:0,n=r-1;r--;){var i=t[r];if(r==n||i!==s){var s=i;Ks(i)?Nt.call(e,i,1):Ui(e,i)}}return e}function Ei(e,t){return e+Ur(Yr()*(t-e+1))}function Ti(e,t){var r="";if(!e||t<1||t>P)return r;do{t%2&&(r+=e),(t=Ur(t/2))&&(e+=e)}while(t);return r}function Ai(e,t){return oo(to(e,t,Lu),e+"")}function Si(e){return Sn(mu(e))}function ki(e,t){var r=mu(e);return lo(r,Nn(t,0,r.length))}function Ci(e,t,r,i){if(!Ia(e))return e;for(var s=-1,o=(t=qi(t,e)).length,a=o-1,u=e;null!=u&&++si?0:i+t),(r=r>i?i:r)<0&&(r+=i),i=t>r?0:r-t>>>0,t>>>=0;for(var s=Me(i);++n>>1,o=e[s];null!==o&&!Da(o)&&(r?o<=t:o=i){var c=t?null:Ts(e);if(c)return Cr(c);a=!1,s=yr,l=new En}else l=t?[]:u;e:for(;++n=i?e:Li(e,t,r)}var Zi=Nr||function(e){return Lt.clearTimeout(e)};function Ji(e,t){if(t)return e.slice();var r=e.length,n=Rt?Rt(r):new e.constructor(r);return e.copy(n),n}function Qi(e){var t=new e.constructor(e.byteLength);return new kt(t).set(new kt(e)),t}function es(e,t){var r=t?Qi(e.buffer):e.buffer;return new e.constructor(r,e.byteOffset,e.length)}function ts(e,t){if(e!==t){var r=e!==n,i=null===e,s=e==e,o=Da(e),a=t!==n,u=null===t,l=t==t,c=Da(t);if(!u&&!c&&!o&&e>t||o&&a&&l&&!u&&!c||i&&a&&l||!r&&l||!s)return 1;if(!i&&!o&&!c&&e1?r[s-1]:n,a=s>2?r[2]:n;for(o=e.length>3&&"function"==typeof o?(s--,o):n,a&&qs(r[0],r[1],a)&&(o=s<3?n:o,s=1),t=tt(t);++i-1?s[o?t[a]:a]:n}}function ds(e){return Os(function(t){var r=t.length,i=r,s=yn.prototype.thru;for(e&&t.reverse();i--;){var a=t[i];if("function"!=typeof a)throw new it(o);if(s&&!u&&"wrapper"==Bs(a))var u=new yn([],!0)}for(i=u?i:r;++i1&&_.reverse(),h&&lu))return!1;var c=o.get(e),h=o.get(t);if(c&&h)return c==t&&h==e;var p=-1,f=!0,g=r&m?new En:n;for(o.set(e,t),o.set(t,e);++p-1&&e%1==0&&e1?"& ":"")+t[n],t=t.join(r>2?", ":" "),e.replace(Be,"{\n/* [wrapped with "+t+"] */\n")}(n,function(e,t){return Ht(j,function(r){var n="_."+r[0];t&r[1]&&!Yt(e,n)&&e.push(n)}),e.sort()}(function(e){var t=e.match(Ne);return t?t[1].split(De):[]}(n),r)))}function uo(e){var t=0,r=0;return function(){var i=qr(),s=I-(i-r);if(r=i,s>0){if(++t>=C)return arguments[0]}else t=0;return e.apply(n,arguments)}}function lo(e,t){var r=-1,i=e.length,s=i-1;for(t=t===n?i:t;++r1?e[t-1]:n;return Mo(e,r="function"==typeof r?(e.pop(),r):n)});function $o(e){var t=mn(e);return t.__chain__=!0,t}function Vo(e,t){return t(e)}var Go=Os(function(e){var t=e.length,r=t?e[0]:0,i=this.__wrapped__,s=function(t){return Bn(t,e)};return!(t>1||this.__actions__.length)&&i instanceof _n&&Ks(r)?((i=i.slice(r,+r+(t?1:0))).__actions__.push({func:Vo,args:[s],thisArg:n}),new yn(i,this.__chain__).thru(function(e){return t&&!e.length&&e.push(n),e})):this.thru(s)});var zo=os(function(e,t,r){ct.call(e,r)?++e[r]:Mn(e,r,1)});var Wo=fs(yo),Ho=fs(_o);function Ko(e,t){return(_a(e)?Ht:$n)(e,Ds(t,3))}function qo(e,t){return(_a(e)?Kt:Vn)(e,Ds(t,3))}var Xo=os(function(e,t,r){ct.call(e,r)?e[r].push(t):Mn(e,r,[t])});var Yo=Ai(function(e,t,r){var n=-1,i="function"==typeof t,s=xa(e)?Me(e.length):[];return $n(e,function(e){s[++n]=i?zt(t,e,r):si(e,t,r)}),s}),Zo=os(function(e,t,r){Mn(e,r,t)});function Jo(e,t){return(_a(e)?Jt:di)(e,Ds(t,3))}var Qo=os(function(e,t,r){e[r?0:1].push(t)},function(){return[[],[]]});var ea=Ai(function(e,t){if(null==e)return[];var r=t.length;return r>1&&qs(e,t[0],t[1])?t=[]:r>2&&qs(t[0],t[1],t[2])&&(t=[t[0]]),_i(e,Hn(t,1),[])}),ta=Dr||function(){return Lt.Date.now()};function ra(e,t,r){return t=r?n:t,t=e&&null==t?e.length:t,Ss(e,E,n,n,n,n,t)}function na(e,t){var r;if("function"!=typeof t)throw new it(o);return e=Ga(e),function(){return--e>0&&(r=t.apply(this,arguments)),e<=1&&(t=n),r}}var ia=Ai(function(e,t,r){var n=g;if(r.length){var i=kr(r,Ns(ia));n|=x}return Ss(e,n,t,r,i)}),sa=Ai(function(e,t,r){var n=g|v;if(r.length){var i=kr(r,Ns(sa));n|=x}return Ss(t,n,e,r,i)});function oa(e,t,r){var i,s,a,u,l,c,h=0,p=!1,f=!1,d=!0;if("function"!=typeof e)throw new it(o);function m(t){var r=i,o=s;return i=s=n,h=t,u=e.apply(o,r)}function g(e){var r=e-c;return c===n||r>=t||r<0||f&&e-h>=a}function v(){var e=ta();if(g(e))return y(e);l=so(v,function(e){var r=t-(e-c);return f?Kr(r,a-(e-h)):r}(e))}function y(e){return l=n,d&&i?m(e):(i=s=n,u)}function _(){var e=ta(),r=g(e);if(i=arguments,s=this,c=e,r){if(l===n)return function(e){return h=e,l=so(v,t),p?m(e):u}(c);if(f)return Zi(l),l=so(v,t),m(c)}return l===n&&(l=so(v,t)),u}return t=Wa(t)||0,Ia(r)&&(p=!!r.leading,a=(f="maxWait"in r)?Hr(Wa(r.maxWait)||0,t):a,d="trailing"in r?!!r.trailing:d),_.cancel=function(){l!==n&&Zi(l),h=0,i=c=s=l=n},_.flush=function(){return l===n?u:y(ta())},_}var aa=Ai(function(e,t){return jn(e,1,t)}),ua=Ai(function(e,t,r){return jn(e,Wa(t)||0,r)});function la(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw new it(o);var r=function(){var n=arguments,i=t?t.apply(this,n):n[0],s=r.cache;if(s.has(i))return s.get(i);var o=e.apply(this,n);return r.cache=s.set(i,o)||s,o};return r.cache=new(la.Cache||wn),r}function ca(e){if("function"!=typeof e)throw new it(o);return function(){var t=arguments;switch(t.length){case 0:return!e.call(this);case 1:return!e.call(this,t[0]);case 2:return!e.call(this,t[0],t[1]);case 3:return!e.call(this,t[0],t[1],t[2])}return!e.apply(this,t)}}la.Cache=wn;var ha=Xi(function(e,t){var r=(t=1==t.length&&_a(t[0])?Jt(t[0],gr(Ds())):Jt(Hn(t,1),gr(Ds()))).length;return Ai(function(n){for(var i=-1,s=Kr(n.length,r);++i=t}),ya=oi(function(){return arguments}())?oi:function(e){return Ra(e)&&ct.call(e,"callee")&&!Mt.call(e,"callee")},_a=Me.isArray,ba=Ft?gr(Ft):function(e){return Ra(e)&&ei(e)==ae};function xa(e){return null!=e&&Ca(e.length)&&!Sa(e)}function wa(e){return Ra(e)&&xa(e)}var Ea=Vr||Wu,Ta=jt?gr(jt):function(e){return Ra(e)&&ei(e)==z};function Aa(e){if(!Ra(e))return!1;var t=ei(e);return t==H||t==W||"string"==typeof e.message&&"string"==typeof e.name&&!Pa(e)}function Sa(e){if(!Ia(e))return!1;var t=ei(e);return t==K||t==q||t==V||t==Q}function ka(e){return"number"==typeof e&&e==Ga(e)}function Ca(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=P}function Ia(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}function Ra(e){return null!=e&&"object"==typeof e}var Oa=Ut?gr(Ut):function(e){return Ra(e)&&Gs(e)==X};function La(e){return"number"==typeof e||Ra(e)&&ei(e)==Y}function Pa(e){if(!Ra(e)||ei(e)!=J)return!1;var t=Ot(e);if(null===t)return!0;var r=ct.call(t,"constructor")&&t.constructor;return"function"==typeof r&&r instanceof r&<.call(r)==dt}var Ma=$t?gr($t):function(e){return Ra(e)&&ei(e)==ee};var Ba=Vt?gr(Vt):function(e){return Ra(e)&&Gs(e)==te};function Na(e){return"string"==typeof e||!_a(e)&&Ra(e)&&ei(e)==re}function Da(e){return"symbol"==typeof e||Ra(e)&&ei(e)==ne}var Fa=Gt?gr(Gt):function(e){return Ra(e)&&Ca(e.length)&&!!At[ei(e)]};var ja=xs(fi),Ua=xs(function(e,t){return e<=t});function $a(e){if(!e)return[];if(xa(e))return Na(e)?Or(e):is(e);if(nr&&e[nr])return function(e){for(var t,r=[];!(t=e.next()).done;)r.push(t.value);return r}(e[nr]());var t=Gs(e);return(t==X?Ar:t==te?Cr:mu)(e)}function Va(e){return e?(e=Wa(e))===L||e===-L?(e<0?-1:1)*M:e==e?e:0:0===e?e:0}function Ga(e){var t=Va(e),r=t%1;return t==t?r?t-r:t:0}function za(e){return e?Nn(Ga(e),0,N):0}function Wa(e){if("number"==typeof e)return e;if(Da(e))return B;if(Ia(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=Ia(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=mr(e);var r=ze.test(e);return r||He.test(e)?It(e.slice(2),r?2:8):Ge.test(e)?B:+e}function Ha(e){return ss(e,au(e))}function Ka(e){return null==e?"":Fi(e)}var qa=as(function(e,t){if(Js(t)||xa(t))ss(t,ou(t),e);else for(var r in t)ct.call(t,r)&&Rn(e,r,t[r])}),Xa=as(function(e,t){ss(t,au(t),e)}),Ya=as(function(e,t,r,n){ss(t,au(t),e,n)}),Za=as(function(e,t,r,n){ss(t,ou(t),e,n)}),Ja=Os(Bn);var Qa=Ai(function(e,t){e=tt(e);var r=-1,i=t.length,s=i>2?t[2]:n;for(s&&qs(t[0],t[1],s)&&(i=1);++r1),t}),ss(e,Ps(e),r),n&&(r=Dn(r,h|p|f,Is));for(var i=t.length;i--;)Ui(r,t[i]);return r});var hu=Os(function(e,t){return null==e?{}:function(e,t){return bi(e,t,function(t,r){return ru(e,r)})}(e,t)});function pu(e,t){if(null==e)return{};var r=Jt(Ps(e),function(e){return[e]});return t=Ds(t),bi(e,r,function(e,r){return t(e,r[0])})}var fu=As(ou),du=As(au);function mu(e){return null==e?[]:vr(e,ou(e))}var gu=hs(function(e,t,r){return t=t.toLowerCase(),e+(r?vu(t):t)});function vu(e){return Au(Ka(e).toLowerCase())}function yu(e){return(e=Ka(e))&&e.replace(qe,xr).replace(yt,"")}var _u=hs(function(e,t,r){return e+(r?"-":"")+t.toLowerCase()}),bu=hs(function(e,t,r){return e+(r?" ":"")+t.toLowerCase()}),xu=cs("toLowerCase");var wu=hs(function(e,t,r){return e+(r?"_":"")+t.toLowerCase()});var Eu=hs(function(e,t,r){return e+(r?" ":"")+Au(t)});var Tu=hs(function(e,t,r){return e+(r?" ":"")+t.toUpperCase()}),Au=cs("toUpperCase");function Su(e,t,r){return e=Ka(e),(t=r?n:t)===n?function(e){return wt.test(e)}(e)?function(e){return e.match(bt)||[]}(e):function(e){return e.match(Fe)||[]}(e):e.match(t)||[]}var ku=Ai(function(e,t){try{return zt(e,n,t)}catch(e){return Aa(e)?e:new Je(e)}}),Cu=Os(function(e,t){return Ht(t,function(t){t=ho(t),Mn(e,t,ia(e[t],e))}),e});function Iu(e){return function(){return e}}var Ru=ds(),Ou=ds(!0);function Lu(e){return e}function Pu(e){return ci("function"==typeof e?e:Dn(e,h))}var Mu=Ai(function(e,t){return function(r){return si(r,e,t)}}),Bu=Ai(function(e,t){return function(r){return si(e,r,t)}});function Nu(e,t,r){var n=ou(t),i=Zn(t,n);null!=r||Ia(t)&&(i.length||!n.length)||(r=t,t=e,e=this,i=Zn(t,ou(t)));var s=!(Ia(r)&&"chain"in r&&!r.chain),o=Sa(e);return Ht(i,function(r){var n=t[r];e[r]=n,o&&(e.prototype[r]=function(){var t=this.__chain__;if(s||t){var r=e(this.__wrapped__);return(r.__actions__=is(this.__actions__)).push({func:n,args:arguments,thisArg:e}),r.__chain__=t,r}return n.apply(e,Qt([this.value()],arguments))})}),e}function Du(){}var Fu=ys(Jt),ju=ys(qt),Uu=ys(rr);function $u(e){return Xs(e)?cr(ho(e)):function(e){return function(t){return Jn(t,e)}}(e)}var Vu=bs(),Gu=bs(!0);function zu(){return[]}function Wu(){return!1}var Hu=vs(function(e,t){return e+t},0),Ku=Es("ceil"),qu=vs(function(e,t){return e/t},1),Xu=Es("floor");var Yu,Zu=vs(function(e,t){return e*t},1),Ju=Es("round"),Qu=vs(function(e,t){return e-t},0);return mn.after=function(e,t){if("function"!=typeof t)throw new it(o);return e=Ga(e),function(){if(--e<1)return t.apply(this,arguments)}},mn.ary=ra,mn.assign=qa,mn.assignIn=Xa,mn.assignInWith=Ya,mn.assignWith=Za,mn.at=Ja,mn.before=na,mn.bind=ia,mn.bindAll=Cu,mn.bindKey=sa,mn.castArray=function(){if(!arguments.length)return[];var e=arguments[0];return _a(e)?e:[e]},mn.chain=$o,mn.chunk=function(e,t,r){t=(r?qs(e,t,r):t===n)?1:Hr(Ga(t),0);var i=null==e?0:e.length;if(!i||t<1)return[];for(var s=0,o=0,a=Me(jr(i/t));ss?0:s+r),(i=i===n||i>s?s:Ga(i))<0&&(i+=s),i=r>i?0:za(i);r>>0)?(e=Ka(e))&&("string"==typeof t||null!=t&&!Ma(t))&&!(t=Fi(t))&&Tr(e)?Yi(Or(e),0,r):e.split(t,r):[]},mn.spread=function(e,t){if("function"!=typeof e)throw new it(o);return t=null==t?0:Hr(Ga(t),0),Ai(function(r){var n=r[t],i=Yi(r,0,t);return n&&Qt(i,n),zt(e,this,i)})},mn.tail=function(e){var t=null==e?0:e.length;return t?Li(e,1,t):[]},mn.take=function(e,t,r){return e&&e.length?Li(e,0,(t=r||t===n?1:Ga(t))<0?0:t):[]},mn.takeRight=function(e,t,r){var i=null==e?0:e.length;return i?Li(e,(t=i-(t=r||t===n?1:Ga(t)))<0?0:t,i):[]},mn.takeRightWhile=function(e,t){return e&&e.length?Vi(e,Ds(t,3),!1,!0):[]},mn.takeWhile=function(e,t){return e&&e.length?Vi(e,Ds(t,3)):[]},mn.tap=function(e,t){return t(e),e},mn.throttle=function(e,t,r){var n=!0,i=!0;if("function"!=typeof e)throw new it(o);return Ia(r)&&(n="leading"in r?!!r.leading:n,i="trailing"in r?!!r.trailing:i),oa(e,t,{leading:n,maxWait:t,trailing:i})},mn.thru=Vo,mn.toArray=$a,mn.toPairs=fu,mn.toPairsIn=du,mn.toPath=function(e){return _a(e)?Jt(e,ho):Da(e)?[e]:is(co(Ka(e)))},mn.toPlainObject=Ha,mn.transform=function(e,t,r){var n=_a(e),i=n||Ea(e)||Fa(e);if(t=Ds(t,4),null==r){var s=e&&e.constructor;r=i?n?new s:[]:Ia(e)&&Sa(s)?gn(Ot(e)):{}}return(i?Ht:Xn)(e,function(e,n,i){return t(r,e,n,i)}),r},mn.unary=function(e){return ra(e,1)},mn.union=Ro,mn.unionBy=Oo,mn.unionWith=Lo,mn.uniq=function(e){return e&&e.length?ji(e):[]},mn.uniqBy=function(e,t){return e&&e.length?ji(e,Ds(t,2)):[]},mn.uniqWith=function(e,t){return t="function"==typeof t?t:n,e&&e.length?ji(e,n,t):[]},mn.unset=function(e,t){return null==e||Ui(e,t)},mn.unzip=Po,mn.unzipWith=Mo,mn.update=function(e,t,r){return null==e?e:$i(e,t,Ki(r))},mn.updateWith=function(e,t,r,i){return i="function"==typeof i?i:n,null==e?e:$i(e,t,Ki(r),i)},mn.values=mu,mn.valuesIn=function(e){return null==e?[]:vr(e,au(e))},mn.without=Bo,mn.words=Su,mn.wrap=function(e,t){return pa(Ki(t),e)},mn.xor=No,mn.xorBy=Do,mn.xorWith=Fo,mn.zip=jo,mn.zipObject=function(e,t){return Wi(e||[],t||[],Rn)},mn.zipObjectDeep=function(e,t){return Wi(e||[],t||[],Ci)},mn.zipWith=Uo,mn.entries=fu,mn.entriesIn=du,mn.extend=Xa,mn.extendWith=Ya,Nu(mn,mn),mn.add=Hu,mn.attempt=ku,mn.camelCase=gu,mn.capitalize=vu,mn.ceil=Ku,mn.clamp=function(e,t,r){return r===n&&(r=t,t=n),r!==n&&(r=(r=Wa(r))==r?r:0),t!==n&&(t=(t=Wa(t))==t?t:0),Nn(Wa(e),t,r)},mn.clone=function(e){return Dn(e,f)},mn.cloneDeep=function(e){return Dn(e,h|f)},mn.cloneDeepWith=function(e,t){return Dn(e,h|f,t="function"==typeof t?t:n)},mn.cloneWith=function(e,t){return Dn(e,f,t="function"==typeof t?t:n)},mn.conformsTo=function(e,t){return null==t||Fn(e,t,ou(t))},mn.deburr=yu,mn.defaultTo=function(e,t){return null==e||e!=e?t:e},mn.divide=qu,mn.endsWith=function(e,t,r){e=Ka(e),t=Fi(t);var i=e.length,s=r=r===n?i:Nn(Ga(r),0,i);return(r-=t.length)>=0&&e.slice(r,s)==t},mn.eq=ma,mn.escape=function(e){return(e=Ka(e))&&Te.test(e)?e.replace(we,wr):e},mn.escapeRegExp=function(e){return(e=Ka(e))&&Le.test(e)?e.replace(Oe,"\\$&"):e},mn.every=function(e,t,r){var i=_a(e)?qt:Gn;return r&&qs(e,t,r)&&(t=n),i(e,Ds(t,3))},mn.find=Wo,mn.findIndex=yo,mn.findKey=function(e,t){return ir(e,Ds(t,3),Xn)},mn.findLast=Ho,mn.findLastIndex=_o,mn.findLastKey=function(e,t){return ir(e,Ds(t,3),Yn)},mn.floor=Xu,mn.forEach=Ko,mn.forEachRight=qo,mn.forIn=function(e,t){return null==e?e:Kn(e,Ds(t,3),au)},mn.forInRight=function(e,t){return null==e?e:qn(e,Ds(t,3),au)},mn.forOwn=function(e,t){return e&&Xn(e,Ds(t,3))},mn.forOwnRight=function(e,t){return e&&Yn(e,Ds(t,3))},mn.get=tu,mn.gt=ga,mn.gte=va,mn.has=function(e,t){return null!=e&&zs(e,t,ri)},mn.hasIn=ru,mn.head=xo,mn.identity=Lu,mn.includes=function(e,t,r,n){e=xa(e)?e:mu(e),r=r&&!n?Ga(r):0;var i=e.length;return r<0&&(r=Hr(i+r,0)),Na(e)?r<=i&&e.indexOf(t,r)>-1:!!i&&or(e,t,r)>-1},mn.indexOf=function(e,t,r){var n=null==e?0:e.length;if(!n)return-1;var i=null==r?0:Ga(r);return i<0&&(i=Hr(n+i,0)),or(e,t,i)},mn.inRange=function(e,t,r){return t=Va(t),r===n?(r=t,t=0):r=Va(r),function(e,t,r){return e>=Kr(t,r)&&e=-P&&e<=P},mn.isSet=Ba,mn.isString=Na,mn.isSymbol=Da,mn.isTypedArray=Fa,mn.isUndefined=function(e){return e===n},mn.isWeakMap=function(e){return Ra(e)&&Gs(e)==se},mn.isWeakSet=function(e){return Ra(e)&&ei(e)==oe},mn.join=function(e,t){return null==e?"":zr.call(e,t)},mn.kebabCase=_u,mn.last=Ao,mn.lastIndexOf=function(e,t,r){var i=null==e?0:e.length;if(!i)return-1;var s=i;return r!==n&&(s=(s=Ga(r))<0?Hr(i+s,0):Kr(s,i-1)),t==t?function(e,t,r){for(var n=r+1;n--;)if(e[n]===t)return n;return n}(e,t,s):sr(e,ur,s,!0)},mn.lowerCase=bu,mn.lowerFirst=xu,mn.lt=ja,mn.lte=Ua,mn.max=function(e){return e&&e.length?zn(e,Lu,ti):n},mn.maxBy=function(e,t){return e&&e.length?zn(e,Ds(t,2),ti):n},mn.mean=function(e){return lr(e,Lu)},mn.meanBy=function(e,t){return lr(e,Ds(t,2))},mn.min=function(e){return e&&e.length?zn(e,Lu,fi):n},mn.minBy=function(e,t){return e&&e.length?zn(e,Ds(t,2),fi):n},mn.stubArray=zu,mn.stubFalse=Wu,mn.stubObject=function(){return{}},mn.stubString=function(){return""},mn.stubTrue=function(){return!0},mn.multiply=Zu,mn.nth=function(e,t){return e&&e.length?yi(e,Ga(t)):n},mn.noConflict=function(){return Lt._===this&&(Lt._=mt),this},mn.noop=Du,mn.now=ta,mn.pad=function(e,t,r){e=Ka(e);var n=(t=Ga(t))?Rr(e):0;if(!t||n>=t)return e;var i=(t-n)/2;return _s(Ur(i),r)+e+_s(jr(i),r)},mn.padEnd=function(e,t,r){e=Ka(e);var n=(t=Ga(t))?Rr(e):0;return t&&nt){var i=e;e=t,t=i}if(r||e%1||t%1){var s=Yr();return Kr(e+s*(t-e+Ct("1e-"+((s+"").length-1))),t)}return Ei(e,t)},mn.reduce=function(e,t,r){var n=_a(e)?er:pr,i=arguments.length<3;return n(e,Ds(t,4),r,i,$n)},mn.reduceRight=function(e,t,r){var n=_a(e)?tr:pr,i=arguments.length<3;return n(e,Ds(t,4),r,i,Vn)},mn.repeat=function(e,t,r){return t=(r?qs(e,t,r):t===n)?1:Ga(t),Ti(Ka(e),t)},mn.replace=function(){var e=arguments,t=Ka(e[0]);return e.length<3?t:t.replace(e[1],e[2])},mn.result=function(e,t,r){var i=-1,s=(t=qi(t,e)).length;for(s||(s=1,e=n);++iP)return[];var r=N,n=Kr(e,N);t=Ds(t),e-=N;for(var i=dr(n,t);++r=o)return e;var u=r-Rr(i);if(u<1)return i;var l=a?Yi(a,0,u).join(""):e.slice(0,u);if(s===n)return l+i;if(a&&(u+=l.length-u),Ma(s)){if(e.slice(u).search(s)){var c,h=l;for(s.global||(s=rt(s.source,Ka(Ve.exec(s))+"g")),s.lastIndex=0;c=s.exec(h);)var p=c.index;l=l.slice(0,p===n?u:p)}}else if(e.indexOf(Fi(s),u)!=u){var f=l.lastIndexOf(s);f>-1&&(l=l.slice(0,f))}return l+i},mn.unescape=function(e){return(e=Ka(e))&&Ee.test(e)?e.replace(xe,Pr):e},mn.uniqueId=function(e){var t=++ht;return Ka(e)+t},mn.upperCase=Tu,mn.upperFirst=Au,mn.each=Ko,mn.eachRight=qo,mn.first=xo,Nu(mn,(Yu={},Xn(mn,function(e,t){ct.call(mn.prototype,t)||(Yu[t]=e)}),Yu),{chain:!1}),mn.VERSION="4.17.21",Ht(["bind","bindKey","curry","curryRight","partial","partialRight"],function(e){mn[e].placeholder=mn}),Ht(["drop","take"],function(e,t){_n.prototype[e]=function(r){r=r===n?1:Hr(Ga(r),0);var i=this.__filtered__&&!t?new _n(this):this.clone();return i.__filtered__?i.__takeCount__=Kr(r,i.__takeCount__):i.__views__.push({size:Kr(r,N),type:e+(i.__dir__<0?"Right":"")}),i},_n.prototype[e+"Right"]=function(t){return this.reverse()[e](t).reverse()}}),Ht(["filter","map","takeWhile"],function(e,t){var r=t+1,n=r==R||3==r;_n.prototype[e]=function(e){var t=this.clone();return t.__iteratees__.push({iteratee:Ds(e,3),type:r}),t.__filtered__=t.__filtered__||n,t}}),Ht(["head","last"],function(e,t){var r="take"+(t?"Right":"");_n.prototype[e]=function(){return this[r](1).value()[0]}}),Ht(["initial","tail"],function(e,t){var r="drop"+(t?"":"Right");_n.prototype[e]=function(){return this.__filtered__?new _n(this):this[r](1)}}),_n.prototype.compact=function(){return this.filter(Lu)},_n.prototype.find=function(e){return this.filter(e).head()},_n.prototype.findLast=function(e){return this.reverse().find(e)},_n.prototype.invokeMap=Ai(function(e,t){return"function"==typeof e?new _n(this):this.map(function(r){return si(r,e,t)})}),_n.prototype.reject=function(e){return this.filter(ca(Ds(e)))},_n.prototype.slice=function(e,t){e=Ga(e);var r=this;return r.__filtered__&&(e>0||t<0)?new _n(r):(e<0?r=r.takeRight(-e):e&&(r=r.drop(e)),t!==n&&(r=(t=Ga(t))<0?r.dropRight(-t):r.take(t-e)),r)},_n.prototype.takeRightWhile=function(e){return this.reverse().takeWhile(e).reverse()},_n.prototype.toArray=function(){return this.take(N)},Xn(_n.prototype,function(e,t){var r=/^(?:filter|find|map|reject)|While$/.test(t),i=/^(?:head|last)$/.test(t),s=mn[i?"take"+("last"==t?"Right":""):t],o=i||/^find/.test(t);s&&(mn.prototype[t]=function(){var t=this.__wrapped__,a=i?[1]:arguments,u=t instanceof _n,l=a[0],c=u||_a(t),h=function(e){var t=s.apply(mn,Qt([e],a));return i&&p?t[0]:t};c&&r&&"function"==typeof l&&1!=l.length&&(u=c=!1);var p=this.__chain__,f=!!this.__actions__.length,d=o&&!p,m=u&&!f;if(!o&&c){t=m?t:new _n(this);var g=e.apply(t,a);return g.__actions__.push({func:Vo,args:[h],thisArg:n}),new yn(g,p)}return d&&m?e.apply(this,a):(g=this.thru(h),d?i?g.value()[0]:g.value():g)})}),Ht(["pop","push","shift","sort","splice","unshift"],function(e){var t=st[e],r=/^(?:push|sort|unshift)$/.test(e)?"tap":"thru",n=/^(?:pop|shift)$/.test(e);mn.prototype[e]=function(){var e=arguments;if(n&&!this.__chain__){var i=this.value();return t.apply(_a(i)?i:[],e)}return this[r](function(r){return t.apply(_a(r)?r:[],e)})}}),Xn(_n.prototype,function(e,t){var r=mn[t];if(r){var n=r.name+"";ct.call(on,n)||(on[n]=[]),on[n].push({name:t,func:r})}}),on[ms(n,v).name]=[{name:"wrapper",func:n}],_n.prototype.clone=function(){var e=new _n(this.__wrapped__);return e.__actions__=is(this.__actions__),e.__dir__=this.__dir__,e.__filtered__=this.__filtered__,e.__iteratees__=is(this.__iteratees__),e.__takeCount__=this.__takeCount__,e.__views__=is(this.__views__),e},_n.prototype.reverse=function(){if(this.__filtered__){var e=new _n(this);e.__dir__=-1,e.__filtered__=!0}else(e=this.clone()).__dir__*=-1;return e},_n.prototype.value=function(){var e=this.__wrapped__.value(),t=this.__dir__,r=_a(e),n=t<0,i=r?e.length:0,s=function(e,t,r){for(var n=-1,i=r.length;++n=this.__values__.length;return{done:e,value:e?n:this.__values__[this.__index__++]}},mn.prototype.plant=function(e){for(var t,r=this;r instanceof vn;){var i=fo(r);i.__index__=0,i.__values__=n,t?s.__wrapped__=i:t=i;var s=i;r=r.__wrapped__}return s.__wrapped__=e,t},mn.prototype.reverse=function(){var e=this.__wrapped__;if(e instanceof _n){var t=e;return this.__actions__.length&&(t=new _n(this)),(t=t.reverse()).__actions__.push({func:Vo,args:[Io],thisArg:n}),new yn(t,this.__chain__)}return this.thru(Io)},mn.prototype.toJSON=mn.prototype.valueOf=mn.prototype.value=function(){return Gi(this.__wrapped__,this.__actions__)},mn.prototype.first=mn.prototype.head,nr&&(mn.prototype[nr]=function(){return this}),mn}();"function"==typeof define&&"object"==typeof define.amd&&define.amd?(Lt._=Mr,define(function(){return Mr})):Mt?((Mt.exports=Mr)._=Mr,Pt._=Mr):Lt._=Mr}).call(this)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],366:[function(e,t,r){(function(r){"use strict";t.exports=v;var n,i=e("pseudomap"),s=e("util"),o=e("yallist"),a=(n="function"==typeof Symbol&&"1"!==r.env._nodeLRUCacheForceNoSymbol?function(e){return Symbol(e)}:function(e){return"_"+e})("max"),u=n("length"),l=n("lengthCalculator"),c=n("allowStale"),h=n("maxAge"),p=n("dispose"),f=n("noDisposeOnSet"),d=n("lruList"),m=n("cache");function g(){return 1}function v(e){if(!(this instanceof v))return new v(e);"number"==typeof e&&(e={max:e}),e||(e={});var t=this[a]=e.max;(!t||"number"!=typeof t||t<=0)&&(this[a]=1/0);var r=e.length||g;"function"!=typeof r&&(r=g),this[l]=r,this[c]=e.stale||!1,this[h]=e.maxAge||0,this[p]=e.dispose,this[f]=e.noDisposeOnSet||!1,this.reset()}function y(e,t,r,n){var i=r.value;b(e,i)&&(w(e,r),e[c]||(i=void 0)),i&&t.call(n,i.value,i.key,e)}function _(e,t,r){var n=e[m].get(t);if(n){var i=n.value;b(e,i)?(w(e,n),e[c]||(i=void 0)):r&&e[d].unshiftNode(n),i&&(i=i.value)}return i}function b(e,t){if(!t||!t.maxAge&&!e[h])return!1;var r=Date.now()-t.now;return t.maxAge?r>t.maxAge:e[h]&&r>e[h]}function x(e){if(e[u]>e[a])for(var t=e[d].tail;e[u]>e[a]&&null!==t;){var r=t.prev;w(e,t),t=r}}function w(e,t){if(t){var r=t.value;e[p]&&e[p](r.key,r.value),e[u]-=r.length,e[m].delete(r.key),e[d].removeNode(t)}}Object.defineProperty(v.prototype,"max",{set:function(e){(!e||"number"!=typeof e||e<=0)&&(e=1/0),this[a]=e,x(this)},get:function(){return this[a]},enumerable:!0}),Object.defineProperty(v.prototype,"allowStale",{set:function(e){this[c]=!!e},get:function(){return this[c]},enumerable:!0}),Object.defineProperty(v.prototype,"maxAge",{set:function(e){(!e||"number"!=typeof e||e<0)&&(e=0),this[h]=e,x(this)},get:function(){return this[h]},enumerable:!0}),Object.defineProperty(v.prototype,"lengthCalculator",{set:function(e){"function"!=typeof e&&(e=g),e!==this[l]&&(this[l]=e,this[u]=0,this[d].forEach(function(e){e.length=this[l](e.value,e.key),this[u]+=e.length},this)),x(this)},get:function(){return this[l]},enumerable:!0}),Object.defineProperty(v.prototype,"length",{get:function(){return this[u]},enumerable:!0}),Object.defineProperty(v.prototype,"itemCount",{get:function(){return this[d].length},enumerable:!0}),v.prototype.rforEach=function(e,t){t=t||this;for(var r=this[d].tail;null!==r;){var n=r.prev;y(this,e,r,t),r=n}},v.prototype.forEach=function(e,t){t=t||this;for(var r=this[d].head;null!==r;){var n=r.next;y(this,e,r,t),r=n}},v.prototype.keys=function(){return this[d].toArray().map(function(e){return e.key},this)},v.prototype.values=function(){return this[d].toArray().map(function(e){return e.value},this)},v.prototype.reset=function(){this[p]&&this[d]&&this[d].length&&this[d].forEach(function(e){this[p](e.key,e.value)},this),this[m]=new i,this[d]=new o,this[u]=0},v.prototype.dump=function(){return this[d].map(function(e){if(!b(this,e))return{k:e.key,v:e.value,e:e.now+(e.maxAge||0)}},this).toArray().filter(function(e){return e})},v.prototype.dumpLru=function(){return this[d]},v.prototype.inspect=function(e,t){var r="LRUCache {",n=!1;this[c]&&(r+="\n allowStale: true",n=!0);var i=this[a];i&&i!==1/0&&(n&&(r+=","),r+="\n max: "+s.inspect(i,t),n=!0);var o=this[h];o&&(n&&(r+=","),r+="\n maxAge: "+s.inspect(o,t),n=!0);var p=this[l];p&&p!==g&&(n&&(r+=","),r+="\n length: "+s.inspect(this[u],t),n=!0);var f=!1;return this[d].forEach(function(e){f?r+=",\n ":(n&&(r+=",\n"),f=!0,r+="\n ");var i=s.inspect(e.key).split("\n").join("\n "),a={value:e.value};e.maxAge!==o&&(a.maxAge=e.maxAge),p!==g&&(a.length=e.length),b(this,e)&&(a.stale=!0),a=s.inspect(a,t).split("\n").join("\n "),r+=i+" => "+a}),(f||n)&&(r+="\n"),r+="}"},v.prototype.set=function(e,t,r){var n=(r=r||this[h])?Date.now():0,i=this[l](t,e);if(this[m].has(e)){if(i>this[a])return w(this,this[m].get(e)),!1;var s=this[m].get(e).value;return this[p]&&(this[f]||this[p](e,s.value)),s.now=n,s.maxAge=r,s.value=t,this[u]+=i-s.length,s.length=i,this.get(e),x(this),!0}var o=new function(e,t,r,n,i){this.key=e,this.value=t,this.length=r,this.now=n,this.maxAge=i||0}(e,t,i,n,r);return o.length>this[a]?(this[p]&&this[p](e,t),!1):(this[u]+=o.length,this[d].unshift(o),this[m].set(e,this[d].head),x(this),!0)},v.prototype.has=function(e){return!!this[m].has(e)&&!b(this,this[m].get(e).value)},v.prototype.get=function(e){return _(this,e,!0)},v.prototype.peek=function(e){return _(this,e,!1)},v.prototype.pop=function(){var e=this[d].tail;return e?(w(this,e),e.value):null},v.prototype.del=function(e){w(this,this[m].get(e))},v.prototype.load=function(e){this.reset();for(var t=Date.now(),r=e.length-1;r>=0;r--){var n=e[r],i=n.e||0;if(0===i)this.set(n.k,n.v);else{var s=i-t;s>0&&this.set(n.k,n.v,s)}}},v.prototype.prune=function(){var e=this;this[m].forEach(function(t,r){_(e,r,!1)})}}).call(this,e("_process"))},{_process:452,pseudomap:453,util:538,yallist:548}],367:[function(e,t,r){(function(r){"use strict";const n=e("fs"),i=e("path"),{promisify:s}=e("util"),o=e("semver").satisfies(r.version,">=10.12.0"),a=e=>{if("win32"===r.platform){if(/[<>:"|?*]/.test(e.replace(i.parse(e).root,""))){const t=new Error(`Path contains invalid characters: ${e}`);throw t.code="EINVAL",t}}},u=e=>{return{...{mode:511,fs:n},...e}},l=e=>{const t=new Error(`operation not permitted, mkdir '${e}'`);return t.code="EPERM",t.errno=-4048,t.path=e,t.syscall="mkdir",t};t.exports=(async(e,t)=>{a(e),t=u(t);const r=s(t.fs.mkdir),c=s(t.fs.stat);if(o&&t.fs.mkdir===n.mkdir){const n=i.resolve(e);return await r(n,{mode:t.mode,recursive:!0}),n}const h=async e=>{try{return await r(e,t.mode),e}catch(t){if("EPERM"===t.code)throw t;if("ENOENT"===t.code){if(i.dirname(e)===e)throw l(e);if(t.message.includes("null bytes"))throw t;return await h(i.dirname(e)),h(e)}try{if(!(await c(e)).isDirectory())throw new Error("The path is not a directory")}catch(e){throw t}return e}};return h(i.resolve(e))}),t.exports.sync=((e,t)=>{if(a(e),t=u(t),o&&t.fs.mkdirSync===n.mkdirSync){const r=i.resolve(e);return n.mkdirSync(r,{mode:t.mode,recursive:!0}),r}const r=e=>{try{t.fs.mkdirSync(e,t.mode)}catch(n){if("EPERM"===n.code)throw n;if("ENOENT"===n.code){if(i.dirname(e)===e)throw l(e);if(n.message.includes("null bytes"))throw n;return r(i.dirname(e)),r(e)}try{if(!t.fs.statSync(e).isDirectory())throw new Error("The path is not a directory")}catch(e){throw n}}return e};return r(i.resolve(e))})}).call(this,e("_process"))},{_process:452,fs:290,path:397,semver:368,util:538}],368:[function(e,t,r){(function(e){var n;r=t.exports=f,n="object"==typeof e&&e.env&&e.env.NODE_DEBUG&&/\bsemver\b/i.test(e.env.NODE_DEBUG)?function(){var e=Array.prototype.slice.call(arguments,0);e.unshift("SEMVER"),console.log.apply(console,e)}:function(){},r.SEMVER_SPEC_VERSION="2.0.0";var i=256,s=Number.MAX_SAFE_INTEGER||9007199254740991,o=r.re=[],a=r.src=[],u=r.tokens={},l=0;function c(e){u[e]=l++}c("NUMERICIDENTIFIER"),a[u.NUMERICIDENTIFIER]="0|[1-9]\\d*",c("NUMERICIDENTIFIERLOOSE"),a[u.NUMERICIDENTIFIERLOOSE]="[0-9]+",c("NONNUMERICIDENTIFIER"),a[u.NONNUMERICIDENTIFIER]="\\d*[a-zA-Z-][a-zA-Z0-9-]*",c("MAINVERSION"),a[u.MAINVERSION]="("+a[u.NUMERICIDENTIFIER]+")\\.("+a[u.NUMERICIDENTIFIER]+")\\.("+a[u.NUMERICIDENTIFIER]+")",c("MAINVERSIONLOOSE"),a[u.MAINVERSIONLOOSE]="("+a[u.NUMERICIDENTIFIERLOOSE]+")\\.("+a[u.NUMERICIDENTIFIERLOOSE]+")\\.("+a[u.NUMERICIDENTIFIERLOOSE]+")",c("PRERELEASEIDENTIFIER"),a[u.PRERELEASEIDENTIFIER]="(?:"+a[u.NUMERICIDENTIFIER]+"|"+a[u.NONNUMERICIDENTIFIER]+")",c("PRERELEASEIDENTIFIERLOOSE"),a[u.PRERELEASEIDENTIFIERLOOSE]="(?:"+a[u.NUMERICIDENTIFIERLOOSE]+"|"+a[u.NONNUMERICIDENTIFIER]+")",c("PRERELEASE"),a[u.PRERELEASE]="(?:-("+a[u.PRERELEASEIDENTIFIER]+"(?:\\."+a[u.PRERELEASEIDENTIFIER]+")*))",c("PRERELEASELOOSE"),a[u.PRERELEASELOOSE]="(?:-?("+a[u.PRERELEASEIDENTIFIERLOOSE]+"(?:\\."+a[u.PRERELEASEIDENTIFIERLOOSE]+")*))",c("BUILDIDENTIFIER"),a[u.BUILDIDENTIFIER]="[0-9A-Za-z-]+",c("BUILD"),a[u.BUILD]="(?:\\+("+a[u.BUILDIDENTIFIER]+"(?:\\."+a[u.BUILDIDENTIFIER]+")*))",c("FULL"),c("FULLPLAIN"),a[u.FULLPLAIN]="v?"+a[u.MAINVERSION]+a[u.PRERELEASE]+"?"+a[u.BUILD]+"?",a[u.FULL]="^"+a[u.FULLPLAIN]+"$",c("LOOSEPLAIN"),a[u.LOOSEPLAIN]="[v=\\s]*"+a[u.MAINVERSIONLOOSE]+a[u.PRERELEASELOOSE]+"?"+a[u.BUILD]+"?",c("LOOSE"),a[u.LOOSE]="^"+a[u.LOOSEPLAIN]+"$",c("GTLT"),a[u.GTLT]="((?:<|>)?=?)",c("XRANGEIDENTIFIERLOOSE"),a[u.XRANGEIDENTIFIERLOOSE]=a[u.NUMERICIDENTIFIERLOOSE]+"|x|X|\\*",c("XRANGEIDENTIFIER"),a[u.XRANGEIDENTIFIER]=a[u.NUMERICIDENTIFIER]+"|x|X|\\*",c("XRANGEPLAIN"),a[u.XRANGEPLAIN]="[v=\\s]*("+a[u.XRANGEIDENTIFIER]+")(?:\\.("+a[u.XRANGEIDENTIFIER]+")(?:\\.("+a[u.XRANGEIDENTIFIER]+")(?:"+a[u.PRERELEASE]+")?"+a[u.BUILD]+"?)?)?",c("XRANGEPLAINLOOSE"),a[u.XRANGEPLAINLOOSE]="[v=\\s]*("+a[u.XRANGEIDENTIFIERLOOSE]+")(?:\\.("+a[u.XRANGEIDENTIFIERLOOSE]+")(?:\\.("+a[u.XRANGEIDENTIFIERLOOSE]+")(?:"+a[u.PRERELEASELOOSE]+")?"+a[u.BUILD]+"?)?)?",c("XRANGE"),a[u.XRANGE]="^"+a[u.GTLT]+"\\s*"+a[u.XRANGEPLAIN]+"$",c("XRANGELOOSE"),a[u.XRANGELOOSE]="^"+a[u.GTLT]+"\\s*"+a[u.XRANGEPLAINLOOSE]+"$",c("COERCE"),a[u.COERCE]="(^|[^\\d])(\\d{1,16})(?:\\.(\\d{1,16}))?(?:\\.(\\d{1,16}))?(?:$|[^\\d])",c("COERCERTL"),o[u.COERCERTL]=new RegExp(a[u.COERCE],"g"),c("LONETILDE"),a[u.LONETILDE]="(?:~>?)",c("TILDETRIM"),a[u.TILDETRIM]="(\\s*)"+a[u.LONETILDE]+"\\s+",o[u.TILDETRIM]=new RegExp(a[u.TILDETRIM],"g");c("TILDE"),a[u.TILDE]="^"+a[u.LONETILDE]+a[u.XRANGEPLAIN]+"$",c("TILDELOOSE"),a[u.TILDELOOSE]="^"+a[u.LONETILDE]+a[u.XRANGEPLAINLOOSE]+"$",c("LONECARET"),a[u.LONECARET]="(?:\\^)",c("CARETTRIM"),a[u.CARETTRIM]="(\\s*)"+a[u.LONECARET]+"\\s+",o[u.CARETTRIM]=new RegExp(a[u.CARETTRIM],"g");c("CARET"),a[u.CARET]="^"+a[u.LONECARET]+a[u.XRANGEPLAIN]+"$",c("CARETLOOSE"),a[u.CARETLOOSE]="^"+a[u.LONECARET]+a[u.XRANGEPLAINLOOSE]+"$",c("COMPARATORLOOSE"),a[u.COMPARATORLOOSE]="^"+a[u.GTLT]+"\\s*("+a[u.LOOSEPLAIN]+")$|^$",c("COMPARATOR"),a[u.COMPARATOR]="^"+a[u.GTLT]+"\\s*("+a[u.FULLPLAIN]+")$|^$",c("COMPARATORTRIM"),a[u.COMPARATORTRIM]="(\\s*)"+a[u.GTLT]+"\\s*("+a[u.LOOSEPLAIN]+"|"+a[u.XRANGEPLAIN]+")",o[u.COMPARATORTRIM]=new RegExp(a[u.COMPARATORTRIM],"g");c("HYPHENRANGE"),a[u.HYPHENRANGE]="^\\s*("+a[u.XRANGEPLAIN]+")\\s+-\\s+("+a[u.XRANGEPLAIN]+")\\s*$",c("HYPHENRANGELOOSE"),a[u.HYPHENRANGELOOSE]="^\\s*("+a[u.XRANGEPLAINLOOSE]+")\\s+-\\s+("+a[u.XRANGEPLAINLOOSE]+")\\s*$",c("STAR"),a[u.STAR]="(<|>)?=?\\s*\\*";for(var h=0;hi)return null;if(!(t.loose?o[u.LOOSE]:o[u.FULL]).test(e))return null;try{return new f(e,t)}catch(e){return null}}function f(e,t){if(t&&"object"==typeof t||(t={loose:!!t,includePrerelease:!1}),e instanceof f){if(e.loose===t.loose)return e;e=e.version}else if("string"!=typeof e)throw new TypeError("Invalid Version: "+e);if(e.length>i)throw new TypeError("version is longer than "+i+" characters");if(!(this instanceof f))return new f(e,t);n("SemVer",e,t),this.options=t,this.loose=!!t.loose;var r=e.trim().match(t.loose?o[u.LOOSE]:o[u.FULL]);if(!r)throw new TypeError("Invalid Version: "+e);if(this.raw=e,this.major=+r[1],this.minor=+r[2],this.patch=+r[3],this.major>s||this.major<0)throw new TypeError("Invalid major version");if(this.minor>s||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>s||this.patch<0)throw new TypeError("Invalid patch version");r[4]?this.prerelease=r[4].split(".").map(function(e){if(/^[0-9]+$/.test(e)){var t=+e;if(t>=0&&t=0;)"number"==typeof this.prerelease[r]&&(this.prerelease[r]++,r=-2);-1===r&&this.prerelease.push(0)}t&&(this.prerelease[0]===t?isNaN(this.prerelease[1])&&(this.prerelease=[t,0]):this.prerelease=[t,0]);break;default:throw new Error("invalid increment argument: "+e)}return this.format(),this.raw=this.version,this},r.inc=function(e,t,r,n){"string"==typeof r&&(n=r,r=void 0);try{return new f(e,r).inc(t,n).version}catch(e){return null}},r.diff=function(e,t){if(_(e,t))return null;var r=p(e),n=p(t),i="";if(r.prerelease.length||n.prerelease.length){i="pre";var s="prerelease"}for(var o in r)if(("major"===o||"minor"===o||"patch"===o)&&r[o]!==n[o])return i+o;return s},r.compareIdentifiers=m;var d=/^[0-9]+$/;function m(e,t){var r=d.test(e),n=d.test(t);return r&&n&&(e=+e,t=+t),e===t?0:r&&!n?-1:n&&!r?1:e0}function y(e,t,r){return g(e,t,r)<0}function _(e,t,r){return 0===g(e,t,r)}function b(e,t,r){return 0!==g(e,t,r)}function x(e,t,r){return g(e,t,r)>=0}function w(e,t,r){return g(e,t,r)<=0}function E(e,t,r,n){switch(t){case"===":return"object"==typeof e&&(e=e.version),"object"==typeof r&&(r=r.version),e===r;case"!==":return"object"==typeof e&&(e=e.version),"object"==typeof r&&(r=r.version),e!==r;case"":case"=":case"==":return _(e,r,n);case"!=":return b(e,r,n);case">":return v(e,r,n);case">=":return x(e,r,n);case"<":return y(e,r,n);case"<=":return w(e,r,n);default:throw new TypeError("Invalid operator: "+t)}}function T(e,t){if(t&&"object"==typeof t||(t={loose:!!t,includePrerelease:!1}),e instanceof T){if(e.loose===!!t.loose)return e;e=e.value}if(!(this instanceof T))return new T(e,t);n("comparator",e,t),this.options=t,this.loose=!!t.loose,this.parse(e),this.semver===A?this.value="":this.value=this.operator+this.semver.version,n("comp",this)}r.rcompareIdentifiers=function(e,t){return m(t,e)},r.major=function(e,t){return new f(e,t).major},r.minor=function(e,t){return new f(e,t).minor},r.patch=function(e,t){return new f(e,t).patch},r.compare=g,r.compareLoose=function(e,t){return g(e,t,!0)},r.compareBuild=function(e,t,r){var n=new f(e,r),i=new f(t,r);return n.compare(i)||n.compareBuild(i)},r.rcompare=function(e,t,r){return g(t,e,r)},r.sort=function(e,t){return e.sort(function(e,n){return r.compareBuild(e,n,t)})},r.rsort=function(e,t){return e.sort(function(e,n){return r.compareBuild(n,e,t)})},r.gt=v,r.lt=y,r.eq=_,r.neq=b,r.gte=x,r.lte=w,r.cmp=E,r.Comparator=T;var A={};function S(e,t){if(t&&"object"==typeof t||(t={loose:!!t,includePrerelease:!1}),e instanceof S)return e.loose===!!t.loose&&e.includePrerelease===!!t.includePrerelease?e:new S(e.raw,t);if(e instanceof T)return new S(e.value,t);if(!(this instanceof S))return new S(e,t);if(this.options=t,this.loose=!!t.loose,this.includePrerelease=!!t.includePrerelease,this.raw=e,this.set=e.split(/\s*\|\|\s*/).map(function(e){return this.parseRange(e.trim())},this).filter(function(e){return e.length}),!this.set.length)throw new TypeError("Invalid SemVer Range: "+e);this.format()}function k(e,t){for(var r=!0,n=e.slice(),i=n.pop();r&&n.length;)r=n.every(function(e){return i.intersects(e,t)}),i=n.pop();return r}function C(e){return!e||"x"===e.toLowerCase()||"*"===e}function I(e,t,r,n,i,s,o,a,u,l,c,h,p){return((t=C(r)?"":C(n)?">="+r+".0.0":C(i)?">="+r+"."+n+".0":">="+t)+" "+(a=C(u)?"":C(l)?"<"+(+u+1)+".0.0":C(c)?"<"+u+"."+(+l+1)+".0":h?"<="+u+"."+l+"."+c+"-"+h:"<="+a)).trim()}function R(e,t,r){for(var i=0;i0){var s=e[i].semver;if(s.major===t.major&&s.minor===t.minor&&s.patch===t.patch)return!0}return!1}return!0}function O(e,t,r){try{t=new S(t,r)}catch(e){return!1}return t.test(e)}function L(e,t,r,n){var i,s,o,a,u;switch(e=new f(e,n),t=new S(t,n),r){case">":i=v,s=w,o=y,a=">",u=">=";break;case"<":i=y,s=x,o=v,a="<",u="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(O(e,t,n))return!1;for(var l=0;l=0.0.0")),c=c||e,h=h||e,i(e.semver,c.semver,n)?c=e:o(e.semver,h.semver,n)&&(h=e)}),c.operator===a||c.operator===u)return!1;if((!h.operator||h.operator===a)&&s(e,h.semver))return!1;if(h.operator===u&&o(e,h.semver))return!1}return!0}T.prototype.parse=function(e){var t=this.options.loose?o[u.COMPARATORLOOSE]:o[u.COMPARATOR],r=e.match(t);if(!r)throw new TypeError("Invalid comparator: "+e);this.operator=void 0!==r[1]?r[1]:"","="===this.operator&&(this.operator=""),r[2]?this.semver=new f(r[2],this.options.loose):this.semver=A},T.prototype.toString=function(){return this.value},T.prototype.test=function(e){if(n("Comparator.test",e,this.options.loose),this.semver===A||e===A)return!0;if("string"==typeof e)try{e=new f(e,this.options)}catch(e){return!1}return E(e,this.operator,this.semver,this.options)},T.prototype.intersects=function(e,t){if(!(e instanceof T))throw new TypeError("a Comparator is required");var r;if(t&&"object"==typeof t||(t={loose:!!t,includePrerelease:!1}),""===this.operator)return""===this.value||(r=new S(e.value,t),O(this.value,r,t));if(""===e.operator)return""===e.value||(r=new S(this.value,t),O(e.semver,r,t));var n=!(">="!==this.operator&&">"!==this.operator||">="!==e.operator&&">"!==e.operator),i=!("<="!==this.operator&&"<"!==this.operator||"<="!==e.operator&&"<"!==e.operator),s=this.semver.version===e.semver.version,o=!(">="!==this.operator&&"<="!==this.operator||">="!==e.operator&&"<="!==e.operator),a=E(this.semver,"<",e.semver,t)&&(">="===this.operator||">"===this.operator)&&("<="===e.operator||"<"===e.operator),u=E(this.semver,">",e.semver,t)&&("<="===this.operator||"<"===this.operator)&&(">="===e.operator||">"===e.operator);return n||i||s&&o||a||u},r.Range=S,S.prototype.format=function(){return this.range=this.set.map(function(e){return e.join(" ").trim()}).join("||").trim(),this.range},S.prototype.toString=function(){return this.range},S.prototype.parseRange=function(e){var t=this.options.loose;e=e.trim();var r=t?o[u.HYPHENRANGELOOSE]:o[u.HYPHENRANGE];e=e.replace(r,I),n("hyphen replace",e),e=e.replace(o[u.COMPARATORTRIM],"$1$2$3"),n("comparator trim",e,o[u.COMPARATORTRIM]),e=(e=(e=e.replace(o[u.TILDETRIM],"$1~")).replace(o[u.CARETTRIM],"$1^")).split(/\s+/).join(" ");var i=t?o[u.COMPARATORLOOSE]:o[u.COMPARATOR],s=e.split(" ").map(function(e){return function(e,t){return n("comp",e,t),e=function(e,t){return e.trim().split(/\s+/).map(function(e){return function(e,t){n("caret",e,t);var r=t.loose?o[u.CARETLOOSE]:o[u.CARET];return e.replace(r,function(t,r,i,s,o){var a;return n("caret",e,t,r,i,s,o),C(r)?a="":C(i)?a=">="+r+".0.0 <"+(+r+1)+".0.0":C(s)?a="0"===r?">="+r+"."+i+".0 <"+r+"."+(+i+1)+".0":">="+r+"."+i+".0 <"+(+r+1)+".0.0":o?(n("replaceCaret pr",o),a="0"===r?"0"===i?">="+r+"."+i+"."+s+"-"+o+" <"+r+"."+i+"."+(+s+1):">="+r+"."+i+"."+s+"-"+o+" <"+r+"."+(+i+1)+".0":">="+r+"."+i+"."+s+"-"+o+" <"+(+r+1)+".0.0"):(n("no pr"),a="0"===r?"0"===i?">="+r+"."+i+"."+s+" <"+r+"."+i+"."+(+s+1):">="+r+"."+i+"."+s+" <"+r+"."+(+i+1)+".0":">="+r+"."+i+"."+s+" <"+(+r+1)+".0.0"),n("caret return",a),a})}(e,t)}).join(" ")}(e,t),n("caret",e),e=function(e,t){return e.trim().split(/\s+/).map(function(e){return function(e,t){var r=t.loose?o[u.TILDELOOSE]:o[u.TILDE];return e.replace(r,function(t,r,i,s,o){var a;return n("tilde",e,t,r,i,s,o),C(r)?a="":C(i)?a=">="+r+".0.0 <"+(+r+1)+".0.0":C(s)?a=">="+r+"."+i+".0 <"+r+"."+(+i+1)+".0":o?(n("replaceTilde pr",o),a=">="+r+"."+i+"."+s+"-"+o+" <"+r+"."+(+i+1)+".0"):a=">="+r+"."+i+"."+s+" <"+r+"."+(+i+1)+".0",n("tilde return",a),a})}(e,t)}).join(" ")}(e,t),n("tildes",e),e=function(e,t){return n("replaceXRanges",e,t),e.split(/\s+/).map(function(e){return function(e,t){e=e.trim();var r=t.loose?o[u.XRANGELOOSE]:o[u.XRANGE];return e.replace(r,function(r,i,s,o,a,u){n("xRange",e,r,i,s,o,a,u);var l=C(s),c=l||C(o),h=c||C(a),p=h;return"="===i&&p&&(i=""),u=t.includePrerelease?"-0":"",l?r=">"===i||"<"===i?"<0.0.0-0":"*":i&&p?(c&&(o=0),a=0,">"===i?(i=">=",c?(s=+s+1,o=0,a=0):(o=+o+1,a=0)):"<="===i&&(i="<",c?s=+s+1:o=+o+1),r=i+s+"."+o+"."+a+u):c?r=">="+s+".0.0"+u+" <"+(+s+1)+".0.0"+u:h&&(r=">="+s+"."+o+".0"+u+" <"+s+"."+(+o+1)+".0"+u),n("xRange return",r),r})}(e,t)}).join(" ")}(e,t),n("xrange",e),e=function(e,t){return n("replaceStars",e,t),e.trim().replace(o[u.STAR],"")}(e,t),n("stars",e),e}(e,this.options)},this).join(" ").split(/\s+/);return this.options.loose&&(s=s.filter(function(e){return!!e.match(i)})),s=s.map(function(e){return new T(e,this.options)},this)},S.prototype.intersects=function(e,t){if(!(e instanceof S))throw new TypeError("a Range is required");return this.set.some(function(r){return k(r,t)&&e.set.some(function(e){return k(e,t)&&r.every(function(r){return e.every(function(e){return r.intersects(e,t)})})})})},r.toComparators=function(e,t){return new S(e,t).set.map(function(e){return e.map(function(e){return e.value}).join(" ").trim().split(" ")})},S.prototype.test=function(e){if(!e)return!1;if("string"==typeof e)try{e=new f(e,this.options)}catch(e){return!1}for(var t=0;t":0===t.prerelease.length?t.patch++:t.prerelease.push(0),t.raw=t.format();case"":case">=":r&&!v(r,t)||(r=t);break;case"<":case"<=":break;default:throw new Error("Unexpected operation: "+e.operator)}})}if(r&&e.test(r))return r;return null},r.validRange=function(e,t){try{return new S(e,t).range||"*"}catch(e){return null}},r.ltr=function(e,t,r){return L(e,t,"<",r)},r.gtr=function(e,t,r){return L(e,t,">",r)},r.outside=L,r.prerelease=function(e,t){var r=p(e,t);return r&&r.prerelease.length?r.prerelease:null},r.intersects=function(e,t,r){return e=new S(e,r),t=new S(t,r),e.intersects(t)},r.coerce=function(e,t){if(e instanceof f)return e;"number"==typeof e&&(e=String(e));if("string"!=typeof e)return null;var r=null;if((t=t||{}).rtl){for(var n;(n=o[u.COERCERTL].exec(e))&&(!r||r.index+r[0].length!==e.length);)r&&n.index+n[0].length===r.index+r[0].length||(r=n),o[u.COERCERTL].lastIndex=n.index+n[1].length+n[2].length;o[u.COERCERTL].lastIndex=-1}else r=e.match(o[u.COERCE]);if(null===r)return null;return p(r[2]+"."+(r[3]||"0")+"."+(r[4]||"0"),t)}}).call(this,e("_process"))},{_process:452}],369:[function(e,t,r){"use strict";const{PassThrough:n}=e("stream");t.exports=function(){var e=[],t=new n({objectMode:!0});return t.setMaxListeners(0),t.add=r,t.isEmpty=function(){return 0==e.length},t.on("unpipe",i),Array.prototype.slice.call(arguments).forEach(r),t;function r(n){return Array.isArray(n)?(n.forEach(r),this):(e.push(n),n.once("end",i.bind(null,n)),n.once("error",t.emit.bind(t,"error")),n.pipe(t,{end:!1}),this)}function i(r){!(e=e.filter(function(e){return e!==r})).length&&t.readable&&t.end()}}},{stream:518}],370:[function(e,t,r){(function(r){"use strict";const n=e("stream").PassThrough,i=Array.prototype.slice;function s(e,t){if(Array.isArray(e))for(let r=0,n=e.length;r0||(t=!1,n())}function a(e){function t(){e.removeListener("merge2UnpipeEnd",t),e.removeListener("end",t),o()}if(e._readableState.endEmitted)return o();e.on("merge2UnpipeEnd",t),e.on("end",t),e.pipe(l,{end:!1}),e.resume()}for(let e=0;e""===e||"./"===e,u=(e,t,r)=>{t=[].concat(t),e=[].concat(e);let n=new Set,i=new Set,o=new Set,a=0,u=e=>{o.add(e.output),r&&r.onResult&&r.onResult(e)};for(let o=0;o!n.has(e));if(r&&0===l.length){if(!0===r.failglob)throw new Error(`No matches found for "${t.join(", ")}"`);if(!0===r.nonull||!0===r.nullglob)return r.unescape?t.map(e=>e.replace(/\\/g,"")):t}return l};u.match=u,u.matcher=((e,t)=>s(e,t)),u.any=u.isMatch=((e,t,r)=>s(t,r)(e)),u.not=((e,t,r={})=>{t=[].concat(t).map(String);let n=new Set,i=[],s=u(e,t,{...r,onResult:e=>{r.onResult&&r.onResult(e),i.push(e.output)}});for(let e of i)s.includes(e)||n.add(e);return[...n]}),u.contains=((e,t,r)=>{if("string"!=typeof e)throw new TypeError(`Expected a string: "${n.inspect(e)}"`);if(Array.isArray(t))return t.some(t=>u.contains(e,t,r));if("string"==typeof t){if(a(e)||a(t))return!1;if(e.includes(t)||e.startsWith("./")&&e.slice(2).includes(t))return!0}return u.isMatch(e,t,{...r,contains:!0})}),u.matchKeys=((e,t,r)=>{if(!o.isObject(e))throw new TypeError("Expected the first argument to be an object");let n=u(Object.keys(e),t,r),i={};for(let t of n)i[t]=e[t];return i}),u.some=((e,t,r)=>{let n=[].concat(e);for(let e of[].concat(t)){let t=s(String(e),r);if(n.some(e=>t(e)))return!0}return!1}),u.every=((e,t,r)=>{let n=[].concat(e);for(let e of[].concat(t)){let t=s(String(e),r);if(!n.every(e=>t(e)))return!1}return!0}),u.all=((e,t,r)=>{if("string"!=typeof e)throw new TypeError(`Expected a string: "${n.inspect(e)}"`);return[].concat(t).every(t=>s(t,r)(e))}),u.capture=((e,t,r)=>{let n=o.isWindows(r),i=s.makeRe(String(e),{...r,capture:!0}).exec(n?o.toPosixSlashes(t):t);if(i)return i.slice(1).map(e=>void 0===e?"":e)}),u.makeRe=((...e)=>s.makeRe(...e)),u.scan=((...e)=>s.scan(...e)),u.parse=((e,t)=>{let r=[];for(let n of[].concat(e||[]))for(let e of i(String(n),t))r.push(s.parse(e,t));return r}),u.braces=((e,t)=>{if("string"!=typeof e)throw new TypeError("Expected a string");return t&&!0===t.nobrace||!/\{.*\}/.test(e)?[e]:i(e,t)}),u.braceExpand=((e,t)=>{if("string"!=typeof e)throw new TypeError("Expected a string");return u.braces(e,{...t,expand:!0})}),t.exports=u},{braces:372,picomatch:400,"picomatch/lib/utils":405,util:538}],372:[function(e,t,r){"use strict";const n=e("./lib/stringify"),i=e("./lib/compile"),s=e("./lib/expand"),o=e("./lib/parse"),a=(e,t={})=>{let r=[];if(Array.isArray(e))for(let n of e){let e=a.create(n,t);Array.isArray(e)?r.push(...e):r.push(e)}else r=[].concat(a.create(e,t));return t&&!0===t.expand&&!0===t.nodupes&&(r=[...new Set(r)]),r};a.parse=((e,t={})=>o(e,t)),a.stringify=((e,t={})=>n("string"==typeof e?a.parse(e,t):e,t)),a.compile=((e,t={})=>("string"==typeof e&&(e=a.parse(e,t)),i(e,t))),a.expand=((e,t={})=>{"string"==typeof e&&(e=a.parse(e,t));let r=s(e,t);return!0===t.noempty&&(r=r.filter(Boolean)),!0===t.nodupes&&(r=[...new Set(r)]),r}),a.create=((e,t={})=>""===e||e.length<3?[e]:!0!==t.expand?a.compile(e,t):a.expand(e,t)),t.exports=a},{"./lib/compile":373,"./lib/expand":375,"./lib/parse":376,"./lib/stringify":377}],373:[function(e,t,r){"use strict";const n=e("fill-range"),i=e("./utils");t.exports=((e,t={})=>{let r=(e,s={})=>{let o=i.isInvalidBrace(s),a=!0===e.invalid&&!0===t.escapeInvalid,u=!0===o||!0===a,l=!0===t.escapeInvalid?"\\":"",c="";if(!0===e.isOpen)return l+e.value;if(!0===e.isClose)return l+e.value;if("open"===e.type)return u?l+e.value:"(";if("close"===e.type)return u?l+e.value:")";if("comma"===e.type)return"comma"===e.prev.type?"":u?e.value:"|";if(e.value)return e.value;if(e.nodes&&e.ranges>0){let r=i.reduce(e.nodes),s=n(...r,{...t,wrap:!1,toRegex:!0});if(0!==s.length)return r.length>1&&s.length>1?`(${s})`:s}if(e.nodes)for(let t of e.nodes)c+=r(t,e);return c};return r(e)})},{"./utils":378,"fill-range":379}],374:[function(e,t,r){"use strict";t.exports={MAX_LENGTH:65536,CHAR_0:"0",CHAR_9:"9",CHAR_UPPERCASE_A:"A",CHAR_LOWERCASE_A:"a",CHAR_UPPERCASE_Z:"Z",CHAR_LOWERCASE_Z:"z",CHAR_LEFT_PARENTHESES:"(",CHAR_RIGHT_PARENTHESES:")",CHAR_ASTERISK:"*",CHAR_AMPERSAND:"&",CHAR_AT:"@",CHAR_BACKSLASH:"\\",CHAR_BACKTICK:"`",CHAR_CARRIAGE_RETURN:"\r",CHAR_CIRCUMFLEX_ACCENT:"^",CHAR_COLON:":",CHAR_COMMA:",",CHAR_DOLLAR:"$",CHAR_DOT:".",CHAR_DOUBLE_QUOTE:'"',CHAR_EQUAL:"=",CHAR_EXCLAMATION_MARK:"!",CHAR_FORM_FEED:"\f",CHAR_FORWARD_SLASH:"/",CHAR_HASH:"#",CHAR_HYPHEN_MINUS:"-",CHAR_LEFT_ANGLE_BRACKET:"<",CHAR_LEFT_CURLY_BRACE:"{",CHAR_LEFT_SQUARE_BRACKET:"[",CHAR_LINE_FEED:"\n",CHAR_NO_BREAK_SPACE:" ",CHAR_PERCENT:"%",CHAR_PLUS:"+",CHAR_QUESTION_MARK:"?",CHAR_RIGHT_ANGLE_BRACKET:">",CHAR_RIGHT_CURLY_BRACE:"}",CHAR_RIGHT_SQUARE_BRACKET:"]",CHAR_SEMICOLON:";",CHAR_SINGLE_QUOTE:"'",CHAR_SPACE:" ",CHAR_TAB:"\t",CHAR_UNDERSCORE:"_",CHAR_VERTICAL_LINE:"|",CHAR_ZERO_WIDTH_NOBREAK_SPACE:"\ufeff"}},{}],375:[function(e,t,r){"use strict";const n=e("fill-range"),i=e("./stringify"),s=e("./utils"),o=(e="",t="",r=!1)=>{let n=[];if(e=[].concat(e),!(t=[].concat(t)).length)return e;if(!e.length)return r?s.flatten(t).map(e=>`{${e}}`):t;for(let i of e)if(Array.isArray(i))for(let e of i)n.push(o(e,t,r));else for(let e of t)!0===r&&"string"==typeof e&&(e=`{${e}}`),n.push(Array.isArray(e)?o(i,e,r):i+e);return s.flatten(n)};t.exports=((e,t={})=>{let r=void 0===t.rangeLimit?1e3:t.rangeLimit,a=(e,u={})=>{e.queue=[];let l=u,c=u.queue;for(;"brace"!==l.type&&"root"!==l.type&&l.parent;)c=(l=l.parent).queue;if(e.invalid||e.dollar)return void c.push(o(c.pop(),i(e,t)));if("brace"===e.type&&!0!==e.invalid&&2===e.nodes.length)return void c.push(o(c.pop(),["{}"]));if(e.nodes&&e.ranges>0){let a=s.reduce(e.nodes);if(s.exceedsLimit(...a,t.step,r))throw new RangeError("expanded array length exceeds range limit. Use options.rangeLimit to increase or disable the limit.");let u=n(...a,t);return 0===u.length&&(u=i(e,t)),c.push(o(c.pop(),u)),void(e.nodes=[])}let h=s.encloseBrace(e),p=e.queue,f=e;for(;"brace"!==f.type&&"root"!==f.type&&f.parent;)p=(f=f.parent).queue;for(let t=0;t{if("string"!=typeof e)throw new TypeError("Expected a string");let r=t||{},_="number"==typeof r.maxLength?Math.min(i,r.maxLength):i;if(e.length>_)throw new SyntaxError(`Input length (${e.length}), exceeds max characters (${_})`);let b,x={type:"root",input:e,nodes:[]},w=[x],E=x,T=x,A=0,S=e.length,k=0,C=0;const I=()=>e[k++],R=e=>{if("text"===e.type&&"dot"===T.type&&(T.type="text"),!T||"text"!==T.type||"text"!==e.type)return E.nodes.push(e),e.parent=E,e.prev=T,T=e,e;T.value+=e.value};for(R({type:"bos"});k0){if(E.ranges>0){E.ranges=0;let e=E.nodes.shift();E.nodes=[e,{type:"text",value:n(E)}]}R({type:"comma",value:b}),E.commas++}else if(b===u&&C>0&&0===E.commas){let e=E.nodes;if(0===C||0===e.length){R({type:"text",value:b});continue}if("dot"===T.type){if(E.range=[],T.value+=b,T.type="range",3!==E.nodes.length&&5!==E.nodes.length){E.invalid=!0,E.ranges=0,T.type="text";continue}E.ranges++,E.args=[];continue}if("range"===T.type){e.pop();let t=e[e.length-1];t.value+=T.value+b,T=t,E.ranges--;continue}R({type:"dot",value:b})}else R({type:"text",value:b});else{if("brace"!==E.type){R({type:"text",value:b});continue}let e="close";(E=w.pop()).close=!0,R({type:e,value:b}),C--,E=w[w.length-1]}else{C++;let e=T.value&&"$"===T.value.slice(-1)||!0===E.dollar;E=R({type:"brace",open:!0,close:!1,dollar:e,depth:C,commas:0,ranges:0,nodes:[]}),w.push(E),R({type:"open",value:b})}else{let e,r=b;for(!0!==t.keepQuotes&&(b="");k{e.nodes||("open"===e.type&&(e.isOpen=!0),"close"===e.type&&(e.isClose=!0),e.nodes||(e.type="text"),e.invalid=!0)});let e=w[w.length-1],t=e.nodes.indexOf(E);e.nodes.splice(t,1,...E.nodes)}}while(w.length>0);return R({type:"eos"}),x})},{"./constants":374,"./stringify":377}],377:[function(e,t,r){"use strict";const n=e("./utils");t.exports=((e,t={})=>{let r=(e,i={})=>{let s=t.escapeInvalid&&n.isInvalidBrace(i),o=!0===e.invalid&&!0===t.escapeInvalid,a="";if(e.value)return(s||o)&&n.isOpenOrClose(e)?"\\"+e.value:e.value;if(e.value)return e.value;if(e.nodes)for(let t of e.nodes)a+=r(t);return a};return r(e)})},{"./utils":378}],378:[function(e,t,r){"use strict";r.isInteger=(e=>"number"==typeof e?Number.isInteger(e):"string"==typeof e&&""!==e.trim()&&Number.isInteger(Number(e))),r.find=((e,t)=>e.nodes.find(e=>e.type===t)),r.exceedsLimit=((e,t,n=1,i)=>!1!==i&&(!(!r.isInteger(e)||!r.isInteger(t))&&(Number(t)-Number(e))/Number(n)>=i)),r.escapeNode=((e,t=0,r)=>{let n=e.nodes[t];n&&(r&&n.type===r||"open"===n.type||"close"===n.type)&&!0!==n.escaped&&(n.value="\\"+n.value,n.escaped=!0)}),r.encloseBrace=(e=>"brace"===e.type&&(e.commas>>0+e.ranges>>0==0&&(e.invalid=!0,!0))),r.isInvalidBrace=(e=>"brace"===e.type&&(!(!0!==e.invalid&&!e.dollar)||(e.commas>>0+e.ranges>>0==0?(e.invalid=!0,!0):(!0!==e.open||!0!==e.close)&&(e.invalid=!0,!0)))),r.isOpenOrClose=(e=>"open"===e.type||"close"===e.type||(!0===e.open||!0===e.close)),r.reduce=(e=>e.reduce((e,t)=>("text"===t.type&&e.push(t.value),"range"===t.type&&(t.type="text"),e),[])),r.flatten=((...e)=>{const t=[],r=e=>{for(let n=0;nnull!==e&&"object"==typeof e&&!Array.isArray(e),o=e=>"number"==typeof e||"string"==typeof e&&""!==e,a=e=>Number.isInteger(+e),u=e=>{let t=`${e}`,r=-1;if("-"===t[0]&&(t=t.slice(1)),"0"===t)return!1;for(;"0"===t[++r];);return r>0},l=(e,t,r)=>{if(t>0){let r="-"===e[0]?"-":"";r&&(e=e.slice(1)),e=r+e.padStart(r?t-1:t,"0")}return!1===r?String(e):e},c=(e,t)=>{let r="-"===e[0]?"-":"";for(r&&(e=e.slice(1),t--);e.length{if(r)return i(e,t,{wrap:!1,...n});let s=String.fromCharCode(e);return e===t?s:`[${s}-${String.fromCharCode(t)}]`},p=(e,t,r)=>{if(Array.isArray(e)){let t=!0===r.wrap,n=r.capture?"":"?:";return t?`(${n}${e.join("|")})`:e.join("|")}return i(e,t,r)},f=(...e)=>new RangeError("Invalid range arguments: "+n.inspect(...e)),d=(e,t,r)=>{if(!0===r.strictRanges)throw f([e,t]);return[]},m=(e,t,r=1,n={})=>{let i=Number(e),s=Number(t);if(!Number.isInteger(i)||!Number.isInteger(s)){if(!0===n.strictRanges)throw f([e,t]);return[]}0===i&&(i=0),0===s&&(s=0);let o=i>s,a=String(e),d=String(t),m=String(r);r=Math.max(Math.abs(r),1);let g=u(a)||u(d)||u(m),v=g?Math.max(a.length,d.length,m.length):0,y=!1===g&&!1===((e,t,r)=>"string"==typeof e||"string"==typeof t||!0===r.stringify)(e,t,n),_=n.transform||(e=>t=>!0===e?Number(t):String(t))(y);if(n.toRegex&&1===r)return h(c(e,v),c(t,v),!0,n);let b={negatives:[],positives:[]},x=e=>b[e<0?"negatives":"positives"].push(Math.abs(e)),w=[],E=0;for(;o?i>=s:i<=s;)!0===n.toRegex&&r>1?x(i):w.push(l(_(i,E),v,y)),i=o?i-r:i+r,E++;return!0===n.toRegex?r>1?((e,t)=>{e.negatives.sort((e,t)=>et?1:0),e.positives.sort((e,t)=>et?1:0);let r,n=t.capture?"":"?:",i="",s="";return e.positives.length&&(i=e.positives.join("|")),e.negatives.length&&(s=`-(${n}${e.negatives.join("|")})`),r=i&&s?`${i}|${s}`:i||s,t.wrap?`(${n}${r})`:r})(b,n):p(w,null,{wrap:!1,...n}):w},g=(e,t,r,n={})=>{if(null==t&&o(e))return[e];if(!o(e)||!o(t))return d(e,t,n);if("function"==typeof r)return g(e,t,1,{transform:r});if(s(r))return g(e,t,0,r);let i={...n};return!0===i.capture&&(i.wrap=!0),r=r||i.step||1,a(r)?a(e)&&a(t)?m(e,t,r,i):((e,t,r=1,n={})=>{if(!a(e)&&e.length>1||!a(t)&&t.length>1)return d(e,t,n);let i=n.transform||(e=>String.fromCharCode(e)),s=`${e}`.charCodeAt(0),o=`${t}`.charCodeAt(0),u=s>o,l=Math.min(s,o),c=Math.max(s,o);if(n.toRegex&&1===r)return h(l,c,!1,n);let f=[],m=0;for(;u?s>=o:s<=o;)f.push(i(s,m)),s=u?s-r:s+r,m++;return!0===n.toRegex?p(f,null,{wrap:!1,options:n}):f})(e,t,Math.max(Math.abs(r),1),i):null==r||s(r)?g(e,t,1,r):((e,t)=>{if(!0===t.strictRanges)throw new TypeError(`Expected step "${e}" to be a number`);return[]})(r,i)};t.exports=g},{"to-regex-range":381,util:538}],380:[function(e,t,r){"use strict";t.exports=function(e){return"number"==typeof e?e-e==0:"string"==typeof e&&""!==e.trim()&&(Number.isFinite?Number.isFinite(+e):isFinite(+e))}},{}],381:[function(e,t,r){"use strict";const n=e("is-number"),i=(e,t,r)=>{if(!1===n(e))throw new TypeError("toRegexRange: expected the first argument to be a number");if(void 0===t||e===t)return String(e);if(!1===n(t))throw new TypeError("toRegexRange: expected the second argument to be a number.");let s={relaxZeros:!0,...r};"boolean"==typeof s.strictZeros&&(s.relaxZeros=!1===s.strictZeros);let u=e+":"+t+"="+String(s.relaxZeros)+String(s.shorthand)+String(s.capture)+String(s.wrap);if(i.cache.hasOwnProperty(u))return i.cache[u].result;let l=Math.min(e,t),c=Math.max(e,t);if(1===Math.abs(l-c)){let r=e+"|"+t;return s.capture?`(${r})`:!1===s.wrap?r:`(?:${r})`}let h=d(e)||d(t),p={min:e,max:t,a:l,b:c},f=[],m=[];if(h&&(p.isPadded=h,p.maxLen=String(p.max).length),l<0){m=o(c<0?Math.abs(c):1,Math.abs(l),p,s),l=p.a=0}return c>=0&&(f=o(l,c,p,s)),p.negatives=m,p.positives=f,p.result=function(e,t,r){let n=a(e,t,"-",!1,r)||[],i=a(t,e,"",!1,r)||[],s=a(e,t,"-?",!0,r)||[];return n.concat(s).concat(i).join("|")}(m,f,s),!0===s.capture?p.result=`(${p.result})`:!1!==s.wrap&&f.length+m.length>1&&(p.result=`(?:${p.result})`),i.cache[u]=p,p.result};function s(e,t,r){if(e===t)return{pattern:e,count:[],digits:0};let n=function(e,t){let r=[];for(let n=0;n1&&i.count.pop(),i.count.push(u.count[0]),i.string=i.pattern+p(i.count),l=t+1)}return a}function a(e,t,r,n,i){let s=[];for(let i of e){let{string:e}=i;n||l(t,"string",e)||s.push(r+e),n&&l(t,"string",e)&&s.push(r+e)}return s}function u(e,t){return e>t?1:t>e?-1:0}function l(e,t,r){return e.some(e=>e[t]===r)}function c(e,t){return Number(String(e).slice(0,-t)+"9".repeat(t))}function h(e,t){return e-e%Math.pow(10,t)}function p(e){let[t=0,r=""]=e;return r||t>1?`{${t+(r?","+r:"")}}`:""}function f(e,t,r){return`[${e}${t-e==1?"":"-"}${t}]`}function d(e){return/^-?(0+)\d/.test(e)}function m(e,t,r){if(!t.isPadded)return e;let n=Math.abs(t.maxLen-String(e).length),i=!1!==r.relaxZeros;switch(n){case 0:return"";case 1:return i?"0?":"0";case 2:return i?"0{0,2}":"00";default:return i?`0{0,${n}}`:`0{${n}}`}}i.cache={},i.clearCache=(()=>i.cache={}),t.exports=i},{"is-number":380}],382:[function(e,t,r){(function(r){e("path");var n=e("fs");function i(){this.types=Object.create(null),this.extensions=Object.create(null)}i.prototype.define=function(e){for(var t in e){for(var n=e[t],i=0;i{for(const r of Reflect.ownKeys(t))Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(t,r));return e};t.exports=n,t.exports.default=n},{}],385:[function(e,t,r){t.exports=d,d.Minimatch=m;var n={sep:"/"};try{n=e("path")}catch(e){}var i=d.GLOBSTAR=m.GLOBSTAR={},s=e("brace-expansion"),o={"!":{open:"(?:(?!(?:",close:"))[^/]*?)"},"?":{open:"(?:",close:")?"},"+":{open:"(?:",close:")+"},"*":{open:"(?:",close:")*"},"@":{open:"(?:",close:")"}},a="[^/]",u=a+"*?",l="(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?",c="(?:(?!(?:\\/|^)\\.).)*?",h="().*{}+?[]^$\\!".split("").reduce(function(e,t){return e[t]=!0,e},{});var p=/\/+/;function f(e,t){e=e||{},t=t||{};var r={};return Object.keys(t).forEach(function(e){r[e]=t[e]}),Object.keys(e).forEach(function(t){r[t]=e[t]}),r}function d(e,t,r){if("string"!=typeof t)throw new TypeError("glob pattern string required");return r||(r={}),!(!r.nocomment&&"#"===t.charAt(0))&&(""===t.trim()?""===e:new m(t,r).match(e))}function m(e,t){if(!(this instanceof m))return new m(e,t);if("string"!=typeof e)throw new TypeError("glob pattern string required");t||(t={}),e=e.trim(),"/"!==n.sep&&(e=e.split(n.sep).join("/")),this.options=t,this.set=[],this.pattern=e,this.regexp=null,this.negate=!1,this.comment=!1,this.empty=!1,this.make()}function g(e,t){if(t||(t=this instanceof m?this.options:{}),void 0===(e=void 0===e?this.pattern:e))throw new TypeError("undefined pattern");return t.nobrace||!e.match(/\{.*\}/)?[e]:s(e)}d.filter=function(e,t){return t=t||{},function(r,n,i){return d(r,e,t)}},d.defaults=function(e){if(!e||!Object.keys(e).length)return d;var t=d,r=function(r,n,i){return t.minimatch(r,n,f(e,i))};return r.Minimatch=function(r,n){return new t.Minimatch(r,f(e,n))},r},m.defaults=function(e){return e&&Object.keys(e).length?d.defaults(e).Minimatch:m},m.prototype.debug=function(){},m.prototype.make=function(){if(this._made)return;var e=this.pattern,t=this.options;if(!t.nocomment&&"#"===e.charAt(0))return void(this.comment=!0);if(!e)return void(this.empty=!0);this.parseNegate();var r=this.globSet=this.braceExpand();t.debug&&(this.debug=console.error);this.debug(this.pattern,r),r=this.globParts=r.map(function(e){return e.split(p)}),this.debug(this.pattern,r),r=r.map(function(e,t,r){return e.map(this.parse,this)},this),this.debug(this.pattern,r),r=r.filter(function(e){return-1===e.indexOf(!1)}),this.debug(this.pattern,r),this.set=r},m.prototype.parseNegate=function(){var e=this.pattern,t=!1,r=0;if(this.options.nonegate)return;for(var n=0,i=e.length;n65536)throw new TypeError("pattern is too long");var r=this.options;if(!r.noglobstar&&"**"===e)return i;if(""===e)return"";var n,s="",l=!!r.nocase,c=!1,p=[],f=[],d=!1,m=-1,g=-1,y="."===e.charAt(0)?"":r.dot?"(?!(?:^|\\/)\\.{1,2}(?:$|\\/))":"(?!\\.)",_=this;function b(){if(n){switch(n){case"*":s+=u,l=!0;break;case"?":s+=a,l=!0;break;default:s+="\\"+n}_.debug("clearStateChar %j %j",n,s),n=!1}}for(var x,w=0,E=e.length;w-1;R--){var O=f[R],L=s.slice(0,O.reStart),P=s.slice(O.reStart,O.reEnd-8),M=s.slice(O.reEnd-8,O.reEnd),B=s.slice(O.reEnd);M+=B;var N=L.split("(").length-1,D=B;for(w=0;w=0&&!(i=e[s]);s--);for(s=0;s>> no match, partial?",e,p,t,f),p!==a))}if("string"==typeof c?(l=n.nocase?h.toLowerCase()===c.toLowerCase():h===c,this.debug("string match",c,h,l)):(l=h.match(c),this.debug("pattern match",c,h,l)),!l)return!1}if(s===a&&o===u)return!0;if(s===a)return r;if(o===u)return s===a-1&&""===e[s];throw new Error("wtf?")}},{"brace-expansion":34,path:397}],386:[function(e,t,r){"use strict";var n=e("cwise-compiler"),i={body:"",args:[],thisVars:[],localVars:[]};function s(e){if(!e)return i;for(var t=0;t>",rrshift:">>>"};!function(){for(var e in a){var t=a[e];r[e]=o({args:["array","array","array"],body:{args:["a","b","c"],body:"a=b"+t+"c"},funcName:e}),r[e+"eq"]=o({args:["array","array"],body:{args:["a","b"],body:"a"+t+"=b"},rvalue:!0,funcName:e+"eq"}),r[e+"s"]=o({args:["array","array","scalar"],body:{args:["a","b","s"],body:"a=b"+t+"s"},funcName:e+"s"}),r[e+"seq"]=o({args:["array","scalar"],body:{args:["a","s"],body:"a"+t+"=s"},rvalue:!0,funcName:e+"seq"})}}();var u={not:"!",bnot:"~",neg:"-",recip:"1.0/"};!function(){for(var e in u){var t=u[e];r[e]=o({args:["array","array"],body:{args:["a","b"],body:"a="+t+"b"},funcName:e}),r[e+"eq"]=o({args:["array"],body:{args:["a"],body:"a="+t+"a"},rvalue:!0,count:2,funcName:e+"eq"})}}();var l={and:"&&",or:"||",eq:"===",neq:"!==",lt:"<",gt:">",leq:"<=",geq:">="};!function(){for(var e in l){var t=l[e];r[e]=o({args:["array","array","array"],body:{args:["a","b","c"],body:"a=b"+t+"c"},funcName:e}),r[e+"s"]=o({args:["array","array","scalar"],body:{args:["a","b","s"],body:"a=b"+t+"s"},funcName:e+"s"}),r[e+"eq"]=o({args:["array","array"],body:{args:["a","b"],body:"a=a"+t+"b"},rvalue:!0,count:2,funcName:e+"eq"}),r[e+"seq"]=o({args:["array","scalar"],body:{args:["a","s"],body:"a=a"+t+"s"},rvalue:!0,count:2,funcName:e+"seq"})}}();var c=["abs","acos","asin","atan","ceil","cos","exp","floor","log","round","sin","sqrt","tan"];!function(){for(var e=0;ethis_s){this_s=-a}else if(a>this_s){this_s=a}",localVars:[],thisVars:["this_s"]},post:{args:[],localVars:[],thisVars:["this_s"],body:"return this_s"},funcName:"norminf"}),r.norm1=n({args:["array"],pre:{args:[],localVars:[],thisVars:["this_s"],body:"this_s=0"},body:{args:[{name:"a",lvalue:!1,rvalue:!0,count:3}],body:"this_s+=a<0?-a:a",localVars:[],thisVars:["this_s"]},post:{args:[],localVars:[],thisVars:["this_s"],body:"return this_s"},funcName:"norm1"}),r.sup=n({args:["array"],pre:{body:"this_h=-Infinity",args:[],thisVars:["this_h"],localVars:[]},body:{body:"if(_inline_1_arg0_>this_h)this_h=_inline_1_arg0_",args:[{name:"_inline_1_arg0_",lvalue:!1,rvalue:!0,count:2}],thisVars:["this_h"],localVars:[]},post:{body:"return this_h",args:[],thisVars:["this_h"],localVars:[]}}),r.inf=n({args:["array"],pre:{body:"this_h=Infinity",args:[],thisVars:["this_h"],localVars:[]},body:{body:"if(_inline_1_arg0_this_v){this_v=_inline_1_arg1_;for(var _inline_1_k=0;_inline_1_k<_inline_1_arg0_.length;++_inline_1_k){this_i[_inline_1_k]=_inline_1_arg0_[_inline_1_k]}}}",args:[{name:"_inline_1_arg0_",lvalue:!1,rvalue:!0,count:2},{name:"_inline_1_arg1_",lvalue:!1,rvalue:!0,count:2}],thisVars:["this_i","this_v"],localVars:["_inline_1_k"]},post:{body:"{return this_i}",args:[],thisVars:["this_i"],localVars:[]}}),r.random=o({args:["array"],pre:{args:[],body:"this_f=Math.random",thisVars:["this_f"]},body:{args:["a"],body:"a=this_f()",thisVars:["this_f"]},funcName:"random"}),r.assign=o({args:["array","array"],body:{args:["a","b"],body:"a=b"},funcName:"assign"}),r.assigns=o({args:["array","scalar"],body:{args:["a","b"],body:"a=b"},funcName:"assigns"}),r.equals=n({args:["array","array"],pre:i,body:{args:[{name:"x",lvalue:!1,rvalue:!0,count:1},{name:"y",lvalue:!1,rvalue:!0,count:1}],body:"if(x!==y){return false}",localVars:[],thisVars:[]},post:{args:[],localVars:[],thisVars:[],body:"return true"},funcName:"equals"})},{"cwise-compiler":48}],387:[function(e,t,r){"use strict";var n=e("ndarray"),i=e("./doConvert.js");t.exports=function(e,t){for(var r=[],s=e,o=1;Array.isArray(s);)r.push(s.length),o*=s.length,s=s[0];return 0===r.length?n():(t||(t=n(new Float64Array(o),r)),i(t,e),t)}},{"./doConvert.js":388,ndarray:389}],388:[function(e,t,r){t.exports=e("cwise-compiler")({args:["array","scalar","index"],pre:{body:"{}",args:[],thisVars:[],localVars:[]},body:{body:"{\nvar _inline_1_v=_inline_1_arg1_,_inline_1_i\nfor(_inline_1_i=0;_inline_1_i<_inline_1_arg2_.length-1;++_inline_1_i) {\n_inline_1_v=_inline_1_v[_inline_1_arg2_[_inline_1_i]]\n}\n_inline_1_arg0_=_inline_1_v[_inline_1_arg2_[_inline_1_arg2_.length-1]]\n}",args:[{name:"_inline_1_arg0_",lvalue:!0,rvalue:!1,count:1},{name:"_inline_1_arg1_",lvalue:!1,rvalue:!0,count:1},{name:"_inline_1_arg2_",lvalue:!1,rvalue:!0,count:4}],thisVars:[],localVars:["_inline_1_i","_inline_1_v"]},post:{body:"{}",args:[],thisVars:[],localVars:[]},funcName:"convert",blockSize:64})},{"cwise-compiler":48}],389:[function(e,t,r){var n=e("iota-array"),i=e("is-buffer"),s="undefined"!=typeof Float64Array;function o(e,t){return e[0]-t[0]}function a(){var e,t=this.stride,r=new Array(t.length);for(e=0;eMath.abs(this.stride[1]))?[1,0]:[0,1]}})"):3===t&&s.push("var s0=Math.abs(this.stride[0]),s1=Math.abs(this.stride[1]),s2=Math.abs(this.stride[2]);if(s0>s1){if(s1>s2){return [2,1,0];}else if(s0>s2){return [1,2,0];}else{return [1,0,2];}}else if(s0>s2){return [2,0,1];}else if(s2>s1){return [0,1,2];}else{return [0,2,1];}}})")):s.push("ORDER})")),s.push("proto.set=function "+r+"_set("+u.join(",")+",v){"),i?s.push("return this.data.set("+c+",v)}"):s.push("return this.data["+c+"]=v}"),s.push("proto.get=function "+r+"_get("+u.join(",")+"){"),i?s.push("return this.data.get("+c+")}"):s.push("return this.data["+c+"]}"),s.push("proto.index=function "+r+"_index(",u.join(),"){return "+c+"}"),s.push("proto.hi=function "+r+"_hi("+u.join(",")+"){return new "+r+"(this.data,"+o.map(function(e){return["(typeof i",e,"!=='number'||i",e,"<0)?this.shape[",e,"]:i",e,"|0"].join("")}).join(",")+","+o.map(function(e){return"this.stride["+e+"]"}).join(",")+",this.offset)}");var f=o.map(function(e){return"a"+e+"=this.shape["+e+"]"}),d=o.map(function(e){return"c"+e+"=this.stride["+e+"]"});s.push("proto.lo=function "+r+"_lo("+u.join(",")+"){var b=this.offset,d=0,"+f.join(",")+","+d.join(","));for(var m=0;m=0){d=i"+m+"|0;b+=c"+m+"*d;a"+m+"-=d}");s.push("return new "+r+"(this.data,"+o.map(function(e){return"a"+e}).join(",")+","+o.map(function(e){return"c"+e}).join(",")+",b)}"),s.push("proto.step=function "+r+"_step("+u.join(",")+"){var "+o.map(function(e){return"a"+e+"=this.shape["+e+"]"}).join(",")+","+o.map(function(e){return"b"+e+"=this.stride["+e+"]"}).join(",")+",c=this.offset,d=0,ceil=Math.ceil");for(m=0;m=0){c=(c+this.stride["+m+"]*i"+m+")|0}else{a.push(this.shape["+m+"]);b.push(this.stride["+m+"])}");return s.push("var ctor=CTOR_LIST[a.length+1];return ctor(this.data,a,b,c)}"),s.push("return function construct_"+r+"(data,shape,stride,offset){return new "+r+"(data,"+o.map(function(e){return"shape["+e+"]"}).join(",")+","+o.map(function(e){return"stride["+e+"]"}).join(",")+",offset)}"),new Function("CTOR_LIST","ORDER",s.join("\n"))(l[e],a)}var l={float32:[],float64:[],int8:[],int16:[],int32:[],uint8:[],uint16:[],uint32:[],array:[],uint8_clamped:[],bigint64:[],biguint64:[],buffer:[],generic:[]};t.exports=function(e,t,r,n){if(void 0===e)return(0,l.array[0])([]);"number"==typeof e&&(e=[e]),void 0===t&&(t=[e.length]);var o=t.length;if(void 0===r){r=new Array(o);for(var a=o-1,c=1;a>=0;--a)r[a]=c,c*=t[a]}if(void 0===n)for(n=0,a=0;a{let t;e=Object.assign({cwd:r.cwd(),path:r.env[i()]},e);let s=n.resolve(e.cwd);const o=[];for(;t!==s;)o.push(n.join(s,"node_modules/.bin")),t=s,s=n.resolve(s,"..");return o.push(n.dirname(r.execPath)),o.concat(e.path).join(n.delimiter)}),t.exports.env=(e=>{e=Object.assign({env:r.env},e);const n=Object.assign({},e.env),s=i({env:n});return e.path=n[s],n[s]=t.exports(e),n})}).call(this,e("_process"))},{_process:452,path:397,"path-key":399}],391:[function(e,t,r){"use strict";function n(e,t,r,n){for(var i=e[t++],s=1<>=u,c-=u,g!==s){if(g===o)break;for(var v=gs;)_=d[_]>>8,++y;var b=_;if(p+y+(v!==g?1:0)>n)return void console.log("Warning, gif stream longer than expected.");r[p++]=b;var x=p+=y;for(v!==g&&(r[p++]=b),_=v;y--;)_=d[_],r[--x]=255&_,_>>=8;null!==m&&a<4096&&(d[a++]=m<<8|b,a>=l+1&&u<12&&(++u,l=l<<1|1)),m=g}else a=o+1,l=(1<<(u=i+1))-1,m=null}return p!==n&&console.log("Warning, gif stream shorter than expected."),r}try{r.GifWriter=function(e,t,r,n){var i=0,s=void 0===(n=void 0===n?{}:n).loop?null:n.loop,o=void 0===n.palette?null:n.palette;if(t<=0||r<=0||t>65535||r>65535)throw new Error("Width/Height invalid.");function a(e){var t=e.length;if(t<2||t>256||t&t-1)throw new Error("Invalid code/color length, must be power of 2 and 2 .. 256.");return t}e[i++]=71,e[i++]=73,e[i++]=70,e[i++]=56,e[i++]=57,e[i++]=97;var u=0,l=0;if(null!==o){for(var c=a(o);c>>=1;)++u;if(c=1<=c)throw new Error("Background index out of range.");if(0===l)throw new Error("Background index explicitly passed as 0.")}}if(e[i++]=255&t,e[i++]=t>>8&255,e[i++]=255&r,e[i++]=r>>8&255,e[i++]=(null!==o?128:0)|u,e[i++]=l,e[i++]=0,null!==o)for(var h=0,p=o.length;h>16&255,e[i++]=f>>8&255,e[i++]=255&f}if(null!==s){if(s<0||s>65535)throw new Error("Loop count invalid.");e[i++]=33,e[i++]=255,e[i++]=11,e[i++]=78,e[i++]=69,e[i++]=84,e[i++]=83,e[i++]=67,e[i++]=65,e[i++]=80,e[i++]=69,e[i++]=50,e[i++]=46,e[i++]=48,e[i++]=3,e[i++]=1,e[i++]=255&s,e[i++]=s>>8&255,e[i++]=0}var d=!1;this.addFrame=function(t,r,n,s,u,l){if(!0===d&&(--i,d=!1),l=void 0===l?{}:l,t<0||r<0||t>65535||r>65535)throw new Error("x/y invalid.");if(n<=0||s<=0||n>65535||s>65535)throw new Error("Width/Height invalid.");if(u.length>=1;)++f;p=1<3)throw new Error("Disposal out of range.");var v=!1,y=0;if(void 0!==l.transparent&&null!==l.transparent&&(v=!0,(y=l.transparent)<0||y>=p))throw new Error("Transparent color index.");if((0!==g||v||0!==m)&&(e[i++]=33,e[i++]=249,e[i++]=4,e[i++]=g<<2|(!0===v?1:0),e[i++]=255&m,e[i++]=m>>8&255,e[i++]=y,e[i++]=0),e[i++]=44,e[i++]=255&t,e[i++]=t>>8&255,e[i++]=255&r,e[i++]=r>>8&255,e[i++]=255&n,e[i++]=n>>8&255,e[i++]=255&s,e[i++]=s>>8&255,e[i++]=!0===c?128|f-1:0,!0===c)for(var _=0,b=h.length;_>16&255,e[i++]=x>>8&255,e[i++]=255&x}return i=function(e,t,r,n){e[t++]=r;var i=t++,s=1<=r;)e[t++]=255&h,h>>=8,c-=8,t===i+256&&(e[i]=255,i=t++)}function f(e){h|=e<=8;)e[t++]=255&h,h>>=8,c-=8,t===i+256&&(e[i]=255,i=t++);4096===u?(f(s),u=a+1,l=r+1,m={}):(u>=1<>7,a=1<<1+(7&s);e[t++],e[t++];var u=null,l=null;o&&(u=t,l=a,t+=3*a);var c=!0,h=[],p=0,f=null,d=0,m=null;for(this.width=r,this.height=i;c&&t=0))throw Error("Invalid block size");if(0===C)break;t+=C}break;case 249:if(4!==e[t++]||0!==e[t+4])throw new Error("Invalid graphics extension block.");var g=e[t++];p=e[t++]|e[t++]<<8,f=e[t++],0==(1&g)&&(f=null),d=g>>2&7,t++;break;case 254:for(;;){if(!((C=e[t++])>=0))throw Error("Invalid block size");if(0===C)break;t+=C}break;default:throw new Error("Unknown graphic control label: 0x"+e[t-1].toString(16))}break;case 44:var v=e[t++]|e[t++]<<8,y=e[t++]|e[t++]<<8,_=e[t++]|e[t++]<<8,b=e[t++]|e[t++]<<8,x=e[t++],w=x>>6&1,E=1<<1+(7&x),T=u,A=l,S=!1;x>>7&&(S=!0,T=t,A=E,t+=3*E);var k=t;for(t++;;){var C;if(!((C=e[t++])>=0))throw Error("Invalid block size");if(0===C)break;t+=C}h.push({x:v,y:y,width:_,height:b,has_local_palette:S,palette_offset:T,palette_size:A,data_offset:k,data_length:t-k,transparent_index:f,interlaced:!!w,delay:p,disposal:d});break;case 59:c=!1;break;default:throw new Error("Unknown gif block: 0x"+e[t-1].toString(16))}this.numFrames=function(){return h.length},this.loopCount=function(){return m},this.frameInfo=function(e){if(e<0||e>=h.length)throw new Error("Frame index out of range.");return h[e]},this.decodeAndBlitFrameBGRA=function(t,i){var s=this.frameInfo(t),o=s.width*s.height,a=new Uint8Array(o);n(e,s.data_offset,a,o);var u=s.palette_offset,l=s.transparent_index;null===l&&(l=256);var c=s.width,h=r-c,p=c,f=4*(s.y*r+s.x),d=4*((s.y+s.height)*r+s.x),m=f,g=4*h;!0===s.interlaced&&(g+=4*r*7);for(var v=8,y=0,_=a.length;y<_;++y){var b=a[y];if(0===p&&(p=c,(m+=g)>=d&&(g=4*h+4*r*(v-1),m=f+(c+h)*(v<<1),v>>=1)),b===l)m+=4;else{var x=e[u+3*b],w=e[u+3*b+1],E=e[u+3*b+2];i[m++]=E,i[m++]=w,i[m++]=x,i[m++]=255}--p}},this.decodeAndBlitFrameRGBA=function(t,i){var s=this.frameInfo(t),o=s.width*s.height,a=new Uint8Array(o);n(e,s.data_offset,a,o);var u=s.palette_offset,l=s.transparent_index;null===l&&(l=256);var c=s.width,h=r-c,p=c,f=4*(s.y*r+s.x),d=4*((s.y+s.height)*r+s.x),m=f,g=4*h;!0===s.interlaced&&(g+=4*r*7);for(var v=8,y=0,_=a.length;y<_;++y){var b=a[y];if(0===p&&(p=c,(m+=g)>=d&&(g=4*h+4*r*(v-1),m=f+(c+h)*(v<<1),v>>=1)),b===l)m+=4;else{var x=e[u+3*b],w=e[u+3*b+1],E=e[u+3*b+2];i[m++]=x,i[m++]=w,i[m++]=E,i[m++]=255}--p}}}}catch(e){}},{}],392:[function(e,t,r){var n=e("wrappy");function i(e){var t=function(){return t.called?t.value:(t.called=!0,t.value=e.apply(this,arguments))};return t.called=!1,t}function s(e){var t=function(){if(t.called)throw new Error(t.onceError);return t.called=!0,t.value=e.apply(this,arguments)},r=e.name||"Function wrapped with `once`";return t.onceError=r+" shouldn't be called more than once",t.called=!1,t}t.exports=n(i),t.exports.strict=n(s),i.proto=i(function(){Object.defineProperty(Function.prototype,"once",{value:function(){return i(this)},configurable:!0}),Object.defineProperty(Function.prototype,"onceStrict",{value:function(){return s(this)},configurable:!0})})},{wrappy:546}],393:[function(e,t,r){"use strict";const n=e("mimic-fn"),i=new WeakMap,s=(e,t={})=>{if("function"!=typeof e)throw new TypeError("Expected a function");let r,s=0;const o=e.displayName||e.name||"",a=function(...n){if(i.set(a,++s),1===s)r=e.apply(this,n),e=null;else if(!0===t.throw)throw new Error(`Function \`${o}\` can only be called once`);return r};return n(a,e),i.set(a,s),a};t.exports=s,t.exports.default=s,t.exports.callCount=(e=>{if(!i.has(e))throw new Error(`The given function \`${e.name}\` is not wrapped by the \`onetime\` package`);return i.get(e)})},{"mimic-fn":384}],394:[function(e,t,r){(function(r,n){t.exports=function(e){var t={};function r(n){if(t[n])return t[n].exports;var i=t[n]={i:n,l:!1,exports:{}};return e[n].call(i.exports,i,i.exports,r),i.l=!0,i.exports}return r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)r.d(n,i,function(t){return e[t]}.bind(null,i));return n},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=4)}([function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(1),i=r(6),s=r(15),o=r(2);t.validatorSymbol=Symbol("validators"),t.Predicate=class{constructor(e,t={}){this.type=e,this.options=t,this.context={validators:[]},this.context={...this.context,...this.options};const r=this.type[0].toLowerCase()+this.type.slice(1);this.addValidator({message:(e,t)=>`Expected ${(null==t?void 0:t.slice(this.type.length+1))||"argument"} to be of type \`${this.type}\` but received type \`${n.default(e)}\``,validator:e=>n.default[r](e)})}[o.testSymbol](e,t,r){for(const{validator:n,message:s}of this.context.validators){if(!0===this.options.optional&&void 0===e)continue;const o=n(e);if(!0===o)continue;let a=r;throw"function"==typeof r&&(a=r()),a=a?`${this.type} \`${a}\``:this.type,new i.ArgumentError(s(e,a,o),t)}}get[t.validatorSymbol](){return this.context.validators}get not(){return s.not(this)}validate(e){return this.addValidator({message:(e,t,r)=>"string"==typeof r?`(${t}) ${r}`:r(t),validator:t=>{const{message:r,validator:n}=e(t);return!!n||r}})}is(e){return this.addValidator({message:(e,t,r)=>r?`(${t}) ${r}`:`Expected ${t} \`${e}\` to pass custom validation function`,validator:e})}addValidator(e){return this.context.validators.push(e),this}}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const{toString:n}=Object.prototype,i=e=>t=>typeof t===e,s=e=>{const t=n.call(e).slice(8,-1);if(t)return t},o=e=>t=>s(t)===e;function a(e){switch(e){case null:return"null";case!0:case!1:return"boolean"}switch(typeof e){case"undefined":return"undefined";case"string":return"string";case"number":return"number";case"bigint":return"bigint";case"symbol":return"symbol"}if(a.function_(e))return"Function";if(a.observable(e))return"Observable";if(a.array(e))return"Array";if(a.buffer(e))return"Buffer";const t=s(e);if(t)return t;if(e instanceof String||e instanceof Boolean||e instanceof Number)throw new TypeError("Please don't use object wrappers for primitive types");return"Object"}a.undefined=i("undefined"),a.string=i("string");const u=i("number");a.number=(e=>u(e)&&!a.nan(e)),a.bigint=i("bigint"),a.function_=i("function"),a.null_=(e=>null===e),a.class_=(e=>a.function_(e)&&e.toString().startsWith("class ")),a.boolean=(e=>!0===e||!1===e),a.symbol=i("symbol"),a.numericString=(e=>a.string(e)&&e.length>0&&!Number.isNaN(Number(e))),a.array=Array.isArray,a.buffer=(e=>!a.nullOrUndefined(e)&&!a.nullOrUndefined(e.constructor)&&a.function_(e.constructor.isBuffer)&&e.constructor.isBuffer(e)),a.nullOrUndefined=(e=>a.null_(e)||a.undefined(e)),a.object=(e=>!a.null_(e)&&("object"==typeof e||a.function_(e))),a.iterable=(e=>!a.nullOrUndefined(e)&&a.function_(e[Symbol.iterator])),a.asyncIterable=(e=>!a.nullOrUndefined(e)&&a.function_(e[Symbol.asyncIterator])),a.generator=(e=>a.iterable(e)&&a.function_(e.next)&&a.function_(e.throw)),a.asyncGenerator=(e=>a.asyncIterable(e)&&a.function_(e.next)&&a.function_(e.throw)),a.nativePromise=(e=>o("Promise")(e)),a.promise=(e=>a.nativePromise(e)||(e=>a.object(e)&&a.function_(e.then)&&a.function_(e.catch))(e)),a.generatorFunction=o("GeneratorFunction"),a.asyncGeneratorFunction=(e=>"AsyncGeneratorFunction"===s(e)),a.asyncFunction=(e=>"AsyncFunction"===s(e)),a.boundFunction=(e=>a.function_(e)&&!e.hasOwnProperty("prototype")),a.regExp=o("RegExp"),a.date=o("Date"),a.error=o("Error"),a.map=(e=>o("Map")(e)),a.set=(e=>o("Set")(e)),a.weakMap=(e=>o("WeakMap")(e)),a.weakSet=(e=>o("WeakSet")(e)),a.int8Array=o("Int8Array"),a.uint8Array=o("Uint8Array"),a.uint8ClampedArray=o("Uint8ClampedArray"),a.int16Array=o("Int16Array"),a.uint16Array=o("Uint16Array"),a.int32Array=o("Int32Array"),a.uint32Array=o("Uint32Array"),a.float32Array=o("Float32Array"),a.float64Array=o("Float64Array"),a.bigInt64Array=o("BigInt64Array"),a.bigUint64Array=o("BigUint64Array"),a.arrayBuffer=o("ArrayBuffer"),a.sharedArrayBuffer=o("SharedArrayBuffer"),a.dataView=o("DataView"),a.directInstanceOf=((e,t)=>Object.getPrototypeOf(e)===t.prototype),a.urlInstance=(e=>o("URL")(e)),a.urlString=(e=>{if(!a.string(e))return!1;try{return new URL(e),!0}catch(e){return!1}}),a.truthy=(e=>Boolean(e)),a.falsy=(e=>!e),a.nan=(e=>Number.isNaN(e));const l=new Set(["undefined","string","number","bigint","boolean","symbol"]);a.primitive=(e=>a.null_(e)||l.has(typeof e)),a.integer=(e=>Number.isInteger(e)),a.safeInteger=(e=>Number.isSafeInteger(e)),a.plainObject=(e=>{if("Object"!==s(e))return!1;const t=Object.getPrototypeOf(e);return null===t||t===Object.getPrototypeOf({})});const c=new Set(["Int8Array","Uint8Array","Uint8ClampedArray","Int16Array","Uint16Array","Int32Array","Uint32Array","Float32Array","Float64Array","BigInt64Array","BigUint64Array"]);a.typedArray=(e=>{const t=s(e);return void 0!==t&&c.has(t)}),a.arrayLike=(e=>!a.nullOrUndefined(e)&&!a.function_(e)&&(e=>a.safeInteger(e)&&e>=0)(e.length)),a.inRange=((e,t)=>{if(a.number(t))return e>=Math.min(0,t)&&e<=Math.max(t,0);if(a.array(t)&&2===t.length)return e>=Math.min(...t)&&e<=Math.max(...t);throw new TypeError(`Invalid range: ${JSON.stringify(t)}`)});const h=["innerHTML","ownerDocument","style","attributes","nodeValue"];a.domElement=(e=>a.object(e)&&1===e.nodeType&&a.string(e.nodeName)&&!a.plainObject(e)&&h.every(t=>t in e)),a.observable=(e=>!!(e&&(e[Symbol.observable]&&e===e[Symbol.observable]()||e["@@observable"]&&e===e["@@observable"]()))),a.nodeStream=(e=>a.object(e)&&a.function_(e.pipe)&&!a.observable(e)),a.infinite=(e=>e===1/0||e===-1/0);const p=e=>t=>a.integer(t)&&Math.abs(t%2)===e;a.evenInteger=p(0),a.oddInteger=p(1),a.emptyArray=(e=>a.array(e)&&0===e.length),a.nonEmptyArray=(e=>a.array(e)&&e.length>0),a.emptyString=(e=>a.string(e)&&0===e.length),a.nonEmptyString=(e=>a.string(e)&&e.length>0),a.emptyStringOrWhitespace=(e=>a.emptyString(e)||(e=>a.string(e)&&!1===/\S/.test(e))(e)),a.emptyObject=(e=>a.object(e)&&!a.map(e)&&!a.set(e)&&0===Object.keys(e).length),a.nonEmptyObject=(e=>a.object(e)&&!a.map(e)&&!a.set(e)&&Object.keys(e).length>0),a.emptySet=(e=>a.set(e)&&0===e.size),a.nonEmptySet=(e=>a.set(e)&&e.size>0),a.emptyMap=(e=>a.map(e)&&0===e.size),a.nonEmptyMap=(e=>a.map(e)&&e.size>0);const f=(e,t,r)=>{if(!1===a.function_(t))throw new TypeError(`Invalid predicate: ${JSON.stringify(t)}`);if(0===r.length)throw new TypeError("Invalid number of values");return e.call(r,t)};a.any=((e,...t)=>(a.array(e)?e:[e]).some(e=>f(Array.prototype.some,e,t))),a.all=((e,...t)=>f(Array.prototype.every,e,t));const d=(e,t,r)=>{if(!e)throw new TypeError(`Expected value which is \`${t}\`, received value of type \`${a(r)}\`.`)};t.assert={undefined:e=>d(a.undefined(e),"undefined",e),string:e=>d(a.string(e),"string",e),number:e=>d(a.number(e),"number",e),bigint:e=>d(a.bigint(e),"bigint",e),function_:e=>d(a.function_(e),"Function",e),null_:e=>d(a.null_(e),"null",e),class_:e=>d(a.class_(e),"Class",e),boolean:e=>d(a.boolean(e),"boolean",e),symbol:e=>d(a.symbol(e),"symbol",e),numericString:e=>d(a.numericString(e),"string with a number",e),array:e=>d(a.array(e),"Array",e),buffer:e=>d(a.buffer(e),"Buffer",e),nullOrUndefined:e=>d(a.nullOrUndefined(e),"null or undefined",e),object:e=>d(a.object(e),"Object",e),iterable:e=>d(a.iterable(e),"Iterable",e),asyncIterable:e=>d(a.asyncIterable(e),"AsyncIterable",e),generator:e=>d(a.generator(e),"Generator",e),asyncGenerator:e=>d(a.asyncGenerator(e),"AsyncGenerator",e),nativePromise:e=>d(a.nativePromise(e),"native Promise",e),promise:e=>d(a.promise(e),"Promise",e),generatorFunction:e=>d(a.generatorFunction(e),"GeneratorFunction",e),asyncGeneratorFunction:e=>d(a.asyncGeneratorFunction(e),"AsyncGeneratorFunction",e),asyncFunction:e=>d(a.asyncFunction(e),"AsyncFunction",e),boundFunction:e=>d(a.boundFunction(e),"Function",e),regExp:e=>d(a.regExp(e),"RegExp",e),date:e=>d(a.date(e),"Date",e),error:e=>d(a.error(e),"Error",e),map:e=>d(a.map(e),"Map",e),set:e=>d(a.set(e),"Set",e),weakMap:e=>d(a.weakMap(e),"WeakMap",e),weakSet:e=>d(a.weakSet(e),"WeakSet",e),int8Array:e=>d(a.int8Array(e),"Int8Array",e),uint8Array:e=>d(a.uint8Array(e),"Uint8Array",e),uint8ClampedArray:e=>d(a.uint8ClampedArray(e),"Uint8ClampedArray",e),int16Array:e=>d(a.int16Array(e),"Int16Array",e),uint16Array:e=>d(a.uint16Array(e),"Uint16Array",e),int32Array:e=>d(a.int32Array(e),"Int32Array",e),uint32Array:e=>d(a.uint32Array(e),"Uint32Array",e),float32Array:e=>d(a.float32Array(e),"Float32Array",e),float64Array:e=>d(a.float64Array(e),"Float64Array",e),bigInt64Array:e=>d(a.bigInt64Array(e),"BigInt64Array",e),bigUint64Array:e=>d(a.bigUint64Array(e),"BigUint64Array",e),arrayBuffer:e=>d(a.arrayBuffer(e),"ArrayBuffer",e),sharedArrayBuffer:e=>d(a.sharedArrayBuffer(e),"SharedArrayBuffer",e),dataView:e=>d(a.dataView(e),"DataView",e),urlInstance:e=>d(a.urlInstance(e),"URL",e),urlString:e=>d(a.urlString(e),"string with a URL",e),truthy:e=>d(a.truthy(e),"truthy",e),falsy:e=>d(a.falsy(e),"falsy",e),nan:e=>d(a.nan(e),"NaN",e),primitive:e=>d(a.primitive(e),"primitive",e),integer:e=>d(a.integer(e),"integer",e),safeInteger:e=>d(a.safeInteger(e),"integer",e),plainObject:e=>d(a.plainObject(e),"plain object",e),typedArray:e=>d(a.typedArray(e),"TypedArray",e),arrayLike:e=>d(a.arrayLike(e),"array-like",e),domElement:e=>d(a.domElement(e),"Element",e),observable:e=>d(a.observable(e),"Observable",e),nodeStream:e=>d(a.nodeStream(e),"Node.js Stream",e),infinite:e=>d(a.infinite(e),"infinite number",e),emptyArray:e=>d(a.emptyArray(e),"empty array",e),nonEmptyArray:e=>d(a.nonEmptyArray(e),"non-empty array",e),emptyString:e=>d(a.emptyString(e),"empty string",e),nonEmptyString:e=>d(a.nonEmptyString(e),"non-empty string",e),emptyStringOrWhitespace:e=>d(a.emptyStringOrWhitespace(e),"empty string or whitespace",e),emptyObject:e=>d(a.emptyObject(e),"empty object",e),nonEmptyObject:e=>d(a.nonEmptyObject(e),"non-empty object",e),emptySet:e=>d(a.emptySet(e),"empty set",e),nonEmptySet:e=>d(a.nonEmptySet(e),"non-empty set",e),emptyMap:e=>d(a.emptyMap(e),"empty map",e),nonEmptyMap:e=>d(a.nonEmptyMap(e),"non-empty map",e),evenInteger:e=>d(a.evenInteger(e),"even integer",e),oddInteger:e=>d(a.oddInteger(e),"odd integer",e),directInstanceOf:(e,t)=>d(a.directInstanceOf(e,t),"T",e),inRange:(e,t)=>d(a.inRange(e,t),"in range",e),any:(e,...t)=>d(a.any(e,...t),"predicate returns truthy for any value",t),all:(e,...t)=>d(a.all(e,...t),"predicate returns truthy for all values",t)},Object.defineProperties(a,{class:{value:a.class_},function:{value:a.function_},null:{value:a.null_}}),Object.defineProperties(t.assert,{class:{value:t.assert.class_},function:{value:t.assert.function_},null:{value:t.assert.null_}}),t.default=a,e.exports=a,e.exports.default=a,e.exports.assert=t.assert},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.testSymbol=Symbol("test"),t.isPredicate=(e=>Boolean(e[t.testSymbol]))},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=((e,t,r=5)=>{const n=[];for(const i of t)if(!e.has(i)&&(n.push(i),n.length===r))return n;return 0===n.length||n})},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(10),i=r(11),s=r(0);t.Predicate=s.Predicate;const o=r(2),a=r(17),u=r(7),l=r(9),c=(e,t,r)=>{if(!o.isPredicate(t)&&"string"!=typeof t)throw new TypeError(`Expected second argument to be a predicate or a string, got \`${typeof t}\``);if(o.isPredicate(t)){const r=n.default();l.default(e,()=>i.inferLabel(r),t)}else l.default(e,t,r)};Object.defineProperties(c,{isValid:{value:(e,t)=>{try{return c(e,t),!0}catch(e){return!1}}},create:{value:(e,t)=>(r,s)=>{if(o.isPredicate(e)){const t=n.default();l.default(r,null!=s?s:()=>i.inferLabel(t),e)}else l.default(r,null!=s?s:e,t)}}}),t.default=u.default(a.default(c));var h=r(7);t.StringPredicate=h.StringPredicate,t.NumberPredicate=h.NumberPredicate,t.BooleanPredicate=h.BooleanPredicate,t.ArrayPredicate=h.ArrayPredicate,t.ObjectPredicate=h.ObjectPredicate,t.DatePredicate=h.DatePredicate,t.ErrorPredicate=h.ErrorPredicate,t.MapPredicate=h.MapPredicate,t.WeakMapPredicate=h.WeakMapPredicate,t.SetPredicate=h.SetPredicate,t.WeakSetPredicate=h.WeakSetPredicate,t.TypedArrayPredicate=h.TypedArrayPredicate,t.ArrayBufferPredicate=h.ArrayBufferPredicate,t.DataViewPredicate=h.DataViewPredicate,t.AnyPredicate=h.AnyPredicate;var p=r(6);t.ArgumentError=p.ArgumentError},function(e,t,r){(function(e){var r="[object Arguments]",i="[object Map]",s="[object Object]",o="[object Set]",a=/^\[object .+?Constructor\]$/,u=/^(?:0|[1-9]\d*)$/,l={};l["[object Float32Array]"]=l["[object Float64Array]"]=l["[object Int8Array]"]=l["[object Int16Array]"]=l["[object Int32Array]"]=l["[object Uint8Array]"]=l["[object Uint8ClampedArray]"]=l["[object Uint16Array]"]=l["[object Uint32Array]"]=!0,l[r]=l["[object Array]"]=l["[object ArrayBuffer]"]=l["[object Boolean]"]=l["[object DataView]"]=l["[object Date]"]=l["[object Error]"]=l["[object Function]"]=l[i]=l["[object Number]"]=l[s]=l["[object RegExp]"]=l[o]=l["[object String]"]=l["[object WeakMap]"]=!1;var c="object"==typeof n&&n&&n.Object===Object&&n,h="object"==typeof self&&self&&self.Object===Object&&self,p=c||h||Function("return this")(),f=t&&!t.nodeType&&t,d=f&&"object"==typeof e&&e&&!e.nodeType&&e,m=d&&d.exports===f,g=m&&c.process,v=function(){try{return g&&g.binding&&g.binding("util")}catch(e){}}(),y=v&&v.isTypedArray;function _(e,t){for(var r=-1,n=null==e?0:e.length;++ra))return!1;var l=s.get(e);if(l&&s.get(t))return l==t;var c=-1,h=!0,p=2&r?new se:void 0;for(s.set(e,t),s.set(t,e);++c-1},ne.prototype.set=function(e,t){var r=this.__data__,n=ae(r,e);return n<0?(++this.size,r.push([e,t])):r[n][1]=t,this},ie.prototype.clear=function(){this.size=0,this.__data__={hash:new re,map:new(z||ne),string:new re}},ie.prototype.delete=function(e){var t=fe(this,e).delete(e);return this.size-=t?1:0,t},ie.prototype.get=function(e){return fe(this,e).get(e)},ie.prototype.has=function(e){return fe(this,e).has(e)},ie.prototype.set=function(e,t){var r=fe(this,e),n=r.size;return r.set(e,t),this.size+=r.size==n?0:1,this},se.prototype.add=se.prototype.push=function(e){return this.__data__.set(e,"__lodash_hash_undefined__"),this},se.prototype.has=function(e){return this.__data__.has(e)},oe.prototype.clear=function(){this.__data__=new ne,this.size=0},oe.prototype.delete=function(e){var t=this.__data__,r=t.delete(e);return this.size=t.size,r},oe.prototype.get=function(e){return this.__data__.get(e)},oe.prototype.has=function(e){return this.__data__.has(e)},oe.prototype.set=function(e,t){var r=this.__data__;if(r instanceof ne){var n=r.__data__;if(!z||n.length<199)return n.push([e,t]),this.size=++r.size,this;r=this.__data__=new ie(n)}return r.set(e,t),this.size=r.size,this};var me=U?function(e){return null==e?[]:(e=Object(e),function(e,t){for(var r=-1,n=null==e?0:e.length,i=0,s=[];++r-1&&e%1==0&&e-1&&e%1==0&&e<=9007199254740991}function Ae(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}function Se(e){return null!=e&&"object"==typeof e}var ke=y?function(e){return function(t){return e(t)}}(y):function(e){return Se(e)&&Te(e.length)&&!!l[ue(e)]};function Ce(e){return null!=(t=e)&&Te(t.length)&&!Ee(t)?function(e,t){var r=xe(e),n=!r&&be(e),i=!r&&!n&&we(e),s=!r&&!n&&!i&&ke(e),o=r||n||i||s,a=o?function(e,t){for(var r=-1,n=Array(e);++r(Object.defineProperties(e,{string:{get:()=>new n.StringPredicate(t)},number:{get:()=>new i.NumberPredicate(t)},boolean:{get:()=>new s.BooleanPredicate(t)},undefined:{get:()=>new o.Predicate("undefined",t)},null:{get:()=>new o.Predicate("null",t)},nullOrUndefined:{get:()=>new o.Predicate("nullOrUndefined",t)},nan:{get:()=>new o.Predicate("nan",t)},symbol:{get:()=>new o.Predicate("symbol",t)},array:{get:()=>new a.ArrayPredicate(t)},object:{get:()=>new u.ObjectPredicate(t)},date:{get:()=>new l.DatePredicate(t)},error:{get:()=>new c.ErrorPredicate(t)},map:{get:()=>new h.MapPredicate(t)},weakMap:{get:()=>new p.WeakMapPredicate(t)},set:{get:()=>new f.SetPredicate(t)},weakSet:{get:()=>new d.WeakSetPredicate(t)},function:{get:()=>new o.Predicate("Function",t)},buffer:{get:()=>new o.Predicate("Buffer",t)},regExp:{get:()=>new o.Predicate("RegExp",t)},promise:{get:()=>new o.Predicate("Promise",t)},typedArray:{get:()=>new m.TypedArrayPredicate("TypedArray",t)},int8Array:{get:()=>new m.TypedArrayPredicate("Int8Array",t)},uint8Array:{get:()=>new m.TypedArrayPredicate("Uint8Array",t)},uint8ClampedArray:{get:()=>new m.TypedArrayPredicate("Uint8ClampedArray",t)},int16Array:{get:()=>new m.TypedArrayPredicate("Int16Array",t)},uint16Array:{get:()=>new m.TypedArrayPredicate("Uint16Array",t)},int32Array:{get:()=>new m.TypedArrayPredicate("Int32Array",t)},uint32Array:{get:()=>new m.TypedArrayPredicate("Uint32Array",t)},float32Array:{get:()=>new m.TypedArrayPredicate("Float32Array",t)},float64Array:{get:()=>new m.TypedArrayPredicate("Float64Array",t)},arrayBuffer:{get:()=>new g.ArrayBufferPredicate("ArrayBuffer",t)},sharedArrayBuffer:{get:()=>new g.ArrayBufferPredicate("SharedArrayBuffer",t)},dataView:{get:()=>new v.DataViewPredicate(t)},iterable:{get:()=>new o.Predicate("Iterable",t)},any:{value:(...e)=>new y.AnyPredicate(e,t)}}),e))},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(4);t.default=((e,t)=>{try{for(const r of e)n.default(r,t);return!0}catch(e){return e.message}})},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(2);t.default=function e(t,r,i){i[n.testSymbol](t,e,r)}},function(e,t,r){"use strict";const n=()=>{const e=Error.prepareStackTrace;Error.prepareStackTrace=((e,t)=>t);const t=(new Error).stack.slice(1);return Error.prepareStackTrace=e,t};e.exports=n,e.exports.default=n},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(12),i=r(13),s=r(14),o=/^.*?\((?