From 8c47bde9babb21086049c9d4c3f70c87d1f26c1d Mon Sep 17 00:00:00 2001 From: jywarren Date: Sat, 15 Jun 2019 14:44:49 -0400 Subject: [PATCH] built --- dist/image-sequencer-ui.js | 102 ++-- dist/image-sequencer-ui.min.js | 2 +- dist/image-sequencer.js | 1008 +++++++++++++++++++------------- dist/image-sequencer.min.js | 2 +- 4 files changed, 648 insertions(+), 466 deletions(-) diff --git a/dist/image-sequencer-ui.js b/dist/image-sequencer-ui.js index 22bc5e69..7a220bff 100644 --- a/dist/image-sequencer-ui.js +++ b/dist/image-sequencer-ui.js @@ -47,7 +47,7 @@ window.onload = function() { $(':root').animate({scrollTop: 0}); } - $('#move-up').on('click',topFunction); + $('#move-up').on('click', topFunction); // UI for each step: @@ -64,14 +64,14 @@ window.onload = function() { } var resetSequence = function(){ - var r=confirm('Do you want to reset the sequence?'); + var r = confirm('Do you want to reset the sequence?'); if (r) window.location = '/'; }; $('#addStep select').on('change', ui.selectNewStepUi); $('#addStep #add-step-btn').on('click', ui.addStepUi); - $('#resetButton').on('click',resetSequence); + $('#resetButton').on('click', resetSequence); //Module button radio selection $('.radio-group .radio').on('click', function() { @@ -85,11 +85,6 @@ window.onload = function() { $(this).removeClass('selected'); }); - $('#download-btn').click(function() { - $('.step-thumbnail:last()').trigger('click'); - return false; - }); - function displayMessageOnSaveSequence(){ $('.savesequencemsg').fadeIn(); setTimeout(function() { @@ -119,7 +114,7 @@ window.onload = function() { var button = event.target; button.disabled = true; - button.innerHTML=''; + button.innerHTML = ''; try { // Select all images from previous steps @@ -193,35 +188,35 @@ window.onload = function() { onLoad: function onFileReaderLoad(progress) { var reader = progress.target; var step = sequencer.steps[0]; - var util= intermediateHtmlStepUi(sequencer); + var util = intermediateHtmlStepUi(sequencer); step.output.src = reader.result; sequencer.run({ index: 0 }); - if(typeof step.options !=='undefined') + if(typeof step.options !== 'undefined') step.options.step.imgElement.src = reader.result; else step.imgElement.src = reader.result; - insertPreview.updatePreviews(reader.result,'#addStep'); - insertPreview.updatePreviews(sequencer.steps[0].imgElement.src,'.insertDiv'); + insertPreview.updatePreviews(reader.result, '#addStep'); + insertPreview.updatePreviews(sequencer.steps[0].imgElement.src, '.insertDiv'); }, onTakePhoto: function (url) { var step = sequencer.steps[0]; step.output.src = url; sequencer.run({ index: 0 }); - if(typeof step.options !=='undefined') + if(typeof step.options !== 'undefined') step.options.step.imgElement.src = url; else step.imgElement.src = url; - insertPreview.updatePreviews(url,'#addStep'); - insertPreview.updatePreviews(sequencer.steps[0].imgElement.src,'.insertDiv'); + insertPreview.updatePreviews(url, '#addStep'); + insertPreview.updatePreviews(sequencer.steps[0].imgElement.src, '.insertDiv'); } }); setupCache(); if (urlHash.getUrlHashParameter('src')) { - insertPreview.updatePreviews(urlHash.getUrlHashParameter('src'),'#addStep'); + insertPreview.updatePreviews(urlHash.getUrlHashParameter('src'), '#addStep'); } else { - insertPreview.updatePreviews('images/tulips.png','#addStep'); + insertPreview.updatePreviews('images/tulips.png', '#addStep'); } }; @@ -277,7 +272,7 @@ function DefaultHtmlSequencerUi(_sequencer, options) { function onLoad() { importStepsFromUrlHash(); - if ($('#selectStep').val()==='none') + if ($('#selectStep').val() === 'none') $(addStepSel + ' #add-step-btn').prop('disabled', true); handleSaveSequence(); } @@ -342,8 +337,8 @@ function DefaultHtmlSequencerUi(_sequencer, options) { } function handleSaveSequence(){ - var stepCount=sequencer.steps.length; - if(stepCount<2) + var stepCount = sequencer.steps.length; + if(stepCount < 2) $(' #save-seq').prop('disabled', true); else $(' #save-seq').prop('disabled', false); @@ -393,8 +388,8 @@ function DefaultHtmlStepUi(_sequencer, options) {
\
\
\ -

' + - '' +step.name + ' \ +

' + + '' + step.name + ' \ \

\

\ @@ -470,7 +465,7 @@ function DefaultHtmlStepUi(_sequencer, options) { '"max="' + inputDesc.max + '"step="' + - (inputDesc.step ? inputDesc.step : 1)+ '">' + '' + paramVal + ''; + (inputDesc.step ? inputDesc.step : 1) + '">' + '' + paramVal + ''; } else html += '">'; @@ -498,9 +493,11 @@ function DefaultHtmlStepUi(_sequencer, options) { ); $(step.ui.querySelector('div.panel-footer')).prepend( '\ + ' - ); + ); } if (step.name != 'load-image') { @@ -509,14 +506,14 @@ function DefaultHtmlStepUi(_sequencer, options) { .prepend( parser.parseFromString(tools, 'text/html').querySelector('div') ); - $(step.ui.querySelectorAll('.remove')).on('click', function() {notify('Step Removed','remove-notification');}); - $(step.ui.querySelectorAll('.insert-step')).on('click', function() { util.insertStep(step.ID); }); + $(step.ui.querySelectorAll('.remove')).on('click', function() {notify('Step Removed', 'remove-notification');}); + $(step.ui.querySelectorAll('.insert-step')).on('click', function() { util.insertStep(step.ID); }); // Insert the step's UI in the right place if (stepOptions.index == _sequencer.steps.length) { stepsEl.appendChild(step.ui); - $('#steps .step-container:nth-last-child(1) .insert-step').prop('disabled',true); + $('#steps .step-container:nth-last-child(1) .insert-step').prop('disabled', true); if($('#steps .step-container:nth-last-child(2)')) - $('#steps .step-container:nth-last-child(2) .insert-step').prop('disabled',false); + $('#steps .step-container:nth-last-child(2) .insert-step').prop('disabled', false); } else { stepsEl.insertBefore(step.ui, $(stepsEl).children()[stepOptions.index]); } @@ -530,6 +527,7 @@ function DefaultHtmlStepUi(_sequencer, options) { }); $(step.imgElement).on('mousemove', _.debounce(() => imageHover(step), 150)); + $(step.imgElement).on('click', (e) => {e.preventDefault(); }); function saveOptions(e) { e.preventDefault(); @@ -562,7 +560,7 @@ function DefaultHtmlStepUi(_sequencer, options) { return inputChanged; } - var + var changedInputs = 0, optionsChanged = false; $(step.ui.querySelector('.input-form')).on('submit', saveOptions); @@ -570,7 +568,7 @@ function DefaultHtmlStepUi(_sequencer, options) { $(input) .data('initValue', $(input).val()) .data('hasChangedBefore', false) - .on('input change' , function() { + .on('input change', function() { $(this) .focus() .data('hasChangedBefore', @@ -614,11 +612,21 @@ function DefaultHtmlStepUi(_sequencer, options) { return output.split('/')[1].split(';')[0]; } - for (let index = 0; index < step.linkElements.length; index++) { + $(step.ui.querySelectorAll('.download-btn')).on('click', () => { - step.linkElements[index].download = step.name + '.' + fileExtension(step.imgElement.src); - step.linkElements[index].target = '_blank'; - } + for (let index = 0; index < step.linkElements.length; index++){ + + var element = document.createElement('a'); + element.setAttribute('href', step.linkElements[index].href); + element.setAttribute('download', step.name + '.' + fileExtension(step.imgElement.src)); + element.style.display = 'none'; + document.body.appendChild(element); + + element.click(); + + document.body.removeChild(element); + } + }); // fill inputs with stored step options if (_sequencer.modulesInfo().hasOwnProperty(step.name)) { @@ -648,24 +656,24 @@ function DefaultHtmlStepUi(_sequencer, options) { var img = $(step.imgElement); - img.mousemove(function(e) { + img.mousemove(function(e) { var canvas = document.createElement('canvas'); canvas.width = img.width(); canvas.height = img.height(); var context = canvas.getContext('2d'); - context.drawImage(this,0,0); + context.drawImage(this, 0, 0); var offset = $(this).offset(); var xPos = e.pageX - offset.left; var yPos = e.pageY - offset.top; var myData = context.getImageData(xPos, yPos, 1, 1); - img[0].title = 'rgb: ' +myData.data[0]+','+ myData.data[1]+','+myData.data[2];//+ rgbdata; - }); + img[0].title = 'rgb: ' + myData.data[0] + ',' + myData.data[1] + ',' + myData.data[2];//+ rgbdata; + }); } function onRemove(step) { step.ui.remove(); - $('#steps .step-container:nth-last-child(1) .insert-step').prop('disabled',true); + $('#steps .step-container:nth-last-child(1) .insert-step').prop('disabled', true); $('div[class*=imgareaselect-]').remove(); } @@ -673,8 +681,8 @@ function DefaultHtmlStepUi(_sequencer, options) { return step.imgElement; } - function notify(msg,id){ - if ($('#'+id).length == 0) { + function notify(msg, id){ + if ($('#' + id).length == 0) { var notification = document.createElement('span'); notification.innerHTML = ' ' + msg ; notification.id = id; @@ -683,7 +691,7 @@ function DefaultHtmlStepUi(_sequencer, options) { $('body').append(notification); } - $('#'+id).fadeIn(500).delay(200).fadeOut(500); + $('#' + id).fadeIn(500).delay(200).fadeOut(500); } @@ -692,14 +700,14 @@ function DefaultHtmlStepUi(_sequencer, options) { onSetup: onSetup, onComplete: onComplete, onRemove: onRemove, - onDraw: onDraw, + onDraw: onDraw, notify: notify, imageHover: imageHover }; } if(typeof window === 'undefined'){ - module.exports={ + module.exports = { DefaultHtmlStepUi: DefaultHtmlStepUi }; } @@ -737,7 +745,7 @@ function generatePreview(previewStepName, customValues, path, selector) { } function updatePreviews(src, selector) { - $(selector+' img').remove(); + $(selector + ' img').remove(); var previewSequencerSteps = { 'resize': '125%', diff --git a/dist/image-sequencer-ui.min.js b/dist/image-sequencer-ui.min.js index b2cbc501..13682274 100644 --- a/dist/image-sequencer-ui.min.js +++ b/dist/image-sequencer-ui.min.js @@ -1 +1 @@ -!function(){return function n(t,e,r){function i(o,a){if(!e[o]){if(!t[o]){var c="function"==typeof require&&require;if(!a&&c)return c(o,!0);if(u)return u(o,!0);var l=new Error("Cannot find module '"+o+"'");throw l.code="MODULE_NOT_FOUND",l}var f=e[o]={exports:{}};t[o][0].call(f.exports,function(n){return i(t[o][1][n]||n)},f,f.exports,n,t,e,r)}return e[o].exports}for(var u="function"==typeof require&&require,o=0;o'+n[e].name+"");t.append(''),t.selectize({sortField:"text"})}sequencer=ImageSequencer(),n(),$(window).on("scroll",function(){var n=$("body").scrollTop()>20||$(":root").scrollTop()>20;$("#move-up").css({display:n?"block":"none"})}),$("#move-up").on("click",function(){$("body").animate({scrollTop:0}),$(":root").animate({scrollTop:0})}),sequencer.setUI(o(sequencer));var t=r(sequencer);a.getUrlHashParameter("src")?sequencer.loadImage(a.getUrlHashParameter("src"),t.onLoad):sequencer.loadImage("images/tulips.png",t.onLoad);$("#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="/")}),$(".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")}),$("#download-btn").click(function(){return $(".step-thumbnail:last()").trigger("click"),!1}),$("body").on("click","button.remove",t.removeStepUi),$("#save-seq").click(()=>{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()},1e3),n())});var e=!1;$(".js-view-as-gif").on("click",function(n){if(!e){e=!0;var t=n.target;t.disabled=!0,t.innerHTML='';try{for(var r=document.getElementsByClassName("step-thumbnail"),i=[],u=0;u{console.log(t),"installed"===t.state&&location.reload()}),console.log("Registration successful, scope is:",n.scope)}).catch(function(n){console.log("Service worker registration failed, error:",n)}),"serviceWorker"in navigator&&caches.keys().then(function(n){n.forEach(function(n){$("#clear-cache").append(" "+n)})}),$("#clear-cache").click(function(){"serviceWorker"in navigator&&caches.keys().then(function(n){n.forEach(function(n){caches.delete(n)})}),location.reload()})}},{}],3:[function(n,t,e){var r=n("./urlHash.js");t.exports=function(n,t){var e=(t=t||{}).addStepSel=t.addStepSel||"#addStep",i=t.removeStepSel=t.removeStepSel||"button.remove";function u(){var t=r.getUrlHashParameter("steps");t&&(n.importString(t),n.run({index:0})),r.setUrlHashParameter("steps",sequencer.toString())}function o(){sequencer.steps.length<2?$(" #save-seq").prop("disabled",!0):$(" #save-seq").prop("disabled",!1)}return t.selectStepSel=t.selectStepSel||"#selectStep",{onLoad:function(){u(),"none"===$("#selectStep").val()&&$(e+" #add-step-btn").prop("disabled",!0),o()},importStepsFromUrlHash:u,selectNewStepUi:function(){var t=$(e+" select").val();t||(t=arguments[0]),$(e+" .info").html(n.modulesInfo(t).description),$(e+" #add-step-btn").prop("disabled",!1)},removeStepUi:function(){var n=$(i).index(this)+1;sequencer.removeSteps(n).run({index:n-1}),r.setUrlHashParameter("steps",sequencer.toString()),o()},addStepUi:function(){if("none"!=$(e+" select").val()){var i;i="string"!=typeof arguments[0]?$(e+" select option").html().toLowerCase().split(" ").join("-"):arguments[0];var u=1;sequencer.sequences[i]?u=sequencer.sequences[i].length:sequencer.modules[i][1].length&&(u=sequencer.modules[i][1].length),n.addSteps(i,t).run({index:n.steps.length-u-1}),$(e+" .info").html("Select a new module to add to your sequence."),$(e+" select").val("none"),o(),r.setUrlHashParameter("steps",n.toString())}}}}},{"./urlHash.js":8}],4:[function(n,t,e){var r=n("./intermediateHtmlStepUi.js"),i=n("./urlHash.js"),u=n("lodash"),o=n("./mapHtmltypes");function a(n,t){var e=(t=t||{}).stepsEl||document.querySelector("#steps");t.selectStepSel=t.selectStepSel||"#selectStep";function a(n){var t=$(n.imgElement);t.mousemove(function(n){var e=document.createElement("canvas");e.width=t.width(),e.height=t.height();var r=e.getContext("2d");r.drawImage(this,0,0);var i=$(this).offset(),u=n.pageX-i.left,o=n.pageY-i.top,a=r.getImageData(u,o,1,1);t[0].title="rgb: "+a.data[0]+","+a.data[1]+","+a.data[2]})}function c(n,t){if(0==$("#"+t).length){var e=document.createElement("span");e.innerHTML=' '+n,e.id=t,e.classList.add("notification"),$("body").append(e)}$("#"+t).fadeIn(500).delay(200).fadeOut(500)}return{getPreview:function(){return step.imgElement},onSetup:function(t,l){t.options&&t.options.description&&(t.description=t.options.description),t.ui='

'+t.name+'

'+(t.description||"")+'

';var f=r(n,t),s=new DOMParser;if(t.ui=s.parseFromString(t.ui,"text/html"),t.ui=t.ui.querySelector("div.container-fluid"),t.linkElements=t.ui.querySelectorAll("a"),t.imgElement=t.ui.querySelector("a img.img-thumbnail"),n.modulesInfo().hasOwnProperty(t.name)){var p=n.modulesInfo(t.name).inputs,h=n.modulesInfo(t.name).outputs,v=Object.assign(p,h);for(var d in v){var g=p.hasOwnProperty(d),_="",y=g?o(p[d]):{};if(g)if("select"==y.type.toLowerCase()){for(var m in _+='"}else{let n=t.options[d]||y.default;_=''+n+"":_+='">'}else _+='';var b=document.createElement("div");b.className="row",b.setAttribute("name",d);var w=p[d].desc||d;b.innerHTML="
"+_+"
",t.ui.querySelector("div.details").appendChild(b)}$(t.ui.querySelector("div.panel-footer")).append('
Press apply to see changes
'),$(t.ui.querySelector("div.panel-footer")).prepend('')}"load-image"!=t.name?(t.ui.querySelector("div.trash-container").prepend(s.parseFromString('
',"text/html").querySelector("div")),$(t.ui.querySelectorAll(".remove")).on("click",function(){c("Step Removed","remove-notification")}),$(t.ui.querySelectorAll(".insert-step")).on("click",function(){f.insertStep(t.ID)}),l.index==n.steps.length?(e.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)):e.insertBefore(t.ui,$(e).children()[l.index])):$("#load-image").append(t.ui),$(t.ui.querySelector(".toggle")).on("click",()=>{$(t.ui.querySelector(".toggleIcon")).toggleClass("rotated"),$(t.ui.querySelectorAll(".cal")).collapse("toggle")}),$(t.imgElement).on("mousemove",u.debounce(()=>a(t),150));var S=0,x=!1;$(t.ui.querySelector(".input-form")).on("submit",function(e){e.preventDefault(),x&&($(t.ui.querySelector("div.details")).find("input,select").each(function(n,e){$(e).data("initValue",$(e).val()).data("hasChangedBefore",!1),t.options[$(e).attr("name")]=$(e).val()}),n.run({index:t.index-1}),i.setUrlHashParameter("steps",n.toString()),$(t.ui.querySelector(".btn-save")).prop("disabled",!0),x=!1,S=0)}),$(t.ui.querySelectorAll(".target")).each(function(n,e){$(e).data("initValue",$(e).val()).data("hasChangedBefore",!1).on("input change",function(){var n,e,r,i;$(this).focus().data("hasChangedBefore",(n=$(this).val(),e=$(this).data("initValue"),r=$(this).data("hasChangedBefore"),i=!(isNaN(e)||isNaN(n)?n===e:n-e==0),x=(S+=r?i?0:-1:i?1:0)>0,$(t.ui.querySelector(".btn-save")).prop("disabled",!x),i))})}),$('input[type="range"]').on("input",function(){$(this).next().html($(this).val())})},onComplete:function(t){$(t.ui.querySelector("img")).show(),$(t.ui.querySelectorAll(".load-spin")).hide(),$(t.ui.querySelector(".load")).hide(),t.imgElement.src="load-image"==t.name?t.output.src:t.output;var e=t.ui.querySelector(".img-thumbnail");for(let n=0;n

Select a new module to add to your sequence.

Resize

Brightness

Contrast

Saturation

Rotate

Crop

';c=(new DOMParser).parseFromString(c,"text/html").querySelector("div"),$(t.ui.querySelector(".insertDiv")).length>0?o():(t.ui.querySelector("div.step").insertAdjacentElement("afterend",c),o(function(){i.updatePreviews(t.output,".insertDiv")})),$(t.ui.querySelector(".insertDiv .close-insert-box")).off("click").on("click",function(){o(function(){})});var l=$(t.ui.querySelector(".insert-step-select"));for(var f in l.html(""),r)void 0!==r[f]&&l.append('");l.selectize({sortField:"text"}),$(t.ui.querySelector(".inserDiv .add-step-btn")).prop("disabled",!0),l.append(''),$(t.ui.querySelector(".insertDiv .radio-group .radio")).on("click",function(){$(this).parent().find(".radio").removeClass("selected"),$(this).addClass("selected"),newStep=$(this).attr("data-value"),$(t.ui.querySelector(".insert-step-select")).val(newStep),u(),a(e),$(this).removeClass("selected")}),l.on("change",u),$(t.ui.querySelector(".insertDiv .add-step-btn")).on("click",function(){a(e)})},{insertStep:insertStep}}},{"./insertPreview.js":5,"./urlHash.js":8}],7:[function(n,t,e){t.exports=function(n){var t;switch(n.type.toLowerCase()){case"integer":t=void 0!=n.min?"range":"number";break;case"string":t="text";break;case"select":t="select";break;case"percentage":t="number";break;case"float":t=void 0!=n.min?"range":"text";break;default:t="text"}var e=n;return e.type=t,e}},{}],8:[function(n,t,e){function r(){var n=window.location.hash;n&&(n=n.split("#")[1]);var t={};return n.split("&").forEach(function(n,e){""!=(n=n.split("="))[0]&&(t[n[0]]=n[1])}),t}function i(n){var t=Object.keys(n),e=Object.values(n),r=[];t.forEach(function(n,i){""!=n&&r.push(t[i]+"="+e[i])});var i=r.join("&");window.location.hash=i}t.exports={getUrlHashParameter:function(n){return r()[n]},setUrlHashParameter:function(n,t){var e=r();e[n]=t,i(e)},getUrlHashParameters:r,setUrlHashParameters:i}},{}],9:[function(n,t,e){(function(n){(function(){var r,i=200,u="Unsupported core-js use. Try https://npms.io/search?q=ponyfill.",o="Expected a function",a="__lodash_hash_undefined__",c=500,l="__lodash_placeholder__",f=1,s=2,p=4,h=1,v=2,d=1,g=2,_=4,y=8,m=16,b=32,w=64,S=128,x=256,$=512,j=30,q="...",k=800,A=16,E=1,I=2,O=1/0,U=9007199254740991,C=1.7976931348623157e308,L=NaN,R=4294967295,z=R-1,P=R>>>1,T=[["ary",S],["bind",d],["bindKey",g],["curry",y],["curryRight",m],["flip",$],["partial",b],["partialRight",w],["rearg",x]],D="[object Arguments]",H="[object Array]",W="[object AsyncFunction]",B="[object Boolean]",M="[object Date]",N="[object DOMException]",F="[object Error]",V="[object Function]",Z="[object GeneratorFunction]",G="[object Map]",K="[object Number]",Y="[object Null]",J="[object Object]",X="[object Proxy]",Q="[object RegExp]",nn="[object Set]",tn="[object String]",en="[object Symbol]",rn="[object Undefined]",un="[object WeakMap]",on="[object WeakSet]",an="[object ArrayBuffer]",cn="[object DataView]",ln="[object Float32Array]",fn="[object Float64Array]",sn="[object Int8Array]",pn="[object Int16Array]",hn="[object Int32Array]",vn="[object Uint8Array]",dn="[object Uint8ClampedArray]",gn="[object Uint16Array]",_n="[object Uint32Array]",yn=/\b__p \+= '';/g,mn=/\b(__p \+=) '' \+/g,bn=/(__e\(.*?\)|\b__t\)) \+\n'';/g,wn=/&(?:amp|lt|gt|quot|#39);/g,Sn=/[&<>"']/g,xn=RegExp(wn.source),$n=RegExp(Sn.source),jn=/<%-([\s\S]+?)%>/g,qn=/<%([\s\S]+?)%>/g,kn=/<%=([\s\S]+?)%>/g,An=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,En=/^\w*$/,In=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,On=/[\\^$.*+?()[\]{}|]/g,Un=RegExp(On.source),Cn=/^\s+|\s+$/g,Ln=/^\s+/,Rn=/\s+$/,zn=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,Pn=/\{\n\/\* \[wrapped with (.+)\] \*/,Tn=/,? & /,Dn=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,Hn=/\\(\\)?/g,Wn=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,Bn=/\w*$/,Mn=/^[-+]0x[0-9a-f]+$/i,Nn=/^0b[01]+$/i,Fn=/^\[object .+?Constructor\]$/,Vn=/^0o[0-7]+$/i,Zn=/^(?:0|[1-9]\d*)$/,Gn=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,Kn=/($^)/,Yn=/['\n\r\u2028\u2029\\]/g,Jn="\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff",Xn="\\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",Qn="[\\ud800-\\udfff]",nt="["+Xn+"]",tt="["+Jn+"]",et="\\d+",rt="[\\u2700-\\u27bf]",it="[a-z\\xdf-\\xf6\\xf8-\\xff]",ut="[^\\ud800-\\udfff"+Xn+et+"\\u2700-\\u27bfa-z\\xdf-\\xf6\\xf8-\\xffA-Z\\xc0-\\xd6\\xd8-\\xde]",ot="\\ud83c[\\udffb-\\udfff]",at="[^\\ud800-\\udfff]",ct="(?:\\ud83c[\\udde6-\\uddff]){2}",lt="[\\ud800-\\udbff][\\udc00-\\udfff]",ft="[A-Z\\xc0-\\xd6\\xd8-\\xde]",st="(?:"+it+"|"+ut+")",pt="(?:"+ft+"|"+ut+")",ht="(?:"+tt+"|"+ot+")"+"?",vt="[\\ufe0e\\ufe0f]?"+ht+("(?:\\u200d(?:"+[at,ct,lt].join("|")+")[\\ufe0e\\ufe0f]?"+ht+")*"),dt="(?:"+[rt,ct,lt].join("|")+")"+vt,gt="(?:"+[at+tt+"?",tt,ct,lt,Qn].join("|")+")",_t=RegExp("['’]","g"),yt=RegExp(tt,"g"),mt=RegExp(ot+"(?="+ot+")|"+gt+vt,"g"),bt=RegExp([ft+"?"+it+"+(?:['’](?:d|ll|m|re|s|t|ve))?(?="+[nt,ft,"$"].join("|")+")",pt+"+(?:['’](?:D|LL|M|RE|S|T|VE))?(?="+[nt,ft+st,"$"].join("|")+")",ft+"?"+st+"+(?:['’](?:d|ll|m|re|s|t|ve))?",ft+"+(?:['’](?:D|LL|M|RE|S|T|VE))?","\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])","\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",et,dt].join("|"),"g"),wt=RegExp("[\\u200d\\ud800-\\udfff"+Jn+"\\ufe0e\\ufe0f]"),St=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,xt=["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"],$t=-1,jt={};jt[ln]=jt[fn]=jt[sn]=jt[pn]=jt[hn]=jt[vn]=jt[dn]=jt[gn]=jt[_n]=!0,jt[D]=jt[H]=jt[an]=jt[B]=jt[cn]=jt[M]=jt[F]=jt[V]=jt[G]=jt[K]=jt[J]=jt[Q]=jt[nn]=jt[tn]=jt[un]=!1;var qt={};qt[D]=qt[H]=qt[an]=qt[cn]=qt[B]=qt[M]=qt[ln]=qt[fn]=qt[sn]=qt[pn]=qt[hn]=qt[G]=qt[K]=qt[J]=qt[Q]=qt[nn]=qt[tn]=qt[en]=qt[vn]=qt[dn]=qt[gn]=qt[_n]=!0,qt[F]=qt[V]=qt[un]=!1;var kt={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},At=parseFloat,Et=parseInt,It="object"==typeof n&&n&&n.Object===Object&&n,Ot="object"==typeof self&&self&&self.Object===Object&&self,Ut=It||Ot||Function("return this")(),Ct="object"==typeof e&&e&&!e.nodeType&&e,Lt=Ct&&"object"==typeof t&&t&&!t.nodeType&&t,Rt=Lt&&Lt.exports===Ct,zt=Rt&&It.process,Pt=function(){try{var n=Lt&&Lt.require&&Lt.require("util").types;return n||zt&&zt.binding&&zt.binding("util")}catch(n){}}(),Tt=Pt&&Pt.isArrayBuffer,Dt=Pt&&Pt.isDate,Ht=Pt&&Pt.isMap,Wt=Pt&&Pt.isRegExp,Bt=Pt&&Pt.isSet,Mt=Pt&&Pt.isTypedArray;function Nt(n,t,e){switch(e.length){case 0:return n.call(t);case 1:return n.call(t,e[0]);case 2:return n.call(t,e[0],e[1]);case 3:return n.call(t,e[0],e[1],e[2])}return n.apply(t,e)}function Ft(n,t,e,r){for(var i=-1,u=null==n?0:n.length;++i-1}function Jt(n,t,e){for(var r=-1,i=null==n?0:n.length;++r-1;);return e}function me(n,t){for(var e=n.length;e--&&oe(t,n[e],0)>-1;);return e}var be=se({"À":"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"}),we=se({"&":"&","<":"<",">":">",'"':""","'":"'"});function Se(n){return"\\"+kt[n]}function xe(n){return wt.test(n)}function $e(n){var t=-1,e=Array(n.size);return n.forEach(function(n,r){e[++t]=[r,n]}),e}function je(n,t){return function(e){return n(t(e))}}function qe(n,t){for(var e=-1,r=n.length,i=0,u=[];++e",""":'"',"'":"'"});var Ue=function n(t){var e,Jn=(t=null==t?Ut:Ue.defaults(Ut.Object(),t,Ue.pick(Ut,xt))).Array,Xn=t.Date,Qn=t.Error,nt=t.Function,tt=t.Math,et=t.Object,rt=t.RegExp,it=t.String,ut=t.TypeError,ot=Jn.prototype,at=nt.prototype,ct=et.prototype,lt=t["__core-js_shared__"],ft=at.toString,st=ct.hasOwnProperty,pt=0,ht=(e=/[^.]+$/.exec(lt&<.keys&<.keys.IE_PROTO||""))?"Symbol(src)_1."+e:"",vt=ct.toString,dt=ft.call(et),gt=Ut._,mt=rt("^"+ft.call(st).replace(On,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),wt=Rt?t.Buffer:r,kt=t.Symbol,It=t.Uint8Array,Ot=wt?wt.allocUnsafe:r,Ct=je(et.getPrototypeOf,et),Lt=et.create,zt=ct.propertyIsEnumerable,Pt=ot.splice,re=kt?kt.isConcatSpreadable:r,se=kt?kt.iterator:r,Ce=kt?kt.toStringTag:r,Le=function(){try{var n=Tu(et,"defineProperty");return n({},"",{}),n}catch(n){}}(),Re=t.clearTimeout!==Ut.clearTimeout&&t.clearTimeout,ze=Xn&&Xn.now!==Ut.Date.now&&Xn.now,Pe=t.setTimeout!==Ut.setTimeout&&t.setTimeout,Te=tt.ceil,De=tt.floor,He=et.getOwnPropertySymbols,We=wt?wt.isBuffer:r,Be=t.isFinite,Me=ot.join,Ne=je(et.keys,et),Fe=tt.max,Ve=tt.min,Ze=Xn.now,Ge=t.parseInt,Ke=tt.random,Ye=ot.reverse,Je=Tu(t,"DataView"),Xe=Tu(t,"Map"),Qe=Tu(t,"Promise"),nr=Tu(t,"Set"),tr=Tu(t,"WeakMap"),er=Tu(et,"create"),rr=tr&&new tr,ir={},ur=fo(Je),or=fo(Xe),ar=fo(Qe),cr=fo(nr),lr=fo(tr),fr=kt?kt.prototype:r,sr=fr?fr.valueOf:r,pr=fr?fr.toString:r;function hr(n){if(Aa(n)&&!_a(n)&&!(n instanceof _r)){if(n instanceof gr)return n;if(st.call(n,"__wrapped__"))return so(n)}return new gr(n)}var vr=function(){function n(){}return function(t){if(!ka(t))return{};if(Lt)return Lt(t);n.prototype=t;var e=new n;return n.prototype=r,e}}();function dr(){}function gr(n,t){this.__wrapped__=n,this.__actions__=[],this.__chain__=!!t,this.__index__=0,this.__values__=r}function _r(n){this.__wrapped__=n,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=R,this.__views__=[]}function yr(n){var t=-1,e=null==n?0:n.length;for(this.clear();++t=t?n:t)),n}function Rr(n,t,e,i,u,o){var a,c=t&f,l=t&s,h=t&p;if(e&&(a=u?e(n,i,u,o):e(n)),a!==r)return a;if(!ka(n))return n;var v=_a(n);if(v){if(a=function(n){var t=n.length,e=new n.constructor(t);return t&&"string"==typeof n[0]&&st.call(n,"index")&&(e.index=n.index,e.input=n.input),e}(n),!c)return eu(n,a)}else{var d=Wu(n),g=d==V||d==Z;if(wa(n))return Yi(n,c);if(d==J||d==D||g&&!u){if(a=l||g?{}:Mu(n),!c)return l?function(n,t){return ru(n,Hu(n),t)}(n,function(n,t){return n&&ru(t,uc(t),n)}(a,n)):function(n,t){return ru(n,Du(n),t)}(n,Or(a,n))}else{if(!qt[d])return u?n:{};a=function(n,t,e){var r,i,u,o=n.constructor;switch(t){case an:return Ji(n);case B:case M:return new o(+n);case cn:return function(n,t){var e=t?Ji(n.buffer):n.buffer;return new n.constructor(e,n.byteOffset,n.byteLength)}(n,e);case ln:case fn:case sn:case pn:case hn:case vn:case dn:case gn:case _n:return Xi(n,e);case G:return new o;case K:case tn:return new o(n);case Q:return(u=new(i=n).constructor(i.source,Bn.exec(i))).lastIndex=i.lastIndex,u;case nn:return new o;case en:return r=n,sr?et(sr.call(r)):{}}}(n,d,c)}}o||(o=new Sr);var _=o.get(n);if(_)return _;if(o.set(n,a),Ca(n))return n.forEach(function(r){a.add(Rr(r,t,e,r,n,o))}),a;if(Ea(n))return n.forEach(function(r,i){a.set(i,Rr(r,t,e,i,n,o))}),a;var y=v?r:(h?l?Ou:Iu:l?uc:ic)(n);return Vt(y||n,function(r,i){y&&(r=n[i=r]),Ar(a,i,Rr(r,t,e,i,n,o))}),a}function zr(n,t,e){var i=e.length;if(null==n)return!i;for(n=et(n);i--;){var u=e[i],o=t[u],a=n[u];if(a===r&&!(u in n)||!o(a))return!1}return!0}function Pr(n,t,e){if("function"!=typeof n)throw new ut(o);return ro(function(){n.apply(r,e)},t)}function Tr(n,t,e,r){var u=-1,o=Yt,a=!0,c=n.length,l=[],f=t.length;if(!c)return l;e&&(t=Xt(t,de(e))),r?(o=Jt,a=!1):t.length>=i&&(o=_e,a=!1,t=new wr(t));n:for(;++u-1},mr.prototype.set=function(n,t){var e=this.__data__,r=Er(e,n);return r<0?(++this.size,e.push([n,t])):e[r][1]=t,this},br.prototype.clear=function(){this.size=0,this.__data__={hash:new yr,map:new(Xe||mr),string:new yr}},br.prototype.delete=function(n){var t=zu(this,n).delete(n);return this.size-=t?1:0,t},br.prototype.get=function(n){return zu(this,n).get(n)},br.prototype.has=function(n){return zu(this,n).has(n)},br.prototype.set=function(n,t){var e=zu(this,n),r=e.size;return e.set(n,t),this.size+=e.size==r?0:1,this},wr.prototype.add=wr.prototype.push=function(n){return this.__data__.set(n,a),this},wr.prototype.has=function(n){return this.__data__.has(n)},Sr.prototype.clear=function(){this.__data__=new mr,this.size=0},Sr.prototype.delete=function(n){var t=this.__data__,e=t.delete(n);return this.size=t.size,e},Sr.prototype.get=function(n){return this.__data__.get(n)},Sr.prototype.has=function(n){return this.__data__.has(n)},Sr.prototype.set=function(n,t){var e=this.__data__;if(e instanceof mr){var r=e.__data__;if(!Xe||r.length0&&e(a)?t>1?Nr(a,t-1,e,r,i):Qt(i,a):r||(i[i.length]=a)}return i}var Fr=au(),Vr=au(!0);function Zr(n,t){return n&&Fr(n,t,ic)}function Gr(n,t){return n&&Vr(n,t,ic)}function Kr(n,t){return Kt(t,function(t){return $a(n[t])})}function Yr(n,t){for(var e=0,i=(t=Vi(t,n)).length;null!=n&&et}function ni(n,t){return null!=n&&st.call(n,t)}function ti(n,t){return null!=n&&t in et(n)}function ei(n,t,e){for(var i=e?Jt:Yt,u=n[0].length,o=n.length,a=o,c=Jn(o),l=1/0,f=[];a--;){var s=n[a];a&&t&&(s=Xt(s,de(t))),l=Ve(s.length,l),c[a]=!e&&(t||u>=120&&s.length>=120)?new wr(a&&s):r}s=n[0];var p=-1,h=c[0];n:for(;++p=a)return c;var l=e[r];return c*("desc"==l?-1:1)}}return n.index-t.index}(n,t,e)})}function yi(n,t,e){for(var r=-1,i=t.length,u={};++r-1;)a!==n&&Pt.call(a,c,1),Pt.call(n,c,1);return n}function bi(n,t){for(var e=n?t.length:0,r=e-1;e--;){var i=t[e];if(e==r||i!==u){var u=i;Fu(i)?Pt.call(n,i,1):Ti(n,i)}}return n}function wi(n,t){return n+De(Ke()*(t-n+1))}function Si(n,t){var e="";if(!n||t<1||t>U)return e;do{t%2&&(e+=n),(t=De(t/2))&&(n+=n)}while(t);return e}function xi(n,t){return io(Qu(n,t,Ic),n+"")}function $i(n){return $r(hc(n))}function ji(n,t){var e=hc(n);return ao(e,Lr(t,0,e.length))}function qi(n,t,e,i){if(!ka(n))return n;for(var u=-1,o=(t=Vi(t,n)).length,a=o-1,c=n;null!=c&&++ui?0:i+t),(e=e>i?i:e)<0&&(e+=i),i=t>e?0:e-t>>>0,t>>>=0;for(var u=Jn(i);++r>>1,o=n[u];null!==o&&!Ra(o)&&(e?o<=t:o=i){var f=t?null:Su(n);if(f)return ke(f);a=!1,u=_e,l=new wr}else l=t?[]:c;n:for(;++r=i?n:Ii(n,t,e)}var Ki=Re||function(n){return Ut.clearTimeout(n)};function Yi(n,t){if(t)return n.slice();var e=n.length,r=Ot?Ot(e):new n.constructor(e);return n.copy(r),r}function Ji(n){var t=new n.constructor(n.byteLength);return new It(t).set(new It(n)),t}function Xi(n,t){var e=t?Ji(n.buffer):n.buffer;return new n.constructor(e,n.byteOffset,n.length)}function Qi(n,t){if(n!==t){var e=n!==r,i=null===n,u=n==n,o=Ra(n),a=t!==r,c=null===t,l=t==t,f=Ra(t);if(!c&&!f&&!o&&n>t||o&&a&&l&&!c&&!f||i&&a&&l||!e&&l||!u)return 1;if(!i&&!o&&!f&&n1?e[u-1]:r,a=u>2?e[2]:r;for(o=n.length>3&&"function"==typeof o?(u--,o):r,a&&Vu(e[0],e[1],a)&&(o=u<3?r:o,u=1),t=et(t);++i-1?u[o?t[a]:a]:r}}function pu(n){return Eu(function(t){var e=t.length,i=e,u=gr.prototype.thru;for(n&&t.reverse();i--;){var a=t[i];if("function"!=typeof a)throw new ut(o);if(u&&!c&&"wrapper"==Cu(a))var c=new gr([],!0)}for(i=c?i:e;++i1&&y.reverse(),s&&lc))return!1;var f=o.get(n);if(f&&o.get(t))return f==t;var s=-1,p=!0,d=e&v?new wr:r;for(o.set(n,t),o.set(t,n);++s-1&&n%1==0&&n1?"& ":"")+t[r],t=t.join(e>2?", ":" "),n.replace(zn,"{\n/* [wrapped with "+t+"] */\n")}(r,function(n,t){return Vt(T,function(e){var r="_."+e[0];t&e[1]&&!Yt(n,r)&&n.push(r)}),n.sort()}(function(n){var t=n.match(Pn);return t?t[1].split(Tn):[]}(r),e)))}function oo(n){var t=0,e=0;return function(){var i=Ze(),u=A-(i-e);if(e=i,u>0){if(++t>=k)return arguments[0]}else t=0;return n.apply(r,arguments)}}function ao(n,t){var e=-1,i=n.length,u=i-1;for(t=t===r?i:t;++e1?n[t-1]:r;return Uo(n,e="function"==typeof e?(n.pop(),e):r)});function Do(n){var t=hr(n);return t.__chain__=!0,t}function Ho(n,t){return t(n)}var Wo=Eu(function(n){var t=n.length,e=t?n[0]:0,i=this.__wrapped__,u=function(t){return Cr(t,n)};return!(t>1||this.__actions__.length)&&i instanceof _r&&Fu(e)?((i=i.slice(e,+e+(t?1:0))).__actions__.push({func:Ho,args:[u],thisArg:r}),new gr(i,this.__chain__).thru(function(n){return t&&!n.length&&n.push(r),n})):this.thru(u)});var Bo=iu(function(n,t,e){st.call(n,e)?++n[e]:Ur(n,e,1)});var Mo=su(go),No=su(_o);function Fo(n,t){return(_a(n)?Vt:Dr)(n,Ru(t,3))}function Vo(n,t){return(_a(n)?Zt:Hr)(n,Ru(t,3))}var Zo=iu(function(n,t,e){st.call(n,e)?n[e].push(t):Ur(n,e,[t])});var Go=xi(function(n,t,e){var r=-1,i="function"==typeof t,u=ma(n)?Jn(n.length):[];return Dr(n,function(n){u[++r]=i?Nt(t,n,e):ri(n,t,e)}),u}),Ko=iu(function(n,t,e){Ur(n,e,t)});function Yo(n,t){return(_a(n)?Xt:pi)(n,Ru(t,3))}var Jo=iu(function(n,t,e){n[e?0:1].push(t)},function(){return[[],[]]});var Xo=xi(function(n,t){if(null==n)return[];var e=t.length;return e>1&&Vu(n,t[0],t[1])?t=[]:e>2&&Vu(t[0],t[1],t[2])&&(t=[t[0]]),_i(n,Nr(t,1),[])}),Qo=ze||function(){return Ut.Date.now()};function na(n,t,e){return t=e?r:t,t=n&&null==t?n.length:t,$u(n,S,r,r,r,r,t)}function ta(n,t){var e;if("function"!=typeof t)throw new ut(o);return n=Wa(n),function(){return--n>0&&(e=t.apply(this,arguments)),n<=1&&(t=r),e}}var ea=xi(function(n,t,e){var r=d;if(e.length){var i=qe(e,Lu(ea));r|=b}return $u(n,r,t,e,i)}),ra=xi(function(n,t,e){var r=d|g;if(e.length){var i=qe(e,Lu(ra));r|=b}return $u(t,r,n,e,i)});function ia(n,t,e){var i,u,a,c,l,f,s=0,p=!1,h=!1,v=!0;if("function"!=typeof n)throw new ut(o);function d(t){var e=i,o=u;return i=u=r,s=t,c=n.apply(o,e)}function g(n){var e=n-f;return f===r||e>=t||e<0||h&&n-s>=a}function _(){var n=Qo();if(g(n))return y(n);l=ro(_,function(n){var e=t-(n-f);return h?Ve(e,a-(n-s)):e}(n))}function y(n){return l=r,v&&i?d(n):(i=u=r,c)}function m(){var n=Qo(),e=g(n);if(i=arguments,u=this,f=n,e){if(l===r)return function(n){return s=n,l=ro(_,t),p?d(n):c}(f);if(h)return l=ro(_,t),d(f)}return l===r&&(l=ro(_,t)),c}return t=Ma(t)||0,ka(e)&&(p=!!e.leading,a=(h="maxWait"in e)?Fe(Ma(e.maxWait)||0,t):a,v="trailing"in e?!!e.trailing:v),m.cancel=function(){l!==r&&Ki(l),s=0,i=f=u=l=r},m.flush=function(){return l===r?c:y(Qo())},m}var ua=xi(function(n,t){return Pr(n,1,t)}),oa=xi(function(n,t,e){return Pr(n,Ma(t)||0,e)});function aa(n,t){if("function"!=typeof n||null!=t&&"function"!=typeof t)throw new ut(o);var e=function(){var r=arguments,i=t?t.apply(this,r):r[0],u=e.cache;if(u.has(i))return u.get(i);var o=n.apply(this,r);return e.cache=u.set(i,o)||u,o};return e.cache=new(aa.Cache||br),e}function ca(n){if("function"!=typeof n)throw new ut(o);return function(){var t=arguments;switch(t.length){case 0:return!n.call(this);case 1:return!n.call(this,t[0]);case 2:return!n.call(this,t[0],t[1]);case 3:return!n.call(this,t[0],t[1],t[2])}return!n.apply(this,t)}}aa.Cache=br;var la=Zi(function(n,t){var e=(t=1==t.length&&_a(t[0])?Xt(t[0],de(Ru())):Xt(Nr(t,1),de(Ru()))).length;return xi(function(r){for(var i=-1,u=Ve(r.length,e);++i=t}),ga=ii(function(){return arguments}())?ii:function(n){return Aa(n)&&st.call(n,"callee")&&!zt.call(n,"callee")},_a=Jn.isArray,ya=Tt?de(Tt):function(n){return Aa(n)&&Xr(n)==an};function ma(n){return null!=n&&qa(n.length)&&!$a(n)}function ba(n){return Aa(n)&&ma(n)}var wa=We||Mc,Sa=Dt?de(Dt):function(n){return Aa(n)&&Xr(n)==M};function xa(n){if(!Aa(n))return!1;var t=Xr(n);return t==F||t==N||"string"==typeof n.message&&"string"==typeof n.name&&!Oa(n)}function $a(n){if(!ka(n))return!1;var t=Xr(n);return t==V||t==Z||t==W||t==X}function ja(n){return"number"==typeof n&&n==Wa(n)}function qa(n){return"number"==typeof n&&n>-1&&n%1==0&&n<=U}function ka(n){var t=typeof n;return null!=n&&("object"==t||"function"==t)}function Aa(n){return null!=n&&"object"==typeof n}var Ea=Ht?de(Ht):function(n){return Aa(n)&&Wu(n)==G};function Ia(n){return"number"==typeof n||Aa(n)&&Xr(n)==K}function Oa(n){if(!Aa(n)||Xr(n)!=J)return!1;var t=Ct(n);if(null===t)return!0;var e=st.call(t,"constructor")&&t.constructor;return"function"==typeof e&&e instanceof e&&ft.call(e)==dt}var Ua=Wt?de(Wt):function(n){return Aa(n)&&Xr(n)==Q};var Ca=Bt?de(Bt):function(n){return Aa(n)&&Wu(n)==nn};function La(n){return"string"==typeof n||!_a(n)&&Aa(n)&&Xr(n)==tn}function Ra(n){return"symbol"==typeof n||Aa(n)&&Xr(n)==en}var za=Mt?de(Mt):function(n){return Aa(n)&&qa(n.length)&&!!jt[Xr(n)]};var Pa=mu(si),Ta=mu(function(n,t){return n<=t});function Da(n){if(!n)return[];if(ma(n))return La(n)?Ie(n):eu(n);if(se&&n[se])return function(n){for(var t,e=[];!(t=n.next()).done;)e.push(t.value);return e}(n[se]());var t=Wu(n);return(t==G?$e:t==nn?ke:hc)(n)}function Ha(n){return n?(n=Ma(n))===O||n===-O?(n<0?-1:1)*C:n==n?n:0:0===n?n:0}function Wa(n){var t=Ha(n),e=t%1;return t==t?e?t-e:t:0}function Ba(n){return n?Lr(Wa(n),0,R):0}function Ma(n){if("number"==typeof n)return n;if(Ra(n))return L;if(ka(n)){var t="function"==typeof n.valueOf?n.valueOf():n;n=ka(t)?t+"":t}if("string"!=typeof n)return 0===n?n:+n;n=n.replace(Cn,"");var e=Nn.test(n);return e||Vn.test(n)?Et(n.slice(2),e?2:8):Mn.test(n)?L:+n}function Na(n){return ru(n,uc(n))}function Fa(n){return null==n?"":zi(n)}var Va=uu(function(n,t){if(Yu(t)||ma(t))ru(t,ic(t),n);else for(var e in t)st.call(t,e)&&Ar(n,e,t[e])}),Za=uu(function(n,t){ru(t,uc(t),n)}),Ga=uu(function(n,t,e,r){ru(t,uc(t),n,r)}),Ka=uu(function(n,t,e,r){ru(t,ic(t),n,r)}),Ya=Eu(Cr);var Ja=xi(function(n,t){n=et(n);var e=-1,i=t.length,u=i>2?t[2]:r;for(u&&Vu(t[0],t[1],u)&&(i=1);++e1),t}),ru(n,Ou(n),e),r&&(e=Rr(e,f|s|p,ku));for(var i=t.length;i--;)Ti(e,t[i]);return e});var lc=Eu(function(n,t){return null==n?{}:function(n,t){return yi(n,t,function(t,e){return nc(n,e)})}(n,t)});function fc(n,t){if(null==n)return{};var e=Xt(Ou(n),function(n){return[n]});return t=Ru(t),yi(n,e,function(n,e){return t(n,e[0])})}var sc=xu(ic),pc=xu(uc);function hc(n){return null==n?[]:ge(n,ic(n))}var vc=lu(function(n,t,e){return t=t.toLowerCase(),n+(e?dc(t):t)});function dc(n){return xc(Fa(n).toLowerCase())}function gc(n){return(n=Fa(n))&&n.replace(Gn,be).replace(yt,"")}var _c=lu(function(n,t,e){return n+(e?"-":"")+t.toLowerCase()}),yc=lu(function(n,t,e){return n+(e?" ":"")+t.toLowerCase()}),mc=cu("toLowerCase");var bc=lu(function(n,t,e){return n+(e?"_":"")+t.toLowerCase()});var wc=lu(function(n,t,e){return n+(e?" ":"")+xc(t)});var Sc=lu(function(n,t,e){return n+(e?" ":"")+t.toUpperCase()}),xc=cu("toUpperCase");function $c(n,t,e){return n=Fa(n),(t=e?r:t)===r?function(n){return St.test(n)}(n)?function(n){return n.match(bt)||[]}(n):function(n){return n.match(Dn)||[]}(n):n.match(t)||[]}var jc=xi(function(n,t){try{return Nt(n,r,t)}catch(n){return xa(n)?n:new Qn(n)}}),qc=Eu(function(n,t){return Vt(t,function(t){t=lo(t),Ur(n,t,ea(n[t],n))}),n});function kc(n){return function(){return n}}var Ac=pu(),Ec=pu(!0);function Ic(n){return n}function Oc(n){return ci("function"==typeof n?n:Rr(n,f))}var Uc=xi(function(n,t){return function(e){return ri(e,n,t)}}),Cc=xi(function(n,t){return function(e){return ri(n,e,t)}});function Lc(n,t,e){var r=ic(t),i=Kr(t,r);null!=e||ka(t)&&(i.length||!r.length)||(e=t,t=n,n=this,i=Kr(t,ic(t)));var u=!(ka(e)&&"chain"in e&&!e.chain),o=$a(n);return Vt(i,function(e){var r=t[e];n[e]=r,o&&(n.prototype[e]=function(){var t=this.__chain__;if(u||t){var e=n(this.__wrapped__);return(e.__actions__=eu(this.__actions__)).push({func:r,args:arguments,thisArg:n}),e.__chain__=t,e}return r.apply(n,Qt([this.value()],arguments))})}),n}function Rc(){}var zc=gu(Xt),Pc=gu(Gt),Tc=gu(ee);function Dc(n){return Zu(n)?fe(lo(n)):function(n){return function(t){return Yr(t,n)}}(n)}var Hc=yu(),Wc=yu(!0);function Bc(){return[]}function Mc(){return!1}var Nc=du(function(n,t){return n+t},0),Fc=wu("ceil"),Vc=du(function(n,t){return n/t},1),Zc=wu("floor");var Gc,Kc=du(function(n,t){return n*t},1),Yc=wu("round"),Jc=du(function(n,t){return n-t},0);return hr.after=function(n,t){if("function"!=typeof t)throw new ut(o);return n=Wa(n),function(){if(--n<1)return t.apply(this,arguments)}},hr.ary=na,hr.assign=Va,hr.assignIn=Za,hr.assignInWith=Ga,hr.assignWith=Ka,hr.at=Ya,hr.before=ta,hr.bind=ea,hr.bindAll=qc,hr.bindKey=ra,hr.castArray=function(){if(!arguments.length)return[];var n=arguments[0];return _a(n)?n:[n]},hr.chain=Do,hr.chunk=function(n,t,e){t=(e?Vu(n,t,e):t===r)?1:Fe(Wa(t),0);var i=null==n?0:n.length;if(!i||t<1)return[];for(var u=0,o=0,a=Jn(Te(i/t));uu?0:u+e),(i=i===r||i>u?u:Wa(i))<0&&(i+=u),i=e>i?0:Ba(i);e>>0)?(n=Fa(n))&&("string"==typeof t||null!=t&&!Ua(t))&&!(t=zi(t))&&xe(n)?Gi(Ie(n),0,e):n.split(t,e):[]},hr.spread=function(n,t){if("function"!=typeof n)throw new ut(o);return t=null==t?0:Fe(Wa(t),0),xi(function(e){var r=e[t],i=Gi(e,0,t);return r&&Qt(i,r),Nt(n,this,i)})},hr.tail=function(n){var t=null==n?0:n.length;return t?Ii(n,1,t):[]},hr.take=function(n,t,e){return n&&n.length?Ii(n,0,(t=e||t===r?1:Wa(t))<0?0:t):[]},hr.takeRight=function(n,t,e){var i=null==n?0:n.length;return i?Ii(n,(t=i-(t=e||t===r?1:Wa(t)))<0?0:t,i):[]},hr.takeRightWhile=function(n,t){return n&&n.length?Hi(n,Ru(t,3),!1,!0):[]},hr.takeWhile=function(n,t){return n&&n.length?Hi(n,Ru(t,3)):[]},hr.tap=function(n,t){return t(n),n},hr.throttle=function(n,t,e){var r=!0,i=!0;if("function"!=typeof n)throw new ut(o);return ka(e)&&(r="leading"in e?!!e.leading:r,i="trailing"in e?!!e.trailing:i),ia(n,t,{leading:r,maxWait:t,trailing:i})},hr.thru=Ho,hr.toArray=Da,hr.toPairs=sc,hr.toPairsIn=pc,hr.toPath=function(n){return _a(n)?Xt(n,lo):Ra(n)?[n]:eu(co(Fa(n)))},hr.toPlainObject=Na,hr.transform=function(n,t,e){var r=_a(n),i=r||wa(n)||za(n);if(t=Ru(t,4),null==e){var u=n&&n.constructor;e=i?r?new u:[]:ka(n)&&$a(u)?vr(Ct(n)):{}}return(i?Vt:Zr)(n,function(n,r,i){return t(e,n,r,i)}),e},hr.unary=function(n){return na(n,1)},hr.union=Ao,hr.unionBy=Eo,hr.unionWith=Io,hr.uniq=function(n){return n&&n.length?Pi(n):[]},hr.uniqBy=function(n,t){return n&&n.length?Pi(n,Ru(t,2)):[]},hr.uniqWith=function(n,t){return t="function"==typeof t?t:r,n&&n.length?Pi(n,r,t):[]},hr.unset=function(n,t){return null==n||Ti(n,t)},hr.unzip=Oo,hr.unzipWith=Uo,hr.update=function(n,t,e){return null==n?n:Di(n,t,Fi(e))},hr.updateWith=function(n,t,e,i){return i="function"==typeof i?i:r,null==n?n:Di(n,t,Fi(e),i)},hr.values=hc,hr.valuesIn=function(n){return null==n?[]:ge(n,uc(n))},hr.without=Co,hr.words=$c,hr.wrap=function(n,t){return fa(Fi(t),n)},hr.xor=Lo,hr.xorBy=Ro,hr.xorWith=zo,hr.zip=Po,hr.zipObject=function(n,t){return Mi(n||[],t||[],Ar)},hr.zipObjectDeep=function(n,t){return Mi(n||[],t||[],qi)},hr.zipWith=To,hr.entries=sc,hr.entriesIn=pc,hr.extend=Za,hr.extendWith=Ga,Lc(hr,hr),hr.add=Nc,hr.attempt=jc,hr.camelCase=vc,hr.capitalize=dc,hr.ceil=Fc,hr.clamp=function(n,t,e){return e===r&&(e=t,t=r),e!==r&&(e=(e=Ma(e))==e?e:0),t!==r&&(t=(t=Ma(t))==t?t:0),Lr(Ma(n),t,e)},hr.clone=function(n){return Rr(n,p)},hr.cloneDeep=function(n){return Rr(n,f|p)},hr.cloneDeepWith=function(n,t){return Rr(n,f|p,t="function"==typeof t?t:r)},hr.cloneWith=function(n,t){return Rr(n,p,t="function"==typeof t?t:r)},hr.conformsTo=function(n,t){return null==t||zr(n,t,ic(t))},hr.deburr=gc,hr.defaultTo=function(n,t){return null==n||n!=n?t:n},hr.divide=Vc,hr.endsWith=function(n,t,e){n=Fa(n),t=zi(t);var i=n.length,u=e=e===r?i:Lr(Wa(e),0,i);return(e-=t.length)>=0&&n.slice(e,u)==t},hr.eq=ha,hr.escape=function(n){return(n=Fa(n))&&$n.test(n)?n.replace(Sn,we):n},hr.escapeRegExp=function(n){return(n=Fa(n))&&Un.test(n)?n.replace(On,"\\$&"):n},hr.every=function(n,t,e){var i=_a(n)?Gt:Wr;return e&&Vu(n,t,e)&&(t=r),i(n,Ru(t,3))},hr.find=Mo,hr.findIndex=go,hr.findKey=function(n,t){return ie(n,Ru(t,3),Zr)},hr.findLast=No,hr.findLastIndex=_o,hr.findLastKey=function(n,t){return ie(n,Ru(t,3),Gr)},hr.floor=Zc,hr.forEach=Fo,hr.forEachRight=Vo,hr.forIn=function(n,t){return null==n?n:Fr(n,Ru(t,3),uc)},hr.forInRight=function(n,t){return null==n?n:Vr(n,Ru(t,3),uc)},hr.forOwn=function(n,t){return n&&Zr(n,Ru(t,3))},hr.forOwnRight=function(n,t){return n&&Gr(n,Ru(t,3))},hr.get=Qa,hr.gt=va,hr.gte=da,hr.has=function(n,t){return null!=n&&Bu(n,t,ni)},hr.hasIn=nc,hr.head=mo,hr.identity=Ic,hr.includes=function(n,t,e,r){n=ma(n)?n:hc(n),e=e&&!r?Wa(e):0;var i=n.length;return e<0&&(e=Fe(i+e,0)),La(n)?e<=i&&n.indexOf(t,e)>-1:!!i&&oe(n,t,e)>-1},hr.indexOf=function(n,t,e){var r=null==n?0:n.length;if(!r)return-1;var i=null==e?0:Wa(e);return i<0&&(i=Fe(r+i,0)),oe(n,t,i)},hr.inRange=function(n,t,e){return t=Ha(t),e===r?(e=t,t=0):e=Ha(e),function(n,t,e){return n>=Ve(t,e)&&n=-U&&n<=U},hr.isSet=Ca,hr.isString=La,hr.isSymbol=Ra,hr.isTypedArray=za,hr.isUndefined=function(n){return n===r},hr.isWeakMap=function(n){return Aa(n)&&Wu(n)==un},hr.isWeakSet=function(n){return Aa(n)&&Xr(n)==on},hr.join=function(n,t){return null==n?"":Me.call(n,t)},hr.kebabCase=_c,hr.last=xo,hr.lastIndexOf=function(n,t,e){var i=null==n?0:n.length;if(!i)return-1;var u=i;return e!==r&&(u=(u=Wa(e))<0?Fe(i+u,0):Ve(u,i-1)),t==t?function(n,t,e){for(var r=e+1;r--;)if(n[r]===t)return r;return r}(n,t,u):ue(n,ce,u,!0)},hr.lowerCase=yc,hr.lowerFirst=mc,hr.lt=Pa,hr.lte=Ta,hr.max=function(n){return n&&n.length?Br(n,Ic,Qr):r},hr.maxBy=function(n,t){return n&&n.length?Br(n,Ru(t,2),Qr):r},hr.mean=function(n){return le(n,Ic)},hr.meanBy=function(n,t){return le(n,Ru(t,2))},hr.min=function(n){return n&&n.length?Br(n,Ic,si):r},hr.minBy=function(n,t){return n&&n.length?Br(n,Ru(t,2),si):r},hr.stubArray=Bc,hr.stubFalse=Mc,hr.stubObject=function(){return{}},hr.stubString=function(){return""},hr.stubTrue=function(){return!0},hr.multiply=Kc,hr.nth=function(n,t){return n&&n.length?gi(n,Wa(t)):r},hr.noConflict=function(){return Ut._===this&&(Ut._=gt),this},hr.noop=Rc,hr.now=Qo,hr.pad=function(n,t,e){n=Fa(n);var r=(t=Wa(t))?Ee(n):0;if(!t||r>=t)return n;var i=(t-r)/2;return _u(De(i),e)+n+_u(Te(i),e)},hr.padEnd=function(n,t,e){n=Fa(n);var r=(t=Wa(t))?Ee(n):0;return t&&rt){var i=n;n=t,t=i}if(e||n%1||t%1){var u=Ke();return Ve(n+u*(t-n+At("1e-"+((u+"").length-1))),t)}return wi(n,t)},hr.reduce=function(n,t,e){var r=_a(n)?ne:pe,i=arguments.length<3;return r(n,Ru(t,4),e,i,Dr)},hr.reduceRight=function(n,t,e){var r=_a(n)?te:pe,i=arguments.length<3;return r(n,Ru(t,4),e,i,Hr)},hr.repeat=function(n,t,e){return t=(e?Vu(n,t,e):t===r)?1:Wa(t),Si(Fa(n),t)},hr.replace=function(){var n=arguments,t=Fa(n[0]);return n.length<3?t:t.replace(n[1],n[2])},hr.result=function(n,t,e){var i=-1,u=(t=Vi(t,n)).length;for(u||(u=1,n=r);++iU)return[];var e=R,r=Ve(n,R);t=Ru(t),n-=R;for(var i=ve(r,t);++e=o)return n;var c=e-Ee(i);if(c<1)return i;var l=a?Gi(a,0,c).join(""):n.slice(0,c);if(u===r)return l+i;if(a&&(c+=l.length-c),Ua(u)){if(n.slice(c).search(u)){var f,s=l;for(u.global||(u=rt(u.source,Fa(Bn.exec(u))+"g")),u.lastIndex=0;f=u.exec(s);)var p=f.index;l=l.slice(0,p===r?c:p)}}else if(n.indexOf(zi(u),c)!=c){var h=l.lastIndexOf(u);h>-1&&(l=l.slice(0,h))}return l+i},hr.unescape=function(n){return(n=Fa(n))&&xn.test(n)?n.replace(wn,Oe):n},hr.uniqueId=function(n){var t=++pt;return Fa(n)+t},hr.upperCase=Sc,hr.upperFirst=xc,hr.each=Fo,hr.eachRight=Vo,hr.first=mo,Lc(hr,(Gc={},Zr(hr,function(n,t){st.call(hr.prototype,t)||(Gc[t]=n)}),Gc),{chain:!1}),hr.VERSION="4.17.11",Vt(["bind","bindKey","curry","curryRight","partial","partialRight"],function(n){hr[n].placeholder=hr}),Vt(["drop","take"],function(n,t){_r.prototype[n]=function(e){e=e===r?1:Fe(Wa(e),0);var i=this.__filtered__&&!t?new _r(this):this.clone();return i.__filtered__?i.__takeCount__=Ve(e,i.__takeCount__):i.__views__.push({size:Ve(e,R),type:n+(i.__dir__<0?"Right":"")}),i},_r.prototype[n+"Right"]=function(t){return this.reverse()[n](t).reverse()}}),Vt(["filter","map","takeWhile"],function(n,t){var e=t+1,r=e==E||3==e;_r.prototype[n]=function(n){var t=this.clone();return t.__iteratees__.push({iteratee:Ru(n,3),type:e}),t.__filtered__=t.__filtered__||r,t}}),Vt(["head","last"],function(n,t){var e="take"+(t?"Right":"");_r.prototype[n]=function(){return this[e](1).value()[0]}}),Vt(["initial","tail"],function(n,t){var e="drop"+(t?"":"Right");_r.prototype[n]=function(){return this.__filtered__?new _r(this):this[e](1)}}),_r.prototype.compact=function(){return this.filter(Ic)},_r.prototype.find=function(n){return this.filter(n).head()},_r.prototype.findLast=function(n){return this.reverse().find(n)},_r.prototype.invokeMap=xi(function(n,t){return"function"==typeof n?new _r(this):this.map(function(e){return ri(e,n,t)})}),_r.prototype.reject=function(n){return this.filter(ca(Ru(n)))},_r.prototype.slice=function(n,t){n=Wa(n);var e=this;return e.__filtered__&&(n>0||t<0)?new _r(e):(n<0?e=e.takeRight(-n):n&&(e=e.drop(n)),t!==r&&(e=(t=Wa(t))<0?e.dropRight(-t):e.take(t-n)),e)},_r.prototype.takeRightWhile=function(n){return this.reverse().takeWhile(n).reverse()},_r.prototype.toArray=function(){return this.take(R)},Zr(_r.prototype,function(n,t){var e=/^(?:filter|find|map|reject)|While$/.test(t),i=/^(?:head|last)$/.test(t),u=hr[i?"take"+("last"==t?"Right":""):t],o=i||/^find/.test(t);u&&(hr.prototype[t]=function(){var t=this.__wrapped__,a=i?[1]:arguments,c=t instanceof _r,l=a[0],f=c||_a(t),s=function(n){var t=u.apply(hr,Qt([n],a));return i&&p?t[0]:t};f&&e&&"function"==typeof l&&1!=l.length&&(c=f=!1);var p=this.__chain__,h=!!this.__actions__.length,v=o&&!p,d=c&&!h;if(!o&&f){t=d?t:new _r(this);var g=n.apply(t,a);return g.__actions__.push({func:Ho,args:[s],thisArg:r}),new gr(g,p)}return v&&d?n.apply(this,a):(g=this.thru(s),v?i?g.value()[0]:g.value():g)})}),Vt(["pop","push","shift","sort","splice","unshift"],function(n){var t=ot[n],e=/^(?:push|sort|unshift)$/.test(n)?"tap":"thru",r=/^(?:pop|shift)$/.test(n);hr.prototype[n]=function(){var n=arguments;if(r&&!this.__chain__){var i=this.value();return t.apply(_a(i)?i:[],n)}return this[e](function(e){return t.apply(_a(e)?e:[],n)})}}),Zr(_r.prototype,function(n,t){var e=hr[t];if(e){var r=e.name+"";(ir[r]||(ir[r]=[])).push({name:t,func:e})}}),ir[hu(r,g).name]=[{name:"wrapper",func:r}],_r.prototype.clone=function(){var n=new _r(this.__wrapped__);return n.__actions__=eu(this.__actions__),n.__dir__=this.__dir__,n.__filtered__=this.__filtered__,n.__iteratees__=eu(this.__iteratees__),n.__takeCount__=this.__takeCount__,n.__views__=eu(this.__views__),n},_r.prototype.reverse=function(){if(this.__filtered__){var n=new _r(this);n.__dir__=-1,n.__filtered__=!0}else(n=this.clone()).__dir__*=-1;return n},_r.prototype.value=function(){var n=this.__wrapped__.value(),t=this.__dir__,e=_a(n),r=t<0,i=e?n.length:0,u=function(n,t,e){for(var r=-1,i=e.length;++r=this.__values__.length;return{done:n,value:n?r:this.__values__[this.__index__++]}},hr.prototype.plant=function(n){for(var t,e=this;e instanceof dr;){var i=so(e);i.__index__=0,i.__values__=r,t?u.__wrapped__=i:t=i;var u=i;e=e.__wrapped__}return u.__wrapped__=n,t},hr.prototype.reverse=function(){var n=this.__wrapped__;if(n instanceof _r){var t=n;return this.__actions__.length&&(t=new _r(this)),(t=t.reverse()).__actions__.push({func:Ho,args:[ko],thisArg:r}),new gr(t,this.__chain__)}return this.thru(ko)},hr.prototype.toJSON=hr.prototype.valueOf=hr.prototype.value=function(){return Wi(this.__wrapped__,this.__actions__)},hr.prototype.first=hr.prototype.head,se&&(hr.prototype[se]=function(){return this}),hr}();"function"==typeof define&&"object"==typeof define.amd&&define.amd?(Ut._=Ue,define(function(){return Ue})):Lt?((Lt.exports=Ue)._=Ue,Ct._=Ue):Ut._=Ue}).call(this)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}]},{},[1]); \ No newline at end of file +!function(){return function n(t,e,r){function i(o,a){if(!e[o]){if(!t[o]){var c="function"==typeof require&&require;if(!a&&c)return c(o,!0);if(u)return u(o,!0);var l=new Error("Cannot find module '"+o+"'");throw l.code="MODULE_NOT_FOUND",l}var f=e[o]={exports:{}};t[o][0].call(f.exports,function(n){return i(t[o][1][n]||n)},f,f.exports,n,t,e,r)}return e[o].exports}for(var u="function"==typeof require&&require,o=0;o'+n[e].name+"");t.append(''),t.selectize({sortField:"text"})}sequencer=ImageSequencer(),n(),$(window).on("scroll",function(){var n=$("body").scrollTop()>20||$(":root").scrollTop()>20;$("#move-up").css({display:n?"block":"none"})}),$("#move-up").on("click",function(){$("body").animate({scrollTop:0}),$(":root").animate({scrollTop:0})}),sequencer.setUI(o(sequencer));var t=r(sequencer);a.getUrlHashParameter("src")?sequencer.loadImage(a.getUrlHashParameter("src"),t.onLoad):sequencer.loadImage("images/tulips.png",t.onLoad);$("#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="/")}),$(".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),$("#save-seq").click(()=>{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()},1e3),n())});var e=!1;$(".js-view-as-gif").on("click",function(n){if(!e){e=!0;var t=n.target;t.disabled=!0,t.innerHTML='';try{for(var r=document.getElementsByClassName("step-thumbnail"),i=[],u=0;u{console.log(t),"installed"===t.state&&location.reload()}),console.log("Registration successful, scope is:",n.scope)}).catch(function(n){console.log("Service worker registration failed, error:",n)}),"serviceWorker"in navigator&&caches.keys().then(function(n){n.forEach(function(n){$("#clear-cache").append(" "+n)})}),$("#clear-cache").click(function(){"serviceWorker"in navigator&&caches.keys().then(function(n){n.forEach(function(n){caches.delete(n)})}),location.reload()})}},{}],3:[function(n,t,e){var r=n("./urlHash.js");t.exports=function(n,t){var e=(t=t||{}).addStepSel=t.addStepSel||"#addStep",i=t.removeStepSel=t.removeStepSel||"button.remove";function u(){var t=r.getUrlHashParameter("steps");t&&(n.importString(t),n.run({index:0})),r.setUrlHashParameter("steps",sequencer.toString())}function o(){sequencer.steps.length<2?$(" #save-seq").prop("disabled",!0):$(" #save-seq").prop("disabled",!1)}return t.selectStepSel=t.selectStepSel||"#selectStep",{onLoad:function(){u(),"none"===$("#selectStep").val()&&$(e+" #add-step-btn").prop("disabled",!0),o()},importStepsFromUrlHash:u,selectNewStepUi:function(){var t=$(e+" select").val();t||(t=arguments[0]),$(e+" .info").html(n.modulesInfo(t).description),$(e+" #add-step-btn").prop("disabled",!1)},removeStepUi:function(){var n=$(i).index(this)+1;sequencer.removeSteps(n).run({index:n-1}),r.setUrlHashParameter("steps",sequencer.toString()),o()},addStepUi:function(){if("none"!=$(e+" select").val()){var i;i="string"!=typeof arguments[0]?$(e+" select option").html().toLowerCase().split(" ").join("-"):arguments[0];var u=1;sequencer.sequences[i]?u=sequencer.sequences[i].length:sequencer.modules[i][1].length&&(u=sequencer.modules[i][1].length),n.addSteps(i,t).run({index:n.steps.length-u-1}),$(e+" .info").html("Select a new module to add to your sequence."),$(e+" select").val("none"),o(),r.setUrlHashParameter("steps",n.toString())}}}}},{"./urlHash.js":8}],4:[function(n,t,e){var r=n("./intermediateHtmlStepUi.js"),i=n("./urlHash.js"),u=n("lodash"),o=n("./mapHtmltypes");function a(n,t){var e=(t=t||{}).stepsEl||document.querySelector("#steps");t.selectStepSel=t.selectStepSel||"#selectStep";function a(n){var t=$(n.imgElement);t.mousemove(function(n){var e=document.createElement("canvas");e.width=t.width(),e.height=t.height();var r=e.getContext("2d");r.drawImage(this,0,0);var i=$(this).offset(),u=n.pageX-i.left,o=n.pageY-i.top,a=r.getImageData(u,o,1,1);t[0].title="rgb: "+a.data[0]+","+a.data[1]+","+a.data[2]})}function c(n,t){if(0==$("#"+t).length){var e=document.createElement("span");e.innerHTML=' '+n,e.id=t,e.classList.add("notification"),$("body").append(e)}$("#"+t).fadeIn(500).delay(200).fadeOut(500)}return{getPreview:function(){return step.imgElement},onSetup:function(t,l){t.options&&t.options.description&&(t.description=t.options.description),t.ui='

'+t.name+'

'+(t.description||"")+'

';var f=r(n,t),s=new DOMParser;if(t.ui=s.parseFromString(t.ui,"text/html"),t.ui=t.ui.querySelector("div.container-fluid"),t.linkElements=t.ui.querySelectorAll("a"),t.imgElement=t.ui.querySelector("a img.img-thumbnail"),n.modulesInfo().hasOwnProperty(t.name)){var p=n.modulesInfo(t.name).inputs,h=n.modulesInfo(t.name).outputs,v=Object.assign(p,h);for(var d in v){var g=p.hasOwnProperty(d),_="",y=g?o(p[d]):{};if(g)if("select"==y.type.toLowerCase()){for(var m in _+='"}else{let n=t.options[d]||y.default;_=''+n+"":_+='">'}else _+='';var b=document.createElement("div");b.className="row",b.setAttribute("name",d);var w=p[d].desc||d;b.innerHTML="
"+_+"
",t.ui.querySelector("div.details").appendChild(b)}$(t.ui.querySelector("div.panel-footer")).append('
Press apply to see changes
'),$(t.ui.querySelector("div.panel-footer")).prepend(' ')}"load-image"!=t.name?(t.ui.querySelector("div.trash-container").prepend(s.parseFromString('
',"text/html").querySelector("div")),$(t.ui.querySelectorAll(".remove")).on("click",function(){c("Step Removed","remove-notification")}),$(t.ui.querySelectorAll(".insert-step")).on("click",function(){f.insertStep(t.ID)}),l.index==n.steps.length?(e.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)):e.insertBefore(t.ui,$(e).children()[l.index])):$("#load-image").append(t.ui),$(t.ui.querySelector(".toggle")).on("click",()=>{$(t.ui.querySelector(".toggleIcon")).toggleClass("rotated"),$(t.ui.querySelectorAll(".cal")).collapse("toggle")}),$(t.imgElement).on("mousemove",u.debounce(()=>a(t),150)),$(t.imgElement).on("click",n=>{n.preventDefault()});var S=0,x=!1;$(t.ui.querySelector(".input-form")).on("submit",function(e){e.preventDefault(),x&&($(t.ui.querySelector("div.details")).find("input,select").each(function(n,e){$(e).data("initValue",$(e).val()).data("hasChangedBefore",!1),t.options[$(e).attr("name")]=$(e).val()}),n.run({index:t.index-1}),i.setUrlHashParameter("steps",n.toString()),$(t.ui.querySelector(".btn-save")).prop("disabled",!0),x=!1,S=0)}),$(t.ui.querySelectorAll(".target")).each(function(n,e){$(e).data("initValue",$(e).val()).data("hasChangedBefore",!1).on("input change",function(){var n,e,r,i;$(this).focus().data("hasChangedBefore",(n=$(this).val(),e=$(this).data("initValue"),r=$(this).data("hasChangedBefore"),i=!(isNaN(e)||isNaN(n)?n===e:n-e==0),x=(S+=r?i?0:-1:i?1:0)>0,$(t.ui.querySelector(".btn-save")).prop("disabled",!x),i))})}),$('input[type="range"]').on("input",function(){$(this).next().html($(this).val())})},onComplete:function(t){$(t.ui.querySelector("img")).show(),$(t.ui.querySelectorAll(".load-spin")).hide(),$(t.ui.querySelector(".load")).hide(),t.imgElement.src="load-image"==t.name?t.output.src:t.output;var e=t.ui.querySelector(".img-thumbnail");for(let n=0;n{for(let e=0;e

Select a new module to add to your sequence.

Resize

Brightness

Contrast

Saturation

Rotate

Crop

';c=(new DOMParser).parseFromString(c,"text/html").querySelector("div"),$(t.ui.querySelector(".insertDiv")).length>0?o():(t.ui.querySelector("div.step").insertAdjacentElement("afterend",c),o(function(){i.updatePreviews(t.output,".insertDiv")})),$(t.ui.querySelector(".insertDiv .close-insert-box")).off("click").on("click",function(){o(function(){})});var l=$(t.ui.querySelector(".insert-step-select"));for(var f in l.html(""),r)void 0!==r[f]&&l.append('");l.selectize({sortField:"text"}),$(t.ui.querySelector(".inserDiv .add-step-btn")).prop("disabled",!0),l.append(''),$(t.ui.querySelector(".insertDiv .radio-group .radio")).on("click",function(){$(this).parent().find(".radio").removeClass("selected"),$(this).addClass("selected"),newStep=$(this).attr("data-value"),$(t.ui.querySelector(".insert-step-select")).val(newStep),u(),a(e),$(this).removeClass("selected")}),l.on("change",u),$(t.ui.querySelector(".insertDiv .add-step-btn")).on("click",function(){a(e)})},{insertStep:insertStep}}},{"./insertPreview.js":5,"./urlHash.js":8}],7:[function(n,t,e){t.exports=function(n){var t;switch(n.type.toLowerCase()){case"integer":t=void 0!=n.min?"range":"number";break;case"string":t="text";break;case"select":t="select";break;case"percentage":t="number";break;case"float":t=void 0!=n.min?"range":"text";break;default:t="text"}var e=n;return e.type=t,e}},{}],8:[function(n,t,e){function r(){var n=window.location.hash;n&&(n=n.split("#")[1]);var t={};return n.split("&").forEach(function(n,e){""!=(n=n.split("="))[0]&&(t[n[0]]=n[1])}),t}function i(n){var t=Object.keys(n),e=Object.values(n),r=[];t.forEach(function(n,i){""!=n&&r.push(t[i]+"="+e[i])});var i=r.join("&");window.location.hash=i}t.exports={getUrlHashParameter:function(n){return r()[n]},setUrlHashParameter:function(n,t){var e=r();e[n]=t,i(e)},getUrlHashParameters:r,setUrlHashParameters:i}},{}],9:[function(n,t,e){(function(n){(function(){var r,i=200,u="Unsupported core-js use. Try https://npms.io/search?q=ponyfill.",o="Expected a function",a="__lodash_hash_undefined__",c=500,l="__lodash_placeholder__",f=1,s=2,p=4,h=1,v=2,d=1,g=2,_=4,y=8,m=16,b=32,w=64,S=128,x=256,$=512,j=30,q="...",k=800,A=16,E=1,I=2,O=1/0,U=9007199254740991,C=1.7976931348623157e308,L=NaN,R=4294967295,z=R-1,P=R>>>1,D=[["ary",S],["bind",d],["bindKey",g],["curry",y],["curryRight",m],["flip",$],["partial",b],["partialRight",w],["rearg",x]],T="[object Arguments]",H="[object Array]",W="[object AsyncFunction]",B="[object Boolean]",M="[object Date]",N="[object DOMException]",F="[object Error]",V="[object Function]",Z="[object GeneratorFunction]",G="[object Map]",K="[object Number]",Y="[object Null]",J="[object Object]",X="[object Proxy]",Q="[object RegExp]",nn="[object Set]",tn="[object String]",en="[object Symbol]",rn="[object Undefined]",un="[object WeakMap]",on="[object WeakSet]",an="[object ArrayBuffer]",cn="[object DataView]",ln="[object Float32Array]",fn="[object Float64Array]",sn="[object Int8Array]",pn="[object Int16Array]",hn="[object Int32Array]",vn="[object Uint8Array]",dn="[object Uint8ClampedArray]",gn="[object Uint16Array]",_n="[object Uint32Array]",yn=/\b__p \+= '';/g,mn=/\b(__p \+=) '' \+/g,bn=/(__e\(.*?\)|\b__t\)) \+\n'';/g,wn=/&(?:amp|lt|gt|quot|#39);/g,Sn=/[&<>"']/g,xn=RegExp(wn.source),$n=RegExp(Sn.source),jn=/<%-([\s\S]+?)%>/g,qn=/<%([\s\S]+?)%>/g,kn=/<%=([\s\S]+?)%>/g,An=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,En=/^\w*$/,In=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,On=/[\\^$.*+?()[\]{}|]/g,Un=RegExp(On.source),Cn=/^\s+|\s+$/g,Ln=/^\s+/,Rn=/\s+$/,zn=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,Pn=/\{\n\/\* \[wrapped with (.+)\] \*/,Dn=/,? & /,Tn=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,Hn=/\\(\\)?/g,Wn=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,Bn=/\w*$/,Mn=/^[-+]0x[0-9a-f]+$/i,Nn=/^0b[01]+$/i,Fn=/^\[object .+?Constructor\]$/,Vn=/^0o[0-7]+$/i,Zn=/^(?:0|[1-9]\d*)$/,Gn=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,Kn=/($^)/,Yn=/['\n\r\u2028\u2029\\]/g,Jn="\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff",Xn="\\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",Qn="[\\ud800-\\udfff]",nt="["+Xn+"]",tt="["+Jn+"]",et="\\d+",rt="[\\u2700-\\u27bf]",it="[a-z\\xdf-\\xf6\\xf8-\\xff]",ut="[^\\ud800-\\udfff"+Xn+et+"\\u2700-\\u27bfa-z\\xdf-\\xf6\\xf8-\\xffA-Z\\xc0-\\xd6\\xd8-\\xde]",ot="\\ud83c[\\udffb-\\udfff]",at="[^\\ud800-\\udfff]",ct="(?:\\ud83c[\\udde6-\\uddff]){2}",lt="[\\ud800-\\udbff][\\udc00-\\udfff]",ft="[A-Z\\xc0-\\xd6\\xd8-\\xde]",st="(?:"+it+"|"+ut+")",pt="(?:"+ft+"|"+ut+")",ht="(?:"+tt+"|"+ot+")"+"?",vt="[\\ufe0e\\ufe0f]?"+ht+("(?:\\u200d(?:"+[at,ct,lt].join("|")+")[\\ufe0e\\ufe0f]?"+ht+")*"),dt="(?:"+[rt,ct,lt].join("|")+")"+vt,gt="(?:"+[at+tt+"?",tt,ct,lt,Qn].join("|")+")",_t=RegExp("['’]","g"),yt=RegExp(tt,"g"),mt=RegExp(ot+"(?="+ot+")|"+gt+vt,"g"),bt=RegExp([ft+"?"+it+"+(?:['’](?:d|ll|m|re|s|t|ve))?(?="+[nt,ft,"$"].join("|")+")",pt+"+(?:['’](?:D|LL|M|RE|S|T|VE))?(?="+[nt,ft+st,"$"].join("|")+")",ft+"?"+st+"+(?:['’](?:d|ll|m|re|s|t|ve))?",ft+"+(?:['’](?:D|LL|M|RE|S|T|VE))?","\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])","\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",et,dt].join("|"),"g"),wt=RegExp("[\\u200d\\ud800-\\udfff"+Jn+"\\ufe0e\\ufe0f]"),St=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,xt=["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"],$t=-1,jt={};jt[ln]=jt[fn]=jt[sn]=jt[pn]=jt[hn]=jt[vn]=jt[dn]=jt[gn]=jt[_n]=!0,jt[T]=jt[H]=jt[an]=jt[B]=jt[cn]=jt[M]=jt[F]=jt[V]=jt[G]=jt[K]=jt[J]=jt[Q]=jt[nn]=jt[tn]=jt[un]=!1;var qt={};qt[T]=qt[H]=qt[an]=qt[cn]=qt[B]=qt[M]=qt[ln]=qt[fn]=qt[sn]=qt[pn]=qt[hn]=qt[G]=qt[K]=qt[J]=qt[Q]=qt[nn]=qt[tn]=qt[en]=qt[vn]=qt[dn]=qt[gn]=qt[_n]=!0,qt[F]=qt[V]=qt[un]=!1;var kt={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},At=parseFloat,Et=parseInt,It="object"==typeof n&&n&&n.Object===Object&&n,Ot="object"==typeof self&&self&&self.Object===Object&&self,Ut=It||Ot||Function("return this")(),Ct="object"==typeof e&&e&&!e.nodeType&&e,Lt=Ct&&"object"==typeof t&&t&&!t.nodeType&&t,Rt=Lt&&Lt.exports===Ct,zt=Rt&&It.process,Pt=function(){try{var n=Lt&&Lt.require&&Lt.require("util").types;return n||zt&&zt.binding&&zt.binding("util")}catch(n){}}(),Dt=Pt&&Pt.isArrayBuffer,Tt=Pt&&Pt.isDate,Ht=Pt&&Pt.isMap,Wt=Pt&&Pt.isRegExp,Bt=Pt&&Pt.isSet,Mt=Pt&&Pt.isTypedArray;function Nt(n,t,e){switch(e.length){case 0:return n.call(t);case 1:return n.call(t,e[0]);case 2:return n.call(t,e[0],e[1]);case 3:return n.call(t,e[0],e[1],e[2])}return n.apply(t,e)}function Ft(n,t,e,r){for(var i=-1,u=null==n?0:n.length;++i-1}function Jt(n,t,e){for(var r=-1,i=null==n?0:n.length;++r-1;);return e}function me(n,t){for(var e=n.length;e--&&oe(t,n[e],0)>-1;);return e}var be=se({"À":"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"}),we=se({"&":"&","<":"<",">":">",'"':""","'":"'"});function Se(n){return"\\"+kt[n]}function xe(n){return wt.test(n)}function $e(n){var t=-1,e=Array(n.size);return n.forEach(function(n,r){e[++t]=[r,n]}),e}function je(n,t){return function(e){return n(t(e))}}function qe(n,t){for(var e=-1,r=n.length,i=0,u=[];++e",""":'"',"'":"'"});var Ue=function n(t){var e,Jn=(t=null==t?Ut:Ue.defaults(Ut.Object(),t,Ue.pick(Ut,xt))).Array,Xn=t.Date,Qn=t.Error,nt=t.Function,tt=t.Math,et=t.Object,rt=t.RegExp,it=t.String,ut=t.TypeError,ot=Jn.prototype,at=nt.prototype,ct=et.prototype,lt=t["__core-js_shared__"],ft=at.toString,st=ct.hasOwnProperty,pt=0,ht=(e=/[^.]+$/.exec(lt&<.keys&<.keys.IE_PROTO||""))?"Symbol(src)_1."+e:"",vt=ct.toString,dt=ft.call(et),gt=Ut._,mt=rt("^"+ft.call(st).replace(On,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),wt=Rt?t.Buffer:r,kt=t.Symbol,It=t.Uint8Array,Ot=wt?wt.allocUnsafe:r,Ct=je(et.getPrototypeOf,et),Lt=et.create,zt=ct.propertyIsEnumerable,Pt=ot.splice,re=kt?kt.isConcatSpreadable:r,se=kt?kt.iterator:r,Ce=kt?kt.toStringTag:r,Le=function(){try{var n=Du(et,"defineProperty");return n({},"",{}),n}catch(n){}}(),Re=t.clearTimeout!==Ut.clearTimeout&&t.clearTimeout,ze=Xn&&Xn.now!==Ut.Date.now&&Xn.now,Pe=t.setTimeout!==Ut.setTimeout&&t.setTimeout,De=tt.ceil,Te=tt.floor,He=et.getOwnPropertySymbols,We=wt?wt.isBuffer:r,Be=t.isFinite,Me=ot.join,Ne=je(et.keys,et),Fe=tt.max,Ve=tt.min,Ze=Xn.now,Ge=t.parseInt,Ke=tt.random,Ye=ot.reverse,Je=Du(t,"DataView"),Xe=Du(t,"Map"),Qe=Du(t,"Promise"),nr=Du(t,"Set"),tr=Du(t,"WeakMap"),er=Du(et,"create"),rr=tr&&new tr,ir={},ur=fo(Je),or=fo(Xe),ar=fo(Qe),cr=fo(nr),lr=fo(tr),fr=kt?kt.prototype:r,sr=fr?fr.valueOf:r,pr=fr?fr.toString:r;function hr(n){if(Aa(n)&&!_a(n)&&!(n instanceof _r)){if(n instanceof gr)return n;if(st.call(n,"__wrapped__"))return so(n)}return new gr(n)}var vr=function(){function n(){}return function(t){if(!ka(t))return{};if(Lt)return Lt(t);n.prototype=t;var e=new n;return n.prototype=r,e}}();function dr(){}function gr(n,t){this.__wrapped__=n,this.__actions__=[],this.__chain__=!!t,this.__index__=0,this.__values__=r}function _r(n){this.__wrapped__=n,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=R,this.__views__=[]}function yr(n){var t=-1,e=null==n?0:n.length;for(this.clear();++t=t?n:t)),n}function Rr(n,t,e,i,u,o){var a,c=t&f,l=t&s,h=t&p;if(e&&(a=u?e(n,i,u,o):e(n)),a!==r)return a;if(!ka(n))return n;var v=_a(n);if(v){if(a=function(n){var t=n.length,e=new n.constructor(t);return t&&"string"==typeof n[0]&&st.call(n,"index")&&(e.index=n.index,e.input=n.input),e}(n),!c)return eu(n,a)}else{var d=Wu(n),g=d==V||d==Z;if(wa(n))return Yi(n,c);if(d==J||d==T||g&&!u){if(a=l||g?{}:Mu(n),!c)return l?function(n,t){return ru(n,Hu(n),t)}(n,function(n,t){return n&&ru(t,uc(t),n)}(a,n)):function(n,t){return ru(n,Tu(n),t)}(n,Or(a,n))}else{if(!qt[d])return u?n:{};a=function(n,t,e){var r,i,u,o=n.constructor;switch(t){case an:return Ji(n);case B:case M:return new o(+n);case cn:return function(n,t){var e=t?Ji(n.buffer):n.buffer;return new n.constructor(e,n.byteOffset,n.byteLength)}(n,e);case ln:case fn:case sn:case pn:case hn:case vn:case dn:case gn:case _n:return Xi(n,e);case G:return new o;case K:case tn:return new o(n);case Q:return(u=new(i=n).constructor(i.source,Bn.exec(i))).lastIndex=i.lastIndex,u;case nn:return new o;case en:return r=n,sr?et(sr.call(r)):{}}}(n,d,c)}}o||(o=new Sr);var _=o.get(n);if(_)return _;if(o.set(n,a),Ca(n))return n.forEach(function(r){a.add(Rr(r,t,e,r,n,o))}),a;if(Ea(n))return n.forEach(function(r,i){a.set(i,Rr(r,t,e,i,n,o))}),a;var y=v?r:(h?l?Ou:Iu:l?uc:ic)(n);return Vt(y||n,function(r,i){y&&(r=n[i=r]),Ar(a,i,Rr(r,t,e,i,n,o))}),a}function zr(n,t,e){var i=e.length;if(null==n)return!i;for(n=et(n);i--;){var u=e[i],o=t[u],a=n[u];if(a===r&&!(u in n)||!o(a))return!1}return!0}function Pr(n,t,e){if("function"!=typeof n)throw new ut(o);return ro(function(){n.apply(r,e)},t)}function Dr(n,t,e,r){var u=-1,o=Yt,a=!0,c=n.length,l=[],f=t.length;if(!c)return l;e&&(t=Xt(t,de(e))),r?(o=Jt,a=!1):t.length>=i&&(o=_e,a=!1,t=new wr(t));n:for(;++u-1},mr.prototype.set=function(n,t){var e=this.__data__,r=Er(e,n);return r<0?(++this.size,e.push([n,t])):e[r][1]=t,this},br.prototype.clear=function(){this.size=0,this.__data__={hash:new yr,map:new(Xe||mr),string:new yr}},br.prototype.delete=function(n){var t=zu(this,n).delete(n);return this.size-=t?1:0,t},br.prototype.get=function(n){return zu(this,n).get(n)},br.prototype.has=function(n){return zu(this,n).has(n)},br.prototype.set=function(n,t){var e=zu(this,n),r=e.size;return e.set(n,t),this.size+=e.size==r?0:1,this},wr.prototype.add=wr.prototype.push=function(n){return this.__data__.set(n,a),this},wr.prototype.has=function(n){return this.__data__.has(n)},Sr.prototype.clear=function(){this.__data__=new mr,this.size=0},Sr.prototype.delete=function(n){var t=this.__data__,e=t.delete(n);return this.size=t.size,e},Sr.prototype.get=function(n){return this.__data__.get(n)},Sr.prototype.has=function(n){return this.__data__.has(n)},Sr.prototype.set=function(n,t){var e=this.__data__;if(e instanceof mr){var r=e.__data__;if(!Xe||r.length0&&e(a)?t>1?Nr(a,t-1,e,r,i):Qt(i,a):r||(i[i.length]=a)}return i}var Fr=au(),Vr=au(!0);function Zr(n,t){return n&&Fr(n,t,ic)}function Gr(n,t){return n&&Vr(n,t,ic)}function Kr(n,t){return Kt(t,function(t){return $a(n[t])})}function Yr(n,t){for(var e=0,i=(t=Vi(t,n)).length;null!=n&&et}function ni(n,t){return null!=n&&st.call(n,t)}function ti(n,t){return null!=n&&t in et(n)}function ei(n,t,e){for(var i=e?Jt:Yt,u=n[0].length,o=n.length,a=o,c=Jn(o),l=1/0,f=[];a--;){var s=n[a];a&&t&&(s=Xt(s,de(t))),l=Ve(s.length,l),c[a]=!e&&(t||u>=120&&s.length>=120)?new wr(a&&s):r}s=n[0];var p=-1,h=c[0];n:for(;++p=a)return c;var l=e[r];return c*("desc"==l?-1:1)}}return n.index-t.index}(n,t,e)})}function yi(n,t,e){for(var r=-1,i=t.length,u={};++r-1;)a!==n&&Pt.call(a,c,1),Pt.call(n,c,1);return n}function bi(n,t){for(var e=n?t.length:0,r=e-1;e--;){var i=t[e];if(e==r||i!==u){var u=i;Fu(i)?Pt.call(n,i,1):Di(n,i)}}return n}function wi(n,t){return n+Te(Ke()*(t-n+1))}function Si(n,t){var e="";if(!n||t<1||t>U)return e;do{t%2&&(e+=n),(t=Te(t/2))&&(n+=n)}while(t);return e}function xi(n,t){return io(Qu(n,t,Ic),n+"")}function $i(n){return $r(hc(n))}function ji(n,t){var e=hc(n);return ao(e,Lr(t,0,e.length))}function qi(n,t,e,i){if(!ka(n))return n;for(var u=-1,o=(t=Vi(t,n)).length,a=o-1,c=n;null!=c&&++ui?0:i+t),(e=e>i?i:e)<0&&(e+=i),i=t>e?0:e-t>>>0,t>>>=0;for(var u=Jn(i);++r>>1,o=n[u];null!==o&&!Ra(o)&&(e?o<=t:o=i){var f=t?null:Su(n);if(f)return ke(f);a=!1,u=_e,l=new wr}else l=t?[]:c;n:for(;++r=i?n:Ii(n,t,e)}var Ki=Re||function(n){return Ut.clearTimeout(n)};function Yi(n,t){if(t)return n.slice();var e=n.length,r=Ot?Ot(e):new n.constructor(e);return n.copy(r),r}function Ji(n){var t=new n.constructor(n.byteLength);return new It(t).set(new It(n)),t}function Xi(n,t){var e=t?Ji(n.buffer):n.buffer;return new n.constructor(e,n.byteOffset,n.length)}function Qi(n,t){if(n!==t){var e=n!==r,i=null===n,u=n==n,o=Ra(n),a=t!==r,c=null===t,l=t==t,f=Ra(t);if(!c&&!f&&!o&&n>t||o&&a&&l&&!c&&!f||i&&a&&l||!e&&l||!u)return 1;if(!i&&!o&&!f&&n1?e[u-1]:r,a=u>2?e[2]:r;for(o=n.length>3&&"function"==typeof o?(u--,o):r,a&&Vu(e[0],e[1],a)&&(o=u<3?r:o,u=1),t=et(t);++i-1?u[o?t[a]:a]:r}}function pu(n){return Eu(function(t){var e=t.length,i=e,u=gr.prototype.thru;for(n&&t.reverse();i--;){var a=t[i];if("function"!=typeof a)throw new ut(o);if(u&&!c&&"wrapper"==Cu(a))var c=new gr([],!0)}for(i=c?i:e;++i1&&y.reverse(),s&&lc))return!1;var f=o.get(n);if(f&&o.get(t))return f==t;var s=-1,p=!0,d=e&v?new wr:r;for(o.set(n,t),o.set(t,n);++s-1&&n%1==0&&n1?"& ":"")+t[r],t=t.join(e>2?", ":" "),n.replace(zn,"{\n/* [wrapped with "+t+"] */\n")}(r,function(n,t){return Vt(D,function(e){var r="_."+e[0];t&e[1]&&!Yt(n,r)&&n.push(r)}),n.sort()}(function(n){var t=n.match(Pn);return t?t[1].split(Dn):[]}(r),e)))}function oo(n){var t=0,e=0;return function(){var i=Ze(),u=A-(i-e);if(e=i,u>0){if(++t>=k)return arguments[0]}else t=0;return n.apply(r,arguments)}}function ao(n,t){var e=-1,i=n.length,u=i-1;for(t=t===r?i:t;++e1?n[t-1]:r;return Uo(n,e="function"==typeof e?(n.pop(),e):r)});function To(n){var t=hr(n);return t.__chain__=!0,t}function Ho(n,t){return t(n)}var Wo=Eu(function(n){var t=n.length,e=t?n[0]:0,i=this.__wrapped__,u=function(t){return Cr(t,n)};return!(t>1||this.__actions__.length)&&i instanceof _r&&Fu(e)?((i=i.slice(e,+e+(t?1:0))).__actions__.push({func:Ho,args:[u],thisArg:r}),new gr(i,this.__chain__).thru(function(n){return t&&!n.length&&n.push(r),n})):this.thru(u)});var Bo=iu(function(n,t,e){st.call(n,e)?++n[e]:Ur(n,e,1)});var Mo=su(go),No=su(_o);function Fo(n,t){return(_a(n)?Vt:Tr)(n,Ru(t,3))}function Vo(n,t){return(_a(n)?Zt:Hr)(n,Ru(t,3))}var Zo=iu(function(n,t,e){st.call(n,e)?n[e].push(t):Ur(n,e,[t])});var Go=xi(function(n,t,e){var r=-1,i="function"==typeof t,u=ma(n)?Jn(n.length):[];return Tr(n,function(n){u[++r]=i?Nt(t,n,e):ri(n,t,e)}),u}),Ko=iu(function(n,t,e){Ur(n,e,t)});function Yo(n,t){return(_a(n)?Xt:pi)(n,Ru(t,3))}var Jo=iu(function(n,t,e){n[e?0:1].push(t)},function(){return[[],[]]});var Xo=xi(function(n,t){if(null==n)return[];var e=t.length;return e>1&&Vu(n,t[0],t[1])?t=[]:e>2&&Vu(t[0],t[1],t[2])&&(t=[t[0]]),_i(n,Nr(t,1),[])}),Qo=ze||function(){return Ut.Date.now()};function na(n,t,e){return t=e?r:t,t=n&&null==t?n.length:t,$u(n,S,r,r,r,r,t)}function ta(n,t){var e;if("function"!=typeof t)throw new ut(o);return n=Wa(n),function(){return--n>0&&(e=t.apply(this,arguments)),n<=1&&(t=r),e}}var ea=xi(function(n,t,e){var r=d;if(e.length){var i=qe(e,Lu(ea));r|=b}return $u(n,r,t,e,i)}),ra=xi(function(n,t,e){var r=d|g;if(e.length){var i=qe(e,Lu(ra));r|=b}return $u(t,r,n,e,i)});function ia(n,t,e){var i,u,a,c,l,f,s=0,p=!1,h=!1,v=!0;if("function"!=typeof n)throw new ut(o);function d(t){var e=i,o=u;return i=u=r,s=t,c=n.apply(o,e)}function g(n){var e=n-f;return f===r||e>=t||e<0||h&&n-s>=a}function _(){var n=Qo();if(g(n))return y(n);l=ro(_,function(n){var e=t-(n-f);return h?Ve(e,a-(n-s)):e}(n))}function y(n){return l=r,v&&i?d(n):(i=u=r,c)}function m(){var n=Qo(),e=g(n);if(i=arguments,u=this,f=n,e){if(l===r)return function(n){return s=n,l=ro(_,t),p?d(n):c}(f);if(h)return l=ro(_,t),d(f)}return l===r&&(l=ro(_,t)),c}return t=Ma(t)||0,ka(e)&&(p=!!e.leading,a=(h="maxWait"in e)?Fe(Ma(e.maxWait)||0,t):a,v="trailing"in e?!!e.trailing:v),m.cancel=function(){l!==r&&Ki(l),s=0,i=f=u=l=r},m.flush=function(){return l===r?c:y(Qo())},m}var ua=xi(function(n,t){return Pr(n,1,t)}),oa=xi(function(n,t,e){return Pr(n,Ma(t)||0,e)});function aa(n,t){if("function"!=typeof n||null!=t&&"function"!=typeof t)throw new ut(o);var e=function(){var r=arguments,i=t?t.apply(this,r):r[0],u=e.cache;if(u.has(i))return u.get(i);var o=n.apply(this,r);return e.cache=u.set(i,o)||u,o};return e.cache=new(aa.Cache||br),e}function ca(n){if("function"!=typeof n)throw new ut(o);return function(){var t=arguments;switch(t.length){case 0:return!n.call(this);case 1:return!n.call(this,t[0]);case 2:return!n.call(this,t[0],t[1]);case 3:return!n.call(this,t[0],t[1],t[2])}return!n.apply(this,t)}}aa.Cache=br;var la=Zi(function(n,t){var e=(t=1==t.length&&_a(t[0])?Xt(t[0],de(Ru())):Xt(Nr(t,1),de(Ru()))).length;return xi(function(r){for(var i=-1,u=Ve(r.length,e);++i=t}),ga=ii(function(){return arguments}())?ii:function(n){return Aa(n)&&st.call(n,"callee")&&!zt.call(n,"callee")},_a=Jn.isArray,ya=Dt?de(Dt):function(n){return Aa(n)&&Xr(n)==an};function ma(n){return null!=n&&qa(n.length)&&!$a(n)}function ba(n){return Aa(n)&&ma(n)}var wa=We||Mc,Sa=Tt?de(Tt):function(n){return Aa(n)&&Xr(n)==M};function xa(n){if(!Aa(n))return!1;var t=Xr(n);return t==F||t==N||"string"==typeof n.message&&"string"==typeof n.name&&!Oa(n)}function $a(n){if(!ka(n))return!1;var t=Xr(n);return t==V||t==Z||t==W||t==X}function ja(n){return"number"==typeof n&&n==Wa(n)}function qa(n){return"number"==typeof n&&n>-1&&n%1==0&&n<=U}function ka(n){var t=typeof n;return null!=n&&("object"==t||"function"==t)}function Aa(n){return null!=n&&"object"==typeof n}var Ea=Ht?de(Ht):function(n){return Aa(n)&&Wu(n)==G};function Ia(n){return"number"==typeof n||Aa(n)&&Xr(n)==K}function Oa(n){if(!Aa(n)||Xr(n)!=J)return!1;var t=Ct(n);if(null===t)return!0;var e=st.call(t,"constructor")&&t.constructor;return"function"==typeof e&&e instanceof e&&ft.call(e)==dt}var Ua=Wt?de(Wt):function(n){return Aa(n)&&Xr(n)==Q};var Ca=Bt?de(Bt):function(n){return Aa(n)&&Wu(n)==nn};function La(n){return"string"==typeof n||!_a(n)&&Aa(n)&&Xr(n)==tn}function Ra(n){return"symbol"==typeof n||Aa(n)&&Xr(n)==en}var za=Mt?de(Mt):function(n){return Aa(n)&&qa(n.length)&&!!jt[Xr(n)]};var Pa=mu(si),Da=mu(function(n,t){return n<=t});function Ta(n){if(!n)return[];if(ma(n))return La(n)?Ie(n):eu(n);if(se&&n[se])return function(n){for(var t,e=[];!(t=n.next()).done;)e.push(t.value);return e}(n[se]());var t=Wu(n);return(t==G?$e:t==nn?ke:hc)(n)}function Ha(n){return n?(n=Ma(n))===O||n===-O?(n<0?-1:1)*C:n==n?n:0:0===n?n:0}function Wa(n){var t=Ha(n),e=t%1;return t==t?e?t-e:t:0}function Ba(n){return n?Lr(Wa(n),0,R):0}function Ma(n){if("number"==typeof n)return n;if(Ra(n))return L;if(ka(n)){var t="function"==typeof n.valueOf?n.valueOf():n;n=ka(t)?t+"":t}if("string"!=typeof n)return 0===n?n:+n;n=n.replace(Cn,"");var e=Nn.test(n);return e||Vn.test(n)?Et(n.slice(2),e?2:8):Mn.test(n)?L:+n}function Na(n){return ru(n,uc(n))}function Fa(n){return null==n?"":zi(n)}var Va=uu(function(n,t){if(Yu(t)||ma(t))ru(t,ic(t),n);else for(var e in t)st.call(t,e)&&Ar(n,e,t[e])}),Za=uu(function(n,t){ru(t,uc(t),n)}),Ga=uu(function(n,t,e,r){ru(t,uc(t),n,r)}),Ka=uu(function(n,t,e,r){ru(t,ic(t),n,r)}),Ya=Eu(Cr);var Ja=xi(function(n,t){n=et(n);var e=-1,i=t.length,u=i>2?t[2]:r;for(u&&Vu(t[0],t[1],u)&&(i=1);++e1),t}),ru(n,Ou(n),e),r&&(e=Rr(e,f|s|p,ku));for(var i=t.length;i--;)Di(e,t[i]);return e});var lc=Eu(function(n,t){return null==n?{}:function(n,t){return yi(n,t,function(t,e){return nc(n,e)})}(n,t)});function fc(n,t){if(null==n)return{};var e=Xt(Ou(n),function(n){return[n]});return t=Ru(t),yi(n,e,function(n,e){return t(n,e[0])})}var sc=xu(ic),pc=xu(uc);function hc(n){return null==n?[]:ge(n,ic(n))}var vc=lu(function(n,t,e){return t=t.toLowerCase(),n+(e?dc(t):t)});function dc(n){return xc(Fa(n).toLowerCase())}function gc(n){return(n=Fa(n))&&n.replace(Gn,be).replace(yt,"")}var _c=lu(function(n,t,e){return n+(e?"-":"")+t.toLowerCase()}),yc=lu(function(n,t,e){return n+(e?" ":"")+t.toLowerCase()}),mc=cu("toLowerCase");var bc=lu(function(n,t,e){return n+(e?"_":"")+t.toLowerCase()});var wc=lu(function(n,t,e){return n+(e?" ":"")+xc(t)});var Sc=lu(function(n,t,e){return n+(e?" ":"")+t.toUpperCase()}),xc=cu("toUpperCase");function $c(n,t,e){return n=Fa(n),(t=e?r:t)===r?function(n){return St.test(n)}(n)?function(n){return n.match(bt)||[]}(n):function(n){return n.match(Tn)||[]}(n):n.match(t)||[]}var jc=xi(function(n,t){try{return Nt(n,r,t)}catch(n){return xa(n)?n:new Qn(n)}}),qc=Eu(function(n,t){return Vt(t,function(t){t=lo(t),Ur(n,t,ea(n[t],n))}),n});function kc(n){return function(){return n}}var Ac=pu(),Ec=pu(!0);function Ic(n){return n}function Oc(n){return ci("function"==typeof n?n:Rr(n,f))}var Uc=xi(function(n,t){return function(e){return ri(e,n,t)}}),Cc=xi(function(n,t){return function(e){return ri(n,e,t)}});function Lc(n,t,e){var r=ic(t),i=Kr(t,r);null!=e||ka(t)&&(i.length||!r.length)||(e=t,t=n,n=this,i=Kr(t,ic(t)));var u=!(ka(e)&&"chain"in e&&!e.chain),o=$a(n);return Vt(i,function(e){var r=t[e];n[e]=r,o&&(n.prototype[e]=function(){var t=this.__chain__;if(u||t){var e=n(this.__wrapped__);return(e.__actions__=eu(this.__actions__)).push({func:r,args:arguments,thisArg:n}),e.__chain__=t,e}return r.apply(n,Qt([this.value()],arguments))})}),n}function Rc(){}var zc=gu(Xt),Pc=gu(Gt),Dc=gu(ee);function Tc(n){return Zu(n)?fe(lo(n)):function(n){return function(t){return Yr(t,n)}}(n)}var Hc=yu(),Wc=yu(!0);function Bc(){return[]}function Mc(){return!1}var Nc=du(function(n,t){return n+t},0),Fc=wu("ceil"),Vc=du(function(n,t){return n/t},1),Zc=wu("floor");var Gc,Kc=du(function(n,t){return n*t},1),Yc=wu("round"),Jc=du(function(n,t){return n-t},0);return hr.after=function(n,t){if("function"!=typeof t)throw new ut(o);return n=Wa(n),function(){if(--n<1)return t.apply(this,arguments)}},hr.ary=na,hr.assign=Va,hr.assignIn=Za,hr.assignInWith=Ga,hr.assignWith=Ka,hr.at=Ya,hr.before=ta,hr.bind=ea,hr.bindAll=qc,hr.bindKey=ra,hr.castArray=function(){if(!arguments.length)return[];var n=arguments[0];return _a(n)?n:[n]},hr.chain=To,hr.chunk=function(n,t,e){t=(e?Vu(n,t,e):t===r)?1:Fe(Wa(t),0);var i=null==n?0:n.length;if(!i||t<1)return[];for(var u=0,o=0,a=Jn(De(i/t));uu?0:u+e),(i=i===r||i>u?u:Wa(i))<0&&(i+=u),i=e>i?0:Ba(i);e>>0)?(n=Fa(n))&&("string"==typeof t||null!=t&&!Ua(t))&&!(t=zi(t))&&xe(n)?Gi(Ie(n),0,e):n.split(t,e):[]},hr.spread=function(n,t){if("function"!=typeof n)throw new ut(o);return t=null==t?0:Fe(Wa(t),0),xi(function(e){var r=e[t],i=Gi(e,0,t);return r&&Qt(i,r),Nt(n,this,i)})},hr.tail=function(n){var t=null==n?0:n.length;return t?Ii(n,1,t):[]},hr.take=function(n,t,e){return n&&n.length?Ii(n,0,(t=e||t===r?1:Wa(t))<0?0:t):[]},hr.takeRight=function(n,t,e){var i=null==n?0:n.length;return i?Ii(n,(t=i-(t=e||t===r?1:Wa(t)))<0?0:t,i):[]},hr.takeRightWhile=function(n,t){return n&&n.length?Hi(n,Ru(t,3),!1,!0):[]},hr.takeWhile=function(n,t){return n&&n.length?Hi(n,Ru(t,3)):[]},hr.tap=function(n,t){return t(n),n},hr.throttle=function(n,t,e){var r=!0,i=!0;if("function"!=typeof n)throw new ut(o);return ka(e)&&(r="leading"in e?!!e.leading:r,i="trailing"in e?!!e.trailing:i),ia(n,t,{leading:r,maxWait:t,trailing:i})},hr.thru=Ho,hr.toArray=Ta,hr.toPairs=sc,hr.toPairsIn=pc,hr.toPath=function(n){return _a(n)?Xt(n,lo):Ra(n)?[n]:eu(co(Fa(n)))},hr.toPlainObject=Na,hr.transform=function(n,t,e){var r=_a(n),i=r||wa(n)||za(n);if(t=Ru(t,4),null==e){var u=n&&n.constructor;e=i?r?new u:[]:ka(n)&&$a(u)?vr(Ct(n)):{}}return(i?Vt:Zr)(n,function(n,r,i){return t(e,n,r,i)}),e},hr.unary=function(n){return na(n,1)},hr.union=Ao,hr.unionBy=Eo,hr.unionWith=Io,hr.uniq=function(n){return n&&n.length?Pi(n):[]},hr.uniqBy=function(n,t){return n&&n.length?Pi(n,Ru(t,2)):[]},hr.uniqWith=function(n,t){return t="function"==typeof t?t:r,n&&n.length?Pi(n,r,t):[]},hr.unset=function(n,t){return null==n||Di(n,t)},hr.unzip=Oo,hr.unzipWith=Uo,hr.update=function(n,t,e){return null==n?n:Ti(n,t,Fi(e))},hr.updateWith=function(n,t,e,i){return i="function"==typeof i?i:r,null==n?n:Ti(n,t,Fi(e),i)},hr.values=hc,hr.valuesIn=function(n){return null==n?[]:ge(n,uc(n))},hr.without=Co,hr.words=$c,hr.wrap=function(n,t){return fa(Fi(t),n)},hr.xor=Lo,hr.xorBy=Ro,hr.xorWith=zo,hr.zip=Po,hr.zipObject=function(n,t){return Mi(n||[],t||[],Ar)},hr.zipObjectDeep=function(n,t){return Mi(n||[],t||[],qi)},hr.zipWith=Do,hr.entries=sc,hr.entriesIn=pc,hr.extend=Za,hr.extendWith=Ga,Lc(hr,hr),hr.add=Nc,hr.attempt=jc,hr.camelCase=vc,hr.capitalize=dc,hr.ceil=Fc,hr.clamp=function(n,t,e){return e===r&&(e=t,t=r),e!==r&&(e=(e=Ma(e))==e?e:0),t!==r&&(t=(t=Ma(t))==t?t:0),Lr(Ma(n),t,e)},hr.clone=function(n){return Rr(n,p)},hr.cloneDeep=function(n){return Rr(n,f|p)},hr.cloneDeepWith=function(n,t){return Rr(n,f|p,t="function"==typeof t?t:r)},hr.cloneWith=function(n,t){return Rr(n,p,t="function"==typeof t?t:r)},hr.conformsTo=function(n,t){return null==t||zr(n,t,ic(t))},hr.deburr=gc,hr.defaultTo=function(n,t){return null==n||n!=n?t:n},hr.divide=Vc,hr.endsWith=function(n,t,e){n=Fa(n),t=zi(t);var i=n.length,u=e=e===r?i:Lr(Wa(e),0,i);return(e-=t.length)>=0&&n.slice(e,u)==t},hr.eq=ha,hr.escape=function(n){return(n=Fa(n))&&$n.test(n)?n.replace(Sn,we):n},hr.escapeRegExp=function(n){return(n=Fa(n))&&Un.test(n)?n.replace(On,"\\$&"):n},hr.every=function(n,t,e){var i=_a(n)?Gt:Wr;return e&&Vu(n,t,e)&&(t=r),i(n,Ru(t,3))},hr.find=Mo,hr.findIndex=go,hr.findKey=function(n,t){return ie(n,Ru(t,3),Zr)},hr.findLast=No,hr.findLastIndex=_o,hr.findLastKey=function(n,t){return ie(n,Ru(t,3),Gr)},hr.floor=Zc,hr.forEach=Fo,hr.forEachRight=Vo,hr.forIn=function(n,t){return null==n?n:Fr(n,Ru(t,3),uc)},hr.forInRight=function(n,t){return null==n?n:Vr(n,Ru(t,3),uc)},hr.forOwn=function(n,t){return n&&Zr(n,Ru(t,3))},hr.forOwnRight=function(n,t){return n&&Gr(n,Ru(t,3))},hr.get=Qa,hr.gt=va,hr.gte=da,hr.has=function(n,t){return null!=n&&Bu(n,t,ni)},hr.hasIn=nc,hr.head=mo,hr.identity=Ic,hr.includes=function(n,t,e,r){n=ma(n)?n:hc(n),e=e&&!r?Wa(e):0;var i=n.length;return e<0&&(e=Fe(i+e,0)),La(n)?e<=i&&n.indexOf(t,e)>-1:!!i&&oe(n,t,e)>-1},hr.indexOf=function(n,t,e){var r=null==n?0:n.length;if(!r)return-1;var i=null==e?0:Wa(e);return i<0&&(i=Fe(r+i,0)),oe(n,t,i)},hr.inRange=function(n,t,e){return t=Ha(t),e===r?(e=t,t=0):e=Ha(e),function(n,t,e){return n>=Ve(t,e)&&n=-U&&n<=U},hr.isSet=Ca,hr.isString=La,hr.isSymbol=Ra,hr.isTypedArray=za,hr.isUndefined=function(n){return n===r},hr.isWeakMap=function(n){return Aa(n)&&Wu(n)==un},hr.isWeakSet=function(n){return Aa(n)&&Xr(n)==on},hr.join=function(n,t){return null==n?"":Me.call(n,t)},hr.kebabCase=_c,hr.last=xo,hr.lastIndexOf=function(n,t,e){var i=null==n?0:n.length;if(!i)return-1;var u=i;return e!==r&&(u=(u=Wa(e))<0?Fe(i+u,0):Ve(u,i-1)),t==t?function(n,t,e){for(var r=e+1;r--;)if(n[r]===t)return r;return r}(n,t,u):ue(n,ce,u,!0)},hr.lowerCase=yc,hr.lowerFirst=mc,hr.lt=Pa,hr.lte=Da,hr.max=function(n){return n&&n.length?Br(n,Ic,Qr):r},hr.maxBy=function(n,t){return n&&n.length?Br(n,Ru(t,2),Qr):r},hr.mean=function(n){return le(n,Ic)},hr.meanBy=function(n,t){return le(n,Ru(t,2))},hr.min=function(n){return n&&n.length?Br(n,Ic,si):r},hr.minBy=function(n,t){return n&&n.length?Br(n,Ru(t,2),si):r},hr.stubArray=Bc,hr.stubFalse=Mc,hr.stubObject=function(){return{}},hr.stubString=function(){return""},hr.stubTrue=function(){return!0},hr.multiply=Kc,hr.nth=function(n,t){return n&&n.length?gi(n,Wa(t)):r},hr.noConflict=function(){return Ut._===this&&(Ut._=gt),this},hr.noop=Rc,hr.now=Qo,hr.pad=function(n,t,e){n=Fa(n);var r=(t=Wa(t))?Ee(n):0;if(!t||r>=t)return n;var i=(t-r)/2;return _u(Te(i),e)+n+_u(De(i),e)},hr.padEnd=function(n,t,e){n=Fa(n);var r=(t=Wa(t))?Ee(n):0;return t&&rt){var i=n;n=t,t=i}if(e||n%1||t%1){var u=Ke();return Ve(n+u*(t-n+At("1e-"+((u+"").length-1))),t)}return wi(n,t)},hr.reduce=function(n,t,e){var r=_a(n)?ne:pe,i=arguments.length<3;return r(n,Ru(t,4),e,i,Tr)},hr.reduceRight=function(n,t,e){var r=_a(n)?te:pe,i=arguments.length<3;return r(n,Ru(t,4),e,i,Hr)},hr.repeat=function(n,t,e){return t=(e?Vu(n,t,e):t===r)?1:Wa(t),Si(Fa(n),t)},hr.replace=function(){var n=arguments,t=Fa(n[0]);return n.length<3?t:t.replace(n[1],n[2])},hr.result=function(n,t,e){var i=-1,u=(t=Vi(t,n)).length;for(u||(u=1,n=r);++iU)return[];var e=R,r=Ve(n,R);t=Ru(t),n-=R;for(var i=ve(r,t);++e=o)return n;var c=e-Ee(i);if(c<1)return i;var l=a?Gi(a,0,c).join(""):n.slice(0,c);if(u===r)return l+i;if(a&&(c+=l.length-c),Ua(u)){if(n.slice(c).search(u)){var f,s=l;for(u.global||(u=rt(u.source,Fa(Bn.exec(u))+"g")),u.lastIndex=0;f=u.exec(s);)var p=f.index;l=l.slice(0,p===r?c:p)}}else if(n.indexOf(zi(u),c)!=c){var h=l.lastIndexOf(u);h>-1&&(l=l.slice(0,h))}return l+i},hr.unescape=function(n){return(n=Fa(n))&&xn.test(n)?n.replace(wn,Oe):n},hr.uniqueId=function(n){var t=++pt;return Fa(n)+t},hr.upperCase=Sc,hr.upperFirst=xc,hr.each=Fo,hr.eachRight=Vo,hr.first=mo,Lc(hr,(Gc={},Zr(hr,function(n,t){st.call(hr.prototype,t)||(Gc[t]=n)}),Gc),{chain:!1}),hr.VERSION="4.17.11",Vt(["bind","bindKey","curry","curryRight","partial","partialRight"],function(n){hr[n].placeholder=hr}),Vt(["drop","take"],function(n,t){_r.prototype[n]=function(e){e=e===r?1:Fe(Wa(e),0);var i=this.__filtered__&&!t?new _r(this):this.clone();return i.__filtered__?i.__takeCount__=Ve(e,i.__takeCount__):i.__views__.push({size:Ve(e,R),type:n+(i.__dir__<0?"Right":"")}),i},_r.prototype[n+"Right"]=function(t){return this.reverse()[n](t).reverse()}}),Vt(["filter","map","takeWhile"],function(n,t){var e=t+1,r=e==E||3==e;_r.prototype[n]=function(n){var t=this.clone();return t.__iteratees__.push({iteratee:Ru(n,3),type:e}),t.__filtered__=t.__filtered__||r,t}}),Vt(["head","last"],function(n,t){var e="take"+(t?"Right":"");_r.prototype[n]=function(){return this[e](1).value()[0]}}),Vt(["initial","tail"],function(n,t){var e="drop"+(t?"":"Right");_r.prototype[n]=function(){return this.__filtered__?new _r(this):this[e](1)}}),_r.prototype.compact=function(){return this.filter(Ic)},_r.prototype.find=function(n){return this.filter(n).head()},_r.prototype.findLast=function(n){return this.reverse().find(n)},_r.prototype.invokeMap=xi(function(n,t){return"function"==typeof n?new _r(this):this.map(function(e){return ri(e,n,t)})}),_r.prototype.reject=function(n){return this.filter(ca(Ru(n)))},_r.prototype.slice=function(n,t){n=Wa(n);var e=this;return e.__filtered__&&(n>0||t<0)?new _r(e):(n<0?e=e.takeRight(-n):n&&(e=e.drop(n)),t!==r&&(e=(t=Wa(t))<0?e.dropRight(-t):e.take(t-n)),e)},_r.prototype.takeRightWhile=function(n){return this.reverse().takeWhile(n).reverse()},_r.prototype.toArray=function(){return this.take(R)},Zr(_r.prototype,function(n,t){var e=/^(?:filter|find|map|reject)|While$/.test(t),i=/^(?:head|last)$/.test(t),u=hr[i?"take"+("last"==t?"Right":""):t],o=i||/^find/.test(t);u&&(hr.prototype[t]=function(){var t=this.__wrapped__,a=i?[1]:arguments,c=t instanceof _r,l=a[0],f=c||_a(t),s=function(n){var t=u.apply(hr,Qt([n],a));return i&&p?t[0]:t};f&&e&&"function"==typeof l&&1!=l.length&&(c=f=!1);var p=this.__chain__,h=!!this.__actions__.length,v=o&&!p,d=c&&!h;if(!o&&f){t=d?t:new _r(this);var g=n.apply(t,a);return g.__actions__.push({func:Ho,args:[s],thisArg:r}),new gr(g,p)}return v&&d?n.apply(this,a):(g=this.thru(s),v?i?g.value()[0]:g.value():g)})}),Vt(["pop","push","shift","sort","splice","unshift"],function(n){var t=ot[n],e=/^(?:push|sort|unshift)$/.test(n)?"tap":"thru",r=/^(?:pop|shift)$/.test(n);hr.prototype[n]=function(){var n=arguments;if(r&&!this.__chain__){var i=this.value();return t.apply(_a(i)?i:[],n)}return this[e](function(e){return t.apply(_a(e)?e:[],n)})}}),Zr(_r.prototype,function(n,t){var e=hr[t];if(e){var r=e.name+"";(ir[r]||(ir[r]=[])).push({name:t,func:e})}}),ir[hu(r,g).name]=[{name:"wrapper",func:r}],_r.prototype.clone=function(){var n=new _r(this.__wrapped__);return n.__actions__=eu(this.__actions__),n.__dir__=this.__dir__,n.__filtered__=this.__filtered__,n.__iteratees__=eu(this.__iteratees__),n.__takeCount__=this.__takeCount__,n.__views__=eu(this.__views__),n},_r.prototype.reverse=function(){if(this.__filtered__){var n=new _r(this);n.__dir__=-1,n.__filtered__=!0}else(n=this.clone()).__dir__*=-1;return n},_r.prototype.value=function(){var n=this.__wrapped__.value(),t=this.__dir__,e=_a(n),r=t<0,i=e?n.length:0,u=function(n,t,e){for(var r=-1,i=e.length;++r=this.__values__.length;return{done:n,value:n?r:this.__values__[this.__index__++]}},hr.prototype.plant=function(n){for(var t,e=this;e instanceof dr;){var i=so(e);i.__index__=0,i.__values__=r,t?u.__wrapped__=i:t=i;var u=i;e=e.__wrapped__}return u.__wrapped__=n,t},hr.prototype.reverse=function(){var n=this.__wrapped__;if(n instanceof _r){var t=n;return this.__actions__.length&&(t=new _r(this)),(t=t.reverse()).__actions__.push({func:Ho,args:[ko],thisArg:r}),new gr(t,this.__chain__)}return this.thru(ko)},hr.prototype.toJSON=hr.prototype.valueOf=hr.prototype.value=function(){return Wi(this.__wrapped__,this.__actions__)},hr.prototype.first=hr.prototype.head,se&&(hr.prototype[se]=function(){return this}),hr}();"function"==typeof define&&"object"==typeof define.amd&&define.amd?(Ut._=Ue,define(function(){return Ue})):Lt?((Lt.exports=Ue)._=Ue,Ct._=Ue):Ut._=Ue}).call(this)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}]},{},[1]); \ No newline at end of file diff --git a/dist/image-sequencer.js b/dist/image-sequencer.js index 6711d719..9829247b 100644 --- a/dist/image-sequencer.js +++ b/dist/image-sequencer.js @@ -83697,7 +83697,7 @@ arguments[4][69][0].apply(exports,arguments) },{"./support/isBuffer":199,"_process":139,"dup":69,"inherits":96}],201:[function(require,module,exports){ // add steps to the sequencer function AddStep(_sequencer, name, o) { - return require('./InsertStep')(_sequencer,-1,name,o); + return require('./InsertStep')(_sequencer, -1, name, o); } module.exports = AddStep; @@ -83774,15 +83774,15 @@ module.exports = function ExportBin(dir = './output/', ref, basic, filename) { },{"data-uri-to-buffer":18,"fs":72}],203:[function(require,module,exports){ function objTypeOf(object){ - return Object.prototype.toString.call(object).split(' ')[1].slice(0,-1); + return Object.prototype.toString.call(object).split(' ')[1].slice(0, -1); } function getPrimitive(object){ - return (objTypeOf(object)=='Array')?object[0]:object; + return (objTypeOf(object) == 'Array') ? object[0] : object; } function makeArray(input) { - return (objTypeOf(input)=='Array')?input:[input]; + return (objTypeOf(input) == 'Array') ? input : [input]; } function copy(a) { @@ -83798,7 +83798,7 @@ function copy(a) { return a; } -function formatInput(args,format,images) { +function formatInput(args, format, images) { var json_q = {}; var format_i = format; if (format == '+') @@ -83810,26 +83810,26 @@ function formatInput(args,format,images) { else if (format == 'r') format = ['o_number']; else if (format == 'l') - format = ['string','o_function']; + format = ['string', 'o_function']; - if(format[format.length-1] == 'o_object') { - if(objTypeOf(args[args.length-1]) != 'Object') + if(format[format.length - 1] == 'o_object') { + if(objTypeOf(args[args.length - 1]) != 'Object') args.push({}); } - else if (format[format.length-1] == 'o_number') { - if(typeof(args[args.length-1]) != 'number' && objTypeOf(args[0])!='Object') + else if (format[format.length - 1] == 'o_number') { + if(typeof(args[args.length - 1]) != 'number' && objTypeOf(args[0]) != 'Object') args.push(1); } - else if (format[format.length-1] == 'o_function') { - if(objTypeOf(args[args.length-1]) != 'Function' && objTypeOf(args[0])!='Object') + else if (format[format.length - 1] == 'o_function') { + if(objTypeOf(args[args.length - 1]) != 'Function' && objTypeOf(args[0]) != 'Object') args.push(function(){}); } if(args.length == format.length) {//making of arrays for (var i in format) { - if (format[i].substr(format[i].length-2,2)=='_a') + if (format[i].substr(format[i].length - 2, 2) == '_a') args[i] = makeArray(args[i]); } } @@ -83837,8 +83837,8 @@ function formatInput(args,format,images) { if (args.length == 1 ) { if(format_i == 'r') json_q = {0:copy(args[0])}; else if(format_i == '-') { - json_q=[]; - json_q= copy(args[0]); + json_q = []; + json_q = copy(args[0]); } } else if (format_i == 'r' ) { @@ -83865,8 +83865,8 @@ function formatInput(args,format,images) { if(format_i == '^') { var size = this.steps.length; var index = args[0]; - index = (index==size)?index:index%size; - if (index<0) index += size+1; + index = (index == size) ? index : index % size; + if (index < 0) index += size + 1; json_q.push({ index: index, name: args[1], @@ -84036,7 +84036,7 @@ ImageSequencer = function ImageSequencer(options) { sequencer.image = arguments[0]; for (var arg in arguments) args.push(copy(arguments[arg])); var json_q = formatInput.call(this, args, 'l'); - if(this.getSteps().length!=0){ + if(this.getSteps().length != 0){ this.options.sequencerCounter = 0; inputlog = []; this.steps = []; @@ -84053,9 +84053,9 @@ ImageSequencer = function ImageSequencer(options) { setUI: this.setUI }; function loadPrevSteps(ref){ - if(prevSteps.length!=0){ + if(prevSteps.length != 0){ ref.addSteps(prevSteps); - prevSteps=[]; + prevSteps = []; } } require('./ui/LoadImage')(sequencer, 'image', json_q.image, function() { @@ -84220,7 +84220,7 @@ ImageSequencer = function ImageSequencer(options) { }; module.exports = ImageSequencer; -},{"./AddStep":201,"./ExportBin":202,"./FormatInput":203,"./InsertStep":205,"./Modules":206,"./ReplaceImage":207,"./Run":208,"./SavedSequences.json":210,"./Strings.js":211,"./ui/LoadImage":351,"./ui/SetInputStep":352,"./ui/UserInterface":353,"./util/createMetaModule":355,"./util/getStep.js":357,"fs":72}],205:[function(require,module,exports){ +},{"./AddStep":201,"./ExportBin":202,"./FormatInput":203,"./InsertStep":205,"./Modules":206,"./ReplaceImage":207,"./Run":208,"./SavedSequences.json":210,"./Strings.js":211,"./ui/LoadImage":355,"./ui/SetInputStep":356,"./ui/UserInterface":357,"./util/createMetaModule":359,"./util/getStep.js":361,"fs":72}],205:[function(require,module,exports){ const getStepUtils = require('./util/getStep.js'); // insert one or more steps at a given index in the sequencer @@ -84244,6 +84244,7 @@ function InsertStep(ref, index, name, o) { o.number = ref.options.sequencerCounter++; //Gives a Unique ID to each step o.name = o_.name || name || moduleInfo.name; o.description = o_.description || moduleInfo.description; + o.moduleInfo = o_.moduleInfo || moduleInfo; o.selector = o_.selector || 'ismod-' + name; o.container = o_.container || ref.options.selector; o.inBrowser = ref.options.inBrowser; @@ -84253,6 +84254,7 @@ function InsertStep(ref, index, name, o) { o.step = { name: o.name, description: o.description, + moduleInfo: o.moduleInfo, ID: o.number, inBrowser: ref.options.inBrowser, ui: ref.options.ui, @@ -84287,7 +84289,7 @@ function InsertStep(ref, index, name, o) { } module.exports = InsertStep; -},{"./util/getStep.js":357}],206:[function(require,module,exports){ +},{"./util/getStep.js":361}],206:[function(require,module,exports){ /* * Core modules and their info files */ @@ -84321,8 +84323,9 @@ module.exports = { 'invert': require('image-sequencer-invert'), 'ndvi': require('./modules/Ndvi'), 'ndvi-colormap': require('./modules/NdviColormap'), - 'paint-bucket': require('./modules/PaintBucket'), + 'noise-reduction': require('./modules/NoiseReduction'), 'overlay': require('./modules/Overlay'), + 'paint-bucket': require('./modules/PaintBucket'), 'replace-color': require('./modules/ReplaceColor'), 'resize': require('./modules/Resize'), 'rotate': require('./modules/Rotate'), @@ -84334,10 +84337,10 @@ module.exports = { 'white-balance': require('./modules/WhiteBalance') }; -},{"./modules/AddQR":214,"./modules/Average":217,"./modules/Blend":220,"./modules/Blur":224,"./modules/Brightness":227,"./modules/CanvasResize":230,"./modules/Channel":233,"./modules/ColorTemperature":236,"./modules/Colorbar":239,"./modules/Colormap":243,"./modules/Contrast":247,"./modules/Convolution":251,"./modules/Crop":256,"./modules/DecodeQr":259,"./modules/Dither":263,"./modules/DrawRectangle":267,"./modules/Dynamic":270,"./modules/EdgeDetect":274,"./modules/Exposure":277,"./modules/FisheyeGl":280,"./modules/FlipImage":284,"./modules/GammaCorrection":287,"./modules/Gradient":290,"./modules/GridOverlay":294,"./modules/Histogram":297,"./modules/ImportImage":301,"./modules/Ndvi":305,"./modules/NdviColormap":308,"./modules/Overlay":311,"./modules/PaintBucket":315,"./modules/ReplaceColor":319,"./modules/Resize":322,"./modules/Rotate":325,"./modules/Saturation":328,"./modules/TextOverlay":332,"./modules/Threshold":336,"./modules/Tint":339,"./modules/WebglDistort":343,"./modules/WhiteBalance":346,"image-sequencer-invert":87}],207:[function(require,module,exports){ +},{"./modules/AddQR":214,"./modules/Average":217,"./modules/Blend":220,"./modules/Blur":224,"./modules/Brightness":227,"./modules/CanvasResize":230,"./modules/Channel":233,"./modules/ColorTemperature":236,"./modules/Colorbar":239,"./modules/Colormap":243,"./modules/Contrast":247,"./modules/Convolution":251,"./modules/Crop":256,"./modules/DecodeQr":259,"./modules/Dither":263,"./modules/DrawRectangle":267,"./modules/Dynamic":270,"./modules/EdgeDetect":274,"./modules/Exposure":277,"./modules/FisheyeGl":280,"./modules/FlipImage":284,"./modules/GammaCorrection":287,"./modules/Gradient":290,"./modules/GridOverlay":294,"./modules/Histogram":297,"./modules/ImportImage":301,"./modules/Ndvi":305,"./modules/NdviColormap":308,"./modules/NoiseReduction":312,"./modules/Overlay":315,"./modules/PaintBucket":319,"./modules/ReplaceColor":323,"./modules/Resize":326,"./modules/Rotate":329,"./modules/Saturation":332,"./modules/TextOverlay":336,"./modules/Threshold":340,"./modules/Tint":343,"./modules/WebglDistort":347,"./modules/WhiteBalance":350,"image-sequencer-invert":87}],207:[function(require,module,exports){ // Uses a given image as input and replaces it with the output. // Works only in the browser. -function ReplaceImage(ref,selector,steps,options) { +function ReplaceImage(ref, selector, steps, options) { if(!ref.options.inBrowser) return false; // This isn't for Node.js var tempSequencer = ImageSequencer({ui: false}); var this_ = ref; @@ -84363,18 +84366,18 @@ function ReplaceImage(ref,selector,steps,options) { // https://github.com/publiclab/image-sequencer/issues/241 // https://stackoverflow.com/a/20048852/1116657 var raw = ''; - var i,j,subArray,chunk = 5000; - for (i=0,j=arr.length; iRead more", "inputs": { "constantFactor":{ @@ -85998,7 +86012,7 @@ module.exports={ },{}],253:[function(require,module,exports){ (function (Buffer){ -module.exports = function Crop(input,options,callback) { +module.exports = function Crop(input, options, callback) { var defaults = require('./../../util/getDefaults.js')(require('./info.json')); var getPixels = require('get-pixels'), savePixels = require('save-pixels'); @@ -86006,7 +86020,7 @@ module.exports = function Crop(input,options,callback) { options.x = parseInt(options.x) || defaults.x; options.y = parseInt(options.y) || defaults.y; - getPixels(input.src,function(err,pixels){ + getPixels(input.src, function(err, pixels){ options.w = parseInt(options.w) || Math.floor(pixels.shape[0]); options.h = parseInt(options.h) || Math.floor(pixels.shape[1]); options.backgroundColor = options.backgroundColor || defaults.backgroundColor; @@ -86019,26 +86033,26 @@ module.exports = function Crop(input,options,callback) { var backgroundArray = []; backgroundColor = options.backgroundColor.split(' '); for(var i = 0; i < w ; i++){ - backgroundArray = backgroundArray.concat([backgroundColor[0],backgroundColor[1],backgroundColor[2],backgroundColor[3]]); + backgroundArray = backgroundArray.concat([backgroundColor[0], backgroundColor[1], backgroundColor[2], backgroundColor[3]]); } // var newarray = new Uint8Array(4*w*h); var array = []; for (var n = oy; n < oy + h; n++) { - var offsetValue = 4*w*n; - if(nRead more", "inputs": { "dither": { @@ -86503,13 +86519,13 @@ module.exports = exports = function(pixels, options){ ih = pixels.shape[1], thickness = Number(options.thickness) || defaults.thickness, ex = options.endX = Number(options.endX) - thickness || iw - 1, - ey = options.endY = Number(options.endY) -thickness || ih - 1, + ey = options.endY = Number(options.endY) - thickness || ih - 1, color = options.color || defaults.color; color = color.split(' '); var drawSide = function(startX, startY, endX, endY){ - for (var n=startX; n <= endX+thickness; n++){ - for (var k=startY; k <= endY+thickness; k++){ + for (var n = startX; n <= endX + thickness; n++){ + for (var k = startY; k <= endY + thickness; k++){ pixels.set(n, k, 0, color[0]); pixels.set(n, k, 1, color[1]); pixels.set(n, k, 2, color[2]); @@ -86524,10 +86540,10 @@ module.exports = exports = function(pixels, options){ drawSide(ox, ey, ex, ey); // Bottom return pixels; }; -},{"./../../util/getDefaults.js":356,"./info.json":268}],266:[function(require,module,exports){ +},{"./../../util/getDefaults.js":360,"./info.json":268}],266:[function(require,module,exports){ module.exports = function DrawRectangle(options, UI) { - + var output; function draw(input, callback, progressObj) { @@ -86554,6 +86570,7 @@ module.exports = function DrawRectangle(options, UI) { return require('../_nomodule/PixelManipulation.js')(input, { output: output, + ui: options.step.ui, changePixel: changePixel, extraManipulation: extraManipulation, format: input.format, @@ -86570,11 +86587,11 @@ module.exports = function DrawRectangle(options, UI) { }; }; -},{"../_nomodule/PixelManipulation.js":348,"./DrawRectangle":265}],267:[function(require,module,exports){ +},{"../_nomodule/PixelManipulation.js":352,"./DrawRectangle":265}],267:[function(require,module,exports){ arguments[4][214][0].apply(exports,arguments) },{"./Module":266,"./info.json":268,"dup":214}],268:[function(require,module,exports){ module.exports={ - "name": "Draw Rectangle", + "name": "draw-rectangle", "description": "It draws a rectangle on the image", "inputs": { "startingX":{ @@ -86617,12 +86634,12 @@ module.exports={ } },{}],269:[function(require,module,exports){ -module.exports = function Dynamic(options,UI) { +module.exports = function Dynamic(options, UI) { var output; // This function is called on every draw. - function draw(input,callback,progressObj) { + function draw(input, callback, progressObj) { progressObj.stop(true); progressObj.overrideFlag = true; @@ -86645,8 +86662,8 @@ module.exports = function Dynamic(options,UI) { channels.forEach(function(channel) { if (options.hasOwnProperty(channel)) options[channel + '_function'] = generator(options[channel]); - else if (channel === 'alpha') options['alpha_function'] = function() { return 255; }; - else options[channel + '_function'] = generator(options.monochrome); + else if (channel === 'alpha') options['alpha_function'] = function() { return 255; }; + else options[channel + '_function'] = generator(options.monochrome); }); function changePixel(r, g, b, a) { @@ -86664,12 +86681,12 @@ module.exports = function Dynamic(options,UI) { } /* Functions to get the neighbouring pixel by position (x,y) */ - function getNeighbourPixel(pixels,curX,curY,distX,distY){ + function getNeighbourPixel(pixels, curX, curY, distX, distY) { return [ - pixels.get(curX+distX,curY+distY,0) - ,pixels.get(curX+distX,curY+distY,1) - ,pixels.get(curX+distX,curY+distY,2) - ,pixels.get(curX+distX,curY+distY,3) + pixels.get(curX + distX, curY + distY, 0), + pixels.get(curX + distX, curY + distY, 1), + pixels.get(curX + distX, curY + distY, 2), + pixels.get(curX + distX, curY + distY, 3) ]; } @@ -86690,7 +86707,7 @@ module.exports = function Dynamic(options,UI) { } } - function output(image,datauri,mimetype){ + function output(image, datauri, mimetype) { // This output is accessible by Image Sequencer step.output = { src: datauri, format: mimetype }; @@ -86698,6 +86715,7 @@ module.exports = function Dynamic(options,UI) { } return require('../_nomodule/PixelManipulation.js')(input, { output: output, + ui: options.step.ui, changePixel: changePixel, getNeighbourPixel: getNeighbourPixel, getNeighborPixel: getNeighbourPixel, @@ -86717,11 +86735,11 @@ module.exports = function Dynamic(options,UI) { }; }; -},{"../_nomodule/PixelManipulation.js":348}],270:[function(require,module,exports){ +},{"../_nomodule/PixelManipulation.js":352}],270:[function(require,module,exports){ arguments[4][214][0].apply(exports,arguments) },{"./Module":269,"./info.json":271,"dup":214}],271:[function(require,module,exports){ module.exports={ - "name": "Dynamic", + "name": "dynamic", "description": "A module which accepts JavaScript math expressions to produce each color channel based on the original image's color. See Infragrammar.", "inputs": { "red": { @@ -86756,7 +86774,7 @@ const kernelx = [ [-1, 0, 1] ], kernely = [ - [-1,-2,-1], + [-1, -2, -1], [ 0, 0, 0], [ 1, 2, 1] ]; @@ -86820,8 +86838,8 @@ function sobelFilter(pixels, x, y) { yn = y + b - 1; if (isOutOfBounds(pixels, xn, yn)) { - gradX += pixels.get(xn+1, yn+1, 0) * kernelx[a][b]; - gradY += pixels.get(xn+1, yn+1, 0) * kernely[a][b]; + gradX += pixels.get(xn + 1, yn + 1, 0) * kernelx[a][b]; + gradY += pixels.get(xn + 1, yn + 1, 0) * kernely[a][b]; } else { gradX += pixels.get(xn, yn, 0) * kernelx[a][b]; @@ -86849,7 +86867,7 @@ function categorizeAngle(angle){ * 2 => NE-SW * 3 => N-S * 4 => NW-SE - */ + */ } function isOutOfBounds(pixels, x, y){ @@ -86858,7 +86876,7 @@ function isOutOfBounds(pixels, x, y){ const removeElem = (arr = [], elem) => { return arr = arr.filter((arrelem) => { - return arrelem !== elem; + return arrelem !== elem; }); }; @@ -86871,7 +86889,7 @@ function nonMaxSupress(pixels, grads, angles) { let angleCategory = categorizeAngle(angles[x][y]); - if (!isOutOfBounds(pixels, x - 1, y - 1) && !isOutOfBounds(pixels, x+1, y+1)){ + if (!isOutOfBounds(pixels, x - 1, y - 1) && !isOutOfBounds(pixels, x + 1, y + 1)){ switch (angleCategory){ case 1: if (!((grads[x][y] >= grads[x][y + 1]) && (grads[x][y] >= grads[x][y - 1]))) { @@ -86937,17 +86955,17 @@ function hysteresis(strongEdgePixels, weakEdgePixels){ let x = pixel[0], y = pixel[1]; - if (weakEdgePixels.includes([x+1, y])) { - removeElem(weakEdgePixels, [x+1, y]); - } - else if (weakEdgePixels.includes([x-1, y])) { - removeElem(weakEdgePixels, [x-1, y]); + if (weakEdgePixels.includes([x + 1, y])) { + removeElem(weakEdgePixels, [x + 1, y]); } - else if (weakEdgePixels.includes([x, y+1])) { - removeElem(weakEdgePixels, [x, y+1]); - } - else if(weakEdgePixels.includes([x, y-1])) { - removeElem(weakEdgePixels, [x, y-1]); + else if (weakEdgePixels.includes([x - 1, y])) { + removeElem(weakEdgePixels, [x - 1, y]); + } + else if (weakEdgePixels.includes([x, y + 1])) { + removeElem(weakEdgePixels, [x, y + 1]); + } + else if(weakEdgePixels.includes([x, y - 1])) { + removeElem(weakEdgePixels, [x, y - 1]); } }); } @@ -86976,11 +86994,11 @@ module.exports = function edgeDetect(options, UI) { // Blur the image const internalSequencer = ImageSequencer({ inBrowser: false, ui: false }); - return internalSequencer.loadImage(input.src, function () { - internalSequencer.importJSON([{ 'name': 'blur', 'options': {blur: options.blur} }]); + return internalSequencer.loadImage(input.src, function() { + internalSequencer.importJSON([{ 'name': 'blur', 'options': { blur: options.blur } }]); return internalSequencer.run(function onCallback(internalOutput) { - require('get-pixels')(internalOutput, function(err, blurPixels){ - if (err){ + require('get-pixels')(internalOutput, function(err, blurPixels) { + if (err) { return; } @@ -86989,16 +87007,17 @@ module.exports = function edgeDetect(options, UI) { return [(r + g + b) / 3, (r + g + b) / 3, (r + g + b) / 3, a]; } - function extraManipulation(){ + function extraManipulation() { return require('./EdgeUtils')(blurPixels, options.highThresholdRatio, options.lowThresholdRatio, options.hysteresis); } function output(image, datauri, mimetype) { step.output = { src: datauri, format: mimetype }; } - + return require('../_nomodule/PixelManipulation.js')(input, { output: output, + ui: options.step.ui, changePixel: changePixel, extraManipulation: extraManipulation, format: input.format, @@ -87019,11 +87038,11 @@ module.exports = function edgeDetect(options, UI) { }; }; -},{"../_nomodule/PixelManipulation.js":348,"./../../util/getDefaults.js":356,"./EdgeUtils":272,"./info.json":275,"get-pixels":28}],274:[function(require,module,exports){ +},{"../_nomodule/PixelManipulation.js":352,"./../../util/getDefaults.js":360,"./EdgeUtils":272,"./info.json":275,"get-pixels":28}],274:[function(require,module,exports){ arguments[4][214][0].apply(exports,arguments) },{"./Module":273,"./info.json":275,"dup":214}],275:[function(require,module,exports){ module.exports={ - "name": "Detect Edges", + "name": "edge-detect", "description": "This module detects edges using the Canny method, which first Gaussian blurs the image to reduce noise (amount of blur configurable in settings as `options.blur`), then applies a number of steps to highlight edges, resulting in a greyscale image where the brighter the pixel, the stronger the detected edge. Read more. ", "inputs": { "blur": { @@ -87065,12 +87084,12 @@ module.exports={ * Changes the Image Exposure */ -module.exports = function Exposure(options,UI){ +module.exports = function Exposure(options, UI) { var defaults = require('./../../util/getDefaults.js')(require('./info.json')); var output; - function draw(input,callback,progressObj){ + function draw(input, callback, progressObj) { options.exposure = options.exposure || defaults.exposure; var exposure = Math.pow(2, options.exposure); @@ -87079,23 +87098,24 @@ module.exports = function Exposure(options,UI){ var step = this; - function changePixel(r, g, b, a){ + function changePixel(r, g, b, a) { - r = Math.min(255, r*exposure); - g = Math.min(255, g*exposure); - b = Math.min(255, b*exposure); + r = Math.min(255, r * exposure); + g = Math.min(255, g * exposure); + b = Math.min(255, b * exposure); return [r, g, b, a]; } - function output(image,datauri,mimetype){ + function output(image, datauri, mimetype) { // This output is accessible by Image Sequencer - step.output = {src:datauri,format:mimetype}; + step.output = { src: datauri, format: mimetype }; } return require('../_nomodule/PixelManipulation.js')(input, { output: output, + ui: options.step.ui, changePixel: changePixel, format: input.format, image: options.image, @@ -87106,17 +87126,17 @@ module.exports = function Exposure(options,UI){ } return { options: options, - draw: draw, + draw: draw, output: output, UI: UI }; }; -},{"../_nomodule/PixelManipulation.js":348,"./../../util/getDefaults.js":356,"./info.json":278}],277:[function(require,module,exports){ +},{"../_nomodule/PixelManipulation.js":352,"./../../util/getDefaults.js":360,"./info.json":278}],277:[function(require,module,exports){ arguments[4][214][0].apply(exports,arguments) },{"./Module":276,"./info.json":278,"dup":214}],278:[function(require,module,exports){ module.exports={ - "name": "Exposure", + "name": "exposure", "description": "Change the exposure of the image by given exposure value", "inputs": { "exposure": { @@ -87202,11 +87222,11 @@ module.exports = function DoNothing(options, UI) { }; }; -},{"../_nomodule/gl-context":349,"fisheyegl":20}],280:[function(require,module,exports){ +},{"../_nomodule/gl-context":353,"fisheyegl":20}],280:[function(require,module,exports){ arguments[4][214][0].apply(exports,arguments) },{"./Module":279,"./info.json":281,"dup":214}],281:[function(require,module,exports){ module.exports={ - "name": "Fisheye GL", + "name": "fisheye-gl", "description": "Correct fisheye, or barrel distortion, in images (with WebGL -- adapted from fisheye-correction-webgl by @bluemir).", "requires": [ "webgl" ], "inputs": { @@ -87290,12 +87310,12 @@ module.exports = function FlipImage(options, UI) { var step = this; - return getPixels(input.src, function(err, oldPixels){ + return getPixels(input.src, function(err, oldPixels) { function changePixel(r, g, b, a) { return [r, g, b, a]; } function extraManipulation(pixels) { - if (err){ + if (err) { console.log(err); return; } @@ -87304,9 +87324,10 @@ module.exports = function FlipImage(options, UI) { function output(image, datauri, mimetype) { step.output = { src: datauri, format: mimetype }; } - + return require('../_nomodule/PixelManipulation.js')(input, { output: output, + ui: options.step.ui, changePixel: changePixel, extraManipulation: extraManipulation, format: input.format, @@ -87326,7 +87347,7 @@ module.exports = function FlipImage(options, UI) { }; }; -},{"../_nomodule/PixelManipulation.js":348,"./flipImage":283,"./info.json":285,"get-pixels":28}],283:[function(require,module,exports){ +},{"../_nomodule/PixelManipulation.js":352,"./flipImage":283,"./info.json":285,"get-pixels":28}],283:[function(require,module,exports){ module.exports = function flipImage(oldPixels, pixels, axis) { var width = oldPixels.shape[0], height = oldPixels.shape[1]; @@ -87340,15 +87361,15 @@ module.exports = function flipImage(oldPixels, pixels, axis) { function flip(){ if(axis.toLowerCase() == 'vertical'){ - for (var n=0; n < width; n++){ - for (var m=0; m < height; m++){ + for (var n = 0; n < width; n++){ + for (var m = 0; m < height; m++){ copyPixel(n, m, n, height - m - 1); } } } else { - for (var n=0; n < width; n++){ - for (var m=0; m < height; m++){ + for (var n = 0; n < width; n++){ + for (var m = 0; m < height; m++){ copyPixel(n, m, width - n - 1, m); } } @@ -87362,7 +87383,7 @@ module.exports = function flipImage(oldPixels, pixels, axis) { arguments[4][214][0].apply(exports,arguments) },{"./Module":282,"./info.json":285,"dup":214}],285:[function(require,module,exports){ module.exports={ - "name": "Flip Image", + "name": "flip-image", "description": "Flip The Image On The Specified Axis.", "inputs": { "Axis": { @@ -87408,6 +87429,7 @@ module.exports = function Gamma(options, UI) { return require('../_nomodule/PixelManipulation.js')(input, { output: output, + ui: options.step.ui, changePixel: changePixel, format: input.format, image: options.image, @@ -87424,11 +87446,11 @@ module.exports = function Gamma(options, UI) { }; }; -},{"../_nomodule/PixelManipulation.js":348,"./../../util/getDefaults.js":356,"./info.json":288}],287:[function(require,module,exports){ +},{"../_nomodule/PixelManipulation.js":352,"./../../util/getDefaults.js":360,"./info.json":288}],287:[function(require,module,exports){ arguments[4][214][0].apply(exports,arguments) },{"./Module":286,"./info.json":288,"dup":214}],288:[function(require,module,exports){ module.exports={ - "name": "Gamma Correction", + "name": "gamma-correction", "description": "Apply gamma correction on the image Read more", "inputs": { "adjustment": { @@ -87511,7 +87533,7 @@ module.exports = function Invert(options, UI) { arguments[4][214][0].apply(exports,arguments) },{"./Module":289,"./info.json":291,"dup":214}],291:[function(require,module,exports){ module.exports={ - "name": "Gradient", + "name": "gradient", "description": "Gives a gradient of the image", "inputs": {}, "docs-link":"https://github.com/publiclab/image-sequencer/blob/main/docs/MODULES.md#gradient-module" @@ -87526,7 +87548,7 @@ module.exports = exports = function(pixels, options){ color = options.color || defaults.color; color = color.split(' '); - for(var x = 0; x < pixels.shape[0]; x+=options.x){ + for(var x = 0; x < pixels.shape[0]; x += options.x){ for(var y = 0 ; y < pixels.shape[1]; y++){ pixels.set(x, y, 0, color[0]); pixels.set(x, y, 1, color[1]); @@ -87535,22 +87557,22 @@ module.exports = exports = function(pixels, options){ } } - for(var y = 0; y < pixels.shape[1]; y+=options.y){ + for(var y = 0; y < pixels.shape[1]; y += options.y){ for(var x = 0 ; x < pixels.shape[0]; x++){ pixels.set(x, y, 0, color[0]); pixels.set(x, y, 1, color[1]); pixels.set(x, y, 2, color[2]); pixels.set(x, y, 3, color[3]); } - } + } return pixels; }; -},{"./../../util/getDefaults.js":356,"./info.json":295}],293:[function(require,module,exports){ +},{"./../../util/getDefaults.js":360,"./info.json":295}],293:[function(require,module,exports){ + +module.exports = function GridOverlay(options, UI) { -module.exports = function GridOverlay(options,UI) { - var output; function draw(input, callback, progressObj) { @@ -87559,7 +87581,7 @@ module.exports = function GridOverlay(options,UI) { progressObj.overrideFlag = true; var step = this; - + function extraManipulation(pixels) { pixels = require('./GridOverlay')(pixels, options); return pixels; @@ -87574,6 +87596,7 @@ module.exports = function GridOverlay(options,UI) { return require('../_nomodule/PixelManipulation.js')(input, { output: output, + ui: options.step.ui, extraManipulation: extraManipulation, format: input.format, image: options.image, @@ -87581,7 +87604,7 @@ module.exports = function GridOverlay(options,UI) { callback: callback }); - + } return { @@ -87592,11 +87615,11 @@ module.exports = function GridOverlay(options,UI) { }; }; -},{"../_nomodule/PixelManipulation.js":348,"./GridOverlay":292}],294:[function(require,module,exports){ +},{"../_nomodule/PixelManipulation.js":352,"./GridOverlay":292}],294:[function(require,module,exports){ arguments[4][214][0].apply(exports,arguments) },{"./Module":293,"./info.json":295,"dup":214}],295:[function(require,module,exports){ module.exports={ - "name": "GridOverlay", + "name": "grid-overlay", "description": "Overlays a grid over an Image", "inputs": { "x": { @@ -87695,6 +87718,7 @@ module.exports = function Channel(options, UI) { return require('../_nomodule/PixelManipulation.js')(input, { output: output, + ui: options.step.ui, changePixel: changePixel, extraManipulation: extraManipulation, format: input.format, @@ -87714,14 +87738,14 @@ module.exports = function Channel(options, UI) { }; }; -},{"../_nomodule/PixelManipulation.js":348,"./../../util/getDefaults.js":356,"./info.json":298}],297:[function(require,module,exports){ +},{"../_nomodule/PixelManipulation.js":352,"./../../util/getDefaults.js":360,"./info.json":298}],297:[function(require,module,exports){ module.exports = [ require('./Module.js'), require('./info.json') ]; },{"./Module.js":296,"./info.json":298}],298:[function(require,module,exports){ module.exports={ - "name": "Histogram", + "name": "histogram", "description": "Calculates the histogram for the image", "inputs": { "gradient": { @@ -87787,7 +87811,7 @@ module.exports = function ImportImageModule(options, UI) { }; }; -},{"./../../util/getDefaults.js":356,"./Ui.js":300,"./info.json":302}],300:[function(require,module,exports){ +},{"./../../util/getDefaults.js":360,"./Ui.js":300,"./info.json":302}],300:[function(require,module,exports){ // hide on save module.exports = function ImportImageModuleUi(step, ui) { @@ -87797,7 +87821,7 @@ module.exports = function ImportImageModuleUi(step, ui) { var dropzoneId = 'dropzone-import-image-' + step.ID; // add a file input listener - var dropZone ='\ + var dropZone = '\
\

\ Select or drag in an image to overlay.\ @@ -87847,7 +87871,7 @@ module.exports = function ImportImageModuleUi(step, ui) { arguments[4][214][0].apply(exports,arguments) },{"./Module":299,"./info.json":302,"dup":214}],302:[function(require,module,exports){ module.exports={ - "name": "Import Image", + "name": "import-image", "description": "Import a new image and replace the original with it. Future versions may enable a blend mode. Specify an image by URL or by file selector.", "url": "https://github.com/publiclab/image-sequencer/tree/master/MODULES.md", "inputs": { @@ -87904,6 +87928,7 @@ module.exports = function Ndvi(options, UI) { return require('../_nomodule/PixelManipulation.js')(input, { output: output, + ui: options.step.ui, changePixel: changePixel, format: input.format, image: options.image, @@ -87921,7 +87946,7 @@ module.exports = function Ndvi(options, UI) { }; }; -},{"../_nomodule/PixelManipulation.js":348,"./../../util/getDefaults.js":356,"./Ui.js":304,"./info.json":306}],304:[function(require,module,exports){ +},{"../_nomodule/PixelManipulation.js":352,"./../../util/getDefaults.js":360,"./Ui.js":304,"./info.json":306}],304:[function(require,module,exports){ // hide on save module.exports = function CropModuleUi(step, ui) { @@ -87942,7 +87967,7 @@ module.exports = function CropModuleUi(step, ui) { var xPos = e.pageX - offset.left; var yPos = e.pageY - offset.top; var ndvi = canvas.getContext('2d').getImageData(xPos, yPos, 1, 1).data[0]; - ndvi = ndvi/127.5 - 1 ; + ndvi = ndvi / 127.5 - 1 ; ndvi = ndvi.toFixed(2); ndviImage[0].title = 'NDVI: ' + ndvi; }); @@ -87961,7 +87986,7 @@ module.exports = function CropModuleUi(step, ui) { arguments[4][214][0].apply(exports,arguments) },{"./Module":303,"./info.json":306,"dup":214}],306:[function(require,module,exports){ module.exports={ - "name": "NDVI", + "name": "ndvi", "description": "Normalized Difference Vegetation Index, or NDVI, is an image analysis technique used with aerial photography. It's a way to visualize the amounts of infrared and other wavelengths of light reflected from vegetation by comparing ratios of blue and red light absorbed versus green and IR light reflected. NDVI is used to evaluate the health of vegetation in satellite imagery, where it correlates with how much photosynthesis is happening. This is helpful in assessing vegetative health or stress. Read more.

This is designed for use with red-filtered single camera DIY Infragram cameras; change to 'blue' for blue filters", "inputs": { "filter": { @@ -87989,17 +88014,156 @@ module.exports = require('../../util/createMetaModule.js')( infoJson: require('./info.json') } )[0]; -},{"../../util/createMetaModule.js":355,"./info.json":309}],308:[function(require,module,exports){ +},{"../../util/createMetaModule.js":359,"./info.json":309}],308:[function(require,module,exports){ arguments[4][214][0].apply(exports,arguments) },{"./Module":307,"./info.json":309,"dup":214}],309:[function(require,module,exports){ module.exports={ - "name": "NDVI-Colormap", + "name": "ndvi-colormap", "description": "Sequentially Applies NDVI and Colormap steps", "inputs": {}, "docs-link": "https://github.com/publiclab/image-sequencer/blob/main/docs/MODULES.md#ndvi-colormap-module" } },{}],310:[function(require,module,exports){ +module.exports = function NoiseReduction(options, UI) { + var defaults = require('./../../util/getDefaults.js')(require('./info.json')); + var output; + + function draw(input, callback, progressObj) { + + progressObj.stop(true); + progressObj.overrideFlag = true; + + var step = this; + options.method = options.method || defaults.method; + + function extraManipulation(pixels) { + pixels = require('./NoiseReduction.js')(pixels, options.method); + return pixels; + } + + function output(image, datauri, mimetype) { + // This output is accessible by Image Sequencer + step.output = { src: datauri, format: mimetype }; + + } + + return require('../_nomodule/PixelManipulation.js')(input, { + output: output, + ui: options.step.ui, + extraManipulation: extraManipulation, + format: input.format, + image: options.image, + callback: callback + }); + } + return { + options: options, + draw: draw, + output: output, + UI: UI + }; +}; +},{"../_nomodule/PixelManipulation.js":352,"./../../util/getDefaults.js":360,"./NoiseReduction.js":311,"./info.json":313}],311:[function(require,module,exports){ +module.exports = function Noise(pixels, method) { + let neighbourX = [-1, -1, -1, 0, 0, 0, 1, 1, 1]; + let neighbourY = [-1, 0, 1, -1, 0, 1, -1, 0, 1]; + + if(method == 'Median Filtering'){ + + for(let y = 0; y < pixels.shape[1]; y++){ + for(let x = 0; x < pixels.shape[0]; x++){ + let i = 0, k = 0, windowr = [],windowg = [], windowb = []; + + while( k <= 8){ + let newX = x + neighbourX[k], newY = y + neighbourY[k]; + + if( newX >= 0 && newX < pixels.shape[0]) + { + if( newY >= 0 && newY < pixels.shape[1]){ + windowr[i] = pixels.get((newX),(newY),0); + windowg[i] = pixels.get((newX),(newY),1); + windowb[i] = pixels.get((newX),(newY),2); + i++; + } + } + k++; + } + + windowr.sort(); + windowg.sort(); + windowb.sort(); + + if(i%2 == 0) + { + let value = windowr[i/2] + windowr[(i/2)-1]; + pixels.set(x,y,0,value); + + value = windowg[i/2] + windowg[(i/2)-1]; + pixels.set(x,y,1,value); + + value = windowb[i/2] + windowb[(i/2)-1]; + pixels.set(x,y,2,value); + + } + else { + pixels.set(x, y, 0, windowr[Math.floor(i/2)]); + pixels.set(x, y, 1, windowg[Math.floor(i/2)]); + pixels.set(x, y, 2, windowb[Math.floor(i/2)]); + + } + } + } + } + else if(method == 'Mean Filtering'){ + + for(let y = 0; y < pixels.shape[1]; y++){ + for(let x = 0; x < pixels.shape[0]; x++){ + let i = 0, k = 0, sumR=0, sumG = 0, sumB =0; + + while( k <= 8){ + let newX = x + neighbourX[k], newY = y + neighbourY[k]; + + if( newX >= 0 && newX < pixels.shape[0]) + { + if( newY >= 0 && newY < pixels.shape[1]){ + sumR += pixels.get(newX,newY,0); + sumG += pixels.get(newX,newY,1); + sumB += pixels.get(newX,newY,2); + i++; + } + } + k++; + } + + pixels.set(x, y, 0, sumR/i); + pixels.set(x, y, 1, sumG/i); + pixels.set(x, y, 2, sumB/i); + + } + } + } + + return pixels; +}; +},{}],312:[function(require,module,exports){ +arguments[4][214][0].apply(exports,arguments) +},{"./Module":310,"./info.json":313,"dup":214}],313:[function(require,module,exports){ +module.exports={ + "name": "Noise Reduction", + "description": "Reduces noise from Image", + "inputs": { + "method": { + "type": "select", + "desc": "Select the noise filtering method", + "default": "Median Filtering", + "values": ["Mean Filtering","Median Filtering"] + } + }, + "docs-link":"" +} + +},{}],314:[function(require,module,exports){ module.exports = function Dynamic(options, UI, util) { var defaults = require('./../../util/getDefaults.js')(require('./info.json')); @@ -88067,6 +88231,7 @@ module.exports = function Dynamic(options, UI, util) { // run PixelManipulation on first Image pixels return require('../_nomodule/PixelManipulation.js')(baseStepOutput, { output: output, + ui: options.step.ui, changePixel: changePixel, format: baseStepOutput.format, image: baseStepImage, @@ -88084,11 +88249,11 @@ module.exports = function Dynamic(options, UI, util) { }; }; -},{"../../util/ParseInputCoordinates":354,"../_nomodule/PixelManipulation.js":348,"./../../util/getDefaults.js":356,"./info.json":312,"get-pixels":28}],311:[function(require,module,exports){ +},{"../../util/ParseInputCoordinates":358,"../_nomodule/PixelManipulation.js":352,"./../../util/getDefaults.js":360,"./info.json":316,"get-pixels":28}],315:[function(require,module,exports){ arguments[4][214][0].apply(exports,arguments) -},{"./Module":310,"./info.json":312,"dup":214}],312:[function(require,module,exports){ +},{"./Module":314,"./info.json":316,"dup":214}],316:[function(require,module,exports){ module.exports={ - "name": "Overlay", + "name": "overlay", "description": "Overlays an Image over another at a given position(x,y) in pixels or in %", "inputs": { "x": { @@ -88110,7 +88275,7 @@ module.exports={ "docs-link":"https://github.com/publiclab/image-sequencer/blob/main/docs/MODULES.md#overlay-module" } -},{}],313:[function(require,module,exports){ +},{}],317:[function(require,module,exports){ module.exports = function PaintBucket(options, UI) { var output; @@ -88136,6 +88301,7 @@ module.exports = function PaintBucket(options, UI) { return require('../_nomodule/PixelManipulation.js')(input, { output: output, + ui: options.step.ui, extraManipulation: extraManipulation, format: input.format, image: options.image, @@ -88152,7 +88318,7 @@ module.exports = function PaintBucket(options, UI) { }; }; -},{"../_nomodule/PixelManipulation.js":348,"./PaintBucket":314}],314:[function(require,module,exports){ +},{"../_nomodule/PixelManipulation.js":352,"./PaintBucket":318}],318:[function(require,module,exports){ module.exports = exports = function(pixels, options) { @@ -88220,11 +88386,11 @@ module.exports = exports = function(pixels, options) { return pixels; }; -},{"./../../util/getDefaults.js":356,"./info.json":316}],315:[function(require,module,exports){ +},{"./../../util/getDefaults.js":360,"./info.json":320}],319:[function(require,module,exports){ arguments[4][214][0].apply(exports,arguments) -},{"./Module":313,"./info.json":316,"dup":214}],316:[function(require,module,exports){ +},{"./Module":317,"./info.json":320,"dup":214}],320:[function(require,module,exports){ module.exports={ - "name": "PaintBucket", + "name": "paint-bucket", "description": "Fill color in pixels", "inputs": { "startingX": { @@ -88255,7 +88421,7 @@ module.exports={ "docs-link":"https://github.com/publiclab/image-sequencer/blob/main/docs/MODULES.md#paint-bucket-module" } -},{}],317:[function(require,module,exports){ +},{}],321:[function(require,module,exports){ module.exports = function ReplaceColor(options, UI) { var output; @@ -88285,6 +88451,7 @@ module.exports = function ReplaceColor(options, UI) { return require('../_nomodule/PixelManipulation.js')(input, { output: output, + ui: options.step.ui, changePixel: changePixel, extraManipulation: extraManipulation, format: input.format, @@ -88301,7 +88468,7 @@ module.exports = function ReplaceColor(options, UI) { }; }; -},{"../_nomodule/PixelManipulation.js":348,"./ReplaceColor":318}],318:[function(require,module,exports){ +},{"../_nomodule/PixelManipulation.js":352,"./ReplaceColor":322}],322:[function(require,module,exports){ module.exports = exports = function(pixels, options){ var color = options.color || '228 86 81'; var replaceColor = options.replaceColor || '0 0 255'; @@ -88315,41 +88482,41 @@ module.exports = exports = function(pixels, options){ cb = color[2]; var tolerance = options.tolerance || 50; - var maxFactor = (1 + tolerance/100); - var minFactor = (1 - tolerance/100); + var maxFactor = (1 + tolerance / 100); + var minFactor = (1 - tolerance / 100); function isSimilar(r, g, b){ - return ( r >= cr*minFactor && r <= cr*maxFactor && - g >= cg*minFactor && g <= cg*maxFactor && - b >= cb*minFactor && b <= cb*maxFactor); + return ( r >= cr * minFactor && r <= cr * maxFactor && + g >= cg * minFactor && g <= cg * maxFactor && + b >= cb * minFactor && b <= cb * maxFactor); } for(var i = 0; i < pixels.shape[0]; i++){ for(var j = 0; j < pixels.shape[1]; j++){ - var r = pixels.get(i,j,0), - g = pixels.get(i,j,1), - b = pixels.get(i,j,2); - if(isSimilar(r,g,b)){ + var r = pixels.get(i, j, 0), + g = pixels.get(i, j, 1), + b = pixels.get(i, j, 2); + if(isSimilar(r, g, b)){ if (replaceMethod == 'greyscale'){ - var avg = (r + g + b)/3; - pixels.set(i,j,0,avg); - pixels.set(i,j,1,avg); - pixels.set(i,j,2,avg); + var avg = (r + g + b) / 3; + pixels.set(i, j, 0, avg); + pixels.set(i, j, 1, avg); + pixels.set(i, j, 2, avg); }else { - pixels.set(i,j,0,replaceColor[0]); - pixels.set(i,j,1,replaceColor[1]); - pixels.set(i,j,2,replaceColor[2]); + pixels.set(i, j, 0, replaceColor[0]); + pixels.set(i, j, 1, replaceColor[1]); + pixels.set(i, j, 2, replaceColor[2]); } } } } return pixels; }; -},{}],319:[function(require,module,exports){ +},{}],323:[function(require,module,exports){ arguments[4][214][0].apply(exports,arguments) -},{"./Module":317,"./info.json":320,"dup":214}],320:[function(require,module,exports){ +},{"./Module":321,"./info.json":324,"dup":214}],324:[function(require,module,exports){ module.exports={ - "name": "ReplaceColor", + "name": "replace-color", "description": "Replace color with grey or your desired color", "inputs": { "replaceMethod": { @@ -88382,7 +88549,7 @@ module.exports={ "docs-link":"https://github.com/publiclab/image-sequencer/blob/main/docs/MODULES.md#replacecolor-module" } -},{}],321:[function(require,module,exports){ +},{}],325:[function(require,module,exports){ /* * Resize the image by given percentage value */ @@ -88416,7 +88583,7 @@ module.exports = function Resize(options, UI) { new_width = Math.round(pixels.shape[0] * (resize_value / 100)); new_height = Math.round(pixels.shape[1] * (resize_value / 100)); - var bitmap = new imagejs.Bitmap({width: pixels.shape[0], height: pixels.shape[1]}); + var bitmap = new imagejs.Bitmap({ width: pixels.shape[0], height: pixels.shape[1] }); bitmap._data.data = pixels.data; @@ -88426,7 +88593,7 @@ module.exports = function Resize(options, UI) { }); pixels.data = resized._data.data; - pixels.shape = [new_width,new_height,4]; + pixels.shape = [new_width, new_height, 4]; pixels.stride[1] = 4 * new_width; return pixels; @@ -88439,6 +88606,7 @@ module.exports = function Resize(options, UI) { return require('../_nomodule/PixelManipulation.js')(input, { output: output, + ui: options.step.ui, changePixel: changePixel, extraManipulation: extraManipulation, format: input.format, @@ -88456,11 +88624,11 @@ module.exports = function Resize(options, UI) { }; }; -},{"../_nomodule/PixelManipulation.js":348,"./../../util/getDefaults.js":356,"./info.json":323,"imagejs":88}],322:[function(require,module,exports){ +},{"../_nomodule/PixelManipulation.js":352,"./../../util/getDefaults.js":360,"./info.json":327,"imagejs":88}],326:[function(require,module,exports){ arguments[4][214][0].apply(exports,arguments) -},{"./Module":321,"./info.json":323,"dup":214}],323:[function(require,module,exports){ +},{"./Module":325,"./info.json":327,"dup":214}],327:[function(require,module,exports){ module.exports={ - "name": "Resize", + "name": "resize", "description": "Resize image by given percentage value", "inputs": { "resize": { @@ -88472,9 +88640,9 @@ module.exports={ "docs-link":"https://github.com/publiclab/image-sequencer/blob/main/docs/MODULES.md#resize-module" } -},{}],324:[function(require,module,exports){ +},{}],328:[function(require,module,exports){ /* - * Rotates image + * Rotates image */ module.exports = function Rotate(options, UI) { @@ -88497,19 +88665,19 @@ module.exports = function Rotate(options, UI) { } function extraManipulation(pixels) { - var rotate_value = (options.rotate)%360; + var rotate_value = (options.rotate) % 360; - if(rotate_value%360 == 0) + if (rotate_value % 360 == 0) return pixels; - var bitmap = new imagejs.Bitmap({width: pixels.shape[0], height: pixels.shape[1]}); + var bitmap = new imagejs.Bitmap({ width: pixels.shape[0], height: pixels.shape[1] }); bitmap._data.data = pixels.data; var rotated = bitmap.rotate({ - degrees: rotate_value, + degrees: rotate_value, }); pixels.data = rotated._data.data; - + return pixels; } @@ -88520,6 +88688,7 @@ module.exports = function Rotate(options, UI) { return require('../_nomodule/PixelManipulation.js')(input, { output: output, + ui: options.step.ui, changePixel: changePixel, extraManipulation: extraManipulation, format: input.format, @@ -88537,11 +88706,11 @@ module.exports = function Rotate(options, UI) { }; }; -},{"../_nomodule/PixelManipulation.js":348,"./../../util/getDefaults.js":356,"./info.json":326,"imagejs":88}],325:[function(require,module,exports){ +},{"../_nomodule/PixelManipulation.js":352,"./../../util/getDefaults.js":360,"./info.json":330,"imagejs":88}],329:[function(require,module,exports){ arguments[4][214][0].apply(exports,arguments) -},{"./Module":324,"./info.json":326,"dup":214}],326:[function(require,module,exports){ +},{"./Module":328,"./info.json":330,"dup":214}],330:[function(require,module,exports){ module.exports={ - "name": "Rotate", + "name": "rotate", "description": "Rotates image by specified degrees", "inputs": { "rotate": { @@ -88556,12 +88725,12 @@ module.exports={ "docs-link":"https://github.com/publiclab/image-sequencer/blob/main/docs/MODULES.md#rotate-modul" } -},{}],327:[function(require,module,exports){ +},{}],331:[function(require,module,exports){ /* * Saturate an image with a value from 0 to 1 */ -module.exports = function Saturation(options,UI) { - +module.exports = function Saturation(options, UI) { + var defaults = require('./../../util/getDefaults.js')(require('./info.json')); var output; @@ -88599,6 +88768,7 @@ module.exports = function Saturation(options,UI) { return require('../_nomodule/PixelManipulation.js')(input, { output: output, + ui: options.step.ui, changePixel: changePixel, format: input.format, image: options.image, @@ -88617,11 +88787,11 @@ module.exports = function Saturation(options,UI) { }; }; -},{"../_nomodule/PixelManipulation.js":348,"./../../util/getDefaults.js":356,"./info.json":329}],328:[function(require,module,exports){ +},{"../_nomodule/PixelManipulation.js":352,"./../../util/getDefaults.js":360,"./info.json":333}],332:[function(require,module,exports){ arguments[4][214][0].apply(exports,arguments) -},{"./Module":327,"./info.json":329,"dup":214}],329:[function(require,module,exports){ +},{"./Module":331,"./info.json":333,"dup":214}],333:[function(require,module,exports){ module.exports={ - "name": "Saturation", + "name": "saturation", "description": "Change the saturation of the image by given value, from 0-1, with 1 being 100% saturated.", "inputs": { "saturation": { @@ -88636,50 +88806,51 @@ module.exports={ "docs-link":"https://github.com/publiclab/image-sequencer/blob/main/docs/MODULES.md#saturation-module" } -},{}],330:[function(require,module,exports){ +},{}],334:[function(require,module,exports){ + +module.exports = function TextOverlay(options, UI) { -module.exports = function TextOverlay(options,UI) { - var output; - + function draw(input, callback, progressObj) { - + progressObj.stop(true); progressObj.overrideFlag = true; - + var step = this; if (!options.step.inBrowser) { // This module is only for browser this.output = input; callback(); } - else{ + else { var priorStep = this.getStep(-1); // get the previous step to add text onto it. function extraManipulation(pixels) { - //if (options.step.inBrowser) - pixels = require('./TextOverlay')(pixels, options,priorStep); + //if (options.step.inBrowser) + pixels = require('./TextOverlay')(pixels, options, priorStep); return pixels; } function output(image, datauri, mimetype) { - + // This output is accesible by Image Sequencer step.output = { src: datauri, format: mimetype }; - + } - + return require('../_nomodule/PixelManipulation.js')(input, { output: output, + ui: options.step.ui, extraManipulation: extraManipulation, format: input.format, image: options.image, inBrowser: options.inBrowser, callback: callback }); - + } } - + return { options: options, draw: draw, @@ -88687,9 +88858,9 @@ module.exports = function TextOverlay(options,UI) { UI: UI }; }; - -},{"../_nomodule/PixelManipulation.js":348,"./TextOverlay":331}],331:[function(require,module,exports){ -module.exports = exports = function(pixels, options,priorstep){ + +},{"../_nomodule/PixelManipulation.js":352,"./TextOverlay":335}],335:[function(require,module,exports){ +module.exports = exports = function(pixels, options, priorstep){ var defaults = require('./../../util/getDefaults.js')(require('./info.json')); options.text = options.text || defaults.text; @@ -88709,18 +88880,18 @@ module.exports = exports = function(pixels, options,priorstep){ var ctx = canvas.getContext('2d'); ctx.drawImage(img[0], 0, 0); ctx.fillStyle = options.color; - ctx.font = options.size +'px ' + options.font; + ctx.font = options.size + 'px ' + options.font; ctx.fillText(options.text, options.x, options.y); - var myImageData = ctx.getImageData(0,0,canvas.width,canvas.height); + var myImageData = ctx.getImageData(0, 0, canvas.width, canvas.height); pixels.data = myImageData.data; return pixels; }; -},{"./../../util/getDefaults.js":356,"./info.json":333}],332:[function(require,module,exports){ +},{"./../../util/getDefaults.js":360,"./info.json":337}],336:[function(require,module,exports){ arguments[4][214][0].apply(exports,arguments) -},{"./Module":330,"./info.json":333,"dup":214}],333:[function(require,module,exports){ +},{"./Module":334,"./info.json":337,"dup":214}],337:[function(require,module,exports){ module.exports={ - "name": "Text-Overlay", + "name": "text-overlay", "description": "Overlay text on image.", "inputs": { "text": { @@ -88773,7 +88944,7 @@ module.exports={ "only": "browser" } -},{}],334:[function(require,module,exports){ +},{}],338:[function(require,module,exports){ /* * Image thresholding with 'image-filter-threshold' */ @@ -88804,6 +88975,7 @@ module.exports = function ImageThreshold(options, UI) { } return require('../_nomodule/PixelManipulation.js')(input, { output: output, + ui: options.step.ui, changePixel: changePixel, extraManipulation: extraManipulation, format: input.format, @@ -88819,7 +88991,7 @@ module.exports = function ImageThreshold(options, UI) { }; }; -},{"../_nomodule/PixelManipulation.js":348,"./Threshold":335}],335:[function(require,module,exports){ +},{"../_nomodule/PixelManipulation.js":352,"./Threshold":339}],339:[function(require,module,exports){ module.exports = function Threshold(pixels, options, histData) { var defaults = require('./../../util/getDefaults.js')(require('./info.json')); @@ -88889,11 +89061,11 @@ function otsu(histData) { return threshold; } -},{"./../../util/getDefaults.js":356,"./info.json":337}],336:[function(require,module,exports){ +},{"./../../util/getDefaults.js":360,"./info.json":341}],340:[function(require,module,exports){ arguments[4][214][0].apply(exports,arguments) -},{"./Module":334,"./info.json":337,"dup":214}],337:[function(require,module,exports){ +},{"./Module":338,"./info.json":341,"dup":214}],341:[function(require,module,exports){ module.exports={ - "name": "Threshold", + "name": "threshold", "description": "Thresholding is used to create binary images", "inputs": { "threshold": { @@ -88914,7 +89086,7 @@ module.exports={ "docs-link":"https://github.com/publiclab/image-sequencer/blob/main/docs/MODULES.md#threshold" } -},{}],338:[function(require,module,exports){ +},{}],342:[function(require,module,exports){ module.exports = function Tint(options, UI) { var defaults = require('./../../util/getDefaults.js')(require('./info.json')); @@ -88949,6 +89121,7 @@ module.exports = function Tint(options, UI) { return require('../_nomodule/PixelManipulation.js')(input, { output: output, + ui: options.step.ui, changePixel: changePixel, format: input.format, image: options.image, @@ -88965,11 +89138,11 @@ module.exports = function Tint(options, UI) { }; }; -},{"../_nomodule/PixelManipulation.js":348,"./../../util/getDefaults.js":356,"./info.json":340}],339:[function(require,module,exports){ +},{"../_nomodule/PixelManipulation.js":352,"./../../util/getDefaults.js":360,"./info.json":344}],343:[function(require,module,exports){ arguments[4][214][0].apply(exports,arguments) -},{"./Module":338,"./info.json":340,"dup":214}],340:[function(require,module,exports){ +},{"./Module":342,"./info.json":344,"dup":214}],344:[function(require,module,exports){ module.exports={ - "name": "Tint", + "name": "tint", "description": "Add color tint to an image", "inputs": { "color":{ @@ -88989,7 +89162,7 @@ module.exports={ "docs-link":"https://github.com/publiclab/image-sequencer/blob/main/docs/MODULES.md#tint" } -},{}],341:[function(require,module,exports){ +},{}],345:[function(require,module,exports){ /* * Resolves Fisheye Effect */ @@ -89119,7 +89292,7 @@ module.exports = function DoNothing(options, UI) { var offsetY = matrix2northmost - matrix1northmost; canvas.draw(texture, - image.width,// * ratio, + image.width, // * ratio, image.height// * ratio ); @@ -89221,7 +89394,7 @@ module.exports = function DoNothing(options, UI) { }; }; -},{"../../util/parseDistortCoordinates.js":358,"../_nomodule/gl-context":349,"./../../util/getDefaults.js":356,"./glfx":342,"./info.json":344}],342:[function(require,module,exports){ +},{"../../util/parseDistortCoordinates.js":362,"../_nomodule/gl-context":353,"./../../util/getDefaults.js":360,"./glfx":346,"./info.json":348}],346:[function(require,module,exports){ /* * glfx.js * http://evanw.github.com/glfx.js/ @@ -89374,11 +89547,11 @@ module.exports = function() { }; return b; }(), s = 'float random(vec3 scale,float seed){return fract(sin(dot(gl_FragCoord.xyz+seed,scale))*43758.5453+seed);}'; return v; }(); -},{}],343:[function(require,module,exports){ +},{}],347:[function(require,module,exports){ arguments[4][214][0].apply(exports,arguments) -},{"./Module":341,"./info.json":344,"dup":214}],344:[function(require,module,exports){ +},{"./Module":345,"./info.json":348,"dup":214}],348:[function(require,module,exports){ module.exports={ - "name": "WebGl Distort", + "name": "webgl-distort", "requires": [ "webgl" ], @@ -89407,7 +89580,7 @@ module.exports={ }, "docs-link":"https://github.com/publiclab/image-sequencer/blob/main/docs/MODULES.md#webgl-distort" } -},{}],345:[function(require,module,exports){ +},{}],349:[function(require,module,exports){ module.exports = function Balance(options, UI) { var defaults = require('./../../util/getDefaults.js')(require('./info.json')); @@ -89428,15 +89601,15 @@ module.exports = function Balance(options, UI) { function extraManipulation(pixels) { var i = 0; - var red_factor = 255/options.red; - var green_factor = 255/options.green; - var blue_factor = 255/options.blue; + var red_factor = 255 / options.red; + var green_factor = 255 / options.green; + var blue_factor = 255 / options.blue; while (i < pixels.data.length) { - pixels.data[i] = Math.min(255, pixels.data[i]*red_factor); - pixels.data[i+1] = Math.min(255, pixels.data[i+1]*green_factor); - pixels.data[i+2] = Math.min(255, pixels.data[i+2]*blue_factor); - i+=4; + pixels.data[i] = Math.min(255, pixels.data[i] * red_factor); + pixels.data[i + 1] = Math.min(255, pixels.data[i + 1] * green_factor); + pixels.data[i + 2] = Math.min(255, pixels.data[i + 2] * blue_factor); + i += 4; } return pixels; @@ -89450,6 +89623,7 @@ module.exports = function Balance(options, UI) { return require('../_nomodule/PixelManipulation.js')(input, { output: output, + ui: options.step.ui, extraManipulation: extraManipulation, format: input.format, image: options.image, @@ -89466,11 +89640,11 @@ module.exports = function Balance(options, UI) { }; }; -},{"../_nomodule/PixelManipulation.js":348,"./../../util/getDefaults.js":356,"./info.json":347}],346:[function(require,module,exports){ +},{"../_nomodule/PixelManipulation.js":352,"./../../util/getDefaults.js":360,"./info.json":351}],350:[function(require,module,exports){ arguments[4][236][0].apply(exports,arguments) -},{"./Module":345,"./info.json":347,"dup":236}],347:[function(require,module,exports){ +},{"./Module":349,"./info.json":351,"dup":236}],351:[function(require,module,exports){ module.exports={ - "name": "White Balance", + "name": "white-balance", "description": "Render neutral colours correctly based on the whitest pixel in the image.", "inputs": { "red": { @@ -89492,7 +89666,7 @@ module.exports={ "docs-link":"https://github.com/publiclab/image-sequencer/blob/main/docs/MODULES.md#white-balance" } -},{}],348:[function(require,module,exports){ +},{}],352:[function(require,module,exports){ (function (process,Buffer){ /* * General purpose per-pixel manipulation @@ -89528,7 +89702,7 @@ module.exports = function PixelManipulation(image, options) { // TODO: this could possibly be more efficient; see // https://github.com/p-v-o-s/infragram-js/blob/master/public/infragram.js#L173-L181 - if (!options.inBrowser && !process.env.TEST) { + if (!options.inBrowser && !process.env.TEST && options.ui) { try { var pace = require('pace')(pixels.shape[0] * pixels.shape[1]); } catch (e) { @@ -89559,7 +89733,7 @@ module.exports = function PixelManipulation(image, options) { pixels.set(x, y, 2, pixel[2]); pixels.set(x, y, 3, pixel[3]); - if (!options.inBrowser && !process.env.TEST) pace.op(); + if (!options.inBrowser && !process.env.TEST && options.ui) pace.op(); } } } @@ -89596,7 +89770,7 @@ module.exports = function PixelManipulation(image, options) { }; }).call(this,require('_process'),require("buffer").Buffer) -},{"_process":139,"buffer":73,"get-pixels":28,"pace":116,"save-pixels":189}],349:[function(require,module,exports){ +},{"_process":139,"buffer":73,"get-pixels":28,"pace":116,"save-pixels":189}],353:[function(require,module,exports){ (function (__dirname){ module.exports = function runInBrowserContext(input, callback, step, options) { @@ -89637,7 +89811,7 @@ module.exports = function runInBrowserContext(input, callback, step, options) { }; }).call(this,"/src/modules/_nomodule") -},{"lodash":101,"path":117}],350:[function(require,module,exports){ +},{"lodash":101,"path":117}],354:[function(require,module,exports){ const GPU = require('gpu.js').GPU; /** @@ -89646,7 +89820,7 @@ const GPU = require('gpu.js').GPU; * @param {Float32Array|Unit8Array|Float64Array} kernel kernelto be convolved on all the matrices. * @param {Boolean} pipeMode Whether to save the output to a texture. * @param {Boolean} normalize Whether to normailize the output by dividing it by the total value of the kernel. - * @returns {Float32Array} + * @returns {Float32Array} */ const convolve = (arrays, kernel, options = {}) => { const pipeMode = options.pipeMode || false, @@ -89706,7 +89880,7 @@ const convolve = (arrays, kernel, options = {}) => { }; /** - * + * * @param {Float32Array|'Object'} outputSize Output size of the compute function. * @param {Function} computeFunc The compute function. Cannot be an arrow function. * @param {'Object'} constants Constants to be passed to the function. Can be accessed inside the compute function using `this.constants`. @@ -89732,7 +89906,7 @@ module.exports = { convolve, compute }; -},{"gpu.js":60}],351:[function(require,module,exports){ +},{"gpu.js":60}],355:[function(require,module,exports){ // special module to load an image into the start of the sequence; used in the HTML UI function LoadImage(ref, name, src, main_callback) { function makeImage(datauri) { @@ -89810,7 +89984,7 @@ function LoadImage(ref, name, src, main_callback) { module.exports = LoadImage; -},{"urify":197}],352:[function(require,module,exports){ +},{"urify":197}],356:[function(require,module,exports){ // TODO: potentially move this into ImportImage module function setInputStepInit() { @@ -89843,16 +90017,16 @@ function setInputStepInit() { function runVideo(){ /* event handler for Take-Photo */ - document.getElementById('video').style.display='inline'; - document.getElementById('capture').style.display='inline'; - document.getElementById('close').style.display='inline'; + document.getElementById('video').style.display = 'inline'; + document.getElementById('capture').style.display = 'inline'; + document.getElementById('close').style.display = 'inline'; var video = document.getElementById('video'); canvas = document.getElementById('canvas'), context = canvas.getContext('2d'), vendorUrl = window.URL || window.webkitURL; - const constraints = { audio: false,video: true}; + const constraints = { audio: false, video: true}; function handleSuccess(stream) { window.stream = stream; // make stream available to browser console @@ -89879,9 +90053,9 @@ function setInputStepInit() { stream.getVideoTracks().forEach(function (track) { track.stop(); }); - document.getElementById('video').style.display='none'; - document.getElementById('capture').style.display='none'; - document.getElementById('close').style.display='none'; + document.getElementById('video').style.display = 'none'; + document.getElementById('capture').style.display = 'none'; + document.getElementById('close').style.display = 'none'; } } @@ -89909,7 +90083,7 @@ function setInputStepInit() { } module.exports = setInputStepInit; -},{}],353:[function(require,module,exports){ +},{}],357:[function(require,module,exports){ /* * User Interface Handling Module */ @@ -89921,10 +90095,10 @@ module.exports = function UserInterface(events = {}) { // No UI } else if(step.inBrowser) { // Create and append an HTML Element - console.log('Added Step "'+step.name+'"'); + console.log('Added Step "' + step.name + '"'); } else { // Create a NodeJS Object - console.log('\x1b[36m%s\x1b[0m','Added Step "'+step.name+'"'); + console.log('\x1b[36m%s\x1b[0m', 'Added Step "' + step.name + '"'); } }; @@ -89933,10 +90107,10 @@ module.exports = function UserInterface(events = {}) { // No UI } else if(step.inBrowser) { // Overlay a loading spinner - console.log('Drawing Step "'+step.name+'"'); + console.log('Drawing Step "' + step.name + '"'); } else { // Don't do anything - console.log('\x1b[33m%s\x1b[0m','Drawing Step "'+step.name+'"'); + console.log('\x1b[33m%s\x1b[0m', 'Drawing Step "' + step.name + '"'); } }; @@ -89946,10 +90120,10 @@ module.exports = function UserInterface(events = {}) { } else if(step.inBrowser) { // Update the DIV Element // Hide the laoding spinner - console.log('Drawn Step "'+step.name+'"'); + console.log('Drawn Step "' + step.name + '"'); } else { // Update the NodeJS Object - console.log('\x1b[32m%s\x1b[0m','Drawn Step "'+step.name+'"'); + console.log('\x1b[32m%s\x1b[0m', 'Drawn Step "' + step.name + '"'); } }; @@ -89958,10 +90132,10 @@ module.exports = function UserInterface(events = {}) { // No UI } else if(step.inBrowser) { // Remove the DIV Element - console.log('Removing Step "'+step.name+'"'); + console.log('Removing Step "' + step.name + '"'); } else { // Delete the NodeJS Object - console.log('\x1b[31m%s\x1b[0m','Removing Step "'+step.name+'"'); + console.log('\x1b[31m%s\x1b[0m', 'Removing Step "' + step.name + '"'); } }; @@ -89973,8 +90147,8 @@ module.exports = function UserInterface(events = {}) { }; -},{}],354:[function(require,module,exports){ -module.exports = function parseCornerCoordinateInputs(options,coord,callback) { +},{}],358:[function(require,module,exports){ +module.exports = function parseCornerCoordinateInputs(options, coord, callback) { var getPixels = require('get-pixels'); getPixels(coord.src, function(err, pixels) { var iw = pixels.shape[0], @@ -89998,7 +90172,7 @@ module.exports = function parseCornerCoordinateInputs(options,coord,callback) { callback(options, coord); }); }; -},{"get-pixels":28}],355:[function(require,module,exports){ +},{"get-pixels":28}],359:[function(require,module,exports){ module.exports = function createMetaModule(mapFunction, moduleOptions) { moduleOptions = moduleOptions || {}; @@ -90064,7 +90238,7 @@ module.exports = function createMetaModule(mapFunction, moduleOptions) { return [MetaModule, moduleOptions.infoJson]; }; -},{"./getDefaults.js":356}],356:[function(require,module,exports){ +},{"./getDefaults.js":360}],360:[function(require,module,exports){ module.exports = function(info){ var defaults = {}; for (var key in info.inputs) { @@ -90075,7 +90249,7 @@ module.exports = function(info){ return defaults; }; -},{}],357:[function(require,module,exports){ +},{}],361:[function(require,module,exports){ module.exports = { getPreviousStep: function() { return this.getStep(-1); @@ -90125,7 +90299,7 @@ module.exports = { img.src = this.getInput(0).src; } }; -},{}],358:[function(require,module,exports){ +},{}],362:[function(require,module,exports){ module.exports = function parseDistortCoordinates(options) { let coord = []; diff --git a/dist/image-sequencer.min.js b/dist/image-sequencer.min.js index c144031f..6c6bd8ec 100644 --- a/dist/image-sequencer.min.js +++ b/dist/image-sequencer.min.js @@ -1 +1 @@ -!function(){return function t(e,r,n){function i(a,s){if(!r[a]){if(!e[a]){var u="function"==typeof require&&require;if(!s&&u)return u(a,!0);if(o)return o(a,!0);var l=new Error("Cannot find module '"+a+"'");throw l.code="MODULE_NOT_FOUND",l}var c=r[a]={exports:{}};e[a][0].call(c.exports,function(t){return i(e[a][1][t]||t)},c,c.exports,t,e,r,n)}return r[a].exports}for(var o="function"==typeof require&&require,a=0;at)return!1;if((r+=e[n+1])>=t)return!0}}function p(t,e){return t<65?36===t:t<91||(t<97?95===t:t<123||(t<=65535?t>=170&&s.test(String.fromCharCode(t)):!1!==e&&h(t,l)))}function f(t,e){return t<48?36===t:t<58||!(t<65)&&(t<91||(t<97?95===t:t<123||(t<=65535?t>=170&&u.test(String.fromCharCode(t)):!1!==e&&(h(t,l)||h(t,c)))))}var d=function(t,e){void 0===e&&(e={}),this.label=t,this.keyword=e.keyword,this.beforeExpr=!!e.beforeExpr,this.startsExpr=!!e.startsExpr,this.isLoop=!!e.isLoop,this.isAssign=!!e.isAssign,this.prefix=!!e.prefix,this.postfix=!!e.postfix,this.binop=e.binop||null,this.updateContext=null};function m(t,e){return new d(t,{beforeExpr:!0,binop:e})}var g={beforeExpr:!0},v={startsExpr:!0},_={};function y(t,e){return void 0===e&&(e={}),e.keyword=t,_[t]=new d(t,e)}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),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}),_break:y("break"),_case:y("case",g),_catch:y("catch"),_continue:y("continue"),_debugger:y("debugger"),_default:y("default",g),_do:y("do",{isLoop:!0,beforeExpr:!0}),_else:y("else",g),_finally:y("finally"),_for:y("for",{isLoop:!0}),_function:y("function",v),_if:y("if"),_return:y("return",g),_switch:y("switch"),_throw:y("throw",g),_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",v),_super:y("super",v),_class:y("class",v),_extends:y("extends",g),_export:y("export"),_import:y("import"),_null:y("null",v),_true:y("true",v),_false:y("false",v),_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})},x=/\r\n?|\n|\u2028|\u2029/,w=new RegExp(x.source,"g");function E(t,e){return 10===t||13===t||!e&&(8232===t||8233===t)}var k=/[\u1680\u180e\u2000-\u200a\u202f\u205f\u3000\ufeff]/,T=/(?:\s|\/\/.*|\/\*[^]*?\*\/)*/g,S=Object.prototype,A=S.hasOwnProperty,C=S.toString;function R(t,e){return A.call(t,e)}var B=Array.isArray||function(t){return"[object Array]"===C.call(t)},P=function(t,e){this.line=t,this.column=e};P.prototype.offset=function(t){return new P(this.line,this.column+t)};var I=function(t,e,r){this.start=e,this.end=r,null!==t.sourceFile&&(this.source=t.sourceFile)};function M(t,e){for(var r=1,n=0;;){w.lastIndex=n;var i=w.exec(t);if(!(i&&i.index=2015&&(e.ecmaVersion-=2009),null==e.allowReserved&&(e.allowReserved=e.ecmaVersion<5),B(e.onToken)){var n=e.onToken;e.onToken=function(t){return n.push(t)}}return B(e.onComment)&&(e.onComment=function(t,e){return function(r,n,i,o,a,s){var u={type:r?"Block":"Line",value:n,start:i,end:o};t.locations&&(u.loc=new I(this,a,s)),t.ranges&&(u.range=[i,o]),e.push(u)}}(e,e.onComment)),e}var L={};function O(t){return new RegExp("^(?:"+t.replace(/ /g,"|")+")$")}var N=function(t,r,i){this.options=t=F(t),this.sourceFile=t.sourceFile,this.keywords=O(n[t.ecmaVersion>=6?6:5]);var o="";if(!t.allowReserved){for(var a=t.ecmaVersion;!(o=e[a]);a--);"module"===t.sourceType&&(o+=" await")}this.reservedWords=O(o);var s=(o?o+" ":"")+e.strict;this.reservedWordsStrict=O(s),this.reservedWordsStrictBind=O(s+" "+e.strictBind),this.input=String(r),this.containsEsc=!1,this.loadPlugins(t.plugins),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"===t.sourceType,this.strict=this.inModule||this.strictDirective(this.pos),this.potentialArrowAt=-1,this.inFunction=this.inGenerator=this.inAsync=!1,this.yieldPos=this.awaitPos=0,this.labels=[],0===this.pos&&t.allowHashBang&&"#!"===this.input.slice(0,2)&&this.skipLineComment(2),this.scopeStack=[],this.enterFunctionScope(),this.regexpState=null};N.prototype.isKeyword=function(t){return this.keywords.test(t)},N.prototype.isReservedWord=function(t){return this.reservedWords.test(t)},N.prototype.extend=function(t,e){this[t]=e(this[t])},N.prototype.loadPlugins=function(t){for(var e in t){var r=L[e];if(!r)throw new Error("Plugin '"+e+"' not found");r(this,t[e])}},N.prototype.parse=function(){var t=this.options.program||this.startNode();return this.nextToken(),this.parseTopLevel(t)};var j=N.prototype,U=/^(?:'((?:\\.|[^'])*?)'|"((?:\\.|[^"])*?)"|;)/;function z(){this.shorthandAssign=this.trailingComma=this.parenthesizedAssign=this.parenthesizedBind=this.doubleProto=-1}j.strictDirective=function(t){for(;;){T.lastIndex=t,t+=T.exec(this.input)[0].length;var e=U.exec(this.input.slice(t));if(!e)return!1;if("use strict"===(e[1]||e[2]))return!0;t+=e[0].length}},j.eat=function(t){return this.type===t&&(this.next(),!0)},j.isContextual=function(t){return this.type===b.name&&this.value===t&&!this.containsEsc},j.eatContextual=function(t){return!!this.isContextual(t)&&(this.next(),!0)},j.expectContextual=function(t){this.eatContextual(t)||this.unexpected()},j.canInsertSemicolon=function(){return this.type===b.eof||this.type===b.braceR||x.test(this.input.slice(this.lastTokEnd,this.start))},j.insertSemicolon=function(){if(this.canInsertSemicolon())return this.options.onInsertedSemicolon&&this.options.onInsertedSemicolon(this.lastTokEnd,this.lastTokEndLoc),!0},j.semicolon=function(){this.eat(b.semi)||this.insertSemicolon()||this.unexpected()},j.afterTrailingComma=function(t,e){if(this.type===t)return this.options.onTrailingComma&&this.options.onTrailingComma(this.lastTokStart,this.lastTokStartLoc),e||this.next(),!0},j.expect=function(t){this.eat(t)||this.unexpected()},j.unexpected=function(t){this.raise(null!=t?t:this.start,"Unexpected token")},j.checkPatternErrors=function(t,e){if(t){t.trailingComma>-1&&this.raiseRecoverable(t.trailingComma,"Comma is not permitted after the rest element");var r=e?t.parenthesizedAssign:t.parenthesizedBind;r>-1&&this.raiseRecoverable(r,"Parenthesized pattern")}},j.checkExpressionErrors=function(t,e){if(!t)return!1;var r=t.shorthandAssign,n=t.doubleProto;if(!e)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")},j.checkYieldAwaitInDefaultParams=function(){this.yieldPos&&(!this.awaitPos||this.yieldPos=6&&(t.sourceType=this.options.sourceType),this.finishNode(t,"Program")};var $={kind:"loop"},V={kind:"switch"};G.isLet=function(){if(this.options.ecmaVersion<6||!this.isContextual("let"))return!1;T.lastIndex=this.pos;var t=T.exec(this.input),e=this.pos+t[0].length,r=this.input.charCodeAt(e);if(91===r||123===r)return!0;if(p(r,!0)){for(var n=e+1;f(this.input.charCodeAt(n),!0);)++n;var o=this.input.slice(e,n);if(!i.test(o))return!0}return!1},G.isAsyncFunction=function(){if(this.options.ecmaVersion<8||!this.isContextual("async"))return!1;T.lastIndex=this.pos;var t=T.exec(this.input),e=this.pos+t[0].length;return!(x.test(this.input.slice(this.pos,e))||"function"!==this.input.slice(e,e+8)||e+8!==this.input.length&&f(this.input.charAt(e+8)))},G.parseStatement=function(t,e,r){var n,i=this.type,o=this.startNode();switch(this.isLet()&&(i=b._var,n="let"),i){case b._break:case b._continue:return this.parseBreakContinueStatement(o,i.keyword);case b._debugger:return this.parseDebuggerStatement(o);case b._do:return this.parseDoStatement(o);case b._for:return this.parseForStatement(o);case b._function:return!t&&this.options.ecmaVersion>=6&&this.unexpected(),this.parseFunctionStatement(o,!1);case b._class:return t||this.unexpected(),this.parseClass(o,!0);case b._if:return this.parseIfStatement(o);case b._return:return this.parseReturnStatement(o);case b._switch:return this.parseSwitchStatement(o);case b._throw:return this.parseThrowStatement(o);case b._try:return this.parseTryStatement(o);case b._const:case b._var:return n=n||this.value,t||"var"===n||this.unexpected(),this.parseVarStatement(o,n);case b._while:return this.parseWhileStatement(o);case b._with:return this.parseWithStatement(o);case b.braceL:return this.parseBlock();case b.semi:return this.parseEmptyStatement(o);case b._export:case b._import:return this.options.allowImportExportEverywhere||(e||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(o):this.parseExport(o,r);default:if(this.isAsyncFunction())return t||this.unexpected(),this.next(),this.parseFunctionStatement(o,!0);var a=this.value,s=this.parseExpression();return i===b.name&&"Identifier"===s.type&&this.eat(b.colon)?this.parseLabeledStatement(o,a,s):this.parseExpressionStatement(o,s)}},G.parseBreakContinueStatement=function(t,e){var r="break"===e;this.next(),this.eat(b.semi)||this.insertSemicolon()?t.label=null:this.type!==b.name?this.unexpected():(t.label=this.parseIdent(),this.semicolon());for(var n=0;n=6?this.eat(b.semi):this.semicolon(),this.finishNode(t,"DoWhileStatement")},G.parseForStatement=function(t){this.next();var e=this.options.ecmaVersion>=9&&(this.inAsync||!this.inFunction&&this.options.allowAwaitOutsideFunction)&&this.eatContextual("await")?this.lastTokStart:-1;if(this.labels.push($),this.enterLexicalScope(),this.expect(b.parenL),this.type===b.semi)return e>-1&&this.unexpected(e),this.parseFor(t,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||"var"!==i&&n.declarations[0].init?(e>-1&&this.unexpected(e),this.parseFor(t,n)):(this.options.ecmaVersion>=9&&(this.type===b._in?e>-1&&this.unexpected(e):t.await=e>-1),this.parseForIn(t,n))}var o=new z,a=this.parseExpression(!0,o);return this.type===b._in||this.options.ecmaVersion>=6&&this.isContextual("of")?(this.options.ecmaVersion>=9&&(this.type===b._in?e>-1&&this.unexpected(e):t.await=e>-1),this.toAssignable(a,!1,o),this.checkLVal(a),this.parseForIn(t,a)):(this.checkExpressionErrors(o,!0),e>-1&&this.unexpected(e),this.parseFor(t,a))},G.parseFunctionStatement=function(t,e){return this.next(),this.parseFunction(t,!0,!1,e)},G.parseIfStatement=function(t){return this.next(),t.test=this.parseParenExpression(),t.consequent=this.parseStatement(!this.strict&&this.type===b._function),t.alternate=this.eat(b._else)?this.parseStatement(!this.strict&&this.type===b._function):null,this.finishNode(t,"IfStatement")},G.parseReturnStatement=function(t){return this.inFunction||this.options.allowReturnOutsideFunction||this.raise(this.start,"'return' outside of function"),this.next(),this.eat(b.semi)||this.insertSemicolon()?t.argument=null:(t.argument=this.parseExpression(),this.semicolon()),this.finishNode(t,"ReturnStatement")},G.parseSwitchStatement=function(t){var e;this.next(),t.discriminant=this.parseParenExpression(),t.cases=[],this.expect(b.braceL),this.labels.push(V),this.enterLexicalScope();for(var r=!1;this.type!==b.braceR;)if(this.type===b._case||this.type===b._default){var n=this.type===b._case;e&&this.finishNode(e,"SwitchCase"),t.cases.push(e=this.startNode()),e.consequent=[],this.next(),n?e.test=this.parseExpression():(r&&this.raiseRecoverable(this.lastTokStart,"Multiple default clauses"),r=!0,e.test=null),this.expect(b.colon)}else e||this.unexpected(),e.consequent.push(this.parseStatement(!0));return this.exitLexicalScope(),e&&this.finishNode(e,"SwitchCase"),this.next(),this.labels.pop(),this.finishNode(t,"SwitchStatement")},G.parseThrowStatement=function(t){return this.next(),x.test(this.input.slice(this.lastTokEnd,this.start))&&this.raise(this.lastTokEnd,"Illegal newline after throw"),t.argument=this.parseExpression(),this.semicolon(),this.finishNode(t,"ThrowStatement")};var X=[];G.parseTryStatement=function(t){if(this.next(),t.block=this.parseBlock(),t.handler=null,this.type===b._catch){var e=this.startNode();this.next(),this.eat(b.parenL)?(e.param=this.parseBindingAtom(),this.enterLexicalScope(),this.checkLVal(e.param,"let"),this.expect(b.parenR)):(this.options.ecmaVersion<10&&this.unexpected(),e.param=null,this.enterLexicalScope()),e.body=this.parseBlock(!1),this.exitLexicalScope(),t.handler=this.finishNode(e,"CatchClause")}return t.finalizer=this.eat(b._finally)?this.parseBlock():null,t.handler||t.finalizer||this.raise(t.start,"Missing catch or finally clause"),this.finishNode(t,"TryStatement")},G.parseVarStatement=function(t,e){return this.next(),this.parseVar(t,!1,e),this.semicolon(),this.finishNode(t,"VariableDeclaration")},G.parseWhileStatement=function(t){return this.next(),t.test=this.parseParenExpression(),this.labels.push($),t.body=this.parseStatement(!1),this.labels.pop(),this.finishNode(t,"WhileStatement")},G.parseWithStatement=function(t){return this.strict&&this.raise(this.start,"'with' in strict mode"),this.next(),t.object=this.parseParenExpression(),t.body=this.parseStatement(!1),this.finishNode(t,"WithStatement")},G.parseEmptyStatement=function(t){return this.next(),this.finishNode(t,"EmptyStatement")},G.parseLabeledStatement=function(t,e,r){for(var n=0,i=this.labels;n=0;a--){var s=this.labels[a];if(s.statementStart!==t.start)break;s.statementStart=this.start,s.kind=o}return this.labels.push({name:e,kind:o,statementStart:this.start}),t.body=this.parseStatement(!0),("ClassDeclaration"===t.body.type||"VariableDeclaration"===t.body.type&&"var"!==t.body.kind||"FunctionDeclaration"===t.body.type&&(this.strict||t.body.generator||t.body.async))&&this.raiseRecoverable(t.body.start,"Invalid labeled declaration"),this.labels.pop(),t.label=r,this.finishNode(t,"LabeledStatement")},G.parseExpressionStatement=function(t,e){return t.expression=e,this.semicolon(),this.finishNode(t,"ExpressionStatement")},G.parseBlock=function(t){void 0===t&&(t=!0);var e=this.startNode();for(e.body=[],this.expect(b.braceL),t&&this.enterLexicalScope();!this.eat(b.braceR);){var r=this.parseStatement(!0);e.body.push(r)}return t&&this.exitLexicalScope(),this.finishNode(e,"BlockStatement")},G.parseFor=function(t,e){return t.init=e,this.expect(b.semi),t.test=this.type===b.semi?null:this.parseExpression(),this.expect(b.semi),t.update=this.type===b.parenR?null:this.parseExpression(),this.expect(b.parenR),this.exitLexicalScope(),t.body=this.parseStatement(!1),this.labels.pop(),this.finishNode(t,"ForStatement")},G.parseForIn=function(t,e){var r=this.type===b._in?"ForInStatement":"ForOfStatement";return this.next(),"ForInStatement"===r&&("AssignmentPattern"===e.type||"VariableDeclaration"===e.type&&null!=e.declarations[0].init&&(this.strict||"Identifier"!==e.declarations[0].id.type))&&this.raise(e.start,"Invalid assignment in for-in loop head"),t.left=e,t.right="ForInStatement"===r?this.parseExpression():this.parseMaybeAssign(),this.expect(b.parenR),this.exitLexicalScope(),t.body=this.parseStatement(!1),this.labels.pop(),this.finishNode(t,r)},G.parseVar=function(t,e,r){for(t.declarations=[],t.kind=r;;){var n=this.startNode();if(this.parseVarId(n,r),this.eat(b.eq)?n.init=this.parseMaybeAssign(e):"const"!==r||this.type===b._in||this.options.ecmaVersion>=6&&this.isContextual("of")?"Identifier"===n.id.type||e&&(this.type===b._in||this.isContextual("of"))?n.init=null:this.raise(this.lastTokEnd,"Complex binding patterns require an initialization value"):this.unexpected(),t.declarations.push(this.finishNode(n,"VariableDeclarator")),!this.eat(b.comma))break}return t},G.parseVarId=function(t,e){t.id=this.parseBindingAtom(e),this.checkLVal(t.id,e,!1)},G.parseFunction=function(t,e,r,n){this.initFunction(t),(this.options.ecmaVersion>=9||this.options.ecmaVersion>=6&&!n)&&(t.generator=this.eat(b.star)),this.options.ecmaVersion>=8&&(t.async=!!n),e&&(t.id="nullableID"===e&&this.type!==b.name?null:this.parseIdent(),t.id&&this.checkLVal(t.id,this.inModule&&!this.inFunction?"let":"var"));var i=this.inGenerator,o=this.inAsync,a=this.yieldPos,s=this.awaitPos,u=this.inFunction;return this.inGenerator=t.generator,this.inAsync=t.async,this.yieldPos=0,this.awaitPos=0,this.inFunction=!0,this.enterFunctionScope(),e||(t.id=this.type===b.name?this.parseIdent():null),this.parseFunctionParams(t),this.parseFunctionBody(t,r),this.inGenerator=i,this.inAsync=o,this.yieldPos=a,this.awaitPos=s,this.inFunction=u,this.finishNode(t,e?"FunctionDeclaration":"FunctionExpression")},G.parseFunctionParams=function(t){this.expect(b.parenL),t.params=this.parseBindingList(b.parenR,!1,this.options.ecmaVersion>=8),this.checkYieldAwaitInDefaultParams()},G.parseClass=function(t,e){this.next(),this.parseClassId(t,e),this.parseClassSuper(t);var r=this.startNode(),n=!1;for(r.body=[],this.expect(b.braceL);!this.eat(b.braceR);){var i=this.parseClassMember(r);i&&"MethodDefinition"===i.type&&"constructor"===i.kind&&(n&&this.raise(i.start,"Duplicate constructor in the same class"),n=!0)}return t.body=this.finishNode(r,"ClassBody"),this.finishNode(t,e?"ClassDeclaration":"ClassExpression")},G.parseClassMember=function(t){var e=this;if(this.eat(b.semi))return null;var r=this.startNode(),n=function(t,n){void 0===n&&(n=!1);var i=e.start,o=e.startLoc;return!!e.eatContextual(t)&&(!(e.type===b.parenL||n&&e.canInsertSemicolon())||(r.key&&e.unexpected(),r.computed=!1,r.key=e.startNodeAt(i,o),r.key.name=t,e.finishNode(r.key,"Identifier"),!1))};r.kind="method",r.static=n("static");var i=this.eat(b.star),o=!1;i||(this.options.ecmaVersion>=8&&n("async",!0)?(o=!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;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"),o&&this.raise(a.start,"Constructor can't be an async method"),r.kind="constructor"),this.parseClassMethod(t,r,i,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},G.parseClassMethod=function(t,e,r,n){e.value=this.parseMethod(r,n),t.body.push(this.finishNode(e,"MethodDefinition"))},G.parseClassId=function(t,e){t.id=this.type===b.name?this.parseIdent():!0===e?this.unexpected():null},G.parseClassSuper=function(t){t.superClass=this.eat(b._extends)?this.parseExprSubscripts():null},G.parseExport=function(t,e){if(this.next(),this.eat(b.star))return this.expectContextual("from"),this.type!==b.string&&this.unexpected(),t.source=this.parseExprAtom(),this.semicolon(),this.finishNode(t,"ExportAllDeclaration");if(this.eat(b._default)){var r;if(this.checkExport(e,"default",this.lastTokStart),this.type===b._function||(r=this.isAsyncFunction())){var n=this.startNode();this.next(),r&&this.next(),t.declaration=this.parseFunction(n,"nullableID",!1,r)}else if(this.type===b._class){var i=this.startNode();t.declaration=this.parseClass(i,"nullableID")}else t.declaration=this.parseMaybeAssign(),this.semicolon();return this.finishNode(t,"ExportDefaultDeclaration")}if(this.shouldParseExportStatement())t.declaration=this.parseStatement(!0),"VariableDeclaration"===t.declaration.type?this.checkVariableExport(e,t.declaration.declarations):this.checkExport(e,t.declaration.id.name,t.declaration.id.start),t.specifiers=[],t.source=null;else{if(t.declaration=null,t.specifiers=this.parseExportSpecifiers(e),this.eatContextual("from"))this.type!==b.string&&this.unexpected(),t.source=this.parseExprAtom();else{for(var o=0,a=t.specifiers;o=6&&t)switch(t.type){case"Identifier":this.inAsync&&"await"===t.name&&this.raise(t.start,"Can not use 'await' as identifier inside an async function");break;case"ObjectPattern":case"ArrayPattern":case"RestElement":break;case"ObjectExpression":t.type="ObjectPattern",r&&this.checkPatternErrors(r,!0);for(var n=0,i=t.properties;n=9&&"SpreadElement"===t.type||this.options.ecmaVersion>=6&&(t.computed||t.method||t.shorthand))){var n,i=t.key;switch(i.type){case"Identifier":n=i.name;break;case"Literal":n=String(i.value);break;default:return}var o=t.kind;if(this.options.ecmaVersion>=6)"__proto__"===n&&"init"===o&&(e.proto&&(r&&r.doubleProto<0?r.doubleProto=i.start:this.raiseRecoverable(i.start,"Redefinition of __proto__ property")),e.proto=!0);else{var a=e[n="$"+n];if(a)("init"===o?this.strict&&a.init||a.get||a.set:a.init||a[o])&&this.raiseRecoverable(i.start,"Redefinition of property");else a=e[n]={init:!1,get:!1,set:!1};a[o]=!0}}},K.parseExpression=function(t,e){var r=this.start,n=this.startLoc,i=this.parseMaybeAssign(t,e);if(this.type===b.comma){var o=this.startNodeAt(r,n);for(o.expressions=[i];this.eat(b.comma);)o.expressions.push(this.parseMaybeAssign(t,e));return this.finishNode(o,"SequenceExpression")}return i},K.parseMaybeAssign=function(t,e,r){if(this.inGenerator&&this.isContextual("yield"))return this.parseYield();var n=!1,i=-1,o=-1;e?(i=e.parenthesizedAssign,o=e.trailingComma,e.parenthesizedAssign=e.trailingComma=-1):(e=new z,n=!0);var a=this.start,s=this.startLoc;this.type!==b.parenL&&this.type!==b.name||(this.potentialArrowAt=this.start);var u=this.parseMaybeConditional(t,e);if(r&&(u=r.call(this,u,a,s)),this.type.isAssign){var l=this.startNodeAt(a,s);return l.operator=this.value,l.left=this.type===b.eq?this.toAssignable(u,!1,e):u,n||z.call(e),e.shorthandAssign=-1,this.checkLVal(u),this.next(),l.right=this.parseMaybeAssign(t),this.finishNode(l,"AssignmentExpression")}return n&&this.checkExpressionErrors(e,!0),i>-1&&(e.parenthesizedAssign=i),o>-1&&(e.trailingComma=o),u},K.parseMaybeConditional=function(t,e){var r=this.start,n=this.startLoc,i=this.parseExprOps(t,e);if(this.checkExpressionErrors(e))return i;if(this.eat(b.question)){var o=this.startNodeAt(r,n);return o.test=i,o.consequent=this.parseMaybeAssign(),this.expect(b.colon),o.alternate=this.parseMaybeAssign(t),this.finishNode(o,"ConditionalExpression")}return i},K.parseExprOps=function(t,e){var r=this.start,n=this.startLoc,i=this.parseMaybeUnary(e,!1);return this.checkExpressionErrors(e)?i:i.start===r&&"ArrowFunctionExpression"===i.type?i:this.parseExprOp(i,r,n,-1,t)},K.parseExprOp=function(t,e,r,n,i){var o=this.type.binop;if(null!=o&&(!i||this.type!==b._in)&&o>n){var a=this.type===b.logicalOR||this.type===b.logicalAND,s=this.value;this.next();var u=this.start,l=this.startLoc,c=this.parseExprOp(this.parseMaybeUnary(null,!1),u,l,o,i),h=this.buildBinary(e,r,t,c,s,a);return this.parseExprOp(h,e,r,n,i)}return t},K.buildBinary=function(t,e,r,n,i,o){var a=this.startNodeAt(t,e);return a.left=r,a.operator=i,a.right=n,this.finishNode(a,o?"LogicalExpression":"BinaryExpression")},K.parseMaybeUnary=function(t,e){var r,n=this.start,i=this.startLoc;if(this.isContextual("await")&&(this.inAsync||!this.inFunction&&this.options.allowAwaitOutsideFunction))r=this.parseAwait(),e=!0;else if(this.type.prefix){var o=this.startNode(),a=this.type===b.incDec;o.operator=this.value,o.prefix=!0,this.next(),o.argument=this.parseMaybeUnary(null,!0),this.checkExpressionErrors(t,!0),a?this.checkLVal(o.argument):this.strict&&"delete"===o.operator&&"Identifier"===o.argument.type?this.raiseRecoverable(o.start,"Deleting local variable in strict mode"):e=!0,r=this.finishNode(o,a?"UpdateExpression":"UnaryExpression")}else{if(r=this.parseExprSubscripts(t),this.checkExpressionErrors(t))return r;for(;this.type.postfix&&!this.canInsertSemicolon();){var s=this.startNodeAt(n,i);s.operator=this.value,s.prefix=!1,s.argument=r,this.checkLVal(r),this.next(),r=this.finishNode(s,"UpdateExpression")}}return!e&&this.eat(b.starstar)?this.buildBinary(n,i,r,this.parseMaybeUnary(null,!1),"**",!1):r},K.parseExprSubscripts=function(t){var e=this.start,r=this.startLoc,n=this.parseExprAtom(t),i="ArrowFunctionExpression"===n.type&&")"!==this.input.slice(this.lastTokStart,this.lastTokEnd);if(this.checkExpressionErrors(t)||i)return n;var o=this.parseSubscripts(n,e,r);return t&&"MemberExpression"===o.type&&(t.parenthesizedAssign>=o.start&&(t.parenthesizedAssign=-1),t.parenthesizedBind>=o.start&&(t.parenthesizedBind=-1)),o},K.parseSubscripts=function(t,e,r,n){for(var i=this.options.ecmaVersion>=8&&"Identifier"===t.type&&"async"===t.name&&this.lastTokEnd===t.end&&!this.canInsertSemicolon()&&"async"===this.input.slice(t.start,t.end),o=void 0;;)if((o=this.eat(b.bracketL))||this.eat(b.dot)){var a=this.startNodeAt(e,r);a.object=t,a.property=o?this.parseExpression():this.parseIdent(!0),a.computed=!!o,o&&this.expect(b.bracketR),t=this.finishNode(a,"MemberExpression")}else if(!n&&this.eat(b.parenL)){var s=new z,u=this.yieldPos,l=this.awaitPos;this.yieldPos=0,this.awaitPos=0;var c=this.parseExprList(b.parenR,this.options.ecmaVersion>=8,!1,s);if(i&&!this.canInsertSemicolon()&&this.eat(b.arrow))return this.checkPatternErrors(s,!1),this.checkYieldAwaitInDefaultParams(),this.yieldPos=u,this.awaitPos=l,this.parseArrowExpression(this.startNodeAt(e,r),c,!0);this.checkExpressionErrors(s,!0),this.yieldPos=u||this.yieldPos,this.awaitPos=l||this.awaitPos;var h=this.startNodeAt(e,r);h.callee=t,h.arguments=c,t=this.finishNode(h,"CallExpression")}else{if(this.type!==b.backQuote)return t;var p=this.startNodeAt(e,r);p.tag=t,p.quasi=this.parseTemplate({isTagged:!0}),t=this.finishNode(p,"TaggedTemplateExpression")}},K.parseExprAtom=function(t){var e,r=this.potentialArrowAt===this.start;switch(this.type){case b._super:return this.inFunction||this.raise(this.start,"'super' outside of function or class"),e=this.startNode(),this.next(),this.type!==b.dot&&this.type!==b.bracketL&&this.type!==b.parenL&&this.unexpected(),this.finishNode(e,"Super");case b._this:return e=this.startNode(),this.next(),this.finishNode(e,"ThisExpression");case b.name:var n=this.start,i=this.startLoc,o=this.containsEsc,a=this.parseIdent(this.type!==b.name);if(this.options.ecmaVersion>=8&&!o&&"async"===a.name&&!this.canInsertSemicolon()&&this.eat(b._function))return this.parseFunction(this.startNodeAt(n,i),!1,!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&&!o)return a=this.parseIdent(),!this.canInsertSemicolon()&&this.eat(b.arrow)||this.unexpected(),this.parseArrowExpression(this.startNodeAt(n,i),[a],!0)}return a;case b.regexp:var s=this.value;return(e=this.parseLiteral(s.value)).regex={pattern:s.pattern,flags:s.flags},e;case b.num:case b.string:return this.parseLiteral(this.value);case b._null:case b._true:case b._false:return(e=this.startNode()).value=this.type===b._null?null:this.type===b._true,e.raw=this.type.keyword,this.next(),this.finishNode(e,"Literal");case b.parenL:var u=this.start,l=this.parseParenAndDistinguishExpression(r);return t&&(t.parenthesizedAssign<0&&!this.isSimpleAssignTarget(l)&&(t.parenthesizedAssign=u),t.parenthesizedBind<0&&(t.parenthesizedBind=u)),l;case b.bracketL:return e=this.startNode(),this.next(),e.elements=this.parseExprList(b.bracketR,!0,!0,t),this.finishNode(e,"ArrayExpression");case b.braceL:return this.parseObj(!1,t);case b._function:return e=this.startNode(),this.next(),this.parseFunction(e,!1);case b._class:return this.parseClass(this.startNode(),!1);case b._new:return this.parseNew();case b.backQuote:return this.parseTemplate();default:this.unexpected()}},K.parseLiteral=function(t){var e=this.startNode();return e.value=t,e.raw=this.input.slice(this.start,this.end),this.next(),this.finishNode(e,"Literal")},K.parseParenExpression=function(){this.expect(b.parenL);var t=this.parseExpression();return this.expect(b.parenR),t},K.parseParenAndDistinguishExpression=function(t){var e,r=this.start,n=this.startLoc,i=this.options.ecmaVersion>=8;if(this.options.ecmaVersion>=6){this.next();var o,a=this.start,s=this.startLoc,u=[],l=!0,c=!1,h=new z,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){o=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),t&&!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),o&&this.unexpected(o),this.checkExpressionErrors(h,!0),this.yieldPos=p||this.yieldPos,this.awaitPos=f||this.awaitPos,u.length>1?((e=this.startNodeAt(a,s)).expressions=u,this.finishNodeAt(e,"SequenceExpression",d,m)):e=u[0]}else e=this.parseParenExpression();if(this.options.preserveParens){var g=this.startNodeAt(r,n);return g.expression=e,this.finishNode(g,"ParenthesizedExpression")}return e},K.parseParenItem=function(t){return t},K.parseParenArrowList=function(t,e,r){return this.parseArrowExpression(this.startNodeAt(t,e),r)};var W=[];K.parseNew=function(){var t=this.startNode(),e=this.parseIdent(!0);if(this.options.ecmaVersion>=6&&this.eat(b.dot)){t.meta=e;var r=this.containsEsc;return t.property=this.parseIdent(!0),("target"!==t.property.name||r)&&this.raiseRecoverable(t.property.start,"The only valid meta property for new is new.target"),this.inFunction||this.raiseRecoverable(t.start,"new.target can only be used in functions"),this.finishNode(t,"MetaProperty")}var n=this.start,i=this.startLoc;return t.callee=this.parseSubscripts(this.parseExprAtom(),n,i,!0),this.eat(b.parenL)?t.arguments=this.parseExprList(b.parenR,this.options.ecmaVersion>=8,!1):t.arguments=W,this.finishNode(t,"NewExpression")},K.parseTemplateElement=function(t){var e=t.isTagged,r=this.startNode();return this.type===b.invalidTemplate?(e||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")},K.parseTemplate=function(t){void 0===t&&(t={});var e=t.isTagged;void 0===e&&(e=!1);var r=this.startNode();this.next(),r.expressions=[];var n=this.parseTemplateElement({isTagged:e});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:e}));return this.next(),this.finishNode(r,"TemplateLiteral")},K.isAsyncProp=function(t){return!t.computed&&"Identifier"===t.key.type&&"async"===t.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))},K.parseObj=function(t,e){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.afterTrailingComma(b.braceR))break;var o=this.parseProperty(t,e);t||this.checkPropClash(o,i,e),r.properties.push(o)}return this.finishNode(r,t?"ObjectPattern":"ObjectExpression")},K.parseProperty=function(t,e){var r,n,i,o,a=this.startNode();if(this.options.ecmaVersion>=9&&this.eat(b.ellipsis))return t?(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&&e&&(e.parenthesizedAssign<0&&(e.parenthesizedAssign=this.start),e.parenthesizedBind<0&&(e.parenthesizedBind=this.start)),a.argument=this.parseMaybeAssign(!1,e),this.type===b.comma&&e&&e.trailingComma<0&&(e.trailingComma=this.start),this.finishNode(a,"SpreadElement"));this.options.ecmaVersion>=6&&(a.method=!1,a.shorthand=!1,(t||e)&&(i=this.start,o=this.startLoc),t||(r=this.eat(b.star)));var s=this.containsEsc;return this.parsePropertyName(a),!t&&!s&&this.options.ecmaVersion>=8&&!r&&this.isAsyncProp(a)?(n=!0,r=this.options.ecmaVersion>=9&&this.eat(b.star),this.parsePropertyName(a,e)):n=!1,this.parsePropertyValue(a,t,r,n,i,o,e,s),this.finishNode(a,"Property")},K.parsePropertyValue=function(t,e,r,n,i,o,a,s){if((r||n)&&this.type===b.colon&&this.unexpected(),this.eat(b.colon))t.value=e?this.parseMaybeDefault(this.start,this.startLoc):this.parseMaybeAssign(!1,a),t.kind="init";else if(this.options.ecmaVersion>=6&&this.type===b.parenL)e&&this.unexpected(),t.kind="init",t.method=!0,t.value=this.parseMethod(r,n);else if(e||s||!(this.options.ecmaVersion>=5)||t.computed||"Identifier"!==t.key.type||"get"!==t.key.name&&"set"!==t.key.name||this.type===b.comma||this.type===b.braceR)this.options.ecmaVersion>=6&&!t.computed&&"Identifier"===t.key.type?(this.checkUnreserved(t.key),t.kind="init",e?t.value=this.parseMaybeDefault(i,o,t.key):this.type===b.eq&&a?(a.shorthandAssign<0&&(a.shorthandAssign=this.start),t.value=this.parseMaybeDefault(i,o,t.key)):t.value=t.key,t.shorthand=!0):this.unexpected();else{(r||n)&&this.unexpected(),t.kind=t.key.name,this.parsePropertyName(t),t.value=this.parseMethod(!1);var u="get"===t.kind?0:1;if(t.value.params.length!==u){var l=t.value.start;"get"===t.kind?this.raiseRecoverable(l,"getter should have no params"):this.raiseRecoverable(l,"setter should have exactly one param")}else"set"===t.kind&&"RestElement"===t.value.params[0].type&&this.raiseRecoverable(t.value.params[0].start,"Setter cannot use rest params")}},K.parsePropertyName=function(t){if(this.options.ecmaVersion>=6){if(this.eat(b.bracketL))return t.computed=!0,t.key=this.parseMaybeAssign(),this.expect(b.bracketR),t.key;t.computed=!1}return t.key=this.type===b.num||this.type===b.string?this.parseExprAtom():this.parseIdent(!0)},K.initFunction=function(t){t.id=null,this.options.ecmaVersion>=6&&(t.generator=!1,t.expression=!1),this.options.ecmaVersion>=8&&(t.async=!1)},K.parseMethod=function(t,e){var r=this.startNode(),n=this.inGenerator,i=this.inAsync,o=this.yieldPos,a=this.awaitPos,s=this.inFunction;return this.initFunction(r),this.options.ecmaVersion>=6&&(r.generator=t),this.options.ecmaVersion>=8&&(r.async=!!e),this.inGenerator=r.generator,this.inAsync=r.async,this.yieldPos=0,this.awaitPos=0,this.inFunction=!0,this.enterFunctionScope(),this.expect(b.parenL),r.params=this.parseBindingList(b.parenR,!1,this.options.ecmaVersion>=8),this.checkYieldAwaitInDefaultParams(),this.parseFunctionBody(r,!1),this.inGenerator=n,this.inAsync=i,this.yieldPos=o,this.awaitPos=a,this.inFunction=s,this.finishNode(r,"FunctionExpression")},K.parseArrowExpression=function(t,e,r){var n=this.inGenerator,i=this.inAsync,o=this.yieldPos,a=this.awaitPos,s=this.inFunction;return this.enterFunctionScope(),this.initFunction(t),this.options.ecmaVersion>=8&&(t.async=!!r),this.inGenerator=!1,this.inAsync=t.async,this.yieldPos=0,this.awaitPos=0,this.inFunction=!0,t.params=this.toAssignableList(e,!0),this.parseFunctionBody(t,!0),this.inGenerator=n,this.inAsync=i,this.yieldPos=o,this.awaitPos=a,this.inFunction=s,this.finishNode(t,"ArrowFunctionExpression")},K.parseFunctionBody=function(t,e){var r=e&&this.type!==b.braceL,n=this.strict,i=!1;if(r)t.body=this.parseMaybeAssign(),t.expression=!0,this.checkParams(t,!1);else{var o=this.options.ecmaVersion>=7&&!this.isSimpleParamList(t.params);n&&!o||(i=this.strictDirective(this.end))&&o&&this.raiseRecoverable(t.start,"Illegal 'use strict' directive in function with non-simple parameter list");var a=this.labels;this.labels=[],i&&(this.strict=!0),this.checkParams(t,!n&&!i&&!e&&this.isSimpleParamList(t.params)),t.body=this.parseBlock(!1),t.expression=!1,this.adaptDirectivePrologue(t.body.body),this.labels=a}this.exitFunctionScope(),this.strict&&t.id&&this.checkLVal(t.id,"none"),this.strict=n},K.isSimpleParamList=function(t){for(var e=0,r=t;e0;)e[r]=arguments[r+1];for(var n=0,i=e;n=1;t--){var e=this.context[t];if("function"===e.token)return e.generator}return!1},nt.updateContext=function(t){var e,r=this.type;r.keyword&&t===b.dot?this.exprAllowed=!1:(e=r.updateContext)?e.call(this,t):this.exprAllowed=r.beforeExpr},b.parenR.updateContext=b.braceR.updateContext=function(){if(1!==this.context.length){var t=this.context.pop();t===rt.b_stat&&"function"===this.curContext().token&&(t=this.context.pop()),this.exprAllowed=!t.isExpr}else this.exprAllowed=!0},b.braceL.updateContext=function(t){this.context.push(this.braceIsBlock(t)?rt.b_stat:rt.b_expr),this.exprAllowed=!0},b.dollarBraceL.updateContext=function(){this.context.push(rt.b_tmpl),this.exprAllowed=!0},b.parenL.updateContext=function(t){var e=t===b._if||t===b._for||t===b._with||t===b._while;this.context.push(e?rt.p_stat:rt.p_expr),this.exprAllowed=!0},b.incDec.updateContext=function(){},b._function.updateContext=b._class.updateContext=function(t){t.beforeExpr&&t!==b.semi&&t!==b._else&&(t!==b.colon&&t!==b.braceL||this.curContext()!==rt.b_stat)?this.context.push(rt.f_expr):this.context.push(rt.f_stat),this.exprAllowed=!1},b.backQuote.updateContext=function(){this.curContext()===rt.q_tmpl?this.context.pop():this.context.push(rt.q_tmpl),this.exprAllowed=!1},b.star.updateContext=function(t){if(t===b._function){var e=this.context.length-1;this.context[e]===rt.f_expr?this.context[e]=rt.f_expr_gen:this.context[e]=rt.f_gen}this.exprAllowed=!0},b.name.updateContext=function(t){var e=!1;this.options.ecmaVersion>=6&&t!==b.dot&&("of"===this.value&&!this.exprAllowed||"yield"===this.value&&this.inGeneratorContext())&&(e=!0),this.exprAllowed=e};var it={$LONE:["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"],General_Category:["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"],Script:["Adlam","Adlm","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","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","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","Mongolian","Mong","Mro","Mroo","Multani","Mult","Myanmar","Mymr","Nabataean","Nbat","New_Tai_Lue","Talu","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","Tibetan","Tibt","Tifinagh","Tfng","Tirhuta","Tirh","Ugaritic","Ugar","Vai","Vaii","Warang_Citi","Wara","Yi","Yiii","Zanabazar_Square","Zanb"]};Array.prototype.push.apply(it.$LONE,it.General_Category),it.gc=it.General_Category,it.sc=it.Script_Extensions=it.scx=it.Script;var ot=N.prototype,at=function(t){this.parser=t,this.validFlags="gim"+(t.options.ecmaVersion>=6?"uy":"")+(t.options.ecmaVersion>=9?"s":""),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 st(t){return t<=65535?String.fromCharCode(t):(t-=65536,String.fromCharCode(55296+(t>>10),56320+(1023&t)))}function ut(t){return 36===t||t>=40&&t<=43||46===t||63===t||t>=91&&t<=94||t>=123&&t<=125}function lt(t){return t>=65&&t<=90||t>=97&&t<=122}function ct(t){return lt(t)||95===t}function ht(t){return ct(t)||pt(t)}function pt(t){return t>=48&&t<=57}function ft(t){return t>=48&&t<=57||t>=65&&t<=70||t>=97&&t<=102}function dt(t){return t>=65&&t<=70?t-65+10:t>=97&&t<=102?t-97+10:t-48}function mt(t){return t>=48&&t<=55}at.prototype.reset=function(t,e,r){var n=-1!==r.indexOf("u");this.start=0|t,this.source=e+"",this.flags=r,this.switchU=n&&this.parser.options.ecmaVersion>=6,this.switchN=n&&this.parser.options.ecmaVersion>=9},at.prototype.raise=function(t){this.parser.raiseRecoverable(this.start,"Invalid regular expression: /"+this.source+"/: "+t)},at.prototype.at=function(t){var e=this.source,r=e.length;if(t>=r)return-1;var n=e.charCodeAt(t);return!this.switchU||n<=55295||n>=57344||t+1>=r?n:(n<<10)+e.charCodeAt(t+1)-56613888},at.prototype.nextIndex=function(t){var e=this.source,r=e.length;if(t>=r)return r;var n=e.charCodeAt(t);return!this.switchU||n<=55295||n>=57344||t+1>=r?t+1:t+2},at.prototype.current=function(){return this.at(this.pos)},at.prototype.lookahead=function(){return this.at(this.nextIndex(this.pos))},at.prototype.advance=function(){this.pos=this.nextIndex(this.pos)},at.prototype.eat=function(t){return this.current()===t&&(this.advance(),!0)},ot.validateRegExpFlags=function(t){for(var e=t.validFlags,r=t.flags,n=0;n-1&&this.raise(t.start,"Duplicate regular expression flag")}},ot.validateRegExpPattern=function(t){this.regexp_pattern(t),!t.switchN&&this.options.ecmaVersion>=9&&t.groupNames.length>0&&(t.switchN=!0,this.regexp_pattern(t))},ot.regexp_pattern=function(t){t.pos=0,t.lastIntValue=0,t.lastStringValue="",t.lastAssertionIsQuantifiable=!1,t.numCapturingParens=0,t.maxBackReference=0,t.groupNames.length=0,t.backReferenceNames.length=0,this.regexp_disjunction(t),t.pos!==t.source.length&&(t.eat(41)&&t.raise("Unmatched ')'"),(t.eat(93)||t.eat(125))&&t.raise("Lone quantifier brackets")),t.maxBackReference>t.numCapturingParens&&t.raise("Invalid escape");for(var e=0,r=t.backReferenceNames;e=9&&(r=t.eat(60)),t.eat(61)||t.eat(33))return this.regexp_disjunction(t),t.eat(41)||t.raise("Unterminated group"),t.lastAssertionIsQuantifiable=!r,!0}return t.pos=e,!1},ot.regexp_eatQuantifier=function(t,e){return void 0===e&&(e=!1),!!this.regexp_eatQuantifierPrefix(t,e)&&(t.eat(63),!0)},ot.regexp_eatQuantifierPrefix=function(t,e){return t.eat(42)||t.eat(43)||t.eat(63)||this.regexp_eatBracedQuantifier(t,e)},ot.regexp_eatBracedQuantifier=function(t,e){var r=t.pos;if(t.eat(123)){var n=0,i=-1;if(this.regexp_eatDecimalDigits(t)&&(n=t.lastIntValue,t.eat(44)&&this.regexp_eatDecimalDigits(t)&&(i=t.lastIntValue),t.eat(125)))return-1!==i&&i=9?this.regexp_groupSpecifier(t):63===t.current()&&t.raise("Invalid group"),this.regexp_disjunction(t),t.eat(41))return t.numCapturingParens+=1,!0;t.raise("Unterminated group")}return!1},ot.regexp_eatExtendedAtom=function(t){return t.eat(46)||this.regexp_eatReverseSolidusAtomEscape(t)||this.regexp_eatCharacterClass(t)||this.regexp_eatUncapturingGroup(t)||this.regexp_eatCapturingGroup(t)||this.regexp_eatInvalidBracedQuantifier(t)||this.regexp_eatExtendedPatternCharacter(t)},ot.regexp_eatInvalidBracedQuantifier=function(t){return this.regexp_eatBracedQuantifier(t,!0)&&t.raise("Nothing to repeat"),!1},ot.regexp_eatSyntaxCharacter=function(t){var e=t.current();return!!ut(e)&&(t.lastIntValue=e,t.advance(),!0)},ot.regexp_eatPatternCharacters=function(t){for(var e=t.pos,r=0;-1!==(r=t.current())&&!ut(r);)t.advance();return t.pos!==e},ot.regexp_eatExtendedPatternCharacter=function(t){var e=t.current();return!(-1===e||36===e||e>=40&&e<=43||46===e||63===e||91===e||94===e||124===e)&&(t.advance(),!0)},ot.regexp_groupSpecifier=function(t){if(t.eat(63)){if(this.regexp_eatGroupName(t))return-1!==t.groupNames.indexOf(t.lastStringValue)&&t.raise("Duplicate capture group name"),void t.groupNames.push(t.lastStringValue);t.raise("Invalid group")}},ot.regexp_eatGroupName=function(t){if(t.lastStringValue="",t.eat(60)){if(this.regexp_eatRegExpIdentifierName(t)&&t.eat(62))return!0;t.raise("Invalid capture group name")}return!1},ot.regexp_eatRegExpIdentifierName=function(t){if(t.lastStringValue="",this.regexp_eatRegExpIdentifierStart(t)){for(t.lastStringValue+=st(t.lastIntValue);this.regexp_eatRegExpIdentifierPart(t);)t.lastStringValue+=st(t.lastIntValue);return!0}return!1},ot.regexp_eatRegExpIdentifierStart=function(t){var e=t.pos,r=t.current();return t.advance(),92===r&&this.regexp_eatRegExpUnicodeEscapeSequence(t)&&(r=t.lastIntValue),function(t){return p(t,!0)||36===t||95===t}(r)?(t.lastIntValue=r,!0):(t.pos=e,!1)},ot.regexp_eatRegExpIdentifierPart=function(t){var e=t.pos,r=t.current();return t.advance(),92===r&&this.regexp_eatRegExpUnicodeEscapeSequence(t)&&(r=t.lastIntValue),function(t){return f(t,!0)||36===t||95===t||8204===t||8205===t}(r)?(t.lastIntValue=r,!0):(t.pos=e,!1)},ot.regexp_eatAtomEscape=function(t){return!!(this.regexp_eatBackReference(t)||this.regexp_eatCharacterClassEscape(t)||this.regexp_eatCharacterEscape(t)||t.switchN&&this.regexp_eatKGroupName(t))||(t.switchU&&(99===t.current()&&t.raise("Invalid unicode escape"),t.raise("Invalid escape")),!1)},ot.regexp_eatBackReference=function(t){var e=t.pos;if(this.regexp_eatDecimalEscape(t)){var r=t.lastIntValue;if(t.switchU)return r>t.maxBackReference&&(t.maxBackReference=r),!0;if(r<=t.numCapturingParens)return!0;t.pos=e}return!1},ot.regexp_eatKGroupName=function(t){if(t.eat(107)){if(this.regexp_eatGroupName(t))return t.backReferenceNames.push(t.lastStringValue),!0;t.raise("Invalid named reference")}return!1},ot.regexp_eatCharacterEscape=function(t){return this.regexp_eatControlEscape(t)||this.regexp_eatCControlLetter(t)||this.regexp_eatZero(t)||this.regexp_eatHexEscapeSequence(t)||this.regexp_eatRegExpUnicodeEscapeSequence(t)||!t.switchU&&this.regexp_eatLegacyOctalEscapeSequence(t)||this.regexp_eatIdentityEscape(t)},ot.regexp_eatCControlLetter=function(t){var e=t.pos;if(t.eat(99)){if(this.regexp_eatControlLetter(t))return!0;t.pos=e}return!1},ot.regexp_eatZero=function(t){return 48===t.current()&&!pt(t.lookahead())&&(t.lastIntValue=0,t.advance(),!0)},ot.regexp_eatControlEscape=function(t){var e=t.current();return 116===e?(t.lastIntValue=9,t.advance(),!0):110===e?(t.lastIntValue=10,t.advance(),!0):118===e?(t.lastIntValue=11,t.advance(),!0):102===e?(t.lastIntValue=12,t.advance(),!0):114===e&&(t.lastIntValue=13,t.advance(),!0)},ot.regexp_eatControlLetter=function(t){var e=t.current();return!!lt(e)&&(t.lastIntValue=e%32,t.advance(),!0)},ot.regexp_eatRegExpUnicodeEscapeSequence=function(t){var e,r=t.pos;if(t.eat(117)){if(this.regexp_eatFixedHexDigits(t,4)){var n=t.lastIntValue;if(t.switchU&&n>=55296&&n<=56319){var i=t.pos;if(t.eat(92)&&t.eat(117)&&this.regexp_eatFixedHexDigits(t,4)){var o=t.lastIntValue;if(o>=56320&&o<=57343)return t.lastIntValue=1024*(n-55296)+(o-56320)+65536,!0}t.pos=i,t.lastIntValue=n}return!0}if(t.switchU&&t.eat(123)&&this.regexp_eatHexDigits(t)&&t.eat(125)&&((e=t.lastIntValue)>=0&&e<=1114111))return!0;t.switchU&&t.raise("Invalid unicode escape"),t.pos=r}return!1},ot.regexp_eatIdentityEscape=function(t){if(t.switchU)return!!this.regexp_eatSyntaxCharacter(t)||!!t.eat(47)&&(t.lastIntValue=47,!0);var e=t.current();return!(99===e||t.switchN&&107===e)&&(t.lastIntValue=e,t.advance(),!0)},ot.regexp_eatDecimalEscape=function(t){t.lastIntValue=0;var e=t.current();if(e>=49&&e<=57){do{t.lastIntValue=10*t.lastIntValue+(e-48),t.advance()}while((e=t.current())>=48&&e<=57);return!0}return!1},ot.regexp_eatCharacterClassEscape=function(t){var e=t.current();if(function(t){return 100===t||68===t||115===t||83===t||119===t||87===t}(e))return t.lastIntValue=-1,t.advance(),!0;if(t.switchU&&this.options.ecmaVersion>=9&&(80===e||112===e)){if(t.lastIntValue=-1,t.advance(),t.eat(123)&&this.regexp_eatUnicodePropertyValueExpression(t)&&t.eat(125))return!0;t.raise("Invalid property name")}return!1},ot.regexp_eatUnicodePropertyValueExpression=function(t){var e=t.pos;if(this.regexp_eatUnicodePropertyName(t)&&t.eat(61)){var r=t.lastStringValue;if(this.regexp_eatUnicodePropertyValue(t)){var n=t.lastStringValue;return this.regexp_validateUnicodePropertyNameAndValue(t,r,n),!0}}if(t.pos=e,this.regexp_eatLoneUnicodePropertyNameOrValue(t)){var i=t.lastStringValue;return this.regexp_validateUnicodePropertyNameOrValue(t,i),!0}return!1},ot.regexp_validateUnicodePropertyNameAndValue=function(t,e,r){it.hasOwnProperty(e)&&-1!==it[e].indexOf(r)||t.raise("Invalid property name")},ot.regexp_validateUnicodePropertyNameOrValue=function(t,e){-1===it.$LONE.indexOf(e)&&t.raise("Invalid property name")},ot.regexp_eatUnicodePropertyName=function(t){var e=0;for(t.lastStringValue="";ct(e=t.current());)t.lastStringValue+=st(e),t.advance();return""!==t.lastStringValue},ot.regexp_eatUnicodePropertyValue=function(t){var e=0;for(t.lastStringValue="";ht(e=t.current());)t.lastStringValue+=st(e),t.advance();return""!==t.lastStringValue},ot.regexp_eatLoneUnicodePropertyNameOrValue=function(t){return this.regexp_eatUnicodePropertyValue(t)},ot.regexp_eatCharacterClass=function(t){if(t.eat(91)){if(t.eat(94),this.regexp_classRanges(t),t.eat(93))return!0;t.raise("Unterminated character class")}return!1},ot.regexp_classRanges=function(t){for(;this.regexp_eatClassAtom(t);){var e=t.lastIntValue;if(t.eat(45)&&this.regexp_eatClassAtom(t)){var r=t.lastIntValue;!t.switchU||-1!==e&&-1!==r||t.raise("Invalid character class"),-1!==e&&-1!==r&&e>r&&t.raise("Range out of order in character class")}}},ot.regexp_eatClassAtom=function(t){var e=t.pos;if(t.eat(92)){if(this.regexp_eatClassEscape(t))return!0;if(t.switchU){var r=t.current();(99===r||mt(r))&&t.raise("Invalid class escape"),t.raise("Invalid escape")}t.pos=e}var n=t.current();return 93!==n&&(t.lastIntValue=n,t.advance(),!0)},ot.regexp_eatClassEscape=function(t){var e=t.pos;if(t.eat(98))return t.lastIntValue=8,!0;if(t.switchU&&t.eat(45))return t.lastIntValue=45,!0;if(!t.switchU&&t.eat(99)){if(this.regexp_eatClassControlLetter(t))return!0;t.pos=e}return this.regexp_eatCharacterClassEscape(t)||this.regexp_eatCharacterEscape(t)},ot.regexp_eatClassControlLetter=function(t){var e=t.current();return!(!pt(e)&&95!==e)&&(t.lastIntValue=e%32,t.advance(),!0)},ot.regexp_eatHexEscapeSequence=function(t){var e=t.pos;if(t.eat(120)){if(this.regexp_eatFixedHexDigits(t,2))return!0;t.switchU&&t.raise("Invalid escape"),t.pos=e}return!1},ot.regexp_eatDecimalDigits=function(t){var e=t.pos,r=0;for(t.lastIntValue=0;pt(r=t.current());)t.lastIntValue=10*t.lastIntValue+(r-48),t.advance();return t.pos!==e},ot.regexp_eatHexDigits=function(t){var e=t.pos,r=0;for(t.lastIntValue=0;ft(r=t.current());)t.lastIntValue=16*t.lastIntValue+dt(r),t.advance();return t.pos!==e},ot.regexp_eatLegacyOctalEscapeSequence=function(t){if(this.regexp_eatOctalDigit(t)){var e=t.lastIntValue;if(this.regexp_eatOctalDigit(t)){var r=t.lastIntValue;e<=3&&this.regexp_eatOctalDigit(t)?t.lastIntValue=64*e+8*r+t.lastIntValue:t.lastIntValue=8*e+r}else t.lastIntValue=e;return!0}return!1},ot.regexp_eatOctalDigit=function(t){var e=t.current();return mt(e)?(t.lastIntValue=e-48,t.advance(),!0):(t.lastIntValue=0,!1)},ot.regexp_eatFixedHexDigits=function(t,e){var r=t.pos;t.lastIntValue=0;for(var n=0;n>10),56320+(1023&t)))}vt.next=function(){this.options.onToken&&this.options.onToken(new gt(this)),this.lastTokEnd=this.end,this.lastTokStart=this.start,this.lastTokEndLoc=this.endLoc,this.lastTokStartLoc=this.startLoc,this.nextToken()},vt.getToken=function(){return this.next(),new gt(this)},"undefined"!=typeof Symbol&&(vt[Symbol.iterator]=function(){var t=this;return{next:function(){var e=t.getToken();return{done:e.type===b.eof,value:e}}}}),vt.curContext=function(){return this.context[this.context.length-1]},vt.nextToken=function(){var t=this.curContext();return t&&t.preserveSpace||this.skipSpace(),this.start=this.pos,this.options.locations&&(this.startLoc=this.curPosition()),this.pos>=this.input.length?this.finishToken(b.eof):t.override?t.override(this):void this.readToken(this.fullCharCodeAtPos())},vt.readToken=function(t){return p(t,this.options.ecmaVersion>=6)||92===t?this.readWord():this.getTokenFromCode(t)},vt.fullCharCodeAtPos=function(){var t=this.input.charCodeAt(this.pos);return t<=55295||t>=57344?t:(t<<10)+this.input.charCodeAt(this.pos+1)-56613888},vt.skipBlockComment=function(){var t,e=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;(t=w.exec(this.input))&&t.index8&&t<14||t>=5760&&k.test(String.fromCharCode(t))))break t;++this.pos}}},vt.finishToken=function(t,e){this.end=this.pos,this.options.locations&&(this.endLoc=this.curPosition());var r=this.type;this.type=t,this.value=e,this.updateContext(r)},vt.readToken_dot=function(){var t=this.input.charCodeAt(this.pos+1);if(t>=48&&t<=57)return this.readNumber(!0);var e=this.input.charCodeAt(this.pos+2);return this.options.ecmaVersion>=6&&46===t&&46===e?(this.pos+=3,this.finishToken(b.ellipsis)):(++this.pos,this.finishToken(b.dot))},vt.readToken_slash=function(){var t=this.input.charCodeAt(this.pos+1);return this.exprAllowed?(++this.pos,this.readRegexp()):61===t?this.finishOp(b.assign,2):this.finishOp(b.slash,1)},vt.readToken_mult_modulo_exp=function(t){var e=this.input.charCodeAt(this.pos+1),r=1,n=42===t?b.star:b.modulo;return this.options.ecmaVersion>=7&&42===t&&42===e&&(++r,n=b.starstar,e=this.input.charCodeAt(this.pos+2)),61===e?this.finishOp(b.assign,r+1):this.finishOp(n,r)},vt.readToken_pipe_amp=function(t){var e=this.input.charCodeAt(this.pos+1);return e===t?this.finishOp(124===t?b.logicalOR:b.logicalAND,2):61===e?this.finishOp(b.assign,2):this.finishOp(124===t?b.bitwiseOR:b.bitwiseAND,1)},vt.readToken_caret=function(){return 61===this.input.charCodeAt(this.pos+1)?this.finishOp(b.assign,2):this.finishOp(b.bitwiseXOR,1)},vt.readToken_plus_min=function(t){var e=this.input.charCodeAt(this.pos+1);return e===t?45!==e||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===e?this.finishOp(b.assign,2):this.finishOp(b.plusMin,1)},vt.readToken_lt_gt=function(t){var e=this.input.charCodeAt(this.pos+1),r=1;return e===t?(r=62===t&&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!==e||60!==t||this.inModule||45!==this.input.charCodeAt(this.pos+2)||45!==this.input.charCodeAt(this.pos+3)?(61===e&&(r=2),this.finishOp(b.relational,r)):(this.skipLineComment(4),this.skipSpace(),this.nextToken())},vt.readToken_eq_excl=function(t){var e=this.input.charCodeAt(this.pos+1);return 61===e?this.finishOp(b.equality,61===this.input.charCodeAt(this.pos+2)?3:2):61===t&&62===e&&this.options.ecmaVersion>=6?(this.pos+=2,this.finishToken(b.arrow)):this.finishOp(61===t?b.eq:b.prefix,1)},vt.getTokenFromCode=function(t){switch(t){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 63:return++this.pos,this.finishToken(b.question);case 96:if(this.options.ecmaVersion<6)break;return++this.pos,this.finishToken(b.backQuote);case 48:var e=this.input.charCodeAt(this.pos+1);if(120===e||88===e)return this.readRadixNumber(16);if(this.options.ecmaVersion>=6){if(111===e||79===e)return this.readRadixNumber(8);if(98===e||66===e)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(t);case 47:return this.readToken_slash();case 37:case 42:return this.readToken_mult_modulo_exp(t);case 124:case 38:return this.readToken_pipe_amp(t);case 94:return this.readToken_caret();case 43:case 45:return this.readToken_plus_min(t);case 60:case 62:return this.readToken_lt_gt(t);case 61:case 33:return this.readToken_eq_excl(t);case 126:return this.finishOp(b.prefix,1)}this.raise(this.pos,"Unexpected character '"+_t(t)+"'")},vt.finishOp=function(t,e){var r=this.input.slice(this.pos,this.pos+e);return this.pos+=e,this.finishToken(t,r)},vt.readRegexp=function(){for(var t,e,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"),t)t=!1;else{if("["===n)e=!0;else if("]"===n&&e)e=!1;else if("/"===n&&!e)break;t="\\"===n}++this.pos}var i=this.input.slice(r,this.pos);++this.pos;var o=this.pos,a=this.readWord1();this.containsEsc&&this.unexpected(o);var s=this.regexpState||(this.regexpState=new at(this));s.reset(r,i,a),this.validateRegExpFlags(s),this.validateRegExpPattern(s);var u=null;try{u=new RegExp(i,a)}catch(t){}return this.finishToken(b.regexp,{pattern:i,flags:a,value:u})},vt.readInt=function(t,e){for(var r=this.pos,n=0,i=0,o=null==e?1/0:e;i=97?a-97+10:a>=65?a-65+10:a>=48&&a<=57?a-48:1/0)>=t)break;++this.pos,n=n*t+s}return this.pos===r||null!=e&&this.pos-r!==e?null:n},vt.readRadixNumber=function(t){this.pos+=2;var e=this.readInt(t);return null==e&&this.raise(this.start+2,"Expected number in radix "+t),p(this.fullCharCodeAtPos())&&this.raise(this.pos,"Identifier directly after number"),this.finishToken(b.num,e)},vt.readNumber=function(t){var e=this.pos;t||null!==this.readInt(10)||this.raise(e,"Invalid number");var r=this.pos-e>=2&&48===this.input.charCodeAt(e);r&&this.strict&&this.raise(e,"Invalid number"),r&&/[89]/.test(this.input.slice(e,this.pos))&&(r=!1);var n=this.input.charCodeAt(this.pos);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(e,"Invalid number")),p(this.fullCharCodeAtPos())&&this.raise(this.pos,"Identifier directly after number");var i=this.input.slice(e,this.pos),o=r?parseInt(i,8):parseFloat(i);return this.finishToken(b.num,o)},vt.readCodePoint=function(){var t;if(123===this.input.charCodeAt(this.pos)){this.options.ecmaVersion<6&&this.unexpected();var e=++this.pos;t=this.readHexChar(this.input.indexOf("}",this.pos)-this.pos),++this.pos,t>1114111&&this.invalidStringToken(e,"Code point out of bounds")}else t=this.readHexChar(4);return t},vt.readString=function(t){for(var e="",r=++this.pos;;){this.pos>=this.input.length&&this.raise(this.start,"Unterminated string constant");var n=this.input.charCodeAt(this.pos);if(n===t)break;92===n?(e+=this.input.slice(r,this.pos),e+=this.readEscapedChar(!1),r=this.pos):(E(n,this.options.ecmaVersion>=10)&&this.raise(this.start,"Unterminated string constant"),++this.pos)}return e+=this.input.slice(r,this.pos++),this.finishToken(b.string,e)};var yt={};vt.tryReadTemplateToken=function(){this.inTemplateElement=!0;try{this.readTmplToken()}catch(t){if(t!==yt)throw t;this.readInvalidTemplateToken()}this.inTemplateElement=!1},vt.invalidStringToken=function(t,e){if(this.inTemplateElement&&this.options.ecmaVersion>=9)throw yt;this.raise(t,e)},vt.readTmplToken=function(){for(var t="",e=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?(t+=this.input.slice(e,this.pos),this.finishToken(b.template,t)):36===r?(this.pos+=2,this.finishToken(b.dollarBraceL)):(++this.pos,this.finishToken(b.backQuote));if(92===r)t+=this.input.slice(e,this.pos),t+=this.readEscapedChar(!0),e=this.pos;else if(E(r)){switch(t+=this.input.slice(e,this.pos),++this.pos,r){case 13:10===this.input.charCodeAt(this.pos)&&++this.pos;case 10:t+="\n";break;default:t+=String.fromCharCode(r)}this.options.locations&&(++this.curLine,this.lineStart=this.pos),e=this.pos}else++this.pos}},vt.readInvalidTemplateToken=function(){for(;this.pos=48&&e<=55){var r=this.input.substr(this.pos-1,3).match(/^[0-7]+/)[0],n=parseInt(r,8);return n>255&&(r=r.slice(0,-1),n=parseInt(r,8)),this.pos+=r.length-1,e=this.input.charCodeAt(this.pos),"0"===r&&56!==e&&57!==e||!this.strict&&!t||this.invalidStringToken(this.pos-1-r.length,t?"Octal literal in template string":"Octal literal in strict mode"),String.fromCharCode(n)}return String.fromCharCode(e)}},vt.readHexChar=function(t){var e=this.pos,r=this.readInt(16,t);return null===r&&this.invalidStringToken(e,"Bad character escape sequence"),r},vt.readWord1=function(){this.containsEsc=!1;for(var t="",e=!0,r=this.pos,n=this.options.ecmaVersion>=6;this.pos0?n-4:n,h=0;h>16&255,s[u++]=e>>8&255,s[u++]=255&e;2===a&&(e=i[t.charCodeAt(h)]<<2|i[t.charCodeAt(h+1)]>>4,s[u++]=255&e);1===a&&(e=i[t.charCodeAt(h)]<<10|i[t.charCodeAt(h+1)]<<4|i[t.charCodeAt(h+2)]>>2,s[u++]=e>>8&255,s[u++]=255&e);return s},r.fromByteArray=function(t){for(var e,r=t.length,i=r%3,o=[],a=0,s=r-i;as?s:a+16383));1===i?(e=t[r-1],o.push(n[e>>2]+n[e<<4&63]+"==")):2===i&&(e=(t[r-2]<<8)+t[r-1],o.push(n[e>>10]+n[e>>4&63]+n[e<<2&63]+"="));return o.join("")};for(var n=[],i=[],o="undefined"!=typeof Uint8Array?Uint8Array:Array,a="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",s=0,u=a.length;s0)throw new Error("Invalid string. Length must be a multiple of 4");var r=t.indexOf("=");return-1===r&&(r=e),[r,r===e?0:4-r%4]}function c(t,e,r){for(var i,o,a=[],s=e;s>18&63]+n[o>>12&63]+n[o>>6&63]+n[63&o]);return a.join("")}i["-".charCodeAt(0)]=62,i["_".charCodeAt(0)]=63},{}],3:[function(t,e,r){(function(t,n,i){!function(t){if("object"==typeof r&&void 0!==e)e.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{var i;"undefined"!=typeof window?i=window:void 0!==n?i=n:"undefined"!=typeof self&&(i=self),i.Promise=t()}}(function(){var e,r,o;return function t(e,r,n){function i(a,s){if(!r[a]){if(!e[a]){var u="function"==typeof _dereq_&&_dereq_;if(!s&&u)return u(a,!0);if(o)return o(a,!0);var l=new Error("Cannot find module '"+a+"'");throw l.code="MODULE_NOT_FOUND",l}var c=r[a]={exports:{}};e[a][0].call(c.exports,function(t){var r=e[a][1][t];return i(r||t)},c,c.exports,t,e,r,n)}return r[a].exports}for(var o="function"==typeof _dereq_&&_dereq_,a=0;a0;)f(t)}function f(t){var e=t.shift();if("function"!=typeof e)e._settlePromises();else{var r=t.shift(),n=t.shift();e.call(r,n)}}u.prototype.setScheduler=function(t){var e=this._schedule;return this._schedule=t,this._customScheduler=!0,e},u.prototype.hasCustomScheduler=function(){return this._customScheduler},u.prototype.enableTrampoline=function(){this._trampolineEnabled=!0},u.prototype.disableTrampolineIfNecessary=function(){s.hasDevTools&&(this._trampolineEnabled=!1)},u.prototype.haveItemsQueued=function(){return this._isTickUsed||this._haveDrainedQueues},u.prototype.fatalError=function(e,r){r?(t.stderr.write("Fatal "+(e instanceof Error?e.stack:e)+"\n"),t.exit(2)):this.throwLater(e)},u.prototype.throwLater=function(t,e){if(1===arguments.length&&(e=t,t=function(){throw e}),"undefined"!=typeof setTimeout)setTimeout(function(){t(e)},0);else try{this._schedule(function(){t(e)})}catch(t){throw new Error("No async scheduler available\n\n See http://goo.gl/MqrFmX\n")}},s.hasDevTools?(u.prototype.invokeLater=function(t,e,r){this._trampolineEnabled?l.call(this,t,e,r):this._schedule(function(){setTimeout(function(){t.call(e,r)},100)})},u.prototype.invoke=function(t,e,r){this._trampolineEnabled?c.call(this,t,e,r):this._schedule(function(){t.call(e,r)})},u.prototype.settlePromises=function(t){this._trampolineEnabled?h.call(this,t):this._schedule(function(){t._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(t,e,r){"use strict";e.exports=function(t,e,r,n){var i=!1,o=function(t,e){this._reject(e)},a=function(t,e){e.promiseRejectionQueued=!0,e.bindingPromise._then(o,o,null,this,t)},s=function(t,e){0==(50397184&this._bitField)&&this._resolveCallback(e.target)},u=function(t,e){e.promiseRejectionQueued||this._reject(t)};t.prototype.bind=function(o){i||(i=!0,t.prototype._propagateFrom=n.propagateFromFunction(),t.prototype._boundValue=n.boundValueFunction());var l=r(o),c=new t(e);c._propagateFrom(this,1);var h=this._target();if(c._setBoundTo(l),l instanceof t){var p={promiseRejectionQueued:!1,promise:c,target:h,bindingPromise:l};h._then(e,a,void 0,c,p),l._then(s,u,void 0,c,p),c._setOnCancel(l)}else c._resolveCallback(h);return c},t.prototype._setBoundTo=function(t){void 0!==t?(this._bitField=2097152|this._bitField,this._boundTo=t):this._bitField=-2097153&this._bitField},t.prototype._isBound=function(){return 2097152==(2097152&this._bitField)},t.bind=function(e,r){return t.resolve(r).bind(e)}}},{}],4:[function(t,e,r){"use strict";var n;"undefined"!=typeof Promise&&(n=Promise);var i=t("./promise")();i.noConflict=function(){try{Promise===i&&(Promise=n)}catch(t){}return i},e.exports=i},{"./promise":22}],5:[function(t,e,r){"use strict";var n=Object.create;if(n){var i=n(null),o=n(null);i[" size"]=o[" size"]=0}e.exports=function(e){var r,n=t("./util"),i=n.canEvaluate;n.isIdentifier;function o(t,r){var i;if(null!=t&&(i=t[r]),"function"!=typeof i){var o="Object "+n.classString(t)+" has no method '"+n.toString(r)+"'";throw new e.TypeError(o)}return i}function a(t){return o(t,this.pop()).apply(t,this)}function s(t){return t[this]}function u(t){var e=+this;return e<0&&(e=Math.max(0,e+t.length)),t[e]}e.prototype.call=function(t){var e=[].slice.call(arguments,1);return e.push(t),this._then(a,void 0,void 0,e,void 0)},e.prototype.get=function(t){var e;if("number"==typeof t)e=u;else if(i){var n=r(t);e=null!==n?n:s}else e=s;return this._then(e,void 0,void 0,t,void 0)}}},{"./util":36}],6:[function(t,e,r){"use strict";e.exports=function(e,r,n,i){var o=t("./util"),a=o.tryCatch,s=o.errorObj,u=e._async;e.prototype.break=e.prototype.cancel=function(){if(!i.cancellation())return this._warn("cancellation is disabled");for(var t=this,e=t;t._isCancellable();){if(!t._cancelBy(e)){e._isFollowing()?e._followee().cancel():e._cancelBranched();break}var r=t._cancellationParent;if(null==r||!r._isCancellable()){t._isFollowing()?t._followee().cancel():t._cancelBranched();break}t._isFollowing()&&t._followee().cancel(),t._setWillBeCancelled(),e=t,t=r}},e.prototype._branchHasCancelled=function(){this._branchesRemainingToCancel--},e.prototype._enoughBranchesHaveCancelled=function(){return void 0===this._branchesRemainingToCancel||this._branchesRemainingToCancel<=0},e.prototype._cancelBy=function(t){return t===this?(this._branchesRemainingToCancel=0,this._invokeOnCancel(),!0):(this._branchHasCancelled(),!!this._enoughBranchesHaveCancelled()&&(this._invokeOnCancel(),!0))},e.prototype._cancelBranched=function(){this._enoughBranchesHaveCancelled()&&this._cancel()},e.prototype._cancel=function(){this._isCancellable()&&(this._setCancelled(),u.invoke(this._cancelPromises,this,void 0))},e.prototype._cancelPromises=function(){this._length()>0&&this._settlePromises()},e.prototype._unsetOnCancel=function(){this._onCancelField=void 0},e.prototype._isCancellable=function(){return this.isPending()&&!this._isCancelled()},e.prototype.isCancellable=function(){return this.isPending()&&!this.isCancelled()},e.prototype._doInvokeOnCancel=function(t,e){if(o.isArray(t))for(var r=0;r=0)return r[t]}return t.prototype._promiseCreated=function(){},t.prototype._pushContext=function(){},t.prototype._popContext=function(){return null},t._peekContext=t.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 t=r.pop(),e=t._promiseCreated;return t._promiseCreated=null,e}return null},n.CapturedTrace=null,n.create=function(){if(e)return new n},n.deactivateLongStackTraces=function(){},n.activateLongStackTraces=function(){var r=t.prototype._pushContext,o=t.prototype._popContext,a=t._peekContext,s=t.prototype._peekContext,u=t.prototype._promiseCreated;n.deactivateLongStackTraces=function(){t.prototype._pushContext=r,t.prototype._popContext=o,t._peekContext=a,t.prototype._peekContext=s,t.prototype._promiseCreated=u,e=!1},e=!0,t.prototype._pushContext=n.prototype._pushContext,t.prototype._popContext=n.prototype._popContext,t._peekContext=t.prototype._peekContext=i,t.prototype._promiseCreated=function(){var t=this._peekContext();t&&null==t._promiseCreated&&(t._promiseCreated=this)}},n}},{}],9:[function(e,r,n){"use strict";r.exports=function(r,n){var i,o,a,s=r._getDomain,u=r._async,l=e("./errors").Warning,c=e("./util"),h=e("./es5"),p=c.canAttachTrace,f=/[\\\/]bluebird[\\\/]js[\\\/](release|debug|instrumented)/,d=/\((?:timers\.js):\d+:\d+\)/,m=/[\/<\(](.+?):(\d+):(\d+)\)?\s*$/,g=null,v=null,_=!1,y=!(0==c.env("BLUEBIRD_DEBUG")),b=!(0==c.env("BLUEBIRD_WARNINGS")||!y&&!c.env("BLUEBIRD_WARNINGS")),x=!(0==c.env("BLUEBIRD_LONG_STACK_TRACES")||!y&&!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 t=this._target();t._bitField=-1048577&t._bitField|524288},r.prototype._ensurePossibleRejectionHandled=function(){if(0==(524288&this._bitField)){this._setRejectionIsUnhandled();var t=this;setTimeout(function(){t._notifyUnhandledRejection()},1)}},r.prototype._notifyUnhandledRejectionIsHandled=function(){X("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 t=this._settledValue();this._setUnhandledRejectionIsNotified(),X("unhandledRejection",o,t,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(t,e,r){return z(t,e,r||this)},r.onPossiblyUnhandledRejection=function(t){var e=s();o="function"==typeof t?null===e?t:c.domainBind(e,t):void 0},r.onUnhandledRejectionHandled=function(t){var e=s();i="function"==typeof t?null===e?t:c.domainBind(e,t):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 t=r.prototype._captureStackTrace,e=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=t,r.prototype._attachExtraTrace=e,r.prototype._dereferenceTrace=i,n.deactivateLongStackTraces(),u.enableTrampoline(),Q.longStackTraces=!1},r.prototype._captureStackTrace=N,r.prototype._attachExtraTrace=j,r.prototype._dereferenceTrace=U,n.activateLongStackTraces(),u.disableTrampolineIfNecessary()}},r.hasLongStackTraces=function(){return Q.longStackTraces&&K()};var k=function(){try{if("function"==typeof CustomEvent){var t=new CustomEvent("CustomEvent");return c.global.dispatchEvent(t),function(t,e){var r={detail:e,cancelable:!0};h.defineProperty(r,"promise",{value:e.promise}),h.defineProperty(r,"reason",{value:e.reason});var n=new CustomEvent(t.toLowerCase(),r);return!c.global.dispatchEvent(n)}}if("function"==typeof Event){t=new Event("CustomEvent");return c.global.dispatchEvent(t),function(t,e){var r=new Event(t.toLowerCase(),{cancelable:!0});return r.detail=e,h.defineProperty(r,"promise",{value:e.promise}),h.defineProperty(r,"reason",{value:e.reason}),!c.global.dispatchEvent(r)}}return(t=document.createEvent("CustomEvent")).initCustomEvent("testingtheevent",!1,!0,{}),c.global.dispatchEvent(t),function(t,e){var r=document.createEvent("CustomEvent");return r.initCustomEvent(t.toLowerCase(),!1,!0,e),!c.global.dispatchEvent(r)}}catch(t){}return function(){return!1}}(),T=c.isNode?function(){return t.emit.apply(t,arguments)}:c.global?function(t){var e="on"+t.toLowerCase(),r=c.global[e];return!!r&&(r.apply(c.global,[].slice.call(arguments,1)),!0)}:function(){return!1};function S(t,e){return{promise:e}}var A={promiseCreated:S,promiseFulfilled:S,promiseRejected:S,promiseResolved:S,promiseCancelled:S,promiseChained:function(t,e,r){return{promise:e,child:r}},warning:function(t,e){return{warning:e}},unhandledRejection:function(t,e,r){return{reason:e,promise:r}},rejectionHandled:S},C=function(t){var e=!1;try{e=T.apply(null,arguments)}catch(t){u.throwLater(t),e=!0}var r=!1;try{r=k(t,A[t].apply(null,arguments))}catch(t){u.throwLater(t),r=!0}return r||e};function R(){return!1}function B(t,e,r){var n=this;try{t(e,r,function(t){if("function"!=typeof t)throw new TypeError("onCancel must be a function, got: "+c.toString(t));n._attachCancellationCallback(t)})}catch(t){return t}}function P(t){if(!this._isCancellable())return this;var e=this._onCancel();void 0!==e?c.isArray(e)?e.push(t):this._setOnCancel([e,t]):this._setOnCancel(t)}function I(){return this._onCancelField}function M(t){this._onCancelField=t}function D(){this._cancellationParent=void 0,this._onCancelField=void 0}function F(t,e){if(0!=(1&e)){this._cancellationParent=t;var r=t._branchesRemainingToCancel;void 0===r&&(r=0),t._branchesRemainingToCancel=r+1}0!=(2&e)&&t._isBound()&&this._setBoundTo(t._boundTo)}r.config=function(t){if("longStackTraces"in(t=Object(t))&&(t.longStackTraces?r.longStackTraces():!t.longStackTraces&&r.hasLongStackTraces()&&E()),"warnings"in t){var e=t.warnings;Q.warnings=!!e,w=Q.warnings,c.isObject(e)&&"wForgottenReturn"in e&&(w=!!e.wForgottenReturn)}if("cancellation"in t&&t.cancellation&&!Q.cancellation){if(u.haveItemsQueued())throw new Error("cannot enable cancellation after promises are in use");r.prototype._clearCancellationData=D,r.prototype._propagateFrom=F,r.prototype._onCancel=I,r.prototype._setOnCancel=M,r.prototype._attachCancellationCallback=P,r.prototype._execute=B,L=F,Q.cancellation=!0}return"monitoring"in t&&(t.monitoring&&!Q.monitoring?(Q.monitoring=!0,r.prototype._fireEvent=C):!t.monitoring&&Q.monitoring&&(Q.monitoring=!1,r.prototype._fireEvent=R)),r},r.prototype._fireEvent=R,r.prototype._execute=function(t,e,r){try{t(e,r)}catch(t){return t}},r.prototype._onCancel=function(){},r.prototype._setOnCancel=function(t){},r.prototype._attachCancellationCallback=function(t){},r.prototype._captureStackTrace=function(){},r.prototype._attachExtraTrace=function(){},r.prototype._dereferenceTrace=function(){},r.prototype._clearCancellationData=function(){},r.prototype._propagateFrom=function(t,e){};var L=function(t,e){0!=(2&e)&&t._isBound()&&this._setBoundTo(t._boundTo)};function O(){var t=this._boundTo;return void 0!==t&&t instanceof r?t.isFulfilled()?t.value():void 0:t}function N(){this._trace=new Z(this._peekContext())}function j(t,e){if(p(t)){var r=this._trace;if(void 0!==r&&e&&(r=r._parent),void 0!==r)r.attachExtraTrace(t);else if(!t.__stackCleaned__){var n=$(t);c.notEnumerableProp(t,"stack",n.message+"\n"+n.stack.join("\n")),c.notEnumerableProp(t,"__stackCleaned__",!0)}}}function U(){this._trace=void 0}function z(t,e,n){if(Q.warnings){var i,o=new l(t);if(e)n._attachExtraTrace(o);else if(Q.longStackTraces&&(i=r._peekContext()))i.attachExtraTrace(o);else{var a=$(o);o.stack=a.message+"\n"+a.stack.join("\n")}C("warning",o)||V(o,"",!0)}}function G(t){for(var e=[],r=0;r0?function(t){for(var e=t.stack.replace(/\s+$/g,"").split("\n"),r=0;r0&&"SyntaxError"!=t.name&&(e=e.slice(r)),e}(t):[" (No stack trace)"],{message:r,stack:"SyntaxError"==t.name?e:G(e)}}function V(t,e,r){if("undefined"!=typeof console){var n;if(c.isObject(t)){var i=t.stack;n=e+v(i,t)}else n=e+String(t);"function"==typeof a?a(n,r):"function"!=typeof console.log&&"object"!=typeof console.log||console.log(n)}}function X(t,e,r,n){var i=!1;try{"function"==typeof e&&(i=!0,"rejectionHandled"===t?e(n):e(r,n))}catch(t){u.throwLater(t)}"unhandledRejection"===t?C(t,r,n)||i||V(r,"Unhandled rejection "):C(t,n)}function q(t){var e;if("function"==typeof t)e="[function "+(t.name||"anonymous")+"]";else{e=t&&"function"==typeof t.toString?t.toString():c.toString(t);if(/\[object [a-zA-Z0-9$_]+\]/.test(e))try{e=JSON.stringify(t)}catch(t){}0===e.length&&(e="(empty array)")}return"(<"+function(t){if(t.length<41)return t;return t.substr(0,38)+"..."}(e)+">, no stack trace)"}function K(){return"function"==typeof J}var W=function(){return!1},H=/[\/<\(]([^:\/]+):(\d+):(?:\d+)\)?\s*$/;function Y(t){var e=t.match(H);if(e)return{fileName:e[1],line:parseInt(e[2],10)}}function Z(t){this._parent=t,this._promisesCreated=0;var e=this._length=1+(void 0===t?0:t._length);J(this,Z),e>32&&this.uncycle()}c.inherits(Z,Error),n.CapturedTrace=Z,Z.prototype.uncycle=function(){var t=this._length;if(!(t<2)){for(var e=[],r={},n=0,i=this;void 0!==i;++n)e.push(i),i=i._parent;for(n=(t=this._length=n)-1;n>=0;--n){var o=e[n].stack;void 0===r[o]&&(r[o]=n)}for(n=0;n0&&(e[a-1]._parent=void 0,e[a-1]._length=1),e[n]._parent=void 0,e[n]._length=1;var s=n>0?e[n-1]:this;a=0;--l)e[l]._length=u,u++;return}}}},Z.prototype.attachExtraTrace=function(t){if(!t.__stackCleaned__){this.uncycle();for(var e=$(t),r=e.message,n=[e.stack],i=this;void 0!==i;)n.push(G(i.stack.split("\n"))),i=i._parent;!function(t){for(var e=t[0],r=1;r=0;--s)if(n[s]===o){a=s;break}for(s=a;s>=0;--s){var u=n[s];if(e[i]!==u)break;e.pop(),i--}e=n}}(n),function(t){for(var e=0;e=0)return g=/@/,v=e,_=!0,function(t){t.stack=(new Error).stack};try{throw new Error}catch(t){n="stack"in t}return"stack"in i||!n||"number"!=typeof Error.stackTraceLimit?(v=function(t,e){return"string"==typeof t?t:"object"!=typeof e&&"function"!=typeof e||void 0===e.name||void 0===e.message?q(e):e.toString()},null):(g=t,v=e,function(t){Error.stackTraceLimit+=6;try{throw new Error}catch(e){t.stack=e.stack}Error.stackTraceLimit-=6})}();"undefined"!=typeof console&&void 0!==console.warn&&(a=function(t){console.warn(t)},c.isNode&&t.stderr.isTTY?a=function(t,e){var r=e?"":"";console.warn(r+t+"\n")}:c.isNode||"string"!=typeof(new Error).stack||(a=function(t,e){console.warn("%c"+t,e?"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 L},boundValueFunction:function(){return O},checkForgottenReturns:function(t,e,r,n,i){if(void 0===t&&null!==e&&w){if(void 0!==i&&i._returnedNonUndefined())return;if(0==(65535&n._bitField))return;r&&(r+=" ");var o="",a="";if(e._trace){for(var s=e._trace.stack.split("\n"),u=G(s),l=u.length-1;l>=0;--l){var c=u[l];if(!d.test(c)){var h=c.match(m);h&&(o="at "+h[1]+":"+h[2]+":"+h[3]+" ");break}}if(u.length>0){var p=u[0];for(l=0;l0&&(a="\n"+s[l-1]);break}}}var f="a promise was created in a "+r+"handler "+o+"but was not returned from it, see http://goo.gl/rRqMUw"+a;n._warn(f,!0,e)}},setBounds:function(t,e){if(K()){for(var r,n,i=t.stack.split("\n"),o=e.stack.split("\n"),a=-1,s=-1,u=0;u=s||(W=function(t){if(f.test(t))return!0;var e=Y(t);return!!(e&&e.fileName===r&&a<=e.line&&e.line<=s)})}},warn:z,deprecated:function(t,e){var r=t+" is deprecated and will be removed in a future version.";return e&&(r+=" Use "+e+" instead."),z(r)},CapturedTrace:Z,fireDomEvent:k,fireGlobalEvent:T}}},{"./errors":12,"./es5":13,"./util":36}],10:[function(t,e,r){"use strict";e.exports=function(t){function e(){return this.value}function r(){throw this.reason}t.prototype.return=t.prototype.thenReturn=function(r){return r instanceof t&&r.suppressUnhandledRejections(),this._then(e,void 0,void 0,{value:r},void 0)},t.prototype.throw=t.prototype.thenThrow=function(t){return this._then(r,void 0,void 0,{reason:t},void 0)},t.prototype.catchThrow=function(t){if(arguments.length<=1)return this._then(void 0,r,void 0,{reason:t},void 0);var e=arguments[1];return this.caught(t,function(){throw e})},t.prototype.catchReturn=function(r){if(arguments.length<=1)return r instanceof t&&r.suppressUnhandledRejections(),this._then(void 0,e,void 0,{value:r},void 0);var n=arguments[1];n instanceof t&&n.suppressUnhandledRejections();return this.caught(r,function(){return n})}}},{}],11:[function(t,e,r){"use strict";e.exports=function(t,e){var r=t.reduce,n=t.all;function i(){return n(this)}t.prototype.each=function(t){return r(this,t,e,0)._then(i,void 0,void 0,this,void 0)},t.prototype.mapSeries=function(t){return r(this,t,e,e)},t.each=function(t,n){return r(t,n,e,0)._then(i,void 0,void 0,t,void 0)},t.mapSeries=function(t,n){return r(t,n,e,e)}}},{}],12:[function(t,e,r){"use strict";var n,i,o=t("./es5"),a=o.freeze,s=t("./util"),u=s.inherits,l=s.notEnumerableProp;function c(t,e){function r(n){if(!(this instanceof r))return new r(n);l(this,"message","string"==typeof n?n:e),l(this,"name",t),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(t){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?t.cancelPromise._reject(e):t.cancelPromise._cancel(),t.cancelPromise=null,!0)}function h(){return f.call(this,this.promise._target()._settledValue())}function p(t){if(!c(this,t))return a.e=t,a}function f(t){var i=this.promise,s=this.handler;if(!this.called){this.called=!0;var u=this.isFinallyHandler()?s.call(i._boundValue()):s.call(i._boundValue(),t);if(u===n)return u;if(void 0!==u){i._setReturnedNonUndefined();var f=r(u,i);if(f instanceof e){if(null!=this.cancelPromise){if(f._isCancelled()){var d=new o("late cancellation observer");return i._attachExtraTrace(d),a.e=d,a}f.isPending()&&f._attachCancellationCallback(new l(this))}return f._then(h,p,void 0,this,void 0)}}}return i.isRejected()?(c(this),a.e=t,a):(c(this),t)}return u.prototype.isFinallyHandler=function(){return 0===this.type},l.prototype._resultCancelled=function(){c(this.finallyHandler)},e.prototype._passThrough=function(t,e,r,n){return"function"!=typeof t?this.then():this._then(r,n,void 0,new u(this,e,t),void 0)},e.prototype.lastly=e.prototype.finally=function(t){return this._passThrough(t,0,f,f)},e.prototype.tap=function(t){return this._passThrough(t,1,f)},e.prototype.tapCatch=function(t){var r=arguments.length;if(1===r)return this._passThrough(t,1,void 0,f);var n,o=new Array(r-1),a=0;for(n=0;n0&&"function"==typeof arguments[e]&&(t=arguments[e]);var n=[].slice.call(arguments);t&&n.pop();var i=new r(n).promise();return void 0!==t?i.spread(t):i}}},{"./util":36}],18:[function(t,e,r){"use strict";e.exports=function(e,r,n,i,o,a){var s=e._getDomain,u=t("./util"),l=u.tryCatch,c=u.errorObj,h=e._async;function p(t,e,r,n){this.constructor$(t),this._promise._captureStackTrace();var i=s();this._callback=null===i?e:u.domainBind(i,e),this._preservedValues=n===o?new Array(this.length()):null,this._limit=r,this._inFlight=0,this._queue=[],h.invoke(this._asyncInit,this,void 0)}function f(t,r,i,o){if("function"!=typeof r)return n("expecting a function but got "+u.classString(r));var a=0;if(void 0!==i){if("object"!=typeof i||null===i)return e.reject(new TypeError("options argument must be an object but it is "+u.classString(i)));if("number"!=typeof i.concurrency)return e.reject(new TypeError("'concurrency' must be a number but it is "+u.classString(i.concurrency)));a=i.concurrency}return new p(t,r,a="number"==typeof a&&isFinite(a)&&a>=1?a:0,o).promise()}u.inherits(p,r),p.prototype._asyncInit=function(){this._init$(void 0,-2)},p.prototype._init=function(){},p.prototype._promiseFulfilled=function(t,r){var n=this._values,o=this.length(),s=this._preservedValues,u=this._limit;if(r<0){if(n[r=-1*r-1]=t,u>=1&&(this._inFlight--,this._drainQueue(),this._isResolved()))return!0}else{if(u>=1&&this._inFlight>=u)return n[r]=t,this._queue.push(r),!1;null!==s&&(s[r]=t);var h=this._promise,p=this._callback,f=h._boundValue();h._pushContext();var d=l(p).call(f,t,r,o),m=h._popContext();if(a.checkForgottenReturns(d,m,null!==s?"Promise.filter":"Promise.map",h),d===c)return this._reject(d.e),!0;var g=i(d,this._promise);if(g instanceof e){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>=o&&(null!==s?this._filter(n,s):this._resolve(n),!0)},p.prototype._drainQueue=function(){for(var t=this._queue,e=this._limit,r=this._values;t.length>0&&this._inFlight1){o.deprecated("calling Promise.try with more than 1 argument");var l=arguments[1],c=arguments[2];n=a.isArray(l)?s(t).apply(c,l):s(t).call(c,l)}else n=s(t)();var h=u._popContext();return o.checkForgottenReturns(n,h,"Promise.try",u),u._resolveFromSyncValue(n),u},e.prototype._resolveFromSyncValue=function(t){t===a.errorObj?this._rejectCallback(t.e,!1):this._resolveCallback(t,!0)}}},{"./util":36}],20:[function(t,e,r){"use strict";var n=t("./util"),i=n.maybeWrapAsError,o=t("./errors").OperationalError,a=t("./es5");var s=/^(?:name|message|stack|cause)$/;function u(t){var e;if(function(t){return t instanceof Error&&a.getPrototypeOf(t)===Error.prototype}(t)){(e=new o(t)).name=t.name,e.message=t.message,e.stack=t.stack;for(var r=a.keys(t),i=0;i1){var r,n=new Array(e-1),i=0;for(r=0;r0&&"function"!=typeof t&&"function"!=typeof e){var r=".then() only accepts functions but was passed: "+l.classString(t);arguments.length>1&&(r+=", "+l.classString(e)),this._warn(r)}return this._then(t,e,void 0,void 0,void 0)},R.prototype.done=function(t,e){this._then(t,e,void 0,void 0,void 0)._setIsFinal()},R.prototype.spread=function(t){return"function"!=typeof t?o("expecting a function but got "+l.classString(t)):this.all()._then(t,void 0,void 0,v,void 0)},R.prototype.toJSON=function(){var t={isFulfilled:!1,isRejected:!1,fulfillmentValue:void 0,rejectionReason:void 0};return this.isFulfilled()?(t.fulfillmentValue=this.value(),t.isFulfilled=!0):this.isRejected()&&(t.rejectionReason=this.reason(),t.isRejected=!0),t},R.prototype.all=function(){return arguments.length>0&&this._warn(".all() was passed arguments but it does not take any"),new b(this).promise()},R.prototype.error=function(t){return this.caught(l.originatesFromRejection,t)},R.getNewLibraryCopy=r.exports,R.is=function(t){return t instanceof R},R.fromNode=R.fromCallback=function(t){var e=new R(g);e._captureStackTrace();var r=arguments.length>1&&!!Object(arguments[1]).multiArgs,n=C(t)(S(e,r));return n===A&&e._rejectCallback(n.e,!0),e._isFateSealed()||e._setAsyncGuaranteed(),e},R.all=function(t){return new b(t).promise()},R.cast=function(t){var e=y(t);return e instanceof R||((e=new R(g))._captureStackTrace(),e._setFulfilled(),e._rejectionHandler0=t),e},R.resolve=R.fulfilled=R.cast,R.reject=R.rejected=function(t){var e=new R(g);return e._captureStackTrace(),e._rejectCallback(t,!0),e},R.setScheduler=function(t){if("function"!=typeof t)throw new d("expecting a function but got "+l.classString(t));return p.setScheduler(t)},R.prototype._then=function(t,e,r,n,i){var o=void 0!==i,a=o?i:new R(g),u=this._target(),c=u._bitField;o||(a._propagateFrom(this,3),a._captureStackTrace(),void 0===n&&0!=(2097152&this._bitField)&&(n=0!=(50397184&c)?this._boundValue():u===this?void 0:this._boundTo),this._fireEvent("promiseChained",this,a));var h=s();if(0!=(50397184&c)){var f,d,v=u._settlePromiseCtx;0!=(33554432&c)?(d=u._rejectionHandler0,f=t):0!=(16777216&c)?(d=u._fulfillmentHandler0,f=e,u._unsetRejectionIsUnhandled()):(v=u._settlePromiseLateCancellationObserver,d=new m("late cancellation observer"),u._attachExtraTrace(d),f=e),p.invoke(v,u,{handler:null===h?f:"function"==typeof f&&l.domainBind(h,f),promise:a,receiver:n,value:d})}else u._addCallbacks(t,e,a,n,h);return a},R.prototype._length=function(){return 65535&this._bitField},R.prototype._isFateSealed=function(){return 0!=(117506048&this._bitField)},R.prototype._isFollowing=function(){return 67108864==(67108864&this._bitField)},R.prototype._setLength=function(t){this._bitField=-65536&this._bitField|65535&t},R.prototype._setFulfilled=function(){this._bitField=33554432|this._bitField,this._fireEvent("promiseFulfilled",this)},R.prototype._setRejected=function(){this._bitField=16777216|this._bitField,this._fireEvent("promiseRejected",this)},R.prototype._setFollowing=function(){this._bitField=67108864|this._bitField,this._fireEvent("promiseResolved",this)},R.prototype._setIsFinal=function(){this._bitField=4194304|this._bitField},R.prototype._isFinal=function(){return(4194304&this._bitField)>0},R.prototype._unsetCancelled=function(){this._bitField=-65537&this._bitField},R.prototype._setCancelled=function(){this._bitField=65536|this._bitField,this._fireEvent("promiseCancelled",this)},R.prototype._setWillBeCancelled=function(){this._bitField=8388608|this._bitField},R.prototype._setAsyncGuaranteed=function(){p.hasCustomScheduler()||(this._bitField=134217728|this._bitField)},R.prototype._receiverAt=function(t){var e=0===t?this._receiver0:this[4*t-4+3];if(e!==u)return void 0===e&&this._isBound()?this._boundValue():e},R.prototype._promiseAt=function(t){return this[4*t-4+2]},R.prototype._fulfillmentHandlerAt=function(t){return this[4*t-4+0]},R.prototype._rejectionHandlerAt=function(t){return this[4*t-4+1]},R.prototype._boundValue=function(){},R.prototype._migrateCallback0=function(t){t._bitField;var e=t._fulfillmentHandler0,r=t._rejectionHandler0,n=t._promise0,i=t._receiverAt(0);void 0===i&&(i=u),this._addCallbacks(e,r,n,i,null)},R.prototype._migrateCallbackAt=function(t,e){var r=t._fulfillmentHandlerAt(e),n=t._rejectionHandlerAt(e),i=t._promiseAt(e),o=t._receiverAt(e);void 0===o&&(o=u),this._addCallbacks(r,n,i,o,null)},R.prototype._addCallbacks=function(t,e,r,n,i){var o=this._length();if(o>=65531&&(o=0,this._setLength(0)),0===o)this._promise0=r,this._receiver0=n,"function"==typeof t&&(this._fulfillmentHandler0=null===i?t:l.domainBind(i,t)),"function"==typeof e&&(this._rejectionHandler0=null===i?e:l.domainBind(i,e));else{var a=4*o-4;this[a+2]=r,this[a+3]=n,"function"==typeof t&&(this[a+0]=null===i?t:l.domainBind(i,t)),"function"==typeof e&&(this[a+1]=null===i?e:l.domainBind(i,e))}return this._setLength(o+1),o},R.prototype._proxy=function(t,e){this._addCallbacks(void 0,void 0,e,t,null)},R.prototype._resolveCallback=function(t,e){if(0==(117506048&this._bitField)){if(t===this)return this._rejectCallback(n(),!1);var r=y(t,this);if(!(r instanceof R))return this._fulfill(t);e&&this._propagateFrom(r,2);var i=r._target();if(i!==this){var o=i._bitField;if(0==(50397184&o)){var a=this._length();a>0&&i._migrateCallback0(this);for(var s=1;s>>16)){if(t===this){var r=n();return this._attachExtraTrace(r),this._reject(r)}this._setFulfilled(),this._rejectionHandler0=t,(65535&e)>0&&(0!=(134217728&e)?this._settlePromises():p.settlePromises(this),this._dereferenceTrace())}},R.prototype._reject=function(t){var e=this._bitField;if(!((117506048&e)>>>16)){if(this._setRejected(),this._fulfillmentHandler0=t,this._isFinal())return p.fatalError(t,l.isNode);(65535&e)>0?p.settlePromises(this):this._ensurePossibleRejectionHandled()}},R.prototype._fulfillPromises=function(t,e){for(var r=1;r0){if(0!=(16842752&t)){var r=this._fulfillmentHandler0;this._settlePromise0(this._rejectionHandler0,r,t),this._rejectPromises(e,r)}else{var n=this._rejectionHandler0;this._settlePromise0(this._fulfillmentHandler0,n,t),this._fulfillPromises(e,n)}this._setLength(0)}this._clearCancellationData()},R.prototype._settledValue=function(){var t=this._bitField;return 0!=(33554432&t)?this._rejectionHandler0:0!=(16777216&t)?this._fulfillmentHandler0:void 0},R.defer=R.pending=function(){return E.deprecated("Promise.defer","new Promise"),{promise:new R(g),resolve:B,reject:P}},l.notEnumerableProp(R,"_makeSelfResolutionError",n),e("./method")(R,g,y,o,E),e("./bind")(R,g,y,E),e("./cancel")(R,b,o,E),e("./direct_resolve")(R),e("./synchronous_inspection")(R),e("./join")(R,b,y,g,p,s),R.Promise=R,R.version="3.5.3",e("./map.js")(R,b,o,y,g,E),e("./call_get.js")(R),e("./using.js")(R,o,y,w,g,E),e("./timers.js")(R,g,E),e("./generators.js")(R,o,g,y,a,E),e("./nodeify.js")(R),e("./promisify.js")(R,g),e("./props.js")(R,b,y,o),e("./race.js")(R,g,y,o),e("./reduce.js")(R,b,o,y,g,E),e("./settle.js")(R,b,E),e("./some.js")(R,b,o),e("./filter.js")(R,g),e("./each.js")(R,g),e("./any.js")(R),l.toFastProperties(R),l.toFastProperties(R.prototype),I({a:1}),I({b:2}),I({c:3}),I(1),I(function(){}),I(void 0),I(!1),I(new R(g)),E.setBounds(h.firstLineError,l.lastLineError),R}},{"./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(t,e,r){"use strict";e.exports=function(e,r,n,i,o){var a=t("./util");a.isArray;function s(t){var n=this._promise=new e(r);t instanceof e&&n._propagateFrom(t,3),n._setOnCancel(this),this._values=t,this._length=0,this._totalResolved=0,this._init(void 0,-2)}return a.inherits(s,o),s.prototype.length=function(){return this._length},s.prototype.promise=function(){return this._promise},s.prototype._init=function t(r,o){var s=n(this._values,this._promise);if(s instanceof e){var u=(s=s._target())._bitField;if(this._values=s,0==(50397184&u))return this._promise._setAsyncGuaranteed(),s._then(t,this._reject,void 0,this,o);if(0==(33554432&u))return 0!=(16777216&u)?this._reject(s._reason()):this._cancel();s=s._value()}if(null!==(s=a.asArray(s)))0!==s.length?this._iterate(s):-5===o?this._resolveEmptyArray():this._resolve(function(t){switch(t){case-2:return[];case-3:return{};case-6:return new Map}}(o));else{var l=i("expecting an array or an iterable object but got "+a.classString(s)).reason();this._promise._rejectCallback(l,!1)}},s.prototype._iterate=function(t){var r=this.getActualLength(t.length);this._length=r,this._values=this.shouldCopyValues()?new Array(r):this._values;for(var i=this._promise,o=!1,a=null,s=0;s=this._length&&(this._resolve(this._values),!0)},s.prototype._promiseCancelled=function(){return this._cancel(),!0},s.prototype._promiseRejected=function(t){return this._totalResolved++,this._reject(t),!0},s.prototype._resultCancelled=function(){if(!this._isResolved()){var t=this._values;if(this._cancel(),t instanceof e)t.cancel();else for(var r=0;r=this._length){var r;if(this._isMap)r=function(t){for(var e=new o,r=t.length/2|0,n=0;n>1},e.prototype.props=function(){return h(this)},e.props=function(t){return h(t)}}},{"./es5":13,"./util":36}],26:[function(t,e,r){"use strict";function n(t){this._capacity=t,this._length=0,this._front=0}n.prototype._willBeOverCapacity=function(t){return this._capacity=this._length&&(this._resolve(this._values),!0)},o.prototype._promiseFulfilled=function(t,e){var r=new i;return r._bitField=33554432,r._settledValueField=t,this._promiseResolved(e,r)},o.prototype._promiseRejected=function(t,e){var r=new i;return r._bitField=16777216,r._settledValueField=t,this._promiseResolved(e,r)},e.settle=function(t){return n.deprecated(".settle()",".reflect()"),new o(t).promise()},e.prototype.settle=function(){return e.settle(this)}}},{"./util":36}],31:[function(t,e,r){"use strict";e.exports=function(e,r,n){var i=t("./util"),o=t("./errors").RangeError,a=t("./errors").AggregateError,s=i.isArray,u={};function l(t){this.constructor$(t),this._howMany=0,this._unwrap=!1,this._initialized=!1}function c(t,e){if((0|e)!==e||e<0)return n("expecting a positive integer\n\n See http://goo.gl/MqrFmX\n");var r=new l(t),i=r.promise();return r.setHowMany(e),r.init(),i}i.inherits(l,r),l.prototype._init=function(){if(this._initialized)if(0!==this._howMany){this._init$(void 0,-5);var t=s(this._values);!this._isResolved()&&t&&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(t){this._howMany=t},l.prototype._promiseFulfilled=function(t){return this._addFulfilled(t),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(t){return this._addRejected(t),this._checkOutcome()},l.prototype._promiseCancelled=function(){return this._values instanceof e||null==this._values?this._cancel():(this._addRejected(u),this._checkOutcome())},l.prototype._checkOutcome=function(){if(this.howMany()>this._canPossiblyFulfill()){for(var t=new a,e=this.length();e0?this._reject(t):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(t){this._values.push(t)},l.prototype._addFulfilled=function(t){this._values[this._totalResolved++]=t},l.prototype._canPossiblyFulfill=function(){return this.length()-this._rejected()},l.prototype._getRangeError=function(t){var e="Input array must contain at least "+this._howMany+" items but contains only "+t+" items";return new o(e)},l.prototype._resolveEmptyArray=function(){this._reject(this._getRangeError(0))},e.some=function(t,e){return c(t,e)},e.prototype.some=function(t){return c(this,t)},e._SomePromiseArray=l}},{"./errors":12,"./util":36}],32:[function(t,e,r){"use strict";e.exports=function(t){function e(t){void 0!==t?(t=t._target(),this._bitField=t._bitField,this._settledValueField=t._isFateSealed()?t._settledValue():void 0):(this._bitField=0,this._settledValueField=void 0)}e.prototype._settledValue=function(){return this._settledValueField};var r=e.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=e.prototype.error=e.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=e.prototype.isFulfilled=function(){return 0!=(33554432&this._bitField)},o=e.prototype.isRejected=function(){return 0!=(16777216&this._bitField)},a=e.prototype.isPending=function(){return 0==(50397184&this._bitField)},s=e.prototype.isResolved=function(){return 0!=(50331648&this._bitField)};e.prototype.isCancelled=function(){return 0!=(8454144&this._bitField)},t.prototype.__isCancelled=function(){return 65536==(65536&this._bitField)},t.prototype._isCancelled=function(){return this._target().__isCancelled()},t.prototype.isCancelled=function(){return 0!=(8454144&this._target()._bitField)},t.prototype.isPending=function(){return a.call(this._target())},t.prototype.isRejected=function(){return o.call(this._target())},t.prototype.isFulfilled=function(){return i.call(this._target())},t.prototype.isResolved=function(){return s.call(this._target())},t.prototype.value=function(){return r.call(this._target())},t.prototype.reason=function(){var t=this._target();return t._unsetRejectionIsUnhandled(),n.call(t)},t.prototype._value=function(){return this._settledValue()},t.prototype._reason=function(){return this._unsetRejectionIsUnhandled(),this._settledValue()},t.PromiseInspection=e}},{}],33:[function(t,e,r){"use strict";e.exports=function(e,r){var n=t("./util"),i=n.errorObj,o=n.isObject;var a={}.hasOwnProperty;return function(t,s){if(o(t)){if(t instanceof e)return t;var u=function(t){try{return function(t){return t.then}(t)}catch(t){return i.e=t,i}}(t);if(u===i){s&&s._pushContext();var l=e.reject(u.e);return s&&s._popContext(),l}if("function"==typeof u)return function(t){try{return a.call(t,"_promise0")}catch(t){return!1}}(t)?(l=new e(r),t._then(l._fulfill,l._reject,void 0,l,null),l):function(t,o,a){var s=new e(r),u=s;a&&a._pushContext(),s._captureStackTrace(),a&&a._popContext();var l=!0,c=n.tryCatch(o).call(t,function(t){s&&(s._resolveCallback(t),s=null)},function(t){s&&(s._rejectCallback(t,l,!0),s=null)});return l=!1,s&&c===i&&(s._rejectCallback(c.e,!0,!0),s=null),u}(t,u,s)}return t}}},{"./util":36}],34:[function(t,e,r){"use strict";e.exports=function(e,r,n){var i=t("./util"),o=e.TimeoutError;function a(t){this.handle=t}a.prototype._resultCancelled=function(){clearTimeout(this.handle)};var s=function(t){return u(+this).thenReturn(t)},u=e.delay=function(t,i){var o,u;return void 0!==i?(o=e.resolve(i)._then(s,null,null,t,void 0),n.cancellation()&&i instanceof e&&o._setOnCancel(i)):(o=new e(r),u=setTimeout(function(){o._fulfill()},+t),n.cancellation()&&o._setOnCancel(new a(u)),o._captureStackTrace()),o._setAsyncGuaranteed(),o};e.prototype.delay=function(t){return u(t,this)};function l(t){return clearTimeout(this.handle),t}function c(t){throw clearTimeout(this.handle),t}e.prototype.timeout=function(t,e){var r,s;t=+t;var u=new a(setTimeout(function(){r.isPending()&&function(t,e,r){var n;n="string"!=typeof e?e instanceof Error?e:new o("operation timed out"):new o(e),i.markAsOriginatingFromRejection(n),t._attachExtraTrace(n),t._reject(n),null!=r&&r.cancel()}(r,e,s)},t));return n.cancellation()?(s=this.then(),(r=s._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(t,e,r){"use strict";e.exports=function(e,r,n,i,o,a){var s=t("./util"),u=t("./errors").TypeError,l=t("./util").inherits,c=s.errorObj,h=s.tryCatch,p={};function f(t){setTimeout(function(){throw t},0)}function d(t,r){var i=0,a=t.length,s=new e(o);return function o(){if(i>=a)return s._fulfill();var u=function(t){var e=n(t);return e!==t&&"function"==typeof t._isDisposable&&"function"==typeof t._getDisposer&&t._isDisposable()&&e._setDisposable(t._getDisposer()),e}(t[i++]);if(u instanceof e&&u._isDisposable()){try{u=n(u._getDisposer().tryDispose(r),t.promise)}catch(t){return f(t)}if(u instanceof e)return u._then(o,f,null,null,null)}o()}(),s}function m(t,e,r){this._data=t,this._promise=e,this._context=r}function g(t,e,r){this.constructor$(t,e,r)}function v(t){return m.isDisposer(t)?(this.resources[this.index]._setDisposable(t),t.promise()):t}function _(t){this.length=t,this.promise=null,this[t-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(t){var e=this.resource(),r=this._context;void 0!==r&&r._pushContext();var n=e!==p?this.doDispose(e,t):null;return void 0!==r&&r._popContext(),this._promise._unsetDisposable(),this._data=null,n},m.isDisposer=function(t){return null!=t&&"function"==typeof t.resource&&"function"==typeof t.tryDispose},l(g,m),g.prototype.doDispose=function(t,e){return this.data().call(t,t,e)},_.prototype._resultCancelled=function(){for(var t=this.length,r=0;r0},e.prototype._getDisposer=function(){return this._disposer},e.prototype._unsetDisposable=function(){this._bitField=-131073&this._bitField,this._disposer=void 0},e.prototype.disposer=function(t){if("function"==typeof t)return new g(t,this,i());throw new u}}},{"./errors":12,"./util":36}],36:[function(e,r,i){"use strict";var o=e("./es5"),a="undefined"==typeof navigator,s={e:{}},u,l="undefined"!=typeof self?self:"undefined"!=typeof window?window:void 0!==n?n:void 0!==this?this:null;function c(){try{var t=u;return u=null,t.apply(this,arguments)}catch(t){return s.e=t,s}}function h(t){return u=t,c}var p=function(t,e){var r={}.hasOwnProperty;function n(){for(var n in this.constructor=t,this.constructor$=e,e.prototype)r.call(e.prototype,n)&&"$"!==n.charAt(n.length-1)&&(this[n+"$"]=e.prototype[n])}return n.prototype=e.prototype,t.prototype=new n,t.prototype};function f(t){return null==t||!0===t||!1===t||"string"==typeof t||"number"==typeof t}function d(t){return"function"==typeof t||"object"==typeof t&&null!==t}function m(t){return f(t)?new Error(A(t)):t}function g(t,e){var r,n=t.length,i=new Array(n+1);for(r=0;r1,n=e.length>0&&!(1===e.length&&"constructor"===e[0]),i=x.test(t+"")&&o.names(t).length>0;if(r||n||i)return!0}return!1}catch(t){return!1}}function E(t){function e(){}e.prototype=t;var r=new e;function n(){return typeof r.foo}return n(),n(),t}var k=/^[a-z$_][a-z$_0-9]*$/i;function T(t){return k.test(t)}function S(t,e,r){for(var n=new Array(t),i=0;i10||$[0]>0),G.isNode&&G.toFastProperties(t);try{throw new Error}catch(t){G.lastLineError=t}r.exports=G},{"./es5":13}]},{},[4])(4)}),"undefined"!=typeof window&&null!==window?window.P=window.Promise:"undefined"!=typeof self&&null!==self&&(self.P=self.Promise)}).call(this,t("_process"),"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{},t("timers").setImmediate)},{_process:139,timers:193}],4:[function(t,e,r){},{}],5:[function(t,e,r){(function(r){var n=t("tty"),i=t("./lib/encode"),o=t("stream").Stream,a=e.exports=function(){var t=null;function e(e){if(t)throw new Error("multiple inputs specified");t=e}var i=null;function o(t){if(i)throw new Error("multiple outputs specified");i=t}for(var a=0;a0&&this.down(e),t>0?this.right(t):t<0&&this.left(-t),this},s.prototype.up=function(t){return void 0===t&&(t=1),this.write(i("["+Math.floor(t)+"A")),this},s.prototype.down=function(t){return void 0===t&&(t=1),this.write(i("["+Math.floor(t)+"B")),this},s.prototype.right=function(t){return void 0===t&&(t=1),this.write(i("["+Math.floor(t)+"C")),this},s.prototype.left=function(t){return void 0===t&&(t=1),this.write(i("["+Math.floor(t)+"D")),this},s.prototype.column=function(t){return this.write(i("["+Math.floor(t)+"G")),this},s.prototype.push=function(t){return this.write(i(t?"7":"[s")),this},s.prototype.pop=function(t){return this.write(i(t?"8":"[u")),this},s.prototype.erase=function(t){return"end"===t||"$"===t?this.write(i("[K")):"start"===t||"^"===t?this.write(i("[1K")):"line"===t?this.write(i("[2K")):"down"===t?this.write(i("[J")):"up"===t?this.write(i("[1J")):"screen"===t?this.write(i("[1J")):this.emit("error",new Error("Unknown erase type: "+t)),this},s.prototype.display=function(t){var e={reset:0,bright:1,dim:2,underscore:4,blink:5,reverse:7,hidden:8}[t];return void 0===e&&this.emit("error",new Error("Unknown attribute: "+t)),this.write(i("["+e+"m")),this},s.prototype.foreground=function(t){if("number"==typeof t)(t<0||t>=256)&&this.emit("error",new Error("Color out of range: "+t)),this.write(i("[38;5;"+t+"m"));else{var e={black:30,red:31,green:32,yellow:33,blue:34,magenta:35,cyan:36,white:37}[t.toLowerCase()];e||this.emit("error",new Error("Unknown color: "+t)),this.write(i("["+e+"m"))}return this},s.prototype.background=function(t){if("number"==typeof t)(t<0||t>=256)&&this.emit("error",new Error("Color out of range: "+t)),this.write(i("[48;5;"+t+"m"));else{var e={black:40,red:41,green:42,yellow:43,blue:44,magenta:45,cyan:46,white:47}[t.toLowerCase()];e||this.emit("error",new Error("Unknown color: "+t)),this.write(i("["+e+"m"))}return this},s.prototype.cursor=function(t){return this.write(i(t?"[?25h":"[?25l")),this};var u=a.extractCodes=function(t){for(var e=[],r=-1,n=0;n=0&&e.push(t.slice(r,n)),r=n):r>=0&&n===t.length-1&&e.push(t.slice(r));return e}}).call(this,t("_process"))},{"./lib/encode":6,_process:139,stream:190,tty:194}],6:[function(t,e,r){(function(t){var r=(e.exports=function(e){return new t([27].concat(function t(e){return"string"==typeof e?e.split("").map(r):Array.isArray(e)?e.reduce(function(e,r){return e.concat(t(r))},[]):void 0}(e)))}).ord=function(t){return t.charCodeAt(0)}}).call(this,t("buffer").Buffer)},{buffer:73}],7:[function(t,e,r){(function(r){"use strict";var n=t("readable-stream").Readable,i=t("util");function o(t,e){if(!(this instanceof o))return new o(t,e);n.call(this,e),null!==t&&void 0!==t||(t=String(t)),this._obj=t}e.exports=o,i.inherits(o,n),o.prototype._read=function(t){var e=this._obj;"string"==typeof e?this.push(new r(e)):r.isBuffer(e)?this.push(e):this.push(new r(JSON.stringify(e))),this.push(null)}}).call(this,t("buffer").Buffer)},{buffer:73,"readable-stream":13,util:200}],8:[function(t,e,r){(function(r){e.exports=s;var n=Object.keys||function(t){var e=[];for(var r in t)e.push(r);return e},i=t("core-util-is");i.inherits=t("inherits");var o=t("./_stream_readable"),a=t("./_stream_writable");function s(t){if(!(this instanceof s))return new s(t);o.call(this,t),a.call(this,t),t&&!1===t.readable&&(this.readable=!1),t&&!1===t.writable&&(this.writable=!1),this.allowHalfOpen=!0,t&&!1===t.allowHalfOpen&&(this.allowHalfOpen=!1),this.once("end",u)}function u(){this.allowHalfOpen||this._writableState.ended||r.nextTick(this.end.bind(this))}i.inherits(s,o),function(t,e){for(var r=0,n=t.length;r0?d(t):b(t)}(t,e);else if(e.objectMode||n&&n.length>0)if(e.ended&&!a){var u=new Error("stream.push() after EOF");t.emit("error",u)}else if(e.endEmitted&&a){u=new Error("stream.unshift() after end event");t.emit("error",u)}else!e.decoder||a||o||(n=e.decoder.write(n)),e.length+=e.objectMode?1:n.length,a?e.buffer.unshift(n):(e.reading=!1,e.buffer.push(n)),e.needReadable&&d(t),function(t,e){e.readingMore||(e.readingMore=!0,r.nextTick(function(){!function(t,e){var r=e.length;for(;!e.reading&&!e.flowing&&!e.ended&&e.lengthe.highWaterMark&&(e.highWaterMark=function(t){if(t>=p)t=p;else{t--;for(var e=1;e<32;e<<=1)t|=t>>e;t++}return t}(t)),t>e.length?e.ended?e.length:(e.needReadable=!0,0):t)}function d(t){var e=t._readableState;e.needReadable=!1,e.emittedReadable||(e.emittedReadable=!0,e.sync?r.nextTick(function(){m(t)}):m(t))}function m(t){t.emit("readable")}function g(t){var e,r=t._readableState;function n(t,n,i){!1===t.write(e)&&r.awaitDrain++}for(r.awaitDrain=0;r.pipesCount&&null!==(e=t.read());)if(1===r.pipesCount?n(r.pipes):x(r.pipes,n),t.emit("data",e),r.awaitDrain>0)return;if(0===r.pipesCount)return r.flowing=!1,void(o.listenerCount(t,"data")>0&&_(t));r.ranOut=!0}function v(){this._readableState.ranOut&&(this._readableState.ranOut=!1,g(this))}function _(t,e){if(t._readableState.flowing)throw new Error("Cannot switch to old mode now.");var n=e||!1,i=!1;t.readable=!0,t.pipe=s.prototype.pipe,t.on=t.addListener=s.prototype.on,t.on("readable",function(){var e;for(i=!0;!n&&null!==(e=t.read());)t.emit("data",e);null===e&&(i=!1,t._readableState.needReadable=!0)}),t.pause=function(){n=!0,this.emit("pause")},t.resume=function(){n=!1,i?r.nextTick(function(){t.emit("readable")}):this.read(0),this.emit("resume")},t.emit("readable")}function y(t,e){var r,n=e.buffer,o=e.length,a=!!e.decoder,s=!!e.objectMode;if(0===n.length)return null;if(0===o)r=null;else if(s)r=n.shift();else if(!t||t>=o)r=a?n.join(""):i.concat(n,o),n.length=0;else{if(t0)throw new Error("endReadable called on non-empty stream");!e.endEmitted&&e.calledRead&&(e.ended=!0,r.nextTick(function(){e.endEmitted||0!==e.length||(e.endEmitted=!0,t.readable=!1,t.emit("end"))}))}function x(t,e){for(var r=0,n=t.length;r0)&&(e.emittedReadable=!1),0===t&&e.needReadable&&(e.length>=e.highWaterMark||e.ended))return d(this),null;if(0===(t=f(t,e))&&e.ended)return r=null,e.length>0&&e.decoder&&(r=y(t,e),e.length-=r.length),0===e.length&&b(this),r;var i=e.needReadable;return e.length-t<=e.highWaterMark&&(i=!0),(e.ended||e.reading)&&(i=!1),i&&(e.reading=!0,e.sync=!0,0===e.length&&(e.needReadable=!0),this._read(e.highWaterMark),e.sync=!1),i&&!e.reading&&(t=f(n,e)),null===(r=t>0?y(t,e):null)&&(e.needReadable=!0,t=0),e.length-=t,0!==e.length||e.ended||(e.needReadable=!0),e.ended&&!e.endEmitted&&0===e.length&&b(this),r},c.prototype._read=function(t){this.emit("error",new Error("not implemented"))},c.prototype.pipe=function(t,e){var i=this,a=this._readableState;switch(a.pipesCount){case 0:a.pipes=t;break;case 1:a.pipes=[a.pipes,t];break;default:a.pipes.push(t)}a.pipesCount+=1;var s=(!e||!1!==e.end)&&t!==r.stdout&&t!==r.stderr?l:h;function u(t){t===i&&h()}function l(){t.end()}a.endEmitted?r.nextTick(s):i.once("end",s),t.on("unpipe",u);var c=function(t){return function(){var e=t._readableState;e.awaitDrain--,0===e.awaitDrain&&g(t)}}(i);function h(){t.removeListener("close",f),t.removeListener("finish",d),t.removeListener("drain",c),t.removeListener("error",p),t.removeListener("unpipe",u),i.removeListener("end",l),i.removeListener("end",h),t._writableState&&!t._writableState.needDrain||c()}function p(e){m(),t.removeListener("error",p),0===o.listenerCount(t,"error")&&t.emit("error",e)}function f(){t.removeListener("finish",d),m()}function d(){t.removeListener("close",f),m()}function m(){i.unpipe(t)}return t.on("drain",c),t._events&&t._events.error?n(t._events.error)?t._events.error.unshift(p):t._events.error=[p,t._events.error]:t.on("error",p),t.once("close",f),t.once("finish",d),t.emit("pipe",i),a.flowing||(this.on("readable",v),a.flowing=!0,r.nextTick(function(){g(i)})),t},c.prototype.unpipe=function(t){var e=this._readableState;if(0===e.pipesCount)return this;if(1===e.pipesCount)return t&&t!==e.pipes?this:(t||(t=e.pipes),e.pipes=null,e.pipesCount=0,this.removeListener("readable",v),e.flowing=!1,t&&t.emit("unpipe",this),this);if(!t){var r=e.pipes,n=e.pipesCount;e.pipes=null,e.pipesCount=0,this.removeListener("readable",v),e.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"===o)e.scalarArgs.push(i),e.shimArgs.push("scalar"+i);else if("index"===o){if(e.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"===o){if(e.shapeArgs.push(i),ir.length)throw new Error("cwise: Too many arguments in pre() block");if(e.body.args.length>r.length)throw new Error("cwise: Too many arguments in body() block");if(e.post.args.length>r.length)throw new Error("cwise: Too many arguments in post() block");return e.debug=!!t.printCode||!!t.debug,e.funcName=t.funcName||"cwise",e.blockSize=t.blockSize||64,n(e)}},{"./lib/thunk.js":17}],16:[function(t,e,r){"use strict";var n=t("uniq");function i(t,e,r){var n,i,o=t.length,a=e.arrayArgs.length,s=e.indexArgs.length>0,u=[],l=[],c=0,h=0;for(n=0;n0&&u.push("var "+l.join(",")),n=o-1;n>=0;--n)c=t[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 o(t,e,r){for(var n=t.body,i=[],o=[],a=0;a0&&_.push("shape=SS.slice(0)"),t.indexArgs.length>0){var y=new Array(r);for(u=0;u0&&v.push("var "+_.join(",")),u=0;u3&&v.push(o(t.pre,t,s));var E=o(t.body,t,s),k=function(t){for(var e=0,r=t[0].length;e0,l=[],c=0;c0;){"].join("")),l.push(["if(j",c,"<",s,"){"].join("")),l.push(["s",e[c],"=j",c].join("")),l.push(["j",c,"=0"].join("")),l.push(["}else{s",e[c],"=",s].join("")),l.push(["j",c,"-=",s,"}"].join("")),u&&l.push(["index[",e[c],"]=j",c].join(""));for(c=0;c3&&v.push(o(t.post,t,s)),t.debug&&console.log("-----Generated cwise routine for ",e,":\n"+v.join("\n")+"\n----------");var T=[t.funcName||"unnamed","_cwise_loop_",a[0].join("s"),"m",k,function(t){for(var e=new Array(t.length),r=!0,n=0;n0&&(r=r&&e[n]===e[n-1])}return r?e[0]:e.join("")}(s)].join("");return new Function(["function ",T,"(",g.join(","),"){",v.join("\n"),"} return ",T].join(""))()}},{uniq:196}],17:[function(t,e,r){"use strict";var n=t("./compile.js");e.exports=function(t){var e=["'use strict'","var CACHED={}"],r=[],i=t.funcName+"_cwise_thunk";e.push(["return function ",i,"(",t.shimArgs.join(","),"){"].join(""));for(var o=[],a=[],s=[["array",t.arrayArgs[0],".shape.slice(",Math.max(0,t.arrayBlockIndices[0]),t.arrayBlockIndices[0]<0?","+t.arrayBlockIndices[0]+")":")"].join("")],u=[],l=[],c=0;c0&&(u.push("array"+t.arrayArgs[0]+".shape.length===array"+h+".shape.length+"+(Math.abs(t.arrayBlockIndices[0])-Math.abs(t.arrayBlockIndices[c]))),l.push("array"+t.arrayArgs[0]+".shape[shapeIndex+"+Math.max(0,t.arrayBlockIndices[0])+"]===array"+h+".shape[shapeIndex+"+Math.max(0,t.arrayBlockIndices[c])+"]"))}for(t.arrayArgs.length>1&&(e.push("if (!("+u.join(" && ")+")) throw new Error('cwise: Arrays do not all have the same dimensionality!')"),e.push("for(var shapeIndex=array"+t.arrayArgs[0]+".shape.length-"+Math.abs(t.arrayBlockIndices[0])+"; shapeIndex--\x3e0;) {"),e.push("if (!("+l.join(" && ")+")) throw new Error('cwise: Arrays do not all have the same shape!')"),e.push("}")),c=0;ch)&&(o[u]=h,f.push(u,h),i[u]=s));if(void 0!==r&&void 0===o[r]){var d=["Could not find a path from ",e," to ",r,"."].join("");throw new Error(d)}return i},extract_shortest_path_from_predecessor_list:function(t,e){for(var r=[],n=e;n;)r.push(n),t[n],n=t[n];return r.reverse(),r},find_path:function(t,e,r){var i=n.single_source_shortest_paths(t,e,r);return n.extract_shortest_path_from_predecessor_list(i,r)},PriorityQueue:{make:function(t){var e,r=n.PriorityQueue,i={};for(e in t=t||{},r)r.hasOwnProperty(e)&&(i[e]=r[e]);return i.queue=[],i.sorter=t.sorter||r.default_sorter,i},default_sorter:function(t,e){return t.cost-e.cost},push:function(t,e){var r={value:t,cost:e};this.queue.push(r),this.queue.sort(this.sorter)},pop:function(){return this.queue.shift()},empty:function(){return 0===this.queue.length}}};void 0!==e&&(e.exports=n)},{}],20:[function(t,e,r){var n=function(e){(e=e||{}).width=e.width||800,e.height=e.height||600;var r=e.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=e.lens||{a:1,b:1,Fx:0,Fy:0,scale:1.5},i=e.fov||{x:1,y:1},o=e.image||"images/barrel-distortion.png",a=function(t){var e=document.querySelector(t);if(null==e)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"},{}],23:[function(t,e,r){e.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"},{}],24:[function(t,e,r){e.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"},{}],25:[function(t,e,r){e.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"},{}],26:[function(t,e,r){e.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"},{}],27:[function(t,e,r){e.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"},{}],28:[function(t,e,r){(function(r,n){"use strict";var i=t("path"),o=t("ndarray"),a=t("omggif").GifReader,s=(t("ndarray-pack"),t("through"),t("data-uri-to-buffer"));function u(t,e){var r;try{r=new a(t)}catch(t){return void e(t)}if(r.numFrames()>0){var n=[r.numFrames(),r.height,r.width,4],i=new Uint8Array(n[0]*n[1]*n[2]*n[3]),s=o(i,n);try{for(var u=0;u=0&&(this.dispose=t)},u.prototype.setRepeat=function(t){this.repeat=t},u.prototype.setTransparent=function(t){this.transparent=t},u.prototype.analyzeImage=function(t){this.setImagePixels(this.removeAlphaChannel(t)),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(t){this.emit("frame#start"),this.analyzeImage(t),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(t){t<1&&(t=1),this.sample=t},u.prototype.writeHeader=function(){this.emit("writeHeader#start"),this.writeUTFBytes("GIF89a"),this.emit("writeHeader#stop")},u.prototype.analyzePixels=function(){var t=this.pixels.length/3;this.indexedPixels=new Uint8Array(t);var e=new o(this.pixels,this.sample);e.buildColormap(),this.colorTab=e.getColormap();for(var r=0,n=0;n>16,r=(65280&t)>>8,n=255&t,i=0,o=16777216,a=this.colorTab.length,s=0;s=0&&(e=7&dispose),e<<=2,this.writeByte(0|e|t),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 t=768-this.colorTab.length,e=0;e>8&255)},u.prototype.writePixels=function(){new a(this.width,this.height,this.indexedPixels,this.colorDepth).encode(this)},u.prototype.stream=function(){return this},u.ByteCapacitor=s,e.exports=u}).call(this,t("buffer").Buffer)},{"./LZWEncoder.js":31,"./TypedNeuQuant.js":32,assert:66,buffer:73,events:74,"readable-stream":38,util:200}],31:[function(t,e,r){var n=-1,i=12,o=5003,a=[0,1,3,7,15,31,63,127,255,511,1023,2047,4095,8191,16383,32767,65535];e.exports=function(t,e,r,s){var u,l,c,h,p,f,d,m,g,v=Math.max(2,s),_=new Uint8Array(256),y=new Int32Array(o),b=new Int32Array(o),x=0,w=0,E=!1;function k(t,e){_[l++]=t,l>=254&&A(e)}function T(t){S(o),w=m+2,E=!0,B(m,t)}function S(t){for(var e=0;e0&&(t.writeByte(l),t.writeBytes(_,0,l),l=0)}function C(t){return(1<0?u|=t<=8;)k(255&u,e),u>>=8,x-=8;if((w>c||E)&&(E?(c=C(f=d),E=!1):c=++f==i?1<0;)k(255&u,e),u>>=8,x-=8;A(e)}}this.encode=function(r){r.writeByte(v),h=t*e,p=0,function(t,e){var r,a,s,u,h,p,v;for(E=!1,c=C(f=d=t),g=1+(m=1<=0){h=p-s,0===s&&(h=1);do{if((s-=h)<0&&(s+=p),y[s]===r){u=b[s];continue t}}while(y[s]>=0)}B(u,e),u=a,w<1<>c,p=u<>3)*(1<l;)u=A[f++],hl&&((s=r[p--])[0]-=u*(s[0]-n)/_,s[1]-=u*(s[1]-o)/_,s[2]-=u*(s[2]-a)/_)}function B(t,e,n){var o,u,f,d,m,g=~(1<<31),v=g,_=-1,y=_;for(o=0;o>s-a))>c,S[o]-=m,T[o]+=m<>3),t=0;t>f;for(S<=1&&(S=0),r=0;r=c&&(P-=c),r++,0===_&&(_=1),r%_==0)for(k-=k/h,(S=(T-=T/m)>>f)<=1&&(S=0),l=0;l>=a,r[t][1]>>=a,r[t][2]>>=a,r[t][3]=t}(),function(){var t,e,n,a,s,u,l=0,c=0;for(t=0;t>1,e=l+1;e>1,e=l+1;e<256;e++)k[e]=o}()},this.getColormap=function(){for(var t=[],e=[],n=0;n=0;)c=u?c=i:(c++,s<0&&(s=-s),(o=a[0]-t)<0&&(o=-o),(s+=o)=0&&((s=e-(a=r[h])[1])>=u?h=-1:(h--,s<0&&(s=-s),(o=a[0]-t)<0&&(o=-o),(s+=o)0)if(e.ended&&!o){var s=new Error("stream.push() after EOF");t.emit("error",s)}else if(e.endEmitted&&o){s=new Error("stream.unshift() after end event");t.emit("error",s)}else!e.decoder||o||i||(n=e.decoder.write(n)),o||(e.reading=!1),e.flowing&&0===e.length&&!e.sync?(t.emit("data",n),t.read(0)):(e.length+=e.objectMode?1:n.length,o?e.buffer.unshift(n):e.buffer.push(n),e.needReadable&&m(t)),function(t,e){e.readingMore||(e.readingMore=!0,r.nextTick(function(){!function(t,e){var r=e.length;for(;!e.reading&&!e.flowing&&!e.ended&&e.lengthe.highWaterMark&&(e.highWaterMark=function(t){if(t>=f)t=f;else{t--;for(var e=1;e<32;e<<=1)t|=t>>e;t++}return t}(t)),t>e.length?e.ended?e.length:(e.needReadable=!0,0):t)}function m(t){var e=t._readableState;e.needReadable=!1,e.emittedReadable||(l("emitReadable",e.flowing),e.emittedReadable=!0,e.sync?r.nextTick(function(){g(t)}):g(t))}function g(t){l("emit readable"),t.emit("readable"),v(t)}function v(t){var e=t._readableState;if(l("flow",e.flowing),e.flowing)do{var r=t.read()}while(null!==r&&e.flowing)}function _(t,e){var r,n=e.buffer,o=e.length,a=!!e.decoder,s=!!e.objectMode;if(0===n.length)return null;if(0===o)r=null;else if(s)r=n.shift();else if(!t||t>=o)r=a?n.join(""):i.concat(n,o),n.length=0;else{if(t0)throw new Error("endReadable called on non-empty stream");e.endEmitted||(e.ended=!0,r.nextTick(function(){e.endEmitted||0!==e.length||(e.endEmitted=!0,t.readable=!1,t.emit("end"))}))}h.prototype.read=function(t){l("read",t);var e=this._readableState,r=t;if((!u.isNumber(t)||t>0)&&(e.emittedReadable=!1),0===t&&e.needReadable&&(e.length>=e.highWaterMark||e.ended))return l("read: emitReadable",e.length,e.ended),0===e.length&&e.ended?y(this):m(this),null;if(0===(t=d(t,e))&&e.ended)return 0===e.length&&y(this),null;var n,i=e.needReadable;return l("need readable",i),(0===e.length||e.length-t0?_(t,e):null,u.isNull(n)&&(e.needReadable=!0,t=0),e.length-=t,0!==e.length||e.ended||(e.needReadable=!0),r!==t&&e.ended&&0===e.length&&y(this),u.isNull(n)||this.emit("data",n),n},h.prototype._read=function(t){this.emit("error",new Error("not implemented"))},h.prototype.pipe=function(t,e){var i=this,a=this._readableState;switch(a.pipesCount){case 0:a.pipes=t;break;case 1:a.pipes=[a.pipes,t];break;default:a.pipes.push(t)}a.pipesCount+=1,l("pipe count=%d opts=%j",a.pipesCount,e);var s=(!e||!1!==e.end)&&t!==r.stdout&&t!==r.stderr?c:p;function u(t){l("onunpipe"),t===i&&p()}function c(){l("onend"),t.end()}a.endEmitted?r.nextTick(s):i.once("end",s),t.on("unpipe",u);var h=function(t){return function(){var e=t._readableState;l("pipeOnDrain",e.awaitDrain),e.awaitDrain&&e.awaitDrain--,0===e.awaitDrain&&o.listenerCount(t,"data")&&(e.flowing=!0,v(t))}}(i);function p(){l("cleanup"),t.removeListener("close",m),t.removeListener("finish",g),t.removeListener("drain",h),t.removeListener("error",d),t.removeListener("unpipe",u),i.removeListener("end",c),i.removeListener("end",p),i.removeListener("data",f),!a.awaitDrain||t._writableState&&!t._writableState.needDrain||h()}function f(e){l("ondata"),!1===t.write(e)&&(l("false write response, pause",i._readableState.awaitDrain),i._readableState.awaitDrain++,i.pause())}function d(e){l("onerror",e),_(),t.removeListener("error",d),0===o.listenerCount(t,"error")&&t.emit("error",e)}function m(){t.removeListener("finish",g),_()}function g(){l("onfinish"),t.removeListener("close",m),_()}function _(){l("unpipe"),i.unpipe(t)}return t.on("drain",h),i.on("data",f),t._events&&t._events.error?n(t._events.error)?t._events.error.unshift(d):t._events.error=[d,t._events.error]:t.on("error",d),t.once("close",m),t.once("finish",g),t.emit("pipe",i),a.flowing||(l("pipe resume"),i.resume()),t},h.prototype.unpipe=function(t){var e=this._readableState;if(0===e.pipesCount)return this;if(1===e.pipesCount)return t&&t!==e.pipes?this:(t||(t=e.pipes),e.pipes=null,e.pipesCount=0,e.flowing=!1,t&&t.emit("unpipe",this),this);if(!t){var r=e.pipes,n=e.pipesCount;e.pipes=null,e.pipesCount=0,e.flowing=!1;for(var i=0;i1){for(var r=[],n=0;n0&&e>0))return null;var n,i=document.createElement("canvas");if(!i)return null;i.width=t,i.height=e;try{n=i.getContext("webgl",r)}catch(t){try{n=i.getContext("experimental-webgl",r)}catch(t){return null}}var o=n.getExtension,a={destroy:function(){var t=o.call(n,"WEBGL_lose_context");t&&t.loseContext()}},s={resize:function(t,e){i.width=t,i.height=e}},u=n.getSupportedExtensions().slice();return u.push("STACKGL_destroy_context","STACKGL_resize_drawingbuffer"),n.getSupportedExtensions=function(){return u.slice()},n.getExtension=function(t){var e=t.toLowerCase();return"stackgl_resize_drawingbuffer"===e?s:"stackgl_destroy_context"===e?a:o.call(n,t)},n||null}},{}],40:[function(t,e,r){"use strict";e.exports=function(t,e){let r=null;r=e.output.length?3===e.output.length?{x:e.output[0],y:e.output[1],z:e.output[2]}:2===e.output.length?{x:e.output[0],y:e.output[1]}:{x:e.output[0]}:e.output;const n={_fn:t,constants:e.constants,output:r,thread:{x:0,y:0,z:0}};return r.z?function(){const t=[];for(let e=0;e0&&e.push(", "),e.push("user_"),e.push(r)}e.push(") {\n")}for(let r=0;r0&&e.push(r.join(""),";\n"),e.push(`for (let ${t}=0;${t}0&&e.push(`if (!${n.join("")}) break;\n`),e.push(o.join("")),e.push(`\n${i.join("")};`),e.push("}\n")}return e}astWhileStatement(t,e){if("WhileStatement"!==t.type)throw this.astErrorOutput("Invalid while statement",t);return e.push("for (let i = 0; i < LOOP_MAX; i++) {"),e.push("if ("),this.astGeneric(t.test,e),e.push(") {\n"),this.astGeneric(t.body,e),e.push("} else {\n"),e.push("break;\n"),e.push("}\n"),e.push("}\n"),e}astDoWhileStatement(t,e){if("DoWhileStatement"!==t.type)throw this.astErrorOutput("Invalid while statement",t);return e.push("for (let i = 0; i < LOOP_MAX; i++) {"),this.astGeneric(t.body,e),e.push("if (!"),this.astGeneric(t.test,e),e.push(") {\n"),e.push("break;\n"),e.push("}\n"),e.push("}\n"),e}astAssignmentExpression(t,e){return this.astGeneric(t.left,e),e.push(t.operator),this.astGeneric(t.right,e),e}astBlockStatement(t,e){if(this.isState("loop-body")){this.pushState("block-body");for(let r=0;r0&&e.push(","),this.astGeneric(t.declarations[r],e);return this.isState("in-for-loop-init")||e.push(";"),e}astIfStatement(t,e){return e.push("if ("),this.astGeneric(t.test,e),e.push(")"),"BlockStatement"===t.consequent.type?this.astGeneric(t.consequent,e):(e.push(" {\n"),this.astGeneric(t.consequent,e),e.push("\n}\n")),t.alternate&&(e.push("else "),"BlockStatement"===t.alternate.type?this.astGeneric(t.alternate,e):(e.push(" {\n"),this.astGeneric(t.alternate,e),e.push("\n}\n"))),e}astThisExpression(t,e){return e.push("_this"),e}astMemberExpression(t,e){const{signature:r,type:n,property:i,xProperty:o,yProperty:a,zProperty:s,name:u,origin:l}=this.getMemberExpressionDetails(t);switch(r){case"this.thread.value":return e.push(`_this.thread.${u}`),e;case"this.output.value":switch(u){case"x":e.push(this.output[0]);break;case"y":e.push(this.output[1]);break;case"z":e.push(this.output[2]);break;default:throw this.astErrorOutput("Unexpected expression",t)}return e;case"value":throw this.astErrorOutput("Unexpected expression",t);case"value[]":case"value[][]":case"value[][][]":case"value.value":if("Math"===l)return e.push(Math[u]),e;switch(i){case"r":return e.push(`user_${u}[0]`),e;case"g":return e.push(`user_${u}[1]`),e;case"b":return e.push(`user_${u}[2]`),e;case"a":return e.push(`user_${u}[3]`),e}break;case"this.constants.value":case"this.constants.value[]":case"this.constants.value[][]":case"this.constants.value[][][]":break;case"fn()[]":return this.astGeneric(t.object,e),e.push("["),this.astGeneric(t.property,e),e.push("]"),e;default:throw this.astErrorOutput("Unexpected expression",t)}if("Number"===n||"Integer"===n)return e.push(`${l}_${u}`),e;const c=this.getKernelArgumentName(u),h=`${l}_${c||u}`;switch(n){case"Array(2)":case"Array(3)":case"Array(4)":case"HTMLImageArray":case"ArrayTexture(1)":case"ArrayTexture(2)":case"ArrayTexture(3)":case"ArrayTexture(4)":case"HTMLImage":default:const t=this.isInput(c||u);if(e.push(`${h}`),s&&a)if(t){const t=this.argumentSizes[this.argumentNames.indexOf(u)];e.push("[("),this.astGeneric(s,e),e.push(`*${t[1]*t[0]})+(`),this.astGeneric(a,e),e.push(`*${t[0]})+`),this.astGeneric(o,e),e.push("]")}else e.push("["),this.astGeneric(s,e),e.push("]"),e.push("["),this.astGeneric(a,e),e.push("]"),e.push("["),this.astGeneric(o,e),e.push("]");else if(a)if(t){const t=this.argumentSizes[this.argumentNames.indexOf(u)];e.push("[("),this.astGeneric(a,e),e.push(`*${t[0]})+`),this.astGeneric(o,e),e.push("]")}else e.push("["),this.astGeneric(a,e),e.push("]"),e.push("["),this.astGeneric(o,e),e.push("]");else e.push("["),this.astGeneric(o,e),e.push("]")}return e}astCallExpression(t,e){if(t.callee){let r=this.astMemberExpressionUnroll(t.callee);this.calledFunctions.indexOf(r)<0&&this.calledFunctions.push(r),this.calledFunctionsArguments[r]||(this.calledFunctionsArguments[r]=[]);const n=[];this.calledFunctionsArguments[r].push(n),e.push(r),e.push("(");for(let r=0;r0&&e.push(", "),this.astGeneric(i,e);const o=this.getType(i);o?n.push({name:i.name||null,type:o}):n.push(null)}return e.push(")"),e}throw this.astErrorOutput("Unknown CallExpression",t)}astArrayExpression(t,e){const r=t.elements.length;e.push("[");for(let n=0;n0&&e.push(", ");const r=t.elements[n];this.astGeneric(r,e)}return e.push("]"),e}astDebuggerStatement(t,e){return e.push("debugger;"),e}}}},{"../function-node":46}],43:[function(t,e,r){const{utils:n}=t("../../utils"),{kernelRunShortcut:i}=t("../../kernel-run-shortcut");function o(t){return/^function /.test(t)&&(t=t.substring(9)),t.replace(/[_]typeof/g,"typeof")}function a(t){return t.replace(/^[A-Za-z]+/,"function").replace(/[_]typeof/g,"typeof")}e.exports={cpuKernelString:function(t,e){return`() => {\n ${i.toString()};\n const utils = {\n allPropertiesOf: ${a(n.allPropertiesOf.toString())},\n clone: ${a(n.clone.toString())},\n };\n let Input = function() {};\n class ${e||"Kernel"} {\n constructor() { \n this.argumentsLength = 0;\n this.canvas = null;\n this.context = null;\n this.built = false;\n this.program = null;\n this.argumentNames = ${JSON.stringify(t.argumentNames)};\n this.argumentTypes = ${JSON.stringify(t.argumentTypes)};\n this.argumentSizes = ${JSON.stringify(t.argumentSizes)};\n this.output = ${JSON.stringify(t.output)};\n this._kernelString = \`${t._kernelString}\`;\n this.output = ${JSON.stringify(t.output)};\n\t\t this.run = function() {\n this.run = null;\n this.build(arguments);\n return this.run.apply(this, arguments);\n }.bind(this);\n this.thread = {\n x: 0,\n y: 0,\n z: 0\n };\n }\n setCanvas(canvas) { this.canvas = canvas; return this; }\n setContext(context) { this.context = context; return this; }\n setInput(Type) { Input = Type; }\n ${o(t.build.toString())}\n setupArguments() {}\n ${o(t.setupConstants.toString())}\n translateSource() {}\n pickRenderStrategy() {}\n run () { ${t.kernelString} }\n getKernelString() { return this._kernelString; }\n ${o(t.validateSettings.toString())}\n ${o(t.checkOutput.toString())}\n };\n return kernelRunShortcut(new Kernel());\n };`}}},{"../../kernel-run-shortcut":62,"../../utils":65}],44:[function(t,e,r){const{Kernel:n}=t("../kernel"),{FunctionBuilder:i}=t("../function-builder"),{CPUFunctionNode:o}=t("./function-node"),{utils:a}=t("../../utils"),{cpuKernelString:s}=t("./kernel-string");e.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(t){return!1}static get mode(){return"cpu"}static nativeFunctionArguments(){return null}static nativeFunctionReturnType(){return null}static combineKernels(t){return t}constructor(t,e){super(t,e),this.mergeSettings(t.settings||e),this._imageData=null,this._colorData=null,this._kernelString=null,this.thread={x:0,y:0,z:0},this.translatedSources=null,this.run=function(){return this.run=null,this.build.apply(this,arguments),this.run.apply(this,arguments)}.bind(this)}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(t){return[]}validateSettings(){if(!this.output||0===this.output.length){if(1!==arguments.length)throw"Auto dimensions only supported for kernels with only one input";const t=a.getVariableType(arguments[0]);if("Array"===t)this.output=a.getDimensions(t);else{if("NumberTexture"!==t&&"ArrayTexture(4)"!==t)throw"Auto dimensions not supported for input type: "+t;this.output=arguments[0].output}}if(this.graphical&&2!==this.output.length)throw new Error("Output must have 2 dimensions on graphical mode");this.checkOutput()}translateSource(){const t=i.fromKernel(this,o);this.translatedSources=t.getPrototypes("kernel"),this.graphical||this.returnType||(this.returnType=t.getKernelResultType())}build(){if(this.setupConstants(),this.setupArguments(arguments),this.validateSettings(),this.translateSource(),this.graphical){const{canvas:t,output:e}=this;if(!t)throw new Error("no canvas available for using graphical output");const r=e[0],n=e[1]||1;t.width=r,t.height=n,this._imageData=this.context.createImageData(r,n),this._colorData=new Uint8ClampedArray(r*n*4)}const t=this.getKernelString();this.kernelString=t,this.debug&&(console.log("Function output:"),console.log(t));try{this.run=new Function([],t).bind(this)()}catch(t){console.error("An error occurred compiling the javascript: ",t)}}color(t,e,r,n){void 0===n&&(n=1),t=Math.floor(255*t),e=Math.floor(255*e),r=Math.floor(255*r),n=Math.floor(255*n);const i=this.output[0],o=this.output[1],a=this.thread.x+(o-this.thread.y-1)*i;this._colorData[4*a+0]=t,this._colorData[4*a+1]=e,this._colorData[4*a+2]=r,this._colorData[4*a+3]=n}getKernelString(){if(null!==this._kernelString)return this._kernelString;let t=null,{translatedSources:e}=this;return e.length>1?e=e.filter(e=>/^function/.test(e)?e:(t=e,!1)):t=e.shift(),this._kernelString=`\n\t\tconst LOOP_MAX = ${this._getLoopMaxString()}\n\t\tconst constants = this.constants;\n\t\tconst _this = this;\n return function (${this.argumentNames.map(t=>"user_"+t).join(", ")}) {\n ${this._processConstants()}\n ${this._processArguments()}\n ${this.graphical?this._graphicalKernelBody(t):this._resultKernelBody(t)}\n ${e.length>0?e.join("\n"):""}\n }.bind(this);`}toString(){return s(this)}_getLoopMaxString(){return this.loopMaxIterations?` ${parseInt(this.loopMaxIterations)};\n`:" 1000;\n"}_processConstants(){if(!this.constants)return"";const t=[];for(let e in this.constants)switch(this.constantTypes[e]){case"HTMLImage":t.push(` const constants_${e} = this._imageTo2DArray(this.constants.${e});`);break;case"HTMLImageArray":t.push(` const constants_${e} = this._imageTo3DArray(this.constants.${e});`);break;case"Input":t.push(` const constants_${e} = this.constants.${e}.value;`);break;default:t.push(` const constants_${e} = this.constants.${e};`)}return t.join("\n")}_processArguments(){const t=[];for(let e=0;e=0;e--){const r=i[e]=new Array(t.width);for(let e=0;e`let subKernelResult_${t.name};`).join("\n")}\n\t\t${this._mapSubKernels(t=>`const result_${t.name} = new ${r}(${e[0]});\n`).join("")}\n for (let x = 0; x < ${e[0]}; x++) {\n this.thread.x = x;\n this.thread.y = 0;\n this.thread.z = 0;\n let kernelResult;\n ${t}\n result[x] = kernelResult;\n ${this._mapSubKernels(t=>`result_${t.name}[x] = subKernelResult_${t.name};\n`).join("")}\n }`}_resultKernel2DLoop(t){const{output:e}=this,r=this._getKernelResultTypeConstructorString();return`const result = new Array(${e[1]});\n\t\t${this._mapSubKernels(t=>`let subKernelResult_${t.name};`).join("\n")}\n ${this._mapSubKernels(t=>`const result_${t.name} = new Array(${e[1]});\n`).join("")}\n for (let y = 0; y < ${e[1]}; y++) {\n this.thread.z = 0;\n this.thread.y = y;\n const resultX = result[y] = new ${r}(${e[0]});\n ${this._mapSubKernels(t=>`const result_${t.name}X = result_${t.name}[y] = new ${r}(${e[0]});\n`).join("")}\n for (let x = 0; x < ${e[0]}; x++) {\n \tthis.thread.x = x;\n let kernelResult;\n ${t}\n resultX[x] = kernelResult;\n ${this._mapSubKernels(t=>`result_${t.name}X[x] = subKernelResult_${t.name};\n`).join("")}\n }\n }`}_graphicalKernel2DLoop(t){const{output:e}=this,r=this._getKernelResultTypeConstructorString();return`${this._mapSubKernels(t=>`let subKernelResult_${t.name};`).join("\n")}\n ${this._mapSubKernels(t=>`const result_${t.name} = new Array(${e[1]});\n`).join("")}\n for (let y = 0; y < ${e[1]}; y++) {\n this.thread.z = 0;\n this.thread.y = y;\n ${this._mapSubKernels(t=>`const result_${t.name}X = result_${t.name}[y] = new ${r}(${e[0]});\n`).join("")}\n for (let x = 0; x < ${e[0]}; x++) {\n \tthis.thread.x = x;\n ${t}\n ${this._mapSubKernels(t=>`result_${t.name}X[x] = subKernelResult_${t.name};\n`).join("")}\n }\n }`}_resultKernel3DLoop(t){const{output:e}=this,r=this._getKernelResultTypeConstructorString();return`const result = new Array(${e[2]});\n ${this._mapSubKernels(t=>`let subKernelResult_${t.name};`).join("\n")}\n ${this._mapSubKernels(t=>`const result_${t.name} = new Array(${e[2]});\n`).join("")}\n for (let z = 0; z < ${e[2]}; z++) {\n this.thread.z = z;\n const resultY = result[z] = new Array(${e[1]});\n ${this._mapSubKernels(t=>`const result_${t.name}Y = result_${t.name}[z] = new Array(${e[1]});\n`).join("")}\n for (let y = 0; y < ${e[1]}; y++) {\n this.thread.y = y;\n const resultX = resultY[y] = new ${r}(${e[0]});\n ${this._mapSubKernels(t=>`const result_${t.name}X = result_${t.name}Y[y] = new ${r}(${e[0]});\n`).join("")}\n for (let x = 0; x < ${e[0]}; x++) {\n \tthis.thread.x = x;\n let kernelResult;\n ${t}\n resultX[x] = kernelResult;\n ${this._mapSubKernels(t=>`result_${t.name}X[x] = subKernelResult_${t.name};\n`).join("")}\n }\n }\n }`}_kernelOutput(){return this.subKernels?`return {\n result: result,\n ${this.subKernels.map(t=>`${t.property}: result_${t.name}`).join(",\n")}\n };`:"return result;"}_mapSubKernels(t){return null===this.subKernels?[""]:this.subKernels.map(t)}destroy(t){t&&delete this.canvas}static destroyContext(t){}toJSON(){const t=super.toJSON();return t.functionNodes=i.fromKernel(this,o).toJSON(),t}}}},{"../../utils":65,"../function-builder":45,"../kernel":49,"./function-node":42,"./kernel-string":43}],45:[function(t,e,r){class n{static fromKernel(t,e,r){const{argumentNames:i,argumentTypes:o,argumentSizes:a,argumentBitRatios:s,constants:u,constantTypes:l,constantBitRatios:c,debug:h,loopMaxIterations:p,nativeFunctions:f,output:d,optimizeFloatMemory:m,precision:g,plugins:v,source:_,subKernels:y,functions:b}=t,x=(t,e,r)=>F.lookupReturnType(t,e,r),w=(t,e)=>F.lookupArgumentType(t,e),E=t=>F.lookupFunctionArgumentTypes(t),k=(t,e)=>F.lookupFunctionArgumentName(t,e),T=(t,e)=>F.lookupFunctionArgumentBitRatio(t,e),S=(t,e,r,n)=>{F.assignArgumentType(t,e,r,n)},A=(t,e,r,n)=>{F.trackArgumentSynonym(t,e,r,n)},C=(t,e,r)=>F.lookupArgumentSynonym(t,e,r),R=(t,e)=>{F.trackFunctionCall(t,e)},B=Object.assign({isRootKernel:!1,onNestedFunction:(t,r)=>{F.addFunctionNode(new e(t,Object.assign({},B,{returnType:r||"Number",lookupReturnType:x,lookupArgumentType:w,lookupFunctionArgumentTypes:E,lookupFunctionArgumentName:k,lookupFunctionArgumentBitRatio:T,triggerImplyArgumentType:S,triggerTrackArgumentSynonym:A,lookupArgumentSynonym:C,onFunctionCall:R})))},lookupReturnType:x,lookupArgumentType:w,lookupFunctionArgumentTypes:E,lookupFunctionArgumentName:k,lookupFunctionArgumentBitRatio:T,triggerImplyArgumentType:S,triggerTrackArgumentSynonym:A,lookupArgumentSynonym:C,onFunctionCall:R,optimizeFloatMemory:m,precision:g,constants:u,constantTypes:l,constantBitRatios:c,debug:h,loopMaxIterations:p,output:d,plugins:v},r||{}),P=Object.assign({},B,{isRootKernel:!0,name:"kernel",argumentNames:i,argumentTypes:o,argumentSizes:a,argumentBitRatios:s});if("object"==typeof _&&_.functionNodes)return(new n).fromJSON(_.functionNodes,e);const I=new e(_,P);let M=null;b&&(M=b.map(t=>new e(t.source,{returnType:t.returnType,argumentTypes:t.argumentTypes,output:d,plugins:v,constants:u,constantTypes:l,constantBitRatios:c,optimizeFloatMemory:m,precision:g,lookupReturnType:x,lookupArgumentType:w,lookupFunctionArgumentTypes:E,lookupFunctionArgumentName:k,lookupFunctionArgumentBitRatio:T,triggerImplyArgumentType:S,triggerTrackArgumentSynonym:A,lookupArgumentSynonym:C,onFunctionCall:R})));let D=null;y&&(D=y.map(t=>{const{name:r,source:n}=t;return new e(n,Object.assign({},B,{name:r,isSubKernel:!0,isRootKernel:!1,returnType:"Number"}))}));const F=new n({kernel:t,rootNode:I,functionNodes:M,nativeFunctions:f,subKernelNodes:D});return F}constructor(t){if(t=t||{},this.kernel=t.kernel,this.rootNode=t.rootNode,this.functionNodes=t.functionNodes||[],this.subKernelNodes=t.subKernelNodes||[],this.nativeFunctions=t.nativeFunctions||[],this.functionMap={},this.nativeFunctionNames=[],this.lookupChain=[],this.argumentChain=[],this.functionNodeDependencies={},this.rootNode&&(this.functionMap.kernel=this.rootNode),this.functionNodes)for(let t=0;t-1)return-1===e.indexOf(t)&&e.push(t),e;const r=this.functionMap[t];if(r){const n=e.indexOf(t);if(-1===n){e.push(t),r.toString();for(let t=0;t-1){e.push(this.nativeFunctions[i].source);continue}const o=this.functionMap[n];o&&e.push(o.toString())}return e}toJSON(){return this.traceFunctionCalls(this.rootNode.name).reverse().map(t=>{const e=this.nativeFunctions.indexOf(t);if(e>-1)return{name:t,source:this.nativeFunctions[e].source};if(this.functionMap[t])return this.functionMap[t].toJSON();throw new Error(`function ${t} not found`)})}fromJSON(t,e){this.functionMap={};for(let r=0;r0&&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(t){return!!this.constants&&this.constants.hasOwnProperty(t)}isInput(t){return"Input"===this.argumentTypes[this.argumentNames.indexOf(t)]}pushState(t){this.states.push(t)}popState(t){if(this.state!==t)throw new Error(`Cannot popState ${t} when in ${this.state}`);this.states.pop()}isState(t){return this.state===t}get state(){return this.states[this.states.length-1]}astMemberExpressionUnroll(t){if("Identifier"===t.type)return t.name;if("ThisExpression"===t.type)return"this";if("MemberExpression"===t.type&&t.object&&t.property)return t.object.hasOwnProperty("name")&&"_"===t.object.name[0]?this.astMemberExpressionUnroll(t.property):this.astMemberExpressionUnroll(t.object)+"."+this.astMemberExpressionUnroll(t.property);if(t.hasOwnProperty("expressions")){const e=t.expressions[0];if("Literal"===e.type&&0===e.value&&2===t.expressions.length)return this.astMemberExpressionUnroll(t.expressions[1])}throw this.astErrorOutput("Unknown astMemberExpressionUnroll",t)}getJsAST(t){if("object"==typeof this.source)return this.ast=this.source;if(this.ast)return this.ast;if(null===(t=t||i))throw"Missing JS to AST parser";const e=Object.freeze(t.parse(`const parser_${this.name} = ${this.source};`,{locations:!0})),r=e.body[0].declarations[0].init;if(!e)throw new Error("Failed to parse JS code");return this.ast=r}getVariableType(t){let e=null;const r=this.argumentNames.indexOf(t);if(-1===r){if(this.declarations[t])return this.declarations[t].type}else{const n=this.argumentTypes[r];n?e=n:this.lookupArgumentType&&(e=this.argumentTypes[r]=this.lookupArgumentType(t,this))}return e}getConstantType(t){if(this.constantTypes[t]){const e=this.constantTypes[t];return"Float"===e?"Number":e}throw new Error(`Type for constant "${t}" not declared`)}getKernelArgumentName(t){return this.lookupArgumentSynonym?-1===this.argumentNames.indexOf(t)?null:this.lookupArgumentSynonym("kernel",this.name,t):null}toString(){return this._string?this._string:this._string=this.astGeneric(this.getJsAST(),[]).join("").trim()}toJSON(){const t={source:this.source,name:this.name,constants:this.constants,constantTypes:this.constantTypes,isRootKernel:this.isRootKernel,isSubKernel:this.isSubKernel,debug:this.debug,output:this.output,loopMaxIterations:this.loopMaxIterations,argumentNames:this.argumentNames,argumentTypes:this.argumentTypes,argumentSizes:this.argumentSizes,returnType:this.returnType};return{ast:this.ast,settings:t}}getType(t){if(Array.isArray(t))return this.getType(t[t.length-1]);switch(t.type){case"BlockStatement":return this.getType(t.body);case"ArrayExpression":return`Array(${t.elements.length})`;case"Literal":const e=`${t.start},${t.end}`;return this.literalTypes[e]?this.literalTypes[e]:Number.isInteger(t.value)?"LiteralInteger":"Number";case"CallExpression":if(this.isAstMathFunction(t))return"Number";if(!t.callee||!t.callee.name){if("SequenceExpression"===t.callee.type&&t.callee.expressions[t.callee.expressions.length-1].property.name)return this.lookupReturnType(t.callee.expressions[t.callee.expressions.length-1].property.name,t,this);throw this.astErrorOutput("Unknown call expression",t)}if(t.callee&&t.callee.name)return this.lookupReturnType(t.callee.name,t,this);throw this.astErrorOutput(`Unhandled getType Type "${t.type}"`,t);case"BinaryExpression":switch(t.operator){case"%":return"Number";case">":case"<":return"Boolean"}const r=this.getType(t.left);return o[r]||r;case"UpdateExpression":case"UnaryExpression":return this.getType(t.argument);case"VariableDeclaration":return this.getType(t.declarations[0]);case"VariableDeclarator":return this.getType(t.id);case"Identifier":if(this.isAstVariable(t)&&"value"===this.getVariableSignature(t)){if(this.argumentNames.indexOf(t.name)>-1)return this.getVariableType(t.name);if(this.declarations[t.name])return this.declarations[t.name].type}if("Infinity"===t.name)return"Number";const n=this.findIdentifierOrigin(t);return n&&n.init?this.getType(n.init):null;case"ReturnStatement":return this.getType(t.argument);case"MemberExpression":if(this.isAstMathFunction(t)){switch(t.property.name){case"ceil":case"floor":case"round":return"Integer"}return"Number"}if(this.isAstVariable(t)){switch(this.getVariableSignature(t)){case"value[]":return o[this.getVariableType(t.object.name)];case"value[][]":return o[this.getVariableType(t.object.object.name)];case"value[][][]":return o[this.getVariableType(t.object.object.object.name)];case"value[][][][]":return o[this.getVariableType(t.object.object.object.object.name)];case"this.thread.value":return"Integer";case"this.output.value":return"LiteralInteger";case"this.constants.value":return this.getConstantType(t.property.name);case"this.constants.value[]":return o[this.getConstantType(t.object.property.name)];case"this.constants.value[][]":return o[this.getConstantType(t.object.object.property.name)];case"this.constants.value[][][]":return o[this.getConstantType(t.object.object.object.property.name)];case"this.constants.value[][][][]":return o[this.getConstantType(t.object.object.object.object.property.name)];case"fn()[]":case"fn()[][]":case"fn()[][][]":return o[this.getType(t.object)];case"value.value":if(this.isAstMathVariable(t))return"Number";switch(t.property.name){case"r":case"g":case"b":case"a":return o[this.getVariableType(t.object.name)]}case"[][]":return"Number"}throw this.astErrorOutput("Unhandled getType MemberExpression",t)}throw this.astErrorOutput("Unhandled getType MemberExpression",t);case"ConditionalExpression":return this.getType(t.consequent);case"FunctionDeclaration":case"FunctionExpression":const i=this.findLastReturn(t.body);return i?this.getType(i):null;case"IfStatement":return this.getType(t.consequent);default:throw this.astErrorOutput(`Unhandled getType Type "${t.type}"`,t)}}isAstMathVariable(t){return"MemberExpression"===t.type&&t.object&&"Identifier"===t.object.type&&"Math"===t.object.name&&t.property&&"Identifier"===t.property.type&&["E","PI","SQRT2","SQRT1_2","LN2","LN10","LOG2E","LOG10E"].indexOf(t.property.name)>-1}isAstMathFunction(t){return"CallExpression"===t.type&&t.callee&&"MemberExpression"===t.callee.type&&t.callee.object&&"Identifier"===t.callee.object.type&&"Math"===t.callee.object.name&&t.callee.property&&"Identifier"===t.callee.property.type&&["abs","acos","asin","atan","atan2","ceil","cos","exp","floor","log","log2","max","min","pow","random","round","sign","sin","sqrt","tan"].indexOf(t.callee.property.name)>-1}isAstVariable(t){return"Identifier"===t.type||"MemberExpression"===t.type}isSafe(t){return this.isSafeDependencies(this.getDependencies(t))}isSafeDependencies(t){return!t||!t.every||t.every(t=>t.isSafe)}getDependencies(t,e,r){if(e||(e=[]),!t)return null;if(Array.isArray(t)){for(let n=0;n-1/0&&t.value<1/0&&!isNaN(t.value)});break;case"VariableDeclarator":return this.getDependencies(t.init,e,r);case"Identifier":this.declarations[t.name]?e.push({name:t.name,origin:"declaration",isSafe:!r&&this.isSafeDependencies(this.declarations[t.name].dependencies)}):this.argumentNames.indexOf(t.name)>-1&&e.push({name:t.name,origin:"argument",isSafe:!1});break;case"FunctionDeclaration":return this.getDependencies(t.body.body[t.body.body.length-1],e,r);case"ReturnStatement":return this.getDependencies(t.argument,e);case"BinaryExpression":return r="/"===t.operator||"*"===t.operator,this.getDependencies(t.left,e,r),this.getDependencies(t.right,e,r),e;case"UnaryExpression":case"UpdateExpression":return this.getDependencies(t.argument,e,r);case"VariableDeclaration":return this.getDependencies(t.declarations,e,r);case"ArrayExpression":return e.push({origin:"declaration",isSafe:!0}),e;case"CallExpression":return e.push({origin:"function",isSafe:!0}),e;case"MemberExpression":const n=this.getMemberExpressionDetails(t);if(n)return n.type;default:throw this.astErrorOutput(`Unhandled type ${t.type} in getAllVariables`,t)}return e}getVariableSignature(t){if(!this.isAstVariable(t))throw new Error(`ast of type "${t.type}" is not a variable signature`);if("Identifier"===t.type)return"value";const e=[];for(;t;)t.computed?e.push("[]"):"ThisExpression"===t.type?e.unshift("this"):t.property&&t.property.name?"x"===t.property.name||"y"===t.property.name||"z"===t.property.name?e.unshift(".value"):"constants"===t.property.name||"thread"===t.property.name||"output"===t.property.name?e.unshift("."+t.property.name):e.unshift(".value"):t.name?e.unshift("value"):t.callee&&t.callee.name?e.unshift("fn()"):t.elements?e.unshift("[]"):e.unshift("unknown"),t=t.object;const r=e.join("");return["value","value[]","value[][]","value[][][]","value[][][][]","value.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(r)>-1?r:null}build(){return this.toString().length>0}astGeneric(t,e){if(null===t)throw this.astErrorOutput("NULL ast",t);if(Array.isArray(t)){for(let r=0;r0?i[i.length-1]:0;return new Error(`${t} on line ${i.length}, position ${o.length}:\n ${r}`)}astDebuggerStatement(t,e){return e}astConditionalExpression(t,e){if("ConditionalExpression"!==t.type)throw this.astErrorOutput("Not a conditional expression",t);return e.push("("),this.astGeneric(t.test,e),e.push("?"),this.astGeneric(t.consequent,e),e.push(":"),this.astGeneric(t.alternate,e),e.push(")"),e}astFunctionDeclaration(t,e){if(this.onNestedFunction){let e=this.getType(t);"LiteralInteger"===e&&(e="Number"),this.onNestedFunction(n.getAstString(this.source,t),e)}return e}astFunctionExpression(t,e){return e}astReturnStatement(t,e){return e}astLiteral(t,e){return this.literalTypes[`${t.start},${t.end}`]="Number",e}astBinaryExpression(t,e){return e}astIdentifierExpression(t,e){return e}astAssignmentExpression(t,e){return e}astExpressionStatement(t,e){return this.astGeneric(t.expression,e),e.push(";"),e}astEmptyStatement(t,e){return e}astBlockStatement(t,e){return e}astIfStatement(t,e){return e}astBreakStatement(t,e){return e.push("break;"),e}astContinueStatement(t,e){return e.push("continue;\n"),e}astForStatement(t,e){return e}astWhileStatement(t,e){return e}astDoWhileStatement(t,e){return e}astVariableDeclaration(t,e){const r=t.declarations;if(!r||!r[0]||!r[0].init)throw this.astErrorOutput("Unexpected expression",t);const n=[],i=r[0],o=i.init;let a=this.isState("in-for-loop-init")?"Integer":this.getType(o);"LiteralInteger"===a&&(a="Number");const s=typeMap[a];if(!s)throw this.astErrorOutput(`Markup type ${s} not handled`,t);let u=this.getDependencies(i.init);this.declarations[i.id.name]=Object.freeze({type:a,dependencies:u,isSafe:u.every(t=>t.isSafe)});const l=[`${a} user_${i.id.name}=`];this.astGeneric(o,l),n.push(l.join(""));for(let t=1;t0&&e.push(","),this.astGeneric(t.expressions,e);return e}astUnaryExpression(t,e){return t.prefix?(e.push(t.operator),this.astGeneric(t.argument,e)):(this.astGeneric(t.argument,e),e.push(t.operator)),e}astUpdateExpression(t,e){return t.prefix?(e.push(t.operator),this.astGeneric(t.argument,e)):(this.astGeneric(t.argument,e),e.push(t.operator)),e}astLogicalExpression(t,e){return e.push("("),this.astGeneric(t.left,e),e.push(t.operator),this.astGeneric(t.right,e),e.push(")"),e}astMemberExpression(t,e){return e}astCallExpression(t,e){return e}astArrayExpression(t,e){return e}getMemberExpressionDetails(t){if("MemberExpression"!==t.type)throw this.astErrorOutput(`Expression ${t.type} not a MemberExpression`,t);let e=null,r=null;const n=this.getVariableSignature(t);switch(n){case"value":return null;case"this.thread.value":case"this.output.value":return{signature:n,type:"Integer",name:t.property.name};case"value[]":if("string"!=typeof t.object.name)throw this.astErrorOutput("Unexpected expression",t);return{name:e=t.object.name,origin:"user",signature:n,type:this.getVariableType(e),xProperty:t.property};case"value[][]":if("string"!=typeof t.object.object.name)throw this.astErrorOutput("Unexpected expression",t);return{name:e=t.object.object.name,origin:"user",signature:n,type:this.getVariableType(e),yProperty:t.object.property,xProperty:t.property};case"value[][][]":if("string"!=typeof t.object.object.object.name)throw this.astErrorOutput("Unexpected expression",t);return{name:e=t.object.object.object.name,origin:"user",signature:n,type:this.getVariableType(e),zProperty:t.object.object.property,yProperty:t.object.property,xProperty:t.property};case"value[][][][]":if("string"!=typeof t.object.object.object.object.name)throw this.astErrorOutput("Unexpected expression",t);return{name:e=t.object.object.object.object.name,origin:"user",signature:n,type:this.getVariableType(e),zProperty:t.object.object.property,yProperty:t.object.property,xProperty:t.property};case"value.value":if("string"!=typeof t.property.name)throw this.astErrorOutput("Unexpected expression",t);if(this.isAstMathVariable(t))return{name:e=t.property.name,origin:"Math",type:"Number",signature:n};switch(t.property.name){case"r":case"g":case"b":case"a":return{name:e=t.object.name,property:t.property.name,origin:"user",signature:n,type:"Number"};default:throw this.astErrorOutput("Unexpected expression",t)}case"this.constants.value":if("string"!=typeof t.property.name)throw this.astErrorOutput("Unexpected expression",t);if(e=t.property.name,!(r=this.getConstantType(e)))throw this.astErrorOutput("Constant has no type",t);return{name:e,type:r,origin:"constants",signature:n};case"this.constants.value[]":if("string"!=typeof t.object.property.name)throw this.astErrorOutput("Unexpected expression",t);if(e=t.object.property.name,!(r=this.getConstantType(e)))throw this.astErrorOutput("Constant has no type",t);return{name:e,type:r,origin:"constants",signature:n,xProperty:t.property};case"this.constants.value[][]":if("string"!=typeof t.object.object.property.name)throw this.astErrorOutput("Unexpected expression",t);if(e=t.object.object.property.name,!(r=this.getConstantType(e)))throw this.astErrorOutput("Constant has no type",t);return{name:e,type:r,origin:"constants",signature:n,yProperty:t.object.property,xProperty:t.property};case"this.constants.value[][][]":if("string"!=typeof t.object.object.object.property.name)throw this.astErrorOutput("Unexpected expression",t);if(e=t.object.object.object.property.name,!(r=this.getConstantType(e)))throw this.astErrorOutput("Constant has no type",t);return{name:e,type:r,origin:"constants",signature:n,zProperty:t.object.object.property,yProperty:t.object.property,xProperty:t.property};case"fn()[]":case"[][]":return{signature:n,property:t.property};default:throw this.astErrorOutput("Unexpected expression",t)}}findIdentifierOrigin(t){const e=[this.ast];for(;e.length>0;){const r=e[0];if("VariableDeclarator"===r.type&&r.id&&r.id.name&&r.id.name===t.name)return r;if(e.shift(),r.argument)e.push(r.argument);else if(r.body)e.push(r.body);else if(r.declarations)e.push(r.declarations);else if(Array.isArray(r))for(let t=0;t0;){const t=e.pop();if("ReturnStatement"===t.type)return t;if(t.argument)e.push(t.argument);else if(t.body)e.push(t.body);else if(t.declarations)e.push(t.declarations);else if(Array.isArray(t))for(let r=0;r0?n[n.length-1]:null;if("FUNCTION_ARGUMENTS"!==p||"/"!==c||"*"!==h)if("MULTI_LINE_COMMENT"!==p||"*"!==c||"/"!==h)if("FUNCTION_ARGUMENTS"!==p||"/"!==c||"/"!==h)if("COMMENT"!==p||"\n"!==c)if(null!==p||"("!==c){if("FUNCTION_ARGUMENTS"===p){if(")"===c){n.pop();break}if("f"===c&&"l"===h&&"o"===t[a+2]&&"a"===t[a+3]&&"t"===t[a+4]&&" "===t[a+5]){n.push("DECLARE_VARIABLE"),l="float",u="",a+=6;continue}if("i"===c&&"n"===h&&"t"===t[a+2]&&" "===t[a+3]){n.push("DECLARE_VARIABLE"),l="int",u="",a+=4;continue}if("v"===c&&"e"===h&&"c"===t[a+2]&&"2"===t[a+3]&&" "===t[a+4]){n.push("DECLARE_VARIABLE"),l="vec2",u="",a+=5;continue}if("v"===c&&"e"===h&&"c"===t[a+2]&&"3"===t[a+3]&&" "===t[a+4]){n.push("DECLARE_VARIABLE"),l="vec3",u="",a+=5;continue}if("v"===c&&"e"===h&&"c"===t[a+2]&&"4"===t[a+3]&&" "===t[a+4]){n.push("DECLARE_VARIABLE"),l="vec4",u="",a+=5;continue}}else if("DECLARE_VARIABLE"===p){if(""===u){if(" "===c){a++;continue}if(!i.test(c))throw new Error("variable name is not expected string")}u+=c,o.test(h)||(n.pop(),r.push(u),e.push(s[l]))}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:e}}static nativeFunctionReturnType(t){return s[t.match(/int|float|vec[2-4]/)[0]]}static combineKernels(t,e){t.apply(null,arguments);const{texSize:r,context:n,threadDim:i}=e.texSize;let a;if("single"===e.precision){const t=r[0],e=Math.ceil(r[1]/4);a=new Float32Array(t*e*4*4),n.readPixels(0,0,t,4*e,n.RGBA,n.FLOAT,a)}else{const t=new Uint8Array(r[0]*r[1]*4);n.readPixels(0,0,r[0],r[1],n.RGBA,n.UNSIGNED_BYTE,t),a=new Float32Array(t.buffer)}return a=a.subarray(0,i[0]*i[1]*i[2]),1===e.output.length?a:2===e.output.length?o.splitArray(a,e.output[0]):3===e.output.length?o.splitArray(a,e.output[0]*e.output[1]).map(function(t){return o.splitArray(t,e.output[0])}):void 0}constructor(t,e){super(t,e),this.texSize=null,this.floatOutputForce=null,this.fixIntegerDivisionAccuracy=null,this.translatedSource=null,this.renderStrategy=null,this.compiledFragmentShader=null,this.compiledVertexShader=null,this.optimizeFloatMemory=null}translateSource(){throw new Error(`"translateSource" not defined on ${this.constructor.name}`)}pickRenderStrategy(t){if(!this.graphical){if("unsigned"===this.precision)switch(this.returnType){case"LiteralInteger":case"Float":case"Number":case"Integer":return this.pipeline?(this.renderStrategy=a.PackedTexture,this.renderOutput=this.renderTexture):this.output[2]>0?(this.renderStrategy=a.PackedPixelTo3DFloat,this.renderOutput=this.render3DPackedFloat):this.output[1]>0?(this.renderStrategy=a.PackedPixelTo2DFloat,this.renderOutput=this.render2DPackedFloat):(this.renderStrategy=a.PackedPixelToFloat,this.renderOutput=this.renderPackedFloat),!0;case"Array(2)":case"Array(3)":case"Array(4)":return this.onRequestFallback(t),!1}else{if("single"!==this.precision)throw new Error(`unhandled precision of "${this.precision}"`);if(this.pipeline)return this.renderStrategy=a.FloatTexture,this.renderOutput=this.renderTexture,!0;switch(this.returnType){case"LiteralInteger":case"Float":case"Number":case"Integer":return this.output[2]>0?this.optimizeFloatMemory?(this.renderStrategy=a.MemoryOptimizedFloatPixelToMemoryOptimized3DFloat,this.renderOutput=this.renderMemoryOptimized3DFloat):(this.renderStrategy=a.FloatPixelTo3DFloat,this.renderOutput=this.render3DFloat):this.output[1]>0?this.optimizeFloatMemory?(this.renderStrategy=a.MemoryOptimizedFloatPixelToMemoryOptimized2DFloat,this.renderOutput=this.renderMemoryOptimized2DFloat):(this.renderStrategy=a.FloatPixelTo2DFloat,this.renderOutput=this.render2DFloat):this.optimizeFloatMemory?(this.renderStrategy=a.MemoryOptimizedFloatPixelToMemoryOptimizedFloat,this.renderOutput=this.renderMemoryOptimizedFloat):(this.renderStrategy=a.FloatPixelToFloat,this.renderOutput=this.renderFloat),!0;case"Array(2)":return this.output[2]>0?(this.renderStrategy=a.FloatPixelTo3DArray2,this.renderOutput=this.render3DArray2):this.output[1]>0?(this.renderStrategy=a.FloatPixelTo2DArray2,this.renderOutput=this.render2DArray2):(this.renderStrategy=a.FloatPixelToArray2,this.renderOutput=this.renderArray2),!0;case"Array(3)":return this.output[2]>0?(this.renderStrategy=a.FloatPixelTo3DArray3,this.renderOutput=this.render3DArray3):this.output[1]>0?(this.renderStrategy=a.FloatPixelTo2DArray3,this.renderOutput=this.render2DArray3):(this.renderStrategy=a.FloatPixelToArray3,this.renderOutput=this.renderArray3),!0;case"Array(4)":return this.output[2]>0?(this.renderStrategy=a.FloatPixelTo3DArray4,this.renderOutput=this.render3DArray4):this.output[1]>0?(this.renderStrategy=a.FloatPixelTo2DArray4,this.renderOutput=this.render2DArray4):(this.renderStrategy=a.FloatPixelToArray4,this.renderOutput=this.renderArray4),!0}}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 o.linesToString(this.getMainResultKernelNumberTexture())+o.linesToString(this.getMainResultSubKernelNumberTexture())}getMainResultArray2Texture(){return o.linesToString(this.getMainResultKernelArray2Texture())+o.linesToString(this.getMainResultSubKernelArray2Texture())}getMainResultArray3Texture(){return o.linesToString(this.getMainResultKernelArray3Texture())+o.linesToString(this.getMainResultSubKernelArray3Texture())}getMainResultArray4Texture(){return o.linesToString(this.getMainResultKernelArray4Texture())+o.linesToString(this.getMainResultSubKernelArray4Texture())}getReturnTextureType(){if(this.graphical)return"ArrayTexture(4)";if("single"===this.precision)switch(this.returnType){case"Float":case"Number":case"Integer":return this.optimizeFloatMemory?"MemoryOptimizedNumberTexture":"ArrayTexture(1)";case"Array(2)":return"ArrayTexture(2)";case"Array(3)":return"ArrayTexture(3)";case"Array(4)":return"ArrayTexture(4)";default:throw new Error(`unsupported returnType ${this.returnType}`)}else switch(this.returnType){case"Float":case"Number":case"Integer":return"NumberTexture";case"Array(2)":case"Array(3)":case"Array(4)":default:throw new Error(`unsupported returnType ${this.returnType}`)}}renderTexture(){return new i({texture:this.outputTexture,size:this.texSize,dimensions:this.threadDim,output:this.output,context:this.context,gpu:this.gpu,type:this.getReturnTextureType()})}readPackedPixelsToUint8Array(){if("unsigned"!==this.precision)throw new Error('Requires this.precision to be "unsigned"');const{texSize:t,context:e}=this,r=new Uint8Array(t[0]*t[1]*4);return e.readPixels(0,0,t[0],t[1],e.RGBA,e.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:t,context:e}=this,r=t[0],n=t[1],i=new Float32Array(r*n*4);return e.readPixels(0,0,r,n,e.RGBA,e.FLOAT,i),i}readMemoryOptimizedFloatPixelsToFloat32Array(){if("single"!==this.precision)throw new Error('Requires this.precision to be "single"');const{texSize:t,context:e}=this,r=t[0],n=t[1],i=new Float32Array(r*n*4);return e.readPixels(0,0,r,n,e.RGBA,e.FLOAT,i),i}renderPackedFloat(){const[t]=this.output;return this.readPackedPixelsToFloat32Array().subarray(0,t)}render2DPackedFloat(){const t=this.readPackedPixelsToFloat32Array(),[e,r]=this.output,n=new Array(r);for(let i=0;in.functionToIFunction(t));continue}this[e]=t[e]}this.canvas||(this.canvas=this.initCanvas()),this.context||(this.context=this.initContext()),this.plugins||(this.plugins=this.initPlugins(t))}build(){throw new Error(`"build" not defined on ${this.constructor.name}`)}run(){throw new Error(`"run" not defined on ${this.constructor.name}`)}initCanvas(){throw new Error(`"initCanvas" not defined on ${this.constructor.name}`)}initContext(){throw new Error(`"initContext" not defined on ${this.constructor.name}`)}initPlugins(t){throw new Error(`"initPlugins" not defined on ${this.constructor.name}`)}setupArguments(t){if(!this.argumentTypes){this.argumentTypes=[];for(let e=0;en.functionToIFunction(t)):this.functions=t,this}setPipeline(t){return this.pipeline=t,this}setPrecision(t){return this.precision=t,this}setOutputToTexture(t){return n.warnDeprecated("method","setOutputToTexture","setPipeline"),this.pipeline=t,this}setImmutable(t){return this.immutable=t,this}setCanvas(t){return this.canvas=t,this}getCanvas(){return n.warnDeprecated("method","getCanvas"),this.canvas}getWebGl(){return n.warnDeprecated("method","getWebGl"),this.context}setContext(t){return this.context=t,this}setArgumentTypes(t){return this.argumentTypes=t,this}requestFallback(t){if(!this.onRequestFallback)throw new Error(`"onRequestFallback" not defined on ${this.constructor.name}`);return this.onRequestFallback(t)}validateSettings(){throw new Error(`"validateSettings" not defined on ${this.constructor.name}`)}exec(){const t=1===arguments.length?[arguments[0]]:Array.apply(null,arguments);return new Promise((e,r)=>{try{e(this.run.apply(this,t))}catch(t){r(t)}})}addSubKernel(t){if(null===this.subKernels&&(this.subKernels=[]),!t.source)throw new Error('subKernel missing "source" property');if(!t.property&&isNaN(t.property))throw new Error('subKernel missing "property" property');if(!t.name)throw new Error('subKernel missing "name" property');return this.subKernels.push(t),this}destroy(t){throw new Error(`"destroy" called on ${this.constructor.name}`)}getBitRatio(t){if("single"===this.precision)return 4;if(Array.isArray(t[0]))return this.getBitRatio(t[0]);if(t.constructor===i)return this.getBitRatio(t.value);switch(t.constructor){case Uint8Array:case Int8Array:return 1;case Uint16Array:case Int16Array:return 2;case Float32Array:case Int32Array:default:return 4}}getPixels(){throw new Error(`"getPixels" called on ${this.constructor.name}`)}checkOutput(){if(!this.output||!Array.isArray(this.output))throw new Error("kernel.output not an array");if(this.output.length<1)throw new Error("kernel.output is empty, needs at least 1 value");for(let t=0;tt.name):null,returnType:this.returnType}}}}}},{"../input":61,"../utils":65}],50:[function(t,e,r){e.exports={fragmentShader:"__HEADER__;\nprecision highp float;\nprecision highp int;\nprecision highp sampler2D;\n\nconst int LOOP_MAX = __LOOP_MAX__;\n\n__PLUGINS__;\n__CONSTANTS__;\n\nvarying vec2 vTexCoord;\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\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\tint channel = integerMod(index, 2);\n\tif (channel == 0) return texel.r * 255.0 + texel.g * 65280.0;\n\tif (channel == 1) return texel.b * 255.0 + texel.a * 65280.0;\n\treturn 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 encode32(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// 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 ivec3 xyz = ivec3(x, y, z);\n int index = xyz.x + texDim.x * (xyz.y + texDim.y * xyz.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 ivec3 xyz = ivec3(x, y, z);\n int index = xyz.x + texDim.x * (xyz.y + texDim.y * xyz.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 ivec3 xyz = ivec3(x, y, z);\n int index = xyz.x + texDim.x * (xyz.y + texDim.y * xyz.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 ivec3 xyz = ivec3(x, y, z);\n int index = xyz.x + texDim.x * (xyz.y + texDim.y * xyz.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 ivec3 xyz = ivec3(x, y, z);\n int index = xyz.x + texDim.x * (xyz.y + texDim.y * xyz.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\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\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 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\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}"}},{}],51:[function(t,e,r){const{FunctionNode:n}=t("../function-node"),i="Math.",o="this.";const a={Array:"sampler2D","Array(2)":"vec2","Array(3)":"vec3","Array(4)":"vec4",Array2D:"sampler2D",Array3D:"sampler2D",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"},s={"===":"==","!==":"!="};e.exports={WebGLFunctionNode:class extends n{constructor(t,e){super(t,e),this.fixIntegerDivisionAccuracy=null,e&&e.hasOwnProperty("fixIntegerDivisionAccuracy")&&(this.fixIntegerDivisionAccuracy=e.fixIntegerDivisionAccuracy)}astFunctionExpression(t,e){if(this.isRootKernel)e.push("void");else{this.returnType||this.findLastReturn()&&(this.returnType=this.getType(t.body),"LiteralInteger"===this.returnType&&(this.returnType="Number"));const{returnType:r}=this;if(r){const t=a[r];if(!t)throw new Error(`unknown type ${r}`);e.push(t)}else e.push("void")}if(e.push(" "),e.push(this.name),e.push("("),!this.isRootKernel)for(let r=0;r0&&e.push(", ");let i=this.getVariableType(n);i&&"LiteralInteger"!==i||(i="Number");const o=a[i];if(!o)throw this.astErrorOutput("Unexpected expression",t);e.push(o),e.push(" "),e.push("user_"),e.push(n)}e.push(") {\n");for(let r=0;r"===t.operator||"<"===t.operator&&"Literal"===t.right.type)&&!Number.isInteger(t.right.value)){this.pushState("casting-to-float"),e.push("float("),this.astGeneric(t.left,e),e.push(")"),this.popState("casting-to-float"),e.push(s[t.operator]||t.operator),this.astGeneric(t.right,e);break}if(this.astGeneric(t.left,e),e.push(s[t.operator]||t.operator),this.pushState("casting-to-integer"),"Literal"===t.right.type){const r=[];if(this.astGeneric(t.right,r),"Integer"!==this.getType(t.right))throw this.astErrorOutput("Unhandled binary expression with literal",t);e.push(r.join(""))}else e.push("int("),this.astGeneric(t.right,e),e.push(")");this.popState("casting-to-integer");break;case"Integer & LiteralInteger":this.astGeneric(t.left,e),e.push(s[t.operator]||t.operator),this.pushState("casting-to-integer"),this.astGeneric(t.right,e),this.popState("casting-to-integer");break;case"Number & Integer":this.astGeneric(t.left,e),e.push(s[t.operator]||t.operator),this.pushState("casting-to-float"),e.push("float("),this.astGeneric(t.right,e),e.push(")"),this.popState("casting-to-float");break;case"Float & LiteralInteger":case"Number & LiteralInteger":this.isState("in-for-loop-test")?(e.push("int("),this.astGeneric(t.left,e),e.push(")"),e.push(s[t.operator]||t.operator),this.pushState("casting-to-integer"),this.astGeneric(t.right,e),this.popState("casting-to-integer")):(this.astGeneric(t.left,e),e.push(s[t.operator]||t.operator),this.pushState("casting-to-float"),this.astGeneric(t.right,e),this.popState("casting-to-float"));break;case"LiteralInteger & Float":case"LiteralInteger & Number":this.isState("in-for-loop-test")||this.isState("in-for-loop-init")||this.isState("casting-to-integer")?(this.pushState("casting-to-integer"),this.astGeneric(t.left,e),e.push(s[t.operator]||t.operator),e.push("int("),this.astGeneric(t.right,e),e.push(")"),this.popState("casting-to-integer")):(this.astGeneric(t.left,e),e.push(s[t.operator]||t.operator),this.pushState("casting-to-float"),this.astGeneric(t.right,e),this.popState("casting-to-float"));break;case"LiteralInteger & Integer":this.pushState("casting-to-integer"),this.astGeneric(t.left,e),this.popState("casting-to-integer"),e.push(s[t.operator]||t.operator),this.astGeneric(t.right,e);break;default:throw this.astErrorOutput(`Unhandled binary expression between ${i}`,t)}}return e.push(")"),e}astIdentifierExpression(t,e){if("Identifier"!==t.type)throw this.astErrorOutput("IdentifierExpression - not an Identifier",t);if("Infinity"===t.name)e.push("3.402823466e+38");else{const r=this.getKernelArgumentName(t.name);r?e.push(`user_${r}`):e.push(`user_${t.name}`)}return e}astForStatement(t,e){if("ForStatement"!==t.type)throw this.astErrorOutput("Invalid for statement",t);const r=[],n=[],i=[],o=[];let a=null;if(t.init){this.pushState("in-for-loop-init"),this.astGeneric(t.init,r);for(let t=0;t0&&e.push(r.join(""),";\n"),e.push(`for (int ${t}=0;${t}0&&e.push(`if (!${n.join("")}) break;\n`),e.push(o.join("")),e.push(`\n${i.join("")};`),e.push("}\n")}return e}astWhileStatement(t,e){if("WhileStatement"!==t.type)throw this.astErrorOutput("Invalid while statement",t);const r=this.getInternalVariableName("safeI");return e.push(`for (int ${r}=0;${r}0)for(let t=0;t0&&e.push(", "),i){case"Integer":this.pushState("casting-to-float"),e.push("float("),this.astGeneric(n,e),e.push(")"),this.popState("casting-to-float");break;default:this.astGeneric(n,e)}}else{const n=this.lookupFunctionArgumentTypes(r)||[];for(let i=0;i0&&e.push(", ");const s=this.getType(o);switch(a||(this.triggerImplyArgumentType(r,i,s,this),a=s),s){case"Number":case"Float":if("Integer"===a){e.push("int("),this.astGeneric(o,e),e.push(")");continue}if("Number"===a||"Float"===a){this.astGeneric(o,e);continue}if("LiteralInteger"===a){this.pushState("casting-to-float"),this.astGeneric(o,e),this.popState("casting-to-float");continue}break;case"Integer":if("Number"===a||"Float"===a){e.push("float("),this.astGeneric(o,e),e.push(")");continue}if("Integer"===a){this.astGeneric(o,e);continue}break;case"LiteralInteger":if("Integer"===a){this.pushState("casting-to-integer"),this.astGeneric(o,e),this.popState("casting-to-integer");continue}if("Number"===a||"Float"===a){this.pushState("casting-to-float"),this.astGeneric(o,e),this.popState("casting-to-float");continue}if("LiteralInteger"===a){this.astGeneric(o,e);continue}break;case"Array(2)":case"Array(3)":case"Array(4)":if(a===s){this.astGeneric(o,e);continue}break;case"Array":case"Input":if(a===s){this.triggerTrackArgumentSynonym(this.name,o.name,r,i),this.astGeneric(o,e);continue}}throw new Error(`Unhandled argument combination of ${s} and ${a}`)}}return e.push(")"),e}astArrayExpression(t,e){const r=t.elements.length;e.push("vec"+r+"(");for(let n=0;n0&&e.push(", ");const r=t.elements[n];this.astGeneric(r,e)}return e.push(")"),e}memberExpressionXYZ(t,e,r,n){return r?n.push(this.memberExpressionPropertyMarkup(r),", "):n.push("0, "),e?n.push(this.memberExpressionPropertyMarkup(e),", "):n.push("0, "),n.push(this.memberExpressionPropertyMarkup(t)),n}memberExpressionPropertyMarkup(t){if(!t)throw new Error("Property not set");const e=this.getType(t),r=[];return"Number"===e?(this.pushState("casting-to-integer"),r.push("int("),this.astGeneric(t,r),r.push(")"),this.popState("casting-to-integer")):"LiteralInteger"===e?(this.pushState("casting-to-integer"),this.astGeneric(t,r),this.popState("casting-to-integer")):this.astGeneric(t,r),r.join("")}}}},{"../function-node":46}],52:[function(t,e,r){const{utils:n}=t("../../utils"),{kernelRunShortcut:i}=t("../../kernel-run-shortcut");function o(t){return/^function /.test(t)&&(t=t.substring(9)),t.replace(/[_]typeof/g,"typeof")}function a(t){return t.replace(/^[A-Za-z23]+/,"function").replace(/[_]typeof/g,"typeof")}function s(t){return t?"true":!1===t?"false":"null"}e.exports={webGLKernelString:function(t,e){return`() => {\n ${i.toString()};\n const utils = {\n allPropertiesOf: ${a(n.allPropertiesOf.toString())},\n clone: ${a(n.clone.toString())},\n splitArray: ${a(n.splitArray.toString())},\n getVariableType: ${a(n.getVariableType.toString())},\n getDimensions: ${a(n.getDimensions.toString())},\n dimToTexSize: ${a(n.dimToTexSize.toString())},\n closestSquareDimensions: ${a(n.closestSquareDimensions.toString())},\n getMemoryOptimizedFloatTextureSize: ${a(n.getMemoryOptimizedFloatTextureSize.toString())},\n getMemoryOptimizedPackedTextureSize: ${a(n.getMemoryOptimizedPackedTextureSize.toString())},\n roundTo: ${a(n.roundTo.toString())},\n flattenTo: ${a(n.flattenTo.toString())},\n flatten2dArrayTo: ${a(n.flatten2dArrayTo.toString())},\n flatten3dArrayTo: ${a(n.flatten3dArrayTo.toString())},\n systemEndianness: ${a(n.getSystemEndianness.toString())},\n isArray: ${a(n.isArray.toString())}\n };\n const canvases = [];\n const maxTexSizes = {};\n let Texture = function() {};\n let Input = function() {}; \n class ${e||"Kernel"} {\n constructor() {\n this.maxTexSize = null;\n this.argumentsLength = 0;\n this.constantsLength = 0;\n this.constantBitRatios = ${t.constantBitRatios?JSON.stringify(t.constantBitRatios):"null"};\n this.canvas = null;\n this.context = null;\n this.program = null;\n this.subKernels = null;\n this.subKernelNames = null;\n this.drawBuffersMap = ${t.drawBuffersMap?JSON.stringify(t.drawBuffersMap):"null"};\n this.endianness = '${t.endianness}';\n this.graphical = ${s(t.graphical)};\n this.optimizeFloatMemory = ${s(t.optimizeFloatMemory)};\n this.precision = "${t.precision}";\n // TODO: not sure how to handle\n this.floatOutputForce = ${s(t.floatOutputForce)};\n this.hardcodeConstants = ${s(t.hardcodeConstants)};\n this.pipeline = ${s(t.pipeline)};\n this.argumentNames = ${JSON.stringify(t.argumentNames)};\n this.argumentTypes = ${JSON.stringify(t.argumentTypes)};\n this.argumentBitRatios = ${JSON.stringify(t.argumentBitRatios)};\n \n this.texSize = ${JSON.stringify(Array.from(t.texSize))};\n this.output = ${JSON.stringify(t.output)};\n this.compiledFragmentShader = \`${t.compiledFragmentShader}\`;\n\t\t this.compiledVertexShader = \`${t.compiledVertexShader}\`;\n\t\t this.returnType = '${t.returnType}';\n\t\t this.programUniformLocationCache = {};\n\t\t this.textureCache = {};\n\t\t this.subKernelOutputTextures = null;\n\t\t this.extensions = {};\n\t\t this.uniform1fCache = {};\n\t\t this.uniform1iCache = {};\n\t\t this.uniform2fCache = {};\n\t\t this.uniform2fvCache = {};\n\t\t this.uniform2ivCache = {};\n\t\t this.uniform3fvCache = {};\n\t\t this.uniform3ivCache = {};\n }\n getFragmentShader() { return this.compiledFragmentShader; }\n getVertexShader() { return this.compiledVertexShader; }\n validateSettings() {}\n initExtensions() {}\n setupArguments() {}\n setupConstants() {}\n setCanvas(canvas) { this.canvas = canvas; return this; }\n setContext(context) { this.context = context; return this; }\n setTexture(Type) { Texture = Type; }\n setInput(Type) { Input = Type; }\n ${o(t.getUniformLocation.toString())}\n ${o(t.build.toString())}\n translateSource() {}\n pickRenderStrategy() {}\n\t\t ${o(t.run.toString())}\n\t\t ${o(t.addArgument.toString())}\n\t\t ${o(t.formatArrayTransfer.toString())}\n\t\t ${o(t.checkOutput.toString())}\n\t\t ${o(t.getArgumentTexture.toString())}\n\t\t ${o(t.getTextureCache.toString())}\n\t\t ${o(t.getOutputTexture.toString())}\n\t\t renderOutput() { ${n.getFunctionBodyFromString(o(t.renderOutput.toString()))} }\n\t\t ${o(t.readPackedPixelsToFloat32Array.toString())}\n\t\t ${o(t.readPackedPixelsToUint8Array.toString())}\n\t\t ${o(t.readFloatPixelsToFloat32Array.toString())}\n\t\t ${o(t.updateMaxTexSize.toString())}\n\t\t ${o(t._setupOutputTexture.toString())}\n\t\t ${o(t.detachTextureCache.toString())}\n\t\t ${o(t.setUniform1f.toString())}\n\t\t ${o(t.setUniform1i.toString())}\n\t\t ${o(t.setUniform2f.toString())}\n\t\t ${o(t.setUniform2fv.toString())}\n\t\t ${o(t.setUniform2iv.toString())}\n\t\t ${o(t.setUniform3fv.toString())}\n\t\t ${o(t.setUniform3iv.toString())}\n\t\t getReturnTextureType() { return "${t.getReturnTextureType()}"; }\n };\n return kernelRunShortcut(new ${e||"Kernel"}());\n };`}}},{"../../kernel-run-shortcut":62,"../../utils":65}],53:[function(t,e,r){const{GLKernel:n}=t("../gl-kernel"),{FunctionBuilder:i}=t("../function-builder"),{WebGLFunctionNode:o}=t("./function-node"),{utils:a}=t("../../utils"),{Texture:s}=t("../../texture"),u=t("../../plugins/triangle-noise"),{fragmentShader:l}=t("./fragment-shader"),{vertexShader:c}=t("./vertex-shader"),{webGLKernelString:h}=t("./kernel-string");let p=null,f=null,d=null,m=null,g=null;const v=[u],_=[],y={};e.exports={WebGLKernel:class extends n{static get isSupported(){return null!==p?p:(this.setupFeatureChecks(),p=this.isContextMatch(d))}static setupFeatureChecks(){"undefined"!=typeof document?f=document.createElement("canvas"):"undefined"!=typeof OffscreenCanvas&&(f=new OffscreenCanvas(0,0)),f&&(d=f.getContext("webgl")||f.getContext("experimental-webgl"))&&d.getExtension&&(m={OES_texture_float:d.getExtension("OES_texture_float"),OES_texture_float_linear:d.getExtension("OES_texture_float_linear"),OES_element_index_uint:d.getExtension("OES_element_index_uint"),WEBGL_draw_buffers:d.getExtension("WEBGL_draw_buffers")},g=this.getFeatures())}static isContextMatch(t){return"undefined"!=typeof WebGLRenderingContext&&t instanceof WebGLRenderingContext}static getFeatures(){const t=this.getIsDrawBuffers();return Object.freeze({isFloatRead:this.getIsFloatRead(),isIntegerDivisionAccurate:this.getIsIntegerDivisionAccurate(),isTextureFloat:this.getIsTextureFloat(),isDrawBuffers:t,kernelMap:t,channelCount:this.getChannelCount()})}static getIsTextureFloat(){return Boolean(m.OES_texture_float)}static getIsDrawBuffers(){return Boolean(m.WEBGL_draw_buffers)}static getChannelCount(){return m.WEBGL_draw_buffers?m.WEBGL_draw_buffers.MAX_DRAW_BUFFERS_WEBGL:1}static get testCanvas(){return f}static get testContext(){return d}static get features(){return g}static get fragmentShader(){return l}static get vertexShader(){return c}constructor(t,e){super(t,e),this.textureCache={},this.threadDim={},this.programUniformLocationCache={},this.framebuffer=null,this.buffer=null,this.program=null,this.pipeline=e.pipeline,this.endianness=a.systemEndianness(),this.extensions={},this.subKernelOutputTextures=null,this.argumentsLength=0,this.constantsLength=0,this.compiledFragmentShader=null,this.compiledVertexShader=null,this.fragShader=null,this.vertShader=null,this.drawBuffersMap=null,this.outputTexture=null,this.maxTexSize=null,this.uniform1fCache={},this.uniform1iCache={},this.uniform2fCache={},this.uniform2fvCache={},this.uniform2ivCache={},this.uniform3fvCache={},this.uniform3ivCache={},this.mergeSettings(t.settings||e)}initCanvas(){if("undefined"!=typeof document){const t=document.createElement("canvas");return t.width=2,t.height=2,t}if("undefined"!=typeof OffscreenCanvas)return new OffscreenCanvas(0,0)}initContext(){const t={alpha:!1,depth:!1,antialias:!1};return this.canvas.getContext("webgl",t)||this.canvas.getContext("experimental-webgl",t)}initPlugins(t){const e=[],{source:r}=this;if("string"==typeof r)for(let t=0;tt===n.name)&&e.push(n)}return e}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(){if(!this.validate)return void(this.texSize=a.dimToTexSize({floatTextures:this.optimizeFloatMemory,floatOutput:"single"===this.precision},this.output,!0));const{features:t}=this.constructor;if(!0===this.optimizeFloatMemory&&!t.isTextureFloat)throw new Error("Float textures are not supported");if("single"===this.precision&&!0!==this.floatOutputForce&&!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!==arguments.length)throw new Error("Auto output only supported for kernels with only one input");const t=a.getVariableType(arguments[0]);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=arguments[0].output}}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.dimToTexSize({floatTextures:this.floatTextures,floatOutput:"single"===this.precision},this.output,!0)}updateMaxTexSize(){const{texSize:t,canvas:e}=this;if(null===this.maxTexSize){let r=_.indexOf(e);-1===r&&(r=_.length,_.push(e),y[r]=[t[0],t[1]]),this.maxTexSize=y[r]}this.maxTexSize[0]g.channelCount)throw new Error("Too many channels!");return this.translatedSource=e}build(){this.initExtensions(),this.validateSettings(),this.setupConstants(),this.setupArguments(arguments),this.updateMaxTexSize(),this.translateSource(),this.pickRenderStrategy();const t=this.texSize,e=this.context,r=this.canvas;e.enable(e.SCISSOR_TEST),this.pipeline&&this.precision,e.viewport(0,0,this.maxTexSize[0],this.maxTexSize[1]),r.width=this.maxTexSize[0],r.height=this.maxTexSize[1];const n=this.threadDim=Array.from(this.output);for(;n.length<3;)n.push(1);const i=this.getVertexShader(arguments),o=e.createShader(e.VERTEX_SHADER);e.shaderSource(o,i),e.compileShader(o),this.vertShader=o;const s=this.getFragmentShader(arguments),u=e.createShader(e.FRAGMENT_SHADER);if(e.shaderSource(u,s),e.compileShader(u),this.fragShader=u,this.debug&&(console.log("GLSL Shader Output:"),console.log(s)),!e.getShaderParameter(o,e.COMPILE_STATUS))throw new Error("Error compiling vertex shader: "+e.getShaderInfoLog(o));if(!e.getShaderParameter(u,e.COMPILE_STATUS))throw new Error("Error compiling fragment shader: "+e.getShaderInfoLog(u));const l=this.program=e.createProgram();e.attachShader(l,o),e.attachShader(l,u),e.linkProgram(l),this.framebuffer=e.createFramebuffer(),this.framebuffer.width=t[0],this.framebuffer.height=t[1];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?e.bindBuffer(e.ARRAY_BUFFER,f):(f=this.buffer=e.createBuffer(),e.bindBuffer(e.ARRAY_BUFFER,f),e.bufferData(e.ARRAY_BUFFER,c.byteLength+h.byteLength,e.STATIC_DRAW)),e.bufferSubData(e.ARRAY_BUFFER,0,c),e.bufferSubData(e.ARRAY_BUFFER,p,h);const d=e.getAttribLocation(this.program,"aPos");e.enableVertexAttribArray(d),e.vertexAttribPointer(d,2,e.FLOAT,!1,0,0);const m=e.getAttribLocation(this.program,"aTexCoord");e.enableVertexAttribArray(m),e.vertexAttribPointer(m,2,e.FLOAT,!1,0,p),e.bindFramebuffer(e.FRAMEBUFFER,this.framebuffer);for(let t in this.constants){const r=this.constants[t],n=a.getVariableType(r);"Float"!==n&&"Integer"!==n&&(e.useProgram(this.program),this.addConstant(this.constants[t],n,t))}this.immutable||(this._setupOutputTexture(),null!==this.subKernels&&this.subKernels.length>0&&this._setupSubOutputTextures(this.subKernels.length))}translateSource(){const t=i.fromKernel(this,o,{fixIntegerDivisionAccuracy:this.fixIntegerDivisionAccuracy});this.translatedSource=t.getPrototypeString("kernel"),this.graphical||this.returnType||(this.returnType=t.getKernelResultType())}run(){null===this.program&&this.build.apply(this,arguments);const t=this.argumentNames,e=this.argumentTypes,r=this.texSize,n=this.context;n.useProgram(this.program),n.scissor(0,0,r[0],r[1]),this.hardcodeConstants||(this.setUniform3iv("uOutputDim",this.threadDim),this.setUniform2iv("uTexSize",r)),this.setUniform2f("ratio",r[0]/this.maxTexSize[0],r[1]/this.maxTexSize[1]),this.argumentsLength=0;for(let r=0;rt.source&&this.source.match(t.functionMatch)?t.source:"").join("\n"):"\n"}_getConstantsString(){const t=[],{threadDim:e,texSize:r}=this;return this.hardcodeConstants?t.push(`ivec3 uOutputDim = ivec3(${e[0]}, ${e[1]}, ${e[2]})`,`ivec2 uTexSize = ivec2(${r[0]}, ${r[1]})`):t.push("uniform ivec3 uOutputDim","uniform ivec2 uTexSize"),a.linesToString(t)}_getTextureCoordinate(){const t=this.subKernels;return null===t||t.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 div_with_int_check(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}":""}_getMainArgumentsString(t){const e=[],{argumentTypes:r,argumentNames:n,hardcodeConstants:i,optimizeFloatMemory:o,precision:s}=this;for(let u=0;u{if(e.hasOwnProperty(r))return e[r];throw`unhandled artifact ${r}`})}getFragmentShader(t){return null!==this.compiledFragmentShader?this.compiledFragmentShader:this.compiledFragmentShader=this.replaceArtifacts(this.constructor.fragmentShader,this._getFragShaderArtifactMap(t))}getVertexShader(t){return null!==this.compiledVertexShader?this.compiledVertexShader:this.compiledVertexShader=this.constructor.vertexShader}toString(){return h(this)}destroy(t){this.outputTexture&&this.context.deleteTexture(this.outputTexture),this.buffer&&this.context.deleteBuffer(this.buffer),this.framebuffer&&this.context.deleteFramebuffer(this.framebuffer),this.vertShader&&this.context.deleteShader(this.vertShader),this.fragShader&&this.context.deleteShader(this.fragShader),this.program&&this.context.deleteProgram(this.program);const e=Object.keys(this.textureCache);for(let t=0;t=0&&(_[t]=null,y[t]=null)}this.destroyExtensions(),delete this.context,delete this.canvas}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(t){const e=t.getExtension("WEBGL_lose_context");e&&e.loseContext()}toJSON(){const t=super.toJSON();return t.functionNodes=i.fromKernel(this,o).toJSON(),t}}}},{"../../plugins/triangle-noise":63,"../../texture":64,"../../utils":65,"../function-builder":45,"../gl-kernel":47,"./fragment-shader":50,"./function-node":51,"./kernel-string":52,"./vertex-shader":54}],54:[function(t,e,r){e.exports={vertexShader:"precision highp float;\nprecision highp int;\nprecision highp sampler2D;\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}"}},{}],55:[function(t,e,r){e.exports={fragmentShader:"#version 300 es\n__HEADER__;\nprecision highp float;\nprecision highp int;\nprecision highp sampler2D;\n\nconst int LOOP_MAX = __LOOP_MAX__;\n\n__PLUGINS__;\n__CONSTANTS__;\n\nin vec2 vTexCoord;\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\tint channel = integerMod(index, 4);\n return texel[channel] * 255.0;\n}\n\nvec4 encode32(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// 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 ivec3 xyz = ivec3(x, y, z);\n int index = xyz.x + texDim.x * (xyz.y + texDim.y * xyz.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 ivec3 xyz = ivec3(x, y, z);\n int index = xyz.x + (texDim.x * (xyz.y + (texDim.y * xyz.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 ivec3 xyz = ivec3(x, y, z);\n int index = xyz.x + (texDim.x * (xyz.y + (texDim.y * xyz.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 ivec3 xyz = ivec3(x, y, z);\n int index = xyz.x + (texDim.x * (xyz.y + (texDim.y * xyz.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 ivec3 xyz = ivec3(x, y, z);\n int index = xyz.x + texDim.x * (xyz.y + texDim.y * xyz.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 ivec3 xyz = ivec3(x, y, z);\n int index = xyz.x + texDim.x * (xyz.y + texDim.y * xyz.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\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\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 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\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}"}},{}],56:[function(t,e,r){const{WebGLFunctionNode:n}=t("../web-gl/function-node");e.exports={WebGL2FunctionNode:class extends n{astIdentifierExpression(t,e){if("Identifier"!==t.type)throw this.astErrorOutput("IdentifierExpression - not an Identifier",t);switch(t.name){case"Infinity":e.push("intBitsToFloat(2139095039)");break;default:const r=this.getKernelArgumentName(t.name);r?e.push(`user_${r}`):e.push(`user_${t.name}`)}return e}}}},{"../web-gl/function-node":51}],57:[function(t,e,r){const{WebGLKernel:n}=t("../web-gl/kernel"),{WebGL2FunctionNode:i}=t("./function-node"),{FunctionBuilder:o}=t("../function-builder"),{utils:a}=t("../../utils"),{Texture:s}=t("../../texture"),{fragmentShader:u}=t("./fragment-shader"),{vertexShader:l}=t("./vertex-shader");let c=null,h=null,p=null,f=null,d=null;e.exports={WebGL2Kernel:class extends n{static get isSupported(){return null!==c?c:(this.setupFeatureChecks(),c=this.isContextMatch(p))}static setupFeatureChecks(){"undefined"!=typeof document?h=document.createElement("canvas"):"undefined"!=typeof OffscreenCanvas&&(h=new OffscreenCanvas(0,0)),h&&(p=h.getContext("webgl2"))&&p.getExtension&&(f={EXT_color_buffer_float:p.getExtension("EXT_color_buffer_float"),OES_texture_float_linear:p.getExtension("OES_texture_float_linear")},d=this.getFeatures())}static isContextMatch(t){return"undefined"!=typeof WebGL2RenderingContext&&t instanceof WebGL2RenderingContext}static getFeatures(){return Object.freeze({isFloatRead:this.getIsFloatRead(),isIntegerDivisionAccurate:this.getIsIntegerDivisionAccurate(),kernelMap:!0,isTextureFloat:!0})}static getIsTextureFloat(){return!0}static getIsIntegerDivisionAccurate(){return super.getIsIntegerDivisionAccurate()}static get testCanvas(){return h}static get testContext(){return p}static get features(){return d}static get fragmentShader(){return u}static get vertexShader(){return l}initContext(){return this.canvas.getContext("webgl2",{alpha:!1,depth:!1,antialias:!1})}initExtensions(){this.extensions={EXT_color_buffer_float:this.context.getExtension("EXT_color_buffer_float"),OES_texture_float_linear:this.context.getExtension("OES_texture_float_linear")}}validateSettings(){if(!this.validate)return void(this.texSize=a.dimToTexSize({floatTextures:this.optimizeFloatMemory,floatOutput:"single"===this.precision},this.output,!0));const t=this.constructor.features;if("single"===this.precision&&!0!==this.floatOutputForce&&!t.isFloatRead)throw new Error("Float texture outputs are not supported");if(this.graphical||null!==this.precision||(this.precision=t.isFloatRead?"single":"unsigned"),null===this.fixIntegerDivisionAccuracy?this.fixIntegerDivisionAccuracy=!t.isIntegerDivisionAccurate:this.fixIntegerDivisionAccuracy&&t.isIntegerDivisionAccurate&&(this.fixIntegerDivisionAccuracy=!1),this.checkOutput(),!this.output||0===this.output.length){if(1!==arguments.length)throw new Error("Auto output only supported for kernels with only one input");const t=a.getVariableType(arguments[0]);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=arguments[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"single"===this.precision&&(console.warn("Cannot use graphical mode and single precision at the same time"),this.precision="unsigned"),void(this.texSize=a.clone(this.output))}!this.graphical&&null===this.precision&&t.isTextureFloat&&(this.precision="single"),this.texSize=a.dimToTexSize({floatTextures:!this.optimizeFloatMemory,floatOutput:"single"===this.precision},this.output,!0),("single"===this.precision||this.floatOutputForce)&&this.context.getExtension("EXT_color_buffer_float")}translateSource(){const t=o.fromKernel(this,i,{fixIntegerDivisionAccuracy:this.fixIntegerDivisionAccuracy});this.translatedSource=t.getPrototypeString("kernel"),this.graphical||this.returnType||(this.returnType=t.getKernelResultType())}run(){null===this.program&&this.build.apply(this,arguments);const{argumentNames:t,argumentTypes:e,texSize:r}=this,n=this.context;n.useProgram(this.program),n.scissor(0,0,r[0],r[1]),this.hardcodeConstants||(this.setUniform3iv("uOutputDim",new Int32Array(this.threadDim)),this.setUniform2iv("uTexSize",r)),this.setUniform2f("ratio",r[0]/this.maxTexSize[0],r[1]/this.maxTexSize[1]),this.argumentsLength=0;for(let r=0;rt.isSupported)}static get isKernelMapSupported(){return c.some(t=>t.isSupported&&t.features.kernelMap)}static get isOffscreenCanvasSupported(){return"undefined"!=typeof Worker&&"undefined"!=typeof OffscreenCanvas||"undefined"!=typeof importScripts}static get isWebGLSupported(){return u.isSupported}static get isWebGL2Supported(){return s.isSupported}static get isHeadlessGLSupported(){return a.isSupported}static get isCanvasSupported(){return"undefined"!=typeof HTMLCanvasElement}static get isGPUHTMLImageArraySupported(){return s.isSupported}static get isSinglePrecisionSupported(){return c.some(t=>t.isSupported&&t.features.isFloatRead&&t.features.isTextureFloat)}constructor(t){if(t=t||{},this.canvas=t.canvas||null,this.context=t.context||null,this.mode=t.mode,"dev"!==this.mode){if(this.Kernel=null,this.kernels=[],this.functions=[],this.nativeFunctions=[],this.chooseKernel(),t.functions)for(let e=0;e{const n=new o(t,r);return n.apply(n,e)}},d(e)||{}),a=l(new this.Kernel(t,r));return this.canvas||(this.canvas=a.canvas),this.context||(this.context=a.context),this.kernels.push(a),a}createKernelMap(){let t,e;if("function"==typeof arguments[arguments.length-2]?(t=arguments[arguments.length-2],e=arguments[arguments.length-1]):t=arguments[arguments.length-1],(!this.Kernel.isSupported||!this.Kernel.features.kernelMap)&&this.mode&&h.indexOf(this.mode)<0)throw new Error(`kernelMap not supported on ${this.Kernel.name}`);const r=this.createKernel(t,d(e));if(Array.isArray(arguments[0])){const t=arguments[0];for(let e=0;e0)throw new Error('Cannot call "addNativeFunction" after "createKernels" has been called.');r=r||{};const{argumentTypes:n,argumentNames:i}=this.Kernel.nativeFunctionArguments(e)||{};return this.nativeFunctions.push({name:t,source:e,settings:r,argumentTypes:n,argumentNames:i,returnType:r.returnType||this.Kernel.nativeFunctionReturnType(e)}),this}destroy(){setTimeout(()=>{for(let t=0;t{if("_"!==r[0]||"_"!==r[1])if("function"==typeof t[r])if("add"===r.substring(0,3)||"set"===r.substring(0,3))e[r]=function(){return t[r].apply(t,arguments),e};else if("requestFallback"===r){const n=t[r].bind(t);e[r]=(()=>{t=n()})}else e[r]=t[r].bind(t);else e.__defineGetter__(r,()=>t[r]),e.__defineSetter__(r,e=>{t[r]=e})}),e.kernel=t,e}}},{"./utils":65}],63:[function(t,e,r){e.exports={name:"triangle-noise-noise",onBeforeRun:t=>{t.setUniform1f("triangle_noise_seed",Math.random())},functionMatch:"Math.random()",functionReplace:"n4rand(vTexCoord)",functionReturnType:"Number",source:"\n\nuniform highp float triangle_noise_seed;\nhighp float triangle_noise_shift = 0.000001;\n\n//https://www.shadertoy.com/view/4t2SDh\n//note: uniformly distributed, normalized rand, [0;1[\nfloat nrand( vec2 n )\n{\n\treturn fract(sin(dot(n.xy, vec2(12.9898, 78.233)))* 43758.5453);\n}\n//note: remaps v to [0;1] in interval [a;b]\nfloat remap( float a, float b, float v )\n{\n\treturn clamp( (v-a) / (b-a), 0.0, 1.0 );\n}\n\nfloat n4rand( vec2 n )\n{\n\tfloat t = fract( triangle_noise_seed + triangle_noise_shift );\n\tfloat nrnd0 = nrand( n + 0.07*t );\n\tfloat nrnd1 = nrand( n + 0.11*t );\t\n\tfloat nrnd2 = nrand( n + 0.13*t );\n\tfloat nrnd3 = nrand( n + 0.17*t );\n\tfloat result = (nrnd0+nrnd1+nrnd2+nrnd3) / 4.0;\n\ttriangle_noise_shift = result + 0.000001;\n\treturn result;\n}"}},{}],64:[function(t,e,r){e.exports={Texture:class{constructor(t){const{texture:e,size:r,dimensions:n,output:i,context:o,gpu:a,type:s="NumberTexture"}=t;if(!i)throw new Error('settings property "output" required.');if(!o)throw new Error('settings property "context" required.');this.texture=e,this.size=r,this.dimensions=n,this.output=i,this.context=o,this.gpu=a,this.kernel=null,this.type=s}toArray(t){let{kernel:e}=this;if(e)return e(this);if(!(t=t||this.gpu))throw new Error('settings property "gpu" or argument required.');return e=t.createKernel(function(t){return t[this.thread.z][this.thread.y][this.thread.x]},{output:this.output,precision:this.getPrecision(),optimizeFloatMemory:"MemoryOptimizedNumberTexture"===this.type}),this.kernel=e,e(this)}getPrecision(){switch(this.type){case"NumberTexture":return"unsigned";case"MemoryOptimizedNumberTexture":case"ArrayTexture(1)":case"ArrayTexture(2)":case"ArrayTexture(3)":case"ArrayTexture(4)":return"single";default:throw new Error("Unknown texture type")}}delete(){return this.context.deleteTexture(this.texture)}}}},{}],65:[function(t,e,r){const{Input:n}=t("./input"),{Texture:i}=t("./texture"),o=/function ([^(]*)/,a=/((\/\/.*$)|(\/\*[\s\S]*?\*\/))/gm,s=/([^\s,]+)/g,u={systemEndianness:()=>l,getSystemEndianness(){const t=new ArrayBuffer(4),e=new Uint32Array(t),r=new Uint8Array(t);if(e[0]=3735928559,239===r[0])return"LE";if(222===r[0])return"BE";throw new Error("unknown endianness")},isFunction:t=>"function"==typeof t,isFunctionString:t=>"string"==typeof t&&"function"===t.slice(0,"function".length).toLowerCase(),getFunctionNameFromString:t=>o.exec(t)[1].trim(),getFunctionBodyFromString:t=>t.substring(t.indexOf("{")+1,t.lastIndexOf("}")),getArgumentNamesFromString(t){const e=t.replace(a,"");let r=e.slice(e.indexOf("(")+1,e.indexOf(")")).match(s);return null===r&&(r=[]),r},clone(t){if(null===t||"object"!=typeof t||t.hasOwnProperty("isActiveClone"))return t;const e=t.constructor();for(let r in t)Object.prototype.hasOwnProperty.call(t,r)&&(t.isActiveClone=null,e[r]=u.clone(t[r]),delete t.isActiveClone);return e},isArray:t=>!isNaN(t.length),getVariableType:t=>u.isArray(t)?"IMG"===t[0].nodeName?"HTMLImageArray":"Array":"number"==typeof t?Number.isInteger(t)?"Integer":"Float":t instanceof i?t.type:t instanceof n?"Input":"IMG"===t.nodeName?"HTMLImage":"Unknown",dimToTexSize(t,e,r){let[n,i,o]=e,a=(n||1)*(i||1)*(o||1);return!t.floatTextures||r&&"single"!==t.precision||(n=a=Math.ceil(a/4)),i>1&&n*i===a?new Int32Array([n,i]):u.closestSquareDimensions(a)},closestSquareDimensions(t){const e=Math.sqrt(t);let r=Math.ceil(e),n=Math.floor(e);for(;r*nMath.floor((t+e-1)/e)*e,getDimensions(t,e){let r;if(u.isArray(t)){const e=[];let n=t;for(;u.isArray(n);)e.push(n.length),n=n[0];r=e.reverse()}else if(t instanceof i)r=t.output;else{if(!(t instanceof n))throw new Error(`Unknown dimensions of ${t}`);r=t.size}if(e)for(r=Array.from(r);r.length<3;)r.push(1);return new Int32Array(r)},flatten2dArrayTo(t,e){let r=0;for(let n=0;nt.length>0?t.join(";\n")+";\n":"\n",warnDeprecated(t,e,r){r?console.warn(`You are using a deprecated ${t} "${e}". It has been replaced with "${r}". Fixing, but please upgrade as it will soon be removed.`):console.warn(`You are using a deprecated ${t} "${e}". It has been removed. Fixing, but please upgrade as it will soon be removed.`)},functionToIFunction(t,e){if(e=e||{},"string"!=typeof t&&"function"!=typeof t)throw new Error("source not a string or function");const r="string"==typeof t?t:t.toString();let n=[];return{source:r,argumentTypes:n=Array.isArray(e.argumentTypes)?e.argumentTypes:"object"==typeof e.argumentTypes?u.getArgumentNamesFromString(r).map(t=>e.argumentTypes[t])||[]:e.argumentTypes||[],returnType:e.returnType||null}}},l=u.getSystemEndianness();e.exports={utils:u}},{"./input":61,"./texture":64}],66:[function(t,e,r){(function(r){"use strict";function n(t,e){if(t===e)return 0;for(var r=t.length,n=e.length,i=0,o=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],!_(t[u],e[u],r,n))return!1;return!0}(t,e,r,a))}return r?t===e:t==e}function y(t){return"[object Arguments]"==Object.prototype.toString.call(t)}function b(t,e){if(!t||!e)return!1;if("[object RegExp]"==Object.prototype.toString.call(e))return e.test(t);try{if(t instanceof e)return!0}catch(t){}return!Error.isPrototypeOf(e)&&!0===e.call({},t)}function x(t,e,r,n){var i;if("function"!=typeof e)throw new TypeError('"block" argument must be a function');"string"==typeof r&&(n=r,r=null),i=function(t){var e;try{t()}catch(t){e=t}return e}(e),n=(r&&r.name?" ("+r.name+").":".")+(n?" "+n:"."),t&&!i&&g(i,r,"Missing expected exception"+n);var a="string"==typeof n,s=!t&&o.isError(i),u=!t&&i&&!r;if((s&&a&&b(i,r)||u)&&g(i,r,"Got unwanted exception"+n),t&&i&&r&&!b(i,r)||!t&&i)throw i}h.AssertionError=function(t){var e;this.name="AssertionError",this.actual=t.actual,this.expected=t.expected,this.operator=t.operator,t.message?(this.message=t.message,this.generatedMessage=!1):(this.message=d(m((e=this).actual),128)+" "+e.operator+" "+d(m(e.expected),128),this.generatedMessage=!0);var r=t.stackStartFunction||g;if(Error.captureStackTrace)Error.captureStackTrace(this,r);else{var n=new Error;if(n.stack){var i=n.stack,o=f(r),a=i.indexOf("\n"+o);if(a>=0){var s=i.indexOf("\n",a+1);i=i.substring(s+1)}this.stack=i}}},o.inherits(h.AssertionError,Error),h.fail=g,h.ok=v,h.equal=function(t,e,r){t!=e&&g(t,e,r,"==",h.equal)},h.notEqual=function(t,e,r){t==e&&g(t,e,r,"!=",h.notEqual)},h.deepEqual=function(t,e,r){_(t,e,!1)||g(t,e,r,"deepEqual",h.deepEqual)},h.deepStrictEqual=function(t,e,r){_(t,e,!0)||g(t,e,r,"deepStrictEqual",h.deepStrictEqual)},h.notDeepEqual=function(t,e,r){_(t,e,!1)&&g(t,e,r,"notDeepEqual",h.notDeepEqual)},h.notDeepStrictEqual=function t(e,r,n){_(e,r,!0)&&g(e,r,n,"notDeepStrictEqual",t)},h.strictEqual=function(t,e,r){t!==e&&g(t,e,r,"===",h.strictEqual)},h.notStrictEqual=function(t,e,r){t===e&&g(t,e,r,"!==",h.notStrictEqual)},h.throws=function(t,e,r){x(!0,t,e,r)},h.doesNotThrow=function(t,e,r){x(!1,t,e,r)},h.ifError=function(t){if(t)throw t};var w=Object.keys||function(t){var e=[];for(var r in t)a.call(t,r)&&e.push(r);return e}}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"util/":69}],67:[function(t,e,r){"function"==typeof Object.create?e.exports=function(t,e){t.super_=e,t.prototype=Object.create(e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}})}:e.exports=function(t,e){t.super_=e;var r=function(){};r.prototype=e.prototype,t.prototype=new r,t.prototype.constructor=t}},{}],68:[function(t,e,r){e.exports=function(t){return t&&"object"==typeof t&&"function"==typeof t.copy&&"function"==typeof t.fill&&"function"==typeof t.readUInt8}},{}],69:[function(t,e,r){(function(e,n){var i=/%[sdj%]/g;r.format=function(t){if(!v(t)){for(var e=[],r=0;r=o)return t;switch(t){case"%s":return String(n[r++]);case"%d":return Number(n[r++]);case"%j":try{return JSON.stringify(n[r++])}catch(t){return"[Circular]"}default:return t}}),u=n[r];r=3&&(n.depth=arguments[2]),arguments.length>=4&&(n.colors=arguments[3]),d(e)?n.showHidden=e:e&&r._extend(n,e),_(n.showHidden)&&(n.showHidden=!1),_(n.depth)&&(n.depth=2),_(n.colors)&&(n.colors=!1),_(n.customInspect)&&(n.customInspect=!0),n.colors&&(n.stylize=u),c(n,t,n.depth)}function u(t,e){var r=s.styles[e];return r?"["+s.colors[r][0]+"m"+t+"["+s.colors[r][1]+"m":t}function l(t,e){return t}function c(t,e,n){if(t.customInspect&&e&&E(e.inspect)&&e.inspect!==r.inspect&&(!e.constructor||e.constructor.prototype!==e)){var i=e.inspect(n,t);return v(i)||(i=c(t,i,n)),i}var o=function(t,e){if(_(e))return t.stylize("undefined","undefined");if(v(e)){var r="'"+JSON.stringify(e).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return t.stylize(r,"string")}if(g(e))return t.stylize(""+e,"number");if(d(e))return t.stylize(""+e,"boolean");if(m(e))return t.stylize("null","null")}(t,e);if(o)return o;var a=Object.keys(e),s=function(t){var e={};return t.forEach(function(t,r){e[t]=!0}),e}(a);if(t.showHidden&&(a=Object.getOwnPropertyNames(e)),w(e)&&(a.indexOf("message")>=0||a.indexOf("description")>=0))return h(e);if(0===a.length){if(E(e)){var u=e.name?": "+e.name:"";return t.stylize("[Function"+u+"]","special")}if(y(e))return t.stylize(RegExp.prototype.toString.call(e),"regexp");if(x(e))return t.stylize(Date.prototype.toString.call(e),"date");if(w(e))return h(e)}var l,b="",k=!1,T=["{","}"];(f(e)&&(k=!0,T=["[","]"]),E(e))&&(b=" [Function"+(e.name?": "+e.name:"")+"]");return y(e)&&(b=" "+RegExp.prototype.toString.call(e)),x(e)&&(b=" "+Date.prototype.toUTCString.call(e)),w(e)&&(b=" "+h(e)),0!==a.length||k&&0!=e.length?n<0?y(e)?t.stylize(RegExp.prototype.toString.call(e),"regexp"):t.stylize("[Object]","special"):(t.seen.push(e),l=k?function(t,e,r,n,i){for(var o=[],a=0,s=e.length;a=0&&0,t+e.replace(/\u001b\[\d\d?m/g,"").length+1},0)>60)return r[0]+(""===e?"":e+"\n ")+" "+t.join(",\n ")+" "+r[1];return r[0]+e+" "+t.join(", ")+" "+r[1]}(l,b,T)):T[0]+b+T[1]}function h(t){return"["+Error.prototype.toString.call(t)+"]"}function p(t,e,r,n,i,o){var a,s,u;if((u=Object.getOwnPropertyDescriptor(e,i)||{value:e[i]}).get?s=u.set?t.stylize("[Getter/Setter]","special"):t.stylize("[Getter]","special"):u.set&&(s=t.stylize("[Setter]","special")),A(n,i)||(a="["+i+"]"),s||(t.seen.indexOf(u.value)<0?(s=m(r)?c(t,u.value,null):c(t,u.value,r-1)).indexOf("\n")>-1&&(s=o?s.split("\n").map(function(t){return" "+t}).join("\n").substr(2):"\n"+s.split("\n").map(function(t){return" "+t}).join("\n")):s=t.stylize("[Circular]","special")),_(a)){if(o&&i.match(/^\d+$/))return s;(a=JSON.stringify(""+i)).match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(a=a.substr(1,a.length-2),a=t.stylize(a,"name")):(a=a.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),a=t.stylize(a,"string"))}return a+": "+s}function f(t){return Array.isArray(t)}function d(t){return"boolean"==typeof t}function m(t){return null===t}function g(t){return"number"==typeof t}function v(t){return"string"==typeof t}function _(t){return void 0===t}function y(t){return b(t)&&"[object RegExp]"===k(t)}function b(t){return"object"==typeof t&&null!==t}function x(t){return b(t)&&"[object Date]"===k(t)}function w(t){return b(t)&&("[object Error]"===k(t)||t instanceof Error)}function E(t){return"function"==typeof t}function k(t){return Object.prototype.toString.call(t)}function T(t){return t<10?"0"+t.toString(10):t.toString(10)}r.debuglog=function(t){if(_(o)&&(o=e.env.NODE_DEBUG||""),t=t.toUpperCase(),!a[t])if(new RegExp("\\b"+t+"\\b","i").test(o)){var n=e.pid;a[t]=function(){var e=r.format.apply(r,arguments);console.error("%s %d: %s",t,n,e)}}else a[t]=function(){};return a[t]},r.inspect=s,s.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]},s.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(t){return null==t},r.isNumber=g,r.isString=v,r.isSymbol=function(t){return"symbol"==typeof t},r.isUndefined=_,r.isRegExp=y,r.isObject=b,r.isDate=x,r.isError=w,r.isFunction=E,r.isPrimitive=function(t){return null===t||"boolean"==typeof t||"number"==typeof t||"string"==typeof t||"symbol"==typeof t||void 0===t},r.isBuffer=t("./support/isBuffer");var S=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function A(t,e){return Object.prototype.hasOwnProperty.call(t,e)}r.log=function(){var t,e;console.log("%s - %s",(t=new Date,e=[T(t.getHours()),T(t.getMinutes()),T(t.getSeconds())].join(":"),[t.getDate(),S[t.getMonth()],e].join(" ")),r.format.apply(r,arguments))},r.inherits=t("inherits"),r._extend=function(t,e){if(!e||!b(e))return t;for(var r=Object.keys(e),n=r.length;n--;)t[r[n]]=e[r[n]];return t}}).call(this,t("_process"),"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"./support/isBuffer":68,_process:139,inherits:67}],70:[function(t,e,r){(function(e,n){"use strict";var i=t("assert"),o=t("pako/lib/zlib/zstream"),a=t("pako/lib/zlib/deflate.js"),s=t("pako/lib/zlib/inflate.js"),u=t("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(t){if("number"!=typeof t||tr.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=t,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?a.deflateEnd(this.strm):this.mode!==r.INFLATE&&this.mode!==r.GUNZIP&&this.mode!==r.INFLATERAW&&this.mode!==r.UNZIP||s.inflateEnd(this.strm),this.mode=r.NONE,this.dictionary=null)},c.prototype.write=function(t,e,r,n,i,o,a){return this._write(!0,t,e,r,n,i,o,a)},c.prototype.writeSync=function(t,e,r,n,i,o,a){return this._write(!1,t,e,r,n,i,o,a)},c.prototype._write=function(t,o,a,s,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===o,"must provide flush value"),this.write_in_progress=!0,o!==r.Z_NO_FLUSH&&o!==r.Z_PARTIAL_FLUSH&&o!==r.Z_SYNC_FLUSH&&o!==r.Z_FULL_FLUSH&&o!==r.Z_FINISH&&o!==r.Z_BLOCK)throw new Error("Invalid flush value");if(null==a&&(a=n.alloc(0),u=0,s=0),this.strm.avail_in=u,this.strm.input=a,this.strm.next_in=s,this.strm.avail_out=h,this.strm.output=l,this.strm.next_out=c,this.flush=o,!t)return this._process(),this._checkError()?this._afterSync():void 0;var p=this;return e.nextTick(function(){p._process(),p._after()}),this},c.prototype._afterSync=function(){var t=this.strm.avail_out,e=this.strm.avail_in;return this.write_in_progress=!1,[e,t]},c.prototype._process=function(){var t=null;switch(this.mode){case r.DEFLATE:case r.GZIP:case r.DEFLATERAW:this.err=a.deflate(this.strm,this.flush);break;case r.UNZIP:switch(this.strm.avail_in>0&&(t=this.strm.next_in),this.gzip_id_bytes_read){case 0:if(null===t)break;if(31!==this.strm.input[t]){this.mode=r.INFLATE;break}if(this.gzip_id_bytes_read=1,t++,1===this.strm.avail_in)break;case 1:if(null===t)break;139===this.strm.input[t]?(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=s.inflate(this.strm,this.flush),this.err===r.Z_NEED_DICT&&this.dictionary&&(this.err=s.inflateSetDictionary(this.strm,this.dictionary),this.err===r.Z_OK?this.err=s.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=s.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 t=this.strm.avail_out,e=this.strm.avail_in;this.write_in_progress=!1,this.callback(e,t),this.pending_close&&this.close()}},c.prototype._error=function(t){this.strm.msg&&(t=this.strm.msg),this.onerror(t,this.err),this.write_in_progress=!1,this.pending_close&&this.close()},c.prototype.init=function(t,e,n,o,a){i(4===arguments.length||5===arguments.length,"init(windowBits, level, memLevel, strategy, [dictionary])"),i(t>=8&&t<=15,"invalid windowBits"),i(e>=-1&&e<=9,"invalid compression level"),i(n>=1&&n<=9,"invalid memlevel"),i(o===r.Z_FILTERED||o===r.Z_HUFFMAN_ONLY||o===r.Z_RLE||o===r.Z_FIXED||o===r.Z_DEFAULT_STRATEGY,"invalid strategy"),this._init(e,t,n,o,a),this._setDictionary()},c.prototype.params=function(){throw new Error("deflateParams Not supported")},c.prototype.reset=function(){this._reset(),this._setDictionary()},c.prototype._init=function(t,e,n,i,u){switch(this.level=t,this.windowBits=e,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 o,this.mode){case r.DEFLATE:case r.GZIP:case r.DEFLATERAW:this.err=a.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=s.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=a.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=a.deflateReset(this.strm);break;case r.INFLATE:case r.INFLATERAW:case r.GUNZIP:this.err=s.inflateReset(this.strm)}this.err!==r.Z_OK&&this._error("Failed to reset stream")},r.Zlib=c}).call(this,t("_process"),t("buffer").Buffer)},{_process:139,assert:66,buffer:73,"pako/lib/zlib/constants":77,"pako/lib/zlib/deflate.js":79,"pako/lib/zlib/inflate.js":81,"pako/lib/zlib/zstream":85}],71:[function(t,e,r){(function(e){"use strict";var n=t("buffer").Buffer,i=t("stream").Transform,o=t("./binding"),a=t("util"),s=t("assert").ok,u=t("buffer").kMaxLength,l="Cannot create final Buffer. It would be larger than 0x"+u.toString(16)+" bytes";o.Z_MIN_WINDOWBITS=8,o.Z_MAX_WINDOWBITS=15,o.Z_DEFAULT_WINDOWBITS=15,o.Z_MIN_CHUNK=64,o.Z_MAX_CHUNK=1/0,o.Z_DEFAULT_CHUNK=16384,o.Z_MIN_MEMLEVEL=1,o.Z_MAX_MEMLEVEL=9,o.Z_DEFAULT_MEMLEVEL=8,o.Z_MIN_LEVEL=-1,o.Z_MAX_LEVEL=9,o.Z_DEFAULT_LEVEL=o.Z_DEFAULT_COMPRESSION;for(var c=Object.keys(o),h=0;h=u?a=new RangeError(l):e=n.concat(i,o),i=[],t.close(),r(a,e)}t.on("error",function(e){t.removeListener("end",s),t.removeListener("readable",a),r(e)}),t.on("end",s),t.end(e),a()}function _(t,e){if("string"==typeof e&&(e=n.from(e)),!n.isBuffer(e))throw new TypeError("Not a string or buffer");var r=t._finishFlushFlag;return t._processChunk(e,r)}function y(t){if(!(this instanceof y))return new y(t);A.call(this,t,o.DEFLATE)}function b(t){if(!(this instanceof b))return new b(t);A.call(this,t,o.INFLATE)}function x(t){if(!(this instanceof x))return new x(t);A.call(this,t,o.GZIP)}function w(t){if(!(this instanceof w))return new w(t);A.call(this,t,o.GUNZIP)}function E(t){if(!(this instanceof E))return new E(t);A.call(this,t,o.DEFLATERAW)}function k(t){if(!(this instanceof k))return new k(t);A.call(this,t,o.INFLATERAW)}function T(t){if(!(this instanceof T))return new T(t);A.call(this,t,o.UNZIP)}function S(t){return t===o.Z_NO_FLUSH||t===o.Z_PARTIAL_FLUSH||t===o.Z_SYNC_FLUSH||t===o.Z_FULL_FLUSH||t===o.Z_FINISH||t===o.Z_BLOCK}function A(t,e){var a=this;if(this._opts=t=t||{},this._chunkSize=t.chunkSize||r.Z_DEFAULT_CHUNK,i.call(this,t),t.flush&&!S(t.flush))throw new Error("Invalid flush flag: "+t.flush);if(t.finishFlush&&!S(t.finishFlush))throw new Error("Invalid flush flag: "+t.finishFlush);if(this._flushFlag=t.flush||o.Z_NO_FLUSH,this._finishFlushFlag=void 0!==t.finishFlush?t.finishFlush:o.Z_FINISH,t.chunkSize&&(t.chunkSizer.Z_MAX_CHUNK))throw new Error("Invalid chunk size: "+t.chunkSize);if(t.windowBits&&(t.windowBitsr.Z_MAX_WINDOWBITS))throw new Error("Invalid windowBits: "+t.windowBits);if(t.level&&(t.levelr.Z_MAX_LEVEL))throw new Error("Invalid compression level: "+t.level);if(t.memLevel&&(t.memLevelr.Z_MAX_MEMLEVEL))throw new Error("Invalid memLevel: "+t.memLevel);if(t.strategy&&t.strategy!=r.Z_FILTERED&&t.strategy!=r.Z_HUFFMAN_ONLY&&t.strategy!=r.Z_RLE&&t.strategy!=r.Z_FIXED&&t.strategy!=r.Z_DEFAULT_STRATEGY)throw new Error("Invalid strategy: "+t.strategy);if(t.dictionary&&!n.isBuffer(t.dictionary))throw new Error("Invalid dictionary: it should be a Buffer instance");this._handle=new o.Zlib(e);var s=this;this._hadError=!1,this._handle.onerror=function(t,e){C(s),s._hadError=!0;var n=new Error(t);n.errno=e,n.code=r.codes[e],s.emit("error",n)};var u=r.Z_DEFAULT_COMPRESSION;"number"==typeof t.level&&(u=t.level);var l=r.Z_DEFAULT_STRATEGY;"number"==typeof t.strategy&&(l=t.strategy),this._handle.init(t.windowBits||r.Z_DEFAULT_WINDOWBITS,u,t.memLevel||r.Z_DEFAULT_MEMLEVEL,l,t.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!a._handle},configurable:!0,enumerable:!0})}function C(t,r){r&&e.nextTick(r),t._handle&&(t._handle.close(),t._handle=null)}function R(t){t.emit("close")}Object.defineProperty(r,"codes",{enumerable:!0,value:Object.freeze(f),writable:!1}),r.Deflate=y,r.Inflate=b,r.Gzip=x,r.Gunzip=w,r.DeflateRaw=E,r.InflateRaw=k,r.Unzip=T,r.createDeflate=function(t){return new y(t)},r.createInflate=function(t){return new b(t)},r.createDeflateRaw=function(t){return new E(t)},r.createInflateRaw=function(t){return new k(t)},r.createGzip=function(t){return new x(t)},r.createGunzip=function(t){return new w(t)},r.createUnzip=function(t){return new T(t)},r.deflate=function(t,e,r){return"function"==typeof e&&(r=e,e={}),v(new y(e),t,r)},r.deflateSync=function(t,e){return _(new y(e),t)},r.gzip=function(t,e,r){return"function"==typeof e&&(r=e,e={}),v(new x(e),t,r)},r.gzipSync=function(t,e){return _(new x(e),t)},r.deflateRaw=function(t,e,r){return"function"==typeof e&&(r=e,e={}),v(new E(e),t,r)},r.deflateRawSync=function(t,e){return _(new E(e),t)},r.unzip=function(t,e,r){return"function"==typeof e&&(r=e,e={}),v(new T(e),t,r)},r.unzipSync=function(t,e){return _(new T(e),t)},r.inflate=function(t,e,r){return"function"==typeof e&&(r=e,e={}),v(new b(e),t,r)},r.inflateSync=function(t,e){return _(new b(e),t)},r.gunzip=function(t,e,r){return"function"==typeof e&&(r=e,e={}),v(new w(e),t,r)},r.gunzipSync=function(t,e){return _(new w(e),t)},r.inflateRaw=function(t,e,r){return"function"==typeof e&&(r=e,e={}),v(new k(e),t,r)},r.inflateRawSync=function(t,e){return _(new k(e),t)},a.inherits(A,i),A.prototype.params=function(t,n,i){if(tr.Z_MAX_LEVEL)throw new RangeError("Invalid compression level: "+t);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!==t||this._strategy!==n){var a=this;this.flush(o.Z_SYNC_FLUSH,function(){s(a._handle,"zlib binding closed"),a._handle.params(t,n),a._hadError||(a._level=t,a._strategy=n,i&&i())})}else e.nextTick(i)},A.prototype.reset=function(){return s(this._handle,"zlib binding closed"),this._handle.reset()},A.prototype._flush=function(t){this._transform(n.alloc(0),"",t)},A.prototype.flush=function(t,r){var i=this,a=this._writableState;("function"==typeof t||void 0===t&&!r)&&(r=t,t=o.Z_FULL_FLUSH),a.ended?r&&e.nextTick(r):a.ending?r&&this.once("end",r):a.needDrain?r&&this.once("drain",function(){return i.flush(t,r)}):(this._flushFlag=t,this.write(n.alloc(0),"",r))},A.prototype.close=function(t){C(this,t),e.nextTick(R,this)},A.prototype._transform=function(t,e,r){var i,a=this._writableState,s=(a.ending||a.ended)&&(!t||a.length===t.length);return null===t||n.isBuffer(t)?this._handle?(s?i=this._finishFlushFlag:(i=this._flushFlag,t.length>=a.length&&(this._flushFlag=this._opts.flush||o.Z_NO_FLUSH)),void this._processChunk(t,i,r)):r(new Error("zlib binding closed")):r(new Error("invalid input"))},A.prototype._processChunk=function(t,e,r){var i=t&&t.length,o=this._chunkSize-this._offset,a=0,c=this,h="function"==typeof r;if(!h){var p,f=[],d=0;this.on("error",function(t){p=t}),s(this._handle,"zlib binding closed");do{var m=this._handle.writeSync(e,t,a,i,this._buffer,this._offset,o)}while(!this._hadError&&_(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}s(this._handle,"zlib binding closed");var v=this._handle.write(e,t,a,i,this._buffer,this._offset,o);function _(u,l){if(this&&(this.buffer=null,this.callback=null),!c._hadError){var p=o-l;if(s(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)&&(o=c._chunkSize,c._offset=0,c._buffer=n.allocUnsafe(c._chunkSize)),0===l){if(a+=i-u,i=u,!h)return!0;var g=c._handle.write(e,t,a,i,c._buffer,c._offset,c._chunkSize);return g.callback=_,void(g.buffer=t)}if(!h)return!1;r()}}v.buffer=t,v.callback=_},a.inherits(y,A),a.inherits(b,A),a.inherits(x,A),a.inherits(w,A),a.inherits(E,A),a.inherits(k,A),a.inherits(T,A)}).call(this,t("_process"))},{"./binding":70,_process:139,assert:66,buffer:73,stream:190,util:200}],72:[function(t,e,r){arguments[4][4][0].apply(r,arguments)},{dup:4}],73:[function(t,e,r){"use strict";var n=t("base64-js"),i=t("ieee754");r.Buffer=s,r.SlowBuffer=function(t){+t!=t&&(t=0);return s.alloc(+t)},r.INSPECT_MAX_BYTES=50;var o=2147483647;function a(t){if(t>o)throw new RangeError("Invalid typed array length");var e=new Uint8Array(t);return e.__proto__=s.prototype,e}function s(t,e,r){if("number"==typeof t){if("string"==typeof e)throw new Error("If encoding is specified then the first argument must be a string");return c(t)}return u(t,e,r)}function u(t,e,r){if("number"==typeof t)throw new TypeError('"value" argument must not be a number');return U(t)?function(t,e,r){if(e<0||t.byteLength=o)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+o.toString(16)+" bytes");return 0|t}function f(t,e){if(s.isBuffer(t))return t.length;if(z(t)||U(t))return t.byteLength;"string"!=typeof t&&(t=""+t);var r=t.length;if(0===r)return 0;for(var n=!1;;)switch(e){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":case void 0:return O(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return N(t).length;default:if(n)return O(t).length;e=(""+e).toLowerCase(),n=!0}}function d(t,e,r){var n=t[e];t[e]=t[r],t[r]=n}function m(t,e,r,n,i){if(0===t.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:t.length-1),r<0&&(r=t.length+r),r>=t.length){if(i)return-1;r=t.length-1}else if(r<0){if(!i)return-1;r=0}if("string"==typeof e&&(e=s.from(e,n)),s.isBuffer(e))return 0===e.length?-1:g(t,e,r,n,i);if("number"==typeof e)return e&=255,"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(t,e,r):Uint8Array.prototype.lastIndexOf.call(t,e,r):g(t,[e],r,n,i);throw new TypeError("val must be string, number or Buffer")}function g(t,e,r,n,i){var o,a=1,s=t.length,u=e.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(t.length<2||e.length<2)return-1;a=2,s/=2,u/=2,r/=2}function l(t,e){return 1===a?t[e]:t.readUInt16BE(e*a)}if(i){var c=-1;for(o=r;os&&(r=s-u),o=r;o>=0;o--){for(var h=!0,p=0;pi&&(n=i):n=i;var o=e.length;if(o%2!=0)throw new TypeError("Invalid hex string");n>o/2&&(n=o/2);for(var a=0;a>8,i=r%256,o.push(i),o.push(n);return o}(e,t.length-r),t,r,n)}function E(t,e,r){return 0===e&&r===t.length?n.fromByteArray(t):n.fromByteArray(t.slice(e,r))}function k(t,e,r){r=Math.min(t.length,r);for(var n=[],i=e;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&(o=t[i+1]))&&(u=(31&l)<<6|63&o)>127&&(c=u);break;case 3:o=t[i+1],a=t[i+2],128==(192&o)&&128==(192&a)&&(u=(15&l)<<12|(63&o)<<6|63&a)>2047&&(u<55296||u>57343)&&(c=u);break;case 4:o=t[i+1],a=t[i+2],s=t[i+3],128==(192&o)&&128==(192&a)&&128==(192&s)&&(u=(15&l)<<18|(63&o)<<12|(63&a)<<6|63&s)>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(t){var e=t.length;if(e<=T)return String.fromCharCode.apply(String,t);var r="",n=0;for(;nthis.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if((r>>>=0)<=(e>>>=0))return"";for(t||(t="utf8");;)switch(t){case"hex":return C(this,e,r);case"utf8":case"utf-8":return k(this,e,r);case"ascii":return S(this,e,r);case"latin1":case"binary":return A(this,e,r);case"base64":return E(this,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return R(this,e,r);default:if(n)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),n=!0}}.apply(this,arguments)},s.prototype.equals=function(t){if(!s.isBuffer(t))throw new TypeError("Argument must be a Buffer");return this===t||0===s.compare(this,t)},s.prototype.inspect=function(){var t="",e=r.INSPECT_MAX_BYTES;return this.length>0&&(t=this.toString("hex",0,e).match(/.{2}/g).join(" "),this.length>e&&(t+=" ... ")),""},s.prototype.compare=function(t,e,r,n,i){if(!s.isBuffer(t))throw new TypeError("Argument must be a Buffer");if(void 0===e&&(e=0),void 0===r&&(r=t?t.length:0),void 0===n&&(n=0),void 0===i&&(i=this.length),e<0||r>t.length||n<0||i>this.length)throw new RangeError("out of range index");if(n>=i&&e>=r)return 0;if(n>=i)return-1;if(e>=r)return 1;if(e>>>=0,r>>>=0,n>>>=0,i>>>=0,this===t)return 0;for(var o=i-n,a=r-e,u=Math.min(o,a),l=this.slice(n,i),c=t.slice(e,r),h=0;h>>=0,isFinite(r)?(r>>>=0,void 0===n&&(n="utf8")):(n=r,r=void 0)}var i=this.length-e;if((void 0===r||r>i)&&(r=i),t.length>0&&(r<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");for(var o=!1;;)switch(n){case"hex":return v(this,t,e,r);case"utf8":case"utf-8":return _(this,t,e,r);case"ascii":return y(this,t,e,r);case"latin1":case"binary":return b(this,t,e,r);case"base64":return x(this,t,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return w(this,t,e,r);default:if(o)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),o=!0}},s.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var T=4096;function S(t,e,r){var n="";r=Math.min(t.length,r);for(var i=e;in)&&(r=n);for(var i="",o=e;or)throw new RangeError("Trying to access beyond buffer length")}function P(t,e,r,n,i,o){if(!s.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>i||et.length)throw new RangeError("Index out of range")}function I(t,e,r,n,i,o){if(r+n>t.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function M(t,e,r,n,o){return e=+e,r>>>=0,o||I(t,0,r,4),i.write(t,e,r,n,23,4),r+4}function D(t,e,r,n,o){return e=+e,r>>>=0,o||I(t,0,r,8),i.write(t,e,r,n,52,8),r+8}s.prototype.slice=function(t,e){var r=this.length;t=~~t,e=void 0===e?r:~~e,t<0?(t+=r)<0&&(t=0):t>r&&(t=r),e<0?(e+=r)<0&&(e=0):e>r&&(e=r),e>>=0,e>>>=0,r||B(t,e,this.length);for(var n=this[t],i=1,o=0;++o>>=0,e>>>=0,r||B(t,e,this.length);for(var n=this[t+--e],i=1;e>0&&(i*=256);)n+=this[t+--e]*i;return n},s.prototype.readUInt8=function(t,e){return t>>>=0,e||B(t,1,this.length),this[t]},s.prototype.readUInt16LE=function(t,e){return t>>>=0,e||B(t,2,this.length),this[t]|this[t+1]<<8},s.prototype.readUInt16BE=function(t,e){return t>>>=0,e||B(t,2,this.length),this[t]<<8|this[t+1]},s.prototype.readUInt32LE=function(t,e){return t>>>=0,e||B(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},s.prototype.readUInt32BE=function(t,e){return t>>>=0,e||B(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},s.prototype.readIntLE=function(t,e,r){t>>>=0,e>>>=0,r||B(t,e,this.length);for(var n=this[t],i=1,o=0;++o=(i*=128)&&(n-=Math.pow(2,8*e)),n},s.prototype.readIntBE=function(t,e,r){t>>>=0,e>>>=0,r||B(t,e,this.length);for(var n=e,i=1,o=this[t+--n];n>0&&(i*=256);)o+=this[t+--n]*i;return o>=(i*=128)&&(o-=Math.pow(2,8*e)),o},s.prototype.readInt8=function(t,e){return t>>>=0,e||B(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},s.prototype.readInt16LE=function(t,e){t>>>=0,e||B(t,2,this.length);var r=this[t]|this[t+1]<<8;return 32768&r?4294901760|r:r},s.prototype.readInt16BE=function(t,e){t>>>=0,e||B(t,2,this.length);var r=this[t+1]|this[t]<<8;return 32768&r?4294901760|r:r},s.prototype.readInt32LE=function(t,e){return t>>>=0,e||B(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},s.prototype.readInt32BE=function(t,e){return t>>>=0,e||B(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},s.prototype.readFloatLE=function(t,e){return t>>>=0,e||B(t,4,this.length),i.read(this,t,!0,23,4)},s.prototype.readFloatBE=function(t,e){return t>>>=0,e||B(t,4,this.length),i.read(this,t,!1,23,4)},s.prototype.readDoubleLE=function(t,e){return t>>>=0,e||B(t,8,this.length),i.read(this,t,!0,52,8)},s.prototype.readDoubleBE=function(t,e){return t>>>=0,e||B(t,8,this.length),i.read(this,t,!1,52,8)},s.prototype.writeUIntLE=function(t,e,r,n){(t=+t,e>>>=0,r>>>=0,n)||P(this,t,e,r,Math.pow(2,8*r)-1,0);var i=1,o=0;for(this[e]=255&t;++o>>=0,r>>>=0,n)||P(this,t,e,r,Math.pow(2,8*r)-1,0);var i=r-1,o=1;for(this[e+i]=255&t;--i>=0&&(o*=256);)this[e+i]=t/o&255;return e+r},s.prototype.writeUInt8=function(t,e,r){return t=+t,e>>>=0,r||P(this,t,e,1,255,0),this[e]=255&t,e+1},s.prototype.writeUInt16LE=function(t,e,r){return t=+t,e>>>=0,r||P(this,t,e,2,65535,0),this[e]=255&t,this[e+1]=t>>>8,e+2},s.prototype.writeUInt16BE=function(t,e,r){return t=+t,e>>>=0,r||P(this,t,e,2,65535,0),this[e]=t>>>8,this[e+1]=255&t,e+2},s.prototype.writeUInt32LE=function(t,e,r){return t=+t,e>>>=0,r||P(this,t,e,4,4294967295,0),this[e+3]=t>>>24,this[e+2]=t>>>16,this[e+1]=t>>>8,this[e]=255&t,e+4},s.prototype.writeUInt32BE=function(t,e,r){return t=+t,e>>>=0,r||P(this,t,e,4,4294967295,0),this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t,e+4},s.prototype.writeIntLE=function(t,e,r,n){if(t=+t,e>>>=0,!n){var i=Math.pow(2,8*r-1);P(this,t,e,r,i-1,-i)}var o=0,a=1,s=0;for(this[e]=255&t;++o>0)-s&255;return e+r},s.prototype.writeIntBE=function(t,e,r,n){if(t=+t,e>>>=0,!n){var i=Math.pow(2,8*r-1);P(this,t,e,r,i-1,-i)}var o=r-1,a=1,s=0;for(this[e+o]=255&t;--o>=0&&(a*=256);)t<0&&0===s&&0!==this[e+o+1]&&(s=1),this[e+o]=(t/a>>0)-s&255;return e+r},s.prototype.writeInt8=function(t,e,r){return t=+t,e>>>=0,r||P(this,t,e,1,127,-128),t<0&&(t=255+t+1),this[e]=255&t,e+1},s.prototype.writeInt16LE=function(t,e,r){return t=+t,e>>>=0,r||P(this,t,e,2,32767,-32768),this[e]=255&t,this[e+1]=t>>>8,e+2},s.prototype.writeInt16BE=function(t,e,r){return t=+t,e>>>=0,r||P(this,t,e,2,32767,-32768),this[e]=t>>>8,this[e+1]=255&t,e+2},s.prototype.writeInt32LE=function(t,e,r){return t=+t,e>>>=0,r||P(this,t,e,4,2147483647,-2147483648),this[e]=255&t,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24,e+4},s.prototype.writeInt32BE=function(t,e,r){return t=+t,e>>>=0,r||P(this,t,e,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t,e+4},s.prototype.writeFloatLE=function(t,e,r){return M(this,t,e,!0,r)},s.prototype.writeFloatBE=function(t,e,r){return M(this,t,e,!1,r)},s.prototype.writeDoubleLE=function(t,e,r){return D(this,t,e,!0,r)},s.prototype.writeDoubleBE=function(t,e,r){return D(this,t,e,!1,r)},s.prototype.copy=function(t,e,r,n){if(r||(r=0),n||0===n||(n=this.length),e>=t.length&&(e=t.length),e||(e=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),t.length-e=0;--i)t[i+e]=this[i+r];else if(o<1e3)for(i=0;i>>=0,r=void 0===r?this.length:r>>>0,t||(t=0),"number"==typeof t)for(o=e;o55295&&r<57344){if(!i){if(r>56319){(e-=3)>-1&&o.push(239,191,189);continue}if(a+1===n){(e-=3)>-1&&o.push(239,191,189);continue}i=r;continue}if(r<56320){(e-=3)>-1&&o.push(239,191,189),i=r;continue}r=65536+(i-55296<<10|r-56320)}else i&&(e-=3)>-1&&o.push(239,191,189);if(i=null,r<128){if((e-=1)<0)break;o.push(r)}else if(r<2048){if((e-=2)<0)break;o.push(r>>6|192,63&r|128)}else if(r<65536){if((e-=3)<0)break;o.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((e-=4)<0)break;o.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return o}function N(t){return n.toByteArray(function(t){if((t=t.trim().replace(F,"")).length<2)return"";for(;t.length%4!=0;)t+="=";return t}(t))}function j(t,e,r,n){for(var i=0;i=e.length||i>=t.length);++i)e[i+r]=t[i];return i}function U(t){return t instanceof ArrayBuffer||null!=t&&null!=t.constructor&&"ArrayBuffer"===t.constructor.name&&"number"==typeof t.byteLength}function z(t){return"function"==typeof ArrayBuffer.isView&&ArrayBuffer.isView(t)}function G(t){return t!=t}},{"base64-js":2,ieee754:86}],74:[function(t,e,r){var n=Object.create||function(t){var e=function(){};return e.prototype=t,new e},i=Object.keys||function(t){var e=[];for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.push(r);return r},o=Function.prototype.bind||function(t){var e=this;return function(){return e.apply(t,arguments)}};function a(){this._events&&Object.prototype.hasOwnProperty.call(this,"_events")||(this._events=n(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0}e.exports=a,a.EventEmitter=a,a.prototype._events=void 0,a.prototype._maxListeners=void 0;var s,u=10;try{var l={};Object.defineProperty&&Object.defineProperty(l,"x",{value:0}),s=0===l.x}catch(t){s=!1}function c(t){return void 0===t._maxListeners?a.defaultMaxListeners:t._maxListeners}function h(t,e,r,i){var o,a,s;if("function"!=typeof r)throw new TypeError('"listener" argument must be a function');if((a=t._events)?(a.newListener&&(t.emit("newListener",e,r.listener?r.listener:r),a=t._events),s=a[e]):(a=t._events=n(null),t._eventsCount=0),s){if("function"==typeof s?s=a[e]=i?[r,s]:[s,r]:i?s.unshift(r):s.push(r),!s.warned&&(o=c(t))&&o>0&&s.length>o){s.warned=!0;var u=new Error("Possible EventEmitter memory leak detected. "+s.length+' "'+String(e)+'" listeners added. Use emitter.setMaxListeners() to increase limit.');u.name="MaxListenersExceededWarning",u.emitter=t,u.type=e,u.count=s.length,"object"==typeof console&&console.warn&&console.warn("%s: %s",u.name,u.message)}}else s=a[e]=r,++t._eventsCount;return t}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 t=new Array(arguments.length),e=0;e1&&(e=arguments[1]),e instanceof Error)throw e;var u=new Error('Unhandled "error" event. ('+e+")");throw u.context=e,u}if(!(r=a[t]))return!1;var l="function"==typeof r;switch(n=arguments.length){case 1:!function(t,e,r){if(e)t.call(r);else for(var n=t.length,i=g(t,n),o=0;o=0;a--)if(r[a]===e||r[a].listener===e){s=r[a].listener,o=a;break}if(o<0)return this;0===o?r.shift():function(t,e){for(var r=e,n=r+1,i=t.length;n=0;o--)this.removeListener(t,e[o]);return this},a.prototype.listeners=function(t){return d(this,t,!0)},a.prototype.rawListeners=function(t){return d(this,t,!1)},a.listenerCount=function(t,e){return"function"==typeof t.listenerCount?t.listenerCount(e):m.call(t,e)},a.prototype.listenerCount=m,a.prototype.eventNames=function(){return this._eventsCount>0?Reflect.ownKeys(this._events):[]}},{}],75:[function(t,e,r){"use strict";var n="undefined"!=typeof Uint8Array&&"undefined"!=typeof Uint16Array&&"undefined"!=typeof Int32Array;function i(t,e){return Object.prototype.hasOwnProperty.call(t,e)}r.assign=function(t){for(var e=Array.prototype.slice.call(arguments,1);e.length;){var r=e.shift();if(r){if("object"!=typeof r)throw new TypeError(r+"must be non-object");for(var n in r)i(r,n)&&(t[n]=r[n])}}return t},r.shrinkBuf=function(t,e){return t.length===e?t:t.subarray?t.subarray(0,e):(t.length=e,t)};var o={arraySet:function(t,e,r,n,i){if(e.subarray&&t.subarray)t.set(e.subarray(r,r+n),i);else for(var o=0;o>>16&65535|0,a=0;0!==r;){r-=a=r>2e3?2e3:r;do{o=o+(i=i+e[n++]|0)|0}while(--a);i%=65521,o%=65521}return i|o<<16|0}},{}],77:[function(t,e,r){"use strict";e.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}},{}],78:[function(t,e,r){"use strict";var n=function(){for(var t,e=[],r=0;r<256;r++){t=r;for(var n=0;n<8;n++)t=1&t?3988292384^t>>>1:t>>>1;e[r]=t}return e}();e.exports=function(t,e,r,i){var o=n,a=i+r;t^=-1;for(var s=i;s>>8^o[255&(t^e[s])];return-1^t}},{}],79:[function(t,e,r){"use strict";var n,i=t("../utils/common"),o=t("./trees"),a=t("./adler32"),s=t("./crc32"),u=t("./messages"),l=0,c=1,h=3,p=4,f=5,d=0,m=1,g=-2,v=-3,_=-5,y=-1,b=1,x=2,w=3,E=4,k=0,T=2,S=8,A=9,C=15,R=8,B=286,P=30,I=19,M=2*B+1,D=15,F=3,L=258,O=L+F+1,N=32,j=42,U=69,z=73,G=91,$=103,V=113,X=666,q=1,K=2,W=3,H=4,Y=3;function Z(t,e){return t.msg=u[e],e}function J(t){return(t<<1)-(t>4?9:0)}function Q(t){for(var e=t.length;--e>=0;)t[e]=0}function tt(t){var e=t.state,r=e.pending;r>t.avail_out&&(r=t.avail_out),0!==r&&(i.arraySet(t.output,e.pending_buf,e.pending_out,r,t.next_out),t.next_out+=r,e.pending_out+=r,t.total_out+=r,t.avail_out-=r,e.pending-=r,0===e.pending&&(e.pending_out=0))}function et(t,e){o._tr_flush_block(t,t.block_start>=0?t.block_start:-1,t.strstart-t.block_start,e),t.block_start=t.strstart,tt(t.strm)}function rt(t,e){t.pending_buf[t.pending++]=e}function nt(t,e){t.pending_buf[t.pending++]=e>>>8&255,t.pending_buf[t.pending++]=255&e}function it(t,e){var r,n,i=t.max_chain_length,o=t.strstart,a=t.prev_length,s=t.nice_match,u=t.strstart>t.w_size-O?t.strstart-(t.w_size-O):0,l=t.window,c=t.w_mask,h=t.prev,p=t.strstart+L,f=l[o+a-1],d=l[o+a];t.prev_length>=t.good_match&&(i>>=2),s>t.lookahead&&(s=t.lookahead);do{if(l[(r=e)+a]===d&&l[r+a-1]===f&&l[r]===l[o]&&l[++r]===l[o+1]){o+=2,r++;do{}while(l[++o]===l[++r]&&l[++o]===l[++r]&&l[++o]===l[++r]&&l[++o]===l[++r]&&l[++o]===l[++r]&&l[++o]===l[++r]&&l[++o]===l[++r]&&l[++o]===l[++r]&&oa){if(t.match_start=e,a=n,n>=s)break;f=l[o+a-1],d=l[o+a]}}}while((e=h[e&c])>u&&0!=--i);return a<=t.lookahead?a:t.lookahead}function ot(t){var e,r,n,o,u,l,c,h,p,f,d=t.w_size;do{if(o=t.window_size-t.lookahead-t.strstart,t.strstart>=d+(d-O)){i.arraySet(t.window,t.window,d,d,0),t.match_start-=d,t.strstart-=d,t.block_start-=d,e=r=t.hash_size;do{n=t.head[--e],t.head[e]=n>=d?n-d:0}while(--r);e=r=d;do{n=t.prev[--e],t.prev[e]=n>=d?n-d:0}while(--r);o+=d}if(0===t.strm.avail_in)break;if(l=t.strm,c=t.window,h=t.strstart+t.lookahead,p=o,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=a(l.adler,c,f,h):2===l.state.wrap&&(l.adler=s(l.adler,c,f,h)),l.next_in+=f,l.total_in+=f,f),t.lookahead+=r,t.lookahead+t.insert>=F)for(u=t.strstart-t.insert,t.ins_h=t.window[u],t.ins_h=(t.ins_h<=F&&(t.ins_h=(t.ins_h<=F)if(n=o._tr_tally(t,t.strstart-t.match_start,t.match_length-F),t.lookahead-=t.match_length,t.match_length<=t.max_lazy_match&&t.lookahead>=F){t.match_length--;do{t.strstart++,t.ins_h=(t.ins_h<=F&&(t.ins_h=(t.ins_h<4096)&&(t.match_length=F-1)),t.prev_length>=F&&t.match_length<=t.prev_length){i=t.strstart+t.lookahead-F,n=o._tr_tally(t,t.strstart-1-t.prev_match,t.prev_length-F),t.lookahead-=t.prev_length-1,t.prev_length-=2;do{++t.strstart<=i&&(t.ins_h=(t.ins_h<15&&(s=2,n-=16),o<1||o>A||r!==S||n<8||n>15||e<0||e>9||a<0||a>E)return Z(t,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*M),this.dyn_dtree=new i.Buf16(2*(2*P+1)),this.bl_tree=new i.Buf16(2*(2*I+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(D+1),this.heap=new i.Buf16(2*B+1),Q(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new i.Buf16(2*B+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 t.state=u,u.strm=t,u.wrap=s,u.gzhead=null,u.w_bits=n,u.w_size=1<t.pending_buf_size-5&&(r=t.pending_buf_size-5);;){if(t.lookahead<=1){if(ot(t),0===t.lookahead&&e===l)return q;if(0===t.lookahead)break}t.strstart+=t.lookahead,t.lookahead=0;var n=t.block_start+r;if((0===t.strstart||t.strstart>=n)&&(t.lookahead=t.strstart-n,t.strstart=n,et(t,!1),0===t.strm.avail_out))return q;if(t.strstart-t.block_start>=t.w_size-O&&(et(t,!1),0===t.strm.avail_out))return q}return t.insert=0,e===p?(et(t,!0),0===t.strm.avail_out?W:H):(t.strstart>t.block_start&&(et(t,!1),t.strm.avail_out),q)}),new ut(4,4,8,4,at),new ut(4,5,16,8,at),new ut(4,6,32,32,at),new ut(4,4,16,16,st),new ut(8,16,32,32,st),new ut(8,16,128,128,st),new ut(8,32,128,256,st),new ut(32,128,258,1024,st),new ut(32,258,258,4096,st)],r.deflateInit=function(t,e){return ht(t,e,S,C,R,k)},r.deflateInit2=ht,r.deflateReset=ct,r.deflateResetKeep=lt,r.deflateSetHeader=function(t,e){return t&&t.state?2!==t.state.wrap?g:(t.state.gzhead=e,d):g},r.deflate=function(t,e){var r,i,a,u;if(!t||!t.state||e>f||e<0)return t?Z(t,g):g;if(i=t.state,!t.output||!t.input&&0!==t.avail_in||i.status===X&&e!==p)return Z(t,0===t.avail_out?_:g);if(i.strm=t,r=i.last_flush,i.last_flush=e,i.status===j)if(2===i.wrap)t.adler=0,rt(i,31),rt(i,139),rt(i,8),i.gzhead?(rt(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)),rt(i,255&i.gzhead.time),rt(i,i.gzhead.time>>8&255),rt(i,i.gzhead.time>>16&255),rt(i,i.gzhead.time>>24&255),rt(i,9===i.level?2:i.strategy>=x||i.level<2?4:0),rt(i,255&i.gzhead.os),i.gzhead.extra&&i.gzhead.extra.length&&(rt(i,255&i.gzhead.extra.length),rt(i,i.gzhead.extra.length>>8&255)),i.gzhead.hcrc&&(t.adler=s(t.adler,i.pending_buf,i.pending,0)),i.gzindex=0,i.status=U):(rt(i,0),rt(i,0),rt(i,0),rt(i,0),rt(i,0),rt(i,9===i.level?2:i.strategy>=x||i.level<2?4:0),rt(i,Y),i.status=V);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|=N),v+=31-v%31,i.status=V,nt(i,v),0!==i.strstart&&(nt(i,t.adler>>>16),nt(i,65535&t.adler)),t.adler=1}if(i.status===U)if(i.gzhead.extra){for(a=i.pending;i.gzindex<(65535&i.gzhead.extra.length)&&(i.pending!==i.pending_buf_size||(i.gzhead.hcrc&&i.pending>a&&(t.adler=s(t.adler,i.pending_buf,i.pending-a,a)),tt(t),a=i.pending,i.pending!==i.pending_buf_size));)rt(i,255&i.gzhead.extra[i.gzindex]),i.gzindex++;i.gzhead.hcrc&&i.pending>a&&(t.adler=s(t.adler,i.pending_buf,i.pending-a,a)),i.gzindex===i.gzhead.extra.length&&(i.gzindex=0,i.status=z)}else i.status=z;if(i.status===z)if(i.gzhead.name){a=i.pending;do{if(i.pending===i.pending_buf_size&&(i.gzhead.hcrc&&i.pending>a&&(t.adler=s(t.adler,i.pending_buf,i.pending-a,a)),tt(t),a=i.pending,i.pending===i.pending_buf_size)){u=1;break}u=i.gzindexa&&(t.adler=s(t.adler,i.pending_buf,i.pending-a,a)),0===u&&(i.gzindex=0,i.status=G)}else i.status=G;if(i.status===G)if(i.gzhead.comment){a=i.pending;do{if(i.pending===i.pending_buf_size&&(i.gzhead.hcrc&&i.pending>a&&(t.adler=s(t.adler,i.pending_buf,i.pending-a,a)),tt(t),a=i.pending,i.pending===i.pending_buf_size)){u=1;break}u=i.gzindexa&&(t.adler=s(t.adler,i.pending_buf,i.pending-a,a)),0===u&&(i.status=$)}else i.status=$;if(i.status===$&&(i.gzhead.hcrc?(i.pending+2>i.pending_buf_size&&tt(t),i.pending+2<=i.pending_buf_size&&(rt(i,255&t.adler),rt(i,t.adler>>8&255),t.adler=0,i.status=V)):i.status=V),0!==i.pending){if(tt(t),0===t.avail_out)return i.last_flush=-1,d}else if(0===t.avail_in&&J(e)<=J(r)&&e!==p)return Z(t,_);if(i.status===X&&0!==t.avail_in)return Z(t,_);if(0!==t.avail_in||0!==i.lookahead||e!==l&&i.status!==X){var y=i.strategy===x?function(t,e){for(var r;;){if(0===t.lookahead&&(ot(t),0===t.lookahead)){if(e===l)return q;break}if(t.match_length=0,r=o._tr_tally(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++,r&&(et(t,!1),0===t.strm.avail_out))return q}return t.insert=0,e===p?(et(t,!0),0===t.strm.avail_out?W:H):t.last_lit&&(et(t,!1),0===t.strm.avail_out)?q:K}(i,e):i.strategy===w?function(t,e){for(var r,n,i,a,s=t.window;;){if(t.lookahead<=L){if(ot(t),t.lookahead<=L&&e===l)return q;if(0===t.lookahead)break}if(t.match_length=0,t.lookahead>=F&&t.strstart>0&&(n=s[i=t.strstart-1])===s[++i]&&n===s[++i]&&n===s[++i]){a=t.strstart+L;do{}while(n===s[++i]&&n===s[++i]&&n===s[++i]&&n===s[++i]&&n===s[++i]&&n===s[++i]&&n===s[++i]&&n===s[++i]&&it.lookahead&&(t.match_length=t.lookahead)}if(t.match_length>=F?(r=o._tr_tally(t,1,t.match_length-F),t.lookahead-=t.match_length,t.strstart+=t.match_length,t.match_length=0):(r=o._tr_tally(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++),r&&(et(t,!1),0===t.strm.avail_out))return q}return t.insert=0,e===p?(et(t,!0),0===t.strm.avail_out?W:H):t.last_lit&&(et(t,!1),0===t.strm.avail_out)?q:K}(i,e):n[i.level].func(i,e);if(y!==W&&y!==H||(i.status=X),y===q||y===W)return 0===t.avail_out&&(i.last_flush=-1),d;if(y===K&&(e===c?o._tr_align(i):e!==f&&(o._tr_stored_block(i,0,0,!1),e===h&&(Q(i.head),0===i.lookahead&&(i.strstart=0,i.block_start=0,i.insert=0))),tt(t),0===t.avail_out))return i.last_flush=-1,d}return e!==p?d:i.wrap<=0?m:(2===i.wrap?(rt(i,255&t.adler),rt(i,t.adler>>8&255),rt(i,t.adler>>16&255),rt(i,t.adler>>24&255),rt(i,255&t.total_in),rt(i,t.total_in>>8&255),rt(i,t.total_in>>16&255),rt(i,t.total_in>>24&255)):(nt(i,t.adler>>>16),nt(i,65535&t.adler)),tt(t),i.wrap>0&&(i.wrap=-i.wrap),0!==i.pending?d:m)},r.deflateEnd=function(t){var e;return t&&t.state?(e=t.state.status)!==j&&e!==U&&e!==z&&e!==G&&e!==$&&e!==V&&e!==X?Z(t,g):(t.state=null,e===V?Z(t,v):d):g},r.deflateSetDictionary=function(t,e){var r,n,o,s,u,l,c,h,p=e.length;if(!t||!t.state)return g;if(2===(s=(r=t.state).wrap)||1===s&&r.status!==j||r.lookahead)return g;for(1===s&&(t.adler=a(t.adler,e,p,0)),r.wrap=0,p>=r.w_size&&(0===s&&(Q(r.head),r.strstart=0,r.block_start=0,r.insert=0),h=new i.Buf8(r.w_size),i.arraySet(h,e,p-r.w_size,r.w_size,0),e=h,p=r.w_size),u=t.avail_in,l=t.next_in,c=t.input,t.avail_in=p,t.next_in=0,t.input=e,ot(r);r.lookahead>=F;){n=r.strstart,o=r.lookahead-(F-1);do{r.ins_h=(r.ins_h<>>=b=y>>>24,d-=b,0===(b=y>>>16&255))S[o++]=65535&y;else{if(!(16&b)){if(0==(64&b)){y=m[(65535&y)+(f&(1<>>=b,d-=b),d<15&&(f+=T[n++]<>>=b=y>>>24,d-=b,!(16&(b=y>>>16&255))){if(0==(64&b)){y=g[(65535&y)+(f&(1<u){t.msg="invalid distance too far back",r.mode=30;break t}if(f>>>=b,d-=b,w>(b=o-a)){if((b=w-b)>c&&r.sane){t.msg="invalid distance too far back",r.mode=30;break t}if(E=0,k=p,0===h){if(E+=l-b,b2;)S[o++]=k[E++],S[o++]=k[E++],S[o++]=k[E++],x-=3;x&&(S[o++]=k[E++],x>1&&(S[o++]=k[E++]))}else{E=o-w;do{S[o++]=S[E++],S[o++]=S[E++],S[o++]=S[E++],x-=3}while(x>2);x&&(S[o++]=S[E++],x>1&&(S[o++]=S[E++]))}break}}break}}while(n>3,f&=(1<<(d-=x<<3))-1,t.next_in=n,t.next_out=o,t.avail_in=n>>24&255)+(t>>>8&65280)+((65280&t)<<8)+((255&t)<<24)}function it(t){var e;return t&&t.state?(e=t.state,t.total_in=t.total_out=e.total=0,t.msg="",e.wrap&&(t.adler=1&e.wrap),e.mode=w,e.last=0,e.havedict=0,e.dmax=32768,e.head=null,e.hold=0,e.bits=0,e.lencode=e.lendyn=new n.Buf32(tt),e.distcode=e.distdyn=new n.Buf32(et),e.sane=1,e.back=-1,d):v}function ot(t){var e;return t&&t.state?((e=t.state).wsize=0,e.whave=0,e.wnext=0,it(t)):v}function at(t,e){var r,n;return t&&t.state?(n=t.state,e<0?(r=0,e=-e):(r=1+(e>>4),e<48&&(e&=15)),e&&(e<8||e>15)?v:(null!==n.window&&n.wbits!==e&&(n.window=null),n.wrap=r,n.wbits=e,ot(t))):v}function st(t,e){var r,i;return t?(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},t.state=i,i.window=null,(r=at(t,e))!==d&&(t.state=null),r):v}var ut,lt,ct=!0;function ht(t){if(ct){var e;for(ut=new n.Buf32(512),lt=new n.Buf32(32),e=0;e<144;)t.lens[e++]=8;for(;e<256;)t.lens[e++]=9;for(;e<280;)t.lens[e++]=7;for(;e<288;)t.lens[e++]=8;for(s(l,t.lens,0,288,ut,0,t.work,{bits:9}),e=0;e<32;)t.lens[e++]=5;s(c,t.lens,0,32,lt,0,t.work,{bits:5}),ct=!1}t.lencode=ut,t.lenbits=9,t.distcode=lt,t.distbits=5}function pt(t,e,r,i){var o,a=t.state;return null===a.window&&(a.wsize=1<=a.wsize?(n.arraySet(a.window,e,r-a.wsize,a.wsize,0),a.wnext=0,a.whave=a.wsize):((o=a.wsize-a.wnext)>i&&(o=i),n.arraySet(a.window,e,r-i,o,a.wnext),(i-=o)?(n.arraySet(a.window,e,r-i,i,0),a.wnext=i,a.whave=a.wsize):(a.wnext+=o,a.wnext===a.wsize&&(a.wnext=0),a.whave>>8&255,r.check=o(r.check,At,2,0),st=0,ut=0,r.mode=E;break}if(r.flags=0,r.head&&(r.head.done=!1),!(1&r.wrap)||(((255&st)<<8)+(st>>8))%31){t.msg="incorrect header check",r.mode=Z;break}if((15&st)!==x){t.msg="unknown compression method",r.mode=Z;break}if(ut-=4,wt=8+(15&(st>>>=4)),0===r.wbits)r.wbits=wt;else if(wt>r.wbits){t.msg="invalid window size",r.mode=Z;break}r.dmax=1<>8&1),512&r.flags&&(At[0]=255&st,At[1]=st>>>8&255,r.check=o(r.check,At,2,0)),st=0,ut=0,r.mode=k;case k:for(;ut<32;){if(0===ot)break t;ot--,st+=tt[rt++]<>>8&255,At[2]=st>>>16&255,At[3]=st>>>24&255,r.check=o(r.check,At,4,0)),st=0,ut=0,r.mode=T;case T:for(;ut<16;){if(0===ot)break t;ot--,st+=tt[rt++]<>8),512&r.flags&&(At[0]=255&st,At[1]=st>>>8&255,r.check=o(r.check,At,2,0)),st=0,ut=0,r.mode=S;case S:if(1024&r.flags){for(;ut<16;){if(0===ot)break t;ot--,st+=tt[rt++]<>>8&255,r.check=o(r.check,At,2,0)),st=0,ut=0}else r.head&&(r.head.extra=null);r.mode=A;case A:if(1024&r.flags&&((ft=r.length)>ot&&(ft=ot),ft&&(r.head&&(wt=r.head.extra_len-r.length,r.head.extra||(r.head.extra=new Array(r.head.extra_len)),n.arraySet(r.head.extra,tt,rt,ft,wt)),512&r.flags&&(r.check=o(r.check,tt,ft,rt)),ot-=ft,rt+=ft,r.length-=ft),r.length))break t;r.length=0,r.mode=C;case C:if(2048&r.flags){if(0===ot)break t;ft=0;do{wt=tt[rt+ft++],r.head&&wt&&r.length<65536&&(r.head.name+=String.fromCharCode(wt))}while(wt&&ft>9&1,r.head.done=!0),t.adler=r.check=0,r.mode=M;break;case P:for(;ut<32;){if(0===ot)break t;ot--,st+=tt[rt++]<>>=7&ut,ut-=7&ut,r.mode=W;break}for(;ut<3;){if(0===ot)break t;ot--,st+=tt[rt++]<>>=1)){case 0:r.mode=F;break;case 1:if(ht(r),r.mode=z,e===f){st>>>=2,ut-=2;break t}break;case 2:r.mode=N;break;case 3:t.msg="invalid block type",r.mode=Z}st>>>=2,ut-=2;break;case F:for(st>>>=7&ut,ut-=7&ut;ut<32;){if(0===ot)break t;ot--,st+=tt[rt++]<>>16^65535)){t.msg="invalid stored block lengths",r.mode=Z;break}if(r.length=65535&st,st=0,ut=0,r.mode=L,e===f)break t;case L:r.mode=O;case O:if(ft=r.length){if(ft>ot&&(ft=ot),ft>at&&(ft=at),0===ft)break t;n.arraySet(et,tt,rt,ft,it),ot-=ft,rt+=ft,at-=ft,it+=ft,r.length-=ft;break}r.mode=M;break;case N:for(;ut<14;){if(0===ot)break t;ot--,st+=tt[rt++]<>>=5,ut-=5,r.ndist=1+(31&st),st>>>=5,ut-=5,r.ncode=4+(15&st),st>>>=4,ut-=4,r.nlen>286||r.ndist>30){t.msg="too many length or distance symbols",r.mode=Z;break}r.have=0,r.mode=j;case j:for(;r.have>>=3,ut-=3}for(;r.have<19;)r.lens[Ct[r.have++]]=0;if(r.lencode=r.lendyn,r.lenbits=7,kt={bits:r.lenbits},Et=s(u,r.lens,0,19,r.lencode,0,r.work,kt),r.lenbits=kt.bits,Et){t.msg="invalid code lengths set",r.mode=Z;break}r.have=0,r.mode=U;case U:for(;r.have>>16&255,_t=65535&St,!((gt=St>>>24)<=ut);){if(0===ot)break t;ot--,st+=tt[rt++]<>>=gt,ut-=gt,r.lens[r.have++]=_t;else{if(16===_t){for(Tt=gt+2;ut>>=gt,ut-=gt,0===r.have){t.msg="invalid bit length repeat",r.mode=Z;break}wt=r.lens[r.have-1],ft=3+(3&st),st>>>=2,ut-=2}else if(17===_t){for(Tt=gt+3;ut>>=gt)),st>>>=3,ut-=3}else{for(Tt=gt+7;ut>>=gt)),st>>>=7,ut-=7}if(r.have+ft>r.nlen+r.ndist){t.msg="invalid bit length repeat",r.mode=Z;break}for(;ft--;)r.lens[r.have++]=wt}}if(r.mode===Z)break;if(0===r.lens[256]){t.msg="invalid code -- missing end-of-block",r.mode=Z;break}if(r.lenbits=9,kt={bits:r.lenbits},Et=s(l,r.lens,0,r.nlen,r.lencode,0,r.work,kt),r.lenbits=kt.bits,Et){t.msg="invalid literal/lengths set",r.mode=Z;break}if(r.distbits=6,r.distcode=r.distdyn,kt={bits:r.distbits},Et=s(c,r.lens,r.nlen,r.ndist,r.distcode,0,r.work,kt),r.distbits=kt.bits,Et){t.msg="invalid distances set",r.mode=Z;break}if(r.mode=z,e===f)break t;case z:r.mode=G;case G:if(ot>=6&&at>=258){t.next_out=it,t.avail_out=at,t.next_in=rt,t.avail_in=ot,r.hold=st,r.bits=ut,a(t,ct),it=t.next_out,et=t.output,at=t.avail_out,rt=t.next_in,tt=t.input,ot=t.avail_in,st=r.hold,ut=r.bits,r.mode===M&&(r.back=-1);break}for(r.back=0;vt=(St=r.lencode[st&(1<>>16&255,_t=65535&St,!((gt=St>>>24)<=ut);){if(0===ot)break t;ot--,st+=tt[rt++]<>yt)])>>>16&255,_t=65535&St,!(yt+(gt=St>>>24)<=ut);){if(0===ot)break t;ot--,st+=tt[rt++]<>>=yt,ut-=yt,r.back+=yt}if(st>>>=gt,ut-=gt,r.back+=gt,r.length=_t,0===vt){r.mode=K;break}if(32&vt){r.back=-1,r.mode=M;break}if(64&vt){t.msg="invalid literal/length code",r.mode=Z;break}r.extra=15&vt,r.mode=$;case $:if(r.extra){for(Tt=r.extra;ut>>=r.extra,ut-=r.extra,r.back+=r.extra}r.was=r.length,r.mode=V;case V:for(;vt=(St=r.distcode[st&(1<>>16&255,_t=65535&St,!((gt=St>>>24)<=ut);){if(0===ot)break t;ot--,st+=tt[rt++]<>yt)])>>>16&255,_t=65535&St,!(yt+(gt=St>>>24)<=ut);){if(0===ot)break t;ot--,st+=tt[rt++]<>>=yt,ut-=yt,r.back+=yt}if(st>>>=gt,ut-=gt,r.back+=gt,64&vt){t.msg="invalid distance code",r.mode=Z;break}r.offset=_t,r.extra=15&vt,r.mode=X;case X:if(r.extra){for(Tt=r.extra;ut>>=r.extra,ut-=r.extra,r.back+=r.extra}if(r.offset>r.dmax){t.msg="invalid distance too far back",r.mode=Z;break}r.mode=q;case q:if(0===at)break t;if(ft=ct-at,r.offset>ft){if((ft=r.offset-ft)>r.whave&&r.sane){t.msg="invalid distance too far back",r.mode=Z;break}ft>r.wnext?(ft-=r.wnext,dt=r.wsize-ft):dt=r.wnext-ft,ft>r.length&&(ft=r.length),mt=r.window}else mt=et,dt=it-r.offset,ft=r.length;ft>at&&(ft=at),at-=ft,r.length-=ft;do{et[it++]=mt[dt++]}while(--ft);0===r.length&&(r.mode=G);break;case K:if(0===at)break t;et[it++]=r.length,at--,r.mode=G;break;case W:if(r.wrap){for(;ut<32;){if(0===ot)break t;ot--,st|=tt[rt++]<=1&&0===F[S];S--);if(A>S&&(A=S),0===S)return l[c++]=20971520,l[c++]=20971520,p.bits=1,0;for(T=1;T0&&(0===t||1!==S))return-1;for(L[1]=0,E=1;E<15;E++)L[E+1]=L[E]+F[E];for(k=0;k852||2===t&&P>592)return 1;for(;;){y=E-R,h[k]<_?(b=0,x=h[k]):h[k]>_?(b=O[N+h[k]],x=M[D+h[k]]):(b=96,x=0),f=1<>R)+(d-=f)]=y<<24|b<<16|x|0}while(0!==d);for(f=1<>=1;if(0!==f?(I&=f-1,I+=f):I=0,k++,0==--F[E]){if(E===S)break;E=e[r+h[k]]}if(E>A&&(I&g)!==m){for(0===R&&(R=A),v+=T,B=1<<(C=E-R);C+R852||2===t&&P>592)return 1;l[m=I&g]=A<<24|C<<16|v-c|0}}return 0!==I&&(l[v+I]=E-R<<24|64<<16|0),p.bits=A,0}},{"../utils/common":75}],83:[function(t,e,r){"use strict";e.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"}},{}],84:[function(t,e,r){"use strict";var n=t("../utils/common"),i=4,o=0,a=1,s=2;function u(t){for(var e=t.length;--e>=0;)t[e]=0}var l=0,c=1,h=2,p=29,f=256,d=f+1+p,m=30,g=19,v=2*d+1,_=15,y=16,b=7,x=256,w=16,E=17,k=18,T=[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0],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],A=[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],R=new Array(2*(d+2));u(R);var B=new Array(2*m);u(B);var P=new Array(512);u(P);var I=new Array(256);u(I);var M=new Array(p);u(M);var D,F,L,O=new Array(m);function N(t,e,r,n,i){this.static_tree=t,this.extra_bits=e,this.extra_base=r,this.elems=n,this.max_length=i,this.has_stree=t&&t.length}function j(t,e){this.dyn_tree=t,this.max_code=0,this.stat_desc=e}function U(t){return t<256?P[t]:P[256+(t>>>7)]}function z(t,e){t.pending_buf[t.pending++]=255&e,t.pending_buf[t.pending++]=e>>>8&255}function G(t,e,r){t.bi_valid>y-r?(t.bi_buf|=e<>y-t.bi_valid,t.bi_valid+=r-y):(t.bi_buf|=e<>>=1,r<<=1}while(--e>0);return r>>>1}function X(t,e,r){var n,i,o=new Array(_+1),a=0;for(n=1;n<=_;n++)o[n]=a=a+r[n-1]<<1;for(i=0;i<=e;i++){var s=t[2*i+1];0!==s&&(t[2*i]=V(o[s]++,s))}}function q(t){var e;for(e=0;e8?z(t,t.bi_buf):t.bi_valid>0&&(t.pending_buf[t.pending++]=t.bi_buf),t.bi_buf=0,t.bi_valid=0}function W(t,e,r,n){var i=2*e,o=2*r;return t[i]>1;r>=1;r--)H(t,o,r);i=u;do{r=t.heap[1],t.heap[1]=t.heap[t.heap_len--],H(t,o,1),n=t.heap[1],t.heap[--t.heap_max]=r,t.heap[--t.heap_max]=n,o[2*i]=o[2*r]+o[2*n],t.depth[i]=(t.depth[r]>=t.depth[n]?t.depth[r]:t.depth[n])+1,o[2*r+1]=o[2*n+1]=i,t.heap[1]=i++,H(t,o,1)}while(t.heap_len>=2);t.heap[--t.heap_max]=t.heap[1],function(t,e){var r,n,i,o,a,s,u=e.dyn_tree,l=e.max_code,c=e.stat_desc.static_tree,h=e.stat_desc.has_stree,p=e.stat_desc.extra_bits,f=e.stat_desc.extra_base,d=e.stat_desc.max_length,m=0;for(o=0;o<=_;o++)t.bl_count[o]=0;for(u[2*t.heap[t.heap_max]+1]=0,r=t.heap_max+1;rd&&(o=d,m++),u[2*n+1]=o,n>l||(t.bl_count[o]++,a=0,n>=f&&(a=p[n-f]),s=u[2*n],t.opt_len+=s*(o+a),h&&(t.static_len+=s*(c[2*n+1]+a)));if(0!==m){do{for(o=d-1;0===t.bl_count[o];)o--;t.bl_count[o]--,t.bl_count[o+1]+=2,t.bl_count[d]--,m-=2}while(m>0);for(o=d;0!==o;o--)for(n=t.bl_count[o];0!==n;)(i=t.heap[--r])>l||(u[2*i+1]!==o&&(t.opt_len+=(o-u[2*i+1])*u[2*i],u[2*i+1]=o),n--)}}(t,e),X(o,l,t.bl_count)}function J(t,e,r){var n,i,o=-1,a=e[1],s=0,u=7,l=4;for(0===a&&(u=138,l=3),e[2*(r+1)+1]=65535,n=0;n<=r;n++)i=a,a=e[2*(n+1)+1],++s>=7;n0?(t.strm.data_type===s&&(t.strm.data_type=function(t){var e,r=4093624447;for(e=0;e<=31;e++,r>>>=1)if(1&r&&0!==t.dyn_ltree[2*e])return o;if(0!==t.dyn_ltree[18]||0!==t.dyn_ltree[20]||0!==t.dyn_ltree[26])return a;for(e=32;e=3&&0===t.bl_tree[2*C[e]+1];e--);return t.opt_len+=3*(e+1)+5+5+4,e}(t),u=t.opt_len+3+7>>>3,(l=t.static_len+3+7>>>3)<=u&&(u=l)):u=l=r+5,r+4<=u&&-1!==e?et(t,e,r,n):t.strategy===i||l===u?(G(t,(c<<1)+(n?1:0),3),Y(t,R,B)):(G(t,(h<<1)+(n?1:0),3),function(t,e,r,n){var i;for(G(t,e-257,5),G(t,r-1,5),G(t,n-4,4),i=0;i>>8&255,t.pending_buf[t.d_buf+2*t.last_lit+1]=255&e,t.pending_buf[t.l_buf+t.last_lit]=255&r,t.last_lit++,0===e?t.dyn_ltree[2*r]++:(t.matches++,e--,t.dyn_ltree[2*(I[r]+f+1)]++,t.dyn_dtree[2*U(e)]++),t.last_lit===t.lit_bufsize-1},r._tr_align=function(t){G(t,c<<1,3),$(t,x,R),function(t){16===t.bi_valid?(z(t,t.bi_buf),t.bi_buf=0,t.bi_valid=0):t.bi_valid>=8&&(t.pending_buf[t.pending++]=255&t.bi_buf,t.bi_buf>>=8,t.bi_valid-=8)}(t)}},{"../utils/common":75}],85:[function(t,e,r){"use strict";e.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}},{}],86:[function(t,e,r){r.read=function(t,e,r,n,i){var o,a,s=8*i-n-1,u=(1<>1,c=-7,h=r?i-1:0,p=r?-1:1,f=t[e+h];for(h+=p,o=f&(1<<-c)-1,f>>=-c,c+=s;c>0;o=256*o+t[e+h],h+=p,c-=8);for(a=o&(1<<-c)-1,o>>=-c,c+=n;c>0;a=256*a+t[e+h],h+=p,c-=8);if(0===o)o=1-l;else{if(o===u)return a?NaN:1/0*(f?-1:1);a+=Math.pow(2,n),o-=l}return(f?-1:1)*a*Math.pow(2,o-n)},r.write=function(t,e,r,n,i,o){var a,s,u,l=8*o-i-1,c=(1<>1,p=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,f=n?0:o-1,d=n?1:-1,m=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(s=isNaN(e)?1:0,a=c):(a=Math.floor(Math.log(e)/Math.LN2),e*(u=Math.pow(2,-a))<1&&(a--,u*=2),(e+=a+h>=1?p/u:p*Math.pow(2,1-h))*u>=2&&(a++,u/=2),a+h>=c?(s=0,a=c):a+h>=1?(s=(e*u-1)*Math.pow(2,i),a+=h):(s=e*Math.pow(2,h-1)*Math.pow(2,i),a=0));i>=8;t[r+f]=255&s,f+=d,s/=256,i-=8);for(a=a<0;t[r+f]=255&a,f+=d,a/=256,l-=8);t[r+f-d]|=128*m}},{}],87:[function(t,e,r){e.exports=[function(t,e){return{options:t,draw:function(e,r,n){n.stop(!0),n.overrideFlag=!0;var i=this;return e.pixelManipulation({output:function(t,e,r){i.output={src:e,format:r}},changePixel:function(t,e,r,n){return[255-t,255-e,255-r,n]},format:e.format,image:t.image,inBrowser:t.inBrowser,callback:r})},output:void 0,UI:e}},{name:"Invert",description:"Inverts the image.",inputs:{}}]},{}],88:[function(t,e,r){"use strict";var n=t("underscore"),i=e.exports={Bitmap:t("./lib/bitmap")};n.extend(i,t("./lib/enums"))},{"./lib/bitmap":89,"./lib/enums":90,underscore:195}],89:[function(t,e,r){(function(r){"use strict";var n=t("fs"),i=(t("underscore"),t("bluebird")),o=t("jpeg-js"),a=t("node-png").PNG,s=t("./enums"),u=t("./utils"),l=t("./resize"),c={r:0,g:0,b:0,a:0},h=e.exports=function(t){t&&(t instanceof h?this._data={data:new r(t.data.data),width:t.width,height:t.height}:t.data?this._data=t:t.width&&t.height&&(this._data={data:new r(4*t.width*t.height),width:t.width,height:t.height},t.color&&this._fill(t.color)))};h.prototype={get width(){return this._data.width},get height(){return this._data.height},attach:function(t){var e=this._data;return this._data=t,e},detach:function(){var t=this._data;return delete this._data,t},_deduceFileType:function(t){if(!t)throw new Error("Can't determine image type");switch(t.substr(-4).toLowerCase()){case".jpg":return s.ImageType.JPG;case".png":return s.ImageType.PNG}if(".jpeg"==t.substr(-5).toLowerCase())return s.ImageType.JPG;throw new Error("Can't recognise image type: "+t)},_readStream:function(t){var e=i.defer(),n=[];return t.on("data",function(t){n.push(t)}),t.on("end",function(){var t=r.concat(n);e.resolve(t)}),t.on("error",function(t){e.reject(t)}),e.promise},_readPNG:function(t){var e=i.defer(),r=new a({filterType:4});return r.on("parsed",function(){e.resolve(r)}),r.on("error",function(t){e.rejecyt(t)}),t.pipe(r),e.promise},_parseOptions:function(t,e){return"number"==typeof(t=t||{})&&(t={type:t}),t.type=t.type||this._deduceFileType(e),t},read:function(t,e){var r=this;switch((e=this._parseOptions(e)).type){case s.ImageType.JPG:return this._readStream(t).then(function(t){r._data=o.decode(t)});case s.ImageType.PNG:return this._readPNG(t).then(function(t){r._data={data:t.data,width:t.width,height:t.height}});default:return i.reject(new Error("Not supported: ImageType "+e.type))}},readFile:function(t,e){var r=this;return u.fs.exists(t).then(function(i){if(i){e=r._parseOptions(e,t);var o=n.createReadStream(t);return r.read(o,e)}throw new Error("File Not Found: "+t)})},write:function(t,e){e=this._parseOptions(e);var r=i.defer();try{switch(t.on("finish",function(){r.resolve()}),t.on("error",function(t){r.reject(t)}),e.type){case s.ImageType.JPG:var n=o.encode(this._data,e.quality||90).data;t.write(n),t.end();break;case s.ImageType.PNG:var u=new a;u.width=this.width,u.height=this.height,u.data=this._data.data,u.on("end",function(){r.resolve()}),u.on("error",function(t){r.reject(t)}),u.pack().pipe(t);break;default:throw new Error("Not supported: ImageType "+e.type)}}catch(t){r.reject(t)}return r.promise},writeFile:function(t,e){e=this._parseOptions(e,t);var r=n.createWriteStream(t);return this.write(r,e)},clone:function(){return new h({width:this.width,height:this.height,data:new r(this._data.data)})},setPixel:function(t,e,r,n,i,o){if(void 0===n){var a=r;r=a.r,n=a.g,i=a.b,o=a.a}void 0===o&&(o=255);var s=4*(e*this.width+t),u=this._data.data;u[s++]=r,u[s++]=n,u[s++]=i,u[s++]=o},getPixel:function(t,e,r){var n=4*(e*this.width+t);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 t=new h({width:this.width,height:this.height}),e=this.width*this.height,r=this._data.data,n=t._data.data,i=0,o=0,a=0;a-1&&R-1&&B=0&&B>=0?x[L]:O)+N*(g=R=0?x[L+4]:O),z=(1-N)*(v=R>=0&&B0?a:0)-(c>0?4:0)]+2*s[f-(l>0?a:0)]+1*s[f-(l>0?a:0)+(c0?4:0)]+4*s[f]+2*s[f+(c0?4:0)]+2*s[f+(l0?o[w-4]:2*o[w]-o[w+4],k=o[w],T=o[w+4],S=z0?m[w-4*p]:2*m[w]-m[w+4*p],B=m[w],P=m[w+4*p],I=j1)for(g=0;g0&&!t[a-1];)a--;o.push({children:[],index:0});var s,u=o[0];for(r=0;r0;)u=o.pop();for(u.index++,o.push(u);o.length<=r;)o.push(s={children:[],index:0}),u.children[u.index]=s.children,u=s;i++}r+10)return f>>--d&1;if(255==(f=e[r++])){var t=e[r++];if(t)throw"unexpected marker: "+(f<<8|t).toString(16)}return d=7,f>>>7}function g(t){for(var e,r=t;null!==(e=m());){if("number"==typeof(r=r[e]))return r;if("object"!=typeof r)throw"invalid huffman sequence"}return null}function v(t){for(var e=0;t>0;){var r=m();if(null===r)return;e=e<<1|r,t--}return e}function _(t){var e=v(t);return e>=1<0)y--;else for(var n=a,i=s;n<=i;){var o=g(e.huffmanTableAC),u=15&o,c=o>>4;if(0!==u)r[t[n+=c]]=_(u)*(1<>4,0===h)o<15?(y=v(o)+(1<>4;if(0!==s)r[t[o+=u]]=_(s),o++;else{if(u<15)break;o+=16}}};var P,I,M,D,F=0;for(I=1==B?i[0].blocksPerLine*i[0].blocksPerColumn:c*n.mcusPerColumn,o||(o=I);F=65488&&P<=65495))break;r+=2}return r-p}function p(t,l){var c,h,p=[],f=l.blocksPerLine,d=l.blocksPerColumn,m=f<<3,g=new Int32Array(64),v=new Uint8Array(64);function _(t,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]=t[x]*w[x];for(x=0;x<8;++x){var k=8*x;0!=E[1+k]||0!=E[2+k]||0!=E[3+k]||0!=E[4+k]||0!=E[5+k]||0!=E[6+k]||0!=E[7+k]?(p=s*E[0+k]+128>>8,f=s*E[4+k]+128>>8,d=E[2+k],m=E[6+k],g=u*(E[1+k]-E[7+k])+128>>8,y=u*(E[1+k]+E[7+k])+128>>8,v=E[3+k]<<4,_=E[5+k]<<4,b=p-f+1>>1,p=p+f+1>>1,f=b,b=d*a+m*o+128>>8,d=d*o-m*a+128>>8,m=b,b=g-_+1>>1,g=g+_+1>>1,_=b,b=y+v+1>>1,v=y-v+1>>1,y=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+y*n+2048>>12,g=g*n-y*i+2048>>12,y=b,b=v*r+_*e+2048>>12,v=v*e-_*r+2048>>12,_=b,E[0+k]=p+y,E[7+k]=p-y,E[1+k]=f+_,E[6+k]=f-_,E[2+k]=d+v,E[5+k]=d-v,E[3+k]=m+g,E[4+k]=m-g):(b=s*E[0+k]+512>>10,E[0+k]=b,E[1+k]=b,E[2+k]=b,E[3+k]=b,E[4+k]=b,E[5+k]=b,E[6+k]=b,E[7+k]=b)}for(x=0;x<8;++x){var T=x;0!=E[8+T]||0!=E[16+T]||0!=E[24+T]||0!=E[32+T]||0!=E[40+T]||0!=E[48+T]||0!=E[56+T]?(p=s*E[0+T]+2048>>12,f=s*E[32+T]+2048>>12,d=E[16+T],m=E[48+T],g=u*(E[8+T]-E[56+T])+2048>>12,y=u*(E[8+T]+E[56+T])+2048>>12,v=E[24+T],_=E[40+T],b=p-f+1>>1,p=p+f+1>>1,f=b,b=d*a+m*o+2048>>12,d=d*o-m*a+2048>>12,m=b,b=g-_+1>>1,g=g+_+1>>1,_=b,b=y+v+1>>1,v=y-v+1>>1,y=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+y*n+2048>>12,g=g*n-y*i+2048>>12,y=b,b=v*r+_*e+2048>>12,v=v*e-_*r+2048>>12,_=b,E[0+T]=p+y,E[56+T]=p-y,E[8+T]=f+_,E[48+T]=f-_,E[16+T]=d+v,E[40+T]=d-v,E[24+T]=m+g,E[32+T]=m-g):(b=s*h[x+0]+8192>>14,E[0+T]=b,E[8+T]=b,E[16+T]=b,E[24+T]=b,E[32+T]=b,E[40+T]=b,E[48+T]=b,E[56+T]=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 y=0;y255?255:t}return l.prototype={load:function(t){var e=new XMLHttpRequest;e.open("GET",t,!0),e.responseType="arraybuffer",e.onload=function(){var t=new Uint8Array(e.response||e.mozResponseArrayBuffer);this.parse(t),this.onload&&this.onload()}.bind(this),e.send(null)},parse:function(e){var r=0;e.length;function n(){var t=e[r]<<8|e[r+1];return r+=2,t}function i(){var t=n(),i=e.subarray(r,r+t-2);return r+=i.length,i}function o(t){var e,r,n=0,i=0;for(r in t.components)t.components.hasOwnProperty(r)&&(n<(e=t.components[r]).h&&(n=e.h),i>4==0)for(z=0;z<64;z++){x[t[z]]=e[r++]}else{if(b>>4!=1)throw"DQT: invalid table spec";for(z=0;z<64;z++){x[t[z]]=n()}}f[15&b]=x}break;case 65472:case 65473:case 65474:n(),(a={}).extended=65473===v,a.progressive=65474===v,a.precision=e[r++],a.scanLines=n(),a.samplesPerLine=n(),a.components={},a.componentsOrder=[];var w,E=e[r++];for(j=0;j>4,T=15&e[r+1],S=e[r+2];a.componentsOrder.push(w),a.components[w]={h:k,v:T,quantizationIdx:S},r+=3}o(a),d.push(a);break;case 65476:var A=n();for(j=2;j>4==0?g:m)[15&C]=c(R,P)}break;case 65501:n(),s=n();break;case 65498:n();var I=e[r++],M=[];for(j=0;j>4],G.huffmanTableAC=m[15&D],M.push(G)}var F=e[r++],L=e[r++],O=e[r++],N=h(e,r,a,M,s,F,L,O>>4,15&O);r+=N;break;default:if(255==e[r-3]&&e[r-2]>=192&&e[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;)e&1<>8&255),F(255&t)}function O(t,e,r,n,i){var o,a=i[0],s=i[240];for(var u=function(t,e){var r,n,i,o,a,s,u,l,c,h,p=0;for(c=0;c<8;++c){r=t[p],n=t[p+1],i=t[p+2],o=t[p+3],a=t[p+4],s=t[p+5],u=t[p+6];var f=r+(l=t[p+7]),m=r-l,g=n+u,v=n-u,_=i+s,y=i-s,b=o+a,x=o-a,w=f+b,E=f-b,k=g+_,T=g-_;t[p]=w+k,t[p+4]=w-k;var S=.707106781*(T+E);t[p+2]=E+S,t[p+6]=E-S;var A=.382683433*((w=x+y)-(T=v+m)),C=.5411961*w+A,R=1.306562965*T+A,B=.707106781*(k=y+v),P=m+B,I=m-B;t[p+5]=I+C,t[p+3]=I-C,t[p+1]=P+R,t[p+7]=P-R,p+=8}for(p=0,c=0;c<8;++c){r=t[p],n=t[p+8],i=t[p+16],o=t[p+24],a=t[p+32],s=t[p+40],u=t[p+48];var M=r+(l=t[p+56]),D=r-l,F=n+u,L=n-u,O=i+s,N=i-s,j=o+a,U=o-a,z=M+j,G=M-j,$=F+O,V=F-O;t[p]=z+$,t[p+32]=z-$;var X=.707106781*(V+G);t[p+16]=G+X,t[p+48]=G-X;var q=.382683433*((z=U+N)-(V=L+D)),K=.5411961*z+q,W=1.306562965*V+q,H=.707106781*($=N+L),Y=D+H,Z=D-H;t[p+40]=Z+K,t[p+24]=Z-K,t[p+8]=Y+W,t[p+56]=Y-W,p++}for(c=0;c<64;++c)h=t[c]*e[c],d[c]=h>0?h+.5|0:h-.5|0;return d}(t,e),l=0;l<64;++l)m[k[l]]=u[l];var c=m[0]-r;r=m[0],0==c?D(n[0]):(D(n[f[o=32767+c]]),D(p[o]));for(var h=63;h>0&&0==m[h];h--);if(0==h)return D(a),r;for(var g,v=1;v<=h;){for(var _=v;0==m[v]&&v<=h;++v);var y=v-_;if(y>=16){g=y>>4;for(var b=1;b<=g;++b)D(s);y&=15}o=32767+m[v],D(i[(y<<4)+f[o]]),D(p[o]),v++}return 63!=h&&D(a),r}function N(t){if(t<=0&&(t=1),t>100&&(t=100),a!=t){(function(t){for(var e=[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=s((e[r]*t+50)/100);n<1?n=1:n>255&&(n=255),u[k[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],o=0;o<64;o++){var a=s((i[o]*t+50)/100);a<1?a=1:a>255&&(a=255),l[k[o]]=a}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[k[f]]*p[d]*p[m]*8),h[f]=1/(l[k[f]]*p[d]*p[m]*8),f++})(t<50?Math.floor(5e3/t):Math.floor(200-2*t)),a=t}}this.encode=function(e,a){(new Date).getTime();a&&N(a),g=new Array,v=0,_=7,L(65496),L(65504),L(16),F(74),F(70),F(73),F(70),F(0),F(1),F(1),F(0),L(1),L(1),F(0),F(0),function(){L(65499),L(132),F(0);for(var t=0;t<64;t++)F(u[t]);F(1);for(var e=0;e<64;e++)F(l[e])}(),function(t,e){L(65472),L(17),F(8),L(e),L(t),F(3),F(1),F(17),F(0),F(2),F(17),F(1),F(3),F(17),F(1)}(e.width,e.height),function(){L(65476),L(418),F(0);for(var t=0;t<16;t++)F(T[t+1]);for(var e=0;e<=11;e++)F(S[e]);F(16);for(var r=0;r<16;r++)F(A[r+1]);for(var n=0;n<=161;n++)F(C[n]);F(1);for(var i=0;i<16;i++)F(R[i+1]);for(var o=0;o<=11;o++)F(B[o]);F(17);for(var a=0;a<16;a++)F(P[a+1]);for(var s=0;s<=161;s++)F(I[s])}(),L(65498),L(12),F(3),F(1),F(0),F(2),F(17),F(3),F(17),F(0),F(63),F(0);var s=0,p=0,f=0;v=0,_=7,this.encode.displayName="_encode_";for(var d,m,w,k,M,j,U,z,G,$=e.data,V=e.width,X=e.height,q=4*V,K=0;K>3)*q+(U=4*(7&G)),K+z>=X&&(j-=q*(K+1+z-X)),d+U>=q&&(j-=d+U-q+4),m=$[j++],w=$[j++],k=$[j++],y[G]=(E[m]+E[w+256>>0]+E[k+512>>0]>>16)-128,b[G]=(E[m+768>>0]+E[w+1024>>0]+E[k+1280>>0]>>16)-128,x[G]=(E[m+1280>>0]+E[w+1536>>0]+E[k+1792>>0]>>16)-128;s=O(y,c,s,r,i),p=O(b,h,p,n,o),f=O(x,h,f,n,o),d+=32}K+=8}if(_>=0){var W=[];W[1]=_+1,W[0]=(1<<_+1)-1,D(W)}return L(65497),new t(g)},function(){(new Date).getTime();e||(e=50),function(){for(var t=String.fromCharCode,e=0;e<256;e++)w[e]=t(e)}(),r=M(T,S),n=M(R,B),i=M(A,C),o=M(P,I),function(){for(var t=1,e=2,r=1;r<=15;r++){for(var n=t;n>0]=38470*t,E[t+512>>0]=7471*t+32768,E[t+768>>0]=-11059*t,E[t+1024>>0]=-21709*t,E[t+1280>>0]=32768*t+8421375,E[t+1536>>0]=-27439*t,E[t+1792>>0]=-5329*t}(),N(e),(new Date).getTime()}()}e.exports=function(t,e){void 0===e&&(e=50);return{data:new r(e).encode(t,e),width:t.width,height:t.height}}}).call(this,t("buffer").Buffer)},{buffer:73}],96:[function(t,e,r){arguments[4][67][0].apply(r,arguments)},{dup:67}],97:[function(t,e,r){"use strict";e.exports=function(t){for(var e=new Array(t),r=0;r=this.width||e<0||e>=this.height)&&!!this.data[e*this.width+t]},t.prototype.set=function(t,e,r){this.data[e*this.width+t]=r?1:0},t.prototype.setRegion=function(t,e,r,n,i){for(var o=e;o=this.size&&(i=(i^this.primitive)&this.size-1);for(o=0;o1&&0===e[0]){for(var n=1;ni.length&&(r=(o=[i,r])[0],i=o[1]);for(var o,a=new Uint8ClampedArray(i.length),s=i.length-r.length,u=0;ur?r:t}var s=function(){function t(t,e){this.width=t,this.data=new Uint8ClampedArray(t*e)}return t.prototype.get=function(t,e){return this.data[e*this.width+t]},t.prototype.set=function(t,e,r){this.data[e*this.width+t]=r},t}();e.binarize=function(t,e,r){if(t.length!==e*r*4)throw new Error("Malformed data passed to binarizer.");for(var u=new s(e,r),l=0;l0&&_>0)){var k=(g.get(_,v-1)+2*g.get(_-1,v)+g.get(_-1,v-1))/4;b6&&(r.setRegion(e-11,0,3,6,!0),r.setRegion(0,e-11,6,3,!0)),r}(e),s=[],l=0,h=0,p=!0,f=o-1;f>0;f-=2){6===f&&f--;for(var d=0;d=0;i--)for(var o=e-9;o>=e-11;o--)n=u(t.get(o,i),n);var l=0;for(o=5;o>=0;o--)for(i=e-9;i>=e-11;i--)l=u(t.get(o,i),l);for(var c,h=1/0,p=0,f=a.VERSIONS;p=0;n--)6!==n&&(e=u(t.get(8,n),e));var i=t.height,o=0;for(n=i-1;n>=i-7;n--)o=u(t.get(8,n),o);for(r=i-8;r1){var c=n.ecBlocks[0].numBlocks,h=n.ecBlocks[1].numBlocks;for(s=0;s0;)for(var p=0,f=i;p=3;){if((l=t.readBits(10))>=1e3)throw new Error("Invalid numeric value above 999");var a=Math.floor(l/100),s=Math.floor(l/10)%10,u=l%10;r.push(48+a,48+s,48+u),n+=a.toString()+s.toString()+u.toString(),o-=3}if(2===o){if((l=t.readBits(7))>=100)throw new Error("Invalid numeric value above 99");a=Math.floor(l/10),s=l%10;r.push(48+a,48+s),n+=a.toString()+s.toString()}else if(1===o){var l;if((l=t.readBits(4))>=10)throw new Error("Invalid numeric value above 9");r.push(48+l),n+=l.toString()}return{bytes:r,text:n}}!function(t){t.Numeric="numeric",t.Alphanumeric="alphanumeric",t.Byte="byte",t.Kanji="kanji",t.ECI="eci"}(n=e.Mode||(e.Mode={})),function(t){t[t.Terminator=0]="Terminator",t[t.Numeric=1]="Numeric",t[t.Alphanumeric=2]="Alphanumeric",t[t.Byte=4]="Byte",t[t.Kanji=8]="Kanji",t[t.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(t,e){for(var r=[],n="",i=[9,11,13][e],o=t.readBits(i);o>=2;){var a=t.readBits(11),s=Math.floor(a/45),l=a%45;r.push(u[s].charCodeAt(0),u[l].charCodeAt(0)),n+=u[s]+u[l],o-=2}if(1===o){s=t.readBits(6);r.push(u[s].charCodeAt(0)),n+=u[s]}return{bytes:r,text:n}}function c(t,e){for(var r=[],n="",i=[8,16,16][e],o=t.readBits(i),a=0;a>8,255&l),n+=String.fromCharCode(a.shiftJISTable[l])}return{bytes:r,text:n}}e.decode=function(t,e){for(var r,a,u,p,f=new o.BitStream(t),d=e<=9?0:e<=26?1:2,m={text:"",bytes:[],chunks:[]};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=s(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 _=l(f,d);m.text+=_.text,(a=m.bytes).push.apply(a,_.bytes),m.chunks.push({type:n.Alphanumeric,text:_.text})}else if(g===i.Byte){var y=c(f,d);m.text+=y.text,(u=m.bytes).push.apply(u,y.bytes),m.chunks.push({type:n.Byte,bytes:y.bytes,text:y.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})}}}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=function(){function t(t){this.byteOffset=0,this.bitOffset=0,this.bytes=t}return t.prototype.readBits=function(t){if(t<1||t>32||t>this.available())throw new Error("Cannot read "+t.toString()+" bits");var e=0;if(this.bitOffset>0){var r=8-this.bitOffset,n=t>8-n<<(o=r-n);e=(this.bytes[this.byteOffset]&i)>>o,t-=n,this.bitOffset+=n,8===this.bitOffset&&(this.bitOffset=0,this.byteOffset++)}if(t>0){for(;t>=8;)e=e<<8|255&this.bytes[this.byteOffset],this.byteOffset++,t-=8;if(t>0){var o;i=255>>(o=8-t)<>o,this.bitOffset+=t}}return e},t.prototype.available=function(){return 8*(this.bytes.length-this.byteOffset)-this.bitOffset},t}();e.BitStream=n},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.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(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=r(1),i=r(2);e.decode=function(t,e){var r=new Uint8ClampedArray(t.length);r.set(t);for(var o=new n.default(285,256,0),a=new i.default(o,r),s=new Uint8ClampedArray(e),u=!1,l=0;l=n/2;){var u=i,l=a;if(a=s,(i=o).isZero())return null;o=u;for(var c=t.zero,h=i.getCoefficient(i.degree()),p=t.inverse(h);o.degree()>=i.degree()&&!o.isZero();){var f=o.degree()-i.degree(),d=t.multiply(o.getCoefficient(o.degree()),p);c=c.addOrSubtract(t.buildMonomial(f,d)),o=o.addOrSubtract(i.multiplyByMonomial(f,d))}if(s=c.multiplyPoly(a).addOrSubtract(l),o.degree()>=i.degree())return null}var m=s.getCoefficient(0);if(0===m)return null;var g,v=t.inverse(m);return[s.multiply(v),o.multiply(v)]}(o,o.buildMonomial(e,1),h,e);if(null===p)return null;var f=function(t,e){var r=e.degree();if(1===r)return[e.getCoefficient(1)];for(var n=new Array(r),i=0,o=1;oMath.abs(e.x-t.x);c?(i=Math.floor(t.y),o=Math.floor(t.x),s=Math.floor(e.y),u=Math.floor(e.x)):(i=Math.floor(t.x),o=Math.floor(t.y),s=Math.floor(e.x),u=Math.floor(e.y));for(var h=Math.abs(s-i),p=Math.abs(u-o),f=Math.floor(-h/2),d=i0){if(_===u)break;_+=m,f-=h}}for(var x=[],w=0;w=t.bottom.startX&&v<=t.bottom.endX||g>=t.bottom.startX&&v<=t.bottom.endX||v<=t.bottom.startX&&g>=t.bottom.endX&&h[2]/(t.bottom.endX-t.bottom.startX)i})).length>0?y[0].bottom=_:r.push({top:_,bottom:_})}if(m){var y,b=e-h[4],x=b-h[3];_={startX:x,y:n,endX:b},(y=c.filter(function(t){return x>=t.bottom.startX&&x<=t.bottom.endX||b>=t.bottom.startX&&x<=t.bottom.endX||x<=t.bottom.startX&&b>=t.bottom.endX&&h[2]/(t.bottom.endX-t.bottom.startX)i})).length>0?y[0].bottom=_:c.push({top:_,bottom:_})}}},f=-1;f<=t.width;f++)p(f);e.push.apply(e,r.filter(function(t){return t.bottom.y!==n&&t.bottom.y-t.top.y>=2})),r=r.filter(function(t){return t.bottom.y===n}),u.push.apply(u,c.filter(function(t){return t.bottom.y!==n})),c=c.filter(function(t){return t.bottom.y===n})},f=0;f<=t.height;f++)p(f);e.push.apply(e,r.filter(function(t){return t.bottom.y-t.top.y>=2})),u.push.apply(u,c);var d=e.filter(function(t){return t.bottom.y-t.top.y>=2}).map(function(e){var r=(e.top.startX+e.top.endX+e.bottom.startX+e.bottom.endX)/4,n=(e.top.y+e.bottom.y+1)/2;if(t.get(Math.round(r),Math.round(n))){var i=[e.top.endX-e.top.startX,e.bottom.endX-e.bottom.startX,e.bottom.y-e.top.y+1],o=s(i)/i.length;return{score:h({x:Math.round(r),y:Math.round(n)},[1,1,3,1,1],t),x:r,y:n,size:o}}}).filter(function(t){return!!t}).sort(function(t,e){return t.score-e.score}).map(function(t,e,r){if(e>n)return null;var i=r.filter(function(t,r){return e!==r}).map(function(e){return{x:e.x,y:e.y,score:e.score+Math.pow(e.size-t.size,2)/t.size,size:e.size}}).sort(function(t,e){return t.score-e.score});if(i.length<2)return null;var o=t.score+i[0].score+i[1].score;return{points:[t].concat(i.slice(0,2)),score:o}}).filter(function(t){return!!t}).sort(function(t,e){return t.score-e.score});if(0===d.length)return null;var m,g,v=function(t,e,r){var n,i,o,s,u,l,c,h=a(t,e),p=a(e,r),f=a(t,r);return p>=h&&p>=f?(n=(s=[e,t,r])[0],i=s[1],o=s[2]):f>=p&&f>=h?(n=(u=[t,e,r])[0],i=u[1],o=u[2]):(n=(l=[t,r,e])[0],i=l[1],o=l[2]),(o.x-i.x)*(n.y-i.y)-(o.y-i.y)*(n.x-i.x)<0&&(n=(c=[o,n])[0],o=c[1]),{bottomLeft:n,topLeft:i,topRight:o}}(d[0].points[0],d[0].points[1],d[0].points[2]),_=v.topRight,y=v.topLeft,b=v.bottomLeft;try{x=function(t,e,r,n){var i=(s(l(t,r,n,5))/7+s(l(t,e,n,5))/7+s(l(r,t,n,5))/7+s(l(e,t,n,5))/7)/4;if(i<1)throw new Error("Invalid module size");var o=Math.round(a(t,e)/i),u=Math.round(a(t,r)/i),c=Math.floor((o+u)/2)+7;switch(c%4){case 0:c++;break;case 2:c--}return{dimension:c,moduleSize:i}}(y,_,b,t),m=x.dimension,g=x.moduleSize}catch(t){return null}var x,w=_.x-y.x+b.x,E=_.y-y.y+b.y,k=(a(y,b)+a(y,_))/2/g,T=1-3/k,S={x:y.x+T*(w-y.x),y:y.y+T*(E-y.y)},A=u.map(function(e){var r=(e.top.startX+e.top.endX+e.bottom.startX+e.bottom.endX)/4,n=(e.top.y+e.bottom.y+1)/2;if(t.get(Math.floor(r),Math.floor(n))){var i=[e.top.endX-e.top.startX,e.bottom.endX-e.bottom.startX,e.bottom.y-e.top.y+1];return s(i),{x:r,y:n,score:h({x:Math.floor(r),y:Math.floor(n)},[1,1,1],t)+a({x:r,y:n},S)}}}).filter(function(t){return!!t}).sort(function(t,e){return t.score-e.score}),C=k>=15&&A.length?A[0]:S;return{alignmentPattern:{x:C.x,y:C.y},bottomLeft:{x:b.x,y:b.y},dimension:m,topLeft:{x:y.x,y:y.y},topRight:{x:_.x,y:_.y}}}}]).default},"object"==typeof r&&"object"==typeof e?e.exports=i():"function"==typeof define&&define.amd?define([],i):"object"==typeof r?r.jsQR=i():n.jsQR=i()},{}],101:[function(t,e,r){(function(t){(function(){var n,i=200,o="Unsupported core-js use. Try https://npms.io/search?q=ponyfill.",a="Expected a function",s="__lodash_hash_undefined__",u=500,l="__lodash_placeholder__",c=1,h=2,p=4,f=1,d=2,m=1,g=2,v=4,_=8,y=16,b=32,x=64,w=128,E=256,k=512,T=30,S="...",A=800,C=16,R=1,B=2,P=1/0,I=9007199254740991,M=1.7976931348623157e308,D=NaN,F=4294967295,L=F-1,O=F>>>1,N=[["ary",w],["bind",m],["bindKey",g],["curry",_],["curryRight",y],["flip",k],["partial",b],["partialRight",x],["rearg",E]],j="[object Arguments]",U="[object Array]",z="[object AsyncFunction]",G="[object Boolean]",$="[object Date]",V="[object DOMException]",X="[object Error]",q="[object Function]",K="[object GeneratorFunction]",W="[object Map]",H="[object Number]",Y="[object Null]",Z="[object Object]",J="[object Proxy]",Q="[object RegExp]",tt="[object Set]",et="[object String]",rt="[object Symbol]",nt="[object Undefined]",it="[object WeakMap]",ot="[object WeakSet]",at="[object ArrayBuffer]",st="[object DataView]",ut="[object Float32Array]",lt="[object Float64Array]",ct="[object Int8Array]",ht="[object Int16Array]",pt="[object Int32Array]",ft="[object Uint8Array]",dt="[object Uint8ClampedArray]",mt="[object Uint16Array]",gt="[object Uint32Array]",vt=/\b__p \+= '';/g,_t=/\b(__p \+=) '' \+/g,yt=/(__e\(.*?\)|\b__t\)) \+\n'';/g,bt=/&(?:amp|lt|gt|quot|#39);/g,xt=/[&<>"']/g,wt=RegExp(bt.source),Et=RegExp(xt.source),kt=/<%-([\s\S]+?)%>/g,Tt=/<%([\s\S]+?)%>/g,St=/<%=([\s\S]+?)%>/g,At=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Ct=/^\w*$/,Rt=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Bt=/[\\^$.*+?()[\]{}|]/g,Pt=RegExp(Bt.source),It=/^\s+|\s+$/g,Mt=/^\s+/,Dt=/\s+$/,Ft=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,Lt=/\{\n\/\* \[wrapped with (.+)\] \*/,Ot=/,? & /,Nt=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,jt=/\\(\\)?/g,Ut=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,zt=/\w*$/,Gt=/^[-+]0x[0-9a-f]+$/i,$t=/^0b[01]+$/i,Vt=/^\[object .+?Constructor\]$/,Xt=/^0o[0-7]+$/i,qt=/^(?:0|[1-9]\d*)$/,Kt=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,Wt=/($^)/,Ht=/['\n\r\u2028\u2029\\]/g,Yt="\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff",Zt="\\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",Jt="[\\ud800-\\udfff]",Qt="["+Zt+"]",te="["+Yt+"]",ee="\\d+",re="[\\u2700-\\u27bf]",ne="[a-z\\xdf-\\xf6\\xf8-\\xff]",ie="[^\\ud800-\\udfff"+Zt+ee+"\\u2700-\\u27bfa-z\\xdf-\\xf6\\xf8-\\xffA-Z\\xc0-\\xd6\\xd8-\\xde]",oe="\\ud83c[\\udffb-\\udfff]",ae="[^\\ud800-\\udfff]",se="(?:\\ud83c[\\udde6-\\uddff]){2}",ue="[\\ud800-\\udbff][\\udc00-\\udfff]",le="[A-Z\\xc0-\\xd6\\xd8-\\xde]",ce="(?:"+ne+"|"+ie+")",he="(?:"+le+"|"+ie+")",pe="(?:"+te+"|"+oe+")"+"?",fe="[\\ufe0e\\ufe0f]?"+pe+("(?:\\u200d(?:"+[ae,se,ue].join("|")+")[\\ufe0e\\ufe0f]?"+pe+")*"),de="(?:"+[re,se,ue].join("|")+")"+fe,me="(?:"+[ae+te+"?",te,se,ue,Jt].join("|")+")",ge=RegExp("['’]","g"),ve=RegExp(te,"g"),_e=RegExp(oe+"(?="+oe+")|"+me+fe,"g"),ye=RegExp([le+"?"+ne+"+(?:['’](?:d|ll|m|re|s|t|ve))?(?="+[Qt,le,"$"].join("|")+")",he+"+(?:['’](?:D|LL|M|RE|S|T|VE))?(?="+[Qt,le+ce,"$"].join("|")+")",le+"?"+ce+"+(?:['’](?:d|ll|m|re|s|t|ve))?",le+"+(?:['’](?: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_])",ee,de].join("|"),"g"),be=RegExp("[\\u200d\\ud800-\\udfff"+Yt+"\\ufe0e\\ufe0f]"),xe=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,we=["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"],Ee=-1,ke={};ke[ut]=ke[lt]=ke[ct]=ke[ht]=ke[pt]=ke[ft]=ke[dt]=ke[mt]=ke[gt]=!0,ke[j]=ke[U]=ke[at]=ke[G]=ke[st]=ke[$]=ke[X]=ke[q]=ke[W]=ke[H]=ke[Z]=ke[Q]=ke[tt]=ke[et]=ke[it]=!1;var Te={};Te[j]=Te[U]=Te[at]=Te[st]=Te[G]=Te[$]=Te[ut]=Te[lt]=Te[ct]=Te[ht]=Te[pt]=Te[W]=Te[H]=Te[Z]=Te[Q]=Te[tt]=Te[et]=Te[rt]=Te[ft]=Te[dt]=Te[mt]=Te[gt]=!0,Te[X]=Te[q]=Te[it]=!1;var Se={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},Ae=parseFloat,Ce=parseInt,Re="object"==typeof t&&t&&t.Object===Object&&t,Be="object"==typeof self&&self&&self.Object===Object&&self,Pe=Re||Be||Function("return this")(),Ie="object"==typeof r&&r&&!r.nodeType&&r,Me=Ie&&"object"==typeof e&&e&&!e.nodeType&&e,De=Me&&Me.exports===Ie,Fe=De&&Re.process,Le=function(){try{var t=Me&&Me.require&&Me.require("util").types;return t||Fe&&Fe.binding&&Fe.binding("util")}catch(t){}}(),Oe=Le&&Le.isArrayBuffer,Ne=Le&&Le.isDate,je=Le&&Le.isMap,Ue=Le&&Le.isRegExp,ze=Le&&Le.isSet,Ge=Le&&Le.isTypedArray;function $e(t,e,r){switch(r.length){case 0:return t.call(e);case 1:return t.call(e,r[0]);case 2:return t.call(e,r[0],r[1]);case 3:return t.call(e,r[0],r[1],r[2])}return t.apply(e,r)}function Ve(t,e,r,n){for(var i=-1,o=null==t?0:t.length;++i-1}function Ye(t,e,r){for(var n=-1,i=null==t?0:t.length;++n-1;);return r}function _r(t,e){for(var r=t.length;r--&&or(e,t[r],0)>-1;);return r}var yr=cr({"À":"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"}),br=cr({"&":"&","<":"<",">":">",'"':""","'":"'"});function xr(t){return"\\"+Se[t]}function wr(t){return be.test(t)}function Er(t){var e=-1,r=Array(t.size);return t.forEach(function(t,n){r[++e]=[n,t]}),r}function kr(t,e){return function(r){return t(e(r))}}function Tr(t,e){for(var r=-1,n=t.length,i=0,o=[];++r",""":'"',"'":"'"});var Pr=function t(e){var r,Yt=(e=null==e?Pe:Pr.defaults(Pe.Object(),e,Pr.pick(Pe,we))).Array,Zt=e.Date,Jt=e.Error,Qt=e.Function,te=e.Math,ee=e.Object,re=e.RegExp,ne=e.String,ie=e.TypeError,oe=Yt.prototype,ae=Qt.prototype,se=ee.prototype,ue=e["__core-js_shared__"],le=ae.toString,ce=se.hasOwnProperty,he=0,pe=(r=/[^.]+$/.exec(ue&&ue.keys&&ue.keys.IE_PROTO||""))?"Symbol(src)_1."+r:"",fe=se.toString,de=le.call(ee),me=Pe._,_e=re("^"+le.call(ce).replace(Bt,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),be=De?e.Buffer:n,Se=e.Symbol,Re=e.Uint8Array,Be=be?be.allocUnsafe:n,Ie=kr(ee.getPrototypeOf,ee),Me=ee.create,Fe=se.propertyIsEnumerable,Le=oe.splice,rr=Se?Se.isConcatSpreadable:n,cr=Se?Se.iterator:n,Ir=Se?Se.toStringTag:n,Mr=function(){try{var t=jo(ee,"defineProperty");return t({},"",{}),t}catch(t){}}(),Dr=e.clearTimeout!==Pe.clearTimeout&&e.clearTimeout,Fr=Zt&&Zt.now!==Pe.Date.now&&Zt.now,Lr=e.setTimeout!==Pe.setTimeout&&e.setTimeout,Or=te.ceil,Nr=te.floor,jr=ee.getOwnPropertySymbols,Ur=be?be.isBuffer:n,zr=e.isFinite,Gr=oe.join,$r=kr(ee.keys,ee),Vr=te.max,Xr=te.min,qr=Zt.now,Kr=e.parseInt,Wr=te.random,Hr=oe.reverse,Yr=jo(e,"DataView"),Zr=jo(e,"Map"),Jr=jo(e,"Promise"),Qr=jo(e,"Set"),tn=jo(e,"WeakMap"),en=jo(ee,"create"),rn=tn&&new tn,nn={},on=ha(Yr),an=ha(Zr),sn=ha(Jr),un=ha(Qr),ln=ha(tn),cn=Se?Se.prototype:n,hn=cn?cn.valueOf:n,pn=cn?cn.toString:n;function fn(t){if(Cs(t)&&!vs(t)&&!(t instanceof vn)){if(t instanceof gn)return t;if(ce.call(t,"__wrapped__"))return pa(t)}return new gn(t)}var dn=function(){function t(){}return function(e){if(!As(e))return{};if(Me)return Me(e);t.prototype=e;var r=new t;return t.prototype=n,r}}();function mn(){}function gn(t,e){this.__wrapped__=t,this.__actions__=[],this.__chain__=!!e,this.__index__=0,this.__values__=n}function vn(t){this.__wrapped__=t,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=F,this.__views__=[]}function _n(t){var e=-1,r=null==t?0:t.length;for(this.clear();++e=e?t:e)),t}function Fn(t,e,r,i,o,a){var s,u=e&c,l=e&h,f=e&p;if(r&&(s=o?r(t,i,o,a):r(t)),s!==n)return s;if(!As(t))return t;var d=vs(t);if(d){if(s=function(t){var e=t.length,r=new t.constructor(e);return e&&"string"==typeof t[0]&&ce.call(t,"index")&&(r.index=t.index,r.input=t.input),r}(t),!u)return ro(t,s)}else{var m=Go(t),g=m==q||m==K;if(xs(t))return Yi(t,u);if(m==Z||m==j||g&&!o){if(s=l||g?{}:Vo(t),!u)return l?function(t,e){return no(t,zo(t),e)}(t,function(t,e){return t&&no(e,ou(e),t)}(s,t)):function(t,e){return no(t,Uo(t),e)}(t,Pn(s,t))}else{if(!Te[m])return o?t:{};s=function(t,e,r){var n,i,o,a=t.constructor;switch(e){case at:return Zi(t);case G:case $:return new a(+t);case st:return function(t,e){var r=e?Zi(t.buffer):t.buffer;return new t.constructor(r,t.byteOffset,t.byteLength)}(t,r);case ut:case lt:case ct:case ht:case pt:case ft:case dt:case mt:case gt:return Ji(t,r);case W:return new a;case H:case et:return new a(t);case Q:return(o=new(i=t).constructor(i.source,zt.exec(i))).lastIndex=i.lastIndex,o;case tt:return new a;case rt:return n=t,hn?ee(hn.call(n)):{}}}(t,m,u)}}a||(a=new wn);var v=a.get(t);if(v)return v;if(a.set(t,s),Ms(t))return t.forEach(function(n){s.add(Fn(n,e,r,n,t,a))}),s;if(Rs(t))return t.forEach(function(n,i){s.set(i,Fn(n,e,r,i,t,a))}),s;var _=d?n:(f?l?Io:Po:l?ou:iu)(t);return Xe(_||t,function(n,i){_&&(n=t[i=n]),Cn(s,i,Fn(n,e,r,i,t,a))}),s}function Ln(t,e,r){var i=r.length;if(null==t)return!i;for(t=ee(t);i--;){var o=r[i],a=e[o],s=t[o];if(s===n&&!(o in t)||!a(s))return!1}return!0}function On(t,e,r){if("function"!=typeof t)throw new ie(a);return ia(function(){t.apply(n,r)},e)}function Nn(t,e,r,n){var o=-1,a=He,s=!0,u=t.length,l=[],c=e.length;if(!u)return l;r&&(e=Ze(e,dr(r))),n?(a=Ye,s=!1):e.length>=i&&(a=gr,s=!1,e=new xn(e));t:for(;++o-1},yn.prototype.set=function(t,e){var r=this.__data__,n=Rn(r,t);return n<0?(++this.size,r.push([t,e])):r[n][1]=e,this},bn.prototype.clear=function(){this.size=0,this.__data__={hash:new _n,map:new(Zr||yn),string:new _n}},bn.prototype.delete=function(t){var e=Oo(this,t).delete(t);return this.size-=e?1:0,e},bn.prototype.get=function(t){return Oo(this,t).get(t)},bn.prototype.has=function(t){return Oo(this,t).has(t)},bn.prototype.set=function(t,e){var r=Oo(this,t),n=r.size;return r.set(t,e),this.size+=r.size==n?0:1,this},xn.prototype.add=xn.prototype.push=function(t){return this.__data__.set(t,s),this},xn.prototype.has=function(t){return this.__data__.has(t)},wn.prototype.clear=function(){this.__data__=new yn,this.size=0},wn.prototype.delete=function(t){var e=this.__data__,r=e.delete(t);return this.size=e.size,r},wn.prototype.get=function(t){return this.__data__.get(t)},wn.prototype.has=function(t){return this.__data__.has(t)},wn.prototype.set=function(t,e){var r=this.__data__;if(r instanceof yn){var n=r.__data__;if(!Zr||n.length0&&r(s)?e>1?Vn(s,e-1,r,n,i):Je(i,s):n||(i[i.length]=s)}return i}var Xn=so(),qn=so(!0);function Kn(t,e){return t&&Xn(t,e,iu)}function Wn(t,e){return t&&qn(t,e,iu)}function Hn(t,e){return We(e,function(e){return ks(t[e])})}function Yn(t,e){for(var r=0,i=(e=qi(e,t)).length;null!=t&&re}function ti(t,e){return null!=t&&ce.call(t,e)}function ei(t,e){return null!=t&&e in ee(t)}function ri(t,e,r){for(var i=r?Ye:He,o=t[0].length,a=t.length,s=a,u=Yt(a),l=1/0,c=[];s--;){var h=t[s];s&&e&&(h=Ze(h,dr(e))),l=Xr(h.length,l),u[s]=!r&&(e||o>=120&&h.length>=120)?new xn(s&&h):n}h=t[0];var p=-1,f=u[0];t:for(;++p=s)return u;var l=r[n];return u*("desc"==l?-1:1)}}return t.index-e.index}(t,e,r)})}function _i(t,e,r){for(var n=-1,i=e.length,o={};++n-1;)s!==t&&Le.call(s,u,1),Le.call(t,u,1);return t}function bi(t,e){for(var r=t?e.length:0,n=r-1;r--;){var i=e[r];if(r==n||i!==o){var o=i;qo(i)?Le.call(t,i,1):Ni(t,i)}}return t}function xi(t,e){return t+Nr(Wr()*(e-t+1))}function wi(t,e){var r="";if(!t||e<1||e>I)return r;do{e%2&&(r+=t),(e=Nr(e/2))&&(t+=t)}while(e);return r}function Ei(t,e){return oa(ta(t,e,Bu),t+"")}function ki(t){return kn(fu(t))}function Ti(t,e){var r=fu(t);return ua(r,Dn(e,0,r.length))}function Si(t,e,r,i){if(!As(t))return t;for(var o=-1,a=(e=qi(e,t)).length,s=a-1,u=t;null!=u&&++oi?0:i+e),(r=r>i?i:r)<0&&(r+=i),i=e>r?0:r-e>>>0,e>>>=0;for(var o=Yt(i);++n>>1,a=t[o];null!==a&&!Fs(a)&&(r?a<=e:a=i){var c=e?null:Eo(t);if(c)return Sr(c);s=!1,o=gr,l=new xn}else l=e?[]:u;t:for(;++n=i?t:Bi(t,e,r)}var Hi=Dr||function(t){return Pe.clearTimeout(t)};function Yi(t,e){if(e)return t.slice();var r=t.length,n=Be?Be(r):new t.constructor(r);return t.copy(n),n}function Zi(t){var e=new t.constructor(t.byteLength);return new Re(e).set(new Re(t)),e}function Ji(t,e){var r=e?Zi(t.buffer):t.buffer;return new t.constructor(r,t.byteOffset,t.length)}function Qi(t,e){if(t!==e){var r=t!==n,i=null===t,o=t==t,a=Fs(t),s=e!==n,u=null===e,l=e==e,c=Fs(e);if(!u&&!c&&!a&&t>e||a&&s&&l&&!u&&!c||i&&s&&l||!r&&l||!o)return 1;if(!i&&!a&&!c&&t1?r[o-1]:n,s=o>2?r[2]:n;for(a=t.length>3&&"function"==typeof a?(o--,a):n,s&&Ko(r[0],r[1],s)&&(a=o<3?n:a,o=1),e=ee(e);++i-1?o[a?e[s]:s]:n}}function po(t){return Bo(function(e){var r=e.length,i=r,o=gn.prototype.thru;for(t&&e.reverse();i--;){var s=e[i];if("function"!=typeof s)throw new ie(a);if(o&&!u&&"wrapper"==Do(s))var u=new gn([],!0)}for(i=u?i:r;++i1&&_.reverse(),h&&lu))return!1;var c=a.get(t);if(c&&a.get(e))return c==e;var h=-1,p=!0,m=r&d?new xn:n;for(a.set(t,e),a.set(e,t);++h-1&&t%1==0&&t1?"& ":"")+e[n],e=e.join(r>2?", ":" "),t.replace(Ft,"{\n/* [wrapped with "+e+"] */\n")}(n,function(t,e){return Xe(N,function(r){var n="_."+r[0];e&r[1]&&!He(t,n)&&t.push(n)}),t.sort()}(function(t){var e=t.match(Lt);return e?e[1].split(Ot):[]}(n),r)))}function sa(t){var e=0,r=0;return function(){var i=qr(),o=C-(i-r);if(r=i,o>0){if(++e>=A)return arguments[0]}else e=0;return t.apply(n,arguments)}}function ua(t,e){var r=-1,i=t.length,o=i-1;for(e=e===n?i:e;++r1?t[e-1]:n;return Ia(t,r="function"==typeof r?(t.pop(),r):n)});function ja(t){var e=fn(t);return e.__chain__=!0,e}function Ua(t,e){return e(t)}var za=Bo(function(t){var e=t.length,r=e?t[0]:0,i=this.__wrapped__,o=function(e){return Mn(e,t)};return!(e>1||this.__actions__.length)&&i instanceof vn&&qo(r)?((i=i.slice(r,+r+(e?1:0))).__actions__.push({func:Ua,args:[o],thisArg:n}),new gn(i,this.__chain__).thru(function(t){return e&&!t.length&&t.push(n),t})):this.thru(o)});var Ga=io(function(t,e,r){ce.call(t,r)?++t[r]:In(t,r,1)});var $a=ho(ga),Va=ho(va);function Xa(t,e){return(vs(t)?Xe:jn)(t,Lo(e,3))}function qa(t,e){return(vs(t)?qe:Un)(t,Lo(e,3))}var Ka=io(function(t,e,r){ce.call(t,r)?t[r].push(e):In(t,r,[e])});var Wa=Ei(function(t,e,r){var n=-1,i="function"==typeof e,o=ys(t)?Yt(t.length):[];return jn(t,function(t){o[++n]=i?$e(e,t,r):ni(t,e,r)}),o}),Ha=io(function(t,e,r){In(t,r,e)});function Ya(t,e){return(vs(t)?Ze:pi)(t,Lo(e,3))}var Za=io(function(t,e,r){t[r?0:1].push(e)},function(){return[[],[]]});var Ja=Ei(function(t,e){if(null==t)return[];var r=e.length;return r>1&&Ko(t,e[0],e[1])?e=[]:r>2&&Ko(e[0],e[1],e[2])&&(e=[e[0]]),vi(t,Vn(e,1),[])}),Qa=Fr||function(){return Pe.Date.now()};function ts(t,e,r){return e=r?n:e,e=t&&null==e?t.length:e,To(t,w,n,n,n,n,e)}function es(t,e){var r;if("function"!=typeof e)throw new ie(a);return t=zs(t),function(){return--t>0&&(r=e.apply(this,arguments)),t<=1&&(e=n),r}}var rs=Ei(function(t,e,r){var n=m;if(r.length){var i=Tr(r,Fo(rs));n|=b}return To(t,n,e,r,i)}),ns=Ei(function(t,e,r){var n=m|g;if(r.length){var i=Tr(r,Fo(ns));n|=b}return To(e,n,t,r,i)});function is(t,e,r){var i,o,s,u,l,c,h=0,p=!1,f=!1,d=!0;if("function"!=typeof t)throw new ie(a);function m(e){var r=i,a=o;return i=o=n,h=e,u=t.apply(a,r)}function g(t){var r=t-c;return c===n||r>=e||r<0||f&&t-h>=s}function v(){var t=Qa();if(g(t))return _(t);l=ia(v,function(t){var r=e-(t-c);return f?Xr(r,s-(t-h)):r}(t))}function _(t){return l=n,d&&i?m(t):(i=o=n,u)}function y(){var t=Qa(),r=g(t);if(i=arguments,o=this,c=t,r){if(l===n)return function(t){return h=t,l=ia(v,e),p?m(t):u}(c);if(f)return l=ia(v,e),m(c)}return l===n&&(l=ia(v,e)),u}return e=$s(e)||0,As(r)&&(p=!!r.leading,s=(f="maxWait"in r)?Vr($s(r.maxWait)||0,e):s,d="trailing"in r?!!r.trailing:d),y.cancel=function(){l!==n&&Hi(l),h=0,i=c=o=l=n},y.flush=function(){return l===n?u:_(Qa())},y}var os=Ei(function(t,e){return On(t,1,e)}),as=Ei(function(t,e,r){return On(t,$s(e)||0,r)});function ss(t,e){if("function"!=typeof t||null!=e&&"function"!=typeof e)throw new ie(a);var r=function(){var n=arguments,i=e?e.apply(this,n):n[0],o=r.cache;if(o.has(i))return o.get(i);var a=t.apply(this,n);return r.cache=o.set(i,a)||o,a};return r.cache=new(ss.Cache||bn),r}function us(t){if("function"!=typeof t)throw new ie(a);return function(){var e=arguments;switch(e.length){case 0:return!t.call(this);case 1:return!t.call(this,e[0]);case 2:return!t.call(this,e[0],e[1]);case 3:return!t.call(this,e[0],e[1],e[2])}return!t.apply(this,e)}}ss.Cache=bn;var ls=Ki(function(t,e){var r=(e=1==e.length&&vs(e[0])?Ze(e[0],dr(Lo())):Ze(Vn(e,1),dr(Lo()))).length;return Ei(function(n){for(var i=-1,o=Xr(n.length,r);++i=e}),gs=ii(function(){return arguments}())?ii:function(t){return Cs(t)&&ce.call(t,"callee")&&!Fe.call(t,"callee")},vs=Yt.isArray,_s=Oe?dr(Oe):function(t){return Cs(t)&&Jn(t)==at};function ys(t){return null!=t&&Ss(t.length)&&!ks(t)}function bs(t){return Cs(t)&&ys(t)}var xs=Ur||$u,ws=Ne?dr(Ne):function(t){return Cs(t)&&Jn(t)==$};function Es(t){if(!Cs(t))return!1;var e=Jn(t);return e==X||e==V||"string"==typeof t.message&&"string"==typeof t.name&&!Ps(t)}function ks(t){if(!As(t))return!1;var e=Jn(t);return e==q||e==K||e==z||e==J}function Ts(t){return"number"==typeof t&&t==zs(t)}function Ss(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=I}function As(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)}function Cs(t){return null!=t&&"object"==typeof t}var Rs=je?dr(je):function(t){return Cs(t)&&Go(t)==W};function Bs(t){return"number"==typeof t||Cs(t)&&Jn(t)==H}function Ps(t){if(!Cs(t)||Jn(t)!=Z)return!1;var e=Ie(t);if(null===e)return!0;var r=ce.call(e,"constructor")&&e.constructor;return"function"==typeof r&&r instanceof r&&le.call(r)==de}var Is=Ue?dr(Ue):function(t){return Cs(t)&&Jn(t)==Q};var Ms=ze?dr(ze):function(t){return Cs(t)&&Go(t)==tt};function Ds(t){return"string"==typeof t||!vs(t)&&Cs(t)&&Jn(t)==et}function Fs(t){return"symbol"==typeof t||Cs(t)&&Jn(t)==rt}var Ls=Ge?dr(Ge):function(t){return Cs(t)&&Ss(t.length)&&!!ke[Jn(t)]};var Os=bo(hi),Ns=bo(function(t,e){return t<=e});function js(t){if(!t)return[];if(ys(t))return Ds(t)?Rr(t):ro(t);if(cr&&t[cr])return function(t){for(var e,r=[];!(e=t.next()).done;)r.push(e.value);return r}(t[cr]());var e=Go(t);return(e==W?Er:e==tt?Sr:fu)(t)}function Us(t){return t?(t=$s(t))===P||t===-P?(t<0?-1:1)*M:t==t?t:0:0===t?t:0}function zs(t){var e=Us(t),r=e%1;return e==e?r?e-r:e:0}function Gs(t){return t?Dn(zs(t),0,F):0}function $s(t){if("number"==typeof t)return t;if(Fs(t))return D;if(As(t)){var e="function"==typeof t.valueOf?t.valueOf():t;t=As(e)?e+"":e}if("string"!=typeof t)return 0===t?t:+t;t=t.replace(It,"");var r=$t.test(t);return r||Xt.test(t)?Ce(t.slice(2),r?2:8):Gt.test(t)?D:+t}function Vs(t){return no(t,ou(t))}function Xs(t){return null==t?"":Li(t)}var qs=oo(function(t,e){if(Zo(e)||ys(e))no(e,iu(e),t);else for(var r in e)ce.call(e,r)&&Cn(t,r,e[r])}),Ks=oo(function(t,e){no(e,ou(e),t)}),Ws=oo(function(t,e,r,n){no(e,ou(e),t,n)}),Hs=oo(function(t,e,r,n){no(e,iu(e),t,n)}),Ys=Bo(Mn);var Zs=Ei(function(t,e){t=ee(t);var r=-1,i=e.length,o=i>2?e[2]:n;for(o&&Ko(e[0],e[1],o)&&(i=1);++r1),e}),no(t,Io(t),r),n&&(r=Fn(r,c|h|p,Co));for(var i=e.length;i--;)Ni(r,e[i]);return r});var lu=Bo(function(t,e){return null==t?{}:function(t,e){return _i(t,e,function(e,r){return tu(t,r)})}(t,e)});function cu(t,e){if(null==t)return{};var r=Ze(Io(t),function(t){return[t]});return e=Lo(e),_i(t,r,function(t,r){return e(t,r[0])})}var hu=ko(iu),pu=ko(ou);function fu(t){return null==t?[]:mr(t,iu(t))}var du=lo(function(t,e,r){return e=e.toLowerCase(),t+(r?mu(e):e)});function mu(t){return Eu(Xs(t).toLowerCase())}function gu(t){return(t=Xs(t))&&t.replace(Kt,yr).replace(ve,"")}var vu=lo(function(t,e,r){return t+(r?"-":"")+e.toLowerCase()}),_u=lo(function(t,e,r){return t+(r?" ":"")+e.toLowerCase()}),yu=uo("toLowerCase");var bu=lo(function(t,e,r){return t+(r?"_":"")+e.toLowerCase()});var xu=lo(function(t,e,r){return t+(r?" ":"")+Eu(e)});var wu=lo(function(t,e,r){return t+(r?" ":"")+e.toUpperCase()}),Eu=uo("toUpperCase");function ku(t,e,r){return t=Xs(t),(e=r?n:e)===n?function(t){return xe.test(t)}(t)?function(t){return t.match(ye)||[]}(t):function(t){return t.match(Nt)||[]}(t):t.match(e)||[]}var Tu=Ei(function(t,e){try{return $e(t,n,e)}catch(t){return Es(t)?t:new Jt(t)}}),Su=Bo(function(t,e){return Xe(e,function(e){e=ca(e),In(t,e,rs(t[e],t))}),t});function Au(t){return function(){return t}}var Cu=po(),Ru=po(!0);function Bu(t){return t}function Pu(t){return ui("function"==typeof t?t:Fn(t,c))}var Iu=Ei(function(t,e){return function(r){return ni(r,t,e)}}),Mu=Ei(function(t,e){return function(r){return ni(t,r,e)}});function Du(t,e,r){var n=iu(e),i=Hn(e,n);null!=r||As(e)&&(i.length||!n.length)||(r=e,e=t,t=this,i=Hn(e,iu(e)));var o=!(As(r)&&"chain"in r&&!r.chain),a=ks(t);return Xe(i,function(r){var n=e[r];t[r]=n,a&&(t.prototype[r]=function(){var e=this.__chain__;if(o||e){var r=t(this.__wrapped__);return(r.__actions__=ro(this.__actions__)).push({func:n,args:arguments,thisArg:t}),r.__chain__=e,r}return n.apply(t,Je([this.value()],arguments))})}),t}function Fu(){}var Lu=vo(Ze),Ou=vo(Ke),Nu=vo(er);function ju(t){return Wo(t)?lr(ca(t)):function(t){return function(e){return Yn(e,t)}}(t)}var Uu=yo(),zu=yo(!0);function Gu(){return[]}function $u(){return!1}var Vu=go(function(t,e){return t+e},0),Xu=wo("ceil"),qu=go(function(t,e){return t/e},1),Ku=wo("floor");var Wu,Hu=go(function(t,e){return t*e},1),Yu=wo("round"),Zu=go(function(t,e){return t-e},0);return fn.after=function(t,e){if("function"!=typeof e)throw new ie(a);return t=zs(t),function(){if(--t<1)return e.apply(this,arguments)}},fn.ary=ts,fn.assign=qs,fn.assignIn=Ks,fn.assignInWith=Ws,fn.assignWith=Hs,fn.at=Ys,fn.before=es,fn.bind=rs,fn.bindAll=Su,fn.bindKey=ns,fn.castArray=function(){if(!arguments.length)return[];var t=arguments[0];return vs(t)?t:[t]},fn.chain=ja,fn.chunk=function(t,e,r){e=(r?Ko(t,e,r):e===n)?1:Vr(zs(e),0);var i=null==t?0:t.length;if(!i||e<1)return[];for(var o=0,a=0,s=Yt(Or(i/e));oo?0:o+r),(i=i===n||i>o?o:zs(i))<0&&(i+=o),i=r>i?0:Gs(i);r>>0)?(t=Xs(t))&&("string"==typeof e||null!=e&&!Is(e))&&!(e=Li(e))&&wr(t)?Wi(Rr(t),0,r):t.split(e,r):[]},fn.spread=function(t,e){if("function"!=typeof t)throw new ie(a);return e=null==e?0:Vr(zs(e),0),Ei(function(r){var n=r[e],i=Wi(r,0,e);return n&&Je(i,n),$e(t,this,i)})},fn.tail=function(t){var e=null==t?0:t.length;return e?Bi(t,1,e):[]},fn.take=function(t,e,r){return t&&t.length?Bi(t,0,(e=r||e===n?1:zs(e))<0?0:e):[]},fn.takeRight=function(t,e,r){var i=null==t?0:t.length;return i?Bi(t,(e=i-(e=r||e===n?1:zs(e)))<0?0:e,i):[]},fn.takeRightWhile=function(t,e){return t&&t.length?Ui(t,Lo(e,3),!1,!0):[]},fn.takeWhile=function(t,e){return t&&t.length?Ui(t,Lo(e,3)):[]},fn.tap=function(t,e){return e(t),t},fn.throttle=function(t,e,r){var n=!0,i=!0;if("function"!=typeof t)throw new ie(a);return As(r)&&(n="leading"in r?!!r.leading:n,i="trailing"in r?!!r.trailing:i),is(t,e,{leading:n,maxWait:e,trailing:i})},fn.thru=Ua,fn.toArray=js,fn.toPairs=hu,fn.toPairsIn=pu,fn.toPath=function(t){return vs(t)?Ze(t,ca):Fs(t)?[t]:ro(la(Xs(t)))},fn.toPlainObject=Vs,fn.transform=function(t,e,r){var n=vs(t),i=n||xs(t)||Ls(t);if(e=Lo(e,4),null==r){var o=t&&t.constructor;r=i?n?new o:[]:As(t)&&ks(o)?dn(Ie(t)):{}}return(i?Xe:Kn)(t,function(t,n,i){return e(r,t,n,i)}),r},fn.unary=function(t){return ts(t,1)},fn.union=Ca,fn.unionBy=Ra,fn.unionWith=Ba,fn.uniq=function(t){return t&&t.length?Oi(t):[]},fn.uniqBy=function(t,e){return t&&t.length?Oi(t,Lo(e,2)):[]},fn.uniqWith=function(t,e){return e="function"==typeof e?e:n,t&&t.length?Oi(t,n,e):[]},fn.unset=function(t,e){return null==t||Ni(t,e)},fn.unzip=Pa,fn.unzipWith=Ia,fn.update=function(t,e,r){return null==t?t:ji(t,e,Xi(r))},fn.updateWith=function(t,e,r,i){return i="function"==typeof i?i:n,null==t?t:ji(t,e,Xi(r),i)},fn.values=fu,fn.valuesIn=function(t){return null==t?[]:mr(t,ou(t))},fn.without=Ma,fn.words=ku,fn.wrap=function(t,e){return cs(Xi(e),t)},fn.xor=Da,fn.xorBy=Fa,fn.xorWith=La,fn.zip=Oa,fn.zipObject=function(t,e){return $i(t||[],e||[],Cn)},fn.zipObjectDeep=function(t,e){return $i(t||[],e||[],Si)},fn.zipWith=Na,fn.entries=hu,fn.entriesIn=pu,fn.extend=Ks,fn.extendWith=Ws,Du(fn,fn),fn.add=Vu,fn.attempt=Tu,fn.camelCase=du,fn.capitalize=mu,fn.ceil=Xu,fn.clamp=function(t,e,r){return r===n&&(r=e,e=n),r!==n&&(r=(r=$s(r))==r?r:0),e!==n&&(e=(e=$s(e))==e?e:0),Dn($s(t),e,r)},fn.clone=function(t){return Fn(t,p)},fn.cloneDeep=function(t){return Fn(t,c|p)},fn.cloneDeepWith=function(t,e){return Fn(t,c|p,e="function"==typeof e?e:n)},fn.cloneWith=function(t,e){return Fn(t,p,e="function"==typeof e?e:n)},fn.conformsTo=function(t,e){return null==e||Ln(t,e,iu(e))},fn.deburr=gu,fn.defaultTo=function(t,e){return null==t||t!=t?e:t},fn.divide=qu,fn.endsWith=function(t,e,r){t=Xs(t),e=Li(e);var i=t.length,o=r=r===n?i:Dn(zs(r),0,i);return(r-=e.length)>=0&&t.slice(r,o)==e},fn.eq=fs,fn.escape=function(t){return(t=Xs(t))&&Et.test(t)?t.replace(xt,br):t},fn.escapeRegExp=function(t){return(t=Xs(t))&&Pt.test(t)?t.replace(Bt,"\\$&"):t},fn.every=function(t,e,r){var i=vs(t)?Ke:zn;return r&&Ko(t,e,r)&&(e=n),i(t,Lo(e,3))},fn.find=$a,fn.findIndex=ga,fn.findKey=function(t,e){return nr(t,Lo(e,3),Kn)},fn.findLast=Va,fn.findLastIndex=va,fn.findLastKey=function(t,e){return nr(t,Lo(e,3),Wn)},fn.floor=Ku,fn.forEach=Xa,fn.forEachRight=qa,fn.forIn=function(t,e){return null==t?t:Xn(t,Lo(e,3),ou)},fn.forInRight=function(t,e){return null==t?t:qn(t,Lo(e,3),ou)},fn.forOwn=function(t,e){return t&&Kn(t,Lo(e,3))},fn.forOwnRight=function(t,e){return t&&Wn(t,Lo(e,3))},fn.get=Qs,fn.gt=ds,fn.gte=ms,fn.has=function(t,e){return null!=t&&$o(t,e,ti)},fn.hasIn=tu,fn.head=ya,fn.identity=Bu,fn.includes=function(t,e,r,n){t=ys(t)?t:fu(t),r=r&&!n?zs(r):0;var i=t.length;return r<0&&(r=Vr(i+r,0)),Ds(t)?r<=i&&t.indexOf(e,r)>-1:!!i&&or(t,e,r)>-1},fn.indexOf=function(t,e,r){var n=null==t?0:t.length;if(!n)return-1;var i=null==r?0:zs(r);return i<0&&(i=Vr(n+i,0)),or(t,e,i)},fn.inRange=function(t,e,r){return e=Us(e),r===n?(r=e,e=0):r=Us(r),function(t,e,r){return t>=Xr(e,r)&&t=-I&&t<=I},fn.isSet=Ms,fn.isString=Ds,fn.isSymbol=Fs,fn.isTypedArray=Ls,fn.isUndefined=function(t){return t===n},fn.isWeakMap=function(t){return Cs(t)&&Go(t)==it},fn.isWeakSet=function(t){return Cs(t)&&Jn(t)==ot},fn.join=function(t,e){return null==t?"":Gr.call(t,e)},fn.kebabCase=vu,fn.last=Ea,fn.lastIndexOf=function(t,e,r){var i=null==t?0:t.length;if(!i)return-1;var o=i;return r!==n&&(o=(o=zs(r))<0?Vr(i+o,0):Xr(o,i-1)),e==e?function(t,e,r){for(var n=r+1;n--;)if(t[n]===e)return n;return n}(t,e,o):ir(t,sr,o,!0)},fn.lowerCase=_u,fn.lowerFirst=yu,fn.lt=Os,fn.lte=Ns,fn.max=function(t){return t&&t.length?Gn(t,Bu,Qn):n},fn.maxBy=function(t,e){return t&&t.length?Gn(t,Lo(e,2),Qn):n},fn.mean=function(t){return ur(t,Bu)},fn.meanBy=function(t,e){return ur(t,Lo(e,2))},fn.min=function(t){return t&&t.length?Gn(t,Bu,hi):n},fn.minBy=function(t,e){return t&&t.length?Gn(t,Lo(e,2),hi):n},fn.stubArray=Gu,fn.stubFalse=$u,fn.stubObject=function(){return{}},fn.stubString=function(){return""},fn.stubTrue=function(){return!0},fn.multiply=Hu,fn.nth=function(t,e){return t&&t.length?gi(t,zs(e)):n},fn.noConflict=function(){return Pe._===this&&(Pe._=me),this},fn.noop=Fu,fn.now=Qa,fn.pad=function(t,e,r){t=Xs(t);var n=(e=zs(e))?Cr(t):0;if(!e||n>=e)return t;var i=(e-n)/2;return _o(Nr(i),r)+t+_o(Or(i),r)},fn.padEnd=function(t,e,r){t=Xs(t);var n=(e=zs(e))?Cr(t):0;return e&&ne){var i=t;t=e,e=i}if(r||t%1||e%1){var o=Wr();return Xr(t+o*(e-t+Ae("1e-"+((o+"").length-1))),e)}return xi(t,e)},fn.reduce=function(t,e,r){var n=vs(t)?Qe:hr,i=arguments.length<3;return n(t,Lo(e,4),r,i,jn)},fn.reduceRight=function(t,e,r){var n=vs(t)?tr:hr,i=arguments.length<3;return n(t,Lo(e,4),r,i,Un)},fn.repeat=function(t,e,r){return e=(r?Ko(t,e,r):e===n)?1:zs(e),wi(Xs(t),e)},fn.replace=function(){var t=arguments,e=Xs(t[0]);return t.length<3?e:e.replace(t[1],t[2])},fn.result=function(t,e,r){var i=-1,o=(e=qi(e,t)).length;for(o||(o=1,t=n);++iI)return[];var r=F,n=Xr(t,F);e=Lo(e),t-=F;for(var i=fr(n,e);++r=a)return t;var u=r-Cr(i);if(u<1)return i;var l=s?Wi(s,0,u).join(""):t.slice(0,u);if(o===n)return l+i;if(s&&(u+=l.length-u),Is(o)){if(t.slice(u).search(o)){var c,h=l;for(o.global||(o=re(o.source,Xs(zt.exec(o))+"g")),o.lastIndex=0;c=o.exec(h);)var p=c.index;l=l.slice(0,p===n?u:p)}}else if(t.indexOf(Li(o),u)!=u){var f=l.lastIndexOf(o);f>-1&&(l=l.slice(0,f))}return l+i},fn.unescape=function(t){return(t=Xs(t))&&wt.test(t)?t.replace(bt,Br):t},fn.uniqueId=function(t){var e=++he;return Xs(t)+e},fn.upperCase=wu,fn.upperFirst=Eu,fn.each=Xa,fn.eachRight=qa,fn.first=ya,Du(fn,(Wu={},Kn(fn,function(t,e){ce.call(fn.prototype,e)||(Wu[e]=t)}),Wu),{chain:!1}),fn.VERSION="4.17.11",Xe(["bind","bindKey","curry","curryRight","partial","partialRight"],function(t){fn[t].placeholder=fn}),Xe(["drop","take"],function(t,e){vn.prototype[t]=function(r){r=r===n?1:Vr(zs(r),0);var i=this.__filtered__&&!e?new vn(this):this.clone();return i.__filtered__?i.__takeCount__=Xr(r,i.__takeCount__):i.__views__.push({size:Xr(r,F),type:t+(i.__dir__<0?"Right":"")}),i},vn.prototype[t+"Right"]=function(e){return this.reverse()[t](e).reverse()}}),Xe(["filter","map","takeWhile"],function(t,e){var r=e+1,n=r==R||3==r;vn.prototype[t]=function(t){var e=this.clone();return e.__iteratees__.push({iteratee:Lo(t,3),type:r}),e.__filtered__=e.__filtered__||n,e}}),Xe(["head","last"],function(t,e){var r="take"+(e?"Right":"");vn.prototype[t]=function(){return this[r](1).value()[0]}}),Xe(["initial","tail"],function(t,e){var r="drop"+(e?"":"Right");vn.prototype[t]=function(){return this.__filtered__?new vn(this):this[r](1)}}),vn.prototype.compact=function(){return this.filter(Bu)},vn.prototype.find=function(t){return this.filter(t).head()},vn.prototype.findLast=function(t){return this.reverse().find(t)},vn.prototype.invokeMap=Ei(function(t,e){return"function"==typeof t?new vn(this):this.map(function(r){return ni(r,t,e)})}),vn.prototype.reject=function(t){return this.filter(us(Lo(t)))},vn.prototype.slice=function(t,e){t=zs(t);var r=this;return r.__filtered__&&(t>0||e<0)?new vn(r):(t<0?r=r.takeRight(-t):t&&(r=r.drop(t)),e!==n&&(r=(e=zs(e))<0?r.dropRight(-e):r.take(e-t)),r)},vn.prototype.takeRightWhile=function(t){return this.reverse().takeWhile(t).reverse()},vn.prototype.toArray=function(){return this.take(F)},Kn(vn.prototype,function(t,e){var r=/^(?:filter|find|map|reject)|While$/.test(e),i=/^(?:head|last)$/.test(e),o=fn[i?"take"+("last"==e?"Right":""):e],a=i||/^find/.test(e);o&&(fn.prototype[e]=function(){var e=this.__wrapped__,s=i?[1]:arguments,u=e instanceof vn,l=s[0],c=u||vs(e),h=function(t){var e=o.apply(fn,Je([t],s));return i&&p?e[0]:e};c&&r&&"function"==typeof l&&1!=l.length&&(u=c=!1);var p=this.__chain__,f=!!this.__actions__.length,d=a&&!p,m=u&&!f;if(!a&&c){e=m?e:new vn(this);var g=t.apply(e,s);return g.__actions__.push({func:Ua,args:[h],thisArg:n}),new gn(g,p)}return d&&m?t.apply(this,s):(g=this.thru(h),d?i?g.value()[0]:g.value():g)})}),Xe(["pop","push","shift","sort","splice","unshift"],function(t){var e=oe[t],r=/^(?:push|sort|unshift)$/.test(t)?"tap":"thru",n=/^(?:pop|shift)$/.test(t);fn.prototype[t]=function(){var t=arguments;if(n&&!this.__chain__){var i=this.value();return e.apply(vs(i)?i:[],t)}return this[r](function(r){return e.apply(vs(r)?r:[],t)})}}),Kn(vn.prototype,function(t,e){var r=fn[e];if(r){var n=r.name+"";(nn[n]||(nn[n]=[])).push({name:e,func:r})}}),nn[fo(n,g).name]=[{name:"wrapper",func:n}],vn.prototype.clone=function(){var t=new vn(this.__wrapped__);return t.__actions__=ro(this.__actions__),t.__dir__=this.__dir__,t.__filtered__=this.__filtered__,t.__iteratees__=ro(this.__iteratees__),t.__takeCount__=this.__takeCount__,t.__views__=ro(this.__views__),t},vn.prototype.reverse=function(){if(this.__filtered__){var t=new vn(this);t.__dir__=-1,t.__filtered__=!0}else(t=this.clone()).__dir__*=-1;return t},vn.prototype.value=function(){var t=this.__wrapped__.value(),e=this.__dir__,r=vs(t),n=e<0,i=r?t.length:0,o=function(t,e,r){for(var n=-1,i=r.length;++n=this.__values__.length;return{done:t,value:t?n:this.__values__[this.__index__++]}},fn.prototype.plant=function(t){for(var e,r=this;r instanceof mn;){var i=pa(r);i.__index__=0,i.__values__=n,e?o.__wrapped__=i:e=i;var o=i;r=r.__wrapped__}return o.__wrapped__=t,e},fn.prototype.reverse=function(){var t=this.__wrapped__;if(t instanceof vn){var e=t;return this.__actions__.length&&(e=new vn(this)),(e=e.reverse()).__actions__.push({func:Ua,args:[Aa],thisArg:n}),new gn(e,this.__chain__)}return this.thru(Aa)},fn.prototype.toJSON=fn.prototype.valueOf=fn.prototype.value=function(){return zi(this.__wrapped__,this.__actions__)},fn.prototype.first=fn.prototype.head,cr&&(fn.prototype[cr]=function(){return this}),fn}();"function"==typeof define&&"object"==typeof define.amd&&define.amd?(Pe._=Pr,define(function(){return Pr})):Me?((Me.exports=Pr)._=Pr,Ie._=Pr):Pe._=Pr}).call(this)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],102:[function(t,e,r){(function(r){t("path");var n=t("fs");function i(){this.types=Object.create(null),this.extensions=Object.create(null)}i.prototype.define=function(t){for(var e in t){for(var n=t[e],i=0;i>",rrshift:">>>"};!function(){for(var t in s){var e=s[t];r[t]=a({args:["array","array","array"],body:{args:["a","b","c"],body:"a=b"+e+"c"},funcName:t}),r[t+"eq"]=a({args:["array","array"],body:{args:["a","b"],body:"a"+e+"=b"},rvalue:!0,funcName:t+"eq"}),r[t+"s"]=a({args:["array","array","scalar"],body:{args:["a","b","s"],body:"a=b"+e+"s"},funcName:t+"s"}),r[t+"seq"]=a({args:["array","scalar"],body:{args:["a","s"],body:"a"+e+"=s"},rvalue:!0,funcName:t+"seq"})}}();var u={not:"!",bnot:"~",neg:"-",recip:"1.0/"};!function(){for(var t in u){var e=u[t];r[t]=a({args:["array","array"],body:{args:["a","b"],body:"a="+e+"b"},funcName:t}),r[t+"eq"]=a({args:["array"],body:{args:["a"],body:"a="+e+"a"},rvalue:!0,count:2,funcName:t+"eq"})}}();var l={and:"&&",or:"||",eq:"===",neq:"!==",lt:"<",gt:">",leq:"<=",geq:">="};!function(){for(var t in l){var e=l[t];r[t]=a({args:["array","array","array"],body:{args:["a","b","c"],body:"a=b"+e+"c"},funcName:t}),r[t+"s"]=a({args:["array","array","scalar"],body:{args:["a","b","s"],body:"a=b"+e+"s"},funcName:t+"s"}),r[t+"eq"]=a({args:["array","array"],body:{args:["a","b"],body:"a=a"+e+"b"},rvalue:!0,count:2,funcName:t+"eq"}),r[t+"seq"]=a({args:["array","scalar"],body:{args:["a","s"],body:"a=a"+e+"s"},rvalue:!0,count:2,funcName:t+"seq"})}}();var c=["abs","acos","asin","atan","ceil","cos","exp","floor","log","round","sin","sqrt","tan"];!function(){for(var t=0;tthis_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=a({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=a({args:["array","array"],body:{args:["a","b"],body:"a=b"},funcName:"assign"}),r.assigns=a({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":15}],105:[function(t,e,r){"use strict";var n=t("ndarray"),i=t("./doConvert.js");e.exports=function(t,e){for(var r=[],o=t,a=1;Array.isArray(o);)r.push(o.length),a*=o.length,o=o[0];return 0===r.length?n():(e||(e=n(new Float64Array(a),r)),i(e,t),e)}},{"./doConvert.js":106,ndarray:107}],106:[function(t,e,r){e.exports=t("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":15}],107:[function(t,e,r){var n=t("iota-array"),i=t("is-buffer"),o="undefined"!=typeof Float64Array;function a(t,e){return t[0]-e[0]}function s(){var t,e=this.stride,r=new Array(e.length);for(t=0;tMath.abs(this.stride[1]))?[1,0]:[0,1]}})"):3===e&&o.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];}}})")):o.push("ORDER})")),o.push("proto.set=function "+r+"_set("+u.join(",")+",v){"),i?o.push("return this.data.set("+c+",v)}"):o.push("return this.data["+c+"]=v}"),o.push("proto.get=function "+r+"_get("+u.join(",")+"){"),i?o.push("return this.data.get("+c+")}"):o.push("return this.data["+c+"]}"),o.push("proto.index=function "+r+"_index(",u.join(),"){return "+c+"}"),o.push("proto.hi=function "+r+"_hi("+u.join(",")+"){return new "+r+"(this.data,"+a.map(function(t){return["(typeof i",t,"!=='number'||i",t,"<0)?this.shape[",t,"]:i",t,"|0"].join("")}).join(",")+","+a.map(function(t){return"this.stride["+t+"]"}).join(",")+",this.offset)}");var f=a.map(function(t){return"a"+t+"=this.shape["+t+"]"}),d=a.map(function(t){return"c"+t+"=this.stride["+t+"]"});o.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}");o.push("return new "+r+"(this.data,"+a.map(function(t){return"a"+t}).join(",")+","+a.map(function(t){return"c"+t}).join(",")+",b)}"),o.push("proto.step=function "+r+"_step("+u.join(",")+"){var "+a.map(function(t){return"a"+t+"=this.shape["+t+"]"}).join(",")+","+a.map(function(t){return"b"+t+"=this.stride["+t+"]"}).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 o.push("var ctor=CTOR_LIST[a.length+1];return ctor(this.data,a,b,c)}"),o.push("return function construct_"+r+"(data,shape,stride,offset){return new "+r+"(data,"+a.map(function(t){return"shape["+t+"]"}).join(",")+","+a.map(function(t){return"stride["+t+"]"}).join(",")+",offset)}"),new Function("CTOR_LIST","ORDER",o.join("\n"))(l[t],s)}var l={float32:[],float64:[],int8:[],int16:[],int32:[],uint8:[],uint16:[],uint32:[],array:[],uint8_clamped:[],buffer:[],generic:[]};e.exports=function(t,e,r,n){if(void 0===t)return(0,l.array[0])([]);"number"==typeof t&&(t=[t]),void 0===e&&(e=[t.length]);var a=e.length;if(void 0===r){r=new Array(a);for(var s=a-1,c=1;s>=0;--s)r[s]=c,c*=e[s]}if(void 0===n)for(n=0,s=0;s0&&(this._paused=!1,this.emit("drain"))}.bind(this))},a.prototype.write=function(t,e){return this.writable?(n.isBuffer(t)||(t=new n(t,e||this._encoding)),this._buffers.push(t),this._buffered+=t.length,this._process(),this._reads&&0==this._reads.length&&(this._paused=!0),this.writable&&!this._paused):(this.emit("error",new Error("Stream not writable")),!1)},a.prototype.end=function(t,e){t&&this.write(t,e),this.writable=!1,this._buffers&&(0==this._buffers.length?this._end():(this._buffers.push(null),this._process()))},a.prototype.destroySoon=a.prototype.end,a.prototype._end=function(){this._reads.length>0&&this.emit("error",new Error("There are some read requests waitng on finished stream")),this.destroy()},a.prototype.destroy=function(){this._buffers&&(this.writable=!1,this._reads=null,this._buffers=null,this.emit("close"))},a.prototype._process=function(){for(;this._buffered>0&&this._reads&&this._reads.length>0;){var t=this._reads[0];if(t.allowLess){this._reads.shift(),(o=this._buffers[0]).length>t.length?(this._buffered-=t.length,this._buffers[0]=o.slice(t.length),t.func.call(this,o.slice(0,t.length))):(this._buffered-=o.length,this._buffers.shift(),t.func.call(this,o))}else{if(!(this._buffered>=t.length))break;this._reads.shift();for(var e=0,r=0,i=new n(t.length);e0&&this._buffers.splice(0,r),this._buffered-=t.length,t.func.call(this,i)}}this._buffers&&this._buffers.length>0&&null==this._buffers[0]&&this._end()}}).call(this,t("_process"),t("buffer").Buffer)},{_process:139,buffer:73,stream:190,util:200}],109:[function(t,e,r){"use strict";e.exports={PNG_SIGNATURE:[137,80,78,71,13,10,26,10],TYPE_IHDR:1229472850,TYPE_IEND:1229278788,TYPE_IDAT:1229209940,TYPE_PLTE:1347179589,TYPE_tRNS:1951551059,TYPE_gAMA:1732332865,COLOR_PALETTE:1,COLOR_COLOR:2,COLOR_ALPHA:4}},{}],110:[function(t,e,r){"use strict";var n=t("util"),i=t("stream"),o=e.exports=function(){i.call(this),this._crc=-1,this.writable=!0};n.inherits(o,i),o.prototype.write=function(t){for(var e=0;e>>8;return!0},o.prototype.end=function(t){t&&this.write(t),this.emit("crc",this.crc32())},o.prototype.crc32=function(){return-1^this._crc},o.crc32=function(t){for(var e=-1,r=0;r>>8;return-1^e};for(var a=[],s=0;s<256;s++){for(var u=s,l=0;l<8;l++)1&u?u=3988292384^u>>>1:u>>>=1;a[s]=u}},{stream:190,util:200}],111:[function(t,e,r){(function(r){"use strict";var n=t("util"),i=(t("zlib"),t("./chunkstream")),o=e.exports=function(t,e,r,n,o){i.call(this),this._width=t,this._height=e,this._Bpp=r,this._data=n,this._options=o,this._line=0,"filterType"in o&&-1!=o.filterType?"number"==typeof o.filterType&&(o.filterType=[o.filterType]):o.filterType=[0,1,2,3,4],this._filters={0:this._filterNone.bind(this),1:this._filterSub.bind(this),2:this._filterUp.bind(this),3:this._filterAvg.bind(this),4:this._filterPaeth.bind(this)},this.read(this._width*r+1,this._reverseFilterLine.bind(this))};n.inherits(o,i);var a={1:{0:0,1:0,2:0,3:255},2:{0:0,1:0,2:0,3:1},3:{0:0,1:1,2:2,3:255},4:{0:0,1:1,2:2,3:3}};o.prototype._reverseFilterLine=function(t){var e=this._data,r=this._width<<2,n=this._line*r,i=t[0];if(0==i)for(var o=0;o0?e[u+c-4]:0;e[u+c]=255!=h?t[l+h]+p:255}else if(2==i)for(o=0;o0?e[u-r+c]:0;e[u+c]=255!=h?t[l+h]+f:255}else if(3==i)for(o=0;o0?e[u+c-4]:0,f=this._line>0?e[u-r+c]:0;var d=Math.floor((p+f)/2);e[u+c]=255!=h?t[l+h]+d:255}else if(4==i)for(o=0;o0?e[u+c-4]:0,f=this._line>0?e[u-r+c]:0;var m=o>0&&this._line>0?e[u-r+c-4]:0;d=s(p,f,m);e[u+c]=255!=h?t[l+h]+d:255}this._line++,this._line=4?t[e*n+a-4]:0,u=t[e*n+a]-s;r?r[e*i+1+a]=u:o+=Math.abs(u)}return o},o.prototype._filterUp=function(t,e,r){var n=this._width<<2,i=n+1,o=0;r&&(r[e*i]=2);for(var a=0;a0?t[(e-1)*n+a]:0,u=t[e*n+a]-s;r?r[e*i+1+a]=u:o+=Math.abs(u)}return o},o.prototype._filterAvg=function(t,e,r){var n=this._width<<2,i=n+1,o=0;r&&(r[e*i]=3);for(var a=0;a=4?t[e*n+a-4]:0,u=e>0?t[(e-1)*n+a]:0,l=t[e*n+a]-(s+u>>1);r?r[e*i+1+a]=l:o+=Math.abs(l)}return o},o.prototype._filterPaeth=function(t,e,r){var n=this._width<<2,i=n+1,o=0;r&&(r[e*i]=4);for(var a=0;a=4?t[e*n+a-4]:0,l=e>0?t[(e-1)*n+a]:0,c=a>=4&&e>0?t[(e-1)*n+a-4]:0,h=t[e*n+a]-s(u,l,c);r?r[e*i+1+a]=h:o+=Math.abs(h)}return o};var s=function(t,e,r){var n=t+e-r,i=Math.abs(n-t),o=Math.abs(n-e),a=Math.abs(n-r);return i<=o&&i<=a?t:o<=a?e:r}}).call(this,t("buffer").Buffer)},{"./chunkstream":108,buffer:73,util:200,zlib:71}],112:[function(t,e,r){(function(r){"use strict";var n=t("util"),i=t("stream"),o=t("zlib"),a=t("./filter"),s=t("./crc"),u=t("./constants"),l=e.exports=function(t){i.call(this),this._options=t,t.deflateChunkSize=t.deflateChunkSize||32768,t.deflateLevel=t.deflateLevel||9,t.deflateStrategy=t.deflateStrategy||3,this.readable=!0};n.inherits(l,i),l.prototype.pack=function(t,e,n){this.emit("data",new r(u.PNG_SIGNATURE)),this.emit("data",this._packIHDR(e,n));t=new a(e,n,4,t,this._options).filter();var i=o.createDeflate({chunkSize:this._options.deflateChunkSize,level:this._options.deflateLevel,strategy:this._options.deflateStrategy});i.on("error",this.emit.bind(this,"error")),i.on("data",function(t){this.emit("data",this._packIDAT(t))}.bind(this)),i.on("end",function(){this.emit("data",this._packIEND()),this.emit("end")}.bind(this)),i.end(t)},l.prototype._packChunk=function(t,e){var n=e?e.length:0,i=new r(n+12);return i.writeUInt32BE(n,0),i.writeUInt32BE(t,4),e&&e.copy(i,8),i.writeInt32BE(s.crc32(i.slice(4,i.length-4)),i.length-4),i},l.prototype._packIHDR=function(t,e){var n=new r(13);return n.writeUInt32BE(t,0),n.writeUInt32BE(e,4),n[8]=8,n[9]=6,n[10]=0,n[11]=0,n[12]=0,this._packChunk(u.TYPE_IHDR,n)},l.prototype._packIDAT=function(t){return this._packChunk(u.TYPE_IDAT,t)},l.prototype._packIEND=function(){return this._packChunk(u.TYPE_IEND,null)}}).call(this,t("buffer").Buffer)},{"./constants":109,"./crc":110,"./filter":111,buffer:73,stream:190,util:200,zlib:71}],113:[function(t,e,r){(function(r){"use strict";var n=t("util"),i=t("zlib"),o=t("./crc"),a=t("./chunkstream"),s=t("./constants"),u=t("./filter"),l=e.exports=function(t){a.call(this),this._options=t,t.checkCRC=!1!==t.checkCRC,this._hasIHDR=!1,this._hasIEND=!1,this._inflate=null,this._filter=null,this._crc=null,this._palette=[],this._colorType=0,this._chunks={},this._chunks[s.TYPE_IHDR]=this._handleIHDR.bind(this),this._chunks[s.TYPE_IEND]=this._handleIEND.bind(this),this._chunks[s.TYPE_IDAT]=this._handleIDAT.bind(this),this._chunks[s.TYPE_PLTE]=this._handlePLTE.bind(this),this._chunks[s.TYPE_tRNS]=this._handleTRNS.bind(this),this._chunks[s.TYPE_gAMA]=this._handleGAMA.bind(this),this.writable=!0,this.on("error",this._handleError.bind(this)),this._handleSignature()};n.inherits(l,a),l.prototype._handleError=function(){this.writable=!1,this.destroy(),this._inflate&&this._inflate.destroy()},l.prototype._handleSignature=function(){this.read(s.PNG_SIGNATURE.length,this._parseSignature.bind(this))},l.prototype._parseSignature=function(t){for(var e=s.PNG_SIGNATURE,r=0;rthis._palette.length)return void this.emit("error",new Error("More transparent colors than palette size"));for(var e=0;e0?this._handleIDAT(t):this._handleChunkEnd()},l.prototype._handleIEND=function(t){this.read(t,this._parseIEND.bind(this))},l.prototype._parseIEND=function(t){this._crc.write(t),this._inflate.end(),this._hasIEND=!0,this._handleChunkEnd()};var c={0:1,2:3,3:1,4:2,6:4};l.prototype._reverseFiltered=function(t,e,r){if(3==this._colorType)for(var n=e<<2,i=0;i0&&this.height>0?new n(4*this.width*this.height):null,t.fill&&this.data&&this.data.fill(0),this.gamma=0,this.readable=this.writable=!0,this._parser=new a(t||{}),this._parser.on("error",this.emit.bind(this,"error")),this._parser.on("close",this._handleClose.bind(this)),this._parser.on("metadata",this._metadata.bind(this)),this._parser.on("gamma",this._gamma.bind(this)),this._parser.on("parsed",function(t){this.data=t,this.emit("parsed",t)}.bind(this)),this._packer=new s(t),this._packer.on("data",this.emit.bind(this,"data")),this._packer.on("end",this.emit.bind(this,"end")),this._parser.on("close",this._handleClose.bind(this)),this._packer.on("error",this.emit.bind(this,"error"))};i.inherits(u,o),u.prototype.pack=function(){return e.nextTick(function(){this._packer.pack(this.data,this.width,this.height)}.bind(this)),this},u.prototype.parse=function(t,e){if(e){var r,n=null;this.once("parsed",r=function(t){this.removeListener("error",n),this.data=t,e(null,this)}.bind(this)),this.once("error",n=function(t){this.removeListener("parsed",r),e(t,null)}.bind(this))}return this.end(t),this},u.prototype.write=function(t){return this._parser.write(t),!0},u.prototype.end=function(t){this._parser.end(t)},u.prototype._metadata=function(t){this.width=t.width,this.height=t.height,this.data=t.data,delete t.data,this.emit("metadata",t)},u.prototype._gamma=function(t){this.gamma=t},u.prototype._handleClose=function(){this._parser.writable||this._packer.readable||this.emit("close")},u.prototype.bitblt=function(t,e,r,n,i,o,a){if(e>this.width||r>this.height||e+n>this.width||r+i>this.height)throw new Error("bitblt reading outside image");if(o>t.width||a>t.height||o+n>t.width||a+i>t.height)throw new Error("bitblt writing outside image");for(var s=0;s>=u,c-=u,g!==o){if(g===a)break;for(var v=go;)y=d[y]>>8,++_;var b=y;if(p+_+(v!==g?1:0)>n)return void console.log("Warning, gif stream longer than expected.");r[p++]=b;var x=p+=_;for(v!==g&&(r[p++]=b),y=v;_--;)y=d[y],r[--x]=255&y,y>>=8;null!==m&&s<4096&&(d[s++]=m<<8|b,s>=l+1&&u<12&&(++u,l=l<<1|1)),m=g}else s=a+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(t,e,r,n){var i=0,o=void 0===(n=void 0===n?{}:n).loop?null:n.loop,a=void 0===n.palette?null:n.palette;if(e<=0||r<=0||e>65535||r>65535)throw new Error("Width/Height invalid.");function s(t){var e=t.length;if(e<2||e>256||e&e-1)throw new Error("Invalid code/color length, must be power of 2 and 2 .. 256.");return e}t[i++]=71,t[i++]=73,t[i++]=70,t[i++]=56,t[i++]=57,t[i++]=97;var u=0,l=0;if(null!==a){for(var c=s(a);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(t[i++]=255&e,t[i++]=e>>8&255,t[i++]=255&r,t[i++]=r>>8&255,t[i++]=(null!==a?128:0)|u,t[i++]=l,t[i++]=0,null!==a)for(var h=0,p=a.length;h>16&255,t[i++]=f>>8&255,t[i++]=255&f}if(null!==o){if(o<0||o>65535)throw new Error("Loop count invalid.");t[i++]=33,t[i++]=255,t[i++]=11,t[i++]=78,t[i++]=69,t[i++]=84,t[i++]=83,t[i++]=67,t[i++]=65,t[i++]=80,t[i++]=69,t[i++]=50,t[i++]=46,t[i++]=48,t[i++]=3,t[i++]=1,t[i++]=255&o,t[i++]=o>>8&255,t[i++]=0}var d=!1;this.addFrame=function(e,r,n,o,u,l){if(!0===d&&(--i,d=!1),l=void 0===l?{}:l,e<0||r<0||e>65535||r>65535)throw new Error("x/y invalid.");if(n<=0||o<=0||n>65535||o>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,_=0;if(void 0!==l.transparent&&null!==l.transparent&&(v=!0,(_=l.transparent)<0||_>=p))throw new Error("Transparent color index.");if((0!==g||v||0!==m)&&(t[i++]=33,t[i++]=249,t[i++]=4,t[i++]=g<<2|(!0===v?1:0),t[i++]=255&m,t[i++]=m>>8&255,t[i++]=_,t[i++]=0),t[i++]=44,t[i++]=255&e,t[i++]=e>>8&255,t[i++]=255&r,t[i++]=r>>8&255,t[i++]=255&n,t[i++]=n>>8&255,t[i++]=255&o,t[i++]=o>>8&255,t[i++]=!0===c?128|f-1:0,!0===c)for(var y=0,b=h.length;y>16&255,t[i++]=x>>8&255,t[i++]=255&x}return i=function(t,e,r,n){t[e++]=r;var i=e++,o=1<=r;)t[e++]=255&h,h>>=8,c-=8,e===i+256&&(t[i]=255,i=e++)}function f(t){h|=t<=8;)t[e++]=255&h,h>>=8,c-=8,e===i+256&&(t[i]=255,i=e++);4096===u?(f(o),u=s+1,l=r+1,m={}):(u>=1<>7,s=1<<1+(7&o);t[e++],t[e++];var u=null,l=null;a&&(u=e,l=s,e+=3*s);var c=!0,h=[],p=0,f=null,d=0,m=null;for(this.width=r,this.height=i;c&&e=0))throw Error("Invalid block size");if(0===C)break;e+=C}break;case 249:if(4!==t[e++]||0!==t[e+4])throw new Error("Invalid graphics extension block.");var g=t[e++];p=t[e++]|t[e++]<<8,f=t[e++],0==(1&g)&&(f=null),d=g>>2&7,e++;break;case 254:for(;;){if(!((C=t[e++])>=0))throw Error("Invalid block size");if(0===C)break;e+=C}break;default:throw new Error("Unknown graphic control label: 0x"+t[e-1].toString(16))}break;case 44:var v=t[e++]|t[e++]<<8,_=t[e++]|t[e++]<<8,y=t[e++]|t[e++]<<8,b=t[e++]|t[e++]<<8,x=t[e++],w=x>>6&1,E=1<<1+(7&x),k=u,T=l,S=!1;x>>7&&(S=!0,k=e,T=E,e+=3*E);var A=e;for(e++;;){var C;if(!((C=t[e++])>=0))throw Error("Invalid block size");if(0===C)break;e+=C}h.push({x:v,y:_,width:y,height:b,has_local_palette:S,palette_offset:k,palette_size:T,data_offset:A,data_length:e-A,transparent_index:f,interlaced:!!w,delay:p,disposal:d});break;case 59:c=!1;break;default:throw new Error("Unknown gif block: 0x"+t[e-1].toString(16))}this.numFrames=function(){return h.length},this.loopCount=function(){return m},this.frameInfo=function(t){if(t<0||t>=h.length)throw new Error("Frame index out of range.");return h[t]},this.decodeAndBlitFrameBGRA=function(e,i){var o=this.frameInfo(e),a=o.width*o.height,s=new Uint8Array(a);n(t,o.data_offset,s,a);var u=o.palette_offset,l=o.transparent_index;null===l&&(l=256);var c=o.width,h=r-c,p=c,f=4*(o.y*r+o.x),d=4*((o.y+o.height)*r+o.x),m=f,g=4*h;!0===o.interlaced&&(g+=4*r*7);for(var v=8,_=0,y=s.length;_=d&&(g=4*h+4*r*(v-1),m=f+(c+h)*(v<<1),v>>=1)),b===l)m+=4;else{var x=t[u+3*b],w=t[u+3*b+1],E=t[u+3*b+2];i[m++]=E,i[m++]=w,i[m++]=x,i[m++]=255}--p}},this.decodeAndBlitFrameRGBA=function(e,i){var o=this.frameInfo(e),a=o.width*o.height,s=new Uint8Array(a);n(t,o.data_offset,s,a);var u=o.palette_offset,l=o.transparent_index;null===l&&(l=256);var c=o.width,h=r-c,p=c,f=4*(o.y*r+o.x),d=4*((o.y+o.height)*r+o.x),m=f,g=4*h;!0===o.interlaced&&(g+=4*r*7);for(var v=8,_=0,y=s.length;_=d&&(g=4*h+4*r*(v-1),m=f+(c+h)*(v<<1),v>>=1)),b===l)m+=4;else{var x=t[u+3*b],w=t[u+3*b+1],E=t[u+3*b+2];i[m++]=x,i[m++]=w,i[m++]=E,i[m++]=255}--p}}}}catch(t){}},{}],116:[function(t,e,r){(function(r){var n=t("charm");function i(t){if(!(t=t||{}).total)throw new Error("You MUST specify the total number of operations that will be processed.");this.total=t.total,this.current=0,this.max_burden=t.maxBurden||.5,this.show_burden=t.showBurden||!1,this.started=!1,this.size=50,this.inner_time=0,this.outer_time=0,this.elapsed=0,this.time_start=0,this.time_end=0,this.time_left=0,this.time_burden=0,this.skip_steps=0,this.skipped=0,this.aborted=!1,this.charm=n(),this.charm.pipe(r.stdout),this.charm.write("\n\n\n")}function o(t,e,r){for(r=r||" ";t.length3&&(u[0]=u[0].replace(/\B(?=(?:\d{3})+(?!\d))/g,a)),(u[1]||"").length=this.total&&this.finished(),this.time_end=(new Date).getTime(),this.inner_time=this.time_end-this.time_start)},i.prototype.updateTimes=function(){this.elapsed=this.time_start-this.started,this.time_end>0&&(this.outer_time=this.time_start-this.time_end),this.inner_time>0&&this.outer_time>0&&(this.time_burden=this.inner_time/(this.inner_time+this.outer_time)*100,this.time_left=this.elapsed/this.current*(this.total-this.current),this.time_left<0&&(this.time_left=0)),this.time_burden>this.max_burden&&this.skip_steps0&&this.current=0;n--){var i=t[n];"."===i?t.splice(n,1):".."===i?(t.splice(n,1),r++):r&&(t.splice(n,1),r--)}if(e)for(;r--;r)t.unshift("..");return t}function n(t,e){if(t.filter)return t.filter(e);for(var r=[],n=0;n=-1&&!i;o--){var a=o>=0?arguments[o]:t.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=e(n(r.split("/"),function(t){return!!t}),!i).join("/"),(i?"/":"")+r||"."},r.normalize=function(t){var o=r.isAbsolute(t),a="/"===i(t,-1);return(t=e(n(t.split("/"),function(t){return!!t}),!o).join("/"))||o||(t="."),t&&a&&(t+="/"),(o?"/":"")+t},r.isAbsolute=function(t){return"/"===t.charAt(0)},r.join=function(){var t=Array.prototype.slice.call(arguments,0);return r.normalize(n(t,function(t,e){if("string"!=typeof t)throw new TypeError("Arguments to path.join must be strings");return t}).join("/"))},r.relative=function(t,e){function n(t){for(var e=0;e=0&&""===t[r];r--);return e>r?[]:t.slice(e,r-e+1)}t=r.resolve(t).substr(1),e=r.resolve(e).substr(1);for(var i=n(t.split("/")),o=n(e.split("/")),a=Math.min(i.length,o.length),s=a,u=0;u=1;--o)if(47===(e=t.charCodeAt(o))){if(!i){n=o;break}}else i=!1;return-1===n?r?"/":".":r&&1===n?"/":t.slice(0,n)},r.basename=function(t,e){var r=function(t){"string"!=typeof t&&(t+="");var e,r=0,n=-1,i=!0;for(e=t.length-1;e>=0;--e)if(47===t.charCodeAt(e)){if(!i){r=e+1;break}}else-1===n&&(i=!1,n=e+1);return-1===n?"":t.slice(r,n)}(t);return e&&r.substr(-1*e.length)===e&&(r=r.substr(0,r.length-e.length)),r},r.extname=function(t){"string"!=typeof t&&(t+="");for(var e=-1,r=0,n=-1,i=!0,o=0,a=t.length-1;a>=0;--a){var s=t.charCodeAt(a);if(47!==s)-1===n&&(i=!1,n=a+1),46===s?-1===e?e=a:1!==o&&(o=1):-1!==e&&(o=-1);else if(!i){r=a+1;break}}return-1===e||-1===n||0===o||1===o&&e===n-1&&e===r+1?"":t.slice(e,n)};var i="b"==="ab".substr(-1)?function(t,e,r){return t.substr(e,r)}:function(t,e,r){return e<0&&(e=t.length+e),t.substr(e,r)}}).call(this,t("_process"))},{_process:139}],118:[function(t,e,r){(function(e){"use strict";var n=t("./interlace"),i={1:{0:0,1:0,2:0,3:255},2:{0:0,1:0,2:0,3:1},3:{0:0,1:1,2:2,3:255},4:{0:0,1:1,2:2,3:3}};function o(t,e,r,n,o,a){for(var s=t.width,u=t.height,l=t.index,c=0;c>4,r.push(h,c);break;case 2:u=3&p,l=p>>2&3,c=p>>4&3,h=p>>6&3,r.push(h,c,l,u);break;case 1:i=1&p,o=p>>1&1,a=p>>2&1,s=p>>3&1,u=p>>4&1,l=p>>5&1,c=p>>6&1,h=p>>7&1,r.push(h,c,l,u,s,a,o,i)}}return{get:function(t){for(;r.length0&&(this._paused=!1,this.emit("drain"))}.bind(this))},a.prototype.write=function(t,e){return this.writable?(r=n.isBuffer(t)?t:new n(t,e||this._encoding),this._buffers.push(r),this._buffered+=r.length,this._process(),this._reads&&0===this._reads.length&&(this._paused=!0),this.writable&&!this._paused):(this.emit("error",new Error("Stream not writable")),!1);var r},a.prototype.end=function(t,e){t&&this.write(t,e),this.writable=!1,this._buffers&&(0===this._buffers.length?this._end():(this._buffers.push(null),this._process()))},a.prototype.destroySoon=a.prototype.end,a.prototype._end=function(){this._reads.length>0&&this.emit("error",new Error("There are some read requests waitng on finished stream")),this.destroy()},a.prototype.destroy=function(){this._buffers&&(this.writable=!1,this._reads=null,this._buffers=null,this.emit("close"))},a.prototype._processReadAllowingLess=function(t){this._reads.shift();var e=this._buffers[0];e.length>t.length?(this._buffered-=t.length,this._buffers[0]=e.slice(t.length),t.func.call(this,e.slice(0,t.length))):(this._buffered-=e.length,this._buffers.shift(),t.func.call(this,e))},a.prototype._processRead=function(t){this._reads.shift();for(var e=0,r=0,i=new n(t.length);e0&&this._buffers.splice(0,r),this._buffered-=t.length,t.func.call(this,i)},a.prototype._process=function(){try{for(;this._buffered>0&&this._reads&&this._reads.length>0;){var t=this._reads[0];if(t.allowLess)this._processReadAllowingLess(t);else{if(!(this._buffered>=t.length))break;this._processRead(t)}}this._buffers&&this._buffers.length>0&&null===this._buffers[0]&&this._end()}catch(t){this.emit("error",t)}}}).call(this,t("_process"),t("buffer").Buffer)},{_process:139,buffer:73,stream:190,util:200}],121:[function(t,e,r){"use strict";e.exports={PNG_SIGNATURE:[137,80,78,71,13,10,26,10],TYPE_IHDR:1229472850,TYPE_IEND:1229278788,TYPE_IDAT:1229209940,TYPE_PLTE:1347179589,TYPE_tRNS:1951551059,TYPE_gAMA:1732332865,COLORTYPE_GRAYSCALE:0,COLORTYPE_PALETTE:1,COLORTYPE_COLOR:2,COLORTYPE_ALPHA:4,COLORTYPE_PALETTE_COLOR:3,COLORTYPE_COLOR_ALPHA:6,COLORTYPE_TO_BPP_MAP:{0:1,2:3,3:1,4:2,6:4},GAMMA_DIVISION:1e5}},{}],122:[function(t,e,r){"use strict";var n=[];!function(){for(var t=0;t<256;t++){for(var e=t,r=0;r<8;r++)1&e?e=3988292384^e>>>1:e>>>=1;n[t]=e}}();var i=e.exports=function(){this._crc=-1};i.prototype.write=function(t){for(var e=0;e>>8;return!0},i.prototype.crc32=function(){return-1^this._crc},i.crc32=function(t){for(var e=-1,r=0;r>>8;return-1^e}},{}],123:[function(t,e,r){(function(r){"use strict";var n=t("./paeth-predictor");var i={0:function(t,e,r,n,i){t.copy(n,i,e,e+r)},1:function(t,e,r,n,i,o){for(var a=0;a=o?t[e+a-o]:0,u=t[e+a]-s;n[i+a]=u}},2:function(t,e,r,n,i){for(var o=0;o0?t[e+o-r]:0,s=t[e+o]-a;n[i+o]=s}},3:function(t,e,r,n,i,o){for(var a=0;a=o?t[e+a-o]:0,u=e>0?t[e+a-r]:0,l=t[e+a]-(s+u>>1);n[i+a]=l}},4:function(t,e,r,i,o,a){for(var s=0;s=a?t[e+s-a]:0,l=e>0?t[e+s-r]:0,c=e>0&&s>=a?t[e+s-(r+a)]:0,h=t[e+s]-n(u,l,c);i[o+s]=h}}},o={0:function(t,e,r){for(var n=0,i=e+r,o=e;o=n?t[e+o-n]:0,s=t[e+o]-a;i+=Math.abs(s)}return i},2:function(t,e,r){for(var n=0,i=e+r,o=e;o0?t[o-r]:0,s=t[o]-a;n+=Math.abs(s)}return n},3:function(t,e,r,n){for(var i=0,o=0;o=n?t[e+o-n]:0,s=e>0?t[e+o-r]:0,u=t[e+o]-(a+s>>1);i+=Math.abs(u)}return i},4:function(t,e,r,i){for(var o=0,a=0;a=i?t[e+a-i]:0,u=e>0?t[e+a-r]:0,l=e>0&&a>=i?t[e+a-(r+i)]:0,c=t[e+a]-n(s,u,l);o+=Math.abs(c)}return o}};e.exports=function(t,e,n,a,s){var u;if("filterType"in a&&-1!==a.filterType){if("number"!=typeof a.filterType)throw new Error("unrecognised filter types");u=[a.filterType]}else u=[0,1,2,3,4];for(var l=e*s,c=0,h=0,p=new r((l+1)*n),f=u[0],d=0;d1)for(var m=1/0,g=0;gi?e[o-n]:0;e[o]=a+s}},a.prototype._unFilterType2=function(t,e,r){for(var n=this._lastLine,i=0;ii?e[a-n]:0,c=Math.floor((l+u)/2);e[a]=s+c}},a.prototype._unFilterType4=function(t,e,r){for(var n=this._xComparison,o=n-1,a=this._lastLine,s=0;so?e[s-n]:0,h=s>o&&a?a[s-n]:0,p=i(c,l,h);e[s]=u+p}},a.prototype._reverseFilterLine=function(t){var e,n=t[0],i=this._images[this._imageIndex],o=i.byteWidth;if(0===n)e=t.slice(1,o+1);else switch(e=new r(o),n){case 1:this._unFilterType1(t,e,o);break;case 2:this._unFilterType2(t,e,o);break;case 3:this._unFilterType3(t,e,o);break;case 4:this._unFilterType4(t,e,o);break;default:throw new Error("Unrecognised filter type - "+n)}this.write(e),i.lineIndex++,i.lineIndex>=i.height?(this._lastLine=null,this._imageIndex++,i=this._images[this._imageIndex]):this._lastLine=e,i?this.read(i.byteWidth+1,this._reverseFilterLine.bind(this)):(this._lastLine=null,this.complete())}}).call(this,t("buffer").Buffer)},{"./interlace":128,"./paeth-predictor":132,buffer:73}],127:[function(t,e,r){(function(t){"use strict";e.exports=function(e,r){var n=r.depth,i=r.width,o=r.height,a=r.colorType,s=r.transColor,u=r.palette,l=e;return 3===a?function(t,e,r,n,i){for(var o=0,a=0;a0&&h>0&&r.push({width:c,height:h,index:u})}return r},r.getInterlaceIterator=function(t){return function(e,r,i){var o=e%n[i].x.length,a=(e-o)/n[i].x.length*8+n[i].x[o],s=r%n[i].y.length;return 4*a+((r-s)/n[i].y.length*8+n[i].y[s])*t*4}}},{}],129:[function(t,e,r){(function(r){"use strict";var n=t("util"),i=t("stream"),o=t("./constants"),a=t("./packer"),s=e.exports=function(t){i.call(this);var e=t||{};this._packer=new a(e),this._deflate=this._packer.createDeflate(),this.readable=!0};n.inherits(s,i),s.prototype.pack=function(t,e,n,i){this.emit("data",new r(o.PNG_SIGNATURE)),this.emit("data",this._packer.packIHDR(e,n)),i&&this.emit("data",this._packer.packGAMA(i));var a=this._packer.filterData(t,e,n);this._deflate.on("error",this.emit.bind(this,"error")),this._deflate.on("data",function(t){this.emit("data",this._packer.packIDAT(t))}.bind(this)),this._deflate.on("end",function(){this.emit("data",this._packer.packIEND()),this.emit("end")}.bind(this)),this._deflate.end(a)}}).call(this,t("buffer").Buffer)},{"./constants":121,"./packer":131,buffer:73,stream:190,util:200}],130:[function(t,e,r){(function(r){"use strict";var n=!0,i=t("zlib");i.deflateSync||(n=!1);var o=t("./constants"),a=t("./packer");e.exports=function(t,e){if(!n)throw new Error("To use the sync capability of this library in old node versions, please also add a dependency on node-zlb-backport");var s=new a(e||{}),u=[];u.push(new r(o.PNG_SIGNATURE)),u.push(s.packIHDR(t.width,t.height)),t.gamma&&u.push(s.packGAMA(t.gamma));var l=s.filterData(t.data,t.width,t.height),c=i.deflateSync(l,s.getDeflateOptions());if(l=null,!c||!c.length)throw new Error("bad png - invalid compressed data response");return u.push(s.packIDAT(c)),u.push(s.packIEND()),r.concat(u)}}).call(this,t("buffer").Buffer)},{"./constants":121,"./packer":131,buffer:73,zlib:71}],131:[function(t,e,r){(function(r){"use strict";var n=t("./constants"),i=t("./crc"),o=t("./bitpacker"),a=t("./filter-pack"),s=t("zlib"),u=e.exports=function(t){if(this._options=t,t.deflateChunkSize=t.deflateChunkSize||32768,t.deflateLevel=null!=t.deflateLevel?t.deflateLevel:9,t.deflateStrategy=null!=t.deflateStrategy?t.deflateStrategy:3,t.inputHasAlpha=null==t.inputHasAlpha||t.inputHasAlpha,t.deflateFactory=t.deflateFactory||s.createDeflate,t.bitDepth=t.bitDepth||8,t.colorType="number"==typeof t.colorType?t.colorType:n.COLORTYPE_COLOR_ALPHA,t.colorType!==n.COLORTYPE_COLOR&&t.colorType!==n.COLORTYPE_COLOR_ALPHA)throw new Error("option color type:"+t.colorType+" is not supported at present");if(8!==t.bitDepth)throw new Error("option bit depth:"+t.bitDepth+" is not supported at present")};u.prototype.getDeflateOptions=function(){return{chunkSize:this._options.deflateChunkSize,level:this._options.deflateLevel,strategy:this._options.deflateStrategy}},u.prototype.createDeflate=function(){return this._options.deflateFactory(this.getDeflateOptions())},u.prototype.filterData=function(t,e,r){var i=o(t,e,r,this._options),s=n.COLORTYPE_TO_BPP_MAP[this._options.colorType];return a(i,e,r,this._options,s)},u.prototype._packChunk=function(t,e){var n=e?e.length:0,o=new r(n+12);return o.writeUInt32BE(n,0),o.writeUInt32BE(t,4),e&&e.copy(o,8),o.writeInt32BE(i.crc32(o.slice(4,o.length-4)),o.length-4),o},u.prototype.packGAMA=function(t){var e=new r(4);return e.writeUInt32BE(Math.floor(t*n.GAMMA_DIVISION),0),this._packChunk(n.TYPE_gAMA,e)},u.prototype.packIHDR=function(t,e){var i=new r(13);return i.writeUInt32BE(t,0),i.writeUInt32BE(e,4),i[8]=this._options.bitDepth,i[9]=this._options.colorType,i[10]=0,i[11]=0,i[12]=0,this._packChunk(n.TYPE_IHDR,i)},u.prototype.packIDAT=function(t){return this._packChunk(n.TYPE_IDAT,t)},u.prototype.packIEND=function(){return this._packChunk(n.TYPE_IEND,null)}}).call(this,t("buffer").Buffer)},{"./bitpacker":119,"./constants":121,"./crc":122,"./filter-pack":123,buffer:73,zlib:71}],132:[function(t,e,r){"use strict";e.exports=function(t,e,r){var n=t+e-r,i=Math.abs(n-t),o=Math.abs(n-e),a=Math.abs(n-r);return i<=o&&i<=a?t:o<=a?e:r}},{}],133:[function(t,e,r){"use strict";var n=t("util"),i=t("zlib"),o=t("./chunkstream"),a=t("./filter-parse-async"),s=t("./parser"),u=t("./bitmapper"),l=t("./format-normaliser"),c=e.exports=function(t){o.call(this),this._parser=new s(t,{read:this.read.bind(this),error:this._handleError.bind(this),metadata:this._handleMetaData.bind(this),gamma:this.emit.bind(this,"gamma"),palette:this._handlePalette.bind(this),transColor:this._handleTransColor.bind(this),finished:this._finished.bind(this),inflateData:this._inflateData.bind(this)}),this._options=t,this.writable=!0,this._parser.start()};n.inherits(c,o),c.prototype._handleError=function(t){this.emit("error",t),this.writable=!1,this.destroy(),this._inflate&&this._inflate.destroy&&this._inflate.destroy(),this.errord=!0},c.prototype._inflateData=function(t){this._inflate||(this._inflate=i.createInflate(),this._inflate.on("error",this.emit.bind(this,"error")),this._filter.on("complete",this._complete.bind(this)),this._inflate.pipe(this._filter)),this._inflate.write(t)},c.prototype._handleMetaData=function(t){this.emit("metadata",t),this._bitmapInfo=Object.create(t),this._filter=new a(this._bitmapInfo)},c.prototype._handleTransColor=function(t){this._bitmapInfo.transColor=t},c.prototype._handlePalette=function(t){this._bitmapInfo.palette=t},c.prototype._finished=function(){this.errord||(this._inflate?this._inflate.end():this.emit("error","No Inflate block"),this.destroySoon())},c.prototype._complete=function(t){if(!this.errord){try{var e=u.dataToBitMap(t,this._bitmapInfo),r=l(e,this._bitmapInfo);e=null}catch(t){return void this._handleError(t)}this.emit("parsed",r)}}},{"./bitmapper":118,"./chunkstream":120,"./filter-parse-async":124,"./format-normaliser":127,"./parser":135,util:200,zlib:71}],134:[function(t,e,r){(function(r){"use strict";var n=!0,i=t("zlib");i.deflateSync||(n=!1);var o=t("./sync-reader"),a=t("./filter-parse-sync"),s=t("./parser"),u=t("./bitmapper"),l=t("./format-normaliser");e.exports=function(t,e){if(!n)throw new Error("To use the sync capability of this library in old node versions, please also add a dependency on node-zlb-backport");var c,h,p;var f=[];var d=new o(t);if(new s(e,{read:d.read.bind(d),error:function(t){c=t},metadata:function(t){h=t},gamma:function(t){p=t},palette:function(t){h.palette=t},transColor:function(t){h.transColor=t},inflateData:function(t){f.push(t)}}).start(),d.process(),c)throw c;var m=r.concat(f);f.length=0;var g=i.inflateSync(m);if(m=null,!g||!g.length)throw new Error("bad png - invalid inflate data response");var v=a.process(g,h);m=null;var _=u.dataToBitMap(v,h);v=null;var y=l(_,h);return h.data=y,h.gamma=p||0,h}}).call(this,t("buffer").Buffer)},{"./bitmapper":118,"./filter-parse-sync":125,"./format-normaliser":127,"./parser":135,"./sync-reader":138,buffer:73,zlib:71}],135:[function(t,e,r){(function(r){"use strict";var n=t("./constants"),i=t("./crc"),o=e.exports=function(t,e){this._options=t,t.checkCRC=!1!==t.checkCRC,this._hasIHDR=!1,this._hasIEND=!1,this._palette=[],this._colorType=0,this._chunks={},this._chunks[n.TYPE_IHDR]=this._handleIHDR.bind(this),this._chunks[n.TYPE_IEND]=this._handleIEND.bind(this),this._chunks[n.TYPE_IDAT]=this._handleIDAT.bind(this),this._chunks[n.TYPE_PLTE]=this._handlePLTE.bind(this),this._chunks[n.TYPE_tRNS]=this._handleTRNS.bind(this),this._chunks[n.TYPE_gAMA]=this._handleGAMA.bind(this),this.read=e.read,this.error=e.error,this.metadata=e.metadata,this.gamma=e.gamma,this.transColor=e.transColor,this.palette=e.palette,this.parsed=e.parsed,this.inflateData=e.inflateData,this.inflateData=e.inflateData,this.finished=e.finished};o.prototype.start=function(){this.read(n.PNG_SIGNATURE.length,this._parseSignature.bind(this))},o.prototype._parseSignature=function(t){for(var e=n.PNG_SIGNATURE,r=0;rthis._palette.length)return void this.error(new Error("More transparent colors than palette size"));for(var e=0;e0?this._handleIDAT(r):this._handleChunkEnd()},o.prototype._handleIEND=function(t){this.read(t,this._parseIEND.bind(this))},o.prototype._parseIEND=function(t){this._crc.write(t),this._hasIEND=!0,this._handleChunkEnd(),this.finished&&this.finished()}}).call(this,t("buffer").Buffer)},{"./constants":121,"./crc":122,buffer:73}],136:[function(t,e,r){"use strict";var n=t("./parser-sync"),i=t("./packer-sync");r.read=function(t,e){return n(t,e||{})},r.write=function(t){return i(t)}},{"./packer-sync":130,"./parser-sync":134}],137:[function(t,e,r){(function(e,n){"use strict";var i=t("util"),o=t("stream"),a=t("./parser-async"),s=t("./packer-async"),u=t("./png-sync"),l=r.PNG=function(t){o.call(this),t=t||{},this.width=t.width||0,this.height=t.height||0,this.data=this.width>0&&this.height>0?new n(4*this.width*this.height):null,t.fill&&this.data&&this.data.fill(0),this.gamma=0,this.readable=this.writable=!0,this._parser=new a(t),this._parser.on("error",this.emit.bind(this,"error")),this._parser.on("close",this._handleClose.bind(this)),this._parser.on("metadata",this._metadata.bind(this)),this._parser.on("gamma",this._gamma.bind(this)),this._parser.on("parsed",function(t){this.data=t,this.emit("parsed",t)}.bind(this)),this._packer=new s(t),this._packer.on("data",this.emit.bind(this,"data")),this._packer.on("end",this.emit.bind(this,"end")),this._parser.on("close",this._handleClose.bind(this)),this._packer.on("error",this.emit.bind(this,"error"))};i.inherits(l,o),l.sync=u,l.prototype.pack=function(){return this.data&&this.data.length?(e.nextTick(function(){this._packer.pack(this.data,this.width,this.height,this.gamma)}.bind(this)),this):(this.emit("error","No data provided"),this)},l.prototype.parse=function(t,e){var r,n;e&&(r=function(t){this.removeListener("error",n),this.data=t,e(null,this)}.bind(this),n=function(t){this.removeListener("parsed",r),e(t,null)}.bind(this),this.once("parsed",r),this.once("error",n));return this.end(t),this},l.prototype.write=function(t){return this._parser.write(t),!0},l.prototype.end=function(t){this._parser.end(t)},l.prototype._metadata=function(t){this.width=t.width,this.height=t.height,this.emit("metadata",t)},l.prototype._gamma=function(t){this.gamma=t},l.prototype._handleClose=function(){this._parser.writable||this._packer.readable||this.emit("close")},l.bitblt=function(t,e,r,n,i,o,a,s){if(r>t.width||n>t.height||r+i>t.width||n+o>t.height)throw new Error("bitblt reading outside image");if(a>e.width||s>e.height||a+i>e.width||s+o>e.height)throw new Error("bitblt writing outside image");for(var u=0;u0&&this._buffer.length;){var t=this._reads[0];if(!this._buffer.length||!(this._buffer.length>=t.length||t.allowLess))break;this._reads.shift();var e=this._buffer;this._buffer=e.slice(t.length),t.func.call(this,e.slice(0,t.length))}return this._reads.length>0?new Error("There are some read requests waitng on finished stream"):this._buffer.length>0?new Error("unrecognised content at end of stream"):void 0}},{}],139:[function(t,e,r){var n,i,o=e.exports={};function a(){throw new Error("setTimeout has not been defined")}function s(){throw new Error("clearTimeout has not been defined")}function u(t){if(n===setTimeout)return setTimeout(t,0);if((n===a||!n)&&setTimeout)return n=setTimeout,setTimeout(t,0);try{return n(t,0)}catch(e){try{return n.call(null,t,0)}catch(e){return n.call(this,t,0)}}}!function(){try{n="function"==typeof setTimeout?setTimeout:a}catch(t){n=a}try{i="function"==typeof clearTimeout?clearTimeout:s}catch(t){i=s}}();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 t=u(f);h=!0;for(var e=c.length;e;){for(l=c,c=[];++p1)for(var r=1;r>>7-t%8&1)},put:function(t,e){for(var r=0;r>>e-r-1&1))},getLengthInBits:function(){return this.length},putBit:function(t){var e=Math.floor(this.length/8);this.buffer.length<=e&&this.buffer.push(0),t&&(this.buffer[e]|=128>>>this.length%8),this.length++}},e.exports=n},{}],145:[function(t,e,r){var n=t("../utils/buffer");function i(t){if(!t||t<1)throw new Error("BitMatrix size must be defined and greater than 0");this.size=t,this.data=new n(t*t),this.data.fill(0),this.reservedBit=new n(t*t),this.reservedBit.fill(0)}i.prototype.set=function(t,e,r,n){var i=t*this.size+e;this.data[i]=r,n&&(this.reservedBit[i]=!0)},i.prototype.get=function(t,e){return this.data[t*this.size+e]},i.prototype.xor=function(t,e,r){this.data[t*this.size+e]^=r},i.prototype.isReserved=function(t,e){return this.reservedBit[t*this.size+e]},e.exports=i},{"../utils/buffer":167}],146:[function(t,e,r){var n=t("../utils/buffer"),i=t("./mode");function o(t){this.mode=i.BYTE,this.data=new n(t)}o.getBitsLength=function(t){return 8*t},o.prototype.getLength=function(){return this.data.length},o.prototype.getBitsLength=function(){return o.getBitsLength(this.data.length)},o.prototype.write=function(t){for(var e=0,r=this.data.length;e=0&&t.bit<4},r.from=function(t,e){if(r.isValid(t))return t;try{return function(t){if("string"!=typeof t)throw new Error("Param is not a string");switch(t.toLowerCase()){case"l":case"low":return r.L;case"m":case"medium":return r.M;case"q":case"quartile":return r.Q;case"h":case"high":return r.H;default:throw new Error("Unknown EC Level: "+t)}}(t)}catch(t){return e}}},{}],149:[function(t,e,r){var n=t("./utils").getSymbolSize;r.getPositions=function(t){var e=n(t);return[[0,0],[e-7,0],[0,e-7]]}},{"./utils":161}],150:[function(t,e,r){var n=t("./utils"),i=n.getBCHDigit(1335);r.getEncodedBits=function(t,e){for(var r=t.bit<<3|e,o=r<<10;n.getBCHDigit(o)-i>=0;)o^=1335<=33088&&r<=40956)r-=33088;else{if(!(r>=57408&&r<=60351))throw new Error("Invalid SJIS character: "+this.data[e]+"\nMake sure your charset is UTF-8");r-=49472}r=192*(r>>>8&255)+(255&r),t.put(r,13)}},e.exports=o},{"./mode":154,"./utils":161}],153:[function(t,e,r){r.Patterns={PATTERN000:0,PATTERN001:1,PATTERN010:2,PATTERN011:3,PATTERN100:4,PATTERN101:5,PATTERN110:6,PATTERN111:7};var n=3,i=3,o=40,a=10;function s(t,e,n){switch(t){case r.Patterns.PATTERN000:return(e+n)%2==0;case r.Patterns.PATTERN001:return e%2==0;case r.Patterns.PATTERN010:return n%3==0;case r.Patterns.PATTERN011:return(e+n)%3==0;case r.Patterns.PATTERN100:return(Math.floor(e/2)+Math.floor(n/3))%2==0;case r.Patterns.PATTERN101:return e*n%2+e*n%3==0;case r.Patterns.PATTERN110:return(e*n%2+e*n%3)%2==0;case r.Patterns.PATTERN111:return(e*n%3+(e+n)%2)%2==0;default:throw new Error("bad maskPattern:"+t)}}r.isValid=function(t){return null!=t&&""!==t&&!isNaN(t)&&t>=0&&t<=7},r.from=function(t){return r.isValid(t)?parseInt(t,10):void 0},r.getPenaltyN1=function(t){for(var e=t.size,r=0,i=0,o=0,a=null,s=null,u=0;u=5&&(r+=n+(i-5)),a=c,i=1),(c=t.get(l,u))===s?o++:(o>=5&&(r+=n+(o-5)),s=c,o=1)}i>=5&&(r+=n+(i-5)),o>=5&&(r+=n+(o-5))}return r},r.getPenaltyN2=function(t){for(var e=t.size,r=0,n=0;n=10&&(1488===n||93===n)&&r++,i=i<<1&2047|t.get(s,a),s>=10&&(1488===i||93===i)&&r++}return r*o},r.getPenaltyN4=function(t){for(var e=0,r=t.data.length,n=0;n=1&&e<10?t.ccBits[0]:e<27?t.ccBits[1]:t.ccBits[2]},r.getBestModeForData=function(t){return i.testNumeric(t)?r.NUMERIC:i.testAlphanumeric(t)?r.ALPHANUMERIC:i.testKanji(t)?r.KANJI:r.BYTE},r.toString=function(t){if(t&&t.id)return t.id;throw new Error("Invalid mode")},r.isValid=function(t){return t&&t.bit&&t.ccBits},r.from=function(t,e){if(r.isValid(t))return t;try{return function(t){if("string"!=typeof t)throw new Error("Param is not a string");switch(t.toLowerCase()){case"numeric":return r.NUMERIC;case"alphanumeric":return r.ALPHANUMERIC;case"kanji":return r.KANJI;case"byte":return r.BYTE;default:throw new Error("Unknown mode: "+t)}}(t)}catch(t){return e}}},{"./regex":159,"./version-check":162}],155:[function(t,e,r){var n=t("./mode");function i(t){this.mode=n.NUMERIC,this.data=t.toString()}i.getBitsLength=function(t){return 10*Math.floor(t/3)+(t%3?t%3*3+1:0)},i.prototype.getLength=function(){return this.data.length},i.prototype.getBitsLength=function(){return i.getBitsLength(this.data.length)},i.prototype.write=function(t){var e,r,n;for(e=0;e+3<=this.data.length;e+=3)r=this.data.substr(e,3),n=parseInt(r,10),t.put(n,10);var i=this.data.length-e;i>0&&(r=this.data.substr(e),n=parseInt(r,10),t.put(n,3*i+1))},e.exports=i},{"./mode":154}],156:[function(t,e,r){var n=t("../utils/buffer"),i=t("./galois-field");r.mul=function(t,e){var r=new n(t.length+e.length-1);r.fill(0);for(var o=0;o=0;){for(var o=r[0],a=0;a>n&1),n<6?t.set(n,8,i,!0):n<8?t.set(n+1,8,i,!0):t.set(o-15+n,8,i,!0),n<8?t.set(8,o-n-1,i,!0):n<9?t.set(8,15-n-1+1,i,!0):t.set(8,15-n-1,i,!0);t.set(o-8,8,1,!0)}function y(t,e,r){var o=new a;r.forEach(function(e){o.put(e.mode.bit,4),o.put(e.getLength(),m.getCharCountIndicator(e.mode,t)),e.write(o)});var s=8*(i.getSymbolTotalCodewords(t)-h.getTotalCodewordsCount(t,e));for(o.getLengthInBits()+4<=s&&o.put(0,4);o.getLengthInBits()%8!=0;)o.putBit(0);for(var u=(s-o.getLengthInBits())/8,l=0;l=0&&s<=6&&(0===u||6===u)||u>=0&&u<=6&&(0===s||6===s)||s>=2&&s<=4&&u>=2&&u<=4?t.set(o+s,a+u,!0,!0):t.set(o+s,a+u,!1,!0))}(b,e),function(t){for(var e=t.size,r=8;r=7&&function(t,e){for(var r,n,i,o=t.size,a=f.getEncodedBits(e),s=0;s<18;s++)r=Math.floor(s/3),n=s%3+o-8-3,i=1==(a>>s&1),t.set(r,n,i,!0),t.set(n,r,i,!0)}(b,e),function(t,e){for(var r=t.size,n=-1,i=r-1,o=7,a=0,s=r-1;s>0;s-=2)for(6===s&&s--;;){for(var u=0;u<2;u++)if(!t.isReserved(i,s-u)){var l=!1;a>>o&1)),t.set(i,s-u,l),-1==--o&&(a++,o=7)}if((i+=n)<0||r<=i){i-=n,n=-n;break}}}(b,d),isNaN(n)&&(n=c.getBestMask(b,_.bind(null,b,r))),c.applyMask(n,b),_(b,r,n),{modules:b,version:e,errorCorrectionLevel:r,maskPattern:n,segments:o}}r.create=function(t,e){if(void 0===t||""===t)throw new Error("No input text");var r,n,a=o.M;return void 0!==e&&(a=o.from(e.errorCorrectionLevel,o.M),r=f.from(e.version),n=c.from(e.maskPattern),e.toSJISFunc&&i.setToSJISFunction(e.toSJISFunc)),b(t,r,a,n)}},{"../utils/buffer":167,"./alignment-pattern":142,"./bit-buffer":144,"./bit-matrix":145,"./error-correction-code":147,"./error-correction-level":148,"./finder-pattern":149,"./format-info":150,"./mask-pattern":153,"./mode":154,"./reed-solomon-encoder":158,"./segments":160,"./utils":161,"./version":163,isarray:168}],158:[function(t,e,r){var n=t("../utils/buffer"),i=t("./polynomial");function o(t){this.genPoly=void 0,this.degree=t,this.degree&&this.initialize(this.degree)}o.prototype.initialize=function(t){this.degree=t,this.genPoly=i.generateECPolynomial(this.degree)},o.prototype.encode=function(t){if(!this.genPoly)throw new Error("Encoder not initialized");var e=new n(this.degree);e.fill(0);var r=n.concat([t,e],t.length+this.degree),o=i.mod(r,this.genPoly),a=this.degree-o.length;if(a>0){var s=new n(this.degree);return s.fill(0),o.copy(s,a),s}return o},e.exports=o},{"../utils/buffer":167,"./polynomial":156}],159:[function(t,e,r){var n="(?:[u3000-u303F]|[u3040-u309F]|[u30A0-u30FF]|[uFF00-uFFEF]|[u4E00-u9FAF]|[u2605-u2606]|[u2190-u2195]|u203B|[u2010u2015u2018u2019u2025u2026u201Cu201Du2225u2260]|[u0391-u0451]|[u00A7u00A8u00B1u00B4u00D7u00F7])+",i="(?:(?![A-Z0-9 $%*+\\-./:]|"+(n=n.replace(/u/g,"\\u"))+")(?:.|[\r\n]))+";r.KANJI=new RegExp(n,"g"),r.BYTE_KANJI=new RegExp("[^A-Z0-9 $%*+\\-./:]+","g"),r.BYTE=new RegExp(i,"g"),r.NUMERIC=new RegExp("[0-9]+","g"),r.ALPHANUMERIC=new RegExp("[A-Z $%*+\\-./:]+","g");var o=new RegExp("^"+n+"$"),a=new RegExp("^[0-9]+$"),s=new RegExp("^[A-Z0-9 $%*+\\-./:]+$");r.testKanji=function(t){return o.test(t)},r.testNumeric=function(t){return a.test(t)},r.testAlphanumeric=function(t){return s.test(t)}},{}],160:[function(t,e,r){var n=t("./mode"),i=t("./numeric-data"),o=t("./alphanumeric-data"),a=t("./byte-data"),s=t("./kanji-data"),u=t("./regex"),l=t("./utils"),c=t("dijkstrajs");function h(t){return unescape(encodeURIComponent(t)).length}function p(t,e,r){for(var n,i=[];null!==(n=t.exec(r));)i.push({data:n[0],index:n.index,mode:e,length:n[0].length});return i}function f(t){var e,r,i=p(u.NUMERIC,n.NUMERIC,t),o=p(u.ALPHANUMERIC,n.ALPHANUMERIC,t);return l.isKanjiModeEnabled()?(e=p(u.BYTE,n.BYTE,t),r=p(u.KANJI,n.KANJI,t)):(e=p(u.BYTE_KANJI,n.BYTE,t),r=[]),i.concat(o,e,r).sort(function(t,e){return t.index-e.index}).map(function(t){return{data:t.data,mode:t.mode,length:t.length}})}function d(t,e){switch(e){case n.NUMERIC:return i.getBitsLength(t);case n.ALPHANUMERIC:return o.getBitsLength(t);case n.KANJI:return s.getBitsLength(t);case n.BYTE:return a.getBitsLength(t)}}function m(t,e){var r,u=n.getBestModeForData(t);if((r=n.from(e,u))!==n.BYTE&&r.bit=0?t[t.length-1]:null;return r&&r.mode===e.mode?(t[t.length-1].data+=e.data,t):(t.push(e),t)},[])}(a))},r.rawSplit=function(t){return r.fromArray(f(t,l.isKanjiModeEnabled()))}},{"./alphanumeric-data":143,"./byte-data":146,"./kanji-data":152,"./mode":154,"./numeric-data":155,"./regex":159,"./utils":161,dijkstrajs:19}],161:[function(t,e,r){var n,i=[0,26,44,70,100,134,172,196,242,292,346,404,466,532,581,655,733,815,901,991,1085,1156,1258,1364,1474,1588,1706,1828,1921,2051,2185,2323,2465,2611,2761,2876,3034,3196,3362,3532,3706];r.getSymbolSize=function(t){if(!t)throw new Error('"version" cannot be null or undefined');if(t<1||t>40)throw new Error('"version" should be in range from 1 to 40');return 4*t+17},r.getSymbolTotalCodewords=function(t){return i[t]},r.getBCHDigit=function(t){for(var e=0;0!==t;)e++,t>>>=1;return e},r.setToSJISFunction=function(t){if("function"!=typeof t)throw new Error('"toSJISFunc" is not a valid function.');n=t},r.isKanjiModeEnabled=function(){return void 0!==n},r.toSJIS=function(t){return n(t)}},{}],162:[function(t,e,r){r.isValid=function(t){return!isNaN(t)&&t>=1&&t<=40}},{}],163:[function(t,e,r){var n=t("./utils"),i=t("./error-correction-code"),o=t("./error-correction-level"),a=t("./mode"),s=t("./version-check"),u=t("isarray"),l=n.getBCHDigit(7973);function c(t,e){return a.getCharCountIndicator(t,e)+4}function h(t,e){var r=0;return t.forEach(function(t){var n=c(t.mode,e);r+=n+t.getBitsLength()}),r}r.from=function(t,e){return s.isValid(t)?parseInt(t,10):e},r.getCapacity=function(t,e,r){if(!s.isValid(t))throw new Error("Invalid QR Code version");void 0===r&&(r=a.BYTE);var o=8*(n.getSymbolTotalCodewords(t)-i.getTotalCodewordsCount(t,e));if(r===a.MIXED)return o;var u=o-c(r,t);switch(r){case a.NUMERIC:return Math.floor(u/10*3);case a.ALPHANUMERIC:return Math.floor(u/11*2);case a.KANJI:return Math.floor(u/13);case a.BYTE:default:return Math.floor(u/8)}},r.getBestVersionForData=function(t,e){var n,i=o.from(e,o.M);if(u(t)){if(t.length>1)return function(t,e){for(var n=1;n<=40;n++)if(h(t,n)<=r.getCapacity(n,e,a.MIXED))return n}(t,i);if(0===t.length)return 1;n=t[0]}else n=t;return function(t,e,n){for(var i=1;i<=40;i++)if(e<=r.getCapacity(i,n,t))return i}(n.mode,n.getLength(),i)},r.getEncodedBits=function(t){if(!s.isValid(t)||t<7)throw new Error("Invalid QR Code version");for(var e=t<<12;n.getBCHDigit(e)-l>=0;)e^=7973<':"",h="0&&l>0&&t[u-1]||(n+=a?o("M",l+r,.5+c+r):o("m",i,0),i=0,a=!1),l+1',p='viewBox="0 0 '+l+" "+l+'"',f=''+c+h+"\n";return"function"==typeof r&&r(null,f),f}},{"./utils":166}],166:[function(t,e,r){function n(t){if("string"!=typeof t)throw new Error("Color should be defined as hex string");var e=t.slice().replace("#","").split("");if(e.length<3||5===e.length||e.length>8)throw new Error("Invalid hex color: "+t);3!==e.length&&4!==e.length||(e=Array.prototype.concat.apply([],e.map(function(t){return[t,t]}))),6===e.length&&e.push("F","F");var r=parseInt(e.join(""),16);return{r:r>>24&255,g:r>>16&255,b:r>>8&255,a:255&r,hex:"#"+e.slice(0,6).join("")}}r.getOptions=function(t){t||(t={}),t.color||(t.color={});var e=void 0===t.margin||null===t.margin||t.margin<0?4:t.margin,r=t.width&&t.width>=21?t.width:void 0,i=t.scale||4;return{width:r,scale:r?4:i,margin:e,color:{dark:n(t.color.dark||"#000000ff"),light:n(t.color.light||"#ffffffff")},type:t.type,rendererOpts:t.rendererOpts||{}}},r.getScale=function(t,e){return e.width&&e.width>=t+2*e.margin?e.width/(t+2*e.margin):e.scale},r.getImageWidth=function(t,e){var n=r.getScale(t,e);return Math.floor((t+2*e.margin)*n)},r.qrToImageData=function(t,e,n){for(var i=e.modules.size,o=e.modules.data,a=r.getScale(i,n),s=Math.floor((i+2*n.margin)*a),u=n.margin*a,l=[n.color.light,n.color.dark],c=0;c=u&&h>=u&&c=i)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+i.toString(16)+" bytes");return 0|t}function s(t,e){var r;return o.TYPED_ARRAY_SUPPORT?(r=new Uint8Array(e)).__proto__=o.prototype:(null===(r=t)&&(r=new o(e)),r.length=e),r}function u(t,e){var r=s(t,e<0?0:0|a(e));if(!o.TYPED_ARRAY_SUPPORT)for(var n=0;n55295&&r<57344){if(!i){if(r>56319){(e-=3)>-1&&o.push(239,191,189);continue}if(a+1===n){(e-=3)>-1&&o.push(239,191,189);continue}i=r;continue}if(r<56320){(e-=3)>-1&&o.push(239,191,189),i=r;continue}r=65536+(i-55296<<10|r-56320)}else i&&(e-=3)>-1&&o.push(239,191,189);if(i=null,r<128){if((e-=1)<0)break;o.push(r)}else if(r<2048){if((e-=2)<0)break;o.push(r>>6|192,63&r|128)}else if(r<65536){if((e-=3)<0)break;o.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((e-=4)<0)break;o.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return o}function h(t){return o.isBuffer(t)?t.length:"undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(t)||t instanceof ArrayBuffer)?t.byteLength:("string"!=typeof t&&(t=""+t),0===t.length?0:c(t).length)}o.TYPED_ARRAY_SUPPORT&&(o.prototype.__proto__=Uint8Array.prototype,o.__proto__=Uint8Array,"undefined"!=typeof Symbol&&Symbol.species&&o[Symbol.species]===o&&Object.defineProperty(o,Symbol.species,{value:null,configurable:!0,enumerable:!1,writable:!1})),o.prototype.write=function(t,e,r){void 0===e?(r=this.length,e=0):void 0===r&&"string"==typeof e?(r=this.length,e=0):isFinite(e)&&(e|=0,isFinite(r)?r|=0:r=void 0);var n=this.length-e;if((void 0===r||r>n)&&(r=n),t.length>0&&(r<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");return function(t,e,r,n){return function(t,e,r,n){for(var i=0;i=e.length||i>=t.length);++i)e[i+r]=t[i];return i}(c(e,t.length-r),t,r,n)}(this,t,e,r)},o.prototype.slice=function(t,e){var r,n=this.length;if(t=~~t,e=void 0===e?n:~~e,t<0?(t+=n)<0&&(t=0):t>n&&(t=n),e<0?(e+=n)<0&&(e=0):e>n&&(e=n),e=t.length&&(e=t.length),e||(e=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),t.length-e=0;--i)t[i+e]=this[i+r];else if(a<1e3||!o.TYPED_ARRAY_SUPPORT)for(i=0;i>>=0,r=void 0===r?this.length:r>>>0,t||(t=0),"number"==typeof t)for(i=e;i0?("string"==typeof e||a.objectMode||Object.getPrototypeOf(e)===l.prototype||(e=function(t){return l.from(t)}(e)),n?a.endEmitted?t.emit("error",new Error("stream.unshift() after end event")):x(t,a,e,!0):a.ended?t.emit("error",new Error("stream.push() after EOF")):(a.reading=!1,a.decoder&&!r?(e=a.decoder.write(e),a.objectMode||0!==e.length?x(t,a,e,!1):S(t,a)):x(t,a,e,!1))):n||(a.reading=!1));return function(t){return!t.ended&&(t.needReadable||t.lengthe.highWaterMark&&(e.highWaterMark=function(t){return t>=w?t=w:(t--,t|=t>>>1,t|=t>>>2,t|=t>>>4,t|=t>>>8,t|=t>>>16,t++),t}(t)),t<=e.length?t:e.ended?e.length:(e.needReadable=!0,0))}function k(t){var e=t._readableState;e.needReadable=!1,e.emittedReadable||(f("emitReadable",e.flowing),e.emittedReadable=!0,e.sync?i.nextTick(T,t):T(t))}function T(t){f("emit readable"),t.emit("readable"),B(t)}function S(t,e){e.readingMore||(e.readingMore=!0,i.nextTick(A,t,e))}function A(t,e){for(var r=e.length;!e.reading&&!e.flowing&&!e.ended&&e.length=e.length?(r=e.decoder?e.buffer.join(""):1===e.buffer.length?e.buffer.head.data:e.buffer.concat(e.length),e.buffer.clear()):r=function(t,e,r){var n;to.length?o.length:t;if(a===o.length?i+=o:i+=o.slice(0,t),0===(t-=a)){a===o.length?(++n,r.next?e.head=r.next:e.head=e.tail=null):(e.head=r,r.data=o.slice(a));break}++n}return e.length-=n,i}(t,e):function(t,e){var r=l.allocUnsafe(t),n=e.head,i=1;n.data.copy(r),t-=n.data.length;for(;n=n.next;){var o=n.data,a=t>o.length?o.length:t;if(o.copy(r,r.length-t,0,a),0===(t-=a)){a===o.length?(++i,n.next?e.head=n.next:e.head=e.tail=null):(e.head=n,n.data=o.slice(a));break}++i}return e.length-=i,r}(t,e);return n}(t,e.buffer,e.decoder),r);var r}function I(t){var e=t._readableState;if(e.length>0)throw new Error('"endReadable()" called on non-empty stream');e.endEmitted||(e.ended=!0,i.nextTick(M,e,t))}function M(t,e){t.endEmitted||0!==t.length||(t.endEmitted=!0,e.readable=!1,e.emit("end"))}function D(t,e){for(var r=0,n=t.length;r=e.highWaterMark||e.ended))return f("read: emitReadable",e.length,e.ended),0===e.length&&e.ended?I(this):k(this),null;if(0===(t=E(t,e))&&e.ended)return 0===e.length&&I(this),null;var n,i=e.needReadable;return f("need readable",i),(0===e.length||e.length-t0?P(t,e):null)?(e.needReadable=!0,t=0):e.length-=t,0===e.length&&(e.ended||(e.needReadable=!0),r!==t&&e.ended&&I(this)),null!==n&&this.emit("data",n),n},y.prototype._read=function(t){this.emit("error",new Error("_read() is not implemented"))},y.prototype.pipe=function(t,e){var n=this,o=this._readableState;switch(o.pipesCount){case 0:o.pipes=t;break;case 1:o.pipes=[o.pipes,t];break;default:o.pipes.push(t)}o.pipesCount+=1,f("pipe count=%d opts=%j",o.pipesCount,e);var u=(!e||!1!==e.end)&&t!==r.stdout&&t!==r.stderr?c:y;function l(e,r){f("onunpipe"),e===n&&r&&!1===r.hasUnpiped&&(r.hasUnpiped=!0,f("cleanup"),t.removeListener("close",v),t.removeListener("finish",_),t.removeListener("drain",h),t.removeListener("error",g),t.removeListener("unpipe",l),n.removeListener("end",c),n.removeListener("end",y),n.removeListener("data",m),p=!0,!o.awaitDrain||t._writableState&&!t._writableState.needDrain||h())}function c(){f("onend"),t.end()}o.endEmitted?i.nextTick(u):n.once("end",u),t.on("unpipe",l);var h=function(t){return function(){var e=t._readableState;f("pipeOnDrain",e.awaitDrain),e.awaitDrain&&e.awaitDrain--,0===e.awaitDrain&&s(t,"data")&&(e.flowing=!0,B(t))}}(n);t.on("drain",h);var p=!1;var d=!1;function m(e){f("ondata"),d=!1,!1!==t.write(e)||d||((1===o.pipesCount&&o.pipes===t||o.pipesCount>1&&-1!==D(o.pipes,t))&&!p&&(f("false write response, pause",n._readableState.awaitDrain),n._readableState.awaitDrain++,d=!0),n.pause())}function g(e){f("onerror",e),y(),t.removeListener("error",g),0===s(t,"error")&&t.emit("error",e)}function v(){t.removeListener("finish",_),y()}function _(){f("onfinish"),t.removeListener("close",v),y()}function y(){f("unpipe"),n.unpipe(t)}return n.on("data",m),function(t,e,r){if("function"==typeof t.prependListener)return t.prependListener(e,r);t._events&&t._events[e]?a(t._events[e])?t._events[e].unshift(r):t._events[e]=[r,t._events[e]]:t.on(e,r)}(t,"error",g),t.once("close",v),t.once("finish",_),t.emit("pipe",n),o.flowing||(f("pipe resume"),n.resume()),t},y.prototype.unpipe=function(t){var e=this._readableState,r={hasUnpiped:!1};if(0===e.pipesCount)return this;if(1===e.pipesCount)return t&&t!==e.pipes?this:(t||(t=e.pipes),e.pipes=null,e.pipesCount=0,e.flowing=!1,t&&t.emit("unpipe",this,r),this);if(!t){var n=e.pipes,i=e.pipesCount;e.pipes=null,e.pipesCount=0,e.flowing=!1;for(var o=0;o-1?i:o.nextTick;_.WritableState=v;var l=t("core-util-is");l.inherits=t("inherits");var c={deprecate:t("util-deprecate")},h=t("./internal/streams/stream"),p=t("safe-buffer").Buffer,f=n.Uint8Array||function(){};var d,m=t("./internal/streams/destroy");function g(){}function v(e,r){s=s||t("./_stream_duplex"),e=e||{};var n=r instanceof s;this.objectMode=!!e.objectMode,n&&(this.objectMode=this.objectMode||!!e.writableObjectMode);var i=e.highWaterMark,l=e.writableHighWaterMark,c=this.objectMode?16:16384;this.highWaterMark=i||0===i?i:n&&(l||0===l)?l:c,this.highWaterMark=Math.floor(this.highWaterMark),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var h=!1===e.decodeStrings;this.decodeStrings=!h,this.defaultEncoding=e.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(t){!function(t,e){var r=t._writableState,n=r.sync,i=r.writecb;if(function(t){t.writing=!1,t.writecb=null,t.length-=t.writelen,t.writelen=0}(r),e)!function(t,e,r,n,i){--e.pendingcb,r?(o.nextTick(i,n),o.nextTick(k,t,e),t._writableState.errorEmitted=!0,t.emit("error",n)):(i(n),t._writableState.errorEmitted=!0,t.emit("error",n),k(t,e))}(t,r,n,e,i);else{var a=w(r);a||r.corked||r.bufferProcessing||!r.bufferedRequest||x(t,r),n?u(b,t,r,a,i):b(t,r,a,i)}}(r,t)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.bufferedRequestCount=0,this.corkedRequestsFree=new a(this)}function _(e){if(s=s||t("./_stream_duplex"),!(d.call(_,this)||this instanceof s))return new _(e);this._writableState=new v(e,this),this.writable=!0,e&&("function"==typeof e.write&&(this._write=e.write),"function"==typeof e.writev&&(this._writev=e.writev),"function"==typeof e.destroy&&(this._destroy=e.destroy),"function"==typeof e.final&&(this._final=e.final)),h.call(this)}function y(t,e,r,n,i,o,a){e.writelen=n,e.writecb=a,e.writing=!0,e.sync=!0,r?t._writev(i,e.onwrite):t._write(i,o,e.onwrite),e.sync=!1}function b(t,e,r,n){r||function(t,e){0===e.length&&e.needDrain&&(e.needDrain=!1,t.emit("drain"))}(t,e),e.pendingcb--,n(),k(t,e)}function x(t,e){e.bufferProcessing=!0;var r=e.bufferedRequest;if(t._writev&&r&&r.next){var n=e.bufferedRequestCount,i=new Array(n),o=e.corkedRequestsFree;o.entry=r;for(var s=0,u=!0;r;)i[s]=r,r.isBuf||(u=!1),r=r.next,s+=1;i.allBuffers=u,y(t,e,!0,e.length,i,"",o.finish),e.pendingcb++,e.lastBufferedRequest=null,o.next?(e.corkedRequestsFree=o.next,o.next=null):e.corkedRequestsFree=new a(e),e.bufferedRequestCount=0}else{for(;r;){var l=r.chunk,c=r.encoding,h=r.callback;if(y(t,e,!1,e.objectMode?1:l.length,l,c,h),r=r.next,e.bufferedRequestCount--,e.writing)break}null===r&&(e.lastBufferedRequest=null)}e.bufferedRequest=r,e.bufferProcessing=!1}function w(t){return t.ending&&0===t.length&&null===t.bufferedRequest&&!t.finished&&!t.writing}function E(t,e){t._final(function(r){e.pendingcb--,r&&t.emit("error",r),e.prefinished=!0,t.emit("prefinish"),k(t,e)})}function k(t,e){var r=w(e);return r&&(!function(t,e){e.prefinished||e.finalCalled||("function"==typeof t._final?(e.pendingcb++,e.finalCalled=!0,o.nextTick(E,t,e)):(e.prefinished=!0,t.emit("prefinish")))}(t,e),0===e.pendingcb&&(e.finished=!0,t.emit("finish"))),r}l.inherits(_,h),v.prototype.getBuffer=function(){for(var t=this.bufferedRequest,e=[];t;)e.push(t),t=t.next;return e},function(){try{Object.defineProperty(v.prototype,"buffer",{get:c.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch(t){}}(),"function"==typeof Symbol&&Symbol.hasInstance&&"function"==typeof Function.prototype[Symbol.hasInstance]?(d=Function.prototype[Symbol.hasInstance],Object.defineProperty(_,Symbol.hasInstance,{value:function(t){return!!d.call(this,t)||this===_&&(t&&t._writableState instanceof v)}})):d=function(t){return t instanceof this},_.prototype.pipe=function(){this.emit("error",new Error("Cannot pipe, not readable"))},_.prototype.write=function(t,e,r){var n,i=this._writableState,a=!1,s=!i.objectMode&&(n=t,p.isBuffer(n)||n instanceof f);return s&&!p.isBuffer(t)&&(t=function(t){return p.from(t)}(t)),"function"==typeof e&&(r=e,e=null),s?e="buffer":e||(e=i.defaultEncoding),"function"!=typeof r&&(r=g),i.ended?function(t,e){var r=new Error("write after end");t.emit("error",r),o.nextTick(e,r)}(this,r):(s||function(t,e,r,n){var i=!0,a=!1;return null===r?a=new TypeError("May not write null values to stream"):"string"==typeof r||void 0===r||e.objectMode||(a=new TypeError("Invalid non-string/buffer chunk")),a&&(t.emit("error",a),o.nextTick(n,a),i=!1),i}(this,i,t,r))&&(i.pendingcb++,a=function(t,e,r,n,i,o){if(!r){var a=function(t,e,r){t.objectMode||!1===t.decodeStrings||"string"!=typeof e||(e=p.from(e,r));return e}(e,n,i);n!==a&&(r=!0,i="buffer",n=a)}var s=e.objectMode?1:n.length;e.length+=s;var u=e.length-1))throw new TypeError("Unknown encoding: "+t);return this._writableState.defaultEncoding=t,this},Object.defineProperty(_.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),_.prototype._write=function(t,e,r){r(new Error("_write() is not implemented"))},_.prototype._writev=null,_.prototype.end=function(t,e,r){var n=this._writableState;"function"==typeof t?(r=t,t=null,e=null):"function"==typeof e&&(r=e,e=null),null!==t&&void 0!==t&&this.write(t,e),n.corked&&(n.corked=1,this.uncork()),n.ending||n.finished||function(t,e,r){e.ending=!0,k(t,e),r&&(e.finished?o.nextTick(r):t.once("finish",r));e.ended=!0,t.writable=!1}(this,n,r)},Object.defineProperty(_.prototype,"destroyed",{get:function(){return void 0!==this._writableState&&this._writableState.destroyed},set:function(t){this._writableState&&(this._writableState.destroyed=t)}}),_.prototype.destroy=m.destroy,_.prototype._undestroy=m.undestroy,_.prototype._destroy=function(t,e){this.end(),e(t)}}).call(this,t("_process"),"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{},t("timers").setImmediate)},{"./_stream_duplex":170,"./internal/streams/destroy":176,"./internal/streams/stream":177,_process:139,"core-util-is":14,inherits:96,"process-nextick-args":179,"safe-buffer":185,timers:193,"util-deprecate":198}],175:[function(t,e,r){"use strict";var n=t("safe-buffer").Buffer,i=t("util");e.exports=function(){function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.head=null,this.tail=null,this.length=0}return t.prototype.push=function(t){var e={data:t,next:null};this.length>0?this.tail.next=e:this.head=e,this.tail=e,++this.length},t.prototype.unshift=function(t){var e={data:t,next:this.head};0===this.length&&(this.tail=e),this.head=e,++this.length},t.prototype.shift=function(){if(0!==this.length){var t=this.head.data;return 1===this.length?this.head=this.tail=null:this.head=this.head.next,--this.length,t}},t.prototype.clear=function(){this.head=this.tail=null,this.length=0},t.prototype.join=function(t){if(0===this.length)return"";for(var e=this.head,r=""+e.data;e=e.next;)r+=t+e.data;return r},t.prototype.concat=function(t){if(0===this.length)return n.alloc(0);if(1===this.length)return this.head.data;for(var e,r,i,o=n.allocUnsafe(t>>>0),a=this.head,s=0;a;)e=a.data,r=o,i=s,e.copy(r,i),s+=a.data.length,a=a.next;return o},t}(),i&&i.inspect&&i.inspect.custom&&(e.exports.prototype[i.inspect.custom]=function(){var t=i.inspect({length:this.length});return this.constructor.name+" "+t})},{"safe-buffer":185,util:4}],176:[function(t,e,r){"use strict";var n=t("process-nextick-args");function i(t,e){t.emit("error",e)}e.exports={destroy:function(t,e){var r=this,o=this._readableState&&this._readableState.destroyed,a=this._writableState&&this._writableState.destroyed;return o||a?(e?e(t):!t||this._writableState&&this._writableState.errorEmitted||n.nextTick(i,this,t),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(t||null,function(t){!e&&t?(n.nextTick(i,r,t),r._writableState&&(r._writableState.errorEmitted=!0)):e&&e(t)}),this)},undestroy:function(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)}}},{"process-nextick-args":179}],177:[function(t,e,r){e.exports=t("events").EventEmitter},{events:74}],178:[function(t,e,r){arguments[4][168][0].apply(r,arguments)},{dup:168}],179:[function(t,e,r){(function(t){"use strict";!t.version||0===t.version.indexOf("v0.")||0===t.version.indexOf("v1.")&&0!==t.version.indexOf("v1.8.")?e.exports={nextTick:function(e,r,n,i){if("function"!=typeof e)throw new TypeError('"callback" argument must be a function');var o,a,s=arguments.length;switch(s){case 0:case 1:return t.nextTick(e);case 2:return t.nextTick(function(){e.call(null,r)});case 3:return t.nextTick(function(){e.call(null,r,n)});case 4:return t.nextTick(function(){e.call(null,r,n,i)});default:for(o=new Array(s-1),a=0;a>5==6?2:t>>4==14?3:t>>3==30?4:t>>6==2?-1:-2}function s(t){var e=this.lastTotal-this.lastNeed,r=function(t,e,r){if(128!=(192&e[0]))return t.lastNeed=0,"�";if(t.lastNeed>1&&e.length>1){if(128!=(192&e[1]))return t.lastNeed=1,"�";if(t.lastNeed>2&&e.length>2&&128!=(192&e[2]))return t.lastNeed=2,"�"}}(this,t);return void 0!==r?r:this.lastNeed<=t.length?(t.copy(this.lastChar,e,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal)):(t.copy(this.lastChar,e,0,t.length),void(this.lastNeed-=t.length))}function u(t,e){if((t.length-e)%2==0){var r=t.toString("utf16le",e);if(r){var n=r.charCodeAt(r.length-1);if(n>=55296&&n<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=t[t.length-2],this.lastChar[1]=t[t.length-1],r.slice(0,-1)}return r}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=t[t.length-1],t.toString("utf16le",e,t.length-1)}function l(t){var e=t&&t.length?this.write(t):"";if(this.lastNeed){var r=this.lastTotal-this.lastNeed;return e+this.lastChar.toString("utf16le",0,r)}return e}function c(t,e){var r=(t.length-e)%3;return 0===r?t.toString("base64",e):(this.lastNeed=3-r,this.lastTotal=3,1===r?this.lastChar[0]=t[t.length-1]:(this.lastChar[0]=t[t.length-2],this.lastChar[1]=t[t.length-1]),t.toString("base64",e,t.length-r))}function h(t){var e=t&&t.length?this.write(t):"";return this.lastNeed?e+this.lastChar.toString("base64",0,3-this.lastNeed):e}function p(t){return t.toString(this.encoding)}function f(t){return t&&t.length?this.write(t):""}r.StringDecoder=o,o.prototype.write=function(t){if(0===t.length)return"";var e,r;if(this.lastNeed){if(void 0===(e=this.fillLast(t)))return"";r=this.lastNeed,this.lastNeed=0}else r=0;return r=0)return i>0&&(t.lastNeed=i-1),i;if(--n=0)return i>0&&(t.lastNeed=i-2),i;if(--n=0)return i>0&&(2===i?i=0:t.lastNeed=i-3),i;return 0}(this,t,e);if(!this.lastNeed)return t.toString("utf8",e);this.lastTotal=r;var n=t.length-(r-this.lastNeed);return t.copy(this.lastChar,0,n),t.toString("utf8",e,n)},o.prototype.fillLast=function(t){if(this.lastNeed<=t.length)return t.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);t.copy(this.lastChar,this.lastTotal-this.lastNeed,0,t.length),this.lastNeed-=t.length}},{"safe-buffer":185}],181:[function(t,e,r){e.exports=t("./readable").PassThrough},{"./readable":182}],182:[function(t,e,r){(r=e.exports=t("./lib/_stream_readable.js")).Stream=r,r.Readable=r,r.Writable=t("./lib/_stream_writable.js"),r.Duplex=t("./lib/_stream_duplex.js"),r.Transform=t("./lib/_stream_transform.js"),r.PassThrough=t("./lib/_stream_passthrough.js")},{"./lib/_stream_duplex.js":170,"./lib/_stream_passthrough.js":171,"./lib/_stream_readable.js":172,"./lib/_stream_transform.js":173,"./lib/_stream_writable.js":174}],183:[function(t,e,r){e.exports=t("./readable").Transform},{"./readable":182}],184:[function(t,e,r){e.exports=t("./lib/_stream_writable.js")},{"./lib/_stream_writable.js":174}],185:[function(t,e,r){var n=t("buffer"),i=n.Buffer;function o(t,e){for(var r in t)e[r]=t[r]}function a(t,e,r){return i(t,e,r)}i.from&&i.alloc&&i.allocUnsafe&&i.allocUnsafeSlow?e.exports=n:(o(n,r),r.Buffer=a),o(i,a),a.from=function(t,e,r){if("number"==typeof t)throw new TypeError("Argument must not be a number");return i(t,e,r)},a.alloc=function(t,e,r){if("number"!=typeof t)throw new TypeError("Argument must be a number");var n=i(t);return void 0!==e?"string"==typeof r?n.fill(e,r):n.fill(e):n.fill(0),n},a.allocUnsafe=function(t){if("number"!=typeof t)throw new TypeError("Argument must be a number");return i(t)},a.allocUnsafeSlow=function(t){if("number"!=typeof t)throw new TypeError("Argument must be a number");return n.SlowBuffer(t)}},{buffer:73}],186:[function(t,e,r){arguments[4][93][0].apply(r,arguments)},{"./lib/decoder":187,"./lib/encoder":188,dup:93}],187:[function(t,e,r){(function(t){var r=function(){"use strict";var t=new Int32Array([0,1,8,16,9,2,3,10,17,24,32,25,18,11,4,5,12,19,26,33,40,48,41,34,27,20,13,6,7,14,21,28,35,42,49,56,57,50,43,36,29,22,15,23,30,37,44,51,58,59,52,45,38,31,39,46,53,60,61,54,47,55,62,63]),e=4017,r=799,n=3406,i=2276,o=1567,a=3784,s=5793,u=2896;function l(){}function c(t,e){for(var r,n,i=0,o=[],a=16;a>0&&!t[a-1];)a--;o.push({children:[],index:0});var s,u=o[0];for(r=0;r0;)u=o.pop();for(u.index++,o.push(u);o.length<=r;)o.push(s={children:[],index:0}),u.children[u.index]=s.children,u=s;i++}r+10)return f>>--d&1;if(255==(f=e[r++])){var t=e[r++];if(t)throw"unexpected marker: "+(f<<8|t).toString(16)}return d=7,f>>>7}function g(t){for(var e,r=t;null!==(e=m());){if("number"==typeof(r=r[e]))return r;if("object"!=typeof r)throw"invalid huffman sequence"}return null}function v(t){for(var e=0;t>0;){var r=m();if(null===r)return;e=e<<1|r,t--}return e}function _(t){var e=v(t);return e>=1<0)y--;else for(var n=a,i=s;n<=i;){var o=g(e.huffmanTableAC),u=15&o,c=o>>4;if(0!==u)r[t[n+=c]]=_(u)*(1<>4,0===h)o<15?(y=v(o)+(1<>4;if(0!==s)r[t[o+=u]]=_(s),o++;else{if(u<15)break;o+=16}}};var P,I,M,D,F=0;for(I=1==B?i[0].blocksPerLine*i[0].blocksPerColumn:c*n.mcusPerColumn,o||(o=I);F=65488&&P<=65495))break;r+=2}return r-p}function p(t,l){var c,h,p=[],f=l.blocksPerLine,d=l.blocksPerColumn,m=f<<3,g=new Int32Array(64),v=new Uint8Array(64);function _(t,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]=t[x]*w[x];for(x=0;x<8;++x){var k=8*x;0!=E[1+k]||0!=E[2+k]||0!=E[3+k]||0!=E[4+k]||0!=E[5+k]||0!=E[6+k]||0!=E[7+k]?(p=s*E[0+k]+128>>8,f=s*E[4+k]+128>>8,d=E[2+k],m=E[6+k],g=u*(E[1+k]-E[7+k])+128>>8,y=u*(E[1+k]+E[7+k])+128>>8,v=E[3+k]<<4,_=E[5+k]<<4,b=p-f+1>>1,p=p+f+1>>1,f=b,b=d*a+m*o+128>>8,d=d*o-m*a+128>>8,m=b,b=g-_+1>>1,g=g+_+1>>1,_=b,b=y+v+1>>1,v=y-v+1>>1,y=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+y*n+2048>>12,g=g*n-y*i+2048>>12,y=b,b=v*r+_*e+2048>>12,v=v*e-_*r+2048>>12,_=b,E[0+k]=p+y,E[7+k]=p-y,E[1+k]=f+_,E[6+k]=f-_,E[2+k]=d+v,E[5+k]=d-v,E[3+k]=m+g,E[4+k]=m-g):(b=s*E[0+k]+512>>10,E[0+k]=b,E[1+k]=b,E[2+k]=b,E[3+k]=b,E[4+k]=b,E[5+k]=b,E[6+k]=b,E[7+k]=b)}for(x=0;x<8;++x){var T=x;0!=E[8+T]||0!=E[16+T]||0!=E[24+T]||0!=E[32+T]||0!=E[40+T]||0!=E[48+T]||0!=E[56+T]?(p=s*E[0+T]+2048>>12,f=s*E[32+T]+2048>>12,d=E[16+T],m=E[48+T],g=u*(E[8+T]-E[56+T])+2048>>12,y=u*(E[8+T]+E[56+T])+2048>>12,v=E[24+T],_=E[40+T],b=p-f+1>>1,p=p+f+1>>1,f=b,b=d*a+m*o+2048>>12,d=d*o-m*a+2048>>12,m=b,b=g-_+1>>1,g=g+_+1>>1,_=b,b=y+v+1>>1,v=y-v+1>>1,y=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+y*n+2048>>12,g=g*n-y*i+2048>>12,y=b,b=v*r+_*e+2048>>12,v=v*e-_*r+2048>>12,_=b,E[0+T]=p+y,E[56+T]=p-y,E[8+T]=f+_,E[48+T]=f-_,E[16+T]=d+v,E[40+T]=d-v,E[24+T]=m+g,E[32+T]=m-g):(b=s*h[x+0]+8192>>14,E[0+T]=b,E[8+T]=b,E[16+T]=b,E[24+T]=b,E[32+T]=b,E[40+T]=b,E[48+T]=b,E[56+T]=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 y=0;y255?255:t}return l.prototype={load:function(t){var e=new XMLHttpRequest;e.open("GET",t,!0),e.responseType="arraybuffer",e.onload=function(){var t=new Uint8Array(e.response||e.mozResponseArrayBuffer);this.parse(t),this.onload&&this.onload()}.bind(this),e.send(null)},parse:function(e){var r=0;e.length;function n(){var t=e[r]<<8|e[r+1];return r+=2,t}function i(){var t=n(),i=e.subarray(r,r+t-2);return r+=i.length,i}function o(t){var e,r,n=0,i=0;for(r in t.components)t.components.hasOwnProperty(r)&&(n<(e=t.components[r]).h&&(n=e.h),i>4==0)for(_=0;_<64;_++){w[t[_]]=e[r++]}else{if(x>>4!=1)throw"DQT: invalid table spec";for(_=0;_<64;_++){w[t[_]]=n()}}f[15&x]=w}break;case 65472:case 65473:case 65474:n(),(a={}).extended=65473===v,a.progressive=65474===v,a.precision=e[r++],a.scanLines=n(),a.samplesPerLine=n(),a.components={},a.componentsOrder=[];var E,k=e[r++];for(U=0;U>4,S=15&e[r+1],A=e[r+2];a.componentsOrder.push(E),a.components[E]={h:T,v:S,quantizationTable:f[A]},r+=3}o(a),d.push(a);break;case 65476:var C=n();for(U=2;U>4==0?g:m)[15&R]=c(B,I)}break;case 65501:n(),s=n();break;case 65498:n();var M=e[r++],D=[];for(U=0;U>4],z.huffmanTableAC=m[15&F],D.push(z)}var L=e[r++],O=e[r++],N=e[r++],j=h(e,r,a,D,s,L,O,N>>4,15&N);r+=j;break;default:if(255==e[r-3]&&e[r-2]>=192&&e[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";this.width=a.samplesPerLine,this.height=a.scanLines,this.jfif=u,this.adobe=l,this.components=[];for(var U=0;U=this.charLength-this.charReceived?this.charLength-this.charReceived:t.length;if(t.copy(this.charBuffer,this.charReceived,0,r),this.charReceived+=r,this.charReceived=55296&&i<=56319)){if(this.charReceived=this.charLength=0,0===t.length)return e;break}this.charLength+=this.surrogateSize,e=""}this.detectIncompleteChar(t);var n=t.length;this.charLength&&(t.copy(this.charBuffer,0,t.length-this.charReceived,n),n-=this.charReceived);var i;n=(e+=t.toString(this.encoding,0,n)).length-1;if((i=e.charCodeAt(n))>=55296&&i<=56319){var o=this.surrogateSize;return this.charLength+=o,this.charReceived+=o,this.charBuffer.copy(this.charBuffer,o,0,o),t.copy(this.charBuffer,0,0,o),e.substring(0,n)}return e},o.prototype.detectIncompleteChar=function(t){for(var e=t.length>=3?3:t.length;e>0;e--){var r=t[t.length-e];if(1==e&&r>>5==6){this.charLength=2;break}if(e<=2&&r>>4==14){this.charLength=3;break}if(e<=3&&r>>3==30){this.charLength=4;break}}this.charReceived=e},o.prototype.end=function(t){var e="";if(t&&t.length&&(e=this.write(t)),this.charReceived){var r=this.charReceived,n=this.charBuffer,i=this.encoding;e+=n.slice(0,r).toString(i)}return e}},{buffer:73}],192:[function(t,e,r){(function(r){var n=t("stream");function i(t,e,i){t=t||function(t){this.queue(t)},e=e||function(){this.queue(null)};var o=!1,a=!1,s=[],u=!1,l=new n;function c(){for(;s.length&&!l.paused;){var t=s.shift();if(null===t)return l.emit("end");l.emit("data",t)}}return l.readable=l.writable=!0,l.paused=!1,l.autoDestroy=!(i&&!1===i.autoDestroy),l.write=function(e){return t.call(this,e),!l.paused},l.queue=l.push=function(t){return u?l:(null===t&&(u=!0),s.push(t),c(),l)},l.on("end",function(){l.readable=!1,!l.writable&&l.autoDestroy&&r.nextTick(function(){l.destroy()})}),l.end=function(t){if(!o)return o=!0,arguments.length&&l.write(t),l.writable=!1,e.call(l),!l.readable&&l.autoDestroy&&l.destroy(),l},l.destroy=function(){if(!a)return a=!0,o=!0,s.length=0,l.writable=l.readable=!1,l.emit("close"),l},l.pause=function(){if(!l.paused)return l.paused=!0,l},l.resume=function(){return l.paused&&(l.paused=!1,l.emit("resume")),c(),l.paused||l.emit("drain"),l},l}e.exports=i,i.through=i}).call(this,t("_process"))},{_process:139,stream:190}],193:[function(t,e,r){(function(e,n){var i=t("process/browser.js").nextTick,o=Function.prototype.apply,a=Array.prototype.slice,s={},u=0;function l(t,e){this._id=t,this._clearFn=e}r.setTimeout=function(){return new l(o.call(setTimeout,window,arguments),clearTimeout)},r.setInterval=function(){return new l(o.call(setInterval,window,arguments),clearInterval)},r.clearTimeout=r.clearInterval=function(t){t.close()},l.prototype.unref=l.prototype.ref=function(){},l.prototype.close=function(){this._clearFn.call(window,this._id)},r.enroll=function(t,e){clearTimeout(t._idleTimeoutId),t._idleTimeout=e},r.unenroll=function(t){clearTimeout(t._idleTimeoutId),t._idleTimeout=-1},r._unrefActive=r.active=function(t){clearTimeout(t._idleTimeoutId);var e=t._idleTimeout;e>=0&&(t._idleTimeoutId=setTimeout(function(){t._onTimeout&&t._onTimeout()},e))},r.setImmediate="function"==typeof e?e:function(t){var e=u++,n=!(arguments.length<2)&&a.call(arguments,1);return s[e]=!0,i(function(){s[e]&&(n?t.apply(null,n):t.call(null),r.clearImmediate(e))}),e},r.clearImmediate="function"==typeof n?n:function(t){delete s[t]}}).call(this,t("timers").setImmediate,t("timers").clearImmediate)},{"process/browser.js":139,timers:193}],194:[function(t,e,r){r.isatty=function(){return!1},r.ReadStream=function(){throw new Error("tty.ReadStream is not implemented")},r.WriteStream=function(){throw new Error("tty.WriteStream is not implemented")}},{}],195:[function(t,e,r){(function(){var t=this,n=t._,i={},o=Array.prototype,a=Object.prototype,s=Function.prototype,u=o.push,l=o.slice,c=o.concat,h=a.toString,p=a.hasOwnProperty,f=o.forEach,d=o.map,m=o.reduce,g=o.reduceRight,v=o.filter,_=o.every,y=o.some,b=o.indexOf,x=o.lastIndexOf,w=Array.isArray,E=Object.keys,k=s.bind,T=function(t){return t instanceof T?t:this instanceof T?void(this._wrapped=t):new T(t)};void 0!==r?(void 0!==e&&e.exports&&(r=e.exports=T),r._=T):t._=T,T.VERSION="1.4.4";var S=T.each=T.forEach=function(t,e,r){if(null!=t)if(f&&t.forEach===f)t.forEach(e,r);else if(t.length===+t.length){for(var n=0,o=t.length;n2;if(null==t&&(t=[]),m&&t.reduce===m)return n&&(e=T.bind(e,n)),i?t.reduce(e,r):t.reduce(e);if(S(t,function(t,o,a){i?r=e.call(n,r,t,o,a):(r=t,i=!0)}),!i)throw new TypeError(A);return r},T.reduceRight=T.foldr=function(t,e,r,n){var i=arguments.length>2;if(null==t&&(t=[]),g&&t.reduceRight===g)return n&&(e=T.bind(e,n)),i?t.reduceRight(e,r):t.reduceRight(e);var o=t.length;if(o!==+o){var a=T.keys(t);o=a.length}if(S(t,function(s,u,l){u=a?a[--o]:--o,i?r=e.call(n,r,t[u],u,l):(r=t[u],i=!0)}),!i)throw new TypeError(A);return r},T.find=T.detect=function(t,e,r){var n;return C(t,function(t,i,o){if(e.call(r,t,i,o))return n=t,!0}),n},T.filter=T.select=function(t,e,r){var n=[];return null==t?n:v&&t.filter===v?t.filter(e,r):(S(t,function(t,i,o){e.call(r,t,i,o)&&(n[n.length]=t)}),n)},T.reject=function(t,e,r){return T.filter(t,function(t,n,i){return!e.call(r,t,n,i)},r)},T.every=T.all=function(t,e,r){e||(e=T.identity);var n=!0;return null==t?n:_&&t.every===_?t.every(e,r):(S(t,function(t,o,a){if(!(n=n&&e.call(r,t,o,a)))return i}),!!n)};var C=T.some=T.any=function(t,e,r){e||(e=T.identity);var n=!1;return null==t?n:y&&t.some===y?t.some(e,r):(S(t,function(t,o,a){if(n||(n=e.call(r,t,o,a)))return i}),!!n)};T.contains=T.include=function(t,e){return null!=t&&(b&&t.indexOf===b?-1!=t.indexOf(e):C(t,function(t){return t===e}))},T.invoke=function(t,e){var r=l.call(arguments,2),n=T.isFunction(e);return T.map(t,function(t){return(n?e:t[e]).apply(t,r)})},T.pluck=function(t,e){return T.map(t,function(t){return t[e]})},T.where=function(t,e,r){return T.isEmpty(e)?r?null:[]:T[r?"find":"filter"](t,function(t){for(var r in e)if(e[r]!==t[r])return!1;return!0})},T.findWhere=function(t,e){return T.where(t,e,!0)},T.max=function(t,e,r){if(!e&&T.isArray(t)&&t[0]===+t[0]&&t.length<65535)return Math.max.apply(Math,t);if(!e&&T.isEmpty(t))return-1/0;var n={computed:-1/0,value:-1/0};return S(t,function(t,i,o){var a=e?e.call(r,t,i,o):t;a>=n.computed&&(n={value:t,computed:a})}),n.value},T.min=function(t,e,r){if(!e&&T.isArray(t)&&t[0]===+t[0]&&t.length<65535)return Math.min.apply(Math,t);if(!e&&T.isEmpty(t))return 1/0;var n={computed:1/0,value:1/0};return S(t,function(t,i,o){var a=e?e.call(r,t,i,o):t;an||void 0===r)return 1;if(r>>1;r.call(n,t[s])=0})})},T.difference=function(t){var e=c.apply(o,l.call(arguments,1));return T.filter(t,function(t){return!T.contains(e,t)})},T.zip=function(){for(var t=l.call(arguments),e=T.max(T.pluck(t,"length")),r=new Array(e),n=0;n=0;r--)e=[t[r].apply(this,e)];return e[0]}},T.after=function(t,e){return t<=0?e():function(){if(--t<1)return e.apply(this,arguments)}},T.keys=E||function(t){if(t!==Object(t))throw new TypeError("Invalid object");var e=[];for(var r in t)T.has(t,r)&&(e[e.length]=r);return e},T.values=function(t){var e=[];for(var r in t)T.has(t,r)&&e.push(t[r]);return e},T.pairs=function(t){var e=[];for(var r in t)T.has(t,r)&&e.push([r,t[r]]);return e},T.invert=function(t){var e={};for(var r in t)T.has(t,r)&&(e[t[r]]=r);return e},T.functions=T.methods=function(t){var e=[];for(var r in t)T.isFunction(t[r])&&e.push(r);return e.sort()},T.extend=function(t){return S(l.call(arguments,1),function(e){if(e)for(var r in e)t[r]=e[r]}),t},T.pick=function(t){var e={},r=c.apply(o,l.call(arguments,1));return S(r,function(r){r in t&&(e[r]=t[r])}),e},T.omit=function(t){var e={},r=c.apply(o,l.call(arguments,1));for(var n in t)T.contains(r,n)||(e[n]=t[n]);return e},T.defaults=function(t){return S(l.call(arguments,1),function(e){if(e)for(var r in e)null==t[r]&&(t[r]=e[r])}),t},T.clone=function(t){return T.isObject(t)?T.isArray(t)?t.slice():T.extend({},t):t},T.tap=function(t,e){return e(t),t};var I=function(t,e,r,n){if(t===e)return 0!==t||1/t==1/e;if(null==t||null==e)return t===e;t instanceof T&&(t=t._wrapped),e instanceof T&&(e=e._wrapped);var i=h.call(t);if(i!=h.call(e))return!1;switch(i){case"[object String]":return t==String(e);case"[object Number]":return t!=+t?e!=+e:0==t?1/t==1/e:t==+e;case"[object Date]":case"[object Boolean]":return+t==+e;case"[object RegExp]":return t.source==e.source&&t.global==e.global&&t.multiline==e.multiline&&t.ignoreCase==e.ignoreCase}if("object"!=typeof t||"object"!=typeof e)return!1;for(var o=r.length;o--;)if(r[o]==t)return n[o]==e;r.push(t),n.push(e);var a=0,s=!0;if("[object Array]"==i){if(s=(a=t.length)==e.length)for(;a--&&(s=I(t[a],e[a],r,n)););}else{var u=t.constructor,l=e.constructor;if(u!==l&&!(T.isFunction(u)&&u instanceof u&&T.isFunction(l)&&l instanceof l))return!1;for(var c in t)if(T.has(t,c)&&(a++,!(s=T.has(e,c)&&I(t[c],e[c],r,n))))break;if(s){for(c in e)if(T.has(e,c)&&!a--)break;s=!a}}return r.pop(),n.pop(),s};T.isEqual=function(t,e){return I(t,e,[],[])},T.isEmpty=function(t){if(null==t)return!0;if(T.isArray(t)||T.isString(t))return 0===t.length;for(var e in t)if(T.has(t,e))return!1;return!0},T.isElement=function(t){return!(!t||1!==t.nodeType)},T.isArray=w||function(t){return"[object Array]"==h.call(t)},T.isObject=function(t){return t===Object(t)},S(["Arguments","Function","String","Number","Date","RegExp"],function(t){T["is"+t]=function(e){return h.call(e)=="[object "+t+"]"}}),T.isArguments(arguments)||(T.isArguments=function(t){return!(!t||!T.has(t,"callee"))}),"function"!=typeof/./&&(T.isFunction=function(t){return"function"==typeof t}),T.isFinite=function(t){return isFinite(t)&&!isNaN(parseFloat(t))},T.isNaN=function(t){return T.isNumber(t)&&t!=+t},T.isBoolean=function(t){return!0===t||!1===t||"[object Boolean]"==h.call(t)},T.isNull=function(t){return null===t},T.isUndefined=function(t){return void 0===t},T.has=function(t,e){return p.call(t,e)},T.noConflict=function(){return t._=n,this},T.identity=function(t){return t},T.times=function(t,e,r){for(var n=Array(t),i=0;i":">",'"':""","'":"'","/":"/"}};M.unescape=T.invert(M.escape);var D={escape:new RegExp("["+T.keys(M.escape).join("")+"]","g"),unescape:new RegExp("("+T.keys(M.unescape).join("|")+")","g")};T.each(["escape","unescape"],function(t){T[t]=function(e){return null==e?"":(""+e).replace(D[t],function(e){return M[t][e]})}}),T.result=function(t,e){if(null==t)return null;var r=t[e];return T.isFunction(r)?r.call(t):r},T.mixin=function(t){S(T.functions(t),function(e){var r=T[e]=t[e];T.prototype[e]=function(){var t=[this._wrapped];return u.apply(t,arguments),j.call(this,r.apply(T,t))}})};var F=0;T.uniqueId=function(t){var e=++F+"";return t?t+e:e},T.templateSettings={evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g,escape:/<%-([\s\S]+?)%>/g};var L=/(.)^/,O={"'":"'","\\":"\\","\r":"r","\n":"n","\t":"t","\u2028":"u2028","\u2029":"u2029"},N=/\\|'|\r|\n|\t|\u2028|\u2029/g;T.template=function(t,e,r){var n;r=T.defaults({},r,T.templateSettings);var i=new RegExp([(r.escape||L).source,(r.interpolate||L).source,(r.evaluate||L).source].join("|")+"|$","g"),o=0,a="__p+='";t.replace(i,function(e,r,n,i,s){return a+=t.slice(o,s).replace(N,function(t){return"\\"+O[t]}),r&&(a+="'+\n((__t=("+r+"))==null?'':_.escape(__t))+\n'"),n&&(a+="'+\n((__t=("+n+"))==null?'':__t)+\n'"),i&&(a+="';\n"+i+"\n__p+='"),o=s+e.length,e}),a+="';\n",r.variable||(a="with(obj||{}){\n"+a+"}\n"),a="var __t,__p='',__j=Array.prototype.join,print=function(){__p+=__j.call(arguments,'');};\n"+a+"return __p;\n";try{n=new Function(r.variable||"obj","_",a)}catch(t){throw t.source=a,t}if(e)return n(e,T);var s=function(t){return n.call(this,t,T)};return s.source="function("+(r.variable||"obj")+"){\n"+a+"}",s},T.chain=function(t){return T(t).chain()};var j=function(t){return this._chain?T(t).chain():t};T.mixin(T),S(["pop","push","reverse","shift","sort","splice","unshift"],function(t){var e=o[t];T.prototype[t]=function(){var r=this._wrapped;return e.apply(r,arguments),"shift"!=t&&"splice"!=t||0!==r.length||delete r[0],j.call(this,r)}}),S(["concat","join","slice"],function(t){var e=o[t];T.prototype[t]=function(){return j.call(this,e.apply(this._wrapped,arguments))}}),T.extend(T.prototype,{chain:function(){return this._chain=!0,this},value:function(){return this._wrapped}})}).call(this)},{}],196:[function(t,e,r){"use strict";e.exports=function(t,e,r){return 0===t.length?t:e?(r||t.sort(e),function(t,e){for(var r=1,n=t.length,i=t[0],o=t[0],a=1;a=a?u+1:a}n.mkdir(e+"sequencer"+a,function(){var o=e+"sequencer"+a+"/",s=r.steps;if(i){var u=s.slice(-1)[0].output.src,l=s.slice(-1)[0].output.format,c=t("data-uri-to-buffer")(u);n.writeFile(o+"image_"+(s.length-1)+"."+l,c,function(){})}else for(var h in s){u=s[h].output.src,l=s[h].output.format,c=t("data-uri-to-buffer")(u);n.writeFile(o+"image_"+h+"."+l,c,function(){})}})},n.readdir(l,function(t,e){var r=[];if(void 0===e||0==e.length)return c(r),[];for(var i=0;it.options.name),n=this;for(var i in n.image=arguments[0],arguments)e.push(a(arguments[i]));var o=l.call(this,e,"l");0!=this.getSteps().length&&(this.options.sequencerCounter=0,c=[],this.steps=[]),c.push({method:"loadImages",json_q:a(o)});var s={name:"ImageSequencer Wrapper",sequencer:this,addSteps:this.addSteps,removeSteps:this.removeSteps,insertSteps:this.insertSteps,run:this.run,UI:this.UI,setUI:this.setUI};t("./ui/LoadImage")(n,"image",o.image,function(){var t;t=n,0!=r.length&&(t.addSteps(r),r=[]),o.callback.call(s)})}function m(t){var e={};if("load-image"==t)return{};if(0==arguments.length){for(var r in this.modules)e[r]=s[r][1];for(var n in this.sequences)e[n]={name:n,steps:this.sequences[n]}}else e=s[t]?s[t][1]:{inputs:u[t].options};return e}var g=t("./Strings.js")(this.steps,m,f,a);return{name:"ImageSequencer",options:e,inputlog:c,modules:s,sequences:u,events:h,steps:[],image:void 0,loadImages:d,loadImage:d,addSteps:f,removeSteps:function(){var t,e="ImageSequencer"==this.name?this:this.sequencer,r=[];for(var n in arguments)r.push(a(arguments[n]));var i,o,s=l.call(e,r,"-");for(var u in c.push({method:"removeSteps",json_q:a(s)}),t=s.sort(function(t,e){return e-t}))i=e,(o=t[u])>0&&(thisStep=i.steps[o],thisStep.UI.onRemove(thisStep.options.step),i.steps.splice(o,1));return this},insertSteps:function(){var e="ImageSequencer"==this.name?this:this.sequencer,r=[];for(var n in arguments)r.push(arguments[n]);var i=l.call(e,r,"^");c.push({method:"insertSteps",json_q:a(i)});var o=i;for(var s in o=o.sort(function(t,e){return e.index-t.index}))t("./InsertStep")(e,o[s].index,o[s].name,o[s].o);return this},replaceImage:function(e,r,n){return(n=n||{}).callback=n.callback||function(){},t("./ReplaceImage")(this,e,r,n)},run:function(e){var r,n=0;(e=e||{mode:"no-arg"}).index&&(n=e.index),"no-arg"!=e.mode&&"function"!=typeof e&&(e.progressObj&&(r=e.progressObj),delete arguments[0]);var o="ImageSequencer"==this.name?this:this.sequencer,s=[];for(var u in arguments)s.push(a(arguments[u]));var c=function(){};for(var u in s)"Function"==i(s[u])&&(c=s.splice(u,1)[0]);var h=l.call(o,s,"r");return t("./Run")(o,h,c,n,r),!0},setUI:function(e){this.events=t("./ui/UserInterface")(e)},exportBin:function(e,r,n){return t("./ExportBin")(e,this,r,n)},modulesInfo:m,toCliString:g.toCliString,detectStringSyntax:g.detectStringSyntax,parseStringSyntax:g.parseStringSyntax,stringToSteps:g.stringToSteps,toString:g.toString,stepToString:g.stepToString,toJSON:g.toJSON,stringToJSON:g.stringToJSON,stringToJSONstep:g.stringToJSONstep,importString:g.importString,importJSON:g.importJSON,loadNewModule:function(e,r){if(!r)return this;if(Array.isArray(r))this.modules[e]=r;else if(r.func&&r.info)this.modules[e]=[r.func,r.info];else if(r.path&&!this.inBrowser){const n=[t(`${r.path}/Module.js`),t(`${r.path}/info.json`)];this.modules[e]=n}return this},saveNewModule:function(t,r){if(!e.inBrowser){var n=p.readFileSync("./src/Modules.js").toString();n=n.substr(0,n.length-1)+" '"+t+"': require('"+r+"'),\n}",p.writeFileSync("./src/Modules.js",n)}},createMetaModule:t("./util/createMetaModule"),saveSequence:function(r,n){const i=stringToJSON(n);var o;e.inBrowser?((o=JSON.parse(window.localStorage.getItem("sequences")))[r]=i,window.localStorage.setItem("sequences",JSON.stringify(o))):((o=t("./SavedSequences.json"))[r]=i,p.writeFileSync("./src/SavedSequences.json",JSON.stringify(o)))},loadModules:function(){this.modules=t("./Modules"),e.inBrowser?this.sequences=JSON.parse(window.localStorage.getItem("sequences")):this.sequences=t("./SavedSequences.json")},getSteps:function(){return this.steps},log:function(t,r){"none"!=e.ui&&(1==arguments.length?console.log(arguments[0]):2==arguments.length&&console.log(t,r))},objTypeOf:i,copy:a,setInputStep:t("./ui/SetInputStep")(r)}},e.exports=ImageSequencer},{"./AddStep":201,"./ExportBin":202,"./FormatInput":203,"./InsertStep":205,"./Modules":206,"./ReplaceImage":207,"./Run":208,"./SavedSequences.json":210,"./Strings.js":211,"./ui/LoadImage":351,"./ui/SetInputStep":352,"./ui/UserInterface":353,"./util/createMetaModule":355,"./util/getStep.js":357,fs:72}],205:[function(t,e,r){t("./util/getStep.js");e.exports=function(t,e,r,n){if(t.sequences[r])return t.importJSON(t.sequences[r]);if(t.detectStringSyntax(r))return t.stringToSteps(r);!function(e,r,n){if(t.modules[r])var i=t.modules[r][1];else console.log("Module "+r+" not found.");var o=t.copy(n);o.number=t.options.sequencerCounter++,o.name=n.name||r||i.name,o.description=n.description||i.description,o.selector=n.selector||"ismod-"+r,o.container=n.container||t.options.selector,o.inBrowser=t.options.inBrowser,-1==e&&(e=t.steps.length),o.step={name:o.name,description:o.description,ID:o.number,inBrowser:t.options.inBrowser,ui:t.options.ui,options:o};var a=t.events;t.modules[r].expandSteps=function(r){for(var n in r){let i=r[n];t.insertSteps(e+Number.parseInt(n),i.name,i.options)}},o=o||{},t.modules[r][1].length?t.modules[r][0](o,a):(a.onSetup(o.step,{index:e}),t.steps.splice(e,0,t.modules[r][0](o,a)))}(e,r,n),t.steps=t.steps}},{"./util/getStep.js":357}],206:[function(t,e,r){e.exports={"add-qr":t("./modules/AddQR"),average:t("./modules/Average"),blend:t("./modules/Blend"),blur:t("./modules/Blur"),brightness:t("./modules/Brightness"),"canvas-resize":t("./modules/CanvasResize"),channel:t("./modules/Channel"),colorbar:t("./modules/Colorbar"),"color-temperature":t("./modules/ColorTemperature"),colormap:t("./modules/Colormap"),contrast:t("./modules/Contrast"),convolution:t("./modules/Convolution"),crop:t("./modules/Crop"),"decode-qr":t("./modules/DecodeQr"),dither:t("./modules/Dither"),"draw-rectangle":t("./modules/DrawRectangle"),dynamic:t("./modules/Dynamic"),"edge-detect":t("./modules/EdgeDetect"),exposure:t("./modules/Exposure"),"flip-image":t("./modules/FlipImage"),"fisheye-gl":t("./modules/FisheyeGl"),histogram:t("./modules/Histogram"),"gamma-correction":t("./modules/GammaCorrection"),gradient:t("./modules/Gradient"),"grid-overlay":t("./modules/GridOverlay"),"import-image":t("./modules/ImportImage"),invert:t("image-sequencer-invert"),ndvi:t("./modules/Ndvi"),"ndvi-colormap":t("./modules/NdviColormap"),"paint-bucket":t("./modules/PaintBucket"),overlay:t("./modules/Overlay"),"replace-color":t("./modules/ReplaceColor"),resize:t("./modules/Resize"),rotate:t("./modules/Rotate"),saturation:t("./modules/Saturation"),"text-overlay":t("./modules/TextOverlay"),threshold:t("./modules/Threshold"),tint:t("./modules/Tint"),"webgl-distort":t("./modules/WebglDistort"),"white-balance":t("./modules/WhiteBalance")}},{"./modules/AddQR":214,"./modules/Average":217,"./modules/Blend":220,"./modules/Blur":224,"./modules/Brightness":227,"./modules/CanvasResize":230,"./modules/Channel":233,"./modules/ColorTemperature":236,"./modules/Colorbar":239,"./modules/Colormap":243,"./modules/Contrast":247,"./modules/Convolution":251,"./modules/Crop":256,"./modules/DecodeQr":259,"./modules/Dither":263,"./modules/DrawRectangle":267,"./modules/Dynamic":270,"./modules/EdgeDetect":274,"./modules/Exposure":277,"./modules/FisheyeGl":280,"./modules/FlipImage":284,"./modules/GammaCorrection":287,"./modules/Gradient":290,"./modules/GridOverlay":294,"./modules/Histogram":297,"./modules/ImportImage":301,"./modules/Ndvi":305,"./modules/NdviColormap":308,"./modules/Overlay":311,"./modules/PaintBucket":315,"./modules/ReplaceColor":319,"./modules/Resize":322,"./modules/Rotate":325,"./modules/Saturation":328,"./modules/TextOverlay":332,"./modules/Threshold":336,"./modules/Tint":339,"./modules/WebglDistort":343,"./modules/WhiteBalance":346,"image-sequencer-invert":87}],207:[function(t,e,r){e.exports=function(t,e,r,n){if(!t.options.inBrowser)return!1;var i=ImageSequencer({ui:!1});if(window.hasOwnProperty("$"))var o=$(e);else o=document.querySelectorAll(e);for(var a=[],s=0;s=e.steps.length?{options:{name:void 0}}:e.steps.slice(c+t)[0]},p.getIndex=function(){return c},n)n.hasOwnProperty(f)&&(p[f]=n[f]);p.UI.onDraw(p.options.step);var d=t("./RunToolkit")(e.copy(h));p.draw(d,function(){e.steps[c].options.step.output=e.steps[c].output.src,e.steps[c].UI.onComplete(e.steps[c].options.step),r(o,++s)},a)}}(s,o)}(r=function(t){0==t[0]&&1==e.steps.length?delete t[0]:0==t[0]&&t[0]++;for(var r=e.steps[t[0]-1];void 0===r||void 0===r.output;)r=e.steps[--t[0]-1];return t}(r))}},{"./RunToolkit":209,"./util/getStep.js":357}],209:[function(t,e,r){const n=t("get-pixels"),i=t("./modules/_nomodule/PixelManipulation"),o=t("lodash"),a=t("data-uri-to-buffer"),s=t("save-pixels");e.exports=function(t){return t.getPixels=n,t.pixelManipulation=i,t.lodash=o,t.dataUriToBuffer=a,t.savePixels=s,t}},{"./modules/_nomodule/PixelManipulation":348,"data-uri-to-buffer":18,"get-pixels":28,lodash:101,"save-pixels":189}],210:[function(t,e,r){e.exports={sample:[{name:"invert",options:{}},{name:"channel",options:{channel:"red"}},{name:"blur",options:{blur:"5"}}]}},{}],211:[function(t,e,r){e.exports=function(t,e,r,n){function i(t){return!(!t.includes(",")&&!t.includes("{"))}function o(t){return t.replace(/\s/g,"").split(",")}function a(t){var r=t.name?t.name:t.options.name;let n=e(r).inputs||{},i={};for(let e in n)t.options[e]&&t.options[e]!=n[e].default&&(i[e]=t.options[e],i[e]=encodeURIComponent(i[e]));return`${r}{${Object.keys(i).map(t=>t+":"+i[t]).join("|")}}`}function s(t){let e;return(e=i(t)?o(t):[t]).map(u)}function u(t){var e;if(e=t.includes("{")?t.includes("(")&&t.indexOf("(")=h&&d>=p?(r.set(f,d,0,a.get(f-h,d-p,0)),r.set(f,d,1,a.get(f-h,d-p,1)),r.set(f,d,2,a.get(f-h,d-p,2)),r.set(f,d,3,a.get(f-h,d-p,3))):(r.set(f,d,0,n.get(f,d,0)),r.set(f,d,1,n.get(f,d,1)),r.set(f,d,2,n.get(f,d,2)),r.set(f,d,3,n.get(f,d,3)));i()})})}},{"get-pixels":28,imagejs:88,qrcode:140}],214:[function(t,e,r){e.exports=[t("./Module"),t("./info.json")]},{"./Module":212,"./info.json":215}],215:[function(t,e,r){e.exports={name:"Add QR",description:"Adds QR corresponding to the given string",url:"https://github.com/publiclab/image-sequencer/tree/master/MODULES.md",inputs:{size:{type:"integer",desc:"size of QR code in pixels",default:200},qrCodeString:{type:"string",desc:"input string to generate QR code",default:"https://github.com/publiclab/image-sequencer"}},"docs-link":"https://github.com/publiclab/image-sequencer/blob/main/docs/MODULES.md#add-qr-module"}},{}],216:[function(t,e,r){e.exports=function(e,r){return e.step.metadata=e.step.metadata||{},{options:e,draw:function(r,n,i){i.stop(!0),i.overrideFlag=!0;var o=this;return t("../_nomodule/PixelManipulation.js")(r,{output:function(t,e,r){o.output={src:e,format:r}},extraManipulation:function(t){for(var r=0,n=[0,0,0,0];rAverages (r, g, b, a): "+n.join(", ")+"

"),t},format:r.format,image:e.image,callback:n})},output:void 0,UI:r}}},{"../_nomodule/PixelManipulation.js":348}],217:[function(t,e,r){arguments[4][214][0].apply(r,arguments)},{"./Module":216,"./info.json":218,dup:214}],218:[function(t,e,r){e.exports={name:"Average",description:"Average all pixel color",inputs:{},"docs-link":"https://github.com/publiclab/image-sequencer/blob/main/docs/MODULES.md#average-module"}},{}],219:[function(require,module,exports){module.exports=function Dynamic(options,UI,util){var defaults=require("./../../util/getDefaults.js")(require("./info.json")),output;function draw(input,callback,progressObj){progressObj.stop(!0),progressObj.overrideFlag=!0;var step=this;"string"==typeof options.func&&eval("options.func = "+options.func);var getPixels=require("get-pixels");"string"==typeof options.offset&&(options.offset=parseInt(options.offset));var priorStep=this.getStep(options.offset);void 0===priorStep.output&&(this.output=input,UI.notify("Offset Unavailable","offset-notification"),callback()),getPixels(priorStep.output.src,function(t,e){return options.firstImagePixels=e,require("../_nomodule/PixelManipulation.js")(input,{output:function(t,e,r){step.output={src:e,format:r}},changePixel:function(t,e,r,n,i,o){let a=options.firstImagePixels;return options.func(t,e,r,n,a.get(i,o,0),a.get(i,o,1),a.get(i,o,2),a.get(i,o,3))},format:input.format,image:options.image,inBrowser:options.inBrowser,callback:callback})})}return options.func=options.func||defaults.blend,options.offset=options.offset||defaults.offset,{options:options,draw:draw,output:output,UI:UI}}},{"../_nomodule/PixelManipulation.js":348,"./../../util/getDefaults.js":356,"./info.json":221,"get-pixels":28}],220:[function(t,e,r){arguments[4][214][0].apply(r,arguments)},{"./Module":219,"./info.json":221,dup:214}],221:[function(t,e,r){e.exports={name:"Blend",description:"Blend two chosen image steps with the given function. Defaults to using the red channel from image 1 and the green and blue and alpha channels of image 2. Easier to use interfaces coming soon!",inputs:{offset:{type:"integer",desc:"Choose which image to blend the current image with. Two steps back is -2, three steps back is -3 etc.",default:-2},blend:{type:"string",desc:"Function to use to blend the two images.",default:"function(r1, g1, b1, a1, r2, g2, b2, a2) { return [ r1, g2, b2, a2 ] }"}},"docs-link":"https://github.com/publiclab/image-sequencer/blob/main/docs/MODULES.md#blend-module"}},{}],222:[function(t,e,r){e.exports=function(e,r){let n=function(t=1){let e=[],r=0;0==t&&(t+=.05);const n=2*Math.pow(t,2);for(let t=-2;t<=2;t++){e.push([]);for(let i=-2;i<=2;i++){let o=Math.sqrt(Math.pow(i,2)+Math.pow(t,2));e[t+2].push(Math.exp(-o/n)),r+=e[t+2][i+2]}}for(let t=0;t<5;t++)for(let n=0;n<5;n++)e[n][t]=e[n][t]/r;return e}(r),i={r:[],g:[],b:[]};for(let t=0;t"40000"?"40000":e.temperature,i.stop(!0),i.overrideFlag=!0;var o=this;return t("../_nomodule/PixelManipulation.js")(r,{output:function(t,e,r){o.output={src:e,format:r}},extraManipulation:function(t){let r,n,i,o=parseInt(e.temperature);(o/=100)<=66?(r=255,n=Math.min(Math.max(99.4708025861*Math.log(o)-161.1195681661,0),255)):(r=Math.min(Math.max(329.698727446*Math.pow(o-60,-.1332047592),0),255),n=Math.min(Math.max(288.1221695283*Math.pow(o-60,-.0755148492),0),255)),o>=66?i=255:o<=19?i=0:(i=o-10,i=Math.min(Math.max(138.5177312231*Math.log(i)-305.0447927307,0),255));for(let e=0;em;r=0<=m?++c:--c)n[r]=(e-i)/(o-i)*(u[r]-s[r])+s[r];return n}}e.exports=function(t,e){return e.colormap=e.colormap||i.default,"object"==typeof e.colormap?colormapFunction=n(e.colormap):i.hasOwnProperty(e.colormap)?colormapFunction=i[e.colormap]:colormapFunction=i.default,colormapFunction(t/255)};var i={greyscale:n([[0,[0,0,0],[255,255,255]],[1,[255,255,255],[255,255,255]]]),bluwhtgrngis:n([[0,[6,23,86],[6,25,84]],[.0625,[6,25,84],[6,25,84]],[.125,[6,25,84],[6,25,84]],[.1875,[6,25,84],[6,25,84]],[.25,[6,25,84],[6,25,84]],[.3125,[6,25,84],[9,24,84]],[.3438,[9,24,84],[119,120,162]],[.375,[119,129,162],[249,250,251]],[.406,[249,250,251],[255,255,255]],[.4375,[255,255,255],[255,255,255]],[.5,[255,255,255],[214,205,191]],[.52,[214,205,191],[178,175,96]],[.5625,[178,175,96],[151,176,53]],[.593,[151,176,53],[146,188,12]],[.625,[146,188,12],[96,161,1]],[.6875,[96,161,1],[30,127,3]],[.75,[30,127,3],[0,99,1]],[.8125,[0,99,1],[0,74,1]],[.875,[0,74,1],[0,52,0]],[.9375,[0,52,0],[0,34,0]],[.968,[0,34,0],[68,70,67]]]),brntogrn:n([[0,[110,12,3],[118,6,1]],[.0625,[118,6,1],[141,19,6]],[.125,[141,19,6],[165,35,13]],[.1875,[165,35,13],[177,59,25]],[.2188,[177,59,25],[192,91,36]],[.25,[192,91,36],[214,145,76]],[.3125,[214,145,76],[230,183,134]],[.375,[230,183,134],[243,224,194]],[.4375,[243,224,194],[250,252,229]],[.5,[250,252,229],[217,235,185]],[.5625,[217,235,185],[184,218,143]],[.625,[184,218,143],[141,202,89]],[.6875,[141,202,89],[80,176,61]],[.75,[80,176,61],[0,147,32]],[.8125,[0,147,32],[1,122,22]],[.875,[1,122,22],[0,114,19]],[.9,[0,114,19],[0,105,18]],[.9375,[0,105,18],[7,70,14]]]),blutoredjet:n([[0,[0,0,140],[1,1,186]],[.0625,[1,1,186],[0,1,248]],[.125,[0,1,248],[0,70,254]],[.1875,[0,70,254],[0,130,255]],[.25,[0,130,255],[2,160,255]],[.2813,[2,160,255],[0,187,255]],[.3125,[0,187,255],[6,250,255]],[.375,[8,252,251],[27,254,228]],[.406,[27,254,228],[70,255,187]],[.4375,[70,255,187],[104,254,151]],[.47,[104,254,151],[132,255,19]],[.5,[132,255,19],[195,255,60]],[.5625,[195,255,60],[231,254,25]],[.5976,[231,254,25],[253,246,1]],[.625,[253,246,1],[252,210,1]],[.657,[252,210,1],[255,183,0]],[.6875,[255,183,0],[255,125,2]],[.75,[255,125,2],[255,65,1]],[.8125,[255,65,1],[247,1,1]],[.875,[247,1,1],[200,1,3]],[.9375,[200,1,3],[122,3,2]]]),colors16:n([[0,[0,0,0],[0,0,0]],[.0625,[3,1,172],[3,1,172]],[.125,[3,1,222],[3,1,222]],[.1875,[0,111,255],[0,111,255]],[.25,[3,172,255],[3,172,255]],[.3125,[1,226,255],[1,226,255]],[.375,[2,255,0],[2,255,0]],[.4375,[198,254,0],[190,254,0]],[.5,[252,255,0],[252,255,0]],[.5625,[255,223,3],[255,223,3]],[.625,[255,143,3],[255,143,3]],[.6875,[255,95,3],[255,95,3]],[.75,[242,0,1],[242,0,1]],[.8125,[245,0,170],[245,0,170]],[.875,[223,180,225],[223,180,225]],[.9375,[255,255,255],[255,255,255]]]),default:n([[0,[45,1,121],[25,1,137]],[.125,[25,1,137],[0,6,156]],[.1875,[0,6,156],[7,41,172]],[.25,[7,41,172],[22,84,187]],[.3125,[22,84,187],[25,125,194]],[.375,[25,125,194],[26,177,197]],[.4375,[26,177,197],[23,199,193]],[.47,[23,199,193],[25,200,170]],[.5,[25,200,170],[21,209,27]],[.5625,[21,209,27],[108,215,18]],[.625,[108,215,18],[166,218,19]],[.6875,[166,218,19],[206,221,20]],[.75,[206,221,20],[222,213,19]],[.7813,[222,213,19],[222,191,19]],[.8125,[222,191,19],[227,133,17]],[.875,[227,133,17],[231,83,16]],[.9375,[231,83,16],[220,61,48]]]),fastie:n([[0,[255,255,255],[0,0,0]],[.167,[0,0,0],[255,255,255]],[.33,[255,255,255],[0,0,0]],[.5,[0,0,0],[140,140,255]],[.55,[140,140,255],[0,255,0]],[.63,[0,255,0],[255,255,0]],[.75,[255,255,0],[255,0,0]],[.95,[255,0,0],[255,0,255]]]),stretched:n([[0,[0,0,255],[0,0,255]],[.1,[0,0,255],[38,195,195]],[.5,[0,150,0],[255,255,0]],[.7,[255,255,0],[255,50,50]],[.9,[255,50,50],[255,50,50]]])}},{}],242:[function(t,e,r){e.exports=function(e,r){return{options:e,draw:function(r,n,i){i.stop(!0),i.overrideFlag=!0;var o=this;return t("../_nomodule/PixelManipulation.js")(r,{output:function(t,e,r){o.output={src:e,format:r}},changePixel:function(r,n,i,o){var a=(r+n+i)/3,s=t("./Colormap")(a,e);return[s[0],s[1],s[2],255]},format:r.format,image:e.image,inBrowser:e.inBrowser,callback:n})},output:void 0,UI:r}}},{"../_nomodule/PixelManipulation.js":348,"./Colormap":241}],243:[function(t,e,r){arguments[4][214][0].apply(r,arguments)},{"./Module":242,"./info.json":244,dup:214}],244:[function(t,e,r){e.exports={name:"Colormap",description:"Maps brightness values (average of red, green & blue) to a given color lookup table, made up of a set of one more color gradients.\n\nFor example, 'cooler' colors like blue could represent low values, while 'hot' colors like red could represent high values.",inputs:{colormap:{type:"select",desc:"Name of the Colormap",default:"default",values:["default","greyscale","bluwhtgrngis","stretched","fastie","brntogrn","blutoredjet","colors16"]}},"docs-link":"https://github.com/publiclab/image-sequencer/blob/main/docs/MODULES.md#colormap-module"}},{}],245:[function(t,e,r){var n=t("lodash");e.exports=function(t,e){let r=n.cloneDeep(t);(e=Number(e))<-100&&(e=-100),e>100&&(e=100),e=(100+e)/100,e*=e;for(let n=0;n255&&(i=255);var o=r.get(n,s,1)/255;o-=.5,o*=e,o+=.5,(o*=255)<0&&(o=0),o>255&&(o=255);var a=r.get(n,s,2)/255;a-=.5,a*=e,a+=.5,(a*=255)<0&&(a=0),a>255&&(a=255),t.set(n,s,0,i),t.set(n,s,1,o),t.set(n,s,2,a)}return t}},{lodash:101}],246:[function(t,e,r){e.exports=function(e,r){var n=t("./../../util/getDefaults.js")(t("./info.json"));return e.contrast=e.contrast||n.contrast,{options:e,draw:function(r,n,i){i.stop(!0),i.overrideFlag=!0;var o=this;return t("../_nomodule/PixelManipulation.js")(r,{output:function(t,e,r){o.output={src:e,format:r}},extraManipulation:function(r){return r=t("./Contrast")(r,e.contrast)},format:r.format,image:e.image,callback:n})},output:void 0,UI:r}}},{"../_nomodule/PixelManipulation.js":348,"./../../util/getDefaults.js":356,"./Contrast":245,"./info.json":248}],247:[function(t,e,r){arguments[4][214][0].apply(r,arguments)},{"./Module":246,"./info.json":248,dup:214}],248:[function(t,e,r){e.exports={name:"Contrast",description:"Change the contrast of the image by given value",inputs:{contrast:{type:"integer",desc:"contrast for the new image, typically -100 to 100",default:70,min:-100,max:100}},"docs-link":"https://github.com/publiclab/image-sequencer/blob/main/docs/MODULES.md#contrast-module"}},{}],249:[function(t,e,r){t("lodash");e.exports=function(e,r,n,o){let a=function(t,e){for(e=e.split(" "),i=0;i<9;i++)e[i]=Number(e[i])*t;let r=0,n=[];for(y=0;y<3;y++)for(n.push([]),x=0;x<3;x++)n[y].push(e[r]),r+=1;return n}(r,n),s={r:[],g:[],b:[]};for(let t=0;tRead more",inputs:{constantFactor:{type:"float",desc:"a constant factor, multiplies all the kernel values by that factor",default:.111,min:.001,max:2,step:.001},kernelValues:{type:"string",desc:"nine space separated numbers representing the kernel values in left to right and top to bottom format.",default:"1 1 1 1 1 1 1 1 1",placeholder:"1 1 1 1 1 1 1 1 1"}},"docs-link":"https://github.com/publiclab/image-sequencer/blob/main/docs/MODULES.md#convolution-module"}},{}],253:[function(t,e,r){(function(r){e.exports=function(e,n,i){var o=t("./../../util/getDefaults.js")(t("./info.json")),a=t("get-pixels"),s=t("save-pixels");n.x=parseInt(n.x)||o.x,n.y=parseInt(n.y)||o.y,a(e.src,function(t,a){n.w=parseInt(n.w)||Math.floor(a.shape[0]),n.h=parseInt(n.h)||Math.floor(a.shape[1]),n.backgroundColor=n.backgroundColor||o.backgroundColor;var u=n.x,l=n.y,c=n.w,h=n.h,p=a.shape[0],f=a.shape[1],d=[];backgroundColor=n.backgroundColor.split(" ");for(var m=0;mRead more",inputs:{dither:{type:"select",desc:"Name of the Dithering Algorithm",default:"none",values:["none","floydsteinberg","bayer","Atkinson"]}},"docs-link":"https://github.com/publiclab/image-sequencer/blob/main/docs/MODULES.md#dither-module"}},{}],265:[function(t,e,r){e.exports=function(e,r){var n=t("./../../util/getDefaults.js")(t("./info.json"));r.startingX=r.startingX||n.startingX,r.startingY=r.startingY||n.startingY;var i=Number(r.startingX),o=Number(r.startingY),a=e.shape[0],s=e.shape[1],u=Number(r.thickness)||n.thickness,l=r.endX=Number(r.endX)-u||a-1,c=r.endY=Number(r.endY)-u||s-1,h=r.color||n.color;h=h.split(" ");var p=function(t,r,n,i){for(var o=t;o<=n+u;o++)for(var a=r;a<=i+u;a++)e.set(o,a,0,h[0]),e.set(o,a,1,h[1]),e.set(o,a,2,h[2]),e.set(o,a,3,h[3])};return p(i,o,i,c),p(l,o,l,c),p(i,o,l,o),p(i,c,l,c),e}},{"./../../util/getDefaults.js":356,"./info.json":268}],266:[function(t,e,r){e.exports=function(e,r){return{options:e,draw:function(r,n,i){i.stop(!0),i.overrideFlag=!0;var o=this;return t("../_nomodule/PixelManipulation.js")(r,{output:function(t,e,r){o.output={src:e,format:r}},changePixel:function(t,e,r,n){return[t,e,r,n]},extraManipulation:function(r){return r=t("./DrawRectangle")(r,e)},format:r.format,image:e.image,callback:n})},output:void 0,UI:r}}},{"../_nomodule/PixelManipulation.js":348,"./DrawRectangle":265}],267:[function(t,e,r){arguments[4][214][0].apply(r,arguments)},{"./Module":266,"./info.json":268,dup:214}],268:[function(t,e,r){e.exports={name:"Draw Rectangle",description:"It draws a rectangle on the image",inputs:{startingX:{type:"integer",desc:"starting x position of the rectangle",default:0},startingY:{type:"integer",desc:"starting y position of the rectangle",default:0},endX:{type:"integer",desc:"last x position of the rectangle",default:"width"},endY:{type:"integer",desc:"last y position of the rectangle",default:"height"},thickness:{type:"integer",desc:"thickness of border",default:1},color:{type:"string",desc:"RGBA values separated by a space",default:"0 0 0 255"}},"docs-link":"https://github.com/publiclab/image-sequencer/blob/main/docs/MODULES.md#draw-rectangle-module"}},{}],269:[function(require,module,exports){module.exports=function Dynamic(options,UI){var output;function draw(input,callback,progressObj){progressObj.stop(!0),progressObj.overrideFlag=!0;var step=this;function generator(expression){var func="f = function (r, g, b, a) { var R = r, G = g, B = b, A = a;",f;return func+="return ",func=func+expression+"}",eval(func),f}options.monochrome=options.monochrome||"(R+G+B)/3";var channels=["red","green","blue","alpha"];function changePixel(t,e,r,n){return[options.red_function(t,e,r,n),options.green_function(t,e,r,n),options.blue_function(t,e,r,n),options.alpha_function(t,e,r,n)]}function getNeighbourPixel(t,e,r,n,i){return[t.get(e+n,r+i,0),t.get(e+n,r+i,1),t.get(e+n,r+i,2),t.get(e+n,r+i,3)]}function map(t,e,r,n,i,o){var a=(t-e)/(r-e)*(i-n)+n;if(!o)return a;function s(t,e,r){return Math.max(Math.min(t,r),e)}return nInfragrammar.",inputs:{red:{type:"string",desc:"Expression to return for red channel with R, G, B, and A inputs",default:"r"},green:{type:"string",desc:"Expression to return for green channel with R, G, B, and A inputs",default:"g"},blue:{type:"string",desc:"Expression to return for blue channel with R, G, B, and A inputs",default:"b"},"monochrome (fallback)":{type:"string",desc:"Expression to return with R, G, B, and A inputs; fallback for other channels if none provided",default:"r + g + b"}},"docs-link":"https://github.com/publiclab/image-sequencer/blob/main/docs/MODULES.md#dynamic-module"}},{}],272:[function(t,e,r){const n=[[-1,0,1],[-2,0,2],[-1,0,1]],i=[[-1,-2,-1],[0,0,0],[1,2,1]];let o=[];function a(t,e){t.set(e[0],e[1],0,0),t.set(e[0],e[1],1,0),t.set(e[0],e[1],2,0),t.set(e[0],e[1],3,255)}function s(t,e,r){let o=t.get(e,r,0),a=0,s=0;for(let o=0;o<3;o++)for(let u=0;u<3;u++){let c=e+o-1,h=r+u-1;l(t,c,h)?(a+=t.get(c+1,h+1,0)*n[o][u],s+=t.get(c+1,h+1,0)*i[o][u]):(a+=t.get(c,h,0)*n[o][u],s+=t.get(c,h,0)*i[o][u])}return{pixel:[o,o,o,Math.sqrt(Math.pow(a,2)+Math.pow(s,2))],angle:Math.atan2(s,a)}}function u(t){return t>=-22.5&&t<=22.5||t<-157.5&&t>=-180?1:t>=22.5&&t<=67.5||t<-112.5&&t>=-157.5?2:t>=67.5&&t<=112.5||t<-67.5&&t>=-112.5?3:t>=112.5&&t<=157.5||t<-22.5&&t>=-67.5?4:void 0}function l(t,e,r){return e<0||r<0||e>=t.shape[0]||r>=t.shape[1]}e.exports=function(t,e,r,n){let i=[],f=[],d=[],m=[];for(var g=0;gt.map(h));for(let n=0;n=e[n][i+1]&&e[n][i]>=e[n][i-1]||o.push([n,i]);break;case 2:e[n][i]>=e[n+1][i+1]&&e[n][i]>=e[n-1][i-1]||o.push([n,i]);break;case 3:e[n][i]>=e[n+1][i]&&e[n][i]>=e[n-1][i]||o.push([n,i]);break;case 4:e[n][i]>=e[n+1][i-1]&&e[n][i]>=e[n-1][i+1]||o.push([n,i])}}}(t,f,i),function(t,e,r,n,i,a){const s=p(n)*e,u=s*r;for(let e=0;eu?n[e][r]>s?i.push(t):a.push(t):o.push(t)}}(t,e,r,f,d,m),"true"==n.toLowerCase()&&function(t,e){t.forEach(t=>{let r=t[0],n=t[1];e.includes([r+1,n])?c(e,[r+1,n]):e.includes([r-1,n])?c(e,[r-1,n]):e.includes([r,n+1])?c(e,[r,n+1]):e.includes([r,n-1])&&c(e,[r,n-1])})}(d,m),d.forEach(e=>(function(t,e){t.set(e[0],e[1],0,255),t.set(e[0],e[1],1,255),t.set(e[0],e[1],2,255),t.set(e[0],e[1],3,255)})(t,e)),m.forEach(e=>a(t,e)),o.forEach(e=>a(t,e)),t};const c=(t=[],e)=>t.filter(t=>t!==e);var h=t=>180*t/Math.PI,p=t=>Math.max(...t.map(t=>t.map(t=>t||0)).map(t=>Math.max(...t)))},{}],273:[function(t,e,r){e.exports=function(e,r){var n=t("./../../util/getDefaults.js")(t("./info.json"));return e.blur=e.blur||n.blur,e.highThresholdRatio=e.highThresholdRatio||n.highThresholdRatio,e.lowThresholdRatio=e.lowThresholdRatio||n.lowThresholdRatio,e.hysteresis=e.hysteresis||n.hysteresis,{options:e,draw:function(r,n,i){i.stop(!0),i.overrideFlag=!0;var o=this;const a=ImageSequencer({inBrowser:!1,ui:!1});return a.loadImage(r.src,function(){return a.importJSON([{name:"blur",options:{blur:e.blur}}]),a.run(function(i){t("get-pixels")(i,function(i,a){if(!i)return t("../_nomodule/PixelManipulation.js")(r,{output:function(t,e,r){o.output={src:e,format:r}},changePixel:function(t,e,r,n){return[(t+e+r)/3,(t+e+r)/3,(t+e+r)/3,n]},extraManipulation:function(){return t("./EdgeUtils")(a,e.highThresholdRatio,e.lowThresholdRatio,e.hysteresis)},format:r.format,image:e.image,inBrowser:e.inBrowser,callback:n})})})})},output:void 0,UI:r}}},{"../_nomodule/PixelManipulation.js":348,"./../../util/getDefaults.js":356,"./EdgeUtils":272,"./info.json":275,"get-pixels":28}],274:[function(t,e,r){arguments[4][214][0].apply(r,arguments)},{"./Module":273,"./info.json":275,dup:214}],275:[function(t,e,r){e.exports={name:"Detect Edges",description:"This module detects edges using the Canny method, which first Gaussian blurs the image to reduce noise (amount of blur configurable in settings as `options.blur`), then applies a number of steps to highlight edges, resulting in a greyscale image where the brighter the pixel, the stronger the detected edge. Read more. ",inputs:{blur:{type:"float",desc:"Amount of gaussian blur(Less blur gives more detail, typically 0-5)",default:2,min:.05,max:5,step:.05},highThresholdRatio:{type:"float",desc:"The high threshold ratio for the image",default:.2,min:0,max:1,step:.01},lowThresholdRatio:{type:"float",desc:"The low threshold value for the image",default:.15,min:0,max:1,step:.01},hysteresis:{type:"select",desc:"Toggle Hysteresis",values:["false","true"],default:"false"}},"docs-link":"https://github.com/publiclab/image-sequencer/blob/main/docs/MODULES.md#edge-detect-module"}},{}],276:[function(t,e,r){e.exports=function(e,r){var n=t("./../../util/getDefaults.js")(t("./info.json"));return{options:e,draw:function(r,i,o){e.exposure=e.exposure||n.exposure;var a=Math.pow(2,e.exposure);o.stop(!0),o.overrideFlag=!0;var s=this;return t("../_nomodule/PixelManipulation.js")(r,{output:function(t,e,r){s.output={src:e,format:r}},changePixel:function(t,e,r,n){return[t=Math.min(255,t*a),e=Math.min(255,e*a),r=Math.min(255,r*a),n]},format:r.format,image:e.image,inBrowser:e.inBrowser,callback:i})},output:void 0,UI:r}}},{"../_nomodule/PixelManipulation.js":348,"./../../util/getDefaults.js":356,"./info.json":278}],277:[function(t,e,r){arguments[4][214][0].apply(r,arguments)},{"./Module":276,"./info.json":278,dup:214}],278:[function(t,e,r){e.exports={name:"Exposure",description:"Change the exposure of the image by given exposure value",inputs:{exposure:{type:"float",desc:"exposure value for the new image",default:1,min:-3,max:4,step:.05}},"docs-link":"https://github.com/publiclab/image-sequencer/blob/main/docs/MODULES.md"}},{}],279:[function(t,e,r){e.exports=function(e,r){t("fisheyegl");return{options:e,draw:function(r,n){var i=this;if(e.inBrowser){if(document.querySelector("#image-sequencer-canvas"))var o=document.querySelector("#image-sequencer-canvas");else(o=document.createElement("canvas")).style.display="none",o.setAttribute("id","image-sequencer-canvas"),document.body.append(o);distorter=FisheyeGl({selector:"#image-sequencer-canvas"}),e.a=parseFloat(e.a)||distorter.lens.a,e.b=parseFloat(e.b)||distorter.lens.b,e.Fx=parseFloat(e.Fx)||distorter.lens.Fx,e.Fy=parseFloat(e.Fy)||distorter.lens.Fy,e.scale=parseFloat(e.scale)||distorter.lens.scale,e.x=parseFloat(e.x)||distorter.fov.x,e.y=parseFloat(e.y)||distorter.fov.y,distorter.lens.a=e.a,distorter.lens.b=e.b,distorter.lens.Fx=e.Fx,distorter.lens.Fy=e.Fy,distorter.lens.scale=e.scale,distorter.fov.x=e.x,distorter.fov.y=e.y,distorter.setImage(r.src,function(){i.output={src:o.toDataURL(),format:r.format},n()})}else t("../_nomodule/gl-context")(r,n,i,e)},output:void 0,UI:r}}},{"../_nomodule/gl-context":349,fisheyegl:20}],280:[function(t,e,r){arguments[4][214][0].apply(r,arguments)},{"./Module":279,"./info.json":281,dup:214}],281:[function(t,e,r){e.exports={name:"Fisheye GL",description:"Correct fisheye, or barrel distortion, in images (with WebGL -- adapted from fisheye-correction-webgl by @bluemir).",requires:["webgl"],inputs:{a:{type:"float",desc:"a parameter",default:1,min:1,max:4},b:{type:"float",desc:"b parameter",default:1,min:1,max:4},Fx:{type:"float",desc:"Fx parameter",default:0,min:0,max:4},Fy:{type:"float",desc:"Fy parameter",default:0,min:0,max:4},scale:{type:"float",desc:"Image Scaling",default:1.5,min:0,max:20},x:{type:"float",desc:"FOV x parameter",default:1.5,min:0,max:20},y:{type:"float",desc:"FOV y parameter",default:1.5,min:0,max:20},fragmentSrc:{type:"PATH",desc:"Path to a WebGL fragment shader file",default:"(inbuilt)"},vertexSrc:{type:"PATH",desc:"Path to a WebGL vertex shader file",default:"(inbuilt)"}},"docs-link":"https://github.com/publiclab/image-sequencer/blob/main/docs/MODULES.md#fisheyegl-module"}},{}],282:[function(t,e,r){e.exports=function(e,r){e.Axis=e.Axis||t("./info.json").inputs.Axis.default;var n=t("get-pixels");return{options:e,draw:function(r,i,o){o.stop(!0),o.overrideFlag=!0;var a=this;return n(r.src,function(n,o){return t("../_nomodule/PixelManipulation.js")(r,{output:function(t,e,r){a.output={src:e,format:r}},changePixel:function(t,e,r,n){return[t,e,r,n]},extraManipulation:function(r){if(!n)return t("./flipImage")(o,r,e.Axis);console.log(n)},format:r.format,image:e.image,inBrowser:e.inBrowser,callback:i})})},output:void 0,UI:r}}},{"../_nomodule/PixelManipulation.js":348,"./flipImage":283,"./info.json":285,"get-pixels":28}],283:[function(t,e,r){e.exports=function(t,e,r){var n=t.shape[0],i=t.shape[1];function o(r,n,i,o){e.set(r,n,0,t.get(i,o,0)),e.set(r,n,1,t.get(i,o,1)),e.set(r,n,2,t.get(i,o,2)),e.set(r,n,3,t.get(i,o,3))}return function(){if("vertical"==r.toLowerCase())for(var t=0;tRead more",inputs:{adjustment:{type:"float",desc:"gamma correction (inverse of actual gamma factor) for the new image",default:.2,min:2,max:1}},"docs-link":"https://github.com/publiclab/image-sequencer/blob/main/docs/MODULES.md#gamma-correction-module"}},{}],289:[function(t,e,r){(function(r){e.exports=function(e,n){return{options:e,draw:function(e,n,i){var o=t("get-pixels"),a=t("save-pixels"),s=this;o(e.src,function(t,i){if(t)console.log("Bad Image path");else{for(var o=i.shape[0],u=0;u{n.output=i.steps[0].output,r()})},output:void 0,UI:r}}},{"./../../util/getDefaults.js":356,"./Ui.js":300,"./info.json":302}],300:[function(t,e,r){e.exports=function(t,e){return{setup:function(e,r){var n="dropzone-import-image-"+t.ID,i='

Select or drag in an image to overlay.

';$(t.ui).find(".details").prepend(i),sequencer.setInputStep({dropZoneSelector:"#"+n,fileInputSelector:"#"+n+" .file-input",onLoad:function(e){var r=e.target;t.options.imageUrl=r.result,t.options.url=r.result,sequencer.run(),setUrlHashParameter("steps",sequencer.toString())}}),$(t.ui).find(".btn-save").on("click",function(){var e=$(t.ui).find(".det input").val();t.options.imageUrl=e,sequencer.run()})}}}},{}],301:[function(t,e,r){arguments[4][214][0].apply(r,arguments)},{"./Module":299,"./info.json":302,dup:214}],302:[function(t,e,r){e.exports={name:"Import Image",description:"Import a new image and replace the original with it. Future versions may enable a blend mode. Specify an image by URL or by file selector.",url:"https://github.com/publiclab/image-sequencer/tree/master/MODULES.md",inputs:{url:{type:"string",desc:"URL of image to import",default:"./images/monarch.png"}},"docs-link":"https://github.com/publiclab/image-sequencer/blob/main/docs/MODULES.md#import-image-module"}},{}],303:[function(t,e,r){e.exports=function(e,r){if(e.step.inBrowser)var n=t("./Ui.js")(e.step,r);var i=t("./../../util/getDefaults.js")(t("./info.json"));return e.filter=e.filter||i.filter,{options:e,draw:function(r,i,o){o.stop(!0),o.overrideFlag=!0;var a=this;return t("../_nomodule/PixelManipulation.js")(r,{output:function(t,e,r){a.output={src:e,format:r}},changePixel:function(t,r,n,i){if("red"==e.filter)var o=(n-t)/(1*n+t);"blue"==e.filter&&(o=(t-n)/(1*n+t));var a=255*(o+1)/2;return[a,a,a,i]},format:r.format,image:e.image,inBrowser:e.inBrowser,callback:function(){e.step.inBrowser&&n.setup(),i()}})},output:void 0,UI:r}}},{"../_nomodule/PixelManipulation.js":348,"./../../util/getDefaults.js":356,"./Ui.js":304,"./info.json":306}],304:[function(t,e,r){e.exports=function(t,e){return{setup:function(){var e=$(t.imgElement);e.mousemove(function(t){var r=document.createElement("canvas");r.width=e.width(),r.height=e.height(),r.getContext("2d").drawImage(this,0,0);var n=$(this).offset(),i=t.pageX-n.left,o=t.pageY-n.top,a=r.getContext("2d").getImageData(i,o,1,1).data[0];a=(a=a/127.5-1).toFixed(2),e[0].title="NDVI: "+a})}}}},{}],305:[function(t,e,r){arguments[4][214][0].apply(r,arguments)},{"./Module":303,"./info.json":306,dup:214}],306:[function(t,e,r){e.exports={name:"NDVI",description:"Normalized Difference Vegetation Index, or NDVI, is an image analysis technique used with aerial photography. It's a way to visualize the amounts of infrared and other wavelengths of light reflected from vegetation by comparing ratios of blue and red light absorbed versus green and IR light reflected. NDVI is used to evaluate the health of vegetation in satellite imagery, where it correlates with how much photosynthesis is happening. This is helpful in assessing vegetative health or stress. Read more.

This is designed for use with red-filtered single camera DIY Infragram cameras; change to 'blue' for blue filters",inputs:{filter:{type:"select",desc:"Filter color",default:"red",values:["red","blue"]}},"docs-link":"https://github.com/publiclab/image-sequencer/blob/main/docs/MODULES.md#ndvi-module"}},{}],307:[function(t,e,r){e.exports=t("../../util/createMetaModule.js")(function(t){return[{name:"ndvi",options:{}},{name:"colormap",options:{colormap:t.colormap}}]},{infoJson:t("./info.json")})[0]},{"../../util/createMetaModule.js":355,"./info.json":309}],308:[function(t,e,r){arguments[4][214][0].apply(r,arguments)},{"./Module":307,"./info.json":309,dup:214}],309:[function(t,e,r){e.exports={name:"NDVI-Colormap",description:"Sequentially Applies NDVI and Colormap steps",inputs:{},"docs-link":"https://github.com/publiclab/image-sequencer/blob/main/docs/MODULES.md#ndvi-colormap-module"}},{}],310:[function(t,e,r){e.exports=function(e,r,n){var i=t("./../../util/getDefaults.js")(t("./info.json"));return e.x=e.x||i.x,e.y=e.y||i.y,{options:e,draw:function(r,n,i){e.offset=parseInt(e.offset)||-2,i.stop(!0),i.overrideFlag=!0;var o=this;t("../../util/ParseInputCoordinates")(e,{src:r.src,x:{valInp:e.x,type:"horizontal"},y:{valInp:e.y,type:"vertical"}},function(t,e){t.x=parseInt(e.x.valInp),t.y=parseInt(e.y.valInp)});var a=this.getStep(e.offset).image,s=this.getOutput(e.offset);t("get-pixels")(r.src,function(r,i){return e.secondImagePixels=i,t("../_nomodule/PixelManipulation.js")(s,{output:function(t,e,r){o.output={src:e,format:r}},changePixel:function(t,r,n,i,o,a){var s=e.secondImagePixels;return o>=e.x&&o-e.x=e.y&&a-e.y=f*x&&e.get(t,r,0)<=f*b&&e.get(t,r,1)>=d*x&&e.get(t,r,1)<=d*b&&e.get(t,r,2)>=m*x&&e.get(t,r,2)<=m*b&&e.get(t,r,3)>=g*x&&e.get(t,r,3)<=g*b}for(l=l.split(" ");_.length;)if(w(i=v.pop(),n=_.pop())){o=a=n;do{o-=1}while(w(i,o)&&o>=0);do{a+=1}while(w(i,a)&&a=o*c&&t<=o*l&&e>=a*c&&e<=a*l&&r>=s*c&&r<=s*l}for(var p=0;pa&&(a=h,s=u)}return s}(n));for(var c=0;c<=l;c+=4)e.data[c]=e.data[c]=0?atob(t.split(",")[1]):unescape(t.split(",")[1]);for(var r=t.split(",")[0].split(":")[1].split(";")[0],n=new Uint8Array(e.length),i=0;i{a("img",[0,0,u.naturalWidth,0,u.naturalWidth,u.naturalHeight,0,u.naturalHeight],s),u.onload=(()=>{var t=document.createElement("canvas");t.width=u.naturalWidth,t.height=u.naturalHeight,t.getContext("2d").drawImage(u,0,0),o.output={src:t.toDataURL("image/png"),format:"png"},u.remove(),i()})}),u.src=r.src,u.id="img",document.body.appendChild(u)}else t("../_nomodule/gl-context")(r,i,o,e)},output:void 0,UI:r}}},{"../../util/parseDistortCoordinates.js":358,"../_nomodule/gl-context":349,"./../../util/getDefaults.js":356,"./glfx":342,"./info.json":344}],342:[function(t,e,r){e.exports=function(){function t(t,e,r){return Math.max(t,Math.min(e,r))}function e(t){return{_:t,loadContentsOf:function(t){N=this._.gl,this._.loadContentsOf(t)},destroy:function(){N=this._.gl,this._.destroy()}}}function r(t){return e(z.fromElement(t))}function n(t,e){var r=N.UNSIGNED_BYTE;if(N.getExtension("OES_texture_float")&&N.getExtension("OES_texture_float_linear")){var n=new z(100,100,N.RGBA,N.FLOAT);try{n.drawTo(function(){r=N.FLOAT})}catch(t){}n.destroy()}this._.texture&&this._.texture.destroy(),this._.spareTexture&&this._.spareTexture.destroy(),this.width=t,this.height=e,this._.texture=new z(t,e,N.RGBA,r),this._.spareTexture=new z(t,e,N.RGBA,r),this._.extraTexture=this._.extraTexture||new z(0,0,N.RGBA,r),this._.flippedShader=this._.flippedShader||new U(null,"uniform sampler2D texture;varying vec2 texCoord;void main(){gl_FragColor=texture2D(texture,vec2(texCoord.x,1.0-texCoord.y));}"),this._.isInitialized=!0}function i(t,e,r){return this._.isInitialized&&t._.width==this.width&&t._.height==this.height||n.call(this,e||t._.width,r||t._.height),t._.use(),this._.texture.drawTo(function(){U.getDefaultShader().drawRect()}),this}function o(){return this._.texture.use(),this._.flippedShader.drawRect(),this}function a(t,e,r,n){(r||this._.texture).use(),this._.spareTexture.drawTo(function(){t.uniforms(e).drawRect()}),this._.spareTexture.swapWith(n||this._.texture)}function s(t){return t.parentNode.insertBefore(this,t),t.parentNode.removeChild(t),this}function u(){var t=new z(this._.texture.width,this._.texture.height,N.RGBA,N.UNSIGNED_BYTE);return this._.texture.use(),t.drawTo(function(){U.getDefaultShader().drawRect()}),e(t)}function l(){var t=this._.texture.width,e=this._.texture.height,r=new Uint8Array(4*t*e);return this._.texture.drawTo(function(){N.readPixels(0,0,t,e,N.RGBA,N.UNSIGNED_BYTE,r)}),r}function c(t){return function(){return N=this._.gl,t.apply(this,arguments)}}function h(t,e,r,n,i,o,a,s){var u,l,c=n-o,h=s-o,p=(l=r-i)*h-(u=a-i)*c;return[r-t+(u=((i=t-r+i-a)*h-u*(o=e-n+o-s))/p)*r,n-e+u*n,u,a-t+(l=(l*o-i*c)/p)*a,s-e+l*s,l,t,e,1]}function p(t){var e=t[0],r=t[1],n=t[2],i=t[3],o=t[4],a=t[5],s=t[6],u=t[7],l=e*o*(t=t[8])-e*a*u-r*i*t+r*a*s+n*i*u-n*o*s;return[(o*t-a*u)/l,(n*u-r*t)/l,(r*a-n*o)/l,(a*s-i*t)/l,(e*t-n*s)/l,(n*i-e*a)/l,(i*u-o*s)/l,(r*s-e*u)/l,(e*o-r*i)/l]}function f(t){var e=t.length;this.xa=[],this.ya=[],this.u=[],this.y2=[],t.sort(function(t,e){return t[0]-e[0]});for(var r=0;r0.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;}"),a.call(this,N.brightnessContrast,{brightness:t(-1,e,1),contrast:t(-1,r,1)}),this}function g(e){e=new f(e);for(var r=[],n=0;256>n;n++)r.push(t(0,Math.floor(256*e.interpolate(n/255)),255));return r}function v(t,e,r){t=g(t),1==arguments.length?e=r=t:(e=g(e),r=g(r));for(var n=[],i=0;256>i;i++)n.splice(n.length,0,t[i],e[i],r[i],255);return this._.extraTexture.initFromBytes(256,1,n),this._.extraTexture.use(1),N.curves=N.curves||new U(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;}"),N.curves.textures({map:1}),a.call(this,N.curves,{}),this}function _(t){N.denoise=N.denoise||new U(null,"uniform sampler2D texture;uniform float exponent;uniform float strength;uniform vec2 texSize;varying vec2 texCoord;void main(){vec4 center=texture2D(texture,texCoord);vec4 color=vec4(0.0);float total=0.0;for(float x=-4.0;x<=4.0;x+=1.0){for(float y=-4.0;y<=4.0;y+=1.0){vec4 sample=texture2D(texture,texCoord+vec2(x,y)/texSize);float weight=1.0-abs(dot(sample.rgb-center.rgb,vec3(0.25)));weight=pow(weight,exponent);color+=sample*weight;total+=weight;}}gl_FragColor=color/total;}");for(var e=0;2>e;e++)a.call(this,N.denoise,{exponent:Math.max(0,t),texSize:[this.width,this.height]});return this}function y(e,r){return N.hueSaturation=N.hueSaturation||new U(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;}"),a.call(this,N.hueSaturation,{hue:t(-1,e,1),saturation:t(-1,r,1)}),this}function b(e){return N.noise=N.noise||new U(null,"uniform sampler2D texture;uniform float amount;varying vec2 texCoord;float rand(vec2 co){return fract(sin(dot(co.xy,vec2(12.9898,78.233)))*43758.5453);}void main(){vec4 color=texture2D(texture,texCoord);float diff=(rand(texCoord)-0.5)*amount;color.r+=diff;color.g+=diff;color.b+=diff;gl_FragColor=color;}"),a.call(this,N.noise,{amount:t(0,e,1)}),this}function x(e){return N.sepia=N.sepia||new U(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;}"),a.call(this,N.sepia,{amount:t(0,e,1)}),this}function w(t,e){return N.unsharpMask=N.unsharpMask||new U(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(){U.getDefaultShader().drawRect()}),this._.extraTexture.use(1),this.triangleBlur(t),N.unsharpMask.textures({originalTexture:1}),a.call(this,N.unsharpMask,{strength:e}),this._.extraTexture.unuse(1),this}function E(e){return N.vibrance=N.vibrance||new U(null,"uniform sampler2D texture;uniform float amount;varying vec2 texCoord;void main(){vec4 color=texture2D(texture,texCoord);float average=(color.r+color.g+color.b)/3.0;float mx=max(color.r,max(color.g,color.b));float amt=(mx-average)*(-amount*3.0);color.rgb=mix(color.rgb,vec3(mx),amt);gl_FragColor=color;}"),a.call(this,N.vibrance,{amount:t(-1,e,1)}),this}function k(e,r){return N.vignette=N.vignette||new U(null,"uniform sampler2D texture;uniform float size;uniform float amount;varying vec2 texCoord;void main(){vec4 color=texture2D(texture,texCoord);float dist=distance(texCoord,vec2(0.5,0.5));color.rgb*=smoothstep(0.8,size*0.799,dist*(amount+size));gl_FragColor=color;}"),a.call(this,N.vignette,{size:t(0,e,1),amount:t(0,r,1)}),this}function T(e,r,n){N.lensBlurPrePass=N.lensBlurPrePass||new U(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;"+G+"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;}";N.lensBlur0=N.lensBlur0||new U(null,i+"void main(){gl_FragColor=sample(delta0);}"),N.lensBlur1=N.lensBlur1||new U(null,i+"void main(){gl_FragColor=(sample(delta0)+sample(delta1))*0.5;}"),N.lensBlur2=N.lensBlur2||new U(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 o=0;3>o;o++){var s=n+2*o*Math.PI/3;i.push([e*Math.sin(s)/this.width,e*Math.cos(s)/this.height])}return e=Math.pow(10,t(-1,r,1)),a.call(this,N.lensBlurPrePass,{power:e}),this._.extraTexture.ensureFormat(this._.texture),a.call(this,N.lensBlur0,{delta0:i[0]},this._.texture,this._.extraTexture),a.call(this,N.lensBlur1,{delta0:i[1],delta1:i[2]},this._.extraTexture,this._.extraTexture),a.call(this,N.lensBlur0,{delta0:i[1]}),this._.extraTexture.use(1),a.call(this,N.lensBlur2,{power:1/e,delta0:i[2]}),this}function S(t,e,r,n,i,o){N.tiltShift=N.tiltShift||new U(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;"+G+"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 s=r-t,u=n-e,l=Math.sqrt(s*s+u*u);return a.call(this,N.tiltShift,{blurRadius:i,gradientRadius:o,start:[t,e],end:[r,n],delta:[s/l,u/l],texSize:[this.width,this.height]}),a.call(this,N.tiltShift,{blurRadius:i,gradientRadius:o,start:[t,e],end:[r,n],delta:[-u/l,s/l],texSize:[this.width,this.height]}),this}function A(t){return N.triangleBlur=N.triangleBlur||new U(null,"uniform sampler2D texture;uniform vec2 delta;varying vec2 texCoord;"+G+"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;}"),a.call(this,N.triangleBlur,{delta:[t/this.width,0]}),a.call(this,N.triangleBlur,{delta:[0,t/this.height]}),this}function C(t,e,r){return N.zoomBlur=N.zoomBlur||new U(null,"uniform sampler2D texture;uniform vec2 center;uniform float strength;uniform vec2 texSize;varying vec2 texCoord;"+G+"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;}"),a.call(this,N.zoomBlur,{center:[t,e],strength:r,texSize:[this.width,this.height]}),this}function R(t,e,r,n){return N.colorHalftone=N.colorHalftone||new U(null,"uniform sampler2D texture;uniform vec2 center;uniform float angle;uniform float scale;uniform vec2 texSize;varying vec2 texCoord;float pattern(float angle){float s=sin(angle),c=cos(angle);vec2 tex=texCoord*texSize-center;vec2 point=vec2(c*tex.x-s*tex.y,s*tex.x+c*tex.y)*scale;return(sin(point.x)*sin(point.y))*4.0;}void main(){vec4 color=texture2D(texture,texCoord);vec3 cmy=1.0-color.rgb;float k=min(cmy.x,min(cmy.y,cmy.z));cmy=(cmy-k)/(1.0-k);cmy=clamp(cmy*10.0-3.0+vec3(pattern(angle+0.26179),pattern(angle+1.30899),pattern(angle)),0.0,1.0);k=clamp(k*10.0-5.0+pattern(angle+0.78539),0.0,1.0);gl_FragColor=vec4(1.0-cmy-k,color.a);}"),a.call(this,N.colorHalftone,{center:[t,e],angle:r,scale:Math.PI/n,texSize:[this.width,this.height]}),this}function B(t,e,r,n){return N.dotScreen=N.dotScreen||new U(null,"uniform sampler2D texture;uniform vec2 center;uniform float angle;uniform float scale;uniform vec2 texSize;varying vec2 texCoord;float pattern(){float s=sin(angle),c=cos(angle);vec2 tex=texCoord*texSize-center;vec2 point=vec2(c*tex.x-s*tex.y,s*tex.x+c*tex.y)*scale;return(sin(point.x)*sin(point.y))*4.0;}void main(){vec4 color=texture2D(texture,texCoord);float average=(color.r+color.g+color.b)/3.0;gl_FragColor=vec4(vec3(average*10.0-5.0+pattern()),color.a);}"),a.call(this,N.dotScreen,{center:[t,e],angle:r,scale:Math.PI/n,texSize:[this.width,this.height]}),this}function P(t){return N.edgeWork1=N.edgeWork1||new U(null,"uniform sampler2D texture;uniform vec2 delta;varying vec2 texCoord;"+G+"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);}"),N.edgeWork2=N.edgeWork2||new U(null,"uniform sampler2D texture;uniform vec2 delta;varying vec2 texCoord;"+G+"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);}"),a.call(this,N.edgeWork1,{delta:[t/this.width,0]}),a.call(this,N.edgeWork2,{delta:[0,t/this.height]}),this}function I(t,e,r){return N.hexagonalPixelate=N.hexagonalPixelate||new U(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;"),a.call(this,N.bulgePinch,{radius:n,strength:t(-1,i,1),center:[e,r],texSize:[this.width,this.height]}),this}function F(t,e,r){if(N.matrixWarp=N.matrixWarp||d("uniform mat3 matrix;uniform bool useTextureSpace;","if(useTextureSpace)coord=coord/texSize*2.0-1.0;vec3 warp=matrix*vec3(coord,1.0);coord=warp.xy/warp.z;if(useTextureSpace)coord=(coord*0.5+0.5)*texSize;"),4==(t=Array.prototype.concat.apply([],t)).length)t=[t[0],t[1],0,t[2],t[3],0,0,0,1];else if(9!=t.length)throw"can only warp with 2x2 or 3x3 matrix";return a.call(this,N.matrixWarp,{matrix:e?p(t):t,texSize:[this.width,this.height],useTextureSpace:0|r}),this}function L(t,e){var r=h.apply(null,e),n=h.apply(null,t);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]])}function O(t,e,r,n){return N.swirl=N.swirl||d("uniform float radius;uniform float angle;uniform vec2 center;","coord-=center;float distance=length(coord);if(distance>1;this.xa[n]>t?r=n:e=n}n=this.xa[r]-this.xa[e];var i=(this.xa[r]-t)/n;return t=(t-this.xa[e])/n,i*this.ya[e]+t*this.ya[r]+((i*i*i-i)*this.y2[e]+(t*t*t-t)*this.y2[r])*n*n/6};var z=function(){function t(t,e,r,n){this.gl=N,this.id=N.createTexture(),this.width=t,this.height=e,this.format=r,this.type=n,N.bindTexture(N.TEXTURE_2D,this.id),N.texParameteri(N.TEXTURE_2D,N.TEXTURE_MAG_FILTER,N.LINEAR),N.texParameteri(N.TEXTURE_2D,N.TEXTURE_MIN_FILTER,N.LINEAR),N.texParameteri(N.TEXTURE_2D,N.TEXTURE_WRAP_S,N.CLAMP_TO_EDGE),N.texParameteri(N.TEXTURE_2D,N.TEXTURE_WRAP_T,N.CLAMP_TO_EDGE),t&&e&&N.texImage2D(N.TEXTURE_2D,0,this.format,t,e,0,this.format,this.type,null)}function e(t){return null==r&&(r=document.createElement("canvas")),r.width=t.width,r.height=t.height,(t=r.getContext("2d")).clearRect(0,0,r.width,r.height),t}t.fromElement=function(e){var r=new t(0,0,N.RGBA,N.UNSIGNED_BYTE);return r.loadContentsOf(e),r},t.prototype.loadContentsOf=function(t){this.width=t.width||t.videoWidth,this.height=t.height||t.videoHeight,N.bindTexture(N.TEXTURE_2D,this.id),N.texImage2D(N.TEXTURE_2D,0,this.format,this.format,this.type,t)},t.prototype.initFromBytes=function(t,e,r){this.width=t,this.height=e,this.format=N.RGBA,this.type=N.UNSIGNED_BYTE,N.bindTexture(N.TEXTURE_2D,this.id),N.texImage2D(N.TEXTURE_2D,0,N.RGBA,t,e,0,N.RGBA,this.type,new Uint8Array(r))},t.prototype.destroy=function(){N.deleteTexture(this.id),this.id=null},t.prototype.use=function(t){N.activeTexture(N.TEXTURE0+(t||0)),N.bindTexture(N.TEXTURE_2D,this.id)},t.prototype.unuse=function(t){N.activeTexture(N.TEXTURE0+(t||0)),N.bindTexture(N.TEXTURE_2D,null)},t.prototype.ensureFormat=function(t,e,r,n){if(1==arguments.length){var i=arguments[0];t=i.width,e=i.height,r=i.format,n=i.type}t==this.width&&e==this.height&&r==this.format&&n==this.type||(this.width=t,this.height=e,this.format=r,this.type=n,N.bindTexture(N.TEXTURE_2D,this.id),N.texImage2D(N.TEXTURE_2D,0,this.format,t,e,0,this.format,this.type,null))},t.prototype.drawTo=function(t){if(N.framebuffer=N.framebuffer||N.createFramebuffer(),N.bindFramebuffer(N.FRAMEBUFFER,N.framebuffer),N.framebufferTexture2D(N.FRAMEBUFFER,N.COLOR_ATTACHMENT0,N.TEXTURE_2D,this.id,0),N.checkFramebufferStatus(N.FRAMEBUFFER)!==N.FRAMEBUFFER_COMPLETE)throw Error("incomplete framebuffer");N.viewport(0,0,this.width,this.height),t(),N.bindFramebuffer(N.FRAMEBUFFER,null)};var r=null;return t.prototype.fillUsingCanvas=function(t){return t(e(this)),this.format=N.RGBA,this.type=N.UNSIGNED_BYTE,N.bindTexture(N.TEXTURE_2D,this.id),N.texImage2D(N.TEXTURE_2D,0,N.RGBA,N.RGBA,N.UNSIGNED_BYTE,r),this},t.prototype.toImage=function(t){this.use(),U.getDefaultShader().drawRect();var n=4*this.width*this.height,i=new Uint8Array(n),o=e(this),a=o.createImageData(this.width,this.height);N.readPixels(0,0,this.width,this.height,N.RGBA,N.UNSIGNED_BYTE,i);for(var s=0;s{e.goto("https://google.com").then(()=>{e.addScriptTag({path:require("path").join(__dirname,"../../../dist/image-sequencer.js")}).then(()=>{e.evaluate(t=>new Promise((e,r)=>{var n=ImageSequencer();n.loadImage(t.input.src),n.addSteps(t.modOptions.step,t.modOptions),n.run(function(t){e(n.steps[1].output.src)})}),obj).then(e=>{t.close().then(()=>{step.output={src:e,format:input.format},callback()})})})})})})}}).call(this,"/src/modules/_nomodule")},{lodash:101,path:117}],350:[function(t,e,r){const n=t("gpu.js").GPU;e.exports={convolve:(t,e,r={})=>{const i=r.pipeMode||!1,o=r.mode||"gpu",a=new n("gpu"!=o?{mode:o}:{}),s=t[0][0].length,u=t[0].length,l=e[0].length,c=e.length,h=Math.floor(l/2),p=Math.floor(c/2),f=`function (array, kernel) {\n let sum = 0;\n for (let i = 0; i < ${l}; i++){\n for (let j = 0; j < ${c}; j++){\n sum += kernel[j][i] * array[this.thread.y + j][this.thread.x + i];\n }\n }\n return sum;\n }`,d=t=>{let e=[];for(var r=0;r{e=e.toString();const i=gpu.createKernel(e,{output:t,constants:r,pipeline:n});return i.build(),n?i().toArray():i()}}},{"gpu.js":60}],351:[function(t,e,r){e.exports=function(e,r,n,i){return function(r,n){!function(r,n,i){var o;if(r.match(/^data:/i))i(o=r,n);else if(!e.options.inBrowser&&r.match(/^https?:\/\//i))t(r.match(/^(https?):\/\//i)[1]).get(r,function(t){var e="",r=t.headers["content-type"];t.setEncoding("base64"),t.on("data",function(t){e+=t}),t.on("end",function(){i("data:"+r+";base64,"+e,n)})});else if(e.options.inBrowser){var a=r.split(".").pop(),s=document.createElement("img"),u=document.createElement("canvas"),l=u.getContext("2d");s.onload=function(){u.width=s.naturalWidth,u.height=s.naturalHeight,l.drawImage(s,0,0),o=u.toDataURL(a),i(o,n)},s.src=r}else o=t("urify")(r),i(o,n)}(n,{name:"load-image",description:"This initial step loads and displays the original image without any modifications.",ID:e.options.sequencerCounter++,inBrowser:e.options.inBrowser,ui:e.options.ui,UI:e.events,output:""},function(t,r){var n=function(t){return{src:t,format:t.split(":")[1].split(";")[0].split("/")[1]}}(t);return e.steps.push(r),e.steps[0].output=n,e.steps[0].UI.onSetup(e.steps[0]),e.steps[0].UI.onDraw(e.steps[0]),e.steps[0].UI.onComplete(e.steps[0]),i(),!0})}(0,n)}},{urify:197}],352:[function(t,e,r){e.exports=function(){return function(t){var e=$(t.dropZoneSelector),r=$(t.fileInputSelector),n=$(t.takePhotoSelector),i=t.onLoad;function o(t){if(t.preventDefault(),t.stopPropagation(),t.target&&t.target.files)var e=t.target.files[0];else e=t.dataTransfer.files[0];if(e){var r=new FileReader;r.onload=i,r.readAsDataURL(e)}}t.onTakePhoto,new FileReader,r.on("change",o),n.on("click",function(){document.getElementById("video").style.display="inline",document.getElementById("capture").style.display="inline",document.getElementById("close").style.display="inline";var e=document.getElementById("video");canvas=document.getElementById("canvas"),context=canvas.getContext("2d"),vendorUrl=window.URL||window.webkitURL,navigator.mediaDevices.getUserMedia({audio:!1,video:!0}).then(function(t){window.stream=t,e.srcObject=t,e.onloadedmetadata=function(t){e.play()},document.getElementById("close").addEventListener("click",function(){!function(t){t.getVideoTracks().forEach(function(t){t.stop()}),document.getElementById("video").style.display="none",document.getElementById("capture").style.display="none",document.getElementById("close").style.display="none"}(t)})}).catch(function(t){console.log("navigator.getUserMedia error: ",t)}),document.getElementById("capture").addEventListener("click",function(r){context.drawImage(e,0,0,400,300),t.onTakePhoto(canvas.toDataURL())})}),e[0].addEventListener("drop",o,!1),e.on("dragover",function(t){t.stopPropagation(),t.preventDefault(),t.dataTransfer.dropEffect="copy"},!1),e.on("dragenter",function(t){e.addClass("hover")}),e.on("dragleave",function(t){e.removeClass("hover")})}}},{}],353:[function(t,e,r){e.exports=function(t={}){return t.onSetup=t.onSetup||function(t){0==t.ui||(t.inBrowser?console.log('Added Step "'+t.name+'"'):console.log("%s",'Added Step "'+t.name+'"'))},t.onDraw=t.onDraw||function(t){0==t.ui||(t.inBrowser?console.log('Drawing Step "'+t.name+'"'):console.log("%s",'Drawing Step "'+t.name+'"'))},t.onComplete=t.onComplete||function(t){0==t.ui||(t.inBrowser?console.log('Drawn Step "'+t.name+'"'):console.log("%s",'Drawn Step "'+t.name+'"'))},t.onRemove=t.onRemove||function(t){0==t.ui||(t.inBrowser?console.log('Removing Step "'+t.name+'"'):console.log("%s",'Removing Step "'+t.name+'"'))},t.notify=t.notify||function(t){console.log(t)},t}},{}],354:[function(t,e,r){e.exports=function(e,r,n){t("get-pixels")(r.src,function(t,i){var o=i.shape[0],a=i.shape[1];if(r.x.valInp){Object.keys(r).forEach(function(t){var e=r[t];e.valInp&&"%"===e.valInp.slice(-1)&&(e.valInp=parseInt(e.valInp,10),"horizontal"===e.type?e.valInp=e.valInp*o/100:e.valInp=e.valInp*a/100)});n(e,r)}})}},{"get-pixels":28}],355:[function(t,e,r){e.exports=function(e,r){return(r=r||{}).infoJson=r.infoJson||{},[function(n,i){var o=t("./getDefaults.js")(r.infoJson);for(key in r.infoJson.inputs)r.infoJson.inputs.hasOwnProperty(key)&&(n[key]=n[key]||o[key]);var a=e(n),s=ImageSequencer({inBrowser:!1,ui:!1});return{options:n,draw:function(t,e){var r=this;s.loadImage(t.src,function(){s.importJSON(a),s.run(function(n){r.output={src:n,format:t.format},e()})})},output:void 0,UI:i}},r.infoJson]}},{"./getDefaults.js":356}],356:[function(t,e,r){e.exports=function(t){var e={};for(var r in t.inputs)t.inputs.hasOwnProperty(r)&&(e[r]=t.inputs[r].default);return e}},{}],357:[function(t,e,r){e.exports={getPreviousStep:function(){return this.getStep(-1)},getNextStep:function(){return this.getStep(1)},getInput:function(t){return t+this.getIndex()===0&&t++,this.getStep(t-1).output},getOutput:function(t){return this.getStep(t).output},getOptions:function(){return this.getStep(0).options},setOptions:function(t){let e=this.getStep(0).options;for(let r in t)e[r]&&(e[r]=t[r])},getFormat:function(){return this.getStep(-1).output.format},getHeight:function(t){let e=new Image;e.onload=function(){t(e.height)},e.src=this.getInput(0).src},getWidth:function(t){let e=new Image;e.onload=function(){t(e.width)},e.src=this.getInput(0).src}}},{}],358:[function(t,e,r){e.exports=function(t){let e=[];return e.push(t.nw.split(",")),e.push(t.ne.split(",")),e.push(t.se.split(",")),e.push(t.sw.split(",")),e.reduce((t,e)=>(t.push(parseInt(e[0])),t.push(parseInt(e[1])),t),[])}},{}]},{},[204]); \ No newline at end of file +!function(){return function t(e,r,n){function i(a,s){if(!r[a]){if(!e[a]){var u="function"==typeof require&&require;if(!s&&u)return u(a,!0);if(o)return o(a,!0);var l=new Error("Cannot find module '"+a+"'");throw l.code="MODULE_NOT_FOUND",l}var c=r[a]={exports:{}};e[a][0].call(c.exports,function(t){return i(e[a][1][t]||t)},c,c.exports,t,e,r,n)}return r[a].exports}for(var o="function"==typeof require&&require,a=0;at)return!1;if((r+=e[n+1])>=t)return!0}}function p(t,e){return t<65?36===t:t<91||(t<97?95===t:t<123||(t<=65535?t>=170&&s.test(String.fromCharCode(t)):!1!==e&&h(t,l)))}function f(t,e){return t<48?36===t:t<58||!(t<65)&&(t<91||(t<97?95===t:t<123||(t<=65535?t>=170&&u.test(String.fromCharCode(t)):!1!==e&&(h(t,l)||h(t,c)))))}var d=function(t,e){void 0===e&&(e={}),this.label=t,this.keyword=e.keyword,this.beforeExpr=!!e.beforeExpr,this.startsExpr=!!e.startsExpr,this.isLoop=!!e.isLoop,this.isAssign=!!e.isAssign,this.prefix=!!e.prefix,this.postfix=!!e.postfix,this.binop=e.binop||null,this.updateContext=null};function m(t,e){return new d(t,{beforeExpr:!0,binop:e})}var g={beforeExpr:!0},v={startsExpr:!0},_={};function y(t,e){return void 0===e&&(e={}),e.keyword=t,_[t]=new d(t,e)}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),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}),_break:y("break"),_case:y("case",g),_catch:y("catch"),_continue:y("continue"),_debugger:y("debugger"),_default:y("default",g),_do:y("do",{isLoop:!0,beforeExpr:!0}),_else:y("else",g),_finally:y("finally"),_for:y("for",{isLoop:!0}),_function:y("function",v),_if:y("if"),_return:y("return",g),_switch:y("switch"),_throw:y("throw",g),_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",v),_super:y("super",v),_class:y("class",v),_extends:y("extends",g),_export:y("export"),_import:y("import"),_null:y("null",v),_true:y("true",v),_false:y("false",v),_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})},x=/\r\n?|\n|\u2028|\u2029/,w=new RegExp(x.source,"g");function E(t,e){return 10===t||13===t||!e&&(8232===t||8233===t)}var k=/[\u1680\u180e\u2000-\u200a\u202f\u205f\u3000\ufeff]/,T=/(?:\s|\/\/.*|\/\*[^]*?\*\/)*/g,S=Object.prototype,A=S.hasOwnProperty,C=S.toString;function R(t,e){return A.call(t,e)}var B=Array.isArray||function(t){return"[object Array]"===C.call(t)},P=function(t,e){this.line=t,this.column=e};P.prototype.offset=function(t){return new P(this.line,this.column+t)};var I=function(t,e,r){this.start=e,this.end=r,null!==t.sourceFile&&(this.source=t.sourceFile)};function M(t,e){for(var r=1,n=0;;){w.lastIndex=n;var i=w.exec(t);if(!(i&&i.index=2015&&(e.ecmaVersion-=2009),null==e.allowReserved&&(e.allowReserved=e.ecmaVersion<5),B(e.onToken)){var n=e.onToken;e.onToken=function(t){return n.push(t)}}return B(e.onComment)&&(e.onComment=function(t,e){return function(r,n,i,o,a,s){var u={type:r?"Block":"Line",value:n,start:i,end:o};t.locations&&(u.loc=new I(this,a,s)),t.ranges&&(u.range=[i,o]),e.push(u)}}(e,e.onComment)),e}var L={};function O(t){return new RegExp("^(?:"+t.replace(/ /g,"|")+")$")}var N=function(t,r,i){this.options=t=F(t),this.sourceFile=t.sourceFile,this.keywords=O(n[t.ecmaVersion>=6?6:5]);var o="";if(!t.allowReserved){for(var a=t.ecmaVersion;!(o=e[a]);a--);"module"===t.sourceType&&(o+=" await")}this.reservedWords=O(o);var s=(o?o+" ":"")+e.strict;this.reservedWordsStrict=O(s),this.reservedWordsStrictBind=O(s+" "+e.strictBind),this.input=String(r),this.containsEsc=!1,this.loadPlugins(t.plugins),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"===t.sourceType,this.strict=this.inModule||this.strictDirective(this.pos),this.potentialArrowAt=-1,this.inFunction=this.inGenerator=this.inAsync=!1,this.yieldPos=this.awaitPos=0,this.labels=[],0===this.pos&&t.allowHashBang&&"#!"===this.input.slice(0,2)&&this.skipLineComment(2),this.scopeStack=[],this.enterFunctionScope(),this.regexpState=null};N.prototype.isKeyword=function(t){return this.keywords.test(t)},N.prototype.isReservedWord=function(t){return this.reservedWords.test(t)},N.prototype.extend=function(t,e){this[t]=e(this[t])},N.prototype.loadPlugins=function(t){for(var e in t){var r=L[e];if(!r)throw new Error("Plugin '"+e+"' not found");r(this,t[e])}},N.prototype.parse=function(){var t=this.options.program||this.startNode();return this.nextToken(),this.parseTopLevel(t)};var j=N.prototype,U=/^(?:'((?:\\.|[^'])*?)'|"((?:\\.|[^"])*?)"|;)/;function z(){this.shorthandAssign=this.trailingComma=this.parenthesizedAssign=this.parenthesizedBind=this.doubleProto=-1}j.strictDirective=function(t){for(;;){T.lastIndex=t,t+=T.exec(this.input)[0].length;var e=U.exec(this.input.slice(t));if(!e)return!1;if("use strict"===(e[1]||e[2]))return!0;t+=e[0].length}},j.eat=function(t){return this.type===t&&(this.next(),!0)},j.isContextual=function(t){return this.type===b.name&&this.value===t&&!this.containsEsc},j.eatContextual=function(t){return!!this.isContextual(t)&&(this.next(),!0)},j.expectContextual=function(t){this.eatContextual(t)||this.unexpected()},j.canInsertSemicolon=function(){return this.type===b.eof||this.type===b.braceR||x.test(this.input.slice(this.lastTokEnd,this.start))},j.insertSemicolon=function(){if(this.canInsertSemicolon())return this.options.onInsertedSemicolon&&this.options.onInsertedSemicolon(this.lastTokEnd,this.lastTokEndLoc),!0},j.semicolon=function(){this.eat(b.semi)||this.insertSemicolon()||this.unexpected()},j.afterTrailingComma=function(t,e){if(this.type===t)return this.options.onTrailingComma&&this.options.onTrailingComma(this.lastTokStart,this.lastTokStartLoc),e||this.next(),!0},j.expect=function(t){this.eat(t)||this.unexpected()},j.unexpected=function(t){this.raise(null!=t?t:this.start,"Unexpected token")},j.checkPatternErrors=function(t,e){if(t){t.trailingComma>-1&&this.raiseRecoverable(t.trailingComma,"Comma is not permitted after the rest element");var r=e?t.parenthesizedAssign:t.parenthesizedBind;r>-1&&this.raiseRecoverable(r,"Parenthesized pattern")}},j.checkExpressionErrors=function(t,e){if(!t)return!1;var r=t.shorthandAssign,n=t.doubleProto;if(!e)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")},j.checkYieldAwaitInDefaultParams=function(){this.yieldPos&&(!this.awaitPos||this.yieldPos=6&&(t.sourceType=this.options.sourceType),this.finishNode(t,"Program")};var $={kind:"loop"},V={kind:"switch"};G.isLet=function(){if(this.options.ecmaVersion<6||!this.isContextual("let"))return!1;T.lastIndex=this.pos;var t=T.exec(this.input),e=this.pos+t[0].length,r=this.input.charCodeAt(e);if(91===r||123===r)return!0;if(p(r,!0)){for(var n=e+1;f(this.input.charCodeAt(n),!0);)++n;var o=this.input.slice(e,n);if(!i.test(o))return!0}return!1},G.isAsyncFunction=function(){if(this.options.ecmaVersion<8||!this.isContextual("async"))return!1;T.lastIndex=this.pos;var t=T.exec(this.input),e=this.pos+t[0].length;return!(x.test(this.input.slice(this.pos,e))||"function"!==this.input.slice(e,e+8)||e+8!==this.input.length&&f(this.input.charAt(e+8)))},G.parseStatement=function(t,e,r){var n,i=this.type,o=this.startNode();switch(this.isLet()&&(i=b._var,n="let"),i){case b._break:case b._continue:return this.parseBreakContinueStatement(o,i.keyword);case b._debugger:return this.parseDebuggerStatement(o);case b._do:return this.parseDoStatement(o);case b._for:return this.parseForStatement(o);case b._function:return!t&&this.options.ecmaVersion>=6&&this.unexpected(),this.parseFunctionStatement(o,!1);case b._class:return t||this.unexpected(),this.parseClass(o,!0);case b._if:return this.parseIfStatement(o);case b._return:return this.parseReturnStatement(o);case b._switch:return this.parseSwitchStatement(o);case b._throw:return this.parseThrowStatement(o);case b._try:return this.parseTryStatement(o);case b._const:case b._var:return n=n||this.value,t||"var"===n||this.unexpected(),this.parseVarStatement(o,n);case b._while:return this.parseWhileStatement(o);case b._with:return this.parseWithStatement(o);case b.braceL:return this.parseBlock();case b.semi:return this.parseEmptyStatement(o);case b._export:case b._import:return this.options.allowImportExportEverywhere||(e||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(o):this.parseExport(o,r);default:if(this.isAsyncFunction())return t||this.unexpected(),this.next(),this.parseFunctionStatement(o,!0);var a=this.value,s=this.parseExpression();return i===b.name&&"Identifier"===s.type&&this.eat(b.colon)?this.parseLabeledStatement(o,a,s):this.parseExpressionStatement(o,s)}},G.parseBreakContinueStatement=function(t,e){var r="break"===e;this.next(),this.eat(b.semi)||this.insertSemicolon()?t.label=null:this.type!==b.name?this.unexpected():(t.label=this.parseIdent(),this.semicolon());for(var n=0;n=6?this.eat(b.semi):this.semicolon(),this.finishNode(t,"DoWhileStatement")},G.parseForStatement=function(t){this.next();var e=this.options.ecmaVersion>=9&&(this.inAsync||!this.inFunction&&this.options.allowAwaitOutsideFunction)&&this.eatContextual("await")?this.lastTokStart:-1;if(this.labels.push($),this.enterLexicalScope(),this.expect(b.parenL),this.type===b.semi)return e>-1&&this.unexpected(e),this.parseFor(t,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||"var"!==i&&n.declarations[0].init?(e>-1&&this.unexpected(e),this.parseFor(t,n)):(this.options.ecmaVersion>=9&&(this.type===b._in?e>-1&&this.unexpected(e):t.await=e>-1),this.parseForIn(t,n))}var o=new z,a=this.parseExpression(!0,o);return this.type===b._in||this.options.ecmaVersion>=6&&this.isContextual("of")?(this.options.ecmaVersion>=9&&(this.type===b._in?e>-1&&this.unexpected(e):t.await=e>-1),this.toAssignable(a,!1,o),this.checkLVal(a),this.parseForIn(t,a)):(this.checkExpressionErrors(o,!0),e>-1&&this.unexpected(e),this.parseFor(t,a))},G.parseFunctionStatement=function(t,e){return this.next(),this.parseFunction(t,!0,!1,e)},G.parseIfStatement=function(t){return this.next(),t.test=this.parseParenExpression(),t.consequent=this.parseStatement(!this.strict&&this.type===b._function),t.alternate=this.eat(b._else)?this.parseStatement(!this.strict&&this.type===b._function):null,this.finishNode(t,"IfStatement")},G.parseReturnStatement=function(t){return this.inFunction||this.options.allowReturnOutsideFunction||this.raise(this.start,"'return' outside of function"),this.next(),this.eat(b.semi)||this.insertSemicolon()?t.argument=null:(t.argument=this.parseExpression(),this.semicolon()),this.finishNode(t,"ReturnStatement")},G.parseSwitchStatement=function(t){var e;this.next(),t.discriminant=this.parseParenExpression(),t.cases=[],this.expect(b.braceL),this.labels.push(V),this.enterLexicalScope();for(var r=!1;this.type!==b.braceR;)if(this.type===b._case||this.type===b._default){var n=this.type===b._case;e&&this.finishNode(e,"SwitchCase"),t.cases.push(e=this.startNode()),e.consequent=[],this.next(),n?e.test=this.parseExpression():(r&&this.raiseRecoverable(this.lastTokStart,"Multiple default clauses"),r=!0,e.test=null),this.expect(b.colon)}else e||this.unexpected(),e.consequent.push(this.parseStatement(!0));return this.exitLexicalScope(),e&&this.finishNode(e,"SwitchCase"),this.next(),this.labels.pop(),this.finishNode(t,"SwitchStatement")},G.parseThrowStatement=function(t){return this.next(),x.test(this.input.slice(this.lastTokEnd,this.start))&&this.raise(this.lastTokEnd,"Illegal newline after throw"),t.argument=this.parseExpression(),this.semicolon(),this.finishNode(t,"ThrowStatement")};var X=[];G.parseTryStatement=function(t){if(this.next(),t.block=this.parseBlock(),t.handler=null,this.type===b._catch){var e=this.startNode();this.next(),this.eat(b.parenL)?(e.param=this.parseBindingAtom(),this.enterLexicalScope(),this.checkLVal(e.param,"let"),this.expect(b.parenR)):(this.options.ecmaVersion<10&&this.unexpected(),e.param=null,this.enterLexicalScope()),e.body=this.parseBlock(!1),this.exitLexicalScope(),t.handler=this.finishNode(e,"CatchClause")}return t.finalizer=this.eat(b._finally)?this.parseBlock():null,t.handler||t.finalizer||this.raise(t.start,"Missing catch or finally clause"),this.finishNode(t,"TryStatement")},G.parseVarStatement=function(t,e){return this.next(),this.parseVar(t,!1,e),this.semicolon(),this.finishNode(t,"VariableDeclaration")},G.parseWhileStatement=function(t){return this.next(),t.test=this.parseParenExpression(),this.labels.push($),t.body=this.parseStatement(!1),this.labels.pop(),this.finishNode(t,"WhileStatement")},G.parseWithStatement=function(t){return this.strict&&this.raise(this.start,"'with' in strict mode"),this.next(),t.object=this.parseParenExpression(),t.body=this.parseStatement(!1),this.finishNode(t,"WithStatement")},G.parseEmptyStatement=function(t){return this.next(),this.finishNode(t,"EmptyStatement")},G.parseLabeledStatement=function(t,e,r){for(var n=0,i=this.labels;n=0;a--){var s=this.labels[a];if(s.statementStart!==t.start)break;s.statementStart=this.start,s.kind=o}return this.labels.push({name:e,kind:o,statementStart:this.start}),t.body=this.parseStatement(!0),("ClassDeclaration"===t.body.type||"VariableDeclaration"===t.body.type&&"var"!==t.body.kind||"FunctionDeclaration"===t.body.type&&(this.strict||t.body.generator||t.body.async))&&this.raiseRecoverable(t.body.start,"Invalid labeled declaration"),this.labels.pop(),t.label=r,this.finishNode(t,"LabeledStatement")},G.parseExpressionStatement=function(t,e){return t.expression=e,this.semicolon(),this.finishNode(t,"ExpressionStatement")},G.parseBlock=function(t){void 0===t&&(t=!0);var e=this.startNode();for(e.body=[],this.expect(b.braceL),t&&this.enterLexicalScope();!this.eat(b.braceR);){var r=this.parseStatement(!0);e.body.push(r)}return t&&this.exitLexicalScope(),this.finishNode(e,"BlockStatement")},G.parseFor=function(t,e){return t.init=e,this.expect(b.semi),t.test=this.type===b.semi?null:this.parseExpression(),this.expect(b.semi),t.update=this.type===b.parenR?null:this.parseExpression(),this.expect(b.parenR),this.exitLexicalScope(),t.body=this.parseStatement(!1),this.labels.pop(),this.finishNode(t,"ForStatement")},G.parseForIn=function(t,e){var r=this.type===b._in?"ForInStatement":"ForOfStatement";return this.next(),"ForInStatement"===r&&("AssignmentPattern"===e.type||"VariableDeclaration"===e.type&&null!=e.declarations[0].init&&(this.strict||"Identifier"!==e.declarations[0].id.type))&&this.raise(e.start,"Invalid assignment in for-in loop head"),t.left=e,t.right="ForInStatement"===r?this.parseExpression():this.parseMaybeAssign(),this.expect(b.parenR),this.exitLexicalScope(),t.body=this.parseStatement(!1),this.labels.pop(),this.finishNode(t,r)},G.parseVar=function(t,e,r){for(t.declarations=[],t.kind=r;;){var n=this.startNode();if(this.parseVarId(n,r),this.eat(b.eq)?n.init=this.parseMaybeAssign(e):"const"!==r||this.type===b._in||this.options.ecmaVersion>=6&&this.isContextual("of")?"Identifier"===n.id.type||e&&(this.type===b._in||this.isContextual("of"))?n.init=null:this.raise(this.lastTokEnd,"Complex binding patterns require an initialization value"):this.unexpected(),t.declarations.push(this.finishNode(n,"VariableDeclarator")),!this.eat(b.comma))break}return t},G.parseVarId=function(t,e){t.id=this.parseBindingAtom(e),this.checkLVal(t.id,e,!1)},G.parseFunction=function(t,e,r,n){this.initFunction(t),(this.options.ecmaVersion>=9||this.options.ecmaVersion>=6&&!n)&&(t.generator=this.eat(b.star)),this.options.ecmaVersion>=8&&(t.async=!!n),e&&(t.id="nullableID"===e&&this.type!==b.name?null:this.parseIdent(),t.id&&this.checkLVal(t.id,this.inModule&&!this.inFunction?"let":"var"));var i=this.inGenerator,o=this.inAsync,a=this.yieldPos,s=this.awaitPos,u=this.inFunction;return this.inGenerator=t.generator,this.inAsync=t.async,this.yieldPos=0,this.awaitPos=0,this.inFunction=!0,this.enterFunctionScope(),e||(t.id=this.type===b.name?this.parseIdent():null),this.parseFunctionParams(t),this.parseFunctionBody(t,r),this.inGenerator=i,this.inAsync=o,this.yieldPos=a,this.awaitPos=s,this.inFunction=u,this.finishNode(t,e?"FunctionDeclaration":"FunctionExpression")},G.parseFunctionParams=function(t){this.expect(b.parenL),t.params=this.parseBindingList(b.parenR,!1,this.options.ecmaVersion>=8),this.checkYieldAwaitInDefaultParams()},G.parseClass=function(t,e){this.next(),this.parseClassId(t,e),this.parseClassSuper(t);var r=this.startNode(),n=!1;for(r.body=[],this.expect(b.braceL);!this.eat(b.braceR);){var i=this.parseClassMember(r);i&&"MethodDefinition"===i.type&&"constructor"===i.kind&&(n&&this.raise(i.start,"Duplicate constructor in the same class"),n=!0)}return t.body=this.finishNode(r,"ClassBody"),this.finishNode(t,e?"ClassDeclaration":"ClassExpression")},G.parseClassMember=function(t){var e=this;if(this.eat(b.semi))return null;var r=this.startNode(),n=function(t,n){void 0===n&&(n=!1);var i=e.start,o=e.startLoc;return!!e.eatContextual(t)&&(!(e.type===b.parenL||n&&e.canInsertSemicolon())||(r.key&&e.unexpected(),r.computed=!1,r.key=e.startNodeAt(i,o),r.key.name=t,e.finishNode(r.key,"Identifier"),!1))};r.kind="method",r.static=n("static");var i=this.eat(b.star),o=!1;i||(this.options.ecmaVersion>=8&&n("async",!0)?(o=!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;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"),o&&this.raise(a.start,"Constructor can't be an async method"),r.kind="constructor"),this.parseClassMethod(t,r,i,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},G.parseClassMethod=function(t,e,r,n){e.value=this.parseMethod(r,n),t.body.push(this.finishNode(e,"MethodDefinition"))},G.parseClassId=function(t,e){t.id=this.type===b.name?this.parseIdent():!0===e?this.unexpected():null},G.parseClassSuper=function(t){t.superClass=this.eat(b._extends)?this.parseExprSubscripts():null},G.parseExport=function(t,e){if(this.next(),this.eat(b.star))return this.expectContextual("from"),this.type!==b.string&&this.unexpected(),t.source=this.parseExprAtom(),this.semicolon(),this.finishNode(t,"ExportAllDeclaration");if(this.eat(b._default)){var r;if(this.checkExport(e,"default",this.lastTokStart),this.type===b._function||(r=this.isAsyncFunction())){var n=this.startNode();this.next(),r&&this.next(),t.declaration=this.parseFunction(n,"nullableID",!1,r)}else if(this.type===b._class){var i=this.startNode();t.declaration=this.parseClass(i,"nullableID")}else t.declaration=this.parseMaybeAssign(),this.semicolon();return this.finishNode(t,"ExportDefaultDeclaration")}if(this.shouldParseExportStatement())t.declaration=this.parseStatement(!0),"VariableDeclaration"===t.declaration.type?this.checkVariableExport(e,t.declaration.declarations):this.checkExport(e,t.declaration.id.name,t.declaration.id.start),t.specifiers=[],t.source=null;else{if(t.declaration=null,t.specifiers=this.parseExportSpecifiers(e),this.eatContextual("from"))this.type!==b.string&&this.unexpected(),t.source=this.parseExprAtom();else{for(var o=0,a=t.specifiers;o=6&&t)switch(t.type){case"Identifier":this.inAsync&&"await"===t.name&&this.raise(t.start,"Can not use 'await' as identifier inside an async function");break;case"ObjectPattern":case"ArrayPattern":case"RestElement":break;case"ObjectExpression":t.type="ObjectPattern",r&&this.checkPatternErrors(r,!0);for(var n=0,i=t.properties;n=9&&"SpreadElement"===t.type||this.options.ecmaVersion>=6&&(t.computed||t.method||t.shorthand))){var n,i=t.key;switch(i.type){case"Identifier":n=i.name;break;case"Literal":n=String(i.value);break;default:return}var o=t.kind;if(this.options.ecmaVersion>=6)"__proto__"===n&&"init"===o&&(e.proto&&(r&&r.doubleProto<0?r.doubleProto=i.start:this.raiseRecoverable(i.start,"Redefinition of __proto__ property")),e.proto=!0);else{var a=e[n="$"+n];if(a)("init"===o?this.strict&&a.init||a.get||a.set:a.init||a[o])&&this.raiseRecoverable(i.start,"Redefinition of property");else a=e[n]={init:!1,get:!1,set:!1};a[o]=!0}}},K.parseExpression=function(t,e){var r=this.start,n=this.startLoc,i=this.parseMaybeAssign(t,e);if(this.type===b.comma){var o=this.startNodeAt(r,n);for(o.expressions=[i];this.eat(b.comma);)o.expressions.push(this.parseMaybeAssign(t,e));return this.finishNode(o,"SequenceExpression")}return i},K.parseMaybeAssign=function(t,e,r){if(this.inGenerator&&this.isContextual("yield"))return this.parseYield();var n=!1,i=-1,o=-1;e?(i=e.parenthesizedAssign,o=e.trailingComma,e.parenthesizedAssign=e.trailingComma=-1):(e=new z,n=!0);var a=this.start,s=this.startLoc;this.type!==b.parenL&&this.type!==b.name||(this.potentialArrowAt=this.start);var u=this.parseMaybeConditional(t,e);if(r&&(u=r.call(this,u,a,s)),this.type.isAssign){var l=this.startNodeAt(a,s);return l.operator=this.value,l.left=this.type===b.eq?this.toAssignable(u,!1,e):u,n||z.call(e),e.shorthandAssign=-1,this.checkLVal(u),this.next(),l.right=this.parseMaybeAssign(t),this.finishNode(l,"AssignmentExpression")}return n&&this.checkExpressionErrors(e,!0),i>-1&&(e.parenthesizedAssign=i),o>-1&&(e.trailingComma=o),u},K.parseMaybeConditional=function(t,e){var r=this.start,n=this.startLoc,i=this.parseExprOps(t,e);if(this.checkExpressionErrors(e))return i;if(this.eat(b.question)){var o=this.startNodeAt(r,n);return o.test=i,o.consequent=this.parseMaybeAssign(),this.expect(b.colon),o.alternate=this.parseMaybeAssign(t),this.finishNode(o,"ConditionalExpression")}return i},K.parseExprOps=function(t,e){var r=this.start,n=this.startLoc,i=this.parseMaybeUnary(e,!1);return this.checkExpressionErrors(e)?i:i.start===r&&"ArrowFunctionExpression"===i.type?i:this.parseExprOp(i,r,n,-1,t)},K.parseExprOp=function(t,e,r,n,i){var o=this.type.binop;if(null!=o&&(!i||this.type!==b._in)&&o>n){var a=this.type===b.logicalOR||this.type===b.logicalAND,s=this.value;this.next();var u=this.start,l=this.startLoc,c=this.parseExprOp(this.parseMaybeUnary(null,!1),u,l,o,i),h=this.buildBinary(e,r,t,c,s,a);return this.parseExprOp(h,e,r,n,i)}return t},K.buildBinary=function(t,e,r,n,i,o){var a=this.startNodeAt(t,e);return a.left=r,a.operator=i,a.right=n,this.finishNode(a,o?"LogicalExpression":"BinaryExpression")},K.parseMaybeUnary=function(t,e){var r,n=this.start,i=this.startLoc;if(this.isContextual("await")&&(this.inAsync||!this.inFunction&&this.options.allowAwaitOutsideFunction))r=this.parseAwait(),e=!0;else if(this.type.prefix){var o=this.startNode(),a=this.type===b.incDec;o.operator=this.value,o.prefix=!0,this.next(),o.argument=this.parseMaybeUnary(null,!0),this.checkExpressionErrors(t,!0),a?this.checkLVal(o.argument):this.strict&&"delete"===o.operator&&"Identifier"===o.argument.type?this.raiseRecoverable(o.start,"Deleting local variable in strict mode"):e=!0,r=this.finishNode(o,a?"UpdateExpression":"UnaryExpression")}else{if(r=this.parseExprSubscripts(t),this.checkExpressionErrors(t))return r;for(;this.type.postfix&&!this.canInsertSemicolon();){var s=this.startNodeAt(n,i);s.operator=this.value,s.prefix=!1,s.argument=r,this.checkLVal(r),this.next(),r=this.finishNode(s,"UpdateExpression")}}return!e&&this.eat(b.starstar)?this.buildBinary(n,i,r,this.parseMaybeUnary(null,!1),"**",!1):r},K.parseExprSubscripts=function(t){var e=this.start,r=this.startLoc,n=this.parseExprAtom(t),i="ArrowFunctionExpression"===n.type&&")"!==this.input.slice(this.lastTokStart,this.lastTokEnd);if(this.checkExpressionErrors(t)||i)return n;var o=this.parseSubscripts(n,e,r);return t&&"MemberExpression"===o.type&&(t.parenthesizedAssign>=o.start&&(t.parenthesizedAssign=-1),t.parenthesizedBind>=o.start&&(t.parenthesizedBind=-1)),o},K.parseSubscripts=function(t,e,r,n){for(var i=this.options.ecmaVersion>=8&&"Identifier"===t.type&&"async"===t.name&&this.lastTokEnd===t.end&&!this.canInsertSemicolon()&&"async"===this.input.slice(t.start,t.end),o=void 0;;)if((o=this.eat(b.bracketL))||this.eat(b.dot)){var a=this.startNodeAt(e,r);a.object=t,a.property=o?this.parseExpression():this.parseIdent(!0),a.computed=!!o,o&&this.expect(b.bracketR),t=this.finishNode(a,"MemberExpression")}else if(!n&&this.eat(b.parenL)){var s=new z,u=this.yieldPos,l=this.awaitPos;this.yieldPos=0,this.awaitPos=0;var c=this.parseExprList(b.parenR,this.options.ecmaVersion>=8,!1,s);if(i&&!this.canInsertSemicolon()&&this.eat(b.arrow))return this.checkPatternErrors(s,!1),this.checkYieldAwaitInDefaultParams(),this.yieldPos=u,this.awaitPos=l,this.parseArrowExpression(this.startNodeAt(e,r),c,!0);this.checkExpressionErrors(s,!0),this.yieldPos=u||this.yieldPos,this.awaitPos=l||this.awaitPos;var h=this.startNodeAt(e,r);h.callee=t,h.arguments=c,t=this.finishNode(h,"CallExpression")}else{if(this.type!==b.backQuote)return t;var p=this.startNodeAt(e,r);p.tag=t,p.quasi=this.parseTemplate({isTagged:!0}),t=this.finishNode(p,"TaggedTemplateExpression")}},K.parseExprAtom=function(t){var e,r=this.potentialArrowAt===this.start;switch(this.type){case b._super:return this.inFunction||this.raise(this.start,"'super' outside of function or class"),e=this.startNode(),this.next(),this.type!==b.dot&&this.type!==b.bracketL&&this.type!==b.parenL&&this.unexpected(),this.finishNode(e,"Super");case b._this:return e=this.startNode(),this.next(),this.finishNode(e,"ThisExpression");case b.name:var n=this.start,i=this.startLoc,o=this.containsEsc,a=this.parseIdent(this.type!==b.name);if(this.options.ecmaVersion>=8&&!o&&"async"===a.name&&!this.canInsertSemicolon()&&this.eat(b._function))return this.parseFunction(this.startNodeAt(n,i),!1,!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&&!o)return a=this.parseIdent(),!this.canInsertSemicolon()&&this.eat(b.arrow)||this.unexpected(),this.parseArrowExpression(this.startNodeAt(n,i),[a],!0)}return a;case b.regexp:var s=this.value;return(e=this.parseLiteral(s.value)).regex={pattern:s.pattern,flags:s.flags},e;case b.num:case b.string:return this.parseLiteral(this.value);case b._null:case b._true:case b._false:return(e=this.startNode()).value=this.type===b._null?null:this.type===b._true,e.raw=this.type.keyword,this.next(),this.finishNode(e,"Literal");case b.parenL:var u=this.start,l=this.parseParenAndDistinguishExpression(r);return t&&(t.parenthesizedAssign<0&&!this.isSimpleAssignTarget(l)&&(t.parenthesizedAssign=u),t.parenthesizedBind<0&&(t.parenthesizedBind=u)),l;case b.bracketL:return e=this.startNode(),this.next(),e.elements=this.parseExprList(b.bracketR,!0,!0,t),this.finishNode(e,"ArrayExpression");case b.braceL:return this.parseObj(!1,t);case b._function:return e=this.startNode(),this.next(),this.parseFunction(e,!1);case b._class:return this.parseClass(this.startNode(),!1);case b._new:return this.parseNew();case b.backQuote:return this.parseTemplate();default:this.unexpected()}},K.parseLiteral=function(t){var e=this.startNode();return e.value=t,e.raw=this.input.slice(this.start,this.end),this.next(),this.finishNode(e,"Literal")},K.parseParenExpression=function(){this.expect(b.parenL);var t=this.parseExpression();return this.expect(b.parenR),t},K.parseParenAndDistinguishExpression=function(t){var e,r=this.start,n=this.startLoc,i=this.options.ecmaVersion>=8;if(this.options.ecmaVersion>=6){this.next();var o,a=this.start,s=this.startLoc,u=[],l=!0,c=!1,h=new z,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){o=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),t&&!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),o&&this.unexpected(o),this.checkExpressionErrors(h,!0),this.yieldPos=p||this.yieldPos,this.awaitPos=f||this.awaitPos,u.length>1?((e=this.startNodeAt(a,s)).expressions=u,this.finishNodeAt(e,"SequenceExpression",d,m)):e=u[0]}else e=this.parseParenExpression();if(this.options.preserveParens){var g=this.startNodeAt(r,n);return g.expression=e,this.finishNode(g,"ParenthesizedExpression")}return e},K.parseParenItem=function(t){return t},K.parseParenArrowList=function(t,e,r){return this.parseArrowExpression(this.startNodeAt(t,e),r)};var W=[];K.parseNew=function(){var t=this.startNode(),e=this.parseIdent(!0);if(this.options.ecmaVersion>=6&&this.eat(b.dot)){t.meta=e;var r=this.containsEsc;return t.property=this.parseIdent(!0),("target"!==t.property.name||r)&&this.raiseRecoverable(t.property.start,"The only valid meta property for new is new.target"),this.inFunction||this.raiseRecoverable(t.start,"new.target can only be used in functions"),this.finishNode(t,"MetaProperty")}var n=this.start,i=this.startLoc;return t.callee=this.parseSubscripts(this.parseExprAtom(),n,i,!0),this.eat(b.parenL)?t.arguments=this.parseExprList(b.parenR,this.options.ecmaVersion>=8,!1):t.arguments=W,this.finishNode(t,"NewExpression")},K.parseTemplateElement=function(t){var e=t.isTagged,r=this.startNode();return this.type===b.invalidTemplate?(e||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")},K.parseTemplate=function(t){void 0===t&&(t={});var e=t.isTagged;void 0===e&&(e=!1);var r=this.startNode();this.next(),r.expressions=[];var n=this.parseTemplateElement({isTagged:e});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:e}));return this.next(),this.finishNode(r,"TemplateLiteral")},K.isAsyncProp=function(t){return!t.computed&&"Identifier"===t.key.type&&"async"===t.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))},K.parseObj=function(t,e){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.afterTrailingComma(b.braceR))break;var o=this.parseProperty(t,e);t||this.checkPropClash(o,i,e),r.properties.push(o)}return this.finishNode(r,t?"ObjectPattern":"ObjectExpression")},K.parseProperty=function(t,e){var r,n,i,o,a=this.startNode();if(this.options.ecmaVersion>=9&&this.eat(b.ellipsis))return t?(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&&e&&(e.parenthesizedAssign<0&&(e.parenthesizedAssign=this.start),e.parenthesizedBind<0&&(e.parenthesizedBind=this.start)),a.argument=this.parseMaybeAssign(!1,e),this.type===b.comma&&e&&e.trailingComma<0&&(e.trailingComma=this.start),this.finishNode(a,"SpreadElement"));this.options.ecmaVersion>=6&&(a.method=!1,a.shorthand=!1,(t||e)&&(i=this.start,o=this.startLoc),t||(r=this.eat(b.star)));var s=this.containsEsc;return this.parsePropertyName(a),!t&&!s&&this.options.ecmaVersion>=8&&!r&&this.isAsyncProp(a)?(n=!0,r=this.options.ecmaVersion>=9&&this.eat(b.star),this.parsePropertyName(a,e)):n=!1,this.parsePropertyValue(a,t,r,n,i,o,e,s),this.finishNode(a,"Property")},K.parsePropertyValue=function(t,e,r,n,i,o,a,s){if((r||n)&&this.type===b.colon&&this.unexpected(),this.eat(b.colon))t.value=e?this.parseMaybeDefault(this.start,this.startLoc):this.parseMaybeAssign(!1,a),t.kind="init";else if(this.options.ecmaVersion>=6&&this.type===b.parenL)e&&this.unexpected(),t.kind="init",t.method=!0,t.value=this.parseMethod(r,n);else if(e||s||!(this.options.ecmaVersion>=5)||t.computed||"Identifier"!==t.key.type||"get"!==t.key.name&&"set"!==t.key.name||this.type===b.comma||this.type===b.braceR)this.options.ecmaVersion>=6&&!t.computed&&"Identifier"===t.key.type?(this.checkUnreserved(t.key),t.kind="init",e?t.value=this.parseMaybeDefault(i,o,t.key):this.type===b.eq&&a?(a.shorthandAssign<0&&(a.shorthandAssign=this.start),t.value=this.parseMaybeDefault(i,o,t.key)):t.value=t.key,t.shorthand=!0):this.unexpected();else{(r||n)&&this.unexpected(),t.kind=t.key.name,this.parsePropertyName(t),t.value=this.parseMethod(!1);var u="get"===t.kind?0:1;if(t.value.params.length!==u){var l=t.value.start;"get"===t.kind?this.raiseRecoverable(l,"getter should have no params"):this.raiseRecoverable(l,"setter should have exactly one param")}else"set"===t.kind&&"RestElement"===t.value.params[0].type&&this.raiseRecoverable(t.value.params[0].start,"Setter cannot use rest params")}},K.parsePropertyName=function(t){if(this.options.ecmaVersion>=6){if(this.eat(b.bracketL))return t.computed=!0,t.key=this.parseMaybeAssign(),this.expect(b.bracketR),t.key;t.computed=!1}return t.key=this.type===b.num||this.type===b.string?this.parseExprAtom():this.parseIdent(!0)},K.initFunction=function(t){t.id=null,this.options.ecmaVersion>=6&&(t.generator=!1,t.expression=!1),this.options.ecmaVersion>=8&&(t.async=!1)},K.parseMethod=function(t,e){var r=this.startNode(),n=this.inGenerator,i=this.inAsync,o=this.yieldPos,a=this.awaitPos,s=this.inFunction;return this.initFunction(r),this.options.ecmaVersion>=6&&(r.generator=t),this.options.ecmaVersion>=8&&(r.async=!!e),this.inGenerator=r.generator,this.inAsync=r.async,this.yieldPos=0,this.awaitPos=0,this.inFunction=!0,this.enterFunctionScope(),this.expect(b.parenL),r.params=this.parseBindingList(b.parenR,!1,this.options.ecmaVersion>=8),this.checkYieldAwaitInDefaultParams(),this.parseFunctionBody(r,!1),this.inGenerator=n,this.inAsync=i,this.yieldPos=o,this.awaitPos=a,this.inFunction=s,this.finishNode(r,"FunctionExpression")},K.parseArrowExpression=function(t,e,r){var n=this.inGenerator,i=this.inAsync,o=this.yieldPos,a=this.awaitPos,s=this.inFunction;return this.enterFunctionScope(),this.initFunction(t),this.options.ecmaVersion>=8&&(t.async=!!r),this.inGenerator=!1,this.inAsync=t.async,this.yieldPos=0,this.awaitPos=0,this.inFunction=!0,t.params=this.toAssignableList(e,!0),this.parseFunctionBody(t,!0),this.inGenerator=n,this.inAsync=i,this.yieldPos=o,this.awaitPos=a,this.inFunction=s,this.finishNode(t,"ArrowFunctionExpression")},K.parseFunctionBody=function(t,e){var r=e&&this.type!==b.braceL,n=this.strict,i=!1;if(r)t.body=this.parseMaybeAssign(),t.expression=!0,this.checkParams(t,!1);else{var o=this.options.ecmaVersion>=7&&!this.isSimpleParamList(t.params);n&&!o||(i=this.strictDirective(this.end))&&o&&this.raiseRecoverable(t.start,"Illegal 'use strict' directive in function with non-simple parameter list");var a=this.labels;this.labels=[],i&&(this.strict=!0),this.checkParams(t,!n&&!i&&!e&&this.isSimpleParamList(t.params)),t.body=this.parseBlock(!1),t.expression=!1,this.adaptDirectivePrologue(t.body.body),this.labels=a}this.exitFunctionScope(),this.strict&&t.id&&this.checkLVal(t.id,"none"),this.strict=n},K.isSimpleParamList=function(t){for(var e=0,r=t;e0;)e[r]=arguments[r+1];for(var n=0,i=e;n=1;t--){var e=this.context[t];if("function"===e.token)return e.generator}return!1},nt.updateContext=function(t){var e,r=this.type;r.keyword&&t===b.dot?this.exprAllowed=!1:(e=r.updateContext)?e.call(this,t):this.exprAllowed=r.beforeExpr},b.parenR.updateContext=b.braceR.updateContext=function(){if(1!==this.context.length){var t=this.context.pop();t===rt.b_stat&&"function"===this.curContext().token&&(t=this.context.pop()),this.exprAllowed=!t.isExpr}else this.exprAllowed=!0},b.braceL.updateContext=function(t){this.context.push(this.braceIsBlock(t)?rt.b_stat:rt.b_expr),this.exprAllowed=!0},b.dollarBraceL.updateContext=function(){this.context.push(rt.b_tmpl),this.exprAllowed=!0},b.parenL.updateContext=function(t){var e=t===b._if||t===b._for||t===b._with||t===b._while;this.context.push(e?rt.p_stat:rt.p_expr),this.exprAllowed=!0},b.incDec.updateContext=function(){},b._function.updateContext=b._class.updateContext=function(t){t.beforeExpr&&t!==b.semi&&t!==b._else&&(t!==b.colon&&t!==b.braceL||this.curContext()!==rt.b_stat)?this.context.push(rt.f_expr):this.context.push(rt.f_stat),this.exprAllowed=!1},b.backQuote.updateContext=function(){this.curContext()===rt.q_tmpl?this.context.pop():this.context.push(rt.q_tmpl),this.exprAllowed=!1},b.star.updateContext=function(t){if(t===b._function){var e=this.context.length-1;this.context[e]===rt.f_expr?this.context[e]=rt.f_expr_gen:this.context[e]=rt.f_gen}this.exprAllowed=!0},b.name.updateContext=function(t){var e=!1;this.options.ecmaVersion>=6&&t!==b.dot&&("of"===this.value&&!this.exprAllowed||"yield"===this.value&&this.inGeneratorContext())&&(e=!0),this.exprAllowed=e};var it={$LONE:["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"],General_Category:["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"],Script:["Adlam","Adlm","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","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","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","Mongolian","Mong","Mro","Mroo","Multani","Mult","Myanmar","Mymr","Nabataean","Nbat","New_Tai_Lue","Talu","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","Tibetan","Tibt","Tifinagh","Tfng","Tirhuta","Tirh","Ugaritic","Ugar","Vai","Vaii","Warang_Citi","Wara","Yi","Yiii","Zanabazar_Square","Zanb"]};Array.prototype.push.apply(it.$LONE,it.General_Category),it.gc=it.General_Category,it.sc=it.Script_Extensions=it.scx=it.Script;var ot=N.prototype,at=function(t){this.parser=t,this.validFlags="gim"+(t.options.ecmaVersion>=6?"uy":"")+(t.options.ecmaVersion>=9?"s":""),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 st(t){return t<=65535?String.fromCharCode(t):(t-=65536,String.fromCharCode(55296+(t>>10),56320+(1023&t)))}function ut(t){return 36===t||t>=40&&t<=43||46===t||63===t||t>=91&&t<=94||t>=123&&t<=125}function lt(t){return t>=65&&t<=90||t>=97&&t<=122}function ct(t){return lt(t)||95===t}function ht(t){return ct(t)||pt(t)}function pt(t){return t>=48&&t<=57}function ft(t){return t>=48&&t<=57||t>=65&&t<=70||t>=97&&t<=102}function dt(t){return t>=65&&t<=70?t-65+10:t>=97&&t<=102?t-97+10:t-48}function mt(t){return t>=48&&t<=55}at.prototype.reset=function(t,e,r){var n=-1!==r.indexOf("u");this.start=0|t,this.source=e+"",this.flags=r,this.switchU=n&&this.parser.options.ecmaVersion>=6,this.switchN=n&&this.parser.options.ecmaVersion>=9},at.prototype.raise=function(t){this.parser.raiseRecoverable(this.start,"Invalid regular expression: /"+this.source+"/: "+t)},at.prototype.at=function(t){var e=this.source,r=e.length;if(t>=r)return-1;var n=e.charCodeAt(t);return!this.switchU||n<=55295||n>=57344||t+1>=r?n:(n<<10)+e.charCodeAt(t+1)-56613888},at.prototype.nextIndex=function(t){var e=this.source,r=e.length;if(t>=r)return r;var n=e.charCodeAt(t);return!this.switchU||n<=55295||n>=57344||t+1>=r?t+1:t+2},at.prototype.current=function(){return this.at(this.pos)},at.prototype.lookahead=function(){return this.at(this.nextIndex(this.pos))},at.prototype.advance=function(){this.pos=this.nextIndex(this.pos)},at.prototype.eat=function(t){return this.current()===t&&(this.advance(),!0)},ot.validateRegExpFlags=function(t){for(var e=t.validFlags,r=t.flags,n=0;n-1&&this.raise(t.start,"Duplicate regular expression flag")}},ot.validateRegExpPattern=function(t){this.regexp_pattern(t),!t.switchN&&this.options.ecmaVersion>=9&&t.groupNames.length>0&&(t.switchN=!0,this.regexp_pattern(t))},ot.regexp_pattern=function(t){t.pos=0,t.lastIntValue=0,t.lastStringValue="",t.lastAssertionIsQuantifiable=!1,t.numCapturingParens=0,t.maxBackReference=0,t.groupNames.length=0,t.backReferenceNames.length=0,this.regexp_disjunction(t),t.pos!==t.source.length&&(t.eat(41)&&t.raise("Unmatched ')'"),(t.eat(93)||t.eat(125))&&t.raise("Lone quantifier brackets")),t.maxBackReference>t.numCapturingParens&&t.raise("Invalid escape");for(var e=0,r=t.backReferenceNames;e=9&&(r=t.eat(60)),t.eat(61)||t.eat(33))return this.regexp_disjunction(t),t.eat(41)||t.raise("Unterminated group"),t.lastAssertionIsQuantifiable=!r,!0}return t.pos=e,!1},ot.regexp_eatQuantifier=function(t,e){return void 0===e&&(e=!1),!!this.regexp_eatQuantifierPrefix(t,e)&&(t.eat(63),!0)},ot.regexp_eatQuantifierPrefix=function(t,e){return t.eat(42)||t.eat(43)||t.eat(63)||this.regexp_eatBracedQuantifier(t,e)},ot.regexp_eatBracedQuantifier=function(t,e){var r=t.pos;if(t.eat(123)){var n=0,i=-1;if(this.regexp_eatDecimalDigits(t)&&(n=t.lastIntValue,t.eat(44)&&this.regexp_eatDecimalDigits(t)&&(i=t.lastIntValue),t.eat(125)))return-1!==i&&i=9?this.regexp_groupSpecifier(t):63===t.current()&&t.raise("Invalid group"),this.regexp_disjunction(t),t.eat(41))return t.numCapturingParens+=1,!0;t.raise("Unterminated group")}return!1},ot.regexp_eatExtendedAtom=function(t){return t.eat(46)||this.regexp_eatReverseSolidusAtomEscape(t)||this.regexp_eatCharacterClass(t)||this.regexp_eatUncapturingGroup(t)||this.regexp_eatCapturingGroup(t)||this.regexp_eatInvalidBracedQuantifier(t)||this.regexp_eatExtendedPatternCharacter(t)},ot.regexp_eatInvalidBracedQuantifier=function(t){return this.regexp_eatBracedQuantifier(t,!0)&&t.raise("Nothing to repeat"),!1},ot.regexp_eatSyntaxCharacter=function(t){var e=t.current();return!!ut(e)&&(t.lastIntValue=e,t.advance(),!0)},ot.regexp_eatPatternCharacters=function(t){for(var e=t.pos,r=0;-1!==(r=t.current())&&!ut(r);)t.advance();return t.pos!==e},ot.regexp_eatExtendedPatternCharacter=function(t){var e=t.current();return!(-1===e||36===e||e>=40&&e<=43||46===e||63===e||91===e||94===e||124===e)&&(t.advance(),!0)},ot.regexp_groupSpecifier=function(t){if(t.eat(63)){if(this.regexp_eatGroupName(t))return-1!==t.groupNames.indexOf(t.lastStringValue)&&t.raise("Duplicate capture group name"),void t.groupNames.push(t.lastStringValue);t.raise("Invalid group")}},ot.regexp_eatGroupName=function(t){if(t.lastStringValue="",t.eat(60)){if(this.regexp_eatRegExpIdentifierName(t)&&t.eat(62))return!0;t.raise("Invalid capture group name")}return!1},ot.regexp_eatRegExpIdentifierName=function(t){if(t.lastStringValue="",this.regexp_eatRegExpIdentifierStart(t)){for(t.lastStringValue+=st(t.lastIntValue);this.regexp_eatRegExpIdentifierPart(t);)t.lastStringValue+=st(t.lastIntValue);return!0}return!1},ot.regexp_eatRegExpIdentifierStart=function(t){var e=t.pos,r=t.current();return t.advance(),92===r&&this.regexp_eatRegExpUnicodeEscapeSequence(t)&&(r=t.lastIntValue),function(t){return p(t,!0)||36===t||95===t}(r)?(t.lastIntValue=r,!0):(t.pos=e,!1)},ot.regexp_eatRegExpIdentifierPart=function(t){var e=t.pos,r=t.current();return t.advance(),92===r&&this.regexp_eatRegExpUnicodeEscapeSequence(t)&&(r=t.lastIntValue),function(t){return f(t,!0)||36===t||95===t||8204===t||8205===t}(r)?(t.lastIntValue=r,!0):(t.pos=e,!1)},ot.regexp_eatAtomEscape=function(t){return!!(this.regexp_eatBackReference(t)||this.regexp_eatCharacterClassEscape(t)||this.regexp_eatCharacterEscape(t)||t.switchN&&this.regexp_eatKGroupName(t))||(t.switchU&&(99===t.current()&&t.raise("Invalid unicode escape"),t.raise("Invalid escape")),!1)},ot.regexp_eatBackReference=function(t){var e=t.pos;if(this.regexp_eatDecimalEscape(t)){var r=t.lastIntValue;if(t.switchU)return r>t.maxBackReference&&(t.maxBackReference=r),!0;if(r<=t.numCapturingParens)return!0;t.pos=e}return!1},ot.regexp_eatKGroupName=function(t){if(t.eat(107)){if(this.regexp_eatGroupName(t))return t.backReferenceNames.push(t.lastStringValue),!0;t.raise("Invalid named reference")}return!1},ot.regexp_eatCharacterEscape=function(t){return this.regexp_eatControlEscape(t)||this.regexp_eatCControlLetter(t)||this.regexp_eatZero(t)||this.regexp_eatHexEscapeSequence(t)||this.regexp_eatRegExpUnicodeEscapeSequence(t)||!t.switchU&&this.regexp_eatLegacyOctalEscapeSequence(t)||this.regexp_eatIdentityEscape(t)},ot.regexp_eatCControlLetter=function(t){var e=t.pos;if(t.eat(99)){if(this.regexp_eatControlLetter(t))return!0;t.pos=e}return!1},ot.regexp_eatZero=function(t){return 48===t.current()&&!pt(t.lookahead())&&(t.lastIntValue=0,t.advance(),!0)},ot.regexp_eatControlEscape=function(t){var e=t.current();return 116===e?(t.lastIntValue=9,t.advance(),!0):110===e?(t.lastIntValue=10,t.advance(),!0):118===e?(t.lastIntValue=11,t.advance(),!0):102===e?(t.lastIntValue=12,t.advance(),!0):114===e&&(t.lastIntValue=13,t.advance(),!0)},ot.regexp_eatControlLetter=function(t){var e=t.current();return!!lt(e)&&(t.lastIntValue=e%32,t.advance(),!0)},ot.regexp_eatRegExpUnicodeEscapeSequence=function(t){var e,r=t.pos;if(t.eat(117)){if(this.regexp_eatFixedHexDigits(t,4)){var n=t.lastIntValue;if(t.switchU&&n>=55296&&n<=56319){var i=t.pos;if(t.eat(92)&&t.eat(117)&&this.regexp_eatFixedHexDigits(t,4)){var o=t.lastIntValue;if(o>=56320&&o<=57343)return t.lastIntValue=1024*(n-55296)+(o-56320)+65536,!0}t.pos=i,t.lastIntValue=n}return!0}if(t.switchU&&t.eat(123)&&this.regexp_eatHexDigits(t)&&t.eat(125)&&((e=t.lastIntValue)>=0&&e<=1114111))return!0;t.switchU&&t.raise("Invalid unicode escape"),t.pos=r}return!1},ot.regexp_eatIdentityEscape=function(t){if(t.switchU)return!!this.regexp_eatSyntaxCharacter(t)||!!t.eat(47)&&(t.lastIntValue=47,!0);var e=t.current();return!(99===e||t.switchN&&107===e)&&(t.lastIntValue=e,t.advance(),!0)},ot.regexp_eatDecimalEscape=function(t){t.lastIntValue=0;var e=t.current();if(e>=49&&e<=57){do{t.lastIntValue=10*t.lastIntValue+(e-48),t.advance()}while((e=t.current())>=48&&e<=57);return!0}return!1},ot.regexp_eatCharacterClassEscape=function(t){var e=t.current();if(function(t){return 100===t||68===t||115===t||83===t||119===t||87===t}(e))return t.lastIntValue=-1,t.advance(),!0;if(t.switchU&&this.options.ecmaVersion>=9&&(80===e||112===e)){if(t.lastIntValue=-1,t.advance(),t.eat(123)&&this.regexp_eatUnicodePropertyValueExpression(t)&&t.eat(125))return!0;t.raise("Invalid property name")}return!1},ot.regexp_eatUnicodePropertyValueExpression=function(t){var e=t.pos;if(this.regexp_eatUnicodePropertyName(t)&&t.eat(61)){var r=t.lastStringValue;if(this.regexp_eatUnicodePropertyValue(t)){var n=t.lastStringValue;return this.regexp_validateUnicodePropertyNameAndValue(t,r,n),!0}}if(t.pos=e,this.regexp_eatLoneUnicodePropertyNameOrValue(t)){var i=t.lastStringValue;return this.regexp_validateUnicodePropertyNameOrValue(t,i),!0}return!1},ot.regexp_validateUnicodePropertyNameAndValue=function(t,e,r){it.hasOwnProperty(e)&&-1!==it[e].indexOf(r)||t.raise("Invalid property name")},ot.regexp_validateUnicodePropertyNameOrValue=function(t,e){-1===it.$LONE.indexOf(e)&&t.raise("Invalid property name")},ot.regexp_eatUnicodePropertyName=function(t){var e=0;for(t.lastStringValue="";ct(e=t.current());)t.lastStringValue+=st(e),t.advance();return""!==t.lastStringValue},ot.regexp_eatUnicodePropertyValue=function(t){var e=0;for(t.lastStringValue="";ht(e=t.current());)t.lastStringValue+=st(e),t.advance();return""!==t.lastStringValue},ot.regexp_eatLoneUnicodePropertyNameOrValue=function(t){return this.regexp_eatUnicodePropertyValue(t)},ot.regexp_eatCharacterClass=function(t){if(t.eat(91)){if(t.eat(94),this.regexp_classRanges(t),t.eat(93))return!0;t.raise("Unterminated character class")}return!1},ot.regexp_classRanges=function(t){for(;this.regexp_eatClassAtom(t);){var e=t.lastIntValue;if(t.eat(45)&&this.regexp_eatClassAtom(t)){var r=t.lastIntValue;!t.switchU||-1!==e&&-1!==r||t.raise("Invalid character class"),-1!==e&&-1!==r&&e>r&&t.raise("Range out of order in character class")}}},ot.regexp_eatClassAtom=function(t){var e=t.pos;if(t.eat(92)){if(this.regexp_eatClassEscape(t))return!0;if(t.switchU){var r=t.current();(99===r||mt(r))&&t.raise("Invalid class escape"),t.raise("Invalid escape")}t.pos=e}var n=t.current();return 93!==n&&(t.lastIntValue=n,t.advance(),!0)},ot.regexp_eatClassEscape=function(t){var e=t.pos;if(t.eat(98))return t.lastIntValue=8,!0;if(t.switchU&&t.eat(45))return t.lastIntValue=45,!0;if(!t.switchU&&t.eat(99)){if(this.regexp_eatClassControlLetter(t))return!0;t.pos=e}return this.regexp_eatCharacterClassEscape(t)||this.regexp_eatCharacterEscape(t)},ot.regexp_eatClassControlLetter=function(t){var e=t.current();return!(!pt(e)&&95!==e)&&(t.lastIntValue=e%32,t.advance(),!0)},ot.regexp_eatHexEscapeSequence=function(t){var e=t.pos;if(t.eat(120)){if(this.regexp_eatFixedHexDigits(t,2))return!0;t.switchU&&t.raise("Invalid escape"),t.pos=e}return!1},ot.regexp_eatDecimalDigits=function(t){var e=t.pos,r=0;for(t.lastIntValue=0;pt(r=t.current());)t.lastIntValue=10*t.lastIntValue+(r-48),t.advance();return t.pos!==e},ot.regexp_eatHexDigits=function(t){var e=t.pos,r=0;for(t.lastIntValue=0;ft(r=t.current());)t.lastIntValue=16*t.lastIntValue+dt(r),t.advance();return t.pos!==e},ot.regexp_eatLegacyOctalEscapeSequence=function(t){if(this.regexp_eatOctalDigit(t)){var e=t.lastIntValue;if(this.regexp_eatOctalDigit(t)){var r=t.lastIntValue;e<=3&&this.regexp_eatOctalDigit(t)?t.lastIntValue=64*e+8*r+t.lastIntValue:t.lastIntValue=8*e+r}else t.lastIntValue=e;return!0}return!1},ot.regexp_eatOctalDigit=function(t){var e=t.current();return mt(e)?(t.lastIntValue=e-48,t.advance(),!0):(t.lastIntValue=0,!1)},ot.regexp_eatFixedHexDigits=function(t,e){var r=t.pos;t.lastIntValue=0;for(var n=0;n>10),56320+(1023&t)))}vt.next=function(){this.options.onToken&&this.options.onToken(new gt(this)),this.lastTokEnd=this.end,this.lastTokStart=this.start,this.lastTokEndLoc=this.endLoc,this.lastTokStartLoc=this.startLoc,this.nextToken()},vt.getToken=function(){return this.next(),new gt(this)},"undefined"!=typeof Symbol&&(vt[Symbol.iterator]=function(){var t=this;return{next:function(){var e=t.getToken();return{done:e.type===b.eof,value:e}}}}),vt.curContext=function(){return this.context[this.context.length-1]},vt.nextToken=function(){var t=this.curContext();return t&&t.preserveSpace||this.skipSpace(),this.start=this.pos,this.options.locations&&(this.startLoc=this.curPosition()),this.pos>=this.input.length?this.finishToken(b.eof):t.override?t.override(this):void this.readToken(this.fullCharCodeAtPos())},vt.readToken=function(t){return p(t,this.options.ecmaVersion>=6)||92===t?this.readWord():this.getTokenFromCode(t)},vt.fullCharCodeAtPos=function(){var t=this.input.charCodeAt(this.pos);return t<=55295||t>=57344?t:(t<<10)+this.input.charCodeAt(this.pos+1)-56613888},vt.skipBlockComment=function(){var t,e=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;(t=w.exec(this.input))&&t.index8&&t<14||t>=5760&&k.test(String.fromCharCode(t))))break t;++this.pos}}},vt.finishToken=function(t,e){this.end=this.pos,this.options.locations&&(this.endLoc=this.curPosition());var r=this.type;this.type=t,this.value=e,this.updateContext(r)},vt.readToken_dot=function(){var t=this.input.charCodeAt(this.pos+1);if(t>=48&&t<=57)return this.readNumber(!0);var e=this.input.charCodeAt(this.pos+2);return this.options.ecmaVersion>=6&&46===t&&46===e?(this.pos+=3,this.finishToken(b.ellipsis)):(++this.pos,this.finishToken(b.dot))},vt.readToken_slash=function(){var t=this.input.charCodeAt(this.pos+1);return this.exprAllowed?(++this.pos,this.readRegexp()):61===t?this.finishOp(b.assign,2):this.finishOp(b.slash,1)},vt.readToken_mult_modulo_exp=function(t){var e=this.input.charCodeAt(this.pos+1),r=1,n=42===t?b.star:b.modulo;return this.options.ecmaVersion>=7&&42===t&&42===e&&(++r,n=b.starstar,e=this.input.charCodeAt(this.pos+2)),61===e?this.finishOp(b.assign,r+1):this.finishOp(n,r)},vt.readToken_pipe_amp=function(t){var e=this.input.charCodeAt(this.pos+1);return e===t?this.finishOp(124===t?b.logicalOR:b.logicalAND,2):61===e?this.finishOp(b.assign,2):this.finishOp(124===t?b.bitwiseOR:b.bitwiseAND,1)},vt.readToken_caret=function(){return 61===this.input.charCodeAt(this.pos+1)?this.finishOp(b.assign,2):this.finishOp(b.bitwiseXOR,1)},vt.readToken_plus_min=function(t){var e=this.input.charCodeAt(this.pos+1);return e===t?45!==e||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===e?this.finishOp(b.assign,2):this.finishOp(b.plusMin,1)},vt.readToken_lt_gt=function(t){var e=this.input.charCodeAt(this.pos+1),r=1;return e===t?(r=62===t&&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!==e||60!==t||this.inModule||45!==this.input.charCodeAt(this.pos+2)||45!==this.input.charCodeAt(this.pos+3)?(61===e&&(r=2),this.finishOp(b.relational,r)):(this.skipLineComment(4),this.skipSpace(),this.nextToken())},vt.readToken_eq_excl=function(t){var e=this.input.charCodeAt(this.pos+1);return 61===e?this.finishOp(b.equality,61===this.input.charCodeAt(this.pos+2)?3:2):61===t&&62===e&&this.options.ecmaVersion>=6?(this.pos+=2,this.finishToken(b.arrow)):this.finishOp(61===t?b.eq:b.prefix,1)},vt.getTokenFromCode=function(t){switch(t){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 63:return++this.pos,this.finishToken(b.question);case 96:if(this.options.ecmaVersion<6)break;return++this.pos,this.finishToken(b.backQuote);case 48:var e=this.input.charCodeAt(this.pos+1);if(120===e||88===e)return this.readRadixNumber(16);if(this.options.ecmaVersion>=6){if(111===e||79===e)return this.readRadixNumber(8);if(98===e||66===e)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(t);case 47:return this.readToken_slash();case 37:case 42:return this.readToken_mult_modulo_exp(t);case 124:case 38:return this.readToken_pipe_amp(t);case 94:return this.readToken_caret();case 43:case 45:return this.readToken_plus_min(t);case 60:case 62:return this.readToken_lt_gt(t);case 61:case 33:return this.readToken_eq_excl(t);case 126:return this.finishOp(b.prefix,1)}this.raise(this.pos,"Unexpected character '"+_t(t)+"'")},vt.finishOp=function(t,e){var r=this.input.slice(this.pos,this.pos+e);return this.pos+=e,this.finishToken(t,r)},vt.readRegexp=function(){for(var t,e,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"),t)t=!1;else{if("["===n)e=!0;else if("]"===n&&e)e=!1;else if("/"===n&&!e)break;t="\\"===n}++this.pos}var i=this.input.slice(r,this.pos);++this.pos;var o=this.pos,a=this.readWord1();this.containsEsc&&this.unexpected(o);var s=this.regexpState||(this.regexpState=new at(this));s.reset(r,i,a),this.validateRegExpFlags(s),this.validateRegExpPattern(s);var u=null;try{u=new RegExp(i,a)}catch(t){}return this.finishToken(b.regexp,{pattern:i,flags:a,value:u})},vt.readInt=function(t,e){for(var r=this.pos,n=0,i=0,o=null==e?1/0:e;i=97?a-97+10:a>=65?a-65+10:a>=48&&a<=57?a-48:1/0)>=t)break;++this.pos,n=n*t+s}return this.pos===r||null!=e&&this.pos-r!==e?null:n},vt.readRadixNumber=function(t){this.pos+=2;var e=this.readInt(t);return null==e&&this.raise(this.start+2,"Expected number in radix "+t),p(this.fullCharCodeAtPos())&&this.raise(this.pos,"Identifier directly after number"),this.finishToken(b.num,e)},vt.readNumber=function(t){var e=this.pos;t||null!==this.readInt(10)||this.raise(e,"Invalid number");var r=this.pos-e>=2&&48===this.input.charCodeAt(e);r&&this.strict&&this.raise(e,"Invalid number"),r&&/[89]/.test(this.input.slice(e,this.pos))&&(r=!1);var n=this.input.charCodeAt(this.pos);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(e,"Invalid number")),p(this.fullCharCodeAtPos())&&this.raise(this.pos,"Identifier directly after number");var i=this.input.slice(e,this.pos),o=r?parseInt(i,8):parseFloat(i);return this.finishToken(b.num,o)},vt.readCodePoint=function(){var t;if(123===this.input.charCodeAt(this.pos)){this.options.ecmaVersion<6&&this.unexpected();var e=++this.pos;t=this.readHexChar(this.input.indexOf("}",this.pos)-this.pos),++this.pos,t>1114111&&this.invalidStringToken(e,"Code point out of bounds")}else t=this.readHexChar(4);return t},vt.readString=function(t){for(var e="",r=++this.pos;;){this.pos>=this.input.length&&this.raise(this.start,"Unterminated string constant");var n=this.input.charCodeAt(this.pos);if(n===t)break;92===n?(e+=this.input.slice(r,this.pos),e+=this.readEscapedChar(!1),r=this.pos):(E(n,this.options.ecmaVersion>=10)&&this.raise(this.start,"Unterminated string constant"),++this.pos)}return e+=this.input.slice(r,this.pos++),this.finishToken(b.string,e)};var yt={};vt.tryReadTemplateToken=function(){this.inTemplateElement=!0;try{this.readTmplToken()}catch(t){if(t!==yt)throw t;this.readInvalidTemplateToken()}this.inTemplateElement=!1},vt.invalidStringToken=function(t,e){if(this.inTemplateElement&&this.options.ecmaVersion>=9)throw yt;this.raise(t,e)},vt.readTmplToken=function(){for(var t="",e=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?(t+=this.input.slice(e,this.pos),this.finishToken(b.template,t)):36===r?(this.pos+=2,this.finishToken(b.dollarBraceL)):(++this.pos,this.finishToken(b.backQuote));if(92===r)t+=this.input.slice(e,this.pos),t+=this.readEscapedChar(!0),e=this.pos;else if(E(r)){switch(t+=this.input.slice(e,this.pos),++this.pos,r){case 13:10===this.input.charCodeAt(this.pos)&&++this.pos;case 10:t+="\n";break;default:t+=String.fromCharCode(r)}this.options.locations&&(++this.curLine,this.lineStart=this.pos),e=this.pos}else++this.pos}},vt.readInvalidTemplateToken=function(){for(;this.pos=48&&e<=55){var r=this.input.substr(this.pos-1,3).match(/^[0-7]+/)[0],n=parseInt(r,8);return n>255&&(r=r.slice(0,-1),n=parseInt(r,8)),this.pos+=r.length-1,e=this.input.charCodeAt(this.pos),"0"===r&&56!==e&&57!==e||!this.strict&&!t||this.invalidStringToken(this.pos-1-r.length,t?"Octal literal in template string":"Octal literal in strict mode"),String.fromCharCode(n)}return String.fromCharCode(e)}},vt.readHexChar=function(t){var e=this.pos,r=this.readInt(16,t);return null===r&&this.invalidStringToken(e,"Bad character escape sequence"),r},vt.readWord1=function(){this.containsEsc=!1;for(var t="",e=!0,r=this.pos,n=this.options.ecmaVersion>=6;this.pos0?n-4:n,h=0;h>16&255,s[u++]=e>>8&255,s[u++]=255&e;2===a&&(e=i[t.charCodeAt(h)]<<2|i[t.charCodeAt(h+1)]>>4,s[u++]=255&e);1===a&&(e=i[t.charCodeAt(h)]<<10|i[t.charCodeAt(h+1)]<<4|i[t.charCodeAt(h+2)]>>2,s[u++]=e>>8&255,s[u++]=255&e);return s},r.fromByteArray=function(t){for(var e,r=t.length,i=r%3,o=[],a=0,s=r-i;as?s:a+16383));1===i?(e=t[r-1],o.push(n[e>>2]+n[e<<4&63]+"==")):2===i&&(e=(t[r-2]<<8)+t[r-1],o.push(n[e>>10]+n[e>>4&63]+n[e<<2&63]+"="));return o.join("")};for(var n=[],i=[],o="undefined"!=typeof Uint8Array?Uint8Array:Array,a="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",s=0,u=a.length;s0)throw new Error("Invalid string. Length must be a multiple of 4");var r=t.indexOf("=");return-1===r&&(r=e),[r,r===e?0:4-r%4]}function c(t,e,r){for(var i,o,a=[],s=e;s>18&63]+n[o>>12&63]+n[o>>6&63]+n[63&o]);return a.join("")}i["-".charCodeAt(0)]=62,i["_".charCodeAt(0)]=63},{}],3:[function(t,e,r){(function(t,n,i){!function(t){if("object"==typeof r&&void 0!==e)e.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{var i;"undefined"!=typeof window?i=window:void 0!==n?i=n:"undefined"!=typeof self&&(i=self),i.Promise=t()}}(function(){var e,r,o;return function t(e,r,n){function i(a,s){if(!r[a]){if(!e[a]){var u="function"==typeof _dereq_&&_dereq_;if(!s&&u)return u(a,!0);if(o)return o(a,!0);var l=new Error("Cannot find module '"+a+"'");throw l.code="MODULE_NOT_FOUND",l}var c=r[a]={exports:{}};e[a][0].call(c.exports,function(t){var r=e[a][1][t];return i(r||t)},c,c.exports,t,e,r,n)}return r[a].exports}for(var o="function"==typeof _dereq_&&_dereq_,a=0;a0;)f(t)}function f(t){var e=t.shift();if("function"!=typeof e)e._settlePromises();else{var r=t.shift(),n=t.shift();e.call(r,n)}}u.prototype.setScheduler=function(t){var e=this._schedule;return this._schedule=t,this._customScheduler=!0,e},u.prototype.hasCustomScheduler=function(){return this._customScheduler},u.prototype.enableTrampoline=function(){this._trampolineEnabled=!0},u.prototype.disableTrampolineIfNecessary=function(){s.hasDevTools&&(this._trampolineEnabled=!1)},u.prototype.haveItemsQueued=function(){return this._isTickUsed||this._haveDrainedQueues},u.prototype.fatalError=function(e,r){r?(t.stderr.write("Fatal "+(e instanceof Error?e.stack:e)+"\n"),t.exit(2)):this.throwLater(e)},u.prototype.throwLater=function(t,e){if(1===arguments.length&&(e=t,t=function(){throw e}),"undefined"!=typeof setTimeout)setTimeout(function(){t(e)},0);else try{this._schedule(function(){t(e)})}catch(t){throw new Error("No async scheduler available\n\n See http://goo.gl/MqrFmX\n")}},s.hasDevTools?(u.prototype.invokeLater=function(t,e,r){this._trampolineEnabled?l.call(this,t,e,r):this._schedule(function(){setTimeout(function(){t.call(e,r)},100)})},u.prototype.invoke=function(t,e,r){this._trampolineEnabled?c.call(this,t,e,r):this._schedule(function(){t.call(e,r)})},u.prototype.settlePromises=function(t){this._trampolineEnabled?h.call(this,t):this._schedule(function(){t._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(t,e,r){"use strict";e.exports=function(t,e,r,n){var i=!1,o=function(t,e){this._reject(e)},a=function(t,e){e.promiseRejectionQueued=!0,e.bindingPromise._then(o,o,null,this,t)},s=function(t,e){0==(50397184&this._bitField)&&this._resolveCallback(e.target)},u=function(t,e){e.promiseRejectionQueued||this._reject(t)};t.prototype.bind=function(o){i||(i=!0,t.prototype._propagateFrom=n.propagateFromFunction(),t.prototype._boundValue=n.boundValueFunction());var l=r(o),c=new t(e);c._propagateFrom(this,1);var h=this._target();if(c._setBoundTo(l),l instanceof t){var p={promiseRejectionQueued:!1,promise:c,target:h,bindingPromise:l};h._then(e,a,void 0,c,p),l._then(s,u,void 0,c,p),c._setOnCancel(l)}else c._resolveCallback(h);return c},t.prototype._setBoundTo=function(t){void 0!==t?(this._bitField=2097152|this._bitField,this._boundTo=t):this._bitField=-2097153&this._bitField},t.prototype._isBound=function(){return 2097152==(2097152&this._bitField)},t.bind=function(e,r){return t.resolve(r).bind(e)}}},{}],4:[function(t,e,r){"use strict";var n;"undefined"!=typeof Promise&&(n=Promise);var i=t("./promise")();i.noConflict=function(){try{Promise===i&&(Promise=n)}catch(t){}return i},e.exports=i},{"./promise":22}],5:[function(t,e,r){"use strict";var n=Object.create;if(n){var i=n(null),o=n(null);i[" size"]=o[" size"]=0}e.exports=function(e){var r,n=t("./util"),i=n.canEvaluate;n.isIdentifier;function o(t,r){var i;if(null!=t&&(i=t[r]),"function"!=typeof i){var o="Object "+n.classString(t)+" has no method '"+n.toString(r)+"'";throw new e.TypeError(o)}return i}function a(t){return o(t,this.pop()).apply(t,this)}function s(t){return t[this]}function u(t){var e=+this;return e<0&&(e=Math.max(0,e+t.length)),t[e]}e.prototype.call=function(t){var e=[].slice.call(arguments,1);return e.push(t),this._then(a,void 0,void 0,e,void 0)},e.prototype.get=function(t){var e;if("number"==typeof t)e=u;else if(i){var n=r(t);e=null!==n?n:s}else e=s;return this._then(e,void 0,void 0,t,void 0)}}},{"./util":36}],6:[function(t,e,r){"use strict";e.exports=function(e,r,n,i){var o=t("./util"),a=o.tryCatch,s=o.errorObj,u=e._async;e.prototype.break=e.prototype.cancel=function(){if(!i.cancellation())return this._warn("cancellation is disabled");for(var t=this,e=t;t._isCancellable();){if(!t._cancelBy(e)){e._isFollowing()?e._followee().cancel():e._cancelBranched();break}var r=t._cancellationParent;if(null==r||!r._isCancellable()){t._isFollowing()?t._followee().cancel():t._cancelBranched();break}t._isFollowing()&&t._followee().cancel(),t._setWillBeCancelled(),e=t,t=r}},e.prototype._branchHasCancelled=function(){this._branchesRemainingToCancel--},e.prototype._enoughBranchesHaveCancelled=function(){return void 0===this._branchesRemainingToCancel||this._branchesRemainingToCancel<=0},e.prototype._cancelBy=function(t){return t===this?(this._branchesRemainingToCancel=0,this._invokeOnCancel(),!0):(this._branchHasCancelled(),!!this._enoughBranchesHaveCancelled()&&(this._invokeOnCancel(),!0))},e.prototype._cancelBranched=function(){this._enoughBranchesHaveCancelled()&&this._cancel()},e.prototype._cancel=function(){this._isCancellable()&&(this._setCancelled(),u.invoke(this._cancelPromises,this,void 0))},e.prototype._cancelPromises=function(){this._length()>0&&this._settlePromises()},e.prototype._unsetOnCancel=function(){this._onCancelField=void 0},e.prototype._isCancellable=function(){return this.isPending()&&!this._isCancelled()},e.prototype.isCancellable=function(){return this.isPending()&&!this.isCancelled()},e.prototype._doInvokeOnCancel=function(t,e){if(o.isArray(t))for(var r=0;r=0)return r[t]}return t.prototype._promiseCreated=function(){},t.prototype._pushContext=function(){},t.prototype._popContext=function(){return null},t._peekContext=t.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 t=r.pop(),e=t._promiseCreated;return t._promiseCreated=null,e}return null},n.CapturedTrace=null,n.create=function(){if(e)return new n},n.deactivateLongStackTraces=function(){},n.activateLongStackTraces=function(){var r=t.prototype._pushContext,o=t.prototype._popContext,a=t._peekContext,s=t.prototype._peekContext,u=t.prototype._promiseCreated;n.deactivateLongStackTraces=function(){t.prototype._pushContext=r,t.prototype._popContext=o,t._peekContext=a,t.prototype._peekContext=s,t.prototype._promiseCreated=u,e=!1},e=!0,t.prototype._pushContext=n.prototype._pushContext,t.prototype._popContext=n.prototype._popContext,t._peekContext=t.prototype._peekContext=i,t.prototype._promiseCreated=function(){var t=this._peekContext();t&&null==t._promiseCreated&&(t._promiseCreated=this)}},n}},{}],9:[function(e,r,n){"use strict";r.exports=function(r,n){var i,o,a,s=r._getDomain,u=r._async,l=e("./errors").Warning,c=e("./util"),h=e("./es5"),p=c.canAttachTrace,f=/[\\\/]bluebird[\\\/]js[\\\/](release|debug|instrumented)/,d=/\((?:timers\.js):\d+:\d+\)/,m=/[\/<\(](.+?):(\d+):(\d+)\)?\s*$/,g=null,v=null,_=!1,y=!(0==c.env("BLUEBIRD_DEBUG")),b=!(0==c.env("BLUEBIRD_WARNINGS")||!y&&!c.env("BLUEBIRD_WARNINGS")),x=!(0==c.env("BLUEBIRD_LONG_STACK_TRACES")||!y&&!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 t=this._target();t._bitField=-1048577&t._bitField|524288},r.prototype._ensurePossibleRejectionHandled=function(){if(0==(524288&this._bitField)){this._setRejectionIsUnhandled();var t=this;setTimeout(function(){t._notifyUnhandledRejection()},1)}},r.prototype._notifyUnhandledRejectionIsHandled=function(){X("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 t=this._settledValue();this._setUnhandledRejectionIsNotified(),X("unhandledRejection",o,t,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(t,e,r){return z(t,e,r||this)},r.onPossiblyUnhandledRejection=function(t){var e=s();o="function"==typeof t?null===e?t:c.domainBind(e,t):void 0},r.onUnhandledRejectionHandled=function(t){var e=s();i="function"==typeof t?null===e?t:c.domainBind(e,t):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 t=r.prototype._captureStackTrace,e=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=t,r.prototype._attachExtraTrace=e,r.prototype._dereferenceTrace=i,n.deactivateLongStackTraces(),u.enableTrampoline(),Q.longStackTraces=!1},r.prototype._captureStackTrace=N,r.prototype._attachExtraTrace=j,r.prototype._dereferenceTrace=U,n.activateLongStackTraces(),u.disableTrampolineIfNecessary()}},r.hasLongStackTraces=function(){return Q.longStackTraces&&K()};var k=function(){try{if("function"==typeof CustomEvent){var t=new CustomEvent("CustomEvent");return c.global.dispatchEvent(t),function(t,e){var r={detail:e,cancelable:!0};h.defineProperty(r,"promise",{value:e.promise}),h.defineProperty(r,"reason",{value:e.reason});var n=new CustomEvent(t.toLowerCase(),r);return!c.global.dispatchEvent(n)}}if("function"==typeof Event){t=new Event("CustomEvent");return c.global.dispatchEvent(t),function(t,e){var r=new Event(t.toLowerCase(),{cancelable:!0});return r.detail=e,h.defineProperty(r,"promise",{value:e.promise}),h.defineProperty(r,"reason",{value:e.reason}),!c.global.dispatchEvent(r)}}return(t=document.createEvent("CustomEvent")).initCustomEvent("testingtheevent",!1,!0,{}),c.global.dispatchEvent(t),function(t,e){var r=document.createEvent("CustomEvent");return r.initCustomEvent(t.toLowerCase(),!1,!0,e),!c.global.dispatchEvent(r)}}catch(t){}return function(){return!1}}(),T=c.isNode?function(){return t.emit.apply(t,arguments)}:c.global?function(t){var e="on"+t.toLowerCase(),r=c.global[e];return!!r&&(r.apply(c.global,[].slice.call(arguments,1)),!0)}:function(){return!1};function S(t,e){return{promise:e}}var A={promiseCreated:S,promiseFulfilled:S,promiseRejected:S,promiseResolved:S,promiseCancelled:S,promiseChained:function(t,e,r){return{promise:e,child:r}},warning:function(t,e){return{warning:e}},unhandledRejection:function(t,e,r){return{reason:e,promise:r}},rejectionHandled:S},C=function(t){var e=!1;try{e=T.apply(null,arguments)}catch(t){u.throwLater(t),e=!0}var r=!1;try{r=k(t,A[t].apply(null,arguments))}catch(t){u.throwLater(t),r=!0}return r||e};function R(){return!1}function B(t,e,r){var n=this;try{t(e,r,function(t){if("function"!=typeof t)throw new TypeError("onCancel must be a function, got: "+c.toString(t));n._attachCancellationCallback(t)})}catch(t){return t}}function P(t){if(!this._isCancellable())return this;var e=this._onCancel();void 0!==e?c.isArray(e)?e.push(t):this._setOnCancel([e,t]):this._setOnCancel(t)}function I(){return this._onCancelField}function M(t){this._onCancelField=t}function D(){this._cancellationParent=void 0,this._onCancelField=void 0}function F(t,e){if(0!=(1&e)){this._cancellationParent=t;var r=t._branchesRemainingToCancel;void 0===r&&(r=0),t._branchesRemainingToCancel=r+1}0!=(2&e)&&t._isBound()&&this._setBoundTo(t._boundTo)}r.config=function(t){if("longStackTraces"in(t=Object(t))&&(t.longStackTraces?r.longStackTraces():!t.longStackTraces&&r.hasLongStackTraces()&&E()),"warnings"in t){var e=t.warnings;Q.warnings=!!e,w=Q.warnings,c.isObject(e)&&"wForgottenReturn"in e&&(w=!!e.wForgottenReturn)}if("cancellation"in t&&t.cancellation&&!Q.cancellation){if(u.haveItemsQueued())throw new Error("cannot enable cancellation after promises are in use");r.prototype._clearCancellationData=D,r.prototype._propagateFrom=F,r.prototype._onCancel=I,r.prototype._setOnCancel=M,r.prototype._attachCancellationCallback=P,r.prototype._execute=B,L=F,Q.cancellation=!0}return"monitoring"in t&&(t.monitoring&&!Q.monitoring?(Q.monitoring=!0,r.prototype._fireEvent=C):!t.monitoring&&Q.monitoring&&(Q.monitoring=!1,r.prototype._fireEvent=R)),r},r.prototype._fireEvent=R,r.prototype._execute=function(t,e,r){try{t(e,r)}catch(t){return t}},r.prototype._onCancel=function(){},r.prototype._setOnCancel=function(t){},r.prototype._attachCancellationCallback=function(t){},r.prototype._captureStackTrace=function(){},r.prototype._attachExtraTrace=function(){},r.prototype._dereferenceTrace=function(){},r.prototype._clearCancellationData=function(){},r.prototype._propagateFrom=function(t,e){};var L=function(t,e){0!=(2&e)&&t._isBound()&&this._setBoundTo(t._boundTo)};function O(){var t=this._boundTo;return void 0!==t&&t instanceof r?t.isFulfilled()?t.value():void 0:t}function N(){this._trace=new Z(this._peekContext())}function j(t,e){if(p(t)){var r=this._trace;if(void 0!==r&&e&&(r=r._parent),void 0!==r)r.attachExtraTrace(t);else if(!t.__stackCleaned__){var n=$(t);c.notEnumerableProp(t,"stack",n.message+"\n"+n.stack.join("\n")),c.notEnumerableProp(t,"__stackCleaned__",!0)}}}function U(){this._trace=void 0}function z(t,e,n){if(Q.warnings){var i,o=new l(t);if(e)n._attachExtraTrace(o);else if(Q.longStackTraces&&(i=r._peekContext()))i.attachExtraTrace(o);else{var a=$(o);o.stack=a.message+"\n"+a.stack.join("\n")}C("warning",o)||V(o,"",!0)}}function G(t){for(var e=[],r=0;r0?function(t){for(var e=t.stack.replace(/\s+$/g,"").split("\n"),r=0;r0&&"SyntaxError"!=t.name&&(e=e.slice(r)),e}(t):[" (No stack trace)"],{message:r,stack:"SyntaxError"==t.name?e:G(e)}}function V(t,e,r){if("undefined"!=typeof console){var n;if(c.isObject(t)){var i=t.stack;n=e+v(i,t)}else n=e+String(t);"function"==typeof a?a(n,r):"function"!=typeof console.log&&"object"!=typeof console.log||console.log(n)}}function X(t,e,r,n){var i=!1;try{"function"==typeof e&&(i=!0,"rejectionHandled"===t?e(n):e(r,n))}catch(t){u.throwLater(t)}"unhandledRejection"===t?C(t,r,n)||i||V(r,"Unhandled rejection "):C(t,n)}function q(t){var e;if("function"==typeof t)e="[function "+(t.name||"anonymous")+"]";else{e=t&&"function"==typeof t.toString?t.toString():c.toString(t);if(/\[object [a-zA-Z0-9$_]+\]/.test(e))try{e=JSON.stringify(t)}catch(t){}0===e.length&&(e="(empty array)")}return"(<"+function(t){if(t.length<41)return t;return t.substr(0,38)+"..."}(e)+">, no stack trace)"}function K(){return"function"==typeof J}var W=function(){return!1},H=/[\/<\(]([^:\/]+):(\d+):(?:\d+)\)?\s*$/;function Y(t){var e=t.match(H);if(e)return{fileName:e[1],line:parseInt(e[2],10)}}function Z(t){this._parent=t,this._promisesCreated=0;var e=this._length=1+(void 0===t?0:t._length);J(this,Z),e>32&&this.uncycle()}c.inherits(Z,Error),n.CapturedTrace=Z,Z.prototype.uncycle=function(){var t=this._length;if(!(t<2)){for(var e=[],r={},n=0,i=this;void 0!==i;++n)e.push(i),i=i._parent;for(n=(t=this._length=n)-1;n>=0;--n){var o=e[n].stack;void 0===r[o]&&(r[o]=n)}for(n=0;n0&&(e[a-1]._parent=void 0,e[a-1]._length=1),e[n]._parent=void 0,e[n]._length=1;var s=n>0?e[n-1]:this;a=0;--l)e[l]._length=u,u++;return}}}},Z.prototype.attachExtraTrace=function(t){if(!t.__stackCleaned__){this.uncycle();for(var e=$(t),r=e.message,n=[e.stack],i=this;void 0!==i;)n.push(G(i.stack.split("\n"))),i=i._parent;!function(t){for(var e=t[0],r=1;r=0;--s)if(n[s]===o){a=s;break}for(s=a;s>=0;--s){var u=n[s];if(e[i]!==u)break;e.pop(),i--}e=n}}(n),function(t){for(var e=0;e=0)return g=/@/,v=e,_=!0,function(t){t.stack=(new Error).stack};try{throw new Error}catch(t){n="stack"in t}return"stack"in i||!n||"number"!=typeof Error.stackTraceLimit?(v=function(t,e){return"string"==typeof t?t:"object"!=typeof e&&"function"!=typeof e||void 0===e.name||void 0===e.message?q(e):e.toString()},null):(g=t,v=e,function(t){Error.stackTraceLimit+=6;try{throw new Error}catch(e){t.stack=e.stack}Error.stackTraceLimit-=6})}();"undefined"!=typeof console&&void 0!==console.warn&&(a=function(t){console.warn(t)},c.isNode&&t.stderr.isTTY?a=function(t,e){var r=e?"":"";console.warn(r+t+"\n")}:c.isNode||"string"!=typeof(new Error).stack||(a=function(t,e){console.warn("%c"+t,e?"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 L},boundValueFunction:function(){return O},checkForgottenReturns:function(t,e,r,n,i){if(void 0===t&&null!==e&&w){if(void 0!==i&&i._returnedNonUndefined())return;if(0==(65535&n._bitField))return;r&&(r+=" ");var o="",a="";if(e._trace){for(var s=e._trace.stack.split("\n"),u=G(s),l=u.length-1;l>=0;--l){var c=u[l];if(!d.test(c)){var h=c.match(m);h&&(o="at "+h[1]+":"+h[2]+":"+h[3]+" ");break}}if(u.length>0){var p=u[0];for(l=0;l0&&(a="\n"+s[l-1]);break}}}var f="a promise was created in a "+r+"handler "+o+"but was not returned from it, see http://goo.gl/rRqMUw"+a;n._warn(f,!0,e)}},setBounds:function(t,e){if(K()){for(var r,n,i=t.stack.split("\n"),o=e.stack.split("\n"),a=-1,s=-1,u=0;u=s||(W=function(t){if(f.test(t))return!0;var e=Y(t);return!!(e&&e.fileName===r&&a<=e.line&&e.line<=s)})}},warn:z,deprecated:function(t,e){var r=t+" is deprecated and will be removed in a future version.";return e&&(r+=" Use "+e+" instead."),z(r)},CapturedTrace:Z,fireDomEvent:k,fireGlobalEvent:T}}},{"./errors":12,"./es5":13,"./util":36}],10:[function(t,e,r){"use strict";e.exports=function(t){function e(){return this.value}function r(){throw this.reason}t.prototype.return=t.prototype.thenReturn=function(r){return r instanceof t&&r.suppressUnhandledRejections(),this._then(e,void 0,void 0,{value:r},void 0)},t.prototype.throw=t.prototype.thenThrow=function(t){return this._then(r,void 0,void 0,{reason:t},void 0)},t.prototype.catchThrow=function(t){if(arguments.length<=1)return this._then(void 0,r,void 0,{reason:t},void 0);var e=arguments[1];return this.caught(t,function(){throw e})},t.prototype.catchReturn=function(r){if(arguments.length<=1)return r instanceof t&&r.suppressUnhandledRejections(),this._then(void 0,e,void 0,{value:r},void 0);var n=arguments[1];n instanceof t&&n.suppressUnhandledRejections();return this.caught(r,function(){return n})}}},{}],11:[function(t,e,r){"use strict";e.exports=function(t,e){var r=t.reduce,n=t.all;function i(){return n(this)}t.prototype.each=function(t){return r(this,t,e,0)._then(i,void 0,void 0,this,void 0)},t.prototype.mapSeries=function(t){return r(this,t,e,e)},t.each=function(t,n){return r(t,n,e,0)._then(i,void 0,void 0,t,void 0)},t.mapSeries=function(t,n){return r(t,n,e,e)}}},{}],12:[function(t,e,r){"use strict";var n,i,o=t("./es5"),a=o.freeze,s=t("./util"),u=s.inherits,l=s.notEnumerableProp;function c(t,e){function r(n){if(!(this instanceof r))return new r(n);l(this,"message","string"==typeof n?n:e),l(this,"name",t),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(t){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?t.cancelPromise._reject(e):t.cancelPromise._cancel(),t.cancelPromise=null,!0)}function h(){return f.call(this,this.promise._target()._settledValue())}function p(t){if(!c(this,t))return a.e=t,a}function f(t){var i=this.promise,s=this.handler;if(!this.called){this.called=!0;var u=this.isFinallyHandler()?s.call(i._boundValue()):s.call(i._boundValue(),t);if(u===n)return u;if(void 0!==u){i._setReturnedNonUndefined();var f=r(u,i);if(f instanceof e){if(null!=this.cancelPromise){if(f._isCancelled()){var d=new o("late cancellation observer");return i._attachExtraTrace(d),a.e=d,a}f.isPending()&&f._attachCancellationCallback(new l(this))}return f._then(h,p,void 0,this,void 0)}}}return i.isRejected()?(c(this),a.e=t,a):(c(this),t)}return u.prototype.isFinallyHandler=function(){return 0===this.type},l.prototype._resultCancelled=function(){c(this.finallyHandler)},e.prototype._passThrough=function(t,e,r,n){return"function"!=typeof t?this.then():this._then(r,n,void 0,new u(this,e,t),void 0)},e.prototype.lastly=e.prototype.finally=function(t){return this._passThrough(t,0,f,f)},e.prototype.tap=function(t){return this._passThrough(t,1,f)},e.prototype.tapCatch=function(t){var r=arguments.length;if(1===r)return this._passThrough(t,1,void 0,f);var n,o=new Array(r-1),a=0;for(n=0;n0&&"function"==typeof arguments[e]&&(t=arguments[e]);var n=[].slice.call(arguments);t&&n.pop();var i=new r(n).promise();return void 0!==t?i.spread(t):i}}},{"./util":36}],18:[function(t,e,r){"use strict";e.exports=function(e,r,n,i,o,a){var s=e._getDomain,u=t("./util"),l=u.tryCatch,c=u.errorObj,h=e._async;function p(t,e,r,n){this.constructor$(t),this._promise._captureStackTrace();var i=s();this._callback=null===i?e:u.domainBind(i,e),this._preservedValues=n===o?new Array(this.length()):null,this._limit=r,this._inFlight=0,this._queue=[],h.invoke(this._asyncInit,this,void 0)}function f(t,r,i,o){if("function"!=typeof r)return n("expecting a function but got "+u.classString(r));var a=0;if(void 0!==i){if("object"!=typeof i||null===i)return e.reject(new TypeError("options argument must be an object but it is "+u.classString(i)));if("number"!=typeof i.concurrency)return e.reject(new TypeError("'concurrency' must be a number but it is "+u.classString(i.concurrency)));a=i.concurrency}return new p(t,r,a="number"==typeof a&&isFinite(a)&&a>=1?a:0,o).promise()}u.inherits(p,r),p.prototype._asyncInit=function(){this._init$(void 0,-2)},p.prototype._init=function(){},p.prototype._promiseFulfilled=function(t,r){var n=this._values,o=this.length(),s=this._preservedValues,u=this._limit;if(r<0){if(n[r=-1*r-1]=t,u>=1&&(this._inFlight--,this._drainQueue(),this._isResolved()))return!0}else{if(u>=1&&this._inFlight>=u)return n[r]=t,this._queue.push(r),!1;null!==s&&(s[r]=t);var h=this._promise,p=this._callback,f=h._boundValue();h._pushContext();var d=l(p).call(f,t,r,o),m=h._popContext();if(a.checkForgottenReturns(d,m,null!==s?"Promise.filter":"Promise.map",h),d===c)return this._reject(d.e),!0;var g=i(d,this._promise);if(g instanceof e){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>=o&&(null!==s?this._filter(n,s):this._resolve(n),!0)},p.prototype._drainQueue=function(){for(var t=this._queue,e=this._limit,r=this._values;t.length>0&&this._inFlight1){o.deprecated("calling Promise.try with more than 1 argument");var l=arguments[1],c=arguments[2];n=a.isArray(l)?s(t).apply(c,l):s(t).call(c,l)}else n=s(t)();var h=u._popContext();return o.checkForgottenReturns(n,h,"Promise.try",u),u._resolveFromSyncValue(n),u},e.prototype._resolveFromSyncValue=function(t){t===a.errorObj?this._rejectCallback(t.e,!1):this._resolveCallback(t,!0)}}},{"./util":36}],20:[function(t,e,r){"use strict";var n=t("./util"),i=n.maybeWrapAsError,o=t("./errors").OperationalError,a=t("./es5");var s=/^(?:name|message|stack|cause)$/;function u(t){var e;if(function(t){return t instanceof Error&&a.getPrototypeOf(t)===Error.prototype}(t)){(e=new o(t)).name=t.name,e.message=t.message,e.stack=t.stack;for(var r=a.keys(t),i=0;i1){var r,n=new Array(e-1),i=0;for(r=0;r0&&"function"!=typeof t&&"function"!=typeof e){var r=".then() only accepts functions but was passed: "+l.classString(t);arguments.length>1&&(r+=", "+l.classString(e)),this._warn(r)}return this._then(t,e,void 0,void 0,void 0)},R.prototype.done=function(t,e){this._then(t,e,void 0,void 0,void 0)._setIsFinal()},R.prototype.spread=function(t){return"function"!=typeof t?o("expecting a function but got "+l.classString(t)):this.all()._then(t,void 0,void 0,v,void 0)},R.prototype.toJSON=function(){var t={isFulfilled:!1,isRejected:!1,fulfillmentValue:void 0,rejectionReason:void 0};return this.isFulfilled()?(t.fulfillmentValue=this.value(),t.isFulfilled=!0):this.isRejected()&&(t.rejectionReason=this.reason(),t.isRejected=!0),t},R.prototype.all=function(){return arguments.length>0&&this._warn(".all() was passed arguments but it does not take any"),new b(this).promise()},R.prototype.error=function(t){return this.caught(l.originatesFromRejection,t)},R.getNewLibraryCopy=r.exports,R.is=function(t){return t instanceof R},R.fromNode=R.fromCallback=function(t){var e=new R(g);e._captureStackTrace();var r=arguments.length>1&&!!Object(arguments[1]).multiArgs,n=C(t)(S(e,r));return n===A&&e._rejectCallback(n.e,!0),e._isFateSealed()||e._setAsyncGuaranteed(),e},R.all=function(t){return new b(t).promise()},R.cast=function(t){var e=y(t);return e instanceof R||((e=new R(g))._captureStackTrace(),e._setFulfilled(),e._rejectionHandler0=t),e},R.resolve=R.fulfilled=R.cast,R.reject=R.rejected=function(t){var e=new R(g);return e._captureStackTrace(),e._rejectCallback(t,!0),e},R.setScheduler=function(t){if("function"!=typeof t)throw new d("expecting a function but got "+l.classString(t));return p.setScheduler(t)},R.prototype._then=function(t,e,r,n,i){var o=void 0!==i,a=o?i:new R(g),u=this._target(),c=u._bitField;o||(a._propagateFrom(this,3),a._captureStackTrace(),void 0===n&&0!=(2097152&this._bitField)&&(n=0!=(50397184&c)?this._boundValue():u===this?void 0:this._boundTo),this._fireEvent("promiseChained",this,a));var h=s();if(0!=(50397184&c)){var f,d,v=u._settlePromiseCtx;0!=(33554432&c)?(d=u._rejectionHandler0,f=t):0!=(16777216&c)?(d=u._fulfillmentHandler0,f=e,u._unsetRejectionIsUnhandled()):(v=u._settlePromiseLateCancellationObserver,d=new m("late cancellation observer"),u._attachExtraTrace(d),f=e),p.invoke(v,u,{handler:null===h?f:"function"==typeof f&&l.domainBind(h,f),promise:a,receiver:n,value:d})}else u._addCallbacks(t,e,a,n,h);return a},R.prototype._length=function(){return 65535&this._bitField},R.prototype._isFateSealed=function(){return 0!=(117506048&this._bitField)},R.prototype._isFollowing=function(){return 67108864==(67108864&this._bitField)},R.prototype._setLength=function(t){this._bitField=-65536&this._bitField|65535&t},R.prototype._setFulfilled=function(){this._bitField=33554432|this._bitField,this._fireEvent("promiseFulfilled",this)},R.prototype._setRejected=function(){this._bitField=16777216|this._bitField,this._fireEvent("promiseRejected",this)},R.prototype._setFollowing=function(){this._bitField=67108864|this._bitField,this._fireEvent("promiseResolved",this)},R.prototype._setIsFinal=function(){this._bitField=4194304|this._bitField},R.prototype._isFinal=function(){return(4194304&this._bitField)>0},R.prototype._unsetCancelled=function(){this._bitField=-65537&this._bitField},R.prototype._setCancelled=function(){this._bitField=65536|this._bitField,this._fireEvent("promiseCancelled",this)},R.prototype._setWillBeCancelled=function(){this._bitField=8388608|this._bitField},R.prototype._setAsyncGuaranteed=function(){p.hasCustomScheduler()||(this._bitField=134217728|this._bitField)},R.prototype._receiverAt=function(t){var e=0===t?this._receiver0:this[4*t-4+3];if(e!==u)return void 0===e&&this._isBound()?this._boundValue():e},R.prototype._promiseAt=function(t){return this[4*t-4+2]},R.prototype._fulfillmentHandlerAt=function(t){return this[4*t-4+0]},R.prototype._rejectionHandlerAt=function(t){return this[4*t-4+1]},R.prototype._boundValue=function(){},R.prototype._migrateCallback0=function(t){t._bitField;var e=t._fulfillmentHandler0,r=t._rejectionHandler0,n=t._promise0,i=t._receiverAt(0);void 0===i&&(i=u),this._addCallbacks(e,r,n,i,null)},R.prototype._migrateCallbackAt=function(t,e){var r=t._fulfillmentHandlerAt(e),n=t._rejectionHandlerAt(e),i=t._promiseAt(e),o=t._receiverAt(e);void 0===o&&(o=u),this._addCallbacks(r,n,i,o,null)},R.prototype._addCallbacks=function(t,e,r,n,i){var o=this._length();if(o>=65531&&(o=0,this._setLength(0)),0===o)this._promise0=r,this._receiver0=n,"function"==typeof t&&(this._fulfillmentHandler0=null===i?t:l.domainBind(i,t)),"function"==typeof e&&(this._rejectionHandler0=null===i?e:l.domainBind(i,e));else{var a=4*o-4;this[a+2]=r,this[a+3]=n,"function"==typeof t&&(this[a+0]=null===i?t:l.domainBind(i,t)),"function"==typeof e&&(this[a+1]=null===i?e:l.domainBind(i,e))}return this._setLength(o+1),o},R.prototype._proxy=function(t,e){this._addCallbacks(void 0,void 0,e,t,null)},R.prototype._resolveCallback=function(t,e){if(0==(117506048&this._bitField)){if(t===this)return this._rejectCallback(n(),!1);var r=y(t,this);if(!(r instanceof R))return this._fulfill(t);e&&this._propagateFrom(r,2);var i=r._target();if(i!==this){var o=i._bitField;if(0==(50397184&o)){var a=this._length();a>0&&i._migrateCallback0(this);for(var s=1;s>>16)){if(t===this){var r=n();return this._attachExtraTrace(r),this._reject(r)}this._setFulfilled(),this._rejectionHandler0=t,(65535&e)>0&&(0!=(134217728&e)?this._settlePromises():p.settlePromises(this),this._dereferenceTrace())}},R.prototype._reject=function(t){var e=this._bitField;if(!((117506048&e)>>>16)){if(this._setRejected(),this._fulfillmentHandler0=t,this._isFinal())return p.fatalError(t,l.isNode);(65535&e)>0?p.settlePromises(this):this._ensurePossibleRejectionHandled()}},R.prototype._fulfillPromises=function(t,e){for(var r=1;r0){if(0!=(16842752&t)){var r=this._fulfillmentHandler0;this._settlePromise0(this._rejectionHandler0,r,t),this._rejectPromises(e,r)}else{var n=this._rejectionHandler0;this._settlePromise0(this._fulfillmentHandler0,n,t),this._fulfillPromises(e,n)}this._setLength(0)}this._clearCancellationData()},R.prototype._settledValue=function(){var t=this._bitField;return 0!=(33554432&t)?this._rejectionHandler0:0!=(16777216&t)?this._fulfillmentHandler0:void 0},R.defer=R.pending=function(){return E.deprecated("Promise.defer","new Promise"),{promise:new R(g),resolve:B,reject:P}},l.notEnumerableProp(R,"_makeSelfResolutionError",n),e("./method")(R,g,y,o,E),e("./bind")(R,g,y,E),e("./cancel")(R,b,o,E),e("./direct_resolve")(R),e("./synchronous_inspection")(R),e("./join")(R,b,y,g,p,s),R.Promise=R,R.version="3.5.3",e("./map.js")(R,b,o,y,g,E),e("./call_get.js")(R),e("./using.js")(R,o,y,w,g,E),e("./timers.js")(R,g,E),e("./generators.js")(R,o,g,y,a,E),e("./nodeify.js")(R),e("./promisify.js")(R,g),e("./props.js")(R,b,y,o),e("./race.js")(R,g,y,o),e("./reduce.js")(R,b,o,y,g,E),e("./settle.js")(R,b,E),e("./some.js")(R,b,o),e("./filter.js")(R,g),e("./each.js")(R,g),e("./any.js")(R),l.toFastProperties(R),l.toFastProperties(R.prototype),I({a:1}),I({b:2}),I({c:3}),I(1),I(function(){}),I(void 0),I(!1),I(new R(g)),E.setBounds(h.firstLineError,l.lastLineError),R}},{"./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(t,e,r){"use strict";e.exports=function(e,r,n,i,o){var a=t("./util");a.isArray;function s(t){var n=this._promise=new e(r);t instanceof e&&n._propagateFrom(t,3),n._setOnCancel(this),this._values=t,this._length=0,this._totalResolved=0,this._init(void 0,-2)}return a.inherits(s,o),s.prototype.length=function(){return this._length},s.prototype.promise=function(){return this._promise},s.prototype._init=function t(r,o){var s=n(this._values,this._promise);if(s instanceof e){var u=(s=s._target())._bitField;if(this._values=s,0==(50397184&u))return this._promise._setAsyncGuaranteed(),s._then(t,this._reject,void 0,this,o);if(0==(33554432&u))return 0!=(16777216&u)?this._reject(s._reason()):this._cancel();s=s._value()}if(null!==(s=a.asArray(s)))0!==s.length?this._iterate(s):-5===o?this._resolveEmptyArray():this._resolve(function(t){switch(t){case-2:return[];case-3:return{};case-6:return new Map}}(o));else{var l=i("expecting an array or an iterable object but got "+a.classString(s)).reason();this._promise._rejectCallback(l,!1)}},s.prototype._iterate=function(t){var r=this.getActualLength(t.length);this._length=r,this._values=this.shouldCopyValues()?new Array(r):this._values;for(var i=this._promise,o=!1,a=null,s=0;s=this._length&&(this._resolve(this._values),!0)},s.prototype._promiseCancelled=function(){return this._cancel(),!0},s.prototype._promiseRejected=function(t){return this._totalResolved++,this._reject(t),!0},s.prototype._resultCancelled=function(){if(!this._isResolved()){var t=this._values;if(this._cancel(),t instanceof e)t.cancel();else for(var r=0;r=this._length){var r;if(this._isMap)r=function(t){for(var e=new o,r=t.length/2|0,n=0;n>1},e.prototype.props=function(){return h(this)},e.props=function(t){return h(t)}}},{"./es5":13,"./util":36}],26:[function(t,e,r){"use strict";function n(t){this._capacity=t,this._length=0,this._front=0}n.prototype._willBeOverCapacity=function(t){return this._capacity=this._length&&(this._resolve(this._values),!0)},o.prototype._promiseFulfilled=function(t,e){var r=new i;return r._bitField=33554432,r._settledValueField=t,this._promiseResolved(e,r)},o.prototype._promiseRejected=function(t,e){var r=new i;return r._bitField=16777216,r._settledValueField=t,this._promiseResolved(e,r)},e.settle=function(t){return n.deprecated(".settle()",".reflect()"),new o(t).promise()},e.prototype.settle=function(){return e.settle(this)}}},{"./util":36}],31:[function(t,e,r){"use strict";e.exports=function(e,r,n){var i=t("./util"),o=t("./errors").RangeError,a=t("./errors").AggregateError,s=i.isArray,u={};function l(t){this.constructor$(t),this._howMany=0,this._unwrap=!1,this._initialized=!1}function c(t,e){if((0|e)!==e||e<0)return n("expecting a positive integer\n\n See http://goo.gl/MqrFmX\n");var r=new l(t),i=r.promise();return r.setHowMany(e),r.init(),i}i.inherits(l,r),l.prototype._init=function(){if(this._initialized)if(0!==this._howMany){this._init$(void 0,-5);var t=s(this._values);!this._isResolved()&&t&&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(t){this._howMany=t},l.prototype._promiseFulfilled=function(t){return this._addFulfilled(t),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(t){return this._addRejected(t),this._checkOutcome()},l.prototype._promiseCancelled=function(){return this._values instanceof e||null==this._values?this._cancel():(this._addRejected(u),this._checkOutcome())},l.prototype._checkOutcome=function(){if(this.howMany()>this._canPossiblyFulfill()){for(var t=new a,e=this.length();e0?this._reject(t):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(t){this._values.push(t)},l.prototype._addFulfilled=function(t){this._values[this._totalResolved++]=t},l.prototype._canPossiblyFulfill=function(){return this.length()-this._rejected()},l.prototype._getRangeError=function(t){var e="Input array must contain at least "+this._howMany+" items but contains only "+t+" items";return new o(e)},l.prototype._resolveEmptyArray=function(){this._reject(this._getRangeError(0))},e.some=function(t,e){return c(t,e)},e.prototype.some=function(t){return c(this,t)},e._SomePromiseArray=l}},{"./errors":12,"./util":36}],32:[function(t,e,r){"use strict";e.exports=function(t){function e(t){void 0!==t?(t=t._target(),this._bitField=t._bitField,this._settledValueField=t._isFateSealed()?t._settledValue():void 0):(this._bitField=0,this._settledValueField=void 0)}e.prototype._settledValue=function(){return this._settledValueField};var r=e.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=e.prototype.error=e.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=e.prototype.isFulfilled=function(){return 0!=(33554432&this._bitField)},o=e.prototype.isRejected=function(){return 0!=(16777216&this._bitField)},a=e.prototype.isPending=function(){return 0==(50397184&this._bitField)},s=e.prototype.isResolved=function(){return 0!=(50331648&this._bitField)};e.prototype.isCancelled=function(){return 0!=(8454144&this._bitField)},t.prototype.__isCancelled=function(){return 65536==(65536&this._bitField)},t.prototype._isCancelled=function(){return this._target().__isCancelled()},t.prototype.isCancelled=function(){return 0!=(8454144&this._target()._bitField)},t.prototype.isPending=function(){return a.call(this._target())},t.prototype.isRejected=function(){return o.call(this._target())},t.prototype.isFulfilled=function(){return i.call(this._target())},t.prototype.isResolved=function(){return s.call(this._target())},t.prototype.value=function(){return r.call(this._target())},t.prototype.reason=function(){var t=this._target();return t._unsetRejectionIsUnhandled(),n.call(t)},t.prototype._value=function(){return this._settledValue()},t.prototype._reason=function(){return this._unsetRejectionIsUnhandled(),this._settledValue()},t.PromiseInspection=e}},{}],33:[function(t,e,r){"use strict";e.exports=function(e,r){var n=t("./util"),i=n.errorObj,o=n.isObject;var a={}.hasOwnProperty;return function(t,s){if(o(t)){if(t instanceof e)return t;var u=function(t){try{return function(t){return t.then}(t)}catch(t){return i.e=t,i}}(t);if(u===i){s&&s._pushContext();var l=e.reject(u.e);return s&&s._popContext(),l}if("function"==typeof u)return function(t){try{return a.call(t,"_promise0")}catch(t){return!1}}(t)?(l=new e(r),t._then(l._fulfill,l._reject,void 0,l,null),l):function(t,o,a){var s=new e(r),u=s;a&&a._pushContext(),s._captureStackTrace(),a&&a._popContext();var l=!0,c=n.tryCatch(o).call(t,function(t){s&&(s._resolveCallback(t),s=null)},function(t){s&&(s._rejectCallback(t,l,!0),s=null)});return l=!1,s&&c===i&&(s._rejectCallback(c.e,!0,!0),s=null),u}(t,u,s)}return t}}},{"./util":36}],34:[function(t,e,r){"use strict";e.exports=function(e,r,n){var i=t("./util"),o=e.TimeoutError;function a(t){this.handle=t}a.prototype._resultCancelled=function(){clearTimeout(this.handle)};var s=function(t){return u(+this).thenReturn(t)},u=e.delay=function(t,i){var o,u;return void 0!==i?(o=e.resolve(i)._then(s,null,null,t,void 0),n.cancellation()&&i instanceof e&&o._setOnCancel(i)):(o=new e(r),u=setTimeout(function(){o._fulfill()},+t),n.cancellation()&&o._setOnCancel(new a(u)),o._captureStackTrace()),o._setAsyncGuaranteed(),o};e.prototype.delay=function(t){return u(t,this)};function l(t){return clearTimeout(this.handle),t}function c(t){throw clearTimeout(this.handle),t}e.prototype.timeout=function(t,e){var r,s;t=+t;var u=new a(setTimeout(function(){r.isPending()&&function(t,e,r){var n;n="string"!=typeof e?e instanceof Error?e:new o("operation timed out"):new o(e),i.markAsOriginatingFromRejection(n),t._attachExtraTrace(n),t._reject(n),null!=r&&r.cancel()}(r,e,s)},t));return n.cancellation()?(s=this.then(),(r=s._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(t,e,r){"use strict";e.exports=function(e,r,n,i,o,a){var s=t("./util"),u=t("./errors").TypeError,l=t("./util").inherits,c=s.errorObj,h=s.tryCatch,p={};function f(t){setTimeout(function(){throw t},0)}function d(t,r){var i=0,a=t.length,s=new e(o);return function o(){if(i>=a)return s._fulfill();var u=function(t){var e=n(t);return e!==t&&"function"==typeof t._isDisposable&&"function"==typeof t._getDisposer&&t._isDisposable()&&e._setDisposable(t._getDisposer()),e}(t[i++]);if(u instanceof e&&u._isDisposable()){try{u=n(u._getDisposer().tryDispose(r),t.promise)}catch(t){return f(t)}if(u instanceof e)return u._then(o,f,null,null,null)}o()}(),s}function m(t,e,r){this._data=t,this._promise=e,this._context=r}function g(t,e,r){this.constructor$(t,e,r)}function v(t){return m.isDisposer(t)?(this.resources[this.index]._setDisposable(t),t.promise()):t}function _(t){this.length=t,this.promise=null,this[t-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(t){var e=this.resource(),r=this._context;void 0!==r&&r._pushContext();var n=e!==p?this.doDispose(e,t):null;return void 0!==r&&r._popContext(),this._promise._unsetDisposable(),this._data=null,n},m.isDisposer=function(t){return null!=t&&"function"==typeof t.resource&&"function"==typeof t.tryDispose},l(g,m),g.prototype.doDispose=function(t,e){return this.data().call(t,t,e)},_.prototype._resultCancelled=function(){for(var t=this.length,r=0;r0},e.prototype._getDisposer=function(){return this._disposer},e.prototype._unsetDisposable=function(){this._bitField=-131073&this._bitField,this._disposer=void 0},e.prototype.disposer=function(t){if("function"==typeof t)return new g(t,this,i());throw new u}}},{"./errors":12,"./util":36}],36:[function(e,r,i){"use strict";var o=e("./es5"),a="undefined"==typeof navigator,s={e:{}},u,l="undefined"!=typeof self?self:"undefined"!=typeof window?window:void 0!==n?n:void 0!==this?this:null;function c(){try{var t=u;return u=null,t.apply(this,arguments)}catch(t){return s.e=t,s}}function h(t){return u=t,c}var p=function(t,e){var r={}.hasOwnProperty;function n(){for(var n in this.constructor=t,this.constructor$=e,e.prototype)r.call(e.prototype,n)&&"$"!==n.charAt(n.length-1)&&(this[n+"$"]=e.prototype[n])}return n.prototype=e.prototype,t.prototype=new n,t.prototype};function f(t){return null==t||!0===t||!1===t||"string"==typeof t||"number"==typeof t}function d(t){return"function"==typeof t||"object"==typeof t&&null!==t}function m(t){return f(t)?new Error(A(t)):t}function g(t,e){var r,n=t.length,i=new Array(n+1);for(r=0;r1,n=e.length>0&&!(1===e.length&&"constructor"===e[0]),i=x.test(t+"")&&o.names(t).length>0;if(r||n||i)return!0}return!1}catch(t){return!1}}function E(t){function e(){}e.prototype=t;var r=new e;function n(){return typeof r.foo}return n(),n(),t}var k=/^[a-z$_][a-z$_0-9]*$/i;function T(t){return k.test(t)}function S(t,e,r){for(var n=new Array(t),i=0;i10||$[0]>0),G.isNode&&G.toFastProperties(t);try{throw new Error}catch(t){G.lastLineError=t}r.exports=G},{"./es5":13}]},{},[4])(4)}),"undefined"!=typeof window&&null!==window?window.P=window.Promise:"undefined"!=typeof self&&null!==self&&(self.P=self.Promise)}).call(this,t("_process"),"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{},t("timers").setImmediate)},{_process:139,timers:193}],4:[function(t,e,r){},{}],5:[function(t,e,r){(function(r){var n=t("tty"),i=t("./lib/encode"),o=t("stream").Stream,a=e.exports=function(){var t=null;function e(e){if(t)throw new Error("multiple inputs specified");t=e}var i=null;function o(t){if(i)throw new Error("multiple outputs specified");i=t}for(var a=0;a0&&this.down(e),t>0?this.right(t):t<0&&this.left(-t),this},s.prototype.up=function(t){return void 0===t&&(t=1),this.write(i("["+Math.floor(t)+"A")),this},s.prototype.down=function(t){return void 0===t&&(t=1),this.write(i("["+Math.floor(t)+"B")),this},s.prototype.right=function(t){return void 0===t&&(t=1),this.write(i("["+Math.floor(t)+"C")),this},s.prototype.left=function(t){return void 0===t&&(t=1),this.write(i("["+Math.floor(t)+"D")),this},s.prototype.column=function(t){return this.write(i("["+Math.floor(t)+"G")),this},s.prototype.push=function(t){return this.write(i(t?"7":"[s")),this},s.prototype.pop=function(t){return this.write(i(t?"8":"[u")),this},s.prototype.erase=function(t){return"end"===t||"$"===t?this.write(i("[K")):"start"===t||"^"===t?this.write(i("[1K")):"line"===t?this.write(i("[2K")):"down"===t?this.write(i("[J")):"up"===t?this.write(i("[1J")):"screen"===t?this.write(i("[1J")):this.emit("error",new Error("Unknown erase type: "+t)),this},s.prototype.display=function(t){var e={reset:0,bright:1,dim:2,underscore:4,blink:5,reverse:7,hidden:8}[t];return void 0===e&&this.emit("error",new Error("Unknown attribute: "+t)),this.write(i("["+e+"m")),this},s.prototype.foreground=function(t){if("number"==typeof t)(t<0||t>=256)&&this.emit("error",new Error("Color out of range: "+t)),this.write(i("[38;5;"+t+"m"));else{var e={black:30,red:31,green:32,yellow:33,blue:34,magenta:35,cyan:36,white:37}[t.toLowerCase()];e||this.emit("error",new Error("Unknown color: "+t)),this.write(i("["+e+"m"))}return this},s.prototype.background=function(t){if("number"==typeof t)(t<0||t>=256)&&this.emit("error",new Error("Color out of range: "+t)),this.write(i("[48;5;"+t+"m"));else{var e={black:40,red:41,green:42,yellow:43,blue:44,magenta:45,cyan:46,white:47}[t.toLowerCase()];e||this.emit("error",new Error("Unknown color: "+t)),this.write(i("["+e+"m"))}return this},s.prototype.cursor=function(t){return this.write(i(t?"[?25h":"[?25l")),this};var u=a.extractCodes=function(t){for(var e=[],r=-1,n=0;n=0&&e.push(t.slice(r,n)),r=n):r>=0&&n===t.length-1&&e.push(t.slice(r));return e}}).call(this,t("_process"))},{"./lib/encode":6,_process:139,stream:190,tty:194}],6:[function(t,e,r){(function(t){var r=(e.exports=function(e){return new t([27].concat(function t(e){return"string"==typeof e?e.split("").map(r):Array.isArray(e)?e.reduce(function(e,r){return e.concat(t(r))},[]):void 0}(e)))}).ord=function(t){return t.charCodeAt(0)}}).call(this,t("buffer").Buffer)},{buffer:73}],7:[function(t,e,r){(function(r){"use strict";var n=t("readable-stream").Readable,i=t("util");function o(t,e){if(!(this instanceof o))return new o(t,e);n.call(this,e),null!==t&&void 0!==t||(t=String(t)),this._obj=t}e.exports=o,i.inherits(o,n),o.prototype._read=function(t){var e=this._obj;"string"==typeof e?this.push(new r(e)):r.isBuffer(e)?this.push(e):this.push(new r(JSON.stringify(e))),this.push(null)}}).call(this,t("buffer").Buffer)},{buffer:73,"readable-stream":13,util:200}],8:[function(t,e,r){(function(r){e.exports=s;var n=Object.keys||function(t){var e=[];for(var r in t)e.push(r);return e},i=t("core-util-is");i.inherits=t("inherits");var o=t("./_stream_readable"),a=t("./_stream_writable");function s(t){if(!(this instanceof s))return new s(t);o.call(this,t),a.call(this,t),t&&!1===t.readable&&(this.readable=!1),t&&!1===t.writable&&(this.writable=!1),this.allowHalfOpen=!0,t&&!1===t.allowHalfOpen&&(this.allowHalfOpen=!1),this.once("end",u)}function u(){this.allowHalfOpen||this._writableState.ended||r.nextTick(this.end.bind(this))}i.inherits(s,o),function(t,e){for(var r=0,n=t.length;r0?d(t):b(t)}(t,e);else if(e.objectMode||n&&n.length>0)if(e.ended&&!a){var u=new Error("stream.push() after EOF");t.emit("error",u)}else if(e.endEmitted&&a){u=new Error("stream.unshift() after end event");t.emit("error",u)}else!e.decoder||a||o||(n=e.decoder.write(n)),e.length+=e.objectMode?1:n.length,a?e.buffer.unshift(n):(e.reading=!1,e.buffer.push(n)),e.needReadable&&d(t),function(t,e){e.readingMore||(e.readingMore=!0,r.nextTick(function(){!function(t,e){var r=e.length;for(;!e.reading&&!e.flowing&&!e.ended&&e.lengthe.highWaterMark&&(e.highWaterMark=function(t){if(t>=p)t=p;else{t--;for(var e=1;e<32;e<<=1)t|=t>>e;t++}return t}(t)),t>e.length?e.ended?e.length:(e.needReadable=!0,0):t)}function d(t){var e=t._readableState;e.needReadable=!1,e.emittedReadable||(e.emittedReadable=!0,e.sync?r.nextTick(function(){m(t)}):m(t))}function m(t){t.emit("readable")}function g(t){var e,r=t._readableState;function n(t,n,i){!1===t.write(e)&&r.awaitDrain++}for(r.awaitDrain=0;r.pipesCount&&null!==(e=t.read());)if(1===r.pipesCount?n(r.pipes):x(r.pipes,n),t.emit("data",e),r.awaitDrain>0)return;if(0===r.pipesCount)return r.flowing=!1,void(o.listenerCount(t,"data")>0&&_(t));r.ranOut=!0}function v(){this._readableState.ranOut&&(this._readableState.ranOut=!1,g(this))}function _(t,e){if(t._readableState.flowing)throw new Error("Cannot switch to old mode now.");var n=e||!1,i=!1;t.readable=!0,t.pipe=s.prototype.pipe,t.on=t.addListener=s.prototype.on,t.on("readable",function(){var e;for(i=!0;!n&&null!==(e=t.read());)t.emit("data",e);null===e&&(i=!1,t._readableState.needReadable=!0)}),t.pause=function(){n=!0,this.emit("pause")},t.resume=function(){n=!1,i?r.nextTick(function(){t.emit("readable")}):this.read(0),this.emit("resume")},t.emit("readable")}function y(t,e){var r,n=e.buffer,o=e.length,a=!!e.decoder,s=!!e.objectMode;if(0===n.length)return null;if(0===o)r=null;else if(s)r=n.shift();else if(!t||t>=o)r=a?n.join(""):i.concat(n,o),n.length=0;else{if(t0)throw new Error("endReadable called on non-empty stream");!e.endEmitted&&e.calledRead&&(e.ended=!0,r.nextTick(function(){e.endEmitted||0!==e.length||(e.endEmitted=!0,t.readable=!1,t.emit("end"))}))}function x(t,e){for(var r=0,n=t.length;r0)&&(e.emittedReadable=!1),0===t&&e.needReadable&&(e.length>=e.highWaterMark||e.ended))return d(this),null;if(0===(t=f(t,e))&&e.ended)return r=null,e.length>0&&e.decoder&&(r=y(t,e),e.length-=r.length),0===e.length&&b(this),r;var i=e.needReadable;return e.length-t<=e.highWaterMark&&(i=!0),(e.ended||e.reading)&&(i=!1),i&&(e.reading=!0,e.sync=!0,0===e.length&&(e.needReadable=!0),this._read(e.highWaterMark),e.sync=!1),i&&!e.reading&&(t=f(n,e)),null===(r=t>0?y(t,e):null)&&(e.needReadable=!0,t=0),e.length-=t,0!==e.length||e.ended||(e.needReadable=!0),e.ended&&!e.endEmitted&&0===e.length&&b(this),r},c.prototype._read=function(t){this.emit("error",new Error("not implemented"))},c.prototype.pipe=function(t,e){var i=this,a=this._readableState;switch(a.pipesCount){case 0:a.pipes=t;break;case 1:a.pipes=[a.pipes,t];break;default:a.pipes.push(t)}a.pipesCount+=1;var s=(!e||!1!==e.end)&&t!==r.stdout&&t!==r.stderr?l:h;function u(t){t===i&&h()}function l(){t.end()}a.endEmitted?r.nextTick(s):i.once("end",s),t.on("unpipe",u);var c=function(t){return function(){var e=t._readableState;e.awaitDrain--,0===e.awaitDrain&&g(t)}}(i);function h(){t.removeListener("close",f),t.removeListener("finish",d),t.removeListener("drain",c),t.removeListener("error",p),t.removeListener("unpipe",u),i.removeListener("end",l),i.removeListener("end",h),t._writableState&&!t._writableState.needDrain||c()}function p(e){m(),t.removeListener("error",p),0===o.listenerCount(t,"error")&&t.emit("error",e)}function f(){t.removeListener("finish",d),m()}function d(){t.removeListener("close",f),m()}function m(){i.unpipe(t)}return t.on("drain",c),t._events&&t._events.error?n(t._events.error)?t._events.error.unshift(p):t._events.error=[p,t._events.error]:t.on("error",p),t.once("close",f),t.once("finish",d),t.emit("pipe",i),a.flowing||(this.on("readable",v),a.flowing=!0,r.nextTick(function(){g(i)})),t},c.prototype.unpipe=function(t){var e=this._readableState;if(0===e.pipesCount)return this;if(1===e.pipesCount)return t&&t!==e.pipes?this:(t||(t=e.pipes),e.pipes=null,e.pipesCount=0,this.removeListener("readable",v),e.flowing=!1,t&&t.emit("unpipe",this),this);if(!t){var r=e.pipes,n=e.pipesCount;e.pipes=null,e.pipesCount=0,this.removeListener("readable",v),e.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"===o)e.scalarArgs.push(i),e.shimArgs.push("scalar"+i);else if("index"===o){if(e.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"===o){if(e.shapeArgs.push(i),ir.length)throw new Error("cwise: Too many arguments in pre() block");if(e.body.args.length>r.length)throw new Error("cwise: Too many arguments in body() block");if(e.post.args.length>r.length)throw new Error("cwise: Too many arguments in post() block");return e.debug=!!t.printCode||!!t.debug,e.funcName=t.funcName||"cwise",e.blockSize=t.blockSize||64,n(e)}},{"./lib/thunk.js":17}],16:[function(t,e,r){"use strict";var n=t("uniq");function i(t,e,r){var n,i,o=t.length,a=e.arrayArgs.length,s=e.indexArgs.length>0,u=[],l=[],c=0,h=0;for(n=0;n0&&u.push("var "+l.join(",")),n=o-1;n>=0;--n)c=t[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 o(t,e,r){for(var n=t.body,i=[],o=[],a=0;a0&&_.push("shape=SS.slice(0)"),t.indexArgs.length>0){var y=new Array(r);for(u=0;u0&&v.push("var "+_.join(",")),u=0;u3&&v.push(o(t.pre,t,s));var E=o(t.body,t,s),k=function(t){for(var e=0,r=t[0].length;e0,l=[],c=0;c0;){"].join("")),l.push(["if(j",c,"<",s,"){"].join("")),l.push(["s",e[c],"=j",c].join("")),l.push(["j",c,"=0"].join("")),l.push(["}else{s",e[c],"=",s].join("")),l.push(["j",c,"-=",s,"}"].join("")),u&&l.push(["index[",e[c],"]=j",c].join(""));for(c=0;c3&&v.push(o(t.post,t,s)),t.debug&&console.log("-----Generated cwise routine for ",e,":\n"+v.join("\n")+"\n----------");var T=[t.funcName||"unnamed","_cwise_loop_",a[0].join("s"),"m",k,function(t){for(var e=new Array(t.length),r=!0,n=0;n0&&(r=r&&e[n]===e[n-1])}return r?e[0]:e.join("")}(s)].join("");return new Function(["function ",T,"(",g.join(","),"){",v.join("\n"),"} return ",T].join(""))()}},{uniq:196}],17:[function(t,e,r){"use strict";var n=t("./compile.js");e.exports=function(t){var e=["'use strict'","var CACHED={}"],r=[],i=t.funcName+"_cwise_thunk";e.push(["return function ",i,"(",t.shimArgs.join(","),"){"].join(""));for(var o=[],a=[],s=[["array",t.arrayArgs[0],".shape.slice(",Math.max(0,t.arrayBlockIndices[0]),t.arrayBlockIndices[0]<0?","+t.arrayBlockIndices[0]+")":")"].join("")],u=[],l=[],c=0;c0&&(u.push("array"+t.arrayArgs[0]+".shape.length===array"+h+".shape.length+"+(Math.abs(t.arrayBlockIndices[0])-Math.abs(t.arrayBlockIndices[c]))),l.push("array"+t.arrayArgs[0]+".shape[shapeIndex+"+Math.max(0,t.arrayBlockIndices[0])+"]===array"+h+".shape[shapeIndex+"+Math.max(0,t.arrayBlockIndices[c])+"]"))}for(t.arrayArgs.length>1&&(e.push("if (!("+u.join(" && ")+")) throw new Error('cwise: Arrays do not all have the same dimensionality!')"),e.push("for(var shapeIndex=array"+t.arrayArgs[0]+".shape.length-"+Math.abs(t.arrayBlockIndices[0])+"; shapeIndex--\x3e0;) {"),e.push("if (!("+l.join(" && ")+")) throw new Error('cwise: Arrays do not all have the same shape!')"),e.push("}")),c=0;ch)&&(o[u]=h,f.push(u,h),i[u]=s));if(void 0!==r&&void 0===o[r]){var d=["Could not find a path from ",e," to ",r,"."].join("");throw new Error(d)}return i},extract_shortest_path_from_predecessor_list:function(t,e){for(var r=[],n=e;n;)r.push(n),t[n],n=t[n];return r.reverse(),r},find_path:function(t,e,r){var i=n.single_source_shortest_paths(t,e,r);return n.extract_shortest_path_from_predecessor_list(i,r)},PriorityQueue:{make:function(t){var e,r=n.PriorityQueue,i={};for(e in t=t||{},r)r.hasOwnProperty(e)&&(i[e]=r[e]);return i.queue=[],i.sorter=t.sorter||r.default_sorter,i},default_sorter:function(t,e){return t.cost-e.cost},push:function(t,e){var r={value:t,cost:e};this.queue.push(r),this.queue.sort(this.sorter)},pop:function(){return this.queue.shift()},empty:function(){return 0===this.queue.length}}};void 0!==e&&(e.exports=n)},{}],20:[function(t,e,r){var n=function(e){(e=e||{}).width=e.width||800,e.height=e.height||600;var r=e.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=e.lens||{a:1,b:1,Fx:0,Fy:0,scale:1.5},i=e.fov||{x:1,y:1},o=e.image||"images/barrel-distortion.png",a=function(t){var e=document.querySelector(t);if(null==e)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"},{}],23:[function(t,e,r){e.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"},{}],24:[function(t,e,r){e.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"},{}],25:[function(t,e,r){e.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"},{}],26:[function(t,e,r){e.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"},{}],27:[function(t,e,r){e.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"},{}],28:[function(t,e,r){(function(r,n){"use strict";var i=t("path"),o=t("ndarray"),a=t("omggif").GifReader,s=(t("ndarray-pack"),t("through"),t("data-uri-to-buffer"));function u(t,e){var r;try{r=new a(t)}catch(t){return void e(t)}if(r.numFrames()>0){var n=[r.numFrames(),r.height,r.width,4],i=new Uint8Array(n[0]*n[1]*n[2]*n[3]),s=o(i,n);try{for(var u=0;u=0&&(this.dispose=t)},u.prototype.setRepeat=function(t){this.repeat=t},u.prototype.setTransparent=function(t){this.transparent=t},u.prototype.analyzeImage=function(t){this.setImagePixels(this.removeAlphaChannel(t)),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(t){this.emit("frame#start"),this.analyzeImage(t),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(t){t<1&&(t=1),this.sample=t},u.prototype.writeHeader=function(){this.emit("writeHeader#start"),this.writeUTFBytes("GIF89a"),this.emit("writeHeader#stop")},u.prototype.analyzePixels=function(){var t=this.pixels.length/3;this.indexedPixels=new Uint8Array(t);var e=new o(this.pixels,this.sample);e.buildColormap(),this.colorTab=e.getColormap();for(var r=0,n=0;n>16,r=(65280&t)>>8,n=255&t,i=0,o=16777216,a=this.colorTab.length,s=0;s=0&&(e=7&dispose),e<<=2,this.writeByte(0|e|t),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 t=768-this.colorTab.length,e=0;e>8&255)},u.prototype.writePixels=function(){new a(this.width,this.height,this.indexedPixels,this.colorDepth).encode(this)},u.prototype.stream=function(){return this},u.ByteCapacitor=s,e.exports=u}).call(this,t("buffer").Buffer)},{"./LZWEncoder.js":31,"./TypedNeuQuant.js":32,assert:66,buffer:73,events:74,"readable-stream":38,util:200}],31:[function(t,e,r){var n=-1,i=12,o=5003,a=[0,1,3,7,15,31,63,127,255,511,1023,2047,4095,8191,16383,32767,65535];e.exports=function(t,e,r,s){var u,l,c,h,p,f,d,m,g,v=Math.max(2,s),_=new Uint8Array(256),y=new Int32Array(o),b=new Int32Array(o),x=0,w=0,E=!1;function k(t,e){_[l++]=t,l>=254&&A(e)}function T(t){S(o),w=m+2,E=!0,B(m,t)}function S(t){for(var e=0;e0&&(t.writeByte(l),t.writeBytes(_,0,l),l=0)}function C(t){return(1<0?u|=t<=8;)k(255&u,e),u>>=8,x-=8;if((w>c||E)&&(E?(c=C(f=d),E=!1):c=++f==i?1<0;)k(255&u,e),u>>=8,x-=8;A(e)}}this.encode=function(r){r.writeByte(v),h=t*e,p=0,function(t,e){var r,a,s,u,h,p,v;for(E=!1,c=C(f=d=t),g=1+(m=1<=0){h=p-s,0===s&&(h=1);do{if((s-=h)<0&&(s+=p),y[s]===r){u=b[s];continue t}}while(y[s]>=0)}B(u,e),u=a,w<1<>c,p=u<>3)*(1<l;)u=A[f++],hl&&((s=r[p--])[0]-=u*(s[0]-n)/_,s[1]-=u*(s[1]-o)/_,s[2]-=u*(s[2]-a)/_)}function B(t,e,n){var o,u,f,d,m,g=~(1<<31),v=g,_=-1,y=_;for(o=0;o>s-a))>c,S[o]-=m,T[o]+=m<>3),t=0;t>f;for(S<=1&&(S=0),r=0;r=c&&(P-=c),r++,0===_&&(_=1),r%_==0)for(k-=k/h,(S=(T-=T/m)>>f)<=1&&(S=0),l=0;l>=a,r[t][1]>>=a,r[t][2]>>=a,r[t][3]=t}(),function(){var t,e,n,a,s,u,l=0,c=0;for(t=0;t>1,e=l+1;e>1,e=l+1;e<256;e++)k[e]=o}()},this.getColormap=function(){for(var t=[],e=[],n=0;n=0;)c=u?c=i:(c++,s<0&&(s=-s),(o=a[0]-t)<0&&(o=-o),(s+=o)=0&&((s=e-(a=r[h])[1])>=u?h=-1:(h--,s<0&&(s=-s),(o=a[0]-t)<0&&(o=-o),(s+=o)0)if(e.ended&&!o){var s=new Error("stream.push() after EOF");t.emit("error",s)}else if(e.endEmitted&&o){s=new Error("stream.unshift() after end event");t.emit("error",s)}else!e.decoder||o||i||(n=e.decoder.write(n)),o||(e.reading=!1),e.flowing&&0===e.length&&!e.sync?(t.emit("data",n),t.read(0)):(e.length+=e.objectMode?1:n.length,o?e.buffer.unshift(n):e.buffer.push(n),e.needReadable&&m(t)),function(t,e){e.readingMore||(e.readingMore=!0,r.nextTick(function(){!function(t,e){var r=e.length;for(;!e.reading&&!e.flowing&&!e.ended&&e.lengthe.highWaterMark&&(e.highWaterMark=function(t){if(t>=f)t=f;else{t--;for(var e=1;e<32;e<<=1)t|=t>>e;t++}return t}(t)),t>e.length?e.ended?e.length:(e.needReadable=!0,0):t)}function m(t){var e=t._readableState;e.needReadable=!1,e.emittedReadable||(l("emitReadable",e.flowing),e.emittedReadable=!0,e.sync?r.nextTick(function(){g(t)}):g(t))}function g(t){l("emit readable"),t.emit("readable"),v(t)}function v(t){var e=t._readableState;if(l("flow",e.flowing),e.flowing)do{var r=t.read()}while(null!==r&&e.flowing)}function _(t,e){var r,n=e.buffer,o=e.length,a=!!e.decoder,s=!!e.objectMode;if(0===n.length)return null;if(0===o)r=null;else if(s)r=n.shift();else if(!t||t>=o)r=a?n.join(""):i.concat(n,o),n.length=0;else{if(t0)throw new Error("endReadable called on non-empty stream");e.endEmitted||(e.ended=!0,r.nextTick(function(){e.endEmitted||0!==e.length||(e.endEmitted=!0,t.readable=!1,t.emit("end"))}))}h.prototype.read=function(t){l("read",t);var e=this._readableState,r=t;if((!u.isNumber(t)||t>0)&&(e.emittedReadable=!1),0===t&&e.needReadable&&(e.length>=e.highWaterMark||e.ended))return l("read: emitReadable",e.length,e.ended),0===e.length&&e.ended?y(this):m(this),null;if(0===(t=d(t,e))&&e.ended)return 0===e.length&&y(this),null;var n,i=e.needReadable;return l("need readable",i),(0===e.length||e.length-t0?_(t,e):null,u.isNull(n)&&(e.needReadable=!0,t=0),e.length-=t,0!==e.length||e.ended||(e.needReadable=!0),r!==t&&e.ended&&0===e.length&&y(this),u.isNull(n)||this.emit("data",n),n},h.prototype._read=function(t){this.emit("error",new Error("not implemented"))},h.prototype.pipe=function(t,e){var i=this,a=this._readableState;switch(a.pipesCount){case 0:a.pipes=t;break;case 1:a.pipes=[a.pipes,t];break;default:a.pipes.push(t)}a.pipesCount+=1,l("pipe count=%d opts=%j",a.pipesCount,e);var s=(!e||!1!==e.end)&&t!==r.stdout&&t!==r.stderr?c:p;function u(t){l("onunpipe"),t===i&&p()}function c(){l("onend"),t.end()}a.endEmitted?r.nextTick(s):i.once("end",s),t.on("unpipe",u);var h=function(t){return function(){var e=t._readableState;l("pipeOnDrain",e.awaitDrain),e.awaitDrain&&e.awaitDrain--,0===e.awaitDrain&&o.listenerCount(t,"data")&&(e.flowing=!0,v(t))}}(i);function p(){l("cleanup"),t.removeListener("close",m),t.removeListener("finish",g),t.removeListener("drain",h),t.removeListener("error",d),t.removeListener("unpipe",u),i.removeListener("end",c),i.removeListener("end",p),i.removeListener("data",f),!a.awaitDrain||t._writableState&&!t._writableState.needDrain||h()}function f(e){l("ondata"),!1===t.write(e)&&(l("false write response, pause",i._readableState.awaitDrain),i._readableState.awaitDrain++,i.pause())}function d(e){l("onerror",e),_(),t.removeListener("error",d),0===o.listenerCount(t,"error")&&t.emit("error",e)}function m(){t.removeListener("finish",g),_()}function g(){l("onfinish"),t.removeListener("close",m),_()}function _(){l("unpipe"),i.unpipe(t)}return t.on("drain",h),i.on("data",f),t._events&&t._events.error?n(t._events.error)?t._events.error.unshift(d):t._events.error=[d,t._events.error]:t.on("error",d),t.once("close",m),t.once("finish",g),t.emit("pipe",i),a.flowing||(l("pipe resume"),i.resume()),t},h.prototype.unpipe=function(t){var e=this._readableState;if(0===e.pipesCount)return this;if(1===e.pipesCount)return t&&t!==e.pipes?this:(t||(t=e.pipes),e.pipes=null,e.pipesCount=0,e.flowing=!1,t&&t.emit("unpipe",this),this);if(!t){var r=e.pipes,n=e.pipesCount;e.pipes=null,e.pipesCount=0,e.flowing=!1;for(var i=0;i1){for(var r=[],n=0;n0&&e>0))return null;var n,i=document.createElement("canvas");if(!i)return null;i.width=t,i.height=e;try{n=i.getContext("webgl",r)}catch(t){try{n=i.getContext("experimental-webgl",r)}catch(t){return null}}var o=n.getExtension,a={destroy:function(){var t=o.call(n,"WEBGL_lose_context");t&&t.loseContext()}},s={resize:function(t,e){i.width=t,i.height=e}},u=n.getSupportedExtensions().slice();return u.push("STACKGL_destroy_context","STACKGL_resize_drawingbuffer"),n.getSupportedExtensions=function(){return u.slice()},n.getExtension=function(t){var e=t.toLowerCase();return"stackgl_resize_drawingbuffer"===e?s:"stackgl_destroy_context"===e?a:o.call(n,t)},n||null}},{}],40:[function(t,e,r){"use strict";e.exports=function(t,e){let r=null;r=e.output.length?3===e.output.length?{x:e.output[0],y:e.output[1],z:e.output[2]}:2===e.output.length?{x:e.output[0],y:e.output[1]}:{x:e.output[0]}:e.output;const n={_fn:t,constants:e.constants,output:r,thread:{x:0,y:0,z:0}};return r.z?function(){const t=[];for(let e=0;e0&&e.push(", "),e.push("user_"),e.push(r)}e.push(") {\n")}for(let r=0;r0&&e.push(r.join(""),";\n"),e.push(`for (let ${t}=0;${t}0&&e.push(`if (!${n.join("")}) break;\n`),e.push(o.join("")),e.push(`\n${i.join("")};`),e.push("}\n")}return e}astWhileStatement(t,e){if("WhileStatement"!==t.type)throw this.astErrorOutput("Invalid while statement",t);return e.push("for (let i = 0; i < LOOP_MAX; i++) {"),e.push("if ("),this.astGeneric(t.test,e),e.push(") {\n"),this.astGeneric(t.body,e),e.push("} else {\n"),e.push("break;\n"),e.push("}\n"),e.push("}\n"),e}astDoWhileStatement(t,e){if("DoWhileStatement"!==t.type)throw this.astErrorOutput("Invalid while statement",t);return e.push("for (let i = 0; i < LOOP_MAX; i++) {"),this.astGeneric(t.body,e),e.push("if (!"),this.astGeneric(t.test,e),e.push(") {\n"),e.push("break;\n"),e.push("}\n"),e.push("}\n"),e}astAssignmentExpression(t,e){return this.astGeneric(t.left,e),e.push(t.operator),this.astGeneric(t.right,e),e}astBlockStatement(t,e){if(this.isState("loop-body")){this.pushState("block-body");for(let r=0;r0&&e.push(","),this.astGeneric(t.declarations[r],e);return this.isState("in-for-loop-init")||e.push(";"),e}astIfStatement(t,e){return e.push("if ("),this.astGeneric(t.test,e),e.push(")"),"BlockStatement"===t.consequent.type?this.astGeneric(t.consequent,e):(e.push(" {\n"),this.astGeneric(t.consequent,e),e.push("\n}\n")),t.alternate&&(e.push("else "),"BlockStatement"===t.alternate.type?this.astGeneric(t.alternate,e):(e.push(" {\n"),this.astGeneric(t.alternate,e),e.push("\n}\n"))),e}astThisExpression(t,e){return e.push("_this"),e}astMemberExpression(t,e){const{signature:r,type:n,property:i,xProperty:o,yProperty:a,zProperty:s,name:u,origin:l}=this.getMemberExpressionDetails(t);switch(r){case"this.thread.value":return e.push(`_this.thread.${u}`),e;case"this.output.value":switch(u){case"x":e.push(this.output[0]);break;case"y":e.push(this.output[1]);break;case"z":e.push(this.output[2]);break;default:throw this.astErrorOutput("Unexpected expression",t)}return e;case"value":throw this.astErrorOutput("Unexpected expression",t);case"value[]":case"value[][]":case"value[][][]":case"value.value":if("Math"===l)return e.push(Math[u]),e;switch(i){case"r":return e.push(`user_${u}[0]`),e;case"g":return e.push(`user_${u}[1]`),e;case"b":return e.push(`user_${u}[2]`),e;case"a":return e.push(`user_${u}[3]`),e}break;case"this.constants.value":case"this.constants.value[]":case"this.constants.value[][]":case"this.constants.value[][][]":break;case"fn()[]":return this.astGeneric(t.object,e),e.push("["),this.astGeneric(t.property,e),e.push("]"),e;default:throw this.astErrorOutput("Unexpected expression",t)}if("Number"===n||"Integer"===n)return e.push(`${l}_${u}`),e;const c=this.getKernelArgumentName(u),h=`${l}_${c||u}`;switch(n){case"Array(2)":case"Array(3)":case"Array(4)":case"HTMLImageArray":case"ArrayTexture(1)":case"ArrayTexture(2)":case"ArrayTexture(3)":case"ArrayTexture(4)":case"HTMLImage":default:const t=this.isInput(c||u);if(e.push(`${h}`),s&&a)if(t){const t=this.argumentSizes[this.argumentNames.indexOf(u)];e.push("[("),this.astGeneric(s,e),e.push(`*${t[1]*t[0]})+(`),this.astGeneric(a,e),e.push(`*${t[0]})+`),this.astGeneric(o,e),e.push("]")}else e.push("["),this.astGeneric(s,e),e.push("]"),e.push("["),this.astGeneric(a,e),e.push("]"),e.push("["),this.astGeneric(o,e),e.push("]");else if(a)if(t){const t=this.argumentSizes[this.argumentNames.indexOf(u)];e.push("[("),this.astGeneric(a,e),e.push(`*${t[0]})+`),this.astGeneric(o,e),e.push("]")}else e.push("["),this.astGeneric(a,e),e.push("]"),e.push("["),this.astGeneric(o,e),e.push("]");else e.push("["),this.astGeneric(o,e),e.push("]")}return e}astCallExpression(t,e){if(t.callee){let r=this.astMemberExpressionUnroll(t.callee);this.calledFunctions.indexOf(r)<0&&this.calledFunctions.push(r),this.calledFunctionsArguments[r]||(this.calledFunctionsArguments[r]=[]);const n=[];this.calledFunctionsArguments[r].push(n),e.push(r),e.push("(");for(let r=0;r0&&e.push(", "),this.astGeneric(i,e);const o=this.getType(i);o?n.push({name:i.name||null,type:o}):n.push(null)}return e.push(")"),e}throw this.astErrorOutput("Unknown CallExpression",t)}astArrayExpression(t,e){const r=t.elements.length;e.push("[");for(let n=0;n0&&e.push(", ");const r=t.elements[n];this.astGeneric(r,e)}return e.push("]"),e}astDebuggerStatement(t,e){return e.push("debugger;"),e}}}},{"../function-node":46}],43:[function(t,e,r){const{utils:n}=t("../../utils"),{kernelRunShortcut:i}=t("../../kernel-run-shortcut");function o(t){return/^function /.test(t)&&(t=t.substring(9)),t.replace(/[_]typeof/g,"typeof")}function a(t){return t.replace(/^[A-Za-z]+/,"function").replace(/[_]typeof/g,"typeof")}e.exports={cpuKernelString:function(t,e){return`() => {\n ${i.toString()};\n const utils = {\n allPropertiesOf: ${a(n.allPropertiesOf.toString())},\n clone: ${a(n.clone.toString())},\n };\n let Input = function() {};\n class ${e||"Kernel"} {\n constructor() { \n this.argumentsLength = 0;\n this.canvas = null;\n this.context = null;\n this.built = false;\n this.program = null;\n this.argumentNames = ${JSON.stringify(t.argumentNames)};\n this.argumentTypes = ${JSON.stringify(t.argumentTypes)};\n this.argumentSizes = ${JSON.stringify(t.argumentSizes)};\n this.output = ${JSON.stringify(t.output)};\n this._kernelString = \`${t._kernelString}\`;\n this.output = ${JSON.stringify(t.output)};\n\t\t this.run = function() {\n this.run = null;\n this.build(arguments);\n return this.run.apply(this, arguments);\n }.bind(this);\n this.thread = {\n x: 0,\n y: 0,\n z: 0\n };\n }\n setCanvas(canvas) { this.canvas = canvas; return this; }\n setContext(context) { this.context = context; return this; }\n setInput(Type) { Input = Type; }\n ${o(t.build.toString())}\n setupArguments() {}\n ${o(t.setupConstants.toString())}\n translateSource() {}\n pickRenderStrategy() {}\n run () { ${t.kernelString} }\n getKernelString() { return this._kernelString; }\n ${o(t.validateSettings.toString())}\n ${o(t.checkOutput.toString())}\n };\n return kernelRunShortcut(new Kernel());\n };`}}},{"../../kernel-run-shortcut":62,"../../utils":65}],44:[function(t,e,r){const{Kernel:n}=t("../kernel"),{FunctionBuilder:i}=t("../function-builder"),{CPUFunctionNode:o}=t("./function-node"),{utils:a}=t("../../utils"),{cpuKernelString:s}=t("./kernel-string");e.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(t){return!1}static get mode(){return"cpu"}static nativeFunctionArguments(){return null}static nativeFunctionReturnType(){return null}static combineKernels(t){return t}constructor(t,e){super(t,e),this.mergeSettings(t.settings||e),this._imageData=null,this._colorData=null,this._kernelString=null,this.thread={x:0,y:0,z:0},this.translatedSources=null,this.run=function(){return this.run=null,this.build.apply(this,arguments),this.run.apply(this,arguments)}.bind(this)}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(t){return[]}validateSettings(){if(!this.output||0===this.output.length){if(1!==arguments.length)throw"Auto dimensions only supported for kernels with only one input";const t=a.getVariableType(arguments[0]);if("Array"===t)this.output=a.getDimensions(t);else{if("NumberTexture"!==t&&"ArrayTexture(4)"!==t)throw"Auto dimensions not supported for input type: "+t;this.output=arguments[0].output}}if(this.graphical&&2!==this.output.length)throw new Error("Output must have 2 dimensions on graphical mode");this.checkOutput()}translateSource(){const t=i.fromKernel(this,o);this.translatedSources=t.getPrototypes("kernel"),this.graphical||this.returnType||(this.returnType=t.getKernelResultType())}build(){if(this.setupConstants(),this.setupArguments(arguments),this.validateSettings(),this.translateSource(),this.graphical){const{canvas:t,output:e}=this;if(!t)throw new Error("no canvas available for using graphical output");const r=e[0],n=e[1]||1;t.width=r,t.height=n,this._imageData=this.context.createImageData(r,n),this._colorData=new Uint8ClampedArray(r*n*4)}const t=this.getKernelString();this.kernelString=t,this.debug&&(console.log("Function output:"),console.log(t));try{this.run=new Function([],t).bind(this)()}catch(t){console.error("An error occurred compiling the javascript: ",t)}}color(t,e,r,n){void 0===n&&(n=1),t=Math.floor(255*t),e=Math.floor(255*e),r=Math.floor(255*r),n=Math.floor(255*n);const i=this.output[0],o=this.output[1],a=this.thread.x+(o-this.thread.y-1)*i;this._colorData[4*a+0]=t,this._colorData[4*a+1]=e,this._colorData[4*a+2]=r,this._colorData[4*a+3]=n}getKernelString(){if(null!==this._kernelString)return this._kernelString;let t=null,{translatedSources:e}=this;return e.length>1?e=e.filter(e=>/^function/.test(e)?e:(t=e,!1)):t=e.shift(),this._kernelString=`\n\t\tconst LOOP_MAX = ${this._getLoopMaxString()}\n\t\tconst constants = this.constants;\n\t\tconst _this = this;\n return function (${this.argumentNames.map(t=>"user_"+t).join(", ")}) {\n ${this._processConstants()}\n ${this._processArguments()}\n ${this.graphical?this._graphicalKernelBody(t):this._resultKernelBody(t)}\n ${e.length>0?e.join("\n"):""}\n }.bind(this);`}toString(){return s(this)}_getLoopMaxString(){return this.loopMaxIterations?` ${parseInt(this.loopMaxIterations)};\n`:" 1000;\n"}_processConstants(){if(!this.constants)return"";const t=[];for(let e in this.constants)switch(this.constantTypes[e]){case"HTMLImage":t.push(` const constants_${e} = this._imageTo2DArray(this.constants.${e});`);break;case"HTMLImageArray":t.push(` const constants_${e} = this._imageTo3DArray(this.constants.${e});`);break;case"Input":t.push(` const constants_${e} = this.constants.${e}.value;`);break;default:t.push(` const constants_${e} = this.constants.${e};`)}return t.join("\n")}_processArguments(){const t=[];for(let e=0;e=0;e--){const r=i[e]=new Array(t.width);for(let e=0;e`let subKernelResult_${t.name};`).join("\n")}\n\t\t${this._mapSubKernels(t=>`const result_${t.name} = new ${r}(${e[0]});\n`).join("")}\n for (let x = 0; x < ${e[0]}; x++) {\n this.thread.x = x;\n this.thread.y = 0;\n this.thread.z = 0;\n let kernelResult;\n ${t}\n result[x] = kernelResult;\n ${this._mapSubKernels(t=>`result_${t.name}[x] = subKernelResult_${t.name};\n`).join("")}\n }`}_resultKernel2DLoop(t){const{output:e}=this,r=this._getKernelResultTypeConstructorString();return`const result = new Array(${e[1]});\n\t\t${this._mapSubKernels(t=>`let subKernelResult_${t.name};`).join("\n")}\n ${this._mapSubKernels(t=>`const result_${t.name} = new Array(${e[1]});\n`).join("")}\n for (let y = 0; y < ${e[1]}; y++) {\n this.thread.z = 0;\n this.thread.y = y;\n const resultX = result[y] = new ${r}(${e[0]});\n ${this._mapSubKernels(t=>`const result_${t.name}X = result_${t.name}[y] = new ${r}(${e[0]});\n`).join("")}\n for (let x = 0; x < ${e[0]}; x++) {\n \tthis.thread.x = x;\n let kernelResult;\n ${t}\n resultX[x] = kernelResult;\n ${this._mapSubKernels(t=>`result_${t.name}X[x] = subKernelResult_${t.name};\n`).join("")}\n }\n }`}_graphicalKernel2DLoop(t){const{output:e}=this,r=this._getKernelResultTypeConstructorString();return`${this._mapSubKernels(t=>`let subKernelResult_${t.name};`).join("\n")}\n ${this._mapSubKernels(t=>`const result_${t.name} = new Array(${e[1]});\n`).join("")}\n for (let y = 0; y < ${e[1]}; y++) {\n this.thread.z = 0;\n this.thread.y = y;\n ${this._mapSubKernels(t=>`const result_${t.name}X = result_${t.name}[y] = new ${r}(${e[0]});\n`).join("")}\n for (let x = 0; x < ${e[0]}; x++) {\n \tthis.thread.x = x;\n ${t}\n ${this._mapSubKernels(t=>`result_${t.name}X[x] = subKernelResult_${t.name};\n`).join("")}\n }\n }`}_resultKernel3DLoop(t){const{output:e}=this,r=this._getKernelResultTypeConstructorString();return`const result = new Array(${e[2]});\n ${this._mapSubKernels(t=>`let subKernelResult_${t.name};`).join("\n")}\n ${this._mapSubKernels(t=>`const result_${t.name} = new Array(${e[2]});\n`).join("")}\n for (let z = 0; z < ${e[2]}; z++) {\n this.thread.z = z;\n const resultY = result[z] = new Array(${e[1]});\n ${this._mapSubKernels(t=>`const result_${t.name}Y = result_${t.name}[z] = new Array(${e[1]});\n`).join("")}\n for (let y = 0; y < ${e[1]}; y++) {\n this.thread.y = y;\n const resultX = resultY[y] = new ${r}(${e[0]});\n ${this._mapSubKernels(t=>`const result_${t.name}X = result_${t.name}Y[y] = new ${r}(${e[0]});\n`).join("")}\n for (let x = 0; x < ${e[0]}; x++) {\n \tthis.thread.x = x;\n let kernelResult;\n ${t}\n resultX[x] = kernelResult;\n ${this._mapSubKernels(t=>`result_${t.name}X[x] = subKernelResult_${t.name};\n`).join("")}\n }\n }\n }`}_kernelOutput(){return this.subKernels?`return {\n result: result,\n ${this.subKernels.map(t=>`${t.property}: result_${t.name}`).join(",\n")}\n };`:"return result;"}_mapSubKernels(t){return null===this.subKernels?[""]:this.subKernels.map(t)}destroy(t){t&&delete this.canvas}static destroyContext(t){}toJSON(){const t=super.toJSON();return t.functionNodes=i.fromKernel(this,o).toJSON(),t}}}},{"../../utils":65,"../function-builder":45,"../kernel":49,"./function-node":42,"./kernel-string":43}],45:[function(t,e,r){class n{static fromKernel(t,e,r){const{argumentNames:i,argumentTypes:o,argumentSizes:a,argumentBitRatios:s,constants:u,constantTypes:l,constantBitRatios:c,debug:h,loopMaxIterations:p,nativeFunctions:f,output:d,optimizeFloatMemory:m,precision:g,plugins:v,source:_,subKernels:y,functions:b}=t,x=(t,e,r)=>F.lookupReturnType(t,e,r),w=(t,e)=>F.lookupArgumentType(t,e),E=t=>F.lookupFunctionArgumentTypes(t),k=(t,e)=>F.lookupFunctionArgumentName(t,e),T=(t,e)=>F.lookupFunctionArgumentBitRatio(t,e),S=(t,e,r,n)=>{F.assignArgumentType(t,e,r,n)},A=(t,e,r,n)=>{F.trackArgumentSynonym(t,e,r,n)},C=(t,e,r)=>F.lookupArgumentSynonym(t,e,r),R=(t,e)=>{F.trackFunctionCall(t,e)},B=Object.assign({isRootKernel:!1,onNestedFunction:(t,r)=>{F.addFunctionNode(new e(t,Object.assign({},B,{returnType:r||"Number",lookupReturnType:x,lookupArgumentType:w,lookupFunctionArgumentTypes:E,lookupFunctionArgumentName:k,lookupFunctionArgumentBitRatio:T,triggerImplyArgumentType:S,triggerTrackArgumentSynonym:A,lookupArgumentSynonym:C,onFunctionCall:R})))},lookupReturnType:x,lookupArgumentType:w,lookupFunctionArgumentTypes:E,lookupFunctionArgumentName:k,lookupFunctionArgumentBitRatio:T,triggerImplyArgumentType:S,triggerTrackArgumentSynonym:A,lookupArgumentSynonym:C,onFunctionCall:R,optimizeFloatMemory:m,precision:g,constants:u,constantTypes:l,constantBitRatios:c,debug:h,loopMaxIterations:p,output:d,plugins:v},r||{}),P=Object.assign({},B,{isRootKernel:!0,name:"kernel",argumentNames:i,argumentTypes:o,argumentSizes:a,argumentBitRatios:s});if("object"==typeof _&&_.functionNodes)return(new n).fromJSON(_.functionNodes,e);const I=new e(_,P);let M=null;b&&(M=b.map(t=>new e(t.source,{returnType:t.returnType,argumentTypes:t.argumentTypes,output:d,plugins:v,constants:u,constantTypes:l,constantBitRatios:c,optimizeFloatMemory:m,precision:g,lookupReturnType:x,lookupArgumentType:w,lookupFunctionArgumentTypes:E,lookupFunctionArgumentName:k,lookupFunctionArgumentBitRatio:T,triggerImplyArgumentType:S,triggerTrackArgumentSynonym:A,lookupArgumentSynonym:C,onFunctionCall:R})));let D=null;y&&(D=y.map(t=>{const{name:r,source:n}=t;return new e(n,Object.assign({},B,{name:r,isSubKernel:!0,isRootKernel:!1,returnType:"Number"}))}));const F=new n({kernel:t,rootNode:I,functionNodes:M,nativeFunctions:f,subKernelNodes:D});return F}constructor(t){if(t=t||{},this.kernel=t.kernel,this.rootNode=t.rootNode,this.functionNodes=t.functionNodes||[],this.subKernelNodes=t.subKernelNodes||[],this.nativeFunctions=t.nativeFunctions||[],this.functionMap={},this.nativeFunctionNames=[],this.lookupChain=[],this.argumentChain=[],this.functionNodeDependencies={},this.rootNode&&(this.functionMap.kernel=this.rootNode),this.functionNodes)for(let t=0;t-1)return-1===e.indexOf(t)&&e.push(t),e;const r=this.functionMap[t];if(r){const n=e.indexOf(t);if(-1===n){e.push(t),r.toString();for(let t=0;t-1){e.push(this.nativeFunctions[i].source);continue}const o=this.functionMap[n];o&&e.push(o.toString())}return e}toJSON(){return this.traceFunctionCalls(this.rootNode.name).reverse().map(t=>{const e=this.nativeFunctions.indexOf(t);if(e>-1)return{name:t,source:this.nativeFunctions[e].source};if(this.functionMap[t])return this.functionMap[t].toJSON();throw new Error(`function ${t} not found`)})}fromJSON(t,e){this.functionMap={};for(let r=0;r0&&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(t){return!!this.constants&&this.constants.hasOwnProperty(t)}isInput(t){return"Input"===this.argumentTypes[this.argumentNames.indexOf(t)]}pushState(t){this.states.push(t)}popState(t){if(this.state!==t)throw new Error(`Cannot popState ${t} when in ${this.state}`);this.states.pop()}isState(t){return this.state===t}get state(){return this.states[this.states.length-1]}astMemberExpressionUnroll(t){if("Identifier"===t.type)return t.name;if("ThisExpression"===t.type)return"this";if("MemberExpression"===t.type&&t.object&&t.property)return t.object.hasOwnProperty("name")&&"_"===t.object.name[0]?this.astMemberExpressionUnroll(t.property):this.astMemberExpressionUnroll(t.object)+"."+this.astMemberExpressionUnroll(t.property);if(t.hasOwnProperty("expressions")){const e=t.expressions[0];if("Literal"===e.type&&0===e.value&&2===t.expressions.length)return this.astMemberExpressionUnroll(t.expressions[1])}throw this.astErrorOutput("Unknown astMemberExpressionUnroll",t)}getJsAST(t){if("object"==typeof this.source)return this.ast=this.source;if(this.ast)return this.ast;if(null===(t=t||i))throw"Missing JS to AST parser";const e=Object.freeze(t.parse(`const parser_${this.name} = ${this.source};`,{locations:!0})),r=e.body[0].declarations[0].init;if(!e)throw new Error("Failed to parse JS code");return this.ast=r}getVariableType(t){let e=null;const r=this.argumentNames.indexOf(t);if(-1===r){if(this.declarations[t])return this.declarations[t].type}else{const n=this.argumentTypes[r];n?e=n:this.lookupArgumentType&&(e=this.argumentTypes[r]=this.lookupArgumentType(t,this))}return e}getConstantType(t){if(this.constantTypes[t]){const e=this.constantTypes[t];return"Float"===e?"Number":e}throw new Error(`Type for constant "${t}" not declared`)}getKernelArgumentName(t){return this.lookupArgumentSynonym?-1===this.argumentNames.indexOf(t)?null:this.lookupArgumentSynonym("kernel",this.name,t):null}toString(){return this._string?this._string:this._string=this.astGeneric(this.getJsAST(),[]).join("").trim()}toJSON(){const t={source:this.source,name:this.name,constants:this.constants,constantTypes:this.constantTypes,isRootKernel:this.isRootKernel,isSubKernel:this.isSubKernel,debug:this.debug,output:this.output,loopMaxIterations:this.loopMaxIterations,argumentNames:this.argumentNames,argumentTypes:this.argumentTypes,argumentSizes:this.argumentSizes,returnType:this.returnType};return{ast:this.ast,settings:t}}getType(t){if(Array.isArray(t))return this.getType(t[t.length-1]);switch(t.type){case"BlockStatement":return this.getType(t.body);case"ArrayExpression":return`Array(${t.elements.length})`;case"Literal":const e=`${t.start},${t.end}`;return this.literalTypes[e]?this.literalTypes[e]:Number.isInteger(t.value)?"LiteralInteger":"Number";case"CallExpression":if(this.isAstMathFunction(t))return"Number";if(!t.callee||!t.callee.name){if("SequenceExpression"===t.callee.type&&t.callee.expressions[t.callee.expressions.length-1].property.name)return this.lookupReturnType(t.callee.expressions[t.callee.expressions.length-1].property.name,t,this);throw this.astErrorOutput("Unknown call expression",t)}if(t.callee&&t.callee.name)return this.lookupReturnType(t.callee.name,t,this);throw this.astErrorOutput(`Unhandled getType Type "${t.type}"`,t);case"BinaryExpression":switch(t.operator){case"%":return"Number";case">":case"<":return"Boolean"}const r=this.getType(t.left);return o[r]||r;case"UpdateExpression":case"UnaryExpression":return this.getType(t.argument);case"VariableDeclaration":return this.getType(t.declarations[0]);case"VariableDeclarator":return this.getType(t.id);case"Identifier":if(this.isAstVariable(t)&&"value"===this.getVariableSignature(t)){if(this.argumentNames.indexOf(t.name)>-1)return this.getVariableType(t.name);if(this.declarations[t.name])return this.declarations[t.name].type}if("Infinity"===t.name)return"Number";const n=this.findIdentifierOrigin(t);return n&&n.init?this.getType(n.init):null;case"ReturnStatement":return this.getType(t.argument);case"MemberExpression":if(this.isAstMathFunction(t)){switch(t.property.name){case"ceil":case"floor":case"round":return"Integer"}return"Number"}if(this.isAstVariable(t)){switch(this.getVariableSignature(t)){case"value[]":return o[this.getVariableType(t.object.name)];case"value[][]":return o[this.getVariableType(t.object.object.name)];case"value[][][]":return o[this.getVariableType(t.object.object.object.name)];case"value[][][][]":return o[this.getVariableType(t.object.object.object.object.name)];case"this.thread.value":return"Integer";case"this.output.value":return"LiteralInteger";case"this.constants.value":return this.getConstantType(t.property.name);case"this.constants.value[]":return o[this.getConstantType(t.object.property.name)];case"this.constants.value[][]":return o[this.getConstantType(t.object.object.property.name)];case"this.constants.value[][][]":return o[this.getConstantType(t.object.object.object.property.name)];case"this.constants.value[][][][]":return o[this.getConstantType(t.object.object.object.object.property.name)];case"fn()[]":case"fn()[][]":case"fn()[][][]":return o[this.getType(t.object)];case"value.value":if(this.isAstMathVariable(t))return"Number";switch(t.property.name){case"r":case"g":case"b":case"a":return o[this.getVariableType(t.object.name)]}case"[][]":return"Number"}throw this.astErrorOutput("Unhandled getType MemberExpression",t)}throw this.astErrorOutput("Unhandled getType MemberExpression",t);case"ConditionalExpression":return this.getType(t.consequent);case"FunctionDeclaration":case"FunctionExpression":const i=this.findLastReturn(t.body);return i?this.getType(i):null;case"IfStatement":return this.getType(t.consequent);default:throw this.astErrorOutput(`Unhandled getType Type "${t.type}"`,t)}}isAstMathVariable(t){return"MemberExpression"===t.type&&t.object&&"Identifier"===t.object.type&&"Math"===t.object.name&&t.property&&"Identifier"===t.property.type&&["E","PI","SQRT2","SQRT1_2","LN2","LN10","LOG2E","LOG10E"].indexOf(t.property.name)>-1}isAstMathFunction(t){return"CallExpression"===t.type&&t.callee&&"MemberExpression"===t.callee.type&&t.callee.object&&"Identifier"===t.callee.object.type&&"Math"===t.callee.object.name&&t.callee.property&&"Identifier"===t.callee.property.type&&["abs","acos","asin","atan","atan2","ceil","cos","exp","floor","log","log2","max","min","pow","random","round","sign","sin","sqrt","tan"].indexOf(t.callee.property.name)>-1}isAstVariable(t){return"Identifier"===t.type||"MemberExpression"===t.type}isSafe(t){return this.isSafeDependencies(this.getDependencies(t))}isSafeDependencies(t){return!t||!t.every||t.every(t=>t.isSafe)}getDependencies(t,e,r){if(e||(e=[]),!t)return null;if(Array.isArray(t)){for(let n=0;n-1/0&&t.value<1/0&&!isNaN(t.value)});break;case"VariableDeclarator":return this.getDependencies(t.init,e,r);case"Identifier":this.declarations[t.name]?e.push({name:t.name,origin:"declaration",isSafe:!r&&this.isSafeDependencies(this.declarations[t.name].dependencies)}):this.argumentNames.indexOf(t.name)>-1&&e.push({name:t.name,origin:"argument",isSafe:!1});break;case"FunctionDeclaration":return this.getDependencies(t.body.body[t.body.body.length-1],e,r);case"ReturnStatement":return this.getDependencies(t.argument,e);case"BinaryExpression":return r="/"===t.operator||"*"===t.operator,this.getDependencies(t.left,e,r),this.getDependencies(t.right,e,r),e;case"UnaryExpression":case"UpdateExpression":return this.getDependencies(t.argument,e,r);case"VariableDeclaration":return this.getDependencies(t.declarations,e,r);case"ArrayExpression":return e.push({origin:"declaration",isSafe:!0}),e;case"CallExpression":return e.push({origin:"function",isSafe:!0}),e;case"MemberExpression":const n=this.getMemberExpressionDetails(t);if(n)return n.type;default:throw this.astErrorOutput(`Unhandled type ${t.type} in getAllVariables`,t)}return e}getVariableSignature(t){if(!this.isAstVariable(t))throw new Error(`ast of type "${t.type}" is not a variable signature`);if("Identifier"===t.type)return"value";const e=[];for(;t;)t.computed?e.push("[]"):"ThisExpression"===t.type?e.unshift("this"):t.property&&t.property.name?"x"===t.property.name||"y"===t.property.name||"z"===t.property.name?e.unshift(".value"):"constants"===t.property.name||"thread"===t.property.name||"output"===t.property.name?e.unshift("."+t.property.name):e.unshift(".value"):t.name?e.unshift("value"):t.callee&&t.callee.name?e.unshift("fn()"):t.elements?e.unshift("[]"):e.unshift("unknown"),t=t.object;const r=e.join("");return["value","value[]","value[][]","value[][][]","value[][][][]","value.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(r)>-1?r:null}build(){return this.toString().length>0}astGeneric(t,e){if(null===t)throw this.astErrorOutput("NULL ast",t);if(Array.isArray(t)){for(let r=0;r0?i[i.length-1]:0;return new Error(`${t} on line ${i.length}, position ${o.length}:\n ${r}`)}astDebuggerStatement(t,e){return e}astConditionalExpression(t,e){if("ConditionalExpression"!==t.type)throw this.astErrorOutput("Not a conditional expression",t);return e.push("("),this.astGeneric(t.test,e),e.push("?"),this.astGeneric(t.consequent,e),e.push(":"),this.astGeneric(t.alternate,e),e.push(")"),e}astFunctionDeclaration(t,e){if(this.onNestedFunction){let e=this.getType(t);"LiteralInteger"===e&&(e="Number"),this.onNestedFunction(n.getAstString(this.source,t),e)}return e}astFunctionExpression(t,e){return e}astReturnStatement(t,e){return e}astLiteral(t,e){return this.literalTypes[`${t.start},${t.end}`]="Number",e}astBinaryExpression(t,e){return e}astIdentifierExpression(t,e){return e}astAssignmentExpression(t,e){return e}astExpressionStatement(t,e){return this.astGeneric(t.expression,e),e.push(";"),e}astEmptyStatement(t,e){return e}astBlockStatement(t,e){return e}astIfStatement(t,e){return e}astBreakStatement(t,e){return e.push("break;"),e}astContinueStatement(t,e){return e.push("continue;\n"),e}astForStatement(t,e){return e}astWhileStatement(t,e){return e}astDoWhileStatement(t,e){return e}astVariableDeclaration(t,e){const r=t.declarations;if(!r||!r[0]||!r[0].init)throw this.astErrorOutput("Unexpected expression",t);const n=[],i=r[0],o=i.init;let a=this.isState("in-for-loop-init")?"Integer":this.getType(o);"LiteralInteger"===a&&(a="Number");const s=typeMap[a];if(!s)throw this.astErrorOutput(`Markup type ${s} not handled`,t);let u=this.getDependencies(i.init);this.declarations[i.id.name]=Object.freeze({type:a,dependencies:u,isSafe:u.every(t=>t.isSafe)});const l=[`${a} user_${i.id.name}=`];this.astGeneric(o,l),n.push(l.join(""));for(let t=1;t0&&e.push(","),this.astGeneric(t.expressions,e);return e}astUnaryExpression(t,e){return t.prefix?(e.push(t.operator),this.astGeneric(t.argument,e)):(this.astGeneric(t.argument,e),e.push(t.operator)),e}astUpdateExpression(t,e){return t.prefix?(e.push(t.operator),this.astGeneric(t.argument,e)):(this.astGeneric(t.argument,e),e.push(t.operator)),e}astLogicalExpression(t,e){return e.push("("),this.astGeneric(t.left,e),e.push(t.operator),this.astGeneric(t.right,e),e.push(")"),e}astMemberExpression(t,e){return e}astCallExpression(t,e){return e}astArrayExpression(t,e){return e}getMemberExpressionDetails(t){if("MemberExpression"!==t.type)throw this.astErrorOutput(`Expression ${t.type} not a MemberExpression`,t);let e=null,r=null;const n=this.getVariableSignature(t);switch(n){case"value":return null;case"this.thread.value":case"this.output.value":return{signature:n,type:"Integer",name:t.property.name};case"value[]":if("string"!=typeof t.object.name)throw this.astErrorOutput("Unexpected expression",t);return{name:e=t.object.name,origin:"user",signature:n,type:this.getVariableType(e),xProperty:t.property};case"value[][]":if("string"!=typeof t.object.object.name)throw this.astErrorOutput("Unexpected expression",t);return{name:e=t.object.object.name,origin:"user",signature:n,type:this.getVariableType(e),yProperty:t.object.property,xProperty:t.property};case"value[][][]":if("string"!=typeof t.object.object.object.name)throw this.astErrorOutput("Unexpected expression",t);return{name:e=t.object.object.object.name,origin:"user",signature:n,type:this.getVariableType(e),zProperty:t.object.object.property,yProperty:t.object.property,xProperty:t.property};case"value[][][][]":if("string"!=typeof t.object.object.object.object.name)throw this.astErrorOutput("Unexpected expression",t);return{name:e=t.object.object.object.object.name,origin:"user",signature:n,type:this.getVariableType(e),zProperty:t.object.object.property,yProperty:t.object.property,xProperty:t.property};case"value.value":if("string"!=typeof t.property.name)throw this.astErrorOutput("Unexpected expression",t);if(this.isAstMathVariable(t))return{name:e=t.property.name,origin:"Math",type:"Number",signature:n};switch(t.property.name){case"r":case"g":case"b":case"a":return{name:e=t.object.name,property:t.property.name,origin:"user",signature:n,type:"Number"};default:throw this.astErrorOutput("Unexpected expression",t)}case"this.constants.value":if("string"!=typeof t.property.name)throw this.astErrorOutput("Unexpected expression",t);if(e=t.property.name,!(r=this.getConstantType(e)))throw this.astErrorOutput("Constant has no type",t);return{name:e,type:r,origin:"constants",signature:n};case"this.constants.value[]":if("string"!=typeof t.object.property.name)throw this.astErrorOutput("Unexpected expression",t);if(e=t.object.property.name,!(r=this.getConstantType(e)))throw this.astErrorOutput("Constant has no type",t);return{name:e,type:r,origin:"constants",signature:n,xProperty:t.property};case"this.constants.value[][]":if("string"!=typeof t.object.object.property.name)throw this.astErrorOutput("Unexpected expression",t);if(e=t.object.object.property.name,!(r=this.getConstantType(e)))throw this.astErrorOutput("Constant has no type",t);return{name:e,type:r,origin:"constants",signature:n,yProperty:t.object.property,xProperty:t.property};case"this.constants.value[][][]":if("string"!=typeof t.object.object.object.property.name)throw this.astErrorOutput("Unexpected expression",t);if(e=t.object.object.object.property.name,!(r=this.getConstantType(e)))throw this.astErrorOutput("Constant has no type",t);return{name:e,type:r,origin:"constants",signature:n,zProperty:t.object.object.property,yProperty:t.object.property,xProperty:t.property};case"fn()[]":case"[][]":return{signature:n,property:t.property};default:throw this.astErrorOutput("Unexpected expression",t)}}findIdentifierOrigin(t){const e=[this.ast];for(;e.length>0;){const r=e[0];if("VariableDeclarator"===r.type&&r.id&&r.id.name&&r.id.name===t.name)return r;if(e.shift(),r.argument)e.push(r.argument);else if(r.body)e.push(r.body);else if(r.declarations)e.push(r.declarations);else if(Array.isArray(r))for(let t=0;t0;){const t=e.pop();if("ReturnStatement"===t.type)return t;if(t.argument)e.push(t.argument);else if(t.body)e.push(t.body);else if(t.declarations)e.push(t.declarations);else if(Array.isArray(t))for(let r=0;r0?n[n.length-1]:null;if("FUNCTION_ARGUMENTS"!==p||"/"!==c||"*"!==h)if("MULTI_LINE_COMMENT"!==p||"*"!==c||"/"!==h)if("FUNCTION_ARGUMENTS"!==p||"/"!==c||"/"!==h)if("COMMENT"!==p||"\n"!==c)if(null!==p||"("!==c){if("FUNCTION_ARGUMENTS"===p){if(")"===c){n.pop();break}if("f"===c&&"l"===h&&"o"===t[a+2]&&"a"===t[a+3]&&"t"===t[a+4]&&" "===t[a+5]){n.push("DECLARE_VARIABLE"),l="float",u="",a+=6;continue}if("i"===c&&"n"===h&&"t"===t[a+2]&&" "===t[a+3]){n.push("DECLARE_VARIABLE"),l="int",u="",a+=4;continue}if("v"===c&&"e"===h&&"c"===t[a+2]&&"2"===t[a+3]&&" "===t[a+4]){n.push("DECLARE_VARIABLE"),l="vec2",u="",a+=5;continue}if("v"===c&&"e"===h&&"c"===t[a+2]&&"3"===t[a+3]&&" "===t[a+4]){n.push("DECLARE_VARIABLE"),l="vec3",u="",a+=5;continue}if("v"===c&&"e"===h&&"c"===t[a+2]&&"4"===t[a+3]&&" "===t[a+4]){n.push("DECLARE_VARIABLE"),l="vec4",u="",a+=5;continue}}else if("DECLARE_VARIABLE"===p){if(""===u){if(" "===c){a++;continue}if(!i.test(c))throw new Error("variable name is not expected string")}u+=c,o.test(h)||(n.pop(),r.push(u),e.push(s[l]))}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:e}}static nativeFunctionReturnType(t){return s[t.match(/int|float|vec[2-4]/)[0]]}static combineKernels(t,e){t.apply(null,arguments);const{texSize:r,context:n,threadDim:i}=e.texSize;let a;if("single"===e.precision){const t=r[0],e=Math.ceil(r[1]/4);a=new Float32Array(t*e*4*4),n.readPixels(0,0,t,4*e,n.RGBA,n.FLOAT,a)}else{const t=new Uint8Array(r[0]*r[1]*4);n.readPixels(0,0,r[0],r[1],n.RGBA,n.UNSIGNED_BYTE,t),a=new Float32Array(t.buffer)}return a=a.subarray(0,i[0]*i[1]*i[2]),1===e.output.length?a:2===e.output.length?o.splitArray(a,e.output[0]):3===e.output.length?o.splitArray(a,e.output[0]*e.output[1]).map(function(t){return o.splitArray(t,e.output[0])}):void 0}constructor(t,e){super(t,e),this.texSize=null,this.floatOutputForce=null,this.fixIntegerDivisionAccuracy=null,this.translatedSource=null,this.renderStrategy=null,this.compiledFragmentShader=null,this.compiledVertexShader=null,this.optimizeFloatMemory=null}translateSource(){throw new Error(`"translateSource" not defined on ${this.constructor.name}`)}pickRenderStrategy(t){if(!this.graphical){if("unsigned"===this.precision)switch(this.returnType){case"LiteralInteger":case"Float":case"Number":case"Integer":return this.pipeline?(this.renderStrategy=a.PackedTexture,this.renderOutput=this.renderTexture):this.output[2]>0?(this.renderStrategy=a.PackedPixelTo3DFloat,this.renderOutput=this.render3DPackedFloat):this.output[1]>0?(this.renderStrategy=a.PackedPixelTo2DFloat,this.renderOutput=this.render2DPackedFloat):(this.renderStrategy=a.PackedPixelToFloat,this.renderOutput=this.renderPackedFloat),!0;case"Array(2)":case"Array(3)":case"Array(4)":return this.onRequestFallback(t),!1}else{if("single"!==this.precision)throw new Error(`unhandled precision of "${this.precision}"`);if(this.pipeline)return this.renderStrategy=a.FloatTexture,this.renderOutput=this.renderTexture,!0;switch(this.returnType){case"LiteralInteger":case"Float":case"Number":case"Integer":return this.output[2]>0?this.optimizeFloatMemory?(this.renderStrategy=a.MemoryOptimizedFloatPixelToMemoryOptimized3DFloat,this.renderOutput=this.renderMemoryOptimized3DFloat):(this.renderStrategy=a.FloatPixelTo3DFloat,this.renderOutput=this.render3DFloat):this.output[1]>0?this.optimizeFloatMemory?(this.renderStrategy=a.MemoryOptimizedFloatPixelToMemoryOptimized2DFloat,this.renderOutput=this.renderMemoryOptimized2DFloat):(this.renderStrategy=a.FloatPixelTo2DFloat,this.renderOutput=this.render2DFloat):this.optimizeFloatMemory?(this.renderStrategy=a.MemoryOptimizedFloatPixelToMemoryOptimizedFloat,this.renderOutput=this.renderMemoryOptimizedFloat):(this.renderStrategy=a.FloatPixelToFloat,this.renderOutput=this.renderFloat),!0;case"Array(2)":return this.output[2]>0?(this.renderStrategy=a.FloatPixelTo3DArray2,this.renderOutput=this.render3DArray2):this.output[1]>0?(this.renderStrategy=a.FloatPixelTo2DArray2,this.renderOutput=this.render2DArray2):(this.renderStrategy=a.FloatPixelToArray2,this.renderOutput=this.renderArray2),!0;case"Array(3)":return this.output[2]>0?(this.renderStrategy=a.FloatPixelTo3DArray3,this.renderOutput=this.render3DArray3):this.output[1]>0?(this.renderStrategy=a.FloatPixelTo2DArray3,this.renderOutput=this.render2DArray3):(this.renderStrategy=a.FloatPixelToArray3,this.renderOutput=this.renderArray3),!0;case"Array(4)":return this.output[2]>0?(this.renderStrategy=a.FloatPixelTo3DArray4,this.renderOutput=this.render3DArray4):this.output[1]>0?(this.renderStrategy=a.FloatPixelTo2DArray4,this.renderOutput=this.render2DArray4):(this.renderStrategy=a.FloatPixelToArray4,this.renderOutput=this.renderArray4),!0}}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 o.linesToString(this.getMainResultKernelNumberTexture())+o.linesToString(this.getMainResultSubKernelNumberTexture())}getMainResultArray2Texture(){return o.linesToString(this.getMainResultKernelArray2Texture())+o.linesToString(this.getMainResultSubKernelArray2Texture())}getMainResultArray3Texture(){return o.linesToString(this.getMainResultKernelArray3Texture())+o.linesToString(this.getMainResultSubKernelArray3Texture())}getMainResultArray4Texture(){return o.linesToString(this.getMainResultKernelArray4Texture())+o.linesToString(this.getMainResultSubKernelArray4Texture())}getReturnTextureType(){if(this.graphical)return"ArrayTexture(4)";if("single"===this.precision)switch(this.returnType){case"Float":case"Number":case"Integer":return this.optimizeFloatMemory?"MemoryOptimizedNumberTexture":"ArrayTexture(1)";case"Array(2)":return"ArrayTexture(2)";case"Array(3)":return"ArrayTexture(3)";case"Array(4)":return"ArrayTexture(4)";default:throw new Error(`unsupported returnType ${this.returnType}`)}else switch(this.returnType){case"Float":case"Number":case"Integer":return"NumberTexture";case"Array(2)":case"Array(3)":case"Array(4)":default:throw new Error(`unsupported returnType ${this.returnType}`)}}renderTexture(){return new i({texture:this.outputTexture,size:this.texSize,dimensions:this.threadDim,output:this.output,context:this.context,gpu:this.gpu,type:this.getReturnTextureType()})}readPackedPixelsToUint8Array(){if("unsigned"!==this.precision)throw new Error('Requires this.precision to be "unsigned"');const{texSize:t,context:e}=this,r=new Uint8Array(t[0]*t[1]*4);return e.readPixels(0,0,t[0],t[1],e.RGBA,e.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:t,context:e}=this,r=t[0],n=t[1],i=new Float32Array(r*n*4);return e.readPixels(0,0,r,n,e.RGBA,e.FLOAT,i),i}readMemoryOptimizedFloatPixelsToFloat32Array(){if("single"!==this.precision)throw new Error('Requires this.precision to be "single"');const{texSize:t,context:e}=this,r=t[0],n=t[1],i=new Float32Array(r*n*4);return e.readPixels(0,0,r,n,e.RGBA,e.FLOAT,i),i}renderPackedFloat(){const[t]=this.output;return this.readPackedPixelsToFloat32Array().subarray(0,t)}render2DPackedFloat(){const t=this.readPackedPixelsToFloat32Array(),[e,r]=this.output,n=new Array(r);for(let i=0;in.functionToIFunction(t));continue}this[e]=t[e]}this.canvas||(this.canvas=this.initCanvas()),this.context||(this.context=this.initContext()),this.plugins||(this.plugins=this.initPlugins(t))}build(){throw new Error(`"build" not defined on ${this.constructor.name}`)}run(){throw new Error(`"run" not defined on ${this.constructor.name}`)}initCanvas(){throw new Error(`"initCanvas" not defined on ${this.constructor.name}`)}initContext(){throw new Error(`"initContext" not defined on ${this.constructor.name}`)}initPlugins(t){throw new Error(`"initPlugins" not defined on ${this.constructor.name}`)}setupArguments(t){if(!this.argumentTypes){this.argumentTypes=[];for(let e=0;en.functionToIFunction(t)):this.functions=t,this}setPipeline(t){return this.pipeline=t,this}setPrecision(t){return this.precision=t,this}setOutputToTexture(t){return n.warnDeprecated("method","setOutputToTexture","setPipeline"),this.pipeline=t,this}setImmutable(t){return this.immutable=t,this}setCanvas(t){return this.canvas=t,this}getCanvas(){return n.warnDeprecated("method","getCanvas"),this.canvas}getWebGl(){return n.warnDeprecated("method","getWebGl"),this.context}setContext(t){return this.context=t,this}setArgumentTypes(t){return this.argumentTypes=t,this}requestFallback(t){if(!this.onRequestFallback)throw new Error(`"onRequestFallback" not defined on ${this.constructor.name}`);return this.onRequestFallback(t)}validateSettings(){throw new Error(`"validateSettings" not defined on ${this.constructor.name}`)}exec(){const t=1===arguments.length?[arguments[0]]:Array.apply(null,arguments);return new Promise((e,r)=>{try{e(this.run.apply(this,t))}catch(t){r(t)}})}addSubKernel(t){if(null===this.subKernels&&(this.subKernels=[]),!t.source)throw new Error('subKernel missing "source" property');if(!t.property&&isNaN(t.property))throw new Error('subKernel missing "property" property');if(!t.name)throw new Error('subKernel missing "name" property');return this.subKernels.push(t),this}destroy(t){throw new Error(`"destroy" called on ${this.constructor.name}`)}getBitRatio(t){if("single"===this.precision)return 4;if(Array.isArray(t[0]))return this.getBitRatio(t[0]);if(t.constructor===i)return this.getBitRatio(t.value);switch(t.constructor){case Uint8Array:case Int8Array:return 1;case Uint16Array:case Int16Array:return 2;case Float32Array:case Int32Array:default:return 4}}getPixels(){throw new Error(`"getPixels" called on ${this.constructor.name}`)}checkOutput(){if(!this.output||!Array.isArray(this.output))throw new Error("kernel.output not an array");if(this.output.length<1)throw new Error("kernel.output is empty, needs at least 1 value");for(let t=0;tt.name):null,returnType:this.returnType}}}}}},{"../input":61,"../utils":65}],50:[function(t,e,r){e.exports={fragmentShader:"__HEADER__;\nprecision highp float;\nprecision highp int;\nprecision highp sampler2D;\n\nconst int LOOP_MAX = __LOOP_MAX__;\n\n__PLUGINS__;\n__CONSTANTS__;\n\nvarying vec2 vTexCoord;\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\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\tint channel = integerMod(index, 2);\n\tif (channel == 0) return texel.r * 255.0 + texel.g * 65280.0;\n\tif (channel == 1) return texel.b * 255.0 + texel.a * 65280.0;\n\treturn 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 encode32(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// 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 ivec3 xyz = ivec3(x, y, z);\n int index = xyz.x + texDim.x * (xyz.y + texDim.y * xyz.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 ivec3 xyz = ivec3(x, y, z);\n int index = xyz.x + texDim.x * (xyz.y + texDim.y * xyz.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 ivec3 xyz = ivec3(x, y, z);\n int index = xyz.x + texDim.x * (xyz.y + texDim.y * xyz.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 ivec3 xyz = ivec3(x, y, z);\n int index = xyz.x + texDim.x * (xyz.y + texDim.y * xyz.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 ivec3 xyz = ivec3(x, y, z);\n int index = xyz.x + texDim.x * (xyz.y + texDim.y * xyz.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\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\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 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\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}"}},{}],51:[function(t,e,r){const{FunctionNode:n}=t("../function-node"),i="Math.",o="this.";const a={Array:"sampler2D","Array(2)":"vec2","Array(3)":"vec3","Array(4)":"vec4",Array2D:"sampler2D",Array3D:"sampler2D",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"},s={"===":"==","!==":"!="};e.exports={WebGLFunctionNode:class extends n{constructor(t,e){super(t,e),this.fixIntegerDivisionAccuracy=null,e&&e.hasOwnProperty("fixIntegerDivisionAccuracy")&&(this.fixIntegerDivisionAccuracy=e.fixIntegerDivisionAccuracy)}astFunctionExpression(t,e){if(this.isRootKernel)e.push("void");else{this.returnType||this.findLastReturn()&&(this.returnType=this.getType(t.body),"LiteralInteger"===this.returnType&&(this.returnType="Number"));const{returnType:r}=this;if(r){const t=a[r];if(!t)throw new Error(`unknown type ${r}`);e.push(t)}else e.push("void")}if(e.push(" "),e.push(this.name),e.push("("),!this.isRootKernel)for(let r=0;r0&&e.push(", ");let i=this.getVariableType(n);i&&"LiteralInteger"!==i||(i="Number");const o=a[i];if(!o)throw this.astErrorOutput("Unexpected expression",t);e.push(o),e.push(" "),e.push("user_"),e.push(n)}e.push(") {\n");for(let r=0;r"===t.operator||"<"===t.operator&&"Literal"===t.right.type)&&!Number.isInteger(t.right.value)){this.pushState("casting-to-float"),e.push("float("),this.astGeneric(t.left,e),e.push(")"),this.popState("casting-to-float"),e.push(s[t.operator]||t.operator),this.astGeneric(t.right,e);break}if(this.astGeneric(t.left,e),e.push(s[t.operator]||t.operator),this.pushState("casting-to-integer"),"Literal"===t.right.type){const r=[];if(this.astGeneric(t.right,r),"Integer"!==this.getType(t.right))throw this.astErrorOutput("Unhandled binary expression with literal",t);e.push(r.join(""))}else e.push("int("),this.astGeneric(t.right,e),e.push(")");this.popState("casting-to-integer");break;case"Integer & LiteralInteger":this.astGeneric(t.left,e),e.push(s[t.operator]||t.operator),this.pushState("casting-to-integer"),this.astGeneric(t.right,e),this.popState("casting-to-integer");break;case"Number & Integer":this.astGeneric(t.left,e),e.push(s[t.operator]||t.operator),this.pushState("casting-to-float"),e.push("float("),this.astGeneric(t.right,e),e.push(")"),this.popState("casting-to-float");break;case"Float & LiteralInteger":case"Number & LiteralInteger":this.isState("in-for-loop-test")?(e.push("int("),this.astGeneric(t.left,e),e.push(")"),e.push(s[t.operator]||t.operator),this.pushState("casting-to-integer"),this.astGeneric(t.right,e),this.popState("casting-to-integer")):(this.astGeneric(t.left,e),e.push(s[t.operator]||t.operator),this.pushState("casting-to-float"),this.astGeneric(t.right,e),this.popState("casting-to-float"));break;case"LiteralInteger & Float":case"LiteralInteger & Number":this.isState("in-for-loop-test")||this.isState("in-for-loop-init")||this.isState("casting-to-integer")?(this.pushState("casting-to-integer"),this.astGeneric(t.left,e),e.push(s[t.operator]||t.operator),e.push("int("),this.astGeneric(t.right,e),e.push(")"),this.popState("casting-to-integer")):(this.astGeneric(t.left,e),e.push(s[t.operator]||t.operator),this.pushState("casting-to-float"),this.astGeneric(t.right,e),this.popState("casting-to-float"));break;case"LiteralInteger & Integer":this.pushState("casting-to-integer"),this.astGeneric(t.left,e),this.popState("casting-to-integer"),e.push(s[t.operator]||t.operator),this.astGeneric(t.right,e);break;default:throw this.astErrorOutput(`Unhandled binary expression between ${i}`,t)}}return e.push(")"),e}astIdentifierExpression(t,e){if("Identifier"!==t.type)throw this.astErrorOutput("IdentifierExpression - not an Identifier",t);if("Infinity"===t.name)e.push("3.402823466e+38");else{const r=this.getKernelArgumentName(t.name);r?e.push(`user_${r}`):e.push(`user_${t.name}`)}return e}astForStatement(t,e){if("ForStatement"!==t.type)throw this.astErrorOutput("Invalid for statement",t);const r=[],n=[],i=[],o=[];let a=null;if(t.init){this.pushState("in-for-loop-init"),this.astGeneric(t.init,r);for(let t=0;t0&&e.push(r.join(""),";\n"),e.push(`for (int ${t}=0;${t}0&&e.push(`if (!${n.join("")}) break;\n`),e.push(o.join("")),e.push(`\n${i.join("")};`),e.push("}\n")}return e}astWhileStatement(t,e){if("WhileStatement"!==t.type)throw this.astErrorOutput("Invalid while statement",t);const r=this.getInternalVariableName("safeI");return e.push(`for (int ${r}=0;${r}0)for(let t=0;t0&&e.push(", "),i){case"Integer":this.pushState("casting-to-float"),e.push("float("),this.astGeneric(n,e),e.push(")"),this.popState("casting-to-float");break;default:this.astGeneric(n,e)}}else{const n=this.lookupFunctionArgumentTypes(r)||[];for(let i=0;i0&&e.push(", ");const s=this.getType(o);switch(a||(this.triggerImplyArgumentType(r,i,s,this),a=s),s){case"Number":case"Float":if("Integer"===a){e.push("int("),this.astGeneric(o,e),e.push(")");continue}if("Number"===a||"Float"===a){this.astGeneric(o,e);continue}if("LiteralInteger"===a){this.pushState("casting-to-float"),this.astGeneric(o,e),this.popState("casting-to-float");continue}break;case"Integer":if("Number"===a||"Float"===a){e.push("float("),this.astGeneric(o,e),e.push(")");continue}if("Integer"===a){this.astGeneric(o,e);continue}break;case"LiteralInteger":if("Integer"===a){this.pushState("casting-to-integer"),this.astGeneric(o,e),this.popState("casting-to-integer");continue}if("Number"===a||"Float"===a){this.pushState("casting-to-float"),this.astGeneric(o,e),this.popState("casting-to-float");continue}if("LiteralInteger"===a){this.astGeneric(o,e);continue}break;case"Array(2)":case"Array(3)":case"Array(4)":if(a===s){this.astGeneric(o,e);continue}break;case"Array":case"Input":if(a===s){this.triggerTrackArgumentSynonym(this.name,o.name,r,i),this.astGeneric(o,e);continue}}throw new Error(`Unhandled argument combination of ${s} and ${a}`)}}return e.push(")"),e}astArrayExpression(t,e){const r=t.elements.length;e.push("vec"+r+"(");for(let n=0;n0&&e.push(", ");const r=t.elements[n];this.astGeneric(r,e)}return e.push(")"),e}memberExpressionXYZ(t,e,r,n){return r?n.push(this.memberExpressionPropertyMarkup(r),", "):n.push("0, "),e?n.push(this.memberExpressionPropertyMarkup(e),", "):n.push("0, "),n.push(this.memberExpressionPropertyMarkup(t)),n}memberExpressionPropertyMarkup(t){if(!t)throw new Error("Property not set");const e=this.getType(t),r=[];return"Number"===e?(this.pushState("casting-to-integer"),r.push("int("),this.astGeneric(t,r),r.push(")"),this.popState("casting-to-integer")):"LiteralInteger"===e?(this.pushState("casting-to-integer"),this.astGeneric(t,r),this.popState("casting-to-integer")):this.astGeneric(t,r),r.join("")}}}},{"../function-node":46}],52:[function(t,e,r){const{utils:n}=t("../../utils"),{kernelRunShortcut:i}=t("../../kernel-run-shortcut");function o(t){return/^function /.test(t)&&(t=t.substring(9)),t.replace(/[_]typeof/g,"typeof")}function a(t){return t.replace(/^[A-Za-z23]+/,"function").replace(/[_]typeof/g,"typeof")}function s(t){return t?"true":!1===t?"false":"null"}e.exports={webGLKernelString:function(t,e){return`() => {\n ${i.toString()};\n const utils = {\n allPropertiesOf: ${a(n.allPropertiesOf.toString())},\n clone: ${a(n.clone.toString())},\n splitArray: ${a(n.splitArray.toString())},\n getVariableType: ${a(n.getVariableType.toString())},\n getDimensions: ${a(n.getDimensions.toString())},\n dimToTexSize: ${a(n.dimToTexSize.toString())},\n closestSquareDimensions: ${a(n.closestSquareDimensions.toString())},\n getMemoryOptimizedFloatTextureSize: ${a(n.getMemoryOptimizedFloatTextureSize.toString())},\n getMemoryOptimizedPackedTextureSize: ${a(n.getMemoryOptimizedPackedTextureSize.toString())},\n roundTo: ${a(n.roundTo.toString())},\n flattenTo: ${a(n.flattenTo.toString())},\n flatten2dArrayTo: ${a(n.flatten2dArrayTo.toString())},\n flatten3dArrayTo: ${a(n.flatten3dArrayTo.toString())},\n systemEndianness: ${a(n.getSystemEndianness.toString())},\n isArray: ${a(n.isArray.toString())}\n };\n const canvases = [];\n const maxTexSizes = {};\n let Texture = function() {};\n let Input = function() {}; \n class ${e||"Kernel"} {\n constructor() {\n this.maxTexSize = null;\n this.argumentsLength = 0;\n this.constantsLength = 0;\n this.constantBitRatios = ${t.constantBitRatios?JSON.stringify(t.constantBitRatios):"null"};\n this.canvas = null;\n this.context = null;\n this.program = null;\n this.subKernels = null;\n this.subKernelNames = null;\n this.drawBuffersMap = ${t.drawBuffersMap?JSON.stringify(t.drawBuffersMap):"null"};\n this.endianness = '${t.endianness}';\n this.graphical = ${s(t.graphical)};\n this.optimizeFloatMemory = ${s(t.optimizeFloatMemory)};\n this.precision = "${t.precision}";\n // TODO: not sure how to handle\n this.floatOutputForce = ${s(t.floatOutputForce)};\n this.hardcodeConstants = ${s(t.hardcodeConstants)};\n this.pipeline = ${s(t.pipeline)};\n this.argumentNames = ${JSON.stringify(t.argumentNames)};\n this.argumentTypes = ${JSON.stringify(t.argumentTypes)};\n this.argumentBitRatios = ${JSON.stringify(t.argumentBitRatios)};\n \n this.texSize = ${JSON.stringify(Array.from(t.texSize))};\n this.output = ${JSON.stringify(t.output)};\n this.compiledFragmentShader = \`${t.compiledFragmentShader}\`;\n\t\t this.compiledVertexShader = \`${t.compiledVertexShader}\`;\n\t\t this.returnType = '${t.returnType}';\n\t\t this.programUniformLocationCache = {};\n\t\t this.textureCache = {};\n\t\t this.subKernelOutputTextures = null;\n\t\t this.extensions = {};\n\t\t this.uniform1fCache = {};\n\t\t this.uniform1iCache = {};\n\t\t this.uniform2fCache = {};\n\t\t this.uniform2fvCache = {};\n\t\t this.uniform2ivCache = {};\n\t\t this.uniform3fvCache = {};\n\t\t this.uniform3ivCache = {};\n }\n getFragmentShader() { return this.compiledFragmentShader; }\n getVertexShader() { return this.compiledVertexShader; }\n validateSettings() {}\n initExtensions() {}\n setupArguments() {}\n setupConstants() {}\n setCanvas(canvas) { this.canvas = canvas; return this; }\n setContext(context) { this.context = context; return this; }\n setTexture(Type) { Texture = Type; }\n setInput(Type) { Input = Type; }\n ${o(t.getUniformLocation.toString())}\n ${o(t.build.toString())}\n translateSource() {}\n pickRenderStrategy() {}\n\t\t ${o(t.run.toString())}\n\t\t ${o(t.addArgument.toString())}\n\t\t ${o(t.formatArrayTransfer.toString())}\n\t\t ${o(t.checkOutput.toString())}\n\t\t ${o(t.getArgumentTexture.toString())}\n\t\t ${o(t.getTextureCache.toString())}\n\t\t ${o(t.getOutputTexture.toString())}\n\t\t renderOutput() { ${n.getFunctionBodyFromString(o(t.renderOutput.toString()))} }\n\t\t ${o(t.readPackedPixelsToFloat32Array.toString())}\n\t\t ${o(t.readPackedPixelsToUint8Array.toString())}\n\t\t ${o(t.readFloatPixelsToFloat32Array.toString())}\n\t\t ${o(t.updateMaxTexSize.toString())}\n\t\t ${o(t._setupOutputTexture.toString())}\n\t\t ${o(t.detachTextureCache.toString())}\n\t\t ${o(t.setUniform1f.toString())}\n\t\t ${o(t.setUniform1i.toString())}\n\t\t ${o(t.setUniform2f.toString())}\n\t\t ${o(t.setUniform2fv.toString())}\n\t\t ${o(t.setUniform2iv.toString())}\n\t\t ${o(t.setUniform3fv.toString())}\n\t\t ${o(t.setUniform3iv.toString())}\n\t\t getReturnTextureType() { return "${t.getReturnTextureType()}"; }\n };\n return kernelRunShortcut(new ${e||"Kernel"}());\n };`}}},{"../../kernel-run-shortcut":62,"../../utils":65}],53:[function(t,e,r){const{GLKernel:n}=t("../gl-kernel"),{FunctionBuilder:i}=t("../function-builder"),{WebGLFunctionNode:o}=t("./function-node"),{utils:a}=t("../../utils"),{Texture:s}=t("../../texture"),u=t("../../plugins/triangle-noise"),{fragmentShader:l}=t("./fragment-shader"),{vertexShader:c}=t("./vertex-shader"),{webGLKernelString:h}=t("./kernel-string");let p=null,f=null,d=null,m=null,g=null;const v=[u],_=[],y={};e.exports={WebGLKernel:class extends n{static get isSupported(){return null!==p?p:(this.setupFeatureChecks(),p=this.isContextMatch(d))}static setupFeatureChecks(){"undefined"!=typeof document?f=document.createElement("canvas"):"undefined"!=typeof OffscreenCanvas&&(f=new OffscreenCanvas(0,0)),f&&(d=f.getContext("webgl")||f.getContext("experimental-webgl"))&&d.getExtension&&(m={OES_texture_float:d.getExtension("OES_texture_float"),OES_texture_float_linear:d.getExtension("OES_texture_float_linear"),OES_element_index_uint:d.getExtension("OES_element_index_uint"),WEBGL_draw_buffers:d.getExtension("WEBGL_draw_buffers")},g=this.getFeatures())}static isContextMatch(t){return"undefined"!=typeof WebGLRenderingContext&&t instanceof WebGLRenderingContext}static getFeatures(){const t=this.getIsDrawBuffers();return Object.freeze({isFloatRead:this.getIsFloatRead(),isIntegerDivisionAccurate:this.getIsIntegerDivisionAccurate(),isTextureFloat:this.getIsTextureFloat(),isDrawBuffers:t,kernelMap:t,channelCount:this.getChannelCount()})}static getIsTextureFloat(){return Boolean(m.OES_texture_float)}static getIsDrawBuffers(){return Boolean(m.WEBGL_draw_buffers)}static getChannelCount(){return m.WEBGL_draw_buffers?m.WEBGL_draw_buffers.MAX_DRAW_BUFFERS_WEBGL:1}static get testCanvas(){return f}static get testContext(){return d}static get features(){return g}static get fragmentShader(){return l}static get vertexShader(){return c}constructor(t,e){super(t,e),this.textureCache={},this.threadDim={},this.programUniformLocationCache={},this.framebuffer=null,this.buffer=null,this.program=null,this.pipeline=e.pipeline,this.endianness=a.systemEndianness(),this.extensions={},this.subKernelOutputTextures=null,this.argumentsLength=0,this.constantsLength=0,this.compiledFragmentShader=null,this.compiledVertexShader=null,this.fragShader=null,this.vertShader=null,this.drawBuffersMap=null,this.outputTexture=null,this.maxTexSize=null,this.uniform1fCache={},this.uniform1iCache={},this.uniform2fCache={},this.uniform2fvCache={},this.uniform2ivCache={},this.uniform3fvCache={},this.uniform3ivCache={},this.mergeSettings(t.settings||e)}initCanvas(){if("undefined"!=typeof document){const t=document.createElement("canvas");return t.width=2,t.height=2,t}if("undefined"!=typeof OffscreenCanvas)return new OffscreenCanvas(0,0)}initContext(){const t={alpha:!1,depth:!1,antialias:!1};return this.canvas.getContext("webgl",t)||this.canvas.getContext("experimental-webgl",t)}initPlugins(t){const e=[],{source:r}=this;if("string"==typeof r)for(let t=0;tt===n.name)&&e.push(n)}return e}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(){if(!this.validate)return void(this.texSize=a.dimToTexSize({floatTextures:this.optimizeFloatMemory,floatOutput:"single"===this.precision},this.output,!0));const{features:t}=this.constructor;if(!0===this.optimizeFloatMemory&&!t.isTextureFloat)throw new Error("Float textures are not supported");if("single"===this.precision&&!0!==this.floatOutputForce&&!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!==arguments.length)throw new Error("Auto output only supported for kernels with only one input");const t=a.getVariableType(arguments[0]);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=arguments[0].output}}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.dimToTexSize({floatTextures:this.floatTextures,floatOutput:"single"===this.precision},this.output,!0)}updateMaxTexSize(){const{texSize:t,canvas:e}=this;if(null===this.maxTexSize){let r=_.indexOf(e);-1===r&&(r=_.length,_.push(e),y[r]=[t[0],t[1]]),this.maxTexSize=y[r]}this.maxTexSize[0]g.channelCount)throw new Error("Too many channels!");return this.translatedSource=e}build(){this.initExtensions(),this.validateSettings(),this.setupConstants(),this.setupArguments(arguments),this.updateMaxTexSize(),this.translateSource(),this.pickRenderStrategy();const t=this.texSize,e=this.context,r=this.canvas;e.enable(e.SCISSOR_TEST),this.pipeline&&this.precision,e.viewport(0,0,this.maxTexSize[0],this.maxTexSize[1]),r.width=this.maxTexSize[0],r.height=this.maxTexSize[1];const n=this.threadDim=Array.from(this.output);for(;n.length<3;)n.push(1);const i=this.getVertexShader(arguments),o=e.createShader(e.VERTEX_SHADER);e.shaderSource(o,i),e.compileShader(o),this.vertShader=o;const s=this.getFragmentShader(arguments),u=e.createShader(e.FRAGMENT_SHADER);if(e.shaderSource(u,s),e.compileShader(u),this.fragShader=u,this.debug&&(console.log("GLSL Shader Output:"),console.log(s)),!e.getShaderParameter(o,e.COMPILE_STATUS))throw new Error("Error compiling vertex shader: "+e.getShaderInfoLog(o));if(!e.getShaderParameter(u,e.COMPILE_STATUS))throw new Error("Error compiling fragment shader: "+e.getShaderInfoLog(u));const l=this.program=e.createProgram();e.attachShader(l,o),e.attachShader(l,u),e.linkProgram(l),this.framebuffer=e.createFramebuffer(),this.framebuffer.width=t[0],this.framebuffer.height=t[1];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?e.bindBuffer(e.ARRAY_BUFFER,f):(f=this.buffer=e.createBuffer(),e.bindBuffer(e.ARRAY_BUFFER,f),e.bufferData(e.ARRAY_BUFFER,c.byteLength+h.byteLength,e.STATIC_DRAW)),e.bufferSubData(e.ARRAY_BUFFER,0,c),e.bufferSubData(e.ARRAY_BUFFER,p,h);const d=e.getAttribLocation(this.program,"aPos");e.enableVertexAttribArray(d),e.vertexAttribPointer(d,2,e.FLOAT,!1,0,0);const m=e.getAttribLocation(this.program,"aTexCoord");e.enableVertexAttribArray(m),e.vertexAttribPointer(m,2,e.FLOAT,!1,0,p),e.bindFramebuffer(e.FRAMEBUFFER,this.framebuffer);for(let t in this.constants){const r=this.constants[t],n=a.getVariableType(r);"Float"!==n&&"Integer"!==n&&(e.useProgram(this.program),this.addConstant(this.constants[t],n,t))}this.immutable||(this._setupOutputTexture(),null!==this.subKernels&&this.subKernels.length>0&&this._setupSubOutputTextures(this.subKernels.length))}translateSource(){const t=i.fromKernel(this,o,{fixIntegerDivisionAccuracy:this.fixIntegerDivisionAccuracy});this.translatedSource=t.getPrototypeString("kernel"),this.graphical||this.returnType||(this.returnType=t.getKernelResultType())}run(){null===this.program&&this.build.apply(this,arguments);const t=this.argumentNames,e=this.argumentTypes,r=this.texSize,n=this.context;n.useProgram(this.program),n.scissor(0,0,r[0],r[1]),this.hardcodeConstants||(this.setUniform3iv("uOutputDim",this.threadDim),this.setUniform2iv("uTexSize",r)),this.setUniform2f("ratio",r[0]/this.maxTexSize[0],r[1]/this.maxTexSize[1]),this.argumentsLength=0;for(let r=0;rt.source&&this.source.match(t.functionMatch)?t.source:"").join("\n"):"\n"}_getConstantsString(){const t=[],{threadDim:e,texSize:r}=this;return this.hardcodeConstants?t.push(`ivec3 uOutputDim = ivec3(${e[0]}, ${e[1]}, ${e[2]})`,`ivec2 uTexSize = ivec2(${r[0]}, ${r[1]})`):t.push("uniform ivec3 uOutputDim","uniform ivec2 uTexSize"),a.linesToString(t)}_getTextureCoordinate(){const t=this.subKernels;return null===t||t.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 div_with_int_check(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}":""}_getMainArgumentsString(t){const e=[],{argumentTypes:r,argumentNames:n,hardcodeConstants:i,optimizeFloatMemory:o,precision:s}=this;for(let u=0;u{if(e.hasOwnProperty(r))return e[r];throw`unhandled artifact ${r}`})}getFragmentShader(t){return null!==this.compiledFragmentShader?this.compiledFragmentShader:this.compiledFragmentShader=this.replaceArtifacts(this.constructor.fragmentShader,this._getFragShaderArtifactMap(t))}getVertexShader(t){return null!==this.compiledVertexShader?this.compiledVertexShader:this.compiledVertexShader=this.constructor.vertexShader}toString(){return h(this)}destroy(t){this.outputTexture&&this.context.deleteTexture(this.outputTexture),this.buffer&&this.context.deleteBuffer(this.buffer),this.framebuffer&&this.context.deleteFramebuffer(this.framebuffer),this.vertShader&&this.context.deleteShader(this.vertShader),this.fragShader&&this.context.deleteShader(this.fragShader),this.program&&this.context.deleteProgram(this.program);const e=Object.keys(this.textureCache);for(let t=0;t=0&&(_[t]=null,y[t]=null)}this.destroyExtensions(),delete this.context,delete this.canvas}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(t){const e=t.getExtension("WEBGL_lose_context");e&&e.loseContext()}toJSON(){const t=super.toJSON();return t.functionNodes=i.fromKernel(this,o).toJSON(),t}}}},{"../../plugins/triangle-noise":63,"../../texture":64,"../../utils":65,"../function-builder":45,"../gl-kernel":47,"./fragment-shader":50,"./function-node":51,"./kernel-string":52,"./vertex-shader":54}],54:[function(t,e,r){e.exports={vertexShader:"precision highp float;\nprecision highp int;\nprecision highp sampler2D;\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}"}},{}],55:[function(t,e,r){e.exports={fragmentShader:"#version 300 es\n__HEADER__;\nprecision highp float;\nprecision highp int;\nprecision highp sampler2D;\n\nconst int LOOP_MAX = __LOOP_MAX__;\n\n__PLUGINS__;\n__CONSTANTS__;\n\nin vec2 vTexCoord;\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\tint channel = integerMod(index, 4);\n return texel[channel] * 255.0;\n}\n\nvec4 encode32(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// 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 ivec3 xyz = ivec3(x, y, z);\n int index = xyz.x + texDim.x * (xyz.y + texDim.y * xyz.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 ivec3 xyz = ivec3(x, y, z);\n int index = xyz.x + (texDim.x * (xyz.y + (texDim.y * xyz.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 ivec3 xyz = ivec3(x, y, z);\n int index = xyz.x + (texDim.x * (xyz.y + (texDim.y * xyz.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 ivec3 xyz = ivec3(x, y, z);\n int index = xyz.x + (texDim.x * (xyz.y + (texDim.y * xyz.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 ivec3 xyz = ivec3(x, y, z);\n int index = xyz.x + texDim.x * (xyz.y + texDim.y * xyz.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 ivec3 xyz = ivec3(x, y, z);\n int index = xyz.x + texDim.x * (xyz.y + texDim.y * xyz.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\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\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 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\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}"}},{}],56:[function(t,e,r){const{WebGLFunctionNode:n}=t("../web-gl/function-node");e.exports={WebGL2FunctionNode:class extends n{astIdentifierExpression(t,e){if("Identifier"!==t.type)throw this.astErrorOutput("IdentifierExpression - not an Identifier",t);switch(t.name){case"Infinity":e.push("intBitsToFloat(2139095039)");break;default:const r=this.getKernelArgumentName(t.name);r?e.push(`user_${r}`):e.push(`user_${t.name}`)}return e}}}},{"../web-gl/function-node":51}],57:[function(t,e,r){const{WebGLKernel:n}=t("../web-gl/kernel"),{WebGL2FunctionNode:i}=t("./function-node"),{FunctionBuilder:o}=t("../function-builder"),{utils:a}=t("../../utils"),{Texture:s}=t("../../texture"),{fragmentShader:u}=t("./fragment-shader"),{vertexShader:l}=t("./vertex-shader");let c=null,h=null,p=null,f=null,d=null;e.exports={WebGL2Kernel:class extends n{static get isSupported(){return null!==c?c:(this.setupFeatureChecks(),c=this.isContextMatch(p))}static setupFeatureChecks(){"undefined"!=typeof document?h=document.createElement("canvas"):"undefined"!=typeof OffscreenCanvas&&(h=new OffscreenCanvas(0,0)),h&&(p=h.getContext("webgl2"))&&p.getExtension&&(f={EXT_color_buffer_float:p.getExtension("EXT_color_buffer_float"),OES_texture_float_linear:p.getExtension("OES_texture_float_linear")},d=this.getFeatures())}static isContextMatch(t){return"undefined"!=typeof WebGL2RenderingContext&&t instanceof WebGL2RenderingContext}static getFeatures(){return Object.freeze({isFloatRead:this.getIsFloatRead(),isIntegerDivisionAccurate:this.getIsIntegerDivisionAccurate(),kernelMap:!0,isTextureFloat:!0})}static getIsTextureFloat(){return!0}static getIsIntegerDivisionAccurate(){return super.getIsIntegerDivisionAccurate()}static get testCanvas(){return h}static get testContext(){return p}static get features(){return d}static get fragmentShader(){return u}static get vertexShader(){return l}initContext(){return this.canvas.getContext("webgl2",{alpha:!1,depth:!1,antialias:!1})}initExtensions(){this.extensions={EXT_color_buffer_float:this.context.getExtension("EXT_color_buffer_float"),OES_texture_float_linear:this.context.getExtension("OES_texture_float_linear")}}validateSettings(){if(!this.validate)return void(this.texSize=a.dimToTexSize({floatTextures:this.optimizeFloatMemory,floatOutput:"single"===this.precision},this.output,!0));const t=this.constructor.features;if("single"===this.precision&&!0!==this.floatOutputForce&&!t.isFloatRead)throw new Error("Float texture outputs are not supported");if(this.graphical||null!==this.precision||(this.precision=t.isFloatRead?"single":"unsigned"),null===this.fixIntegerDivisionAccuracy?this.fixIntegerDivisionAccuracy=!t.isIntegerDivisionAccurate:this.fixIntegerDivisionAccuracy&&t.isIntegerDivisionAccurate&&(this.fixIntegerDivisionAccuracy=!1),this.checkOutput(),!this.output||0===this.output.length){if(1!==arguments.length)throw new Error("Auto output only supported for kernels with only one input");const t=a.getVariableType(arguments[0]);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=arguments[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"single"===this.precision&&(console.warn("Cannot use graphical mode and single precision at the same time"),this.precision="unsigned"),void(this.texSize=a.clone(this.output))}!this.graphical&&null===this.precision&&t.isTextureFloat&&(this.precision="single"),this.texSize=a.dimToTexSize({floatTextures:!this.optimizeFloatMemory,floatOutput:"single"===this.precision},this.output,!0),("single"===this.precision||this.floatOutputForce)&&this.context.getExtension("EXT_color_buffer_float")}translateSource(){const t=o.fromKernel(this,i,{fixIntegerDivisionAccuracy:this.fixIntegerDivisionAccuracy});this.translatedSource=t.getPrototypeString("kernel"),this.graphical||this.returnType||(this.returnType=t.getKernelResultType())}run(){null===this.program&&this.build.apply(this,arguments);const{argumentNames:t,argumentTypes:e,texSize:r}=this,n=this.context;n.useProgram(this.program),n.scissor(0,0,r[0],r[1]),this.hardcodeConstants||(this.setUniform3iv("uOutputDim",new Int32Array(this.threadDim)),this.setUniform2iv("uTexSize",r)),this.setUniform2f("ratio",r[0]/this.maxTexSize[0],r[1]/this.maxTexSize[1]),this.argumentsLength=0;for(let r=0;rt.isSupported)}static get isKernelMapSupported(){return c.some(t=>t.isSupported&&t.features.kernelMap)}static get isOffscreenCanvasSupported(){return"undefined"!=typeof Worker&&"undefined"!=typeof OffscreenCanvas||"undefined"!=typeof importScripts}static get isWebGLSupported(){return u.isSupported}static get isWebGL2Supported(){return s.isSupported}static get isHeadlessGLSupported(){return a.isSupported}static get isCanvasSupported(){return"undefined"!=typeof HTMLCanvasElement}static get isGPUHTMLImageArraySupported(){return s.isSupported}static get isSinglePrecisionSupported(){return c.some(t=>t.isSupported&&t.features.isFloatRead&&t.features.isTextureFloat)}constructor(t){if(t=t||{},this.canvas=t.canvas||null,this.context=t.context||null,this.mode=t.mode,"dev"!==this.mode){if(this.Kernel=null,this.kernels=[],this.functions=[],this.nativeFunctions=[],this.chooseKernel(),t.functions)for(let e=0;e{const n=new o(t,r);return n.apply(n,e)}},d(e)||{}),a=l(new this.Kernel(t,r));return this.canvas||(this.canvas=a.canvas),this.context||(this.context=a.context),this.kernels.push(a),a}createKernelMap(){let t,e;if("function"==typeof arguments[arguments.length-2]?(t=arguments[arguments.length-2],e=arguments[arguments.length-1]):t=arguments[arguments.length-1],(!this.Kernel.isSupported||!this.Kernel.features.kernelMap)&&this.mode&&h.indexOf(this.mode)<0)throw new Error(`kernelMap not supported on ${this.Kernel.name}`);const r=this.createKernel(t,d(e));if(Array.isArray(arguments[0])){const t=arguments[0];for(let e=0;e0)throw new Error('Cannot call "addNativeFunction" after "createKernels" has been called.');r=r||{};const{argumentTypes:n,argumentNames:i}=this.Kernel.nativeFunctionArguments(e)||{};return this.nativeFunctions.push({name:t,source:e,settings:r,argumentTypes:n,argumentNames:i,returnType:r.returnType||this.Kernel.nativeFunctionReturnType(e)}),this}destroy(){setTimeout(()=>{for(let t=0;t{if("_"!==r[0]||"_"!==r[1])if("function"==typeof t[r])if("add"===r.substring(0,3)||"set"===r.substring(0,3))e[r]=function(){return t[r].apply(t,arguments),e};else if("requestFallback"===r){const n=t[r].bind(t);e[r]=(()=>{t=n()})}else e[r]=t[r].bind(t);else e.__defineGetter__(r,()=>t[r]),e.__defineSetter__(r,e=>{t[r]=e})}),e.kernel=t,e}}},{"./utils":65}],63:[function(t,e,r){e.exports={name:"triangle-noise-noise",onBeforeRun:t=>{t.setUniform1f("triangle_noise_seed",Math.random())},functionMatch:"Math.random()",functionReplace:"n4rand(vTexCoord)",functionReturnType:"Number",source:"\n\nuniform highp float triangle_noise_seed;\nhighp float triangle_noise_shift = 0.000001;\n\n//https://www.shadertoy.com/view/4t2SDh\n//note: uniformly distributed, normalized rand, [0;1[\nfloat nrand( vec2 n )\n{\n\treturn fract(sin(dot(n.xy, vec2(12.9898, 78.233)))* 43758.5453);\n}\n//note: remaps v to [0;1] in interval [a;b]\nfloat remap( float a, float b, float v )\n{\n\treturn clamp( (v-a) / (b-a), 0.0, 1.0 );\n}\n\nfloat n4rand( vec2 n )\n{\n\tfloat t = fract( triangle_noise_seed + triangle_noise_shift );\n\tfloat nrnd0 = nrand( n + 0.07*t );\n\tfloat nrnd1 = nrand( n + 0.11*t );\t\n\tfloat nrnd2 = nrand( n + 0.13*t );\n\tfloat nrnd3 = nrand( n + 0.17*t );\n\tfloat result = (nrnd0+nrnd1+nrnd2+nrnd3) / 4.0;\n\ttriangle_noise_shift = result + 0.000001;\n\treturn result;\n}"}},{}],64:[function(t,e,r){e.exports={Texture:class{constructor(t){const{texture:e,size:r,dimensions:n,output:i,context:o,gpu:a,type:s="NumberTexture"}=t;if(!i)throw new Error('settings property "output" required.');if(!o)throw new Error('settings property "context" required.');this.texture=e,this.size=r,this.dimensions=n,this.output=i,this.context=o,this.gpu=a,this.kernel=null,this.type=s}toArray(t){let{kernel:e}=this;if(e)return e(this);if(!(t=t||this.gpu))throw new Error('settings property "gpu" or argument required.');return e=t.createKernel(function(t){return t[this.thread.z][this.thread.y][this.thread.x]},{output:this.output,precision:this.getPrecision(),optimizeFloatMemory:"MemoryOptimizedNumberTexture"===this.type}),this.kernel=e,e(this)}getPrecision(){switch(this.type){case"NumberTexture":return"unsigned";case"MemoryOptimizedNumberTexture":case"ArrayTexture(1)":case"ArrayTexture(2)":case"ArrayTexture(3)":case"ArrayTexture(4)":return"single";default:throw new Error("Unknown texture type")}}delete(){return this.context.deleteTexture(this.texture)}}}},{}],65:[function(t,e,r){const{Input:n}=t("./input"),{Texture:i}=t("./texture"),o=/function ([^(]*)/,a=/((\/\/.*$)|(\/\*[\s\S]*?\*\/))/gm,s=/([^\s,]+)/g,u={systemEndianness:()=>l,getSystemEndianness(){const t=new ArrayBuffer(4),e=new Uint32Array(t),r=new Uint8Array(t);if(e[0]=3735928559,239===r[0])return"LE";if(222===r[0])return"BE";throw new Error("unknown endianness")},isFunction:t=>"function"==typeof t,isFunctionString:t=>"string"==typeof t&&"function"===t.slice(0,"function".length).toLowerCase(),getFunctionNameFromString:t=>o.exec(t)[1].trim(),getFunctionBodyFromString:t=>t.substring(t.indexOf("{")+1,t.lastIndexOf("}")),getArgumentNamesFromString(t){const e=t.replace(a,"");let r=e.slice(e.indexOf("(")+1,e.indexOf(")")).match(s);return null===r&&(r=[]),r},clone(t){if(null===t||"object"!=typeof t||t.hasOwnProperty("isActiveClone"))return t;const e=t.constructor();for(let r in t)Object.prototype.hasOwnProperty.call(t,r)&&(t.isActiveClone=null,e[r]=u.clone(t[r]),delete t.isActiveClone);return e},isArray:t=>!isNaN(t.length),getVariableType:t=>u.isArray(t)?"IMG"===t[0].nodeName?"HTMLImageArray":"Array":"number"==typeof t?Number.isInteger(t)?"Integer":"Float":t instanceof i?t.type:t instanceof n?"Input":"IMG"===t.nodeName?"HTMLImage":"Unknown",dimToTexSize(t,e,r){let[n,i,o]=e,a=(n||1)*(i||1)*(o||1);return!t.floatTextures||r&&"single"!==t.precision||(n=a=Math.ceil(a/4)),i>1&&n*i===a?new Int32Array([n,i]):u.closestSquareDimensions(a)},closestSquareDimensions(t){const e=Math.sqrt(t);let r=Math.ceil(e),n=Math.floor(e);for(;r*nMath.floor((t+e-1)/e)*e,getDimensions(t,e){let r;if(u.isArray(t)){const e=[];let n=t;for(;u.isArray(n);)e.push(n.length),n=n[0];r=e.reverse()}else if(t instanceof i)r=t.output;else{if(!(t instanceof n))throw new Error(`Unknown dimensions of ${t}`);r=t.size}if(e)for(r=Array.from(r);r.length<3;)r.push(1);return new Int32Array(r)},flatten2dArrayTo(t,e){let r=0;for(let n=0;nt.length>0?t.join(";\n")+";\n":"\n",warnDeprecated(t,e,r){r?console.warn(`You are using a deprecated ${t} "${e}". It has been replaced with "${r}". Fixing, but please upgrade as it will soon be removed.`):console.warn(`You are using a deprecated ${t} "${e}". It has been removed. Fixing, but please upgrade as it will soon be removed.`)},functionToIFunction(t,e){if(e=e||{},"string"!=typeof t&&"function"!=typeof t)throw new Error("source not a string or function");const r="string"==typeof t?t:t.toString();let n=[];return{source:r,argumentTypes:n=Array.isArray(e.argumentTypes)?e.argumentTypes:"object"==typeof e.argumentTypes?u.getArgumentNamesFromString(r).map(t=>e.argumentTypes[t])||[]:e.argumentTypes||[],returnType:e.returnType||null}}},l=u.getSystemEndianness();e.exports={utils:u}},{"./input":61,"./texture":64}],66:[function(t,e,r){(function(r){"use strict";function n(t,e){if(t===e)return 0;for(var r=t.length,n=e.length,i=0,o=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],!_(t[u],e[u],r,n))return!1;return!0}(t,e,r,a))}return r?t===e:t==e}function y(t){return"[object Arguments]"==Object.prototype.toString.call(t)}function b(t,e){if(!t||!e)return!1;if("[object RegExp]"==Object.prototype.toString.call(e))return e.test(t);try{if(t instanceof e)return!0}catch(t){}return!Error.isPrototypeOf(e)&&!0===e.call({},t)}function x(t,e,r,n){var i;if("function"!=typeof e)throw new TypeError('"block" argument must be a function');"string"==typeof r&&(n=r,r=null),i=function(t){var e;try{t()}catch(t){e=t}return e}(e),n=(r&&r.name?" ("+r.name+").":".")+(n?" "+n:"."),t&&!i&&g(i,r,"Missing expected exception"+n);var a="string"==typeof n,s=!t&&o.isError(i),u=!t&&i&&!r;if((s&&a&&b(i,r)||u)&&g(i,r,"Got unwanted exception"+n),t&&i&&r&&!b(i,r)||!t&&i)throw i}h.AssertionError=function(t){var e;this.name="AssertionError",this.actual=t.actual,this.expected=t.expected,this.operator=t.operator,t.message?(this.message=t.message,this.generatedMessage=!1):(this.message=d(m((e=this).actual),128)+" "+e.operator+" "+d(m(e.expected),128),this.generatedMessage=!0);var r=t.stackStartFunction||g;if(Error.captureStackTrace)Error.captureStackTrace(this,r);else{var n=new Error;if(n.stack){var i=n.stack,o=f(r),a=i.indexOf("\n"+o);if(a>=0){var s=i.indexOf("\n",a+1);i=i.substring(s+1)}this.stack=i}}},o.inherits(h.AssertionError,Error),h.fail=g,h.ok=v,h.equal=function(t,e,r){t!=e&&g(t,e,r,"==",h.equal)},h.notEqual=function(t,e,r){t==e&&g(t,e,r,"!=",h.notEqual)},h.deepEqual=function(t,e,r){_(t,e,!1)||g(t,e,r,"deepEqual",h.deepEqual)},h.deepStrictEqual=function(t,e,r){_(t,e,!0)||g(t,e,r,"deepStrictEqual",h.deepStrictEqual)},h.notDeepEqual=function(t,e,r){_(t,e,!1)&&g(t,e,r,"notDeepEqual",h.notDeepEqual)},h.notDeepStrictEqual=function t(e,r,n){_(e,r,!0)&&g(e,r,n,"notDeepStrictEqual",t)},h.strictEqual=function(t,e,r){t!==e&&g(t,e,r,"===",h.strictEqual)},h.notStrictEqual=function(t,e,r){t===e&&g(t,e,r,"!==",h.notStrictEqual)},h.throws=function(t,e,r){x(!0,t,e,r)},h.doesNotThrow=function(t,e,r){x(!1,t,e,r)},h.ifError=function(t){if(t)throw t};var w=Object.keys||function(t){var e=[];for(var r in t)a.call(t,r)&&e.push(r);return e}}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"util/":69}],67:[function(t,e,r){"function"==typeof Object.create?e.exports=function(t,e){t.super_=e,t.prototype=Object.create(e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}})}:e.exports=function(t,e){t.super_=e;var r=function(){};r.prototype=e.prototype,t.prototype=new r,t.prototype.constructor=t}},{}],68:[function(t,e,r){e.exports=function(t){return t&&"object"==typeof t&&"function"==typeof t.copy&&"function"==typeof t.fill&&"function"==typeof t.readUInt8}},{}],69:[function(t,e,r){(function(e,n){var i=/%[sdj%]/g;r.format=function(t){if(!v(t)){for(var e=[],r=0;r=o)return t;switch(t){case"%s":return String(n[r++]);case"%d":return Number(n[r++]);case"%j":try{return JSON.stringify(n[r++])}catch(t){return"[Circular]"}default:return t}}),u=n[r];r=3&&(n.depth=arguments[2]),arguments.length>=4&&(n.colors=arguments[3]),d(e)?n.showHidden=e:e&&r._extend(n,e),_(n.showHidden)&&(n.showHidden=!1),_(n.depth)&&(n.depth=2),_(n.colors)&&(n.colors=!1),_(n.customInspect)&&(n.customInspect=!0),n.colors&&(n.stylize=u),c(n,t,n.depth)}function u(t,e){var r=s.styles[e];return r?"["+s.colors[r][0]+"m"+t+"["+s.colors[r][1]+"m":t}function l(t,e){return t}function c(t,e,n){if(t.customInspect&&e&&E(e.inspect)&&e.inspect!==r.inspect&&(!e.constructor||e.constructor.prototype!==e)){var i=e.inspect(n,t);return v(i)||(i=c(t,i,n)),i}var o=function(t,e){if(_(e))return t.stylize("undefined","undefined");if(v(e)){var r="'"+JSON.stringify(e).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return t.stylize(r,"string")}if(g(e))return t.stylize(""+e,"number");if(d(e))return t.stylize(""+e,"boolean");if(m(e))return t.stylize("null","null")}(t,e);if(o)return o;var a=Object.keys(e),s=function(t){var e={};return t.forEach(function(t,r){e[t]=!0}),e}(a);if(t.showHidden&&(a=Object.getOwnPropertyNames(e)),w(e)&&(a.indexOf("message")>=0||a.indexOf("description")>=0))return h(e);if(0===a.length){if(E(e)){var u=e.name?": "+e.name:"";return t.stylize("[Function"+u+"]","special")}if(y(e))return t.stylize(RegExp.prototype.toString.call(e),"regexp");if(x(e))return t.stylize(Date.prototype.toString.call(e),"date");if(w(e))return h(e)}var l,b="",k=!1,T=["{","}"];(f(e)&&(k=!0,T=["[","]"]),E(e))&&(b=" [Function"+(e.name?": "+e.name:"")+"]");return y(e)&&(b=" "+RegExp.prototype.toString.call(e)),x(e)&&(b=" "+Date.prototype.toUTCString.call(e)),w(e)&&(b=" "+h(e)),0!==a.length||k&&0!=e.length?n<0?y(e)?t.stylize(RegExp.prototype.toString.call(e),"regexp"):t.stylize("[Object]","special"):(t.seen.push(e),l=k?function(t,e,r,n,i){for(var o=[],a=0,s=e.length;a=0&&0,t+e.replace(/\u001b\[\d\d?m/g,"").length+1},0)>60)return r[0]+(""===e?"":e+"\n ")+" "+t.join(",\n ")+" "+r[1];return r[0]+e+" "+t.join(", ")+" "+r[1]}(l,b,T)):T[0]+b+T[1]}function h(t){return"["+Error.prototype.toString.call(t)+"]"}function p(t,e,r,n,i,o){var a,s,u;if((u=Object.getOwnPropertyDescriptor(e,i)||{value:e[i]}).get?s=u.set?t.stylize("[Getter/Setter]","special"):t.stylize("[Getter]","special"):u.set&&(s=t.stylize("[Setter]","special")),A(n,i)||(a="["+i+"]"),s||(t.seen.indexOf(u.value)<0?(s=m(r)?c(t,u.value,null):c(t,u.value,r-1)).indexOf("\n")>-1&&(s=o?s.split("\n").map(function(t){return" "+t}).join("\n").substr(2):"\n"+s.split("\n").map(function(t){return" "+t}).join("\n")):s=t.stylize("[Circular]","special")),_(a)){if(o&&i.match(/^\d+$/))return s;(a=JSON.stringify(""+i)).match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(a=a.substr(1,a.length-2),a=t.stylize(a,"name")):(a=a.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),a=t.stylize(a,"string"))}return a+": "+s}function f(t){return Array.isArray(t)}function d(t){return"boolean"==typeof t}function m(t){return null===t}function g(t){return"number"==typeof t}function v(t){return"string"==typeof t}function _(t){return void 0===t}function y(t){return b(t)&&"[object RegExp]"===k(t)}function b(t){return"object"==typeof t&&null!==t}function x(t){return b(t)&&"[object Date]"===k(t)}function w(t){return b(t)&&("[object Error]"===k(t)||t instanceof Error)}function E(t){return"function"==typeof t}function k(t){return Object.prototype.toString.call(t)}function T(t){return t<10?"0"+t.toString(10):t.toString(10)}r.debuglog=function(t){if(_(o)&&(o=e.env.NODE_DEBUG||""),t=t.toUpperCase(),!a[t])if(new RegExp("\\b"+t+"\\b","i").test(o)){var n=e.pid;a[t]=function(){var e=r.format.apply(r,arguments);console.error("%s %d: %s",t,n,e)}}else a[t]=function(){};return a[t]},r.inspect=s,s.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]},s.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(t){return null==t},r.isNumber=g,r.isString=v,r.isSymbol=function(t){return"symbol"==typeof t},r.isUndefined=_,r.isRegExp=y,r.isObject=b,r.isDate=x,r.isError=w,r.isFunction=E,r.isPrimitive=function(t){return null===t||"boolean"==typeof t||"number"==typeof t||"string"==typeof t||"symbol"==typeof t||void 0===t},r.isBuffer=t("./support/isBuffer");var S=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function A(t,e){return Object.prototype.hasOwnProperty.call(t,e)}r.log=function(){var t,e;console.log("%s - %s",(t=new Date,e=[T(t.getHours()),T(t.getMinutes()),T(t.getSeconds())].join(":"),[t.getDate(),S[t.getMonth()],e].join(" ")),r.format.apply(r,arguments))},r.inherits=t("inherits"),r._extend=function(t,e){if(!e||!b(e))return t;for(var r=Object.keys(e),n=r.length;n--;)t[r[n]]=e[r[n]];return t}}).call(this,t("_process"),"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"./support/isBuffer":68,_process:139,inherits:67}],70:[function(t,e,r){(function(e,n){"use strict";var i=t("assert"),o=t("pako/lib/zlib/zstream"),a=t("pako/lib/zlib/deflate.js"),s=t("pako/lib/zlib/inflate.js"),u=t("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(t){if("number"!=typeof t||tr.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=t,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?a.deflateEnd(this.strm):this.mode!==r.INFLATE&&this.mode!==r.GUNZIP&&this.mode!==r.INFLATERAW&&this.mode!==r.UNZIP||s.inflateEnd(this.strm),this.mode=r.NONE,this.dictionary=null)},c.prototype.write=function(t,e,r,n,i,o,a){return this._write(!0,t,e,r,n,i,o,a)},c.prototype.writeSync=function(t,e,r,n,i,o,a){return this._write(!1,t,e,r,n,i,o,a)},c.prototype._write=function(t,o,a,s,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===o,"must provide flush value"),this.write_in_progress=!0,o!==r.Z_NO_FLUSH&&o!==r.Z_PARTIAL_FLUSH&&o!==r.Z_SYNC_FLUSH&&o!==r.Z_FULL_FLUSH&&o!==r.Z_FINISH&&o!==r.Z_BLOCK)throw new Error("Invalid flush value");if(null==a&&(a=n.alloc(0),u=0,s=0),this.strm.avail_in=u,this.strm.input=a,this.strm.next_in=s,this.strm.avail_out=h,this.strm.output=l,this.strm.next_out=c,this.flush=o,!t)return this._process(),this._checkError()?this._afterSync():void 0;var p=this;return e.nextTick(function(){p._process(),p._after()}),this},c.prototype._afterSync=function(){var t=this.strm.avail_out,e=this.strm.avail_in;return this.write_in_progress=!1,[e,t]},c.prototype._process=function(){var t=null;switch(this.mode){case r.DEFLATE:case r.GZIP:case r.DEFLATERAW:this.err=a.deflate(this.strm,this.flush);break;case r.UNZIP:switch(this.strm.avail_in>0&&(t=this.strm.next_in),this.gzip_id_bytes_read){case 0:if(null===t)break;if(31!==this.strm.input[t]){this.mode=r.INFLATE;break}if(this.gzip_id_bytes_read=1,t++,1===this.strm.avail_in)break;case 1:if(null===t)break;139===this.strm.input[t]?(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=s.inflate(this.strm,this.flush),this.err===r.Z_NEED_DICT&&this.dictionary&&(this.err=s.inflateSetDictionary(this.strm,this.dictionary),this.err===r.Z_OK?this.err=s.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=s.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 t=this.strm.avail_out,e=this.strm.avail_in;this.write_in_progress=!1,this.callback(e,t),this.pending_close&&this.close()}},c.prototype._error=function(t){this.strm.msg&&(t=this.strm.msg),this.onerror(t,this.err),this.write_in_progress=!1,this.pending_close&&this.close()},c.prototype.init=function(t,e,n,o,a){i(4===arguments.length||5===arguments.length,"init(windowBits, level, memLevel, strategy, [dictionary])"),i(t>=8&&t<=15,"invalid windowBits"),i(e>=-1&&e<=9,"invalid compression level"),i(n>=1&&n<=9,"invalid memlevel"),i(o===r.Z_FILTERED||o===r.Z_HUFFMAN_ONLY||o===r.Z_RLE||o===r.Z_FIXED||o===r.Z_DEFAULT_STRATEGY,"invalid strategy"),this._init(e,t,n,o,a),this._setDictionary()},c.prototype.params=function(){throw new Error("deflateParams Not supported")},c.prototype.reset=function(){this._reset(),this._setDictionary()},c.prototype._init=function(t,e,n,i,u){switch(this.level=t,this.windowBits=e,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 o,this.mode){case r.DEFLATE:case r.GZIP:case r.DEFLATERAW:this.err=a.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=s.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=a.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=a.deflateReset(this.strm);break;case r.INFLATE:case r.INFLATERAW:case r.GUNZIP:this.err=s.inflateReset(this.strm)}this.err!==r.Z_OK&&this._error("Failed to reset stream")},r.Zlib=c}).call(this,t("_process"),t("buffer").Buffer)},{_process:139,assert:66,buffer:73,"pako/lib/zlib/constants":77,"pako/lib/zlib/deflate.js":79,"pako/lib/zlib/inflate.js":81,"pako/lib/zlib/zstream":85}],71:[function(t,e,r){(function(e){"use strict";var n=t("buffer").Buffer,i=t("stream").Transform,o=t("./binding"),a=t("util"),s=t("assert").ok,u=t("buffer").kMaxLength,l="Cannot create final Buffer. It would be larger than 0x"+u.toString(16)+" bytes";o.Z_MIN_WINDOWBITS=8,o.Z_MAX_WINDOWBITS=15,o.Z_DEFAULT_WINDOWBITS=15,o.Z_MIN_CHUNK=64,o.Z_MAX_CHUNK=1/0,o.Z_DEFAULT_CHUNK=16384,o.Z_MIN_MEMLEVEL=1,o.Z_MAX_MEMLEVEL=9,o.Z_DEFAULT_MEMLEVEL=8,o.Z_MIN_LEVEL=-1,o.Z_MAX_LEVEL=9,o.Z_DEFAULT_LEVEL=o.Z_DEFAULT_COMPRESSION;for(var c=Object.keys(o),h=0;h=u?a=new RangeError(l):e=n.concat(i,o),i=[],t.close(),r(a,e)}t.on("error",function(e){t.removeListener("end",s),t.removeListener("readable",a),r(e)}),t.on("end",s),t.end(e),a()}function _(t,e){if("string"==typeof e&&(e=n.from(e)),!n.isBuffer(e))throw new TypeError("Not a string or buffer");var r=t._finishFlushFlag;return t._processChunk(e,r)}function y(t){if(!(this instanceof y))return new y(t);A.call(this,t,o.DEFLATE)}function b(t){if(!(this instanceof b))return new b(t);A.call(this,t,o.INFLATE)}function x(t){if(!(this instanceof x))return new x(t);A.call(this,t,o.GZIP)}function w(t){if(!(this instanceof w))return new w(t);A.call(this,t,o.GUNZIP)}function E(t){if(!(this instanceof E))return new E(t);A.call(this,t,o.DEFLATERAW)}function k(t){if(!(this instanceof k))return new k(t);A.call(this,t,o.INFLATERAW)}function T(t){if(!(this instanceof T))return new T(t);A.call(this,t,o.UNZIP)}function S(t){return t===o.Z_NO_FLUSH||t===o.Z_PARTIAL_FLUSH||t===o.Z_SYNC_FLUSH||t===o.Z_FULL_FLUSH||t===o.Z_FINISH||t===o.Z_BLOCK}function A(t,e){var a=this;if(this._opts=t=t||{},this._chunkSize=t.chunkSize||r.Z_DEFAULT_CHUNK,i.call(this,t),t.flush&&!S(t.flush))throw new Error("Invalid flush flag: "+t.flush);if(t.finishFlush&&!S(t.finishFlush))throw new Error("Invalid flush flag: "+t.finishFlush);if(this._flushFlag=t.flush||o.Z_NO_FLUSH,this._finishFlushFlag=void 0!==t.finishFlush?t.finishFlush:o.Z_FINISH,t.chunkSize&&(t.chunkSizer.Z_MAX_CHUNK))throw new Error("Invalid chunk size: "+t.chunkSize);if(t.windowBits&&(t.windowBitsr.Z_MAX_WINDOWBITS))throw new Error("Invalid windowBits: "+t.windowBits);if(t.level&&(t.levelr.Z_MAX_LEVEL))throw new Error("Invalid compression level: "+t.level);if(t.memLevel&&(t.memLevelr.Z_MAX_MEMLEVEL))throw new Error("Invalid memLevel: "+t.memLevel);if(t.strategy&&t.strategy!=r.Z_FILTERED&&t.strategy!=r.Z_HUFFMAN_ONLY&&t.strategy!=r.Z_RLE&&t.strategy!=r.Z_FIXED&&t.strategy!=r.Z_DEFAULT_STRATEGY)throw new Error("Invalid strategy: "+t.strategy);if(t.dictionary&&!n.isBuffer(t.dictionary))throw new Error("Invalid dictionary: it should be a Buffer instance");this._handle=new o.Zlib(e);var s=this;this._hadError=!1,this._handle.onerror=function(t,e){C(s),s._hadError=!0;var n=new Error(t);n.errno=e,n.code=r.codes[e],s.emit("error",n)};var u=r.Z_DEFAULT_COMPRESSION;"number"==typeof t.level&&(u=t.level);var l=r.Z_DEFAULT_STRATEGY;"number"==typeof t.strategy&&(l=t.strategy),this._handle.init(t.windowBits||r.Z_DEFAULT_WINDOWBITS,u,t.memLevel||r.Z_DEFAULT_MEMLEVEL,l,t.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!a._handle},configurable:!0,enumerable:!0})}function C(t,r){r&&e.nextTick(r),t._handle&&(t._handle.close(),t._handle=null)}function R(t){t.emit("close")}Object.defineProperty(r,"codes",{enumerable:!0,value:Object.freeze(f),writable:!1}),r.Deflate=y,r.Inflate=b,r.Gzip=x,r.Gunzip=w,r.DeflateRaw=E,r.InflateRaw=k,r.Unzip=T,r.createDeflate=function(t){return new y(t)},r.createInflate=function(t){return new b(t)},r.createDeflateRaw=function(t){return new E(t)},r.createInflateRaw=function(t){return new k(t)},r.createGzip=function(t){return new x(t)},r.createGunzip=function(t){return new w(t)},r.createUnzip=function(t){return new T(t)},r.deflate=function(t,e,r){return"function"==typeof e&&(r=e,e={}),v(new y(e),t,r)},r.deflateSync=function(t,e){return _(new y(e),t)},r.gzip=function(t,e,r){return"function"==typeof e&&(r=e,e={}),v(new x(e),t,r)},r.gzipSync=function(t,e){return _(new x(e),t)},r.deflateRaw=function(t,e,r){return"function"==typeof e&&(r=e,e={}),v(new E(e),t,r)},r.deflateRawSync=function(t,e){return _(new E(e),t)},r.unzip=function(t,e,r){return"function"==typeof e&&(r=e,e={}),v(new T(e),t,r)},r.unzipSync=function(t,e){return _(new T(e),t)},r.inflate=function(t,e,r){return"function"==typeof e&&(r=e,e={}),v(new b(e),t,r)},r.inflateSync=function(t,e){return _(new b(e),t)},r.gunzip=function(t,e,r){return"function"==typeof e&&(r=e,e={}),v(new w(e),t,r)},r.gunzipSync=function(t,e){return _(new w(e),t)},r.inflateRaw=function(t,e,r){return"function"==typeof e&&(r=e,e={}),v(new k(e),t,r)},r.inflateRawSync=function(t,e){return _(new k(e),t)},a.inherits(A,i),A.prototype.params=function(t,n,i){if(tr.Z_MAX_LEVEL)throw new RangeError("Invalid compression level: "+t);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!==t||this._strategy!==n){var a=this;this.flush(o.Z_SYNC_FLUSH,function(){s(a._handle,"zlib binding closed"),a._handle.params(t,n),a._hadError||(a._level=t,a._strategy=n,i&&i())})}else e.nextTick(i)},A.prototype.reset=function(){return s(this._handle,"zlib binding closed"),this._handle.reset()},A.prototype._flush=function(t){this._transform(n.alloc(0),"",t)},A.prototype.flush=function(t,r){var i=this,a=this._writableState;("function"==typeof t||void 0===t&&!r)&&(r=t,t=o.Z_FULL_FLUSH),a.ended?r&&e.nextTick(r):a.ending?r&&this.once("end",r):a.needDrain?r&&this.once("drain",function(){return i.flush(t,r)}):(this._flushFlag=t,this.write(n.alloc(0),"",r))},A.prototype.close=function(t){C(this,t),e.nextTick(R,this)},A.prototype._transform=function(t,e,r){var i,a=this._writableState,s=(a.ending||a.ended)&&(!t||a.length===t.length);return null===t||n.isBuffer(t)?this._handle?(s?i=this._finishFlushFlag:(i=this._flushFlag,t.length>=a.length&&(this._flushFlag=this._opts.flush||o.Z_NO_FLUSH)),void this._processChunk(t,i,r)):r(new Error("zlib binding closed")):r(new Error("invalid input"))},A.prototype._processChunk=function(t,e,r){var i=t&&t.length,o=this._chunkSize-this._offset,a=0,c=this,h="function"==typeof r;if(!h){var p,f=[],d=0;this.on("error",function(t){p=t}),s(this._handle,"zlib binding closed");do{var m=this._handle.writeSync(e,t,a,i,this._buffer,this._offset,o)}while(!this._hadError&&_(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}s(this._handle,"zlib binding closed");var v=this._handle.write(e,t,a,i,this._buffer,this._offset,o);function _(u,l){if(this&&(this.buffer=null,this.callback=null),!c._hadError){var p=o-l;if(s(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)&&(o=c._chunkSize,c._offset=0,c._buffer=n.allocUnsafe(c._chunkSize)),0===l){if(a+=i-u,i=u,!h)return!0;var g=c._handle.write(e,t,a,i,c._buffer,c._offset,c._chunkSize);return g.callback=_,void(g.buffer=t)}if(!h)return!1;r()}}v.buffer=t,v.callback=_},a.inherits(y,A),a.inherits(b,A),a.inherits(x,A),a.inherits(w,A),a.inherits(E,A),a.inherits(k,A),a.inherits(T,A)}).call(this,t("_process"))},{"./binding":70,_process:139,assert:66,buffer:73,stream:190,util:200}],72:[function(t,e,r){arguments[4][4][0].apply(r,arguments)},{dup:4}],73:[function(t,e,r){"use strict";var n=t("base64-js"),i=t("ieee754");r.Buffer=s,r.SlowBuffer=function(t){+t!=t&&(t=0);return s.alloc(+t)},r.INSPECT_MAX_BYTES=50;var o=2147483647;function a(t){if(t>o)throw new RangeError("Invalid typed array length");var e=new Uint8Array(t);return e.__proto__=s.prototype,e}function s(t,e,r){if("number"==typeof t){if("string"==typeof e)throw new Error("If encoding is specified then the first argument must be a string");return c(t)}return u(t,e,r)}function u(t,e,r){if("number"==typeof t)throw new TypeError('"value" argument must not be a number');return U(t)?function(t,e,r){if(e<0||t.byteLength=o)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+o.toString(16)+" bytes");return 0|t}function f(t,e){if(s.isBuffer(t))return t.length;if(z(t)||U(t))return t.byteLength;"string"!=typeof t&&(t=""+t);var r=t.length;if(0===r)return 0;for(var n=!1;;)switch(e){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":case void 0:return O(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return N(t).length;default:if(n)return O(t).length;e=(""+e).toLowerCase(),n=!0}}function d(t,e,r){var n=t[e];t[e]=t[r],t[r]=n}function m(t,e,r,n,i){if(0===t.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:t.length-1),r<0&&(r=t.length+r),r>=t.length){if(i)return-1;r=t.length-1}else if(r<0){if(!i)return-1;r=0}if("string"==typeof e&&(e=s.from(e,n)),s.isBuffer(e))return 0===e.length?-1:g(t,e,r,n,i);if("number"==typeof e)return e&=255,"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(t,e,r):Uint8Array.prototype.lastIndexOf.call(t,e,r):g(t,[e],r,n,i);throw new TypeError("val must be string, number or Buffer")}function g(t,e,r,n,i){var o,a=1,s=t.length,u=e.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(t.length<2||e.length<2)return-1;a=2,s/=2,u/=2,r/=2}function l(t,e){return 1===a?t[e]:t.readUInt16BE(e*a)}if(i){var c=-1;for(o=r;os&&(r=s-u),o=r;o>=0;o--){for(var h=!0,p=0;pi&&(n=i):n=i;var o=e.length;if(o%2!=0)throw new TypeError("Invalid hex string");n>o/2&&(n=o/2);for(var a=0;a>8,i=r%256,o.push(i),o.push(n);return o}(e,t.length-r),t,r,n)}function E(t,e,r){return 0===e&&r===t.length?n.fromByteArray(t):n.fromByteArray(t.slice(e,r))}function k(t,e,r){r=Math.min(t.length,r);for(var n=[],i=e;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&(o=t[i+1]))&&(u=(31&l)<<6|63&o)>127&&(c=u);break;case 3:o=t[i+1],a=t[i+2],128==(192&o)&&128==(192&a)&&(u=(15&l)<<12|(63&o)<<6|63&a)>2047&&(u<55296||u>57343)&&(c=u);break;case 4:o=t[i+1],a=t[i+2],s=t[i+3],128==(192&o)&&128==(192&a)&&128==(192&s)&&(u=(15&l)<<18|(63&o)<<12|(63&a)<<6|63&s)>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(t){var e=t.length;if(e<=T)return String.fromCharCode.apply(String,t);var r="",n=0;for(;nthis.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if((r>>>=0)<=(e>>>=0))return"";for(t||(t="utf8");;)switch(t){case"hex":return C(this,e,r);case"utf8":case"utf-8":return k(this,e,r);case"ascii":return S(this,e,r);case"latin1":case"binary":return A(this,e,r);case"base64":return E(this,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return R(this,e,r);default:if(n)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),n=!0}}.apply(this,arguments)},s.prototype.equals=function(t){if(!s.isBuffer(t))throw new TypeError("Argument must be a Buffer");return this===t||0===s.compare(this,t)},s.prototype.inspect=function(){var t="",e=r.INSPECT_MAX_BYTES;return this.length>0&&(t=this.toString("hex",0,e).match(/.{2}/g).join(" "),this.length>e&&(t+=" ... ")),""},s.prototype.compare=function(t,e,r,n,i){if(!s.isBuffer(t))throw new TypeError("Argument must be a Buffer");if(void 0===e&&(e=0),void 0===r&&(r=t?t.length:0),void 0===n&&(n=0),void 0===i&&(i=this.length),e<0||r>t.length||n<0||i>this.length)throw new RangeError("out of range index");if(n>=i&&e>=r)return 0;if(n>=i)return-1;if(e>=r)return 1;if(e>>>=0,r>>>=0,n>>>=0,i>>>=0,this===t)return 0;for(var o=i-n,a=r-e,u=Math.min(o,a),l=this.slice(n,i),c=t.slice(e,r),h=0;h>>=0,isFinite(r)?(r>>>=0,void 0===n&&(n="utf8")):(n=r,r=void 0)}var i=this.length-e;if((void 0===r||r>i)&&(r=i),t.length>0&&(r<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");for(var o=!1;;)switch(n){case"hex":return v(this,t,e,r);case"utf8":case"utf-8":return _(this,t,e,r);case"ascii":return y(this,t,e,r);case"latin1":case"binary":return b(this,t,e,r);case"base64":return x(this,t,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return w(this,t,e,r);default:if(o)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),o=!0}},s.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var T=4096;function S(t,e,r){var n="";r=Math.min(t.length,r);for(var i=e;in)&&(r=n);for(var i="",o=e;or)throw new RangeError("Trying to access beyond buffer length")}function P(t,e,r,n,i,o){if(!s.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>i||et.length)throw new RangeError("Index out of range")}function I(t,e,r,n,i,o){if(r+n>t.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function M(t,e,r,n,o){return e=+e,r>>>=0,o||I(t,0,r,4),i.write(t,e,r,n,23,4),r+4}function D(t,e,r,n,o){return e=+e,r>>>=0,o||I(t,0,r,8),i.write(t,e,r,n,52,8),r+8}s.prototype.slice=function(t,e){var r=this.length;t=~~t,e=void 0===e?r:~~e,t<0?(t+=r)<0&&(t=0):t>r&&(t=r),e<0?(e+=r)<0&&(e=0):e>r&&(e=r),e>>=0,e>>>=0,r||B(t,e,this.length);for(var n=this[t],i=1,o=0;++o>>=0,e>>>=0,r||B(t,e,this.length);for(var n=this[t+--e],i=1;e>0&&(i*=256);)n+=this[t+--e]*i;return n},s.prototype.readUInt8=function(t,e){return t>>>=0,e||B(t,1,this.length),this[t]},s.prototype.readUInt16LE=function(t,e){return t>>>=0,e||B(t,2,this.length),this[t]|this[t+1]<<8},s.prototype.readUInt16BE=function(t,e){return t>>>=0,e||B(t,2,this.length),this[t]<<8|this[t+1]},s.prototype.readUInt32LE=function(t,e){return t>>>=0,e||B(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},s.prototype.readUInt32BE=function(t,e){return t>>>=0,e||B(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},s.prototype.readIntLE=function(t,e,r){t>>>=0,e>>>=0,r||B(t,e,this.length);for(var n=this[t],i=1,o=0;++o=(i*=128)&&(n-=Math.pow(2,8*e)),n},s.prototype.readIntBE=function(t,e,r){t>>>=0,e>>>=0,r||B(t,e,this.length);for(var n=e,i=1,o=this[t+--n];n>0&&(i*=256);)o+=this[t+--n]*i;return o>=(i*=128)&&(o-=Math.pow(2,8*e)),o},s.prototype.readInt8=function(t,e){return t>>>=0,e||B(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},s.prototype.readInt16LE=function(t,e){t>>>=0,e||B(t,2,this.length);var r=this[t]|this[t+1]<<8;return 32768&r?4294901760|r:r},s.prototype.readInt16BE=function(t,e){t>>>=0,e||B(t,2,this.length);var r=this[t+1]|this[t]<<8;return 32768&r?4294901760|r:r},s.prototype.readInt32LE=function(t,e){return t>>>=0,e||B(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},s.prototype.readInt32BE=function(t,e){return t>>>=0,e||B(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},s.prototype.readFloatLE=function(t,e){return t>>>=0,e||B(t,4,this.length),i.read(this,t,!0,23,4)},s.prototype.readFloatBE=function(t,e){return t>>>=0,e||B(t,4,this.length),i.read(this,t,!1,23,4)},s.prototype.readDoubleLE=function(t,e){return t>>>=0,e||B(t,8,this.length),i.read(this,t,!0,52,8)},s.prototype.readDoubleBE=function(t,e){return t>>>=0,e||B(t,8,this.length),i.read(this,t,!1,52,8)},s.prototype.writeUIntLE=function(t,e,r,n){(t=+t,e>>>=0,r>>>=0,n)||P(this,t,e,r,Math.pow(2,8*r)-1,0);var i=1,o=0;for(this[e]=255&t;++o>>=0,r>>>=0,n)||P(this,t,e,r,Math.pow(2,8*r)-1,0);var i=r-1,o=1;for(this[e+i]=255&t;--i>=0&&(o*=256);)this[e+i]=t/o&255;return e+r},s.prototype.writeUInt8=function(t,e,r){return t=+t,e>>>=0,r||P(this,t,e,1,255,0),this[e]=255&t,e+1},s.prototype.writeUInt16LE=function(t,e,r){return t=+t,e>>>=0,r||P(this,t,e,2,65535,0),this[e]=255&t,this[e+1]=t>>>8,e+2},s.prototype.writeUInt16BE=function(t,e,r){return t=+t,e>>>=0,r||P(this,t,e,2,65535,0),this[e]=t>>>8,this[e+1]=255&t,e+2},s.prototype.writeUInt32LE=function(t,e,r){return t=+t,e>>>=0,r||P(this,t,e,4,4294967295,0),this[e+3]=t>>>24,this[e+2]=t>>>16,this[e+1]=t>>>8,this[e]=255&t,e+4},s.prototype.writeUInt32BE=function(t,e,r){return t=+t,e>>>=0,r||P(this,t,e,4,4294967295,0),this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t,e+4},s.prototype.writeIntLE=function(t,e,r,n){if(t=+t,e>>>=0,!n){var i=Math.pow(2,8*r-1);P(this,t,e,r,i-1,-i)}var o=0,a=1,s=0;for(this[e]=255&t;++o>0)-s&255;return e+r},s.prototype.writeIntBE=function(t,e,r,n){if(t=+t,e>>>=0,!n){var i=Math.pow(2,8*r-1);P(this,t,e,r,i-1,-i)}var o=r-1,a=1,s=0;for(this[e+o]=255&t;--o>=0&&(a*=256);)t<0&&0===s&&0!==this[e+o+1]&&(s=1),this[e+o]=(t/a>>0)-s&255;return e+r},s.prototype.writeInt8=function(t,e,r){return t=+t,e>>>=0,r||P(this,t,e,1,127,-128),t<0&&(t=255+t+1),this[e]=255&t,e+1},s.prototype.writeInt16LE=function(t,e,r){return t=+t,e>>>=0,r||P(this,t,e,2,32767,-32768),this[e]=255&t,this[e+1]=t>>>8,e+2},s.prototype.writeInt16BE=function(t,e,r){return t=+t,e>>>=0,r||P(this,t,e,2,32767,-32768),this[e]=t>>>8,this[e+1]=255&t,e+2},s.prototype.writeInt32LE=function(t,e,r){return t=+t,e>>>=0,r||P(this,t,e,4,2147483647,-2147483648),this[e]=255&t,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24,e+4},s.prototype.writeInt32BE=function(t,e,r){return t=+t,e>>>=0,r||P(this,t,e,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t,e+4},s.prototype.writeFloatLE=function(t,e,r){return M(this,t,e,!0,r)},s.prototype.writeFloatBE=function(t,e,r){return M(this,t,e,!1,r)},s.prototype.writeDoubleLE=function(t,e,r){return D(this,t,e,!0,r)},s.prototype.writeDoubleBE=function(t,e,r){return D(this,t,e,!1,r)},s.prototype.copy=function(t,e,r,n){if(r||(r=0),n||0===n||(n=this.length),e>=t.length&&(e=t.length),e||(e=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),t.length-e=0;--i)t[i+e]=this[i+r];else if(o<1e3)for(i=0;i>>=0,r=void 0===r?this.length:r>>>0,t||(t=0),"number"==typeof t)for(o=e;o55295&&r<57344){if(!i){if(r>56319){(e-=3)>-1&&o.push(239,191,189);continue}if(a+1===n){(e-=3)>-1&&o.push(239,191,189);continue}i=r;continue}if(r<56320){(e-=3)>-1&&o.push(239,191,189),i=r;continue}r=65536+(i-55296<<10|r-56320)}else i&&(e-=3)>-1&&o.push(239,191,189);if(i=null,r<128){if((e-=1)<0)break;o.push(r)}else if(r<2048){if((e-=2)<0)break;o.push(r>>6|192,63&r|128)}else if(r<65536){if((e-=3)<0)break;o.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((e-=4)<0)break;o.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return o}function N(t){return n.toByteArray(function(t){if((t=t.trim().replace(F,"")).length<2)return"";for(;t.length%4!=0;)t+="=";return t}(t))}function j(t,e,r,n){for(var i=0;i=e.length||i>=t.length);++i)e[i+r]=t[i];return i}function U(t){return t instanceof ArrayBuffer||null!=t&&null!=t.constructor&&"ArrayBuffer"===t.constructor.name&&"number"==typeof t.byteLength}function z(t){return"function"==typeof ArrayBuffer.isView&&ArrayBuffer.isView(t)}function G(t){return t!=t}},{"base64-js":2,ieee754:86}],74:[function(t,e,r){var n=Object.create||function(t){var e=function(){};return e.prototype=t,new e},i=Object.keys||function(t){var e=[];for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.push(r);return r},o=Function.prototype.bind||function(t){var e=this;return function(){return e.apply(t,arguments)}};function a(){this._events&&Object.prototype.hasOwnProperty.call(this,"_events")||(this._events=n(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0}e.exports=a,a.EventEmitter=a,a.prototype._events=void 0,a.prototype._maxListeners=void 0;var s,u=10;try{var l={};Object.defineProperty&&Object.defineProperty(l,"x",{value:0}),s=0===l.x}catch(t){s=!1}function c(t){return void 0===t._maxListeners?a.defaultMaxListeners:t._maxListeners}function h(t,e,r,i){var o,a,s;if("function"!=typeof r)throw new TypeError('"listener" argument must be a function');if((a=t._events)?(a.newListener&&(t.emit("newListener",e,r.listener?r.listener:r),a=t._events),s=a[e]):(a=t._events=n(null),t._eventsCount=0),s){if("function"==typeof s?s=a[e]=i?[r,s]:[s,r]:i?s.unshift(r):s.push(r),!s.warned&&(o=c(t))&&o>0&&s.length>o){s.warned=!0;var u=new Error("Possible EventEmitter memory leak detected. "+s.length+' "'+String(e)+'" listeners added. Use emitter.setMaxListeners() to increase limit.');u.name="MaxListenersExceededWarning",u.emitter=t,u.type=e,u.count=s.length,"object"==typeof console&&console.warn&&console.warn("%s: %s",u.name,u.message)}}else s=a[e]=r,++t._eventsCount;return t}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 t=new Array(arguments.length),e=0;e1&&(e=arguments[1]),e instanceof Error)throw e;var u=new Error('Unhandled "error" event. ('+e+")");throw u.context=e,u}if(!(r=a[t]))return!1;var l="function"==typeof r;switch(n=arguments.length){case 1:!function(t,e,r){if(e)t.call(r);else for(var n=t.length,i=g(t,n),o=0;o=0;a--)if(r[a]===e||r[a].listener===e){s=r[a].listener,o=a;break}if(o<0)return this;0===o?r.shift():function(t,e){for(var r=e,n=r+1,i=t.length;n=0;o--)this.removeListener(t,e[o]);return this},a.prototype.listeners=function(t){return d(this,t,!0)},a.prototype.rawListeners=function(t){return d(this,t,!1)},a.listenerCount=function(t,e){return"function"==typeof t.listenerCount?t.listenerCount(e):m.call(t,e)},a.prototype.listenerCount=m,a.prototype.eventNames=function(){return this._eventsCount>0?Reflect.ownKeys(this._events):[]}},{}],75:[function(t,e,r){"use strict";var n="undefined"!=typeof Uint8Array&&"undefined"!=typeof Uint16Array&&"undefined"!=typeof Int32Array;function i(t,e){return Object.prototype.hasOwnProperty.call(t,e)}r.assign=function(t){for(var e=Array.prototype.slice.call(arguments,1);e.length;){var r=e.shift();if(r){if("object"!=typeof r)throw new TypeError(r+"must be non-object");for(var n in r)i(r,n)&&(t[n]=r[n])}}return t},r.shrinkBuf=function(t,e){return t.length===e?t:t.subarray?t.subarray(0,e):(t.length=e,t)};var o={arraySet:function(t,e,r,n,i){if(e.subarray&&t.subarray)t.set(e.subarray(r,r+n),i);else for(var o=0;o>>16&65535|0,a=0;0!==r;){r-=a=r>2e3?2e3:r;do{o=o+(i=i+e[n++]|0)|0}while(--a);i%=65521,o%=65521}return i|o<<16|0}},{}],77:[function(t,e,r){"use strict";e.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}},{}],78:[function(t,e,r){"use strict";var n=function(){for(var t,e=[],r=0;r<256;r++){t=r;for(var n=0;n<8;n++)t=1&t?3988292384^t>>>1:t>>>1;e[r]=t}return e}();e.exports=function(t,e,r,i){var o=n,a=i+r;t^=-1;for(var s=i;s>>8^o[255&(t^e[s])];return-1^t}},{}],79:[function(t,e,r){"use strict";var n,i=t("../utils/common"),o=t("./trees"),a=t("./adler32"),s=t("./crc32"),u=t("./messages"),l=0,c=1,h=3,p=4,f=5,d=0,m=1,g=-2,v=-3,_=-5,y=-1,b=1,x=2,w=3,E=4,k=0,T=2,S=8,A=9,C=15,R=8,B=286,P=30,I=19,M=2*B+1,D=15,F=3,L=258,O=L+F+1,N=32,j=42,U=69,z=73,G=91,$=103,V=113,X=666,q=1,K=2,W=3,H=4,Y=3;function Z(t,e){return t.msg=u[e],e}function J(t){return(t<<1)-(t>4?9:0)}function Q(t){for(var e=t.length;--e>=0;)t[e]=0}function tt(t){var e=t.state,r=e.pending;r>t.avail_out&&(r=t.avail_out),0!==r&&(i.arraySet(t.output,e.pending_buf,e.pending_out,r,t.next_out),t.next_out+=r,e.pending_out+=r,t.total_out+=r,t.avail_out-=r,e.pending-=r,0===e.pending&&(e.pending_out=0))}function et(t,e){o._tr_flush_block(t,t.block_start>=0?t.block_start:-1,t.strstart-t.block_start,e),t.block_start=t.strstart,tt(t.strm)}function rt(t,e){t.pending_buf[t.pending++]=e}function nt(t,e){t.pending_buf[t.pending++]=e>>>8&255,t.pending_buf[t.pending++]=255&e}function it(t,e){var r,n,i=t.max_chain_length,o=t.strstart,a=t.prev_length,s=t.nice_match,u=t.strstart>t.w_size-O?t.strstart-(t.w_size-O):0,l=t.window,c=t.w_mask,h=t.prev,p=t.strstart+L,f=l[o+a-1],d=l[o+a];t.prev_length>=t.good_match&&(i>>=2),s>t.lookahead&&(s=t.lookahead);do{if(l[(r=e)+a]===d&&l[r+a-1]===f&&l[r]===l[o]&&l[++r]===l[o+1]){o+=2,r++;do{}while(l[++o]===l[++r]&&l[++o]===l[++r]&&l[++o]===l[++r]&&l[++o]===l[++r]&&l[++o]===l[++r]&&l[++o]===l[++r]&&l[++o]===l[++r]&&l[++o]===l[++r]&&oa){if(t.match_start=e,a=n,n>=s)break;f=l[o+a-1],d=l[o+a]}}}while((e=h[e&c])>u&&0!=--i);return a<=t.lookahead?a:t.lookahead}function ot(t){var e,r,n,o,u,l,c,h,p,f,d=t.w_size;do{if(o=t.window_size-t.lookahead-t.strstart,t.strstart>=d+(d-O)){i.arraySet(t.window,t.window,d,d,0),t.match_start-=d,t.strstart-=d,t.block_start-=d,e=r=t.hash_size;do{n=t.head[--e],t.head[e]=n>=d?n-d:0}while(--r);e=r=d;do{n=t.prev[--e],t.prev[e]=n>=d?n-d:0}while(--r);o+=d}if(0===t.strm.avail_in)break;if(l=t.strm,c=t.window,h=t.strstart+t.lookahead,p=o,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=a(l.adler,c,f,h):2===l.state.wrap&&(l.adler=s(l.adler,c,f,h)),l.next_in+=f,l.total_in+=f,f),t.lookahead+=r,t.lookahead+t.insert>=F)for(u=t.strstart-t.insert,t.ins_h=t.window[u],t.ins_h=(t.ins_h<=F&&(t.ins_h=(t.ins_h<=F)if(n=o._tr_tally(t,t.strstart-t.match_start,t.match_length-F),t.lookahead-=t.match_length,t.match_length<=t.max_lazy_match&&t.lookahead>=F){t.match_length--;do{t.strstart++,t.ins_h=(t.ins_h<=F&&(t.ins_h=(t.ins_h<4096)&&(t.match_length=F-1)),t.prev_length>=F&&t.match_length<=t.prev_length){i=t.strstart+t.lookahead-F,n=o._tr_tally(t,t.strstart-1-t.prev_match,t.prev_length-F),t.lookahead-=t.prev_length-1,t.prev_length-=2;do{++t.strstart<=i&&(t.ins_h=(t.ins_h<15&&(s=2,n-=16),o<1||o>A||r!==S||n<8||n>15||e<0||e>9||a<0||a>E)return Z(t,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*M),this.dyn_dtree=new i.Buf16(2*(2*P+1)),this.bl_tree=new i.Buf16(2*(2*I+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(D+1),this.heap=new i.Buf16(2*B+1),Q(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new i.Buf16(2*B+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 t.state=u,u.strm=t,u.wrap=s,u.gzhead=null,u.w_bits=n,u.w_size=1<t.pending_buf_size-5&&(r=t.pending_buf_size-5);;){if(t.lookahead<=1){if(ot(t),0===t.lookahead&&e===l)return q;if(0===t.lookahead)break}t.strstart+=t.lookahead,t.lookahead=0;var n=t.block_start+r;if((0===t.strstart||t.strstart>=n)&&(t.lookahead=t.strstart-n,t.strstart=n,et(t,!1),0===t.strm.avail_out))return q;if(t.strstart-t.block_start>=t.w_size-O&&(et(t,!1),0===t.strm.avail_out))return q}return t.insert=0,e===p?(et(t,!0),0===t.strm.avail_out?W:H):(t.strstart>t.block_start&&(et(t,!1),t.strm.avail_out),q)}),new ut(4,4,8,4,at),new ut(4,5,16,8,at),new ut(4,6,32,32,at),new ut(4,4,16,16,st),new ut(8,16,32,32,st),new ut(8,16,128,128,st),new ut(8,32,128,256,st),new ut(32,128,258,1024,st),new ut(32,258,258,4096,st)],r.deflateInit=function(t,e){return ht(t,e,S,C,R,k)},r.deflateInit2=ht,r.deflateReset=ct,r.deflateResetKeep=lt,r.deflateSetHeader=function(t,e){return t&&t.state?2!==t.state.wrap?g:(t.state.gzhead=e,d):g},r.deflate=function(t,e){var r,i,a,u;if(!t||!t.state||e>f||e<0)return t?Z(t,g):g;if(i=t.state,!t.output||!t.input&&0!==t.avail_in||i.status===X&&e!==p)return Z(t,0===t.avail_out?_:g);if(i.strm=t,r=i.last_flush,i.last_flush=e,i.status===j)if(2===i.wrap)t.adler=0,rt(i,31),rt(i,139),rt(i,8),i.gzhead?(rt(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)),rt(i,255&i.gzhead.time),rt(i,i.gzhead.time>>8&255),rt(i,i.gzhead.time>>16&255),rt(i,i.gzhead.time>>24&255),rt(i,9===i.level?2:i.strategy>=x||i.level<2?4:0),rt(i,255&i.gzhead.os),i.gzhead.extra&&i.gzhead.extra.length&&(rt(i,255&i.gzhead.extra.length),rt(i,i.gzhead.extra.length>>8&255)),i.gzhead.hcrc&&(t.adler=s(t.adler,i.pending_buf,i.pending,0)),i.gzindex=0,i.status=U):(rt(i,0),rt(i,0),rt(i,0),rt(i,0),rt(i,0),rt(i,9===i.level?2:i.strategy>=x||i.level<2?4:0),rt(i,Y),i.status=V);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|=N),v+=31-v%31,i.status=V,nt(i,v),0!==i.strstart&&(nt(i,t.adler>>>16),nt(i,65535&t.adler)),t.adler=1}if(i.status===U)if(i.gzhead.extra){for(a=i.pending;i.gzindex<(65535&i.gzhead.extra.length)&&(i.pending!==i.pending_buf_size||(i.gzhead.hcrc&&i.pending>a&&(t.adler=s(t.adler,i.pending_buf,i.pending-a,a)),tt(t),a=i.pending,i.pending!==i.pending_buf_size));)rt(i,255&i.gzhead.extra[i.gzindex]),i.gzindex++;i.gzhead.hcrc&&i.pending>a&&(t.adler=s(t.adler,i.pending_buf,i.pending-a,a)),i.gzindex===i.gzhead.extra.length&&(i.gzindex=0,i.status=z)}else i.status=z;if(i.status===z)if(i.gzhead.name){a=i.pending;do{if(i.pending===i.pending_buf_size&&(i.gzhead.hcrc&&i.pending>a&&(t.adler=s(t.adler,i.pending_buf,i.pending-a,a)),tt(t),a=i.pending,i.pending===i.pending_buf_size)){u=1;break}u=i.gzindexa&&(t.adler=s(t.adler,i.pending_buf,i.pending-a,a)),0===u&&(i.gzindex=0,i.status=G)}else i.status=G;if(i.status===G)if(i.gzhead.comment){a=i.pending;do{if(i.pending===i.pending_buf_size&&(i.gzhead.hcrc&&i.pending>a&&(t.adler=s(t.adler,i.pending_buf,i.pending-a,a)),tt(t),a=i.pending,i.pending===i.pending_buf_size)){u=1;break}u=i.gzindexa&&(t.adler=s(t.adler,i.pending_buf,i.pending-a,a)),0===u&&(i.status=$)}else i.status=$;if(i.status===$&&(i.gzhead.hcrc?(i.pending+2>i.pending_buf_size&&tt(t),i.pending+2<=i.pending_buf_size&&(rt(i,255&t.adler),rt(i,t.adler>>8&255),t.adler=0,i.status=V)):i.status=V),0!==i.pending){if(tt(t),0===t.avail_out)return i.last_flush=-1,d}else if(0===t.avail_in&&J(e)<=J(r)&&e!==p)return Z(t,_);if(i.status===X&&0!==t.avail_in)return Z(t,_);if(0!==t.avail_in||0!==i.lookahead||e!==l&&i.status!==X){var y=i.strategy===x?function(t,e){for(var r;;){if(0===t.lookahead&&(ot(t),0===t.lookahead)){if(e===l)return q;break}if(t.match_length=0,r=o._tr_tally(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++,r&&(et(t,!1),0===t.strm.avail_out))return q}return t.insert=0,e===p?(et(t,!0),0===t.strm.avail_out?W:H):t.last_lit&&(et(t,!1),0===t.strm.avail_out)?q:K}(i,e):i.strategy===w?function(t,e){for(var r,n,i,a,s=t.window;;){if(t.lookahead<=L){if(ot(t),t.lookahead<=L&&e===l)return q;if(0===t.lookahead)break}if(t.match_length=0,t.lookahead>=F&&t.strstart>0&&(n=s[i=t.strstart-1])===s[++i]&&n===s[++i]&&n===s[++i]){a=t.strstart+L;do{}while(n===s[++i]&&n===s[++i]&&n===s[++i]&&n===s[++i]&&n===s[++i]&&n===s[++i]&&n===s[++i]&&n===s[++i]&&it.lookahead&&(t.match_length=t.lookahead)}if(t.match_length>=F?(r=o._tr_tally(t,1,t.match_length-F),t.lookahead-=t.match_length,t.strstart+=t.match_length,t.match_length=0):(r=o._tr_tally(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++),r&&(et(t,!1),0===t.strm.avail_out))return q}return t.insert=0,e===p?(et(t,!0),0===t.strm.avail_out?W:H):t.last_lit&&(et(t,!1),0===t.strm.avail_out)?q:K}(i,e):n[i.level].func(i,e);if(y!==W&&y!==H||(i.status=X),y===q||y===W)return 0===t.avail_out&&(i.last_flush=-1),d;if(y===K&&(e===c?o._tr_align(i):e!==f&&(o._tr_stored_block(i,0,0,!1),e===h&&(Q(i.head),0===i.lookahead&&(i.strstart=0,i.block_start=0,i.insert=0))),tt(t),0===t.avail_out))return i.last_flush=-1,d}return e!==p?d:i.wrap<=0?m:(2===i.wrap?(rt(i,255&t.adler),rt(i,t.adler>>8&255),rt(i,t.adler>>16&255),rt(i,t.adler>>24&255),rt(i,255&t.total_in),rt(i,t.total_in>>8&255),rt(i,t.total_in>>16&255),rt(i,t.total_in>>24&255)):(nt(i,t.adler>>>16),nt(i,65535&t.adler)),tt(t),i.wrap>0&&(i.wrap=-i.wrap),0!==i.pending?d:m)},r.deflateEnd=function(t){var e;return t&&t.state?(e=t.state.status)!==j&&e!==U&&e!==z&&e!==G&&e!==$&&e!==V&&e!==X?Z(t,g):(t.state=null,e===V?Z(t,v):d):g},r.deflateSetDictionary=function(t,e){var r,n,o,s,u,l,c,h,p=e.length;if(!t||!t.state)return g;if(2===(s=(r=t.state).wrap)||1===s&&r.status!==j||r.lookahead)return g;for(1===s&&(t.adler=a(t.adler,e,p,0)),r.wrap=0,p>=r.w_size&&(0===s&&(Q(r.head),r.strstart=0,r.block_start=0,r.insert=0),h=new i.Buf8(r.w_size),i.arraySet(h,e,p-r.w_size,r.w_size,0),e=h,p=r.w_size),u=t.avail_in,l=t.next_in,c=t.input,t.avail_in=p,t.next_in=0,t.input=e,ot(r);r.lookahead>=F;){n=r.strstart,o=r.lookahead-(F-1);do{r.ins_h=(r.ins_h<>>=b=y>>>24,d-=b,0===(b=y>>>16&255))S[o++]=65535&y;else{if(!(16&b)){if(0==(64&b)){y=m[(65535&y)+(f&(1<>>=b,d-=b),d<15&&(f+=T[n++]<>>=b=y>>>24,d-=b,!(16&(b=y>>>16&255))){if(0==(64&b)){y=g[(65535&y)+(f&(1<u){t.msg="invalid distance too far back",r.mode=30;break t}if(f>>>=b,d-=b,w>(b=o-a)){if((b=w-b)>c&&r.sane){t.msg="invalid distance too far back",r.mode=30;break t}if(E=0,k=p,0===h){if(E+=l-b,b2;)S[o++]=k[E++],S[o++]=k[E++],S[o++]=k[E++],x-=3;x&&(S[o++]=k[E++],x>1&&(S[o++]=k[E++]))}else{E=o-w;do{S[o++]=S[E++],S[o++]=S[E++],S[o++]=S[E++],x-=3}while(x>2);x&&(S[o++]=S[E++],x>1&&(S[o++]=S[E++]))}break}}break}}while(n>3,f&=(1<<(d-=x<<3))-1,t.next_in=n,t.next_out=o,t.avail_in=n>>24&255)+(t>>>8&65280)+((65280&t)<<8)+((255&t)<<24)}function it(t){var e;return t&&t.state?(e=t.state,t.total_in=t.total_out=e.total=0,t.msg="",e.wrap&&(t.adler=1&e.wrap),e.mode=w,e.last=0,e.havedict=0,e.dmax=32768,e.head=null,e.hold=0,e.bits=0,e.lencode=e.lendyn=new n.Buf32(tt),e.distcode=e.distdyn=new n.Buf32(et),e.sane=1,e.back=-1,d):v}function ot(t){var e;return t&&t.state?((e=t.state).wsize=0,e.whave=0,e.wnext=0,it(t)):v}function at(t,e){var r,n;return t&&t.state?(n=t.state,e<0?(r=0,e=-e):(r=1+(e>>4),e<48&&(e&=15)),e&&(e<8||e>15)?v:(null!==n.window&&n.wbits!==e&&(n.window=null),n.wrap=r,n.wbits=e,ot(t))):v}function st(t,e){var r,i;return t?(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},t.state=i,i.window=null,(r=at(t,e))!==d&&(t.state=null),r):v}var ut,lt,ct=!0;function ht(t){if(ct){var e;for(ut=new n.Buf32(512),lt=new n.Buf32(32),e=0;e<144;)t.lens[e++]=8;for(;e<256;)t.lens[e++]=9;for(;e<280;)t.lens[e++]=7;for(;e<288;)t.lens[e++]=8;for(s(l,t.lens,0,288,ut,0,t.work,{bits:9}),e=0;e<32;)t.lens[e++]=5;s(c,t.lens,0,32,lt,0,t.work,{bits:5}),ct=!1}t.lencode=ut,t.lenbits=9,t.distcode=lt,t.distbits=5}function pt(t,e,r,i){var o,a=t.state;return null===a.window&&(a.wsize=1<=a.wsize?(n.arraySet(a.window,e,r-a.wsize,a.wsize,0),a.wnext=0,a.whave=a.wsize):((o=a.wsize-a.wnext)>i&&(o=i),n.arraySet(a.window,e,r-i,o,a.wnext),(i-=o)?(n.arraySet(a.window,e,r-i,i,0),a.wnext=i,a.whave=a.wsize):(a.wnext+=o,a.wnext===a.wsize&&(a.wnext=0),a.whave>>8&255,r.check=o(r.check,At,2,0),st=0,ut=0,r.mode=E;break}if(r.flags=0,r.head&&(r.head.done=!1),!(1&r.wrap)||(((255&st)<<8)+(st>>8))%31){t.msg="incorrect header check",r.mode=Z;break}if((15&st)!==x){t.msg="unknown compression method",r.mode=Z;break}if(ut-=4,wt=8+(15&(st>>>=4)),0===r.wbits)r.wbits=wt;else if(wt>r.wbits){t.msg="invalid window size",r.mode=Z;break}r.dmax=1<>8&1),512&r.flags&&(At[0]=255&st,At[1]=st>>>8&255,r.check=o(r.check,At,2,0)),st=0,ut=0,r.mode=k;case k:for(;ut<32;){if(0===ot)break t;ot--,st+=tt[rt++]<>>8&255,At[2]=st>>>16&255,At[3]=st>>>24&255,r.check=o(r.check,At,4,0)),st=0,ut=0,r.mode=T;case T:for(;ut<16;){if(0===ot)break t;ot--,st+=tt[rt++]<>8),512&r.flags&&(At[0]=255&st,At[1]=st>>>8&255,r.check=o(r.check,At,2,0)),st=0,ut=0,r.mode=S;case S:if(1024&r.flags){for(;ut<16;){if(0===ot)break t;ot--,st+=tt[rt++]<>>8&255,r.check=o(r.check,At,2,0)),st=0,ut=0}else r.head&&(r.head.extra=null);r.mode=A;case A:if(1024&r.flags&&((ft=r.length)>ot&&(ft=ot),ft&&(r.head&&(wt=r.head.extra_len-r.length,r.head.extra||(r.head.extra=new Array(r.head.extra_len)),n.arraySet(r.head.extra,tt,rt,ft,wt)),512&r.flags&&(r.check=o(r.check,tt,ft,rt)),ot-=ft,rt+=ft,r.length-=ft),r.length))break t;r.length=0,r.mode=C;case C:if(2048&r.flags){if(0===ot)break t;ft=0;do{wt=tt[rt+ft++],r.head&&wt&&r.length<65536&&(r.head.name+=String.fromCharCode(wt))}while(wt&&ft>9&1,r.head.done=!0),t.adler=r.check=0,r.mode=M;break;case P:for(;ut<32;){if(0===ot)break t;ot--,st+=tt[rt++]<>>=7&ut,ut-=7&ut,r.mode=W;break}for(;ut<3;){if(0===ot)break t;ot--,st+=tt[rt++]<>>=1)){case 0:r.mode=F;break;case 1:if(ht(r),r.mode=z,e===f){st>>>=2,ut-=2;break t}break;case 2:r.mode=N;break;case 3:t.msg="invalid block type",r.mode=Z}st>>>=2,ut-=2;break;case F:for(st>>>=7&ut,ut-=7&ut;ut<32;){if(0===ot)break t;ot--,st+=tt[rt++]<>>16^65535)){t.msg="invalid stored block lengths",r.mode=Z;break}if(r.length=65535&st,st=0,ut=0,r.mode=L,e===f)break t;case L:r.mode=O;case O:if(ft=r.length){if(ft>ot&&(ft=ot),ft>at&&(ft=at),0===ft)break t;n.arraySet(et,tt,rt,ft,it),ot-=ft,rt+=ft,at-=ft,it+=ft,r.length-=ft;break}r.mode=M;break;case N:for(;ut<14;){if(0===ot)break t;ot--,st+=tt[rt++]<>>=5,ut-=5,r.ndist=1+(31&st),st>>>=5,ut-=5,r.ncode=4+(15&st),st>>>=4,ut-=4,r.nlen>286||r.ndist>30){t.msg="too many length or distance symbols",r.mode=Z;break}r.have=0,r.mode=j;case j:for(;r.have>>=3,ut-=3}for(;r.have<19;)r.lens[Ct[r.have++]]=0;if(r.lencode=r.lendyn,r.lenbits=7,kt={bits:r.lenbits},Et=s(u,r.lens,0,19,r.lencode,0,r.work,kt),r.lenbits=kt.bits,Et){t.msg="invalid code lengths set",r.mode=Z;break}r.have=0,r.mode=U;case U:for(;r.have>>16&255,_t=65535&St,!((gt=St>>>24)<=ut);){if(0===ot)break t;ot--,st+=tt[rt++]<>>=gt,ut-=gt,r.lens[r.have++]=_t;else{if(16===_t){for(Tt=gt+2;ut>>=gt,ut-=gt,0===r.have){t.msg="invalid bit length repeat",r.mode=Z;break}wt=r.lens[r.have-1],ft=3+(3&st),st>>>=2,ut-=2}else if(17===_t){for(Tt=gt+3;ut>>=gt)),st>>>=3,ut-=3}else{for(Tt=gt+7;ut>>=gt)),st>>>=7,ut-=7}if(r.have+ft>r.nlen+r.ndist){t.msg="invalid bit length repeat",r.mode=Z;break}for(;ft--;)r.lens[r.have++]=wt}}if(r.mode===Z)break;if(0===r.lens[256]){t.msg="invalid code -- missing end-of-block",r.mode=Z;break}if(r.lenbits=9,kt={bits:r.lenbits},Et=s(l,r.lens,0,r.nlen,r.lencode,0,r.work,kt),r.lenbits=kt.bits,Et){t.msg="invalid literal/lengths set",r.mode=Z;break}if(r.distbits=6,r.distcode=r.distdyn,kt={bits:r.distbits},Et=s(c,r.lens,r.nlen,r.ndist,r.distcode,0,r.work,kt),r.distbits=kt.bits,Et){t.msg="invalid distances set",r.mode=Z;break}if(r.mode=z,e===f)break t;case z:r.mode=G;case G:if(ot>=6&&at>=258){t.next_out=it,t.avail_out=at,t.next_in=rt,t.avail_in=ot,r.hold=st,r.bits=ut,a(t,ct),it=t.next_out,et=t.output,at=t.avail_out,rt=t.next_in,tt=t.input,ot=t.avail_in,st=r.hold,ut=r.bits,r.mode===M&&(r.back=-1);break}for(r.back=0;vt=(St=r.lencode[st&(1<>>16&255,_t=65535&St,!((gt=St>>>24)<=ut);){if(0===ot)break t;ot--,st+=tt[rt++]<>yt)])>>>16&255,_t=65535&St,!(yt+(gt=St>>>24)<=ut);){if(0===ot)break t;ot--,st+=tt[rt++]<>>=yt,ut-=yt,r.back+=yt}if(st>>>=gt,ut-=gt,r.back+=gt,r.length=_t,0===vt){r.mode=K;break}if(32&vt){r.back=-1,r.mode=M;break}if(64&vt){t.msg="invalid literal/length code",r.mode=Z;break}r.extra=15&vt,r.mode=$;case $:if(r.extra){for(Tt=r.extra;ut>>=r.extra,ut-=r.extra,r.back+=r.extra}r.was=r.length,r.mode=V;case V:for(;vt=(St=r.distcode[st&(1<>>16&255,_t=65535&St,!((gt=St>>>24)<=ut);){if(0===ot)break t;ot--,st+=tt[rt++]<>yt)])>>>16&255,_t=65535&St,!(yt+(gt=St>>>24)<=ut);){if(0===ot)break t;ot--,st+=tt[rt++]<>>=yt,ut-=yt,r.back+=yt}if(st>>>=gt,ut-=gt,r.back+=gt,64&vt){t.msg="invalid distance code",r.mode=Z;break}r.offset=_t,r.extra=15&vt,r.mode=X;case X:if(r.extra){for(Tt=r.extra;ut>>=r.extra,ut-=r.extra,r.back+=r.extra}if(r.offset>r.dmax){t.msg="invalid distance too far back",r.mode=Z;break}r.mode=q;case q:if(0===at)break t;if(ft=ct-at,r.offset>ft){if((ft=r.offset-ft)>r.whave&&r.sane){t.msg="invalid distance too far back",r.mode=Z;break}ft>r.wnext?(ft-=r.wnext,dt=r.wsize-ft):dt=r.wnext-ft,ft>r.length&&(ft=r.length),mt=r.window}else mt=et,dt=it-r.offset,ft=r.length;ft>at&&(ft=at),at-=ft,r.length-=ft;do{et[it++]=mt[dt++]}while(--ft);0===r.length&&(r.mode=G);break;case K:if(0===at)break t;et[it++]=r.length,at--,r.mode=G;break;case W:if(r.wrap){for(;ut<32;){if(0===ot)break t;ot--,st|=tt[rt++]<=1&&0===F[S];S--);if(A>S&&(A=S),0===S)return l[c++]=20971520,l[c++]=20971520,p.bits=1,0;for(T=1;T0&&(0===t||1!==S))return-1;for(L[1]=0,E=1;E<15;E++)L[E+1]=L[E]+F[E];for(k=0;k852||2===t&&P>592)return 1;for(;;){y=E-R,h[k]<_?(b=0,x=h[k]):h[k]>_?(b=O[N+h[k]],x=M[D+h[k]]):(b=96,x=0),f=1<>R)+(d-=f)]=y<<24|b<<16|x|0}while(0!==d);for(f=1<>=1;if(0!==f?(I&=f-1,I+=f):I=0,k++,0==--F[E]){if(E===S)break;E=e[r+h[k]]}if(E>A&&(I&g)!==m){for(0===R&&(R=A),v+=T,B=1<<(C=E-R);C+R852||2===t&&P>592)return 1;l[m=I&g]=A<<24|C<<16|v-c|0}}return 0!==I&&(l[v+I]=E-R<<24|64<<16|0),p.bits=A,0}},{"../utils/common":75}],83:[function(t,e,r){"use strict";e.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"}},{}],84:[function(t,e,r){"use strict";var n=t("../utils/common"),i=4,o=0,a=1,s=2;function u(t){for(var e=t.length;--e>=0;)t[e]=0}var l=0,c=1,h=2,p=29,f=256,d=f+1+p,m=30,g=19,v=2*d+1,_=15,y=16,b=7,x=256,w=16,E=17,k=18,T=[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0],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],A=[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],R=new Array(2*(d+2));u(R);var B=new Array(2*m);u(B);var P=new Array(512);u(P);var I=new Array(256);u(I);var M=new Array(p);u(M);var D,F,L,O=new Array(m);function N(t,e,r,n,i){this.static_tree=t,this.extra_bits=e,this.extra_base=r,this.elems=n,this.max_length=i,this.has_stree=t&&t.length}function j(t,e){this.dyn_tree=t,this.max_code=0,this.stat_desc=e}function U(t){return t<256?P[t]:P[256+(t>>>7)]}function z(t,e){t.pending_buf[t.pending++]=255&e,t.pending_buf[t.pending++]=e>>>8&255}function G(t,e,r){t.bi_valid>y-r?(t.bi_buf|=e<>y-t.bi_valid,t.bi_valid+=r-y):(t.bi_buf|=e<>>=1,r<<=1}while(--e>0);return r>>>1}function X(t,e,r){var n,i,o=new Array(_+1),a=0;for(n=1;n<=_;n++)o[n]=a=a+r[n-1]<<1;for(i=0;i<=e;i++){var s=t[2*i+1];0!==s&&(t[2*i]=V(o[s]++,s))}}function q(t){var e;for(e=0;e8?z(t,t.bi_buf):t.bi_valid>0&&(t.pending_buf[t.pending++]=t.bi_buf),t.bi_buf=0,t.bi_valid=0}function W(t,e,r,n){var i=2*e,o=2*r;return t[i]>1;r>=1;r--)H(t,o,r);i=u;do{r=t.heap[1],t.heap[1]=t.heap[t.heap_len--],H(t,o,1),n=t.heap[1],t.heap[--t.heap_max]=r,t.heap[--t.heap_max]=n,o[2*i]=o[2*r]+o[2*n],t.depth[i]=(t.depth[r]>=t.depth[n]?t.depth[r]:t.depth[n])+1,o[2*r+1]=o[2*n+1]=i,t.heap[1]=i++,H(t,o,1)}while(t.heap_len>=2);t.heap[--t.heap_max]=t.heap[1],function(t,e){var r,n,i,o,a,s,u=e.dyn_tree,l=e.max_code,c=e.stat_desc.static_tree,h=e.stat_desc.has_stree,p=e.stat_desc.extra_bits,f=e.stat_desc.extra_base,d=e.stat_desc.max_length,m=0;for(o=0;o<=_;o++)t.bl_count[o]=0;for(u[2*t.heap[t.heap_max]+1]=0,r=t.heap_max+1;rd&&(o=d,m++),u[2*n+1]=o,n>l||(t.bl_count[o]++,a=0,n>=f&&(a=p[n-f]),s=u[2*n],t.opt_len+=s*(o+a),h&&(t.static_len+=s*(c[2*n+1]+a)));if(0!==m){do{for(o=d-1;0===t.bl_count[o];)o--;t.bl_count[o]--,t.bl_count[o+1]+=2,t.bl_count[d]--,m-=2}while(m>0);for(o=d;0!==o;o--)for(n=t.bl_count[o];0!==n;)(i=t.heap[--r])>l||(u[2*i+1]!==o&&(t.opt_len+=(o-u[2*i+1])*u[2*i],u[2*i+1]=o),n--)}}(t,e),X(o,l,t.bl_count)}function J(t,e,r){var n,i,o=-1,a=e[1],s=0,u=7,l=4;for(0===a&&(u=138,l=3),e[2*(r+1)+1]=65535,n=0;n<=r;n++)i=a,a=e[2*(n+1)+1],++s>=7;n0?(t.strm.data_type===s&&(t.strm.data_type=function(t){var e,r=4093624447;for(e=0;e<=31;e++,r>>>=1)if(1&r&&0!==t.dyn_ltree[2*e])return o;if(0!==t.dyn_ltree[18]||0!==t.dyn_ltree[20]||0!==t.dyn_ltree[26])return a;for(e=32;e=3&&0===t.bl_tree[2*C[e]+1];e--);return t.opt_len+=3*(e+1)+5+5+4,e}(t),u=t.opt_len+3+7>>>3,(l=t.static_len+3+7>>>3)<=u&&(u=l)):u=l=r+5,r+4<=u&&-1!==e?et(t,e,r,n):t.strategy===i||l===u?(G(t,(c<<1)+(n?1:0),3),Y(t,R,B)):(G(t,(h<<1)+(n?1:0),3),function(t,e,r,n){var i;for(G(t,e-257,5),G(t,r-1,5),G(t,n-4,4),i=0;i>>8&255,t.pending_buf[t.d_buf+2*t.last_lit+1]=255&e,t.pending_buf[t.l_buf+t.last_lit]=255&r,t.last_lit++,0===e?t.dyn_ltree[2*r]++:(t.matches++,e--,t.dyn_ltree[2*(I[r]+f+1)]++,t.dyn_dtree[2*U(e)]++),t.last_lit===t.lit_bufsize-1},r._tr_align=function(t){G(t,c<<1,3),$(t,x,R),function(t){16===t.bi_valid?(z(t,t.bi_buf),t.bi_buf=0,t.bi_valid=0):t.bi_valid>=8&&(t.pending_buf[t.pending++]=255&t.bi_buf,t.bi_buf>>=8,t.bi_valid-=8)}(t)}},{"../utils/common":75}],85:[function(t,e,r){"use strict";e.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}},{}],86:[function(t,e,r){r.read=function(t,e,r,n,i){var o,a,s=8*i-n-1,u=(1<>1,c=-7,h=r?i-1:0,p=r?-1:1,f=t[e+h];for(h+=p,o=f&(1<<-c)-1,f>>=-c,c+=s;c>0;o=256*o+t[e+h],h+=p,c-=8);for(a=o&(1<<-c)-1,o>>=-c,c+=n;c>0;a=256*a+t[e+h],h+=p,c-=8);if(0===o)o=1-l;else{if(o===u)return a?NaN:1/0*(f?-1:1);a+=Math.pow(2,n),o-=l}return(f?-1:1)*a*Math.pow(2,o-n)},r.write=function(t,e,r,n,i,o){var a,s,u,l=8*o-i-1,c=(1<>1,p=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,f=n?0:o-1,d=n?1:-1,m=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(s=isNaN(e)?1:0,a=c):(a=Math.floor(Math.log(e)/Math.LN2),e*(u=Math.pow(2,-a))<1&&(a--,u*=2),(e+=a+h>=1?p/u:p*Math.pow(2,1-h))*u>=2&&(a++,u/=2),a+h>=c?(s=0,a=c):a+h>=1?(s=(e*u-1)*Math.pow(2,i),a+=h):(s=e*Math.pow(2,h-1)*Math.pow(2,i),a=0));i>=8;t[r+f]=255&s,f+=d,s/=256,i-=8);for(a=a<0;t[r+f]=255&a,f+=d,a/=256,l-=8);t[r+f-d]|=128*m}},{}],87:[function(t,e,r){e.exports=[function(t,e){return{options:t,draw:function(e,r,n){n.stop(!0),n.overrideFlag=!0;var i=this;return e.pixelManipulation({output:function(t,e,r){i.output={src:e,format:r}},changePixel:function(t,e,r,n){return[255-t,255-e,255-r,n]},format:e.format,image:t.image,inBrowser:t.inBrowser,callback:r})},output:void 0,UI:e}},{name:"Invert",description:"Inverts the image.",inputs:{}}]},{}],88:[function(t,e,r){"use strict";var n=t("underscore"),i=e.exports={Bitmap:t("./lib/bitmap")};n.extend(i,t("./lib/enums"))},{"./lib/bitmap":89,"./lib/enums":90,underscore:195}],89:[function(t,e,r){(function(r){"use strict";var n=t("fs"),i=(t("underscore"),t("bluebird")),o=t("jpeg-js"),a=t("node-png").PNG,s=t("./enums"),u=t("./utils"),l=t("./resize"),c={r:0,g:0,b:0,a:0},h=e.exports=function(t){t&&(t instanceof h?this._data={data:new r(t.data.data),width:t.width,height:t.height}:t.data?this._data=t:t.width&&t.height&&(this._data={data:new r(4*t.width*t.height),width:t.width,height:t.height},t.color&&this._fill(t.color)))};h.prototype={get width(){return this._data.width},get height(){return this._data.height},attach:function(t){var e=this._data;return this._data=t,e},detach:function(){var t=this._data;return delete this._data,t},_deduceFileType:function(t){if(!t)throw new Error("Can't determine image type");switch(t.substr(-4).toLowerCase()){case".jpg":return s.ImageType.JPG;case".png":return s.ImageType.PNG}if(".jpeg"==t.substr(-5).toLowerCase())return s.ImageType.JPG;throw new Error("Can't recognise image type: "+t)},_readStream:function(t){var e=i.defer(),n=[];return t.on("data",function(t){n.push(t)}),t.on("end",function(){var t=r.concat(n);e.resolve(t)}),t.on("error",function(t){e.reject(t)}),e.promise},_readPNG:function(t){var e=i.defer(),r=new a({filterType:4});return r.on("parsed",function(){e.resolve(r)}),r.on("error",function(t){e.rejecyt(t)}),t.pipe(r),e.promise},_parseOptions:function(t,e){return"number"==typeof(t=t||{})&&(t={type:t}),t.type=t.type||this._deduceFileType(e),t},read:function(t,e){var r=this;switch((e=this._parseOptions(e)).type){case s.ImageType.JPG:return this._readStream(t).then(function(t){r._data=o.decode(t)});case s.ImageType.PNG:return this._readPNG(t).then(function(t){r._data={data:t.data,width:t.width,height:t.height}});default:return i.reject(new Error("Not supported: ImageType "+e.type))}},readFile:function(t,e){var r=this;return u.fs.exists(t).then(function(i){if(i){e=r._parseOptions(e,t);var o=n.createReadStream(t);return r.read(o,e)}throw new Error("File Not Found: "+t)})},write:function(t,e){e=this._parseOptions(e);var r=i.defer();try{switch(t.on("finish",function(){r.resolve()}),t.on("error",function(t){r.reject(t)}),e.type){case s.ImageType.JPG:var n=o.encode(this._data,e.quality||90).data;t.write(n),t.end();break;case s.ImageType.PNG:var u=new a;u.width=this.width,u.height=this.height,u.data=this._data.data,u.on("end",function(){r.resolve()}),u.on("error",function(t){r.reject(t)}),u.pack().pipe(t);break;default:throw new Error("Not supported: ImageType "+e.type)}}catch(t){r.reject(t)}return r.promise},writeFile:function(t,e){e=this._parseOptions(e,t);var r=n.createWriteStream(t);return this.write(r,e)},clone:function(){return new h({width:this.width,height:this.height,data:new r(this._data.data)})},setPixel:function(t,e,r,n,i,o){if(void 0===n){var a=r;r=a.r,n=a.g,i=a.b,o=a.a}void 0===o&&(o=255);var s=4*(e*this.width+t),u=this._data.data;u[s++]=r,u[s++]=n,u[s++]=i,u[s++]=o},getPixel:function(t,e,r){var n=4*(e*this.width+t);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 t=new h({width:this.width,height:this.height}),e=this.width*this.height,r=this._data.data,n=t._data.data,i=0,o=0,a=0;a-1&&R-1&&B=0&&B>=0?x[L]:O)+N*(g=R=0?x[L+4]:O),z=(1-N)*(v=R>=0&&B0?a:0)-(c>0?4:0)]+2*s[f-(l>0?a:0)]+1*s[f-(l>0?a:0)+(c0?4:0)]+4*s[f]+2*s[f+(c0?4:0)]+2*s[f+(l0?o[w-4]:2*o[w]-o[w+4],k=o[w],T=o[w+4],S=z0?m[w-4*p]:2*m[w]-m[w+4*p],B=m[w],P=m[w+4*p],I=j1)for(g=0;g0&&!t[a-1];)a--;o.push({children:[],index:0});var s,u=o[0];for(r=0;r0;)u=o.pop();for(u.index++,o.push(u);o.length<=r;)o.push(s={children:[],index:0}),u.children[u.index]=s.children,u=s;i++}r+10)return f>>--d&1;if(255==(f=e[r++])){var t=e[r++];if(t)throw"unexpected marker: "+(f<<8|t).toString(16)}return d=7,f>>>7}function g(t){for(var e,r=t;null!==(e=m());){if("number"==typeof(r=r[e]))return r;if("object"!=typeof r)throw"invalid huffman sequence"}return null}function v(t){for(var e=0;t>0;){var r=m();if(null===r)return;e=e<<1|r,t--}return e}function _(t){var e=v(t);return e>=1<0)y--;else for(var n=a,i=s;n<=i;){var o=g(e.huffmanTableAC),u=15&o,c=o>>4;if(0!==u)r[t[n+=c]]=_(u)*(1<>4,0===h)o<15?(y=v(o)+(1<>4;if(0!==s)r[t[o+=u]]=_(s),o++;else{if(u<15)break;o+=16}}};var P,I,M,D,F=0;for(I=1==B?i[0].blocksPerLine*i[0].blocksPerColumn:c*n.mcusPerColumn,o||(o=I);F=65488&&P<=65495))break;r+=2}return r-p}function p(t,l){var c,h,p=[],f=l.blocksPerLine,d=l.blocksPerColumn,m=f<<3,g=new Int32Array(64),v=new Uint8Array(64);function _(t,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]=t[x]*w[x];for(x=0;x<8;++x){var k=8*x;0!=E[1+k]||0!=E[2+k]||0!=E[3+k]||0!=E[4+k]||0!=E[5+k]||0!=E[6+k]||0!=E[7+k]?(p=s*E[0+k]+128>>8,f=s*E[4+k]+128>>8,d=E[2+k],m=E[6+k],g=u*(E[1+k]-E[7+k])+128>>8,y=u*(E[1+k]+E[7+k])+128>>8,v=E[3+k]<<4,_=E[5+k]<<4,b=p-f+1>>1,p=p+f+1>>1,f=b,b=d*a+m*o+128>>8,d=d*o-m*a+128>>8,m=b,b=g-_+1>>1,g=g+_+1>>1,_=b,b=y+v+1>>1,v=y-v+1>>1,y=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+y*n+2048>>12,g=g*n-y*i+2048>>12,y=b,b=v*r+_*e+2048>>12,v=v*e-_*r+2048>>12,_=b,E[0+k]=p+y,E[7+k]=p-y,E[1+k]=f+_,E[6+k]=f-_,E[2+k]=d+v,E[5+k]=d-v,E[3+k]=m+g,E[4+k]=m-g):(b=s*E[0+k]+512>>10,E[0+k]=b,E[1+k]=b,E[2+k]=b,E[3+k]=b,E[4+k]=b,E[5+k]=b,E[6+k]=b,E[7+k]=b)}for(x=0;x<8;++x){var T=x;0!=E[8+T]||0!=E[16+T]||0!=E[24+T]||0!=E[32+T]||0!=E[40+T]||0!=E[48+T]||0!=E[56+T]?(p=s*E[0+T]+2048>>12,f=s*E[32+T]+2048>>12,d=E[16+T],m=E[48+T],g=u*(E[8+T]-E[56+T])+2048>>12,y=u*(E[8+T]+E[56+T])+2048>>12,v=E[24+T],_=E[40+T],b=p-f+1>>1,p=p+f+1>>1,f=b,b=d*a+m*o+2048>>12,d=d*o-m*a+2048>>12,m=b,b=g-_+1>>1,g=g+_+1>>1,_=b,b=y+v+1>>1,v=y-v+1>>1,y=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+y*n+2048>>12,g=g*n-y*i+2048>>12,y=b,b=v*r+_*e+2048>>12,v=v*e-_*r+2048>>12,_=b,E[0+T]=p+y,E[56+T]=p-y,E[8+T]=f+_,E[48+T]=f-_,E[16+T]=d+v,E[40+T]=d-v,E[24+T]=m+g,E[32+T]=m-g):(b=s*h[x+0]+8192>>14,E[0+T]=b,E[8+T]=b,E[16+T]=b,E[24+T]=b,E[32+T]=b,E[40+T]=b,E[48+T]=b,E[56+T]=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 y=0;y255?255:t}return l.prototype={load:function(t){var e=new XMLHttpRequest;e.open("GET",t,!0),e.responseType="arraybuffer",e.onload=function(){var t=new Uint8Array(e.response||e.mozResponseArrayBuffer);this.parse(t),this.onload&&this.onload()}.bind(this),e.send(null)},parse:function(e){var r=0;e.length;function n(){var t=e[r]<<8|e[r+1];return r+=2,t}function i(){var t=n(),i=e.subarray(r,r+t-2);return r+=i.length,i}function o(t){var e,r,n=0,i=0;for(r in t.components)t.components.hasOwnProperty(r)&&(n<(e=t.components[r]).h&&(n=e.h),i>4==0)for(z=0;z<64;z++){x[t[z]]=e[r++]}else{if(b>>4!=1)throw"DQT: invalid table spec";for(z=0;z<64;z++){x[t[z]]=n()}}f[15&b]=x}break;case 65472:case 65473:case 65474:n(),(a={}).extended=65473===v,a.progressive=65474===v,a.precision=e[r++],a.scanLines=n(),a.samplesPerLine=n(),a.components={},a.componentsOrder=[];var w,E=e[r++];for(j=0;j>4,T=15&e[r+1],S=e[r+2];a.componentsOrder.push(w),a.components[w]={h:k,v:T,quantizationIdx:S},r+=3}o(a),d.push(a);break;case 65476:var A=n();for(j=2;j>4==0?g:m)[15&C]=c(R,P)}break;case 65501:n(),s=n();break;case 65498:n();var I=e[r++],M=[];for(j=0;j>4],G.huffmanTableAC=m[15&D],M.push(G)}var F=e[r++],L=e[r++],O=e[r++],N=h(e,r,a,M,s,F,L,O>>4,15&O);r+=N;break;default:if(255==e[r-3]&&e[r-2]>=192&&e[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;)e&1<>8&255),F(255&t)}function O(t,e,r,n,i){var o,a=i[0],s=i[240];for(var u=function(t,e){var r,n,i,o,a,s,u,l,c,h,p=0;for(c=0;c<8;++c){r=t[p],n=t[p+1],i=t[p+2],o=t[p+3],a=t[p+4],s=t[p+5],u=t[p+6];var f=r+(l=t[p+7]),m=r-l,g=n+u,v=n-u,_=i+s,y=i-s,b=o+a,x=o-a,w=f+b,E=f-b,k=g+_,T=g-_;t[p]=w+k,t[p+4]=w-k;var S=.707106781*(T+E);t[p+2]=E+S,t[p+6]=E-S;var A=.382683433*((w=x+y)-(T=v+m)),C=.5411961*w+A,R=1.306562965*T+A,B=.707106781*(k=y+v),P=m+B,I=m-B;t[p+5]=I+C,t[p+3]=I-C,t[p+1]=P+R,t[p+7]=P-R,p+=8}for(p=0,c=0;c<8;++c){r=t[p],n=t[p+8],i=t[p+16],o=t[p+24],a=t[p+32],s=t[p+40],u=t[p+48];var M=r+(l=t[p+56]),D=r-l,F=n+u,L=n-u,O=i+s,N=i-s,j=o+a,U=o-a,z=M+j,G=M-j,$=F+O,V=F-O;t[p]=z+$,t[p+32]=z-$;var X=.707106781*(V+G);t[p+16]=G+X,t[p+48]=G-X;var q=.382683433*((z=U+N)-(V=L+D)),K=.5411961*z+q,W=1.306562965*V+q,H=.707106781*($=N+L),Y=D+H,Z=D-H;t[p+40]=Z+K,t[p+24]=Z-K,t[p+8]=Y+W,t[p+56]=Y-W,p++}for(c=0;c<64;++c)h=t[c]*e[c],d[c]=h>0?h+.5|0:h-.5|0;return d}(t,e),l=0;l<64;++l)m[k[l]]=u[l];var c=m[0]-r;r=m[0],0==c?D(n[0]):(D(n[f[o=32767+c]]),D(p[o]));for(var h=63;h>0&&0==m[h];h--);if(0==h)return D(a),r;for(var g,v=1;v<=h;){for(var _=v;0==m[v]&&v<=h;++v);var y=v-_;if(y>=16){g=y>>4;for(var b=1;b<=g;++b)D(s);y&=15}o=32767+m[v],D(i[(y<<4)+f[o]]),D(p[o]),v++}return 63!=h&&D(a),r}function N(t){if(t<=0&&(t=1),t>100&&(t=100),a!=t){(function(t){for(var e=[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=s((e[r]*t+50)/100);n<1?n=1:n>255&&(n=255),u[k[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],o=0;o<64;o++){var a=s((i[o]*t+50)/100);a<1?a=1:a>255&&(a=255),l[k[o]]=a}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[k[f]]*p[d]*p[m]*8),h[f]=1/(l[k[f]]*p[d]*p[m]*8),f++})(t<50?Math.floor(5e3/t):Math.floor(200-2*t)),a=t}}this.encode=function(e,a){(new Date).getTime();a&&N(a),g=new Array,v=0,_=7,L(65496),L(65504),L(16),F(74),F(70),F(73),F(70),F(0),F(1),F(1),F(0),L(1),L(1),F(0),F(0),function(){L(65499),L(132),F(0);for(var t=0;t<64;t++)F(u[t]);F(1);for(var e=0;e<64;e++)F(l[e])}(),function(t,e){L(65472),L(17),F(8),L(e),L(t),F(3),F(1),F(17),F(0),F(2),F(17),F(1),F(3),F(17),F(1)}(e.width,e.height),function(){L(65476),L(418),F(0);for(var t=0;t<16;t++)F(T[t+1]);for(var e=0;e<=11;e++)F(S[e]);F(16);for(var r=0;r<16;r++)F(A[r+1]);for(var n=0;n<=161;n++)F(C[n]);F(1);for(var i=0;i<16;i++)F(R[i+1]);for(var o=0;o<=11;o++)F(B[o]);F(17);for(var a=0;a<16;a++)F(P[a+1]);for(var s=0;s<=161;s++)F(I[s])}(),L(65498),L(12),F(3),F(1),F(0),F(2),F(17),F(3),F(17),F(0),F(63),F(0);var s=0,p=0,f=0;v=0,_=7,this.encode.displayName="_encode_";for(var d,m,w,k,M,j,U,z,G,$=e.data,V=e.width,X=e.height,q=4*V,K=0;K>3)*q+(U=4*(7&G)),K+z>=X&&(j-=q*(K+1+z-X)),d+U>=q&&(j-=d+U-q+4),m=$[j++],w=$[j++],k=$[j++],y[G]=(E[m]+E[w+256>>0]+E[k+512>>0]>>16)-128,b[G]=(E[m+768>>0]+E[w+1024>>0]+E[k+1280>>0]>>16)-128,x[G]=(E[m+1280>>0]+E[w+1536>>0]+E[k+1792>>0]>>16)-128;s=O(y,c,s,r,i),p=O(b,h,p,n,o),f=O(x,h,f,n,o),d+=32}K+=8}if(_>=0){var W=[];W[1]=_+1,W[0]=(1<<_+1)-1,D(W)}return L(65497),new t(g)},function(){(new Date).getTime();e||(e=50),function(){for(var t=String.fromCharCode,e=0;e<256;e++)w[e]=t(e)}(),r=M(T,S),n=M(R,B),i=M(A,C),o=M(P,I),function(){for(var t=1,e=2,r=1;r<=15;r++){for(var n=t;n>0]=38470*t,E[t+512>>0]=7471*t+32768,E[t+768>>0]=-11059*t,E[t+1024>>0]=-21709*t,E[t+1280>>0]=32768*t+8421375,E[t+1536>>0]=-27439*t,E[t+1792>>0]=-5329*t}(),N(e),(new Date).getTime()}()}e.exports=function(t,e){void 0===e&&(e=50);return{data:new r(e).encode(t,e),width:t.width,height:t.height}}}).call(this,t("buffer").Buffer)},{buffer:73}],96:[function(t,e,r){arguments[4][67][0].apply(r,arguments)},{dup:67}],97:[function(t,e,r){"use strict";e.exports=function(t){for(var e=new Array(t),r=0;r=this.width||e<0||e>=this.height)&&!!this.data[e*this.width+t]},t.prototype.set=function(t,e,r){this.data[e*this.width+t]=r?1:0},t.prototype.setRegion=function(t,e,r,n,i){for(var o=e;o=this.size&&(i=(i^this.primitive)&this.size-1);for(o=0;o1&&0===e[0]){for(var n=1;ni.length&&(r=(o=[i,r])[0],i=o[1]);for(var o,a=new Uint8ClampedArray(i.length),s=i.length-r.length,u=0;ur?r:t}var s=function(){function t(t,e){this.width=t,this.data=new Uint8ClampedArray(t*e)}return t.prototype.get=function(t,e){return this.data[e*this.width+t]},t.prototype.set=function(t,e,r){this.data[e*this.width+t]=r},t}();e.binarize=function(t,e,r){if(t.length!==e*r*4)throw new Error("Malformed data passed to binarizer.");for(var u=new s(e,r),l=0;l0&&_>0)){var k=(g.get(_,v-1)+2*g.get(_-1,v)+g.get(_-1,v-1))/4;b6&&(r.setRegion(e-11,0,3,6,!0),r.setRegion(0,e-11,6,3,!0)),r}(e),s=[],l=0,h=0,p=!0,f=o-1;f>0;f-=2){6===f&&f--;for(var d=0;d=0;i--)for(var o=e-9;o>=e-11;o--)n=u(t.get(o,i),n);var l=0;for(o=5;o>=0;o--)for(i=e-9;i>=e-11;i--)l=u(t.get(o,i),l);for(var c,h=1/0,p=0,f=a.VERSIONS;p=0;n--)6!==n&&(e=u(t.get(8,n),e));var i=t.height,o=0;for(n=i-1;n>=i-7;n--)o=u(t.get(8,n),o);for(r=i-8;r1){var c=n.ecBlocks[0].numBlocks,h=n.ecBlocks[1].numBlocks;for(s=0;s0;)for(var p=0,f=i;p=3;){if((l=t.readBits(10))>=1e3)throw new Error("Invalid numeric value above 999");var a=Math.floor(l/100),s=Math.floor(l/10)%10,u=l%10;r.push(48+a,48+s,48+u),n+=a.toString()+s.toString()+u.toString(),o-=3}if(2===o){if((l=t.readBits(7))>=100)throw new Error("Invalid numeric value above 99");a=Math.floor(l/10),s=l%10;r.push(48+a,48+s),n+=a.toString()+s.toString()}else if(1===o){var l;if((l=t.readBits(4))>=10)throw new Error("Invalid numeric value above 9");r.push(48+l),n+=l.toString()}return{bytes:r,text:n}}!function(t){t.Numeric="numeric",t.Alphanumeric="alphanumeric",t.Byte="byte",t.Kanji="kanji",t.ECI="eci"}(n=e.Mode||(e.Mode={})),function(t){t[t.Terminator=0]="Terminator",t[t.Numeric=1]="Numeric",t[t.Alphanumeric=2]="Alphanumeric",t[t.Byte=4]="Byte",t[t.Kanji=8]="Kanji",t[t.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(t,e){for(var r=[],n="",i=[9,11,13][e],o=t.readBits(i);o>=2;){var a=t.readBits(11),s=Math.floor(a/45),l=a%45;r.push(u[s].charCodeAt(0),u[l].charCodeAt(0)),n+=u[s]+u[l],o-=2}if(1===o){s=t.readBits(6);r.push(u[s].charCodeAt(0)),n+=u[s]}return{bytes:r,text:n}}function c(t,e){for(var r=[],n="",i=[8,16,16][e],o=t.readBits(i),a=0;a>8,255&l),n+=String.fromCharCode(a.shiftJISTable[l])}return{bytes:r,text:n}}e.decode=function(t,e){for(var r,a,u,p,f=new o.BitStream(t),d=e<=9?0:e<=26?1:2,m={text:"",bytes:[],chunks:[]};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=s(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 _=l(f,d);m.text+=_.text,(a=m.bytes).push.apply(a,_.bytes),m.chunks.push({type:n.Alphanumeric,text:_.text})}else if(g===i.Byte){var y=c(f,d);m.text+=y.text,(u=m.bytes).push.apply(u,y.bytes),m.chunks.push({type:n.Byte,bytes:y.bytes,text:y.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})}}}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=function(){function t(t){this.byteOffset=0,this.bitOffset=0,this.bytes=t}return t.prototype.readBits=function(t){if(t<1||t>32||t>this.available())throw new Error("Cannot read "+t.toString()+" bits");var e=0;if(this.bitOffset>0){var r=8-this.bitOffset,n=t>8-n<<(o=r-n);e=(this.bytes[this.byteOffset]&i)>>o,t-=n,this.bitOffset+=n,8===this.bitOffset&&(this.bitOffset=0,this.byteOffset++)}if(t>0){for(;t>=8;)e=e<<8|255&this.bytes[this.byteOffset],this.byteOffset++,t-=8;if(t>0){var o;i=255>>(o=8-t)<>o,this.bitOffset+=t}}return e},t.prototype.available=function(){return 8*(this.bytes.length-this.byteOffset)-this.bitOffset},t}();e.BitStream=n},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.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(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=r(1),i=r(2);e.decode=function(t,e){var r=new Uint8ClampedArray(t.length);r.set(t);for(var o=new n.default(285,256,0),a=new i.default(o,r),s=new Uint8ClampedArray(e),u=!1,l=0;l=n/2;){var u=i,l=a;if(a=s,(i=o).isZero())return null;o=u;for(var c=t.zero,h=i.getCoefficient(i.degree()),p=t.inverse(h);o.degree()>=i.degree()&&!o.isZero();){var f=o.degree()-i.degree(),d=t.multiply(o.getCoefficient(o.degree()),p);c=c.addOrSubtract(t.buildMonomial(f,d)),o=o.addOrSubtract(i.multiplyByMonomial(f,d))}if(s=c.multiplyPoly(a).addOrSubtract(l),o.degree()>=i.degree())return null}var m=s.getCoefficient(0);if(0===m)return null;var g,v=t.inverse(m);return[s.multiply(v),o.multiply(v)]}(o,o.buildMonomial(e,1),h,e);if(null===p)return null;var f=function(t,e){var r=e.degree();if(1===r)return[e.getCoefficient(1)];for(var n=new Array(r),i=0,o=1;oMath.abs(e.x-t.x);c?(i=Math.floor(t.y),o=Math.floor(t.x),s=Math.floor(e.y),u=Math.floor(e.x)):(i=Math.floor(t.x),o=Math.floor(t.y),s=Math.floor(e.x),u=Math.floor(e.y));for(var h=Math.abs(s-i),p=Math.abs(u-o),f=Math.floor(-h/2),d=i0){if(_===u)break;_+=m,f-=h}}for(var x=[],w=0;w=t.bottom.startX&&v<=t.bottom.endX||g>=t.bottom.startX&&v<=t.bottom.endX||v<=t.bottom.startX&&g>=t.bottom.endX&&h[2]/(t.bottom.endX-t.bottom.startX)i})).length>0?y[0].bottom=_:r.push({top:_,bottom:_})}if(m){var y,b=e-h[4],x=b-h[3];_={startX:x,y:n,endX:b},(y=c.filter(function(t){return x>=t.bottom.startX&&x<=t.bottom.endX||b>=t.bottom.startX&&x<=t.bottom.endX||x<=t.bottom.startX&&b>=t.bottom.endX&&h[2]/(t.bottom.endX-t.bottom.startX)i})).length>0?y[0].bottom=_:c.push({top:_,bottom:_})}}},f=-1;f<=t.width;f++)p(f);e.push.apply(e,r.filter(function(t){return t.bottom.y!==n&&t.bottom.y-t.top.y>=2})),r=r.filter(function(t){return t.bottom.y===n}),u.push.apply(u,c.filter(function(t){return t.bottom.y!==n})),c=c.filter(function(t){return t.bottom.y===n})},f=0;f<=t.height;f++)p(f);e.push.apply(e,r.filter(function(t){return t.bottom.y-t.top.y>=2})),u.push.apply(u,c);var d=e.filter(function(t){return t.bottom.y-t.top.y>=2}).map(function(e){var r=(e.top.startX+e.top.endX+e.bottom.startX+e.bottom.endX)/4,n=(e.top.y+e.bottom.y+1)/2;if(t.get(Math.round(r),Math.round(n))){var i=[e.top.endX-e.top.startX,e.bottom.endX-e.bottom.startX,e.bottom.y-e.top.y+1],o=s(i)/i.length;return{score:h({x:Math.round(r),y:Math.round(n)},[1,1,3,1,1],t),x:r,y:n,size:o}}}).filter(function(t){return!!t}).sort(function(t,e){return t.score-e.score}).map(function(t,e,r){if(e>n)return null;var i=r.filter(function(t,r){return e!==r}).map(function(e){return{x:e.x,y:e.y,score:e.score+Math.pow(e.size-t.size,2)/t.size,size:e.size}}).sort(function(t,e){return t.score-e.score});if(i.length<2)return null;var o=t.score+i[0].score+i[1].score;return{points:[t].concat(i.slice(0,2)),score:o}}).filter(function(t){return!!t}).sort(function(t,e){return t.score-e.score});if(0===d.length)return null;var m,g,v=function(t,e,r){var n,i,o,s,u,l,c,h=a(t,e),p=a(e,r),f=a(t,r);return p>=h&&p>=f?(n=(s=[e,t,r])[0],i=s[1],o=s[2]):f>=p&&f>=h?(n=(u=[t,e,r])[0],i=u[1],o=u[2]):(n=(l=[t,r,e])[0],i=l[1],o=l[2]),(o.x-i.x)*(n.y-i.y)-(o.y-i.y)*(n.x-i.x)<0&&(n=(c=[o,n])[0],o=c[1]),{bottomLeft:n,topLeft:i,topRight:o}}(d[0].points[0],d[0].points[1],d[0].points[2]),_=v.topRight,y=v.topLeft,b=v.bottomLeft;try{x=function(t,e,r,n){var i=(s(l(t,r,n,5))/7+s(l(t,e,n,5))/7+s(l(r,t,n,5))/7+s(l(e,t,n,5))/7)/4;if(i<1)throw new Error("Invalid module size");var o=Math.round(a(t,e)/i),u=Math.round(a(t,r)/i),c=Math.floor((o+u)/2)+7;switch(c%4){case 0:c++;break;case 2:c--}return{dimension:c,moduleSize:i}}(y,_,b,t),m=x.dimension,g=x.moduleSize}catch(t){return null}var x,w=_.x-y.x+b.x,E=_.y-y.y+b.y,k=(a(y,b)+a(y,_))/2/g,T=1-3/k,S={x:y.x+T*(w-y.x),y:y.y+T*(E-y.y)},A=u.map(function(e){var r=(e.top.startX+e.top.endX+e.bottom.startX+e.bottom.endX)/4,n=(e.top.y+e.bottom.y+1)/2;if(t.get(Math.floor(r),Math.floor(n))){var i=[e.top.endX-e.top.startX,e.bottom.endX-e.bottom.startX,e.bottom.y-e.top.y+1];return s(i),{x:r,y:n,score:h({x:Math.floor(r),y:Math.floor(n)},[1,1,1],t)+a({x:r,y:n},S)}}}).filter(function(t){return!!t}).sort(function(t,e){return t.score-e.score}),C=k>=15&&A.length?A[0]:S;return{alignmentPattern:{x:C.x,y:C.y},bottomLeft:{x:b.x,y:b.y},dimension:m,topLeft:{x:y.x,y:y.y},topRight:{x:_.x,y:_.y}}}}]).default},"object"==typeof r&&"object"==typeof e?e.exports=i():"function"==typeof define&&define.amd?define([],i):"object"==typeof r?r.jsQR=i():n.jsQR=i()},{}],101:[function(t,e,r){(function(t){(function(){var n,i=200,o="Unsupported core-js use. Try https://npms.io/search?q=ponyfill.",a="Expected a function",s="__lodash_hash_undefined__",u=500,l="__lodash_placeholder__",c=1,h=2,p=4,f=1,d=2,m=1,g=2,v=4,_=8,y=16,b=32,x=64,w=128,E=256,k=512,T=30,S="...",A=800,C=16,R=1,B=2,P=1/0,I=9007199254740991,M=1.7976931348623157e308,D=NaN,F=4294967295,L=F-1,O=F>>>1,N=[["ary",w],["bind",m],["bindKey",g],["curry",_],["curryRight",y],["flip",k],["partial",b],["partialRight",x],["rearg",E]],j="[object Arguments]",U="[object Array]",z="[object AsyncFunction]",G="[object Boolean]",$="[object Date]",V="[object DOMException]",X="[object Error]",q="[object Function]",K="[object GeneratorFunction]",W="[object Map]",H="[object Number]",Y="[object Null]",Z="[object Object]",J="[object Proxy]",Q="[object RegExp]",tt="[object Set]",et="[object String]",rt="[object Symbol]",nt="[object Undefined]",it="[object WeakMap]",ot="[object WeakSet]",at="[object ArrayBuffer]",st="[object DataView]",ut="[object Float32Array]",lt="[object Float64Array]",ct="[object Int8Array]",ht="[object Int16Array]",pt="[object Int32Array]",ft="[object Uint8Array]",dt="[object Uint8ClampedArray]",mt="[object Uint16Array]",gt="[object Uint32Array]",vt=/\b__p \+= '';/g,_t=/\b(__p \+=) '' \+/g,yt=/(__e\(.*?\)|\b__t\)) \+\n'';/g,bt=/&(?:amp|lt|gt|quot|#39);/g,xt=/[&<>"']/g,wt=RegExp(bt.source),Et=RegExp(xt.source),kt=/<%-([\s\S]+?)%>/g,Tt=/<%([\s\S]+?)%>/g,St=/<%=([\s\S]+?)%>/g,At=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Ct=/^\w*$/,Rt=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Bt=/[\\^$.*+?()[\]{}|]/g,Pt=RegExp(Bt.source),It=/^\s+|\s+$/g,Mt=/^\s+/,Dt=/\s+$/,Ft=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,Lt=/\{\n\/\* \[wrapped with (.+)\] \*/,Ot=/,? & /,Nt=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,jt=/\\(\\)?/g,Ut=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,zt=/\w*$/,Gt=/^[-+]0x[0-9a-f]+$/i,$t=/^0b[01]+$/i,Vt=/^\[object .+?Constructor\]$/,Xt=/^0o[0-7]+$/i,qt=/^(?:0|[1-9]\d*)$/,Kt=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,Wt=/($^)/,Ht=/['\n\r\u2028\u2029\\]/g,Yt="\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff",Zt="\\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",Jt="[\\ud800-\\udfff]",Qt="["+Zt+"]",te="["+Yt+"]",ee="\\d+",re="[\\u2700-\\u27bf]",ne="[a-z\\xdf-\\xf6\\xf8-\\xff]",ie="[^\\ud800-\\udfff"+Zt+ee+"\\u2700-\\u27bfa-z\\xdf-\\xf6\\xf8-\\xffA-Z\\xc0-\\xd6\\xd8-\\xde]",oe="\\ud83c[\\udffb-\\udfff]",ae="[^\\ud800-\\udfff]",se="(?:\\ud83c[\\udde6-\\uddff]){2}",ue="[\\ud800-\\udbff][\\udc00-\\udfff]",le="[A-Z\\xc0-\\xd6\\xd8-\\xde]",ce="(?:"+ne+"|"+ie+")",he="(?:"+le+"|"+ie+")",pe="(?:"+te+"|"+oe+")"+"?",fe="[\\ufe0e\\ufe0f]?"+pe+("(?:\\u200d(?:"+[ae,se,ue].join("|")+")[\\ufe0e\\ufe0f]?"+pe+")*"),de="(?:"+[re,se,ue].join("|")+")"+fe,me="(?:"+[ae+te+"?",te,se,ue,Jt].join("|")+")",ge=RegExp("['’]","g"),ve=RegExp(te,"g"),_e=RegExp(oe+"(?="+oe+")|"+me+fe,"g"),ye=RegExp([le+"?"+ne+"+(?:['’](?:d|ll|m|re|s|t|ve))?(?="+[Qt,le,"$"].join("|")+")",he+"+(?:['’](?:D|LL|M|RE|S|T|VE))?(?="+[Qt,le+ce,"$"].join("|")+")",le+"?"+ce+"+(?:['’](?:d|ll|m|re|s|t|ve))?",le+"+(?:['’](?: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_])",ee,de].join("|"),"g"),be=RegExp("[\\u200d\\ud800-\\udfff"+Yt+"\\ufe0e\\ufe0f]"),xe=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,we=["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"],Ee=-1,ke={};ke[ut]=ke[lt]=ke[ct]=ke[ht]=ke[pt]=ke[ft]=ke[dt]=ke[mt]=ke[gt]=!0,ke[j]=ke[U]=ke[at]=ke[G]=ke[st]=ke[$]=ke[X]=ke[q]=ke[W]=ke[H]=ke[Z]=ke[Q]=ke[tt]=ke[et]=ke[it]=!1;var Te={};Te[j]=Te[U]=Te[at]=Te[st]=Te[G]=Te[$]=Te[ut]=Te[lt]=Te[ct]=Te[ht]=Te[pt]=Te[W]=Te[H]=Te[Z]=Te[Q]=Te[tt]=Te[et]=Te[rt]=Te[ft]=Te[dt]=Te[mt]=Te[gt]=!0,Te[X]=Te[q]=Te[it]=!1;var Se={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},Ae=parseFloat,Ce=parseInt,Re="object"==typeof t&&t&&t.Object===Object&&t,Be="object"==typeof self&&self&&self.Object===Object&&self,Pe=Re||Be||Function("return this")(),Ie="object"==typeof r&&r&&!r.nodeType&&r,Me=Ie&&"object"==typeof e&&e&&!e.nodeType&&e,De=Me&&Me.exports===Ie,Fe=De&&Re.process,Le=function(){try{var t=Me&&Me.require&&Me.require("util").types;return t||Fe&&Fe.binding&&Fe.binding("util")}catch(t){}}(),Oe=Le&&Le.isArrayBuffer,Ne=Le&&Le.isDate,je=Le&&Le.isMap,Ue=Le&&Le.isRegExp,ze=Le&&Le.isSet,Ge=Le&&Le.isTypedArray;function $e(t,e,r){switch(r.length){case 0:return t.call(e);case 1:return t.call(e,r[0]);case 2:return t.call(e,r[0],r[1]);case 3:return t.call(e,r[0],r[1],r[2])}return t.apply(e,r)}function Ve(t,e,r,n){for(var i=-1,o=null==t?0:t.length;++i-1}function Ye(t,e,r){for(var n=-1,i=null==t?0:t.length;++n-1;);return r}function _r(t,e){for(var r=t.length;r--&&or(e,t[r],0)>-1;);return r}var yr=cr({"À":"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"}),br=cr({"&":"&","<":"<",">":">",'"':""","'":"'"});function xr(t){return"\\"+Se[t]}function wr(t){return be.test(t)}function Er(t){var e=-1,r=Array(t.size);return t.forEach(function(t,n){r[++e]=[n,t]}),r}function kr(t,e){return function(r){return t(e(r))}}function Tr(t,e){for(var r=-1,n=t.length,i=0,o=[];++r",""":'"',"'":"'"});var Pr=function t(e){var r,Yt=(e=null==e?Pe:Pr.defaults(Pe.Object(),e,Pr.pick(Pe,we))).Array,Zt=e.Date,Jt=e.Error,Qt=e.Function,te=e.Math,ee=e.Object,re=e.RegExp,ne=e.String,ie=e.TypeError,oe=Yt.prototype,ae=Qt.prototype,se=ee.prototype,ue=e["__core-js_shared__"],le=ae.toString,ce=se.hasOwnProperty,he=0,pe=(r=/[^.]+$/.exec(ue&&ue.keys&&ue.keys.IE_PROTO||""))?"Symbol(src)_1."+r:"",fe=se.toString,de=le.call(ee),me=Pe._,_e=re("^"+le.call(ce).replace(Bt,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),be=De?e.Buffer:n,Se=e.Symbol,Re=e.Uint8Array,Be=be?be.allocUnsafe:n,Ie=kr(ee.getPrototypeOf,ee),Me=ee.create,Fe=se.propertyIsEnumerable,Le=oe.splice,rr=Se?Se.isConcatSpreadable:n,cr=Se?Se.iterator:n,Ir=Se?Se.toStringTag:n,Mr=function(){try{var t=jo(ee,"defineProperty");return t({},"",{}),t}catch(t){}}(),Dr=e.clearTimeout!==Pe.clearTimeout&&e.clearTimeout,Fr=Zt&&Zt.now!==Pe.Date.now&&Zt.now,Lr=e.setTimeout!==Pe.setTimeout&&e.setTimeout,Or=te.ceil,Nr=te.floor,jr=ee.getOwnPropertySymbols,Ur=be?be.isBuffer:n,zr=e.isFinite,Gr=oe.join,$r=kr(ee.keys,ee),Vr=te.max,Xr=te.min,qr=Zt.now,Kr=e.parseInt,Wr=te.random,Hr=oe.reverse,Yr=jo(e,"DataView"),Zr=jo(e,"Map"),Jr=jo(e,"Promise"),Qr=jo(e,"Set"),tn=jo(e,"WeakMap"),en=jo(ee,"create"),rn=tn&&new tn,nn={},on=ha(Yr),an=ha(Zr),sn=ha(Jr),un=ha(Qr),ln=ha(tn),cn=Se?Se.prototype:n,hn=cn?cn.valueOf:n,pn=cn?cn.toString:n;function fn(t){if(Cs(t)&&!vs(t)&&!(t instanceof vn)){if(t instanceof gn)return t;if(ce.call(t,"__wrapped__"))return pa(t)}return new gn(t)}var dn=function(){function t(){}return function(e){if(!As(e))return{};if(Me)return Me(e);t.prototype=e;var r=new t;return t.prototype=n,r}}();function mn(){}function gn(t,e){this.__wrapped__=t,this.__actions__=[],this.__chain__=!!e,this.__index__=0,this.__values__=n}function vn(t){this.__wrapped__=t,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=F,this.__views__=[]}function _n(t){var e=-1,r=null==t?0:t.length;for(this.clear();++e=e?t:e)),t}function Fn(t,e,r,i,o,a){var s,u=e&c,l=e&h,f=e&p;if(r&&(s=o?r(t,i,o,a):r(t)),s!==n)return s;if(!As(t))return t;var d=vs(t);if(d){if(s=function(t){var e=t.length,r=new t.constructor(e);return e&&"string"==typeof t[0]&&ce.call(t,"index")&&(r.index=t.index,r.input=t.input),r}(t),!u)return ro(t,s)}else{var m=Go(t),g=m==q||m==K;if(xs(t))return Yi(t,u);if(m==Z||m==j||g&&!o){if(s=l||g?{}:Vo(t),!u)return l?function(t,e){return no(t,zo(t),e)}(t,function(t,e){return t&&no(e,ou(e),t)}(s,t)):function(t,e){return no(t,Uo(t),e)}(t,Pn(s,t))}else{if(!Te[m])return o?t:{};s=function(t,e,r){var n,i,o,a=t.constructor;switch(e){case at:return Zi(t);case G:case $:return new a(+t);case st:return function(t,e){var r=e?Zi(t.buffer):t.buffer;return new t.constructor(r,t.byteOffset,t.byteLength)}(t,r);case ut:case lt:case ct:case ht:case pt:case ft:case dt:case mt:case gt:return Ji(t,r);case W:return new a;case H:case et:return new a(t);case Q:return(o=new(i=t).constructor(i.source,zt.exec(i))).lastIndex=i.lastIndex,o;case tt:return new a;case rt:return n=t,hn?ee(hn.call(n)):{}}}(t,m,u)}}a||(a=new wn);var v=a.get(t);if(v)return v;if(a.set(t,s),Ms(t))return t.forEach(function(n){s.add(Fn(n,e,r,n,t,a))}),s;if(Rs(t))return t.forEach(function(n,i){s.set(i,Fn(n,e,r,i,t,a))}),s;var _=d?n:(f?l?Io:Po:l?ou:iu)(t);return Xe(_||t,function(n,i){_&&(n=t[i=n]),Cn(s,i,Fn(n,e,r,i,t,a))}),s}function Ln(t,e,r){var i=r.length;if(null==t)return!i;for(t=ee(t);i--;){var o=r[i],a=e[o],s=t[o];if(s===n&&!(o in t)||!a(s))return!1}return!0}function On(t,e,r){if("function"!=typeof t)throw new ie(a);return ia(function(){t.apply(n,r)},e)}function Nn(t,e,r,n){var o=-1,a=He,s=!0,u=t.length,l=[],c=e.length;if(!u)return l;r&&(e=Ze(e,dr(r))),n?(a=Ye,s=!1):e.length>=i&&(a=gr,s=!1,e=new xn(e));t:for(;++o-1},yn.prototype.set=function(t,e){var r=this.__data__,n=Rn(r,t);return n<0?(++this.size,r.push([t,e])):r[n][1]=e,this},bn.prototype.clear=function(){this.size=0,this.__data__={hash:new _n,map:new(Zr||yn),string:new _n}},bn.prototype.delete=function(t){var e=Oo(this,t).delete(t);return this.size-=e?1:0,e},bn.prototype.get=function(t){return Oo(this,t).get(t)},bn.prototype.has=function(t){return Oo(this,t).has(t)},bn.prototype.set=function(t,e){var r=Oo(this,t),n=r.size;return r.set(t,e),this.size+=r.size==n?0:1,this},xn.prototype.add=xn.prototype.push=function(t){return this.__data__.set(t,s),this},xn.prototype.has=function(t){return this.__data__.has(t)},wn.prototype.clear=function(){this.__data__=new yn,this.size=0},wn.prototype.delete=function(t){var e=this.__data__,r=e.delete(t);return this.size=e.size,r},wn.prototype.get=function(t){return this.__data__.get(t)},wn.prototype.has=function(t){return this.__data__.has(t)},wn.prototype.set=function(t,e){var r=this.__data__;if(r instanceof yn){var n=r.__data__;if(!Zr||n.length0&&r(s)?e>1?Vn(s,e-1,r,n,i):Je(i,s):n||(i[i.length]=s)}return i}var Xn=so(),qn=so(!0);function Kn(t,e){return t&&Xn(t,e,iu)}function Wn(t,e){return t&&qn(t,e,iu)}function Hn(t,e){return We(e,function(e){return ks(t[e])})}function Yn(t,e){for(var r=0,i=(e=qi(e,t)).length;null!=t&&re}function ti(t,e){return null!=t&&ce.call(t,e)}function ei(t,e){return null!=t&&e in ee(t)}function ri(t,e,r){for(var i=r?Ye:He,o=t[0].length,a=t.length,s=a,u=Yt(a),l=1/0,c=[];s--;){var h=t[s];s&&e&&(h=Ze(h,dr(e))),l=Xr(h.length,l),u[s]=!r&&(e||o>=120&&h.length>=120)?new xn(s&&h):n}h=t[0];var p=-1,f=u[0];t:for(;++p=s)return u;var l=r[n];return u*("desc"==l?-1:1)}}return t.index-e.index}(t,e,r)})}function _i(t,e,r){for(var n=-1,i=e.length,o={};++n-1;)s!==t&&Le.call(s,u,1),Le.call(t,u,1);return t}function bi(t,e){for(var r=t?e.length:0,n=r-1;r--;){var i=e[r];if(r==n||i!==o){var o=i;qo(i)?Le.call(t,i,1):Ni(t,i)}}return t}function xi(t,e){return t+Nr(Wr()*(e-t+1))}function wi(t,e){var r="";if(!t||e<1||e>I)return r;do{e%2&&(r+=t),(e=Nr(e/2))&&(t+=t)}while(e);return r}function Ei(t,e){return oa(ta(t,e,Bu),t+"")}function ki(t){return kn(fu(t))}function Ti(t,e){var r=fu(t);return ua(r,Dn(e,0,r.length))}function Si(t,e,r,i){if(!As(t))return t;for(var o=-1,a=(e=qi(e,t)).length,s=a-1,u=t;null!=u&&++oi?0:i+e),(r=r>i?i:r)<0&&(r+=i),i=e>r?0:r-e>>>0,e>>>=0;for(var o=Yt(i);++n>>1,a=t[o];null!==a&&!Fs(a)&&(r?a<=e:a=i){var c=e?null:Eo(t);if(c)return Sr(c);s=!1,o=gr,l=new xn}else l=e?[]:u;t:for(;++n=i?t:Bi(t,e,r)}var Hi=Dr||function(t){return Pe.clearTimeout(t)};function Yi(t,e){if(e)return t.slice();var r=t.length,n=Be?Be(r):new t.constructor(r);return t.copy(n),n}function Zi(t){var e=new t.constructor(t.byteLength);return new Re(e).set(new Re(t)),e}function Ji(t,e){var r=e?Zi(t.buffer):t.buffer;return new t.constructor(r,t.byteOffset,t.length)}function Qi(t,e){if(t!==e){var r=t!==n,i=null===t,o=t==t,a=Fs(t),s=e!==n,u=null===e,l=e==e,c=Fs(e);if(!u&&!c&&!a&&t>e||a&&s&&l&&!u&&!c||i&&s&&l||!r&&l||!o)return 1;if(!i&&!a&&!c&&t1?r[o-1]:n,s=o>2?r[2]:n;for(a=t.length>3&&"function"==typeof a?(o--,a):n,s&&Ko(r[0],r[1],s)&&(a=o<3?n:a,o=1),e=ee(e);++i-1?o[a?e[s]:s]:n}}function po(t){return Bo(function(e){var r=e.length,i=r,o=gn.prototype.thru;for(t&&e.reverse();i--;){var s=e[i];if("function"!=typeof s)throw new ie(a);if(o&&!u&&"wrapper"==Do(s))var u=new gn([],!0)}for(i=u?i:r;++i1&&_.reverse(),h&&lu))return!1;var c=a.get(t);if(c&&a.get(e))return c==e;var h=-1,p=!0,m=r&d?new xn:n;for(a.set(t,e),a.set(e,t);++h-1&&t%1==0&&t1?"& ":"")+e[n],e=e.join(r>2?", ":" "),t.replace(Ft,"{\n/* [wrapped with "+e+"] */\n")}(n,function(t,e){return Xe(N,function(r){var n="_."+r[0];e&r[1]&&!He(t,n)&&t.push(n)}),t.sort()}(function(t){var e=t.match(Lt);return e?e[1].split(Ot):[]}(n),r)))}function sa(t){var e=0,r=0;return function(){var i=qr(),o=C-(i-r);if(r=i,o>0){if(++e>=A)return arguments[0]}else e=0;return t.apply(n,arguments)}}function ua(t,e){var r=-1,i=t.length,o=i-1;for(e=e===n?i:e;++r1?t[e-1]:n;return Ia(t,r="function"==typeof r?(t.pop(),r):n)});function ja(t){var e=fn(t);return e.__chain__=!0,e}function Ua(t,e){return e(t)}var za=Bo(function(t){var e=t.length,r=e?t[0]:0,i=this.__wrapped__,o=function(e){return Mn(e,t)};return!(e>1||this.__actions__.length)&&i instanceof vn&&qo(r)?((i=i.slice(r,+r+(e?1:0))).__actions__.push({func:Ua,args:[o],thisArg:n}),new gn(i,this.__chain__).thru(function(t){return e&&!t.length&&t.push(n),t})):this.thru(o)});var Ga=io(function(t,e,r){ce.call(t,r)?++t[r]:In(t,r,1)});var $a=ho(ga),Va=ho(va);function Xa(t,e){return(vs(t)?Xe:jn)(t,Lo(e,3))}function qa(t,e){return(vs(t)?qe:Un)(t,Lo(e,3))}var Ka=io(function(t,e,r){ce.call(t,r)?t[r].push(e):In(t,r,[e])});var Wa=Ei(function(t,e,r){var n=-1,i="function"==typeof e,o=ys(t)?Yt(t.length):[];return jn(t,function(t){o[++n]=i?$e(e,t,r):ni(t,e,r)}),o}),Ha=io(function(t,e,r){In(t,r,e)});function Ya(t,e){return(vs(t)?Ze:pi)(t,Lo(e,3))}var Za=io(function(t,e,r){t[r?0:1].push(e)},function(){return[[],[]]});var Ja=Ei(function(t,e){if(null==t)return[];var r=e.length;return r>1&&Ko(t,e[0],e[1])?e=[]:r>2&&Ko(e[0],e[1],e[2])&&(e=[e[0]]),vi(t,Vn(e,1),[])}),Qa=Fr||function(){return Pe.Date.now()};function ts(t,e,r){return e=r?n:e,e=t&&null==e?t.length:e,To(t,w,n,n,n,n,e)}function es(t,e){var r;if("function"!=typeof e)throw new ie(a);return t=zs(t),function(){return--t>0&&(r=e.apply(this,arguments)),t<=1&&(e=n),r}}var rs=Ei(function(t,e,r){var n=m;if(r.length){var i=Tr(r,Fo(rs));n|=b}return To(t,n,e,r,i)}),ns=Ei(function(t,e,r){var n=m|g;if(r.length){var i=Tr(r,Fo(ns));n|=b}return To(e,n,t,r,i)});function is(t,e,r){var i,o,s,u,l,c,h=0,p=!1,f=!1,d=!0;if("function"!=typeof t)throw new ie(a);function m(e){var r=i,a=o;return i=o=n,h=e,u=t.apply(a,r)}function g(t){var r=t-c;return c===n||r>=e||r<0||f&&t-h>=s}function v(){var t=Qa();if(g(t))return _(t);l=ia(v,function(t){var r=e-(t-c);return f?Xr(r,s-(t-h)):r}(t))}function _(t){return l=n,d&&i?m(t):(i=o=n,u)}function y(){var t=Qa(),r=g(t);if(i=arguments,o=this,c=t,r){if(l===n)return function(t){return h=t,l=ia(v,e),p?m(t):u}(c);if(f)return l=ia(v,e),m(c)}return l===n&&(l=ia(v,e)),u}return e=$s(e)||0,As(r)&&(p=!!r.leading,s=(f="maxWait"in r)?Vr($s(r.maxWait)||0,e):s,d="trailing"in r?!!r.trailing:d),y.cancel=function(){l!==n&&Hi(l),h=0,i=c=o=l=n},y.flush=function(){return l===n?u:_(Qa())},y}var os=Ei(function(t,e){return On(t,1,e)}),as=Ei(function(t,e,r){return On(t,$s(e)||0,r)});function ss(t,e){if("function"!=typeof t||null!=e&&"function"!=typeof e)throw new ie(a);var r=function(){var n=arguments,i=e?e.apply(this,n):n[0],o=r.cache;if(o.has(i))return o.get(i);var a=t.apply(this,n);return r.cache=o.set(i,a)||o,a};return r.cache=new(ss.Cache||bn),r}function us(t){if("function"!=typeof t)throw new ie(a);return function(){var e=arguments;switch(e.length){case 0:return!t.call(this);case 1:return!t.call(this,e[0]);case 2:return!t.call(this,e[0],e[1]);case 3:return!t.call(this,e[0],e[1],e[2])}return!t.apply(this,e)}}ss.Cache=bn;var ls=Ki(function(t,e){var r=(e=1==e.length&&vs(e[0])?Ze(e[0],dr(Lo())):Ze(Vn(e,1),dr(Lo()))).length;return Ei(function(n){for(var i=-1,o=Xr(n.length,r);++i=e}),gs=ii(function(){return arguments}())?ii:function(t){return Cs(t)&&ce.call(t,"callee")&&!Fe.call(t,"callee")},vs=Yt.isArray,_s=Oe?dr(Oe):function(t){return Cs(t)&&Jn(t)==at};function ys(t){return null!=t&&Ss(t.length)&&!ks(t)}function bs(t){return Cs(t)&&ys(t)}var xs=Ur||$u,ws=Ne?dr(Ne):function(t){return Cs(t)&&Jn(t)==$};function Es(t){if(!Cs(t))return!1;var e=Jn(t);return e==X||e==V||"string"==typeof t.message&&"string"==typeof t.name&&!Ps(t)}function ks(t){if(!As(t))return!1;var e=Jn(t);return e==q||e==K||e==z||e==J}function Ts(t){return"number"==typeof t&&t==zs(t)}function Ss(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=I}function As(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)}function Cs(t){return null!=t&&"object"==typeof t}var Rs=je?dr(je):function(t){return Cs(t)&&Go(t)==W};function Bs(t){return"number"==typeof t||Cs(t)&&Jn(t)==H}function Ps(t){if(!Cs(t)||Jn(t)!=Z)return!1;var e=Ie(t);if(null===e)return!0;var r=ce.call(e,"constructor")&&e.constructor;return"function"==typeof r&&r instanceof r&&le.call(r)==de}var Is=Ue?dr(Ue):function(t){return Cs(t)&&Jn(t)==Q};var Ms=ze?dr(ze):function(t){return Cs(t)&&Go(t)==tt};function Ds(t){return"string"==typeof t||!vs(t)&&Cs(t)&&Jn(t)==et}function Fs(t){return"symbol"==typeof t||Cs(t)&&Jn(t)==rt}var Ls=Ge?dr(Ge):function(t){return Cs(t)&&Ss(t.length)&&!!ke[Jn(t)]};var Os=bo(hi),Ns=bo(function(t,e){return t<=e});function js(t){if(!t)return[];if(ys(t))return Ds(t)?Rr(t):ro(t);if(cr&&t[cr])return function(t){for(var e,r=[];!(e=t.next()).done;)r.push(e.value);return r}(t[cr]());var e=Go(t);return(e==W?Er:e==tt?Sr:fu)(t)}function Us(t){return t?(t=$s(t))===P||t===-P?(t<0?-1:1)*M:t==t?t:0:0===t?t:0}function zs(t){var e=Us(t),r=e%1;return e==e?r?e-r:e:0}function Gs(t){return t?Dn(zs(t),0,F):0}function $s(t){if("number"==typeof t)return t;if(Fs(t))return D;if(As(t)){var e="function"==typeof t.valueOf?t.valueOf():t;t=As(e)?e+"":e}if("string"!=typeof t)return 0===t?t:+t;t=t.replace(It,"");var r=$t.test(t);return r||Xt.test(t)?Ce(t.slice(2),r?2:8):Gt.test(t)?D:+t}function Vs(t){return no(t,ou(t))}function Xs(t){return null==t?"":Li(t)}var qs=oo(function(t,e){if(Zo(e)||ys(e))no(e,iu(e),t);else for(var r in e)ce.call(e,r)&&Cn(t,r,e[r])}),Ks=oo(function(t,e){no(e,ou(e),t)}),Ws=oo(function(t,e,r,n){no(e,ou(e),t,n)}),Hs=oo(function(t,e,r,n){no(e,iu(e),t,n)}),Ys=Bo(Mn);var Zs=Ei(function(t,e){t=ee(t);var r=-1,i=e.length,o=i>2?e[2]:n;for(o&&Ko(e[0],e[1],o)&&(i=1);++r1),e}),no(t,Io(t),r),n&&(r=Fn(r,c|h|p,Co));for(var i=e.length;i--;)Ni(r,e[i]);return r});var lu=Bo(function(t,e){return null==t?{}:function(t,e){return _i(t,e,function(e,r){return tu(t,r)})}(t,e)});function cu(t,e){if(null==t)return{};var r=Ze(Io(t),function(t){return[t]});return e=Lo(e),_i(t,r,function(t,r){return e(t,r[0])})}var hu=ko(iu),pu=ko(ou);function fu(t){return null==t?[]:mr(t,iu(t))}var du=lo(function(t,e,r){return e=e.toLowerCase(),t+(r?mu(e):e)});function mu(t){return Eu(Xs(t).toLowerCase())}function gu(t){return(t=Xs(t))&&t.replace(Kt,yr).replace(ve,"")}var vu=lo(function(t,e,r){return t+(r?"-":"")+e.toLowerCase()}),_u=lo(function(t,e,r){return t+(r?" ":"")+e.toLowerCase()}),yu=uo("toLowerCase");var bu=lo(function(t,e,r){return t+(r?"_":"")+e.toLowerCase()});var xu=lo(function(t,e,r){return t+(r?" ":"")+Eu(e)});var wu=lo(function(t,e,r){return t+(r?" ":"")+e.toUpperCase()}),Eu=uo("toUpperCase");function ku(t,e,r){return t=Xs(t),(e=r?n:e)===n?function(t){return xe.test(t)}(t)?function(t){return t.match(ye)||[]}(t):function(t){return t.match(Nt)||[]}(t):t.match(e)||[]}var Tu=Ei(function(t,e){try{return $e(t,n,e)}catch(t){return Es(t)?t:new Jt(t)}}),Su=Bo(function(t,e){return Xe(e,function(e){e=ca(e),In(t,e,rs(t[e],t))}),t});function Au(t){return function(){return t}}var Cu=po(),Ru=po(!0);function Bu(t){return t}function Pu(t){return ui("function"==typeof t?t:Fn(t,c))}var Iu=Ei(function(t,e){return function(r){return ni(r,t,e)}}),Mu=Ei(function(t,e){return function(r){return ni(t,r,e)}});function Du(t,e,r){var n=iu(e),i=Hn(e,n);null!=r||As(e)&&(i.length||!n.length)||(r=e,e=t,t=this,i=Hn(e,iu(e)));var o=!(As(r)&&"chain"in r&&!r.chain),a=ks(t);return Xe(i,function(r){var n=e[r];t[r]=n,a&&(t.prototype[r]=function(){var e=this.__chain__;if(o||e){var r=t(this.__wrapped__);return(r.__actions__=ro(this.__actions__)).push({func:n,args:arguments,thisArg:t}),r.__chain__=e,r}return n.apply(t,Je([this.value()],arguments))})}),t}function Fu(){}var Lu=vo(Ze),Ou=vo(Ke),Nu=vo(er);function ju(t){return Wo(t)?lr(ca(t)):function(t){return function(e){return Yn(e,t)}}(t)}var Uu=yo(),zu=yo(!0);function Gu(){return[]}function $u(){return!1}var Vu=go(function(t,e){return t+e},0),Xu=wo("ceil"),qu=go(function(t,e){return t/e},1),Ku=wo("floor");var Wu,Hu=go(function(t,e){return t*e},1),Yu=wo("round"),Zu=go(function(t,e){return t-e},0);return fn.after=function(t,e){if("function"!=typeof e)throw new ie(a);return t=zs(t),function(){if(--t<1)return e.apply(this,arguments)}},fn.ary=ts,fn.assign=qs,fn.assignIn=Ks,fn.assignInWith=Ws,fn.assignWith=Hs,fn.at=Ys,fn.before=es,fn.bind=rs,fn.bindAll=Su,fn.bindKey=ns,fn.castArray=function(){if(!arguments.length)return[];var t=arguments[0];return vs(t)?t:[t]},fn.chain=ja,fn.chunk=function(t,e,r){e=(r?Ko(t,e,r):e===n)?1:Vr(zs(e),0);var i=null==t?0:t.length;if(!i||e<1)return[];for(var o=0,a=0,s=Yt(Or(i/e));oo?0:o+r),(i=i===n||i>o?o:zs(i))<0&&(i+=o),i=r>i?0:Gs(i);r>>0)?(t=Xs(t))&&("string"==typeof e||null!=e&&!Is(e))&&!(e=Li(e))&&wr(t)?Wi(Rr(t),0,r):t.split(e,r):[]},fn.spread=function(t,e){if("function"!=typeof t)throw new ie(a);return e=null==e?0:Vr(zs(e),0),Ei(function(r){var n=r[e],i=Wi(r,0,e);return n&&Je(i,n),$e(t,this,i)})},fn.tail=function(t){var e=null==t?0:t.length;return e?Bi(t,1,e):[]},fn.take=function(t,e,r){return t&&t.length?Bi(t,0,(e=r||e===n?1:zs(e))<0?0:e):[]},fn.takeRight=function(t,e,r){var i=null==t?0:t.length;return i?Bi(t,(e=i-(e=r||e===n?1:zs(e)))<0?0:e,i):[]},fn.takeRightWhile=function(t,e){return t&&t.length?Ui(t,Lo(e,3),!1,!0):[]},fn.takeWhile=function(t,e){return t&&t.length?Ui(t,Lo(e,3)):[]},fn.tap=function(t,e){return e(t),t},fn.throttle=function(t,e,r){var n=!0,i=!0;if("function"!=typeof t)throw new ie(a);return As(r)&&(n="leading"in r?!!r.leading:n,i="trailing"in r?!!r.trailing:i),is(t,e,{leading:n,maxWait:e,trailing:i})},fn.thru=Ua,fn.toArray=js,fn.toPairs=hu,fn.toPairsIn=pu,fn.toPath=function(t){return vs(t)?Ze(t,ca):Fs(t)?[t]:ro(la(Xs(t)))},fn.toPlainObject=Vs,fn.transform=function(t,e,r){var n=vs(t),i=n||xs(t)||Ls(t);if(e=Lo(e,4),null==r){var o=t&&t.constructor;r=i?n?new o:[]:As(t)&&ks(o)?dn(Ie(t)):{}}return(i?Xe:Kn)(t,function(t,n,i){return e(r,t,n,i)}),r},fn.unary=function(t){return ts(t,1)},fn.union=Ca,fn.unionBy=Ra,fn.unionWith=Ba,fn.uniq=function(t){return t&&t.length?Oi(t):[]},fn.uniqBy=function(t,e){return t&&t.length?Oi(t,Lo(e,2)):[]},fn.uniqWith=function(t,e){return e="function"==typeof e?e:n,t&&t.length?Oi(t,n,e):[]},fn.unset=function(t,e){return null==t||Ni(t,e)},fn.unzip=Pa,fn.unzipWith=Ia,fn.update=function(t,e,r){return null==t?t:ji(t,e,Xi(r))},fn.updateWith=function(t,e,r,i){return i="function"==typeof i?i:n,null==t?t:ji(t,e,Xi(r),i)},fn.values=fu,fn.valuesIn=function(t){return null==t?[]:mr(t,ou(t))},fn.without=Ma,fn.words=ku,fn.wrap=function(t,e){return cs(Xi(e),t)},fn.xor=Da,fn.xorBy=Fa,fn.xorWith=La,fn.zip=Oa,fn.zipObject=function(t,e){return $i(t||[],e||[],Cn)},fn.zipObjectDeep=function(t,e){return $i(t||[],e||[],Si)},fn.zipWith=Na,fn.entries=hu,fn.entriesIn=pu,fn.extend=Ks,fn.extendWith=Ws,Du(fn,fn),fn.add=Vu,fn.attempt=Tu,fn.camelCase=du,fn.capitalize=mu,fn.ceil=Xu,fn.clamp=function(t,e,r){return r===n&&(r=e,e=n),r!==n&&(r=(r=$s(r))==r?r:0),e!==n&&(e=(e=$s(e))==e?e:0),Dn($s(t),e,r)},fn.clone=function(t){return Fn(t,p)},fn.cloneDeep=function(t){return Fn(t,c|p)},fn.cloneDeepWith=function(t,e){return Fn(t,c|p,e="function"==typeof e?e:n)},fn.cloneWith=function(t,e){return Fn(t,p,e="function"==typeof e?e:n)},fn.conformsTo=function(t,e){return null==e||Ln(t,e,iu(e))},fn.deburr=gu,fn.defaultTo=function(t,e){return null==t||t!=t?e:t},fn.divide=qu,fn.endsWith=function(t,e,r){t=Xs(t),e=Li(e);var i=t.length,o=r=r===n?i:Dn(zs(r),0,i);return(r-=e.length)>=0&&t.slice(r,o)==e},fn.eq=fs,fn.escape=function(t){return(t=Xs(t))&&Et.test(t)?t.replace(xt,br):t},fn.escapeRegExp=function(t){return(t=Xs(t))&&Pt.test(t)?t.replace(Bt,"\\$&"):t},fn.every=function(t,e,r){var i=vs(t)?Ke:zn;return r&&Ko(t,e,r)&&(e=n),i(t,Lo(e,3))},fn.find=$a,fn.findIndex=ga,fn.findKey=function(t,e){return nr(t,Lo(e,3),Kn)},fn.findLast=Va,fn.findLastIndex=va,fn.findLastKey=function(t,e){return nr(t,Lo(e,3),Wn)},fn.floor=Ku,fn.forEach=Xa,fn.forEachRight=qa,fn.forIn=function(t,e){return null==t?t:Xn(t,Lo(e,3),ou)},fn.forInRight=function(t,e){return null==t?t:qn(t,Lo(e,3),ou)},fn.forOwn=function(t,e){return t&&Kn(t,Lo(e,3))},fn.forOwnRight=function(t,e){return t&&Wn(t,Lo(e,3))},fn.get=Qs,fn.gt=ds,fn.gte=ms,fn.has=function(t,e){return null!=t&&$o(t,e,ti)},fn.hasIn=tu,fn.head=ya,fn.identity=Bu,fn.includes=function(t,e,r,n){t=ys(t)?t:fu(t),r=r&&!n?zs(r):0;var i=t.length;return r<0&&(r=Vr(i+r,0)),Ds(t)?r<=i&&t.indexOf(e,r)>-1:!!i&&or(t,e,r)>-1},fn.indexOf=function(t,e,r){var n=null==t?0:t.length;if(!n)return-1;var i=null==r?0:zs(r);return i<0&&(i=Vr(n+i,0)),or(t,e,i)},fn.inRange=function(t,e,r){return e=Us(e),r===n?(r=e,e=0):r=Us(r),function(t,e,r){return t>=Xr(e,r)&&t=-I&&t<=I},fn.isSet=Ms,fn.isString=Ds,fn.isSymbol=Fs,fn.isTypedArray=Ls,fn.isUndefined=function(t){return t===n},fn.isWeakMap=function(t){return Cs(t)&&Go(t)==it},fn.isWeakSet=function(t){return Cs(t)&&Jn(t)==ot},fn.join=function(t,e){return null==t?"":Gr.call(t,e)},fn.kebabCase=vu,fn.last=Ea,fn.lastIndexOf=function(t,e,r){var i=null==t?0:t.length;if(!i)return-1;var o=i;return r!==n&&(o=(o=zs(r))<0?Vr(i+o,0):Xr(o,i-1)),e==e?function(t,e,r){for(var n=r+1;n--;)if(t[n]===e)return n;return n}(t,e,o):ir(t,sr,o,!0)},fn.lowerCase=_u,fn.lowerFirst=yu,fn.lt=Os,fn.lte=Ns,fn.max=function(t){return t&&t.length?Gn(t,Bu,Qn):n},fn.maxBy=function(t,e){return t&&t.length?Gn(t,Lo(e,2),Qn):n},fn.mean=function(t){return ur(t,Bu)},fn.meanBy=function(t,e){return ur(t,Lo(e,2))},fn.min=function(t){return t&&t.length?Gn(t,Bu,hi):n},fn.minBy=function(t,e){return t&&t.length?Gn(t,Lo(e,2),hi):n},fn.stubArray=Gu,fn.stubFalse=$u,fn.stubObject=function(){return{}},fn.stubString=function(){return""},fn.stubTrue=function(){return!0},fn.multiply=Hu,fn.nth=function(t,e){return t&&t.length?gi(t,zs(e)):n},fn.noConflict=function(){return Pe._===this&&(Pe._=me),this},fn.noop=Fu,fn.now=Qa,fn.pad=function(t,e,r){t=Xs(t);var n=(e=zs(e))?Cr(t):0;if(!e||n>=e)return t;var i=(e-n)/2;return _o(Nr(i),r)+t+_o(Or(i),r)},fn.padEnd=function(t,e,r){t=Xs(t);var n=(e=zs(e))?Cr(t):0;return e&&ne){var i=t;t=e,e=i}if(r||t%1||e%1){var o=Wr();return Xr(t+o*(e-t+Ae("1e-"+((o+"").length-1))),e)}return xi(t,e)},fn.reduce=function(t,e,r){var n=vs(t)?Qe:hr,i=arguments.length<3;return n(t,Lo(e,4),r,i,jn)},fn.reduceRight=function(t,e,r){var n=vs(t)?tr:hr,i=arguments.length<3;return n(t,Lo(e,4),r,i,Un)},fn.repeat=function(t,e,r){return e=(r?Ko(t,e,r):e===n)?1:zs(e),wi(Xs(t),e)},fn.replace=function(){var t=arguments,e=Xs(t[0]);return t.length<3?e:e.replace(t[1],t[2])},fn.result=function(t,e,r){var i=-1,o=(e=qi(e,t)).length;for(o||(o=1,t=n);++iI)return[];var r=F,n=Xr(t,F);e=Lo(e),t-=F;for(var i=fr(n,e);++r=a)return t;var u=r-Cr(i);if(u<1)return i;var l=s?Wi(s,0,u).join(""):t.slice(0,u);if(o===n)return l+i;if(s&&(u+=l.length-u),Is(o)){if(t.slice(u).search(o)){var c,h=l;for(o.global||(o=re(o.source,Xs(zt.exec(o))+"g")),o.lastIndex=0;c=o.exec(h);)var p=c.index;l=l.slice(0,p===n?u:p)}}else if(t.indexOf(Li(o),u)!=u){var f=l.lastIndexOf(o);f>-1&&(l=l.slice(0,f))}return l+i},fn.unescape=function(t){return(t=Xs(t))&&wt.test(t)?t.replace(bt,Br):t},fn.uniqueId=function(t){var e=++he;return Xs(t)+e},fn.upperCase=wu,fn.upperFirst=Eu,fn.each=Xa,fn.eachRight=qa,fn.first=ya,Du(fn,(Wu={},Kn(fn,function(t,e){ce.call(fn.prototype,e)||(Wu[e]=t)}),Wu),{chain:!1}),fn.VERSION="4.17.11",Xe(["bind","bindKey","curry","curryRight","partial","partialRight"],function(t){fn[t].placeholder=fn}),Xe(["drop","take"],function(t,e){vn.prototype[t]=function(r){r=r===n?1:Vr(zs(r),0);var i=this.__filtered__&&!e?new vn(this):this.clone();return i.__filtered__?i.__takeCount__=Xr(r,i.__takeCount__):i.__views__.push({size:Xr(r,F),type:t+(i.__dir__<0?"Right":"")}),i},vn.prototype[t+"Right"]=function(e){return this.reverse()[t](e).reverse()}}),Xe(["filter","map","takeWhile"],function(t,e){var r=e+1,n=r==R||3==r;vn.prototype[t]=function(t){var e=this.clone();return e.__iteratees__.push({iteratee:Lo(t,3),type:r}),e.__filtered__=e.__filtered__||n,e}}),Xe(["head","last"],function(t,e){var r="take"+(e?"Right":"");vn.prototype[t]=function(){return this[r](1).value()[0]}}),Xe(["initial","tail"],function(t,e){var r="drop"+(e?"":"Right");vn.prototype[t]=function(){return this.__filtered__?new vn(this):this[r](1)}}),vn.prototype.compact=function(){return this.filter(Bu)},vn.prototype.find=function(t){return this.filter(t).head()},vn.prototype.findLast=function(t){return this.reverse().find(t)},vn.prototype.invokeMap=Ei(function(t,e){return"function"==typeof t?new vn(this):this.map(function(r){return ni(r,t,e)})}),vn.prototype.reject=function(t){return this.filter(us(Lo(t)))},vn.prototype.slice=function(t,e){t=zs(t);var r=this;return r.__filtered__&&(t>0||e<0)?new vn(r):(t<0?r=r.takeRight(-t):t&&(r=r.drop(t)),e!==n&&(r=(e=zs(e))<0?r.dropRight(-e):r.take(e-t)),r)},vn.prototype.takeRightWhile=function(t){return this.reverse().takeWhile(t).reverse()},vn.prototype.toArray=function(){return this.take(F)},Kn(vn.prototype,function(t,e){var r=/^(?:filter|find|map|reject)|While$/.test(e),i=/^(?:head|last)$/.test(e),o=fn[i?"take"+("last"==e?"Right":""):e],a=i||/^find/.test(e);o&&(fn.prototype[e]=function(){var e=this.__wrapped__,s=i?[1]:arguments,u=e instanceof vn,l=s[0],c=u||vs(e),h=function(t){var e=o.apply(fn,Je([t],s));return i&&p?e[0]:e};c&&r&&"function"==typeof l&&1!=l.length&&(u=c=!1);var p=this.__chain__,f=!!this.__actions__.length,d=a&&!p,m=u&&!f;if(!a&&c){e=m?e:new vn(this);var g=t.apply(e,s);return g.__actions__.push({func:Ua,args:[h],thisArg:n}),new gn(g,p)}return d&&m?t.apply(this,s):(g=this.thru(h),d?i?g.value()[0]:g.value():g)})}),Xe(["pop","push","shift","sort","splice","unshift"],function(t){var e=oe[t],r=/^(?:push|sort|unshift)$/.test(t)?"tap":"thru",n=/^(?:pop|shift)$/.test(t);fn.prototype[t]=function(){var t=arguments;if(n&&!this.__chain__){var i=this.value();return e.apply(vs(i)?i:[],t)}return this[r](function(r){return e.apply(vs(r)?r:[],t)})}}),Kn(vn.prototype,function(t,e){var r=fn[e];if(r){var n=r.name+"";(nn[n]||(nn[n]=[])).push({name:e,func:r})}}),nn[fo(n,g).name]=[{name:"wrapper",func:n}],vn.prototype.clone=function(){var t=new vn(this.__wrapped__);return t.__actions__=ro(this.__actions__),t.__dir__=this.__dir__,t.__filtered__=this.__filtered__,t.__iteratees__=ro(this.__iteratees__),t.__takeCount__=this.__takeCount__,t.__views__=ro(this.__views__),t},vn.prototype.reverse=function(){if(this.__filtered__){var t=new vn(this);t.__dir__=-1,t.__filtered__=!0}else(t=this.clone()).__dir__*=-1;return t},vn.prototype.value=function(){var t=this.__wrapped__.value(),e=this.__dir__,r=vs(t),n=e<0,i=r?t.length:0,o=function(t,e,r){for(var n=-1,i=r.length;++n=this.__values__.length;return{done:t,value:t?n:this.__values__[this.__index__++]}},fn.prototype.plant=function(t){for(var e,r=this;r instanceof mn;){var i=pa(r);i.__index__=0,i.__values__=n,e?o.__wrapped__=i:e=i;var o=i;r=r.__wrapped__}return o.__wrapped__=t,e},fn.prototype.reverse=function(){var t=this.__wrapped__;if(t instanceof vn){var e=t;return this.__actions__.length&&(e=new vn(this)),(e=e.reverse()).__actions__.push({func:Ua,args:[Aa],thisArg:n}),new gn(e,this.__chain__)}return this.thru(Aa)},fn.prototype.toJSON=fn.prototype.valueOf=fn.prototype.value=function(){return zi(this.__wrapped__,this.__actions__)},fn.prototype.first=fn.prototype.head,cr&&(fn.prototype[cr]=function(){return this}),fn}();"function"==typeof define&&"object"==typeof define.amd&&define.amd?(Pe._=Pr,define(function(){return Pr})):Me?((Me.exports=Pr)._=Pr,Ie._=Pr):Pe._=Pr}).call(this)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],102:[function(t,e,r){(function(r){t("path");var n=t("fs");function i(){this.types=Object.create(null),this.extensions=Object.create(null)}i.prototype.define=function(t){for(var e in t){for(var n=t[e],i=0;i>",rrshift:">>>"};!function(){for(var t in s){var e=s[t];r[t]=a({args:["array","array","array"],body:{args:["a","b","c"],body:"a=b"+e+"c"},funcName:t}),r[t+"eq"]=a({args:["array","array"],body:{args:["a","b"],body:"a"+e+"=b"},rvalue:!0,funcName:t+"eq"}),r[t+"s"]=a({args:["array","array","scalar"],body:{args:["a","b","s"],body:"a=b"+e+"s"},funcName:t+"s"}),r[t+"seq"]=a({args:["array","scalar"],body:{args:["a","s"],body:"a"+e+"=s"},rvalue:!0,funcName:t+"seq"})}}();var u={not:"!",bnot:"~",neg:"-",recip:"1.0/"};!function(){for(var t in u){var e=u[t];r[t]=a({args:["array","array"],body:{args:["a","b"],body:"a="+e+"b"},funcName:t}),r[t+"eq"]=a({args:["array"],body:{args:["a"],body:"a="+e+"a"},rvalue:!0,count:2,funcName:t+"eq"})}}();var l={and:"&&",or:"||",eq:"===",neq:"!==",lt:"<",gt:">",leq:"<=",geq:">="};!function(){for(var t in l){var e=l[t];r[t]=a({args:["array","array","array"],body:{args:["a","b","c"],body:"a=b"+e+"c"},funcName:t}),r[t+"s"]=a({args:["array","array","scalar"],body:{args:["a","b","s"],body:"a=b"+e+"s"},funcName:t+"s"}),r[t+"eq"]=a({args:["array","array"],body:{args:["a","b"],body:"a=a"+e+"b"},rvalue:!0,count:2,funcName:t+"eq"}),r[t+"seq"]=a({args:["array","scalar"],body:{args:["a","s"],body:"a=a"+e+"s"},rvalue:!0,count:2,funcName:t+"seq"})}}();var c=["abs","acos","asin","atan","ceil","cos","exp","floor","log","round","sin","sqrt","tan"];!function(){for(var t=0;tthis_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=a({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=a({args:["array","array"],body:{args:["a","b"],body:"a=b"},funcName:"assign"}),r.assigns=a({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":15}],105:[function(t,e,r){"use strict";var n=t("ndarray"),i=t("./doConvert.js");e.exports=function(t,e){for(var r=[],o=t,a=1;Array.isArray(o);)r.push(o.length),a*=o.length,o=o[0];return 0===r.length?n():(e||(e=n(new Float64Array(a),r)),i(e,t),e)}},{"./doConvert.js":106,ndarray:107}],106:[function(t,e,r){e.exports=t("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":15}],107:[function(t,e,r){var n=t("iota-array"),i=t("is-buffer"),o="undefined"!=typeof Float64Array;function a(t,e){return t[0]-e[0]}function s(){var t,e=this.stride,r=new Array(e.length);for(t=0;tMath.abs(this.stride[1]))?[1,0]:[0,1]}})"):3===e&&o.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];}}})")):o.push("ORDER})")),o.push("proto.set=function "+r+"_set("+u.join(",")+",v){"),i?o.push("return this.data.set("+c+",v)}"):o.push("return this.data["+c+"]=v}"),o.push("proto.get=function "+r+"_get("+u.join(",")+"){"),i?o.push("return this.data.get("+c+")}"):o.push("return this.data["+c+"]}"),o.push("proto.index=function "+r+"_index(",u.join(),"){return "+c+"}"),o.push("proto.hi=function "+r+"_hi("+u.join(",")+"){return new "+r+"(this.data,"+a.map(function(t){return["(typeof i",t,"!=='number'||i",t,"<0)?this.shape[",t,"]:i",t,"|0"].join("")}).join(",")+","+a.map(function(t){return"this.stride["+t+"]"}).join(",")+",this.offset)}");var f=a.map(function(t){return"a"+t+"=this.shape["+t+"]"}),d=a.map(function(t){return"c"+t+"=this.stride["+t+"]"});o.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}");o.push("return new "+r+"(this.data,"+a.map(function(t){return"a"+t}).join(",")+","+a.map(function(t){return"c"+t}).join(",")+",b)}"),o.push("proto.step=function "+r+"_step("+u.join(",")+"){var "+a.map(function(t){return"a"+t+"=this.shape["+t+"]"}).join(",")+","+a.map(function(t){return"b"+t+"=this.stride["+t+"]"}).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 o.push("var ctor=CTOR_LIST[a.length+1];return ctor(this.data,a,b,c)}"),o.push("return function construct_"+r+"(data,shape,stride,offset){return new "+r+"(data,"+a.map(function(t){return"shape["+t+"]"}).join(",")+","+a.map(function(t){return"stride["+t+"]"}).join(",")+",offset)}"),new Function("CTOR_LIST","ORDER",o.join("\n"))(l[t],s)}var l={float32:[],float64:[],int8:[],int16:[],int32:[],uint8:[],uint16:[],uint32:[],array:[],uint8_clamped:[],buffer:[],generic:[]};e.exports=function(t,e,r,n){if(void 0===t)return(0,l.array[0])([]);"number"==typeof t&&(t=[t]),void 0===e&&(e=[t.length]);var a=e.length;if(void 0===r){r=new Array(a);for(var s=a-1,c=1;s>=0;--s)r[s]=c,c*=e[s]}if(void 0===n)for(n=0,s=0;s0&&(this._paused=!1,this.emit("drain"))}.bind(this))},a.prototype.write=function(t,e){return this.writable?(n.isBuffer(t)||(t=new n(t,e||this._encoding)),this._buffers.push(t),this._buffered+=t.length,this._process(),this._reads&&0==this._reads.length&&(this._paused=!0),this.writable&&!this._paused):(this.emit("error",new Error("Stream not writable")),!1)},a.prototype.end=function(t,e){t&&this.write(t,e),this.writable=!1,this._buffers&&(0==this._buffers.length?this._end():(this._buffers.push(null),this._process()))},a.prototype.destroySoon=a.prototype.end,a.prototype._end=function(){this._reads.length>0&&this.emit("error",new Error("There are some read requests waitng on finished stream")),this.destroy()},a.prototype.destroy=function(){this._buffers&&(this.writable=!1,this._reads=null,this._buffers=null,this.emit("close"))},a.prototype._process=function(){for(;this._buffered>0&&this._reads&&this._reads.length>0;){var t=this._reads[0];if(t.allowLess){this._reads.shift(),(o=this._buffers[0]).length>t.length?(this._buffered-=t.length,this._buffers[0]=o.slice(t.length),t.func.call(this,o.slice(0,t.length))):(this._buffered-=o.length,this._buffers.shift(),t.func.call(this,o))}else{if(!(this._buffered>=t.length))break;this._reads.shift();for(var e=0,r=0,i=new n(t.length);e0&&this._buffers.splice(0,r),this._buffered-=t.length,t.func.call(this,i)}}this._buffers&&this._buffers.length>0&&null==this._buffers[0]&&this._end()}}).call(this,t("_process"),t("buffer").Buffer)},{_process:139,buffer:73,stream:190,util:200}],109:[function(t,e,r){"use strict";e.exports={PNG_SIGNATURE:[137,80,78,71,13,10,26,10],TYPE_IHDR:1229472850,TYPE_IEND:1229278788,TYPE_IDAT:1229209940,TYPE_PLTE:1347179589,TYPE_tRNS:1951551059,TYPE_gAMA:1732332865,COLOR_PALETTE:1,COLOR_COLOR:2,COLOR_ALPHA:4}},{}],110:[function(t,e,r){"use strict";var n=t("util"),i=t("stream"),o=e.exports=function(){i.call(this),this._crc=-1,this.writable=!0};n.inherits(o,i),o.prototype.write=function(t){for(var e=0;e>>8;return!0},o.prototype.end=function(t){t&&this.write(t),this.emit("crc",this.crc32())},o.prototype.crc32=function(){return-1^this._crc},o.crc32=function(t){for(var e=-1,r=0;r>>8;return-1^e};for(var a=[],s=0;s<256;s++){for(var u=s,l=0;l<8;l++)1&u?u=3988292384^u>>>1:u>>>=1;a[s]=u}},{stream:190,util:200}],111:[function(t,e,r){(function(r){"use strict";var n=t("util"),i=(t("zlib"),t("./chunkstream")),o=e.exports=function(t,e,r,n,o){i.call(this),this._width=t,this._height=e,this._Bpp=r,this._data=n,this._options=o,this._line=0,"filterType"in o&&-1!=o.filterType?"number"==typeof o.filterType&&(o.filterType=[o.filterType]):o.filterType=[0,1,2,3,4],this._filters={0:this._filterNone.bind(this),1:this._filterSub.bind(this),2:this._filterUp.bind(this),3:this._filterAvg.bind(this),4:this._filterPaeth.bind(this)},this.read(this._width*r+1,this._reverseFilterLine.bind(this))};n.inherits(o,i);var a={1:{0:0,1:0,2:0,3:255},2:{0:0,1:0,2:0,3:1},3:{0:0,1:1,2:2,3:255},4:{0:0,1:1,2:2,3:3}};o.prototype._reverseFilterLine=function(t){var e=this._data,r=this._width<<2,n=this._line*r,i=t[0];if(0==i)for(var o=0;o0?e[u+c-4]:0;e[u+c]=255!=h?t[l+h]+p:255}else if(2==i)for(o=0;o0?e[u-r+c]:0;e[u+c]=255!=h?t[l+h]+f:255}else if(3==i)for(o=0;o0?e[u+c-4]:0,f=this._line>0?e[u-r+c]:0;var d=Math.floor((p+f)/2);e[u+c]=255!=h?t[l+h]+d:255}else if(4==i)for(o=0;o0?e[u+c-4]:0,f=this._line>0?e[u-r+c]:0;var m=o>0&&this._line>0?e[u-r+c-4]:0;d=s(p,f,m);e[u+c]=255!=h?t[l+h]+d:255}this._line++,this._line=4?t[e*n+a-4]:0,u=t[e*n+a]-s;r?r[e*i+1+a]=u:o+=Math.abs(u)}return o},o.prototype._filterUp=function(t,e,r){var n=this._width<<2,i=n+1,o=0;r&&(r[e*i]=2);for(var a=0;a0?t[(e-1)*n+a]:0,u=t[e*n+a]-s;r?r[e*i+1+a]=u:o+=Math.abs(u)}return o},o.prototype._filterAvg=function(t,e,r){var n=this._width<<2,i=n+1,o=0;r&&(r[e*i]=3);for(var a=0;a=4?t[e*n+a-4]:0,u=e>0?t[(e-1)*n+a]:0,l=t[e*n+a]-(s+u>>1);r?r[e*i+1+a]=l:o+=Math.abs(l)}return o},o.prototype._filterPaeth=function(t,e,r){var n=this._width<<2,i=n+1,o=0;r&&(r[e*i]=4);for(var a=0;a=4?t[e*n+a-4]:0,l=e>0?t[(e-1)*n+a]:0,c=a>=4&&e>0?t[(e-1)*n+a-4]:0,h=t[e*n+a]-s(u,l,c);r?r[e*i+1+a]=h:o+=Math.abs(h)}return o};var s=function(t,e,r){var n=t+e-r,i=Math.abs(n-t),o=Math.abs(n-e),a=Math.abs(n-r);return i<=o&&i<=a?t:o<=a?e:r}}).call(this,t("buffer").Buffer)},{"./chunkstream":108,buffer:73,util:200,zlib:71}],112:[function(t,e,r){(function(r){"use strict";var n=t("util"),i=t("stream"),o=t("zlib"),a=t("./filter"),s=t("./crc"),u=t("./constants"),l=e.exports=function(t){i.call(this),this._options=t,t.deflateChunkSize=t.deflateChunkSize||32768,t.deflateLevel=t.deflateLevel||9,t.deflateStrategy=t.deflateStrategy||3,this.readable=!0};n.inherits(l,i),l.prototype.pack=function(t,e,n){this.emit("data",new r(u.PNG_SIGNATURE)),this.emit("data",this._packIHDR(e,n));t=new a(e,n,4,t,this._options).filter();var i=o.createDeflate({chunkSize:this._options.deflateChunkSize,level:this._options.deflateLevel,strategy:this._options.deflateStrategy});i.on("error",this.emit.bind(this,"error")),i.on("data",function(t){this.emit("data",this._packIDAT(t))}.bind(this)),i.on("end",function(){this.emit("data",this._packIEND()),this.emit("end")}.bind(this)),i.end(t)},l.prototype._packChunk=function(t,e){var n=e?e.length:0,i=new r(n+12);return i.writeUInt32BE(n,0),i.writeUInt32BE(t,4),e&&e.copy(i,8),i.writeInt32BE(s.crc32(i.slice(4,i.length-4)),i.length-4),i},l.prototype._packIHDR=function(t,e){var n=new r(13);return n.writeUInt32BE(t,0),n.writeUInt32BE(e,4),n[8]=8,n[9]=6,n[10]=0,n[11]=0,n[12]=0,this._packChunk(u.TYPE_IHDR,n)},l.prototype._packIDAT=function(t){return this._packChunk(u.TYPE_IDAT,t)},l.prototype._packIEND=function(){return this._packChunk(u.TYPE_IEND,null)}}).call(this,t("buffer").Buffer)},{"./constants":109,"./crc":110,"./filter":111,buffer:73,stream:190,util:200,zlib:71}],113:[function(t,e,r){(function(r){"use strict";var n=t("util"),i=t("zlib"),o=t("./crc"),a=t("./chunkstream"),s=t("./constants"),u=t("./filter"),l=e.exports=function(t){a.call(this),this._options=t,t.checkCRC=!1!==t.checkCRC,this._hasIHDR=!1,this._hasIEND=!1,this._inflate=null,this._filter=null,this._crc=null,this._palette=[],this._colorType=0,this._chunks={},this._chunks[s.TYPE_IHDR]=this._handleIHDR.bind(this),this._chunks[s.TYPE_IEND]=this._handleIEND.bind(this),this._chunks[s.TYPE_IDAT]=this._handleIDAT.bind(this),this._chunks[s.TYPE_PLTE]=this._handlePLTE.bind(this),this._chunks[s.TYPE_tRNS]=this._handleTRNS.bind(this),this._chunks[s.TYPE_gAMA]=this._handleGAMA.bind(this),this.writable=!0,this.on("error",this._handleError.bind(this)),this._handleSignature()};n.inherits(l,a),l.prototype._handleError=function(){this.writable=!1,this.destroy(),this._inflate&&this._inflate.destroy()},l.prototype._handleSignature=function(){this.read(s.PNG_SIGNATURE.length,this._parseSignature.bind(this))},l.prototype._parseSignature=function(t){for(var e=s.PNG_SIGNATURE,r=0;rthis._palette.length)return void this.emit("error",new Error("More transparent colors than palette size"));for(var e=0;e0?this._handleIDAT(t):this._handleChunkEnd()},l.prototype._handleIEND=function(t){this.read(t,this._parseIEND.bind(this))},l.prototype._parseIEND=function(t){this._crc.write(t),this._inflate.end(),this._hasIEND=!0,this._handleChunkEnd()};var c={0:1,2:3,3:1,4:2,6:4};l.prototype._reverseFiltered=function(t,e,r){if(3==this._colorType)for(var n=e<<2,i=0;i0&&this.height>0?new n(4*this.width*this.height):null,t.fill&&this.data&&this.data.fill(0),this.gamma=0,this.readable=this.writable=!0,this._parser=new a(t||{}),this._parser.on("error",this.emit.bind(this,"error")),this._parser.on("close",this._handleClose.bind(this)),this._parser.on("metadata",this._metadata.bind(this)),this._parser.on("gamma",this._gamma.bind(this)),this._parser.on("parsed",function(t){this.data=t,this.emit("parsed",t)}.bind(this)),this._packer=new s(t),this._packer.on("data",this.emit.bind(this,"data")),this._packer.on("end",this.emit.bind(this,"end")),this._parser.on("close",this._handleClose.bind(this)),this._packer.on("error",this.emit.bind(this,"error"))};i.inherits(u,o),u.prototype.pack=function(){return e.nextTick(function(){this._packer.pack(this.data,this.width,this.height)}.bind(this)),this},u.prototype.parse=function(t,e){if(e){var r,n=null;this.once("parsed",r=function(t){this.removeListener("error",n),this.data=t,e(null,this)}.bind(this)),this.once("error",n=function(t){this.removeListener("parsed",r),e(t,null)}.bind(this))}return this.end(t),this},u.prototype.write=function(t){return this._parser.write(t),!0},u.prototype.end=function(t){this._parser.end(t)},u.prototype._metadata=function(t){this.width=t.width,this.height=t.height,this.data=t.data,delete t.data,this.emit("metadata",t)},u.prototype._gamma=function(t){this.gamma=t},u.prototype._handleClose=function(){this._parser.writable||this._packer.readable||this.emit("close")},u.prototype.bitblt=function(t,e,r,n,i,o,a){if(e>this.width||r>this.height||e+n>this.width||r+i>this.height)throw new Error("bitblt reading outside image");if(o>t.width||a>t.height||o+n>t.width||a+i>t.height)throw new Error("bitblt writing outside image");for(var s=0;s>=u,c-=u,g!==o){if(g===a)break;for(var v=go;)y=d[y]>>8,++_;var b=y;if(p+_+(v!==g?1:0)>n)return void console.log("Warning, gif stream longer than expected.");r[p++]=b;var x=p+=_;for(v!==g&&(r[p++]=b),y=v;_--;)y=d[y],r[--x]=255&y,y>>=8;null!==m&&s<4096&&(d[s++]=m<<8|b,s>=l+1&&u<12&&(++u,l=l<<1|1)),m=g}else s=a+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(t,e,r,n){var i=0,o=void 0===(n=void 0===n?{}:n).loop?null:n.loop,a=void 0===n.palette?null:n.palette;if(e<=0||r<=0||e>65535||r>65535)throw new Error("Width/Height invalid.");function s(t){var e=t.length;if(e<2||e>256||e&e-1)throw new Error("Invalid code/color length, must be power of 2 and 2 .. 256.");return e}t[i++]=71,t[i++]=73,t[i++]=70,t[i++]=56,t[i++]=57,t[i++]=97;var u=0,l=0;if(null!==a){for(var c=s(a);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(t[i++]=255&e,t[i++]=e>>8&255,t[i++]=255&r,t[i++]=r>>8&255,t[i++]=(null!==a?128:0)|u,t[i++]=l,t[i++]=0,null!==a)for(var h=0,p=a.length;h>16&255,t[i++]=f>>8&255,t[i++]=255&f}if(null!==o){if(o<0||o>65535)throw new Error("Loop count invalid.");t[i++]=33,t[i++]=255,t[i++]=11,t[i++]=78,t[i++]=69,t[i++]=84,t[i++]=83,t[i++]=67,t[i++]=65,t[i++]=80,t[i++]=69,t[i++]=50,t[i++]=46,t[i++]=48,t[i++]=3,t[i++]=1,t[i++]=255&o,t[i++]=o>>8&255,t[i++]=0}var d=!1;this.addFrame=function(e,r,n,o,u,l){if(!0===d&&(--i,d=!1),l=void 0===l?{}:l,e<0||r<0||e>65535||r>65535)throw new Error("x/y invalid.");if(n<=0||o<=0||n>65535||o>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,_=0;if(void 0!==l.transparent&&null!==l.transparent&&(v=!0,(_=l.transparent)<0||_>=p))throw new Error("Transparent color index.");if((0!==g||v||0!==m)&&(t[i++]=33,t[i++]=249,t[i++]=4,t[i++]=g<<2|(!0===v?1:0),t[i++]=255&m,t[i++]=m>>8&255,t[i++]=_,t[i++]=0),t[i++]=44,t[i++]=255&e,t[i++]=e>>8&255,t[i++]=255&r,t[i++]=r>>8&255,t[i++]=255&n,t[i++]=n>>8&255,t[i++]=255&o,t[i++]=o>>8&255,t[i++]=!0===c?128|f-1:0,!0===c)for(var y=0,b=h.length;y>16&255,t[i++]=x>>8&255,t[i++]=255&x}return i=function(t,e,r,n){t[e++]=r;var i=e++,o=1<=r;)t[e++]=255&h,h>>=8,c-=8,e===i+256&&(t[i]=255,i=e++)}function f(t){h|=t<=8;)t[e++]=255&h,h>>=8,c-=8,e===i+256&&(t[i]=255,i=e++);4096===u?(f(o),u=s+1,l=r+1,m={}):(u>=1<>7,s=1<<1+(7&o);t[e++],t[e++];var u=null,l=null;a&&(u=e,l=s,e+=3*s);var c=!0,h=[],p=0,f=null,d=0,m=null;for(this.width=r,this.height=i;c&&e=0))throw Error("Invalid block size");if(0===C)break;e+=C}break;case 249:if(4!==t[e++]||0!==t[e+4])throw new Error("Invalid graphics extension block.");var g=t[e++];p=t[e++]|t[e++]<<8,f=t[e++],0==(1&g)&&(f=null),d=g>>2&7,e++;break;case 254:for(;;){if(!((C=t[e++])>=0))throw Error("Invalid block size");if(0===C)break;e+=C}break;default:throw new Error("Unknown graphic control label: 0x"+t[e-1].toString(16))}break;case 44:var v=t[e++]|t[e++]<<8,_=t[e++]|t[e++]<<8,y=t[e++]|t[e++]<<8,b=t[e++]|t[e++]<<8,x=t[e++],w=x>>6&1,E=1<<1+(7&x),k=u,T=l,S=!1;x>>7&&(S=!0,k=e,T=E,e+=3*E);var A=e;for(e++;;){var C;if(!((C=t[e++])>=0))throw Error("Invalid block size");if(0===C)break;e+=C}h.push({x:v,y:_,width:y,height:b,has_local_palette:S,palette_offset:k,palette_size:T,data_offset:A,data_length:e-A,transparent_index:f,interlaced:!!w,delay:p,disposal:d});break;case 59:c=!1;break;default:throw new Error("Unknown gif block: 0x"+t[e-1].toString(16))}this.numFrames=function(){return h.length},this.loopCount=function(){return m},this.frameInfo=function(t){if(t<0||t>=h.length)throw new Error("Frame index out of range.");return h[t]},this.decodeAndBlitFrameBGRA=function(e,i){var o=this.frameInfo(e),a=o.width*o.height,s=new Uint8Array(a);n(t,o.data_offset,s,a);var u=o.palette_offset,l=o.transparent_index;null===l&&(l=256);var c=o.width,h=r-c,p=c,f=4*(o.y*r+o.x),d=4*((o.y+o.height)*r+o.x),m=f,g=4*h;!0===o.interlaced&&(g+=4*r*7);for(var v=8,_=0,y=s.length;_=d&&(g=4*h+4*r*(v-1),m=f+(c+h)*(v<<1),v>>=1)),b===l)m+=4;else{var x=t[u+3*b],w=t[u+3*b+1],E=t[u+3*b+2];i[m++]=E,i[m++]=w,i[m++]=x,i[m++]=255}--p}},this.decodeAndBlitFrameRGBA=function(e,i){var o=this.frameInfo(e),a=o.width*o.height,s=new Uint8Array(a);n(t,o.data_offset,s,a);var u=o.palette_offset,l=o.transparent_index;null===l&&(l=256);var c=o.width,h=r-c,p=c,f=4*(o.y*r+o.x),d=4*((o.y+o.height)*r+o.x),m=f,g=4*h;!0===o.interlaced&&(g+=4*r*7);for(var v=8,_=0,y=s.length;_=d&&(g=4*h+4*r*(v-1),m=f+(c+h)*(v<<1),v>>=1)),b===l)m+=4;else{var x=t[u+3*b],w=t[u+3*b+1],E=t[u+3*b+2];i[m++]=x,i[m++]=w,i[m++]=E,i[m++]=255}--p}}}}catch(t){}},{}],116:[function(t,e,r){(function(r){var n=t("charm");function i(t){if(!(t=t||{}).total)throw new Error("You MUST specify the total number of operations that will be processed.");this.total=t.total,this.current=0,this.max_burden=t.maxBurden||.5,this.show_burden=t.showBurden||!1,this.started=!1,this.size=50,this.inner_time=0,this.outer_time=0,this.elapsed=0,this.time_start=0,this.time_end=0,this.time_left=0,this.time_burden=0,this.skip_steps=0,this.skipped=0,this.aborted=!1,this.charm=n(),this.charm.pipe(r.stdout),this.charm.write("\n\n\n")}function o(t,e,r){for(r=r||" ";t.length3&&(u[0]=u[0].replace(/\B(?=(?:\d{3})+(?!\d))/g,a)),(u[1]||"").length=this.total&&this.finished(),this.time_end=(new Date).getTime(),this.inner_time=this.time_end-this.time_start)},i.prototype.updateTimes=function(){this.elapsed=this.time_start-this.started,this.time_end>0&&(this.outer_time=this.time_start-this.time_end),this.inner_time>0&&this.outer_time>0&&(this.time_burden=this.inner_time/(this.inner_time+this.outer_time)*100,this.time_left=this.elapsed/this.current*(this.total-this.current),this.time_left<0&&(this.time_left=0)),this.time_burden>this.max_burden&&this.skip_steps0&&this.current=0;n--){var i=t[n];"."===i?t.splice(n,1):".."===i?(t.splice(n,1),r++):r&&(t.splice(n,1),r--)}if(e)for(;r--;r)t.unshift("..");return t}function n(t,e){if(t.filter)return t.filter(e);for(var r=[],n=0;n=-1&&!i;o--){var a=o>=0?arguments[o]:t.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=e(n(r.split("/"),function(t){return!!t}),!i).join("/"),(i?"/":"")+r||"."},r.normalize=function(t){var o=r.isAbsolute(t),a="/"===i(t,-1);return(t=e(n(t.split("/"),function(t){return!!t}),!o).join("/"))||o||(t="."),t&&a&&(t+="/"),(o?"/":"")+t},r.isAbsolute=function(t){return"/"===t.charAt(0)},r.join=function(){var t=Array.prototype.slice.call(arguments,0);return r.normalize(n(t,function(t,e){if("string"!=typeof t)throw new TypeError("Arguments to path.join must be strings");return t}).join("/"))},r.relative=function(t,e){function n(t){for(var e=0;e=0&&""===t[r];r--);return e>r?[]:t.slice(e,r-e+1)}t=r.resolve(t).substr(1),e=r.resolve(e).substr(1);for(var i=n(t.split("/")),o=n(e.split("/")),a=Math.min(i.length,o.length),s=a,u=0;u=1;--o)if(47===(e=t.charCodeAt(o))){if(!i){n=o;break}}else i=!1;return-1===n?r?"/":".":r&&1===n?"/":t.slice(0,n)},r.basename=function(t,e){var r=function(t){"string"!=typeof t&&(t+="");var e,r=0,n=-1,i=!0;for(e=t.length-1;e>=0;--e)if(47===t.charCodeAt(e)){if(!i){r=e+1;break}}else-1===n&&(i=!1,n=e+1);return-1===n?"":t.slice(r,n)}(t);return e&&r.substr(-1*e.length)===e&&(r=r.substr(0,r.length-e.length)),r},r.extname=function(t){"string"!=typeof t&&(t+="");for(var e=-1,r=0,n=-1,i=!0,o=0,a=t.length-1;a>=0;--a){var s=t.charCodeAt(a);if(47!==s)-1===n&&(i=!1,n=a+1),46===s?-1===e?e=a:1!==o&&(o=1):-1!==e&&(o=-1);else if(!i){r=a+1;break}}return-1===e||-1===n||0===o||1===o&&e===n-1&&e===r+1?"":t.slice(e,n)};var i="b"==="ab".substr(-1)?function(t,e,r){return t.substr(e,r)}:function(t,e,r){return e<0&&(e=t.length+e),t.substr(e,r)}}).call(this,t("_process"))},{_process:139}],118:[function(t,e,r){(function(e){"use strict";var n=t("./interlace"),i={1:{0:0,1:0,2:0,3:255},2:{0:0,1:0,2:0,3:1},3:{0:0,1:1,2:2,3:255},4:{0:0,1:1,2:2,3:3}};function o(t,e,r,n,o,a){for(var s=t.width,u=t.height,l=t.index,c=0;c>4,r.push(h,c);break;case 2:u=3&p,l=p>>2&3,c=p>>4&3,h=p>>6&3,r.push(h,c,l,u);break;case 1:i=1&p,o=p>>1&1,a=p>>2&1,s=p>>3&1,u=p>>4&1,l=p>>5&1,c=p>>6&1,h=p>>7&1,r.push(h,c,l,u,s,a,o,i)}}return{get:function(t){for(;r.length0&&(this._paused=!1,this.emit("drain"))}.bind(this))},a.prototype.write=function(t,e){return this.writable?(r=n.isBuffer(t)?t:new n(t,e||this._encoding),this._buffers.push(r),this._buffered+=r.length,this._process(),this._reads&&0===this._reads.length&&(this._paused=!0),this.writable&&!this._paused):(this.emit("error",new Error("Stream not writable")),!1);var r},a.prototype.end=function(t,e){t&&this.write(t,e),this.writable=!1,this._buffers&&(0===this._buffers.length?this._end():(this._buffers.push(null),this._process()))},a.prototype.destroySoon=a.prototype.end,a.prototype._end=function(){this._reads.length>0&&this.emit("error",new Error("There are some read requests waitng on finished stream")),this.destroy()},a.prototype.destroy=function(){this._buffers&&(this.writable=!1,this._reads=null,this._buffers=null,this.emit("close"))},a.prototype._processReadAllowingLess=function(t){this._reads.shift();var e=this._buffers[0];e.length>t.length?(this._buffered-=t.length,this._buffers[0]=e.slice(t.length),t.func.call(this,e.slice(0,t.length))):(this._buffered-=e.length,this._buffers.shift(),t.func.call(this,e))},a.prototype._processRead=function(t){this._reads.shift();for(var e=0,r=0,i=new n(t.length);e0&&this._buffers.splice(0,r),this._buffered-=t.length,t.func.call(this,i)},a.prototype._process=function(){try{for(;this._buffered>0&&this._reads&&this._reads.length>0;){var t=this._reads[0];if(t.allowLess)this._processReadAllowingLess(t);else{if(!(this._buffered>=t.length))break;this._processRead(t)}}this._buffers&&this._buffers.length>0&&null===this._buffers[0]&&this._end()}catch(t){this.emit("error",t)}}}).call(this,t("_process"),t("buffer").Buffer)},{_process:139,buffer:73,stream:190,util:200}],121:[function(t,e,r){"use strict";e.exports={PNG_SIGNATURE:[137,80,78,71,13,10,26,10],TYPE_IHDR:1229472850,TYPE_IEND:1229278788,TYPE_IDAT:1229209940,TYPE_PLTE:1347179589,TYPE_tRNS:1951551059,TYPE_gAMA:1732332865,COLORTYPE_GRAYSCALE:0,COLORTYPE_PALETTE:1,COLORTYPE_COLOR:2,COLORTYPE_ALPHA:4,COLORTYPE_PALETTE_COLOR:3,COLORTYPE_COLOR_ALPHA:6,COLORTYPE_TO_BPP_MAP:{0:1,2:3,3:1,4:2,6:4},GAMMA_DIVISION:1e5}},{}],122:[function(t,e,r){"use strict";var n=[];!function(){for(var t=0;t<256;t++){for(var e=t,r=0;r<8;r++)1&e?e=3988292384^e>>>1:e>>>=1;n[t]=e}}();var i=e.exports=function(){this._crc=-1};i.prototype.write=function(t){for(var e=0;e>>8;return!0},i.prototype.crc32=function(){return-1^this._crc},i.crc32=function(t){for(var e=-1,r=0;r>>8;return-1^e}},{}],123:[function(t,e,r){(function(r){"use strict";var n=t("./paeth-predictor");var i={0:function(t,e,r,n,i){t.copy(n,i,e,e+r)},1:function(t,e,r,n,i,o){for(var a=0;a=o?t[e+a-o]:0,u=t[e+a]-s;n[i+a]=u}},2:function(t,e,r,n,i){for(var o=0;o0?t[e+o-r]:0,s=t[e+o]-a;n[i+o]=s}},3:function(t,e,r,n,i,o){for(var a=0;a=o?t[e+a-o]:0,u=e>0?t[e+a-r]:0,l=t[e+a]-(s+u>>1);n[i+a]=l}},4:function(t,e,r,i,o,a){for(var s=0;s=a?t[e+s-a]:0,l=e>0?t[e+s-r]:0,c=e>0&&s>=a?t[e+s-(r+a)]:0,h=t[e+s]-n(u,l,c);i[o+s]=h}}},o={0:function(t,e,r){for(var n=0,i=e+r,o=e;o=n?t[e+o-n]:0,s=t[e+o]-a;i+=Math.abs(s)}return i},2:function(t,e,r){for(var n=0,i=e+r,o=e;o0?t[o-r]:0,s=t[o]-a;n+=Math.abs(s)}return n},3:function(t,e,r,n){for(var i=0,o=0;o=n?t[e+o-n]:0,s=e>0?t[e+o-r]:0,u=t[e+o]-(a+s>>1);i+=Math.abs(u)}return i},4:function(t,e,r,i){for(var o=0,a=0;a=i?t[e+a-i]:0,u=e>0?t[e+a-r]:0,l=e>0&&a>=i?t[e+a-(r+i)]:0,c=t[e+a]-n(s,u,l);o+=Math.abs(c)}return o}};e.exports=function(t,e,n,a,s){var u;if("filterType"in a&&-1!==a.filterType){if("number"!=typeof a.filterType)throw new Error("unrecognised filter types");u=[a.filterType]}else u=[0,1,2,3,4];for(var l=e*s,c=0,h=0,p=new r((l+1)*n),f=u[0],d=0;d1)for(var m=1/0,g=0;gi?e[o-n]:0;e[o]=a+s}},a.prototype._unFilterType2=function(t,e,r){for(var n=this._lastLine,i=0;ii?e[a-n]:0,c=Math.floor((l+u)/2);e[a]=s+c}},a.prototype._unFilterType4=function(t,e,r){for(var n=this._xComparison,o=n-1,a=this._lastLine,s=0;so?e[s-n]:0,h=s>o&&a?a[s-n]:0,p=i(c,l,h);e[s]=u+p}},a.prototype._reverseFilterLine=function(t){var e,n=t[0],i=this._images[this._imageIndex],o=i.byteWidth;if(0===n)e=t.slice(1,o+1);else switch(e=new r(o),n){case 1:this._unFilterType1(t,e,o);break;case 2:this._unFilterType2(t,e,o);break;case 3:this._unFilterType3(t,e,o);break;case 4:this._unFilterType4(t,e,o);break;default:throw new Error("Unrecognised filter type - "+n)}this.write(e),i.lineIndex++,i.lineIndex>=i.height?(this._lastLine=null,this._imageIndex++,i=this._images[this._imageIndex]):this._lastLine=e,i?this.read(i.byteWidth+1,this._reverseFilterLine.bind(this)):(this._lastLine=null,this.complete())}}).call(this,t("buffer").Buffer)},{"./interlace":128,"./paeth-predictor":132,buffer:73}],127:[function(t,e,r){(function(t){"use strict";e.exports=function(e,r){var n=r.depth,i=r.width,o=r.height,a=r.colorType,s=r.transColor,u=r.palette,l=e;return 3===a?function(t,e,r,n,i){for(var o=0,a=0;a0&&h>0&&r.push({width:c,height:h,index:u})}return r},r.getInterlaceIterator=function(t){return function(e,r,i){var o=e%n[i].x.length,a=(e-o)/n[i].x.length*8+n[i].x[o],s=r%n[i].y.length;return 4*a+((r-s)/n[i].y.length*8+n[i].y[s])*t*4}}},{}],129:[function(t,e,r){(function(r){"use strict";var n=t("util"),i=t("stream"),o=t("./constants"),a=t("./packer"),s=e.exports=function(t){i.call(this);var e=t||{};this._packer=new a(e),this._deflate=this._packer.createDeflate(),this.readable=!0};n.inherits(s,i),s.prototype.pack=function(t,e,n,i){this.emit("data",new r(o.PNG_SIGNATURE)),this.emit("data",this._packer.packIHDR(e,n)),i&&this.emit("data",this._packer.packGAMA(i));var a=this._packer.filterData(t,e,n);this._deflate.on("error",this.emit.bind(this,"error")),this._deflate.on("data",function(t){this.emit("data",this._packer.packIDAT(t))}.bind(this)),this._deflate.on("end",function(){this.emit("data",this._packer.packIEND()),this.emit("end")}.bind(this)),this._deflate.end(a)}}).call(this,t("buffer").Buffer)},{"./constants":121,"./packer":131,buffer:73,stream:190,util:200}],130:[function(t,e,r){(function(r){"use strict";var n=!0,i=t("zlib");i.deflateSync||(n=!1);var o=t("./constants"),a=t("./packer");e.exports=function(t,e){if(!n)throw new Error("To use the sync capability of this library in old node versions, please also add a dependency on node-zlb-backport");var s=new a(e||{}),u=[];u.push(new r(o.PNG_SIGNATURE)),u.push(s.packIHDR(t.width,t.height)),t.gamma&&u.push(s.packGAMA(t.gamma));var l=s.filterData(t.data,t.width,t.height),c=i.deflateSync(l,s.getDeflateOptions());if(l=null,!c||!c.length)throw new Error("bad png - invalid compressed data response");return u.push(s.packIDAT(c)),u.push(s.packIEND()),r.concat(u)}}).call(this,t("buffer").Buffer)},{"./constants":121,"./packer":131,buffer:73,zlib:71}],131:[function(t,e,r){(function(r){"use strict";var n=t("./constants"),i=t("./crc"),o=t("./bitpacker"),a=t("./filter-pack"),s=t("zlib"),u=e.exports=function(t){if(this._options=t,t.deflateChunkSize=t.deflateChunkSize||32768,t.deflateLevel=null!=t.deflateLevel?t.deflateLevel:9,t.deflateStrategy=null!=t.deflateStrategy?t.deflateStrategy:3,t.inputHasAlpha=null==t.inputHasAlpha||t.inputHasAlpha,t.deflateFactory=t.deflateFactory||s.createDeflate,t.bitDepth=t.bitDepth||8,t.colorType="number"==typeof t.colorType?t.colorType:n.COLORTYPE_COLOR_ALPHA,t.colorType!==n.COLORTYPE_COLOR&&t.colorType!==n.COLORTYPE_COLOR_ALPHA)throw new Error("option color type:"+t.colorType+" is not supported at present");if(8!==t.bitDepth)throw new Error("option bit depth:"+t.bitDepth+" is not supported at present")};u.prototype.getDeflateOptions=function(){return{chunkSize:this._options.deflateChunkSize,level:this._options.deflateLevel,strategy:this._options.deflateStrategy}},u.prototype.createDeflate=function(){return this._options.deflateFactory(this.getDeflateOptions())},u.prototype.filterData=function(t,e,r){var i=o(t,e,r,this._options),s=n.COLORTYPE_TO_BPP_MAP[this._options.colorType];return a(i,e,r,this._options,s)},u.prototype._packChunk=function(t,e){var n=e?e.length:0,o=new r(n+12);return o.writeUInt32BE(n,0),o.writeUInt32BE(t,4),e&&e.copy(o,8),o.writeInt32BE(i.crc32(o.slice(4,o.length-4)),o.length-4),o},u.prototype.packGAMA=function(t){var e=new r(4);return e.writeUInt32BE(Math.floor(t*n.GAMMA_DIVISION),0),this._packChunk(n.TYPE_gAMA,e)},u.prototype.packIHDR=function(t,e){var i=new r(13);return i.writeUInt32BE(t,0),i.writeUInt32BE(e,4),i[8]=this._options.bitDepth,i[9]=this._options.colorType,i[10]=0,i[11]=0,i[12]=0,this._packChunk(n.TYPE_IHDR,i)},u.prototype.packIDAT=function(t){return this._packChunk(n.TYPE_IDAT,t)},u.prototype.packIEND=function(){return this._packChunk(n.TYPE_IEND,null)}}).call(this,t("buffer").Buffer)},{"./bitpacker":119,"./constants":121,"./crc":122,"./filter-pack":123,buffer:73,zlib:71}],132:[function(t,e,r){"use strict";e.exports=function(t,e,r){var n=t+e-r,i=Math.abs(n-t),o=Math.abs(n-e),a=Math.abs(n-r);return i<=o&&i<=a?t:o<=a?e:r}},{}],133:[function(t,e,r){"use strict";var n=t("util"),i=t("zlib"),o=t("./chunkstream"),a=t("./filter-parse-async"),s=t("./parser"),u=t("./bitmapper"),l=t("./format-normaliser"),c=e.exports=function(t){o.call(this),this._parser=new s(t,{read:this.read.bind(this),error:this._handleError.bind(this),metadata:this._handleMetaData.bind(this),gamma:this.emit.bind(this,"gamma"),palette:this._handlePalette.bind(this),transColor:this._handleTransColor.bind(this),finished:this._finished.bind(this),inflateData:this._inflateData.bind(this)}),this._options=t,this.writable=!0,this._parser.start()};n.inherits(c,o),c.prototype._handleError=function(t){this.emit("error",t),this.writable=!1,this.destroy(),this._inflate&&this._inflate.destroy&&this._inflate.destroy(),this.errord=!0},c.prototype._inflateData=function(t){this._inflate||(this._inflate=i.createInflate(),this._inflate.on("error",this.emit.bind(this,"error")),this._filter.on("complete",this._complete.bind(this)),this._inflate.pipe(this._filter)),this._inflate.write(t)},c.prototype._handleMetaData=function(t){this.emit("metadata",t),this._bitmapInfo=Object.create(t),this._filter=new a(this._bitmapInfo)},c.prototype._handleTransColor=function(t){this._bitmapInfo.transColor=t},c.prototype._handlePalette=function(t){this._bitmapInfo.palette=t},c.prototype._finished=function(){this.errord||(this._inflate?this._inflate.end():this.emit("error","No Inflate block"),this.destroySoon())},c.prototype._complete=function(t){if(!this.errord){try{var e=u.dataToBitMap(t,this._bitmapInfo),r=l(e,this._bitmapInfo);e=null}catch(t){return void this._handleError(t)}this.emit("parsed",r)}}},{"./bitmapper":118,"./chunkstream":120,"./filter-parse-async":124,"./format-normaliser":127,"./parser":135,util:200,zlib:71}],134:[function(t,e,r){(function(r){"use strict";var n=!0,i=t("zlib");i.deflateSync||(n=!1);var o=t("./sync-reader"),a=t("./filter-parse-sync"),s=t("./parser"),u=t("./bitmapper"),l=t("./format-normaliser");e.exports=function(t,e){if(!n)throw new Error("To use the sync capability of this library in old node versions, please also add a dependency on node-zlb-backport");var c,h,p;var f=[];var d=new o(t);if(new s(e,{read:d.read.bind(d),error:function(t){c=t},metadata:function(t){h=t},gamma:function(t){p=t},palette:function(t){h.palette=t},transColor:function(t){h.transColor=t},inflateData:function(t){f.push(t)}}).start(),d.process(),c)throw c;var m=r.concat(f);f.length=0;var g=i.inflateSync(m);if(m=null,!g||!g.length)throw new Error("bad png - invalid inflate data response");var v=a.process(g,h);m=null;var _=u.dataToBitMap(v,h);v=null;var y=l(_,h);return h.data=y,h.gamma=p||0,h}}).call(this,t("buffer").Buffer)},{"./bitmapper":118,"./filter-parse-sync":125,"./format-normaliser":127,"./parser":135,"./sync-reader":138,buffer:73,zlib:71}],135:[function(t,e,r){(function(r){"use strict";var n=t("./constants"),i=t("./crc"),o=e.exports=function(t,e){this._options=t,t.checkCRC=!1!==t.checkCRC,this._hasIHDR=!1,this._hasIEND=!1,this._palette=[],this._colorType=0,this._chunks={},this._chunks[n.TYPE_IHDR]=this._handleIHDR.bind(this),this._chunks[n.TYPE_IEND]=this._handleIEND.bind(this),this._chunks[n.TYPE_IDAT]=this._handleIDAT.bind(this),this._chunks[n.TYPE_PLTE]=this._handlePLTE.bind(this),this._chunks[n.TYPE_tRNS]=this._handleTRNS.bind(this),this._chunks[n.TYPE_gAMA]=this._handleGAMA.bind(this),this.read=e.read,this.error=e.error,this.metadata=e.metadata,this.gamma=e.gamma,this.transColor=e.transColor,this.palette=e.palette,this.parsed=e.parsed,this.inflateData=e.inflateData,this.inflateData=e.inflateData,this.finished=e.finished};o.prototype.start=function(){this.read(n.PNG_SIGNATURE.length,this._parseSignature.bind(this))},o.prototype._parseSignature=function(t){for(var e=n.PNG_SIGNATURE,r=0;rthis._palette.length)return void this.error(new Error("More transparent colors than palette size"));for(var e=0;e0?this._handleIDAT(r):this._handleChunkEnd()},o.prototype._handleIEND=function(t){this.read(t,this._parseIEND.bind(this))},o.prototype._parseIEND=function(t){this._crc.write(t),this._hasIEND=!0,this._handleChunkEnd(),this.finished&&this.finished()}}).call(this,t("buffer").Buffer)},{"./constants":121,"./crc":122,buffer:73}],136:[function(t,e,r){"use strict";var n=t("./parser-sync"),i=t("./packer-sync");r.read=function(t,e){return n(t,e||{})},r.write=function(t){return i(t)}},{"./packer-sync":130,"./parser-sync":134}],137:[function(t,e,r){(function(e,n){"use strict";var i=t("util"),o=t("stream"),a=t("./parser-async"),s=t("./packer-async"),u=t("./png-sync"),l=r.PNG=function(t){o.call(this),t=t||{},this.width=t.width||0,this.height=t.height||0,this.data=this.width>0&&this.height>0?new n(4*this.width*this.height):null,t.fill&&this.data&&this.data.fill(0),this.gamma=0,this.readable=this.writable=!0,this._parser=new a(t),this._parser.on("error",this.emit.bind(this,"error")),this._parser.on("close",this._handleClose.bind(this)),this._parser.on("metadata",this._metadata.bind(this)),this._parser.on("gamma",this._gamma.bind(this)),this._parser.on("parsed",function(t){this.data=t,this.emit("parsed",t)}.bind(this)),this._packer=new s(t),this._packer.on("data",this.emit.bind(this,"data")),this._packer.on("end",this.emit.bind(this,"end")),this._parser.on("close",this._handleClose.bind(this)),this._packer.on("error",this.emit.bind(this,"error"))};i.inherits(l,o),l.sync=u,l.prototype.pack=function(){return this.data&&this.data.length?(e.nextTick(function(){this._packer.pack(this.data,this.width,this.height,this.gamma)}.bind(this)),this):(this.emit("error","No data provided"),this)},l.prototype.parse=function(t,e){var r,n;e&&(r=function(t){this.removeListener("error",n),this.data=t,e(null,this)}.bind(this),n=function(t){this.removeListener("parsed",r),e(t,null)}.bind(this),this.once("parsed",r),this.once("error",n));return this.end(t),this},l.prototype.write=function(t){return this._parser.write(t),!0},l.prototype.end=function(t){this._parser.end(t)},l.prototype._metadata=function(t){this.width=t.width,this.height=t.height,this.emit("metadata",t)},l.prototype._gamma=function(t){this.gamma=t},l.prototype._handleClose=function(){this._parser.writable||this._packer.readable||this.emit("close")},l.bitblt=function(t,e,r,n,i,o,a,s){if(r>t.width||n>t.height||r+i>t.width||n+o>t.height)throw new Error("bitblt reading outside image");if(a>e.width||s>e.height||a+i>e.width||s+o>e.height)throw new Error("bitblt writing outside image");for(var u=0;u0&&this._buffer.length;){var t=this._reads[0];if(!this._buffer.length||!(this._buffer.length>=t.length||t.allowLess))break;this._reads.shift();var e=this._buffer;this._buffer=e.slice(t.length),t.func.call(this,e.slice(0,t.length))}return this._reads.length>0?new Error("There are some read requests waitng on finished stream"):this._buffer.length>0?new Error("unrecognised content at end of stream"):void 0}},{}],139:[function(t,e,r){var n,i,o=e.exports={};function a(){throw new Error("setTimeout has not been defined")}function s(){throw new Error("clearTimeout has not been defined")}function u(t){if(n===setTimeout)return setTimeout(t,0);if((n===a||!n)&&setTimeout)return n=setTimeout,setTimeout(t,0);try{return n(t,0)}catch(e){try{return n.call(null,t,0)}catch(e){return n.call(this,t,0)}}}!function(){try{n="function"==typeof setTimeout?setTimeout:a}catch(t){n=a}try{i="function"==typeof clearTimeout?clearTimeout:s}catch(t){i=s}}();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 t=u(f);h=!0;for(var e=c.length;e;){for(l=c,c=[];++p1)for(var r=1;r>>7-t%8&1)},put:function(t,e){for(var r=0;r>>e-r-1&1))},getLengthInBits:function(){return this.length},putBit:function(t){var e=Math.floor(this.length/8);this.buffer.length<=e&&this.buffer.push(0),t&&(this.buffer[e]|=128>>>this.length%8),this.length++}},e.exports=n},{}],145:[function(t,e,r){var n=t("../utils/buffer");function i(t){if(!t||t<1)throw new Error("BitMatrix size must be defined and greater than 0");this.size=t,this.data=new n(t*t),this.data.fill(0),this.reservedBit=new n(t*t),this.reservedBit.fill(0)}i.prototype.set=function(t,e,r,n){var i=t*this.size+e;this.data[i]=r,n&&(this.reservedBit[i]=!0)},i.prototype.get=function(t,e){return this.data[t*this.size+e]},i.prototype.xor=function(t,e,r){this.data[t*this.size+e]^=r},i.prototype.isReserved=function(t,e){return this.reservedBit[t*this.size+e]},e.exports=i},{"../utils/buffer":167}],146:[function(t,e,r){var n=t("../utils/buffer"),i=t("./mode");function o(t){this.mode=i.BYTE,this.data=new n(t)}o.getBitsLength=function(t){return 8*t},o.prototype.getLength=function(){return this.data.length},o.prototype.getBitsLength=function(){return o.getBitsLength(this.data.length)},o.prototype.write=function(t){for(var e=0,r=this.data.length;e=0&&t.bit<4},r.from=function(t,e){if(r.isValid(t))return t;try{return function(t){if("string"!=typeof t)throw new Error("Param is not a string");switch(t.toLowerCase()){case"l":case"low":return r.L;case"m":case"medium":return r.M;case"q":case"quartile":return r.Q;case"h":case"high":return r.H;default:throw new Error("Unknown EC Level: "+t)}}(t)}catch(t){return e}}},{}],149:[function(t,e,r){var n=t("./utils").getSymbolSize;r.getPositions=function(t){var e=n(t);return[[0,0],[e-7,0],[0,e-7]]}},{"./utils":161}],150:[function(t,e,r){var n=t("./utils"),i=n.getBCHDigit(1335);r.getEncodedBits=function(t,e){for(var r=t.bit<<3|e,o=r<<10;n.getBCHDigit(o)-i>=0;)o^=1335<=33088&&r<=40956)r-=33088;else{if(!(r>=57408&&r<=60351))throw new Error("Invalid SJIS character: "+this.data[e]+"\nMake sure your charset is UTF-8");r-=49472}r=192*(r>>>8&255)+(255&r),t.put(r,13)}},e.exports=o},{"./mode":154,"./utils":161}],153:[function(t,e,r){r.Patterns={PATTERN000:0,PATTERN001:1,PATTERN010:2,PATTERN011:3,PATTERN100:4,PATTERN101:5,PATTERN110:6,PATTERN111:7};var n=3,i=3,o=40,a=10;function s(t,e,n){switch(t){case r.Patterns.PATTERN000:return(e+n)%2==0;case r.Patterns.PATTERN001:return e%2==0;case r.Patterns.PATTERN010:return n%3==0;case r.Patterns.PATTERN011:return(e+n)%3==0;case r.Patterns.PATTERN100:return(Math.floor(e/2)+Math.floor(n/3))%2==0;case r.Patterns.PATTERN101:return e*n%2+e*n%3==0;case r.Patterns.PATTERN110:return(e*n%2+e*n%3)%2==0;case r.Patterns.PATTERN111:return(e*n%3+(e+n)%2)%2==0;default:throw new Error("bad maskPattern:"+t)}}r.isValid=function(t){return null!=t&&""!==t&&!isNaN(t)&&t>=0&&t<=7},r.from=function(t){return r.isValid(t)?parseInt(t,10):void 0},r.getPenaltyN1=function(t){for(var e=t.size,r=0,i=0,o=0,a=null,s=null,u=0;u=5&&(r+=n+(i-5)),a=c,i=1),(c=t.get(l,u))===s?o++:(o>=5&&(r+=n+(o-5)),s=c,o=1)}i>=5&&(r+=n+(i-5)),o>=5&&(r+=n+(o-5))}return r},r.getPenaltyN2=function(t){for(var e=t.size,r=0,n=0;n=10&&(1488===n||93===n)&&r++,i=i<<1&2047|t.get(s,a),s>=10&&(1488===i||93===i)&&r++}return r*o},r.getPenaltyN4=function(t){for(var e=0,r=t.data.length,n=0;n=1&&e<10?t.ccBits[0]:e<27?t.ccBits[1]:t.ccBits[2]},r.getBestModeForData=function(t){return i.testNumeric(t)?r.NUMERIC:i.testAlphanumeric(t)?r.ALPHANUMERIC:i.testKanji(t)?r.KANJI:r.BYTE},r.toString=function(t){if(t&&t.id)return t.id;throw new Error("Invalid mode")},r.isValid=function(t){return t&&t.bit&&t.ccBits},r.from=function(t,e){if(r.isValid(t))return t;try{return function(t){if("string"!=typeof t)throw new Error("Param is not a string");switch(t.toLowerCase()){case"numeric":return r.NUMERIC;case"alphanumeric":return r.ALPHANUMERIC;case"kanji":return r.KANJI;case"byte":return r.BYTE;default:throw new Error("Unknown mode: "+t)}}(t)}catch(t){return e}}},{"./regex":159,"./version-check":162}],155:[function(t,e,r){var n=t("./mode");function i(t){this.mode=n.NUMERIC,this.data=t.toString()}i.getBitsLength=function(t){return 10*Math.floor(t/3)+(t%3?t%3*3+1:0)},i.prototype.getLength=function(){return this.data.length},i.prototype.getBitsLength=function(){return i.getBitsLength(this.data.length)},i.prototype.write=function(t){var e,r,n;for(e=0;e+3<=this.data.length;e+=3)r=this.data.substr(e,3),n=parseInt(r,10),t.put(n,10);var i=this.data.length-e;i>0&&(r=this.data.substr(e),n=parseInt(r,10),t.put(n,3*i+1))},e.exports=i},{"./mode":154}],156:[function(t,e,r){var n=t("../utils/buffer"),i=t("./galois-field");r.mul=function(t,e){var r=new n(t.length+e.length-1);r.fill(0);for(var o=0;o=0;){for(var o=r[0],a=0;a>n&1),n<6?t.set(n,8,i,!0):n<8?t.set(n+1,8,i,!0):t.set(o-15+n,8,i,!0),n<8?t.set(8,o-n-1,i,!0):n<9?t.set(8,15-n-1+1,i,!0):t.set(8,15-n-1,i,!0);t.set(o-8,8,1,!0)}function y(t,e,r){var o=new a;r.forEach(function(e){o.put(e.mode.bit,4),o.put(e.getLength(),m.getCharCountIndicator(e.mode,t)),e.write(o)});var s=8*(i.getSymbolTotalCodewords(t)-h.getTotalCodewordsCount(t,e));for(o.getLengthInBits()+4<=s&&o.put(0,4);o.getLengthInBits()%8!=0;)o.putBit(0);for(var u=(s-o.getLengthInBits())/8,l=0;l=0&&s<=6&&(0===u||6===u)||u>=0&&u<=6&&(0===s||6===s)||s>=2&&s<=4&&u>=2&&u<=4?t.set(o+s,a+u,!0,!0):t.set(o+s,a+u,!1,!0))}(b,e),function(t){for(var e=t.size,r=8;r=7&&function(t,e){for(var r,n,i,o=t.size,a=f.getEncodedBits(e),s=0;s<18;s++)r=Math.floor(s/3),n=s%3+o-8-3,i=1==(a>>s&1),t.set(r,n,i,!0),t.set(n,r,i,!0)}(b,e),function(t,e){for(var r=t.size,n=-1,i=r-1,o=7,a=0,s=r-1;s>0;s-=2)for(6===s&&s--;;){for(var u=0;u<2;u++)if(!t.isReserved(i,s-u)){var l=!1;a>>o&1)),t.set(i,s-u,l),-1==--o&&(a++,o=7)}if((i+=n)<0||r<=i){i-=n,n=-n;break}}}(b,d),isNaN(n)&&(n=c.getBestMask(b,_.bind(null,b,r))),c.applyMask(n,b),_(b,r,n),{modules:b,version:e,errorCorrectionLevel:r,maskPattern:n,segments:o}}r.create=function(t,e){if(void 0===t||""===t)throw new Error("No input text");var r,n,a=o.M;return void 0!==e&&(a=o.from(e.errorCorrectionLevel,o.M),r=f.from(e.version),n=c.from(e.maskPattern),e.toSJISFunc&&i.setToSJISFunction(e.toSJISFunc)),b(t,r,a,n)}},{"../utils/buffer":167,"./alignment-pattern":142,"./bit-buffer":144,"./bit-matrix":145,"./error-correction-code":147,"./error-correction-level":148,"./finder-pattern":149,"./format-info":150,"./mask-pattern":153,"./mode":154,"./reed-solomon-encoder":158,"./segments":160,"./utils":161,"./version":163,isarray:168}],158:[function(t,e,r){var n=t("../utils/buffer"),i=t("./polynomial");function o(t){this.genPoly=void 0,this.degree=t,this.degree&&this.initialize(this.degree)}o.prototype.initialize=function(t){this.degree=t,this.genPoly=i.generateECPolynomial(this.degree)},o.prototype.encode=function(t){if(!this.genPoly)throw new Error("Encoder not initialized");var e=new n(this.degree);e.fill(0);var r=n.concat([t,e],t.length+this.degree),o=i.mod(r,this.genPoly),a=this.degree-o.length;if(a>0){var s=new n(this.degree);return s.fill(0),o.copy(s,a),s}return o},e.exports=o},{"../utils/buffer":167,"./polynomial":156}],159:[function(t,e,r){var n="(?:[u3000-u303F]|[u3040-u309F]|[u30A0-u30FF]|[uFF00-uFFEF]|[u4E00-u9FAF]|[u2605-u2606]|[u2190-u2195]|u203B|[u2010u2015u2018u2019u2025u2026u201Cu201Du2225u2260]|[u0391-u0451]|[u00A7u00A8u00B1u00B4u00D7u00F7])+",i="(?:(?![A-Z0-9 $%*+\\-./:]|"+(n=n.replace(/u/g,"\\u"))+")(?:.|[\r\n]))+";r.KANJI=new RegExp(n,"g"),r.BYTE_KANJI=new RegExp("[^A-Z0-9 $%*+\\-./:]+","g"),r.BYTE=new RegExp(i,"g"),r.NUMERIC=new RegExp("[0-9]+","g"),r.ALPHANUMERIC=new RegExp("[A-Z $%*+\\-./:]+","g");var o=new RegExp("^"+n+"$"),a=new RegExp("^[0-9]+$"),s=new RegExp("^[A-Z0-9 $%*+\\-./:]+$");r.testKanji=function(t){return o.test(t)},r.testNumeric=function(t){return a.test(t)},r.testAlphanumeric=function(t){return s.test(t)}},{}],160:[function(t,e,r){var n=t("./mode"),i=t("./numeric-data"),o=t("./alphanumeric-data"),a=t("./byte-data"),s=t("./kanji-data"),u=t("./regex"),l=t("./utils"),c=t("dijkstrajs");function h(t){return unescape(encodeURIComponent(t)).length}function p(t,e,r){for(var n,i=[];null!==(n=t.exec(r));)i.push({data:n[0],index:n.index,mode:e,length:n[0].length});return i}function f(t){var e,r,i=p(u.NUMERIC,n.NUMERIC,t),o=p(u.ALPHANUMERIC,n.ALPHANUMERIC,t);return l.isKanjiModeEnabled()?(e=p(u.BYTE,n.BYTE,t),r=p(u.KANJI,n.KANJI,t)):(e=p(u.BYTE_KANJI,n.BYTE,t),r=[]),i.concat(o,e,r).sort(function(t,e){return t.index-e.index}).map(function(t){return{data:t.data,mode:t.mode,length:t.length}})}function d(t,e){switch(e){case n.NUMERIC:return i.getBitsLength(t);case n.ALPHANUMERIC:return o.getBitsLength(t);case n.KANJI:return s.getBitsLength(t);case n.BYTE:return a.getBitsLength(t)}}function m(t,e){var r,u=n.getBestModeForData(t);if((r=n.from(e,u))!==n.BYTE&&r.bit=0?t[t.length-1]:null;return r&&r.mode===e.mode?(t[t.length-1].data+=e.data,t):(t.push(e),t)},[])}(a))},r.rawSplit=function(t){return r.fromArray(f(t,l.isKanjiModeEnabled()))}},{"./alphanumeric-data":143,"./byte-data":146,"./kanji-data":152,"./mode":154,"./numeric-data":155,"./regex":159,"./utils":161,dijkstrajs:19}],161:[function(t,e,r){var n,i=[0,26,44,70,100,134,172,196,242,292,346,404,466,532,581,655,733,815,901,991,1085,1156,1258,1364,1474,1588,1706,1828,1921,2051,2185,2323,2465,2611,2761,2876,3034,3196,3362,3532,3706];r.getSymbolSize=function(t){if(!t)throw new Error('"version" cannot be null or undefined');if(t<1||t>40)throw new Error('"version" should be in range from 1 to 40');return 4*t+17},r.getSymbolTotalCodewords=function(t){return i[t]},r.getBCHDigit=function(t){for(var e=0;0!==t;)e++,t>>>=1;return e},r.setToSJISFunction=function(t){if("function"!=typeof t)throw new Error('"toSJISFunc" is not a valid function.');n=t},r.isKanjiModeEnabled=function(){return void 0!==n},r.toSJIS=function(t){return n(t)}},{}],162:[function(t,e,r){r.isValid=function(t){return!isNaN(t)&&t>=1&&t<=40}},{}],163:[function(t,e,r){var n=t("./utils"),i=t("./error-correction-code"),o=t("./error-correction-level"),a=t("./mode"),s=t("./version-check"),u=t("isarray"),l=n.getBCHDigit(7973);function c(t,e){return a.getCharCountIndicator(t,e)+4}function h(t,e){var r=0;return t.forEach(function(t){var n=c(t.mode,e);r+=n+t.getBitsLength()}),r}r.from=function(t,e){return s.isValid(t)?parseInt(t,10):e},r.getCapacity=function(t,e,r){if(!s.isValid(t))throw new Error("Invalid QR Code version");void 0===r&&(r=a.BYTE);var o=8*(n.getSymbolTotalCodewords(t)-i.getTotalCodewordsCount(t,e));if(r===a.MIXED)return o;var u=o-c(r,t);switch(r){case a.NUMERIC:return Math.floor(u/10*3);case a.ALPHANUMERIC:return Math.floor(u/11*2);case a.KANJI:return Math.floor(u/13);case a.BYTE:default:return Math.floor(u/8)}},r.getBestVersionForData=function(t,e){var n,i=o.from(e,o.M);if(u(t)){if(t.length>1)return function(t,e){for(var n=1;n<=40;n++)if(h(t,n)<=r.getCapacity(n,e,a.MIXED))return n}(t,i);if(0===t.length)return 1;n=t[0]}else n=t;return function(t,e,n){for(var i=1;i<=40;i++)if(e<=r.getCapacity(i,n,t))return i}(n.mode,n.getLength(),i)},r.getEncodedBits=function(t){if(!s.isValid(t)||t<7)throw new Error("Invalid QR Code version");for(var e=t<<12;n.getBCHDigit(e)-l>=0;)e^=7973<':"",h="0&&l>0&&t[u-1]||(n+=a?o("M",l+r,.5+c+r):o("m",i,0),i=0,a=!1),l+1',p='viewBox="0 0 '+l+" "+l+'"',f=''+c+h+"\n";return"function"==typeof r&&r(null,f),f}},{"./utils":166}],166:[function(t,e,r){function n(t){if("string"!=typeof t)throw new Error("Color should be defined as hex string");var e=t.slice().replace("#","").split("");if(e.length<3||5===e.length||e.length>8)throw new Error("Invalid hex color: "+t);3!==e.length&&4!==e.length||(e=Array.prototype.concat.apply([],e.map(function(t){return[t,t]}))),6===e.length&&e.push("F","F");var r=parseInt(e.join(""),16);return{r:r>>24&255,g:r>>16&255,b:r>>8&255,a:255&r,hex:"#"+e.slice(0,6).join("")}}r.getOptions=function(t){t||(t={}),t.color||(t.color={});var e=void 0===t.margin||null===t.margin||t.margin<0?4:t.margin,r=t.width&&t.width>=21?t.width:void 0,i=t.scale||4;return{width:r,scale:r?4:i,margin:e,color:{dark:n(t.color.dark||"#000000ff"),light:n(t.color.light||"#ffffffff")},type:t.type,rendererOpts:t.rendererOpts||{}}},r.getScale=function(t,e){return e.width&&e.width>=t+2*e.margin?e.width/(t+2*e.margin):e.scale},r.getImageWidth=function(t,e){var n=r.getScale(t,e);return Math.floor((t+2*e.margin)*n)},r.qrToImageData=function(t,e,n){for(var i=e.modules.size,o=e.modules.data,a=r.getScale(i,n),s=Math.floor((i+2*n.margin)*a),u=n.margin*a,l=[n.color.light,n.color.dark],c=0;c=u&&h>=u&&c=i)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+i.toString(16)+" bytes");return 0|t}function s(t,e){var r;return o.TYPED_ARRAY_SUPPORT?(r=new Uint8Array(e)).__proto__=o.prototype:(null===(r=t)&&(r=new o(e)),r.length=e),r}function u(t,e){var r=s(t,e<0?0:0|a(e));if(!o.TYPED_ARRAY_SUPPORT)for(var n=0;n55295&&r<57344){if(!i){if(r>56319){(e-=3)>-1&&o.push(239,191,189);continue}if(a+1===n){(e-=3)>-1&&o.push(239,191,189);continue}i=r;continue}if(r<56320){(e-=3)>-1&&o.push(239,191,189),i=r;continue}r=65536+(i-55296<<10|r-56320)}else i&&(e-=3)>-1&&o.push(239,191,189);if(i=null,r<128){if((e-=1)<0)break;o.push(r)}else if(r<2048){if((e-=2)<0)break;o.push(r>>6|192,63&r|128)}else if(r<65536){if((e-=3)<0)break;o.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((e-=4)<0)break;o.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return o}function h(t){return o.isBuffer(t)?t.length:"undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(t)||t instanceof ArrayBuffer)?t.byteLength:("string"!=typeof t&&(t=""+t),0===t.length?0:c(t).length)}o.TYPED_ARRAY_SUPPORT&&(o.prototype.__proto__=Uint8Array.prototype,o.__proto__=Uint8Array,"undefined"!=typeof Symbol&&Symbol.species&&o[Symbol.species]===o&&Object.defineProperty(o,Symbol.species,{value:null,configurable:!0,enumerable:!1,writable:!1})),o.prototype.write=function(t,e,r){void 0===e?(r=this.length,e=0):void 0===r&&"string"==typeof e?(r=this.length,e=0):isFinite(e)&&(e|=0,isFinite(r)?r|=0:r=void 0);var n=this.length-e;if((void 0===r||r>n)&&(r=n),t.length>0&&(r<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");return function(t,e,r,n){return function(t,e,r,n){for(var i=0;i=e.length||i>=t.length);++i)e[i+r]=t[i];return i}(c(e,t.length-r),t,r,n)}(this,t,e,r)},o.prototype.slice=function(t,e){var r,n=this.length;if(t=~~t,e=void 0===e?n:~~e,t<0?(t+=n)<0&&(t=0):t>n&&(t=n),e<0?(e+=n)<0&&(e=0):e>n&&(e=n),e=t.length&&(e=t.length),e||(e=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),t.length-e=0;--i)t[i+e]=this[i+r];else if(a<1e3||!o.TYPED_ARRAY_SUPPORT)for(i=0;i>>=0,r=void 0===r?this.length:r>>>0,t||(t=0),"number"==typeof t)for(i=e;i0?("string"==typeof e||a.objectMode||Object.getPrototypeOf(e)===l.prototype||(e=function(t){return l.from(t)}(e)),n?a.endEmitted?t.emit("error",new Error("stream.unshift() after end event")):x(t,a,e,!0):a.ended?t.emit("error",new Error("stream.push() after EOF")):(a.reading=!1,a.decoder&&!r?(e=a.decoder.write(e),a.objectMode||0!==e.length?x(t,a,e,!1):S(t,a)):x(t,a,e,!1))):n||(a.reading=!1));return function(t){return!t.ended&&(t.needReadable||t.lengthe.highWaterMark&&(e.highWaterMark=function(t){return t>=w?t=w:(t--,t|=t>>>1,t|=t>>>2,t|=t>>>4,t|=t>>>8,t|=t>>>16,t++),t}(t)),t<=e.length?t:e.ended?e.length:(e.needReadable=!0,0))}function k(t){var e=t._readableState;e.needReadable=!1,e.emittedReadable||(f("emitReadable",e.flowing),e.emittedReadable=!0,e.sync?i.nextTick(T,t):T(t))}function T(t){f("emit readable"),t.emit("readable"),B(t)}function S(t,e){e.readingMore||(e.readingMore=!0,i.nextTick(A,t,e))}function A(t,e){for(var r=e.length;!e.reading&&!e.flowing&&!e.ended&&e.length=e.length?(r=e.decoder?e.buffer.join(""):1===e.buffer.length?e.buffer.head.data:e.buffer.concat(e.length),e.buffer.clear()):r=function(t,e,r){var n;to.length?o.length:t;if(a===o.length?i+=o:i+=o.slice(0,t),0===(t-=a)){a===o.length?(++n,r.next?e.head=r.next:e.head=e.tail=null):(e.head=r,r.data=o.slice(a));break}++n}return e.length-=n,i}(t,e):function(t,e){var r=l.allocUnsafe(t),n=e.head,i=1;n.data.copy(r),t-=n.data.length;for(;n=n.next;){var o=n.data,a=t>o.length?o.length:t;if(o.copy(r,r.length-t,0,a),0===(t-=a)){a===o.length?(++i,n.next?e.head=n.next:e.head=e.tail=null):(e.head=n,n.data=o.slice(a));break}++i}return e.length-=i,r}(t,e);return n}(t,e.buffer,e.decoder),r);var r}function I(t){var e=t._readableState;if(e.length>0)throw new Error('"endReadable()" called on non-empty stream');e.endEmitted||(e.ended=!0,i.nextTick(M,e,t))}function M(t,e){t.endEmitted||0!==t.length||(t.endEmitted=!0,e.readable=!1,e.emit("end"))}function D(t,e){for(var r=0,n=t.length;r=e.highWaterMark||e.ended))return f("read: emitReadable",e.length,e.ended),0===e.length&&e.ended?I(this):k(this),null;if(0===(t=E(t,e))&&e.ended)return 0===e.length&&I(this),null;var n,i=e.needReadable;return f("need readable",i),(0===e.length||e.length-t0?P(t,e):null)?(e.needReadable=!0,t=0):e.length-=t,0===e.length&&(e.ended||(e.needReadable=!0),r!==t&&e.ended&&I(this)),null!==n&&this.emit("data",n),n},y.prototype._read=function(t){this.emit("error",new Error("_read() is not implemented"))},y.prototype.pipe=function(t,e){var n=this,o=this._readableState;switch(o.pipesCount){case 0:o.pipes=t;break;case 1:o.pipes=[o.pipes,t];break;default:o.pipes.push(t)}o.pipesCount+=1,f("pipe count=%d opts=%j",o.pipesCount,e);var u=(!e||!1!==e.end)&&t!==r.stdout&&t!==r.stderr?c:y;function l(e,r){f("onunpipe"),e===n&&r&&!1===r.hasUnpiped&&(r.hasUnpiped=!0,f("cleanup"),t.removeListener("close",v),t.removeListener("finish",_),t.removeListener("drain",h),t.removeListener("error",g),t.removeListener("unpipe",l),n.removeListener("end",c),n.removeListener("end",y),n.removeListener("data",m),p=!0,!o.awaitDrain||t._writableState&&!t._writableState.needDrain||h())}function c(){f("onend"),t.end()}o.endEmitted?i.nextTick(u):n.once("end",u),t.on("unpipe",l);var h=function(t){return function(){var e=t._readableState;f("pipeOnDrain",e.awaitDrain),e.awaitDrain&&e.awaitDrain--,0===e.awaitDrain&&s(t,"data")&&(e.flowing=!0,B(t))}}(n);t.on("drain",h);var p=!1;var d=!1;function m(e){f("ondata"),d=!1,!1!==t.write(e)||d||((1===o.pipesCount&&o.pipes===t||o.pipesCount>1&&-1!==D(o.pipes,t))&&!p&&(f("false write response, pause",n._readableState.awaitDrain),n._readableState.awaitDrain++,d=!0),n.pause())}function g(e){f("onerror",e),y(),t.removeListener("error",g),0===s(t,"error")&&t.emit("error",e)}function v(){t.removeListener("finish",_),y()}function _(){f("onfinish"),t.removeListener("close",v),y()}function y(){f("unpipe"),n.unpipe(t)}return n.on("data",m),function(t,e,r){if("function"==typeof t.prependListener)return t.prependListener(e,r);t._events&&t._events[e]?a(t._events[e])?t._events[e].unshift(r):t._events[e]=[r,t._events[e]]:t.on(e,r)}(t,"error",g),t.once("close",v),t.once("finish",_),t.emit("pipe",n),o.flowing||(f("pipe resume"),n.resume()),t},y.prototype.unpipe=function(t){var e=this._readableState,r={hasUnpiped:!1};if(0===e.pipesCount)return this;if(1===e.pipesCount)return t&&t!==e.pipes?this:(t||(t=e.pipes),e.pipes=null,e.pipesCount=0,e.flowing=!1,t&&t.emit("unpipe",this,r),this);if(!t){var n=e.pipes,i=e.pipesCount;e.pipes=null,e.pipesCount=0,e.flowing=!1;for(var o=0;o-1?i:o.nextTick;_.WritableState=v;var l=t("core-util-is");l.inherits=t("inherits");var c={deprecate:t("util-deprecate")},h=t("./internal/streams/stream"),p=t("safe-buffer").Buffer,f=n.Uint8Array||function(){};var d,m=t("./internal/streams/destroy");function g(){}function v(e,r){s=s||t("./_stream_duplex"),e=e||{};var n=r instanceof s;this.objectMode=!!e.objectMode,n&&(this.objectMode=this.objectMode||!!e.writableObjectMode);var i=e.highWaterMark,l=e.writableHighWaterMark,c=this.objectMode?16:16384;this.highWaterMark=i||0===i?i:n&&(l||0===l)?l:c,this.highWaterMark=Math.floor(this.highWaterMark),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var h=!1===e.decodeStrings;this.decodeStrings=!h,this.defaultEncoding=e.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(t){!function(t,e){var r=t._writableState,n=r.sync,i=r.writecb;if(function(t){t.writing=!1,t.writecb=null,t.length-=t.writelen,t.writelen=0}(r),e)!function(t,e,r,n,i){--e.pendingcb,r?(o.nextTick(i,n),o.nextTick(k,t,e),t._writableState.errorEmitted=!0,t.emit("error",n)):(i(n),t._writableState.errorEmitted=!0,t.emit("error",n),k(t,e))}(t,r,n,e,i);else{var a=w(r);a||r.corked||r.bufferProcessing||!r.bufferedRequest||x(t,r),n?u(b,t,r,a,i):b(t,r,a,i)}}(r,t)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.bufferedRequestCount=0,this.corkedRequestsFree=new a(this)}function _(e){if(s=s||t("./_stream_duplex"),!(d.call(_,this)||this instanceof s))return new _(e);this._writableState=new v(e,this),this.writable=!0,e&&("function"==typeof e.write&&(this._write=e.write),"function"==typeof e.writev&&(this._writev=e.writev),"function"==typeof e.destroy&&(this._destroy=e.destroy),"function"==typeof e.final&&(this._final=e.final)),h.call(this)}function y(t,e,r,n,i,o,a){e.writelen=n,e.writecb=a,e.writing=!0,e.sync=!0,r?t._writev(i,e.onwrite):t._write(i,o,e.onwrite),e.sync=!1}function b(t,e,r,n){r||function(t,e){0===e.length&&e.needDrain&&(e.needDrain=!1,t.emit("drain"))}(t,e),e.pendingcb--,n(),k(t,e)}function x(t,e){e.bufferProcessing=!0;var r=e.bufferedRequest;if(t._writev&&r&&r.next){var n=e.bufferedRequestCount,i=new Array(n),o=e.corkedRequestsFree;o.entry=r;for(var s=0,u=!0;r;)i[s]=r,r.isBuf||(u=!1),r=r.next,s+=1;i.allBuffers=u,y(t,e,!0,e.length,i,"",o.finish),e.pendingcb++,e.lastBufferedRequest=null,o.next?(e.corkedRequestsFree=o.next,o.next=null):e.corkedRequestsFree=new a(e),e.bufferedRequestCount=0}else{for(;r;){var l=r.chunk,c=r.encoding,h=r.callback;if(y(t,e,!1,e.objectMode?1:l.length,l,c,h),r=r.next,e.bufferedRequestCount--,e.writing)break}null===r&&(e.lastBufferedRequest=null)}e.bufferedRequest=r,e.bufferProcessing=!1}function w(t){return t.ending&&0===t.length&&null===t.bufferedRequest&&!t.finished&&!t.writing}function E(t,e){t._final(function(r){e.pendingcb--,r&&t.emit("error",r),e.prefinished=!0,t.emit("prefinish"),k(t,e)})}function k(t,e){var r=w(e);return r&&(!function(t,e){e.prefinished||e.finalCalled||("function"==typeof t._final?(e.pendingcb++,e.finalCalled=!0,o.nextTick(E,t,e)):(e.prefinished=!0,t.emit("prefinish")))}(t,e),0===e.pendingcb&&(e.finished=!0,t.emit("finish"))),r}l.inherits(_,h),v.prototype.getBuffer=function(){for(var t=this.bufferedRequest,e=[];t;)e.push(t),t=t.next;return e},function(){try{Object.defineProperty(v.prototype,"buffer",{get:c.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch(t){}}(),"function"==typeof Symbol&&Symbol.hasInstance&&"function"==typeof Function.prototype[Symbol.hasInstance]?(d=Function.prototype[Symbol.hasInstance],Object.defineProperty(_,Symbol.hasInstance,{value:function(t){return!!d.call(this,t)||this===_&&(t&&t._writableState instanceof v)}})):d=function(t){return t instanceof this},_.prototype.pipe=function(){this.emit("error",new Error("Cannot pipe, not readable"))},_.prototype.write=function(t,e,r){var n,i=this._writableState,a=!1,s=!i.objectMode&&(n=t,p.isBuffer(n)||n instanceof f);return s&&!p.isBuffer(t)&&(t=function(t){return p.from(t)}(t)),"function"==typeof e&&(r=e,e=null),s?e="buffer":e||(e=i.defaultEncoding),"function"!=typeof r&&(r=g),i.ended?function(t,e){var r=new Error("write after end");t.emit("error",r),o.nextTick(e,r)}(this,r):(s||function(t,e,r,n){var i=!0,a=!1;return null===r?a=new TypeError("May not write null values to stream"):"string"==typeof r||void 0===r||e.objectMode||(a=new TypeError("Invalid non-string/buffer chunk")),a&&(t.emit("error",a),o.nextTick(n,a),i=!1),i}(this,i,t,r))&&(i.pendingcb++,a=function(t,e,r,n,i,o){if(!r){var a=function(t,e,r){t.objectMode||!1===t.decodeStrings||"string"!=typeof e||(e=p.from(e,r));return e}(e,n,i);n!==a&&(r=!0,i="buffer",n=a)}var s=e.objectMode?1:n.length;e.length+=s;var u=e.length-1))throw new TypeError("Unknown encoding: "+t);return this._writableState.defaultEncoding=t,this},Object.defineProperty(_.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),_.prototype._write=function(t,e,r){r(new Error("_write() is not implemented"))},_.prototype._writev=null,_.prototype.end=function(t,e,r){var n=this._writableState;"function"==typeof t?(r=t,t=null,e=null):"function"==typeof e&&(r=e,e=null),null!==t&&void 0!==t&&this.write(t,e),n.corked&&(n.corked=1,this.uncork()),n.ending||n.finished||function(t,e,r){e.ending=!0,k(t,e),r&&(e.finished?o.nextTick(r):t.once("finish",r));e.ended=!0,t.writable=!1}(this,n,r)},Object.defineProperty(_.prototype,"destroyed",{get:function(){return void 0!==this._writableState&&this._writableState.destroyed},set:function(t){this._writableState&&(this._writableState.destroyed=t)}}),_.prototype.destroy=m.destroy,_.prototype._undestroy=m.undestroy,_.prototype._destroy=function(t,e){this.end(),e(t)}}).call(this,t("_process"),"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{},t("timers").setImmediate)},{"./_stream_duplex":170,"./internal/streams/destroy":176,"./internal/streams/stream":177,_process:139,"core-util-is":14,inherits:96,"process-nextick-args":179,"safe-buffer":185,timers:193,"util-deprecate":198}],175:[function(t,e,r){"use strict";var n=t("safe-buffer").Buffer,i=t("util");e.exports=function(){function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.head=null,this.tail=null,this.length=0}return t.prototype.push=function(t){var e={data:t,next:null};this.length>0?this.tail.next=e:this.head=e,this.tail=e,++this.length},t.prototype.unshift=function(t){var e={data:t,next:this.head};0===this.length&&(this.tail=e),this.head=e,++this.length},t.prototype.shift=function(){if(0!==this.length){var t=this.head.data;return 1===this.length?this.head=this.tail=null:this.head=this.head.next,--this.length,t}},t.prototype.clear=function(){this.head=this.tail=null,this.length=0},t.prototype.join=function(t){if(0===this.length)return"";for(var e=this.head,r=""+e.data;e=e.next;)r+=t+e.data;return r},t.prototype.concat=function(t){if(0===this.length)return n.alloc(0);if(1===this.length)return this.head.data;for(var e,r,i,o=n.allocUnsafe(t>>>0),a=this.head,s=0;a;)e=a.data,r=o,i=s,e.copy(r,i),s+=a.data.length,a=a.next;return o},t}(),i&&i.inspect&&i.inspect.custom&&(e.exports.prototype[i.inspect.custom]=function(){var t=i.inspect({length:this.length});return this.constructor.name+" "+t})},{"safe-buffer":185,util:4}],176:[function(t,e,r){"use strict";var n=t("process-nextick-args");function i(t,e){t.emit("error",e)}e.exports={destroy:function(t,e){var r=this,o=this._readableState&&this._readableState.destroyed,a=this._writableState&&this._writableState.destroyed;return o||a?(e?e(t):!t||this._writableState&&this._writableState.errorEmitted||n.nextTick(i,this,t),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(t||null,function(t){!e&&t?(n.nextTick(i,r,t),r._writableState&&(r._writableState.errorEmitted=!0)):e&&e(t)}),this)},undestroy:function(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)}}},{"process-nextick-args":179}],177:[function(t,e,r){e.exports=t("events").EventEmitter},{events:74}],178:[function(t,e,r){arguments[4][168][0].apply(r,arguments)},{dup:168}],179:[function(t,e,r){(function(t){"use strict";!t.version||0===t.version.indexOf("v0.")||0===t.version.indexOf("v1.")&&0!==t.version.indexOf("v1.8.")?e.exports={nextTick:function(e,r,n,i){if("function"!=typeof e)throw new TypeError('"callback" argument must be a function');var o,a,s=arguments.length;switch(s){case 0:case 1:return t.nextTick(e);case 2:return t.nextTick(function(){e.call(null,r)});case 3:return t.nextTick(function(){e.call(null,r,n)});case 4:return t.nextTick(function(){e.call(null,r,n,i)});default:for(o=new Array(s-1),a=0;a>5==6?2:t>>4==14?3:t>>3==30?4:t>>6==2?-1:-2}function s(t){var e=this.lastTotal-this.lastNeed,r=function(t,e,r){if(128!=(192&e[0]))return t.lastNeed=0,"�";if(t.lastNeed>1&&e.length>1){if(128!=(192&e[1]))return t.lastNeed=1,"�";if(t.lastNeed>2&&e.length>2&&128!=(192&e[2]))return t.lastNeed=2,"�"}}(this,t);return void 0!==r?r:this.lastNeed<=t.length?(t.copy(this.lastChar,e,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal)):(t.copy(this.lastChar,e,0,t.length),void(this.lastNeed-=t.length))}function u(t,e){if((t.length-e)%2==0){var r=t.toString("utf16le",e);if(r){var n=r.charCodeAt(r.length-1);if(n>=55296&&n<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=t[t.length-2],this.lastChar[1]=t[t.length-1],r.slice(0,-1)}return r}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=t[t.length-1],t.toString("utf16le",e,t.length-1)}function l(t){var e=t&&t.length?this.write(t):"";if(this.lastNeed){var r=this.lastTotal-this.lastNeed;return e+this.lastChar.toString("utf16le",0,r)}return e}function c(t,e){var r=(t.length-e)%3;return 0===r?t.toString("base64",e):(this.lastNeed=3-r,this.lastTotal=3,1===r?this.lastChar[0]=t[t.length-1]:(this.lastChar[0]=t[t.length-2],this.lastChar[1]=t[t.length-1]),t.toString("base64",e,t.length-r))}function h(t){var e=t&&t.length?this.write(t):"";return this.lastNeed?e+this.lastChar.toString("base64",0,3-this.lastNeed):e}function p(t){return t.toString(this.encoding)}function f(t){return t&&t.length?this.write(t):""}r.StringDecoder=o,o.prototype.write=function(t){if(0===t.length)return"";var e,r;if(this.lastNeed){if(void 0===(e=this.fillLast(t)))return"";r=this.lastNeed,this.lastNeed=0}else r=0;return r=0)return i>0&&(t.lastNeed=i-1),i;if(--n=0)return i>0&&(t.lastNeed=i-2),i;if(--n=0)return i>0&&(2===i?i=0:t.lastNeed=i-3),i;return 0}(this,t,e);if(!this.lastNeed)return t.toString("utf8",e);this.lastTotal=r;var n=t.length-(r-this.lastNeed);return t.copy(this.lastChar,0,n),t.toString("utf8",e,n)},o.prototype.fillLast=function(t){if(this.lastNeed<=t.length)return t.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);t.copy(this.lastChar,this.lastTotal-this.lastNeed,0,t.length),this.lastNeed-=t.length}},{"safe-buffer":185}],181:[function(t,e,r){e.exports=t("./readable").PassThrough},{"./readable":182}],182:[function(t,e,r){(r=e.exports=t("./lib/_stream_readable.js")).Stream=r,r.Readable=r,r.Writable=t("./lib/_stream_writable.js"),r.Duplex=t("./lib/_stream_duplex.js"),r.Transform=t("./lib/_stream_transform.js"),r.PassThrough=t("./lib/_stream_passthrough.js")},{"./lib/_stream_duplex.js":170,"./lib/_stream_passthrough.js":171,"./lib/_stream_readable.js":172,"./lib/_stream_transform.js":173,"./lib/_stream_writable.js":174}],183:[function(t,e,r){e.exports=t("./readable").Transform},{"./readable":182}],184:[function(t,e,r){e.exports=t("./lib/_stream_writable.js")},{"./lib/_stream_writable.js":174}],185:[function(t,e,r){var n=t("buffer"),i=n.Buffer;function o(t,e){for(var r in t)e[r]=t[r]}function a(t,e,r){return i(t,e,r)}i.from&&i.alloc&&i.allocUnsafe&&i.allocUnsafeSlow?e.exports=n:(o(n,r),r.Buffer=a),o(i,a),a.from=function(t,e,r){if("number"==typeof t)throw new TypeError("Argument must not be a number");return i(t,e,r)},a.alloc=function(t,e,r){if("number"!=typeof t)throw new TypeError("Argument must be a number");var n=i(t);return void 0!==e?"string"==typeof r?n.fill(e,r):n.fill(e):n.fill(0),n},a.allocUnsafe=function(t){if("number"!=typeof t)throw new TypeError("Argument must be a number");return i(t)},a.allocUnsafeSlow=function(t){if("number"!=typeof t)throw new TypeError("Argument must be a number");return n.SlowBuffer(t)}},{buffer:73}],186:[function(t,e,r){arguments[4][93][0].apply(r,arguments)},{"./lib/decoder":187,"./lib/encoder":188,dup:93}],187:[function(t,e,r){(function(t){var r=function(){"use strict";var t=new Int32Array([0,1,8,16,9,2,3,10,17,24,32,25,18,11,4,5,12,19,26,33,40,48,41,34,27,20,13,6,7,14,21,28,35,42,49,56,57,50,43,36,29,22,15,23,30,37,44,51,58,59,52,45,38,31,39,46,53,60,61,54,47,55,62,63]),e=4017,r=799,n=3406,i=2276,o=1567,a=3784,s=5793,u=2896;function l(){}function c(t,e){for(var r,n,i=0,o=[],a=16;a>0&&!t[a-1];)a--;o.push({children:[],index:0});var s,u=o[0];for(r=0;r0;)u=o.pop();for(u.index++,o.push(u);o.length<=r;)o.push(s={children:[],index:0}),u.children[u.index]=s.children,u=s;i++}r+10)return f>>--d&1;if(255==(f=e[r++])){var t=e[r++];if(t)throw"unexpected marker: "+(f<<8|t).toString(16)}return d=7,f>>>7}function g(t){for(var e,r=t;null!==(e=m());){if("number"==typeof(r=r[e]))return r;if("object"!=typeof r)throw"invalid huffman sequence"}return null}function v(t){for(var e=0;t>0;){var r=m();if(null===r)return;e=e<<1|r,t--}return e}function _(t){var e=v(t);return e>=1<0)y--;else for(var n=a,i=s;n<=i;){var o=g(e.huffmanTableAC),u=15&o,c=o>>4;if(0!==u)r[t[n+=c]]=_(u)*(1<>4,0===h)o<15?(y=v(o)+(1<>4;if(0!==s)r[t[o+=u]]=_(s),o++;else{if(u<15)break;o+=16}}};var P,I,M,D,F=0;for(I=1==B?i[0].blocksPerLine*i[0].blocksPerColumn:c*n.mcusPerColumn,o||(o=I);F=65488&&P<=65495))break;r+=2}return r-p}function p(t,l){var c,h,p=[],f=l.blocksPerLine,d=l.blocksPerColumn,m=f<<3,g=new Int32Array(64),v=new Uint8Array(64);function _(t,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]=t[x]*w[x];for(x=0;x<8;++x){var k=8*x;0!=E[1+k]||0!=E[2+k]||0!=E[3+k]||0!=E[4+k]||0!=E[5+k]||0!=E[6+k]||0!=E[7+k]?(p=s*E[0+k]+128>>8,f=s*E[4+k]+128>>8,d=E[2+k],m=E[6+k],g=u*(E[1+k]-E[7+k])+128>>8,y=u*(E[1+k]+E[7+k])+128>>8,v=E[3+k]<<4,_=E[5+k]<<4,b=p-f+1>>1,p=p+f+1>>1,f=b,b=d*a+m*o+128>>8,d=d*o-m*a+128>>8,m=b,b=g-_+1>>1,g=g+_+1>>1,_=b,b=y+v+1>>1,v=y-v+1>>1,y=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+y*n+2048>>12,g=g*n-y*i+2048>>12,y=b,b=v*r+_*e+2048>>12,v=v*e-_*r+2048>>12,_=b,E[0+k]=p+y,E[7+k]=p-y,E[1+k]=f+_,E[6+k]=f-_,E[2+k]=d+v,E[5+k]=d-v,E[3+k]=m+g,E[4+k]=m-g):(b=s*E[0+k]+512>>10,E[0+k]=b,E[1+k]=b,E[2+k]=b,E[3+k]=b,E[4+k]=b,E[5+k]=b,E[6+k]=b,E[7+k]=b)}for(x=0;x<8;++x){var T=x;0!=E[8+T]||0!=E[16+T]||0!=E[24+T]||0!=E[32+T]||0!=E[40+T]||0!=E[48+T]||0!=E[56+T]?(p=s*E[0+T]+2048>>12,f=s*E[32+T]+2048>>12,d=E[16+T],m=E[48+T],g=u*(E[8+T]-E[56+T])+2048>>12,y=u*(E[8+T]+E[56+T])+2048>>12,v=E[24+T],_=E[40+T],b=p-f+1>>1,p=p+f+1>>1,f=b,b=d*a+m*o+2048>>12,d=d*o-m*a+2048>>12,m=b,b=g-_+1>>1,g=g+_+1>>1,_=b,b=y+v+1>>1,v=y-v+1>>1,y=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+y*n+2048>>12,g=g*n-y*i+2048>>12,y=b,b=v*r+_*e+2048>>12,v=v*e-_*r+2048>>12,_=b,E[0+T]=p+y,E[56+T]=p-y,E[8+T]=f+_,E[48+T]=f-_,E[16+T]=d+v,E[40+T]=d-v,E[24+T]=m+g,E[32+T]=m-g):(b=s*h[x+0]+8192>>14,E[0+T]=b,E[8+T]=b,E[16+T]=b,E[24+T]=b,E[32+T]=b,E[40+T]=b,E[48+T]=b,E[56+T]=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 y=0;y255?255:t}return l.prototype={load:function(t){var e=new XMLHttpRequest;e.open("GET",t,!0),e.responseType="arraybuffer",e.onload=function(){var t=new Uint8Array(e.response||e.mozResponseArrayBuffer);this.parse(t),this.onload&&this.onload()}.bind(this),e.send(null)},parse:function(e){var r=0;e.length;function n(){var t=e[r]<<8|e[r+1];return r+=2,t}function i(){var t=n(),i=e.subarray(r,r+t-2);return r+=i.length,i}function o(t){var e,r,n=0,i=0;for(r in t.components)t.components.hasOwnProperty(r)&&(n<(e=t.components[r]).h&&(n=e.h),i>4==0)for(_=0;_<64;_++){w[t[_]]=e[r++]}else{if(x>>4!=1)throw"DQT: invalid table spec";for(_=0;_<64;_++){w[t[_]]=n()}}f[15&x]=w}break;case 65472:case 65473:case 65474:n(),(a={}).extended=65473===v,a.progressive=65474===v,a.precision=e[r++],a.scanLines=n(),a.samplesPerLine=n(),a.components={},a.componentsOrder=[];var E,k=e[r++];for(U=0;U>4,S=15&e[r+1],A=e[r+2];a.componentsOrder.push(E),a.components[E]={h:T,v:S,quantizationTable:f[A]},r+=3}o(a),d.push(a);break;case 65476:var C=n();for(U=2;U>4==0?g:m)[15&R]=c(B,I)}break;case 65501:n(),s=n();break;case 65498:n();var M=e[r++],D=[];for(U=0;U>4],z.huffmanTableAC=m[15&F],D.push(z)}var L=e[r++],O=e[r++],N=e[r++],j=h(e,r,a,D,s,L,O,N>>4,15&N);r+=j;break;default:if(255==e[r-3]&&e[r-2]>=192&&e[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";this.width=a.samplesPerLine,this.height=a.scanLines,this.jfif=u,this.adobe=l,this.components=[];for(var U=0;U=this.charLength-this.charReceived?this.charLength-this.charReceived:t.length;if(t.copy(this.charBuffer,this.charReceived,0,r),this.charReceived+=r,this.charReceived=55296&&i<=56319)){if(this.charReceived=this.charLength=0,0===t.length)return e;break}this.charLength+=this.surrogateSize,e=""}this.detectIncompleteChar(t);var n=t.length;this.charLength&&(t.copy(this.charBuffer,0,t.length-this.charReceived,n),n-=this.charReceived);var i;n=(e+=t.toString(this.encoding,0,n)).length-1;if((i=e.charCodeAt(n))>=55296&&i<=56319){var o=this.surrogateSize;return this.charLength+=o,this.charReceived+=o,this.charBuffer.copy(this.charBuffer,o,0,o),t.copy(this.charBuffer,0,0,o),e.substring(0,n)}return e},o.prototype.detectIncompleteChar=function(t){for(var e=t.length>=3?3:t.length;e>0;e--){var r=t[t.length-e];if(1==e&&r>>5==6){this.charLength=2;break}if(e<=2&&r>>4==14){this.charLength=3;break}if(e<=3&&r>>3==30){this.charLength=4;break}}this.charReceived=e},o.prototype.end=function(t){var e="";if(t&&t.length&&(e=this.write(t)),this.charReceived){var r=this.charReceived,n=this.charBuffer,i=this.encoding;e+=n.slice(0,r).toString(i)}return e}},{buffer:73}],192:[function(t,e,r){(function(r){var n=t("stream");function i(t,e,i){t=t||function(t){this.queue(t)},e=e||function(){this.queue(null)};var o=!1,a=!1,s=[],u=!1,l=new n;function c(){for(;s.length&&!l.paused;){var t=s.shift();if(null===t)return l.emit("end");l.emit("data",t)}}return l.readable=l.writable=!0,l.paused=!1,l.autoDestroy=!(i&&!1===i.autoDestroy),l.write=function(e){return t.call(this,e),!l.paused},l.queue=l.push=function(t){return u?l:(null===t&&(u=!0),s.push(t),c(),l)},l.on("end",function(){l.readable=!1,!l.writable&&l.autoDestroy&&r.nextTick(function(){l.destroy()})}),l.end=function(t){if(!o)return o=!0,arguments.length&&l.write(t),l.writable=!1,e.call(l),!l.readable&&l.autoDestroy&&l.destroy(),l},l.destroy=function(){if(!a)return a=!0,o=!0,s.length=0,l.writable=l.readable=!1,l.emit("close"),l},l.pause=function(){if(!l.paused)return l.paused=!0,l},l.resume=function(){return l.paused&&(l.paused=!1,l.emit("resume")),c(),l.paused||l.emit("drain"),l},l}e.exports=i,i.through=i}).call(this,t("_process"))},{_process:139,stream:190}],193:[function(t,e,r){(function(e,n){var i=t("process/browser.js").nextTick,o=Function.prototype.apply,a=Array.prototype.slice,s={},u=0;function l(t,e){this._id=t,this._clearFn=e}r.setTimeout=function(){return new l(o.call(setTimeout,window,arguments),clearTimeout)},r.setInterval=function(){return new l(o.call(setInterval,window,arguments),clearInterval)},r.clearTimeout=r.clearInterval=function(t){t.close()},l.prototype.unref=l.prototype.ref=function(){},l.prototype.close=function(){this._clearFn.call(window,this._id)},r.enroll=function(t,e){clearTimeout(t._idleTimeoutId),t._idleTimeout=e},r.unenroll=function(t){clearTimeout(t._idleTimeoutId),t._idleTimeout=-1},r._unrefActive=r.active=function(t){clearTimeout(t._idleTimeoutId);var e=t._idleTimeout;e>=0&&(t._idleTimeoutId=setTimeout(function(){t._onTimeout&&t._onTimeout()},e))},r.setImmediate="function"==typeof e?e:function(t){var e=u++,n=!(arguments.length<2)&&a.call(arguments,1);return s[e]=!0,i(function(){s[e]&&(n?t.apply(null,n):t.call(null),r.clearImmediate(e))}),e},r.clearImmediate="function"==typeof n?n:function(t){delete s[t]}}).call(this,t("timers").setImmediate,t("timers").clearImmediate)},{"process/browser.js":139,timers:193}],194:[function(t,e,r){r.isatty=function(){return!1},r.ReadStream=function(){throw new Error("tty.ReadStream is not implemented")},r.WriteStream=function(){throw new Error("tty.WriteStream is not implemented")}},{}],195:[function(t,e,r){(function(){var t=this,n=t._,i={},o=Array.prototype,a=Object.prototype,s=Function.prototype,u=o.push,l=o.slice,c=o.concat,h=a.toString,p=a.hasOwnProperty,f=o.forEach,d=o.map,m=o.reduce,g=o.reduceRight,v=o.filter,_=o.every,y=o.some,b=o.indexOf,x=o.lastIndexOf,w=Array.isArray,E=Object.keys,k=s.bind,T=function(t){return t instanceof T?t:this instanceof T?void(this._wrapped=t):new T(t)};void 0!==r?(void 0!==e&&e.exports&&(r=e.exports=T),r._=T):t._=T,T.VERSION="1.4.4";var S=T.each=T.forEach=function(t,e,r){if(null!=t)if(f&&t.forEach===f)t.forEach(e,r);else if(t.length===+t.length){for(var n=0,o=t.length;n2;if(null==t&&(t=[]),m&&t.reduce===m)return n&&(e=T.bind(e,n)),i?t.reduce(e,r):t.reduce(e);if(S(t,function(t,o,a){i?r=e.call(n,r,t,o,a):(r=t,i=!0)}),!i)throw new TypeError(A);return r},T.reduceRight=T.foldr=function(t,e,r,n){var i=arguments.length>2;if(null==t&&(t=[]),g&&t.reduceRight===g)return n&&(e=T.bind(e,n)),i?t.reduceRight(e,r):t.reduceRight(e);var o=t.length;if(o!==+o){var a=T.keys(t);o=a.length}if(S(t,function(s,u,l){u=a?a[--o]:--o,i?r=e.call(n,r,t[u],u,l):(r=t[u],i=!0)}),!i)throw new TypeError(A);return r},T.find=T.detect=function(t,e,r){var n;return C(t,function(t,i,o){if(e.call(r,t,i,o))return n=t,!0}),n},T.filter=T.select=function(t,e,r){var n=[];return null==t?n:v&&t.filter===v?t.filter(e,r):(S(t,function(t,i,o){e.call(r,t,i,o)&&(n[n.length]=t)}),n)},T.reject=function(t,e,r){return T.filter(t,function(t,n,i){return!e.call(r,t,n,i)},r)},T.every=T.all=function(t,e,r){e||(e=T.identity);var n=!0;return null==t?n:_&&t.every===_?t.every(e,r):(S(t,function(t,o,a){if(!(n=n&&e.call(r,t,o,a)))return i}),!!n)};var C=T.some=T.any=function(t,e,r){e||(e=T.identity);var n=!1;return null==t?n:y&&t.some===y?t.some(e,r):(S(t,function(t,o,a){if(n||(n=e.call(r,t,o,a)))return i}),!!n)};T.contains=T.include=function(t,e){return null!=t&&(b&&t.indexOf===b?-1!=t.indexOf(e):C(t,function(t){return t===e}))},T.invoke=function(t,e){var r=l.call(arguments,2),n=T.isFunction(e);return T.map(t,function(t){return(n?e:t[e]).apply(t,r)})},T.pluck=function(t,e){return T.map(t,function(t){return t[e]})},T.where=function(t,e,r){return T.isEmpty(e)?r?null:[]:T[r?"find":"filter"](t,function(t){for(var r in e)if(e[r]!==t[r])return!1;return!0})},T.findWhere=function(t,e){return T.where(t,e,!0)},T.max=function(t,e,r){if(!e&&T.isArray(t)&&t[0]===+t[0]&&t.length<65535)return Math.max.apply(Math,t);if(!e&&T.isEmpty(t))return-1/0;var n={computed:-1/0,value:-1/0};return S(t,function(t,i,o){var a=e?e.call(r,t,i,o):t;a>=n.computed&&(n={value:t,computed:a})}),n.value},T.min=function(t,e,r){if(!e&&T.isArray(t)&&t[0]===+t[0]&&t.length<65535)return Math.min.apply(Math,t);if(!e&&T.isEmpty(t))return 1/0;var n={computed:1/0,value:1/0};return S(t,function(t,i,o){var a=e?e.call(r,t,i,o):t;an||void 0===r)return 1;if(r>>1;r.call(n,t[s])=0})})},T.difference=function(t){var e=c.apply(o,l.call(arguments,1));return T.filter(t,function(t){return!T.contains(e,t)})},T.zip=function(){for(var t=l.call(arguments),e=T.max(T.pluck(t,"length")),r=new Array(e),n=0;n=0;r--)e=[t[r].apply(this,e)];return e[0]}},T.after=function(t,e){return t<=0?e():function(){if(--t<1)return e.apply(this,arguments)}},T.keys=E||function(t){if(t!==Object(t))throw new TypeError("Invalid object");var e=[];for(var r in t)T.has(t,r)&&(e[e.length]=r);return e},T.values=function(t){var e=[];for(var r in t)T.has(t,r)&&e.push(t[r]);return e},T.pairs=function(t){var e=[];for(var r in t)T.has(t,r)&&e.push([r,t[r]]);return e},T.invert=function(t){var e={};for(var r in t)T.has(t,r)&&(e[t[r]]=r);return e},T.functions=T.methods=function(t){var e=[];for(var r in t)T.isFunction(t[r])&&e.push(r);return e.sort()},T.extend=function(t){return S(l.call(arguments,1),function(e){if(e)for(var r in e)t[r]=e[r]}),t},T.pick=function(t){var e={},r=c.apply(o,l.call(arguments,1));return S(r,function(r){r in t&&(e[r]=t[r])}),e},T.omit=function(t){var e={},r=c.apply(o,l.call(arguments,1));for(var n in t)T.contains(r,n)||(e[n]=t[n]);return e},T.defaults=function(t){return S(l.call(arguments,1),function(e){if(e)for(var r in e)null==t[r]&&(t[r]=e[r])}),t},T.clone=function(t){return T.isObject(t)?T.isArray(t)?t.slice():T.extend({},t):t},T.tap=function(t,e){return e(t),t};var I=function(t,e,r,n){if(t===e)return 0!==t||1/t==1/e;if(null==t||null==e)return t===e;t instanceof T&&(t=t._wrapped),e instanceof T&&(e=e._wrapped);var i=h.call(t);if(i!=h.call(e))return!1;switch(i){case"[object String]":return t==String(e);case"[object Number]":return t!=+t?e!=+e:0==t?1/t==1/e:t==+e;case"[object Date]":case"[object Boolean]":return+t==+e;case"[object RegExp]":return t.source==e.source&&t.global==e.global&&t.multiline==e.multiline&&t.ignoreCase==e.ignoreCase}if("object"!=typeof t||"object"!=typeof e)return!1;for(var o=r.length;o--;)if(r[o]==t)return n[o]==e;r.push(t),n.push(e);var a=0,s=!0;if("[object Array]"==i){if(s=(a=t.length)==e.length)for(;a--&&(s=I(t[a],e[a],r,n)););}else{var u=t.constructor,l=e.constructor;if(u!==l&&!(T.isFunction(u)&&u instanceof u&&T.isFunction(l)&&l instanceof l))return!1;for(var c in t)if(T.has(t,c)&&(a++,!(s=T.has(e,c)&&I(t[c],e[c],r,n))))break;if(s){for(c in e)if(T.has(e,c)&&!a--)break;s=!a}}return r.pop(),n.pop(),s};T.isEqual=function(t,e){return I(t,e,[],[])},T.isEmpty=function(t){if(null==t)return!0;if(T.isArray(t)||T.isString(t))return 0===t.length;for(var e in t)if(T.has(t,e))return!1;return!0},T.isElement=function(t){return!(!t||1!==t.nodeType)},T.isArray=w||function(t){return"[object Array]"==h.call(t)},T.isObject=function(t){return t===Object(t)},S(["Arguments","Function","String","Number","Date","RegExp"],function(t){T["is"+t]=function(e){return h.call(e)=="[object "+t+"]"}}),T.isArguments(arguments)||(T.isArguments=function(t){return!(!t||!T.has(t,"callee"))}),"function"!=typeof/./&&(T.isFunction=function(t){return"function"==typeof t}),T.isFinite=function(t){return isFinite(t)&&!isNaN(parseFloat(t))},T.isNaN=function(t){return T.isNumber(t)&&t!=+t},T.isBoolean=function(t){return!0===t||!1===t||"[object Boolean]"==h.call(t)},T.isNull=function(t){return null===t},T.isUndefined=function(t){return void 0===t},T.has=function(t,e){return p.call(t,e)},T.noConflict=function(){return t._=n,this},T.identity=function(t){return t},T.times=function(t,e,r){for(var n=Array(t),i=0;i":">",'"':""","'":"'","/":"/"}};M.unescape=T.invert(M.escape);var D={escape:new RegExp("["+T.keys(M.escape).join("")+"]","g"),unescape:new RegExp("("+T.keys(M.unescape).join("|")+")","g")};T.each(["escape","unescape"],function(t){T[t]=function(e){return null==e?"":(""+e).replace(D[t],function(e){return M[t][e]})}}),T.result=function(t,e){if(null==t)return null;var r=t[e];return T.isFunction(r)?r.call(t):r},T.mixin=function(t){S(T.functions(t),function(e){var r=T[e]=t[e];T.prototype[e]=function(){var t=[this._wrapped];return u.apply(t,arguments),j.call(this,r.apply(T,t))}})};var F=0;T.uniqueId=function(t){var e=++F+"";return t?t+e:e},T.templateSettings={evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g,escape:/<%-([\s\S]+?)%>/g};var L=/(.)^/,O={"'":"'","\\":"\\","\r":"r","\n":"n","\t":"t","\u2028":"u2028","\u2029":"u2029"},N=/\\|'|\r|\n|\t|\u2028|\u2029/g;T.template=function(t,e,r){var n;r=T.defaults({},r,T.templateSettings);var i=new RegExp([(r.escape||L).source,(r.interpolate||L).source,(r.evaluate||L).source].join("|")+"|$","g"),o=0,a="__p+='";t.replace(i,function(e,r,n,i,s){return a+=t.slice(o,s).replace(N,function(t){return"\\"+O[t]}),r&&(a+="'+\n((__t=("+r+"))==null?'':_.escape(__t))+\n'"),n&&(a+="'+\n((__t=("+n+"))==null?'':__t)+\n'"),i&&(a+="';\n"+i+"\n__p+='"),o=s+e.length,e}),a+="';\n",r.variable||(a="with(obj||{}){\n"+a+"}\n"),a="var __t,__p='',__j=Array.prototype.join,print=function(){__p+=__j.call(arguments,'');};\n"+a+"return __p;\n";try{n=new Function(r.variable||"obj","_",a)}catch(t){throw t.source=a,t}if(e)return n(e,T);var s=function(t){return n.call(this,t,T)};return s.source="function("+(r.variable||"obj")+"){\n"+a+"}",s},T.chain=function(t){return T(t).chain()};var j=function(t){return this._chain?T(t).chain():t};T.mixin(T),S(["pop","push","reverse","shift","sort","splice","unshift"],function(t){var e=o[t];T.prototype[t]=function(){var r=this._wrapped;return e.apply(r,arguments),"shift"!=t&&"splice"!=t||0!==r.length||delete r[0],j.call(this,r)}}),S(["concat","join","slice"],function(t){var e=o[t];T.prototype[t]=function(){return j.call(this,e.apply(this._wrapped,arguments))}}),T.extend(T.prototype,{chain:function(){return this._chain=!0,this},value:function(){return this._wrapped}})}).call(this)},{}],196:[function(t,e,r){"use strict";e.exports=function(t,e,r){return 0===t.length?t:e?(r||t.sort(e),function(t,e){for(var r=1,n=t.length,i=t[0],o=t[0],a=1;a=a?u+1:a}n.mkdir(e+"sequencer"+a,function(){var o=e+"sequencer"+a+"/",s=r.steps;if(i){var u=s.slice(-1)[0].output.src,l=s.slice(-1)[0].output.format,c=t("data-uri-to-buffer")(u);n.writeFile(o+"image_"+(s.length-1)+"."+l,c,function(){})}else for(var h in s){u=s[h].output.src,l=s[h].output.format,c=t("data-uri-to-buffer")(u);n.writeFile(o+"image_"+h+"."+l,c,function(){})}})},n.readdir(l,function(t,e){var r=[];if(void 0===e||0==e.length)return c(r),[];for(var i=0;it.options.name),n=this;for(var i in n.image=arguments[0],arguments)e.push(a(arguments[i]));var o=l.call(this,e,"l");0!=this.getSteps().length&&(this.options.sequencerCounter=0,c=[],this.steps=[]),c.push({method:"loadImages",json_q:a(o)});var s={name:"ImageSequencer Wrapper",sequencer:this,addSteps:this.addSteps,removeSteps:this.removeSteps,insertSteps:this.insertSteps,run:this.run,UI:this.UI,setUI:this.setUI};t("./ui/LoadImage")(n,"image",o.image,function(){var t;t=n,0!=r.length&&(t.addSteps(r),r=[]),o.callback.call(s)})}function m(t){var e={};if("load-image"==t)return{};if(0==arguments.length){for(var r in this.modules)e[r]=s[r][1];for(var n in this.sequences)e[n]={name:n,steps:this.sequences[n]}}else e=s[t]?s[t][1]:{inputs:u[t].options};return e}var g=t("./Strings.js")(this.steps,m,f,a);return{name:"ImageSequencer",options:e,inputlog:c,modules:s,sequences:u,events:h,steps:[],image:void 0,loadImages:d,loadImage:d,addSteps:f,removeSteps:function(){var t,e="ImageSequencer"==this.name?this:this.sequencer,r=[];for(var n in arguments)r.push(a(arguments[n]));var i,o,s=l.call(e,r,"-");for(var u in c.push({method:"removeSteps",json_q:a(s)}),t=s.sort(function(t,e){return e-t}))i=e,(o=t[u])>0&&(thisStep=i.steps[o],thisStep.UI.onRemove(thisStep.options.step),i.steps.splice(o,1));return this},insertSteps:function(){var e="ImageSequencer"==this.name?this:this.sequencer,r=[];for(var n in arguments)r.push(arguments[n]);var i=l.call(e,r,"^");c.push({method:"insertSteps",json_q:a(i)});var o=i;for(var s in o=o.sort(function(t,e){return e.index-t.index}))t("./InsertStep")(e,o[s].index,o[s].name,o[s].o);return this},replaceImage:function(e,r,n){return(n=n||{}).callback=n.callback||function(){},t("./ReplaceImage")(this,e,r,n)},run:function(e){var r,n=0;(e=e||{mode:"no-arg"}).index&&(n=e.index),"no-arg"!=e.mode&&"function"!=typeof e&&(e.progressObj&&(r=e.progressObj),delete arguments[0]);var o="ImageSequencer"==this.name?this:this.sequencer,s=[];for(var u in arguments)s.push(a(arguments[u]));var c=function(){};for(var u in s)"Function"==i(s[u])&&(c=s.splice(u,1)[0]);var h=l.call(o,s,"r");return t("./Run")(o,h,c,n,r),!0},setUI:function(e){this.events=t("./ui/UserInterface")(e)},exportBin:function(e,r,n){return t("./ExportBin")(e,this,r,n)},modulesInfo:m,toCliString:g.toCliString,detectStringSyntax:g.detectStringSyntax,parseStringSyntax:g.parseStringSyntax,stringToSteps:g.stringToSteps,toString:g.toString,stepToString:g.stepToString,toJSON:g.toJSON,stringToJSON:g.stringToJSON,stringToJSONstep:g.stringToJSONstep,importString:g.importString,importJSON:g.importJSON,loadNewModule:function(e,r){if(!r)return this;if(Array.isArray(r))this.modules[e]=r;else if(r.func&&r.info)this.modules[e]=[r.func,r.info];else if(r.path&&!this.inBrowser){const n=[t(`${r.path}/Module.js`),t(`${r.path}/info.json`)];this.modules[e]=n}return this},saveNewModule:function(t,r){if(!e.inBrowser){var n=p.readFileSync("./src/Modules.js").toString();n=n.substr(0,n.length-1)+" '"+t+"': require('"+r+"'),\n}",p.writeFileSync("./src/Modules.js",n)}},createMetaModule:t("./util/createMetaModule"),saveSequence:function(r,n){const i=stringToJSON(n);var o;e.inBrowser?((o=JSON.parse(window.localStorage.getItem("sequences")))[r]=i,window.localStorage.setItem("sequences",JSON.stringify(o))):((o=t("./SavedSequences.json"))[r]=i,p.writeFileSync("./src/SavedSequences.json",JSON.stringify(o)))},loadModules:function(){this.modules=t("./Modules"),e.inBrowser?this.sequences=JSON.parse(window.localStorage.getItem("sequences")):this.sequences=t("./SavedSequences.json")},getSteps:function(){return this.steps},log:function(t,r){"none"!=e.ui&&(1==arguments.length?console.log(arguments[0]):2==arguments.length&&console.log(t,r))},objTypeOf:i,copy:a,setInputStep:t("./ui/SetInputStep")(r)}},e.exports=ImageSequencer},{"./AddStep":201,"./ExportBin":202,"./FormatInput":203,"./InsertStep":205,"./Modules":206,"./ReplaceImage":207,"./Run":208,"./SavedSequences.json":210,"./Strings.js":211,"./ui/LoadImage":355,"./ui/SetInputStep":356,"./ui/UserInterface":357,"./util/createMetaModule":359,"./util/getStep.js":361,fs:72}],205:[function(t,e,r){t("./util/getStep.js");e.exports=function(t,e,r,n){if(t.sequences[r])return t.importJSON(t.sequences[r]);if(t.detectStringSyntax(r))return t.stringToSteps(r);!function(e,r,n){if(t.modules[r])var i=t.modules[r][1];else console.log("Module "+r+" not found.");var o=t.copy(n);o.number=t.options.sequencerCounter++,o.name=n.name||r||i.name,o.description=n.description||i.description,o.moduleInfo=n.moduleInfo||i,o.selector=n.selector||"ismod-"+r,o.container=n.container||t.options.selector,o.inBrowser=t.options.inBrowser,-1==e&&(e=t.steps.length),o.step={name:o.name,description:o.description,moduleInfo:o.moduleInfo,ID:o.number,inBrowser:t.options.inBrowser,ui:t.options.ui,options:o};var a=t.events;t.modules[r].expandSteps=function(r){for(var n in r){let i=r[n];t.insertSteps(e+Number.parseInt(n),i.name,i.options)}},o=o||{},t.modules[r][1].length?t.modules[r][0](o,a):(a.onSetup(o.step,{index:e}),t.steps.splice(e,0,t.modules[r][0](o,a)))}(e,r,n),t.steps=t.steps}},{"./util/getStep.js":361}],206:[function(t,e,r){e.exports={"add-qr":t("./modules/AddQR"),average:t("./modules/Average"),blend:t("./modules/Blend"),blur:t("./modules/Blur"),brightness:t("./modules/Brightness"),"canvas-resize":t("./modules/CanvasResize"),channel:t("./modules/Channel"),colorbar:t("./modules/Colorbar"),"color-temperature":t("./modules/ColorTemperature"),colormap:t("./modules/Colormap"),contrast:t("./modules/Contrast"),convolution:t("./modules/Convolution"),crop:t("./modules/Crop"),"decode-qr":t("./modules/DecodeQr"),dither:t("./modules/Dither"),"draw-rectangle":t("./modules/DrawRectangle"),dynamic:t("./modules/Dynamic"),"edge-detect":t("./modules/EdgeDetect"),exposure:t("./modules/Exposure"),"flip-image":t("./modules/FlipImage"),"fisheye-gl":t("./modules/FisheyeGl"),histogram:t("./modules/Histogram"),"gamma-correction":t("./modules/GammaCorrection"),gradient:t("./modules/Gradient"),"grid-overlay":t("./modules/GridOverlay"),"import-image":t("./modules/ImportImage"),invert:t("image-sequencer-invert"),ndvi:t("./modules/Ndvi"),"ndvi-colormap":t("./modules/NdviColormap"),"noise-reduction":t("./modules/NoiseReduction"),overlay:t("./modules/Overlay"),"paint-bucket":t("./modules/PaintBucket"),"replace-color":t("./modules/ReplaceColor"),resize:t("./modules/Resize"),rotate:t("./modules/Rotate"),saturation:t("./modules/Saturation"),"text-overlay":t("./modules/TextOverlay"),threshold:t("./modules/Threshold"),tint:t("./modules/Tint"),"webgl-distort":t("./modules/WebglDistort"),"white-balance":t("./modules/WhiteBalance")}},{"./modules/AddQR":214,"./modules/Average":217,"./modules/Blend":220,"./modules/Blur":224,"./modules/Brightness":227,"./modules/CanvasResize":230,"./modules/Channel":233,"./modules/ColorTemperature":236,"./modules/Colorbar":239,"./modules/Colormap":243,"./modules/Contrast":247,"./modules/Convolution":251,"./modules/Crop":256,"./modules/DecodeQr":259,"./modules/Dither":263,"./modules/DrawRectangle":267,"./modules/Dynamic":270,"./modules/EdgeDetect":274,"./modules/Exposure":277,"./modules/FisheyeGl":280,"./modules/FlipImage":284,"./modules/GammaCorrection":287,"./modules/Gradient":290,"./modules/GridOverlay":294,"./modules/Histogram":297,"./modules/ImportImage":301,"./modules/Ndvi":305,"./modules/NdviColormap":308,"./modules/NoiseReduction":312,"./modules/Overlay":315,"./modules/PaintBucket":319,"./modules/ReplaceColor":323,"./modules/Resize":326,"./modules/Rotate":329,"./modules/Saturation":332,"./modules/TextOverlay":336,"./modules/Threshold":340,"./modules/Tint":343,"./modules/WebglDistort":347,"./modules/WhiteBalance":350,"image-sequencer-invert":87}],207:[function(t,e,r){e.exports=function(t,e,r,n){if(!t.options.inBrowser)return!1;var i=ImageSequencer({ui:!1});if(window.hasOwnProperty("$"))var o=$(e);else o=document.querySelectorAll(e);for(var a=[],s=0;s=e.steps.length?{options:{name:void 0}}:e.steps.slice(c+t)[0]},p.getIndex=function(){return c},n)n.hasOwnProperty(f)&&(p[f]=n[f]);p.UI.onDraw(p.options.step);var d=t("./RunToolkit")(e.copy(h));p.draw(d,function(){e.steps[c].options.step.output=e.steps[c].output.src,e.steps[c].UI.onComplete(e.steps[c].options.step),r(o,++s)},a)}}(s,o)}(r=function(t){0==t[0]&&1==e.steps.length?delete t[0]:0==t[0]&&t[0]++;for(var r=e.steps[t[0]-1];void 0===r||void 0===r.output;)r=e.steps[--t[0]-1];return t}(r))}},{"./RunToolkit":209,"./util/getStep.js":361}],209:[function(t,e,r){const n=t("get-pixels"),i=t("./modules/_nomodule/PixelManipulation"),o=t("lodash"),a=t("data-uri-to-buffer"),s=t("save-pixels");e.exports=function(t){return t.getPixels=n,t.pixelManipulation=i,t.lodash=o,t.dataUriToBuffer=a,t.savePixels=s,t}},{"./modules/_nomodule/PixelManipulation":352,"data-uri-to-buffer":18,"get-pixels":28,lodash:101,"save-pixels":189}],210:[function(t,e,r){e.exports={sample:[{name:"invert",options:{}},{name:"channel",options:{channel:"red"}},{name:"blur",options:{blur:"5"}}]}},{}],211:[function(t,e,r){e.exports=function(t,e,r,n){function i(t){return!(!t.includes(",")&&!t.includes("{"))}function o(t){return t.replace(/\s/g,"").split(",")}function a(t){var r=t.name?t.name:t.options.name;let n=e(r).inputs||{},i={};for(let e in n)t.options[e]&&t.options[e]!=n[e].default&&(i[e]=t.options[e],i[e]=encodeURIComponent(i[e]));return`${r}{${Object.keys(i).map(t=>t+":"+i[t]).join("|")}}`}function s(t){let e;return(e=i(t)?o(t):[t]).map(u)}function u(t){var e;if(e=t.includes("{")?t.includes("(")&&t.indexOf("(")=h&&d>=p?(r.set(f,d,0,a.get(f-h,d-p,0)),r.set(f,d,1,a.get(f-h,d-p,1)),r.set(f,d,2,a.get(f-h,d-p,2)),r.set(f,d,3,a.get(f-h,d-p,3))):(r.set(f,d,0,n.get(f,d,0)),r.set(f,d,1,n.get(f,d,1)),r.set(f,d,2,n.get(f,d,2)),r.set(f,d,3,n.get(f,d,3)));i()})})}},{"get-pixels":28,imagejs:88,qrcode:140}],214:[function(t,e,r){e.exports=[t("./Module"),t("./info.json")]},{"./Module":212,"./info.json":215}],215:[function(t,e,r){e.exports={name:"add-qr",description:"Adds QR corresponding to the given string",url:"https://github.com/publiclab/image-sequencer/tree/master/MODULES.md",inputs:{size:{type:"integer",desc:"size of QR code in pixels",default:200},qrCodeString:{type:"string",desc:"input string to generate QR code",default:"https://github.com/publiclab/image-sequencer"}},"docs-link":"https://github.com/publiclab/image-sequencer/blob/main/docs/MODULES.md#add-qr-module"}},{}],216:[function(t,e,r){e.exports=function(e,r){return e.step.metadata=e.step.metadata||{},{options:e,draw:function(r,n,i){i.stop(!0),i.overrideFlag=!0;var o=this;return t("../_nomodule/PixelManipulation.js")(r,{output:function(t,e,r){o.output={src:e,format:r}},ui:e.step.ui,extraManipulation:function(t){for(var r=0,n=[0,0,0,0];rAverages (r, g, b, a): "+n.join(", ")+"

"),t},format:r.format,image:e.image,callback:n})},output:void 0,UI:r}}},{"../_nomodule/PixelManipulation.js":352}],217:[function(t,e,r){arguments[4][214][0].apply(r,arguments)},{"./Module":216,"./info.json":218,dup:214}],218:[function(t,e,r){e.exports={name:"average",description:"Average all pixel color",inputs:{},"docs-link":"https://github.com/publiclab/image-sequencer/blob/main/docs/MODULES.md#average-module"}},{}],219:[function(require,module,exports){module.exports=function Dynamic(options,UI,util){var defaults=require("./../../util/getDefaults.js")(require("./info.json")),output;function draw(input,callback,progressObj){progressObj.stop(!0),progressObj.overrideFlag=!0;var step=this;"string"==typeof options.func&&eval("options.func = "+options.func);var getPixels=require("get-pixels");"string"==typeof options.offset&&(options.offset=parseInt(options.offset));var priorStep=this.getStep(options.offset);void 0===priorStep.output&&(this.output=input,UI.notify("Offset Unavailable","offset-notification"),callback()),getPixels(priorStep.output.src,function(t,e){return options.firstImagePixels=e,require("../_nomodule/PixelManipulation.js")(input,{output:function(t,e,r){step.output={src:e,format:r}},ui:options.step.ui,changePixel:function(t,e,r,n,i,o){let a=options.firstImagePixels;return options.func(t,e,r,n,a.get(i,o,0),a.get(i,o,1),a.get(i,o,2),a.get(i,o,3))},format:input.format,image:options.image,inBrowser:options.inBrowser,callback:callback})})}return options.func=options.func||defaults.blend,options.offset=options.offset||defaults.offset,{options:options,draw:draw,output:output,UI:UI}}},{"../_nomodule/PixelManipulation.js":352,"./../../util/getDefaults.js":360,"./info.json":221,"get-pixels":28}],220:[function(t,e,r){arguments[4][214][0].apply(r,arguments)},{"./Module":219,"./info.json":221,dup:214}],221:[function(t,e,r){e.exports={name:"blend",description:"Blend two chosen image steps with the given function. Defaults to using the red channel from image 1 and the green and blue and alpha channels of image 2. Easier to use interfaces coming soon!",inputs:{offset:{type:"integer",desc:"Choose which image to blend the current image with. Two steps back is -2, three steps back is -3 etc.",default:-2},blend:{type:"string",desc:"Function to use to blend the two images.",default:"function(r1, g1, b1, a1, r2, g2, b2, a2) { return [ r1, g2, b2, a2 ] }"}},"docs-link":"https://github.com/publiclab/image-sequencer/blob/main/docs/MODULES.md#blend-module"}},{}],222:[function(t,e,r){e.exports=function(e,r){let n=function(t=1){let e=[],r=0;0==t&&(t+=.05);const n=2*Math.pow(t,2);for(let t=-2;t<=2;t++){e.push([]);for(let i=-2;i<=2;i++){let o=Math.sqrt(Math.pow(i,2)+Math.pow(t,2));e[t+2].push(Math.exp(-o/n)),r+=e[t+2][i+2]}}for(let t=0;t<5;t++)for(let n=0;n<5;n++)e[n][t]=e[n][t]/r;return e}(r),i={r:[],g:[],b:[]};for(let t=0;t"40000"?"40000":e.temperature,i.stop(!0),i.overrideFlag=!0;var o=this;return t("../_nomodule/PixelManipulation.js")(r,{output:function(t,e,r){o.output={src:e,format:r}},ui:e.step.ui,extraManipulation:function(t){let r,n,i,o=parseInt(e.temperature);(o/=100)<=66?(r=255,n=Math.min(Math.max(99.4708025861*Math.log(o)-161.1195681661,0),255)):(r=Math.min(Math.max(329.698727446*Math.pow(o-60,-.1332047592),0),255),n=Math.min(Math.max(288.1221695283*Math.pow(o-60,-.0755148492),0),255)),o>=66?i=255:o<=19?i=0:(i=o-10,i=Math.min(Math.max(138.5177312231*Math.log(i)-305.0447927307,0),255));for(let e=0;em;r=0<=m?++c:--c)n[r]=(e-i)/(o-i)*(u[r]-s[r])+s[r];return n}}e.exports=function(t,e){return e.colormap=e.colormap||i.default,"object"==typeof e.colormap?colormapFunction=n(e.colormap):i.hasOwnProperty(e.colormap)?colormapFunction=i[e.colormap]:colormapFunction=i.default,colormapFunction(t/255)};var i={greyscale:n([[0,[0,0,0],[255,255,255]],[1,[255,255,255],[255,255,255]]]),bluwhtgrngis:n([[0,[6,23,86],[6,25,84]],[.0625,[6,25,84],[6,25,84]],[.125,[6,25,84],[6,25,84]],[.1875,[6,25,84],[6,25,84]],[.25,[6,25,84],[6,25,84]],[.3125,[6,25,84],[9,24,84]],[.3438,[9,24,84],[119,120,162]],[.375,[119,129,162],[249,250,251]],[.406,[249,250,251],[255,255,255]],[.4375,[255,255,255],[255,255,255]],[.5,[255,255,255],[214,205,191]],[.52,[214,205,191],[178,175,96]],[.5625,[178,175,96],[151,176,53]],[.593,[151,176,53],[146,188,12]],[.625,[146,188,12],[96,161,1]],[.6875,[96,161,1],[30,127,3]],[.75,[30,127,3],[0,99,1]],[.8125,[0,99,1],[0,74,1]],[.875,[0,74,1],[0,52,0]],[.9375,[0,52,0],[0,34,0]],[.968,[0,34,0],[68,70,67]]]),brntogrn:n([[0,[110,12,3],[118,6,1]],[.0625,[118,6,1],[141,19,6]],[.125,[141,19,6],[165,35,13]],[.1875,[165,35,13],[177,59,25]],[.2188,[177,59,25],[192,91,36]],[.25,[192,91,36],[214,145,76]],[.3125,[214,145,76],[230,183,134]],[.375,[230,183,134],[243,224,194]],[.4375,[243,224,194],[250,252,229]],[.5,[250,252,229],[217,235,185]],[.5625,[217,235,185],[184,218,143]],[.625,[184,218,143],[141,202,89]],[.6875,[141,202,89],[80,176,61]],[.75,[80,176,61],[0,147,32]],[.8125,[0,147,32],[1,122,22]],[.875,[1,122,22],[0,114,19]],[.9,[0,114,19],[0,105,18]],[.9375,[0,105,18],[7,70,14]]]),blutoredjet:n([[0,[0,0,140],[1,1,186]],[.0625,[1,1,186],[0,1,248]],[.125,[0,1,248],[0,70,254]],[.1875,[0,70,254],[0,130,255]],[.25,[0,130,255],[2,160,255]],[.2813,[2,160,255],[0,187,255]],[.3125,[0,187,255],[6,250,255]],[.375,[8,252,251],[27,254,228]],[.406,[27,254,228],[70,255,187]],[.4375,[70,255,187],[104,254,151]],[.47,[104,254,151],[132,255,19]],[.5,[132,255,19],[195,255,60]],[.5625,[195,255,60],[231,254,25]],[.5976,[231,254,25],[253,246,1]],[.625,[253,246,1],[252,210,1]],[.657,[252,210,1],[255,183,0]],[.6875,[255,183,0],[255,125,2]],[.75,[255,125,2],[255,65,1]],[.8125,[255,65,1],[247,1,1]],[.875,[247,1,1],[200,1,3]],[.9375,[200,1,3],[122,3,2]]]),colors16:n([[0,[0,0,0],[0,0,0]],[.0625,[3,1,172],[3,1,172]],[.125,[3,1,222],[3,1,222]],[.1875,[0,111,255],[0,111,255]],[.25,[3,172,255],[3,172,255]],[.3125,[1,226,255],[1,226,255]],[.375,[2,255,0],[2,255,0]],[.4375,[198,254,0],[190,254,0]],[.5,[252,255,0],[252,255,0]],[.5625,[255,223,3],[255,223,3]],[.625,[255,143,3],[255,143,3]],[.6875,[255,95,3],[255,95,3]],[.75,[242,0,1],[242,0,1]],[.8125,[245,0,170],[245,0,170]],[.875,[223,180,225],[223,180,225]],[.9375,[255,255,255],[255,255,255]]]),default:n([[0,[45,1,121],[25,1,137]],[.125,[25,1,137],[0,6,156]],[.1875,[0,6,156],[7,41,172]],[.25,[7,41,172],[22,84,187]],[.3125,[22,84,187],[25,125,194]],[.375,[25,125,194],[26,177,197]],[.4375,[26,177,197],[23,199,193]],[.47,[23,199,193],[25,200,170]],[.5,[25,200,170],[21,209,27]],[.5625,[21,209,27],[108,215,18]],[.625,[108,215,18],[166,218,19]],[.6875,[166,218,19],[206,221,20]],[.75,[206,221,20],[222,213,19]],[.7813,[222,213,19],[222,191,19]],[.8125,[222,191,19],[227,133,17]],[.875,[227,133,17],[231,83,16]],[.9375,[231,83,16],[220,61,48]]]),fastie:n([[0,[255,255,255],[0,0,0]],[.167,[0,0,0],[255,255,255]],[.33,[255,255,255],[0,0,0]],[.5,[0,0,0],[140,140,255]],[.55,[140,140,255],[0,255,0]],[.63,[0,255,0],[255,255,0]],[.75,[255,255,0],[255,0,0]],[.95,[255,0,0],[255,0,255]]]),stretched:n([[0,[0,0,255],[0,0,255]],[.1,[0,0,255],[38,195,195]],[.5,[0,150,0],[255,255,0]],[.7,[255,255,0],[255,50,50]],[.9,[255,50,50],[255,50,50]]])}},{}],242:[function(t,e,r){e.exports=function(e,r){return{options:e,draw:function(r,n,i){i.stop(!0),i.overrideFlag=!0;var o=this;return t("../_nomodule/PixelManipulation.js")(r,{output:function(t,e,r){o.output={src:e,format:r}},ui:e.step.ui,changePixel:function(r,n,i,o){var a=(r+n+i)/3,s=t("./Colormap")(a,e);return[s[0],s[1],s[2],255]},format:r.format,image:e.image,inBrowser:e.inBrowser,callback:n})},output:void 0,UI:r}}},{"../_nomodule/PixelManipulation.js":352,"./Colormap":241}],243:[function(t,e,r){arguments[4][214][0].apply(r,arguments)},{"./Module":242,"./info.json":244,dup:214}],244:[function(t,e,r){e.exports={name:"colormap",description:"Maps brightness values (average of red, green & blue) to a given color lookup table, made up of a set of one more color gradients.\n\nFor example, 'cooler' colors like blue could represent low values, while 'hot' colors like red could represent high values.",inputs:{colormap:{type:"select",desc:"Name of the Colormap",default:"default",values:["default","greyscale","bluwhtgrngis","stretched","fastie","brntogrn","blutoredjet","colors16"]}},"docs-link":"https://github.com/publiclab/image-sequencer/blob/main/docs/MODULES.md#colormap-module"}},{}],245:[function(t,e,r){var n=t("lodash");e.exports=function(t,e){let r=n.cloneDeep(t);(e=Number(e))<-100&&(e=-100),e>100&&(e=100),e=(100+e)/100,e*=e;for(let n=0;n255&&(i=255);var o=r.get(n,s,1)/255;o-=.5,o*=e,o+=.5,(o*=255)<0&&(o=0),o>255&&(o=255);var a=r.get(n,s,2)/255;a-=.5,a*=e,a+=.5,(a*=255)<0&&(a=0),a>255&&(a=255),t.set(n,s,0,i),t.set(n,s,1,o),t.set(n,s,2,a)}return t}},{lodash:101}],246:[function(t,e,r){e.exports=function(e,r){var n=t("./../../util/getDefaults.js")(t("./info.json"));return e.contrast=e.contrast||n.contrast,{options:e,draw:function(r,n,i){i.stop(!0),i.overrideFlag=!0;var o=this;return t("../_nomodule/PixelManipulation.js")(r,{output:function(t,e,r){o.output={src:e,format:r}},ui:e.step.ui,extraManipulation:function(r){return r=t("./Contrast")(r,e.contrast)},format:r.format,image:e.image,callback:n})},output:void 0,UI:r}}},{"../_nomodule/PixelManipulation.js":352,"./../../util/getDefaults.js":360,"./Contrast":245,"./info.json":248}],247:[function(t,e,r){arguments[4][214][0].apply(r,arguments)},{"./Module":246,"./info.json":248,dup:214}],248:[function(t,e,r){e.exports={name:"contrast",description:"Change the contrast of the image by given value",inputs:{contrast:{type:"integer",desc:"contrast for the new image, typically -100 to 100",default:70,min:-100,max:100}},"docs-link":"https://github.com/publiclab/image-sequencer/blob/main/docs/MODULES.md#contrast-module"}},{}],249:[function(t,e,r){t("lodash");e.exports=function(e,r,n,o){let a=function(t,e){for(e=e.split(" "),i=0;i<9;i++)e[i]=Number(e[i])*t;let r=0,n=[];for(y=0;y<3;y++)for(n.push([]),x=0;x<3;x++)n[y].push(e[r]),r+=1;return n}(r,n),s={r:[],g:[],b:[]};for(let t=0;tRead more",inputs:{constantFactor:{type:"float",desc:"a constant factor, multiplies all the kernel values by that factor",default:.111,min:.001,max:2,step:.001},kernelValues:{type:"string",desc:"nine space separated numbers representing the kernel values in left to right and top to bottom format.",default:"1 1 1 1 1 1 1 1 1",placeholder:"1 1 1 1 1 1 1 1 1"}},"docs-link":"https://github.com/publiclab/image-sequencer/blob/main/docs/MODULES.md#convolution-module"}},{}],253:[function(t,e,r){(function(r){e.exports=function(e,n,i){var o=t("./../../util/getDefaults.js")(t("./info.json")),a=t("get-pixels"),s=t("save-pixels");n.x=parseInt(n.x)||o.x,n.y=parseInt(n.y)||o.y,a(e.src,function(t,a){n.w=parseInt(n.w)||Math.floor(a.shape[0]),n.h=parseInt(n.h)||Math.floor(a.shape[1]),n.backgroundColor=n.backgroundColor||o.backgroundColor;var u=n.x,l=n.y,c=n.w,h=n.h,p=a.shape[0],f=a.shape[1],d=[];backgroundColor=n.backgroundColor.split(" ");for(var m=0;mRead more",inputs:{dither:{type:"select",desc:"Name of the Dithering Algorithm",default:"none",values:["none","floydsteinberg","bayer","Atkinson"]}},"docs-link":"https://github.com/publiclab/image-sequencer/blob/main/docs/MODULES.md#dither-module"}},{}],265:[function(t,e,r){e.exports=function(e,r){var n=t("./../../util/getDefaults.js")(t("./info.json"));r.startingX=r.startingX||n.startingX,r.startingY=r.startingY||n.startingY;var i=Number(r.startingX),o=Number(r.startingY),a=e.shape[0],s=e.shape[1],u=Number(r.thickness)||n.thickness,l=r.endX=Number(r.endX)-u||a-1,c=r.endY=Number(r.endY)-u||s-1,h=r.color||n.color;h=h.split(" ");var p=function(t,r,n,i){for(var o=t;o<=n+u;o++)for(var a=r;a<=i+u;a++)e.set(o,a,0,h[0]),e.set(o,a,1,h[1]),e.set(o,a,2,h[2]),e.set(o,a,3,h[3])};return p(i,o,i,c),p(l,o,l,c),p(i,o,l,o),p(i,c,l,c),e}},{"./../../util/getDefaults.js":360,"./info.json":268}],266:[function(t,e,r){e.exports=function(e,r){return{options:e,draw:function(r,n,i){i.stop(!0),i.overrideFlag=!0;var o=this;return t("../_nomodule/PixelManipulation.js")(r,{output:function(t,e,r){o.output={src:e,format:r}},ui:e.step.ui,changePixel:function(t,e,r,n){return[t,e,r,n]},extraManipulation:function(r){return r=t("./DrawRectangle")(r,e)},format:r.format,image:e.image,callback:n})},output:void 0,UI:r}}},{"../_nomodule/PixelManipulation.js":352,"./DrawRectangle":265}],267:[function(t,e,r){arguments[4][214][0].apply(r,arguments)},{"./Module":266,"./info.json":268,dup:214}],268:[function(t,e,r){e.exports={name:"draw-rectangle",description:"It draws a rectangle on the image",inputs:{startingX:{type:"integer",desc:"starting x position of the rectangle",default:0},startingY:{type:"integer",desc:"starting y position of the rectangle",default:0},endX:{type:"integer",desc:"last x position of the rectangle",default:"width"},endY:{type:"integer",desc:"last y position of the rectangle",default:"height"},thickness:{type:"integer",desc:"thickness of border",default:1},color:{type:"string",desc:"RGBA values separated by a space",default:"0 0 0 255"}},"docs-link":"https://github.com/publiclab/image-sequencer/blob/main/docs/MODULES.md#draw-rectangle-module"}},{}],269:[function(require,module,exports){module.exports=function Dynamic(options,UI){var output;function draw(input,callback,progressObj){progressObj.stop(!0),progressObj.overrideFlag=!0;var step=this;function generator(expression){var func="f = function (r, g, b, a) { var R = r, G = g, B = b, A = a;",f;return func+="return ",func=func+expression+"}",eval(func),f}options.monochrome=options.monochrome||"(R+G+B)/3";var channels=["red","green","blue","alpha"];function changePixel(t,e,r,n){return[options.red_function(t,e,r,n),options.green_function(t,e,r,n),options.blue_function(t,e,r,n),options.alpha_function(t,e,r,n)]}function getNeighbourPixel(t,e,r,n,i){return[t.get(e+n,r+i,0),t.get(e+n,r+i,1),t.get(e+n,r+i,2),t.get(e+n,r+i,3)]}function map(t,e,r,n,i,o){var a=(t-e)/(r-e)*(i-n)+n;if(!o)return a;function s(t,e,r){return Math.max(Math.min(t,r),e)}return nInfragrammar.",inputs:{red:{type:"string",desc:"Expression to return for red channel with R, G, B, and A inputs",default:"r"},green:{type:"string",desc:"Expression to return for green channel with R, G, B, and A inputs",default:"g"},blue:{type:"string",desc:"Expression to return for blue channel with R, G, B, and A inputs",default:"b"},"monochrome (fallback)":{type:"string",desc:"Expression to return with R, G, B, and A inputs; fallback for other channels if none provided",default:"r + g + b"}},"docs-link":"https://github.com/publiclab/image-sequencer/blob/main/docs/MODULES.md#dynamic-module"}},{}],272:[function(t,e,r){const n=[[-1,0,1],[-2,0,2],[-1,0,1]],i=[[-1,-2,-1],[0,0,0],[1,2,1]];let o=[];function a(t,e){t.set(e[0],e[1],0,0),t.set(e[0],e[1],1,0),t.set(e[0],e[1],2,0),t.set(e[0],e[1],3,255)}function s(t,e,r){let o=t.get(e,r,0),a=0,s=0;for(let o=0;o<3;o++)for(let u=0;u<3;u++){let c=e+o-1,h=r+u-1;l(t,c,h)?(a+=t.get(c+1,h+1,0)*n[o][u],s+=t.get(c+1,h+1,0)*i[o][u]):(a+=t.get(c,h,0)*n[o][u],s+=t.get(c,h,0)*i[o][u])}return{pixel:[o,o,o,Math.sqrt(Math.pow(a,2)+Math.pow(s,2))],angle:Math.atan2(s,a)}}function u(t){return t>=-22.5&&t<=22.5||t<-157.5&&t>=-180?1:t>=22.5&&t<=67.5||t<-112.5&&t>=-157.5?2:t>=67.5&&t<=112.5||t<-67.5&&t>=-112.5?3:t>=112.5&&t<=157.5||t<-22.5&&t>=-67.5?4:void 0}function l(t,e,r){return e<0||r<0||e>=t.shape[0]||r>=t.shape[1]}e.exports=function(t,e,r,n){let i=[],f=[],d=[],m=[];for(var g=0;gt.map(h));for(let n=0;n=e[n][i+1]&&e[n][i]>=e[n][i-1]||o.push([n,i]);break;case 2:e[n][i]>=e[n+1][i+1]&&e[n][i]>=e[n-1][i-1]||o.push([n,i]);break;case 3:e[n][i]>=e[n+1][i]&&e[n][i]>=e[n-1][i]||o.push([n,i]);break;case 4:e[n][i]>=e[n+1][i-1]&&e[n][i]>=e[n-1][i+1]||o.push([n,i])}}}(t,f,i),function(t,e,r,n,i,a){const s=p(n)*e,u=s*r;for(let e=0;eu?n[e][r]>s?i.push(t):a.push(t):o.push(t)}}(t,e,r,f,d,m),"true"==n.toLowerCase()&&function(t,e){t.forEach(t=>{let r=t[0],n=t[1];e.includes([r+1,n])?c(e,[r+1,n]):e.includes([r-1,n])?c(e,[r-1,n]):e.includes([r,n+1])?c(e,[r,n+1]):e.includes([r,n-1])&&c(e,[r,n-1])})}(d,m),d.forEach(e=>(function(t,e){t.set(e[0],e[1],0,255),t.set(e[0],e[1],1,255),t.set(e[0],e[1],2,255),t.set(e[0],e[1],3,255)})(t,e)),m.forEach(e=>a(t,e)),o.forEach(e=>a(t,e)),t};const c=(t=[],e)=>t.filter(t=>t!==e);var h=t=>180*t/Math.PI,p=t=>Math.max(...t.map(t=>t.map(t=>t||0)).map(t=>Math.max(...t)))},{}],273:[function(t,e,r){e.exports=function(e,r){var n=t("./../../util/getDefaults.js")(t("./info.json"));return e.blur=e.blur||n.blur,e.highThresholdRatio=e.highThresholdRatio||n.highThresholdRatio,e.lowThresholdRatio=e.lowThresholdRatio||n.lowThresholdRatio,e.hysteresis=e.hysteresis||n.hysteresis,{options:e,draw:function(r,n,i){i.stop(!0),i.overrideFlag=!0;var o=this;const a=ImageSequencer({inBrowser:!1,ui:!1});return a.loadImage(r.src,function(){return a.importJSON([{name:"blur",options:{blur:e.blur}}]),a.run(function(i){t("get-pixels")(i,function(i,a){if(!i)return t("../_nomodule/PixelManipulation.js")(r,{output:function(t,e,r){o.output={src:e,format:r}},ui:e.step.ui,changePixel:function(t,e,r,n){return[(t+e+r)/3,(t+e+r)/3,(t+e+r)/3,n]},extraManipulation:function(){return t("./EdgeUtils")(a,e.highThresholdRatio,e.lowThresholdRatio,e.hysteresis)},format:r.format,image:e.image,inBrowser:e.inBrowser,callback:n})})})})},output:void 0,UI:r}}},{"../_nomodule/PixelManipulation.js":352,"./../../util/getDefaults.js":360,"./EdgeUtils":272,"./info.json":275,"get-pixels":28}],274:[function(t,e,r){arguments[4][214][0].apply(r,arguments)},{"./Module":273,"./info.json":275,dup:214}],275:[function(t,e,r){e.exports={name:"edge-detect",description:"This module detects edges using the Canny method, which first Gaussian blurs the image to reduce noise (amount of blur configurable in settings as `options.blur`), then applies a number of steps to highlight edges, resulting in a greyscale image where the brighter the pixel, the stronger the detected edge. Read more. ",inputs:{blur:{type:"float",desc:"Amount of gaussian blur(Less blur gives more detail, typically 0-5)",default:2,min:.05,max:5,step:.05},highThresholdRatio:{type:"float",desc:"The high threshold ratio for the image",default:.2,min:0,max:1,step:.01},lowThresholdRatio:{type:"float",desc:"The low threshold value for the image",default:.15,min:0,max:1,step:.01},hysteresis:{type:"select",desc:"Toggle Hysteresis",values:["false","true"],default:"false"}},"docs-link":"https://github.com/publiclab/image-sequencer/blob/main/docs/MODULES.md#edge-detect-module"}},{}],276:[function(t,e,r){e.exports=function(e,r){var n=t("./../../util/getDefaults.js")(t("./info.json"));return{options:e,draw:function(r,i,o){e.exposure=e.exposure||n.exposure;var a=Math.pow(2,e.exposure);o.stop(!0),o.overrideFlag=!0;var s=this;return t("../_nomodule/PixelManipulation.js")(r,{output:function(t,e,r){s.output={src:e,format:r}},ui:e.step.ui,changePixel:function(t,e,r,n){return[t=Math.min(255,t*a),e=Math.min(255,e*a),r=Math.min(255,r*a),n]},format:r.format,image:e.image,inBrowser:e.inBrowser,callback:i})},output:void 0,UI:r}}},{"../_nomodule/PixelManipulation.js":352,"./../../util/getDefaults.js":360,"./info.json":278}],277:[function(t,e,r){arguments[4][214][0].apply(r,arguments)},{"./Module":276,"./info.json":278,dup:214}],278:[function(t,e,r){e.exports={name:"exposure",description:"Change the exposure of the image by given exposure value",inputs:{exposure:{type:"float",desc:"exposure value for the new image",default:1,min:-3,max:4,step:.05}},"docs-link":"https://github.com/publiclab/image-sequencer/blob/main/docs/MODULES.md"}},{}],279:[function(t,e,r){e.exports=function(e,r){t("fisheyegl");return{options:e,draw:function(r,n){var i=this;if(e.inBrowser){if(document.querySelector("#image-sequencer-canvas"))var o=document.querySelector("#image-sequencer-canvas");else(o=document.createElement("canvas")).style.display="none",o.setAttribute("id","image-sequencer-canvas"),document.body.append(o);distorter=FisheyeGl({selector:"#image-sequencer-canvas"}),e.a=parseFloat(e.a)||distorter.lens.a,e.b=parseFloat(e.b)||distorter.lens.b,e.Fx=parseFloat(e.Fx)||distorter.lens.Fx,e.Fy=parseFloat(e.Fy)||distorter.lens.Fy,e.scale=parseFloat(e.scale)||distorter.lens.scale,e.x=parseFloat(e.x)||distorter.fov.x,e.y=parseFloat(e.y)||distorter.fov.y,distorter.lens.a=e.a,distorter.lens.b=e.b,distorter.lens.Fx=e.Fx,distorter.lens.Fy=e.Fy,distorter.lens.scale=e.scale,distorter.fov.x=e.x,distorter.fov.y=e.y,distorter.setImage(r.src,function(){i.output={src:o.toDataURL(),format:r.format},n()})}else t("../_nomodule/gl-context")(r,n,i,e)},output:void 0,UI:r}}},{"../_nomodule/gl-context":353,fisheyegl:20}],280:[function(t,e,r){arguments[4][214][0].apply(r,arguments)},{"./Module":279,"./info.json":281,dup:214}],281:[function(t,e,r){e.exports={name:"fisheye-gl",description:"Correct fisheye, or barrel distortion, in images (with WebGL -- adapted from fisheye-correction-webgl by @bluemir).",requires:["webgl"],inputs:{a:{type:"float",desc:"a parameter",default:1,min:1,max:4},b:{type:"float",desc:"b parameter",default:1,min:1,max:4},Fx:{type:"float",desc:"Fx parameter",default:0,min:0,max:4},Fy:{type:"float",desc:"Fy parameter",default:0,min:0,max:4},scale:{type:"float",desc:"Image Scaling",default:1.5,min:0,max:20},x:{type:"float",desc:"FOV x parameter",default:1.5,min:0,max:20},y:{type:"float",desc:"FOV y parameter",default:1.5,min:0,max:20},fragmentSrc:{type:"PATH",desc:"Path to a WebGL fragment shader file",default:"(inbuilt)"},vertexSrc:{type:"PATH",desc:"Path to a WebGL vertex shader file",default:"(inbuilt)"}},"docs-link":"https://github.com/publiclab/image-sequencer/blob/main/docs/MODULES.md#fisheyegl-module"}},{}],282:[function(t,e,r){e.exports=function(e,r){e.Axis=e.Axis||t("./info.json").inputs.Axis.default;var n=t("get-pixels");return{options:e,draw:function(r,i,o){o.stop(!0),o.overrideFlag=!0;var a=this;return n(r.src,function(n,o){return t("../_nomodule/PixelManipulation.js")(r,{output:function(t,e,r){a.output={src:e,format:r}},ui:e.step.ui,changePixel:function(t,e,r,n){return[t,e,r,n]},extraManipulation:function(r){if(!n)return t("./flipImage")(o,r,e.Axis);console.log(n)},format:r.format,image:e.image,inBrowser:e.inBrowser,callback:i})})},output:void 0,UI:r}}},{"../_nomodule/PixelManipulation.js":352,"./flipImage":283,"./info.json":285,"get-pixels":28}],283:[function(t,e,r){e.exports=function(t,e,r){var n=t.shape[0],i=t.shape[1];function o(r,n,i,o){e.set(r,n,0,t.get(i,o,0)),e.set(r,n,1,t.get(i,o,1)),e.set(r,n,2,t.get(i,o,2)),e.set(r,n,3,t.get(i,o,3))}return function(){if("vertical"==r.toLowerCase())for(var t=0;tRead more",inputs:{adjustment:{type:"float",desc:"gamma correction (inverse of actual gamma factor) for the new image",default:.2,min:2,max:1}},"docs-link":"https://github.com/publiclab/image-sequencer/blob/main/docs/MODULES.md#gamma-correction-module"}},{}],289:[function(t,e,r){(function(r){e.exports=function(e,n){return{options:e,draw:function(e,n,i){var o=t("get-pixels"),a=t("save-pixels"),s=this;o(e.src,function(t,i){if(t)console.log("Bad Image path");else{for(var o=i.shape[0],u=0;u{n.output=i.steps[0].output,r()})},output:void 0,UI:r}}},{"./../../util/getDefaults.js":360,"./Ui.js":300,"./info.json":302}],300:[function(t,e,r){e.exports=function(t,e){return{setup:function(e,r){var n="dropzone-import-image-"+t.ID,i='

Select or drag in an image to overlay.

';$(t.ui).find(".details").prepend(i),sequencer.setInputStep({dropZoneSelector:"#"+n,fileInputSelector:"#"+n+" .file-input",onLoad:function(e){var r=e.target;t.options.imageUrl=r.result,t.options.url=r.result,sequencer.run(),setUrlHashParameter("steps",sequencer.toString())}}),$(t.ui).find(".btn-save").on("click",function(){var e=$(t.ui).find(".det input").val();t.options.imageUrl=e,sequencer.run()})}}}},{}],301:[function(t,e,r){arguments[4][214][0].apply(r,arguments)},{"./Module":299,"./info.json":302,dup:214}],302:[function(t,e,r){e.exports={name:"import-image",description:"Import a new image and replace the original with it. Future versions may enable a blend mode. Specify an image by URL or by file selector.",url:"https://github.com/publiclab/image-sequencer/tree/master/MODULES.md",inputs:{url:{type:"string",desc:"URL of image to import",default:"./images/monarch.png"}},"docs-link":"https://github.com/publiclab/image-sequencer/blob/main/docs/MODULES.md#import-image-module"}},{}],303:[function(t,e,r){e.exports=function(e,r){if(e.step.inBrowser)var n=t("./Ui.js")(e.step,r);var i=t("./../../util/getDefaults.js")(t("./info.json"));return e.filter=e.filter||i.filter,{options:e,draw:function(r,i,o){o.stop(!0),o.overrideFlag=!0;var a=this;return t("../_nomodule/PixelManipulation.js")(r,{output:function(t,e,r){a.output={src:e,format:r}},ui:e.step.ui,changePixel:function(t,r,n,i){if("red"==e.filter)var o=(n-t)/(1*n+t);"blue"==e.filter&&(o=(t-n)/(1*n+t));var a=255*(o+1)/2;return[a,a,a,i]},format:r.format,image:e.image,inBrowser:e.inBrowser,callback:function(){e.step.inBrowser&&n.setup(),i()}})},output:void 0,UI:r}}},{"../_nomodule/PixelManipulation.js":352,"./../../util/getDefaults.js":360,"./Ui.js":304,"./info.json":306}],304:[function(t,e,r){e.exports=function(t,e){return{setup:function(){var e=$(t.imgElement);e.mousemove(function(t){var r=document.createElement("canvas");r.width=e.width(),r.height=e.height(),r.getContext("2d").drawImage(this,0,0);var n=$(this).offset(),i=t.pageX-n.left,o=t.pageY-n.top,a=r.getContext("2d").getImageData(i,o,1,1).data[0];a=(a=a/127.5-1).toFixed(2),e[0].title="NDVI: "+a})}}}},{}],305:[function(t,e,r){arguments[4][214][0].apply(r,arguments)},{"./Module":303,"./info.json":306,dup:214}],306:[function(t,e,r){e.exports={name:"ndvi",description:"Normalized Difference Vegetation Index, or NDVI, is an image analysis technique used with aerial photography. It's a way to visualize the amounts of infrared and other wavelengths of light reflected from vegetation by comparing ratios of blue and red light absorbed versus green and IR light reflected. NDVI is used to evaluate the health of vegetation in satellite imagery, where it correlates with how much photosynthesis is happening. This is helpful in assessing vegetative health or stress. Read more.

This is designed for use with red-filtered single camera DIY Infragram cameras; change to 'blue' for blue filters",inputs:{filter:{type:"select",desc:"Filter color",default:"red",values:["red","blue"]}},"docs-link":"https://github.com/publiclab/image-sequencer/blob/main/docs/MODULES.md#ndvi-module"}},{}],307:[function(t,e,r){e.exports=t("../../util/createMetaModule.js")(function(t){return[{name:"ndvi",options:{}},{name:"colormap",options:{colormap:t.colormap}}]},{infoJson:t("./info.json")})[0]},{"../../util/createMetaModule.js":359,"./info.json":309}],308:[function(t,e,r){arguments[4][214][0].apply(r,arguments)},{"./Module":307,"./info.json":309,dup:214}],309:[function(t,e,r){e.exports={name:"ndvi-colormap",description:"Sequentially Applies NDVI and Colormap steps",inputs:{},"docs-link":"https://github.com/publiclab/image-sequencer/blob/main/docs/MODULES.md#ndvi-colormap-module"}},{}],310:[function(t,e,r){e.exports=function(e,r){var n=t("./../../util/getDefaults.js")(t("./info.json"));return{options:e,draw:function(r,i,o){o.stop(!0),o.overrideFlag=!0;var a=this;return e.method=e.method||n.method,t("../_nomodule/PixelManipulation.js")(r,{output:function(t,e,r){a.output={src:e,format:r}},ui:e.step.ui,extraManipulation:function(r){return r=t("./NoiseReduction.js")(r,e.method)},format:r.format,image:e.image,callback:i})},output:void 0,UI:r}}},{"../_nomodule/PixelManipulation.js":352,"./../../util/getDefaults.js":360,"./NoiseReduction.js":311,"./info.json":313}],311:[function(t,e,r){e.exports=function(t,e){let r=[-1,-1,-1,0,0,0,1,1,1],n=[-1,0,1,-1,0,1,-1,0,1];if("Median Filtering"==e)for(let e=0;e=0&&c=0&&h=0&&c=0&&h=e.x&&o-e.x=e.y&&a-e.y=f*x&&e.get(t,r,0)<=f*b&&e.get(t,r,1)>=d*x&&e.get(t,r,1)<=d*b&&e.get(t,r,2)>=m*x&&e.get(t,r,2)<=m*b&&e.get(t,r,3)>=g*x&&e.get(t,r,3)<=g*b}for(l=l.split(" ");_.length;)if(w(i=v.pop(),n=_.pop())){o=a=n;do{o-=1}while(w(i,o)&&o>=0);do{a+=1}while(w(i,a)&&a=o*c&&t<=o*l&&e>=a*c&&e<=a*l&&r>=s*c&&r<=s*l}for(var p=0;pa&&(a=h,s=u)}return s}(n));for(var c=0;c<=l;c+=4)e.data[c]=e.data[c]=0?atob(t.split(",")[1]):unescape(t.split(",")[1]);for(var r=t.split(",")[0].split(":")[1].split(";")[0],n=new Uint8Array(e.length),i=0;i{a("img",[0,0,u.naturalWidth,0,u.naturalWidth,u.naturalHeight,0,u.naturalHeight],s),u.onload=(()=>{var t=document.createElement("canvas");t.width=u.naturalWidth,t.height=u.naturalHeight,t.getContext("2d").drawImage(u,0,0),o.output={src:t.toDataURL("image/png"),format:"png"},u.remove(),i()})}),u.src=r.src,u.id="img",document.body.appendChild(u)}else t("../_nomodule/gl-context")(r,i,o,e)},output:void 0,UI:r}}},{"../../util/parseDistortCoordinates.js":362,"../_nomodule/gl-context":353,"./../../util/getDefaults.js":360,"./glfx":346,"./info.json":348}],346:[function(t,e,r){e.exports=function(){function t(t,e,r){return Math.max(t,Math.min(e,r))}function e(t){return{_:t,loadContentsOf:function(t){N=this._.gl,this._.loadContentsOf(t)},destroy:function(){N=this._.gl,this._.destroy()}}}function r(t){return e(z.fromElement(t))}function n(t,e){var r=N.UNSIGNED_BYTE;if(N.getExtension("OES_texture_float")&&N.getExtension("OES_texture_float_linear")){var n=new z(100,100,N.RGBA,N.FLOAT);try{n.drawTo(function(){r=N.FLOAT})}catch(t){}n.destroy()}this._.texture&&this._.texture.destroy(),this._.spareTexture&&this._.spareTexture.destroy(),this.width=t,this.height=e,this._.texture=new z(t,e,N.RGBA,r),this._.spareTexture=new z(t,e,N.RGBA,r),this._.extraTexture=this._.extraTexture||new z(0,0,N.RGBA,r),this._.flippedShader=this._.flippedShader||new U(null,"uniform sampler2D texture;varying vec2 texCoord;void main(){gl_FragColor=texture2D(texture,vec2(texCoord.x,1.0-texCoord.y));}"),this._.isInitialized=!0}function i(t,e,r){return this._.isInitialized&&t._.width==this.width&&t._.height==this.height||n.call(this,e||t._.width,r||t._.height),t._.use(),this._.texture.drawTo(function(){U.getDefaultShader().drawRect()}),this}function o(){return this._.texture.use(),this._.flippedShader.drawRect(),this}function a(t,e,r,n){(r||this._.texture).use(),this._.spareTexture.drawTo(function(){t.uniforms(e).drawRect()}),this._.spareTexture.swapWith(n||this._.texture)}function s(t){return t.parentNode.insertBefore(this,t),t.parentNode.removeChild(t),this}function u(){var t=new z(this._.texture.width,this._.texture.height,N.RGBA,N.UNSIGNED_BYTE);return this._.texture.use(),t.drawTo(function(){U.getDefaultShader().drawRect()}),e(t)}function l(){var t=this._.texture.width,e=this._.texture.height,r=new Uint8Array(4*t*e);return this._.texture.drawTo(function(){N.readPixels(0,0,t,e,N.RGBA,N.UNSIGNED_BYTE,r)}),r}function c(t){return function(){return N=this._.gl,t.apply(this,arguments)}}function h(t,e,r,n,i,o,a,s){var u,l,c=n-o,h=s-o,p=(l=r-i)*h-(u=a-i)*c;return[r-t+(u=((i=t-r+i-a)*h-u*(o=e-n+o-s))/p)*r,n-e+u*n,u,a-t+(l=(l*o-i*c)/p)*a,s-e+l*s,l,t,e,1]}function p(t){var e=t[0],r=t[1],n=t[2],i=t[3],o=t[4],a=t[5],s=t[6],u=t[7],l=e*o*(t=t[8])-e*a*u-r*i*t+r*a*s+n*i*u-n*o*s;return[(o*t-a*u)/l,(n*u-r*t)/l,(r*a-n*o)/l,(a*s-i*t)/l,(e*t-n*s)/l,(n*i-e*a)/l,(i*u-o*s)/l,(r*s-e*u)/l,(e*o-r*i)/l]}function f(t){var e=t.length;this.xa=[],this.ya=[],this.u=[],this.y2=[],t.sort(function(t,e){return t[0]-e[0]});for(var r=0;r0.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;}"),a.call(this,N.brightnessContrast,{brightness:t(-1,e,1),contrast:t(-1,r,1)}),this}function g(e){e=new f(e);for(var r=[],n=0;256>n;n++)r.push(t(0,Math.floor(256*e.interpolate(n/255)),255));return r}function v(t,e,r){t=g(t),1==arguments.length?e=r=t:(e=g(e),r=g(r));for(var n=[],i=0;256>i;i++)n.splice(n.length,0,t[i],e[i],r[i],255);return this._.extraTexture.initFromBytes(256,1,n),this._.extraTexture.use(1),N.curves=N.curves||new U(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;}"),N.curves.textures({map:1}),a.call(this,N.curves,{}),this}function _(t){N.denoise=N.denoise||new U(null,"uniform sampler2D texture;uniform float exponent;uniform float strength;uniform vec2 texSize;varying vec2 texCoord;void main(){vec4 center=texture2D(texture,texCoord);vec4 color=vec4(0.0);float total=0.0;for(float x=-4.0;x<=4.0;x+=1.0){for(float y=-4.0;y<=4.0;y+=1.0){vec4 sample=texture2D(texture,texCoord+vec2(x,y)/texSize);float weight=1.0-abs(dot(sample.rgb-center.rgb,vec3(0.25)));weight=pow(weight,exponent);color+=sample*weight;total+=weight;}}gl_FragColor=color/total;}");for(var e=0;2>e;e++)a.call(this,N.denoise,{exponent:Math.max(0,t),texSize:[this.width,this.height]});return this}function y(e,r){return N.hueSaturation=N.hueSaturation||new U(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;}"),a.call(this,N.hueSaturation,{hue:t(-1,e,1),saturation:t(-1,r,1)}),this}function b(e){return N.noise=N.noise||new U(null,"uniform sampler2D texture;uniform float amount;varying vec2 texCoord;float rand(vec2 co){return fract(sin(dot(co.xy,vec2(12.9898,78.233)))*43758.5453);}void main(){vec4 color=texture2D(texture,texCoord);float diff=(rand(texCoord)-0.5)*amount;color.r+=diff;color.g+=diff;color.b+=diff;gl_FragColor=color;}"),a.call(this,N.noise,{amount:t(0,e,1)}),this}function x(e){return N.sepia=N.sepia||new U(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;}"),a.call(this,N.sepia,{amount:t(0,e,1)}),this}function w(t,e){return N.unsharpMask=N.unsharpMask||new U(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(){U.getDefaultShader().drawRect()}),this._.extraTexture.use(1),this.triangleBlur(t),N.unsharpMask.textures({originalTexture:1}),a.call(this,N.unsharpMask,{strength:e}),this._.extraTexture.unuse(1),this}function E(e){return N.vibrance=N.vibrance||new U(null,"uniform sampler2D texture;uniform float amount;varying vec2 texCoord;void main(){vec4 color=texture2D(texture,texCoord);float average=(color.r+color.g+color.b)/3.0;float mx=max(color.r,max(color.g,color.b));float amt=(mx-average)*(-amount*3.0);color.rgb=mix(color.rgb,vec3(mx),amt);gl_FragColor=color;}"),a.call(this,N.vibrance,{amount:t(-1,e,1)}),this}function k(e,r){return N.vignette=N.vignette||new U(null,"uniform sampler2D texture;uniform float size;uniform float amount;varying vec2 texCoord;void main(){vec4 color=texture2D(texture,texCoord);float dist=distance(texCoord,vec2(0.5,0.5));color.rgb*=smoothstep(0.8,size*0.799,dist*(amount+size));gl_FragColor=color;}"),a.call(this,N.vignette,{size:t(0,e,1),amount:t(0,r,1)}),this}function T(e,r,n){N.lensBlurPrePass=N.lensBlurPrePass||new U(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;"+G+"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;}";N.lensBlur0=N.lensBlur0||new U(null,i+"void main(){gl_FragColor=sample(delta0);}"),N.lensBlur1=N.lensBlur1||new U(null,i+"void main(){gl_FragColor=(sample(delta0)+sample(delta1))*0.5;}"),N.lensBlur2=N.lensBlur2||new U(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 o=0;3>o;o++){var s=n+2*o*Math.PI/3;i.push([e*Math.sin(s)/this.width,e*Math.cos(s)/this.height])}return e=Math.pow(10,t(-1,r,1)),a.call(this,N.lensBlurPrePass,{power:e}),this._.extraTexture.ensureFormat(this._.texture),a.call(this,N.lensBlur0,{delta0:i[0]},this._.texture,this._.extraTexture),a.call(this,N.lensBlur1,{delta0:i[1],delta1:i[2]},this._.extraTexture,this._.extraTexture),a.call(this,N.lensBlur0,{delta0:i[1]}),this._.extraTexture.use(1),a.call(this,N.lensBlur2,{power:1/e,delta0:i[2]}),this}function S(t,e,r,n,i,o){N.tiltShift=N.tiltShift||new U(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;"+G+"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 s=r-t,u=n-e,l=Math.sqrt(s*s+u*u);return a.call(this,N.tiltShift,{blurRadius:i,gradientRadius:o,start:[t,e],end:[r,n],delta:[s/l,u/l],texSize:[this.width,this.height]}),a.call(this,N.tiltShift,{blurRadius:i,gradientRadius:o,start:[t,e],end:[r,n],delta:[-u/l,s/l],texSize:[this.width,this.height]}),this}function A(t){return N.triangleBlur=N.triangleBlur||new U(null,"uniform sampler2D texture;uniform vec2 delta;varying vec2 texCoord;"+G+"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;}"),a.call(this,N.triangleBlur,{delta:[t/this.width,0]}),a.call(this,N.triangleBlur,{delta:[0,t/this.height]}),this}function C(t,e,r){return N.zoomBlur=N.zoomBlur||new U(null,"uniform sampler2D texture;uniform vec2 center;uniform float strength;uniform vec2 texSize;varying vec2 texCoord;"+G+"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;}"),a.call(this,N.zoomBlur,{center:[t,e],strength:r,texSize:[this.width,this.height]}),this}function R(t,e,r,n){return N.colorHalftone=N.colorHalftone||new U(null,"uniform sampler2D texture;uniform vec2 center;uniform float angle;uniform float scale;uniform vec2 texSize;varying vec2 texCoord;float pattern(float angle){float s=sin(angle),c=cos(angle);vec2 tex=texCoord*texSize-center;vec2 point=vec2(c*tex.x-s*tex.y,s*tex.x+c*tex.y)*scale;return(sin(point.x)*sin(point.y))*4.0;}void main(){vec4 color=texture2D(texture,texCoord);vec3 cmy=1.0-color.rgb;float k=min(cmy.x,min(cmy.y,cmy.z));cmy=(cmy-k)/(1.0-k);cmy=clamp(cmy*10.0-3.0+vec3(pattern(angle+0.26179),pattern(angle+1.30899),pattern(angle)),0.0,1.0);k=clamp(k*10.0-5.0+pattern(angle+0.78539),0.0,1.0);gl_FragColor=vec4(1.0-cmy-k,color.a);}"),a.call(this,N.colorHalftone,{center:[t,e],angle:r,scale:Math.PI/n,texSize:[this.width,this.height]}),this}function B(t,e,r,n){return N.dotScreen=N.dotScreen||new U(null,"uniform sampler2D texture;uniform vec2 center;uniform float angle;uniform float scale;uniform vec2 texSize;varying vec2 texCoord;float pattern(){float s=sin(angle),c=cos(angle);vec2 tex=texCoord*texSize-center;vec2 point=vec2(c*tex.x-s*tex.y,s*tex.x+c*tex.y)*scale;return(sin(point.x)*sin(point.y))*4.0;}void main(){vec4 color=texture2D(texture,texCoord);float average=(color.r+color.g+color.b)/3.0;gl_FragColor=vec4(vec3(average*10.0-5.0+pattern()),color.a);}"),a.call(this,N.dotScreen,{center:[t,e],angle:r,scale:Math.PI/n,texSize:[this.width,this.height]}),this}function P(t){return N.edgeWork1=N.edgeWork1||new U(null,"uniform sampler2D texture;uniform vec2 delta;varying vec2 texCoord;"+G+"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);}"),N.edgeWork2=N.edgeWork2||new U(null,"uniform sampler2D texture;uniform vec2 delta;varying vec2 texCoord;"+G+"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);}"),a.call(this,N.edgeWork1,{delta:[t/this.width,0]}),a.call(this,N.edgeWork2,{delta:[0,t/this.height]}),this}function I(t,e,r){return N.hexagonalPixelate=N.hexagonalPixelate||new U(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;"),a.call(this,N.bulgePinch,{radius:n,strength:t(-1,i,1),center:[e,r],texSize:[this.width,this.height]}),this}function F(t,e,r){if(N.matrixWarp=N.matrixWarp||d("uniform mat3 matrix;uniform bool useTextureSpace;","if(useTextureSpace)coord=coord/texSize*2.0-1.0;vec3 warp=matrix*vec3(coord,1.0);coord=warp.xy/warp.z;if(useTextureSpace)coord=(coord*0.5+0.5)*texSize;"),4==(t=Array.prototype.concat.apply([],t)).length)t=[t[0],t[1],0,t[2],t[3],0,0,0,1];else if(9!=t.length)throw"can only warp with 2x2 or 3x3 matrix";return a.call(this,N.matrixWarp,{matrix:e?p(t):t,texSize:[this.width,this.height],useTextureSpace:0|r}),this}function L(t,e){var r=h.apply(null,e),n=h.apply(null,t);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]])}function O(t,e,r,n){return N.swirl=N.swirl||d("uniform float radius;uniform float angle;uniform vec2 center;","coord-=center;float distance=length(coord);if(distance>1;this.xa[n]>t?r=n:e=n}n=this.xa[r]-this.xa[e];var i=(this.xa[r]-t)/n;return t=(t-this.xa[e])/n,i*this.ya[e]+t*this.ya[r]+((i*i*i-i)*this.y2[e]+(t*t*t-t)*this.y2[r])*n*n/6};var z=function(){function t(t,e,r,n){this.gl=N,this.id=N.createTexture(),this.width=t,this.height=e,this.format=r,this.type=n,N.bindTexture(N.TEXTURE_2D,this.id),N.texParameteri(N.TEXTURE_2D,N.TEXTURE_MAG_FILTER,N.LINEAR),N.texParameteri(N.TEXTURE_2D,N.TEXTURE_MIN_FILTER,N.LINEAR),N.texParameteri(N.TEXTURE_2D,N.TEXTURE_WRAP_S,N.CLAMP_TO_EDGE),N.texParameteri(N.TEXTURE_2D,N.TEXTURE_WRAP_T,N.CLAMP_TO_EDGE),t&&e&&N.texImage2D(N.TEXTURE_2D,0,this.format,t,e,0,this.format,this.type,null)}function e(t){return null==r&&(r=document.createElement("canvas")),r.width=t.width,r.height=t.height,(t=r.getContext("2d")).clearRect(0,0,r.width,r.height),t}t.fromElement=function(e){var r=new t(0,0,N.RGBA,N.UNSIGNED_BYTE);return r.loadContentsOf(e),r},t.prototype.loadContentsOf=function(t){this.width=t.width||t.videoWidth,this.height=t.height||t.videoHeight,N.bindTexture(N.TEXTURE_2D,this.id),N.texImage2D(N.TEXTURE_2D,0,this.format,this.format,this.type,t)},t.prototype.initFromBytes=function(t,e,r){this.width=t,this.height=e,this.format=N.RGBA,this.type=N.UNSIGNED_BYTE,N.bindTexture(N.TEXTURE_2D,this.id),N.texImage2D(N.TEXTURE_2D,0,N.RGBA,t,e,0,N.RGBA,this.type,new Uint8Array(r))},t.prototype.destroy=function(){N.deleteTexture(this.id),this.id=null},t.prototype.use=function(t){N.activeTexture(N.TEXTURE0+(t||0)),N.bindTexture(N.TEXTURE_2D,this.id)},t.prototype.unuse=function(t){N.activeTexture(N.TEXTURE0+(t||0)),N.bindTexture(N.TEXTURE_2D,null)},t.prototype.ensureFormat=function(t,e,r,n){if(1==arguments.length){var i=arguments[0];t=i.width,e=i.height,r=i.format,n=i.type}t==this.width&&e==this.height&&r==this.format&&n==this.type||(this.width=t,this.height=e,this.format=r,this.type=n,N.bindTexture(N.TEXTURE_2D,this.id),N.texImage2D(N.TEXTURE_2D,0,this.format,t,e,0,this.format,this.type,null))},t.prototype.drawTo=function(t){if(N.framebuffer=N.framebuffer||N.createFramebuffer(),N.bindFramebuffer(N.FRAMEBUFFER,N.framebuffer),N.framebufferTexture2D(N.FRAMEBUFFER,N.COLOR_ATTACHMENT0,N.TEXTURE_2D,this.id,0),N.checkFramebufferStatus(N.FRAMEBUFFER)!==N.FRAMEBUFFER_COMPLETE)throw Error("incomplete framebuffer");N.viewport(0,0,this.width,this.height),t(),N.bindFramebuffer(N.FRAMEBUFFER,null)};var r=null;return t.prototype.fillUsingCanvas=function(t){return t(e(this)),this.format=N.RGBA,this.type=N.UNSIGNED_BYTE,N.bindTexture(N.TEXTURE_2D,this.id),N.texImage2D(N.TEXTURE_2D,0,N.RGBA,N.RGBA,N.UNSIGNED_BYTE,r),this},t.prototype.toImage=function(t){this.use(),U.getDefaultShader().drawRect();var n=4*this.width*this.height,i=new Uint8Array(n),o=e(this),a=o.createImageData(this.width,this.height);N.readPixels(0,0,this.width,this.height,N.RGBA,N.UNSIGNED_BYTE,i);for(var s=0;s{e.goto("https://google.com").then(()=>{e.addScriptTag({path:require("path").join(__dirname,"../../../dist/image-sequencer.js")}).then(()=>{e.evaluate(t=>new Promise((e,r)=>{var n=ImageSequencer();n.loadImage(t.input.src),n.addSteps(t.modOptions.step,t.modOptions),n.run(function(t){e(n.steps[1].output.src)})}),obj).then(e=>{t.close().then(()=>{step.output={src:e,format:input.format},callback()})})})})})})}}).call(this,"/src/modules/_nomodule")},{lodash:101,path:117}],354:[function(t,e,r){const n=t("gpu.js").GPU;e.exports={convolve:(t,e,r={})=>{const i=r.pipeMode||!1,o=r.mode||"gpu",a=new n("gpu"!=o?{mode:o}:{}),s=t[0][0].length,u=t[0].length,l=e[0].length,c=e.length,h=Math.floor(l/2),p=Math.floor(c/2),f=`function (array, kernel) {\n let sum = 0;\n for (let i = 0; i < ${l}; i++){\n for (let j = 0; j < ${c}; j++){\n sum += kernel[j][i] * array[this.thread.y + j][this.thread.x + i];\n }\n }\n return sum;\n }`,d=t=>{let e=[];for(var r=0;r{e=e.toString();const i=gpu.createKernel(e,{output:t,constants:r,pipeline:n});return i.build(),n?i().toArray():i()}}},{"gpu.js":60}],355:[function(t,e,r){e.exports=function(e,r,n,i){return function(r,n){!function(r,n,i){var o;if(r.match(/^data:/i))i(o=r,n);else if(!e.options.inBrowser&&r.match(/^https?:\/\//i))t(r.match(/^(https?):\/\//i)[1]).get(r,function(t){var e="",r=t.headers["content-type"];t.setEncoding("base64"),t.on("data",function(t){e+=t}),t.on("end",function(){i("data:"+r+";base64,"+e,n)})});else if(e.options.inBrowser){var a=r.split(".").pop(),s=document.createElement("img"),u=document.createElement("canvas"),l=u.getContext("2d");s.onload=function(){u.width=s.naturalWidth,u.height=s.naturalHeight,l.drawImage(s,0,0),o=u.toDataURL(a),i(o,n)},s.src=r}else o=t("urify")(r),i(o,n)}(n,{name:"load-image",description:"This initial step loads and displays the original image without any modifications.",ID:e.options.sequencerCounter++,inBrowser:e.options.inBrowser,ui:e.options.ui,UI:e.events,output:""},function(t,r){var n=function(t){return{src:t,format:t.split(":")[1].split(";")[0].split("/")[1]}}(t);return e.steps.push(r),e.steps[0].output=n,e.steps[0].UI.onSetup(e.steps[0]),e.steps[0].UI.onDraw(e.steps[0]),e.steps[0].UI.onComplete(e.steps[0]),i(),!0})}(0,n)}},{urify:197}],356:[function(t,e,r){e.exports=function(){return function(t){var e=$(t.dropZoneSelector),r=$(t.fileInputSelector),n=$(t.takePhotoSelector),i=t.onLoad;function o(t){if(t.preventDefault(),t.stopPropagation(),t.target&&t.target.files)var e=t.target.files[0];else e=t.dataTransfer.files[0];if(e){var r=new FileReader;r.onload=i,r.readAsDataURL(e)}}t.onTakePhoto,new FileReader,r.on("change",o),n.on("click",function(){document.getElementById("video").style.display="inline",document.getElementById("capture").style.display="inline",document.getElementById("close").style.display="inline";var e=document.getElementById("video");canvas=document.getElementById("canvas"),context=canvas.getContext("2d"),vendorUrl=window.URL||window.webkitURL,navigator.mediaDevices.getUserMedia({audio:!1,video:!0}).then(function(t){window.stream=t,e.srcObject=t,e.onloadedmetadata=function(t){e.play()},document.getElementById("close").addEventListener("click",function(){!function(t){t.getVideoTracks().forEach(function(t){t.stop()}),document.getElementById("video").style.display="none",document.getElementById("capture").style.display="none",document.getElementById("close").style.display="none"}(t)})}).catch(function(t){console.log("navigator.getUserMedia error: ",t)}),document.getElementById("capture").addEventListener("click",function(r){context.drawImage(e,0,0,400,300),t.onTakePhoto(canvas.toDataURL())})}),e[0].addEventListener("drop",o,!1),e.on("dragover",function(t){t.stopPropagation(),t.preventDefault(),t.dataTransfer.dropEffect="copy"},!1),e.on("dragenter",function(t){e.addClass("hover")}),e.on("dragleave",function(t){e.removeClass("hover")})}}},{}],357:[function(t,e,r){e.exports=function(t={}){return t.onSetup=t.onSetup||function(t){0==t.ui||(t.inBrowser?console.log('Added Step "'+t.name+'"'):console.log("%s",'Added Step "'+t.name+'"'))},t.onDraw=t.onDraw||function(t){0==t.ui||(t.inBrowser?console.log('Drawing Step "'+t.name+'"'):console.log("%s",'Drawing Step "'+t.name+'"'))},t.onComplete=t.onComplete||function(t){0==t.ui||(t.inBrowser?console.log('Drawn Step "'+t.name+'"'):console.log("%s",'Drawn Step "'+t.name+'"'))},t.onRemove=t.onRemove||function(t){0==t.ui||(t.inBrowser?console.log('Removing Step "'+t.name+'"'):console.log("%s",'Removing Step "'+t.name+'"'))},t.notify=t.notify||function(t){console.log(t)},t}},{}],358:[function(t,e,r){e.exports=function(e,r,n){t("get-pixels")(r.src,function(t,i){var o=i.shape[0],a=i.shape[1];if(r.x.valInp){Object.keys(r).forEach(function(t){var e=r[t];e.valInp&&"%"===e.valInp.slice(-1)&&(e.valInp=parseInt(e.valInp,10),"horizontal"===e.type?e.valInp=e.valInp*o/100:e.valInp=e.valInp*a/100)});n(e,r)}})}},{"get-pixels":28}],359:[function(t,e,r){e.exports=function(e,r){return(r=r||{}).infoJson=r.infoJson||{},[function(n,i){var o=t("./getDefaults.js")(r.infoJson);for(key in r.infoJson.inputs)r.infoJson.inputs.hasOwnProperty(key)&&(n[key]=n[key]||o[key]);var a=e(n),s=ImageSequencer({inBrowser:!1,ui:!1});return{options:n,draw:function(t,e){var r=this;s.loadImage(t.src,function(){s.importJSON(a),s.run(function(n){r.output={src:n,format:t.format},e()})})},output:void 0,UI:i}},r.infoJson]}},{"./getDefaults.js":360}],360:[function(t,e,r){e.exports=function(t){var e={};for(var r in t.inputs)t.inputs.hasOwnProperty(r)&&(e[r]=t.inputs[r].default);return e}},{}],361:[function(t,e,r){e.exports={getPreviousStep:function(){return this.getStep(-1)},getNextStep:function(){return this.getStep(1)},getInput:function(t){return t+this.getIndex()===0&&t++,this.getStep(t-1).output},getOutput:function(t){return this.getStep(t).output},getOptions:function(){return this.getStep(0).options},setOptions:function(t){let e=this.getStep(0).options;for(let r in t)e[r]&&(e[r]=t[r])},getFormat:function(){return this.getStep(-1).output.format},getHeight:function(t){let e=new Image;e.onload=function(){t(e.height)},e.src=this.getInput(0).src},getWidth:function(t){let e=new Image;e.onload=function(){t(e.width)},e.src=this.getInput(0).src}}},{}],362:[function(t,e,r){e.exports=function(t){let e=[];return e.push(t.nw.split(",")),e.push(t.ne.split(",")),e.push(t.se.split(",")),e.push(t.sw.split(",")),e.reduce((t,e)=>(t.push(parseInt(e[0])),t.push(parseInt(e[1])),t),[])}},{}]},{},[204]); \ No newline at end of file