From 1f45e32de579d31a99a8d467992cbed14687b022 Mon Sep 17 00:00:00 2001 From: Peiling Jiang <25191575+peilingjiang@users.noreply.github.com> Date: Mon, 27 May 2024 14:55:21 -0700 Subject: [PATCH] 0.7.8 --- lib/RemoteCalibrator.min.js | 2 +- lib/RemoteCalibrator.min.js.LICENSE.txt | 2 +- package-lock.json | 4 ++-- package.json | 10 +++++++--- 4 files changed, 11 insertions(+), 7 deletions(-) diff --git a/lib/RemoteCalibrator.min.js b/lib/RemoteCalibrator.min.js index 1c6754d..1a77315 100644 --- a/lib/RemoteCalibrator.min.js +++ b/lib/RemoteCalibrator.min.js @@ -1,3 +1,3 @@ /*! For license information please see RemoteCalibrator.min.js.LICENSE.txt */ -!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.RemoteCalibrator=t():e.RemoteCalibrator=t()}(self,(()=>(()=>{var __webpack_modules__={6003:()=>{window.requestAnimFrame=window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||function(e,t){return window.setTimeout(e,1e3/60)},window.cancelRequestAnimFrame=window.cancelCancelRequestAnimationFrame||window.webkitCancelRequestAnimationFrame||window.mozCancelRequestAnimationFrame||window.oCancelRequestAnimationFrame||window.msCancelRequestAnimationFrame||window.clearTimeout},359:(e,t,n)=>{"use strict";n.d(t,{F:()=>r,a:()=>a});var s=n(9677);const r=(e,t,{go:n,cancel:r,custom:a},i,o=!0)=>{const l=document.createElement("div");let u,c,h;if(l.className="rc-buttons"+(o?" rc-absolute-buttons":""),l.id="rc-buttons",n&&(u=document.createElement("button"),u.className="rc-button rc-go-button",u.onclick=n,u.innerHTML=s.H.RC_ok[e],l.appendChild(u)),r&&i&&(c=document.createElement("button"),c.className="rc-button rc-cancel-button",c.onclick=r,c.innerHTML=s.H.RC_cancel[e],l.appendChild(c)),a){const{callback:e,content:t}=a;h=document.createElement("button"),h.className="rc-button rc-custom-button",h.onclick=e,h.innerHTML=t,l.appendChild(h)}return t.appendChild(l),[l,u,c,h]},a=e=>{e.querySelector("#rc-buttons").remove()}},2016:(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{"use strict";__webpack_require__.d(__webpack_exports__,{K:()=>takeInput});var _buttons__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__(359),_keyBinder__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__(9853),_utils__WEBPACK_IMPORTED_MODULE_2__=__webpack_require__(9043);const takeInput=async(RC,extraFunction=null,extraFunctionOut=null,customButtonConfig=null)=>{const unit=RC.equipment.value.unit,unitDisplay=unit===RC._CONST.UNITS.CM?"cm":"in",unitIsFraction=unit===RC._CONST.UNITS.IN_F,formItem=`
\n
\n ${unitIsFraction?`${unitDisplay}`:`${unitDisplay}`}\n
\n
`,instruction=RC.background.querySelector(".calibration-instruction");instruction.innerHTML+=formItem;const formElement=instruction.querySelector(".rc-form"),formInputElement=instruction.querySelector(".rc-form-input"),formInputElementFInteger=instruction.querySelector(".rc-form-input-f-integer"),formInputElementFFraction=instruction.querySelector(".rc-form-input-f-fraction");unitIsFraction?formInputElementFInteger.focus():formInputElement.focus();const addedButtons=(0,_buttons__WEBPACK_IMPORTED_MODULE_0__.F)(RC.L,formElement,{go:()=>{},custom:customButtonConfig||void 0},!0,!1),goButton=addedButtons[1],customButton=addedButtons[3];goButton.disabled=!0;const eleOkay=e=>{e.classList.remove("rc-input-error"),goButton.disabled=!1},eleError=e=>{isAcceptedSingleInput(e.value.slice(-1))?(e.classList.add("rc-input-error"),goButton.disabled=!0):e.value=e.value.substring(0,e.value.length-1)},setupEleOninput=(e,t)=>{e.oninput=()=>{t(e.value)?eleOkay(e):eleError(e)}},_validationForFraction=()=>{let e=!0;return validInputInteger(formInputElementFInteger.value)?eleOkay(formInputElementFInteger):(eleError(formInputElementFInteger),e=!1),validInputFraction(formInputElementFFraction.value)?eleOkay(formInputElementFFraction):(eleError(formInputElementFFraction),e=!1),e};return unitIsFraction?(formInputElementFInteger.oninput=_validationForFraction,formInputElementFFraction.oninput=_validationForFraction):setupEleOninput(formInputElement,validInput),(0,_utils__WEBPACK_IMPORTED_MODULE_2__.nB)(extraFunction),new Promise((resolve=>{const bFunction=()=>{removeInputElements(formElement,extraFunctionOut),(0,_keyBinder__WEBPACK_IMPORTED_MODULE_1__.l)(bindKeysFunction),resolve(null)},fFunction=()=>{let valid=!1,numericalValue,inputValue;unitIsFraction&&validInputInteger(formInputElementFInteger.value)&&validInputFraction(formInputElementFFraction.value)?(valid=!0,numericalValue=parseInt(formInputElementFInteger.value)+eval(formInputElementFFraction.value),inputValue=formInputElementFInteger.value+" "+formInputElementFFraction.value):!unitIsFraction&&validInput(formInputElement.value)&&(valid=!0,numericalValue=Number(formInputElement.value)||Number(formInputElement.value.replace(",",".")),inputValue=formInputElement.value),valid&&(removeInputElements(formElement,extraFunctionOut),(0,_keyBinder__WEBPACK_IMPORTED_MODULE_1__.l)(bindKeysFunction),resolve({value:{numerical:numericalValue,input:inputValue,unit},timestamp:performance.now()}))};goButton.onclick=fFunction,customButton.onclick=bFunction;const bindKeysFunction=(0,_keyBinder__WEBPACK_IMPORTED_MODULE_1__.m)({Enter:fFunction,Escape:bFunction})}))},removeInputElements=(e,t)=>{(0,_buttons__WEBPACK_IMPORTED_MODULE_0__.a)(e);for(let t of e.children)t.remove();e.remove(),(0,_utils__WEBPACK_IMPORTED_MODULE_2__.nB)(t)},validInput=e=>e.length>0&&!e.includes(" ")&&(!isNaN(e)||!isNaN(e.replace(",","."))),validInputInteger=e=>!!validInput(e)&&(parseInt(e)===Number(e)&&Number(e)>0),validInputFraction=text=>{if("0"===text)return!0;if(!text.includes("/")||text.match(/\//g).length>1)return!1;const numbers=text.split("/");return validInputInteger(numbers[0])&&validInputInteger(numbers[1])&&(0,_utils__WEBPACK_IMPORTED_MODULE_2__.DW)(numbers[1])&&eval(text)<1},isAcceptedSingleInput=e=>/[0-9]/.test(e)||[".","/",","].includes(e)},9853:(e,t,n)=>{"use strict";n.d(t,{l:()=>a,m:()=>r});var s=n(9043);function r(e,t="keydown"){const n=t=>{t.key in e&&(t.preventDefault(),(0,s.nB)(e[t.key],t))};return document.body.addEventListener(t,n),n}function a(e,t="keydown"){document.body.removeEventListener(t,e)}},2646:(e,t,n)=>{"use strict";n.d(t,{G:()=>i,t:()=>r});var s=n(9677);function r(e){const t=Object.keys(s.H.EE_languageNameNative);if(t.includes(e))return a(e);const n=[];t.forEach((e=>{n.push(e.split("-")[0])}));const r=e.split("-")[0].toLowerCase();return n.includes(r)?a(t[n.indexOf(r)]):a("en-US")}function a(e){return{value:{language:e,languageNameEnglish:s.H.EE_languageNameEnglish[e],languageNameNative:s.H.EE_languageNameNative[e],languageDirection:s.H.EE_languageDirection[e],languagePhraseSource:s.H.EE_phraseSource[e]},timestamp:performance.now()}}function i(e){return"1"===s.H.EE_languageUseSpace[e]?" ":""}},477:(e,t,n)=>{"use strict";n.d(t,{l:()=>u});const s="mocha"===n(7999)._;let r,a;if(!s){const e=n(9171);r=e.Synth,a=e.Volume}class i{triggerAttackRelease(){}}const o=s?new i:new r({oscillator:{type:"sine"},envelope:{attack:.001,decay:.001,sustain:1,release:.001}}).connect(new a(-17).toDestination()),l=s?new i:new r({oscillator:{type:"sine"}}).connect(new a(-5).toDestination()),u=(e=0)=>{switch(e){case 0:default:return void o.triggerAttackRelease(2e3,.05);case 1:return void o.triggerAttackRelease(500,.5);case 2:return void o.triggerAttackRelease(200,.6);case 3:return void l.triggerAttackRelease(200,.2)}}},9043:(e,t,n)=>{"use strict";function s(e,...t){if(e&&"function"==typeof e)return t.length?e(...t):e()}n.d(t,{$O:()=>l,$k:()=>w,AU:()=>u,Av:()=>y,DW:()=>d,Ew:()=>c,G8:()=>g,JZ:()=>m,KY:()=>v,Md:()=>r,Nh:()=>f,Sf:()=>i,aS:()=>o,k4:()=>p,ll:()=>h,ln:()=>b,nB:()=>s,yy:()=>a}),function(){for(var e=0,t=["ms","moz","webkit","o"],n=0;n{};function a(e){return new Promise((t=>setTimeout(t,e)))}function i(){if(document.fullscreenEnabled||document.webkitFullscreenEnabled||document.mozFullScreenEnabled||document.msFullscreenEnabled){const e=document.documentElement;return e.requestFullscreen?(e.requestFullscreen(),!0):e.mozRequestFullScreen?(e.mozRequestFullScreen(),!0):e.webkitRequestFullscreen?(e.webkitRequestFullscreen(),!0):!!e.msRequestFullscreen&&(e.msRequestFullscreen(),!0)}return!1}function o(){return Math.abs(window.innerHeight-screen.height)<5&&Math.abs(window.innerWidth-screen.width)<5&&window.screenX<5&&window.screenY<5}function l(e,t=null,n=!1,s=""){return`

${e}

`+(t?`

${t}

`:"")}function u(e,t,n){return en?n:e}function c(e,t,n,s,r){return s+1*(e-t)/(n-t)*(r-s)}function h(e,t,n,s){return Math.sqrt(Math.pow(e-n,2)+Math.pow(t-s,2))}function d(e){return e&&!(e&e-1)}function p(e){for(let t=e.length-1;t>0;t--){const n=Math.floor(Math.random()*(t+1));[e[t],e[n]]=[e[n],e[t]]}return e}function f(e,t){let n=Math.pow(10,t);return Math.round(e*n)/n}const m=e=>{const t=Math.floor(e.length/2),n=[...e].sort(((e,t)=>e-t));return e.length%2!=0?n[t]:(n[t-1]+n[t])/2},g=e=>e.reduce(((e,t)=>e+t))/e.length;function y(e,t,n=1){let s=0,r=0;for(;0===s;)s=Math.random();for(;0===r;)r=Math.random();let a=Math.sqrt(-2*Math.log(s))*Math.cos(2*Math.PI*r);return a=a/10+.5,a>1||a<0?a=y(e,t,n):(a=Math.pow(a,n),a*=t-e,a+=e),a}const b=e=>JSON.parse(JSON.stringify(e));function w(){"activeElement"in document&&document.activeElement.blur()}const v=e=>{if("touchstart"===e.type||"touchmove"===e.type){const t=e.touches[0];return{x:t.clientX,y:t.clientY}}return{x:e.clientX,y:e.clientY}}},7999:(e,t,n)=>{"use strict";n.d(t,{A:()=>w,_:()=>y});var s=n(7503),r=n.n(s),a=n(115),i=n.n(a);const o=["tall","short","up","down","fancy","busy","loud","crazy","kind","nice","real","speedy","handy","active","alert","bold","brave","bright","calm","clever","cool","free","grand","great","happy","jolly","lucky","spicy","sunny","super","wise"],l=["bat","bear","bird","cat","cow","deer","dog","dove","dragon","duck","eagle","fish","fox","frog","goose","lion","mouse","owl","pig","rat","seal","shark","sheep","snake","spider","tiger","turkey","viper","whale","wolf","onion","carrot","pear","bean","corn","bread","apple","banana","fig","grape","lemon","lime","orange","peach","plum","dumpling","cake","pasta","pot","sushi"],u=["blue","bronze","fire","forest","gold","gray","green","navy","purple","red","silver","sky","yellow","neon","black","white","brown","aqua"];function c(e){return e[Math.floor(Math.random()*e.length)]}function h(e){return e.charAt(0).toUpperCase()+e.slice(1)}function d(){const e="000"+(new Date).getMilliseconds().toString();return h(c(o))+h(c(u))+h(c(l))+e.substring(e.length-3)}var p=n(782),f=n(9043),m=n(2646),g=n(9677);const y="production";class b{constructor(){window.console.log(`%c\nEasyEyes Remote Calibrator ${this.version.value}\n`,`color: ${this._CONST.COLOR.ORANGE}`),this._initialized=!1,this._id=null,this._lang=null,this._langData=[],this._panelStatus={hasPanel:!1,panelFinished:!1,panelResolveIntervals:[]},this._panel={panel:null,panelObserver:null,panelTasks:[],panelParent:null,panelOptions:{},panelCallback:null,panelResolve:null},this._participantCheckEquipment={has:null,equipment:null,unit:null},this._trackingSetupFinishedStatus={gaze:!0,distance:!0},this._trackingPaused={gaze:!1,distance:!1},this._trackingVideoFrameTimestamps={gaze:0,distance:0},this._distanceTrackNudging={distanceCorrecting:null,distanceCorrectEnabled:!1,distanceDesired:null,distanceAllowedRatio:null},this._gazeTrackNudging={isCorrectingGaze:!1},this._environmentData=[],this._displayData=[],this._screenData=[],this._viewingDistanceData=[],this._nearPointData=[],this._PDData=[],this._gazePositionData=[],this._gazeAccuracyData=[],this._performanceData=[],this._fullscreenData=[],this._equipmentData=[],this._checkData=[],this._background={element:null,instructionElement:null},this._nudger={element:null,gazeElement:null},this._params={backgroundColor:"#eee",videoOpacity:.8,showCancelButton:!0}}get background(){return this._background.element}get instructionElement(){return this._background.instructionElement}get nudger(){return this._nudger.element}get params(){return this._params}get id(){return this._id?{value:this._id.value,timestamp:this._id.timestamp,date:this._id.date}:null}_helper_get(e,t){if(!e.length)return null;let n=e[e.length-1];return t?{value:n.value[t],timestamp:n.timestamp}:n}get version(){return{value:"0.7.7"}}get supportedLanguages(){const e=[];for(let t in g.H.EE_languageNameEnglish)e.push({language:t,languageNameEnglish:g.H.EE_languageNameEnglish[t],languageNameNative:g.H.EE_languageNameNative[t]});return e}get L(){return this._lang}get LD(){return this.languageDirection.value}get language(){return this._helper_get(this._langData,"language")}get languageNameEnglish(){return this._helper_get(this._langData,"languageNameEnglish")}get languageNameNative(){return this._helper_get(this._langData,"languageNameNative")}get languageDirection(){return this._helper_get(this._langData,"languageDirection")}get languagePhraseSource(){return this._helper_get(this._langData,"languagePhraseSource")}get computeArrayFillMHz(){return this._helper_get(this._performanceData,"computeArrayFillMHz")}get computeRandomMHz(){return this._helper_get(this._performanceData,"computeRandomMHz")}get idealFps(){return this._helper_get(this._performanceData,"idealFps")}get stressFps(){return this._helper_get(this._performanceData,"stressFps")}get isFullscreen(){return this.fullscreenData.length&&i()((0,f.aS)(),this._helper_get(this._fullscreenData).value)||(this.newFullscreenData={value:(0,f.aS)(),timestamp:performance.now()}),this._helper_get(this._fullscreenData)}get concurrency(){return this._helper_get(this._environmentData,"concurrency")}get browser(){return this._helper_get(this._environmentData,"browser")}get browserVersion(){return this._helper_get(this._environmentData,"browserVersion")}get deviceType(){return this._helper_get(this._environmentData,"deviceType")}get isMobile(){const e=this._helper_get(this._environmentData,"deviceType");return{value:"desktop"!==e.value,timestamp:e.timestamp}}get model(){return this._helper_get(this._environmentData,"model")}get manufacturer(){return this._helper_get(this._environmentData,"manufacturer")}get engine(){return this._helper_get(this._environmentData,"engine")}get system(){return this._helper_get(this._environmentData,"system")}get systemFamily(){return this._helper_get(this._environmentData,"systemFamily")}get description(){return this._helper_get(this._environmentData,"description")}get fullDescription(){return this._helper_get(this._environmentData,"fullDescription")}get userLanguage(){return this._helper_get(this._environmentData,"userLanguage")}get equipment(){return this._helper_get(this._equipmentData)}get displayWidthPx(){return this._displaySize(),this._helper_get(this._displayData,"displayWidthPx")}get displayHeightPx(){return this._displaySize(),this._helper_get(this._displayData,"displayHeightPx")}get windowWidthPx(){return this._displaySize(),this._helper_get(this._displayData,"windowWidthPx")}get windowHeightPx(){return this._displaySize(),this._helper_get(this._displayData,"windowHeightPx")}get screenWidthCm(){return this._helper_get(this._screenData,"screenWidthCm")}get screenHeightCm(){return this._helper_get(this._screenData,"screenHeightCm")}get screenDiagonalCm(){return this._helper_get(this._screenData,"screenDiagonalCm")}get screenDiagonalIn(){return this._helper_get(this._screenData,"screenDiagonalIn")}get screenPpi(){return this._helper_get(this._screenData,"screenPpi")}get screenPhysicalPpi(){return this._helper_get(this._screenData,"screenPhysicalPpi")}get viewingDistanceCm(){return this._helper_get(this._viewingDistanceData)}get nearPointCm(){return this._helper_get(this._nearPointData)}get PDCm(){return this._helper_get(this._PDData)}get gazePositionPx(){return this._helper_get(this._gazePositionData)}get gazeAccuracyDeg(){return this._helper_get(this._gazeAccuracyData)}get displayData(){return this._displayData}get screenData(){return this._screenData}get viewingDistanceData(){return this._viewingDistanceData}get nearPointData(){return this._nearPointData}get PDData(){return this._PDData}get gazeData(){return this._gazePositionData}get performanceData(){return this._performanceData}get fullscreenData(){return this._fullscreenData}get environmentData(){return this._environmentData}get languageData(){return this._langData}get equipmentData(){return this._equipmentData}get checkData(){return this._checkData}set newDisplayData(e){this._displayData.push(e)}set newScreenData(e){this._screenData.push(e)}set newViewingDistanceData(e){this._viewingDistanceData.push(e)}set newNearPointData(e){this._nearPointData.push(e)}set newPDData(e){this._PDData.push(e)}set newGazePositionData(e){this._gazePositionData.push(e)}set newGazeAccuracyData(e){this._gazeAccuracyData.push(e)}set newEnvironmentData(e){this._environmentData.push(e)}set newPerformanceData(e){this._performanceData.push(e)}set newFullscreenData(e){this._fullscreenData.push(e)}set newLanguageData(e){this._langData.push(e)}set newEquipmentData(e){this._equipmentData.push(e)}set newCheckData(e){this._checkData.push(e)}}b.prototype.init=async function(e={},t){this._initialized||(this._initialized=!0,e=Object.assign({id:d(),language:"AUTO",languagePhrasesJSON:null,fullscreen:!1},e),await(async(e=null)=>{const{remoteCalibratorPhrases:t}=await import("https://cdn.jsdelivr.net/gh/EasyEyes/remote-calibrator-phrases@latest/phrases/main.js");Object.assign(g.H,t),e&&Object.assign(g.H,e)})(e.languagePhrasesJSON),e.fullscreen&&!p.Y&&(0,f.Sf)(),this._id={value:e.id,timestamp:performance.now(),date:new Date},this._environment(),this._displaySize(),this._CONST.S.AUTO===e.language?this.newLanguageData=(0,m.t)(this.userLanguage.value):this.newLanguageData=(0,m.t)(e.language),this._lang=this.language.value,(0,f.nB)(t,this._id))},b.prototype._environment=function(){if(this.checkInitialized()){(0,f.$k)();const e=e=>e.match(/Mobi/i)?"mobile":"desktop",t={value:{concurrency:window.navigator.hardwareConcurrency||-1,browser:r().name,browserVersion:r().version,deviceType:e(navigator.userAgent),model:r().product||"unknown",manufacturer:r().manufacturer||"unknown",engine:r().layout,system:`${r().os.family} ${r().os.version}`,systemFamily:r().os.family,description:r().description,fullDescription:r().ua,userLanguage:window.navigator.userLanguage||window.navigator.language},timestamp:this.id.timestamp};this.newEnvironmentData=t}},b.prototype.checkInitialized=function(){return!!this._initialized},b.prototype.getFullscreen=function(e=!0){return!!(0,f.aS)()||(this.newFullscreenData={value:!(!e||p.Y)&&(0,f.Sf)(),timestamp:performance.now()},this.isMobile.value&&window.scrollBy(0,1),this.isFullscreen)},b.prototype.newLanguage=function(e){if(this.checkInitialized()){let t;return this.newLanguageData=t=(0,m.t)(e),this._lang=this.language.value,t}},b.prototype._addBackground=function(e){if(null!==this.background)return;let t=document.getElementById("calibration-background");return t||(t=document.createElement("div"),t.id="calibration-background",t.className=`calibration-background rc-lang-${this.LD.toLowerCase()}`,document.body.classList.add("lock-view"),document.body.appendChild(t),t.style.background=this.params.backgroundColor),e&&(t.innerHTML=e),this._background.element=t,this.background},b.prototype._replaceBackground=function(e){return null!==this.background&&this._removeBackground(),this._addBackground(e)},b.prototype._removeBackground=function(){let e=document.getElementById("calibration-background");return!!e&&(document.body.classList.remove("lock-view"),document.body.removeChild(e),this._background={element:null,instructionElement:null},!0)},b.prototype._addBackgroundText=function(e,t){let n=this.background.getElementsByClassName("calibration-instruction");for(let e=0;e{"use strict";n.d(t,{Y:()=>s});const s=!1},9677:(e,t,n)=>{"use strict";n.d(t,{H:()=>s});const s={EE_languageDirection:{"en-US":"",de:"",fr:"",es:"",pt:"",it:"",ro:"",pl:"",ru:"",hy:"",fi:"",ka:"",he:"",ar:"",ur:"",hi:"",ta:"",ml:"",te:"",kn:"",bn:"",id:"","zh-CN":"","zh-HK":"",ja:"",ko:""},EE_languageUseSpace:{"en-US":"",de:"",fr:"",es:"",pt:"",it:"",ro:"",pl:"",ru:"",hy:"",fi:"",ka:"",he:"",ar:"",ur:"",hi:"",ta:"",ml:"",te:"",kn:"",bn:"",id:"","zh-CN":"","zh-HK":"",ja:"",ko:""},EE_languageUsesSpaces:{"en-US":"",de:"",fr:"",es:"",pt:"",it:"",ro:"",pl:"",ru:"",hy:"",fi:"",ka:"",he:"",ar:"",ur:"",hi:"",ta:"",ml:"",te:"",kn:"",bn:"",id:"","zh-CN":"","zh-HK":"",ja:"",ko:""},EE_languageFont:{"en-US":"",de:"",fr:"",es:"",pt:"",it:"",ro:"",pl:"",ru:"",hy:"",fi:"",ka:"",he:"",ar:"",ur:"",hi:"",ta:"",ml:"",te:"",kn:"",bn:"",id:"","zh-CN":"","zh-HK":"",ja:"",ko:""},EE_languageNameEnglish:{"en-US":"",de:"",fr:"",es:"",pt:"",it:"",ro:"",pl:"",ru:"",hy:"",fi:"",ka:"",he:"",ar:"",ur:"",hi:"",ta:"",ml:"",te:"",kn:"",bn:"",id:"","zh-CN":"","zh-HK":"",ja:"",ko:""},EE_languageNameNative:{"en-US":"",de:"",fr:"",es:"",pt:"",it:"",ro:"",pl:"",ru:"",hy:"",fi:"",ka:"",he:"",ar:"",ur:"",hi:"",ta:"",ml:"",te:"",kn:"",bn:"",id:"","zh-CN":"","zh-HK":"",ja:"",ko:""},EE_languageChoose:{"en-US":"",de:"",fr:"",es:"",pt:"",it:"",ro:"",pl:"",ru:"",hy:"",fi:"",ka:"",he:"",ar:"",ur:"",hi:"",ta:"",ml:"",te:"",kn:"",bn:"",id:"","zh-CN":"","zh-HK":"",ja:"",ko:""},EE_phraseSource:{"en-US":"",de:"",fr:"",es:"",pt:"",it:"",ro:"",pl:"",ru:"",hy:"",fi:"",ka:"",he:"",ar:"",ur:"",hi:"",ta:"",ml:"",te:"",kn:"",bn:"",id:"","zh-CN":"","zh-HK":"",ja:"",ko:""},EE_compatibilityTitle:{"en-US":"",de:"",fr:"",es:"",pt:"",it:"",ro:"",pl:"",ru:"",hy:"",fi:"",ka:"",he:"",ar:"",ur:"",hi:"",ta:"",ml:"",te:"",kn:"",bn:"",id:"","zh-CN":"","zh-HK":"",ja:"",ko:""},EE_compatible:{"en-US":"",de:"",fr:"",es:"",pt:"",it:"",ro:"",pl:"",ru:"",hy:"",fi:"",ka:"",he:"",ar:"",ur:"",hi:"",ta:"",ml:"",te:"",kn:"",bn:"",id:"","zh-CN":"","zh-HK":"",ja:"",ko:""},EE_compatibleBrowserDeviceCores:{"en-US":"",de:"",fr:"",es:"",pt:"",it:"",ro:"",pl:"",ru:"",hy:"",fi:"",ka:"",he:"",ar:"",ur:"",hi:"",ta:"",ml:"",te:"",kn:"",bn:"",id:"","zh-CN":"","zh-HK":"",ja:"",ko:""},EE_compatibleBrowserNotOSDeviceCores:{"en-US":"",de:"",fr:"",es:"",pt:"",it:"",ro:"",pl:"",ru:"",hy:"",fi:"",ka:"",he:"",ar:"",ur:"",hi:"",ta:"",ml:"",te:"",kn:"",bn:"",id:"","zh-CN":"","zh-HK":"",ja:"",ko:""},EE_compatibleBrowserOSDeviceCores:{"en-US":"",de:"",fr:"",es:"",pt:"",it:"",ro:"",pl:"",ru:"",hy:"",fi:"",ka:"",he:"",ar:"",ur:"",hi:"",ta:"",ml:"",te:"",kn:"",bn:"",id:"","zh-CN":"","zh-HK":"",ja:"",ko:""},EE_compatibleBrowserVersionDeviceCores:{"en-US":"",de:"",fr:"",es:"",pt:"",it:"",ro:"",pl:"",ru:"",hy:"",fi:"",ka:"",he:"",ar:"",ur:"",hi:"",ta:"",ml:"",te:"",kn:"",bn:"",id:"","zh-CN":"","zh-HK":"",ja:"",ko:""},EE_compatibleBrowserVersionNotOSDeviceCores:{"en-US":"",de:"",fr:"",es:"",pt:"",it:"",ro:"",pl:"",ru:"",hy:"",fi:"",ka:"",he:"",ar:"",ur:"",hi:"",ta:"",ml:"",te:"",kn:"",bn:"",id:"","zh-CN":"","zh-HK":"",ja:"",ko:""},EE_compatibleBrowserVersionOSDeviceCores:{"en-US":"",de:"",fr:"",es:"",pt:"",it:"",ro:"",pl:"",ru:"",hy:"",fi:"",ka:"",he:"",ar:"",ur:"",hi:"",ta:"",ml:"",te:"",kn:"",bn:"",id:"","zh-CN":"","zh-HK":"",ja:"",ko:""},EE_compatibleDeviceCores:{"en-US":"",de:"",fr:"",es:"",pt:"",it:"",ro:"",pl:"",ru:"",hy:"",fi:"",ka:"",he:"",ar:"",ur:"",hi:"",ta:"",ml:"",te:"",kn:"",bn:"",id:"","zh-CN":"","zh-HK":"",ja:"",ko:""},EE_compatibleExceptForScreenResolution:{"en-US":"",de:"",fr:"",es:"",pt:"",it:"",ro:"",pl:"",ru:"",hy:"",fi:"",ka:"",he:"",ar:"",ur:"",hi:"",ta:"",ml:"",te:"",kn:"",bn:"",id:"","zh-CN":"","zh-HK":"",ja:"",ko:""},EE_compatibleNotBrowserDeviceCores:{"en-US":"",de:"",fr:"",es:"",pt:"",it:"",ro:"",pl:"",ru:"",hy:"",fi:"",ka:"",he:"",ar:"",ur:"",hi:"",ta:"",ml:"",te:"",kn:"",bn:"",id:"","zh-CN":"","zh-HK":"",ja:"",ko:""},EE_compatibleNotBrowserNotOSDeviceCores:{"en-US":"",de:"",fr:"",es:"",pt:"",it:"",ro:"",pl:"",ru:"",hy:"",fi:"",ka:"",he:"",ar:"",ur:"",hi:"",ta:"",ml:"",te:"",kn:"",bn:"",id:"","zh-CN":"","zh-HK":"",ja:"",ko:""},EE_compatibleNotBrowserOSDeviceCores:{"en-US":"",de:"",fr:"",es:"",pt:"",it:"",ro:"",pl:"",ru:"",hy:"",fi:"",ka:"",he:"",ar:"",ur:"",hi:"",ta:"",ml:"",te:"",kn:"",bn:"",id:"","zh-CN":"","zh-HK":"",ja:"",ko:""},EE_compatibleNotOSDeviceCores:{"en-US":"",de:"",fr:"",es:"",pt:"",it:"",ro:"",pl:"",ru:"",hy:"",fi:"",ka:"",he:"",ar:"",ur:"",hi:"",ta:"",ml:"",te:"",kn:"",bn:"",id:"","zh-CN":"","zh-HK":"",ja:"",ko:""},EE_compatibleOSDeviceCores:{"en-US":"",de:"",fr:"",es:"",pt:"",it:"",ro:"",pl:"",ru:"",hy:"",fi:"",ka:"",he:"",ar:"",ur:"",hi:"",ta:"",ml:"",te:"",kn:"",bn:"",id:"","zh-CN":"","zh-HK":"",ja:"",ko:""},EE_compatibleScreenHeight:{"en-US":"",de:"",fr:"",es:"",pt:"",it:"",ro:"",pl:"",ru:"",hy:"",fi:"",ka:"",he:"",ar:"",ur:"",hi:"",ta:"",ml:"",te:"",kn:"",bn:"",id:"","zh-CN":"","zh-HK":"",ja:"",ko:""},EE_compatibleScreenSize:{"en-US":"",de:"",fr:"",es:"",pt:"",it:"",ro:"",pl:"",ru:"",hy:"",fi:"",ka:"",he:"",ar:"",ur:"",hi:"",ta:"",ml:"",te:"",kn:"",bn:"",id:"","zh-CN":"","zh-HK":"",ja:"",ko:""},EE_compatibleScreenWidth:{"en-US":"",de:"",fr:"",es:"",pt:"",it:"",ro:"",pl:"",ru:"",hy:"",fi:"",ka:"",he:"",ar:"",ur:"",hi:"",ta:"",ml:"",te:"",kn:"",bn:"",id:"","zh-CN":"","zh-HK":"",ja:"",ko:""},EE_ok:{"en-US":"",de:"",fr:"",es:"",pt:"",it:"",ro:"",pl:"",ru:"",hy:"",fi:"",ka:"",he:"",ar:"",ur:"",hi:"",ta:"",ml:"",te:"",kn:"",bn:"",id:"","zh-CN":"","zh-HK":"",ja:"",ko:""},EE_or:{"en-US":"",de:"",fr:"",es:"",pt:"",it:"",ro:"",pl:"",ru:"",hy:"",fi:"",ka:"",he:"",ar:"",ur:"",hi:"",ta:"",ml:"",te:"",kn:"",bn:"",id:"","zh-CN":"","zh-HK":"",ja:"",ko:""},EE_refresh:{"en-US":"",de:"",fr:"",es:"",pt:"",it:"",ro:"",pl:"",ru:"",hy:"",fi:"",ka:"",he:"",ar:"",ur:"",hi:"",ta:"",ml:"",te:"",kn:"",bn:"",id:"","zh-CN":"","zh-HK":"",ja:"",ko:""},EE_describeDevice:{"en-US":"",de:"",fr:"",es:"",pt:"",it:"",ro:"",pl:"",ru:"",hy:"",fi:"",ka:"",he:"",ar:"",ur:"",hi:"",ta:"",ml:"",te:"",kn:"",bn:"",id:"","zh-CN":"","zh-HK":"",ja:"",ko:""},EE_describeScreenSize:{"en-US":"",de:"",fr:"",es:"",pt:"",it:"",ro:"",pl:"",ru:"",hy:"",fi:"",ka:"",he:"",ar:"",ur:"",hi:"",ta:"",ml:"",te:"",kn:"",bn:"",id:"","zh-CN":"","zh-HK":"",ja:"",ko:""},EE_IDRequested:{"en-US":"",de:"",fr:"",es:"",pt:"",it:"",ro:"",pl:"",ru:"",hy:"",fi:"",ka:"",he:"",ar:"",ur:"",hi:"",ta:"",ml:"",te:"",kn:"",bn:"",id:"","zh-CN":"","zh-HK":"",ja:"",ko:""},EE_noFileSelected:{"en-US":"",de:"",fr:"",es:"",pt:"",it:"",ro:"",pl:"",ru:"",hy:"",fi:"",ka:"",he:"",ar:"",ur:"",hi:"",ta:"",ml:"",te:"",kn:"",bn:"",id:"","zh-CN":"","zh-HK":"",ja:"",ko:""},EE_browseForID:{"en-US":"",de:"",fr:"",es:"",pt:"",it:"",ro:"",pl:"",ru:"",hy:"",fi:"",ka:"",he:"",ar:"",ur:"",hi:"",ta:"",ml:"",te:"",kn:"",bn:"",id:"","zh-CN":"","zh-HK":"",ja:"",ko:""},EE_ID_noLocalStorage:{"en-US":"",de:"",fr:"",es:"",pt:"",it:"",ro:"",pl:"",ru:"",hy:"",fi:"",ka:"",he:"",ar:"",ur:"",hi:"",ta:"",ml:"",te:"",kn:"",bn:"",id:"","zh-CN":"","zh-HK":"",ja:"",ko:""},EE_ID:{"en-US":"",de:"",fr:"",es:"",pt:"",it:"",ro:"",pl:"",ru:"",hy:"",fi:"",ka:"",he:"",ar:"",ur:"",hi:"",ta:"",ml:"",te:"",kn:"",bn:"",id:"","zh-CN":"","zh-HK":"",ja:"",ko:""},EE_ID_uploadOrValidID:{"en-US":"",de:"",fr:"",es:"",pt:"",it:"",ro:"",pl:"",ru:"",hy:"",fi:"",ka:"",he:"",ar:"",ur:"",hi:"",ta:"",ml:"",te:"",kn:"",bn:"",id:"","zh-CN":"","zh-HK":"",ja:"",ko:""},EE_ID_invalidID:{"en-US":"",de:"",fr:"",es:"",pt:"",it:"",ro:"",pl:"",ru:"",hy:"",fi:"",ka:"",he:"",ar:"",ur:"",hi:"",ta:"",ml:"",te:"",kn:"",bn:"",id:"","zh-CN":"","zh-HK":"",ja:"",ko:""},EE_ID_invalidFile:{"en-US":"",de:"",fr:"",es:"",pt:"",it:"",ro:"",pl:"",ru:"",hy:"",fi:"",ka:"",he:"",ar:"",ur:"",hi:"",ta:"",ml:"",te:"",kn:"",bn:"",id:"","zh-CN":"","zh-HK":"",ja:"",ko:""},EE_incompatible:{"en-US":"",de:"",fr:"",es:"",pt:"",it:"",ro:"",pl:"",ru:"",hy:"",fi:"",ka:"",he:"",ar:"",ur:"",hi:"",ta:"",ml:"",te:"",kn:"",bn:"",id:"","zh-CN":"","zh-HK":"",ja:"",ko:""},EE_incompatibleReturnToProlific:{"en-US":"",de:"",fr:"",es:"",pt:"",it:"",ro:"",pl:"",ru:"",hy:"",fi:"",ka:"",he:"",ar:"",ur:"",hi:"",ta:"",ml:"",te:"",kn:"",bn:"",id:"","zh-CN":"","zh-HK":"",ja:"",ko:""},EE_studyURL:{"en-US":"",de:"",fr:"",es:"",pt:"",it:"",ro:"",pl:"",ru:"",hy:"",fi:"",ka:"",he:"",ar:"",ur:"",hi:"",ta:"",ml:"",te:"",kn:"",bn:"",id:"","zh-CN":"","zh-HK":"",ja:"",ko:""},RC_angleDistanceIntro:{"en-US":"",de:"",fr:"",es:"",pt:"",it:"",ro:"",pl:"",ru:"",hy:"",fi:"",ka:"",he:"",ar:"",ur:"",hi:"",ta:"",ml:"",te:"",kn:"",bn:"",id:"","zh-CN":"","zh-HK":"",ja:"",ko:""},RC_angleDistanceTitle:{"en-US":"",de:"",fr:"",es:"",pt:"",it:"",ro:"",pl:"",ru:"",hy:"",fi:"",ka:"",he:"",ar:"",ur:"",hi:"",ta:"",ml:"",te:"",kn:"",bn:"",id:"","zh-CN":"","zh-HK":"",ja:"",ko:""},RC_cancel:{"en-US":"",de:"",fr:"",es:"",pt:"",it:"",ro:"",pl:"",ru:"",hy:"",fi:"",ka:"",he:"",ar:"",ur:"",hi:"",ta:"",ml:"",te:"",kn:"",bn:"",id:"","zh-CN":"","zh-HK":"",ja:"",ko:""},RC_distanceTracking:{"en-US":"",de:"",fr:"",es:"",pt:"",it:"",ro:"",pl:"",ru:"",hy:"",fi:"",ka:"",he:"",ar:"",ur:"",hi:"",ta:"",ml:"",te:"",kn:"",bn:"",id:"","zh-CN":"","zh-HK":"",ja:"",ko:""},RC_distanceTrackingCloseL:{"en-US":"",de:"",fr:"",es:"",pt:"",it:"",ro:"",pl:"",ru:"",hy:"",fi:"",ka:"",he:"",ar:"",ur:"",hi:"",ta:"",ml:"",te:"",kn:"",bn:"",id:"","zh-CN":"","zh-HK":"",ja:"",ko:""},RC_distanceTrackingCloseR:{"en-US":"",de:"",fr:"",es:"",pt:"",it:"",ro:"",pl:"",ru:"",hy:"",fi:"",ka:"",he:"",ar:"",ur:"",hi:"",ta:"",ml:"",te:"",kn:"",bn:"",id:"","zh-CN":"","zh-HK":"",ja:"",ko:""},RC_distanceTrackingGuide:{"en-US":"",de:"",fr:"",es:"",pt:"",it:"",ro:"",pl:"",ru:"",hy:"",fi:"",ka:"",he:"",ar:"",ur:"",hi:"",ta:"",ml:"",te:"",kn:"",bn:"",id:"","zh-CN":"","zh-HK":"",ja:"",ko:""},RC_distanceTrackingIntroEnd:{"en-US":"",de:"",fr:"",es:"",pt:"",it:"",ro:"",pl:"",ru:"",hy:"",fi:"",ka:"",he:"",ar:"",ur:"",hi:"",ta:"",ml:"",te:"",kn:"",bn:"",id:"","zh-CN":"","zh-HK":"",ja:"",ko:""},RC_distanceTrackingIntroStart:{"en-US":"",de:"",fr:"",es:"",pt:"",it:"",ro:"",pl:"",ru:"",hy:"",fi:"",ka:"",he:"",ar:"",ur:"",hi:"",ta:"",ml:"",te:"",kn:"",bn:"",id:"","zh-CN":"","zh-HK":"",ja:"",ko:""},RC_distanceTrackingMoveCloser:{"en-US":"",de:"",fr:"",es:"",pt:"",it:"",ro:"",pl:"",ru:"",hy:"",fi:"",ka:"",he:"",ar:"",ur:"",hi:"",ta:"",ml:"",te:"",kn:"",bn:"",id:"","zh-CN":"","zh-HK":"",ja:"",ko:""},RC_distanceTrackingMoveFurther:{"en-US":"",de:"",fr:"",es:"",pt:"",it:"",ro:"",pl:"",ru:"",hy:"",fi:"",ka:"",he:"",ar:"",ur:"",hi:"",ta:"",ml:"",te:"",kn:"",bn:"",id:"","zh-CN":"","zh-HK":"",ja:"",ko:""},RC_distanceTrackingRedo:{"en-US":"",de:"",fr:"",es:"",pt:"",it:"",ro:"",pl:"",ru:"",hy:"",fi:"",ka:"",he:"",ar:"",ur:"",hi:"",ta:"",ml:"",te:"",kn:"",bn:"",id:"","zh-CN":"","zh-HK":"",ja:"",ko:""},RC_distanceTrackingTitle:{"en-US":"",de:"",fr:"",es:"",pt:"",it:"",ro:"",pl:"",ru:"",hy:"",fi:"",ka:"",he:"",ar:"",ur:"",hi:"",ta:"",ml:"",te:"",kn:"",bn:"",id:"","zh-CN":"","zh-HK":"",ja:"",ko:""},RC_environment:{"en-US":"",de:"",fr:"",es:"",pt:"",it:"",ro:"",pl:"",ru:"",hy:"",fi:"",ka:"",he:"",ar:"",ur:"",hi:"",ta:"",ml:"",te:"",kn:"",bn:"",id:"","zh-CN":"","zh-HK":"",ja:"",ko:""},RC_errorCameraUseDenied:{"en-US":"",de:"",fr:"",es:"",pt:"",it:"",ro:"",pl:"",ru:"",hy:"",fi:"",ka:"",he:"",ar:"",ur:"",hi:"",ta:"",ml:"",te:"",kn:"",bn:"",id:"","zh-CN":"","zh-HK":"",ja:"",ko:""},RC_errorNoCamera:{"en-US":"",de:"",fr:"",es:"",pt:"",it:"",ro:"",pl:"",ru:"",hy:"",fi:"",ka:"",he:"",ar:"",ur:"",hi:"",ta:"",ml:"",te:"",kn:"",bn:"",id:"","zh-CN":"","zh-HK":"",ja:"",ko:""},RC_gazeTracking:{"en-US":"",de:"",fr:"",es:"",pt:"",it:"",ro:"",pl:"",ru:"",hy:"",fi:"",ka:"",he:"",ar:"",ur:"",hi:"",ta:"",ml:"",te:"",kn:"",bn:"",id:"","zh-CN":"","zh-HK":"",ja:"",ko:""},RC_gazeTrackingIntro:{"en-US":"",de:"",fr:"",es:"",pt:"",it:"",ro:"",pl:"",ru:"",hy:"",fi:"",ka:"",he:"",ar:"",ur:"",hi:"",ta:"",ml:"",te:"",kn:"",bn:"",id:"","zh-CN":"","zh-HK":"",ja:"",ko:""},RC_gazeTrackingNudge:{"en-US":"",de:"",fr:"",es:"",pt:"",it:"",ro:"",pl:"",ru:"",hy:"",fi:"",ka:"",he:"",ar:"",ur:"",hi:"",ta:"",ml:"",te:"",kn:"",bn:"",id:"","zh-CN":"","zh-HK":"",ja:"",ko:""},RC_gazeTrackingTitle:{"en-US":"",de:"",fr:"",es:"",pt:"",it:"",ro:"",pl:"",ru:"",hy:"",fi:"",ka:"",he:"",ar:"",ur:"",hi:"",ta:"",ml:"",te:"",kn:"",bn:"",id:"","zh-CN":"","zh-HK":"",ja:"",ko:""},RC_ifStuckPleaseReturn:{"en-US":"",de:"",fr:"",es:"",pt:"",it:"",ro:"",pl:"",ru:"",hy:"",fi:"",ka:"",he:"",ar:"",ur:"",hi:"",ta:"",ml:"",te:"",kn:"",bn:"",id:"","zh-CN":"","zh-HK":"",ja:"",ko:""},RC_nearPointIntro:{"en-US":"",de:"",fr:"",es:"",pt:"",it:"",ro:"",pl:"",ru:"",hy:"",fi:"",ka:"",he:"",ar:"",ur:"",hi:"",ta:"",ml:"",te:"",kn:"",bn:"",id:"","zh-CN":"","zh-HK":"",ja:"",ko:""},RC_nearPointTitle:{"en-US":"",de:"",fr:"",es:"",pt:"",it:"",ro:"",pl:"",ru:"",hy:"",fi:"",ka:"",he:"",ar:"",ur:"",hi:"",ta:"",ml:"",te:"",kn:"",bn:"",id:"","zh-CN":"","zh-HK":"",ja:"",ko:""},RC_ok:{"en-US":"",de:"",fr:"",es:"",pt:"",it:"",ro:"",pl:"",ru:"",hy:"",fi:"",ka:"",he:"",ar:"",ur:"",hi:"",ta:"",ml:"",te:"",kn:"",bn:"",id:"","zh-CN":"","zh-HK":"",ja:"",ko:""},RC_panelButton:{"en-US":"",de:"",fr:"",es:"",pt:"",it:"",ro:"",pl:"",ru:"",hy:"",fi:"",ka:"",he:"",ar:"",ur:"",hi:"",ta:"",ml:"",te:"",kn:"",bn:"",id:"","zh-CN":"","zh-HK":"",ja:"",ko:""},RC_panelIntro:{"en-US":"",de:"",fr:"",es:"",pt:"",it:"",ro:"",pl:"",ru:"",hy:"",fi:"",ka:"",he:"",ar:"",ur:"",hi:"",ta:"",ml:"",te:"",kn:"",bn:"",id:"","zh-CN":"","zh-HK":"",ja:"",ko:""},RC_panelIntroNext:{"en-US":"",de:"",fr:"",es:"",pt:"",it:"",ro:"",pl:"",ru:"",hy:"",fi:"",ka:"",he:"",ar:"",ur:"",hi:"",ta:"",ml:"",te:"",kn:"",bn:"",id:"","zh-CN":"","zh-HK":"",ja:"",ko:""},RC_panelTitle:{"en-US":"",de:"",fr:"",es:"",pt:"",it:"",ro:"",pl:"",ru:"",hy:"",fi:"",ka:"",he:"",ar:"",ur:"",hi:"",ta:"",ml:"",te:"",kn:"",bn:"",id:"","zh-CN":"","zh-HK":"",ja:"",ko:""},RC_panelTitleNext:{"en-US":"",de:"",fr:"",es:"",pt:"",it:"",ro:"",pl:"",ru:"",hy:"",fi:"",ka:"",he:"",ar:"",ur:"",hi:"",ta:"",ml:"",te:"",kn:"",bn:"",id:"","zh-CN":"","zh-HK":"",ja:"",ko:""},RC_panelUsesWebcam:{"en-US":"",de:"",fr:"",es:"",pt:"",it:"",ro:"",pl:"",ru:"",hy:"",fi:"",ka:"",he:"",ar:"",ur:"",hi:"",ta:"",ml:"",te:"",kn:"",bn:"",id:"","zh-CN":"","zh-HK":"",ja:"",ko:""},RC_panelUsesWebcamPhone:{"en-US":"",de:"",fr:"",es:"",pt:"",it:"",ro:"",pl:"",ru:"",hy:"",fi:"",ka:"",he:"",ar:"",ur:"",hi:"",ta:"",ml:"",te:"",kn:"",bn:"",id:"","zh-CN":"","zh-HK":"",ja:"",ko:""},RC_performance:{"en-US":"",de:"",fr:"",es:"",pt:"",it:"",ro:"",pl:"",ru:"",hy:"",fi:"",ka:"",he:"",ar:"",ur:"",hi:"",ta:"",ml:"",te:"",kn:"",bn:"",id:"","zh-CN":"","zh-HK":"",ja:"",ko:""},RC_performanceIntro:{"en-US":"",de:"",fr:"",es:"",pt:"",it:"",ro:"",pl:"",ru:"",hy:"",fi:"",ka:"",he:"",ar:"",ur:"",hi:"",ta:"",ml:"",te:"",kn:"",bn:"",id:"","zh-CN":"","zh-HK":"",ja:"",ko:""},RC_performanceTitle:{"en-US":"",de:"",fr:"",es:"",pt:"",it:"",ro:"",pl:"",ru:"",hy:"",fi:"",ka:"",he:"",ar:"",ur:"",hi:"",ta:"",ml:"",te:"",kn:"",bn:"",id:"","zh-CN":"","zh-HK":"",ja:"",ko:""},RC_privacyCamera:{"en-US":"",de:"",fr:"",es:"",pt:"",it:"",ro:"",pl:"",ru:"",hy:"",fi:"",ka:"",he:"",ar:"",ur:"",hi:"",ta:"",ml:"",te:"",kn:"",bn:"",id:"","zh-CN":"","zh-HK":"",ja:"",ko:""},RC_privacyIphoneMicrophone:{"en-US":"",de:"",fr:"",es:"",pt:"",it:"",ro:"",pl:"",ru:"",hy:"",fi:"",ka:"",he:"",ar:"",ur:"",hi:"",ta:"",ml:"",te:"",kn:"",bn:"",id:"","zh-CN":"","zh-HK":"",ja:"",ko:""},RC_requestCamera:{"en-US":"",de:"",fr:"",es:"",pt:"",it:"",ro:"",pl:"",ru:"",hy:"",fi:"",ka:"",he:"",ar:"",ur:"",hi:"",ta:"",ml:"",te:"",kn:"",bn:"",id:"","zh-CN":"","zh-HK":"",ja:"",ko:""},RC_screenSize:{"en-US":"",de:"",fr:"",es:"",pt:"",it:"",ro:"",pl:"",ru:"",hy:"",fi:"",ka:"",he:"",ar:"",ur:"",hi:"",ta:"",ml:"",te:"",kn:"",bn:"",id:"","zh-CN":"","zh-HK":"",ja:"",ko:""},RC_screenSizeCredit:{"en-US":"",de:"",fr:"",es:"",pt:"",it:"",ro:"",pl:"",ru:"",hy:"",fi:"",ka:"",he:"",ar:"",ur:"",hi:"",ta:"",ml:"",te:"",kn:"",bn:"",id:"","zh-CN":"","zh-HK":"",ja:"",ko:""},RC_screenSizeCreditCard:{"en-US":"",de:"",fr:"",es:"",pt:"",it:"",ro:"",pl:"",ru:"",hy:"",fi:"",ka:"",he:"",ar:"",ur:"",hi:"",ta:"",ml:"",te:"",kn:"",bn:"",id:"","zh-CN":"","zh-HK":"",ja:"",ko:""},RC_screenSizeHave:{"en-US":"",de:"",fr:"",es:"",pt:"",it:"",ro:"",pl:"",ru:"",hy:"",fi:"",ka:"",he:"",ar:"",ur:"",hi:"",ta:"",ml:"",te:"",kn:"",bn:"",id:"","zh-CN":"","zh-HK":"",ja:"",ko:""},RC_screenSizeIntro:{"en-US":"",de:"",fr:"",es:"",pt:"",it:"",ro:"",pl:"",ru:"",hy:"",fi:"",ka:"",he:"",ar:"",ur:"",hi:"",ta:"",ml:"",te:"",kn:"",bn:"",id:"","zh-CN":"","zh-HK":"",ja:"",ko:""},RC_screenSizeTitle:{"en-US":"",de:"",fr:"",es:"",pt:"",it:"",ro:"",pl:"",ru:"",hy:"",fi:"",ka:"",he:"",ar:"",ur:"",hi:"",ta:"",ml:"",te:"",kn:"",bn:"",id:"","zh-CN":"","zh-HK":"",ja:"",ko:""},RC_screenSizeUSBA:{"en-US":"",de:"",fr:"",es:"",pt:"",it:"",ro:"",pl:"",ru:"",hy:"",fi:"",ka:"",he:"",ar:"",ur:"",hi:"",ta:"",ml:"",te:"",kn:"",bn:"",id:"","zh-CN":"","zh-HK":"",ja:"",ko:""},RC_screenSizeUSBC:{"en-US":"",de:"",fr:"",es:"",pt:"",it:"",ro:"",pl:"",ru:"",hy:"",fi:"",ka:"",he:"",ar:"",ur:"",hi:"",ta:"",ml:"",te:"",kn:"",bn:"",id:"","zh-CN":"","zh-HK":"",ja:"",ko:""},RC_starting:{"en-US":"",de:"",fr:"",es:"",pt:"",it:"",ro:"",pl:"",ru:"",hy:"",fi:"",ka:"",he:"",ar:"",ur:"",hi:"",ta:"",ml:"",te:"",kn:"",bn:"",id:"","zh-CN":"","zh-HK":"",ja:"",ko:""},RC_viewingBlindSpotCredit:{"en-US":"",de:"",fr:"",es:"",pt:"",it:"",ro:"",pl:"",ru:"",hy:"",fi:"",ka:"",he:"",ar:"",ur:"",hi:"",ta:"",ml:"",te:"",kn:"",bn:"",id:"","zh-CN":"","zh-HK":"",ja:"",ko:""},RC_viewingBlindSpotRejected:{"en-US":"",de:"",fr:"",es:"",pt:"",it:"",ro:"",pl:"",ru:"",hy:"",fi:"",ka:"",he:"",ar:"",ur:"",hi:"",ta:"",ml:"",te:"",kn:"",bn:"",id:"","zh-CN":"","zh-HK":"",ja:"",ko:""},RC_viewingDistance:{"en-US":"",de:"",fr:"",es:"",pt:"",it:"",ro:"",pl:"",ru:"",hy:"",fi:"",ka:"",he:"",ar:"",ur:"",hi:"",ta:"",ml:"",te:"",kn:"",bn:"",id:"","zh-CN":"","zh-HK":"",ja:"",ko:""},RC_viewingDistanceIntro:{"en-US":"",de:"",fr:"",es:"",pt:"",it:"",ro:"",pl:"",ru:"",hy:"",fi:"",ka:"",he:"",ar:"",ur:"",hi:"",ta:"",ml:"",te:"",kn:"",bn:"",id:"","zh-CN":"","zh-HK":"",ja:"",ko:""},RC_viewingDistanceIntroTitle:{"en-US":"",de:"",fr:"",es:"",pt:"",it:"",ro:"",pl:"",ru:"",hy:"",fi:"",ka:"",he:"",ar:"",ur:"",hi:"",ta:"",ml:"",te:"",kn:"",bn:"",id:"","zh-CN":"","zh-HK":"",ja:"",ko:""},RC_viewingDistanceIntroLiMethod:{"en-US":"",de:"",fr:"",es:"",pt:"",it:"",ro:"",pl:"",ru:"",hy:"",fi:"",ka:"",he:"",ar:"",ur:"",hi:"",ta:"",ml:"",te:"",kn:"",bn:"",id:"","zh-CN":"","zh-HK":"",ja:"",ko:""},RC_viewingDistanceRedo:{"en-US":"",de:"",fr:"",es:"",pt:"",it:"",ro:"",pl:"",ru:"",hy:"",fi:"",ka:"",he:"",ar:"",ur:"",hi:"",ta:"",ml:"",te:"",kn:"",bn:"",id:"","zh-CN":"","zh-HK":"",ja:"",ko:""},RC_viewingDistanceTitle:{"en-US":"",de:"",fr:"",es:"",pt:"",it:"",ro:"",pl:"",ru:"",hy:"",fi:"",ka:"",he:"",ar:"",ur:"",hi:"",ta:"",ml:"",te:"",kn:"",bn:"",id:"","zh-CN":"","zh-HK":"",ja:"",ko:""}}},7790:(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{"use strict";__webpack_require__.d(__webpack_exports__,{K:()=>_setDebugControl});var _components_utils__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__(9043);const _setDebugControl=(e,t,n,s)=>{const r=document.createElement("div");r.className="rc-panel-debug-control",r.innerHTML='

DEBUG CONTROL

REMEMBER TO SET debug TO false FOR PRODUCTION MODE!

',t.appendChild(r);const a=[];for(let t of n){let n=t.name?t.name:t;const s=document.createElement("div");s.className="rc-panel-debug-control-task-row",s.id="rc-debugger-row-"+n;let i=e._debuggerDefault[n];if(i){r.innerHTML+=`

${n}

`;const e={n:"number",s:"string"};switch(n){case"screenSize":for(let t in i.value)s.innerHTML+=_createValueElement(n,t,i.value[t],".value."+t,e.n);break;case"measureDistance":s.innerHTML+=_createValueElement(n,"value",i.value,".value",e.n),s.innerHTML+=_createValueElement(n,"method",i.method,".method",e.s,!0);break;case"trackDistance":s.innerHTML+=_createValueElement(n,"viewingDistanceCm",i.value.viewingDistanceCm,".value",e.n),s.innerHTML+=_createValueElement(n,"PDCm",i.value.PDCm,".value",e.n),s.innerHTML+=_createValueElement(n,"nearPointCm.x",i.value.nearPointCm.x,".value.x",e.n),s.innerHTML+=_createValueElement(n,"nearPointCm.y",i.value.nearPointCm.y,".value.y",e.n),s.innerHTML+=_createValueElement(n,"latencyMs",i.value.latencyMs,".latencyMs",e.n),s.innerHTML+=_createValueElement(n,"method",i.method,".method",e.s,!0);break;case"trackGaze":s.innerHTML+=_createValueElement(n,"x",i.value.x,".value.x",e.n),s.innerHTML+=_createValueElement(n,"y",i.value.y,".value.y",e.n),s.innerHTML+=_createValueElement(n,"latencyMs",i.value.latencyMs,".value.latencyMs",e.n);break;case"performance":s.innerHTML+=_createValueElement(n,"computeArrayFillMHz",i.value.computeArrayFillMHz,".value.computeArrayFillMHz",e.n),s.innerHTML+=_createValueElement(n,"computeRandomMHz",i.value.computeRandomMHz,".value.computeRandomMHz",e.n),s.innerHTML+=_createValueElement(n,"idealFps",i.value.idealFps,".value.idealFps",e.n),s.innerHTML+=_createValueElement(n,"stressFps",i.value.stressFps,".value.stressFps",e.n)}r.appendChild(s),a.push(n)}}const i=document.createElement("button");i.className="rc-panel-debug-control-next",i.innerHTML="Simulate calibration and continue",i.onclick=()=>{_wrapValues(e,a),(0,_components_utils__WEBPACK_IMPORTED_MODULE_0__.nB)(s,{timestamp:performance.now()}),e._panelStatus.panelFinished=!0},r.appendChild(i)},_createValueElement=(e,t,n,s,r,a=!1)=>`
\n \n

${t}

\n
`,_wrapValues=(e,t)=>{for(let n of t){const t=document.querySelector("#rc-debugger-row-"+n),s={};switch(n){case"screenSize":s.value={},_putData(e,s,t),e.newScreenData=(0,_components_utils__WEBPACK_IMPORTED_MODULE_0__.ln)(s);break;case"measureDistance":_putData(e,s,t),e.newViewingDistanceData=(0,_components_utils__WEBPACK_IMPORTED_MODULE_0__.ln)(s);break;case"trackDistance":e.newViewingDistanceData={value:_get(t,"#trackDistance-viewingDistanceCm"),latencyMs:_get(t,"#trackDistance-latencyMs"),method:_get(t,"#trackDistance-method","string"),timestamp:e._debuggerDefault.timestamp},e.newNearPointData={value:{x:_get(t,"#trackDistance-nearPointCm-x"),y:_get(t,"#trackDistance-nearPointCm-y")},timestamp:e._debuggerDefault.timestamp},e.newPDData={value:_get(t,"#trackDistance-PDCm"),timestamp:e._debuggerDefault.timestamp};break;case"trackGaze":s.value={},_putData(e,s,t),e.newGazePositionData=(0,_components_utils__WEBPACK_IMPORTED_MODULE_0__.ln)(s);break;case"performance":s.value={},_putData(e,s,t),e.newPerformanceData=(0,_components_utils__WEBPACK_IMPORTED_MODULE_0__.ln)(s)}}},_get=(e,t)=>{const n=e.querySelector(t);return"number"===n.dataset.type?Number(n.value):n.value},_putData=(RC,newData,taskRow)=>{for(let ele of taskRow.childNodes){const eleInput=ele.querySelector("input");try{eval(`newData${eleInput.dataset.source} = eleInput.dataset.type === 'number' ? Number(eleInput.value) : eleInput.value`)}catch(e){}newData.timestamp=RC._debuggerDefault.timestamp}return newData}},2921:(e,t,n)=>{"use strict";n.d(t,{A:()=>o});var s=n(1354),r=n.n(s),a=n(6314),i=n.n(a)()(r());i.push([e.id,".animated{-webkit-animation-duration:var(--animate-duration);animation-duration:var(--animate-duration);-webkit-animation-fill-mode:both;animation-fill-mode:both}.animated.infinite{-webkit-animation-iteration-count:infinite;animation-iteration-count:infinite}.animated.repeat-1{-webkit-animation-iteration-count:var(--animate-repeat);animation-iteration-count:var(--animate-repeat)}.animated.repeat-2{-webkit-animation-iteration-count:calc(var(--animate-repeat)*2);animation-iteration-count:calc(var(--animate-repeat)*2)}.animated.repeat-3{-webkit-animation-iteration-count:calc(var(--animate-repeat)*3);animation-iteration-count:calc(var(--animate-repeat)*3)}.animated.delay-1s{-webkit-animation-delay:var(--animate-delay);animation-delay:var(--animate-delay)}.animated.delay-2s{-webkit-animation-delay:calc(var(--animate-delay)*2);animation-delay:calc(var(--animate-delay)*2)}.animated.delay-3s{-webkit-animation-delay:calc(var(--animate-delay)*3);animation-delay:calc(var(--animate-delay)*3)}.animated.delay-4s{-webkit-animation-delay:calc(var(--animate-delay)*4);animation-delay:calc(var(--animate-delay)*4)}.animated.delay-5s{-webkit-animation-delay:calc(var(--animate-delay)*5);animation-delay:calc(var(--animate-delay)*5)}.animated.faster{-webkit-animation-duration:calc(var(--animate-duration)/2);animation-duration:calc(var(--animate-duration)/2)}.animated.fast{-webkit-animation-duration:calc(var(--animate-duration)*.8);animation-duration:calc(var(--animate-duration)*.8)}.animated.slow{-webkit-animation-duration:calc(var(--animate-duration)*2);animation-duration:calc(var(--animate-duration)*2)}.animated.slower{-webkit-animation-duration:calc(var(--animate-duration)*3);animation-duration:calc(var(--animate-duration)*3)}@media (prefers-reduced-motion:reduce),print{.animated{-webkit-animation-duration:1ms!important;animation-duration:1ms!important;-webkit-animation-iteration-count:1!important;animation-iteration-count:1!important;-webkit-transition-duration:1ms!important;transition-duration:1ms!important}.animated[class*=Out]{opacity:0}}","",{version:3,sources:["webpack://./node_modules/animate.css/source/_base.css"],names:[],mappings:"AAAA,UACE,kDAA2C,CAA3C,0CAA2C,CAC3C,gCAAyB,CAAzB,wBACF,CAEA,mBACE,0CAAmC,CAAnC,kCACF,CAEA,mBACE,uDAAgD,CAAhD,+CACF,CAEA,mBACE,+DAA0D,CAA1D,uDACF,CAEA,mBACE,+DAA0D,CAA1D,uDACF,CAEA,mBACE,4CAAqC,CAArC,oCACF,CAEA,mBACE,oDAA+C,CAA/C,4CACF,CAEA,mBACE,oDAA+C,CAA/C,4CACF,CAEA,mBACE,oDAA+C,CAA/C,4CACF,CAEA,mBACE,oDAA+C,CAA/C,4CACF,CAEA,iBACE,0DAAqD,CAArD,kDACF,CAEA,eACE,2DAAuD,CAAvD,mDACF,CAEA,eACE,0DAAqD,CAArD,kDACF,CAEA,iBACE,0DAAqD,CAArD,kDACF,CAEA,6CACE,UACE,wCAAkC,CAAlC,gCAAkC,CAElC,6CAAuC,CAAvC,qCAAuC,CADvC,yCAAmC,CAAnC,iCAEF,CAEA,sBACE,SACF,CACF",sourcesContent:[".animated {\n animation-duration: var(--animate-duration);\n animation-fill-mode: both;\n}\n\n.animated.infinite {\n animation-iteration-count: infinite;\n}\n\n.animated.repeat-1 {\n animation-iteration-count: var(--animate-repeat);\n}\n\n.animated.repeat-2 {\n animation-iteration-count: calc(var(--animate-repeat) * 2);\n}\n\n.animated.repeat-3 {\n animation-iteration-count: calc(var(--animate-repeat) * 3);\n}\n\n.animated.delay-1s {\n animation-delay: var(--animate-delay);\n}\n\n.animated.delay-2s {\n animation-delay: calc(var(--animate-delay) * 2);\n}\n\n.animated.delay-3s {\n animation-delay: calc(var(--animate-delay) * 3);\n}\n\n.animated.delay-4s {\n animation-delay: calc(var(--animate-delay) * 4);\n}\n\n.animated.delay-5s {\n animation-delay: calc(var(--animate-delay) * 5);\n}\n\n.animated.faster {\n animation-duration: calc(var(--animate-duration) / 2);\n}\n\n.animated.fast {\n animation-duration: calc(var(--animate-duration) * 0.8);\n}\n\n.animated.slow {\n animation-duration: calc(var(--animate-duration) * 2);\n}\n\n.animated.slower {\n animation-duration: calc(var(--animate-duration) * 3);\n}\n\n@media print, (prefers-reduced-motion: reduce) {\n .animated {\n animation-duration: 1ms !important;\n transition-duration: 1ms !important;\n animation-iteration-count: 1 !important;\n }\n\n .animated[class*='Out'] {\n opacity: 0;\n }\n}\n"],sourceRoot:""}]);const o=i},2636:(e,t,n)=>{"use strict";n.d(t,{A:()=>o});var s=n(1354),r=n.n(s),a=n(6314),i=n.n(a)()(r());i.push([e.id,":root{--animate-duration:1s;--animate-delay:1s;--animate-repeat:1}","",{version:3,sources:["webpack://./node_modules/animate.css/source/_vars.css"],names:[],mappings:"AAAA,MACE,qBAAsB,CACtB,kBAAmB,CACnB,kBACF",sourcesContent:[":root {\n --animate-duration: 1s;\n --animate-delay: 1s;\n --animate-repeat: 1;\n}\n"],sourceRoot:""}]);const o=i},7271:(e,t,n)=>{"use strict";n.d(t,{A:()=>o});var s=n(1354),r=n.n(s),a=n(6314),i=n.n(a)()(r());i.push([e.id,"@-webkit-keyframes fadeInUp{0%{opacity:0;-webkit-transform:translate3d(0,100%,0);transform:translate3d(0,100%,0)}to{opacity:1;-webkit-transform:translateZ(0);transform:translateZ(0)}}@keyframes fadeInUp{0%{opacity:0;-webkit-transform:translate3d(0,100%,0);transform:translate3d(0,100%,0)}to{opacity:1;-webkit-transform:translateZ(0);transform:translateZ(0)}}.fadeInUp{-webkit-animation-name:fadeInUp;animation-name:fadeInUp}","",{version:3,sources:["webpack://./node_modules/animate.css/source/fading_entrances/fadeInUp.css"],names:[],mappings:"AAAA,4BACE,GACE,SAAU,CACV,uCAAkC,CAAlC,+BACF,CAEA,GACE,SAAU,CACV,+BAA+B,CAA/B,uBACF,CACF,CAVA,oBACE,GACE,SAAU,CACV,uCAAkC,CAAlC,+BACF,CAEA,GACE,SAAU,CACV,+BAA+B,CAA/B,uBACF,CACF,CAEA,UACE,+BAAwB,CAAxB,uBACF",sourcesContent:["@keyframes fadeInUp {\n from {\n opacity: 0;\n transform: translate3d(0, 100%, 0);\n }\n\n to {\n opacity: 1;\n transform: translate3d(0, 0, 0);\n }\n}\n\n.fadeInUp {\n animation-name: fadeInUp;\n}\n"],sourceRoot:""}]);const o=i},2551:(e,t,n)=>{"use strict";n.d(t,{A:()=>o});var s=n(1354),r=n.n(s),a=n(6314),i=n.n(a)()(r());i.push([e.id,"@-webkit-keyframes fadeOutDown{0%{opacity:1}to{opacity:0;-webkit-transform:translate3d(0,100%,0);transform:translate3d(0,100%,0)}}@keyframes fadeOutDown{0%{opacity:1}to{opacity:0;-webkit-transform:translate3d(0,100%,0);transform:translate3d(0,100%,0)}}.fadeOutDown{-webkit-animation-name:fadeOutDown;animation-name:fadeOutDown}","",{version:3,sources:["webpack://./node_modules/animate.css/source/fading_exits/fadeOutDown.css"],names:[],mappings:"AAAA,+BACE,GACE,SACF,CAEA,GACE,SAAU,CACV,uCAAkC,CAAlC,+BACF,CACF,CATA,uBACE,GACE,SACF,CAEA,GACE,SAAU,CACV,uCAAkC,CAAlC,+BACF,CACF,CAEA,aACE,kCAA2B,CAA3B,0BACF",sourcesContent:["@keyframes fadeOutDown {\n from {\n opacity: 1;\n }\n\n to {\n opacity: 0;\n transform: translate3d(0, 100%, 0);\n }\n}\n\n.fadeOutDown {\n animation-name: fadeOutDown;\n}\n"],sourceRoot:""}]);const o=i},8470:(e,t,n)=>{"use strict";n.d(t,{A:()=>o});var s=n(1354),r=n.n(s),a=n(6314),i=n.n(a)()(r());i.push([e.id,'.swal2-popup.swal2-toast{background:#fff;box-shadow:0 0 1px rgba(0,0,0,.075),0 1px 2px rgba(0,0,0,.075),1px 2px 4px rgba(0,0,0,.075),1px 3px 8px rgba(0,0,0,.075),2px 4px 16px rgba(0,0,0,.075);box-sizing:border-box;grid-column:1/4!important;grid-row:1/4!important;grid-template-columns:min-content auto min-content;overflow-y:hidden;padding:1em;pointer-events:all}.swal2-popup.swal2-toast>*{grid-column:2}.swal2-popup.swal2-toast .swal2-title{font-size:1em;margin:.5em 1em;padding:0;text-align:initial}.swal2-popup.swal2-toast .swal2-loading{justify-content:center}.swal2-popup.swal2-toast .swal2-input{font-size:1em;height:2em;margin:.5em}.swal2-popup.swal2-toast .swal2-validation-message{font-size:1em}.swal2-popup.swal2-toast .swal2-footer{font-size:.8em;margin:.5em 0 0;padding:.5em 0 0}.swal2-popup.swal2-toast .swal2-close{align-self:center;font-size:2em;grid-column:3/3;grid-row:1/99;height:.8em;margin:0;width:.8em}.swal2-popup.swal2-toast .swal2-html-container{font-size:1em;margin:.5em 1em;overflow:initial;padding:0;text-align:initial}.swal2-popup.swal2-toast .swal2-html-container:empty{padding:0}.swal2-popup.swal2-toast .swal2-loader{align-self:center;grid-column:1;grid-row:1/99;height:2em;margin:.25em;width:2em}.swal2-popup.swal2-toast .swal2-icon{align-self:center;grid-column:1;grid-row:1/99;height:2em;margin:0 .5em 0 0;min-width:2em;width:2em}.swal2-popup.swal2-toast .swal2-icon .swal2-icon-content{align-items:center;display:flex;font-size:1.8em;font-weight:700}.swal2-popup.swal2-toast .swal2-icon.swal2-success .swal2-success-ring{height:2em;width:2em}.swal2-popup.swal2-toast .swal2-icon.swal2-error [class^=swal2-x-mark-line]{top:.875em;width:1.375em}.swal2-popup.swal2-toast .swal2-icon.swal2-error [class^=swal2-x-mark-line][class$=left]{left:.3125em}.swal2-popup.swal2-toast .swal2-icon.swal2-error [class^=swal2-x-mark-line][class$=right]{right:.3125em}.swal2-popup.swal2-toast .swal2-actions{height:auto;justify-content:flex-start;margin:.5em 0 0;padding:0 .5em}.swal2-popup.swal2-toast .swal2-styled{font-size:1em;margin:.25em .5em;padding:.4em .6em}.swal2-popup.swal2-toast .swal2-success{border-color:#a5dc86}.swal2-popup.swal2-toast .swal2-success [class^=swal2-success-circular-line]{border-radius:50%;height:3em;position:absolute;width:1.6em}.swal2-popup.swal2-toast .swal2-success [class^=swal2-success-circular-line][class$=left]{border-radius:4em 0 0 4em;left:-.5em;top:-.8em;transform:rotate(-45deg);transform-origin:2em 2em}.swal2-popup.swal2-toast .swal2-success [class^=swal2-success-circular-line][class$=right]{border-radius:0 4em 4em 0;left:.9375em;top:-.25em;transform-origin:0 1.5em}.swal2-popup.swal2-toast .swal2-success .swal2-success-ring{height:2em;width:2em}.swal2-popup.swal2-toast .swal2-success .swal2-success-fix{height:2.6875em;left:.4375em;top:0;width:.4375em}.swal2-popup.swal2-toast .swal2-success [class^=swal2-success-line]{height:.3125em}.swal2-popup.swal2-toast .swal2-success [class^=swal2-success-line][class$=tip]{left:.1875em;top:1.125em;width:.75em}.swal2-popup.swal2-toast .swal2-success [class^=swal2-success-line][class$=long]{right:.1875em;top:.9375em;width:1.375em}.swal2-popup.swal2-toast .swal2-success.swal2-icon-show .swal2-success-line-tip{animation:swal2-toast-animate-success-line-tip .75s}.swal2-popup.swal2-toast .swal2-success.swal2-icon-show .swal2-success-line-long{animation:swal2-toast-animate-success-line-long .75s}.swal2-popup.swal2-toast.swal2-show{animation:swal2-toast-show .5s}.swal2-popup.swal2-toast.swal2-hide{animation:swal2-toast-hide .1s forwards}div:where(.swal2-container){box-sizing:border-box;display:grid;grid-template-areas:"top-start top top-end" "center-start center center-end" "bottom-start bottom-center bottom-end";grid-template-rows:minmax(min-content,auto) minmax(min-content,auto) minmax(min-content,auto);height:100%;inset:0;overflow-x:hidden;padding:.625em;position:fixed;transition:background-color .1s;z-index:1060;-webkit-overflow-scrolling:touch}div:where(.swal2-container).swal2-backdrop-show,div:where(.swal2-container).swal2-noanimation{background:rgba(0,0,0,.4)}div:where(.swal2-container).swal2-backdrop-hide{background:transparent!important}div:where(.swal2-container).swal2-bottom-start,div:where(.swal2-container).swal2-center-start,div:where(.swal2-container).swal2-top-start{grid-template-columns:minmax(0,1fr) auto auto}div:where(.swal2-container).swal2-bottom,div:where(.swal2-container).swal2-center,div:where(.swal2-container).swal2-top{grid-template-columns:auto minmax(0,1fr) auto}div:where(.swal2-container).swal2-bottom-end,div:where(.swal2-container).swal2-center-end,div:where(.swal2-container).swal2-top-end{grid-template-columns:auto auto minmax(0,1fr)}div:where(.swal2-container).swal2-top-start>.swal2-popup{align-self:start}div:where(.swal2-container).swal2-top>.swal2-popup{grid-column:2;place-self:start center}div:where(.swal2-container).swal2-top-end>.swal2-popup,div:where(.swal2-container).swal2-top-right>.swal2-popup{grid-column:3;place-self:start end}div:where(.swal2-container).swal2-center-left>.swal2-popup,div:where(.swal2-container).swal2-center-start>.swal2-popup{align-self:center;grid-row:2}div:where(.swal2-container).swal2-center>.swal2-popup{grid-column:2;grid-row:2;place-self:center center}div:where(.swal2-container).swal2-center-end>.swal2-popup,div:where(.swal2-container).swal2-center-right>.swal2-popup{grid-column:3;grid-row:2;place-self:center end}div:where(.swal2-container).swal2-bottom-left>.swal2-popup,div:where(.swal2-container).swal2-bottom-start>.swal2-popup{align-self:end;grid-column:1;grid-row:3}div:where(.swal2-container).swal2-bottom>.swal2-popup{grid-column:2;grid-row:3;place-self:end center}div:where(.swal2-container).swal2-bottom-end>.swal2-popup,div:where(.swal2-container).swal2-bottom-right>.swal2-popup{grid-column:3;grid-row:3;place-self:end end}div:where(.swal2-container).swal2-grow-fullscreen>.swal2-popup,div:where(.swal2-container).swal2-grow-row>.swal2-popup{grid-column:1/4;width:100%}div:where(.swal2-container).swal2-grow-column>.swal2-popup,div:where(.swal2-container).swal2-grow-fullscreen>.swal2-popup{align-self:stretch;grid-row:1/4}div:where(.swal2-container).swal2-no-transition{transition:none!important}div:where(.swal2-container) div:where(.swal2-popup){background:#fff;border:none;border-radius:5px;box-sizing:border-box;color:#545454;display:none;font-family:inherit;font-size:1rem;grid-template-columns:minmax(0,100%);max-width:100%;padding:0 0 1.25em;position:relative;width:32em}div:where(.swal2-container) div:where(.swal2-popup):focus{outline:none}div:where(.swal2-container) div:where(.swal2-popup).swal2-loading{overflow-y:hidden}div:where(.swal2-container) h2:where(.swal2-title){color:inherit;font-size:1.875em;font-weight:600;margin:0;max-width:100%;padding:.8em 1em 0;position:relative;text-align:center;text-transform:none;word-wrap:break-word}div:where(.swal2-container) div:where(.swal2-actions){align-items:center;box-sizing:border-box;display:flex;flex-wrap:wrap;justify-content:center;margin:1.25em auto 0;padding:0;width:auto;z-index:1}div:where(.swal2-container) div:where(.swal2-actions):not(.swal2-loading) .swal2-styled[disabled]{opacity:.4}div:where(.swal2-container) div:where(.swal2-actions):not(.swal2-loading) .swal2-styled:hover{background-image:linear-gradient(rgba(0,0,0,.1),rgba(0,0,0,.1))}div:where(.swal2-container) div:where(.swal2-actions):not(.swal2-loading) .swal2-styled:active{background-image:linear-gradient(rgba(0,0,0,.2),rgba(0,0,0,.2))}div:where(.swal2-container) div:where(.swal2-loader){align-items:center;animation:swal2-rotate-loading 1.5s linear 0s infinite normal;border-color:#2778c4 transparent;border-radius:100%;border-style:solid;border-width:.25em;display:none;height:2.2em;justify-content:center;margin:0 1.875em;width:2.2em}div:where(.swal2-container) button:where(.swal2-styled){box-shadow:0 0 0 3px transparent;font-weight:500;margin:.3125em;padding:.625em 1.1em;transition:box-shadow .1s}div:where(.swal2-container) button:where(.swal2-styled):not([disabled]){cursor:pointer}div:where(.swal2-container) button:where(.swal2-styled).swal2-confirm{background:initial;background-color:#7066e0;border:0;border-radius:.25em;color:#fff;font-size:1em}div:where(.swal2-container) button:where(.swal2-styled).swal2-confirm:focus{box-shadow:0 0 0 3px rgba(112,102,224,.5)}div:where(.swal2-container) button:where(.swal2-styled).swal2-deny{background:initial;background-color:#dc3741;border:0;border-radius:.25em;color:#fff;font-size:1em}div:where(.swal2-container) button:where(.swal2-styled).swal2-deny:focus{box-shadow:0 0 0 3px rgba(220,55,65,.5)}div:where(.swal2-container) button:where(.swal2-styled).swal2-cancel{background:initial;background-color:#6e7881;border:0;border-radius:.25em;color:#fff;font-size:1em}div:where(.swal2-container) button:where(.swal2-styled).swal2-cancel:focus{box-shadow:0 0 0 3px hsla(208,8%,47%,.5)}div:where(.swal2-container) button:where(.swal2-styled).swal2-default-outline:focus{box-shadow:0 0 0 3px rgba(100,150,200,.5)}div:where(.swal2-container) button:where(.swal2-styled):focus{outline:none}div:where(.swal2-container) button:where(.swal2-styled)::-moz-focus-inner{border:0}div:where(.swal2-container) div:where(.swal2-footer){border-top:1px solid #eee;color:inherit;font-size:1em;margin:1em 0 0;padding:1em 1em 0;text-align:center}div:where(.swal2-container) .swal2-timer-progress-bar-container{border-bottom-left-radius:5px;border-bottom-right-radius:5px;bottom:0;grid-column:auto!important;left:0;overflow:hidden;position:absolute;right:0}div:where(.swal2-container) div:where(.swal2-timer-progress-bar){background:rgba(0,0,0,.2);height:.25em;width:100%}div:where(.swal2-container) img:where(.swal2-image){margin:2em auto 1em;max-width:100%}div:where(.swal2-container) button:where(.swal2-close){align-items:center;background:transparent;border:none;border-radius:5px;color:#ccc;cursor:pointer;font-family:monospace;font-size:2.5em;height:1.2em;justify-content:center;justify-self:end;margin-bottom:-1.2em;margin-right:0;margin-top:0;overflow:hidden;padding:0;transition:color .1s,box-shadow .1s;width:1.2em;z-index:2}div:where(.swal2-container) button:where(.swal2-close):hover{background:transparent;color:#f27474;transform:none}div:where(.swal2-container) button:where(.swal2-close):focus{box-shadow:inset 0 0 0 3px rgba(100,150,200,.5);outline:none}div:where(.swal2-container) button:where(.swal2-close)::-moz-focus-inner{border:0}div:where(.swal2-container) .swal2-html-container{color:inherit;font-size:1.125em;font-weight:400;justify-content:center;line-height:normal;margin:1em 1.6em .3em;overflow:auto;padding:0;text-align:center;z-index:1;word-wrap:break-word;word-break:break-word}div:where(.swal2-container) div:where(.swal2-radio),div:where(.swal2-container) input:where(.swal2-file),div:where(.swal2-container) input:where(.swal2-input),div:where(.swal2-container) label:where(.swal2-checkbox),div:where(.swal2-container) select:where(.swal2-select),div:where(.swal2-container) textarea:where(.swal2-textarea){margin:1em 2em 3px}div:where(.swal2-container) input:where(.swal2-file),div:where(.swal2-container) input:where(.swal2-input),div:where(.swal2-container) textarea:where(.swal2-textarea){background:transparent;border:1px solid #d9d9d9;border-radius:.1875em;box-shadow:inset 0 1px 1px rgba(0,0,0,.06),0 0 0 3px transparent;box-sizing:border-box;color:inherit;font-size:1.125em;transition:border-color .1s,box-shadow .1s;width:auto}div:where(.swal2-container) input:where(.swal2-file).swal2-inputerror,div:where(.swal2-container) input:where(.swal2-input).swal2-inputerror,div:where(.swal2-container) textarea:where(.swal2-textarea).swal2-inputerror{border-color:#f27474!important;box-shadow:0 0 2px #f27474!important}div:where(.swal2-container) input:where(.swal2-file):focus,div:where(.swal2-container) input:where(.swal2-input):focus,div:where(.swal2-container) textarea:where(.swal2-textarea):focus{border:1px solid #b4dbed;box-shadow:inset 0 1px 1px rgba(0,0,0,.06),0 0 0 3px rgba(100,150,200,.5);outline:none}div:where(.swal2-container) input:where(.swal2-file)::-moz-placeholder,div:where(.swal2-container) input:where(.swal2-input)::-moz-placeholder,div:where(.swal2-container) textarea:where(.swal2-textarea)::-moz-placeholder{color:#ccc}div:where(.swal2-container) input:where(.swal2-file)::placeholder,div:where(.swal2-container) input:where(.swal2-input)::placeholder,div:where(.swal2-container) textarea:where(.swal2-textarea)::placeholder{color:#ccc}div:where(.swal2-container) .swal2-range{background:#fff;margin:1em 2em 3px}div:where(.swal2-container) .swal2-range input{width:80%}div:where(.swal2-container) .swal2-range output{color:inherit;font-weight:600;text-align:center;width:20%}div:where(.swal2-container) .swal2-range input,div:where(.swal2-container) .swal2-range output{font-size:1.125em;height:2.625em;line-height:2.625em;padding:0}div:where(.swal2-container) .swal2-input{height:2.625em;padding:0 .75em}div:where(.swal2-container) .swal2-file{background:transparent;font-size:1.125em;margin-left:auto;margin-right:auto;width:75%}div:where(.swal2-container) .swal2-textarea{height:6.75em;padding:.75em}div:where(.swal2-container) .swal2-select{background:transparent;color:inherit;font-size:1.125em;max-width:100%;min-width:50%;padding:.375em .625em}div:where(.swal2-container) .swal2-checkbox,div:where(.swal2-container) .swal2-radio{align-items:center;background:#fff;color:inherit;justify-content:center}div:where(.swal2-container) .swal2-checkbox label,div:where(.swal2-container) .swal2-radio label{font-size:1.125em;margin:0 .6em}div:where(.swal2-container) .swal2-checkbox input,div:where(.swal2-container) .swal2-radio input{flex-shrink:0;margin:0 .4em}div:where(.swal2-container) label:where(.swal2-input-label){display:flex;justify-content:center;margin:1em auto 0}div:where(.swal2-container) div:where(.swal2-validation-message){align-items:center;background:#f0f0f0;color:#666;font-size:1em;font-weight:300;justify-content:center;margin:1em 0 0;overflow:hidden;padding:.625em}div:where(.swal2-container) div:where(.swal2-validation-message):before{background-color:#f27474;border-radius:50%;color:#fff;content:"!";display:inline-block;font-weight:600;height:1.5em;line-height:1.5em;margin:0 .625em;min-width:1.5em;text-align:center;width:1.5em}div:where(.swal2-container) .swal2-progress-steps{align-items:center;background:transparent;flex-wrap:wrap;font-weight:600;margin:1.25em auto;max-width:100%;padding:0}div:where(.swal2-container) .swal2-progress-steps li{display:inline-block;position:relative}div:where(.swal2-container) .swal2-progress-steps .swal2-progress-step{background:#2778c4;border-radius:2em;color:#fff;flex-shrink:0;height:2em;line-height:2em;text-align:center;width:2em;z-index:20}div:where(.swal2-container) .swal2-progress-steps .swal2-progress-step.swal2-active-progress-step{background:#2778c4}div:where(.swal2-container) .swal2-progress-steps .swal2-progress-step.swal2-active-progress-step~.swal2-progress-step{background:#add8e6;color:#fff}div:where(.swal2-container) .swal2-progress-steps .swal2-progress-step.swal2-active-progress-step~.swal2-progress-step-line{background:#add8e6}div:where(.swal2-container) .swal2-progress-steps .swal2-progress-step-line{background:#2778c4;flex-shrink:0;height:.4em;margin:0 -1px;width:2.5em;z-index:10}div:where(.swal2-icon){border:.25em solid #000;border-radius:50%;box-sizing:content-box;cursor:default;font-family:inherit;height:5em;justify-content:center;line-height:5em;margin:2.5em auto .6em;position:relative;-webkit-user-select:none;-moz-user-select:none;user-select:none;width:5em}div:where(.swal2-icon) .swal2-icon-content{align-items:center;display:flex;font-size:3.75em}div:where(.swal2-icon).swal2-error{border-color:#f27474;color:#f27474}div:where(.swal2-icon).swal2-error .swal2-x-mark{flex-grow:1;position:relative}div:where(.swal2-icon).swal2-error [class^=swal2-x-mark-line]{background-color:#f27474;border-radius:.125em;display:block;height:.3125em;position:absolute;top:2.3125em;width:2.9375em}div:where(.swal2-icon).swal2-error [class^=swal2-x-mark-line][class$=left]{left:1.0625em;transform:rotate(45deg)}div:where(.swal2-icon).swal2-error [class^=swal2-x-mark-line][class$=right]{right:1em;transform:rotate(-45deg)}div:where(.swal2-icon).swal2-error.swal2-icon-show{animation:swal2-animate-error-icon .5s}div:where(.swal2-icon).swal2-error.swal2-icon-show .swal2-x-mark{animation:swal2-animate-error-x-mark .5s}div:where(.swal2-icon).swal2-warning{border-color:#facea8;color:#f8bb86}div:where(.swal2-icon).swal2-warning.swal2-icon-show{animation:swal2-animate-error-icon .5s}div:where(.swal2-icon).swal2-warning.swal2-icon-show .swal2-icon-content{animation:swal2-animate-i-mark .5s}div:where(.swal2-icon).swal2-info{border-color:#9de0f6;color:#3fc3ee}div:where(.swal2-icon).swal2-info.swal2-icon-show{animation:swal2-animate-error-icon .5s}div:where(.swal2-icon).swal2-info.swal2-icon-show .swal2-icon-content{animation:swal2-animate-i-mark .8s}div:where(.swal2-icon).swal2-question{border-color:#c9dae1;color:#87adbd}div:where(.swal2-icon).swal2-question.swal2-icon-show{animation:swal2-animate-error-icon .5s}div:where(.swal2-icon).swal2-question.swal2-icon-show .swal2-icon-content{animation:swal2-animate-question-mark .8s}div:where(.swal2-icon).swal2-success{border-color:#a5dc86;color:#a5dc86}div:where(.swal2-icon).swal2-success [class^=swal2-success-circular-line]{border-radius:50%;height:7.5em;position:absolute;width:3.75em}div:where(.swal2-icon).swal2-success [class^=swal2-success-circular-line][class$=left]{border-radius:7.5em 0 0 7.5em;left:-2.0635em;top:-.4375em;transform:rotate(-45deg);transform-origin:3.75em 3.75em}div:where(.swal2-icon).swal2-success [class^=swal2-success-circular-line][class$=right]{border-radius:0 7.5em 7.5em 0;left:1.875em;top:-.6875em;transform:rotate(-45deg);transform-origin:0 3.75em}div:where(.swal2-icon).swal2-success .swal2-success-ring{border:.25em solid hsla(98,55%,69%,.3);border-radius:50%;box-sizing:content-box;height:100%;left:-.25em;position:absolute;top:-.25em;width:100%;z-index:2}div:where(.swal2-icon).swal2-success .swal2-success-fix{height:5.625em;left:1.625em;position:absolute;top:.5em;transform:rotate(-45deg);width:.4375em;z-index:1}div:where(.swal2-icon).swal2-success [class^=swal2-success-line]{background-color:#a5dc86;border-radius:.125em;display:block;height:.3125em;position:absolute;z-index:2}div:where(.swal2-icon).swal2-success [class^=swal2-success-line][class$=tip]{left:.8125em;top:2.875em;transform:rotate(45deg);width:1.5625em}div:where(.swal2-icon).swal2-success [class^=swal2-success-line][class$=long]{right:.5em;top:2.375em;transform:rotate(-45deg);width:2.9375em}div:where(.swal2-icon).swal2-success.swal2-icon-show .swal2-success-line-tip{animation:swal2-animate-success-line-tip .75s}div:where(.swal2-icon).swal2-success.swal2-icon-show .swal2-success-line-long{animation:swal2-animate-success-line-long .75s}div:where(.swal2-icon).swal2-success.swal2-icon-show .swal2-success-circular-line-right{animation:swal2-rotate-success-circular-line 4.25s ease-in}[class^=swal2]{-webkit-tap-highlight-color:rgba(0,0,0,0)}.swal2-show{animation:swal2-show .3s}.swal2-hide{animation:swal2-hide .15s forwards}.swal2-noanimation{transition:none}.swal2-scrollbar-measure{height:50px;overflow:scroll;position:absolute;top:-9999px;width:50px}.swal2-rtl .swal2-close{margin-left:0;margin-right:0}.swal2-rtl .swal2-timer-progress-bar{left:auto;right:0}@keyframes swal2-toast-show{0%{transform:translateY(-.625em) rotate(2deg)}33%{transform:translateY(0) rotate(-2deg)}66%{transform:translateY(.3125em) rotate(2deg)}to{transform:translateY(0) rotate(0deg)}}@keyframes swal2-toast-hide{to{opacity:0;transform:rotate(1deg)}}@keyframes swal2-toast-animate-success-line-tip{0%{left:.0625em;top:.5625em;width:0}54%{left:.125em;top:.125em;width:0}70%{left:-.25em;top:.625em;width:1.625em}84%{left:.75em;top:1.0625em;width:.5em}to{left:.1875em;top:1.125em;width:.75em}}@keyframes swal2-toast-animate-success-line-long{0%{right:1.375em;top:1.625em;width:0}65%{right:.9375em;top:1.25em;width:0}84%{right:0;top:.9375em;width:1.125em}to{right:.1875em;top:.9375em;width:1.375em}}@keyframes swal2-show{0%{transform:scale(.7)}45%{transform:scale(1.05)}80%{transform:scale(.95)}to{transform:scale(1)}}@keyframes swal2-hide{0%{opacity:1;transform:scale(1)}to{opacity:0;transform:scale(.5)}}@keyframes swal2-animate-success-line-tip{0%{left:.0625em;top:1.1875em;width:0}54%{left:.125em;top:1.0625em;width:0}70%{left:-.375em;top:2.1875em;width:3.125em}84%{left:1.3125em;top:3em;width:1.0625em}to{left:.8125em;top:2.8125em;width:1.5625em}}@keyframes swal2-animate-success-line-long{0%{right:2.875em;top:3.375em;width:0}65%{right:2.875em;top:3.375em;width:0}84%{right:0;top:2.1875em;width:3.4375em}to{right:.5em;top:2.375em;width:2.9375em}}@keyframes swal2-rotate-success-circular-line{0%{transform:rotate(-45deg)}5%{transform:rotate(-45deg)}12%{transform:rotate(-405deg)}to{transform:rotate(-405deg)}}@keyframes swal2-animate-error-x-mark{0%{margin-top:1.625em;opacity:0;transform:scale(.4)}50%{margin-top:1.625em;opacity:0;transform:scale(.4)}80%{margin-top:-.375em;transform:scale(1.15)}to{margin-top:0;opacity:1;transform:scale(1)}}@keyframes swal2-animate-error-icon{0%{opacity:0;transform:rotateX(100deg)}to{opacity:1;transform:rotateX(0deg)}}@keyframes swal2-rotate-loading{0%{transform:rotate(0deg)}to{transform:rotate(1turn)}}@keyframes swal2-animate-question-mark{0%{transform:rotateY(-1turn)}to{transform:rotateY(0)}}@keyframes swal2-animate-i-mark{0%{opacity:0;transform:rotate(45deg)}25%{opacity:.4;transform:rotate(-25deg)}50%{opacity:.8;transform:rotate(15deg)}75%{opacity:1;transform:rotate(-5deg)}to{opacity:1;transform:rotateX(0)}}body.swal2-shown:not(.swal2-no-backdrop):not(.swal2-toast-shown){overflow:hidden}body.swal2-height-auto{height:auto!important}body.swal2-no-backdrop .swal2-container{background-color:transparent!important;pointer-events:none}body.swal2-no-backdrop .swal2-container .swal2-popup{pointer-events:all}body.swal2-no-backdrop .swal2-container .swal2-modal{box-shadow:0 0 10px rgba(0,0,0,.4)}@media print{body.swal2-shown:not(.swal2-no-backdrop):not(.swal2-toast-shown){overflow-y:scroll!important}body.swal2-shown:not(.swal2-no-backdrop):not(.swal2-toast-shown)>[aria-hidden=true]{display:none}body.swal2-shown:not(.swal2-no-backdrop):not(.swal2-toast-shown) .swal2-container{position:static!important}}body.swal2-toast-shown .swal2-container{background-color:transparent;box-sizing:border-box;max-width:100%;pointer-events:none;width:360px}body.swal2-toast-shown .swal2-container.swal2-top{inset:0 auto auto 50%;transform:translateX(-50%)}body.swal2-toast-shown .swal2-container.swal2-top-end,body.swal2-toast-shown .swal2-container.swal2-top-right{inset:0 0 auto auto}body.swal2-toast-shown .swal2-container.swal2-top-left,body.swal2-toast-shown .swal2-container.swal2-top-start{inset:0 auto auto 0}body.swal2-toast-shown .swal2-container.swal2-center-left,body.swal2-toast-shown .swal2-container.swal2-center-start{inset:50% auto auto 0;transform:translateY(-50%)}body.swal2-toast-shown .swal2-container.swal2-center{inset:50% auto auto 50%;transform:translate(-50%,-50%)}body.swal2-toast-shown .swal2-container.swal2-center-end,body.swal2-toast-shown .swal2-container.swal2-center-right{inset:50% 0 auto auto;transform:translateY(-50%)}body.swal2-toast-shown .swal2-container.swal2-bottom-left,body.swal2-toast-shown .swal2-container.swal2-bottom-start{inset:auto auto 0 0}body.swal2-toast-shown .swal2-container.swal2-bottom{inset:auto auto 0 50%;transform:translateX(-50%)}body.swal2-toast-shown .swal2-container.swal2-bottom-end,body.swal2-toast-shown .swal2-container.swal2-bottom-right{inset:auto 0 0 auto}',"",{version:3,sources:["webpack://./node_modules/sweetalert2/src/scss/_toasts.scss","webpack://./node_modules/sweetalert2/src/variables.scss","webpack://./node_modules/sweetalert2/src/scss/_core.scss","webpack://./node_modules/sweetalert2/src/scss/_icons.scss","webpack://./node_modules/sweetalert2/src/scss/_toasts-animations.scss","webpack://./node_modules/sweetalert2/src/scss/_animations.scss","webpack://./node_modules/sweetalert2/src/scss/_mixins.scss","webpack://./node_modules/sweetalert2/src/scss/_body.scss","webpack://./node_modules/sweetalert2/src/scss/_toasts-body.scss"],names:[],mappings:"AACE,yBAOE,eCRU,CDSV,sJCqOF,CD5OE,qBAAA,CACA,yBAAA,CACA,sBAAA,CACA,kDAAA,CAEA,iBAAA,CADA,WCmPkB,CD/OlB,kBAAA,CAEA,2BACE,aAAA,CAGF,sCAGE,aCyOwB,CD3OxB,eCyOqB,CDxOrB,SCyOsB,CDvOtB,kBAAA,CAGF,wCACE,sBAAA,CAGF,sCAGE,aCqOwB,CDvOxB,UCqOqB,CDpOrB,WCsOwB,CDlO1B,mDACE,aCkO6B,CD/N/B,uCAGE,cCgOyB,CDlOzB,eCgOsB,CD/NtB,gBCiOyB,CD7N3B,sCAGE,iBAAA,CAIA,aCqM+B,CD3M/B,eAAA,CACA,aAAA,CAGA,WCqM4B,CDpM5B,QCqM4B,CDvM5B,UCwM+B,CDlMjC,+CAIE,aCuMiC,CD1MjC,eCwM8B,CDtM9B,gBAAA,CADA,SCwM+B,CDrM/B,kBAAA,CAEA,qDACE,SAAA,CAIJ,uCAGE,iBAAA,CAFA,aAAA,CACA,aAAA,CAGA,UAAA,CACA,YAAA,CAFA,SAEA,CAGF,qCAGE,iBAAA,CAFA,aAAA,CACA,aAAA,CAIA,UAAA,CACA,iBAAA,CAFA,aAAA,CADA,SAGA,CAEA,yDAEE,kBAAA,CADA,YAAA,CAEA,eCuKqB,CDtKrB,eAAA,CAIA,uEAEE,UAAA,CADA,SACA,CAKF,4EACE,UAAA,CACA,aAAA,CAEA,yFACE,YAAA,CAGF,0FACE,aAAA,CAMR,wCAEE,WAAA,CADA,0BAAA,CAGA,eAAA,CACA,cAAA,CAGF,uCAGE,aCyI0B,CD3I1B,iBAAA,CACA,iBC0I0B,CDtI5B,wCACE,oBC1FU,CD4FV,6EAKE,iBAAA,CADA,UAAA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AAA,CAAA,CCpCN,wCAIE,4BAAA,CAHA,qBAAA,CAEA,cAAA,CAEA,mBAAA,CAHA,WAGA,CAEA,kDACE,qBAAA,CACA,0BAAA,CAGF,8GAEE,mBAAA,CAGF,+GAEE,mBAAA,CAGF,qHAEE,qBAAA,CACA,0BAAA,CAGF,qDACE,uBAAA,CACA,8BAAA,CAGF,oHAEE,qBAAA,CACA,0BAAA,CAGF,qHAEE,mBAAA,CAGF,qDACE,qBAAA,CACA,0BAAA,CAGF,oHAEE,mBAAA",sourcesContent:[".swal2-popup {\n &.swal2-toast {\n box-sizing: border-box;\n grid-column: 1/4 !important;\n grid-row: 1/4 !important;\n grid-template-columns: min-content auto min-content;\n padding: $swal2-toast-padding;\n overflow-y: hidden;\n background: $swal2-toast-background;\n box-shadow: $swal2-toast-box-shadow;\n pointer-events: all;\n\n > * {\n grid-column: 2;\n }\n\n .swal2-title {\n margin: $swal2-toast-title-margin;\n padding: $swal2-toast-title-padding;\n font-size: $swal2-toast-title-font-size;\n text-align: initial;\n }\n\n .swal2-loading {\n justify-content: center;\n }\n\n .swal2-input {\n height: $swal2-toast-input-height;\n margin: $swal2-toast-input-margin;\n font-size: $swal2-toast-input-font-size;\n }\n\n .swal2-validation-message {\n font-size: $swal2-toast-validation-font-size;\n }\n\n .swal2-footer {\n margin: $swal2-toast-footer-margin;\n padding: $swal2-toast-footer-margin;\n font-size: $swal2-toast-footer-font-size;\n }\n\n .swal2-close {\n grid-column: 3/3;\n grid-row: 1/99;\n align-self: center;\n width: $swal2-toast-close-button-width;\n height: $swal2-toast-close-button-height;\n margin: $swal2-toast-close-button-margin;\n font-size: $swal2-toast-close-button-font-size;\n }\n\n .swal2-html-container {\n margin: $swal2-toast-html-container-margin;\n padding: $swal2-toast-html-container-padding;\n overflow: initial;\n font-size: $swal2-toast-html-container-font-size;\n text-align: initial;\n\n &:empty {\n padding: 0;\n }\n }\n\n .swal2-loader {\n grid-column: 1;\n grid-row: 1/99;\n align-self: center;\n width: 2em;\n height: 2em;\n margin: 0.25em;\n }\n\n .swal2-icon {\n grid-column: 1;\n grid-row: 1/99;\n align-self: center;\n width: 2em;\n min-width: 2em;\n height: 2em;\n margin: 0 0.5em 0 0;\n\n .swal2-icon-content {\n display: flex;\n align-items: center;\n font-size: $swal2-toast-icon-font-size;\n font-weight: bold;\n }\n\n &.swal2-success {\n .swal2-success-ring {\n width: 2em;\n height: 2em;\n }\n }\n\n &.swal2-error {\n [class^='swal2-x-mark-line'] {\n top: 0.875em;\n width: 1.375em;\n\n &[class$='left'] {\n left: 0.3125em;\n }\n\n &[class$='right'] {\n right: 0.3125em;\n }\n }\n }\n }\n\n .swal2-actions {\n justify-content: flex-start;\n height: auto;\n margin: 0;\n margin-top: 0.5em;\n padding: 0 0.5em;\n }\n\n .swal2-styled {\n margin: 0.25em 0.5em;\n padding: 0.4em 0.6em;\n font-size: $swal2-toast-buttons-font-size;\n }\n\n .swal2-success {\n border-color: $swal2-success;\n\n [class^='swal2-success-circular-line'] {\n // Emulate moving circular line\n position: absolute;\n width: 1.6em;\n height: 3em;\n border-radius: 50%;\n\n &[class$='left'] {\n top: -0.8em;\n left: -0.5em;\n transform: rotate(-45deg);\n transform-origin: 2em 2em;\n border-radius: 4em 0 0 4em;\n }\n\n &[class$='right'] {\n top: -0.25em;\n left: 0.9375em;\n transform-origin: 0 1.5em;\n border-radius: 0 4em 4em 0;\n }\n }\n\n .swal2-success-ring {\n width: 2em;\n height: 2em;\n }\n\n .swal2-success-fix {\n top: 0;\n left: 0.4375em;\n width: 0.4375em;\n height: 2.6875em;\n }\n\n [class^='swal2-success-line'] {\n height: 0.3125em;\n\n &[class$='tip'] {\n top: 1.125em;\n left: 0.1875em;\n width: 0.75em;\n }\n\n &[class$='long'] {\n top: 0.9375em;\n right: 0.1875em;\n width: 1.375em;\n }\n }\n\n &.swal2-icon-show {\n @if $swal2-icon-animations {\n .swal2-success-line-tip {\n animation: swal2-toast-animate-success-line-tip 0.75s;\n }\n\n .swal2-success-line-long {\n animation: swal2-toast-animate-success-line-long 0.75s;\n }\n }\n }\n }\n\n &.swal2-show {\n animation: $swal2-toast-show-animation;\n }\n\n &.swal2-hide {\n animation: $swal2-toast-hide-animation;\n }\n }\n}\n","$swal2-white: #fff !default;\n$swal2-black: #000 !default;\n$swal2-outline-color: rgba(100, 150, 200, 0.5) !default;\n\n// CONTAINER\n$swal2-container-padding: 0.625em !default;\n\n// POPUP\n$swal2-width: 32em !default;\n$swal2-padding: 0 0 1.25em !default;\n$swal2-border: none !default;\n$swal2-color: lighten($swal2-black, 33) !default;\n$swal2-border-radius: 5px !default;\n$swal2-box-shadow: #d9d9d9 !default;\n\n// ANIMATIONS\n$swal2-show-animation: swal2-show 0.3s !default;\n$swal2-hide-animation: swal2-hide 0.15s forwards !default;\n\n// BACKGROUND\n$swal2-background: $swal2-white !default;\n\n// TYPOGRAPHY\n$swal2-font: inherit !default;\n$swal2-font-size: 1rem !default;\n\n// BACKDROP\n$swal2-backdrop: rgba($swal2-black, 0.4) !default;\n$swal2-backdrop-transition: background-color 0.1s !default;\n\n// ICONS\n$swal2-icon-size: 5em !default;\n$swal2-icon-animations: true !default;\n$swal2-icon-margin: 2.5em auto 0.6em !default;\n$swal2-icon-font-family: inherit !default;\n$swal2-icon-font-size: 3.75em !default;\n$swal2-icon-border-color: #000 !default;\n$swal2-icon-zoom: null !default;\n$swal2-success: #a5dc86 !default;\n$swal2-success-border: rgba($swal2-success, 0.3) !default;\n$swal2-error: #f27474 !default;\n$swal2-warning: #f8bb86 !default;\n$swal2-info: #3fc3ee !default;\n$swal2-question: #87adbd !default;\n\n// IMAGE\n$swal2-image-margin: 2em auto 1em !default;\n\n// TITLE\n$swal2-title-position: relative !default;\n$swal2-title-max-width: 100% !default;\n$swal2-title-margin: 0 !default;\n$swal2-title-padding: 0.8em 1em 0 !default;\n$swal2-title-color: inherit !default;\n$swal2-title-font-size: 1.875em !default;\n$swal2-title-font-weight: 600 !default;\n$swal2-title-text-align: center !default;\n\n// HTML CONTAINER\n$swal2-html-container-justify-content: center !default;\n$swal2-html-container-margin: 1em 1.6em 0.3em !default;\n$swal2-html-container-padding: 0 !default;\n$swal2-html-container-overflow: auto !default;\n$swal2-html-container-color: inherit !default;\n$swal2-html-container-font-size: 1.125em !default;\n$swal2-html-container-font-weight: normal !default;\n$swal2-html-container-line-height: normal !default;\n$swal2-html-container-text-align: center !default;\n$swal2-html-container-word-wrap: break-word !default;\n$swal2-html-container-word-break: break-word !default;\n\n// INPUT\n$swal2-input-margin: 1em 2em 3px !default;\n$swal2-input-width: auto !default;\n$swal2-input-height: 2.625em !default;\n$swal2-input-padding: 0 0.75em !default;\n$swal2-input-border: 1px solid lighten($swal2-black, 85) !default;\n$swal2-input-border-radius: 0.1875em !default;\n$swal2-input-box-shadow:\n inset 0 1px 1px rgba($swal2-black, 0.06),\n 0 0 0 3px transparent !default;\n$swal2-input-font-size: 1.125em !default;\n$swal2-input-background: transparent !default;\n$swal2-input-color: inherit !default;\n$swal2-input-transition:\n border-color 0.1s,\n box-shadow 0.1s !default;\n\n// INPUT:FOCUS\n$swal2-input-focus-border: 1px solid #b4dbed !default;\n$swal2-input-focus-outline: none !default;\n$swal2-input-focus-box-shadow:\n inset 0 1px 1px rgba($swal2-black, 0.06),\n 0 0 0 3px $swal2-outline-color !default;\n\n// TEXTAREA SPECIFIC VARIABLES\n$swal2-textarea-height: 6.75em !default;\n$swal2-textarea-padding: 0.75em !default;\n\n// INPUT LABEL\n$swal2-input-label-margin: 1em auto 0 !default;\n$swal2-input-label-justify-content: center !default;\n\n// VALIDATION MESSAGE\n$swal2-validation-message-align-items: center !default;\n$swal2-validation-message-justify-content: center !default;\n$swal2-validation-message-margin: 1em 0 0 !default;\n$swal2-validation-message-padding: 0.625em !default;\n$swal2-validation-message-background: lighten($swal2-black, 94) !default;\n$swal2-validation-message-color: lighten($swal2-black, 40) !default;\n$swal2-validation-message-font-size: 1em !default;\n$swal2-validation-message-font-weight: 300 !default;\n$swal2-validation-message-icon-background: $swal2-error !default;\n$swal2-validation-message-icon-color: $swal2-white !default;\n$swal2-validation-message-icon-zoom: null !default;\n\n// PROGRESS STEPS\n$swal2-progress-steps-flex-wrap: wrap !default;\n$swal2-progress-steps-align-items: center !default;\n$swal2-progress-steps-max-width: 100% !default;\n$swal2-progress-steps-background: transparent !default;\n$swal2-progress-steps-margin: 1.25em auto !default;\n$swal2-progress-steps-padding: 0 !default;\n$swal2-progress-steps-font-weight: 600 !default;\n$swal2-progress-steps-distance: 2.5em !default;\n$swal2-progress-step-width: 2em;\n$swal2-progress-step-height: 2em;\n$swal2-progress-step-border-radius: 2em;\n$swal2-progress-step-background: #add8e6 !default;\n$swal2-progress-step-color: $swal2-white !default;\n$swal2-active-step-background: #2778c4 !default;\n$swal2-active-step-color: $swal2-white !default;\n\n// FOOTER\n$swal2-footer-margin: 1em 0 0 !default;\n$swal2-footer-padding: 1em 1em 0 !default;\n$swal2-footer-border-color: #eee !default;\n$swal2-footer-color: inherit !default;\n$swal2-footer-font-size: 1em !default;\n$swal2-footer-text-align: center !default;\n\n// TIMER PROGRESS BAR\n$swal2-timer-progress-bar-height: 0.25em;\n$swal2-timer-progress-bar-background: rgba($swal2-black, 0.2) !default;\n\n// CLOSE BUTTON\n$swal2-close-button-justify-self: end !default;\n$swal2-close-button-align-items: center !default;\n$swal2-close-button-justify-content: center !default;\n$swal2-close-button-width: 1.2em !default;\n$swal2-close-button-height: 1.2em !default;\n$swal2-close-button-position: null !default;\n$swal2-close-button-gap: 0 !default;\n$swal2-close-button-padding: 0 !default;\n$swal2-close-button-transition:\n color 0.1s,\n box-shadow 0.1s !default;\n$swal2-close-button-border: none !default;\n$swal2-close-button-border-radius: $swal2-border-radius !default;\n$swal2-close-button-outline: null !default;\n$swal2-close-button-background: transparent !default;\n$swal2-close-button-color: #ccc !default;\n$swal2-close-button-font-family: monospace !default;\n$swal2-close-button-font-size: 2.5em !default;\n$swal2-close-button-box-shadow: inset 0 0 0 3px transparent !default;\n\n// CLOSE BUTTON:HOVER\n$swal2-close-button-hover-transform: none !default;\n$swal2-close-button-hover-color: $swal2-error !default;\n$swal2-close-button-hover-background: transparent !default;\n\n// CLOSE BUTTON:FOCUS\n$swal2-close-button-focus-outline: none !default;\n$swal2-close-button-focus-box-shadow: inset 0 0 0 3px $swal2-outline-color !default;\n\n// ACTIONS\n$swal2-actions-flex-wrap: wrap !default;\n$swal2-actions-align-items: center !default;\n$swal2-actions-justify-content: center !default;\n$swal2-actions-width: auto !default;\n$swal2-actions-margin: 1.25em auto 0 !default;\n$swal2-actions-padding: 0 !default;\n\n// COMMON VARIABLES FOR ALL ACTION BUTTONS\n$swal2-button-margin: 0.3125em !default;\n$swal2-button-padding: 0.625em 1.1em !default;\n$swal2-button-transition: box-shadow 0.1s !default;\n$swal2-button-box-shadow: 0 0 0 3px transparent !default;\n$swal2-button-font-weight: 500 !default;\n$swal2-button-darken-hover: rgba($swal2-black, 0.1) !default;\n$swal2-button-darken-active: rgba($swal2-black, 0.2) !default;\n$swal2-button-focus-outline: none !default;\n$swal2-button-focus-box-shadow: 0 0 0 3px $swal2-outline-color !default;\n\n// CONFIRM BUTTON\n$swal2-confirm-button-order: null !default;\n$swal2-confirm-button-border: 0 !default;\n$swal2-confirm-button-border-radius: 0.25em !default;\n$swal2-confirm-button-background-color: #7066e0 !default;\n$swal2-confirm-button-color: $swal2-white !default;\n$swal2-confirm-button-font-size: 1em !default;\n$swal2-confirm-button-focus-box-shadow: 0 0 0 3px rgba($swal2-confirm-button-background-color, 0.5) !default;\n\n// DENY BUTTON\n$swal2-deny-button-order: null !default;\n$swal2-deny-button-border: 0 !default;\n$swal2-deny-button-border-radius: 0.25em !default;\n$swal2-deny-button-background-color: #dc3741 !default;\n$swal2-deny-button-color: $swal2-white !default;\n$swal2-deny-button-font-size: 1em !default;\n$swal2-deny-button-focus-box-shadow: 0 0 0 3px rgba($swal2-deny-button-background-color, 0.5) !default;\n\n// CANCEL BUTTON\n$swal2-cancel-button-order: null !default;\n$swal2-cancel-button-border: 0 !default;\n$swal2-cancel-button-border-radius: 0.25em !default;\n$swal2-cancel-button-background-color: #6e7881 !default;\n$swal2-cancel-button-color: $swal2-white !default;\n$swal2-cancel-button-font-size: 1em !default;\n$swal2-cancel-button-focus-box-shadow: 0 0 0 3px rgba($swal2-cancel-button-background-color, 0.5) !default;\n\n// LOADER\n$swal2-loader-align-items: center !default;\n$swal2-loader-justify-content: center !default;\n$swal2-loader-width: 2.2em !default;\n$swal2-loader-height: 2.2em !default;\n$swal2-loader-margin: 0 1.875em !default;\n$swal2-loader-animation: swal2-rotate-loading 1.5s linear 0s infinite normal !default;\n$swal2-loader-border-width: 0.25em !default;\n$swal2-loader-border-style: solid !default;\n$swal2-loader-border-radius: 100% !default;\n$swal2-loader-border-color: #2778c4 transparent #2778c4 transparent !default;\n\n// TOASTS\n$swal2-toast-show-animation: swal2-toast-show 0.5s !default;\n$swal2-toast-hide-animation: swal2-toast-hide 0.1s forwards !default;\n$swal2-toast-border: none !default;\n$swal2-toast-box-shadow:\n 0 0 1px hsl(0deg 0% 0% / 0.075),\n 0 1px 2px hsl(0deg 0% 0% / 0.075),\n 1px 2px 4px hsl(0deg 0% 0% / 0.075),\n 1px 3px 8px hsl(0deg 0% 0% / 0.075),\n 2px 4px 16px hsl(0deg 0% 0% / 0.075) !default;\n$swal2-toast-background: $swal2-white !default;\n$swal2-toast-close-button-width: 0.8em !default;\n$swal2-toast-close-button-height: 0.8em !default;\n$swal2-toast-close-button-margin: 0 !default;\n$swal2-toast-close-button-font-size: 2em !default;\n$swal2-toast-width: 360px !default;\n$swal2-toast-padding: 1em !default;\n$swal2-toast-title-margin: 0.5em 1em !default;\n$swal2-toast-title-padding: 0 !default;\n$swal2-toast-title-font-size: 1em !default;\n$swal2-toast-icon-font-size: 1.8em !default;\n$swal2-toast-html-container-margin: 0.5em 1em !default;\n$swal2-toast-html-container-padding: 0 !default;\n$swal2-toast-html-container-font-size: 1em !default;\n$swal2-toast-input-height: 2em !default;\n$swal2-toast-input-margin: 0.5em !default;\n$swal2-toast-input-font-size: 1em !default;\n$swal2-toast-validation-font-size: 1em !default;\n$swal2-toast-buttons-font-size: 1em !default;\n$swal2-toast-footer-margin: 0.5em 0 0 !default;\n$swal2-toast-footer-padding: 0.5em 0 0 !default;\n$swal2-toast-footer-font-size: 0.8em !default;\n","@use 'sass:math';\n\ndiv:where(.swal2-container) {\n display: grid;\n position: fixed;\n z-index: 1060;\n inset: 0;\n box-sizing: border-box;\n grid-template-areas:\n 'top-start top top-end'\n 'center-start center center-end'\n 'bottom-start bottom-center bottom-end';\n grid-template-rows: minmax(min-content, auto) minmax(min-content, auto) minmax(min-content, auto);\n height: 100%; // Safari\n padding: $swal2-container-padding;\n overflow-x: hidden;\n transition: $swal2-backdrop-transition;\n\n // sweetalert2/issues/905\n -webkit-overflow-scrolling: touch;\n\n &.swal2-backdrop-show,\n &.swal2-noanimation {\n background: $swal2-backdrop;\n }\n\n &.swal2-backdrop-hide {\n background: transparent !important;\n }\n\n &.swal2-top-start,\n &.swal2-center-start,\n &.swal2-bottom-start {\n grid-template-columns: minmax(0, 1fr) auto auto;\n }\n\n &.swal2-top,\n &.swal2-center,\n &.swal2-bottom {\n grid-template-columns: auto minmax(0, 1fr) auto;\n }\n\n &.swal2-top-end,\n &.swal2-center-end,\n &.swal2-bottom-end {\n grid-template-columns: auto auto minmax(0, 1fr);\n }\n\n &.swal2-top-start > .swal2-popup {\n align-self: start;\n }\n\n &.swal2-top > .swal2-popup {\n grid-column: 2;\n place-self: start center;\n }\n\n &.swal2-top-end > .swal2-popup,\n &.swal2-top-right > .swal2-popup {\n grid-column: 3;\n place-self: start end;\n }\n\n &.swal2-center-start > .swal2-popup,\n &.swal2-center-left > .swal2-popup {\n grid-row: 2;\n align-self: center;\n }\n\n &.swal2-center > .swal2-popup {\n grid-column: 2;\n grid-row: 2;\n place-self: center center;\n }\n\n &.swal2-center-end > .swal2-popup,\n &.swal2-center-right > .swal2-popup {\n grid-column: 3;\n grid-row: 2;\n place-self: center end;\n }\n\n &.swal2-bottom-start > .swal2-popup,\n &.swal2-bottom-left > .swal2-popup {\n grid-column: 1;\n grid-row: 3;\n align-self: end;\n }\n\n &.swal2-bottom > .swal2-popup {\n grid-column: 2;\n grid-row: 3;\n place-self: end center;\n }\n\n &.swal2-bottom-end > .swal2-popup,\n &.swal2-bottom-right > .swal2-popup {\n grid-column: 3;\n grid-row: 3;\n place-self: end end;\n }\n\n &.swal2-grow-row > .swal2-popup,\n &.swal2-grow-fullscreen > .swal2-popup {\n grid-column: 1/4;\n width: 100%;\n }\n\n &.swal2-grow-column > .swal2-popup,\n &.swal2-grow-fullscreen > .swal2-popup {\n grid-row: 1/4;\n align-self: stretch;\n }\n\n &.swal2-no-transition {\n transition: none !important;\n }\n\n div:where(.swal2-popup) {\n display: none;\n position: relative;\n box-sizing: border-box;\n grid-template-columns: minmax(0, 100%);\n width: $swal2-width;\n max-width: 100%;\n padding: $swal2-padding;\n border: $swal2-border;\n border-radius: $swal2-border-radius;\n background: $swal2-background;\n color: $swal2-color;\n font-family: $swal2-font;\n font-size: $swal2-font-size;\n\n &:focus {\n outline: none;\n }\n\n &.swal2-loading {\n overflow-y: hidden;\n }\n }\n\n h2:where(.swal2-title) {\n position: $swal2-title-position;\n max-width: $swal2-title-max-width;\n margin: $swal2-title-margin;\n padding: $swal2-title-padding;\n color: $swal2-title-color;\n font-size: $swal2-title-font-size;\n font-weight: $swal2-title-font-weight;\n text-align: $swal2-title-text-align;\n text-transform: none;\n word-wrap: break-word;\n }\n\n div:where(.swal2-actions) {\n display: flex;\n z-index: 1; // prevent success icon from overlapping buttons\n box-sizing: border-box;\n flex-wrap: $swal2-actions-flex-wrap;\n align-items: $swal2-actions-align-items;\n justify-content: $swal2-actions-justify-content;\n width: $swal2-actions-width;\n margin: $swal2-actions-margin;\n padding: $swal2-actions-padding;\n\n &:not(.swal2-loading) {\n .swal2-styled {\n &[disabled] {\n opacity: 0.4;\n }\n\n &:hover {\n background-image: linear-gradient($swal2-button-darken-hover, $swal2-button-darken-hover);\n }\n\n &:active {\n background-image: linear-gradient($swal2-button-darken-active, $swal2-button-darken-active);\n }\n }\n }\n }\n\n div:where(.swal2-loader) {\n display: none;\n align-items: $swal2-loader-align-items;\n justify-content: $swal2-loader-justify-content;\n width: $swal2-loader-width;\n height: $swal2-loader-height;\n margin: $swal2-loader-margin;\n animation: $swal2-loader-animation;\n border-width: $swal2-loader-border-width;\n border-style: $swal2-loader-border-style;\n border-radius: $swal2-loader-border-radius;\n border-color: $swal2-loader-border-color;\n }\n\n button:where(.swal2-styled) {\n margin: $swal2-button-margin;\n padding: $swal2-button-padding;\n transition: $swal2-button-transition;\n box-shadow: $swal2-button-box-shadow;\n font-weight: $swal2-button-font-weight;\n\n &:not([disabled]) {\n cursor: pointer;\n }\n\n &.swal2-confirm {\n order: $swal2-confirm-button-order;\n border: $swal2-confirm-button-border;\n border-radius: $swal2-confirm-button-border-radius;\n background: initial;\n background-color: $swal2-confirm-button-background-color;\n color: $swal2-confirm-button-color;\n font-size: $swal2-confirm-button-font-size;\n\n &:focus {\n box-shadow: $swal2-confirm-button-focus-box-shadow;\n }\n }\n\n &.swal2-deny {\n order: $swal2-deny-button-order;\n border: $swal2-deny-button-border;\n border-radius: $swal2-deny-button-border-radius;\n background: initial;\n background-color: $swal2-deny-button-background-color;\n color: $swal2-deny-button-color;\n font-size: $swal2-deny-button-font-size;\n\n &:focus {\n box-shadow: $swal2-deny-button-focus-box-shadow;\n }\n }\n\n &.swal2-cancel {\n order: $swal2-cancel-button-order;\n border: $swal2-cancel-button-border;\n border-radius: $swal2-cancel-button-border-radius;\n background: initial;\n background-color: $swal2-cancel-button-background-color;\n color: $swal2-cancel-button-color;\n font-size: $swal2-cancel-button-font-size;\n\n &:focus {\n box-shadow: $swal2-cancel-button-focus-box-shadow;\n }\n }\n\n &.swal2-default-outline {\n &:focus {\n box-shadow: $swal2-button-focus-box-shadow;\n }\n }\n\n &:focus {\n outline: $swal2-button-focus-outline;\n }\n\n &::-moz-focus-inner {\n border: 0;\n }\n }\n\n div:where(.swal2-footer) {\n margin: $swal2-footer-margin;\n padding: $swal2-footer-padding;\n border-top: 1px solid $swal2-footer-border-color;\n color: $swal2-footer-color;\n font-size: $swal2-footer-font-size;\n text-align: $swal2-footer-text-align;\n }\n\n .swal2-timer-progress-bar-container {\n position: absolute;\n right: 0;\n bottom: 0;\n left: 0;\n grid-column: auto !important;\n overflow: hidden;\n border-bottom-right-radius: $swal2-border-radius;\n border-bottom-left-radius: $swal2-border-radius;\n }\n\n div:where(.swal2-timer-progress-bar) {\n width: 100%;\n height: $swal2-timer-progress-bar-height;\n background: $swal2-timer-progress-bar-background;\n }\n\n img:where(.swal2-image) {\n max-width: 100%;\n margin: $swal2-image-margin;\n }\n\n button:where(.swal2-close) {\n position: $swal2-close-button-position;\n z-index: 2; // sweetalert2/issues/1617\n align-items: $swal2-close-button-align-items;\n justify-content: $swal2-close-button-justify-content;\n width: $swal2-close-button-width;\n height: $swal2-close-button-height;\n margin-top: $swal2-close-button-gap;\n margin-right: $swal2-close-button-gap;\n margin-bottom: -$swal2-close-button-height;\n padding: $swal2-close-button-padding;\n overflow: hidden;\n transition: $swal2-close-button-transition;\n border: $swal2-close-button-border;\n border-radius: $swal2-close-button-border-radius;\n outline: $swal2-close-button-outline;\n background: $swal2-close-button-background;\n color: $swal2-close-button-color;\n font-family: $swal2-close-button-font-family;\n font-size: $swal2-close-button-font-size;\n cursor: pointer;\n justify-self: $swal2-close-button-justify-self;\n\n &:hover {\n transform: $swal2-close-button-hover-transform;\n background: $swal2-close-button-hover-background;\n color: $swal2-close-button-hover-color;\n }\n\n &:focus {\n outline: $swal2-close-button-focus-outline;\n box-shadow: $swal2-close-button-focus-box-shadow;\n }\n\n &::-moz-focus-inner {\n border: 0;\n }\n }\n\n .swal2-html-container {\n z-index: 1; // prevent success icon overlapping the content\n justify-content: $swal2-html-container-justify-content;\n margin: $swal2-html-container-margin;\n padding: $swal2-html-container-padding;\n overflow: $swal2-html-container-overflow;\n color: $swal2-html-container-color;\n font-size: $swal2-html-container-font-size;\n font-weight: $swal2-html-container-font-weight;\n line-height: $swal2-html-container-line-height;\n text-align: $swal2-html-container-text-align;\n word-wrap: $swal2-html-container-word-wrap;\n word-break: $swal2-html-container-word-break;\n }\n\n input:where(.swal2-input),\n input:where(.swal2-file),\n textarea:where(.swal2-textarea),\n select:where(.swal2-select),\n div:where(.swal2-radio),\n label:where(.swal2-checkbox) {\n margin: $swal2-input-margin;\n }\n\n input:where(.swal2-input),\n input:where(.swal2-file),\n textarea:where(.swal2-textarea) {\n box-sizing: border-box;\n width: $swal2-input-width;\n transition: $swal2-input-transition;\n border: $swal2-input-border;\n border-radius: $swal2-input-border-radius;\n background: $swal2-input-background;\n box-shadow: $swal2-input-box-shadow;\n color: $swal2-input-color;\n font-size: $swal2-input-font-size;\n\n &.swal2-inputerror {\n border-color: $swal2-error !important;\n box-shadow: 0 0 2px $swal2-error !important;\n }\n\n &:focus {\n border: $swal2-input-focus-border;\n outline: $swal2-input-focus-outline;\n box-shadow: $swal2-input-focus-box-shadow;\n }\n\n &::placeholder {\n color: #ccc;\n }\n }\n\n .swal2-range {\n margin: $swal2-input-margin;\n background: $swal2-background;\n\n input {\n width: 80%;\n }\n\n output {\n width: 20%;\n color: $swal2-input-color;\n font-weight: 600;\n text-align: center;\n }\n\n input,\n output {\n height: $swal2-input-height;\n padding: 0;\n font-size: $swal2-input-font-size;\n line-height: $swal2-input-height;\n }\n }\n\n .swal2-input {\n height: $swal2-input-height;\n padding: $swal2-input-padding;\n }\n\n .swal2-file {\n width: 75%;\n margin-right: auto;\n margin-left: auto;\n background: $swal2-input-background;\n font-size: $swal2-input-font-size;\n }\n\n .swal2-textarea {\n height: $swal2-textarea-height;\n padding: $swal2-textarea-padding;\n }\n\n .swal2-select {\n min-width: 50%;\n max-width: 100%;\n padding: 0.375em 0.625em;\n background: $swal2-input-background;\n color: $swal2-input-color;\n font-size: $swal2-input-font-size;\n }\n\n .swal2-radio,\n .swal2-checkbox {\n align-items: center;\n justify-content: center;\n background: $swal2-background;\n color: $swal2-input-color;\n\n label {\n margin: 0 0.6em;\n font-size: $swal2-input-font-size;\n }\n\n input {\n flex-shrink: 0;\n margin: 0 0.4em;\n }\n }\n\n label:where(.swal2-input-label) {\n display: flex;\n justify-content: $swal2-input-label-justify-content;\n margin: $swal2-input-label-margin;\n }\n\n div:where(.swal2-validation-message) {\n align-items: $swal2-validation-message-align-items;\n justify-content: $swal2-validation-message-justify-content;\n margin: $swal2-validation-message-margin;\n padding: $swal2-validation-message-padding;\n overflow: hidden;\n background: $swal2-validation-message-background;\n color: $swal2-validation-message-color;\n font-size: $swal2-validation-message-font-size;\n font-weight: $swal2-validation-message-font-weight;\n\n &::before {\n content: '!';\n display: inline-block;\n width: 1.5em;\n min-width: 1.5em;\n height: 1.5em;\n margin: 0 0.625em;\n zoom: $swal2-validation-message-icon-zoom;\n border-radius: 50%;\n background-color: $swal2-validation-message-icon-background;\n color: $swal2-validation-message-icon-color;\n font-weight: 600;\n line-height: 1.5em;\n text-align: center;\n }\n }\n\n .swal2-progress-steps {\n flex-wrap: $swal2-progress-steps-flex-wrap;\n align-items: $swal2-progress-steps-align-items;\n max-width: $swal2-progress-steps-max-width;\n margin: $swal2-progress-steps-margin;\n padding: $swal2-progress-steps-padding;\n background: $swal2-progress-steps-background;\n font-weight: $swal2-progress-steps-font-weight;\n\n li {\n display: inline-block;\n position: relative;\n }\n\n .swal2-progress-step {\n z-index: 20;\n flex-shrink: 0;\n width: $swal2-progress-step-width;\n height: $swal2-progress-step-height;\n border-radius: $swal2-progress-step-border-radius;\n background: $swal2-active-step-background;\n color: $swal2-active-step-color;\n line-height: $swal2-progress-step-height;\n text-align: center;\n\n &.swal2-active-progress-step {\n background: $swal2-active-step-background;\n\n ~ .swal2-progress-step {\n background: $swal2-progress-step-background;\n color: $swal2-progress-step-color;\n }\n\n ~ .swal2-progress-step-line {\n background: $swal2-progress-step-background;\n }\n }\n }\n\n .swal2-progress-step-line {\n z-index: 10;\n flex-shrink: 0;\n width: $swal2-progress-steps-distance;\n height: 0.4em;\n margin: 0 -1px;\n background: $swal2-active-step-background;\n }\n }\n}\n\n@import 'icons';\n\n// github.com/sweetalert2/sweetalert2/issues/268\n[class^='swal2'] {\n -webkit-tap-highlight-color: transparent;\n}\n\n.swal2-show {\n animation: $swal2-show-animation;\n}\n\n.swal2-hide {\n animation: $swal2-hide-animation;\n}\n\n.swal2-noanimation {\n transition: none;\n}\n\n// Measure scrollbar width for padding body during modal show/hide\n.swal2-scrollbar-measure {\n position: absolute;\n top: -9999px;\n width: 50px;\n height: 50px;\n overflow: scroll;\n}\n\n// Right-to-left support\n.swal2-rtl {\n .swal2-close {\n margin-right: initial;\n margin-left: $swal2-close-button-gap;\n }\n\n .swal2-timer-progress-bar {\n right: 0;\n left: auto;\n }\n}\n","// https://stackoverflow.com/a/12335841/1331425\n@function strip-units($number) {\n @return math.div($number, ($number * 0 + 1));\n}\n$icon-zoom: math.div(strip-units($swal2-icon-size), 5);\n\ndiv:where(.swal2-icon) {\n position: relative;\n box-sizing: content-box;\n justify-content: center;\n width: $swal2-icon-size;\n height: $swal2-icon-size;\n margin: $swal2-icon-margin;\n zoom: $swal2-icon-zoom;\n border: #{0.25em * $icon-zoom} solid transparent;\n border-radius: 50%;\n border-color: $swal2-icon-border-color;\n font-family: $swal2-icon-font-family;\n line-height: $swal2-icon-size;\n cursor: default;\n user-select: none;\n\n .swal2-icon-content {\n display: flex;\n align-items: center;\n font-size: $swal2-icon-font-size;\n }\n\n &.swal2-error {\n border-color: $swal2-error;\n color: $swal2-error;\n\n .swal2-x-mark {\n position: relative;\n flex-grow: 1;\n\n @if $icon-zoom != 1 {\n zoom: $icon-zoom;\n }\n }\n\n [class^='swal2-x-mark-line'] {\n display: block;\n position: absolute;\n top: 2.3125em;\n width: 2.9375em;\n height: 0.3125em;\n border-radius: 0.125em;\n background-color: $swal2-error;\n\n &[class$='left'] {\n left: 1.0625em;\n transform: rotate(45deg);\n }\n\n &[class$='right'] {\n right: 1em;\n transform: rotate(-45deg);\n }\n }\n\n // Error icon animation\n &.swal2-icon-show {\n @if $swal2-icon-animations {\n animation: swal2-animate-error-icon 0.5s;\n\n .swal2-x-mark {\n animation: swal2-animate-error-x-mark 0.5s;\n }\n }\n }\n }\n\n &.swal2-warning {\n border-color: lighten($swal2-warning, 7);\n color: $swal2-warning;\n\n // Warning icon animation\n &.swal2-icon-show {\n @if $swal2-icon-animations {\n animation: swal2-animate-error-icon 0.5s;\n\n .swal2-icon-content {\n animation: swal2-animate-i-mark 0.5s;\n }\n }\n }\n }\n\n &.swal2-info {\n border-color: lighten($swal2-info, 20);\n color: $swal2-info;\n\n // Info icon animation\n &.swal2-icon-show {\n @if $swal2-icon-animations {\n animation: swal2-animate-error-icon 0.5s;\n\n .swal2-icon-content {\n animation: swal2-animate-i-mark 0.8s;\n }\n }\n }\n }\n\n &.swal2-question {\n border-color: lighten($swal2-question, 20);\n color: $swal2-question;\n\n // Question icon animation\n &.swal2-icon-show {\n @if $swal2-icon-animations {\n animation: swal2-animate-error-icon 0.5s;\n\n .swal2-icon-content {\n animation: swal2-animate-question-mark 0.8s;\n }\n }\n }\n }\n\n &.swal2-success {\n border-color: $swal2-success;\n color: $swal2-success;\n\n [class^='swal2-success-circular-line'] {\n // Emulate moving circular line\n position: absolute;\n width: 3.75em;\n height: 7.5em;\n border-radius: 50%;\n\n &[class$='left'] {\n top: -0.4375em;\n left: -2.0635em;\n transform: rotate(-45deg);\n transform-origin: 3.75em 3.75em;\n border-radius: 7.5em 0 0 7.5em;\n\n @if $icon-zoom != 1 {\n zoom: $icon-zoom;\n }\n }\n\n &[class$='right'] {\n top: -0.6875em;\n left: 1.875em;\n transform: rotate(-45deg);\n transform-origin: 0 3.75em;\n border-radius: 0 7.5em 7.5em 0;\n\n @if $icon-zoom != 1 {\n zoom: $icon-zoom;\n }\n }\n }\n\n .swal2-success-ring {\n // Ring\n position: absolute;\n z-index: 2;\n top: -0.25em;\n left: -0.25em;\n box-sizing: content-box;\n width: 100%;\n height: 100%;\n border: 0.25em solid $swal2-success-border;\n border-radius: 50%;\n\n @if $icon-zoom != 1 {\n zoom: $icon-zoom;\n }\n }\n\n .swal2-success-fix {\n // Hide corners left from animation\n position: absolute;\n z-index: 1;\n top: 0.5em;\n left: 1.625em;\n width: 0.4375em;\n height: 5.625em;\n transform: rotate(-45deg);\n\n @if $icon-zoom != 1 {\n zoom: $icon-zoom;\n }\n }\n\n [class^='swal2-success-line'] {\n display: block;\n position: absolute;\n z-index: 2;\n height: 0.3125em;\n border-radius: 0.125em;\n background-color: $swal2-success;\n\n &[class$='tip'] {\n top: 2.875em;\n left: 0.8125em;\n width: 1.5625em;\n transform: rotate(45deg);\n }\n\n &[class$='long'] {\n top: 2.375em;\n right: 0.5em;\n width: 2.9375em;\n transform: rotate(-45deg);\n }\n\n @if $icon-zoom != 1 {\n zoom: $icon-zoom;\n }\n }\n\n // Success icon animation\n &.swal2-icon-show {\n @if $swal2-icon-animations {\n .swal2-success-line-tip {\n animation: swal2-animate-success-line-tip 0.75s;\n }\n\n .swal2-success-line-long {\n animation: swal2-animate-success-line-long 0.75s;\n }\n\n .swal2-success-circular-line-right {\n animation: swal2-rotate-success-circular-line 4.25s ease-in;\n }\n }\n }\n }\n}\n","// Animations\n@keyframes swal2-toast-show {\n 0% {\n transform: translateY(-0.625em) rotateZ(2deg);\n }\n\n 33% {\n transform: translateY(0) rotateZ(-2deg);\n }\n\n 66% {\n transform: translateY(0.3125em) rotateZ(2deg);\n }\n\n 100% {\n transform: translateY(0) rotateZ(0deg);\n }\n}\n\n@keyframes swal2-toast-hide {\n 100% {\n transform: rotateZ(1deg);\n opacity: 0;\n }\n}\n\n@keyframes swal2-toast-animate-success-line-tip {\n 0% {\n top: 0.5625em;\n left: 0.0625em;\n width: 0;\n }\n\n 54% {\n top: 0.125em;\n left: 0.125em;\n width: 0;\n }\n\n 70% {\n top: 0.625em;\n left: -0.25em;\n width: 1.625em;\n }\n\n 84% {\n top: 1.0625em;\n left: 0.75em;\n width: 0.5em;\n }\n\n 100% {\n top: 1.125em;\n left: 0.1875em;\n width: 0.75em;\n }\n}\n\n@keyframes swal2-toast-animate-success-line-long {\n 0% {\n top: 1.625em;\n right: 1.375em;\n width: 0;\n }\n\n 65% {\n top: 1.25em;\n right: 0.9375em;\n width: 0;\n }\n\n 84% {\n top: 0.9375em;\n right: 0;\n width: 1.125em;\n }\n\n 100% {\n top: 0.9375em;\n right: 0.1875em;\n width: 1.375em;\n }\n}\n","@import 'toasts-animations';\n\n// Appearance animation\n@keyframes swal2-show {\n 0% {\n transform: scale(0.7);\n }\n\n 45% {\n transform: scale(1.05);\n }\n\n 80% {\n transform: scale(0.95);\n }\n\n 100% {\n transform: scale(1);\n }\n}\n\n// Disppearance animation\n@keyframes swal2-hide {\n 0% {\n transform: scale(1);\n opacity: 1;\n }\n\n 100% {\n transform: scale(0.5);\n opacity: 0;\n }\n}\n\n// Success icon animations\n@keyframes swal2-animate-success-line-tip {\n 0% {\n top: 1.1875em;\n left: 0.0625em;\n width: 0;\n }\n\n 54% {\n top: 1.0625em;\n left: 0.125em;\n width: 0;\n }\n\n 70% {\n top: 2.1875em;\n left: -0.375em;\n width: 3.125em;\n }\n\n 84% {\n top: 3em;\n left: 1.3125em;\n width: 1.0625em;\n }\n\n 100% {\n top: 2.8125em;\n left: 0.8125em;\n width: 1.5625em;\n }\n}\n\n@keyframes swal2-animate-success-line-long {\n 0% {\n top: 3.375em;\n right: 2.875em;\n width: 0;\n }\n\n 65% {\n top: 3.375em;\n right: 2.875em;\n width: 0;\n }\n\n 84% {\n top: 2.1875em;\n right: 0;\n width: 3.4375em;\n }\n\n 100% {\n top: 2.375em;\n right: 0.5em;\n width: 2.9375em;\n }\n}\n\n@keyframes swal2-rotate-success-circular-line {\n 0% {\n transform: rotate(-45deg);\n }\n\n 5% {\n transform: rotate(-45deg);\n }\n\n 12% {\n transform: rotate(-405deg);\n }\n\n 100% {\n transform: rotate(-405deg);\n }\n}\n\n// Error icon animations\n@keyframes swal2-animate-error-x-mark {\n 0% {\n margin-top: 1.625em;\n transform: scale(0.4);\n opacity: 0;\n }\n\n 50% {\n margin-top: 1.625em;\n transform: scale(0.4);\n opacity: 0;\n }\n\n 80% {\n margin-top: -0.375em;\n transform: scale(1.15);\n }\n\n 100% {\n margin-top: 0;\n transform: scale(1);\n opacity: 1;\n }\n}\n\n@keyframes swal2-animate-error-icon {\n 0% {\n transform: rotateX(100deg);\n opacity: 0;\n }\n\n 100% {\n transform: rotateX(0deg);\n opacity: 1;\n }\n}\n\n@keyframes swal2-rotate-loading {\n 0% {\n transform: rotate(0deg);\n }\n\n 100% {\n transform: rotate(360deg);\n }\n}\n\n// Question mark animation\n@keyframes swal2-animate-question-mark {\n 0% {\n transform: rotateY(-360deg);\n }\n\n 100% {\n transform: rotateY(0);\n }\n}\n\n// Info and Warning mark animation\n@keyframes swal2-animate-i-mark {\n 0% {\n transform: rotateZ(45deg);\n opacity: 0;\n }\n\n 25% {\n transform: rotateZ(-25deg);\n opacity: 0.4;\n }\n\n 50% {\n transform: rotateZ(15deg);\n opacity: 0.8;\n }\n\n 75% {\n transform: rotateZ(-5deg);\n opacity: 1;\n }\n\n 100% {\n transform: rotateX(0);\n opacity: 1;\n }\n}\n","// https://stackoverflow.com/a/30250161\n@mixin not($ignor-list...) {\n @if (length($ignor-list) == 1) {\n $ignor-list: nth($ignor-list, 1);\n }\n\n $not-output: '';\n\n @each $not in $ignor-list {\n $not-output: $not-output + ':not(#{$not})'; // stylelint-disable-line scss/no-duplicate-dollar-variables\n }\n\n &#{$not-output} {\n @content;\n }\n}\n","@import 'toasts-body';\n\n@mixin sweetalert2-body() {\n &.swal2-shown {\n @include not('.swal2-no-backdrop', '.swal2-toast-shown') {\n overflow: hidden; // not overflow-y because of Sarari, #1253\n }\n }\n\n &.swal2-height-auto {\n height: auto !important; // #781 #1107\n }\n\n &.swal2-no-backdrop {\n .swal2-container {\n background-color: transparent !important;\n pointer-events: none;\n\n .swal2-popup {\n pointer-events: all;\n }\n\n .swal2-modal {\n box-shadow: 0 0 10px $swal2-backdrop;\n }\n }\n }\n\n @media print {\n &.swal2-shown {\n @include not('.swal2-no-backdrop', '.swal2-toast-shown') {\n overflow-y: scroll !important;\n\n > [aria-hidden='true'] {\n display: none;\n }\n\n .swal2-container {\n position: static !important;\n }\n }\n }\n }\n}\n","@mixin sweetalert2-toasts-body() {\n &.swal2-toast-shown {\n .swal2-container {\n box-sizing: border-box;\n width: $swal2-toast-width;\n max-width: 100%;\n background-color: transparent;\n pointer-events: none;\n\n &.swal2-top {\n inset: 0 auto auto 50%;\n transform: translateX(-50%);\n }\n\n &.swal2-top-end,\n &.swal2-top-right {\n inset: 0 0 auto auto;\n }\n\n &.swal2-top-start,\n &.swal2-top-left {\n inset: 0 auto auto 0;\n }\n\n &.swal2-center-start,\n &.swal2-center-left {\n inset: 50% auto auto 0;\n transform: translateY(-50%);\n }\n\n &.swal2-center {\n inset: 50% auto auto 50%;\n transform: translate(-50%, -50%);\n }\n\n &.swal2-center-end,\n &.swal2-center-right {\n inset: 50% 0 auto auto;\n transform: translateY(-50%);\n }\n\n &.swal2-bottom-start,\n &.swal2-bottom-left {\n inset: auto auto 0 0;\n }\n\n &.swal2-bottom {\n inset: auto auto 0 50%;\n transform: translateX(-50%);\n }\n\n &.swal2-bottom-end,\n &.swal2-bottom-right {\n inset: auto 0 0 auto;\n }\n }\n }\n}\n"],sourceRoot:""}]);const o=i},663:(e,t,n)=>{"use strict";n.d(t,{A:()=>o});var s=n(1354),r=n.n(s),a=n(6314),i=n.n(a)()(r());i.push([e.id,".rc-buttons{z-index:10}.rc-absolute-buttons{bottom:1.25rem;position:fixed;right:1.25rem;text-align:right}.rc-button{border:none!important;border-radius:7px!important;cursor:pointer;font-size:1rem!important;font-weight:700!important;line-height:150%!important;margin:.25rem!important;padding:1rem 1.5rem!important;text-align:center!important}.rc-go-button{background:rgba(255,154,0,.667)!important;color:#fff!important}.rc-go-button:hover{background:#ff9a00!important}.rc-go-button:active{background:#d68200!important}.rc-cancel-button,.rc-custom-button{background:hsla(0,0%,100%,.933)!important;color:#333!important}.rc-cancel-button:hover,.rc-custom-button:hover{background:#ddd!important}.rc-cancel-button:active,.rc-custom-button:active{background:#aaa!important;color:#000!important}.rc-button:disabled{background:#ddd!important;color:#999!important;cursor:default!important}","",{version:3,sources:["webpack://./src/css/buttons.scss"],names:[],mappings:"AAAA,YACE,UAAA,CAGF,qBAGE,cAAA,CAFA,cAAA,CAGA,aAAA,CAFA,gBAEA,CAGF,WAEE,qBAAA,CAMA,2BAAA,CACA,cAAA,CALA,wBAAA,CACA,yBAAA,CAFA,0BAAA,CAIA,uBAAA,CADA,6BAAA,CALA,2BAQA,CAGF,cACE,yCAAA,CACA,oBAAA,CAEA,oBACE,4BAAA,CAGF,qBACE,4BAAA,CAIJ,oCAEE,yCAAA,CACA,oBAAA,CAEA,gDACE,yBAAA,CAGF,kDACE,yBAAA,CACA,oBAAA,CAIJ,oBACE,yBAAA,CACA,oBAAA,CACA,wBAAA",sourcesContent:[".rc-buttons {\n z-index: 10;\n}\n\n.rc-absolute-buttons {\n position: fixed;\n text-align: right;\n bottom: 1.25rem;\n right: 1.25rem;\n}\n\n.rc-button {\n text-align: center !important;\n border: none !important;\n line-height: 150% !important;\n font-size: 1rem !important;\n font-weight: 700 !important;\n padding: 1rem 1.5rem !important;\n margin: 0.25rem !important;\n border-radius: 7px !important;\n cursor: pointer;\n}\n\n.rc-go-button {\n background: #ff9a00aa !important;\n color: #fff !important;\n\n &:hover {\n background: #ff9a00 !important;\n }\n\n &:active {\n background: #d68200 !important;\n }\n}\n\n.rc-cancel-button,\n.rc-custom-button {\n background: #ffffffee !important;\n color: #333 !important;\n\n &:hover {\n background: #ddd !important;\n }\n\n &:active {\n background: #aaa !important;\n color: #000 !important;\n }\n}\n\n.rc-button:disabled {\n background: #ddd !important;\n color: #999 !important;\n cursor: default !important;\n}\n"],sourceRoot:""}]);const o=i},290:(e,t,n)=>{"use strict";n.d(t,{A:()=>o});var s=n(1354),r=n.n(s),a=n(6314),i=n.n(a)()(r());i.push([e.id,".my__swal2__container .swal2-select{border:2px solid #aaa!important;border-radius:5px!important;font-family:inherit!important;font-size:1.2rem!important;margin:auto 1.6rem!important;outline:none!important;padding-top:.5rem!important}.rc-form{font-family:inherit;font-size:2rem;pointer-events:auto!important}.rc-form .rc-form-inputs{display:flex;justify-content:space-between!important;margin:1rem 0}.rc-form .rc-form-inputs .rc-form-input,.rc-form .rc-form-inputs span{flex-grow:1;font-family:inherit;font-size:inherit;padding:.5rem}.rc-form .rc-form-inputs span{font-weight:700}.rc-form .rc-form-input{border:2px solid #aaa;border-radius:5px;outline:none;width:min(100%,10rem)}.rc-form .rc-form-input.rc-input-error{border-color:#ac0d0d!important;color:#ac0d0d!important}.rc-form .rc-form-input+.rc-form-input{margin-left:.5rem}.arrow-two-sided-svg{position:fixed}.arrow-two-sided-svg .arrow-two-sided{fill:#ff9a00}.arrow-two-sided-horizontal{bottom:10%;left:0;right:0;width:100%}.arrow-two-sided-vertical{bottom:0;height:100%;right:5%;top:0}","",{version:3,sources:["webpack://./src/css/check.scss"],names:[],mappings:"AAAA,oCAME,+BAAA,CADA,2BAAA,CADA,6BAAA,CAHA,0BAAA,CACA,4BAAA,CAKA,sBAAA,CAJA,2BAIA,CAOF,SAEE,mBAAA,CADA,cAAA,CAEA,6BAAA,CAEA,yBACE,YAAA,CACA,uCAAA,CACA,aAAA,CAEA,sEAEE,WAAA,CAEA,mBAAA,CACA,iBAAA,CAFA,aAEA,CAGF,8BACE,eAAA,CAIJ,wBACE,qBAAA,CAEA,iBAAA,CADA,YAAA,CAEA,qBAAA,CAEA,uCACE,8BAAA,CACA,uBAAA,CAIJ,uCACE,iBAAA,CAIJ,qBACE,cAAA,CAEA,sCACE,YAAA,CAIJ,4BAEE,UAAA,CACA,MAAA,CACA,OAAA,CAHA,UAGA,CAGF,0BAIE,QAAA,CAHA,WAAA,CACA,QAAA,CACA,KACA",sourcesContent:[".my__swal2__container .swal2-select {\n font-size: 1.2rem !important;\n margin: auto 1.6rem !important;\n padding-top: 0.5rem !important;\n font-family: inherit !important;\n border-radius: 5px !important;\n border: 2px solid #aaa !important;\n outline: none !important;\n}\n\n/* -------------------------------------------------------------------------- */\n/* Measure Input */\n/* -------------------------------------------------------------------------- */\n\n.rc-form {\n font-size: 2rem;\n font-family: inherit;\n pointer-events: auto !important;\n\n .rc-form-inputs {\n display: flex;\n justify-content: space-between !important;\n margin: 1rem 0;\n\n .rc-form-input,\n span {\n flex-grow: 1;\n padding: 0.5rem;\n font-family: inherit;\n font-size: inherit;\n }\n\n span {\n font-weight: 700;\n }\n }\n\n .rc-form-input {\n border: 2px solid #aaa;\n outline: none;\n border-radius: 5px;\n width: min(100%, 10rem);\n\n &.rc-input-error {\n border-color: #ac0d0d !important;\n color: #ac0d0d !important;\n }\n }\n\n .rc-form-input + .rc-form-input {\n margin-left: 0.5rem;\n }\n}\n\n.arrow-two-sided-svg {\n position: fixed;\n\n .arrow-two-sided {\n fill: #ff9a00;\n }\n}\n\n.arrow-two-sided-horizontal {\n width: 100%;\n bottom: 10%;\n left: 0;\n right: 0;\n}\n\n.arrow-two-sided-vertical {\n height: 100%;\n right: 5%;\n top: 0;\n bottom: 0;\n}\n"],sourceRoot:""}]);const o=i},2945:(e,t,n)=>{"use strict";n.d(t,{A:()=>o});var s=n(1354),r=n.n(s),a=n(6314),i=n.n(a)()(r());i.push([e.id,"#eye-side{font-weight:700}#blind-spot-canvas{bottom:0;display:block;left:0;margin:0;padding:0;position:fixed;right:0;top:0;z-index:-1}#blind-spot-instruction{max-width:unset!important}@media(min-width:641px){#blind-spot-instruction{font-size:1.1rem!important;width:65%!important}}@media(max-width:640px){#blind-spot-instruction{font-size:.9rem!important;width:90%!important}}#pip-video{display:none}#video-canvas{border-radius:6px;bottom:1rem;display:block;left:1rem;position:absolute;z-index:1000}#rc-ruler{cursor:pointer;max-height:120px;overflow:hidden;position:fixed;-webkit-user-select:none;-moz-user-select:none;user-select:none}#rc-ruler-scales{left:30px;pointer-events:none;position:absolute;top:0;z-index:1}#rc-ruler-scales #size-arrow{opacity:.5;transform:rotate(90deg) translateY(calc(50% + 3px))}#rc-ruler-scales .rc-ruler-scale-text{color:rgba(44,46,67,.667);font-weight:700;margin:0!important;padding:0;position:absolute;top:32px!important;transform:translate(-50%)!important}#rc-ruler-scales .rc-ruler-scale{display:block;position:absolute;top:0;transform:translate(-1px);width:2px;z-index:2}#rc-ruler-scales .rc-ruler-major{background-color:rgba(44,46,67,.933);height:30px}#rc-ruler-scales .rc-ruler-secondary{background-color:rgba(89,82,96,.867);height:24px}#rc-ruler-scales .rc-ruler-minor{background-color:rgba(89,82,96,.4);height:16px}.hide-nudger .calibration-nudger{display:none!important;opacity:0!important}.calibration-nudger,.gaze-nudger{bottom:0;box-sizing:border-box;height:100%;left:0;margin:0;overflow:hidden;position:fixed;right:0;scrollbar-width:none;text-align:center;top:0;-webkit-user-select:none;-moz-user-select:none;user-select:none;width:100%;z-index:999999999}.calibration-nudger *,.gaze-nudger *{font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen,Ubuntu,Cantarell,Open Sans,Helvetica Neue,sans-serif}#rc-distance-correct{margin:0 auto auto;overflow-wrap:break-word;padding:2rem;text-align:center;width:100%}#rc-distance-correct #rc-distance-correct-instruction{font-size:7rem;font-weight:700;line-height:100%;margin:0 auto 2rem}#rc-distance-correct #rc-distance-correct-guide{font-size:3rem;font-weight:500;line-height:200%}#rc-distance-correct #rc-distance-correct-guide .rc-distance-num{border-radius:7px!important;font-family:monospace!important;font-size:9rem;font-weight:700;padding:.5rem;vertical-align:middle}","",{version:3,sources:["webpack://./src/css/distance.scss"],names:[],mappings:"AAAA,UACE,eAAA,CAGF,mBAME,QAAA,CAJA,aAAA,CAGA,MAAA,CAIA,QAAA,CADA,SAAA,CAPA,cAAA,CAMA,OAAA,CAHA,KAAA,CADA,UAMA,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: -1;\n top: 0;\n left: 0;\n bottom: 0;\n right: 0;\n padding: 0;\n margin: 0;\n}\n\n#blind-spot-instruction {\n // max-width: min(32rem, 100%) !important;\n max-width: unset !important;\n}\n\n@media (min-width: 641px) {\n #blind-spot-instruction {\n width: 65% !important;\n font-size: 1.1rem !important;\n }\n}\n\n@media (max-width: 640px) {\n #blind-spot-instruction {\n width: 90% !important;\n font-size: 0.9rem !important;\n }\n}\n\n#pip-video {\n display: none;\n}\n\n#video-canvas {\n z-index: 1000;\n position: absolute;\n display: block;\n bottom: 1rem;\n left: 1rem;\n border-radius: 6px;\n}\n\n/* ----------------------------------- PD ----------------------------------- */\n\n#rc-ruler {\n position: fixed;\n max-height: 120px;\n overflow: hidden;\n\n cursor: pointer;\n user-select: none;\n}\n\n#rc-ruler-scales {\n position: absolute;\n top: 0;\n left: 30px;\n z-index: 1;\n pointer-events: none;\n\n #size-arrow {\n transform: rotate(90deg) translate(0, calc(50% + 3px));\n opacity: 0.5;\n }\n\n .rc-ruler-scale-text {\n position: absolute;\n top: 32px !important;\n margin: 0 !important;\n padding: 0;\n color: #2c2e43aa;\n font-weight: 700;\n transform: translate(-50%, 0) !important;\n }\n\n .rc-ruler-scale {\n position: absolute;\n display: block;\n top: 0;\n width: 2px;\n transform: translate(-1px, 0);\n z-index: 2;\n }\n\n .rc-ruler-major {\n background-color: #2c2e43ee;\n height: 30px;\n }\n\n .rc-ruler-secondary {\n background-color: #595260dd;\n height: 24px;\n }\n\n .rc-ruler-minor {\n background-color: #59526066;\n height: 16px;\n }\n}\n\n/* ---------------------------------- Check --------------------------------- */\n\n.hide-nudger {\n .calibration-nudger {\n display: none !important;\n opacity: 0 !important;\n }\n}\n\n.calibration-nudger,\n.gaze-nudger {\n z-index: 999999999;\n position: fixed;\n width: 100%;\n height: 100%;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n margin: 0;\n overflow: hidden;\n user-select: none;\n box-sizing: border-box;\n text-align: center;\n scrollbar-width: none;\n\n * {\n font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen,\n Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;\n }\n}\n\n#rc-distance-correct {\n text-align: center;\n width: 100%;\n margin: 0 auto auto auto;\n padding: 2rem;\n overflow-wrap: break-word;\n\n #rc-distance-correct-instruction {\n font-weight: 700;\n font-size: 7rem;\n margin: 0 auto 2rem auto;\n line-height: 100%;\n }\n\n #rc-distance-correct-guide {\n font-weight: 500;\n font-size: 3rem;\n line-height: 200%;\n\n .rc-distance-num {\n padding: 0.5rem;\n border-radius: 7px !important;\n font-weight: 700;\n font-family: monospace !important;\n vertical-align: middle;\n font-size: 9rem;\n }\n\n // .rc-distance-now {\n // border: 2px solid #ff9a00;\n // background-color: #ff9a0066;\n // }\n\n // .rc-distance-desired {\n // border: 2px solid #3490de;\n // background-color: #3490de66;\n // }\n }\n}\n"],sourceRoot:""}]);const o=i},4636:(e,t,n)=>{"use strict";n.d(t,{A:()=>o});var s=n(1354),r=n.n(s),a=n(6314),i=n.n(a)()(r());i.push([e.id,":root{--rc-panel-theme-color:#3490de;--rc-panel-darken-color:#185b94;--rc-panel-theme-color-semi:#3490de66;--rc-panel-darken-color-semi:#185b9488}.rc-panel{background-color:var(--rc-panel-theme-color);border-radius:10px!important;box-shadow:var(--rc-panel-darken-color-semi) 0 50px 100px -20px,var(--rc-panel-theme-color-semi) 0 30px 60px -30px!important;display:block;margin-left:auto!important;margin-right:auto!important;max-width:720px!important;overflow:hidden;padding:.75rem!important;position:relative;width:100%}.rc-panel *{box-sizing:border-box;outline:none;text-rendering:optimizeLegibility;vertical-align:baseline;-webkit-font-smoothing:auto;-moz-osx-font-smoothing:grayscale;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen,Ubuntu,Cantarell,Open Sans,Helvetica Neue,sans-serif;font-kerning:normal;scrollbar-width:none;-webkit-user-select:none;-moz-user-select:none;user-select:none}.rc-panel .rc-panel-title{color:#fff!important;font-size:2rem!important;font-weight:600!important;margin:1rem 1rem 0!important}.rc-panel .rc-panel-description{color:hsla(0,0%,100%,.8)!important;font-size:1rem!important;font-weight:500!important;margin:.5rem 1rem 0!important}.rc-panel #rc-panel-language-parent{display:flex;flex-direction:row-reverse;margin:0;padding:0}.rc-panel #rc-panel-language-parent #rc-panel-lang-picker{background-color:hsla(0,0%,100%,.8)!important;border:none!important;border-radius:5px!important;display:block;font-size:1rem!important;font-weight:500!important;margin:.25rem .25rem 0!important;outline:none!important;padding:.25rem!important}.rc-panel .rc-panel-steps{margin:-3rem 0 0!important;padding-top:4rem!important}.rc-panel .rc-panel-steps.rc-panel-steps-l,.rc-panel .rc-panel-steps.rc-panel-steps-s{display:flex!important;justify-content:space-between!important}.rc-panel .rc-panel-steps.rc-panel-steps-l .rc-panel-step,.rc-panel .rc-panel-steps.rc-panel-steps-s .rc-panel-step{background:hsla(0,0%,100%,.8);flex-grow:1!important;margin:.25rem!important;padding:0!important;position:relative;text-align:center;transition:background-color .2s}.rc-panel .rc-panel-steps.rc-panel-steps-l .rc-panel-step .rc-panel-step-use,.rc-panel .rc-panel-steps.rc-panel-steps-s .rc-panel-step .rc-panel-step-use{font-size:1rem!important;line-height:170%!important;margin:0!important;padding:0 .3rem!important;position:absolute;right:0;top:0}.rc-panel .rc-panel-steps.rc-panel-steps-l .rc-panel-step .rc-panel-step-use svg,.rc-panel .rc-panel-steps.rc-panel-steps-s .rc-panel-step .rc-panel-step-use svg{height:1rem;width:1rem;fill:var(--rc-panel-darken-color)}.rc-panel .rc-panel-steps.rc-panel-steps-l .rc-panel-step .rc-panel-step-name,.rc-panel .rc-panel-steps.rc-panel-steps-s .rc-panel-step .rc-panel-step-name{color:var(--rc-panel-darken-color);font-size:1rem!important;font-weight:700!important;line-height:150%!important;white-space:nowrap}.rc-panel .rc-panel-steps.rc-panel-steps-l{flex-flow:row nowrap;max-width:100%;overflow-x:scroll}.rc-panel .rc-panel-steps.rc-panel-steps-l .rc-panel-step-name{margin:1.5rem .5rem!important}.rc-panel .rc-panel-steps.rc-panel-steps-l .rc-panel-step-use-tip{bottom:110%!important;display:flex!important;left:50%!important;position:absolute!important;transform:translate(-50%)!important}.rc-panel .rc-panel-steps.rc-panel-steps-s{flex-flow:column nowrap;overflow-x:hidden}.rc-panel .rc-panel-steps.rc-panel-steps-s .rc-panel-step{overflow-x:hidden;text-align:left;white-space:nowrap}.rc-panel .rc-panel-steps.rc-panel-steps-s .rc-panel-step-name{margin:1.2rem .75rem 1.2rem 1.5rem!important}.rc-panel .rc-panel-steps.rc-panel-steps-s .rc-panel-step-use-tip{display:inline-flex!important;position:relative!important}.rc-panel .rc-panel-steps .rc-panel-step{border:none!important;border-radius:7px!important}.rc-panel .rc-panel-steps .rc-panel-step .rc-panel-step-name{display:inline-block!important;position:relative!important}.rc-panel .rc-panel-steps .rc-panel-step-use-tip{align-items:center!important;background-color:rgba(255,154,0,.933)!important;border:none!important;border-radius:7px!important;color:#fff!important;font-size:.75rem!important;font-weight:500!important;justify-content:center!important;line-height:100%!important;margin:0!important;opacity:0;padding:.7rem .5rem!important;pointer-events:none;text-align:center!important;transition:opacity .2s;width:-moz-max-content!important;width:max-content!important;z-index:10!important}.rc-panel .rc-panel-steps .rc-panel-step-use-tip svg{height:.75rem;width:.75rem;fill:#fff}.rc-panel .rc-panel-steps .rc-panel-step-use-tip svg:last-of-type{margin-right:5px}.rc-panel .rc-panel-steps .rc-panel-step-todo:focus,.rc-panel .rc-panel-steps .rc-panel-step-todo:hover{background-color:#fff}.rc-panel .rc-panel-steps .rc-panel-step-todo:focus .rc-panel-step-use-tip,.rc-panel .rc-panel-steps .rc-panel-step-todo:hover .rc-panel-step-use-tip{opacity:1!important}.rc-panel .rc-panel-steps .rc-panel-step-todo:active{background-color:hsla(0,0%,93%,.8)}.rc-panel .rc-panel-steps .rc-panel-step-finished{background-color:hsla(0,0%,73%,.8)!important}.rc-panel .rc-panel-steps .rc-panel-step-inactive{opacity:.6;pointer-events:none}.rc-panel .rc-panel-steps .rc-panel-step-active{cursor:pointer;opacity:1}.rc-panel ::-webkit-scrollbar{display:none;width:0}.rc-panel .rc-panel-debug-control{background-color:hsla(0,0%,100%,.8);border:3px solid #e00;border-radius:7px;margin:1rem 0 0;overflow:hidden;padding:.5rem}.rc-panel .rc-panel-debug-control *{color:#ac0d0d}.rc-panel .rc-panel-debug-control h2,.rc-panel .rc-panel-debug-control h3,.rc-panel .rc-panel-debug-control p{margin:0!important}.rc-panel .rc-panel-debug-control h2{font-size:1.2rem!important;font-weight:700!important}.rc-panel .rc-panel-debug-control h3{font-size:.9rem;font-variant:small-caps;font-weight:500;padding-bottom:.3rem;padding-top:.5rem}.rc-panel .rc-panel-debug-control .rc-panel-debug-bold-text{font-size:1rem!important;font-weight:700}.rc-panel .rc-panel-debug-control .rc-panel-debug-control-next{background-color:#e00;border:none;border-radius:5px;color:#fff;cursor:pointer;font-size:.9rem!important;margin:1rem 0 0;padding:.5rem 1.2rem!important}.rc-panel .rc-panel-debug-control .rc-panel-debug-control-next:hover{background-color:#ac0d0d}.rc-panel .rc-panel-debug-control .rc-panel-debug-control-task-row{display:inline-flex;justify-content:flex-start!important;width:100%}.rc-panel .rc-panel-debug-control .rc-panel-debug-control-task-row .value-element{flex-grow:1;overflow-x:hidden;padding:0 .1rem;pointer-events:none;-webkit-user-select:none;-moz-user-select:none;user-select:none;white-space:nowrap}.rc-panel .rc-panel-debug-control .rc-panel-debug-control-task-row .value-element:first-of-type{padding-left:0}.rc-panel .rc-panel-debug-control .rc-panel-debug-control-task-row .value-element:last-of-type{padding-right:0}.rc-panel .rc-panel-debug-control .rc-panel-debug-control-task-row .value-element p{color:#ac0d0d;font-size:.65rem!important;line-height:150%!important;padding-left:1px!important}.rc-panel .rc-panel-debug-control .rc-panel-debug-control-task-row .value-element input{background-color:hsla(0,0%,100%,.8);border:1px solid #e99!important;border-radius:3px!important;font-size:.8rem;margin:0!important;padding:.3rem!important;pointer-events:auto;-webkit-user-select:auto;-moz-user-select:au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CADA,0BAAA,CADA,0BAGA,CAGF,wFAOE,mCAAA,CAFA,+BAAA,CACA,2BAAA,CAHA,eAAA,CAFA,kBAAA,CACA,uBAAA,CAOA,mBAAA,CADA,wBAAA,CAAA,qBAAA,CAAA,gBAAA,CAJA,UAKA",sourcesContent:[":root {\n --rc-panel-theme-color: #3490de;\n --rc-panel-darken-color: #185b94;\n --rc-panel-theme-color-semi: #3490de66;\n --rc-panel-darken-color-semi: #185b9488;\n}\n\n.rc-panel {\n position: relative;\n display: block;\n margin-left: auto !important;\n margin-right: auto !important;\n background-color: var(--rc-panel-theme-color);\n width: 100%;\n max-width: 720px !important;\n padding: 0.75rem !important;\n border-radius: 10px !important;\n box-shadow:\n var(--rc-panel-darken-color-semi) 0px 50px 100px -20px,\n var(--rc-panel-theme-color-semi) 0px 30px 60px -30px !important;\n overflow: hidden;\n\n * {\n outline: none;\n vertical-align: baseline;\n box-sizing: border-box;\n text-rendering: optimizeLegibility;\n -webkit-font-smoothing: auto;\n -moz-osx-font-smoothing: grayscale;\n font-kerning: normal;\n user-select: none;\n font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen,\n Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;\n scrollbar-width: none;\n }\n\n .rc-panel-title {\n color: #fff !important;\n margin: 1rem 1rem 0 1rem !important;\n font-size: 2rem !important;\n font-weight: 600 !important;\n }\n\n .rc-panel-description {\n color: #ffffffcc !important;\n margin: 0.5rem 1rem 0 1rem !important;\n font-size: 1rem !important;\n font-weight: 500 !important;\n }\n\n #rc-panel-language-parent {\n display: flex;\n flex-direction: row-reverse;\n margin: 0;\n padding: 0;\n\n #rc-panel-lang-picker {\n display: block;\n background-color: #ffffffcc !important;\n border: none !important;\n outline: none !important;\n margin: 0.25rem 0.25rem 0 0.25rem !important;\n padding: 0.25rem !important;\n font-size: 1rem !important;\n font-weight: 500 !important;\n border-radius: 5px !important;\n }\n }\n\n .rc-panel-steps {\n margin: -3rem 0 0 0 !important;\n padding-top: 4rem !important;\n\n &.rc-panel-steps-l,\n &.rc-panel-steps-s {\n display: flex !important;\n justify-content: space-between !important;\n\n .rc-panel-step {\n position: relative;\n flex-grow: 1 !important;\n margin: 0.25rem !important;\n text-align: center;\n padding: 0 !important;\n background: #ffffffcc;\n transition: background-color 0.2s;\n\n // &:focus {\n // outline: 3px solid black !important;\n // }\n\n .rc-panel-step-use {\n position: absolute;\n right: 0;\n top: 0;\n padding: 0 0.3rem !important;\n margin: 0 !important;\n font-size: 1rem !important;\n line-height: 170% !important;\n\n svg {\n width: 1rem;\n height: 1rem;\n fill: var(--rc-panel-darken-color);\n }\n }\n\n .rc-panel-step-name {\n line-height: 150% !important;\n font-size: 1rem !important;\n font-weight: 700 !important;\n color: var(--rc-panel-darken-color);\n white-space: nowrap;\n }\n }\n }\n\n &.rc-panel-steps-l {\n flex-flow: row nowrap;\n max-width: 100%;\n overflow-x: scroll;\n\n .rc-panel-step-name {\n margin: 1.5rem 0.5rem !important;\n }\n\n .rc-panel-step-use-tip {\n position: absolute !important;\n display: flex !important;\n bottom: 110% !important;\n left: 50% !important;\n transform: translate(-50%, 0) !important;\n }\n }\n\n &.rc-panel-steps-s {\n flex-flow: column nowrap;\n overflow-x: hidden;\n\n .rc-panel-step {\n text-align: left;\n overflow-x: hidden;\n white-space: nowrap;\n }\n\n .rc-panel-step-name {\n margin: 1.2rem 0.75rem 1.2rem 1.5rem !important;\n }\n\n .rc-panel-step-use-tip {\n position: relative !important;\n display: inline-flex !important;\n }\n }\n\n .rc-panel-step {\n border-radius: 7px !important;\n border: none !important;\n\n .rc-panel-step-name {\n position: relative !important;\n display: inline-block !important;\n }\n }\n\n // .rc-panel-next-button {\n // .rc-panel-step-name::after {\n // content: ' →' !important;\n // }\n // }\n\n .rc-panel-step-use-tip {\n // visibility: hidden;\n // backdrop-filter: blur(2px);\n // box-shadow: rgba(0, 0, 0, 0.1) 0px 0px 8px !important;\n opacity: 0;\n width: max-content !important;\n background-color: #ff9a00ee !important;\n color: #fff !important;\n text-align: center !important;\n justify-content: center !important;\n align-items: center !important;\n font-size: 0.75rem !important;\n font-weight: 500 !important;\n border-radius: 7px !important;\n border: none !important;\n padding: 0.7rem 0.5rem !important;\n margin: 0 !important;\n z-index: 10 !important;\n line-height: 100% !important;\n transition: opacity 0.2s;\n pointer-events: none;\n\n svg {\n width: 0.75rem;\n height: 0.75rem;\n fill: #fff;\n }\n\n svg:last-of-type {\n margin-right: 5px;\n }\n }\n\n .rc-panel-step-todo {\n &:hover,\n &:focus {\n background-color: #fff;\n\n .rc-panel-step-use-tip {\n // visibility: visible !important;\n opacity: 1 !important;\n }\n }\n\n &:active {\n background-color: #eeeeeecc;\n }\n }\n\n .rc-panel-step-finished {\n background-color: #bbbbbbcc !important;\n }\n\n .rc-panel-step-inactive {\n opacity: 0.6;\n pointer-events: none;\n }\n\n .rc-panel-step-active {\n opacity: 1;\n cursor: pointer;\n }\n }\n\n ::-webkit-scrollbar {\n width: 0;\n display: none;\n }\n\n /* ---------------------------------- DEBUG --------------------------------- */\n\n .rc-panel-debug-control {\n margin: 0;\n margin-top: 1rem;\n padding: 0.5rem;\n border: 3px solid #ee0000;\n border-radius: 7px;\n background-color: #ffffffcc;\n overflow: hidden;\n\n * {\n color: #ac0d0d;\n }\n\n h2,\n h3,\n p {\n margin: 0 !important;\n }\n\n h2 {\n font-weight: 700 !important;\n font-size: 1.2rem !important;\n }\n\n h3 {\n font-variant: small-caps;\n font-size: 0.9rem;\n font-weight: 500;\n padding-top: 0.5rem;\n padding-bottom: 0.3rem;\n }\n\n .rc-panel-debug-bold-text {\n font-size: 1rem !important;\n font-weight: bold;\n }\n\n .rc-panel-debug-control-next {\n font-size: 0.9rem !important;\n margin: 1rem 0 0 0;\n color: #fff;\n background-color: #ee0000;\n padding: 0.5rem 1.2rem !important;\n border-radius: 5px;\n border: none;\n cursor: pointer;\n\n &:hover {\n background-color: #ac0d0d;\n }\n }\n\n .rc-panel-debug-control-task-row {\n display: inline-flex;\n justify-content: flex-start !important;\n width: 100%;\n\n .value-element {\n flex-grow: 1;\n padding: 0 0.1rem;\n overflow-x: hidden;\n white-space: nowrap;\n // max-width: 10rem;\n user-select: none;\n pointer-events: none;\n\n &:first-of-type {\n padding-left: 0;\n }\n\n &:last-of-type {\n padding-right: 0;\n }\n\n p {\n padding-left: 1px !important;\n line-height: 150% !important;\n font-size: 0.65rem !important;\n color: #ac0d0d;\n }\n\n input {\n margin: 0 !important;\n padding: 0.3rem !important;\n font-size: 0.8rem;\n width: 100%;\n border: 1px solid #ee9999 !important;\n border-radius: 3px !important;\n background-color: #ffffffcc;\n user-select: auto;\n pointer-events: auto;\n }\n }\n }\n }\n}\n"],sourceRoot:""}]);const o=i},5151:(e,t,n)=>{"use strict";n.d(t,{A:()=>o});var s=n(1354),r=n.n(s),a=n(6314),i=n.n(a)()(r());i.push([e.id,"#size-card,#size-usba,#size-usbc{display:block;height:auto;left:2rem;position:absolute;z-index:2}#size-arrow{display:block;height:auto;position:absolute;width:70px;z-index:1}#size-arrow-fill{transition:fill .3s}.minor{transition:opacity .25s}.rc-slider:active~.size-obj .minor{opacity:0}#matching-obj{background-color:#fff;border:none;border-radius:7px;font-size:1.1rem;font-weight:600;margin-bottom:unset;margin-left:.3rem;margin-right:.3rem;margin-top:unset;padding-bottom:unset;padding-left:.3rem;padding-right:.3rem;padding-top:unset;pointer-events:auto!important;vertical-align:middle}@media(min-width:481px){.rc-size-obj-selection{display:inline-flex}}@media(max-width:480px){.rc-size-obj-selection{display:inline-block}}","",{version:3,sources:["webpack://./src/css/screenSize.scss"],names:[],mappings:"AAAA,iCAIE,aAAA,CAGA,WAAA,CADA,SAAA,CAHA,iBAAA,CAKA,SAAA,CAGF,YAEE,aAAA,CAGA,WAAA,CAJA,iBAAA,CAGA,UAAA,CAEA,SAAA,CAGF,iBACE,mBAAA,CAGF,OACE,uBAAA,CAIF,mCACE,SAAA,CAKF,cAGE,qBAAA,CADA,WAAA,CADA,iBAAA,CAMA,gBAAA,CADA,eAAA,CADA,mBAAA,CAAA,iBAAA,CAAA,kBAAA,CAAA,gBAAA,CADA,oBAAA,CAAA,kBAAA,CAAA,mBAAA,CAAA,iBAAA,CAKA,6BAAA,CADA,qBACA,CAGF,wBACE,uBACE,mBAAA,CAAA,CAIJ,wBACE,uBACE,oBAAA,CAAA",sourcesContent:["#size-card,\n#size-usba,\n#size-usbc {\n position: absolute;\n display: block;\n /* top: calc(max(45%, 200px) + 50px); */\n left: 2rem;\n height: auto;\n z-index: 2;\n}\n\n#size-arrow {\n position: absolute;\n display: block;\n /* display: none; */\n width: 70px;\n height: auto;\n z-index: 1;\n}\n\n#size-arrow-fill {\n transition: fill 0.3s;\n}\n\n.minor {\n transition: opacity 0.25s;\n}\n\n/* .rc-slider:hover ~ .size-obj .minor, */\n.rc-slider:active ~ .size-obj .minor {\n opacity: 0;\n}\n\n/* -------------------------------------------------------------------------- */\n\n#matching-obj {\n border-radius: 7px;\n border: none;\n background-color: #fff;\n padding: unset 0.3rem;\n margin: unset 0.3rem;\n font-weight: 600;\n font-size: 1.1rem;\n vertical-align: middle;\n pointer-events: auto !important;\n}\n\n@media (min-width: 481px) {\n .rc-size-obj-selection {\n display: inline-flex;\n }\n}\n\n@media (max-width: 480px) {\n .rc-size-obj-selection {\n display: inline-block;\n }\n}\n"],sourceRoot:""}]);const o=i},5319:(e,t,n)=>{"use strict";n.d(t,{A:()=>o});var s=n(1354),r=n.n(s),a=n(6314),i=n.n(a)()(r());i.push([e.id,".rc-slider{-webkit-appearance:none;-moz-appearance:none;appearance:none;background:linear-gradient(90deg,#ffc772,#ffc772 60%,#fff 0);border-radius:5px;cursor:grab;direction:ltr!important;display:block;height:10px;left:2rem;opacity:1;position:absolute;transition:opacity .3s;width:calc(100% - 4rem);z-index:10}.rc-slider::-webkit-slider-thumb{-webkit-appearance:none;appearance:none;background:#ff9a00;border:1px solid #cc7a00;border-radius:15px;box-shadow:0 0 12px 0 rgba(136,82,0,.2);cursor:inherit;height:30px;width:30px}.rc-slider::-moz-range-thumb{-moz-appearance:none;appearance:none;background:#ff9a00;border:1px solid #cc7a00;border-radius:15px;box-shadow:0 0 12px 0 rgba(136,82,0,.2);cursor:inherit;height:30px;width:30px}.rc-slider::-ms-thumb{appearance:none;background:#ff9a00;border:1px solid #cc7a00;border-radius:15px;box-shadow:0 0 12px 0 rgba(136,82,0,.2);cursor:inherit;height:30px;width:30px}","",{version:3,sources:["webpack://./src/css/slider.scss"],names:[],mappings:"AAAA,WAGE,uBAAA,CAAA,oBAAA,CAAA,eAAA,CAGA,4DAAA,CAIA,iBAAA,CAEA,WAAA,CAEA,uBAAA,CAZA,aAAA,CAGA,WAAA,CAIA,SAAA,CAFA,SAAA,CANA,iBAAA,CAYA,sBAAA,CATA,uBAAA,CAOA,UAGA,CAkBF,iCAVE,uBAAA,CAAA,eAAA,CAKA,kBAAA,CADA,wBAAA,CADA,kBAAA,CAGA,uCAAA,CACA,cAAA,CALA,WAAA,CADA,UAMA,CAOF,6BAdE,oBAAA,CAAA,eAAA,CAKA,kBAAA,CADA,wBAAA,CADA,kBAAA,CAGA,uCAAA,CACA,cAAA,CALA,WAAA,CADA,UAMA,CAWF,sBAlBE,eAAA,CAKA,kBAAA,CADA,wBAAA,CADA,kBAAA,CAGA,uCAAA,CACA,cAAA,CALA,WAAA,CADA,UAMA",sourcesContent:[".rc-slider {\n position: absolute;\n display: block;\n appearance: none;\n width: calc(100% - 4rem);\n height: 10px;\n background: linear-gradient(90deg, #ffc772, #ffc772 60%, #fff 60%);\n opacity: 1;\n /* top: max(45%, 200px); */\n left: 2rem;\n border-radius: 5px;\n z-index: 10;\n cursor: grab;\n transition: opacity 0.3s;\n direction: ltr !important;\n}\n\n// .rc-slider:hover {\n// opacity: 1;\n// }\n\n@mixin thumb-style {\n appearance: none;\n width: 30px;\n height: 30px;\n border-radius: 15px;\n border: 1px solid #cc7a00;\n background: #ff9a00;\n box-shadow: 0 0 12px 0 #88520033;\n cursor: inherit;\n}\n\n.rc-slider::-webkit-slider-thumb {\n @include thumb-style;\n}\n\n.rc-slider::-moz-range-thumb {\n @include thumb-style;\n}\n\n.rc-slider::-ms-thumb {\n @include thumb-style;\n}\n"],sourceRoot:""}]);const o=i},4889:(e,t,n)=>{"use strict";n.d(t,{A:()=>o});var s=n(1354),r=n.n(s),a=n(6314),i=n.n(a)()(r());i.push([e.id,"#webgazerVideoContainer .webgazer-videoinput-select{background:hsla(0,0%,100%,.8)!important;border:none!important;border-radius:.6rem!important;color:#666;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen,Ubuntu,Cantarell,Open Sans,Helvetica Neue,sans-serif;font-size:.6rem;left:0;line-height:100%;margin:.3rem;outline:none!important;padding:.2rem .3rem;position:absolute;top:0;z-index:9}","",{version:3,sources:["webpack://./src/css/video.scss"],names:[],mappings:"AACE,oDAcE,uCAAA,CAHA,qBAAA,CAEA,6BAAA,CAEA,UAAA,CARA,wHAAA,CAEA,eAAA,CALA,MAAA,CAMA,gBAAA,CALA,YAAA,CAOA,sBAAA,CANA,mBAAA,CAJA,iBAAA,CACA,KAAA,CAFA,SAcA",sourcesContent:["#webgazerVideoContainer {\n .webgazer-videoinput-select {\n z-index: 9;\n position: absolute;\n top: 0;\n left: 0;\n margin: 0.3rem;\n padding: 0.2rem 0.3rem;\n font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen,\n Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;\n font-size: 0.6rem;\n line-height: 100%;\n border: none !important;\n outline: none !important;\n border-radius: 0.6rem !important;\n background: #ffffffcc !important;\n color: #666;\n }\n}\n"],sourceRoot:""}]);const o=i},9057:(e,t,n)=>{"use strict";n.d(t,{A:()=>o});var s=n(1354),r=n.n(s),a=n(6314),i=n.n(a)()(r());i.push([e.id,"#gaze-system-instruction{top:65%;white-space:pre}.gaze-nudge-instruction{top:65%}.gaze-calibration-dot{background:#ff005c80;cursor:auto;display:block;position:fixed!important;transition-timing-function:ease-in-out;transition:left .5s,right .5s,top .5s,bottom .5s;z-index:999999998}.gaze-calibration-dot-click{background:#ff005c;cursor:pointer;margin:auto;position:absolute;text-align:center;vertical-align:middle}.gaze-calibration-dot-click:active{opacity:.3}.gaze-calibration-dot-text{color:#fff;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen,Ubuntu,Cantarell,Open Sans,Helvetica Neue,sans-serif;font-size:.9rem;font-weight:500;vertical-align:text-bottom}#webgazerGazeDot,#webgazerGazeDot-tempClone,.gaze-calibration-dot-text{pointer-events:none;-webkit-user-select:none;-moz-user-select:none;user-select:none}#webgazerGazeDot,#webgazerGazeDot-tempClone{background-color:#111d5e;border-radius:5px;opacity:.5;position:fixed;z-index:9999999999}#webgazerVideoContainer{border-radius:5px;display:block;overflow:hidden;position:fixed!important;transform-origin:bottom left;z-index:999999997}#webgazerFaceFeedbackBox,#webgazerVideoContainer,#webgazerVideoContainer *{-webkit-user-select:none;-moz-user-select:none;user-select:none}#webgazerFaceFeedbackBox{border-radius:10px;box-sizing:border-box;opacity:.6;pointer-events:none}.rc-crosshair,.rc-gaze-nudger-arrows{position:absolute;-webkit-user-select:none;-moz-user-select:none;user-select:none}.rc-crosshair{border-radius:50%;cursor:pointer;display:block;height:40px;position:fixed!important;transition-timing-function:ease-in-out;transition:left .5s,right .5s,top .5s,bottom .5s;width:40px;z-index:999999999}.rc-crosshair-component{background-color:#000;left:50%;margin:auto;pointer-events:none;position:absolute;top:50%;transform:translate(-50%,-50%);-webkit-user-select:none;-moz-user-select:none;user-select:none}","",{version:3,sources:["webpack://./src/css/gaze.css"],names:[],mappings:"AAAA,yBACE,OAAQ,CACR,eACF,CAEA,wBACE,OACF,CAEA,sBACE,oBAAqB,CAGrB,WAAe,CADf,aAAc,CADd,wBAA0B,CAI1B,sCAAuC,CACvC,gDAIa,CANb,iBAOF,CAEA,4BAEE,kBAAmB,CAEnB,cAAe,CADf,WAAY,CAFZ,iBAAkB,CAIlB,iBAAkB,CAClB,qBACF,CAEA,mCACE,UACF,CAEA,2BAIE,UAAW,CAHX,wHAC8D,CAG9D,eAAiB,CAFjB,eAAgB,CAGhB,0BAGF,CAIA,uEALE,mBAAoB,CADpB,wBAAiB,CAAjB,qBAAiB,CAAjB,gBAeF,CATA,4CAKE,wBAAyB,CACzB,iBAAkB,CAFlB,UAAY,CAFZ,cAAe,CACf,kBAMF,CAEA,wBAKE,iBAAkB,CAHlB,aAAc,CAKd,eAAgB,CAJhB,wBAA0B,CAC1B,4BAA6B,CAH7B,iBASF,CAMA,2EAPE,wBAAiB,CAAjB,qBAAiB,CAAjB,gBAcF,CAPA,yBAGE,kBAAmB,CADnB,qBAAsB,CAEtB,UAAY,CACZ,mBAEF,CAIA,qCAEE,iBAAkB,CAIlB,wBAAiB,CAAjB,qBAAiB,CAAjB,gBACF,CAEA,cAcE,iBAAkB,CARlB,cAAe,CAJf,aAAc,CAEd,WAAY,CAHZ,wBAA0B,CAM1B,sCAAuC,CACvC,gDAIa,CATb,UAAW,CAEX,iBAUF,CAEA,wBAQE,qBAAsB,CALtB,QAAS,CAET,WAAY,CACZ,mBAAoB,CALpB,iBAAkB,CAClB,OAAQ,CAER,8BAAgC,CAGhC,wBAAiB,CAAjB,qBAAiB,CAAjB,gBAEF",sourcesContent:["#gaze-system-instruction {\n top: 65%;\n white-space: pre;\n}\n\n.gaze-nudge-instruction {\n top: 65%;\n}\n\n.gaze-calibration-dot {\n background: #ff005c80;\n position: fixed !important;\n display: block;\n cursor: initial;\n z-index: 999999998;\n transition-timing-function: ease-in-out;\n transition:\n left 0.5s,\n right 0.5s,\n top 0.5s,\n bottom 0.5s;\n}\n\n.gaze-calibration-dot-click {\n position: absolute;\n background: #ff005c;\n margin: auto;\n cursor: pointer;\n text-align: center;\n vertical-align: middle;\n}\n\n.gaze-calibration-dot-click:active {\n opacity: 0.3;\n}\n\n.gaze-calibration-dot-text {\n font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen,\n Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;\n font-weight: 500;\n color: #fff;\n font-size: 0.9rem;\n vertical-align: text-bottom;\n user-select: none;\n pointer-events: none;\n}\n\n/* ----------------------------- WebGazer Native ---------------------------- */\n\n#webgazerGazeDot,\n#webgazerGazeDot-tempClone {\n position: fixed;\n z-index: 9999999999;\n opacity: 0.5;\n background-color: #111d5e;\n border-radius: 5px;\n pointer-events: none;\n user-select: none;\n}\n\n#webgazerVideoContainer {\n z-index: 999999997;\n display: block;\n position: fixed !important;\n transform-origin: bottom left;\n border-radius: 5px;\n /* opacity: 0.8; */\n overflow: hidden;\n /* pointer-events: none; */\n user-select: none;\n}\n\n#webgazerVideoContainer * {\n user-select: none;\n}\n\n#webgazerFaceFeedbackBox {\n /* TODO Set style in sub-module */\n box-sizing: border-box;\n border-radius: 10px;\n opacity: 0.6;\n pointer-events: none;\n user-select: none;\n}\n\n/* ------------------------------- Gaze Nudger ------------------------------ */\n\n.rc-crosshair,\n.rc-gaze-nudger-arrows {\n position: absolute;\n /* top: 50%;\n left: 50%;\n transform: translate(-50%, -50%); */\n user-select: none;\n}\n\n.rc-crosshair {\n position: fixed !important;\n display: block;\n width: 40px;\n height: 40px;\n z-index: 999999999;\n cursor: pointer;\n transition-timing-function: ease-in-out;\n transition:\n left 0.5s,\n right 0.5s,\n top 0.5s,\n bottom 0.5s;\n /* filter: drop-shadow(0 0 3px #fff); */\n border-radius: 50%;\n}\n\n.rc-crosshair-component {\n position: absolute;\n top: 50%;\n left: 50%;\n transform: translate(-50%, -50%);\n margin: auto;\n pointer-events: none;\n user-select: none;\n background-color: #000;\n}\n"],sourceRoot:""}]);const o=i},9725:(e,t,n)=>{"use strict";n.d(t,{A:()=>o});var s=n(1354),r=n.n(s),a=n(6314),i=n.n(a)()(r());i.push([e.id,"#calibration-background{bottom:0;box-sizing:border-box;height:100%;left:0;margin:0;overflow:hidden;overflow-y:scroll;position:fixed;right:0;scrollbar-width:none;text-align:center;top:0;-webkit-user-select:none;-moz-user-select:none;user-select:none;width:100%;z-index:999999990}#calibration-background::-webkit-scrollbar{display:none;width:0}#calibration-background *{font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen,Ubuntu,Cantarell,Open Sans,Helvetica Neue,sans-serif}#calibration-background p{line-height:150%}.calibration-instruction{pointer-events:none;position:absolute;-webkit-user-select:none;-moz-user-select:none;user-select:none}.calibration-instruction-scrollable{height:200%}.calibration-instruction h1{font-weight:700;min-width:360px}.calibration-instruction *{font-size:1.2rem;line-height:170%;margin:0;padding:0}.calibration-instruction p{margin-top:1rem;white-space:pre-line}.calibration-description{line-height:170%}.rc-hang-description{font-size:1rem!important;margin-top:50vh!important}@media (min-width:481px){.calibration-instruction{margin:2rem}.calibration-instruction h1{font-size:2.5rem!important;line-height:100%}.calibration-description{width:calc(100% - 4rem);width:max(min(100% - 4rem,960px),300px)}.calibration-description,.calibration-description *{font-size:1.2rem}.calibration-credit-text{font-size:.9rem!important}}@media (max-width:480px){.calibration-instruction{margin:1rem}.calibration-instruction h1{font-size:1.8rem!important;line-height:120%}.calibration-description{width:calc(100% - 1rem)}.calibration-description,.calibration-description *{font-size:1rem}.calibration-credit-text{font-size:.7rem!important}}.float-instruction{background:hsla(0,0%,100%,.9);border-radius:10px;font-size:1rem;font-weight:500;left:50%;margin:0;max-width:25rem;padding:10px 17px;position:fixed;text-align:center;transform:translate(-50%);-webkit-user-select:none;-moz-user-select:none;user-select:none;z-index:999999991}.swal2-container{z-index:999999999!important}.calibration-credit-text{bottom:3px!important;color:#999!important;line-height:100%!important;margin:0!important;padding:0!important;position:fixed!important;text-align:center!important;width:100%!important}.lock-view{overflow:hidden!important}.rc-lang-ltr{direction:ltr!important;text-align:left!important}.rc-lang-rtl{direction:rtl!important;text-align:right!important}.cursor-grab{cursor:grab}.cursor-grabbing{cursor:grabbing}","",{version:3,sources:["webpack://./src/css/main.css"],names:[],mappings:"AACA,wBAQE,QAAS,CAMT,qBAAsB,C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BACF,CAMA,aACE,WACF,CAEA,iBACE,eACF",sourcesContent:["/* background div */\n#calibration-background {\n z-index: 999999990;\n position: fixed;\n width: 100%;\n height: 100%;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n margin: 0;\n /* background: #eee; */\n overflow: hidden;\n overflow-y: scroll;\n user-select: none;\n box-sizing: border-box;\n text-align: center;\n scrollbar-width: none;\n}\n\n#calibration-background::-webkit-scrollbar {\n width: 0;\n display: none;\n}\n\n#calibration-background * {\n font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen,\n Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;\n}\n\n#calibration-background p {\n line-height: 150%;\n}\n\n.calibration-instruction {\n position: absolute;\n user-select: none;\n pointer-events: none;\n}\n\n.calibration-instruction-scrollable {\n height: 200%;\n}\n\n.calibration-instruction h1 {\n min-width: 360px;\n font-weight: 700;\n}\n\n.calibration-instruction * {\n font-size: 1.2rem;\n line-height: 170%;\n margin: 0;\n padding: 0;\n}\n\n.calibration-instruction p {\n white-space: pre-line;\n margin-top: 1rem;\n}\n\n.calibration-description {\n line-height: 170%;\n}\n\n.rc-hang-description {\n margin-top: 50vh !important;\n font-size: 1rem !important;\n}\n\n/* -------------------------------------------------------------------------- */\n/* Screen size specific */\n\n@media (min-width: 481px) {\n .calibration-instruction {\n margin: 2rem;\n }\n\n .calibration-instruction h1 {\n line-height: 100%;\n font-size: 2.5rem !important;\n }\n\n .calibration-description {\n width: calc(100% - 4rem);\n width: max(min(100% - 4rem, 960px), 300px);\n }\n\n .calibration-description,\n .calibration-description * {\n font-size: 1.2rem;\n }\n\n .calibration-credit-text {\n font-size: 0.9rem !important;\n }\n}\n\n@media (max-width: 480px) {\n .calibration-instruction {\n margin: 1rem;\n }\n\n .calibration-instruction h1 {\n line-height: 120%;\n font-size: 1.8rem !important;\n }\n\n .calibration-description {\n width: calc(100% - 1rem);\n }\n\n .calibration-description,\n .calibration-description * {\n font-size: 1rem;\n }\n\n .calibration-credit-text {\n font-size: 0.7rem !important;\n }\n}\n\n.float-instruction {\n position: fixed;\n text-align: center;\n user-select: none;\n background: rgba(255, 255, 255, 0.9);\n padding: 10px 17px;\n margin: 0;\n left: 50%;\n max-width: 25rem;\n transform: translate(-50%, 0);\n border-radius: 10px;\n font-size: 1rem;\n font-weight: 500;\n z-index: 999999991;\n}\n\n/* -------------------------------------------------------------------------- */\n\n.swal2-container {\n z-index: 999999999 !important;\n}\n\n/* -------------------------------------------------------------------------- */\n\n.calibration-credit-text {\n position: fixed !important;\n width: 100% !important;\n bottom: 3px !important;\n color: #999 !important;\n margin: 0 !important;\n padding: 0 !important;\n line-height: 100% !important;\n text-align: center !important;\n}\n\n/* -------------------------------------------------------------------------- */\n\n.lock-view {\n overflow: hidden !important;\n}\n\n/* -------------------------------------------------------------------------- */\n\n.rc-lang-ltr {\n direction: ltr !important;\n text-align: left !important;\n}\n\n.rc-lang-rtl {\n direction: rtl !important;\n text-align: right !important;\n}\n\n/* -------------------------------------------------------------------------- */\n/* --------------------------------- CURSOR --------------------------------- */\n/* -------------------------------------------------------------------------- */\n\n.cursor-grab {\n cursor: grab;\n}\n\n.cursor-grabbing {\n cursor: grabbing;\n}\n"],sourceRoot:""}]);const o=i},2535:(e,t,n)=>{"use strict";n.d(t,{A:()=>o});var s=n(1354),r=n.n(s),a=n(6314),i=n.n(a)()(r());i.push([e.id,".swal2-container{font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen,Ubuntu,Cantarell,Open Sans,Helvetica Neue,sans-serif!important}.my__swal2__icon{font-weight:700!important;-webkit-user-select:none!important;-moz-user-select:none!important;user-select:none!important}.my__swal2__icon *{color:#ff9a00!important}.my__swal2__title{color:#000!important;font-size:2rem!important;font-weight:700!important}.my__swal2__html,.my__swal2__title{-webkit-user-select:none!important;-moz-user-select:none!important;user-select:none!important}.my__swal2__html{color:#444!important;font-size:1.2rem!important;font-weight:400!important;line-height:150%!important;margin:1.6rem}.my__swal2__html__center{text-align:center!important}.animate__animated.animate__fadeInUp,.animate__animated.animate__fadeOutDown{--animate-duration:400ms!important;--animate-delay:0!important}.fadeInUp,.fadeOutDown{animation-delay:0!important;animation-duration:.4s!important}","",{version:3,sources:["webpack://./src/css/swal.css"],names:[],mappings:"AAAA,iBACE,kIAEF,CAEA,iBACE,yBAA4B,CAC5B,kCAA4B,CAA5B,+BAA4B,CAA5B,0BACF,CAEA,mBACE,uBACF,CAEA,kBACE,oBAAsB,CACtB,wBAA0B,CAC1B,yBAEF,CAEA,mCAHE,kCAA4B,CAA5B,+BAA4B,CAA5B,0BAUF,CAPA,iBAEE,oBAAsB,CACtB,0BAA4B,CAE5B,yBAA8B,CAD9B,0BAA4B,CAH5B,aAMF,CAEA,yBACE,2BACF,CAEA,6EAEE,kCAAoC,CACpC,2BACF,CAEA,uBAGE,2BAA6B,CAD7B,gCAEF",sourcesContent:[".swal2-container {\n font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen,\n Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif !important;\n}\n\n.my__swal2__icon {\n font-weight: bold !important;\n user-select: none !important;\n}\n\n.my__swal2__icon * {\n color: #ff9a00 !important;\n}\n\n.my__swal2__title {\n color: #000 !important;\n font-size: 2rem !important;\n font-weight: bold !important;\n user-select: none !important;\n}\n\n.my__swal2__html {\n margin: 1.6rem;\n color: #444 !important;\n font-size: 1.2rem !important;\n line-height: 150% !important;\n font-weight: normal !important;\n user-select: none !important;\n}\n\n.my__swal2__html__center {\n text-align: center !important;\n}\n\n.animate__animated.animate__fadeInUp,\n.animate__animated.animate__fadeOutDown {\n --animate-duration: 400ms !important;\n --animate-delay: 0 !important;\n}\n\n.fadeInUp,\n.fadeOutDown {\n animation-duration: 400ms !important;\n animation-delay: 0 !important;\n}\n"],sourceRoot:""}]);const o=i},6314:e=>{"use strict";e.exports=function(e){var t=[];return t.toString=function(){return this.map((function(t){var n="",s=void 0!==t[5];return t[4]&&(n+="@supports (".concat(t[4],") {")),t[2]&&(n+="@media ".concat(t[2]," {")),s&&(n+="@layer".concat(t[5].length>0?" ".concat(t[5]):""," {")),n+=e(t),s&&(n+="}"),t[2]&&(n+="}"),t[4]&&(n+="}"),n})).join("")},t.i=function(e,n,s,r,a){"string"==typeof e&&(e=[[null,e,void 0]]);var i={};if(s)for(var o=0;o0?" ".concat(c[5]):""," {").concat(c[1],"}")),c[5]=a),n&&(c[2]?(c[1]="@media ".concat(c[2]," {").concat(c[1],"}"),c[2]=n):c[2]=n),r&&(c[4]?(c[1]="@supports (".concat(c[4],") {").concat(c[1],"}"),c[4]=r):c[4]="".concat(r)),t.push(c))}},t}},1354:e=>{"use strict";e.exports=function(e){var t=e[1],n=e[3];if(!n)return t;if("function"==typeof btoa){var s=btoa(unescape(encodeURIComponent(JSON.stringify(n)))),r="sourceMappingURL=data:application/json;charset=utf-8;base64,".concat(s),a="/*# ".concat(r," */");return[t].concat([a]).join("\n")}return[t].join("\n")}},7158:function(e){var t=function(){"use strict";var e,t,n,s,r,a,i,o,l,u,c,h,d,p,f,m,g,y,b,w,v,x,A,k="leader-line",C=1,S=2,E=3,_=4,I={top:C,right:S,bottom:E,left:_},T=1,N=2,O=3,R=4,D=5,M={straight:T,arc:N,fluid:O,magnet:R,grid:D},F="behind",B=k+"-defs",z='',L={disc:{elmId:"leader-line-disc",noRotate:!0,bBox:{left:-5,top:-5,width:10,height:10,right:5,bottom:5},widthR:2.5,heightR:2.5,bCircle:5,sideLen:5,backLen:5,overhead:0,outlineBase:1,outlineMax:4},square:{elmId:"leader-line-square",noRotate:!0,bBox:{left:-5,top:-5,width:10,height:10,right:5,bottom:5},widthR:2.5,heightR:2.5,bCircle:5,sideLen:5,backLen:5,overhead:0,outlineBase:1,outlineMax:4},arrow1:{elmId:"leader-line-arrow1",bBox:{left:-8,top:-8,width:16,height:16,right:8,bottom:8},widthR:4,heightR:4,bCircle:8,sideLen:8,backLen:8,overhead:8,outlineBase:2,outlineMax:1.5},arrow2:{elmId:"leader-line-arrow2",bBox:{left:-7,top:-8,width:11,height:16,right:4,bottom:8},widthR:2.75,heightR:4,bCircle:8,sideLen:8,backLen:7,overhead:4,outlineBase:1,outlineMax:1.75},arrow3:{elmId:"leader-line-arrow3",bBox:{left:-4,top:-5,width:12,height:10,right:8,bottom:5},widthR:3,heightR:2.5,bCircle:8,sideLen:5,backLen:4,overhead:8,outlineBase:1,outlineMax:2.5},hand:{elmId:"leader-line-hand",bBox:{left:-3,top:-12,width:40,height:24,right:37,bottom:12},widthR:10,heightR:6,bCircle:37,sideLen:12,backLen:3,overhead:37},crosshair:{elmId:"leader-line-crosshair",noRotate:!0,bBox:{left:-96,top:-96,width:192,height:192,right:96,bottom:96},widthR:48,heightR:48,bCircle:96,sideLen:96,backLen:96,overhead:0}},P={behind:F,disc:"disc",square:"square",arrow1:"arrow1",arrow2:"arrow2",arrow3:"arrow3",hand:"hand",crosshair:"crosshair"},V={disc:"disc",square:"square",arrow1:"arrow1",arrow2:"arrow2",arrow3:"arrow3",hand:"hand",crosshair:"crosshair"},W=[C,S,E,_],U="auto",G={x:"left",y:"top",width:"width",height:"height"},q=80,j=4,H=5,$=120,K=8,X=3.75,Z=10,Y=30,Q=.5522847,J=.25*Math.PI,ee=/^\s*(\-?[\d\.]+)\s*(\%)?\s*$/,te="http://www.w3.org/2000/svg",ne="-ms-scroll-limit"in document.documentElement.style&&"-ms-ime-align"in document.documentElement.style&&!window.navigator.msPointerEnabled,se=!ne&&!!document.uniqueID,re="MozAppearance"in document.documentElement.style,ae=!(ne||re||!window.chrome||!window.CSS),ie=!(ne||se||re||ae||window.chrome||!("WebkitAppearance"in document.documentElement.style)),oe=se||ne?.2:.1,le={path:O,lineColor:"coral",lineSize:4,plugSE:[F,"arrow1"],plugSizeSE:[1,1],lineOutlineEnabled:!1,lineOutlineColor:"indianred",lineOutlineSize:.25,plugOutlineEnabledSE:[!1,!1],plugOutlineSizeSE:[1,1]},ue=(v={}.toString,x={}.hasOwnProperty.toString,A=x.call(Object),function(e){var t,n;return e&&"[object Object]"===v.call(e)&&(!(t=Object.getPrototypeOf(e))||(n=t.hasOwnProperty("constructor")&&t.constructor)&&"function"==typeof n&&x.call(n)===A)}),ce=Number.isFinite||function(e){return"number"==typeof e&&window.isFinite(e)},he=(p={ease:[.25,.1,.25,1],linear:[0,0,1,1],"ease-in":[.42,0,1,1],"ease-out":[0,0,.58,1],"ease-in-out":[.42,0,.58,1]},f=1e3/60/2,m=window.requestAnimationFrame||window.mozRequestAnimationFrame||window.webkitRequestAnimationFrame||window.msRequestAnimationFrame||function(e){setTimeout(e,f)},g=window.cancelAnimationFrame||window.mozCancelAnimationFrame||window.webkitCancelAnimationFrame||window.msCancelAnimationFrame||function(e){clearTimeout(e)},y=Number.isFinite||function(e){return"number"==typeof e&&window.isFinite(e)},b=[],w=0,{add:function(e,t,n,s,r,a,i){var o,l,u,c,h,d,m,g,y,v,x,A,k,C=++w;function S(t,n){return{value:e(n),timeRatio:t,outputRatio:n}}if("string"==typeof r&&(r=p[r]),e=e||function(){},n=this._endIndex||this._string[this._currentIndex]<"0"||"9"=this._endIndex||this._string[this._currentIndex]<"0"||"9"=this._endIndex)return null;var e=null,t=this._string[this._currentIndex];if(this._currentIndex+=1,"0"===t)e=0;else{if("1"!==t)return null;e=1}return this._skipOptionalSpacesOrDelimiter(),e}};var o=e.SVGPathElement.prototype.setAttribute,l=e.SVGPathElement.prototype.removeAttribute,u=e.Symbol?e.Symbol():"__cachedPathData",c=e.Symbol?e.Symbol():"__cachedNormalizedPathData",h=function(e,t,n,s,r,a,i,o,l,u){function c(e,t,n){return{x:e*Math.cos(n)-t*Math.sin(n),y:e*Math.sin(n)+t*Math.cos(n)}}var d,p,f,m,g,y,b,w,v,x,A,k,C,S,E,_=(d=i,Math.PI*d/180),I=[];u?(S=u[0],E=u[1],k=u[2],C=u[3]):(e=(p=c(e,t,-_)).x,t=p.y,1<(y=(m=(e-(n=(f=c(n,s,-_)).x))/2)*m/(r*r)+(g=(t-(s=f.y))/2)*g/(a*a))&&(r*=y=Math.sqrt(y),a*=y),v=(b=r*r)*(w=a*a)-b*g*g-w*m*m,x=b*g*g+w*m*m,k=(A=(o===l?-1:1)*Math.sqrt(Math.abs(v/x)))*r*g/a+(e+n)/2,C=A*-a*m/r+(t+s)/2,S=Math.asin(parseFloat(((t-C)/a).toFixed(9))),E=Math.asin(parseFloat(((s-C)/a).toFixed(9))),e120*Math.PI/180&&(T=E,N=n,O=s,E=l&&S=n.duration&&n.count&&n.loopsLeft<=1)return a=n.frames[n.lastFrame=n.reverse?0:n.frames.length-1],n.frameCallback(a.value,!0,a.timeRatio,a.outputRatio),void(n.framesStart=null);if(s>n.duration){if(r=Math.floor(s/n.duration),n.count){if(r>=n.loopsLeft)return a=n.frames[n.lastFrame=n.reverse?0:n.frames.length-1],n.frameCallback(a.value,!0,a.timeRatio,a.outputRatio),void(n.framesStart=null);n.loopsLeft-=r}n.framesStart+=n.duration*r,s=e-n.framesStart}n.reverse&&(s=n.duration-s),a=n.frames[n.lastFrame=Math.round(s/f)],!1!==n.frameCallback(a.value,!1,a.timeRatio,a.outputRatio)?t=!0:n.framesStart=null}})),t&&(d=m.call(window,ke))}function Ce(e,t){e.framesStart=Date.now(),null!=t&&(e.framesStart-=e.duration*(e.reverse?1-t:t)),e.loopsLeft=e.count,e.lastFrame=null,ke()}function Se(e,t){var n,s;return typeof e!=typeof t||(n=ue(e)?"obj":Array.isArray(e)?"array":"")!=(ue(t)?"obj":Array.isArray(t)?"array":"")||("obj"===n?Se(s=Object.keys(e).sort(),Object.keys(t).sort())||s.some((function(n){return Se(e[n],t[n])})):"array"===n?e.length!==t.length||e.some((function(e,n){return Se(e,t[n])})):e!==t)}function Ee(e){return e?ue(e)?Object.keys(e).reduce((function(t,n){return t[n]=Ee(e[n]),t}),{}):Array.isArray(e)?e.map(Ee):e:e}function _e(e){var t,n,s,r=1,a=e=(e+"").trim();function i(e){var t=1,n=ee.exec(e);return n&&(t=parseFloat(n[1]),n[2]?t=0<=t&&t<=100?t/100:1:(t<0||1=Math.abs(s)?0<=t?S:_:0<=s?E:C))}))),x.position_path!==A.position_path||x.position_lineStrokeWidth!==A.position_lineStrokeWidth||[0,1].some((function(e){return x.position_plugOverheadSE[e]!==A.position_plugOverheadSE[e]||(a=k[e],i=A.position_socketXYSE[e],a.x!==i.x||a.y!==i.y||a.socketId!==i.socketId)||(n=t[e],s=A.position_socketGravitySE[e],(r=null==n?"auto":Array.isArray(n)?"array":"number")!=(null==s?"auto":Array.isArray(s)?"array":"number")||("array"==r?n[0]!==s[0]||n[1]!==s[1]:n!==s));var n,s,r,a,i}))){switch(e.pathList.baseVal=s=[],e.pathList.animVal=null,x.position_path){case T:s.push([F(k[0]),F(k[1])]);break;case N:d="number"==typeof t[0]&&0j?(x.position_lineStrokeWidth-j)*H:0),e.socketId===C?((a=(e.y-n.y)/2)=t.x:t.dirId===a?e.y>=t.y:e.x<=t.x}function p(e,t){return t.dirId===n||t.dirId===a?e.x===t.x:e.y===t.y}function f(e){return e[0]?{contain:0,notContain:1}:{contain:1,notContain:0}}function m(e,t,n){return Math.abs(t[n]-e[n])}function g(e,t,s){return"x"===s?e.x=Y?g(l[t.notContain],l[t.contain],u[t.contain]):l[t.contain].dirId)):(s=[{x:l[0].x,y:l[0].y},{x:l[1].x,y:l[1].y}],o.forEach((function(e,t){var n=0===t?1:0,r=m(s[t],s[n],u[t]);rZ&&(l[a]-eZ&&(l[a]-es.outlineMax&&(t=s.outlineMax),t*=2*s.outlineBase,x=Xe(b,v.plugOutline_strokeWidthSE,e,t)||x,x=Xe(b,v.plugOutline_inStrokeWidthSE,e,v.plugOutline_colorTraSE[e]?t-oe/(v.line_strokeWidth/le.lineSize)/w.plugSizeSE[e]*2:t/2)||x)})),x)),(n.faces||he.line||he.plug||he.lineOutline||he.plugOutline)&&(he.faces=(C=(A=t).curStats,S=A.aplStats,E=A.events,_=!1,!C.line_altColor&&Xe(A,S,"line_color",k=C.line_color,E.apl_line_color)&&(A.lineFace.style.stroke=k,_=!0),Xe(A,S,"line_strokeWidth",k=C.line_strokeWidth,E.apl_line_strokeWidth)&&(A.lineShape.style.strokeWidth=k+"px",_=!0,(re||se)&&(qe(A,A.lineShape),se&&(qe(A,A.lineFace),qe(A,A.lineMaskCaps)))),Xe(A,S,"lineOutline_enabled",k=C.lineOutline_enabled,E.apl_lineOutline_enabled)&&(A.lineOutlineFace.style.display=k?"inline":"none",_=!0),C.lineOutline_enabled&&(Xe(A,S,"lineOutline_color",k=C.lineOutline_color,E.apl_lineOutline_color)&&(A.lineOutlineFace.style.stroke=k,_=!0),Xe(A,S,"lineOutline_strokeWidth",k=C.lineOutline_strokeWidth,E.apl_lineOutline_strokeWidth)&&(A.lineOutlineMaskShape.style.strokeWidth=k+"px",_=!0,se&&(qe(A,A.lineOutlineMaskCaps),qe(A,A.lineOutlineFace))),Xe(A,S,"lineOutline_inStrokeWidth",k=C.lineOutline_inStrokeWidth,E.apl_lineOutline_inStrokeWidth)&&(A.lineMaskShape.style.strokeWidth=k+"px",_=!0,se&&(qe(A,A.lineOutlineMaskCaps),qe(A,A.lineOutlineFace)))),Xe(A,S,"plug_enabled",k=C.plug_enabled,E.apl_plug_enabled)&&(A.plugsFace.style.display=k?"inline":"none",_=!0),C.plug_enabled&&[0,1].forEach((function(e){var t=C.plug_plugSE[e],n=t!==F?L[V[t]]:null,s=$e(e,n);Xe(A,S.plug_enabledSE,e,k=C.plug_enabledSE[e],E.apl_plug_enabledSE)&&(A.plugsFace.style[s.prop]=k?"url(#"+A.plugMarkerIdSE[e]+")":"none",_=!0),C.plug_enabledSE[e]&&(Xe(A,S.plug_plugSE,e,t,E.apl_plug_plugSE)&&(A.plugFaceSE[e].href.baseVal="#"+n.elmId,He(A,A.plugMarkerSE[e],s.orient,n.bBox,A.svg,A.plugMarkerShapeSE[e],A.plugsFace),_=!0,re&&qe(A,A.plugsFace)),Xe(A,S.plug_colorSE,e,k=C.plug_colorSE[e],E.apl_plug_colorSE)&&(A.plugFaceSE[e].style.fill=k,_=!0,(ae||ie||se)&&!C.line_colorTra&&qe(A,se?A.lineMaskCaps:A.capsMaskLine)),["markerWidth","markerHeight"].forEach((function(t){var n="plug_"+t+"SE";Xe(A,S[n],e,k=C[n][e],E["apl_"+n])&&(A.plugMarkerSE[e][t].baseVal.value=k,_=!0)})),Xe(A,S.plugOutline_enabledSE,e,k=C.plugOutline_enabledSE[e],E.apl_plugOutline_enabledSE)&&(k?(A.plugFaceSE[e].style.mask="url(#"+A.plugMaskIdSE[e]+")",A.plugOutlineFaceSE[e].style.display="inline"):(A.plugFaceSE[e].style.mask="none",A.plugOutlineFaceSE[e].style.display="none"),_=!0),C.plugOutline_enabledSE[e]&&(Xe(A,S.plugOutline_plugSE,e,t,E.apl_plugOutline_plugSE)&&(A.plugOutlineFaceSE[e].href.baseVal=A.plugMaskShapeSE[e].href.baseVal=A.plugOutlineMaskShapeSE[e].href.baseVal="#"+n.elmId,[A.plugMaskSE[e],A.plugOutlineMaskSE[e]].forEach((function(e){e.x.baseVal.value=n.bBox.left,e.y.baseVal.value=n.bBox.top,e.width.baseVal.value=n.bBox.width,e.height.baseVal.value=n.bBox.height})),_=!0),Xe(A,S.plugOutline_colorSE,e,k=C.plugOutline_colorSE[e],E.apl_plugOutline_colorSE)&&(A.plugOutlineFaceSE[e].style.fill=k,_=!0,se&&(qe(A,A.lineMaskCaps),qe(A,A.lineOutlineMaskCaps))),Xe(A,S.plugOutline_strokeWidthSE,e,k=C.plugOutline_strokeWidthSE[e],E.apl_plugOutline_strokeWidthSE)&&(A.plugOutlineMaskShapeSE[e].style.strokeWidth=k+"px",_=!0),Xe(A,S.plugOutline_inStrokeWidthSE,e,k=C.plugOutline_inStrokeWidthSE[e],E.apl_plugOutline_inStrokeWidthSE)&&(A.plugMaskShapeSE[e].style.strokeWidth=k+"px",_=!0)))})),_)),(n.position||he.line||he.plug)&&(he.position=Qe(t)),(n.path||he.position)&&(he.path=(N=(I=t).curStats,O=I.aplStats,R=I.pathList.animVal||I.pathList.baseVal,D=N.path_edge,M=!1,R&&(D.x1=D.x2=R[0][0].x,D.y1=D.y2=R[0][0].y,N.path_pathData=T=Le(R,(function(e){e.xD.x2&&(D.x2=e.x),e.y>D.y2&&(D.y2=e.y)})),Ve(T,O.path_pathData)&&(I.linePath.setPathData(T),O.path_pathData=T,M=!0,se?(qe(I,I.plugsFace),qe(I,I.lineMaskCaps)):re&&qe(I,I.linePath),I.events.apl_path&&I.events.apl_path.forEach((function(e){e(I,T)})))),M)),he.viewBox=(z=(B=t).curStats,P=B.aplStats,W=z.path_edge,U=z.viewBox_bBox,q=P.viewBox_bBox,j=B.svg.viewBox.baseVal,H=B.svg.style,$=!1,K=Math.max(z.line_strokeWidth/2,z.viewBox_plugBCircleSE[0]||0,z.viewBox_plugBCircleSE[1]||0),X={x1:W.x1-K,y1:W.y1-K,x2:W.x2+K,y2:W.y2+K},B.events.new_edge4viewBox&&B.events.new_edge4viewBox.forEach((function(e){e(B,X)})),U.x=z.lineMask_x=z.lineOutlineMask_x=z.maskBGRect_x=X.x1,U.y=z.lineMask_y=z.lineOutlineMask_y=z.maskBGRect_y=X.y1,U.width=X.x2-X.x1,U.height=X.y2-X.y1,["x","y","width","height"].forEach((function(e){var t;(t=U[e])!==q[e]&&(j[e]=q[e]=t,H[G[e]]=t+("x"===e||"y"===e?B.bodyOffset[e]:0)+"px",$=!0)})),$),he.mask=(Q=(Z=t).curStats,J=Z.aplStats,ee=!1,Q.plug_enabled?[0,1].forEach((function(e){Q.capsMaskMarker_enabledSE[e]=Q.plug_enabledSE[e]&&Q.plug_colorTraSE[e]||Q.plugOutline_enabledSE[e]&&Q.plugOutline_colorTraSE[e]})):Q.capsMaskMarker_enabledSE[0]=Q.capsMaskMarker_enabledSE[1]=!1,Q.capsMaskMarker_enabled=Q.capsMaskMarker_enabledSE[0]||Q.capsMaskMarker_enabledSE[1],Q.lineMask_outlineMode=Q.lineOutline_enabled,Q.caps_enabled=Q.capsMaskMarker_enabled||Q.capsMaskAnchor_enabledSE[0]||Q.capsMaskAnchor_enabledSE[1],Q.lineMask_enabled=Q.caps_enabled||Q.lineMask_outlineMode,(Q.lineMask_enabled&&!Q.lineMask_outlineMode||Q.lineOutline_enabled)&&["x","y"].forEach((function(e){var t="maskBGRect_"+e;Xe(Z,J,t,Y=Q[t])&&(Z.maskBGRect[e].baseVal.value=Y,ee=!0)})),Xe(Z,J,"lineMask_enabled",Y=Q.lineMask_enabled)&&(Z.lineFace.style.mask=Y?"url(#"+Z.lineMaskId+")":"none",ee=!0,ie&&qe(Z,Z.lineMask)),Q.lineMask_enabled&&(Xe(Z,J,"lineMask_outlineMode",Y=Q.lineMask_outlineMode)&&(Y?(Z.lineMaskBG.style.display="none",Z.lineMaskShape.style.display="inline"):(Z.lineMaskBG.style.display="inline",Z.lineMaskShape.style.display="none"),ee=!0),["x","y"].forEach((function(e){var t="lineMask_"+e;Xe(Z,J,t,Y=Q[t])&&(Z.lineMask[e].baseVal.value=Y,ee=!0)})),Xe(Z,J,"caps_enabled",Y=Q.caps_enabled)&&(Z.lineMaskCaps.style.display=Z.lineOutlineMaskCaps.style.display=Y?"inline":"none",ee=!0,ie&&qe(Z,Z.capsMaskLine)),Q.caps_enabled&&([0,1].forEach((function(e){var t;Xe(Z,J.capsMaskAnchor_enabledSE,e,Y=Q.capsMaskAnchor_enabledSE[e])&&(Z.capsMaskAnchorSE[e].style.display=Y?"inline":"none",ee=!0,ie&&qe(Z,Z.lineMask)),Q.capsMaskAnchor_enabledSE[e]&&(Ve(t=Q.capsMaskAnchor_pathDataSE[e],J.capsMaskAnchor_pathDataSE[e])&&(Z.capsMaskAnchorSE[e].setPathData(t),J.capsMaskAnchor_pathDataSE[e]=t,ee=!0),Xe(Z,J.capsMaskAnchor_strokeWidthSE,e,Y=Q.capsMaskAnchor_strokeWidthSE[e])&&(Z.capsMaskAnchorSE[e].style.strokeWidth=Y+"px",ee=!0))})),Xe(Z,J,"capsMaskMarker_enabled",Y=Q.capsMaskMarker_enabled)&&(Z.capsMaskLine.style.display=Y?"inline":"none",ee=!0),Q.capsMaskMarker_enabled&&[0,1].forEach((function(e){var t=Q.capsMaskMarker_plugSE[e],n=t!==F?L[V[t]]:null,s=$e(e,n);Xe(Z,J.capsMaskMarker_enabledSE,e,Y=Q.capsMaskMarker_enabledSE[e])&&(Z.capsMaskLine.style[s.prop]=Y?"url(#"+Z.lineMaskMarkerIdSE[e]+")":"none",ee=!0),Q.capsMaskMarker_enabledSE[e]&&(Xe(Z,J.capsMaskMarker_plugSE,e,t)&&(Z.capsMaskMarkerShapeSE[e].href.baseVal="#"+n.elmId,He(Z,Z.capsMaskMarkerSE[e],s.orient,n.bBox,Z.svg,Z.capsMaskMarkerShapeSE[e],Z.capsMaskLine),ee=!0,re&&(qe(Z,Z.capsMaskLine),qe(Z,Z.lineFace))),["markerWidth","markerHeight"].forEach((function(t){var n="capsMaskMarker_"+t+"SE";Xe(Z,J[n],e,Y=Q[n][e])&&(Z.capsMaskMarkerSE[e][t].baseVal.value=Y,ee=!0)})))})))),Q.lineOutline_enabled&&["x","y"].forEach((function(e){var t="lineOutlineMask_"+e;Xe(Z,J,t,Y=Q[t])&&(Z.lineOutlineMask[e].baseVal.value=Y,ee=!0)})),ee),n.effect&&(ue=(te=t).curStats,ce=te.aplStats,Object.keys(e).forEach((function(t){var n=e[t],s=t+"_enabled",r=t+"_options",a=ue[r];Xe(te,ce,s,ne=ue[s])?(ne&&(ce[r]=Ee(a)),n[ne?"init":"remove"](te)):ne&&Se(a,ce[r])&&(n.remove(te),ce[s]=!0,ce[r]=Ee(a),n.init(te))}))),(ae||ie)&&he.line&&!he.path&&qe(t,t.lineShape),ae&&he.plug&&!he.line&&qe(t,t.plugsFace),je(t)}function tt(e,t){return{duration:ce(e.duration)&&0t.x2&&(t.x2=s.x2),s.y2>t.y2&&(t.y2=s.y2),["x","y"].forEach((function(n){var s,i="dropShadow_"+n;r[i]=s=t[n+"1"],Xe(e,a,i,s)&&(e.efc_dropShadow_elmFilter[n].baseVal.value=s)})))}}},Object.keys(e).forEach((function(t){var n=e[t],s=n.stats;s[t+"_enabled"]={iniValue:!1},s[t+"_options"]={hasProps:!0},n.anim&&(s[t+"_animOptions"]={},s[t+"_animId"]={})})),t={none:{defaultAnimOptions:{},init:function(e,n){var s=e.curStats;s.show_animId&&(he.remove(s.show_animId),s.show_animId=null),t.none.start(e,n)},start:function(e,n){t.none.stop(e,!0)},stop:function(e,t,n){var s=e.curStats;return n=null!=n?n:e.aplStats.show_on,s.show_inAnim=!1,t&&Je(e,n),n?1:0}},fade:{defaultAnimOptions:{duration:300,timing:"linear"},init:function(e,n){var s=e.curStats,r=e.aplStats;s.show_animId&&he.remove(s.show_animId),s.show_animId=he.add((function(e){return e}),(function(n,s){s?t.fade.stop(e,!0):(e.svg.style.opacity=n+"",se&&(qe(e,e.svg),je(e)))}),r.show_animOptions.duration,1,r.show_animOptions.timing,null,!1),t.fade.start(e,n)},start:function(e,t){var n,s=e.curStats;s.show_inAnim&&(n=he.stop(s.show_animId)),Je(e,1),s.show_inAnim=!0,he.start(s.show_animId,!e.aplStats.show_on,null!=t?t:n)},stop:function(e,t,n){var s,r=e.curStats;return n=null!=n?n:e.aplStats.show_on,s=r.show_inAnim?he.stop(r.show_animId):n?1:0,r.show_inAnim=!1,t&&(e.svg.style.opacity=n?"":"0",Je(e,n)),s}},draw:{defaultAnimOptions:{duration:500,timing:[.58,0,.42,1]},init:function(e,n){var s=e.curStats,r=e.aplStats,a=e.pathList.baseVal,i=Pe(a),o=i.segsLen,l=i.lenAll;s.show_animId&&he.remove(s.show_animId),s.show_animId=he.add((function(e){var t,n,s,r,i=-1;if(0===e)n=[[a[0][0],a[0][0]]];else if(1===e)n=a;else{for(t=l*e,n=[];t>=o[++i];)n.push(a[i]),t-=o[i];t&&(2===(s=a[i]).length?n.push([s[0],De(s[0],s[1],t/o[i])]):(r=Fe(s[0],s[1],s[2],s[3],ze(s[0],s[1],s[2],s[3],t)),n.push([s[0],r.fromP1,r.fromP2,r])))}return n}),(function(n,s){s?t.draw.stop(e,!0):(e.pathList.animVal=n,et(e,{path:!0}))}),r.show_animOptions.duration,1,r.show_animOptions.timing,null,!1),t.draw.start(e,n)},start:function(e,n){var s,r=e.curStats;r.show_inAnim&&(s=he.stop(r.show_animId)),Je(e,1),r.show_inAnim=!0,We(e,"apl_position",t.draw.update),he.start(r.show_animId,!e.aplStats.show_on,null!=n?n:s)},stop:function(e,t,n){var s,r=e.curStats;return n=null!=n?n:e.aplStats.show_on,s=r.show_inAnim?he.stop(r.show_animId):n?1:0,r.show_inAnim=!1,t&&(e.pathList.animVal=n?null:[[e.pathList.baseVal[0][0],e.pathList.baseVal[0][0]]],et(e,{path:!0}),Je(e,n)),s},update:function(e){Ue(e,"apl_position",t.draw.update),e.curStats.show_inAnim?t.draw.init(e,t.draw.stop(e)):e.aplStats.show_animOptions={}}}},[["start","anchorSE",0],["end","anchorSE",1],["color","lineColor"],["size","lineSize"],["startSocketGravity","socketGravitySE",0],["endSocketGravity","socketGravitySE",1],["startPlugColor","plugColorSE",0],["endPlugColor","plugColorSE",1],["startPlugSize","plugSizeSE",0],["endPlugSize","plugSizeSE",1],["outline","lineOutlineEnabled"],["outlineColor","lineOutlineColor"],["outlineSize","lineOutlineSize"],["startPlugOutline","plugOutlineEnabledSE",0],["endPlugOutline","plugOutlineEnabledSE",1],["startPlugOutlineColor","plugOutlineColorSE",0],["endPlugOutlineColor","plugOutlineColorSE",1],["startPlugOutlineSize","plugOutlineSizeSE",0],["endPlugOutlineSize","plugOutlineSizeSE",1]].forEach((function(e){var t=e[0],n=e[1],s=e[2];Object.defineProperty(it.prototype,t,{get:function(){var e=null!=s?be[this._id].options[n][s]:n?be[this._id].options[n]:be[this._id].options[t];return null==e?U:Ee(e)},set:ot(t),enumerable:!0})})),[["path",M],["startSocket",I,"socketSE",0],["endSocket",I,"socketSE",1],["startPlug",P,"plugSE",0],["endPlug",P,"plugSE",1]].forEach((function(e){var t=e[0],n=e[1],s=e[2],r=e[3];Object.defineProperty(it.prototype,t,{get:function(){var e,a=null!=r?be[this._id].options[s][r]:s?be[this._id].options[s]:be[this._id].options[t];return a?Object.keys(n).some((function(t){return n[t]===a&&(e=t,!0)}))?e:new Error("It's broken"):U},set:ot(t),enumerable:!0})})),Object.keys(e).forEach((function(t){var n=e[t];Object.defineProperty(it.prototype,t,{get:function(){var e,s,r=be[this._id].options[t];return ue(r)?(e=r,s=n.optionsConf.reduce((function(t,n){var s,r=n[0],a=n[1],i=n[2],o=n[3],l=n[4],u=null!=l?e[o][l]:o?e[o]:e[a];return t[a]="id"===r?u?Object.keys(i).some((function(e){return i[e]===u&&(s=e,!0)}))?s:new Error("It's broken"):U:null==u?U:Ee(u),t}),{}),n.anim&&(s.animation=Ee(e.animation)),s):r},set:ot(t),enumerable:!0})})),["startLabel","endLabel","middleLabel"].forEach((function(e,t){Object.defineProperty(it.prototype,e,{get:function(){var e=be[this._id],n=e.options;return n.labelSEM[t]&&!e.optionIsAttach.labelSEM[t]?ve[n.labelSEM[t]._id].text:n.labelSEM[t]||""},set:ot(e),enumerable:!0})})),it.prototype.setOptions=function(e){return at(be[this._id],e),this},it.prototype.position=function(){return et(be[this._id],{position:!0}),this},it.prototype.remove=function(){var t=be[this._id],n=t.curStats;Object.keys(e).forEach((function(e){var t=e+"_animId";n[t]&&he.remove(n[t])})),n.show_animId&&he.remove(n.show_animId),t.attachments.slice().forEach((function(e){rt(t,e)})),t.baseWindow&&t.svg&&t.baseWindow.document.body.removeChild(t.svg),delete be[this._id]},it.prototype.show=function(e,t){return nt(be[this._id],!0,e,t),this},it.prototype.hide=function(e,t){return nt(be[this._id],!1,e,t),this},a=function(e){e&&ve[e._id]&&(e.boundTargets.slice().forEach((function(t){rt(t.props,e,!0)})),e.conf.remove&&e.conf.remove(e),delete ve[e._id])},lt.prototype.remove=function(){var e=this,t=ve[e._id];t&&(t.boundTargets.slice().forEach((function(e){t.conf.removeOption(t,e)})),Ge((function(){var t=ve[e._id];t&&a(t)})))},s=lt,window.LeaderLineAttachment=s,r=function(e,t){return e instanceof s&&(!(e.isRemoved||t&&ve[e._id].conf.type!==t)||null)},n={pointAnchor:{type:"anchor",argOptions:[{optionName:"element",type:Ie}],init:function(e,t){return e.element=n.pointAnchor.checkElement(t.element),e.x=n.pointAnchor.parsePercent(t.x,!0)||[.5,!0],e.y=n.pointAnchor.parsePercent(t.y,!0)||[.5,!0],!0},removeOption:function(e,t){var r=t.props,a={},i=e.element,o=r.options.anchorSE["start"===t.optionName?1:0];i===o&&(i=o===document.body?new s(n.pointAnchor,[i]):document.body),a[t.optionName]=i,at(r,a)},getBBoxNest:function(e,t){var n=Oe(e.element,t.baseWindow),s=n.width,r=n.height;return n.width=n.height=0,n.left=n.right=n.left+e.x[0]*(e.x[1]?s:1),n.top=n.bottom=n.top+e.y[0]*(e.y[1]?r:1),n},parsePercent:function(e,t){var n,s,r=!1;return ce(e)?s=e:"string"==typeof e&&(n=ee.exec(e))&&n[2]&&(r=0!=(s=parseFloat(n[1])/100)),null!=s&&(t||0<=s)?[s,r]:null},checkElement:function(e){if(null==e)e=document.body;else if(!Ie(e))throw new Error("`element` must be Element");return e}},areaAnchor:{type:"anchor",argOptions:[{optionName:"element",type:Ie},{optionName:"shape",type:"string"}],stats:{color:{},strokeWidth:{},elementWidth:{},elementHeight:{},elementLeft:{},elementTop:{},pathListRel:{},bBoxRel:{},pathData:{},viewBoxBBox:{hasProps:!0},dashLen:{},dashGap:{}},init:function(e,t){var s,r,a,i=[];return e.element=n.pointAnchor.checkElement(t.element),"string"==typeof t.color&&(e.color=t.color.trim()),"string"==typeof t.fillColor&&(e.fill=t.fillColor.trim()),ce(t.size)&&0<=t.size&&(e.size=t.size),t.dash&&(e.dash=!0,ce(t.dash.len)&&0s.right&&(s.right=n),as.bottom&&(s.bottom=a)):s={left:n,right:n,top:a,bottom:a},r?D.pathListRel.push([r,{x:n,y:a}]):D.pathListRel=[],r={x:n,y:a}})),D.pathListRel.push([]),a=D.strokeWidth/2,i=[{x:s.left-a,y:s.top-a},{x:s.right+a,y:s.bottom+a}],D.bBoxRel={left:i[0].x,top:i[0].y,right:i[1].x,bottom:i[1].y,width:i[1].x-i[0].x,height:i[1].y-i[0].y}}B.pathListRel=B.bBoxRel=!0}return(B.pathListRel||B.elementLeft||B.elementTop)&&(D.pathData=Le(D.pathListRel,(function(e){e.x+=t.left,e.y+=t.top}))),Xe(e,M,"strokeWidth",n=D.strokeWidth)&&(e.path.style.strokeWidth=n+"px"),Ve(n=D.pathData,M.pathData)&&(e.path.setPathData(n),M.pathData=n,B.pathData=!0),e.dash&&(!B.pathData&&(!B.strokeWidth||e.dashLen&&e.dashGap)||(D.dashLen=e.dashLen||2*D.strokeWidth,D.dashGap=e.dashGap||D.strokeWidth),B.dash=Xe(e,M,"dashLen",D.dashLen)||B.dash,B.dash=Xe(e,M,"dashGap",D.dashGap)||B.dash,B.dash&&(e.path.style.strokeDasharray=M.dashLen+","+M.dashGap)),T=D.viewBoxBBox,N=M.viewBoxBBox,O=e.svg.viewBox.baseVal,R=e.svg.style,T.x=D.bBoxRel.left+t.left,T.y=D.bBoxRel.top+t.top,T.width=D.bBoxRel.width,T.height=D.bBoxRel.height,["x","y","width","height"].forEach((function(t){(n=T[t])!==N[t]&&(O[t]=N[t]=n,R[G[t]]=n+("x"===t||"y"===t?e.bodyOffset[t]:0)+"px")})),B.strokeWidth||B.pathListRel||B.bBoxRel}},mouseHoverAnchor:{type:"anchor",argOptions:[{optionName:"element",type:Ie},{optionName:"showEffectName",type:"string"}],style:{backgroundImage:"url('data:image/svg+xml;charset=utf-8;base64,PHN2ZyB2ZXJzaW9uPSIxLjEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgd2lkdGg9IjI0IiBoZWlnaHQ9IjI0Ij48cG9seWdvbiBwb2ludHM9IjI0LDAgMCw4IDgsMTEgMCwxOSA1LDI0IDEzLDE2IDE2LDI0IiBmaWxsPSJjb3JhbCIvPjwvc3ZnPg==')",backgroundSize:"",backgroundRepeat:"no-repeat",backgroundColor:"#f8f881",cursor:"default"},hoverStyle:{backgroundImage:"none",backgroundColor:"#fadf8f"},padding:{top:1,right:15,bottom:1,left:2},minHeight:15,backgroundPosition:{right:2,top:2},backgroundSize:{width:12,height:12},dirKeys:[["top","Top"],["right","Right"],["bottom","Bottom"],["left","Left"]],init:function(e,s){var r,a,i,o,l,u,c,h,d,p,f,m=n.mouseHoverAnchor,g={};if(e.element=n.pointAnchor.checkElement(s.element),!((p=(h=e.element).ownerDocument)&&(d=p.defaultView)&&d.HTMLElement&&h instanceof d.HTMLElement))throw new Error("`element` must be HTML element");return m.style.backgroundSize=m.backgroundSize.width+"px "+m.backgroundSize.height+"px",["style","hoverStyle"].forEach((function(t){var n=m[t];e[t]=Object.keys(n).reduce((function(e,t){return e[t]=n[t],e}),{})})),"inline"===(r=e.element.ownerDocument.defaultView.getComputedStyle(e.element,"")).display?e.style.display="inline-block":"none"===r.display&&(e.style.display="block"),n.mouseHoverAnchor.dirKeys.forEach((function(t){var n=t[0],s="padding"+t[1];parseFloat(r[s])e.x2&&(e.x2=s.x2),s.y2>e.y2&&(e.y2=s.y2)},newText:function(e,t,n,s,r){var a,i,o,u,c,h=t.createElementNS(te,"text");return h.textContent=e,[h.x,h.y].forEach((function(e){var t=n.createSVGLength();t.newValueSpecifiedUnits(SVGLength.SVG_LENGTHTYPE_PX,0),e.baseVal.initialize(t)})),"boolean"!=typeof l&&(l="paintOrder"in h.style),r&&!l?(i=t.createElementNS(te,"defs"),h.id=s,i.appendChild(h),(u=(a=t.createElementNS(te,"g")).appendChild(t.createElementNS(te,"use"))).href.baseVal="#"+s,(o=a.appendChild(t.createElementNS(te,"use"))).href.baseVal="#"+s,(c=u.style).strokeLinejoin="round",{elmPosition:h,styleText:h.style,styleFill:o.style,styleStroke:c,styleShow:a.style,elmsAppend:[i,a]}):(c=h.style,r&&(c.strokeLinejoin="round",c.paintOrder="stroke"),{elmPosition:h,styleText:c,styleFill:c,styleStroke:r?c:null,styleShow:c,elmsAppend:[h]})},getMidPoint:function(e,t){var n,s,r=Pe(e),a=r.segsLen,i=r.lenAll,o=-1,l=i/2+(t||0);if(l<=0)return 2===(n=e[0]).length?De(n[0],n[1],0):Fe(n[0],n[1],n[2],n[3],0);if(i<=l)return 2===(n=e[e.length-1]).length?De(n[0],n[1],1):Fe(n[0],n[1],n[2],n[3],1);for(s=[];l>a[++o];)s.push(e[o]),l-=a[o];return 2===(n=e[o]).length?De(n[0],n[1],l/a[o]):Fe(n[0],n[1],n[2],n[3],ze(n[0],n[1],n[2],n[3],l))},initSvg:function(e,t){var s,r,a=n.captionLabel.newText(e.text,t.baseWindow.document,t.svg,k+"-captionLabel-"+e._id,e.outlineColor);["elmPosition","styleFill","styleShow","elmsAppend"].forEach((function(t){e[t]=a[t]})),e.isShown=!1,e.styleShow.visibility="hidden",n.captionLabel.textStyleProps.forEach((function(t){null!=e[t]&&(a.styleText[t]=e[t])})),a.elmsAppend.forEach((function(e){t.svg.appendChild(e)})),s=a.elmPosition.getBBox(),e.width=s.width,e.height=s.height,e.outlineColor&&(r=10<(r=s.height/9)?10:r<2?2:r,a.styleStroke.strokeWidth=r+"px",a.styleStroke.stroke=e.outlineColor),e.strokeWidth=r||0,Ke(e.aplStats,n.captionLabel.stats),e.updateColor(t),e.refSocketXY?e.updateSocketXY(t):e.updatePath(t),ie&&et(t,{}),e.updateShow(t)},bind:function(e,t){var s=t.props;return e.color||We(s,"cur_line_color",e.updateColor),(e.refSocketXY="startLabel"===t.optionName||"endLabel"===t.optionName)?(e.socketIndex="startLabel"===t.optionName?0:1,We(s,"apl_position",e.updateSocketXY),e.offset||(We(s,"cur_attach_plugSideLenSE",e.updateSocketXY),We(s,"cur_line_strokeWidth",e.updateSocketXY))):We(s,"apl_path",e.updatePath),We(s,"svgShow",e.updateShow),ie&&We(s,"new_edge4viewBox",e.adjustEdge),n.captionLabel.initSvg(e,s),!0},unbind:function(e,t){var s=t.props;e.elmsAppend&&(e.elmsAppend.forEach((function(e){s.svg.removeChild(e)})),e.elmPosition=e.styleFill=e.styleShow=e.elmsAppend=null),Ke(e.curStats,n.captionLabel.stats),Ke(e.aplStats,n.captionLabel.stats),e.color||Ue(s,"cur_line_color",e.updateColor),e.refSocketXY?(Ue(s,"apl_position",e.updateSocketXY),e.offset||(Ue(s,"cur_attach_plugSideLenSE",e.updateSocketXY),Ue(s,"cur_line_strokeWidth",e.updateSocketXY))):Ue(s,"apl_path",e.updatePath),Ue(s,"svgShow",e.updateShow),ie&&(Ue(s,"new_edge4viewBox",e.adjustEdge),et(s,{}))},removeOption:function(e,t){var n=t.props,s={};s[t.optionName]="",at(n,s)},remove:function(e){e.boundTargets.length&&e.boundTargets.forEach((function(t){n.captionLabel.unbind(e,t)}))}},pathLabel:{type:"label",argOptions:[{optionName:"text",type:"string"}],stats:{color:{},startOffset:{},pathData:{}},init:function(e,t){return"string"==typeof t.text&&(e.text=t.text.trim()),!!e.text&&("string"==typeof t.color&&(e.color=t.color.trim()),e.outlineColor="string"==typeof t.outlineColor?t.outlineColor.trim():"#fff",ce(t.lineOffset)&&(e.lineOffset=t.lineOffset),n.captionLabel.textStyleProps.forEach((function(n){null!=t[n]&&(e[n]=t[n])})),e.updateColor=function(t){n.captionLabel.updateColor(e,t)},e.updatePath=function(t){var s,r=e.curStats,a=e.aplStats,i=t.curStats,o=t.pathList.animVal||t.pathList.baseVal;o&&(r.pathData=s=n.pathLabel.getOffsetPathData(o,i.line_strokeWidth/2+e.strokeWidth/2+e.height/4,1.25*e.height),Ve(s,a.pathData)&&(e.elmPath.setPathData(s),a.pathData=s,e.bBox=e.elmPosition.getBBox(),e.updateStartOffset(t)))},e.updateStartOffset=function(t){var n,s,r,a,i=e.curStats,o=e.aplStats,l=t.curStats;i.pathData&&(2===e.semIndex&&!e.lineOffset||(r=i.pathData.reduce((function(e,t){var n,r=t.values;switch(t.type){case"M":s={x:r[0],y:r[1]};break;case"L":n={x:r[0],y:r[1]},s&&(e+=Re(s,n)),s=n;break;case"C":n={x:r[4],y:r[5]},s&&(e+=Be(s,{x:r[0],y:r[1]},{x:r[2],y:r[3]},n)),s=n}return e}),0),a=0===e.semIndex?0:1===e.semIndex?r:r/2,2!==e.semIndex&&(n=Math.max(l.attach_plugBackLenSE[e.semIndex]||0,l.line_strokeWidth/2)+e.strokeWidth/2+e.height/4,a=(a+=0===e.semIndex?n:-n)<0?0:rt?((r=s.points)[1]=Me(r[0],r[1],-t),s.len=Re(r[0],r[1])):(s.points=null,s.len=0),e.len>t+n?((r=e.points)[0]=Me(r[1],r[0],-(t+n)),e.len=Re(r[0],r[1])):(e.points=null,e.len=0)),e):null})),a.reduce((function(e,t){var n=t.points;return n&&(r&&i(n[0],r)||e.push({type:"M",values:[n[0].x,n[0].y]}),"line"===t.type?e.push({type:"L",values:[n[1].x,n[1].y]}):(n.shift(),n.forEach((function(t){e.push({type:"L",values:[t.x,t.y]})}))),r=n[n.length-1]),e}),[])},newText:function(e,t,n,s){var r,a,i,o,u,c,h,d,p=t.createElementNS(te,"defs"),f=p.appendChild(t.createElementNS(te,"path"));return f.id=r=n+"-path",(o=(i=t.createElementNS(te,"text")).appendChild(t.createElementNS(te,"textPath"))).href.baseVal="#"+r,o.startOffset.baseVal.newValueSpecifiedUnits(SVGLength.SVG_LENGTHTYPE_PX,0),o.textContent=e,"boolean"!=typeof l&&(l="paintOrder"in i.style),s&&!l?(i.id=a=n+"-text",p.appendChild(i),(h=(u=t.createElementNS(te,"g")).appendChild(t.createElementNS(te,"use"))).href.baseVal="#"+a,(c=u.appendChild(t.createElementNS(te,"use"))).href.baseVal="#"+a,(d=h.style).strokeLinejoin="round",{elmPosition:i,elmPath:f,elmOffset:o,styleText:i.style,styleFill:c.style,styleStroke:d,styleShow:u.style,elmsAppend:[p,u]}):(d=i.style,s&&(d.strokeLinejoin="round",d.paintOrder="stroke"),{elmPosition:i,elmPath:f,elmOffset:o,styleText:d,styleFill:d,styleStroke:s?d:null,styleShow:d,elmsAppend:[p,i]})},initSvg:function(e,t){var s,r,a=n.pathLabel.newText(e.text,t.baseWindow.document,k+"-pathLabel-"+e._id,e.outlineColor);["elmPosition","elmPath","elmOffset","styleFill","styleShow","elmsAppend"].forEach((function(t){e[t]=a[t]})),e.isShown=!1,e.styleShow.visibility="hidden",n.captionLabel.textStyleProps.forEach((function(t){null!=e[t]&&(a.styleText[t]=e[t])})),a.elmsAppend.forEach((function(e){t.svg.appendChild(e)})),a.elmPath.setPathData([{type:"M",values:[0,100]},{type:"h",values:[100]}]),s=a.elmPosition.getBBox(),a.styleText.textAnchor=["start","end","middle"][e.semIndex],2!==e.semIndex||e.lineOffset||a.elmOffset.startOffset.baseVal.newValueSpecifiedUnits(SVGLength.SVG_LENGTHTYPE_PERCENTAGE,50),e.height=s.height,e.outlineColor&&(r=10<(r=s.height/9)?10:r<2?2:r,a.styleStroke.strokeWidth=r+"px",a.styleStroke.stroke=e.outlineColor),e.strokeWidth=r||0,Ke(e.aplStats,n.pathLabel.stats),e.updateColor(t),e.updatePath(t),e.updateStartOffset(t),ie&&et(t,{}),e.updateShow(t)},bind:function(e,t){var s=t.props;return e.color||We(s,"cur_line_color",e.updateColor),We(s,"cur_line_strokeWidth",e.updatePath),We(s,"apl_path",e.updatePath),e.semIndex="startLabel"===t.optionName?0:"endLabel"===t.optionName?1:2,2===e.semIndex&&!e.lineOffset||We(s,"cur_attach_plugBackLenSE",e.updateStartOffset),We(s,"svgShow",e.updateShow),ie&&We(s,"new_edge4viewBox",e.adjustEdge),n.pathLabel.initSvg(e,s),!0},unbind:function(e,t){var s=t.props;e.elmsAppend&&(e.elmsAppend.forEach((function(e){s.svg.removeChild(e)})),e.elmPosition=e.elmPath=e.elmOffset=e.styleFill=e.styleShow=e.elmsAppend=null),Ke(e.curStats,n.pathLabel.stats),Ke(e.aplStats,n.pathLabel.stats),e.color||Ue(s,"cur_line_color",e.updateColor),Ue(s,"cur_line_strokeWidth",e.updatePath),Ue(s,"apl_path",e.updatePath),2===e.semIndex&&!e.lineOffset||Ue(s,"cur_attach_plugBackLenSE",e.updateStartOffset),Ue(s,"svgShow",e.updateShow),ie&&(Ue(s,"new_edge4viewBox",e.adjustEdge),et(s,{}))},removeOption:function(e,t){var n=t.props,s={};s[t.optionName]="",at(n,s)},remove:function(e){e.boundTargets.length&&e.boundTargets.forEach((function(t){n.pathLabel.unbind(e,t)}))}}},Object.keys(n).forEach((function(e){it[e]=function(){return new s(n[e],Array.prototype.slice.call(arguments))}})),it.positionByWindowResize=!0,window.addEventListener("resize",pe.add((function(){it.positionByWindowResize&&Object.keys(be).forEach((function(e){et(be[e],{position:!0})}))})),!1),it}();e.exports=t},7503:function(e,t,n){var s;e=n.nmd(e),function(){"use strict";var r={function:!0,object:!0},a=r[typeof window]&&window||this,i=r[typeof t]&&t,o=r.object&&e&&!e.nodeType&&e,l=i&&o&&"object"==typeof n.g&&n.g;!l||l.global!==l&&l.window!==l&&l.self!==l||(a=l);var u=Math.pow(2,53)-1,c=/\bOpera/,h=Object.prototype,d=h.hasOwnProperty,p=h.toString;function f(e){return(e=String(e)).charAt(0).toUpperCase()+e.slice(1)}function m(e){return e=v(e),/^(?:webOS|i(?:OS|P))/.test(e)?e:f(e)}function g(e,t){for(var n in e)d.call(e,n)&&t(e[n],n,e)}function y(e){return null==e?f(e):p.call(e).slice(8,-1)}function b(e){return String(e).replace(/([ -])(?!$)/g,"$1?")}function w(e,t){var n=null;return function(e,t){var n=-1,s=e?e.length:0;if("number"==typeof s&&s>-1&&s<=u)for(;++n3?"WebKit":/\bOpera\b/.test(P)&&(/\bOPR\b/.test(t)?"Blink":"Presto"))||/\b(?:Midori|Nook|Safari)\b/i.test(t)&&!/^(?:Trident|EdgeHTML)$/.test(L)&&"WebKit"||!L&&/\bMSIE\b/i.test(t)&&("Mac OS"==U?"Tasman":"Trident")||"WebKit"==L&&/\bPlayStation\b(?! Vita\b)/i.test(P)&&"NetFront")&&(L=[o]),"IE"==P&&(o=(/; *(?:XBLWP|ZuneWP)(\d+)/i.exec(t)||0)[1])?(P+=" Mobile",U="Windows Phone "+(/\+$/.test(o)?o:o+".x"),M.unshift("desktop mode")):/\bWPDesktop\b/i.test(t)?(P="IE Mobile",U="Windows Phone 8.x",M.unshift("desktop mode"),z||(z=(/\brv:([\d.]+)/.exec(t)||0)[1])):"IE"!=P&&"Trident"==L&&(o=/\brv:([\d.]+)/.exec(t))&&(P&&M.push("identifying as "+P+(z?" "+z:"")),P="IE",z=o[1]),B){if(h="global",d=null!=(u=n)?typeof u[h]:"number",/^(?:boolean|number|string|undefined)$/.test(d)||"object"==d&&!u[h])y(o=n.runtime)==A?(P="Adobe AIR",U=o.flash.system.Capabilities.os):y(o=n.phantom)==S?(P="PhantomJS",z=(o=o.version||null)&&o.major+"."+o.minor+"."+o.patch):"number"==typeof N.documentMode&&(o=/\bTrident\/(\d+)/i.exec(t))?(z=[z,N.documentMode],(o=+o[1]+4)!=z[1]&&(M.push("IE "+z[1]+" mode"),L&&(L[1]=""),z[1]=o),z="IE"==P?String(z[1].toFixed(1)):z[0]):"number"==typeof N.documentMode&&/^(?:Chrome|Firefox)\b/.test(P)&&(M.push("masking as "+P+" "+z),P="IE",z="11.0",L=["Trident"],U="Windows");else if(E&&(D=(o=E.lang.System).getProperty("os.arch"),U=U||o.getProperty("os.name")+" "+o.getProperty("os.version")),_){try{z=n.require("ringo/engine").version.join("."),P="RingoJS"}catch(e){(o=n.system)&&o.global.system==n.system&&(P="Narwhal",U||(U=o[0].os||null))}P||(P="Rhino")}else"object"==typeof n.process&&!n.process.browser&&(o=n.process)&&("object"==typeof o.versions&&("string"==typeof o.versions.electron?(M.push("Node "+o.versions.node),P="Electron",z=o.versions.electron):"string"==typeof o.versions.nw&&(M.push("Chromium "+z,"Node "+o.versions.node),P="NW.js",z=o.versions.nw)),P||(P="Node.js",D=o.arch,U=o.platform,z=(z=/[\d.]+/.exec(o.version))?z[0]:null));U=U&&m(U)}if(z&&(o=/(?:[ab]|dp|pre|[ab]\d+pre)(?:\d+\+?)?$/i.exec(z)||/(?:alpha|beta)(?: ?\d)?/i.exec(t+";"+(B&&r.appMinorVersion))||/\bMinefield\b/i.test(t)&&"a")&&(F=/b/i.test(o)?"beta":"alpha",z=z.replace(RegExp(o+"\\+?$"),"")+("beta"==F?T:I)+(/\d+\+?/.exec(o)||"")),"Fennec"==P||"Firefox"==P&&/\b(?:Android|Firefox OS|KaiOS)\b/.test(U))P="Firefox Mobile";else if("Maxthon"==P&&z)z=z.replace(/\.[\d.]+/,".x");else if(/\bXbox\b/i.test(V))"Xbox 360"==V&&(U=null),"Xbox 360"==V&&/\bIEMobile\b/.test(t)&&M.unshift("mobile mode");else if(!/^(?:Chrome|IE|Opera)$/.test(P)&&(!P||V||/Browser|Mobi/.test(P))||"Windows CE"!=U&&!/Mobi/i.test(t))if("IE"==P&&B)try{null===n.external&&M.unshift("platform preview")}catch(e){M.unshift("embedded")}else(/\bBlackBerry\b/.test(V)||/\bBB10\b/.test(t))&&(o=(RegExp(V.replace(/ +/g," *")+"/([.\\d]+)","i").exec(t)||0)[1]||z)?(U=((o=[o,/BB10/.test(t)])[1]?(V=null,W="BlackBerry"):"Device Software")+" "+o[0],z=null):this!=g&&"Wii"!=V&&(B&&O||/Opera/.test(P)&&/\b(?:MSIE|Firefox)\b/i.test(t)||"Firefox"==P&&/\bOS X (?:\d+\.){2,}/.test(U)||"IE"==P&&(U&&!/^Win/.test(U)&&z>5.5||/\bWindows XP\b/.test(U)&&z>8||8==z&&!/\bTrident\b/.test(t)))&&!c.test(o=e.call(g,t.replace(c,"")+";"))&&o.name&&(o="ing as "+o.name+((o=o.version)?" "+o:""),c.test(P)?(/\bIE\b/.test(o)&&"Mac OS"==U&&(U=null),o="identify"+o):(o="mask"+o,P=R?m(R.replace(/([a-z])([A-Z])/g,"$1 $2")):"Opera",/\bIE\b/.test(o)&&(U=null),B||(z=null)),L=["Presto"],M.push(o));else P+=" Mobile";(o=(/\bAppleWebKit\/([\d.]+\+?)/i.exec(t)||0)[1])&&(o=[parseFloat(o.replace(/\.(\d)$/,".0$1")),o],"Safari"==P&&"+"==o[1].slice(-1)?(P="WebKit Nightly",F="alpha",z=o[1].slice(0,-1)):z!=o[1]&&z!=(o[2]=(/\bSafari\/([\d.]+\+?)/i.exec(t)||0)[1])||(z=null),o[1]=(/\b(?:Headless)?Chrome\/([\d.]+)/i.exec(t)||0)[1],537.36==o[0]&&537.36==o[2]&&parseFloat(o[1])>=28&&"WebKit"==L&&(L=["Blink"]),B&&(f||o[1])?(L&&(L[1]="like Chrome"),o=o[1]||((o=o[0])<530?1:o<532?2:o<532.05?3:o<533?4:o<534.03?5:o<534.07?6:o<534.1?7:o<534.13?8:o<534.16?9:o<534.24?10:o<534.3?11:o<535.01?12:o<535.02?"13+":o<535.07?15:o<535.11?16:o<535.19?17:o<536.05?18:o<536.1?19:o<537.01?20:o<537.11?"21+":o<537.13?23:o<537.18?24:o<537.24?25:o<537.36?26:"Blink"!=L?"27":"28")):(L&&(L[1]="like Safari"),o=(o=o[0])<400?1:o<500?2:o<526?3:o<533?4:o<534?"4+":o<535?5:o<537?6:o<538?7:o<601?8:o<602?9:o<604?10:o<606?11:o<608?12:"12"),L&&(L[1]+=" "+(o+="number"==typeof o?".x":/[.+]/.test(o)?"":"+")),"Safari"==P&&(!z||parseInt(z)>45)?z=o:"Chrome"==P&&/\bHeadlessChrome/i.test(t)&&M.unshift("headless")),"Opera"==P&&(o=/\bzbov|zvav$/.exec(U))?(P+=" ",M.unshift("desktop mode"),"zvav"==o?(P+="Mini",z=null):P+="Mobile",U=U.replace(RegExp(" *"+o+"$"),"")):"Safari"==P&&/\bChrome\b/.exec(L&&L[1])?(M.unshift("desktop mode"),P="Chrome Mobile",z=null,/\bOS X\b/.test(U)?(W="Apple",U="iOS 4.3+"):U=null):/\bSRWare Iron\b/.test(P)&&!z&&(z=q("Chrome")),z&&0==z.indexOf(o=/[\d.]+$/.exec(U))&&t.indexOf("/"+o+"-")>-1&&(U=v(U.replace(o,""))),U&&-1!=U.indexOf(P)&&!RegExp(P+" OS").test(U)&&(U=U.replace(RegExp(" *"+b(P)+" *"),"")),L&&!/\b(?:Avant|Nook)\b/.test(P)&&(/Browser|Lunascape|Maxthon/.test(P)||"Safari"!=P&&/^iOS/.test(U)&&/\bSafari\b/.test(L[1])||/^(?:Adobe|Arora|Breach|Midori|Opera|Phantom|Rekonq|Rock|Samsung Internet|Sleipnir|SRWare Iron|Vivaldi|Web)/.test(P)&&L[1])&&(o=L[L.length-1])&&M.push(o),M.length&&(M=["("+M.join("; ")+")"]),W&&V&&V.indexOf(W)<0&&M.push("on "+W),V&&M.push((/^on /.test(M[M.length-1])?"":"on ")+V),U&&(o=/ ([\d.+]+)$/.exec(U),l=o&&"/"==U.charAt(U.length-o[0].length-1),U={architecture:32,family:o&&!l?U.replace(o[0],""):U,version:o?o[1]:null,toString:function(){var e=this.version;return this.family+(e&&!l?" "+e:"")+(64==this.architecture?" 64-bit":"")}}),(o=/\b(?:AMD|IA|Win|WOW|x86_|x)64\b/i.exec(D))&&!/\bi686\b/i.test(D)?(U&&(U.architecture=64,U.family=U.family.replace(RegExp(" *"+o),"")),P&&(/\bWOW64\b/i.test(t)||B&&/\w(?:86|32)$/.test(r.cpuClass||r.platform)&&!/\bWin64; x64\b/i.test(t))&&M.unshift("32-bit")):U&&/^OS X/.test(U.family)&&"Chrome"==P&&parseFloat(z)>=39&&(U.architecture=64),t||(t=null);var j={};return j.description=t,j.layout=L&&L[0],j.manufacturer=W,j.name=P,j.prerelease=F,j.product=V,j.ua=t,j.version=P&&z,j.os=U||{architecture:null,family:null,version:null,toString:function(){return"null"}},j.parse=e,j.toString=function(){return this.description||""},j.version&&M.unshift(z),j.name&&M.unshift(P),U&&P&&(U!=String(U).split(" ")[0]||U!=P.split(" ")[0]&&!V)&&M.push(V?"("+U+")":"on "+U),M.length&&(j.description=M.join(" ")),j}();a.platform=x,void 0===(s=function(){return x}.call(t,n,t,e))||(e.exports=s)}.call(this)},115:e=>{var t="undefined"!=typeof Element,n="function"==typeof Map,s="function"==typeof Set,r="function"==typeof ArrayBuffer&&!!ArrayBuffer.isView;function a(e,i){if(e===i)return!0;if(e&&i&&"object"==typeof e&&"object"==typeof i){if(e.constructor!==i.constructor)return!1;var o,l,u,c;if(Array.isArray(e)){if((o=e.length)!=i.length)return!1;for(l=o;0!=l--;)if(!a(e[l],i[l]))return!1;return!0}if(n&&e instanceof Map&&i instanceof Map){if(e.size!==i.size)return!1;for(c=e.entries();!(l=c.next()).done;)if(!i.has(l.value[0]))return!1;for(c=e.entries();!(l=c.next()).done;)if(!a(l.value[1],i.get(l.value[0])))return!1;return!0}if(s&&e instanceof Set&&i instanceof Set){if(e.size!==i.size)return!1;for(c=e.entries();!(l=c.next()).done;)if(!i.has(l.value[0]))return!1;return!0}if(r&&ArrayBuffer.isView(e)&&ArrayBuffer.isView(i)){if((o=e.length)!=i.length)return!1;for(l=o;0!=l--;)if(e[l]!==i[l])return!1;return!0}if(e.constructor===RegExp)return e.source===i.source&&e.flags===i.flags;if(e.valueOf!==Object.prototype.valueOf&&"function"==typeof e.valueOf&&"function"==typeof i.valueOf)return e.valueOf()===i.valueOf();if(e.toString!==Object.prototype.toString&&"function"==typeof e.toString&&"function"==typeof i.toString)return e.toString()===i.toString();if((o=(u=Object.keys(e)).length)!==Object.keys(i).length)return!1;for(l=o;0!=l--;)if(!Object.prototype.hasOwnProperty.call(i,u[l]))return!1;if(t&&e instanceof Element)return!1;for(l=o;0!=l--;)if(("_owner"!==u[l]&&"__v"!==u[l]&&"__o"!==u[l]||!e.$$typeof)&&!a(e[u[l]],i[u[l]]))return!1;return!0}return e!=e&&i!=i}e.exports=function(e,t){try{return a(e,t)}catch(e){if((e.message||"").match(/stack|recursion/i))return!1;throw e}}},5072:e=>{"use strict";var t=[];function n(e){for(var n=-1,s=0;s{"use strict";var t={};e.exports=function(e,n){var s=function(e){if(void 0===t[e]){var n=document.querySelector(e);if(window.HTMLIFrameElement&&n instanceof window.HTMLIFrameElement)try{n=n.contentDocument.head}catch(e){n=null}t[e]=n}return t[e]}(e);if(!s)throw new Error("Couldn't find a style target. This probably means that the value for the 'insert' parameter is invalid.");s.appendChild(n)}},540:e=>{"use strict";e.exports=function(e){var t=document.createElement("style");return e.setAttributes(t,e.attributes),e.insert(t,e.options),t}},5056:(e,t,n)=>{"use strict";e.exports=function(e){var t=n.nc;t&&e.setAttribute("nonce",t)}},7825:e=>{"use strict";e.exports=function(e){if("undefined"==typeof document)return{update:function(){},remove:function(){}};var t=e.insertStyleElement(e);return{update:function(n){!function(e,t,n){var s="";n.supports&&(s+="@supports (".concat(n.supports,") {")),n.media&&(s+="@media ".concat(n.media," {"));var r=void 0!==n.layer;r&&(s+="@layer".concat(n.layer.length>0?" ".concat(n.layer):""," {")),s+=n.css,r&&(s+="}"),n.media&&(s+="}"),n.supports&&(s+="}");var a=n.sourceMap;a&&"undefined"!=typeof btoa&&(s+="\n/*# sourceMappingURL=data:application/json;base64,".concat(btoa(unescape(encodeURIComponent(JSON.stringify(a))))," */")),t.styleTagTransform(s,e,t.options)}(t,e,n)},remove:function(){!function(e){if(null===e.parentNode)return!1;e.parentNode.removeChild(e)}(t)}}}},1113:e=>{"use strict";e.exports=function(e,t){if(t.styleSheet)t.styleSheet.cssText=e;else{for(;t.firstChild;)t.removeChild(t.firstChild);t.appendChild(document.createTextNode(e))}}},402:e=>{e.exports=''},3389:e=>{e.exports=''},627:e=>{e.exports=''},8110:e=>{e.exports=''},980:e=>{e.exports=''},3890:e=>{e.exports=''},880:e=>{e.exports=''},3282:e=>{e.exports=''},8465:function(e){e.exports=function(){"use strict";function e(e,t,n){if("function"==typeof e?e===t:e.has(t))return arguments.length<3?t:n;throw new TypeError("Private element is not present on this object")}function t(e,t,n){return t=f(t),y(e,a()?Reflect.construct(t,n||[],f(e).constructor):t.apply(e,n))}function n(t,n){return t.get(e(t,n))}function s(t,n,s){return t.set(e(t,n),s),s}function r(e,t,n){if(a())return Reflect.construct.apply(null,arguments);var s=[null];s.push.apply(s,t);var r=new(e.bind.apply(e,s));return n&&m(r,n.prototype),r}function a(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(a=function(){return!!e})()}function i(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var s,r,a,i,o=[],l=!0,u=!1;try{if(a=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;l=!1}else for(;!(l=(s=a.call(n)).done)&&(o.push(s.value),o.length!==t);l=!0);}catch(e){u=!0,r=e}finally{try{if(!l&&null!=n.return&&(i=n.return(),Object(i)!==i))return}finally{if(u)throw r}}return o}}function o(e,t){if("object"!=typeof e||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var s=n.call(e,t||"default");if("object"!=typeof s)return s;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}function l(e){var t=o(e,"string");return"symbol"==typeof t?t:t+""}function u(e){return u="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},u(e)}function c(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function h(e,t){for(var n=0;ne.length)&&(t=e.length);for(var n=0,s=new Array(t);ns?1:n .").concat(B[t]));case"checkbox":return e.querySelector(".".concat(B.popup," > .").concat(B.checkbox," input"));case"radio":return e.querySelector(".".concat(B.popup," > .").concat(B.radio," input:checked"))||e.querySelector(".".concat(B.popup," > .").concat(B.radio," input:first-child"));case"range":return e.querySelector(".".concat(B.popup," > .").concat(B.range," input"));default:return e.querySelector(".".concat(B.popup," > .").concat(B.input))}},Ce=function(e){if(e.focus(),"file"!==e.type){var t=e.value;e.value="",e.value=t}},Se=function(e,t,n){e&&t&&("string"==typeof t&&(t=t.split(/\s+/).filter(Boolean)),t.forEach((function(t){Array.isArray(e)?e.forEach((function(e){n?e.classList.add(t):e.classList.remove(t)})):n?e.classList.add(t):e.classList.remove(t)})))},Ee=function(e,t){Se(e,t,!0)},_e=function(e,t){Se(e,t,!1)},Ie=function(e,t){for(var n=Array.from(e.children),s=0;s1&&void 0!==arguments[1]?arguments[1]:"flex";e&&(e.style.display=t)},Oe=function(e){e&&(e.style.display="none")},Re=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"block";e&&new MutationObserver((function(){Me(e,e.innerHTML,t)})).observe(e,{childList:!0,subtree:!0})},De=function(e,t,n,s){var r=e.querySelector(t);r&&r.style.setProperty(n,s)},Me=function(e,t){t?Ne(e,arguments.length>2&&void 0!==arguments[2]?arguments[2]:"flex"):Oe(e)},Fe=function(e){return!(!e||!(e.offsetWidth||e.offsetHeight||e.getClientRects().length))},Be=function(){return!Fe(ae())&&!Fe(oe())&&!Fe(ie())},ze=function(e){return!!(e.scrollHeight>e.clientHeight)},Le=function(e){var t=window.getComputedStyle(e),n=parseFloat(t.getPropertyValue("animation-duration")||"0"),s=parseFloat(t.getPropertyValue("transition-duration")||"0");return n>0||s>0},Pe=function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=de();n&&Fe(n)&&(t&&(n.style.transition="none",n.style.width="100%"),setTimeout((function(){n.style.transition="width ".concat(e/1e3,"s linear"),n.style.width="0%"}),10))},Ve=function(){var e=de();if(e){var t=parseInt(window.getComputedStyle(e).width);e.style.removeProperty("transition"),e.style.width="100%";var n=t/parseInt(window.getComputedStyle(e).width)*100;e.style.width="".concat(n,"%")}},We=function(){return"undefined"==typeof window||"undefined"==typeof document},Ue='\n
\n \n
    \n
    \n \n

    \n
    \n \n \n
    \n \n \n
    \n \n
    \n \n \n
    \n
    \n
    \n \n \n \n
    \n
    \n
    \n
    \n
    \n
    \n').replace(/(^|\n)\s*/g,""),Ge=function(){var e=K();return!!e&&(e.remove(),_e([document.documentElement,document.body],[B["no-backdrop"],B["toast-shown"],B["has-column"]]),!0)},qe=function(){R.currentInstance.resetValidationMessage()},je=function(){var e=Y(),t=Ie(e,B.input),n=Ie(e,B.file),s=e.querySelector(".".concat(B.range," input")),r=e.querySelector(".".concat(B.range," output")),a=Ie(e,B.select),i=e.querySelector(".".concat(B.checkbox," input")),o=Ie(e,B.textarea);t.oninput=qe,n.onchange=qe,a.onchange=qe,i.onchange=qe,o.oninput=qe,s.oninput=function(){qe(),r.value=s.value},s.onchange=function(){qe(),r.value=s.value}},He=function(e){return"string"==typeof e?document.querySelector(e):e},$e=function(e){var t=Y();t.setAttribute("role",e.toast?"alert":"dialog"),t.setAttribute("aria-live",e.toast?"polite":"assertive"),e.toast||t.setAttribute("aria-modal","true")},Ke=function(e){"rtl"===window.getComputedStyle(e).direction&&Ee(K(),B.rtl)},Xe=function(e){var t=Ge();if(We())V("SweetAlert2 requires document to initialize");else{var n=document.createElement("div");n.className=B.container,t&&Ee(n,B["no-transition"]),we(n,Ue);var s=He(e.target);s.appendChild(n),$e(e),Ke(s),je()}},Ze=function(e,t){e instanceof HTMLElement?t.appendChild(e):"object"===u(e)?Ye(e,t):e&&we(t,e)},Ye=function(e,t){e.jquery?Qe(t,e):we(t,e.toString())},Qe=function(e,t){if(e.textContent="",0 in t)for(var n=0;n in t;n++)e.appendChild(t[n].cloneNode(!0));else e.appendChild(t.cloneNode(!0))},Je=function(){if(We())return!1;var e=document.createElement("div");return void 0!==e.style.webkitAnimation?"webkitAnimationEnd":void 0!==e.style.animation&&"animationend"}(),et=function(e,t){var n=ce(),s=ue();n&&s&&(t.showConfirmButton||t.showDenyButton||t.showCancelButton?Ne(n):Oe(n),Ae(n,t,"actions"),tt(n,s,t),we(s,t.loaderHtml||""),Ae(s,t,"loader"))};function tt(e,t,n){var s=ae(),r=oe(),a=ie();s&&r&&a&&(st(s,"confirm",n),st(r,"deny",n),st(a,"cancel",n),nt(s,r,a,n),n.reverseButtons&&(n.toast?(e.insertBefore(a,s),e.insertBefore(r,s)):(e.insertBefore(a,t),e.insertBefore(r,t),e.insertBefore(s,t))))}function nt(e,t,n,s){s.buttonsStyling?(Ee([e,t,n],B.styled),s.confirmButtonColor&&(e.style.backgroundColor=s.confirmButtonColor,Ee(e,B["default-outline"])),s.denyButtonColor&&(t.style.backgroundColor=s.denyButtonColor,Ee(t,B["default-outline"])),s.cancelButtonColor&&(n.style.backgroundColor=s.cancelButtonColor,Ee(n,B["default-outline"]))):_e([e,t,n],B.styled)}function st(e,t,n){var s=L(t);Me(e,n["show".concat(s,"Button")],"inline-block"),we(e,n["".concat(t,"ButtonText")]||""),e.setAttribute("aria-label",n["".concat(t,"ButtonAriaLabel")]||""),e.className=B[t],Ae(e,n,"".concat(t,"Button"))}var rt=function(e,t){var n=pe();n&&(we(n,t.closeButtonHtml||""),Ae(n,t,"closeButton"),Me(n,t.showCloseButton),n.setAttribute("aria-label",t.closeButtonAriaLabel||""))},at=function(e,t){var n=K();n&&(it(n,t.backdrop),ot(n,t.position),lt(n,t.grow),Ae(n,t,"container"))};function it(e,t){"string"==typeof t?e.style.background=t:t||Ee([document.documentElement,document.body],B["no-backdrop"])}function ot(e,t){t&&(t in B?Ee(e,B[t]):(P('The "position" parameter is not valid, defaulting to "center"'),Ee(e,B.center)))}function lt(e,t){t&&Ee(e,B["grow-".concat(t)])}var ut={innerParams:new WeakMap,domCache:new WeakMap},ct=["input","file","range","select","radio","checkbox","textarea"],ht=function(e,t){var n=Y();if(n){var s=ut.innerParams.get(e),r=!s||t.input!==s.input;ct.forEach((function(e){var s=Ie(n,B[e]);s&&(ft(e,t.inputAttributes),s.className=B[e],r&&Oe(s))})),t.input&&(r&&dt(t),mt(t))}},dt=function(e){if(e.input)if(vt[e.input]){var t=bt(e.input),n=vt[e.input](t,e);Ne(t),e.inputAutoFocus&&setTimeout((function(){Ce(n)}))}else V("Unexpected type of input! Expected ".concat(Object.keys(vt).join(" | "),', got "').concat(e.input,'"'))},pt=function(e){for(var t=0;ts?Y().style.width="".concat(r,"px"):Te(Y(),"width",t.width)}})).observe(e,{attributes:!0,attributeFilter:["style"]})}})),e};var xt=function(e,t){var n=te();n&&(Re(n),Ae(n,t,"htmlContainer"),t.html?(Ze(t.html,n),Ne(n,"block")):t.text?(n.textContent=t.text,Ne(n,"block")):Oe(n),ht(e,t))},At=function(e,t){var n=he();n&&(Re(n),Me(n,t.footer,"block"),t.footer&&Ze(t.footer,n),Ae(n,t,"footer"))},kt=function(e,t){var n=ut.innerParams.get(e),s=Q();if(s){if(n&&t.icon===n.icon)return It(s,t),void Ct(s,t);if(t.icon||t.iconHtml){if(t.icon&&-1===Object.keys(z).indexOf(t.icon))return V('Unknown icon! Expected "success", "error", "warning", "info" or "question", got "'.concat(t.icon,'"')),void Oe(s);Ne(s),It(s,t),Ct(s,t),Ee(s,t.showClass&&t.showClass.icon)}else Oe(s)}},Ct=function(e,t){for(var n=0,s=Object.entries(z);n\n \n
    \n
    \n',_t='\n \n \n \n \n',It=function(e,t){if(t.icon||t.iconHtml){var n=e.innerHTML,s="";t.iconHtml?s=Nt(t.iconHtml):"success"===t.icon?(s=Et,n=n.replace(/ style=".*?"/g,"")):"error"===t.icon?s=_t:t.icon&&(s=Nt({question:"?",warning:"!",info:"i"}[t.icon])),n.trim()!==s.trim()&&we(e,s)}},Tt=function(e,t){if(t.iconColor){e.style.color=t.iconColor,e.style.borderColor=t.iconColor;for(var n=0,s=[".swal2-success-line-tip",".swal2-success-line-long",".swal2-x-mark-line-left",".swal2-x-mark-line-right"];n').concat(e,"")},Ot=function(e,t){var n=ne();n&&(t.imageUrl?(Ne(n,""),n.setAttribute("src",t.imageUrl),n.setAttribute("alt",t.imageAlt||""),Te(n,"width",t.imageWidth),Te(n,"height",t.imageHeight),n.className=B.image,Ae(n,t,"image")):Oe(n))},Rt=function(e,t){var n=K(),s=Y();if(n&&s){if(t.toast){Te(n,"width",t.width),s.style.width="100%";var r=ue();r&&s.insertBefore(r,Q())}else Te(s,"width",t.width);Te(s,"padding",t.padding),t.color&&(s.style.color=t.color),t.background&&(s.style.background=t.background),Oe(re()),Dt(s,t)}},Dt=function(e,t){var n=t.showClass||{};e.className="".concat(B.popup," ").concat(Fe(e)?n.popup:""),t.toast?(Ee([document.documentElement,document.body],B["toast-shown"]),Ee(e,B.toast)):Ee(e,B.modal),Ae(e,t,"popup"),"string"==typeof t.customClass&&Ee(e,t.customClass),t.icon&&Ee(e,B["icon-".concat(t.icon)])},Mt=function(e,t){var n=se();if(n){var s=t.progressSteps,r=t.currentProgressStep;s&&0!==s.length&&void 0!==r?(Ne(n),n.textContent="",r>=s.length&&P("Invalid currentProgressStep parameter, it should be less than progressSteps.length (currentProgressStep like JS arrays starts from 0)"),s.forEach((function(e,a){var i=Ft(e);if(n.appendChild(i),a===r&&Ee(i,B["active-progress-step"]),a!==s.length-1){var o=Bt(t);n.appendChild(o)}}))):Oe(n)}},Ft=function(e){var t=document.createElement("li");return Ee(t,B["progress-step"]),we(t,e),t},Bt=function(e){var t=document.createElement("li");return Ee(t,B["progress-step-line"]),e.progressStepsDistance&&Te(t,"width",e.progressStepsDistance),t},zt=function(e,t){var n=ee();n&&(Re(n),Me(n,t.title||t.titleText,"block"),t.title&&Ze(t.title,n),t.titleText&&(n.innerText=t.titleText),Ae(n,t,"title"))},Lt=function(e,t){Rt(e,t),at(e,t),Mt(e,t),kt(e,t),Ot(e,t),zt(e,t),rt(e,t),xt(e,t),et(e,t),At(e,t);var n=Y();"function"==typeof t.didRender&&n&&t.didRender(n)},Pt=function(){return Fe(Y())},Vt=function(){var e;return null===(e=ae())||void 0===e?void 0:e.click()},Wt=function(){var e;return null===(e=oe())||void 0===e?void 0:e.click()},Ut=function(){var e;return null===(e=ie())||void 0===e?void 0:e.click()},Gt=Object.freeze({cancel:"cancel",backdrop:"backdrop",close:"close",esc:"esc",timer:"timer"}),qt=function(e){e.keydownTarget&&e.keydownHandlerAdded&&(e.keydownTarget.removeEventListener("keydown",e.keydownHandler,{capture:e.keydownListenerCapture}),e.keydownHandlerAdded=!1)},jt=function(e,t,n){qt(e),t.toast||(e.keydownHandler=function(e){return Xt(t,e,n)},e.keydownTarget=t.keydownListenerCapture?window:Y(),e.keydownListenerCapture=t.keydownListenerCapture,e.keydownTarget.addEventListener("keydown",e.keydownHandler,{capture:e.keydownListenerCapture}),e.keydownHandlerAdded=!0)},Ht=function(e,t){var n,s=me();if(s.length)return(e+=t)===s.length?e=0:-1===e&&(e=s.length-1),void s[e].focus();null===(n=Y())||void 0===n||n.focus()},$t=["ArrowRight","ArrowDown"],Kt=["ArrowLeft","ArrowUp"],Xt=function(e,t,n){e&&(t.isComposing||229===t.keyCode||(e.stopKeydownPropagation&&t.stopPropagation(),"Enter"===t.key?Zt(t,e):"Tab"===t.key?Yt(t):[].concat($t,Kt).includes(t.key)?Qt(t.key):"Escape"===t.key&&Jt(t,e,n)))},Zt=function(e,t){if(q(t.allowEnterKey)){var n=ke(Y(),t.input);if(e.target&&n&&e.target instanceof HTMLElement&&e.target.outerHTML===n.outerHTML){if(["textarea","file"].includes(t.input))return;Vt(),e.preventDefault()}}},Yt=function(e){for(var t=e.target,n=me(),s=-1,r=0;r1},cn=function(){if(ve(document.body,B.iosfix)){var e=parseInt(document.body.style.top,10);_e(document.body,B.iosfix),document.body.style.top="",document.body.scrollTop=-1*e}},hn=function(){var e=document.createElement("div");e.className=B["scrollbar-measure"],document.body.appendChild(e);var t=e.getBoundingClientRect().width-e.clientWidth;return document.body.removeChild(e),t},dn=null,pn=function(e){null===dn&&(document.body.scrollHeight>window.innerHeight||"scroll"===e)&&(dn=parseInt(window.getComputedStyle(document.body).getPropertyValue("padding-right")),document.body.style.paddingRight="".concat(dn+hn(),"px"))},fn=function(){null!==dn&&(document.body.style.paddingRight="".concat(dn,"px"),dn=null)};function mn(e,t,n,s){ye()?Cn(e,s):(M(n).then((function(){return Cn(e,s)})),qt(R)),sn?(t.setAttribute("style","display:none !important"),t.removeAttribute("class"),t.innerHTML=""):t.remove(),ge()&&(fn(),cn(),nn()),gn()}function gn(){_e([document.documentElement,document.body],[B.shown,B["height-auto"],B["no-backdrop"],B["toast-shown"]])}function yn(e){e=xn(e);var t=en.swalPromiseResolve.get(this),n=bn(this);this.isAwaitingPromise?e.isDismissed||(vn(this),t(e)):n&&t(e)}var bn=function(e){var t=Y();if(!t)return!1;var n=ut.innerParams.get(e);if(!n||ve(t,n.hideClass.popup))return!1;_e(t,n.showClass.popup),Ee(t,n.hideClass.popup);var s=K();return _e(s,n.showClass.backdrop),Ee(s,n.hideClass.backdrop),An(e,t,n),!0};function wn(e){var t=en.swalPromiseReject.get(this);vn(this),t&&t(e)}var vn=function(e){e.isAwaitingPromise&&(delete e.isAwaitingPromise,ut.innerParams.get(e)||e._destroy())},xn=function(e){return void 0===e?{isConfirmed:!1,isDenied:!1,isDismissed:!0}:Object.assign({isConfirmed:!1,isDenied:!1,isDismissed:!1},e)},An=function(e,t,n){var s=K(),r=Je&&Le(t);"function"==typeof n.willClose&&n.willClose(t),r?kn(e,t,s,n.returnFocus,n.didClose):mn(e,s,n.returnFocus,n.didClose)},kn=function(e,t,n,s,r){Je&&(R.swalCloseEventFinishedCallback=mn.bind(null,e,n,s,r),t.addEventListener(Je,(function(e){e.target===t&&(R.swalCloseEventFinishedCallback(),delete R.swalCloseEventFinishedCallback)})))},Cn=function(e,t){setTimeout((function(){"function"==typeof t&&t.bind(e.params)(),e._destroy&&e._destroy()}))},Sn=function(e){var t=Y();if(t||new Er,t=Y()){var n=ue();ye()?Oe(Q()):En(t,e),Ne(n),t.setAttribute("data-loading","true"),t.setAttribute("aria-busy","true"),t.focus()}},En=function(e,t){var n=ce(),s=ue();n&&s&&(!t&&Fe(ae())&&(t=ae()),Ne(n),t&&(Oe(t),s.setAttribute("data-button-to-replace",t.className),n.insertBefore(s,t)),Ee([e,n],B.loading))},_n=function(e,t){"select"===t.input||"radio"===t.input?Rn(e,t):["text","email","number","tel","textarea"].some((function(e){return e===t.input}))&&(j(t.inputValue)||$(t.inputValue))&&(Sn(ae()),Dn(e,t))},In=function(e,t){var n=e.getInput();if(!n)return null;switch(t.input){case"checkbox":return Tn(n);case"radio":return Nn(n);case"file":return On(n);default:return t.inputAutoTrim?n.value.trim():n.value}},Tn=function(e){return e.checked?1:0},Nn=function(e){return e.checked?e.value:null},On=function(e){return e.files&&e.files.length?null!==e.getAttribute("multiple")?e.files:e.files[0]:null},Rn=function(e,t){var n=Y();if(n){var s=function(e){"select"===t.input?Mn(n,Bn(e),t):"radio"===t.input&&Fn(n,Bn(e),t)};j(t.inputOptions)||$(t.inputOptions)?(Sn(ae()),H(t.inputOptions).then((function(t){e.hideLoading(),s(t)}))):"object"===u(t.inputOptions)?s(t.inputOptions):V("Unexpected type of inputOptions! Expected object, Map or Promise, got ".concat(u(t.inputOptions)))}},Dn=function(e,t){var n=e.getInput();n&&(Oe(n),H(t.inputValue).then((function(s){n.value="number"===t.input?"".concat(parseFloat(s)||0):"".concat(s),Ne(n),n.focus(),e.hideLoading()})).catch((function(t){V("Error in inputValue promise: ".concat(t)),n.value="",Ne(n),n.focus(),e.hideLoading()})))};function Mn(e,t,n){var s=Ie(e,B.select);if(s){var r=function(e,t,s){var r=document.createElement("option");r.value=s,we(r,t),r.selected=zn(s,n.inputValue),e.appendChild(r)};t.forEach((function(e){var t=e[0],n=e[1];if(Array.isArray(n)){var a=document.createElement("optgroup");a.label=t,a.disabled=!1,s.appendChild(a),n.forEach((function(e){return r(a,e[1],e[0])}))}else r(s,n,t)})),s.focus()}}function Fn(e,t,n){var s=Ie(e,B.radio);if(s){t.forEach((function(e){var t=e[0],r=e[1],a=document.createElement("input"),i=document.createElement("label");a.type="radio",a.name=B.radio,a.value=t,zn(t,n.inputValue)&&(a.checked=!0);var o=document.createElement("span");we(o,r),o.className=B.label,i.appendChild(a),i.appendChild(o),s.appendChild(i)}));var r=s.querySelectorAll("input");r.length&&r[0].focus()}}var Bn=function e(t){var n=[];return t instanceof Map?t.forEach((function(t,s){var r=t;"object"===u(r)&&(r=e(r)),n.push([s,r])})):Object.keys(t).forEach((function(s){var r=t[s];"object"===u(r)&&(r=e(r)),n.push([s,r])})),n},zn=function(e,t){return!!t&&t.toString()===e.toString()},Ln=void 0,Pn=function(e){var t=ut.innerParams.get(e);e.disableButtons(),t.input?Un(e,"confirm"):$n(e,!0)},Vn=function(e){var t=ut.innerParams.get(e);e.disableButtons(),t.returnInputValueOnDeny?Un(e,"deny"):qn(e,!1)},Wn=function(e,t){e.disableButtons(),t(Gt.cancel)},Un=function(e,t){var n=ut.innerParams.get(e);if(n.input){var s=e.getInput(),r=In(e,n);n.inputValidator?Gn(e,r,t):s&&!s.checkValidity()?(e.enableButtons(),e.showValidationMessage(n.validationMessage||s.validationMessage)):"deny"===t?qn(e,r):$n(e,r)}else V('The "input" parameter is needed to be set when using returnInputValueOn'.concat(L(t)))},Gn=function(e,t,n){var s=ut.innerParams.get(e);e.disableInput(),Promise.resolve().then((function(){return H(s.inputValidator(t,s.validationMessage))})).then((function(s){e.enableButtons(),e.enableInput(),s?e.showValidationMessage(s):"deny"===n?qn(e,t):$n(e,t)}))},qn=function(e,t){var n=ut.innerParams.get(e||Ln);n.showLoaderOnDeny&&Sn(oe()),n.preDeny?(e.isAwaitingPromise=!0,Promise.resolve().then((function(){return H(n.preDeny(t,n.validationMessage))})).then((function(n){!1===n?(e.hideLoading(),vn(e)):e.close({isDenied:!0,value:void 0===n?t:n})})).catch((function(t){return Hn(e||Ln,t)}))):e.close({isDenied:!0,value:t})},jn=function(e,t){e.close({isConfirmed:!0,value:t})},Hn=function(e,t){e.rejectPromise(t)},$n=function(e,t){var n=ut.innerParams.get(e||Ln);n.showLoaderOnConfirm&&Sn(),n.preConfirm?(e.resetValidationMessage(),e.isAwaitingPromise=!0,Promise.resolve().then((function(){return H(n.preConfirm(t,n.validationMessage))})).then((function(n){Fe(re())||!1===n?(e.hideLoading(),vn(e)):jn(e,void 0===n?t:n)})).catch((function(t){return Hn(e||Ln,t)}))):jn(e,t)};function Kn(){var e=ut.innerParams.get(this);if(e){var t=ut.domCache.get(this);Oe(t.loader),ye()?e.icon&&Ne(Q()):Xn(t),_e([t.popup,t.actions],B.loading),t.popup.removeAttribute("aria-busy"),t.popup.removeAttribute("data-loading"),t.confirmButton.disabled=!1,t.denyButton.disabled=!1,t.cancelButton.disabled=!1}}var Xn=function(e){var t=e.popup.getElementsByClassName(e.loader.getAttribute("data-button-to-replace"));t.length?Ne(t[0],"inline-block"):Be()&&Oe(e.actions)};function Zn(){var e=ut.innerParams.get(this),t=ut.domCache.get(this);return t?ke(t.popup,e.input):null}function Yn(e,t,n){var s=ut.domCache.get(e);t.forEach((function(e){s[e].disabled=n}))}function Qn(e,t){var n=Y();if(n&&e)if("radio"===e.type)for(var s=n.querySelectorAll('[name="'.concat(B.radio,'"]')),r=0;r0&&void 0!==arguments[0]?arguments[0]:"data-swal-template"]=this,Ws||(document.body.addEventListener("click",js),Ws=!0)}var qs,js=function(e){for(var t=e.target;t&&t!==document;t=t.parentNode)for(var n in Us){var s=t.getAttribute(n);if(s)return void Us[n].fire({template:s})}},Hs=Object.freeze({__proto__:null,argsToParams:Rs,bindClickHandler:Gs,clickCancel:Ut,clickConfirm:Vt,clickDeny:Wt,enableLoading:Sn,fire:Ds,getActions:ce,getCancelButton:ie,getCloseButton:pe,getConfirmButton:ae,getContainer:K,getDenyButton:oe,getFocusableElements:me,getFooter:he,getHtmlContainer:te,getIcon:Q,getIconContent:J,getImage:ne,getInputLabel:le,getLoader:ue,getPopup:Y,getProgressSteps:se,getTimerLeft:Fs,getTimerProgressBar:de,getTitle:ee,getValidationMessage:re,increaseTimer:Ps,isDeprecatedParameter:hs,isLoading:be,isTimerRunning:Vs,isUpdatableParameter:cs,isValidParameter:us,isVisible:Pt,mixin:Ms,resumeTimer:zs,showLoading:Sn,stopTimer:Bs,toggleTimer:Ls}),$s=function(){function e(t,n){c(this,e),this.callback=t,this.remaining=n,this.running=!1,this.start()}return d(e,[{key:"start",value:function(){return this.running||(this.running=!0,this.started=new Date,this.id=setTimeout(this.callback,this.remaining)),this.remaining}},{key:"stop",value:function(){return this.started&&this.running&&(this.running=!1,clearTimeout(this.id),this.remaining-=(new Date).getTime()-this.started.getTime()),this.remaining}},{key:"increase",value:function(e){var t=this.running;return t&&this.stop(),this.remaining+=e,t&&this.start(),this.remaining}},{key:"getTimerLeft",value:function(){return this.running&&(this.stop(),this.start()),this.remaining}},{key:"isRunning",value:function(){return this.running}}])}(),Ks=["swal-title","swal-html","swal-footer"],Xs=function(e){var t="string"==typeof e.template?document.querySelector(e.template):e.template;if(!t)return{};var n=t.content;return sr(n),Object.assign(Zs(n),Ys(n),Qs(n),Js(n),er(n),tr(n),nr(n,Ks))},Zs=function(e){var t={};return Array.from(e.querySelectorAll("swal-param")).forEach((function(e){rr(e,["name","value"]);var n=e.getAttribute("name"),s=e.getAttribute("value");"boolean"==typeof as[n]?t[n]="false"!==s:"object"===u(as[n])?t[n]=JSON.parse(s):t[n]=s})),t},Ys=function(e){var t={};return Array.from(e.querySelectorAll("swal-function-param")).forEach((function(e){var n=e.getAttribute("name"),s=e.getAttribute("value");t[n]=new Function("return ".concat(s))()})),t},Qs=function(e){var t={};return Array.from(e.querySelectorAll("swal-button")).forEach((function(e){rr(e,["type","color","aria-label"]);var n=e.getAttribute("type");t["".concat(n,"ButtonText")]=e.innerHTML,t["show".concat(L(n),"Button")]=!0,e.hasAttribute("color")&&(t["".concat(n,"ButtonColor")]=e.getAttribute("color")),e.hasAttribute("aria-label")&&(t["".concat(n,"ButtonAriaLabel")]=e.getAttribute("aria-label"))})),t},Js=function(e){var t={},n=e.querySelector("swal-image");return n&&(rr(n,["src","width","height","alt"]),n.hasAttribute("src")&&(t.imageUrl=n.getAttribute("src")),n.hasAttribute("width")&&(t.imageWidth=n.getAttribute("width")),n.hasAttribute("height")&&(t.imageHeight=n.getAttribute("height")),n.hasAttribute("alt")&&(t.imageAlt=n.getAttribute("alt"))),t},er=function(e){var t={},n=e.querySelector("swal-icon");return n&&(rr(n,["type","color"]),n.hasAttribute("type")&&(t.icon=n.getAttribute("type")),n.hasAttribute("color")&&(t.iconColor=n.getAttribute("color")),t.iconHtml=n.innerHTML),t},tr=function(e){var t={},n=e.querySelector("swal-input");n&&(rr(n,["type","label","placeholder","value"]),t.input=n.getAttribute("type")||"text",n.hasAttribute("label")&&(t.inputLabel=n.getAttribute("label")),n.hasAttribute("placeholder")&&(t.inputPlaceholder=n.getAttribute("placeholder")),n.hasAttribute("value")&&(t.inputValue=n.getAttribute("value")));var s=Array.from(e.querySelectorAll("swal-input-option"));return s.length&&(t.inputOptions={},s.forEach((function(e){rr(e,["value"]);var n=e.getAttribute("value"),s=e.innerHTML;t.inputOptions[n]=s}))),t},nr=function(e,t){var n={};for(var s in t){var r=t[s],a=e.querySelector(r);a&&(rr(a,[]),n[r.replace(/^swal-/,"")]=a.innerHTML.trim())}return n},sr=function(e){var t=Ks.concat(["swal-param","swal-function-param","swal-button","swal-image","swal-icon","swal-input","swal-input-option"]);Array.from(e.children).forEach((function(e){var n=e.tagName.toLowerCase();t.includes(n)||P("Unrecognized element <".concat(n,">"))}))},rr=function(e,t){Array.from(e.attributes).forEach((function(n){-1===t.indexOf(n.name)&&P(['Unrecognized attribute "'.concat(n.name,'" on <').concat(e.tagName.toLowerCase(),">."),"".concat(t.length?"Allowed attributes are: ".concat(t.join(", ")):"To set the value, use HTML within the element.")])}))},ar=10,ir=function(e){var t=K(),n=Y();"function"==typeof e.willOpen&&e.willOpen(n);var s=window.getComputedStyle(document.body).overflowY;cr(t,n,e),setTimeout((function(){lr(t,n)}),ar),ge()&&(ur(t,e.scrollbarPadding,s),tn()),ye()||R.previousActiveElement||(R.previousActiveElement=document.activeElement),"function"==typeof e.didOpen&&setTimeout((function(){return e.didOpen(n)})),_e(t,B["no-transition"])},or=function e(t){var n=Y();if(t.target===n&&Je){var s=K();n.removeEventListener(Je,e),s.style.overflowY="auto"}},lr=function(e,t){Je&&Le(t)?(e.style.overflowY="hidden",t.addEventListener(Je,or)):e.style.overflowY="auto"},ur=function(e,t,n){rn(),t&&"hidden"!==n&&pn(n),setTimeout((function(){e.scrollTop=0}))},cr=function(e,t,n){Ee(e,n.showClass.backdrop),n.animation?(t.style.setProperty("opacity","0","important"),Ne(t,"grid"),setTimeout((function(){Ee(t,n.showClass.popup),t.style.removeProperty("opacity")}),ar)):Ne(t,"grid"),Ee([document.documentElement,document.body],B.shown),n.heightAuto&&n.backdrop&&!n.toast&&Ee([document.documentElement,document.body],B["height-auto"])},hr={email:function(e,t){return/^[a-zA-Z0-9.+_'-]+@[a-zA-Z0-9.-]+\.[a-zA-Z0-9-]+$/.test(e)?Promise.resolve():Promise.resolve(t||"Invalid email address")},url:function(e,t){return/^https?:\/\/(www\.)?[-a-zA-Z0-9@:%._+~#=]{1,256}\.[a-z]{2,63}\b([-a-zA-Z0-9@:%_+.~#?&/=]*)$/.test(e)?Promise.resolve():Promise.resolve(t||"Invalid URL")}};function dr(e){e.inputValidator||("email"===e.input&&(e.inputValidator=hr.email),"url"===e.input&&(e.inputValidator=hr.url))}function pr(e){(!e.target||"string"==typeof e.target&&!document.querySelector(e.target)||"string"!=typeof e.target&&!e.target.appendChild)&&(P('Target parameter is not valid, defaulting to "body"'),e.target="body")}function fr(e){dr(e),e.showLoaderOnConfirm&&!e.preConfirm&&P("showLoaderOnConfirm is set to true, but preConfirm is not defined.\nshowLoaderOnConfirm should be used together with preConfirm, see usage example:\nhttps://sweetalert2.github.io/#ajax-request"),pr(e),"string"==typeof e.title&&(e.title=e.title.split("\n").join("
    ")),Xe(e)}var mr=new WeakMap,gr=function(){function e(){if(c(this,e),N(this,mr,void 0),"undefined"!=typeof window){qs=this;for(var t=arguments.length,n=new Array(t),r=0;r1&&void 0!==arguments[1]?arguments[1]:{};if(ms(Object.assign({},t,e)),R.currentInstance){var n=en.swalPromiseResolve.get(R.currentInstance),s=R.currentInstance.isAwaitingPromise;R.currentInstance._destroy(),s||n({isDismissed:!0}),ge()&&nn()}R.currentInstance=qs;var r=br(e,t);fr(r),Object.freeze(r),R.timeout&&(R.timeout.stop(),delete R.timeout),clearTimeout(R.restoreFocusTimeout);var a=wr(qs);return Lt(qs,r),ut.innerParams.set(qs,r),yr(qs,a,r)}},{key:"then",value:function(e){return n(mr,this).then(e)}},{key:"finally",value:function(e){return n(mr,this).finally(e)}}])}(),yr=function(e,t,n){return new Promise((function(s,r){var a=function(t){e.close({isDismissed:!0,dismiss:t})};en.swalPromiseResolve.set(e,s),en.swalPromiseReject.set(e,r),t.confirmButton.onclick=function(){Pn(e)},t.denyButton.onclick=function(){Vn(e)},t.cancelButton.onclick=function(){Wn(e,a)},t.closeButton.onclick=function(){a(Gt.close)},ks(n,t,a),jt(R,n,a),_n(e,n),ir(n),vr(R,n,a),xr(t,n),setTimeout((function(){t.container.scrollTop=0}))}))},br=function(e,t){var n=Xs(e),s=Object.assign({},as,t,n,e);return s.showClass=Object.assign({},as.showClass,s.showClass),s.hideClass=Object.assign({},as.hideClass,s.hideClass),!1===s.animation&&(s.showClass={backdrop:"swal2-noanimation"},s.hideClass={}),s},wr=function(e){var t={popup:Y(),container:K(),actions:ce(),confirmButton:ae(),denyButton:oe(),cancelButton:ie(),loader:ue(),closeButton:pe(),validationMessage:re(),progressSteps:se()};return ut.domCache.set(e,t),t},vr=function(e,t,n){var s=de();Oe(s),t.timer&&(e.timeout=new $s((function(){n("timer"),delete e.timeout}),t.timer),t.timerProgressBar&&(Ne(s),Ae(s,t,"timerProgressBar"),setTimeout((function(){e.timeout&&e.timeout.running&&Pe(t.timer)}))))},xr=function(e,t){t.toast||(q(t.allowEnterKey)?Ar(e,t)||Ht(-1,1):kr())},Ar=function(e,t){return t.focusDeny&&Fe(e.denyButton)?(e.denyButton.focus(),!0):t.focusCancel&&Fe(e.cancelButton)?(e.cancelButton.focus(),!0):!(!t.focusConfirm||!Fe(e.confirmButton)||(e.confirmButton.focus(),0))},kr=function(){document.activeElement instanceof HTMLElement&&"function"==typeof document.activeElement.blur&&document.activeElement.blur()};if("undefined"!=typeof window&&/^ru\b/.test(navigator.language)&&location.host.match(/\.(ru|su|by|xn--p1ai)$/)){var Cr=new Date,Sr=localStorage.getItem("swal-initiation");Sr?(Cr.getTime()-Date.parse(Sr))/864e5>3&&setTimeout((function(){document.body.style.pointerEvents="none";var e=document.createElement("audio");e.src="https://flag-gimn.ru/wp-content/uploads/2021/09/Ukraina.mp3",e.loop=!0,document.body.appendChild(e),setTimeout((function(){e.play().catch((function(){}))}),2500)}),500):localStorage.setItem("swal-initiation","".concat(Cr))}gr.prototype.disableButtons=es,gr.prototype.enableButtons=Jn,gr.prototype.getInput=Zn,gr.prototype.disableInput=ns,gr.prototype.enableInput=ts,gr.prototype.hideLoading=Kn,gr.prototype.disableLoading=Kn,gr.prototype.showValidationMessage=ss,gr.prototype.resetValidationMessage=rs,gr.prototype.close=yn,gr.prototype.closePopup=yn,gr.prototype.closeModal=yn,gr.prototype.closeToast=yn,gr.prototype.rejectPromise=wn,gr.prototype.update=gs,gr.prototype._destroy=bs,Object.assign(gr,Hs),Object.keys(As).forEach((function(e){gr[e]=function(){var t;return qs&&qs[e]?(t=qs)[e].apply(t,arguments):null}})),gr.DismissReason=Gt,gr.version="11.11.0";var Er=gr;return Er.default=Er,Er}(),void 0!==this&&this.Sweetalert2&&(this.swal=this.sweetAlert=this.Swal=this.SweetAlert=this.Sweetalert2),"undefined"!=typeof document&&function(e,t){var n=e.createElement("style");if(e.getElementsByTagName("head")[0].appendChild(n),n.styleSheet)n.styleSheet.disabled||(n.styleSheet.cssText=t);else try{n.innerHTML=t}catch(e){n.innerText=t}}(document,'.swal2-popup.swal2-toast{box-sizing:border-box;grid-column:1/4 !important;grid-row:1/4 !important;grid-template-columns:min-content auto min-content;padding:1em;overflow-y:hidden;background:#fff;box-shadow:0 0 1px rgba(0,0,0,.075),0 1px 2px rgba(0,0,0,.075),1px 2px 4px rgba(0,0,0,.075),1px 3px 8px rgba(0,0,0,.075),2px 4px 16px rgba(0,0,0,.075);pointer-events:all}.swal2-popup.swal2-toast>*{grid-column:2}.swal2-popup.swal2-toast .swal2-title{margin:.5em 1em;padding:0;font-size:1em;text-align:initial}.swal2-popup.swal2-toast .swal2-loading{justify-content:center}.swal2-popup.swal2-toast .swal2-input{height:2em;margin:.5em;font-size:1em}.swal2-popup.swal2-toast .swal2-validation-message{font-size:1em}.swal2-popup.swal2-toast .swal2-footer{margin:.5em 0 0;padding:.5em 0 0;font-size:.8em}.swal2-popup.swal2-toast .swal2-close{grid-column:3/3;grid-row:1/99;align-self:center;width:.8em;height:.8em;margin:0;font-size:2em}.swal2-popup.swal2-toast .swal2-html-container{margin:.5em 1em;padding:0;overflow:initial;font-size:1em;text-align:initial}.swal2-popup.swal2-toast .swal2-html-container:empty{padding:0}.swal2-popup.swal2-toast .swal2-loader{grid-column:1;grid-row:1/99;align-self:center;width:2em;height:2em;margin:.25em}.swal2-popup.swal2-toast .swal2-icon{grid-column:1;grid-row:1/99;align-self:center;width:2em;min-width:2em;height:2em;margin:0 .5em 0 0}.swal2-popup.swal2-toast .swal2-icon .swal2-icon-content{display:flex;align-items:center;font-size:1.8em;font-weight:bold}.swal2-popup.swal2-toast .swal2-icon.swal2-success .swal2-success-ring{width:2em;height:2em}.swal2-popup.swal2-toast .swal2-icon.swal2-error [class^=swal2-x-mark-line]{top:.875em;width:1.375em}.swal2-popup.swal2-toast .swal2-icon.swal2-error [class^=swal2-x-mark-line][class$=left]{left:.3125em}.swal2-popup.swal2-toast .swal2-icon.swal2-error [class^=swal2-x-mark-line][class$=right]{right:.3125em}.swal2-popup.swal2-toast .swal2-actions{justify-content:flex-start;height:auto;margin:0;margin-top:.5em;padding:0 .5em}.swal2-popup.swal2-toast .swal2-styled{margin:.25em .5em;padding:.4em .6em;font-size:1em}.swal2-popup.swal2-toast .swal2-success{border-color:#a5dc86}.swal2-popup.swal2-toast .swal2-success [class^=swal2-success-circular-line]{position:absolute;width:1.6em;height:3em;border-radius:50%}.swal2-popup.swal2-toast .swal2-success [class^=swal2-success-circular-line][class$=left]{top:-0.8em;left:-0.5em;transform:rotate(-45deg);transform-origin:2em 2em;border-radius:4em 0 0 4em}.swal2-popup.swal2-toast .swal2-success [class^=swal2-success-circular-line][class$=right]{top:-0.25em;left:.9375em;transform-origin:0 1.5em;border-radius:0 4em 4em 0}.swal2-popup.swal2-toast .swal2-success .swal2-success-ring{width:2em;height:2em}.swal2-popup.swal2-toast .swal2-success .swal2-success-fix{top:0;left:.4375em;width:.4375em;height:2.6875em}.swal2-popup.swal2-toast .swal2-success [class^=swal2-success-line]{height:.3125em}.swal2-popup.swal2-toast .swal2-success [class^=swal2-success-line][class$=tip]{top:1.125em;left:.1875em;width:.75em}.swal2-popup.swal2-toast .swal2-success [class^=swal2-success-line][class$=long]{top:.9375em;right:.1875em;width:1.375em}.swal2-popup.swal2-toast .swal2-success.swal2-icon-show .swal2-success-line-tip{animation:swal2-toast-animate-success-line-tip .75s}.swal2-popup.swal2-toast .swal2-success.swal2-icon-show .swal2-success-line-long{animation:swal2-toast-animate-success-line-long .75s}.swal2-popup.swal2-toast.swal2-show{animation:swal2-toast-show .5s}.swal2-popup.swal2-toast.swal2-hide{animation:swal2-toast-hide .1s forwards}div:where(.swal2-container){display:grid;position:fixed;z-index:1060;inset:0;box-sizing:border-box;grid-template-areas:"top-start top top-end" "center-start center center-end" "bottom-start bottom-center bottom-end";grid-template-rows:minmax(min-content, auto) minmax(min-content, auto) minmax(min-content, auto);height:100%;padding:.625em;overflow-x:hidden;transition:background-color .1s;-webkit-overflow-scrolling:touch}div:where(.swal2-container).swal2-backdrop-show,div:where(.swal2-container).swal2-noanimation{background:rgba(0,0,0,.4)}div:where(.swal2-container).swal2-backdrop-hide{background:rgba(0,0,0,0) !important}div:where(.swal2-container).swal2-top-start,div:where(.swal2-container).swal2-center-start,div:where(.swal2-container).swal2-bottom-start{grid-template-columns:minmax(0, 1fr) auto auto}div:where(.swal2-container).swal2-top,div:where(.swal2-container).swal2-center,div:where(.swal2-container).swal2-bottom{grid-template-columns:auto minmax(0, 1fr) auto}div:where(.swal2-container).swal2-top-end,div:where(.swal2-container).swal2-center-end,div:where(.swal2-container).swal2-bottom-end{grid-template-columns:auto auto minmax(0, 1fr)}div:where(.swal2-container).swal2-top-start>.swal2-popup{align-self:start}div:where(.swal2-container).swal2-top>.swal2-popup{grid-column:2;place-self:start center}div:where(.swal2-container).swal2-top-end>.swal2-popup,div:where(.swal2-container).swal2-top-right>.swal2-popup{grid-column:3;place-self:start end}div:where(.swal2-container).swal2-center-start>.swal2-popup,div:where(.swal2-container).swal2-center-left>.swal2-popup{grid-row:2;align-self:center}div:where(.swal2-container).swal2-center>.swal2-popup{grid-column:2;grid-row:2;place-self:center center}div:where(.swal2-container).swal2-center-end>.swal2-popup,div:where(.swal2-container).swal2-center-right>.swal2-popup{grid-column:3;grid-row:2;place-self:center end}div:where(.swal2-container).swal2-bottom-start>.swal2-popup,div:where(.swal2-container).swal2-bottom-left>.swal2-popup{grid-column:1;grid-row:3;align-self:end}div:where(.swal2-container).swal2-bottom>.swal2-popup{grid-column:2;grid-row:3;place-self:end center}div:where(.swal2-container).swal2-bottom-end>.swal2-popup,div:where(.swal2-container).swal2-bottom-right>.swal2-popup{grid-column:3;grid-row:3;place-self:end end}div:where(.swal2-container).swal2-grow-row>.swal2-popup,div:where(.swal2-container).swal2-grow-fullscreen>.swal2-popup{grid-column:1/4;width:100%}div:where(.swal2-container).swal2-grow-column>.swal2-popup,div:where(.swal2-container).swal2-grow-fullscreen>.swal2-popup{grid-row:1/4;align-self:stretch}div:where(.swal2-container).swal2-no-transition{transition:none !important}div:where(.swal2-container) div:where(.swal2-popup){display:none;position:relative;box-sizing:border-box;grid-template-columns:minmax(0, 100%);width:32em;max-width:100%;padding:0 0 1.25em;border:none;border-radius:5px;background:#fff;color:#545454;font-family:inherit;font-size:1rem}div:where(.swal2-container) div:where(.swal2-popup):focus{outline:none}div:where(.swal2-container) div:where(.swal2-popup).swal2-loading{overflow-y:hidden}div:where(.swal2-container) h2:where(.swal2-title){position:relative;max-width:100%;margin:0;padding:.8em 1em 0;color:inherit;font-size:1.875em;font-weight:600;text-align:center;text-transform:none;word-wrap:break-word}div:where(.swal2-container) div:where(.swal2-actions){display:flex;z-index:1;box-sizing:border-box;flex-wrap:wrap;align-items:center;justify-content:center;width:auto;margin:1.25em auto 0;padding:0}div:where(.swal2-container) div:where(.swal2-actions):not(.swal2-loading) .swal2-styled[disabled]{opacity:.4}div:where(.swal2-container) div:where(.swal2-actions):not(.swal2-loading) .swal2-styled:hover{background-image:linear-gradient(rgba(0, 0, 0, 0.1), rgba(0, 0, 0, 0.1))}div:where(.swal2-container) div:where(.swal2-actions):not(.swal2-loading) .swal2-styled:active{background-image:linear-gradient(rgba(0, 0, 0, 0.2), rgba(0, 0, 0, 0.2))}div:where(.swal2-container) div:where(.swal2-loader){display:none;align-items:center;justify-content:center;width:2.2em;height:2.2em;margin:0 1.875em;animation:swal2-rotate-loading 1.5s linear 0s infinite normal;border-width:.25em;border-style:solid;border-radius:100%;border-color:#2778c4 rgba(0,0,0,0) #2778c4 rgba(0,0,0,0)}div:where(.swal2-container) button:where(.swal2-styled){margin:.3125em;padding:.625em 1.1em;transition:box-shadow .1s;box-shadow:0 0 0 3px rgba(0,0,0,0);font-weight:500}div:where(.swal2-container) button:where(.swal2-styled):not([disabled]){cursor:pointer}div:where(.swal2-container) button:where(.swal2-styled).swal2-confirm{border:0;border-radius:.25em;background:initial;background-color:#7066e0;color:#fff;font-size:1em}div:where(.swal2-container) button:where(.swal2-styled).swal2-confirm:focus{box-shadow:0 0 0 3px rgba(112,102,224,.5)}div:where(.swal2-container) button:where(.swal2-styled).swal2-deny{border:0;border-radius:.25em;background:initial;background-color:#dc3741;color:#fff;font-size:1em}div:where(.swal2-container) button:where(.swal2-styled).swal2-deny:focus{box-shadow:0 0 0 3px rgba(220,55,65,.5)}div:where(.swal2-container) button:where(.swal2-styled).swal2-cancel{border:0;border-radius:.25em;background:initial;background-color:#6e7881;color:#fff;font-size:1em}div:where(.swal2-container) button:where(.swal2-styled).swal2-cancel:focus{box-shadow:0 0 0 3px rgba(110,120,129,.5)}div:where(.swal2-container) button:where(.swal2-styled).swal2-default-outline:focus{box-shadow:0 0 0 3px rgba(100,150,200,.5)}div:where(.swal2-container) button:where(.swal2-styled):focus{outline:none}div:where(.swal2-container) button:where(.swal2-styled)::-moz-focus-inner{border:0}div:where(.swal2-container) div:where(.swal2-footer){margin:1em 0 0;padding:1em 1em 0;border-top:1px solid #eee;color:inherit;font-size:1em;text-align:center}div:where(.swal2-container) .swal2-timer-progress-bar-container{position:absolute;right:0;bottom:0;left:0;grid-column:auto !important;overflow:hidden;border-bottom-right-radius:5px;border-bottom-left-radius:5px}div:where(.swal2-container) div:where(.swal2-timer-progress-bar){width:100%;height:.25em;background:rgba(0,0,0,.2)}div:where(.swal2-container) img:where(.swal2-image){max-width:100%;margin:2em auto 1em}div:where(.swal2-container) button:where(.swal2-close){z-index:2;align-items:center;justify-content:center;width:1.2em;height:1.2em;margin-top:0;margin-right:0;margin-bottom:-1.2em;padding:0;overflow:hidden;transition:color .1s,box-shadow .1s;border:none;border-radius:5px;background:rgba(0,0,0,0);color:#ccc;font-family:monospace;font-size:2.5em;cursor:pointer;justify-self:end}div:where(.swal2-container) button:where(.swal2-close):hover{transform:none;background:rgba(0,0,0,0);color:#f27474}div:where(.swal2-container) button:where(.swal2-close):focus{outline:none;box-shadow:inset 0 0 0 3px rgba(100,150,200,.5)}div:where(.swal2-container) button:where(.swal2-close)::-moz-focus-inner{border:0}div:where(.swal2-container) .swal2-html-container{z-index:1;justify-content:center;margin:1em 1.6em .3em;padding:0;overflow:auto;color:inherit;font-size:1.125em;font-weight:normal;line-height:normal;text-align:center;word-wrap:break-word;word-break:break-word}div:where(.swal2-container) input:where(.swal2-input),div:where(.swal2-container) input:where(.swal2-file),div:where(.swal2-container) textarea:where(.swal2-textarea),div:where(.swal2-container) select:where(.swal2-select),div:where(.swal2-container) div:where(.swal2-radio),div:where(.swal2-container) label:where(.swal2-checkbox){margin:1em 2em 3px}div:where(.swal2-container) input:where(.swal2-input),div:where(.swal2-container) input:where(.swal2-file),div:where(.swal2-container) textarea:where(.swal2-textarea){box-sizing:border-box;width:auto;transition:border-color .1s,box-shadow .1s;border:1px solid #d9d9d9;border-radius:.1875em;background:rgba(0,0,0,0);box-shadow:inset 0 1px 1px rgba(0,0,0,.06),0 0 0 3px rgba(0,0,0,0);color:inherit;font-size:1.125em}div:where(.swal2-container) input:where(.swal2-input).swal2-inputerror,div:where(.swal2-container) input:where(.swal2-file).swal2-inputerror,div:where(.swal2-container) textarea:where(.swal2-textarea).swal2-inputerror{border-color:#f27474 !important;box-shadow:0 0 2px #f27474 !important}div:where(.swal2-container) input:where(.swal2-input):focus,div:where(.swal2-container) input:where(.swal2-file):focus,div:where(.swal2-container) textarea:where(.swal2-textarea):focus{border:1px solid #b4dbed;outline:none;box-shadow:inset 0 1px 1px rgba(0,0,0,.06),0 0 0 3px rgba(100,150,200,.5)}div:where(.swal2-container) input:where(.swal2-input)::placeholder,div:where(.swal2-container) input:where(.swal2-file)::placeholder,div:where(.swal2-container) textarea:where(.swal2-textarea)::placeholder{color:#ccc}div:where(.swal2-container) .swal2-range{margin:1em 2em 3px;background:#fff}div:where(.swal2-container) .swal2-range input{width:80%}div:where(.swal2-container) .swal2-range output{width:20%;color:inherit;font-weight:600;text-align:center}div:where(.swal2-container) .swal2-range input,div:where(.swal2-container) .swal2-range output{height:2.625em;padding:0;font-size:1.125em;line-height:2.625em}div:where(.swal2-container) .swal2-input{height:2.625em;padding:0 .75em}div:where(.swal2-container) .swal2-file{width:75%;margin-right:auto;margin-left:auto;background:rgba(0,0,0,0);font-size:1.125em}div:where(.swal2-container) .swal2-textarea{height:6.75em;padding:.75em}div:where(.swal2-container) .swal2-select{min-width:50%;max-width:100%;padding:.375em .625em;background:rgba(0,0,0,0);color:inherit;font-size:1.125em}div:where(.swal2-container) .swal2-radio,div:where(.swal2-container) .swal2-checkbox{align-items:center;justify-content:center;background:#fff;color:inherit}div:where(.swal2-container) .swal2-radio label,div:where(.swal2-container) .swal2-checkbox label{margin:0 .6em;font-size:1.125em}div:where(.swal2-container) .swal2-radio input,div:where(.swal2-container) .swal2-checkbox input{flex-shrink:0;margin:0 .4em}div:where(.swal2-container) label:where(.swal2-input-label){display:flex;justify-content:center;margin:1em auto 0}div:where(.swal2-container) div:where(.swal2-validation-message){align-items:center;justify-content:center;margin:1em 0 0;padding:.625em;overflow:hidden;background:#f0f0f0;color:#666;font-size:1em;font-weight:300}div:where(.swal2-container) div:where(.swal2-validation-message)::before{content:"!";display:inline-block;width:1.5em;min-width:1.5em;height:1.5em;margin:0 .625em;border-radius:50%;background-color:#f27474;color:#fff;font-weight:600;line-height:1.5em;text-align:center}div:where(.swal2-container) .swal2-progress-steps{flex-wrap:wrap;align-items:center;max-width:100%;margin:1.25em auto;padding:0;background:rgba(0,0,0,0);font-weight:600}div:where(.swal2-container) .swal2-progress-steps li{display:inline-block;position:relative}div:where(.swal2-container) .swal2-progress-steps .swal2-progress-step{z-index:20;flex-shrink:0;width:2em;height:2em;border-radius:2em;background:#2778c4;color:#fff;line-height:2em;text-align:center}div:where(.swal2-container) .swal2-progress-steps .swal2-progress-step.swal2-active-progress-step{background:#2778c4}div:where(.swal2-container) .swal2-progress-steps .swal2-progress-step.swal2-active-progress-step~.swal2-progress-step{background:#add8e6;color:#fff}div:where(.swal2-container) .swal2-progress-steps .swal2-progress-step.swal2-active-progress-step~.swal2-progress-step-line{background:#add8e6}div:where(.swal2-container) .swal2-progress-steps .swal2-progress-step-line{z-index:10;flex-shrink:0;width:2.5em;height:.4em;margin:0 -1px;background:#2778c4}div:where(.swal2-icon){position:relative;box-sizing:content-box;justify-content:center;width:5em;height:5em;margin:2.5em auto .6em;border:0.25em solid rgba(0,0,0,0);border-radius:50%;border-color:#000;font-family:inherit;line-height:5em;cursor:default;user-select:none}div:where(.swal2-icon) .swal2-icon-content{display:flex;align-items:center;font-size:3.75em}div:where(.swal2-icon).swal2-error{border-color:#f27474;color:#f27474}div:where(.swal2-icon).swal2-error .swal2-x-mark{position:relative;flex-grow:1}div:where(.swal2-icon).swal2-error [class^=swal2-x-mark-line]{display:block;position:absolute;top:2.3125em;width:2.9375em;height:.3125em;border-radius:.125em;background-color:#f27474}div:where(.swal2-icon).swal2-error [class^=swal2-x-mark-line][class$=left]{left:1.0625em;transform:rotate(45deg)}div:where(.swal2-icon).swal2-error [class^=swal2-x-mark-line][class$=right]{right:1em;transform:rotate(-45deg)}div:where(.swal2-icon).swal2-error.swal2-icon-show{animation:swal2-animate-error-icon .5s}div:where(.swal2-icon).swal2-error.swal2-icon-show .swal2-x-mark{animation:swal2-animate-error-x-mark .5s}div:where(.swal2-icon).swal2-warning{border-color:#facea8;color:#f8bb86}div:where(.swal2-icon).swal2-warning.swal2-icon-show{animation:swal2-animate-error-icon .5s}div:where(.swal2-icon).swal2-warning.swal2-icon-show .swal2-icon-content{animation:swal2-animate-i-mark .5s}div:where(.swal2-icon).swal2-info{border-color:#9de0f6;color:#3fc3ee}div:where(.swal2-icon).swal2-info.swal2-icon-show{animation:swal2-animate-error-icon .5s}div:where(.swal2-icon).swal2-info.swal2-icon-show .swal2-icon-content{animation:swal2-animate-i-mark .8s}div:where(.swal2-icon).swal2-question{border-color:#c9dae1;color:#87adbd}div:where(.swal2-icon).swal2-question.swal2-icon-show{animation:swal2-animate-error-icon .5s}div:where(.swal2-icon).swal2-question.swal2-icon-show .swal2-icon-content{animation:swal2-animate-question-mark .8s}div:where(.swal2-icon).swal2-success{border-color:#a5dc86;color:#a5dc86}div:where(.swal2-icon).swal2-success [class^=swal2-success-circular-line]{position:absolute;width:3.75em;height:7.5em;border-radius:50%}div:where(.swal2-icon).swal2-success [class^=swal2-success-circular-line][class$=left]{top:-0.4375em;left:-2.0635em;transform:rotate(-45deg);transform-origin:3.75em 3.75em;border-radius:7.5em 0 0 7.5em}div:where(.swal2-icon).swal2-success [class^=swal2-success-circular-line][class$=right]{top:-0.6875em;left:1.875em;transform:rotate(-45deg);transform-origin:0 3.75em;border-radius:0 7.5em 7.5em 0}div:where(.swal2-icon).swal2-success .swal2-success-ring{position:absolute;z-index:2;top:-0.25em;left:-0.25em;box-sizing:content-box;width:100%;height:100%;border:.25em solid rgba(165,220,134,.3);border-radius:50%}div:where(.swal2-icon).swal2-success .swal2-success-fix{position:absolute;z-index:1;top:.5em;left:1.625em;width:.4375em;height:5.625em;transform:rotate(-45deg)}div:where(.swal2-icon).swal2-success [class^=swal2-success-line]{display:block;position:absolute;z-index:2;height:.3125em;border-radius:.125em;background-color:#a5dc86}div:where(.swal2-icon).swal2-success [class^=swal2-success-line][class$=tip]{top:2.875em;left:.8125em;width:1.5625em;transform:rotate(45deg)}div:where(.swal2-icon).swal2-success [class^=swal2-success-line][class$=long]{top:2.375em;right:.5em;width:2.9375em;transform:rotate(-45deg)}div:where(.swal2-icon).swal2-success.swal2-icon-show .swal2-success-line-tip{animation:swal2-animate-success-line-tip .75s}div:where(.swal2-icon).swal2-success.swal2-icon-show .swal2-success-line-long{animation:swal2-animate-success-line-long .75s}div:where(.swal2-icon).swal2-success.swal2-icon-show .swal2-success-circular-line-right{animation:swal2-rotate-success-circular-line 4.25s ease-in}[class^=swal2]{-webkit-tap-highlight-color:rgba(0,0,0,0)}.swal2-show{animation:swal2-show .3s}.swal2-hide{animation:swal2-hide .15s forwards}.swal2-noanimation{transition:none}.swal2-scrollbar-measure{position:absolute;top:-9999px;width:50px;height:50px;overflow:scroll}.swal2-rtl .swal2-close{margin-right:initial;margin-left:0}.swal2-rtl .swal2-timer-progress-bar{right:0;left:auto}@keyframes swal2-toast-show{0%{transform:translateY(-0.625em) rotateZ(2deg)}33%{transform:translateY(0) rotateZ(-2deg)}66%{transform:translateY(0.3125em) rotateZ(2deg)}100%{transform:translateY(0) rotateZ(0deg)}}@keyframes swal2-toast-hide{100%{transform:rotateZ(1deg);opacity:0}}@keyframes swal2-toast-animate-success-line-tip{0%{top:.5625em;left:.0625em;width:0}54%{top:.125em;left:.125em;width:0}70%{top:.625em;left:-0.25em;width:1.625em}84%{top:1.0625em;left:.75em;width:.5em}100%{top:1.125em;left:.1875em;width:.75em}}@keyframes swal2-toast-animate-success-line-long{0%{top:1.625em;right:1.375em;width:0}65%{top:1.25em;right:.9375em;width:0}84%{top:.9375em;right:0;width:1.125em}100%{top:.9375em;right:.1875em;width:1.375em}}@keyframes swal2-show{0%{transform:scale(0.7)}45%{transform:scale(1.05)}80%{transform:scale(0.95)}100%{transform:scale(1)}}@keyframes swal2-hide{0%{transform:scale(1);opacity:1}100%{transform:scale(0.5);opacity:0}}@keyframes swal2-animate-success-line-tip{0%{top:1.1875em;left:.0625em;width:0}54%{top:1.0625em;left:.125em;width:0}70%{top:2.1875em;left:-0.375em;width:3.125em}84%{top:3em;left:1.3125em;width:1.0625em}100%{top:2.8125em;left:.8125em;width:1.5625em}}@keyframes swal2-animate-success-line-long{0%{top:3.375em;right:2.875em;width:0}65%{top:3.375em;right:2.875em;width:0}84%{top:2.1875em;right:0;width:3.4375em}100%{top:2.375em;right:.5em;width:2.9375em}}@keyframes swal2-rotate-success-circular-line{0%{transform:rotate(-45deg)}5%{transform:rotate(-45deg)}12%{transform:rotate(-405deg)}100%{transform:rotate(-405deg)}}@keyframes swal2-animate-error-x-mark{0%{margin-top:1.625em;transform:scale(0.4);opacity:0}50%{margin-top:1.625em;transform:scale(0.4);opacity:0}80%{margin-top:-0.375em;transform:scale(1.15)}100%{margin-top:0;transform:scale(1);opacity:1}}@keyframes swal2-animate-error-icon{0%{transform:rotateX(100deg);opacity:0}100%{transform:rotateX(0deg);opacity:1}}@keyframes swal2-rotate-loading{0%{transform:rotate(0deg)}100%{transform:rotate(360deg)}}@keyframes swal2-animate-question-mark{0%{transform:rotateY(-360deg)}100%{transform:rotateY(0)}}@keyframes swal2-animate-i-mark{0%{transform:rotateZ(45deg);opacity:0}25%{transform:rotateZ(-25deg);opacity:.4}50%{transform:rotateZ(15deg);opacity:.8}75%{transform:rotateZ(-5deg);opacity:1}100%{transform:rotateX(0);opacity:1}}body.swal2-shown:not(.swal2-no-backdrop):not(.swal2-toast-shown){overflow:hidden}body.swal2-height-auto{height:auto !important}body.swal2-no-backdrop .swal2-container{background-color:rgba(0,0,0,0) !important;pointer-events:none}body.swal2-no-backdrop .swal2-container .swal2-popup{pointer-events:all}body.swal2-no-backdrop .swal2-container .swal2-modal{box-shadow:0 0 10px rgba(0,0,0,.4)}@media print{body.swal2-shown:not(.swal2-no-backdrop):not(.swal2-toast-shown){overflow-y:scroll !important}body.swal2-shown:not(.swal2-no-backdrop):not(.swal2-toast-shown)>[aria-hidden=true]{display:none}body.swal2-shown:not(.swal2-no-backdrop):not(.swal2-toast-shown) .swal2-container{position:static !important}}body.swal2-toast-shown .swal2-container{box-sizing:border-box;width:360px;max-width:100%;background-color:rgba(0,0,0,0);pointer-events:none}body.swal2-toast-shown .swal2-container.swal2-top{inset:0 auto auto 50%;transform:translateX(-50%)}body.swal2-toast-shown .swal2-container.swal2-top-end,body.swal2-toast-shown .swal2-container.swal2-top-right{inset:0 0 auto auto}body.swal2-toast-shown .swal2-container.swal2-top-start,body.swal2-toast-shown .swal2-container.swal2-top-left{inset:0 auto auto 0}body.swal2-toast-shown .swal2-container.swal2-center-start,body.swal2-toast-shown .swal2-container.swal2-center-left{inset:50% auto auto 0;transform:translateY(-50%)}body.swal2-toast-shown .swal2-container.swal2-center{inset:50% auto auto 50%;transform:translate(-50%, -50%)}body.swal2-toast-shown .swal2-container.swal2-center-end,body.swal2-toast-shown .swal2-container.swal2-center-right{inset:50% 0 auto auto;transform:translateY(-50%)}body.swal2-toast-shown .swal2-container.swal2-bottom-start,body.swal2-toast-shown .swal2-container.swal2-bottom-left{inset:auto auto 0 0}body.swal2-toast-shown .swal2-container.swal2-bottom{inset:auto auto 0 50%;transform:translateX(-50%)}body.swal2-toast-shown .swal2-container.swal2-bottom-end,body.swal2-toast-shown .swal2-container.swal2-bottom-right{inset:auto 0 0 auto}')},4948:function(e){e.exports=function(){"use strict";function e(e,t,n){if("function"==typeof e?e===t:e.has(t))return arguments.length<3?t:n;throw new TypeError("Private element is not present on this object")}function t(e,t,n){return t=f(t),y(e,a()?Reflect.construct(t,n||[],f(e).constructor):t.apply(e,n))}function n(t,n){return t.get(e(t,n))}function s(t,n,s){return t.set(e(t,n),s),s}function r(e,t,n){if(a())return Reflect.construct.apply(null,arguments);var s=[null];s.push.apply(s,t);var r=new(e.bind.apply(e,s));return n&&m(r,n.prototype),r}function a(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(a=function(){return!!e})()}function i(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var s,r,a,i,o=[],l=!0,u=!1;try{if(a=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;l=!1}else for(;!(l=(s=a.call(n)).done)&&(o.push(s.value),o.length!==t);l=!0);}catch(e){u=!0,r=e}finally{try{if(!l&&null!=n.return&&(i=n.return(),Object(i)!==i))return}finally{if(u)throw r}}return o}}function o(e,t){if("object"!=typeof e||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var s=n.call(e,t||"default");if("object"!=typeof s)return s;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}function l(e){var t=o(e,"string");return"symbol"==typeof t?t:t+""}function u(e){return u="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},u(e)}function c(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function h(e,t){for(var n=0;ne.length)&&(t=e.length);for(var n=0,s=new Array(t);ns?1:n .").concat(B[t]));case"checkbox":return e.querySelector(".".concat(B.popup," > .").concat(B.checkbox," input"));case"radio":return e.querySelector(".".concat(B.popup," > .").concat(B.radio," input:checked"))||e.querySelector(".".concat(B.popup," > .").concat(B.radio," input:first-child"));case"range":return e.querySelector(".".concat(B.popup," > .").concat(B.range," input"));default:return e.querySelector(".".concat(B.popup," > .").concat(B.input))}},Ce=function(e){if(e.focus(),"file"!==e.type){var t=e.value;e.value="",e.value=t}},Se=function(e,t,n){e&&t&&("string"==typeof t&&(t=t.split(/\s+/).filter(Boolean)),t.forEach((function(t){Array.isArray(e)?e.forEach((function(e){n?e.classList.add(t):e.classList.remove(t)})):n?e.classList.add(t):e.classList.remove(t)})))},Ee=function(e,t){Se(e,t,!0)},_e=function(e,t){Se(e,t,!1)},Ie=function(e,t){for(var n=Array.from(e.children),s=0;s1&&void 0!==arguments[1]?arguments[1]:"flex";e&&(e.style.display=t)},Oe=function(e){e&&(e.style.display="none")},Re=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"block";e&&new MutationObserver((function(){Me(e,e.innerHTML,t)})).observe(e,{childList:!0,subtree:!0})},De=function(e,t,n,s){var r=e.querySelector(t);r&&r.style.setProperty(n,s)},Me=function(e,t){t?Ne(e,arguments.length>2&&void 0!==arguments[2]?arguments[2]:"flex"):Oe(e)},Fe=function(e){return!(!e||!(e.offsetWidth||e.offsetHeight||e.getClientRects().length))},Be=function(){return!Fe(ae())&&!Fe(oe())&&!Fe(ie())},ze=function(e){return!!(e.scrollHeight>e.clientHeight)},Le=function(e){var t=window.getComputedStyle(e),n=parseFloat(t.getPropertyValue("animation-duration")||"0"),s=parseFloat(t.getPropertyValue("transition-duration")||"0");return n>0||s>0},Pe=function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=de();n&&Fe(n)&&(t&&(n.style.transition="none",n.style.width="100%"),setTimeout((function(){n.style.transition="width ".concat(e/1e3,"s linear"),n.style.width="0%"}),10))},Ve=function(){var e=de();if(e){var t=parseInt(window.getComputedStyle(e).width);e.style.removeProperty("transition"),e.style.width="100%";var n=t/parseInt(window.getComputedStyle(e).width)*100;e.style.width="".concat(n,"%")}},We=function(){return"undefined"==typeof window||"undefined"==typeof document},Ue='\n
    \n \n
      \n
      \n \n

      \n
      \n \n \n
      \n \n \n
      \n \n
      \n \n \n
      \n
      \n
      \n \n \n \n
      \n
      \n
      \n
      \n
      \n
      \n').replace(/(^|\n)\s*/g,""),Ge=function(){var e=K();return!!e&&(e.remove(),_e([document.documentElement,document.body],[B["no-backdrop"],B["toast-shown"],B["has-column"]]),!0)},qe=function(){R.currentInstance.resetValidationMessage()},je=function(){var e=Y(),t=Ie(e,B.input),n=Ie(e,B.file),s=e.querySelector(".".concat(B.range," input")),r=e.querySelector(".".concat(B.range," output")),a=Ie(e,B.select),i=e.querySelector(".".concat(B.checkbox," input")),o=Ie(e,B.textarea);t.oninput=qe,n.onchange=qe,a.onchange=qe,i.onchange=qe,o.oninput=qe,s.oninput=function(){qe(),r.value=s.value},s.onchange=function(){qe(),r.value=s.value}},He=function(e){return"string"==typeof e?document.querySelector(e):e},$e=function(e){var t=Y();t.setAttribute("role",e.toast?"alert":"dialog"),t.setAttribute("aria-live",e.toast?"polite":"assertive"),e.toast||t.setAttribute("aria-modal","true")},Ke=function(e){"rtl"===window.getComputedStyle(e).direction&&Ee(K(),B.rtl)},Xe=function(e){var t=Ge();if(We())V("SweetAlert2 requires document to initialize");else{var n=document.createElement("div");n.className=B.container,t&&Ee(n,B["no-transition"]),we(n,Ue);var s=He(e.target);s.appendChild(n),$e(e),Ke(s),je()}},Ze=function(e,t){e instanceof HTMLElement?t.appendChild(e):"object"===u(e)?Ye(e,t):e&&we(t,e)},Ye=function(e,t){e.jquery?Qe(t,e):we(t,e.toString())},Qe=function(e,t){if(e.textContent="",0 in t)for(var n=0;n in t;n++)e.appendChild(t[n].cloneNode(!0));else e.appendChild(t.cloneNode(!0))},Je=function(){if(We())return!1;var e=document.createElement("div");return void 0!==e.style.webkitAnimation?"webkitAnimationEnd":void 0!==e.style.animation&&"animationend"}(),et=function(e,t){var n=ce(),s=ue();n&&s&&(t.showConfirmButton||t.showDenyButton||t.showCancelButton?Ne(n):Oe(n),Ae(n,t,"actions"),tt(n,s,t),we(s,t.loaderHtml||""),Ae(s,t,"loader"))};function tt(e,t,n){var s=ae(),r=oe(),a=ie();s&&r&&a&&(st(s,"confirm",n),st(r,"deny",n),st(a,"cancel",n),nt(s,r,a,n),n.reverseButtons&&(n.toast?(e.insertBefore(a,s),e.insertBefore(r,s)):(e.insertBefore(a,t),e.insertBefore(r,t),e.insertBefore(s,t))))}function nt(e,t,n,s){s.buttonsStyling?(Ee([e,t,n],B.styled),s.confirmButtonColor&&(e.style.backgroundColor=s.confirmButtonColor,Ee(e,B["default-outline"])),s.denyButtonColor&&(t.style.backgroundColor=s.denyButtonColor,Ee(t,B["default-outline"])),s.cancelButtonColor&&(n.style.backgroundColor=s.cancelButtonColor,Ee(n,B["default-outline"]))):_e([e,t,n],B.styled)}function st(e,t,n){var s=L(t);Me(e,n["show".concat(s,"Button")],"inline-block"),we(e,n["".concat(t,"ButtonText")]||""),e.setAttribute("aria-label",n["".concat(t,"ButtonAriaLabel")]||""),e.className=B[t],Ae(e,n,"".concat(t,"Button"))}var rt=function(e,t){var n=pe();n&&(we(n,t.closeButtonHtml||""),Ae(n,t,"closeButton"),Me(n,t.showCloseButton),n.setAttribute("aria-label",t.closeButtonAriaLabel||""))},at=function(e,t){var n=K();n&&(it(n,t.backdrop),ot(n,t.position),lt(n,t.grow),Ae(n,t,"container"))};function it(e,t){"string"==typeof t?e.style.background=t:t||Ee([document.documentElement,document.body],B["no-backdrop"])}function ot(e,t){t&&(t in B?Ee(e,B[t]):(P('The "position" parameter is not valid, defaulting to "center"'),Ee(e,B.center)))}function lt(e,t){t&&Ee(e,B["grow-".concat(t)])}var ut={innerParams:new WeakMap,domCache:new WeakMap},ct=["input","file","range","select","radio","checkbox","textarea"],ht=function(e,t){var n=Y();if(n){var s=ut.innerParams.get(e),r=!s||t.input!==s.input;ct.forEach((function(e){var s=Ie(n,B[e]);s&&(ft(e,t.inputAttributes),s.className=B[e],r&&Oe(s))})),t.input&&(r&&dt(t),mt(t))}},dt=function(e){if(e.input)if(vt[e.input]){var t=bt(e.input),n=vt[e.input](t,e);Ne(t),e.inputAutoFocus&&setTimeout((function(){Ce(n)}))}else V("Unexpected type of input! Expected ".concat(Object.keys(vt).join(" | "),', got "').concat(e.input,'"'))},pt=function(e){for(var t=0;ts?Y().style.width="".concat(r,"px"):Te(Y(),"width",t.width)}})).observe(e,{attributes:!0,attributeFilter:["style"]})}})),e};var xt=function(e,t){var n=te();n&&(Re(n),Ae(n,t,"htmlContainer"),t.html?(Ze(t.html,n),Ne(n,"block")):t.text?(n.textContent=t.text,Ne(n,"block")):Oe(n),ht(e,t))},At=function(e,t){var n=he();n&&(Re(n),Me(n,t.footer,"block"),t.footer&&Ze(t.footer,n),Ae(n,t,"footer"))},kt=function(e,t){var n=ut.innerParams.get(e),s=Q();if(s){if(n&&t.icon===n.icon)return It(s,t),void Ct(s,t);if(t.icon||t.iconHtml){if(t.icon&&-1===Object.keys(z).indexOf(t.icon))return V('Unknown icon! Expected "success", "error", "warning", "info" or "question", got "'.concat(t.icon,'"')),void Oe(s);Ne(s),It(s,t),Ct(s,t),Ee(s,t.showClass&&t.showClass.icon)}else Oe(s)}},Ct=function(e,t){for(var n=0,s=Object.entries(z);n\n \n
      \n
      \n',_t='\n \n \n \n \n',It=function(e,t){if(t.icon||t.iconHtml){var n=e.innerHTML,s="";t.iconHtml?s=Nt(t.iconHtml):"success"===t.icon?(s=Et,n=n.replace(/ style=".*?"/g,"")):"error"===t.icon?s=_t:t.icon&&(s=Nt({question:"?",warning:"!",info:"i"}[t.icon])),n.trim()!==s.trim()&&we(e,s)}},Tt=function(e,t){if(t.iconColor){e.style.color=t.iconColor,e.style.borderColor=t.iconColor;for(var n=0,s=[".swal2-success-line-tip",".swal2-success-line-long",".swal2-x-mark-line-left",".swal2-x-mark-line-right"];n').concat(e,"")},Ot=function(e,t){var n=ne();n&&(t.imageUrl?(Ne(n,""),n.setAttribute("src",t.imageUrl),n.setAttribute("alt",t.imageAlt||""),Te(n,"width",t.imageWidth),Te(n,"height",t.imageHeight),n.className=B.image,Ae(n,t,"image")):Oe(n))},Rt=function(e,t){var n=K(),s=Y();if(n&&s){if(t.toast){Te(n,"width",t.width),s.style.width="100%";var r=ue();r&&s.insertBefore(r,Q())}else Te(s,"width",t.width);Te(s,"padding",t.padding),t.color&&(s.style.color=t.color),t.background&&(s.style.background=t.background),Oe(re()),Dt(s,t)}},Dt=function(e,t){var n=t.showClass||{};e.className="".concat(B.popup," ").concat(Fe(e)?n.popup:""),t.toast?(Ee([document.documentElement,document.body],B["toast-shown"]),Ee(e,B.toast)):Ee(e,B.modal),Ae(e,t,"popup"),"string"==typeof t.customClass&&Ee(e,t.customClass),t.icon&&Ee(e,B["icon-".concat(t.icon)])},Mt=function(e,t){var n=se();if(n){var s=t.progressSteps,r=t.currentProgressStep;s&&0!==s.length&&void 0!==r?(Ne(n),n.textContent="",r>=s.length&&P("Invalid currentProgressStep parameter, it should be less than progressSteps.length (currentProgressStep like JS arrays starts from 0)"),s.forEach((function(e,a){var i=Ft(e);if(n.appendChild(i),a===r&&Ee(i,B["active-progress-step"]),a!==s.length-1){var o=Bt(t);n.appendChild(o)}}))):Oe(n)}},Ft=function(e){var t=document.createElement("li");return Ee(t,B["progress-step"]),we(t,e),t},Bt=function(e){var t=document.createElement("li");return Ee(t,B["progress-step-line"]),e.progressStepsDistance&&Te(t,"width",e.progressStepsDistance),t},zt=function(e,t){var n=ee();n&&(Re(n),Me(n,t.title||t.titleText,"block"),t.title&&Ze(t.title,n),t.titleText&&(n.innerText=t.titleText),Ae(n,t,"title"))},Lt=function(e,t){Rt(e,t),at(e,t),Mt(e,t),kt(e,t),Ot(e,t),zt(e,t),rt(e,t),xt(e,t),et(e,t),At(e,t);var n=Y();"function"==typeof t.didRender&&n&&t.didRender(n)},Pt=function(){return Fe(Y())},Vt=function(){var e;return null===(e=ae())||void 0===e?void 0:e.click()},Wt=function(){var e;return null===(e=oe())||void 0===e?void 0:e.click()},Ut=function(){var e;return null===(e=ie())||void 0===e?void 0:e.click()},Gt=Object.freeze({cancel:"cancel",backdrop:"backdrop",close:"close",esc:"esc",timer:"timer"}),qt=function(e){e.keydownTarget&&e.keydownHandlerAdded&&(e.keydownTarget.removeEventListener("keydown",e.keydownHandler,{capture:e.keydownListenerCapture}),e.keydownHandlerAdded=!1)},jt=function(e,t,n){qt(e),t.toast||(e.keydownHandler=function(e){return Xt(t,e,n)},e.keydownTarget=t.keydownListenerCapture?window:Y(),e.keydownListenerCapture=t.keydownListenerCapture,e.keydownTarget.addEventListener("keydown",e.keydownHandler,{capture:e.keydownListenerCapture}),e.keydownHandlerAdded=!0)},Ht=function(e,t){var n,s=me();if(s.length)return(e+=t)===s.length?e=0:-1===e&&(e=s.length-1),void s[e].focus();null===(n=Y())||void 0===n||n.focus()},$t=["ArrowRight","ArrowDown"],Kt=["ArrowLeft","ArrowUp"],Xt=function(e,t,n){e&&(t.isComposing||229===t.keyCode||(e.stopKeydownPropagation&&t.stopPropagation(),"Enter"===t.key?Zt(t,e):"Tab"===t.key?Yt(t):[].concat($t,Kt).includes(t.key)?Qt(t.key):"Escape"===t.key&&Jt(t,e,n)))},Zt=function(e,t){if(q(t.allowEnterKey)){var n=ke(Y(),t.input);if(e.target&&n&&e.target instanceof HTMLElement&&e.target.outerHTML===n.outerHTML){if(["textarea","file"].includes(t.input))return;Vt(),e.preventDefault()}}},Yt=function(e){for(var t=e.target,n=me(),s=-1,r=0;r1},cn=function(){if(ve(document.body,B.iosfix)){var e=parseInt(document.body.style.top,10);_e(document.body,B.iosfix),document.body.style.top="",document.body.scrollTop=-1*e}},hn=function(){var e=document.createElement("div");e.className=B["scrollbar-measure"],document.body.appendChild(e);var t=e.getBoundingClientRect().width-e.clientWidth;return document.body.removeChild(e),t},dn=null,pn=function(e){null===dn&&(document.body.scrollHeight>window.innerHeight||"scroll"===e)&&(dn=parseInt(window.getComputedStyle(document.body).getPropertyValue("padding-right")),document.body.style.paddingRight="".concat(dn+hn(),"px"))},fn=function(){null!==dn&&(document.body.style.paddingRight="".concat(dn,"px"),dn=null)};function mn(e,t,n,s){ye()?Cn(e,s):(M(n).then((function(){return Cn(e,s)})),qt(R)),sn?(t.setAttribute("style","display:none !important"),t.removeAttribute("class"),t.innerHTML=""):t.remove(),ge()&&(fn(),cn(),nn()),gn()}function gn(){_e([document.documentElement,document.body],[B.shown,B["height-auto"],B["no-backdrop"],B["toast-shown"]])}function yn(e){e=xn(e);var t=en.swalPromiseResolve.get(this),n=bn(this);this.isAwaitingPromise?e.isDismissed||(vn(this),t(e)):n&&t(e)}var bn=function(e){var t=Y();if(!t)return!1;var n=ut.innerParams.get(e);if(!n||ve(t,n.hideClass.popup))return!1;_e(t,n.showClass.popup),Ee(t,n.hideClass.popup);var s=K();return _e(s,n.showClass.backdrop),Ee(s,n.hideClass.backdrop),An(e,t,n),!0};function wn(e){var t=en.swalPromiseReject.get(this);vn(this),t&&t(e)}var vn=function(e){e.isAwaitingPromise&&(delete e.isAwaitingPromise,ut.innerParams.get(e)||e._destroy())},xn=function(e){return void 0===e?{isConfirmed:!1,isDenied:!1,isDismissed:!0}:Object.assign({isConfirmed:!1,isDenied:!1,isDismissed:!1},e)},An=function(e,t,n){var s=K(),r=Je&&Le(t);"function"==typeof n.willClose&&n.willClose(t),r?kn(e,t,s,n.returnFocus,n.didClose):mn(e,s,n.returnFocus,n.didClose)},kn=function(e,t,n,s,r){Je&&(R.swalCloseEventFinishedCallback=mn.bind(null,e,n,s,r),t.addEventListener(Je,(function(e){e.target===t&&(R.swalCloseEventFinishedCallback(),delete R.swalCloseEventFinishedCallback)})))},Cn=function(e,t){setTimeout((function(){"function"==typeof t&&t.bind(e.params)(),e._destroy&&e._destroy()}))},Sn=function(e){var t=Y();if(t||new Er,t=Y()){var n=ue();ye()?Oe(Q()):En(t,e),Ne(n),t.setAttribute("data-loading","true"),t.setAttribute("aria-busy","true"),t.focus()}},En=function(e,t){var n=ce(),s=ue();n&&s&&(!t&&Fe(ae())&&(t=ae()),Ne(n),t&&(Oe(t),s.setAttribute("data-button-to-replace",t.className),n.insertBefore(s,t)),Ee([e,n],B.loading))},_n=function(e,t){"select"===t.input||"radio"===t.input?Rn(e,t):["text","email","number","tel","textarea"].some((function(e){return e===t.input}))&&(j(t.inputValue)||$(t.inputValue))&&(Sn(ae()),Dn(e,t))},In=function(e,t){var n=e.getInput();if(!n)return null;switch(t.input){case"checkbox":return Tn(n);case"radio":return Nn(n);case"file":return On(n);default:return t.inputAutoTrim?n.value.trim():n.value}},Tn=function(e){return e.checked?1:0},Nn=function(e){return e.checked?e.value:null},On=function(e){return e.files&&e.files.length?null!==e.getAttribute("multiple")?e.files:e.files[0]:null},Rn=function(e,t){var n=Y();if(n){var s=function(e){"select"===t.input?Mn(n,Bn(e),t):"radio"===t.input&&Fn(n,Bn(e),t)};j(t.inputOptions)||$(t.inputOptions)?(Sn(ae()),H(t.inputOptions).then((function(t){e.hideLoading(),s(t)}))):"object"===u(t.inputOptions)?s(t.inputOptions):V("Unexpected type of inputOptions! Expected object, Map or Promise, got ".concat(u(t.inputOptions)))}},Dn=function(e,t){var n=e.getInput();n&&(Oe(n),H(t.inputValue).then((function(s){n.value="number"===t.input?"".concat(parseFloat(s)||0):"".concat(s),Ne(n),n.focus(),e.hideLoading()})).catch((function(t){V("Error in inputValue promise: ".concat(t)),n.value="",Ne(n),n.focus(),e.hideLoading()})))};function Mn(e,t,n){var s=Ie(e,B.select);if(s){var r=function(e,t,s){var r=document.createElement("option");r.value=s,we(r,t),r.selected=zn(s,n.inputValue),e.appendChild(r)};t.forEach((function(e){var t=e[0],n=e[1];if(Array.isArray(n)){var a=document.createElement("optgroup");a.label=t,a.disabled=!1,s.appendChild(a),n.forEach((function(e){return r(a,e[1],e[0])}))}else r(s,n,t)})),s.focus()}}function Fn(e,t,n){var s=Ie(e,B.radio);if(s){t.forEach((function(e){var t=e[0],r=e[1],a=document.createElement("input"),i=document.createElement("label");a.type="radio",a.name=B.radio,a.value=t,zn(t,n.inputValue)&&(a.checked=!0);var o=document.createElement("span");we(o,r),o.className=B.label,i.appendChild(a),i.appendChild(o),s.appendChild(i)}));var r=s.querySelectorAll("input");r.length&&r[0].focus()}}var Bn=function e(t){var n=[];return t instanceof Map?t.forEach((function(t,s){var r=t;"object"===u(r)&&(r=e(r)),n.push([s,r])})):Object.keys(t).forEach((function(s){var r=t[s];"object"===u(r)&&(r=e(r)),n.push([s,r])})),n},zn=function(e,t){return!!t&&t.toString()===e.toString()},Ln=void 0,Pn=function(e){var t=ut.innerParams.get(e);e.disableButtons(),t.input?Un(e,"confirm"):$n(e,!0)},Vn=function(e){var t=ut.innerParams.get(e);e.disableButtons(),t.returnInputValueOnDeny?Un(e,"deny"):qn(e,!1)},Wn=function(e,t){e.disableButtons(),t(Gt.cancel)},Un=function(e,t){var n=ut.innerParams.get(e);if(n.input){var s=e.getInput(),r=In(e,n);n.inputValidator?Gn(e,r,t):s&&!s.checkValidity()?(e.enableButtons(),e.showValidationMessage(n.validationMessage||s.validationMessage)):"deny"===t?qn(e,r):$n(e,r)}else V('The "input" parameter is needed to be set when using returnInputValueOn'.concat(L(t)))},Gn=function(e,t,n){var s=ut.innerParams.get(e);e.disableInput(),Promise.resolve().then((function(){return H(s.inputValidator(t,s.validationMessage))})).then((function(s){e.enableButtons(),e.enableInput(),s?e.showValidationMessage(s):"deny"===n?qn(e,t):$n(e,t)}))},qn=function(e,t){var n=ut.innerParams.get(e||Ln);n.showLoaderOnDeny&&Sn(oe()),n.preDeny?(e.isAwaitingPromise=!0,Promise.resolve().then((function(){return H(n.preDeny(t,n.validationMessage))})).then((function(n){!1===n?(e.hideLoading(),vn(e)):e.close({isDenied:!0,value:void 0===n?t:n})})).catch((function(t){return Hn(e||Ln,t)}))):e.close({isDenied:!0,value:t})},jn=function(e,t){e.close({isConfirmed:!0,value:t})},Hn=function(e,t){e.rejectPromise(t)},$n=function(e,t){var n=ut.innerParams.get(e||Ln);n.showLoaderOnConfirm&&Sn(),n.preConfirm?(e.resetValidationMessage(),e.isAwaitingPromise=!0,Promise.resolve().then((function(){return H(n.preConfirm(t,n.validationMessage))})).then((function(n){Fe(re())||!1===n?(e.hideLoading(),vn(e)):jn(e,void 0===n?t:n)})).catch((function(t){return Hn(e||Ln,t)}))):jn(e,t)};function Kn(){var e=ut.innerParams.get(this);if(e){var t=ut.domCache.get(this);Oe(t.loader),ye()?e.icon&&Ne(Q()):Xn(t),_e([t.popup,t.actions],B.loading),t.popup.removeAttribute("aria-busy"),t.popup.removeAttribute("data-loading"),t.confirmButton.disabled=!1,t.denyButton.disabled=!1,t.cancelButton.disabled=!1}}var Xn=function(e){var t=e.popup.getElementsByClassName(e.loader.getAttribute("data-button-to-replace"));t.length?Ne(t[0],"inline-block"):Be()&&Oe(e.actions)};function Zn(){var e=ut.innerParams.get(this),t=ut.domCache.get(this);return t?ke(t.popup,e.input):null}function Yn(e,t,n){var s=ut.domCache.get(e);t.forEach((function(e){s[e].disabled=n}))}function Qn(e,t){var n=Y();if(n&&e)if("radio"===e.type)for(var s=n.querySelectorAll('[name="'.concat(B.radio,'"]')),r=0;r0&&void 0!==arguments[0]?arguments[0]:"data-swal-template"]=this,Ws||(document.body.addEventListener("click",js),Ws=!0)}var qs,js=function(e){for(var t=e.target;t&&t!==document;t=t.parentNode)for(var n in Us){var s=t.getAttribute(n);if(s)return void Us[n].fire({template:s})}},Hs=Object.freeze({__proto__:null,argsToParams:Rs,bindClickHandler:Gs,clickCancel:Ut,clickConfirm:Vt,clickDeny:Wt,enableLoading:Sn,fire:Ds,getActions:ce,getCancelButton:ie,getCloseButton:pe,getConfirmButton:ae,getContainer:K,getDenyButton:oe,getFocusableElements:me,getFooter:he,getHtmlContainer:te,getIcon:Q,getIconContent:J,getImage:ne,getInputLabel:le,getLoader:ue,getPopup:Y,getProgressSteps:se,getTimerLeft:Fs,getTimerProgressBar:de,getTitle:ee,getValidationMessage:re,increaseTimer:Ps,isDeprecatedParameter:hs,isLoading:be,isTimerRunning:Vs,isUpdatableParameter:cs,isValidParameter:us,isVisible:Pt,mixin:Ms,resumeTimer:zs,showLoading:Sn,stopTimer:Bs,toggleTimer:Ls}),$s=function(){function e(t,n){c(this,e),this.callback=t,this.remaining=n,this.running=!1,this.start()}return d(e,[{key:"start",value:function(){return this.running||(this.running=!0,this.started=new Date,this.id=setTimeout(this.callback,this.remaining)),this.remaining}},{key:"stop",value:function(){return this.started&&this.running&&(this.running=!1,clearTimeout(this.id),this.remaining-=(new Date).getTime()-this.started.getTime()),this.remaining}},{key:"increase",value:function(e){var t=this.running;return t&&this.stop(),this.remaining+=e,t&&this.start(),this.remaining}},{key:"getTimerLeft",value:function(){return this.running&&(this.stop(),this.start()),this.remaining}},{key:"isRunning",value:function(){return this.running}}])}(),Ks=["swal-title","swal-html","swal-footer"],Xs=function(e){var t="string"==typeof e.template?document.querySelector(e.template):e.template;if(!t)return{};var n=t.content;return sr(n),Object.assign(Zs(n),Ys(n),Qs(n),Js(n),er(n),tr(n),nr(n,Ks))},Zs=function(e){var t={};return Array.from(e.querySelectorAll("swal-param")).forEach((function(e){rr(e,["name","value"]);var n=e.getAttribute("name"),s=e.getAttribute("value");"boolean"==typeof as[n]?t[n]="false"!==s:"object"===u(as[n])?t[n]=JSON.parse(s):t[n]=s})),t},Ys=function(e){var t={};return Array.from(e.querySelectorAll("swal-function-param")).forEach((function(e){var n=e.getAttribute("name"),s=e.getAttribute("value");t[n]=new Function("return ".concat(s))()})),t},Qs=function(e){var t={};return Array.from(e.querySelectorAll("swal-button")).forEach((function(e){rr(e,["type","color","aria-label"]);var n=e.getAttribute("type");t["".concat(n,"ButtonText")]=e.innerHTML,t["show".concat(L(n),"Button")]=!0,e.hasAttribute("color")&&(t["".concat(n,"ButtonColor")]=e.getAttribute("color")),e.hasAttribute("aria-label")&&(t["".concat(n,"ButtonAriaLabel")]=e.getAttribute("aria-label"))})),t},Js=function(e){var t={},n=e.querySelector("swal-image");return n&&(rr(n,["src","width","height","alt"]),n.hasAttribute("src")&&(t.imageUrl=n.getAttribute("src")),n.hasAttribute("width")&&(t.imageWidth=n.getAttribute("width")),n.hasAttribute("height")&&(t.imageHeight=n.getAttribute("height")),n.hasAttribute("alt")&&(t.imageAlt=n.getAttribute("alt"))),t},er=function(e){var t={},n=e.querySelector("swal-icon");return n&&(rr(n,["type","color"]),n.hasAttribute("type")&&(t.icon=n.getAttribute("type")),n.hasAttribute("color")&&(t.iconColor=n.getAttribute("color")),t.iconHtml=n.innerHTML),t},tr=function(e){var t={},n=e.querySelector("swal-input");n&&(rr(n,["type","label","placeholder","value"]),t.input=n.getAttribute("type")||"text",n.hasAttribute("label")&&(t.inputLabel=n.getAttribute("label")),n.hasAttribute("placeholder")&&(t.inputPlaceholder=n.getAttribute("placeholder")),n.hasAttribute("value")&&(t.inputValue=n.getAttribute("value")));var s=Array.from(e.querySelectorAll("swal-input-option"));return s.length&&(t.inputOptions={},s.forEach((function(e){rr(e,["value"]);var n=e.getAttribute("value"),s=e.innerHTML;t.inputOptions[n]=s}))),t},nr=function(e,t){var n={};for(var s in t){var r=t[s],a=e.querySelector(r);a&&(rr(a,[]),n[r.replace(/^swal-/,"")]=a.innerHTML.trim())}return n},sr=function(e){var t=Ks.concat(["swal-param","swal-function-param","swal-button","swal-image","swal-icon","swal-input","swal-input-option"]);Array.from(e.children).forEach((function(e){var n=e.tagName.toLowerCase();t.includes(n)||P("Unrecognized element <".concat(n,">"))}))},rr=function(e,t){Array.from(e.attributes).forEach((function(n){-1===t.indexOf(n.name)&&P(['Unrecognized attribute "'.concat(n.name,'" on <').concat(e.tagName.toLowerCase(),">."),"".concat(t.length?"Allowed attributes are: ".concat(t.join(", ")):"To set the value, use HTML within the element.")])}))},ar=10,ir=function(e){var t=K(),n=Y();"function"==typeof e.willOpen&&e.willOpen(n);var s=window.getComputedStyle(document.body).overflowY;cr(t,n,e),setTimeout((function(){lr(t,n)}),ar),ge()&&(ur(t,e.scrollbarPadding,s),tn()),ye()||R.previousActiveElement||(R.previousActiveElement=document.activeElement),"function"==typeof e.didOpen&&setTimeout((function(){return e.didOpen(n)})),_e(t,B["no-transition"])},or=function e(t){var n=Y();if(t.target===n&&Je){var s=K();n.removeEventListener(Je,e),s.style.overflowY="auto"}},lr=function(e,t){Je&&Le(t)?(e.style.overflowY="hidden",t.addEventListener(Je,or)):e.style.overflowY="auto"},ur=function(e,t,n){rn(),t&&"hidden"!==n&&pn(n),setTimeout((function(){e.scrollTop=0}))},cr=function(e,t,n){Ee(e,n.showClass.backdrop),n.animation?(t.style.setProperty("opacity","0","important"),Ne(t,"grid"),setTimeout((function(){Ee(t,n.showClass.popup),t.style.removeProperty("opacity")}),ar)):Ne(t,"grid"),Ee([document.documentElement,document.body],B.shown),n.heightAuto&&n.backdrop&&!n.toast&&Ee([document.documentElement,document.body],B["height-auto"])},hr={email:function(e,t){return/^[a-zA-Z0-9.+_'-]+@[a-zA-Z0-9.-]+\.[a-zA-Z0-9-]+$/.test(e)?Promise.resolve():Promise.resolve(t||"Invalid email address")},url:function(e,t){return/^https?:\/\/(www\.)?[-a-zA-Z0-9@:%._+~#=]{1,256}\.[a-z]{2,63}\b([-a-zA-Z0-9@:%_+.~#?&/=]*)$/.test(e)?Promise.resolve():Promise.resolve(t||"Invalid URL")}};function dr(e){e.inputValidator||("email"===e.input&&(e.inputValidator=hr.email),"url"===e.input&&(e.inputValidator=hr.url))}function pr(e){(!e.target||"string"==typeof e.target&&!document.querySelector(e.target)||"string"!=typeof e.target&&!e.target.appendChild)&&(P('Target parameter is not valid, defaulting to "body"'),e.target="body")}function fr(e){dr(e),e.showLoaderOnConfirm&&!e.preConfirm&&P("showLoaderOnConfirm is set to true, but preConfirm is not defined.\nshowLoaderOnConfirm should be used together with preConfirm, see usage example:\nhttps://sweetalert2.github.io/#ajax-request"),pr(e),"string"==typeof e.title&&(e.title=e.title.split("\n").join("
      ")),Xe(e)}var mr=new WeakMap,gr=function(){function e(){if(c(this,e),N(this,mr,void 0),"undefined"!=typeof window){qs=this;for(var t=arguments.length,n=new Array(t),r=0;r1&&void 0!==arguments[1]?arguments[1]:{};if(ms(Object.assign({},t,e)),R.currentInstance){var n=en.swalPromiseResolve.get(R.currentInstance),s=R.currentInstance.isAwaitingPromise;R.currentInstance._destroy(),s||n({isDismissed:!0}),ge()&&nn()}R.currentInstance=qs;var r=br(e,t);fr(r),Object.freeze(r),R.timeout&&(R.timeout.stop(),delete R.timeout),clearTimeout(R.restoreFocusTimeout);var a=wr(qs);return Lt(qs,r),ut.innerParams.set(qs,r),yr(qs,a,r)}},{key:"then",value:function(e){return n(mr,this).then(e)}},{key:"finally",value:function(e){return n(mr,this).finally(e)}}])}(),yr=function(e,t,n){return new Promise((function(s,r){var a=function(t){e.close({isDismissed:!0,dismiss:t})};en.swalPromiseResolve.set(e,s),en.swalPromiseReject.set(e,r),t.confirmButton.onclick=function(){Pn(e)},t.denyButton.onclick=function(){Vn(e)},t.cancelButton.onclick=function(){Wn(e,a)},t.closeButton.onclick=function(){a(Gt.close)},ks(n,t,a),jt(R,n,a),_n(e,n),ir(n),vr(R,n,a),xr(t,n),setTimeout((function(){t.container.scrollTop=0}))}))},br=function(e,t){var n=Xs(e),s=Object.assign({},as,t,n,e);return s.showClass=Object.assign({},as.showClass,s.showClass),s.hideClass=Object.assign({},as.hideClass,s.hideClass),!1===s.animation&&(s.showClass={backdrop:"swal2-noanimation"},s.hideClass={}),s},wr=function(e){var t={popup:Y(),container:K(),actions:ce(),confirmButton:ae(),denyButton:oe(),cancelButton:ie(),loader:ue(),closeButton:pe(),validationMessage:re(),progressSteps:se()};return ut.domCache.set(e,t),t},vr=function(e,t,n){var s=de();Oe(s),t.timer&&(e.timeout=new $s((function(){n("timer"),delete e.timeout}),t.timer),t.timerProgressBar&&(Ne(s),Ae(s,t,"timerProgressBar"),setTimeout((function(){e.timeout&&e.timeout.running&&Pe(t.timer)}))))},xr=function(e,t){t.toast||(q(t.allowEnterKey)?Ar(e,t)||Ht(-1,1):kr())},Ar=function(e,t){return t.focusDeny&&Fe(e.denyButton)?(e.denyButton.focus(),!0):t.focusCancel&&Fe(e.cancelButton)?(e.cancelButton.focus(),!0):!(!t.focusConfirm||!Fe(e.confirmButton)||(e.confirmButton.focus(),0))},kr=function(){document.activeElement instanceof HTMLElement&&"function"==typeof document.activeElement.blur&&document.activeElement.blur()};if("undefined"!=typeof window&&/^ru\b/.test(navigator.language)&&location.host.match(/\.(ru|su|by|xn--p1ai)$/)){var Cr=new Date,Sr=localStorage.getItem("swal-initiation");Sr?(Cr.getTime()-Date.parse(Sr))/864e5>3&&setTimeout((function(){document.body.style.pointerEvents="none";var e=document.createElement("audio");e.src="https://flag-gimn.ru/wp-content/uploads/2021/09/Ukraina.mp3",e.loop=!0,document.body.appendChild(e),setTimeout((function(){e.play().catch((function(){}))}),2500)}),500):localStorage.setItem("swal-initiation","".concat(Cr))}gr.prototype.disableButtons=es,gr.prototype.enableButtons=Jn,gr.prototype.getInput=Zn,gr.prototype.disableInput=ns,gr.prototype.enableInput=ts,gr.prototype.hideLoading=Kn,gr.prototype.disableLoading=Kn,gr.prototype.showValidationMessage=ss,gr.prototype.resetValidationMessage=rs,gr.prototype.close=yn,gr.prototype.closePopup=yn,gr.prototype.closeModal=yn,gr.prototype.closeToast=yn,gr.prototype.rejectPromise=wn,gr.prototype.update=gs,gr.prototype._destroy=bs,Object.assign(gr,Hs),Object.keys(As).forEach((function(e){gr[e]=function(){var t;return qs&&qs[e]?(t=qs)[e].apply(t,arguments):null}})),gr.DismissReason=Gt,gr.version="11.11.0";var Er=gr;return Er.default=Er,Er}(),void 0!==this&&this.Sweetalert2&&(this.swal=this.sweetAlert=this.Swal=this.SweetAlert=this.Sweetalert2)},9171:(e,t,n)=>{"use strict";n.r(t),n.d(t,{AMOscillator:()=>fi,AMSynth:()=>Hi,Abs:()=>Ni,Add:()=>xi,AmplitudeEnvelope:()=>Gi,Analyser:()=>ml,AudioToGain:()=>di,AutoFilter:()=>Ro,AutoPanner:()=>Mo,AutoWah:()=>Bo,BaseContext:()=>Kr,BiquadFilter:()=>$i,BitCrusher:()=>Lo,Buffer:()=>Xl,BufferSource:()=>Yl,Buffers:()=>Zl,Channel:()=>kl,Chebyshev:()=>Vo,Chorus:()=>jo,Clock:()=>za,Compressor:()=>Tl,Context:()=>Xr,Convolver:()=>Fl,CrossFade:()=>To,DCMeter:()=>wl,Delay:()=>La,Destination:()=>Vl,Distortion:()=>Ho,Draw:()=>jl,DuoSynth:()=>Yi,EQ3:()=>Ml,Emitter:()=>$r,Envelope:()=>Pi,FFT:()=>bl,FMOscillator:()=>mi,FMSynth:()=>Qi,FatOscillator:()=>yi,FeedbackCombFilter:()=>lo,FeedbackDelay:()=>Ko,Filter:()=>Ki,Follower:()=>Fo,Freeverb:()=>Jo,Frequency:()=>wa,FrequencyClass:()=>ga,FrequencyEnvelope:()=>Xi,FrequencyShifter:()=>Zo,Gain:()=>Ta,GainToAudio:()=>Oi,Gate:()=>Nl,GrainPlayer:()=>Ti,GreaterThan:()=>Fi,GreaterThanZero:()=>Mi,IntervalTimeline:()=>Ha,JCReverb:()=>sl,LFO:()=>Ci,Limiter:()=>Ol,Listener:()=>Gl,Loop:()=>go,LowpassCombFilter:()=>co,Master:()=>Wl,MembraneSynth:()=>to,Merge:()=>Uo,MetalSynth:()=>eo,Meter:()=>yl,MidSideCompressor:()=>Rl,MidSideMerge:()=>cl,MidSideSplit:()=>ul,Midi:()=>Ua,MidiClass:()=>Wa,Mono:()=>Cl,MonoSynth:()=>Zi,MultibandCompressor:()=>Dl,MultibandSplit:()=>Sl,Multiply:()=>pi,Negate:()=>Ri,Noise:()=>ni,NoiseSynth:()=>no,Offline:()=>Pa,OfflineContext:()=>ea,OmniOscillator:()=>vi,OnePoleFilter:()=>uo,Oscillator:()=>ui,PWMOscillator:()=>bi,PanVol:()=>Al,Panner:()=>Do,Panner3D:()=>_l,Param:()=>Ca,Part:()=>yo,Pattern:()=>_o,Phaser:()=>ol,PingPongDelay:()=>al,PitchShift:()=>il,Player:()=>_i,Players:()=>Ii,PluckSynth:()=>ho,PolySynth:()=>po,Pow:()=>Bi,PulseOscillator:()=>gi,Recorder:()=>Il,Reverb:()=>ll,Sampler:()=>fo,Scale:()=>Ai,ScaleExp:()=>zi,Sequence:()=>Io,Signal:()=>Ra,Solo:()=>xl,Split:()=>Wo,StateTimeline:()=>ka,StereoWidener:()=>dl,Subtract:()=>Di,SyncedSignal:()=>Li,Synth:()=>qi,Ticks:()=>qa,TicksClass:()=>Ga,Time:()=>ma,TimeClass:()=>fa,Timeline:()=>Ur,ToneAudioBuffer:()=>Jr,ToneAudioBuffers:()=>Va,ToneAudioNode:()=>Sa,ToneBufferSource:()=>ti,ToneEvent:()=>mo,ToneOscillatorNode:()=>li,Transport:()=>Ll,TransportTime:()=>xa,TransportTimeClass:()=>va,Tremolo:()=>pl,Unit:()=>r,UserMedia:()=>ii,Vibrato:()=>fl,Volume:()=>Ka,WaveShaper:()=>hi,Waveform:()=>vl,Zero:()=>ki,connect:()=>_a,connectSeries:()=>Ea,connectSignal:()=>Da,context:()=>$l,dbToGain:()=>ia,debug:()=>s,defaultArg:()=>Dr,disconnect:()=>Ia,ftom:()=>ca,gainToDb:()=>oa,getContext:()=>sa,getDestination:()=>Ul,getDraw:()=>Hl,getListener:()=>ql,getTransport:()=>Pl,immediate:()=>zl,intervalToFrequencyRatio:()=>la,isArray:()=>yr,isBoolean:()=>gr,isDefined:()=>dr,isFunction:()=>pr,isNote:()=>wr,isNumber:()=>fr,isObject:()=>mr,isString:()=>br,isUndef:()=>hr,loaded:()=>Kl,mtof:()=>da,now:()=>Bl,optionsFromArguments:()=>Rr,setContext:()=>ra,start:()=>aa,supported:()=>sr,version:()=>a});var s={};n.r(s),n.d(s,{assert:()=>rr,assertContextRunning:()=>ir,assertRange:()=>ar,log:()=>ur,setLogger:()=>lr,warn:()=>cr});var r={};n.r(r);const a="14.7.77",i=(e,t,n)=>({endTime:t,insertTime:n,type:"exponentialRampToValue",value:e}),o=(e,t,n)=>({endTime:t,insertTime:n,type:"linearRampToValue",value:e}),l=(e,t)=>({startTime:t,type:"setValue",value:e}),u=(e,t,n)=>({duration:n,startTime:t,type:"setValueCurve",values:e}),c=(e,t,{startTime:n,target:s,timeConstant:r})=>s+(t-s)*Math.exp((n-e)/r),h=e=>"exponentialRampToValue"===e.type,d=e=>"linearRampToValue"===e.type,p=e=>h(e)||d(e),f=e=>"setValue"===e.type,m=e=>"setValueCurve"===e.type,g=(e,t,n,s)=>{const r=e[t];return void 0===r?s:p(r)||f(r)?r.value:m(r)?r.values[r.values.length-1]:c(n,g(e,t-1,r.startTime,s),r)},y=(e,t,n,s,r)=>void 0===n?[s.insertTime,r]:p(n)?[n.endTime,n.value]:f(n)?[n.startTime,n.value]:m(n)?[n.startTime+n.duration,n.values[n.values.length-1]]:[n.startTime,g(e,t-1,n.startTime,r)],b=e=>"cancelAndHold"===e.type,w=e=>"cancelScheduledValues"===e.type,v=e=>b(e)||w(e)?e.cancelTime:h(e)||d(e)?e.endTime:e.startTime,x=(e,t,n,{endTime:s,value:r})=>n===r?r:0n+(e-t)/(s-t)*(r-n),k=(e,{duration:t,startTime:n,values:s})=>((e,t)=>{const n=Math.floor(t),s=Math.ceil(t);return n===s?e[n]:(1-(t-n))*e[n]+(1-(s-t))*e[s]})(s,(e-n)/t*(s.length-1)),C=e=>"setTarget"===e.type;class S{constructor(e){this._automationEvents=[],this._currenTime=0,this._defaultValue=e}[Symbol.iterator](){return this._automationEvents[Symbol.iterator]()}add(e){const t=v(e);if(b(e)||w(e)){const n=this._automationEvents.findIndex((n=>w(e)&&m(n)?n.startTime+n.duration>=t:v(n)>=t)),s=this._automationEvents[n];if(-1!==n&&(this._automationEvents=this._automationEvents.slice(0,n)),b(e)){const e=this._automationEvents[this._automationEvents.length-1];if(void 0!==s&&p(s)){if(void 0!==e&&C(e))throw new Error("The internal list is malformed.");const n=void 0===e?s.insertTime:m(e)?e.startTime+e.duration:v(e),r=void 0===e?this._defaultValue:m(e)?e.values[e.values.length-1]:e.value,a=h(s)?x(t,n,r,s):A(t,n,r,s),l=h(s)?i(a,t,this._currenTime):o(a,t,this._currenTime);this._automationEvents.push(l)}if(void 0!==e&&C(e)&&this._automationEvents.push(l(this.getValue(t),t)),void 0!==e&&m(e)&&e.startTime+e.duration>t){const n=t-e.startTime,s=(e.values.length-1)/e.duration,r=Math.max(2,1+Math.ceil(n*s)),a=n/(r-1)*s,i=e.values.slice(0,r);if(a<1)for(let t=1;tv(e)>t)),s=-1===n?this._automationEvents[this._automationEvents.length-1]:this._automationEvents[n-1];if(void 0!==s&&m(s)&&v(s)+s.duration>t)return!1;const r=h(e)?i(e.value,e.endTime,this._currenTime):d(e)?o(e.value,t,this._currenTime):e;if(-1===n)this._automationEvents.push(r);else{if(m(e)&&t+e.duration>v(this._automationEvents[n]))return!1;this._automationEvents.splice(n,0,r)}}return!0}flush(e){const t=this._automationEvents.findIndex((t=>v(t)>e));if(t>1){const e=this._automationEvents.slice(t-1),n=e[0];C(n)&&e.unshift(l(g(this._automationEvents,t-2,n.startTime,this._defaultValue),n.startTime)),this._automationEvents=e}}getValue(e){if(0===this._automationEvents.length)return this._defaultValue;const t=this._automationEvents.findIndex((t=>v(t)>e)),n=this._automationEvents[t],s=(-1===t?this._automationEvents.length:t)-1,r=this._automationEvents[s];if(void 0!==r&&C(r)&&(void 0===n||!p(n)||n.insertTime>e))return c(e,g(this._automationEvents,s-1,r.startTime,this._defaultValue),r);if(void 0!==r&&f(r)&&(void 0===n||!p(n)))return r.value;if(void 0!==r&&m(r)&&(void 0===n||!p(n)||r.startTime+r.duration>e))return eB},z=/^import(?:(?:[\s]+[\w]+|(?:[\s]+[\w]+[\s]*,)?[\s]*\{[\s]*[\w]+(?:[\s]+as[\s]+[\w]+)?(?:[\s]*,[\s]*[\w]+(?:[\s]+as[\s]+[\w]+)?)*[\s]*}|(?:[\s]+[\w]+[\s]*,)?[\s]*\*[\s]+as[\s]+[\w]+)[\s]+from)?(?:[\s]*)("([^"\\]|\\.)+"|'([^'\\]|\\.)+')(?:[\s]*);?/,L=(e,t)=>{const n=[];let s=e.replace(/^[\s]+/,""),r=s.match(z);for(;null!==r;){const e=r[1].slice(1,-1),a=r[0].replace(/([\s]+)?;?$/,"").replace(e,new URL(e,t).toString());n.push(a),s=s.slice(r[0].length).replace(/^[\s]+/,""),r=s.match(z)}return[n.join(";"),s]},P=e=>{if(void 0!==e&&!Array.isArray(e))throw new TypeError("The parameterDescriptors property of given value for processorCtor is not an array.")},V=e=>{if(!(e=>{try{new new Proxy(e,B)}catch{return!1}return!0})(e))throw new TypeError("The given value for processorCtor should be a constructor.");if(null===e.prototype||"object"!=typeof e.prototype)throw new TypeError("The given value for processorCtor should have a prototype.")},W=(e,t)=>{const n=e.get(t);if(void 0===n)throw new Error("A value with the given key could not be found.");return n},U=(e,t)=>{const n=Array.from(e).filter(t);if(n.length>1)throw Error("More than one element was found.");if(0===n.length)throw Error("No element was found.");const[s]=n;return e.delete(s),s},G=(e,t,n,s)=>{const r=W(e,t),a=U(r,(e=>e[0]===n&&e[1]===s));return 0===r.size&&e.delete(t),a},q=e=>W(R,e),j=e=>{if(E.has(e))throw new Error("The AudioNode is already stored.");E.add(e),q(e).forEach((e=>e(!0)))},H=e=>"port"in e,$=e=>{if(!E.has(e))throw new Error("The AudioNode is not stored.");E.delete(e),q(e).forEach((e=>e(!1)))},K=(e,t)=>{!H(e)&&t.every((e=>0===e.size))&&$(e)},X={channelCount:2,channelCountMode:"max",channelInterpretation:"speakers",fftSize:2048,maxDecibels:-30,minDecibels:-100,smoothingTimeConstant:.8},Z=(e,t)=>e.context===t,Y=e=>{try{e.copyToChannel(new Float32Array(1),0,-1)}catch{return!1}return!0},Q=()=>new DOMException("","IndexSizeError"),J=e=>{var t;e.getChannelData=(t=e.getChannelData,n=>{try{return t.call(e,n)}catch(e){if(12===e.code)throw Q();throw e}})},ee={numberOfChannels:1},te=-34028234663852886e22,ne=-te,se=e=>E.has(e),re={buffer:null,channelCount:2,channelCountMode:"max",channelInterpretation:"speakers",loop:!1,loopEnd:0,loopStart:0,playbackRate:1},ae=e=>W(_,e),ie=e=>W(T,e),oe=(e,t)=>{const{activeInputs:n}=ae(e);n.forEach((n=>n.forEach((([n])=>{t.includes(e)||oe(n,[...t,e])}))));const s=(e=>"playbackRate"in e)(e)?[e.playbackRate]:H(e)?Array.from(e.parameters.values()):(e=>"frequency"in e&&"gain"in e)(e)?[e.Q,e.detune,e.frequency,e.gain]:(e=>"offset"in e)(e)?[e.offset]:(e=>!("frequency"in e)&&"gain"in e)(e)?[e.gain]:(e=>"detune"in e&&"frequency"in e)(e)?[e.detune,e.frequency]:(e=>"pan"in e)(e)?[e.pan]:[];for(const e of s){const n=ie(e);void 0!==n&&n.activeInputs.forEach((([e])=>oe(e,t)))}se(e)&&$(e)},le=e=>{oe(e.destination,[])},ue=e=>void 0===e||"number"==typeof e||"string"==typeof e&&("balanced"===e||"interactive"===e||"playback"===e),ce=e=>"context"in e,he=e=>ce(e[0]),de=(e,t,n,s)=>{for(const t of e)if(n(t)){if(s)return!1;throw Error("The set contains at least one similar element.")}return e.add(t),!0},pe=(e,t,[n,s],r)=>{de(e,[t,n,s],(e=>e[0]===t&&e[1]===n),r)},fe=(e,[t,n,s],r)=>{const a=e.get(t);void 0===a?e.set(t,new Set([[n,s]])):de(a,[n,s],(e=>e[0]===n),r)},me=e=>"inputs"in e,ge=(e,t,n,s)=>{if(me(t)){const r=t.inputs[s];return e.connect(r,n,0),[r,n,0]}return e.connect(t,n,s),[t,n,s]},ye=(e,t,n)=>{for(const s of e)if(s[0]===t&&s[1]===n)return e.delete(s),s;return null},be=(e,t)=>{if(!q(e).delete(t))throw new Error("Missing the expected event listener.")},we=(e,t,n)=>{const s=W(e,t),r=U(s,(e=>e[0]===n));return 0===s.size&&e.delete(t),r},ve=(e,t,n,s)=>{me(t)?e.disconnect(t.inputs[s],n,0):e.disconnect(t,n,s)},xe=e=>W(I,e),Ae=e=>W(N,e),ke=e=>D.has(e),Ce=e=>!E.has(e),Se=(e,t)=>new Promise((n=>{if(null!==t)n(!0);else{const t=e.createScriptProcessor(256,1,1),s=e.createGain(),r=e.createBuffer(1,2,44100),a=r.getChannelData(0);a[0]=1,a[1]=1;const i=e.createBufferSource();i.buffer=r,i.loop=!0,i.connect(t).connect(e.destination),i.connect(s),i.disconnect(s),t.onaudioprocess=s=>{const r=s.inputBuffer.getChannelData(0);Array.prototype.some.call(r,(e=>1===e))?n(!0):n(!1),i.stop(),t.onaudioprocess=null,i.disconnect(t),t.disconnect(e.destination)},i.start()}})),Ee=(e,t)=>{const n=new Map;for(const t of e)for(const e of t){const t=n.get(e);n.set(e,void 0===t?1:t+1)}n.forEach(((e,n)=>t(n,e)))},_e=e=>"context"in e,Ie=e=>{const t=new Map;e.connect=(e=>(n,s=0,r=0)=>{const a=_e(n)?e(n,s,r):e(n,s),i=t.get(n);return void 0===i?t.set(n,[{input:r,output:s}]):i.every((e=>e.input!==r||e.output!==s))&&i.push({input:r,output:s}),a})(e.connect.bind(e)),e.disconnect=(n=>(s,r,a)=>{if(n.apply(e),void 0===s)t.clear();else if("number"==typeof s)for(const[e,n]of t){const r=n.filter((e=>e.output!==s));0===r.length?t.delete(e):t.set(e,r)}else if(t.has(s))if(void 0===r)t.delete(s);else{const e=t.get(s);if(void 0!==e){const n=e.filter((e=>e.output!==r&&(e.input!==a||void 0===a)));0===n.length?t.delete(s):t.set(s,n)}}for(const[n,s]of t)s.forEach((t=>{_e(n)?e.connect(n,t.output,t.input):e.connect(n,t.output)}))})(e.disconnect)},Te=(e,t,n,s)=>{const{activeInputs:r,passiveInputs:a}=ie(t),{outputs:i}=ae(e),o=q(e),l=i=>{const o=xe(e),l=Ae(t);if(i){const t=we(a,e,n);pe(r,e,t,!1),s||ke(e)||o.connect(l,n)}else{const t=((e,t,n)=>U(e,(e=>e[0]===t&&e[1]===n)))(r,e,n);fe(a,t,!1),s||ke(e)||o.disconnect(l,n)}};return!!de(i,[t,n],(e=>e[0]===t&&e[1]===n),!0)&&(o.add(l),se(e)?pe(r,e,[n,l],!0):fe(a,[e,n,l],!0),!0)},Ne=(e,t,n,s,r)=>{const[a,i]=((e,t,n,s)=>{const{activeInputs:r,passiveInputs:a}=ae(t),i=ye(r[s],e,n);if(null===i)return[G(a,e,n,s)[2],!1];return[i[2],!0]})(e,n,s,r);if(null!==a&&(be(e,a),!i||t||ke(e)||ve(xe(e),xe(n),s,r)),se(n)){const{activeInputs:e}=ae(n);K(n,e)}},Oe=(e,t,n,s)=>{const[r,a]=((e,t,n)=>{const{activeInputs:s,passiveInputs:r}=ie(t),a=ye(s,e,n);if(null===a)return[we(r,e,n)[1],!1];return[a[2],!0]})(e,n,s);null!==r&&(be(e,r),!a||t||ke(e)||xe(e).disconnect(Ae(n),s))};class Re{constructor(e){this._map=new Map(e)}get size(){return this._map.size}entries(){return this._map.entries()}forEach(e,t=null){return this._map.forEach(((n,s)=>e.call(t,n,s,this)))}get(e){return this._map.get(e)}has(e){return this._map.has(e)}keys(){return this._map.keys()}values(){return this._map.values()}}const De={channelCount:2,channelCountMode:"explicit",channelInterpretation:"speakers",numberOfInputs:1,numberOfOutputs:1,parameterData:{},processorOptions:{}};function Me(e,t,n,s,r){if("function"==typeof e.copyFromChannel)0===t[n].byteLength&&(t[n]=new Float32Array(128)),e.copyFromChannel(t[n],s,r);else{const a=e.getChannelData(s);if(0===t[n].byteLength)t[n]=a.slice(r,r+128);else{const e=new Float32Array(a.buffer,r*Float32Array.BYTES_PER_ELEMENT,128);t[n].set(e)}}}const Fe=(e,t,n,s,r)=>{"function"==typeof e.copyToChannel?0!==t[n].byteLength&&e.copyToChannel(t[n],s,r):0!==t[n].byteLength&&e.getChannelData(s).set(t[n],r)},Be=(e,t)=>{const n=[];for(let s=0;s{const o=null===t?128*Math.ceil(e.context.length/128):t.length,l=s.channelCount*s.numberOfInputs,u=r.reduce(((e,t)=>e+t),0),c=0===u?null:n.createBuffer(u,o,n.sampleRate);if(void 0===a)throw new Error("Missing the processor constructor.");const h=ae(e),d=await((e,t)=>{const n=W(F,e),s=xe(t);return W(n,s)})(n,e),p=Be(s.numberOfInputs,s.channelCount),f=Be(s.numberOfOutputs,r),m=Array.from(e.parameters.keys()).reduce(((e,t)=>({...e,[t]:new Float32Array(128)})),{});for(let u=0;u0&&null!==t)for(let e=0;e{Me(t,m,e,l+n,u)}));for(let e=0;e0===h.activeInputs[t].size?[]:e)),t=i(u/n.sampleRate,n.sampleRate,(()=>d.process(e,f,m)));if(null!==c)for(let e=0,t=0;e{const{port1:t,port2:n}=new MessageChannel;return new Promise((s=>{const r=()=>{n.onmessage=null,t.close(),n.close(),s()};n.onmessage=()=>r();try{t.postMessage(e,[e])}catch{}finally{r()}}))},qe={channelCount:2,channelCountMode:"max",channelInterpretation:"speakers",delayTime:0,maxDelayTime:1},je=(e,t,n)=>{const s=t[n];if(void 0===s)throw e();return s},He={attack:.003,channelCount:2,channelCountMode:"clamped-max",channelInterpretation:"speakers",knee:30,ratio:12,release:.25,threshold:-24},$e={channelCount:2,channelCountMode:"max",channelInterpretation:"speakers",gain:1},Ke=()=>new DOMException("","InvalidStateError"),Xe=()=>new DOMException("","InvalidAccessError"),Ze={channelCount:2,channelCountMode:"max",channelInterpretation:"speakers"},Ye=(e,t,n,s,r,a,i,o,l,u,c)=>{const h=u.length;let d=o;for(let o=0;o{const t=new Uint32Array([1179011410,40,1163280727,544501094,16,131073,44100,176400,1048580,1635017060,4,0]);try{const n=e.decodeAudioData(t.buffer,(()=>{}));return void 0!==n&&(n.catch((()=>{})),!0)}catch{}return!1},et={numberOfChannels:1},tt=(e,t,n)=>{const s=t[n];void 0!==s&&s!==e[n]&&(e[n]=s)},nt=(e,t)=>{tt(e,t,"channelCount"),tt(e,t,"channelCountMode"),tt(e,t,"channelInterpretation")},st=e=>"function"==typeof e.getFloatTimeDomainData,rt=(e,t,n)=>{const s=t[n];void 0!==s&&s!==e[n].value&&(e[n].value=s)},at=e=>{e.start=(t=>(n=0,s=0,r)=>{if("number"==typeof r&&r<0||s<0||n<0)throw new RangeError("The parameters can't be negative.");t.call(e,n,s,r)})(e.start)},it=e=>{var t;e.stop=(t=e.stop,(n=0)=>{if(n<0)throw new RangeError("The parameter can't be negative.");t.call(e,n)})},ot=(e,t)=>null===e?512:Math.max(512,Math.min(16384,Math.pow(2,Math.round(Math.log2(e*t))))),lt=async(e,t)=>{const n=await(e=>new Promise(((t,n)=>{const{port1:s,port2:r}=new MessageChannel;s.onmessage=({data:e})=>{s.close(),r.close(),t(e)},s.onmessageerror=({data:e})=>{s.close(),r.close(),n(e)},r.postMessage(e)})))(t);return new e(n)},ut=(e,t)=>{const n=e.createBiquadFilter();return nt(n,t),rt(n,t,"Q"),rt(n,t,"detune"),rt(n,t,"frequency"),rt(n,t,"gain"),tt(n,t,"type"),n},ct=(e,t)=>{const n=e.createChannelSplitter(t.numberOfOutputs);return nt(n,t),(e=>{const t=e.numberOfOutputs;Object.defineProperty(e,"channelCount",{get:()=>t,set:e=>{if(e!==t)throw Ke()}}),Object.defineProperty(e,"channelCountMode",{get:()=>"explicit",set:e=>{if("explicit"!==e)throw Ke()}}),Object.defineProperty(e,"channelInterpretation",{get:()=>"discrete",set:e=>{if("discrete"!==e)throw Ke()}})})(n),n},ht=(e,t)=>(e.connect=t.connect.bind(t),e.disconnect=t.disconnect.bind(t),e),dt=(e,t)=>{const n=e.createDelay(t.maxDelayTime);return nt(n,t),rt(n,t,"delayTime"),n},pt=(e,t)=>{const n=e.createGain();return nt(n,t),rt(n,t,"gain"),n};function ft(e,t){const n=t[0]*t[0]+t[1]*t[1];return[(e[0]*t[0]+e[1]*t[1])/n,(e[1]*t[0]-e[0]*t[1])/n]}function mt(e,t){let n=[0,0];for(let a=e.length-1;a>=0;a-=1)r=t,n=[(s=n)[0]*r[0]-s[1]*r[1],s[0]*r[1]+s[1]*r[0]],n[0]+=e[a];var s,r;return n}const gt=(e,t,n,s)=>e.createScriptProcessor(t,n,s),yt=()=>new DOMException("","NotSupportedError"),bt={numberOfChannels:1},wt={channelCount:2,channelCountMode:"max",channelInterpretation:"speakers",detune:0,frequency:440,periodicWave:void 0,type:"sine"},vt={channelCount:2,channelCountMode:"clamped-max",channelInterpretation:"speakers",coneInnerAngle:360,coneOuterAngle:360,coneOuterGain:0,distanceModel:"inverse",maxDistance:1e4,orientationX:1,orientationY:0,orientationZ:0,panningModel:"equalpower",positionX:0,positionY:0,positionZ:0,refDistance:1,rolloffFactor:1},xt={disableNormalization:!1},At={channelCount:2,channelCountMode:"explicit",channelInterpretation:"speakers",pan:0},kt=()=>new DOMException("","UnknownError"),Ct={channelCount:2,channelCountMode:"max",channelInterpretation:"speakers",curve:null,oversample:"none"},St=(e,t,n)=>void 0===e.copyFromChannel?e.getChannelData(n)[0]:(e.copyFromChannel(t,n),t[0]),Et=e=>{if(null===e)return!1;const t=e.length;return t%2!=0?0!==e[Math.floor(t/2)]:e[t/2-1]+e[t/2]!==0},_t=(e,t,n,s)=>{let r=e;for(;!r.hasOwnProperty(t);)r=Object.getPrototypeOf(r);const{get:a,set:i}=Object.getOwnPropertyDescriptor(r,t);Object.defineProperty(e,t,{get:n(a),set:s(i)})},It=(e,t,n)=>{try{e.setValueAtTime(t,n)}catch(s){if(9!==s.code)throw s;It(e,t,n+1e-7)}},Tt=e=>{const t=e.createOscillator();try{t.start(-1)}catch(e){return e instanceof RangeError}return!1},Nt=e=>{const t=e.createBuffer(1,1,44100),n=e.createBufferSource();n.buffer=t,n.start(),n.stop();try{return n.stop(),!0}catch{return!1}},Ot=e=>{const t=e.createOscillator();try{t.stop(-1)}catch(e){return e instanceof RangeError}return!1},Rt=()=>{try{new DOMException}catch{return!1}return!0},Dt=()=>new Promise((e=>{const t=new ArrayBuffer(0),{port1:n,port2:s}=new MessageChannel;n.onmessage=({data:t})=>e(null!==t),s.postMessage(t,[t])})),Mt=(e,t)=>{const n=t.createGain();e.connect(n);const s=(t=>()=>{t.call(e,n),e.removeEventListener("ended",s)})(e.disconnect);e.addEventListener("ended",s),ht(e,n),e.stop=(t=>{let s=!1;return(r=0)=>{if(s)try{t.call(e,r)}catch{n.gain.setValueAtTime(0,r)}else t.call(e,r),s=!0}})(e.stop)},Ft=(e,t)=>n=>{const s={value:e};return Object.defineProperties(n,{currentTarget:s,target:s}),"function"==typeof t?t.call(e,n):t.handleEvent.call(e,n)},Bt=(e=>(t,n,[s,r,a],i)=>{e(t[r],[n,s,a],(e=>e[0]===n&&e[1]===s),i)})(de),zt=(e=>(t,n,[s,r,a],i)=>{const o=t.get(s);void 0===o?t.set(s,new Set([[r,n,a]])):e(o,[r,n,a],(e=>e[0]===r&&e[1]===n),i)})(de),Lt=(e=>(t,n,s,r)=>e(t[r],(e=>e[0]===n&&e[1]===s)))(U),Pt=new WeakMap,Vt=(e=>t=>{var n;return null!==(n=e.get(t))&&void 0!==n?n:0})(Pt),Wt=(Ut=new Map,Gt=new WeakMap,(e,t)=>{const n=Gt.get(e);if(void 0!==n)return n;const s=Ut.get(e);if(void 0!==s)return s;try{const n=t();return n instanceof Promise?(Ut.set(e,n),n.catch((()=>!1)).then((t=>(Ut.delete(e),Gt.set(e,t),t)))):(Gt.set(e,n),n)}catch{return Gt.set(e,!1),!1}});var Ut,Gt;const qt="undefined"==typeof window?null:window,jt=((e,t)=>(n,s)=>{const r=n.createAnalyser();if(nt(r,s),!(s.maxDecibels>s.minDecibels))throw t();return tt(r,s,"fftSize"),tt(r,s,"maxDecibels"),tt(r,s,"minDecibels"),tt(r,s,"smoothingTimeConstant"),e(st,(()=>st(r)))||(e=>{e.getFloatTimeDomainData=t=>{const n=new Uint8Array(t.length);e.getByteTimeDomainData(n);const s=Math.max(n.length,e.fftSize);for(let e=0;et=>{const n=e(t);if(null===n.renderer)throw new Error("Missing the renderer of the given AudioNode in the audio graph.");return n.renderer})(ae),$t=((e,t,n)=>async(s,r,a)=>{const i=e(s);await Promise.all(i.activeInputs.map(((e,i)=>Array.from(e).map((async([e,o])=>{const l=t(e),u=await l.render(e,r),c=s.context.destination;n(e)||s===c&&n(s)||u.connect(a,o,i)})))).reduce(((e,t)=>[...e,...t]),[]))})(ae,Ht,ke),Kt=((e,t,n)=>()=>{const s=new WeakMap;return{render(r,a){const i=s.get(a);return void 0!==i?Promise.resolve(i):(async(r,a)=>{let i=t(r);if(!Z(i,a)){const t={channelCount:i.channelCount,channelCountMode:i.channelCountMode,channelInterpretation:i.channelInterpretation,fftSize:i.fftSize,maxDecibels:i.maxDecibels,minDecibels:i.minDecibels,smoothingTimeConstant:i.smoothingTimeConstant};i=e(a,t)}return s.set(a,i),await n(r,a,i),i})(r,a)}}})(jt,xe,$t),Xt=(Zt=O,e=>{const t=Zt.get(e);if(void 0===t)throw Ke();return t});var Zt;const Yt=(e=>null===e?null:e.hasOwnProperty("OfflineAudioContext")?e.OfflineAudioContext:e.hasOwnProperty("webkitOfflineAudioContext")?e.webkitOfflineAudioContext:null)(qt),Qt=(e=>t=>null!==e&&t instanceof e)(Yt),Jt=new WeakMap,en=(e=>class{constructor(e){this._nativeEventTarget=e,this._listeners=new WeakMap}addEventListener(t,n,s){if(null!==n){let r=this._listeners.get(n);void 0===r&&(r=e(this,n),"function"==typeof n&&this._listeners.set(n,r)),this._nativeEventTarget.addEventListener(t,r,s)}}dispatchEvent(e){return this._nativeEventTarget.dispatchEvent(e)}removeEventListener(e,t,n){const s=null===t?void 0:this._listeners.get(t);this._nativeEventTarget.removeEventListener(e,void 0===s?null:s,n)}})(Ft),tn=(e=>null===e?null:e.hasOwnProperty("AudioContext")?e.AudioContext:e.hasOwnProperty("webkitAudioContext")?e.webkitAudioContext:null)(qt),nn=(e=>t=>null!==e&&t instanceof e)(tn),sn=(e=>t=>null!==e&&"function"==typeof e.AudioNode&&t instanceof e.AudioNode)(qt),rn=(e=>t=>null!==e&&"function"==typeof e.AudioParam&&t instanceof e.AudioParam)(qt),an=(e=>null===e?null:e.hasOwnProperty("AudioWorkletNode")?e.AudioWorkletNode:null)(qt),on=((e,t,n,s,r,a,i,o,l,u,c,h,d,p,f,m)=>class extends u{constructor(t,s,r,a){super(r),this._context=t,this._nativeAudioNode=r;const i=c(t);h(i)&&!0!==n(Se,(()=>Se(i,m)))&&Ie(r),I.set(this,r),R.set(this,new Set),"closed"!==t.state&&s&&j(this),e(this,a,r)}get channelCount(){return this._nativeAudioNode.channelCount}set channelCount(e){this._nativeAudioNode.channelCount=e}get channelCountMode(){return this._nativeAudioNode.channelCountMode}set channelCountMode(e){this._nativeAudioNode.channelCountMode=e}get channelInterpretation(){return this._nativeAudioNode.channelInterpretation}set channelInterpretation(e){this._nativeAudioNode.channelInterpretation=e}get context(){return this._context}get numberOfInputs(){return this._nativeAudioNode.numberOfInputs}get numberOfOutputs(){return this._nativeAudioNode.numberOfOutputs}connect(e,n=0,o=0){if(n<0||n>=this._nativeAudioNode.numberOfOutputs)throw r();const u=c(this._context),h=f(u);if(d(e)||p(e))throw a();if(ce(e)){const r=xe(e);try{const t=ge(this._nativeAudioNode,r,n,o),s=Ce(this);(h||s)&&this._nativeAudioNode.disconnect(...t),"closed"!==this.context.state&&!s&&Ce(e)&&j(e)}catch(e){if(12===e.code)throw a();throw e}if(t(this,e,n,o,h)){const t=l([this],e);Ee(t,s(h))}return e}const m=Ae(e);if("playbackRate"===m.name&&1024===m.maxValue)throw i();try{this._nativeAudioNode.connect(m,n),(h||Ce(this))&&this._nativeAudioNode.disconnect(m,n)}catch(e){if(12===e.code)throw a();throw e}if(Te(this,e,n,h)){const t=l([this],e);Ee(t,s(h))}}disconnect(e,t,n){let s;const i=c(this._context),u=f(i);if(void 0===e)s=((e,t)=>{const n=ae(e),s=[];for(const r of n.outputs)he(r)?Ne(e,t,...r):Oe(e,t,...r),s.push(r[0]);return n.outputs.clear(),s})(this,u);else if("number"==typeof e){if(e<0||e>=this.numberOfOutputs)throw r();s=((e,t,n)=>{const s=ae(e),r=[];for(const a of s.outputs)a[1]===n&&(he(a)?Ne(e,t,...a):Oe(e,t,...a),r.push(a[0]),s.outputs.delete(a));return r})(this,u,e)}else{if(void 0!==t&&(t<0||t>=this.numberOfOutputs))throw r();if(ce(e)&&void 0!==n&&(n<0||n>=e.numberOfInputs))throw r();if(s=((e,t,n,s,r)=>{const a=ae(e);return Array.from(a.outputs).filter((e=>!(e[0]!==n||void 0!==s&&e[1]!==s||void 0!==r&&e[2]!==r))).map((n=>(he(n)?Ne(e,t,...n):Oe(e,t,...n),a.outputs.delete(n),n[0])))})(this,u,e,t,n),0===s.length)throw a()}for(const e of s){const t=l([this],e);Ee(t,o)}}})((ln=_,(e,t,n)=>{const s=[];for(let e=0;e{const p=new WeakMap;return(f,m,g,y,b)=>{const{activeInputs:w,passiveInputs:v}=a(m),{outputs:x}=a(f),A=o(f),k=a=>{const o=l(m),u=l(f);if(a){const t=G(v,f,g,y);e(w,f,t,!1),b||h(f)||n(u,o,g,y),d(m)&&j(m)}else{const e=s(w,f,g,y);t(v,y,e,!1),b||h(f)||r(u,o,g,y);const n=i(m);if(0===n)c(m)&&K(m,w);else{const e=p.get(m);void 0!==e&&clearTimeout(e),p.set(m,setTimeout((()=>{c(m)&&K(m,w)}),1e3*n))}}};return!!u(x,[m,g,y],(e=>e[0]===m&&e[1]===g&&e[2]===y),!0)&&(A.add(k),c(f)?e(w,f,[g,y,k],!0):t(v,y,[f,g,k],!0),!0)}})(Bt,zt,ge,Lt,ve,ae,Vt,q,xe,de,se,ke,Ce),Wt,((e,t,n,s,r,a)=>i=>(o,l)=>{const u=e.get(o);if(void 0===u){if(!i&&a(o)){const e=s(o),{outputs:a}=n(o);for(const n of a)if(he(n)){const r=s(n[0]);t(e,r,n[1],n[2])}else{const t=r(n[0]);e.disconnect(t,n[1])}}e.set(o,l)}else e.set(o,u+l)})(D,ve,ae,xe,Ae,se),Q,Xe,yt,((e,t,n,s,r,a,i,o)=>(l,u)=>{const c=t.get(l);if(void 0===c)throw new Error("Missing the expected cycle count.");const h=a(l.context),d=o(h);if(c===u){if(t.delete(l),!d&&i(l)){const t=s(l),{outputs:a}=n(l);for(const n of a)if(he(n)){const r=s(n[0]);e(t,r,n[1],n[2])}else{const e=r(n[0]);t.connect(e,n[1])}}}else t.set(l,c-u)})(ge,D,ae,xe,Ae,Xt,se,Qt),((e,t,n)=>function s(r,a){const i=ce(a)?a:n(e,a);if((e=>"delayTime"in e)(i))return[];if(r[0]===i)return[r];if(r.includes(i))return[];const{outputs:o}=t(i);return Array.from(o).map((e=>s([...r,i],e[0]))).reduce(((e,t)=>e.concat(t)),[])})(Jt,ae,W),en,Xt,nn,sn,rn,Qt,an);var ln;const un=((e,t,n,s,r,a)=>class extends e{constructor(e,n){const i=r(e),o={...X,...n},l=s(i,o);super(e,!1,l,a(i)?t():null),this._nativeAnalyserNode=l}get fftSize(){return this._nativeAnalyserNode.fftSize}set fftSize(e){this._nativeAnalyserNode.fftSize=e}get frequencyBinCount(){return this._nativeAnalyserNode.frequencyBinCount}get maxDecibels(){return this._nativeAnalyserNode.maxDecibels}set maxDecibels(e){const t=this._nativeAnalyserNode.maxDecibels;if(this._nativeAnalyserNode.maxDecibels=e,!(e>this._nativeAnalyserNode.minDecibels))throw this._nativeAnalyserNode.maxDecibels=t,n()}get minDecibels(){return this._nativeAnalyserNode.minDecibels}set minDecibels(e){const t=this._nativeAnalyserNode.minDecibels;if(this._nativeAnalyserNode.minDecibels=e,!(this._nativeAnalyserNode.maxDecibels>e))throw this._nativeAnalyserNode.minDecibels=t,n()}get smoothingTimeConstant(){return this._nativeAnalyserNode.smoothingTimeConstant}set smoothingTimeConstant(e){this._nativeAnalyserNode.smoothingTimeConstant=e}getByteFrequencyData(e){this._nativeAnalyserNode.getByteFrequencyData(e)}getByteTimeDomainData(e){this._nativeAnalyserNode.getByteTimeDomainData(e)}getFloatFrequencyData(e){this._nativeAnalyserNode.getFloatFrequencyData(e)}getFloatTimeDomainData(e){this._nativeAnalyserNode.getFloatTimeDomainData(e)}})(on,Kt,Q,jt,Xt,Qt),cn=new WeakSet,hn=(e=>null===e?null:e.hasOwnProperty("AudioBuffer")?e.AudioBuffer:null)(qt),dn=(pn=new Uint32Array(1),e=>(pn[0]=e,pn[0]));var pn;const fn=((e,t)=>n=>{n.copyFromChannel=(s,r,a=0)=>{const i=e(a),o=e(r);if(o>=n.numberOfChannels)throw t();const l=n.length,u=n.getChannelData(o),c=s.length;for(let e=i<0?-i:0;e+i{const i=e(a),o=e(r);if(o>=n.numberOfChannels)throw t();const l=n.length,u=n.getChannelData(o),c=s.length;for(let e=i<0?-i:0;e+it=>{t.copyFromChannel=(n=>(s,r,a=0)=>{const i=e(a),o=e(r);if(i(s,r,a=0)=>{const i=e(a),o=e(r);if(i{let l=null;return class u{constructor(u){if(null===r)throw new Error("Missing the native OfflineAudioContext constructor.");const{length:c,numberOfChannels:h,sampleRate:d}={...ee,...u};null===l&&(l=new r(1,1,44100));const p=null!==s&&t(a,a)?new s({length:c,numberOfChannels:h,sampleRate:d}):l.createBuffer(h,c,d);if(0===p.numberOfChannels)throw n();return"function"!=typeof p.copyFromChannel?(i(p),J(p)):t(Y,(()=>Y(p)))||o(p),e.add(p),p}static[Symbol.hasInstance](t){return null!==t&&"object"==typeof t&&Object.getPrototypeOf(t)===u.prototype||e.has(t)}}})(cn,Wt,yt,hn,Yt,(e=>()=>{if(null===e)return!1;try{new e({length:1,sampleRate:44100})}catch{return!1}return!0})(hn),fn,mn),yn=(e=>(t,n)=>{const s=e(t,{channelCount:1,channelCountMode:"explicit",channelInterpretation:"discrete",gain:0});n.connect(s).connect(t.destination);const r=()=>{n.removeEventListener("ended",r),n.disconnect(s),s.disconnect()};n.addEventListener("ended",r)})(pt),bn=((e,t,n)=>async(s,r,a)=>{const i=t(s);await Promise.all(Array.from(i.activeInputs).map((async([t,s])=>{const i=e(t),o=await i.render(t,r);n(t)||o.connect(a,s)})))})(Ht,ie,ke),wn=(e=>(t,n,s)=>e(n,t,s))(bn),vn=((e,t,n,s,r,a,i,o,l,u,c)=>(h,d)=>{const p=h.createBufferSource();return nt(p,d),rt(p,d,"playbackRate"),tt(p,d,"buffer"),tt(p,d,"loop"),tt(p,d,"loopEnd"),tt(p,d,"loopStart"),t(n,(()=>n(h)))||(e=>{e.start=(t=>{let n=!1;return(s=0,r=0,a)=>{if(n)throw Ke();t.call(e,s,r,a),n=!0}})(e.start)})(p),t(s,(()=>s(h)))||l(p),t(r,(()=>r(h)))||u(p,h),t(a,(()=>a(h)))||at(p),t(i,(()=>i(h)))||c(p,h),t(o,(()=>o(h)))||it(p),e(h,p),p})(yn,Wt,(e=>{const t=e.createBufferSource();t.start();try{t.start()}catch{return!0}return!1}),(e=>{const t=e.createBufferSource(),n=e.createBuffer(1,1,44100);t.buffer=n;try{t.start(0,1)}catch{return!1}return!0}),(e=>{const t=e.createBufferSource();t.start();try{t.stop()}catch{return!1}return!0}),Tt,Nt,Ot,(e=>{e.start=(t=>(n=0,s=0,r)=>{const a=e.buffer,i=null===a?s:Math.min(a.duration,s);null!==a&&i>a.duration-.5/e.context.sampleRate?t.call(e,n,0,0):t.call(e,n,i,r)})(e.start)}),(e=>(t,n)=>{const s=n.createBuffer(1,1,44100);null===t.buffer&&(t.buffer=s),e(t,"buffer",(e=>()=>{const n=e.call(t);return n===s?null:n}),(e=>n=>e.call(t,null===n?s:n)))})(_t),Mt),xn=((e,t)=>(n,s,r)=>(e(s).replay(r),t(s,n,r)))((e=>t=>{const n=e(t);if(null===n.renderer)throw new Error("Missing the renderer of the given AudioParam in the audio graph.");return n.renderer})(ie),bn),An=((e,t,n,s,r)=>()=>{const a=new WeakMap;let i=null,o=null;return{set start(e){i=e},set stop(e){o=e},render(l,u){const c=a.get(u);return void 0!==c?Promise.resolve(c):(async(l,u)=>{let c=n(l);const h=Z(c,u);if(!h){const e={buffer:c.buffer,channelCount:c.channelCount,channelCountMode:c.channelCountMode,channelInterpretation:c.channelInterpretation,loop:c.loop,loopEnd:c.loopEnd,loopStart:c.loopStart,playbackRate:c.playbackRate.value};c=t(u,e),null!==i&&c.start(...i),null!==o&&c.stop(o)}return a.set(u,c),h?await e(u,l.playbackRate,c.playbackRate):await s(u,l.playbackRate,c.playbackRate),await r(l,u,c),c})(l,u)}}})(wn,vn,xe,xn,$t),kn=((e,t,n,s,r,a,i,o,l,u,c,h,d)=>(p,f,m,g=null,y=null)=>{const b=m.value,w=new S(b),v=f?s(w):null,x={get defaultValue(){return b},get maxValue(){return null===g?m.maxValue:g},get minValue(){return null===y?m.minValue:y},get value(){return m.value},set value(e){m.value=e,x.setValueAtTime(e,p.context.currentTime)},cancelAndHoldAtTime(e){if("function"==typeof m.cancelAndHoldAtTime)null===v&&w.flush(p.context.currentTime),w.add(r(e)),m.cancelAndHoldAtTime(e);else{const t=Array.from(w).pop();null===v&&w.flush(p.context.currentTime),w.add(r(e));const n=Array.from(w).pop();m.cancelScheduledValues(e),t!==n&&void 0!==n&&("exponentialRampToValue"===n.type?m.exponentialRampToValueAtTime(n.value,n.endTime):"linearRampToValue"===n.type?m.linearRampToValueAtTime(n.value,n.endTime):"setValue"===n.type?m.setValueAtTime(n.value,n.startTime):"setValueCurve"===n.type&&m.setValueCurveAtTime(n.values,n.startTime,n.duration))}return x},cancelScheduledValues:e=>(null===v&&w.flush(p.context.currentTime),w.add(a(e)),m.cancelScheduledValues(e),x),exponentialRampToValueAtTime(e,t){if(0===e)throw new RangeError;if(!Number.isFinite(t)||t<0)throw new RangeError;const n=p.context.currentTime;return null===v&&w.flush(n),0===Array.from(w).length&&(w.add(u(b,n)),m.setValueAtTime(b,n)),w.add(i(e,t)),m.exponentialRampToValueAtTime(e,t),x},linearRampToValueAtTime(e,t){const n=p.context.currentTime;return null===v&&w.flush(n),0===Array.from(w).length&&(w.add(u(b,n)),m.setValueAtTime(b,n)),w.add(o(e,t)),m.linearRampToValueAtTime(e,t),x},setTargetAtTime:(e,t,n)=>(null===v&&w.flush(p.context.currentTime),w.add(l(e,t,n)),m.setTargetAtTime(e,t,n),x),setValueAtTime:(e,t)=>(null===v&&w.flush(p.context.currentTime),w.add(u(e,t)),m.setValueAtTime(e,t),x),setValueCurveAtTime(e,t,n){const s=e instanceof Float32Array?e:new Float32Array(e);if(null!==h&&"webkitAudioContext"===h.name){const e=t+n,r=p.context.sampleRate,a=Math.ceil(t*r),i=Math.floor(e*r),o=i-a,l=new Float32Array(o);for(let e=0;e{Cn.set(e,{activeInputs:new Set,passiveInputs:new WeakMap,renderer:t})}),Jt,N,(e=>({replay(t){for(const n of e)if("exponentialRampToValue"===n.type){const{endTime:e,value:s}=n;t.exponentialRampToValueAtTime(s,e)}else if("linearRampToValue"===n.type){const{endTime:e,value:s}=n;t.linearRampToValueAtTime(s,e)}else if("setTarget"===n.type){const{startTime:e,target:s,timeConstant:r}=n;t.setTargetAtTime(s,e,r)}else if("setValue"===n.type){const{startTime:e,value:s}=n;t.setValueAtTime(s,e)}else{if("setValueCurve"!==n.type)throw new Error("Can't apply an unknown automation.");{const{duration:e,startTime:s,values:r}=n;t.setValueCurveAtTime(r,s,e)}}}})),(e=>({cancelTime:e,type:"cancelAndHold"})),(e=>({cancelTime:e,type:"cancelScheduledValues"})),((e,t)=>({endTime:t,type:"exponentialRampToValue",value:e})),((e,t)=>({endTime:t,type:"linearRampToValue",value:e})),((e,t,n)=>({startTime:t,target:e,timeConstant:n,type:"setTarget"})),l,u,tn,It);var Cn;const Sn=((e,t,n,s,r,a,i,o)=>class extends e{constructor(e,s){const o=a(e),l={...re,...s},u=r(o,l),c=i(o),h=c?t():null;super(e,!1,u,h),this._audioBufferSourceNodeRenderer=h,this._isBufferNullified=!1,this._isBufferSet=null!==l.buffer,this._nativeAudioBufferSourceNode=u,this._onended=null,this._playbackRate=n(this,c,u.playbackRate,ne,te)}get buffer(){return this._isBufferNullified?null:this._nativeAudioBufferSourceNode.buffer}set buffer(e){if(this._nativeAudioBufferSourceNode.buffer=e,null!==e){if(this._isBufferSet)throw s();this._isBufferSet=!0}}get loop(){return this._nativeAudioBufferSourceNode.loop}set loop(e){this._nativeAudioBufferSourceNode.loop=e}get loopEnd(){return this._nativeAudioBufferSourceNode.loopEnd}set loopEnd(e){this._nativeAudioBufferSourceNode.loopEnd=e}get loopStart(){return this._nativeAudioBufferSourceNode.loopStart}set loopStart(e){this._nativeAudioBufferSourceNode.loopStart=e}get onended(){return this._onended}set onended(e){const t="function"==typeof e?o(this,e):null;this._nativeAudioBufferSourceNode.onended=t;const n=this._nativeAudioBufferSourceNode.onended;this._onended=null!==n&&n===t?e:n}get playbackRate(){return this._playbackRate}start(e=0,t=0,n){if(this._nativeAudioBufferSourceNode.start(e,t,n),null!==this._audioBufferSourceNodeRenderer&&(this._audioBufferSourceNodeRenderer.start=void 0===n?[e,t]:[e,t,n]),"closed"!==this.context.state){j(this);const e=()=>{this._nativeAudioBufferSourceNode.removeEventListener("ended",e),se(this)&&$(this)};this._nativeAudioBufferSourceNode.addEventListener("ended",e)}}stop(e=0){this._nativeAudioBufferSourceNode.stop(e),null!==this._audioBufferSourceNodeRenderer&&(this._audioBufferSourceNodeRenderer.stop=e)}})(on,An,kn,Ke,vn,Xt,Qt,Ft),En=((e,t,n,s,r,a,i,o)=>class extends e{constructor(e,n){const s=a(e),l=i(s),u=r(s,n,l);super(e,!1,u,l?t(o):null),this._isNodeOfNativeOfflineAudioContext=l,this._nativeAudioDestinationNode=u}get channelCount(){return this._nativeAudioDestinationNode.channelCount}set channelCount(e){if(this._isNodeOfNativeOfflineAudioContext)throw s();if(e>this._nativeAudioDestinationNode.maxChannelCount)throw n();this._nativeAudioDestinationNode.channelCount=e}get channelCountMode(){return this._nativeAudioDestinationNode.channelCountMode}set channelCountMode(e){if(this._isNodeOfNativeOfflineAudioContext)throw s();this._nativeAudioDestinationNode.channelCountMode=e}get maxChannelCount(){return this._nativeAudioDestinationNode.maxChannelCount}})(on,(e=>{const t=new WeakMap;return{render(n,s){const r=t.get(s);return void 0!==r?Promise.resolve(r):(async(n,s)=>{const r=s.destination;return t.set(s,r),await e(n,s,r),r})(n,s)}}}),Q,Ke,((e,t)=>(n,s,r)=>{const a=n.destination;if(a.channelCount!==s)try{a.channelCount=s}catch{}r&&"explicit"!==a.channelCountMode&&(a.channelCountMode="explicit"),0===a.maxChannelCount&&Object.defineProperty(a,"maxChannelCount",{value:s});const i=e(n,{channelCount:s,channelCountMode:a.channelCountMode,channelInterpretation:a.channelInterpretation,gain:1});return t(i,"channelCount",(e=>()=>e.call(i)),(e=>t=>{e.call(i,t);try{a.channelCount=t}catch(e){if(t>a.maxChannelCount)throw e}})),t(i,"channelCountMode",(e=>()=>e.call(i)),(e=>t=>{e.call(i,t),a.channelCountMode=t})),t(i,"channelInterpretation",(e=>()=>e.call(i)),(e=>t=>{e.call(i,t),a.channelInterpretation=t})),Object.defineProperty(i,"maxChannelCount",{get:()=>a.maxChannelCount}),i.connect(a),i})(pt,_t),Xt,Qt,$t),_n=((e,t,n,s,r)=>()=>{const a=new WeakMap;return{render(i,o){const l=a.get(o);return void 0!==l?Promise.resolve(l):(async(i,o)=>{let l=n(i);const u=Z(l,o);if(!u){const e={Q:l.Q.value,channelCount:l.channelCount,channelCountMode:l.channelCountMode,channelInterpretation:l.channelInterpretation,detune:l.detune.value,frequency:l.frequency.value,gain:l.gain.value,type:l.type};l=t(o,e)}return a.set(o,l),u?(await e(o,i.Q,l.Q),await e(o,i.detune,l.detune),await e(o,i.frequency,l.frequency),await e(o,i.gain,l.gain)):(await s(o,i.Q,l.Q),await s(o,i.detune,l.detune),await s(o,i.frequency,l.frequency),await s(o,i.gain,l.gain)),await r(i,o,l),l})(i,o)}}})(wn,ut,xe,xn,$t),In=(e=>(t,n)=>e.set(t,n))(Pt),Tn=((e,t,n,s,r,a,i,o)=>class extends e{constructor(e,s){const l=a(e),u={...Le,...s},c=r(l,u),h=i(l);super(e,!1,c,h?n():null),this._Q=t(this,h,c.Q,ne,te),this._detune=t(this,h,c.detune,1200*Math.log2(ne),-1200*Math.log2(ne)),this._frequency=t(this,h,c.frequency,e.sampleRate/2,0),this._gain=t(this,h,c.gain,40*Math.log10(ne),te),this._nativeBiquadFilterNode=c,o(this,1)}get detune(){return this._detune}get frequency(){return this._frequency}get gain(){return this._gain}get Q(){return this._Q}get type(){return this._nativeBiquadFilterNode.type}set type(e){this._nativeBiquadFilterNode.type=e}getFrequencyResponse(e,t,n){try{this._nativeBiquadFilterNode.getFrequencyResponse(e,t,n)}catch(e){if(11===e.code)throw s();throw e}if(e.length!==t.length||t.length!==n.length)throw s()}})(on,kn,_n,Xe,ut,Xt,Qt,In),Nn=((e,t)=>(n,s,r)=>{const a=new Set;return n.connect=(r=>(i,o=0,l=0)=>{const u=0===a.size;if(t(i))return r.call(n,i,o,l),e(a,[i,o,l],(e=>e[0]===i&&e[1]===o&&e[2]===l),!0),u&&s(),i;r.call(n,i,o),e(a,[i,o],(e=>e[0]===i&&e[1]===o),!0),u&&s()})(n.connect),n.disconnect=(e=>(s,i,o)=>{const l=a.size>0;if(void 0===s)e.apply(n),a.clear();else if("number"==typeof s){e.call(n,s);for(const e of a)e[1]===s&&a.delete(e)}else{t(s)?e.call(n,s,i,o):e.call(n,s,i);for(const e of a)e[0]!==s||void 0!==i&&e[1]!==i||void 0!==o&&e[2]!==o||a.delete(e)}const u=0===a.size;l&&u&&r()})(n.disconnect),n})(de,sn),On=((e,t)=>(n,s)=>{s.channelCount=1,s.channelCountMode="explicit",Object.defineProperty(s,"channelCount",{get:()=>1,set:()=>{throw e()}}),Object.defineProperty(s,"channelCountMode",{get:()=>"explicit",set:()=>{throw e()}});const r=n.createBufferSource();t(s,(()=>{const e=s.numberOfInputs;for(let t=0;tr.disconnect(s)))})(Ke,Nn),Rn=((e,t)=>(n,s)=>{const r=n.createChannelMerger(s.numberOfInputs);return null!==e&&"webkitAudioContext"===e.name&&t(n,r),nt(r,s),r})(tn,On),Dn=((e,t,n)=>()=>{const s=new WeakMap;return{render(r,a){const i=s.get(a);return void 0!==i?Promise.resolve(i):(async(r,a)=>{let i=t(r);if(!Z(i,a)){const t={channelCount:i.channelCount,channelCountMode:i.channelCountMode,channelInterpretation:i.channelInterpretation,numberOfInputs:i.numberOfInputs};i=e(a,t)}return s.set(a,i),await n(r,a,i),i})(r,a)}}})(Rn,xe,$t),Mn=((e,t,n,s,r)=>class extends e{constructor(e,a){const i=s(e),o={...Pe,...a};super(e,!1,n(i,o),r(i)?t():null)}})(on,Dn,Rn,Xt,Qt),Fn=((e,t,n)=>()=>{const s=new WeakMap;return{render(r,a){const i=s.get(a);return void 0!==i?Promise.resolve(i):(async(r,a)=>{let i=t(r);if(!Z(i,a)){const t={channelCount:i.channelCount,channelCountMode:i.channelCountMode,channelInterpretation:i.channelInterpretation,numberOfOutputs:i.numberOfOutputs};i=e(a,t)}return s.set(a,i),await n(r,a,i),i})(r,a)}}})(ct,xe,$t),Bn=((e,t,n,s,r,a)=>class extends e{constructor(e,i){const o=s(e),l=a({...Ve,...i});super(e,!1,n(o,l),r(o)?t():null)}})(on,Fn,ct,Xt,Qt,(e=>({...e,channelCount:e.numberOfOutputs}))),zn=((e,t,n,s)=>(r,{offset:a,...i})=>{const o=r.createBuffer(1,2,44100),l=t(r,{buffer:null,channelCount:2,channelCountMode:"max",channelInterpretation:"speakers",loop:!1,loopEnd:0,loopStart:0,playbackRate:1}),u=n(r,{...i,gain:a}),c=o.getChannelData(0);c[0]=1,c[1]=1,l.buffer=o,l.loop=!0;const h={get bufferSize(){},get channelCount(){return u.channelCount},set channelCount(e){u.channelCount=e},get channelCountMode(){return u.channelCountMode},set channelCountMode(e){u.channelCountMode=e},get channelInterpretation(){return u.channelInterpretation},set channelInterpretation(e){u.channelInterpretation=e},get context(){return u.context},get inputs(){return[]},get numberOfInputs(){return l.numberOfInputs},get numberOfOutputs(){return u.numberOfOutputs},get offset(){return u.gain},get onended(){return l.onended},set onended(e){l.onended=e},addEventListener:(...e)=>l.addEventListener(e[0],e[1],e[2]),dispatchEvent:(...e)=>l.dispatchEvent(e[0]),removeEventListener:(...e)=>l.removeEventListener(e[0],e[1],e[2]),start(e=0){l.start.call(l,e)},stop(e=0){l.stop.call(l,e)}};return e(r,l),s(ht(h,u),(()=>l.connect(u)),(()=>l.disconnect(u)))})(yn,vn,pt,Nn),Ln=((e,t,n,s,r)=>(a,i)=>{if(void 0===a.createConstantSource)return n(a,i);const o=a.createConstantSource();return nt(o,i),rt(o,i,"offset"),t(s,(()=>s(a)))||at(o),t(r,(()=>r(a)))||it(o),e(a,o),o})(yn,Wt,zn,Tt,Ot),Pn=((e,t,n,s,r)=>()=>{const a=new WeakMap;let i=null,o=null;return{set start(e){i=e},set stop(e){o=e},render(l,u){const c=a.get(u);return void 0!==c?Promise.resolve(c):(async(l,u)=>{let c=n(l);const h=Z(c,u);if(!h){const e={channelCount:c.channelCount,channelCountMode:c.channelCountMode,channelInterpretation:c.channelInterpretation,offset:c.offset.value};c=t(u,e),null!==i&&c.start(i),null!==o&&c.stop(o)}return a.set(u,c),h?await e(u,l.offset,c.offset):await s(u,l.offset,c.offset),await r(l,u,c),c})(l,u)}}})(wn,Ln,xe,xn,$t),Vn=((e,t,n,s,r,a,i)=>class extends e{constructor(e,i){const o=r(e),l={...We,...i},u=s(o,l),c=a(o),h=c?n():null;super(e,!1,u,h),this._constantSourceNodeRenderer=h,this._nativeConstantSourceNode=u,this._offset=t(this,c,u.offset,ne,te),this._onended=null}get offset(){return this._offset}get onended(){return this._onended}set onended(e){const t="function"==typeof e?i(this,e):null;this._nativeConstantSourceNode.onended=t;const n=this._nativeConstantSourceNode.onended;this._onended=null!==n&&n===t?e:n}start(e=0){if(this._nativeConstantSourceNode.start(e),null!==this._constantSourceNodeRenderer&&(this._constantSourceNodeRenderer.start=e),"closed"!==this.context.state){j(this);const e=()=>{this._nativeConstantSourceNode.removeEventListener("ended",e),se(this)&&$(this)};this._nativeConstantSourceNode.addEventListener("ended",e)}}stop(e=0){this._nativeConstantSourceNode.stop(e),null!==this._constantSourceNodeRenderer&&(this._constantSourceNodeRenderer.stop=e)}})(on,kn,Pn,Ln,Xt,Qt,Ft),Wn=((e,t)=>(n,s)=>{const r=n.createConvolver();if(nt(r,s),s.disableNormalization===r.normalize&&(r.normalize=!s.disableNormalization),tt(r,s,"buffer"),s.channelCount>2)throw e();if(t(r,"channelCount",(e=>()=>e.call(r)),(t=>n=>{if(n>2)throw e();return t.call(r,n)})),"max"===s.channelCountMode)throw e();return t(r,"channelCountMode",(e=>()=>e.call(r)),(t=>n=>{if("max"===n)throw e();return t.call(r,n)})),r})(yt,_t),Un=((e,t,n)=>()=>{const s=new WeakMap;return{render(r,a){const i=s.get(a);return void 0!==i?Promise.resolve(i):(async(r,a)=>{let i=t(r);if(!Z(i,a)){const t={buffer:i.buffer,channelCount:i.channelCount,channelCountMode:i.channelCountMode,channelInterpretation:i.channelInterpretation,disableNormalization:!i.normalize};i=e(a,t)}return s.set(a,i),me(i)?await n(r,a,i.inputs[0]):await n(r,a,i),i})(r,a)}}})(Wn,xe,$t),Gn=((e,t,n,s,r,a)=>class extends e{constructor(e,i){const o=s(e),l={...Ue,...i},u=n(o,l);super(e,!1,u,r(o)?t():null),this._isBufferNullified=!1,this._nativeConvolverNode=u,null!==l.buffer&&a(this,l.buffer.duration)}get buffer(){return this._isBufferNullified?null:this._nativeConvolverNode.buffer}set buffer(e){if(this._nativeConvolverNode.buffer=e,null===e&&null!==this._nativeConvolverNode.buffer){const e=this._nativeConvolverNode.context;this._nativeConvolverNode.buffer=e.createBuffer(1,1,e.sampleRate),this._isBufferNullified=!0,a(this,0)}else this._isBufferNullified=!1,a(this,null===this._nativeConvolverNode.buffer?0:this._nativeConvolverNode.buffer.duration)}get normalize(){return this._nativeConvolverNode.normalize}set normalize(e){this._nativeConvolverNode.normalize=e}})(on,Un,Wn,Xt,Qt,In),qn=((e,t,n,s,r)=>a=>{const i=new WeakMap;return{render(o,l){const u=i.get(l);return void 0!==u?Promise.resolve(u):(async(o,l)=>{let u=n(o);const c=Z(u,l);if(!c){const e={channelCount:u.channelCount,channelCountMode:u.channelCountMode,channelInterpretation:u.channelInterpretation,delayTime:u.delayTime.value,maxDelayTime:a};u=t(l,e)}return i.set(l,u),c?await e(l,o.delayTime,u.delayTime):await s(l,o.delayTime,u.delayTime),await r(o,l,u),u})(o,l)}}})(wn,dt,xe,xn,$t),jn=((e,t,n,s,r,a,i)=>class extends e{constructor(e,o){const l=r(e),u={...qe,...o},c=s(l,u),h=a(l);super(e,!1,c,h?n(u.maxDelayTime):null),this._delayTime=t(this,h,c.delayTime),i(this,u.maxDelayTime)}get delayTime(){return this._delayTime}})(on,kn,qn,dt,Xt,Qt,In),Hn=(e=>(t,n)=>{const s=t.createDynamicsCompressor();if(nt(s,n),n.channelCount>2)throw e();if("max"===n.channelCountMode)throw e();return rt(s,n,"attack"),rt(s,n,"knee"),rt(s,n,"ratio"),rt(s,n,"release"),rt(s,n,"threshold"),s})(yt),$n=((e,t,n,s,r)=>()=>{const a=new WeakMap;return{render(i,o){const l=a.get(o);return void 0!==l?Promise.resolve(l):(async(i,o)=>{let l=n(i);const u=Z(l,o);if(!u){const e={attack:l.attack.value,channelCount:l.channelCount,channelCountMode:l.channelCountMode,channelInterpretation:l.channelInterpretation,knee:l.knee.value,ratio:l.ratio.value,release:l.release.value,threshold:l.threshold.value};l=t(o,e)}return a.set(o,l),u?(await e(o,i.attack,l.attack),await e(o,i.knee,l.knee),await e(o,i.ratio,l.ratio),await e(o,i.release,l.release),await e(o,i.threshold,l.threshold)):(await s(o,i.attack,l.attack),await s(o,i.knee,l.knee),await s(o,i.ratio,l.ratio),await s(o,i.release,l.release),await s(o,i.threshold,l.threshold)),await r(i,o,l),l})(i,o)}}})(wn,Hn,xe,xn,$t),Kn=((e,t,n,s,r,a,i,o)=>class extends e{constructor(e,r){const l=a(e),u={...He,...r},c=s(l,u),h=i(l);super(e,!1,c,h?n():null),this._attack=t(this,h,c.attack),this._knee=t(this,h,c.knee),this._nativeDynamicsCompressorNode=c,this._ratio=t(this,h,c.ratio),this._release=t(this,h,c.release),this._threshold=t(this,h,c.threshold),o(this,.006)}get attack(){return this._attack}get channelCount(){return this._nativeDynamicsCompressorNode.channelCount}set channelCount(e){const t=this._nativeDynamicsCompressorNode.channelCount;if(this._nativeDynamicsCompressorNode.channelCount=e,e>2)throw this._nativeDynamicsCompressorNode.channelCount=t,r()}get channelCountMode(){return this._nativeDynamicsCompressorNode.channelCountMode}set channelCountMode(e){const t=this._nativeDynamicsCompressorNode.channelCountMode;if(this._nativeDynamicsCompressorNode.channelCountMode=e,"max"===e)throw this._nativeDynamicsCompressorNode.channelCountMode=t,r()}get knee(){return this._knee}get ratio(){return this._ratio}get reduction(){return"number"==typeof this._nativeDynamicsCompressorNode.reduction.value?this._nativeDynamicsCompressorNode.reduction.value:this._nativeDynamicsCompressorNode.reduction}get release(){return this._release}get threshold(){return this._threshold}})(on,kn,$n,Hn,yt,Xt,Qt,In),Xn=((e,t,n,s,r)=>()=>{const a=new WeakMap;return{render(i,o){const l=a.get(o);return void 0!==l?Promise.resolve(l):(async(i,o)=>{let l=n(i);const u=Z(l,o);if(!u){const e={channelCount:l.channelCount,channelCountMode:l.channelCountMode,channelInterpretation:l.channelInterpretation,gain:l.gain.value};l=t(o,e)}return a.set(o,l),u?await e(o,i.gain,l.gain):await s(o,i.gain,l.gain),await r(i,o,l),l})(i,o)}}})(wn,pt,xe,xn,$t),Zn=((e,t,n,s,r,a)=>class extends e{constructor(e,i){const o=r(e),l={...$e,...i},u=s(o,l),c=a(o);super(e,!1,u,c?n():null),this._gain=t(this,c,u.gain,ne,te)}get gain(){return this._gain}})(on,kn,Xn,pt,Xt,Qt),Yn=((e,t,n,s)=>(r,a,{channelCount:i,channelCountMode:o,channelInterpretation:l,feedback:u,feedforward:c})=>{const h=ot(a,r.sampleRate),d=u instanceof Float64Array?u:new Float64Array(u),p=c instanceof Float64Array?c:new Float64Array(c),f=d.length,m=p.length,g=Math.min(f,m);if(0===f||f>20)throw s();if(0===d[0])throw t();if(0===m||m>20)throw s();if(0===p[0])throw t();if(1!==d[0]){for(let e=0;e{const t=e.inputBuffer,n=e.outputBuffer,s=t.numberOfChannels;for(let e=0;ey.addEventListener(e[0],e[1],e[2]),dispatchEvent:(...e)=>y.dispatchEvent(e[0]),getFrequencyResponse(t,n,s){if(t.length!==n.length||n.length!==s.length)throw e();const r=t.length;for(let e=0;ey.removeEventListener(e[0],e[1],e[2])},y)})(Xe,Ke,gt,yt),Qn=((e,t,n,s)=>r=>e(Je,(()=>Je(r)))?Promise.resolve(e(s,s)).then((e=>{if(!e){const e=n(r,512,0,1);r.oncomplete=()=>{e.onaudioprocess=null,e.disconnect()},e.onaudioprocess=()=>r.currentTime,e.connect(r.destination)}return r.startRendering()})):new Promise((e=>{const n=t(r,{channelCount:1,channelCountMode:"explicit",channelInterpretation:"discrete",gain:0});r.oncomplete=t=>{n.disconnect(),e(t.renderedBuffer)},n.connect(r.destination),r.startRendering()})))(Wt,pt,gt,((e,t)=>()=>{if(null===t)return Promise.resolve(!1);const n=new t(1,1,44100),s=e(n,{channelCount:1,channelCountMode:"explicit",channelInterpretation:"discrete",gain:0});return new Promise((e=>{n.oncomplete=()=>{s.disconnect(),e(0!==n.currentTime)},n.startRendering()}))})(pt,Yt)),Jn=((e,t,n,s,r)=>(a,i)=>{const o=new WeakMap;let l=null;const u=async(u,c)=>{let h=null,d=t(u);const p=Z(d,c);if(void 0===c.createIIRFilter?h=e(c,{buffer:null,channelCount:2,channelCountMode:"max",channelInterpretation:"speakers",loop:!1,loopEnd:0,loopStart:0,playbackRate:1}):p||(d=c.createIIRFilter(i,a)),o.set(c,null===h?d:h),null!==h){if(null===l){if(null===n)throw new Error("Missing the native OfflineAudioContext constructor.");const e=new n(u.context.destination.channelCount,u.context.length,c.sampleRate);l=(async()=>{await s(u,e,e.destination);return((e,t,n,s)=>{const r=n instanceof Float64Array?n:new Float64Array(n),a=s instanceof Float64Array?s:new Float64Array(s),i=r.length,o=a.length,l=Math.min(i,o);if(1!==r[0]){for(let e=0;e(t,n,s)=>{if(void 0===t.createIIRFilter)return e(t,n,s);const r=t.createIIRFilter(s.feedforward,s.feedback);return nt(r,s),r})(Yn),ts=((e,t,n,s,r,a)=>class extends e{constructor(e,i){const o=s(e),l=r(o),u={...Ze,...i},c=t(o,l?null:e.baseLatency,u);super(e,!1,c,l?n(u.feedback,u.feedforward):null),(e=>{var t;e.getFrequencyResponse=(t=e.getFrequencyResponse,(n,s,r)=>{if(n.length!==s.length||s.length!==r.length)throw Xe();return t.call(e,n,s,r)})})(c),this._nativeIIRFilterNode=c,a(this,1)}getFrequencyResponse(e,t,n){return this._nativeIIRFilterNode.getFrequencyResponse(e,t,n)}})(on,es,Jn,Xt,Qt,In),ns=((e,t,n,s,r,a,i,o)=>(l,u)=>{const c=u.listener,{forwardX:h,forwardY:d,forwardZ:p,positionX:f,positionY:m,positionZ:g,upX:y,upY:b,upZ:w}=void 0===c.forwardX?(()=>{const h=new Float32Array(1),d=t(u,{channelCount:1,channelCountMode:"explicit",channelInterpretation:"speakers",numberOfInputs:9}),p=i(u);let f=!1,m=[0,0,-1,0,1,0],g=[0,0,0];const y=()=>{if(f)return;f=!0;const e=s(u,256,9,0);e.onaudioprocess=({inputBuffer:e})=>{const t=[a(e,h,0),a(e,h,1),a(e,h,2),a(e,h,3),a(e,h,4),a(e,h,5)];t.some(((e,t)=>e!==m[t]))&&(c.setOrientation(...t),m=t);const n=[a(e,h,6),a(e,h,7),a(e,h,8)];n.some(((e,t)=>e!==g[t]))&&(c.setPosition(...n),g=n)},d.connect(e)},b=e=>t=>{t!==m[e]&&(m[e]=t,c.setOrientation(...m))},w=e=>t=>{t!==g[e]&&(g[e]=t,c.setPosition(...g))},v=(t,s,a)=>{const i=n(u,{channelCount:1,channelCountMode:"explicit",channelInterpretation:"discrete",offset:s});i.connect(d,0,t),i.start(),Object.defineProperty(i.offset,"defaultValue",{get:()=>s});const c=e({context:l},p,i.offset,ne,te);var h,f,m,g,b,w,v;return o(c,"value",(e=>()=>e.call(c)),(e=>t=>{try{e.call(c,t)}catch(e){if(9!==e.code)throw e}y(),p&&a(t)})),c.cancelAndHoldAtTime=(h=c.cancelAndHoldAtTime,p?()=>{throw r()}:(...e)=>{const t=h.apply(c,e);return y(),t}),c.cancelScheduledValues=(f=c.cancelScheduledValues,p?()=>{throw r()}:(...e)=>{const t=f.apply(c,e);return y(),t}),c.exponentialRampToValueAtTime=(m=c.exponentialRampToValueAtTime,p?()=>{throw r()}:(...e)=>{const t=m.apply(c,e);return y(),t}),c.linearRampToValueAtTime=(g=c.linearRampToValueAtTime,p?()=>{throw r()}:(...e)=>{const t=g.apply(c,e);return y(),t}),c.setTargetAtTime=(b=c.setTargetAtTime,p?()=>{throw r()}:(...e)=>{const t=b.apply(c,e);return y(),t}),c.setValueAtTime=(w=c.setValueAtTime,p?()=>{throw r()}:(...e)=>{const t=w.apply(c,e);return y(),t}),c.setValueCurveAtTime=(v=c.setValueCurveAtTime,p?()=>{throw r()}:(...e)=>{const t=v.apply(c,e);return y(),t}),c};return{forwardX:v(0,0,b(0)),forwardY:v(1,0,b(1)),forwardZ:v(2,-1,b(2)),positionX:v(6,0,w(0)),positionY:v(7,0,w(1)),positionZ:v(8,0,w(2)),upX:v(3,0,b(3)),upY:v(4,1,b(4)),upZ:v(5,0,b(5))}})():c;return{get forwardX(){return h},get forwardY(){return d},get forwardZ(){return p},get positionX(){return f},get positionY(){return m},get positionZ(){return g},get upX(){return y},get upY(){return b},get upZ(){return w}}})(kn,Rn,Ln,gt,yt,St,Qt,_t),ss=new WeakMap,rs=((e,t,n,s,r,a)=>class extends n{constructor(n,a){super(n),this._nativeContext=n,O.set(this,n),s(n)&&r.set(n,new Set),this._destination=new e(this,a),this._listener=t(this,n),this._onstatechange=null}get currentTime(){return this._nativeContext.currentTime}get destination(){return this._destination}get listener(){return this._listener}get onstatechange(){return this._onstatechange}set onstatechange(e){const t="function"==typeof e?a(this,e):null;this._nativeContext.onstatechange=t;const n=this._nativeContext.onstatechange;this._onstatechange=null!==n&&n===t?e:n}get sampleRate(){return this._nativeContext.sampleRate}get state(){return this._nativeContext.state}})(En,ns,en,Qt,ss,Ft),as=((e,t,n,s,r,a)=>(i,o)=>{const l=i.createOscillator();return nt(l,o),rt(l,o,"detune"),rt(l,o,"frequency"),void 0!==o.periodicWave?l.setPeriodicWave(o.periodicWave):tt(l,o,"type"),t(n,(()=>n(i)))||at(l),t(s,(()=>s(i)))||a(l,i),t(r,(()=>r(i)))||it(l),e(i,l),l})(yn,Wt,Tt,Nt,Ot,Mt),is=((e,t,n,s,r)=>()=>{const a=new WeakMap;let i=null,o=null,l=null;return{set periodicWave(e){i=e},set start(e){o=e},set stop(e){l=e},render(u,c){const h=a.get(c);return void 0!==h?Promise.resolve(h):(async(u,c)=>{let h=n(u);const d=Z(h,c);if(!d){const e={channelCount:h.channelCount,channelCountMode:h.channelCountMode,channelInterpretation:h.channelInterpretation,detune:h.detune.value,frequency:h.frequency.value,periodicWave:null===i?void 0:i,type:h.type};h=t(c,e),null!==o&&h.start(o),null!==l&&h.stop(l)}return a.set(c,h),d?(await e(c,u.detune,h.detune),await e(c,u.frequency,h.frequency)):(await s(c,u.detune,h.detune),await s(c,u.frequency,h.frequency)),await r(u,c,h),h})(u,c)}}})(wn,as,xe,xn,$t),os=((e,t,n,s,r,a,i)=>class extends e{constructor(e,i){const o=r(e),l={...wt,...i},u=n(o,l),c=a(o),h=c?s():null,d=e.sampleRate/2;super(e,!1,u,h),this._detune=t(this,c,u.detune,153600,-153600),this._frequency=t(this,c,u.frequency,d,-d),this._nativeOscillatorNode=u,this._onended=null,this._oscillatorNodeRenderer=h,null!==this._oscillatorNodeRenderer&&void 0!==l.periodicWave&&(this._oscillatorNodeRenderer.periodicWave=l.periodicWave)}get detune(){return this._detune}get frequency(){return this._frequency}get onended(){return this._onended}set onended(e){const t="function"==typeof e?i(this,e):null;this._nativeOscillatorNode.onended=t;const n=this._nativeOscillatorNode.onended;this._onended=null!==n&&n===t?e:n}get type(){return this._nativeOscillatorNode.type}set type(e){this._nativeOscillatorNode.type=e,null!==this._oscillatorNodeRenderer&&(this._oscillatorNodeRenderer.periodicWave=null)}setPeriodicWave(e){this._nativeOscillatorNode.setPeriodicWave(e),null!==this._oscillatorNodeRenderer&&(this._oscillatorNodeRenderer.periodicWave=e)}start(e=0){if(this._nativeOscillatorNode.start(e),null!==this._oscillatorNodeRenderer&&(this._oscillatorNodeRenderer.start=e),"closed"!==this.context.state){j(this);const e=()=>{this._nativeOscillatorNode.removeEventListener("ended",e),se(this)&&$(this)};this._nativeOscillatorNode.addEventListener("ended",e)}}stop(e=0){this._nativeOscillatorNode.stop(e),null!==this._oscillatorNodeRenderer&&(this._oscillatorNodeRenderer.stop=e)}})(on,kn,as,is,Xt,Qt,Ft),ls=(e=>(t,n)=>{const s=e(t,{buffer:null,channelCount:2,channelCountMode:"max",channelInterpretation:"speakers",loop:!1,loopEnd:0,loopStart:0,playbackRate:1}),r=t.createBuffer(1,2,44100);return s.buffer=r,s.loop=!0,s.connect(n),s.start(),()=>{s.stop(),s.disconnect(n)}})(vn),us=((e,t,n,s,r)=>(a,{curve:i,oversample:o,...l})=>{const u=a.createWaveShaper(),c=a.createWaveShaper();nt(u,l),nt(c,l);const h=n(a,{...l,gain:1}),d=n(a,{...l,gain:-1}),p=n(a,{...l,gain:1}),f=n(a,{...l,gain:-1});let m=null,g=!1,y=null;const b={get bufferSize(){},get channelCount(){return u.channelCount},set channelCount(e){h.channelCount=e,d.channelCount=e,u.channelCount=e,p.channelCount=e,c.channelCount=e,f.channelCount=e},get channelCountMode(){return u.channelCountMode},set channelCountMode(e){h.channelCountMode=e,d.channelCountMode=e,u.channelCountMode=e,p.channelCountMode=e,c.channelCountMode=e,f.channelCountMode=e},get channelInterpretation(){return u.channelInterpretation},set channelInterpretation(e){h.channelInterpretation=e,d.channelInterpretation=e,u.channelInterpretation=e,p.channelInterpretation=e,c.channelInterpretation=e,f.channelInterpretation=e},get context(){return u.context},get curve(){return y},set curve(n){if(null!==n&&n.length<2)throw t();if(null===n)u.curve=n,c.curve=n;else{const e=n.length,t=new Float32Array(e+2-e%2),s=new Float32Array(e+2-e%2);t[0]=n[0],s[0]=-n[e-1];const r=Math.ceil((e+1)/2),a=(e+1)/2-1;for(let i=1;ih.addEventListener(e[0],e[1],e[2]),dispatchEvent:(...e)=>h.dispatchEvent(e[0]),removeEventListener:(...e)=>h.removeEventListener(e[0],e[1],e[2])};null!==i&&(b.curve=i instanceof Float32Array?i:new Float32Array(i)),o!==b.oversample&&(b.oversample=o);return r(ht(b,p),(()=>{h.connect(u).connect(p),h.connect(d).connect(c).connect(f).connect(p),g=!0,s(y)&&(m=e(a,h))}),(()=>{h.disconnect(u),u.disconnect(p),h.disconnect(d),d.disconnect(c),c.disconnect(f),f.disconnect(p),g=!1,null!==m&&(m(),m=null)}))})(ls,Ke,pt,Et,Nn),cs=((e,t,n,s,r,a,i)=>(o,l)=>{const u=o.createWaveShaper();if(null!==a&&"webkitAudioContext"===a.name&&void 0===o.createGain().gain.automationRate)return n(o,l);nt(u,l);const c=null===l.curve||l.curve instanceof Float32Array?l.curve:new Float32Array(l.curve);if(null!==c&&c.length<2)throw t();tt(u,{curve:c},"curve"),tt(u,l,"oversample");let h=null,d=!1;i(u,"curve",(e=>()=>e.call(u)),(t=>n=>(t.call(u,n),d&&(s(n)&&null===h?h=e(o,u):s(n)||null===h||(h(),h=null)),n)));return r(u,(()=>{d=!0,s(u.curve)&&(h=e(o,u))}),(()=>{d=!1,null!==h&&(h(),h=null)}))})(ls,Ke,us,Et,Nn,tn,_t),hs=((e,t,n,s,r,a,i,o,l,u)=>(c,{coneInnerAngle:h,coneOuterAngle:d,coneOuterGain:p,distanceModel:f,maxDistance:m,orientationX:g,orientationY:y,orientationZ:b,panningModel:w,positionX:v,positionY:x,positionZ:A,refDistance:k,rolloffFactor:C,...S})=>{const E=c.createPanner();if(S.channelCount>2)throw i();if("max"===S.channelCountMode)throw i();nt(E,S);const _={channelCount:1,channelCountMode:"explicit",channelInterpretation:"discrete"},I=n(c,{..._,channelInterpretation:"speakers",numberOfInputs:6}),T=s(c,{...S,gain:1}),N=s(c,{..._,gain:1}),O=s(c,{..._,gain:0}),R=s(c,{..._,gain:0}),D=s(c,{..._,gain:0}),M=s(c,{..._,gain:0}),F=s(c,{..._,gain:0}),B=r(c,256,6,1),z=a(c,{..._,curve:new Float32Array([1,1]),oversample:"none"});let L=[g,y,b],P=[v,x,A];const V=new Float32Array(1);B.onaudioprocess=({inputBuffer:e})=>{const t=[l(e,V,0),l(e,V,1),l(e,V,2)];t.some(((e,t)=>e!==L[t]))&&(E.setOrientation(...t),L=t);const n=[l(e,V,3),l(e,V,4),l(e,V,5)];n.some(((e,t)=>e!==P[t]))&&(E.setPosition(...n),P=n)},Object.defineProperty(O.gain,"defaultValue",{get:()=>0}),Object.defineProperty(R.gain,"defaultValue",{get:()=>0}),Object.defineProperty(D.gain,"defaultValue",{get:()=>0}),Object.defineProperty(M.gain,"defaultValue",{get:()=>0}),Object.defineProperty(F.gain,"defaultValue",{get:()=>0});const W={get bufferSize(){},get channelCount(){return E.channelCount},set channelCount(e){if(e>2)throw i();T.channelCount=e,E.channelCount=e},get channelCountMode(){return E.channelCountMode},set channelCountMode(e){if("max"===e)throw i();T.channelCountMode=e,E.channelCountMode=e},get channelInterpretation(){return E.channelInterpretation},set channelInterpretation(e){T.channelInterpretation=e,E.channelInterpretation=e},get coneInnerAngle(){return E.coneInnerAngle},set coneInnerAngle(e){E.coneInnerAngle=e},get coneOuterAngle(){return E.coneOuterAngle},set coneOuterAngle(e){E.coneOuterAngle=e},get coneOuterGain(){return E.coneOuterGain},set coneOuterGain(e){if(e<0||e>1)throw t();E.coneOuterGain=e},get context(){return E.context},get distanceModel(){return E.distanceModel},set distanceModel(e){E.distanceModel=e},get inputs(){return[T]},get maxDistance(){return E.maxDistance},set maxDistance(e){if(e<0)throw new RangeError;E.maxDistance=e},get numberOfInputs(){return E.numberOfInputs},get numberOfOutputs(){return E.numberOfOutputs},get orientationX(){return N.gain},get orientationY(){return O.gain},get orientationZ(){return R.gain},get panningModel(){return E.panningModel},set panningModel(e){E.panningModel=e},get positionX(){return D.gain},get positionY(){return M.gain},get positionZ(){return F.gain},get refDistance(){return E.refDistance},set refDistance(e){if(e<0)throw new RangeError;E.refDistance=e},get rolloffFactor(){return E.rolloffFactor},set rolloffFactor(e){if(e<0)throw new RangeError;E.rolloffFactor=e},addEventListener:(...e)=>T.addEventListener(e[0],e[1],e[2]),dispatchEvent:(...e)=>T.dispatchEvent(e[0]),removeEventListener:(...e)=>T.removeEventListener(e[0],e[1],e[2])};h!==W.coneInnerAngle&&(W.coneInnerAngle=h),d!==W.coneOuterAngle&&(W.coneOuterAngle=d),p!==W.coneOuterGain&&(W.coneOuterGain=p),f!==W.distanceModel&&(W.distanceModel=f),m!==W.maxDistance&&(W.maxDistance=m),g!==W.orientationX.value&&(W.orientationX.value=g),y!==W.orientationY.value&&(W.orientationY.value=y),b!==W.orientationZ.value&&(W.orientationZ.value=b),w!==W.panningModel&&(W.panningModel=w),v!==W.positionX.value&&(W.positionX.value=v),x!==W.positionY.value&&(W.positionY.value=x),A!==W.positionZ.value&&(W.positionZ.value=A),k!==W.refDistance&&(W.refDistance=k),C!==W.rolloffFactor&&(W.rolloffFactor=C),1===L[0]&&0===L[1]&&0===L[2]||E.setOrientation(...L),0===P[0]&&0===P[1]&&0===P[2]||E.setPosition(...P);return u(ht(W,E),(()=>{T.connect(E),e(T,z,0,0),z.connect(N).connect(I,0,0),z.connect(O).connect(I,0,1),z.connect(R).connect(I,0,2),z.connect(D).connect(I,0,3),z.connect(M).connect(I,0,4),z.connect(F).connect(I,0,5),I.connect(B).connect(c.destination)}),(()=>{T.disconnect(E),o(T,z,0,0),z.disconnect(N),N.disconnect(I),z.disconnect(O),O.disconnect(I),z.disconnect(R),R.disconnect(I),z.disconnect(D),D.disconnect(I),z.disconnect(M),M.disconnect(I),z.disconnect(F),F.disconnect(I),I.disconnect(B),B.disconnect(c.destination)}))})(ge,Ke,Rn,pt,gt,cs,yt,ve,St,Nn),ds=(e=>(t,n)=>{const s=t.createPanner();return void 0===s.orientationX?e(t,n):(nt(s,n),rt(s,n,"orientationX"),rt(s,n,"orientationY"),rt(s,n,"orientationZ"),rt(s,n,"positionX"),rt(s,n,"positionY"),rt(s,n,"positionZ"),tt(s,n,"coneInnerAngle"),tt(s,n,"coneOuterAngle"),tt(s,n,"coneOuterGain"),tt(s,n,"distanceModel"),tt(s,n,"maxDistance"),tt(s,n,"panningModel"),tt(s,n,"refDistance"),tt(s,n,"rolloffFactor"),s)})(hs),ps=((e,t,n,s,r,a,i,o,l,u)=>()=>{const c=new WeakMap;let h=null;return{render(d,p){const f=c.get(p);return void 0!==f?Promise.resolve(f):(async(d,p)=>{let f=null,m=a(d);const g={channelCount:m.channelCount,channelCountMode:m.channelCountMode,channelInterpretation:m.channelInterpretation},y={...g,coneInnerAngle:m.coneInnerAngle,coneOuterAngle:m.coneOuterAngle,coneOuterGain:m.coneOuterGain,distanceModel:m.distanceModel,maxDistance:m.maxDistance,panningModel:m.panningModel,refDistance:m.refDistance,rolloffFactor:m.rolloffFactor},b=Z(m,p);if("bufferSize"in m)f=s(p,{...g,gain:1});else if(!b){const e={...y,orientationX:m.orientationX.value,orientationY:m.orientationY.value,orientationZ:m.orientationZ.value,positionX:m.positionX.value,positionY:m.positionY.value,positionZ:m.positionZ.value};m=r(p,e)}if(c.set(p,null===f?m:f),null!==f){if(null===h){if(null===i)throw new Error("Missing the native OfflineAudioContext constructor.");const e=new i(6,d.context.length,p.sampleRate),s=t(e,{channelCount:1,channelCountMode:"explicit",channelInterpretation:"speakers",numberOfInputs:6});s.connect(e.destination),h=(async()=>{const t=await Promise.all([d.orientationX,d.orientationY,d.orientationZ,d.positionX,d.positionY,d.positionZ].map((async(t,s)=>{const r=n(e,{channelCount:1,channelCountMode:"explicit",channelInterpretation:"discrete",offset:0===s?1:0});return await o(e,t,r.offset),r})));for(let e=0;e<6;e+=1)t[e].connect(s,0,e),t[e].start(0);return u(e)})()}const e=await h,a=s(p,{...g,gain:1});await l(d,p,a);const c=[];for(let t=0;te!==m[t]))||n.some(((e,t)=>e!==b[t]))){m=e,b=n;const i=t/p.sampleRate;w.gain.setValueAtTime(0,i),w=s(p,{...g,gain:0}),v=r(p,{...y,orientationX:m[0],orientationY:m[1],orientationZ:m[2],positionX:b[0],positionY:b[1],positionZ:b[2]}),w.gain.setValueAtTime(1,i),a.connect(w).connect(v.inputs[0]),v.connect(f)}}return f}return b?(await e(p,d.orientationX,m.orientationX),await e(p,d.orientationY,m.orientationY),await e(p,d.orientationZ,m.orientationZ),await e(p,d.positionX,m.positionX),await e(p,d.positionY,m.positionY),await e(p,d.positionZ,m.positionZ)):(await o(p,d.orientationX,m.orientationX),await o(p,d.orientationY,m.orientationY),await o(p,d.orientationZ,m.orientationZ),await o(p,d.positionX,m.positionX),await o(p,d.positionY,m.positionY),await o(p,d.positionZ,m.positionZ)),me(m)?await l(d,p,m.inputs[0]):await l(d,p,m),m})(d,p)}}})(wn,Rn,Ln,pt,ds,xe,Yt,xn,$t,Qn),fs=((e,t,n,s,r,a,i)=>class extends e{constructor(e,o){const l=r(e),u={...vt,...o},c=n(l,u),h=a(l);super(e,!1,c,h?s():null),this._nativePannerNode=c,this._orientationX=t(this,h,c.orientationX,ne,te),this._orientationY=t(this,h,c.orientationY,ne,te),this._orientationZ=t(this,h,c.orientationZ,ne,te),this._positionX=t(this,h,c.positionX,ne,te),this._positionY=t(this,h,c.positionY,ne,te),this._positionZ=t(this,h,c.positionZ,ne,te),i(this,1)}get coneInnerAngle(){return this._nativePannerNode.coneInnerAngle}set coneInnerAngle(e){this._nativePannerNode.coneInnerAngle=e}get coneOuterAngle(){return this._nativePannerNode.coneOuterAngle}set coneOuterAngle(e){this._nativePannerNode.coneOuterAngle=e}get coneOuterGain(){return this._nativePannerNode.coneOuterGain}set coneOuterGain(e){this._nativePannerNode.coneOuterGain=e}get distanceModel(){return this._nativePannerNode.distanceModel}set distanceModel(e){this._nativePannerNode.distanceModel=e}get maxDistance(){return this._nativePannerNode.maxDistance}set maxDistance(e){this._nativePannerNode.maxDistance=e}get orientationX(){return this._orientationX}get orientationY(){return this._orientationY}get orientationZ(){return this._orientationZ}get panningModel(){return this._nativePannerNode.panningModel}set panningModel(e){this._nativePannerNode.panningModel=e}get positionX(){return this._positionX}get positionY(){return this._positionY}get positionZ(){return this._positionZ}get refDistance(){return this._nativePannerNode.refDistance}set refDistance(e){this._nativePannerNode.refDistance=e}get rolloffFactor(){return this._nativePannerNode.rolloffFactor}set rolloffFactor(e){this._nativePannerNode.rolloffFactor=e}})(on,kn,ds,ps,Xt,Qt,In),ms=(e=>(t,{disableNormalization:n,imag:s,real:r})=>{const a=s instanceof Float32Array?s:new Float32Array(s),i=r instanceof Float32Array?r:new Float32Array(r),o=t.createPeriodicWave(i,a,{disableNormalization:n});if(Array.from(s).length<2)throw e();return o})(Q),gs=((e,t,n,s)=>class r{constructor(r,a){const i=t(r),o=s({...xt,...a}),l=e(i,o);return n.add(l),l}static[Symbol.hasInstance](e){return null!==e&&"object"==typeof e&&Object.getPrototypeOf(e)===r.prototype||n.has(e)}})(ms,Xt,new WeakSet,(e=>{const{imag:t,real:n}=e;return void 0===t?void 0===n?{...e,imag:[0,0],real:[0,0]}:{...e,imag:Array.from(n,(()=>0)),real:n}:void 0===n?{...e,imag:t,real:Array.from(t,(()=>0))}:{...e,imag:t,real:n}})),ys=((e,t,n,s,r,a)=>{const i=16385,o=new Float32Array([1,1]),l=Math.PI/2,u={channelCount:1,channelCountMode:"explicit",channelInterpretation:"discrete"},c={...u,oversample:"none"},h=(e,a,h,d,p)=>{if(1===a)return((e,t,r,a)=>{const h=new Float32Array(i),d=new Float32Array(i);for(let e=0;e{const d=new Float32Array(i),p=new Float32Array(i),f=new Float32Array(i),m=new Float32Array(i),g=Math.floor(8192.5);for(let e=0;eg){const t=(e-g)/(16384-g)*l;d[e]=Math.cos(t),p[e]=Math.sin(t),f[e]=0,m[e]=1}else{const t=e/(16384-g)*l;d[e]=1,p[e]=0,f[e]=Math.cos(t),m[e]=Math.sin(t)}const y=t(e,{channelCount:2,channelCountMode:"explicit",channelInterpretation:"discrete",numberOfOutputs:2}),b=n(e,{...u,gain:0}),w=s(e,{...c,curve:d}),v=n(e,{...u,gain:0}),x=s(e,{...c,curve:p}),A=s(e,{...c,curve:o}),k=n(e,{...u,gain:0}),C=s(e,{...c,curve:f}),S=n(e,{...u,gain:0}),E=s(e,{...c,curve:m});return{connectGraph(){r.connect(y),r.connect(void 0===A.inputs?A:A.inputs[0]),y.connect(b,0),y.connect(v,0),y.connect(k,1),y.connect(S,1),A.connect(a),a.connect(void 0===w.inputs?w:w.inputs[0]),a.connect(void 0===x.inputs?x:x.inputs[0]),a.connect(void 0===C.inputs?C:C.inputs[0]),a.connect(void 0===E.inputs?E:E.inputs[0]),w.connect(b.gain),x.connect(v.gain),C.connect(k.gain),E.connect(S.gain),b.connect(h,0,0),k.connect(h,0,0),v.connect(h,0,1),S.connect(h,0,1)},disconnectGraph(){r.disconnect(y),r.disconnect(void 0===A.inputs?A:A.inputs[0]),y.disconnect(b,0),y.disconnect(v,0),y.disconnect(k,1),y.disconnect(S,1),A.disconnect(a),a.disconnect(void 0===w.inputs?w:w.inputs[0]),a.disconnect(void 0===x.inputs?x:x.inputs[0]),a.disconnect(void 0===C.inputs?C:C.inputs[0]),a.disconnect(void 0===E.inputs?E:E.inputs[0]),w.disconnect(b.gain),x.disconnect(v.gain),C.disconnect(k.gain),E.disconnect(S.gain),b.disconnect(h,0,0),k.disconnect(h,0,0),v.disconnect(h,0,1),S.disconnect(h,0,1)}}})(e,h,d,p);throw r()};return(t,{channelCount:s,channelCountMode:i,pan:o,...l})=>{if("max"===i)throw r();const u=e(t,{...l,channelCount:1,channelCountMode:i,numberOfInputs:2}),c=n(t,{...l,channelCount:s,channelCountMode:i,gain:1}),d=n(t,{channelCount:1,channelCountMode:"explicit",channelInterpretation:"discrete",gain:o});let{connectGraph:p,disconnectGraph:f}=h(t,s,c,d,u);Object.defineProperty(d.gain,"defaultValue",{get:()=>0}),Object.defineProperty(d.gain,"maxValue",{get:()=>1}),Object.defineProperty(d.gain,"minValue",{get:()=>-1});const m={get bufferSize(){},get channelCount(){return c.channelCount},set channelCount(e){c.channelCount!==e&&(g&&f(),({connectGraph:p,disconnectGraph:f}=h(t,e,c,d,u)),g&&p()),c.channelCount=e},get channelCountMode(){return c.channelCountMode},set channelCountMode(e){if("clamped-max"===e||"max"===e)throw r();c.channelCountMode=e},get channelInterpretation(){return c.channelInterpretation},set channelInterpretation(e){c.channelInterpretation=e},get context(){return c.context},get inputs(){return[c]},get numberOfInputs(){return c.numberOfInputs},get numberOfOutputs(){return c.numberOfOutputs},get pan(){return d.gain},addEventListener:(...e)=>c.addEventListener(e[0],e[1],e[2]),dispatchEvent:(...e)=>c.dispatchEvent(e[0]),removeEventListener:(...e)=>c.removeEventListener(e[0],e[1],e[2])};let g=!1;return a(ht(m,u),(()=>{p(),g=!0}),(()=>{f(),g=!1}))}})(Rn,ct,pt,cs,yt,Nn),bs=((e,t)=>(n,s)=>{const r=s.channelCountMode;if("clamped-max"===r)throw t();if(void 0===n.createStereoPanner)return e(n,s);const a=n.createStereoPanner();return nt(a,s),rt(a,s,"pan"),Object.defineProperty(a,"channelCountMode",{get:()=>r,set:e=>{if(e!==r)throw t()}}),a})(ys,yt),ws=((e,t,n,s,r)=>()=>{const a=new WeakMap;return{render(i,o){const l=a.get(o);return void 0!==l?Promise.resolve(l):(async(i,o)=>{let l=n(i);const u=Z(l,o);if(!u){const e={channelCount:l.channelCount,channelCountMode:l.channelCountMode,channelInterpretation:l.channelInterpretation,pan:l.pan.value};l=t(o,e)}return a.set(o,l),u?await e(o,i.pan,l.pan):await s(o,i.pan,l.pan),me(l)?await r(i,o,l.inputs[0]):await r(i,o,l),l})(i,o)}}})(wn,bs,xe,xn,$t),vs=((e,t,n,s,r,a)=>class extends e{constructor(e,i){const o=r(e),l={...At,...i},u=n(o,l),c=a(o);super(e,!1,u,c?s():null),this._pan=t(this,c,u.pan)}get pan(){return this._pan}})(on,kn,bs,ws,Xt,Qt),xs=((e,t,n)=>()=>{const s=new WeakMap;return{render(r,a){const i=s.get(a);return void 0!==i?Promise.resolve(i):(async(r,a)=>{let i=t(r);if(!Z(i,a)){const t={channelCount:i.channelCount,channelCountMode:i.channelCountMode,channelInterpretation:i.channelInterpretation,curve:i.curve,oversample:i.oversample};i=e(a,t)}return s.set(a,i),me(i)?await n(r,a,i.inputs[0]):await n(r,a,i),i})(r,a)}}})(cs,xe,$t),As=((e,t,n,s,r,a,i)=>class extends e{constructor(e,t){const o=r(e),l={...Ct,...t},u=n(o,l);super(e,!0,u,a(o)?s():null),this._isCurveNullified=!1,this._nativeWaveShaperNode=u,i(this,1)}get curve(){return this._isCurveNullified?null:this._nativeWaveShaperNode.curve}set curve(e){if(null===e)this._isCurveNullified=!0,this._nativeWaveShaperNode.curve=new Float32Array([0,0]);else{if(e.length<2)throw t();this._isCurveNullified=!1,this._nativeWaveShaperNode.curve=e}}get oversample(){return this._nativeWaveShaperNode.oversample}set oversample(e){this._nativeWaveShaperNode.oversample=e}})(on,Ke,cs,xs,Xt,Qt,In),ks=(e=>null!==e&&e.isSecureContext)(qt),Cs=(e=>(t,n,s)=>{Object.defineProperties(e,{currentFrame:{configurable:!0,get:()=>Math.round(t*n)},currentTime:{configurable:!0,get:()=>t}});try{return s()}finally{null!==e&&(delete e.currentFrame,delete e.currentTime)}})(qt),Ss=new WeakMap,Es=((e,t)=>n=>{let s=e.get(n);if(void 0!==s)return s;if(null===t)throw new Error("Missing the native OfflineAudioContext constructor.");return s=new t(1,1,44100),e.set(n,s),s})(Ss,Yt),_s=ks?((e,t,n,s,r,a,i,o,l,u,c,h,d)=>{let p=0;return(f,m,g={credentials:"omit"})=>{const y=c.get(f);if(void 0!==y&&y.has(m))return Promise.resolve();const b=u.get(f);if(void 0!==b){const e=b.get(m);if(void 0!==e)return e}const w=a(f),v=void 0===w.audioWorklet?r(m).then((([e,t])=>{const[s,r]=L(e,t);return n(`${s};((a,b)=>{(a[b]=a[b]||[]).push((AudioWorkletProcessor,global,registerProcessor,sampleRate,self,window)=>{${r}\n})})(window,'_AWGS')`)})).then((()=>{const e=d._AWGS.pop();if(void 0===e)throw new SyntaxError;s(w.currentTime,w.sampleRate,(()=>e(class{},void 0,((e,n)=>{if(""===e.trim())throw t();const s=M.get(w);if(void 0!==s){if(s.has(e))throw t();V(n),P(n.parameterDescriptors),s.set(e,n)}else V(n),P(n.parameterDescriptors),M.set(w,new Map([[e,n]]))}),w.sampleRate,void 0,void 0)))})):Promise.all([r(m),Promise.resolve(e(h,h))]).then((([[e,t],n])=>{const s=p+1;p=s;const[r,a]=L(e,t),u=new Blob([`${r};((AudioWorkletProcessor,registerProcessor)=>{${a}\n})(${n?"AudioWorkletProcessor":"class extends AudioWorkletProcessor {__b=new WeakSet();constructor(){super();(p=>p.postMessage=(q=>(m,t)=>q.call(p,m,t?t.filter(u=>!this.__b.has(u)):t))(p.postMessage))(this.port)}}"},(n,p)=>registerProcessor(n,class extends p{${n?"":"__c = (a) => a.forEach(e=>this.__b.add(e.buffer));"}process(i,o,p){${n?"":"i.forEach(this.__c);o.forEach(this.__c);this.__c(Object.values(p));"}return super.process(i.map(j=>j.some(k=>k.length===0)?[]:j),o,p)}}));registerProcessor('__sac${s}',class extends AudioWorkletProcessor{process(){return !1}})`],{type:"application/javascript; charset=utf-8"}),c=URL.createObjectURL(u);return w.audioWorklet.addModule(c,g).then((()=>{if(o(w))return w;const e=i(w);return e.audioWorklet.addModule(c,g).then((()=>e))})).then((e=>{if(null===l)throw new SyntaxError;try{new l(e,`__sac${s}`)}catch{throw new SyntaxError}})).finally((()=>URL.revokeObjectURL(c)))}));return void 0===b?u.set(f,new Map([[m,v]])):b.set(m,v),v.then((()=>{const e=c.get(f);void 0===e?c.set(f,new Set([m])):e.add(m)})).finally((()=>{const e=u.get(f);void 0!==e&&e.delete(m)})),v}})(Wt,yt,(e=>t=>new Promise(((n,s)=>{if(null===e)return void s(new SyntaxError);const r=e.document.head;if(null===r)s(new SyntaxError);else{const a=e.document.createElement("script"),i=new Blob([t],{type:"application/javascript"}),o=URL.createObjectURL(i),l=e.onerror,u=()=>{e.onerror=l,URL.revokeObjectURL(o)};e.onerror=(t,n,r,a,i)=>n===o||n===e.location.href&&1===r&&1===a?(u(),s(i),!1):null!==l?l(t,n,r,a,i):void 0,a.onerror=()=>{u(),s(new SyntaxError)},a.onload=()=>{u(),n()},a.src=o,a.type="module",r.appendChild(a)}})))(qt),Cs,(e=>async t=>{try{const e=await fetch(t);if(e.ok)return[await e.text(),e.url]}catch{}throw e()})((()=>new DOMException("","AbortError"))),Xt,Es,Qt,an,new WeakMap,new WeakMap,((e,t)=>async()=>{if(null===e)return!0;if(null===t)return!1;const n=new Blob(['class A extends AudioWorkletProcessor{process(i){this.port.postMessage(i,[i[0][0].buffer])}}registerProcessor("a",A)'],{type:"application/javascript; charset=utf-8"}),s=new t(1,128,44100),r=URL.createObjectURL(n);let a=!1,i=!1;try{await s.audioWorklet.addModule(r);const t=new e(s,"a",{numberOfOutputs:0}),n=s.createOscillator();t.port.onmessage=()=>a=!0,t.onprocessorerror=()=>i=!0,n.connect(t),n.start(0),await s.startRendering(),await new Promise((e=>setTimeout(e)))}catch{}finally{URL.revokeObjectURL(r)}return a&&!i})(an,Yt),qt):void 0,Is=((e,t)=>n=>e(n)||t(n))(nn,Qt),Ts=((e,t,n,s,r,a,i,o,l,u,c)=>(h,d)=>{const p=i(h)?h:a(h);if(r.has(d)){const e=n();return Promise.reject(e)}try{r.add(d)}catch{}return t(l,(()=>l(p)))?p.decodeAudioData(d).then((n=>(Ge(d).catch((()=>{})),t(o,(()=>o(n)))||c(n),e.add(n),n))):new Promise(((t,n)=>{const r=async()=>{try{await Ge(d)}catch{}},a=e=>{n(e),r()};try{p.decodeAudioData(d,(n=>{"function"!=typeof n.copyFromChannel&&(u(n),J(n)),e.add(n),r().then((()=>t(n)))}),(e=>{a(null===e?s():e)}))}catch(e){a(e)}}))})(cn,Wt,(()=>new DOMException("","DataCloneError")),(()=>new DOMException("","EncodingError")),new WeakSet,Xt,Is,Y,Je,fn,mn),Ns=((e,t,n,s,r,a,i,o,l,u,c,h,d,p,f,m,g,y,b,w)=>class extends f{constructor(t,n){super(t,n),this._nativeContext=t,this._audioWorklet=void 0===e?void 0:{addModule:(t,n)=>e(this,t,n)}}get audioWorklet(){return this._audioWorklet}createAnalyser(){return new t(this)}createBiquadFilter(){return new r(this)}createBuffer(e,t,s){return new n({length:t,numberOfChannels:e,sampleRate:s})}createBufferSource(){return new s(this)}createChannelMerger(e=6){return new a(this,{numberOfInputs:e})}createChannelSplitter(e=6){return new i(this,{numberOfOutputs:e})}createConstantSource(){return new o(this)}createConvolver(){return new l(this)}createDelay(e=1){return new c(this,{maxDelayTime:e})}createDynamicsCompressor(){return new h(this)}createGain(){return new d(this)}createIIRFilter(e,t){return new p(this,{feedback:t,feedforward:e})}createOscillator(){return new m(this)}createPanner(){return new g(this)}createPeriodicWave(e,t,n={disableNormalization:!1}){return new y(this,{...n,imag:t,real:e})}createStereoPanner(){return new b(this)}createWaveShaper(){return new w(this)}decodeAudioData(e,t,n){return u(this._nativeContext,e).then((e=>("function"==typeof t&&t(e),e)),(e=>{throw"function"==typeof n&&n(e),e}))}})(_s,un,gn,Sn,Tn,Mn,Bn,Vn,Gn,Ts,jn,Kn,Zn,ts,rs,os,fs,gs,vs,As),Os=((e,t,n,s)=>class extends e{constructor(e,r){const a=n(e),i=t(a,r);if(s(a))throw TypeError();super(e,!0,i,null),this._nativeMediaElementAudioSourceNode=i}get mediaElement(){return this._nativeMediaElementAudioSourceNode.mediaElement}})(on,((e,t)=>e.createMediaElementSource(t.mediaElement)),Xt,Qt),Rs=((e,t,n,s)=>class extends e{constructor(e,r){const a=n(e);if(s(a))throw new TypeError;const i={...Qe,...r},o=t(a,i);super(e,!1,o,null),this._nativeMediaStreamAudioDestinationNode=o}get stream(){return this._nativeMediaStreamAudioDestinationNode.stream}})(on,((e,t)=>{const n=e.createMediaStreamDestination();return nt(n,t),1===n.numberOfOutputs&&Object.defineProperty(n,"numberOfOutputs",{get:()=>0}),n}),Xt,Qt),Ds=((e,t,n,s)=>class extends e{constructor(e,r){const a=n(e),i=t(a,r);if(s(a))throw new TypeError;super(e,!0,i,null),this._nativeMediaStreamAudioSourceNode=i}get mediaStream(){return this._nativeMediaStreamAudioSourceNode.mediaStream}})(on,((e,{mediaStream:t})=>{const n=t.getAudioTracks();n.sort(((e,t)=>e.idt.id?1:0));const s=n.slice(0,1),r=e.createMediaStreamSource(new MediaStream(s));return Object.defineProperty(r,"mediaStream",{value:t}),r}),Xt,Qt),Ms=((e,t)=>(n,{mediaStreamTrack:s})=>{if("function"==typeof n.createMediaStreamTrackSource)return n.createMediaStreamTrackSource(s);const r=new MediaStream([s]),a=n.createMediaStreamSource(r);if("audio"!==s.kind)throw e();if(t(n))throw new TypeError;return a})(Ke,Qt),Fs=((e,t,n)=>class extends e{constructor(e,s){const r=n(e);super(e,!0,t(r,s),null)}})(on,Ms,Xt),Bs=((e,t,n,s,r,a,i,o,l)=>class extends e{constructor(e={}){if(null===l)throw new Error("Missing the native AudioContext constructor.");let t;try{t=new l(e)}catch(e){if(12===e.code&&"sampleRate is not in range"===e.message)throw n();throw e}if(null===t)throw s();if(!ue(e.latencyHint))throw new TypeError(`The provided value '${e.latencyHint}' is not a valid enum value of type AudioContextLatencyCategory.`);if(void 0!==e.sampleRate&&t.sampleRate!==e.sampleRate)throw n();super(t,2);const{latencyHint:r}=e,{sampleRate:a}=t;if(this._baseLatency="number"==typeof t.baseLatency?t.baseLatency:"balanced"===r?512/a:"interactive"===r||void 0===r?256/a:"playback"===r?1024/a:128*Math.max(2,Math.min(128,Math.round(r*a/128)))/a,this._nativeAudioContext=t,"webkitAudioContext"===l.name?(this._nativeGainNode=t.createGain(),this._nativeOscillatorNode=t.createOscillator(),this._nativeGainNode.gain.value=1e-37,this._nativeOscillatorNode.connect(this._nativeGainNode).connect(t.destination),this._nativeOscillatorNode.start()):(this._nativeGainNode=null,this._nativeOscillatorNode=null),this._state=null,"running"===t.state){this._state="suspended";const e=()=>{"suspended"===this._state&&(this._state=null),t.removeEventListener("statechange",e)};t.addEventListener("statechange",e)}}get baseLatency(){return this._baseLatency}get state(){return null!==this._state?this._state:this._nativeAudioContext.state}close(){return"closed"===this.state?this._nativeAudioContext.close().then((()=>{throw t()})):("suspended"===this._state&&(this._state=null),this._nativeAudioContext.close().then((()=>{null!==this._nativeGainNode&&null!==this._nativeOscillatorNode&&(this._nativeOscillatorNode.stop(),this._nativeGainNode.disconnect(),this._nativeOscillatorNode.disconnect()),le(this)})))}createMediaElementSource(e){return new r(this,{mediaElement:e})}createMediaStreamDestination(){return new a(this)}createMediaStreamSource(e){return new i(this,{mediaStream:e})}createMediaStreamTrackSource(e){return new o(this,{mediaStreamTrack:e})}resume(){return"suspended"===this._state?new Promise(((e,t)=>{const n=()=>{this._nativeAudioContext.removeEventListener("statechange",n),"running"===this._nativeAudioContext.state?e():this.resume().then(e,t)};this._nativeAudioContext.addEventListener("statechange",n)})):this._nativeAudioContext.resume().catch((e=>{if(void 0===e||15===e.code)throw t();throw e}))}suspend(){return this._nativeAudioContext.suspend().catch((e=>{if(void 0===e)throw t();throw e}))}})(Ns,Ke,yt,kt,Os,Rs,Ds,Fs,tn),zs=(e=>t=>{const n=e.get(t);if(void 0===n)throw new Error("The context has no set of AudioWorkletNodes.");return n})(ss),Ls=(e=>(t,n)=>{e(t).add(n)})(zs),Ps=(e=>(t,n,s=0,r=0)=>{const a=t[s];if(void 0===a)throw e();return _e(n)?a.connect(n,0,r):a.connect(n,0)})(Q),Vs=(e=>(t,n)=>{e(t).delete(n)})(zs),Ws=(e=>(t,n=void 0,s=void 0,r=0)=>void 0===n?t.forEach((e=>e.disconnect())):"number"==typeof n?je(e,t,n).disconnect():_e(n)?void 0===s?t.forEach((e=>e.disconnect(n))):void 0===r?je(e,t,s).disconnect(n,0):je(e,t,s).disconnect(n,0,r):void 0===s?t.forEach((e=>e.disconnect(n))):je(e,t,s).disconnect(n,0))(Q),Us=new WeakMap,Gs=((e,t)=>n=>t(e,n))(Us,W),qs=((e,t,n,s,r,a,i,o,l,u,c,h,d)=>(p,f,m,g)=>{if(0===g.numberOfInputs&&0===g.numberOfOutputs)throw l();const y=Array.isArray(g.outputChannelCount)?g.outputChannelCount:Array.from(g.outputChannelCount);if(y.some((e=>e<1)))throw l();if(y.length!==g.numberOfOutputs)throw t();if("explicit"!==g.channelCountMode)throw l();const b=g.channelCount*g.numberOfInputs,w=y.reduce(((e,t)=>e+t),0),v=void 0===m.parameterDescriptors?0:m.parameterDescriptors.length;if(b+v>6||w>6)throw l();const x=new MessageChannel,A=[],k=[];for(let e=0;evoid 0===e?0:e},maxValue:{get:()=>void 0===t?ne:t},minValue:{get:()=>void 0===n?te:n}}),C.push(r)}const S=s(p,{channelCount:1,channelCountMode:"explicit",channelInterpretation:"speakers",numberOfInputs:Math.max(1,b+v)}),E=ot(f,p.sampleRate),_=o(p,E,b+v,Math.max(1,w)),I=r(p,{channelCount:Math.max(1,w),channelCountMode:"explicit",channelInterpretation:"discrete",numberOfOutputs:Math.max(1,w)}),T=[];for(let e=0;e{const n=C[t];return n.connect(S,0,b+t),n.start(0),[e,n.offset]})));S.connect(_);let O=g.channelInterpretation,R=null;const D=0===g.numberOfOutputs?[_]:T,M={get bufferSize(){return E},get channelCount(){return g.channelCount},set channelCount(e){throw n()},get channelCountMode(){return g.channelCountMode},set channelCountMode(e){throw n()},get channelInterpretation(){return O},set channelInterpretation(e){for(const t of A)t.channelInterpretation=e;O=e},get context(){return _.context},get inputs(){return A},get numberOfInputs(){return g.numberOfInputs},get numberOfOutputs(){return g.numberOfOutputs},get onprocessorerror(){return R},set onprocessorerror(e){"function"==typeof R&&M.removeEventListener("processorerror",R),R="function"==typeof e?e:null,"function"==typeof R&&M.addEventListener("processorerror",R)},get parameters(){return N},get port(){return x.port2},addEventListener:(...e)=>_.addEventListener(e[0],e[1],e[2]),connect:e.bind(null,D),disconnect:u.bind(null,D),dispatchEvent:(...e)=>_.dispatchEvent(e[0]),removeEventListener:(...e)=>_.removeEventListener(e[0],e[1],e[2])},B=new Map;var z,L;x.port1.addEventListener=(z=x.port1.addEventListener,(...e)=>{if("message"===e[0]){const t="function"==typeof e[1]?e[1]:"object"==typeof e[1]&&null!==e[1]&&"function"==typeof e[1].handleEvent?e[1].handleEvent:null;if(null!==t){const n=B.get(e[1]);void 0!==n?e[1]=n:(e[1]=e=>{c(p.currentTime,p.sampleRate,(()=>t(e)))},B.set(t,e[1]))}}return z.call(x.port1,e[0],e[1],e[2])}),x.port1.removeEventListener=(L=x.port1.removeEventListener,(...e)=>{if("message"===e[0]){const t=B.get(e[1]);void 0!==t&&(B.delete(e[1]),e[1]=t)}return L.call(x.port1,e[0],e[1],e[2])});let P=null;Object.defineProperty(x.port1,"onmessage",{get:()=>P,set:e=>{"function"==typeof P&&x.port1.removeEventListener("message",P),P="function"==typeof e?e:null,"function"==typeof P&&(x.port1.addEventListener("message",P),x.port1.start())}}),m.prototype.port=x.port1;let V=null;const W=((e,t,n,s)=>{let r=F.get(e);void 0===r&&(r=new WeakMap,F.set(e,r));const a=lt(n,s);return r.set(t,a),a})(p,M,m,g);W.then((e=>V=e));const U=Be(g.numberOfInputs,g.channelCount),G=Be(g.numberOfOutputs,y),q=void 0===m.parameterDescriptors?[]:m.parameterDescriptors.reduce(((e,{name:t})=>({...e,[t]:new Float32Array(128)})),{});let j=!0;const H=()=>{g.numberOfOutputs>0&&_.disconnect(I);for(let e=0,t=0;e{if(null!==V){const n=h(M);for(let s=0;s{Me(e,q,t,b+n,s)}));for(let e=0;e{if(n[t].size>0)return $.set(t,E/128),e;const s=$.get(t);return void 0===s?[]:(e.every((e=>e.every((e=>0===e))))&&(1===s?$.delete(t):$.set(t,s-1)),e)})),r=c(p.currentTime+s/p.sampleRate,p.sampleRate,(()=>V.process(e,G,q)));j=r;for(let e=0,n=0;e_.connect(X).connect(p.destination),Y=()=>{_.disconnect(X),X.disconnect()};return Z(),d(M,(()=>{if(j){Y(),g.numberOfOutputs>0&&_.connect(I);for(let e=0,t=0;e{j&&(Z(),H()),K=!1}))})(Ps,Q,Ke,Rn,ct,Ln,pt,gt,yt,Ws,Cs,Gs,Nn),js=((e,t,n,s,r)=>(a,i,o,l,u,c)=>{if(null!==o)try{const t=new o(a,l,c),s=new Map;let i=null;if(Object.defineProperties(t,{channelCount:{get:()=>c.channelCount,set:()=>{throw e()}},channelCountMode:{get:()=>"explicit",set:()=>{throw e()}},onprocessorerror:{get:()=>i,set:e=>{"function"==typeof i&&t.removeEventListener("processorerror",i),i="function"==typeof e?e:null,"function"==typeof i&&t.addEventListener("processorerror",i)}}}),t.addEventListener=(d=t.addEventListener,(...e)=>{if("processorerror"===e[0]){const t="function"==typeof e[1]?e[1]:"object"==typeof e[1]&&null!==e[1]&&"function"==typeof e[1].handleEvent?e[1].handleEvent:null;if(null!==t){const n=s.get(e[1]);void 0!==n?e[1]=n:(e[1]=n=>{"error"===n.type?(Object.defineProperties(n,{type:{value:"processorerror"}}),t(n)):t(new ErrorEvent(e[0],{...n}))},s.set(t,e[1]))}}return d.call(t,"error",e[1],e[2]),d.call(t,...e)}),t.removeEventListener=(h=t.removeEventListener,(...e)=>{if("processorerror"===e[0]){const t=s.get(e[1]);void 0!==t&&(s.delete(e[1]),e[1]=t)}return h.call(t,"error",e[1],e[2]),h.call(t,e[0],e[1],e[2])}),0!==c.numberOfOutputs){const e=n(a,{channelCount:1,channelCountMode:"explicit",channelInterpretation:"discrete",gain:0});t.connect(e).connect(a.destination);return r(t,(()=>e.disconnect()),(()=>e.connect(a.destination)))}return t}catch(e){if(11===e.code)throw s();throw e}var h,d;if(void 0===u)throw s();return(e=>{const{port1:t}=new MessageChannel;try{t.postMessage(e)}finally{t.close()}})(c),t(a,i,u,c)})(Ke,qs,pt,yt,Nn),Hs=((e,t,n,s,r,a,i,o,l,u,c,h,d,p,f,m)=>(g,y,b)=>{const w=new WeakMap;let v=null;return{render(x,A){o(A,x);const k=w.get(A);return void 0!==k?Promise.resolve(k):(async(o,x)=>{let A=c(o),k=null;const C=Z(A,x),S=Array.isArray(y.outputChannelCount)?y.outputChannelCount:Array.from(y.outputChannelCount);if(null===h){const e=S.reduce(((e,t)=>e+t),0),n=r(x,{channelCount:Math.max(1,e),channelCountMode:"explicit",channelInterpretation:"discrete",numberOfOutputs:Math.max(1,e)}),a=[];for(let e=0;e{const l=new d(n,128*Math.ceil(o.context.length/128),x.sampleRate),u=[],c=[];for(let e=0;e{const t=a(l,{channelCount:1,channelCountMode:"explicit",channelInterpretation:"discrete",offset:e.value});return await p(l,e,t.offset),t}))),g=s(l,{channelCount:1,channelCountMode:"explicit",channelInterpretation:"speakers",numberOfInputs:Math.max(1,e+t)});for(let e=0;ef(o,l,e)))),m(l)};v=ze(o,0===n?null:await l(),x,y,S,b,u)}const e=await v,t=n(x,{buffer:null,channelCount:2,channelCountMode:"max",channelInterpretation:"speakers",loop:!1,loopEnd:0,loopStart:0,playbackRate:1}),[l,c,h]=k;null!==e&&(t.buffer=e,t.start(0)),t.connect(l);for(let e=0,t=0;et=>e.get(t))(Ss),Ks=(e=>(t,n)=>{e.set(t,n)})(Us),Xs=ks?((e,t,n,s,r,a,i,o,l,u,c,h,d,p)=>class extends t{constructor(t,p,f){var m;const g=o(t),y=l(g),b=c({...De,...f});d(b);const w=M.get(g),v=null==w?void 0:w.get(p),x=y||"closed"!==g.state?g:null!==(m=i(g))&&void 0!==m?m:g,A=r(x,y?null:t.baseLatency,u,p,v,b);super(t,!0,A,y?s(p,b,v):null);const k=[];A.parameters.forEach(((e,t)=>{const s=n(this,y,e);k.push([t,s])})),this._nativeAudioWorkletNode=A,this._onprocessorerror=null,this._parameters=new Re(k),y&&e(g,this);const{activeInputs:C}=a(this);h(A,C)}get onprocessorerror(){return this._onprocessorerror}set onprocessorerror(e){const t="function"==typeof e?p(this,e):null;this._nativeAudioWorkletNode.onprocessorerror=t;const n=this._nativeAudioWorkletNode.onprocessorerror;this._onprocessorerror=null!==n&&n===t?e:n}get parameters(){return null===this._parameters?this._nativeAudioWorkletNode.parameters:this._parameters}get port(){return this._nativeAudioWorkletNode.port}})(Ls,on,kn,Hs,js,ae,$s,Xt,Qt,an,(e=>({...e,outputChannelCount:void 0!==e.outputChannelCount?e.outputChannelCount:1===e.numberOfInputs&&1===e.numberOfOutputs?[e.channelCount]:Array.from({length:e.numberOfOutputs},(()=>1))})),Ks,(e=>{const{port1:t,port2:n}=new MessageChannel;try{t.postMessage(e)}finally{t.close(),n.close()}}),Ft):void 0,Zs=(((e,t,n,s,r)=>{})(Ke,yt,kt,rs,tn),((e,t)=>(n,s,r)=>{if(null===t)throw new Error("Missing the native OfflineAudioContext constructor.");try{return new t(n,s,r)}catch(t){if("SyntaxError"===t.name)throw e();throw t}})(yt,Yt)),Ys=((e,t,n,s,r,a,i,o)=>(l,u)=>n(l).render(l,u).then((()=>Promise.all(Array.from(s(u)).map((e=>n(e).render(e,u)))))).then((()=>r(u))).then((n=>("function"!=typeof n.copyFromChannel?(i(n),J(n)):t(a,(()=>a(n)))||o(n),e.add(n),n))))(cn,Wt,Ht,zs,Qn,Y,fn,mn),Qs=(((e,t,n,s,r)=>{})(Wt,Ke,Zs,rs,Ys),((e,t,n,s,r)=>class extends e{constructor(e,n,r){let a;if("number"==typeof e&&void 0!==n&&void 0!==r)a={length:n,numberOfChannels:e,sampleRate:r};else{if("object"!=typeof e)throw new Error("The given parameters are not valid.");a=e}const{length:i,numberOfChannels:o,sampleRate:l}={...bt,...a},u=s(o,i,l);t(Je,(()=>Je(u)))||u.addEventListener("statechange",(()=>{let e=0;const t=n=>{"running"===this._state&&(e>0?(u.removeEventListener("statechange",t),n.stopImmediatePropagation(),this._waitForThePromiseToSettle(n)):e+=1)};return t})()),super(u,o),this._length=i,this._nativeOfflineAudioContext=u,this._state=null}get length(){return void 0===this._nativeOfflineAudioContext.length?this._length:this._nativeOfflineAudioContext.length}get state(){return null===this._state?this._nativeOfflineAudioContext.state:this._state}startRendering(){return"running"===this._state?Promise.reject(n()):(this._state="running",r(this.destination,this._nativeOfflineAudioContext).finally((()=>{this._state=null,le(this)})))}_waitForThePromiseToSettle(e){null===this._state?this._nativeOfflineAudioContext.dispatchEvent(e):setTimeout((()=>this._waitForThePromiseToSettle(e)))}})(Ns,Wt,Ke,Zs,Ys)),Js=((e,t)=>n=>{const s=e.get(n);return t(s)||t(n)})(O,nn),er=((e,t)=>n=>e.has(n)||t(n))(I,sn),tr=((e,t)=>n=>e.has(n)||t(n))(N,rn),nr=((e,t)=>n=>{const s=e.get(n);return t(s)||t(n)})(O,Qt),sr=()=>(async(e,t,n,s,r,a,i,o,l,u,c,h,d,p,f,m)=>{if(e(t,t)&&e(n,n)&&e(r,r)&&e(a,a)&&e(o,o)&&e(l,l)&&e(u,u)&&e(c,c)&&e(h,h)&&e(d,d)&&e(p,p))return(await Promise.all([e(s,s),e(i,i),e(f,f),e(m,m)])).every((e=>e));return!1})(Wt,(e=>()=>{if(null===e)return!1;const t=new e(1,1,44100).createBuffer(1,1,44100);if(void 0===t.copyToChannel)return!0;const n=new Float32Array(2);try{t.copyFromChannel(n,0,0)}catch{return!1}return!0})(Yt),(e=>()=>{if(null===e)return!1;if(void 0!==e.prototype&&void 0!==e.prototype.close)return!0;const t=new e,n=void 0!==t.close;try{t.close()}catch{}return n})(tn),(e=>()=>{if(null===e)return Promise.resolve(!1);const t=new e(1,1,44100);return new Promise((e=>{let n=!0;const s=s=>{n&&(n=!1,t.startRendering(),e(s instanceof TypeError))};let r;try{r=t.decodeAudioData(null,(()=>{}),s)}catch(e){s(e)}void 0!==r&&r.catch(s)}))})(Yt),(e=>()=>{if(null===e)return!1;let t;try{t=new e({latencyHint:"balanced"})}catch{return!1}return t.close(),!0})(tn),(e=>()=>{if(null===e)return!1;const t=new e(1,1,44100).createGain(),n=t.connect(t)===t;return t.disconnect(t),n})(Yt),((e,t)=>async()=>{if(null===e)return!0;if(null===t)return!1;const n=new Blob(['let c,p;class A extends AudioWorkletProcessor{constructor(){super();this.port.onmessage=(e)=>{p=e.data;p.onmessage=()=>{p.postMessage(c);p.close()};this.port.postMessage(0)}}process(){c=1}}registerProcessor("a",A)'],{type:"application/javascript; charset=utf-8"}),s=new MessageChannel,r=new t(1,128,44100),a=URL.createObjectURL(n);let i=!1;try{await r.audioWorklet.addModule(a);const t=new e(r,"a",{numberOfOutputs:0}),n=r.createOscillator();await new Promise((e=>{t.port.onmessage=()=>e(),t.port.postMessage(s.port2,[s.port2])})),t.port.onmessage=()=>i=!0,n.connect(t),n.start(0),await r.startRendering(),i=await new Promise((e=>{s.port1.onmessage=({data:t})=>e(1===t),s.port1.postMessage(0)}))}catch{}finally{s.port1.close(),URL.revokeObjectURL(a)}return i})(an,Yt),(e=>()=>{if(null===e)return!1;const t=new e(1,1,44100).createChannelMerger();if("max"===t.channelCountMode)return!0;try{t.channelCount=2}catch{return!0}return!1})(Yt),(e=>()=>{if(null===e)return!1;const t=new e(1,1,44100);return void 0===t.createConstantSource||t.createConstantSource().offset.maxValue!==Number.POSITIVE_INFINITY})(Yt),(e=>()=>{if(null===e)return!1;const t=new e(1,1,44100),n=t.createConvolver();n.buffer=t.createBuffer(1,1,t.sampleRate);try{n.buffer=t.createBuffer(1,1,t.sampleRate)}catch{return!1}return!0})(Yt),(e=>()=>{if(null===e)return!1;const t=new e(1,1,44100).createConvolver();try{t.channelCount=1}catch{return!1}return!0})(Yt),Rt,(e=>()=>null!==e&&e.hasOwnProperty("isSecureContext"))(qt),(e=>()=>{if(null===e)return!1;const t=new e;try{return t.createMediaStreamSource(new MediaStream),!1}catch(e){return!0}finally{t.close()}})(tn),(e=>()=>{if(null===e)return Promise.resolve(!1);const t=new e(1,1,44100);if(void 0===t.createStereoPanner)return Promise.resolve(!0);if(void 0===t.createConstantSource)return Promise.resolve(!0);const n=t.createConstantSource(),s=t.createStereoPanner();return n.channelCount=1,n.offset.value=1,s.channelCount=1,n.start(),n.connect(s).connect(t.destination),t.startRendering().then((e=>1!==e.getChannelData(0)[0]))})(Yt),Dt);function rr(e,t){if(!e)throw new Error(t)}function ar(e,t,n=1/0){if(!(t<=e&&e<=n))throw new RangeError(`Value must be within [${t}, ${n}], got: ${e}`)}function ir(e){e.isOffline||"running"===e.state||cr('The AudioContext is "suspended". Invoke Tone.start() from a user action to start the audio.')}let or=console;function lr(e){or=e}function ur(...e){or.log(...e)}function cr(...e){or.warn(...e)}function hr(e){return void 0===e}function dr(e){return!hr(e)}function pr(e){return"function"==typeof e}function fr(e){return"number"==typeof e}function mr(e){return"[object Object]"===Object.prototype.toString.call(e)&&e.constructor===Object}function gr(e){return"boolean"==typeof e}function yr(e){return Array.isArray(e)}function br(e){return"string"==typeof e}function wr(e){return br(e)&&/^([a-g]{1}(?:b|#|x|bb)?)(-?[0-9]+)/i.test(e)}const vr="object"==typeof self?self:null,xr=vr&&(vr.hasOwnProperty("AudioContext")||vr.hasOwnProperty("webkitAudioContext"));function Ar(e,t,n,s){var r,a=arguments.length,i=a<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,n):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)i=Reflect.decorate(e,t,n,s);else for(var o=e.length-1;o>=0;o--)(r=e[o])&&(i=(a<3?r(i):a>3?r(t,n,i):r(t,n))||i);return a>3&&i&&Object.defineProperty(t,n,i),i}function kr(e,t,n,s){return new(n||(n=Promise))((function(r,a){function i(e){try{l(s.next(e))}catch(e){a(e)}}function o(e){try{l(s.throw(e))}catch(e){a(e)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(i,o)}l((s=s.apply(e,t||[])).next())}))}Object.create;Object.create;"function"==typeof SuppressedError&&SuppressedError;class Cr{constructor(e,t,n){this._callback=e,this._type=t,this._updateInterval=n,this._createClock()}_createWorker(){const e=new Blob([`\n\t\t\t// the initial timeout time\n\t\t\tlet timeoutTime = ${(1e3*this._updateInterval).toFixed(1)};\n\t\t\t// onmessage callback\n\t\t\tself.onmessage = function(msg){\n\t\t\t\ttimeoutTime = parseInt(msg.data);\n\t\t\t};\n\t\t\t// the tick function which posts a message\n\t\t\t// and schedules a new tick\n\t\t\tfunction tick(){\n\t\t\t\tsetTimeout(tick, timeoutTime);\n\t\t\t\tself.postMessage('tick');\n\t\t\t}\n\t\t\t// call tick initially\n\t\t\ttick();\n\t\t\t`],{type:"text/javascript"}),t=URL.createObjectURL(e),n=new Worker(t);n.onmessage=this._callback.bind(this),this._worker=n}_createTimeout(){this._timeout=setTimeout((()=>{this._createTimeout(),this._callback()}),1e3*this._updateInterval)}_createClock(){if("worker"===this._type)try{this._createWorker()}catch(e){this._type="timeout",this._createClock()}else"timeout"===this._type&&this._createTimeout()}_disposeClock(){this._timeout&&(clearTimeout(this._timeout),this._timeout=0),this._worker&&(this._worker.terminate(),this._worker.onmessage=null)}get updateInterval(){return this._updateInterval}set updateInterval(e){this._updateInterval=Math.max(e,128/44100),"worker"===this._type&&this._worker.postMessage(Math.max(1e3*e,1))}get type(){return this._type}set type(e){this._disposeClock(),this._type=e,this._createClock()}dispose(){this._disposeClock()}}function Sr(e){return tr(e)}function Er(e){return er(e)}function _r(e){return nr(e)}function Ir(e){return Js(e)}function Tr(e){return e instanceof AudioBuffer}function Nr(e,t){return"value"===e||Sr(t)||Er(t)||Tr(t)}function Or(e,...t){if(!t.length)return e;const n=t.shift();if(mr(e)&&mr(n))for(const t in n)Nr(t,n[t])?e[t]=n[t]:mr(n[t])?(e[t]||Object.assign(e,{[t]:{}}),Or(e[t],n[t])):Object.assign(e,{[t]:n[t]});return Or(e,...t)}function Rr(e,t,n=[],s){const r={},a=Array.from(t);if(mr(a[0])&&s&&!Reflect.has(a[0],s)){Object.keys(a[0]).some((t=>Reflect.has(e,t)))||(Or(r,{[s]:a[0]}),n.splice(n.indexOf(s),1),a.shift())}if(1===a.length&&mr(a[0]))Or(r,a[0]);else for(let e=0;e{Reflect.has(e,t)&&delete e[t]})),e}class Fr{constructor(){this.debug=!1,this._wasDisposed=!1}static getDefaults(){return{}}log(...e){(this.debug||vr&&this.toString()===vr.TONE_DEBUG_CLASS)&&ur(this,...e)}dispose(){return this._wasDisposed=!0,this}get disposed(){return this._wasDisposed}toString(){return this.name}}Fr.version=a;const Br=1e-6;function zr(e,t){return e>t+Br}function Lr(e,t){return zr(e,t)||Vr(e,t)}function Pr(e,t){return e+Brthis.memory){const e=this.length-this.memory;this._timeline.splice(0,e)}return this}remove(e){const t=this._timeline.indexOf(e);return-1!==t&&this._timeline.splice(t,1),this}get(e,t="time"){const n=this._search(e,t);return-1!==n?this._timeline[n]:null}peek(){return this._timeline[0]}shift(){return this._timeline.shift()}getAfter(e,t="time"){const n=this._search(e,t);return n+10&&this._timeline[t-1].time=0?this._timeline[n-1]:null}cancel(e){if(this._timeline.length>1){let t=this._search(e);if(t>=0)if(Vr(this._timeline[t].time,e)){for(let n=t;n>=0&&Vr(this._timeline[n].time,e);n--)t=n;this._timeline=this._timeline.slice(0,t)}else this._timeline=this._timeline.slice(0,t+1);else this._timeline=[]}else 1===this._timeline.length&&Lr(this._timeline[0].time,e)&&(this._timeline=[]);return this}cancelBefore(e){const t=this._search(e);return t>=0&&(this._timeline=this._timeline.slice(t+1)),this}previousEvent(e){const t=this._timeline.indexOf(e);return t>0?this._timeline[t-1]:null}_search(e,t="time"){if(0===this._timeline.length)return-1;let n=0;const s=this._timeline.length;let r=s;if(s>0&&this._timeline[s-1][t]<=e)return s-1;for(;n=0&&this._timeline[n].time>=e;)n--;return this._iterate(t,n+1),this}forEachAtTime(e,t){const n=this._search(e);if(-1!==n&&Vr(this._timeline[n].time,e)){let s=n;for(let t=n;t>=0&&Vr(this._timeline[t].time,e);t--)s=t;this._iterate((e=>{t(e)}),s,n)}return this}dispose(){return super.dispose(),this._timeline=[],this}}const Gr=[];function qr(e){Gr.push(e)}const jr=[];function Hr(e){jr.push(e)}class $r extends Fr{constructor(){super(...arguments),this.name="Emitter"}on(e,t){return e.split(/\W+/).forEach((e=>{hr(this._events)&&(this._events={}),this._events.hasOwnProperty(e)||(this._events[e]=[]),this._events[e].push(t)})),this}once(e,t){const n=(...s)=>{t(...s),this.off(e,n)};return this.on(e,n),this}off(e,t){return e.split(/\W+/).forEach((n=>{if(hr(this._events)&&(this._events={}),this._events.hasOwnProperty(e))if(hr(t))this._events[e]=[];else{const n=this._events[e];for(let e=n.length-1;e>=0;e--)n[e]===t&&n.splice(e,1)}})),this}emit(e,...t){if(this._events&&this._events.hasOwnProperty(e)){const n=this._events[e].slice(0);for(let e=0,s=n.length;e{const n=Object.getOwnPropertyDescriptor($r.prototype,t);Object.defineProperty(e.prototype,t,n)}))}dispose(){return super.dispose(),this._events=void 0,this}}class Kr extends $r{constructor(){super(...arguments),this.isOffline=!1}toJSON(){return{}}}class Xr extends Kr{constructor(){super(),this.name="Context",this._constants=new Map,this._timeouts=new Ur,this._timeoutIds=0,this._initialized=!1,this.isOffline=!1,this._workletModules=new Map;const e=Rr(Xr.getDefaults(),arguments,["context"]);e.context?this._context=e.context:this._context=function(e){return new Bs(e)}({latencyHint:e.latencyHint}),this._ticker=new Cr(this.emit.bind(this,"tick"),e.clockSource,e.updateInterval),this.on("tick",this._timeoutLoop.bind(this)),this._context.onstatechange=()=>{this.emit("statechange",this.state)},this._setLatencyHint(e.latencyHint),this.lookAhead=e.lookAhead}static getDefaults(){return{clockSource:"worker",latencyHint:"interactive",lookAhead:.1,updateInterval:.05}}initialize(){var e;return this._initialized||(e=this,Gr.forEach((t=>t(e))),this._initialized=!0),this}createAnalyser(){return this._context.createAnalyser()}createOscillator(){return this._context.createOscillator()}createBufferSource(){return this._context.createBufferSource()}createBiquadFilter(){return this._context.createBiquadFilter()}createBuffer(e,t,n){return this._context.createBuffer(e,t,n)}createChannelMerger(e){return this._context.createChannelMerger(e)}createChannelSplitter(e){return this._context.createChannelSplitter(e)}createConstantSource(){return this._context.createConstantSource()}createConvolver(){return this._context.createConvolver()}createDelay(e){return this._context.createDelay(e)}createDynamicsCompressor(){return this._context.createDynamicsCompressor()}createGain(){return this._context.createGain()}createIIRFilter(e,t){return this._context.createIIRFilter(e,t)}createPanner(){return this._context.createPanner()}createPeriodicWave(e,t,n){return this._context.createPeriodicWave(e,t,n)}createStereoPanner(){return this._context.createStereoPanner()}createWaveShaper(){return this._context.createWaveShaper()}createMediaStreamSource(e){rr(Ir(this._context),"Not available if OfflineAudioContext");return this._context.createMediaStreamSource(e)}createMediaElementSource(e){rr(Ir(this._context),"Not available if OfflineAudioContext");return this._context.createMediaElementSource(e)}createMediaStreamDestination(){rr(Ir(this._context),"Not available if OfflineAudioContext");return this._context.createMediaStreamDestination()}decodeAudioData(e){return this._context.decodeAudioData(e)}get currentTime(){return this._context.currentTime}get state(){return this._context.state}get sampleRate(){return this._context.sampleRate}get listener(){return this.initialize(),this._listener}set listener(e){rr(!this._initialized,"The listener cannot be set after initialization."),this._listener=e}get transport(){return this.initialize(),this._transport}set transport(e){rr(!this._initialized,"The transport cannot be set after initialization."),this._transport=e}get draw(){return this.initialize(),this._draw}set draw(e){rr(!this._initialized,"Draw cannot be set after initialization."),this._draw=e}get destination(){return this.initialize(),this._destination}set destination(e){rr(!this._initialized,"The destination cannot be set after initialization."),this._destination=e}createAudioWorkletNode(e,t){return function(e,t,n){return rr(dr(Xs),"This node only works in a secure context (https or localhost)"),new Xs(e,t,n)}(this.rawContext,e,t)}addAudioWorkletModule(e,t){return kr(this,void 0,void 0,(function*(){rr(dr(this.rawContext.audioWorklet),"AudioWorkletNode is only available in a secure context (https or localhost)"),this._workletModules.has(t)||this._workletModules.set(t,this.rawContext.audioWorklet.addModule(e)),yield this._workletModules.get(t)}))}workletsAreReady(){return kr(this,void 0,void 0,(function*(){const e=[];this._workletModules.forEach((t=>e.push(t))),yield Promise.all(e)}))}get updateInterval(){return this._ticker.updateInterval}set updateInterval(e){this._ticker.updateInterval=e}get clockSource(){return this._ticker.type}set clockSource(e){this._ticker.type=e}get latencyHint(){return this._latencyHint}_setLatencyHint(e){let t=0;if(this._latencyHint=e,br(e))switch(e){case"interactive":t=.1;break;case"playback":t=.5;break;case"balanced":t=.25}this.lookAhead=t,this.updateInterval=t/2}get rawContext(){return this._context}now(){return this._context.currentTime+this.lookAhead}immediate(){return this._context.currentTime}resume(){return Ir(this._context)?this._context.resume():Promise.resolve()}close(){return kr(this,void 0,void 0,(function*(){var e;Ir(this._context)&&(yield this._context.close()),this._initialized&&(e=this,jr.forEach((t=>t(e))))}))}getConstant(e){if(this._constants.has(e))return this._constants.get(e);{const t=this._context.createBuffer(1,128,this._context.sampleRate),n=t.getChannelData(0);for(let t=0;tthis._constants[e].disconnect())),this}_timeoutLoop(){const e=this.now();let t=this._timeouts.peek();for(;this._timeouts.length&&t&&t.time<=e;)t.callback(),this._timeouts.shift(),t=this._timeouts.peek()}setTimeout(e,t){this._timeoutIds++;const n=this.now();return this._timeouts.add({callback:e,id:this._timeoutIds,time:n+t}),this._timeoutIds}clearTimeout(e){return this._timeouts.forEach((t=>{t.id===e&&this._timeouts.remove(t)})),this}clearInterval(e){return this.clearTimeout(e)}setInterval(e,t){const n=++this._timeoutIds,s=()=>{const r=this.now();this._timeouts.add({callback:()=>{e(),s()},id:n,time:r+t})};return s(),n}}function Zr(e,t){yr(t)?t.forEach((t=>Zr(e,t))):Object.defineProperty(e,t,{enumerable:!0,writable:!1})}function Yr(e,t){yr(t)?t.forEach((t=>Yr(e,t))):Object.defineProperty(e,t,{writable:!0})}const Qr=()=>{};class Jr extends Fr{constructor(){super(),this.name="ToneAudioBuffer",this.onload=Qr;const e=Rr(Jr.getDefaults(),arguments,["url","onload","onerror"]);this.reverse=e.reverse,this.onload=e.onload,e.url&&Tr(e.url)||e.url instanceof Jr?this.set(e.url):br(e.url)&&this.load(e.url).catch(e.onerror)}static getDefaults(){return{onerror:Qr,onload:Qr,reverse:!1}}get sampleRate(){return this._buffer?this._buffer.sampleRate:sa().sampleRate}set(e){return e instanceof Jr?e.loaded?this._buffer=e.get():e.onload=()=>{this.set(e),this.onload(this)}:this._buffer=e,this._reversed&&this._reverse(),this}get(){return this._buffer}load(e){return kr(this,void 0,void 0,(function*(){const t=Jr.load(e).then((e=>{this.set(e),this.onload(this)}));Jr.downloads.push(t);try{yield t}finally{const e=Jr.downloads.indexOf(t);Jr.downloads.splice(e,1)}return this}))}dispose(){return super.dispose(),this._buffer=void 0,this}fromArray(e){const t=yr(e)&&e[0].length>0,n=t?e.length:1,s=t?e[0].length:e.length,r=sa(),a=r.createBuffer(n,s,r.sampleRate),i=t||1!==n?e:[e];for(let e=0;ee/t)),this.fromArray(e)}return this}toArray(e){if(fr(e))return this.getChannelData(e);if(1===this.numberOfChannels)return this.toArray(0);{const e=[];for(let t=0;t0}get duration(){return this._buffer?this._buffer.duration:0}get length(){return this._buffer?this._buffer.length:0}get numberOfChannels(){return this._buffer?this._buffer.numberOfChannels:0}get reverse(){return this._reversed}set reverse(e){this._reversed!==e&&(this._reversed=e,this._reverse())}static fromArray(e){return(new Jr).fromArray(e)}static fromUrl(e){return kr(this,void 0,void 0,(function*(){const t=new Jr;return yield t.load(e)}))}static load(e){return kr(this,void 0,void 0,(function*(){const t=e.match(/\[([^\]\[]+\|.+)\]$/);if(t){const n=t[1].split("|");let s=n[0];for(const e of n)if(Jr.supportsType(e)){s=e;break}e=e.replace(t[0],s)}const n=""===Jr.baseUrl||Jr.baseUrl.endsWith("/")?Jr.baseUrl:Jr.baseUrl+"/",s=yield fetch(n+e);if(!s.ok)throw new Error(`could not load url: ${e}`);const r=yield s.arrayBuffer();return yield sa().decodeAudioData(r)}))}static supportsType(e){const t=e.split("."),n=t[t.length-1];return""!==document.createElement("audio").canPlayType("audio/"+n)}static loaded(){return kr(this,void 0,void 0,(function*(){for(yield Promise.resolve();Jr.downloads.length;)yield Jr.downloads[0]}))}}Jr.baseUrl="",Jr.downloads=[];class ea extends Xr{constructor(){var e,t,n;super({clockSource:"offline",context:_r(arguments[0])?arguments[0]:(e=arguments[0],t=arguments[1]*arguments[2],n=arguments[2],new Qs(e,t,n)),lookAhead:0,updateInterval:_r(arguments[0])?128/arguments[0].sampleRate:128/arguments[2]}),this.name="OfflineContext",this._currentTime=0,this.isOffline=!0,this._duration=_r(arguments[0])?arguments[0].length/arguments[0].sampleRate:arguments[1]}now(){return this._currentTime}get currentTime(){return this._currentTime}_renderClock(e){return kr(this,void 0,void 0,(function*(){let t=0;for(;this._duration-this._currentTime>=0;){this.emit("tick"),this._currentTime+=128/this.sampleRate,t++;const n=Math.floor(this.sampleRate/128);e&&t%n==0&&(yield new Promise((e=>setTimeout(e,1))))}}))}render(e=!0){return kr(this,void 0,void 0,(function*(){yield this.workletsAreReady(),yield this._renderClock(e);const t=yield this._context.startRendering();return new Jr(t)}))}close(){return Promise.resolve()}}const ta=new class extends Kr{constructor(){super(...arguments),this.lookAhead=0,this.latencyHint=0,this.isOffline=!1}createAnalyser(){return{}}createOscillator(){return{}}createBufferSource(){return{}}createBiquadFilter(){return{}}createBuffer(e,t,n){return{}}createChannelMerger(e){return{}}createChannelSplitter(e){return{}}createConstantSource(){return{}}createConvolver(){return{}}createDelay(e){return{}}createDynamicsCompressor(){return{}}createGain(){return{}}createIIRFilter(e,t){return{}}createPanner(){return{}}createPeriodicWave(e,t,n){return{}}createStereoPanner(){return{}}createWaveShaper(){return{}}createMediaStreamSource(e){return{}}createMediaElementSource(e){return{}}createMediaStreamDestination(){return{}}decodeAudioData(e){return Promise.resolve({})}createAudioWorkletNode(e,t){return{}}get rawContext(){return{}}addAudioWorkletModule(e,t){return kr(this,void 0,void 0,(function*(){return Promise.resolve()}))}resume(){return Promise.resolve()}setTimeout(e,t){return 0}clearTimeout(e){return this}setInterval(e,t){return 0}clearInterval(e){return this}getConstant(e){return{}}get currentTime(){return 0}get state(){return{}}get sampleRate(){return 0}get listener(){return{}}get transport(){return{}}get draw(){return{}}set draw(e){}get destination(){return{}}set destination(e){}now(){return 0}immediate(){return 0}};let na=ta;function sa(){return na===ta&&xr&&ra(new Xr),na}function ra(e){na=Ir(e)?new Xr(e):_r(e)?new ea(e):e}function aa(){return na.resume()}if(vr&&!vr.TONE_SILENCE_LOGGING){let e="v";"dev"===a&&(e="")}function ia(e){return Math.pow(10,e/20)}function oa(e){return Math.log(e)/Math.LN10*20}function la(e){return Math.pow(2,e/12)}let ua=440;function ca(e){return Math.round(ha(e))}function ha(e){return 69+12*Math.log2(e/ua)}function da(e){return ua*Math.pow(2,(e-69)/12)}class pa extends Fr{constructor(e,t,n){super(),this.defaultUnits="s",this._val=t,this._units=n,this.context=e,this._expressions=this._getExpressions()}_getExpressions(){return{hz:{method:e=>this._frequencyToUnits(parseFloat(e)),regexp:/^(\d+(?:\.\d+)?)hz$/i},i:{method:e=>this._ticksToUnits(parseInt(e,10)),regexp:/^(\d+)i$/i},m:{method:e=>this._beatsToUnits(parseInt(e,10)*this._getTimeSignature()),regexp:/^(\d+)m$/i},n:{method:(e,t)=>{const n=parseInt(e,10),s="."===t?1.5:1;return 1===n?this._beatsToUnits(this._getTimeSignature())*s:this._beatsToUnits(4/n)*s},regexp:/^(\d+)n(\.?)$/i},number:{method:e=>this._expressions[this.defaultUnits].method.call(this,e),regexp:/^(\d+(?:\.\d+)?)$/},s:{method:e=>this._secondsToUnits(parseFloat(e)),regexp:/^(\d+(?:\.\d+)?)s$/},samples:{method:e=>parseInt(e,10)/this.context.sampleRate,regexp:/^(\d+)samples$/},t:{method:e=>{const t=parseInt(e,10);return this._beatsToUnits(8/(3*Math.floor(t)))},regexp:/^(\d+)t$/i},tr:{method:(e,t,n)=>{let s=0;return e&&"0"!==e&&(s+=this._beatsToUnits(this._getTimeSignature()*parseFloat(e))),t&&"0"!==t&&(s+=this._beatsToUnits(parseFloat(t))),n&&"0"!==n&&(s+=this._beatsToUnits(parseFloat(n)/4)),s},regexp:/^(\d+(?:\.\d+)?):(\d+(?:\.\d+)?):?(\d+(?:\.\d+)?)?$/}}}valueOf(){if(this._val instanceof pa&&this.fromType(this._val),hr(this._val))return this._noArg();if(br(this._val)&&hr(this._units)){for(const e in this._expressions)if(this._expressions[e].regexp.test(this._val.trim())){this._units=e;break}}else if(mr(this._val)){let e=0;for(const t in this._val)if(dr(this._val[t])){const n=this._val[t];e+=new this.constructor(this.context,t).valueOf()*n}return e}if(dr(this._units)){const e=this._expressions[this._units],t=this._val.toString().trim().match(e.regexp);return t?e.method.apply(this,t.slice(1)):e.method.call(this,this._val)}return br(this._val)?parseFloat(this._val):this._val}_frequencyToUnits(e){return 1/e}_beatsToUnits(e){return 60/this._getBpm()*e}_secondsToUnits(e){return e}_ticksToUnits(e){return e*this._beatsToUnits(1)/this._getPPQ()}_noArg(){return this._now()}_getBpm(){return this.context.transport.bpm.value}_getTimeSignature(){return this.context.transport.timeSignature}_getPPQ(){return this.context.transport.PPQ}fromType(e){switch(this._units=void 0,this.defaultUnits){case"s":this._val=e.toSeconds();break;case"i":this._val=e.toTicks();break;case"hz":this._val=e.toFrequency();break;case"midi":this._val=e.toMidi()}return this}toFrequency(){return 1/this.toSeconds()}toSamples(){return this.toSeconds()*this.context.sampleRate}toMilliseconds(){return 1e3*this.toSeconds()}}class fa extends pa{constructor(){super(...arguments),this.name="TimeClass"}_getExpressions(){return Object.assign(super._getExpressions(),{now:{method:e=>this._now()+new this.constructor(this.context,e).valueOf(),regexp:/^\+(.+)/},quantize:{method:e=>{const t=new fa(this.context,e).valueOf();return this._secondsToUnits(this.context.transport.nextSubdivision(t))},regexp:/^@(.+)/}})}quantize(e,t=1){const n=new this.constructor(this.context,e).valueOf(),s=this.valueOf();return s+(Math.round(s/n)*n-s)*t}toNotation(){const e=this.toSeconds(),t=["1m"];for(let e=1;e<9;e++){const n=Math.pow(2,e);t.push(n+"n."),t.push(n+"n"),t.push(n+"t")}t.push("0");let n=t[0],s=new fa(this.context,t[0]).toSeconds();return t.forEach((t=>{const r=new fa(this.context,t).toSeconds();Math.abs(r-e)3&&(s=parseFloat(parseFloat(r).toFixed(3)));return[n,t,s].join(":")}toTicks(){const e=this._beatsToUnits(1),t=this.valueOf()/e;return Math.round(t*this._getPPQ())}toSeconds(){return this.valueOf()}toMidi(){return ca(this.toFrequency())}_now(){return this.context.now()}}function ma(e,t){return new fa(sa(),e,t)}class ga extends fa{constructor(){super(...arguments),this.name="Frequency",this.defaultUnits="hz"}static get A4(){return ua}static set A4(e){!function(e){ua=e}(e)}_getExpressions(){return Object.assign({},super._getExpressions(),{midi:{regexp:/^(\d+(?:\.\d+)?midi)/,method(e){return"midi"===this.defaultUnits?e:ga.mtof(e)}},note:{regexp:/^([a-g]{1}(?:b|#|x|bb)?)(-?[0-9]+)/i,method(e,t){const n=ya[e.toLowerCase()]+12*(parseInt(t,10)+1);return"midi"===this.defaultUnits?n:ga.mtof(n)}},tr:{regexp:/^(\d+(?:\.\d+)?):(\d+(?:\.\d+)?):?(\d+(?:\.\d+)?)?/,method(e,t,n){let s=1;return e&&"0"!==e&&(s*=this._beatsToUnits(this._getTimeSignature()*parseFloat(e))),t&&"0"!==t&&(s*=this._beatsToUnits(parseFloat(t))),n&&"0"!==n&&(s*=this._beatsToUnits(parseFloat(n)/4)),s}}})}transpose(e){return new ga(this.context,this.valueOf()*la(e))}harmonize(e){return e.map((e=>this.transpose(e)))}toMidi(){return ca(this.valueOf())}toNote(){const e=this.toFrequency(),t=Math.log2(e/ga.A4);let n=Math.round(12*t)+57;const s=Math.floor(n/12);s<0&&(n+=-12*s);return ba[n%12]+s.toString()}toSeconds(){return 1/super.toSeconds()}toTicks(){const e=this._beatsToUnits(1),t=this.valueOf()/e;return Math.floor(t*this._getPPQ())}_noArg(){return 0}_frequencyToUnits(e){return e}_ticksToUnits(e){return 1/(60*e/(this._getBpm()*this._getPPQ()))}_beatsToUnits(e){return 1/super._beatsToUnits(e)}_secondsToUnits(e){return 1/e}static mtof(e){return da(e)}static ftom(e){return ca(e)}}const ya={cbb:-2,cb:-1,c:0,"c#":1,cx:2,dbb:0,db:1,d:2,"d#":3,dx:4,ebb:2,eb:3,e:4,"e#":5,ex:6,fbb:3,fb:4,f:5,"f#":6,fx:7,gbb:5,gb:6,g:7,"g#":8,gx:9,abb:7,ab:8,a:9,"a#":10,ax:11,bbb:9,bb:10,b:11,"b#":12,bx:13},ba=["C","C#","D","D#","E","F","F#","G","G#","A","A#","B"];function wa(e,t){return new ga(sa(),e,t)}class va extends fa{constructor(){super(...arguments),this.name="TransportTime"}_now(){return this.context.transport.seconds}}function xa(e,t){return new va(sa(),e,t)}class Aa extends Fr{constructor(){super();const e=Rr(Aa.getDefaults(),arguments,["context"]);this.defaultContext?this.context=this.defaultContext:this.context=e.context}static getDefaults(){return{context:sa()}}now(){return this.context.currentTime+this.context.lookAhead}immediate(){return this.context.currentTime}get sampleTime(){return 1/this.context.sampleRate}get blockTime(){return 128/this.context.sampleRate}toSeconds(e){return new fa(this.context,e).toSeconds()}toFrequency(e){return new ga(this.context,e).toFrequency()}toTicks(e){return new va(this.context,e).toTicks()}_getPartialProperties(e){const t=this.get();return Object.keys(t).forEach((n=>{hr(e[n])&&delete t[n]})),t}get(){const e=this.constructor.getDefaults();return Object.keys(e).forEach((t=>{if(Reflect.has(this,t)){const n=this[t];dr(n)&&dr(n.value)&&dr(n.setValueAtTime)?e[t]=n.value:n instanceof Aa?e[t]=n._getPartialProperties(e[t]):yr(n)||fr(n)||br(n)||gr(n)?e[t]=n:delete e[t]}})),e}set(e){return Object.keys(e).forEach((t=>{Reflect.has(this,t)&&dr(this[t])&&(this[t]&&dr(this[t].value)&&dr(this[t].setValueAtTime)?this[t].value!==e[t]&&(this[t].value=e[t]):this[t]instanceof Aa?this[t].set(e[t]):this[t]=e[t])})),this}}class ka extends Ur{constructor(e="stopped"){super(),this.name="StateTimeline",this._initial=e,this.setStateAtTime(this._initial,0)}getValueAtTime(e){const t=this.get(e);return null!==t?t.state:this._initial}setStateAtTime(e,t,n){return ar(t,0),this.add(Object.assign({},n,{state:e,time:t})),this}getLastState(e,t){for(let n=this._search(t);n>=0;n--){const t=this._timeline[n];if(t.state===e)return t}}getNextState(e,t){const n=this._search(t);if(-1!==n)for(let t=n;t0,"timeConstant must be a number greater than 0");const r=this.toSeconds(t);return this._assertRange(s),rr(isFinite(s)&&isFinite(r),`Invalid argument(s) to setTargetAtTime: ${JSON.stringify(e)}, ${JSON.stringify(t)}`),this._events.add({constant:n,time:r,type:"setTargetAtTime",value:s}),this.log(this.units,"setTargetAtTime",e,r,n),this._param.setTargetAtTime(s,r,n),this}setValueCurveAtTime(e,t,n,s=1){n=this.toSeconds(n),t=this.toSeconds(t);const r=this._fromType(e[0])*s;this.setValueAtTime(this._toType(r),t);const a=n/(e.length-1);for(let n=1;n{"cancelScheduledValues"===t.type?e.cancelScheduledValues(t.time):"setTargetAtTime"===t.type?e.setTargetAtTime(t.value,t.time,t.constant):e[t.type](t.value,t.time)})),this}setParam(e){rr(this._swappable,"The Param must be assigned as 'swappable' in the constructor");const t=this.input;return t.disconnect(this._param),this.apply(e),this._param=e,t.connect(this._param),this}dispose(){return super.dispose(),this._events.dispose(),this}get defaultValue(){return this._toType(this._param.defaultValue)}_exponentialApproach(e,t,n,s,r){return n+(t-n)*Math.exp(-(r-e)/s)}_linearInterpolate(e,t,n,s,r){return t+(r-e)/(n-e)*(s-t)}_exponentialInterpolate(e,t,n,s,r){return t*Math.pow(s/t,(r-e)/(n-e))}}class Sa extends Aa{constructor(){super(...arguments),this.name="ToneAudioNode",this._internalChannels=[]}get numberOfInputs(){return dr(this.input)?Sr(this.input)||this.input instanceof Ca?1:this.input.numberOfInputs:0}get numberOfOutputs(){return dr(this.output)?this.output.numberOfOutputs:0}_isAudioNode(e){return dr(e)&&(e instanceof Sa||Er(e))}_getInternalNodes(){const e=this._internalChannels.slice(0);return this._isAudioNode(this.input)&&e.push(this.input),this._isAudioNode(this.output)&&this.input!==this.output&&e.push(this.output),e}_setChannelProperties(e){this._getInternalNodes().forEach((t=>{t.channelCount=e.channelCount,t.channelCountMode=e.channelCountMode,t.channelInterpretation=e.channelInterpretation}))}_getChannelProperties(){const e=this._getInternalNodes();rr(e.length>0,"ToneAudioNode does not have any internal nodes");const t=e[0];return{channelCount:t.channelCount,channelCountMode:t.channelCountMode,channelInterpretation:t.channelInterpretation}}get channelCount(){return this._getChannelProperties().channelCount}set channelCount(e){const t=this._getChannelProperties();this._setChannelProperties(Object.assign(t,{channelCount:e}))}get channelCountMode(){return this._getChannelProperties().channelCountMode}set channelCountMode(e){const t=this._getChannelProperties();this._setChannelProperties(Object.assign(t,{channelCountMode:e}))}get channelInterpretation(){return this._getChannelProperties().channelInterpretation}set channelInterpretation(e){const t=this._getChannelProperties();this._setChannelProperties(Object.assign(t,{channelInterpretation:e}))}connect(e,t=0,n=0){return _a(this,e,t,n),this}toDestination(){return this.connect(this.context.destination),this}toMaster(){return cr("toMaster() has been renamed toDestination()"),this.toDestination()}disconnect(e,t=0,n=0){return Ia(this,e,t,n),this}chain(...e){return Ea(this,...e),this}fan(...e){return e.forEach((e=>this.connect(e))),this}dispose(){return super.dispose(),dr(this.input)&&(this.input instanceof Sa?this.input.dispose():Er(this.input)&&this.input.disconnect()),dr(this.output)&&(this.output instanceof Sa?this.output.dispose():Er(this.output)&&this.output.disconnect()),this._internalChannels=[],this}}function Ea(...e){const t=e.shift();e.reduce(((e,t)=>(e instanceof Sa?e.connect(t):Er(e)&&_a(e,t),t)),t)}function _a(e,t,n=0,s=0){for(rr(dr(e),"Cannot connect from undefined node"),rr(dr(t),"Cannot connect to undefined node"),(t instanceof Sa||Er(t))&&rr(t.numberOfInputs>0,"Cannot connect to node with no inputs"),rr(e.numberOfOutputs>0,"Cannot connect from node with no outputs");t instanceof Sa||t instanceof Ca;)dr(t.input)&&(t=t.input);for(;e instanceof Sa;)dr(e.output)&&(e=e.output);Sr(t)?e.connect(t,n):e.connect(t,n,s)}function Ia(e,t,n=0,s=0){if(dr(t))for(;t instanceof Sa;)t=t.input;for(;!Er(e);)dr(e.output)&&(e=e.output);Sr(t)?e.disconnect(t,n):Er(t)?e.disconnect(t,n,s):e.disconnect()}class Ta extends Sa{constructor(){super(Rr(Ta.getDefaults(),arguments,["gain","units"])),this.name="Gain",this._gainNode=this.context.createGain(),this.input=this._gainNode,this.output=this._gainNode;const e=Rr(Ta.getDefaults(),arguments,["gain","units"]);this.gain=new Ca({context:this.context,convert:e.convert,param:this._gainNode.gain,units:e.units,value:e.gain,minValue:e.minValue,maxValue:e.maxValue}),Zr(this,"gain")}static getDefaults(){return Object.assign(Sa.getDefaults(),{convert:!0,gain:1,units:"gain"})}dispose(){return super.dispose(),this._gainNode.disconnect(),this.gain.dispose(),this}}class Na extends Sa{constructor(e){super(e),this.onended=Qr,this._startTime=-1,this._stopTime=-1,this._timeout=-1,this.output=new Ta({context:this.context,gain:0}),this._gainNode=this.output,this.getStateAtTime=function(e){const t=this.toSeconds(e);return-1!==this._startTime&&t>=this._startTime&&(-1===this._stopTime||t<=this._stopTime)?"started":"stopped"},this._fadeIn=e.fadeIn,this._fadeOut=e.fadeOut,this._curve=e.curve,this.onended=e.onended}static getDefaults(){return Object.assign(Sa.getDefaults(),{curve:"linear",fadeIn:0,fadeOut:0,onended:Qr})}_startGain(e,t=1){rr(-1===this._startTime,"Source cannot be started more than once");const n=this.toSeconds(this._fadeIn);return this._startTime=e+n,this._startTime=Math.max(this._startTime,this.context.currentTime),n>0?(this._gainNode.gain.setValueAtTime(0,e),"linear"===this._curve?this._gainNode.gain.linearRampToValueAtTime(t,e+n):this._gainNode.gain.exponentialApproachValueAtTime(t,e,n)):this._gainNode.gain.setValueAtTime(t,e),this}stop(e){return this.log("stop",e),this._stopGain(this.toSeconds(e)),this}_stopGain(e){rr(-1!==this._startTime,"'start' must be called before 'stop'"),this.cancelStop();const t=this.toSeconds(this._fadeOut);return this._stopTime=this.toSeconds(e)+t,this._stopTime=Math.max(this._stopTime,this.context.currentTime),t>0?"linear"===this._curve?this._gainNode.gain.linearRampTo(0,t,e):this._gainNode.gain.targetRampTo(0,t,e):(this._gainNode.gain.cancelAndHoldAtTime(e),this._gainNode.gain.setValueAtTime(0,e)),this.context.clearTimeout(this._timeout),this._timeout=this.context.setTimeout((()=>{const e="exponential"===this._curve?2*t:0;this._stopSource(this.now()+e),this._onended()}),this._stopTime-this.context.currentTime),this}_onended(){if(this.onended!==Qr&&(this.onended(this),this.onended=Qr,!this.context.isOffline)){const e=()=>this.dispose();void 0!==window.requestIdleCallback?window.requestIdleCallback(e):setTimeout(e,1e3)}}get state(){return this.getStateAtTime(this.now())}cancelStop(){return this.log("cancelStop"),rr(-1!==this._startTime,"Source is not started"),this._gainNode.gain.cancelScheduledValues(this._startTime+this.sampleTime),this.context.clearTimeout(this._timeout),this._stopTime=-1,this}dispose(){return super.dispose(),this._gainNode.disconnect(),this}}class Oa extends Na{constructor(){super(Rr(Oa.getDefaults(),arguments,["offset"])),this.name="ToneConstantSource",this._source=this.context.createConstantSource();const e=Rr(Oa.getDefaults(),arguments,["offset"]);_a(this._source,this._gainNode),this.offset=new Ca({context:this.context,convert:e.convert,param:this._source.offset,units:e.units,value:e.offset,minValue:e.minValue,maxValue:e.maxValue})}static getDefaults(){return Object.assign(Na.getDefaults(),{convert:!0,offset:1,units:"number"})}start(e){const t=this.toSeconds(e);return this.log("start",t),this._startGain(t),this._source.start(t),this}_stopSource(e){this._source.stop(e)}dispose(){return super.dispose(),"started"===this.state&&this.stop(),this._source.disconnect(),this.offset.dispose(),this}}class Ra extends Sa{constructor(){super(Rr(Ra.getDefaults(),arguments,["value","units"])),this.name="Signal",this.override=!0;const e=Rr(Ra.getDefaults(),arguments,["value","units"]);this.output=this._constantSource=new Oa({context:this.context,convert:e.convert,offset:e.value,units:e.units,minValue:e.minValue,maxValue:e.maxValue}),this._constantSource.start(0),this.input=this._param=this._constantSource.offset}static getDefaults(){return Object.assign(Sa.getDefaults(),{convert:!0,units:"number",value:0})}connect(e,t=0,n=0){return Da(this,e,t,n),this}dispose(){return super.dispose(),this._param.dispose(),this._constantSource.dispose(),this}setValueAtTime(e,t){return this._param.setValueAtTime(e,t),this}getValueAtTime(e){return this._param.getValueAtTime(e)}setRampPoint(e){return this._param.setRampPoint(e),this}linearRampToValueAtTime(e,t){return this._param.linearRampToValueAtTime(e,t),this}exponentialRampToValueAtTime(e,t){return this._param.exponentialRampToValueAtTime(e,t),this}exponentialRampTo(e,t,n){return this._param.exponentialRampTo(e,t,n),this}linearRampTo(e,t,n){return this._param.linearRampTo(e,t,n),this}targetRampTo(e,t,n){return this._param.targetRampTo(e,t,n),this}exponentialApproachValueAtTime(e,t,n){return this._param.exponentialApproachValueAtTime(e,t,n),this}setTargetAtTime(e,t,n){return this._param.setTargetAtTime(e,t,n),this}setValueCurveAtTime(e,t,n,s){return this._param.setValueCurveAtTime(e,t,n,s),this}cancelScheduledValues(e){return this._param.cancelScheduledValues(e),this}cancelAndHoldAtTime(e){return this._param.cancelAndHoldAtTime(e),this}rampTo(e,t,n){return this._param.rampTo(e,t,n),this}get value(){return this._param.value}set value(e){this._param.value=e}get convert(){return this._param.convert}set convert(e){this._param.convert=e}get units(){return this._param.units}get overridden(){return this._param.overridden}set overridden(e){this._param.overridden=e}get maxValue(){return this._param.maxValue}get minValue(){return this._param.minValue}apply(e){return this._param.apply(e),this}}function Da(e,t,n,s){(t instanceof Ca||Sr(t)||t instanceof Ra&&t.override)&&(t.cancelScheduledValues(0),t.setValueAtTime(0,0),t instanceof Ra&&(t.overridden=!0)),_a(e,t,n,s)}class Ma extends Ca{constructor(){super(Rr(Ma.getDefaults(),arguments,["value"])),this.name="TickParam",this._events=new Ur(1/0),this._multiplier=1;const e=Rr(Ma.getDefaults(),arguments,["value"]);this._multiplier=e.multiplier,this._events.cancel(0),this._events.add({ticks:0,time:0,type:"setValueAtTime",value:this._fromType(e.value)}),this.setValueAtTime(e.value,0)}static getDefaults(){return Object.assign(Ca.getDefaults(),{multiplier:1,units:"hertz",value:1})}setTargetAtTime(e,t,n){t=this.toSeconds(t),this.setRampPoint(t);const s=this._fromType(e),r=this._events.get(t),a=Math.round(Math.max(1/n,1));for(let e=0;e<=a;e++){const a=n*e+t,i=this._exponentialApproach(r.time,r.value,s,n,a);this.linearRampToValueAtTime(this._toType(i),a)}return this}setValueAtTime(e,t){const n=this.toSeconds(t);super.setValueAtTime(e,t);const s=this._events.get(n),r=this._events.previousEvent(s),a=this._getTicksUntilEvent(r,n);return s.ticks=Math.max(a,0),this}linearRampToValueAtTime(e,t){const n=this.toSeconds(t);super.linearRampToValueAtTime(e,t);const s=this._events.get(n),r=this._events.previousEvent(s),a=this._getTicksUntilEvent(r,n);return s.ticks=Math.max(a,0),this}exponentialRampToValueAtTime(e,t){t=this.toSeconds(t);const n=this._fromType(e),s=this._events.get(t),r=Math.round(Math.max(10*(t-s.time),1)),a=(t-s.time)/r;for(let e=0;e<=r;e++){const r=a*e+s.time,i=this._exponentialInterpolate(s.time,s.value,t,n,r);this.linearRampToValueAtTime(this._toType(i),r)}return this}_getTicksUntilEvent(e,t){if(null===e)e={ticks:0,time:0,type:"setValueAtTime",value:0};else if(hr(e.ticks)){const t=this._events.previousEvent(e);e.ticks=this._getTicksUntilEvent(t,e.time)}const n=this._fromType(this.getValueAtTime(e.time));let s=this._fromType(this.getValueAtTime(t));const r=this._events.get(t);return r&&r.time===t&&"setValueAtTime"===r.type&&(s=this._fromType(this.getValueAtTime(t-this.sampleTime))),.5*(t-e.time)*(n+s)+e.ticks}getTicksAtTime(e){const t=this.toSeconds(e),n=this._events.get(t);return Math.max(this._getTicksUntilEvent(n,t),0)}getDurationOfTicks(e,t){const n=this.toSeconds(t),s=this.getTicksAtTime(t);return this.getTimeOfTick(s+e)-n}getTimeOfTick(e){const t=this._events.get(e,"ticks"),n=this._events.getAfter(e,"ticks");if(t&&t.ticks===e)return t.time;if(t&&n&&"linearRampToValueAtTime"===n.type&&t.value!==n.value){const s=this._fromType(this.getValueAtTime(t.time)),r=(this._fromType(this.getValueAtTime(n.time))-s)/(n.time-t.time),a=Math.sqrt(Math.pow(s,2)-2*r*(t.ticks-e)),i=(-s+a)/r;return(i>0?i:(-s-a)/r)+t.time}return t?0===t.value?1/0:t.time+(e-t.ticks)/t.value:e/this._initialValue}ticksToTime(e,t){return this.getDurationOfTicks(e,t)}timeToTicks(e,t){const n=this.toSeconds(t),s=this.toSeconds(e),r=this.getTicksAtTime(n);return this.getTicksAtTime(n+s)-r}_fromType(e){return"bpm"===this.units&&this.multiplier?1/(60/e/this.multiplier):super._fromType(e)}_toType(e){return"bpm"===this.units&&this.multiplier?e/this.multiplier*60:super._toType(e)}get multiplier(){return this._multiplier}set multiplier(e){const t=this.value;this._multiplier=e,this.cancelScheduledValues(0),this.setValueAtTime(t,0)}}class Fa extends Ra{constructor(){super(Rr(Fa.getDefaults(),arguments,["value"])),this.name="TickSignal";const e=Rr(Fa.getDefaults(),arguments,["value"]);this.input=this._param=new Ma({context:this.context,convert:e.convert,multiplier:e.multiplier,param:this._constantSource.offset,units:e.units,value:e.value})}static getDefaults(){return Object.assign(Ra.getDefaults(),{multiplier:1,units:"hertz",value:1})}ticksToTime(e,t){return this._param.ticksToTime(e,t)}timeToTicks(e,t){return this._param.timeToTicks(e,t)}getTimeOfTick(e){return this._param.getTimeOfTick(e)}getDurationOfTicks(e,t){return this._param.getDurationOfTicks(e,t)}getTicksAtTime(e){return this._param.getTicksAtTime(e)}get multiplier(){return this._param.multiplier}set multiplier(e){this._param.multiplier=e}dispose(){return super.dispose(),this._param.dispose(),this}}class Ba extends Aa{constructor(){super(Rr(Ba.getDefaults(),arguments,["frequency"])),this.name="TickSource",this._state=new ka,this._tickOffset=new Ur;const e=Rr(Ba.getDefaults(),arguments,["frequency"]);this.frequency=new Fa({context:this.context,units:e.units,value:e.frequency}),Zr(this,"frequency"),this._state.setStateAtTime("stopped",0),this.setTicksAtTime(0,0)}static getDefaults(){return Object.assign({frequency:1,units:"hertz"},Aa.getDefaults())}get state(){return this.getStateAtTime(this.now())}start(e,t){const n=this.toSeconds(e);return"started"!==this._state.getValueAtTime(n)&&(this._state.setStateAtTime("started",n),dr(t)&&this.setTicksAtTime(t,n)),this}stop(e){const t=this.toSeconds(e);if("stopped"===this._state.getValueAtTime(t)){const e=this._state.get(t);e&&e.time>0&&(this._tickOffset.cancel(e.time),this._state.cancel(e.time))}return this._state.cancel(t),this._state.setStateAtTime("stopped",t),this.setTicksAtTime(0,t),this}pause(e){const t=this.toSeconds(e);return"started"===this._state.getValueAtTime(t)&&this._state.setStateAtTime("paused",t),this}cancel(e){return e=this.toSeconds(e),this._state.cancel(e),this._tickOffset.cancel(e),this}getTicksAtTime(e){const t=this.toSeconds(e),n=this._state.getLastState("stopped",t),s={state:"paused",time:t};this._state.add(s);let r=n,a=0;return this._state.forEachBetween(n.time,t+this.sampleTime,(e=>{let t=r.time;const n=this._tickOffset.get(e.time);n&&n.time>=r.time&&(a=n.ticks,t=n.time),"started"===r.state&&"started"!==e.state&&(a+=this.frequency.getTicksAtTime(e.time)-this.frequency.getTicksAtTime(t)),r=e})),this._state.remove(s),a}get ticks(){return this.getTicksAtTime(this.now())}set ticks(e){this.setTicksAtTime(e,this.now())}get seconds(){return this.getSecondsAtTime(this.now())}set seconds(e){const t=this.now(),n=this.frequency.timeToTicks(e,t);this.setTicksAtTime(n,t)}getSecondsAtTime(e){e=this.toSeconds(e);const t=this._state.getLastState("stopped",e),n={state:"paused",time:e};this._state.add(n);let s=t,r=0;return this._state.forEachBetween(t.time,e+this.sampleTime,(e=>{let t=s.time;const n=this._tickOffset.get(e.time);n&&n.time>=s.time&&(r=n.seconds,t=n.time),"started"===s.state&&"started"!==e.state&&(r+=e.time-t),s=e})),this._state.remove(n),r}setTicksAtTime(e,t){return t=this.toSeconds(t),this._tickOffset.cancel(t),this._tickOffset.add({seconds:this.frequency.getDurationOfTicks(e,t),ticks:e,time:t}),this}getStateAtTime(e){return e=this.toSeconds(e),this._state.getValueAtTime(e)}getTimeOfTick(e,t=this.now()){const n=this._tickOffset.get(t),s=this._state.get(t),r=Math.max(n.time,s.time),a=this.frequency.getTicksAtTime(r)+e-n.ticks;return this.frequency.getTimeOfTick(a)}forEachTickBetween(e,t,n){let s=this._state.get(e);this._state.forEachBetween(e,t,(t=>{s&&"started"===s.state&&"started"!==t.state&&this.forEachTickBetween(Math.max(s.time,e),t.time-this.sampleTime,n),s=t}));let r=null;if(s&&"started"===s.state){const a=Math.max(s.time,e),i=this.frequency.getTicksAtTime(a),o=i-this.frequency.getTicksAtTime(s.time);let l=Math.ceil(o)-o;l=Vr(l,1)?0:l;let u=this.frequency.getTimeOfTick(i+l);for(;u{switch(e.state){case"started":const t=this._tickSource.getTicksAtTime(e.time);this.emit("start",e.time,t);break;case"stopped":0!==e.time&&this.emit("stop",e.time);break;case"paused":this.emit("pause",e.time)}})),this._tickSource.forEachTickBetween(e,t,((e,t)=>{this.callback(e,t)})))}getStateAtTime(e){const t=this.toSeconds(e);return this._state.getValueAtTime(t)}dispose(){return super.dispose(),this.context.off("tick",this._boundLoop),this._tickSource.dispose(),this._state.dispose(),this}}$r.mixin(za);class La extends Sa{constructor(){super(Rr(La.getDefaults(),arguments,["delayTime","maxDelay"])),this.name="Delay";const e=Rr(La.getDefaults(),arguments,["delayTime","maxDelay"]),t=this.toSeconds(e.maxDelay);this._maxDelay=Math.max(t,this.toSeconds(e.delayTime)),this._delayNode=this.input=this.output=this.context.createDelay(t),this.delayTime=new Ca({context:this.context,param:this._delayNode.delayTime,units:"time",value:e.delayTime,minValue:0,maxValue:this.maxDelay}),Zr(this,"delayTime")}static getDefaults(){return Object.assign(Sa.getDefaults(),{delayTime:0,maxDelay:1})}get maxDelay(){return this._maxDelay}dispose(){return super.dispose(),this._delayNode.disconnect(),this.delayTime.dispose(),this}}function Pa(e,t,n=2,s=sa().sampleRate){return kr(this,void 0,void 0,(function*(){const r=sa(),a=new ea(n,t,s);ra(a),yield e(a);const i=a.render();ra(r);const o=yield i;return new Jr(o)}))}class Va extends Fr{constructor(){super(),this.name="ToneAudioBuffers",this._buffers=new Map,this._loadingCount=0;const e=Rr(Va.getDefaults(),arguments,["urls","onload","baseUrl"],"urls");this.baseUrl=e.baseUrl,Object.keys(e.urls).forEach((t=>{this._loadingCount++;const n=e.urls[t];this.add(t,n,this._bufferLoaded.bind(this,e.onload),e.onerror)}))}static getDefaults(){return{baseUrl:"",onerror:Qr,onload:Qr,urls:{}}}has(e){return this._buffers.has(e.toString())}get(e){return rr(this.has(e),`ToneAudioBuffers has no buffer named: ${e}`),this._buffers.get(e.toString())}_bufferLoaded(e){this._loadingCount--,0===this._loadingCount&&e&&e()}get loaded(){return Array.from(this._buffers).every((([e,t])=>t.loaded))}add(e,t,n=Qr,s=Qr){return br(t)?this._buffers.set(e.toString(),new Jr(this.baseUrl+t,n,s)):this._buffers.set(e.toString(),new Jr(t,n,s)),this}dispose(){return super.dispose(),this._buffers.forEach((e=>e.dispose())),this._buffers.clear(),this}}class Wa extends ga{constructor(){super(...arguments),this.name="MidiClass",this.defaultUnits="midi"}_frequencyToUnits(e){return ca(super._frequencyToUnits(e))}_ticksToUnits(e){return ca(super._ticksToUnits(e))}_beatsToUnits(e){return ca(super._beatsToUnits(e))}_secondsToUnits(e){return ca(super._secondsToUnits(e))}toMidi(){return this.valueOf()}toFrequency(){return da(this.toMidi())}transpose(e){return new Wa(this.context,this.toMidi()+e)}}function Ua(e,t){return new Wa(sa(),e,t)}class Ga extends va{constructor(){super(...arguments),this.name="Ticks",this.defaultUnits="i"}_now(){return this.context.transport.ticks}_beatsToUnits(e){return this._getPPQ()*e}_secondsToUnits(e){return Math.floor(e/(60/this._getBpm())*this._getPPQ())}_ticksToUnits(e){return e}toTicks(){return this.valueOf()}toSeconds(){return this.valueOf()/this._getPPQ()*(60/this._getBpm())}}function qa(e,t){return new Ga(sa(),e,t)}class ja extends Aa{constructor(){super(...arguments),this.name="Draw",this.expiration=.25,this.anticipation=.008,this._events=new Ur,this._boundDrawLoop=this._drawLoop.bind(this),this._animationFrame=-1}schedule(e,t){return this._events.add({callback:e,time:this.toSeconds(t)}),1===this._events.length&&(this._animationFrame=requestAnimationFrame(this._boundDrawLoop)),this}cancel(e){return this._events.cancel(this.toSeconds(e)),this}_drawLoop(){const e=this.context.currentTime;for(;this._events.length&&this._events.peek().time-this.anticipation<=e;){const t=this._events.shift();t&&e-t.time<=this.expiration&&t.callback()}this._events.length>0&&(this._animationFrame=requestAnimationFrame(this._boundDrawLoop))}dispose(){return super.dispose(),this._events.dispose(),cancelAnimationFrame(this._animationFrame),this}}qr((e=>{e.draw=new ja({context:e})})),Hr((e=>{e.draw.dispose()}));class Ha extends Fr{constructor(){super(...arguments),this.name="IntervalTimeline",this._root=null,this._length=0}add(e){rr(dr(e.time),"Events must have a time property"),rr(dr(e.duration),"Events must have a duration parameter"),e.time=e.time.valueOf();let t=new $a(e.time,e.time+e.duration,e);for(null===this._root?this._root=t:this._root.insert(t),this._length++;null!==t;)t.updateHeight(),t.updateMax(),this._rebalance(t),t=t.parent;return this}remove(e){if(null!==this._root){const t=[];this._root.search(e.time,t);for(const n of t)if(n.event===e){this._removeNode(n),this._length--;break}}return this}get length(){return this._length}cancel(e){return this.forEachFrom(e,(e=>this.remove(e))),this}_setRoot(e){this._root=e,null!==this._root&&(this._root.parent=null)}_replaceNodeInParent(e,t){null!==e.parent?(e.isLeftChild()?e.parent.left=t:e.parent.right=t,this._rebalance(e.parent)):this._setRoot(t)}_removeNode(e){if(null===e.left&&null===e.right)this._replaceNodeInParent(e,null);else if(null===e.right)this._replaceNodeInParent(e,e.left);else if(null===e.left)this._replaceNodeInParent(e,e.right);else{let t,n=null;if(e.getBalance()>0)if(null===e.left.right)t=e.left,t.right=e.right,n=t;else{for(t=e.left.right;null!==t.right;)t=t.right;t.parent&&(t.parent.right=t.left,n=t.parent,t.left=e.left,t.right=e.right)}else if(null===e.right.left)t=e.right,t.left=e.left,n=t;else{for(t=e.right.left;null!==t.left;)t=t.left;t.parent&&(t.parent.left=t.right,n=t.parent,t.left=e.left,t.right=e.right)}null!==e.parent?e.isLeftChild()?e.parent.left=t:e.parent.right=t:this._setRoot(t),n&&this._rebalance(n)}e.dispose()}_rotateLeft(e){const t=e.parent,n=e.isLeftChild(),s=e.right;s&&(e.right=s.left,s.left=e),null!==t?n?t.left=s:t.right=s:this._setRoot(s)}_rotateRight(e){const t=e.parent,n=e.isLeftChild(),s=e.left;s&&(e.left=s.right,s.right=e),null!==t?n?t.left=s:t.right=s:this._setRoot(s)}_rebalance(e){const t=e.getBalance();t>1&&e.left?e.left.getBalance()<0?this._rotateLeft(e.left):this._rotateRight(e):t<-1&&e.right&&(e.right.getBalance()>0?this._rotateRight(e.right):this._rotateLeft(e))}get(e){if(null!==this._root){const t=[];if(this._root.search(e,t),t.length>0){let e=t[0];for(let n=1;ne.low&&(e=t[n]);return e.event}}return null}forEach(e){if(null!==this._root){const t=[];this._root.traverse((e=>t.push(e))),t.forEach((t=>{t.event&&e(t.event)}))}return this}forEachAtTime(e,t){if(null!==this._root){const n=[];this._root.search(e,n),n.forEach((e=>{e.event&&t(e.event)}))}return this}forEachFrom(e,t){if(null!==this._root){const n=[];this._root.searchAfter(e,n),n.forEach((e=>{e.event&&t(e.event)}))}return this}dispose(){return super.dispose(),null!==this._root&&this._root.traverse((e=>e.dispose())),this._root=null,this}}class $a{constructor(e,t,n){this._left=null,this._right=null,this.parent=null,this.height=0,this.event=n,this.low=e,this.high=t,this.max=this.high}insert(e){e.low<=this.low?null===this.left?this.left=e:this.left.insert(e):null===this.right?this.right=e:this.right.insert(e)}search(e,t){e>this.max||(null!==this.left&&this.left.search(e,t),this.low<=e&&this.high>e&&t.push(this),this.low>e||null!==this.right&&this.right.search(e,t))}searchAfter(e,t){this.low>=e&&(t.push(this),null!==this.left&&this.left.searchAfter(e,t)),null!==this.right&&this.right.searchAfter(e,t)}traverse(e){e(this),null!==this.left&&this.left.traverse(e),null!==this.right&&this.right.traverse(e)}updateHeight(){null!==this.left&&null!==this.right?this.height=Math.max(this.left.height,this.right.height)+1:null!==this.right?this.height=this.right.height+1:null!==this.left?this.height=this.left.height+1:this.height=0}updateMax(){this.max=this.high,null!==this.left&&(this.max=Math.max(this.max,this.left.max)),null!==this.right&&(this.max=Math.max(this.max,this.right.max))}getBalance(){let e=0;return null!==this.left&&null!==this.right?e=this.left.height-this.right.height:null!==this.left?e=this.left.height+1:null!==this.right&&(e=-(this.right.height+1)),e}isLeftChild(){return null!==this.parent&&this.parent.left===this}get left(){return this._left}set left(e){this._left=e,null!==e&&(e.parent=this),this.updateHeight(),this.updateMax()}get right(){return this._right}set right(e){this._right=e,null!==e&&(e.parent=this),this.updateHeight(),this.updateMax()}dispose(){this.parent=null,this._left=null,this._right=null,this.event=null}}class Ka extends Sa{constructor(){super(Rr(Ka.getDefaults(),arguments,["volume"])),this.name="Volume";const e=Rr(Ka.getDefaults(),arguments,["volume"]);this.input=this.output=new Ta({context:this.context,gain:e.volume,units:"decibels"}),this.volume=this.output.gain,Zr(this,"volume"),this._unmutedVolume=e.volume,this.mute=e.mute}static getDefaults(){return Object.assign(Sa.getDefaults(),{mute:!1,volume:0})}get mute(){return this.volume.value===-1/0}set mute(e){!this.mute&&e?(this._unmutedVolume=this.volume.value,this.volume.value=-1/0):this.mute&&!e&&(this.volume.value=this._unmutedVolume)}dispose(){return super.dispose(),this.input.dispose(),this.volume.dispose(),this}}class Xa extends Sa{constructor(){super(Rr(Xa.getDefaults(),arguments)),this.name="Destination",this.input=new Ka({context:this.context}),this.output=new Ta({context:this.context}),this.volume=this.input.volume;const e=Rr(Xa.getDefaults(),arguments);Ea(this.input,this.output,this.context.rawContext.destination),this.mute=e.mute,this._internalChannels=[this.input,this.context.rawContext.destination,this.output]}static getDefaults(){return Object.assign(Sa.getDefaults(),{mute:!1,volume:0})}get mute(){return this.input.mute}set mute(e){this.input.mute=e}chain(...e){return this.input.disconnect(),e.unshift(this.input),e.push(this.output),Ea(...e),this}get maxChannelCount(){return this.context.rawContext.destination.maxChannelCount}dispose(){return super.dispose(),this.volume.dispose(),this}}qr((e=>{e.destination=new Xa({context:e})})),Hr((e=>{e.destination.dispose()}));class Za extends Fr{constructor(e){super(),this.name="TimelineValue",this._timeline=new Ur({memory:10}),this._initialValue=e}set(e,t){return this._timeline.add({value:e,time:t}),this}get(e){const t=this._timeline.get(e);return t?t.value:this._initialValue}}class Ya{constructor(e,t){this.id=Ya._eventId++;const n=Object.assign(Ya.getDefaults(),t);this.transport=e,this.callback=n.callback,this._once=n.once,this.time=n.time}static getDefaults(){return{callback:Qr,once:!1,time:0}}invoke(e){this.callback&&(this.callback(e),this._once&&this.transport.clear(this.id))}dispose(){return this.callback=void 0,this}}Ya._eventId=0;class Qa extends Ya{constructor(e,t){super(e,t),this._currentId=-1,this._nextId=-1,this._nextTick=this.time,this._boundRestart=this._restart.bind(this);const n=Object.assign(Qa.getDefaults(),t);this.duration=new Ga(e.context,n.duration).valueOf(),this._interval=new Ga(e.context,n.interval).valueOf(),this._nextTick=n.time,this.transport.on("start",this._boundRestart),this.transport.on("loopStart",this._boundRestart),this.context=this.transport.context,this._restart()}static getDefaults(){return Object.assign({},Ya.getDefaults(),{duration:1/0,interval:1,once:!1})}invoke(e){this._createEvents(e),super.invoke(e)}_createEvents(e){const t=this.transport.getTicksAtTime(e);t>=this.time&&t>=this._nextTick&&this._nextTick+this._intervalthis.time&&(this._nextTick=this.time+Math.ceil((t-this.time)/this._interval)*this._interval),this._currentId=this.transport.scheduleOnce(this.invoke.bind(this),new Ga(this.context,this._nextTick).toSeconds()),this._nextTick+=this._interval,this._nextId=this.transport.scheduleOnce(this.invoke.bind(this),new Ga(this.context,this._nextTick).toSeconds())}dispose(){return super.dispose(),this.transport.clear(this._currentId),this.transport.clear(this._nextId),this.transport.off("start",this._boundRestart),this.transport.off("loopStart",this._boundRestart),this}}class Ja extends Aa{constructor(){super(Rr(Ja.getDefaults(),arguments)),this.name="Transport",this._loop=new Za(!1),this._loopStart=0,this._loopEnd=0,this._scheduledEvents={},this._timeline=new Ur,this._repeatedEvents=new Ha,this._syncedSignals=[],this._swingAmount=0;const e=Rr(Ja.getDefaults(),arguments);this._ppq=e.ppq,this._clock=new za({callback:this._processTick.bind(this),context:this.context,frequency:0,units:"bpm"}),this._bindClockEvents(),this.bpm=this._clock.frequency,this._clock.frequency.multiplier=e.ppq,this.bpm.setValueAtTime(e.bpm,0),Zr(this,"bpm"),this._timeSignature=e.timeSignature,this._swingTicks=e.ppq/2}static getDefaults(){return Object.assign(Aa.getDefaults(),{bpm:120,loopEnd:"4m",loopStart:0,ppq:192,swing:0,swingSubdivision:"8n",timeSignature:4})}_processTick(e,t){if(this._loop.get(e)&&t>=this._loopEnd&&(this.emit("loopEnd",e),this._clock.setTicksAtTime(this._loopStart,e),t=this._loopStart,this.emit("loopStart",e,this._clock.getSecondsAtTime(e)),this.emit("loop",e)),this._swingAmount>0&&t%this._ppq!=0&&t%(2*this._swingTicks)!=0){const n=t%(2*this._swingTicks)/(2*this._swingTicks),s=Math.sin(n*Math.PI)*this._swingAmount;e+=new Ga(this.context,2*this._swingTicks/3).toSeconds()*s}this._timeline.forEachAtTime(t,(t=>t.invoke(e)))}schedule(e,t){const n=new Ya(this,{callback:e,time:new va(this.context,t).toTicks()});return this._addEvent(n,this._timeline)}scheduleRepeat(e,t,n,s=1/0){const r=new Qa(this,{callback:e,duration:new fa(this.context,s).toTicks(),interval:new fa(this.context,t).toTicks(),time:new va(this.context,n).toTicks()});return this._addEvent(r,this._repeatedEvents)}scheduleOnce(e,t){const n=new Ya(this,{callback:e,once:!0,time:new va(this.context,t).toTicks()});return this._addEvent(n,this._timeline)}clear(e){if(this._scheduledEvents.hasOwnProperty(e)){const t=this._scheduledEvents[e.toString()];t.timeline.remove(t.event),t.event.dispose(),delete this._scheduledEvents[e.toString()]}return this}_addEvent(e,t){return this._scheduledEvents[e.id.toString()]={event:e,timeline:t},t.add(e),e.id}cancel(e=0){const t=this.toTicks(e);return this._timeline.forEachFrom(t,(e=>this.clear(e.id))),this._repeatedEvents.forEachFrom(t,(e=>this.clear(e.id))),this}_bindClockEvents(){this._clock.on("start",((e,t)=>{t=new Ga(this.context,t).toSeconds(),this.emit("start",e,t)})),this._clock.on("stop",(e=>{this.emit("stop",e)})),this._clock.on("pause",(e=>{this.emit("pause",e)}))}get state(){return this._clock.getStateAtTime(this.now())}start(e,t){let n;return dr(t)&&(n=this.toTicks(t)),this._clock.start(e,n),this}stop(e){return this._clock.stop(e),this}pause(e){return this._clock.pause(e),this}toggle(e){return e=this.toSeconds(e),"started"!==this._clock.getStateAtTime(e)?this.start(e):this.stop(e),this}get timeSignature(){return this._timeSignature}set timeSignature(e){yr(e)&&(e=e[0]/e[1]*4),this._timeSignature=e}get loopStart(){return new fa(this.context,this._loopStart,"i").toSeconds()}set loopStart(e){this._loopStart=this.toTicks(e)}get loopEnd(){return new fa(this.context,this._loopEnd,"i").toSeconds()}set loopEnd(e){this._loopEnd=this.toTicks(e)}get loop(){return this._loop.get(this.now())}set loop(e){this._loop.set(e,this.now())}setLoopPoints(e,t){return this.loopStart=e,this.loopEnd=t,this}get swing(){return this._swingAmount}set swing(e){this._swingAmount=e}get swingSubdivision(){return new Ga(this.context,this._swingTicks).toNotation()}set swingSubdivision(e){this._swingTicks=this.toTicks(e)}get position(){const e=this.now(),t=this._clock.getTicksAtTime(e);return new Ga(this.context,t).toBarsBeatsSixteenths()}set position(e){const t=this.toTicks(e);this.ticks=t}get seconds(){return this._clock.seconds}set seconds(e){const t=this.now(),n=this._clock.frequency.timeToTicks(e,t);this.ticks=n}get progress(){if(this.loop){const e=this.now();return(this._clock.getTicksAtTime(e)-this._loopStart)/(this._loopEnd-this._loopStart)}return 0}get ticks(){return this._clock.ticks}set ticks(e){if(this._clock.ticks!==e){const t=this.now();if("started"===this.state){const n=this._clock.getTicksAtTime(t),s=t+this._clock.frequency.getDurationOfTicks(Math.ceil(n)-n,t);this.emit("stop",s),this._clock.setTicksAtTime(e,s),this.emit("start",s,this._clock.getSecondsAtTime(s))}else this._clock.setTicksAtTime(e,t)}}getTicksAtTime(e){return Math.round(this._clock.getTicksAtTime(e))}getSecondsAtTime(e){return this._clock.getSecondsAtTime(e)}get PPQ(){return this._clock.frequency.multiplier}set PPQ(e){this._clock.frequency.multiplier=e}nextSubdivision(e){if(e=this.toTicks(e),"started"!==this.state)return 0;{const t=this.now(),n=e-this.getTicksAtTime(t)%e;return this._clock.nextTickTime(n,t)}}syncSignal(e,t){if(!t){const n=this.now();if(0!==e.getValueAtTime(n)){const s=1/(60/this.bpm.getValueAtTime(n)/this.PPQ);t=e.getValueAtTime(n)/s}else t=0}const n=new Ta(t);return this.bpm.connect(n),n.connect(e._param),this._syncedSignals.push({initial:e.value,ratio:n,signal:e}),e.value=0,this}unsyncSignal(e){for(let t=this._syncedSignals.length-1;t>=0;t--){const n=this._syncedSignals[t];n.signal===e&&(n.ratio.dispose(),n.signal.value=n.initial,this._syncedSignals.splice(t,1))}return this}dispose(){return super.dispose(),this._clock.dispose(),Yr(this,"bpm"),this._timeline.dispose(),this._repeatedEvents.dispose(),this}}$r.mixin(Ja),qr((e=>{e.transport=new Ja({context:e})})),Hr((e=>{e.transport.dispose()}));class ei extends Sa{constructor(e){super(e),this.input=void 0,this._state=new ka("stopped"),this._synced=!1,this._scheduled=[],this._syncedStart=Qr,this._syncedStop=Qr,this._state.memory=100,this._state.increasing=!0,this._volume=this.output=new Ka({context:this.context,mute:e.mute,volume:e.volume}),this.volume=this._volume.volume,Zr(this,"volume"),this.onstop=e.onstop}static getDefaults(){return Object.assign(Sa.getDefaults(),{mute:!1,onstop:Qr,volume:0})}get state(){return this._synced?"started"===this.context.transport.state?this._state.getValueAtTime(this.context.transport.seconds):"stopped":this._state.getValueAtTime(this.now())}get mute(){return this._volume.mute}set mute(e){this._volume.mute=e}_clampToCurrentTime(e){return this._synced?e:Math.max(e,this.context.currentTime)}start(e,t,n){let s=hr(e)&&this._synced?this.context.transport.seconds:this.toSeconds(e);if(s=this._clampToCurrentTime(s),this._synced||"started"!==this._state.getValueAtTime(s))if(this.log("start",s),this._state.setStateAtTime("started",s),this._synced){const e=this._state.get(s);e&&(e.offset=this.toSeconds(Dr(t,0)),e.duration=n?this.toSeconds(n):void 0);const r=this.context.transport.schedule((e=>{this._start(e,t,n)}),s);this._scheduled.push(r),"started"===this.context.transport.state&&this.context.transport.getSecondsAtTime(this.immediate())>s&&this._syncedStart(this.now(),this.context.transport.seconds)}else ir(this.context),this._start(s,t,n);else rr(zr(s,this._state.get(s).time),"Start time must be strictly greater than previous start time"),this._state.cancel(s),this._state.setStateAtTime("started",s),this.log("restart",s),this.restart(s,t,n);return this}stop(e){let t=hr(e)&&this._synced?this.context.transport.seconds:this.toSeconds(e);if(t=this._clampToCurrentTime(t),"started"===this._state.getValueAtTime(t)||dr(this._state.getNextState("started",t))){if(this.log("stop",t),this._synced){const e=this.context.transport.schedule(this._stop.bind(this),t);this._scheduled.push(e)}else this._stop(t);this._state.cancel(t),this._state.setStateAtTime("stopped",t)}return this}restart(e,t,n){return e=this.toSeconds(e),"started"===this._state.getValueAtTime(e)&&(this._state.cancel(e),this._restart(e,t,n)),this}sync(){return this._synced||(this._synced=!0,this._syncedStart=(e,t)=>{if(t>0){const n=this._state.get(t);if(n&&"started"===n.state&&n.time!==t){const s=t-this.toSeconds(n.time);let r;n.duration&&(r=this.toSeconds(n.duration)-s),this._start(e,this.toSeconds(n.offset)+s,r)}}},this._syncedStop=e=>{const t=this.context.transport.getSecondsAtTime(Math.max(e-this.sampleTime,0));"started"===this._state.getValueAtTime(t)&&this._stop(e)},this.context.transport.on("start",this._syncedStart),this.context.transport.on("loopStart",this._syncedStart),this.context.transport.on("stop",this._syncedStop),this.context.transport.on("pause",this._syncedStop),this.context.transport.on("loopEnd",this._syncedStop)),this}unsync(){return this._synced&&(this.context.transport.off("stop",this._syncedStop),this.context.transport.off("pause",this._syncedStop),this.context.transport.off("loopEnd",this._syncedStop),this.context.transport.off("start",this._syncedStart),this.context.transport.off("loopStart",this._syncedStart)),this._synced=!1,this._scheduled.forEach((e=>this.context.transport.clear(e))),this._scheduled=[],this._state.cancel(0),this._stop(0),this}dispose(){return super.dispose(),this.onstop=Qr,this.unsync(),this._volume.dispose(),this._state.dispose(),this}}class ti extends Na{constructor(){super(Rr(ti.getDefaults(),arguments,["url","onload"])),this.name="ToneBufferSource",this._source=this.context.createBufferSource(),this._internalChannels=[this._source],this._sourceStarted=!1,this._sourceStopped=!1;const e=Rr(ti.getDefaults(),arguments,["url","onload"]);_a(this._source,this._gainNode),this._source.onended=()=>this._stopSource(),this.playbackRate=new Ca({context:this.context,param:this._source.playbackRate,units:"positive",value:e.playbackRate}),this.loop=e.loop,this.loopStart=e.loopStart,this.loopEnd=e.loopEnd,this._buffer=new Jr(e.url,e.onload,e.onerror),this._internalChannels.push(this._source)}static getDefaults(){return Object.assign(Na.getDefaults(),{url:new Jr,loop:!1,loopEnd:0,loopStart:0,onload:Qr,onerror:Qr,playbackRate:1})}get fadeIn(){return this._fadeIn}set fadeIn(e){this._fadeIn=e}get fadeOut(){return this._fadeOut}set fadeOut(e){this._fadeOut=e}get curve(){return this._curve}set curve(e){this._curve=e}start(e,t,n,s=1){rr(this.buffer.loaded,"buffer is either not set or not loaded");const r=this.toSeconds(e);this._startGain(r,s),t=this.loop?Dr(t,this.loopStart):Dr(t,0);let a=Math.max(this.toSeconds(t),0);if(this.loop){const e=this.toSeconds(this.loopEnd)||this.buffer.duration,t=this.toSeconds(this.loopStart),n=e-t;Lr(a,e)&&(a=(a-t)%n+t),Vr(a,this.buffer.duration)&&(a=0)}if(this._source.buffer=this.buffer.get(),this._source.loopEnd=this.toSeconds(this.loopEnd)||this.buffer.duration,Pr(a,this.buffer.duration)&&(this._sourceStarted=!0,this._source.start(r,a)),dr(n)){let e=this.toSeconds(n);e=Math.max(e,0),this.stop(r+e)}return this}_stopSource(e){!this._sourceStopped&&this._sourceStarted&&(this._sourceStopped=!0,this._source.stop(this.toSeconds(e)),this._onended())}get loopStart(){return this._source.loopStart}set loopStart(e){this._source.loopStart=this.toSeconds(e)}get loopEnd(){return this._source.loopEnd}set loopEnd(e){this._source.loopEnd=this.toSeconds(e)}get buffer(){return this._buffer}set buffer(e){this._buffer.set(e)}get loop(){return this._source.loop}set loop(e){this._source.loop=e,this._sourceStarted&&this.cancelStop()}dispose(){return super.dispose(),this._source.onended=null,this._source.disconnect(),this._buffer.dispose(),this.playbackRate.dispose(),this}}class ni extends ei{constructor(){super(Rr(ni.getDefaults(),arguments,["type"])),this.name="Noise",this._source=null;const e=Rr(ni.getDefaults(),arguments,["type"]);this._playbackRate=e.playbackRate,this.type=e.type,this._fadeIn=e.fadeIn,this._fadeOut=e.fadeOut}static getDefaults(){return Object.assign(ei.getDefaults(),{fadeIn:0,fadeOut:0,playbackRate:1,type:"white"})}get type(){return this._type}set type(e){if(rr(e in ai,"Noise: invalid type: "+e),this._type!==e&&(this._type=e,"started"===this.state)){const e=this.now();this._stop(e),this._start(e)}}get playbackRate(){return this._playbackRate}set playbackRate(e){this._playbackRate=e,this._source&&(this._source.playbackRate.value=e)}_start(e){const t=ai[this._type];this._source=new ti({url:t,context:this.context,fadeIn:this._fadeIn,fadeOut:this._fadeOut,loop:!0,onended:()=>this.onstop(this),playbackRate:this._playbackRate}).connect(this.output),this._source.start(this.toSeconds(e),Math.random()*(t.duration-.001))}_stop(e){this._source&&(this._source.stop(this.toSeconds(e)),this._source=null)}get fadeIn(){return this._fadeIn}set fadeIn(e){this._fadeIn=e,this._source&&(this._source.fadeIn=this._fadeIn)}get fadeOut(){return this._fadeOut}set fadeOut(e){this._fadeOut=e,this._source&&(this._source.fadeOut=this._fadeOut)}_restart(e){this._stop(e),this._start(e)}dispose(){return super.dispose(),this._source&&this._source.disconnect(),this}}const si=220500,ri={brown:null,pink:null,white:null},ai={get brown(){if(!ri.brown){const e=[];for(let t=0;t<2;t++){const n=new Float32Array(si);e[t]=n;let s=0;for(let e=0;et.label===e||t.deviceId===e)),!this._device&&t.length>0&&(this._device=t[0]),rr(dr(this._device),`No matching device ${e}`));const n={audio:{echoCancellation:!1,sampleRate:this.context.sampleRate,noiseSuppression:!1,mozNoiseSuppression:!1}};this._device&&(n.audio.deviceId=this._device.deviceId);const s=yield navigator.mediaDevices.getUserMedia(n);if(!this._stream){this._stream=s;const e=this.context.createMediaStreamSource(s);_a(e,this.output),this._mediaStream=e}return this}))}close(){return this._stream&&this._mediaStream&&(this._stream.getAudioTracks().forEach((e=>{e.stop()})),this._stream=void 0,this._mediaStream.disconnect(),this._mediaStream=void 0),this._device=void 0,this}static enumerateDevices(){return kr(this,void 0,void 0,(function*(){return(yield navigator.mediaDevices.enumerateDevices()).filter((e=>"audioinput"===e.kind))}))}get state(){return this._stream&&this._stream.active?"started":"stopped"}get deviceId(){return this._device?this._device.deviceId:void 0}get groupId(){return this._device?this._device.groupId:void 0}get label(){return this._device?this._device.label:void 0}get mute(){return this._volume.mute}set mute(e){this._volume.mute=e}dispose(){return super.dispose(),this.close(),this._volume.dispose(),this.volume.dispose(),this}static get supported(){return dr(navigator.mediaDevices)&&dr(navigator.mediaDevices.getUserMedia)}}function oi(e,t){return kr(this,void 0,void 0,(function*(){const n=t/e.context.sampleRate,s=new ea(1,n,e.context.sampleRate);new e.constructor(Object.assign(e.get(),{frequency:2/n,detune:0,context:s})).toDestination().start(0);return(yield s.render()).getChannelData(0)}))}class li extends Na{constructor(){super(Rr(li.getDefaults(),arguments,["frequency","type"])),this.name="ToneOscillatorNode",this._oscillator=this.context.createOscillator(),this._internalChannels=[this._oscillator];const e=Rr(li.getDefaults(),arguments,["frequency","type"]);_a(this._oscillator,this._gainNode),this.type=e.type,this.frequency=new Ca({context:this.context,param:this._oscillator.frequency,units:"frequency",value:e.frequency}),this.detune=new Ca({context:this.context,param:this._oscillator.detune,units:"cents",value:e.detune}),Zr(this,["frequency","detune"])}static getDefaults(){return Object.assign(Na.getDefaults(),{detune:0,frequency:440,type:"sine"})}start(e){const t=this.toSeconds(e);return this.log("start",t),this._startGain(t),this._oscillator.start(t),this}_stopSource(e){this._oscillator.stop(e)}setPeriodicWave(e){return this._oscillator.setPeriodicWave(e),this}get type(){return this._oscillator.type}set type(e){this._oscillator.type=e}dispose(){return super.dispose(),"started"===this.state&&this.stop(),this._oscillator.disconnect(),this.frequency.dispose(),this.detune.dispose(),this}}class ui extends ei{constructor(){super(Rr(ui.getDefaults(),arguments,["frequency","type"])),this.name="Oscillator",this._oscillator=null;const e=Rr(ui.getDefaults(),arguments,["frequency","type"]);this.frequency=new Ra({context:this.context,units:"frequency",value:e.frequency}),Zr(this,"frequency"),this.detune=new Ra({context:this.context,units:"cents",value:e.detune}),Zr(this,"detune"),this._partials=e.partials,this._partialCount=e.partialCount,this._type=e.type,e.partialCount&&"custom"!==e.type&&(this._type=this.baseType+e.partialCount.toString()),this.phase=e.phase}static getDefaults(){return Object.assign(ei.getDefaults(),{detune:0,frequency:440,partialCount:0,partials:[],phase:0,type:"sine"})}_start(e){const t=this.toSeconds(e),n=new li({context:this.context,onended:()=>this.onstop(this)});this._oscillator=n,this._wave?this._oscillator.setPeriodicWave(this._wave):this._oscillator.type=this._type,this._oscillator.connect(this.output),this.frequency.connect(this._oscillator.frequency),this.detune.connect(this._oscillator.detune),this._oscillator.start(t)}_stop(e){const t=this.toSeconds(e);this._oscillator&&this._oscillator.stop(t)}_restart(e){const t=this.toSeconds(e);return this.log("restart",t),this._oscillator&&this._oscillator.cancelStop(),this._state.cancel(t),this}syncFrequency(){return this.context.transport.syncSignal(this.frequency),this}unsyncFrequency(){return this.context.transport.unsyncSignal(this.frequency),this}_getCachedPeriodicWave(){if("custom"===this._type){return ui._periodicWaveCache.find((e=>{return e.phase===this._phase&&(t=e.partials,n=this._partials,t.length===n.length&&t.every(((e,t)=>n[t]===e)));var t,n}))}{const e=ui._periodicWaveCache.find((e=>e.type===this._type&&e.phase===this._phase));return this._partialCount=e?e.partialCount:this._partialCount,e}}get type(){return this._type}set type(e){this._type=e;const t=-1!==["sine","square","sawtooth","triangle"].indexOf(e);if(0===this._phase&&t)this._wave=void 0,this._partialCount=0,null!==this._oscillator&&(this._oscillator.type=e);else{const t=this._getCachedPeriodicWave();if(dr(t)){const{partials:e,wave:n}=t;this._wave=n,this._partials=e,null!==this._oscillator&&this._oscillator.setPeriodicWave(this._wave)}else{const[t,n]=this._getRealImaginary(e,this._phase),s=this.context.createPeriodicWave(t,n);this._wave=s,null!==this._oscillator&&this._oscillator.setPeriodicWave(this._wave),ui._periodicWaveCache.push({imag:n,partialCount:this._partialCount,partials:this._partials,phase:this._phase,real:t,type:this._type,wave:this._wave}),ui._periodicWaveCache.length>100&&ui._periodicWaveCache.shift()}}}get baseType(){return this._type.replace(this.partialCount.toString(),"")}set baseType(e){this.partialCount&&"custom"!==this._type&&"custom"!==e?this.type=e+this.partialCount:this.type=e}get partialCount(){return this._partialCount}set partialCount(e){ar(e,0);let t=this._type;const n=/^(sine|triangle|square|sawtooth)(\d+)$/.exec(this._type);if(n&&(t=n[1]),"custom"!==this._type)this.type=0===e?t:t+e.toString();else{const t=new Float32Array(e);this._partials.forEach(((e,n)=>t[n]=e)),this._partials=Array.from(t),this.type=this._type}}_getRealImaginary(e,t){let n=2048;const s=new Float32Array(n),r=new Float32Array(n);let a=1;if("custom"===e){if(a=this._partials.length+1,this._partialCount=this._partials.length,n=a,0===this._partials.length)return[s,r]}else{const t=/^(sine|triangle|square|sawtooth)(\d+)$/.exec(e);t?(a=parseInt(t[2],10)+1,this._partialCount=parseInt(t[2],10),e=t[1],a=Math.max(a,2),n=a):this._partialCount=0,this._partials=[]}for(let i=1;i>1&1?-1:1):0,this._partials[i-1]=o;break;case"custom":o=this._partials[i-1];break;default:throw new TypeError("Oscillator: invalid type: "+e)}0!==o?(s[i]=-o*Math.sin(t*i),r[i]=o*Math.cos(t*i)):(s[i]=0,r[i]=0)}return[s,r]}_inverseFFT(e,t,n){let s=0;const r=e.length;for(let a=0;at.includes(e))),"oversampling must be either 'none', '2x', or '4x'"),this._shaper.oversample=e}dispose(){return super.dispose(),this._shaper.disconnect(),this}}class di extends ci{constructor(){super(...arguments),this.name="AudioToGain",this._norm=new hi({context:this.context,mapping:e=>(e+1)/2}),this.input=this._norm,this.output=this._norm}dispose(){return super.dispose(),this._norm.dispose(),this}}class pi extends Ra{constructor(){super(Object.assign(Rr(pi.getDefaults(),arguments,["value"]))),this.name="Multiply",this.override=!1;const e=Rr(pi.getDefaults(),arguments,["value"]);this._mult=this.input=this.output=new Ta({context:this.context,minValue:e.minValue,maxValue:e.maxValue}),this.factor=this._param=this._mult.gain,this.factor.setValueAtTime(e.value,0)}static getDefaults(){return Object.assign(Ra.getDefaults(),{value:0})}dispose(){return super.dispose(),this._mult.dispose(),this}}class fi extends ei{constructor(){super(Rr(fi.getDefaults(),arguments,["frequency","type","modulationType"])),this.name="AMOscillator",this._modulationScale=new di({context:this.context}),this._modulationNode=new Ta({context:this.context});const e=Rr(fi.getDefaults(),arguments,["frequency","type","modulationType"]);this._carrier=new ui({context:this.context,detune:e.detune,frequency:e.frequency,onstop:()=>this.onstop(this),phase:e.phase,type:e.type}),this.frequency=this._carrier.frequency,this.detune=this._carrier.detune,this._modulator=new ui({context:this.context,phase:e.phase,type:e.modulationType}),this.harmonicity=new pi({context:this.context,units:"positive",value:e.harmonicity}),this.frequency.chain(this.harmonicity,this._modulator.frequency),this._modulator.chain(this._modulationScale,this._modulationNode.gain),this._carrier.chain(this._modulationNode,this.output),Zr(this,["frequency","detune","harmonicity"])}static getDefaults(){return Object.assign(ui.getDefaults(),{harmonicity:1,modulationType:"square"})}_start(e){this._modulator.start(e),this._carrier.start(e)}_stop(e){this._modulator.stop(e),this._carrier.stop(e)}_restart(e){this._modulator.restart(e),this._carrier.restart(e)}get type(){return this._carrier.type}set type(e){this._carrier.type=e}get baseType(){return this._carrier.baseType}set baseType(e){this._carrier.baseType=e}get partialCount(){return this._carrier.partialCount}set partialCount(e){this._carrier.partialCount=e}get modulationType(){return this._modulator.type}set modulationType(e){this._modulator.type=e}get phase(){return this._carrier.phase}set phase(e){this._carrier.phase=e,this._modulator.phase=e}get partials(){return this._carrier.partials}set partials(e){this._carrier.partials=e}asArray(e=1024){return kr(this,void 0,void 0,(function*(){return oi(this,e)}))}dispose(){return super.dispose(),this.frequency.dispose(),this.detune.dispose(),this.harmonicity.dispose(),this._carrier.dispose(),this._modulator.dispose(),this._modulationNode.dispose(),this._modulationScale.dispose(),this}}class mi extends ei{constructor(){super(Rr(mi.getDefaults(),arguments,["frequency","type","modulationType"])),this.name="FMOscillator",this._modulationNode=new Ta({context:this.context,gain:0});const e=Rr(mi.getDefaults(),arguments,["frequency","type","modulationType"]);this._carrier=new ui({context:this.context,detune:e.detune,frequency:0,onstop:()=>this.onstop(this),phase:e.phase,type:e.type}),this.detune=this._carrier.detune,this.frequency=new Ra({context:this.context,units:"frequency",value:e.frequency}),this._modulator=new ui({context:this.context,phase:e.phase,type:e.modulationType}),this.harmonicity=new pi({context:this.context,units:"positive",value:e.harmonicity}),this.modulationIndex=new pi({context:this.context,units:"positive",value:e.modulationIndex}),this.frequency.connect(this._carrier.frequency),this.frequency.chain(this.harmonicity,this._modulator.frequency),this.frequency.chain(this.modulationIndex,this._modulationNode),this._modulator.connect(this._modulationNode.gain),this._modulationNode.connect(this._carrier.frequency),this._carrier.connect(this.output),this.detune.connect(this._modulator.detune),Zr(this,["modulationIndex","frequency","detune","harmonicity"])}static getDefaults(){return Object.assign(ui.getDefaults(),{harmonicity:1,modulationIndex:2,modulationType:"square"})}_start(e){this._modulator.start(e),this._carrier.start(e)}_stop(e){this._modulator.stop(e),this._carrier.stop(e)}_restart(e){return this._modulator.restart(e),this._carrier.restart(e),this}get type(){return this._carrier.type}set type(e){this._carrier.type=e}get baseType(){return this._carrier.baseType}set baseType(e){this._carrier.baseType=e}get partialCount(){return this._carrier.partialCount}set partialCount(e){this._carrier.partialCount=e}get modulationType(){return this._modulator.type}set modulationType(e){this._modulator.type=e}get phase(){return this._carrier.phase}set phase(e){this._carrier.phase=e,this._modulator.phase=e}get partials(){return this._carrier.partials}set partials(e){this._carrier.partials=e}asArray(e=1024){return kr(this,void 0,void 0,(function*(){return oi(this,e)}))}dispose(){return super.dispose(),this.frequency.dispose(),this.harmonicity.dispose(),this._carrier.dispose(),this._modulator.dispose(),this._modulationNode.dispose(),this.modulationIndex.dispose(),this}}class gi extends ei{constructor(){super(Rr(gi.getDefaults(),arguments,["frequency","width"])),this.name="PulseOscillator",this._widthGate=new Ta({context:this.context,gain:0}),this._thresh=new hi({context:this.context,mapping:e=>e<=0?-1:1});const e=Rr(gi.getDefaults(),arguments,["frequency","width"]);this.width=new Ra({context:this.context,units:"audioRange",value:e.width}),this._triangle=new ui({context:this.context,detune:e.detune,frequency:e.frequency,onstop:()=>this.onstop(this),phase:e.phase,type:"triangle"}),this.frequency=this._triangle.frequency,this.detune=this._triangle.detune,this._triangle.chain(this._thresh,this.output),this.width.chain(this._widthGate,this._thresh),Zr(this,["width","frequency","detune"])}static getDefaults(){return Object.assign(ei.getDefaults(),{detune:0,frequency:440,phase:0,type:"pulse",width:.2})}_start(e){e=this.toSeconds(e),this._triangle.start(e),this._widthGate.gain.setValueAtTime(1,e)}_stop(e){e=this.toSeconds(e),this._triangle.stop(e),this._widthGate.gain.cancelScheduledValues(e),this._widthGate.gain.setValueAtTime(0,e)}_restart(e){this._triangle.restart(e),this._widthGate.gain.cancelScheduledValues(e),this._widthGate.gain.setValueAtTime(1,e)}get phase(){return this._triangle.phase}set phase(e){this._triangle.phase=e}get type(){return"pulse"}get baseType(){return"pulse"}get partials(){return[]}get partialCount(){return 0}set carrierType(e){this._triangle.type=e}asArray(e=1024){return kr(this,void 0,void 0,(function*(){return oi(this,e)}))}dispose(){return super.dispose(),this._triangle.dispose(),this.width.dispose(),this._widthGate.dispose(),this._thresh.dispose(),this}}class yi extends ei{constructor(){super(Rr(yi.getDefaults(),arguments,["frequency","type","spread"])),this.name="FatOscillator",this._oscillators=[];const e=Rr(yi.getDefaults(),arguments,["frequency","type","spread"]);this.frequency=new Ra({context:this.context,units:"frequency",value:e.frequency}),this.detune=new Ra({context:this.context,units:"cents",value:e.detune}),this._spread=e.spread,this._type=e.type,this._phase=e.phase,this._partials=e.partials,this._partialCount=e.partialCount,this.count=e.count,Zr(this,["frequency","detune"])}static getDefaults(){return Object.assign(ui.getDefaults(),{count:3,spread:20,type:"sawtooth"})}_start(e){e=this.toSeconds(e),this._forEach((t=>t.start(e)))}_stop(e){e=this.toSeconds(e),this._forEach((t=>t.stop(e)))}_restart(e){this._forEach((t=>t.restart(e)))}_forEach(e){for(let t=0;tt.type=e))}get spread(){return this._spread}set spread(e){if(this._spread=e,this._oscillators.length>1){const t=-e/2,n=e/(this._oscillators.length-1);this._forEach(((e,s)=>e.detune.value=t+n*s))}}get count(){return this._oscillators.length}set count(e){if(ar(e,1),this._oscillators.length!==e){this._forEach((e=>e.dispose())),this._oscillators=[];for(let t=0;tthis.onstop(this):Qr});"custom"===this.type&&(n.partials=this._partials),this.frequency.connect(n.frequency),this.detune.connect(n.detune),n.detune.overridden=!1,n.connect(this.output),this._oscillators[t]=n}this.spread=this._spread,"started"===this.state&&this._forEach((e=>e.start()))}}get phase(){return this._phase}set phase(e){this._phase=e,this._forEach(((e,t)=>e.phase=this._phase+t/this.count*360))}get baseType(){return this._oscillators[0].baseType}set baseType(e){this._forEach((t=>t.baseType=e)),this._type=this._oscillators[0].type}get partials(){return this._oscillators[0].partials}set partials(e){this._partials=e,this._partialCount=this._partials.length,e.length&&(this._type="custom",this._forEach((t=>t.partials=e)))}get partialCount(){return this._oscillators[0].partialCount}set partialCount(e){this._partialCount=e,this._forEach((t=>t.partialCount=e)),this._type=this._oscillators[0].type}asArray(e=1024){return kr(this,void 0,void 0,(function*(){return oi(this,e)}))}dispose(){return super.dispose(),this.frequency.dispose(),this.detune.dispose(),this._forEach((e=>e.dispose())),this}}class bi extends ei{constructor(){super(Rr(bi.getDefaults(),arguments,["frequency","modulationFrequency"])),this.name="PWMOscillator",this.sourceType="pwm",this._scale=new pi({context:this.context,value:2});const e=Rr(bi.getDefaults(),arguments,["frequency","modulationFrequency"]);this._pulse=new gi({context:this.context,frequency:e.modulationFrequency}),this._pulse.carrierType="sine",this.modulationFrequency=this._pulse.frequency,this._modulator=new ui({context:this.context,detune:e.detune,frequency:e.frequency,onstop:()=>this.onstop(this),phase:e.phase}),this.frequency=this._modulator.frequency,this.detune=this._modulator.detune,this._modulator.chain(this._scale,this._pulse.width),this._pulse.connect(this.output),Zr(this,["modulationFrequency","frequency","detune"])}static getDefaults(){return Object.assign(ei.getDefaults(),{detune:0,frequency:440,modulationFrequency:.4,phase:0,type:"pwm"})}_start(e){e=this.toSeconds(e),this._modulator.start(e),this._pulse.start(e)}_stop(e){e=this.toSeconds(e),this._modulator.stop(e),this._pulse.stop(e)}_restart(e){this._modulator.restart(e),this._pulse.restart(e)}get type(){return"pwm"}get baseType(){return"pwm"}get partials(){return[]}get partialCount(){return 0}get phase(){return this._modulator.phase}set phase(e){this._modulator.phase=e}asArray(e=1024){return kr(this,void 0,void 0,(function*(){return oi(this,e)}))}dispose(){return super.dispose(),this._pulse.dispose(),this._scale.dispose(),this._modulator.dispose(),this}}const wi={am:fi,fat:yi,fm:mi,oscillator:ui,pulse:gi,pwm:bi};class vi extends ei{constructor(){super(Rr(vi.getDefaults(),arguments,["frequency","type"])),this.name="OmniOscillator";const e=Rr(vi.getDefaults(),arguments,["frequency","type"]);this.frequency=new Ra({context:this.context,units:"frequency",value:e.frequency}),this.detune=new Ra({context:this.context,units:"cents",value:e.detune}),Zr(this,["frequency","detune"]),this.set(e)}static getDefaults(){return Object.assign(ui.getDefaults(),mi.getDefaults(),fi.getDefaults(),yi.getDefaults(),gi.getDefaults(),bi.getDefaults())}_start(e){this._oscillator.start(e)}_stop(e){this._oscillator.stop(e)}_restart(e){return this._oscillator.restart(e),this}get type(){let e="";return["am","fm","fat"].some((e=>this._sourceType===e))&&(e=this._sourceType),e+this._oscillator.type}set type(e){"fm"===e.substr(0,2)?(this._createNewOscillator("fm"),this._oscillator=this._oscillator,this._oscillator.type=e.substr(2)):"am"===e.substr(0,2)?(this._createNewOscillator("am"),this._oscillator=this._oscillator,this._oscillator.type=e.substr(2)):"fat"===e.substr(0,3)?(this._createNewOscillator("fat"),this._oscillator=this._oscillator,this._oscillator.type=e.substr(3)):"pwm"===e?(this._createNewOscillator("pwm"),this._oscillator=this._oscillator):"pulse"===e?this._createNewOscillator("pulse"):(this._createNewOscillator("oscillator"),this._oscillator=this._oscillator,this._oscillator.type=e)}get partials(){return this._oscillator.partials}set partials(e){this._getOscType(this._oscillator,"pulse")||this._getOscType(this._oscillator,"pwm")||(this._oscillator.partials=e)}get partialCount(){return this._oscillator.partialCount}set partialCount(e){this._getOscType(this._oscillator,"pulse")||this._getOscType(this._oscillator,"pwm")||(this._oscillator.partialCount=e)}set(e){return Reflect.has(e,"type")&&e.type&&(this.type=e.type),super.set(e),this}_createNewOscillator(e){if(e!==this._sourceType){this._sourceType=e;const t=wi[e],n=this.now();if(this._oscillator){const e=this._oscillator;e.stop(n),this.context.setTimeout((()=>e.dispose()),this.blockTime)}this._oscillator=new t({context:this.context}),this.frequency.connect(this._oscillator.frequency),this.detune.connect(this._oscillator.detune),this._oscillator.connect(this.output),this._oscillator.onstop=()=>this.onstop(this),"started"===this.state&&this._oscillator.start(n)}}get phase(){return this._oscillator.phase}set phase(e){this._oscillator.phase=e}get sourceType(){return this._sourceType}set sourceType(e){let t="sine";"pwm"!==this._oscillator.type&&"pulse"!==this._oscillator.type&&(t=this._oscillator.type),"fm"===e?this.type="fm"+t:"am"===e?this.type="am"+t:"fat"===e?this.type="fat"+t:"oscillator"===e?this.type=t:"pulse"===e?this.type="pulse":"pwm"===e&&(this.type="pwm")}_getOscType(e,t){return e instanceof wi[t]}get baseType(){return this._oscillator.baseType}set baseType(e){this._getOscType(this._oscillator,"pulse")||this._getOscType(this._oscillator,"pwm")||"pulse"===e||"pwm"===e||(this._oscillator.baseType=e)}get width(){return this._getOscType(this._oscillator,"pulse")?this._oscillator.width:void 0}get count(){return this._getOscType(this._oscillator,"fat")?this._oscillator.count:void 0}set count(e){this._getOscType(this._oscillator,"fat")&&fr(e)&&(this._oscillator.count=e)}get spread(){return this._getOscType(this._oscillator,"fat")?this._oscillator.spread:void 0}set spread(e){this._getOscType(this._oscillator,"fat")&&fr(e)&&(this._oscillator.spread=e)}get modulationType(){return this._getOscType(this._oscillator,"fm")||this._getOscType(this._oscillator,"am")?this._oscillator.modulationType:void 0}set modulationType(e){(this._getOscType(this._oscillator,"fm")||this._getOscType(this._oscillator,"am"))&&br(e)&&(this._oscillator.modulationType=e)}get modulationIndex(){return this._getOscType(this._oscillator,"fm")?this._oscillator.modulationIndex:void 0}get harmonicity(){return this._getOscType(this._oscillator,"fm")||this._getOscType(this._oscillator,"am")?this._oscillator.harmonicity:void 0}get modulationFrequency(){return this._getOscType(this._oscillator,"pwm")?this._oscillator.modulationFrequency:void 0}asArray(e=1024){return kr(this,void 0,void 0,(function*(){return oi(this,e)}))}dispose(){return super.dispose(),this.detune.dispose(),this.frequency.dispose(),this._oscillator.dispose(),this}}class xi extends Ra{constructor(){super(Object.assign(Rr(xi.getDefaults(),arguments,["value"]))),this.override=!1,this.name="Add",this._sum=new Ta({context:this.context}),this.input=this._sum,this.output=this._sum,this.addend=this._param,Ea(this._constantSource,this._sum)}static getDefaults(){return Object.assign(Ra.getDefaults(),{value:0})}dispose(){return super.dispose(),this._sum.dispose(),this}}class Ai extends ci{constructor(){super(Object.assign(Rr(Ai.getDefaults(),arguments,["min","max"]))),this.name="Scale";const e=Rr(Ai.getDefaults(),arguments,["min","max"]);this._mult=this.input=new pi({context:this.context,value:e.max-e.min}),this._add=this.output=new xi({context:this.context,value:e.min}),this._min=e.min,this._max=e.max,this.input.connect(this.output)}static getDefaults(){return Object.assign(ci.getDefaults(),{max:1,min:0})}get min(){return this._min}set min(e){this._min=e,this._setRange()}get max(){return this._max}set max(e){this._max=e,this._setRange()}_setRange(){this._add.value=this._min,this._mult.value=this._max-this._min}dispose(){return super.dispose(),this._add.dispose(),this._mult.dispose(),this}}class ki extends ci{constructor(){super(Object.assign(Rr(ki.getDefaults(),arguments))),this.name="Zero",this._gain=new Ta({context:this.context}),this.output=this._gain,this.input=void 0,_a(this.context.getConstant(0),this._gain)}dispose(){return super.dispose(),Ia(this.context.getConstant(0),this._gain),this}}class Ci extends Sa{constructor(){super(Rr(Ci.getDefaults(),arguments,["frequency","min","max"])),this.name="LFO",this._stoppedValue=0,this._units="number",this.convert=!0,this._fromType=Ca.prototype._fromType,this._toType=Ca.prototype._toType,this._is=Ca.prototype._is,this._clampValue=Ca.prototype._clampValue;const e=Rr(Ci.getDefaults(),arguments,["frequency","min","max"]);this._oscillator=new ui(e),this.frequency=this._oscillator.frequency,this._amplitudeGain=new Ta({context:this.context,gain:e.amplitude,units:"normalRange"}),this.amplitude=this._amplitudeGain.gain,this._stoppedSignal=new Ra({context:this.context,units:"audioRange",value:0}),this._zeros=new ki({context:this.context}),this._a2g=new di({context:this.context}),this._scaler=this.output=new Ai({context:this.context,max:e.max,min:e.min}),this.units=e.units,this.min=e.min,this.max=e.max,this._oscillator.chain(this._amplitudeGain,this._a2g,this._scaler),this._zeros.connect(this._a2g),this._stoppedSignal.connect(this._a2g),Zr(this,["amplitude","frequency"]),this.phase=e.phase}static getDefaults(){return Object.assign(ui.getDefaults(),{amplitude:1,frequency:"4n",max:1,min:0,type:"sine",units:"number"})}start(e){return e=this.toSeconds(e),this._stoppedSignal.setValueAtTime(0,e),this._oscillator.start(e),this}stop(e){return e=this.toSeconds(e),this._stoppedSignal.setValueAtTime(this._stoppedValue,e),this._oscillator.stop(e),this}sync(){return this._oscillator.sync(),this._oscillator.syncFrequency(),this}unsync(){return this._oscillator.unsync(),this._oscillator.unsyncFrequency(),this}_setStoppedValue(){this._stoppedValue=this._oscillator.getInitialValue(),this._stoppedSignal.value=this._stoppedValue}get min(){return this._toType(this._scaler.min)}set min(e){e=this._fromType(e),this._scaler.min=e}get max(){return this._toType(this._scaler.max)}set max(e){e=this._fromType(e),this._scaler.max=e}get type(){return this._oscillator.type}set type(e){this._oscillator.type=e,this._setStoppedValue()}get partials(){return this._oscillator.partials}set partials(e){this._oscillator.partials=e,this._setStoppedValue()}get phase(){return this._oscillator.phase}set phase(e){this._oscillator.phase=e,this._setStoppedValue()}get units(){return this._units}set units(e){const t=this.min,n=this.max;this._units=e,this.min=t,this.max=n}get state(){return this._oscillator.state}connect(e,t,n){return(e instanceof Ca||e instanceof Ra)&&(this.convert=e.convert,this.units=e.units),Da(this,e,t,n),this}dispose(){return super.dispose(),this._oscillator.dispose(),this._stoppedSignal.dispose(),this._zeros.dispose(),this._scaler.dispose(),this._a2g.dispose(),this._amplitudeGain.dispose(),this.amplitude.dispose(),this}}function Si(e,t=1/0){const n=new WeakMap;return function(s,r){Reflect.defineProperty(s,r,{configurable:!0,enumerable:!0,get:function(){return n.get(this)},set:function(s){ar(s,e,t),n.set(this,s)}})}}function Ei(e,t=1/0){const n=new WeakMap;return function(s,r){Reflect.defineProperty(s,r,{configurable:!0,enumerable:!0,get:function(){return n.get(this)},set:function(s){ar(this.toSeconds(s),e,t),n.set(this,s)}})}}class _i extends ei{constructor(){super(Rr(_i.getDefaults(),arguments,["url","onload"])),this.name="Player",this._activeSources=new Set;const e=Rr(_i.getDefaults(),arguments,["url","onload"]);this._buffer=new Jr({onload:this._onload.bind(this,e.onload),onerror:e.onerror,reverse:e.reverse,url:e.url}),this.autostart=e.autostart,this._loop=e.loop,this._loopStart=e.loopStart,this._loopEnd=e.loopEnd,this._playbackRate=e.playbackRate,this.fadeIn=e.fadeIn,this.fadeOut=e.fadeOut}static getDefaults(){return Object.assign(ei.getDefaults(),{autostart:!1,fadeIn:0,fadeOut:0,loop:!1,loopEnd:0,loopStart:0,onload:Qr,onerror:Qr,playbackRate:1,reverse:!1})}load(e){return kr(this,void 0,void 0,(function*(){return yield this._buffer.load(e),this._onload(),this}))}_onload(e=Qr){e(),this.autostart&&this.start()}_onSourceEnd(e){this.onstop(this),this._activeSources.delete(e),0!==this._activeSources.size||this._synced||"started"!==this._state.getValueAtTime(this.now())||(this._state.cancel(this.now()),this._state.setStateAtTime("stopped",this.now()))}start(e,t,n){return super.start(e,t,n),this}_start(e,t,n){t=this._loop?Dr(t,this._loopStart):Dr(t,0);const s=this.toSeconds(t),r=n;n=Dr(n,Math.max(this._buffer.duration-s,0));let a=this.toSeconds(n);a/=this._playbackRate,e=this.toSeconds(e);const i=new ti({url:this._buffer,context:this.context,fadeIn:this.fadeIn,fadeOut:this.fadeOut,loop:this._loop,loopEnd:this._loopEnd,loopStart:this._loopStart,onended:this._onSourceEnd.bind(this),playbackRate:this._playbackRate}).connect(this.output);this._loop||this._synced||(this._state.cancel(e+a),this._state.setStateAtTime("stopped",e+a,{implicitEnd:!0})),this._activeSources.add(i),this._loop&&hr(r)?i.start(e,s):i.start(e,s,a-this.toSeconds(this.fadeOut))}_stop(e){const t=this.toSeconds(e);this._activeSources.forEach((e=>e.stop(t)))}restart(e,t,n){return super.restart(e,t,n),this}_restart(e,t,n){this._stop(e),this._start(e,t,n)}seek(e,t){const n=this.toSeconds(t);if("started"===this._state.getValueAtTime(n)){const t=this.toSeconds(e);this._stop(n),this._start(n,t)}return this}setLoopPoints(e,t){return this.loopStart=e,this.loopEnd=t,this}get loopStart(){return this._loopStart}set loopStart(e){this._loopStart=e,this.buffer.loaded&&ar(this.toSeconds(e),0,this.buffer.duration),this._activeSources.forEach((t=>{t.loopStart=e}))}get loopEnd(){return this._loopEnd}set loopEnd(e){this._loopEnd=e,this.buffer.loaded&&ar(this.toSeconds(e),0,this.buffer.duration),this._activeSources.forEach((t=>{t.loopEnd=e}))}get buffer(){return this._buffer}set buffer(e){this._buffer.set(e)}get loop(){return this._loop}set loop(e){if(this._loop!==e&&(this._loop=e,this._activeSources.forEach((t=>{t.loop=e})),e)){const e=this._state.getNextState("stopped",this.now());e&&this._state.cancel(e.time)}}get playbackRate(){return this._playbackRate}set playbackRate(e){this._playbackRate=e;const t=this.now(),n=this._state.getNextState("stopped",t);n&&n.implicitEnd&&(this._state.cancel(n.time),this._activeSources.forEach((e=>e.cancelStop()))),this._activeSources.forEach((n=>{n.playbackRate.setValueAtTime(e,t)}))}get reverse(){return this._buffer.reverse}set reverse(e){this._buffer.reverse=e}get loaded(){return this._buffer.loaded}dispose(){return super.dispose(),this._activeSources.forEach((e=>e.dispose())),this._activeSources.clear(),this._buffer.dispose(),this}}Ar([Ei(0)],_i.prototype,"fadeIn",void 0),Ar([Ei(0)],_i.prototype,"fadeOut",void 0);class Ii extends Sa{constructor(){super(Rr(Ii.getDefaults(),arguments,["urls","onload"],"urls")),this.name="Players",this.input=void 0,this._players=new Map;const e=Rr(Ii.getDefaults(),arguments,["urls","onload"],"urls");this._volume=this.output=new Ka({context:this.context,volume:e.volume}),this.volume=this._volume.volume,Zr(this,"volume"),this._buffers=new Va({urls:e.urls,onload:e.onload,baseUrl:e.baseUrl,onerror:e.onerror}),this.mute=e.mute,this._fadeIn=e.fadeIn,this._fadeOut=e.fadeOut}static getDefaults(){return Object.assign(ei.getDefaults(),{baseUrl:"",fadeIn:0,fadeOut:0,mute:!1,onload:Qr,onerror:Qr,urls:{},volume:0})}get mute(){return this._volume.mute}set mute(e){this._volume.mute=e}get fadeIn(){return this._fadeIn}set fadeIn(e){this._fadeIn=e,this._players.forEach((t=>{t.fadeIn=e}))}get fadeOut(){return this._fadeOut}set fadeOut(e){this._fadeOut=e,this._players.forEach((t=>{t.fadeOut=e}))}get state(){return Array.from(this._players).some((([e,t])=>"started"===t.state))?"started":"stopped"}has(e){return this._buffers.has(e)}player(e){if(rr(this.has(e),`No Player with the name ${e} exists on this object`),!this._players.has(e)){const t=new _i({context:this.context,fadeIn:this._fadeIn,fadeOut:this._fadeOut,url:this._buffers.get(e)}).connect(this.output);this._players.set(e,t)}return this._players.get(e)}get loaded(){return this._buffers.loaded}add(e,t,n){return rr(!this._buffers.has(e),"A buffer with that name already exists on this object"),this._buffers.add(e,t,n),this}stopAll(e){return this._players.forEach((t=>t.stop(e))),this}dispose(){return super.dispose(),this._volume.dispose(),this.volume.dispose(),this._players.forEach((e=>e.dispose())),this._buffers.dispose(),this}}class Ti extends ei{constructor(){super(Rr(Ti.getDefaults(),arguments,["url","onload"])),this.name="GrainPlayer",this._loopStart=0,this._loopEnd=0,this._activeSources=[];const e=Rr(Ti.getDefaults(),arguments,["url","onload"]);this.buffer=new Jr({onload:e.onload,onerror:e.onerror,reverse:e.reverse,url:e.url}),this._clock=new za({context:this.context,callback:this._tick.bind(this),frequency:1/e.grainSize}),this._playbackRate=e.playbackRate,this._grainSize=e.grainSize,this._overlap=e.overlap,this.detune=e.detune,this.overlap=e.overlap,this.loop=e.loop,this.playbackRate=e.playbackRate,this.grainSize=e.grainSize,this.loopStart=e.loopStart,this.loopEnd=e.loopEnd,this.reverse=e.reverse,this._clock.on("stop",this._onstop.bind(this))}static getDefaults(){return Object.assign(ei.getDefaults(),{onload:Qr,onerror:Qr,overlap:.1,grainSize:.2,playbackRate:1,detune:0,loop:!1,loopStart:0,loopEnd:0,reverse:!1})}_start(e,t,n){t=Dr(t,0),t=this.toSeconds(t),e=this.toSeconds(e);const s=1/this._clock.frequency.getValueAtTime(e);this._clock.start(e,t/s),n&&this.stop(e+this.toSeconds(n))}restart(e,t,n){return super.restart(e,t,n),this}_restart(e,t,n){this._stop(e),this._start(e,t,n)}_stop(e){this._clock.stop(e)}_onstop(e){this._activeSources.forEach((t=>{t.fadeOut=0,t.stop(e)})),this.onstop(this)}_tick(e){const t=this._clock.getTicksAtTime(e),n=t*this._grainSize;if(this.log("offset",n),!this.loop&&n>this.buffer.duration)return void this.stop(e);const s=n{const e=this._activeSources.indexOf(r);-1!==e&&this._activeSources.splice(e,1)}}get playbackRate(){return this._playbackRate}set playbackRate(e){ar(e,.001),this._playbackRate=e,this.grainSize=this._grainSize}get loopStart(){return this._loopStart}set loopStart(e){this.buffer.loaded&&ar(this.toSeconds(e),0,this.buffer.duration),this._loopStart=this.toSeconds(e)}get loopEnd(){return this._loopEnd}set loopEnd(e){this.buffer.loaded&&ar(this.toSeconds(e),0,this.buffer.duration),this._loopEnd=this.toSeconds(e)}get reverse(){return this.buffer.reverse}set reverse(e){this.buffer.reverse=e}get grainSize(){return this._grainSize}set grainSize(e){this._grainSize=this.toSeconds(e),this._clock.frequency.setValueAtTime(this._playbackRate/this._grainSize,this.now())}get overlap(){return this._overlap}set overlap(e){const t=this.toSeconds(e);ar(t,0),this._overlap=t}get loaded(){return this.buffer.loaded}dispose(){return super.dispose(),this.buffer.dispose(),this._clock.dispose(),this._activeSources.forEach((e=>e.dispose())),this}}class Ni extends ci{constructor(){super(...arguments),this.name="Abs",this._abs=new hi({context:this.context,mapping:e=>Math.abs(e)<.001?0:Math.abs(e)}),this.input=this._abs,this.output=this._abs}dispose(){return super.dispose(),this._abs.dispose(),this}}class Oi extends ci{constructor(){super(...arguments),this.name="GainToAudio",this._norm=new hi({context:this.context,mapping:e=>2*Math.abs(e)-1}),this.input=this._norm,this.output=this._norm}dispose(){return super.dispose(),this._norm.dispose(),this}}class Ri extends ci{constructor(){super(...arguments),this.name="Negate",this._multiply=new pi({context:this.context,value:-1}),this.input=this._multiply,this.output=this._multiply}dispose(){return super.dispose(),this._multiply.dispose(),this}}class Di extends Ra{constructor(){super(Object.assign(Rr(Di.getDefaults(),arguments,["value"]))),this.override=!1,this.name="Subtract",this._sum=new Ta({context:this.context}),this.input=this._sum,this.output=this._sum,this._neg=new Ri({context:this.context}),this.subtrahend=this._param,Ea(this._constantSource,this._neg,this._sum)}static getDefaults(){return Object.assign(Ra.getDefaults(),{value:0})}dispose(){return super.dispose(),this._neg.dispose(),this._sum.dispose(),this}}class Mi extends ci{constructor(){super(Object.assign(Rr(Mi.getDefaults(),arguments))),this.name="GreaterThanZero",this._thresh=this.output=new hi({context:this.context,length:127,mapping:e=>e<=0?0:1}),this._scale=this.input=new pi({context:this.context,value:1e4}),this._scale.connect(this._thresh)}dispose(){return super.dispose(),this._scale.dispose(),this._thresh.dispose(),this}}class Fi extends Ra{constructor(){super(Object.assign(Rr(Fi.getDefaults(),arguments,["value"]))),this.name="GreaterThan",this.override=!1;const e=Rr(Fi.getDefaults(),arguments,["value"]);this._subtract=this.input=new Di({context:this.context,value:e.value}),this._gtz=this.output=new Mi({context:this.context}),this.comparator=this._param=this._subtract.subtrahend,Zr(this,"comparator"),this._subtract.connect(this._gtz)}static getDefaults(){return Object.assign(Ra.getDefaults(),{value:0})}dispose(){return super.dispose(),this._gtz.dispose(),this._subtract.dispose(),this.comparator.dispose(),this}}class Bi extends ci{constructor(){super(Object.assign(Rr(Bi.getDefaults(),arguments,["value"]))),this.name="Pow";const e=Rr(Bi.getDefaults(),arguments,["value"]);this._exponentScaler=this.input=this.output=new hi({context:this.context,mapping:this._expFunc(e.value),length:8192}),this._exponent=e.value}static getDefaults(){return Object.assign(ci.getDefaults(),{value:1})}_expFunc(e){return t=>Math.pow(Math.abs(t),e)}get value(){return this._exponent}set value(e){this._exponent=e,this._exponentScaler.setMap(this._expFunc(this._exponent))}dispose(){return super.dispose(),this._exponentScaler.dispose(),this}}class zi extends Ai{constructor(){super(Object.assign(Rr(zi.getDefaults(),arguments,["min","max","exponent"]))),this.name="ScaleExp";const e=Rr(zi.getDefaults(),arguments,["min","max","exponent"]);this.input=this._exp=new Bi({context:this.context,value:e.exponent}),this._exp.connect(this._mult)}static getDefaults(){return Object.assign(Ai.getDefaults(),{exponent:1})}get exponent(){return this._exp.value}set exponent(e){this._exp.value=e}dispose(){return super.dispose(),this._exp.dispose(),this}}class Li extends Ra{constructor(){super(Rr(Ra.getDefaults(),arguments,["value","units"])),this.name="SyncedSignal",this.override=!1;const e=Rr(Ra.getDefaults(),arguments,["value","units"]);this._lastVal=e.value,this._synced=this.context.transport.scheduleRepeat(this._onTick.bind(this),"1i"),this._syncedCallback=this._anchorValue.bind(this),this.context.transport.on("start",this._syncedCallback),this.context.transport.on("pause",this._syncedCallback),this.context.transport.on("stop",this._syncedCallback),this._constantSource.disconnect(),this._constantSource.stop(0),this._constantSource=this.output=new Oa({context:this.context,offset:e.value,units:e.units}).start(0),this.setValueAtTime(e.value,0)}_onTick(e){const t=super.getValueAtTime(this.context.transport.seconds);this._lastVal!==t&&(this._lastVal=t,this._constantSource.offset.setValueAtTime(t,e))}_anchorValue(e){const t=super.getValueAtTime(this.context.transport.seconds);this._lastVal=t,this._constantSource.offset.cancelAndHoldAtTime(e),this._constantSource.offset.setValueAtTime(t,e)}getValueAtTime(e){const t=new va(this.context,e).toSeconds();return super.getValueAtTime(t)}setValueAtTime(e,t){const n=new va(this.context,t).toSeconds();return super.setValueAtTime(e,n),this}linearRampToValueAtTime(e,t){const n=new va(this.context,t).toSeconds();return super.linearRampToValueAtTime(e,n),this}exponentialRampToValueAtTime(e,t){const n=new va(this.context,t).toSeconds();return super.exponentialRampToValueAtTime(e,n),this}setTargetAtTime(e,t,n){const s=new va(this.context,t).toSeconds();return super.setTargetAtTime(e,s,n),this}cancelScheduledValues(e){const t=new va(this.context,e).toSeconds();return super.cancelScheduledValues(t),this}setValueCurveAtTime(e,t,n,s){const r=new va(this.context,t).toSeconds();return n=this.toSeconds(n),super.setValueCurveAtTime(e,r,n,s),this}cancelAndHoldAtTime(e){const t=new va(this.context,e).toSeconds();return super.cancelAndHoldAtTime(t),this}setRampPoint(e){const t=new va(this.context,e).toSeconds();return super.setRampPoint(t),this}exponentialRampTo(e,t,n){const s=new va(this.context,n).toSeconds();return super.exponentialRampTo(e,t,s),this}linearRampTo(e,t,n){const s=new va(this.context,n).toSeconds();return super.linearRampTo(e,t,s),this}targetRampTo(e,t,n){const s=new va(this.context,n).toSeconds();return super.targetRampTo(e,t,s),this}dispose(){return super.dispose(),this.context.transport.clear(this._synced),this.context.transport.off("start",this._syncedCallback),this.context.transport.off("pause",this._syncedCallback),this.context.transport.off("stop",this._syncedCallback),this._constantSource.dispose(),this}}class Pi extends Sa{constructor(){super(Rr(Pi.getDefaults(),arguments,["attack","decay","sustain","release"])),this.name="Envelope",this._sig=new Ra({context:this.context,value:0}),this.output=this._sig,this.input=void 0;const e=Rr(Pi.getDefaults(),arguments,["attack","decay","sustain","release"]);this.attack=e.attack,this.decay=e.decay,this.sustain=e.sustain,this.release=e.release,this.attackCurve=e.attackCurve,this.releaseCurve=e.releaseCurve,this.decayCurve=e.decayCurve}static getDefaults(){return Object.assign(Sa.getDefaults(),{attack:.01,attackCurve:"linear",decay:.1,decayCurve:"exponential",release:1,releaseCurve:"exponential",sustain:.5})}get value(){return this.getValueAtTime(this.now())}_getCurve(e,t){if(br(e))return e;{let n;for(n in Vi)if(Vi[n][t]===e)return n;return e}}_setCurve(e,t,n){if(br(n)&&Reflect.has(Vi,n)){const s=Vi[n];mr(s)?"_decayCurve"!==e&&(this[e]=s[t]):this[e]=s}else{if(!yr(n)||"_decayCurve"===e)throw new Error("Envelope: invalid curve: "+n);this[e]=n}}get attackCurve(){return this._getCurve(this._attackCurve,"In")}set attackCurve(e){this._setCurve("_attackCurve","In",e)}get releaseCurve(){return this._getCurve(this._releaseCurve,"Out")}set releaseCurve(e){this._setCurve("_releaseCurve","Out",e)}get decayCurve(){return this._decayCurve}set decayCurve(e){rr(["linear","exponential"].some((t=>t===e)),`Invalid envelope curve: ${e}`),this._decayCurve=e}triggerAttack(e,t=1){this.log("triggerAttack",e,t),e=this.toSeconds(e);let n=this.toSeconds(this.attack);const s=this.toSeconds(this.decay),r=this.getValueAtTime(e);if(r>0){n=(1-r)/(1/n)}if(n0){const n=this.toSeconds(this.release);n{const e=128;let t,n;const s=[];for(t=0;t{const s=e[t],r=this.context.transport.schedule((s=>{e[t]=s,n.apply(this,e)}),s);this._scheduledEvents.push(r)}}unsync(){return this._scheduledEvents.forEach((e=>this.context.transport.clear(e))),this._scheduledEvents=[],this._synced&&(this._synced=!1,this.triggerAttack=this._original_triggerAttack,this.triggerRelease=this._original_triggerRelease),this}triggerAttackRelease(e,t,n,s){const r=this.toSeconds(n),a=this.toSeconds(t);return this.triggerAttack(e,r,s),this.triggerRelease(r+a),this}dispose(){return super.dispose(),this._volume.dispose(),this.unsync(),this._scheduledEvents=[],this}}class Ui extends Wi{constructor(){super(Rr(Ui.getDefaults(),arguments));const e=Rr(Ui.getDefaults(),arguments);this.portamento=e.portamento,this.onsilence=e.onsilence}static getDefaults(){return Object.assign(Wi.getDefaults(),{detune:0,onsilence:Qr,portamento:0})}triggerAttack(e,t,n=1){this.log("triggerAttack",e,t,n);const s=this.toSeconds(t);return this._triggerEnvelopeAttack(s,n),this.setNote(e,s),this}triggerRelease(e){this.log("triggerRelease",e);const t=this.toSeconds(e);return this._triggerEnvelopeRelease(t),this}setNote(e,t){const n=this.toSeconds(t),s=e instanceof ga?e.toFrequency():e;if(this.portamento>0&&this.getLevelAtTime(n)>.05){const e=this.toSeconds(this.portamento);this.frequency.exponentialRampTo(s,e,n)}else this.frequency.setValueAtTime(s,n);return this}}Ar([Ei(0)],Ui.prototype,"portamento",void 0);class Gi extends Pi{constructor(){super(Rr(Gi.getDefaults(),arguments,["attack","decay","sustain","release"])),this.name="AmplitudeEnvelope",this._gainNode=new Ta({context:this.context,gain:0}),this.output=this._gainNode,this.input=this._gainNode,this._sig.connect(this._gainNode.gain),this.output=this._gainNode,this.input=this._gainNode}dispose(){return super.dispose(),this._gainNode.dispose(),this}}class qi extends Ui{constructor(){super(Rr(qi.getDefaults(),arguments)),this.name="Synth";const e=Rr(qi.getDefaults(),arguments);this.oscillator=new vi(Object.assign({context:this.context,detune:e.detune,onstop:()=>this.onsilence(this)},e.oscillator)),this.frequency=this.oscillator.frequency,this.detune=this.oscillator.detune,this.envelope=new Gi(Object.assign({context:this.context},e.envelope)),this.oscillator.chain(this.envelope,this.output),Zr(this,["oscillator","frequency","detune","envelope"])}static getDefaults(){return Object.assign(Ui.getDefaults(),{envelope:Object.assign(Mr(Pi.getDefaults(),Object.keys(Sa.getDefaults())),{attack:.005,decay:.1,release:1,sustain:.3}),oscillator:Object.assign(Mr(vi.getDefaults(),[...Object.keys(ei.getDefaults()),"frequency","detune"]),{type:"triangle"})})}_triggerEnvelopeAttack(e,t){if(this.envelope.triggerAttack(e,t),this.oscillator.start(e),0===this.envelope.sustain){const t=this.toSeconds(this.envelope.attack),n=this.toSeconds(this.envelope.decay);this.oscillator.stop(e+t+n)}}_triggerEnvelopeRelease(e){this.envelope.triggerRelease(e),this.oscillator.stop(e+this.toSeconds(this.envelope.release))}getLevelAtTime(e){return e=this.toSeconds(e),this.envelope.getValueAtTime(e)}dispose(){return super.dispose(),this.oscillator.dispose(),this.envelope.dispose(),this}}class ji extends Ui{constructor(){super(Rr(ji.getDefaults(),arguments)),this.name="ModulationSynth";const e=Rr(ji.getDefaults(),arguments);this._carrier=new qi({context:this.context,oscillator:e.oscillator,envelope:e.envelope,onsilence:()=>this.onsilence(this),volume:-10}),this._modulator=new qi({context:this.context,oscillator:e.modulation,envelope:e.modulationEnvelope,volume:-10}),this.oscillator=this._carrier.oscillator,this.envelope=this._carrier.envelope,this.modulation=this._modulator.oscillator,this.modulationEnvelope=this._modulator.envelope,this.frequency=new Ra({context:this.context,units:"frequency"}),this.detune=new Ra({context:this.context,value:e.detune,units:"cents"}),this.harmonicity=new pi({context:this.context,value:e.harmonicity,minValue:0}),this._modulationNode=new Ta({context:this.context,gain:0}),Zr(this,["frequency","harmonicity","oscillator","envelope","modulation","modulationEnvelope","detune"])}static getDefaults(){return Object.assign(Ui.getDefaults(),{harmonicity:3,oscillator:Object.assign(Mr(vi.getDefaults(),[...Object.keys(ei.getDefaults()),"frequency","detune"]),{type:"sine"}),envelope:Object.assign(Mr(Pi.getDefaults(),Object.keys(Sa.getDefaults())),{attack:.01,decay:.01,sustain:1,release:.5}),modulation:Object.assign(Mr(vi.getDefaults(),[...Object.keys(ei.getDefaults()),"frequency","detune"]),{type:"square"}),modulationEnvelope:Object.assign(Mr(Pi.getDefaults(),Object.keys(Sa.getDefaults())),{attack:.5,decay:0,sustain:1,release:.5})})}_triggerEnvelopeAttack(e,t){this._carrier._triggerEnvelopeAttack(e,t),this._modulator._triggerEnvelopeAttack(e,t)}_triggerEnvelopeRelease(e){return this._carrier._triggerEnvelopeRelease(e),this._modulator._triggerEnvelopeRelease(e),this}getLevelAtTime(e){return e=this.toSeconds(e),this.envelope.getValueAtTime(e)}dispose(){return super.dispose(),this._carrier.dispose(),this._modulator.dispose(),this.frequency.dispose(),this.detune.dispose(),this.harmonicity.dispose(),this._modulationNode.dispose(),this}}class Hi extends ji{constructor(){super(Rr(Hi.getDefaults(),arguments)),this.name="AMSynth",this._modulationScale=new di({context:this.context}),this.frequency.connect(this._carrier.frequency),this.frequency.chain(this.harmonicity,this._modulator.frequency),this.detune.fan(this._carrier.detune,this._modulator.detune),this._modulator.chain(this._modulationScale,this._modulationNode.gain),this._carrier.chain(this._modulationNode,this.output)}dispose(){return super.dispose(),this._modulationScale.dispose(),this}}class $i extends Sa{constructor(){super(Rr($i.getDefaults(),arguments,["frequency","type"])),this.name="BiquadFilter";const e=Rr($i.getDefaults(),arguments,["frequency","type"]);this._filter=this.context.createBiquadFilter(),this.input=this.output=this._filter,this.Q=new Ca({context:this.context,units:"number",value:e.Q,param:this._filter.Q}),this.frequency=new Ca({context:this.context,units:"frequency",value:e.frequency,param:this._filter.frequency}),this.detune=new Ca({context:this.context,units:"cents",value:e.detune,param:this._filter.detune}),this.gain=new Ca({context:this.context,units:"decibels",convert:!1,value:e.gain,param:this._filter.gain}),this.type=e.type}static getDefaults(){return Object.assign(Sa.getDefaults(),{Q:1,type:"lowpass",frequency:350,detune:0,gain:0})}get type(){return this._filter.type}set type(e){rr(-1!==["lowpass","highpass","bandpass","lowshelf","highshelf","notch","allpass","peaking"].indexOf(e),`Invalid filter type: ${e}`),this._filter.type=e}getFrequencyResponse(e=128){const t=new Float32Array(e);for(let n=0;nt.type=e))}get rolloff(){return this._rolloff}set rolloff(e){const t=fr(e)?e:parseInt(e,10),n=[-12,-24,-48,-96];let s=n.indexOf(t);rr(-1!==s,`rolloff can only be ${n.join(", ")}`),s+=1,this._rolloff=t,this.input.disconnect(),this._filters.forEach((e=>e.disconnect())),this._filters=new Array(s);for(let e=0;e1));return this._filters.forEach((()=>{t.getFrequencyResponse(e).forEach(((e,t)=>n[t]*=e))})),t.dispose(),n}dispose(){return super.dispose(),this._filters.forEach((e=>{e.dispose()})),Yr(this,["detune","frequency","gain","Q"]),this.frequency.dispose(),this.Q.dispose(),this.detune.dispose(),this.gain.dispose(),this}}class Xi extends Pi{constructor(){super(Rr(Xi.getDefaults(),arguments,["attack","decay","sustain","release"])),this.name="FrequencyEnvelope";const e=Rr(Xi.getDefaults(),arguments,["attack","decay","sustain","release"]);this._octaves=e.octaves,this._baseFrequency=this.toFrequency(e.baseFrequency),this._exponent=this.input=new Bi({context:this.context,value:e.exponent}),this._scale=this.output=new Ai({context:this.context,min:this._baseFrequency,max:this._baseFrequency*Math.pow(2,this._octaves)}),this._sig.chain(this._exponent,this._scale)}static getDefaults(){return Object.assign(Pi.getDefaults(),{baseFrequency:200,exponent:1,octaves:4})}get baseFrequency(){return this._baseFrequency}set baseFrequency(e){const t=this.toFrequency(e);ar(t,0),this._baseFrequency=t,this._scale.min=this._baseFrequency,this.octaves=this._octaves}get octaves(){return this._octaves}set octaves(e){this._octaves=e,this._scale.max=this._baseFrequency*Math.pow(2,e)}get exponent(){return this._exponent.value}set exponent(e){this._exponent.value=e}dispose(){return super.dispose(),this._exponent.dispose(),this._scale.dispose(),this}}class Zi extends Ui{constructor(){super(Rr(Zi.getDefaults(),arguments)),this.name="MonoSynth";const e=Rr(Zi.getDefaults(),arguments);this.oscillator=new vi(Object.assign(e.oscillator,{context:this.context,detune:e.detune,onstop:()=>this.onsilence(this)})),this.frequency=this.oscillator.frequency,this.detune=this.oscillator.detune,this.filter=new Ki(Object.assign(e.filter,{context:this.context})),this.filterEnvelope=new Xi(Object.assign(e.filterEnvelope,{context:this.context})),this.envelope=new Gi(Object.assign(e.envelope,{context:this.context})),this.oscillator.chain(this.filter,this.envelope,this.output),this.filterEnvelope.connect(this.filter.frequency),Zr(this,["oscillator","frequency","detune","filter","filterEnvelope","envelope"])}static getDefaults(){return Object.assign(Ui.getDefaults(),{envelope:Object.assign(Mr(Pi.getDefaults(),Object.keys(Sa.getDefaults())),{attack:.005,decay:.1,release:1,sustain:.9}),filter:Object.assign(Mr(Ki.getDefaults(),Object.keys(Sa.getDefaults())),{Q:1,rolloff:-12,type:"lowpass"}),filterEnvelope:Object.assign(Mr(Xi.getDefaults(),Object.keys(Sa.getDefaults())),{attack:.6,baseFrequency:200,decay:.2,exponent:2,octaves:3,release:2,sustain:.5}),oscillator:Object.assign(Mr(vi.getDefaults(),Object.keys(ei.getDefaults())),{type:"sawtooth"})})}_triggerEnvelopeAttack(e,t=1){if(this.envelope.triggerAttack(e,t),this.filterEnvelope.triggerAttack(e),this.oscillator.start(e),0===this.envelope.sustain){const t=this.toSeconds(this.envelope.attack),n=this.toSeconds(this.envelope.decay);this.oscillator.stop(e+t+n)}}_triggerEnvelopeRelease(e){this.envelope.triggerRelease(e),this.filterEnvelope.triggerRelease(e),this.oscillator.stop(e+this.toSeconds(this.envelope.release))}getLevelAtTime(e){return e=this.toSeconds(e),this.envelope.getValueAtTime(e)}dispose(){return super.dispose(),this.oscillator.dispose(),this.envelope.dispose(),this.filterEnvelope.dispose(),this.filter.dispose(),this}}class Yi extends Ui{constructor(){super(Rr(Yi.getDefaults(),arguments)),this.name="DuoSynth";const e=Rr(Yi.getDefaults(),arguments);this.voice0=new Zi(Object.assign(e.voice0,{context:this.context,onsilence:()=>this.onsilence(this)})),this.voice1=new Zi(Object.assign(e.voice1,{context:this.context})),this.harmonicity=new pi({context:this.context,units:"positive",value:e.harmonicity}),this._vibrato=new Ci({frequency:e.vibratoRate,context:this.context,min:-50,max:50}),this._vibrato.start(),this.vibratoRate=this._vibrato.frequency,this._vibratoGain=new Ta({context:this.context,units:"normalRange",gain:e.vibratoAmount}),this.vibratoAmount=this._vibratoGain.gain,this.frequency=new Ra({context:this.context,units:"frequency",value:440}),this.detune=new Ra({context:this.context,units:"cents",value:e.detune}),this.frequency.connect(this.voice0.frequency),this.frequency.chain(this.harmonicity,this.voice1.frequency),this._vibrato.connect(this._vibratoGain),this._vibratoGain.fan(this.voice0.detune,this.voice1.detune),this.detune.fan(this.voice0.detune,this.voice1.detune),this.voice0.connect(this.output),this.voice1.connect(this.output),Zr(this,["voice0","voice1","frequency","vibratoAmount","vibratoRate"])}getLevelAtTime(e){return e=this.toSeconds(e),this.voice0.envelope.getValueAtTime(e)+this.voice1.envelope.getValueAtTime(e)}static getDefaults(){return Or(Ui.getDefaults(),{vibratoAmount:.5,vibratoRate:5,harmonicity:1.5,voice0:Or(Mr(Zi.getDefaults(),Object.keys(Ui.getDefaults())),{filterEnvelope:{attack:.01,decay:0,sustain:1,release:.5},envelope:{attack:.01,decay:0,sustain:1,release:.5}}),voice1:Or(Mr(Zi.getDefaults(),Object.keys(Ui.getDefaults())),{filterEnvelope:{attack:.01,decay:0,sustain:1,release:.5},envelope:{attack:.01,decay:0,sustain:1,release:.5}})})}_triggerEnvelopeAttack(e,t){this.voice0._triggerEnvelopeAttack(e,t),this.voice1._triggerEnvelopeAttack(e,t)}_triggerEnvelopeRelease(e){return this.voice0._triggerEnvelopeRelease(e),this.voice1._triggerEnvelopeRelease(e),this}dispose(){return super.dispose(),this.voice0.dispose(),this.voice1.dispose(),this.frequency.dispose(),this.detune.dispose(),this._vibrato.dispose(),this.vibratoRate.dispose(),this._vibratoGain.dispose(),this.harmonicity.dispose(),this}}class Qi extends ji{constructor(){super(Rr(Qi.getDefaults(),arguments)),this.name="FMSynth";const e=Rr(Qi.getDefaults(),arguments);this.modulationIndex=new pi({context:this.context,value:e.modulationIndex}),this.frequency.connect(this._carrier.frequency),this.frequency.chain(this.harmonicity,this._modulator.frequency),this.frequency.chain(this.modulationIndex,this._modulationNode),this.detune.fan(this._carrier.detune,this._modulator.detune),this._modulator.connect(this._modulationNode.gain),this._modulationNode.connect(this._carrier.frequency),this._carrier.connect(this.output)}static getDefaults(){return Object.assign(ji.getDefaults(),{modulationIndex:10})}dispose(){return super.dispose(),this.modulationIndex.dispose(),this}}const Ji=[1,1.483,1.932,2.546,2.63,3.897];class eo extends Ui{constructor(){super(Rr(eo.getDefaults(),arguments)),this.name="MetalSynth",this._oscillators=[],this._freqMultipliers=[];const e=Rr(eo.getDefaults(),arguments);this.detune=new Ra({context:this.context,units:"cents",value:e.detune}),this.frequency=new Ra({context:this.context,units:"frequency"}),this._amplitude=new Ta({context:this.context,gain:0}).connect(this.output),this._highpass=new Ki({Q:0,context:this.context,type:"highpass"}).connect(this._amplitude);for(let t=0;tthis.onsilence(this):Qr,type:"square"});n.connect(this._highpass),this._oscillators[t]=n;const s=new pi({context:this.context,value:Ji[t]});this._freqMultipliers[t]=s,this.frequency.chain(s,n.frequency),this.detune.connect(n.detune)}this._filterFreqScaler=new Ai({context:this.context,max:7e3,min:this.toFrequency(e.resonance)}),this.envelope=new Pi({attack:e.envelope.attack,attackCurve:"linear",context:this.context,decay:e.envelope.decay,release:e.envelope.release,sustain:0}),this.envelope.chain(this._filterFreqScaler,this._highpass.frequency),this.envelope.connect(this._amplitude.gain),this._octaves=e.octaves,this.octaves=e.octaves}static getDefaults(){return Or(Ui.getDefaults(),{envelope:Object.assign(Mr(Pi.getDefaults(),Object.keys(Sa.getDefaults())),{attack:.001,decay:1.4,release:.2}),harmonicity:5.1,modulationIndex:32,octaves:1.5,resonance:4e3})}_triggerEnvelopeAttack(e,t=1){return this.envelope.triggerAttack(e,t),this._oscillators.forEach((t=>t.start(e))),0===this.envelope.sustain&&this._oscillators.forEach((t=>{t.stop(e+this.toSeconds(this.envelope.attack)+this.toSeconds(this.envelope.decay))})),this}_triggerEnvelopeRelease(e){return this.envelope.triggerRelease(e),this._oscillators.forEach((t=>t.stop(e+this.toSeconds(this.envelope.release)))),this}getLevelAtTime(e){return e=this.toSeconds(e),this.envelope.getValueAtTime(e)}get modulationIndex(){return this._oscillators[0].modulationIndex.value}set modulationIndex(e){this._oscillators.forEach((t=>t.modulationIndex.value=e))}get harmonicity(){return this._oscillators[0].harmonicity.value}set harmonicity(e){this._oscillators.forEach((t=>t.harmonicity.value=e))}get resonance(){return this._filterFreqScaler.min}set resonance(e){this._filterFreqScaler.min=this.toFrequency(e),this.octaves=this._octaves}get octaves(){return this._octaves}set octaves(e){this._octaves=e,this._filterFreqScaler.max=this._filterFreqScaler.min*Math.pow(2,e)}dispose(){return super.dispose(),this._oscillators.forEach((e=>e.dispose())),this._freqMultipliers.forEach((e=>e.dispose())),this.frequency.dispose(),this.detune.dispose(),this._filterFreqScaler.dispose(),this._amplitude.dispose(),this.envelope.dispose(),this._highpass.dispose(),this}}class to extends qi{constructor(){super(Rr(to.getDefaults(),arguments)),this.name="MembraneSynth",this.portamento=0;const e=Rr(to.getDefaults(),arguments);this.pitchDecay=e.pitchDecay,this.octaves=e.octaves,Zr(this,["oscillator","envelope"])}static getDefaults(){return Or(Ui.getDefaults(),qi.getDefaults(),{envelope:{attack:.001,attackCurve:"exponential",decay:.4,release:1.4,sustain:.01},octaves:10,oscillator:{type:"sine"},pitchDecay:.05})}setNote(e,t){const n=this.toSeconds(t),s=this.toFrequency(e instanceof ga?e.toFrequency():e),r=s*this.octaves;return this.oscillator.frequency.setValueAtTime(r,n),this.oscillator.frequency.exponentialRampToValueAtTime(s,n+this.toSeconds(this.pitchDecay)),this}dispose(){return super.dispose(),this}}Ar([Si(0)],to.prototype,"octaves",void 0),Ar([Ei(0)],to.prototype,"pitchDecay",void 0);class no extends Wi{constructor(){super(Rr(no.getDefaults(),arguments)),this.name="NoiseSynth";const e=Rr(no.getDefaults(),arguments);this.noise=new ni(Object.assign({context:this.context},e.noise)),this.envelope=new Gi(Object.assign({context:this.context},e.envelope)),this.noise.chain(this.envelope,this.output)}static getDefaults(){return Object.assign(Wi.getDefaults(),{envelope:Object.assign(Mr(Pi.getDefaults(),Object.keys(Sa.getDefaults())),{decay:.1,sustain:0}),noise:Object.assign(Mr(ni.getDefaults(),Object.keys(ei.getDefaults())),{type:"white"})})}triggerAttack(e,t=1){return e=this.toSeconds(e),this.envelope.triggerAttack(e,t),this.noise.start(e),0===this.envelope.sustain&&this.noise.stop(e+this.toSeconds(this.envelope.attack)+this.toSeconds(this.envelope.decay)),this}triggerRelease(e){return e=this.toSeconds(e),this.envelope.triggerRelease(e),this.noise.stop(e+this.toSeconds(this.envelope.release)),this}sync(){return this._syncState()&&(this._syncMethod("triggerAttack",0),this._syncMethod("triggerRelease",0)),this}triggerAttackRelease(e,t,n=1){return t=this.toSeconds(t),e=this.toSeconds(e),this.triggerAttack(t,n),this.triggerRelease(t+e),this}dispose(){return super.dispose(),this.noise.dispose(),this.envelope.dispose(),this}}const so=new Set;function ro(e){so.add(e)}function ao(e,t){const n=`registerProcessor("${e}", ${t})`;so.add(n)}class io extends Sa{constructor(e){super(e),this.name="ToneAudioWorklet",this.workletOptions={},this.onprocessorerror=Qr;const t=URL.createObjectURL(new Blob([Array.from(so).join("\n")],{type:"text/javascript"})),n=this._audioWorkletName();this._dummyGain=this.context.createGain(),this._dummyParam=this._dummyGain.gain,this.context.addAudioWorkletModule(t,n).then((()=>{this.disposed||(this._worklet=this.context.createAudioWorkletNode(n,this.workletOptions),this._worklet.onprocessorerror=this.onprocessorerror.bind(this),this.onReady(this._worklet))}))}dispose(){return super.dispose(),this._dummyGain.disconnect(),this._worklet&&(this._worklet.port.postMessage("dispose"),this._worklet.disconnect()),this}}ro('\n\t/**\n\t * The base AudioWorkletProcessor for use in Tone.js. Works with the [[ToneAudioWorklet]]. \n\t */\n\tclass ToneAudioWorkletProcessor extends AudioWorkletProcessor {\n\n\t\tconstructor(options) {\n\t\t\t\n\t\t\tsuper(options);\n\t\t\t/**\n\t\t\t * If the processor was disposed or not. Keep alive until it\'s disposed.\n\t\t\t */\n\t\t\tthis.disposed = false;\n\t\t \t/** \n\t\t\t * The number of samples in the processing block\n\t\t\t */\n\t\t\tthis.blockSize = 128;\n\t\t\t/**\n\t\t\t * the sample rate\n\t\t\t */\n\t\t\tthis.sampleRate = sampleRate;\n\n\t\t\tthis.port.onmessage = (event) => {\n\t\t\t\t// when it receives a dispose \n\t\t\t\tif (event.data === "dispose") {\n\t\t\t\t\tthis.disposed = true;\n\t\t\t\t}\n\t\t\t};\n\t\t}\n\t}\n');ro("\n\t/**\n\t * Abstract class for a single input/output processor. \n\t * has a 'generate' function which processes one sample at a time\n\t */\n\tclass SingleIOProcessor extends ToneAudioWorkletProcessor {\n\n\t\tconstructor(options) {\n\t\t\tsuper(Object.assign(options, {\n\t\t\t\tnumberOfInputs: 1,\n\t\t\t\tnumberOfOutputs: 1\n\t\t\t}));\n\t\t\t/**\n\t\t\t * Holds the name of the parameter and a single value of that\n\t\t\t * parameter at the current sample\n\t\t\t * @type { [name: string]: number }\n\t\t\t */\n\t\t\tthis.params = {}\n\t\t}\n\n\t\t/**\n\t\t * Generate an output sample from the input sample and parameters\n\t\t * @abstract\n\t\t * @param input number\n\t\t * @param channel number\n\t\t * @param parameters { [name: string]: number }\n\t\t * @returns number\n\t\t */\n\t\tgenerate(){}\n\n\t\t/**\n\t\t * Update the private params object with the \n\t\t * values of the parameters at the given index\n\t\t * @param parameters { [name: string]: Float32Array },\n\t\t * @param index number\n\t\t */\n\t\tupdateParams(parameters, index) {\n\t\t\tfor (const paramName in parameters) {\n\t\t\t\tconst param = parameters[paramName];\n\t\t\t\tif (param.length > 1) {\n\t\t\t\t\tthis.params[paramName] = parameters[paramName][index];\n\t\t\t\t} else {\n\t\t\t\t\tthis.params[paramName] = parameters[paramName][0];\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * Process a single frame of the audio\n\t\t * @param inputs Float32Array[][]\n\t\t * @param outputs Float32Array[][]\n\t\t */\n\t\tprocess(inputs, outputs, parameters) {\n\t\t\tconst input = inputs[0];\n\t\t\tconst output = outputs[0];\n\t\t\t// get the parameter values\n\t\t\tconst channelCount = Math.max(input && input.length || 0, output.length);\n\t\t\tfor (let sample = 0; sample < this.blockSize; sample++) {\n\t\t\t\tthis.updateParams(parameters, sample);\n\t\t\t\tfor (let channel = 0; channel < channelCount; channel++) {\n\t\t\t\t\tconst inputSample = input && input.length ? input[channel][sample] : 0;\n\t\t\t\t\toutput[channel][sample] = this.generate(inputSample, channel, this.params);\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn !this.disposed;\n\t\t}\n\t};\n");ro("\n\t/**\n\t * A multichannel buffer for use within an AudioWorkletProcessor as a delay line\n\t */\n\tclass DelayLine {\n\t\t\n\t\tconstructor(size, channels) {\n\t\t\tthis.buffer = [];\n\t\t\tthis.writeHead = []\n\t\t\tthis.size = size;\n\n\t\t\t// create the empty channels\n\t\t\tfor (let i = 0; i < channels; i++) {\n\t\t\t\tthis.buffer[i] = new Float32Array(this.size);\n\t\t\t\tthis.writeHead[i] = 0;\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * Push a value onto the end\n\t\t * @param channel number\n\t\t * @param value number\n\t\t */\n\t\tpush(channel, value) {\n\t\t\tthis.writeHead[channel] += 1;\n\t\t\tif (this.writeHead[channel] > this.size) {\n\t\t\t\tthis.writeHead[channel] = 0;\n\t\t\t}\n\t\t\tthis.buffer[channel][this.writeHead[channel]] = value;\n\t\t}\n\n\t\t/**\n\t\t * Get the recorded value of the channel given the delay\n\t\t * @param channel number\n\t\t * @param delay number delay samples\n\t\t */\n\t\tget(channel, delay) {\n\t\t\tlet readHead = this.writeHead[channel] - Math.floor(delay);\n\t\t\tif (readHead < 0) {\n\t\t\t\treadHead += this.size;\n\t\t\t}\n\t\t\treturn this.buffer[channel][readHead];\n\t\t}\n\t}\n");const oo="feedback-comb-filter";ao(oo,'\n\tclass FeedbackCombFilterWorklet extends SingleIOProcessor {\n\n\t\tconstructor(options) {\n\t\t\tsuper(options);\n\t\t\tthis.delayLine = new DelayLine(this.sampleRate, options.channelCount || 2);\n\t\t}\n\n\t\tstatic get parameterDescriptors() {\n\t\t\treturn [{\n\t\t\t\tname: "delayTime",\n\t\t\t\tdefaultValue: 0.1,\n\t\t\t\tminValue: 0,\n\t\t\t\tmaxValue: 1,\n\t\t\t\tautomationRate: "k-rate"\n\t\t\t}, {\n\t\t\t\tname: "feedback",\n\t\t\t\tdefaultValue: 0.5,\n\t\t\t\tminValue: 0,\n\t\t\t\tmaxValue: 0.9999,\n\t\t\t\tautomationRate: "k-rate"\n\t\t\t}];\n\t\t}\n\n\t\tgenerate(input, channel, parameters) {\n\t\t\tconst delayedSample = this.delayLine.get(channel, parameters.delayTime * this.sampleRate);\n\t\t\tthis.delayLine.push(channel, input + delayedSample * parameters.feedback);\n\t\t\treturn delayedSample;\n\t\t}\n\t}\n');class lo extends io{constructor(){super(Rr(lo.getDefaults(),arguments,["delayTime","resonance"])),this.name="FeedbackCombFilter";const e=Rr(lo.getDefaults(),arguments,["delayTime","resonance"]);this.input=new Ta({context:this.context}),this.output=new Ta({context:this.context}),this.delayTime=new Ca({context:this.context,value:e.delayTime,units:"time",minValue:0,maxValue:1,param:this._dummyParam,swappable:!0}),this.resonance=new Ca({context:this.context,value:e.resonance,units:"normalRange",param:this._dummyParam,swappable:!0}),Zr(this,["resonance","delayTime"])}_audioWorkletName(){return oo}static getDefaults(){return Object.assign(Sa.getDefaults(),{delayTime:.1,resonance:.5})}onReady(e){Ea(this.input,e,this.output);const t=e.parameters.get("delayTime");this.delayTime.setParam(t);const n=e.parameters.get("feedback");this.resonance.setParam(n)}dispose(){return super.dispose(),this.input.dispose(),this.output.dispose(),this.delayTime.dispose(),this.resonance.dispose(),this}}class uo extends Sa{constructor(){super(Rr(uo.getDefaults(),arguments,["frequency","type"])),this.name="OnePoleFilter";const e=Rr(uo.getDefaults(),arguments,["frequency","type"]);this._frequency=e.frequency,this._type=e.type,this.input=new Ta({context:this.context}),this.output=new Ta({context:this.context}),this._createFilter()}static getDefaults(){return Object.assign(Sa.getDefaults(),{frequency:880,type:"lowpass"})}_createFilter(){const e=this._filter,t=this.toFrequency(this._frequency),n=1/(2*Math.PI*t);if("lowpass"===this._type){const e=1/(n*this.context.sampleRate),t=e-1;this._filter=this.context.createIIRFilter([e,0],[1,t])}else{const e=1/(n*this.context.sampleRate)-1;this._filter=this.context.createIIRFilter([1,-1],[1,e])}this.input.chain(this._filter,this.output),e&&this.context.setTimeout((()=>{this.disposed||(this.input.disconnect(e),e.disconnect())}),this.blockTime)}get frequency(){return this._frequency}set frequency(e){this._frequency=e,this._createFilter()}get type(){return this._type}set type(e){this._type=e,this._createFilter()}getFrequencyResponse(e=128){const t=new Float32Array(e);for(let n=0;nt.voice===e));this._activeVoices.splice(t,1)}_getNextAvailableVoice(){if(this._availableVoices.length)return this._availableVoices.shift();if(this._voices.lengthMath.ceil(this._averageActiveVoices+1)){const e=this._availableVoices.shift(),t=this._voices.indexOf(e);this._voices.splice(t,1),this.context.isOffline||e.dispose()}}_triggerAttack(e,t,n){e.forEach((e=>{const s=new Wa(this.context,e).toMidi(),r=this._getNextAvailableVoice();r&&(r.triggerAttack(e,t,n),this._activeVoices.push({midi:s,voice:r,released:!1}),this.log("triggerAttack",e,t))}))}_triggerRelease(e,t){e.forEach((e=>{const n=new Wa(this.context,e).toMidi(),s=this._activeVoices.find((({midi:e,released:t})=>e===n&&!t));s&&(s.voice.triggerRelease(t),s.released=!0,this.log("triggerRelease",e,t))}))}_scheduleEvent(e,t,n,s){rr(!this.disposed,"Synth was already disposed"),n<=this.now()?"attack"===e?this._triggerAttack(t,n,s):this._triggerRelease(t,n):this.context.setTimeout((()=>{this._scheduleEvent(e,t,n,s)}),n-this.now())}triggerAttack(e,t,n){Array.isArray(e)||(e=[e]);const s=this.toSeconds(t);return this._scheduleEvent("attack",e,s,n),this}triggerRelease(e,t){Array.isArray(e)||(e=[e]);const n=this.toSeconds(t);return this._scheduleEvent("release",e,n),this}triggerAttackRelease(e,t,n,s){const r=this.toSeconds(n);if(this.triggerAttack(e,r,s),yr(t)){rr(yr(e),"If the duration is an array, the notes must also be an array");for(let n=0;n0,"The duration must be greater than 0"),this.triggerRelease(e[n],r+a)}}else{const n=this.toSeconds(t);rr(n>0,"The duration must be greater than 0"),this.triggerRelease(e,r+n)}return this}sync(){return this._syncState()&&(this._syncMethod("triggerAttack",1),this._syncMethod("triggerRelease",1)),this}set(e){const t=Mr(e,["onsilence","context"]);return this.options=Or(this.options,t),this._voices.forEach((e=>e.set(t))),this._dummyVoice.set(t),this}get(){return this._dummyVoice.get()}releaseAll(e){const t=this.toSeconds(e);return this._activeVoices.forEach((({voice:e})=>{e.triggerRelease(t)})),this}dispose(){return super.dispose(),this._dummyVoice.dispose(),this._voices.forEach((e=>e.dispose())),this._activeVoices=[],this._availableVoices=[],this.context.clearInterval(this._gcTimeout),this}}class fo extends Wi{constructor(){super(Rr(fo.getDefaults(),arguments,["urls","onload","baseUrl"],"urls")),this.name="Sampler",this._activeSources=new Map;const e=Rr(fo.getDefaults(),arguments,["urls","onload","baseUrl"],"urls"),t={};Object.keys(e.urls).forEach((n=>{const s=parseInt(n,10);if(rr(wr(n)||fr(s)&&isFinite(s),`url key is neither a note or midi pitch: ${n}`),wr(n)){const s=new ga(this.context,n).toMidi();t[s]=e.urls[n]}else fr(s)&&isFinite(s)&&(t[s]=e.urls[s])})),this._buffers=new Va({urls:t,onload:e.onload,baseUrl:e.baseUrl,onerror:e.onerror}),this.attack=e.attack,this.release=e.release,this.curve=e.curve,this._buffers.loaded&&Promise.resolve().then(e.onload)}static getDefaults(){return Object.assign(Wi.getDefaults(),{attack:0,baseUrl:"",curve:"exponential",onload:Qr,onerror:Qr,release:.1,urls:{}})}_findClosest(e){let t=0;for(;t<96;){if(this._buffers.has(e+t))return-t;if(this._buffers.has(e-t))return t;t++}throw new Error(`No available buffers for note: ${e}`)}triggerAttack(e,t,n=1){return this.log("triggerAttack",e,t,n),Array.isArray(e)||(e=[e]),e.forEach((e=>{const s=ha(new ga(this.context,e).toFrequency()),r=Math.round(s),a=s-r,i=this._findClosest(r),o=r-i,l=this._buffers.get(o),u=la(i+a),c=new ti({url:l,context:this.context,curve:this.curve,fadeIn:this.attack,fadeOut:this.release,playbackRate:u}).connect(this.output);c.start(t,0,l.duration/u,n),yr(this._activeSources.get(r))||this._activeSources.set(r,[]),this._activeSources.get(r).push(c),c.onended=()=>{if(this._activeSources&&this._activeSources.has(r)){const e=this._activeSources.get(r),t=e.indexOf(c);-1!==t&&e.splice(t,1)}}})),this}triggerRelease(e,t){return this.log("triggerRelease",e,t),Array.isArray(e)||(e=[e]),e.forEach((e=>{const n=new ga(this.context,e).toMidi();if(this._activeSources.has(n)&&this._activeSources.get(n).length){const e=this._activeSources.get(n);t=this.toSeconds(t),e.forEach((e=>{e.stop(t)})),this._activeSources.set(n,[])}})),this}releaseAll(e){const t=this.toSeconds(e);return this._activeSources.forEach((e=>{for(;e.length;){e.shift().stop(t)}})),this}sync(){return this._syncState()&&(this._syncMethod("triggerAttack",1),this._syncMethod("triggerRelease",1)),this}triggerAttackRelease(e,t,n,s=1){const r=this.toSeconds(n);return this.triggerAttack(e,r,s),yr(t)?(rr(yr(e),"notes must be an array when duration is array"),e.forEach(((e,n)=>{const s=t[Math.min(n,t.length-1)];this.triggerRelease(e,r+this.toSeconds(s))}))):this.triggerRelease(e,r+this.toSeconds(t)),this}add(e,t,n){if(rr(wr(e)||isFinite(e),`note must be a pitch or midi: ${e}`),wr(e)){const s=new ga(this.context,e).toMidi();this._buffers.add(s,t,n)}else this._buffers.add(e,t,n);return this}get loaded(){return this._buffers.loaded}dispose(){return super.dispose(),this._buffers.dispose(),this._activeSources.forEach((e=>{e.forEach((e=>e.dispose()))})),this._activeSources.clear(),this}}Ar([Ei(0)],fo.prototype,"attack",void 0),Ar([Ei(0)],fo.prototype,"release",void 0);class mo extends Aa{constructor(){super(Rr(mo.getDefaults(),arguments,["callback","value"])),this.name="ToneEvent",this._state=new ka("stopped"),this._startOffset=0;const e=Rr(mo.getDefaults(),arguments,["callback","value"]);this._loop=e.loop,this.callback=e.callback,this.value=e.value,this._loopStart=this.toTicks(e.loopStart),this._loopEnd=this.toTicks(e.loopEnd),this._playbackRate=e.playbackRate,this._probability=e.probability,this._humanize=e.humanize,this.mute=e.mute,this._playbackRate=e.playbackRate,this._state.increasing=!0,this._rescheduleEvents()}static getDefaults(){return Object.assign(Aa.getDefaults(),{callback:Qr,humanize:!1,loop:!1,loopEnd:"1m",loopStart:0,mute:!1,playbackRate:1,probability:1,value:null})}_rescheduleEvents(e=-1){this._state.forEachFrom(e,(e=>{let t;if("started"===e.state){-1!==e.id&&this.context.transport.clear(e.id);const n=e.time+Math.round(this.startOffset/this._playbackRate);if(!0===this._loop||fr(this._loop)&&this._loop>1){t=1/0,fr(this._loop)&&(t=this._loop*this._getLoopDuration());const s=this._state.getAfter(n);null!==s&&(t=Math.min(t,s.time-n)),t!==1/0&&(this._state.setStateAtTime("stopped",n+t+1,{id:-1}),t=new Ga(this.context,t));const r=new Ga(this.context,this._getLoopDuration());e.id=this.context.transport.scheduleRepeat(this._tick.bind(this),r,new Ga(this.context,n),t)}else e.id=this.context.transport.schedule(this._tick.bind(this),new Ga(this.context,n))}}))}get state(){return this._state.getValueAtTime(this.context.transport.ticks)}get startOffset(){return this._startOffset}set startOffset(e){this._startOffset=e}get probability(){return this._probability}set probability(e){this._probability=e}get humanize(){return this._humanize}set humanize(e){this._humanize=e}start(e){const t=this.toTicks(e);return"stopped"===this._state.getValueAtTime(t)&&(this._state.add({id:-1,state:"started",time:t}),this._rescheduleEvents(t)),this}stop(e){this.cancel(e);const t=this.toTicks(e);if("started"===this._state.getValueAtTime(t)){this._state.setStateAtTime("stopped",t,{id:-1});const e=this._state.getBefore(t);let n=t;null!==e&&(n=e.time),this._rescheduleEvents(n)}return this}cancel(e){e=Dr(e,-1/0);const t=this.toTicks(e);return this._state.forEachFrom(t,(e=>{this.context.transport.clear(e.id)})),this._state.cancel(t),this}_tick(e){const t=this.context.transport.getTicksAtTime(e);if(!this.mute&&"started"===this._state.getValueAtTime(t)){if(this.probability<1&&Math.random()>this.probability)return;if(this.humanize){let t=.02;gr(this.humanize)||(t=this.toSeconds(this.humanize)),e+=(2*Math.random()-1)*t}this.callback(e,this.value)}}_getLoopDuration(){return Math.round((this._loopEnd-this._loopStart)/this._playbackRate)}get loop(){return this._loop}set loop(e){this._loop=e,this._rescheduleEvents()}get playbackRate(){return this._playbackRate}set playbackRate(e){this._playbackRate=e,this._rescheduleEvents()}get loopEnd(){return new Ga(this.context,this._loopEnd).toSeconds()}set loopEnd(e){this._loopEnd=this.toTicks(e),this._loop&&this._rescheduleEvents()}get loopStart(){return new Ga(this.context,this._loopStart).toSeconds()}set loopStart(e){this._loopStart=this.toTicks(e),this._loop&&this._rescheduleEvents()}get progress(){if(this._loop){const e=this.context.transport.ticks,t=this._state.get(e);if(null!==t&&"started"===t.state){const n=this._getLoopDuration();return(e-t.time)%n/n}return 0}return 0}dispose(){return super.dispose(),this.cancel(),this._state.dispose(),this}}class go extends Aa{constructor(){super(Rr(go.getDefaults(),arguments,["callback","interval"])),this.name="Loop";const e=Rr(go.getDefaults(),arguments,["callback","interval"]);this._event=new mo({context:this.context,callback:this._tick.bind(this),loop:!0,loopEnd:e.interval,playbackRate:e.playbackRate,probability:e.probability}),this.callback=e.callback,this.iterations=e.iterations}static getDefaults(){return Object.assign(Aa.getDefaults(),{interval:"4n",callback:Qr,playbackRate:1,iterations:1/0,probability:1,mute:!1,humanize:!1})}start(e){return this._event.start(e),this}stop(e){return this._event.stop(e),this}cancel(e){return this._event.cancel(e),this}_tick(e){this.callback(e)}get state(){return this._event.state}get progress(){return this._event.progress}get interval(){return this._event.loopEnd}set interval(e){this._event.loopEnd=e}get playbackRate(){return this._event.playbackRate}set playbackRate(e){this._event.playbackRate=e}get humanize(){return this._event.humanize}set humanize(e){this._event.humanize=e}get probability(){return this._event.probability}set probability(e){this._event.probability=e}get mute(){return this._event.mute}set mute(e){this._event.mute=e}get iterations(){return!0===this._event.loop?1/0:this._event.loop}set iterations(e){this._event.loop=e===1/0||e}dispose(){return super.dispose(),this._event.dispose(),this}}class yo extends mo{constructor(){super(Rr(yo.getDefaults(),arguments,["callback","events"])),this.name="Part",this._state=new ka("stopped"),this._events=new Set;const e=Rr(yo.getDefaults(),arguments,["callback","events"]);this._state.increasing=!0,e.events.forEach((e=>{yr(e)?this.add(e[0],e[1]):this.add(e)}))}static getDefaults(){return Object.assign(mo.getDefaults(),{events:[]})}start(e,t){const n=this.toTicks(e);if("started"!==this._state.getValueAtTime(n)){t=Dr(t,this._loop?this._loopStart:0),t=this._loop?Dr(t,this._loopStart):Dr(t,0);const e=this.toTicks(t);this._state.add({id:-1,offset:e,state:"started",time:n}),this._forEach((t=>{this._startNote(t,n,e)}))}return this}_startNote(e,t,n){t-=n,this._loop?e.startOffset>=this._loopStart&&e.startOffset=n&&(e.loop=!1,e.start(new Ga(this.context,t))):e.startOffset>=n&&e.start(new Ga(this.context,t))}get startOffset(){return this._startOffset}set startOffset(e){this._startOffset=e,this._forEach((e=>{e.startOffset+=this._startOffset}))}stop(e){const t=this.toTicks(e);return this._state.cancel(t),this._state.setStateAtTime("stopped",t),this._forEach((t=>{t.stop(e)})),this}at(e,t){const n=new va(this.context,e).toTicks(),s=new Ga(this.context,1).toSeconds(),r=this._events.values();let a=r.next();for(;!a.done;){const e=a.value;if(Math.abs(n-e.startOffset){"started"===t.state?this._startNote(e,t.time,t.offset):e.stop(new Ga(this.context,t.time))}))}remove(e,t){return mr(e)&&e.hasOwnProperty("time")&&(e=(t=e).time),e=this.toTicks(e),this._events.forEach((n=>{n.startOffset===e&&(hr(t)||dr(t)&&n.value===t)&&(this._events.delete(n),n.dispose())})),this}clear(){return this._forEach((e=>e.dispose())),this._events.clear(),this}cancel(e){return this._forEach((t=>t.cancel(e))),this._state.cancel(this.toTicks(e)),this}_forEach(e){return this._events&&this._events.forEach((t=>{t instanceof yo?t._forEach(e):e(t)})),this}_setAll(e,t){this._forEach((n=>{n[e]=t}))}_tick(e,t){this.mute||this.callback(e,t)}_testLoopBoundries(e){this._loop&&(e.startOffset=this._loopEnd)?e.cancel(0):"stopped"===e.state&&this._restartEvent(e)}get probability(){return this._probability}set probability(e){this._probability=e,this._setAll("probability",e)}get humanize(){return this._humanize}set humanize(e){this._humanize=e,this._setAll("humanize",e)}get loop(){return this._loop}set loop(e){this._loop=e,this._forEach((t=>{t.loopStart=this.loopStart,t.loopEnd=this.loopEnd,t.loop=e,this._testLoopBoundries(t)}))}get loopEnd(){return new Ga(this.context,this._loopEnd).toSeconds()}set loopEnd(e){this._loopEnd=this.toTicks(e),this._loop&&this._forEach((t=>{t.loopEnd=e,this._testLoopBoundries(t)}))}get loopStart(){return new Ga(this.context,this._loopStart).toSeconds()}set loopStart(e){this._loopStart=this.toTicks(e),this._loop&&this._forEach((e=>{e.loopStart=this.loopStart,this._testLoopBoundries(e)}))}get playbackRate(){return this._playbackRate}set playbackRate(e){this._playbackRate=e,this._setAll("playbackRate",e)}get length(){return this._events.size}dispose(){return super.dispose(),this.clear(),this}}function*bo(e){let t=0;for(;t=0;)t=xo(t,e),yield e[t],t--}function*vo(e,t){for(;;)yield*t(e)}function xo(e,t){return Wr(e,0,t.length-1)}function*Ao(e,t){let n=t?0:e.length-1;for(;;)n=xo(n,e),yield e[n],t?(n++,n>=e.length-1&&(t=!1)):(n--,n<=0&&(t=!0))}function*ko(e){let t=0,n=0;for(;t=0;)t=xo(t,e),yield e[t],n++,t+=n%2?-2:1}function*So(e){const t=[];for(let n=0;n0;){const n=xo(t.splice(Math.floor(t.length*Math.random()),1)[0],e);yield e[n]}}function*Eo(e,t="up",n=0){switch(rr(e.length>0,"The array must have more than one value in it"),t){case"up":yield*vo(e,bo);case"down":yield*vo(e,wo);case"upDown":yield*Ao(e,!0);case"downUp":yield*Ao(e,!1);case"alternateUp":yield*vo(e,ko);case"alternateDown":yield*vo(e,Co);case"random":yield*function*(e){for(;;){const t=Math.floor(Math.random()*e.length);yield e[t]}}(e);case"randomOnce":yield*vo(e,So);case"randomWalk":yield*function*(e){let t=Math.floor(Math.random()*e.length);for(;;)0===t?t++:t===e.length-1||Math.random()<.5?t--:t++,yield e[t]}(e)}}class _o extends go{constructor(){super(Rr(_o.getDefaults(),arguments,["callback","values","pattern"])),this.name="Pattern";const e=Rr(_o.getDefaults(),arguments,["callback","values","pattern"]);this.callback=e.callback,this._values=e.values,this._pattern=Eo(e.values,e.pattern),this._type=e.pattern}static getDefaults(){return Object.assign(go.getDefaults(),{pattern:"up",values:[],callback:Qr})}_tick(e){const t=this._pattern.next();this._value=t.value,this.callback(e,this._value)}get values(){return this._values}set values(e){this._values=e,this.pattern=this._type}get value(){return this._value}get pattern(){return this._type}set pattern(e){this._type=e,this._pattern=Eo(this._values,this._type)}}class Io extends mo{constructor(){super(Rr(Io.getDefaults(),arguments,["callback","events","subdivision"])),this.name="Sequence",this._part=new yo({callback:this._seqCallback.bind(this),context:this.context}),this._events=[],this._eventsArray=[];const e=Rr(Io.getDefaults(),arguments,["callback","events","subdivision"]);this._subdivision=this.toTicks(e.subdivision),this.events=e.events,this.loop=e.loop,this.loopStart=e.loopStart,this.loopEnd=e.loopEnd,this.playbackRate=e.playbackRate,this.probability=e.probability,this.humanize=e.humanize,this.mute=e.mute,this.playbackRate=e.playbackRate}static getDefaults(){return Object.assign(Mr(mo.getDefaults(),["value"]),{events:[],loop:!0,loopEnd:0,loopStart:0,subdivision:"8n"})}_seqCallback(e,t){null!==t&&this.callback(e,t)}get events(){return this._events}set events(e){this.clear(),this._eventsArray=e,this._events=this._createSequence(this._eventsArray),this._eventsUpdated()}start(e,t){return this._part.start(e,t?this._indexTime(t):t),this}stop(e){return this._part.stop(e),this}get subdivision(){return new Ga(this.context,this._subdivision).toSeconds()}_createSequence(e){return new Proxy(e,{get:(e,t)=>e[t],set:(e,t,n)=>(br(t)&&isFinite(parseInt(t,10))&&yr(n)?e[t]=this._createSequence(n):e[t]=n,this._eventsUpdated(),!0)})}_eventsUpdated(){this._part.clear(),this._rescheduleSequence(this._eventsArray,this._subdivision,this.startOffset),this.loopEnd=this.loopEnd}_rescheduleSequence(e,t,n){e.forEach(((e,s)=>{const r=s*t+n;if(yr(e))this._rescheduleSequence(e,t/e.length,r);else{const t=new Ga(this.context,r,"i").toSeconds();this._part.add(t,e)}}))}_indexTime(e){return new Ga(this.context,e*this._subdivision+this.startOffset).toSeconds()}clear(){return this._part.clear(),this}dispose(){return super.dispose(),this._part.dispose(),this}get loop(){return this._part.loop}set loop(e){this._part.loop=e}get loopStart(){return this._loopStart}set loopStart(e){this._loopStart=e,this._part.loopStart=this._indexTime(e)}get loopEnd(){return this._loopEnd}set loopEnd(e){this._loopEnd=e,this._part.loopEnd=0===e?this._indexTime(this._eventsArray.length):this._indexTime(e)}get startOffset(){return this._part.startOffset}set startOffset(e){this._part.startOffset=e}get playbackRate(){return this._part.playbackRate}set playbackRate(e){this._part.playbackRate=e}get probability(){return this._part.probability}set probability(e){this._part.probability=e}get progress(){return this._part.progress}get humanize(){return this._part.humanize}set humanize(e){this._part.humanize=e}get length(){return this._part.length}}class To extends Sa{constructor(){super(Object.assign(Rr(To.getDefaults(),arguments,["fade"]))),this.name="CrossFade",this._panner=this.context.createStereoPanner(),this._split=this.context.createChannelSplitter(2),this._g2a=new Oi({context:this.context}),this.a=new Ta({context:this.context,gain:0}),this.b=new Ta({context:this.context,gain:0}),this.output=new Ta({context:this.context}),this._internalChannels=[this.a,this.b];const e=Rr(To.getDefaults(),arguments,["fade"]);this.fade=new Ra({context:this.context,units:"normalRange",value:e.fade}),Zr(this,"fade"),this.context.getConstant(1).connect(this._panner),this._panner.connect(this._split),this._panner.channelCount=1,this._panner.channelCountMode="explicit",_a(this._split,this.a.gain,0),_a(this._split,this.b.gain,1),this.fade.chain(this._g2a,this._panner.pan),this.a.connect(this.output),this.b.connect(this.output)}static getDefaults(){return Object.assign(Sa.getDefaults(),{fade:.5})}dispose(){return super.dispose(),this.a.dispose(),this.b.dispose(),this.output.dispose(),this.fade.dispose(),this._g2a.dispose(),this._panner.disconnect(),this._split.disconnect(),this}}class No extends Sa{constructor(e){super(e),this.name="Effect",this._dryWet=new To({context:this.context}),this.wet=this._dryWet.fade,this.effectSend=new Ta({context:this.context}),this.effectReturn=new Ta({context:this.context}),this.input=new Ta({context:this.context}),this.output=this._dryWet,this.input.fan(this._dryWet.a,this.effectSend),this.effectReturn.connect(this._dryWet.b),this.wet.setValueAtTime(e.wet,0),this._internalChannels=[this.effectReturn,this.effectSend],Zr(this,"wet")}static getDefaults(){return Object.assign(Sa.getDefaults(),{wet:1})}connectEffect(e){return this._internalChannels.push(e),this.effectSend.chain(e,this.effectReturn),this}dispose(){return super.dispose(),this._dryWet.dispose(),this.effectSend.dispose(),this.effectReturn.dispose(),this.wet.dispose(),this}}class Oo extends No{constructor(e){super(e),this.name="LFOEffect",this._lfo=new Ci({context:this.context,frequency:e.frequency,amplitude:e.depth}),this.depth=this._lfo.amplitude,this.frequency=this._lfo.frequency,this.type=e.type,Zr(this,["frequency","depth"])}static getDefaults(){return Object.assign(No.getDefaults(),{frequency:1,type:"sine",depth:1})}start(e){return this._lfo.start(e),this}stop(e){return this._lfo.stop(e),this}sync(){return this._lfo.sync(),this}unsync(){return this._lfo.unsync(),this}get type(){return this._lfo.type}set type(e){this._lfo.type=e}dispose(){return super.dispose(),this._lfo.dispose(),this.frequency.dispose(),this.depth.dispose(),this}}class Ro extends Oo{constructor(){super(Rr(Ro.getDefaults(),arguments,["frequency","baseFrequency","octaves"])),this.name="AutoFilter";const e=Rr(Ro.getDefaults(),arguments,["frequency","baseFrequency","octaves"]);this.filter=new Ki(Object.assign(e.filter,{context:this.context})),this.connectEffect(this.filter),this._lfo.connect(this.filter.frequency),this.octaves=e.octaves,this.baseFrequency=e.baseFrequency}static getDefaults(){return Object.assign(Oo.getDefaults(),{baseFrequency:200,octaves:2.6,filter:{type:"lowpass",rolloff:-12,Q:1}})}get baseFrequency(){return this._lfo.min}set baseFrequency(e){this._lfo.min=this.toFrequency(e),this.octaves=this._octaves}get octaves(){return this._octaves}set octaves(e){this._octaves=e,this._lfo.max=this._lfo.min*Math.pow(2,e)}dispose(){return super.dispose(),this.filter.dispose(),this}}class Do extends Sa{constructor(){super(Object.assign(Rr(Do.getDefaults(),arguments,["pan"]))),this.name="Panner",this._panner=this.context.createStereoPanner(),this.input=this._panner,this.output=this._panner;const e=Rr(Do.getDefaults(),arguments,["pan"]);this.pan=new Ca({context:this.context,param:this._panner.pan,value:e.pan,minValue:-1,maxValue:1}),this._panner.channelCount=e.channelCount,this._panner.channelCountMode="explicit",Zr(this,"pan")}static getDefaults(){return Object.assign(Sa.getDefaults(),{pan:0,channelCount:1})}dispose(){return super.dispose(),this._panner.disconnect(),this.pan.dispose(),this}}class Mo extends Oo{constructor(){super(Rr(Mo.getDefaults(),arguments,["frequency"])),this.name="AutoPanner";const e=Rr(Mo.getDefaults(),arguments,["frequency"]);this._panner=new Do({context:this.context,channelCount:e.channelCount}),this.connectEffect(this._panner),this._lfo.connect(this._panner.pan),this._lfo.min=-1,this._lfo.max=1}static getDefaults(){return Object.assign(Oo.getDefaults(),{channelCount:1})}dispose(){return super.dispose(),this._panner.dispose(),this}}class Fo extends Sa{constructor(){super(Rr(Fo.getDefaults(),arguments,["smoothing"])),this.name="Follower";const e=Rr(Fo.getDefaults(),arguments,["smoothing"]);this._abs=this.input=new Ni({context:this.context}),this._lowpass=this.output=new uo({context:this.context,frequency:1/this.toSeconds(e.smoothing),type:"lowpass"}),this._abs.connect(this._lowpass),this._smoothing=e.smoothing}static getDefaults(){return Object.assign(Sa.getDefaults(),{smoothing:.05})}get smoothing(){return this._smoothing}set smoothing(e){this._smoothing=e,this._lowpass.frequency=1/this.toSeconds(this.smoothing)}dispose(){return super.dispose(),this._abs.dispose(),this._lowpass.dispose(),this}}class Bo extends No{constructor(){super(Rr(Bo.getDefaults(),arguments,["baseFrequency","octaves","sensitivity"])),this.name="AutoWah";const e=Rr(Bo.getDefaults(),arguments,["baseFrequency","octaves","sensitivity"]);this._follower=new Fo({context:this.context,smoothing:e.follower}),this._sweepRange=new zi({context:this.context,min:0,max:1,exponent:.5}),this._baseFrequency=this.toFrequency(e.baseFrequency),this._octaves=e.octaves,this._inputBoost=new Ta({context:this.context}),this._bandpass=new Ki({context:this.context,rolloff:-48,frequency:0,Q:e.Q}),this._peaking=new Ki({context:this.context,type:"peaking"}),this._peaking.gain.value=e.gain,this.gain=this._peaking.gain,this.Q=this._bandpass.Q,this.effectSend.chain(this._inputBoost,this._follower,this._sweepRange),this._sweepRange.connect(this._bandpass.frequency),this._sweepRange.connect(this._peaking.frequency),this.effectSend.chain(this._bandpass,this._peaking,this.effectReturn),this._setSweepRange(),this.sensitivity=e.sensitivity,Zr(this,["gain","Q"])}static getDefaults(){return Object.assign(No.getDefaults(),{baseFrequency:100,octaves:6,sensitivity:0,Q:2,gain:2,follower:.2})}get octaves(){return this._octaves}set octaves(e){this._octaves=e,this._setSweepRange()}get follower(){return this._follower.smoothing}set follower(e){this._follower.smoothing=e}get baseFrequency(){return this._baseFrequency}set baseFrequency(e){this._baseFrequency=this.toFrequency(e),this._setSweepRange()}get sensitivity(){return oa(1/this._inputBoost.gain.value)}set sensitivity(e){this._inputBoost.gain.value=1/ia(e)}_setSweepRange(){this._sweepRange.min=this._baseFrequency,this._sweepRange.max=Math.min(this._baseFrequency*Math.pow(2,this._octaves),this.context.sampleRate/2)}dispose(){return super.dispose(),this._follower.dispose(),this._sweepRange.dispose(),this._bandpass.dispose(),this._peaking.dispose(),this._inputBoost.dispose(),this}}const zo="bit-crusher";ao(zo,"\n\tclass BitCrusherWorklet extends SingleIOProcessor {\n\n\t\tstatic get parameterDescriptors() {\n\t\t\treturn [{\n\t\t\t\tname: \"bits\",\n\t\t\t\tdefaultValue: 12,\n\t\t\t\tminValue: 1,\n\t\t\t\tmaxValue: 16,\n\t\t\t\tautomationRate: 'k-rate'\n\t\t\t}];\n\t\t}\n\n\t\tgenerate(input, _channel, parameters) {\n\t\t\tconst step = Math.pow(0.5, parameters.bits - 1);\n\t\t\tconst val = step * Math.floor(input / step + 0.5);\n\t\t\treturn val;\n\t\t}\n\t}\n");class Lo extends No{constructor(){super(Rr(Lo.getDefaults(),arguments,["bits"])),this.name="BitCrusher";const e=Rr(Lo.getDefaults(),arguments,["bits"]);this._bitCrusherWorklet=new Po({context:this.context,bits:e.bits}),this.connectEffect(this._bitCrusherWorklet),this.bits=this._bitCrusherWorklet.bits}static getDefaults(){return Object.assign(No.getDefaults(),{bits:4})}dispose(){return super.dispose(),this._bitCrusherWorklet.dispose(),this}}class Po extends io{constructor(){super(Rr(Po.getDefaults(),arguments)),this.name="BitCrusherWorklet";const e=Rr(Po.getDefaults(),arguments);this.input=new Ta({context:this.context}),this.output=new Ta({context:this.context}),this.bits=new Ca({context:this.context,value:e.bits,units:"positive",minValue:1,maxValue:16,param:this._dummyParam,swappable:!0})}static getDefaults(){return Object.assign(io.getDefaults(),{bits:12})}_audioWorkletName(){return zo}onReady(e){Ea(this.input,e,this.output);const t=e.parameters.get("bits");this.bits.setParam(t)}dispose(){return super.dispose(),this.input.dispose(),this.output.dispose(),this.bits.dispose(),this}}class Vo extends No{constructor(){super(Rr(Vo.getDefaults(),arguments,["order"])),this.name="Chebyshev";const e=Rr(Vo.getDefaults(),arguments,["order"]);this._shaper=new hi({context:this.context,length:4096}),this._order=e.order,this.connectEffect(this._shaper),this.order=e.order,this.oversample=e.oversample}static getDefaults(){return Object.assign(No.getDefaults(),{order:1,oversample:"none"})}_getCoefficient(e,t,n){return n.has(t)||(0===t?n.set(t,0):1===t?n.set(t,e):n.set(t,2*e*this._getCoefficient(e,t-1,n)-this._getCoefficient(e,t-2,n))),n.get(t)}get order(){return this._order}set order(e){this._order=e,this._shaper.setMap((t=>this._getCoefficient(t,e,new Map)))}get oversample(){return this._shaper.oversample}set oversample(e){this._shaper.oversample=e}dispose(){return super.dispose(),this._shaper.dispose(),this}}class Wo extends Sa{constructor(){super(Rr(Wo.getDefaults(),arguments,["channels"])),this.name="Split";const e=Rr(Wo.getDefaults(),arguments,["channels"]);this._splitter=this.input=this.output=this.context.createChannelSplitter(e.channels),this._internalChannels=[this._splitter]}static getDefaults(){return Object.assign(Sa.getDefaults(),{channels:2})}dispose(){return super.dispose(),this._splitter.disconnect(),this}}class Uo extends Sa{constructor(){super(Rr(Uo.getDefaults(),arguments,["channels"])),this.name="Merge";const e=Rr(Uo.getDefaults(),arguments,["channels"]);this._merger=this.output=this.input=this.context.createChannelMerger(e.channels)}static getDefaults(){return Object.assign(Sa.getDefaults(),{channels:2})}dispose(){return super.dispose(),this._merger.disconnect(),this}}class Go extends Sa{constructor(e){super(e),this.name="StereoEffect",this.input=new Ta({context:this.context}),this.input.channelCount=2,this.input.channelCountMode="explicit",this._dryWet=this.output=new To({context:this.context,fade:e.wet}),this.wet=this._dryWet.fade,this._split=new Wo({context:this.context,channels:2}),this._merge=new Uo({context:this.context,channels:2}),this.input.connect(this._split),this.input.connect(this._dryWet.a),this._merge.connect(this._dryWet.b),Zr(this,["wet"])}connectEffectLeft(...e){this._split.connect(e[0],0,0),Ea(...e),_a(e[e.length-1],this._merge,0,0)}connectEffectRight(...e){this._split.connect(e[0],1,0),Ea(...e),_a(e[e.length-1],this._merge,0,1)}static getDefaults(){return Object.assign(Sa.getDefaults(),{wet:1})}dispose(){return super.dispose(),this._dryWet.dispose(),this._split.dispose(),this._merge.dispose(),this}}class qo extends Go{constructor(e){super(e),this.feedback=new Ra({context:this.context,value:e.feedback,units:"normalRange"}),this._feedbackL=new Ta({context:this.context}),this._feedbackR=new Ta({context:this.context}),this._feedbackSplit=new Wo({context:this.context,channels:2}),this._feedbackMerge=new Uo({context:this.context,channels:2}),this._merge.connect(this._feedbackSplit),this._feedbackMerge.connect(this._split),this._feedbackSplit.connect(this._feedbackL,0,0),this._feedbackL.connect(this._feedbackMerge,0,0),this._feedbackSplit.connect(this._feedbackR,1,0),this._feedbackR.connect(this._feedbackMerge,0,1),this.feedback.fan(this._feedbackL.gain,this._feedbackR.gain),Zr(this,["feedback"])}static getDefaults(){return Object.assign(Go.getDefaults(),{feedback:.5})}dispose(){return super.dispose(),this.feedback.dispose(),this._feedbackL.dispose(),this._feedbackR.dispose(),this._feedbackSplit.dispose(),this._feedbackMerge.dispose(),this}}class jo extends qo{constructor(){super(Rr(jo.getDefaults(),arguments,["frequency","delayTime","depth"])),this.name="Chorus";const e=Rr(jo.getDefaults(),arguments,["frequency","delayTime","depth"]);this._depth=e.depth,this._delayTime=e.delayTime/1e3,this._lfoL=new Ci({context:this.context,frequency:e.frequency,min:0,max:1}),this._lfoR=new Ci({context:this.context,frequency:e.frequency,min:0,max:1,phase:180}),this._delayNodeL=new La({context:this.context}),this._delayNodeR=new La({context:this.context}),this.frequency=this._lfoL.frequency,Zr(this,["frequency"]),this._lfoL.frequency.connect(this._lfoR.frequency),this.connectEffectLeft(this._delayNodeL),this.connectEffectRight(this._delayNodeR),this._lfoL.connect(this._delayNodeL.delayTime),this._lfoR.connect(this._delayNodeR.delayTime),this.depth=this._depth,this.type=e.type,this.spread=e.spread}static getDefaults(){return Object.assign(qo.getDefaults(),{frequency:1.5,delayTime:3.5,depth:.7,type:"sine",spread:180,feedback:0,wet:.5})}get depth(){return this._depth}set depth(e){this._depth=e;const t=this._delayTime*e;this._lfoL.min=Math.max(this._delayTime-t,0),this._lfoL.max=this._delayTime+t,this._lfoR.min=Math.max(this._delayTime-t,0),this._lfoR.max=this._delayTime+t}get delayTime(){return 1e3*this._delayTime}set delayTime(e){this._delayTime=e/1e3,this.depth=this._depth}get type(){return this._lfoL.type}set type(e){this._lfoL.type=e,this._lfoR.type=e}get spread(){return this._lfoR.phase-this._lfoL.phase}set spread(e){this._lfoL.phase=90-e/2,this._lfoR.phase=e/2+90}start(e){return this._lfoL.start(e),this._lfoR.start(e),this}stop(e){return this._lfoL.stop(e),this._lfoR.stop(e),this}sync(){return this._lfoL.sync(),this._lfoR.sync(),this}unsync(){return this._lfoL.unsync(),this._lfoR.unsync(),this}dispose(){return super.dispose(),this._lfoL.dispose(),this._lfoR.dispose(),this._delayNodeL.dispose(),this._delayNodeR.dispose(),this.frequency.dispose(),this}}class Ho extends No{constructor(){super(Rr(Ho.getDefaults(),arguments,["distortion"])),this.name="Distortion";const e=Rr(Ho.getDefaults(),arguments,["distortion"]);this._shaper=new hi({context:this.context,length:4096}),this._distortion=e.distortion,this.connectEffect(this._shaper),this.distortion=e.distortion,this.oversample=e.oversample}static getDefaults(){return Object.assign(No.getDefaults(),{distortion:.4,oversample:"none"})}get distortion(){return this._distortion}set distortion(e){this._distortion=e;const t=100*e,n=Math.PI/180;this._shaper.setMap((e=>Math.abs(e)<.001?0:(3+t)*e*20*n/(Math.PI+t*Math.abs(e))))}get oversample(){return this._shaper.oversample}set oversample(e){this._shaper.oversample=e}dispose(){return super.dispose(),this._shaper.dispose(),this}}class $o extends No{constructor(e){super(e),this.name="FeedbackEffect",this._feedbackGain=new Ta({context:this.context,gain:e.feedback,units:"normalRange"}),this.feedback=this._feedbackGain.gain,Zr(this,"feedback"),this.effectReturn.chain(this._feedbackGain,this.effectSend)}static getDefaults(){return Object.assign(No.getDefaults(),{feedback:.125})}dispose(){return super.dispose(),this._feedbackGain.dispose(),this.feedback.dispose(),this}}class Ko extends $o{constructor(){super(Rr(Ko.getDefaults(),arguments,["delayTime","feedback"])),this.name="FeedbackDelay";const e=Rr(Ko.getDefaults(),arguments,["delayTime","feedback"]);this._delayNode=new La({context:this.context,delayTime:e.delayTime,maxDelay:e.maxDelay}),this.delayTime=this._delayNode.delayTime,this.connectEffect(this._delayNode),Zr(this,"delayTime")}static getDefaults(){return Object.assign($o.getDefaults(),{delayTime:.25,maxDelay:1})}dispose(){return super.dispose(),this._delayNode.dispose(),this.delayTime.dispose(),this}}class Xo extends Sa{constructor(e){super(e),this.name="PhaseShiftAllpass",this.input=new Ta({context:this.context}),this.output=new Ta({context:this.context}),this.offset90=new Ta({context:this.context});this._bank0=this._createAllPassFilterBank([.6923878,.9360654322959,.988229522686,.9987488452737]),this._bank1=this._createAllPassFilterBank([.4021921162426,.856171088242,.9722909545651,.9952884791278]),this._oneSampleDelay=this.context.createIIRFilter([0,1],[1,0]),Ea(this.input,...this._bank0,this._oneSampleDelay,this.output),Ea(this.input,...this._bank1,this.offset90)}_createAllPassFilterBank(e){return e.map((e=>{const t=[[e*e,0,-1],[1,0,-e*e]];return this.context.createIIRFilter(t[0],t[1])}))}dispose(){return super.dispose(),this.input.dispose(),this.output.dispose(),this.offset90.dispose(),this._bank0.forEach((e=>e.disconnect())),this._bank1.forEach((e=>e.disconnect())),this._oneSampleDelay.disconnect(),this}}class Zo extends No{constructor(){super(Rr(Zo.getDefaults(),arguments,["frequency"])),this.name="FrequencyShifter";const e=Rr(Zo.getDefaults(),arguments,["frequency"]);this.frequency=new Ra({context:this.context,units:"frequency",value:e.frequency,minValue:-this.context.sampleRate/2,maxValue:this.context.sampleRate/2}),this._sine=new li({context:this.context,type:"sine"}),this._cosine=new ui({context:this.context,phase:-90,type:"sine"}),this._sineMultiply=new pi({context:this.context}),this._cosineMultiply=new pi({context:this.context}),this._negate=new Ri({context:this.context}),this._add=new xi({context:this.context}),this._phaseShifter=new Xo({context:this.context}),this.effectSend.connect(this._phaseShifter),this.frequency.fan(this._sine.frequency,this._cosine.frequency),this._phaseShifter.offset90.connect(this._cosineMultiply),this._cosine.connect(this._cosineMultiply.factor),this._phaseShifter.connect(this._sineMultiply),this._sine.connect(this._sineMultiply.factor),this._sineMultiply.connect(this._negate),this._cosineMultiply.connect(this._add),this._negate.connect(this._add.addend),this._add.connect(this.effectReturn);const t=this.immediate();this._sine.start(t),this._cosine.start(t)}static getDefaults(){return Object.assign(No.getDefaults(),{frequency:0})}dispose(){return super.dispose(),this.frequency.dispose(),this._add.dispose(),this._cosine.dispose(),this._cosineMultiply.dispose(),this._negate.dispose(),this._phaseShifter.dispose(),this._sine.dispose(),this._sineMultiply.dispose(),this}}const Yo=[1557/44100,1617/44100,1491/44100,1422/44100,1277/44100,1356/44100,1188/44100,1116/44100],Qo=[225,556,441,341];class Jo extends Go{constructor(){super(Rr(Jo.getDefaults(),arguments,["roomSize","dampening"])),this.name="Freeverb",this._combFilters=[],this._allpassFiltersL=[],this._allpassFiltersR=[];const e=Rr(Jo.getDefaults(),arguments,["roomSize","dampening"]);this.roomSize=new Ra({context:this.context,value:e.roomSize,units:"normalRange"}),this._allpassFiltersL=Qo.map((e=>{const t=this.context.createBiquadFilter();return t.type="allpass",t.frequency.value=e,t})),this._allpassFiltersR=Qo.map((e=>{const t=this.context.createBiquadFilter();return t.type="allpass",t.frequency.value=e,t})),this._combFilters=Yo.map(((t,n)=>{const s=new co({context:this.context,dampening:e.dampening,delayTime:t});return nt.dampening=e))}dispose(){return super.dispose(),this._allpassFiltersL.forEach((e=>e.disconnect())),this._allpassFiltersR.forEach((e=>e.disconnect())),this._combFilters.forEach((e=>e.dispose())),this.roomSize.dispose(),this}}const el=[.06748,.06404,.08212,.09004],tl=[.773,.802,.753,.733],nl=[347,113,37];class sl extends Go{constructor(){super(Rr(sl.getDefaults(),arguments,["roomSize"])),this.name="JCReverb",this._allpassFilters=[],this._feedbackCombFilters=[];const e=Rr(sl.getDefaults(),arguments,["roomSize"]);this.roomSize=new Ra({context:this.context,value:e.roomSize,units:"normalRange"}),this._scaleRoomSize=new Ai({context:this.context,min:-.733,max:.197}),this._allpassFilters=nl.map((e=>{const t=this.context.createBiquadFilter();return t.type="allpass",t.frequency.value=e,t})),this._feedbackCombFilters=el.map(((e,t)=>{const n=new lo({context:this.context,delayTime:e});return this._scaleRoomSize.connect(n.resonance),n.resonance.value=tl[t],te.disconnect())),this._feedbackCombFilters.forEach((e=>e.dispose())),this.roomSize.dispose(),this._scaleRoomSize.dispose(),this}}class rl extends qo{constructor(e){super(e),this._feedbackL.disconnect(),this._feedbackL.connect(this._feedbackMerge,0,1),this._feedbackR.disconnect(),this._feedbackR.connect(this._feedbackMerge,0,0),Zr(this,["feedback"])}}class al extends rl{constructor(){super(Rr(al.getDefaults(),arguments,["delayTime","feedback"])),this.name="PingPongDelay";const e=Rr(al.getDefaults(),arguments,["delayTime","feedback"]);this._leftDelay=new La({context:this.context,maxDelay:e.maxDelay}),this._rightDelay=new La({context:this.context,maxDelay:e.maxDelay}),this._rightPreDelay=new La({context:this.context,maxDelay:e.maxDelay}),this.delayTime=new Ra({context:this.context,units:"time",value:e.delayTime}),this.connectEffectLeft(this._leftDelay),this.connectEffectRight(this._rightPreDelay,this._rightDelay),this.delayTime.fan(this._leftDelay.delayTime,this._rightDelay.delayTime,this._rightPreDelay.delayTime),this._feedbackL.disconnect(),this._feedbackL.connect(this._rightDelay),Zr(this,["delayTime"])}static getDefaults(){return Object.assign(rl.getDefaults(),{delayTime:.25,maxDelay:1})}dispose(){return super.dispose(),this._leftDelay.dispose(),this._rightDelay.dispose(),this._rightPreDelay.dispose(),this.delayTime.dispose(),this}}class il extends $o{constructor(){super(Rr(il.getDefaults(),arguments,["pitch"])),this.name="PitchShift";const e=Rr(il.getDefaults(),arguments,["pitch"]);this._frequency=new Ra({context:this.context}),this._delayA=new La({maxDelay:1,context:this.context}),this._lfoA=new Ci({context:this.context,min:0,max:.1,type:"sawtooth"}).connect(this._delayA.delayTime),this._delayB=new La({maxDelay:1,context:this.context}),this._lfoB=new Ci({context:this.context,min:0,max:.1,type:"sawtooth",phase:180}).connect(this._delayB.delayTime),this._crossFade=new To({context:this.context}),this._crossFadeLFO=new Ci({context:this.context,min:0,max:1,type:"triangle",phase:90}).connect(this._crossFade.fade),this._feedbackDelay=new La({delayTime:e.delayTime,context:this.context}),this.delayTime=this._feedbackDelay.delayTime,Zr(this,"delayTime"),this._pitch=e.pitch,this._windowSize=e.windowSize,this._delayA.connect(this._crossFade.a),this._delayB.connect(this._crossFade.b),this._frequency.fan(this._lfoA.frequency,this._lfoB.frequency,this._crossFadeLFO.frequency),this.effectSend.fan(this._delayA,this._delayB),this._crossFade.chain(this._feedbackDelay,this.effectReturn);const t=this.now();this._lfoA.start(t),this._lfoB.start(t),this._crossFadeLFO.start(t),this.windowSize=this._windowSize}static getDefaults(){return Object.assign($o.getDefaults(),{pitch:0,windowSize:.1,delayTime:0,feedback:0})}get pitch(){return this._pitch}set pitch(e){this._pitch=e;let t=0;e<0?(this._lfoA.min=0,this._lfoA.max=this._windowSize,this._lfoB.min=0,this._lfoB.max=this._windowSize,t=la(e-1)+1):(this._lfoA.min=this._windowSize,this._lfoA.max=0,this._lfoB.min=this._windowSize,this._lfoB.max=0,t=la(e)-1),this._frequency.value=t*(1.2/this._windowSize)}get windowSize(){return this._windowSize}set windowSize(e){this._windowSize=this.toSeconds(e),this.pitch=this._pitch}dispose(){return super.dispose(),this._frequency.dispose(),this._delayA.dispose(),this._delayB.dispose(),this._lfoA.dispose(),this._lfoB.dispose(),this._crossFade.dispose(),this._crossFadeLFO.dispose(),this._feedbackDelay.dispose(),this}}class ol extends Go{constructor(){super(Rr(ol.getDefaults(),arguments,["frequency","octaves","baseFrequency"])),this.name="Phaser";const e=Rr(ol.getDefaults(),arguments,["frequency","octaves","baseFrequency"]);this._lfoL=new Ci({context:this.context,frequency:e.frequency,min:0,max:1}),this._lfoR=new Ci({context:this.context,frequency:e.frequency,min:0,max:1,phase:180}),this._baseFrequency=this.toFrequency(e.baseFrequency),this._octaves=e.octaves,this.Q=new Ra({context:this.context,value:e.Q,units:"positive"}),this._filtersL=this._makeFilters(e.stages,this._lfoL),this._filtersR=this._makeFilters(e.stages,this._lfoR),this.frequency=this._lfoL.frequency,this.frequency.value=e.frequency,this.connectEffectLeft(...this._filtersL),this.connectEffectRight(...this._filtersR),this._lfoL.frequency.connect(this._lfoR.frequency),this.baseFrequency=e.baseFrequency,this.octaves=e.octaves,this._lfoL.start(),this._lfoR.start(),Zr(this,["frequency","Q"])}static getDefaults(){return Object.assign(Go.getDefaults(),{frequency:.5,octaves:3,stages:10,Q:10,baseFrequency:350})}_makeFilters(e,t){const n=[];for(let s=0;se.disconnect())),this._filtersR.forEach((e=>e.disconnect())),this.frequency.dispose(),this}}class ll extends No{constructor(){super(Rr(ll.getDefaults(),arguments,["decay"])),this.name="Reverb",this._convolver=this.context.createConvolver(),this.ready=Promise.resolve();const e=Rr(ll.getDefaults(),arguments,["decay"]);this._decay=e.decay,this._preDelay=e.preDelay,this.generate(),this.connectEffect(this._convolver)}static getDefaults(){return Object.assign(No.getDefaults(),{decay:1.5,preDelay:.01})}get decay(){return this._decay}set decay(e){ar(e=this.toSeconds(e),.001),this._decay=e,this.generate()}get preDelay(){return this._preDelay}set preDelay(e){ar(e=this.toSeconds(e),0),this._preDelay=e,this.generate()}generate(){return kr(this,void 0,void 0,(function*(){const e=this.ready,t=new ea(2,this._decay+this._preDelay,this.context.sampleRate),n=new ni({context:t}),s=new ni({context:t}),r=new Uo({context:t});n.connect(r,0,0),s.connect(r,0,1);const a=new Ta({context:t}).toDestination();r.connect(a),n.start(0),s.start(0),a.gain.setValueAtTime(0,0),a.gain.setValueAtTime(1,this._preDelay),a.gain.exponentialApproachValueAtTime(0,this._preDelay,this.decay);const i=t.render();return this.ready=i.then(Qr),yield e,this._convolver.buffer=(yield i).get(),this}))}dispose(){return super.dispose(),this._convolver.disconnect(),this}}class ul extends Sa{constructor(){super(Rr(ul.getDefaults(),arguments)),this.name="MidSideSplit",this._split=this.input=new Wo({channels:2,context:this.context}),this._midAdd=new xi({context:this.context}),this.mid=new pi({context:this.context,value:Math.SQRT1_2}),this._sideSubtract=new Di({context:this.context}),this.side=new pi({context:this.context,value:Math.SQRT1_2}),this._split.connect(this._midAdd,0),this._split.connect(this._midAdd.addend,1),this._split.connect(this._sideSubtract,0),this._split.connect(this._sideSubtract.subtrahend,1),this._midAdd.connect(this.mid),this._sideSubtract.connect(this.side)}dispose(){return super.dispose(),this.mid.dispose(),this.side.dispose(),this._midAdd.dispose(),this._sideSubtract.dispose(),this._split.dispose(),this}}class cl extends Sa{constructor(){super(Rr(cl.getDefaults(),arguments)),this.name="MidSideMerge",this.mid=new Ta({context:this.context}),this.side=new Ta({context:this.context}),this._left=new xi({context:this.context}),this._leftMult=new pi({context:this.context,value:Math.SQRT1_2}),this._right=new Di({context:this.context}),this._rightMult=new pi({context:this.context,value:Math.SQRT1_2}),this._merge=this.output=new Uo({context:this.context}),this.mid.fan(this._left),this.side.connect(this._left.addend),this.mid.connect(this._right),this.side.connect(this._right.subtrahend),this._left.connect(this._leftMult),this._right.connect(this._rightMult),this._leftMult.connect(this._merge,0,0),this._rightMult.connect(this._merge,0,1)}dispose(){return super.dispose(),this.mid.dispose(),this.side.dispose(),this._leftMult.dispose(),this._rightMult.dispose(),this._left.dispose(),this._right.dispose(),this}}class hl extends No{constructor(e){super(e),this.name="MidSideEffect",this._midSideMerge=new cl({context:this.context}),this._midSideSplit=new ul({context:this.context}),this._midSend=this._midSideSplit.mid,this._sideSend=this._midSideSplit.side,this._midReturn=this._midSideMerge.mid,this._sideReturn=this._midSideMerge.side,this.effectSend.connect(this._midSideSplit),this._midSideMerge.connect(this.effectReturn)}connectEffectMid(...e){this._midSend.chain(...e,this._midReturn)}connectEffectSide(...e){this._sideSend.chain(...e,this._sideReturn)}dispose(){return super.dispose(),this._midSideSplit.dispose(),this._midSideMerge.dispose(),this._midSend.dispose(),this._sideSend.dispose(),this._midReturn.dispose(),this._sideReturn.dispose(),this}}class dl extends hl{constructor(){super(Rr(dl.getDefaults(),arguments,["width"])),this.name="StereoWidener";const e=Rr(dl.getDefaults(),arguments,["width"]);this.width=new Ra({context:this.context,value:e.width,units:"normalRange"}),Zr(this,["width"]),this._twoTimesWidthMid=new pi({context:this.context,value:2}),this._twoTimesWidthSide=new pi({context:this.context,value:2}),this._midMult=new pi({context:this.context}),this._twoTimesWidthMid.connect(this._midMult.factor),this.connectEffectMid(this._midMult),this._oneMinusWidth=new Di({context:this.context}),this._oneMinusWidth.connect(this._twoTimesWidthMid),_a(this.context.getConstant(1),this._oneMinusWidth),this.width.connect(this._oneMinusWidth.subtrahend),this._sideMult=new pi({context:this.context}),this.width.connect(this._twoTimesWidthSide),this._twoTimesWidthSide.connect(this._sideMult.factor),this.connectEffectSide(this._sideMult)}static getDefaults(){return Object.assign(hl.getDefaults(),{width:.5})}dispose(){return super.dispose(),this.width.dispose(),this._midMult.dispose(),this._sideMult.dispose(),this._twoTimesWidthMid.dispose(),this._twoTimesWidthSide.dispose(),this._oneMinusWidth.dispose(),this}}class pl extends Go{constructor(){super(Rr(pl.getDefaults(),arguments,["frequency","depth"])),this.name="Tremolo";const e=Rr(pl.getDefaults(),arguments,["frequency","depth"]);this._lfoL=new Ci({context:this.context,type:e.type,min:1,max:0}),this._lfoR=new Ci({context:this.context,type:e.type,min:1,max:0}),this._amplitudeL=new Ta({context:this.context}),this._amplitudeR=new Ta({context:this.context}),this.frequency=new Ra({context:this.context,value:e.frequency,units:"frequency"}),this.depth=new Ra({context:this.context,value:e.depth,units:"normalRange"}),Zr(this,["frequency","depth"]),this.connectEffectLeft(this._amplitudeL),this.connectEffectRight(this._amplitudeR),this._lfoL.connect(this._amplitudeL.gain),this._lfoR.connect(this._amplitudeR.gain),this.frequency.fan(this._lfoL.frequency,this._lfoR.frequency),this.depth.fan(this._lfoR.amplitude,this._lfoL.amplitude),this.spread=e.spread}static getDefaults(){return Object.assign(Go.getDefaults(),{frequency:10,type:"sine",depth:.5,spread:180})}start(e){return this._lfoL.start(e),this._lfoR.start(e),this}stop(e){return this._lfoL.stop(e),this._lfoR.stop(e),this}sync(){return this._lfoL.sync(),this._lfoR.sync(),this.context.transport.syncSignal(this.frequency),this}unsync(){return this._lfoL.unsync(),this._lfoR.unsync(),this.context.transport.unsyncSignal(this.frequency),this}get type(){return this._lfoL.type}set type(e){this._lfoL.type=e,this._lfoR.type=e}get spread(){return this._lfoR.phase-this._lfoL.phase}set spread(e){this._lfoL.phase=90-e/2,this._lfoR.phase=e/2+90}dispose(){return super.dispose(),this._lfoL.dispose(),this._lfoR.dispose(),this._amplitudeL.dispose(),this._amplitudeR.dispose(),this.frequency.dispose(),this.depth.dispose(),this}}class fl extends No{constructor(){super(Rr(fl.getDefaults(),arguments,["frequency","depth"])),this.name="Vibrato";const e=Rr(fl.getDefaults(),arguments,["frequency","depth"]);this._delayNode=new La({context:this.context,delayTime:0,maxDelay:e.maxDelay}),this._lfo=new Ci({context:this.context,type:e.type,min:0,max:e.maxDelay,frequency:e.frequency,phase:-90}).start().connect(this._delayNode.delayTime),this.frequency=this._lfo.frequency,this.depth=this._lfo.amplitude,this.depth.value=e.depth,Zr(this,["frequency","depth"]),this.effectSend.chain(this._delayNode,this.effectReturn)}static getDefaults(){return Object.assign(No.getDefaults(),{maxDelay:.005,frequency:5,depth:.1,type:"sine"})}get type(){return this._lfo.type}set type(e){this._lfo.type=e}dispose(){return super.dispose(),this._delayNode.dispose(),this._lfo.dispose(),this.frequency.dispose(),this.depth.dispose(),this}}class ml extends Sa{constructor(){super(Rr(ml.getDefaults(),arguments,["type","size"])),this.name="Analyser",this._analysers=[],this._buffers=[];const e=Rr(ml.getDefaults(),arguments,["type","size"]);this.input=this.output=this._gain=new Ta({context:this.context}),this._split=new Wo({context:this.context,channels:e.channels}),this.input.connect(this._split),ar(e.channels,1);for(let t=0;t{const n=this._buffers[t];"fft"===this._type?e.getFloatFrequencyData(n):"waveform"===this._type&&e.getFloatTimeDomainData(n)})),1===this.channels?this._buffers[0]:this._buffers}get size(){return this._analysers[0].frequencyBinCount}set size(e){this._analysers.forEach(((t,n)=>{t.fftSize=2*e,this._buffers[n]=new Float32Array(e)}))}get channels(){return this._analysers.length}get type(){return this._type}set type(e){rr("waveform"===e||"fft"===e,`Analyser: invalid type: ${e}`),this._type=e}get smoothing(){return this._analysers[0].smoothingTimeConstant}set smoothing(e){this._analysers.forEach((t=>t.smoothingTimeConstant=e))}dispose(){return super.dispose(),this._analysers.forEach((e=>e.disconnect())),this._split.dispose(),this._gain.dispose(),this}}class gl extends Sa{constructor(){super(Rr(gl.getDefaults(),arguments)),this.name="MeterBase",this.input=this.output=this._analyser=new ml({context:this.context,size:256,type:"waveform"})}dispose(){return super.dispose(),this._analyser.dispose(),this}}class yl extends gl{constructor(){super(Rr(yl.getDefaults(),arguments,["smoothing"])),this.name="Meter",this._rms=0;const e=Rr(yl.getDefaults(),arguments,["smoothing"]);this.input=this.output=this._analyser=new ml({context:this.context,size:256,type:"waveform",channels:e.channels}),this.smoothing=e.smoothing,this.normalRange=e.normalRange}static getDefaults(){return Object.assign(gl.getDefaults(),{smoothing:.8,normalRange:!1,channels:1})}getLevel(){return cr("'getLevel' has been changed to 'getValue'"),this.getValue()}getValue(){const e=this._analyser.getValue(),t=(1===this.channels?[e]:e).map((e=>{const t=e.reduce(((e,t)=>e+t*t),0),n=Math.sqrt(t/e.length);return this._rms=Math.max(n,this._rms*this.smoothing),this.normalRange?this._rms:oa(this._rms)}));return 1===this.channels?t[0]:t}get channels(){return this._analyser.channels}dispose(){return super.dispose(),this._analyser.dispose(),this}}class bl extends gl{constructor(){super(Rr(bl.getDefaults(),arguments,["size"])),this.name="FFT";const e=Rr(bl.getDefaults(),arguments,["size"]);this.normalRange=e.normalRange,this._analyser.type="fft",this.size=e.size}static getDefaults(){return Object.assign(Sa.getDefaults(),{normalRange:!1,size:1024,smoothing:.8})}getValue(){return this._analyser.getValue().map((e=>this.normalRange?ia(e):e))}get size(){return this._analyser.size}set size(e){this._analyser.size=e}get smoothing(){return this._analyser.smoothing}set smoothing(e){this._analyser.smoothing=e}getFrequencyOfIndex(e){return rr(0<=e&&ee._updateSolo()))}get muted(){return 0===this.input.gain.value}_addSolo(){xl._soloed.has(this.context)||xl._soloed.set(this.context,new Set),xl._soloed.get(this.context).add(this)}_removeSolo(){xl._soloed.has(this.context)&&xl._soloed.get(this.context).delete(this)}_isSoloed(){return xl._soloed.has(this.context)&&xl._soloed.get(this.context).has(this)}_noSolos(){return!xl._soloed.has(this.context)||xl._soloed.has(this.context)&&0===xl._soloed.get(this.context).size}_updateSolo(){this._isSoloed()||this._noSolos()?this.input.gain.value=1:this.input.gain.value=0}dispose(){return super.dispose(),xl._allSolos.get(this.context).delete(this),this._removeSolo(),this}}xl._allSolos=new Map,xl._soloed=new Map;class Al extends Sa{constructor(){super(Rr(Al.getDefaults(),arguments,["pan","volume"])),this.name="PanVol";const e=Rr(Al.getDefaults(),arguments,["pan","volume"]);this._panner=this.input=new Do({context:this.context,pan:e.pan,channelCount:e.channelCount}),this.pan=this._panner.pan,this._volume=this.output=new Ka({context:this.context,volume:e.volume}),this.volume=this._volume.volume,this._panner.connect(this._volume),this.mute=e.mute,Zr(this,["pan","volume"])}static getDefaults(){return Object.assign(Sa.getDefaults(),{mute:!1,pan:0,volume:0,channelCount:1})}get mute(){return this._volume.mute}set mute(e){this._volume.mute=e}dispose(){return super.dispose(),this._panner.dispose(),this.pan.dispose(),this._volume.dispose(),this.volume.dispose(),this}}class kl extends Sa{constructor(){super(Rr(kl.getDefaults(),arguments,["volume","pan"])),this.name="Channel";const e=Rr(kl.getDefaults(),arguments,["volume","pan"]);this._solo=this.input=new xl({solo:e.solo,context:this.context}),this._panVol=this.output=new Al({context:this.context,pan:e.pan,volume:e.volume,mute:e.mute,channelCount:e.channelCount}),this.pan=this._panVol.pan,this.volume=this._panVol.volume,this._solo.connect(this._panVol),Zr(this,["pan","volume"])}static getDefaults(){return Object.assign(Sa.getDefaults(),{pan:0,volume:0,mute:!1,solo:!1,channelCount:1})}get solo(){return this._solo.solo}set solo(e){this._solo.solo=e}get muted(){return this._solo.muted||this.mute}get mute(){return this._panVol.mute}set mute(e){this._panVol.mute=e}_getBus(e){return kl.buses.has(e)||kl.buses.set(e,new Ta({context:this.context})),kl.buses.get(e)}send(e,t=0){const n=this._getBus(e),s=new Ta({context:this.context,units:"decibels",gain:t});return this.connect(s),s.connect(n),s}receive(e){return this._getBus(e).connect(this),this}dispose(){return super.dispose(),this._panVol.dispose(),this.pan.dispose(),this.volume.dispose(),this._solo.dispose(),this}}kl.buses=new Map;class Cl extends Sa{constructor(){super(Rr(Cl.getDefaults(),arguments)),this.name="Mono",this.input=new Ta({context:this.context}),this._merge=this.output=new Uo({channels:2,context:this.context}),this.input.connect(this._merge,0,0),this.input.connect(this._merge,0,1)}dispose(){return super.dispose(),this._merge.dispose(),this.input.dispose(),this}}class Sl extends Sa{constructor(){super(Rr(Sl.getDefaults(),arguments,["lowFrequency","highFrequency"])),this.name="MultibandSplit",this.input=new Ta({context:this.context}),this.output=void 0,this.low=new Ki({context:this.context,frequency:0,type:"lowpass"}),this._lowMidFilter=new Ki({context:this.context,frequency:0,type:"highpass"}),this.mid=new Ki({context:this.context,frequency:0,type:"lowpass"}),this.high=new Ki({context:this.context,frequency:0,type:"highpass"}),this._internalChannels=[this.low,this.mid,this.high];const e=Rr(Sl.getDefaults(),arguments,["lowFrequency","highFrequency"]);this.lowFrequency=new Ra({context:this.context,units:"frequency",value:e.lowFrequency}),this.highFrequency=new Ra({context:this.context,units:"frequency",value:e.highFrequency}),this.Q=new Ra({context:this.context,units:"positive",value:e.Q}),this.input.fan(this.low,this.high),this.input.chain(this._lowMidFilter,this.mid),this.lowFrequency.fan(this.low.frequency,this._lowMidFilter.frequency),this.highFrequency.fan(this.mid.frequency,this.high.frequency),this.Q.connect(this.low.Q),this.Q.connect(this._lowMidFilter.Q),this.Q.connect(this.mid.Q),this.Q.connect(this.high.Q),Zr(this,["high","mid","low","highFrequency","lowFrequency"])}static getDefaults(){return Object.assign(Sa.getDefaults(),{Q:1,highFrequency:2500,lowFrequency:400})}dispose(){return super.dispose(),Yr(this,["high","mid","low","highFrequency","lowFrequency"]),this.low.dispose(),this._lowMidFilter.dispose(),this.mid.dispose(),this.high.dispose(),this.lowFrequency.dispose(),this.highFrequency.dispose(),this.Q.dispose(),this}}class El extends Sa{constructor(){super(...arguments),this.name="Listener",this.positionX=new Ca({context:this.context,param:this.context.rawContext.listener.positionX}),this.positionY=new Ca({context:this.context,param:this.context.rawContext.listener.positionY}),this.positionZ=new Ca({context:this.context,param:this.context.rawContext.listener.positionZ}),this.forwardX=new Ca({context:this.context,param:this.context.rawContext.listener.forwardX}),this.forwardY=new Ca({context:this.context,param:this.context.rawContext.listener.forwardY}),this.forwardZ=new Ca({context:this.context,param:this.context.rawContext.listener.forwardZ}),this.upX=new Ca({context:this.context,param:this.context.rawContext.listener.upX}),this.upY=new Ca({context:this.context,param:this.context.rawContext.listener.upY}),this.upZ=new Ca({context:this.context,param:this.context.rawContext.listener.upZ})}static getDefaults(){return Object.assign(Sa.getDefaults(),{positionX:0,positionY:0,positionZ:0,forwardX:0,forwardY:0,forwardZ:-1,upX:0,upY:1,upZ:0})}dispose(){return super.dispose(),this.positionX.dispose(),this.positionY.dispose(),this.positionZ.dispose(),this.forwardX.dispose(),this.forwardY.dispose(),this.forwardZ.dispose(),this.upX.dispose(),this.upY.dispose(),this.upZ.dispose(),this}}qr((e=>{e.listener=new El({context:e})})),Hr((e=>{e.listener.dispose()}));class _l extends Sa{constructor(){super(Rr(_l.getDefaults(),arguments,["positionX","positionY","positionZ"])),this.name="Panner3D";const e=Rr(_l.getDefaults(),arguments,["positionX","positionY","positionZ"]);this._panner=this.input=this.output=this.context.createPanner(),this.panningModel=e.panningModel,this.maxDistance=e.maxDistance,this.distanceModel=e.distanceModel,this.coneOuterGain=e.coneOuterGain,this.coneOuterAngle=e.coneOuterAngle,this.coneInnerAngle=e.coneInnerAngle,this.refDistance=e.refDistance,this.rolloffFactor=e.rolloffFactor,this.positionX=new Ca({context:this.context,param:this._panner.positionX,value:e.positionX}),this.positionY=new Ca({context:this.context,param:this._panner.positionY,value:e.positionY}),this.positionZ=new Ca({context:this.context,param:this._panner.positionZ,value:e.positionZ}),this.orientationX=new Ca({context:this.context,param:this._panner.orientationX,value:e.orientationX}),this.orientationY=new Ca({context:this.context,param:this._panner.orientationY,value:e.orientationY}),this.orientationZ=new Ca({context:this.context,param:this._panner.orientationZ,value:e.orientationZ})}static getDefaults(){return Object.assign(Sa.getDefaults(),{coneInnerAngle:360,coneOuterAngle:360,coneOuterGain:0,distanceModel:"inverse",maxDistance:1e4,orientationX:0,orientationY:0,orientationZ:0,panningModel:"equalpower",positionX:0,positionY:0,positionZ:0,refDistance:1,rolloffFactor:1})}setPosition(e,t,n){return this.positionX.value=e,this.positionY.value=t,this.positionZ.value=n,this}setOrientation(e,t,n){return this.orientationX.value=e,this.orientationY.value=t,this.orientationZ.value=n,this}get panningModel(){return this._panner.panningModel}set panningModel(e){this._panner.panningModel=e}get refDistance(){return this._panner.refDistance}set refDistance(e){this._panner.refDistance=e}get rolloffFactor(){return this._panner.rolloffFactor}set rolloffFactor(e){this._panner.rolloffFactor=e}get distanceModel(){return this._panner.distanceModel}set distanceModel(e){this._panner.distanceModel=e}get coneInnerAngle(){return this._panner.coneInnerAngle}set coneInnerAngle(e){this._panner.coneInnerAngle=e}get coneOuterAngle(){return this._panner.coneOuterAngle}set coneOuterAngle(e){this._panner.coneOuterAngle=e}get coneOuterGain(){return this._panner.coneOuterGain}set coneOuterGain(e){this._panner.coneOuterGain=e}get maxDistance(){return this._panner.maxDistance}set maxDistance(e){this._panner.maxDistance=e}dispose(){return super.dispose(),this._panner.disconnect(),this.orientationX.dispose(),this.orientationY.dispose(),this.orientationZ.dispose(),this.positionX.dispose(),this.positionY.dispose(),this.positionZ.dispose(),this}}class Il extends Sa{constructor(){super(Rr(Il.getDefaults(),arguments)),this.name="Recorder";const e=Rr(Il.getDefaults(),arguments);this.input=new Ta({context:this.context}),rr(Il.supported,"Media Recorder API is not available"),this._stream=this.context.createMediaStreamDestination(),this.input.connect(this._stream),this._recorder=new MediaRecorder(this._stream.stream,{mimeType:e.mimeType})}static getDefaults(){return Sa.getDefaults()}get mimeType(){return this._recorder.mimeType}static get supported(){return null!==vr&&Reflect.has(vr,"MediaRecorder")}get state(){return"inactive"===this._recorder.state?"stopped":"paused"===this._recorder.state?"paused":"started"}start(){return kr(this,void 0,void 0,(function*(){rr("started"!==this.state,"Recorder is already started");const e=new Promise((e=>{const t=()=>{this._recorder.removeEventListener("start",t,!1),e()};this._recorder.addEventListener("start",t,!1)}));return this._recorder.start(),yield e}))}stop(){return kr(this,void 0,void 0,(function*(){rr("stopped"!==this.state,"Recorder is not started");const e=new Promise((e=>{const t=n=>{this._recorder.removeEventListener("dataavailable",t,!1),e(n.data)};this._recorder.addEventListener("dataavailable",t,!1)}));return this._recorder.stop(),yield e}))}pause(){return rr("started"===this.state,"Recorder must be started"),this._recorder.pause(),this}dispose(){return super.dispose(),this.input.dispose(),this._stream.disconnect(),this}}class Tl extends Sa{constructor(){super(Rr(Tl.getDefaults(),arguments,["threshold","ratio"])),this.name="Compressor",this._compressor=this.context.createDynamicsCompressor(),this.input=this._compressor,this.output=this._compressor;const e=Rr(Tl.getDefaults(),arguments,["threshold","ratio"]);this.threshold=new Ca({minValue:this._compressor.threshold.minValue,maxValue:this._compressor.threshold.maxValue,context:this.context,convert:!1,param:this._compressor.threshold,units:"decibels",value:e.threshold}),this.attack=new Ca({minValue:this._compressor.attack.minValue,maxValue:this._compressor.attack.maxValue,context:this.context,param:this._compressor.attack,units:"time",value:e.attack}),this.release=new Ca({minValue:this._compressor.release.minValue,maxValue:this._compressor.release.maxValue,context:this.context,param:this._compressor.release,units:"time",value:e.release}),this.knee=new Ca({minValue:this._compressor.knee.minValue,maxValue:this._compressor.knee.maxValue,context:this.context,convert:!1,param:this._compressor.knee,units:"decibels",value:e.knee}),this.ratio=new Ca({minValue:this._compressor.ratio.minValue,maxValue:this._compressor.ratio.maxValue,context:this.context,convert:!1,param:this._compressor.ratio,units:"positive",value:e.ratio}),Zr(this,["knee","release","attack","ratio","threshold"])}static getDefaults(){return Object.assign(Sa.getDefaults(),{attack:.003,knee:30,ratio:12,release:.25,threshold:-24})}get reduction(){return this._compressor.reduction}dispose(){return super.dispose(),this._compressor.disconnect(),this.attack.dispose(),this.release.dispose(),this.threshold.dispose(),this.ratio.dispose(),this.knee.dispose(),this}}class Nl extends Sa{constructor(){super(Object.assign(Rr(Nl.getDefaults(),arguments,["threshold","smoothing"]))),this.name="Gate";const e=Rr(Nl.getDefaults(),arguments,["threshold","smoothing"]);this._follower=new Fo({context:this.context,smoothing:e.smoothing}),this._gt=new Fi({context:this.context,value:ia(e.threshold)}),this.input=new Ta({context:this.context}),this._gate=this.output=new Ta({context:this.context}),this.input.connect(this._gate),this.input.chain(this._follower,this._gt,this._gate.gain)}static getDefaults(){return Object.assign(Sa.getDefaults(),{smoothing:.1,threshold:-40})}get threshold(){return oa(this._gt.value)}set threshold(e){this._gt.value=ia(e)}get smoothing(){return this._follower.smoothing}set smoothing(e){this._follower.smoothing=e}dispose(){return super.dispose(),this.input.dispose(),this._follower.dispose(),this._gt.dispose(),this._gate.dispose(),this}}class Ol extends Sa{constructor(){super(Object.assign(Rr(Ol.getDefaults(),arguments,["threshold"]))),this.name="Limiter";const e=Rr(Ol.getDefaults(),arguments,["threshold"]);this._compressor=this.input=this.output=new Tl({context:this.context,ratio:20,attack:.003,release:.01,threshold:e.threshold}),this.threshold=this._compressor.threshold,Zr(this,"threshold")}static getDefaults(){return Object.assign(Sa.getDefaults(),{threshold:-12})}get reduction(){return this._compressor.reduction}dispose(){return super.dispose(),this._compressor.dispose(),this.threshold.dispose(),this}}class Rl extends Sa{constructor(){super(Object.assign(Rr(Rl.getDefaults(),arguments))),this.name="MidSideCompressor";const e=Rr(Rl.getDefaults(),arguments);this._midSideSplit=this.input=new ul({context:this.context}),this._midSideMerge=this.output=new cl({context:this.context}),this.mid=new Tl(Object.assign(e.mid,{context:this.context})),this.side=new Tl(Object.assign(e.side,{context:this.context})),this._midSideSplit.mid.chain(this.mid,this._midSideMerge.mid),this._midSideSplit.side.chain(this.side,this._midSideMerge.side),Zr(this,["mid","side"])}static getDefaults(){return Object.assign(Sa.getDefaults(),{mid:{ratio:3,threshold:-24,release:.03,attack:.02,knee:16},side:{ratio:6,threshold:-30,release:.25,attack:.03,knee:10}})}dispose(){return super.dispose(),this.mid.dispose(),this.side.dispose(),this._midSideSplit.dispose(),this._midSideMerge.dispose(),this}}class Dl extends Sa{constructor(){super(Object.assign(Rr(Dl.getDefaults(),arguments))),this.name="MultibandCompressor";const e=Rr(Dl.getDefaults(),arguments);this._splitter=this.input=new Sl({context:this.context,lowFrequency:e.lowFrequency,highFrequency:e.highFrequency}),this.lowFrequency=this._splitter.lowFrequency,this.highFrequency=this._splitter.highFrequency,this.output=new Ta({context:this.context}),this.low=new Tl(Object.assign(e.low,{context:this.context})),this.mid=new Tl(Object.assign(e.mid,{context:this.context})),this.high=new Tl(Object.assign(e.high,{context:this.context})),this._splitter.low.chain(this.low,this.output),this._splitter.mid.chain(this.mid,this.output),this._splitter.high.chain(this.high,this.output),Zr(this,["high","mid","low","highFrequency","lowFrequency"])}static getDefaults(){return Object.assign(Sa.getDefaults(),{lowFrequency:250,highFrequency:2e3,low:{ratio:6,threshold:-30,release:.25,attack:.03,knee:10},mid:{ratio:3,threshold:-24,release:.03,attack:.02,knee:16},high:{ratio:3,threshold:-24,release:.03,attack:.02,knee:16}})}dispose(){return super.dispose(),this._splitter.dispose(),this.low.dispose(),this.mid.dispose(),this.high.dispose(),this.output.dispose(),this}}class Ml extends Sa{constructor(){super(Rr(Ml.getDefaults(),arguments,["low","mid","high"])),this.name="EQ3",this.output=new Ta({context:this.context}),this._internalChannels=[];const e=Rr(Ml.getDefaults(),arguments,["low","mid","high"]);this.input=this._multibandSplit=new Sl({context:this.context,highFrequency:e.highFrequency,lowFrequency:e.lowFrequency}),this._lowGain=new Ta({context:this.context,gain:e.low,units:"decibels"}),this._midGain=new Ta({context:this.context,gain:e.mid,units:"decibels"}),this._highGain=new Ta({context:this.context,gain:e.high,units:"decibels"}),this.low=this._lowGain.gain,this.mid=this._midGain.gain,this.high=this._highGain.gain,this.Q=this._multibandSplit.Q,this.lowFrequency=this._multibandSplit.lowFrequency,this.highFrequency=this._multibandSplit.highFrequency,this._multibandSplit.low.chain(this._lowGain,this.output),this._multibandSplit.mid.chain(this._midGain,this.output),this._multibandSplit.high.chain(this._highGain,this.output),Zr(this,["low","mid","high","lowFrequency","highFrequency"]),this._internalChannels=[this._multibandSplit]}static getDefaults(){return Object.assign(Sa.getDefaults(),{high:0,highFrequency:2500,low:0,lowFrequency:400,mid:0})}dispose(){return super.dispose(),Yr(this,["low","mid","high","lowFrequency","highFrequency"]),this._multibandSplit.dispose(),this.lowFrequency.dispose(),this.highFrequency.dispose(),this._lowGain.dispose(),this._midGain.dispose(),this._highGain.dispose(),this.low.dispose(),this.mid.dispose(),this.high.dispose(),this.Q.dispose(),this}}class Fl extends Sa{constructor(){super(Rr(Fl.getDefaults(),arguments,["url","onload"])),this.name="Convolver",this._convolver=this.context.createConvolver();const e=Rr(Fl.getDefaults(),arguments,["url","onload"]);this._buffer=new Jr(e.url,(t=>{this.buffer=t,e.onload()})),this.input=new Ta({context:this.context}),this.output=new Ta({context:this.context}),this._buffer.loaded&&(this.buffer=this._buffer),this.normalize=e.normalize,this.input.chain(this._convolver,this.output)}static getDefaults(){return Object.assign(Sa.getDefaults(),{normalize:!0,onload:Qr})}load(e){return kr(this,void 0,void 0,(function*(){this.buffer=yield this._buffer.load(e)}))}get buffer(){return this._buffer.length?this._buffer:null}set buffer(e){e&&this._buffer.set(e),this._convolver.buffer&&(this.input.disconnect(),this._convolver.disconnect(),this._convolver=this.context.createConvolver(),this.input.chain(this._convolver,this.output));const t=this._buffer.get();this._convolver.buffer=t||null}get normalize(){return this._convolver.normalize}set normalize(e){this._convolver.normalize=e}dispose(){return super.dispose(),this._buffer.dispose(),this._convolver.disconnect(),this}}function Bl(){return sa().now()}function zl(){return sa().immediate()}const Ll=sa().transport;function Pl(){return sa().transport}const Vl=sa().destination,Wl=sa().destination;function Ul(){return sa().destination}const Gl=sa().listener;function ql(){return sa().listener}const jl=sa().draw;function Hl(){return sa().draw}const $l=sa();function Kl(){return Jr.loaded()}const Xl=Jr,Zl=Va,Yl=ti},8990:function(e,t,n){(function(){"use strict";var e;function t(e){var t=0;return function(){return t>>0)+"_",r=0;return function e(s){if(this instanceof e)throw new TypeError("Symbol is not a constructor");return new t(n+(s||"")+"_"+r++,s)}})),a("Symbol.iterator",(function(e){if(e)return e;e=Symbol("Symbol.iterator");for(var n="Array Int8Array Uint8Array Uint8ClampedArray Int16Array Uint16Array Int32Array Uint32Array Float32Array Float64Array".split(" "),a=0;a(t=t||0)&&(t=Math.max(t+s,0));ta)s[n++]=a;else{if(2048>a)s[n++]=a>>6|192;else{if(55296<=a&&57343>=a){if(56319>=a&&r=i){a=1024*(a-55296)+i-56320+65536,s[n++]=a>>18|240,s[n++]=a>>12&63|128,s[n++]=a>>6&63|128,s[n++]=63&a|128;continue}r--}if(t)throw Error("Found an unpaired surrogate");a=65533}s[n++]=a>>12|224,s[n++]=a>>6&63|128}s[n++]=63&a|128}}e=s.subarray(0,n)}return e}var D={},M=null;function F(e,t){void 0===t&&(t=0),z(),t=D[t];for(var n=Array(Math.floor(e.length/3)),s=t[64]||"",r=0,a=0;r>2];i=t[(3&i)<<4|o>>4],o=t[(15&o)<<2|l>>6],l=t[63&l],n[a++]=u+i+o+l}switch(u=0,l=s,e.length-r){case 2:l=t[(15&(u=e[r+1]))<<2]||s;case 1:e=e[r],n[a]=t[e>>2]+t[(3&e)<<4|u>>4]+l+s}return n.join("")}function B(e){var t=e.length,n=3*t/4;n%3?n=Math.floor(n):-1!="=.".indexOf(e[t-1])&&(n=-1!="=.".indexOf(e[t-2])?n-2:n-1);var s=new Uint8Array(n),r=0;return function(e,t){function n(t){for(;s>4),64!=i&&(t(a<<4&240|i>>2),64!=o&&t(i<<6&192|o))}}(e,(function(e){s[r++]=e})),s.subarray(0,r)}function z(){if(!M){M={};for(var e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789".split(""),t=["+/=","+/","-_=","-_.","-_"],n=0;5>n;n++){var s=e.concat(t[n].split(""));D[n]=s;for(var r=0;rr&&128<=t;r++)n|=(127&(t=e.h[e.g++]))<<7*r;if(128<=t&&(n|=(127&(t=e.h[e.g++]))<<28,s|=(127&t)>>4),128<=t)for(r=0;5>r&&128<=t;r++)s|=(127&(t=e.h[e.g++]))<<7*r+3;if(128>t)return e=n>>>0,(s=2147483648&(t=s>>>0))&&(t=~t>>>0,0==(e=1+~e>>>0)&&(t=t+1>>>0)),e=4294967296*t+(e>>>0),s?-e:e;e.m=!0}U.prototype.reset=function(){this.g=this.l},U.prototype.i=function(){var e=this.h,t=e[this.g],n=127&t;return 128>t?(this.g+=1,n):(n|=(127&(t=e[this.g+1]))<<7,128>t?(this.g+=2,n):(n|=(127&(t=e[this.g+2]))<<14,128>t?(this.g+=3,n):(n|=(127&(t=e[this.g+3]))<<21,128>t?(this.g+=4,n):(n|=(15&(t=e[this.g+4]))<<28,128>t?(this.g+=5,n>>>0):(this.g+=5,128<=e[this.g++]&&128<=e[this.g++]&&128<=e[this.g++]&&128<=e[this.g++]&&this.g++,n)))))},U.prototype.o=function(){var e=this.h[this.g],t=this.h[this.g+1],n=this.h[this.g+2],s=this.h[this.g+3];return this.g+=4,e=2*((n=(e|t<<8|n<<16|s<<24)>>>0)>>31)+1,t=n>>>23&255,n&=8388607,255==t?n?NaN:1/0*e:0==t?e*Math.pow(2,-149)*n:e*Math.pow(2,t-150)*(n+Math.pow(2,23))};var j=[];function H(){this.g=new Uint8Array(64),this.h=0}function $(e,t){for(;127>>=7;e.push(t)}function K(e){var t={},n=void 0!==t.N&&t.N;this.o={v:void 0!==t.v&&t.v},this.N=n,t=this.o,j.length?(n=j.pop(),t&&(n.v=t.v),e&&G(n,e),e=n):e=new U(e,t),this.g=e,this.m=this.g.g,this.h=this.i=this.l=-1,this.j=!1}function X(e){var t=e.g;if((t=t.g==t.j)||(t=e.j)||(t=(t=e.g).m||0>t.g||t.g>t.j),t)return!1;e.m=e.g.g;var n=7&(t=e.g.i());return 0!=n&&5!=n&&1!=n&&2!=n&&3!=n&&4!=n?(e.j=!0,!1):(e.i=t,e.l=t>>>3,e.h=n,!0)}function Z(e){switch(e.h){case 0:if(0!=e.h)Z(e);else{for(e=e.g;128&e.h[e.g];)e.g++;e.g++}break;case 1:1!=e.h?Z(e):(e=e.g).g+=8;break;case 2:if(2!=e.h)Z(e);else{var t=e.g.i();(e=e.g).g+=t}break;case 5:5!=e.h?Z(e):(e=e.g).g+=4;break;case 3:for(t=e.l;;){if(!X(e)){e.j=!0;break}if(4==e.h){e.l!=t&&(e.j=!0);break}Z(e)}break;default:e.j=!0}}function Y(e,t,n){var s=e.g.j,r=e.g.i(),a=e.g.g+r;if(e.g.j=a,n(t,e),0!==(n=a-e.g.g))throw Error("Message parsing ended unexpectedly. Expected to read "+r+" bytes, instead read "+(r-n)+" bytes, either the data ended unexpectedly or the message misreported its own length");return e.g.g=a,e.g.j=s,t}function Q(e){return e.g.o()}function J(e){var t,n=e.g.i(),s=(e=e.g).g;if(e.g+=n,e=e.h,N)(t=I)||(t=I=new TextDecoder("utf-8",{fatal:!1})),t=t.decode(e.subarray(s,s+n));else{n=s+n;for(var r,a,i,o=[],l=null;s(r=e[s++])?o.push(r):224>r?s>=n?o.push(65533):(a=e[s++],194>r||128!=(192&a)?(s--,o.push(65533)):o.push((31&r)<<6|63&a)):240>r?s>=n-1?o.push(65533):128!=(192&(a=e[s++]))||224===r&&160>a||237===r&&160<=a||128!=(192&(t=e[s++]))?(s--,o.push(65533)):o.push((15&r)<<12|(63&a)<<6|63&t):244>=r?s>=n-2?o.push(65533):128!=(192&(a=e[s++]))||a-144+(r<<28)>>30||128!=(192&(t=e[s++]))||128!=(192&(i=e[s++]))?(s--,o.push(65533)):(r=(7&r)<<18|(63&a)<<12|(63&t)<<6|63&i,r-=65536,o.push(55296+(r>>10&1023),56320+(1023&r))):o.push(65533),8192<=o.length&&(l=_(l,o),o.length=0);t=_(l,o)}return t}function ee(e,t,n){var s=e.g.i();for(s=e.g.g+s;e.g.gs?1:0)?-s:s)?0<1/s?W=0:(0,W=2147483648):isNaN(s)?(0,W=2147483647):34028234663852886e22>>0):11754943508222875e-54>s?(s=Math.round(s/Math.pow(2,-149)),0,W=(n<<31|s)>>>0):(t=Math.floor(Math.log(s)/Math.LN2),s*=Math.pow(2,-t),16777216<=(s=Math.round(8388608*s))&&++t,0,W=(n<<31|t+127<<23|8388607&s)>>>0),n=W,e.push(n>>>0&255),e.push(n>>>8&255),e.push(n>>>16&255),e.push(n>>>24&255)}}H.prototype.push=function(e){if(!(this.h+1=e.l?e.i?e.i[t]:void 0:e.h[t+e.j]}function ye(e,t){var n=void 0!==n&&n,s=ge(e,t,n);return null==s&&(s=fe),s===fe&&xe(e,t,s=de([]),n),s}function be(e){var t=ye(e,3);if(e.m||(e.m={}),!e.m[3]){for(var n=0;n=e.l?(me(e),e.i[t]=n):e.h[t+e.j]=n}function Ae(e,t,n){if(-1===n)return null;if(e.g||(e.g={}),!e.g[n]){var s=ge(e,n,!1);s&&(e.g[n]=new t(s))}return e.g[n]}function ke(e,t){e.g||(e.g={});var n=e.g[1];if(!n){var s=ye(e,1);n=[];for(var r=0;r_;var I=(_=Math.abs(_))>>>0;for(_=Math.floor((_-I)/4294967296),_>>>=0,S&&(_=~_>>>0,4294967295<(I=1+(~I>>>0))&&(I=0,4294967295<++_&&(_=0))),S=W=I,I=_;0>>7|I<<25)>>>0,I>>>=7;E.push(S)}if(_e(k,C),A=re(A),v.call(w,x,A),y.O)for(w=0;w_;_++)S.push(127&I|128),I>>=7;S.push(1)}ae(E,2,ge(C,2)),null!=(S=ge(C,3))&&(S=R(S),$(E.g,26),$(E.g,S.length),se(E,E.g.end()),se(E,S)),null!=(S=ge(C,4))&&(S=R(S),$(E.g,34),$(E.g,S.length),se(E,E.g.end()),se(E,S)),_e(C,E),k=re(k),x.call(v,A,k)}}f=f.data;break e;default:f={}}}switch(c=f,h=u.stream,u.type){case"video":r.pushTexture2d(Object.assign(Object.assign({},c),{stream:h,timestamp:s}));break;case"detections":(d=c).stream=h,d.timestamp=s,r.pushDetectionList(d);break;default:throw Error("Unknown input config type: '"+u.type+"'")}}return p.i.send(r),b(n,p.C,4);case 4:r.delete(),n.g=0}}))}))},e.onResults=function(e,t){this.listeners[t||"$"]=e},E("Solution",nt),E("OptionType",{BOOL:0,NUMBER:1,aa:2,0:"BOOL",1:"NUMBER",2:"STRING"});var lt={files:[{url:"face_mesh_solution_packed_assets_loader.js"},{simd:!0,url:"face_mesh_solution_simd_wasm_bin.js"},{simd:!1,url:"face_mesh_solution_wasm_bin.js"}],graph:{url:"face_mesh.binarypb"},listeners:[{wants:["multi_face_geometry","image_transformed","multi_face_landmarks"],outs:{image:"image_transformed",multiFaceGeometry:{type:"proto_list",stream:"multi_face_geometry",transform:function(e){return e.map(ot)}},multiFaceLandmarks:{type:"proto_list",stream:"multi_face_landmarks",transform:function(e){return e.map((function(e){return ke(Ve(e),ze).map(Xe)}))}}}}],inputs:{image:{type:"video",stream:"input_frames_gpu"}},options:{useCpuInference:{type:0,graphOptionXref:{calculatorType:"InferenceCalculator",fieldName:"use_cpu_inference"},default:"iPad Simulator;iPhone Simulator;iPod Simulator;iPad;iPhone;iPod".split(";").includes(navigator.platform)||navigator.userAgent.includes("Mac")&&"ontouchend"in document},enableFaceGeometry:{type:0,graphOptionXref:{calculatorName:"EnableFaceGeometryConstant",calculatorType:"ConstantSidePacketCalculator",fieldName:"bool_value"}},selfieMode:{type:0,graphOptionXref:{calculatorType:"GlScalerCalculator",calculatorIndex:1,fieldName:"flip_horizontal"}},maxNumFaces:{type:1,graphOptionXref:{calculatorType:"ConstantSidePacketCalculator",calculatorName:"ConstantSidePacketCalculatorNumFaces",fieldName:"int_value"}},refineLandmarks:{type:0,graphOptionXref:{calculatorType:"ConstantSidePacketCalculator",calculatorName:"ConstantSidePacketCalculatorRefineLandmarks",fieldName:"bool_value"}},minDetectionConfidence:{type:1,graphOptionXref:{calculatorType:"TensorsToDetectionsCalculator",calculatorName:"facelandmarkfrontgpu__facedetectionshortrangegpu__facedetectionshortrangecommon__TensorsToDetectionsCalculator",fieldName:"min_score_thresh"}},minTrackingConfidence:{type:1,graphOptionXref:{calculatorType:"ThresholdingCalculator",calculatorName:"facelandmarkfrontgpu__facelandmarkgpu__ThresholdingCalculator",fieldName:"threshold"}},cameraNear:{type:1,graphOptionXref:{calculatorType:"FaceGeometryEnvGeneratorCalculator",fieldName:"near"}},cameraFar:{type:1,graphOptionXref:{calculatorType:"FaceGeometryEnvGeneratorCalculator",fieldName:"far"}},cameraVerticalFovDegrees:{type:1,graphOptionXref:{calculatorType:"FaceGeometryEnvGeneratorCalculator",fieldName:"vertical_fov_degrees"}}}},ut=[[61,146],[146,91],[91,181],[181,84],[84,17],[17,314],[314,405],[405,321],[321,375],[375,291],[61,185],[185,40],[40,39],[39,37],[37,0],[0,267],[267,269],[269,270],[270,409],[409,291],[78,95],[95,88],[88,178],[178,87],[87,14],[14,317],[317,402],[402,318],[318,324],[324,308],[78,191],[191,80],[80,81],[81,82],[82,13],[13,312],[312,311],[311,310],[310,415],[415,308]],ct=[[263,249],[249,390],[390,373],[373,374],[374,380],[380,381],[381,382],[382,362],[263,466],[466,388],[388,387],[387,386],[386,385],[385,384],[384,398],[398,362]],ht=[[276,283],[283,282],[282,295],[295,285],[300,293],[293,334],[334,296],[296,336]],dt=[[33,7],[7,163],[163,144],[144,145],[145,153],[153,154],[154,155],[155,133],[33,246],[246,161],[161,160],[160,159],[159,158],[158,157],[157,173],[173,133]],pt=[[46,53],[53,52],[52,65],[65,55],[70,63],[63,105],[105,66],[66,107]],ft=[[10,338],[338,297],[297,332],[332,284],[284,251],[251,389],[389,356],[356,454],[454,323],[323,361],[361,288],[288,397],[397,365],[365,379],[379,378],[378,400],[400,377],[377,152],[152,148],[148,176],[176,149],[149,150],[150,136],[136,172],[172,58],[58,132],[132,93],[93,234],[234,127],[127,162],[162,21],[21,54],[54,103],[103,67],[67,109],[109,10]],mt=[].concat(l(ut),l(ct),l(ht),l(dt),l(pt),l(ft));function gt(e){e=e||{},e=Object.assign(Object.assign({},lt),e),this.g=new nt(e)}(e=gt.prototype).close=function(){return this.g.close(),Promise.resolve()},e.onResults=function(e){this.g.onResults(e)},e.initialize=function(){return Re(this,(function e(){var t=this;return k(e,(function(e){return b(e,t.g.initialize(),0)}))}))},e.reset=function(){this.g.reset()},e.send=function(e){return Re(this,(function t(){var n=this;return k(t,(function(t){return b(t,n.g.send(e),0)}))}))},e.setOptions=function(e){this.g.setOptions(e)},E("FACE_GEOMETRY",{Layout:{COLUMN_MAJOR:0,ROW_MAJOR:1,0:"COLUMN_MAJOR",1:"ROW_MAJOR"},PrimitiveType:{TRIANGLE:0,0:"TRIANGLE"},VertexType:{VERTEX_PT:0,0:"VERTEX_PT"},DEFAULT_CAMERA_PARAMS:{verticalFovDegrees:63,near:1,far:1e4}}),E("FaceMesh",gt),E("FACEMESH_LIPS",ut),E("FACEMESH_LEFT_EYE",ct),E("FACEMESH_LEFT_EYEBROW",ht),E("FACEMESH_LEFT_IRIS",[[474,475],[475,476],[476,477],[477,474]]),E("FACEMESH_RIGHT_EYE",dt),E("FACEMESH_RIGHT_EYEBROW",pt),E("FACEMESH_RIGHT_IRIS",[[469,470],[470,471],[471,472],[472,469]]),E("FACEMESH_FACE_OVAL",ft),E("FACEMESH_CONTOURS",mt),E("FACEMESH_TESSELATION",[[127,34],[34,139],[139,127],[11,0],[0,37],[37,11],[232,231],[231,120],[120,232],[72,37],[37,39],[39,72],[128,121],[121,47],[47,128],[232,121],[121,128],[128,232],[104,69],[69,67],[67,104],[175,171],[171,148],[148,175],[118,50],[50,101],[101,118],[73,39],[39,40],[40,73],[9,151],[151,108],[108,9],[48,115],[115,131],[131,48],[194,204],[204,211],[211,194],[74,40],[40,185],[185,74],[80,42],[42,183],[183,80],[40,92],[92,186],[186,40],[230,229],[229,118],[118,230],[202,212],[212,214],[214,202],[83,18],[18,17],[17,83],[76,61],[61,146],[146,76],[160,29],[29,30],[30,160],[56,157],[157,173],[173,56],[106,204],[204,194],[194,106],[135,214],[214,192],[192,135],[203,165],[165,98],[98,203],[21,71],[71,68],[68,21],[51,45],[45,4],[4,51],[144,24],[24,23],[23,144],[77,146],[146,91],[91,77],[205,50],[50,187],[187,205],[201,200],[200,18],[18,201],[91,106],[106,182],[182,91],[90,91],[91,181],[181,90],[85,84],[84,17],[17,85],[206,203],[203,36],[36,206],[148,171],[171,140],[140,148],[92,40],[40,39],[39,92],[193,189],[189,244],[244,193],[159,158],[158,28],[28,159],[247,246],[246,161],[161,247],[236,3],[3,196],[196,236],[54,68],[68,104],[104,54],[193,168],[168,8],[8,193],[117,228],[228,31],[31,117],[189,193],[193,55],[55,189],[98,97],[97,99],[99,98],[126,47],[47,100],[100,126],[166,79],[79,218],[218,166],[155,154],[154,26],[26,155],[209,49],[49,131],[131,209],[135,136],[136,150],[150,135],[47,126],[126,217],[217,47],[223,52],[52,53],[53,223],[45,51],[51,134],[134,45],[211,170],[170,140],[140,211],[67,69],[69,108],[108,67],[43,106],[106,91],[91,43],[230,119],[119,120],[120,230],[226,130],[130,247],[247,226],[63,53],[53,52],[52,63],[238,20],[20,242],[242,238],[46,70],[70,156],[156,46],[78,62],[62,96],[96,78],[46,53],[53,63],[63,46],[143,34],[34,227],[227,143],[123,117],[117,111],[111,123],[44,125],[125,19],[19,44],[236,134],[134,51],[51,236],[216,206],[206,205],[205,216],[154,153],[153,22],[22,154],[39,37],[37,167],[167,39],[200,201],[201,208],[208,200],[36,142],[142,100],[100,36],[57,212],[212,202],[202,57],[20,60],[60,99],[99,20],[28,158],[158,157],[157,28],[35,226],[226,113],[113,35],[160,159],[159,27],[27,160],[204,202],[202,210],[210,204],[113,225],[225,46],[46,113],[43,202],[202,204],[204,43],[62,76],[76,77],[77,62],[137,123],[123,116],[116,137],[41,38],[38,72],[72,41],[203,129],[129,142],[142,203],[64,98],[98,240],[240,64],[49,102],[102,64],[64,49],[41,73],[73,74],[74,41],[212,216],[216,207],[207,212],[42,74],[74,184],[184,42],[169,170],[170,211],[211,169],[170,149],[149,176],[176,170],[105,66],[66,69],[69,105],[122,6],[6,168],[168,122],[123,147],[147,187],[187,123],[96,77],[77,90],[90,96],[65,55],[55,107],[107,65],[89,90],[90,180],[180,89],[101,100],[100,120],[120,101],[63,105],[105,104],[104,63],[93,137],[137,227],[227,93],[15,86],[86,85],[85,15],[129,102],[102,49],[49,129],[14,87],[87,86],[86,14],[55,8],[8,9],[9,55],[100,47],[47,121],[121,100],[145,23],[23,22],[22,145],[88,89],[89,179],[179,88],[6,122],[122,196],[196,6],[88,95],[95,96],[96,88],[138,172],[172,136],[136,138],[215,58],[58,172],[172,215],[115,48],[48,219],[219,115],[42,80],[80,81],[81,42],[195,3],[3,51],[51,195],[43,146],[146,61],[61,43],[171,175],[175,199],[199,171],[81,82],[82,38],[38,81],[53,46],[46,225],[225,53],[144,163],[163,110],[110,144],[52,65],[65,66],[66,52],[229,228],[228,117],[117,229],[34,127],[127,234],[234,34],[107,108],[108,69],[69,107],[109,108],[108,151],[151,109],[48,64],[64,235],[235,48],[62,78],[78,191],[191,62],[129,209],[209,126],[126,129],[111,35],[35,143],[143,111],[117,123],[123,50],[50,117],[222,65],[65,52],[52,222],[19,125],[125,141],[141,19],[221,55],[55,65],[65,221],[3,195],[195,197],[197,3],[25,7],[7,33],[33,25],[220,237],[237,44],[44,220],[70,71],[71,139],[139,70],[122,193],[193,245],[245,122],[247,130],[130,33],[33,247],[71,21],[21,162],[162,71],[170,169],[169,150],[150,170],[188,174],[174,196],[196,188],[216,186],[186,92],[92,216],[2,97],[97,167],[167,2],[141,125],[125,241],[241,141],[164,167],[167,37],[37,164],[72,38],[38,12],[12,72],[38,82],[82,13],[13,38],[63,68],[68,71],[71,63],[226,35],[35,111],[111,226],[101,50],[50,205],[205,101],[206,92],[92,165],[165,206],[209,198],[198,217],[217,209],[165,167],[167,97],[97,165],[220,115],[115,218],[218,220],[133,112],[112,243],[243,133],[239,238],[238,241],[241,239],[214,135],[135,169],[169,214],[190,173],[173,133],[133,190],[171,208],[208,32],[32,171],[125,44],[44,237],[237,125],[86,87],[87,178],[178,86],[85,86],[86,179],[179,85],[84,85],[85,180],[180,84],[83,84],[84,181],[181,83],[201,83],[83,182],[182,201],[137,93],[93,132],[132,137],[76,62],[62,183],[183,76],[61,76],[76,184],[184,61],[57,61],[61,185],[185,57],[212,57],[57,186],[186,212],[214,207],[207,187],[187,214],[34,143],[143,156],[156,34],[79,239],[239,237],[237,79],[123,137],[137,177],[177,123],[44,1],[1,4],[4,44],[201,194],[194,32],[32,201],[64,102],[102,129],[129,64],[213,215],[215,138],[138,213],[59,166],[166,219],[219,59],[242,99],[99,97],[97,242],[2,94],[94,141],[141,2],[75,59],[59,235],[235,75],[24,110],[110,228],[228,24],[25,130],[130,226],[226,25],[23,24],[24,229],[229,23],[22,23],[23,230],[230,22],[26,22],[22,231],[231,26],[112,26],[26,232],[232,112],[189,190],[190,243],[243,189],[221,56],[56,190],[190,221],[28,56],[56,221],[221,28],[27,28],[28,222],[222,27],[29,27],[27,223],[223,29],[30,29],[29,224],[224,30],[247,30],[30,225],[225,247],[238,79],[79,20],[20,238],[166,59],[59,75],[75,166],[60,75],[75,240],[240,60],[147,177],[177,215],[215,147],[20,79],[79,166],[166,20],[187,147],[147,213],[213,187],[112,233],[233,244],[244,112],[233,128],[128,245],[245,233],[128,114],[114,188],[188,128],[114,217],[217,174],[174,114],[131,115],[115,220],[220,131],[217,198],[198,236],[236,217],[198,131],[131,134],[134,198],[177,132],[132,58],[58,177],[143,35],[35,124],[124,143],[110,163],[163,7],[7,110],[228,110],[110,25],[25,228],[356,389],[389,368],[368,356],[11,302],[302,267],[267,11],[452,350],[350,349],[349,452],[302,303],[303,269],[269,302],[357,343],[343,277],[277,357],[452,453],[453,357],[357,452],[333,332],[332,297],[297,333],[175,152],[152,377],[377,175],[347,348],[348,330],[330,347],[303,304],[304,270],[270,303],[9,336],[336,337],[337,9],[278,279],[279,360],[360,278],[418,262],[262,431],[431,418],[304,408],[408,409],[409,304],[310,415],[415,407],[407,310],[270,409],[409,410],[410,270],[450,348],[348,347],[347,450],[422,430],[430,434],[434,422],[313,314],[314,17],[17,313],[306,307],[307,375],[375,306],[387,388],[388,260],[260,387],[286,414],[414,398],[398,286],[335,406],[406,418],[418,335],[364,367],[367,416],[416,364],[423,358],[358,327],[327,423],[251,284],[284,298],[298,251],[281,5],[5,4],[4,281],[373,374],[374,253],[253,373],[307,320],[320,321],[321,307],[425,427],[427,411],[411,425],[421,313],[313,18],[18,421],[321,405],[405,406],[406,321],[320,404],[404,405],[405,320],[315,16],[16,17],[17,315],[426,425],[425,266],[266,426],[377,400],[400,369],[369,377],[322,391],[391,269],[269,322],[417,465],[465,464],[464,417],[386,257],[257,258],[258,386],[466,260],[260,388],[388,466],[456,399],[399,419],[419,456],[284,332],[332,333],[333,284],[417,285],[285,8],[8,417],[346,340],[340,261],[261,346],[413,441],[441,285],[285,413],[327,460],[460,328],[328,327],[355,371],[371,329],[329,355],[392,439],[439,438],[438,392],[382,341],[341,256],[256,382],[429,420],[420,360],[360,429],[364,394],[394,379],[379,364],[277,343],[343,437],[437,277],[443,444],[444,283],[283,443],[275,440],[440,363],[363,275],[431,262],[262,369],[369,431],[297,338],[338,337],[337,297],[273,375],[375,321],[321,273],[450,451],[451,349],[349,450],[446,342],[342,467],[467,446],[293,334],[334,282],[282,293],[458,461],[461,462],[462,458],[276,353],[353,383],[383,276],[308,324],[324,325],[325,308],[276,300],[300,293],[293,276],[372,345],[345,447],[447,372],[352,345],[345,340],[340,352],[274,1],[1,19],[19,274],[456,248],[248,281],[281,456],[436,427],[427,425],[425,436],[381,256],[256,252],[252,381],[269,391],[391,393],[393,269],[200,199],[199,428],[428,200],[266,330],[330,329],[329,266],[287,273],[273,422],[422,287],[250,462],[462,328],[328,250],[258,286],[286,384],[384,258],[265,353],[353,342],[342,265],[387,259],[259,257],[257,387],[424,431],[431,430],[430,424],[342,353],[353,276],[276,342],[273,335],[335,424],[424,273],[292,325],[325,307],[307,292],[366,447],[447,345],[345,366],[271,303],[303,302],[302,271],[423,266],[266,371],[371,423],[294,455],[455,460],[460,294],[279,278],[278,294],[294,279],[271,272],[272,304],[304,271],[432,434],[434,427],[427,432],[272,407],[407,408],[408,272],[394,430],[430,431],[431,394],[395,369],[369,400],[400,395],[334,333],[333,299],[299,334],[351,417],[417,168],[168,351],[352,280],[280,411],[411,352],[325,319],[319,320],[320,325],[295,296],[296,336],[336,295],[319,403],[403,404],[404,319],[330,348],[348,349],[349,330],[293,298],[298,333],[333,293],[323,454],[454,447],[447,323],[15,16],[16,315],[315,15],[358,429],[429,279],[279,358],[14,15],[15,316],[316,14],[285,336],[336,9],[9,285],[329,349],[349,350],[350,329],[374,380],[380,252],[252,374],[318,402],[402,403],[403,318],[6,197],[197,419],[419,6],[318,319],[319,325],[325,318],[367,364],[364,365],[365,367],[435,367],[367,397],[397,435],[344,438],[438,439],[439,344],[272,271],[271,311],[311,272],[195,5],[5,281],[281,195],[273,287],[287,291],[291,273],[396,428],[428,199],[199,396],[311,271],[271,268],[268,311],[283,444],[444,445],[445,283],[373,254],[254,339],[339,373],[282,334],[334,296],[296,282],[449,347],[347,346],[346,449],[264,447],[447,454],[454,264],[336,296],[296,299],[299,336],[338,10],[10,151],[151,338],[278,439],[439,455],[455,278],[292,407],[407,415],[415,292],[358,371],[371,355],[355,358],[340,345],[345,372],[372,340],[346,347],[347,280],[280,346],[442,443],[443,282],[282,442],[19,94],[94,370],[370,19],[441,442],[442,295],[295,441],[248,419],[419,197],[197,248],[263,255],[255,359],[359,263],[440,275],[275,274],[274,440],[300,383],[383,368],[368,300],[351,412],[412,465],[465,351],[263,467],[467,466],[466,263],[301,368],[368,389],[389,301],[395,378],[378,379],[379,395],[412,351],[351,419],[419,412],[436,426],[426,322],[322,436],[2,164],[164,393],[393,2],[370,462],[462,461],[461,370],[164,0],[0,267],[267,164],[302,11],[11,12],[12,302],[268,12],[12,13],[13,268],[293,300],[300,301],[301,293],[446,261],[261,340],[340,446],[330,266],[266,425],[425,330],[426,423],[423,391],[391,426],[429,355],[355,437],[437,429],[391,327],[327,326],[326,391],[440,457],[457,438],[438,440],[341,382],[382,362],[362,341],[459,457],[457,461],[461,459],[434,430],[430,394],[394,434],[414,463],[463,362],[362,414],[396,369],[369,262],[262,396],[354,461],[461,457],[457,354],[316,403],[403,402],[402,316],[315,404],[404,403],[403,315],[314,405],[405,404],[404,314],[313,406],[406,405],[405,313],[421,418],[418,406],[406,421],[366,401],[401,361],[361,366],[306,408],[408,407],[407,306],[291,409],[409,408],[408,291],[287,410],[410,409],[409,287],[432,436],[436,410],[410,432],[434,416],[416,411],[411,434],[264,368],[368,383],[383,264],[309,438],[438,457],[457,309],[352,376],[376,401],[401,352],[274,275],[275,4],[4,274],[421,428],[428,262],[262,421],[294,327],[327,358],[358,294],[433,416],[416,367],[367,433],[289,455],[455,439],[439,289],[462,370],[370,326],[326,462],[2,326],[326,370],[370,2],[305,460],[460,455],[455,305],[254,449],[449,448],[448,254],[255,261],[261,446],[446,255],[253,450],[450,449],[449,253],[252,451],[451,450],[450,252],[256,452],[452,451],[451,256],[341,453],[453,452],[452,341],[413,464],[464,463],[463,413],[441,413],[413,414],[414,441],[258,442],[442,441],[441,258],[257,443],[443,442],[442,257],[259,444],[444,443],[443,259],[260,445],[445,444],[444,260],[467,342],[342,445],[445,467],[459,458],[458,250],[250,459],[289,392],[392,290],[290,289],[290,328],[328,460],[460,290],[376,433],[433,435],[435,376],[250,290],[290,392],[392,250],[411,416],[416,433],[433,411],[341,463],[463,464],[464,341],[453,464],[464,465],[465,453],[357,465],[465,412],[412,357],[343,412],[412,399],[399,343],[360,363],[363,440],[440,360],[437,399],[399,456],[456,437],[420,456],[456,363],[363,420],[401,435],[435,288],[288,401],[372,383],[383,353],[353,372],[339,255],[255,249],[249,339],[448,261],[261,255],[255,448],[133,243],[243,190],[190,133],[133,155],[155,112],[112,133],[33,246],[246,247],[247,33],[33,130],[130,25],[25,33],[398,384],[384,286],[286,398],[362,398],[398,414],[414,362],[362,463],[463,341],[341,362],[263,359],[359,467],[467,263],[263,249],[249,255],[255,263],[466,467],[467,260],[260,466],[75,60],[60,166],[166,75],[238,239],[239,79],[79,238],[162,127],[127,139],[139,162],[72,11],[11,37],[37,72],[121,232],[232,120],[120,121],[73,72],[72,39],[39,73],[114,128],[128,47],[47,114],[233,232],[232,128],[128,233],[103,104],[104,67],[67,103],[152,175],[175,148],[148,152],[119,118],[118,101],[101,119],[74,73],[73,40],[40,74],[107,9],[9,108],[108,107],[49,48],[48,131],[131,49],[32,194],[194,211],[211,32],[184,74],[74,185],[185,184],[191,80],[80,183],[183,191],[185,40],[40,186],[186,185],[119,230],[230,118],[118,119],[210,202],[202,214],[214,210],[84,83],[83,17],[17,84],[77,76],[76,146],[146,77],[161,160],[160,30],[30,161],[190,56],[56,173],[173,190],[182,106],[106,194],[194,182],[138,135],[135,192],[192,138],[129,203],[203,98],[98,129],[54,21],[21,68],[68,54],[5,51],[51,4],[4,5],[145,144],[144,23],[23,145],[90,77],[77,91],[91,90],[207,205],[205,187],[187,207],[83,201],[201,18],[18,83],[181,91],[91,182],[182,181],[180,90],[90,181],[181,180],[16,85],[85,17],[17,16],[205,206],[206,36],[36,205],[176,148],[148,140],[140,176],[165,92],[92,39],[39,165],[245,193],[193,244],[244,245],[27,159],[159,28],[28,27],[30,247],[247,161],[161,30],[174,236],[236,196],[196,174],[103,54],[54,104],[104,103],[55,193],[193,8],[8,55],[111,117],[117,31],[31,111],[221,189],[189,55],[55,221],[240,98],[98,99],[99,240],[142,126],[126,100],[100,142],[219,166],[166,218],[218,219],[112,155],[155,26],[26,112],[198,209],[209,131],[131,198],[169,135],[135,150],[150,169],[114,47],[47,217],[217,114],[224,223],[223,53],[53,224],[220,45],[45,134],[134,220],[32,211],[211,140],[140,32],[109,67],[67,108],[108,109],[146,43],[43,91],[91,146],[231,230],[230,120],[120,231],[113,226],[226,247],[247,113],[105,63],[63,52],[52,105],[241,238],[238,242],[242,241],[124,46],[46,156],[156,124],[95,78],[78,96],[96,95],[70,46],[46,63],[63,70],[116,143],[143,227],[227,116],[116,123],[123,111],[111,116],[1,44],[44,19],[19,1],[3,236],[236,51],[51,3],[207,216],[216,205],[205,207],[26,154],[154,22],[22,26],[165,39],[39,167],[167,165],[199,200],[200,208],[208,199],[101,36],[36,100],[100,101],[43,57],[57,202],[202,43],[242,20],[20,99],[99,242],[56,28],[28,157],[157,56],[124,35],[35,113],[113,124],[29,160],[160,27],[27,29],[211,204],[204,210],[210,211],[124,113],[113,46],[46,124],[106,43],[43,204],[204,106],[96,62],[62,77],[77,96],[227,137],[137,116],[116,227],[73,41],[41,72],[72,73],[36,203],[203,142],[142,36],[235,64],[64,240],[240,235],[48,49],[49,64],[64,48],[42,41],[41,74],[74,42],[214,212],[212,207],[207,214],[183,42],[42,184],[184,183],[210,169],[169,211],[211,210],[140,170],[170,176],[176,140],[104,105],[105,69],[69,104],[193,122],[122,168],[168,193],[50,123],[123,187],[187,50],[89,96],[96,90],[90,89],[66,65],[65,107],[107,66],[179,89],[89,180],[180,179],[119,101],[101,120],[120,119],[68,63],[63,104],[104,68],[234,93],[93,227],[227,234],[16,15],[15,85],[85,16],[209,129],[129,49],[49,209],[15,14],[14,86],[86,15],[107,55],[55,9],[9,107],[120,100],[100,121],[121,120],[153,145],[145,22],[22,153],[178,88],[88,179],[179,178],[197,6],[6,196],[196,197],[89,88],[88,96],[96,89],[135,138],[138,136],[136,135],[138,215],[215,172],[172,138],[218,115],[115,219],[219,218],[41,42],[42,81],[81,41],[5,195],[195,51],[51,5],[57,43],[43,61],[61,57],[208,171],[171,199],[199,208],[41,81],[81,38],[38,41],[224,53],[53,225],[225,224],[24,144],[144,110],[110,24],[105,52],[52,66],[66,105],[118,229],[229,117],[117,118],[227,34],[34,234],[234,227],[66,107],[107,69],[69,66],[10,109],[109,151],[151,10],[219,48],[48,235],[235,219],[183,62],[62,191],[191,183],[142,129],[129,126],[126,142],[116,111],[111,143],[143,116],[118,117],[117,50],[50,118],[223,222],[222,52],[52,223],[94,19],[19,141],[141,94],[222,221],[221,65],[65,222],[196,3],[3,197],[197,196],[45,220],[220,44],[44,45],[156,70],[70,139],[139,156],[188,122],[122,245],[245,188],[139,71],[71,162],[162,139],[149,170],[170,150],[150,149],[122,188],[188,196],[196,122],[206,216],[216,92],[92,206],[164,2],[2,167],[167,164],[242,141],[141,241],[241,242],[0,164],[164,37],[37,0],[11,72],[72,12],[12,11],[12,38],[38,13],[13,12],[70,63],[63,71],[71,70],[31,226],[226,111],[111,31],[36,101],[101,205],[205,36],[203,206],[206,165],[165,203],[126,209],[209,217],[217,126],[98,165],[165,97],[97,98],[237,220],[220,218],[218,237],[237,239],[239,241],[241,237],[210,214],[214,169],[169,210],[140,171],[171,32],[32,140],[241,125],[125,237],[237,241],[179,86],[86,178],[178,179],[180,85],[85,179],[179,180],[181,84],[84,180],[180,181],[182,83],[83,181],[181,182],[194,201],[201,182],[182,194],[177,137],[137,132],[132,177],[184,76],[76,183],[183,184],[185,61],[61,184],[184,185],[186,57],[57,185],[185,186],[216,212],[212,186],[186,216],[192,214],[214,187],[187,192],[139,34],[34,156],[156,139],[218,79],[79,237],[237,218],[147,123],[123,177],[177,147],[45,44],[44,4],[4,45],[208,201],[201,32],[32,208],[98,64],[64,129],[129,98],[192,213],[213,138],[138,192],[235,59],[59,219],[219,235],[141,242],[242,97],[97,141],[97,2],[2,141],[141,97],[240,75],[75,235],[235,240],[229,24],[24,228],[228,229],[31,25],[25,226],[226,31],[230,23],[23,229],[229,230],[231,22],[22,230],[230,231],[232,26],[26,231],[231,232],[233,112],[112,232],[232,233],[244,189],[189,243],[243,244],[189,221],[221,190],[190,189],[222,28],[28,221],[221,222],[223,27],[27,222],[222,223],[224,29],[29,223],[223,224],[225,30],[30,224],[224,225],[113,247],[247,225],[225,113],[99,60],[60,240],[240,99],[213,147],[147,215],[215,213],[60,20],[20,166],[166,60],[192,187],[187,213],[213,192],[243,112],[112,244],[244,243],[244,233],[233,245],[245,244],[245,128],[128,188],[188,245],[188,114],[114,174],[174,188],[134,131],[131,220],[220,134],[174,217],[217,236],[236,174],[236,198],[198,134],[134,236],[215,177],[177,58],[58,215],[156,143],[143,124],[124,156],[25,110],[110,7],[7,25],[31,228],[228,25],[25,31],[264,356],[356,368],[368,264],[0,11],[11,267],[267,0],[451,452],[452,349],[349,451],[267,302],[302,269],[269,267],[350,357],[357,277],[277,350],[350,452],[452,357],[357,350],[299,333],[333,297],[297,299],[396,175],[175,377],[377,396],[280,347],[347,330],[330,280],[269,303],[303,270],[270,269],[151,9],[9,337],[337,151],[344,278],[278,360],[360,344],[424,418],[418,431],[431,424],[270,304],[304,409],[409,270],[272,310],[310,407],[407,272],[322,270],[270,410],[410,322],[449,450],[450,347],[347,449],[432,422],[422,434],[434,432],[18,313],[313,17],[17,18],[291,306],[306,375],[375,291],[259,387],[387,260],[260,259],[424,335],[335,418],[418,424],[434,364],[364,416],[416,434],[391,423],[423,327],[327,391],[301,251],[251,298],[298,301],[275,281],[281,4],[4,275],[254,373],[373,253],[253,254],[375,307],[307,321],[321,375],[280,425],[425,411],[411,280],[200,421],[421,18],[18,200],[335,321],[321,406],[406,335],[321,320],[320,405],[405,321],[314,315],[315,17],[17,314],[423,426],[426,266],[266,423],[396,377],[377,369],[369,396],[270,322],[322,269],[269,270],[413,417],[417,464],[464,413],[385,386],[386,258],[258,385],[248,456],[456,419],[419,248],[298,284],[284,333],[333,298],[168,417],[417,8],[8,168],[448,346],[346,261],[261,448],[417,413],[413,285],[285,417],[326,327],[327,328],[328,326],[277,355],[355,329],[329,277],[309,392],[392,438],[438,309],[381,382],[382,256],[256,381],[279,429],[429,360],[360,279],[365,364],[364,379],[379,365],[355,277],[277,437],[437,355],[282,443],[443,283],[283,282],[281,275],[275,363],[363,281],[395,431],[431,369],[369,395],[299,297],[297,337],[337,299],[335,273],[273,321],[321,335],[348,450],[450,349],[349,348],[359,446],[446,467],[467,359],[283,293],[293,282],[282,283],[250,458],[458,462],[462,250],[300,276],[276,383],[383,300],[292,308],[308,325],[325,292],[283,276],[276,293],[293,283],[264,372],[372,447],[447,264],[346,352],[352,340],[340,346],[354,274],[274,19],[19,354],[363,456],[456,281],[281,363],[426,436],[436,425],[425,426],[380,381],[381,252],[252,380],[267,269],[269,393],[393,267],[421,200],[200,428],[428,421],[371,266],[266,329],[329,371],[432,287],[287,422],[422,432],[290,250],[250,328],[328,290],[385,258],[258,384],[384,385],[446,265],[265,342],[342,446],[386,387],[387,257],[257,386],[422,424],[424,430],[430,422],[445,342],[342,276],[276,445],[422,273],[273,424],[424,422],[306,292],[292,307],[307,306],[352,366],[366,345],[345,352],[268,271],[271,302],[302,268],[358,423],[423,371],[371,358],[327,294],[294,460],[460,327],[331,279],[279,294],[294,331],[303,271],[271,304],[304,303],[436,432],[432,427],[427,436],[304,272],[272,408],[408,304],[395,394],[394,431],[431,395],[378,395],[395,400],[400,378],[296,334],[334,299],[299,296],[6,351],[351,168],[168,6],[376,352],[352,411],[411,376],[307,325],[325,320],[320,307],[285,295],[295,336],[336,285],[320,319],[319,404],[404,320],[329,330],[330,349],[349,329],[334,293],[293,333],[333,334],[366,323],[323,447],[447,366],[316,15],[15,315],[315,316],[331,358],[358,279],[279,331],[317,14],[14,316],[316,317],[8,285],[285,9],[9,8],[277,329],[329,350],[350,277],[253,374],[374,252],[252,253],[319,318],[318,403],[403,319],[351,6],[6,419],[419,351],[324,318],[318,325],[325,324],[397,367],[367,365],[365,397],[288,435],[435,397],[397,288],[278,344],[344,439],[439,278],[310,272],[272,311],[311,310],[248,195],[195,281],[281,248],[375,273],[273,291],[291,375],[175,396],[396,199],[199,175],[312,311],[311,268],[268,312],[276,283],[283,445],[445,276],[390,373],[373,339],[339,390],[295,282],[282,296],[296,295],[448,449],[449,346],[346,448],[356,264],[264,454],[454,356],[337,336],[336,299],[299,337],[337,338],[338,151],[151,337],[294,278],[278,455],[455,294],[308,292],[292,415],[415,308],[429,358],[358,355],[355,429],[265,340],[340,372],[372,265],[352,346],[346,280],[280,352],[295,442],[442,282],[282,295],[354,19],[19,370],[370,354],[285,441],[441,295],[295,285],[195,248],[248,197],[197,195],[457,440],[440,274],[274,457],[301,300],[300,368],[368,301],[417,351],[351,465],[465,417],[251,301],[301,389],[389,251],[394,395],[395,379],[379,394],[399,412],[412,419],[419,399],[410,436],[436,322],[322,410],[326,2],[2,393],[393,326],[354,370],[370,461],[461,354],[393,164],[164,267],[267,393],[268,302],[302,12],[12,268],[312,268],[268,13],[13,312],[298,293],[293,301],[301,298],[265,446],[446,340],[340,265],[280,330],[330,425],[425,280],[322,426],[426,391],[391,322],[420,429],[429,437],[437,420],[393,391],[391,326],[326,393],[344,440],[440,438],[438,344],[458,459],[459,461],[461,458],[364,434],[434,394],[394,364],[428,396],[396,262],[262,428],[274,354],[354,457],[457,274],[317,316],[316,402],[402,317],[316,315],[315,403],[403,316],[315,314],[314,404],[404,315],[314,313],[313,405],[405,314],[313,421],[421,406],[406,313],[323,366],[366,361],[361,323],[292,306],[306,407],[407,292],[306,291],[291,408],[408,306],[291,287],[287,409],[409,291],[287,432],[432,410],[410,287],[427,434],[434,411],[411,427],[372,264],[264,383],[383,372],[459,309],[309,457],[457,459],[366,352],[352,401],[401,366],[1,274],[274,4],[4,1],[418,421],[421,262],[262,418],[331,294],[294,358],[358,331],[435,433],[433,367],[367,435],[392,289],[289,439],[439,392],[328,462],[462,326],[326,328],[94,2],[2,370],[370,94],[289,305],[305,455],[455,289],[339,254],[254,448],[448,339],[359,255],[255,446],[446,359],[254,253],[253,449],[449,254],[253,252],[252,450],[450,253],[252,256],[256,451],[451,252],[256,341],[341,452],[452,256],[414,413],[413,463],[463,414],[286,441],[441,414],[414,286],[286,258],[258,441],[441,286],[258,257],[257,442],[442,258],[257,259],[259,443],[443,257],[259,260],[260,444],[444,259],[260,467],[467,445],[445,260],[309,459],[459,250],[250,309],[305,289],[289,290],[290,305],[305,290],[290,460],[460,305],[401,376],[376,435],[435,401],[309,250],[250,392],[392,309],[376,411],[411,433],[433,376],[453,341],[341,464],[464,453],[357,453],[453,465],[465,357],[343,357],[357,412],[412,343],[437,343],[343,399],[399,437],[344,360],[360,440],[440,344],[420,437],[437,456],[456,420],[360,420],[420,363],[363,360],[361,401],[401,288],[288,361],[265,372],[372,353],[353,265],[390,339],[339,249],[249,390],[339,448],[448,255],[255,339]]),E("matrixDataToMatrix",(function(e){for(var t=e.getCols(),n=e.getRows(),s=e.getPackedDataList(),r=[],a=0;a{e.exports=function e(t,n,s){function r(i,o){if(!n[i]){if(!t[i]){if(a)return a(i,!0);var l=new Error("Cannot find module '"+i+"'");throw l.code="MODULE_NOT_FOUND",l}var u=n[i]={exports:{}};t[i][0].call(u.exports,(function(e){var n=t[i][1][e];return r(n||e)}),u,u.exports,e,t,n,s)}return n[i].exports}for(var a=void 0,i=0;i=43)}})).catch((function(){return!1}))}function A(e){return"boolean"==typeof m?u.resolve(m):x(e).then((function(e){return m=e}))}function k(e){var t=g[e.name],n={};n.promise=new u((function(e,t){n.resolve=e,n.reject=t})),t.deferredOperations.push(n),t.dbReady?t.dbReady=t.dbReady.then((function(){return n.promise})):t.dbReady=n.promise}function C(e){var t=g[e.name].deferredOperations.pop();if(t)return t.resolve(),t.promise}function S(e,t){var n=g[e.name].deferredOperations.pop();if(n)return n.reject(t),n.promise}function E(e,t){return new u((function(n,s){if(g[e.name]=g[e.name]||B(),e.db){if(!t)return n(e.db);k(e),e.db.close()}var r=[e.name];t&&r.push(e.version);var a=i.open.apply(i,r);t&&(a.onupgradeneeded=function(t){var n=a.result;try{n.createObjectStore(e.storeName),t.oldVersion<=1&&n.createObjectStore(f)}catch(e){if("ConstraintError"!==e.name)throw e}}),a.onerror=function(e){e.preventDefault(),s(a.error)},a.onsuccess=function(){var t=a.result;t.onversionchange=function(e){e.target.close()},n(t),C(e)}}))}function _(e){return E(e,!1)}function I(e){return E(e,!0)}function T(e,t){if(!e.db)return!0;var n=!e.db.objectStoreNames.contains(e.storeName),s=e.versione.db.version;if(s&&(e.version,e.version=e.db.version),r||n){if(n){var a=e.db.version+1;a>e.version&&(e.version=a)}return!0}return!1}function N(e){return new u((function(t,n){var s=new FileReader;s.onerror=n,s.onloadend=function(n){var s=btoa(n.target.result||"");t({__local_forage_encoded_blob:!0,data:s,type:e.type})},s.readAsBinaryString(e)}))}function O(e){return l([v(atob(e.data))],{type:e.type})}function R(e){return e&&e.__local_forage_encoded_blob}function D(e){var t=this,n=t._initReady().then((function(){var e=g[t._dbInfo.name];if(e&&e.dbReady)return e.dbReady}));return h(n,e,e),n}function M(e){k(e);for(var t=g[e.name],n=t.forages,s=0;s0&&(!e.db||"InvalidStateError"===r.name||"NotFoundError"===r.name))return u.resolve().then((function(){if(!e.db||"NotFoundError"===r.name&&!e.db.objectStoreNames.contains(e.storeName)&&e.version<=e.db.version)return e.db&&(e.version=e.db.version+1),I(e)})).then((function(){return M(e).then((function(){F(e,t,n,s-1)}))})).catch(n);n(r)}}function B(){return{forages:[],db:null,dbReady:null,deferredOperations:[]}}function z(e){var t=this,n={db:null};if(e)for(var s in e)n[s]=e[s];var r=g[n.name];r||(r=B(),g[n.name]=r),r.forages.push(t),t._initReady||(t._initReady=t.ready,t.ready=D);var a=[];function i(){return u.resolve()}for(var o=0;o>4,c[l++]=(15&s)<<4|r>>2,c[l++]=(3&r)<<6|63&a;return u}function fe(e){var t,n=new Uint8Array(e),s="";for(t=0;t>2],s+=X[(3&n[t])<<4|n[t+1]>>4],s+=X[(15&n[t+1])<<2|n[t+2]>>6],s+=X[63&n[t+2]];return n.length%3==2?s=s.substring(0,s.length-1)+"=":n.length%3==1&&(s=s.substring(0,s.length-2)+"=="),s}function me(e,t){var n="";if(e&&(n=de.call(e)),e&&("[object ArrayBuffer]"===n||e.buffer&&"[object ArrayBuffer]"===de.call(e.buffer))){var s,r=Q;e instanceof ArrayBuffer?(s=e,r+=ee):(s=e.buffer,"[object Int8Array]"===n?r+=ne:"[object Uint8Array]"===n?r+=se:"[object Uint8ClampedArray]"===n?r+=re:"[object Int16Array]"===n?r+=ae:"[object Uint16Array]"===n?r+=oe:"[object Int32Array]"===n?r+=ie:"[object Uint32Array]"===n?r+=le:"[object Float32Array]"===n?r+=ue:"[object Float64Array]"===n?r+=ce:t(new Error("Failed to get type for BinaryArray"))),t(r+fe(s))}else if("[object Blob]"===n){var a=new FileReader;a.onload=function(){var n=Z+e.type+"~"+fe(this.result);t(Q+te+n)},a.readAsArrayBuffer(e)}else try{t(JSON.stringify(e))}catch(e){t(null,e)}}function ge(e){if(e.substring(0,J)!==Q)return JSON.parse(e);var t,n=e.substring(he),s=e.substring(J,he);if(s===te&&Y.test(n)){var r=n.match(Y);t=r[1],n=n.substring(r[0].length)}var a=pe(n);switch(s){case ee:return a;case te:return l([a],{type:t});case ne:return new Int8Array(a);case se:return new Uint8Array(a);case re:return new Uint8ClampedArray(a);case ae:return new Int16Array(a);case oe:return new Uint16Array(a);case ie:return new Int32Array(a);case le:return new Uint32Array(a);case ue:return new Float32Array(a);case ce:return new Float64Array(a);default:throw new Error("Unkown type: "+s)}}var ye={serialize:me,deserialize:ge,stringToBuffer:pe,bufferToString:fe};function be(e,t,n,s){e.executeSql("CREATE TABLE IF NOT EXISTS "+t.storeName+" (id INTEGER PRIMARY KEY, key unique, value)",[],n,s)}function we(e){var t=this,n={db:null};if(e)for(var s in e)n[s]="string"!=typeof e[s]?e[s].toString():e[s];var r=new u((function(e,s){try{n.db=openDatabase(n.name,String(n.version),n.description,n.size)}catch(e){return s(e)}n.db.transaction((function(r){be(r,n,(function(){t._dbInfo=n,e()}),(function(e,t){s(t)}))}),s)}));return n.serializer=ye,r}function ve(e,t,n,s,r,a){e.executeSql(n,s,r,(function(e,i){i.code===i.SYNTAX_ERR?e.executeSql("SELECT name FROM sqlite_master WHERE type='table' AND name = ?",[t.storeName],(function(e,o){o.rows.length?a(e,i):be(e,t,(function(){e.executeSql(n,s,r,a)}),a)}),a):a(e,i)}),a)}function xe(e,t){var n=this;e=d(e);var s=new u((function(t,s){n.ready().then((function(){var r=n._dbInfo;r.db.transaction((function(n){ve(n,r,"SELECT * FROM "+r.storeName+" WHERE key = ? LIMIT 1",[e],(function(e,n){var s=n.rows.length?n.rows.item(0).value:null;s&&(s=r.serializer.deserialize(s)),t(s)}),(function(e,t){s(t)}))}))})).catch(s)}));return c(s,t),s}function Ae(e,t){var n=this,s=new u((function(t,s){n.ready().then((function(){var r=n._dbInfo;r.db.transaction((function(n){ve(n,r,"SELECT * FROM "+r.storeName,[],(function(n,s){for(var a=s.rows,i=a.length,o=0;o0)return void a(ke.apply(r,[e,o,n,s-1]));i(t)}}))}))})).catch(i)}));return c(a,n),a}function Ce(e,t,n){return ke.apply(this,[e,t,n,1])}function Se(e,t){var n=this;e=d(e);var s=new u((function(t,s){n.ready().then((function(){var r=n._dbInfo;r.db.transaction((function(n){ve(n,r,"DELETE FROM "+r.storeName+" WHERE key = ?",[e],(function(){t()}),(function(e,t){s(t)}))}))})).catch(s)}));return c(s,t),s}function Ee(e){var t=this,n=new u((function(e,n){t.ready().then((function(){var s=t._dbInfo;s.db.transaction((function(t){ve(t,s,"DELETE FROM "+s.storeName,[],(function(){e()}),(function(e,t){n(t)}))}))})).catch(n)}));return c(n,e),n}function _e(e){var t=this,n=new u((function(e,n){t.ready().then((function(){var s=t._dbInfo;s.db.transaction((function(t){ve(t,s,"SELECT COUNT(key) as c FROM "+s.storeName,[],(function(t,n){var s=n.rows.item(0).c;e(s)}),(function(e,t){n(t)}))}))})).catch(n)}));return c(n,e),n}function Ie(e,t){var n=this,s=new u((function(t,s){n.ready().then((function(){var r=n._dbInfo;r.db.transaction((function(n){ve(n,r,"SELECT key FROM "+r.storeName+" WHERE id = ? LIMIT 1",[e+1],(function(e,n){var s=n.rows.length?n.rows.item(0).key:null;t(s)}),(function(e,t){s(t)}))}))})).catch(s)}));return c(s,t),s}function Te(e){var t=this,n=new u((function(e,n){t.ready().then((function(){var s=t._dbInfo;s.db.transaction((function(t){ve(t,s,"SELECT key FROM "+s.storeName,[],(function(t,n){for(var s=[],r=0;r '__WebKitDatabaseInfoTable__'",[],(function(n,s){for(var r=[],a=0;a0}function ze(e){var t=this,n={};if(e)for(var s in e)n[s]=e[s];return n.keyPrefix=Me(e,t._defaultConfig),Be()?(t._dbInfo=n,n.serializer=ye,u.resolve()):u.reject()}function Le(e){var t=this,n=t.ready().then((function(){for(var e=t._dbInfo.keyPrefix,n=localStorage.length-1;n>=0;n--){var s=localStorage.key(n);0===s.indexOf(e)&&localStorage.removeItem(s)}}));return c(n,e),n}function Pe(e,t){var n=this;e=d(e);var s=n.ready().then((function(){var t=n._dbInfo,s=localStorage.getItem(t.keyPrefix+e);return s&&(s=t.serializer.deserialize(s)),s}));return c(s,t),s}function Ve(e,t){var n=this,s=n.ready().then((function(){for(var t=n._dbInfo,s=t.keyPrefix,r=s.length,a=localStorage.length,i=1,o=0;o=0;t--){var n=localStorage.key(t);0===n.indexOf(e)&&localStorage.removeItem(n)}})):u.reject("Invalid arguments"),c(s,t),s}var $e={_driver:"localStorageWrapper",_initStorage:ze,_support:De(),iterate:Ve,getItem:Pe,setItem:je,removeItem:qe,clear:Le,length:Ge,key:We,keys:Ue,dropInstance:He},Ke=function(e,t){return e===t||"number"==typeof e&&"number"==typeof t&&isNaN(e)&&isNaN(t)},Xe=function(e,t){for(var n=e.length,s=0;s{e.exports=n;var t=null;try{t=new WebAssembly.Instance(new WebAssembly.Module(new Uint8Array([0,97,115,109,1,0,0,0,1,13,2,96,0,1,127,96,4,127,127,127,127,1,127,3,7,6,0,1,1,1,1,1,6,6,1,127,1,65,0,11,7,50,6,3,109,117,108,0,1,5,100,105,118,95,115,0,2,5,100,105,118,95,117,0,3,5,114,101,109,95,115,0,4,5,114,101,109,95,117,0,5,8,103,101,116,95,104,105,103,104,0,0,10,191,1,6,4,0,35,0,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,126,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,127,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,128,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,129,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,130,34,4,66,32,135,167,36,0,32,4,167,11])),{}).exports}catch(e){}function n(e,t,n){this.low=0|e,this.high=0|t,this.unsigned=!!n}function s(e){return!0===(e&&e.__isLong__)}n.prototype.__isLong__,Object.defineProperty(n.prototype,"__isLong__",{value:!0}),n.isLong=s;var r={},a={};function i(e,t){var n,s,i;return t?(i=0<=(e>>>=0)&&e<256)&&(s=a[e])?s:(n=l(e,(0|e)<0?-1:0,!0),i&&(a[e]=n),n):(i=-128<=(e|=0)&&e<128)&&(s=r[e])?s:(n=l(e,e<0?-1:0,!1),i&&(r[e]=n),n)}function o(e,t){if(isNaN(e))return t?y:g;if(t){if(e<0)return y;if(e>=p)return A}else{if(e<=-f)return k;if(e+1>=f)return x}return e<0?o(-e,t).neg():l(e%d|0,e/d|0,t)}function l(e,t,s){return new n(e,t,s)}n.fromInt=i,n.fromNumber=o,n.fromBits=l;var u=Math.pow;function c(e,t,n){if(0===e.length)throw Error("empty string");if("NaN"===e||"Infinity"===e||"+Infinity"===e||"-Infinity"===e)return g;if("number"==typeof t?(n=t,t=!1):t=!!t,(n=n||10)<2||360)throw Error("interior hyphen");if(0===s)return c(e.substring(1),t,n).neg();for(var r=o(u(n,8)),a=g,i=0;i>>0:this.low},C.toNumber=function(){return this.unsigned?(this.high>>>0)*d+(this.low>>>0):this.high*d+(this.low>>>0)},C.toString=function(e){if((e=e||10)<2||36>>0).toString(e);if((a=l).isZero())return c+i;for(;c.length<6;)c="0"+c;i=""+c+i}},C.getHighBits=function(){return this.high},C.getHighBitsUnsigned=function(){return this.high>>>0},C.getLowBits=function(){return this.low},C.getLowBitsUnsigned=function(){return this.low>>>0},C.getNumBitsAbs=function(){if(this.isNegative())return this.eq(k)?64:this.neg().getNumBitsAbs();for(var e=0!=this.high?this.high:this.low,t=31;t>0&&!(e&1<=0},C.isOdd=function(){return!(1&~this.low)},C.isEven=function(){return!(1&this.low)},C.equals=function(e){return s(e)||(e=h(e)),(this.unsigned===e.unsigned||this.high>>>31!=1||e.high>>>31!=1)&&(this.high===e.high&&this.low===e.low)},C.eq=C.equals,C.notEquals=function(e){return!this.eq(e)},C.neq=C.notEquals,C.ne=C.notEquals,C.lessThan=function(e){return this.comp(e)<0},C.lt=C.lessThan,C.lessThanOrEqual=function(e){return this.comp(e)<=0},C.lte=C.lessThanOrEqual,C.le=C.lessThanOrEqual,C.greaterThan=function(e){return this.comp(e)>0},C.gt=C.greaterThan,C.greaterThanOrEqual=function(e){return this.comp(e)>=0},C.gte=C.greaterThanOrEqual,C.ge=C.greaterThanOrEqual,C.compare=function(e){if(s(e)||(e=h(e)),this.eq(e))return 0;var t=this.isNegative(),n=e.isNegative();return t&&!n?-1:!t&&n?1:this.unsigned?e.high>>>0>this.high>>>0||e.high===this.high&&e.low>>>0>this.low>>>0?-1:1:this.sub(e).isNegative()?-1:1},C.comp=C.compare,C.negate=function(){return!this.unsigned&&this.eq(k)?k:this.not().add(b)},C.neg=C.negate,C.add=function(e){s(e)||(e=h(e));var t=this.high>>>16,n=65535&this.high,r=this.low>>>16,a=65535&this.low,i=e.high>>>16,o=65535&e.high,u=e.low>>>16,c=0,d=0,p=0,f=0;return p+=(f+=a+(65535&e.low))>>>16,d+=(p+=r+u)>>>16,c+=(d+=n+o)>>>16,c+=t+i,l((p&=65535)<<16|(f&=65535),(c&=65535)<<16|(d&=65535),this.unsigned)},C.subtract=function(e){return s(e)||(e=h(e)),this.add(e.neg())},C.sub=C.subtract,C.multiply=function(e){if(this.isZero())return g;if(s(e)||(e=h(e)),t)return l(t.mul(this.low,this.high,e.low,e.high),t.get_high(),this.unsigned);if(e.isZero())return g;if(this.eq(k))return e.isOdd()?k:g;if(e.eq(k))return this.isOdd()?k:g;if(this.isNegative())return e.isNegative()?this.neg().mul(e.neg()):this.neg().mul(e).neg();if(e.isNegative())return this.mul(e.neg()).neg();if(this.lt(m)&&e.lt(m))return o(this.toNumber()*e.toNumber(),this.unsigned);var n=this.high>>>16,r=65535&this.high,a=this.low>>>16,i=65535&this.low,u=e.high>>>16,c=65535&e.high,d=e.low>>>16,p=65535&e.low,f=0,y=0,b=0,w=0;return b+=(w+=i*p)>>>16,y+=(b+=a*p)>>>16,b&=65535,y+=(b+=i*d)>>>16,f+=(y+=r*p)>>>16,y&=65535,f+=(y+=a*d)>>>16,y&=65535,f+=(y+=i*c)>>>16,f+=n*p+r*d+a*c+i*u,l((b&=65535)<<16|(w&=65535),(f&=65535)<<16|(y&=65535),this.unsigned)},C.mul=C.multiply,C.divide=function(e){if(s(e)||(e=h(e)),e.isZero())throw Error("division by zero");var n,r,a;if(t)return this.unsigned||-2147483648!==this.high||-1!==e.low||-1!==e.high?l((this.unsigned?t.div_u:t.div_s)(this.low,this.high,e.low,e.high),t.get_high(),this.unsigned):this;if(this.isZero())return this.unsigned?y:g;if(this.unsigned){if(e.unsigned||(e=e.toUnsigned()),e.gt(this))return y;if(e.gt(this.shru(1)))return w;a=y}else{if(this.eq(k))return e.eq(b)||e.eq(v)?k:e.eq(k)?b:(n=this.shr(1).div(e).shl(1)).eq(g)?e.isNegative()?b:v:(r=this.sub(e.mul(n)),a=n.add(r.div(e)));if(e.eq(k))return this.unsigned?y:g;if(this.isNegative())return e.isNegative()?this.neg().div(e.neg()):this.neg().div(e).neg();if(e.isNegative())return this.div(e.neg()).neg();a=g}for(r=this;r.gte(e);){n=Math.max(1,Math.floor(r.toNumber()/e.toNumber()));for(var i=Math.ceil(Math.log(n)/Math.LN2),c=i<=48?1:u(2,i-48),d=o(n),p=d.mul(e);p.isNegative()||p.gt(r);)p=(d=o(n-=c,this.unsigned)).mul(e);d.isZero()&&(d=b),a=a.add(d),r=r.sub(p)}return a},C.div=C.divide,C.modulo=function(e){return s(e)||(e=h(e)),t?l((this.unsigned?t.rem_u:t.rem_s)(this.low,this.high,e.low,e.high),t.get_high(),this.unsigned):this.sub(this.div(e).mul(e))},C.mod=C.modulo,C.rem=C.modulo,C.not=function(){return l(~this.low,~this.high,this.unsigned)},C.and=function(e){return s(e)||(e=h(e)),l(this.low&e.low,this.high&e.high,this.unsigned)},C.or=function(e){return s(e)||(e=h(e)),l(this.low|e.low,this.high|e.high,this.unsigned)},C.xor=function(e){return s(e)||(e=h(e)),l(this.low^e.low,this.high^e.high,this.unsigned)},C.shiftLeft=function(e){return s(e)&&(e=e.toInt()),0==(e&=63)?this:e<32?l(this.low<>>32-e,this.unsigned):l(0,this.low<>>e|this.high<<32-e,this.high>>e,this.unsigned):l(this.high>>e-32,this.high>=0?0:-1,this.unsigned)},C.shr=C.shiftRight,C.shiftRightUnsigned=function(e){if(s(e)&&(e=e.toInt()),0===(e&=63))return this;var t=this.high;return e<32?l(this.low>>>e|t<<32-e,t>>>e,this.unsigned):l(32===e?t:t>>>e-32,0,this.unsigned)},C.shru=C.shiftRightUnsigned,C.shr_u=C.shiftRightUnsigned,C.toSigned=function(){return this.unsigned?l(this.low,this.high,!1):this},C.toUnsigned=function(){return this.unsigned?this:l(this.low,this.high,!0)},C.toBytes=function(e){return e?this.toBytesLE():this.toBytesBE()},C.toBytesLE=function(){var e=this.high,t=this.low;return[255&t,t>>>8&255,t>>>16&255,t>>>24,255&e,e>>>8&255,e>>>16&255,e>>>24]},C.toBytesBE=function(){var e=this.high,t=this.low;return[e>>>24,e>>>16&255,e>>>8&255,255&e,t>>>24,t>>>16&255,t>>>8&255,255&t]},n.fromBytes=function(e,t,s){return s?n.fromBytesLE(e,t):n.fromBytesBE(e,t)},n.fromBytesLE=function(e,t){return new n(e[0]|e[1]<<8|e[2]<<16|e[3]<<24,e[4]|e[5]<<8|e[6]<<16|e[7]<<24,t)},n.fromBytesBE=function(e,t){return new n(e[4]<<24|e[5]<<16|e[6]<<8|e[7],e[0]<<24|e[1]<<16|e[2]<<8|e[3],t)}},9464:function(e,t){var n,s,r;s=[e],n=function(e){"use strict";function t(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var n=Object.assign||function(e){for(var t=1;tMath.abs(n[a][i])&&(i=o);for(var l=a;l=a;h--)n[h][c]-=n[h][a]*n[a][c]/n[a][a]}for(var d=s-1;d>=0;d--){for(var p=0,f=d+1;f=0;x--)v+=x>1?y[x]+"x^"+x+" + ":1===x?y[x]+"x + ":y[x];return{string:v,points:w,predict:b,equation:[].concat(s(y)).reverse(),r2:o(a(e,w),t.precision)}}};function u(){var e=function(e,s){return n({_round:o},e,t({},s,(function(e,t){return l[s](e,n({},r,t))})))};return Object.keys(l).reduce(e,{})}e.exports=u()},void 0===(r="function"==typeof n?n.apply(t,s):n)||(e.exports=r)},2183:(e,t,n)=>{var s=n(1812),r=n(6357),a=n(1119),i=n(147),o=n(6297),l=n(9181),u=n(7529);u.alea=s,u.xor128=r,u.xorwow=a,u.xorshift7=i,u.xor4096=o,u.tychei=l,e.exports=u},1812:function(e,t,n){var s;!function(e,r,a){function i(e){var t=this,n=function(){var e=4022871197,t=function(t){t=String(t);for(var n=0;n>>0,e=(s*=e)>>>0,e+=4294967296*(s-=e)}return 2.3283064365386963e-10*(e>>>0)};return t}();t.next=function(){var e=2091639*t.s0+2.3283064365386963e-10*t.c;return t.s0=t.s1,t.s1=t.s2,t.s2=e-(t.c=0|e)},t.c=1,t.s0=n(" "),t.s1=n(" "),t.s2=n(" "),t.s0-=n(e),t.s0<0&&(t.s0+=1),t.s1-=n(e),t.s1<0&&(t.s1+=1),t.s2-=n(e),t.s2<0&&(t.s2+=1),n=null}function o(e,t){return t.c=e.c,t.s0=e.s0,t.s1=e.s1,t.s2=e.s2,t}function l(e,t){var n=new i(e),s=t&&t.state,r=n.next;return r.int32=function(){return 4294967296*n.next()|0},r.double=function(){return r()+11102230246251565e-32*(2097152*r()|0)},r.quick=r,s&&("object"==typeof s&&o(s,n),r.state=function(){return o(n,{})}),r}r&&r.exports?r.exports=l:n.amdD&&n.amdO?void 0===(s=function(){return l}.call(t,n,t,r))||(r.exports=s):this.alea=l}(0,e=n.nmd(e),n.amdD)},9181:function(e,t,n){var s;!function(e,r,a){function i(e){var t=this,n="";t.next=function(){var e=t.b,n=t.c,s=t.d,r=t.a;return e=e<<25^e>>>7^n,n=n-s|0,s=s<<24^s>>>8^r,r=r-e|0,t.b=e=e<<20^e>>>12^n,t.c=n=n-s|0,t.d=s<<16^n>>>16^r,t.a=r-e|0},t.a=0,t.b=0,t.c=-1640531527,t.d=1367130551,e===Math.floor(e)?(t.a=e/4294967296|0,t.b=0|e):n+=e;for(var s=0;s>>0)/4294967296};return r.double=function(){do{var e=((n.next()>>>11)+(n.next()>>>0)/4294967296)/(1<<21)}while(0===e);return e},r.int32=n.next,r.quick=r,s&&("object"==typeof s&&o(s,n),r.state=function(){return o(n,{})}),r}r&&r.exports?r.exports=l:n.amdD&&n.amdO?void 0===(s=function(){return l}.call(t,n,t,r))||(r.exports=s):this.tychei=l}(0,e=n.nmd(e),n.amdD)},6357:function(e,t,n){var s;!function(e,r,a){function i(e){var t=this,n="";t.x=0,t.y=0,t.z=0,t.w=0,t.next=function(){var e=t.x^t.x<<11;return t.x=t.y,t.y=t.z,t.z=t.w,t.w^=t.w>>>19^e^e>>>8},e===(0|e)?t.x=e:n+=e;for(var s=0;s>>0)/4294967296};return r.double=function(){do{var e=((n.next()>>>11)+(n.next()>>>0)/4294967296)/(1<<21)}while(0===e);return e},r.int32=n.next,r.quick=r,s&&("object"==typeof s&&o(s,n),r.state=function(){return o(n,{})}),r}r&&r.exports?r.exports=l:n.amdD&&n.amdO?void 0===(s=function(){return l}.call(t,n,t,r))||(r.exports=s):this.xor128=l}(0,e=n.nmd(e),n.amdD)},6297:function(e,t,n){var s;!function(e,r,a){function i(e){var t=this;t.next=function(){var e,n,s=t.w,r=t.X,a=t.i;return t.w=s=s+1640531527|0,n=r[a+34&127],e=r[a=a+1&127],n^=n<<13,e^=e<<17,n^=n>>>15,e^=e>>>12,n=r[a]=n^e,t.i=a,n+(s^s>>>16)|0},function(e,t){var n,s,r,a,i,o=[],l=128;for(t===(0|t)?(s=t,t=null):(t+="\0",s=0,l=Math.max(l,t.length)),r=0,a=-32;a>>15,s^=s<<4,s^=s>>>13,a>=0&&(i=i+1640531527|0,r=0==(n=o[127&a]^=s+i)?r+1:0);for(r>=128&&(o[127&(t&&t.length||0)]=-1),r=127,a=512;a>0;--a)s=o[r+34&127],n=o[r=r+1&127],s^=s<<13,n^=n<<17,s^=s>>>15,n^=n>>>12,o[r]=s^n;e.w=i,e.X=o,e.i=r}(t,e)}function o(e,t){return t.i=e.i,t.w=e.w,t.X=e.X.slice(),t}function l(e,t){null==e&&(e=+new Date);var n=new i(e),s=t&&t.state,r=function(){return(n.next()>>>0)/4294967296};return r.double=function(){do{var e=((n.next()>>>11)+(n.next()>>>0)/4294967296)/(1<<21)}while(0===e);return e},r.int32=n.next,r.quick=r,s&&(s.X&&o(s,n),r.state=function(){return o(n,{})}),r}r&&r.exports?r.exports=l:n.amdD&&n.amdO?void 0===(s=function(){return l}.call(t,n,t,r))||(r.exports=s):this.xor4096=l}(0,e=n.nmd(e),n.amdD)},147:function(e,t,n){var s;!function(e,r,a){function i(e){var t=this;t.next=function(){var e,n,s=t.x,r=t.i;return e=s[r],n=(e^=e>>>7)^e<<24,n^=(e=s[r+1&7])^e>>>10,n^=(e=s[r+3&7])^e>>>3,n^=(e=s[r+4&7])^e<<7,e=s[r+7&7],n^=(e^=e<<13)^e<<9,s[r]=n,t.i=r+1&7,n},function(e,t){var n,s=[];if(t===(0|t))s[0]=t;else for(t=""+t,n=0;n0;--n)e.next()}(t,e)}function o(e,t){return t.x=e.x.slice(),t.i=e.i,t}function l(e,t){null==e&&(e=+new Date);var n=new i(e),s=t&&t.state,r=function(){return(n.next()>>>0)/4294967296};return r.double=function(){do{var e=((n.next()>>>11)+(n.next()>>>0)/4294967296)/(1<<21)}while(0===e);return e},r.int32=n.next,r.quick=r,s&&(s.x&&o(s,n),r.state=function(){return o(n,{})}),r}r&&r.exports?r.exports=l:n.amdD&&n.amdO?void 0===(s=function(){return l}.call(t,n,t,r))||(r.exports=s):this.xorshift7=l}(0,e=n.nmd(e),n.amdD)},1119:function(e,t,n){var s;!function(e,r,a){function i(e){var t=this,n="";t.next=function(){var e=t.x^t.x>>>2;return t.x=t.y,t.y=t.z,t.z=t.w,t.w=t.v,(t.d=t.d+362437|0)+(t.v=t.v^t.v<<4^e^e<<1)|0},t.x=0,t.y=0,t.z=0,t.w=0,t.v=0,e===(0|e)?t.x=e:n+=e;for(var s=0;s>>4),t.next()}function o(e,t){return t.x=e.x,t.y=e.y,t.z=e.z,t.w=e.w,t.v=e.v,t.d=e.d,t}function l(e,t){var n=new i(e),s=t&&t.state,r=function(){return(n.next()>>>0)/4294967296};return r.double=function(){do{var e=((n.next()>>>11)+(n.next()>>>0)/4294967296)/(1<<21)}while(0===e);return e},r.int32=n.next,r.quick=r,s&&("object"==typeof s&&o(s,n),r.state=function(){return o(n,{})}),r}r&&r.exports?r.exports=l:n.amdD&&n.amdO?void 0===(s=function(){return l}.call(t,n,t,r))||(r.exports=s):this.xorwow=l}(0,e=n.nmd(e),n.amdD)},7529:function(e,t,n){var s;!function(r,a,i){var o,l=256,u=i.pow(l,6),c=i.pow(2,52),h=2*c,d=l-1;function p(e,t,n){var s=[],d=y(g((t=1==t?{entropy:!0}:t||{}).entropy?[e,b(a)]:null==e?function(){try{var e;return o&&(e=o.randomBytes)?e=e(l):(e=new Uint8Array(l),(r.crypto||r.msCrypto).getRandomValues(e)),b(e)}catch(e){var t=r.navigator,n=t&&t.plugins;return[+new Date,r,n,r.screen,b(a)]}}():e,3),s),p=new f(s),w=function(){for(var e=p.g(6),t=u,n=0;e=h;)e/=2,t/=2,n>>>=1;return(e+n)/t};return w.int32=function(){return 0|p.g(4)},w.quick=function(){return p.g(4)/4294967296},w.double=w,y(b(p.S),a),(t.pass||n||function(e,t,n,s){return s&&(s.S&&m(s,p),e.state=function(){return m(p,{})}),n?(i.random=e,t):e})(w,d,"global"in t?t.global:this==i,t.state)}function f(e){var t,n=e.length,s=this,r=0,a=s.i=s.j=0,i=s.S=[];for(n||(e=[n++]);r{},9830:()=>{},3818:()=>{},6308:()=>{},7695:()=>{},170:()=>{}},__webpack_module_cache__={};function __webpack_require__(e){var t=__webpack_module_cache__[e];if(void 0!==t)return t.exports;var n=__webpack_module_cache__[e]={id:e,loaded:!1,exports:{}};return __webpack_modules__[e].call(n.exports,n,n.exports,__webpack_require__),n.loaded=!0,n.exports}__webpack_require__.amdD=function(){throw new Error("define cannot be used indirect")},__webpack_require__.amdO={},__webpack_require__.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return __webpack_require__.d(t,{a:t}),t},__webpack_require__.d=(e,t)=>{for(var n in t)__webpack_require__.o(t,n)&&!__webpack_require__.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},__webpack_require__.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),__webpack_require__.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),__webpack_require__.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},__webpack_require__.nmd=e=>(e.paths=[],e.children||(e.children=[]),e),__webpack_require__.nc=void 0;var __webpack_exports__={};return(()=>{"use strict";__webpack_require__.d(__webpack_exports__,{default:()=>_H});var e={};__webpack_require__.r(e),__webpack_require__.d(e,{CompositeArrayBuffer:()=>wo,browserFiles:()=>pu,browserHTTPRequest:()=>Au,concatenateArrayBuffers:()=>Lo,copyModel:()=>kl,decodeWeights:()=>To,decodeWeightsStream:()=>Mo,encodeWeights:()=>Io,fromMemory:()=>Eu,fromMemorySync:()=>_u,getLoadHandlers:()=>Xo,getModelArtifactsForJSON:()=>Uo,getModelArtifactsForJSONSync:()=>Wo,getModelArtifactsInfoForJSON:()=>Go,getSaveHandlers:()=>Ko,getWeightSpecs:()=>qo,http:()=>xu,isHTTPScheme:()=>wu,listModels:()=>xl,loadWeights:()=>gu,moveModel:()=>Cl,registerLoadRouter:()=>$o,registerSaveRouter:()=>Ho,removeModel:()=>Al,weightsLoaderFactory:()=>yu,withSaveHandler:()=>Iu,withSaveHandlerSync:()=>Tu});var t={};__webpack_require__.r(t),__webpack_require__.d(t,{assertParamsValid:()=>Pu,computeFlatOffset:()=>Qu,computeOutShape:()=>Wu,getNormalizedAxes:()=>ju,isSliceContinous:()=>Yu,maskToAxes:()=>Vu,parseSliceParams:()=>Ju,sliceInfo:()=>ec,startForAxis:()=>Xu,startIndicesWithElidedDims:()=>Hu,stopForAxis:()=>Zu,stopIndicesWithElidedDims:()=>$u,stridesForAxis:()=>Ku,stridesWithElidedDims:()=>Uu});var n={};__webpack_require__.r(n),__webpack_require__.d(n,{conv2d:()=>ff,depthwiseConv2d:()=>yf,matMul:()=>bf});var s={};__webpack_require__.r(s),__webpack_require__.d(s,{collectGatherOpShapeInfo:()=>Tg,computeOutShape:()=>Ig,segOpComputeOptimalWindowSize:()=>_g});var r={};__webpack_require__.r(r),__webpack_require__.d(r,{ERF_A1:()=>jm,ERF_A2:()=>Hm,ERF_A3:()=>$m,ERF_A4:()=>Km,ERF_A5:()=>Xm,ERF_P:()=>qm,PARALLELIZE_THRESHOLD:()=>Dm,RowPartitionType:()=>Im,SELU_SCALE:()=>Gm,SELU_SCALEALPHA:()=>Um,applyActivation:()=>df,assertAndGetBroadcastShape:()=>su,assertAxesAreInnerMostDims:()=>_h,assertParamsConsistent:()=>Em,assignToTypedArray:()=>tg,axesAreInnerMostDims:()=>kh,calculateShapes:()=>Wp,checkEinsumDimSizes:()=>cg,checkPadOnDimRoundingMode:()=>Ic,combineLocations:()=>Ch,combineRaggedTensorToTensorShapes:()=>Tm,complexWithEvenIndex:()=>Qm,complexWithOddIndex:()=>Jm,computeConv2DInfo:()=>yc,computeConv3DInfo:()=>bc,computeDefaultPad:()=>wc,computeDilation2DInfo:()=>fc,computeOptimalWindowSize:()=>Mm,computeOutAndReduceShapes:()=>Sh,computeOutShape:()=>_m,computePool2DInfo:()=>mc,computePool3DInfo:()=>gc,convertConv2DDataFormat:()=>_c,decodeEinsumEquation:()=>lg,eitherStridesOrDilationsAreOne:()=>Sc,expandShapeToKeepDim:()=>Eh,exponent:()=>sg,exponents:()=>ng,fromStringArrayToUint8:()=>Og,fromUint8ToStringArray:()=>Ng,getAxesPermutation:()=>Ih,getBroadcastDims:()=>tu,getComplexWithIndex:()=>eg,getEinsumComputePath:()=>hg,getEinsumPermutation:()=>ug,getFusedBiasGradient:()=>hf,getFusedDyActivation:()=>cf,getImageCenter:()=>Fm,getInnerMostAxes:()=>Nh,getPermuted:()=>zm,getRaggedRank:()=>Om,getReductionAxes:()=>nu,getReshaped:()=>Bm,getReshapedPermuted:()=>Lm,getRowPartitionTypesHelper:()=>Nm,getSliceBeginCoords:()=>Pm,getSliceSize:()=>Vm,getSparseFillEmptyRowsIndicesDenseShapeMismatch:()=>mg,getSparseFillEmptyRowsNegativeIndexErrorMessage:()=>gg,getSparseFillEmptyRowsOutOfRangeIndexErrorMessage:()=>yg,getSparseReshapeEmptyTensorZeroOutputDimErrorMessage:()=>vg,getSparseReshapeInputOutputMismatchErrorMessage:()=>Ag,getSparseReshapeInputOutputMultipleErrorMessage:()=>xg,getSparseReshapeMultipleNegativeOneOutputDimErrorMessage:()=>bg,getSparseReshapeNegativeOutputDimErrorMessage:()=>wg,getSparseSegmentReductionIndicesOutOfRangeErrorMessage:()=>Eg,getSparseSegmentReductionNegativeSegmentIdsErrorMessage:()=>kg,getSparseSegmentReductionNonIncreasingSegmentIdsErrorMessage:()=>Cg,getSparseSegmentReductionSegmentIdOutOfRangeErrorMessage:()=>Sg,getUndoAxesPermutation:()=>Th,isIdentityPermutation:()=>dg,log:()=>Ua,mergeRealAndImagArrays:()=>Zm,prepareAndValidate:()=>Wm,prepareSplitSize:()=>fg,segment_util:()=>s,shouldFuse:()=>pf,slice_util:()=>t,splitRealAndImagArrays:()=>Ym,stridesOrDilationsArePositive:()=>Ec,tupleValuesAreOne:()=>Cc,upcastType:()=>Gi,validateDefaultValueShape:()=>Rm,validateInput:()=>Vp,validateUpdateShape:()=>Pp,warn:()=>Wa});var a={};__webpack_require__.r(a),__webpack_require__.d(a,{json:()=>eC});var i={};__webpack_require__.r(i),__webpack_require__.d(i,{json:()=>tC});var o={};__webpack_require__.r(o),__webpack_require__.d(o,{json:()=>nC});var l={};__webpack_require__.r(l),__webpack_require__.d(l,{json:()=>sC});var u={};__webpack_require__.r(u),__webpack_require__.d(u,{json:()=>rC});var c={};__webpack_require__.r(c),__webpack_require__.d(c,{json:()=>aC});var h={};__webpack_require__.r(h),__webpack_require__.d(h,{json:()=>iC});var d={};__webpack_require__.r(d),__webpack_require__.d(d,{json:()=>oC});var p={};__webpack_require__.r(p),__webpack_require__.d(p,{json:()=>lC});var f={};__webpack_require__.r(f),__webpack_require__.d(f,{json:()=>uC});var m={};__webpack_require__.r(m),__webpack_require__.d(m,{json:()=>cC});var g={};__webpack_require__.r(g),__webpack_require__.d(g,{json:()=>hC});var y={};__webpack_require__.r(y),__webpack_require__.d(y,{json:()=>dC});var b={};__webpack_require__.r(b),__webpack_require__.d(b,{json:()=>pC});var w={};__webpack_require__.r(w),__webpack_require__.d(w,{json:()=>fC});var v={};__webpack_require__.r(v),__webpack_require__.d(v,{json:()=>mC});var x={};__webpack_require__.r(x),__webpack_require__.d(x,{json:()=>gC});var A={};__webpack_require__.r(A),__webpack_require__.d(A,{json:()=>yC});var k={};__webpack_require__.r(k),__webpack_require__.d(k,{json:()=>bC});var C={};__webpack_require__.r(C),__webpack_require__.d(C,{OP_SCOPE_SUFFIX:()=>po,abs:()=>eu,acos:()=>nc,acosh:()=>sc,add:()=>Dl,addN:()=>rc,all:()=>ac,any:()=>ic,argMax:()=>oc,argMin:()=>lc,asin:()=>uc,asinh:()=>cc,atan:()=>hc,atan2:()=>dc,atanh:()=>pc,avgPool:()=>Nc,avgPool3d:()=>Oc,basicLSTMCell:()=>zc,batchNorm:()=>Pc,batchNorm2d:()=>Vc,batchNorm3d:()=>Wc,batchNorm4d:()=>Uc,batchToSpaceND:()=>Lc,bincount:()=>Gc,bitwiseAnd:()=>qc,booleanMaskAsync:()=>Qp,broadcastArgs:()=>jc,broadcastTo:()=>Hc,buffer:()=>Tl,cast:()=>Nl,ceil:()=>$c,clipByValue:()=>Kc,clone:()=>Ol,complex:()=>mo,concat:()=>Rc,concat1d:()=>Xc,concat2d:()=>Zc,concat3d:()=>Yc,concat4d:()=>Qc,conv1d:()=>eh,conv2d:()=>Jc,conv2dTranspose:()=>nh,conv3d:()=>sh,conv3dTranspose:()=>ah,cos:()=>ih,cosh:()=>oh,cosineWindow:()=>of,cumprod:()=>lh,cumsum:()=>uh,denseBincount:()=>ch,depthToSpace:()=>hh,depthwiseConv2d:()=>dh,diag:()=>ph,dilation2d:()=>fh,div:()=>Fl,divNoNan:()=>yh,dot:()=>bh,dropout:()=>rf,einsum:()=>wh,elu:()=>vh,enclosingPowerOfTwo:()=>af,ensureShape:()=>xh,equal:()=>mh,erf:()=>Ah,euclideanNorm:()=>Bh,exp:()=>zh,expandDims:()=>Lh,expm1:()=>Ph,eye:()=>Wh,fft:()=>kp,fill:()=>Xl,floor:()=>Uh,floorDiv:()=>Ml,fused:()=>n,gather:()=>Gh,gatherND:()=>sf,greater:()=>qh,greaterEqual:()=>jh,ifft:()=>Cp,imag:()=>Hh,image:()=>bm,inTopKAsync:()=>lf,irfft:()=>Sp,isFinite:()=>$h,isInf:()=>Kh,isNaN:()=>Xh,leakyRelu:()=>Zh,less:()=>Yh,lessEqual:()=>Qh,linalg:()=>wm,linspace:()=>Jh,localResponseNormalization:()=>ed,log:()=>td,log1p:()=>nd,logSigmoid:()=>ad,logSoftmax:()=>id,logSumExp:()=>od,logicalAnd:()=>ld,logicalNot:()=>ud,logicalOr:()=>cd,logicalXor:()=>hd,losses:()=>vm,lowerBound:()=>fd,matMul:()=>Dc,max:()=>Oh,maxPool:()=>md,maxPool3d:()=>gd,maxPoolWithArgmax:()=>yd,maximum:()=>ru,mean:()=>bd,meshgrid:()=>xd,min:()=>Rh,minimum:()=>Ad,mirrorPad:()=>kd,mod:()=>Cd,moments:()=>Sd,movingAverage:()=>ef,mul:()=>Bl,multiRNNCell:()=>Ed,multinomial:()=>_d,neg:()=>sd,norm:()=>Fh,notEqual:()=>Id,oneHot:()=>Td,ones:()=>vd,onesLike:()=>Nd,op:()=>fo,outerProduct:()=>Od,pad:()=>Rd,pad1d:()=>Dd,pad2d:()=>Md,pad3d:()=>Fd,pad4d:()=>Bd,pool:()=>Ld,pow:()=>Yl,prelu:()=>Pd,print:()=>Rl,prod:()=>Vd,raggedGather:()=>Wd,raggedRange:()=>Ud,raggedTensorToTensor:()=>Gd,rand:()=>qd,randomGamma:()=>Xd,randomNormal:()=>Zd,randomStandardNormal:()=>Yd,randomUniform:()=>Qd,randomUniformInt:()=>Jd,range:()=>ep,real:()=>tp,reciprocal:()=>np,relu:()=>sp,relu6:()=>rp,reshape:()=>Tc,reverse:()=>ap,reverse1d:()=>ip,reverse2d:()=>op,reverse3d:()=>lp,reverse4d:()=>up,rfft:()=>_p,round:()=>cp,rsqrt:()=>hp,scalar:()=>Wl,scatterND:()=>tf,searchSorted:()=>pd,selu:()=>dp,separableConv2d:()=>pp,setdiff1dAsync:()=>fp,sigmoid:()=>Mc,sign:()=>mp,signal:()=>ym,sin:()=>gp,sinh:()=>yp,slice:()=>Fc,slice1d:()=>bp,slice2d:()=>wp,slice3d:()=>vp,slice4d:()=>xp,softmax:()=>Ap,softplus:()=>rd,spaceToBatchND:()=>zd,sparse:()=>xm,sparseToDense:()=>nf,spectral:()=>gm,split:()=>Ep,sqrt:()=>zl,square:()=>Ll,squaredDifference:()=>Ip,squeeze:()=>Tp,stack:()=>Np,step:()=>Op,stridedSlice:()=>Rp,string:()=>Am,sub:()=>Ql,sum:()=>Dh,tan:()=>Dp,tanh:()=>Bc,tensor:()=>yo,tensor1d:()=>Mp,tensor2d:()=>Fp,tensor3d:()=>Nu,tensor4d:()=>Bp,tensor5d:()=>zp,tensor6d:()=>Lp,tensorScatterUpdate:()=>Up,tile:()=>Vh,topk:()=>Gp,transpose:()=>Jp,truncatedNormal:()=>qp,unique:()=>jp,unsortedSegmentSum:()=>Hp,unstack:()=>$p,upperBound:()=>Kp,variable:()=>Xp,where:()=>gh,whereAsync:()=>Yp,zeros:()=>wd,zerosLike:()=>Pl});var S={};__webpack_require__.r(S),__webpack_require__.d(S,{addImpl:()=>wE,bincountImpl:()=>h_,bincountReduceImpl:()=>d_,bitwiseAndImpl:()=>f_,castImpl:()=>fE,ceilImpl:()=>b_,concatImpl:()=>C_,equalImpl:()=>lI,expImpl:()=>wI,expm1Impl:()=>CI,floorImpl:()=>WI,gatherNdImpl:()=>XI,gatherV2Impl:()=>YI,greaterEqualImpl:()=>nT,greaterImpl:()=>JI,lessEqualImpl:()=>mT,lessImpl:()=>dT,linSpaceImpl:()=>bT,logImpl:()=>vT,maxImpl:()=>FT,maximumImpl:()=>LT,minimumImpl:()=>KT,multiplyImpl:()=>eI,negImpl:()=>rN,notEqualImpl:()=>dN,prodImpl:()=>SN,raggedGatherImpl:()=>NN,raggedRangeImpl:()=>DN,raggedTensorToTensorImpl:()=>PN,rangeImpl:()=>WN,rsqrtImpl:()=>JN,scatterImpl:()=>nO,sigmoidImpl:()=>aE,simpleAbsImpl:()=>IE,sliceImpl:()=>o_,sparseFillEmptyRowsImpl:()=>AO,sparseReshapeImpl:()=>CO,sparseSegmentReductionImpl:()=>EO,sqrtImpl:()=>OO,staticRegexReplaceImpl:()=>LO,stridedSliceImpl:()=>GO,stringNGramsImpl:()=>HO,stringSplitImpl:()=>XO,stringToHashBucketFastImpl:()=>YO,subImpl:()=>NI,tileImpl:()=>sR,topKImpl:()=>oR,transposeImpl:()=>FE,uniqueImpl:()=>fR});var E=__webpack_require__(7999),_=__webpack_require__(9043);E.A.prototype._CONST=Object.freeze({N:{VIDEO_W:{DESKTOP:208,MOBILE:144},VIDEO_MARGIN:"10px",GAZE_CALIBRATION:{R:40,MARGIN:32,BORDER:8,CENTER_EXTRA_CHECK_OFFSET:2,MID_EXTRA_CHECK_OFFSET:6},PPI_DONT_USE:127.7,PD_DONT_USE:6.4,VIEW_DIST_DONT_USE:40},S:{AUTO:"AUTO",CLICK_TYPE:{MOUSE:"mouse",TOUCH:"touch"}},COLOR:{LIGHT_GREY:"#cccccc",ORANGE:"#ff9a00",DARK_RED:"#ac0d0d",RED:"#ee0000"},LTR:"LTR",RTL:"RTL",VIEW_METHOD:{B:"BlindSpot",F:"FaceMesh"},IN_TO_CM:2.54,UNITS:{CM:"cm",IN_D:"inDecimal",IN_F:"inFractional"}}),E.A.prototype._debuggerDefault=Object.freeze({date:new Date("July 20, 69 20:17:40 GMT+00:00"),timestamp:performance.now(),screenSize:{value:{screenWidthCm:28.6,screenHeightCm:17.9,screenPhysicalPpi:250,screenPpi:125,screenDiagonalCm:33.8,screenDiagonalIn:13.3}},measureDistance:{value:40,method:"BlindSpot"},trackDistance:{value:{viewingDistanceCm:40,PDCm:6.4,nearPointCm:{x:0,y:0},latencyMs:50},method:"FaceMesh"},trackGaze:{value:{x:screen.width/2,y:screen.height/2,latencyMs:50}},performance:{value:{computeArrayFillMHz:(0,_.Nh)(.5,3),computeRandomMHz:(0,_.Nh)(5,3),idealFps:60,stressFps:60}}});var I=__webpack_require__(115),T=__webpack_require__.n(I),N=__webpack_require__(3389),O=__webpack_require__.n(N),R=__webpack_require__(402),D=__webpack_require__.n(R),M=__webpack_require__(880),F=__webpack_require__.n(M),B=__webpack_require__(3282),z=__webpack_require__.n(B);const L=(e,t)=>{e.style.top=Math.round(t.querySelector(".calibration-instruction").getBoundingClientRect().bottom)+25+"px"},P=e=>{const t=e.value/e.max;e.style.background=`linear-gradient(90deg, #ffc772, #ffc772 ${100*t}%, #fff ${100*t}%)`};var V=__webpack_require__(9853),W=__webpack_require__(359),U=__webpack_require__(9677);E.A.prototype._displaySize=function(){if(!this.checkInitialized())return;const e={value:{displayWidthPx:screen.width,displayHeightPx:screen.height,windowWidthPx:window.innerWidth,windowHeightPx:window.innerHeight},timestamp:performance.now()};this.displayData.length&&T()(e.value,this.displayData[this.displayData.length-1].value)||(this.newDisplayData=e)};const G={card:O(),arrow:D(),usba:F(),usbc:z()},q={card:3.375,usba:.787402,usbc:.787402};E.A.prototype.screenSize=function(e={},t){this.checkInitialized()&&((0,_.$k)(),e=Object.assign({fullscreen:!1,repeatTesting:1,decimalPlace:1,defaultObject:"card",headline:"🖥️ "+U.H.RC_screenSizeTitle[this.L],description:U.H.RC_screenSizeIntro[this.L],check:!1,checkCallback:null},e),this.getFullscreen(e.fullscreen),["usba","usbc","card"].includes(e.defaultObject)||(e.defaultObject="card"),e.description+=`

      ${U.H.RC_screenSizeHave[this.L].replace("xxx",``)}`,this._addBackground(),this._addBackgroundText(e.headline,e.description),this._addCreditOnBackground(U.H.RC_screenSizeCredit[this.L]),function(e,t,n,s){const r=((e,t,n)=>{const s=document.createElement("input");return s.id="rc-size-slider",s.className="rc-slider",s.type="range",s.min=t,s.max=n,s.value=Math.max(Math.min(Math.round(100*Math.random()),80),20),s.step=.1,L(s,e),P(s),e.appendChild(s),s})(t,0,100),a=(t,n)=>{if("rc-slider"===t.target.className&&"rc-size-slider"===t.target.id&&(n===e._CONST.S.CLICK_TYPE.MOUSE&&1===t.which||n===e._CONST.S.CLICK_TYPE.TOUCH)){t.target.style.cursor="grabbing",c.setAttribute("fill",e._CONST.COLOR.ORANGE);const s=()=>{r.style.cursor="grab",c.setAttribute("fill",e._CONST.COLOR.LIGHT_GREY),document.removeEventListener("mouseup",s,!1)};n===e._CONST.S.CLICK_TYPE.MOUSE?document.addEventListener("mouseup",s,!1):n===e._CONST.S.CLICK_TYPE.TOUCH&&document.addEventListener("touchend",s,!1)}},i=e=>{a(e,"mouse")},o=e=>{a(e,"touch")};document.addEventListener("mousedown",i,!1),document.addEventListener("touchstart",o,!1);const l=$(["card","arrow","usba","usbc"],t);let u=n.defaultObject;document.getElementById("matching-obj").addEventListener("change",(e=>{K(e.target.value,l,d),u=e.target.value})),K("card",l);let c=document.getElementById("size-arrow-fill");c.setAttribute("fill",e._CONST.COLOR.LIGHT_GREY);let h={width:l.arrow.getBoundingClientRect().width,height:l.arrow.getBoundingClientRect().height};const d=()=>{j(e,r,l.card,l.arrow,h),H(r,l.usba),H(r,l.usbc)};d();const p=()=>{P(r),d()},f=new ResizeObserver((()=>{d(),L(r,t),Z(l,r)}));f.observe(t);const m=()=>{document.removeEventListener("mousedown",i,!1),document.removeEventListener("touchstart",o,!1),document.removeEventListener("input",p,!1),f.unobserve(t),e._removeBackground(),(0,V.l)(y)},g=()=>{let t=(l[u].getBoundingClientRect().width||parseInt(l[u].style.width))/q[u];const r=n.decimalPlace,a=X(t,r);e.newScreenData=a,m(),n.check?e._checkScreenSize(s,a,n.checkCallback):(0,_.nB)(s,a)};r.addEventListener("input",p,!1);const y=(0,V.m)({Escape:m,Enter:g," ":g});(0,W.F)(e.L,e.background,{go:g,cancel:m},e.params.showCancelButton),K(u,l,d)}(this,this.background,e,t))};const j=(e,t,n,s,r)=>{const a=(t.offsetWidth-30)*(t.value/100)*(window.innerWidth<480?2:1)+15;n.style.width=a+"px";let i=n.getBoundingClientRect();0!==i.width&&(s.style.left=i.left+a+"px",s.style.top=i.top+e.background.scrollTop+(.63*a-r.height)/2+"px")},H=(e,t)=>{t.style.width=(0,_.Ew)(Math.pow(e.value,1.5),0,1e3,50,400)+"px"},$=(e,t)=>{let n=document.getElementsByClassName("size-obj");for(;n.length;)n[0].parentNode.removeChild(n[0]);const s={};for(let n of e){let e=document.createElement("div");t.appendChild(e),e.outerHTML=G[n],e=document.getElementById("size-"+n),e.setAttribute("preserveAspectRatio","none"),e.style.visibility="hidden",s[n]=e}return Z(s,document.querySelector("#rc-size-slider")),s},K=(e,t,n)=>{for(let n in t)t[n].style.visibility=n===e?"visible":"hidden";t.arrow.style.visibility="hidden",(0,_.nB)(n)},X=(e,t)=>{const n={value:{screenWidthCm:(0,_.Nh)(2.54*window.screen.width/e,t),screenHeightCm:(0,_.Nh)(2.54*window.screen.height/e,t),screenPhysicalPpi:(0,_.Nh)(e*window.devicePixelRatio,t),screenPpi:(0,_.Nh)(e,t)},timestamp:performance.now()};return n.value.screenDiagonalCm=(0,_.Nh)(Math.hypot(n.value.screenWidthCm,n.value.screenHeightCm),t),n.value.screenDiagonalIn=(0,_.Nh)(n.value.screenDiagonalCm/2.54,t),n},Z=(e,t)=>{for(let n in e)e[n].style.top=t.getBoundingClientRect().top+50+"px"};var Y=__webpack_require__(8465),Q=__webpack_require__.n(Y);const J=32,ee=3,te=(e,t)=>"left"===e?.1*t:.9*t;function ne(e,t,n){e.fillStyle="#000",e.fillRect(t-(J>>1),n-(ee>>1),J,ee),e.fillRect(t-(ee>>1),n-(J>>1),ee,J)}const se=30;function re(e,t,n){return"left"===e?[t+(J+se)/2,n-(se>>1)]:[se>>1,t-(J+se)/2]}const ae=(e,{showIcon:t})=>({icon:t?"info":void 0,allowEscapeKey:!1,allowEnterKey:!1,allowOutsideClick:!1,showConfirmButton:!0,confirmButtonText:U.H.RC_ok[e.L],showClass:{popup:"fadeInUp",icon:""},hideClass:{popup:"fadeOutDown"},iconColor:e._CONST.COLOR.ORANGE,confirmButtonColor:"#aaa",customClass:{popup:"my__swal2__container",icon:"my__swal2__icon",title:"my__swal2__title",htmlContainer:`my__swal2__html rc-lang-${e.LD.toLowerCase()}`,confirmButton:"rc-button rc-go-button"}});let ie;"mocha"!==E._&&(ie=__webpack_require__(477).l);function oe(e,t,n=!1,s){const r=t.control;let a=e._CONST.N.PPI_DONT_USE;e.screenPpi&&(a=e.screenPpi.value);let i=!0,o=[],l=0;const u=document.createElement("div");u.innerHTML='',e.background.appendChild(u),e._constructFloatInstructionElement("blind-spot-instruction",U.H.RC_distanceTrackingCloseL[e.L]),e._addCreditOnBackground(U.H.RC_viewingBlindSpotCredit[e.L]);const c=document.querySelector("#blind-spot-canvas"),h=c.getContext("2d"),d=document.getElementById("blind-spot-instruction");let p="left";e._setFloatInstructionElementPos(p,16);let f,m=te(p,c.width);const g=()=>{c.style.width=(c.width=window.innerWidth)+"px",c.style.height=(c.height=window.innerHeight)+"px",m=te(p,c.width),f=re(p,m,c.width)},y=new ResizeObserver((()=>{g()}));y.observe(e.background),g();let b=f["left"===p?0:1],w=b,v=e._CONST.COLOR.DARK_RED,x="left"===p?1:-1;const A=(t=!0)=>{i=!1,r&&function(e,t){document.getElementById(e).removeEventListener("mousedown",t),document.getElementById(e).removeEventListener("touchstart",t)}("blind-spot-canvas",B),y.unobserve(e.background),e._removeBackground(),!e._trackingSetupFinishedStatus.distance&&t&&(e._trackingSetupFinishedStatus.distance=!0,e.gazeTracker.checkInitialized("distance",!1)&&e.endDistance()),(0,V.l)(D),(0,V.l)(M,"keyup")},k=async()=>{if("mocha"!==E._&&ie(),l+=1,o.push({dist:(0,_.Nh)(le(b,m,a),t.decimalPlace),v:x,closedEyeSide:p,crossX:m,circleX:b,ppi:a,timestamp:performance.now()}),2===Math.floor(l/t.repeatTesting))if(function(e){let t=[],n=[];for(let s of e)"left"===s.closedEyeSide?t.push(s.dist):n.push(s.dist);const s=(0,_.G8)(t),r=(0,_.G8)(n);return Math.abs(s-r)<.2*Math.min(s,r)}(o)){const r=e.newViewingDistanceData={value:(0,_.Nh)((0,_.JZ)(ue(o)),t.decimalPlace),timestamp:performance.now(),method:e._CONST.VIEW_METHOD.B,raw:{...o}};let a;n?(a="trackDistance",i=!1,y.unobserve(e.background),(0,V.l)(D),(0,V.l)(M,"keyup")):(a="measureDistance",A(!1)),t.check?await e._checkDistance(s,r,a,t.checkCallback):(0,_.nB)(s,r)}else{l=0;const t=o[0];R(t.v,t.closedEyeSide,t.crossX),o=[],Q().fire({...ae(e,{showIcon:!1}),icon:void 0,html:U.H.RC_viewingBlindSpotRejected[e.L],allowEnterKey:!0})}else l%t.repeatTesting==0?("left"===p?(p="right",d.innerHTML=U.H.RC_distanceTrackingCloseR[e.L]):(p="left",d.innerHTML=U.H.RC_distanceTrackingCloseL[e.L]),e._setFloatInstructionElementPos(p,16),R(1,p,te(p,c.width),!1,!0)):(x=-x,O(p,f))};let C=!1,S=null;const I=t=>{C||(T(),C=!0,v=e._CONST.COLOR.RED,S=setInterval((()=>{"ArrowLeft"===t.key?(b-=10,N()):"ArrowRight"===t.key&&(b+=10,N())}),30))},T=()=>{C=!1,v=e._CONST.COLOR.DARK_RED,S&&(clearInterval(S),S=null)},N=()=>{w=(0,_.AU)(b,...f),b=w},O=(e,t)=>{let n=t["left"===e?0:1],s=Math.abs(t[1]-t[0])/4,r=(0,_.Av)(n-s,n+s);(r-t[0])*(r-t[1])>0&&(r=2*n-r),b=r},R=(t,n,s,r=!0,a=!0)=>{x=t,p=n,m=s,f=re(p,m,c.width),r&&(d.innerHTML="left"===p?U.H.RC_distanceTrackingCloseL[e.L]:U.H.RC_distanceTrackingCloseR[e.L],e._setFloatInstructionElementPos(p,16)),a&&(b=f["left"===p?0:1],O(n,f))},D=(0,V.m)({Escape:t.showCancelButton?A:void 0,Enter:k," ":k,ArrowLeft:r?I:_.Md,ArrowRight:r?I:_.Md}),M=(0,V.m)({ArrowLeft:r?T:_.Md,ArrowRight:r?T:_.Md},"keyup");(0,W.F)(e.L,e.background,{go:k,cancel:t.showCancelButton?A:void 0,custom:{callback:()=>{Q().fire({...ae(e,{showIcon:!1}),icon:void 0,html:U.H.RC_viewingDistanceIntroLiMethod[e.L],allowEnterKey:!0})},content:U.H.RC_viewingDistanceIntroTitle[e.L]}},e.params.showCancelButton);const F={x:null,circleX:null},B=t=>{const n=!(!t.touches||!t.touches[0]);let s,r;if(n||t.preventDefault(),n?(s=t.touches[0].clientX,r=t.touches[0].clientY):(s=t.clientX,r=t.clientY),a=b,i=c.height/2,o=s,l=r,(0,_.ll)(a,i,o,l)>1){F.x=s,F.circleX=b;const r=document.getElementById("blind-spot-canvas");v=e._CONST.COLOR.RED,r.classList.replace("cursor-grab","cursor-grabbing");const a=e=>{let s;t.preventDefault(),e.preventDefault(),s=n?e.touches[0].clientX:e.clientX,b=F.circleX+s-F.x,b=(0,_.AU)(b,...re(p,m,c.width))};n?document.addEventListener("touchmove",a):document.addEventListener("mousemove",a);const i=()=>{n?(document.removeEventListener("touchend",i),document.removeEventListener("touchmove",a)):(document.removeEventListener("mouseup",i),document.removeEventListener("mousemove",a)),F.x=null,F.circleX=null,v=e._CONST.COLOR.DARK_RED,r.classList.replace("cursor-grabbing","cursor-grab")};n?document.addEventListener("touchend",i):document.addEventListener("mouseup",i)}var a,i,o,l};r&&function(e,t){document.getElementById(e).addEventListener("mousedown",t),document.getElementById(e).addEventListener("touchstart",t)}("blind-spot-canvas",B);const z=performance.now();let L=z;const P=()=>{h.clearRect(0,0,c.width,c.height),ne(h,m,c.height/2),L=performance.now(),function(e,t,n,s,r,a,i=!0){t.beginPath(),t.arc(n,s,se>>1,0,2*Math.PI),t.closePath(),t.fillStyle=i?r%125<63?a:"#fff":a,t.fill()}(0,h,b,c.height/2,Math.round(L-z),v,t.sparkle),r||(b+=5*x,N()),i?requestAnimationFrame(P):h.clearRect(0,0,c.width,c.height)};requestAnimationFrame(P)}function le(e,t,n){return Math.abs(t-e)/n/(s=15,Math.tan(s*Math.PI/180))/.3937;var s}function ue(e){const t=[];for(let n of e)t.push(n.dist);return t}function ce(e,t={framerate:60,break:!1}){let n=0,s=0,r=0;const a=1e3/t.framerate,i=()=>{t.break||requestAnimationFrame(i),n=performance.now(),r=n-s,r>a&&(s=n-r%a,e())};requestAnimationFrame(i)}E.A.prototype.measureDistance=function(e={},t){if(!this.checkInitialized())return;let n;(0,_.$k)(),n=(void 0!==e.control&&e.control,U.H.RC_viewingDistanceIntroLiMethod[this.L]),e=Object.assign({fullscreen:!1,repeatTesting:1,sparkle:!0,decimalPlace:1,control:!0,headline:"📏 "+U.H.RC_viewingDistanceTitle[this.L],description:n,check:!1,checkCallback:!1,showCancelButton:!0},e),this.getFullscreen(e.fullscreen),this._addBackground(),this._replaceBackground((0,_.$O)(e.headline,null,!0,"")),oe(this,e,!1,t)};var he=__webpack_require__(2646);const de=async e=>{if(navigator.permissions&&navigator.permissions.query)return navigator.permissions.query({name:"camera"}).then((async t=>{if("prompt"===t.state)return await Q().fire({...ae(e,{showIcon:!1}),icon:void 0,imageUrl:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAoAAAAFACAYAAAAszc0KAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAG9jSURBVHgB7b17sGTXVea5b95bVSpJpVfJjypkIzRYtizT3QgZcDvC2KYnosc2MDN0B9gYeoDBDmJiCAIb5q8Z7Oie+YMAzzAdMQwYHBOEZUFDu8e26I6gAZvpoQ3Y2DTYlmUbWS+XZFepJFWV6l2VnSuv1tXKdb+19j6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wPu18bfkzcev5yCzlHiLoxKtf+bzg8RGdB4yUWD9oUkvKA4volG5onJH+YvqXnQvoPvf59PHo2W05fDXL4sDvTjYZ2I0aQidU3Q+rbjOni2rWv+zPHj/rfW/Fnd079vt6HwRsqpMCEBUKXxF9g8z647isMfscRSHT7ev2Mbb7itoG4mIadJF++gBqA2E7+r0IrWWP/+wRXnyjRcSHVGjkzVY6EHv8+tX9o8ET8v5rzXySIzUxsqha+PTQ3H7svn8RefRxunzUhOSPkzkZvNRm7Hu/SE/Uf7QvZedM+uezbqO8prd33ocnfesbmTh/G+tbkTnEtWb3Vr//deWaufPp5PV76wuErIbqY4B9BUANYLZw8EKpRYiUdU3sodN5D86V+jBZ69DFLd/eHr/0RIVKJyPV/17d+t/GLzB1x62/tcfR3mwZcriREQWNhu/z7d3K0H+dDu7X/34u6zRRUIX5QGVN7IWeuGABvNH1zwSiD6+2jmyZfHxeL+RWPT3XnYu/fmO7s1MFEV5bL0eNi/o3vJptMTlBQ/K+26r//ZZWBO/vrwoX/bc+DKiOpw9gwlZZSYWgo5ufnRc3f1xtC34SR9+37rrm5649WUZmK5EjYgFuWf+0AO11lgNh+0iOsrnNGG8IK3lK0t72nyhdOZJLV+166VuQsv94c8j2o6OdT2HXfIVuflj09zH08SH/CuR/9bzM+860iVN1v+2vHiR2xIG7VP0kd3ONtOIf1iiY7aCZG+UUWXXSur9RA+L3YCeJ7vtHzyZP/uL4hbscXs+/TVB+/7h6fOR/UblVHy+kP+obD5MlD+0bcNEYe1xFKYlTh+3z3cU3t/rvhz+nPgXMOuvBGXNGuesHD496x+VC7m11P+W+KNri54j0XXyzxcft1qXUDrZOYryGF1vu43ywfq/ndb6Xzs/0b2J7qkoL4TsJv4z+hgOOCHGmwAAAAAASUVORK5CYII=",imageWidth:480,imageAlt:"Please allow camera access",html:U.H.RC_requestCamera[e.L]+"
      "+U.H.RC_privacyCamera[e.L]})})).catch((e=>{}))},pe={video:!1};E.A.prototype.trackDistance=async function(e={},t,n){if(!this.checkInitialized())return;let s;if((0,_.$k)(),s=(void 0!==e.control&&e.control,U.H.RC_viewingDistanceIntroLiMethod[this.L]),e=Object.assign({fullscreen:!1,repeatTesting:1,sparkle:!0,pipWidthPx:this._CONST.N.VIDEO_W[this.isMobile.value?"MOBILE":"DESKTOP"],showVideo:!0,showFaceOverlay:!1,decimalPlace:1,framerate:3,desiredDistanceCm:void 0,desiredDistanceTolerance:1.2,desiredDistanceMonitor:!1,desiredDistanceMonitorCancelable:!1,desiredDistanceMonitorAllowRecalibrate:!0,nearPoint:!0,showNearPoint:!1,control:!0,headline:"📏 "+U.H.RC_distanceTrackingTitle[this.L],description:U.H.RC_distanceTrackingIntroStart[this.L]+(0,he.G)(this.L)+s+(0,he.G)(this.L)+U.H.RC_distanceTrackingIntroEnd[this.L],check:!1,checkCallback:null,showCancelButton:!0},e),this.getFullscreen(e.fullscreen),this.gazeTracker.checkInitialized("distance"))return this.gazeTracker._toFixedN=e.decimalPlace,this.showNearPoint(e.showNearPoint),this.showVideo(e.showVideo),void this.showFaceOverlay(e.showFaceOverlay);this._addBackground(),this._constructFloatInstructionElement("gaze-system-instruction",U.H.RC_starting[this.L]),await de(this);const r=e=>{this.showVideo(pe.video),pe.video=!1,this.gazeTracker.checkInitialized("gaze",!1)&&this.showGazer(a),(0,_.nB)(t,e),ye.current=e},a=this.gazeTracker.webgazer.params.showGazeDot,i=async()=>{this._addBackground(),this._replaceBackground((0,_.$O)(e.headline,null,!0,"")),this.gazeTracker.checkInitialized("gaze",!1)&&this.showGazer(!1),oe(this,e,!0,r)};ge.pipWidthPx=e.pipWidthPx,ge.decimalPlace=e.decimalPlace,ge.framerate=e.framerate,ge.nearPoint=e.nearPoint,ge.showNearPoint=e.showNearPoint,ge.desiredDistanceCm=e.desiredDistanceCm,ge.desiredDistanceTolerance=e.desiredDistanceTolerance,ge.desiredDistanceMonitor=e.desiredDistanceMonitor,ge.desiredDistanceMonitorCancelable=e.desiredDistanceMonitorCancelable,ge.desiredDistanceMonitorAllowRecalibrate=e.desiredDistanceMonitorAllowRecalibrate,pe.video=e.showVideo,this.gazeTracker._init({toFixedN:1,showVideo:!0,showFaceOverlay:e.showFaceOverlay},"distance"),this._trackingSetupFinishedStatus.distance=!1;const o={options:e,callbackStatic:t,callbackTrack:n};e.nearPoint?fe(this,(()=>this._measurePD({},i)),n,o):fe(this,i,n,o)};const fe=async(e,t,n,s)=>{e.gazeTracker.beginVideo({pipWidthPx:ge.pipWidthPx},(()=>{e._removeFloatInstructionElement(),(0,_.nB)(t),Se(e,ge,n,s)}))},me=(e,t)=>Math.hypot(e.x-t.x,e.y-t.y,e.z-t.z),ge={pipWidthPx:0,decimalPlace:2,framerate:3,nearPoint:!0,showNearPoint:!1,desiredDistanceCm:void 0,desiredDistanceTolerance:1.2,desiredDistanceMonitor:!1,desiredDistanceMonitorCancelable:!1,desiredDistanceMonitorAllowRecalibrate:!0},ye={current:null};let be,we,ve={framerate:20,break:!0},xe=null,Ae=!1,ke=0,Ce=1;const Se=async(e,t,n,s)=>{const r=document.querySelector("#webgazerVideoCanvas");(0,_.yy)(1e3).then((async()=>{let a,i;ke=0,Ce=1;a=await e.gazeTracker.webgazer.getTracker().model;let o=e.screenPpi?e.screenPpi.value:e._CONST.N.PPI_DONT_USE;!e.screenPpi&&t.nearPoint,t.nearPoint&&t.showNearPoint&&(xe=document.createElement("div"),xe.id="rc-near-point-dot",document.body.appendChild(xe),Object.assign(xe.style,{display:"block",zIndex:999999,width:"10px",height:"10px",background:"green",position:"fixed",top:"-15px",left:"-15px"})),Ae=!1;const{desiredDistanceCm:l,desiredDistanceTolerance:u,desiredDistanceMonitor:c,desiredDistanceMonitorCancelable:h,desiredDistanceMonitorAllowRecalibrate:d}=t;e._distanceTrackNudging.distanceCorrectEnabled=!0,e._distanceTrackNudging.distanceDesired=l,e._distanceTrackNudging.distanceAllowedRatio=u,we=async()=>{const u=performance.now();if(i=await a.estimateFaces(r),i.length){e._trackingVideoFrameTimestamps.distance+=u;const a=i[0].keypoints;if(5===Ce){if(ke+=me(a[133],a[362]),ke/=5,e._trackingVideoFrameTimestamps.distance/=5,null!==ye.current){if(!be){const t=_e(o),n=Math.sqrt(Math.pow(ye.current.value,2)-Math.pow(t,2));ye.current.value=n,be=ke*ye.current.value,s.options.check||e._removeBackground(),e._trackingSetupFinishedStatus.distance=!0,Ae=!0}const i=performance.now(),u=Math.round(i-e._trackingVideoFrameTimestamps.distance),p=e.newViewingDistanceData={value:(0,_.Nh)(be/ke,t.decimalPlace),timestamp:i,method:e._CONST.VIEW_METHOD.F,latencyMs:u};let f;(Ae||c)&&(l&&e.nudgeDistance(h,d,s),Ae=!1),t.nearPoint&&(f=Ee(e,t,r,a,ke,i,o,u)),n&&"function"==typeof n&&(e.gazeTracker.defaultDistanceTrackCallback=n,n({value:{viewingDistanceCm:p.value,nearPointCm:f?f.value:[null,null],latencyMs:u},timestamp:i,method:e._CONST.VIEW_METHOD.F}))}ke=0,Ce=1,e._trackingVideoFrameTimestamps.distance=0}else ke+=me(a[133],a[362]),++Ce}},ve.break=!1,ve.framerate=5*t.framerate,ce(we,ve)}))},Ee=(e,t,n,s,r,a,i,o)=>{let l=((e,t,n)=>[(-t.x-n.x+e.videoWidth)/2,(-t.y-n.y+e.videoHeight)/2])(n,s[133],s[362]);l.forEach(((t,n)=>{l[n]=(e.PDCm?e.PDCm.value:e._CONST.N.PD_DONT_USE)*t/r}));let u=e.newNearPointData={value:{x:(0,_.Nh)(l[0],t.decimalPlace),y:(0,_.Nh)(l[1]+screen.height/2*2.54/i,t.decimalPlace),latencyMs:o},timestamp:a};if(t.showNearPoint){let e=u.value.x*i/2.54,t=u.value.y*i/2.54;Object.assign(xe.style,{left:screen.width/2-window.screenLeft+e-5+"px",top:screen.height/2-window.screenTop-(window.outerHeight-window.innerHeight)-t-5+"px"})}return u};E.A.prototype.pauseDistance=function(){return this.gazeTracker.checkInitialized("distance",!0)&&!this._trackingPaused.distance?(ve.break=!0,xe&&(xe.style.display="none"),this._trackingVideoFrameTimestamps.distance=0,this._trackingPaused.distance=!0,this.pauseNudger(),this):null},E.A.prototype.resumeDistance=function(){return this.gazeTracker.checkInitialized("distance",!0)&&this._trackingPaused.distance?(ve.break=!1,xe&&(xe.style.display="block"),ke=0,Ce=1,this._trackingVideoFrameTimestamps.distance=0,ce(we,ve),this._trackingPaused.distance=!1,this.resumeNudger(),this):null},E.A.prototype.endDistance=function(e=!1,t=!0){return this.gazeTracker.checkInitialized("distance",!0)?(ve.break=!0,ve.framerate=20,ge.pipWidthPx=0,ge.decimalPlace=2,ge.framerate=3,ge.nearPoint=!0,ge.showNearPoint=!1,ge.desiredDistanceCm=void 0,ge.desiredDistanceTolerance=1.2,ge.desiredDistanceMonitor=!1,ge.desiredDistanceMonitorCancelable=!1,ge.desiredDistanceMonitorAllowRecalibrate=!0,ye.current=null,be=null,we=null,Ae=!1,this._trackingVideoFrameTimestamps.distance=0,this._trackingPaused.distance=!1,xe&&(document.body.removeChild(xe),xe=null),this.endNudger(),t&&this.gazeTracker.end("distance",e),this):null},E.A.prototype.getDistanceNow=async function(e=null){if(!this.checkInitialized()||!this.gazeTracker.checkInitialized("distance",!0)||!ve.break)return;let t=e||this.gazeTracker.defaultDistanceTrackCallback,n=document.querySelector("#webgazerVideoFeed"),s=await this.gazeTracker.webgazer.getTracker().model;const r=performance.now();let a=await s.estimateFaces(n);if(a.length){const e=a[0].scaledMesh,s=me(e[133],e[362]);let i=performance.now();const o=i-r,l=this.newViewingDistanceData={value:(0,_.Nh)(be/s,ge.decimalPlace),timestamp:i,method:this._CONST.VIEW_METHOD.F,latencyMs:o};let u;return ge.nearPoint&&(u=Ee(this,ge,n,e,s,i,this.screenPpi?this.screenPpi.value:this._CONST.N.PPI_DONT_USE,o)),(0,_.nB)(t,{value:{viewingDistanceCm:l.value,nearPointCm:u?u.value:null,latencyMs:o},timestamp:i,method:this._CONST.VIEW_METHOD.F}),l}return null},E.A.prototype.showNearPoint=function(e=!0){if(this.gazeTracker.checkInitialized("distance",!1)){const t=document.querySelector("#rc-near-point-dot");t&&(t.display=e?"block":"none")}};const _e=e=>2.54*(window.screen.height/2/e);E.A.prototype.nudgeDistance=function(e=!1,t=!0,n){if(!this.checkInitialized())return;const{distanceDesired:s,distanceAllowedRatio:r}=this._distanceTrackNudging;if(s){if(this.viewingDistanceCm&&this.viewingDistanceCm.method===this._CONST.VIEW_METHOD.F){if(Ie(this.viewingDistanceCm.value,s,r))return!0;{const a=()=>{this._removeNudger(),clearInterval(this._distanceTrackNudging.distanceCorrecting),this._distanceTrackNudging.distanceCorrecting=null,(0,V.l)(o)},i=async()=>{this.endDistance(),this._addBackground(),await(0,_.yy)(2e3),this.trackDistance(n.options,n.callbackStatic,n.callbackTrack)},o=(0,V.m)(e?{Escape:this.endNudger}:{});if(null===this._distanceTrackNudging.distanceCorrecting&&this._distanceTrackNudging.distanceCorrectEnabled){const[n,l,u]=Te(this);let c=e?{cancel:()=>{this.endNudger()}}:{};t&&(c={...c,custom:{callback:i,content:U.H.RC_distanceTrackingRedo[this.L]}}),(e||t)&&(0,W.F)(this.L,this.nudger,c,this.params.showCancelButton);const h=()=>{n.innerHTML=Ne(this,this.viewingDistanceCm.value,s),l.innerHTML=Math.round(this.viewingDistanceCm.value),u.innerHTML=Math.round(s)};h(),this._distanceTrackNudging.distanceCorrecting=setInterval((()=>{h(),Ie(this.viewingDistanceCm.value,s,r)&&(a(),(0,V.l)(o))}),200)}else this._distanceTrackNudging.distanceCorrecting&&!this._distanceTrackNudging.distanceCorrectEnabled&&a();return!1}}return!1}};const Ie=(e,t,n)=>{if(!Oe(n))return!1;let s=t*n,r=t/n;return e<=Math.max(s,r)&&e>=Math.min(s,r)},Te=e=>(e._addNudger(`
      \n

      \n

      ${U.H.RC_distanceTrackingGuide[e.L].replace("xx1",'').replace("xx2",'')}

      \n
      \n `),[document.querySelector("#rc-distance-correct-instruction"),document.querySelector("#rc-distance-now"),document.querySelector("#rc-distance-desired")]),Ne=(e,t,n)=>t>=n?U.H.RC_distanceTrackingMoveCloser[e.L]:U.H.RC_distanceTrackingMoveFurther[e.L],Oe=e=>!isNaN(e)&&(e>0&&1!==e);E.A.prototype.setDistanceDesired=function(e,t=null){return this._distanceTrackNudging.distanceDesired=e,t&&Oe(t)&&(this._distanceTrackNudging.distanceAllowedRatio=t),e},E.A.prototype._addNudger=function(e){if(null!==this.nudger)return;let t=document.getElementById("calibration-nudger");return t||(t=document.createElement("div"),t.id="calibration-nudger",t.className=`calibration-nudger rc-lang-${this.LD.toLowerCase()}`,document.body.classList.add("lock-view"),document.body.appendChild(t),t.style.background=this.params.backgroundColor),e&&(t.innerHTML=e),this._nudger.element=t,this.nudger},E.A.prototype._removeNudger=function(){let e=document.getElementById("calibration-nudger");return!!e&&(document.body.classList.remove("lock-view"),document.body.removeChild(e),this._nudger={element:null},!0)},E.A.prototype.pauseNudger=function(){document.body.classList.add("hide-nudger")},E.A.prototype.resumeNudger=function(){document.body.classList.remove("hide-nudger")},E.A.prototype.endNudger=function(){return!!this._distanceTrackNudging.distanceCorrectEnabled&&(this._removeNudger(),this._distanceTrackNudging.distanceCorrectEnabled=!1,this._distanceTrackNudging.distanceCorrecting&&clearInterval(this._distanceTrackNudging.distanceCorrecting),this._distanceTrackNudging.distanceCorrecting=null,this._distanceTrackNudging.distanceDesired=null,this._distanceAllowedRatio=null,!0)};function Re(e,t,n,s,r){let a=setInterval((()=>{let i=document.getElementById("webgazerVideoContainer");i&&(clearInterval(a),i.style.height=t/parseInt(i.style.width)*parseInt(i.style.height)+"px",i.style.width=t+"px",i.style.opacity=n,s.setVideoViewerSize(parseInt(i.style.width),parseInt(i.style.height)),De(e,i),setTimeout((()=>{e.videoOpacity(),e.isMobile.value?i.style.transition="right 0.5s, top 0.5s, width 0.5s, height 0.5s, border-radius 0.5s":i.style.transition="left 0.5s, bottom 0.5s, width 0.5s, height 0.5s, border-radius 0.5s",(0,_.nB)(r)}),700))}),100)}function De(e,t){e.isMobile.value?(t.style.left="unset",t.style.right=e._CONST.N.VIDEO_MARGIN,t.style.top=e._CONST.N.VIDEO_MARGIN,t.style.bottom="unset"):(t.style.left=e._CONST.N.VIDEO_MARGIN,t.style.right="unset",t.style.top="unset",t.style.bottom=e._CONST.N.VIDEO_MARGIN)}const Me={video:!1,videoWidth:0,videoHeight:0,opacity:1,gaze:!1,faceOverlay:!1},Fe=.9;E.A.prototype._measurePD=async function(e={},t){if(!this.checkInitialized())return;(0,_.$k)(),e=Object.assign({fullscreen:!1,headline:"👁️ "+U.H.RC_nearPointTitle[this.L],description:U.H.RC_nearPointIntro[this.L],shortDescription:U.H.RC_nearPointIntro[this.L]},e),this.getFullscreen(e.fullscreen),await(0,_.yy)(1e3),this._replaceBackground(),this._replaceBackground((0,_.$O)(e.headline,e.shortDescription,!0));const n=this.screenPpi?this.screenPpi.value:this._CONST.N.PPI_DONT_USE;let[s,r]=Be(this),[a,i]=Pe(this,n,s,r);const o=this,l=(e=!0)=>{a.removeEventListener("mousedown",i),this._removeBackground(),this.showVideo(Me.video),this.showGazer(Me.gaze),this.showFaceOverlay(Me.faceOverlay),this.gazeTracker.webgazer.showFaceFeedbackBox(!0),Object.assign(document.querySelector("#webgazerVideoContainer").style,{height:Me.videoHeight,width:Me.videoWidth,opacity:Me.opacity,borderRadius:"5px"}),De(o,document.querySelector("#webgazerVideoContainer")),Object.assign(document.querySelector("#webgazerVideoFeed").style,{height:Me.videoHeight,width:Me.videoWidth,top:"unset",transform:"scale(-1, 1)",transformOrigin:"unset"}),Me.video=!1,Me.videoWidth=0,Me.videoHeight=0,Me.opacity=1,Me.gaze=!1,Me.faceOverlay=!1,!o._trackingSetupFinishedStatus.distance&&e&&(o._trackingSetupFinishedStatus.distance=!0,o.endDistance()),(0,V.l)(c)},u=()=>{if(-100!==Le){const e={value:2.54*Le/n,timestamp:performance.now()};return this.newPDData=e,l(!1),(0,_.nB)(t,e)}},c=(0,V.m)({Escape:l,Enter:u," ":u});(0,W.F)(this.L,this.background,{go:u,cancel:l},this.params.showCancelButton),setTim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/FIQwtCUeUJBodc4AJRC8q8plX9RHCMD1svJg0EIJUmcO2PqXzZue+rl16vKSoxn/39nE9KqgqMETAAAAABJRU5ErkJggg==",imageWidth:480,imageAlt:"Measurement Instruction",html:e.description})}),700)};const Be=e=>{let t=document.querySelector("#webgazerVideoFeed");if(t)return ze(e,t,document.querySelector("#webgazerVideoCanvas"),document.querySelector("#webgazerVideoContainer"))},ze=(e,t,n,s,r=null)=>{r||t.captureStream&&(r=t.captureStream());let a=.3*window.innerWidth/parseInt(t.style.width)*parseInt(t.style.height);Me.videoWidth=s.style.width,Me.videoHeight=s.style.height,Me.opacity=s.style.opacity;const i={height:Math.round(a)+"px",width:Math.round(window.innerWidth*Fe)+"px",opacity:1,borderRadius:"15px"};Object.assign(s.style,i),e.isMobile.value?Object.assign(s.style,{right:Math.round(.5*window.innerWidth*(1-Fe))+"px",top:Math.round(.5*(window.innerHeight-a))+"px"}):Object.assign(s.style,{left:Math.round(.5*window.innerWidth*(1-Fe))+"px",bottom:Math.round(.5*(window.innerHeight-a))+"px"});const o={height:Math.round(a*Fe/.3)+"px",width:Math.round(window.innerWidth*Fe)+"px",top:Math.round(.6000000000000001*-a)+"px",transform:"scale(-2, 2)",transformOrigin:"center"};return Object.assign(t.style,o),Me.video=e.gazeTracker.webgazer.params.showVideo,Me.gaze=e.gazeTracker.webgazer.params.showGazeDot,Me.faceOverlay=e.gazeTracker.webgazer.params.showFaceOverlay,Me.video||e.showVideo(!0),Me.gaze&&e.showGazer(!1),Me.faceOverlay&&e.showFaceOverlay(!1),e.gazeTracker.webgazer.showFaceFeedbackBox(!1),[window.innerWidth*Fe,a]};let Le=-100;const Pe=(e,t,n,s)=>{const r=document.createElement("div");r.id="rc-ruler",Object.assign(r.style,{height:.9*(window.innerHeight-s)/2+"px",width:2*window.innerWidth+"px",left:.25*(window.innerWidth-n)+"px",bottom:0,backgroundColor:"#FFD523dd",borderRadius:"7px 0 0 0",boxSizing:"border-box",borderBottom:"5px solid #bb6600"}),e.background.appendChild(r);const a=document.createElement("div");a.id="rc-ruler-scales",r.appendChild(a);const i=2.54*(r.clientWidth-60)/t;for(let n=0;n<=10*(0,_.Nh)(i,1);n++){let s=document.createElement("div"),r=.1*n*t/2.54+"px";if(s.className="rc-ruler-scale "+(n%10==0?"rc-ruler-major":n%5==0?"rc-ruler-secondary":"rc-ruler-minor"),s.style.left=r,a.appendChild(s),n%10==0){let t=document.createElement("p");t.className="rc-ruler-scale-text",t.style.left=r,t.innerHTML=n/10,a.appendChild(t),0===n&&(t.style.color=e._CONST.COLOR.DARK_RED)}}let o=document.createElement("div");a.appendChild(o),o.outerHTML=D(),o=document.querySelector("#size-arrow"),o.setAttribute("preserveAspectRatio","none"),o.style.left="-100px",o.style.top="40px",document.getElementById("size-arrow-fill").setAttribute("fill",e._CONST.COLOR.DARK_RED);const l=e=>{o.style.left=(Le=e.offsetX-30)+"px";const t=e=>{o.style.left=(Le=e.offsetX-30)+"px"};r.addEventListener("mousemove",t),r.addEventListener("mouseup",(function e(){r.removeEventListener("mousemove",t),r.removeEventListener("mouseup",e)}))};return r.addEventListener("mousedown",l),[r,l]};function Ve(e){return Ve="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Ve(e)}var We=/^\s+/,Ue=/\s+$/;function Ge(e,t){if(t=t||{},(e=e||"")instanceof Ge)return e;if(!(this instanceof Ge))return new Ge(e,t);var n=function(e){var t={r:0,g:0,b:0},n=1,s=null,r=null,a=null,i=!1,o=!1;"string"==typeof e&&(e=function(e){e=e.replace(We,"").replace(Ue,"").toLowerCase();var t,n=!1;if(it[e])e=it[e],n=!0;else if("transparent"==e)return{r:0,g:0,b:0,a:0,format:"name"};if(t=wt.rgb.exec(e))return{r:t[1],g:t[2],b:t[3]};if(t=wt.rgba.exec(e))return{r:t[1],g:t[2],b:t[3],a:t[4]};if(t=wt.hsl.exec(e))return{h:t[1],s:t[2],l:t[3]};if(t=wt.hsla.exec(e))return{h:t[1],s:t[2],l:t[3],a:t[4]};if(t=wt.hsv.exec(e))return{h:t[1],s:t[2],v:t[3]};if(t=wt.hsva.exec(e))return{h:t[1],s:t[2],v:t[3],a:t[4]};if(t=wt.hex8.exec(e))return{r:ht(t[1]),g:ht(t[2]),b:ht(t[3]),a:mt(t[4]),format:n?"name":"hex8"};if(t=wt.hex6.exec(e))return{r:ht(t[1]),g:ht(t[2]),b:ht(t[3]),format:n?"name":"hex"};if(t=wt.hex4.exec(e))return{r:ht(t[1]+""+t[1]),g:ht(t[2]+""+t[2]),b:ht(t[3]+""+t[3]),a:mt(t[4]+""+t[4]),format:n?"name":"hex8"};if(t=wt.hex3.exec(e))return{r:ht(t[1]+""+t[1]),g:ht(t[2]+""+t[2]),b:ht(t[3]+""+t[3]),format:n?"name":"hex"};return!1}(e));"object"==Ve(e)&&(vt(e.r)&&vt(e.g)&&vt(e.b)?(t=function(e,t,n){return{r:255*ut(e,255),g:255*ut(t,255),b:255*ut(n,255)}}(e.r,e.g,e.b),i=!0,o="%"===String(e.r).substr(-1)?"prgb":"rgb"):vt(e.h)&&vt(e.s)&&vt(e.v)?(s=pt(e.s),r=pt(e.v),t=function(e,t,n){e=6*ut(e,360),t=ut(t,100),n=ut(n,100);var s=Math.floor(e),r=e-s,a=n*(1-t),i=n*(1-r*t),o=n*(1-(1-r)*t),l=s%6,u=[n,i,a,a,o,n][l],c=[o,n,n,i,a,a][l],h=[a,a,o,n,n,i][l];return{r:255*u,g:255*c,b:255*h}}(e.h,s,r),i=!0,o="hsv"):vt(e.h)&&vt(e.s)&&vt(e.l)&&(s=pt(e.s),a=pt(e.l),t=function(e,t,n){var s,r,a;function i(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?e+6*(t-e)*n:n<.5?t:n<2/3?e+(t-e)*(2/3-n)*6:e}if(e=ut(e,360),t=ut(t,100),n=ut(n,100),0===t)s=r=a=n;else{var o=n<.5?n*(1+t):n+t-n*t,l=2*n-o;s=i(l,o,e+1/3),r=i(l,o,e),a=i(l,o,e-1/3)}return{r:255*s,g:255*r,b:255*a}}(e.h,s,a),i=!0,o="hsl"),e.hasOwnProperty("a")&&(n=e.a));return n=lt(n),{ok:i,format:e.format||o,r:Math.min(255,Math.max(t.r,0)),g:Math.min(255,Math.max(t.g,0)),b:Math.min(255,Math.max(t.b,0)),a:n}}(e);this._originalInput=e,this._r=n.r,this._g=n.g,this._b=n.b,this._a=n.a,this._roundA=Math.round(100*this._a)/100,this._format=t.format||n.format,this._gradientType=t.gradientType,this._r<1&&(this._r=Math.round(this._r)),this._g<1&&(this._g=Math.round(this._g)),this._b<1&&(this._b=Math.round(this._b)),this._ok=n.ok}function qe(e,t,n){e=ut(e,255),t=ut(t,255),n=ut(n,255);var s,r,a=Math.max(e,t,n),i=Math.min(e,t,n),o=(a+i)/2;if(a==i)s=r=0;else{var l=a-i;switch(r=o>.5?l/(2-a-i):l/(a+i),a){case e:s=(t-n)/l+(t>1)+720)%360;--t;)s.h=(s.h+r)%360,a.push(Ge(s));return a}function at(e,t){t=t||6;for(var n=Ge(e).toHsv(),s=n.h,r=n.s,a=n.v,i=[],o=1/t;t--;)i.push(Ge({h:s,s:r,v:a})),a=(a+o)%1;return i}Ge.prototype={isDark:function(){return this.getBrightness()<128},isLight:function(){return!this.isDark()},isValid:function(){return this._ok},getOriginalInput:function(){return this._originalInput},getFormat:function(){return this._format},getAlpha:function(){return this._a},getBrightness:function(){var e=this.toRgb();return(299*e.r+587*e.g+114*e.b)/1e3},getLuminance:function(){var e,t,n,s=this.toRgb();return e=s.r/255,t=s.g/255,n=s.b/255,.2126*(e<=.03928?e/12.92:Math.pow((e+.055)/1.055,2.4))+.7152*(t<=.03928?t/12.92:Math.pow((t+.055)/1.055,2.4))+.0722*(n<=.03928?n/12.92:Math.pow((n+.055)/1.055,2.4))},setAlpha:function(e){return this._a=lt(e),this._roundA=Math.round(100*this._a)/100,this},toHsv:function(){var e=je(this._r,this._g,this._b);return{h:360*e.h,s:e.s,v:e.v,a:this._a}},toHsvString:function(){var e=je(this._r,this._g,this._b),t=Math.round(360*e.h),n=Math.round(100*e.s),s=Math.round(100*e.v);return 1==this._a?"hsv("+t+", "+n+"%, "+s+"%)":"hsva("+t+", "+n+"%, "+s+"%, "+this._roundA+")"},toHsl:function(){var e=qe(this._r,this._g,this._b);return{h:360*e.h,s:e.s,l:e.l,a:this._a}},toHslString:function(){var e=qe(this._r,this._g,this._b),t=Math.round(360*e.h),n=Math.round(100*e.s),s=Math.round(100*e.l);return 1==this._a?"hsl("+t+", "+n+"%, "+s+"%)":"hsla("+t+", "+n+"%, "+s+"%, "+this._roundA+")"},toHex:function(e){return He(this._r,this._g,this._b,e)},toHexString:function(e){return"#"+this.toHex(e)},toHex8:function(e){return function(e,t,n,s,r){var a=[dt(Math.round(e).toString(16)),dt(Math.round(t).toString(16)),dt(Math.round(n).toString(16)),dt(ft(s))];if(r&&a[0].charAt(0)==a[0].charAt(1)&&a[1].charAt(0)==a[1].charAt(1)&&a[2].charAt(0)==a[2].charAt(1)&&a[3].charAt(0)==a[3].charAt(1))return a[0].charAt(0)+a[1].charAt(0)+a[2].charAt(0)+a[3].charAt(0);return a.join("")}(this._r,this._g,this._b,this._a,e)},toHex8String:function(e){return"#"+this.toHex8(e)},toRgb:function(){return{r:Math.round(this._r),g:Math.round(this._g),b:Math.round(this._b),a:this._a}},toRgbString:function(){return 1==this._a?"rgb("+Math.round(this._r)+", "+Math.round(this._g)+", "+Math.round(this._b)+")":"rgba("+Math.round(this._r)+", "+Math.round(this._g)+", "+Math.round(this._b)+", "+this._roundA+")"},toPercentageRgb:function(){return{r:Math.round(100*ut(this._r,255))+"%",g:Math.round(100*ut(this._g,255))+"%",b:Math.round(100*ut(this._b,255))+"%",a:this._a}},toPercentageRgbString:function(){return 1==this._a?"rgb("+Math.round(100*ut(this._r,255))+"%, "+Math.round(100*ut(this._g,255))+"%, "+Math.round(100*ut(this._b,255))+"%)":"rgba("+Math.round(100*ut(this._r,255))+"%, "+Math.round(100*ut(this._g,255))+"%, "+Math.round(100*ut(this._b,255))+"%, "+this._roundA+")"},toName:function(){return 0===this._a?"transparent":!(this._a<1)&&(ot[He(this._r,this._g,this._b,!0)]||!1)},toFilter:function(e){var t="#"+$e(this._r,this._g,this._b,this._a),n=t,s=this._gradientType?"GradientType = 1, ":"";if(e){var r=Ge(e);n="#"+$e(r._r,r._g,r._b,r._a)}return"progid:DXImageTransform.Microsoft.gradient("+s+"startColorstr="+t+",endColorstr="+n+")"},toString:function(e){var t=!!e;e=e||this._format;var n=!1,s=this._a<1&&this._a>=0;return t||!s||"hex"!==e&&"hex6"!==e&&"hex3"!==e&&"hex4"!==e&&"hex8"!==e&&"name"!==e?("rgb"===e&&(n=this.toRgbString()),"prgb"===e&&(n=this.toPercentageRgbString()),"hex"!==e&&"hex6"!==e||(n=this.toHexString()),"hex3"===e&&(n=this.toHexString(!0)),"hex4"===e&&(n=this.toHex8String(!0)),"hex8"===e&&(n=this.toHex8String()),"name"===e&&(n=this.toName()),"hsl"===e&&(n=this.toHslString()),"hsv"===e&&(n=this.toHsvString()),n||this.toHexString()):"name"===e&&0===this._a?this.toName():this.toRgbString()},clone:function(){return Ge(this.toString())},_applyModification:function(e,t){var n=e.apply(null,[this].concat([].slice.call(t)));return this._r=n._r,this._g=n._g,this._b=n._b,this.setAlpha(n._a),this},lighten:function(){return this._applyModification(Ye,arguments)},brighten:function(){return this._applyModification(Qe,arguments)},darken:function(){return this._applyModification(Je,arguments)},desaturate:function(){return this._applyModification(Ke,arguments)},saturate:function(){return this._applyModification(Xe,arguments)},greyscale:function(){return this._applyModification(Ze,arguments)},spin:function(){return this._applyModification(et,arguments)},_applyCombination:function(e,t){return e.apply(null,[this].concat([].slice.call(t)))},analogous:function(){return this._applyCombination(rt,arguments)},complement:function(){return this._applyCombination(tt,arguments)},monochromatic:function(){return this._applyCombination(at,arguments)},splitcomplement:function(){return this._applyCombination(st,arguments)},triad:function(){return this._applyCombination(nt,[3])},tetrad:function(){return this._applyCombination(nt,[4])}},Ge.fromRatio=function(e,t){if("object"==Ve(e)){var n={};for(var s in e)e.hasOwnProperty(s)&&(n[s]="a"===s?e[s]:pt(e[s]));e=n}return Ge(e,t)},Ge.equals=function(e,t){return!(!e||!t)&&Ge(e).toRgbString()==Ge(t).toRgbString()},Ge.random=function(){return Ge.fromRatio({r:Math.random(),g:Math.random(),b:Math.random()})},Ge.mix=function(e,t,n){n=0===n?0:n||50;var s=Ge(e).toRgb(),r=Ge(t).toRgb(),a=n/100;return Ge({r:(r.r-s.r)*a+s.r,g:(r.g-s.g)*a+s.g,b:(r.b-s.b)*a+s.b,a:(r.a-s.a)*a+s.a})},Ge.readability=function(e,t){var n=Ge(e),s=Ge(t);return(Math.max(n.getLuminance(),s.getLuminance())+.05)/(Math.min(n.getLuminance(),s.getLuminance())+.05)},Ge.isReadable=function(e,t,n){var s,r,a=Ge.readability(e,t);switch(r=!1,(s=function(e){var t,n;t=((e=e||{level:"AA",size:"small"}).level||"AA").toUpperCase(),n=(e.size||"small").toLowerCase(),"AA"!==t&&"AAA"!==t&&(t="AA");"small"!==n&&"large"!==n&&(n="small");return{level:t,size:n}}(n)).level+s.size){case"AAsmall":case"AAAlarge":r=a>=4.5;break;case"AAlarge":r=a>=3;break;case"AAAsmall":r=a>=7}return r},Ge.mostReadable=function(e,t,n){var s,r,a,i,o=null,l=0;r=(n=n||{}).includeFallbackColors,a=n.level,i=n.size;for(var u=0;ul&&(l=s,o=Ge(t[u]));return Ge.isReadable(e,o,{level:a,size:i})||!r?o:(n.includeFallbackColors=!1,Ge.mostReadable(e,["#fff","#000"],n))};var it=Ge.names={aliceblue:"f0f8ff",antiquewhite:"faebd7",aqua:"0ff",aquamarine:"7fffd4",azure:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"000",blanchedalmond:"ffebcd",blue:"00f",blueviolet:"8a2be2",brown:"a52a2a",burlywood:"deb887",burntsienna:"ea7e5d",cadetblue:"5f9ea0",chartreuse:"7fff00",chocolate:"d2691e",coral:"ff7f50",cornflowerblue:"6495ed",cornsilk:"fff8dc",crimson:"dc143c",cyan:"0ff",darkblue:"00008b",darkcyan:"008b8b",darkgoldenrod:"b8860b",darkgray:"a9a9a9",darkgreen:"006400",darkgrey:"a9a9a9",darkkhaki:"bdb76b",darkmagenta:"8b008b",darkolivegreen:"556b2f",darkorange:"ff8c00",darkorchid:"9932cc",darkred:"8b0000",darksalmon:"e9967a",darkseagreen:"8fbc8f",darkslateblue:"483d8b",darkslategray:"2f4f4f",darkslategrey:"2f4f4f",darkturquoise:"00ced1",darkviolet:"9400d3",deeppink:"ff1493",deepskyblue:"00bfff",dimgray:"696969",dimgrey:"696969",dodgerblue:"1e90ff",firebrick:"b22222",floralwhite:"fffaf0",forestgreen:"228b22",fuchsia:"f0f",gainsboro:"dcdcdc",ghostwhite:"f8f8ff",gold:"ffd700",goldenrod:"daa520",gray:"808080",green:"008000",greenyellow:"adff2f",grey:"808080",honeydew:"f0fff0",hotpink:"ff69b4",indianred:"cd5c5c",indigo:"4b0082",ivory:"fffff0",khaki:"f0e68c",lavender:"e6e6fa",lavenderblush:"fff0f5",lawngreen:"7cfc00",lemonchiffon:"fffacd",lightblue:"add8e6",lightcoral:"f08080",lightcyan:"e0ffff",lightgoldenrodyellow:"fafad2",lightgray:"d3d3d3",lightgreen:"90ee90",lightgrey:"d3d3d3",lightpink:"ffb6c1",lightsalmon:"ffa07a",lightseagreen:"20b2aa",lightskyblue:"87cefa",lightslategray:"789",lightslategrey:"789",lightsteelblue:"b0c4de",lightyellow:"ffffe0",lime:"0f0",limegreen:"32cd32",linen:"faf0e6",magenta:"f0f",maroon:"800000",mediumaquamarine:"66cdaa",mediumblue:"0000cd",mediumorchid:"ba55d3",mediumpurple:"9370db",mediumseagreen:"3cb371",mediumslateblue:"7b68ee",mediumspringgreen:"00fa9a",mediumturquoise:"48d1cc",mediumvioletred:"c71585",midnightblue:"191970",mintcream:"f5fffa",mistyrose:"ffe4e1",moccasin:"ffe4b5",navajowhite:"ffdead",navy:"000080",oldlace:"fdf5e6",olive:"808000",olivedrab:"6b8e23",orange:"ffa500",orangered:"ff4500",orchid:"da70d6",palegoldenrod:"eee8aa",palegreen:"98fb98",paleturquoise:"afeeee",palevioletred:"db7093",papayawhip:"ffefd5",peachpuff:"ffdab9",peru:"cd853f",pink:"ffc0cb",plum:"dda0dd",powderblue:"b0e0e6",purple:"800080",rebeccapurple:"663399",red:"f00",rosybrown:"bc8f8f",royalblue:"4169e1",saddlebrown:"8b4513",salmon:"fa8072",sandybrown:"f4a460",seagreen:"2e8b57",seashell:"fff5ee",sienna:"a0522d",silver:"c0c0c0",skyblue:"87ceeb",slateblue:"6a5acd",slategray:"708090",slategrey:"708090",snow:"fffafa",springgreen:"00ff7f",steelblue:"4682b4",tan:"d2b48c",teal:"008080",thistle:"d8bfd8",tomato:"ff6347",turquoise:"40e0d0",violet:"ee82ee",wheat:"f5deb3",white:"fff",whitesmoke:"f5f5f5",yellow:"ff0",yellowgreen:"9acd32"},ot=Ge.hexNames=function(e){var t={};for(var n in e)e.hasOwnProperty(n)&&(t[e[n]]=n);return t}(it);function lt(e){return e=parseFloat(e),(isNaN(e)||e<0||e>1)&&(e=1),e}function ut(e,t){(function(e){return"string"==typeof e&&-1!=e.indexOf(".")&&1===parseFloat(e)})(e)&&(e="100%");var n=function(e){return"string"==typeof e&&-1!=e.indexOf("%")}(e);return e=Math.min(t,Math.max(0,parseFloat(e))),n&&(e=parseInt(e*t,10)/100),Math.abs(e-t)<1e-6?1:e%t/parseFloat(t)}function ct(e){return Math.min(1,Math.max(0,e))}function ht(e){return parseInt(e,16)}function dt(e){return 1==e.length?"0"+e:""+e}function pt(e){return e<=1&&(e=100*e+"%"),e}function ft(e){return Math.round(255*parseFloat(e)).toString(16)}function mt(e){return ht(e)/255}var gt,yt,bt,wt=(yt="[\\s|\\(]+("+(gt="(?:[-\\+]?\\d*\\.\\d+%?)|(?:[-\\+]?\\d+%?)")+")[,|\\s]+("+gt+")[,|\\s]+("+gt+")\\s*\\)?",bt="[\\s|\\(]+("+gt+")[,|\\s]+("+gt+")[,|\\s]+("+gt+")[,|\\s]+("+gt+")\\s*\\)?",{CSS_UNIT:new RegExp(gt),rgb:new RegExp("rgb"+yt),rgba:new RegExp("rgba"+bt),hsl:new RegExp("hsl"+yt),hsla:new RegExp("hsla"+bt),hsv:new RegExp("hsv"+yt),hsva:new RegExp("hsva"+bt),hex3:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex6:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,hex4:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex8:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/});function vt(e){return!!wt.CSS_UNIT.exec(e)}var xt=__webpack_require__(782);const At=e=>e/2.54,kt={video:!1,gazer:!1};function Ct(e,t){e.background?e._replaceBackground((0,_.$O)(t.headline,t.description)):e._addBackground((0,_.$O)(t.headline,t.description)),e._constructFloatInstructionElement("gaze-system-instruction",U.H.RC_starting[e.L])}E.A.prototype.calibrateGaze=function(e={},t){if(!this.gazeTracker.checkInitialized("gaze",!0))return;(0,_.$k)(),(e=Object.assign({greedyLearner:!1,calibrationCount:1,headline:"👀 "+U.H.RC_gazeTrackingTitle[this.L],description:U.H.RC_gazeTrackingIntro[this.L]},e)).nudge=!1,kt.video=this.gazeTracker.webgazer.params.showVideo,kt.gazer=this.gazeTracker.webgazer.params.showGazeDot,kt.video||this.showVideo(!0),kt.gazer||this.showGazer(!0),this.gazeTracker.webgazer.params.greedyLearner=e.greedyLearner,Ct(this,e);const n=St(this,e,(()=>{this._removeBackground(),(0,V.l)(s),(0,_.nB)(t,{timestamp:performance.now()})})),s=(0,V.m)({Escape:()=>{n.deleteSelf(!1),this._removeBackground(),this.showVideo(kt.video),this.showGazer(kt.gazer),kt.video=!1,kt.gazer=!1,this._trackingSetupFinishedStatus.gaze||(this._trackingSetupFinishedStatus.gaze=!0,this.endGaze()),(0,V.l)(s)}})};const St=(e,t,n)=>(e._removeFloatInstructionElement(),new Et(e,document.body,t,kt,n));class Et{constructor(e,t,n,s,r){this._sequentialOrder(n.nudge),this.nudge=n.nudge,this.RC=e,this.clickThresholdBase=xt.Y?1:n.calibrationCount,this.clicks=0,this.position=this.order.shift(),this.clickThreshold=this.clickThresholdBase,this.r=this.RC._CONST.N.GAZE_CALIBRATION.R,this.div=document.createElement("div");const a=document.createElement("div"),i=document.createElement("div");this.div.className="rc-crosshair",this.div.id="rc-crosshair",a.className="rc-crosshair-component rc-crosshair-vertical",i.className="rc-crosshair-component rc-crosshair-horizontal",i.style.height=a.style.width=`${ee}px`,i.style.width=a.style.height=`${J}px`,this.div.style.background=e.params.backgroundColor;const o=Ge(e.params.backgroundColor).toRgb();return this.div.style.background=`rgba(${o.r}, ${o.g}, ${o.b}, 0.75)`,this.div.appendChild(a),this.div.appendChild(i),this.parent=t,this.parent.appendChild(this.div),this.placeDot(),this.handleClick=this.takeClick.bind(this),this.div.addEventListener("click",this.handleClick,!1),this.originalStyles=s,this.endCalibrationCallback=r,this.div}placeDot(){Object.assign(this.div.style,[{left:this.RC._CONST.N.GAZE_CALIBRATION.MARGIN+"px",right:"unset"},{left:`calc(50% - ${this.RC._CONST.N.GAZE_CALIBRATION.R/2}px)`,right:"unset"},{left:window.innerWidth-this.RC._CONST.N.GAZE_CALIBRATION.R-this.RC._CONST.N.GAZE_CALIBRATION.MARGIN+"px",right:"unset"},{left:`calc(50% - ${this.RC._CONST.N.GAZE_CALIBRATION.R/2}px - ${this.getOffsetPx(this.RC._CONST.N.GAZE_CALIBRATION.CENTER_EXTRA_CHECK_OFFSET)}px)`,right:"unset"},{left:`calc(50% - ${this.RC._CONST.N.GAZE_CALIBRATION.R/2}px + ${this.getOffsetPx(this.RC._CONST.N.GAZE_CALIBRATION.CENTER_EXTRA_CHECK_OFFSET)}px)`,right:"unset"},{left:`calc(50% - ${this.RC._CONST.N.GAZE_CALIBRATION.R/2}px - ${this.getOffsetPx(this.RC._CONST.N.GAZE_CALIBRATION.MID_EXTRA_CHECK_OFFSET,.3*window.innerWidth)}px)`,right:"unset"},{left:`calc(50% - ${this.RC._CONST.N.GAZE_CALIBRATION.R/2}px + ${this.getOffsetPx(this.RC._CONST.N.GAZE_CALIBRATION.MID_EXTRA_CHECK_OFFSET,.3*window.innerWidth)}px)`,right:"unset"}][this.position[0]],[{top:this.RC._CONST.N.GAZE_CALIBRATION.MARGIN+"px",bottom:"unset"},{top:`calc(50% - ${this.RC._CONST.N.GAZE_CALIBRATION.R/2}px)`,bottom:"unset"},{top:window.innerHeight-this.RC._CONST.N.GAZE_CALIBRATION.R-this.RC._CONST.N.GAZE_CALIBRATION.MARGIN+"px",bottom:"unset"},{top:`calc(50% - ${this.RC._CONST.N.GAZE_CALIBRATION.R/2}px - ${this.getOffsetPx(this.RC._CONST.N.GAZE_CALIBRATION.CENTER_EXTRA_CHECK_OFFSET)}px)`,bottom:"unset"},{top:`calc(50% - ${this.RC._CONST.N.GAZE_CALIBRATION.R/2}px + ${this.getOffsetPx(this.RC._CONST.N.GAZE_CALIBRATION.CENTER_EXTRA_CHECK_OFFSET)}px)`,bottom:"unset"},{top:`calc(50% - ${this.RC._CONST.N.GAZE_CALIBRATION.R/2}px - ${this.getOffsetPx(this.RC._CONST.N.GAZE_CALIBRATION.MID_EXTRA_CHECK_OFFSET,.3*window.innerHeight)}px)`,bottom:"unset"},{top:`calc(50% - ${this.RC._CONST.N.GAZE_CALIBRATION.R/2}px + ${this.getOffsetPx(this.RC._CONST.N.GAZE_CALIBRATION.MID_EXTRA_CHECK_OFFSET,.3*window.innerHeight)}px)`,bottom:"unset"}][this.position[1]])}takeClick(e){if(this.clickAtCenter(e)){this.clicks++,this.clicks>=this.clickThreshold&&(this.order.length?(this.position=this.order.shift(),this.clickThreshold=this.clickThresholdBase,this.placeDot(),this.clicks=0):this.deleteSelf(!0));let e=document.querySelectorAll(".leader-line");e&&e.forEach((e=>e.style.opacity=0))}}deleteSelf(e=!0){this.div.removeEventListener("click",this.handleClick,!1),this.parent.removeChild(this.div),e&&(this.nudge||this.RC.showVideo(this.originalStyles.video),this.nudge||(this.originalStyles.video=!1),this.RC.showGazer(this.originalStyles.gazer),this.originalStyles.gazer=!1,(0,_.nB)(this.endCalibrationCallback),this.nudge||(this.RC._trackingSetupFinishedStatus.gaze=!0))}clickAtCenter(e){const{x:t,y:n}=(0,_.KY)(e),{left:s,top:r,right:a,bottom:i}=this.div.getBoundingClientRect(),o=(s+a)/2,l=(r+i)/2;return t>=o-5&&t<=o+5&&n>=l-5&&n<=l+5}_randomOrder(){this.order=[];for(let e of[0,1,2])for(let t of[0,1,2])this.order.push([e,t]);(0,_.k4)(this.order)}_sequentialOrder(e=!1){this.order=e?[[1,1],[1,3],[4,1],[1,4],[3,1],[1,1],[1,4],[4,1],[1,3],[3,1],[1,1]]:xt.Y?[[0,0],[2,0],[2,2],[0,2],[1,1]]:[[1,1],[1,0],[2,0],[2,1],[2,2],[1,2],[0,2],[0,1],[0,0],[1,1],[1,2],[2,2],[2,1],[2,0],[1,0],[0,0],[0,1],[0,2],[1,1],[1,5],[6,5],[6,1],[6,6],[1,6],[5,6],[5,1],[5,5],[1,1],[1,6],[6,6],[6,1],[6,5],[1,5],[5,5],[5,1],[5,6],[1,1],[1,4],[4,1],[1,3],[3,1],[1,1],[1,3],[4,1],[1,4],[3,1],[1,1]]}getOffsetPx(e,t=null){const n=(s=e,r=this.RC.screenPpi?this.RC.screenPpi.value:this.RC._CONST.N.PPI_DONT_USE,a=this.RC.viewingDistanceCm?this.RC.viewingDistanceCm.value:this.RC._CONST.N.VIEW_DIST_DONT_USE,At(r)*a*Math.tan(s*(Math.PI/180)));var s,r,a;return t?Math.min(n,t):n}}E.A.prototype.trackGaze=async function(e={},t=null,n=null){if(!this.checkInitialized())return;if((0,_.$k)(),e=Object.assign({fullscreen:!1,greedyLearner:!1,framerate:60,showGazer:!0,showVideo:!0,pipWidthPx:this._CONST.N.VIDEO_W[this.isMobile.value?"MOBILE":"DESKTOP"],showFaceOverlay:!1,calibrationCount:1,thresholdDeg:10,decimalPlace:0,headline:"👀 "+U.H.RC_gazeTrackingTitle[this.L],description:U.H.RC_gazeTrackingIntro[this.L]},e),this.getFullscreen(e.fullscreen),this.gazeTracker.checkInitialized("gaze"))return this.gazeTracker._toFixedN=e.decimalPlace,this.showGazer(e.showGazer),this.showVideo(e.showVideo),this.showFaceOverlay(e.showFaceOverlay),this.gazeTracker.attachNewCallback(n),void(this.gazeTracker.defaultGazeCallback=n);this._addBackground(),await de(this),this.gazeTracker._init({greedyLearner:e.greedyLearner,framerate:e.framerate,toFixedN:e.decimalPlace,showVideo:e.showVideo,showFaceOverlay:e.showFaceOverlay,showGazer:e.showGazer},"gaze"),Ct(this,e);const s={pipWidthPx:e.pipWidthPx},r={greedyLearner:e.greedyLearner,calibrationCount:e.calibrationCount,headline:e.headline,description:e.description};this.gazeTracker.begin(s,(()=>{this._trackingSetupFinishedStatus.gaze=!1,this.calibrateGaze(r,a)}));const a=s=>{(0,_.nB)(t,s),this.gazeTracker.webgazer.params.greedyLearner||this.gazeTracker.stopLearning({click:!0,move:!0});return e.thresholdDeg,this.gazeTracker.attachNewCallback(n),void(this.gazeTracker.defaultGazeCallback=n)}},E.A.prototype.getGazeNow=async function(e={},t=null){if(!(this.checkInitialized()&&this.gazeTracker.checkInitialized("gaze",!0)&&this.gazeTracker.webgazer.params.paused&&this._trackingPaused.gaze))return;e=Object.assign({wait:0,frames:5},e);let n=t||this.gazeTracker.defaultGazeCallback;return await this.gazeTracker.getGazeNow(e,n)},E.A.prototype.pauseGaze=function(){!this.gazeTracker.checkInitialized("gaze",!0)&&this._trackingPaused.gaze||(this._trackingPaused.gaze=!0,this.gazeTracker.pause())},E.A.prototype.resumeGaze=function(){(this.gazeTracker.checkInitialized("gaze",!0)||this._trackingPaused.gaze)&&(this._trackingPaused.gaze=!1,this.gazeTracker.resume())},E.A.prototype.endGaze=function(e=!1){this.gazeTracker.checkInitialized("gaze",!0)&&(this._trackingPaused.gaze=!1,this.gazeTracker.end("gaze",e))},E.A.prototype.gazeLearning=function(e=!0,t){t=Object.assign({click:!0,move:!0},t),e?this.gazeTracker.startLearning(t):this.gazeTracker.stopLearning(t)},E.A.prototype.showGazer=function(e=!0){this.gazeTracker.checkInitialized("gaze",!1)&&this.gazeTracker.showGazer(e)},E.A.prototype.showVideo=function(e=!0){this.gazeTracker.checkInitialized("",!1)&&this.gazeTracker.showVideo(e)},E.A.prototype.showFaceOverlay=function(e=!0){this.gazeTracker.checkInitialized("gaze",!1)&&this.gazeTracker.showFaceOverlay(e)};var _t=__webpack_require__(7158),It=__webpack_require__.n(_t);const Tt={gazer:!1,gazeLearning:!1,gazePaused:!1},Nt={current:null};E.A.prototype.nudgeGaze=function(e={},t){if(!this.checkInitialized()||!this.gazeTracker.checkInitialized("gaze",!0))return;if(e=Object.assign({showOffset:!0},e),this._gazeTrackNudging.isCorrectingGaze)return;this._gazeTrackNudging.isCorrectingGaze=!0;let n=document.getElementById("gaze-nudger");n||(n=document.createElement("div"),n.id="gaze-nudger",n.className=`gaze-nudger rc-lang-${this.LD.toLowerCase()}`,document.body.classList.add("lock-view"),document.body.appendChild(n),n.style.background=this.params.backgroundColor);const s=`

      ${U.H.RC_gazeTrackingNudge[this.L]}

      `;n.innerHTML+=s;const r=Ot(this,n,t);if(this._nudger.gazeElement=n,e.showOffset){const e=document.createElement("div");e.id="fake-gaze-dot",e.style.position="absolute",e.style.left=this.gazePositionPx.value.x-5+"px",e.style.top=this.gazePositionPx.value.y-5+"px",e.style.width="10px",e.style.height="10px",e.style.borderRadius="50%",e.style.background="transparent",e.style.zIndex="9999999999",document.body.appendChild(e),Nt.current=new(It())(It().pointAnchor(e,{x:"50%",y:"50%"}),It().pointAnchor(r,{x:"50%",y:"50%"}),{path:"straight",color:this._CONST.COLOR.DARK_RED,startPlug:"disc"});const t=document.querySelector(".leader-line");t.style.zIndex=9999999999,t.style.opacity=.7,t.style.transitionDuration="0.2s"}Tt.gazePaused=this._trackingPaused.gaze,Tt.gazer=this.gazeTracker.webgazer.params.showGazeDot,Tt.gazeLearning=this.gazeTracker._learning,Tt.gazePaused&&this.resumeGaze(),Tt.gazer||this.showGazer(!0),Tt.gazeLearning||this.gazeLearning(!0,{click:!0,move:!1})};const Ot=(e,t,n)=>new Et(e,t,{greedyLearner:!1,calibrationCount:1,nudge:!0},Tt,(()=>{t.remove(),t=null,e._nudgerElement=null,document.body.classList.remove("lock-view"),Tt.gazePaused&&e.pauseGaze(),Tt.gazePaused=!1,Nt.current&&(Nt.current.remove(),Nt.current=null),e._gazeTrackNudging.isCorrectingGaze=!1,(0,_.nB)(n)}));var Rt=__webpack_require__(4948),Dt=__webpack_require__.n(Rt);let Mt=!1;E.A.prototype.getGazeAccuracy=function(e={},t,n){if(!this.checkInitialized())return!1;(0,_.$k)();const s=this.screenPpi,r=this.viewingDistanceCm;if(!s||!r)return!1;e=Object.assign({backgroundColor:"#eee",thresholdDeg:10,decimalPlace:3},e),this._addBackground();const a=document.createElement("div");a.innerHTML='',this.background.appendChild(a);const i=document.querySelector("#gaze-accuracy-canvas"),o=i.getContext("2d"),l=()=>{i.style.width=(i.width=window.innerWidth)+"px",i.style.height=(i.height=window.innerHeight)+"px"},u=new ResizeObserver((()=>{l()}));return u.observe(this.background),l(),Dt().fire({...ae(this,{showIcon:!0}),html:"We will measure your gaze accuracy. Please do not move the mouse and look at the fixation at the middle of the screen for the next 5 seconds."}).then((()=>{Mt=!0,Ft(i,o,e),this.gazeTracker.startStoringPoints(),(0,_.yy)(5e3).then((()=>{Mt=!1,this.gazeTracker.stopStoringPoints();const a=this.gazeTracker.webgazer.getStoredPoints(),l=Bt({x:i.width/2,y:i.height/2},a,s.value,r.value);this.newGazeAccuracyData={value:(0,_.Nh)(l,e.decimalPlace),timestamp:performance.now()},l{const s=()=>{t.fillStyle=n.backgroundColor,t.fillRect(0,0,e.width,e.height),ne(t,e.width/2,e.height/2),Mt&&requestAnimationFrame(s)};requestAnimationFrame(s)},Bt=(e,t,n,s)=>{let r=0;for(let a=0;a0;)n=Math.random()*t|0,t--,Gt(e,t,n)}function Wt(e,t,n){return Math.max(e,Math.min(t,n))}function Ut(e){return e%2==0?e:e+1}function Gt(e,t,n){const s=e[t];e[t]=e[n],e[n]=s}function qt(e,t){if(!e)throw new Error("string"==typeof t?t:t())}function jt(e,t,n=""){qt(Kt(e,t),(()=>n+` Shapes ${e} and ${t} must match`))}function Ht(e){qt(null!=e,(()=>"The input to the tensor constructor must be a non-null value."))}function $t(e){if(0===e.length)return 1;let t=e[0];for(let n=1;n0),n,s){return new Promise(((r,a)=>{let i=0;const o=()=>{if(e())return void r();i++;const l=t(i);null!=n&&i>=n?a():null!=s?s(o,l):setTimeout(o,l)};o()}))}function Jt(e,t){let n=1,s=-1;for(let t=0;t=0)n*=e[t];else if(-1===e[t]){if(-1!==s)throw Error(`Shapes can only have 1 implicit size. Found -1 at dim ${s} and dim ${t}`);s=t}else if(e[t]<0)throw Error(`Shapes can not be < 0. Found ${e[t]} at dim ${t}`);if(-1===s){if(t>0&&t!==n)throw Error(`Size(${t}) must match the product of shape ${e}`);return e}if(0===n)throw Error(`Cannot infer the missing size in [${e}] when there are 0 elements`);if(t%n!=0)throw Error(`The implicit shape can't be a fractional number. Got ${t} / ${n}`);const r=e.slice();return r[s]=t/n,r}function en(e,t){const n=t.length;return qt((e=null==e?t.map(((e,t)=>t)):[].concat(e)).every((e=>e>=-n&&e`All values in axis param must be in range [-${n}, ${n}) but got axis ${e}`)),qt(e.every((e=>Xt(e))),(()=>`All values in axis param must be integers but got axis ${e}`)),e.map((e=>e<0?n+e:e))}function tn(e,t){const n=[],s=[],r=null!=t&&Array.isArray(t)&&0===t.length,a=null==t||r?null:en(t,e).sort();let i=0;for(let t=0;tt)&&1===e[t]&&(n.push(e[t]),s.push(t)),a[i]<=t&&i++}1!==e[t]&&(n.push(e[t]),s.push(t))}return{newShape:n,keptDims:s}}function nn(e,t){return sn(e,t)}function sn(e,t){let n=null;if(null==e||"float32"===e)n=new Float32Array(t);else if("int32"===e)n=new Int32Array(t);else if("bool"===e)n=new Uint8Array(t);else{if("string"!==e)throw new Error(`Unknown data type ${e}`);n=new Array(t)}return n}function rn(e,t){return"complex64"!==t&&(("float32"!==t||"complex64"===e)&&(("int32"!==t||"float32"===e||"complex64"===e)&&("bool"!==t||"bool"!==e)))}function an(e){if("float32"===e||"int32"===e)return 4;if("complex64"===e)return 8;if("bool"===e)return 1;throw new Error(`Unknown dtype ${e}`)}function on(e){return"string"==typeof e||e instanceof String}function ln(e){return"number"==typeof e}function un(e){return Array.isArray(e)?un(e[0]):e instanceof Float32Array?"float32":e instanceof Int32Array||e instanceof Uint8Array||e instanceof Uint8ClampedArray?"int32":ln(e)?"float32":on(e)?"string":"boolean"==typeof e?"bool":"float32"}function cn(e){return!!(e&&e.constructor&&e.call&&e.apply)}function hn(e,t){for(let n=t;n=0;--s)n[s]=n[s+1]*e[s+1];return n}function pn(e,t,n,s=!1){const r=new Array;if(1===t.length){const a=t[0]*(s?2:1);for(let t=0;te*t))*(s?2:1);for(let t=0;te*t))*(n?2:1);if(0===s)return[];if(s!==t.length)throw new Error(`[${e}] does not match the input size ${t.length}${n?" for a complex tensor":""}.`);return pn(0,e,t,n)}function mn(e,t){const n=gn(e,t);for(let e=0;ee*t),1);if(null==t||"float32"===t)return fn(e,new Float32Array(n));if("int32"===t)return fn(e,new Int32Array(n));if("bool"===t)return fn(e,new Uint8Array(n));throw new Error(`Unknown data type ${t}`)}function bn(e){e.forEach((t=>{qt(Number.isInteger(t)&&t>=0,(()=>`Tensor must have a shape comprised of positive integers but got shape [${e}].`))}))}function wn(e,t,n){if(0===t)return 0;if(1===t)return e[0];let s=e[e.length-1];for(let t=0;t{const[t,n]=e.split(":");this.urlFlags[t]=function(e,t){const n=t.toLowerCase();return"true"===n||"false"===n?"true"===n:""+ +n===n?+n:t}(0,n)}))}}}function Cn(e){const t={};return e.replace(/[?&]([^=?&]+)(?:=([^&]*))?/g,((e,...n)=>(function(e,t,n){e[decodeURIComponent(t)]=decodeURIComponent(n||"")}(t,n[0],n[1]),n.join("=")))),t}function Sn(){return _n}let En,_n=null;function In(){if(null==En){let e;if("undefined"!=typeof window)e=window;else if(void 0!==__webpack_require__.g)e=__webpack_require__.g;else if("undefined"!=typeof process)e=process;else{if("undefined"==typeof self)throw new Error("Could not find a global object");e=self}En=e}return En}function Tn(e,t){const n=function(){const e=In();return null==e._tfGlobals&&(e._tfGlobals=new Map),e._tfGlobals}();if(n.has(e))return n.get(e);{const s=t();return n.set(e,s),n.get(e)}}const Nn="Abs",On="Acos",Rn="Acosh",Dn="Add",Mn="AddN",Fn="All",Bn="Any",zn="ArgMax",Ln="ArgMin",Pn="Asin",Vn="Asinh",Wn="Atan",Un="Atanh",Gn="Atan2",qn="AvgPool",jn="AvgPoolGrad",Hn="AvgPool3D",$n="AvgPool3DGrad",Kn="BatchMatMul",Xn="BatchToSpaceND",Zn="Bincount",Yn="BitwiseAnd",Qn="BroadcastArgs",Jn="Cast",es="Ceil",ts="ClipByValue",ns="Complex",ss="ComplexAbs",rs="Concat",as="Conv2D",is="Conv2DBackpropFilter",os="Conv2DBackpropInput",ls="Conv3D",us="Conv3DBackpropFilterV2",cs="Conv3DBackpropInputV2",hs="Cos",ds="Cosh",ps="Cumprod",fs="Cumsum",ms="CropAndResize",gs="DenseBincount",ys="DepthToSpace",bs="DepthwiseConv2dNative",ws="DepthwiseConv2dNativeBackpropFilter",vs="DepthwiseConv2dNativeBackpropInput",xs="Diag",As="Dilation2D",ks="Dilation2DBackpropInput",Cs="Dilation2DBackpropFilter",Ss="Draw",Es="RealDiv",_s="Einsum",Is="Elu",Ts="EluGrad",Ns="Erf",Os="Equal",Rs="Exp",Ds="ExpandDims",Ms="Expm1",Fs="FFT",Bs="Fill",zs="FlipLeftRight",Ls="Floor",Ps="FloorDiv",Vs="FusedBatchNorm",Ws="GatherV2",Us="GatherNd",Gs="Greater",qs="GreaterEqual",js="Identity",Hs="IFFT",$s="Imag",Ks="IsFinite",Xs="IsInf",Zs="IsNan",Ys="LeakyRelu",Qs="Less",Js="LessEqual",er="LinSpace",tr="Log",nr="Log1p",sr="LogicalAnd",rr="LogicalNot",ar="LogicalOr",ir="LRN",or="LRNGrad",lr="Max",ur="Maximum",cr="MaxPool",hr="MaxPoolGrad",dr="MaxPool3D",pr="MaxPool3DGrad",fr="MaxPoolWithArgmax",mr="Mean",gr="Min",yr="Minimum",br="MirrorPad",wr="Mod",vr="Multinomial",xr="Multiply",Ar="Neg",kr="NotEqual",Cr="NonMaxSuppressionV3",Sr="NonMaxSuppressionV4",Er="NonMaxSuppressionV5",_r="OnesLike",Ir="OneHot",Tr="Pack",Nr="PadV2",Or="Pow",Rr="Prelu",Dr="Prod",Mr="RaggedGather",Fr="RaggedRange",Br="RaggedTensorToTensor",zr="Range",Lr="Real",Pr="Reciprocal",Vr="Relu",Wr="Reshape",Ur="ResizeNearestNeighbor",Gr="ResizeNearestNeighborGrad",qr="ResizeBilinear",jr="ResizeBilinearGrad",Hr="Relu6",$r="Reverse",Kr="Round",Xr="Rsqrt",Zr="ScatterNd",Yr="TensorScatterUpdate",Qr="SearchSorted",Jr="Select",ea="Selu",ta="Slice",na="Sin",sa="Sinh",ra="Sign",aa="Sigmoid",ia="Softplus",oa="Sqrt",la="Sum",ua="SpaceToBatchND",ca="SplitV",ha="Softmax",da="SparseFillEmptyRows",pa="SparseReshape",fa="SparseSegmentMean",ma="SparseSegmentSum",ga="SparseToDense",ya="SquaredDifference",ba="Square",wa="StaticRegexReplace",va="StridedSlice",xa="StringNGrams",Aa="StringSplit",ka="StringToHashBucketFast",Ca="Sub",Sa="Tan",Ea="Tanh",_a="Tile",Ia="TopK",Ta="Transform",Na="Transpose",Oa="Unique",Ra="Unpack",Da="UnsortedSegmentSum",Ma="ZerosLike",Fa="Step",Ba="FromPixels",za="RotateWithOffset",La="_FusedMatMul",Pa="FusedConv2D",Va="FusedDepthwiseConv2D";function Wa(...e){!Sn().getBool("IS_TEST")&&Sn().getBool("PROD")}function Ua(...e){!Sn().getBool("IS_TEST")&&Sn().getBool("PROD")}const Ga=Tn("kernelRegistry",(()=>new Map)),qa=Tn("gradRegistry",(()=>new Map));function ja(e,t){const n=Za(e,t);return Ga.get(n)}function Ha(e){return qa.get(e)}function $a(e){const t=Ga.entries(),n=[];for(;;){const{done:s,value:r}=t.next();if(s)break;const[a,i]=r,[o]=a.split("_");o===e&&n.push(i)}return n}function Ka(e){const{kernelName:t,backendName:n}=e,s=Za(t,n);Ga.has(s)&&Wa(),Ga.set(s,e)}function Xa(e){const{kernelName:t}=e;qa.has(t)&&Sn().getBool("DEBUG")&&Wa(),qa.set(t,e)}function Za(e,t){return`${t}_${e}`}function Ya(e){return e instanceof Float32Array||e instanceof Int32Array||e instanceof Uint8Array||e instanceof Uint8ClampedArray}var Qa=__webpack_require__(3122);const Ja=__webpack_require__.n(Qa)()||Qa;function ei(e){return Ja.fromString(e,!0,16)}const ti=ei("c3a5c85c97cb3127"),ni=ei("b492b66fbe98f273"),si=ei("9ae16a3b2f90404f");function ri(e){return e.xor(e.shru(47))}function ai(e,t,n){const s=e.slice(t,t+n);return Ja.fromBytes(Array.from(s),!0,!0)}function ii(e,t){return ai(e,t,8)}function oi(e,t){return ai(e,t,4)}function li(e,t){return 0===t?e:e.shru(t).or(e.shl(64-t))}function ui(e,t,n=ei("9ddfea08eb382d69")){let s=e.xor(t).mul(n);s=s.xor(s.shru(47));let r=t.xor(s).mul(n);return r=r.xor(r.shru(47)),r=r.mul(n),r}function ci(e,t,n,s){return function(e,t,n,s,r,a){r=r.add(e),a=li(a.add(r).add(s),21);const i=r;return r=(r=r.add(t)).add(n),a=a.add(li(r,44)),[r.add(s),a.add(i)]}(ii(e,t),ii(e,t+8),ii(e,t+16),ii(e,t+24),n,s)}function hi(e,t=e.length){const n=Ja.fromNumber(81,!0);if(t<=32)return t<=16?function(e,t=e.length){if(t>=8){const n=si.add(2*t),s=ii(e,0).add(si),r=ii(e,t-8);return ui(li(r,37).mul(n).add(s),li(s,25).add(r).mul(n),n)}if(t>=4){const n=si.add(2*t);return ui(oi(e,0).shl(3).add(t),oi(e,t-4),n)}if(t>0){const n=e[0]+(e[t>>1]<<8),s=t+(e[t-1]<<2);return ri(si.mul(n).xor(ti.mul(s))).mul(si)}return si}(e,t):function(e,t=e.length){const n=si.add(2*t),s=ii(e,0).mul(ni),r=ii(e,8),a=ii(e,t-8).mul(n),i=ii(e,t-16).mul(si);return ui(li(s.add(r),43).add(li(a,30)).add(i),s.add(li(r.add(si),18)).add(a),n)}(e,t);if(t<=64)return function(e,t=e.length){const n=si.add(2*t),s=ii(e,0).mul(si),r=ii(e,8),a=ii(e,t-8).mul(n),i=ii(e,t-16).mul(si),o=li(s.add(r),43).add(li(a,30)).add(i),l=ui(o,s.add(li(r.add(si),18)).add(a),n),u=ii(e,16).mul(n),c=ii(e,24),h=o.add(ii(e,t-32)).mul(n),d=l.add(ii(e,t-24)).mul(n);return ui(li(u.add(c),43).add(li(h,30)).add(d),u.add(li(c.add(s),18)).add(h),n)}(e,t);let s=n,r=n.mul(ni).add(113),a=ri(r.mul(si).add(113)).mul(si),i=[Ja.UZERO,Ja.UZERO],o=[Ja.UZERO,Ja.UZERO];s=s.mul(si).add(ii(e,0));let l=0;const u=64*(t-1>>6),c=u+(t-1&63)-63;do{s=li(s.add(r).add(i[0]).add(ii(e,l+8)),37).mul(ni),r=li(r.add(i[1]).add(ii(e,l+48)),42).mul(ni),s=s.xor(o[1]),r=r.add(i[0]).add(ii(e,l+40)),a=li(a.add(o[0]),33).mul(ni),i=ci(e,l,i[1].mul(ni),s.add(o[0])),o=ci(e,l+32,a.add(o[1]),r.add(ii(e,l+16))),[a,s]=[s,a],l+=64}while(l!==u);const h=ni.add(a.and(255).shl(1));return l=c,o[0]=o[0].add(t-1&63),i[0]=i[0].add(o[0]),o[0]=o[0].add(i[0]),s=li(s.add(r).add(i[0]).add(ii(e,l+8)),37).mul(h),r=li(r.add(i[1]).add(ii(e,l+48)),42).mul(h),s=s.xor(o[1].mul(9)),r=r.add(i[0].mul(9).add(ii(e,l+40))),a=li(a.add(o[0]),33).mul(h),i=ci(e,l,i[1].mul(h),s.add(o[0])),o=ci(e,l+32,a.add(o[1]),r.add(ii(e,l+16))),[a,s]=[s,a],ui(ui(i[0],o[0],h).add(ri(r).mul(ti)).add(a),ui(i[1],o[1],h).add(s),h)}function di(e,t){return"string"===t?mi(e):pi([e],t)}function pi(e,t){if("string"===t)throw new Error("Cannot convert a string[] to a TypedArray");if(Array.isArray(e)&&(e=bi(e)),Sn().getBool("DEBUG")&&function(e,t){for(let n=0;n{s=n()};let a;const i=fi();if(this.backendTimer.timerAvailable())a=this.backendTimer.time(r);else{r();for(const e of s)e.dataSync();a=Promise.resolve({kernelMs:fi()-i})}if(Sn().getBool("CHECK_COMPUTATION_FOR_ERRORS"))for(let t=0;t{vi(t,n.dtype,e)}))}return{kernelName:e,outputs:s,inputs:t,timeMs:a.then((e=>e.kernelMs)),extraInfo:a.then((e=>null!=e.getExtraProfileInfo?e.getExtraProfileInfo():""))}}logKernelProfile(e){const{kernelName:t,outputs:n,timeMs:s,inputs:r,extraInfo:a}=e;n.forEach((e=>{Promise.all([e.data(),s,a]).then((n=>{this.logger.logKernelProfile(t,e,n[0],n[1],r,n[2])}))}))}}function vi(e,t,n){if("float32"!==t)return!1;for(let t=0;t0?s:""} `}}}}const Ai=20,ki=3,Ci=7;function Si(e,t,n,s){const r=dn(t),a=function(e,t,n,s){const r=$t(t),a=s[s.length-1],i=new Array(a).fill(0),o=t.length,l="complex64"===n?Ti(e):e;if(o>1)for(let e=0;e" "+e)).join("\n")),l.join("\n")}function Ei(e,t,n){let s;return s=Array.isArray(e)?`${parseFloat(e[0].toFixed(Ci))} + ${parseFloat(e[1].toFixed(Ci))}j`:on(e)?`'${e}'`:"bool"===n?_i(e):parseFloat(e.toFixed(Ci)).toString(),Yt(s,t)}function _i(e){return 0===e?"false":"true"}function Ii(e,t,n,s,r,a=!0){const i="complex64"===n?2:1,o=t[0],l=t.length;if(0===l){if("complex64"===n){return[Ei(Ti(e)[0],0,n)]}return"bool"===n?[_i(e[0])]:[e[0].toString()]}if(1===l){if(o>Ai){const t=ki*i;let s=Array.from(e.slice(0,t)),a=Array.from(e.slice((o-ki)*i,o*i));return"complex64"===n&&(s=Ti(s),a=Ti(a)),["["+s.map(((e,t)=>Ei(e,r[t],n))).join(", ")+", ..., "+a.map(((e,t)=>Ei(e,r[o-ki+t],n))).join(", ")+"]"]}return["["+("complex64"===n?Ti(e):Array.from(e)).map(((e,t)=>Ei(e,r[t],n))).join(", ")+"]"]}const u=t.slice(1),c=s.slice(1),h=s[0]*i,d=[];if(o>Ai){for(let t=0;t0?d[0]+p:"");for(let e=1;e`Length of values '${e}' does not match the size inferred by the shape '${this.size}'.`))}if("complex64"===t)throw new Error("complex64 dtype TensorBuffers are not supported. Please create a TensorBuffer for the real and imaginary parts separately and call tf.complex(real, imag).");this.values=n||sn(t,this.size),this.strides=dn(e)}set(e,...t){0===t.length&&(t=[0]),qt(t.length===this.rank,(()=>`The number of provided coordinates (${t.length}) must match the rank (${this.rank})`));const n=this.locToIndex(t);this.values[n]=e}get(...e){0===e.length&&(e=[0]);let t=0;for(const n of e){if(n<0||n>=this.shape[t]){const t=`Requested out of range element at ${e}. Buffer shape=${this.shape}`;throw new Error(t)}t++}let n=e[e.length-1];for(let t=0;tgi(e)))}catch(e){throw new Error("Failed to decode the string bytes into utf-8. To get the original bytes, call tensor.bytes().")}}return e}dataToGPU(e){return this.throwIfDisposed(),Oi().readToGPU(this.dataId,e)}dataSync(){this.throwIfDisposed();const e=Oi().readSync(this.dataId);if("string"===this.dtype)try{return e.map((e=>gi(e)))}catch(e){throw new Error("Failed to decode the string bytes into utf-8. To get the original bytes, call tensor.bytes().")}return e}async bytes(){this.throwIfDisposed();const e=await Oi().read(this.dataId);return"string"===this.dtype?e:new Uint8Array(e.buffer)}dispose(){this.isDisposed||(this.kerasMask&&this.kerasMask.dispose(),Oi().disposeTensor(this),this.isDisposedInternal=!0)}get isDisposed(){return this.isDisposedInternal}throwIfDisposed(){if(this.isDisposed)throw new Error("Tensor is disposed.")}print(e=!1){return Ri.print(this,e)}clone(){return this.throwIfDisposed(),Ri.clone(this)}toString(e=!1){return Si(this.dataSync(),this.shape,this.dtype,e)}cast(e){return this.throwIfDisposed(),Ri.cast(this,e)}variable(e=!0,t,n){return this.throwIfDisposed(),Oi().makeVariable(this,e,t,n)}}function Fi(){return Tn("Tensor",(()=>Mi))}Object.defineProperty(Mi,Symbol.hasInstance,{value:e=>!!e&&null!=e.data&&null!=e.dataSync&&null!=e.throwIfDisposed}),Fi();class Bi extends Mi{constructor(e,t,n,s){super(e.shape,e.dtype,e.dataId,s),this.trainable=t,this.name=n}assign(e){if(e.dtype!==this.dtype)throw new Error(`dtype of the new value (${e.dtype}) and previous value (${this.dtype}) must match`);if(!Kt(e.shape,this.shape))throw new Error(`shape of the new value (${e.shape}) and previous value (${this.shape}) must match`);Oi().disposeTensor(this),this.dataId=e.dataId,Oi().incRef(this,null)}dispose(){Oi().disposeVariable(this),this.isDisposedInternal=!0}}var zi,Li,Pi,Vi,Wi;Object.defineProperty(Bi,Symbol.hasInstance,{value:e=>e instanceof Mi&&null!=e.assign&&e.assign instanceof Function}),function(e){e.R0="R0",e.R1="R1",e.R2="R2",e.R3="R3",e.R4="R4",e.R5="R5",e.R6="R6"}(zi||(zi={})),function(e){e.float32="float32",e.int32="int32",e.bool="int32",e.complex64="complex64"}(Li||(Li={})),function(e){e.float32="float32",e.int32="int32",e.bool="bool",e.complex64="complex64"}(Pi||(Pi={})),function(e){e.float32="float32",e.int32="float32",e.bool="float32",e.complex64="complex64"}(Vi||(Vi={})),function(e){e.float32="complex64",e.int32="complex64",e.bool="complex64",e.complex64="complex64"}(Wi||(Wi={}));const Ui={float32:Vi,int32:Li,bool:Pi,complex64:Wi};function Gi(e,t){if("string"===e||"string"===t){if("string"===e&&"string"===t)return"string";throw new Error(`Can not upcast ${e} with ${t}`)}return Ui[e][t]}function qi(e){return Gi(e,"int32")}function ji(e){return null!=e&&"object"==typeof e&&"texture"in e&&e.texture instanceof WebGLTexture}function Hi(e){return"undefined"!=typeof GPUBuffer&&null!=e&&"object"==typeof e&&"buffer"in e&&e.buffer instanceof GPUBuffer}function $i(e,t){if(e.dtype===t.dtype)return[e,t];const n=Gi(e.dtype,t.dtype);return[e.cast(n),t.cast(n)]}function Ki(e,t){return t.some((t=>t.id===e.id))}function Xi(e){const t=[];return Zi(e,t,new Set),t}function Zi(e,t,n){if(null==e)return;if(e instanceof Mi)return void t.push(e);if(s=e,!Array.isArray(s)&&"object"!=typeof s)return;var s;const r=e;for(const e in r){const s=r[e];n.has(s)||(n.add(s),Zi(s,t,n))}}function Yi(e){return null!=e.kernelName}class Qi{constructor(){this.registeredVariables={},this.nextTapeNodeId=0,this.numBytes=0,this.numTensors=0,this.numStringTensors=0,this.numDataBuffers=0,this.gradientDepth=0,this.kernelDepth=0,this.scopeStack=[],this.numDataMovesStack=[],this.nextScopeId=0,this.tensorInfo=new WeakMap,this.profiling=!1,this.activeProfile={newBytes:0,newTensors:0,peakBytes:0,kernels:[],result:null,get kernelNames(){return Array.from(new Set(this.kernels.map((e=>e.name))))}}}dispose(){for(const e in this.registeredVariables)this.registeredVariables[e].dispose()}}class Ji{constructor(e){this.ENV=e,this.registry={},this.registryFactory={},this.pendingBackendInitId=0,this.state=new Qi}async ready(){if(null!=this.pendingBackendInit)return this.pendingBackendInit.then((()=>{}));if(null!=this.backendInstance)return;const e=this.getSortedBackends();for(let t=0;t{null!=e.setupFunc&&e.setupFunc(this.backendInstance)}))}disposeRegisteredKernels(e){$a(e).forEach((t=>{null!=t.disposeFunc&&t.disposeFunc(this.registry[e])}))}initializeBackend(e){const t=this.registryFactory[e];if(null==t)throw new Error(`Cannot initialize backend ${e}, no registration found.`);try{const n=t.factory();if(!n||n instanceof Lt||"function"!=typeof n.then)return this.registry[e]=n,{success:!0,asyncInit:!1};{const t=++this.pendingBackendInitId,s=n.then((n=>!(t(tthis.registryFactory[t].priority-this.registryFactory[e].priority))}initializeBackendsAndReturnBest(){const e=this.getSortedBackends();for(let t=0;tthis.startScope(s)),(()=>this.endScope(n)),(()=>(n=t(),n)))}scopedRun(e,t,n){e();try{const e=n();return t(),e}catch(e){throw t(),e}}nextTensorId(){return Ji.nextTensorId++}nextVariableId(){return Ji.nextVariableId++}clone(e){const t=to.runKernel(js,{x:e}),n={x:e};return this.addTapeNode(this.state.activeScope.name,n,[t],(e=>({x:()=>{const t={x:e},n={dtype:"float32"};return to.runKernel(Jn,t,n)}})),[],{}),t}runKernel(e,t,n){null==this.backendName&&this.backend;if(!(null!=ja(e,this.backendName)))throw new Error(`Kernel '${e}' not registered for backend '${this.backendName}'`);return this.runKernelFunc({kernelName:e,inputs:t,attrs:n})}shouldCheckForMemLeaks(){return this.ENV.getBool("IS_TEST")}checkKernelForMemLeak(e,t,n){const s=this.backend.numDataIds();let r=0;n.forEach((e=>{r+="complex64"===e.dtype?3:1}));const a=this.state.numDataMovesStack[this.state.numDataMovesStack.length-1],i=s-t-r-a;if(i>0)throw new Error(`Backend '${this.backendName}' has an internal memory leak (${i} data ids) after running '${e}'`)}runKernelFunc(e){let t,n=[];const s=this.isTapeOn(),r=this.state.numBytes,a=this.state.numTensors;let i,o;this.shouldCheckForMemLeaks()&&this.state.numDataMovesStack.push(0),null==this.backendName&&this.backend;const l=Yi(e)?e.kernelName:null!=this.state.activeScope?this.state.activeScope.name:"";if(Yi(e)){const{kernelName:t,inputs:r,attrs:a}=e;null==this.backendName&&this.backend;const l=ja(t,this.backendName);qt(null!=l,(()=>`Cannot find registered kernel '${t}' for backend '${this.backendName}'`)),i=()=>{const e=this.backend.numDataIds();o=l.kernelFunc({inputs:r,attrs:a,backend:this.backend});const i=Array.isArray(o)?o:[o];this.shouldCheckForMemLeaks()&&this.checkKernelForMemLeak(t,e,i);const u=i.map((e=>null!=e.rank?e:this.makeTensorFromTensorInfo(e)));if(s){const e=this.getTensorsForGradient(t,r,u);n=this.saveTensorsForBackwardMode(e)}return u}}else{const{forwardFunc:t}=e,r=e=>{s&&(n=e.map((e=>this.keep(this.clone(e)))))};i=()=>{const e=this.backend.numDataIds();o=this.tidy((()=>t(this.backend,r)));const n=Array.isArray(o)?o:[o];return this.shouldCheckForMemLeaks()&&this.checkKernelForMemLeak(l,e,n),n}}const{inputs:u,attrs:c}=e,h=Yi(e)?null:e.backwardsFunc;let d;return this.scopedRun((()=>this.state.kernelDepth++),(()=>this.state.kernelDepth--),(()=>{this.ENV.getBool("DEBUG")||this.state.profiling?(d=this.profiler.profileKernel(l,u,(()=>i())),this.ENV.getBool("DEBUG")&&this.profiler.logKernelProfile(d),t=d.outputs):t=i()})),s&&this.addTapeNode(l,u,t,h,n,c),this.state.profiling&&this.state.activeProfile.kernels.push({name:l,bytesAdded:this.state.numBytes-r,totalBytesSnapshot:this.state.numBytes,tensorsAdded:this.state.numTensors-a,totalTensorsSnapshot:this.state.numTensors,inputShapes:Object.keys(u).map((e=>null!=u[e]?u[e].shape:null)),outputShapes:t.map((e=>e.shape)),kernelTimeMs:d.timeMs,extraInfo:d.extraInfo}),Array.isArray(o)?t:t[0]}saveTensorsForBackwardMode(e){const t=e.map((e=>this.keep(this.clone(e))));return t}getTensorsForGradient(e,t,n){const s=Ha(e);if(null!=s){const e=s.inputsToSave||[],r=s.outputsToSave||[];let a;s.saveAllInputs?(qt(Array.isArray(t),(()=>"saveAllInputs is true, expected inputs to be an array.")),a=Object.keys(t).map((e=>t[e]))):a=e.map((e=>t[e]));const i=n.filter(((e,t)=>r[t]));return a.concat(i)}return[]}makeTensor(e,t,n,s){if(null==e)throw new Error("Values passed to engine.makeTensor() are null");n=n||"float32",s=s||this.backend;let r=e;"string"===n&&on(e[0])&&(r=e.map((e=>mi(e))));const a=s.write(r,t,n),i=new Mi(t,n,a,this.nextTensorId());if(this.trackTensor(i,s),"string"===n){const e=this.state.tensorInfo.get(a),t=function(e){if(null==e)return 0;let t=0;return e.forEach((e=>t+=e.length)),t}(r);this.state.numBytes+=t-e.bytes,e.bytes=t}return i}makeTensorFromDataId(e,t,n,s){const r={dataId:e,shape:t,dtype:n=n||"float32"};return this.makeTensorFromTensorInfo(r,s)}makeTensorFromTensorInfo(e,t){const{dataId:n,shape:s,dtype:r}=e,a=new Mi(s,r,n,this.nextTensorId());return this.trackTensor(a,t),a}makeVariable(e,t=!0,n,s){n=n||this.nextVariableId().toString(),null!=s&&s!==e.dtype&&(e=e.cast(s));const r=new Bi(e,t,n,this.nextTensorId());if(null!=this.state.registeredVariables[r.name])throw new Error(`Variable with name ${r.name} was already registered`);return this.state.registeredVariables[r.name]=r,this.incRef(r,this.backend),r}trackTensor(e,t){this.state.numTensors++,"string"===e.dtype&&this.state.numStringTensors++;let n=0;"complex64"!==e.dtype&&"string"!==e.dtype&&(n=e.size*an(e.dtype)),this.state.numBytes+=n,this.state.tensorInfo.has(e.dataId)||(this.state.numDataBuffers++,this.state.tensorInfo.set(e.dataId,{backend:t||this.backend,dtype:e.dtype,shape:e.shape,bytes:n})),e instanceof Bi||this.track(e)}incRef(e,t){this.trackTensor(e,t),this.backend.incRef(e.dataId)}removeDataId(e,t){this.state.tensorInfo.has(e)&&this.state.tensorInfo.get(e).backend===t&&(this.state.tensorInfo.delete(e),this.state.numDataBuffers--)}disposeTensor(e){if(!this.state.tensorInfo.has(e.dataId))return;const t=this.state.tensorInfo.get(e.dataId);if(this.state.numTensors--,"string"===e.dtype&&(this.state.numStringTensors--,this.state.numBytes-=t.bytes),"complex64"!==e.dtype&&"string"!==e.dtype){const t=e.size*an(e.dtype);this.state.numBytes-=t}t.backend.disposeData(e.dataId)&&this.removeDataId(e.dataId,t.backend)}disposeVariables(){for(const e in this.state.registeredVariables){const t=this.state.registeredVariables[e];this.disposeVariable(t)}}disposeVariable(e){this.disposeTensor(e),null!=this.state.registeredVariables[e.name]&&delete this.state.registeredVariables[e.name]}memory(){const e=this.backend.memory();return e.numTensors=this.state.numTensors,e.numDataBuffers=this.state.numDataBuffers,e.numBytes=this.state.numBytes,this.state.numStringTensors>0&&(e.unreliable=!0,null==e.reasons&&(e.reasons=[]),e.reasons.push("Memory usage by string tensors is approximate (2 bytes per character)")),e}async profile(e){this.state.profiling=!0;const t=this.state.numBytes,n=this.state.numTensors;this.state.activeProfile.kernels=[],this.state.activeProfile.result=await e(),this.state.profiling=!1,this.state.activeProfile.peakBytes=Math.max(...this.state.activeProfile.kernels.map((e=>e.totalBytesSnapshot))),this.state.activeProfile.newBytes=this.state.numBytes-t,this.state.activeProfile.newTensors=this.state.numTensors-n;for(const e of this.state.activeProfile.kernels)e.kernelTimeMs=await e.kernelTimeMs,e.extraInfo=await e.extraInfo;return this.state.activeProfile}isTapeOn(){return this.state.gradientDepth>0&&0===this.state.kernelDepth}addTapeNode(e,t,n,s,r,a){const i={id:this.state.nextTapeNodeId++,kernelName:e,inputs:t,outputs:n,saved:r},o=Ha(e);null!=o&&(s=o.gradFunc),null!=s&&(i.gradient=e=>(e=e.map(((e,t)=>{if(null==e){const e=n[t],s=gn(e.size,e.dtype);return this.makeTensor(s,e.shape,e.dtype)}return e})),s(e.length>1?e:e[0],r,a))),this.state.activeTape.push(i)}keep(e){return e.kept=!0,e}startTape(){0===this.state.gradientDepth&&(this.state.activeTape=[]),this.state.gradientDepth++}endTape(){this.state.gradientDepth--}startScope(e){const t={track:[],name:"unnamed scope",id:this.state.nextScopeId++};e&&(t.name=e),this.state.scopeStack.push(t),this.state.activeScope=t}endScope(e){const t=Xi(e),n=new Set(t.map((e=>e.id)));for(let e=0;e{e.kept||e.scopeId!==s.id||this.track(e)}))}gradients(e,t,n,s=!1){if(qt(t.length>0,(()=>"gradients() received an empty list of xs.")),null!=n&&"float32"!==n.dtype)throw new Error(`dy must have 'float32' dtype, but has '${n.dtype}'`);const r=this.scopedRun((()=>this.startTape()),(()=>this.endTape()),(()=>this.tidy("forward",e)));qt(r instanceof Mi,(()=>"The result y returned by f() must be a tensor."));const a=function(e,t,n){const s={},r={};for(let e=0;es[e.id]=!0)),o=!0,r[a.id]=!0;break}if(o)break}}const a={};a[n.id]=!0;const i={};for(let t=e.length-1;t>=0;t--){const n=e[t],s=n.inputs;for(let e=0;e0)throw new Error("Cannot compute gradient of y=f(x) with respect to x. Make sure that the f you passed encloses all operations that lead from x to y.");return this.tidy("backward",(()=>{const e={};e[r.id]=null==n?function(e){const t=mn($t(e),"float32");return to.makeTensor(t,e,"float32")}(r.shape):n,function(e,t,n,s){for(let r=t.length-1;r>=0;r--){const a=t[r],i=[];if(a.outputs.forEach((t=>{const n=e[t.id];null!=n?i.push(n):i.push(null)})),null==a.gradient)throw new Error(`Cannot compute gradient: gradient function not found for ${a.kernelName}.`);const o=a.gradient(i);for(const t in a.inputs){if(!(t in o))throw new Error(`Cannot backprop through input ${t}. Available gradients found: ${Object.keys(o)}.`);const r=n((()=>o[t]()));if("float32"!==r.dtype)throw new Error(`Error in gradient for op ${a.kernelName}. The gradient of input ${t} must have 'float32' dtype, but has '${r.dtype}'`);const i=a.inputs[t];if(!Kt(r.shape,i.shape))throw new Error(`Error in gradient for op ${a.kernelName}. The gradient of input '${t}' has shape '${r.shape}', which does not match the shape of the input '${i.shape}'`);if(null==e[i.id])e[i.id]=r;else{const t=e[i.id];e[i.id]=s(t,r),t.dispose()}}}}(e,a,(e=>this.tidy(e)),no);const s=t.map((t=>e[t.id]));return 0===this.state.gradientDepth&&(this.state.activeTape.forEach((e=>{for(const t of e.saved)t.dispose()})),this.state.activeTape=null),{value:r,grads:s}}))}customGrad(e){return qt(cn(e),(()=>"The f passed in customGrad(f) must be a function.")),(...t)=>{let n;qt(t.every((e=>e instanceof Mi)),(()=>"The args passed in customGrad(f)(x1, x2,...) must all be tensors"));const s={};t.forEach(((e,t)=>{s[t]=e}));return this.runKernelFunc({forwardFunc:(s,r)=>(n=e(...t,r),qt(n.value instanceof Mi,(()=>"The function f passed in customGrad(f) must return an object where `obj.value` is a tensor")),qt(cn(n.gradFunc),(()=>"The function f passed in customGrad(f) must return an object where `obj.gradFunc` is a function.")),n.value),backwardsFunc:(e,s)=>{const r=n.gradFunc(e,s),a=Array.isArray(r)?r:[r];qt(a.length===t.length,(()=>"The function f passed in customGrad(f) must return an object where `obj.gradFunc` is a function that returns the same number of tensors as inputs passed to f(...).")),qt(a.every((e=>e instanceof Mi)),(()=>"The function f passed in customGrad(f) must return an object where `obj.gradFunc` is a function that returns a list of only tensors."));const i={};return a.forEach(((e,t)=>{i[t]=()=>e})),i},inputs:s})}}readSync(e){return this.state.tensorInfo.get(e).backend.readSync(e)}read(e){return this.state.tensorInfo.get(e).backend.read(e)}readToGPU(e,t){return this.state.tensorInfo.get(e).backend.readToGPU(e,t)}async time(e){const t=fi(),n=await this.backend.time(e);return n.wallMs=fi()-t,n}track(e){return null!=this.state.activeScope&&(e.scopeId=this.state.activeScope.id,this.state.activeScope.track.push(e)),e}get registeredVariables(){return this.state.registeredVariables}reset(){this.pendingBackendInitId++,this.state.dispose(),this.ENV.reset(),this.state=new Qi;for(const e in this.registry)this.disposeRegisteredKernels(e),this.registry[e].dispose(),delete this.registry[e];this.backendName=null,this.backendInstance=null,this.pendingBackendInit=null}}function eo(){const e=In();if(null==e._tfengine){const t=new kn(e);e._tfengine=new Ji(t)}var t;return t=e._tfengine.ENV,_n=t,Oi=()=>e._tfengine,e._tfengine}Ji.nextTensorId=0,Ji.nextVariableId=0;const to=eo();function no(e,t){const n={a:e,b:t};return to.runKernel(Dn,n)}let so;function ro(e){if(void 0!==so)return so;if(e||"undefined"!=typeof navigator&&null!=navigator){if(e||(e=navigator),"ReactNative"===e.product)return!0;const t=e.userAgent||e.vendor||("undefined"!=typeof window?window.opera:"");if(!t){const t=e;return t.userAgentData&&t.userAgentData.mobile}return/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino/i.test(t)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i.test(t.substr(0,4))}return!1}function ao(){return"undefined"!=typeof window&&null!=window.document||"undefined"!=typeof WorkerGlobalScope}const io=Sn();function oo(e,t){let n=e;if(yi(e))return"string"===t?[]:[e.length];if(ji(e)){const t=e.channels||"RGBA";return[e.height,e.width*t.length]}if(Hi(e))return[e.buffer.size/(null==t?4:an(t))];if(!Array.isArray(e))return[];const s=[];for(;Array.isArray(n)||yi(n)&&"string"!==t;)s.push(n.length),n=n[0];return Array.isArray(e)&&Sn().getBool("TENSORLIKE_CHECK_SHAPE_CONSISTENCY")&&lo(e,s,[]),s}function lo(e,t,n){if(n=n||[],!Array.isArray(e)&&!yi(e))return void qt(0===t.length,(()=>`Element arr[${n.join("][")}] is a primitive, but should be an array/TypedArray of ${t[0]} elements`));qt(t.length>0,(()=>`Element arr[${n.join("][")}] should be a primitive, but is an array of ${e.length} elements`)),qt(e.length===t[0],(()=>`Element arr[${n.join("][")}] should have ${t[0]} elements, but has ${e.length} elements`));const s=t.slice(1);for(let t=0;t=0&&(r=s),uo(s,r,t,n),null==e||!yi(e)&&!Array.isArray(e)&&"number"!=typeof e&&"boolean"!=typeof e&&"string"!=typeof e){const s=null==e?"null":e.constructor.name;throw new Error(`Argument '${t}' passed to '${n}' must be a Tensor or TensorLike, but got '${s}'`)}const a=oo(e,r);yi(e)||Array.isArray(e)||(e=[e]);const i="string"!==r?pi(e,r):bi(e,[],!0);return to.makeTensor(i,a,r)}function ho(e,t,n,s="numeric"){if(!Array.isArray(e))throw new Error(`Argument ${t} passed to ${n} must be a \`Tensor[]\` or \`TensorLike[]\``);return e.map(((e,r)=>co(e,`${t}[${r}]`,n,s)))}io.registerFlag("DEBUG",(()=>!1),(e=>{})),io.registerFlag("IS_BROWSER",(()=>ao())),io.registerFlag("IS_NODE",(()=>"undefined"!=typeof process&&void 0!==process.versions&&void 0!==process.versions.node)),io.registerFlag("IS_CHROME",(()=>"undefined"!=typeof navigator&&null!=navigator&&null!=navigator.userAgent&&/Chrome/.test(navigator.userAgent)&&/Google Inc/.test(navigator.vendor))),io.registerFlag("IS_SAFARI",(()=>"undefined"!=typeof navigator&&null!=navigator&&null!=navigator.userAgent&&/Safari/.test(navigator.userAgent)&&/Apple/.test(navigator.vendor))),io.registerFlag("PROD",(()=>!1)),io.registerFlag("TENSORLIKE_CHECK_SHAPE_CONSISTENCY",(()=>io.getBool("DEBUG"))),io.registerFlag("DEPRECATION_WARNINGS_ENABLED",(()=>!0)),io.registerFlag("IS_TEST",(()=>!1)),io.registerFlag("CHECK_COMPUTATION_FOR_ERRORS",(()=>io.getBool("DEBUG"))),io.registerFlag("WRAP_TO_IMAGEBITMAP",(()=>!1)),io.registerFlag("CANVAS2D_WILL_READ_FREQUENTLY_FOR_GPU",(()=>!1)),io.registerFlag("USE_SETTIMEOUTCUSTOM",(()=>!1));const po="__op";function fo(e){const t=Object.keys(e);if(1!==t.length)throw new Error(`Please provide an object with a single key (operation name) mapping to a function. Got an object with ${t.length} keys.`);let n=t[0];const s=e[n];n.endsWith("_")&&(n=n.substring(0,n.length-1)),n+=po;const r=(...e)=>{to.startScope(n);try{const t=s(...e);return xn(t),to.endScope(t),t}catch(e){throw to.endScope(null),e}};return Object.defineProperty(r,"name",{value:n,configurable:!0}),r}const mo=fo({complex_:function(e,t){const n=co(e,"real","complex"),s=co(t,"imag","complex");jt(n.shape,s.shape,`real and imag shapes, ${n.shape} and ${s.shape}, must match in call to tf.complex().`);const r={real:n,imag:s};return to.runKernel(ns,r)}});function go(e,t,n,s){if(null==s)s=un(e);else if("complex64"===s)throw new Error("Cannot construct a complex64 tensor directly. Please use tf.complex(real, imag).");if(Hi(e)||ji(e)){if("float32"!==s&&"int32"!==s)throw new Error(`Creating tensor from GPU data only supports 'float32'|'int32' dtype, while the dtype is ${s}.`);return to.backend.createTensorFromGPUData(e,t||n,s)}if(!yi(e)&&!Array.isArray(e)&&"number"!=typeof e&&"boolean"!=typeof e&&"string"!=typeof e)throw new Error("values passed to tensor(values) must be a number/boolean/string or an array of numbers/booleans/strings, or a TypedArray");if(null!=t){bn(t);const e=$t(t),s=$t(n);qt(e===s,(()=>`Based on the provided shape, [${t}], the tensor should have ${e} values but has ${s}`));for(let e=0;e`Error creating a new Tensor. Inferred shape (${n}) does not match the provided shape (${t}). `))}}return yi(e)||Array.isArray(e)||(e=[e]),t=t||n,e="string"!==s?pi(e,s):bi(e,[],!0),to.makeTensor(e,t,s)}function yo(e,t,n){return go(e,t,oo(e,n),n)}const bo={float32:4,float16:2,int32:4,uint16:2,uint8:1,bool:1,complex64:8};class wo{static join(e){return new wo(e).slice()}constructor(e){if(this.shards=[],this.previousShardIndex=0,null==e)return;if(e instanceof Array||(e=[e]),0===(e=e.map((e=>yi(e)?e.buffer:e))).length)return;this.bufferUniformSize=e[0].byteLength;let t=0;for(let n=0;n=this.byteLength)return-1;if(null!=this.bufferUniformSize)return this.previousShardIndex=Math.floor(e/this.bufferUniformSize),this.previousShardIndex;function t(t){return e=t.end?1:0}if(0===t(this.shards[this.previousShardIndex]))return this.previousShardIndex;const n=function(e,t){let n=0,s=e.length;for(;n<=s;){const r=Math.floor((s-n)/2)+n,a=t(e[r]);if(0===a)return r;a<0?s=r:n=r+1}return-1}(this.shards,t);return-1===n?-1:(this.previousShardIndex=n,this.previousShardIndex)}}function vo(){return to}function xo(){return to.memory()}function Ao(e,t){return to.tidy(e,t)}function ko(e){Xi(e).forEach((e=>e.dispose()))}function Co(e){return to.keep(e)}function So(e,t,n=1){return to.registerBackend(e,t,n)}function Eo(){return to.backend}Di=function(e){Sn().getBool("DEPRECATION_WARNINGS_ENABLED")};const _o=4;async function Io(e,t){const n=[],s=[],r=Array.isArray(e)?e.map((e=>e.name)):Object.keys(e);for(let a=0;a{const t=await o.bytes(),n=t.reduce(((e,t)=>e+t.length),0)+_o*t.length,s=new Uint8Array(n);let r=0;for(let e=0;en.slice(r+e,r+t)));s[e.name]=Ro(e,n.slice(r,r+t)),r+=t}return s}function No(e,t){const n=$t(e.shape);let s;if("quantization"in e){const t=e.quantization;s=bo[t.dtype]}else{if("string"===e.dtype){let e=0;for(let s=0;s{let t=e<<13,n=0;for(;!(8388608&t);)n-=8388608,t<<=1;return t&=-8388609,n+=947912704,t|n},t=new Uint32Array(2048);t[0]=0;for(let n=1;n<1024;n++)t[n]=e(n);for(let e=1024;e<2048;e++)t[e]=939524096+(e-1024<<13);return t}(),t=function(){const e=new Uint32Array(64);e[0]=0,e[31]=1199570944,e[32]=2147483648,e[63]=3347054592;for(let t=1;t<31;t++)e[t]=t<<23;for(let t=33;t<63;t++)e[t]=2147483648+(t-32<<23);return e}(),n=function(){const e=new Uint32Array(64);for(let t=0;t<64;t++)e[t]=1024;return e[0]=e[32]=0,e}();return s=>{const r=new ArrayBuffer(4*s.length),a=new Uint32Array(r);for(let r=0;r>10]+(1023&i)]+t[i>>10];a[r]=o}return new Float32Array(r)}}();i=e(u)}}else{if("int32"!==s)throw new Error(`Unsupported dtype in weight '${n}': ${s}`);if("uint8"!==r.dtype&&"uint16"!==r.dtype)throw new Error(`Unsupported quantization type ${r.dtype} for weight type int32.`);i=new Int32Array(u.length);for(let e=0;e(r=await Do(s,r,t),r.slice(e,t))));r=await Do(s,r,t);const a=r.slice(0,t);r=r.slice(t);const i=Ro(e,a);if(n[e.name]=i,"webgpu"===to.backendName){const e=Eo();"uploadToGPU"in e&&$t(i.shape)>=Sn().get("WEBGPU_CPU_HANDOFF_SIZE_THRESHOLD")&&e.uploadToGPU(i.dataId)}}return n}function Fo(e){if(null===e)throw new Error(`Invalid input value: ${JSON.stringify(e)}`);let t=0;const n=[];e.forEach((e=>{if(t+=e.byteLength,n.push(e.byteLength===e.buffer.byteLength?e:new e.constructor(e)),!(e instanceof Float32Array||e instanceof Int32Array||e instanceof Uint8Array))throw new Error(`Unsupported TypedArray subtype: ${e.constructor.name}`)}));const s=new Uint8Array(t);let r=0;return n.forEach((e=>{s.set(new Uint8Array(e.buffer),r),r+=e.byteLength})),s.buffer}const Bo="undefined"!=typeof Buffer&&("undefined"==typeof Blob||"undefined"==typeof atob||"undefined"==typeof btoa);function zo(e){return Bo?Buffer.byteLength(e,"utf8"):new Blob([e]).size}function Lo(e){return wo.join(e)}function Po(e){for(e=e.trim();e.endsWith("/");)e=e.slice(0,e.length-1);const t=e.split("/");return t[t.length-1]}function Vo(e,t){const n={modelTopology:e.modelTopology,format:e.format,generatedBy:e.generatedBy,convertedBy:e.convertedBy,weightsManifest:t};return null!=e.signature&&(n.signature=e.signature),null!=e.userDefinedMetadata&&(n.userDefinedMetadata=e.userDefinedMetadata),null!=e.modelInitializer&&(n.modelInitializer=e.modelInitializer),null!=e.initializerSignature&&(n.initializerSignature=e.initializerSignature),null!=e.trainingConfig&&(n.trainingConfig=e.trainingConfig),n}function Wo(e,t,n){const s={modelTopology:e.modelTopology,format:e.format,generatedBy:e.generatedBy,convertedBy:e.convertedBy};if(null!=e.trainingConfig&&(s.trainingConfig=e.trainingConfig),null!=e.weightsManifest){if(!t)throw new Error("modelJSON has weightsManifest but weightSpecs is null");if(!n)throw new Error("modelJSON has weightsManifest but weightData is null");s.weightSpecs=t,s.weightData=n}return null!=e.signature&&(s.signature=e.signature),null!=e.userDefinedMetadata&&(s.userDefinedMetadata=e.userDefinedMetadata),null!=e.modelInitializer&&(s.modelInitializer=e.modelInitializer),null!=e.initializerSignature&&(s.initializerSignature=e.initializerSignature),s}async function Uo(e,t){let n,s;return null!=e.weightsManifest&&([n,s]=await t(e.weightsManifest)),Wo(e,n,s)}function Go(e){if(e.modelTopology instanceof ArrayBuffer)throw new Error("Expected JSON model topology, received ArrayBuffer.");return{dateSaved:new Date,modelTopologyType:"JSON",modelTopologyBytes:null==e.modelTopology?0:zo(JSON.stringify(e.modelTopology)),weightSpecsBytes:null==e.weightSpecs?0:zo(JSON.stringify(e.weightSpecs)),weightDataBytes:null==e.weightData?0:new wo(e.weightData).byteLength}}function qo(e){const t=[];for(const n of e)t.push(...n.weights);return t}class jo{constructor(){this.saveRouters=[],this.loadRouters=[]}static getInstance(){return null==jo.instance&&(jo.instance=new jo),jo.instance}static registerSaveRouter(e){jo.getInstance().saveRouters.push(e)}static registerLoadRouter(e){jo.getInstance().loadRouters.push(e)}static getSaveHandlers(e){return jo.getHandlers(e,"save")}static getLoadHandlers(e,t){return jo.getHandlers(e,"load",t)}static getHandlers(e,t,n){const s=[];return("load"===t?jo.getInstance().loadRouters:jo.getInstance().saveRouters).forEach((t=>{const r=t(e,n);null!==r&&s.push(r)})),s}}const Ho=e=>jo.registerSaveRouter(e),$o=e=>jo.registerLoadRouter(e),Ko=e=>jo.getSaveHandlers(e),Xo=(e,t)=>jo.getLoadHandlers(e,t),Zo="tensorflowjs",Yo="models_store",Qo="model_info_store";function Jo(){if(!Sn().getBool("IS_BROWSER"))throw new Error("Failed to obtain IndexedDB factory because the current environmentis not a web browser.");const e="undefined"==typeof window?self:window,t=e.indexedDB||e.mozIndexedDB||e.webkitIndexedDB||e.msIndexedDB||e.shimIndexedDB;if(null==t)throw new Error("The current browser does not appear to support IndexedDB.");return t}function el(e){const t=e.result;t.createObjectStore(Yo,{keyPath:"modelPath"}),t.createObjectStore(Qo,{keyPath:"modelPath"})}class tl{constructor(e){if(this.indexedDB=Jo(),null==e||!e)throw new Error("For IndexedDB, modelPath must not be null, undefined or empty.");this.modelPath=e}async save(e){if(e.modelTopology instanceof ArrayBuffer)throw new Error("BrowserLocalStorage.save() does not support saving model topology in binary formats yet.");return this.databaseAction(this.modelPath,e)}async load(){return this.databaseAction(this.modelPath)}databaseAction(e,t){return new Promise(((e,n)=>{const s=this.indexedDB.open(Zo,1);s.onupgradeneeded=()=>el(s),s.onsuccess=()=>{const r=s.result;if(null==t){const t=r.transaction(Yo,"readonly"),s=t.objectStore(Yo).get(this.modelPath);s.onsuccess=()=>{if(null==s.result)return r.close(),n(new Error(`Cannot find model with path '${this.modelPath}' in IndexedDB.`));e(s.result.modelArtifacts)},s.onerror=e=>(r.close(),n(s.error)),t.oncomplete=()=>r.close()}else{t.weightData=wo.join(t.weightData);const s=Go(t),a=r.transaction(Qo,"readwrite");let i,o,l=a.objectStore(Qo);try{i=l.put({modelPath:this.modelPath,modelArtifactsInfo:s})}catch(e){return n(e)}i.onsuccess=()=>{o=r.transaction(Yo,"readwrite");const i=o.objectStore(Yo);let u;try{u=i.put({modelPath:this.modelPath,modelArtifacts:t,modelArtifactsInfo:s})}catch(e){return n(e)}u.onsuccess=()=>e({modelArtifactsInfo:s}),u.onerror=e=>{l=a.objectStore(Qo);const t=l.delete(this.modelPath);t.onsuccess=()=>(r.close(),n(u.error)),t.onerror=e=>(r.close(),n(u.error))}},i.onerror=e=>(r.close(),n(i.error)),a.oncomplete=()=>{null==o?r.close():o.oncomplete=()=>r.close()}}},s.onerror=e=>n(s.error)}))}}tl.URL_SCHEME="indexeddb://";const nl=e=>{return Sn().getBool("IS_BROWSER")&&!Array.isArray(e)&&e.startsWith(tl.URL_SCHEME)?(t=e.slice(tl.URL_SCHEME.length),new tl(t)):null;var t};jo.registerSaveRouter(nl),jo.registerLoadRouter(nl);class sl{constructor(){this.indexedDB=Jo()}async listModels(){return new Promise(((e,t)=>{const n=this.indexedDB.open(Zo,1);n.onupgradeneeded=()=>el(n),n.onsuccess=()=>{const s=n.result,r=s.transaction(Qo,"readonly"),a=r.objectStore(Qo).getAll();a.onsuccess=()=>{const t={};for(const e of a.result)t[e.modelPath]=e.modelArtifactsInfo;e(t)},a.onerror=e=>(s.close(),t(a.error)),r.oncomplete=()=>s.close()},n.onerror=e=>t(n.error)}))}async removeModel(e){var t;return e=(t=e).startsWith(tl.URL_SCHEME)?t.slice(tl.URL_SCHEME.length):t,new Promise(((t,n)=>{const s=this.indexedDB.open(Zo,1);s.onupgradeneeded=()=>el(s),s.onsuccess=()=>{const r=s.result,a=r.transaction(Qo,"readwrite"),i=a.objectStore(Qo),o=i.get(e);let l;o.onsuccess=()=>{if(null==o.result)return r.close(),n(new Error(`Cannot find model with path '${e}' in IndexedDB.`));{const s=i.delete(e),a=()=>{l=r.transaction(Yo,"readwrite");const s=l.objectStore(Yo).delete(e);s.onsuccess=()=>t(o.result.modelArtifactsInfo),s.onerror=e=>n(o.error)};s.onsuccess=a,s.onerror=e=>(a(),r.close(),n(o.error))}},o.onerror=e=>(r.close(),n(o.error)),a.oncomplete=()=>{null==l?r.close():l.oncomplete=()=>r.close()}},s.onerror=e=>n(s.error)}))}}const rl="/",al="tensorflowjs_models",il="info",ol="model_topology",ll="weight_specs",ul="weight_data",cl="model_metadata";function hl(e){return{info:[al,e,il].join(rl),topology:[al,e,ol].join(rl),weightSpecs:[al,e,ll].join(rl),weightData:[al,e,ul].join(rl),modelMetadata:[al,e,cl].join(rl)}}function dl(e){for(const t of Object.values(e))window.localStorage.removeItem(t)}function pl(e){const t=e.split(rl);if(t.length<3)throw new Error(`Invalid key format: ${e}`);return t.slice(1,t.length-1).join(rl)}class fl{constructor(e){if(!Sn().getBool("IS_BROWSER")||"undefined"==typeof window||void 0===window.localStorage)throw new Error("The current environment does not support local storage.");if(this.LS=window.localStorage,null==e||!e)throw new Error("For local storage, modelPath must not be null, undefined or empty.");this.modelPath=e,this.keys=hl(this.modelPath)}async save(e){if(e.modelTopology instanceof ArrayBuffer)throw new Error("BrowserLocalStorage.save() does not support saving model topology in binary formats yet.");{const t=JSON.stringify(e.modelTopology),n=JSON.stringify(e.weightSpecs),s=Go(e),r=wo.join(e.weightData);try{this.LS.setItem(this.keys.info,JSON.stringify(s)),this.LS.setItem(this.keys.topology,t),this.LS.setItem(this.keys.weightSpecs,n),this.LS.setItem(this.keys.weightData,function(e){if(Bo)return Buffer.from(e).toString("base64");const t=new Uint8Array(e);let n="";for(let e=0,s=t.length;e{return Sn().getBool("IS_BROWSER")&&!Array.isArray(e)&&e.startsWith(fl.URL_SCHEME)?(t=e.slice(fl.URL_SCHEME.length),new fl(t)):null;var t};jo.registerSaveRouter(ml),jo.registerLoadRouter(ml);class gl{constructor(){qt(Sn().getBool("IS_BROWSER"),(()=>"Current environment is not a web browser")),qt("undefined"==typeof window||void 0!==window.localStorage,(()=>"Current browser does not appear to support localStorage")),this.LS=window.localStorage}async listModels(){const e={},t=al+rl,n=rl+il;for(let s=0;s"scheme must not be undefined or null.")),e.endsWith(yl)&&(e=e.slice(0,e.indexOf(yl))),qt(e.length>0,(()=>"scheme must not be an empty string."));const n=bl.getInstance();qt(null==n.managers[e],(()=>`A model store manager is already registered for scheme '${e}'.`)),n.managers[e]=t}static getManager(e){const t=bl.getInstance().managers[e];if(null==t)throw new Error(`Cannot find model manager for scheme '${e}'`);return t}static getSchemes(){return Object.keys(bl.getInstance().managers)}}function wl(e){if(-1===e.indexOf(yl))throw new Error(`The url string provided does not contain a scheme. Supported schemes are: ${bl.getSchemes().join(",")}`);return{scheme:e.split(yl)[0],path:e.split(yl)[1]}}async function vl(e,t,n=!1){qt(e!==t,(()=>`Old path and new path are the same: '${e}'`));const s=jo.getLoadHandlers(e);qt(s.length>0,(()=>`Copying failed because no load handler is found for source URL ${e}.`)),qt(s.length<2,(()=>`Copying failed because more than one (${s.length}) load handlers for source URL ${e}.`));const r=s[0],a=jo.getSaveHandlers(t);qt(a.length>0,(()=>`Copying failed because no save handler is found for destination URL ${t}.`)),qt(a.length<2,(()=>`Copying failed because more than one (${s.length}) save handlers for destination URL ${t}.`));const i=a[0],o=wl(e).scheme,l=wl(e).path,u=o===wl(e).scheme,c=await r.load();n&&u&&await bl.getManager(o).removeModel(l);const h=await i.save(c);return n&&!u&&await bl.getManager(o).removeModel(l),h.modelArtifactsInfo}async function xl(){const e=bl.getSchemes(),t={};for(const n of e){const e=await bl.getManager(n).listModels();for(const s in e){t[n+yl+s]=e[s]}}return t}async function Al(e){const t=wl(e);return bl.getManager(t.scheme).removeModel(t.path)}async function kl(e,t){return vl(e,t,!1)}async function Cl(e,t){return vl(e,t,!0)}class Sl{constructor(){this.messageName="setTimeoutCustom",this.functionRefs=[],this.handledMessageCount=0,this.hasEventListener=!1}fetch(e,t){return fetch(e,t)}now(){return performance.now()}encode(e,t){if("utf-8"!==t&&"utf8"!==t)throw new Error(`Browser's encoder only supports utf-8, but got ${t}`);return null==this.textEncoder&&(this.textEncoder=new TextEncoder),this.textEncoder.encode(e)}decode(e,t){return new TextDecoder(t).decode(e)}setTimeoutCustom(e,t){"undefined"!=typeof window&&Sn().getBool("USE_SETTIMEOUTCUSTOM")?(this.functionRefs.push(e),setTimeout((()=>{window.postMessage({name:this.messageName,index:this.functionRefs.length-1},"*")}),t),this.hasEventListener||(this.hasEventListener=!0,window.addEventListener("message",(e=>{if(e.source===window&&e.data.name===this.messageName){e.stopPropagation();(0,this.functionRefs[e.data.index])(),this.handledMessageCount++,this.handledMessageCount===this.functionRefs.length&&(this.functionRefs=[],this.handledMessageCount=0)}}),!0))):setTimeout(e,t)}isTypedArray(e){return Ya(e)}}if(Sn().get("IS_BROWSER")){Sn().setPlatform("browser",new Sl);try{bl.registerManager(fl.URL_SCHEME,new gl)}catch(e){}try{bl.registerManager(tl.URL_SCHEME,new sl)}catch(e){}}const El=()=>__webpack_require__(8273);let _l;class Il{constructor(){this.util=__webpack_require__(9830),this.textEncoder=new this.util.TextEncoder}fetch(e,t){return null!=Sn().global.fetch?Sn().global.fetch(e,t):(null==_l&&(_l=El()),_l(e,t))}now(){const e=process.hrtime();return 1e3*e[0]+e[1]/1e6}encode(e,t){if("utf-8"!==t&&"utf8"!==t)throw new Error(`Node built-in encoder only supports utf-8, but got ${t}`);return this.textEncoder.encode(e)}decode(e,t){return 0===e.length?"":new this.util.TextDecoder(t).decode(e)}isTypedArray(e){return this.util.types.isFloat32Array(e)||this.util.types.isInt32Array(e)||this.util.types.isUint8Array(e)||this.util.types.isUint8ClampedArray(e)}}function Tl(e,t="float32",n){return t=t||"float32",bn(e),new Ni(e,t,n)}Sn().get("IS_NODE")&&!Sn().get("IS_BROWSER")&&Sn().setPlatform("node",new Il);const Nl=fo({cast_:function(e,t){const n=co(e,"x","cast");if(!function(e){return"bool"===e||"complex64"===e||"float32"===e||"int32"===e||"string"===e}(t))throw new Error(`Failed to cast to unknown dtype ${t}`);if("string"===t&&"string"!==n.dtype||"string"!==t&&"string"===n.dtype)throw new Error("Only strings can be casted to strings");const s={x:n},r={dtype:t};return to.runKernel(Jn,s,r)}});const Ol=fo({clone_:function(e){const t={x:co(e,"x","clone","string_or_numeric")};return to.runKernel(js,t)}});function Rl(e,t=!1){}eo();Ri={buffer:Tl,cast:Nl,clone:Ol,print:Rl};const Dl=fo({add_:function(e,t){let n=co(e,"a","add"),s=co(t,"b","add");[n,s]=$i(n,s);const r={a:n,b:s};return to.runKernel(Dn,r)}});const Ml=fo({floorDiv_:function(e,t){let n=co(e,"a","floorDiv"),s=co(t,"b","floorDiv");[n,s]=$i(n,s);const r={a:n,b:s};return to.runKernel(Ps,r)}});const Fl=fo({div_:function(e,t){let n=co(e,"a","div"),s=co(t,"b","div");if([n,s]=$i(n,s),"int32"===n.dtype&&"int32"===s.dtype)return Ml(n,s);const r={a:n,b:s};return to.runKernel(Es,r,{})}});const Bl=fo({mul_:function(e,t){let n=co(e,"a","mul"),s=co(t,"b","mul");[n,s]=$i(n,s);const r={a:n,b:s};return to.runKernel(xr,r)}});const zl=fo({sqrt_:function(e){const t={x:co(e,"x","sqrt","float32")};return to.runKernel(oa,t)}});const Ll=fo({square_:function(e){const t=co(e,"x","square");return to.runKernel("Square",{x:t},{})}});const Pl=fo({zerosLike_:function(e){const t={x:co(e,"x","zerosLike")};return to.runKernel(Ma,t)}});function Vl(e){return to.customGrad(e)}function Wl(e,t){if((yi(e)&&"string"!==t||Array.isArray(e))&&"complex64"!==t)throw new Error("Error creating a new Scalar: value must be a primitive (number|boolean|string)");if("string"===t&&yi(e)&&!(e instanceof Uint8Array))throw new Error("When making a scalar from encoded string, the value must be `Uint8Array`.");return go(e,[],[],t)}const Ul=new Map,Gl=new Map;class ql{getClassName(){return this.constructor.className}static fromConfig(e,t){return new e(t)}}class jl{constructor(){this.classNameMap={}}static getMap(){return null==jl.instance&&(jl.instance=new jl),jl.instance}static register(e){jl.getMap().classNameMap[e.className]=[e,e.fromConfig]}}function Hl(e,t,n){qt(null!=e.className,(()=>"Class being registered does not have the static className property defined.")),qt("string"==typeof e.className,(()=>"className is required to be a string, but got type "+typeof e.className)),qt(e.className.length>0,(()=>"Class being registered has an empty-string as its className, which is disallowed.")),void 0===t&&(t="Custom"),void 0===n&&(n=e.className);const s=t+">"+n;return jl.register(e),Ul.set(s,e),Gl.set(e,s),e}class $l extends ql{minimize(e,t=!1,n){const{value:s,grads:r}=this.computeGradients(e,n);if(null!=n){const e=n.map((e=>({name:e.name,tensor:r[e.name]})));this.applyGradients(e)}else this.applyGradients(r);return ko(r),t?s:(s.dispose(),null)}get iterations(){return null==this.iterations_&&(this.iterations_=0),this.iterations_}incrementIterations(){this.iterations_=this.iterations+1}computeGradients(e,t){return function(e,t){qt(cn(e),(()=>"The f passed in variableGrads(f) must be a function")),qt(null==t||Array.isArray(t)&&t.every((e=>e instanceof Bi)),(()=>"The varList passed in variableGrads(f, varList) must be an array of variables"));const n=null!=t;if(!n){t=[];for(const e in to.registeredVariables)t.push(to.registeredVariables[e])}const s=n?t.filter((e=>!e.trainable)):null,r=t.length;t=t.filter((e=>e.trainable)),qt(t.length>0,(()=>`variableGrads() expects at least one of the input variables to be trainable, but none of the ${r} variables is trainable.`));const{value:a,grads:i}=to.gradients(e,t,null,!0);qt(i.some((e=>null!=e)),(()=>"Cannot find a connection between any variable and the result of the loss function y=f(x). Please make sure the operations that use variables are inside the function f passed to minimize().")),qt(0===a.rank,(()=>`The f passed in variableGrads(f) must return a scalar, but it returned a rank-${a.rank} tensor`));const o={};return t.forEach(((e,t)=>{null!=i[t]&&(o[e.name]=i[t])})),null!=s&&s.forEach((e=>o[e.name]=null)),{value:a,grads:o}}(e,t)}dispose(){null!=this.iterations_&&ko(this.iterations_)}async saveIterations(){return null==this.iterations_&&(this.iterations_=0),{name:"iter",tensor:Wl(this.iterations_,"int32")}}async getWeights(){throw new Error("getWeights() is not implemented for this optimizer yet.")}async setWeights(e){throw new Error(`setWeights() is not implemented for this optimizer class ${this.getClassName()}`)}async extractIterations(e){return this.iterations_=(await e[0].tensor.data())[0],e.slice(1)}}Object.defineProperty($l,Symbol.hasInstance,{value:e=>null!=e.minimize&&null!=e.computeGradients&&null!=e.applyGradients});class Kl extends $l{static get className(){return"Adadelta"}constructor(e,t,n=null){super(),this.learningRate=e,this.rho=t,this.epsilon=n,this.accumulatedGrads=[],this.accumulatedUpdates=[],null==n&&(this.epsilon=to.backend.epsilon())}applyGradients(e){(Array.isArray(e)?e.map((e=>e.name)):Object.keys(e)).forEach(((t,n)=>{const s=to.registeredVariables[t],r=!1;null==this.accumulatedGrads[n]&&(this.accumulatedGrads[n]={originalName:`${t}/accum_grad`,variable:Ao((()=>Pl(s).variable(r)))}),null==this.accumulatedUpdates[n]&&(this.accumulatedUpdates[n]={originalName:`${t}/accum_var`,variable:Ao((()=>Pl(s).variable(r)))});const a=Array.isArray(e)?e[n].tensor:e[t];if(null==a)return;const i=this.accumulatedGrads[n].variable,o=this.accumulatedUpdates[n].variable;Ao((()=>{const e=Dl(Bl(i,this.rho),Bl(Ll(a),1-this.rho)),t=Bl(Fl(zl(Dl(o,this.epsilon)),zl(Dl(i,this.epsilon))),a),n=Dl(Bl(o,this.rho),Bl(Ll(t),1-this.rho));i.assign(e),o.assign(n);const r=Dl(Bl(t,-this.learningRate),s);s.assign(r)}))})),this.incrementIterations()}dispose(){null!=this.accumulatedUpdates&&(ko(this.accumulatedGrads.map((e=>e.variable))),ko(this.accumulatedUpdates.map((e=>e.variable))))}async getWeights(){const e=[...this.accumulatedGrads,...this.accumulatedUpdates];return[await this.saveIterations()].concat(e.map((e=>({name:e.originalName,tensor:e.variable}))))}async setWeights(e){const t=(e=await this.extractIterations(e)).length/2,n=!1;this.accumulatedGrads=e.slice(0,t).map((e=>({originalName:e.name,variable:e.tensor.variable(n)}))),this.accumulatedUpdates=e.slice(t,2*t).map((e=>({originalName:e.name,variable:e.tensor.variable(n)})))}getConfig(){return{learningRate:this.learningRate,rho:this.rho,epsilon:this.epsilon}}static fromConfig(e,t){return new e(t.learningRate,t.rho,t.epsilon)}}function Xl(e,t,n){bn(e);const s={shape:e,value:t,dtype:n=n||un(t)};return to.runKernel(Bs,{},s)}class Zl extends $l{static get className(){return"Adagrad"}constructor(e,t=.1){super(),this.learningRate=e,this.initialAccumulatorValue=t,this.accumulatedGrads=[]}applyGradients(e){(Array.isArray(e)?e.map((e=>e.name)):Object.keys(e)).forEach(((t,n)=>{const s=to.registeredVariables[t];if(null==this.accumulatedGrads[n]){const e=!1;this.accumulatedGrads[n]={originalName:`${t}/accumulator`,variable:Ao((()=>Xl(s.shape,this.initialAccumulatorValue).variable(e)))}}const r=Array.isArray(e)?e[n].tensor:e[t];if(null==r)return;const a=this.accumulatedGrads[n].variable;Ao((()=>{const e=Dl(a,Ll(r));a.assign(e);const t=Dl(Bl(Fl(r,zl(Dl(e,to.backend.epsilon()))),-this.learningRate),s);s.assign(t)}))})),this.incrementIterations()}dispose(){null!=this.accumulatedGrads&&ko(this.accumulatedGrads.map((e=>e.variable)))}async getWeights(){return[await this.saveIterations()].concat(this.accumulatedGrads.map((e=>({name:e.originalName,tensor:e.variable}))))}async setWeights(e){e=await this.extractIterations(e);this.accumulatedGrads=e.map((e=>({originalName:e.name,variable:e.tensor.variable(false)})))}getConfig(){return{learningRate:this.learningRate,initialAccumulatorValue:this.initialAccumulatorValue}}static fromConfig(e,t){return new e(t.learningRate,t.initialAccumulatorValue)}}const Yl=fo({pow_:function(e,t){let n=co(e,"base","pow"),s=co(t,"exp","pow");[n,s]=$i(n,s);const r={a:n,b:s};return to.runKernel(Or,r)}});const Ql=fo({sub_:function(e,t){let n=co(e,"a","sub"),s=co(t,"b","sub");[n,s]=$i(n,s);const r={a:n,b:s};return to.runKernel(Ca,r)}});class Jl extends $l{static get className(){return"Adam"}constructor(e,t,n,s=null){super(),this.learningRate=e,this.beta1=t,this.beta2=n,this.epsilon=s,this.accumulatedFirstMoment=[],this.accumulatedSecondMoment=[],Ao((()=>{this.accBeta1=Wl(t).variable(),this.accBeta2=Wl(n).variable()})),null==s&&(this.epsilon=to.backend.epsilon())}applyGradients(e){const t=Array.isArray(e)?e.map((e=>e.name)):Object.keys(e);Ao((()=>{const n=Ql(1,this.accBeta1),s=Ql(1,this.accBeta2);t.forEach(((t,r)=>{const a=to.registeredVariables[t],i=!1;null==this.accumulatedFirstMoment[r]&&(this.accumulatedFirstMoment[r]={originalName:`${t}/m`,variable:Ao((()=>Pl(a).variable(i)))}),null==this.accumulatedSecondMoment[r]&&(this.accumulatedSecondMoment[r]={originalName:`${t}/v`,variable:Ao((()=>Pl(a).variable(i)))});const o=Array.isArray(e)?e[r].tensor:e[t];if(null==o)return;const l=this.accumulatedFirstMoment[r].variable,u=this.accumulatedSecondMoment[r].variable,c=Dl(Bl(l,this.beta1),Bl(o,1-this.beta1)),h=Dl(Bl(u,this.beta2),Bl(Ll(o),1-this.beta2)),d=Fl(c,n),p=Fl(h,s);l.assign(c),u.assign(h);const f=Dl(Bl(Fl(d,Dl(zl(p),this.epsilon)),-this.learningRate),a);a.assign(f)})),this.accBeta1.assign(Bl(this.accBeta1,this.beta1)),this.accBeta2.assign(Bl(this.accBeta2,this.beta2))})),this.incrementIterations()}dispose(){this.accBeta1.dispose(),this.accBeta2.dispose(),null!=this.accumulatedFirstMoment&&ko(this.accumulatedFirstMoment.map((e=>e.variable))),null!=this.accumulatedSecondMoment&&ko(this.accumulatedSecondMoment.map((e=>e.variable)))}async getWeights(){const e=[...this.accumulatedFirstMoment,...this.accumulatedSecondMoment];return[await this.saveIterations()].concat(e.map((e=>({name:e.originalName,tensor:e.variable}))))}async setWeights(e){e=await this.extractIterations(e),Ao((()=>{this.accBeta1.assign(Yl(this.beta1,this.iterations_+1)),this.accBeta2.assign(Yl(this.beta2,this.iterations_+1))}));const t=e.length/2,n=!1;this.accumulatedFirstMoment=e.slice(0,t).map((e=>({originalName:e.name,variable:e.tensor.variable(n)}))),this.accumulatedSecondMoment=e.slice(t,2*t).map((e=>({originalName:e.name,variable:e.tensor.variable(n)})))}getConfig(){return{learningRate:this.learningRate,beta1:this.beta1,beta2:this.beta2,epsilon:this.epsilon}}static fromConfig(e,t){return new e(t.learningRate,t.beta1,t.beta2,t.epsilon)}}const eu=fo({abs_:function(e){const t=co(e,"x","abs");if("complex64"===t.dtype){const e={x:t};return to.runKernel(ss,e)}{const e={x:t};return to.runKernel(Nn,e)}}});function tu(e,t){const n=e.length,s=[];for(let r=0;r1&&1===i&&s.unshift(a)}return s}function nu(e,t){const n=[];for(let s=0;s1)&&n.unshift(a)}return n}function su(e,t){const n=Math.max(e.length,t.length),s=new Array(n);for(let r=0;r{this.iteration=Wl(0).variable(),this.accBeta1=Wl(t).variable()})),null==s&&(this.epsilon=to.backend.epsilon())}applyGradients(e){const t=Array.isArray(e)?e.map((e=>e.name)):Object.keys(e);Ao((()=>{const n=Ql(1,this.accBeta1),s=Fl(-this.learningRate,Dl(Bl(this.iteration,this.decay),1));t.forEach(((t,r)=>{const a=to.registeredVariables[t],i=!1;null==this.accumulatedFirstMoment[r]&&(this.accumulatedFirstMoment[r]={originalName:`${t}/m`,variable:Pl(a).variable(i)}),null==this.accumulatedWeightedInfNorm[r]&&(this.accumulatedWeightedInfNorm[r]={originalName:`${t}/v`,variable:Pl(a).variable(i)});const o=Array.isArray(e)?e[r].tensor:e[t];if(null==o)return;const l=this.accumulatedFirstMoment[r].variable,u=this.accumulatedWeightedInfNorm[r].variable,c=Dl(Bl(l,this.beta1),Bl(o,1-this.beta1)),h=Bl(u,this.beta2),d=eu(o),p=ru(h,d);l.assign(c),u.assign(p);const f=Dl(Bl(Fl(s,n),Fl(c,Dl(p,this.epsilon))),a);a.assign(f)})),this.iteration.assign(Dl(this.iteration,1)),this.accBeta1.assign(Bl(this.accBeta1,this.beta1))})),this.incrementIterations()}dispose(){this.accBeta1.dispose(),this.iteration.dispose(),null!=this.accumulatedFirstMoment&&ko(this.accumulatedFirstMoment.map((e=>e.variable))),null!=this.accumulatedWeightedInfNorm&&ko(this.accumulatedWeightedInfNorm.map((e=>e.variable)))}async getWeights(){throw new Error("getWeights() is not implemented for Adamax yet.")}async setWeights(e){throw new Error("setWeights() is not implemented for Adamax yet.")}getConfig(){return{learningRate:this.learningRate,beta1:this.beta1,beta2:this.beta2,epsilon:this.epsilon,decay:this.decay}}static fromConfig(e,t){return new e(t.learningRate,t.beta1,t.beta2,t.epsilon,t.decay)}}class iu extends $l{static get className(){return"SGD"}constructor(e){super(),this.learningRate=e,this.setLearningRate(e)}applyGradients(e){(Array.isArray(e)?e.map((e=>e.name)):Object.keys(e)).forEach(((t,n)=>{const s=Array.isArray(e)?e[n].tensor:e[t];if(null==s)return;const r=to.registeredVariables[t];Ao((()=>{const e=Dl(Bl(this.c,s),r);r.assign(e)}))})),this.incrementIterations()}setLearningRate(e){this.learningRate=e,null!=this.c&&this.c.dispose(),this.c=Co(Wl(-e))}dispose(){this.c.dispose()}async getWeights(){return[await this.saveIterations()]}async setWeights(e){if(0!==(e=await this.extractIterations(e)).length)throw new Error("SGD optimizer does not have settable weights.")}getConfig(){return{learningRate:this.learningRate}}static fromConfig(e,t){return new e(t.learningRate)}}class ou extends iu{static get className(){return"Momentum"}constructor(e,t,n=!1){super(e),this.learningRate=e,this.momentum=t,this.useNesterov=n,this.accumulations=[],this.m=Wl(this.momentum)}applyGradients(e){(Array.isArray(e)?e.map((e=>e.name)):Object.keys(e)).forEach(((t,n)=>{const s=to.registeredVariables[t];if(null==this.accumulations[n]){const e=!1;this.accumulations[n]={originalName:`${t}/momentum`,variable:Ao((()=>Pl(s).variable(e)))}}const r=this.accumulations[n].variable,a=Array.isArray(e)?e[n].tensor:e[t];null!=a&&Ao((()=>{let e;const t=Dl(Bl(this.m,r),a);e=this.useNesterov?Dl(Bl(this.c,Dl(a,Bl(t,this.m))),s):Dl(Bl(this.c,t),s),r.assign(t),s.assign(e)}))})),this.incrementIterations()}dispose(){this.m.dispose(),null!=this.accumulations&&ko(this.accumulations.map((e=>e.variable)))}setMomentum(e){this.momentum=e}async getWeights(){return[await this.saveIterations()].concat(this.accumulations.map((e=>({name:e.originalName,tensor:e.variable}))))}async setWeights(e){e=await this.extractIterations(e);this.accumulations=e.map((e=>({originalName:e.name,variable:e.tensor.variable(false)})))}getConfig(){return{learningRate:this.learningRate,momentum:this.momentum,useNesterov:this.useNesterov}}static fromConfig(e,t){return new e(t.learningRate,t.momentum,t.useNesterov)}}class lu extends $l{static get className(){return"RMSProp"}constructor(e,t=.9,n=0,s=null,r=!1){if(super(),this.learningRate=e,this.decay=t,this.momentum=n,this.epsilon=s,this.accumulatedMeanSquares=[],this.accumulatedMoments=[],this.accumulatedMeanGrads=[],this.centered=r,null==s&&(this.epsilon=to.backend.epsilon()),null==e)throw new Error("learningRate for RMSPropOptimizer must be defined.")}applyGradients(e){(Array.isArray(e)?e.map((e=>e.name)):Object.keys(e)).forEach(((t,n)=>{const s=to.registeredVariables[t],r=!1;null==this.accumulatedMeanSquares[n]&&(this.accumulatedMeanSquares[n]={originalName:`${t}/rms`,variable:Ao((()=>Pl(s).variable(r)))}),null==this.accumulatedMoments[n]&&(this.accumulatedMoments[n]={originalName:`${t}/momentum`,variable:Ao((()=>Pl(s).variable(r)))}),null==this.accumulatedMeanGrads[n]&&this.centered&&(this.accumulatedMeanGrads[n]={originalName:`${t}/mg`,variable:Ao((()=>Pl(s).variable(r)))});const a=Array.isArray(e)?e[n].tensor:e[t];if(null==a)return;const i=this.accumulatedMeanSquares[n].variable,o=this.accumulatedMoments[n].variable;Ao((()=>{const e=Dl(Bl(i,this.decay),Bl(Ll(a),1-this.decay));if(this.centered){const t=this.accumulatedMeanGrads[n].variable,r=Dl(Bl(t,this.decay),Bl(a,1-this.decay)),l=Fl(Bl(a,this.learningRate),zl(Ql(e,Dl(Ll(r),this.epsilon)))),u=Dl(Bl(o,this.momentum),l);i.assign(e),t.assign(r),o.assign(u);const c=Ql(s,u);s.assign(c)}else{const e=Dl(Bl(i,this.decay),Bl(Ll(a),1-this.decay)),t=Dl(Bl(o,this.momentum),Fl(Bl(a,this.learningRate),zl(Dl(e,this.epsilon))));i.assign(e),o.assign(t);const n=Ql(s,t);s.assign(n)}}))})),this.incrementIterations()}dispose(){null!=this.accumulatedMeanSquares&&ko(this.accumulatedMeanSquares.map((e=>e.variable))),null!=this.accumulatedMeanGrads&&this.centered&&ko(this.accumulatedMeanGrads.map((e=>e.variable))),null!=this.accumulatedMoments&&ko(this.accumulatedMoments.map((e=>e.variable)))}async getWeights(){const e=[...this.accumulatedMeanSquares,...this.accumulatedMoments];return this.centered&&e.push(...this.accumulatedMeanGrads),[await this.saveIterations()].concat(e.map((e=>({name:e.originalName,tensor:e.variable}))))}async setWeights(e){e=await this.extractIterations(e);const t=this.centered?e.length/3:e.length/2,n=!1;this.accumulatedMeanSquares=e.slice(0,t).map((e=>({originalName:e.name,variable:e.tensor.variable(n)}))),this.accumulatedMoments=e.slice(t,2*t).map((e=>({originalName:e.name,variable:e.tensor.variable(n)}))),this.centered&&(this.accumulatedMeanGrads=e.slice(2*t,3*t).map((e=>({originalName:e.name,variable:e.tensor.variable(n)}))))}getConfig(){return{learningRate:this.learningRate,decay:this.decay,momentum:this.momentum,epsilon:this.epsilon,centered:this.centered}}static fromConfig(e,t){return new e(t.learningRate,t.decay,t.momentum,t.epsilon,t.centered)}}const uu=[Kl,Zl,Jl,au,ou,lu,iu];function cu(e){return new Promise((e=>setTimeout(e))).then(e)}class hu{constructor(e){if(!Sn().getBool("IS_BROWSER"))throw new Error("browserDownloads() cannot proceed because the current environment is not a browser.");e.startsWith(hu.URL_SCHEME)&&(e=e.slice(hu.URL_SCHEME.length)),null!=e&&0!==e.length||(e="model"),this.modelJsonFileName=e+".json",this.weightDataFileName=e+".weights.bin"}async save(e){if("undefined"==typeof document)throw new Error("Browser downloads are not supported in this environment since `document` is not present");const t=wo.join(e.weightData),n=window.URL.createObjectURL(new Blob([t],{type:"application/octet-stream"}));if(e.modelTopology instanceof ArrayBuffer)throw new Error("BrowserDownloads.save() does not support saving model topology in binary formats yet.");{const t=Vo(e,[{paths:["./"+this.weightDataFileName],weights:e.weightSpecs}]),s=window.URL.createObjectURL(new Blob([JSON.stringify(t)],{type:"application/json"})),r=null==this.modelJsonAnchor?document.createElement("a"):this.modelJsonAnchor;if(r.download=this.modelJsonFileName,r.href=s,await cu((()=>r.dispatchEvent(new MouseEvent("click")))),null!=e.weightData){const e=null==this.weightDataAnchor?document.createElement("a"):this.weightDataAnchor;e.download=this.weightDataFileName,e.href=n,await cu((()=>e.dispatchEvent(new MouseEvent("click"))))}return{modelArtifactsInfo:Go(e)}}}}hu.URL_SCHEME="downloads://";class du{constructor(e){if(null==e||e.length<1)throw new Error(`When calling browserFiles, at least 1 file is required, but received ${e}`);this.jsonFile=e[0],this.weightsFiles=e.slice(1)}async load(){return new Promise(((e,t)=>{const n=new FileReader;n.onload=n=>{const s=JSON.parse(n.target.result),r=s.modelTopology;if(null==r)return void t(new Error(`modelTopology field is missing from file ${this.jsonFile.name}`));if(null==s.weightsManifest)return void t(new Error(`weightManifest field is missing from file ${this.jsonFile.name}`));if(0===this.weightsFiles.length)return void e({modelTopology:r});const a=Uo(s,(e=>this.loadWeights(e)));e(a)},n.onerror=e=>t(`Failed to read model topology and weights manifest JSON from file '${this.jsonFile.name}'. BrowserFiles supports loading Keras-style tf.Model artifacts only.`),n.readAsText(this.jsonFile)}))}loadWeights(e){const t=[],n=[];for(const s of e)t.push(...s.weights),n.push(...s.paths);const s=this.checkManifestAndWeightFiles(e),r=n.map((e=>this.loadWeightsFile(e,s[e])));return Promise.all(r).then((e=>[t,e]))}loadWeightsFile(e,t){return new Promise(((n,s)=>{const r=new FileReader;r.onload=e=>{const t=e.target.result;n(t)},r.onerror=t=>s(`Failed to weights data from file of path '${e}'.`),r.readAsArrayBuffer(t)}))}checkManifestAndWeightFiles(e){const t=[],n=this.weightsFiles.map((e=>Po(e.name))),s={};for(const r of e)r.paths.forEach((e=>{const r=Po(e);if(-1!==t.indexOf(r))throw new Error(`Duplicate file basename found in weights manifest: '${r}'`);if(t.push(r),-1===n.indexOf(r))throw new Error(`Weight file with basename '${r}' is not provided.`);s[e]=this.weightsFiles[n.indexOf(r)]}));if(t.length!==this.weightsFiles.length)throw new Error(`Mismatch in the number of files in weights manifest (${t.length}) and the number of weight files provided (${this.weightsFiles.length}).`);return s}}function pu(e){return new du(e)}function fu(e,t,n,s){!function(e){qt(null!=e&&Array.isArray(e)&&e.length>0,(()=>"promises must be a none empty array"))}(e),function(e,t){qt(e>=0&&e<=1,(()=>`Progress fraction must be in range [0, 1], but got startFraction ${e}`)),qt(t>=0&&t<=1,(()=>`Progress fraction must be in range [0, 1], but got endFraction ${t}`)),qt(t>=e,(()=>`startFraction must be no more than endFraction, but got startFraction ${e} and endFraction ${t}`))}(n=null==n?0:n,s=null==s?1:s);let r=0;return Promise.all(e.map((a=>(a.then((a=>{const i=n+ ++r/e.length*(s-n);return t(i),a})),a))))}async function mu(e,t){null==t&&(t={});const n=null==t.fetchFunc?Sn().platform.fetch:t.fetchFunc,s=e.map((e=>n(e,t.requestInit,{isBinary:!0}))),r=(null==t.onProgress?await Promise.all(s):await fu(s,t.onProgress,0,.5)).map((e=>e.arrayBuffer()));return null==t.onProgress?await Promise.all(r):await fu(r,t.onProgress,.5,1)}async function gu(e,t="",n,s){return yu((e=>mu(e,{requestInit:s})))(e,t,n)}function yu(e){return async(t,n="",s)=>{const r=t.map((()=>!1)),a={},i=null!=s?s.map((()=>!1)):[],o=[];if(t.forEach(((e,t)=>{let n=0;e.weights.forEach((e=>{const l="quantization"in e?e.quantization.dtype:e.dtype,u=bo[l]*$t(e.shape),c=()=>{r[t]=!0,null==a[t]&&(a[t]=[]),a[t].push({manifestEntry:e,groupOffset:n,sizeBytes:u})};null!=s?s.forEach(((t,n)=>{t===e.name&&(c(),i[n]=!0)})):c(),o.push(e.name),n+=u}))})),!i.every((e=>e))){const e=s.filter(((e,t)=>!i[t]));throw new Error(`Could not find weights in manifest with names: ${e.join(", ")}. \nManifest JSON has weights with names: ${o.join(", ")}.`)}const l=r.reduce(((e,t,n)=>(t&&e.push(n),e)),[]),u=[];l.forEach((e=>{t[e].paths.forEach((e=>{const t=n+(n.endsWith("/")?"":"/")+e;u.push(t)}))}));const c=await e(u),h={};let d=0;return l.forEach((e=>{const n=t[e].paths.length,s=new wo(c.slice(d,d+n));a[e].forEach((e=>{const t=To(s.slice(e.groupOffset,e.groupOffset+e.sizeBytes),[e.manifestEntry]);for(const e in t)h[e]=t[e]})),d+=n})),h}}jo.registerSaveRouter((e=>Sn().getBool("IS_BROWSER")&&!Array.isArray(e)&&e.startsWith(hu.URL_SCHEME)?function(e="model"){return new hu(e)}(e.slice(hu.URL_SCHEME.length)):null));class bu{constructor(e,t){if(this.DEFAULT_METHOD="POST",null==t&&(t={}),this.weightPathPrefix=t.weightPathPrefix,this.weightUrlConverter=t.weightUrlConverter,null!=t.fetchFunc?(qt("function"==typeof t.fetchFunc,(()=>"Must pass a function that matches the signature of `fetch` (see https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API)")),this.fetch=t.fetchFunc):this.fetch=Sn().platform.fetch,qt(null!=e&&e.length>0,(()=>"URL path for http must not be null, undefined or empty.")),Array.isArray(e)&&qt(2===e.length,(()=>`URL paths for http must have a length of 2, (actual length is ${e.length}).`)),this.path=e,null!=t.requestInit&&null!=t.requestInit.body)throw new Error("requestInit is expected to have no pre-existing body, but has one.");this.requestInit=t.requestInit||{},this.loadOptions=t}async save(e){if(e.modelTopology instanceof ArrayBuffer)throw new Error("BrowserHTTPRequest.save() does not support saving model topology in binary formats yet.");const t=Object.assign({method:this.DEFAULT_METHOD},this.requestInit);t.body=new FormData;const n=Vo(e,[{paths:["./model.weights.bin"],weights:e.weightSpecs}]);if(t.body.append("model.json",new Blob([JSON.stringify(n)],{type:"application/json"}),"model.json"),null!=e.weightData){const n=wo.join(e.weightData);t.body.append("model.weights.bin",new Blob([n],{type:"application/octet-stream"}),"model.weights.bin")}const s=await this.fetch(this.path,t);if(s.ok)return{modelArtifactsInfo:Go(e),responses:[s]};throw new Error(`BrowserHTTPRequest.save() failed due to HTTP response status ${s.status}.`)}async loadModelJSON(){const e=await this.fetch(this.path,this.requestInit);if(!e.ok)throw new Error(`Request to ${this.path} failed with status code ${e.status}. Please verify this URL points to the model JSON of the model to load.`);let t;try{t=await e.json()}catch(e){let t=`Failed to parse model JSON of response from ${this.path}.`;throw this.path.endsWith(".pb")?t+=" Your path contains a .pb file extension. Support for .pb models have been removed in TensorFlow.js 1.0 in favor of .json models. You can re-convert your Python TensorFlow model using the TensorFlow.js 1.0 conversion scripts or you can convert your.pb models with the 'pb2json'NPM script in the tensorflow/tfjs-converter repository.":t+=" Please make sure the server is serving valid JSON for this request.",new Error(t)}const n=t.modelTopology,s=t.weightsManifest;if(null==n&&null==s)throw new Error(`The JSON from HTTP path ${this.path} contains neither model topology or manifest for weights.`);return t}async load(){if(this.loadOptions.streamWeights)return this.loadStream();return Uo(await this.loadModelJSON(),(e=>this.loadWeights(e)))}async loadStream(){const e=await this.loadModelJSON(),t=await this.getWeightUrls(e.weightsManifest),n=qo(e.weightsManifest);return Object.assign(Object.assign({},e),{weightSpecs:n,getWeightStream:()=>function(e,t){var n;const s=null==t.fetchFunc?Sn().platform.fetch:t.fetchFunc;let r,a=0;return null===(n=t.onProgress)||void 0===n||n.call(t,0),new ReadableStream({pull:async n=>{for(var i;at?e.substring(n):"";return[s+"/",r]}(t),r=this.weightPathPrefix||n,a=[],i=[];for(const t of e)for(const e of t.paths)null!=this.weightUrlConverter?i.push(this.weightUrlConverter(e)):a.push(r+e+s);return this.weightUrlConverter&&a.push(...await Promise.all(i)),a}async loadWeights(e){const t=await this.getWeightUrls(e);return[qo(e),await mu(t,this.loadOptions)]}}function wu(e){return null!=e.match(bu.URL_SCHEME_REGEX)}bu.URL_SCHEME_REGEX=/^https?:\/\//;const vu=(e,t)=>{if("undefined"==typeof fetch&&(null==t||null==t.fetchFunc))return null;{let n=!0;if(n=Array.isArray(e)?e.every((e=>wu(e))):wu(e),n)return xu(e,t)}return null};function xu(e,t){return new bu(e,t)}function Au(e,t){return xu(e,t)}jo.registerSaveRouter(vu),jo.registerLoadRouter(vu);class ku{constructor(e){this.modelArtifacts=e}load(){return this.modelArtifacts}}class Cu{constructor(e){this.saveHandler=e}save(e){return this.saveHandler(e)}}class Su{constructor(e){e.load&&(this.load=()=>Promise.resolve(e.load())),e.save&&(this.save=t=>Promise.resolve(e.save(t)))}}function Eu(e,t,n,s){return new Su(_u(...arguments))}function _u(e,t,n,s){if(1===arguments.length){const t=null!=e.modelTopology||null!=e.weightSpecs;return new ku(t?e:{modelTopology:e})}return new ku({modelTopology:e,weightSpecs:t,weightData:n,trainingConfig:s})}function Iu(e){return new Cu(e)}function Tu(e){return new Cu(e)}function Nu(e,t,n){if(Ht(e),null!=t&&3!==t.length)throw new Error("tensor3d() requires shape to have three numbers");const s=oo(e,n);if(3!==s.length&&1!==s.length)throw new Error("tensor3d() requires values to be number[][][] or flat/TypedArray");if(1===s.length&&null==t)throw new Error("tensor3d() requires shape to be provided when `values` are a flat array");return go(e,t,s,n)}let Ou,Ru=!1;function Du(e,t=3){if(t>4)throw new Error("Cannot construct Tensor with more than 4 channels from pixels.");if(null==e)throw new Error("pixels passed to tf.browser.fromPixels() can not be null");let n=!1,s=!1,r=!1,a=!1,i=!1,o=!1;if(e.data instanceof Uint8Array)n=!0;else if("undefined"!=typeof ImageData&&e instanceof ImageData)s=!0;else if("undefined"!=typeof HTMLVideoElement&&e instanceof HTMLVideoElement)r=!0;else if("undefined"!=typeof HTMLImageElement&&e instanceof HTMLImageElement)a=!0;else if(null!=e.getContext)i=!0;else{if(!("undefined"!=typeof ImageBitmap&&e instanceof ImageBitmap))throw new Error(`pixels passed to tf.browser.fromPixels() must be either an HTMLVideoElement, HTMLImageElement, HTMLCanvasElement, ImageData in browser, or OffscreenCanvas, ImageData in webworker or {data: Uint32Array, width: number, height: number}, but was ${e.constructor.name}`);o=!0}if(null!=ja(Ba,to.backendName)){const n={pixels:e},s={numChannels:t};return to.runKernel(Ba,n,s)}const[l,u]=r?[e.videoWidth,e.videoHeight]:[e.width,e.height];let c,h;if(i)c=e.getContext("2d").getImageData(0,0,l,u).data;else if(s||n)c=e.data;else if(a||r||o){if(null==Ou)if("undefined"==typeof document){if("undefined"==typeof OffscreenCanvas||"undefined"==typeof OffscreenCanvasRenderingContext2D)throw new Error("Cannot parse input in current context. Reason: OffscreenCanvas Context2D rendering is not supported.");Ou=new OffscreenCanvas(1,1).getContext("2d")}else Ou=document.createElement("canvas").getContext("2d",{willReadFrequently:!0});Ou.canvas.width=l,Ou.canvas.height=u,Ou.drawImage(e,0,0,l,u),c=Ou.getImageData(0,0,l,u).data}if(4===t)h=new Int32Array(c);else{const e=l*u;h=new Int32Array(e*t);for(let n=0;n4||2===t)throw new Error(`toPixels only supports depth of size 1, 3 or 4 but got ${t}`);if("float32"!==e.dtype&&"int32"!==e.dtype)throw new Error(`Unsupported type for toPixels: ${e.dtype}. Please use float32 or int32 tensors.`)}async function Fu(e,t){let n=co(e,"img","toPixels");if(!(e instanceof Mi)){const e=n;n=Nl(e,"int32"),e.dispose()}Mu(n);const[s,r]=n.shape.slice(0,2),a=2===n.rank?1:n.shape[2],i=await n.data(),o="float32"===n.dtype?255:1,l=new Uint8ClampedArray(r*s*4);for(let e=0;e1)throw new Error(`Tensor values for a float32 Tensor must be in the range [0 - 1] but encountered ${r}.`)}else if("int32"===n.dtype&&(r<0||r>255))throw new Error(`Tensor values for a int32 Tensor must be in the range [0 - 255] but encountered ${r}.`);1===a?(t[0]=r*o,t[1]=r*o,t[2]=r*o):t[s]=r*o}const s=4*e;l[s+0]=Math.round(t[0]),l[s+1]=Math.round(t[1]),l[s+2]=Math.round(t[2]),l[s+3]=Math.round(t[3])}if(null!=t){if(!Ru){null!=ja(Ss,to.backendName)&&(Ru=!0)}t.width=r,t.height=s;const e=t.getContext("2d"),n=new ImageData(l,r,s);e.putImageData(n,0,0)}return n!==e&&n.dispose(),l}const Bu=fo({fromPixels_:Du}),zu=-2,Lu=-1;function Pu(e,t,n){const s=e.shape.length;qt(s===t.length,(()=>`Error in slice${s}D: Length of begin ${t} must match the rank of the array (${s}).`)),qt(s===n.length,(()=>`Error in slice${s}D: Length of size ${n} must match the rank of the array (${s}).`));for(let r=0;r`Error in slice${s}D: begin[${r}] + size[${r}] (${t[r]+n[r]}) would overflow input.shape[${r}] (${e.shape[r]})`))}function Vu(e){const t=[];let n=0;for(;e>0;)1&e&&t.push(n),e/=2,n++;return t}function Wu(e,t,n){const s=[];for(let r=0;r0){const l=t[0],u=n+1;c=Hu(i,l,u,s,e),h=$u(o,l,u,r,e),d=Uu(a,l,u,e)}else for(let t=0;t-1)a[r]=0;else{const i=Gu(t,n,r);let o=s[i];e&1<-1)a[r]=Number.MAX_SAFE_INTEGER;else{const i=Gu(t,n,r);let o=s[i];e&1<0?Number.MIN_SAFE_INTEGER:Number.MAX_SAFE_INTEGER);const l=s[r];return i<0&&(i+=l),i=Wt(0,i,l-1),i}function Zu(e,t,n,s,r,a){let i=t[r];const o=n[r]||1;(e&1<0?Number.MAX_SAFE_INTEGER:Number.MIN_SAFE_INTEGER);const l=s[r];return i<0&&(i+=l),i=o>0?Wt(0,i,l):Wt(-1,i,l-1),i}function Yu(e,t,n){let s=n.length;for(let e=0;e1){s=e;break}for(let r=s+1;r0||n[r]!==e[r])return!1;return!0}function Qu(e,t){let n=e.length>0?e[e.length-1]:1;for(let s=0;s{qt(-1!==e,(()=>"slice() does not support negative begin indexing."))})),a=null==n?new Array(r).fill(-1):"number"==typeof n?[n,...new Array(r-1).fill(-1)]:n.lengtht>=0?t:(qt(-1===t,(()=>`Negative size values should be exactly -1 but got ${t} for the slice() size at index ${n}.`)),e.shape[n]-s[n]))),[s,a]}function ec(e,t,n,s,r,a,i,o,l){let u;if(null==s?(u=new Array(t.length),u.fill(1)):u=s,null!=i&&i&i-1)throw new Error("Multiple ellipses in slice is not allowed.");let c=!1;const h={dims:u.length,numAddAxisAfterEllipsis:0,begin:t.slice(),end:n.slice(),strides:u.slice(),beginMask:r,endMask:a,ellipsisMask:i,newAxisMask:o,shrinkAxisMask:l};for(let e=0;e0?0:-1,d.strides[t]>0?s:s-1];if(n&&d.strides[t]<=0)throw Error("only stride 1 allowed on non-range indexing.");m=m&&1===d.strides[t];const i=!!(d.beginMask&1<=s)throw Error(`slice index ${d.begin[t]} of dimension ${t} out of bounds.`)}else d.begin[t]=tc(d.begin[t],0,d.strides[t],s,r,a),d.end[t]=tc(d.end[t],1,d.strides[t],s,r,a);const e=1===d.strides[t]&&0===d.begin[t]&&d.end[t]===s;p=p&&e,f=f&&(0===t&&1===d.strides[t]||e)}else p=p&&1===d.strides[t]&&i,f=f&&(0===t&&1===d.strides[t]||i);let o,l=!1;if(d.beginValid&&d.endValid?(o=d.end[t]-d.begin[t],l=!0):n?(o=1,l=!0):i&&s>=0&&(o=d.strides[t]<0?-s:s,l=!0),l){let e;e=0===o||o<0!=d.strides[t]<0?0:Math.trunc(o/d.strides[t])+(o%d.strides[t]!=0?1:0),g.push(e)}else g.push(-1)}for(let e=0;e=0?y.push(g[t]):t===zu&&y.push(1)}return{finalShapeSparse:y.filter(((e,t)=>d.finalShapeGatherIndices[t]!==zu)),finalShape:y,isIdentity:p,sliceDim0:f,isSimpleSlice:m,begin:d.begin,end:d.end,strides:d.strides}}function tc(e,t,n,s,r,a){if(r[t])return n>0?a[t]:a[t+1&1];{const t=e<0?s+e:e;return ta[1]?a[1]:t}}const nc=fo({acos_:function(e){const t={x:co(e,"x","acos")};return to.runKernel(On,t)}});const sc=fo({acosh_:function(e){const t={x:co(e,"x","acosh")};return to.runKernel(Rn,t)}});const rc=fo({addN_:function(e){qt(Array.isArray(e),(()=>"The argument passed to tf.addN() must be a list of tensors")),qt(e.length>=1,(()=>`Must pass at least one tensor to tf.addN(), but got ${e.length}`));const t=e.map(((e,t)=>co(e,`tensors${t}`,"addN"))),n=t[0];t.forEach((e=>{if(e.dtype!==n.dtype)throw new Error("All tensors passed to tf.addN() must have the same dtype")})),t.forEach((e=>{if(!Kt(e.shape,n.shape))throw new Error("All tensors passed to tf.addN() must have the same shape")}));const s=t;return to.runKernel(Mn,s)}});const ac=fo({all_:function(e,t=null,n=!1){const s={x:co(e,"x","all","bool")},r={axis:t,keepDims:n};return to.runKernel(Fn,s,r)}});const ic=fo({any_:function(e,t=null,n=!1){const s={x:co(e,"x","any","bool")},r={axis:t,keepDims:n};return to.runKernel(Bn,s,r)}});const oc=fo({argMax_:function(e,t=0){const n={x:co(e,"x","argMax")},s={axis:t};return to.runKernel(zn,n,s)}});const lc=fo({argMin_:function(e,t=0){const n={x:co(e,"x","argMin")},s={axis:t};return to.runKernel(Ln,n,s)}});const uc=fo({asin_:function(e){const t={x:co(e,"x","asin")};return to.runKernel(Pn,t)}});const cc=fo({asinh_:function(e){const t={x:co(e,"x","asinh")};return to.runKernel(Vn,t)}});const hc=fo({atan_:function(e){const t={x:co(e,"x","atan")};return to.runKernel(Wn,t)}});const dc=fo({atan2_:function(e,t){let n=co(e,"a","atan2"),s=co(t,"b","atan2");[n,s]=$i(n,s);const r={a:n,b:s};return to.runKernel(Gn,r)}});const pc=fo({atanh_:function(e){const t={x:co(e,"x","atanh")};return to.runKernel(Un,t)}});function fc(e,t,n,s,r="NHWC",a){return yc(e,[...t,e[3]],n,a,s,null,null,_c(r))}function mc(e,t,n,s,r,a,i="channelsLast"){const[o,l]=vc(t);let u;if("channelsLast"===i)u=[o,l,e[3],e[3]];else{if("channelsFirst"!==i)throw new Error(`Unknown dataFormat ${i}`);u=[o,l,e[1],e[1]]}return yc(e,u,n,s,r,a,!1,i)}function gc(e,t,n,s,r,a,i="NDHWC"){const[o,l,u]=xc(t);let c,h;if("NDHWC"===i)h="channelsLast",c=[o,l,u,e[4],e[4]];else{if("NCDHW"!==i)throw new Error(`Unknown dataFormat ${i}`);h="channelsFirst",c=[o,l,u,e[1],e[1]]}return bc(e,c,n,s,r,!1,h,a)}function yc(e,t,n,s,r,a,i=!1,o="channelsLast"){let[l,u,c,h]=[-1,-1,-1,-1];if("channelsLast"===o)[l,u,c,h]=e;else{if("channelsFirst"!==o)throw new Error(`Unknown dataFormat ${o}`);[l,h,u,c]=e}const[d,p,,f]=t,[m,g]=vc(n),[y,b]=vc(s),w=Ac(d,y),v=Ac(p,b),{padInfo:x,outHeight:A,outWidth:k}=function(e,t,n,s,r,a,i,o,l){let u,c,h;if("number"==typeof e){u={top:e,bottom:e,left:e,right:e,type:0===e?"VALID":"NUMBER"};const r=function(e,t,n,s,r){null==s&&(s=wc(e,t,n));const a=e[0],i=e[1],o=kc((a-t+2*s)/n+1,r),l=kc((i-t+2*s)/n+1,r);return[o,l]}([t,n],a,s,e,o);c=r[0],h=r[1]}else if("same"===e){c=Math.ceil(t/s),h=Math.ceil(n/r);const e=Math.max(0,(c-1)*s+a-t),o=Math.max(0,(h-1)*r+i-n),l=Math.floor(e/2),d=e-l,p=Math.floor(o/2);u={top:l,bottom:d,left:p,right:o-p,type:"SAME"}}else if("valid"===e)u={top:0,bottom:0,left:0,right:0,type:"VALID"},c=Math.ceil((t-a+1)/s),h=Math.ceil((n-i+1)/r);else{if("object"!=typeof e)throw Error(`Unknown padding parameter: ${e}`);{const d="channelsLast"===l?e[1][0]:e[2][0],p="channelsLast"===l?e[1][1]:e[2][1],f="channelsLast"===l?e[2][0]:e[3][0],m="channelsLast"===l?e[2][1]:e[3][1];u={top:d,bottom:p,left:f,right:m,type:0===d&&0===p&&0===f&&0===m?"VALID":"EXPLICIT"},c=kc((t-a+d+p)/s+1,o),h=kc((n-i+f+m)/r+1,o)}}return{padInfo:u,outHeight:c,outWidth:h}}(r,u,c,m,g,w,v,a,o),C=i?f*h:f;let S;return"channelsFirst"===o?S=[l,C,A,k]:"channelsLast"===o&&(S=[l,A,k,C]),{batchSize:l,dataFormat:o,inHeight:u,inWidth:c,inChannels:h,outHeight:A,outWidth:k,outChannels:C,padInfo:x,strideHeight:m,strideWidth:g,filterHeight:d,filterWidth:p,effectiveFilterHeight:w,effectiveFilterWidth:v,dilationHeight:y,dilationWidth:b,inShape:e,outShape:S,filterShape:t}}function bc(e,t,n,s,r,a=!1,i="channelsLast",o){let[l,u,c,h,d]=[-1,-1,-1,-1,-1];if("channelsLast"===i)[l,u,c,h,d]=e;else{if("channelsFirst"!==i)throw new Error(`Unknown dataFormat ${i}`);[l,d,u,c,h]=e}const[p,f,m,,g]=t,[y,b,w]=xc(n),[v,x,A]=xc(s),k=Ac(p,v),C=Ac(f,x),S=Ac(m,A),{padInfo:E,outDepth:_,outHeight:I,outWidth:T}=function(e,t,n,s,r,a,i,o,l,u,c){let h,d,p,f;"valid"===e&&(e=0);if("number"==typeof e){h={top:e,bottom:e,left:e,right:e,front:e,back:e,type:0===e?"VALID":"NUMBER"};const m=function(e,t,n,s,r,a){null==r&&(r=wc(e,t[0],s[0]));const i=[0,0,0,n];for(let n=0;n<3;n++)e[n]+2*r>=t[n]&&(i[n]=kc((e[n]-t[n]+2*r)/s[n]+1,a));return i}([t,n,s,1],[o,l,u],1,[r,a,i],e,c);d=m[0],p=m[1],f=m[2]}else{if("same"!==e)throw Error(`Unknown padding parameter: ${e}`);{d=Math.ceil(t/r),p=Math.ceil(n/a),f=Math.ceil(s/i);const e=(d-1)*r+o-t,c=(p-1)*a+l-n,m=(f-1)*i+u-s,g=Math.floor(e/2),y=e-g,b=Math.floor(c/2),w=c-b,v=Math.floor(m/2);h={top:b,bottom:w,left:v,right:m-v,front:g,back:y,type:"SAME"}}}return{padInfo:h,outDepth:d,outHeight:p,outWidth:f}}(r,u,c,h,y,b,w,k,C,S,o),N=a?g*d:g;let O;return"channelsFirst"===i?O=[l,N,_,I,T]:"channelsLast"===i&&(O=[l,_,I,T,N]),{batchSize:l,dataFormat:i,inDepth:u,inHeight:c,inWidth:h,inChannels:d,outDepth:_,outHeight:I,outWidth:T,outChannels:N,padInfo:E,strideDepth:y,strideHeight:b,strideWidth:w,filterDepth:p,filterHeight:f,filterWidth:m,effectiveFilterDepth:k,effectiveFilterHeight:C,effectiveFilterWidth:S,dilationDepth:v,dilationHeight:x,dilationWidth:A,inShape:e,outShape:O,filterShape:t}}function wc(e,t,n,s=1){const r=Ac(t,s);return Math.floor((e[0]*(n-1)-n+r)/2)}function vc(e){return"number"==typeof e?[e,e,e]:2===e.length?[e[0],e[1],1]:e}function xc(e){return"number"==typeof e?[e,e,e]:e}function Ac(e,t){return t<=1?e:e+(e-1)*(t-1)}function kc(e,t){if(!t)return Math.trunc(e);switch(t){case"round":return Math.round(e);case"ceil":return Math.ceil(e);case"floor":return Math.floor(e);default:throw new Error(`Unknown roundingMode ${t}`)}}function Cc(e){const[t,n,s]=vc(e);return 1===t&&1===n&&1===s}function Sc(e,t){return Cc(e)||Cc(t)}function Ec(e){return vc(e).every((e=>e>0))}function _c(e){if("NHWC"===e)return"channelsLast";if("NCHW"===e)return"channelsFirst";throw new Error(`Unknown dataFormat ${e}`)}function Ic(e,t,n){if(null!=n){if("string"==typeof t)throw Error(`Error in ${e}: pad must be an integer when using dimRoundingMode ${n} but got pad ${t}.`);if("number"==typeof t)qt(Xt(t),(()=>`Error in ${e}: pad must be an integer when using dimRoundingMode ${n} but got pad ${t}.`));else{if("object"!=typeof t)throw Error(`Error in ${e}: Unknown padding parameter: ${t}`);t.forEach((t=>{t.forEach((t=>{qt(Xt(t),(()=>`Error in ${e}: pad must be an integer when using dimRoundingMode ${n} but got pad ${t}.`))}))}))}}}const Tc=fo({reshape_:function(e,t){const n={x:co(e,"x","reshape","string_or_numeric")},s={shape:t};return to.runKernel(Wr,n,s)}});const Nc=fo({avgPool_:function(e,t,n,s,r){const a=co(e,"x","avgPool","float32");qt(Sc(n,1),(()=>`Error in avgPool: Either strides or dilations must be 1. Got strides ${n} and dilations '1'`));let i=a,o=!1;3===a.rank&&(o=!0,i=Tc(a,[1,a.shape[0],a.shape[1],a.shape[2]])),qt(4===i.rank,(()=>`Error in avgPool: x must be rank 4 but got rank ${i.rank}.`)),Ic("avgPool",s,r);const l={x:i},u={filterSize:t,strides:n,pad:s,dimRoundingMode:r};let c=to.runKernel(qn,l,u);return c=Nl(c,a.dtype),o?Tc(c,[c.shape[1],c.shape[2],c.shape[3]]):c}});const Oc=fo({avgPool3d_:function(e,t,n,s,r,a="NDHWC"){const i=co(e,"x","avgPool3d","float32");let o=i,l=!1;4===i.rank&&(l=!0,o=Tc(i,[1,i.shape[0],i.shape[1],i.shape[2],i.shape[3]])),qt(5===o.rank,(()=>`Error in avgPool3d: x must be rank 5 but got rank ${o.rank}.`)),qt("NDHWC"===a,(()=>`Error in avgPool3d: Only NDHWC is currently supported, but got dataFormat of ${a}`)),qt("number"==typeof n&&n>0||Array.isArray(n)&&n[0]>0&&n[1]>0&&n[2]>0,(()=>`Error in avgPool3d: Stride must be > 0, but got '${n}'`)),Ic("avgPool3d",s,r);const u={x:o},c={filterSize:t,strides:n,pad:s,dimRoundingMode:r,dataFormat:a};let h=to.runKernel(Hn,u,c);return h=Nl(h,o.dtype),l?Tc(h,[h.shape[1],h.shape[2],h.shape[3],h.shape[4]]):h}});const Rc=fo({concat_:function(e,t=0){qt(e.length>=1,(()=>"Pass at least one tensor to concat"));const n=ho(e,"tensors","concat","string_or_numeric");if("complex64"===n[0].dtype&&n.forEach((e=>{if("complex64"!==e.dtype)throw new Error(`Cannot concatenate complex64 tensors with a tensor\n with dtype ${e.dtype}. `)})),1===n.length)return Ol(n[0]);const s=n,r={axis:t};return to.runKernel(rs,s,r)}});const Dc=fo({matMul_:function(e,t,n=!1,s=!1){let r=co(e,"a","matMul"),a=co(t,"b","matMul");[r,a]=$i(r,a);const i={a:r,b:a},o={transposeA:n,transposeB:s};return to.runKernel(Kn,i,o)}});const Mc=fo({sigmoid_:function(e){const t={x:co(e,"x","sigmoid","float32")};return to.runKernel(aa,t)}});const Fc=fo({slice_:function(e,t,n){const s=co(e,"x","slice","string_or_numeric");if(0===s.rank)throw new Error("Slicing scalar is not possible");const r={x:s},a={begin:t,size:n};return to.runKernel(ta,r,a)}});const Bc=fo({tanh_:function(e){const t={x:co(e,"x","tanh","float32")};return to.runKernel(Ea,t)}});const zc=fo({basicLSTMCell_:function(e,t,n,s,r,a){const i=co(e,"forgetBias","basicLSTMCell"),o=co(t,"lstmKernel","basicLSTMCell"),l=co(n,"lstmBias","basicLSTMCell"),u=co(s,"data","basicLSTMCell"),c=co(r,"c","basicLSTMCell"),h=co(a,"h","basicLSTMCell"),d=Rc([u,h],1),p=Dc(d,o),f=Dl(p,l),m=f.shape[0],g=f.shape[1]/4,y=[m,g],b=Fc(f,[0,0],y),w=Fc(f,[0,g],y),v=Fc(f,[0,2*g],y),x=Fc(f,[0,3*g],y),A=Dl(Bl(Mc(b),Bc(w)),Bl(c,Mc(Dl(i,v))));return[A,Bl(Bc(A),Mc(x))]}});const Lc=fo({batchToSpaceND_:function(e,t,n){const s=co(e,"x","batchToSpaceND"),r=t.reduce(((e,t)=>e*t));qt(s.rank>=1+t.length,(()=>`input rank is ${s.rank} but should be > than blockShape.length ${t.length}`)),qt(n.length===t.length,(()=>`crops.length is ${n.length} but should be equal to blockShape.length ${t.length}`)),qt(s.shape[0]%r==0,(()=>`input tensor batch is ${s.shape[0]} but is not divisible by the product of the elements of blockShape ${t.join(" * ")} === ${r}`));const a={x:s},i={blockShape:t,crops:n};return to.runKernel(Xn,a,i)}});const Pc=fo({batchNorm_:function(e,t,n,s,r,a){null==a&&(a=.001);const i=co(e,"x","batchNorm"),o=co(t,"mean","batchNorm"),l=co(n,"variance","batchNorm");let u,c;null!=r&&(u=co(r,"scale","batchNorm")),null!=s&&(c=co(s,"offset","batchNorm")),qt(o.rank===l.rank,(()=>"Batch normalization gradient requires mean and variance to have equal ranks.")),qt(null==c||o.rank===c.rank,(()=>"Batch normalization gradient requires mean and offset to have equal ranks.")),qt(null==u||o.rank===u.rank,(()=>"Batch normalization gradient requires mean and scale to have equal ranks."));const h={x:function(e){let t;return t=0===e.rank||1===e.rank?Tc(e,[1,1,1,e.size]):2===e.rank?Tc(e,[1,1,e.shape[0],e.shape[1]]):3===e.rank?Tc(e,[1,e.shape[0],e.shape[1],e.shape[2]]):e,t}(i),scale:u,offset:c,mean:o,variance:l},d={varianceEpsilon:a},p=to.runKernel(Vs,h,d);return Tc(p,i.shape)}});const Vc=fo({batchNorm2d_:function(e,t,n,s,r,a){const i=co(e,"x","batchNorm"),o=co(t,"mean","batchNorm"),l=co(n,"variance","batchNorm");let u,c;return null!=r&&(u=co(r,"scale","batchNorm")),null!=s&&(c=co(s,"offset","batchNorm")),qt(2===i.rank,(()=>`Error in batchNorm2D: x must be rank 2 but got rank ${i.rank}.`)),qt(2===o.rank||1===o.rank,(()=>`Error in batchNorm2D: mean must be rank 2 or rank 1 but got rank ${o.rank}.`)),qt(2===l.rank||1===l.rank,(()=>`Error in batchNorm2D: variance must be rank 2 or rank 1 but got rank ${l.rank}.`)),null!=u&&qt(2===u.rank||1===u.rank,(()=>`Error in batchNorm2D: scale must be rank 2 or rank 1 but got rank ${u.rank}.`)),null!=c&&qt(2===c.rank||1===c.rank,(()=>`Error in batchNorm2D: offset must be rank 2 or rank 1 but got rank ${c.rank}.`)),Pc(i,o,l,c,u,a)}});const Wc=fo({batchNorm3d_:function(e,t,n,s,r,a){const i=co(e,"x","batchNorm"),o=co(t,"mean","batchNorm"),l=co(n,"variance","batchNorm");let u,c;return null!=r&&(u=co(r,"scale","batchNorm")),null!=s&&(c=co(s,"offset","batchNorm")),qt(3===i.rank,(()=>`Error in batchNorm3D: x must be rank 3 but got rank ${i.rank}.`)),qt(3===o.rank||1===o.rank,(()=>`Error in batchNorm3D: mean must be rank 3 or rank 1 but got rank ${o.rank}.`)),qt(3===l.rank||1===l.rank,(()=>`Error in batchNorm3D: variance must be rank 3 or rank 1 but got rank ${l.rank}.`)),null!=u&&qt(3===u.rank||1===u.rank,(()=>`Error in batchNorm3D: scale must be rank 3 or rank 1 but got rank ${u.rank}.`)),null!=c&&qt(3===c.rank||1===c.rank,(()=>`Error in batchNorm3D: offset must be rank 3 or rank 1 but got rank ${c.rank}.`)),Pc(i,o,l,c,u,a)}});const Uc=fo({batchNorm4d_:function(e,t,n,s,r,a){const i=co(e,"x","batchNorm"),o=co(t,"mean","batchNorm"),l=co(n,"variance","batchNorm");let u,c;return null!=r&&(u=co(r,"scale","batchNorm")),null!=s&&(c=co(s,"offset","batchNorm")),qt(4===i.rank,(()=>`Error in batchNorm4D: x must be rank 4 but got rank ${i.rank}.`)),qt(4===o.rank||1===o.rank,(()=>`Error in batchNorm4D: mean must be rank 4 or rank 1 but got rank ${o.rank}.`)),qt(4===l.rank||1===l.rank,(()=>`Error in batchNorm4D: variance must be rank 4 or rank 1 but got rank ${l.rank}.`)),null!=u&&qt(4===u.rank||1===u.rank,(()=>`Error in batchNorm4D: scale must be rank 4 or rank 1 but got rank ${u.rank}.`)),null!=c&&qt(4===c.rank||1===c.rank,(()=>`Error in batchNorm4D: offset must be rank 4 or rank 1 but got rank ${c.rank}.`)),Pc(i,o,l,c,u,a)}});const Gc=fo({bincount_:function(e,t,n){const s=co(e,"x","bincount"),r=co(t,"weights","bincount");qt("int32"===s.dtype,(()=>`Error in bincount: input dtype must be int32, but got ${s.dtype}`)),qt(n>=0,(()=>`size must be non-negative, but got ${n}.`)),qt(r.size===s.size||0===r.size,(()=>`Error in bincount: weights must have the same size as input or0-length, but got input shape: ${s.shape}, weights shape: ${r.shape}.`));const a={x:s,weights:r},i={size:n};return to.runKernel(Zn,a,i)}});const qc=fo({bitwiseAnd_:function(e,t){const n=co(e,"x","bitwiseAnd"),s=co(t,"y","bitwiseAnd");if(!Kt(n.shape,s.shape))throw new Error(`BitwiseAnd: Tensors must have the same shape. x: ${n.shape}, y: ${s.shape}`);if("int32"!==n.dtype||"int32"!==s.dtype)throw new Error(`BitwiseAnd: Only supports 'int32' values in tensor, found type of x: ${n.dtype} and type of y: ${s.dtype}`);const r={a:n,b:s};return to.runKernel(Yn,r)}});const jc=fo({broadcastArgs_:function(e,t){const n=co(e,"s0","broadcastArgs","int32"),s=co(t,"s1","broadcastArgs","int32");if(1!==n.rank)throw new Error(`broadcastArgs(): first input must be a vector (rank=1). Has rank ${n.rank}`);if(1!==s.rank)throw new Error(`broadcastArgs(): second input must be a vector (rank=1). Has rank ${s.rank}`);const r={s0:n,s1:s};return to.runKernel(Qn,r)}});const Hc=fo({broadcastTo_:function(e,t){let n=co(e,"broadcastTo","x");const s=n.shape;if(bn(t),t.lengthn.rank){const e=n.shape.slice();for(;e.length=0;e--)if(r[e]===t[e])a[e]=1;else if(1!==n.shape[e])throw new Error(`broadcastTo(): [${s}] cannot be broadcast to [${t}].`);if(0===a.map(((e,t)=>e>1?t:-1)).filter((e=>e>=0)).length)return Ol(n);const i={x:n},o={reps:a};return to.runKernel(_a,i,o)}});const $c=fo({ceil_:function(e){const t={x:co(e,"x","ceil","float32")};return to.runKernel(es,t)}});const Kc=fo({clipByValue_:function(e,t,n){const s=co(e,"x","clipByValue");if(qt(t<=n,(()=>`Error in clip: min (${t}) must be less than or equal to max (${n}).`)),t===n)return Xl(s.shape,t,s.dtype);const r={x:s},a={clipValueMin:t,clipValueMax:n};return to.runKernel(ts,r,a)}});const Xc=fo({concat1d_:function(e){return Rc(e,0)}});const Zc=fo({concat2d_:function(e,t){return Rc(e,t)}});const Yc=fo({concat3d_:function(e,t){return Rc(e,t)}});const Qc=fo({concat4d_:function(e,t){return Rc(e,t)}});const Jc=fo({conv2d_:function(e,t,n,s,r="NHWC",a=[1,1],i){const o=co(e,"x","conv2d","float32"),l=co(t,"filter","conv2d","float32");let u=o,c=!1;3===o.rank&&(c=!0,u=Tc(o,[1,o.shape[0],o.shape[1],o.shape[2]])),qt(4===u.rank,(()=>`Error in conv2d: input must be rank 4, but got rank ${u.rank}.`)),qt(4===l.rank,(()=>`Error in conv2d: filter must be rank 4, but got rank ${l.rank}.`)),Ic("conv2d",s,i);const h="NHWC"===r?u.shape[3]:u.shape[1];qt(h===l.shape[2],(()=>`Error in conv2d: depth of input (${h}) must match input depth for filter ${l.shape[2]}.`)),qt(Sc(n,a),(()=>`Error in conv2D: Either strides or dilations must be 1. Got strides ${n} and dilations '${a}'`)),qt(Ec(a),(()=>"Error in conv2D: Dilated rates should be larger than 0.")),qt(Ec(n),(()=>"Error in conv2D: Strides should be larger than 0."));const d={x:u,filter:l},p={strides:n,pad:s,dataFormat:r,dilations:a,dimRoundingMode:i},f=to.runKernel(as,d,p);return c?Tc(f,[f.shape[1],f.shape[2],f.shape[3]]):f}});const eh=fo({conv1d_:function(e,t,n,s,r="NWC",a=1,i){const o=co(e,"x","conv1d"),l=co(t,"filter","conv1d");let u=o,c=!1;2===o.rank&&(c=!0,u=Tc(o,[1,o.shape[0],o.shape[1]])),qt(3===u.rank,(()=>`Error in conv1d: input must be rank 3, but got rank ${u.rank}.`)),qt(3===l.rank,(()=>`Error in conv1d: filter must be rank 3, but got rank ${l.rank}.`)),Ic("conv1d",s,i),qt(u.shape[2]===l.shape[1],(()=>`Error in conv1d: depth of input (${u.shape[2]}) must match input depth for filter ${l.shape[1]}.`)),qt(Sc(n,a),(()=>`Error in conv1D: Either stride or dilation must be 1. Got stride ${n} and dilation '${a}'`)),qt(Ec(a),(()=>"Error in conv1D: Dilated rates should be larger than 0.")),qt(Ec(n),(()=>"Error in conv1D: Stride should be larger than 0.")),qt("NWC"===r,(()=>`Error in conv1d: got dataFormat of ${r} but only NWC is currently supported.`));const h=Tc(l,[1,l.shape[0],l.shape[1],l.shape[2]]),d=Tc(u,[u.shape[0],1,u.shape[1],u.shape[2]]),p=Jc(d,h,[1,n],s,"NHWC",[1,a],i);return Tc(p,c?[p.shape[2],p.shape[3]]:[p.shape[0],p.shape[2],p.shape[3]])}});const th=fo({conv2DBackpropInput_:function(e,t,n,s,r,a="NHWC",i){qt(e.length===t.rank,(()=>`Length of inShape (${e.length}) and rank of dy (${t.rank}) must match`));let o=e,l=t,u=!1;3===t.rank&&(u=!0,l=Tc(t,[1,t.shape[0],t.shape[1],t.shape[2]]),o=[1,e[0],e[1],e[2]]),qt(4===o.length,(()=>`Error in conv2dDerInput: inShape must be length 4, but got length ${o.length}.`)),qt(4===l.rank,(()=>`Error in conv2dDerInput: dy must be rank 4, but got rank ${l.rank}`)),qt(4===n.rank,(()=>`Error in conv2dDerInput: filter must be rank 4, but got rank ${n.rank}`));const c="NHWC"===a?o[3]:o[1],h="NHWC"===a?l.shape[3]:l.shape[1];qt(c===n.shape[2],(()=>`Error in conv2dDerInput: depth of input (${c}) must match input depth for filter ${n.shape[2]}.`)),qt(h===n.shape[3],(()=>`Error in conv2dDerInput: depth of output (${h}) must match output depth for filter ${n.shape[3]}.`)),Ic("conv2dDerInput",r,i);const d={dy:l,filter:n},p={strides:s,pad:r,dataFormat:a,dimRoundingMode:i,inputShape:o},f=to.runKernel(os,d,p);return u?Tc(f,[f.shape[1],f.shape[2],f.shape[3]]):f}});const nh=fo({conv2dTranspose_:function(e,t,n,s,r,a){const i=co(e,"x","conv2dTranspose"),o=co(t,"filter","conv2dTranspose");return th(n,i,o,s,r,"NHWC",a)}});const sh=fo({conv3d_:function(e,t,n,s,r="NDHWC",a=[1,1,1]){const i=co(e,"x","conv3d"),o=co(t,"filter","conv3d");let l=i,u=!1;4===i.rank&&(u=!0,l=Tc(i,[1,i.shape[0],i.shape[1],i.shape[2],i.shape[3]])),qt(5===l.rank,(()=>`Error in conv3d: input must be rank 5, but got rank ${l.rank}.`)),qt(5===o.rank,(()=>`Error in conv3d: filter must be rank 5, but got rank ${o.rank}.`)),qt(l.shape[4]===o.shape[3],(()=>`Error in conv3d: depth of input (${l.shape[4]}) must match input depth for filter ${o.shape[3]}.`)),qt(Sc(n,a),(()=>`Error in conv3D: Either strides or dilations must be 1. Got strides ${n} and dilations '${a}'`)),qt("NDHWC"===r,(()=>`Error in conv3d: got dataFormat of ${r} but only NDHWC is currently supported.`)),qt(Ec(a),(()=>"Error in conv3D: Dilated rates should be larger than 0.")),qt(Ec(n),(()=>"Error in conv3D: Strides should be larger than 0."));const c={x:l,filter:o},h={strides:n,pad:s,dataFormat:r,dilations:a},d=to.runKernel(ls,c,h);return u?Tc(d,[d.shape[1],d.shape[2],d.shape[3],d.shape[4]]):d}});const rh=fo({conv3DBackpropInput_:function(e,t,n,s,r){qt(e.length===t.rank,(()=>`Length of inShape (${e.length}) and rank of dy (${t.rank}) must match`));let a=e,i=t,o=!1;4===t.rank&&(o=!0,i=Tc(t,[1,t.shape[0],t.shape[1],t.shape[2],t.shape[3]]),a=[1,e[0],e[1],e[2],e[3]]);const l=a[4],u=i.shape[4];qt(5===a.length,(()=>`Error in conv3dDerInput: inShape must be length 5, but got length ${a.length}.`)),qt(5===i.rank,(()=>`Error in conv3dDerInput: dy must be rank 5, but got rank ${i.rank}`)),qt(5===n.rank,(()=>`Error in conv3dDerInput: filter must be rank 5, but got rank ${n.rank}`)),qt(l===n.shape[3],(()=>`Error in conv3dDerInput: depth of input (${l}) must match input depth for filter ${n.shape[3]}.`)),qt(u===n.shape[4],(()=>`Error in conv3dDerInput: depth of output (${u}) must match output depth for filter ${n.shape[4]}.`));const c={dy:i,filter:n},h={pad:r,strides:s,inputShape:a},d=to.runKernel(cs,c,h);return o?Tc(d,[d.shape[1],d.shape[2],d.shape[3],d.shape[4]]):d}});const ah=fo({conv3dTranspose_:function(e,t,n,s,r){const a=co(e,"x","conv3dTranspose"),i=co(t,"filter","conv3dTranspose");return rh(n,a,i,s,r)}});const ih=fo({cos_:function(e){const t={x:co(e,"x","cos","float32")};return to.runKernel(hs,t)}});const oh=fo({cosh_:function(e){const t={x:co(e,"x","cosh","float32")};return to.runKernel(ds,t)}});const lh=fo({cumprod_:function(e,t=0,n=!1,s=!1){const r={x:co(e,"x","cumprod")},a={axis:t,exclusive:n,reverse:s};return to.runKernel(ps,r,a)}});const uh=fo({cumsum_:function(e,t=0,n=!1,s=!1){const r={x:co(e,"x","cumsum")},a={axis:t,exclusive:n,reverse:s};return to.runKernel(fs,r,a)}});const ch=fo({denseBincount_:function(e,t,n,s=!1){const r=co(e,"x","denseBincount"),a=co(t,"weights","denseBincount");qt("int32"===r.dtype,(()=>`Error in denseBincount: input dtype must be int32, but got ${r.dtype}`)),qt(r.rank<=2,(()=>`Error in denseBincount: input must be at most rank 2, but got rank ${r.rank}.`)),qt(n>=0,(()=>`size must be non-negative, but got ${n}.`)),qt(a.size===r.size||0===a.size,(()=>`Error in denseBincount: weights must have the same shape as x or 0-length, but got x shape: ${r.shape}, weights shape: ${a.shape}.`));const i={x:r,weights:a},o={size:n,binaryOutput:s};return to.runKernel(gs,i,o)}});const hh=fo({depthToSpace_:function(e,t,n="NHWC"){const s=co(e,"x","depthToSpace","float32"),r="NHWC"===n?s.shape[1]:s.shape[2],a="NHWC"===n?s.shape[2]:s.shape[3],i="NHWC"===n?s.shape[3]:s.shape[1];qt(t>1,(()=>`blockSize should be > 1 for depthToSpace, but was: ${t}`)),qt(r*t>=0,(()=>`Negative dimension size caused by overflow when multiplying\n ${r} and ${t} for depthToSpace with input shape\n ${s.shape}`)),qt(a*t>=0,(()=>`Negative dimension size caused by overflow when multiplying\n ${a} and ${t} for depthToSpace with input shape\n ${s.shape}`)),qt(i%(t*t)==0,(()=>`Dimension size must be evenly divisible by ${t*t} but is ${i} for depthToSpace with input shape ${s.shape}`));const o={x:s},l={blockSize:t,dataFormat:n};return to.runKernel(ys,o,l)}});const dh=fo({depthwiseConv2d_:function(e,t,n,s,r="NHWC",a=[1,1],i){const o=co(e,"x","depthwiseConv2d","float32"),l=co(t,"filter","depthwiseConv2d","float32");let u=o,c=!1;3===o.rank&&(c=!0,u=Tc(o,[1,o.shape[0],o.shape[1],o.shape[2]])),qt(4===u.rank,(()=>`Error in depthwiseConv2d: input must be rank 4, but got rank ${u.rank}.`)),qt(4===l.rank,(()=>`Error in depthwiseConv2d: filter must be rank 4, but got rank ${l.rank}.`));const h="NHWC"===r?u.shape[3]:u.shape[1];qt(h===l.shape[2],(()=>`Error in depthwiseConv2d: number of input channels (${h}) must match the inChannels dimension in filter ${l.shape[2]}.`)),Ic("depthwiseConv2d",s,i);const d={x:u,filter:l},p={strides:n,pad:s,dataFormat:r,dilations:a,dimRoundingMode:i},f=to.runKernel(bs,d,p);return c?Tc(f,[f.shape[1],f.shape[2],f.shape[3]]):f}});const ph=fo({diag_:function(e){const t={x:co(e,"x","diag")};return to.runKernel(xs,t)}});const fh=fo({dilation2d_:function(e,t,n,s,r=[1,1],a="NHWC"){const i=co(e,"x","dilation2d"),o=co(t,"filter","dilation2d");qt(3===i.rank||4===i.rank,(()=>`Error in dilation2d: input must be rank 3 or 4, but got rank ${i.rank}.`)),qt(3===o.rank,(()=>`Error in dilation2d: filter must be rank 3, but got rank ${o.rank}.`)),qt("NHWC"===a,(()=>`Error in dilation2d: Only NHWC is currently supported, but got dataFormat of ${a}`));let l=i,u=!1;3===i.rank&&(l=Tc(i,[1,i.shape[0],i.shape[1],i.shape[2]]),u=!0),qt(l.shape[3]===o.shape[2],(()=>`Error in dilation2d: input and filter must have the same depth: ${l.shape[3]} vs ${o.shape[2]}`));const c={x:l,filter:o},h={strides:n,pad:s,dilations:r},d=to.runKernel(As,c,h);return u?Tc(d,[d.shape[1],d.shape[2],d.shape[3]]):d}});const mh=fo({equal_:function(e,t){let n=co(e,"a","equal","string_or_numeric"),s=co(t,"b","equal","string_or_numeric");[n,s]=$i(n,s),su(n.shape,s.shape);const r={a:n,b:s};return to.runKernel(Os,r)}});const gh=fo({where_:function(e,t,n){const s=co(t,"a","where"),r=co(n,"b","where"),a=co(e,"condition","where","bool"),i=su(su(a.shape,s.shape),r.shape),o={condition:Hc(a,i),t:Hc(s,i),e:Hc(r,i)};return to.runKernel(Jr,o)}});const yh=fo({divNoNan_:function(e,t){let n=co(e,"a","div"),s=co(t,"b","div");[n,s]=$i(n,s);const r=Fl(n,s),a=Pl(r),i=mh(s,a);return gh(i,a,r)}});const bh=fo({dot_:function(e,t){const n=co(e,"t1","dot"),s=co(t,"t2","dot");qt(!(1!==n.rank&&2!==n.rank||1!==s.rank&&2!==s.rank),(()=>`Error in dot: inputs must all be rank 1 or 2, but got ranks ${n.rank} and ${s.rank}.`));const r=1===n.rank?n.size:n.shape[1],a=1===s.rank?s.size:s.shape[0];if(qt(r===a,(()=>`Error in dot: inner dimensions of inputs must match, but got ${r} and ${a}.`)),1===n.rank&&1===s.rank){const e=Tc(n,[1,-1]),t=Tc(s,[-1,1]),r=Dc(e,t);return Tc(r,[])}if(1===n.rank&&2===s.rank){const e=Tc(n,[1,-1]),t=Tc(s,[s.shape[0],s.shape[1]]),r=Dc(e,t);return Tc(r,[r.size])}if(2===n.rank&&1===s.rank){const e=Tc(s,[-1,1]),t=Dc(n,e);return Tc(t,[t.size])}{const e=Tc(s,[s.shape[0],s.shape[1]]);return Dc(n,e)}}});const wh=fo({einsum_:function(e,...t){const n=t.map(((e,t)=>co(e,`tensors${t}`,"einsum"))),s={equation:e};return to.runKernel(_s,n,s)}});const vh=fo({elu_:function(e){const t={x:co(e,"x","elu","float32")};return to.runKernel(Is,t)}});const xh=fo({ensureShape_:function(e,t){const n=co(e,"x","ensureShape","string_or_numeric");if(!function(e,t){if(e===t)return!0;if(null==e||null==t)return!1;if(e.length!==t.length)return!1;for(let n=0;n"Input dtype must be `int32` or `float32`.")),"int32"===t.dtype&&(t=Nl(t,"float32"));const n={x:t};return to.runKernel(Ns,n)}});function kh(e,t){for(let n=0;ne[t]))]}function Eh(e,t){return Ch(e,t.map((e=>1)),t)}function _h(e,t,n){qt(kh(t,n),(()=>`${e} supports only inner-most axes for now. Got axes ${t} and rank-${n} input.`))}function Ih(e,t){if(kh(e,t))return null;const n=[];for(let s=0;sn.push(e))),n}function Th(e){return e.map(((e,t)=>[t,e])).sort(((e,t)=>e[1]-t[1])).map((e=>e[0]))}function Nh(e,t){const n=[];for(let s=t-e;s"Axis must be <= rank of the tensor"));const s={input:n},r={dim:t};return to.runKernel(Ds,s,r)}});const Ph=fo({expm1_:function(e){const t={x:co(e,"x","expm1")};return to.runKernel(Ms,t)}});const Vh=fo({tile_:function(e,t){const n=co(e,"x","tile","string_or_numeric");qt(n.rank===t.length,(()=>`Error in transpose: rank of input ${n.rank} must match length of reps ${t}.`));const s={x:n},r={reps:t};return to.runKernel(_a,s,r)}});const Wh=fo({eye_:function(e,t,n,s="float32"){null==t&&(t=e);const r=Tl([e,t],s),a=e<=t?e:t;for(let e=0;e`Error in localResponseNormalization: x must be rank 3 or 4 but got\n rank ${a.rank}.`)),qt(Xt(t),(()=>`Error in localResponseNormalization: depthRadius must be an integer but got depthRadius ${t}.`));let i=a,o=!1;3===a.rank&&(o=!0,i=Tc(a,[1,a.shape[0],a.shape[1],a.shape[2]]));const l={x:i},u={depthRadius:t,bias:n,alpha:s,beta:r},c=to.runKernel(ir,l,u);return o?Tc(c,[c.shape[1],c.shape[2],c.shape[3]]):c}});const td=fo({log_:function(e){const t={x:co(e,"x","log","float32")};return to.runKernel(tr,t)}});const nd=fo({log1p_:function(e){const t={x:co(e,"x","log1p")};return to.runKernel(nr,t)}});const sd=fo({neg_:function(e){const t={x:co(e,"x","neg")};return to.runKernel(Ar,t)}});const rd=fo({softplus_:function(e){const t={x:co(e,"x","softplus")};return to.runKernel(ia,t)}});const ad=fo({logSigmoid_:function(e){const t=co(e,"x","logSigmoid");return Vl((e=>({value:sd(rd(sd(e))),gradFunc:t=>Bl(t,Mc(sd(e)))})))(t)}});const id=fo({logSoftmax_:function(e,t=-1){const n=co(e,"logits","logSoftmax");if(-1===t&&(t=n.rank-1),t!==n.rank-1)throw Error(`Log Softmax along a non-last dimension is not yet supported. Logits was rank ${n.rank} and axis was ${t}`);const s=Vl(((e,n)=>{const s=Oh(e,t,!0),r=Ql(e,s),a=Ql(Nl(r,"float32"),td(Dh(zh(r),t,!0)));n([a]);return{value:a,gradFunc:(e,n)=>{const[s]=n,r=zh(s);return Ql(e,Bl(Dh(e,t,!0),r))}}}));return s(n)}});const od=fo({logSumExp_:function(e,t=null,n=!1){const s=co(e,"x","logSumExp"),r=en(t,s.shape),a=Oh(s,r,!0),i=Ql(s,a),o=zh(i),l=Dh(o,r),u=td(l),c=Dl(Tc(a,u.shape),u);if(n){const e=Eh(c.shape,r);return Tc(c,e)}return c}});const ld=fo({logicalAnd_:function(e,t){const n=co(e,"a","logicalAnd","bool"),s=co(t,"b","logicalAnd","bool");su(n.shape,s.shape);const r={a:n,b:s};return to.runKernel(sr,r)}});const ud=fo({logicalNot_:function(e){const t={x:co(e,"x","logicalNot","bool")};return to.runKernel(rr,t)}});const cd=fo({logicalOr_:function(e,t){const n=co(e,"a","logicalOr","bool"),s=co(t,"b","logicalOr","bool");su(n.shape,s.shape);const r={a:n,b:s};return to.runKernel(ar,r)}});const hd=fo({logicalXor_:function(e,t){const n=co(e,"a","logicalXor","bool"),s=co(t,"b","logicalXor","bool");return su(n.shape,s.shape),ld(cd(e,t),ud(ld(e,t)))}}),dd=2147483648;const pd=fo({searchSorted_:function(e,t,n="left"){const s=co(e,"sortedSequence","searchSorted"),r=co(t,"values","searchSorted"),a=s.shape[s.shape.length-1],i=r.shape[r.shape.length-1],o=Tc(s,[-1,a]),l=Tc(r,[-1,i]);if(o.rank<2)throw new Error("Sorted input argument must be at least 2-dimensional");if(o.shape[0]!==l.shape[0])throw new Error("Leading dimension of 'sortedSequence' and 'values' must match.");if($t(l.shape)>=dd)throw new Error("values tensor size must less than 2147483648");if(o.shape[1]>=dd)throw new Error(`trailing dim_size must less than 2147483648 for int32 output type, was ${o.shape[1]}`);const u={sortedSequence:o,values:l},c={side:n};return to.runKernel(Qr,u,c)}});function fd(e,t){return pd(e,t,"left")}const md=fo({maxPool_:function(e,t,n,s,r){const a=co(e,"x","maxPool");let i=a,o=!1;3===a.rank&&(o=!0,i=Tc(a,[1,a.shape[0],a.shape[1],a.shape[2]])),qt(4===i.rank,(()=>`Error in maxPool: input must be rank 4 but got rank ${i.rank}.`)),qt(Sc(n,1),(()=>`Error in maxPool: Either strides or dilations must be 1. Got strides ${n} and dilations '1'`)),Ic("maxPool",s,r);const l={x:i},u={filterSize:t,strides:n,pad:s,dimRoundingMode:r},c=to.runKernel(cr,l,u);return o?Tc(c,[c.shape[1],c.shape[2],c.shape[3]]):c}});const gd=fo({maxPool3d_:function(e,t=[1,1,1],n,s,r,a="NDHWC"){const i=co(e,"x","maxPool3d");let o=i,l=!1;4===i.rank&&(l=!0,o=Tc(i,[1,i.shape[0],i.shape[1],i.shape[2],i.shape[3]])),qt(5===o.rank,(()=>`Error in maxPool3d: x must be rank 5 but got rank ${o.rank}.`)),qt("NDHWC"===a,(()=>`Error in maxPool3d: Only NDHWC is currently supported, but got dataFormat of ${a}`)),Ic("maxPool3d",s,r);const u={x:o},c={filterSize:t,strides:n,pad:s,dimRoundingMode:r,dataFormat:a},h=to.runKernel(dr,u,c);return l?Tc(h,[h.shape[1],h.shape[2],h.shape[3],h.shape[4]]):h}});const yd=fo({maxPoolWithArgmax_:function(e,t,n,s,r=!1){const a={x:co(e,"x","maxPoolWithArgmax")},i={filterSize:t,strides:n,pad:s,includeBatchInIndex:r},o=to.runKernel(fr,a,i);return{result:o[0],indexes:o[1]}}});const bd=fo({mean_:function(e,t=null,n=!1){const s={x:co(e,"x","mean")},r={axis:t,keepDims:n};return to.runKernel(mr,s,r)}});function wd(e,t="float32"){if(bn(e),"complex64"===t){const t=wd(e,"float32"),n=wd(e,"float32");return mo(t,n)}const n=gn($t(e),t);return to.makeTensor(n,e,t)}function vd(e,t="float32"){if(bn(e),"complex64"===t){const t=vd(e,"float32"),n=wd(e,"float32");return mo(t,n)}const n=mn($t(e),t);return to.makeTensor(n,e,t)}function xd(e,t,{indexing:n="xy"}={}){if("xy"!==n&&"ij"!==n)throw new TypeError(`${n} is not a valid third argument to meshgrid`);if(void 0===e)return[];let s=co(e,"x","meshgrid",e instanceof Mi?e.dtype:"float32");if(void 0===t)return[s];let r=co(t,"y","meshgrid",t instanceof Mi?t.dtype:"float32");const a=$t(s.shape),i=$t(r.shape);return"xy"===n?(s=Tc(s,[1,-1]),r=Tc(r,[-1,1]),[Dc(vd([i,1],s.dtype),s),Dc(r,vd([1,a],r.dtype))]):(s=Tc(s,[-1,1]),r=Tc(r,[1,-1]),[Dc(s,vd([1,i],s.dtype)),Dc(vd([a,1],r.dtype),r)])}const Ad=fo({minimum_:function(e,t){let n=co(e,"a","minimum"),s=co(t,"b","minimum");[n,s]=$i(n,s),"bool"===n.dtype&&(n=Nl(n,"int32"),s=Nl(s,"int32")),su(n.shape,s.shape);const r={a:n,b:s};return to.runKernel(yr,r)}});const kd=fo({mirrorPad_:function(e,t,n){qt("reflect"===n||"symmetric"===n,(()=>`Invalid mode. Mode must be either reflect or symmetric. Got ${n}.`));const s=co(e,"x","mirrorPad");if(0===s.rank)throw new Error("mirrorPad(scalar) is not defined. Pass non-scalar to mirrorPad");qt(t.length===s.rank,(()=>`Padding doesn't match input. Must be ${s.rank}. Got ${t.length}.`));const r="reflect"===n?1:0;for(let e=0;e"Invalid number of paddings. Must be length of 2 each.")),qt(t[e][0]>=0&&t[e][0]<=s.shape[e]-r&&t[e][1]>=0&&t[e][1]<=s.shape[e]-r,(()=>`Padding in dimension ${e} cannot be greater than or equal to ${s.shape[e]-r} or less than 0 for input of shape ${s.shape}`));const a={paddings:t,mode:n},i={x:s};return to.runKernel(br,i,a)}});const Cd=fo({mod_:function(e,t){let n=co(e,"a","mod"),s=co(t,"b","mod");[n,s]=$i(n,s);const r={a:n,b:s};return to.runKernel(wr,r)}});const Sd=fo({moments_:function(e,t=null,n=!1){const s=en(t,(e=co(e,"x","moments")).shape),r=bd(e,s,n);let a=r.shape;n||(a=Eh(r.shape,s));const i=Ll(Ql(Nl(e,"float32"),Tc(r,a)));return{mean:r,variance:bd(i,s,n)}}});const Ed=fo({multiRNNCell_:function(e,t,n,s){const r=co(t,"data","multiRNNCell"),a=ho(n,"c","multiRNNCell"),i=ho(s,"h","multiRNNCell");let o=r;const l=[];for(let t=0;t2)throw new Error(`Rank of probabilities must be 1 or 2, but is ${i}`);n=n||Math.random();const o={logits:1===i?Tc(r,[1,-1]):r},l={numSamples:t,seed:n,normalized:s},u=to.runKernel(vr,o,l);return 1===i?Tc(u,[u.size]):u}});const Id=fo({notEqual_:function(e,t){let n=co(e,"a","notEqual","string_or_numeric"),s=co(t,"b","notEqual","string_or_numeric");[n,s]=$i(n,s),su(n.shape,s.shape);const r={a:n,b:s};return to.runKernel(kr,r)}});const Td=fo({oneHot_:function(e,t,n=1,s=0,r="int32"){if(t<2)throw new Error(`Error in oneHot: depth must be >=2, but it is ${t}`);const a={indices:co(e,"indices","oneHot","int32")},i={dtype:r,depth:t,onValue:n,offValue:s};return to.runKernel(Ir,a,i)}});const Nd=fo({onesLike_:function(e){const t={x:co(e,"x","onesLike")};return to.runKernel(_r,t)}});const Od=fo({outerProduct_:function(e,t){const n=co(e,"v1","outerProduct"),s=co(t,"v2","outerProduct");qt(1===n.rank&&1===s.rank,(()=>`Error in outerProduct: inputs must be rank 1, but got ranks ${n.rank} and ${s.rank}.`));const r=Tc(n,[-1,1]),a=Tc(s,[1,-1]);return Dc(r,a)}});const Rd=fo({pad_:function(e,t,n=0){const s=co(e,"x","pad");if(0===s.rank)throw new Error("pad(scalar) is not defined. Pass non-scalar to pad");const r={paddings:t,constantValue:n},a={x:s};return to.runKernel(Nr,a,r)}});const Dd=fo({pad1d_:function(e,t,n=0){return qt(2===t.length,(()=>"Invalid number of paddings. Must be length of 2.")),Rd(e,[t],n)}});const Md=fo({pad2d_:function(e,t,n=0){return qt(2===t.length&&2===t[0].length&&2===t[1].length,(()=>"Invalid number of paddings. Must be length of 2 each.")),Rd(e,t,n)}});const Fd=fo({pad3d_:function(e,t,n=0){return qt(3===t.length&&2===t[0].length&&2===t[1].length&&2===t[2].length,(()=>"Invalid number of paddings. Must be length of 2 each.")),Rd(e,t,n)}});const Bd=fo({pad4d_:function(e,t,n=0){return qt(4===t.length&&2===t[0].length&&2===t[1].length&&2===t[2].length&&2===t[3].length,(()=>"Invalid number of paddings. Must be length of 2 each.")),Rd(e,t,n)}});const zd=fo({spaceToBatchND_:function(e,t,n){const s=co(e,"x","spaceToBatchND");qt(s.rank>=1+t.length,(()=>`input rank ${s.rank} should be > than [blockShape] ${t.length}`)),qt(n.length===t.length,(()=>`paddings.shape[0] ${n.length} must be equal to [blockShape] ${t.length}`)),qt(s.shape.reduce(((e,s,r)=>r>0&&r<=t.length?e&&(s+n[r-1][0]+n[r-1][1])%t[r-1]==0:e),!0),(()=>`input spatial dimensions ${s.shape.slice(1)} with paddings ${n.toString()} must be divisible by blockShapes ${t.toString()}`));const r={x:s},a={blockShape:t,paddings:n};return to.runKernel(ua,r,a)}});const Ld=fo({pool_:function(e,t,n,s,r,a,i){null==r&&(r=[1,1]),null==a&&(a=1),0===s&&(s="valid");const o=co(e,"x","maxPool");let l=o,u=!1;3===o.rank&&(u=!0,l=Tc(o,[1,o.shape[0],o.shape[1],o.shape[2]])),qt(Sc(a,r),(()=>`Error in pool: Either strides or dilations must be 1. Got strides ${a} and dilations '${r}'`));const c=mc(l.shape,t,a,r,s),h=[c.dilationHeight,c.dilationWidth];let d;d="same"===s?function(e,t){const n=e.map(((e,n)=>e+(e-1)*(t[n]-1))),s=n.map((e=>e-1)),r=s.map((e=>Math.floor(e/2))),a=s.map(((e,t)=>e-r[t]));return s.map(((e,t)=>[r[t],a[t]]))}([c.filterHeight,c.filterWidth],h):[[0,0],[0,0]];const p=1===h[0]&&1===h[1],[f,m]=function(e,t,n){const s=n.map((e=>e[0])),r=n.map((e=>e[1])),a=e.concat(s,r),i=t.map(((e,t)=>(e-a[t]%e)%e)),o=r.map(((e,t)=>e+i[t])),l=t.map(((e,t)=>[s[t],o[t]])),u=t.map(((e,t)=>[0,i[t]]));return[l,u]}([c.inHeight,c.inWidth],h,d),g=p?s:"valid",y=p?l:zd(l,h,f),b=("avg"===n?()=>Nc(y,t,a,g,i):()=>md(y,t,a,g,i))(),w=p?b:Lc(b,h,m);return u?Tc(w,[w.shape[1],w.shape[2],w.shape[3]]):w}});const Pd=fo({prelu_:function(e,t){const n={x:co(e,"x","prelu"),alpha:co(t,"alpha","prelu")};return to.runKernel(Rr,n)}});const Vd=fo({prod_:function(e,t=null,n=!1){let s=co(e,"x","prod");"bool"===s.dtype&&(s=Nl(s,"int32"));const r={x:s},a={axis:t,keepDims:n};return to.runKernel(Dr,r,a)}});const Wd=fo({raggedGather_:function(e,t,n,s){const r={paramsNestedSplits:e.map(((e,t)=>co(e,`tensors${t}`,"raggedGather","int32"))),paramsDenseValues:co(t,"paramsDenseValues","raggedGather"),indices:co(n,"indices","raggedGather","int32")},a={outputRaggedRank:s},i=to.runKernel(Mr,r,a);return{outputNestedSplits:i.slice(0,i.length-1),outputDenseValues:i[i.length-1]}}});const Ud=fo({raggedRange_:function(e,t,n){const s=co(e,"starts","raggedRange"),r={starts:s,limits:co(t,"limits","raggedRange",s.dtype),deltas:co(n,"deltas","raggedRange",s.dtype)},a=to.runKernel(Fr,r);return{rtNestedSplits:a[0],rtDenseValues:a[1]}}});const Gd=fo({raggedTensorToTensor_:function(e,t,n,s,r){const a=co(e,"shape","raggedTensorToTensor","int32"),i=co(t,"values","raggedTensorToTensor"),o={shape:a,values:i,defaultValue:co(n,"defaultValue","raggedTensorToTensor",i.dtype),rowPartitionTensors:s.map(((e,t)=>co(e,`tensors${t}`,"raggedTensorToTensor","int32")))},l={rowPartitionTypes:r};return to.runKernel(Br,o,l)}});const qd=fo({rand_:function(e,t,n){bn(e);const s=$t(e);let r=null;if(null==n||"float32"===n)r=new Float32Array(s);else if("int32"===n)r=new Int32Array(s);else{if("bool"!==n)throw new Error(`Unknown data type ${n}`);r=new Uint8Array(s)}for(let e=0;e=1||0===a);const i=Math.sqrt(-2*Math.log(a)/a);e=this.mean+this.stdDev*s*i,t=this.mean+this.stdDev*r*i,this.truncated&&!this.isValidTruncated(e)||(n=!0)}return this.truncated&&!this.isValidTruncated(t)||(this.nextVal=this.convertValue(t)),this.convertValue(e)}convertValue(e){return null==this.dtype||"float32"===this.dtype?e:Math.round(e)}isValidTruncated(e){return e<=this.upper&&e>=this.lower}}class $d{constructor(e,t,n,s){this.alpha=e,this.beta=1/t,this.dtype=n;const r=s||Math.random();this.randu=jd.alea(r.toString()),this.randn=new Hd(0,1,n,!1,this.randu()),this.d=e<1?e+2/3:e-1/3,this.c=1/Math.sqrt(9*this.d)}nextValue(){let e,t,n,s,r,a;for(;;){do{s=this.randn.nextValue(),a=1+this.c*s}while(a<=0);if(a*=a*a,e=s*s,t=1-.331*e*e,n=.5*e+this.d*(1-a+Math.log(a)),r=this.randu(),rnull==this.dtype||"float32"===this.dtype,this.min=e,this.range=t-e,this.dtype=n,null==s&&(s=Math.random()),"number"==typeof s&&(s=s.toString()),!this.canReturnFloat()&&this.range<=1)throw new Error(`The difference between ${e} - ${t} <= 1 and dtype is not float`);this.random=jd.alea(s)}convertValue(e){return this.canReturnFloat()?e:Math.round(e)}nextValue(){return this.convertValue(this.min+this.range*this.random())}}const Xd=fo({randomGamma_:function(e,t,n=1,s="float32",r){if(bn(e),null==n&&(n=1),null==s&&(s="float32"),"float32"!==s&&"int32"!==s)throw new Error(`Unsupported data type ${s}`);const a=new $d(t,n,s,r),i=Tl(e,s);for(let e=0;e`Error in reverse1D: x must be rank 1 but got rank ${t.rank}.`)),ap(t,0)}});const op=fo({reverse2d_:function(e,t){const n=co(e,"x","reverse");return qt(2===n.rank,(()=>`Error in reverse2D: x must be rank 2 but got rank ${n.rank}.`)),ap(n,t)}});const lp=fo({reverse3d_:function(e,t){const n=co(e,"x","reverse");return qt(3===n.rank,(()=>`Error in reverse3D: x must be rank 3 but got rank ${n.rank}.`)),ap(n,t)}});const up=fo({reverse4d_:function(e,t){const n=co(e,"x","reverse");return qt(4===n.rank,(()=>`Error in reverse4D: x must be rank 4 but got rank ${n.rank}.`)),ap(n,t)}});const cp=fo({round_:function(e){const t={x:co(e,"x","round")};return to.runKernel(Kr,t)}});const hp=fo({rsqrt_:function(e){const t={x:co(e,"x","rsqrt","float32")};return to.runKernel(Xr,t)}});const dp=fo({selu_:function(e){const t={x:co(e,"x","selu")};return to.runKernel(ea,t)}});const pp=fo({separableConv2d_:function(e,t,n,s,r,a=[1,1],i="NHWC"){const o=co(e,"x","separableConv2d"),l=co(t,"depthwiseFilter","separableConv2d"),u=co(n,"pointwiseFilter","separableConv2d");let c=o,h=!1;if(3===o.rank&&(h=!0,c=Tc(o,[1,o.shape[0],o.shape[1],o.shape[2]])),"NCHW"===i)throw new Error("separableConv2d currently does not support dataFormat NCHW; only NHWC is supported");qt(4===c.rank,(()=>`Error in separableConv2d: input must be rank 4, but got rank ${c.rank}.`)),qt(4===l.rank,(()=>`Error in separableConv2d: depthwise filter must be rank 4, but got rank ${l.rank}.`)),qt(4===u.rank,(()=>`Error in separableConv2d: pointwise filter must be rank 4, but got rank ${l.rank}.`)),qt(1===u.shape[0],(()=>`Error in separableConv2d: the first dimension of pointwise filter must be 1, but got ${u.shape[0]}.`)),qt(1===u.shape[1],(()=>`Error in separableConv2d: the second dimension of pointwise filter must be 1, but got ${u.shape[1]}.`));const d=l.shape[2],p=l.shape[3];qt(u.shape[2]===d*p,(()=>`Error in separableConv2d: the third dimension of pointwise filter must be ${d*p}, but got ${u.shape[2]}.`));const f=dh(c,l,s,r,i,a),m=Jc(f,u,1,"valid",i);return h?Tc(m,[m.shape[1],m.shape[2],m.shape[3]]):m}});const fp=async function(e,t){const n=co(e,"x","setdiff1d"),s=co(t,"y","setdiff1d");qt(n.dtype===s.dtype,(()=>`x and y should have the same dtype, but got x (${n.dtype}) and y (${s.dtype}).`)),qt(1===n.rank,(()=>`x should be 1D tensor, but got x (${n.shape}).`)),qt(1===s.rank,(()=>`y should be 1D tensor, but got y (${s.shape}).`));const r=await n.data(),a=await s.data(),i=new Set(a);let o=0;for(let e=0;e`slice1d expects a rank-1 tensor, but got a rank-${s.rank} tensor`)),Fc(s,[t],[n])}});const wp=fo({slice2d_:function(e,t,n){const s=co(e,"x","slice2d");return qt(2===s.rank,(()=>`slice2d expects a rank-2 tensor, but got a rank-${s.rank} tensor`)),Fc(s,t,n)}});const vp=fo({slice3d_:function(e,t,n){const s=co(e,"x","slice3d");return qt(3===s.rank,(()=>`slice3d expects a rank-3 tensor, but got a rank-${s.rank} tensor`)),Fc(s,t,n)}});const xp=fo({slice4d_:function(e,t,n){const s=co(e,"x","slice4d");return qt(4===s.rank,(()=>`slice4d expects a rank-4 tensor, but got a rank-${s.rank} tensor`)),Fc(s,t,n)}});const Ap=fo({softmax_:function(e,t=-1){const n=co(e,"logits","softmax","float32");if(-1===t&&(t=n.rank-1),t!==n.rank-1)throw Error(`Softmax along a non-last dimension is not yet supported. Logits was rank ${n.rank} and dim was ${t}`);const s={logits:n},r={dim:t};return to.runKernel(ha,s,r)}});const kp=fo({fft_:function(e){qt("complex64"===e.dtype,(()=>`The dtype for tf.spectral.fft() must be complex64 but got ${e.dtype}.`));const t={input:e};return to.runKernel(Fs,t)}});const Cp=fo({ifft_:function(e){qt("complex64"===e.dtype,(()=>`The dtype for tf.spectral.ifft() must be complex64 but got ${e.dtype}.`));const t={input:e};return to.runKernel(Hs,t)}});const Sp=fo({irfft_:function(e){const t=e.shape[e.shape.length-1],n=e.size/t;let s;if(t<=2){const r=Tc(e,[n,t]);s=Cp(r)}else{const r=[n,2*(t-1)],a=Tc(tp(e),[n,t]),i=Tc(Hh(e),[n,t]),o=ap(Fc(a,[0,1],[n,t-2]),1),l=Bl(ap(Fc(i,[0,1],[n,t-2]),1),Wl(-1)),u=Rc([a,o],1),c=Rc([i,l],1),h=Tc(mo(u,c),[r[0],r[1]]);s=Cp(h)}if(s=tp(s),3===e.rank&&0!==e.shape[0]){const t=s,n=e.shape[0];s=Tc(s,[n,s.shape[0]/n,s.shape[1]]),t.dispose()}return s}});const Ep=fo({split_:function(e,t,n=0){const s={x:co(e,"x","split")},r={numOrSizeSplits:t,axis:n};return to.runKernel(ca,s,r)}});const _p=fo({rfft_:function(e,t){qt("float32"===e.dtype,(()=>`The dtype for rfft() must be real value but got ${e.dtype}`));let n=e.shape[e.shape.length-1];const s=e.size/n;let r;if(null!=t&&t0)),a=e.shape.map((e=>e));a[e.shape.length-1]=t,r=Fc(e,s,a),n=t}else if(null!=t&&t>n){const s=e.shape.map((e=>e));s[e.shape.length-1]=t-n,r=Rc([e,wd(s)],e.shape.length-1),n=t}else r=e;const a=Pl(r),i=Tc(mo(r,a),[s,n]),o=kp(i),l=Math.floor(n/2)+1,u=tp(o),c=Hh(o),h=Ep(u,[l,n-l],u.shape.length-1),d=Ep(c,[l,n-l],c.shape.length-1),p=r.shape.slice();return p[r.shape.length-1]=l,Tc(mo(h[0],d[0]),p)}});const Ip=fo({squaredDifference_:function(e,t){let n=co(e,"a","squaredDifference"),s=co(t,"b","squaredDifference");[n,s]=$i(n,s),su(n.shape,s.shape);const r={a:n,b:s};return to.runKernel(ya,r,{})}});const Tp=fo({squeeze_:function(e,t){const n=co(e,"x","squeeze","string_or_numeric");return Tc(n,tn(n.shape,t).newShape)}});const Np=fo({stack_:function(e,t=0){const n=ho(e,"tensors","stack","string_or_numeric");qt(n.length>=1,(()=>"Pass at least one tensor to tf.stack")),n.length>0&&qt(t<=n[0].rank,(()=>"Axis must be <= rank of the tensor"));const s=n,r={axis:t};return to.runKernel(Tr,s,r)}});const Op=fo({step_:function(e,t=0){const n={x:co(e,"x","step")},s={alpha:t};return to.runKernel(Fa,n,s)}});const Rp=fo({stridedSlice_:function(e,t,n,s,r=0,a=0,i=0,o=0,l=0){const u={x:co(e,"x","stridedSlice","string_or_numeric")},c={begin:t,end:n,strides:s,beginMask:r,endMask:a,ellipsisMask:i,newAxisMask:o,shrinkAxisMask:l};return to.runKernel(va,u,c)}});const Dp=fo({tan_:function(e){const t={x:co(e,"x","tan","float32")};return to.runKernel(Sa,t)}});function Mp(e,t){Ht(e);const n=oo(e,t);if(1!==n.length)throw new Error("tensor1d() requires values to be a flat/TypedArray");return go(e,null,n,t)}function Fp(e,t,n){if(Ht(e),null!=t&&2!==t.length)throw new Error("tensor2d() requires shape to have two numbers");const s=oo(e,n);if(2!==s.length&&1!==s.length)throw new Error("tensor2d() requires values to be number[][] or flat/TypedArray");if(1===s.length&&null==t)throw new Error("tensor2d() requires shape to be provided when `values` are a flat/TypedArray");return go(e,t,s,n)}function Bp(e,t,n){if(Ht(e),null!=t&&4!==t.length)throw new Error("tensor4d() requires shape to have four numbers");const s=oo(e,n);if(4!==s.length&&1!==s.length)throw new Error("tensor4d() requires values to be number[][][][] or flat/TypedArray");if(1===s.length&&null==t)throw new Error("tensor4d() requires shape to be provided when `values` are a flat array");return go(e,t,s,n)}function zp(e,t,n){if(Ht(e),null!=t&&5!==t.length)throw new Error("tensor5d() requires shape to have five numbers");const s=oo(e,n);if(5!==s.length&&1!==s.length)throw new Error("tensor5d() requires values to be number[][][][][] or flat/TypedArray");if(1===s.length&&null==t)throw new Error("tensor5d() requires shape to be provided when `values` are a flat array");return go(e,t,s,n)}function Lp(e,t,n){if(Ht(e),null!=t&&6!==t.length)throw new Error("tensor6d() requires shape to have six numbers");const s=oo(e,n);if(6!==s.length&&1!==s.length)throw new Error("tensor6d() requires values to be number[][][][][][] or flat/TypedArray");if(1===s.length&&null==t)throw new Error("tensor6d() requires shape to be provided when `values` are a flat array");return go(e,t=t||s,s,n)}function Pp(e,t,n){const s=t.rank>1?t.shape[t.rank-1]:1,r=t.rank>1?t.rank-1:1,a=`Must have updates.shape = indices.shape[:batchDim] + shape[sliceDim:], got updates.shape: ${n.shape}, indices.shape: ${t.shape}, shape: ${e}, sliceDim: ${s}, and batchDim: ${r}.`;if(n.rank1?t.shape[s-1]:1,a=n.length;let i=1;for(let e=r;e= 0 but got ${t}`);if(t>r)throw new Error(`'k' passed to topk() must be <= the last dimension (${r}) but got ${t}`);const a={x:s},i={k:t,sorted:n},[o,l]=to.runKernel(Ia,a,i);return{values:o,indices:l}}});const qp=fo({truncatedNormal_:function(e,t=0,n=1,s,r){if(bn(e),null!=s&&"bool"===s)throw new Error("Unsupported data type $ { dtype }");const a=new Hd(t,n,s,!0,r),i=Tl(e,s);for(let e=0;e0,(()=>"The input tensor must be at least 1D"));const s={x:n},r={axis:t},[a,i]=to.runKernel(Oa,s,r);return{values:a,indices:i}}});const Hp=fo({unsortedSegmentSum_:function(e,t,n){const s=co(e,"x","unsortedSegmentSum"),r=co(t,"segmentIds","unsortedSegmentSum","int32");qt(Xt(n),(()=>"numSegments must be of dtype int"));const a={x:s,segmentIds:r},i={numSegments:n};return to.runKernel(Da,a,i)}});const $p=fo({unstack_:function(e,t=0){const n=co(e,"x","unstack","string_or_numeric");qt(t>=-n.shape.length&&t`Axis = ${t} is not in [-${n.shape.length}, ${n.shape.length})`));const s={value:n},r={axis:t};return to.runKernel(Ra,s,r)}});function Kp(e,t){return pd(e,t,"right")}function Xp(e,t=!0,n,s){return to.makeVariable(e,t,n,s)}function Zp(e,t){const n=[];for(let e=0;e0,(()=>"mask cannot be scalar")),jt(o.slice(a,a+i),r.shape,"mask's shape must match the first K dimensions of tensor's shape,");let l=1;for(let e=a;et)).reverse()),qt(s.rank===t.length,(()=>`Error in transpose: rank of input ${s.rank} must match length of perm ${t}.`)),t.forEach((e=>{qt(e>=0&&e"All entries in 'perm' must be between 0 and "+(s.rank-1)+` but got ${t}`))})),s.rank<=1)return s.clone();const r={x:s},a={perm:t};return"complex64"===s.dtype?Ao((()=>{let e=tp(s),t=Hh(s);return e=to.runKernel(Na,{x:e},a),t=to.runKernel(Na,{x:t},a),n&&(t=sd(t)),mo(e,t)})):to.runKernel(Na,r,a)}});const ef=fo({movingAverage_:function(e,t,n,s,r=!0){const a=co(e,"v","movingAverage"),i=co(t,"x","movingAverage"),o=co(n,"decay","movingAverage");var l,u;u=i,qt((l=a).dtype===u.dtype,(()=>`The dtypes of the first(${l.dtype}) and second(${u.dtype}) input must match`)),qt(Kt(a.shape,i.shape),(()=>"Shape mismatch in v and x"));const c=Wl(1),h=Ql(c,o);let d=Bl(Ql(i,a),h);if(r){qt(null!=s,(()=>"When using zeroDebias: true, step is required."));const e=co(s,"step","movingAverage");d=Fl(d,Ql(c,Yl(o,e)))}return Dl(a,d)}});const tf=fo({scatterND_:function(e,t,n){bn(n);const s=co(e,"indices","scatterND","int32"),r=co(t,"updates","scatterND");Vp(r,s,n);const a={indices:s,updates:r},i={shape:n};return to.runKernel(Zr,a,i)}});const nf=fo({sparseToDense_:function(e,t,n,s=0){bn(n);const r=co(e,"sparseIndices","sparseToDense","int32"),a=co(t,"sparseValues","sparseToDense","string_or_numeric"),i=co(s,"defaultValue","sparseToDense",a.dtype);!function(e,t,n,s){if("int32"!==e.dtype)throw new Error(`tf.sparseToDense() expects the indices to be int32 type, but the dtype was ${e.dtype}.`);if(e.rank>2)throw new Error(`sparseIndices should be a scalar, vector, or matrix, but got shape ${e.shape}.`);const r=e.rank>0?e.shape[0]:1,a=e.rank>1?e.shape[1]:1;if(n.length!==a)throw new Error(`outputShape has incorrect number of elements:, ${n.length}, should be: ${a}.`);const i=t.size;if(0!==t.rank&&(1!==t.rank||i!==r))throw new Error(`sparseValues has incorrect shape ${t.shape}, should be [] or [${r}]`);if(t.dtype!==s.dtype)throw new Error("sparseValues.dtype must match defaultValues.dtype")}(r,a,n,i);const o={sparseIndices:r,sparseValues:a,defaultValue:i},l={outputShape:n};return to.runKernel(ga,o,l)}});const sf=fo({gatherND_:function(e,t){const n=co(t,"indices","gatherND","int32"),s={params:co(e,"x","gatherND","string_or_numeric"),indices:n};return to.runKernel(Us,s)}});const rf=fo({dropout_:function(e,t,n,s){const r=co(e,"x","dropout");if(qt("float32"===r.dtype,(()=>`x has to be a floating point tensor since it's going to be scaled, but got a ${r.dtype} tensor instead.`)),qt(t>=0&&t<1,(()=>`rate must be a float in the range [0, 1), but got ${t}.`)),0===t)return e instanceof Mi?r.clone():r;const a=function(e,t){if(null==t)return e.shape.slice();if(Kt(e.shape,t))return t;if(e.shape.length===t.length){const n=[];for(let s=0;s1,(()=>`inTopK() expects the predictions to be of rank 2 or higher, but got ${s.rank}`)),qt(s.rank-1===r.rank,(()=>`predictions rank should be 1 larger than targets rank, but got predictions rank ${s.rank} and targets rank ${r.rank}`)),jt(s.shape.slice(0,s.shape.length-1),r.shape,"predictions's shape should be align with the targets' shape, except the last dimension.");const a=s.shape[s.shape.length-1];qt(n>0&&n<=a,(()=>`'k' passed to inTopK() must be > 0 && <= the predictions last dimension (${a}), but got ${n}`));const i=await s.data(),o=await r.data(),[l,u]=[i.length/a,a],c=nn("bool",l);for(let e=0;et.value-e.value)),c[e]=0;for(let t=0;t`Error in conv2dDerFilter: input must be rank 4, but got shape ${o.shape}.`)),qt(4===l.rank,(()=>`Error in conv2dDerFilter: dy must be rank 4, but got shape ${l.shape}.`)),qt(4===n.length,(()=>`Error in conv2dDerFilter: filterShape must be length 4, but got ${n}.`));const u="NHWC"===a?o.shape[3]:o.shape[1],c="NHWC"===a?l.shape[3]:l.shape[1];qt(u===n[2],(()=>`Error in conv2dDerFilter: depth of input ${u}) must match input depth in filter (${n[2]}.`)),qt(c===n[3],(()=>`Error in conv2dDerFilter: depth of dy (${c}) must match output depth for filter (${n[3]}).`)),Ic("conv2dDerFilter",r,i);const h={x:o,dy:l},d={strides:s,pad:r,dataFormat:a,dimRoundingMode:i,filterShape:n};return to.runKernel(is,h,d)}});function cf(e,t,n){if(null==n||"linear"===n)return e;if("relu"===n)return Bl(e,Op(t));throw new Error(`Cannot compute gradient for fused activation ${n}.`)}function hf(e,t){let n=t;const s=nu(e.shape,t.shape);return s.length>0&&(n=Dh(n,s)),Tc(n,e.shape)}function df(e,t,n,s){if("linear"===t)return e;if("relu"===t)return sp(e);if("elu"===t)return vh(e);if("relu6"===t)return rp(e);if("prelu"===t)return Pd(e,n);if("leakyrelu"===t)return Zh(e,s);if("sigmoid"===t)return Mc(e);throw new Error(`Unknown fused activation ${t}.`)}const pf=(e,t)=>!(e>0)||"linear"===t;const ff=fo({fusedConv2d_:function({x:e,filter:t,strides:n,pad:s,dataFormat:r="NHWC",dilations:a=[1,1],dimRoundingMode:i,bias:o,activation:l="linear",preluActivationWeights:u,leakyreluAlpha:c}){if(l=l||"linear",!1===pf(to.state.gradientDepth,l)){qt("NHWC"===r,(()=>`Error in fused conv2d: got dataFormat of ${r} but only NHWC is currently supported for the case of gradient depth is 0 and the activation is not linear.`));let h=Jc(e,t,n,s,r,a,i);return null!=o&&(h=Dl(h,o)),df(h,l,u,c)}const h=co(e,"x","conv2d","float32"),d=co(t,"filter","conv2d","float32");let p=h,f=!1;3===h.rank&&(f=!0,p=Tc(h,[1,h.shape[0],h.shape[1],h.shape[2]])),qt(4===p.rank,(()=>`Error in fused conv2d: input must be rank 4, but got rank ${p.rank}.`)),qt(4===d.rank,(()=>`Error in fused conv2d: filter must be rank 4, but got rank ${d.rank}.`)),Ic("fused conv2d",s,i);const m="NHWC"===r?p.shape[3]:p.shape[1];qt(d.shape[2]===m,(()=>`Error in conv2d: depth of input (${m}) must match input depth for filter ${d.shape[2]}.`)),qt(Sc(n,a),(()=>`Error in conv2D: Either strides or dilations must be 1. Got strides ${n} and dilations '${a}'`));const g=yc(p.shape,d.shape,n,a,s,i);let y,b;if(null!=o&&(y=co(o,"bias","fused conv2d"),[y]=$i(y,h),"NHWC"===r?su(g.outShape,y.shape):(qt(y.shape.length<=1,(()=>`Error in fused conv2d: only supports scalar or 1-D Tensor bias for NCHW format but got the bias of rank-${y.shape.length}.`)),qt(0===y.shape.length||y.shape[0]===g.outChannels||1===y.shape[0],(()=>`Error in fused conv2d: bias shape (${y.shape}) is not compatible with the number of output channels (${g.outChannels})`)))),null!=u){const e=u.shape;if(qt(e.length<=1||3===e.length,(()=>`Error in fused conv2d: only supports scalar, 1-D Tensor or 3-D Tensor PReLU activation weights but got a tensor of rank-${e.length}.`)),1===e.length)qt(1===e[0]||e[0]===g.outChannels,(()=>`Error in fused conv2d: PReLU activation weights (${e}) is not compatible with the number of output channels (${g.outChannels}).`));else if(3===e.length)try{su(e,g.outShape)}catch(t){const n=`Error in fused conv2d: PReLU activation weights (${e}) is not compatible with the output shape of the conv2d (${g.outShape}).`;throw Error(n)}b=co(u,"prelu weights","fused conv2d")}const w=(e,t)=>{qt("NHWC"===r,(()=>`Error in gradient of fused conv2D: got dataFormat of ${r} but only NHWC is currently supported.`));const[i,o,u,c]=t,h=cf(e,u,l);qt(Cc(a),(()=>`Error in gradient of fused conv2D: dilation rates greater than 1 are not yet supported in gradients. Got dilations '${a}'`));const d=[th(o.shape,h,i,n,s),uf(o,h,i.shape,n,s)];if(null!=c){const e=hf(c,h);d.push(e)}return d},v={x:p,filter:d,bias:y,preluActivationWeights:b},x={strides:n,pad:s,dataFormat:r,dilations:a,dimRoundingMode:i,activation:l,leakyreluAlpha:c};if(null==o){const e=Vl(((e,t,n)=>{let s=to.runKernel(Pa,v,x);return n([t,e,s]),f&&(s=Tc(s,[s.shape[1],s.shape[2],s.shape[3]])),{value:s,gradFunc:w}}));return e(p,d)}{const e=Vl(((e,t,n,s)=>{let r=to.runKernel(Pa,v,x);return s([t,e,r,n]),f&&(r=Tc(r,[r.shape[1],r.shape[2],r.shape[3]])),{value:r,gradFunc:w}}));return e(p,d,y)}}});const mf=fo({depthwiseConv2dNativeBackpropFilter_:function(e,t,n,s,r,a=[1,1],i){let o=e;3===e.rank&&(o=Tc(e,[1,e.shape[0],e.shape[1],e.shape[2]]));let l=t;3===l.rank&&(l=Tc(t,[1,t.shape[0],t.shape[1],t.shape[2]]));const u={x:o,dy:l},c={strides:s,pad:r,dimRoundingMode:i,dilations:a,filterShape:n};return to.runKernel(ws,u,c)}});const gf=fo({depthwiseConv2dNativeBackpropInput_:function(e,t,n,s,r,a=[1,1],i){let o=t,l=!1;3===t.rank&&(l=!0,o=Tc(t,[1,t.shape[0],t.shape[1],t.shape[2]]));const u={dy:o,filter:n},c={strides:s,pad:r,dimRoundingMode:i,dilations:a,inputShape:e},h=to.runKernel(vs,u,c);return l?Tc(h,[h.shape[1],h.shape[2],h.shape[3]]):h}});const yf=fo({fusedDepthwiseConv2d_:function({x:e,filter:t,strides:n,pad:s,dataFormat:r="NHWC",dilations:a=[1,1],dimRoundingMode:i,bias:o,activation:l="linear",preluActivationWeights:u,leakyreluAlpha:c}){if(!1===pf(to.state.gradientDepth,l)){let h=dh(e,t,n,s,r,a,i);return null!=o&&(h=Dl(h,o)),df(h,l,u,c)}const h=co(e,"x","depthwiseConv2d","float32"),d=co(t,"filter","depthwiseConv2d","float32");let p=h,f=!1;3===h.rank&&(f=!0,p=Tc(h,[1,h.shape[0],h.shape[1],h.shape[2]])),qt(4===p.rank,(()=>`Error in fused depthwiseConv2d: input must be rank 4, but got rank ${p.rank}.`)),qt(4===d.rank,(()=>`Error in fused depthwiseConv2d: filter must be rank 4, but got rank ${d.rank}.`)),qt(p.shape[3]===d.shape[2],(()=>`Error in fused depthwiseConv2d: number of input channels (${p.shape[3]}) must match the inChannels dimension in filter ${d.shape[2]}.`)),null==a&&(a=[1,1]),qt(Sc(n,a),(()=>`Error in fused depthwiseConv2d: Either strides or dilations must be 1. Got strides ${n} and dilations '${a}'`)),Ic("fused depthwiseConv2d",s,i);const m=yc(p.shape,d.shape,n,a,s,i,!0);let g,y;null!=o&&(g=co(o,"bias","fused conv2d"),[g]=$i(g,h),su(m.outShape,g.shape)),null!=u&&(y=co(u,"prelu weights","fused depthwiseConv2d"));const b=(e,t)=>{qt(Cc(a),(()=>`Error in gradient of fused depthwiseConv2d: dilation rates greater than 1 are not yet supported. Got dilations '${a}'`));const[r,o,u,c]=t,h=cf(e,u,l),d=gf(o.shape,h,r,n,s,a,i),p=mf(o,h,r.shape,n,s,a,i);if(null!=c){return[d,p,hf(g,h)]}return[d,p]},w={x:p,filter:d,bias:g,preluActivationWeights:y},v={strides:n,pad:s,dataFormat:r,dilations:a,dimRoundingMode:i,activation:l,leakyreluAlpha:c};if(null==o){const e=Vl(((e,t,n)=>{let s=to.runKernel(Va,w,v);return n([t,e,s]),f&&(s=Tc(s,[s.shape[1],s.shape[2],s.shape[3]])),{value:s,gradFunc:b}}));return e(p,d)}{const e=Vl(((e,t,n,s)=>{let r=to.runKernel(Va,w,v);return s([t,e,r,n]),f&&(r=Tc(r,[r.shape[1],r.shape[2],r.shape[3]])),{value:r,gradFunc:b}}));return e(p,d,g)}}});const bf=fo({fusedMatMul_:function({a:e,b:t,transposeA:n=!1,transposeB:s=!1,bias:r,activation:a="linear",preluActivationWeights:i,leakyreluAlpha:o=.2}){if(!1===pf(to.state.gradientDepth,a)){let l=Dc(e,t,n,s);return null!=r&&(l=Dl(l,r)),df(l,a,i,o)}let l=co(e,"a","fused matMul"),u=co(t,"b","fused matMul");[l,u]=$i(l,u);const c=n?l.shape[l.rank-2]:l.shape[l.rank-1],h=s?u.shape[u.rank-1]:u.shape[u.rank-2],d=n?l.shape[l.rank-1]:l.shape[l.rank-2],p=s?u.shape[u.rank-2]:u.shape[u.rank-1],f=l.shape.slice(0,-2),m=u.shape.slice(0,-2),g=$t(f),y=$t(m);qt(c===h,(()=>`Error in fused matMul: inner shapes (${c}) and (${h}) of Tensors with shapes ${l.shape} and ${u.shape} and transposeA=${n} and transposeB=${s} must match.`));const b=su(l.shape.slice(0,-2),u.shape.slice(0,-2)).concat([d,p]),w=Tc(l,n?[g,c,d]:[g,d,c]),v=Tc(u,s?[y,p,h]:[y,h,p]);let x,A;null!=r&&(x=co(r,"bias","fused matMul"),[x]=$i(x,l),su(b,x.shape)),null!=i&&(A=co(i,"prelu weights","fused matMul"));const k=(e,t)=>{const[i,o,l,u]=t,c=cf(Tc(e,l.shape),l,a);let h,d;if(n||s?!n&&s?(h=Dc(c,o,!1,!1),d=Dc(c,i,!0,!1)):n&&!s?(h=Dc(o,c,!1,!0),d=Dc(i,c,!1,!1)):(h=Dc(o,c,!0,!0),d=Dc(c,i,!0,!0)):(h=Dc(c,o,!1,!0),d=Dc(i,c,!0,!1)),null!=r){return[h,d,hf(u,c)]}return[h,d]},C={a:w,b:v,bias:x,preluActivationWeights:A},S={transposeA:n,transposeB:s,activation:a,leakyreluAlpha:o};if(null==r){const e=Vl(((e,t,n)=>{const s=to.runKernel(La,C,S);return n([e,t,s]),{value:Tc(s,b),gradFunc:k}}));return e(w,v)}{const e=Vl(((e,t,n,s)=>{const r=to.runKernel(La,C,S);return s([e,t,r,n]),{value:Tc(r,b),gradFunc:k}}));return e(w,v,x)}}});const wf=fo({hammingWindow_:function(e){return of(e,.54,.46)}});const vf=fo({hannWindow_:function(e){return of(e,.5,.5)}});const xf=fo({frame_:function(e,t,n,s=!1,r=0){let a=0;const i=[];for(;a+t<=e.size;)i.push(Fc(e,a,t)),a+=n;if(s)for(;a`Error in cropAndResize: image must be rank 4,but got rank ${i.rank}.`)),qt(2===o.rank&&4===o.shape[1],(()=>`Error in cropAndResize: boxes must be have size [${u},4] but had shape ${o.shape}.`)),qt(1===l.rank&&l.shape[0]===u,(()=>`Error in cropAndResize: boxInd must be have size [${u}] but had shape ${o.shape}.`)),qt(2===s.length,(()=>`Error in cropAndResize: cropSize must be of length 2, but got length ${s.length}.`)),qt(s[0]>=1&&s[1]>=1,(()=>`cropSize must be atleast [1,1], but was ${s}`)),qt("bilinear"===r||"nearest"===r,(()=>`method must be bilinear or nearest, but was ${r}`));const c={image:i,boxes:o,boxInd:l},h={method:r,extrapolationValue:a,cropSize:s};return to.runKernel(ms,c,h)}});const Cf=fo({flipLeftRight_:function(e){const t=co(e,"image","flipLeftRight","float32");qt(4===t.rank,(()=>`Error in flipLeftRight: image must be rank 4,but got rank ${t.rank}.`));const n={image:t};return to.runKernel(zs,n,{})}});const Sf=fo({grayscaleToRGB_:function(e){const t=co(e,"image","grayscaleToRGB"),n=t.rank-1,s=t.shape[n];qt(t.rank>=2,(()=>`Error in grayscaleToRGB: images must be at least rank 2, but got rank ${t.rank}.`)),qt(1===s,(()=>`Error in grayscaleToRGB: last dimension of a grayscale image should be size 1, but got size ${s}.`));const r=new Array(t.rank);return r.fill(1,0,n),r[n]=3,Vh(t,r)}});const Ef=fo({rgbToGrayscale_:function(e){const t=co(e,"image","RGBToGrayscale"),n=t.rank-1,s=t.shape[n];qt(t.rank>=2,(()=>`Error in RGBToGrayscale: images must be at least rank 2, but got rank ${t.rank}.`)),qt(3===s,(()=>`Error in RGBToGrayscale: last dimension of an RGB image should be size 3, but got size ${s}.`));const r=t.dtype,a=Nl(t,"float32"),i=Mp([.2989,.587,.114]);let o;switch(t.rank){case 2:o=wh("ij,j->i",a,i);break;case 3:o=wh("ijk,k->ij",a,i);break;case 4:o=wh("ijkl,l->ijk",a,i);break;case 5:o=wh("ijklm,m->ijkl",a,i);break;case 6:o=wh("ijklmn,n->ijklm",a,i);break;default:throw new Error("Not a valid tensor rank.")}return o=Lh(o,-1),Nl(o,r)}});const _f=fo({rotateWithOffset_:function(e,t,n=0,s=.5){const r=co(e,"image","rotateWithOffset","float32");qt(4===r.rank,(()=>`Error in rotateWithOffset: image must be rank 4,but got rank ${r.rank}.`));const a={image:r},i={radians:t,fillValue:n,center:s};return to.runKernel(za,a,i)}});function If(e,t,n,s,r,a){null==s&&(s=.5),null==r&&(r=Number.NEGATIVE_INFINITY),null==a&&(a=0);const i=e.shape[0];return n=Math.min(n,i),qt(0<=s&&s<=1,(()=>`iouThreshold must be in [0, 1], but was '${s}'`)),qt(2===e.rank,(()=>`boxes must be a 2D tensor, but was of rank '${e.rank}'`)),qt(4===e.shape[1],(()=>`boxes must have 4 columns, but 2nd dimension was ${e.shape[1]}`)),qt(1===t.rank,(()=>"scores must be a 1D tensor")),qt(t.shape[0]===i,(()=>`scores has incompatible shape with boxes. Expected ${i}, but was ${t.shape[0]}`)),qt(0<=a&&a<=1,(()=>`softNmsSigma must be in [0, 1], but was '${a}'`)),{maxOutputSize:n,iouThreshold:s,scoreThreshold:r,softNmsSigma:a}}const Tf=fo({nonMaxSuppression_:function(e,t,n,s=.5,r=Number.NEGATIVE_INFINITY){const a=co(e,"boxes","nonMaxSuppression","float32"),i=co(t,"scores","nonMaxSuppression","float32"),o=If(a,i,n,s,r),l={maxOutputSize:n=o.maxOutputSize,iouThreshold:s=o.iouThreshold,scoreThreshold:r=o.scoreThreshold};return to.runKernel(Cr,{boxes:a,scores:i},l)}});function Nf(e,t,n){const s=function(e,t,n){return function(e,t,n){let s=0,r=e.length,a=0,i=!1;for(;s>>1);const o=n(t,e[a]);o>0?s=a+1:(r=a,i=!o)}return i?s:-s-1}(e,t,n||Of)}(e,t,n),r=s<0?-(s+1):s;e.splice(r,0,t)}function Of(e,t){return e>t?1:er&&u.push({score:t[e],boxIndex:e,suppressBeginIndex:0});u.sort(Lf);const c=a>0?-.5/a:0,h=[],d=[];for(;h.length0;){const t=u.pop(),{score:n,boxIndex:a,suppressBeginIndex:i}=t;if(n=i;--n){const i=Bf(e,a,h[n]);if(i>=s){o=!0;break}if(t.score=t.score*zf(s,c,i),t.score<=r)break}t.suppressBeginIndex=h.length,o||(t.score===n?(h.push(a),d.push(t.score)):t.score>r&&Nf(u,t,Lf))}const p=h.length,f=n-p;o&&f>0&&(h.push(...new Array(f).fill(0)),d.push(...new Array(f).fill(0)));const m={selectedIndices:h};return i&&(m.selectedScores=d),l&&(m.validOutputs=p),m}function Bf(e,t,n){const s=e.subarray(4*t,4*t+4),r=e.subarray(4*n,4*n+4),a=Math.min(s[0],s[2]),i=Math.min(s[1],s[3]),o=Math.max(s[0],s[2]),l=Math.max(s[1],s[3]),u=Math.min(r[0],r[2]),c=Math.min(r[1],r[3]),h=Math.max(r[0],r[2]),d=Math.max(r[1],r[3]),p=(o-a)*(l-i),f=(h-u)*(d-c);if(p<=0||f<=0)return 0;const m=Math.max(a,u),g=Math.max(i,c),y=Math.min(o,h),b=Math.min(l,d),w=Math.max(y-m,0)*Math.max(b-g,0);return w/(p+f-w)}function zf(e,t,n){const s=Math.exp(t*n*n);return n<=e?s:0}function Lf(e,t){return e.score-t.score||e.score===t.score&&t.boxIndex-e.boxIndex}const Pf=async function(e,t,n,s=.5,r=Number.NEGATIVE_INFINITY){const a=co(e,"boxes","nonMaxSuppressionAsync"),i=co(t,"scores","nonMaxSuppressionAsync"),o=If(a,i,n,s,r);n=o.maxOutputSize,s=o.iouThreshold,r=o.scoreThreshold;const l=await Promise.all([a.data(),i.data()]),u=l[0],c=l[1],{selectedIndices:h}=Rf(u,c,n,s,r);return a!==e&&a.dispose(),i!==t&&i.dispose(),Mp(h,"int32")};const Vf=fo({nonMaxSuppressionWithScore_:function(e,t,n,s=.5,r=Number.NEGATIVE_INFINITY,a=0){const i=co(e,"boxes","nonMaxSuppression"),o=co(t,"scores","nonMaxSuppression"),l=If(i,o,n,s,r,a),u={boxes:i,scores:o},c={maxOutputSize:n=l.maxOutputSize,iouThreshold:s=l.iouThreshold,scoreThreshold:r=l.scoreThreshold,softNmsSigma:a=l.softNmsSigma},h=to.runKernel(Er,u,c);return{selectedIndices:h[0],selectedScores:h[1]}}});const Wf=async function(e,t,n,s=.5,r=Number.NEGATIVE_INFINITY,a=0){const i=co(e,"boxes","nonMaxSuppressionAsync"),o=co(t,"scores","nonMaxSuppressionAsync"),l=If(i,o,n,s,r,a);n=l.maxOutputSize,s=l.iouThreshold,r=l.scoreThreshold,a=l.softNmsSigma;const u=await Promise.all([i.data(),o.data()]),c=u[0],h=u[1],{selectedIndices:d,selectedScores:p}=Mf(c,h,n,s,r,a);return i!==e&&i.dispose(),o!==t&&o.dispose(),{selectedIndices:Mp(d,"int32"),selectedScores:Mp(p)}};const Uf=fo({nonMaxSuppressionPadded_:function(e,t,n,s=.5,r=Number.NEGATIVE_INFINITY,a=!1){const i=co(e,"boxes","nonMaxSuppression"),o=co(t,"scores","nonMaxSuppression"),l=If(i,o,n,s,r,null),u={boxes:i,scores:o},c={maxOutputSize:l.maxOutputSize,iouThreshold:l.iouThreshold,scoreThreshold:l.scoreThreshold,padToMaxOutputSize:a},h=to.runKernel(Sr,u,c);return{selectedIndices:h[0],validOutputs:h[1]}}});const Gf=async function(e,t,n,s=.5,r=Number.NEGATIVE_INFINITY,a=!1){const i=co(e,"boxes","nonMaxSuppressionAsync"),o=co(t,"scores","nonMaxSuppressionAsync"),l=If(i,o,n,s,r,null),u=l.maxOutputSize,c=l.iouThreshold,h=l.scoreThreshold,[d,p]=await Promise.all([i.data(),o.data()]),{selectedIndices:f,validOutputs:m}=Df(d,p,u,c,h,a);return i!==e&&i.dispose(),o!==t&&o.dispose(),{selectedIndices:Mp(f,"int32"),validOutputs:Wl(m,"int32")}};const qf=fo({resizeBilinear_:function(e,t,n=!1,s=!1){const r=co(e,"images","resizeBilinear");qt(3===r.rank||4===r.rank,(()=>`Error in resizeBilinear: x must be rank 3 or 4, but got rank ${r.rank}.`)),qt(2===t.length,(()=>`Error in resizeBilinear: new shape must 2D, but got shape ${t}.`)),qt(!1===s||!1===n,(()=>"Error in resizeBilinear: If halfPixelCenters is true, alignCorners must be false."));let a=r,i=!1;3===r.rank&&(i=!0,a=Tc(r,[1,r.shape[0],r.shape[1],r.shape[2]]));const[]=t,o={images:a},l={alignCorners:n,halfPixelCenters:s,size:t},u=to.runKernel(qr,o,l);return i?Tc(u,[u.shape[1],u.shape[2],u.shape[3]]):u}});const jf=fo({resizeNearestNeighbor_:function(e,t,n=!1,s=!1){const r=co(e,"images","resizeNearestNeighbor");qt(3===r.rank||4===r.rank,(()=>`Error in resizeNearestNeighbor: x must be rank 3 or 4, but got rank ${r.rank}.`)),qt(2===t.length,(()=>`Error in resizeNearestNeighbor: new shape must 2D, but got shape ${t}.`)),qt("float32"===r.dtype||"int32"===r.dtype,(()=>"`images` must have `int32` or `float32` as dtype")),qt(!1===s||!1===n,(()=>"Error in resizeNearestNeighbor: If halfPixelCenters is true, alignCorners must be false."));let a=r,i=!1;3===r.rank&&(i=!0,a=Tc(r,[1,r.shape[0],r.shape[1],r.shape[2]]));const[]=t,o={images:a},l={alignCorners:n,halfPixelCenters:s,size:t},u=to.runKernel(Ur,o,l);return i?Tc(u,[u.shape[1],u.shape[2],u.shape[3]]):u}});const Hf=fo({threshold_:function(e,t="binary",n=!1,s=.5){const r=co(e,"image","threshold"),a=r.shape[0]*r.shape[1];let i,o,l,u,c=Bl(Mp([s]),255);if(qt(3===r.rank,(()=>`Error in threshold: image must be rank 3,but got rank ${r.rank}.`)),qt(3===r.shape[2]||1===r.shape[2],(()=>`Error in threshold: image color channel must be equal to 3 or 1but got ${r.shape[2]}.`)),qt("int32"===r.dtype||"float32"===r.dtype,(()=>`Error in dtype: image dtype must be int32 or float32,but got dtype ${r.dtype}.`)),qt("otsu"===t||"binary"===t,(()=>`Method must be binary or otsu, but was ${t}`)),3===r.shape[2]){[i,o,l]=Ep(r,[1,1,1],-1);const e=Bl(i,.2989),t=Bl(o,.587),n=Bl(l,.114);u=Dl(Dl(e,t),n)}else u=e;if("otsu"===t){c=function(e,t){let n,s,r,a,i,o,l=Mp([-1]),u=Mp([0]),c=Mp([0]);for(let h=0;h`Error in transform: image must be rank 4,but got rank ${i.rank}.`)),qt(2===o.rank&&(o.shape[0]===i.shape[0]||1===o.shape[0])&&8===o.shape[1],(()=>"Error in transform: Input transform should be batch x 8 or 1 x 8")),qt(null==a||2===a.length,(()=>`Error in transform: outputShape must be [height, width] or null, but got ${a}.`));const l={image:i,transforms:o},u={interpolation:n,fillMode:s,fillValue:r,outputShape:a};return to.runKernel(Ta,l,u)}});const Kf=fo({bandPart_:function(e,t,n){const s=co(e,"a","bandPart");qt(s.rank>=2,(()=>`bandPart(): Rank must be at least 2, got ${s.rank}.`));const r=s.shape,[a,i]=s.shape.slice(-2);let o,l;"number"==typeof t?(qt(t%1==0,(()=>`bandPart(): numLower must be an integer, got ${t}.`)),qt(t<=a,(()=>`bandPart(): numLower (${t}) must not be greater than the number of rows (${a}).`)),o=co(t<0?a:t,"numLower","bandPart")):(qt("int32"===t.dtype,(()=>"bandPart(): numLower's dtype must be an int32.")),o=gh(Yh(t,0),a,Ad(t,a))),"number"==typeof n?(qt(n%1==0,(()=>`bandPart(): numUpper must be an integer, got ${n}.`)),qt(n<=i,(()=>`bandPart(): numUpper (${n}) must not be greater than the number of columns (${i}).`)),l=co(n<0?i:n,"numUpper","bandPart")):(qt("int32"===n.dtype,(()=>"bandPart(): numUpper's dtype must be an int32.")),l=gh(Yh(n,0),i,Ad(n,i)));const u=Tc(ep(0,a,1,"int32"),[-1,1]),c=ep(0,i,1,"int32"),h=Ql(u,c),d=ld(Qh(h,o),jh(h,sd(l))),p=wd([a,i],s.dtype);return Tc(Np($p(Tc(s,[-1,a,i])).map((e=>gh(d,e,p)))),r)}});const Xf=fo({gramSchmidt_:function(e){let t;if(Array.isArray(e)){t=!1,qt(null!=e&&e.length>0,(()=>"Gram-Schmidt process: input must not be null, undefined, or empty"));const n=e[0].shape[0];for(let t=1;t`Gram-Schmidt: Non-unique lengths found in the input vectors: (${e[t].shape[0]} vs. ${n})`))}else t=!0,e=Ep(e,e.shape[0],0).map((e=>Tp(e,[0])));qt(e.length<=e[0].shape[0],(()=>`Gram-Schmidt: Number of vectors (${e.length}) exceeds number of dimensions (${e[0].shape[0]}).`));const n=[],s=e;for(let t=0;t{let e=s[t];if(t>0)for(let s=0;s{qt(2===e.shape.length,(()=>`qr2d() requires a 2D Tensor, but got a ${e.shape.length}D Tensor.`));const n=e.shape[0],s=e.shape[1];let r=Wh(n),a=Ol(e);const i=Fp([[1]],[1,1]);let o=Ol(i);const l=n>=s?s:n;for(let e=0;e{const t=Fc(a,[e,e],[n-e,1]),l=Fh(t),u=Fc(a,[e,e],[1,1]),c=gh(qh(u,0),Fp([[-1]]),Fp([[1]])),h=Ql(u,Bl(c,l)),d=Fl(t,h);o=1===d.shape[0]?Ol(i):Rc([i,Fc(d,[1,0],[d.shape[0]-1,d.shape[1]])],0);const p=sd(Fl(Dc(c,h),l)),f=Fc(a,[e,0],[n-e,s]),m=Bl(p,o),g=Jp(o);if(0===e)a=Ql(f,Dc(m,Dc(g,f)));else{const t=Ql(f,Dc(m,Dc(g,f)));a=Rc([Fc(a,[0,0],[e,s]),t],0)}const y=Jp(m),b=Fc(r,[0,e],[n,r.shape[1]-e]);if(0===e)r=Ql(b,Dc(Dc(b,o),y));else{const t=Ql(b,Dc(Dc(b,o),y));r=Rc([Fc(r,[0,0],[n,e]),t],1)}return[o,a,r]})),ko([t,l,u])}return!t&&n>s&&(r=Fc(r,[0,0],[n,s]),a=Fc(a,[0,0],[s,s])),[r,a]}))}const Yf=fo({qr_:function(e,t=!1){if(qt(e.rank>=2,(()=>`qr() requires input tensor to have a rank >= 2, but got rank ${e.rank}`)),2===e.rank)return Zf(e,t);{const n=e.shape.slice(0,e.shape.length-2).reduce(((e,t)=>e*t)),s=$p(Tc(e,[n,e.shape[e.shape.length-2],e.shape[e.shape.length-1]]),0),r=[],a=[];s.forEach((e=>{const[n,s]=Zf(e,t);r.push(n),a.push(s)}));return[Tc(Np(r,0),e.shape),Tc(Np(a,0),e.shape)]}}});var Qf;!function(e){e[e.NONE=0]="NONE",e[e.MEAN=1]="MEAN",e[e.SUM=2]="SUM",e[e.SUM_BY_NONZERO_WEIGHTS=3]="SUM_BY_NONZERO_WEIGHTS"}(Qf||(Qf={}));const Jf=fo({computeWeightedLoss_:function(e,t,n=Qf.SUM_BY_NONZERO_WEIGHTS){const s=co(e,"losses","computeWeightedLoss");let r=null;null!=t&&(r=co(t,"weights","computeWeightedLoss"));const a=null==r?s:Bl(s,r);if(n===Qf.NONE)return a;if(n===Qf.SUM)return Dh(a);if(n===Qf.MEAN){if(null==r)return bd(a);{const e=s.size/r.size,t=Fl(Dh(a),Dh(r));return e>1?Fl(t,Wl(e)):t}}if(n===Qf.SUM_BY_NONZERO_WEIGHTS){if(null==r)return Fl(Dh(a),Wl(s.size));{const e=Bl(r,vd(s.shape)),t=Nl(Dh(Id(e,Wl(0))),"float32");return Fl(Dh(a),t)}}throw Error(`Unknown reduction: ${n}`)}});const em=fo({absoluteDifference_:function(e,t,n,s=Qf.SUM_BY_NONZERO_WEIGHTS){const r=co(e,"labels","absoluteDifference"),a=co(t,"predictions","absoluteDifference");let i=null;null!=n&&(i=co(n,"weights","absoluteDifference")),jt(r.shape,a.shape,"Error in absoluteDifference: ");const o=eu(Ql(r,a));return Jf(o,i,s)}});const tm=fo({cosineDistance_:function(e,t,n,s,r=Qf.SUM_BY_NONZERO_WEIGHTS){const a=co(e,"labels","cosineDistance"),i=co(t,"predictions","cosineDistance");let o=null;null!=s&&(o=co(s,"weights","cosineDistance")),jt(a.shape,i.shape,"Error in cosineDistance: ");const l=Wl(1),u=Ql(l,Dh(Bl(a,i),n,!0));return Jf(u,o,r)}});const nm=fo({hingeLoss_:function(e,t,n,s=Qf.SUM_BY_NONZERO_WEIGHTS){let r=co(e,"labels","hingeLoss");const a=co(t,"predictions","hingeLoss");let i=null;null!=n&&(i=co(n,"weights","hingeLoss")),jt(r.shape,a.shape,"Error in hingeLoss: ");const o=Wl(1);r=Ql(Bl(Wl(2),r),o);const l=sp(Ql(o,Bl(r,a)));return Jf(l,i,s)}});const sm=fo({huberLoss_:function(e,t,n,s=1,r=Qf.SUM_BY_NONZERO_WEIGHTS){const a=co(e,"labels","huberLoss"),i=co(t,"predictions","huberLoss");let o=null;null!=n&&(o=co(n,"weights","huberLoss")),jt(a.shape,i.shape,"Error in huberLoss: ");const l=Wl(s),u=eu(Ql(i,a)),c=Ad(u,l),h=Ql(u,c),d=Dl(Bl(Wl(.5),Ll(c)),Bl(l,h));return Jf(d,o,r)}});const rm=fo({logLoss_:function(e,t,n,s=1e-7,r=Qf.SUM_BY_NONZERO_WEIGHTS){const a=co(e,"labels","logLoss"),i=co(t,"predictions","logLoss");let o=null;null!=n&&(o=co(n,"weights","logLoss")),jt(a.shape,i.shape,"Error in logLoss: ");const l=Wl(1),u=Wl(s),c=sd(Bl(a,td(Dl(i,u)))),h=Bl(Ql(l,a),td(Dl(Ql(l,i),u))),d=Ql(c,h);return Jf(d,o,r)}});const am=fo({meanSquaredError_:function(e,t,n,s=Qf.SUM_BY_NONZERO_WEIGHTS){const r=co(e,"labels","meanSquaredError"),a=co(t,"predictions","meanSquaredError");let i=null;null!=n&&(i=co(n,"weights","meanSquaredError")),jt(r.shape,a.shape,"Error in meanSquaredError: ");const o=Ip(r,a);return Jf(o,i,s)}});const im=fo({sigmoidCrossEntropy_:function(e,t,n,s=0,r=Qf.SUM_BY_NONZERO_WEIGHTS){let a=co(e,"multiClassLabels","sigmoidCrossEntropy");const i=co(t,"logits","sigmoidCrossEntropy");let o=null;if(null!=n&&(o=co(n,"weights","sigmoidCrossEntropy")),jt(a.shape,i.shape,"Error in sigmoidCrossEntropy: "),s>0){const e=Wl(s),t=Wl(1),n=Wl(.5);a=Dl(Bl(a,Ql(t,e)),Bl(n,e))}const l=function(e,t){const n=co(e,"labels","sigmoidCrossEntropyWithLogits"),s=co(t,"logits","sigmoidCrossEntropyWithLogits");jt(n.shape,s.shape,"Error in sigmoidCrossEntropyWithLogits: ");const r=sp(s),a=Bl(s,n),i=nd(zh(sd(eu(s))));return Dl(Ql(r,a),i)}(a,i);return Jf(l,o,r)}});const om=fo({softmaxCrossEntropy_:function(e,t,n,s=0,r=Qf.SUM_BY_NONZERO_WEIGHTS){let a=co(e,"onehotLabels","softmaxCrossEntropy");const i=co(t,"logits","softmaxCrossEntropy");let o=null;if(null!=n&&(o=co(n,"weights","softmaxCrossEntropy")),jt(a.shape,i.shape,"Error in softmaxCrossEntropy: "),s>0){const e=Wl(s),t=Wl(1),n=Wl(a.shape[1]);a=Dl(Bl(a,Ql(t,e)),Fl(e,n))}const l=function(e,t,n=-1){if(-1===n&&(n=t.rank-1),n!==t.rank-1)throw Error(`Softmax cross entropy along a non-last dimension is not yet supported. Labels / logits was rank ${t.rank} and dim was ${n}`);const s=Vl(((e,t,s)=>{const r=od(t,[n],!0),a=Ql(Nl(t,"float32"),r);s([e,a]);const i=sd(Bl(a,e));return{value:Dh(i,[n]),gradFunc:(e,t)=>{const[s,r]=t,a=Eh(e.shape,[n]);return[Bl(Tc(e,a),Ql(Nl(s,"float32"),zh(r))),Bl(Tc(e,a),Ql(zh(r),Nl(s,"float32")))]}}}));return s(e,t)}(a,i);return Jf(l,o,r)}});const lm=fo({sparseFillEmptyRows_:function(e,t,n,s){const r=co(e,"indices","sparseFillEmptyRows","int32"),a=co(t,"values","sparseFillEmptyRows"),i=co(n,"denseShape","sparseFillEmptyRows","int32"),o=co(s,"defaultValue","sparseFillEmptyRows",a.dtype);if(2!==r.rank)throw new Error(`Indices should be Tensor2D but received shape\n ${r.shape}`);if(1!==a.rank)throw new Error(`Values should be Tensor1D but received shape ${a.shape}`);if(1!==i.rank)throw new Error(`Dense shape should be Tensor1D but received shape ${i.shape}`);if(0!==o.rank)throw new Error(`Default value should be a scalar but received shape ${o.shape}`);const l={indices:r,values:a,denseShape:i,defaultValue:o},u=to.runKernel(da,l);return{outputIndices:u[0],outputValues:u[1],emptyRowIndicator:u[2],reverseIndexMap:u[3]}}});const um=fo({sparseReshape_:function(e,t,n){const s=co(e,"inputIndices","sparseReshape","int32"),r=co(t,"inputShape","sparseReshape","int32"),a=co(n,"newShape","sparseReshape","int32");if(2!==s.rank)throw new Error(`Input indices should be Tensor2D but received shape\n ${s.shape}`);if(1!==r.rank)throw new Error(`Input shape should be Tensor1D but received shape ${r.shape}`);if(1!==a.rank)throw new Error(`New shape should be Tensor1D but received shape ${a.shape}`);const i={inputIndices:s,inputShape:r,newShape:a},o=to.runKernel(pa,i);return{outputIndices:o[0],outputShape:o[1]}}});const cm=fo({sparseSegmentMean_:function(e,t,n){const s=co(e,"data","sparseSegmentMean"),r=co(t,"indices","sparseSegmentMean","int32"),a=co(n,"segmentIds","sparseSegmentMean","int32");if(s.rank<1)throw new Error("Data should be at least 1 dimensional but received scalar");if(1!==r.rank)throw new Error(`Indices should be Tensor1D but received shape\n ${r.shape}`);if(1!==a.rank)throw new Error(`Segment ids should be Tensor1D but received shape\n ${a.shape}`);const i={data:s,indices:r,segmentIds:a};return to.runKernel(fa,i)}});const hm=fo({sparseSegmentSum_:function(e,t,n){const s=co(e,"data","sparseSegmentSum"),r=co(t,"indices","sparseSegmentSum","int32"),a=co(n,"segmentIds","sparseSegmentSum","int32");if(s.rank<1)throw new Error("Data should be at least 1 dimensional but received scalar");if(1!==r.rank)throw new Error(`Indices should be Tensor1D but received shape\n ${r.shape}`);if(1!==a.rank)throw new Error(`Segment ids should be Tensor1D but received shape\n ${a.shape}`);const i={data:s,indices:r,segmentIds:a};return to.runKernel(ma,i)}});const dm=fo({stringNGrams_:function(e,t,n,s,r,a,i,o){const l=co(e,"data","stringNGrams","string");if("string"!==l.dtype)throw new Error("Data must be of datatype string");if(1!==l.shape.length)throw new Error(`Data must be a vector, saw: ${l.shape}`);const u=co(t,"dataSplits","stringNGrams");if("int32"!==u.dtype)throw new Error("Data splits must be of datatype int32");const c={separator:n,nGramWidths:s,leftPad:r,rightPad:a,padWidth:i,preserveShortSequences:o},h={data:l,dataSplits:u},d=to.runKernel(xa,h,c);return{nGrams:d[0],nGramsSplits:d[1]}}});const pm=fo({stringSplit_:function(e,t,n=!0){const s=co(e,"input","stringSplit","string"),r=co(t,"delimiter","stringSplit","string");if(1!==s.rank)throw new Error(`Input should be Tensor1D but received shape ${s.shape}`);if(0!==r.rank)throw new Error(`Delimiter should be a scalar but received shape ${r.shape}`);const a={skipEmpty:n},i={input:s,delimiter:r},o=to.runKernel(Aa,i,a);return{indices:o[0],values:o[1],shape:o[2]}}});const fm=fo({stringToHashBucketFast_:function(e,t){const n=co(e,"input","stringToHashBucketFast","string"),s={numBuckets:t};if(t<=0)throw new Error("Number of buckets must be at least 1");const r={input:n};return to.runKernel(ka,r,s)}});const mm=fo({staticRegexReplace_:function(e,t,n,s=!0){const r=co(e,"input","staticRegexReplace","string"),a={pattern:t,rewrite:n,replaceGlobal:s};return to.runKernel(wa,{x:r},a)}}),gm={fft:kp,ifft:Cp,rfft:_p,irfft:Sp},ym={hammingWindow:wf,hannWindow:vf,frame:xf,stft:Af},bm={flipLeftRight:Cf,grayscaleToRGB:Sf,resizeNearestNeighbor:jf,resizeBilinear:qf,rgbToGrayscale:Ef,rotateWithOffset:_f,cropAndResize:kf,nonMaxSuppression:Tf,nonMaxSuppressionAsync:Pf,nonMaxSuppressionWithScore:Vf,nonMaxSuppressionWithScoreAsync:Wf,nonMaxSuppressionPadded:Uf,nonMaxSuppressionPaddedAsync:Gf,threshold:Hf,transform:$f},wm={bandPart:Kf,gramSchmidt:Xf,qr:Yf},vm={absoluteDifference:em,computeWeightedLoss:Jf,cosineDistance:tm,hingeLoss:nm,huberLoss:sm,logLoss:rm,meanSquaredError:am,sigmoidCrossEntropy:im,softmaxCrossEntropy:om},xm={sparseFillEmptyRows:lm,sparseReshape:um,sparseSegmentMean:cm,sparseSegmentSum:hm},Am={stringNGrams:dm,stringSplit:pm,stringToHashBucketFast:fm,staticRegexReplace:mm};const km=class{static sgd(e){return new iu(e)}static momentum(e,t,n=!1){return new ou(e,t,n)}static rmsprop(e,t=.9,n=0,s=null,r=!1){return new lu(e,t,n,s,r)}static adam(e=.001,t=.9,n=.999,s=null){return new Jl(e,t,n,s)}static adadelta(e=.001,t=.95,n=null){return new Kl(e,t,n)}static adamax(e=.002,t=.9,n=.999,s=null,r=0){return new au(e,t,n,s,r)}static adagrad(e,t=.1){return new Zl(e,t)}},Cm="undefined"!=typeof requestAnimationFrame?requestAnimationFrame:"undefined"!=typeof setImmediate?setImmediate:e=>e();function Sm(){return new Promise((e=>Cm((()=>e()))))}function Em(e,t){const n=e[0].length;e.forEach(((e,t)=>{qt(e.length===n,(()=>`Error in concat${n}D: rank of tensors[${t}] must be the same as the rank of the rest (${n})`))})),qt(t>=0&&t`Error in concat${n}D: axis must be between 0 and ${n-1}.`));const s=e[0];e.forEach(((e,r)=>{for(let a=0;a`Error in concat${n}D: Shape of tensors[${r}] (${e}) does not match the shape of the rest (${s}) along the non-concatenated axis ${r}.`))}))}function _m(e,t){const n=e[0].slice();for(let s=1;s=0)if(o>=0){if(o!==a)throw new Error(`rt input.shape and shape=${t} are incompatible: rt input.shape[${r+e}] = ${a} but shape[${r+e}] = ${o}`)}else s[i]=a}return s}function Nm(e){const t={FIRST_DIM_SIZE:Im.FIRST_DIM_SIZE,VALUE_ROWIDS:Im.VALUE_ROWIDS,ROW_LENGTHS:Im.ROW_LENGTHS,ROW_SPLITS:Im.ROW_SPLITS,ROW_LIMITS:Im.ROW_LIMITS,ROW_STARTS:Im.ROW_STARTS},n=[];for(const s of e){if(!(s in t))break;n.push(t[s])}return n}function Om(e){return 0===e.length?0:e[0]===Im.FIRST_DIM_SIZE?e.length-1:e.length}function Rm(e,t){if(null==e||null==t)return;const n=e.length,s=t.length;if(n>=s)throw new Error(`defaultValue.shape=${e} and ragged tensor flatValues.shape=${t}, are incompatible: defaultValue.rank = ${n} must be less than ragged tensor input flatValues.rank = ${s})`);for(let r=0;r=0&&s>=0&&1!==n&&n!==s)throw new Error(`defaultValue.shape=${e}, and ragged tensor input flatValues.shape=${t} are incompatible: defaultValue.shape[${r-e.length}] = ${n} but ragged tensor input.flatValues.shape[${r-e.length}] = ${s}`)}}!function(e){e[e.FIRST_DIM_SIZE=0]="FIRST_DIM_SIZE",e[e.VALUE_ROWIDS=1]="VALUE_ROWIDS",e[e.ROW_LENGTHS=2]="ROW_LENGTHS",e[e.ROW_SPLITS=3]="ROW_SPLITS",e[e.ROW_LIMITS=4]="ROW_LIMITS",e[e.ROW_STARTS=5]="ROW_STARTS"}(Im||(Im={}));const Dm=30;function Mm(e){return e<=Dm?e:hn(e,Math.floor(Math.sqrt(e)))}function Fm(e,t,n){return[n*("number"==typeof e?e:e[0]),t*("number"==typeof e?e:e[1])]}function Bm(e,t,n,s=!0){let r=[];if(s)r=r.concat(t.slice(0)),r.push(e[0]/n),r=r.concat(e.slice(1));else{r=r.concat(e[0]);const n=t.length;for(let s=0;s=2*t+1||s%2==1?r.push(s):n.push(s);s.push(...n),s.push(0),s.push(...r)}return s}function Lm(e,t,n,s=!0){const r=[];s?r.push(e[0]/n):r.push(e[0]*n);for(let n=1;nn)throw new Error(`index innermost dimension length must be <= tensor rank; saw: ${t.shape[s-1]} vs. ${n}`);if(0===$t(e.shape))throw new Error(`Requested more than 0 entries, but input is empty. Input shape: ${e.shape}.`);const r=t.shape,a=r[r.length-1];let i=1;for(let e=0;ee/u)),1].slice(0,a);return[l,i,u,c]}const Um=1.7580993408473768,Gm=1.0507009873554805,qm=.3275911,jm=.254829592,Hm=-.284496736,$m=1.421413741,Km=-1.453152027,Xm=1.061405429;function Zm(e,t){if(e.length!==t.length)throw new Error(`Cannot merge real and imag arrays of different lengths. real:${e.length}, imag: ${t.length}.`);const n=new Float32Array(2*e.length);for(let s=0;s/g,ig=",",og="...";function lg(e,t){const n=((e=e.replace(/\s/g,"")).length-e.replace(ag,"").length)/rg.length;if(n<1)throw new Error("Equations without an arrow are not supported.");if(n>1)throw new Error(`Equation must contain exactly one arrow ("${rg}").`);const[s,r]=e.split(rg);qt(-1===s.indexOf(og),(()=>`The ellipsis notation ("${og}") is not supported yet.`));const a=s.split(ig),i=a.length;if(t!==i)throw new Error(`Expected ${i} input tensors, received ${t}`);if(i>2)throw new Error("Support for more than 2 input tensors is not implemented yet.");const o=[];for(let e=0;e-1!==e.indexOf(t))))throw new Error(`Output subscripts contain the label ${t} not present in the input subscripts.`);-1===o.indexOf(t)&&o.push(t)}for(let e=0;e-1!==e)),{permutationIndices:n,expandDims:s}}function cg(e,t,n){const s=new Array(e);for(let e=0;e`Expected dimension ${s[t[e][n]]} at axis ${n} of input shaped ${JSON.stringify(r)}, but got dimension ${r[n]}`))}}function hg(e,t){const n=e,s=[];let r=0;0===e.length&&n.push(-1),r=e.length+1;for(let e=0;ee===t))}function pg(e,t){const n=[];for(let s=0;s"Number of splits must evenly divide the axis.")),s=new Array(t).fill(e.shape[n]/t);else{const r=t.reduce(((e,t)=>(-1===t&&(e+=1),e)),0);qt(r<=1,(()=>"There should be only one negative value in split array."));const a=t.indexOf(-1);if(-1!==a){const s=t.reduce(((e,t)=>t>0?e+t:e));t[a]=e.shape[n]-s}qt(e.shape[n]===t.reduce(((e,t)=>e+t)),(()=>"The sum of sizes must match the size of the axis dimension.")),s=t}return s}function mg(e){return`Received SparseTensor with denseShape[0] = 0 but\n indices.shape[0] = ${e}`}function gg(e,t){return`indices(${e}, 0) is invalid: ${t} < 0`}function yg(e,t,n){return`indices(${e}, 0) is invalid: ${t} >= ${n}`}function bg(e,t){return`only one output dimension may be -1, not both ${e} and ${t}`}function wg(e,t){return`size ${e} must be non-negative, not ${t}`}function vg(){return"reshape cannot infer the missing input size for an empty tensor unless all specified input sizes are non-zero"}function xg(e,t){return`Input to reshape is a SparseTensor with ${$t(e)}\n dense values, but the requested shape requires a multiple of ${$t(t)}. inputShape=${e} outputShape= ${t}`}function Ag(e,t){return`Input to reshape is a tensor with ${$t(e)} dense values, but the requested shape has ${$t(t)}. inputShape=${e} outputShape=${t}`}function kg(){return"segment ids must be >= 0"}function Cg(){return"segment ids are not increasing"}function Sg(e,t){return`Segment id ${e} out of range [0, ${t}), possibly because segmentIds input is not sorted.`}function Eg(e,t,n){return`Bad: indices[${e}] == ${t} out of range [0, ${n})`}function _g(e,t){let n,s=!1;for(e<=Dm?(n=e,s=!0):n=hn(e,Math.floor(Math.sqrt(e)));!s;)n>t||n===e?s=!0:n=hn(e,n+1);return n}function Ig(e,t,n){const s=[],r=e.length;for(let a=0;ar))throw new Error(`Expect batchDims in the range of [-${r}, ${r}], but got ${s}`);if(s<0&&(s+=r),s>a)throw new Error(`batchDims (${s}) must be less than rank(x) (\n ${a}).`);if(ngi(e)))}catch(e){throw new Error(`Failed to decode encoded string bytes into utf-8, error: ${e}`)}}function Og(e){return e.map((e=>mi(e)))}!function(){for(const e of uu)Hl(e)}();const Rg={kernelName:Nn,inputsToSave:["x"],gradFunc:(e,t)=>{const[n]=t;return{x:()=>Bl(e,Op(Nl(n,"float32"),-1))}}},Dg={kernelName:On,inputsToSave:["x"],gradFunc:(e,t)=>{const[n]=t;return{x:()=>{const t=Ll(Nl(n,"float32")),s=zl(Ql(Wl(1),t));return sd(Fl(e,s))}}}},Mg={kernelName:Rn,inputsToSave:["x"],gradFunc:(e,t)=>{const[n]=t;return{x:()=>{const t=zl(Ql(Ll(Nl(n,"float32")),1));return Fl(e,t)}}}},Fg={kernelName:Dn,inputsToSave:["a","b"],gradFunc:(e,t)=>{const[n,s]=t,r=su(n.shape,s.shape);return{a:()=>{let t=e;const s=nu(n.shape,r);return s.length>0&&(t=Dh(t,s)),Tc(t,n.shape)},b:()=>{let t=e;const n=nu(s.shape,r);return n.length>0&&(t=Dh(t,n)),Tc(t,s.shape)}}}},Bg={kernelName:Mn,saveAllInputs:!0,gradFunc:(e,t)=>{const n={};return t.forEach(((t,s)=>{n[s]=()=>e.clone()})),n}},zg={kernelName:zn,inputsToSave:["x"],gradFunc:(e,t)=>{const[n]=t;return{x:()=>Pl(n)}}},Lg={kernelName:Ln,inputsToSave:["x"],gradFunc:(e,t)=>{const[n]=t;return{x:()=>Pl(n)}}},Pg={kernelName:Pn,inputsToSave:["x"],gradFunc:(e,t)=>{const[n]=t;return{x:()=>Fl(e,zl(Ql(Wl(1),Ll(Nl(n,"float32")))))}}},Vg={kernelName:Vn,inputsToSave:["x"],gradFunc:(e,t)=>{const[n]=t;return{x:()=>{const t=zl(Dl(Wl(1),Ll(Nl(n,"float32"))));return Fl(e,t)}}}},Wg={kernelName:Gn,inputsToSave:["a","b"],gradFunc:(e,t)=>{const[n,s]=t,r=su(n.shape,s.shape);return{a:()=>{const t=Dl(Ll(n),Ll(s));let a=Bl(e,Fl(s,t));const i=nu(n.shape,r);return i.length>0&&(a=Dh(a,i)),Tc(a,n.shape)},b:()=>{const t=Dl(Ll(n),Ll(s));let a=sd(Bl(e,Fl(n,t)));const i=nu(s.shape,r);return i.length>0&&(a=Dh(a,i)),Tc(a,s.shape)}}}},Ug={kernelName:Wn,inputsToSave:["x"],gradFunc:(e,t)=>{const[n]=t;return{x:()=>Fl(e,Dl(Ll(Nl(n,"float32")),1))}}},Gg={kernelName:Un,inputsToSave:["x"],gradFunc:(e,t)=>{const[n]=t;return{x:()=>Fl(e,Ql(Wl(1),Ll(Nl(n,"float32"))))}}};const qg=fo({avgPool3dGrad_:function(e,t,n,s,r,a){const i=co(e,"dy","avgPool3dGrad"),o=co(t,"input","avgPool3dGrad");let l=i,u=o,c=!1;4===o.rank&&(c=!0,l=Tc(i,[1,i.shape[0],i.shape[1],i.shape[2],i.shape[3]]),u=Tc(o,[1,o.shape[0],o.shape[1],o.shape[2],o.shape[3]])),qt(5===l.rank,(()=>`Error in avgPool3dGrad: dy must be rank 5 but got rank ${l.rank}.`)),qt(5===u.rank,(()=>`Error in avgPool3dGrad: input must be rank 5 but got rank ${u.rank}.`)),Ic("avgPool3dGrad",r,a);const h={dy:l,input:u},d={filterSize:n,strides:s,pad:r,dimRoundingMode:a},p=to.runKernel($n,h,d);return c?Tc(p,[p.shape[1],p.shape[2],p.shape[3],p.shape[4]]):p}}),jg={kernelName:Hn,inputsToSave:["x"],gradFunc:(e,t,n)=>{const[s]=t,{filterSize:r,strides:a,pad:i,dimRoundingMode:o}=n;return{x:()=>qg(e,s,r,a,i,o)}}};const Hg=fo({avgPoolGrad_:function(e,t,n,s,r){const a=co(e,"dy","avgPoolGrad"),i=co(t,"input","avgPoolGrad");qt(i.rank===a.rank,(()=>`Rank of input (${i.rank}) does not match rank of dy (${a.rank})`));let o=i,l=a,u=!1;3===i.rank&&(u=!0,o=Tc(i,[1,i.shape[0],i.shape[1],i.shape[2]]),l=Tc(a,[1,a.shape[0],a.shape[1],a.shape[2]])),qt(4===l.rank,(()=>`Error in avgPoolGrad: dy must be rank 4 but got rank ${l.rank}.`)),qt(4===o.rank,(()=>`Error in avgPoolGrad: input must be rank 4 but got rank ${o.rank}.`));const c={dy:l,input:o},h={filterSize:n,strides:s,pad:r},d=to.runKernel(jn,c,h);return u?Tc(d,[d.shape[1],d.shape[2],d.shape[3]]):d}}),$g={kernelName:qn,inputsToSave:["x"],gradFunc:(e,t,n)=>{const[s]=t,{filterSize:r,strides:a,pad:i}=n;return{x:()=>Hg(e,s,r,a,i)}}},Kg={kernelName:Kn,inputsToSave:["a","b"],gradFunc:(e,t,n)=>{const[s,r]=t,{transposeA:a,transposeB:i}=n;return a||i?!a&&i?{a:()=>Dc(e,r,!1,!1),b:()=>Dc(e,s,!0,!1)}:a&&!i?{a:()=>Dc(r,e,!1,!0),b:()=>Dc(s,e,!1,!1)}:{a:()=>Dc(r,e,!0,!0),b:()=>Dc(e,s,!0,!0)}:{a:()=>Dc(e,r,!1,!0),b:()=>Dc(s,e,!0,!1)}}},Xg={kernelName:Xn,gradFunc:(e,t,n)=>{const{blockShape:s,crops:r}=n;return{x:()=>zd(e,s,r)}}},Zg={kernelName:"BroadcastTo",gradFunc:(e,t,n)=>{const s=n,r=s.inputShape,a=s.shape,i=Array.from(a);for(let e=r.length-1;e>=0;e--)if(r[e]===a[e])i[e]=1;else if(1!==r[e])throw new Error(`broadcastTo(): [${r}] cannot be broadcast to [${a}].`);const o=[];for(let e=0;e1&&o.push(e);return{x:()=>Dh(e,o,!0)}}},Yg={kernelName:Jn,gradFunc:e=>({x:()=>e.clone()})},Qg={kernelName:es,gradFunc:e=>({x:()=>Pl(e)})},Jg={kernelName:ts,inputsToSave:["x"],gradFunc:(e,t,n)=>{const[s]=t,{clipValueMin:r,clipValueMax:a}=n;return{x:()=>gh(ld(jh(s,r),Qh(s,a)),e,Pl(e))}}},ey={kernelName:ss,inputsToSave:["x"],gradFunc:Rg.gradFunc},ty={kernelName:rs,saveAllInputs:!0,gradFunc:(e,t,n)=>{const s=t.map((e=>e.shape)),{axis:r}=n,a=en(r,t[0].shape)[0],i=s.map((e=>e[a]));return Ep(e,i,a).map((e=>()=>e))}},ny={kernelName:as,inputsToSave:["x","filter"],gradFunc:(e,t,n)=>{const[s,r]=t,{dilations:a,strides:i,pad:o,dataFormat:l}=n;return qt(Cc(a),(()=>`Error in gradient of conv2D: dilation rates greater than 1 are not yet supported in gradients. Got dilations '${a}'`)),{x:()=>th(s.shape,e,r,i,o,l),filter:()=>uf(s,e,r.shape,i,o,l)}}},sy={kernelName:os,inputsToSave:["dy","filter"],gradFunc:(e,t,n)=>{const[s,r]=t,{strides:a,pad:i,dataFormat:o,dimRoundingMode:l}=n;return{dy:()=>Jc(e,r,a,i,o,1,l),filter:()=>uf(e,s,r.shape,a,i,o,l)}}};const ry=fo({conv3DBackpropFilter_:function(e,t,n,s,r){let a=e;4===e.rank&&(a=Tc(e,[1,e.shape[0],e.shape[1],e.shape[2],e.shape[3]]));let i=t;4===i.rank&&(i=Tc(t,[1,t.shape[0],t.shape[1],t.shape[2],t.shape[3]])),qt(5===a.rank,(()=>`Error in conv3dDerFilter: input must be rank 5, but got shape ${a.shape}.`)),qt(5===i.rank,(()=>`Error in conv3dDerFilter: dy must be rank 5, but got shape ${i.shape}.`)),qt(5===n.length,(()=>`Error in conv3dDerFilter: filterShape must be length 5, but got ${n}.`)),qt(a.shape[4]===n[3],(()=>`Error in conv3dDerFilter: depth of input ${a.shape[4]}) must match input depth in filter (${n[3]}.`)),qt(i.shape[4]===n[4],(()=>`Error in conv3dDerFilter: depth of dy (${i.shape[4]}) must match output depth for filter (${n[4]}).`));const o={x:a,dy:i},l={strides:s,pad:r,filterShape:n};return to.runKernel(us,o,l)}}),ay={kernelName:ls,inputsToSave:["x","filter"],gradFunc:(e,t,n)=>{const{dilations:s,strides:r,pad:a}=n;qt(Cc(s),(()=>`Error in gradient of conv3D: dilation rates greater than 1 are not yet supported in gradients. Got dilations '${s}'`));const[i,o]=t;return{x:()=>rh(i.shape,e,o,r,a),filter:()=>ry(i,e,o.shape,r,a)}}},iy={kernelName:hs,inputsToSave:["x"],gradFunc:(e,t)=>{const[n]=t;return{x:()=>Bl(sd(gp(Nl(n,"float32"))),e)}}},oy={kernelName:ds,inputsToSave:["x"],gradFunc:(e,t)=>{const[n]=t;return{x:()=>Bl(yp(Nl(n,"float32")),e)}}},ly={kernelName:fs,inputsToSave:["x"],gradFunc:(e,t,n)=>{const[s]=t,{axis:r,exclusive:a,reverse:i}=n;return{x:()=>{const t=Ih([r],s.rank);let n=uh(e,r,a,!i);return null!=t&&(n=Jp(n,t)),n}}}},uy={kernelName:bs,inputsToSave:["x","filter"],gradFunc:(e,t,n)=>{const{dilations:s,strides:r,pad:a,dimRoundingMode:i}=n,o=null==s?[1,1]:s;qt(Cc(o),(()=>`Error in gradient of depthwiseConv2dNative: dilation rates greater than 1 are not yet supported. Got dilations '${o}'`));const[l,u]=t;return qt(4===l.rank,(()=>`Error in gradient of depthwiseConv2dNative: input must be rank 4, but got rank ${l.rank}.`)),qt(4===u.rank,(()=>`Error in gradient of depthwiseConv2dNative: filter must be rank 4, but got rank ${u.rank}.`)),qt(l.shape[3]===u.shape[2],(()=>`Error in gradient of depthwiseConv2d: number of input channels (${l.shape[3]}) must match the inChannels dimension in filter ${u.shape[2]}.`)),qt(Sc(r,o),(()=>`Error in gradient of depthwiseConv2d: Either strides or dilations must be 1. Got strides ${r} and dilations '${o}'.`)),Ic("depthwiseConv2d",a,i),{x:()=>gf(l.shape,e,u,r,a,o,i),filter:()=>mf(l,e,u.shape,r,a,o,i)}}},cy={kernelName:As,inputsToSave:["x","filter"],gradFunc:(e,t,n)=>{const[s,r]=t,a={x:s,filter:r,dy:e},i={x:s,filter:r,dy:e};return{x:()=>to.runKernel(ks,a,n),filter:()=>to.runKernel(Cs,i,n)}}},hy={kernelName:Is,outputsToSave:[!0],gradFunc:(e,t)=>{const[n]=t,s={dy:e,y:n};return{x:()=>to.runKernel(Ts,s)}}},dy={kernelName:Ns,inputsToSave:["x"],gradFunc:(e,t)=>{const[n]=t,s=Bl(zh(sd(Ll(n))),2/Math.sqrt(Math.PI));return{x:()=>Bl(e,s)}}},py={kernelName:Rs,outputsToSave:[!0],gradFunc:(e,t)=>{const[n]=t;return{x:()=>Bl(e,n)}}},fy={kernelName:Ds,inputsToSave:["input"],gradFunc:(e,t)=>{const[n]=t;return{input:()=>Tc(e,n.shape)}}},my={kernelName:Ms,inputsToSave:["x"],gradFunc:(e,t)=>{const[n]=t;return{x:()=>Bl(e,zh(n))}}},gy={kernelName:Ls,gradFunc:e=>({x:()=>Pl(e)})},yy={kernelName:Ps,inputsToSave:["a","b"],gradFunc:(e,t)=>{const[n,s]=t,r=su(n.shape,s.shape);return{a:()=>{const t=Fl(e,Nl(s,"float32")),a=nu(n.shape,r);return a.length>0?Tc(Dh(t,a),n.shape):t},b:()=>{let t=Bl(e,Nl(n,"float32"));const a=nu(s.shape,r);a.length>0&&(t=Tc(Dh(t,a),s.shape));const i=Ll(s);return sd(Fl(t,Nl(i,"float32")))}}}},by={kernelName:Vs,inputsToSave:["x","mean","variance","scale"],gradFunc:(e,t,n)=>{const{varianceEpsilon:s}=n,[r,a,i,o]=t,l=null==o?Wl(1):o,u=nu(a.shape,r.shape),c=[];if(1===a.rank){for(let e=0;e1===a.rank?Tc(Bl(Bl(e,Vh(Tc(p,[1,1,1,a.shape[0]]),c)),l),r.shape):Tc(Bl(Bl(e,p),l),r.shape),mean:()=>{let e=Bl(Bl(p,Wl(-1)),d);return 1===a.rank&&(e=Dh(e,u)),Tc(e,a.shape)},variance:()=>{let e=Bl(Bl(f,h),d);return 1===a.rank&&(e=Dh(e,u)),Tc(e,a.shape)},scale:()=>{const t=Bl(h,p);let n=Bl(e,t);return 1===a.rank&&(n=Dh(n,u)),Tc(n,a.shape)},offset:()=>{let t=e;return 1===a.rank&&(t=Dh(t,u)),Tc(t,a.shape)}}}},wy={kernelName:Ws,inputsToSave:["x","indices"],gradFunc:(e,t,n)=>{const[s,r]=t,{axis:a,batchDims:i}=n,o=en(a,s.shape)[0],l=(e,t,n)=>()=>{const s=e.shape,r=t.size,i=s.slice(0,o),l=i.length,u=s.slice(a,s.length).slice(1),c=u.length,h=vy(0,l),d=vy(l+1,l+1+c),p=xy([i,[r],u]),f=Tc(n,p),m=Tc(t,[r]),g=xy([[l],h,d]),y=Jp(f,g);let b=Hp(y,m,e.shape[o]);const w=Th(g);return b=Jp(b,w),b};if(1===i){const t=s.shape[0],n=s.split(t,0);return{x:()=>{const t=Np(n.map(((t,n)=>l(t,r.slice(n,1),e.slice(n,1))())));return t.reshape(s.shape)},indices:()=>r}}return{x:l(s,r,e),indices:()=>r}}};function vy(e,t){const n=[];for(let s=e;s{const[n,s]=t;return{a:()=>Pl(n),b:()=>Pl(s)}}},ky={kernelName:js,gradFunc:e=>({x:()=>Nl(e,"float32")})},Cy={kernelName:Ks,gradFunc:e=>({x:()=>Pl(e)})},Sy={kernelName:Xs,gradFunc:e=>({x:()=>Pl(e)})},Ey={kernelName:Zs,gradFunc:e=>({x:()=>Pl(e)})},_y={kernelName:Ys,inputsToSave:["x"],gradFunc:(e,t,n)=>{const[s]=t,{alpha:r}=n,a=qh(s,0);return{x:()=>gh(a,e,Bl(e,r))}}},Iy={kernelName:nr,inputsToSave:["x"],gradFunc:(e,t)=>{const[n]=t;return{x:()=>Fl(e,Dl(n,1))}}},Ty={kernelName:tr,inputsToSave:["x"],gradFunc:(e,t)=>{const[n]=t;return{x:()=>Fl(e,Nl(n,"float32"))}}},Ny={kernelName:"LogSoftmax",inputsToSave:[],outputsToSave:[!0],gradFunc:(e,t,n)=>{const[s]=t,{axis:r}=n;return{logits:()=>{const t=zh(s);return Ql(e,Bl(Dh(e,r,!0),t))}}}};const Oy=fo({localResponseNormalizationBackprop_:function(e,t,n,s=5,r=1,a=1,i=.5){const o={x:e,y:t,dy:n},l={depthRadius:s,bias:r,alpha:a,beta:i};return to.runKernel(or,o,l)}}),Ry={kernelName:ir,inputsToSave:["x"],outputsToSave:[!0],gradFunc:(e,t,n)=>{const[s,r]=t,{depthRadius:a,bias:i,alpha:o,beta:l}=n;return{x:()=>Oy(s,r,e,a,i,o,l)}}};function Dy(e,t,n,s){return t.rankBl(e,Nl(mh(n,t),e.dtype))}}const My={kernelName:lr,inputsToSave:["x"],outputsToSave:[!0],gradFunc:(e,t,n)=>{const s=n,{reductionIndices:r}=s,a=t[0],i=Dy(e,t[1],a,en(r,a.shape));return{x:()=>i.x()}}},Fy={kernelName:ur,inputsToSave:["a","b"],gradFunc:(e,t)=>{const[n,s]=t;return{a:()=>Bl(e,Nl(jh(n,s),"float32")),b:()=>Bl(e,Nl(Yh(n,s),"float32"))}}};const By=fo({maxPool3dGrad_:function(e,t,n,s,r,a,i){const o=co(e,"dy","maxPool3dGrad"),l=co(t,"input","maxPool3dGrad"),u=co(n,"output","maxPool3dGrad");let c=o,h=l,d=u,p=!1;4===l.rank&&(p=!0,c=Tc(o,[1,o.shape[0],o.shape[1],o.shape[2],o.shape[3]]),h=Tc(l,[1,l.shape[0],l.shape[1],l.shape[2],l.shape[3]]),d=Tc(u,[1,u.shape[0],u.shape[1],u.shape[2],u.shape[3]])),qt(5===c.rank,(()=>`Error in maxPool3dGrad: dy must be rank 5 but got rank ${c.rank}.`)),qt(5===h.rank,(()=>`Error in maxPool3dGrad: input must be rank 5 but got rank ${h.rank}.`)),qt(5===d.rank,(()=>`Error in maxPool3dGrad: output must be rank 5 but got rank ${d.rank}.`)),Ic("maxPool3dGrad",a,i);const f={dy:c,input:h,output:d},m={filterSize:s,strides:r,pad:a,dimRoundingMode:i},g=to.runKernel(pr,f,m);return p?Tc(g,[g.shape[1],g.shape[2],g.shape[3],g.shape[4]]):g}}),zy={kernelName:dr,inputsToSave:["x"],outputsToSave:[!0],gradFunc:(e,t,n)=>{const[s,r]=t,{filterSize:a,strides:i,pad:o,dimRoundingMode:l}=n;return{x:()=>By(e,s,r,a,i,o,l)}}};const Ly=fo({maxPoolGrad_:function(e,t,n,s,r,a,i){const o=co(e,"dy","maxPoolGrad"),l=co(t,"input","maxPoolGrad"),u=co(n,"output","maxPoolGrad");qt(l.rank===o.rank,(()=>`Rank of input (${l.rank}) does not match rank of dy (${o.rank})`)),qt(4===o.rank,(()=>`Error in maxPoolGrad: dy must be rank 4 but got rank ${o.rank}.`)),qt(4===l.rank,(()=>`Error in maxPoolGrad: input must be rank 4 but got rank ${l.rank}.`)),Ic("maxPoolGrad",a,i);const c={dy:o,input:l,output:u},h={filterSize:s,strides:r,pad:a,dimRoundingMode:i};return to.runKernel(hr,c,h)}}),Py={kernelName:cr,inputsToSave:["x"],outputsToSave:[!0],gradFunc:(e,t,n)=>{const[s,r]=t,{filterSize:a,strides:i,pad:o}=n;return{x:()=>Ly(e,s,r,a,i,o)}}},Vy={kernelName:br,inputsToSave:["x"],gradFunc:(e,t,n)=>{const s=t[0],{paddings:r}=n,a=r.map((e=>e[0]));return{x:()=>Fc(e,a,s.shape)}}},Wy={kernelName:Tr,saveAllInputs:!0,gradFunc:(e,t,n)=>{const{axis:s}=n;return $p(e,s).map((e=>()=>e))}},Uy={kernelName:Nr,inputsToSave:["x"],gradFunc:(e,t,n)=>{const s=t[0],{paddings:r}=n,a=r.map((e=>e[0]));return{x:()=>Fc(e,a,s.shape)}}},Gy={kernelName:Or,inputsToSave:["a","b"],outputsToSave:[!0],gradFunc:(e,t)=>{const[n,s,r]=t,a=n,i=s,o=su(a.shape,i.shape);return{a:()=>{const t=Nl(i,"float32");let n=Bl(e,Bl(t,Yl(a,Ql(t,Wl(1)))));const s=nu(a.shape,o);return s.length>0&&(n=Dh(n,s)),Tc(n,a.shape)},b:()=>{const t=qh(a,0),n=gh(t,td(a),Pl(a));let s=Bl(e,Bl(r,n));const l=nu(i.shape,o);return l.length>0&&(s=Dh(s,l)),Tc(s,i.shape)}}}};function qy(e,t,n){const s=e.shape.length,r=s-n.length,a=Ih(n,s);let i=e;null!=a&&(i=Jp(e,a));const o=i.shape.slice(),l=o.splice(s-n.length,n.length).reduce(((e,t)=>e*t),1);o.push(l);let u=function(e,t,n){const s=e.shape.slice();s[n]=1;const r=Tc(t,s),a=lh(e,n,!0,!1),i=lh(e,n,!0,!0),o=Bl(a,i);return Bl(r,o)}(i.reshape(o),t,r);if(u=u.reshape(i.shape),null!=a){const e=Th(a);u=Jp(u,e)}return u}const jy={kernelName:ea,inputsToSave:["x"],gradFunc:(e,t)=>{const[n]=t;return{x:()=>{const t=qh(n,Wl(0)),s=Wl(Um),r=Wl(Gm),a=Bl(e,r),i=Bl(Bl(e,s),zh(Nl(n,"float32")));return gh(t,a,i)}}}},Hy={kernelName:ua,gradFunc:(e,t,n)=>{const{blockShape:s,paddings:r}=n;return{x:()=>Lc(e,s,r)}}},$y={kernelName:ca,gradFunc:(e,t,n)=>{const{axis:s}=n;return{x:()=>Rc(e,s)}}},Ky={kernelName:_a,inputsToSave:["x"],gradFunc:(e,t,n)=>{const[s]=t,{reps:r}=n;return{x:()=>{let t=Pl(s);if(1===s.rank)for(let n=0;n{const[n,s]=t,r=su(n.shape,s.shape);return{a:()=>{const t=Fl(e,Nl(s,"float32")),a=nu(n.shape,r);return a.length>0?Tc(Dh(t,a),n.shape):t},b:()=>{let t=Bl(e,Nl(n,"float32"));const a=nu(s.shape,r);a.length>0&&(t=Tc(Dh(t,a),s.shape));const i=Ll(s);return sd(Fl(t,Nl(i,"float32")))}}}},hy,dy,py,fy,my,yy,gy,by,wy,Ay,ky,Cy,Sy,Ey,_y,Iy,Ty,Ny,Ry,My,My,Fy,zy,Py,{kernelName:mr,inputsToSave:["x"],gradFunc:(e,t,n)=>{const[s]=t,{axis:r}=n,a=en(r,s.shape),i=$t(Sh(s.shape,a)[1]);return{x:()=>{const t=s.shape.slice();a.forEach((e=>{t[e]=1}));const n=Tc(e,t);return Fl(Bl(n,vd(s.shape,"float32")),i)}}}},{kernelName:gr,inputsToSave:["x"],outputsToSave:[!0],gradFunc:(e,t,n)=>{const s=n,{axis:r}=s,[a,i]=t,o=Dy(e,i,a,en(r,a.shape));return{x:()=>o.x()}}},{kernelName:yr,inputsToSave:["a","b"],gradFunc:(e,t)=>{const[n,s]=t;return{a:()=>Bl(e,Nl(Qh(n,s),"float32")),b:()=>Bl(e,Nl(qh(n,s),"float32"))}}},Vy,{kernelName:wr,inputsToSave:["a","b"],gradFunc:(e,t)=>{const[n,s]=t,r=su(n.shape,s.shape);return{a:()=>{const t=nu(n.shape,r);return t.length>0?Tc(Dh(e,t),n.shape):e},b:()=>{const t=Bl(e,sd(Uh(Fl(n,s)))),a=nu(s.shape,r);return a.length>0?Tc(Dh(t,a),s.shape):t}}}},{kernelName:xr,inputsToSave:["a","b"],gradFunc:(e,t)=>{const[n,s]=t,r=su(n.shape,s.shape);return{a:()=>{const t=Bl(e,Nl(s,"float32")),a=nu(n.shape,r);return a.length>0?Tc(Dh(t,a),n.shape):t},b:()=>{const t=Bl(e,Nl(n,"float32")),a=nu(s.shape,r);return a.length>0?Tc(Dh(t,a),s.shape):t}}}},{kernelName:Ar,gradFunc:e=>({x:()=>sd(e)})},{kernelName:Ir,inputsToSave:["indices"],gradFunc:(e,t)=>{const n=t[0];return{indices:()=>wd(n.shape,"float32")}}},{kernelName:_r,gradFunc:e=>({x:()=>Pl(e)})},Wy,Uy,Uy,Gy,{kernelName:Rr,inputsToSave:["x","alpha"],gradFunc:(e,t)=>{const[n,s]=t,r=qh(n,0);return{x:()=>gh(r,e,Bl(e,s)),alpha:()=>{let t=gh(r,Pl(e),Bl(e,n));const a=nu(s.shape,e.shape);return a.length>0&&(t=Dh(t,a)),Tc(t,s.shape)}}}},{kernelName:Dr,inputsToSave:["x"],gradFunc:(e,t,n)=>{const[s]=t,{axis:r}=n;let a=[];return a=null==r?s.shape.map(((e,t)=>t)):"number"==typeof r?[r]:r,{x:()=>qy(s,e,a)}}},{kernelName:Pr,inputsToSave:["x"],gradFunc:(e,t)=>{const[n]=t;return{x:()=>Fl(e,sd(Ll(n)))}}},{kernelName:Hr,inputsToSave:["x"],gradFunc:(e,t)=>{const[n]=t,s=Bl(Qh(n,6),Op(n));return{x:()=>Bl(e,Nl(s,"float32"))}}},{kernelName:Vr,inputsToSave:["x"],gradFunc:(e,t)=>{const[n]=t;return{x:()=>Bl(e,Nl(Op(n),"float32"))}}},{kernelName:Wr,inputsToSave:["x"],gradFunc:(e,t)=>{const[n]=t;return{x:()=>Tc(e,n.shape)}}},{kernelName:qr,inputsToSave:["images"],gradFunc:(e,t,n)=>{const[s]=t,r={dy:e,images:s};return{images:()=>to.runKernel(jr,r,n)}}},{kernelName:Ur,inputsToSave:["images"],gradFunc:(e,t,n)=>{const[s]=t,r={dy:e,images:s};return{images:()=>to.runKernel(Gr,r,n)}}},{kernelName:$r,gradFunc:(e,t,n)=>{const{dims:s}=n,r=en(s,e.shape);return{x:()=>ap(e,r)}}},{kernelName:Kr,gradFunc:e=>({x:()=>Pl(e)})},{kernelName:Xr,inputsToSave:["x"],gradFunc:(e,t)=>{const[n]=t;return{x:()=>sd(Fl(e,Bl(Yl(n,1.5),2)))}}},{kernelName:Jr,inputsToSave:["condition"],gradFunc:(e,t)=>{const[n]=t;return{condition:()=>Nl(Pl(n),"float32"),t:()=>Bl(e,Nl(n,e.dtype)),e:()=>Bl(e,Nl(ud(n),e.dtype))}}},jy,{kernelName:aa,outputsToSave:[!0],gradFunc:(e,t)=>{const[n]=t;return{x:()=>Bl(e,Bl(n,Ql(Wl(1),n)))}}},{kernelName:ra,gradFunc:e=>({x:()=>Pl(e)})},{kernelName:na,inputsToSave:["x"],gradFunc:(e,t)=>{const[n]=t;return{x:()=>Bl(ih(Nl(n,"float32")),e)}}},{kernelName:sa,inputsToSave:["x"],gradFunc:(e,t)=>{const[n]=t;return{x:()=>Bl(oh(Nl(n,"float32")),e)}}},{kernelName:ta,inputsToSave:["x"],gradFunc:(e,t,n)=>{const[s]=t,{begin:r,size:a}=n,i=s.shape,[o,l]=Ju(s,r,a),u=[];for(let t=0;tRd(e,u)}}},{kernelName:ha,outputsToSave:[!0],gradFunc:(e,t,n)=>{const[s]=t,{dim:r}=n,a=Bl(e,s);return{logits:()=>Ql(a,Bl(Dh(a,[r],true),s))}}},{kernelName:ia,inputsToSave:["x"],gradFunc:(e,t)=>{const[n]=t;return{x:()=>Bl(e,Mc(n))}}},Hy,Hy,$y,$y,{kernelName:oa,inputsToSave:["x"],gradFunc:(e,t)=>{const[n]=t;return{x:()=>Fl(e,Bl(zl(Nl(n,"float32")),2))}}},{kernelName:ya,inputsToSave:["a","b"],gradFunc:(e,t)=>{const[n,s]=t,r=Wl(2);return{a:()=>Bl(e,Bl(r,Ql(n,s))),b:()=>Bl(e,Bl(r,Ql(s,n)))}}},{kernelName:ba,inputsToSave:["x"],gradFunc:(e,t)=>{const[n]=t;return{x:()=>Bl(e,Bl(Nl(n,"float32"),2))}}},{kernelName:Fa,gradFunc:e=>({x:()=>Pl(e)})},{kernelName:Ca,inputsToSave:["a","b"],gradFunc:(e,t)=>{const[n,s]=t,r=su(n.shape,s.shape);return{a:()=>{let t=e;const s=nu(n.shape,r);return s.length>0&&(t=Dh(t,s)),Tc(t,n.shape)},b:()=>{let t=e;const n=nu(s.shape,r);return n.length>0&&(t=Dh(t,n)),Tc(sd(t),s.shape)}}}},{kernelName:la,inputsToSave:["x"],gradFunc:(e,t,n)=>{const[s]=t,r=s.shape.slice(),{axis:a}=n;en(a,s.shape).forEach((e=>{r[e]=1}));const i=Tc(e,r),o=Bl(i,vd(s.shape,"float32"));return{x:()=>o}}},{kernelName:Sa,inputsToSave:["x"],gradFunc:(e,t)=>{const[n]=t;return{x:()=>Fl(e,Ll(ih(n)))}}},{kernelName:Ea,outputsToSave:[!0],gradFunc:(e,t)=>{const[n]=t;return{x:()=>Bl(Ql(Wl(1),Ll(n)),e)}}},Ky,{kernelName:Na,gradFunc:(e,t,n)=>{const s=n,{perm:r}=s,a=Th(r);return{x:()=>Jp(e,a)}}},{kernelName:Ra,gradFunc:(e,t,n)=>{const s=n,{axis:r}=s;return{value:()=>Np(e,r)}}},{kernelName:Da,inputsToSave:["segmentIds"],gradFunc:(e,t)=>{const[n]=t;return{x:()=>function(e,t){const n=ru(t,Pl(t)),s=Gh(e,n);let r=jh(t,Wl(0,"int32"));const a=s.rank-r.rank;for(let e=0;e({x:()=>Pl(e)})}];for(const e of Xy)Xa(e);Fi().prototype.abs=function(){return this.throwIfDisposed(),eu(this)},Fi().prototype.acos=function(){return this.throwIfDisposed(),nc(this)},Fi().prototype.acosh=function(){return this.throwIfDisposed(),sc(this)},Fi().prototype.add=function(e){return this.throwIfDisposed(),Dl(this,e)},Fi().prototype.all=function(e,t){return this.throwIfDisposed(),ac(this,e,t)},Fi().prototype.any=function(e,t){return this.throwIfDisposed(),ic(this,e,t)},Fi().prototype.argMax=function(e){return this.throwIfDisposed(),oc(this,e)},Fi().prototype.argMin=function(e){return this.throwIfDisposed(),lc(this,e)},Fi().prototype.asScalar=function(){return this.throwIfDisposed(),qt(1===this.size,(()=>"The array must have only 1 element.")),Tc(this,[])},Fi().prototype.asType=function(e){return this.throwIfDisposed(),Nl(this,e)},Fi().prototype.as1D=function(){return this.throwIfDisposed(),Tc(this,[this.size])},Fi().prototype.as2D=function(e,t){return this.throwIfDisposed(),Tc(this,[e,t])},Fi().prototype.as3D=function(e,t,n){return this.throwIfDisposed(),Tc(this,[e,t,n])},Fi().prototype.as4D=function(e,t,n,s){return this.throwIfDisposed(),Tc(this,[e,t,n,s])},Fi().prototype.as5D=function(e,t,n,s,r){return this.throwIfDisposed(),Tc(this,[e,t,n,s,r])},Fi().prototype.asin=function(){return this.throwIfDisposed(),uc(this)},Fi().prototype.asinh=function(){return this.throwIfDisposed(),cc(this)},Fi().prototype.atan=function(){return this.throwIfDisposed(),hc(this)},Fi().prototype.atan2=function(e){return this.throwIfDisposed(),dc(this,e)},Fi().prototype.atanh=function(){return this.throwIfDisposed(),pc(this)},Fi().prototype.avgPool=function(e,t,n,s){return this.throwIfDisposed(),Nc(this,e,t,n,s)},Fi().prototype.batchToSpaceND=function(e,t){return this.throwIfDisposed(),Lc(this,e,t)},Fi().prototype.batchNorm=function(e,t,n,s,r){return this.throwIfDisposed(),Pc(this,e,t,n,s,r)},Fi().prototype.broadcastTo=function(e){return this.throwIfDisposed(),Hc(this,e)},Fi().prototype.cast=function(e){return this.throwIfDisposed(),Nl(this,e)},Fi().prototype.ceil=function(){return this.throwIfDisposed(),$c(this)},Fi().prototype.clipByValue=function(e,t){return this.throwIfDisposed(),Kc(this,e,t)},Fi().prototype.concat=function(e,t){return this.throwIfDisposed(),e instanceof Mi&&(e=[e]),Rc([this,...e],t)},Fi().prototype.conv1d=function(e,t,n,s,r,a){return this.throwIfDisposed(),eh(this,e,t,n,s,r,a)},Fi().prototype.conv2dTranspose=function(e,t,n,s,r){return this.throwIfDisposed(),nh(this,e,t,n,s,r)},Fi().prototype.conv2d=function(e,t,n,s,r,a){return this.throwIfDisposed(),Jc(this,e,t,n,s,r,a)},Fi().prototype.cos=function(){return this.throwIfDisposed(),ih(this)},Fi().prototype.cosh=function(){return this.throwIfDisposed(),oh(this)},Fi().prototype.cumprod=function(e,t,n){return this.throwIfDisposed(),lh(this,e,t,n)},Fi().prototype.cumsum=function(e,t,n){return this.throwIfDisposed(),uh(this,e,t,n)},Fi().prototype.depthToSpace=function(e,t){return this.throwIfDisposed(),hh(this,e,t)},Fi().prototype.depthwiseConv2d=function(e,t,n,s,r,a){return this.throwIfDisposed(),dh(this,e,t,n,s,r,a)},Fi().prototype.dilation2d=function(e,t,n,s,r){return this.throwIfDisposed(),fh(this,e,t,n,s,r)},Fi().prototype.divNoNan=function(e){return this.throwIfDisposed(),yh(this,e)},Fi().prototype.div=function(e){return this.throwIfDisposed(),Fl(this,e)},Fi().prototype.dot=function(e){return this.throwIfDisposed(),bh(this,e)},Fi().prototype.elu=function(){return this.throwIfDisposed(),vh(this)},Fi().prototype.equal=function(e){return this.throwIfDisposed(),mh(this,e)},Fi().prototype.erf=function(){return this.throwIfDisposed(),Ah(this)},Fi().prototype.euclideanNorm=function(e,t){return this.throwIfDisposed(),Bh(this,e,t)},Fi().prototype.exp=function(){return this.throwIfDisposed(),zh(this)},Fi().prototype.expandDims=function(e){return this.throwIfDisposed(),Lh(this,e)},Fi().prototype.expm1=function(){return this.throwIfDisposed(),Ph(this)},Fi().prototype.fft=function(){return this.throwIfDisposed(),kp(this)},Fi().prototype.flatten=function(){return this.throwIfDisposed(),Tc(this,[this.size])},Fi().prototype.floor=function(){return this.throwIfDisposed(),Uh(this)},Fi().prototype.floorDiv=function(e){return this.throwIfDisposed(),Ml(this,e)},Fi().prototype.gather=function(e,t,n){return this.throwIfDisposed(),Gh(this,e,t,n)},Fi().prototype.greaterEqual=function(e){return this.throwIfDisposed(),jh(this,e)},Fi().prototype.greater=function(e){return this.throwIfDisposed(),qh(this,e)},Fi().prototype.ifft=function(){return this.throwIfDisposed(),Cp(this)},Fi().prototype.irfft=function(){return this.throwIfDisposed(),Sp(this)},Fi().prototype.isFinite=function(){return this.throwIfDisposed(),$h(this)},Fi().prototype.isInf=function(){return this.throwIfDisposed(),Kh(this)},Fi().prototype.isNaN=function(){return this.throwIfDisposed(),Xh(this)},Fi().prototype.leakyRelu=function(e){return this.throwIfDisposed(),Zh(this,e)},Fi().prototype.lessEqual=function(e){return this.throwIfDisposed(),Qh(this,e)},Fi().prototype.less=function(e){return this.throwIfDisposed(),Yh(this,e)},Fi().prototype.localResponseNormalization=function(e,t,n,s){return this.throwIfDisposed(),ed(this,e,t,n,s)},Fi().prototype.logSigmoid=function(){return this.throwIfDisposed(),ad(this)},Fi().prototype.logSoftmax=function(e){return this.throwIfDisposed(),id(this,e)},Fi().prototype.logSumExp=function(e,t){return this.throwIfDisposed(),od(this,e,t)},Fi().prototype.log=function(){return this.throwIfDisposed(),td(this)},Fi().prototype.log1p=function(){return this.throwIfDisposed(),nd(this)},Fi().prototype.logicalAnd=function(e){return this.throwIfDisposed(),ld(this,e)},Fi().prototype.logicalNot=function(){return this.throwIfDisposed(),ud(this)},Fi().prototype.logicalOr=function(e){return this.throwIfDisposed(),cd(this,e)},Fi().prototype.logicalXor=function(e){return this.throwIfDisposed(),hd(this,e)},Fi().prototype.matMul=function(e,t,n){return this.throwIfDisposed(),Dc(this,e,t,n)},Fi().prototype.maxPool=function(e,t,n,s){return this.throwIfDisposed(),md(this,e,t,n,s)},Fi().prototype.max=function(e,t){return this.throwIfDisposed(),Oh(this,e,t)},Fi().prototype.maximum=function(e){return this.throwIfDisposed(),ru(this,e)},Fi().prototype.mean=function(e,t){return this.throwIfDisposed(),bd(this,e,t)},Fi().prototype.min=function(e,t){return this.throwIfDisposed(),Rh(this,e,t)},Fi().prototype.minimum=function(e){return this.throwIfDisposed(),Ad(this,e)},Fi().prototype.mirrorPad=function(e,t){return this.throwIfDisposed(),kd(this,e,t)},Fi().prototype.mod=function(e){return this.throwIfDisposed(),Cd(this,e)},Fi().prototype.mul=function(e){return this.throwIfDisposed(),Bl(this,e)},Fi().prototype.neg=function(){return this.throwIfDisposed(),sd(this)},Fi().prototype.norm=function(e,t,n){return this.throwIfDisposed(),Fh(this,e,t,n)},Fi().prototype.notEqual=function(e){return this.throwIfDisposed(),Id(this,e)},Fi().prototype.oneHot=function(e,t=1,n=0){return this.throwIfDisposed(),Td(this,e,t,n)},Fi().prototype.onesLike=function(){return this.throwIfDisposed(),Nd(this)},Fi().prototype.pad=function(e,t){return this.throwIfDisposed(),Rd(this,e,t)},Fi().prototype.pool=function(e,t,n,s,r,a){return this.throwIfDisposed(),Ld(this,e,t,n,s,r,a)},Fi().prototype.pow=function(e){return this.throwIfDisposed(),Yl(this,e)},Fi().prototype.prelu=function(e){return this.throwIfDisposed(),Pd(this,e)},Fi().prototype.prod=function(e,t){return this.throwIfDisposed(),Vd(this,e,t)},Fi().prototype.reciprocal=function(){return this.throwIfDisposed(),np(this)},Fi().prototype.relu=function(){return this.throwIfDisposed(),sp(this)},Fi().prototype.relu6=function(){return this.throwIfDisposed(),rp(this)},Fi().prototype.reshapeAs=function(e){return this.throwIfDisposed(),Tc(this,e.shape)},Fi().prototype.reshape=function(e){return this.throwIfDisposed(),Tc(this,e)},Fi().prototype.resizeBilinear=function(e,t,n){return this.throwIfDisposed(),qf(this,e,t,n)},Fi().prototype.resizeNearestNeighbor=function(e,t,n){return this.throwIfDisposed(),jf(this,e,t,n)},Fi().prototype.reverse=function(e){return this.throwIfDisposed(),ap(this,e)},Fi().prototype.rfft=function(){return this.throwIfDisposed(),_p(this)},Fi().prototype.round=function(){return this.throwIfDisposed(),cp(this)},Fi().prototype.rsqrt=function(){return this.throwIfDisposed(),hp(this)},Fi().prototype.selu=function(){return this.throwIfDisposed(),dp(this)},Fi().prototype.separableConv2d=function(e,t,n,s,r,a){return this.throwIfDisposed(),pp(this,e,t,n,s,r,a)},Fi().prototype.sigmoid=function(){return this.throwIfDisposed(),Mc(this)},Fi().prototype.sign=function(){return this.throwIfDisposed(),mp(this)},Fi().prototype.sin=function(){return this.throwIfDisposed(),gp(this)},Fi().prototype.sinh=function(){return this.throwIfDisposed(),yp(this)},Fi().prototype.slice=function(e,t){return this.throwIfDisposed(),Fc(this,e,t)},Fi().prototype.softmax=function(e){return this.throwIfDisposed(),Ap(this,e)},Fi().prototype.softplus=function(){return this.throwIfDisposed(),rd(this)},Fi().prototype.spaceToBatchND=function(e,t){return this.throwIfDisposed(),zd(this,e,t)},Fi().prototype.split=function(e,t){return this.throwIfDisposed(),Ep(this,e,t)},Fi().prototype.sqrt=function(){return this.throwIfDisposed(),zl(this)},Fi().prototype.square=function(){return this.throwIfDisposed(),Ll(this)},Fi().prototype.squaredDifference=function(e){return this.throwIfDisposed(),Ip(this,e)},Fi().prototype.squeeze=function(e){return this.throwIfDisposed(),Tp(this,e)},Fi().prototype.stack=function(e,t){this.throwIfDisposed();const n=e instanceof Mi?[this,e]:[this,...e];return Np(n,t)},Fi().prototype.step=function(e){return this.throwIfDisposed(),Op(this,e)},Fi().prototype.stridedSlice=function(e,t,n,s,r,a,i,o){return this.throwIfDisposed(),Rp(this,e,t,n,s,r,a,i,o)},Fi().prototype.sub=function(e){return this.throwIfDisposed(),Ql(this,e)},Fi().prototype.sum=function(e,t){return this.throwIfDisposed(),Dh(this,e,t)},Fi().prototype.tan=function(){return this.throwIfDisposed(),Dp(this)},Fi().prototype.tanh=function(){return this.throwIfDisposed(),Bc(this)},Fi().prototype.tile=function(e){return this.throwIfDisposed(),Vh(this,e)},Fi().prototype.toBool=function(){return this.throwIfDisposed(),Nl(this,"bool")},Fi().prototype.toFloat=function(){return this.throwIfDisposed(),Nl(this,"float32")},Fi().prototype.toInt=function(){return this.throwIfDisposed(),Nl(this,"int32")},Fi().prototype.topk=function(e,t){return this.throwIfDisposed(),Gp(this,e,t)},Fi().prototype.transpose=function(e){return this.throwIfDisposed(),Jp(this,e)},Fi().prototype.unique=function(e){return this.throwIfDisposed(),jp(this,e)},Fi().prototype.unsortedSegmentSum=function(e,t){return this.throwIfDisposed(),Hp(this,e,t)},Fi().prototype.unstack=function(e){return this.throwIfDisposed(),$p(this,e)},Fi().prototype.where=function(e,t){return this.throwIfDisposed(),gh(e,this,t)},Fi().prototype.zerosLike=function(){return this.throwIfDisposed(),Pl(this)};class Zy extends Error{constructor(e){super(e),Object.setPrototypeOf(this,Zy.prototype)}}class Yy extends Error{constructor(e){super(e),Object.setPrototypeOf(this,Yy.prototype)}}class Qy extends Error{constructor(e){super(e),Object.setPrototypeOf(this,Qy.prototype)}}class Jy extends Error{constructor(e){super(e),Object.setPrototypeOf(this,Jy.prototype)}}class eb extends Error{constructor(e){super(e),Object.setPrototypeOf(this,eb.prototype)}}Error;class tb{constructor(e){this.maxEntries=e||100,this.cache=new Map}get(e){let t;return this.cache.has(e)&&(t=this.cache.get(e),this.cache.delete(e),this.cache.set(e,t)),t}put(e,t){if(this.cache.has(e))this.cache.delete(e);else if(this.cache.size>=this.maxEntries){const e=this.cache.keys().next().value;this.cache.delete(e)}this.cache.set(e,t)}getMaxEntries(){return this.maxEntries}setMaxEntries(e){if(e<0)throw new Error(`The maxEntries of LRU caches must be at least 0, but got ${e}.`);if(this.maxEntries>e)for(let t=0;tt.toUpperCase()))}let ub={};function cb(e){if(null==e)return null;const t={};return t.className=e.getClassName(),t.config=e.getConfig(),t}function hb(e){if(null!=e&&"object"==typeof e)if(Array.isArray(e))e.forEach((e=>hb(e)));else{const t=Object.keys(e);for(const n of t){const t=e[n];null!=t&&"object"==typeof t&&(Array.isArray(t)||"ndarray"!==t.type||"number"!=typeof t.value?hb(t):e[n]=t.value)}}}function db(e,t={},n={},s="object",r=!1){if("string"==typeof e){const r=e;let a;if(r in n)a=n[r];else if(r in ub)a=ub[r];else if(a=t[r],null==a)throw new Qy(`Unknown ${s}: ${e}. This may be due to one of the following reasons:\n1. The ${s} is defined in Python, in which case it needs to be ported to TensorFlow.js or your JavaScript code.\n2. The custom ${s} is defined in JavaScript, but is not registered properly with tf.serialization.registerClass().`);return a}{const a=e;if(null==a.className||null==a.config)throw new Qy(`${s}: Improper config format: ${JSON.stringify(a)}.\n'className' and 'config' must set.`);const i=a.className;let o,l;if(i in n?[o,l]=n[i]:i in ub?[o,l]=ub.className:i in t&&([o,l]=t[i]),null==o)throw new Qy(`Unknown ${s}: ${i}. This may be due to one of the following reasons:\n1. The ${s} is defined in Python, in which case it needs to be ported to TensorFlow.js or your JavaScript code.\n2. The custom ${s} is defined in JavaScript, but is not registered properly with tf.serialization.registerClass().`);if(null!=l){const e={};for(const t of Object.keys(ub))e[t]=ub[t];for(const t of Object.keys(n))e[t]=n[t];a.config.customObjects=e;const t=Object.assign({},ub);for(const e of Object.keys(n))ub[e]=n[e];hb(a.config);const s=l(o,a.config,n,r);return ub=Object.assign({},t),s}{const e=Object.assign({},ub);for(const e of Object.keys(n))ub[e]=n[e];const t=new o(a.config);return ub=Object.assign({},e),t}}}function pb(e,t){return-1*function(e,t){return et?1:0}(e,t)}function fb(e){if(null==e)return e;const t=[];for(const n of e)-1===t.indexOf(n)&&t.push(n);return t}function mb(e){if(null==e)throw new Qy(`Invalid value in obj: ${JSON.stringify(e)}`);for(const t in e)if(e.hasOwnProperty(t))return!1;return!0}function gb(e,t,n){if(null!=n&&e.indexOf(n)<0)throw new Qy(`${n} is not a valid ${t}. Valid values are ${e} or null/undefined.`)}function yb(e,t,n=0,s=1/0){return sb(n>=0),sb(s>=n),Array.isArray(e)&&e.length>=n&&e.length<=s&&e.every((e=>typeof e===t))}function bb(e,t){Array.isArray(e)?(qt(e.length>0,(()=>`${t} is unexpectedly an empty array.`)),e.forEach(((e,n)=>bb(e,`element ${n+1} of ${t}`)))):qt(Number.isInteger(e)&&e>0,(()=>`Expected ${t} to be a positive integer, but got ${wb(e)}.`))}function wb(e){return null===e?"null":Array.isArray(e)?"["+e.map((e=>wb(e))).join(",")+"]":"string"==typeof e?`"${e}"`:`${e}`}function vb(e){return"relu"===e?"relu":"linear"===e?"linear":"elu"===e?"elu":null}let xb=0;function Ab(){return xb++}const kb={};function Cb(e=""){return e in kb||(kb[e]=0),kb[e]+=1,e+kb[e].toString()}const Sb=["channelsFirst","channelsLast"],Eb=["nearest","bilinear"],_b=["valid","same","causal"],Ib=["max","avg"],Tb=["sum","mul","concat","ave"],Nb=new Map;function Ob(e){gb(Sb,"DataFormat",e)}function Rb(e){gb(_b,"PaddingMode",e)}function Db(e){gb(Ib,"PoolMode",e)}const Mb=[],Fb="/";function Bb(e,t){Mb.push(e);try{const e=t();return Mb.pop(),e}catch(e){throw Mb.pop(),e}}function zb(e){if(!Vb(e))throw new Error("Not a valid tensor name: '"+e+"'");return(0===Mb.length?"":Mb.join(Fb)+Fb)+e}function Lb(e){if(!Vb(e))throw new Error("Not a valid tensor name: '"+e+"'");Nb.has(e)||Nb.set(e,0);const t=Nb.get(e);if(Nb.set(e,Nb.get(e)+1),t>0){const n=`${e}_${t}`;return Nb.set(n,1),n}return e}const Pb=new RegExp(/^[A-Za-z0-9][-A-Za-z0-9\._\/]*$/);function Vb(e){return!!e.match(Pb)}function Wb(e,t,n){null==t&&(t=0),null==n&&(n=e.length);let s=1;for(let r=t;rt&&(t=s)}return t}function qb(e,t){if(t{switch(e.rank){case 1:return bp(e,t,n);case 2:return wp(e,[t,0],[n,e.shape[1]]);case 3:return vp(e,[t,0,0],[n,e.shape[1],e.shape[2]]);case 4:return xp(e,[t,0,0,0],[n,e.shape[1],e.shape[2],e.shape[3]]);case 5:return Fc(e,[t,0,0,0,0],[n,e.shape[1],e.shape[2],e.shape[3],e.shape[4]]);case 6:return Fc(e,[t,0,0,0,0,0],[n,e.shape[1],e.shape[2],e.shape[3],e.shape[4],e.shape[5]]);default:throw new Qy(`sliceAlongFirstAxis() received an unsupported tensor rank: ${e.rank}`)}}))}function Zb(e,t,n){return Ao((()=>{switch(e.rank){case 1:return bp(e,t,n);case 2:return wp(e,[0,t],[e.shape[0],n]);case 3:return vp(e,[0,0,t],[e.shape[0],e.shape[1],n]);case 4:return xp(e,[0,0,0,t],[e.shape[0],e.shape[1],e.shape[2],n]);default:throw new Qy(`sliceAlongLastAxis() received an unsupported tensor rank: ${e.rank}`)}}))}function Yb(e,t,n,s){return Ao((()=>{switch(e.rank){case 1:return bp(e,t,n);case 2:switch(s){case 1:return Xb(e,t,n);case 2:return Zb(e,t,n);default:throw new Qy(`The axis is not within the rank of the tensor ${s}`)}case 3:switch(s){case 1:return Xb(e,t,n);case 2:return vp(e,[0,t,0],[e.shape[0],n,e.shape[2]]);case 3:return Zb(e,t,n);default:throw new Qy(`The axis is not within the rank of the tensor ${s}`)}case 4:switch(s){case 1:return Xb(e,t,n);case 2:return xp(e,[0,t,0,0],[e.shape[0],n,e.shape[2],e.shape[3]]);case 3:return xp(e,[0,0,t,0],[e.shape[0],e.shape[1],n,e.shape[3]]);case 4:return Zb(e,t,n);default:throw new Qy(`The axis is not within the rank of the tensor ${s}`)}default:throw new Qy(`sliceAlongLastAxis() received an unsupported tensor rank: ${e.rank}`)}}))}function Qb(e,t=-1){let n;return t<0&&(n=e[0].rank,t=0!==n?n:0),t===e[0].rank&&(t=-1),Rc(e,t)}function Jb(e,t){switch(e.rank){case 1:return Xc([e,t]);case 2:return Zc([e,t],0);case 3:return Yc([e,t],0);case 4:return Qc([e,t],0);default:throw new Qy(`concatAlongFirstAxis() received an unsupported tensor rank: ${e.rank}`)}}function ew(e,t){if(Array.isArray(t)||(t=[t]),e.rank!==t.length)throw new Qy(`The length of input n (${t.length}) does not match the number of dimensions in input x (${e.rank})`);return Vh(e,t)}function tw(e,t=0,n=1,s,r){return Zd(e,t,n,s,r)}function nw(e,t,n,s){if(e.rank<2||t.rank<2)throw new Jy(`dot requires both inputs to be rank >= 2 but got x shape = ${e.shape} and y shape = ${t.shape}`);if(t.rank>=3){if(e.shape.slice(-1)[0]!==t.shape.slice(-2)[0])throw new Jy(`If rank y >= 3, then the second last dim of y must equal the last dim of x but got x shape = ${e.shape} and y shape = ${t.shape}`)}if(2===e.rank&&2===t.rank){return bf({a:e,b:t,transposeA:!1,transposeB:!1,bias:s?aw(e.rank,s,"channelsLast"):null,activation:n})}{const r=e.shape.slice(),a=r.pop();e=Tc(e,[-1,a]);const i=t.shape.slice(),o=i.pop(),l=i.pop(),u=[...i,o],c=Array.from({length:t.rank},((e,n)=>0===n?t.rank-2:n<=t.rank-2?n-1:n));t=Tc(Jp(t,c),[l,-1]);const h=[...r,...u];return Tc(bf({a:e,b:t,transposeA:!1,transposeB:!1,bias:s?aw(e.rank,s,"channelsLast"):null,activation:n}),h)}}function sw(e,t,n){return Ao((()=>(t=Array.isArray(t)?Mp(t,"int32"):Nl(t,"int32"),Gh(e,t,n))))}function rw(e){return Bl(e,e)}function aw(e,t,n){const s=t.shape;if(1!==t.rank&&t.rank!==e)throw new Qy(`Unexpected bias dimensions: ${t.rank}; expected it to be 1 or ${e}`);if(5===e){if("channelsFirst"===n)return 1===s.length?Tc(t,[1,s[0],1,1,1]):Tc(t,[1,s[3],s[0],s[1],s[2]]);if("channelsLast"===n)return 1===s.length?Tc(t,[1,1,1,1,s[0]]):Tc(t,[1].concat(s))}else if(4===e){if("channelsFirst"===n)return 1===s.length?Tc(t,[1,s[0],1,1]):Tc(t,[1,s[2],s[0],s[1]]);if("channelsLast"===n)return 1===s.length?Tc(t,[1,1,1,s[0]]):Tc(t,[1].concat(s))}else if(3===e){if("channelsFirst"===n)return 1===s.length?Tc(t,[1,s[0],1]):Tc(t,[1,s[1],s[0]]);if("channelsLast"===n)return 1===s.length?Tc(t,[1,1,s[0]]):Tc(t,[1].concat(s))}else if(e<3)return t;throw new Qy(`Unsupported input rank by biasAdd: ${t.rank}`)}function iw(e,t,n){return Ao((()=>(null==n&&(n="channelsLast"),Ob(n),Dl(e,aw(e.rank,t,n)))))}function ow(e,t,n,s){return Ao((()=>rf(e,t,n,s)))}function lw(e,t,n=!1){return n?e():t()}const uw=["fanIn","fanOut","fanAvg"],cw=["normal","uniform","truncatedNormal"];class hw extends ql{fromConfigUsesCustomObjects(){return!1}getConfig(){return{}}}class dw extends hw{apply(e,t){return wd(e,t)}}dw.className="Zeros",Hl(dw);class pw extends hw{apply(e,t){return vd(e,t)}}pw.className="Ones",Hl(pw);class fw extends hw{constructor(e){if(super(),"object"!=typeof e)throw new Qy(`Expected argument of type ConstantConfig but got ${e}`);if(void 0===e.value)throw new Qy(`config must have value set but got ${e}`);this.value=e.value}apply(e,t){return Ao((()=>Bl(Wl(this.value),vd(e,t))))}getConfig(){return{value:this.value}}}fw.className="Constant",Hl(fw);class mw extends hw{constructor(e){super(),this.DEFAULT_MINVAL=-.05,this.DEFAULT_MAXVAL=.05,this.minval=e.minval||this.DEFAULT_MINVAL,this.maxval=e.maxval||this.DEFAULT_MAXVAL,this.seed=e.seed}apply(e,t){return Qd(e,this.minval,this.maxval,t,this.seed)}getConfig(){return{minval:this.minval,maxval:this.maxval,seed:this.seed}}}mw.className="RandomUniform",Hl(mw);class gw extends hw{constructor(e){super(),this.DEFAULT_MEAN=0,this.DEFAULT_STDDEV=.05,this.mean=e.mean||this.DEFAULT_MEAN,this.stddev=e.stddev||this.DEFAULT_STDDEV,this.seed=e.seed}apply(e,t){if("float32"!==(t=t||"float32")&&"int32"!==t)throw new Jy(`randomNormal does not support dType ${t}.`);return tw(e,this.mean,this.stddev,t,this.seed)}getConfig(){return{mean:this.mean,stddev:this.stddev,seed:this.seed}}}gw.className="RandomNormal",Hl(gw);class yw extends hw{constructor(e){super(),this.DEFAULT_MEAN=0,this.DEFAULT_STDDEV=.05,this.mean=e.mean||this.DEFAULT_MEAN,this.stddev=e.stddev||this.DEFAULT_STDDEV,this.seed=e.seed}apply(e,t){if("float32"!==(t=t||"float32")&&"int32"!==t)throw new Jy(`truncatedNormal does not support dType ${t}.`);return qp(e,this.mean,this.stddev,t,this.seed)}getConfig(){return{mean:this.mean,stddev:this.stddev,seed:this.seed}}}yw.className="TruncatedNormal",Hl(yw);class bw extends hw{constructor(e){super(),this.gain=null!=e.gain?e.gain:1}apply(e,t){return Ao((()=>{if(2!==e.length||e[0]!==e[1])throw new Qy("Identity matrix initializer can only be used for 2D square matrices.");return Bl(this.gain,Wh(e[0]))}))}getConfig(){return{gain:this.gain}}}bw.className="Identity",Hl(bw);class ww extends hw{constructor(e){if(super(),e.scale<0)throw new Qy(`scale must be a positive float. Got: ${e.scale}`);var t;this.scale=null==e.scale?1:e.scale,this.mode=null==e.mode?"fanIn":e.mode,t=this.mode,gb(uw,"FanMode",t),this.distribution=null==e.distribution?"normal":e.distribution,function(e){gb(cw,"Distribution",e)}(this.distribution),this.seed=e.seed}apply(e,t){const n=function(e,t="channelsLast"){let n,s;if(Ob(t),2===e.length)n=e[0],s=e[1];else if(-1!==[3,4,5].indexOf(e.length)){if("channelsFirst"===t){const t=Wb(e,2);n=e[1]*t,s=e[0]*t}else if("channelsLast"===t){const t=Wb(e,0,e.length-2);n=e[e.length-2]*t,s=e[e.length-1]*t}}else{const t=Wb(e);n=Math.sqrt(t),s=Math.sqrt(t)}return[n,s]}(e),s=n[0],r=n[1];let a=this.scale;if("fanIn"===this.mode?a/=Math.max(1,s):"fanOut"===this.mode?a/=Math.max(1,r):a/=Math.max(1,(s+r)/2),"normal"===this.distribution){const n=Math.sqrt(a);if("float32"!==(t=t||"float32")&&"int32"!==t)throw new Jy(`${this.getClassName()} does not support dType ${t}.`);return qp(e,0,n,t,this.seed)}{const n=Math.sqrt(3*a);return Qd(e,-n,n,t,this.seed)}}getConfig(){return{scale:this.scale,mode:this.mode,distribution:this.distribution,seed:this.seed}}}ww.className="VarianceScaling",Hl(ww);class vw extends ww{constructor(e){super({scale:1,mode:"fanAvg",distribution:"uniform",seed:null==e?null:e.seed})}getClassName(){return ww.className}}vw.className="GlorotUniform",Hl(vw);class xw extends ww{constructor(e){super({scale:1,mode:"fanAvg",distribution:"normal",seed:null==e?null:e.seed})}getClassName(){return ww.className}}xw.className="GlorotNormal",Hl(xw);class Aw extends ww{constructor(e){super({scale:2,mode:"fanIn",distribution:"normal",seed:null==e?null:e.seed})}getClassName(){return ww.className}}Aw.className="HeNormal",Hl(Aw);class kw extends ww{constructor(e){super({scale:2,mode:"fanIn",distribution:"uniform",seed:null==e?null:e.seed})}getClassName(){return ww.className}}kw.className="HeUniform",Hl(kw);class Cw extends ww{constructor(e){super({scale:1,mode:"fanIn",distribution:"normal",seed:null==e?null:e.seed})}getClassName(){return ww.className}}Cw.className="LeCunNormal",Hl(Cw);class Sw extends ww{constructor(e){super({scale:1,mode:"fanIn",distribution:"uniform",seed:null==e?null:e.seed})}getClassName(){return ww.className}}Sw.className="LeCunUniform",Hl(Sw);class Ew extends hw{constructor(e){super(),this.DEFAULT_GAIN=1,this.ELEMENTS_WARN_SLOW=2e3,this.gain=null==e.gain?this.DEFAULT_GAIN:e.gain,this.seed=e.seed}apply(e,t){return Ao((()=>{if(e.length<2)throw new Jy("Shape must be at least 2D.");if("int32"!==t&&"float32"!==t&&void 0!==t)throw new TypeError(`Unsupported data type ${t}.`);const n=$t(e.slice(0,-1)),s=e[e.length-1];this.ELEMENTS_WARN_SLOW;const r=tw([Math.max(s,n),Math.min(s,n)],0,1,t,this.seed),a=wm.qr(r,!1);let i=a[0];const o=a[1].flatten().stridedSlice([0],[Math.min(s,n)*Math.min(s,n)],[Math.min(s,n)+1]);return i=Bl(i,o.sign()),ne*t));return t}const Bw="Variable";class zw{constructor(e,t="float32",n=Bw,s=!0,r=null){this.dtype=null==t?"float32":t,this.shape=e.shape,this.id=Ab(),n=null==n?Bw:n,this.originalName=zb(n),this.name=Lb(this.originalName),this.trainable_=s,this.constraint=r,this.val=Xp(e,this.trainable_,this.name,this.dtype)}read(){return this.assertNotDisposed(),this.val}write(e){return this.assertNotDisposed(),function(e,t){if(e.shape.toString()!==t.shape.toString())throw new Error("Shape mismatch: "+JSON.stringify(e.shape)+" vs. "+JSON.stringify(t.shape))}(this.val,e),this.val.id!==e.id&&(this.val.assign(e),null!=this.constraint&&this.val.assign(this.constraint.apply(this.val))),this}dispose(){this.assertNotDisposed(),this.val.dispose()}assertNotDisposed(){if(this.val.isDisposed)throw new Error(`LayersVariable ${this.name} is already disposed.`)}get trainable(){return this.trainable_}set trainable(e){this.trainable_=e,this.val.trainable=e}}function Lw(e){return e.map((e=>e.read()))}function Pw(e){e.forEach((e=>{e[0].write(e[1])}))}class Vw{constructor(e){this.dtype=e.dtype,this.shape=e.shape,null!=e.shape?this.ndim=e.shape.length:this.ndim=e.ndim,this.maxNDim=e.maxNDim,this.minNDim=e.minNDim,this.axes=e.axes||{}}}class Ww{constructor(e,t,n,s,r,a,i){this.dtype=e,this.shape=t,this.sourceLayer=n,this.inputs=s,this.callArgs=r,this.outputTensorIndex=i,this.id=Ab(),null!=a&&(this.originalName=zb(a),this.name=Lb(this.originalName)),this.rank=t.length}}let Uw=0;class Gw{constructor(e,t){this.callArgs=t,this.id=Uw++,this.outboundLayer=e.outboundLayer,this.inboundLayers=e.inboundLayers,this.nodeIndices=e.nodeIndices,this.tensorIndices=e.tensorIndices,this.inputTensors=e.inputTensors,this.outputTensors=e.outputTensors,this.inputMasks=e.inputMasks,this.outputMasks=e.outputMasks,this.inputShapes=e.inputShapes,this.outputShapes=e.outputShapes;for(const t of e.inboundLayers)null!=t&&t.outboundNodes.push(this);e.outboundLayer.inboundNodes.push(this)}getConfig(){const e=[];for(const t of this.inboundLayers)null!=t?e.push(t.name):e.push(null);return{outboundLayer:this.outboundLayer?this.outboundLayer.name:null,inboundLayers:e,nodeIndices:this.nodeIndices,tensorIndices:this.tensorIndices}}}let qw=0;class jw extends ql{constructor(e={}){super(),this._callHook=null,this._addedWeightNames=[],this._stateful=!1,this.id=qw++,this.activityRegularizer=null,this.inputSpec=null,this.supportsMasking=!1,this._trainableWeights=[],this._nonTrainableWeights=[],this._losses=[],this._updates=[],this._built=!1,this.inboundNodes=[],this.outboundNodes=[];let t=e.name;if(!t){const e=this.getClassName();t=ob(e)+"_"+Cb(e)}if(this.name=t,this.trainable_=null==e.trainable||e.trainable,null!=e.inputShape||null!=e.batchInputShape){let t;if(null!=e.batchInputShape)t=e.batchInputShape;else if(null!=e.inputShape){let n=null;null!=e.batchSize&&(n=e.batchSize),t=[n].concat(e.inputShape)}this.batchInputShape=t;let n=e.dtype;null==n&&(n=e.inputDType),null==n&&(n="float32"),this.dtype=n}null!=e.weights?this.initialWeights=e.weights:this.initialWeights=null,this._refCount=null,this.fastWeightInitDuringBuild=!1}static nodeKey(e,t){return e.name+"_ib-"+t.toString()}getNodeAtIndex(e,t){if(0===this.inboundNodes.length)throw new Yy(`The layer has never been called and thus has no defined ${t}.`);if(this.inboundNodes.length<=e)throw new Qy(`Asked to get ${t} at node ${e}, but the layer has only ${this.inboundNodes.length} inbound nodes.`);return this.inboundNodes[e]}getInputAt(e){return ab(this.getNodeAtIndex(e,"input").inputTensors)}getOutputAt(e){return ab(this.getNodeAtIndex(e,"output").outputTensors)}get input(){if(this.inboundNodes.length>1)throw new Zy(`Layer ${this.name} has multiple inbound nodes, hence the notion of "layer input" is ill-defined. Use \`getInputAt(nodeIndex)\` instead.`);if(0===this.inboundNodes.length)throw new Zy(`Layer ${this.name} is not connected, no input to return.`);return ab(this.getNodeAtIndex(0,"input").inputTensors)}get output(){if(0===this.inboundNodes.length)throw new Zy(`Layer ${this.name} has no inbound nodes.`);if(this.inboundNodes.length>1)throw new Zy(`Layer ${this.name} has multiple inbound nodes, hence the notion of "layer output" is ill-defined. Use \`getOutputAt(nodeIndex)\` instead.`);return ab(this.getNodeAtIndex(0,"output").outputTensors)}get losses(){return this._losses}calculateLosses(){return this.losses.map((e=>e()))}get updates(){return this._updates}get built(){return this._built}set built(e){this._built=e}get trainable(){return this.trainable_}set trainable(e){this._trainableWeights.forEach((t=>t.trainable=e)),this.trainable_=e}get trainableWeights(){return this.trainable_?this._trainableWeights.filter((e=>e.trainable)):[]}set trainableWeights(e){this._trainableWeights=e}get nonTrainableWeights(){return this.trainable?this._trainableWeights.filter((e=>!e.trainable)).concat(this._nonTrainableWeights):this._trainableWeights.concat(this._nonTrainableWeights)}set nonTrainableWeights(e){this._nonTrainableWeights=e}get weights(){return this.trainableWeights.concat(this.nonTrainableWeights)}get stateful(){return this._stateful}resetStates(){if(!this.stateful)throw new Error("Cannot call the resetStates() method of a non-stateful Layer object.")}assertInputCompatibility(e){const t=ib(e);if(null==this.inputSpec||0===this.inputSpec.length)return;const n=ib(this.inputSpec);if(t.length!==n.length)throw new Qy(`Layer ${this.name} expects ${n.length} inputs, but it received ${t.length} input tensors. Input received: ${e}`);for(let e=0;er.maxNDim)throw new Qy(`Input ${e} is incompatible with layer ${this.name}: expected max_ndim=${r.maxNDim}, found ndim=${a}`);if(null!=r.minNDim&&a=0?t[s]:t[t.length+s];if(null!=a&&-1===[a,null].indexOf(i))throw new Qy(`Input ${e} is incompatible with layer ${this.name}: expected axis ${s} of input shape to have value ${a} but got shape ${t}.`)}}if(null!=r.shape)for(let t=0;t{if(!this.built){this.assertInputCompatibility(e);const t=[];for(const n of ib(e))t.push(n.shape);this.build(ab(t)),this.built=!0,this.initialWeights&&this.setWeights(this.initialWeights),null===this._refCount&&r&&(this._refCount=1)}if(this.assertInputCompatibility(e),r){let s=this.call(e,t);this.supportsMasking&&this.setMaskMetadata(e,s);const r=ib(s),a=[];for(let e of r)-1!==n.indexOf(e)&&(e=e.clone()),a.push(e);if(s=ab(a),null!=this.activityRegularizer)throw new Jy("Layer invocation in the presence of activity regularizer(s) is not supported yet.");return s}{const n=function(e){e=ib(e);const t=[];for(const n of e)t.push(n.shape);return ab(t)}(e),s=this.computeOutputShape(n);let r;const a="float32";if(this.warnOnIncompatibleInputShape(Array.isArray(e)?n[0]:n),r=null!=s&&s.length>0&&Array.isArray(s[0])?s.map(((n,s)=>new Ww(a,n,this,ib(e),t,this.name,s))):new Ww(a,s,this,ib(e),t,this.name),this.addInboundNode(e,r,null,null,n,s,t),this._refCount++,null!=this.activityRegularizer)throw new Jy("Layer invocation in the presence of activity regularizer(s) is not supported yet.");return r}}))}warnOnIncompatibleInputShape(e){if(null!=this.batchInputShape)if(e.length!==this.batchInputShape.length);else{let t=!1;this.batchInputShape.forEach(((n,s)=>{null!=n&&null!=e[s]&&e[s]!==n&&(t=!0)}))}}get outputShape(){if(null==this.inboundNodes||0===this.inboundNodes.length)throw new Zy(`The layer ${this.name} has never been called and thus has no defined output shape.`);const e=[];for(const t of this.inboundNodes){const n=JSON.stringify(t.outputShapes);-1===e.indexOf(n)&&e.push(n)}if(1===e.length){const e=this.inboundNodes[0].outputShapes;return Array.isArray(e)&&Array.isArray(e[0])&&1===e.length?e[0]:e}throw new Zy(`The layer ${this.name} has multiple inbound nodes with different output shapes. Hence the notion of "output shape" is ill-defined for the layer.`)}countParams(){if(!this.built)throw new Yy(`You tried to call countParams() on ${this.name}, but the layer is not built yet. Build it first by calling build(batchInputShape).`);return Fw(this.weights)}build(e){this.built=!0}getWeights(e=!1){return Lw(e?this.trainableWeights:this.weights)}setWeights(e){Ao((()=>{const t=this.weights;if(t.length!==e.length)throw new Qy(`You called setWeights(weights) on layer "${this.name}" with a weight list of length ${e.length}, but the layer was expecting ${t.length} weights. Provided weights: ${e}...`);if(0===t.length)return;const n=[],s=Lw(t);for(let r=0;rr.apply(u.read()))),null==a&&(a=!0),a?this._trainableWeights.push(u):this._nonTrainableWeights.push(u),u}setFastWeightInitDuringBuild(e){this.fastWeightInitDuringBuild=e}addLoss(e){null==e||Array.isArray(e)&&0===e.length||(e=ib(e),void 0!==this._losses&&null!==this._losses&&this.losses.push(...e))}computeOutputShape(e){return e}computeMask(e,t){if(!this.supportsMasking){if(null!=t){if(!Array.isArray(t))throw new TypeError(`Layer ${this.name} does not support masking, but was passed an inputMask.`);t.forEach((e=>{if(null!=e)throw new TypeError(`Layer ${this.name} does not support masking, but was passed an inputMask.`)}))}return null}return t}setMaskMetadata(e,t,n){if(!this.supportsMasking)return;const s=this.computeMask(e,n),r=ib(t),a=ib(s);if(r.length!==a.length)throw new Error(`${this.name} outputs ${r.length} tensors but ${r.length} masks for those tensors`);for(let e=0;ee.dispose())),this.weights.length}assertNotDisposed(){if(0===this._refCount)throw new Error(`Layer '${this.name}' is already disposed.`)}dispose(){if(!this.built)throw new Error(`Cannot dispose Layer ${this.name} because it has not been built yet.`);if(null===this._refCount)throw new Error(`Cannot dispose Layer ${this.name} because it has not been used yet.`);this.assertNotDisposed();let e=0;return 0==--this._refCount&&(e=this.disposeWeights()),{refCountAfterDispose:this._refCount,numDisposedVariables:e}}}function Hw(e,t,n){if((null==t||null!=n&&n>0)&&(t=e.sourceLayer,n=e.nodeIndex),0===t.inboundNodes.length)return[e];{const e=t.inboundNodes[n];if(0===e.inboundLayers.length)return e.inputTensors;{const t=[];for(let n=0;ne.name)),l=[],u=t.names();for(const e of o)-1!==u.indexOf(e)?l.push(t.getValue(e)):l.push(null);null!=s&&(s.maxNumTensors=-1/0,s.minNumTensors=1/0);const c=o.join(",")+"|"+t.names().sort().join(",");let h,d=Xw.get(c);if(null==d){const e=function(e,t){qt(null!=e&&e.length>0,(()=>"Expected at least one fetch, got none"));let n=[],s={};if(1===e.length){const r=Jw(e[0],t);n=r.sorted,s=r.recipientMap}else{const r=new Set;for(const a of e){const{sorted:e,recipientMap:i}=Jw(a,t);for(const t of e)r.has(t.name)||(n.push(t),r.add(t.name));for(const e in i)null==s[e]&&(s[e]=new Set),i[e].forEach((t=>s[e].add(t)))}}return{sorted:n,recipientCounts:Qw(s)}}(i,t);d=e.sorted,h=e.recipientCounts,Xw.put(c,d),Zw.put(c,h)}h={},r||Object.assign(h,Zw.get(c));const p=new Kw(t);for(let e=0;es.maxNumTensors&&(s.maxNumTensors=e),e0;){const e=a[a.length-1];if(n.has(e.name)){a.pop();continue}const t=i[i.length-1]===a.length-1;if(0===e.inputs.length||t)a.pop(),s.push(e),n.add(e.name),t&&i.pop();else{i.push(a.length-1);for(const t of e.inputs)null==r[t.name]&&(r[t.name]=new Set),r[t.name].add(e.name),n.has(t.name)||a.push(t)}}return{sorted:s,recipientMap:r}}function ev(e){let t;if(1===e.sourceLayer.inboundNodes.length)t=e.sourceLayer.output;else{let n=null;for(let t=0;tzl(Dh(Bl(e,e),t,!0))))}Sn().registerFlag("TOPOLOGICAL_SORT_CACHE_MAX_ENTRIES",(()=>100),(function(e){null!=Xw&&Xw.setMaxEntries(e),null!=Zw&&Zw.setMaxEntries(e)}));class nv extends ql{getConfig(){return{}}}class sv extends nv{constructor(e){super(),this.defaultMaxValue=2,this.defaultAxis=0,this.maxValue=null!=e.maxValue?e.maxValue:this.defaultMaxValue,this.axis=null!=e.axis?e.axis:this.defaultAxis}apply(e){return Ao((()=>{const t=tv(e,this.axis),n=Kc(t,0,this.maxValue);return Bl(e,Fl(n,Dl(Hb(),t)))}))}getConfig(){return{maxValue:this.maxValue,axis:this.axis}}}sv.className="MaxNorm",Hl(sv);class rv extends nv{constructor(e){super(),this.defaultAxis=0,this.axis=null!=e.axis?e.axis:this.defaultAxis}apply(e){return Ao((()=>Fl(e,Dl(Hb(),tv(e,this.axis)))))}getConfig(){return{axis:this.axis}}}rv.className="UnitNorm",Hl(rv);class av extends nv{apply(e){return sp(e)}}av.className="NonNeg",Hl(av);class iv extends nv{constructor(e){super(),this.defaultMinValue=0,this.defaultMaxValue=1,this.defaultRate=1,this.defaultAxis=0,this.minValue=null!=e.minValue?e.minValue:this.defaultMinValue,this.maxValue=null!=e.maxValue?e.maxValue:this.defaultMaxValue,this.rate=null!=e.rate?e.rate:this.defaultRate,this.axis=null!=e.axis?e.axis:this.defaultAxis}apply(e){return Ao((()=>{const t=tv(e,this.axis),n=Dl(Bl(this.rate,Kc(t,this.minValue,this.maxValue)),Bl(1-this.rate,t));return Bl(e,Fl(n,Dl(Hb(),t)))}))}getConfig(){return{minValue:this.minValue,maxValue:this.maxValue,rate:this.rate,axis:this.axis}}}iv.className="MinMaxNorm",Hl(iv);const ov={maxNorm:"MaxNorm",minMaxNorm:"MinMaxNorm",nonNeg:"NonNeg",unitNorm:"UnitNorm"};function lv(e){return cb(e)}function uv(e,t={}){return db(e,jl.getMap().classNameMap,t,"constraint")}function cv(e){if(null==e)return null;if("string"==typeof e){return uv({className:e in ov?ov[e]:e,config:{}})}return e instanceof nv?e:uv(e)}async function hv(e){if(null==e)return;const t=[],n=[],s=[];for(const r in e){const a=e[r];if("number"!=typeof a){const e=a;t.push(e.data()),n.push(r),s.push(e)}}if(t.length>0){const r=await Promise.all(t);for(let t=0;tDl(this.totals[e],Bl(s,n))));this.totals[e]=r,null!=t&&t.dispose()}}}async onEpochEnd(e,t){if(null!=t)for(const e of this.params.metrics)null!=this.totals[e]&&("number"==typeof this.totals[e]?t[e]=this.totals[e]/this.seen:Ao((()=>{const n=Bl(Fl(1,this.seen),this.totals[e]);t[e]=n,this.totals[e].dispose(),Co(t[e])})))}}class yv extends fv{async onTrainBegin(e){this.epoch=[],this.history={}}async onEpochEnd(e,t){null==t&&(t={}),this.epoch.push(e);for(const e in t)null==this.history[e]&&(this.history[e]=[]),this.history[e].push(t[e])}async syncData(){const e=[],t=[],n=[];for(const s in this.history){const r=this.history[s];for(let a=0;a{const i=null!=n?n():fi();return i-rnew bv(e,t)))}class vv{constructor(){}static registerCallbackConstructor(e,t){qt(e>=0&&Number.isInteger(e),(()=>`Verbosity level is expected to be an integer >= 0, but got ${e}`)),vv.checkForDuplicate(t),null==vv.constructors[e]&&(vv.constructors[e]=[]),vv.constructors[e].push(t)}static checkForDuplicate(e){for(const t in vv.constructors){vv.constructors[+t].forEach((t=>{if(t===e)throw new Qy("Duplicate callback constructor.")}))}}static clear(){vv.constructors={}}static createCallbacks(e){const t=[];for(const n in vv.constructors){const s=+n;e>=s&&t.push(...vv.constructors[s])}return t.map((e=>new e))}}function xv(e,t,n,s,r,a,i,o,l){const u=new yv,c=[new gv,...vv.createCallbacks(t)];null!=e&&c.push(...e),c.push(u);const h=new mv(c);return h.setParams({epochs:n,initialEpoch:s,samples:r,steps:a,batchSize:i,verbose:t,doValidation:o,metrics:l}),{callbackList:h,history:u}}function Av(e,t={},n=!1){return db(e,jl.getMap().classNameMap,t,"layer",n)}function kv(e,t){return Ao((()=>{"float32"!==e.dtype&&(e=Nl(e,"float32"));const n=Dh(rw(e),t,!0),s=Xl(n.shape,Hb()),r=zl(ru(n,s));return Fl(e,r)}))}function Cv(e,t){return Ao((()=>bd(rw(Ql(t,e)),-1)))}function Sv(e,t){return Ao((()=>bd(eu(Ql(t,e)),-1)))}function Ev(e,t){return Ao((()=>{const n=Ql(e,t),s=Kc(eu(e),Hb(),Number.MAX_VALUE),r=eu(Fl(n,s));return Bl(100,bd(r,-1))}))}function _v(e,t){return Ao((()=>{const n=Kc(t,Hb(),Number.MAX_VALUE),s=td(Dl(1,n)),r=Kc(e,Hb(),Number.MAX_VALUE),a=td(Dl(1,r));return bd(rw(Ql(s,a)),-1)}))}function Iv(e,t,n=!1){return Ao((()=>{if(n)t=Ap(t);else{const e=Dh(t,t.shape.length-1,!0);t=Fl(t,e)}return t=Kc(t,Hb(),1-Hb()),sd(Dh(Bl(Nl(e,"float32"),td(t)),t.shape.length-1))}))}function Tv(e,t,n=!1){return Ao((()=>{const s=Nl(Uh(function(e){const t=[Wb(e.shape)];return Tc(e,t)}(e)),"int32"),r=(t=Kc(t,Hb(),1-Hb())).shape;return Iv(Tc(Td(s,r[r.length-1]),r),t,n)}))}function Nv(e,t){return Ao((()=>{let n;return n=Kc(t,Hb(),1-Hb()),n=td(Fl(n,Ql(1,n))),bd(function(e,t){if(!Kt(e.shape,t.shape))throw new Qy(`logits and labels must have the same shape, but got shapes ${JSON.stringify(e.shape)} and ${JSON.stringify(t.shape)}`);return Ao((()=>{const n=sp(t),s=sd(eu(t));return Dl(Ql(n,Bl(t,e)),nd(zh(s)))}))}(e,n),-1)}))}function Ov(e,t){return Ao((()=>{const n=Kc(e,Hb(),1),s=Kc(t,Hb(),1);return Dh(Bl(e,td(Fl(n,s))),-1)}))}function Rv(e,t){return Ao((()=>{const n=kv(e,-1),s=kv(t,-1),r=Bl(n,s);return sd(Dh(r,-1))}))}vv.constructors={};const Dv={meanSquaredError:Cv,meanAbsoluteError:Sv,meanAbsolutePercentageError:Ev,meanSquaredLogarithmicError:_v,squaredHinge:function(e,t){return Ao((()=>{const n=ru(0,Ql(1,Bl(e,t)));return bd(rw(n),-1)}))},hinge:function(e,t){return Ao((()=>{const n=ru(0,Ql(1,Bl(e,t)));return bd(n,-1)}))},categoricalHinge:function(e,t){return Ao((()=>{const n=Dh(Bl(e,t),-1),s=Oh(Bl(Ql(1,e),t),-1);return ru(0,Dl(1,Ql(s,n)))}))},logcosh:function(e,t){return Ao((()=>{const n=Math.log(2),s=Ql(t,e),r=Ql(Dl(s,rd(Bl(-2,s))),n);return bd(r,-1)}))},categoricalCrossentropy:Iv,sparseCategoricalCrossentropy:Tv,binaryCrossentropy:Nv,kullbackLeiblerDivergence:Ov,poisson:function(e,t){return Ao((()=>{const n=td(Dl(Hb(),t));return bd(Ql(t,Bl(e,n)),-1)}))},cosineProximity:Rv};function Mv(e){if("string"==typeof e){if(e in Dv)return Dv[e];let t=`Unknown loss ${e}`;throw e.toLowerCase().includes("softmaxcrossentropy")&&(t=`Unknown loss ${e}. Use "categoricalCrossentropy" as the string name for tf.losses.softmaxCrossEntropy`),new Qy(t)}return e}function Fv(e,t){return Ao((()=>{const n=Bl(.5,Nd(t)),s=$b(qh(t,n),e.dtype);return bd(mh(e,s),-1)}))}function Bv(e,t){return Ao((()=>$b(mh(oc(e,-1),oc(t,-1)),"float32")))}function zv(e,t){return Ao((()=>Nl(Dh(ld(mh(e,1),mh(t,1))),"float32")))}function Lv(e,t){return Nv(e,t)}function Pv(e,t){return e.rank===t.rank&&(e=Tp(e,[e.rank-1])),(t=oc(t,-1)).dtype!==e.dtype&&(t=Nl(t,e.dtype)),Nl(mh(e,t),"float32")}const Vv=Iv,Wv=Tv,Uv={binaryAccuracy:Fv,categoricalAccuracy:Bv,precision:function(e,t){return Ao((()=>{const n=zv(e,t),s=function(e,t){return Ao((()=>Nl(Dh(ld(mh(e,0),mh(t,1))),"float32")))}(e,t),r=Dl(n,s);return Nl(gh(qh(r,0),Fl(n,r),0),"float32")}))},categoricalCrossentropy:Vv,sparseCategoricalCrossentropy:Wv,mse:Cv,MSE:Cv,mae:Sv,MAE:Sv,mape:Ev,MAPE:Ev,cosine:Rv};function Gv(e){if("string"==typeof e&&e in Uv)return Uv[e];if("string"!=typeof e&&null!=e)return e;throw new Qy(`Unknown metric ${e}`)}function qv(e){if(sb(null!==e,`Unknown LossOrMetricFn ${e}`),"string"==typeof e)return e;{let t;for(const n of Object.keys(Dv))if(Dv[n]===e){t=n;break}if(void 0!==t)return t;for(const n of Object.keys(Uv))if(Uv[n]===e){t=n;break}return void 0!==t?t:e.name}}function jv(e,t,n=!1){if(null==e||"object"!=typeof e||Object.getPrototypeOf(e)!==Object.prototype||!Hv(e))throw new Error("User-defined metadata is expected to be a JSON object, but is not.");if(n){JSON.stringify(e).length}}function Hv(e){if(null===e)return!0;if("object"==typeof e){if(Object.getPrototypeOf(e)===Object.prototype){const t=Object.keys(e);for(const n of t){if("string"!=typeof n)return!1;if(!Hv(e[n]))return!1}return!0}if(Array.isArray(e)){for(const t of e)if(!Hv(t))return!1;return!0}return!1}{const t=typeof e;return"string"===t||"number"===t||"boolean"===t}}function $v(e,t,n,s=console.log){const r=function(e){let t=!0;const n=[],s=[];for(const t in e.nodesByDepth)n.push(e.nodesByDepth[t]);for(const e of n){if(e.length>1||1===e.length&&e[0].inboundLayers.length>1){t=!1;break}s.push(...e)}if(t)for(const n of e.layers){let e=!1;for(const r of n.inboundNodes)if(-1!==s.indexOf(r)){if(e){t=!1;break}e=!0}if(!t)break}return t}(e),a=["Layer (type)","Input Shape","Output shape","Param #"];let i;if(r?(t=t||90,n=n||[.32,.61,.89,1]):(t=t||115,n=n||[.24,.48,.7,.8,1]),n[n.length-1]<=1&&(n=n.map((e=>Math.floor(t*e)))),!r){a.push("Receives inputs"),i=[];for(const t in e.nodesByDepth)i.push(...e.nodesByDepth[t])}s("_".repeat(t)),Kv(a,n,s),s("=".repeat(t));const o=e.layers;for(let e=0;e0&&(s=s.slice(0,s.length-1)+" "),s+=e[n],s=s.slice(0,t[n]),s+=" ".repeat(t[n]-s.length);n(s)}function Xv(e,t,n){let s,r;try{r=e.inboundNodes.map((e=>JSON.stringify(e.inputShapes))).join(",")}catch(e){r="multiple"}try{s=JSON.stringify(e.outputShape)}catch(e){s="multiple"}Kv([`${e.name} (${e.getClassName()})`,r,s,e.countParams().toString()],t,n)}function Zv(e,t,n,s){let r,a;try{a=e.inboundNodes.map((e=>JSON.stringify(e.inputShapes))).join(",")}catch(e){a="multiple"}try{r=JSON.stringify(e.outputShape)}catch(e){r="multiple"}const i=[];for(const t of e.inboundNodes)if(!(null!=n&&n.length>0&&-1===n.indexOf(t)))for(let e=0;ee.name))}`);fb(this.outputs).length,this.outputs.length,this.inputLayers=[],this.inputLayersNodeIndices=[],this.inputLayersTensorIndices=[],this.outputLayers=[],this.outputLayersNodeIndices=[],this.outputLayersTensorIndices=[],this.layers=[],this.internalContainerRefs=[];for(const e of this.outputs){const t=e.sourceLayer,n=e.nodeIndex,s=e.tensorIndex;this.outputLayers.push(t),this.outputLayersNodeIndices.push(n),this.outputLayersTensorIndices.push(s)}for(const e of this.inputs){const t=e.sourceLayer,n=e.nodeIndex,s=e.tensorIndex;sb(0===n,"input layer has >1 nodes"),sb(0===s,"input layer has >1 tensors"),this.inputLayers.push(t),this.inputLayersNodeIndices.push(n),this.inputLayersTensorIndices.push(s)}this.inputNames=[],this.outputNames=[],this.feedInputShapes=[],this.feedInputNames=[],this.feedOutputNames=[];for(let t=0;te.shape)),this.internalOutputShapes=this.outputs.map((e=>e.shape));const t={},n={},s={},r={},a={},i=[],o=(e,t,n,s,r,l)=>{null!=s&&null!=r&&null!=l||(s=e.sourceLayer,r=e.nodeIndex,l=e.tensorIndex);const u=s.inboundNodes[r];if(-1!==n.indexOf(u))throw new Yy(`The tensor ${e.name} at layer "${s.name}" is part of a cycle.`);if(-1!==t.indexOf(u))return;this.containerNodes.add(tx.nodeKey(s,r)),s.id in a||(a[s.id]=Object.keys(a).length),-1===n.indexOf(u)&&n.push(u);const c=u.inboundLayers.length;for(let e=0;e=0;)n.splice(n.indexOf(u),1);i.push(u)},l=[],u=[];for(const e of this.outputs)o(e,l,u);const c=i.slice().reverse();for(const e of c){n[e.id]=e,e.id in t||(t[e.id]=0);let a=t[e.id];const i=null==s[e.outboundLayer.id]?0:s[e.outboundLayer.id];a=Math.max(a,i),s[e.outboundLayer.id]=a,r[e.outboundLayer.id]=e.outboundLayer,t[e.id]=a;for(let s=0;sparseInt(e,10))).sort(pb);this.layers=[];for(const e of p){const t=d[e];t.sort(((e,t)=>{const n=a[e.id],s=a[t.id];return ns?1:0}));for(const e of t)e instanceof tx&&this.internalContainerRefs.push(e),this.layers.push(e)}this.layersByDepth=d,p=Object.keys(h).map((e=>parseInt(e,10))).sort(pb);const f=this.inputs.slice(),m=[];for(const e of p)for(const t of h[e]){const e=t.outboundLayer;if(null!=e){for(const n of t.inputTensors)if(-1===f.indexOf(n))throw new Yy(`Graph disconnected: cannot obtain value for tensor ${n} at layer "${e.name}". The following previous layers were accessed without issue: ${m}`);for(const e of t.outputTensors)f.push(e);m.push(e.name)}}this.nodesByDepth=h;const g=this.layers.map((e=>e.name));for(const e of g){const t=g.filter((t=>t===e)).length;if(1!==t)throw new Yy(`The name "${e}" is used ${t} times in the model. All layer names should be unique. Layer names: `+JSON.stringify(g))}this.outboundNodes=[],this.inboundNodes=[],new Gw({outboundLayer:this,inboundLayers:[],nodeIndices:[],tensorIndices:[],inputTensors:this.inputs,outputTensors:this.outputs,inputMasks:this.inputs.map((e=>null)),outputMasks:this.outputs.map((e=>null)),inputShapes:this.inputs.map((e=>e.shape)),outputShapes:this.outputs.map((e=>e.shape))}),this.built=!0,this._refCount=1}assertNotDisposed(){if(0===this._refCount)throw new Error(`Container '${this.name}' is already disposed.`)}dispose(){this.assertNotDisposed();const e={refCountAfterDispose:null,numDisposedVariables:0};if(0==--this._refCount){for(const t of this.layers)e.numDisposedVariables+=t.dispose().numDisposedVariables;for(const t of this.internalContainerRefs)e.numDisposedVariables+=t.dispose().numDisposedVariables}return e.refCountAfterDispose=this._refCount,e}get trainable(){return this.trainable_}set trainable(e){this.layers.forEach((t=>{t._trainableWeights.forEach((t=>t.trainable=e))})),this.trainable_=e}get trainableWeights(){if(this._trainableWeights.length>0)throw new Qy("Container instance unexpectedly contains _trainableWeights.The trainable weights of a Container are a union of the trainable weights of its consituent Layers. Its own _trainableWeights must remain an empty Array.");if(!this.trainable)return[];let e=[];for(const t of this.layers)e=e.concat(t.trainableWeights);return e}get nonTrainableWeights(){const e=[];for(const t of this.layers)e.push(...t.nonTrainableWeights);if(!this.trainable){const t=[];for(const e of this.layers)t.push(...e.trainableWeights);return t.concat(e)}return e}get weights(){return this.trainableWeights.concat(this.nonTrainableWeights)}loadWeights(e,t=!0){const n={};let s=0;const r=(e=>{const t=Object.keys(e);if(0===t.length)return!1;const n=t[0].split("/");return!isNaN(parseInt(n[n.length-1],10))})(e);r&&this.parseWeights(e);for(const e of this.layers)for(const[t,a]of e.weights.entries()){const e=r?`${a.name.split("/").slice(0,-1).join("/")+"/"}${t}`:a.originalName;if(null!=n[e])throw new Qy(`Duplicate weight name: ${e}`);n[e]=a,s++}const a=[];for(const s in e){let r=s;if(null==n[s]){const e=s.split("/");r=e.slice(0,-2).concat([e[e.length-1]]).join("/")}if(null!=n[r])a.push([n[r],e[s]]);else if(t)throw new Qy(`Provided weight data has no target variable: ${s}`);delete n[r]}if(t){const e=[];for(const t in n)e.push(t);if(e.length>0)throw new Qy(`${e.length} of ${s} weights are not set: ${e}`)}Pw(a)}parseWeights(e){for(const t in Object.keys(e)){const n=t.split("/"),s=["vars","layer_checkpoint_dependencies"],r=n.map((e=>e.startsWith("_")?e.slice(1):e)).filter((e=>!s.includes(e))).join("/");r!==t&&(e[r]=e[t],delete e[t])}}updatedConfig(){const e=this.getConfig(),t={};return t.className=this.getClassName(),t.config=e,t.kerasVersion=`tfjs-layers ${ex}`,t.backend="TensorFlow.js",t}toJSON(e,t=!0){const n=Jv(this.updatedConfig());return t?JSON.stringify(n):n}call(e,t){return Ao((()=>{e=ib(e);const n=new Kw;for(let t=0;t{let n;return e=ib(e),n=null==t?nb(null,e.length):ib(t),this.runInternalGraph(e,n)[1]}))}computeOutputShape(e){const t=Rw(e);if(t.length!==this.inputLayers.length)throw new Qy(`Invalid inputShape argument ${e}: model has ${this.inputLayers.length} tensor inputs.`);const n={};for(let e=0;eparseInt(e,10))).sort(pb);if(s.length>1)for(const e of s){const t=this.nodesByDepth[e];for(const e of t){const t=e.outboundLayer;if(-1!==this.inputLayers.map((e=>e.id)).indexOf(t.id))continue;const s=[];for(let t=0;tparseInt(e,10))).sort(pb);for(const e of s){const t=this.nodesByDepth[e];for(const e of t){const t=e.outboundLayer,s=e.inputTensors,r=e.outputTensors,a=new Array;for(const e of s)e.id in n&&a.push(n[e.id]);if(a.length===s.length){let s,i,o,l,u={};if(null!=e.callArgs&&(u=e.callArgs),1===a.length){const[e,n]=a[0];null==u.mask&&(u.mask=n),o=ib(t.call(e,u)),l=ib(t.computeMask(e,n)),s=[e],i=[n]}else s=a.map((e=>e[0])),i=a.map((e=>e[1])),null==u.mask&&(u.mask=i),o=ib(t.call(s,u)),l=ib(t.computeMask(s,i));if(t.activityRegularizer)throw new Jy("LayersModel invocation with concrete Tensor value(s) in the presence of activity regularizer(s) is not supported yet.");for(let e=0;e{const e=[];for(const t of this.layers)for(let n=0;n0){const e=[];for(let n=0;n0&&e.apply(ab(n),s)}function l(e){const n=e.name,a=Av(e,null!=t.customObjects?t.customObjects:{});a.setFastWeightInitDuringBuild(s),r[n]=a;e.inboundNodes.forEach((e=>{if(!(e instanceof Array))throw new Qy(`Corrupted configuration, expected array for nodeData: ${e}`);i(a,e)}))}const u=t.name,c=t.layers;for(const e of c)l(e);for(;!mb(a);)for(const e of c){const t=r[e.name];if(t.name in a){const e=a[t.name];delete a[t.name];for(const n of e)o(t,n)}}const h=[],d=[],p=t.inputLayers;for(const e of p){const t=e[0],n=e[1],s=e[2];sb(t in r);const a=r[t].inboundNodes[n].outputTensors;h.push(a[s])}const f=t.outputLayers;for(const e of f){const t=e[0],n=e[1],s=e[2];sb(t in r);const a=r[t].inboundNodes[n].outputTensors;d.push(a[s])}return new e({inputs:h,outputs:d,name:u})}get stateful(){if(this._stateful)throw new Qy("Container instance unexpectedly has _stateful = true. The statefulness of a Container is determined by the Layers it contains. Its _stateful property must remain the default false.");for(const e of this.layers)if(e.stateful)return!0;return!1}resetStates(){Ao((()=>{this.layers.forEach((e=>{e.stateful&&e.resetStates()}))}))}}function nx(e,t,n){const s=t.length;if(null==e||Array.isArray(e)&&0===e.length)return t.map((e=>null));if(1===s)return Array.isArray(e)&&1===e.length?e:"object"==typeof e&&t[0]in e?[e[t[0]]]:[e];if(Array.isArray(e)){if(e.length!==s)throw new Error(`Provided ${n} is an array of ${e.length} element(s), but the model has ${s} outputs. Make sure a set of weights is provided for each model output.`);return e}if("object"==typeof e&&Object.keys(e).length>0&&"object"==typeof e[Object.keys(e)[0]]){const n=[];return t.forEach((t=>{t in e?n.push(e[t]):n.push(null)})),n}throw new Error(`The model has multiple (${s}) outputs, so ${n} must be either an array with ${s} elements or an object with ${t} keys. Provided ${n} not understood: ${JSON.stringify(e)}`)}function sx(e,t){return nx(e,t,"classWeight")}async function rx(e,t,n,s){if(null!=t||null!=s)throw new Error("Support sampleWeight is not implemented yet");if(null!=n){const t=Ao((()=>{if(1===e.shape.length)return Ol(e);if(2===e.shape.length){if(e.shape[1]>1){return oc(e,1)}if(1===e.shape[1])return Tc(e,[e.shape[0]]);throw new Error(`Encountered unexpected last-dimension size (${e.shape[1]}) during handling of class weights. The size is expected to be >= 1.`)}throw new Error(`Unexpected rank of target (y) tensor (${e.rank}) during handling of class weights. The rank is expected to be 1 or 2.`)})),s=Array.from(await t.data());ko(t);const r=[];return s.forEach((e=>{if(null==n[e])throw new Error(`classWeight must contain all classes in the training data. The class ${e} exists in the data but not in classWeight`);r.push(n[e])})),Mp(r,"float32")}return null}function ax(e,t){return Bl(e,t)}function ix(e,t){let n,s;const r=t;n=r.xs,s=r.ys,qt(null!=n&&null!=s,(()=>`A Dataset iterator for fitDataset() is expected to generate objects of the form \`{xs: xVal, ys: yVal}\`, where the two values may be \`tf.Tensor\`, an array of Tensors, or a map of string to Tensor. The provided Dataset instead generates ${t}`));const a=ox("input",e.inputNames,n),i=ox("output",e.outputNames,s),o=a[0].shape[0];qt(a.length===e.inputs.length,(()=>`LayersModel has ${e.inputs.length} inputs, but the dataset provides ${a.length} inputs. (Expected input keys: ${JSON.stringify(e.inputNames)})`)),qt(i.length===e.outputs.length,(()=>`LayersModel has ${e.outputs.length} outputs, but the dataset provides ${i.length} outputs. (Expected output keys: ${JSON.stringify(e.outputNames)})`));for(let t=0;t`Batch size mismatch: input ${e.inputNames[t]} has ${a[t].shape[0]}; expected ${o} based on input ${e.inputNames[0]}.`));for(let t=0;t`Batch size mismatch: output ${e.outputNames[t]} has ${i[t].shape[0]}; expected ${o} based on input ${e.inputNames[0]}.`));return{xs:a,ys:i}}function ox(e,t,n){if(n instanceof Mi)return[n];if(Array.isArray(n))return qt(n.length===t.length,(()=>`Received an array of ${n.length} Tensors, but expected ${t.length} to match the ${e} keys ${t}.`)),n;{const s=[];for(const r of t){if(null==n[r])throw new Qy(`The feature data generated by the dataset lacks the required ${e} key '${r}'.`);s.push(n[r])}return s}}async function lx(e,t,n){const s=null!=n.batchesPerEpoch;if(qt(null!=e.optimizer,(()=>"You must compile a model before training/testing. Use LayersModel.compile(modelCompileConfig).")),qt(null!=n,(()=>"For fitDataset(), the 2nd argument (config) is required, but it is not provided in this call.")),qt(null!=n.epochs&&n.epochs>0&&Number.isInteger(n.epochs),(()=>`For fitDataset(), config.epochs is expected to be a positive integer, but got ${n.epochs}`)),qt(!s||n.batchesPerEpoch>0&&Number.isInteger(n.batchesPerEpoch),(()=>`For fitDataset(), config.batchesPerEpoch is expected to be a positive integer if specified, but got ${n.batchesPerEpoch}`)),qt(null==n.validationSplit,(()=>"`validationSplit` is not supported by `fitDataset()`. Use validationData instead.")),e.isTraining)throw new Error("Cannot start training because another fit() call is ongoing.");e.isTraining=!0;try{const r=null!=n.validationData;let a,i;if(r)if(ux(n.validationData))qt(null==n.validationBatches||n.validationBatches>0&&Number.isInteger(n.validationBatches),(()=>`For fitDataset() with dataset-based validation, config.validationBatches is expected not to be provided, or to be a positive integer, but got ${n.validationBatches}`));else{const e=function(e){if(3===e.length)throw new Jy("Validation with sample weights is not implemented yet.");return{xs:e[0],ys:e[1]}}(n.validationData);a=e.xs,i=e.ys}const o=e.makeTrainFunction(),l=e.getDedupedMetricsNames();let u;u=r?l.slice().concat(l.map((e=>"val_"+e))):l.slice();const c=wv(n.callbacks,n.yieldEvery),h=null==n.verbose?1:n.verbose,{callbackList:d,history:p}=xv(c,h,n.epochs,null,null,function(e,t){let n=null;null!=t.batchesPerEpoch?n=t.batchesPerEpoch:Number.isFinite(e.size)&&(n=e.size);return n}(t,n),null,r,u);d.setModel(e),e.history=p,await d.onTrainBegin(),e.stopTraining_=!1;let f=null==n.initialEpoch?0:n.initialEpoch,m=await t.iterator();for(;f=n.batchesPerEpoch:t.done){if(r){let t;t=ux(n.validationData)?ib(await e.evaluateDataset(n.validationData,{batches:n.validationBatches})):ib(e.evaluate(a,i,{batchSize:null==n.validationBatchSize?32:n.validationBatchSize,verbose:0}));for(let n=0;n0&&Number.isInteger(e),(()=>`batchSize is required to be a positive integer, but got ${e}`))}function hx(e,t,n){return null==e?[null]:Array.isArray(e)?e.map((e=>Xb(e,t,n-t))):Xb(e,t,n-t)}function dx(e,t){return Ao((()=>null==e?null:Array.isArray(e)?e.map((e=>dx(e,t))):sw(e,"int32"===t.dtype?t:Nl(t,"int32"))))}function px(e,t){const n=[];let s=0,r=null;for(;s=e&&(r=e),n.push([s,r]),s=r;return n}function fx(e){const t=[];e instanceof Mi&&(e=[e]);for(let n=0;nn.push(e.id)));else if(null!=t)for(const e in t){const s=t[e];n.push(s.id)}const s=[];if(e instanceof Mi)-1===n.indexOf(e.id)&&s.push(e);else if(Array.isArray(e))e.forEach((e=>{-1===n.indexOf(e.id)&&s.push(e)}));else if(null!=e)for(const t in e){const r=e[t];-1===n.indexOf(r.id)&&s.push(r)}s.forEach((e=>{e.isDisposed||e.dispose()}))}function gx(e){return Array.isArray(e)}function yx(e){return!function(e){return e instanceof Mi}(e)&&!gx(e)}function bx(e,t,n,s=!0,r=""){if(null==t||0===t.length){if(null!=e){let t=!1;if(gx(e)&&e.length>0)t=!0;else if(yx(e)){for(const n in e)if(e.hasOwnProperty(n)){t=!0;break}}else t=!0;if(t)throw new Qy(`Error when checking model ${r} expected no data, but got ${e}`)}return[]}if(null==e)return t.map((e=>null));let a;if(yx(e)){a=[];for(const n of t){if(null==e[n])throw new Qy(`No data provided for "${n}". Need data for each key in: ${t}`);a.push(e[n])}}else if(gx(e)){if(e.length!==t.length)throw new Qy(`Error when checking model ${r}: the Array of Tensors that you are passing to your model is not the size the model expected. Expected to see ${t.length} Tensor(s), but instead got the following list of Tensor(s): ${e}`);a=e}else{if(t.length>1)throw new Qy(`The model ${r} expects ${t.length} Tensor(s), but only received one Tensor. Found: Tensor with shape ${e.shape}`);a=[e]}if(a=fx(a),null!=n)for(let e=0;e=0&&a!==o)throw new Qy(`${r} expected a batch of elements where each example has shape [${n[e].slice(1,n[e].length)}] (i.e.,tensor shape [*,${n[e].slice(1,n[e].length)}]) but the ${r} received an input with ${i.shape[0]} examples, each with shape [${i.shape.slice(1,i.shape.length)}] (tensor shape [${i.shape}])`)}}return a}function wx(e,t,n,s=!0,r=""){let a;if(Array.isArray(e)){if(e.length!==t.length)throw new Qy(`Error when checking model ${r}: the Array of Tensors that you are passing to your model is not the size the the model expected. Expected to see ${t.length} Tensor(s), but instead got ${e.length} Tensors(s).`);a=e}else{if(t.length>1)throw new Qy(`The model expects ${t.length} ${r} Tensors, but only received one Tensor. Found: array with shape ${JSON.stringify(e.shape)}.`);a=[e]}if(null!=n)for(let e=0;ekm.adagrad(.01),Adadelta:()=>km.adadelta(1,.95,Hb()),Adam:()=>km.adam(.001,.9,.999,Hb()),Adamax:()=>km.adamax(.002,.9,.999,Hb(),0),RMSProp:()=>km.rmsprop(.001,.9,0,Hb()),SGD:()=>km.sgd(.01)};if(t.adagrad=t.Adagrad,t.adadelta=t.Adadelta,t.adam=t.Adam,t.adamax=t.Adamax,t.rmsprop=t.RMSProp,t.sgd=t.SGD,e in t)return t[e]();throw new Qy(`Unknown Optimizer ${e}`)}(e.optimizer),this.isOptimizerOwned=!0;else{if(!(e.optimizer instanceof $l))throw new Qy("User-defined optimizer must be an instance of tf.Optimizer.");this.optimizer_=e.optimizer,this.isOptimizerOwned=!1}let t=[];if(Array.isArray(e.loss)||"string"==typeof e.loss||"function"==typeof e.loss)if(Array.isArray(e.loss)){if(e.loss.length!==this.outputs.length)throw new Qy(`When passing an Array as loss, it should have one entry per model output. The model has ${this.outputs.length} output(s), but you passed loss=${e.loss}.`);const n=e.loss;t=n.map((e=>Mv(e)))}else{const n=Mv(e.loss);this.outputs.forEach((e=>{t.push(n)}))}else{e.loss=e.loss;for(const t in e.loss)if(-1===this.outputNames.indexOf(t))throw new Qy(`Unknown entry in loss dictionary: "${t}". Only expected the following keys: ${this.outputNames}`);for(const n of this.outputNames)e.loss[n],t.push(Mv(e.loss[n]))}this.lossFunctions=t,this.feedOutputNames=[],this.feedOutputShapes=[],this.feedLossFns=[];for(let e=0;e{for(let e=0;e1&&(this.metricsTensors.push([t,e]),this.metricsNames.push(this.outputNames[e]+"_loss"))}}));const s=function(e,t){if(null==e||Array.isArray(e)&&0===e.length)return t.map((e=>[]));let n;if("string"==typeof e||"function"==typeof e)n=[e];else{if(!Array.isArray(e)&&"object"!=typeof e)throw new TypeError(`Type of metrics argument not understood. Expected an string,function, Array, or Object, found: ${e}`);n=e}if(Array.isArray(n))return t.map((e=>n));{const e=[];for(const s of t){let t=n.hasOwnProperty(s)?n[s]:[];Array.isArray(t)||(t=[t]),e.push(t)}return e}}(e.metrics,this.outputNames),r=(e,t,n)=>{this.outputNames.length>1&&(t=this.outputNames[e]+"_"+t),this.metricsNames.push(t),this.metricsTensors.push([n,e])};Bb("metric",(()=>{for(let e=0;e{let n,s,a;for(const i of t){if("string"==typeof i&&-1!==["accuracy","acc","crossentropy","ce"].indexOf(i)){const t=this.internalOutputShapes[e];let r;1===t[t.length-1]||this.lossFunctions[e]===Nv?-1!==["accuracy","acc"].indexOf(i)?s=Fv:-1!==["crossentropy","ce"].indexOf(i)&&(s=Lv):this.lossFunctions[e]===Tv?-1!==["accuracy","acc"].indexOf(i)?s=Pv:-1!==["crossentropy","ce"].indexOf(i)&&(s=Wv):-1!==["accuracy","acc"].indexOf(i)?s=Bv:-1!==["crossentropy","ce"].indexOf(i)&&(s=Vv),-1!==["accuracy","acc"].indexOf(i)?r="acc":-1!==["crossentropy","ce"].indexOf(i)&&(r="ce"),a=s,n=""+r}else{const e=Gv(i);a=e,n=""+qv(i)}let t;Bb(n,(()=>{t=a})),r(e,n,t)}})(s[e])}})),this.collectedTrainableWeights=this.trainableWeights}checkTrainableWeightsConsistency(){null!=this.collectedTrainableWeights&&(this.trainableWeights.length,this.collectedTrainableWeights.length)}evaluate(e,t,n={}){const s=null==n.batchSize?32:n.batchSize;cx(s);const r=this.standardizeUserDataXY(e,t,!0,s);try{const e=r[0].concat(r[1]);this.makeTestFunction();const t=this.testFunction;return ab(this.testLoop(t,e,s,n.verbose,n.steps))}finally{mx(r[0],e),mx(r[1],t)}}async evaluateDataset(e,t){return this.makeTestFunction(),async function(e,t,n){const s=null!=(n=n||{}).batches,r=e.testFunction;let a=[];if(n.verbose>0)throw new Jy("Verbose mode is not implemented yet.");qt(!s||n.batches>0&&Number.isInteger(n.batches),(()=>`Test loop expects \`batches\` to be a positive integer, but received ${JSON.stringify(n.batches)}`));const i="function"==typeof t.next?t:await t.iterator();let o=0,l=0;for(;!s||l{if(t.value){const{xs:n,ys:s}=ix(e,t.value),i=n.concat(s),u=Ao((()=>r(i)));if(ko(i),0===l)for(let e=0;eDl(a[e],Bl(c,t)))),l>0&&ko(n)}ko(u),o+=c,++l}return a})),t.done)break}for(let e=0;ee.name));for(let s=0;s0){const n=[];throw t.forEach(((t,s)=>{null==t&&n.push(e[s])})),new Qy(`Cannot find SymbolicTensors for output name(s): ${JSON.stringify(n)}`)}return t}predictLoop(e,t=32,n=!1){return Ao((()=>{const s=this.checkNumSamples(e);if(n)throw new Jy("Verbose predictLoop() is not implemented yet.");const r=px(s,t),a=this.outputs.map((e=>[]));for(let t=0;t{const n=r[t][0],s=r[t][1],a=hx(e,n,s),i=[];if(Array.isArray(a))for(let e=0;ea[t].push(e)))}return ab(a.map((e=>Rc(e,0))))}))}predict(e,t={}){const n=fx(e);wx(n,this.inputNames,this.feedInputShapes,!1);try{const e=null==t.batchSize?32:t.batchSize;return cx(e),this.predictLoop(n,e)}finally{mx(n,e)}}predictOnBatch(e){wx(e,this.inputNames,this.feedInputShapes,!0);const t=(Array.isArray(e)?e[0]:e).shape[0];return this.predictLoop(e,t)}standardizeUserDataXY(e,t,n=!0,s){if(null==this.optimizer_)throw new Yy("You must compile a model before training/testing. Use LayersModel.compile(modelCompileArgs).");const r=[];for(let e=0;ee.shape[0])));s.sort();const r=fb(t.map((e=>e.shape[0])));if(r.sort(),s.length>1)throw new Qy(`All input Tensors (x) should have the same number of samples. Got array shapes: ${JSON.stringify(e.map((e=>e.shape)))}`);if(r.length>1)throw new Qy(`All target Tensors (y) should have the same number of samples. Got array shapes: ${JSON.stringify(t.map((e=>e.shape)))}`);if(s.length>0&&r.length>0&&!Kt(s,r))throw new Qy(`Input Tensors should have the same number of samples as target Tensors. Found ${s[0]} input sample(s) and ${r[0]} target sample(s).`)}(e=bx(e,this.feedInputNames,this.feedInputShapes,!1,"input"),t=bx(t,this.feedOutputNames,r,!1,"target")),function(e,t,n){const s=[Cv,Nv,Iv];for(let r=0;r0&&e[0].shape[0]%s!=0)throw new Qy(`In a stateful network, you should only pass inputs with a number of samples that is divisible by the batch size ${s}. Found: ${e[0].shape[0]} sample(s).`);return[e,t]}async standardizeUserData(e,t,n,s,r=!0,a){const[i,o]=this.standardizeUserDataXY(e,t,r,a);if(null!=n)throw new Error("sample weight is not supported yet.");let l=null;if(null!=s){const e=sx(s,this.outputNames);l=[];for(let t=0;t{const a=this.checkNumSamples(t,n,r,"steps"),i=[];if(s>0)throw new Jy("Verbose mode is not implemented yet.");if(null!=r)throw new Jy("steps mode in testLoop() is not implemented yet");{const s=px(a,n),r=Mp(qb(0,a));for(let n=0;n1){r+=`_${rb(e.slice(0,n),s)}`}t.push(r)}return t}makeTrainFunction(){return e=>{const t=[],n=e.slice(0,this.inputs.length),s=e.slice(this.inputs.length,this.inputs.length+this.outputs.length),r=e.slice(this.inputs.length+this.outputs.length,this.inputs.length+2*this.outputs.length),a=[],i=this.collectedTrainableWeights.map((e=>e.read()));return[this.optimizer_.minimize((()=>{const e=[];for(let t=0;t1&&e{l=Dl(l,e)})),l}),!0,i)].concat(a)}}makeTestFunction(){this.testFunction=e=>Ao((()=>{const t=[];let n;const s=e.slice(0,this.inputs.length),r=e.slice(this.inputs.length,this.inputs.length+this.outputs.length),a=[];for(let e=0;e0){if(g=!0,2!==n.validationData.length)throw 3===n.validationData.length?new Jy("validationData including sample weights is not supported yet."):new Qy(`When passing validation data, it must contain 2 (valX, valY) or 3 (valX, valY, valSampleWeight) items; ${n.validationData} is invalid.`);o=n.validationData[0],l=n.validationData[1];const e=!0,t=await this.standardizeUserData(o,l,null,null,e,d);u=t[0],c=t[1],m=u.concat(c)}else if(null!=n.validationSplit&&n.validationSplit>0&&n.validationSplit<1){g=!0;const e=Math.floor(s[0].shape[0]*(1-n.validationSplit)),t=s[0].shape[0];u=hx(s,e,t),a=s,s=hx(s,0,e),c=hx(r,e,t),i=r,r=hx(r,0,e),m=u.concat(c)}else null!=n.validationSteps&&(g=!0);const y=s.concat(r).concat(h);this.checkTrainableWeightsConsistency();const b=this.makeTrainFunction(),w=this.getDedupedMetricsNames();let v,x;g?(this.makeTestFunction(),v=this.testFunction,x=w.slice().concat(w.map((e=>"val_"+e)))):(v=null,m=[],x=w.slice());const A=wv(n.callbacks,n.yieldEvery);return await this.fitLoop(b,y,w,d,n.epochs,n.verbose,A,v,m,n.shuffle,x,n.initialEpoch,null,null)}finally{this.isTraining=!1,mx(s,e),mx(r,t),mx(a,e),mx(i,t),mx(u,o),mx(c,l),null!=h&&ko(h)}}async fitLoop(e,t,n,s,r,a,i,o,l,u,c,h,d,p){null==s&&(s=32),null==r&&(r=1),null==u&&(u=!0),null==h&&(h=0);let f=!1;if(null!=o&&null!=l&&(f=!0),null!=p&&(f=!0,null==d))throw new Qy("Can only use `validationSteps` when doing step-wise training, i.e., `stepsPerEpoch` must be set.");const m=this.checkNumSamples(t,s,d,"steps_per_epoch");let g;null!=m&&(g=qb(0,m)),null==a&&(a=1);const{callbackList:y,history:b}=xv(i,a,r,h,m,d,s,f,c);y.setModel(this),this.history=b,await y.onTrainBegin(),this.stopTraining_=!1;for(let a=h;a{const h=i[u][0],d=i[u][1],p=Xb(a,h,d-h);c.batch=u,c.size=d-h;const m=dx(t,p),g=e(m);for(let e=0;eob(e)))}else{const t=Object.keys(this.loss);e={};const n=this.loss;for(const s of t){if("string"!=typeof n[s])throw new Error("Serialization of non-string loss is not supported.");e[s]=ob(n[s])}}return e}getMetricIdentifiers(){if("string"==typeof this.metrics||"function"==typeof this.metrics)return[ob(qv(this.metrics))];if(Array.isArray(this.metrics))return this.metrics.map((e=>ob(qv(e))));{const e={};for(const t in this.metrics)e[t]=ob(qv(this.metrics[t]));return e}}getTrainingConfig(){return{loss:this.getLossIdentifiers(),metrics:this.getMetricIdentifiers(),optimizer_config:{class_name:this.optimizer.getClassName(),config:this.optimizer.getConfig()}}}loadTrainingConfig(e){if(null!=e.weighted_metrics)throw new Error("Loading weight_metrics is not supported yet.");if(null!=e.loss_weights)throw new Error("Loading loss_weights is not supported yet.");if(null!=e.sample_weight_mode)throw new Error("Loading sample_weight_mode is not supported yet.");const t=Av(Qv(e.optimizer_config));let n,s;if("string"==typeof e.loss)n=lb(e.loss);else if(Array.isArray(e.loss))n=e.loss.map((e=>lb(e)));else if(null!=e.loss){n={};for(const t in e.loss)n[t]=lb(e.loss[t])}if(Array.isArray(e.metrics))s=e.metrics.map((e=>lb(e)));else if(null!=e.metrics){s={};for(const t in e.metrics)s[t]=lb(e.metrics[t])}this.compile({loss:n,metrics:s,optimizer:t})}async save(e,t){if("string"==typeof e){const t=Ko(e);if(0===t.length)throw new Qy(`Cannot find any save handlers for URL '${e}'`);if(t.length>1)throw new Qy(`Found more than one (${t.length}) save handlers for URL '${e}'`);e=t[0]}if(null==e.save)throw new Qy("LayersModel.save() cannot proceed because the IOHandler provided does not have the `save` attribute defined.");const n=await Io(this.getNamedWeights(t)),s={modelTopology:this.toJSON(null,!1),format:"layers-model",generatedBy:`TensorFlow.js tfjs-layers v${ex}`,convertedBy:null};if(null!=t&&t.includeOptimizer&&null!=this.optimizer){s.trainingConfig=this.getTrainingConfig();const e="optimizer",{data:t,specs:r}=await Io(await this.optimizer.getWeights(),e);n.specs.push(...r),n.data=Lo([n.data,t])}if(null!=this.userDefinedMetadata){const e=!0;jv(this.userDefinedMetadata,this.name,e),s.userDefinedMetadata=this.userDefinedMetadata}return s.weightData=n.data,s.weightSpecs=n.specs,e.save(s)}setUserDefinedMetadata(e){jv(e,this.name),this.userDefinedMetadata=e}getUserDefinedMetadata(){return this.userDefinedMetadata}}vx.className="Model",Hl(vx);class xx extends vx{}xx.className="Functional",Hl(xx);class Ax extends vx{constructor(e){if(super({inputs:[],outputs:[]}),e=e||{},this.trainable=!0,this.built=!1,this.name=null!=e.name?e.name:Cb("sequential_"),null!=e.layers)for(const t of e.layers)this.add(t)}checkShape(e){if(e.inboundNodes[0].outputTensors[0].shape.some((e=>e<0)))throw new Qy(`Negative dimension size caused by adding layer ${e.name} with input shape [${e.inboundNodes[0].inputTensors[0].shape}]`)}add(e){const t=e instanceof Ax||e instanceof vx;let n;if(t){if(n=e,1!==n.outputs.length)throw new Qy("All layers in a Sequential model should have a single output tensor. For multi-output layers, use the functional API.");if(1!==n.inputs.length)throw new Qy("All layers in a Sequential model should have a single input tensor. For multi-input layers, use the functional API.")}if(0===this.outputs.length){if(0===e.inboundNodes.length){if(null==e.batchInputShape)throw new Qy("The first layer in a Sequential model must get an `inputShape` or `batchInputShape` argument.");const t=function(e){if(null==e.batchShape&&null==e.shape)throw new Error("Please provide to Input either a `shape` or a `batchShape` argument. Note that `shape` does not include the batch dimension.");if(null!=e.batchShape&&null!=e.shape)throw new Qy("Please provide either a `shape` or `batchShape` argument to Input, but not both.");let t=e.batchShape;null!=e.shape&&null==t&&(t=[null].concat(e.shape));let n=e.dtype;return null==n&&(n="float32"),new $w({batchInputShape:t,name:e.name,dtype:n,sparse:e.sparse}).inboundNodes[0].outputTensors[0]}({batchShape:e.batchInputShape,dtype:e.dtype,name:e.name+"_input"});e.apply(t)}if(t)this.outputs=n.outputs,this.inputs=n.inputs;else{if(1!==e.inboundNodes.length)throw new Qy(`A layer added to a Sequential model must not already be connected somewhere else. LayersModel received layer ${e.name} which has ${e.inboundNodes.length} pre-existing inbound connections.`);if(1!==e.inboundNodes[0].outputTensors.length)throw new Qy("All layers in a Sequential model should have a single output tensor. For multi-output layers, use the functional API.");this.checkShape(e),this.outputs=[e.inboundNodes[0].outputTensors[0]],this.inputs=Hw(this.outputs[0])}this.inboundNodes=[],new Gw({outboundLayer:this,inboundLayers:[],nodeIndices:[],tensorIndices:[],inputTensors:this.inputs,outputTensors:this.outputs,inputMasks:nb(null,this.inputs.length),outputMasks:[null],inputShapes:this.inputs.map((e=>e.shape)),outputShapes:this.outputs[0].shape})}else{const t=e.apply(this.outputs[0]);if(Array.isArray(t))throw new TypeError("All layers in a Sequential model should have a single output tensor. For multi-output layers, use the functional API.");this.checkShape(e),this.outputs=[t],this.inboundNodes[0].outputTensors=this.outputs,this.inboundNodes[0].outputShapes=[this.outputs[0].shape]}this.layers.push(e),this.built=!1}pop(){if(0===this.layers.length)throw new TypeError("There are no layers in the model.");if(this.layers.pop(),0===this.layers.length)this.outputs=[],this.inboundNodes=[],this.outboundNodes=[];else{const e=this.layers.length-1;this.layers[e].outboundNodes=[],this.outputs=[this.layers[e].output],this.inboundNodes[0].outputTensors=this.outputs,this.inboundNodes[0].outputShapes=[this.outputs[0].shape]}}call(e,t){return null==this.model&&this.build(),this.model.call(e,t)}build(e){if(Mw(e),0===this.inputs.length||0===this.outputs.length)throw new TypeError("Sequential model cannot be built: model is empty. Add some layers first.");this.model=new vx({inputs:this.inputs,outputs:this.outputs[0],name:this.name+"_model"}),this.model.trainable=this.trainable,this.supportsMasking=this.model.supportsMasking,this.inputLayers=this.model.inputLayers,this.inputLayersNodeIndices=this.model.inputLayersNodeIndices,this.inputLayersTensorIndices=this.model.inputLayersTensorIndices,this.outputLayers=this.model.outputLayers,this.outputLayersNodeIndices=this.model.outputLayersNodeIndices,this.outputLayersTensorIndices=this.model.outputLayersTensorIndices,this.nodesByDepth=this.model.nodesByDepth,this.containerNodes=this.model.containerNodes,this.outputNames=this.model.outputNames,this.inputNames=this.model.inputNames,this.built=!0}countParams(){return this.built||this.build(),super.countParams()}summary(e,t,n=console.log){this.built||this.build(),super.summary(e,t,n)}setWeights(e){null==this.model&&this.build(),this.model.setWeights(e)}evaluate(e,t,n={}){if(!this.built)throw new Yy("The model needs to be compiled before being used.");return this.model.evaluate(e,t,n)}async evaluateDataset(e,t){if(!this.built)throw new Yy("The model needs to be compiled before being used.");return this.model.evaluateDataset(e,t)}predict(e,t={}){return null==this.model&&this.build(),this.model.predict(e,t)}predictOnBatch(e){return null==this.model&&this.build(),this.model.predictOnBatch(e)}compile(e){this.build(),this.model.compile(e),this.optimizer_=this.model.optimizer,this.isOptimizerOwned=this.model.isOptimizerOwned,this.loss=this.model.loss,this.metrics=this.model.metrics,this.metricsTensors=this.model.metricsTensors,this.metricsNames=this.model.metricsNames}get optimizer(){return null==this.model?void 0:this.model.optimizer}set optimizer(e){this.model.optimizer=e}async fit(e,t,n={}){if(!this.built)throw new Yy("The model needs to be compiled before being used.");return this.model.fit(e,t,n)}async fitDataset(e,t){if(!this.built)throw new Yy("The model needs to be compiled before being used.");return this.model.fitDataset(e,t)}async trainOnBatch(e,t){return this.model.trainOnBatch(e,t)}static fromConfig(e,t,n={},s=!1){let r,a={};if(t instanceof Array){if(null==t[0].className||"Merge"===t[0].className)throw new Qy("Legacy serialization format not supported yet.");r=t}else qt(null!=t.layers,(()=>"When the config data for a Sequential model is not an Array, it must be an Object that contains the 'layers' field.")),r=t.layers,delete t.layers,a=t;const i=new e(a);if(!(i instanceof Ax))throw new Jy(`Sequential.fromConfig called on non-Sequential input: ${i}`);for(const e of r){const t=Av(e,void 0,s);s&&t.setFastWeightInitDuringBuild(!0),i.add(t)}return i}set stopTraining(e){if(null==this.model)throw new Qy("Cannot set the stopTraining property of a sequential model before it is compiled.");this.model.stopTraining=e}get stopTraining(){if(null==this.model)throw new Qy("Cannot get the stopTraining property of a sequential model before it is compiled.");return this.model.stopTraining}getConfig(){const e=[];for(const t of this.layers){const n={};n.className=t.getClassName(),n.config=t.getConfig(),e.push(n)}return{name:this.name,layers:e}}}Ax.className="Sequential",Hl(Ax);class kx extends ql{getConfig(){return{}}}class Cx extends kx{apply(e,t=1){return function(e,t=1){if(1!==t)throw new Jy(`Support for alpha values other than 1 (${t}) is not implemented yet.`);return vh(e)}(e,t)}}Cx.className="elu",Hl(Cx);class Sx extends kx{apply(e){return dp(e)}}Sx.className="selu",Hl(Sx);class Ex extends kx{apply(e){return sp(e)}}Ex.className="relu",Hl(Ex);class _x extends kx{apply(e){return Ao((()=>Ad(6,sp(e))))}}_x.className="relu6",Hl(_x);class Ix extends kx{apply(e){return e}}Ix.className="linear",Hl(Ix);class Tx extends kx{apply(e){return Mc(e)}}Tx.className="sigmoid",Hl(Tx);class Nx extends kx{apply(e){return function(e){return Ao((()=>{const t=Dl(.5,Bl(.2,e));return Kc(t,0,1)}))}(e)}}Nx.className="hardSigmoid",Hl(Nx);class Ox extends kx{apply(e){return rd(e)}}Ox.className="softplus",Hl(Ox);class Rx extends kx{apply(e){return function(e){return Ao((()=>Fl(e,Dl(eu(e),1))))}(e)}}Rx.className="softsign",Hl(Rx);class Dx extends kx{apply(e){return Bc(e)}}Dx.className="tanh",Hl(Dx);class Mx extends kx{apply(e,t=-1){return Ap(e,t)}}Mx.className="softmax",Hl(Mx);class Fx extends kx{apply(e,t=-1){return id(e,t)}}Fx.className="logSoftmax",Hl(Fx);class Bx extends kx{apply(e){return Ao((()=>Ao((()=>{const t=Math.sqrt(2),n=Bl(.5,Dl(1,Ah(Fl(e,t))));return Bl(e,n)}))))}}Bx.className="gelu",Hl(Bx);class zx extends kx{apply(e){return Ao((()=>Bl(.5,Bl(e,Dl(1,Bc(Bl(zl(Fl(2,Math.PI)),Dl(e,Bl(.044715,Yl(e,3))))))))))}}zx.className="gelu_new",Hl(zx);class Lx extends kx{apply(e){return Ao((()=>Bl(e,Bc(rd(e)))))}}Lx.className="mish",Hl(Lx);class Px extends kx{apply(e,t=1){return Ao((()=>Bl(Mc(Bl(e,t)),e)))}}function Vx(e){return e.getClassName()}function Wx(e,t={}){return db(e,jl.getMap().classNameMap,t,"activation")}function Ux(e){if(null==e){const e={className:"linear",config:{}};return Wx(e)}if("string"==typeof e){const t={};return t.className=e,t.config={},Wx(t)}return e instanceof kx?e:Wx(e)}function Gx(e){if(null!=e&&"object"!=typeof e)throw new Error(`Argument to L1L2 regularizer's constructor is expected to be an object, but received: ${e}`)}Px.className="swish",Hl(Px);class qx extends ql{}class jx extends qx{constructor(e){super(),Gx(e),this.l1=null==e||null==e.l1?.01:e.l1,this.l2=null==e||null==e.l2?.01:e.l2,this.hasL1=0!==this.l1,this.hasL2=0!==this.l2}apply(e){return Ao((()=>{let t=wd([1]);return this.hasL1&&(t=Dl(t,Dh(Bl(this.l1,eu(e))))),this.hasL2&&(t=Dl(t,Dh(Bl(this.l2,rw(e))))),Tc(t,[])}))}getConfig(){return{l1:this.l1,l2:this.l2}}static fromConfig(e,t){return new e({l1:t.l1,l2:t.l2})}}jx.className="L1L2",Hl(jx);const Hx={l1l2:"L1L2"};function $x(e){return cb(e)}function Kx(e,t={}){return db(e,jl.getMap().classNameMap,t,"regularizer")}function Xx(e){if(null==e)return null;if("string"==typeof e){return Kx({className:e in Hx?Hx[e]:e,config:{}})}return e instanceof qx?e:Kx(e)}class Zx extends jw{constructor(e){super(null==e?{}:e),this.supportsMasking=!0,null!=e&&(this.maxValue=e.maxValue)}call(e,t){e=Dw(e);let n=sp(e);return null!=this.maxValue&&(n=Kc(n,0,this.maxValue)),n}computeOutputShape(e){return e}getConfig(){const e={maxValue:this.maxValue},t=super.getConfig();return Object.assign(e,t),e}}Zx.className="ReLU",Hl(Zx);class Yx extends jw{constructor(e){super(null==e?{}:e),this.DEFAULT_ALPHA=.3,null==e&&(e={}),this.alpha=null==e.alpha?this.DEFAULT_ALPHA:e.alpha}call(e,t){const n=Dw(e);return Zh(n,this.alpha)}computeOutputShape(e){return e}getConfig(){const e={alpha:this.alpha},t=super.getConfig();return Object.assign(e,t),e}}Yx.className="LeakyReLU",Hl(Yx);class Qx extends jw{constructor(e){if(super(null==e?{}:e),this.DEFAULT_ALPHA_INITIALIZER="zeros",null==e&&(e={}),this.supportsMasking=!0,this.alphaInitializer=Nw(e.alphaInitializer||this.DEFAULT_ALPHA_INITIALIZER),this.alphaRegularizer=Xx(e.alphaRegularizer),this.alphaConstraint=cv(e.alphaConstraint),null==e.sharedAxes)this.sharedAxes=null;else if(Array.isArray(e.sharedAxes))this.sharedAxes=e.sharedAxes;else{if("number"!=typeof e.sharedAxes)throw new Qy(`Expected sharedAxes to be a number or an array of numbers, but got ${e.sharedAxes}`);this.sharedAxes=[e.sharedAxes]}}build(e){const t=(e=Mw(e)).slice(1);if(null!=this.sharedAxes)for(const e of this.sharedAxes)t[e-1]=1;this.alpha=this.addWeight("alpha",t,"float32",this.alphaInitializer,this.alphaRegularizer,!0,this.alphaConstraint);const n={};if(null!=this.sharedAxes)for(let t=1;t{let n=Dw(e);const s=t.mask;if(null!=s){const e=Bl(Ql(vd(n.shape),Nl(s,n.dtype)),Wl(-1e9));n=Dl(n,e)}return this.axis instanceof Array?this.axis.length>1?zh(Ql(n,od(n,this.axis,!0))):this.softmax(n,this.axis[0]):this.softmax(n,this.axis)}))}computeOutputShape(e){return e}getConfig(){const e={axis:this.axis},t=super.getConfig();return Object.assign(e,t),e}}function nA(e,t,n){if("number"==typeof e)return nb(e,t);if(e.length!==t)throw new Qy(`The ${n} argument must be an integer or tuple of ${t} integers. Received: ${e.length} elements.`);for(let r=0;r(Ob(t),"channelsFirst"===t?Jp(e,[0,2,3,1]):e)))}function iA(e,t){return Ao((()=>(Ob(t),"channelsFirst"===t?Jp(e,[0,2,3,4,1]):e)))}function oA(e,t,n,s=1,r="valid",a,i=1){return Ao((()=>{if(null==a&&(a="channelsLast"),Ob(a),3!==e.shape.length)throw new Qy(`The input of a conv1dWithBias operation should be 3, but is ${e.shape.length} instead.`);if(3!==t.shape.length)throw new Qy(`The kernel for a conv1dWithBias operation should be 3, but is ${t.shape.length} instead`);if(null!=n&&1!==n.shape.length)throw new Qy(`The bias for a conv1dWithBias operation should be 1, but is ${n.shape.length} instead`);if("channelsFirst"===a&&(e=Jp(e,[0,2,1])),"causal"===r)throw new Jy("The support for CAUSAL padding mode in conv1dWithBias is not implemented yet.");let o=eh(e,t,s,"same"===r?"same":"valid","NWC",i);return null!=n&&(o=iw(o,n)),o}))}function lA(e,t,n,s=[1,1],r="valid",a,i,o=null){return Ao((()=>{if(null==a&&(a="channelsLast"),Ob(a),3!==e.rank&&4!==e.rank)throw new Qy(`conv2dWithBiasActivation expects input to be of rank 3 or 4, but received ${e.rank}.`);if(3!==t.rank&&4!==t.rank)throw new Qy(`conv2dWithBiasActivation expects kernel to be of rank 3 or 4, but received ${e.rank}.`);let l=aA(e,a);if("causal"===r)throw new Jy("The support for CAUSAL padding mode in conv1dWithBias is not implemented yet.");return l=ff({x:l,filter:t,strides:s,pad:"same"===r?"same":"valid",dilations:i,dataFormat:"NHWC",bias:n,activation:o}),"channelsFirst"===a&&(l=Jp(l,[0,3,1,2])),l}))}function uA(e,t,n,s=[1,1,1],r="valid",a,i){return Ao((()=>{if(null==a&&(a="channelsLast"),Ob(a),4!==e.rank&&5!==e.rank)throw new Qy(`conv3dWithBias expects input to be of rank 4 or 5, but received ${e.rank}.`);if(4!==t.rank&&5!==t.rank)throw new Qy(`conv3dWithBias expects kernel to be of rank 4 or 5, but received ${e.rank}.`);let o=iA(e,a);if("causal"===r)throw new Jy("The support for CAUSAL padding mode in conv3dWithBias is not implemented yet.");return o=sh(o,t,s,"same"===r?"same":"valid","NDHWC",i),null!=n&&(o=iw(o,n)),"channelsFirst"===a&&(o=Jp(o,[0,4,1,2,3])),o}))}tA.className="Softmax",Hl(tA);class cA extends jw{constructor(e,t){if(super(t),this.bias=null,this.DEFAULT_KERNEL_INITIALIZER="glorotNormal",this.DEFAULT_BIAS_INITIALIZER="zeros",cA.verifyArgs(t),this.rank=e,bb(this.rank,"rank"),1!==this.rank&&2!==this.rank&&3!==this.rank)throw new Jy(`Convolution layer for rank other than 1, 2, or 3 (${this.rank}) is not implemented yet.`);if(this.kernelSize=nA(t.kernelSize,e,"kernelSize"),this.strides=nA(null==t.strides?1:t.strides,e,"strides"),this.padding=null==t.padding?"valid":t.padding,Rb(this.padding),this.dataFormat=null==t.dataFormat?"channelsLast":t.dataFormat,Ob(this.dataFormat),this.activation=Ux(t.activation),this.useBias=null==t.useBias||t.useBias,this.biasInitializer=Nw(t.biasInitializer||this.DEFAULT_BIAS_INITIALIZER),this.biasConstraint=cv(t.biasConstraint),this.biasRegularizer=Xx(t.biasRegularizer),this.activityRegularizer=Xx(t.activityRegularizer),this.dilationRate=nA(null==t.dilationRate?1:t.dilationRate,e,"dilationRate"),1===this.rank&&Array.isArray(this.dilationRate)&&1!==this.dilationRate.length)throw new Qy(`dilationRate must be a number or an array of a single number for 1D convolution, but received ${JSON.stringify(this.dilationRate)}`);if(2===this.rank){if("number"==typeof this.dilationRate)this.dilationRate=[this.dilationRate,this.dilationRate];else if(2!==this.dilationRate.length)throw new Qy(`dilationRate must be a number or array of two numbers for 2D convolution, but received ${JSON.stringify(this.dilationRate)}`)}else if(3===this.rank)if("number"==typeof this.dilationRate)this.dilationRate=[this.dilationRate,this.dilationRate,this.dilationRate];else if(3!==this.dilationRate.length)throw new Qy(`dilationRate must be a number or array of three numbers for 3D convolution, but received ${JSON.stringify(this.dilationRate)}`)}static verifyArgs(e){if(sb("kernelSize"in e,"required key 'kernelSize' not in config"),"number"!=typeof e.kernelSize&&!yb(e.kernelSize,"number",1,3))throw new Qy(`BaseConv expects config.kernelSize to be number or number[] with length 1, 2, or 3, but received ${JSON.stringify(e.kernelSize)}.`)}getConfig(){const e={kernelSize:this.kernelSize,strides:this.strides,padding:this.padding,dataFormat:this.dataFormat,dilationRate:this.dilationRate,activation:Vx(this.activation),useBias:this.useBias,biasInitializer:Tw(this.biasInitializer),biasRegularizer:$x(this.biasRegularizer),activityRegularizer:$x(this.activityRegularizer),biasConstraint:lv(this.biasConstraint)},t=super.getConfig();return Object.assign(e,t),e}}class hA extends cA{constructor(e,t){super(e,t),this.kernel=null,hA.verifyArgs(t),this.filters=t.filters,bb(this.filters,"filters"),this.kernelInitializer=Nw(t.kernelInitializer||this.DEFAULT_KERNEL_INITIALIZER),this.kernelConstraint=cv(t.kernelConstraint),this.kernelRegularizer=Xx(t.kernelRegularizer)}build(e){e=Mw(e);const t="channelsFirst"===this.dataFormat?1:e.length-1;if(null==e[t])throw new Qy(`The channel dimension of the input should be defined. Found ${e[t]}`);const n=e[t],s=this.kernelSize.concat([n,this.filters]);this.kernel=this.addWeight("kernel",s,null,this.kernelInitializer,this.kernelRegularizer,!0,this.kernelConstraint),this.useBias&&(this.bias=this.addWeight("bias",[this.filters],null,this.biasInitializer,this.biasRegularizer,!0,this.biasConstraint)),this.inputSpec=[{ndim:this.rank+2,axes:{[t]:n}}],this.built=!0}call(e,t){return Ao((()=>{let t;e=Dw(e);const n=null==this.bias?null:this.bias.read(),s=vb(this.activation.getClassName());if(null!=s&&2===this.rank)t=lA(e,this.kernel.read(),n,this.strides,this.padding,this.dataFormat,this.dilationRate,s);else{if(1===this.rank)t=oA(e,this.kernel.read(),n,this.strides[0],this.padding,this.dataFormat,this.dilationRate[0]);else if(2===this.rank)t=lA(e,this.kernel.read(),n,this.strides,this.padding,this.dataFormat,this.dilationRate);else{if(3!==this.rank)throw new Jy("convolutions greater than 3D are not implemented yet.");t=uA(e,this.kernel.read(),n,this.strides,this.padding,this.dataFormat,this.dilationRate)}null!=this.activation&&(t=this.activation.apply(t))}return t}))}computeOutputShape(e){e=Mw(e);const t=[],n="channelsLast"===this.dataFormat?e.slice(1,e.length-1):e.slice(2);for(let e=0;e 0 but got ${JSON.stringify(e.filters)}`)}}class dA extends hA{constructor(e){super(2,e),dA.verifyArgs(e)}getConfig(){const e=super.getConfig();return delete e.rank,e}static verifyArgs(e){if("number"!=typeof e.kernelSize&&!yb(e.kernelSize,"number",1,2))throw new Qy(`Conv2D expects config.kernelSize to be number or number[] with length 1 or 2, but received ${JSON.stringify(e.kernelSize)}.`)}}dA.className="Conv2D",Hl(dA);class pA extends hA{constructor(e){super(3,e),pA.verifyArgs(e)}getConfig(){const e=super.getConfig();return delete e.rank,e}static verifyArgs(e){if("number"!=typeof e.kernelSize&&(!Array.isArray(e.kernelSize)||1!==e.kernelSize.length&&3!==e.kernelSize.length))throw new Qy(`Conv3D expects config.kernelSize to be number or [number, number, number], but received ${JSON.stringify(e.kernelSize)}.`)}}pA.className="Conv3D",Hl(pA);class fA extends dA{constructor(e){if(super(e),this.inputSpec=[new Vw({ndim:4})],"same"!==this.padding&&"valid"!==this.padding)throw new Qy(`Conv2DTranspose currently supports only padding modes 'same' and 'valid', but received padding mode ${this.padding}`)}build(e){if(4!==(e=Mw(e)).length)throw new Qy("Input should have rank 4; Received input shape: "+JSON.stringify(e));const t="channelsFirst"===this.dataFormat?1:e.length-1;if(null==e[t])throw new Qy("The channel dimension of the inputs should be defined. Found `None`.");const n=e[t],s=this.kernelSize.concat([this.filters,n]);this.kernel=this.addWeight("kernel",s,"float32",this.kernelInitializer,this.kernelRegularizer,!0,this.kernelConstraint),this.useBias&&(this.bias=this.addWeight("bias",[this.filters],"float32",this.biasInitializer,this.biasRegularizer,!0,this.biasConstraint)),this.inputSpec=[new Vw({ndim:4,axes:{[t]:n}})],this.built=!0}call(e,t){return Ao((()=>{let t=Dw(e);if(4!==t.shape.length)throw new Qy(`Conv2DTranspose.call() expects input tensor to be rank-4, but received a tensor of rank-${t.shape.length}`);const n=t.shape,s=n[0];let r,a;"channelsFirst"===this.dataFormat?(r=2,a=3):(r=1,a=2);const i=n[r],o=n[a],l=this.kernelSize[0],u=this.kernelSize[1],c=this.strides[0],h=this.strides[1],d=[s,rA(i,c,l,this.padding),rA(o,h,u,this.padding),this.filters];"channelsLast"!==this.dataFormat&&(t=Jp(t,[0,2,3,1]));let p=nh(t,this.kernel.read(),d,this.strides,this.padding);return"channelsLast"!==this.dataFormat&&(p=Jp(p,[0,3,1,2])),null!=this.bias&&(p=iw(p,this.bias.read(),this.dataFormat)),null!=this.activation&&(p=this.activation.apply(p)),p}))}computeOutputShape(e){const t=(e=Mw(e)).slice();let n,s,r;"channelsFirst"===this.dataFormat?(n=1,s=2,r=3):(n=3,s=1,r=2);const a=this.kernelSize[0],i=this.kernelSize[1],o=this.strides[0],l=this.strides[1];return t[n]=this.filters,t[s]=rA(t[s],o,a,this.padding),t[r]=rA(t[r],l,i,this.padding),t}getConfig(){const e=super.getConfig();return delete e.dilationRate,e}}fA.className="Conv2DTranspose",Hl(fA);class mA extends pA{constructor(e){if(super(e),this.inputSpec=[new Vw({ndim:5})],"same"!==this.padding&&"valid"!==this.padding)throw new Qy(`Conv3DTranspose currently supports only padding modes 'same' and 'valid', but received padding mode ${this.padding}`)}build(e){if(5!==(e=Mw(e)).length)throw new Qy("Input should have rank 5; Received input shape: "+JSON.stringify(e));const t="channelsFirst"===this.dataFormat?1:e.length-1;if(null==e[t])throw new Qy("The channel dimension of the inputs should be defined. Found `None`.");const n=e[t],s=this.kernelSize.concat([this.filters,n]);this.kernel=this.addWeight("kernel",s,"float32",this.kernelInitializer,this.kernelRegularizer,!0,this.kernelConstraint),this.useBias&&(this.bias=this.addWeight("bias",[this.filters],"float32",this.biasInitializer,this.biasRegularizer,!0,this.biasConstraint)),this.inputSpec=[new Vw({ndim:5,axes:{[t]:n}})],this.built=!0}call(e,t){return Ao((()=>{let t=Dw(e);if(5!==t.shape.length)throw new Qy(`Conv3DTranspose.call() expects input tensor to be rank-4, but received a tensor of rank-${t.shape.length}`);const n=t.shape,s=n[0];let r,a,i;"channelsFirst"===this.dataFormat?(i=2,r=3,a=4):(i=1,r=2,a=3);const o=n[i],l=n[r],u=n[a],c=this.kernelSize[0],h=this.kernelSize[1],d=this.kernelSize[2],p=this.strides[0],f=this.strides[1],m=this.strides[2],g=[s,rA(o,p,c,this.padding),rA(l,f,h,this.padding),rA(u,m,d,this.padding),this.filters];"channelsLast"!==this.dataFormat&&(t=Jp(t,[0,2,3,4,1]));let y=ah(t,this.kernel.read(),g,this.strides,this.padding);return"channelsLast"!==this.dataFormat&&(y=Jp(y,[0,4,1,2,3])),null!==this.bias&&(y=iw(y,this.bias.read(),this.dataFormat)),null!==this.activation&&(y=this.activation.apply(y)),y}))}computeOutputShape(e){const t=(e=Mw(e)).slice();let n,s,r,a;"channelsFirst"===this.dataFormat?(n=1,s=2,r=3,a=4):(n=4,s=1,r=2,a=3);const i=this.kernelSize[0],o=this.kernelSize[1],l=this.kernelSize[2],u=this.strides[0],c=this.strides[1],h=this.strides[2];return t[n]=this.filters,t[s]=rA(t[s],u,i,this.padding),t[r]=rA(t[r],c,o,this.padding),t[a]=rA(t[a],h,l,this.padding),t}getConfig(){const e=super.getConfig();return delete e.dilationRate,e}}mA.className="Conv3DTranspose",Hl(mA);class gA extends hA{constructor(e,t){if(super(e,t),this.DEFAULT_DEPTHWISE_INITIALIZER="glorotUniform",this.DEFAULT_POINTWISE_INITIALIZER="glorotUniform",this.depthwiseKernel=null,this.pointwiseKernel=null,null==t.filters)throw new Qy("The `filters` configuration field is required by SeparableConv, but is unspecified.");if(null!=t.kernelInitializer||null!=t.kernelRegularizer||null!=t.kernelConstraint)throw new Qy("Fields kernelInitializer, kernelRegularizer and kernelConstraint are invalid for SeparableConv2D. Use depthwiseInitializer, depthwiseRegularizer, depthwiseConstraint, pointwiseInitializer, pointwiseRegularizer and pointwiseConstraint instead.");if(null!=t.padding&&"same"!==t.padding&&"valid"!==t.padding)throw new Qy(`SeparableConv${this.rank}D supports only padding modes: 'same' and 'valid', but received ${JSON.stringify(t.padding)}`);this.depthMultiplier=null==t.depthMultiplier?1:t.depthMultiplier,this.depthwiseInitializer=Nw(t.depthwiseInitializer||this.DEFAULT_DEPTHWISE_INITIALIZER),this.depthwiseRegularizer=Xx(t.depthwiseRegularizer),this.depthwiseConstraint=cv(t.depthwiseConstraint),this.pointwiseInitializer=Nw(t.depthwiseInitializer||this.DEFAULT_POINTWISE_INITIALIZER),this.pointwiseRegularizer=Xx(t.pointwiseRegularizer),this.pointwiseConstraint=cv(t.pointwiseConstraint)}build(e){if((e=Mw(e)).length{let t;if(e=Dw(e),1===this.rank)throw new Jy("1D separable convolution is not implemented yet.");return 2===this.rank&&("channelsFirst"===this.dataFormat&&(e=Jp(e,[0,2,3,1])),t=pp(e,this.depthwiseKernel.read(),this.pointwiseKernel.read(),this.strides,this.padding,this.dilationRate,"NHWC")),this.useBias&&(t=iw(t,this.bias.read(),this.dataFormat)),null!=this.activation&&(t=this.activation.apply(t)),"channelsFirst"===this.dataFormat&&(t=Jp(t,[0,3,1,2])),t}))}getConfig(){const e=super.getConfig();return delete e.rank,delete e.kernelInitializer,delete e.kernelRegularizer,delete e.kernelConstraint,e.depthwiseInitializer=Tw(this.depthwiseInitializer),e.pointwiseInitializer=Tw(this.pointwiseInitializer),e.depthwiseRegularizer=$x(this.depthwiseRegularizer),e.pointwiseRegularizer=$x(this.pointwiseRegularizer),e.depthwiseConstraint=lv(this.depthwiseConstraint),e.pointwiseConstraint=lv(this.pointwiseConstraint),e}}gA.className="SeparableConv";class yA extends gA{constructor(e){super(2,e)}}yA.className="SeparableConv2D",Hl(yA);class bA extends hA{constructor(e){super(1,e),bA.verifyArgs(e),this.inputSpec=[{ndim:3}]}getConfig(){const e=super.getConfig();return delete e.rank,delete e.dataFormat,e}static verifyArgs(e){if("number"!=typeof e.kernelSize&&!yb(e.kernelSize,"number",1,1))throw new Qy(`Conv1D expects config.kernelSize to be number or number[] with length 1, but received ${JSON.stringify(e.kernelSize)}.`)}}bA.className="Conv1D",Hl(bA);class wA extends jw{constructor(e){super(e),"number"==typeof e.cropping?this.cropping=[[e.cropping,e.cropping],[e.cropping,e.cropping]]:"number"==typeof e.cropping[0]?this.cropping=[[e.cropping[0],e.cropping[0]],[e.cropping[1],e.cropping[1]]]:this.cropping=e.cropping,this.dataFormat=void 0===e.dataFormat?"channelsLast":e.dataFormat,this.inputSpec=[{ndim:4}]}computeOutputShape(e){return"channelsFirst"===this.dataFormat?[e[0],e[1],e[2]-this.cropping[0][0]-this.cropping[0][1],e[3]-this.cropping[1][0]-this.cropping[1][1]]:[e[0],e[1]-this.cropping[0][0]-this.cropping[0][1],e[2]-this.cropping[1][0]-this.cropping[1][1],e[3]]}call(e,t){return Ao((()=>{if(e=Dw(e),"channelsLast"===this.dataFormat){const t=Yb(e,this.cropping[0][0],e.shape[1]-this.cropping[0][0]-this.cropping[0][1],2);return Yb(t,this.cropping[1][0],e.shape[2]-this.cropping[1][1]-this.cropping[1][0],3)}{const t=Yb(e,this.cropping[0][0],e.shape[2]-this.cropping[0][0]-this.cropping[0][1],3);return Yb(t,this.cropping[1][0],e.shape[3]-this.cropping[1][1]-this.cropping[1][0],4)}}))}getConfig(){const e={cropping:this.cropping,dataFormat:this.dataFormat},t=super.getConfig();return Object.assign(e,t),e}}wA.className="Cropping2D",Hl(wA);class vA extends jw{constructor(e){var t;super(e),this.DEFAULT_SIZE=[2,2],this.inputSpec=[{ndim:4}],this.size=null==e.size?this.DEFAULT_SIZE:e.size,this.dataFormat=null==e.dataFormat?"channelsLast":e.dataFormat,Ob(this.dataFormat),this.interpolation=null==e.interpolation?"nearest":e.interpolation,t=this.interpolation,gb(Eb,"InterpolationFormat",t)}computeOutputShape(e){if("channelsFirst"===this.dataFormat){const t=null==e[2]?null:this.size[0]*e[2],n=null==e[3]?null:this.size[1]*e[3];return[e[0],e[1],t,n]}{const t=null==e[1]?null:this.size[0]*e[1],n=null==e[2]?null:this.size[1]*e[2];return[e[0],t,n,e[3]]}}call(e,t){return Ao((()=>{let t=Dw(e);const n=t.shape;if("channelsFirst"===this.dataFormat){t=Jp(t,[0,2,3,1]);const e=this.size[0]*n[2],s=this.size[1]*n[3],r="nearest"===this.interpolation?bm.resizeNearestNeighbor(t,[e,s]):bm.resizeBilinear(t,[e,s]);return Jp(r,[0,3,1,2])}{const e=this.size[0]*n[1],s=this.size[1]*n[2];return"nearest"===this.interpolation?bm.resizeNearestNeighbor(t,[e,s]):bm.resizeBilinear(t,[e,s])}}))}getConfig(){const e={size:this.size,dataFormat:this.dataFormat,interpolation:this.interpolation},t=super.getConfig();return Object.assign(e,t),e}}vA.className="UpSampling2D",Hl(vA);class xA extends cA{constructor(e){super(2,e),this.depthwiseKernel=null,this.depthMultiplier=null==e.depthMultiplier?1:e.depthMultiplier,this.depthwiseInitializer=Nw(e.depthwiseInitializer||this.DEFAULT_KERNEL_INITIALIZER),this.depthwiseConstraint=cv(e.depthwiseConstraint),this.depthwiseRegularizer=Xx(e.depthwiseRegularizer)}build(e){if((e=Mw(e)).length<4)throw new Qy(`Inputs to DepthwiseConv2D should have rank 4. Received input shape: ${JSON.stringify(e)}.`);const t="channelsFirst"===this.dataFormat?1:3;if(null==e[t]||e[t]<0)throw new Qy(`The channel dimension of the inputs to DepthwiseConv2D should be defined, but is not (${e[t]}).`);const n=e[t],s=[this.kernelSize[0],this.kernelSize[1],n,this.depthMultiplier];this.depthwiseKernel=this.addWeight("depthwise_kernel",s,null,this.depthwiseInitializer,this.depthwiseRegularizer,!0,this.depthwiseConstraint),this.useBias?this.bias=this.addWeight("bias",[n*this.depthMultiplier],null,this.biasInitializer,this.biasRegularizer,!0,this.biasConstraint):this.bias=null,this.built=!0}call(e,t){return Ao((()=>{let t=function(e,t,n=[1,1],s="valid",r,a){return Ao((()=>{null==r&&(r="channelsLast"),Ob(r);let i=aA(e,r);if(4!==e.rank)throw new Qy(`Input for depthwiseConv2d is required to be 4-D, but is instead ${e.rank}-D`);if(4!==t.rank)throw new Qy(`depthwiseKernel is required to be 4-D, but is instead ${t.rank}-D`);return i=dh(i,t,n,"same"===s?"same":"valid","NHWC",a),"channelsFirst"===r&&(i=Jp(i,[0,3,1,2])),i}))}(e=Dw(e),this.depthwiseKernel.read(),this.strides,this.padding,this.dataFormat,null);return this.useBias&&(t=iw(t,this.bias.read(),this.dataFormat)),null!=this.activation&&(t=this.activation.apply(t)),t}))}computeOutputShape(e){e=Mw(e);const t="channelsFirst"===this.dataFormat?e[2]:e[1],n="channelsFirst"===this.dataFormat?e[3]:e[2],s="channelsFirst"===this.dataFormat?e[1]*this.depthMultiplier:e[3]*this.depthMultiplier,r=sA(t,this.kernelSize[0],this.padding,this.strides[0]),a=sA(n,this.kernelSize[1],this.padding,this.strides[1]);return"channelsFirst"===this.dataFormat?[e[0],s,r,a]:[e[0],r,a,s]}getConfig(){const e=super.getConfig();return e.depthMultiplier=this.depthMultiplier,e.depthwiseInitializer=Tw(this.depthwiseInitializer),e.depthwiseRegularizer=$x(this.depthwiseRegularizer),e.depthwiseConstraint=lv(this.depthwiseRegularizer),e}}function AA(e,t,n,s){if(Array.isArray(e)){if(null!=t||null!=n)throw new Qy("When inputs is an array, neither initialState or constants should be provided");null!=s&&(n=e.slice(e.length-s,e.length),e=e.slice(0,e.length-s)),e.length>1&&(t=e.slice(1,e.length)),e=e[0]}function r(e){return null==e||Array.isArray(e)?e:[e]}return{inputs:e,initialState:t=r(t),constants:n=r(n)}}function kA(e,t,n,s=!1,r,a,i=!1,o=!1){return Ao((()=>{const i=t.shape.length;if(i<3)throw new Qy(`Input should be at least 3D, but is ${i}D.`);const l=[1,0].concat(qb(2,i));if(t=Jp(t,l),null!=a)throw new Jy("The rnn() functoin of the deeplearn.js backend does not support constants yet.");null!=r&&((r=Nl(Nl(r,"bool"),"float32")).rank===i-1&&(r=Lh(r,-1)),r=Jp(r,l)),s&&(t=ap(t,0),null!=r&&(r=ap(r,0)));const u=[];let c,h=n;const d=t.shape[0],p=$p(t);let f,m;null!=r&&(f=$p(r));for(let t=0;te(n,h)));if(null==r)c=s[0],h=s[1];else{const e=Ao((()=>{const e=f[t],n=Ql(Nd(e),e);return{output:Dl(Bl(s[0],e),Bl(h[0],n)),newStates:h.map(((t,r)=>Dl(Bl(s[1][r],e),Bl(t,n))))}}));c=e.output,h=e.newStates}o&&u.push(c)}if(o){m=Np(u,1)}return[c,m,h]}))}xA.className="DepthwiseConv2D",Hl(xA);class CA extends jw{constructor(e){let t;if(super(e),null==e.cell)throw new Qy("cell property is missing for the constructor of RNN.");if(t=Array.isArray(e.cell)?new RA({cells:e.cell}):e.cell,null==t.stateSize)throw new Qy("The RNN cell should have an attribute `stateSize` (tuple of integers, one integer per RNN state).");this.cell=t,this.returnSequences=null!=e.returnSequences&&e.returnSequences,this.returnState=null!=e.returnState&&e.returnState,this.goBackwards=null!=e.goBackwards&&e.goBackwards,this._stateful=null!=e.stateful&&e.stateful,this.unroll=null!=e.unroll&&e.unroll,this.supportsMasking=!0,this.inputSpec=[new Vw({ndim:3})],this.stateSpec=null,this.states_=null,this.numConstants=null,this.keptStates=[]}getStates(){if(null==this.states_){return qb(0,Array.isArray(this.cell.stateSize)?this.cell.stateSize.length:1).map((e=>null))}return this.states_}setStates(e){this.states_=e}computeOutputShape(e){Ow(e)&&(e=e[0]);let t=this.cell.stateSize;Array.isArray(t)||(t=[t]);const n=t[0];let s;if(s=this.returnSequences?[e[0],e[1],n]:[e[0],n],this.returnState){const n=[];for(const s of t)n.push([e[0],s]);return[s].concat(n)}return s}computeMask(e,t){return Ao((()=>{Array.isArray(t)&&(t=t[0]);const e=this.returnSequences?t:null;if(this.returnState){const t=this.states.map((e=>null));return[e].concat(t)}return e}))}get states(){if(null==this.states_){const e=Array.isArray(this.cell.stateSize)?this.cell.stateSize.length:1,t=[];for(let n=0;ne.shape[e.shape.length-1])),r))throw new Qy(`An initialState was passed that is not compatible with cell.stateSize. Received stateSpec=${this.stateSpec}; However cell.stateSize is ${this.cell.stateSize}`)}else this.stateSpec=r.map((e=>new Vw({shape:[null,e]})));this.stateful&&this.resetStates()}resetStates(e,t=!1){Ao((()=>{if(!this.stateful)throw new Zy("Cannot call resetStates() on an RNN Layer that is not stateful.");const n=this.inputSpec[0].shape[0];if(null==n)throw new Qy("If an RNN is stateful, it needs to know its batch size. Specify the batch size of your input tensors: \n- If using a Sequential model, specify the batch size by passing a `batchInputShape` option to your first layer.\n- If using the functional API, specify the batch size by passing a `batchShape` option to your Input layer.");if(null==this.states_)Array.isArray(this.cell.stateSize)?this.states_=this.cell.stateSize.map((e=>wd([n,e]))):this.states_=[wd([n,this.cell.stateSize])];else if(null==e)ko(this.states_),null!=this.keptStates&&(ko(this.keptStates),this.keptStates=[]),Array.isArray(this.cell.stateSize)?this.states_=this.cell.stateSize.map((e=>wd([n,e]))):this.states_[0]=wd([n,this.cell.stateSize]);else{if(Array.isArray(e)||(e=[e]),e.length!==this.states_.length)throw new Qy(`Layer ${this.name} expects ${this.states_.length} state(s), but it received ${e.length} state value(s). Input received: ${e}`);!0===t?this.keptStates.push(this.states_.slice()):ko(this.states_);for(let t=0;tCo(e.clone())))}))}apply(e,t){let n=null==t?null:t.initialState,s=null==t?null:t.constants;null==t&&(t={});const r=AA(e,n,s,this.numConstants);e=r.inputs,n=r.initialState,s=r.constants;let a=[],i=[];if(null!=n){t.initialState=n,a=a.concat(n),this.stateSpec=[];for(const e of n)this.stateSpec.push(new Vw({shape:e.shape}));i=i.concat(this.stateSpec)}null!=s&&(t.constants=s,a=a.concat(s),this.numConstants=s.length);if(a[0]instanceof Ww){const n=[e].concat(a),s=this.inputSpec.concat(i),r=this.inputSpec;this.inputSpec=s;const o=super.apply(n,t);return this.inputSpec=r,o}return super.apply(e,t)}call(e,t){return Ao((()=>{const n=null==t?null:t.mask,s=null==t?null:t.training;let r=null==t?null:t.initialState;e=Dw(e),null==r&&(r=this.stateful?this.states_:this.getInitialState(e));const a=Array.isArray(this.cell.stateSize)?this.cell.stateSize.length:1;if(r.length!==a)throw new Qy(`RNN Layer has ${a} state(s) but was passed ${r.length} initial state(s).`);this.unroll;const i={training:s},o=kA(((e,t)=>{const n=this.cell.call([e].concat(t),i);return[n[0],n.slice(1)]}),e,r,this.goBackwards,n,null,this.unroll,this.returnSequences),l=o[0],u=o[1],c=o[2];this.stateful&&this.resetStates(c,s);const h=this.returnSequences?u:l;return this.returnState?[h].concat(c):h}))}getInitialState(e){return Ao((()=>{let t=wd(e.shape);return t=Dh(t,[1,2]),t=Kb(t),Array.isArray(this.cell.stateSize)?this.cell.stateSize.map((e=>e>1?ew(t,[1,e]):t)):this.cell.stateSize>1?[ew(t,[1,this.cell.stateSize])]:[t]}))}get trainableWeights(){return this.trainable?this.cell.trainableWeights:[]}get nonTrainableWeights(){return this.trainable?this.cell.nonTrainableWeights:this.cell.weights}setFastWeightInitDuringBuild(e){super.setFastWeightInitDuringBuild(e),null!=this.cell&&this.cell.setFastWeightInitDuringBuild(e)}getConfig(){const e=super.getConfig(),t={returnSequences:this.returnSequences,returnState:this.returnState,goBackwards:this.goBackwards,stateful:this.stateful,unroll:this.unroll};null!=this.numConstants&&(t.numConstants=this.numConstants);const n=this.cell.getConfig();return this.getClassName()===CA.className&&(t.cell={className:this.cell.getClassName(),config:n}),Object.assign(Object.assign(Object.assign({},n),e),t)}static fromConfig(e,t,n={}){const s=Av(t.cell,n);return new e(Object.assign(t,{cell:s}))}}CA.className="RNN",Hl(CA);class SA extends jw{}class EA extends SA{constructor(e){super(e),this.DEFAULT_ACTIVATION="tanh",this.DEFAULT_KERNEL_INITIALIZER="glorotNormal",this.DEFAULT_RECURRENT_INITIALIZER="orthogonal",this.DEFAULT_BIAS_INITIALIZER="zeros",this.units=e.units,bb(this.units,"units"),this.activation=Ux(null==e.activation?this.DEFAULT_ACTIVATION:e.activation),this.useBias=null==e.useBias||e.useBias,this.kernelInitializer=Nw(e.kernelInitializer||this.DEFAULT_KERNEL_INITIALIZER),this.recurrentInitializer=Nw(e.recurrentInitializer||this.DEFAULT_RECURRENT_INITIALIZER),this.biasInitializer=Nw(e.biasInitializer||this.DEFAULT_BIAS_INITIALIZER),this.kernelRegularizer=Xx(e.kernelRegularizer),this.recurrentRegularizer=Xx(e.recurrentRegularizer),this.biasRegularizer=Xx(e.biasRegularizer),this.kernelConstraint=cv(e.kernelConstraint),this.recurrentConstraint=cv(e.recurrentConstraint),this.biasConstraint=cv(e.biasConstraint),this.dropout=Ub([1,Gb([0,null==e.dropout?0:e.dropout])]),this.recurrentDropout=Ub([1,Gb([0,null==e.recurrentDropout?0:e.recurrentDropout])]),this.dropoutFunc=e.dropoutFunc,this.stateSize=this.units,this.dropoutMask=null,this.recurrentDropoutMask=null}build(e){e=Mw(e),this.kernel=this.addWeight("kernel",[e[e.length-1],this.units],null,this.kernelInitializer,this.kernelRegularizer,!0,this.kernelConstraint),this.recurrentKernel=this.addWeight("recurrent_kernel",[this.units,this.units],null,this.recurrentInitializer,this.recurrentRegularizer,!0,this.recurrentConstraint),this.useBias?this.bias=this.addWeight("bias",[this.units],null,this.biasInitializer,this.biasRegularizer,!0,this.biasConstraint):this.bias=null,this.built=!0}call(e,t){return Ao((()=>{if(2!==e.length)throw new Qy(`SimpleRNNCell expects 2 input Tensors, got ${e.length}.`);let n=e[1];e=e[0];const s=null!=t.training&&t.training;let r;0Nd(e),rate:this.dropout,training:s,dropoutFunc:this.dropoutFunc})),0Nd(n),rate:this.recurrentDropout,training:s,dropoutFunc:this.dropoutFunc}));const a=this.dropoutMask,i=this.recurrentDropoutMask;r=nw(null!=a?Bl(e,a):e,this.kernel.read()),null!=this.bias&&(r=iw(r,this.bias.read())),null!=i&&(n=Bl(n,i));let o=Dl(r,nw(n,this.recurrentKernel.read()));return null!=this.activation&&(o=this.activation.apply(o)),[o,o]}))}getConfig(){const e=super.getConfig(),t={units:this.units,activation:Vx(this.activation),useBias:this.useBias,kernelInitializer:Tw(this.kernelInitializer),recurrentInitializer:Tw(this.recurrentInitializer),biasInitializer:Tw(this.biasInitializer),kernelRegularizer:$x(this.kernelRegularizer),recurrentRegularizer:$x(this.recurrentRegularizer),biasRegularizer:$x(this.biasRegularizer),activityRegularizer:$x(this.activityRegularizer),kernelConstraint:lv(this.kernelConstraint),recurrentConstraint:lv(this.recurrentConstraint),biasConstraint:lv(this.biasConstraint),dropout:this.dropout,recurrentDropout:this.recurrentDropout};return Object.assign(Object.assign({},e),t)}}EA.className="SimpleRNNCell",Hl(EA);class _A extends CA{constructor(e){e.cell=new EA(e),super(e)}call(e,t){return Ao((()=>{null!=this.cell.dropoutMask&&(ko(this.cell.dropoutMask),this.cell.dropoutMask=null),null!=this.cell.recurrentDropoutMask&&(ko(this.cell.recurrentDropoutMask),this.cell.recurrentDropoutMask=null);const n=null==t?null:t.mask,s=null==t?null:t.training,r=null==t?null:t.initialState;return super.call(e,{mask:n,training:s,initialState:r})}))}static fromConfig(e,t){return new e(t)}}_A.className="SimpleRNN",Hl(_A);class IA extends SA{constructor(e){if(super(e),this.DEFAULT_ACTIVATION="tanh",this.DEFAULT_RECURRENT_ACTIVATION="hardSigmoid",this.DEFAULT_KERNEL_INITIALIZER="glorotNormal",this.DEFAULT_RECURRENT_INITIALIZER="orthogonal",this.DEFAULT_BIAS_INITIALIZER="zeros",e.resetAfter)throw new Qy("GRUCell does not support reset_after parameter set to true.");this.units=e.units,bb(this.units,"units"),this.activation=Ux(void 0===e.activation?this.DEFAULT_ACTIVATION:e.activation),this.recurrentActivation=Ux(void 0===e.recurrentActivation?this.DEFAULT_RECURRENT_ACTIVATION:e.recurrentActivation),this.useBias=null==e.useBias||e.useBias,this.kernelInitializer=Nw(e.kernelInitializer||this.DEFAULT_KERNEL_INITIALIZER),this.recurrentInitializer=Nw(e.recurrentInitializer||this.DEFAULT_RECURRENT_INITIALIZER),this.biasInitializer=Nw(e.biasInitializer||this.DEFAULT_BIAS_INITIALIZER),this.kernelRegularizer=Xx(e.kernelRegularizer),this.recurrentRegularizer=Xx(e.recurrentRegularizer),this.biasRegularizer=Xx(e.biasRegularizer),this.kernelConstraint=cv(e.kernelConstraint),this.recurrentConstraint=cv(e.recurrentConstraint),this.biasConstraint=cv(e.biasConstraint),this.dropout=Ub([1,Gb([0,null==e.dropout?0:e.dropout])]),this.recurrentDropout=Ub([1,Gb([0,null==e.recurrentDropout?0:e.recurrentDropout])]),this.dropoutFunc=e.dropoutFunc,this.implementation=e.implementation,this.stateSize=this.units,this.dropoutMask=null,this.recurrentDropoutMask=null}build(e){const t=(e=Mw(e))[e.length-1];this.kernel=this.addWeight("kernel",[t,3*this.units],null,this.kernelInitializer,this.kernelRegularizer,!0,this.kernelConstraint),this.recurrentKernel=this.addWeight("recurrent_kernel",[this.units,3*this.units],null,this.recurrentInitializer,this.recurrentRegularizer,!0,this.recurrentConstraint),this.useBias?this.bias=this.addWeight("bias",[3*this.units],null,this.biasInitializer,this.biasRegularizer,!0,this.biasConstraint):this.bias=null,this.built=!0}call(e,t){return Ao((()=>{if(2!==e.length)throw new Qy(`GRUCell expects 2 input Tensors (inputs, h, c), got ${e.length}.`);const n=null!=t.training&&t.training;let s=e[1];e=e[0],0Nd(e),rate:this.dropout,training:n,count:3,dropoutFunc:this.dropoutFunc})),0Nd(s),rate:this.recurrentDropout,training:n,count:3,dropoutFunc:this.dropoutFunc}));const r=this.dropoutMask,a=this.recurrentDropoutMask;let i,o,l;0{null!=this.cell.dropoutMask&&(ko(this.cell.dropoutMask),this.cell.dropoutMask=null),null!=this.cell.recurrentDropoutMask&&(ko(this.cell.recurrentDropoutMask),this.cell.recurrentDropoutMask=null);const n=null==t?null:t.mask,s=null==t?null:t.training,r=null==t?null:t.initialState;return super.call(e,{mask:n,training:s,initialState:r})}))}static fromConfig(e,t){return 0===t.implmentation&&(t.implementation=1),new e(t)}}TA.className="GRU",Hl(TA);class NA extends SA{constructor(e){super(e),this.DEFAULT_ACTIVATION="tanh",this.DEFAULT_RECURRENT_ACTIVATION="hardSigmoid",this.DEFAULT_KERNEL_INITIALIZER="glorotNormal",this.DEFAULT_RECURRENT_INITIALIZER="orthogonal",this.DEFAULT_BIAS_INITIALIZER="zeros",this.units=e.units,bb(this.units,"units"),this.activation=Ux(void 0===e.activation?this.DEFAULT_ACTIVATION:e.activation),this.recurrentActivation=Ux(void 0===e.recurrentActivation?this.DEFAULT_RECURRENT_ACTIVATION:e.recurrentActivation),this.useBias=null==e.useBias||e.useBias,this.kernelInitializer=Nw(e.kernelInitializer||this.DEFAULT_KERNEL_INITIALIZER),this.recurrentInitializer=Nw(e.recurrentInitializer||this.DEFAULT_RECURRENT_INITIALIZER),this.biasInitializer=Nw(e.biasInitializer||this.DEFAULT_BIAS_INITIALIZER),this.unitForgetBias=e.unitForgetBias,this.kernelRegularizer=Xx(e.kernelRegularizer),this.recurrentRegularizer=Xx(e.recurrentRegularizer),this.biasRegularizer=Xx(e.biasRegularizer),this.kernelConstraint=cv(e.kernelConstraint),this.recurrentConstraint=cv(e.recurrentConstraint),this.biasConstraint=cv(e.biasConstraint),this.dropout=Ub([1,Gb([0,null==e.dropout?0:e.dropout])]),this.recurrentDropout=Ub([1,Gb([0,null==e.recurrentDropout?0:e.recurrentDropout])]),this.dropoutFunc=e.dropoutFunc,this.implementation=e.implementation,this.stateSize=[this.units,this.units],this.dropoutMask=null,this.recurrentDropoutMask=null}build(e){var t;const n=(e=Mw(e))[e.length-1];let s;if(this.kernel=this.addWeight("kernel",[n,4*this.units],null,this.kernelInitializer,this.kernelRegularizer,!0,this.kernelConstraint),this.recurrentKernel=this.addWeight("recurrent_kernel",[this.units,4*this.units],null,this.recurrentInitializer,this.recurrentRegularizer,!0,this.recurrentConstraint),this.useBias){if(this.unitForgetBias){const e=this.biasInitializer,n=this.units;s=new((t=class extends hw{apply(t,s){const r=e.apply([n]),a=(new pw).apply([n]),i=e.apply([2*n]);return Jb(Jb(r,a),i)}}).className="CustomInit",t)}else s=this.biasInitializer;this.bias=this.addWeight("bias",[4*this.units],null,s,this.biasRegularizer,!0,this.biasConstraint)}else this.bias=null;this.built=!0}call(e,t){return Ao((()=>{const n=null!=t.training&&t.training;if(3!==e.length)throw new Qy(`LSTMCell expects 3 input Tensors (inputs, h, c), got ${e.length}.`);let s=e[1];const r=e[2];e=e[0],0Nd(e),rate:this.dropout,training:n,count:4,dropoutFunc:this.dropoutFunc})),0Nd(s),rate:this.recurrentDropout,training:n,count:4,dropoutFunc:this.dropoutFunc}));const a=this.dropoutMask,i=this.recurrentDropoutMask;let o,l,u,c;0{null!=this.cell.dropoutMask&&(ko(this.cell.dropoutMask),this.cell.dropoutMask=null),null!=this.cell.recurrentDropoutMask&&(ko(this.cell.recurrentDropoutMask),this.cell.recurrentDropoutMask=null);const n=null==t?null:t.mask,s=null==t?null:t.training,r=null==t?null:t.initialState;return super.call(e,{mask:n,training:s,initialState:r})}))}static fromConfig(e,t){return 0===t.implmentation&&(t.implementation=1),new e(t)}}OA.className="LSTM",Hl(OA);class RA extends SA{constructor(e){super(e),this.cells=e.cells}get stateSize(){const e=[];for(const t of this.cells.slice().reverse())Array.isArray(t.stateSize)?e.push(...t.stateSize):e.push(t.stateSize);return e}call(e,t){return Ao((()=>{let n=e.slice(1);const s=[];for(const e of this.cells.slice().reverse())Array.isArray(e.stateSize)?s.push(n.splice(0,e.stateSize.length)):s.push(n.splice(0,1));s.reverse();const r=[];let a;for(let i=0;i{Bb(`RNNCell_${s}`,(()=>{n.build(e),t=Array.isArray(n.stateSize)?n.stateSize[0]:n.stateSize,e=[e[0],t]}))})),this.built=!0}getConfig(){const e=super.getConfig(),t={cells:this.cells.map((e=>({className:e.getClassName(),config:e.getConfig()})))};return Object.assign(Object.assign({},e),t)}static fromConfig(e,t,n={}){const s=[];for(const e of t.cells)s.push(Av(e,n));return new e({cells:s})}get trainableWeights(){if(!this.trainable)return[];const e=[];for(const t of this.cells)e.push(...t.trainableWeights);return e}get nonTrainableWeights(){const e=[];for(const t of this.cells)e.push(...t.nonTrainableWeights);if(!this.trainable){const t=[];for(const e of this.cells)t.push(...e.trainableWeights);return t.concat(e)}return e}getWeights(){const e=[];for(const t of this.cells)e.push(...t.weights);return Lw(e)}setWeights(e){const t=[];for(const n of this.cells){const s=n.weights.length,r=e.splice(s);for(let e=0;enull!=a?a(t(),n):ow(t(),n),o=()=>lw(i,t,s);if(!r||r<=1)return Co(o().clone());return Array(r).fill(void 0).map(o).map((e=>Co(e.clone())))}RA.className="StackedRNNCells",Hl(RA);var MA=function(e,t){var n={};for(var s in e)Object.prototype.hasOwnProperty.call(e,s)&&t.indexOf(s)<0&&(n[s]=e[s]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(s=Object.getOwnPropertySymbols(e);r{if(null!=this.cell.dropoutMask&&(ko(this.cell.dropoutMask),this.cell.dropoutMask=null),null!=this.cell.recurrentDropoutMask&&(ko(this.cell.recurrentDropoutMask),this.cell.recurrentDropoutMask=null),t&&t.constants)throw new Qy("ConvRNN2D cell does not support constants");const n=null==t?null:t.mask,s=null==t?null:t.training,r=null==t?null:t.initialState;return super.call(e,{mask:n,training:s,initialState:r})}))}computeOutputShape(e){let t=this.computeSingleOutputShape(e);return this.returnSequences||(t=[t[0],...t.slice(2)]),this.returnState&&(t=[t,...Array(2).fill([e[0],...t.slice(-3)])]),t}getInitialState(e){return Ao((()=>{const{stateSize:t}=this.cell,n=e.shape,s=this.computeSingleOutputShape(n),r=wd([s[0],...s.slice(2)]);return Array.isArray(t)?Array(t.length).fill(r):[r]}))}resetStates(e,t=!1){Ao((()=>{if(!this.stateful)throw new Zy("Cannot call resetStates() on an RNN Layer that is not stateful.");const n=this.inputSpec[0].shape,s=this.computeSingleOutputShape(n),r=[s[0],...s.slice(2)];if(null==n[0])throw new Qy("If an RNN is stateful, it needs to know its batch size. Specify the batch size of your input tensors: \n- If using a Sequential model, specify the batch size by passing a `batchInputShape` option to your first layer.\n- If using the functional API, specify the batch size by passing a `batchShape` option to your Input layer.");if(null==this.getStates())Array.isArray(this.cell.stateSize)?this.states_=this.cell.stateSize.map((()=>wd(r))):this.states_=[wd(r)];else if(null==e)ko(this.states_),null!=this.keptStates&&(ko(this.keptStates),this.keptStates=[]),Array.isArray(this.cell.stateSize)?this.states_=this.cell.stateSize.map((()=>wd(r))):this.states_[0]=wd(r);else{if(Array.isArray(e)||(e=[e]),e.length!==this.states_.length)throw new Qy(`Layer ${this.name} expects ${this.states_.length} state(s), but it received ${e.length} state value(s). Input received: ${e}`);t?this.keptStates.push(this.states_.slice()):ko(this.states_);for(let t=0;tCo(e.clone())))}))}computeSingleOutputShape(e){const{dataFormat:t,filters:n,kernelSize:s,padding:r,strides:a,dilationRate:i}=this.cell,o="channelsFirst"===t,l=e[o?3:2],u=e[o?4:3],c=sA(l,s[0],r,a[0],i[0]),h=sA(u,s[1],r,a[1],i[1]);return[...e.slice(0,2),...o?[n,c,h]:[c,h,n]]}}FA.className="ConvRNN2D";class BA extends NA{constructor(e){const{filters:t,kernelSize:n,strides:s,padding:r,dataFormat:a,dilationRate:i}=e;super(Object.assign(Object.assign({},e),{units:t})),this.filters=t,bb(this.filters,"filters"),this.kernelSize=nA(n,2,"kernelSize"),this.kernelSize.forEach((e=>bb(e,"kernelSize"))),this.strides=nA(s||1,2,"strides"),this.strides.forEach((e=>bb(e,"strides"))),this.padding=r||"valid",Rb(this.padding),this.dataFormat=a||"channelsLast",Ob(this.dataFormat),this.dilationRate=nA(i||1,2,"dilationRate"),this.dilationRate.forEach((e=>bb(e,"dilationRate")))}build(e){var t;e=Mw(e);const n="channelsFirst"===this.dataFormat?1:e.length-1;if(null==e[n])throw new Qy(`The channel dimension of the input should be defined. Found ${e[n]}`);const s=e[n],r=this.kernelSize.concat([s,4*this.filters]);this.kernel=this.addWeight("kernel",r,null,this.kernelInitializer,this.kernelRegularizer,!0,this.kernelConstraint);const a=this.kernelSize.concat([this.filters,4*this.filters]);if(this.recurrentKernel=this.addWeight("recurrent_kernel",a,null,this.recurrentInitializer,this.recurrentRegularizer,!0,this.recurrentConstraint),this.useBias){let e;if(this.unitForgetBias){const n=this.biasInitializer,s=this.filters;e=new((t=class extends hw{apply(e,t){return Qb([n.apply([s]),vd([s]),n.apply([2*s])])}}).className="CustomInit",t)}else e=this.biasInitializer;this.bias=this.addWeight("bias",[4*this.filters],null,e,this.biasRegularizer,!0,this.biasConstraint)}this.built=!0}call(e,t){return Ao((()=>{if(3!==e.length)throw new Qy(`ConvLSTM2DCell expects 3 input Tensors (inputs, h, c), got ${e.length}.`);const n=t.training||!1,s=e[0],r=e[1],a=e[2];0Nd(s),rate:this.dropout,training:n,count:4,dropoutFunc:this.dropoutFunc}));const i=this.dropoutMask,o=(e,t,n)=>t&&t[n]?Bl(t[n],e):e;let l=o(s,i,0),u=o(s,i,1),c=o(s,i,2),h=o(s,i,3);0Nd(r),rate:this.recurrentDropout,training:n,count:4,dropoutFunc:this.dropoutFunc}));const d=this.recurrentDropoutMask;let p=o(r,d,0),f=o(r,d,1),m=o(r,d,2),g=o(r,d,3);const[y,b,w,v]=Ep(this.kernel.read(),4,3),[x,A,k,C]=this.useBias?Ep(this.bias.read(),4):[null,null,null,null];l=this.inputConv(l,y,x,this.padding),u=this.inputConv(u,b,A,this.padding),c=this.inputConv(c,w,k,this.padding),h=this.inputConv(h,v,C,this.padding);const[S,E,_,I]=Ep(this.recurrentKernel.read(),4,3);p=this.recurrentConv(p,S),f=this.recurrentConv(f,E),m=this.recurrentConv(m,_),g=this.recurrentConv(g,I);const T=this.recurrentActivation.apply(Dl(l,p)),N=this.recurrentActivation.apply(Dl(u,f)),O=Dl(Bl(N,a),Bl(T,this.activation.apply(Dl(c,m)))),R=Bl(this.recurrentActivation.apply(Dl(h,g)),this.activation.apply(O));return[R,R,O]}))}getConfig(){const e=super.getConfig(),{units:t}=e,n=MA(e,["units"]),s={filters:this.filters,kernelSize:this.kernelSize,padding:this.padding,dataFormat:this.dataFormat,dilationRate:this.dilationRate,strides:this.strides};return Object.assign(Object.assign({},n),s)}inputConv(e,t,n,s){const r=Jc(e,t,this.strides,s||"valid","channelsFirst"===this.dataFormat?"NCHW":"NHWC",this.dilationRate);return n?iw(r,n,this.dataFormat):r}recurrentConv(e,t){return Jc(e,t,1,"same","channelsFirst"===this.dataFormat?"NCHW":"NHWC")}}BA.className="ConvLSTM2DCell",Hl(BA);class zA extends FA{constructor(e){const t=new BA(e);super(Object.assign(Object.assign({},e),{cell:t}))}static fromConfig(e,t){return new e(t)}}zA.className="ConvLSTM2D",Hl(zA);class LA extends jw{constructor(e){super(e),this.rate=Math.max(Math.min(e.rate,1),0),this.noiseShape=e.noiseShape,this.seed=e.seed,this.supportsMasking=!0}getNoiseShape(e){if(null==this.noiseShape)return this.noiseShape;const t=e.shape,n=[];for(let e=0;e{this.invokeCallHook(e,t);const n=Dw(e);if(0ow(n,this.rate,s,this.seed)),(()=>n),e)}return e}))}getConfig(){const e={rate:this.rate,noiseShape:this.noiseShape,seed:this.seed},t=super.getConfig();return Object.assign(e,t),e}dispose(){return super.dispose()}}LA.className="Dropout",Hl(LA);class PA extends LA{constructor(e){super(e),this.inputSpec=[{ndim:3}]}getNoiseShape(e){const t=e.shape;return[t[0],1,t[2]]}}PA.className="SpatialDropout1D",Hl(PA);class VA extends jw{constructor(e){if(super(e),this.activation=null,this.useBias=!0,this.kernel=null,this.bias=null,this.DEFAULT_KERNEL_INITIALIZER="glorotNormal",this.DEFAULT_BIAS_INITIALIZER="zeros",null==e.batchInputShape&&null==e.inputShape&&null!=e.inputDim){let t=null;null!=e.batchSize&&(t=e.batchSize),this.batchInputShape=[t,e.inputDim]}this.units=e.units,bb(this.units,"units"),this.activation=Ux(e.activation),null!=e.useBias&&(this.useBias=e.useBias),this.kernelInitializer=Nw(e.kernelInitializer||this.DEFAULT_KERNEL_INITIALIZER),this.biasInitializer=Nw(e.biasInitializer||this.DEFAULT_BIAS_INITIALIZER),this.kernelConstraint=cv(e.kernelConstraint),this.biasConstraint=cv(e.biasConstraint),this.kernelRegularizer=Xx(e.kernelRegularizer),this.biasRegularizer=Xx(e.biasRegularizer),this.activityRegularizer=Xx(e.activityRegularizer),this.supportsMasking=!0,this.inputSpec=[{minNDim:2}]}build(e){const t=(e=Mw(e))[e.length-1];null==this.kernel&&(this.kernel=this.addWeight("kernel",[t,this.units],null,this.kernelInitializer,this.kernelRegularizer,!0,this.kernelConstraint),this.useBias&&(this.bias=this.addWeight("bias",[this.units],null,this.biasInitializer,this.biasRegularizer,!0,this.biasConstraint))),this.inputSpec=[{minNDim:2,axes:{[-1]:t}}],this.built=!0}computeOutputShape(e){const t=(e=Mw(e)).slice();return t[t.length-1]=this.units,t}call(e,t){return Ao((()=>{this.invokeCallHook(e,t);const n=Dw(e),s=vb(this.activation.getClassName());let r;return null!=s?r=nw(n,this.kernel.read(),s,this.bias?this.bias.read():null):(r=nw(n,this.kernel.read()),null!=this.bias&&(r=iw(r,this.bias.read())),null!=this.activation&&(r=this.activation.apply(r))),r}))}getConfig(){const e={units:this.units,activation:Vx(this.activation),useBias:this.useBias,kernelInitializer:Tw(this.kernelInitializer),biasInitializer:Tw(this.biasInitializer),kernelRegularizer:$x(this.kernelRegularizer),biasRegularizer:$x(this.biasRegularizer),activityRegularizer:$x(this.activityRegularizer),kernelConstraint:lv(this.kernelConstraint),biasConstraint:lv(this.biasConstraint)},t=super.getConfig();return Object.assign(e,t),e}}VA.className="Dense",Hl(VA);class WA extends jw{constructor(e){super(e=e||{}),this.inputSpec=[{minNDim:3}],this.dataFormat=e.dataFormat}computeOutputShape(e){e=Mw(e);for(const t of e.slice(1))if(null==t)throw new Qy(`The shape of the input to "Flatten" is not fully defined (got ${e.slice(1)}). Make sure to pass a complete "input_shape" or "batch_input_shape" argument to the first layer in your model.`);return[e[0],Wb(e,1)]}call(e,t){return Ao((()=>{this.invokeCallHook(e,t);let n=Dw(e);if("channelsFirst"===this.dataFormat&&n.rank>1){const e=[0];for(let t=2;t{this.invokeCallHook(e,t);const n=Dw(e);return this.activation.apply(n)}))}getConfig(){const e={activation:Vx(this.activation)},t=super.getConfig();return Object.assign(e,t),e}}UA.className="Activation",Hl(UA);class GA extends jw{constructor(e){super(e),this.n=e.n,this.inputSpec=[{ndim:2}]}computeOutputShape(e){return[e[0],this.n,e[1]]}call(e,t){return Ao((()=>{return e=Dw(e),t=e,n=this.n,Ao((()=>{if(2!==t.shape.length)throw new Qy(`repeat() expects a rank-2 tensor, but received a rank-${t.shape.length} tensor.`);return ew(Kb(t,1),[1,n,1])}));var t,n}))}getConfig(){const e={n:this.n},t=super.getConfig();return Object.assign(e,t),e}}GA.className="RepeatVector",Hl(GA);class qA extends jw{constructor(e){super(e),this.targetShape=e.targetShape;for(let e=0;e{this.invokeCallHook(e,t);const n=Dw(e),s=n.shape,r=s.slice(0,1).concat(this.fixUnknownDimension(s.slice(1),this.targetShape));return Tc(n,r)}))}getConfig(){const e={targetShape:this.targetShape},t=super.getConfig();return Object.assign(e,t),e}}qA.className="Reshape",Hl(qA);class jA extends jw{constructor(e){if(super(e),null==e.dims)throw new Error("Required configuration field `dims` is missing during Permute constructor call.");if(!Array.isArray(e.dims))throw new Error(`Permute constructor requires \`dims\` to be an Array, but received ${e.dims} instead.`);const t=qb(1,e.dims.length+1);if(!Kt(e.dims.slice().sort(),t))throw new Error("Invalid permutation `dims`: "+JSON.stringify(e.dims)+" `dims` must contain consecutive integers starting from 1.");this.dims=e.dims,this.dimsIncludingBatch=[0].concat(this.dims),this.inputSpec=[new Vw({ndim:this.dims.length+1})]}computeOutputShape(e){const t=(e=Mw(e)).slice();return this.dims.forEach(((n,s)=>{t[s+1]=e[n]})),t}call(e,t){return Jp(Dw(e),this.dimsIncludingBatch)}getConfig(){const e={dims:this.dims},t=super.getConfig();return Object.assign(e,t),e}}jA.className="Permute",Hl(jA);class HA extends jw{constructor(e){super(null==e?{}:e),this.supportsMasking=!0,this.maskValue=null!=e?null==e.maskValue?0:e.maskValue:0}computeOutputShape(e){return e}getConfig(){const e=super.getConfig(),t={maskValue:this.maskValue};return Object.assign(t,e),t}computeMask(e,t){const n=Dw(e);return ic(Id(n,this.maskValue),-1)}call(e,t){return Ao((()=>{this.invokeCallHook(e,t);const n=Dw(e),s=ic(Id(n,this.maskValue),-1,!0);return Bl(n,Nl(s,n.dtype))}))}}HA.className="Masking",Hl(HA);class $A extends jw{constructor(e){if(super(e),this.embeddings=null,this.DEFAULT_EMBEDDINGS_INITIALIZER="randomUniform",null==e.batchInputShape&&null==e.inputShape){let t=null;null!=e.batchSize&&(t=e.batchSize),null==e.inputLength?this.batchInputShape=[t,null]:this.batchInputShape=[t].concat(ib(e.inputLength))}this.inputDim=e.inputDim,bb(this.inputDim,"inputDim"),this.outputDim=e.outputDim,bb(this.outputDim,"outputDim"),this.embeddingsInitializer=Nw(e.embeddingsInitializer||this.DEFAULT_EMBEDDINGS_INITIALIZER),this.embeddingsRegularizer=Xx(e.embeddingsRegularizer),this.activityRegularizer=Xx(e.activityRegularizer),this.embeddingsConstraint=cv(e.embeddingsConstraint),this.maskZero=e.maskZero,this.supportsMasking=e.maskZero,this.inputLength=e.inputLength}build(e){this.embeddings=this.addWeight("embeddings",[this.inputDim,this.outputDim],this.dtype,this.embeddingsInitializer,this.embeddingsRegularizer,!0,this.embeddingsConstraint),this.built=!0}warnOnIncompatibleInputShape(e){}computeMask(e,t){return Ao((()=>this.maskZero?(e=Dw(e),Id(e,Pl(e))):null))}computeOutputShape(e){if(e=Mw(e),null==this.inputLength)return[...e,this.outputDim];const t=ib(this.inputLength);if(t.length!==e.length-1)throw new Qy(`"inputLength" is ${this.inputLength}, but received input shape has shape ${e}`);{let n=0;for(let s=0;s{this.invokeCallHook(e,t);let n=Dw(e);"int32"!==n.dtype&&(n=$b(n,"int32"));const s=sw(this.embeddings.read(),Tc(n,[n.size]));return Tc(s,Mw(this.computeOutputShape(n.shape)))}))}getConfig(){const e={inputDim:this.inputDim,outputDim:this.outputDim,embeddingsInitializer:Tw(this.embeddingsInitializer),embeddingsRegularizer:$x(this.embeddingsRegularizer),activityRegularizer:$x(this.activityRegularizer),embeddingsConstraint:lv(this.embeddingsConstraint),maskZero:this.maskZero,inputLength:this.inputLength},t=super.getConfig();return Object.assign(e,t),e}}$A.className="Embedding",Hl($A);class KA extends jw{constructor(e){super(e||{}),this.supportsMasking=!0}mergeFunction(e){throw new Jy}computeElementwiseOpOutputShape(e,t){if(null==e||null==t)return null;if(e.length1)throw new Qy(`Can not merge tensors with different batch sizes. Got tensors with shapes: ${JSON.stringify(e)}.`);let n=null==e[0]?null:e[0].slice(1);for(let t=1;te.length));-1===e.indexOf(null)&&1===fb(s).length?this.reshapeRequired=!1:this.reshapeRequired=!0}call(e,t){return Ao((()=>{if(this.reshapeRequired){const t=[],n=e.map((e=>e.rank));if(-1===n.indexOf(null)){const s=Gb(n);for(let n of e){const e=n.rank;for(let t=0;t1){const r=qb(1,e).concat([0]);t.push(Jp(s,r)),n=!0}else t.push(s)}let s=this.mergeFunction(t);const r=s.rank;if(n)if(null==r){const e=s.shape,t=e[e.length-1],n=[t].concat(e.slice(0,e.length-1));s=Tc(Jp(Tc(s,[-1,t]),[1,0]),n)}else if(r>1){const e=[r-1].concat(qb(0,r-1));s=Jp(s,e)}return s}}return this.mergeFunction(e)}))}computeOutputShape(e){let t;t=null==e[0]?null:e[0].slice(1);for(let n=1;n{if(null==t)return null;if(!Array.isArray(t))throw new Qy("`mask` should be an Array");if(!Array.isArray(e))throw new Qy("`inputs` should be an Array");if(t.length!==e.length)throw new Qy(`The Array 'inputs' and 'mask' are expected to have the same length, but have different lengths (${e.length} vs ${t.length})`);if(t.every((e=>null==e)))return null;let n=(t=t.map((e=>null==e?e:Lh(e,0))))[0];for(let e=1;e{let t=e[0].clone();for(let n=1;n{let t=e[0].clone();for(let n=1;n{let t=e[0].clone();for(let n=1;n{let t=e[0];for(let n=1;n{let t=e[0];for(let n=1;n1)throw new Qy("A `Concatenate` layer requires inputs with matching shapes except for the concat axis. Got input shapes: "+JSON.stringify(e))}mergeFunction(e){return Ao((()=>Qb(e,this.axis)))}computeOutputShape(e){if(!Array.isArray(e)||!Array.isArray(e[0]))throw new Qy("A `Concatenate` layer should be called on a list of inputs.");const t=e,n=t[0].slice(),s=this.axis<0?n.length+this.axis:this.axis;for(const e of t.slice(1)){if(null==n[s]||null==e[s]){n[s]=null;break}n[s]+=e[s]}return n}computeMask(e,t){if(null==t)return null;if(!Array.isArray(t))throw new Qy("`mask` should be an array for Concatenate");if(!Array.isArray(e))throw new Qy("`inputs` should be an array for Concatenate");if(t.length!==e.length)throw new Qy(`Mismatch in the length of mask (${t.length}) and the legnth of inputs (${e.length})`);return Ao((()=>{let n=!0;if(t.forEach((e=>{null==e||(n=!1)})),n)return null;const s=[];for(let n=0;n"A `Dot` layer should be called on a list of exactly 2 inputs."));const t=e[0],n=e[1];if(t.length>3||n.length>3)throw new Jy("Dot layer does not support tensors of 4D or higher rank yet.");const s=this.interpretAxes(t,n);if(t[s[0]]!==n[s[1]])throw new Qy(`Dimension incompatibility: ${t[s[0]]} !== ${n[s[1]]}`)}mergeFunction(e){if(2!==e.length)throw new Qy(`A \`Dot\` layer must be called on exactly 2 inputs, but received ${e.length} input(s).`);let t,n=e[0],s=e[1];return t=Array.isArray(this.axes)?this.axes.map(((t,n)=>tk(t,e[n].shape.length))):[tk(this.axes,n.shape.length),tk(this.axes,s.shape.length)],this.normalize&&(n=kv(n,t[0]),s=kv(s,t[1])),function(e,t,n){if(e.shape.length>3||t.shape.length>3)throw new Jy("batchDot is not implemented for tensors of 4D or higher rank yet");if(qt(e.shape.length>=2,(()=>`batchDot requires the rank of x to be >= 2, but got ${e.shape.length}`)),qt(e.shape.length>=2,(()=>`batchDot requires the rank of y to be >= 2, but got ${t.shape.length}`)),"number"==typeof n&&(n=[n,n]),"complex64"===e.dtype||"complex64"===t.dtype)throw new Jy("batchDot is not implemented for complex64-type Tensors yet.");const s=e.shape.length,r=t.shape.length;null==n&&(n=[s-1,r-2]);const a=n;return Ao((()=>{let n,i;if(s>r){n=s-r;const e=[];for(let t=0;ts){n=r-s;const t=[];for(let e=0;e0){let e;e=s>r?s+r-3:s-1;const t=[];for(let s=e;s"A `Dot` layer should be called on a list of exactly 2 inputs."));const t=e[0].slice(),n=e[1].slice();if(t.length>3||n.length>3)throw new Jy("Dot layer does not support tensors of 4D or higher rank yet.");const s=this.interpretAxes(t,n);t.splice(s[0],1),n.splice(s[1],1),n.splice(0,1);const r=t.concat(n);return 1===r.length&&r.push(1),r}computeMask(e,t){return null}getConfig(){const e={axes:this.axes,normalize:this.normalize},t=super.getConfig();return Object.assign(e,t),e}}nk.className="Dot",Hl(nk);class sk extends jw{constructor(e){super(e),this.supportsMasking=!0,this.stddev=e.stddev}computeOutputShape(e){return e}getConfig(){const e=super.getConfig(),t={stddev:this.stddev};return Object.assign(t,e),t}call(e,t){return Ao((()=>{this.invokeCallHook(e,t);const n=Dw(e);return lw((()=>Dl(tw(n.shape,0,this.stddev),n)),(()=>n),t.training||!1)}))}}sk.className="GaussianNoise",Hl(sk);class rk extends jw{constructor(e){super(e),this.supportsMasking=!0,this.rate=e.rate}computeOutputShape(e){return e}getConfig(){const e=super.getConfig(),t={rate:this.rate};return Object.assign(t,e),t}call(e,t){return Ao((()=>{this.invokeCallHook(e,t);const n=Dw(e);if(this.rate>0&&this.rate<1){return lw((()=>{const e=Math.sqrt(this.rate/(1-this.rate));return Bl(n,tw(n.shape,1,e))}),(()=>n),t.training||!1)}return n}))}}rk.className="GaussianDropout",Hl(rk);class ak extends jw{constructor(e){super(e),this.supportsMasking=!0,this.rate=e.rate,this.noiseShape=e.noiseShape}_getNoiseShape(e){return this.noiseShape||Dw(e).shape}computeOutputShape(e){return e}getConfig(){const e=super.getConfig(),t={rate:this.rate};return Object.assign(t,e),t}call(e,t){return Ao((()=>{if(this.rate<1&&this.rate>0){const n=this._getNoiseShape(e),s=()=>{const t=Dw(e),s=-1.7580993408473766;let r=jh(Qd(n),this.rate);r=$b(r,"float32");const a=((1-this.rate)*(1+this.rate*s**2))**-.5,i=-a*s*this.rate,o=Dl(Bl(t,r),Bl(Dl(r,-1),s));return Dl(Bl(o,a),i)};return lw(s,(()=>Dw(e)),t.training||!1)}return e}))}}function ik(e,t,n,s,r,a=.001){let i;if(2===e.rank)i=Vc(e,t,n,s,r,a);else if(3===e.rank)i=Wc(e,t,n,s,r,a);else{if(4!==e.rank)throw new Jy(`batchNormalization is not implemented for array of rank ${e.rank} yet`);i=Uc(e,t,n,s,r,a)}return i}function ok(e,t,n,s,r=.001){return Kt(s.slice().sort(),qb(0,e.rank-1))?function(e,t,n,s,r=.001){return Ao((()=>{const a=Sd(e,s),i=a.mean,o=a.variance;return[ik(e,i,o,n,t,r),i,o]}))}(e,t,n,s,r):function(e,t,n,s,r=.001){return Ao((()=>{const a=Sd(e,s),i=a.mean,o=a.variance,l=[];for(const t of qb(0,e.rank))-1!==s.indexOf(t)?l.push(1):l.push(e.shape[t]);const u=Tc(i,l),c=Tc(o,l),h=null==t?null:Tc(t,l),d=null==n?null:Tc(n,l);return[ik(e,u,c,d,h,r),i,o]}))}(e,t,n,s,r)}ak.className="AlphaDropout",Hl(ak);class lk extends jw{constructor(e){null==e&&(e={}),super(e),this.supportsMasking=!0,this.axis=null==e.axis?-1:e.axis,this.momentum=null==e.momentum?.99:e.momentum,this.epsilon=null==e.epsilon?.001:e.epsilon,this.center=null==e.center||e.center,this.scale=null==e.scale||e.scale,this.betaInitializer=Nw(e.betaInitializer||"zeros"),this.gammaInitializer=Nw(e.gammaInitializer||"ones"),this.movingMeanInitializer=Nw(e.movingMeanInitializer||"zeros"),this.movingVarianceInitializer=Nw(e.movingVarianceInitializer||"ones"),this.betaConstraint=cv(e.betaConstraint),this.gammaConstraint=cv(e.gammaConstraint),this.betaRegularizer=Xx(e.betaRegularizer),this.gammaRegularizer=Xx(e.gammaRegularizer)}build(e){e=Mw(e);const t=this.axis>=0?this.axis:this.axis+e.length,n=e[t];if(null==n)throw new Qy(`Axis ${t} of input tensor should have a defined dimension but the layer received an input with shape ${JSON.stringify(e)}.`);this.inputSpec=[new Vw({ndim:e.length,axes:{[t]:n}})];const s=[n];this.scale&&(this.gamma=this.addWeight("gamma",s,null,this.gammaInitializer,this.gammaRegularizer,!0,this.gammaConstraint)),this.center&&(this.beta=this.addWeight("beta",s,null,this.betaInitializer,this.betaRegularizer,!0,this.betaConstraint)),this.movingMean=this.addWeight("moving_mean",s,null,this.movingMeanInitializer,null,!1),this.movingVariance=this.addWeight("moving_variance",s,null,this.movingVarianceInitializer,null,!1),this.built=!0}call(e,t){return Ao((()=>{const n=null!=t.training&&t.training,s=Dw(e),r=s.shape,a=r.length,i=qb(0,a),o=this.axis>=0?this.axis:this.axis+a;i.splice(o,1);const l=nb(1,a);l[o]=r[o];const u=i.slice();u.sort();const c=!Kt(u,qb(0,a).slice(0,a-1));if(!n)return(()=>{if(c){const e=Tc(this.movingMean.read(),l),t=Tc(this.movingVariance.read(),l),n=this.center?Tc(this.beta.read(),l):null,r=this.scale?Tc(this.gamma.read(),l):null;return ik(s,e,t,n,r,this.epsilon)}return ik(s,this.movingMean.read(),this.movingVariance.read(),null==this.beta?null:this.beta.read(),null==this.gamma?null:this.gamma.read(),this.epsilon)})();const[h,d,p]=ok(s,this.gamma.read(),this.beta.read(),i,this.epsilon),f=(e,t,n)=>{Ao((()=>{const s=1-n,r=e.read(),a=Bl(Ql(r,t),s);e.write(Ql(r,a))}))};return(()=>{f(this.movingMean,d,this.momentum),f(this.movingVariance,p,this.momentum)})(),h}))}getConfig(){const e={axis:this.axis,momentum:this.momentum,epsilon:this.epsilon,center:this.center,scale:this.scale,betaInitializer:Tw(this.betaInitializer),gammaInitializer:Tw(this.gammaInitializer),movingMeanInitializer:Tw(this.movingMeanInitializer),movingVarianceInitializer:Tw(this.movingVarianceInitializer),betaRegularizer:$x(this.betaRegularizer),gammaRegularizer:$x(this.gammaRegularizer),betaConstraint:lv(this.betaConstraint),gammaConstraint:lv(this.gammaConstraint)},t=super.getConfig();return Object.assign(e,t),e}}lk.className="BatchNormalization",Hl(lk);class uk extends jw{constructor(e){if(null==e&&(e={}),super(e),this.axis=null==e.axis?-1:e.axis,"number"==typeof this.axis){if(!Number.isInteger(this.axis))throw new Error(`Expected axis to be an integer, but received ${this.axis}`)}else{if(!Array.isArray(this.axis))throw new Error(`Expected axis to be an integer or an array of integers, but received ${JSON.stringify(this.axis)}`);for(const e of this.axis)if(!Number.isInteger(e))throw new Error(`Expected axis to be an array of integers, but received ${JSON.stringify(this.axis)}`)}this.epsilon=null==e.epsilon?.001:e.epsilon,this.center=null==e.center||e.center,this.scale=null==e.scale||e.scale,this.betaInitializer=Nw(e.betaInitializer||"zeros"),this.gammaInitializer=Nw(e.gammaInitializer||"ones"),this.betaRegularizer=Xx(e.betaRegularizer),this.gammaRegularizer=Xx(e.gammaRegularizer),this.supportsMasking=!0}build(e){const t=(e=Mw(e)).length;"number"==typeof this.axis&&(this.axis=[this.axis]);for(let e=0;e=t)throw new Error(`Invalid axis: ${e}`);if(this.axis.length!==fb(this.axis).length)throw new Error(`Found duplicate axes in: ${this.axis}`);const n=this.axis.map((t=>e[t])),s=!0;this.scale?this.gamma=this.addWeight("gamma",n,"float32",this.gammaInitializer,this.gammaRegularizer,s):this.gamma=null,this.center?this.beta=this.addWeight("beta",n,"float32",this.betaInitializer,this.betaRegularizer,s):this.beta=null,this.built=!0}call(e,t){const n=Dw(e),s=n.shape,r=s.length;return Ao((()=>{let{mean:e,variance:t}=Sd(n,this.axis,!0);const a=nb(1,r);for(const e of this.axis)a[e]=s[e];const i=e=>null!=e&&e.shape.length!==r?Tc(e,a):e;let o=this.scale?i(this.gamma.read()):null,l=this.center?i(this.beta.read()):null;const u=[],c=[];for(let e=0;e=0?e[2]+this.padding[0][0]+this.padding[0][1]:null,n=null!=e[3]&&e[3]>=0?e[3]+this.padding[1][0]+this.padding[1][1]:null,[e[0],e[1],t,n]):(t=null!=e[1]&&e[1]>=0?e[1]+this.padding[0][0]+this.padding[0][1]:null,n=null!=e[2]&&e[2]>=0?e[2]+this.padding[1][0]+this.padding[1][1]:null,[e[0],t,n,e[3]])}call(e,t){return Ao((()=>{return t=Dw(e),n=this.padding,s=this.dataFormat,Ao((()=>{if(4!==t.rank)throw new Qy(`temporalPadding expects input tensor to be 4-D, but received a ${t.rank}-D tensor.`);if(null==n&&(n=[[1,1],[1,1]]),2!==n.length||2!==n[0].length||2!==n[1].length)throw new Qy("spatial2dPadding expects `padding` to be an Array of two Arrays, each of which is an Array of two integers.");if(null==s&&(s="channelsLast"),"channelsLast"!==s&&"channelsFirst"!==s)throw new Qy(`Unknown data format: ${s}. Supported data formats are 'channelsLast' and 'channelsFirst.`);let e;return e="channelsFirst"===s?[[0,0],[0,0],n[0],n[1]]:[[0,0],n[0],n[1],[0,0]],Rd(t,e)}));var t,n,s}))}getConfig(){const e={padding:this.padding,dataFormat:this.dataFormat},t=super.getConfig();return Object.assign(e,t),e}}function hk(e,t,n,s,r,a){return Ao((()=>{let i;Ob(r),Db(a),Rb(s),null==n&&(n=[1,1]),null==s&&(s="valid"),null==r&&(r="channelsLast"),null==a&&(a="max"),e=aA(e,r);const o="same"===s?"same":"valid";return i="max"===a?md(e,t,n,o):Nc(e,t,n,o),"channelsFirst"===r&&(i=Jp(i,[0,3,1,2])),i}))}function dk(e,t,n,s,r,a){return Ao((()=>{let i;Ob(r),Db(a),Rb(s),null==n&&(n=[1,1,1]),null==s&&(s="valid"),null==r&&(r="channelsLast"),null==a&&(a="max"),e=iA(e,r);const o="same"===s?"same":"valid";return i="max"===a?gd(e,t,n,o):Oc(e,t,n,o),"channelsFirst"===r&&(i=Jp(i,[0,4,1,2,3])),i}))}ck.className="ZeroPadding2D",Hl(ck);class pk extends jw{constructor(e){if(null==e.poolSize&&(e.poolSize=2),super(e),"number"==typeof e.poolSize)this.poolSize=[e.poolSize];else{if(!Array.isArray(e.poolSize)||1!==e.poolSize.length||"number"!=typeof e.poolSize[0])throw new Qy(`poolSize for 1D convolutional layer must be a number or an Array of a single number, but received ${JSON.stringify(e.poolSize)}`);this.poolSize=e.poolSize}if(bb(this.poolSize,"poolSize"),null==e.strides)this.strides=this.poolSize;else if("number"==typeof e.strides)this.strides=[e.strides];else{if(!Array.isArray(e.strides)||1!==e.strides.length||"number"!=typeof e.strides[0])throw new Qy(`strides for 1D convolutional layer must be a number or an Array of a single number, but received ${JSON.stringify(e.strides)}`);this.strides=e.strides}bb(this.strides,"strides"),this.padding=null==e.padding?"valid":e.padding,Rb(this.padding),this.inputSpec=[new Vw({ndim:3})]}computeOutputShape(e){const t=sA((e=Mw(e))[1],this.poolSize[0],this.padding,this.strides[0]);return[e[0],t,e[2]]}call(e,t){return Ao((()=>{this.invokeCallHook(e,t),e=Kb(Dw(e),2);const n=this.poolingFunction(Dw(e),[this.poolSize[0],1],[this.strides[0],1],this.padding,"channelsLast");return Tp(n,[2])}))}getConfig(){const e={poolSize:this.poolSize,padding:this.padding,strides:this.strides},t=super.getConfig();return Object.assign(e,t),e}}class fk extends pk{constructor(e){super(e)}poolingFunction(e,t,n,s,r){return Ob(r),Rb(s),hk(e,t,n,s,r,"max")}}fk.className="MaxPooling1D",Hl(fk);class mk extends pk{constructor(e){super(e)}poolingFunction(e,t,n,s,r){return Ob(r),Rb(s),hk(e,t,n,s,r,"avg")}}mk.className="AveragePooling1D",Hl(mk);class gk extends jw{constructor(e){if(null==e.poolSize&&(e.poolSize=[2,2]),super(e),this.poolSize=Array.isArray(e.poolSize)?e.poolSize:[e.poolSize,e.poolSize],null==e.strides)this.strides=this.poolSize;else if(Array.isArray(e.strides)){if(2!==e.strides.length)throw new Qy(`If the strides property of a 2D pooling layer is an Array, it is expected to have a length of 2, but received length ${e.strides.length}.`);this.strides=e.strides}else this.strides=[e.strides,e.strides];bb(this.poolSize,"poolSize"),bb(this.strides,"strides"),this.padding=null==e.padding?"valid":e.padding,this.dataFormat=null==e.dataFormat?"channelsLast":e.dataFormat,Ob(this.dataFormat),Rb(this.padding),this.inputSpec=[new Vw({ndim:4})]}computeOutputShape(e){e=Mw(e);let t="channelsFirst"===this.dataFormat?e[2]:e[1],n="channelsFirst"===this.dataFormat?e[3]:e[2];return t=sA(t,this.poolSize[0],this.padding,this.strides[0]),n=sA(n,this.poolSize[1],this.padding,this.strides[1]),"channelsFirst"===this.dataFormat?[e[0],e[1],t,n]:[e[0],t,n,e[3]]}call(e,t){return Ao((()=>(this.invokeCallHook(e,t),this.poolingFunction(Dw(e),this.poolSize,this.strides,this.padding,this.dataFormat))))}getConfig(){const e={poolSize:this.poolSize,padding:this.padding,strides:this.strides,dataFormat:this.dataFormat},t=super.getConfig();return Object.assign(e,t),e}}class yk extends gk{constructor(e){super(e)}poolingFunction(e,t,n,s,r){return Ob(r),Rb(s),hk(e,t,n,s,r,"max")}}yk.className="MaxPooling2D",Hl(yk);class bk extends gk{constructor(e){super(e)}poolingFunction(e,t,n,s,r){return Ob(r),Rb(s),hk(e,t,n,s,r,"avg")}}bk.className="AveragePooling2D",Hl(bk);class wk extends jw{constructor(e){if(null==e.poolSize&&(e.poolSize=[2,2,2]),super(e),this.poolSize=Array.isArray(e.poolSize)?e.poolSize:[e.poolSize,e.poolSize,e.poolSize],null==e.strides)this.strides=this.poolSize;else if(Array.isArray(e.strides)){if(3!==e.strides.length)throw new Qy(`If the strides property of a 3D pooling layer is an Array, it is expected to have a length of 3, but received length ${e.strides.length}.`);this.strides=e.strides}else this.strides=[e.strides,e.strides,e.strides];bb(this.poolSize,"poolSize"),bb(this.strides,"strides"),this.padding=null==e.padding?"valid":e.padding,this.dataFormat=null==e.dataFormat?"channelsLast":e.dataFormat,Ob(this.dataFormat),Rb(this.padding),this.inputSpec=[new Vw({ndim:5})]}computeOutputShape(e){e=Mw(e);let t="channelsFirst"===this.dataFormat?e[2]:e[1],n="channelsFirst"===this.dataFormat?e[3]:e[2],s="channelsFirst"===this.dataFormat?e[4]:e[3];return t=sA(t,this.poolSize[0],this.padding,this.strides[0]),n=sA(n,this.poolSize[1],this.padding,this.strides[1]),s=sA(s,this.poolSize[2],this.padding,this.strides[2]),"channelsFirst"===this.dataFormat?[e[0],e[1],t,n,s]:[e[0],t,n,s,e[4]]}call(e,t){return Ao((()=>(this.invokeCallHook(e,t),this.poolingFunction(Dw(e),this.poolSize,this.strides,this.padding,this.dataFormat))))}getConfig(){const e={poolSize:this.poolSize,padding:this.padding,strides:this.strides,dataFormat:this.dataFormat},t=super.getConfig();return Object.assign(e,t),e}}class vk extends wk{constructor(e){super(e)}poolingFunction(e,t,n,s,r){return Ob(r),Rb(s),dk(e,t,n,s,r,"max")}}vk.className="MaxPooling3D",Hl(vk);class xk extends wk{constructor(e){super(e)}poolingFunction(e,t,n,s,r){return Ob(r),Rb(s),dk(e,t,n,s,r,"avg")}}xk.className="AveragePooling3D",Hl(xk);class Ak extends jw{constructor(e){super(e),this.inputSpec=[new Vw({ndim:3})]}computeOutputShape(e){return[e[0],e[2]]}call(e,t){throw new Jy}}class kk extends Ak{constructor(e){super(e||{})}call(e,t){return Ao((()=>{const t=Dw(e);return bd(t,1)}))}}kk.className="GlobalAveragePooling1D",Hl(kk);class Ck extends Ak{constructor(e){super(e||{})}call(e,t){return Ao((()=>{const t=Dw(e);return Oh(t,1)}))}}Ck.className="GlobalMaxPooling1D",Hl(Ck);class Sk extends jw{constructor(e){super(e),this.dataFormat=null==e.dataFormat?"channelsLast":e.dataFormat,Ob(this.dataFormat),this.inputSpec=[new Vw({ndim:4})]}computeOutputShape(e){return"channelsLast"===this.dataFormat?[e[0],e[3]]:[e[0],e[1]]}call(e,t){throw new Jy}getConfig(){const e={dataFormat:this.dataFormat},t=super.getConfig();return Object.assign(e,t),e}}class Ek extends Sk{call(e,t){return Ao((()=>{const t=Dw(e);return"channelsLast"===this.dataFormat?bd(t,[1,2]):bd(t,[2,3])}))}}Ek.className="GlobalAveragePooling2D",Hl(Ek);class _k extends Sk{call(e,t){return Ao((()=>{const t=Dw(e);return"channelsLast"===this.dataFormat?Oh(t,[1,2]):Oh(t,[2,3])}))}}_k.className="GlobalMaxPooling2D",Hl(_k);class Ik extends jw{constructor(e){super(e),this.layer=e.layer}build(e){this.built=!0}get trainable(){return null!=this.layer&&this.layer.trainable}set trainable(e){null!=this.layer&&(this.layer.trainable=e)}get trainableWeights(){return this.layer.trainableWeights}get nonTrainableWeights(){return this.layer.nonTrainableWeights}get updates(){return this.layer._updates}get losses(){return this.layer.losses}getWeights(){return this.layer.getWeights()}setWeights(e){this.layer.setWeights(e)}getConfig(){const e={layer:{className:this.layer.getClassName(),config:this.layer.getConfig()}},t=super.getConfig();return Object.assign(e,t),e}setFastWeightInitDuringBuild(e){super.setFastWeightInitDuringBuild(e),null!=this.layer&&this.layer.setFastWeightInitDuringBuild(e)}static fromConfig(e,t,n={}){const s=Av(t.layer,n);delete t.layer;const r={layer:s};return Object.assign(r,t),new e(r)}}class Tk extends Ik{constructor(e){super(e),this.supportsMasking=!0}build(e){if((e=Mw(e)).length<3)throw new Qy(`TimeDistributed layer expects an input shape >= 3D, but received input shape ${JSON.stringify(e)}`);this.inputSpec=[{shape:e}];const t=[e[0]].concat(e.slice(2));this.layer.built||(this.layer.build(t),this.layer.built=!0),super.build(e)}computeOutputShape(e){const t=[(e=Mw(e))[0]].concat(e.slice(2)),n=this.layer.computeOutputShape(t),s=e[1];return[n[0],s].concat(n.slice(1))}call(e,t){return Ao((()=>kA(((e,n)=>[Dw(this.layer.call(e,t)),[]]),e=Dw(e),[],!1,null,null,!1,!0)[1]))}}Tk.className="TimeDistributed",Hl(Tk);class Nk extends Ik{constructor(e){super(e);const t=e.layer.getConfig(),n={};n.className=e.layer.getClassName(),n.config=t,this.forwardLayer=Av(n),t.goBackwards=!0!==t.goBackwards;const s={};var r;if(s.className=e.layer.getClassName(),s.config=t,this.backwardLayer=Av(s),this.forwardLayer.name="forward_"+this.forwardLayer.name,this.backwardLayer.name="backward_"+this.backwardLayer.name,this.mergeMode=void 0===e.mergeMode?"concat":e.mergeMode,r=this.mergeMode,gb(Tb,"BidirectionalMergeMode",r),e.weights)throw new Jy("weights support is not implemented for Bidirectional layer yet.");this._stateful=e.layer.stateful,this.returnSequences=e.layer.returnSequences,this.returnState=e.layer.returnState,this.supportsMasking=!0,this._trainable=!0,this.inputSpec=e.layer.inputSpec,this.numConstants=null}get trainable(){return this._trainable}set trainable(e){this._trainable=e,null!=this.forwardLayer&&(this.forwardLayer.trainable=e),null!=this.backwardLayer&&(this.backwardLayer.trainable=e)}getWeights(){return this.forwardLayer.getWeights().concat(this.backwardLayer.getWeights())}setWeights(e){const t=e.length,n=Math.floor(t/2);this.forwardLayer.setWeights(e.slice(0,n)),this.backwardLayer.setWeights(e.slice(n))}computeOutputShape(e){let t,n,s,r=this.forwardLayer.computeOutputShape(e);return Array.isArray(r)&&Array.isArray(r[0])||(r=[r]),this.returnState?(s=r.slice(1),t=r[0]):t=r[0],"concat"===this.mergeMode?(t[t.length-1]*=2,n=[t]):n=null==this.mergeMode?[t,t.slice()]:[t],this.returnState?null==this.mergeMode?n.concat(s).concat(s.slice()):[t].concat(s).concat(s.slice()):ab(n)}apply(e,t){let n=null==t?null:t.initialState,s=null==t?null:t.constants;null==t&&(t={});const r=AA(e,n,s,this.numConstants);if(e=r.inputs,n=r.initialState,s=r.constants,Array.isArray(e)&&(n=e.slice(1),e=e[0]),(null==n||0===n.length)&&null==s)return super.apply(e,t);const a=[],i=[];if(null!=n){const e=n.length;if(e%2>0)throw new Qy("When passing `initialState` to a Bidrectional RNN, the state should be an Array containing the states of the underlying RNNs.");t.initialState=n,a.push(...n);const s=n.map((e=>new Vw({shape:e.shape})));this.forwardLayer.stateSpec=s.slice(0,e/2),this.backwardLayer.stateSpec=s.slice(e/2),i.push(...s)}if(null!=s)throw new Jy("Support for constants in Bidirectional layers is not implemented yet.");const o=a[0]instanceof Ww;for(const e of a)if(e instanceof Ww!==o)throw new Qy("The initial state of a Bidirectional layer cannot be specified as a mix of symbolic and non-symbolic tensors");if(o){const n=[e].concat(a),s=this.inputSpec.concat(i),r=this.inputSpec;this.inputSpec=s;const o=super.apply(n,t);return this.inputSpec=r,o}return super.apply(e,t)}call(e,t){return Ao((()=>{const n=t.initialState;let s,r,a,i;if(null==n)s=this.forwardLayer.call(e,t),r=this.backwardLayer.call(e,t);else{const a=n.slice(0,n.length/2),i=n.slice(n.length/2);s=this.forwardLayer.call(e,Object.assign(t,{initialState:a})),r=this.backwardLayer.call(e,Object.assign(t,{initialState:i}))}return this.returnState&&(Array.isArray(s)&&(a=s.slice(1).concat(r.slice(1))),s=s[0],r=r[0]),this.returnSequences&&(r=ap(r,1)),"concat"===this.mergeMode?i=Qb([s,r]):"sum"===this.mergeMode?i=Dl(s,r):"ave"===this.mergeMode?i=Bl(.5,Dl(s,r)):"mul"===this.mergeMode?i=Bl(s,r):null==this.mergeMode&&(i=[s,r]),this.returnState?null==this.mergeMode?i.concat(a):[i].concat(a):i}))}resetStates(e){this.forwardLayer.resetStates(),this.backwardLayer.resetStates()}build(e){Bb(this.forwardLayer.name,(()=>{this.forwardLayer.build(e)})),Bb(this.backwardLayer.name,(()=>{this.backwardLayer.build(e)})),this.built=!0}computeMask(e,t){let n;if(Array.isArray(t)&&(t=t[0]),n=this.returnSequences?null==this.mergeMode?[t,t]:t:null==this.mergeMode?[null,null]:null,this.returnState){const e=this.forwardLayer.states.map((e=>null));return Array.isArray(n)?n.concat(e).concat(e):[n].concat(e).concat(e)}return n}get trainableWeights(){return this.forwardLayer.trainableWeights.concat(this.backwardLayer.trainableWeights)}get nonTrainableWeights(){return this.forwardLayer.nonTrainableWeights.concat(this.backwardLayer.nonTrainableWeights)}setFastWeightInitDuringBuild(e){super.setFastWeightInitDuringBuild(e),null!=this.forwardLayer&&this.forwardLayer.setFastWeightInitDuringBuild(e),null!=this.backwardLayer&&this.backwardLayer.setFastWeightInitDuringBuild(e)}getConfig(){const e={mergeMode:this.mergeMode},t=super.getConfig();return Object.assign(e,t),e}static fromConfig(e,t){const n=Av(t.layer);if(delete t.layer,null!=t.numConstants)throw new Jy("Deserialization of a Bidirectional layer with numConstants present is not supported yet.");const s=t;return s.layer=n,new e(s)}}Nk.className="Bidirectional",Hl(Nk);class Ok extends jw{constructor(e){super(e),this.scale=e.scale,e.offset?this.offset=e.offset:this.offset=0}getConfig(){const e={scale:this.scale,offset:this.offset},t=super.getConfig();return Object.assign(e,t),e}call(e,t){return Ao((()=>("float32"!==(e=Dw(e)).dtype&&(e=$b(e,"float32")),Dl(Bl(e,this.scale),this.offset))))}}Ok.className="Rescaling",Hl(Ok);const{resizeBilinear:Rk,cropAndResize:Dk}=bm;class Mk extends jw{constructor(e){super(e),this.height=e.height,this.width=e.width}centerCrop(e,t,n,s,r,a,i,o){return Ao((()=>{let l,u=!1;const c=[t/a,n/i,(s+t)/a,(r+n)/i],h=[];3===e.rank?(u=!0,l=Np([e])):l=e;for(let e=0;e$b(Rk(e,[t,n]),s)))}call(e,t){return Ao((()=>{const t=Dw(e),n=t.dtype,s=t.shape,r=s[s.length-3],a=s[s.length-2];let i=0;r!==this.height&&(i=Math.floor((r-this.height)/2));let o=0;return a!==this.width&&(o=Math.floor((a-this.width)/2),0===o&&(o=1)),i>=0&&o>=0?this.centerCrop(t,i,o,this.height,this.width,r,a,n):this.upsize(e,this.height,this.width,n)}))}getConfig(){const e={height:this.height,width:this.width},t=super.getConfig();return Object.assign(e,t),e}computeOutputShape(e){const t=(e=Mw(e)).length-3,n=e.length-2;return e[t]=this.height,e[n]=this.width,e}}Mk.className="CenterCrop",Hl(Mk);class Fk extends jw{constructor(e){super(e),this.numTokens=e.numTokens,e.outputMode?this.outputMode=e.outputMode:this.outputMode="multiHot"}getConfig(){const e={numTokens:this.numTokens,outputMode:this.outputMode},t=super.getConfig();return Object.assign(e,t),e}computeOutputShape(e){return null==(e=Mw(e))?[this.numTokens]:"oneHot"===this.outputMode&&1!==e[e.length-1]?(e.push(this.numTokens),e):(e[e.length-1]=this.numTokens,e)}call(e,t){return Ao((()=>{let n;if("int32"!==(e=Dw(e)).dtype&&(e=$b(e,"int32")),void 0!==t.countWeights){if("count"!==this.outputMode)throw new Qy(`countWeights is not used when outputMode !== count.\n Received countWeights=${t.countWeights}`);n=Dw(t.countWeights)}const s=Oh(e),r=Rh(e),a=qh(this.numTokens,s).bufferSync().get(0),i=jh(r,0).bufferSync().get(0);if(!a||!i)throw new Qy(`Input values must be between 0 < values <= numTokens with numTokens=${this.numTokens}`);return function(e,t,n,s){let r=Dw(e);if("int32"!==r.dtype&&(r=$b(r,"int32")),"int"===t)return r;const a=r.shape;if(0===r.rank&&(r=Lh(r,-1)),"oneHot"===t&&1!==r.shape[r.shape.length-1]&&(r=Lh(r,-1)),r.rank>2)throw new Qy(`When outputMode is not int, maximum output rank is 2 Received outputMode ${t} and input shape ${a} which would result in output rank ${r.rank}.`);const i=["multiHot","oneHot"].includes(t),o=r;let l;if(l=ch(o,void 0!==s&&"count"===t?s:[],n,i),"tfIdf"!==t)return l;if(s)return Bl(l,s);throw new Qy("When outputMode is 'tfIdf', weights must be provided.")}(e,this.outputMode,this.numTokens,n)}))}}Fk.className="CategoryEncoding",Hl(Fk);const Bk=new Set(["bilinear","nearest"]);class zk extends jw{constructor(e){if(super(e),this.height=e.height,this.width=e.width,e.interpolation){if(!Bk.has(e.interpolation))throw new Qy(`Invalid interpolation parameter: ${e.interpolation} is not implemented`);this.interpolation=e.interpolation}else this.interpolation="bilinear";this.cropToAspectRatio=Boolean(e.cropToAspectRatio)}computeOutputShape(e){const t=(e=Mw(e))[2];return[this.height,this.width,t]}getConfig(){const e={height:this.height,width:this.width,interpolation:this.interpolation,cropToAspectRatio:this.cropToAspectRatio},t=super.getConfig();return Object.assign(e,t),e}call(e,t){return Ao((()=>{const t=[this.height,this.width];if("bilinear"===this.interpolation)return bm.resizeBilinear(e,t,!this.cropToAspectRatio);if("nearest"===this.interpolation)return bm.resizeNearestNeighbor(e,t,!this.cropToAspectRatio);throw new Error(`Interpolation is ${this.interpolation} but only ${[...Bk]} are supported`)}))}}zk.className="Resizing",Hl(zk);class Lk{constructor(e){this.seed=e}next(){if(void 0!==this.seed)return this.seed++}}Lk.className="RandomSeed";class Pk extends jw{constructor(e){super(e),this.randomGenerator=new Lk(e.seed)}getConfig(){const e={seed:this.randomGenerator.seed},t=super.getConfig();return Object.assign(e,t),e}}Pk.className="BaseRandomLayer";const Vk=new Set(["bilinear","nearest"]);class Wk extends Pk{constructor(e){super(e);const{factor:t,interpolation:n="bilinear"}=e;if(this.factor=t,Array.isArray(this.factor)&&2===this.factor.length)this.widthLower=this.factor[0],this.widthUpper=this.factor[1];else{if(Array.isArray(this.factor)||!(this.factor>0))throw new Qy(`Invalid factor: ${this.factor}. Must be positive number or tuple of 2 numbers`);this.widthLower=-this.factor,this.widthUpper=this.factor}if(this.widthLower<-1||this.widthUpper<-1)throw new Qy(`factor must have values larger than -1. Got: ${this.factor}`);if(this.widthUpper{const t=Dw(e);this.imgHeight=t.shape[t.shape.length-3];const n=t.shape[t.shape.length-2];this.widthFactor=Qd([1],1+this.widthLower,1+this.widthUpper,"float32",this.randomGenerator.next());let s=this.widthFactor.dataSync()[0]*n;s=Math.round(s);const r=[this.imgHeight,s];switch(this.interpolation){case"bilinear":return bm.resizeBilinear(e,r);case"nearest":return bm.resizeNearestNeighbor(e,r);default:throw new Error(`Interpolation is ${this.interpolation}\n but only ${[...Vk]} are supported`)}}))}}Wk.className="RandomWidth",Hl(Wk);var Uk,Gk;Sn().registerFlag("KEEP_INTERMEDIATE_TENSORS",(()=>!1),(e=>{})),function(e){e[e.DT_INVALID=0]="DT_INVALID",e[e.DT_FLOAT=1]="DT_FLOAT",e[e.DT_DOUBLE=2]="DT_DOUBLE",e[e.DT_INT32=3]="DT_INT32",e[e.DT_UINT8=4]="DT_UINT8",e[e.DT_INT16=5]="DT_INT16",e[e.DT_INT8=6]="DT_INT8",e[e.DT_STRING=7]="DT_STRING",e[e.DT_COMPLEX64=8]="DT_COMPLEX64",e[e.DT_INT64=9]="DT_INT64",e[e.DT_BOOL=10]="DT_BOOL",e[e.DT_QINT8=11]="DT_QINT8",e[e.DT_QUINT8=12]="DT_QUINT8",e[e.DT_QINT32=13]="DT_QINT32",e[e.DT_BFLOAT16=14]="DT_BFLOAT16",e[e.DT_QINT16=15]="DT_QINT16",e[e.DT_QUINT16=16]="DT_QUINT16",e[e.DT_UINT16=17]="DT_UINT16",e[e.DT_COMPLEX128=18]="DT_COMPLEX128",e[e.DT_HALF=19]="DT_HALF",e[e.DT_RESOURCE=20]="DT_RESOURCE",e[e.DT_VARIANT=21]="DT_VARIANT",e[e.DT_UINT32=22]="DT_UINT32",e[e.DT_UINT64=23]="DT_UINT64",e[e.DT_FLOAT_REF=101]="DT_FLOAT_REF",e[e.DT_DOUBLE_REF=102]="DT_DOUBLE_REF",e[e.DT_INT32_REF=103]="DT_INT32_REF",e[e.DT_UINT8_REF=104]="DT_UINT8_REF",e[e.DT_INT16_REF=105]="DT_INT16_REF",e[e.DT_INT8_REF=106]="DT_INT8_REF",e[e.DT_STRING_REF=107]="DT_STRING_REF",e[e.DT_COMPLEX64_REF=108]="DT_COMPLEX64_REF",e[e.DT_INT64_REF=109]="DT_INT64_REF",e[e.DT_BOOL_REF=110]="DT_BOOL_REF",e[e.DT_QINT8_REF=111]="DT_QINT8_REF",e[e.DT_QUINT8_REF=112]="DT_QUINT8_REF",e[e.DT_QINT32_REF=113]="DT_QINT32_REF",e[e.DT_BFLOAT16_REF=114]="DT_BFLOAT16_REF",e[e.DT_QINT16_REF=115]="DT_QINT16_REF",e[e.DT_QUINT16_REF=116]="DT_QUINT16_REF",e[e.DT_UINT16_REF=117]="DT_UINT16_REF",e[e.DT_COMPLEX128_REF=118]="DT_COMPLEX128_REF",e[e.DT_HALF_REF=119]="DT_HALF_REF",e[e.DT_RESOURCE_REF=120]="DT_RESOURCE_REF",e[e.DT_VARIANT_REF=121]="DT_VARIANT_REF",e[e.DT_UINT32_REF=122]="DT_UINT32_REF",e[e.DT_UINT64_REF=123]="DT_UINT64_REF"}(Uk||(Uk={})),function(e){let t;!function(e){e[e.LEGACY=0]="LEGACY",e[e.V1=1]="V1",e[e.V2=2]="V2"}(t=e.CheckpointFormatVersion||(e.CheckpointFormatVersion={}))}(Gk||(Gk={}));const qk={};function jk(e){return qk[e]}function Hk(e,t,n,s,r){const a=t.inputParams[e];if(a&&void 0!==a.inputIndexStart){const e=a.inputIndexStart,i=0===a.inputIndexEnd?void 0:void 0===a.inputIndexEnd?e+1:a.inputIndexEnd,o=e<0?t.inputNames.length+e:e;if("tensor"===a.type)return $k(t.inputNames[o],n,s,r);if("tensors"===a.type){const a=t.inputs.slice(e,i);return t.inputNames.slice(e,i).filter(((e,t)=>{var n;return"NoOp"!==(null===(n=a[t])||void 0===n?void 0:n.op)})).map((e=>$k(e,n,s,r)))}const l=$k(t.inputNames[o],n,s,r),u=l.dataSync();return"number"===a.type?u[0]:fn(l.shape,u)}const i=t.attrParams[e];return i&&i.value}function $k(e,t,n,s){const[r,a]=Yk(e,n);if(null!=s){const e=s.getHashTableHandleByName(r);if(null!=e)return e}const i=n.currentContextIds.find((e=>!!t[Zk(r,e)]));return void 0!==i?t[Zk(r,i)][a]:void 0}function Kk(e,t,n){return t[Zk(e,n.currentContextId)]}function Xk(e,t){const[n,s,r]=Yk(e,t);return[Zk(n,t&&t.currentContextId),s,r]}function Zk(e,t){return t?`${e}-${t}`:e}function Yk(e,t){if(""===e)return["",0,void 0];const n=null!=t&&null!=t.parseNodeNameCache;if(n){const n=t.parseNodeNameCache.get(e);if(null!=n)return n}const s=e.split(":");let r;if(1===s.length)r=[e,0,void 0];else{const e=s[0],t=3===s.length?s[1]:void 0;r=[e,Number(s[s.length-1]),t]}return n&&t.parseNodeNameCache.set(e,r),r}function Qk(e,t,n){let s=Hk("pad",e,t,n);if("explicit"===s){s=Hk("explicitPaddings",e,t,n);const r=[[0,0],[0,0],[0,0],[0,0]];for(let e=0;e<4;e++)r[e][0]=s[2*e],r[e][1]=s[2*e+1];return r}return s}function Jk(e){return e.kept?e:Ol(e)}const eC=[{tfOpName:"Add",category:"arithmetic",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"AddV2",category:"arithmetic",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"AddN",category:"arithmetic",inputs:[{start:0,end:0,name:"tensors",type:"tensors"}]},{tfOpName:"BiasAdd",category:"arithmetic",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0},{tfName:"data_format",name:"dataFormat",type:"string",notSupported:!0}]},{tfOpName:"Sub",category:"arithmetic",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"RealDiv",category:"arithmetic",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Div",category:"arithmetic",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"DivNoNan",category:"arithmetic",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"FloorDiv",category:"arithmetic",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Mul",category:"arithmetic",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Maximum",category:"arithmetic",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Minimum",category:"arithmetic",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Pow",category:"arithmetic",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"SquaredDifference",category:"arithmetic",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Mod",category:"arithmetic",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"FloorMod",category:"arithmetic",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]}],tC=[{tfOpName:"Abs",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Acos",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Asin",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Atan",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Atan2",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"y",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Ceil",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"ClipByValue",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"clipValueMin",type:"number"},{start:2,name:"clipValueMax",type:"number"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Complex",category:"basic_math",inputs:[{start:0,name:"real",type:"tensor"},{start:1,name:"imag",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"ComplexAbs",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Cos",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Cosh",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Elu",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Exp",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Floor",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Log",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Imag",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0},{tfName:"Tout",name:"outputType",type:"dtype",notSupported:!0}]},{tfOpName:"Neg",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Real",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0},{tfName:"Tout",name:"outputType",type:"dtype",notSupported:!0}]},{tfOpName:"Prelu",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"alpha",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Relu",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Relu6",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Selu",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Sigmoid",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Sin",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Sinh",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Sqrt",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Rsqrt",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Square",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Tan",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Tanh",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Sign",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Round",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Expm1",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Log1p",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Reciprocal",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Softplus",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Asinh",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Acosh",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Atanh",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Erf",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"LeakyRelu",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"alpha",name:"alpha",type:"number",defaultValue:.2},{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"IsNan",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"IsFinite",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"IsInf",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]}],nC=[{tfOpName:"EmptyTensorList",category:"control",inputs:[{start:0,name:"elementShape",type:"shape"},{start:1,name:"maxNumElements",type:"number"}],attrs:[{tfName:"element_dtype",name:"elementDType",type:"dtype"}]},{tfOpName:"LoopCond",category:"control",inputs:[{start:0,name:"pred",type:"tensor"}]},{tfOpName:"Switch",category:"control",inputs:[{start:0,name:"data",type:"tensor"},{start:1,name:"pred",type:"tensor"}]},{tfOpName:"Merge",category:"control",inputs:[{start:0,end:0,name:"tensors",type:"tensors"}]},{tfOpName:"Enter",category:"control",inputs:[{start:0,name:"tensor",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0},{tfName:"frame_name",name:"frameName",type:"string"},{tfName:"is_constant",name:"isConstant",type:"bool"}]},{tfOpName:"Exit",category:"control",inputs:[{start:0,name:"tensor",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"NextIteration",category:"control",inputs:[{start:0,name:"tensor",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"TensorArrayV3",category:"control",inputs:[{start:0,name:"size",type:"number"}],attrs:[{tfName:"dtype",name:"dtype",type:"dtype"},{tfName:"element_shape",name:"elementShape",type:"shape"},{tfName:"dynamic_size",name:"dynamicSize",type:"bool"},{tfName:"clear_after_read",name:"clearAfterRead",type:"bool"},{tfName:"identical_element_shapes",name:"identicalElementShapes",type:"bool"},{tfName:"tensor_array_name",name:"name",type:"string"}]},{tfOpName:"TensorArrayWriteV3",category:"control",inputs:[{start:0,name:"tensorArrayId",type:"tensor"},{start:1,name:"index",type:"number"},{start:2,name:"tensor",type:"tensor"},{start:3,name:"flowIn",type:"number"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"TensorArrayReadV3",category:"control",inputs:[{start:0,name:"tensorArrayId",type:"tensor"},{start:1,name:"index",type:"number"},{start:2,name:"flowIn",type:"number"}],attrs:[{tfName:"dtype",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"TensorArrayGatherV3",category:"control",inputs:[{start:0,name:"tensorArrayId",type:"tensor"},{start:1,name:"indices",type:"number[]"},{start:2,name:"flowIn",type:"number"}],attrs:[{tfName:"dtype",name:"dtype",type:"dtype"},{tfName:"element_shape",name:"elementShape",type:"shape"}]},{tfOpName:"TensorArrayScatterV3",category:"control",inputs:[{start:0,name:"tensorArrayId",type:"tensor"},{start:1,name:"indices",type:"number[]"},{start:2,name:"tensor",type:"tensor"},{start:3,name:"flowIn",type:"number"}],attrs:[{tfName:"T",name:"dtype",type:"dtype"}]},{tfOpName:"TensorArrayConcatV3",category:"control",inputs:[{start:0,name:"tensorArrayId",type:"tensor"},{start:1,name:"flowIn",type:"number"}],attrs:[{tfName:"dtype",name:"dtype",type:"dtype"},{tfName:"element_shape_except0",name:"elementShapeExcept0",type:"shape",notSupported:!0}]},{tfOpName:"TensorArraySplitV3",category:"control",inputs:[{start:0,name:"tensorArrayId",type:"tensor"},{start:1,name:"tensor",type:"tensor"},{start:2,name:"lengths",type:"number[]"},{start:3,name:"flowIn",type:"number"}],attrs:[{tfName:"T",name:"dtype",type:"dtype"}]},{tfOpName:"TensorArraySizeV3",category:"control",inputs:[{start:0,name:"tensorArrayId",type:"tensor"},{start:1,name:"flowIn",type:"number"}]},{tfOpName:"TensorArrayCloseV3",category:"control",inputs:[{start:0,name:"tensorArrayId",type:"tensor"}]},{tfOpName:"StatelessIf",category:"control",inputs:[{start:0,name:"cond",type:"tensor"},{start:1,end:0,name:"args",type:"tensors"}],attrs:[{tfName:"then_branch",name:"thenBranch",type:"func"},{tfName:"else_branch",name:"elseBranch",type:"func"}]},{tfOpName:"If",category:"control",inputs:[{start:0,name:"cond",type:"tensor"},{start:1,end:0,name:"args",type:"tensors"}],attrs:[{tfName:"then_branch",name:"thenBranch",type:"func"},{tfName:"else_branch",name:"elseBranch",type:"func"}]},{tfOpName:"StatelessWhile",category:"control",inputs:[{start:0,end:0,name:"args",type:"tensors"}],attrs:[{tfName:"cond",name:"cond",type:"func"},{tfName:"body",name:"body",type:"func"}]},{tfOpName:"While",category:"control",inputs:[{start:0,end:0,name:"args",type:"tensors"}],attrs:[{tfName:"cond",name:"cond",type:"func"},{tfName:"body",name:"body",type:"func"}]},{tfOpName:"TensorListScatter",category:"control",inputs:[{start:0,name:"tensor",type:"tensor"},{start:1,name:"indices",type:"number[]"},{start:2,name:"elementShape",type:"shape"}],attrs:[{tfName:"element_dtype",name:"elementDType",type:"dtype"}]},{tfOpName:"TensorListScatterV2",category:"control",inputs:[{start:0,name:"tensor",type:"tensor"},{start:1,name:"indices",type:"number[]"},{start:2,name:"elementShape",type:"shape"},{start:3,name:"numElements",type:"number"}],attrs:[{tfName:"element_dtype",name:"elementDType",type:"dtype"}]},{tfOpName:"TensorListGather",category:"control",inputs:[{start:0,name:"tensorListId",type:"tensor"},{start:1,name:"indices",type:"number[]"},{start:2,name:"elementShape",type:"shape"}],attrs:[{tfName:"element_dtype",name:"elementDType",type:"dtype"}]},{tfOpName:"TensorListGetItem",category:"control",inputs:[{start:0,name:"tensorListId",type:"tensor"},{start:1,name:"index",type:"number"},{start:2,name:"elementShape",type:"shape"}],attrs:[{tfName:"element_dtype",name:"elementDType",type:"dtype"}]},{tfOpName:"TensorListSetItem",category:"control",inputs:[{start:0,name:"tensorListId",type:"tensor"},{start:1,name:"index",type:"number"},{start:2,name:"tensor",type:"tensor"}],attrs:[{tfName:"element_dtype",name:"elementDType",type:"dtype"}]},{tfOpName:"TensorListReserve",category:"control",inputs:[{start:0,name:"elementShape",type:"shape"},{start:1,name:"numElements",type:"number"}],attrs:[{tfName:"element_dtype",name:"elementDType",type:"dtype"}]},{tfOpName:"TensorListFromTensor",category:"control",inputs:[{start:0,name:"tensor",type:"tensor"},{start:1,name:"elementShape",type:"shape"}],attrs:[{tfName:"element_dtype",name:"elementDType",type:"dtype"}]},{tfOpName:"TensorListStack",category:"control",inputs:[{start:0,name:"tensorListId",type:"tensor"},{start:1,name:"elementShape",type:"shape"}],attrs:[{tfName:"element_dtype",name:"elementDType",type:"dtype"},{tfName:"num_elements",name:"numElements",type:"dtype"}]},{tfOpName:"TensorListSplit",category:"control",inputs:[{start:0,name:"tensor",type:"tensor"},{start:1,name:"elementShape",type:"shape"},{start:2,name:"lengths",type:"number[]"}],attrs:[{tfName:"element_dtype",name:"elementDType",type:"dtype"}]},{tfOpName:"TensorListConcat",category:"control",inputs:[{start:0,name:"tensorListId",type:"tensor"}],attrs:[{tfName:"element_shape",name:"elementShape",type:"shape"},{tfName:"element_dtype",name:"elementDType",type:"dtype"}]},{tfOpName:"TensorListConcatV2",category:"control",inputs:[{start:0,name:"tensorListId",type:"tensor"}],attrs:[{tfName:"element_shape",name:"elementShape",type:"shape"},{tfName:"element_dtype",name:"elementDType",type:"dtype"}]},{tfOpName:"TensorListPopBack",category:"control",inputs:[{start:0,name:"tensorListId",type:"tensor"},{start:1,name:"elementShape",type:"shape"}],attrs:[{tfName:"element_dtype",name:"elementDType",type:"dtype"}]},{tfOpName:"TensorListPushBack",category:"control",inputs:[{start:0,name:"tensorListId",type:"tensor"},{start:1,name:"tensor",type:"tensor"}],attrs:[{tfName:"element_dtype",name:"elementDType",type:"dtype"}]},{tfOpName:"TensorListLength",category:"control",inputs:[{start:0,name:"tensorListId",type:"tensor"}]},{tfOpName:"TensorListResize",category:"control",inputs:[{start:0,name:"tensorListId",type:"tensor"},{start:1,name:"size",type:"number"}]}],sC=[{tfOpName:"AvgPool",category:"convolution",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"strides",name:"strides",type:"number[]"},{tfName:"padding",name:"pad",type:"string"},{tfName:"data_format",name:"dataFormat",type:"string",notSupported:!0},{tfName:"ksize",name:"kernelSize",type:"number[]"},{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"MaxPool",category:"convolution",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"strides",name:"strides",type:"number[]"},{tfName:"padding",name:"pad",type:"string"},{tfName:"data_format",name:"dataFormat",type:"string",notSupported:!0},{tfName:"ksize",name:"kernelSize",type:"number[]"},{tfName:"explicit_paddings",name:"explicitPaddings",type:"number[]",defaultValue:[],notSupported:!0},{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"MaxPoolWithArgmax",category:"convolution",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"strides",name:"strides",type:"number[]"},{tfName:"padding",name:"pad",type:"string"},{tfName:"ksize",name:"kernelSize",type:"number[]"},{tfName:"include_batch_in_index",name:"includeBatchInIndex",type:"bool"},{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"AvgPool3D",category:"convolution",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"strides",name:"strides",type:"number[]"},{tfName:"padding",name:"pad",type:"string"},{tfName:"data_format",name:"dataFormat",type:"string",notSupported:!0},{tfName:"ksize",name:"kernelSize",type:"number[]"},{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"MaxPool3D",category:"convolution",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"strides",name:"strides",type:"number[]"},{tfName:"padding",name:"pad",type:"string"},{tfName:"data_format",name:"dataFormat",type:"string",notSupported:!0},{tfName:"ksize",name:"kernelSize",type:"number[]"},{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Conv1D",category:"convolution",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"filter",type:"tensor"}],attrs:[{tfName:"stride",name:"stride",type:"number"},{tfName:"padding",name:"pad",type:"string"},{tfName:"data_format",name:"dataFormat",type:"string",defaultValue:"NWC"},{tfName:"T",name:"dtype",type:"dtype",notSupported:!0},{tfName:"dilation",name:"dilation",type:"number",defaultValue:1}]},{tfOpName:"Conv2D",category:"convolution",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"filter",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0},{tfName:"strides",name:"strides",type:"number[]"},{tfName:"padding",name:"pad",type:"string"},{tfName:"useCudnnOnGpu",name:"useCudnnOnGpu",type:"bool"},{tfName:"data_format",name:"dataFormat",type:"string",defaultValue:"NHWC"},{tfName:"explicit_paddings",name:"explicitPaddings",type:"number[]",defaultValue:[]},{tfName:"dilations",name:"dilations",type:"number[]"}]},{tfOpName:"_FusedConv2D",category:"convolution",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"filter",type:"tensor"},{start:2,end:0,name:"args",type:"tensors"}],attrs:[{tfName:"num_args",name:"numArgs",type:"number"},{tfName:"T",name:"dtype",type:"dtype",notSupported:!0},{tfName:"strides",name:"strides",type:"number[]"},{tfName:"padding",name:"pad",type:"string"},{tfName:"explicit_paddings",name:"explicitPaddings",type:"number[]",defaultValue:[]},{tfName:"use_cudnn_on_gpu",name:"useCudnnOnGpu",type:"bool",defaultValue:!0},{tfName:"data_format",name:"dataFormat",type:"string",defaultValue:"NHWC"},{tfName:"dilations",name:"dilations",type:"number[]",defaultValue:[1,1,1,1]},{tfName:"fused_ops",name:"fusedOps",type:"string[]",defaultValue:[]},{tfName:"epsilon",name:"epsilon",type:"number",defaultValue:1e-4},{tfName:"leakyrelu_alpha",name:"leakyreluAlpha",type:"number",defaultValue:.2}]},{tfOpName:"Conv2DBackpropInput",category:"convolution",inputs:[{start:2,name:"x",type:"tensor"},{start:1,name:"filter",type:"tensor"},{start:0,name:"outputShape",type:"number[]"}],attrs:[{tfName:"strides",name:"strides",type:"number[]"},{tfName:"padding",name:"pad",type:"string"},{tfName:"data_format",name:"dataFormat",type:"string",notSupported:!0},{tfName:"explicit_paddings",name:"explicitPaddings",type:"number[]",defaultValue:[]},{tfName:"dilations",name:"dilations",type:"number[]",notSupported:!0}]},{tfOpName:"DepthwiseConv2d",category:"convolution",inputs:[{start:0,name:"input",type:"tensor"},{start:1,name:"filter",type:"tensor"}],attrs:[{tfName:"strides",name:"strides",type:"number[]"},{tfName:"padding",name:"pad",type:"string"},{tfName:"data_format",name:"dataFormat",type:"string",defaultValue:"NHWC"},{tfName:"explicit_paddings",name:"explicitPaddings",type:"number[]",defaultValue:[]},{tfName:"dilations",name:"dilations",type:"number[]"}]},{tfOpName:"DepthwiseConv2dNative",category:"convolution",inputs:[{start:0,name:"input",type:"tensor"},{start:1,name:"filter",type:"tensor"}],attrs:[{tfName:"strides",name:"strides",type:"number[]"},{tfName:"padding",name:"pad",type:"string"},{tfName:"data_format",name:"dataFormat",type:"string",defaultValue:"NHWC"},{tfName:"explicit_paddings",name:"explicitPaddings",type:"number[]",defaultValue:[]},{tfName:"dilations",name:"dilations",type:"number[]"}]},{tfOpName:"FusedDepthwiseConv2dNative",category:"convolution",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"filter",type:"tensor"},{start:2,end:0,name:"args",type:"tensors"}],attrs:[{tfName:"num_args",name:"numArgs",type:"number"},{tfName:"T",name:"dtype",type:"dtype",notSupported:!0},{tfName:"strides",name:"strides",type:"number[]"},{tfName:"padding",name:"pad",type:"string"},{tfName:"data_format",name:"dataFormat",type:"string",defaultValue:"NHWC"},{tfName:"dilations",name:"dilations",type:"number[]",defaultValue:[1,1,1,1]},{tfName:"fused_ops",name:"fusedOps",type:"string[]",defaultValue:[]},{tfName:"explicit_paddings",name:"explicitPaddings",type:"number[]",defaultValue:[]}]},{tfOpName:"Conv3D",category:"convolution",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"filter",type:"tensor"}],attrs:[{tfName:"strides",name:"strides",type:"number[]"},{tfName:"padding",name:"pad",type:"string"},{tfName:"data_format",name:"dataFormat",type:"string",defaultValue:"NHWC"},{tfName:"dilations",name:"dilations",type:"number[]"}]},{tfOpName:"Dilation2D",category:"convolution",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"filter",type:"tensor"}],attrs:[{tfName:"strides",name:"strides",type:"number[]"},{tfName:"rates",name:"dilations",type:"number[]"},{tfName:"padding",name:"pad",type:"string"}]}],rC=[{tfOpName:"Fill",category:"creation",inputs:[{start:0,name:"shape",type:"number[]"},{start:1,name:"value",type:"number"}],attrs:[{tfName:"T",name:"dtype",type:"dtype"}]},{tfOpName:"LinSpace",category:"creation",inputs:[{start:0,name:"start",type:"number"},{start:1,name:"stop",type:"number"},{start:2,name:"num",type:"number"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"OneHot",category:"creation",inputs:[{start:0,name:"indices",type:"tensor"},{start:1,name:"depth",type:"number"},{start:2,name:"onValue",type:"number",defaultValue:1},{start:3,name:"offValue",type:"number",defaultValue:0}],attrs:[{tfName:"axis",name:"axis",type:"number",notSupported:!0},{tfName:"T",name:"dtype",type:"dtype"}]},{tfOpName:"Ones",category:"creation",inputs:[{start:0,name:"shape",type:"number[]"}],attrs:[{tfName:"T",name:"dtype",type:"dtype"}]},{tfOpName:"OnesLike",category:"creation",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"dtype",name:"dtype",type:"dtype"}]},{tfOpName:"RandomStandardNormal",category:"creation",inputs:[{start:0,name:"shape",type:"number[]"}],attrs:[{tfName:"seed",name:"seed",type:"number",defaultValue:0},{tfName:"seed2",name:"seed2",type:"number",defaultValue:0,notSupported:!0},{tfName:"dtype",name:"dtype",type:"dtype"},{tfName:"T",name:"T",type:"number",notSupported:!0}]},{tfOpName:"RandomUniform",category:"creation",inputs:[{start:0,name:"shape",type:"number[]"}],attrs:[{tfName:"minval",name:"minval",type:"number",defaultValue:0},{tfName:"maxval",name:"maxval",type:"number",defaultValue:1},{tfName:"dtype",name:"dtype",type:"dtype"},{tfName:"seed",name:"seed",type:"number",defaultValue:0},{tfName:"seed2",name:"seed2",type:"number",defaultValue:0,notSupported:!0},{tfName:"T",name:"T",type:"number",notSupported:!0}]},{tfOpName:"RandomUniformInt",category:"creation",inputs:[{start:0,name:"shape",type:"number[]"}],attrs:[{tfName:"minval",name:"minval",type:"number"},{tfName:"maxval",name:"maxval",type:"number"},{tfName:"seed",name:"seed",type:"number",defaultValue:0},{tfName:"seed2",name:"seed2",type:"number",defaultValue:0,notSupported:!0}]},{tfOpName:"Range",category:"creation",inputs:[{start:0,name:"start",type:"number"},{start:1,name:"stop",type:"number"},{start:2,name:"step",type:"number",defaultValue:0}],attrs:[{tfName:"Tidx",name:"dtype",type:"dtype"}]},{tfOpName:"TruncatedNormal",category:"creation",inputs:[{start:0,name:"shape",type:"number[]"}],attrs:[{tfName:"means",name:"mean",type:"number",defaultValue:0},{tfName:"stddev",name:"stdDev",type:"number",defaultValue:1},{tfName:"seed",name:"seed",type:"number"},{tfName:"seed2",name:"seed2",type:"number",defaultValue:0,notSupported:!0},{tfName:"dtype",name:"dtype",type:"dtype"},{tfName:"T",name:"T",type:"number",notSupported:!0}]},{tfOpName:"Zeros",category:"creation",inputs:[{start:0,name:"shape",type:"number[]"}],attrs:[{tfName:"T",name:"dtype",type:"dtype"}]},{tfOpName:"ZerosLike",category:"creation",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype"}]},{tfOpName:"Multinomial",category:"creation",inputs:[{start:0,name:"logits",type:"tensor"},{start:1,name:"numSamples",type:"number"}],attrs:[{tfName:"seed",name:"seed",type:"number"},{tfName:"seed2",name:"seed2",type:"number"},{tfName:"T",name:"dtype",type:"dtype"},{tfName:"output_dtype",name:"output_dtype",type:"dtype"}]}],aC=[{tfOpName:"NonMaxSuppressionV2",category:"dynamic",inputs:[{start:0,name:"boxes",type:"tensor"},{start:1,name:"scores",type:"tensor"},{start:2,name:"maxOutputSize",type:"number"},{start:3,name:"iouThreshold",type:"number"}]},{tfOpName:"NonMaxSuppressionV3",category:"dynamic",inputs:[{start:0,name:"boxes",type:"tensor"},{start:1,name:"scores",type:"tensor"},{start:2,name:"maxOutputSize",type:"number"},{start:3,name:"iouThreshold",type:"number"},{start:4,name:"scoreThreshold",type:"number"}]},{tfOpName:"NonMaxSuppressionV4",category:"dynamic",inputs:[{start:0,name:"boxes",type:"tensor"},{start:1,name:"scores",type:"tensor"},{start:2,name:"maxOutputSize",type:"number"},{start:3,name:"iouThreshold",type:"number"},{start:4,name:"scoreThreshold",type:"number"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0},{tfName:"T_threshold",name:"threshold",type:"dtype",notSupported:!0},{tfName:"pad_to_max_output_size",name:"padToMaxOutputSize",type:"bool"}]},{tfOpName:"NonMaxSuppressionV5",category:"dynamic",inputs:[{start:0,name:"boxes",type:"tensor"},{start:1,name:"scores",type:"tensor"},{start:2,name:"maxOutputSize",type:"number"},{start:3,name:"iouThreshold",type:"number"},{start:4,name:"scoreThreshold",type:"number"},{start:5,name:"softNmsSigma",type:"number"}]},{tfOpName:"Where",category:"dynamic",inputs:[{start:0,name:"condition",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"ListDiff",category:"dynamic",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"y",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]}],iC=[{tfOpName:"LowerBound",category:"evaluation",inputs:[{start:0,name:"sortedSequence",type:"tensor"},{start:1,name:"values",type:"tensor"}]},{tfOpName:"TopKV2",category:"evaluation",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"k",type:"number"}],attrs:[{tfName:"sorted",name:"sorted",type:"bool"}]},{tfOpName:"UpperBound",category:"evaluation",inputs:[{start:0,name:"sortedSequence",type:"tensor"},{start:1,name:"values",type:"tensor"}]},{tfOpName:"Unique",category:"evaluation",inputs:[{start:0,name:"x",type:"tensor"}]},{tfOpName:"UniqueV2",category:"evaluation",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"axis",type:"number"}]}],oC=[{tfOpName:"PlaceholderWithDefault",category:"graph",inputs:[{start:0,name:"default",type:"tensor"}],attrs:[{tfName:"shape",name:"shape",type:"shape"},{tfName:"dtype",name:"dtype",type:"dtype"}]},{tfOpName:"Placeholder",category:"graph",attrs:[{tfName:"shape",name:"shape",type:"shape"},{tfName:"dtype",name:"dtype",type:"dtype"}]},{tfOpName:"Const",category:"graph"},{tfOpName:"Identity",category:"graph",inputs:[{start:0,name:"x",type:"tensor"}]},{tfOpName:"IdentityN",category:"graph",inputs:[{start:0,end:0,name:"x",type:"tensors"}]},{tfOpName:"Snapshot",category:"graph",inputs:[{start:0,name:"x",type:"tensor"}]},{tfOpName:"Rank",category:"graph",inputs:[{start:0,name:"x",type:"tensor"}]},{tfOpName:"Size",category:"graph",inputs:[{start:0,name:"x",type:"tensor"}]},{tfOpName:"Shape",category:"graph",inputs:[{start:0,name:"x",type:"tensor"}]},{tfOpName:"ShapeN",category:"graph",inputs:[{start:0,end:0,name:"x",type:"tensors"}]},{tfOpName:"Print",category:"graph",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"data",type:"tensors"}],attrs:[{tfName:"message",name:"message",type:"string"},{tfName:"first_n",name:"firstN",type:"number",notSupported:!0},{tfName:"summarize",name:"summarize",type:"number",defaultValue:3}]},{tfOpName:"NoOp",category:"graph",inputs:[]},{tfOpName:"StopGradient",category:"graph",inputs:[{start:0,name:"x",type:"tensor"}]},{tfOpName:"FakeQuantWithMinMaxVars",category:"graph",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"min",name:"min",type:"number"},{tfName:"max",name:"max",type:"number"}]}],lC=[{tfOpName:"HashTable",category:"hash_table",inputs:[],attrs:[{tfName:"shared_name",name:"sharedName",type:"string"},{tfName:"use_node_name_sharing",name:"useNodeNameSharing",type:"bool"},{tfName:"key_dtype",name:"keyDType",type:"dtype"},{tfName:"value_dtype",name:"valueDType",type:"dtype"}]},{tfOpName:"HashTableV2",category:"hash_table",inputs:[],attrs:[{tfName:"shared_name",name:"sharedName",type:"string"},{tfName:"use_node_name_sharing",name:"useNodeNameSharing",type:"bool"},{tfName:"key_dtype",name:"keyDType",type:"dtype"},{tfName:"value_dtype",name:"valueDType",type:"dtype"}]},{tfOpName:"LookupTableImport",category:"hash_table",inputs:[{start:0,name:"tableHandle",type:"tensor"},{start:1,name:"keys",type:"tensor"},{start:2,name:"values",type:"tensor"}],attrs:[{tfName:"Tin",name:"tIn",type:"dtype",notSupported:!0},{tfName:"Tout",name:"tOut",type:"dtype",notSupported:!0}]},{tfOpName:"LookupTableImportV2",category:"hash_table",inputs:[{start:0,name:"tableHandle",type:"tensor"},{start:1,name:"keys",type:"tensor"},{start:2,name:"values",type:"tensor"}],attrs:[{tfName:"Tin",name:"tIn",type:"dtype",notSupported:!0},{tfName:"Tout",name:"tOut",type:"dtype",notSupported:!0}]},{tfOpName:"LookupTableFind",category:"hash_table",inputs:[{start:0,name:"tableHandle",type:"tensor"},{start:1,name:"keys",type:"tensor"},{start:2,name:"defaultValue",type:"tensor"}],attrs:[{tfName:"Tin",name:"tIn",type:"dtype",notSupported:!0},{tfName:"Tout",name:"tOut",type:"dtype",notSupported:!0}]},{tfOpName:"LookupTableFindV2",category:"hash_table",inputs:[{start:0,name:"tableHandle",type:"tensor"},{start:1,name:"keys",type:"tensor"},{start:2,name:"defaultValue",type:"tensor"}],attrs:[{tfName:"Tin",name:"tIn",type:"dtype",notSupported:!0},{tfName:"Tout",name:"tOut",type:"dtype",notSupported:!0}]},{tfOpName:"LookupTableSize",category:"hash_table",inputs:[{start:0,name:"tableHandle",type:"tensor"}]},{tfOpName:"LookupTableSizeV2",category:"hash_table",inputs:[{start:0,name:"tableHandle",type:"tensor"}]},{tfOpName:"InitializeTable",category:"hash_table",inputs:[{start:0,name:"tableHandle",type:"tensor"},{start:1,name:"keys",type:"tensor"},{start:2,name:"values",type:"tensor"}]},{tfOpName:"InitializeTableV2",category:"hash_table",inputs:[{start:0,name:"tableHandle",type:"tensor"},{start:1,name:"keys",type:"tensor"},{start:2,name:"values",type:"tensor"}]}],uC=[{tfOpName:"ResizeBilinear",category:"image",inputs:[{start:0,name:"images",type:"tensor"},{start:1,name:"size",type:"number[]"}],attrs:[{tfName:"align_corners",name:"alignCorners",type:"bool"},{tfName:"half_pixel_centers",name:"halfPixelCenters",type:"bool"},{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"ResizeNearestNeighbor",category:"image",inputs:[{start:0,name:"images",type:"tensor"},{start:1,name:"size",type:"number[]"}],attrs:[{tfName:"align_corners",name:"alignCorners",type:"bool"},{tfName:"half_pixel_centers",name:"halfPixelCenters",type:"bool"},{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"CropAndResize",category:"image",inputs:[{start:0,name:"image",type:"tensor"},{start:1,name:"boxes",type:"tensor"},{start:2,name:"boxInd",type:"tensor"},{start:3,name:"cropSize",type:"number[]"}],attrs:[{tfName:"method",name:"method",type:"string"},{tfName:"extrapolation_value",name:"extrapolationValue",type:"number"}]},{tfOpName:"ImageProjectiveTransformV3",category:"image",inputs:[{start:0,name:"images",type:"tensor"},{start:1,name:"transforms",type:"tensor"},{start:2,name:"outputShape",type:"number[]"},{start:3,name:"fillValue",type:"number"}],attrs:[{tfName:"interpolation",name:"interpolation",type:"string"},{tfName:"fill_mode",name:"fillMode",type:"string"}]}],cC=[{tfOpName:"Equal",category:"logical",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"NotEqual",category:"logical",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Greater",category:"logical",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"GreaterEqual",category:"logical",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Less",category:"logical",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"LessEqual",category:"logical",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"LogicalAnd",category:"logical",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"LogicalNot",category:"logical",inputs:[{start:0,name:"a",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"LogicalOr",category:"logical",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Select",category:"logical",inputs:[{start:0,name:"condition",type:"tensor"},{start:1,name:"a",type:"tensor"},{start:2,name:"b",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"SelectV2",category:"logical",inputs:[{start:0,name:"condition",type:"tensor"},{start:1,name:"a",type:"tensor"},{start:2,name:"b",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"BitwiseAnd",category:"logical",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"y",type:"tensor"}]}],hC=[{tfOpName:"_FusedMatMul",category:"matrices",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"},{start:2,end:0,name:"args",type:"tensors"}],attrs:[{tfName:"num_args",name:"numArgs",type:"number"},{tfName:"fused_ops",name:"fusedOps",type:"string[]",defaultValue:[]},{tfName:"epsilon",name:"epsilon",type:"number",defaultValue:1e-4},{tfName:"transpose_a",name:"transposeA",type:"bool",defaultValue:!1},{tfName:"transpose_b",name:"transposeB",type:"bool",defaultValue:!1},{tfName:"leakyrelu_alpha",name:"leakyreluAlpha",type:"number",defaultValue:.2},{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"MatMul",category:"matrices",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"}],attrs:[{tfName:"transpose_a",name:"transposeA",type:"bool",defaultValue:!1},{tfName:"transpose_b",name:"transposeB",type:"bool",defaultValue:!1},{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"BatchMatMul",category:"matrices",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"}],attrs:[{tfName:"adj_x",name:"transposeA",type:"bool",defaultValue:!1},{tfName:"adj_y",name:"transposeB",type:"bool",defaultValue:!1},{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"BatchMatMulV2",category:"matrices",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"}],attrs:[{tfName:"adj_x",name:"transposeA",type:"bool",defaultValue:!1},{tfName:"adj_y",name:"transposeB",type:"bool",defaultValue:!1},{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Transpose",category:"matrices",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"perm",type:"number[]"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Einsum",category:"matrices",inputs:[{start:0,end:0,name:"tensors",type:"tensors"}],attrs:[{tfName:"equation",name:"equation",type:"string"},{tfName:"N",name:"n",type:"number",defaultValue:2},{tfName:"T",name:"dtype",type:"dtype"}]},{tfOpName:"MatrixBandPart",category:"matrices",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"numLower",type:"tensor"},{start:1,name:"numUpper",type:"tensor"}]}],dC=[{tfOpName:"EuclideanNorm",category:"normalization",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"axis",type:"number[]"}],attrs:[{tfName:"keep_dims",name:"keepDims",type:"bool",defaultValue:!1}]},{tfOpName:"FusedBatchNorm",category:"normalization",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"scale",type:"tensor"},{start:2,name:"offset",type:"tensor"},{start:3,name:"mean",type:"tensor"},{start:4,name:"variance",type:"tensor"}],attrs:[{tfName:"epsilon",name:"epsilon",type:"number",defaultValue:.001},{tfName:"data_format",name:"dataFormat",type:"string",notSupported:!0}]},{tfOpName:"FusedBatchNormV2",category:"normalization",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"scale",type:"tensor"},{start:2,name:"offset",type:"tensor"},{start:3,name:"mean",type:"tensor"},{start:4,name:"variance",type:"tensor"}],attrs:[{tfName:"epsilon",name:"epsilon",type:"number",defaultValue:.001},{tfName:"data_format",name:"dataFormat",type:"string",notSupported:!0}]},{tfOpName:"FusedBatchNormV3",category:"normalization",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"scale",type:"tensor"},{start:2,name:"offset",type:"tensor"},{start:3,name:"mean",type:"tensor"},{start:4,name:"variance",type:"tensor"}],attrs:[{tfName:"epsilon",name:"epsilon",type:"number",defaultValue:.001},{tfName:"data_format",name:"dataFormat",type:"string",notSupported:!0}]},{tfOpName:"LRN",category:"normalization",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"depth_radius",name:"radius",type:"number",defaultValue:5},{tfName:"bias",name:"bias",type:"number",defaultValue:1},{tfName:"alpha",name:"alpha",type:"number",defaultValue:1},{tfName:"beta",name:"beta",type:"number",defaultValue:.5}]},{tfOpName:"Softmax",category:"normalization",inputs:[{start:0,name:"x",type:"tensor"}]},{tfOpName:"LogSoftmax",category:"normalization",inputs:[{start:0,name:"x",type:"tensor"}]}],pC=[{tfOpName:"Bincount",category:"reduction",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"size",type:"number"},{start:2,name:"weights",type:"tensor"}]},{tfOpName:"DenseBincount",category:"reduction",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"size",type:"number"},{start:2,name:"weights",type:"tensor"}],attrs:[{tfName:"binary_output",name:"binaryOutput",type:"bool"}]},{tfOpName:"Max",category:"reduction",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"axis",type:"number[]"}],attrs:[{tfName:"keep_dims",name:"keepDims",type:"bool"}]},{tfOpName:"Mean",category:"reduction",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"axis",type:"number[]"}],attrs:[{tfName:"keep_dims",name:"keepDims",type:"bool"}]},{tfOpName:"Min",category:"reduction",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"axis",type:"number[]"}],attrs:[{tfName:"keep_dims",name:"keepDims",type:"bool"}]},{tfOpName:"Sum",category:"reduction",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"axis",type:"number[]"}],attrs:[{tfName:"keep_dims",name:"keepDims",type:"bool"}]},{tfOpName:"All",category:"reduction",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"axis",type:"number[]"}],attrs:[{tfName:"keep_dims",name:"keepDims",type:"bool"}]},{tfOpName:"Any",category:"reduction",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"axis",type:"number[]"}],attrs:[{tfName:"keep_dims",name:"keepDims",type:"bool"}]},{tfOpName:"ArgMax",category:"reduction",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"axis",type:"number"}]},{tfOpName:"ArgMin",category:"reduction",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"axis",type:"number"}]},{tfOpName:"Prod",category:"reduction",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"axis",type:"number[]"}],attrs:[{tfName:"keep_dims",name:"keepDims",type:"bool"},{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Cumprod",category:"reduction",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"axis",type:"number"}],attrs:[{tfName:"exclusive",name:"exclusive",type:"bool"},{tfName:"reverse",name:"reverse",type:"bool"}]},{tfOpName:"Cumsum",category:"reduction",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"axis",type:"number"}],attrs:[{tfName:"exclusive",name:"exclusive",type:"bool"},{tfName:"reverse",name:"reverse",type:"bool"}]}],fC=[{tfOpName:"ConcatV2",category:"slice_join",inputs:[{start:0,end:-1,name:"tensors",type:"tensors"},{start:-1,name:"axis",type:"number"}],attrs:[{tfName:"N",name:"n",type:"number",defaultValue:2}]},{tfOpName:"Concat",category:"slice_join",inputs:[{start:1,end:0,name:"tensors",type:"tensors"},{start:0,name:"axis",type:"number"}],attrs:[{tfName:"N",name:"n",type:"number",defaultValue:2}]},{tfOpName:"GatherV2",category:"slice_join",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"indices",type:"tensor"},{start:2,name:"axis",type:"number",defaultValue:0}],attrs:[{tfName:"batch_dims",name:"batchDims",type:"number",defaultValue:0}]},{tfOpName:"Gather",category:"slice_join",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"indices",type:"tensor"}],attrs:[{tfName:"validate_indices",name:"validateIndices",type:"bool",notSupported:!0}]},{tfOpName:"Reverse",category:"slice_join",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"dims",type:"bool[]"}]},{tfOpName:"ReverseV2",category:"slice_join",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"axis",type:"number[]"}]},{tfOpName:"Slice",category:"slice_join",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"begin",type:"number[]"},{start:2,name:"size",type:"number[]"}]},{tfOpName:"StridedSlice",category:"slice_join",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"begin",type:"number[]"},{start:2,name:"end",type:"number[]"},{start:3,name:"strides",type:"number[]"}],attrs:[{tfName:"begin_mask",name:"beginMask",type:"number",defaultValue:0},{tfName:"end_mask",name:"endMask",type:"number",defaultValue:0},{tfName:"new_axis_mask",name:"newAxisMask",type:"number",defaultValue:0},{tfName:"ellipsis_mask",name:"ellipsisMask",type:"number",defaultValue:0},{tfName:"shrink_axis_mask",name:"shrinkAxisMask",type:"number",defaultValue:0}]},{tfOpName:"Pack",category:"slice_join",inputs:[{start:0,end:0,name:"tensors",type:"tensors"}],attrs:[{tfName:"axis",name:"axis",type:"number",defaultValue:0}]},{tfOpName:"Unpack",category:"slice_join",inputs:[{start:0,name:"tensor",type:"tensor"}],attrs:[{tfName:"axis",name:"axis",type:"number",defaultValue:0},{tfName:"num",name:"num",type:"number",defaultValue:0,notSupported:!0}]},{tfOpName:"Tile",category:"slice_join",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"reps",type:"number[]"}]},{tfOpName:"Split",category:"slice_join",inputs:[{start:0,name:"axis",type:"number",defaultValue:0},{start:1,name:"x",type:"tensor"}],attrs:[{tfName:"num_split",name:"numOrSizeSplits",type:"number",defaultValue:1}]},{tfOpName:"SplitV",category:"slice_join",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"numOrSizeSplits",type:"number[]"},{start:2,name:"axis",type:"number",defaultValue:0}]},{tfOpName:"ScatterNd",category:"slice_join",inputs:[{start:0,name:"indices",type:"tensor"},{start:1,name:"values",type:"tensor"},{start:2,name:"shape",type:"number[]"}]},{tfOpName:"GatherNd",category:"slice_join",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"indices",type:"tensor"}]},{tfOpName:"SparseToDense",category:"slice_join",inputs:[{start:0,name:"sparseIndices",type:"tensor"},{start:1,name:"outputShape",type:"number[]"},{start:2,name:"sparseValues",type:"tensor"},{start:3,name:"defaultValue",type:"tensor"}],attrs:[{tfName:"validate_indices",name:"validateIndices",type:"bool",defaultValue:!1,notSupported:!0}]},{tfOpName:"TensorScatterUpdate",category:"slice_join",inputs:[{start:0,name:"tensor",type:"tensor"},{start:1,name:"indices",type:"tensor"},{start:2,name:"values",type:"tensor"}]}],mC=[{tfOpName:"SparseFillEmptyRows",category:"sparse",inputs:[{start:0,name:"indices",type:"tensor"},{start:1,name:"values",type:"tensor"},{start:2,name:"denseShape",type:"tensor"},{start:3,name:"defaultValue",type:"tensor"}]},{tfOpName:"SparseReshape",category:"sparse",inputs:[{start:0,name:"inputIndices",type:"tensor"},{start:1,name:"inputShape",type:"tensor"},{start:2,name:"newShape",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"SparseSegmentMean",category:"sparse",inputs:[{start:0,name:"data",type:"tensor"},{start:1,name:"indices",type:"tensor"},{start:2,name:"segmentIds",type:"tensor"}]},{tfOpName:"SparseSegmentSum",category:"sparse",inputs:[{start:0,name:"data",type:"tensor"},{start:1,name:"indices",type:"tensor"},{start:2,name:"segmentIds",type:"tensor"}]}],gC=[{tfOpName:"FFT",category:"spectral",inputs:[{start:0,name:"x",type:"tensor"}]},{tfOpName:"IFFT",category:"spectral",inputs:[{start:0,name:"x",type:"tensor"}]},{tfOpName:"RFFT",category:"spectral",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"fft_length",type:"number",notSupported:!0}]},{tfOpName:"IRFFT",category:"spectral",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"fft_length",type:"number",notSupported:!0}]}],yC=[{tfOpName:"StaticRegexReplace",category:"string",inputs:[{start:0,name:"input",type:"tensor"}],attrs:[{tfName:"pattern",name:"pattern",type:"string"},{tfName:"rewrite",name:"rewrite",type:"string"},{tfName:"replace_global",name:"replaceGlobal",type:"bool"}]},{tfOpName:"StringNGrams",category:"string",inputs:[{start:0,name:"data",type:"tensor"},{start:1,name:"dataSplits",type:"tensor"}],attrs:[{tfName:"separator",name:"separator",type:"string"},{tfName:"ngram_widths",name:"nGramWidths",type:"number[]"},{tfName:"left_pad",name:"leftPad",type:"string"},{tfName:"right_pad",name:"rightPad",type:"string"},{tfName:"pad_width",name:"padWidth",type:"number"},{tfName:"preserve_short_sequences",name:"preserveShortSequences",type:"bool"}],outputs:["ngrams","ngrams_splits"]},{tfOpName:"StringSplit",category:"string",inputs:[{start:0,name:"input",type:"tensor"},{start:1,name:"delimiter",type:"tensor"}],attrs:[{tfName:"skip_empty",name:"skipEmpty",type:"bool"}],outputs:["indices","values","shape"]},{tfOpName:"StringToHashBucketFast",category:"string",inputs:[{start:0,name:"input",type:"tensor"}],attrs:[{tfName:"num_buckets",name:"numBuckets",type:"number"}]}],bC=[{tfOpName:"Cast",category:"transformation",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"SrcT",name:"sdtype",type:"dtype",notSupported:!0},{tfName:"DstT",name:"dtype",type:"dtype"}]},{tfOpName:"ExpandDims",category:"transformation",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"axis",type:"number"}]},{tfOpName:"MirrorPad",category:"transformation",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"padding",type:"number[]"}],attrs:[{tfName:"mode",name:"mode",type:"string"}]},{tfOpName:"Pad",category:"transformation",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"padding",type:"number[]"}],attrs:[{tfName:"constant_value",name:"constantValue",type:"number",defaultValue:0}]},{tfOpName:"PadV2",category:"transformation",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"padding",type:"number[]"},{start:2,name:"constantValue",type:"number",defaultValue:0}]},{tfOpName:"Reshape",category:"transformation",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"shape",type:"number[]"}]},{tfOpName:"EnsureShape",category:"transformation",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"shape",type:"number[]"}]},{tfOpName:"Squeeze",category:"transformation",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"axis",tfDeprecatedName:"squeeze_dims",name:"axis",type:"number[]"}]},{tfOpName:"SpaceToBatchND",category:"transformation",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"blockShape",type:"number[]"},{start:2,name:"paddings",type:"number[]"}]},{tfOpName:"BatchToSpaceND",category:"transformation",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"blockShape",type:"number[]"},{start:2,name:"crops",type:"number[]"}]},{tfOpName:"DepthToSpace",category:"transformation",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"block_size",name:"blockSize",type:"number"},{tfName:"data_format",name:"dataFormat",type:"string"}]},{tfOpName:"BroadcastTo",category:"transformation",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"shape",type:"number[]"}],attrs:[]},{tfOpName:"BroadcastArgs",category:"transformation",inputs:[{start:0,name:"s0",type:"tensor"},{start:1,name:"s1",type:"tensor"}],attrs:[]}];class wC{static get Instance(){return this._instance||(this._instance=new this)}constructor(){const e=[].concat(...[a,i,o,l,u,c,h,d,p,f,m,g,y,b,w,v,x,A,k].map((e=>e.json)));this.opMappers=e.reduce(((e,t)=>(e[t.tfOpName]=t,e)),{})}transformGraph(e,t={}){const n=e.node,s=[],r=[],a=[],i=n.reduce(((e,t)=>(e[t.name]=this.mapNode(t),t.op.startsWith("Placeholder")?s.push(e[t.name]):"Const"===t.op?r.push(e[t.name]):null!=t.input&&0!==t.input.length||a.push(e[t.name]),e)),{});let o=[];const l=[];let u={},c={};null!=t&&(u=this.mapSignatureEntries(t.inputs),c=this.mapSignatureEntries(t.outputs));const h=Object.keys(i);h.forEach((e=>{const t=i[e];t.inputNames.forEach(((e,n)=>{const[s,,r]=Xk(e),a=i[s];if(null!=a.outputs){const e=a.outputs.indexOf(r);if(-1!==e){const r=`${s}:${e}`;t.inputNames[n]=r}}t.inputs.push(a),a.children.push(t)}))})),0===Object.keys(c).length?h.forEach((e=>{const t=i[e];0===t.children.length&&l.push(t)})):Object.keys(c).forEach((e=>{const[t]=Xk(e),n=i[t];null!=n&&(n.signatureKey=c[e],l.push(n))})),Object.keys(u).length>0?Object.keys(u).forEach((e=>{const[t]=Xk(e),n=i[t];n&&(n.signatureKey=u[e],o.push(n))})):o=s;let d={};null!=e.library&&null!=e.library.function&&(d=e.library.function.reduce(((e,t)=>(e[t.signature.name]=this.mapFunction(t),e)),{}));const p={nodes:i,inputs:o,outputs:l,weights:r,placeholders:s,signature:t,functions:d};return a.length>0&&(p.initNodes=a),p}mapSignatureEntries(e){return Object.keys(e||{}).reduce(((t,n)=>(t[e[n].name]=n,t)),{})}mapNode(e){const t=jk(e.op)||this.opMappers[e.op]||{};null==e.attr&&(e.attr={});const n={name:e.name,op:e.op,category:t.category,inputNames:(e.input||[]).map((e=>e.startsWith("^")?e.slice(1):e)),inputs:[],children:[],inputParams:{},attrParams:{},rawAttrs:e.attr,outputs:t.outputs};return null!=t.inputs&&(n.inputParams=t.inputs.reduce(((e,t)=>(e[t.name]={type:t.type,inputIndexStart:t.start,inputIndexEnd:t.end},e)),{})),null!=t.attrs&&(n.attrParams=t.attrs.reduce(((t,n)=>{const s=n.type;let r;switch(n.type){case"string":r=xC(e.attr,n.tfName,n.defaultValue),void 0===r&&n.tfDeprecatedName&&(r=xC(e.attr,n.tfDeprecatedName,n.defaultValue));break;case"string[]":r=OC(e.attr,n.tfName,n.defaultValue),void 0===r&&n.tfDeprecatedName&&(r=OC(e.attr,n.tfDeprecatedName,n.defaultValue));break;case"number":r=kC(e.attr,n.tfName,n.defaultValue||0),void 0===r&&n.tfDeprecatedName&&(r=kC(e.attr,n.tfDeprecatedName,n.defaultValue));break;case"number[]":r=NC(e.attr,n.tfName,n.defaultValue),void 0===r&&n.tfDeprecatedName&&(r=NC(e.attr,n.tfDeprecatedName,n.defaultValue));break;case"bool":r=AC(e.attr,n.tfName,n.defaultValue),void 0===r&&n.tfDeprecatedName&&(r=AC(e.attr,n.tfDeprecatedName,n.defaultValue));break;case"bool[]":r=DC(e.attr,n.tfName,n.defaultValue),void 0===r&&n.tfDeprecatedName&&(r=DC(e.attr,n.tfDeprecatedName,n.defaultValue));break;case"shape":r=TC(e.attr,n.tfName,n.defaultValue),void 0===r&&n.tfDeprecatedName&&(r=TC(e.attr,n.tfDeprecatedName,n.defaultValue));break;case"shape[]":r=RC(e.attr,n.tfName,n.defaultValue),void 0===r&&n.tfDeprecatedName&&(r=RC(e.attr,n.tfDeprecatedName,n.defaultValue));break;case"dtype":r=EC(e.attr,n.tfName,n.defaultValue),void 0===r&&n.tfDeprecatedName&&(r=EC(e.attr,n.tfDeprecatedName,n.defaultValue));break;case"dtype[]":r=_C(e.attr,n.tfName,n.defaultValue),void 0===r&&n.tfDeprecatedName&&(r=_C(e.attr,n.tfDeprecatedName,n.defaultValue));break;case"func":r=SC(e.attr,n.tfName,n.defaultValue),void 0===r&&n.tfDeprecatedName&&(r=SC(e.attr,n.tfDeprecatedName,n.defaultValue));break;case"tensor":case"tensors":break;default:throw new Error(`Unsupported param type: ${n.type} for op: ${e.op}`)}return t[n.name]={value:r,type:s},t}),{})),n}mapFunction(e){const t=e.nodeDef,n=[];let s={};null!=t&&(s=t.reduce(((e,t)=>(e[t.name]=this.mapNode(t),"Const"===t.op&&n.push(e[t.name]),e)),{}));const r=[],a=[];e.signature.inputArg.forEach((e=>{const[t]=Xk(e.name),n={name:t,op:"Placeholder",inputs:[],inputNames:[],category:"graph",inputParams:{},attrParams:{dtype:{value:CC(e.type),type:"dtype"}},children:[]};n.signatureKey=e.name,r.push(n),s[t]=n}));Object.keys(s).forEach((e=>{const t=s[e];t.inputNames.forEach(((e,n)=>{const[r,,a]=Xk(e),i=s[r];if(null!=i.outputs){const e=i.outputs.indexOf(a);if(-1!==e){const s=`${r}:${e}`;t.inputNames[n]=s}}t.inputs.push(i),i.children.push(t)}))}));const i=e.ret;e.signature.outputArg.forEach((e=>{const[t,n]=Xk(i[e.name]),r=s[t];null!=r&&(r.defaultOutput=n,a.push(r))}));const o=this.mapArgsToSignature(e);return{nodes:s,inputs:r,outputs:a,weights:n,placeholders:[],signature:o}}mapArgsToSignature(e){return{methodName:e.signature.name,inputs:e.signature.inputArg.reduce(((e,t)=>(e[t.name]=this.mapArgToTensorInfo(t),e)),{}),outputs:e.signature.outputArg.reduce(((t,n)=>(t[n.name]=this.mapArgToTensorInfo(n,e.ret),t)),{})}}mapArgToTensorInfo(e,t){let n=e.name;return null!=t&&(n=t[n]),{name:n,dtype:e.type}}}function vC(e,t){const n=Array.isArray(e)?String.fromCharCode.apply(null,e):function(e){const t=Sn().global;if(void 0!==t.atob)return t.atob(e);if("undefined"!=typeof Buffer)return new Buffer(e,"base64").toString();throw new Error("Unable to decode base64 in this environment. Missing built-in atob() or Buffer()")}(e);return t?n:n.toLowerCase()}function xC(e,t,n,s=!1){const r=e[t];return null!=r?vC(r.s,s):n}function AC(e,t,n){const s=e[t];return s?s.b:n}function kC(e,t,n){const s=e[t]||{},r=null!=s.i?s.i:null!=s.f?s.f:n;return"number"==typeof r?r:parseInt(r,10)}function CC(e){switch("string"==typeof e&&(e=Uk[e]),e){case Uk.DT_FLOAT:case Uk.DT_HALF:return"float32";case Uk.DT_INT32:case Uk.DT_INT64:case Uk.DT_INT8:case Uk.DT_UINT8:return"int32";case Uk.DT_BOOL:return"bool";case Uk.DT_DOUBLE:return"float32";case Uk.DT_STRING:return"string";case Uk.DT_COMPLEX64:case Uk.DT_COMPLEX128:return"complex64";default:return null}}function SC(e,t,n){const s=e[t];return s&&s.func?s.func.name:n}function EC(e,t,n){const s=e[t];return s&&s.type?CC(s.type):n}function _C(e,t,n){const s=e[t];return s&&s.list&&s.list.type?s.list.type.map((e=>CC(e))):n}function IC(e){if(!e.unknownRank)return null!=e.dim?e.dim.map((e=>"number"==typeof e.size?e.size:parseInt(e.size,10))):[]}function TC(e,t,n){const s=e[t];return s&&s.shape?IC(s.shape):n}function NC(e,t,n){const s=e[t];return s?((s.list.f&&s.list.f.length?s.list.f:s.list.i)||[]).map((e=>"number"==typeof e?e:parseInt(e,10))):n}function OC(e,t,n,s=!1){const r=e[t];return r&&r.list&&r.list.s?r.list.s.map((e=>vC(e,s))):n}function RC(e,t,n){const s=e[t];return s&&s.list&&s.list.shape?s.list.shape.map((e=>IC(e))):n}function DC(e,t,n){const s=e[t];return s&&s.list&&s.list.b?s.list.b:n}class MC{constructor(e,t,n){this.node=e,this.tensorMap=t,this.context=n,this.inputs=[],this.attrs={},this.inputs=e.inputNames.map((e=>this.getInput(e))),null!=e.rawAttrs&&(this.attrs=Object.keys(e.rawAttrs).reduce(((e,t)=>(e[t]=this.getAttr(t),e)),{}))}getInput(e){return $k(e,this.tensorMap,this.context)}getAttr(e,t){const n=this.node.rawAttrs[e];if(null!=n.tensor)return $k(e,this.tensorMap,this.context);if(null!=n.i||null!=n.f)return kC(this.node.rawAttrs,e,t);if(null!=n.s)return xC(this.node.rawAttrs,e,t);if(null!=n.b)return AC(this.node.rawAttrs,e,t);if(null!=n.shape)return TC(this.node.rawAttrs,e,t);if(null!=n.type)return EC(this.node.rawAttrs,e,t);if(null!=n.list){if(null!=n.list.i||null!=n.list.f)return NC(this.node.rawAttrs,e,t);if(null!=n.list.s)return OC(this.node.rawAttrs,e,t);if(null!=n.list.shape)return RC(this.node.rawAttrs,e,t);if(null!=n.list.b)return DC(this.node.rawAttrs,e,t);if(null!=n.list.type)return _C(this.node.rawAttrs,e,t)}return t}}function FC(e,t,n=""){if("number"!=typeof e&&"number"!=typeof t){qt(e.length===t.length,(()=>n+` Shapes ${e} and ${t} must match`));for(let s=0;sn+` Shapes ${e} and ${t} must match`))}}}function BC(e){return"number"!=typeof e&&!e.some((e=>e<0))}function zC(e,t,n){let s=LC(e,n);const r=!BC(s);if(r&&0===t.length)throw new Error(`Tried to calculate elements of an empty list with non-fully-defined elementShape: ${s}`);if(r&&t.forEach((e=>{s=LC(e.shape,s)})),!BC(s))throw new Error(`Non-fully-defined elementShape: ${s}`);return s}function LC(e,t){if("number"==typeof e)return t;if("number"==typeof t)return e;if(e.length!==t.length)throw new Error(`Incompatible ranks during merge: ${e} vs. ${t}`);const n=[];for(let s=0;s=0&&a>=0&&r!==a)throw new Error(`Incompatible shape during merge: ${e} vs. ${t}`);n[s]=r>=0?r:a}return n}class PC{constructor(e,t,n,s,r,a,i){this.name=e,this.dtype=t,this.maxSize=n,this.elementShape=s,this.identicalElementShapes=r,this.dynamicSize=a,this.clearAfterRead=i,this.tensors=[],this.closed_=!1,this.idTensor=Wl(0),Co(this.idTensor)}get id(){return this.idTensor.id}get closed(){return this.closed_}clearAndClose(e){this.tensors.forEach((t=>{null!=e&&e.has(t.tensor.id)||t.tensor.dispose()})),this.tensors=[],this.closed_=!0,this.idTensor.dispose()}size(){return this.tensors.length}read(e){if(this.closed_)throw new Error(`TensorArray ${this.name} has already been closed.`);if(e<0||e>=this.size())throw new Error(`Tried to read from index ${e}, but array size is: ${this.size()}`);const t=this.tensors[e];if(t.cleared)throw new Error(`TensorArray ${this.name}: Could not read index ${e} twice because it was cleared after a previous read (perhaps try setting clear_after_read = false?).`);return this.clearAfterRead&&(t.cleared=!0),t.read=!0,t.tensor}readMany(e){return e.map((e=>this.read(e)))}write(e,t){if(this.closed_)throw new Error(`TensorArray ${this.name} has already been closed.`);if(e<0||!this.dynamicSize&&e>=this.maxSize)throw new Error(`Tried to write to index ${e}, but array is not resizeable and size is: ${this.maxSize}`);const n=this.tensors[e]||{};if(t.dtype!==this.dtype)throw new Error(`TensorArray ${this.name}: Could not write to TensorArray index ${e},\n because the value dtype is ${t.dtype}, but TensorArray dtype is ${this.dtype}.`);if(0!==this.size()||null!=this.elementShape&&0!==this.elementShape.length||(this.elementShape=t.shape),FC(this.elementShape,t.shape,`TensorArray ${this.name}: Could not write to TensorArray index ${e}.`),n.read)throw new Error(`TensorArray ${this.name}: Could not write to TensorArray index ${e}, because it has already been read.`);if(n.written)throw new Error(`TensorArray ${this.name}: Could not write to TensorArray index ${e}, because it has already been written.`);n.tensor=t,Co(t),n.written=!0,this.tensors[e]=n}writeMany(e,t){if(e.length!==t.length)throw new Error(`TensorArray ${this.name}: could not write multiple tensors,because the index size: ${e.length} is not the same as tensors size: ${t.length}.`);e.forEach(((e,n)=>this.write(e,t[n])))}gather(e,t){if(t&&t!==this.dtype)throw new Error(`TensorArray dtype is ${this.dtype} but gather requested dtype ${t}`);if(e)e=e.slice(0,this.size());else{e=[];for(let t=0;t=this.maxSize)throw new Error(`Max index must be < array size (${n} vs. ${this.maxSize})`);this.writeMany(e,$p(t,0))}split(e,t){if(t.dtype!==this.dtype)throw new Error(`TensorArray dtype is ${this.dtype} but tensor has dtype ${t.dtype}`);let n=0;const s=e.map((e=>(n+=e,n)));if(n!==t.shape[0])throw new Error(`Expected sum of lengths to be equal to\n tensor.shape[0], but sum of lengths is\n ${n}, and tensor's shape is: ${t.shape}`);if(!this.dynamicSize&&e.length!==this.maxSize)throw new Error(`TensorArray's size is not equal to the size of lengths (${this.maxSize} vs. ${e.length}), and the TensorArray is not marked as dynamically resizeable`);const r=0===n?0:t.size/n,a=[];Ao((()=>{t=Tc(t,[1,n,r]);for(let n=0;n{if(n!==e.dtype)throw new Error(`Invalid data types; op elements ${n}, but list elements ${e.dtype}`);FC(t,e.shape,"TensorList shape mismatch: "),Co(e)})),this.idTensor=Wl(0),this.maxNumElements=s,Co(this.idTensor)}copy(){return new VC([...this.tensors],this.elementShape,this.elementDtype)}clearAndClose(e){this.tensors.forEach((t=>{null!=e&&e.has(t.id)||t.dispose()})),this.tensors.length=0,this.idTensor.dispose()}size(){return this.tensors.length}stack(e,t,n=-1){if(t!==this.elementDtype)throw new Error(`Invalid data types; op elements ${t}, but list elements ${this.elementDtype}`);if(-1!==n&&this.tensors.length!==n)throw new Error(`Operation expected a list with ${n} elements but got a list with ${this.tensors.length} elements.`);FC(e,this.elementShape,"TensorList shape mismatch: ");const s=zC(this.elementShape,this.tensors,e);return Ao((()=>{const e=this.tensors.map((e=>Tc(e,s)));return Np(e,0)}))}popBack(e,t){if(t!==this.elementDtype)throw new Error(`Invalid data types; op elements ${t}, but list elements ${this.elementDtype}`);if(0===this.size())throw new Error("Trying to pop from an empty list.");const n=zC(this.elementShape,this.tensors,e),s=this.tensors.pop();return s.kept=!1,FC(s.shape,e,"TensorList shape mismatch: "),Tc(s,n)}pushBack(e){if(e.dtype!==this.elementDtype)throw new Error(`Invalid data types; op elements ${e.dtype}, but list elements ${this.elementDtype}`);if(FC(e.shape,this.elementShape,"TensorList shape mismatch: "),this.maxNumElements===this.size())throw new Error("Trying to push element into a full list.");Co(e),this.tensors.push(e)}resize(e){if(e<0)throw new Error(`TensorListResize expects size to be non-negative. Got: ${e}`);if(-1!==this.maxNumElements&&e>this.maxNumElements)throw new Error(`TensorListResize input size ${e} is greater maxNumElement ${this.maxNumElements}.`);const t=new VC([],this.elementShape,this.elementDtype,this.maxNumElements);t.tensors.length=e;for(let n=0;nthis.tensors.length)throw new Error(`Trying to access element ${e} in a list with ${this.tensors.length} elements.`);if(null==this.tensors[e])throw new Error(`element at index ${e} is null.`);FC(this.tensors[e].shape,t,"TensorList shape mismatch: ");const s=zC(this.elementShape,this.tensors,t);return Tc(this.tensors[e],s)}setItem(e,t){if(t.dtype!==this.elementDtype)throw new Error(`Invalid data types; op elements ${t.dtype}, but list elements ${this.elementDtype}`);if(e<0||-1!==this.maxNumElements&&e>=this.maxNumElements)throw new Error(`Trying to set element ${e} in a list with max ${this.maxNumElements} elements.`);FC(this.elementShape,t.shape,"TensorList shape mismatch: "),Co(t),null!=this.tensors[e]&&(this.tensors[e].kept=!1),this.tensors[e]=t}gather(e,t,n){if(t!==this.elementDtype)throw new Error(`Invalid data types; op elements ${t}, but list elements ${this.elementDtype}`);FC(this.elementShape,n,"TensorList shape mismatch: "),e=e.slice(0,this.size());const s=zC(this.elementShape,this.tensors,n);return 0===e.length?yo([],[0].concat(s)):Ao((()=>{const t=e.map((e=>Tc(this.tensors[e],s)));return Np(t,0)}))}concat(e,t){if(e&&e!==this.elementDtype)throw new Error(`TensorList dtype is ${this.elementDtype} but concat requested dtype ${e}`);FC(this.elementShape,t,"TensorList shape mismatch: ");const n=zC(this.elementShape,this.tensors,t);return 0===this.size()?yo([],[0].concat(n)):Ao((()=>{const e=this.tensors.map((e=>Tc(e,n)));return Rc(e,0)}))}}const WC=async(e,t,n)=>{switch(e.op){case"If":case"StatelessIf":{const s=Hk("thenBranch",e,t,n),r=Hk("elseBranch",e,t,n),a=Hk("cond",e,t,n),i=Hk("args",e,t,n);return(await a.data())[0]?n.functionMap[s].executeFunctionAsync(i,n.tensorArrayMap,n.tensorListMap):n.functionMap[r].executeFunctionAsync(i,n.tensorArrayMap,n.tensorListMap)}case"While":case"StatelessWhile":{const s=Hk("body",e,t,n),r=Hk("cond",e,t,n),a=Hk("args",e,t,n),i=await n.functionMap[r].executeFunctionAsync(a,n.tensorArrayMap,n.tensorListMap),o=a.map((e=>e.id));let l=await i[0].data();i.forEach((e=>{e.kept||-1!==o.indexOf(e.id)||e.dispose()}));let u=a;for(;l[0];){const e=u;u=await n.functionMap[s].executeFunctionAsync(u,n.tensorArrayMap,n.tensorListMap);const t=u.map((e=>e.id));e.forEach((e=>{e.kept||-1!==o.indexOf(e.id)||-1!==t.indexOf(e.id)||e.dispose()}));const a=await n.functionMap[r].executeFunctionAsync(u,n.tensorArrayMap,n.tensorListMap);l=await a[0].data(),a.forEach((e=>{e.kept||-1!==o.indexOf(e.id)||-1!==t.indexOf(e.id)||e.dispose()}))}return u}case"LoopCond":return[Jk(Hk("pred",e,t,n))];case"Switch":{const s=Hk("pred",e,t,n);let r=Hk("data",e,t,n);return r.kept||(r=Jk(r)),(await s.data())[0]?[void 0,r]:[r,void 0]}case"Merge":{const s=e.inputNames.find((e=>void 0!==$k(e,t,n)));if(s){return[Jk($k(s,t,n))]}return}case"Enter":{const s=Hk("frameName",e,t,n),r=Hk("tensor",e,t,n);return n.enterFrame(s),[Jk(r)]}case"Exit":{const s=Hk("tensor",e,t,n);return n.exitFrame(),[Jk(s)]}case"NextIteration":{const s=Hk("tensor",e,t,n);return n.nextIteration(),[Jk(s)]}case"TensorArrayV3":{const s=Hk("size",e,t,n),r=Hk("dtype",e,t,n),a=Hk("elementShape",e,t,n),i=Hk("dynamicSize",e,t,n),o=Hk("clearAfterRead",e,t,n),l=Hk("identicalElementShapes",e,t,n),u=Hk("name",e,t,n),c=new PC(u,r,s,a,l,i,o);return n.addTensorArray(c),[c.idTensor,Wl(1)]}case"TensorArrayWriteV3":{const s=Hk("tensorArrayId",e,t,n),r=Hk("index",e,t,n),a=Hk("tensor",e,t,n),i=n.getTensorArray(s.id);return i.write(r,a),[i.idTensor]}case"TensorArrayReadV3":{const s=Hk("tensorArrayId",e,t,n),r=Hk("index",e,t,n);return[n.getTensorArray(s.id).read(r)]}case"TensorArrayGatherV3":{const s=Hk("tensorArrayId",e,t,n),r=Hk("indices",e,t,n),a=Hk("dtype",e,t,n);return[n.getTensorArray(s.id).gather(r,a)]}case"TensorArrayScatterV3":{const s=Hk("tensorArrayId",e,t,n),r=Hk("indices",e,t,n),a=Hk("tensor",e,t,n),i=n.getTensorArray(s.id);return i.scatter(r,a),[i.idTensor]}case"TensorArrayConcatV3":{const s=Hk("tensorArrayId",e,t,n),r=n.getTensorArray(s.id),a=Hk("dtype",e,t,n);return[r.concat(a)]}case"TensorArraySplitV3":{const s=Hk("tensorArrayId",e,t,n),r=Hk("tensor",e,t,n),a=Hk("lengths",e,t,n),i=n.getTensorArray(s.id);return i.split(a,r),[i.idTensor]}case"TensorArraySizeV3":{const s=Hk("tensorArrayId",e,t,n);return[Wl(n.getTensorArray(s.id).size(),"int32")]}case"TensorArrayCloseV3":{const s=Hk("tensorArrayId",e,t,n),r=n.getTensorArray(s.id);return r.clearAndClose(),[r.idTensor]}case"TensorListSetItem":{const s=Hk("tensorListId",e,t,n),r=Hk("index",e,t,n),a=Hk("tensor",e,t,n),i=n.getTensorList(s.id);return i.setItem(r,a),[i.idTensor]}case"TensorListGetItem":{const s=Hk("tensorListId",e,t,n),r=Hk("index",e,t,n),a=Hk("elementShape",e,t,n),i=Hk("elementDType",e,t,n);return[n.getTensorList(s.id).getItem(r,a,i)]}case"TensorListScatterV2":case"TensorListScatter":{const s=Hk("indices",e,t,n),r=function(e,t,n,s){if(t.length!==e.shape[0])throw new Error(`Expected len(indices) == tensor.shape[0], but saw: ${t.length} vs. ${e.shape[0]}`);const r=Math.max(...t);if(null!=s&&-1!==s&&r>=s)throw new Error(`Max index must be < array size (${r} vs. ${s})`);const a=new VC([],n,e.dtype,s),i=$p(e,0);return t.forEach(((e,t)=>{a.setItem(e,i[t])})),a}(Hk("tensor",e,t,n),s,Hk("elementShape",e,t,n),Hk("numElements",e,t,n));return n.addTensorList(r),[r.idTensor]}case"TensorListReserve":case"EmptyTensorList":{const s=Hk("elementShape",e,t,n),r=Hk("elementDType",e,t,n);let a;a="TensorListReserve"===e.op?"numElements":"maxNumElements";const i=Hk(a,e,t,n),o=function(e,t,n,s){return new VC([],e,t,s)}(s,r,0,"TensorListReserve"===e.op?-1:i);return n.addTensorList(o),[o.idTensor]}case"TensorListGather":{const s=Hk("tensorListId",e,t,n),r=Hk("indices",e,t,n),a=Hk("elementShape",e,t,n),i=Hk("elementDType",e,t,n);return[n.getTensorList(s.id).gather(r,i,a)]}case"TensorListStack":{const s=Hk("tensorListId",e,t,n),r=Hk("elementShape",e,t,n),a=Hk("elementDType",e,t,n),i=Hk("numElements",e,t,n);return[n.getTensorList(s.id).stack(r,a,i)]}case"TensorListFromTensor":{const s=function(e,t,n){const s=e.dtype;if(e.shape.length<1)throw new Error(`Tensor must be at least a vector, but saw shape: ${e.shape}`);if(e.dtype!==n)throw new Error(`Invalid data types; op elements ${e.dtype}, but list elements ${n}`);FC(e.shape.slice(1),t,"TensorList shape mismatch: ");const r=$p(e);return new VC(r,t,s)}(Hk("tensor",e,t,n),Hk("elementShape",e,t,n),Hk("elementDType",e,t,n));return n.addTensorList(s),[s.idTensor]}case"TensorListConcat":case"TensorListConcatV2":{const s=Hk("tensorListId",e,t,n),r=n.getTensorList(s.id),a=Hk("dtype",e,t,n),i=Hk("elementShape",e,t,n);return[r.concat(a,i)]}case"TensorListPushBack":{const s=Hk("tensorListId",e,t,n),r=Hk("tensor",e,t,n),a=n.getTensorList(s.id);return a.pushBack(r),[a.idTensor]}case"TensorListPopBack":{const s=Hk("tensorListId",e,t,n),r=Hk("elementShape",e,t,n),a=Hk("elementDType",e,t,n);return[n.getTensorList(s.id).popBack(r,a)]}case"TensorListSplit":{const s=Hk("tensor",e,t,n),r=Hk("elementShape",e,t,n),a=function(e,t,n){let s=0;const r=t.map((e=>(s+=e,s)));if(s!==e.shape[0])throw new Error(`Expected sum of lengths to be equal to\n tensor.shape[0], but sum of lengths is\n ${s}, and tensor's shape is: ${e.shape}`);const a=LC(e.shape.slice(1),n),i=0===s?0:e.size/s,o=Ao((()=>{const n=[];e=Tc(e,[1,s,i]);for(let s=0;se.dispose())),this.tensorMap.clear(),this.handle.dispose()}size(){return this.tensorMap.size}tensorSize(){return Wl(this.size(),"int32")}async import(e,t){this.checkKeyAndValueTensor(e,t);const n=await e.data();return this.tensorMap.forEach((e=>e.dispose())),this.tensorMap.clear(),Ao((()=>{const e=$p(t),s=n.length,r=e.length;qt(s===r,(()=>`The number of elements doesn't match, keys has ${s} elements, the values has ${r} elements.`));for(let t=0;t{const e=[];for(let s=0;s{switch(e.category){case"arithmetic":return r((()=>((e,t,n,s=C)=>{switch(e.op){case"BiasAdd":case"AddV2":case"Add":return[s.add(Hk("a",e,t,n),Hk("b",e,t,n))];case"AddN":return[s.addN(Hk("tensors",e,t,n))];case"FloorMod":case"Mod":return[s.mod(Hk("a",e,t,n),Hk("b",e,t,n))];case"Mul":return[s.mul(Hk("a",e,t,n),Hk("b",e,t,n))];case"RealDiv":case"Div":return[s.div(Hk("a",e,t,n),Hk("b",e,t,n))];case"DivNoNan":return[s.divNoNan(Hk("a",e,t,n),Hk("b",e,t,n))];case"FloorDiv":return[s.floorDiv(Hk("a",e,t,n),Hk("b",e,t,n))];case"Sub":return[s.sub(Hk("a",e,t,n),Hk("b",e,t,n))];case"Minimum":return[s.minimum(Hk("a",e,t,n),Hk("b",e,t,n))];case"Maximum":return[s.maximum(Hk("a",e,t,n),Hk("b",e,t,n))];case"Pow":return[s.pow(Hk("a",e,t,n),Hk("b",e,t,n))];case"SquaredDifference":return[s.squaredDifference(Hk("a",e,t,n),Hk("b",e,t,n))];default:throw TypeError(`Node type ${e.op} is not implemented`)}})(e,t,n)));case"basic_math":return r((()=>((e,t,n,s=C)=>{switch(e.op){case"Abs":case"ComplexAbs":return[s.abs(Hk("x",e,t,n))];case"Acos":return[s.acos(Hk("x",e,t,n))];case"Acosh":return[s.acosh(Hk("x",e,t,n))];case"Asin":return[s.asin(Hk("x",e,t,n))];case"Asinh":return[s.asinh(Hk("x",e,t,n))];case"Atan":return[s.atan(Hk("x",e,t,n))];case"Atan2":return[s.atan2(Hk("x",e,t,n),Hk("y",e,t,n))];case"Atanh":return[s.atanh(Hk("x",e,t,n))];case"Ceil":return[s.ceil(Hk("x",e,t,n))];case"Complex":return[s.complex(Hk("real",e,t,n),Hk("imag",e,t,n))];case"Cos":return[s.cos(Hk("x",e,t,n))];case"Cosh":return[s.cosh(Hk("x",e,t,n))];case"Elu":return[s.elu(Hk("x",e,t,n))];case"Erf":return[s.erf(Hk("x",e,t,n))];case"Exp":return[s.exp(Hk("x",e,t,n))];case"Expm1":return[s.expm1(Hk("x",e,t,n))];case"Floor":return[s.floor(Hk("x",e,t,n))];case"Log":return[s.log(Hk("x",e,t,n))];case"Log1p":return[s.log1p(Hk("x",e,t,n))];case"Imag":return[s.imag(Hk("x",e,t,n))];case"Neg":return[s.neg(Hk("x",e,t,n))];case"Reciprocal":return[s.reciprocal(Hk("x",e,t,n))];case"Real":return[s.real(Hk("x",e,t,n))];case"Relu":return[s.relu(Hk("x",e,t,n))];case"Round":return[s.round(Hk("x",e,t,n))];case"Selu":return[s.selu(Hk("x",e,t,n))];case"Sigmoid":return[s.sigmoid(Hk("x",e,t,n))];case"Sin":return[s.sin(Hk("x",e,t,n))];case"Sign":return[s.sign(Hk("x",e,t,n))];case"Sinh":return[s.sinh(Hk("x",e,t,n))];case"Softplus":return[s.softplus(Hk("x",e,t,n))];case"Sqrt":return[s.sqrt(Hk("x",e,t,n))];case"Square":return[s.square(Hk("x",e,t,n))];case"Tanh":return[s.tanh(Hk("x",e,t,n))];case"Tan":return[s.tan(Hk("x",e,t,n))];case"ClipByValue":return[s.clipByValue(Hk("x",e,t,n),Hk("clipValueMin",e,t,n),Hk("clipValueMax",e,t,n))];case"Relu6":return[s.relu6(Hk("x",e,t,n))];case"Rsqrt":return[s.rsqrt($k(e.inputNames[0],t,n))];case"LeakyRelu":return[s.leakyRelu(Hk("x",e,t,n),Hk("alpha",e,t,n))];case"Prelu":return[s.prelu(Hk("x",e,t,n),Hk("alpha",e,t,n))];case"IsNan":return[s.isNaN($k(e.inputNames[0],t,n))];case"IsInf":return[s.isInf($k(e.inputNames[0],t,n))];case"IsFinite":return[s.isFinite($k(e.inputNames[0],t,n))];default:throw TypeError(`Node type ${e.op} is not implemented`)}})(e,t,n)));case"control":return WC(e,t,n);case"convolution":return r((()=>((e,t,n,s=C)=>{switch(e.op){case"Conv1D":{const r=Hk("stride",e,t,n),a=Hk("pad",e,t,n),i=Hk("dataFormat",e,t,n).toUpperCase(),o=Hk("dilation",e,t,n);return[s.conv1d(Hk("x",e,t,n),Hk("filter",e,t,n),r,a,i,o)]}case"Conv2D":{const r=Hk("strides",e,t,n),a=Qk(e,t,n),i=Hk("dataFormat",e,t,n).toUpperCase(),o=Hk("dilations",e,t,n);return[s.conv2d(Hk("x",e,t,n),Hk("filter",e,t,n),[r[1],r[2]],a,i,[o[1],o[2]])]}case"_FusedConv2D":{const{stride:r,pad:a,dataFormat:i,dilations:o,biasArg:l,preluArg:u,activationFunc:c,leakyreluAlpha:h}=UC(e,t,n);return[s.fused.conv2d({x:Hk("x",e,t,n),filter:Hk("filter",e,t,n),strides:[r[1],r[2]],pad:a,dataFormat:i,dilations:[o[1],o[2]],bias:l,activation:c,preluActivationWeights:u,leakyreluAlpha:h})]}case"FusedDepthwiseConv2dNative":{const{stride:r,pad:a,dataFormat:i,dilations:o,biasArg:l,preluArg:u,activationFunc:c,leakyreluAlpha:h}=UC(e,t,n);return[s.fused.depthwiseConv2d({x:Hk("x",e,t,n),filter:Hk("filter",e,t,n),strides:[r[1],r[2]],pad:a,dataFormat:i,dilations:[o[1],o[2]],bias:l,activation:c,preluActivationWeights:u,leakyreluAlpha:h})]}case"Conv2DBackpropInput":case"Conv2dTranspose":{const r=Hk("outputShape",e,t,n),a=Hk("strides",e,t,n),i=Qk(e,t,n);return[s.conv2dTranspose(Hk("x",e,t,n),Hk("filter",e,t,n),r,[a[1],a[2]],i)]}case"DepthwiseConv2dNative":case"DepthwiseConv2d":{const r=Hk("strides",e,t,n),a=Qk(e,t,n),i=Hk("dilations",e,t,n),o=Hk("dataFormat",e,t,n).toUpperCase();return[s.depthwiseConv2d(Hk("input",e,t,n),Hk("filter",e,t,n),[r[1],r[2]],a,o,[i[1],i[2]])]}case"Conv3D":{const r=Hk("strides",e,t,n),a=Hk("pad",e,t,n),i=Hk("dataFormat",e,t,n).toUpperCase(),o=Hk("dilations",e,t,n);return[s.conv3d(Hk("x",e,t,n),Hk("filter",e,t,n),[r[1],r[2],r[3]],a,i,[o[1],o[2],o[3]])]}case"AvgPool":{const r=Hk("strides",e,t,n),a=Hk("pad",e,t,n),i=Hk("kernelSize",e,t,n);return[s.avgPool(Hk("x",e,t,n),[i[1],i[2]],[r[1],r[2]],a)]}case"MaxPool":{const r=Hk("strides",e,t,n),a=Hk("pad",e,t,n),i=Hk("kernelSize",e,t,n);return[s.maxPool(Hk("x",e,t,n),[i[1],i[2]],[r[1],r[2]],a)]}case"MaxPoolWithArgmax":{const r=Hk("strides",e,t,n),a=Hk("pad",e,t,n),i=Hk("kernelSize",e,t,n),o=Hk("includeBatchInIndex",e,t,n),{result:l,indexes:u}=s.maxPoolWithArgmax(Hk("x",e,t,n),[i[1],i[2]],[r[1],r[2]],a,o);return[l,u]}case"AvgPool3D":{const r=Hk("strides",e,t,n),a=Hk("pad",e,t,n),i=Hk("kernelSize",e,t,n);return[s.avgPool3d(Hk("x",e,t,n),[i[1],i[2],i[3]],[r[1],r[2],r[3]],a)]}case"MaxPool3D":{const r=Hk("strides",e,t,n),a=Hk("pad",e,t,n),i=Hk("kernelSize",e,t,n);return[s.maxPool3d(Hk("x",e,t,n),[i[1],i[2],i[3]],[r[1],r[2],r[3]],a)]}case"Dilation2D":{const r=Hk("strides",e,t,n),a=Hk("pad",e,t,n),i=Hk("dilations",e,t,n),o=r[1],l=r[2],u=i[1],c=i[2];return[s.dilation2d(Hk("x",e,t,n),Hk("filter",e,t,n),[o,l],a,[u,c],"NHWC")]}default:throw TypeError(`Node type ${e.op} is not implemented`)}})(e,t,n)));case"creation":return r((()=>((e,t,n,s=C)=>{switch(e.op){case"Fill":{const r=Hk("shape",e,t,n),a=Hk("dtype",e,t,n),i=Hk("value",e,t,n);return[s.fill(r,i,a)]}case"LinSpace":{const r=Hk("start",e,t,n),a=Hk("stop",e,t,n),i=Hk("num",e,t,n);return[s.linspace(r,a,i)]}case"Multinomial":{const r=Hk("logits",e,t,n),a=Hk("numSamples",e,t,n),i=Hk("seed",e,t,n);return[s.multinomial(r,a,i)]}case"OneHot":{const r=Hk("indices",e,t,n),a=Hk("depth",e,t,n),i=Hk("onValue",e,t,n),o=Hk("offValue",e,t,n),l=Hk("dtype",e,t,n);return[s.oneHot(r,a,i,o,l)]}case"Ones":return[s.ones(Hk("shape",e,t,n),Hk("dtype",e,t,n))];case"OnesLike":return[s.onesLike(Hk("x",e,t,n))];case"RandomStandardNormal":return[s.randomStandardNormal(Hk("shape",e,t,n),Hk("dtype",e,t,n),Hk("seed",e,t,n))];case"RandomUniform":return[s.randomUniform(Hk("shape",e,t,n),Hk("minval",e,t,n),Hk("maxval",e,t,n),Hk("dtype",e,t,n))];case"RandomUniformInt":return[s.randomUniformInt(Hk("shape",e,t,n),Hk("minval",e,t,n),Hk("maxval",e,t,n),Hk("seed",e,t,n))];case"Range":{const r=Hk("start",e,t,n),a=Hk("stop",e,t,n),i=Hk("step",e,t,n);return[s.range(r,a,i,Hk("dtype",e,t,n))]}case"TruncatedNormal":{const r=Hk("shape",e,t,n),a=Hk("mean",e,t,n),i=Hk("stdDev",e,t,n),o=Hk("seed",e,t,n);return[s.truncatedNormal(r,a,i,Hk("dtype",e,t,n),o)]}case"Zeros":return[s.zeros(Hk("shape",e,t,n),Hk("dtype",e,t,n))];case"ZerosLike":return[s.zerosLike(Hk("x",e,t,n))];default:throw TypeError(`Node type ${e.op} is not implemented`)}})(e,t,n)));case"dynamic":return(async(e,t,n,s,r=C)=>{switch(e.op){case"NonMaxSuppressionV5":{const{boxes:s,scores:a,maxOutputSize:i,iouThreshold:o,scoreThreshold:l,softNmsSigma:u}=GC(e,t,n),c=await r.image.nonMaxSuppressionWithScoreAsync(s,a,i,o,l,u);return[c.selectedIndices,c.selectedScores]}case"NonMaxSuppressionV4":{const{boxes:s,scores:a,maxOutputSize:i,iouThreshold:o,scoreThreshold:l}=GC(e,t,n),u=Hk("padToMaxOutputSize",e,t,n),c=await r.image.nonMaxSuppressionPaddedAsync(s,a,i,o,l,u);return[c.selectedIndices,c.validOutputs]}case"NonMaxSuppressionV3":case"NonMaxSuppressionV2":{const{boxes:s,scores:a,maxOutputSize:i,iouThreshold:o,scoreThreshold:l}=GC(e,t,n);return[await r.image.nonMaxSuppressionAsync(s,a,i,o,l)]}case"Where":{const s=r.cast(Hk("condition",e,t,n),"bool"),a=[await r.whereAsync(s)];return s.dispose(),a}case"ListDiff":return r.setdiff1dAsync(Hk("x",e,t,n),Hk("y",e,t,n));default:throw TypeError(`Node type ${e.op} is not implemented`)}})(e,t,n);case"evaluation":return r((()=>((e,t,n,s=C)=>{switch(e.op){case"LowerBound":{const r=Hk("sortedSequence",e,t,n),a=Hk("values",e,t,n);return[s.lowerBound(r,a)]}case"TopKV2":{const r=Hk("x",e,t,n),a=Hk("k",e,t,n),i=Hk("sorted",e,t,n),o=s.topk(r,a,i);return[o.values,o.indices]}case"UpperBound":{const r=Hk("sortedSequence",e,t,n),a=Hk("values",e,t,n);return[s.upperBound(r,a)]}case"Unique":{const r=Hk("x",e,t,n),a=s.unique(r);return[a.values,a.indices]}case"UniqueV2":{const r=Hk("x",e,t,n),a=Hk("axis",e,t,n),i=s.unique(r,a);return[i.values,i.indices]}default:throw TypeError(`Node type ${e.op} is not implemented`)}})(e,t,n)));case"image":return r((()=>((e,t,n,s=C)=>{switch(e.op){case"ResizeBilinear":{const r=Hk("images",e,t,n),a=Hk("size",e,t,n),i=Hk("alignCorners",e,t,n),o=Hk("halfPixelCenters",e,t,n);return[s.image.resizeBilinear(r,[a[0],a[1]],i,o)]}case"ResizeNearestNeighbor":{const r=Hk("images",e,t,n),a=Hk("size",e,t,n),i=Hk("alignCorners",e,t,n),o=Hk("halfPixelCenters",e,t,n);return[s.image.resizeNearestNeighbor(r,[a[0],a[1]],i,o)]}case"CropAndResize":{const r=Hk("image",e,t,n),a=Hk("boxes",e,t,n),i=Hk("boxInd",e,t,n),o=Hk("cropSize",e,t,n),l=Hk("method",e,t,n),u=Hk("extrapolationValue",e,t,n);return[s.image.cropAndResize(r,a,i,o,l,u)]}case"ImageProjectiveTransformV3":{const r=Hk("images",e,t,n),a=Hk("transforms",e,t,n),i=Hk("outputShape",e,t,n),o=Hk("fillValue",e,t,n),l=Hk("interpolation",e,t,n),u=Hk("fillMode",e,t,n);return[s.image.transform(r,a,l.toLowerCase(),u.toLowerCase(),o,i)]}default:throw TypeError(`Node type ${e.op} is not implemented`)}})(e,t,n)));case"graph":return r((()=>((e,t,n,s=C)=>{switch(e.op){case"Const":return t[e.name];case"PlaceholderWithDefault":const r=Hk("default",e,t,n);return[$k(e.name,t,n)||r];case"Placeholder":return[$k(e.name,t,n)];case"Identity":case"StopGradient":case"FakeQuantWithMinMaxVars":case"Snapshot":return[Jk(Hk("x",e,t,n))];case"IdentityN":return Hk("x",e,t,n).map((e=>Jk(e)));case"Shape":return[s.tensor1d(Hk("x",e,t,n).shape,"int32")];case"ShapeN":return Hk("x",e,t,n).map((e=>s.tensor1d(e.shape)));case"Size":return[s.scalar(Hk("x",e,t,n).size,"int32")];case"Rank":return[s.scalar(Hk("x",e,t,n).rank,"int32")];case"NoOp":return[s.scalar(1)];case"Print":const a=Hk("x",e,t,n),i=Hk("data",e,t,n);Hk("message",e,t,n),Hk("summarize",e,t,n);for(let e=0;e((e,t,n,s=C)=>{switch(e.op){case"Equal":return[s.equal(Hk("a",e,t,n),Hk("b",e,t,n))];case"NotEqual":return[s.notEqual(Hk("a",e,t,n),Hk("b",e,t,n))];case"Greater":return[s.greater(Hk("a",e,t,n),Hk("b",e,t,n))];case"GreaterEqual":return[s.greaterEqual(Hk("a",e,t,n),Hk("b",e,t,n))];case"Less":return[s.less(Hk("a",e,t,n),Hk("b",e,t,n))];case"LessEqual":return[s.lessEqual(Hk("a",e,t,n),Hk("b",e,t,n))];case"LogicalAnd":return[s.logicalAnd(Hk("a",e,t,n),Hk("b",e,t,n))];case"LogicalNot":return[s.logicalNot(Hk("a",e,t,n))];case"LogicalOr":return[s.logicalOr(Hk("a",e,t,n),Hk("b",e,t,n))];case"Select":case"SelectV2":return[s.where(Hk("condition",e,t,n),Hk("a",e,t,n),Hk("b",e,t,n))];case"BitwiseAnd":return[s.bitwiseAnd(Hk("a",e,t,n),Hk("b",e,t,n))];default:throw TypeError(`Node type ${e.op} is not implemented`)}})(e,t,n)));case"matrices":return r((()=>((e,t,n,s=C)=>{switch(e.op){case"BatchMatMul":case"BatchMatMulV2":case"MatMul":return[s.matMul(Hk("a",e,t,n),Hk("b",e,t,n),Hk("transposeA",e,t,n),Hk("transposeB",e,t,n))];case"Einsum":return[s.einsum(Hk("equation",e,t,n),...Hk("tensors",e,t,n))];case"Transpose":return[s.transpose(Hk("x",e,t,n),Hk("perm",e,t,n))];case"_FusedMatMul":const[r,a]=Hk("fusedOps",e,t,n),i="biasadd"===r,o="prelu"===a,l=Hk("numArgs",e,t,n),u=Hk("leakyreluAlpha",e,t,n);if(i){if(o&&2!==l)throw new Error("Fused MatMul with BiasAdd and Prelu must have two extra arguments: bias and alpha.");if(!o&&1!==l)throw new Error("Fused MatMul with BiasAdd must have one extra argument: bias.")}const[c,h]=Hk("args",e,t,n);return[s.fused.matMul({a:Hk("a",e,t,n),b:Hk("b",e,t,n),transposeA:Hk("transposeA",e,t,n),transposeB:Hk("transposeB",e,t,n),bias:c,activation:a,preluActivationWeights:h,leakyreluAlpha:u})];case"MatrixBandPart":return[s.linalg.bandPart(Hk("a",e,t,n),Hk("numLower",e,t,n),Hk("numUpper",e,t,n))];default:throw TypeError(`Node type ${e.op} is not implemented`)}})(e,t,n)));case"normalization":return r((()=>((e,t,n,s=C)=>{switch(e.op){case"EuclideanNorm":return[s.euclideanNorm(Hk("x",e,t,n),Hk("axis",e,t,n),Hk("keepDims",e,t,n))];case"FusedBatchNorm":case"FusedBatchNormV2":case"FusedBatchNormV3":return[s.batchNorm(Hk("x",e,t,n),Hk("mean",e,t,n),Hk("variance",e,t,n),Hk("offset",e,t,n),Hk("scale",e,t,n),Hk("epsilon",e,t,n))];case"LRN":return[s.localResponseNormalization(Hk("x",e,t,n),Hk("radius",e,t,n),Hk("bias",e,t,n),Hk("alpha",e,t,n),Hk("beta",e,t,n))];case"Softmax":return[s.softmax(Hk("x",e,t,n))];case"LogSoftmax":return[s.logSoftmax(Hk("x",e,t,n))];default:throw TypeError(`Node type ${e.op} is not implemented`)}})(e,t,n)));case"ragged":return r((()=>((e,t,n,s=C)=>{switch(e.op){case"RaggedGather":{const{outputNestedSplits:r,outputDenseValues:a}=s.raggedGather(Hk("paramsNestedSplits",e,t,n),Hk("paramsDenseValues",e,t,n),Hk("indices",e,t,n),Hk("outputRaggedRank",e,t,n));return r.concat(a)}case"RaggedRange":{const{rtNestedSplits:r,rtDenseValues:a}=s.raggedRange(Hk("starts",e,t,n),Hk("limits",e,t,n),Hk("splits",e,t,n));return[r,a]}case"RaggedTensorToTensor":return[s.raggedTensorToTensor(Hk("shape",e,t,n),Hk("values",e,t,n),Hk("defaultValue",e,t,n),Hk("rowPartitionTensors",e,t,n),Hk("rowPartitionTypes",e,t,n))];default:throw TypeError(`Node type ${e.op} is not implemented`)}})(e,t,n)));case"reduction":return r((()=>((e,t,n,s=C)=>{switch(e.op){case"Max":{const r=Hk("axis",e,t,n),a=Hk("keepDims",e,t,n);return[s.max(Hk("x",e,t,n),r,a)]}case"Mean":{const r=Hk("axis",e,t,n),a=Hk("keepDims",e,t,n);return[s.mean(Hk("x",e,t,n),r,a)]}case"Min":{const r=Hk("axis",e,t,n),a=Hk("keepDims",e,t,n);return[s.min(Hk("x",e,t,n),r,a)]}case"Sum":{const r=Hk("axis",e,t,n),a=Hk("keepDims",e,t,n);return[s.sum(Hk("x",e,t,n),r,a)]}case"All":{const r=Hk("axis",e,t,n),a=Hk("keepDims",e,t,n);return[s.all(Hk("x",e,t,n),r,a)]}case"Any":{const r=Hk("axis",e,t,n),a=Hk("keepDims",e,t,n);return[s.any(Hk("x",e,t,n),r,a)]}case"ArgMax":{const r=Hk("axis",e,t,n);return[s.argMax(Hk("x",e,t,n),r)]}case"ArgMin":{const r=Hk("axis",e,t,n);return[s.argMin(Hk("x",e,t,n),r)]}case"Prod":{const r=Hk("axis",e,t,n),a=Hk("keepDims",e,t,n);return[s.prod(Hk("x",e,t,n),r,a)]}case"Cumprod":{const r=Hk("axis",e,t,n),a=Hk("exclusive",e,t,n),i=Hk("reverse",e,t,n);return[s.cumprod(Hk("x",e,t,n),r,a,i)]}case"Cumsum":{const r=Hk("axis",e,t,n),a=Hk("exclusive",e,t,n),i=Hk("reverse",e,t,n);return[s.cumsum(Hk("x",e,t,n),r,a,i)]}case"Bincount":const r=Hk("x",e,t,n),a=Hk("weights",e,t,n),i=Hk("size",e,t,n);return[s.bincount(r,a,i)];case"DenseBincount":{const r=Hk("x",e,t,n),a=Hk("weights",e,t,n),i=Hk("size",e,t,n),o=Hk("binaryOutput",e,t,n);return[s.denseBincount(r,a,i,o)]}default:throw TypeError(`Node type ${e.op} is not implemented`)}})(e,t,n)));case"slice_join":return r((()=>((e,t,n,s=C)=>{switch(e.op){case"ConcatV2":case"Concat":{const r=Hk("n",e,t,n),a=Hk("axis",e,t,n);let i=Hk("tensors",e,t,n);return i=i.slice(0,r),[s.concat(i,a)]}case"Gather":{const r=Hk("x",e,t,n),a=Hk("indices",e,t,n);return[s.gather(r,s.cast(a,"int32"),0)]}case"GatherV2":{const r=Hk("axis",e,t,n),a=Hk("batchDims",e,t,n),i=Hk("x",e,t,n),o=Hk("indices",e,t,n);return[s.gather(i,s.cast(o,"int32"),r,a)]}case"Reverse":{const r=Hk("dims",e,t,n),a=[];for(let e=0;e{const r=Hk("axis",e,t,n),a=Hk("tensors",e,t,n),i=a[0].shape,o=s.squeeze(a[0]).shape,l=a.map((e=>{const t=Kt(e.shape,i);if(!t&&!Kt(s.squeeze(e).shape,o))throw new Error("the input tensors shape does not match");return t?e:s.reshape(e,i)}));return[s.stack(l,r)]}));case"Unpack":{const r=Hk("axis",e,t,n),a=Hk("tensor",e,t,n);return s.unstack(a,r)}case"Tile":{const r=Hk("reps",e,t,n);return[s.tile(Hk("x",e,t,n),r)]}case"Split":case"SplitV":{const r=Hk("axis",e,t,n),a=Hk("numOrSizeSplits",e,t,n),i=Hk("x",e,t,n);return s.split(i,a,r)}case"ScatterNd":{const r=Hk("indices",e,t,n),a=Hk("values",e,t,n),i=Hk("shape",e,t,n);return[s.scatterND(r,a,i)]}case"GatherNd":{const r=Hk("x",e,t,n),a=Hk("indices",e,t,n);return[s.gatherND(r,a)]}case"SparseToDense":{const r=Hk("sparseIndices",e,t,n),a=Hk("outputShape",e,t,n),i=Hk("sparseValues",e,t,n),o=Hk("defaultValue",e,t,n);return[s.sparseToDense(r,i,a,i.dtype===o.dtype?o:s.cast(o,i.dtype))]}case"TensorScatterUpdate":{const r=Hk("indices",e,t,n),a=Hk("values",e,t,n),i=Hk("tensor",e,t,n);return[s.tensorScatterUpdate(i,r,a)]}default:throw TypeError(`Node type ${e.op} is not implemented`)}})(e,t,n)));case"sparse":return r((()=>((e,t,n,s=C)=>{switch(e.op){case"SparseFillEmptyRows":{const{outputIndices:r,outputValues:a,emptyRowIndicator:i,reverseIndexMap:o}=s.sparse.sparseFillEmptyRows(Hk("indices",e,t,n),Hk("values",e,t,n),Hk("denseShape",e,t,n),Hk("defaultValue",e,t,n));return[r,a,i,o]}case"SparseReshape":{const{outputIndices:r,outputShape:a}=s.sparse.sparseReshape(Hk("inputIndices",e,t,n),Hk("inputShape",e,t,n),Hk("newShape",e,t,n));return[r,a]}case"SparseSegmentMean":return[s.sparse.sparseSegmentMean(Hk("data",e,t,n),Hk("indices",e,t,n),Hk("segmentIds",e,t,n))];case"SparseSegmentSum":return[s.sparse.sparseSegmentSum(Hk("data",e,t,n),Hk("indices",e,t,n),Hk("segmentIds",e,t,n))];default:throw TypeError(`Node type ${e.op} is not implemented`)}})(e,t,n)));case"spectral":return r((()=>((e,t,n,s=C)=>{switch(e.op){case"FFT":return[s.fft(Hk("x",e,t,n))];case"IFFT":return[s.ifft(Hk("x",e,t,n))];case"RFFT":return[s.rfft(Hk("x",e,t,n))];case"IRFFT":return[s.irfft(Hk("x",e,t,n))];default:throw TypeError(`Node type ${e.op} is not implemented`)}})(e,t,n)));case"string":return r((()=>((e,t,n,s=C)=>{switch(e.op){case"StaticRegexReplace":return[s.string.staticRegexReplace(Hk("input",e,t,n),Hk("pattern",e,t,n),Hk("rewrite",e,t,n),Hk("replaceGlobal",e,t,n))];case"StringNGrams":{const{nGrams:r,nGramsSplits:a}=s.string.stringNGrams(Hk("data",e,t,n),Hk("dataSplits",e,t,n),Hk("separator",e,t,n),Hk("nGramWidths",e,t,n),Hk("leftPad",e,t,n),Hk("rightPad",e,t,n),Hk("padWidth",e,t,n),Hk("preserveShortSequences",e,t,n));return[r,a]}case"StringSplit":{const{indices:r,values:a,shape:i}=s.string.stringSplit(Hk("input",e,t,n),Hk("delimiter",e,t,n),Hk("skipEmpty",e,t,n));return[r,a,i]}case"StringToHashBucketFast":return[s.string.stringToHashBucketFast(Hk("input",e,t,n),Hk("numBuckets",e,t,n))];default:throw TypeError(`Node type ${e.op} is not implemented`)}})(e,t,n)));case"transformation":return r((()=>((e,t,n,s=C)=>{switch(e.op){case"Cast":return[s.cast(Hk("x",e,t,n),Hk("dtype",e,t,n))];case"ExpandDims":{const r=Hk("axis",e,t,n);return[s.expandDims(Hk("x",e,t,n),r)]}case"Squeeze":{const r=Hk("axis",e,t,n);return[s.squeeze(Hk("x",e,t,n),r)]}case"Reshape":return[s.reshape(Hk("x",e,t,n),Hk("shape",e,t,n))];case"EnsureShape":return[s.ensureShape(Hk("x",e,t,n),Hk("shape",e,t,n))];case"MirrorPad":return[s.mirrorPad(Hk("x",e,t,n),Hk("padding",e,t,n),Hk("mode",e,t,n))];case"PadV2":case"Pad":return[s.pad(Hk("x",e,t,n),Hk("padding",e,t,n),Hk("constantValue",e,t,n))];case"SpaceToBatchND":{const r=Hk("blockShape",e,t,n),a=Hk("paddings",e,t,n);return[s.spaceToBatchND(Hk("x",e,t,n),r,a)]}case"BatchToSpaceND":{const r=Hk("blockShape",e,t,n),a=Hk("crops",e,t,n);return[s.batchToSpaceND(Hk("x",e,t,n),r,a)]}case"DepthToSpace":{const r=Hk("blockSize",e,t,n),a=Hk("dataFormat",e,t,n).toUpperCase();return[s.depthToSpace(Hk("x",e,t,n),r,a)]}case"BroadcastTo":return[s.broadcastTo(Hk("x",e,t,n),Hk("shape",e,t,n))];case"BroadcastArgs":return[s.broadcastArgs(Hk("s0",e,t,n),Hk("s1",e,t,n))];default:throw TypeError(`Node type ${e.op} is not implemented`)}})(e,t,n)));case"hash_table":return(async(e,t,n,s)=>{switch(e.op){case"HashTable":case"HashTableV2":{const r=s.getHashTableHandleByName(e.name);if(null!=r)return[r];{const r=Hk("keyDType",e,t,n),a=Hk("valueDType",e,t,n),i=new qC(r,a);return s.addHashTable(e.name,i),[i.handle]}}case"InitializeTable":case"InitializeTableV2":case"LookupTableImport":case"LookupTableImportV2":{const r=Hk("tableHandle",e,t,n,s),a=Hk("keys",e,t,n),i=Hk("values",e,t,n),o=s.getHashTableById(r.id);return[await o.import(a,i)]}case"LookupTableFind":case"LookupTableFindV2":{const r=Hk("tableHandle",e,t,n,s),a=Hk("keys",e,t,n),i=Hk("defaultValue",e,t,n),o=s.getHashTableById(r.id);return[await o.find(a,i)]}case"LookupTableSize":case"LookupTableSizeV2":{const r=Hk("tableHandle",e,t,n,s);return[s.getHashTableById(r.id).tensorSize()]}default:throw TypeError(`Node type ${e.op} is not implemented`)}})(e,t,n,s);case"custom":const a=jk(e.op);if(a&&a.customExecutor)return a.customExecutor(new MC(e,t,n));throw TypeError(`Custom op ${e.op} is not registered.`);default:throw TypeError(`Unknown op '${e.op}'. File an issue at https://github.com/tensorflow/tfjs/issues so we can add it, or register a custom execution with tf.registerOp()`)}})(e,t,n);return xn(a)?a.then((e=>[].concat(e))):[].concat(a)}class HC{constructor(e={},t={},n={},s={},r){this.weightMap=e,this.tensorArrayMap=t,this.tensorListMap=n,this.functionMap=s,this.parseNodeNameCache=r,this.rootContext={id:0,frameName:"",iterationId:0},this.contexts=[this.rootContext],this.lastId=0,this.generateCurrentContextIds()}newFrame(e,t){return{id:e,frameName:t,iterationId:0}}set currentContext(e){this.contexts!==e&&(this.contexts=e,this.generateCurrentContextIds())}get currentContext(){return this.contexts}get currentContextId(){return this._currentContextIds[0]}get currentContextIds(){return this._currentContextIds}generateCurrentContextIds(){const e=[];for(let t=0;t0===e.id&&0===e.iterationId?"":`${e.frameName}-${e.iterationId}`)).join("/"):""}enterFrame(e){this.contexts&&(this.lastId++,this.contexts=this.contexts.slice(),this.contexts.push(this.newFrame(this.lastId,e)),this._currentContextIds.unshift(this.contextIdforContexts(this.contexts)))}exitFrame(){if(!(this.contexts&&this.contexts.length>1))throw new Error("Cannot exit frame, the context is empty");this.contexts=this.contexts.slice(),this.contexts.splice(-1),this.currentContextIds.shift()}nextIteration(){if(!(this.contexts&&this.contexts.length>0))throw new Error("Cannot increase frame iteration, the context is empty");{this.contexts=this.contexts.slice(),this.lastId++;const e=Object.assign({},this.contexts[this.contexts.length-1]);e.iterationId+=1,e.id=this.lastId,this.contexts.splice(-1,1,e),this._currentContextIds.splice(0,1,this.contextIdforContexts(this.contexts))}}getWeight(e){return this.weightMap[e]}addTensorArray(e){this.tensorArrayMap[e.id]=e}getTensorArray(e){return this.tensorArrayMap[e]}addTensorList(e){this.tensorListMap[e.id]=e}getTensorList(e){return this.tensorListMap[e]}dispose(e){for(const t in this.tensorArrayMap)this.tensorArrayMap[t].clearAndClose(e);for(const t in this.tensorListMap)this.tensorListMap[t].clearAndClose(e)}}function $C(e,t,n,s){const r=new Set,a=[];let i=null,o=null;const l=new Set,u=new Set(Object.keys(e).map((e=>Yk(e)[0])));s=s||[];const c=new Set(s.map((e=>Yk(e.name)[0]))),h=[...t];for(;h.length>0;){const e=h.pop();(JC(e)||eS(e)||tS(e))&&null==i&&(i=e,o=i.children.map((e=>e.name)).filter((e=>r.has(e)))),r.add(e.name),null==n[e.name]&&(u.has(e.name)||c.has(e.name)||(0!==e.inputs.length?e.inputs.forEach((e=>{l.has(e.name)||(l.add(e.name),h.push(e))})):a.push(e.name)))}return{inputs:e,outputs:t,usedNodes:r,missingInputs:a,dynamicNode:i,syncInputs:o}}function KC(e,t){const{usedNodes:n,inputs:s}=t,r=Object.keys(s).map((e=>Yk(e)[0])).map((t=>e.nodes[t])),a=e.initNodes||[],i=e=>n.has("string"==typeof e?e:e.name);function o(e){return[...new Map(e.map((e=>[e.name,e]))).values()]}const l=o([...r,...e.weights,...a]).filter(i),u=o([...l,...Object.values(e.nodes)]).filter(i),c=new Map(u.map((e=>[e.name,e]))),h={};for(const e of u){h[e.name]=h[e.name]||0;for(const t of e.children)i(t)||(h[t.name]=Number.POSITIVE_INFINITY),h[t.name]=(h[t.name]||0)+1}const d=Object.entries(h).filter((([,e])=>0===e)).map((([e])=>e)),p=[...d];for(;d.length>0;){const e=d.pop(),t=c.get(e);for(const e of t.children.filter(i))0==--h[e.name]&&(p.push(e.name),d.push(e.name))}const f=function(e,t){const n=new Map(e.map((e=>[e.name,e]))),s=t.map((e=>e.name)),r=new Set(s);for(;s.length>0;){const e=s.pop(),t=n.get(e);for(const e of t.children)n.has(e.name)&&!r.has(e.name)&&(r.add(e.name),s.push(e.name))}const a=e.filter((e=>r.has(e.name)));return a}(p.map((e=>c.get(e))),l);return function(e,t){const n=new Map(e.map(((e,t)=>[e.name,t]))),s=new Set(t.map((e=>e.name))),r=e=>s.has("string"==typeof e?e:e.name),a=new Set(e.map((e=>e.name))),i=e=>a.has("string"==typeof e?e:e.name);for(const t of e){for(const e of t.children.filter(i)){if(!n.has(e.name))throw new XC(`Child ${e.name} of node ${t.name} is unreachable.`);if(n.get(t.name)>n.get(e.name))throw new XC(`Node ${t.name} is scheduled to run after its child ${e.name}.`)}if(!r(t))for(const e of t.inputs){if(!n.has(e.name))throw new XC(`Input ${e.name} of node ${t.name} is unreachable.`);if(n.get(e.name)>n.get(t.name))throw new XC(`Node ${t.name} is scheduled to run before its input ${e.name}.`)}}}(f,l),f}class XC extends Error{constructor(e){super(`NodesExecutionOrderError: ${e}`)}}const ZC=new Set(["Switch","Merge","Enter","Exit","NextIteration","StatelessIf","StatelessWhile","if","While"]),YC=new Set(["NonMaxSuppressionV2","NonMaxSuppressionV3","NonMaxSuppressionV5","Where"]),QC=new Set(["HashTable","HashTableV2","LookupTableImport","LookupTableImportV2","LookupTableFind","LookupTableFindV2","LookupTableSize","LookupTableSizeV2"]);function JC(e){return ZC.has(e.op)}function eS(e){return YC.has(e.op)}function tS(e){return QC.has(e.op)}class nS{get weightIds(){return this.parent?this.parent.weightIds:this._weightIds}get functionExecutorMap(){return this.parent?this.parent.functionExecutorMap:this._functionExecutorMap}get weightMap(){return this.parent?this.parent.weightMap:this._weightMap}set weightMap(e){const t=Object.keys(e).map((t=>e[t].map((e=>e.id))));this._weightIds=[].concat(...t),this._weightMap=e}set resourceManager(e){this._resourceManager=e}get inputs(){return this._inputs.map((e=>({name:e.name,shape:e.attrParams.shape?e.attrParams.shape.value:void 0,dtype:e.attrParams.dtype?e.attrParams.dtype.value:void 0})))}get outputs(){return this._outputs.map((e=>({name:e.name,shape:e.attrParams.shape?e.attrParams.shape.value:void 0,dtype:e.attrParams.dtype?e.attrParams.dtype.value:void 0})))}get inputNodes(){return this._inputs.map((e=>e.signatureKey||e.name))}get outputNodes(){return this._outputs.map((e=>{const t=e.signatureKey||e.name;return e.defaultOutput?`${t}:${e.defaultOutput}`:t}))}get functions(){return Object.keys(this._functions).reduce(((e,t)=>(e[t]=this._functions[t].signature,e)),{})}constructor(e,t){this.graph=e,this.parent=t,this.compiledMap=new Map,this.parseNodeNameCache=new Map,this._weightMap={},this.SEPARATOR=",",this._functions={},this._functionExecutorMap={},this.keepIntermediateTensors=!1,this._outputs=e.outputs,this._inputs=e.inputs,this._initNodes=e.initNodes,this._signature=e.signature,this._functions=e.functions,null!=e.functions&&Object.keys(e.functions).forEach((t=>{this._functionExecutorMap[t]=new nS(e.functions[t],this)}))}getCompilationKey(e,t){const n=e.map((e=>e.name)).sort(),s=t.map((e=>e.name)).sort();return n.join(this.SEPARATOR)+"--"+s.join(this.SEPARATOR)}compile(e,t){const n=$C(e,t,this.weightMap,this._initNodes),{missingInputs:s,dynamicNode:r,syncInputs:a}=n;if(null!=r)throw new Error(`This execution contains the node '${r.name}', which has the dynamic op '${r.op}'. Please use model.executeAsync() instead. Alternatively, to avoid the dynamic ops, specify the inputs [${a}]`);if(s.length>0){const n=t.map((e=>e.name)),r=Object.keys(e);throw new Error(`Cannot compute the outputs [${n}] from the provided inputs [${r}]. Missing the following inputs: [${s}]`)}const i=KC(this.graph,n),o=function(e){const t=new Map(e.map(((e,t)=>[e.name,t]))),n=Number.MAX_SAFE_INTEGER,s=e.map(((e,t)=>JC(e)?n:t)),r=e=>{const n=s[t.get(e.name)];return null==n?-1:n},a=e.map(((e,t)=>e.children.map(r).reduce(((e,t)=>Math.max(e,t)),s[t]))),i=new Map;for(let t=0;tthis.cloneAndKeepTensor(e)));return t}cloneTensorMap(e){return Object.fromEntries(Object.entries(e).map((([e,t])=>[e,this.cloneTensorList(t)])))}execute(e,t){this.disposeIntermediateTensors(),e=this.mapInputs(e);const n=Object.keys(e).sort();this.checkInputs(e),this.checkInputShapeAndType(e),t=this.mapOutputs(t),this.checkOutputs(t);const s=n.map((e=>this.graph.nodes[Yk(e)[0]])),r=t.map((e=>Yk(e)[0])),a=new Set(r);let i=r.map((e=>this.graph.nodes[e]));0===i.length&&(i=this._outputs);const o=this.getCompilationKey(s,i);let l=this.compiledMap.get(o);null==l&&(l=this.compile(e,i),this.compiledMap.set(o,l));try{this.keepIntermediateTensors=Sn().getBool("KEEP_INTERMEDIATE_TENSORS")}catch(e){this.keepIntermediateTensors=!1}const u={},c={};return Ao((()=>{const n=new HC(this.weightMap,u,c,this.functionExecutorMap,this.parseNodeNameCache),s=Object.assign({},this.weightMap);this.keepIntermediateTensors&&(this.clonedTensorsMap=this.cloneTensorMap(this.weightMap)),Object.keys(e).forEach((t=>{const[r,a]=Yk(t,n),i=[];i[a]=e[t],s[r]=i,this.keepIntermediateTensors&&(this.clonedTensorsMap[r]=this.cloneTensorList(i))}));const r=this.getFrozenTensorIds(s),{orderedNodes:i,nodeLiveUntilMap:o}=l;for(const e of i){if(s[e.name])continue;const t=jC(e,s,n,this._resourceManager);if(xn(t))throw new Error(`The execution of the op '${e.op}' returned a promise. Please use model.executeAsync() instead.`);s[e.name]=t,this.keepIntermediateTensors&&(this.clonedTensorsMap[e.name]=this.cloneTensorList(t)),this.checkTensorForDisposalWithNodeLiveUntilInfo(e,s,n,r,a,o.get(e.name))}return null==this.parent&&n.dispose(r),t.map((e=>$k(e,s,n)))}))}getFrozenTensorIds(e){const t=[].concat.apply([],Object.keys(e).map((t=>e[t])).map((e=>e.map((e=>e.id)))));return new Set(t)}checkTensorForDisposal(e,t,n,s,r,a,i){if(!JC(t)&&!a.has(e)){for(const s of n[e])null!=s&&(i[s.id]=(i[s.id]||0)+t.children.length);for(const e of t.inputs){if(JC(e))continue;const t=Kk(e.name,n,s);if(null!=t)for(const e of t){if(!e||e.kept||r.has(e.id))continue;const t=i[e.id];1===t?(e.dispose(),delete i[e.id]):null!=t&&i[e.id]--}}}}checkTensorForDisposalWithNodeLiveUntilInfo(e,t,n,s,r,a){function i(e){return JC(e)||r.has(e.name)}if(!JC(e)&&null!=a)for(const e of a){if(i(e))continue;const r=Kk(e.name,t,n);for(const e of r)!e||e.kept||s.has(e.id)||e.dispose()}}async executeAsync(e,t){return this._executeAsync(e,t)}disposeIntermediateTensors(){this.clonedTensorsMap&&(Object.values(this.clonedTensorsMap).forEach((e=>{for(const t of e)t&&!t.isDisposed&&t.dispose()})),this.clonedTensorsMap=null)}getIntermediateTensors(){return this.clonedTensorsMap}async _executeAsync(e,t,n=!1,s={},r={}){this.disposeIntermediateTensors(),n||(e=this.mapInputs(e),this.checkInputs(e),this.checkInputShapeAndType(e),t=this.mapOutputs(t),this.checkOutputs(t));try{this.keepIntermediateTensors=Sn().getBool("KEEP_INTERMEDIATE_TENSORS")}catch(e){this.keepIntermediateTensors=!1}const a=new HC(this.weightMap,s,r,this.functionExecutorMap,this.parseNodeNameCache);this.keepIntermediateTensors&&(this.clonedTensorsMap=this.cloneTensorMap(this.weightMap));const i=await this.executeWithControlFlow(e,a,t,n),o=t.map((e=>$k(e,i,a))),l=o.map((e=>e.id)),u=Object.keys(e).map((t=>e[t].id)),c=new Set([...l,...u,...this.weightIds]);return Object.values(i).forEach((e=>{e.forEach((e=>{!e||e.isDisposed||c.has(e.id)||e.dispose()}))})),null==this.parent&&a.dispose(c),o}async executeFunctionAsync(e,t,n){const s=e.reduce(((e,t,n)=>(e[this.inputs[n].name]=t,e)),{});return this._executeAsync(s,this.outputNodes,!0,t,n)}async executeWithControlFlow(e,t,n,s){const r=Object.keys(e),a=r.map((e=>this.graph.nodes[Yk(e)[0]])),i=n.map((e=>Yk(e)[0])),o=new Set(i);let l=i.map((e=>this.graph.nodes[e]));0===l.length&&(l=this._outputs);const{usedNodes:u,missingInputs:c,dynamicNode:h,syncInputs:d}=$C(e,l,this.weightMap,this._initNodes),p=[...a,...this.graph.weights,...this._initNodes||[]].map((e=>({node:e,contexts:t.currentContext}))),f=Object.assign({},this.weightMap);Object.keys(e).forEach((t=>{const[n,s]=Yk(t),r=[];r[s]=e[t],f[n]=r}));const m={},g=this.getFrozenTensorIds(f),y={};for(;p.length>0;){const e=this.processStack(a,p,t,f,y,g,o,m,u);await Promise.all(e)}const b=l.filter((e=>!JC(e)&&!$k(e.name,f,t))).map((e=>e.name));if(b.length>0){let e="";throw null!=h&&(e=`Alternatively, to avoid the dynamic ops, use model.execute() and specify the inputs [${d}]`),new Error(`Cannot compute the outputs [${b}] from the provided inputs [${r}]. Consider providing the following inputs: [${c}]. ${e}`)}return f}processStack(e,t,n,s,r,a,i,o,l){const u=[];for(;t.length>0;){const e=t.pop();n.currentContext=e.contexts;let c="";if("Enter"===e.node.op&&Hk("isConstant",e.node,s,n)&&([c]=Xk(e.node.name,n)),null==s[e.node.name]){const h=jC(e.node,s,n,this._resourceManager);c||([c]=Xk(e.node.name,n));const d=n.currentContext;xn(h)?u.push(h.then((u=>(s[c]=u,this.keepIntermediateTensors&&(this.clonedTensorsMap[c]=this.cloneTensorList(u)),n.currentContext=d,this.checkTensorForDisposal(c,e.node,s,n,a,i,o),this.processChildNodes(e.node,t,n,s,r,l),u)))):(s[c]=h,this.keepIntermediateTensors&&(this.clonedTensorsMap[c]=this.cloneTensorList(h)),this.checkTensorForDisposal(c,e.node,s,n,a,i,o),this.processChildNodes(e.node,t,n,s,r,l))}else this.processChildNodes(e.node,t,n,s,r,l)}return u}processChildNodes(e,t,n,s,r,a){e.children.forEach((e=>{const[i]=Xk(e.name,n);!r[i]&&a.has(e.name)&&("Merge"===e.op?e.inputNames.some((e=>!!$k(e,s,n)))&&(r[i]=!0,t.push({contexts:n.currentContext,node:e})):e.inputNames.every((e=>!!$k(e,s,n)))&&(r[i]=!0,t.push({contexts:n.currentContext,node:e})))}))}dispose(){Object.keys(this.weightMap).forEach((e=>this.weightMap[e].forEach((e=>e.dispose()))))}checkInputShapeAndType(e){Object.keys(e).forEach((t=>{const n=e[t],[s]=Yk(t),r=this.graph.nodes[s];if(r.attrParams.shape&&r.attrParams.shape.value){const e=r.attrParams.shape.value;qt(e.length===n.shape.length&&n.shape.every(((t,n)=>-1===e[n]||e[n]===t)),(()=>`The shape of dict['${r.name}'] provided in model.execute(dict) must be [${e}], but was [${n.shape}]`))}r.attrParams.dtype&&r.attrParams.dtype.value&&qt(n.dtype===r.attrParams.dtype.value,(()=>`The dtype of dict['${r.name}'] provided in model.execute(dict) must be ${r.attrParams.dtype.value}, but was ${n.dtype}`))}))}mapInputs(e){var t,n;const s={};for(const r in e){const a=null===(n=null===(t=this._signature)||void 0===t?void 0:t.inputs)||void 0===n?void 0:n[r];null!=a?s[a.name]=e[r]:s[r]=e[r]}return s}checkInputs(e){const t=Object.keys(e).filter((e=>{const[t]=Yk(e);return null==this.graph.nodes[t]}));if(t.length>0)throw new Error(`The dict provided in model.execute(dict) has keys: [${t}] that are not part of graph`)}mapOutputs(e){return e.map((e=>{var t,n;const s=null===(n=null===(t=this._signature)||void 0===t?void 0:t.outputs)||void 0===n?void 0:n[e];return null!=s?s.name:e}),{})}checkOutputs(e){e.forEach((e=>{const[t]=Yk(e);if(!this.graph.nodes[t])throw new Error(`The output '${e}' is not found in the graph`)}))}}class sS{constructor(e={},t={}){this.hashTableNameToHandle=e,this.hashTableMap=t}addHashTable(e,t){this.hashTableNameToHandle[e]=t.handle,this.hashTableMap[t.id]=t}getHashTableHandleByName(e){return this.hashTableNameToHandle[e]}getHashTableById(e){return this.hashTableMap[e]}dispose(){for(const e in this.hashTableMap)this.hashTableMap[e].clearAndClose(),delete this.hashTableMap[e];for(const e in this.hashTableNameToHandle)this.hashTableNameToHandle[e].dispose(),delete this.hashTableNameToHandle[e]}}const rS="?tfjs-format=file",aS="model.json";class iS{get modelVersion(){return this.version}get inputNodes(){return this.executor.inputNodes}get outputNodes(){return this.executor.outputNodes}get inputs(){return this.executor.inputs}get outputs(){return this.executor.outputs}get weights(){return this.executor.weightMap}get metadata(){return this.artifacts.userDefinedMetadata}get modelSignature(){return this.signature}get modelStructuredOutputKeys(){return this.structuredOutputKeys}constructor(t,n={},s=e){this.modelUrl=t,this.loadOptions=n,this.version="n/a",this.io=s,null==n&&(this.loadOptions={}),this.resourceManager=new sS}findIOHandler(){const e=this.modelUrl;if(null!=e.load)this.handler=e;else if(null!=this.loadOptions.requestInit)this.handler=this.io.browserHTTPRequest(e,this.loadOptions);else{const t=this.io.getLoadHandlers(e,this.loadOptions);if(0===t.length)t.push(this.io.browserHTTPRequest(e,this.loadOptions));else if(t.length>1)throw new Error(`Found more than one (${t.length}) load handlers for URL '${[e]}'`);this.handler=t[0]}}load(){if(this.findIOHandler(),null==this.handler.load)throw new Error("Cannot proceed with model loading because the IOHandler provided does not have the `load` method implemented.");const e=this.handler.load();return xn(e)?e.then((e=>null==e.getWeightStream?this.loadSync(e):this.loadStreaming(e))):this.loadSync(e)}loadSync(e){const t=this.io.decodeWeights(e.weightData,e.weightSpecs);return this.loadWithWeightMap(e,t)}async loadStreaming(e){if(null==e.getWeightStream)throw new Error("Model artifacts missing streamWeights function");const t=await Mo(e.getWeightStream(),e.weightSpecs);return this.loadWithWeightMap(e,t)}loadWithWeightMap(e,t){this.artifacts=e;const n=this.artifacts.modelTopology;let s=this.artifacts.signature;if(null!=this.artifacts.userDefinedMetadata){const e=this.artifacts.userDefinedMetadata;null!=e.signature&&(s=e.signature),null!=e.structuredOutputKeys&&(this.structuredOutputKeys=e.structuredOutputKeys)}if(this.signature=s,this.version=`${n.versions.producer}.${n.versions.minConsumer}`,this.executor=new nS(wC.Instance.transformGraph(n,this.signature)),this.executor.weightMap=this.convertTensorMapToTensorsMap(t),this.executor.resourceManager=this.resourceManager,null!=e.modelInitializer&&null!=e.modelInitializer.node){const t=wC.Instance.transformGraph(e.modelInitializer);this.initializer=new nS(t),this.initializer.weightMap=this.executor.weightMap,this.initializer.resourceManager=this.resourceManager,this.initializerSignature=e.initializerSignature}return!0}async save(e,t){if("string"==typeof e){const t=this.io.getSaveHandlers(e);if(0===t.length)throw new Error(`Cannot find any save handlers for URL '${e}'`);if(t.length>1)throw new Error(`Found more than one (${t.length}) save handlers for URL '${e}'`);e=t[0]}if(null==e.save)throw new Error("GraphModel.save() cannot proceed because the IOHandler provided does not have the `save` attribute defined.");return e.save(this.artifacts)}addStructuredOutputNames(e){if(this.structuredOutputKeys){const t={};return(e instanceof Mi?[e]:e).forEach(((e,n)=>t[this.structuredOutputKeys[n]]=e)),t}return e}predict(e,t){const n=this.execute(e,this.outputNodes);return this.addStructuredOutputNames(n)}async predictAsync(e,t){const n=await this.executeAsync(e,this.outputNodes);return this.addStructuredOutputNames(n)}normalizeInputs(e){var t;if(!(e instanceof Mi||Array.isArray(e))){const n=null===(t=this.signature)||void 0===t?void 0:t.inputs;if(null!=n)for(const t in n){const s=n[t];null!=s.resourceId&&(e[t]=this.resourceIdToCapturedInput[s.resourceId])}return e}e=Array.isArray(e)?e:[e];const n=Object.keys(this.resourceIdToCapturedInput).length;if(e.length+n!==this.inputNodes.length)throw new Error(`Input tensor count mismatch, the graph model has ${this.inputNodes.length-n} non-resource placeholders, while there are ${e.length} input tensors provided.`);let s=0;return this.inputNodes.reduce(((t,n)=>{var r,a,i;const o=null===(i=null===(a=null===(r=this.signature)||void 0===r?void 0:r.inputs)||void 0===a?void 0:a[n])||void 0===i?void 0:i.resourceId;return t[n]=null!=o?this.resourceIdToCapturedInput[o]:e[s++],t}),{})}normalizeOutputs(e){return e=e||this.outputNodes,Array.isArray(e)?e:[e]}executeInitializerGraph(){return null==this.initializer?[]:null==this.initializerSignature?this.initializer.execute({},[]):this.initializer.execute({},Object.keys(this.initializerSignature.outputs))}async executeInitializerGraphAsync(){return null==this.initializer?[]:null==this.initializerSignature?this.initializer.executeAsync({},[]):this.initializer.executeAsync({},Object.keys(this.initializerSignature.outputs))}setResourceIdToCapturedInput(e){if(this.resourceIdToCapturedInput={},this.initializerSignature){const t=this.initializerSignature.outputs,n=Object.keys(t);for(let s=0;s1?n:n[0]}async executeAsync(e,t){null==this.resourceIdToCapturedInput&&this.setResourceIdToCapturedInput(await this.executeInitializerGraphAsync()),e=this.normalizeInputs(e),t=this.normalizeOutputs(t);const n=await this.executor.executeAsync(e,t);return n.length>1?n:n[0]}getIntermediateTensors(){return this.executor.getIntermediateTensors()}disposeIntermediateTensors(){this.executor.disposeIntermediateTensors()}convertTensorMapToTensorsMap(e){return Object.keys(e).reduce(((t,n)=>(t[n]=[e[n]],t)),{})}dispose(){this.executor.dispose(),this.initializer&&(this.initializer.dispose(),this.resourceIdToCapturedInput&&ko(this.resourceIdToCapturedInput)),this.resourceManager.dispose()}}async function oS(t,n={},s=e){if(null==t)throw new Error("modelUrl in loadGraphModel() cannot be null. Please provide a url or an IOHandler that loads the model");null==n&&(n={}),n.fromTFHub&&"string"==typeof t&&(t=function(e){e.endsWith("/")||(e+="/");return`${e}${aS}${rS}`}(t));const r=new iS(t,n,s);return await r.load(),r}function lS(e,t,n=new Map,s=new Set){if(null==e)return null;if("function"==typeof Blob&&e instanceof Blob)return e.slice();if(s.has(e))throw new Error("Circular references are not supported.");if(n.has(e))return n.get(e);const r=t(e);if(r.recurse&&null!==r.value)throw new Error("A deep map function may not return both a value and recurse=true.");if(r.recurse){if(dS(e)){const r=Array.isArray(e)?[]:{};s.add(e);for(const a in e){const i=lS(e[a],t,n,s);r[a]=i}return s.delete(e),e.__proto__&&(r.__proto__=e.__proto__),r}throw new Error(`Can't recurse into non-iterable type: ${e}`)}return n.set(e,r.value),r.value}function uS(e,t=hS){return cS(e,t)}function cS(e,t,n=new Set){const s=e[0];if(n.has(s))throw new Error("Circular references are not supported.");const r=t(e);if(r.recurse&&null!==r.value)throw new Error("A deep zip function may not return both a value and recurse=true.");if(r.recurse){if(dS(s)){const r=Array.isArray(s)?[]:{};n.add(s);for(const a in s){const s=cS(e.map((e=>e[a])),t,n);r[a]=s}return n.delete(s),r}throw new Error(`Can't recurse into non-iterable type: ${s}`)}return r.value}function hS(e){return null===e?null:dS(e[0])?{value:null,recurse:!0}:{value:e,recurse:!1}}function dS(e){let t=!1;if(Sn().get("IS_BROWSER"))t=e instanceof TextDecoder;else{const{StringDecoder:n}=__webpack_require__(7695);t=e instanceof n}return null!=e&&!ArrayBuffer.isView(e)&&(Array.isArray(e)||"object"==typeof e&&!(e instanceof Mi)&&!(e instanceof Promise)&&!t)}function pS(e){return function(e,t){return lS(e,t)}(e,fS)}function fS(e){return e instanceof Mi?{value:e.clone(),recurse:!1}:dS(e)?{value:null,recurse:!0}:{value:e,recurse:!1}}class mS{constructor(e){if(this.capacity=e,this.begin=0,this.end=0,null==e)throw new RangeError("Can't create a ring buffer of unknown capacity.");if(e<1)throw new RangeError("Can't create ring buffer of capacity < 1.");this.data=new Array(e),this.doubledCapacity=2*e}wrap(e){for(;e<0;)e+=this.doubledCapacity;return e%this.doubledCapacity}get(e){if(e<0)throw new RangeError("Can't get item at a negative index.");return this.data[e%this.capacity]}set(e,t){if(e<0)throw new RangeError("Can't set item at a negative index.");this.data[e%this.capacity]=t}length(){let e=this.end-this.begin;return e<0&&(e=this.doubledCapacity+e),e}isFull(){return this.length()===this.capacity}isEmpty(){return 0===this.length()}push(e){if(this.isFull())throw new RangeError("Ring buffer is full.");this.set(this.end,e),this.end=this.wrap(this.end+1)}pushAll(e){for(const t of e)this.push(t)}pop(){if(this.isEmpty())throw new RangeError("Ring buffer is empty.");this.end=this.wrap(this.end-1);const e=this.get(this.end);return this.set(this.end,void 0),e}unshift(e){if(this.isFull())throw new RangeError("Ring buffer is full.");this.begin=this.wrap(this.begin-1),this.set(this.begin,e)}shift(){if(this.isEmpty())throw new RangeError("Ring buffer is empty.");const e=this.get(this.begin);return this.set(this.begin,void 0),this.begin=this.wrap(this.begin+1),e}shuffleExcise(e){if(this.isEmpty())throw new RangeError("Ring buffer is empty.");const t=this.wrap(this.begin+e),n=this.get(t);return this.set(t,this.pop()),n}}class gS extends mS{constructor(){super(gS.INITIAL_CAPACITY)}isFull(){return!1}push(e){super.isFull()&&this.expand(),super.push(e)}unshift(e){super.isFull()&&this.expand(),super.unshift(e)}expand(){const e=2*this.capacity,t=new Array(e),n=this.length();for(let e=0;e!0===e))}rowMajorBatch(e,t=!0){return new SS(this,e,t)}columnMajorBatch(e,t=!0,n=hS){return this.rowMajorBatch(e,t).map((e=>uS(e,n)))}concatenate(e,t){return new RS(new vS([this,e]),t)}take(e){return e<0||null==e?this:new CS(this,e)}skip(e){return e<0||null==e?this:new kS(this,e)}prefetch(e){return new MS(this,e)}shuffle(e,t){return new FS(this,e,t)}serial(){return new AS(this)}}class vS extends wS{constructor(e){super(),this.items=e,this.trav=0}summary(){return`Array of ${this.items.length} items`}async next(){if(this.trav>=this.items.length)return{value:null,done:!0};const e=this.items[this.trav];return this.trav++,{value:pS(e),done:!1}}}class xS extends wS{constructor(e){super(),this.nextFn=e}summary(){return"Function call"}async next(){try{return this.nextFn()}catch(e){throw e.message=`Error thrown while iterating through a dataset: ${e.message}`,e}}}class AS extends wS{constructor(e){super(),this.upstream=e,this.lastRead=Promise.resolve({value:null,done:!1})}summary(){return`${this.upstream.summary()} -> Serial`}async next(){return this.lastRead=this.lastRead.then((()=>this.serialNext())),this.lastRead}async serialNext(){return this.upstream.next()}}class kS extends wS{constructor(e,t){super(),this.upstream=e,this.maxCount=t,this.count=0,this.lastRead=Promise.resolve({value:null,done:!1})}summary(){return`${this.upstream.summary()} -> Skip`}async next(){return this.lastRead=this.lastRead.then((()=>this.serialNext())),this.lastRead}async serialNext(){for(;this.count++ Take`}async next(){return this.count++>=this.maxCount?{value:null,done:!0}:this.upstream.next()}}class SS extends wS{constructor(e,t,n=!0){super(),this.upstream=e,this.batchSize=t,this.enableSmallLastBatch=n,this.lastRead=Promise.resolve({value:null,done:!1})}summary(){return`${this.upstream.summary()} -> RowMajorBatch`}async next(){return this.lastRead=this.lastRead.then((()=>this.serialNext())),this.lastRead}async serialNext(){const e=[];for(;e.length0?{value:e,done:!1}:{value:null,done:!0};e.push(t.value)}return{value:e,done:!1}}}class ES extends wS{constructor(e,t){super(),this.upstream=e,this.predicate=t,this.lastRead=Promise.resolve({value:null,done:!1})}summary(){return`${this.upstream.summary()} -> Filter`}async next(){return this.lastRead=this.lastRead.then((()=>this.serialNext())),this.lastRead}async serialNext(){for(;;){const e=await this.upstream.next();if(e.done||this.predicate(e.value))return e;ko(e.value)}}}class _S extends wS{constructor(e,t){super(),this.upstream=e,this.transform=t}summary(){return`${this.upstream.summary()} -> Map`}async next(){const e=await this.upstream.next();if(e.done)return{value:null,done:!0};const t=Xi(e.value),n=this.transform(e.value),s=Xi(n);for(const e of t)Ki(e,s)||e.dispose();return{value:n,done:!1}}}class IS extends wS{constructor(e,t){super(),this.upstream=e,this.handler=t,this.count=0,this.lastRead=Promise.resolve({value:null,done:!1})}summary(){return`${this.upstream.summary()} -> handleErrors`}async next(){return this.lastRead=this.lastRead.then((()=>this.serialNext())),this.lastRead}async serialNext(){for(;;)try{return await this.upstream.next()}catch(e){if(!this.handler(e))return{value:null,done:!0}}}}class TS extends wS{constructor(e,t){super(),this.upstream=e,this.transform=t}summary(){return`${this.upstream.summary()} -> AsyncMap`}async next(){const e=await this.upstream.next();if(e.done)return{value:null,done:!0};const t=Xi(e.value),n=await this.transform(e.value),s=Xi(n);for(const e of t)Ki(e,s)||e.dispose();return{value:n,done:!1}}}class NS extends wS{constructor(){super(),this.outputQueue=new gS,this.lastRead=Promise.resolve({value:null,done:!1})}async next(){return this.lastRead=this.lastRead.then((()=>this.serialNext())),this.lastRead}async serialNext(){for(;0===this.outputQueue.length();)if(!await this.pump())return{value:null,done:!0};return{value:this.outputQueue.shift(),done:!1}}}class OS extends NS{constructor(e,t){super(),this.upstream=e,this.transform=t}summary(){return`${this.upstream.summary()} -> Flatmap`}async pump(){const e=await this.upstream.next();if(e.done)return!1;const t=Xi(e.value),n=this.transform(e.value),s=Xi(n);this.outputQueue.pushAll(n);for(const e of t)Ki(e,s)||e.dispose();return!0}}class RS extends wS{constructor(e,t){super(),this.baseErrorHandler=t,this.lastRead=null,this.iterator=null,this.moreIterators=e}summary(){return"TODO: fill in upstream of chained summaries -> Chained"}async next(){return this.lastRead=this.readFromChain(this.lastRead),this.lastRead}async readFromChain(e){if(await e,null==this.iterator){const e=await this.moreIterators.next();if(e.done)return{value:null,done:!0};this.iterator=e.value,null!=this.baseErrorHandler&&(this.iterator=this.iterator.handleErrors(this.baseErrorHandler))}const t=await this.iterator.next();return t.done?(this.iterator=null,this.readFromChain(e)):t}}var DS;!function(e){e[e.FAIL=0]="FAIL",e[e.SHORTEST=1]="SHORTEST",e[e.LONGEST=2]="LONGEST"}(DS||(DS={}));class MS extends wS{constructor(e,t){super(),this.upstream=e,this.bufferSize=t,this.buffer=new mS(t)}summary(){return`${this.upstream.summary()} -> Prefetch`}refill(){for(;!this.buffer.isFull();){const e=this.upstream.next();this.buffer.push(e)}}next(){return this.refill(),this.buffer.shift()}}class FS extends MS{constructor(e,t,n){super(e,t),this.upstream=e,this.windowSize=t,this.upstreamExhausted=!1,this.random=jd.alea(n||fi().toString()),this.lastRead=Promise.resolve({value:null,done:!1})}async next(){return this.lastRead=this.lastRead.then((()=>this.serialNext())),this.lastRead}randomInt(e){return Math.floor(this.random()*e)}chooseIndex(){return this.randomInt(this.buffer.length())}async serialNext(){for(this.upstreamExhausted||this.refill();!this.buffer.isEmpty();){const e=this.chooseIndex(),t=await this.buffer.shuffleExcise(e);if(!t.done)return this.refill(),t;this.upstreamExhausted=!0}return{value:null,done:!0}}}class BS{constructor(){this.size=null}batch(e,t=!0){const n=this;let s;return qt(e>0,(()=>`batchSize needs to be positive, but it is\n ${e}`)),s=this.size===1/0||null==this.size?this.size:t?Math.ceil(this.size/e):Math.floor(this.size/e),zS((async()=>(await n.iterator()).columnMajorBatch(e,t,LS)),s)}concatenate(e){const t=this;let n;return n=this.size===1/0||e.size===1/0?1/0:null!=this.size&&null!=e.size?this.size+e.size:null,zS((async()=>(await t.iterator()).concatenate(await e.iterator())),n)}filter(e){const t=this;let n;return n=this.size===1/0?1/0:null,zS((async()=>(await t.iterator()).filter((t=>Ao((()=>e(t)))))),n)}async forEachAsync(e){return(await this.iterator()).forEachAsync(e)}map(e){const t=this;return zS((async()=>(await t.iterator()).map((t=>Ao((()=>e(t)))))),this.size)}mapAsync(e){const t=this;return zS((async()=>(await t.iterator()).mapAsync(e)),this.size)}prefetch(e){if(null==e)throw new RangeError("`Dataset.prefetch()` requires bufferSize to be specified.");const t=this;return zS((async()=>(await t.iterator()).prefetch(e)),this.size)}repeat(e){const t=this;let n;return n=null!=this.size&&e>0?this.size*e:0===e?0:null!=this.size&&(void 0===e||e<0)?1/0:null,zS((async()=>bS(yS((async()=>({value:await t.iterator(),done:!1}))).take(e))),n)}skip(e){const t=this;let n;return n=null!=this.size&&e>=0&&this.size>=e?this.size-e:null!=this.size&&(this.size(await t.iterator()).skip(e)),n)}shuffle(e,t,n=!0){if(null==e||e<0)throw null==this.size?new RangeError("`Dataset.shuffle()` requires bufferSize to be specified."):new RangeError(`\`Dataset.shuffle()\` requires bufferSize to be specified. If your data fits in main memory (for regular JS objects), and/or GPU memory (for \`tf.Tensor\`s), consider setting bufferSize to the dataset size (${this.size} elements)`);const s=this,r=jd.alea(t||fi().toString());return zS((async()=>{let t=r.int32();return n&&(t+=r.int32()),(await s.iterator()).shuffle(e,t.toString())}),this.size)}take(e){const t=this;let n;return n=null!=this.size&&this.size>e?e:null!=this.size&&this.size<=e?this.size:null,zS((async()=>(await t.iterator()).take(e)),n)}async toArray(){if(this.size===1/0)throw new Error("Can not convert infinite data stream to array.");return(await this.iterator()).toArray()}async toArrayForTest(){if(this.size===1/0)throw new Error("Can not convert infinite data stream to array.");return(await this.iterator()).toArrayForTest()}}function zS(e,t=null){return new class extends BS{constructor(){super(...arguments),this.size=t}async iterator(){return e()}}}function LS(e){if(null===e)return null;const t=e[0];if(null==(n=t)||null===(s=n)||"object"!=typeof s&&"function"!=typeof s||Array.isArray(n)||"object"==typeof n&&n instanceof Mi||yi(n)){return{value:function(e){if(0===e.length)throw new Error("Can't make a batch of zero elements.");return e[0]instanceof Mi?Np(e):yo(e)}(e),recurse:!1}}var n,s;return{value:null,recurse:!0}}BS.MAX_BUFFER_SIZE=1e4;Symbol("out"),Symbol("field"),Symbol("quote"),Symbol("quoteafterquote"),Symbol("quoteinquote");function PS(e,t){Array.isArray(e)||(e=[e]),e.forEach((e=>{null!=e&&qt("complex64"!==e.dtype,(()=>`${t} does not support complex64 tensors in the CPU backend.`))}))}const VS=Zp;class WS extends Lt{nextDataId(){return WS.nextDataId++}constructor(){super(),this.blockSize=48,this.firstUse=!0,this.data=new zt(this,vo())}write(e,t,n){this.firstUse&&(this.firstUse=!1,Sn().get("IS_NODE")&&Wa());const s={id:this.nextDataId()};return this.data.set(s,{values:e,dtype:n,refCount:1}),s}makeTensorInfo(e,t,n){let s;if("string"===t&&null!=n&&n.length>0&&on(n[0])){const r=n.map((e=>mi(e)));s=this.write(r,e,t)}else s=this.write(n,e,t);return{dataId:s,shape:e,dtype:t}}refCount(e){if(this.data.has(e)){return this.data.get(e).refCount}return 0}incRef(e){this.data.get(e).refCount++}decRef(e){if(this.data.has(e)){this.data.get(e).refCount--}}move(e,t,n,s,r){this.data.set(e,{values:t,dtype:s,refCount:r})}numDataIds(){return this.data.numDataIds()}async read(e){return this.readSync(e)}readSync(e){const{dtype:t,complexTensorInfos:n}=this.data.get(e);if("complex64"===t){return Zm(this.readSync(n.real.dataId),this.readSync(n.imag.dataId))}return function(e,t){if(Array.isArray(e))return e;if("float32"===t)return e instanceof Float32Array?e:new Float32Array(e);if("int32"===t)return e instanceof Int32Array?e:new Int32Array(e);if("bool"===t||"string"===t)return Uint8Array.from(new Int32Array(e));throw new Error(`Unknown dtype ${t}`)}(this.data.get(e).values,t)}bufferSync(e){const t=this.readSync(e.dataId);if("string"===e.dtype)try{const n=t.map((e=>gi(e)));return Tl(e.shape,e.dtype,n)}catch(e){throw new Error("Failed to decode encoded string bytes into utf-8")}return Tl(e.shape,e.dtype,t)}makeOutput(e,t,n){return vo().makeTensorFromTensorInfo(this.makeTensorInfo(t,n,e),this)}disposeData(e,t=!1){if(this.data.has(e)){if(this.data.get(e).refCount--,!t&&this.data.get(e).refCount>0)return!1;const{complexTensorInfos:n}=this.data.get(e);null!=n&&(this.disposeData(n.real.dataId,!0),this.disposeData(n.imag.dataId,!0)),this.data.delete(e)}return!0}disposeIntermediateTensorInfo(e){this.disposeData(e.dataId)}async time(e){const t=fi();e();return{kernelMs:fi()-t}}memory(){return{unreliable:!0,reasons:["The reported memory is an upper bound. Due to automatic garbage collection, the true allocated memory may be less."]}}where(e){PS([e],"where");const t=this.readSync(e.dataId);return VS(e.shape,t)}dispose(){}floatPrecision(){return 32}epsilon(){return super.epsilon()}}WS.nextDataId=0;function US(e){return(t,n,s)=>{const r=sn(n,t.length);for(let n=0;n{const{x:i}=s;PS(i,e);const o=a,l=o.data.get(i.dataId).values;let u;if("string"===i.dtype){if(!Array.isArray(l))throw new Error("String tensor's value was not an instance of Array");u=Ng(l)}else u=l;const c=n||i.dtype,h=t(u,c,r);return o.makeTensorInfo(i.shape,c,h)}}So("cpu",(()=>new WS),1);const jS=GS(Is,(e=>e>=0?e:Math.exp(e)-1)),HS={kernelName:Is,backendName:"cpu",kernelFunc:jS};function $S(e){const{inputs:t,backend:n}=e,{x:s}=t;return n.incRef(s.dataId),{dataId:s.dataId,shape:s.shape,dtype:s.dtype}}const KS={kernelName:js,backendName:"cpu",kernelFunc:$S};function XS(e){const{inputs:t,backend:n,attrs:s}=e,{x:r}=t,{alpha:a}=s;PS([r],"leakyRelu");const i=$t(r.shape),o=n.data.get(r.dataId).values,l=nn("float32",i);for(let e=0;e{const i=su(t,n),o=i.length,l=dn(i),u=nn(a,$t(i)),c=t.length,h=n.length,d=dn(t),p=dn(n),f=tu(t,i),m=tu(n,i);if(f.length+m.length===0)for(let t=0;ta[e]=0));const i=wn(a,c,d),g=n.slice(-h);m.forEach((e=>g[e]=0));const y=wn(g,h,p);u[t]=e(s[i],r[y])}return[u,i]}}const QS=YS(((e,t)=>e<0?t*e:e));function JS(e){const{inputs:t,backend:n}=e,{x:s,alpha:r}=t;PS([s,r],"prelu");const a=n.data.get(s.dataId).values,i=n.data.get(r.dataId).values,[o,l]=QS(s.shape,r.shape,a,i,"float32");return n.makeTensorInfo(l,"float32",o)}const eE={kernelName:Rr,backendName:"cpu",kernelFunc:JS},tE=GS(Vr,(e=>Math.max(0,e))),nE={kernelName:Vr,backendName:"cpu",kernelFunc:tE},sE=GS(Hr,(e=>Math.min(Math.max(0,e),6))),rE={kernelName:Hr,backendName:"cpu",kernelFunc:sE},aE=US((e=>1/(1+Math.exp(-e)))),iE=GS(aa,(e=>1/(1+Math.exp(-e)))),oE={kernelName:aa,backendName:"cpu",kernelFunc:iE};function lE(e,t,n,s,r){if("linear"===n)return $S({inputs:{x:t},backend:e});if("relu"===n)return tE({inputs:{x:t},backend:e});if("elu"===n)return jS({inputs:{x:t},backend:e});if("relu6"===n)return sE({inputs:{x:t},backend:e});if("prelu"===n)return JS({inputs:{x:t,alpha:s},backend:e});if("leakyrelu"===n)return XS({inputs:{x:t},backend:e,attrs:{alpha:r}});if("sigmoid"===n)return iE({inputs:{x:t},backend:e});throw new Error(`Activation ${n} has not been implemented for the CPU backend.`)}function uE(e){const{inputs:t,backend:n}=e,{real:s,imag:r}=t,a=n.data.get(s.dataId).values,i=n.data.get(r.dataId).values,o=n.makeTensorInfo(s.shape,"complex64");return n.data.get(o.dataId).complexTensorInfos={real:n.makeTensorInfo(s.shape,"float32",a),imag:n.makeTensorInfo(r.shape,"float32",i)},o}const cE={kernelName:ns,backendName:"cpu",kernelFunc:uE};function hE(e,t,n="float32"){if("complex64"===n){return uE({inputs:{real:hE(e,t,"float32"),imag:hE(e,t,"float32")},backend:e})}const s=gn($t(t),n);return e.makeTensorInfo(t,n,s)}function dE(e){const{inputs:t,backend:n}=e,{input:s}=t,r=n.data.get(s.dataId).complexTensorInfos.real,a=n.data.get(r.dataId).values;return n.makeTensorInfo(r.shape,r.dtype,a)}const pE={kernelName:Lr,backendName:"cpu",kernelFunc:dE};function fE(e,t,n,s){if("int32"===s){return[t,"int32",Int32Array.from(e)]}if("bool"===s){const s=pi([0],n),[r,a]=YS(((e,t)=>e!==t?1:0))(t,[],e,s,"bool");return[a,"bool",r]}throw new Error(`Error in Cast: failed to cast ${n} to ${s}`)}function mE(e){const{inputs:t,backend:n,attrs:s}=e,{x:r}=t,{dtype:a}=s;if("complex64"===a){if("complex64"===r.dtype)return $S({inputs:{x:r},backend:n});const e=hE(n,r.shape,r.dtype),t=mE({inputs:{x:r},backend:n,attrs:{dtype:"float32"}}),s=uE({inputs:{real:t,imag:e},backend:n});return n.disposeIntermediateTensorInfo(e),n.disposeIntermediateTensorInfo(t),s}if("complex64"===r.dtype){const e=dE({inputs:{input:r},backend:n}),t=mE({inputs:{x:e},backend:n,attrs:{dtype:a}});return n.disposeIntermediateTensorInfo(e),t}if(!rn(r.dtype,a)){const e=$S({inputs:{x:r},backend:n});return{dataId:e.dataId,shape:e.shape,dtype:a}}const i=n.data.get(r.dataId).values,[o,l,u]=fE(i,r.shape,r.dtype,a);return n.makeTensorInfo(o,l,u)}const gE={kernelName:Jn,backendName:"cpu",kernelFunc:mE};function yE(e,t,n,s){return null==n?({inputs:n,backend:r})=>{const{a,b:i}=n,o=r;PS([a,i],e);const l=o.data.get(a.dataId).values,u=o.data.get(i.dataId).values,c="string"===a.dtype?Ng(l):l,h="string"===a.dtype?Ng(u):u,d=s||a.dtype,[p,f]=t(a.shape,i.shape,c,h,d);return o.makeTensorInfo(f,d,p)}:({inputs:e,backend:r})=>{const{a,b:i}=e,o=r;if("complex64"===a.dtype||"complex64"===i.dtype){const e=mE({inputs:{x:a},backend:o,attrs:{dtype:"complex64"}}),t=o.data.get(e.dataId),s=t.complexTensorInfos.real,r=t.complexTensorInfos.imag,l=o.data.get(s.dataId).values,u=o.data.get(r.dataId).values,c=mE({inputs:{x:i},backend:o,attrs:{dtype:"complex64"}}),h=o.data.get(c.dataId),d=h.complexTensorInfos.real,p=h.complexTensorInfos.imag,f=o.data.get(d.dataId).values,m=o.data.get(p.dataId).values,[g,y,b]=n(a.shape,i.shape,l,u,f,m),w=o.makeTensorInfo(b,"float32",g),v=o.makeTensorInfo(b,"float32",y),x=uE({inputs:{real:w,imag:v},backend:o});return o.disposeIntermediateTensorInfo(e),o.disposeIntermediateTensorInfo(c),o.disposeIntermediateTensorInfo(w),o.disposeIntermediateTensorInfo(v),x}{const e=o.data.get(a.dataId).values,n=o.data.get(i.dataId).values,r=s||a.dtype,[l,u]=t(a.shape,i.shape,e,n,r);return o.makeTensorInfo(u,r,l)}}}function bE(e){return(t,n,s,r,a,i)=>{const o=su(t,n),l=$t(o),u=o.length,c=dn(o),h=nn("float32",l),d=nn("float32",l),p=tu(t,o),f=tu(n,o),m=Zm(s,r),g=Zm(a,i),y=t.length,b=dn(t),w=n.length,v=dn(n);if(p.length+f.length===0)for(let t=0;ts[e]=0));const r=wn(s,y,b),a=n.slice(-w);f.forEach((e=>a[e]=0));const i=wn(a,w,v),o=e(m[2*r],m[2*r+1],g[2*i],g[2*i+1]);h[t]=o.real,d[t]=o.imag}return[h,d,o]}}const wE=YS(((e,t)=>e+t)),vE=bE(((e,t,n,s)=>({real:e+n,imag:t+s}))),xE=yE(Dn,wE,vE),AE={kernelName:Dn,backendName:"cpu",kernelFunc:xE};function kE(e){const{inputs:t,backend:n,attrs:s}=e,{x:r}=t,{shape:a}=s,i=$t(r.shape),o=Jt(a,i),l=$t(o);qt(i===l,(()=>`The new shape (${o}) has ${l} elements and the old shape (${r.shape}) has ${i} elements. The new shape and old shape must have the same number of elements.`)),n.incRef(r.dataId);const u=n.data.get(r.dataId);if(null!=u.complexTensorInfos){const e=u.complexTensorInfos.real,t=u.complexTensorInfos.imag;e.shape=o,t.shape=o}return{dataId:r.dataId,shape:o,dtype:r.dtype}}const CE={kernelName:Wr,backendName:"cpu",kernelFunc:kE};function SE(e){const{inputs:t,backend:n,attrs:s}=e,{a:r,b:a}=t,{transposeA:i,transposeB:o}=s;PS([r,a],"matMul");const l=r.shape.length,u=a.shape.length,c=i?r.shape[l-2]:r.shape[l-1],h=o?a.shape[u-1]:a.shape[u-2],d=i?r.shape[l-1]:r.shape[l-2],p=o?a.shape[u-2]:a.shape[u-1],f=r.shape.slice(0,-2),m=a.shape.slice(0,-2),g=$t(f),y=$t(m),b=su(r.shape.slice(0,-2),a.shape.slice(0,-2)).concat([d,p]);qt(c===h,(()=>`Error in matMul: inner shapes (${c}) and (${h}) of Tensors with shapes ${r.shape} and ${a.shape} and transposeA=${i} and transposeB=${o} must match.`));const w=o?[y,p,h]:[y,h,p],v=kE({inputs:{x:r},backend:n,attrs:{shape:i?[g,c,d]:[g,d,c]}}),x=kE({inputs:{x:a},backend:n,attrs:{shape:w}}),A=i?v.shape[1]:v.shape[2],k=i?v.shape[2]:v.shape[1],C=o?x.shape[1]:x.shape[2],S=Math.max(g,y),E=n.data.get(v.dataId).values,_=n.data.get(x.dataId).values,I=dn(v.shape),T=dn(x.shape),[N,O,R]=i?[I[0],1,I[1]]:[I[0],I[1],1],[D,M,F]=o?[1,T[1],T[0]]:[T[1],1,T[0]],B=k*C,z=Tl([S,k,C],v.dtype),L=z.values,P=n.blockSize;for(let e=0;e{const{x:t}=e.inputs,n=e.backend;PS(t,"abs");let s=new Float32Array($t(t.shape));return s=IE(n.data.get(t.dataId).values),n.makeOutput(s,t.shape,t.dtype)}},NE=GS(On,(e=>Math.acos(e))),OE={kernelName:On,backendName:"cpu",kernelFunc:NE},RE=GS(Rn,(e=>Math.acosh(e))),DE={kernelName:Rn,backendName:"cpu",kernelFunc:RE};const ME={kernelName:Mn,backendName:"cpu",kernelFunc:function(e){const{inputs:t,backend:n}=e,s=t;PS(t,"addN");const r=s.map((e=>n.data.get(e.dataId).values)),a=Tl(s[0].shape,s[0].dtype),i=a.values;for(let e=0;en&&(n=r,s=e)}d[e]=s}return u.forEach((e=>n.disposeIntermediateTensorInfo(e))),n.makeTensorInfo(c,"int32",d)}};const WE={kernelName:Ln,backendName:"cpu",kernelFunc:function(e){const{inputs:t,backend:n,attrs:s}=e,{x:r}=t,{axis:a}=s;PS(r,"argMin");let i=en(a,r.shape);const o=Ih(i,r.shape.length);let l=r;const u=[];null!=o&&(l=BE({inputs:{x:r},backend:n,attrs:{perm:o}}),u.push(l),i=Nh(i.length,l.shape.length)),i=[i[0]],_h("argMin",i,l.shape.length);const[c,h]=Sh(l.shape,i),d=gn($t(c),"int32"),p=$t(h),f=n.data.get(l.dataId).values;for(let e=0;en.disposeIntermediateTensorInfo(e))),n.makeTensorInfo(c,"int32",d)}},UE=GS(Pn,(e=>Math.asin(e))),GE={kernelName:Pn,backendName:"cpu",kernelFunc:UE},qE=GS(Vn,(e=>Math.asinh(e))),jE={kernelName:Vn,backendName:"cpu",kernelFunc:qE},HE=GS(Wn,(e=>Math.atan(e))),$E={kernelName:Wn,backendName:"cpu",kernelFunc:HE},KE=YS(((e,t)=>Math.atan2(e,t))),XE=yE(Gn,KE),ZE={kernelName:Gn,backendName:"cpu",kernelFunc:XE},YE=GS(Un,(e=>Math.atanh(e))),QE={kernelName:Un,backendName:"cpu",kernelFunc:YE};function JE(e,t,n,s,r,a){const i=r.strideHeight,o=r.strideWidth,l=r.dilationHeight,u=r.dilationWidth,c=r.effectiveFilterHeight,h=r.effectiveFilterWidth,d=r.padInfo.top,p=r.padInfo.left,f="max"===a?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,m=Tl(r.outShape,n),g=m.values,y=r.outShape[1]*r.outShape[2]*r.outShape[3],b=r.outShape[2]*r.outShape[3],w=r.outShape[3];for(let t=0;ty?y=i:"avg"===a&&(b+=i,v++)}if(isNaN(y))break}g[k+n*w+t]="avg"===a?b/v:y}}}return m}function e_(e,t,n,s,r=!1,a=!1){const i=Tl(s.outShape,"int32"),o=s.strideHeight,l=s.strideWidth,u=s.dilationHeight,c=s.dilationWidth,h=s.effectiveFilterHeight,d=s.effectiveFilterWidth,p=s.padInfo.top,f=s.padInfo.left,m=Tl(t,n,e);for(let e=0;ev&&(v=u,x=r?a?((e*s.inHeight+n)*s.inWidth+o)*s.inChannels+t:(n*s.inWidth+o)*s.inChannels+t:i*d+l)}}i.set(x,e,n,o,t)}}return i}function t_(e,t,n,s,r,a){const i=r.strideDepth,o=r.strideHeight,l=r.strideWidth,u=r.dilationDepth,c=r.dilationHeight,h=r.dilationWidth,d=r.effectiveFilterDepth,p=r.effectiveFilterHeight,f=r.effectiveFilterWidth,m=r.padInfo.front,g=r.padInfo.top,y=r.padInfo.left,b="max"===a?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,w=Tl(r.outShape,n),v=w.values,x=r.outShape[1]*r.outShape[2]*r.outShape[3]*r.outShape[4],A=r.outShape[2]*r.outShape[3]*r.outShape[4],k=r.outShape[3]*r.outShape[4],C=r.outShape[4];for(let t=0;tA?A=r:"avg"===a&&(k+=r,S++),isNaN(A))break}if(isNaN(A))break}if(isNaN(A))break}v[g+t]="avg"===a?k/Math.max(S,1):A}}}}return w}const n_={kernelName:qn,backendName:"cpu",kernelFunc:function(e){const{inputs:t,backend:n,attrs:s}=e,{x:r}=t;PS(r,"avgPool");const{filterSize:a,strides:i,pad:o,dimRoundingMode:l}=s;qt(Sc(i,1),(()=>`Error in avgPool: Either strides or dilations must be 1. Got strides ${i} and dilations '1'`));const u=mc(r.shape,a,i,1,o,l);let c;if(1===u.filterWidth&&1===u.filterHeight&&Kt(u.inShape,u.outShape))c=$S({inputs:{x:r},backend:n});else{const e=n.data.get(r.dataId).values,t=dn(r.shape),s=JE(e,r.shape,r.dtype,t,u,"avg");c=n.makeTensorInfo(u.outShape,r.dtype,s.values)}return c}};const s_={kernelName:Hn,backendName:"cpu",kernelFunc:function(e){const{inputs:t,backend:n,attrs:s}=e,{x:r}=t,{filterSize:a,strides:i,pad:o,dimRoundingMode:l,dataFormat:u}=s;PS(r,"avgPool3d");const c=gc(r.shape,a,i,1,o,l,u),h=t_(n.data.get(r.dataId).values,r.shape,r.dtype,dn(r.shape),c,"avg");return n.makeTensorInfo(h.shape,"float32",h.values)}};const r_={kernelName:$n,backendName:"cpu",kernelFunc:function(e){const{inputs:t,backend:n,attrs:s}=e,{dy:r,input:a}=t,{filterSize:i,strides:o,pad:l,dimRoundingMode:u}=s;PS([r,a],"avgPool3DGrad");const c=gc(a.shape,i,o,1,l,u),h=c.strideDepth,d=c.strideHeight,p=c.strideWidth,f=c.filterDepth,m=c.filterHeight,g=c.filterWidth,y=c.dilationDepth,b=c.dilationHeight,w=c.dilationWidth,v=c.effectiveFilterDepth,x=c.effectiveFilterHeight,A=c.effectiveFilterWidth,k=v-1-c.padInfo.front,C=A-1-c.padInfo.left,S=x-1-c.padInfo.top,E=Tl(a.shape,"float32"),_=1/(f*m*g),I=n.bufferSync(r);for(let e=0;e=c.outDepth||Math.floor(s)!==s))for(let n=0;n=c.outHeight||Math.floor(r)!==r))for(let n=0;n=c.outWidth||Math.floor(a)!==a)continue;l+=I.get(e,s,r,a,t)}}}E.set(l*_,e,n,s,r,t)}return n.makeTensorInfo(E.shape,E.dtype,E.values)}};const a_={kernelName:jn,backendName:"cpu",kernelFunc:function(e){const{inputs:t,backend:n,attrs:s}=e,{dy:r,input:a}=t,i=a;PS([r,a],"avgPoolGrad");const{filterSize:o,strides:l,pad:u}=s,c=mc(i.shape,o,l,1,u),h=c.strideHeight,d=c.strideWidth,p=c.filterHeight,f=c.filterWidth,m=c.dilationHeight,g=c.dilationWidth,y=c.effectiveFilterHeight,b=c.effectiveFilterWidth,w=b-1-c.padInfo.left,v=y-1-c.padInfo.top,x=Tl(i.shape,"float32"),A=1/(p*f),k=n.data.get(r.dataId).values,C=Tl(r.shape,"float32",k);for(let e=0;e=c.outHeight||Math.floor(s)!==s))for(let n=0;n=c.outWidth||Math.floor(r)!==r)continue;i+=C.get(e,s,r,t)}}x.set(i*A,e,n,s,t)}return n.makeTensorInfo(x.shape,x.dtype,x.values)}};const i_={kernelName:Vs,backendName:"cpu",kernelFunc:function(e){const{inputs:t,backend:n,attrs:s}=e,{x:r,scale:a,offset:i,mean:o,variance:l}=t;qt(o.shape.length===l.shape.length,(()=>"Batch normalization gradient requires mean and variance to have equal ranks.")),qt(null==i||o.shape.length===i.shape.length,(()=>"Batch normalization gradient requires mean and offset to have equal ranks.")),qt(null==a||o.shape.length===a.shape.length,(()=>"Batch normalization gradient requires mean and scale to have equal ranks.")),PS([r,o,l,a,i],"batchNorm");let{varianceEpsilon:u}=s;null==u&&(u=.001);const c=n.data.get(r.dataId).values,h=n.data.get(o.dataId).values,d=n.data.get(l.dataId).values,p=a?n.data.get(a.dataId).values:new Float32Array([1]),f=i?n.data.get(i.dataId).values:new Float32Array([0]),m=new Float32Array(c.length),g=f.length,y=p.length,b=d.length,w=h.length;let v=0,x=0,A=0,k=0;for(let e=0;e=g&&(v=0),x>=w&&(x=0),A>=y&&(A=0),k>=b&&(k=0);return n.makeTensorInfo(r.shape,r.dtype,m)}};function o_(e,t,n,s,r){const a=Yu(s,t,n),i=$t(n),o=dn(s);if(a){const n=Qu(t,o);return"string"===r?e.slice(n,n+i):e.subarray(n,n+i)}const l=Tl(s,r,"string"===r?Ng(e):e),u=Tl(n,r);for(let e=0;ee+t[n]));u.set(l.get(...s),...n)}return"string"===r?Og(u.values):u.values}function l_(e){const{inputs:t,backend:n,attrs:s}=e,{x:r}=t,{begin:a,size:i}=s;PS(r,"slice");const[o,l]=Ju(r,a,i);Pu(r,o,l);const u=o_(n.data.get(r.dataId).values,o,l,r.shape,r.dtype);return n.makeTensorInfo(l,r.dtype,u)}const u_={kernelName:ta,backendName:"cpu",kernelFunc:l_};const c_={kernelName:Xn,backendName:"cpu",kernelFunc:function(e){const{inputs:t,backend:n,attrs:s}=e,{x:r}=t,{blockShape:a,crops:i}=s;PS([r],"batchToSpaceND");const o=a.reduce(((e,t)=>e*t)),l=Bm(r.shape,a,o),u=zm(l.length,a.length),c=Lm(r.shape,a,o),h=Pm(i,a.length),d=Vm(c,i,a.length),p=kE({inputs:{x:r},backend:n,attrs:{shape:l}}),f=BE({inputs:{x:p},backend:n,attrs:{perm:u}}),m=kE({inputs:{x:f},backend:n,attrs:{shape:c}}),g=l_({inputs:{x:m},backend:n,attrs:{begin:h,size:d}});return n.disposeIntermediateTensorInfo(p),n.disposeIntermediateTensorInfo(f),n.disposeIntermediateTensorInfo(m),g}};function h_(e,t,n,s,r){const a=$t(s),i=gn(r,n);for(let n=0;n=r||(i[s]+=a>0?t[n]:1)}return i}function d_(e,t,n,s=!1){const r=e.shape[0],a=e.shape[1],i=Tl([r,n],t.dtype);for(let o=0;o=n||(s?i.set(1,o,a):t.size>0?i.set(i.get(o,a)+t.get(o,r),o,a):i.set(i.get(o,a)+1,o,a))}return i}const p_={kernelName:Zn,backendName:"cpu",kernelFunc:function(e){const{inputs:t,backend:n,attrs:s}=e,{x:r,weights:a}=t,{size:i}=s,o=h_(n.data.get(r.dataId).values,n.data.get(a.dataId).values,a.dtype,a.shape,i);return n.makeTensorInfo([i],a.dtype,o)}},f_=YS(((e,t)=>e&t)),m_=yE(Yn,f_),g_={kernelName:Yn,backendName:"cpu",kernelFunc:m_};const y_={kernelName:Qn,backendName:"cpu",kernelFunc:function(e){const{inputs:t,backend:n}=e,{s0:s,s1:r}=t,a=n.data.get(s.dataId).values,i=n.data.get(r.dataId).values,o=su(Array.from(a),Array.from(i));return n.makeTensorInfo([o.length],"int32",Int32Array.from(o))}},b_=US((e=>Math.ceil(e))),w_=qS(es,b_),v_={kernelName:es,backendName:"cpu",kernelFunc:w_},x_=GS(ts,((e,t)=>{const n=t;return e>n.clipValueMax?n.clipValueMax:e{const{x:t}=e.inputs,n=e.backend,s=new Float32Array($t(t.shape)),r=n.data.get(t.dataId),a=r.complexTensorInfos.real,i=r.complexTensorInfos.imag,o=n.data.get(a.dataId).values,l=n.data.get(i.dataId).values;for(let e=0;e{const n=$t(e.shape);r.set(e.vals,t),t+=n}))}else{let s=0;e.forEach((e=>{const a="string"===n?Ng(e.vals):e.vals;let i=0;for(let n=0;ne.shape)),a);let i=_m(t.map((e=>e.shape)),a);if(0===$t(i))return n.makeTensorInfo(i,t[0].dtype,[]);const o=t.filter((e=>$t(e.shape)>0));if(1===o.length)return $S({inputs:{x:o[0]},backend:n});if("complex64"===o[0].dtype){const e=o.map((e=>dE({inputs:{input:e},backend:n}))),t=o.map((e=>S_({inputs:{input:e},backend:n}))),s=__({inputs:e,backend:n,attrs:{axis:a}}),r=__({inputs:t,backend:n,attrs:{axis:a}}),i=uE({inputs:{real:s,imag:r},backend:n});return e.forEach((e=>n.disposeIntermediateTensorInfo(e))),t.forEach((e=>n.disposeIntermediateTensorInfo(e))),n.disposeIntermediateTensorInfo(s),n.disposeIntermediateTensorInfo(r),i}const l=o.map((e=>{const t=$t(e.shape.slice(a));return kE({inputs:{x:e},backend:n,attrs:{shape:[-1,t]}})})),u=l.map((e=>({vals:n.data.get(e.dataId).values,shape:e.shape})));i=_m(l.map((e=>e.shape)),1);const c=1===l[0].shape[0],h=C_(u,i,t[0].dtype,c),d=_m(o.map((e=>e.shape)),a),p=n.makeTensorInfo(d,t[0].dtype,h);return l.forEach((e=>n.disposeIntermediateTensorInfo(e))),p}const I_={kernelName:rs,backendName:"cpu",kernelFunc:__};function T_(e){const{inputs:t,backend:n,attrs:s}=e,{x:r,filter:a}=t,{strides:i,pad:o,dataFormat:l,dilations:u,dimRoundingMode:c}=s;PS([r,a],"conv2d");const h=_c(l),d=yc(r.shape,a.shape,i,u,o,c,!1,h),p=d.filterHeight,f=d.filterWidth,m=d.dilationHeight,g=d.dilationWidth,y=d.padInfo.left,b=d.padInfo.top,w="channelsLast"===d.dataFormat,v=new Ni(d.outShape,r.dtype),x=dn(r.shape),A=dn(a.shape),k=x[0],C=w?x[1]:x[2],S=w?x[2]:1,E=w?1:x[1],_=v.strides[0],I=w?v.strides[1]:v.strides[2],T=w?v.strides[2]:1,N=w?1:v.strides[1],O=n.data.get(r.dataId).values,R=n.data.get(a.dataId).values,D=v.values;for(let e=0;e=d.inHeight)continue;const a=e*A[0],i=t+n*C;for(let e=0;e=d.inWidth)continue;const r=i+s*S;let o=a+e*A[1];for(let e=0;e=u.inDepth)continue;const a=e*S[0],i=t+n*C[1];for(let e=0;e=u.inHeight)continue;const r=a+e*S[1],o=i+s*C[2];for(let e=0;e=u.inWidth)continue;const a=r+e*S[2],i=o+t*u.inChannels;let l=a;for(let e=0;eMath.cos(e))),z_={kernelName:hs,backendName:"cpu",kernelFunc:B_},L_=GS(ds,(e=>Math.cosh(e))),P_={kernelName:ds,backendName:"cpu",kernelFunc:L_};const V_={kernelName:ms,backendName:"cpu",kernelFunc:function(e){const{inputs:t,backend:n,attrs:s}=e,{image:r,boxes:a,boxInd:i}=t,{cropSize:o,method:l,extrapolationValue:u}=s,[c,h,d,p]=r.shape,f=a.shape[0],[m,g]=o,y=Tl([f,m,g,p],"float32"),b=n.data.get(a.dataId).values,w=n.data.get(i.dataId).values,v=n.data.get(r.dataId).values,x=dn(r.shape),A=dn(y.shape);for(let e=0;e=c)continue;const o=m>1?(r-n)*(h-1)/(m-1):0,f=g>1?(a-s)*(d-1)/(g-1):0;for(let t=0;t1?n*(h-1)+t*o:.5*(n+r)*(h-1);if(c<0||c>h-1)for(let n=0;n1?s*(d-1)+l*f:.5*(s+a)*(d-1);if(c<0||c>d-1){for(let n=0;n1?s*(d-1)+n*f:.5*(s+a)*(d-1);if(r<0||r>d-1){for(let s=0;se+f-t-1:(e,t)=>e+t;for(let e=0;ee+f-t-1:(e,t)=>e+t;for(let e=0;e`Only NHWC dataFormat supported on CPU for depthToSpace. Got ${i}`));const o=r.shape[0],l=r.shape[1],u=r.shape[2],c=r.shape[3],h=l*a,d=u*a,p=c/(a*a),f=n.data.get(r.dataId).values,m=new Float32Array(o*h*d*p);let g=0;for(let e=0;e`Error in depthwiseConv2d: Either strides or dilations must be 1. Got strides ${i} and dilations '${d}'`));const p=yc(r.shape,a.shape,i,d,o,u,!0),{filterHeight:f,filterWidth:m,dilationHeight:g,dilationWidth:y,padInfo:b}=p,w=b.left,v=b.top,x=p.outChannels/p.inChannels,A=new Ni(p.outShape,r.dtype),k=n.data.get(r.dataId).values,C=n.data.get(a.dataId).values,S=A.values;for(let e=0;e=p.inHeight)continue;const a=e*h[0],i=t+n*c[1];for(let e=0;e=p.inWidth)continue;const r=a+e*h[1],o=i+s*p.inChannels;let l=t,u=r;for(let e=0;e{const{x:s,filter:r}=e,{strides:a,pad:i,dilations:o}=n,l=t,u=l.data.get(s.dataId).values,c=s.shape.length,h=l.data.get(r.dataId).values,d=r.shape.length,{batchSize:p,inHeight:f,inWidth:m,inChannels:g,outHeight:y,outWidth:b,padInfo:w,strideHeight:v,strideWidth:x,filterHeight:A,filterWidth:k,dilationHeight:C,dilationWidth:S,outShape:E}=fc(s.shape,r.shape,a,i,"NHWC",o),_=$t(E),I=E.length,T=sn(s.dtype,_);for(let e=0;e=0&&a=0&&pl&&(l=m)}}}T[wn([e,t,a,o],I,dn(E))]=l}}}return{dataId:l.write(pi(T,s.dtype),E,s.dtype),shape:E,dtype:s.dtype}}},Y_={kernelName:Cs,backendName:"cpu",kernelFunc:({inputs:e,backend:t,attrs:n})=>{const{x:s,filter:r,dy:a}=e,{strides:i,pad:o,dilations:l}=n,u=t,c=fn(s.shape,u.data.get(s.dataId).values),h=fn(r.shape,u.data.get(r.dataId).values),{batchSize:d,inHeight:p,inWidth:f,inChannels:m,outHeight:g,outWidth:y,padInfo:b,strideHeight:w,strideWidth:v,filterHeight:x,filterWidth:A,dilationHeight:k,dilationWidth:C,outShape:S}=fc(s.shape,r.shape,i,o,"NHWC",l);qt(a.rank===S.length,(()=>`Error in ${Cs}, dy must have the same rank as output ${S.length}, but got ${a.rank}`));const E=fn(S,u.data.get(a.dataId).values),_=yn(r.shape,r.dtype);for(let e=0;e=0&&s=0&&ui&&(i=r,o=t,l=n)}}}_[o][l][a]+=E[e][t][s][a]}}}return{dataId:u.write(pi(_,s.dtype),r.shape,r.dtype),shape:r.shape,dtype:r.dtype}}},Q_={kernelName:ks,backendName:"cpu",kernelFunc:({inputs:e,backend:t,attrs:n})=>{const{x:s,filter:r,dy:a}=e,{strides:i,pad:o,dilations:l}=n,u=t,c=fn(s.shape,u.data.get(s.dataId).values),h=fn(r.shape,u.data.get(r.dataId).values),{batchSize:d,inHeight:p,inWidth:f,inChannels:m,outHeight:g,outWidth:y,padInfo:b,strideHeight:w,strideWidth:v,filterHeight:x,filterWidth:A,dilationHeight:k,dilationWidth:C,outShape:S}=fc(s.shape,r.shape,i,o,"NHWC",l);qt(a.rank===S.length,(()=>`Error in ${ks}, dy must have the same rank as output ${S.length}, but got ${a.rank}`));const E=fn(S,u.data.get(a.dataId).values),_=yn(s.shape,s.dtype);for(let e=0;e=0&&s=0&&ui&&(i=r,o=s,l=u)}}}_[e][o][l][a]+=E[e][t][s][a]}}}return{dataId:u.write(pi(_,s.dtype),s.shape,s.dtype),shape:s.shape,dtype:s.dtype}}};const J_={kernelName:Ss,backendName:"cpu",kernelFunc:function(e){const{inputs:t,backend:n,attrs:s}=e,{image:r}=t,{canvas:a,options:i}=s,{contextOptions:o,imageOptions:l}=i||{},u=(null==l?void 0:l.alpha)||1,c=(null==o?void 0:o.contextType)||"2d";if("2d"!==c)throw new Error(`Context type ${o.contextType} is not supported by the CPU backend.`);const h=a.getContext(c,(null==o?void 0:o.contextAttributes)||{});if(null==h)throw new Error(`Could not get the context with ${c} type.`);const[d,p]=r.shape.slice(0,2),f=2===r.shape.length?1:r.shape[2],m=n.data.get(r.dataId).values,g="float32"===r.dtype?255:1,y=new Uint8ClampedArray(p*d*4);for(let e=0;e1)throw new Error(`Tensor values for a float32 Tensor must be in the range [0 - 1] but encountered ${s}.`)}else if("int32"===r.dtype&&(s<0||s>255))throw new Error(`Tensor values for a int32 Tensor must be in the range [0 - 255] but encountered ${s}.`);1===f?(t[0]=s*g,t[1]=s*g,t[2]=s*g):t[n]=s*g}const n=4*e;y[n+0]=Math.round(t[0]),y[n+1]=Math.round(t[1]),y[n+2]=Math.round(t[2]),y[n+3]=Math.round(t[3])}a.width=p,a.height=d;const b=new ImageData(y,p,d);return h.putImageData(b,0,0),r}},eI=YS(((e,t)=>e*t)),tI=bE(((e,t,n,s)=>({real:e*n-t*s,imag:e*s+t*n}))),nI=yE(xr,eI,tI),sI={kernelName:xr,backendName:"cpu",kernelFunc:nI};function rI(e){const{inputs:t,backend:n,attrs:s}=e,{x:r}=t,{axis:a,keepDims:i}=s;let o;PS(r,"sum"),o="bool"===r.dtype?mE({inputs:{x:r},backend:n,attrs:{dtype:"int32"}}):$S({inputs:{x:r},backend:n});const l=o.shape.length,u=en(a,o.shape),c=Ih(u,l);let h=u,d=o;null!=c&&(d=BE({inputs:{x:o},backend:n,attrs:{perm:c}}),h=Nh(h.length,l)),_h("sum",h,d.shape.length);const[p,f]=Sh(d.shape,h);let m=hE(n,p,Gi(d.dtype,"int32"));const g=$t(f),y=n.data.get(m.dataId).values,b=n.data.get(d.dataId).values;for(let e=0;e=0&&(d=rI({inputs:{x:d},backend:n,attrs:{axis:u[e]-(i.length-p),keepDims:!1}}),f.push(d)),p--)}for(const e of f)e!==d&&n.disposeIntermediateTensorInfo(e);return d}};const oI={kernelName:Ts,backendName:"cpu",kernelFunc:function(e){const{inputs:t,backend:n}=e,{dy:s,y:r}=t;PS([s,r],"eluGrad");const a=new Float32Array($t(r.shape)),i=n.data.get(r.dataId).values,o=n.data.get(s.dataId).values;for(let e=0;e=0?o[e]:o[e]*(t+1)}return n.makeTensorInfo(r.shape,"float32",a)}},lI=YS(((e,t)=>e===t?1:0)),uI=yE(Os,lI,null,"bool"),cI={kernelName:Os,backendName:"cpu",kernelFunc:uI},hI=qm,dI=jm,pI=Hm,fI=$m,mI=Km,gI=Xm,yI=GS(Ns,(e=>{const t=Math.sign(e),n=Math.abs(e),s=1/(1+hI*n);return t*(1-((((gI*s+mI)*s+fI)*s+pI)*s+dI)*s*Math.exp(-n*n))})),bI={kernelName:Ns,backendName:"cpu",kernelFunc:yI},wI=US((e=>Math.exp(e))),vI=qS(Rs,wI,"float32"),xI={kernelName:Rs,backendName:"cpu",kernelFunc:vI};function AI(e){const{inputs:t,backend:n,attrs:s}=e,{input:r}=t,{dim:a}=s,i=r.shape.length,o=r.shape.slice();let l=a;return a<0&&(qt(-(i+1)<=a,(()=>`Axis must be in the interval [${-(i+1)}, ${i}]`)),l=i+a+1),o.splice(l,0,1),kE({inputs:{x:r},backend:n,attrs:{shape:o}})}const kI={kernelName:Ds,backendName:"cpu",kernelFunc:AI},CI=US((e=>Math.expm1(e))),SI=qS(Ms,CI),EI={kernelName:Ms,backendName:"cpu",kernelFunc:SI},_I=YS(((e,t)=>e/t)),II=yE(Es,_I),TI={kernelName:Es,backendName:"cpu",kernelFunc:II},NI=YS(((e,t)=>e-t)),OI=bE(((e,t,n,s)=>({real:e-n,imag:t-s}))),RI=yE(Ca,NI,OI),DI={kernelName:Ca,backendName:"cpu",kernelFunc:RI};function MI(e,t,n){const s=e.shape,r=s[0],a=s[1],i=n.data.get(e.dataId),o=i.complexTensorInfos.real,l=i.complexTensorInfos.imag,u=[r,a],c=$t(u),h=nn("float32",c),d=nn("float32",c);for(let e=0;e{const{image:s}=e,r=n,a=nn(s.dtype,$t(s.shape)),[i,o,l,u]=s.shape,c=r.data.get(s.dataId).values;for(let e=0;e=0&&iMath.floor(e))),UI=qS(Ls,WI),GI={kernelName:Ls,backendName:"cpu",kernelFunc:UI},qI=YS(((e,t)=>Math.floor(e/t))),jI=yE(Ps,qI,null,"int32"),HI={kernelName:Ps,backendName:"cpu",kernelFunc:jI};const $I={kernelName:Pa,backendName:"cpu",kernelFunc:function(e){const{inputs:t,backend:n,attrs:s}=e,{x:r,filter:a,bias:i,preluActivationWeights:o}=t,{strides:l,pad:u,dataFormat:c,dilations:h,dimRoundingMode:d,activation:p,leakyreluAlpha:f}=s;let m=T_({inputs:{x:r,filter:a},backend:n,attrs:{strides:l,pad:u,dataFormat:c,dilations:h,dimRoundingMode:d}});if(i){const e=m;if("NCHW"===c&&1===i.shape.length&&1!==i.shape[0]){const e=kE({inputs:{x:i},backend:n,attrs:{shape:[i.shape[0],1,1]}});m=xE({inputs:{a:m,b:e},backend:n}),n.disposeIntermediateTensorInfo(e)}else m=xE({inputs:{a:m,b:i},backend:n});n.disposeIntermediateTensorInfo(e)}if(p){const e=m;if("NCHW"===c&&"prelu"===p&&1===o.shape.length&&1!==o.shape[0]){const e=kE({inputs:{x:o},backend:n,attrs:{shape:[o.shape[0],1,1]}});m=lE(n,m,p,e,f),n.disposeIntermediateTensorInfo(e)}else m=lE(n,m,p,o,f);n.disposeIntermediateTensorInfo(e)}return m}};const KI={kernelName:Va,backendName:"cpu",kernelFunc:function(e){const{inputs:t,backend:n,attrs:s}=e,{x:r,filter:a,bias:i,preluActivationWeights:o}=t,{strides:l,pad:u,dataFormat:c,dilations:h,dimRoundingMode:d,activation:p,leakyreluAlpha:f}=s;let m=j_({inputs:{x:r,filter:a},backend:n,attrs:{strides:l,pad:u,dataFormat:c,dilations:h,dimRoundingMode:d}});if(i){const e=m;m=xE({inputs:{a:m,b:i},backend:n}),n.disposeIntermediateTensorInfo(e)}if(p){const e=m;m=lE(n,m,p,o,f),n.disposeIntermediateTensorInfo(e)}return m}};function XI(e,t,n,s,r,a,i,o,l){const u=Tl([s,a],n);for(let n=0;n=l/a)throw new Error(`Invalid indices: ${s} does not index into ${o}`);for(let e=0;e=0,(()=>`GatherV2: the index value ${t} is not in [0, ${c-1}]`))}let h=o;null==o&&(h=0);const d=$t(a.shape),p=Tg(r,a,l,h),f=kE({inputs:{x:r},backend:n,attrs:{shape:[p.batchSize,p.outerSize,p.dimSize,p.sliceSize]}}),m=kE({inputs:{x:a},backend:n,attrs:{shape:[p.batchSize,d/p.batchSize]}}),g=[p.batchSize,p.outerSize,d/p.batchSize,p.sliceSize],y=n.bufferSync(m),b=YI(n.bufferSync(f),y,g);return n.disposeIntermediateTensorInfo(f),n.disposeIntermediateTensorInfo(m),n.makeTensorInfo(p.outputShape,b.dtype,b.values)}},JI=YS(((e,t)=>e>t?1:0)),eT=yE(Gs,JI,null,"bool"),tT={kernelName:Gs,backendName:"cpu",kernelFunc:eT},nT=YS(((e,t)=>e>=t?1:0)),sT=yE(qs,nT,null,"bool"),rT={kernelName:qs,backendName:"cpu",kernelFunc:sT};const aT={kernelName:Hs,backendName:"cpu",kernelFunc:function(e){const{inputs:t,backend:n}=e,{input:s}=t,r=$t(s.shape),a=s.shape[s.shape.length-1],i=kE({inputs:{x:s},backend:n,attrs:{shape:[r/a,a]}}),o=MI(i,!0,n),l=kE({inputs:{x:o},backend:n,attrs:{shape:s.shape}});return n.disposeIntermediateTensorInfo(i),n.disposeIntermediateTensorInfo(o),l}},iT=GS(Ks,(e=>Number.isFinite(e)?1:0),"bool"),oT={kernelName:Ks,backendName:"cpu",kernelFunc:iT},lT=GS(Xs,(e=>Math.abs(e)===1/0?1:0),"bool"),uT={kernelName:Xs,backendName:"cpu",kernelFunc:lT},cT=GS(Zs,(e=>Number.isNaN(e)?1:0),"bool"),hT={kernelName:Zs,backendName:"cpu",kernelFunc:cT},dT=YS(((e,t)=>ee<=t?1:0)),gT=yE(Js,mT,null,"bool"),yT={kernelName:Js,backendName:"cpu",kernelFunc:gT};function bT(e,t,n){const s=(t-e)/(n-1),r=gn(n,"float32");r[0]=e;for(let e=1;eMath.log(e))),xT=qS(tr,vT),AT={kernelName:tr,backendName:"cpu",kernelFunc:xT},kT=GS(nr,(e=>Math.log1p(e))),CT={kernelName:nr,backendName:"cpu",kernelFunc:kT},ST=YS(((e,t)=>e&&t)),ET=yE(sr,ST,null,"bool"),_T={kernelName:sr,backendName:"cpu",kernelFunc:ET},IT=GS(rr,(e=>e?0:1),"bool"),TT={kernelName:rr,backendName:"cpu",kernelFunc:IT},NT=YS(((e,t)=>e||t)),OT=yE(ar,NT,null,"bool"),RT={kernelName:ar,backendName:"cpu",kernelFunc:OT};const DT={kernelName:ir,backendName:"cpu",kernelFunc:function(e){const{inputs:t,backend:n,attrs:s}=e,{x:r}=t,{depthRadius:a,bias:i,alpha:o,beta:l}=s;PS(r,"LRN");const u=r.shape[3],c=u-1,h=n.data.get(r.dataId).values,d=$t(r.shape),p=new Float32Array(d);function f(e){const t=e%u;let n=e-t+Math.max(0,t-a);const s=e-t+Math.min(t+a,c);let r=0;for(;n<=s;n++){const e=h[n];r+=e*e}return r}for(let e=0;ea)&&(a=t)}r[n]=a}return r}function BT(e){const{inputs:t,backend:n,attrs:s}=e,{x:r}=t,{reductionIndices:a,keepDims:i}=s,o=n;let l=r.shape;const u=l.length,c=en(a,l);let h=c;const d=Ih(h,u);let p=o.data.get(r.dataId).values;if(null!=d){const e=new Array(u);for(let t=0;tMath.max(e,t))),PT=yE(ur,LT),VT={kernelName:ur,backendName:"cpu",kernelFunc:PT};const WT={kernelName:cr,backendName:"cpu",kernelFunc:function(e){const{inputs:t,backend:n,attrs:s}=e,{x:r}=t;PS(r,"maxPool");const{filterSize:a,strides:i,pad:o,dimRoundingMode:l}=s;qt(Sc(i,1),(()=>`Error in maxPool: Either strides or dilations must be 1. Got strides ${i} and dilations '1'`));const u=mc(r.shape,a,i,1,o,l);let c;if(1===u.filterWidth&&1===u.filterHeight&&Kt(u.inShape,u.outShape))c=$S({inputs:{x:r},backend:n});else{const e=n.data.get(r.dataId).values,t=dn(r.shape),s=JE(e,r.shape,r.dtype,t,u,"max");c=n.makeTensorInfo(u.outShape,r.dtype,s.values)}return c}};const UT={kernelName:dr,backendName:"cpu",kernelFunc:function(e){const{inputs:t,backend:n,attrs:s}=e,{x:r}=t,{filterSize:a,strides:i,pad:o,dimRoundingMode:l,dataFormat:u}=s;PS(r,"maxPool3d");const c=gc(r.shape,a,i,1,o,l,u),h=t_(n.data.get(r.dataId).values,r.shape,r.dtype,dn(r.shape),c,"max");return n.makeTensorInfo(h.shape,"float32",h.values)}};const GT={kernelName:pr,backendName:"cpu",kernelFunc:function(e){const{inputs:t,backend:n,attrs:s}=e,{dy:r,input:a}=t,{filterSize:i,strides:o,pad:l,dimRoundingMode:u}=s;PS([r,a],"maxPool3DGrad");const c=gc(a.shape,i,o,1,l,u),h=function(e,t){const n=Tl(t.outShape,"int32"),s=t.strideDepth,r=t.strideHeight,a=t.strideWidth,i=t.dilationDepth,o=t.dilationHeight,l=t.dilationWidth,u=t.effectiveFilterDepth,c=t.effectiveFilterHeight,h=t.effectiveFilterWidth,d=t.padInfo.front,p=t.padInfo.top,f=t.padInfo.left;for(let m=0;m=C&&(C=o,S=n*c*h+r*c+i)}}}n.set(S,m,y,s,r,g)}}}return n}(n.bufferSync(a),c),d=c.strideDepth,p=c.strideHeight,f=c.strideWidth,m=c.dilationDepth,g=c.dilationHeight,y=c.dilationWidth,b=c.effectiveFilterDepth,w=c.effectiveFilterHeight,v=c.effectiveFilterWidth,x=b-1-c.padInfo.front,A=v-1-c.padInfo.left,k=w-1-c.padInfo.top,C=Tl(a.shape,"float32"),S=n.bufferSync(r);for(let e=0;e=c.outDepth||Math.floor(s)!==s))for(let r=0;r=c.outHeight||Math.floor(a)!==a))for(let i=0;i=c.outWidth||Math.floor(u)!==u)continue;const d=b*w*v-1-h.get(e,s,a,u,t)===n*w*v+r*v+i?1:0;if(0===d)continue;l+=S.get(e,s,a,u,t)*d}}}C.set(l,e,n,s,r,t)}return n.makeTensorInfo(C.shape,C.dtype,C.values)}};const qT={kernelName:hr,backendName:"cpu",kernelFunc:function(e){const{inputs:t,backend:n,attrs:s}=e,{dy:r,input:a,output:i}=t,o=a;PS([a,i],"maxPoolGrad");const{filterSize:l,strides:u,pad:c,dimRoundingMode:h}=s,d=mc(o.shape,l,u,1,c,h),p=n.data.get(o.dataId).values,f=Tl(d.outShape,o.dtype,e_(p,o.shape,o.dtype,d).values),m=d.strideHeight,g=d.strideWidth,y=d.dilationHeight,b=d.dilationWidth,w=d.effectiveFilterHeight,v=d.effectiveFilterWidth,x=v-1-d.padInfo.left,A=w-1-d.padInfo.top,k=Tl(o.shape,"float32"),C=n.data.get(r.dataId).values,S=Tl(r.shape,"float32",C);for(let e=0;e=d.outHeight||Math.floor(s)!==s))for(let r=0;r=d.outWidth||Math.floor(o)!==o)continue;const l=w*v-1-f.get(e,s,o,t)===n*v+r?1:0;if(0===l)continue;i+=S.get(e,s,o,t)*l}}k.set(i,e,n,s,t)}return n.makeTensorInfo(k.shape,k.dtype,k.values)}};const jT={kernelName:fr,backendName:"cpu",kernelFunc:({inputs:e,attrs:t,backend:n})=>{const{x:s}=e,{filterSize:r,strides:a,pad:i,includeBatchInIndex:o}=t,l=n;PS(s,"MaxPoolWithArgmax");const u=l.data.get(s.dataId).values,c=mc(s.shape,r,a,[1,1],i),[h,d]=function(e,t,n,s,r){const a=JE(e,0,n,dn(t),r,"max"),i=e_(e,t,n,r,!0,s);return[a.values,i.values]}(u,s.shape,s.dtype,o,c),p=l.write(h,c.outShape,s.dtype),f=l.write(d,c.outShape,s.dtype);return[{dataId:p,shape:c.outShape,dtype:s.dtype},{dataId:f,shape:c.outShape,dtype:"int32"}]}};const HT={kernelName:mr,backendName:"cpu",kernelFunc:function(e){const{inputs:t,backend:n,attrs:s}=e,{x:r}=t,{axis:a,keepDims:i}=s,o=en(a,r.shape),l=$t(Sh(r.shape,o)[1]),u=[],c=n.makeTensorInfo([],"float32",new Float32Array([l]));u.push(c);const h=mE({inputs:{x:r},backend:n,attrs:{dtype:"float32"}});u.push(h);const d=II({inputs:{a:h,b:c},backend:n});u.push(d);const p=rI({inputs:{x:d},backend:n,attrs:{axis:a,keepDims:i}});return u.forEach((e=>n.disposeIntermediateTensorInfo(e))),p}};const $T={kernelName:gr,backendName:"cpu",kernelFunc:function(e){const{inputs:t,backend:n,attrs:s}=e,{x:r}=t,{axis:a,keepDims:i}=s;PS(r,"min");const o=en(a,r.shape);let l=o;const u=Ih(l,r.shape.length);let c=r;null!=u&&(c=BE({inputs:{x:r},backend:n,attrs:{perm:u}}),l=Nh(l.length,r.shape.length)),_h("min",l,c.shape.length);const[h,d]=Sh(c.shape,l),p=$t(d),f=gn($t(h),c.dtype),m=n.data.get(c.dataId).values;for(let e=0;eMath.min(e,t))),XT=yE(yr,KT),ZT={kernelName:yr,backendName:"cpu",kernelFunc:XT};const YT={kernelName:br,backendName:"cpu",kernelFunc:function(e){const{inputs:t,backend:n,attrs:s}=e,{x:r}=t,{paddings:a,mode:i}=s;PS(r,"mirrorPad");const o=a.map(((e,t)=>e[0]+r.shape[t]+e[1])),l=a.map((e=>e[0])),u=a.map(((e,t)=>e[0]+r.shape[t])),c="reflect"===i?0:1,h=n.data.get(r.dataId).values,d=r.shape.length,p=dn(r.shape),f=$t(o),m=o.length,g=dn(o),y=nn(r.dtype,f);for(let e=0;e=u[e]&&(t[e]=2*(u[e]-1)-t[e]+c);t=t.map(((e,t)=>e-l[t]));const n=wn(t,d,p);y[e]=h[n]}return{dataId:n.write(y,o,r.dtype),shape:o,dtype:r.dtype}}},QT=YS(((e,t)=>{const n=e%t;return e<0&&t<0||e>=0&&t>=0?n:(n+t)%t})),JT=yE(wr,QT),eN={kernelName:wr,backendName:"cpu",kernelFunc:JT};function tN(e){const{inputs:t,backend:n,attrs:s}=e,{logits:r}=t,{dim:a}=s,i=r.shape.length;let o=a;if(-1===o&&(o=i-1),o!==i-1)throw Error(`Softmax along a non-last dimension is not yet supported. Logits was rank ${i} and dim was ${o}`);const l=en([o],r.shape),u=BT({inputs:{x:r},backend:n,attrs:{reductionIndices:l,keepDims:!1}}),c=Eh(u.shape,l),h=kE({inputs:{x:u},backend:n,attrs:{shape:c}}),d=RI({inputs:{a:r,b:h},backend:n}),p=vI({inputs:{x:d},backend:n}),f=rI({inputs:{x:p},backend:n,attrs:{axis:l,keepDims:!1}}),m=kE({inputs:{x:f},backend:n,attrs:{shape:c}}),g=II({inputs:{a:p,b:m},backend:n});return n.disposeIntermediateTensorInfo(u),n.disposeIntermediateTensorInfo(h),n.disposeIntermediateTensorInfo(d),n.disposeIntermediateTensorInfo(p),n.disposeIntermediateTensorInfo(f),n.disposeIntermediateTensorInfo(m),g}const nN={kernelName:ha,backendName:"cpu",kernelFunc:tN};const sN={kernelName:vr,backendName:"cpu",kernelFunc:function(e){const{inputs:t,backend:n,attrs:s}=e,{logits:r}=t,{numSamples:a,seed:i,normalized:o}=s;PS(r,"multinomial");const l=o?r:tN({inputs:{logits:r},backend:n,attrs:{dim:-1}}),u=l.shape[0],c=l.shape[1],h=n.data.get(l.dataId).values,d=[u,a],p=gn($t(d),"int32");for(let e=0;ee!==t?1:0)),pN=yE(kr,dN,null,"bool"),fN={kernelName:kr,backendName:"cpu",kernelFunc:pN};const mN={kernelName:Ir,backendName:"cpu",kernelFunc:function(e){const{inputs:t,backend:n,attrs:s}=e,{indices:r}=t,{dtype:a,depth:i,onValue:o,offValue:l}=s;PS(r,"oneHot");const u=$t(r.shape),c=new Float32Array(u*i);c.fill(l);const h=n.data.get(r.dataId).values;for(let e=0;e=0&&h[e]{jt(a,e.shape,"All tensors passed to stack must have matching shapes"),qt(i===e.dtype,(()=>"All tensors passed to stack must have matching dtypes"))}));const o=[],l=__({inputs:t.map((e=>{const t=AI({inputs:{input:e},backend:n,attrs:{dim:r}});return o.push(t),t})),backend:n,attrs:{axis:r}});return o.forEach((e=>n.disposeIntermediateTensorInfo(e))),l}const vN={kernelName:Tr,backendName:"cpu",kernelFunc:wN};const xN={kernelName:Nr,backendName:"cpu",kernelFunc:function(e){const{inputs:t,backend:n,attrs:s}=e,{x:r}=t,{paddings:a,constantValue:i}=s;PS(r,"pad");const o=a.map(((e,t)=>e[0]+r.shape[t]+e[1])),l=a.map((e=>e[0])),u=n.data.get(r.dataId).values,c=$t(r.shape),h=r.shape.length,d=dn(r.shape),p=$t(o),f=o.length,m=dn(o),g=nn(r.dtype,p);0!==i&&g.fill(i);for(let e=0;ee+l[t])),f,m)]=u[e]}return{dataId:n.write(g,o,r.dtype),shape:o,dtype:r.dtype}}},AN=YS(((e,t)=>Math.pow(e,t))),kN=yE(Or,AN),CN={kernelName:Or,backendName:"cpu",kernelFunc:kN};function SN(e,t,n,s){const[r,a]=Sh(e,s),i=Gi(t,"int32"),o=gn($t(r),i),l=$t(a);for(let e=0;en.disposeIntermediateTensorInfo(e))),n.makeTensorInfo(y,g,f)}};function _N(e,t,n,s){const r=[];let a=0;const i=t.length-1+n.length,o=new Array(i).fill(null).map((()=>[0]));!function(e,t){for(let n=0;nr)throw new Error("Ragged splits must not point past values");for(let e=1;es[e])throw new Error("Ragged splits must be sorted in ascending order")}}(n,s);let l=1;for(let e=0;e=0){const e=o[r],t=e[e.length-1]-s[i];for(let e=i;e{if(e<0||e>=n){const r=vn(s,t.length,dn(t)).join(",");throw new Error(`indices[${r}] = ${e} is not in [0, ${n})`)}}))}(a,i,t[0][0]-1),0===s.length)throw new Error("params.rank must be nonzero");const l=s[0],{outSplits:u,valueSlices:c,numValues:h}=_N(a,i,e,l),d=function(e){const t=[];for(let n=0;ns[t]=e))}return t}(u),p=TN(n,s,r,c,h);return[d,p[0],p[1]]}const ON={kernelName:Mr,backendName:"cpu",kernelFunc:function(e){const{inputs:t,backend:n,attrs:s}=e,{paramsNestedSplits:r,paramsDenseValues:a,indices:i}=t,{outputRaggedRank:o}=s,l=r.map((e=>n.data.get(e.dataId).values)),u=r.map((e=>e.shape)),c=n.data.get(a.dataId).values,h=n.data.get(i.dataId).values,[d,p,f]=NN(l,u,c,a.shape,a.dtype,h,i.shape),m=d.map((e=>n.makeTensorInfo([e.length],"int32",e))),g=n.makeTensorInfo(f,a.dtype,p);return m.concat([g])}},RN=2147483647;function DN(e,t,n,s,r,a,i){if(t.length>1)throw new Error("starts must be a scalar or vector");if(r.length>1)throw new Error("limits must be a scalar or vector");if(i.length>1)throw new Error("deltas must be a scalar or vector");const o=0===t.length,l=0===r.length,u=0===i.length,c=[];o||c.push(t[0]),l||c.push(r[0]),u||c.push(i[0]);for(let e=1;e0&&rn)c=0;else if(c=Math.ceil(Math.abs((r-n)/i)),c>RN)throw new Error(`Requires ((limit - start) / delta) <= ${RN}`);d[t+1]=d[t]+c}const p=sn(n,d[h]);let f=0;for(let t=0;tn&&(n=t)}return n}static getMaxWidthValueRowID(e){const t=e.length;if(0===t)return 0;let n=0,s=e[0],r=0;for(let a=1;a"Final length of result must be equal to firstDimension.")),r}calculateOutputIndexRowSplit(e,t,n,s){const r=e.length,a=[];for(let i=0;i0&&a.length!==e[r-1])throw new Error("Invalid row split size.");return a}calculateOutputIndexValueRowID(e,t,n,s){const r=e.length,a=[];if(0===r)return[];let i=0,o=e[0];if(o>=t.length)throw new Error(`Got currentValueRowId=${o}, which is not less than ${t.length}`);let l=t[o];a.push(l);for(let u=1;u=0&&(++i,i=t.length)throw new Error(`Got nextValueRowId=${r} which is not less than ${t.length}`);l=t[r]}a.push(l)}if(a.length!==e.length)throw new Error("Invalid row ids.");return a}calculateOutputIndex(e,t,n,s){const r=this.getRowPartitionTensor(e),a=this.getRowPartitionTypeByDimension(e);switch(a){case FN.VALUE_ROWIDS:return this.calculateOutputIndexValueRowID(r,t,n,s);case FN.ROW_SPLITS:if(r.length-1>t.length)throw new Error(`Row partition size is greater than output size: ${r.length-1} > ${t.length}`);return this.calculateOutputIndexRowSplit(r,t,n,s);default:throw new Error(`Unsupported partition type: ${FN[a]}`)}}getFirstDimensionSize(){const e=this.rowPartitionValues[0];if(0===this.rowPartitionTypes.length)throw new Error("No row_partition_types given.");const t=this.rowPartitionTypes[0];switch(t){case FN.FIRST_DIM_SIZE:return e[0];case FN.VALUE_ROWIDS:throw new Error("Cannot handle VALUE_ROWIDS in first dimension.");case FN.ROW_SPLITS:return this.rowPartitionValuesShapes[0][0]-1;default:throw new Error(`Cannot handle type ${FN[t]}`)}}compute(){if(this.rowPartitionValues[0].length<=0)throw new Error("Invalid first partition input. Tensor requires at least one element.");const e=this.getFirstDimensionSize(),t=this.calculateOutputSize(e),n=new Array(this.raggedRank+1);n[n.length-1]=1;for(let e=n.length-2;e>=0;--e)n[e]=n[e+1]*t[e+1];const s=LN(t,!1),r=sn(this.valuesDType,$t(s));if(n[0]*t[0]>0){let a=this.calculateFirstParentOutputIndex(e,n[0],t[0]);for(let e=1;e<=this.raggedRank;++e){a=this.calculateOutputIndex(e-1,a,n[e],t[e])}this.setOutput(this.raggedRank,a,r,s)}return[s,r]}setOutput(e,t,n,s){if(0===n.length)return;const r=this.values,a=n;let i=s.slice();i=i.slice(e+1);const o=$t(i),l=t.length;let u=this.defaultValue;if(u.length!==o&&1!==u.length){const e=this.defaultValueShape;Ao((()=>{const t=Tc(u,e),n=Hc(t,i);u=n.dataSync()}))}let c=0,h=0,d=0;for(let e=0;e<=l;++e){let s=e=l){const e=n.length;s=Math.floor(e/o)}if(s>d)if(1===this.defaultValue.length)a.subarray(d*o,s*o).fill(this.defaultValue[0]),d=s;else for(;s>d;){zN(a.slice(d*o),u,o),++d}s<0?(c=e+1,h=d):(c=e,h=d,d=h+1)}else++d}}}function zN(e,t,n){for(let s=0;s= 0`);if(s<-1)throw new Error(`Dimension ${s} must be >= -1`);s=-1}n.push(s)}return n}function PN(e,t,n,s,r,a,i,o,l,u){return new BN(e,t,n,s,r,a,i,o,l,u).compute()}const VN={kernelName:Br,backendName:"cpu",kernelFunc:function(e){const{inputs:t,backend:n,attrs:s}=e,{shape:r,values:a,defaultValue:i,rowPartitionTensors:o}=t,{rowPartitionTypes:l}=s,u=n.data.get(r.dataId).values,c=n.data.get(a.dataId).values,h=n.data.get(i.dataId).values,d=o.map((e=>n.data.get(e.dataId).values)),p=o.map((e=>e.shape)),[f,m]=PN(u,r.shape,c,a.shape,a.dtype,h,i.shape,d,p,l);return n.makeTensorInfo(f,a.dtype,m)}};function WN(e,t,n,s){if(e===t||e1)return gn(0,s);const r=gn(Math.abs(Math.ceil((t-e)/n)),s);t1/e)),qN={kernelName:Pr,backendName:"cpu",kernelFunc:GN};const jN={kernelName:qr,backendName:"cpu",kernelFunc:function(e){const{inputs:t,backend:n,attrs:s}=e,{images:r}=t,{alignCorners:a,halfPixelCenters:i,size:o}=s;PS(r,"resizeBilinear");const l=dn(r.shape),[u,c]=o,[h,d,p,f]=r.shape,m=n.data.get(r.dataId).values,g=new Float32Array($t([h,u,c,f])),y=[a&&u>1?d-1:d,a&&c>1?p-1:p],b=[a&&u>1?u-1:u,a&&c>1?c-1:c];let w=0;const v=y[0]/b[0],x=y[1]/b[1];for(let e=0;e1?u-1:u,i&&p>1?c-1:c],g=[i&&d>1?d-1:d,i&&p>1?p-1:p],y=m[0]/g[0],b=m[1]/g[1],w=n.data.get(a.dataId).values;let v=0;for(let e=0;e1?d-1:d,a&&c>1?p-1:p],b=[a&&u>1?u-1:u,a&&c>1?c-1:c],w=y[0]/b[0],v=y[1]/b[1];let x=0;for(let e=0;e1?c-1:c,i&&f>1?h-1:h],b=[i&&p>1?p-1:p,i&&f>1?f-1:f],w=y[0]/b[0],v=y[1]/b[1],x=1/w,A=1/v,k=2*Math.ceil(x)+2,C=2*Math.ceil(A)+2;for(let e=0;e=p)continue;const d=t+u*l[1],m=u*w;if(e===Math.min(c-1,i?Math.round(m):Math.floor(m)))for(let e=0;e=f)continue;const r=d+t*l[2],a=t*v;s===Math.min(h-1,i?Math.round(a):Math.floor(a))&&(o+=g[r+n])}}m[a+n]=o}}}}return n.makeTensorInfo(r.shape,r.dtype,m)}};const XN={kernelName:$r,backendName:"cpu",kernelFunc:function(e){const{inputs:t,backend:n,attrs:s}=e,{x:r}=t,{dims:a}=s;PS(r,"reverse");const i=r.shape.length,o=en(a,r.shape);if(0===i)return $S({inputs:{x:r},backend:n});const l=new Ni(r.shape,r.dtype),u=n.bufferSync(r);for(let e=0;en[e]=r.shape[e]-1-n[e])),l.set(u.get(...n),...t)}return n.makeTensorInfo(l.shape,l.dtype,l.values)}},ZN={kernelName:za,backendName:"cpu",kernelFunc:({inputs:e,attrs:t,backend:n})=>{const{image:s}=e,{radians:r,fillValue:a,center:i}=t,o=n,l=nn(s.dtype,$t(s.shape)),[u,c,h,d]=s.shape,[p,f]=Fm(i,c,h),m=Math.sin(r),g=Math.cos(r),y=o.data.get(s.dataId).values;for(let e=0;e=0&&v=0&&x{const t=Math.floor(e);return e-t<.5?Math.floor(e):e-t>.5?Math.ceil(e):t%2==0?t:t+1})),QN={kernelName:Kr,backendName:"cpu",kernelFunc:YN},JN=US((e=>1/Math.sqrt(e))),eO=qS(Xr,JN),tO={kernelName:Xr,backendName:"cpu",kernelFunc:eO};function nO(e,t,n,s,r,a,i,o,l,u){const c=[s/r,r],h=e.values,d=t.values;if(0===s)return Tl(n,t.dtype);const p=l instanceof Ni?l:Tl(c,t.dtype);"string"==typeof l||"number"==typeof l?p.values.fill(l):"boolean"==typeof l&&p.values.fill(+l);for(let e=0;e=s/r)throw new Error(`Invalid indices: ${a} does not index into ${n}`);for(let n=0;n1||1===r.shape.length?1:$t(r.shape.slice(1));for(let e=0;ee>=0?uO*e:lO*(Math.exp(e)-1))),hO={kernelName:ea,backendName:"cpu",kernelFunc:cO},dO=GS(ra,(e=>e<0?-1:e>0?1:0)),pO={kernelName:ra,backendName:"cpu",kernelFunc:dO},fO=GS(na,(e=>Math.sin(e))),mO={kernelName:na,backendName:"cpu",kernelFunc:fO},gO=GS(sa,(e=>Math.sinh(e))),yO={kernelName:sa,backendName:"cpu",kernelFunc:gO},bO=Math.log(1.1920928955078125e-7)+2,wO=GS(ia,(e=>{const t=e>-bO,n=e=l)throw new Error(yg(t,n,l));++f[n],d=d&&n>=p,p=n}let m=!0;for(let e=0;e0&&(f[e]+=f[e-1])}if(m&&d){const t=e,n=s;for(let e=0;eNumber(e))))),n.makeTensorInfo([m.length],s.dtype,new Int32Array(m))]}};function CO(e,t,n,s,r){const a=$t(s),i=t[0],o=r.length,l=[];let u=1,c=-1;for(let e=0;e0){d[h-1]=1;for(let e=h-2;e>=0;--e)d[e]=d[e+1]*s[e+1]}const p=[];if(o>0){p[o-1]=1;for(let e=o-2;e>=0;--e)p[e]=p[e+1]*l[e+1]}const f=sn(n,i*o);for(let t=0;t0?r[o-1]+1:0;if(c<0)throw new Error("segment ids must be >= 0");const h=t.slice();h[0]=c;const d=sn(n,h.reduce(((e,t)=>e*t),1));if(0===o)return c>0&&d.fill(i),[d,h];if(c<=0)throw new Error("segment ids must be >= 0");let p=0,f=1,m=0,g=r[p];for(;;){let t=0;if(f=t)throw new Error("segment ids are not increasing")}if(g<0||g>=c)throw new Error(Sg(g,c));g>m&&d.fill(i,m*u,g*u);for(let t=p;t=l[0])throw new Error(Eg(t,s[t],l[0]));for(let t=0;to)break}return m{const t=[...c];t[o]=e;const s=l_({inputs:{x:r},backend:n,attrs:{begin:u,size:t}});return u[o]+=e,s}))}},OO=US((e=>Math.sqrt(e))),RO=GS(oa,(e=>Math.sqrt(e))),DO={kernelName:oa,backendName:"cpu",kernelFunc:RO},MO={kernelName:ba,backendName:"cpu",kernelFunc:({inputs:e,backend:t})=>{const{x:n}=e,s=t;PS(n,"square");const r=s.data.get(n.dataId).values,a=new Float32Array(r.length);for(let e=0;e{const n=e-t;return n*n})),BO=yE(ya,FO),zO={kernelName:ya,backendName:"cpu",kernelFunc:BO},LO=US(((e,t)=>{const{pattern:n,replaceGlobal:s,rewrite:r}=t;return e.replace(new RegExp(n,s?"g":""),r)})),PO=qS(wa,LO),VO={kernelName:wa,backendName:"cpu",kernelFunc:PO},WO=GS(Fa,((e,t)=>{const n=t;return isNaN(e)?NaN:e>0?1:n.alpha})),UO={kernelName:Fa,backendName:"cpu",kernelFunc:WO};function GO(e,t,n,s){const r=Tl(e,t.dtype);for(let e=0;e=1,(()=>`Input must have rank at least 1, got: ${r.shape.length}`));const e=Wu(b,w,v),t=l_({inputs:{x:r},backend:n,attrs:{begin:b,size:e}});x=kE({inputs:{x:t},backend:n,attrs:{shape:f}}),n.disposeIntermediateTensorInfo(t)}else{const e=GO(p,n.bufferSync(r),v,b);x=n.makeTensorInfo(f,e.dtype,e.values)}return x}};class jO{constructor(e,t,n,s,r,a){this.separator=mi(e),this.nGramWidths=t,this.leftPad=mi(n),this.rightPad=mi(s),this.padWidth=r,this.preserveShort=a}getPadWidth(e){return Math.min(this.padWidth<0?e-1:this.padWidth,e-1)}getNumNGrams(e,t){const n=this.getPadWidth(t);return Math.max(0,e+2*n-t+1)}createNGrams(e,t,n,s,r,a){for(let i=0;i0?0:i-o);let d=0;d+=l*this.leftPad.length;for(let t=0;te.forEach((e=>p[f++]=e));for(let e=0;e0){m(e[h+c-1]);for(let e=0;e0){let e=t[0];if(0!==e)throw new Error(`First split value must be 0, got ${e}`);for(let r=1;r=e;if(s=s&&t[r]<=n,!s)throw new Error(`Invalid split value ${t[r]}, must be in [${e}, ${n}]`);e=t[r]}if(e!==n)throw new Error(`Last split value must be data size. Expected ${n}, got ${e}`)}const r=s-1,a=sn("int32",s);if(0===n||0===s){const e=new Array(n);for(let e=0;e<=r;++e)a[e]=0;return[e,a]}a[0]=0;for(let e=1;e<=r;++e){const n=t[e]-t[e-1];let s=0;this.nGramWidths.forEach((e=>{s+=this.getNumNGrams(n,e)})),this.preserveShort&&n>0&&0===s&&(s=1),a[e]=a[e-1]+s}const i=new Array(a[r]);for(let n=0;n{const o=t[n+1]-t[n],l=this.getNumNGrams(o,a);this.createNGrams(e,s,i,r,l,a),r+=l})),this.preserveShort&&r===a[n]){const a=t[n+1]-t[n];if(0===a)continue;const o=a+2*this.padWidth,l=1;this.createNGrams(e,s,i,r,l,o)}}return[i,a]}}function HO(e,t,n,s,r,a,i,o){return new jO(n,s,r,a,i,o).compute(e,t)}const $O={kernelName:xa,backendName:"cpu",kernelFunc:function(e){const{inputs:t,backend:n,attrs:s}=e,{separator:r,nGramWidths:a,leftPad:i,rightPad:o,padWidth:l,preserveShortSequences:u}=s,{data:c,dataSplits:h}=t,d=n.data.get(c.dataId).values,p=n.data.get(h.dataId).values,[f,m]=HO(d,p,r,a,i,o,l,u);return[n.makeTensorInfo([f.length],"string",f),n.makeTensorInfo(h.shape,"int32",m)]}};function KO(e,t,n,s){if(!e.length)return;if(0===t.length){for(let t=0;tMath.tan(e))),eR={kernelName:Sa,backendName:"cpu",kernelFunc:JO},tR=GS(Ea,(e=>Math.tanh(e)));const nR={kernelName:Yr,backendName:"cpu",kernelFunc:function(e){const{inputs:t,backend:n}=e,{tensor:s,indices:r,updates:a}=t,{sliceRank:i,numUpdates:o,sliceSize:l,strides:u,outputSize:c}=Wp(0,r,s.shape),h=n.bufferSync(r),d=n.bufferSync(a),p=n.bufferSync(s),f=nO(h,d,s.shape,c,l,o,i,u,p,!1);return n.makeTensorInfo(s.shape,f.dtype,f.values)}};function sR(e,t){const n=new Array(e.rank);for(let s=0;s{const n=t.value-e.value;return 0===n?e.index-t.index:n};function iR(e,t,n=0,s=e.length-1){for(;s>n;){if(s-n>600){const r=s-n+1,a=t-n+1,i=Math.log(r),o=.5*Math.exp(2*i/3),l=.5*Math.sqrt(i*o*(r-o)/r)*Math.sign(a-r/2);iR(e,t,Math.max(n,Math.floor(t-a*o/r+l)),Math.min(s,Math.floor(t+(r-a)*o/r+l)))}const r=e[t];let a=n,i=s;for(Gt(e,n,t),aR(e[s],r)>0&&Gt(e,n,s);a0;)i-=1}0===aR(e[n],r)?Gt(e,n,i):(i+=1,Gt(e,i,s)),i<=t&&(n=i+1),t<=i&&(s=i-1)}}function oR(e,t,n,s,r){const a=t[t.length-1],[i,o]=[e.length/a,a],l=nn(n,i*s),u=nn("int32",i*s);for(let t=0;ti[t]={value:e,index:t})),st-1)if(t<=1)n=0;else{const e=2*t;n-=e*Math.trunc(n/e),n>=t&&(n=e-n-1)}return Wt(0,n,t-1)}(e,t);case"wrap":return function(e,t){let n=e;if(n<0)if(t<=1)n=0;else{const e=t-1;n+=t*(Math.trunc(-n/e)+1)}else if(n>t-1)if(t<=1)n=0;else{const e=t-1;n-=t*Math.trunc(n/e)}return Wt(0,n,t-1)}(e,t);case"nearest":return function(e,t){return Wt(0,e,t-1)}(e,t);default:return function(e,t){return e}(e)}}function hR(e,t,n,s,r,a,i,o,l,u,c){return 0<=o&&o{for(let n=0;nn.disposeIntermediateTensorInfo(e))),h}},bR=[_E,TE,OE,DE,AE,ME,LE,PE,VE,WE,GE,jE,$E,ZE,QE,n_,s_,r_,a_,EE,i_,c_,p_,g_,y_,gE,v_,A_,cE,k_,I_,N_,O_,R_,D_,M_,F_,z_,P_,V_,W_,U_,G_,q_,H_,$_,K_,X_,Z_,Y_,Q_,J_,iI,HS,oI,cI,bI,xI,kI,EI,zI,PI,VI,GI,HI,$I,KI,ZI,QI,tT,rT,KS,aT,E_,oT,uT,hT,ZS,fT,yT,wT,AT,CT,_T,TT,RT,DT,MT,zT,VT,WT,UT,GT,qT,jT,HT,$T,ZT,YT,eN,sN,sI,aN,oN,uN,hN,fN,mN,bN,vN,xN,CN,eE,EN,ON,MN,VN,UN,pE,TI,qN,nE,rE,CE,jN,HN,$N,KN,XN,ZN,QN,tO,sO,iO,oO,hO,oE,pO,mO,yO,u_,nN,vO,xO,kO,SO,_O,IO,TO,NO,DO,MO,zO,VO,UO,qO,$O,ZO,QO,DI,aI,eR,{kernelName:Ea,backendName:"cpu",kernelFunc:tR},nR,rR,lR,uR,zE,mR,gR,yR,yN];for(const e of bR)Ka(e);const wR={},vR={alpha:!1,antialias:!1,premultipliedAlpha:!1,preserveDrawingBuffer:!1,depth:!1,stencil:!1,failIfMajorPerformanceCaveat:!0};function xR(e,t){if(!(e in wR)||null!=t){const n=function(e,t){if(1!==e&&2!==e)throw new Error("Cannot get WebGL rendering context, WebGL is disabled.");const n=null==t?function(e){if(Sn().getBool("IS_SAFARI")||"undefined"==typeof OffscreenCanvas||2!==e){if("undefined"!=typeof document)return document.createElement("canvas");throw new Error("Cannot create a canvas in this context")}return new OffscreenCanvas(300,150)}(e):t;n.addEventListener("webglcontextlost",(t=>{t.preventDefault(),delete wR[e]}),!1),Sn().getBool("SOFTWARE_WEBGL_ENABLED")&&(vR.failIfMajorPerformanceCaveat=!1);if(1===e)return n.getContext("webgl",vR)||n.getContext("experimental-webgl",vR);return n.getContext("webgl2",vR)}(e,t);if(null===n)return null;wR[e]=n}const n=wR[e];return null==n||n.isContextLost()?(delete wR[e],xR(e)):(n.disable(n.DEPTH_TEST),n.disable(n.STENCIL_TEST),n.disable(n.BLEND),n.disable(n.DITHER),n.disable(n.POLYGON_OFFSET_FILL),n.disable(n.SAMPLE_COVERAGE),n.enable(n.SCISSOR_TEST),n.enable(n.CULL_FACE),n.cullFace(n.BACK),wR[e])}var AR,kR,CR;function SR(e,t){return[t,e]}function ER(e){const t=$t(e);return Zt(Math.ceil(t/4))}function _R(e,t){return[Math.max(1,Math.ceil(t/2)),Math.max(1,Math.ceil(e/2))]}function IR(e,t){const n=e;let s,r,a,i,o,l,u,c,h,d;return 2===Sn().getNumber("WEBGL_VERSION")?(s=n.R32F,r=n.R16F,a=n.RGBA16F,i=n.RGBA32F,o=n.RED,u=4,c=1,h=n.HALF_FLOAT,d=n.FLOAT,l=n.RGBA8):(s=e.RGBA,r=e.RGBA,a=e.RGBA,i=n.RGBA,o=e.RGBA,u=4,c=4,h=null!=t?t.HALF_FLOAT_OES:null,d=e.FLOAT,l=e.RGBA),{internalFormatFloat:s,internalFormatHalfFloat:r,internalFormatPackedHalfFloat:a,internalFormatPackedFloat:i,textureFormatFloat:o,downloadTextureFormat:l,downloadUnpackNumChannels:u,defaultNumChannels:c,textureTypeHalfFloat:h,textureTypeFloat:d}}function TR(e,t){const n=t();return Sn().getBool("DEBUG")&&function(e){const t=e.getError();if(t!==e.NO_ERROR)throw new Error("WebGL Error: "+function(e,t){switch(t){case e.NO_ERROR:return"NO_ERROR";case e.INVALID_ENUM:return"INVALID_ENUM";case e.INVALID_VALUE:return"INVALID_VALUE";case e.INVALID_OPERATION:return"INVALID_OPERATION";case e.INVALID_FRAMEBUFFER_OPERATION:return"INVALID_FRAMEBUFFER_OPERATION";case e.OUT_OF_MEMORY:return"OUT_OF_MEMORY";case e.CONTEXT_LOST_WEBGL:return"CONTEXT_LOST_WEBGL";default:return`Unknown error code ${t}`}}(e,t))}(e),n}!function(e){e[e.DENSE=0]="DENSE",e[e.SHARED_BATCH=1]="SHARED_BATCH"}(AR||(AR={})),function(e){e[e.RENDER=0]="RENDER",e[e.UPLOAD=1]="UPLOAD",e[e.PIXELS=2]="PIXELS",e[e.DOWNLOAD=3]="DOWNLOAD"}(kR||(kR={})),function(e){e[e.UNPACKED_FLOAT16=0]="UNPACKED_FLOAT16",e[e.UNPACKED_FLOAT32=1]="UNPACKED_FLOAT32",e[e.PACKED_4X1_UNSIGNED_BYTE=2]="PACKED_4X1_UNSIGNED_BYTE",e[e.PACKED_2X2_FLOAT32=3]="PACKED_2X2_FLOAT32",e[e.PACKED_2X2_FLOAT16=4]="PACKED_2X2_FLOAT16"}(CR||(CR={}));function NR(e){return!!(Sn().getBool("WEBGL_RENDER_FLOAT32_ENABLED")||0===e||5.96e-8e.getExtension(t)),'Extension "'+t+'" not supported on this browser.')}const RR=/ERROR: [0-9]+:([0-9]+):/g;function DR(e,t){const n=RR.exec(t);if(null==n)return;const s=+n[1],r=e.split("\n"),a=r.length.toString().length+2,i=r.map(((e,t)=>Yt((t+1).toString(),a)+e));let o=0;for(let e=0;ee.validateProgram(t))),!1===e.getProgramParameter(t,e.VALIDATE_STATUS))throw new Error("Shader program validation failed.")}function FR(e,t,n,s,r,a,i){const o=e.getAttribLocation(t,n);return-1!==o&&(TR(e,(()=>e.bindBuffer(e.ARRAY_BUFFER,s))),TR(e,(()=>e.vertexAttribPointer(o,r,e.FLOAT,!1,a,i))),TR(e,(()=>e.enableVertexAttribArray(o))),!0)}function BR(e,t,n,s){TR(e,(()=>function(e,t,n){WR(e,n),TR(e,(()=>e.activeTexture(e.TEXTURE0+n))),TR(e,(()=>e.bindTexture(e.TEXTURE_2D,t)))}(e,t,s))),TR(e,(()=>e.uniform1i(n,s)))}function zR(e,t,n){TR(e,(()=>e.bindFramebuffer(e.FRAMEBUFFER,n))),TR(e,(()=>e.framebufferTexture2D(e.FRAMEBUFFER,e.COLOR_ATTACHMENT0,e.TEXTURE_2D,t,0)))}function LR(e,t){TR(e,(()=>e.bindFramebuffer(e.FRAMEBUFFER,t))),TR(e,(()=>e.framebufferTexture2D(e.FRAMEBUFFER,e.COLOR_ATTACHMENT0,e.TEXTURE_2D,null,0)))}function PR(e){const t=e.checkFramebufferStatus(e.FRAMEBUFFER);if(t!==e.FRAMEBUFFER_COMPLETE)throw new Error("Error binding framebuffer: "+function(e,t){switch(t){case e.FRAMEBUFFER_INCOMPLETE_ATTACHMENT:return"FRAMEBUFFER_INCOMPLETE_ATTACHMENT";case e.FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT:return"FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT";case e.FRAMEBUFFER_INCOMPLETE_DIMENSIONS:return"FRAMEBUFFER_INCOMPLETE_DIMENSIONS";case e.FRAMEBUFFER_UNSUPPORTED:return"FRAMEBUFFER_UNSUPPORTED";default:return`unknown error ${t}`}}(e,t))}function VR(e,t,n){const s=TR(e,(()=>t()));if(null==s)throw new Error(n);return s}function WR(e,t){const n=e.MAX_COMBINED_TEXTURE_IMAGE_UNITS-1,s=t+e.TEXTURE0;if(sn){throw new Error(`textureUnit must be in ${`[gl.TEXTURE0, gl.TEXTURE${n}]`}.`)}}function UR(e,t=2){return $t(e.slice(0,e.length-t))}function GR(e){if(0===e.length)throw Error("Cannot get rows and columns of an empty shape array.");return[e.length>1?e[e.length-2]:1,e[e.length-1]]}function qR(e){let t=[1,1,1];return 0===e.length||1===e.length&&1===e[0]||(t=[UR(e),...GR(e)]),t}function jR(e){return e%2==0}function HR(e,t){if(Kt(e=e.slice(-2),t=t.slice(-2)))return!0;if(!e.length||!t.length)return!0;if(0===e[0]||0===e[1]||0===t[0]||0===t[1])return!0;if(e.length!==t.length){const n=e[e.length-1],s=t[t.length-1];if(n===s)return!0;if(jR(n)&&jR(s)&&(1===e[0]||1===t[0]))return!0}return e[1]===t[1]&&jR(e[0])&&jR(t[0])}let $R,KR;function XR(e,t){return null!=e.getExtension(t)}function ZR(e){try{if(null!=xR(e))return!0}catch(e){return!1}return!1}function YR(e){if(0===e)return!1;const t=xR(e);if(1!==e){if(XR(t,"EXT_color_buffer_float"))return QR(t);const e="EXT_color_buffer_half_float";if(XR(t,e)){const n=t.getExtension(e);return function(e,t){const n=IR(e,t),s=e.createTexture();e.bindTexture(e.TEXTURE_2D,s);const r=1,a=1;e.texImage2D(e.TEXTURE_2D,0,n.internalFormatHalfFloat,r,a,0,n.textureFormatFloat,n.textureTypeHalfFloat,null);const i=e.createFramebuffer();e.bindFramebuffer(e.FRAMEBUFFER,i),e.framebufferTexture2D(e.FRAMEBUFFER,e.COLOR_ATTACHMENT0,e.TEXTURE_2D,s,0);const o=e.checkFramebufferStatus(e.FRAMEBUFFER)===e.FRAMEBUFFER_COMPLETE;return e.bindTexture(e.TEXTURE_2D,null),e.bindFramebuffer(e.FRAMEBUFFER,null),e.deleteTexture(s),e.deleteFramebuffer(i),o}(t,n)}return!1}if(!XR(t,"OES_texture_float"))return!1;if(!XR(t,"WEBGL_color_buffer_float"))return!1;return QR(t)}function QR(e){const t=IR(e),n=e.createTexture();e.bindTexture(e.TEXTURE_2D,n);e.texImage2D(e.TEXTURE_2D,0,t.internalFormatFloat,1,1,0,t.textureFormatFloat,t.textureTypeFloat,null);const s=e.createFramebuffer();e.bindFramebuffer(e.FRAMEBUFFER,s),e.framebufferTexture2D(e.FRAMEBUFFER,e.COLOR_ATTACHMENT0,e.TEXTURE_2D,n,0);const r=e.checkFramebufferStatus(e.FRAMEBUFFER)===e.FRAMEBUFFER_COMPLETE;return e.bindTexture(e.TEXTURE_2D,null),e.bindFramebuffer(e.FRAMEBUFFER,null),e.deleteTexture(n),e.deleteFramebuffer(s),r}function JR(e,t){Array.isArray(e)||(e=[e]),e.forEach((e=>{null!=e&&qt("complex64"!==e.dtype,(()=>`${t} does not support complex64 tensors in the WebGL backend.`))}))}const eD=Sn();function tD(){let e,t,n,s,r,a,i,o,l,u;return 2===Sn().getNumber("WEBGL_VERSION")?(e="#version 300 es",t="in",n="out",s="in",r="texture",a="outputColor",i="out vec4 outputColor;",o=Sn().getBool("WEBGL2_ISNAN_CUSTOM")?"\n bool isnan_custom(float val) {\n uint floatToUint = floatBitsToUint(val);\n return (floatToUint & 0x7fffffffu) > 0x7f800000u;\n }\n\n bvec4 isnan_custom(vec4 val) {\n return bvec4(isnan_custom(val.x),\n isnan_custom(val.y), isnan_custom(val.z), isnan_custom(val.w));\n }\n\n #define isnan(value) isnan_custom(value)\n ":"",l="",u="\n #define round(value) newRound(value)\n int newRound(float value) {\n return int(floor(value + 0.5));\n }\n\n ivec4 newRound(vec4 value) {\n return ivec4(floor(value + vec4(0.5)));\n }\n "):(e="",t="attribute",n="varying",s="varying",r="texture2D",a="gl_FragColor",i="",o="\n #define isnan(value) isnan_custom(value)\n bool isnan_custom(float val) {\n return (val > 0. || val < 1. || val == 0.) ? false : true;\n }\n bvec4 isnan_custom(vec4 val) {\n return bvec4(isnan(val.x), isnan(val.y), isnan(val.z), isnan(val.w));\n }\n ",l="\n uniform float INFINITY;\n\n bool isinf(float val) {\n return abs(val) == INFINITY;\n }\n bvec4 isinf(vec4 val) {\n return equal(abs(val), vec4(INFINITY));\n }\n ",u="\n int round(float value) {\n return int(floor(value + 0.5));\n }\n\n ivec4 round(vec4 value) {\n return ivec4(floor(value + vec4(0.5)));\n }\n "),{version:e,attribute:t,varyingVs:n,varyingFs:s,texture2D:r,output:a,defineOutput:i,defineSpecialNaN:o,defineSpecialInf:l,defineRound:u}}function nD(e,t,n="index"){const s=dn(t);return s.map(((t,r)=>`${`int ${e[r]} = ${n} / ${t}`}; ${r===s.length-1?`int ${e[r+1]} = ${n} - ${e[r]} * ${t}`:`index -= ${e[r]} * ${t}`};`)).join("")}function sD(e,t,n="index"){const s=dn(t);return s.map(((t,r)=>`${`int ${e[r]} = ${n} / outShapeStrides[${r}]`}; ${r===s.length-1?`int ${e[r+1]} = ${n} - ${e[r]} * outShapeStrides[${r}]`:`index -= ${e[r]} * outShapeStrides[${r}]`};`)).join("")}function rD(e,t,n="index"){const s=function(e,t){const n=e.length,s=e.map((e=>`${t}[${e}]`)),r=new Array(n-1);r[n-2]=s[n-1];for(let e=n-3;e>=0;--e)r[e]=`(${r[e+1]} * ${s[e+1]})`;return r}(e.map(((e,t)=>t)),t);return s.map(((t,r)=>`${`int ${e[r]} = ${n} / ${s[r]}`}; ${r===s.length-1?`int ${e[r+1]} = ${n} - ${e[r]} * ${s[r]}`:`index -= ${e[r]} * ${s[r]}`};`)).join("")}function aD(e){const t=dn(e).map((e=>e.toString()));return`\n int getFlatIndex(ivec3 coords) {\n return coords.x * ${t[0]} + coords.y * ${t[1]} + coords.z;\n }\n`}eD.registerFlag("HAS_WEBGL",(()=>eD.getNumber("WEBGL_VERSION")>0)),eD.registerFlag("WEBGL_VERSION",(()=>ZR(2)?2:ZR(1)?1:0)),eD.registerFlag("WEBGL_CHECK_NUMERICAL_PROBLEMS",(()=>!1)),eD.registerFlag("WEBGL_BUFFER_SUPPORTED",(()=>2===eD.get("WEBGL_VERSION"))),eD.registerFlag("WEBGL_CPU_FORWARD",(()=>!0)),eD.registerFlag("WEBGL_FORCE_F16_TEXTURES",(()=>!1)),eD.registerFlag("WEBGL_PACK",(()=>eD.getBool("HAS_WEBGL"))),eD.registerFlag("WEBGL_PACK_NORMALIZATION",(()=>eD.getBool("WEBGL_PACK"))),eD.registerFlag("WEBGL_PACK_CLIP",(()=>eD.getBool("WEBGL_PACK"))),eD.registerFlag("WEBGL_PACK_DEPTHWISECONV",(()=>eD.getBool("WEBGL_PACK"))),eD.registerFlag("WEBGL_PACK_BINARY_OPERATIONS",(()=>eD.getBool("WEBGL_PACK"))),eD.registerFlag("WEBGL_PACK_UNARY_OPERATIONS",(()=>eD.getBool("WEBGL_PACK"))),eD.registerFlag("WEBGL_PACK_ARRAY_OPERATIONS",(()=>eD.getBool("WEBGL_PACK"))),eD.registerFlag("WEBGL_PACK_IMAGE_OPERATIONS",(()=>eD.getBool("WEBGL_PACK"))),eD.registerFlag("WEBGL_PACK_REDUCE",(()=>eD.getBool("WEBGL_PACK"))),eD.registerFlag("WEBGL_LAZILY_UNPACK",(()=>eD.getBool("WEBGL_PACK"))),eD.registerFlag("WEBGL_CONV_IM2COL",(()=>eD.getBool("WEBGL_PACK"))),eD.registerFlag("WEBGL_PACK_CONV2DTRANSPOSE",(()=>eD.getBool("WEBGL_PACK"))),eD.registerFlag("WEBGL_MAX_TEXTURE_SIZE",(()=>function(e){if(null==$R){const t=xR(e);$R=t.getParameter(t.MAX_TEXTURE_SIZE)}return $R}(eD.getNumber("WEBGL_VERSION")))),eD.registerFlag("WEBGL_MAX_TEXTURES_IN_SHADER",(()=>function(e){if(null==KR){const t=xR(e);KR=t.getParameter(t.MAX_TEXTURE_IMAGE_UNITS)}return Math.min(16,KR)}(eD.getNumber("WEBGL_VERSION")))),eD.registerFlag("WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_VERSION",(()=>{const e=eD.getNumber("WEBGL_VERSION");return 0===e?0:function(e){if(0===e)return 0;let t;const n=xR(e);return t=XR(n,"EXT_disjoint_timer_query_webgl2")&&2===e?2:XR(n,"EXT_disjoint_timer_query")?1:0,t}(e)})),eD.registerFlag("WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_RELIABLE",(()=>eD.getNumber("WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_VERSION")>0&&!ro())),eD.registerFlag("WEBGL_RENDER_FLOAT32_CAPABLE",(()=>function(e){if(0===e)return!1;const t=xR(e);if(1===e){if(!XR(t,"OES_texture_float"))return!1}else if(!XR(t,"EXT_color_buffer_float"))return!1;return QR(t)}(eD.getNumber("WEBGL_VERSION")))),eD.registerFlag("WEBGL_RENDER_FLOAT32_ENABLED",(()=>!eD.getBool("WEBGL_FORCE_F16_TEXTURES")&&eD.getBool("WEBGL_RENDER_FLOAT32_CAPABLE"))),eD.registerFlag("WEBGL_DOWNLOAD_FLOAT_ENABLED",(()=>YR(eD.getNumber("WEBGL_VERSION")))),eD.registerFlag("WEBGL_FENCE_API_ENABLED",(()=>{return 2===(e=eD.getNumber("WEBGL_VERSION"))&&null!=xR(e).fenceSync;var e})),eD.registerFlag("WEBGL_SIZE_UPLOAD_UNIFORM",(()=>eD.getBool("WEBGL_RENDER_FLOAT32_ENABLED")?4:0)),eD.registerFlag("WEBGL_DELETE_TEXTURE_THRESHOLD",(()=>-1),(e=>{if("number"!=typeof e)throw new Error(`WEBGL_DELETE_TEXTURE_THRESHOLD must be a number but got ${e}.`);if(e<0&&-1!==e)throw new Error(`WEBGL_DELETE_TEXTURE_THRESHOLD must be -1 (indicating never delete) or at least 0, but got ${e}.`)})),eD.registerFlag("WEBGL_FLUSH_THRESHOLD",(()=>ro()?1:-1),(e=>{if("number"!=typeof e)throw new Error(`WEBGL_FLUSH_THRESHOLD must be a number but got ${e}.`);if(e<0&&-1!==e)throw new Error(`WEBGL_FLUSH_THRESHOLD must be -1 (indicating never manual flush) or at least 0, but got ${e}.`)})),eD.registerFlag("CPU_HANDOFF_SIZE_THRESHOLD",(()=>128)),eD.registerFlag("WEBGL_USE_SHAPES_UNIFORMS",(()=>!1)),eD.registerFlag("TOPK_LAST_DIM_CPU_HANDOFF_SIZE_THRESHOLD",(()=>1e5)),eD.registerFlag("TOPK_K_CPU_HANDOFF_THRESHOLD",(()=>128)),eD.registerFlag("WEBGL_EXP_CONV",(()=>!1)),eD.registerFlag("SOFTWARE_WEBGL_ENABLED",(()=>eD.getBool("IS_TEST"))),eD.registerFlag("WEBGL_MAX_SIZE_FOR_NARROW_TEXTURE",(()=>1/0)),eD.registerFlag("WEBGL_AUTO_SQUARIFY_NARROW_TEXTURE_SHAPE",(()=>!1)),eD.registerFlag("WEBGL2_ISNAN_CUSTOM",(()=>!1)),eD.registerFlag("ENGINE_COMPILE_ONLY",(()=>!1));const iD="\n const float FLOAT_MAX = 1.70141184e38;\n const float FLOAT_MIN = 1.17549435e-38;\n\n lowp vec4 encode_float(highp float v) {\n if (isnan(v)) {\n return vec4(255, 255, 255, 255);\n }\n\n highp float av = abs(v);\n\n if(av < FLOAT_MIN) {\n return vec4(0.0, 0.0, 0.0, 0.0);\n } else if(v > FLOAT_MAX) {\n return vec4(0.0, 0.0, 128.0, 127.0) / 255.0;\n } else if(v < -FLOAT_MAX) {\n return vec4(0.0, 0.0, 128.0, 255.0) / 255.0;\n }\n\n highp vec4 c = vec4(0,0,0,0);\n\n highp float e = floor(log2(av));\n highp float m = exp2(fract(log2(av))) - 1.0;\n\n c[2] = floor(128.0 * m);\n m -= c[2] / 128.0;\n c[1] = floor(32768.0 * m);\n m -= c[1] / 32768.0;\n c[0] = floor(8388608.0 * m);\n\n highp float ebias = e + 127.0;\n c[3] = floor(ebias / 2.0);\n ebias -= c[3] * 2.0;\n c[2] += floor(ebias) * 128.0;\n\n c[3] += 128.0 * step(0.0, -v);\n\n return c / 255.0;\n }\n",{getBroadcastDims:oD}=r;function lD(e,t,n){const s=[];if(e.forEach((e=>{const t=$t(e.shapeInfo.logicalShape);if(e.shapeInfo.isUniform?s.push(`uniform float ${e.name}${t>1?`[${t}]`:""};`):(s.push(`uniform sampler2D ${e.name};`),s.push(`uniform int offset${e.name};`)),n.enableShapeUniforms){const{uniformShape:t}=wD(n.packedInputs,e.shapeInfo.logicalShape,e.shapeInfo.texShape);switch(t.length){case 1:s.push(`uniform int ${e.name}Shape;`);break;case 2:s.push(`uniform ivec2 ${e.name}Shape;`);break;case 3:s.push(`uniform ivec3 ${e.name}Shape;`);break;case 4:s.push(`uniform ivec4 ${e.name}Shape;`)}s.push(`uniform ivec2 ${e.name}TexShape;`)}})),n.enableShapeUniforms){switch(t.logicalShape.length){case 1:s.push("uniform int outShape;");break;case 2:s.push("uniform ivec2 outShape;"),s.push("uniform int outShapeStrides;");break;case 3:s.push("uniform ivec3 outShape;"),s.push("uniform ivec2 outShapeStrides;");break;case 4:s.push("uniform ivec4 outShape;"),s.push("uniform ivec3 outShapeStrides;")}s.push("uniform ivec2 outTexShape;")}n.customUniforms&&n.customUniforms.forEach((e=>{s.push(`uniform ${e.type} ${e.name}${e.arrayIndex?`[${e.arrayIndex}]`:""};`)}));const r=s.join("\n"),a=e.map((e=>function(e,t,n=!1,s){let r="";r+=n?cD(e,s):uD(e,s);const a=e.shapeInfo.logicalShape,i=t.logicalShape;a.length<=i.length&&(r+=n?function(e,t){const n=e.name,s=n.charAt(0).toUpperCase()+n.slice(1),r="get"+s+"AtOutCoords",a=e.shapeInfo.logicalShape.length,i=t.logicalShape.length,o=oD(e.shapeInfo.logicalShape,t.logicalShape),l=bD(i),u=i-a;let c;const h=["x","y","z","w","u","v"];c=0===a?"":i<2&&o.length>=1?"coords = 0;":o.map((e=>`coords.${h[e+u]} = 0;`)).join("\n");let d="";d=i<2&&a>0?"coords":e.shapeInfo.logicalShape.map(((e,t)=>`coords.${h[t+u]}`)).join(", ");let p="return outputValue;";const f=1===$t(e.shapeInfo.logicalShape),m=$t(t.logicalShape),g=1===m;if(1!==a||f||g){if(f&&!g)p=1===i?"\n return vec4(outputValue.x, outputValue.x, 0., 0.);\n ":"\n return vec4(outputValue.x);\n ";else if(o.length){const e=a-2,t=a-1;o.indexOf(e)>-1&&o.indexOf(t)>-1?p="return vec4(outputValue.x);":o.indexOf(e)>-1?p="return vec4(outputValue.x, outputValue.y, outputValue.x, outputValue.y);":o.indexOf(t)>-1&&(p="return vec4(outputValue.xx, outputValue.zz);")}}else p="\n return vec4(outputValue.xy, outputValue.xy);\n ";return`\n vec4 ${r}() {\n ${l} coords = getOutputCoords();\n ${c}\n vec4 outputValue = get${s}(${d});\n ${p}\n }\n `}(e,t):function(e,t){const n=e.name,s=n.charAt(0).toUpperCase()+n.slice(1),r="get"+s+"AtOutCoords",a=t.texShape,i=e.shapeInfo.texShape,o=e.shapeInfo.logicalShape.length,l=t.logicalShape.length;if(!e.shapeInfo.isUniform&&o===l&&null==e.shapeInfo.flatOffset&&Kt(i,a))return`\n float ${r}() {\n return sampleTexture(${n}, resultUV);\n }\n `;const u=bD(l),c=oD(e.shapeInfo.logicalShape,t.logicalShape),h=l-o;let d;const p=["x","y","z","w","u","v"];d=0===o?"":l<2&&c.length>=1?"coords = 0;":c.map((e=>`coords.${p[e+h]} = 0;`)).join("\n");let f="";f=l<2&&o>0?"coords":e.shapeInfo.logicalShape.map(((e,t)=>`coords.${p[t+h]}`)).join(", ");return`\n float ${r}() {\n ${u} coords = getOutputCoords();\n ${d}\n return get${s}(${f});\n }\n `}(e,t));return r}(e,t,n.packedInputs,n.enableShapeUniforms))).join("\n"),i=t.texShape,o=tD(),l=function(e){return`\n float sampleTexture(sampler2D textureSampler, vec2 uv) {\n return ${e.texture2D}(textureSampler, uv).r;\n }\n `}(o);let u,c,h=function(e){const t=`${e.version}\n precision highp float;\n precision highp int;\n precision highp sampler2D;\n ${e.varyingFs} vec2 resultUV;\n ${e.defineOutput}\n const vec2 halfCR = vec2(0.5, 0.5);\n\n struct ivec5\n {\n int x;\n int y;\n int z;\n int w;\n int u;\n };\n\n struct ivec6\n {\n int x;\n int y;\n int z;\n int w;\n int u;\n int v;\n };\n\n uniform float NAN;\n ${e.defineSpecialNaN}\n ${e.defineSpecialInf}\n ${e.defineRound}\n\n int imod(int x, int y) {\n return x - y * (x / y);\n }\n\n int idiv(int a, int b, float sign) {\n int res = a / b;\n int mod = imod(a, b);\n if (sign < 0. && mod != 0) {\n res -= 1;\n }\n return res;\n }\n\n //Based on the work of Dave Hoskins\n //https://www.shadertoy.com/view/4djSRW\n #define HASHSCALE1 443.8975\n float random(float seed){\n vec2 p = resultUV * seed;\n vec3 p3 = fract(vec3(p.xyx) * HASHSCALE1);\n p3 += dot(p3, p3.yzx + 19.19);\n return fract((p3.x + p3.y) * p3.z);\n }\n\n ${hD}\n ${dD}\n ${pD}\n `;return t}(o);t.isPacked?(u=function(e,t,n){switch(e.length){case 0:return mD();case 1:return function(e,t,n){const s=[Math.ceil(t[0]/2),Math.ceil(t[1]/2)];if(1===s[0])return n?"\n int getOutputCoords() {\n return 2 * int(resultUV.x * ceil(float(outTexShape[1]) / 2.0));\n }\n ":`\n int getOutputCoords() {\n return 2 * int(resultUV.x * ${s[1]}.0);\n }\n `;if(1===s[1])return n?"\n int getOutputCoords() {\n return 2 * int(resultUV.y * ceil(float(outTexShape[0]) / 2.0));\n }\n ":`\n int getOutputCoords() {\n return 2 * int(resultUV.y * ${s[0]}.0);\n }\n `;if(n)return"\n int getOutputCoords() {\n ivec2 packedTexShape = ivec2(ceil(float(outTexShape[0]) / 2.0), ceil(float(outTexShape[1]) / 2.0));\n ivec2 resTexRC = ivec2(resultUV.yx *\n vec2(packedTexShape[0], packedTexShape[1]));\n return 2 * (resTexRC.x * packedTexShape[1] + resTexRC.y);\n }\n ";return`\n int getOutputCoords() {\n ivec2 resTexRC = ivec2(resultUV.yx *\n vec2(${s[0]}, ${s[1]}));\n return 2 * (resTexRC.x * ${s[1]} + resTexRC.y);\n }\n `}(0,t,n);case 2:return function(e,t,n){const s=[Math.ceil(t[0]/2),Math.ceil(t[1]/2)];if(Kt(e,t))return n?"\n ivec2 getOutputCoords() {\n ivec2 packedTexShape = ivec2(ceil(float(outTexShape[0]) / 2.0), ceil(float(outTexShape[1]) / 2.0));\n return 2 * ivec2(resultUV.yx * vec2(packedTexShape[0], packedTexShape[1]));\n }\n ":`\n ivec2 getOutputCoords() {\n return 2 * ivec2(resultUV.yx * vec2(${s[0]}, ${s[1]}));\n }\n `;const r=Math.ceil(e[1]/2);if(n)return"\n ivec2 getOutputCoords() {\n ivec2 packedTexShape = ivec2(ceil(float(outTexShape[0]) / 2.0), ceil(float(outTexShape[1]) / 2.0));\n int texelsInLogicalRow = int(ceil(float(outShape[1]) / 2.0));\n ivec2 resTexRC = ivec2(resultUV.yx *\n vec2(packedTexShape[0], packedTexShape[1]));\n\n int index = resTexRC.x * packedTexShape[1] + resTexRC.y;\n int r = 2 * (index / texelsInLogicalRow);\n int c = imod(index, texelsInLogicalRow) * 2;\n\n return ivec2(r, c);\n }\n ";return`\n ivec2 getOutputCoords() {\n ivec2 resTexRC = ivec2(resultUV.yx *\n vec2(${s[0]}, ${s[1]}));\n\n int index = resTexRC.x * ${s[1]} + resTexRC.y;\n int r = 2 * (index / ${r});\n int c = imod(index, ${r}) * 2;\n\n return ivec2(r, c);\n }\n `}(e,t,n);case 3:return function(e,t,n){if(n)return"\n ivec3 getOutputCoords() {\n ivec2 packedTexShape = ivec2(ceil(float(outTexShape[0]) / 2.0), ceil(float(outTexShape[1]) / 2.0));\n int texelsInLogicalRow = int(ceil(float(outShape[2]) / 2.0));\n int texelsInBatch = texelsInLogicalRow * int(ceil(float(outShape[1]) / 2.0));\n ivec2 resTexRC = ivec2(resultUV.yx *\n vec2(packedTexShape[0], packedTexShape[1]));\n int index = resTexRC.x * packedTexShape[1] + resTexRC.y;\n\n int b = index / texelsInBatch;\n index -= b * texelsInBatch;\n\n int r = 2 * (index / texelsInLogicalRow);\n int c = imod(index, texelsInLogicalRow) * 2;\n\n return ivec3(b, r, c);\n }\n ";const s=[Math.ceil(t[0]/2),Math.ceil(t[1]/2)],r=Math.ceil(e[2]/2),a=r*Math.ceil(e[1]/2);return`\n ivec3 getOutputCoords() {\n ivec2 resTexRC = ivec2(resultUV.yx *\n vec2(${s[0]}, ${s[1]}));\n int index = resTexRC.x * ${s[1]} + resTexRC.y;\n\n int b = index / ${a};\n index -= b * ${a};\n\n int r = 2 * (index / ${r});\n int c = imod(index, ${r}) * 2;\n\n return ivec3(b, r, c);\n }\n `}(e,t,n);default:return function(e,t,n){if(n)return"\n ivec4 getOutputCoords() {\n ivec2 packedTexShape = ivec2(ceil(float(outTexShape[0]) / 2.0), ceil(float(outTexShape[1]) / 2.0));\n ivec2 resTexRC = ivec2(resultUV.yx *\n vec2(packedTexShape[0], packedTexShape[1]));\n int index = resTexRC.x * packedTexShape[1] + resTexRC.y;\n\n int texelsInLogicalRow = int(ceil(float(outShape[3]) / 2.0));\n int texelsInBatch = texelsInLogicalRow * int(ceil(float(outShape[2]) / 2.0));\n int texelsInBatchN = texelsInBatch * outShape[1];\n\n int b2 = index / texelsInBatchN;\n index -= b2 * texelsInBatchN;\n\n int b = index / texelsInBatch;\n index -= b * texelsInBatch;\n\n int r = 2 * (index / texelsInLogicalRow);\n int c = imod(index, texelsInLogicalRow) * 2;\n\n return ivec4(b2, b, r, c);\n }\n ";const s=[Math.ceil(t[0]/2),Math.ceil(t[1]/2)],r=Math.ceil(e[e.length-1]/2),a=r*Math.ceil(e[e.length-2]/2);let i=a,o="",l="b, r, c";for(let t=2;t1&&!Kt(t,n)&&s.lengthe[t])).join(", ")}function AD(e,t,n,s){const r=n.map(((e,n)=>{const s={logicalShape:e.shape,texShape:e.isUniform?null:e.texData.texShape,isUniform:e.isUniform,isPacked:!e.isUniform&&e.texData.isPacked,flatOffset:null};return null!=e.texData&&null!=e.texData.slice&&e.texData.slice.flatOffset>0&&(s.flatOffset=e.texData.slice.flatOffset),{name:t.variableNames[n],shapeInfo:s}})),a=r.map((e=>e.shapeInfo)),i={logicalShape:s.shape,texShape:s.texData.texShape,isUniform:!1,isPacked:s.texData.isPacked,flatOffset:null},o=lD(r,i,t),l=function(e,t){const n=VR(e,(()=>e.createShader(e.FRAGMENT_SHADER)),"Unable to create fragment WebGLShader.");if(TR(e,(()=>e.shaderSource(n,t))),TR(e,(()=>e.compileShader(n))),Sn().get("ENGINE_COMPILE_ONLY"))return n;if(!1===e.getShaderParameter(n,e.COMPILE_STATUS))throw DR(t,e.getShaderInfoLog(n)),new Error("Failed to compile fragment shader.");return n}(e.gl,o),u=e.createProgram(l);return Sn().get("ENGINE_COMPILE_ONLY")?{program:t,fragmentShader:l,source:o,webGLProgram:u,inShapeInfos:a,outShapeInfo:i,variablesLocations:null,customUniformLocations:null,infLoc:null,nanLoc:null,outShapeLocation:null,outShapeStridesLocation:null,outTexShapeLocation:null}:(e.buildVao(u),Object.assign({program:t,fragmentShader:l,source:o,webGLProgram:u,inShapeInfos:a,outShapeInfo:i},kD(e,t,u)))}function kD(e,t,n){const s=[],r=[];let a,i,o,l=null,u=null;u=e.getUniformLocation(n,"NAN",!1),1===Sn().getNumber("WEBGL_VERSION")&&(l=e.getUniformLocation(n,"INFINITY",!1));const c=!1;for(const r of t.variableNames){const a={name:r,uniform:e.getUniformLocation(n,r,c),offset:e.getUniformLocation(n,`offset${r}`,c)};t.enableShapeUniforms&&(a.shape=e.getUniformLocation(n,`${r}Shape`,c),a.texShape=e.getUniformLocation(n,`${r}TexShape`,c)),s.push(a)}if(t.enableShapeUniforms&&(a=e.getUniformLocation(n,"outShape",c),o=e.getUniformLocation(n,"outShapeStrides",c),i=e.getUniformLocation(n,"outTexShape",c)),t.customUniforms)for(const s of t.customUniforms)r.push(e.getUniformLocation(n,s.name,c));return{variablesLocations:s,customUniformLocations:r,infLoc:l,nanLoc:u,outShapeLocation:a,outShapeStridesLocation:o,outTexShapeLocation:i}}function CD(e,t){if(e.length!==t.length)throw Error(`Binary was compiled with ${e.length} inputs, but was executed with ${t.length} inputs`);e.forEach(((e,n)=>{const s=e.logicalShape,r=t[n],a=r.shape;if(!Kt(s,a))throw Error(`Binary was compiled with different shapes than the current args. Shapes ${s} and ${a} must match`);if(e.isUniform&&r.isUniform)return;const i=e.texShape,o=r.isUniform?null:r.texData.texShape;if(!Kt(i,o))throw Error(`Binary was compiled with different texture shapes than the current args. Shape ${i} and ${o} must match`)}))}function SD(e){return Sn().getBool("WEBGL_USE_SHAPES_UNIFORMS")&&e<=4}class ED{constructor(e){this.variableNames=["A"],this.packedInputs=!1,this.packedOutput=!0,this.outPackingScheme=AR.DENSE,this.customUniforms=[{name:"texShape",type:"ivec2"}];const t=tD();this.outputShape=e,this.enableShapeUniforms=SD(this.outputShape.length),this.userCode=`\n ivec3 outCoordsFromFlatIndex(int index) {\n ${this.enableShapeUniforms?sD(["r","c","d"],e):nD(["r","c","d"],e)}\n return ivec3(r, c, d);\n }\n\n void main() {\n ivec2 resTexRC = ivec2(resultUV.yx * vec2(texShape[0], texShape[1]));\n int index = 4 * (resTexRC.x * texShape[1] + resTexRC.y);\n\n vec4 result = vec4(0.);\n\n for (int i=0; i<4; i++) {\n int flatIndex = index + i;\n ivec3 rc = outCoordsFromFlatIndex(flatIndex);\n result[i] = getA(rc.x, rc.y, rc.z);\n }\n\n ${t.output} = result;\n }\n `}}class _D{constructor(e){this.variableNames=["A"],this.packedInputs=!0,this.packedOutput=!0,this.outPackingScheme=AR.DENSE,this.customUniforms=[{name:"texShape",type:"ivec2"}];const t=tD();this.outputShape=e,this.enableShapeUniforms=SD(this.outputShape.length),this.userCode=`\n ivec3 outCoordsFromFlatIndex(int index) {\n ${this.enableShapeUniforms?sD(["r","c","d"],e):nD(["r","c","d"],e)}\n return ivec3(r, c, d);\n }\n\n void main() {\n ivec2 resTexRC = ivec2(resultUV.yx * vec2(texShape[0], texShape[1]));\n int index = 4 * (resTexRC.x * texShape[1] + resTexRC.y);\n\n vec4 result = vec4(0.);\n\n for (int i=0; i<4; i++) {\n int flatIndex = index + i;\n ivec3 rc = outCoordsFromFlatIndex(flatIndex);\n result[i] = getChannel(getA(rc.x, rc.y, rc.z), vec2(rc.y, rc.z));\n }\n\n ${t.output} = result;\n }\n `}}class ID{constructor(e){this.variableNames=["A"],this.outTexUsage=kR.DOWNLOAD;const t=tD();this.outputShape=e,this.userCode=`\n ${iD}\n\n void main() {\n float x = getAAtOutCoords();\n ${t.output} = encode_float(x);\n }\n `}}class TD{constructor(e){this.variableNames=["A"],this.packedInputs=!0,this.packedOutput=!1,this.outTexUsage=kR.DOWNLOAD;const t=tD();this.outputShape=e,this.userCode=`\n ${iD}\n\n void main() {\n ivec3 coords = getOutputCoords();\n float x = getChannel(getAAtOutCoords(), vec2(coords.y, coords.z));\n ${t.output} = encode_float(x);\n }\n `}}const ND={R:0,G:1,B:2,A:3};class OD{constructor(e,t=!1,n="RGBA"){this.variableNames=["A"],this.customUniforms=[{name:"texShape",type:"ivec2"}];const s=tD();this.outputShape=e,this.enableShapeUniforms=SD(this.outputShape.length);let r="result";t&&(r="floor(result * 255. + 0.5)");let a="";for(let e=0;ee.createShader(e.VERTEX_SHADER)),"Unable to create vertex WebGLShader.");if(TR(e,(()=>e.shaderSource(n,t))),TR(e,(()=>e.compileShader(n))),!1===e.getShaderParameter(n,e.COMPILE_STATUS))throw new Error("Failed to compile vertex shader.");return n}(e,`${t.version}\n precision highp float;\n ${t.attribute} vec3 clipSpacePos;\n ${t.attribute} vec2 uv;\n ${t.varyingVs} vec2 resultUV;\n\n void main() {\n gl_Position = vec4(clipSpacePos, 1);\n resultUV = uv;\n }`)}function MD(e){return function(e,t){const n=VR(e,(()=>e.createBuffer()),"Unable to create WebGLBuffer");return TR(e,(()=>e.bindBuffer(e.ARRAY_BUFFER,n))),TR(e,(()=>e.bufferData(e.ARRAY_BUFFER,t,e.STATIC_DRAW))),n}(e,new Float32Array([-1,1,0,0,1,-1,-1,0,0,0,1,1,0,1,1,1,-1,0,1,0]))}function FD(e){return function(e,t){const n=VR(e,(()=>e.createBuffer()),"Unable to create WebGLBuffer");return TR(e,(()=>e.bindBuffer(e.ELEMENT_ARRAY_BUFFER,n))),TR(e,(()=>e.bufferData(e.ELEMENT_ARRAY_BUFFER,t,e.STATIC_DRAW))),n}(e,new Uint16Array([0,1,2,2,1,3]))}function BD(e,t,n,s,r,a){!function(e,t){const n=Sn().getNumber("WEBGL_MAX_TEXTURE_SIZE");if(e<=0||t<=0)throw new Error(`Requested texture size [${e}x${t}] is invalid.`);if(e>n||t>n)throw new Error(`Requested texture size [${e}x${t}] greater than WebGL maximum on this browser / GPU [${n}x${n}].`)}(t,n);const i=function(e){return VR(e,(()=>e.createTexture()),"Unable to create WebGLTexture.")}(e),o=e.TEXTURE_2D;return TR(e,(()=>e.bindTexture(o,i))),TR(e,(()=>e.texParameteri(o,e.TEXTURE_WRAP_S,e.CLAMP_TO_EDGE))),TR(e,(()=>e.texParameteri(o,e.TEXTURE_WRAP_T,e.CLAMP_TO_EDGE))),TR(e,(()=>e.texParameteri(o,e.TEXTURE_MIN_FILTER,e.NEAREST))),TR(e,(()=>e.texParameteri(o,e.TEXTURE_MAG_FILTER,e.NEAREST))),1===Sn().getNumber("WEBGL_VERSION")?TR(e,(()=>e.texImage2D(o,0,s,t,n,0,r,a,null))):TR(e,(()=>e.texStorage2D(o,1,s,t,n))),TR(e,(()=>e.bindTexture(e.TEXTURE_2D,null))),{texture:i,texShape:[n,t]}}function zD(e){return e.internalFormatFloat}function LD(e){return e.internalFormatHalfFloat}function PD(e){return e.downloadTextureFormat}function VD(e){return e.internalFormatPackedFloat}function WD(e){return e.internalFormatPackedHalfFloat}function UD(e,t,n,s,r,a,i,o){const l=e,u=new Float32Array(function(e,t){const[n,s]=_R(e,t);return n*s*4}(a,i));return l.bindBuffer(l.PIXEL_PACK_BUFFER,t),l.getBufferSubData(l.PIXEL_PACK_BUFFER,0,u),l.bindBuffer(l.PIXEL_PACK_BUFFER,null),u}class GD{constructor(e){this.outputTexture=null,this.program=null,this.disposed=!1,this.itemsToPoll=[];const t=Sn().getNumber("WEBGL_VERSION");if(null!=e?(this.gl=e,function(e,t){wR[e]=t}(t,e)):this.gl=xR(t),e=this.gl,2===Sn().getNumber("WEBGL_VERSION")){const t=e;this.createVertexArray=()=>TR(t,(()=>t.createVertexArray())),this.bindVertexArray=e=>TR(t,(()=>t.bindVertexArray(e))),this.deleteVertexArray=e=>TR(t,(()=>t.deleteVertexArray(e))),this.getVertexArray=()=>TR(t,(()=>t.getParameter(t.VERTEX_ARRAY_BINDING)))}else if(null!=e){const t=e.getExtension("OES_vertex_array_object");if(null==t)throw new Error("All WebGL1 implementations are expected to offer OES_vertex_array_object.");this.createVertexArray=()=>TR(e,(()=>t.createVertexArrayOES())),this.bindVertexArray=n=>TR(e,(()=>t.bindVertexArrayOES(n))),this.deleteVertexArray=n=>TR(e,(()=>t.deleteVertexArrayOES(n))),this.getVertexArray=()=>TR(e,(()=>e.getParameter(t.VERTEX_ARRAY_BINDING_OES)))}let n="WEBGL_color_buffer_float";const s="EXT_color_buffer_half_float";if(this.parallelCompilationExtension=this.gl.getExtension("KHR_parallel_shader_compile"),1===Sn().getNumber("WEBGL_VERSION")){const e="OES_texture_float",t="OES_texture_half_float";if(this.textureFloatExtension=OR(this.gl,e),XR(this.gl,t))this.textureHalfFloatExtension=OR(this.gl,t);else if(Sn().get("WEBGL_FORCE_F16_TEXTURES"))throw new Error("GL context does not support half float textures, yet the environment flag WEBGL_FORCE_F16_TEXTURES is set to true.");if(this.colorBufferFloatExtension=this.gl.getExtension(n),XR(this.gl,s))this.colorBufferHalfFloatExtension=OR(this.gl,s);else if(Sn().get("WEBGL_FORCE_F16_TEXTURES"))throw new Error("GL context does not support color renderable half floats, yet the environment flag WEBGL_FORCE_F16_TEXTURES is set to true.")}else if(n="EXT_color_buffer_float",XR(this.gl,n))this.colorBufferFloatExtension=this.gl.getExtension(n);else{if(!XR(this.gl,s))throw new Error("GL context does not support color renderable floats");this.colorBufferHalfFloatExtension=this.gl.getExtension(s)}this.vertexBuffer=MD(this.gl),this.indexBuffer=FD(this.gl),this.framebuffer=function(e){return VR(e,(()=>e.createFramebuffer()),"Unable to create WebGLFramebuffer.")}(this.gl),this.textureConfig=IR(this.gl,this.textureHalfFloatExtension)}get debug(){return Sn().getBool("DEBUG")}dispose(){if(this.disposed)return;this.program,this.outputTexture;const e=this.gl;TR(e,(()=>e.finish())),TR(e,(()=>e.bindFramebuffer(e.FRAMEBUFFER,null))),TR(e,(()=>e.deleteFramebuffer(this.framebuffer))),TR(e,(()=>e.bindBuffer(e.ARRAY_BUFFER,null))),TR(e,(()=>e.bindBuffer(e.ELEMENT_ARRAY_BUFFER,null))),TR(e,(()=>e.deleteBuffer(this.indexBuffer))),this.disposed=!0}createFloat32MatrixTexture(e,t){return this.throwIfDisposed(),function(e,t,n,s){const[r,a]=SR(t,n);return BD(e,r,a,zD(s),s.textureFormatFloat,e.FLOAT)}(this.gl,e,t,this.textureConfig)}createFloat16MatrixTexture(e,t){return this.throwIfDisposed(),function(e,t,n,s){const[r,a]=SR(t,n);return BD(e,r,a,LD(s),s.textureFormatFloat,s.textureTypeHalfFloat)}(this.gl,e,t,this.textureConfig)}createUnsignedBytesMatrixTexture(e,t){return this.throwIfDisposed(),function(e,t,n,s){const[r,a]=SR(t,n);return BD(e,r,a,PD(s),e.RGBA,e.UNSIGNED_BYTE)}(this.gl,e,t,this.textureConfig)}uploadPixelDataToTexture(e,t){this.throwIfDisposed(),function(e,t,n){TR(e,(()=>e.bindTexture(e.TEXTURE_2D,t))),n.data instanceof Uint8Array?2===Sn().getNumber("WEBGL_VERSION")?TR(e,(()=>e.texSubImage2D(e.TEXTURE_2D,0,0,0,n.width,n.height,e.RGBA,e.UNSIGNED_BYTE,n.data))):TR(e,(()=>e.texImage2D(e.TEXTURE_2D,0,e.RGBA,n.width,n.height,0,e.RGBA,e.UNSIGNED_BYTE,n.data))):2===Sn().getNumber("WEBGL_VERSION")?TR(e,(()=>e.texSubImage2D(e.TEXTURE_2D,0,0,0,e.RGBA,e.UNSIGNED_BYTE,n))):TR(e,(()=>e.texImage2D(e.TEXTURE_2D,0,e.RGBA,e.RGBA,e.UNSIGNED_BYTE,n))),TR(e,(()=>e.bindTexture(e.TEXTURE_2D,null)))}(this.gl,e,t)}uploadDenseMatrixToTexture(e,t,n,s){this.throwIfDisposed(),function(e,t,n,s,r,a){let i,o,l;TR(e,(()=>e.bindTexture(e.TEXTURE_2D,t))),r instanceof Uint8Array?(i=new Uint8Array(n*s*4),o=e.UNSIGNED_BYTE,l=e.RGBA):(i=new Float32Array(n*s*4),o=e.FLOAT,l=a.internalFormatPackedFloat),i.set(r),2===Sn().getNumber("WEBGL_VERSION")?TR(e,(()=>e.texSubImage2D(e.TEXTURE_2D,0,0,0,n,s,e.RGBA,o,i))):TR(e,(()=>e.texImage2D(e.TEXTURE_2D,0,l,n,s,0,e.RGBA,o,i))),TR(e,(()=>e.bindTexture(e.TEXTURE_2D,null)))}(this.gl,e,t,n,s,this.textureConfig)}createFloat16PackedMatrixTexture(e,t){return this.throwIfDisposed(),function(e,t,n,s){const[r,a]=_R(t,n);return BD(e,r,a,WD(s),e.RGBA,s.textureTypeHalfFloat)}(this.gl,e,t,this.textureConfig)}createPackedMatrixTexture(e,t){return this.throwIfDisposed(),function(e,t,n,s){const[r,a]=_R(t,n);return BD(e,r,a,VD(s),e.RGBA,e.FLOAT)}(this.gl,e,t,this.textureConfig)}deleteMatrixTexture(e){this.throwIfDisposed(),this.outputTexture===e&&(LR(this.gl,this.framebuffer),this.outputTexture=null),TR(this.gl,(()=>this.gl.deleteTexture(e)))}downloadByteEncodedFloatMatrixFromOutputTexture(e,t,n){return this.downloadMatrixDriver(e,(()=>function(e,t,n,s){const[r,a]=SR(t,n),i=new Uint8Array(t*n*4);return TR(e,(()=>e.readPixels(0,0,r,a,s.downloadTextureFormat,e.UNSIGNED_BYTE,i))),new Float32Array(i.buffer)}(this.gl,t,n,this.textureConfig)))}downloadPackedMatrixFromBuffer(e,t,n,s,r,a){return UD(this.gl,e,0,0,0,r,a,this.textureConfig)}downloadFloat32MatrixFromBuffer(e,t){return function(e,t,n){const s=e,r=new Float32Array(n);return s.bindBuffer(s.PIXEL_PACK_BUFFER,t),s.getBufferSubData(s.PIXEL_PACK_BUFFER,0,r),s.bindBuffer(s.PIXEL_PACK_BUFFER,null),r}(this.gl,e,t)}createBufferFromTexture(e,t,n){this.bindTextureToFrameBuffer(e);const s=function(e,t,n,s){const r=e.createBuffer();TR(e,(()=>e.bindBuffer(e.PIXEL_PACK_BUFFER,r)));const a=16*t*n;return TR(e,(()=>e.bufferData(e.PIXEL_PACK_BUFFER,a,e.STREAM_READ))),TR(e,(()=>e.readPixels(0,0,n,t,e.RGBA,e.FLOAT,0))),TR(e,(()=>e.bindBuffer(e.PIXEL_PACK_BUFFER,null))),r}(this.gl,t,n,this.textureConfig);return this.unbindTextureToFrameBuffer(),s}createAndWaitForFence(){const e=this.createFence(this.gl);return this.pollFence(e)}createFence(e){let t,n;if(Sn().getBool("WEBGL_FENCE_API_ENABLED")){const s=e,r=s.fenceSync(s.SYNC_GPU_COMMANDS_COMPLETE,0);e.flush(),n=()=>{const e=s.clientWaitSync(r,0,0);return e===s.ALREADY_SIGNALED||e===s.CONDITION_SATISFIED},t=r}else Sn().getNumber("WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_VERSION")>0?(t=this.beginQuery(),this.endQuery(),n=()=>this.isQueryAvailable(t,Sn().getNumber("WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_VERSION"))):n=()=>!0;return{query:t,isFencePassed:n}}downloadMatrixFromPackedTexture(e,t,n){return this.downloadMatrixDriver(e,(()=>function(e,t,n){const s=new Float32Array(t*n*4);return TR(e,(()=>e.readPixels(0,0,n,t,e.RGBA,e.FLOAT,s))),s}(this.gl,t,n)))}createProgram(e){this.throwIfDisposed();const t=this.gl;null==this.vertexShader&&(this.vertexShader=DD(t));const n=function(e){return VR(e,(()=>e.createProgram()),"Unable to create WebGLProgram.")}(t);TR(t,(()=>t.attachShader(n,this.vertexShader))),TR(t,(()=>t.attachShader(n,e))),function(e,t){if(TR(e,(()=>e.linkProgram(t))),!Sn().get("ENGINE_COMPILE_ONLY")&&!1===e.getProgramParameter(t,e.LINK_STATUS))throw new Error("Failed to link vertex and fragment shaders.")}(t,n);const s=Object.assign(n,{vao:this.createVertexArray()});return this.debug&&MR(t,s),s}buildVao(e){this.setProgram(e),this.bindVertexArray(e.vao);const t=this.gl;TR(t,(()=>t.bindBuffer(t.ELEMENT_ARRAY_BUFFER,this.indexBuffer))),function(e,t,n){TR(e,(()=>e.bindBuffer(e.ARRAY_BUFFER,n))),FR(e,t,"clipSpacePos",n,3,20,0)&&FR(e,t,"uv",n,2,20,12)}(t,e,this.vertexBuffer)}deleteProgram(e){this.throwIfDisposed(),e===this.program&&(this.program=null),null!=e&&(TR(this.gl,(()=>this.gl.deleteProgram(e))),this.deleteVertexArray(e.vao))}setProgram(e){this.throwIfDisposed(),this.program=e,null!=this.program&&this.debug&&MR(this.gl,this.program),TR(this.gl,(()=>this.gl.useProgram(e)))}getUniformLocation(e,t,n=!0){return this.throwIfDisposed(),n?function(e,t,n){return VR(e,(()=>e.getUniformLocation(t,n)),'uniform "'+n+'" not present in program.')}(this.gl,e,t):function(e,t,n){return e.getUniformLocation(t,n)}(this.gl,e,t)}getAttributeLocation(e,t){return this.throwIfDisposed(),TR(this.gl,(()=>this.gl.getAttribLocation(e,t)))}getUniformLocationNoThrow(e,t){return this.throwIfDisposed(),this.gl.getUniformLocation(e,t)}setInputMatrixTexture(e,t,n){this.throwIfDisposed(),this.throwIfNoProgram(),BR(this.gl,e,t,n)}setOutputMatrixTexture(e,t,n){this.setOutputMatrixTextureDriver(e,n,t)}setOutputPackedMatrixTexture(e,t,n){this.throwIfDisposed();const[s,r]=_R(t,n);this.setOutputMatrixTextureDriver(e,s,r)}setOutputMatrixWriteRegion(e,t,n,s){this.setOutputMatrixWriteRegionDriver(n,e,s,t)}setOutputPackedMatrixWriteRegion(e,t,n,s){throw new Error("setOutputPackedMatrixWriteRegion not implemented.")}debugValidate(){null!=this.program&&MR(this.gl,this.program),PR(this.gl)}executeProgram(){this.throwIfDisposed(),this.throwIfNoProgram();const e=this.gl;if(this.debug){this.getVertexArray();this.debugValidate()}TR(e,(()=>e.drawElements(e.TRIANGLES,6,e.UNSIGNED_SHORT,0)))}blockUntilAllProgramsCompleted(){this.throwIfDisposed(),TR(this.gl,(()=>this.gl.finish()))}getQueryTimerExtension(){return null==this.disjointQueryTimerExtension&&(this.disjointQueryTimerExtension=OR(this.gl,2===Sn().getNumber("WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_VERSION")?"EXT_disjoint_timer_query_webgl2":"EXT_disjoint_timer_query")),this.disjointQueryTimerExtension}getQueryTimerExtensionWebGL2(){return this.getQueryTimerExtension()}getQueryTimerExtensionWebGL1(){return this.getQueryTimerExtension()}beginQuery(){if(2===Sn().getNumber("WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_VERSION")){const e=this.gl,t=this.getQueryTimerExtensionWebGL2(),n=e.createQuery();return e.beginQuery(t.TIME_ELAPSED_EXT,n),n}const e=this.getQueryTimerExtensionWebGL1(),t=e.createQueryEXT();return e.beginQueryEXT(e.TIME_ELAPSED_EXT,t),t}endQuery(){if(2===Sn().getNumber("WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_VERSION")){const e=this.gl,t=this.getQueryTimerExtensionWebGL2();return void e.endQuery(t.TIME_ELAPSED_EXT)}const e=this.getQueryTimerExtensionWebGL1();e.endQueryEXT(e.TIME_ELAPSED_EXT)}async waitForQueryAndGetTime(e){return await Qt((()=>this.disposed||this.isQueryAvailable(e,Sn().getNumber("WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_VERSION")))),this.getQueryTime(e,Sn().getNumber("WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_VERSION"))}getQueryTime(e,t){if(0===t)return null;if(2===t){const t=this.gl;return t.getQueryParameter(e,t.QUERY_RESULT)/1e6}{const t=this.getQueryTimerExtensionWebGL1();return t.getQueryObjectEXT(e,t.QUERY_RESULT_EXT)/1e6}}isQueryAvailable(e,t){if(0===t)return!0;if(2===t){const t=this.gl,n=this.getQueryTimerExtensionWebGL2(),s=t.getQueryParameter(e,t.QUERY_RESULT_AVAILABLE);return null==this.disjoint&&(this.disjoint=this.gl.getParameter(n.GPU_DISJOINT_EXT)),s&&!this.disjoint}{const t=this.getQueryTimerExtensionWebGL1(),n=t.getQueryObjectEXT(e,t.QUERY_RESULT_AVAILABLE_EXT);return null==this.disjoint&&(this.disjoint=this.gl.getParameter(t.GPU_DISJOINT_EXT)),n&&!this.disjoint}}pollFence(e){return new Promise((t=>{this.addItemToPoll((()=>e.isFencePassed()),(()=>t()))}))}pollItems(){const e=function(e){let t=0;for(;te.isDoneFn)));for(let t=0;t<=e;++t){const{resolveFn:e}=this.itemsToPoll[t];e()}this.itemsToPoll=this.itemsToPoll.slice(e+1)}addItemToPoll(e,t){if(this.itemsToPoll.push({isDoneFn:e,resolveFn:t}),this.itemsToPoll.length>1)return;let n;"setTimeoutCustom"in Sn().platform&&(n=Sn().platform.setTimeoutCustom.bind(Sn().platform)),Qt((()=>(this.pollItems(),0===this.itemsToPoll.length)),(()=>0),null,n)}bindTextureToFrameBuffer(e){this.throwIfDisposed(),zR(this.gl,e,this.framebuffer),this.debug&&PR(this.gl)}unbindTextureToFrameBuffer(){null!=this.outputTexture?(zR(this.gl,this.outputTexture,this.framebuffer),this.debug&&PR(this.gl)):LR(this.gl,this.framebuffer)}downloadMatrixDriver(e,t){this.bindTextureToFrameBuffer(e);const n=t();return this.unbindTextureToFrameBuffer(),n}setOutputMatrixTextureDriver(e,t,n){this.throwIfDisposed();const s=this.gl;zR(s,e,this.framebuffer),this.debug&&PR(s),this.outputTexture=e,TR(s,(()=>s.viewport(0,0,t,n))),TR(s,(()=>s.scissor(0,0,t,n)))}setOutputMatrixWriteRegionDriver(e,t,n,s){this.throwIfDisposed(),TR(this.gl,(()=>this.gl.scissor(e,t,n,s)))}throwIfDisposed(){if(this.disposed)throw new Error("Attempted to use disposed GPGPUContext.")}throwIfNoProgram(){if(null==this.program)throw new Error("No GPU program is currently set.")}}const{addImpl:qD,bincountImpl:jD,bincountReduceImpl:HD,bitwiseAndImpl:$D,castImpl:KD,ceilImpl:XD,concatImpl:ZD,equalImpl:YD,expImpl:QD,expm1Impl:JD,floorImpl:eM,gatherNdImpl:tM,gatherV2Impl:nM,greaterImpl:sM,greaterEqualImpl:rM,lessImpl:aM,lessEqualImpl:iM,linSpaceImpl:oM,logImpl:lM,maxImpl:uM,maximumImpl:cM,minimumImpl:hM,multiplyImpl:dM,negImpl:pM,notEqualImpl:fM,prodImpl:mM,raggedGatherImpl:gM,raggedRangeImpl:yM,raggedTensorToTensorImpl:bM,rangeImpl:wM,rsqrtImpl:vM,scatterImpl:xM,sigmoidImpl:AM,simpleAbsImpl:kM,sliceImpl:CM,sparseFillEmptyRowsImpl:SM,sparseReshapeImpl:EM,sparseSegmentReductionImpl:_M,sqrtImpl:IM,staticRegexReplaceImpl:TM,stridedSliceImpl:NM,stringNGramsImpl:OM,stringSplitImpl:RM,stringToHashBucketFastImpl:DM,subImpl:MM,tileImpl:FM,topKImpl:BM,transposeImpl:zM,uniqueImpl:LM}=S;function PM(e,t){return["x","y","z","w","u","v"].slice(0,t).map((t=>`${e}.${t}`))}function VM(e,t){return 1===t?[e]:PM(e,t)}class WM{constructor(e){if(this.variableNames=["A"],this.packedInputs=!1,this.packedOutput=!0,this.outputShape=e,this.rank=e.length,this.enableShapeUniforms=SD(this.outputShape.length),0===this.rank)this.userCode="\n void main() {\n setOutput(vec4(getA(), 0., 0., 0.));\n }\n ";else{const e=VM("rc",this.rank),t=bD(this.rank),n=this.getOutOfBoundsCondition(e),s=this.getSetup(e),r=this.getOutput(e);this.userCode=`\n void main() {\n ${t} rc = getOutputCoords();\n\n if(${n}) {\n setOutput(vec4(0));\n } else {\n ${s}\n\n setOutput(vec4(${r}));\n }\n }\n `}}getSourceCoordsArr(e){const t=[];for(let n=0;n<=1;n++)for(let s=0;s<=1;s++){let r=`${0===n?"r":"rp1"}, ${0===s?"c":"cp1"}`;for(let t=2;t ${this.enableShapeUniforms?"outShape":this.outputShape[0]}`;let t="";for(let n=this.rank-2;n= ${this.enableShapeUniforms?`outShape[${n}]`:this.outputShape[n]}`,n= ${n};\n bool rEdge = rp1 >= ${s};\n `}getOutput(e){const t=this.getSourceCoordsArr(e);if(1===this.rank){return`getA(rc), (rc + 1 >= ${this.enableShapeUniforms?"outShape":this.outputShape[0]} ? 0. : getA(rc + 1)), 0, 0`}return`getA(${t[0]}),\n cEdge ? 0. : getA(${t[1]}),\n rEdge ? 0. : getA(${t[2]}),\n rEdge || cEdge ? 0. : getA(${t[3]})`}}class UM{constructor(e,t){this.variableNames=["A"],this.packedInputs=!0,this.packedOutput=!0,this.customUniforms=[{name:"inputShape",type:"ivec3"}],this.outputShape=e,this.enableShapeUniforms=SD(this.outputShape.length);let n="";for(let e=0;e<4;e++){let t="thisRC = rc;";e%2==1&&(t+="thisRC.z += 1;"),e>1&&(t+="thisRC.y += 1;"),n+=`\n ${t}\n ${e>0?"if(thisRC.y < rows && thisRC.z < cols){":""}\n int flatIndex = getFlatIndex(thisRC);\n\n ivec3 inputRC = inputCoordsFromReshapedOutCoords(flatIndex);\n vec2 inputRCInnerDims = vec2(float(inputRC.y),float(inputRC.z));\n\n result[${e}] =\n getChannel(getA(inputRC.x, inputRC.y, inputRC.z), inputRCInnerDims);\n ${e>0?"}":""}\n `}var s,r;this.userCode=`\n ${s=t,r=this.enableShapeUniforms,`\n ivec3 inputCoordsFromReshapedOutCoords(int index) {\n ${r?rD(["r","c","d"],"inputShape"):nD(["r","c","d"],s)}\n return ivec3(r, c, d);\n }\n `}\n ${this.enableShapeUniforms?"\n int getFlatIndex(ivec3 coords) {\n return coords.x * outShapeStrides[0] + coords.y * outShapeStrides[1] + coords.z;\n }\n":aD(e)}\n\n void main() {\n ivec3 rc = getOutputCoords();\n\n vec4 result = vec4(0.);\n\n ivec3 thisRC;\n int rows = ${this.enableShapeUniforms?"outShape[1]":e[1]};\n int cols = ${this.enableShapeUniforms?"outShape[2]":e[2]};\n\n ${n}\n\n setOutput(result);\n }\n `}}class GM{constructor(e){this.gpgpu=e,this.numUsedTextures=0,this.numFreeTextures=0,this._numBytesAllocated=0,this._numBytesFree=0,this.freeTextures={},this.usedTextures={},this.logEnabled=!1}acquireTexture(e,t,n){const s=jM(t,n),r=HM(e,s,n);r in this.freeTextures||(this.freeTextures[r]=[]),r in this.usedTextures||(this.usedTextures[r]=[]);const a=qM(e,s,this.gpgpu.gl,this.gpgpu.textureConfig,n);if(this.freeTextures[r].length>0){this.numFreeTextures--,this.numUsedTextures++,this._numBytesFree-=a,this.log();const e=this.freeTextures[r].pop();return this.usedTextures[r].push(e),e}let i;return s===CR.PACKED_2X2_FLOAT32?i=this.gpgpu.createPackedMatrixTexture(e[0],e[1]):s===CR.PACKED_2X2_FLOAT16?i=this.gpgpu.createFloat16PackedMatrixTexture(e[0],e[1]):s===CR.UNPACKED_FLOAT32?i=this.gpgpu.createFloat32MatrixTexture(e[0],e[1]):s===CR.UNPACKED_FLOAT16?i=this.gpgpu.createFloat16MatrixTexture(e[0],e[1]):s===CR.PACKED_4X1_UNSIGNED_BYTE&&(i=this.gpgpu.createUnsignedBytesMatrixTexture(e[0],e[1])),this.usedTextures[r].push(i),this.numUsedTextures++,this._numBytesAllocated+=a,this.log(),i}releaseTexture(e,t,n,s){if(null==this.freeTextures)return;const r=jM(n,s),a=HM(t,r,s);a in this.freeTextures||(this.freeTextures[a]=[]);const i=qM(t,r,this.gpgpu.gl,this.gpgpu.textureConfig,s),o=Sn().getNumber("WEBGL_DELETE_TEXTURE_THRESHOLD");-1!==o&&this._numBytesAllocated>o?(this.gpgpu.deleteMatrixTexture(e.texture),this._numBytesAllocated-=i):(this.freeTextures[a].push(e),this.numFreeTextures++,this._numBytesFree+=i),this.numUsedTextures--;const l=this.usedTextures[a],u=l&&l.indexOf(e);if(null==u||u<0)throw new Error("Cannot release a texture that was never provided by this texture manager");l[u]=l[l.length-1],l.pop(),this.log()}log(){if(!this.logEnabled)return;this.numFreeTextures,this.numUsedTextures,this._numBytesFree,this._numBytesAllocated}get numBytesAllocated(){return this._numBytesAllocated}get numBytesFree(){return this._numBytesFree}getNumUsedTextures(){return this.numUsedTextures}getNumFreeTextures(){return this.numFreeTextures}dispose(){if(null!=this.freeTextures){for(const e in this.freeTextures)this.freeTextures[e].forEach((e=>{this.gpgpu.deleteMatrixTexture(e.texture)}));for(const e in this.usedTextures)this.usedTextures[e].forEach((e=>{this.gpgpu.deleteMatrixTexture(e.texture)}));this.freeTextures=null,this.usedTextures=null,this.numUsedTextures=0,this.numFreeTextures=0,this._numBytesAllocated=0,this._numBytesFree=0}}}function qM(e,t,n,s,r){const a=function(e,t){switch(e){case CR.PACKED_2X2_FLOAT32:return VD(t);case CR.PACKED_2X2_FLOAT16:return WD(t);case CR.UNPACKED_FLOAT32:return zD(t);case CR.UNPACKED_FLOAT16:return LD(t);case CR.PACKED_4X1_UNSIGNED_BYTE:return PD(t);default:throw new Error(`Unknown physical texture type ${e}`)}}(t,s);let i;if(r){const[t,n]=_R(e[0],e[1]);i=t*n}else{const[t,n]=SR(e[0],e[1]);i=t*n}const o=function(e,t){const n=e;if(t===n.R32F)return 4;if(t===n.R16F)return 2;if(t===n.RGBA32F)return 16;if(t===e.RGBA)return 16;if(t===n.RGBA16F)return 8;if(t===n.RGBA8)return 4;throw new Error(`Unknown internal format ${t}`)}(n,a);return i*o}function jM(e,t){if(e===kR.UPLOAD)return CR.PACKED_2X2_FLOAT32;if(e===kR.RENDER||null==e)return function(e){return Sn().getBool("WEBGL_RENDER_FLOAT32_ENABLED")?e?CR.PACKED_2X2_FLOAT32:CR.UNPACKED_FLOAT32:e?CR.PACKED_2X2_FLOAT16:CR.UNPACKED_FLOAT16}(t);if(e===kR.DOWNLOAD||e===kR.PIXELS)return CR.PACKED_4X1_UNSIGNED_BYTE;throw new Error(`Unknown logical texture type ${e}`)}function HM(e,t,n){return`${e[0]}_${e[1]}_${t}_${n}`}class $M{constructor(e,t){this.variableNames=["A"],this.outputShape=e,this.enableShapeUniforms=SD(this.outputShape.length),this.userCode=`\n float unaryOperation(float x) {\n ${t}\n }\n\n void main() {\n float x = getAAtOutCoords();\n float y = unaryOperation(x);\n\n setOutput(y);\n }\n `}}const KM="if (isnan(x)) return x;",XM="return x;",ZM="return abs(x);";const YM="return (x >= 0.0) ? x : (exp(x) - 1.0);",QM=KM+"\n return (x < 0.0) ? 0.0 : x;\n",JM=KM+"\n return (x < 0.0) ? 0.0 : min(6.0, x);\n",eF="return x;",tF="return 1.0 / (1.0 + exp(-1.0 * x));",nF="return x;",sF="\n vec4 result;\n\n result.r = (x.r >= 0.0) ? x.r : (exp(x.r) - 1.0);\n result.g = (x.g >= 0.0) ? x.g : (exp(x.g) - 1.0);\n result.b = (x.b >= 0.0) ? x.b : (exp(x.b) - 1.0);\n result.a = (x.a >= 0.0) ? x.a : (exp(x.a) - 1.0);\n\n return result;\n",rF="\n vec4 result = x * vec4(greaterThanEqual(x, vec4(0.0)));\n bvec4 isNaN = isnan(x);\n\n result.r = isNaN.r ? x.r : result.r;\n result.g = isNaN.g ? x.g : result.g;\n result.b = isNaN.b ? x.b : result.b;\n result.a = isNaN.a ? x.a : result.a;\n\n return result;\n",aF="\n vec4 result = min(x, vec4(6.)) * vec4(greaterThanEqual(x, vec4(0.0)));\n bvec4 isNaN = isnan(x);\n\n result.r = isNaN.r ? x.r : result.r;\n result.g = isNaN.g ? x.g : result.g;\n result.b = isNaN.b ? x.b : result.b;\n result.a = isNaN.a ? x.a : result.a;\n\n return result;\n",iF="return 1.0 / (1.0 + exp(-1.0 * x));";class oF{constructor(e,t){this.variableNames=["A"],this.packedInputs=!0,this.packedOutput=!0,this.outputShape=e,this.enableShapeUniforms=SD(this.outputShape.length),this.userCode=`\n vec4 unaryOperation(vec4 x) {\n ${t}\n }\n\n void main() {\n vec4 x = getAAtOutCoords();\n vec4 y = unaryOperation(x);\n\n setOutput(y);\n }\n `}}class lF{constructor(e){this.variableNames=["A"],this.packedInputs=!0,this.packedOutput=!1,this.outputShape=e,this.enableShapeUniforms=SD(this.outputShape.length);const t=e.length,n=VM("rc",t),s=bD(t),r=function(e,t){if(1===e)return"rc";let n="";for(let s=0;st.push(e)))}const t=this.texData.get(e),{values:n,shape:s,slice:r,dtype:a,complexTensorInfos:i,isPacked:o}=t;if(null!=r){let t;t=o?new oF(s,eF):new $M(s,eF);const n=this.runWebGLProgram(t,[{dataId:e,shape:s,dtype:a}],a),r=this.read(n.dataId);return this.disposeIntermediateTensorInfo(n),r}if(null!=n)return this.convertAndCacheOnCPU(e);if(Sn().getBool("DEBUG")&&!Sn().getBool("WEBGL_DOWNLOAD_FLOAT_ENABLED")&&2===Sn().getNumber("WEBGL_VERSION"))throw new Error("tensor.data() with WEBGL_DOWNLOAD_FLOAT_ENABLED=false and WEBGL_VERSION=2 not yet supported.");let l,u,c=null;if("complex64"!==a&&Sn().get("WEBGL_BUFFER_SUPPORTED")){l=this.decode(e);const t=this.texData.get(l.dataId);c=this.gpgpu.createBufferFromTexture(t.texture.texture,...ER(s))}if(this.pendingRead.set(e,[]),"complex64"!==a&&await this.gpgpu.createAndWaitForFence(),"complex64"===a){const e=await Promise.all([this.read(i.real.dataId),this.read(i.imag.dataId)]);u=Zm(e[0],e[1])}else if(null==c)u=this.getValuesFromTexture(e);else{const e=$t(s);u=this.gpgpu.downloadFloat32MatrixFromBuffer(c,e)}if(null!=l&&this.disposeIntermediateTensorInfo(l),null!=c){const e=this.gpgpu.gl;TR(e,(()=>e.deleteBuffer(c)))}const h=this.convertAndCacheOnCPU(e,u),d=this.pendingRead.get(e);return this.pendingRead.delete(e),d.forEach((e=>e(h))),this.pendingDisposal.has(e)&&(this.pendingDisposal.delete(e),this.disposeData(e)&&vo().removeDataId(e,this),this.pendingDeletes--),h}readToGPU(e,t={}){const n=this.texData.get(e),{values:s,shape:r,slice:a,dtype:i,isPacked:o,texture:l}=n;if("complex64"===i)throw new Error("Does not support reading texture for complex64 dtype.");if(null!=a){let n;n=o?new oF(r,eF):new $M(r,eF);const s=this.runWebGLProgram(n,[{dataId:e,shape:r,dtype:i}],i),a=this.readToGPU(s,t);return this.disposeIntermediateTensorInfo(s),a}if(null==l)throw null!=s?new Error("Data is not on GPU but on CPU."):new Error("There is no data on GPU or CPU.");const u=this.decode(e,t.customTexShape),c=vo().makeTensorFromTensorInfo(u),h=this.texData.get(u.dataId);return Object.assign({tensorRef:c},h.texture)}bufferSync(e){const t=this.readSync(e.dataId);if("string"===e.dtype)try{const n=t.map((e=>gi(e)));return Tl(e.shape,e.dtype,n)}catch(e){throw new Error("Failed to decode encoded string bytes into utf-8")}return Tl(e.shape,e.dtype,t)}checkNumericalProblems(e){if(null!=e)for(let t=0;t0}time(e){const t=this.activeTimers,n=[];let s=!1;null==this.programTimersStack?(this.programTimersStack=n,s=!0):this.activeTimers.push(n),this.activeTimers=n,e();const r=bi(this.activeTimers.map((e=>e.query))).filter((e=>null!=e)),a=bi(this.activeTimers.map((e=>e.name))).filter((e=>null!=e));this.activeTimers=t,s&&(this.programTimersStack=null);const i={uploadWaitMs:this.uploadWaitMs,downloadWaitMs:this.downloadWaitMs,kernelMs:null,wallMs:null};return(async()=>{if(Sn().getNumber("WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_RELIABLE")>0){const e=await Promise.all(r);i.kernelMs=function(e){let t=0;for(let n=0;ne.map(((e,t)=>({name:a[t],ms:e}))).map((e=>`${e.name}: ${e.ms}`)).join(", ")}else i.kernelMs={error:"WebGL query timers are not supported in this environment."};return this.uploadWaitMs=0,this.downloadWaitMs=0,i})()}memory(){return{unreliable:!1,numBytesInGPU:this.numBytesInGPU,numBytesInGPUAllocated:this.textureManager.numBytesAllocated,numBytesInGPUFree:this.textureManager.numBytesFree}}startTimer(){return Sn().getNumber("WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_RELIABLE")>0?this.gpgpu.beginQuery():{startMs:fi(),endMs:null}}endTimer(e){return Sn().getNumber("WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_RELIABLE")>0?(this.gpgpu.endQuery(),e):(e.endMs=fi(),e)}async getQueryTime(e){if(Sn().getNumber("WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_RELIABLE")>0)return this.gpgpu.waitForQueryAndGetTime(e);const t=e;return t.endMs-t.startMs}disposeData(e,t=!1){if(this.pendingDisposal.has(e))return!1;if(!this.texData.has(e))return!0;if(t?this.texData.get(e).refCount=0:this.texData.get(e).refCount--,!t&&this.texData.get(e).refCount>0)return!1;if(this.pendingRead.has(e))return this.pendingDisposal.add(e),this.pendingDeletes++,!1;this.releaseGPUData(e);const{complexTensorInfos:n}=this.texData.get(e);return null!=n&&(this.disposeData(n.real.dataId,t),this.disposeData(n.imag.dataId,t)),this.texData.delete(e),!0}releaseGPUData(e){const{texture:t,dtype:n,texShape:s,usage:r,isPacked:a,slice:i}=this.texData.get(e),o=i&&i.origDataId||e,l=this.dataRefCount.get(o);l>1?this.dataRefCount.set(o,l-1):(this.dataRefCount.delete(o),null!=t&&(this.numBytesInGPU-=this.computeBytes(s,n),this.textureManager.releaseTexture(t,s,r,a)));const u=this.texData.get(e);u.texture=null,u.texShape=null,u.isPacked=!1,u.slice=null}getTexture(e){return this.uploadToGPU(e),this.texData.get(e).texture.texture}getDataInfo(e){return this.texData.get(e)}shouldExecuteOnCPU(e,t=hF){return Sn().getBool("WEBGL_CPU_FORWARD")&&e.every((e=>null==this.texData.get(e.dataId).texture&&$t(e.shape)0&&on(n[0])){const r=n.map((e=>mi(e)));s=this.write(r,e,t)}else s=this.write(n,e,t);return this.texData.get(s).usage=null,{dataId:s,shape:e,dtype:t}}makeOutput(e,t,n){return vo().makeTensorFromTensorInfo(this.makeTensorInfo(e,t,n),this)}unpackTensor(e){const t=new lF(e.shape);return this.runWebGLProgram(t,[e],e.dtype)}packTensor(e){const t=new WM(e.shape);return this.runWebGLProgram(t,[e],e.dtype,null,!0)}packedReshape(e,t){const n=[UR(e.shape),...GR(e.shape)],s={dtype:e.dtype,shape:n,dataId:e.dataId},r=[UR(t),...GR(t)],a=new UM(r,n),i=[n],o=this.runWebGLProgram(a,[s],e.dtype,i,!0);return{dataId:o.dataId,shape:t,dtype:o.dtype}}decode(e,t){const n=this.texData.get(e),{isPacked:s,shape:r,dtype:a}=n;if(null!=t){qt($t(r)<=t[0]*t[1]*4,(()=>"customTexShape is too small. Row * Column * 4 should be equal or larger than the size of the tensor data."))}const i=qR(r);let o;o=s?new _D(i):new ED(i);const l=[null!=t?t:ER(i)];return{dtype:a,shape:r,dataId:this.runWebGLProgram(o,[{shape:i,dtype:a,dataId:e}],a,l,!0,t).dataId}}runWebGLProgram(e,t,n,s,r=!1,a){const i=this.makeTensorInfo(e.outputShape,n),o=this.texData.get(i.dataId);if(e.packedOutput&&(o.isPacked=!0),e.outPackingScheme===AR.DENSE){const t=null!=a?a:ER(e.outputShape);o.texShape=t.map((e=>2*e))}if(null!=e.outTexUsage&&(o.usage=e.outTexUsage),0===$t(i.shape))return o.values=nn(i.dtype,0),i;const l=[],u=t.map((t=>{if("complex64"===t.dtype)throw new Error("GPGPUProgram does not support complex64 input. For complex64 dtypes, please separate the program into real and imaginary parts.");let n=this.texData.get(t.dataId);if(null==n.texture){if(!e.packedInputs&&$t(t.shape)<=Sn().getNumber("WEBGL_SIZE_UPLOAD_UNIFORM"))return{shape:t.shape,texData:null,isUniform:!0,uniformValues:n.values};e.packedInputs&&(n.isPacked=!0,n.shape=t.shape)}if(this.uploadToGPU(t.dataId),!!n.isPacked!=!!e.packedInputs)t=n.isPacked?this.unpackTensor(t):this.packTensor(t),l.push(t),n=this.texData.get(t.dataId);else if(n.isPacked&&!HR(n.shape,t.shape)){const e=t,s=t.shape;t.shape=n.shape,t=this.packedReshape(t,s),l.push(t),n=this.texData.get(t.dataId),e.shape=s}return{shape:t.shape,texData:n,isUniform:!1}}));this.uploadToGPU(i.dataId);const c={shape:i.shape,texData:o,isUniform:!1},h=function(e,t,n){let s="";t.concat(n).forEach((t=>{const r=null!=t.texData&&null!=t.texData.slice&&t.texData.slice.flatOffset>0;if(e.enableShapeUniforms&&!t.isUniform){const a=t.texData.texShape,{useSqueezeShape:i,uniformShape:o,keptDims:l}=wD(e.packedInputs,t.shape,a);let u="",c="",h="";if(1===o.length&&e.packedInputs){const e=[Math.ceil(a[0]/2),Math.ceil(a[1]/2)];u=`${e[0]>1}_${e[1]>1}`}else if(2!==o.length||e.packedInputs){if(o.length>2&&!e.packedInputs){const e=dn(o);h=`${e[0]===a[1]}_${e[e.length-1]===a[1]}`}}else c=`${o[0]>1}_${o[1]>1}`;const d=t.shape.length,p=2===o.length&&Kt(t.shape,a),f=1===$t(t.shape),m=tu(t.shape,n.shape),g=!e.packedInputs&&d===n.shape.length&&Kt(a,n.texData.texShape),y=e.packedInputs||o.length>2?"":`${a[0]>1}_${a[1]>1}`;s+=`${d}_${g}_${i?l:""}_${o.length}_${f}_${m}_${p}_${u}_${c}_${h}_${y}_${r}`}else{const e=t.isUniform?"uniform":t.texData.texShape;s+=`${t.shape}_${e}_${r}`}}));const r=e.userCode;let a=e.constructor.name;return a+="_"+s+"_"+r+`${Sn().getNumber("WEBGL_VERSION")}`,a}(e,u,c),d=this.getAndSaveBinary(h,(()=>AD(this.gpgpu,e,u,c))),p=null!=this.activeTimers;let f;p&&(f=this.startTimer()),Sn().get("ENGINE_COMPILE_ONLY")||function(e,t,n,s,r){t.program.enableShapeUniforms||(CD(t.inShapeInfos,n),CD([t.outShapeInfo],[s]));const a=s.texData.texture,i=s.texData.texShape;s.texData.isPacked?e.setOutputPackedMatrixTexture(a.texture,i[0],i[1]):e.setOutputMatrixTexture(a.texture,i[0],i[1]),e.setProgram(t.webGLProgram),e.bindVertexArray(t.webGLProgram.vao),1===Sn().getNumber("WEBGL_VERSION")&&null!==t.infLoc&&e.gl.uniform1f(t.infLoc,1/0),null!==t.nanLoc&&e.gl.uniform1f(t.nanLoc,NaN);for(let s=0;sthis.disposeIntermediateTensorInfo(e))),p&&(f=this.endTimer(f),this.activeTimers.push({name:e.constructor.name,query:this.getQueryTime(f)}));const m=Sn().getNumber("WEBGL_FLUSH_THRESHOLD");if(m>0){const e=fi();e-this.lastGlFlushTime>m&&(this.gpgpu.gl.flush(),this.lastGlFlushTime=e)}if(!Sn().getBool("WEBGL_LAZILY_UNPACK")&&o.isPacked&&!1===r){const e=this.unpackTensor(i);return this.disposeIntermediateTensorInfo(i),e}return i}compileAndRun(e,t,n,s,r=!1){n=n||t[0].dtype;return this.runWebGLProgram(e,t,n,s,r)}getAndSaveBinary(e,t){return e in this.binaryCache||(this.binaryCache[e]=t()),this.binaryCache[e]}getTextureManager(){return this.textureManager}dispose(){if(!this.disposed){if(!Sn().getBool("IS_TEST")){Object.keys(this.binaryCache).forEach((e=>{this.gpgpu.deleteProgram(this.binaryCache[e].webGLProgram),delete this.binaryCache[e]}))}this.textureManager.dispose(),null!=this.canvas&&"undefined"!=typeof HTMLCanvasElement&&this.canvas instanceof HTMLCanvasElement?this.canvas.remove():this.canvas=null,this.gpgpuCreatedLocally&&(this.gpgpu.program=null,this.gpgpu.dispose()),this.disposed=!0}}floatPrecision(){return null==this.floatPrecisionValue&&(this.floatPrecisionValue=Ao((()=>{if(!Sn().get("WEBGL_RENDER_FLOAT32_ENABLED")){const e=Sn().getBool("DEBUG");Sn().set("DEBUG",!1);const t=this.abs(Wl(1e-8)).dataSync()[0];if(Sn().set("DEBUG",e),t>0)return 32}return 16}))),this.floatPrecisionValue}epsilon(){return 32===this.floatPrecision()?1e-7:1e-4}uploadToGPU(e){const t=this.texData.get(e),{shape:n,dtype:s,values:r,texture:a,usage:i,isPacked:o}=t;if(null!=a)return;const l=null!=this.activeTimers;let u;l&&(u=fi());let c=t.texShape;if(null==c&&(c=function(e,t=!1){let n=Sn().getNumber("WEBGL_MAX_TEXTURE_SIZE"),s=Sn().getNumber("WEBGL_MAX_SIZE_FOR_NARROW_TEXTURE");if(s===1/0&&Sn().getBool("WEBGL_AUTO_SQUARIFY_NARROW_TEXTURE_SHAPE")&&(s=n/2),t&&(n*=2,s*=2,1===(e=e.map(((t,n)=>n>=e.length-2?Ut(e[n]):e[n]))).length&&(e=[2,e[0]])),2!==e.length){const t=tn(e);e=t.newShape}let r=$t(e),a=null;e.length<=1&&r<=n?a=[1,r]:2===e.length&&e[0]<=n&&e[1]<=n?a=e:3===e.length&&e[0]*e[1]<=n&&e[2]<=n?a=[e[0]*e[1],e[2]]:3===e.length&&e[0]<=n&&e[1]*e[2]<=n?a=[e[0],e[1]*e[2]]:4===e.length&&e[0]*e[1]*e[2]<=n&&e[3]<=n?a=[e[0]*e[1]*e[2],e[3]]:4===e.length&&e[0]<=n&&e[1]*e[2]*e[3]<=n&&(a=[e[0],e[1]*e[2]*e[3]]);const i=null!=a&&Math.max(...a)>s&&Math.min(...a)<=(t?2:1)&&Math.min(...a)>0;if(null==a||i)if(t){const t=UR(e);let n=2,s=2;e.length&&([n,s]=GR(e)),r=t*(n/2)*(s/2),a=Zt(r).map((e=>2*e))}else a=Zt(r);return a}(n,o),t.texShape=c),null!=r){const e=qR(n);let a,i=c[1],h=c[0];const d=r instanceof Uint8Array||r instanceof Uint8ClampedArray;!o&&d||([i,h]=_R(c[0],c[1])),a=o?new RD(e,d):new OD(e,d);const p=d?[h,i]:c,f=this.makeTensorInfo(p,s),m=this.texData.get(f.dataId);m.usage=d?kR.PIXELS:kR.UPLOAD,m.texShape=p,this.gpgpu.uploadDenseMatrixToTexture(this.getTexture(f.dataId),i,h,r);const g=[[h,i]],y=!0,b=this.runWebGLProgram(a,[f],s,g,y),w=this.texData.get(b.dataId);t.texShape=w.texShape,t.isPacked=w.isPacked,t.usage=w.usage,Sn().get("ENGINE_COMPILE_ONLY")?this.disposeData(b.dataId):(t.texture=w.texture,t.values=null,this.texData.delete(b.dataId)),this.disposeIntermediateTensorInfo(f),l&&(this.uploadWaitMs+=fi()-u)}else{const e=this.acquireTexture(c,i,s,o);t.texture=e}}convertAndCacheOnCPU(e,t){const n=this.texData.get(e),{dtype:s}=n;return null!=t&&(n.values=function(e,t){if("float32"===t||"complex64"===t)return e;if("int32"===t||"bool"===t){const n="int32"===t?new Int32Array(e.length):new Uint8Array(e.length);for(let t=0;t1024*this.numMBBeforeWarning*1024){(this.numBytesInGPU/1024/1024).toFixed(2);this.warnedAboutMemory=!0}return this.textureManager.acquireTexture(e,t,s)}computeBytes(e,t){return e[0]*e[1]*an(t)}checkCompileCompletion(){for(const[,e]of Object.entries(this.binaryCache))this.checkCompletion_(e)}async checkCompileCompletionAsync(){const e=[];if(this.gpgpu.parallelCompilationExtension){for(const[,t]of Object.entries(this.binaryCache))e.push(this.checkCompletionAsync_(t));return Promise.all(e)}for(const[,t]of Object.entries(this.binaryCache)){const n=new Promise((e=>{try{this.checkCompletion_(t),e(!0)}catch(e){throw e}}));e.push(n)}return Promise.all(e)}async checkCompletionAsync_(e){return this.gpgpu.gl.getProgramParameter(e.webGLProgram,this.gpgpu.parallelCompilationExtension.COMPLETION_STATUS_KHR)?this.checkCompletion_(e):(await Sm(),this.checkCompletionAsync_(e))}checkCompletion_(e){if(!1===this.gpgpu.gl.getProgramParameter(e.webGLProgram,this.gpgpu.gl.LINK_STATUS)){if(!1===this.gpgpu.gl.getShaderParameter(e.fragmentShader,this.gpgpu.gl.COMPILE_STATUS))throw DR(e.source,this.gpgpu.gl.getShaderInfoLog(e.fragmentShader)),new Error("Failed to compile fragment shader.");throw new Error("Failed to link vertex and fragment shaders.")}return!0}getUniformLocations(){for(const e of Object.values(this.binaryCache)){this.gpgpu.buildVao(e.webGLProgram);const{variablesLocations:t,customUniformLocations:n,infLoc:s,nanLoc:r,outShapeLocation:a,outShapeStridesLocation:i,outTexShapeLocation:o}=kD(this.gpgpu,e.program,e.webGLProgram);e.variablesLocations=t,e.customUniformLocations=n,e.infLoc=s,e.nanLoc=r,e.outShapeLocation=a,e.outShapeStridesLocation=i,e.outTexShapeLocation=o}}createTensorFromGPUData(e,t,n){e.channels=e.channels||"RGBA";const{texture:s,height:r,width:a,channels:i}=e,o=vo().backend;if(!o.gpgpu.gl.isTexture(s))throw new Error("The texture is invalid. Also, please make sure the texture and the TFJS WebGL backend are using the same canvas. If you want to use your own custom canvas, you have to create and use the custom TFJS WebGL backend created from the canvas through 'new tf.MathBackendWebGL(customCanvas)'.");const l=o.writeTexture(s,t,n,r,a,i);return vo().makeTensorFromDataId(l,t,n,o)}}dF.nextDataId=0;ao()&&So("webgl",(()=>new dF),2);const pF="\n if (isnan(a)) return a;\n if (isnan(b)) return b;\n";class fF{constructor(e,t,n){this.variableNames=["A","B"],this.outputShape=su(t,n),this.enableShapeUniforms=SD(this.outputShape.length),this.userCode=`\n float binaryOperation(float a, float b) {\n ${e}\n }\n\n void main() {\n float a = getAAtOutCoords();\n float b = getBAtOutCoords();\n setOutput(binaryOperation(a, b));\n }\n `}}const mF="\n result.r = isNaN.r ? NAN : result.r;\n result.g = isNaN.g ? NAN : result.g;\n result.b = isNaN.b ? NAN : result.b;\n result.a = isNaN.a ? NAN : result.a;\n";class gF{constructor(e,t,n,s=!1){this.variableNames=["A","B"],this.supportsBroadcasting=!0,this.packedInputs=!0,this.packedOutput=!0,this.outputShape=su(t,n);const r=this.outputShape.length;this.enableShapeUniforms=SD(r);let a="";if(s)if(0===r||1===$t(this.outputShape))a="\n result.y = 0.;\n result.z = 0.;\n result.w = 0.;\n ";else{if(a=`\n ${bD(r)} coords = getOutputCoords();\n `,1===r)this.enableShapeUniforms?a+="\n result.y = (coords + 1) >= outShape ? 0. : result.y;\n result.z = 0.;\n result.w = 0.;\n ":a+=`\n result.y = (coords + 1) >= ${this.outputShape[0]} ? 0. : result.y;\n result.z = 0.;\n result.w = 0.;\n `;else{const e=VM("coords",r);this.enableShapeUniforms?a+=`\n bool nextRowOutOfBounds =\n (${e[r-2]} + 1) >= outShape[${r} - 2];\n bool nextColOutOfBounds =\n (${e[r-1]} + 1) >= outShape[${r} - 1];\n result.y = nextColOutOfBounds ? 0. : result.y;\n result.z = nextRowOutOfBounds ? 0. : result.z;\n result.w = nextColOutOfBounds || nextRowOutOfBounds ? 0. : result.w;\n `:a+=`\n bool nextRowOutOfBounds =\n (${e[r-2]} + 1) >= ${this.outputShape[r-2]};\n bool nextColOutOfBounds =\n (${e[r-1]} + 1) >= ${this.outputShape[r-1]};\n result.y = nextColOutOfBounds ? 0. : result.y;\n result.z = nextRowOutOfBounds ? 0. : result.z;\n result.w = nextColOutOfBounds || nextRowOutOfBounds ? 0. : result.w;\n `}}this.userCode=`\n vec4 binaryOperation(vec4 a, vec4 b) {\n ${e}\n }\n\n void main() {\n vec4 a = getAAtOutCoords();\n vec4 b = getBAtOutCoords();\n\n vec4 result = binaryOperation(a, b);\n ${a}\n\n setOutput(result);\n }\n `}}function yF(e){const{inputs:t,backend:n}=e,{x:s}=t;return n.incRef(s.dataId),{dataId:s.dataId,shape:s.shape,dtype:s.dtype}}const bF={kernelName:js,backendName:"webgl",kernelFunc:yF};function wF(e){const{inputs:t,backend:n}=e,{real:s,imag:r}=t,a=n.makeTensorInfo(s.shape,"complex64"),i=n.texData.get(a.dataId),o=yF({inputs:{x:s},backend:n}),l=yF({inputs:{x:r},backend:n});return i.complexTensorInfos={real:o,imag:l},a}const vF={kernelName:ns,backendName:"webgl",kernelFunc:wF},xF="return (a < 0.) ? b * a : a;",AF="\n vec4 aLessThanZero = vec4(lessThan(a, vec4(0.)));\n return (aLessThanZero * (b * a)) + ((vec4(1.0) - aLessThanZero) * a);\n";const kF={kernelName:Ys,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:n,attrs:s}=e,{x:r}=t,{alpha:a}=s,i=n.makeTensorInfo([],"float32",di(a,"float32")),o=Sn().getBool("WEBGL_PACK_BINARY_OPERATIONS")?new gF(AF,r.shape,i.shape):new fF(xF,r.shape,i.shape),l=n.runWebGLProgram(o,[r,i],"float32");return n.disposeIntermediateTensorInfo(i),l}},CF="return (a < 0.) ? b * a : a;",SF="\n vec4 aLessThanZero = vec4(lessThan(a, vec4(0.)));\n return (aLessThanZero * (b * a)) + ((vec4(1.0) - aLessThanZero) * a);\n";const EF={kernelName:Rr,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:n}=e,{x:s,alpha:r}=t,a=Sn().getBool("WEBGL_PACK_BINARY_OPERATIONS")?new gF(SF,s.shape,r.shape):new fF(CF,s.shape,r.shape);return n.runWebGLProgram(a,[s,r],"float32")}},_F="if (isnan(x)) return x;";function IF({opSnippet:e,packedOpSnippet:t,cpuKernelImpl:n,dtype:s}){return({inputs:r,backend:a})=>{const{x:i}=r,o=a,l=s||i.dtype;if(o.shouldExecuteOnCPU([i])&&null!=n){const e=o.texData.get(i.dataId),t=n(e.values,l);return o.makeTensorInfo(i.shape,l,t)}let u;return u=Sn().getBool("WEBGL_PACK_UNARY_OPERATIONS")&&null!=t?new oF(i.shape,t):new $M(i.shape,e),o.runWebGLProgram(u,[i],l)}}function TF({opSnippet:e,packedOpSnippet:t,checkOutOfBounds:n=!1,supportsComplex:s=!1,cpuKernelImpl:r,dtype:a}){return({inputs:i,backend:o})=>{const{a:l,b:u}=i,c=o;if(s&&"complex64"===l.dtype){const t=c.texData.get(l.dataId),n=c.texData.get(u.dataId),[s,r]=[[t.complexTensorInfos.real,n.complexTensorInfos.real],[t.complexTensorInfos.imag,n.complexTensorInfos.imag]].map((t=>{const[n,s]=t,r={dataId:n.dataId,dtype:n.dtype,shape:l.shape},a={dataId:s.dataId,dtype:s.dtype,shape:u.shape},i=new fF(e,l.shape,u.shape);return c.runWebGLProgram(i,[r,a],Gi(n.dtype,s.dtype))})),a=wF({inputs:{real:s,imag:r},backend:c});return c.disposeIntermediateTensorInfo(s),c.disposeIntermediateTensorInfo(r),a}const h=a||Gi(l.dtype,u.dtype);if(("string"===l.dtype||"string"===u.dtype||c.shouldExecuteOnCPU([l,u]))&&null!=r){const e=c.texData.get(l.dataId).values,t=c.texData.get(u.dataId).values,n="string"===l.dtype?Ng(e):e,s="string"===l.dtype?Ng(t):t,[a,i]=r(l.shape,u.shape,n,s,h),o=c.makeTensorInfo(i,h);return c.texData.get(o.dataId).values=a,o}let d;return d=Sn().getBool("WEBGL_PACK_BINARY_OPERATIONS")&&null!=t?new gF(t,l.shape,u.shape,n):new fF(e,l.shape,u.shape),c.runWebGLProgram(d,[l,u],h)}}function NF(e,t=!1){if("linear"===e)return t?nF:XM;if("relu"===e)return t?rF:QM;if("elu"===e)return t?sF:YM;if("relu6"===e)return t?aF:JM;if("prelu"===e)return t?SF:CF;if("leakyrelu"===e)return t?AF:xF;if("sigmoid"===e)return t?iF:tF;throw new Error(`Activation ${e} has not been implemented for the WebGL backend.`)}class OF{constructor(e,t,n,s=!1,r=!1,a=!1,i=null,o=!1,l=!1){this.variableNames=["matrixA","matrixB"],this.packedInputs=!0,this.packedOutput=!0,this.outputShape=n,this.enableShapeUniforms=SD(this.outputShape.length);const u=s?e[1]:e[2],c=Math.ceil(u/2),h=s?"i * 2, rc.y":"rc.y, i * 2",d=r?"rc.z, i * 2":"i * 2, rc.z",p=s?["a.xxyy","a.zzww"]:["a.xxzz","a.yyww"],f=r?["b.xzxz","b.ywyw"]:["b.xyxy","b.zwzw"];let m="",g="";i&&(m=o?`vec4 activation(vec4 a) {\n vec4 b = getPreluActivationWeightsAtOutCoords();\n ${i}\n }`:l?`vec4 activation(vec4 a) {\n vec4 b = getLeakyreluAlphaAtOutCoords();\n ${i}\n }`:`vec4 activation(vec4 x) {\n ${i}\n }`,g="result = activation(result);");const y=a?"result += getBiasAtOutCoords();":"";a&&this.variableNames.push("bias"),o&&this.variableNames.push("preluActivationWeights"),l&&this.variableNames.push("leakyreluAlpha");let b="rc.x",w="rc.x";e[0]`The new shape (${l}) has ${u} elements and the old shape (${r.shape}) has ${o} elements. The new shape and old shape must have the same number of elements.`));const c=i.texData.get(r.dataId);return!c.isPacked||HR(r.shape,l)||null!==c.texture&&HR(c.shape,l)?(i.incRef(r.dataId),{dataId:r.dataId,shape:l,dtype:r.dtype}):function(e,t,n){const s=[UR(e.shape),...GR(e.shape)],r={dtype:e.dtype,shape:s,dataId:e.dataId},a=[UR(t),...GR(t)],i=new UM(a,s),o=[s],l=n.runWebGLProgram(i,[r],e.dtype,o,!0);return{dataId:l.dataId,shape:t,dtype:l.dtype}}(r,l,i)}const LF={kernelName:Wr,backendName:"webgl",kernelFunc:zF};class PF{constructor(e,t){this.variableNames=["x"];const{windowSize:n,batchSize:s,inSize:r,outSize:a}=e;this.outputShape=[s,a];const i=4*Math.floor(n/4),o=n%4;let l="sumValue += dot(values, ones);";if(null!=t){const e=1/t;l=`sumValue += dot(values * ${Xt(e)?e.toPrecision(2):e}, ones);`}let u="";r%n>0&&(u=`\n if (inIdx < 0 || inIdx >= ${r}) {\n return 0.0;\n }\n `),this.userCode=`\n const vec4 ones = vec4(1.0, 1.0, 1.0, 1.0);\n\n float getValue(int batch, int inIdx) {\n ${u}\n return getX(batch, inIdx);\n }\n\n void main() {\n ivec2 coords = getOutputCoords();\n int batch = coords[0];\n int outIdx = coords[1];\n int inOffset = outIdx * ${n};\n\n float sumValue = 0.0;\n\n for (int i = 0; i < ${i}; i += 4) {\n int inIdx = inOffset + i;\n vec4 values = vec4(\n getValue(batch, inIdx),\n getValue(batch, inIdx + 1),\n getValue(batch, inIdx + 2),\n getValue(batch, inIdx + 3)\n );\n\n ${l}\n }\n\n int inIdx = inOffset + ${i};\n if (${1===o}) {\n vec4 values = vec4(getValue(batch, inIdx), 0.0, 0.0, 0.0);\n\n ${l}\n } else if (${2===o}) {\n vec4 values = vec4(\n getValue(batch, inIdx),\n getValue(batch, inIdx + 1), 0.0, 0.0);\n\n ${l}\n } else if (${3===o}) {\n vec4 values = vec4(\n getValue(batch, inIdx),\n getValue(batch, inIdx + 1),\n getValue(batch, inIdx + 2), 0.0);\n\n ${l}\n }\n setOutput(sumValue);\n }\n `}}class VF{constructor(e,t){this.variableNames=["x"];const{windowSize:n,batchSize:s,inSize:r,outSize:a}=e;this.outputShape=[s,a];let i="0.0",o="";"prod"===t?i="1.0":"min"===t?(i="1.0 / 1e-20",o="min"):"max"===t&&(i="-1.0 / 1e-20",o="max");let l=`${t}(${t}(${t}(minMaxValue[0], minMaxValue[1]), minMaxValue[2]), minMaxValue[3])`;"sum"===t?l="sumValue":"prod"===t?l="prodValue":"all"===t?l="allValue":"any"===t&&(l="anyValue");const u=4*Math.floor(n/4),c=n%4;let h=`\n if (${"sum"===t}) {\n sumValue += dot(values, ones);\n } else if (${"prod"===t}) {\n vec2 tmp = vec2(values[0], values[1]) * vec2(values[2], values[3]);\n prodValue *= tmp[0] * tmp[1];\n } else {\n minMaxValue = ${o}(values, minMaxValue);\n if (${"min"===t} || ${"max"===t}) {\n minMaxValue = ${o}(values, minMaxValue);\n bvec4 isNaN = isnan(values);\n if (isNaN.r || isNaN.g || isNaN.b || isNaN.a) {\n minMaxValue = vec4(NAN);\n }\n }\n }\n `,d="vec4";"all"===t?(i="1.0",h="\n bool reducedAllValue = all(values);\n float floatedReducedAllValue = float(reducedAllValue);\n allValue = float(allValue >= 1.0 && floatedReducedAllValue >= 1.0);\n ",d="bvec4"):"any"===t&&(i="0.0",h="\n bool reducedAnyValue = any(values);\n float floatedReducedAnyValue = float(reducedAnyValue);\n anyValue = float(anyValue >= 1.0 || floatedReducedAnyValue >= 1.0);\n ",d="bvec4");let p="";r%n>0&&(p=`\n if (inIdx < 0 || inIdx >= ${r}) {\n return initializationValue;\n }\n `),this.userCode=`\n const float initializationValue = ${i};\n const vec4 ones = vec4(1.0, 1.0, 1.0, 1.0);\n\n float getValue(int batch, int inIdx) {\n ${p}\n return getX(batch, inIdx);\n }\n\n void main() {\n ivec2 coords = getOutputCoords();\n int batch = coords[0];\n int outIdx = coords[1];\n int inOffset = outIdx * ${n};\n\n vec4 minMaxValue = vec4(${i});\n float prodValue = 1.0;\n float sumValue = 0.0;\n float allValue = 1.0;\n float anyValue = 0.0;\n\n for (int i = 0; i < ${u}; i += 4) {\n int inIdx = inOffset + i;\n ${d} values = ${d}(\n getValue(batch, inIdx),\n getValue(batch, inIdx + 1),\n getValue(batch, inIdx + 2),\n getValue(batch, inIdx + 3)\n );\n\n ${h}\n }\n\n int inIdx = inOffset + ${u};\n if (${1===c}) {\n ${d} values = ${d}(\n getValue(batch, inIdx),\n initializationValue,\n initializationValue,\n initializationValue\n );\n\n ${h}\n } else if (${2===c}) {\n ${d} values = ${d}(\n getValue(batch, inIdx),\n getValue(batch, inIdx + 1),\n initializationValue,\n initializationValue\n );\n\n ${h}\n } else if (${3===c}) {\n ${d} values = ${d}(\n getValue(batch, inIdx),\n getValue(batch, inIdx + 1),\n getValue(batch, inIdx + 2),\n initializationValue\n );\n\n ${h}\n }\n setOutput(${l});\n }\n `}}function WF(e,t,n,s){const r=function(e){const t=[];for(;0===t.length||1!==t[t.length-1].outSize;){const n=t.length?t[t.length-1].outSize:e[1],s=Mm(n);t.push({inSize:n,windowSize:s,outSize:Math.ceil(n/s)})}return t}(e.shape);let a=e;for(let i=0;i6)throw Error(`Transpose for rank ${t} is not yet supported`);const n=["resRC.x","resRC.y","resRC.z","resRC.w","resRC.u","resRC.v"],s=new Array(t);for(let t=0;t6)throw Error(`Packed transpose for rank ${this.rank} is not yet supported.`);const s=bD(this.rank),r=PM("rc",this.rank),a=new Array(this.rank);for(let e=0;e`Error in matMul: inner shapes (${h}) and (${d}) of Tensors with shapes ${e.shape} and ${t.shape} and transposeA=${n} and transposeB=${s} must match.`));const v=n?[y,h,p]:[y,p,h],x=s?[b,f,d]:[b,d,f],A=zF({inputs:{x:e},backend:r,attrs:{shape:v}}),k=zF({inputs:{x:t},backend:r,attrs:{shape:x}}),C=[A,k],S=Math.max(y,b),E=n?A.shape[1]:A.shape[2],_=null!=a,I=null!=i,T="leakyrelu"===l,N=null!=l?NF(l,!0):null;let O;if((1===p||1===f)&&E>XF&&!1===(_||I||T||null!=N)){let e=A,t=k;n&&(e=$F({inputs:{x:A},backend:r,attrs:{perm:[0,2,1]}}),C.push(e)),s&&(t=$F({inputs:{x:k},backend:r,attrs:{perm:[0,2,1]}}),C.push(t));const a=1===f;let i=e;1!==f&&(i=zF({inputs:{x:e},backend:r,attrs:{shape:[S,E,1]}}),C.push(i));const o=1===f?2:1;let l=t;a&&(l=zF({inputs:{x:t},backend:r,attrs:{shape:[S,1,E]}}),C.push(l));const u=FF({inputs:{a:i,b:l},backend:r});O=jF({inputs:{x:u},backend:r,attrs:{axis:o,keepDims:!0}}),C.push(u)}else{const l=Gi(e.dtype,t.dtype),u=new OF(v,x,[S,p,f],n,s,_,N,I,T),c=[A,k];if(null!=a&&c.push(a),I&&c.push(i),T){const e=r.makeTensorInfo([],"float32",di(o,"float32"));c.push(e),C.push(e)}O=r.runWebGLProgram(u,c,l)}const R=zF({inputs:{x:O},backend:r,attrs:{shape:w}});C.push(O);for(const e of C)r.disposeIntermediateTensorInfo(e);return R}const YF={kernelName:La,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:n,attrs:s}=e,{a:r,b:a,bias:i,preluActivationWeights:o}=t,{transposeA:l,transposeB:u,activation:c,leakyreluAlpha:h}=s;return ZF({a:r,b:a,transposeA:l,transposeB:u,backend:n,bias:i,preluActivationWeights:o,leakyreluAlpha:h,activation:c})}},QF="return abs(x);";const JF={kernelName:Nn,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:n}=e,{x:s}=t;if(n.shouldExecuteOnCPU([s])&&"complex64"!==s.dtype){const e=n.texData.get(s.dataId),t=kM(e.values);return n.makeTensorInfo(s.shape,s.dtype,t)}let r;return r=Sn().getBool("WEBGL_PACK_UNARY_OPERATIONS")?new oF(s.shape,QF):new $M(s.shape,QF),n.runWebGLProgram(r,[s],s.dtype)}},eB=IF({opSnippet:KM+"\n if (abs(x) > 1.) {\n return NAN;\n }\n return acos(x);\n"}),tB={kernelName:On,backendName:"webgl",kernelFunc:eB},nB=IF({opSnippet:KM+"\n if (x < 1.0) return NAN;\nreturn log(x + sqrt(x * x - 1.0));"}),sB={kernelName:Rn,backendName:"webgl",kernelFunc:nB},rB="return a + b;",aB=TF({opSnippet:rB,packedOpSnippet:rB,supportsComplex:!0,cpuKernelImpl:qD}),iB={kernelName:Dn,backendName:"webgl",kernelFunc:aB};class oB{constructor(e,t){this.outputShape=[],this.outputShape=e,this.variableNames=t.map(((e,t)=>`T${t}`));const n=[];this.variableNames.forEach((e=>{n.push(`float v${e} = get${e}AtOutCoords();`)}));const s=this.variableNames.map((e=>`v${e}`)).join(" + ");this.userCode=`\n void main() {\n ${n.join("\n ")}\n\n float result = ${s};\n setOutput(result);\n }\n `}}class lB{constructor(e,t){this.outputShape=[],this.packedInputs=!0,this.packedOutput=!0,this.outputShape=e,this.variableNames=t.map(((e,t)=>`T${t}`));const n=[];this.variableNames.forEach((e=>{n.push(`vec4 v${e} = get${e}AtOutCoords();`)}));const s=this.variableNames.map((e=>`v${e}`)).join(" + ");this.userCode=`\n void main() {\n ${n.join("\n ")}\n\n vec4 result = ${s};\n setOutput(result);\n }\n `}}const uB={kernelName:Mn,backendName:"webgl",kernelFunc:function e(t){const{inputs:n,backend:s}=t,r=n;if(1===r.length)return yF({inputs:{x:r[0]},backend:s});if(r.length>Sn().getNumber("WEBGL_MAX_TEXTURES_IN_SHADER")){const t=Math.floor(r.length/2),n=e({inputs:r.slice(0,t),backend:s}),a=e({inputs:r.slice(t),backend:s});return e({inputs:[n,a],backend:s})}const a=r.map((e=>e.dtype)).reduce(((e,t)=>Gi(e,t))),i=r.map((e=>e.shape)),o=Sn().getBool("WEBGL_PACK")?new lB(r[0].shape,i):new oB(r[0].shape,i);return s.runWebGLProgram(o,r,a)}};const cB={kernelName:Fn,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:n,attrs:s}=e,{x:r}=t,{axis:a,keepDims:i}=s,o=r.shape.length,l=en(a,r.shape);let u=l;const c=Ih(u,o);let h=r;null!=c&&(h=$F({inputs:{x:r},backend:n,attrs:{perm:c}}),u=Nh(u.length,o)),_h("all",u,o);const[d,p]=Sh(h.shape,u),f=zF({inputs:{x:h},backend:n,attrs:{shape:[-1,$t(p)]}}),m=WF(f,f.dtype,"all",n);let g;if(i){g=zF({inputs:{x:m},backend:n,attrs:{shape:Eh(d,l)}})}else g=zF({inputs:{x:m},backend:n,attrs:{shape:d}});return n.disposeIntermediateTensorInfo(f),n.disposeIntermediateTensorInfo(m),null!=c&&n.disposeIntermediateTensorInfo(h),g}};const hB={kernelName:Bn,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:n,attrs:s}=e,{x:r}=t,{axis:a,keepDims:i}=s,o=r.shape.length,l=en(a,r.shape);let u=l;const c=Ih(u,o);let h=r;null!=c&&(h=$F({inputs:{x:r},backend:n,attrs:{perm:c}}),u=Nh(u.length,o)),_h("any",u,o);const[d,p]=Sh(h.shape,u),f=zF({inputs:{x:h},backend:n,attrs:{shape:[-1,$t(p)]}}),m=WF(f,f.dtype,"any",n);let g;if(i){g=zF({inputs:{x:m},backend:n,attrs:{shape:Eh(d,l)}})}else g=zF({inputs:{x:m},backend:n,attrs:{shape:d}});return n.disposeIntermediateTensorInfo(f),n.disposeIntermediateTensorInfo(m),null!=c&&n.disposeIntermediateTensorInfo(h),g}};class dB{constructor(e,t,n){this.variableNames=["A"];const{windowSize:s,batchSize:r,outSize:a}=e;n||this.variableNames.push("bestIndicesA"),this.outputShape=[r,a];const i="max"===t?">":"<",o=n?"inOffset + i;":"round(getBestIndicesA(batch, inOffset + i));";this.userCode=`\n void main() {\n ivec2 coords = getOutputCoords();\n int batch = coords[0];\n int outIdx = coords[1];\n int inOffset = outIdx * ${s};\n\n int bestIndex = inOffset;\n float bestValue = getA(batch, bestIndex);\n\n for (int i = 0; i < ${s}; i++) {\n int inIdx = ${o};\n float candidate = getA(batch, inIdx);\n if (candidate ${i} bestValue) {\n bestValue = candidate;\n bestIndex = inIdx;\n }\n }\n setOutput(float(bestIndex));\n }\n `}}class pB{constructor(e,t,n,s){this.variableNames=["A"],this.packedInputs=!0,this.packedOutput=!0,qt(e.length>2,(()=>`Packed arg${n.charAt(0).toUpperCase()+n.slice(1)} supports only inputs with rank above 2.`));const r=e[e.length-1],a=Math.ceil(r/t);this.outputShape=e.slice(0,-1),a>1&&this.outputShape.push(a),s||this.variableNames.push("bestIndicesA");const i=this.outputShape,o=i.length,l=bD(o),u=VM("coords",o);let c,h;if(1===a){h=o+1;const e=bD(h);c=`\n ${e} sourceLocR = ${e}(${u.join()}, 0);\n ++${u[o-1]};\n ${e} sourceLocG = ${e}(${u.join()}, 0);\n ++${u[o-2]};\n ${e} sourceLocA = ${e}(${u.join()}, 0);\n --${u[o-1]};\n ${e} sourceLocB = ${e}(${u.join()}, 0);\n --${u[o-2]};`}else h=o,c=`\n ${l} sourceLocR = coords;\n ++${u[o-1]};\n ${l} sourceLocG = coords;\n ++${u[o-2]};\n ${l} sourceLocA = coords;\n --${u[o-1]};\n ${l} sourceLocB = coords;\n --${u[o-2]};`;const d=["x","y","z","w","u","v"].slice(0,h),p="."+d[h-1],f=d.map((e=>"int "+e)),m=VM("sourceLocR",h-1).concat("inIdx.r"),g=VM("sourceLocG",h-1).concat("inIdx.g"),y=VM("sourceLocB",h-1).concat("inIdx.b"),b=VM("sourceLocA",h-1).concat("inIdx.a"),w="max"===n?"greaterThan":"lessThan",v=s?"":`\n inIdx = round(vec4(getBestIndicesAChannel(${m.join()}),\n getBestIndicesAChannel(${g.join()}),\n getBestIndicesAChannel(${y.join()}),\n getBestIndicesAChannel(${b.join()})));`,x=`vec4(\n getAChannel(${m.join()}),\n hasNextCol ? getAChannel(${g.join()}) : 0.,\n hasNextRow ? getAChannel(${y.join()}) : 0.,\n hasNextRow && hasNextCol ? getAChannel(${b.join()}) : 0.)`,A=s?"":`\n float getBestIndicesAChannel(${f.join()}) {\n return getChannel(getBestIndicesA(${d.join()}),\n vec2(${d.slice(-2).join()}));\n }`;this.userCode=`\n float getAChannel(${f.join()}) {\n return getChannel(getA(${d.join()}),\n vec2(${d.slice(-2).join()}));\n }\n ${A}\n void main() {\n ${l} coords = getOutputCoords();\n bool hasNextCol = ${u[o-1]} < ${i[o-1]-1};\n bool hasNextRow = ${u[o-2]} < ${i[o-2]-1};\n ${c}\n ivec4 srcIdx = ivec4(sourceLocR${p}, sourceLocG${p},\n sourceLocB${p}, sourceLocA${p}) * ${t};\n ivec4 inIdx = srcIdx;\n vec4 bestIndex = vec4(inIdx);\n vec4 bestValue = ${x};\n\n for (int i = 0; i < ${t}; i++) {\n inIdx = srcIdx;\n ${v}\n vec4 candidate = ${x};\n bvec4 nan = isnan(candidate);\n bvec4 replace = bvec4(\n vec4(${w}(candidate, bestValue)) * (vec4(1.0) - vec4(nan)));\n\n bestValue = vec4(replace.x ? candidate.x : bestValue.x,\n replace.y ? candidate.y : bestValue.y,\n replace.z ? candidate.z : bestValue.z,\n replace.w ? candidate.w : bestValue.w);\n bestIndex = mix(bestIndex, vec4(inIdx), vec4(replace));\n srcIdx++;\n }\n setOutput(bestIndex);\n }\n `}}function fB(e,t,n,s=null){let r=t.shape[0],a=t.shape[1];null!=s&&(r=s.shape[0],a=s.shape[1]);const i=Mm(a),o={windowSize:i,inSize:a,batchSize:r,outSize:Math.ceil(a/i)},l=new dB(o,n,null==s),u=[t];null!=s&&u.push(s);const c=e.runWebGLProgram(l,u,"int32");if(1===c.shape[1])return c;const h=fB(e,t,n,c);return e.disposeIntermediateTensorInfo(c),h}function mB(e,t,n,s=null){const r=null!=s?s.shape:t.shape,a=Mm(r[r.length-1]),i=new pB(r,a,n,null==s),o=null==s?[t]:[t,s],l=e.runWebGLProgram(i,o,"int32");if(l.shape.length===t.shape.length){const s=mB(e,t,n,l);return e.disposeIntermediateTensorInfo(l),s}return l}function gB(e,t,n,s){const r=[n];if(_h("arg"+s.charAt(0).toUpperCase()+s.slice(1),r,t.shape.length),!Sn().getBool("WEBGL_PACK_REDUCE")||t.shape.length<=2){const n=[],a=e.texData.get(t.dataId);let i=t;null!==a&&a.isPacked&&(i=e.unpackTensor(t),n.push(i));const[o,l]=Sh(i.shape,r),u=$t(l),c=zF({inputs:{x:i},backend:e,attrs:{shape:[-1,u]}});n.push(c);const h=fB(e,c,s);n.push(h);const d=zF({inputs:{x:h},backend:e,attrs:{shape:o}});return n.forEach((t=>e.disposeIntermediateTensorInfo(t))),d}return mB(e,t,s)}const yB={kernelName:zn,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:n,attrs:s}=e,{x:r}=t,{axis:a}=s;let i=en(a,r.shape);const o=Ih(i,r.shape.length);let l=r;const u=[];null!=o&&(l=$F({inputs:{x:r},backend:n,attrs:{perm:o}}),u.push(l),i=Nh(i.length,l.shape.length)),_h("argMax",[i[0]],l.shape.length);const c=gB(n,l,i[0],"max");return u.forEach((e=>n.disposeIntermediateTensorInfo(e))),c}};const bB={kernelName:Ln,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:n,attrs:s}=e,{x:r}=t,{axis:a}=s;let i=en(a,r.shape);const o=Ih(i,r.shape.length);let l=r;const u=[];null!=o&&(l=$F({inputs:{x:r},backend:n,attrs:{perm:o}}),u.push(l),i=Nh(i.length,l.shape.length)),_h("argMin",[i[0]],l.shape.length);const c=gB(n,l,i[0],"min");return u.forEach((e=>n.disposeIntermediateTensorInfo(e))),c}},wB=IF({opSnippet:KM+"\n if (abs(x) > 1.) {\n return NAN;\n }\n return asin(x);\n"}),vB={kernelName:Pn,backendName:"webgl",kernelFunc:wB},xB=IF({opSnippet:KM+"return log(x + sqrt(x * x + 1.0));"}),AB={kernelName:Vn,backendName:"webgl",kernelFunc:xB},kB=IF({opSnippet:KM+"\n return atan(x);\n"}),CB={kernelName:Wn,backendName:"webgl",kernelFunc:kB},SB=TF({opSnippet:pF+"\n return atan(a, b);\n",packedOpSnippet:"\n vec4 result = atan(a, b);\n bvec4 isNaNA = isnan(a);\n bvec4 isNaNB = isnan(b);\n bvec4 isNaN = bvec4(isNaNA.x || isNaNB.x, isNaNA.y || isNaNB.y, isNaNA.z || isNaNB.z, isNaNA.w || isNaNB.w);\n "+mF+"\n return result;\n"}),EB={kernelName:Gn,backendName:"webgl",kernelFunc:SB},_B=IF({opSnippet:KM+"\n if ((x < -1.0) || (x > 1.0)) return NAN;\nreturn (log(1.0 + x) - log(1.0 - x)) / 2.0;"}),IB={kernelName:Un,backendName:"webgl",kernelFunc:_B};class TB{constructor(e,t,n,s=!1,r=!1){if(this.variableNames=["x"],"avg"===t&&n)throw new Error("Cannot compute positions for average pool.");const a=e.filterWidth,i=e.strideHeight,o=e.strideWidth,l=e.dilationHeight,u=e.dilationWidth,c=e.effectiveFilterHeight,h=e.effectiveFilterWidth,d=e.padInfo.top,p=e.padInfo.left;this.outputShape=e.outShape;const f="avg"===t,m=`((batch * ${e.inHeight} + xR) * ${e.inWidth} + xC) * ${e.inChannels} + d`,g=`(xR * ${e.inWidth} + xC) * ${e.inChannels} + d`;let y="0.0";if(f||(y="-1.0 / 1e-20"),n){const t=">=";return void(this.userCode=`\n const ivec2 strides = ivec2(${i}, ${o});\n const ivec2 pads = ivec2(${d}, ${p});\n\n void main() {\n ivec4 coords = getOutputCoords();\n int batch = coords[0];\n int d = coords[3];\n\n ivec2 xRCCorner = coords.yz * strides - pads;\n int xRCorner = xRCCorner.x;\n int xCCorner = xRCCorner.y;\n\n // max/min x(?, ?, d) to get y(yR, yC, d).\n // ? = to be determined\n float minMaxValue = 0.0;\n float minMaxValueFound = 0.0;\n int minMaxPosition = 0;\n float avgValue = 0.0;\n\n for (int wR = 0; wR < ${c};\n wR += ${l}) {\n int xR = xRCorner + wR;\n\n if (xR < 0 || xR >= ${e.inHeight}) {\n continue;\n }\n\n for (int wC = 0; wC < ${h};\n wC += ${u}) {\n int xC = xCCorner + wC;\n\n if (xC < 0 || xC >= ${e.inWidth}) {\n continue;\n }\n\n float value = getX(batch, xR, xC, d);\n\n // If a min / max value has already been found, use it. If not,\n // use the current value.\n float currMinMaxValue = mix(\n value, minMaxValue, minMaxValueFound);\n if (value ${t} currMinMaxValue) {\n minMaxValue = value;\n minMaxValueFound = 1.0;\n minMaxPosition = ${s?r?m:g:`wR * ${h} + wC`};\n }\n }\n }\n setOutput(float(minMaxPosition));\n }\n `)}let b=`${t}(${t}(${t}(minMaxValue[0], minMaxValue[1]), minMaxValue[2]), minMaxValue[3])`;"avg"===t&&(b="avgValue / max(count, 1.0)");const w=4*Math.floor(a/4),v=a%4,x=`\n if (${f}) {\n avgValue += dot(values, ones);\n } else {\n minMaxValue = max(values, minMaxValue);\n }\n `;this.userCode=`\n const ivec2 strides = ivec2(${i}, ${o});\n const ivec2 pads = ivec2(${d}, ${p});\n const float initializationValue = ${y};\n const vec4 ones = vec4(1.0, 1.0, 1.0, 1.0);\n\n float count = 0.0;\n\n float getValue(int batch, int xR, int xC, int d) {\n if (xC < 0 || xC >= ${e.inWidth}) {\n return initializationValue;\n }\n count += 1.0;\n return getX(batch, xR, xC, d);\n }\n\n void main() {\n ivec4 coords = getOutputCoords();\n int batch = coords[0];\n int d = coords[3];\n\n ivec2 xRCCorner = coords.yz * strides - pads;\n int xRCorner = xRCCorner.x;\n int xCCorner = xRCCorner.y;\n\n // max/min x(?, ?, d) to get y(yR, yC, d).\n // ? = to be determined\n vec4 minMaxValue = vec4(${y});\n float avgValue = 0.0;\n count = 0.0;\n\n for (int wR = 0; wR < ${c};\n wR += ${l}) {\n int xR = xRCorner + wR;\n\n if (xR < 0 || xR >= ${e.inHeight}) {\n continue;\n }\n\n for (int wC = 0; wC < ${w}; wC += 4) {\n int xC = xCCorner + wC * ${u};\n\n vec4 values = vec4(\n getValue(batch, xR, xC, d),\n getValue(batch, xR, xC + ${u}, d),\n getValue(batch, xR, xC + 2 * ${u}, d),\n getValue(batch, xR, xC + 3 * ${u}, d)\n );\n\n ${x}\n }\n\n int xC = xCCorner + ${w};\n if (${1===v}) {\n vec4 values = vec4(\n getValue(batch, xR, xC, d),\n initializationValue,\n initializationValue,\n initializationValue\n );\n\n ${x}\n } else if (${2===v}) {\n vec4 values = vec4(\n getValue(batch, xR, xC, d),\n getValue(batch, xR, xC + ${u}, d),\n initializationValue,\n initializationValue\n );\n\n ${x}\n } else if (${3===v}) {\n vec4 values = vec4(\n getValue(batch, xR, xC, d),\n getValue(batch, xR, xC + ${u}, d),\n getValue(batch, xR, xC + 2 * ${u}, d),\n initializationValue\n );\n\n ${x}\n }\n }\n setOutput(${b});\n }\n `}}class NB{constructor(e,t,n,s=!1,r=!1){if(this.variableNames=["x"],"avg"===t&&n)throw new Error("Cannot compute positions for average pool.");const a=e.filterWidth,i=e.strideDepth,o=e.strideHeight,l=e.strideWidth,u=e.dilationDepth,c=e.dilationHeight,h=e.dilationWidth,d=e.effectiveFilterDepth,p=e.effectiveFilterHeight,f=e.effectiveFilterWidth,m=e.padInfo.front,g=e.padInfo.top,y=e.padInfo.left;this.outputShape=e.outShape;const b="avg"===t;let w="0.0";if(b||(w="-1.0 / 1e-20"),n){const t=">=";return void(this.userCode=`\n const ivec3 strides =\n ivec3(${i}, ${o}, ${l});\n const ivec3 pads = ivec3(${m}, ${g}, ${y});\n\n void main() {\n ivec5 coords = getOutputCoords();\n int batch = coords.x;\n int ch = coords.u;\n\n ivec3 xCorner = ivec3(coords.y, coords.z, coords.w) * strides - pads;\n int xDCorner = xCorner.x;\n int xRCorner = xCorner.y;\n int xCCorner = xCorner.z;\n\n // max/min x(?, ?, ?, ch) to get y(yD, yR, yC, ch).\n // ? = to be determined\n float minMaxValue = 0.0;\n float minMaxValueFound = 0.0;\n int minMaxPosition = 0;\n\n for (int wD = 0; wD < ${d};\n wD += ${u}) {\n int xD = xDCorner + wD;\n\n if (xD < 0 || xD >= ${e.inDepth}) {\n continue;\n }\n\n for (int wR = 0; wR < ${p};\n wR += ${c}) {\n int xR = xRCorner + wR;\n\n if (xR < 0 || xR >= ${e.inHeight}) {\n continue;\n }\n\n for (int wC = 0; wC < ${f};\n wC += ${h}) {\n int xC = xCCorner + wC;\n\n if (xC < 0 || xC >= ${e.inWidth}) {\n continue;\n }\n\n float value = getX(batch, xD, xR, xC, ch);\n\n // If a min / max value has already been found, use it. If not,\n // use the current value.\n float currMinMaxValue = mix(\n value, minMaxValue, minMaxValueFound);\n if (value ${t} currMinMaxValue) {\n minMaxValue = value;\n minMaxValueFound = 1.0;\n minMaxPosition = ${s?r?`(((batch * ${e.inDepth} + xD) * ${e.inHeight} + xR) * ${e.inWidth} + xC) * ${e.inChannels} + ch`:`((xD * ${e.inHeight} + xR) * ${e.inWidth} + xC) * ${e.inChannels} + ch`:`wD * ${p} * ${f} +\n wR * ${f} + wC`};\n }\n }\n }\n }\n setOutput(float(minMaxPosition));\n }\n `)}let v=`${t}(${t}(${t}(minMaxValue[0], minMaxValue[1]), minMaxValue[2]), minMaxValue[3])`;"avg"===t&&(v="avgValue / max(count, 1.0)");const x=4*Math.floor(a/4),A=a%4,k=`\n if (${b}) {\n avgValue += dot(values, ones);\n } else {\n minMaxValue = max(values, minMaxValue);\n }\n `;this.userCode=`\n const ivec3 strides =\n ivec3(${i}, ${o}, ${l});\n const ivec3 pads = ivec3(${m}, ${g}, ${y});\n const float initializationValue = ${w};\n const vec4 ones = vec4(1.0, 1.0, 1.0, 1.0);\n\n float count = 0.0;\n\n float getValue(int batch, int xD, int xR, int xC, int ch) {\n if (xC < 0 || xC >= ${e.inWidth}) {\n return initializationValue;\n }\n count += 1.0;\n return getX(batch, xD, xR, xC, ch);\n }\n\n void main() {\n ivec5 coords = getOutputCoords();\n int batch = coords.x;\n int ch = coords.u;\n\n ivec3 xCorner = ivec3(coords.y, coords.z, coords.w) * strides - pads;\n int xDCorner = xCorner.x;\n int xRCorner = xCorner.y;\n int xCCorner = xCorner.z;\n\n // max/min x(?, ?, ?, d) to get y(yD, yR, yC, ch).\n // ? = to be determined\n vec4 minMaxValue = vec4(${w});\n float avgValue = 0.0;\n count = 0.0;\n\n for (int wD = 0; wD < ${d};\n wD += ${u}) {\n int xD = xDCorner + wD;\n\n if (xD < 0 || xD >= ${e.inDepth}) {\n continue;\n }\n\n for (int wR = 0; wR < ${p};\n wR += ${c}) {\n int xR = xRCorner + wR;\n\n if (xR < 0 || xR >= ${e.inHeight}) {\n continue;\n }\n\n for (int wC = 0; wC < ${x}; wC += 4) {\n int xC = xCCorner + wC * ${h};\n\n vec4 values = vec4(\n getValue(batch, xD, xR, xC, ch),\n getValue(batch, xD, xR, xC + ${h}, ch),\n getValue(batch, xD, xR, xC + 2 * ${h}, ch),\n getValue(batch, xD, xR, xC + 3 * ${h}, ch)\n );\n\n ${k}\n }\n\n int xC = xCCorner + ${x};\n if (${1===A}) {\n vec4 values = vec4(\n getValue(batch, xD, xR, xC, ch),\n initializationValue,\n initializationValue,\n initializationValue\n );\n\n ${k}\n } else if (${2===A}) {\n vec4 values = vec4(\n getValue(batch, xD, xR, xC, ch),\n getValue(batch, xD, xR, xC + ${h}, ch),\n initializationValue,\n initializationValue\n );\n\n ${k}\n } else if (${3===A}) {\n vec4 values = vec4(\n getValue(batch, xD, xR, xC, ch),\n getValue(batch, xD, xR, xC + ${h}, ch),\n getValue(batch, xD, xR, xC + 2 * ${h}, ch),\n initializationValue\n );\n\n ${k}\n }\n }\n }\n setOutput(${v});\n }\n `}}const OB={kernelName:qn,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:n,attrs:s}=e,{x:r}=t;JR(r,"avgPool");const{filterSize:a,strides:i,pad:o,dimRoundingMode:l}=s;qt(Sc(i,1),(()=>`Error in avgPool: Either strides or dilations must be 1. Got strides ${i} and dilations '1'`));const u=mc(r.shape,a,i,1,o,l);if(1===u.filterWidth&&1===u.filterHeight&&Kt(u.inShape,u.outShape))return yF({inputs:{x:r},backend:n});const c=new TB(u,"avg",!1);return n.runWebGLProgram(c,[r],"float32")}};const RB={kernelName:Hn,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:n,attrs:s}=e,{x:r}=t,{filterSize:a,strides:i,pad:o,dimRoundingMode:l,dataFormat:u}=s,c=gc(r.shape,a,i,[1,1,1],o,l,u),h=new NB(c,"avg",!1);return n.runWebGLProgram(h,[r],"float32")}};class DB{constructor(e){this.variableNames=["dy"],this.outputShape=e.inShape;const t=e.filterHeight,n=e.filterWidth,s=e.strideHeight,r=e.strideWidth,a=e.dilationHeight,i=e.dilationWidth,o=e.effectiveFilterHeight,l=e.effectiveFilterWidth,u=o-1-e.padInfo.top,c=l-1-e.padInfo.left,h=1/(t*n);this.userCode=`\n const ivec2 pads = ivec2(${u}, ${c});\n const float avgMultiplier = float(${h});\n\n void main() {\n ivec4 coords = getOutputCoords();\n int b = coords[0];\n int d = coords[3];\n\n ivec2 dyRCCorner = coords.yz - pads;\n int dyRCorner = dyRCCorner.x;\n int dyCCorner = dyRCCorner.y;\n\n // Convolve dy(?, ?, d) with pos mask(:, :, d) to get dx(xR, xC, d).\n // ? = to be determined. : = across all values in that axis.\n float dotProd = 0.0;\n for (int wR = 0; wR < ${o};\n wR += ${a}) {\n float dyR = float(dyRCorner + wR) / ${s}.0;\n\n if (dyR < 0.0 || dyR >= ${e.outHeight}.0 || fract(dyR) > 0.0) {\n continue;\n }\n int idyR = int(dyR);\n\n for (int wC = 0; wC < ${l};\n wC+= ${i}) {\n float dyC = float(dyCCorner + wC) / ${r}.0;\n\n if (dyC < 0.0 || dyC >= ${e.outWidth}.0 ||\n fract(dyC) > 0.0) {\n continue;\n }\n int idyC = int(dyC);\n\n float dyValue = getDy(b, idyR, idyC, d);\n\n dotProd += dyValue * avgMultiplier;\n }\n }\n setOutput(dotProd);\n }\n `}}class MB{constructor(e){this.variableNames=["dy"],this.outputShape=e.inShape;const t=e.filterDepth,n=e.filterHeight,s=e.filterWidth,r=e.strideDepth,a=e.strideHeight,i=e.strideWidth,o=e.dilationDepth,l=e.dilationHeight,u=e.dilationWidth,c=e.effectiveFilterDepth,h=e.effectiveFilterHeight,d=e.effectiveFilterWidth,p=c-1-e.padInfo.front,f=h-1-e.padInfo.top,m=d-1-e.padInfo.left,g=1/(t*n*s);this.userCode=`\n const ivec3 pads = ivec3(${p}, ${f}, ${m});\n const float avgMultiplier = float(${g});\n\n void main() {\n ivec5 coords = getOutputCoords();\n int batch = coords.x;\n int ch = coords.u;\n\n ivec3 dyCorner = ivec3(coords.y, coords.z, coords.w) - pads;\n int dyDCorner = dyCorner.x;\n int dyRCorner = dyCorner.y;\n int dyCCorner = dyCorner.z;\n\n // Convolve dy(?, ?, ?, d) with pos mask(:, :, :, ch) to get\n // dx(xD, xR, xC, ch).\n // ? = to be determined. : = across all values in that axis.\n float dotProd = 0.0;\n\n for (int wD = 0; wD < ${c};\n wD += ${o}) {\n float dyD = float(dyDCorner + wD) / ${r}.0;\n\n if (dyD < 0.0 || dyD >= ${e.outDepth}.0 || fract(dyD) > 0.0) {\n continue;\n }\n int idyD = int(dyD);\n\n for (int wR = 0; wR < ${h};\n wR += ${l}) {\n float dyR = float(dyRCorner + wR) / ${a}.0;\n\n if (dyR < 0.0 || dyR >= ${e.outHeight}.0 ||\n fract(dyR) > 0.0) {\n continue;\n }\n int idyR = int(dyR);\n\n for (int wC = 0; wC < ${d};\n wC += ${u}) {\n float dyC = float(dyCCorner + wC) / ${i}.0;\n\n if (dyC < 0.0 || dyC >= ${e.outWidth}.0 ||\n fract(dyC) > 0.0) {\n continue;\n }\n int idyC = int(dyC);\n\n float dyValue = getDy(batch, idyD, idyR, idyC, ch);\n\n dotProd += dyValue * avgMultiplier;\n }\n }\n }\n setOutput(dotProd);\n }\n `}}const FB={kernelName:$n,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:n,attrs:s}=e,{dy:r,input:a}=t,i=a,{filterSize:o,strides:l,pad:u,dimRoundingMode:c}=s,h=gc(i.shape,o,l,[1,1,1],u,c),d=new MB(h);return n.runWebGLProgram(d,[r],i.dtype)}};const BB={kernelName:jn,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:n,attrs:s}=e,{dy:r,input:a}=t,i=a;JR([r,a],"avgPoolGrad");const{filterSize:o,strides:l,pad:u}=s,c=mc(i.shape,o,l,1,u),h=new DB(c);return n.runWebGLProgram(h,[r],i.dtype)}};const zB={kernelName:Kn,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:n,attrs:s}=e,{a:r,b:a}=t,{transposeA:i,transposeB:o}=s;return ZF({a:r,b:a,transposeA:i,transposeB:o,backend:n})}};class LB{constructor(e,t,n,s,r,a){this.outputShape=[],this.variableNames=["x","mean","variance"],su(e,t),su(e,n);let i="0.0";null!=s&&(su(e,s),this.variableNames.push("offset"),i="getOffsetAtOutCoords()");let o="1.0";null!=r&&(su(e,r),this.variableNames.push("scale"),o="getScaleAtOutCoords()"),this.outputShape=e,this.userCode=`\n void main() {\n float x = getXAtOutCoords();\n float mean = getMeanAtOutCoords();\n float variance = getVarianceAtOutCoords();\n float offset = ${i};\n float scale = ${o};\n float inv = scale * inversesqrt(variance + float(${a}));\n setOutput(dot(vec3(x, -mean, offset), vec3(inv, inv, 1)));\n }\n `}}class PB{constructor(e,t,n,s,r,a){this.packedInputs=!0,this.packedOutput=!0,this.variableNames=["x","mean","variance"],su(e,t),su(e,n);let i="vec4(0.0)";null!=s&&(su(e,s),this.variableNames.push("offset"),i="getOffsetAtOutCoords()");let o="vec4(1.0)";null!=r&&(su(e,r),this.variableNames.push("scale"),o="getScaleAtOutCoords()"),this.outputShape=e,this.userCode=`\n void main() {\n vec4 offset = ${i};\n vec4 scale = ${o};\n\n vec4 x = getXAtOutCoords();\n vec4 mean = getMeanAtOutCoords();\n vec4 variance = getVarianceAtOutCoords();\n\n vec4 inv = scale * inversesqrt(variance + vec4(${a}));\n\n setOutput((x - mean) * inv + offset);\n }\n `}}const VB={kernelName:Vs,backendName:"webgl",kernelFunc:({inputs:e,backend:t,attrs:n})=>{const{x:s,mean:r,variance:a,offset:i,scale:o}=e;qt(r.shape.length===a.shape.length,(()=>"Batch normalization gradient requires mean and variance to have equal ranks.")),qt(null==i||r.shape.length===i.shape.length,(()=>"Batch normalization gradient requires mean and offset to have equal ranks.")),qt(null==o||r.shape.length===o.shape.length,(()=>"Batch normalization gradient requires mean and scale to have equal ranks."));let{varianceEpsilon:l}=n;null==l&&(l=.001);const u=[s,r,a];let c=null;null!=i&&(c=i.shape,u.push(i));let h=null;null!=o&&(h=o.shape,u.push(o));const d=Sn().getBool("WEBGL_PACK_NORMALIZATION")?new PB(s.shape,r.shape,a.shape,c,h,l):new LB(s.shape,r.shape,a.shape,c,h,l);return t.runWebGLProgram(d,u,u[0].dtype)}};class WB{constructor(e){this.variableNames=["source"],this.outputShape=e,this.rank=e.length;const t=bD(this.rank);this.customUniforms=[{name:"start",arrayIndex:this.rank,type:"int"}];const n=function(e){if(1===e)return"sourceLoc";if(e<=6)return UB.slice(0,e).map((e=>"sourceLoc."+e)).join(",");throw Error(`Slicing for rank ${e} is not yet supported`)}(this.rank);let s;s=`\n ${t} sourceLoc;\n ${t} coords = getOutputCoords();\n ${e.map(((e,t)=>`sourceLoc.${UB[t]} = start[${t}] + coords.${UB[t]};`)).join("\n")}\n `,this.userCode=`\n void main() {\n ${s}\n setOutput(getSource(${n}));\n }\n `}}const UB=["x","y","z","w","u","v"];class GB{constructor(e){this.variableNames=["source"],this.packedInputs=!0,this.packedOutput=!0,this.outputShape=e,this.rank=e.length,this.customUniforms=[{name:"start",arrayIndex:this.rank,type:"int"}];const t=bD(this.rank),n=VM("coords",this.rank),s=VM("sourceLoc",this.rank),r=1===this.rank?"sourceLoc":`vec2(${s.slice(-2).join()})`,a=`getChannel(getSource(${s.join()}), ${r})`,i=`\n result.x = ${a};\n if (++${n[this.rank-1]} < ${e[this.rank-1]}) {\n ++${s[this.rank-1]};\n result.y = ${a};\n --${s[this.rank-1]};\n }\n `,o=1===this.rank?"":`\n --${n[this.rank-1]};\n if (++${n[this.rank-2]} < ${e[this.rank-2]}) {\n ++${s[this.rank-2]};\n result.z = ${a};\n if (++${n[this.rank-1]} < ${e[this.rank-1]}) {\n ++${s[this.rank-1]};\n result.w = ${a};\n }\n }\n `,l=this.rank<=4?`sourceLoc = coords +\n ${t}(${e.map(((e,t)=>`start[${t}]`)).join()});`:e.map(((e,t)=>`${s[t]} = ${n[t]} + start[${t}];`)).join("\n");this.userCode=`\n void main() {\n ${t} coords = getOutputCoords();\n ${t} sourceLoc;\n ${l}\n vec4 result = vec4(0.);\n ${i}\n ${o}\n setOutput(result);\n }\n `}}function qB(e){const{inputs:t,backend:n,attrs:s}=e,{x:r}=t,{begin:a,size:i}=s,[o,l]=Ju(r,a,i);if(Pu(r,o,l),0===$t(l))return n.makeTensorInfo(l,r.dtype,[]);if(n.shouldExecuteOnCPU([r])||"string"===r.dtype){const e=n.texData.get(r.dataId),t=CM(e.values,o,l,r.shape,r.dtype);return n.makeTensorInfo(l,r.dtype,t)}const{isPacked:u}=n.texData.get(r.dataId),c=Yu(r.shape,o,l);if(u||!c){const e=Sn().getBool("WEBGL_PACK_ARRAY_OPERATIONS")?new GB(l):new WB(l),t=[o];return n.runWebGLProgram(e,[r],r.dtype,t)}return n.uploadToGPU(r.dataId),function(e,t,n,s){const r=s.texData.get(e.dataId),a=s.makeTensorInfo(n,e.dtype),i=s.texData.get(a.dataId);Object.assign(i,r),i.refCount=1,i.shape=n,i.dtype=e.dtype;let o=Qu(t,dn(e.shape));r.slice&&(o+=r.slice.flatOffset),i.slice={flatOffset:o,origDataId:r.slice&&r.slice.origDataId||e.dataId};const l=s.dataRefCount.get(i.slice.origDataId)||1;return s.dataRefCount.set(i.slice.origDataId,l+1),a}(r,o,l,n)}const jB={kernelName:ta,backendName:"webgl",kernelFunc:qB},HB={kernelName:Xn,backendName:"webgl",kernelFunc:e=>{const{inputs:t,backend:n,attrs:s}=e,{x:r}=t,{blockShape:a,crops:i}=s;qt(r.shape.length<=4,(()=>"batchToSpaceND for rank > 4 with a WebGL backend not implemented yet"));const o=a.reduce(((e,t)=>e*t)),l=Bm(r.shape,a,o),u=zm(l.length,a.length),c=Lm(r.shape,a,o),h=Pm(i,a.length),d=Vm(c,i,a.length),p=[],f=zF({inputs:{x:r},backend:n,attrs:{shape:l}}),m=$F({inputs:{x:f},backend:n,attrs:{perm:u}}),g=zF({inputs:{x:m},backend:n,attrs:{shape:c}}),y=qB({inputs:{x:g},backend:n,attrs:{begin:h,size:d}});return p.push(f),p.push(m),p.push(g),p.forEach((e=>n.disposeIntermediateTensorInfo(e))),y}};const $B={kernelName:Zn,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:n,attrs:s}=e,{x:r,weights:a}=t,{size:i}=s,o=n.readSync(r.dataId),l=n.readSync(a.dataId),u=jD(o,l,a.dtype,a.shape,i);return n.makeTensorInfo([i],a.dtype,u)}};const KB={kernelName:Yn,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:n}=e,{a:s,b:r}=t,a=Sn().getBool("WEBGL_PACK_BINARY_OPERATIONS"),i=Sn().getNumber("WEBGL_VERSION");if(n.shouldExecuteOnCPU([s,r])||1===i){const e=n.texData.get(s.dataId).values,t=n.texData.get(r.dataId).values,[a,i]=$D(s.shape,r.shape,e,t,s.dtype),o=n.makeTensorInfo(i,s.dtype);return n.texData.get(o.dataId).values=a,o}let o;return o=a?new gF("\n int r = int(a.r) & int(b.r);\n int g = int(a.g) & int(b.g);\n int rb = int(a.b) & int(b.b);\n int ra = int(a.a) & int(b.a);\n return vec4(r, g, rb, ra);\n",s.shape,r.shape,!1):new fF("\n return float(int(a.r) & int(b.r));\n",s.shape,r.shape),n.runWebGLProgram(o,[s,r],s.dtype)}};const XB={kernelName:Qn,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:n}=e,{s0:s,s1:r}=t,a=n.readSync(s.dataId),i=n.readSync(r.dataId),o=su(Array.from(a),Array.from(i));return n.makeTensorInfo([o.length],"int32",Int32Array.from(o))}},ZB=TF({opSnippet:"return float(a != b);",cpuKernelImpl:fM,dtype:"bool"}),YB={kernelName:kr,backendName:"webgl",kernelFunc:ZB};function QB(e){const{inputs:t,backend:n}=e,{input:s}=t;return yF({inputs:{x:n.texData.get(s.dataId).complexTensorInfos.real},backend:n})}const JB={kernelName:Lr,backendName:"webgl",kernelFunc:QB},ez="return float(int(x));";const tz={kernelName:Jn,backendName:"webgl",kernelFunc:function e(t){const{inputs:n,backend:s,attrs:r}=t,{x:a}=n,{dtype:i}=r;if("complex64"===i){if("complex64"===a.dtype)return yF({inputs:{x:a},backend:s});const t=wd(a.shape),n=e({inputs:{x:a},backend:s,attrs:{dtype:"float32"}}),r=wF({inputs:{real:n,imag:t},backend:s});return t.dispose(),s.disposeIntermediateTensorInfo(n),r}if("complex64"===a.dtype){const t=QB({inputs:{input:a},backend:s}),n=e({inputs:{x:t},backend:s,attrs:{dtype:i}});return s.disposeIntermediateTensorInfo(t),n}if(!rn(a.dtype,i)){const e=yF({inputs:{x:a},backend:s});return{dataId:e.dataId,shape:e.shape,dtype:i}}if(s.shouldExecuteOnCPU([a])){const e=s.texData.get(a.dataId).values,[t,n,r]=KD(e,a.shape,a.dtype,i);return s.makeTensorInfo(t,n,r)}if("int32"===i)return function(e,t){const n=new $M(e.shape,ez),s=t.runWebGLProgram(n,[e],"int32");return{dataId:s.dataId,shape:s.shape,dtype:s.dtype}}(a,s);if("bool"===i){const e=s.makeTensorInfo([],"bool",nn("bool",1)),t=ZB({inputs:{a,b:e},backend:s});return s.disposeIntermediateTensorInfo(e),t}throw new Error(`Error in Cast: failed to cast ${a.dtype} to ${i}`)}},nz="return ceil(x);",sz=IF({opSnippet:nz,packedOpSnippet:nz,cpuKernelImpl:XD}),rz={kernelName:es,backendName:"webgl",kernelFunc:sz};class az{constructor(e){this.variableNames=["A"],this.customUniforms=[{name:"minVal",type:"float"},{name:"maxVal",type:"float"}],this.outputShape=e,this.userCode="\n\n void main() {\n float value = getAAtOutCoords();\n if (isnan(value)) {\n setOutput(value);\n return;\n }\n\n setOutput(clamp(value, minVal, maxVal));\n }\n "}}class iz{constructor(e){this.variableNames=["A"],this.packedInputs=!0,this.packedOutput=!0,this.customUniforms=[{name:"minVal",type:"float"},{name:"maxVal",type:"float"}],this.outputShape=e,this.userCode="\n void main() {\n vec4 value = getAAtOutCoords();\n\n if (any(isnan(value))) {\n setOutput(value);\n return;\n }\n\n setOutput(clamp(value, vec4(minVal), vec4(maxVal)));\n }\n "}}const oz={kernelName:ts,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:n,attrs:s}=e,{x:r}=t,{clipValueMin:a,clipValueMax:i}=s;let o;o=Sn().getBool("WEBGL_PACK_CLIP")?new iz(r.shape):new az(r.shape);const l=[[a],[i]];return n.runWebGLProgram(o,[r],r.dtype,l)}};class lz{constructor(e){this.variableNames=["real","imag"],this.outputShape=e,this.userCode="\n void main() {\n float re = abs(getRealAtOutCoords());\n float im = abs(getImagAtOutCoords());\n float mx = max(re, im);\n\n // sadly the length function in glsl is not underflow-safe\n // (at least not on Intel GPUs). So the safe solution is\n // to ensure underflow-safety in all cases.\n setOutput(\n mx == 0.0 ? 0.0 : mx * length(vec2(1, min(re, im)/mx))\n );\n }\n "}}function uz(e,t){return{dataId:t.dataId,dtype:t.dtype,shape:e.shape}}const cz={kernelName:ss,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:n}=e,{x:s}=t,r=n.texData.get(s.dataId),a=new lz(s.shape),i=[uz(s,r.complexTensorInfos.real),uz(s,r.complexTensorInfos.imag)];return n.runWebGLProgram(a,i,i[0].dtype)}};class hz{constructor(e){this.outputShape=[],this.outputShape=_m(e,1),this.variableNames=e.map(((e,t)=>`T${t}`));const t=new Array(e.length-1);t[0]=e[0][1];for(let n=1;n`T${t}`));const o=new Array(e.length-1);o[0]=e[0][t];for(let n=1;n= ${o[e-1]}) {\n return getChannel(\n getT${e}(${pz(i,l,t)}),\n vec2(${pz(u,l,t)}));\n }`}const d=o.length,p=o[o.length-1];h+=`\n return getChannel(\n getT${d}(${pz(i,l,p)}),\n vec2(${pz(u,l,p)}));`,this.userCode=`\n float getValue(${i.map((e=>"int "+e))}) {\n ${h}\n }\n\n void main() {\n ${r} coords = getOutputCoords();\n vec4 result = vec4(getValue(${a}), 0., 0., 0.);\n\n ${a[s-1]} = ${a[s-1]} + 1;\n if (${a[s-1]} < ${n[s-1]}) {\n result.g = getValue(${a});\n }\n\n ${a[s-2]} = ${a[s-2]} + 1;\n if (${a[s-2]} < ${n[s-2]}) {\n result.a = getValue(${a});\n }\n\n ${a[s-1]} = ${a[s-1]} - 1;\n if (${a[s-2]} < ${n[s-2]} &&\n ${a[s-1]} < ${n[s-1]}) {\n result.b = getValue(${a});\n }\n setOutput(result);\n }\n `}}function pz(e,t,n){const s=e.indexOf(t);return e.map(((e,t)=>t===s?`${e} - ${n}`:e)).join()}function fz(e){const{inputs:t,backend:n}=e,{input:s}=t;return yF({inputs:{x:n.texData.get(s.dataId).complexTensorInfos.imag},backend:n})}const mz={kernelName:$s,backendName:"webgl",kernelFunc:fz};function gz(e,t,n){const s=e[0].dtype;if("complex64"===s){const s=e.map((e=>QB({inputs:{input:e},backend:n}))),r=e.map((e=>fz({inputs:{input:e},backend:n}))),a=gz(s,t,n),i=gz(r,t,n),o=wF({inputs:{real:a,imag:i},backend:n});return s.forEach((e=>n.disposeIntermediateTensorInfo(e))),r.forEach((e=>n.disposeIntermediateTensorInfo(e))),n.disposeIntermediateTensorInfo(a),n.disposeIntermediateTensorInfo(i),o}let r=n.shouldExecuteOnCPU(e);if("string"===s&&(r=!0),r){const r=e.map((e=>{const s=$t(e.shape.slice(t));return zF({inputs:{x:e},backend:n,attrs:{shape:[-1,s]}})})),a=r.map((e=>({vals:n.readSync(e.dataId),shape:e.shape}))),i=_m(r.map((e=>e.shape)),1),o=1===r[0].shape[0],l=ZD(a,i,s,o),u=_m(e.map((e=>e.shape)),t),c=n.makeTensorInfo(u,s,l);return r.forEach((e=>n.disposeIntermediateTensorInfo(e))),c}const a=e.filter((e=>$t(e.shape)>0)),i=Sn().getBool("WEBGL_PACK_ARRAY_OPERATIONS")&&a[0].shape.length>1;if(1===a.length){const t=i?new $M(e[0].shape,eF):new oF(e[0].shape,eF);return n.runWebGLProgram(t,e,s)}const o=Sn().getNumber("WEBGL_MAX_TEXTURES_IN_SHADER");if(a.length>o){const e=[];for(let s=0;se.shape)),t);return n.runWebGLProgram(e,a,s)}const{tensors2D:l,outShape:u}=function(e,t,n){const s=_m(e.map((e=>e.shape)),t),r=e.map((e=>zF({inputs:{x:e},attrs:{shape:[-1,$t(e.shape.slice(t))]},backend:n})));return{tensors2D:r,outShape:s}}(a,t,n),c=new hz(l.map((e=>e.shape))),h=n.runWebGLProgram(c,l,s);l.forEach((e=>n.disposeIntermediateTensorInfo(e)));const d=zF({inputs:{x:h},attrs:{shape:u},backend:n});return n.disposeIntermediateTensorInfo(h),d}function yz(e){const{inputs:t,backend:n,attrs:s}=e,{axis:r}=s,a=en(r,t[0].shape)[0];Em(t.map((e=>e.shape)),a);const i=_m(t.map((e=>e.shape)),a);if(0===$t(i))return n.makeTensorInfo(i,t[0].dtype,[]);const o=t.filter((e=>$t(e.shape)>0));return 1===o.length?yF({inputs:{x:o[0]},backend:n}):gz(o,a,n)}const bz={kernelName:rs,backendName:"webgl",kernelFunc:yz};class wz{constructor(e,t=!1,n=null,s=!1,r=!1){this.variableNames=["x","W"],this.outputShape=e.outShape;const a=e.padInfo.top,i=e.padInfo.left,o=e.strideHeight,l=e.strideWidth,u=e.dilationHeight,c=e.dilationWidth,h=e.filterHeight,d=e.filterWidth,p=4*Math.floor(e.inChannels/4),f=e.inChannels%4,m="channelsLast"===e.dataFormat,g=m?1:2,y=m?2:3,b=m?3:1;let w="",v="";n&&(w=s?`float activation(float a) {\n float b = getPreluActivationWeightsAtOutCoords();\n ${n}\n }`:r?`float activation(float a) {\n float b = getLeakyreluAlphaAtOutCoords();\n ${n}\n }`:`\n float activation(float x) {\n ${n}\n }\n `,v="result = activation(result);");const x=t?"result += getBiasAtOutCoords();":"";t&&this.variableNames.push("bias"),s&&this.variableNames.push("preluActivationWeights"),r&&this.variableNames.push("leakyreluAlpha"),this.userCode=`\n ${w}\n\n const ivec2 strides = ivec2(${o}, ${l});\n const ivec2 pads = ivec2(${a}, ${i});\n\n void main() {\n ivec4 coords = getOutputCoords();\n int batch = coords[0];\n int d2 = coords[${b}];\n\n ivec2 xRCCorner =\n ivec2(coords[${g}], coords[${y}]) * strides - pads;\n int xRCorner = xRCCorner.x;\n int xCCorner = xRCCorner.y;\n\n // Convolve x(?, ?, d1) with w(:, :, d1, d2) to get y(yR, yC, d2).\n // ? = to be determined. : = across all values in that axis.\n float dotProd = 0.0;\n for (int wR = 0; wR < ${h}; wR++) {\n int xR = xRCorner + wR * ${u};\n\n if (xR < 0 || xR >= ${e.inHeight}) {\n continue;\n }\n\n for (int wC = 0; wC < ${d}; wC++) {\n int xC = xCCorner + wC * ${c};\n\n if (xC < 0 || xC >= ${e.inWidth}) {\n continue;\n }\n\n for (int d1 = 0; d1 < ${p}; d1 += 4) {\n vec4 wValues = vec4(\n getW(wR, wC, d1, d2),\n getW(wR, wC, d1 + 1, d2),\n getW(wR, wC, d1 + 2, d2),\n getW(wR, wC, d1 + 3, d2)\n );\n\n if (${m}) {\n vec4 xValues = vec4(\n getX(batch, xR, xC, d1),\n getX(batch, xR, xC, d1 + 1),\n getX(batch, xR, xC, d1 + 2),\n getX(batch, xR, xC, d1 + 3)\n );\n dotProd += dot(xValues, wValues);\n } else {\n vec4 xValues = vec4(\n getX(batch, d1, xR, xC),\n getX(batch, d1 + 1, xR, xC),\n getX(batch, d1 + 2, xR, xC),\n getX(batch, d1 + 3, xR, xC)\n );\n dotProd += dot(xValues, wValues);\n }\n }\n\n if (${1===f}) {\n\n if (${m}) {\n dotProd +=\n getX(batch, xR, xC, ${p}) *\n getW(wR, wC, ${p}, d2);\n } else {\n dotProd +=\n getX(batch, ${p}, xR, xC) *\n getW(wR, wC, ${p}, d2);\n }\n\n } else if (${2===f}) {\n vec2 wValues = vec2(\n getW(wR, wC, ${p}, d2),\n getW(wR, wC, ${p} + 1, d2)\n );\n\n if (${m}) {\n vec2 xValues = vec2(\n getX(batch, xR, xC, ${p}),\n getX(batch, xR, xC, ${p} + 1)\n );\n dotProd += dot(xValues, wValues);\n } else {\n vec2 xValues = vec2(\n getX(batch, ${p}, xR, xC),\n getX(batch, ${p} + 1, xR, xC)\n );\n dotProd += dot(xValues, wValues);\n }\n\n } else if (${3===f}) {\n vec3 wValues = vec3(\n getW(wR, wC, ${p}, d2),\n getW(wR, wC, ${p} + 1, d2),\n getW(wR, wC, ${p} + 2, d2)\n );\n\n if (${m}) {\n vec3 xValues = vec3(\n getX(batch, xR, xC, ${p}),\n getX(batch, xR, xC, ${p} + 1),\n getX(batch, xR, xC, ${p} + 2)\n );\n dotProd += dot(xValues, wValues);\n } else {\n vec3 xValues = vec3(\n getX(batch, ${p}, xR, xC),\n getX(batch, ${p} + 1, xR, xC),\n getX(batch, ${p} + 2, xR, xC)\n );\n dotProd += dot(xValues, wValues);\n }\n\n }\n }\n }\n\n float result = dotProd;\n ${x}\n ${v}\n setOutput(result);\n }\n `}}class vz{constructor(e){this.variableNames=["x","W"],this.outputShape=e.outShape;const t=e.padInfo.front,n=e.padInfo.top,s=e.padInfo.left,r=e.strideDepth,a=e.strideHeight,i=e.strideWidth,o=e.dilationDepth,l=e.dilationHeight,u=e.dilationWidth,c=e.filterDepth,h=e.filterHeight,d=e.filterWidth,p=4*Math.floor(e.inChannels/4),f=e.inChannels%4;this.userCode=`\n const ivec3 strides = ivec3(${r}, ${a}, ${i});\n const ivec3 pads = ivec3(${t}, ${n}, ${s});\n\n void main() {\n ivec5 coords = getOutputCoords();\n int batch = coords.x;\n int d2 = coords.u;\n\n ivec3 xFRCCorner = ivec3(coords.y, coords.z, coords.w) * strides - pads;\n int xFCorner = xFRCCorner.x;\n int xRCorner = xFRCCorner.y;\n int xCCorner = xFRCCorner.z;\n\n // Convolve x(?, ?, ?, d1) with w(:, :, :, d1, d2) to get\n // y(yF, yR, yC, d2). ? = to be determined. : = across all\n // values in that axis.\n float dotProd = 0.0;\n for (int wF = 0; wF < ${c}; wF++) {\n int xF = xFCorner + wF * ${o};\n\n if (xF < 0 || xF >= ${e.inDepth}) {\n continue;\n }\n\n for (int wR = 0; wR < ${h}; wR++) {\n int xR = xRCorner + wR * ${l};\n\n if (xR < 0 || xR >= ${e.inHeight}) {\n continue;\n }\n\n for (int wC = 0; wC < ${d}; wC++) {\n int xC = xCCorner + wC * ${u};\n\n if (xC < 0 || xC >= ${e.inWidth}) {\n continue;\n }\n\n for (int d1 = 0; d1 < ${p}; d1 += 4) {\n vec4 xValues = vec4(\n getX(batch, xF, xR, xC, d1),\n getX(batch, xF, xR, xC, d1 + 1),\n getX(batch, xF, xR, xC, d1 + 2),\n getX(batch, xF, xR, xC, d1 + 3)\n );\n vec4 wValues = vec4(\n getW(wF, wR, wC, d1, d2),\n getW(wF, wR, wC, d1 + 1, d2),\n getW(wF, wR, wC, d1 + 2, d2),\n getW(wF, wR, wC, d1 + 3, d2)\n );\n\n dotProd += dot(xValues, wValues);\n }\n\n if (${1===f}) {\n dotProd +=\n getX(batch, xF, xR, xC, ${p}) *\n getW(wF, wR, wC, ${p}, d2);\n } else if (${2===f}) {\n vec2 xValues = vec2(\n getX(batch, xF, xR, xC, ${p}),\n getX(batch, xF, xR, xC, ${p} + 1)\n );\n vec2 wValues = vec2(\n getW(wF, wR, wC, ${p}, d2),\n getW(wF, wR, wC, ${p} + 1, d2)\n );\n dotProd += dot(xValues, wValues);\n } else if (${3===f}) {\n vec3 xValues = vec3(\n getX(batch, xF, xR, xC, ${p}),\n getX(batch, xF, xR, xC, ${p} + 1),\n getX(batch, xF, xR, xC, ${p} + 2)\n );\n vec3 wValues = vec3(\n getW(wF, wR, wC, ${p}, d2),\n getW(wF, wR, wC, ${p} + 1, d2),\n getW(wF, wR, wC, ${p} + 2, d2)\n );\n dotProd += dot(xValues, wValues);\n }\n }\n }\n }\n setOutput(dotProd);\n }\n `}}class xz{constructor(e,t=!1,n=null,s=!1,r=!1){this.variableNames=["x","W"],this.packedInputs=!0,this.packedOutput=!0,this.customUniforms=[{name:"pads",type:"ivec2"},{name:"strides",type:"ivec2"},{name:"dilations",type:"ivec2"},{name:"inDims",type:"ivec2"}],this.outputShape=e.outShape,this.enableShapeUniforms=SD(this.outputShape.length);const a=e.padInfo.left,i=e.strideWidth,o=e.dilationWidth,l=e.filterHeight,u=e.filterWidth,c=u;let h="\n int xR; int xC; int xCOffset;\n vec4 wTexel; vec4 previous; vec4 final;";for(let e=0;e=0 && xR < inDims[0]) {\n ";for(let t=0;t<(c+1)/2;t++){const n=2*t;if(h+=`\n xC = xCCorner + ${n*o};\n `,1===i){if(n= 0 && xCOffset < inDims[1] && xTexelC${n}Ready == 0) {\n xTexelC${n} = getX(batch, xR, xCOffset, d1);\n\n // Need to manually clear unused channels in case\n // we're reading from recycled texture.\n if (xCOffset + 1 >= inDims[1]) {\n xTexelC${n}.zw = vec2(0.0);\n }\n xTexelC${n}Ready = 1;\n }\n `,h+=1===o&&n>0?`\n xC${n} = vec4(xTexelC${n-2}.zw, xTexelC${n}.xy);\n `:`\n xCOffset = xC + 1 - 2;\n\n if (xCOffset >= 0 && xCOffset < inDims[1]) {\n previous = getX(batch, xR, xCOffset, d1);\n\n // Need to manually clear unused channels in case\n // we're reading from recycled texture.\n if (xCOffset + 1 >= inDims[1]) {\n previous.zw = vec2(0.0);\n }\n\n xC${n} = vec4(previous.zw, xTexelC${n}.xy);\n } else {\n xC${n} = vec4(0.0, 0.0, xTexelC${n}.xy);\n }\n `):h+=`\n if (xC >= 0 && xC < inDims[1] && xTexelC${n}Ready == 0) {\n xTexelC${n} = getX(batch, xR, xC, d1);\n if (xC + 1 >= inDims[1]) {\n xTexelC${n}.zw = vec2(0.0);\n }\n xTexelC${n}Ready = 1;\n }\n\n xC${n} = xTexelC${n};\n `,n+1= 0 && xCOffset < inDims[1] && xTexelC${n+1}Ready == 0) {\n xTexelC${n+1} = getX(batch, xR, xCOffset, d1);\n\n // Need to manually clear unused channels in case\n // we're reading from recycled texture.\n if (xCOffset + 1 >= inDims[1]) {\n xTexelC${n+1}.zw = vec2(0.0);\n }\n xTexelC${n+1}Ready = 1;\n }\n `,h+=o>1?`\n xCOffset -= 2;\n if (xCOffset >= 0 && xCOffset < inDims[1]) {\n previous = getX(batch, xR, xCOffset, d1);\n xC${n+1} = vec4(previous.zw, xTexelC${n+1}.xy);\n } else {\n xC${n+1} = vec4(0.0, 0.0, xTexelC${n+1}.xy);\n }\n `:`\n xC${n+1} = vec4(xTexelC${n}.zw, xTexelC${n+1}.xy);\n `):h+=1===e?`\n xC${n+1} = xTexelC${n};\n `:`\n xCOffset = xC + ${e};\n\n if (xCOffset >= 0 && xCOffset < inDims[1] && xTexelC${n+1}Ready == 0) {\n xTexelC${n+1} = getX(batch, xR, xCOffset, d1);\n if (xCOffset + 1 >= inDims[1]) {\n xTexelC${n+1}.zw = vec2(0.0);\n }\n xTexelC${n+1}Ready = 1;\n }\n\n xC${n+1} = xTexelC${n+1};\n `}}else n= 0 && xCOffset < inDims[1] && xTexelC${n}Ready == 0) {\n xTexelC${n} = getX(batch, xR, xCOffset, d1);\n // Need to manually clear unused channels in case\n // we're reading from recycled texture.\n if (xCOffset + 1 >= inDims[1]) {\n xTexelC${n}.zw = vec2(0.0);\n }\n xTexelC${n}Ready = 1;\n }\n\n if(xC + 1 >= 0 && xC + 1 < inDims[1] && xTexelC${n+1}Ready == 0) {\n xTexelC${n+1} = getX(batch, xR, xC + 1, d1);\n // Need to manually clear unused channels in case\n // we're reading from recycled texture.\n if (xC + 2 >= inDims[1]) {\n xTexelC${n+1}.zw = vec2(0.0);\n }\n xTexelC${n+1}Ready = 1;\n }\n\n xC${n} = vec4(xTexelC${n}.zw, xTexelC${n+1}.zw);\n `,n+1= 0 && xCOffset < inDims[1]) {\n final = getX(batch, xR, xCOffset, d1);\n }\n xC${n+1} = vec4(xTexelC${n+1}.xy, final.xy);\n `)):(h+=`\n if(xC >= 0 && xC < inDims[1] && xTexelC${n}Ready == 0) {\n xTexelC${n} = getX(batch, xR, xC, d1);\n if (xC + 1 >= inDims[1]) {\n xTexelC${n}.zw = vec2(0.0);\n }\n xTexelC${n}Ready = 1;\n }\n\n xCOffset = xC + strides[1];\n if(xCOffset >= 0 && xCOffset < inDims[1] && xTexelC${n+1}Ready == 0) {\n xTexelC${n+1} = getX(batch, xR, xCOffset, d1);\n if (xCOffset + 1 >= inDims[1]) {\n xTexelC${n+1}.zw = vec2(0.);\n }\n xTexelC${n+1}Ready = 1;\n }\n\n xC${n} = vec4(\n xTexelC${n}.xy, xTexelC${n+1}.xy);\n `,n+1= 0) {\n // Use custom imod instead mod. On Intel GPU, mod may generate\n // unexpected value.\n // https://github.com/tensorflow/tfjs/issues/5447\n offsetX = imod(blockIndex, outWidth) * stride[1] - pad[1];\n d1 = offsetX + dilation[1] * (imod(pos, itemsPerBlockRow) /\n inChannels);\n\n if(d1 < inputShape[${i}] && d1 >= 0) {\n\n ch = imod(pos, inChannels);\n\n if (${r}) {\n innerDims = vec2(d1, ch);\n result[${2*e+t}] = getChannel(\n getA(rc.x, d0, int(innerDims.x),\n int(innerDims.y)), innerDims);\n } else {\n innerDims = vec2(d0, d1);\n result[${2*e+t}] = getChannel(\n getA(rc.x, ch, int(innerDims.x),\n int(innerDims.y)), innerDims);\n }\n }\n }\n }\n `;this.userCode=`\n void main() {\n ivec3 rc = getOutputCoords();\n\n vec4 result = vec4(0);\n\n int blockIndex, pos, offsetY, d0, offsetX, d1, ch;\n vec2 innerDims;\n\n ${l}\n\n ${s.output} = result;\n }\n `}}function kz(e,t){const n=e.length;return n>=3?t?[...e.slice(0,-3),e[n-3]*e[n-2],e[n-1]]:[...e.slice(0,-3),e[n-3],e[n-2]*e[n-1]]:!t&&1===n&&e[0]>1?[e[0],1]:null}function Cz({x:e,filter:t,convInfo:n,backend:s,bias:r=null,preluActivationWeights:a=null,leakyreluAlpha:i=0,activation:o=null}){const l=e.shape,u=s.texData.get(e.dataId),c=n.inChannels,h=l[0]*l[1]*l[2],d=n.outChannels,p="channelsLast"===n.dataFormat,f=!1;let m;const g=[];if(null!=a){const e=kz(a.shape,p);null!=e&&(a=zF({inputs:{x:a},backend:s,attrs:{shape:e}}),g.push(a))}if(null!=r){const e=kz(r.shape,p);null!=e&&(r=zF({inputs:{x:r},backend:s,attrs:{shape:e}}),g.push(r))}if(!((1===h||1===d)&&c>XF)&&u.isPacked&&p&&null!=u.texture&&l[2]%2!=0&&Kt(u.shape.slice(-3),l.slice(-3))){const c=l[0]*l[1]*(l[2]+1),h={dataId:e.dataId,shape:[1,c,n.inChannels],dtype:e.dtype},d=u.shape;u.shape=u.shape.slice(),u.shape[u.shape.length-2]++,qt(HR(u.shape,h.shape),(()=>`packed reshape ${u.shape} to ${h.shape} isn't free`));const p=zF({inputs:{x:t},backend:s,attrs:{shape:[1,n.inChannels,n.outChannels]}});g.push(p);const y=ZF({a:h,b:p,backend:s,transposeA:false,transposeB:f,bias:r,activation:o,preluActivationWeights:a,leakyreluAlpha:i}),b=s.texData.get(y.dataId);qt(b.isPacked,(()=>"batchMatMul result is expected to be packed")),u.shape=d,b.shape=n.outShape,m=yF({inputs:{x:y},backend:s}),m.shape=n.outShape,g.push(y)}else{const l=n.outHeight*n.outWidth,u=zF({inputs:{x:e},backend:s,attrs:{shape:p?[n.batchSize,l,n.inChannels]:[n.batchSize,n.inChannels,l]}}),c=zF({inputs:{x:t},backend:s,attrs:{shape:[1,n.inChannels,n.outChannels]}}),h=ZF({a:p?u:c,b:p?c:u,transposeA:!p,transposeB:f,backend:s,bias:r,activation:o,preluActivationWeights:a,leakyreluAlpha:i});m=zF({inputs:{x:h},backend:s,attrs:{shape:n.outShape}}),g.push(u),g.push(c),g.push(h)}for(const e of g)s.disposeIntermediateTensorInfo(e);return m}function Sz({x:e,filter:t,convInfo:n,backend:s,bias:r=null,preluActivationWeights:a=null,leakyreluAlpha:i=0,activation:o=null}){const{filterWidth:l,filterHeight:u,inChannels:c,outWidth:h,outHeight:d,dataFormat:p}=n,f="channelsLast"===p,m=l*u*c,g=d*h,y=[n.batchSize,m,g],b=[];if(null!=a){const e=kz(a.shape,f);null!=e&&(a=zF({inputs:{x:a},backend:s,attrs:{shape:e}}),b.push(a))}if(null!=r){const e=kz(r.shape,f);null!=e&&(r=zF({inputs:{x:r},backend:s,attrs:{shape:e}}),b.push(r))}const w=zF({inputs:{x:t},backend:s,attrs:{shape:[1,m,$t(t.shape)/m]}});b.push(w);const v=new Az(y,n),x=[e.shape,[n.padInfo.top,n.padInfo.left],[n.strideHeight,n.strideWidth],[n.dilationHeight,n.dilationWidth],[n.inChannels],[n.filterWidth*n.inChannels],[n.outWidth]],A=s.runWebGLProgram(v,[e],"float32",x),k=zF({inputs:{x:A},backend:s,attrs:{shape:y}});b.push(A),b.push(k);const C=null!=r,S=null!=a,E="leakyrelu"===o,_=o?NF(o,!0):null,I=new OF(f?k.shape:w.shape,f?w.shape:k.shape,f?[n.batchSize,g,n.outChannels]:[n.batchSize,n.outChannels,g],!0,!1,C,_,S,E),T=f?[k,w]:[w,k];if(r&&T.push(r),S&&T.push(a),E){const e=s.makeTensorInfo([],"float32",di(i,"float32"));T.push(e),b.push(e)}const N=s.runWebGLProgram(I,T,"float32"),O=zF({inputs:{x:N},backend:s,attrs:{shape:n.outShape}});b.push(N);for(const e of b)s.disposeIntermediateTensorInfo(e);return O}const Ez={kernelName:as,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:n,attrs:s}=e,{x:r,filter:a}=t,{strides:i,pad:o,dataFormat:l,dilations:u,dimRoundingMode:c}=s,h=_c(l),d=yc(r.shape,a.shape,i,u,o,c,!1,h);let p;if(1!==d.filterHeight||1!==d.filterWidth||1!==d.dilationHeight||1!==d.dilationWidth||1!==d.strideHeight||1!==d.strideWidth||"SAME"!==d.padInfo.type&&"VALID"!==d.padInfo.type)if(d.strideWidth<=2&&"channelsLast"===h&&Sn().getBool("WEBGL_EXP_CONV")){const e=new xz(d),t=[[d.padInfo.top,d.padInfo.left],[d.strideHeight,d.strideWidth],[d.dilationHeight,d.dilationWidth],[d.inHeight,d.inWidth]];p=n.runWebGLProgram(e,[r,a],"float32",t)}else if(Sn().getBool("WEBGL_CONV_IM2COL"))p=Sz({x:r,filter:a,convInfo:d,backend:n});else{const e=new wz(d);p=n.runWebGLProgram(e,[r,a],"float32")}else p=Cz({x:r,filter:a,convInfo:d,backend:n});const f=zF({inputs:{x:p},backend:n,attrs:{shape:d.outShape}});return n.disposeIntermediateTensorInfo(p),f}};class _z{constructor(e){this.variableNames=["x","dy"],this.outputShape=e.filterShape;const t=e.strideHeight,n=e.strideWidth,s=e.padInfo.top,r=e.padInfo.left,a="channelsLast"===e.dataFormat;this.userCode=`\n void main() {\n ivec4 coords = getOutputCoords();\n int wR = coords.x;\n int wC = coords.y;\n int d1 = coords.z;\n int d2 = coords.w;\n\n // Convolve x(?, ?, d1) with dy(:, :, d2) to get dw(wR, wC, d1, d2).\n // ? = to be determined. : = across all values in that axis.\n float dotProd = 0.0;\n\n for (int b = 0; b < ${e.batchSize}; b++) {\n for (int yR = 0; yR < ${e.outHeight}; yR++) {\n int xR = wR + yR * ${t} - ${s};\n\n if (xR < 0 || xR >= ${e.inHeight}) {\n continue;\n }\n\n for (int yC = 0; yC < ${e.outWidth}; yC++) {\n int xC = wC + yC * ${n} - ${r};\n\n if (xC < 0 || xC >= ${e.inWidth}) {\n continue;\n }\n\n ${a?"float dyValue = getDy(b, yR, yC, d2);\n float xValue = getX(b, xR, xC, d1);\n dotProd += (xValue * dyValue);":"float dyValue = getDy(b, d2, yR, yC);\n float xValue = getX(b, d1, xR, xC);\n dotProd += (xValue * dyValue);"}\n }\n }\n }\n setOutput(dotProd);\n }\n `}}class Iz{constructor(e){this.variableNames=["dy","W"],this.outputShape=e.inShape;const t=e.filterHeight,n=e.filterWidth,s=e.strideHeight,r=e.strideWidth,a="channelsLast"===e.dataFormat,i=t-1-e.padInfo.top,o=n-1-e.padInfo.left,l=a?1:2,u=a?2:3,c=a?3:1;this.userCode=`\n const ivec2 pads = ivec2(${i}, ${o});\n\n void main() {\n ivec4 coords = getOutputCoords();\n int batch = coords[0];\n int d1 = coords[${c}];\n\n ivec2 dyCorner = ivec2(coords[${l}], coords[${u}]) - pads;\n int dyRCorner = dyCorner.x;\n int dyCCorner = dyCorner.y;\n\n // Convolve dy(?, ?, d2) with w(:, :, d1, d2) to compute dx(xR, xC, d1).\n // ? = to be determined. : = across all values in that axis.\n float dotProd = 0.0;\n for (int wR = 0; wR < ${t}; wR++) {\n float dyR = float(dyRCorner + wR) / ${s}.0;\n\n if (dyR < 0.0 || dyR >= ${e.outHeight}.0 || fract(dyR) > 0.0) {\n continue;\n }\n int idyR = int(dyR);\n\n int wRPerm = ${t} - 1 - wR;\n\n for (int wC = 0; wC < ${n}; wC++) {\n float dyC = float(dyCCorner + wC) / ${r}.0;\n\n if (dyC < 0.0 || dyC >= ${e.outWidth}.0 ||\n fract(dyC) > 0.0) {\n continue;\n }\n int idyC = int(dyC);\n\n int wCPerm = ${n} - 1 - wC;\n\n for (int d2 = 0; d2 < ${e.outChannels}; d2++) {\n\n if (${a}) {\n float xValue = getDy(batch, idyR, idyC, d2);\n float wValue = getW(wRPerm, wCPerm, d1, d2);\n dotProd += xValue * wValue;\n } else {\n float xValue = getDy(batch, d2, idyR, idyC);\n float wValue = getW(wRPerm, wCPerm, d1, d2);\n dotProd += xValue * wValue;\n }\n\n }\n }\n }\n setOutput(dotProd);\n }\n `}}class Tz{constructor(e){this.variableNames=["x","dy"],this.outputShape=e.filterShape;const t=e.strideDepth,n=e.strideHeight,s=e.strideWidth,r=e.padInfo.front,a=e.padInfo.top,i=e.padInfo.left;this.userCode=`\n void main() {\n ivec5 coords = getOutputCoords();\n int wF = coords.x;\n int wR = coords.y;\n int wC = coords.z;\n int d1 = coords.w;\n int d2 = coords.u;\n\n float dotProd = 0.0;\n\n for (int b = 0; b < ${e.batchSize}; b++) {\n for (int yF = 0; yF < ${e.outDepth}; yF++) {\n int xF = wF + yF * ${t} - ${r};\n\n if (xF < 0 || xF >= ${e.inDepth}) {\n continue;\n }\n\n for (int yR = 0; yR < ${e.outHeight}; yR++) {\n int xR = wR + yR * ${n} - ${a};\n\n if (xR < 0 || xR >= ${e.inHeight}) {\n continue;\n }\n\n for (int yC = 0; yC < ${e.outWidth}; yC++) {\n int xC = wC + yC * ${s} - ${i};\n\n if (xC < 0 || xC >= ${e.inWidth}) {\n continue;\n }\n\n float dyValue = getDy(b, yF, yR, yC, d2);\n float xValue = getX(b, xF, xR, xC, d1);\n dotProd += (xValue * dyValue);\n }\n }\n }\n }\n setOutput(dotProd);\n }\n `}}class Nz{constructor(e){this.variableNames=["dy","W"],this.outputShape=e.inShape;const t=e.filterDepth,n=e.filterHeight,s=e.filterWidth,r=e.strideDepth,a=e.strideHeight,i=e.strideWidth,o=t-1-e.padInfo.front,l=n-1-e.padInfo.top,u=s-1-e.padInfo.left;this.userCode=`\n const ivec3 pads = ivec3(${o}, ${l}, ${u});\n\n void main() {\n ivec5 coords = getOutputCoords();\n int batch = coords.x;\n int d1 = coords.u;\n\n\n ivec3 dyCorner = ivec3(coords.y, coords.z, coords.w) - pads;\n int dyFCorner = dyCorner.x;\n int dyRCorner = dyCorner.y;\n int dyCCorner = dyCorner.z;\n\n float dotProd = 0.0;\n for (int wF = 0; wF < ${t}; wF++) {\n float dyF = float(dyFCorner + wF) / ${r}.0;\n\n if (dyF < 0.0 || dyF >= ${e.outDepth}.0 || fract(dyF) > 0.0) {\n continue;\n }\n int idyF = int(dyF);\n\n int wFPerm = ${t} - 1 - wF;\n\n for (int wR = 0; wR < ${n}; wR++) {\n float dyR = float(dyRCorner + wR) / ${a}.0;\n\n if (dyR < 0.0 || dyR >= ${e.outHeight}.0 ||\n fract(dyR) > 0.0) {\n continue;\n }\n int idyR = int(dyR);\n\n int wRPerm = ${n} - 1 - wR;\n\n for (int wC = 0; wC < ${s}; wC++) {\n float dyC = float(dyCCorner + wC) / ${i}.0;\n\n if (dyC < 0.0 || dyC >= ${e.outWidth}.0 ||\n fract(dyC) > 0.0) {\n continue;\n }\n int idyC = int(dyC);\n\n int wCPerm = ${s} - 1 - wC;\n\n for (int d2 = 0; d2 < ${e.outChannels}; d2++) {\n float xValue = getDy(batch, idyF, idyR, idyC, d2);\n float wValue = getW(wFPerm, wRPerm, wCPerm, d1, d2);\n dotProd += xValue * wValue;\n }\n }\n }\n }\n setOutput(dotProd);\n }\n `}}const Oz={kernelName:is,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:n,attrs:s}=e,{x:r,dy:a}=t,{strides:i,pad:o,dataFormat:l,dimRoundingMode:u,filterShape:c}=s,h=_c(l),d=yc(r.shape,c,i,1,o,u,!1,h),p=new _z(d);return n.runWebGLProgram(p,[r,a],"float32")}};class Rz{constructor(e){this.variableNames=["dy","W"],this.packedInputs=!0,this.packedOutput=!0,this.customUniforms=[{name:"strides",type:"vec2"}],this.outputShape=e.inShape,this.enableShapeUniforms=SD(this.outputShape.length);const t=e.filterHeight,n=e.filterWidth,s=t-1-e.padInfo.top,r=n-1-e.padInfo.left;this.userCode=`\n const ivec2 pads = ivec2(${s}, ${r});\n\n void main() {\n ivec4 coords = getOutputCoords();\n int batch = coords[0];\n int d1 = coords[3];\n\n ivec2 dyCorner = ivec2(coords[1], coords[2]) - pads;\n int dyRCorner = dyCorner.x;\n int dyCCorner = dyCorner.y;\n\n vec4 result = vec4(0.);\n for (int wR = 0; wR < ${t}; wR++) {\n float dyR = float(dyRCorner + wR) / strides[0];\n if (dyR < 0.0 || dyR >= ${e.outHeight}.0 || fract(dyR) > 0.0) {\n continue;\n }\n int idyR = int(dyR);\n int wRPerm = ${t} - 1 - wR;\n\n for (int wC = 0; wC < ${n}; wC++) {\n int wCPerm = ${n} - 1 - wC;\n\n float dyC = float(dyCCorner + wC) / strides[1];\n bool idyCVal = (dyC >= 0.0) && (dyC < ${e.outWidth}.0)\n && (fract(dyC) == 0.0);\n int idyC = int(dyC);\n\n float dyC2 = float(dyCCorner + wC + 1) / strides[1];\n bool idyCVal2 = (dyC2 >= 0.0) && (dyC2 < ${e.outWidth}.0)\n && (fract(dyC2) == 0.0);\n int idyC2 = int(dyC2);\n\n if (idyCVal && idyCVal2) {\n for (int d2 = 0; d2 < ${e.outChannels}; d2 += 2) {\n vec4 wValue = getW(wRPerm, wCPerm, d1, d2);\n vec4 dySample = getDy(batch, idyR, idyC, d2);\n vec4 dySample2 = (idyC / 2 == idyC2 / 2) ?\n dySample : getDy(batch, idyR, idyC2, d2);\n\n vec2 dyValue = mod(float(idyC), 2.) == 0. ?\n dySample.xy : dySample.zw;\n result.xy += vec2(dot(dyValue, wValue.xy),\n dot(dyValue, wValue.zw));\n\n dyValue = mod(float(idyC2), 2.) == 0. ?\n dySample2.xy : dySample2.zw;\n result.zw += vec2(dot(dyValue, wValue.xy),\n dot(dyValue, wValue.zw));\n }\n } else if (idyCVal) {\n for (int d2 = 0; d2 < ${e.outChannels}; d2 += 2) {\n vec4 wValue = getW(wRPerm, wCPerm, d1, d2);\n vec4 dySample = getDy(batch, idyR, idyC, d2);\n vec2 dyValue = mod(float(idyC), 2.) == 0. ?\n dySample.xy : dySample.zw;\n result.xy += vec2(dot(dyValue, wValue.xy),\n dot(dyValue, wValue.zw));\n }\n } else if (idyCVal2) {\n for (int d2 = 0; d2 < ${e.outChannels}; d2 += 2) {\n vec4 wValue = getW(wRPerm, wCPerm, d1, d2);\n vec4 dySample = getDy(batch, idyR, idyC2, d2);\n vec2 dyValue = mod(float(idyC2), 2.) == 0. ?\n dySample.xy : dySample.zw;\n result.zw += vec2(dot(dyValue, wValue.xy),\n dot(dyValue, wValue.zw));\n }\n }\n }\n }\n setOutput(result);\n }\n `}}const Dz={kernelName:os,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:n,attrs:s}=e,{dy:r,filter:a}=t,{inputShape:i,strides:o,pad:l,dataFormat:u,dimRoundingMode:c}=s,h=_c(u),d=yc(i,a.shape,o,1,l,c,!1,h);if(Sn().getBool("WEBGL_PACK_CONV2DTRANSPOSE")&&"channelsLast"===h){const e=[[d.strideHeight,d.strideWidth]],t=new Rz(d);return n.runWebGLProgram(t,[r,a],"float32",e)}{const e=new Iz(d);return n.runWebGLProgram(e,[r,a],"float32")}}};const Mz={kernelName:ls,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:n,attrs:s}=e,{x:r,filter:a}=t,{strides:i,pad:o,dilations:l}=s,u=bc(r.shape,a.shape,i,l,o),c=new vz(u);return n.runWebGLProgram(c,[r,a],"float32")}};const Fz={kernelName:us,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:n,attrs:s}=e,{x:r,dy:a}=t,{strides:i,pad:o,filterShape:l}=s,u=bc(r.shape,l,i,1,o),c=new Tz(u);return n.runWebGLProgram(c,[r,a],"float32")}};const Bz={kernelName:cs,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:n,attrs:s}=e,{dy:r,filter:a}=t,{pad:i,strides:o,inputShape:l}=s,u=bc(l,a.shape,o,1,i),c=new Nz(u);return n.runWebGLProgram(c,[r,a],"float32")}},zz=IF({opSnippet:_F+"\n return cos(x);\n",packedOpSnippet:`\n vec4 result = cos(x);\n bvec4 isNaN = isnan(x);\n ${mF}\n return result;\n`}),Lz={kernelName:hs,backendName:"webgl",kernelFunc:zz},Pz=IF({opSnippet:"\n float e2x = exp(-x);\n return (e2x + 1.0 / e2x) / 2.0;\n"}),Vz={kernelName:ds,backendName:"webgl",kernelFunc:Pz};class Wz{constructor(e,t,n,s,r){this.variableNames=["Image","Boxes","BoxInd"],this.outputShape=[];const[a,i,o,l]=e,[u]=t,[c,h]=n;this.outputShape=[u,c,h,l];const d="bilinear"===s?1:0,[p,f]=[i-1+".0",o-1+".0"],[m,g,y]=c>1?[""+(i-1)/(c-1),"(y2-y1) * height_ratio",`y1*${p} + float(y)*(height_scale)`]:["0.0","0.0",`0.5 * (y1+y2) * ${p}`],[b,w,v]=h>1?[""+(o-1)/(h-1),"(x2-x1) * width_ratio",`x1*${f} + float(x)*(width_scale)`]:["0.0","0.0",`0.5 * (x1+x2) * ${f}`];this.userCode=`\n const float height_ratio = float(${m});\n const float width_ratio = float(${b});\n void main() {\n ivec4 coords = getOutputCoords();\n int b = coords[0];\n int y = coords[1];\n int x = coords[2];\n int d = coords[3];\n\n // get box vals\n float y1 = getBoxes(b,0);\n float x1 = getBoxes(b,1);\n float y2 = getBoxes(b,2);\n float x2 = getBoxes(b,3);\n\n // get image in batch index\n int bInd = round(getBoxInd(b));\n if(bInd < 0 || bInd >= ${a}) {\n return;\n }\n\n float height_scale = ${g};\n float width_scale = ${w};\n\n float in_y = ${y};\n if( in_y < 0.0 || in_y > ${p} ) {\n setOutput(float(${r}));\n return;\n }\n float in_x = ${v};\n if( in_x < 0.0 || in_x > ${f} ) {\n setOutput(float(${r}));\n return;\n }\n\n vec2 sourceFracIndexCR = vec2(in_x,in_y);\n if(${d} == 1) {\n // Compute the four integer indices.\n ivec2 sourceFloorCR = ivec2(sourceFracIndexCR);\n ivec2 sourceCeilCR = ivec2(ceil(sourceFracIndexCR));\n\n float topLeft = getImage(b, sourceFloorCR.y, sourceFloorCR.x, d);\n float bottomLeft = getImage(b, sourceCeilCR.y, sourceFloorCR.x, d);\n float topRight = getImage(b, sourceFloorCR.y, sourceCeilCR.x, d);\n float bottomRight = getImage(b, sourceCeilCR.y, sourceCeilCR.x, d);\n\n vec2 fracCR = sourceFracIndexCR - vec2(sourceFloorCR);\n\n float top = topLeft + (topRight - topLeft) * fracCR.x;\n float bottom = bottomLeft + (bottomRight - bottomLeft) * fracCR.x;\n float newValue = top + (bottom - top) * fracCR.y;\n setOutput(newValue);\n } else {\n // Compute the coordinators of nearest neighbor point.\n ivec2 sourceNearestCR = ivec2(floor(\n sourceFracIndexCR + vec2(0.5,0.5)));\n float newValue = getImage(b, sourceNearestCR.y, sourceNearestCR.x, d);\n setOutput(newValue);\n }\n }\n `}}const Uz={kernelName:ms,backendName:"webgl",kernelFunc:e=>{const{inputs:t,backend:n,attrs:s}=e,{image:r,boxes:a,boxInd:i}=t,{cropSize:o,method:l,extrapolationValue:u}=s,c=new Wz(r.shape,a.shape,o,l,u);return n.runWebGLProgram(c,[r,a,i],"float32")}};var Gz;!function(e){e.Prod="*",e.Sum="+"}(Gz||(Gz={}));class qz{constructor(e,t,n,s){this.op=e,this.outputShape=t,this.variableNames=["x"],this.customUniforms=[{name:"index",type:"float"}];const r=this.outputShape.length,a=this.op===Gz.Prod?"1.0":"0.0",i=n?a:`getX(${jz(r,"coords",this.op)})`,o=this.outputShape[this.outputShape.length-1];let l="",u="";n?(l=s?"end != "+(o-1):"end != 0",u=s?"end + 1":"end - 1"):(l=s?`end + pow2 < ${o}`:"end >= pow2",u=s?"end + pow2":"end - pow2"),this.userCode=`\n void main() {\n ${bD(r)} coords = getOutputCoords();\n int end = ${Hz(r,"coords",this.op)};\n float val = ${i};\n int pow2 = int(pow(2.0, index));\n if (${l}) {\n int idx = ${u};\n ${Hz(r,"coords",this.op)} = idx;\n val ${this.op}= getX(${jz(r,"coords",this.op)});\n }\n setOutput(val);\n }\n `}}function jz(e,t,n){if(1===e)return`${t}`;if(2===e)return`${t}.x, ${t}.y`;if(3===e)return`${t}.x, ${t}.y, ${t}.z`;if(4===e)return`${t}.x, ${t}.y, ${t}.z, ${t}.w`;throw new Error(`Cumulative ${n} for rank ${e} is not yet supported`)}function Hz(e,t,n){if(1===e)return`${t}`;if(2===e)return`${t}.y`;if(3===e)return`${t}.z`;if(4===e)return`${t}.w`;throw new Error(`Cumulative ${n} for rank ${e} is not yet supported`)}function $z(e,t,n,s,r,a){const i=t.shape.length,o=Ih([s],i);let l=t;null!=o&&(l=$F({inputs:{x:t},backend:n,attrs:{perm:o}}));const u=Nh(1,i)[0];if(u!==i-1)throw new Error(`WebGL cumprod shader expects an inner-most axis=${t.shape.length-1} but got axis=${s}`);const c=l.shape[u];let h=yF({inputs:{x:l},backend:n});for(let t=0;t<=Math.ceil(Math.log2(c))-1;t++){const s=new qz(e,l.shape,!1,a),r=[[t]],i=h;h=n.runWebGLProgram(s,[h],h.dtype,r),n.disposeIntermediateTensorInfo(i)}if(r){const t=new qz(e,l.shape,r,a),s=h;h=n.runWebGLProgram(t,[h],h.dtype),n.disposeIntermediateTensorInfo(s)}if(null!=o){const e=$F({inputs:{x:h},backend:n,attrs:{perm:Th(o)}});return n.disposeIntermediateTensorInfo(h),n.disposeIntermediateTensorInfo(l),e}return h}const Kz={kernelName:ps,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:n,attrs:s}=e,{x:r}=t,{axis:a,exclusive:i,reverse:o}=s;return $z(Gz.Prod,r,n,a,i,o)}};const Xz={kernelName:fs,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:n,attrs:s}=e,{x:r}=t,{axis:a,exclusive:i,reverse:o}=s;return $z(Gz.Sum,r,n,a,i,o)}};const Zz={kernelName:gs,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:n,attrs:s}=e,{x:r,weights:a}=t,{size:i,binaryOutput:o}=s;if(1===r.shape.length){const e=n.readSync(r.dataId),t=n.readSync(a.dataId),s=jD(e,t,a.dtype,a.shape,i);return n.makeTensorInfo([i],a.dtype,s)}if(2===r.shape.length){const e=n.bufferSync(r),t=n.bufferSync(a),s=HD(e,t,i,o);return n.makeTensorInfo(s.shape,a.dtype,s.values)}throw new Error(`Error in denseBincount: input must be at most rank 2, but got rank${r.shape.length}.`)}};class Yz{constructor(e,t,n){this.variableNames=["x"],this.outputShape=[],this.outputShape=e,this.blockSize=t,this.dataFormat=n,this.userCode=`\n void main() {\n ivec4 coords = getOutputCoords();\n int b = coords[0];\n int h = ${this.getHeightCoordString()};\n int w = ${this.getWidthCoordString()};\n int d = ${this.getDepthCoordString()};\n\n int in_h = h / ${t};\n int offset_h = imod(h, ${t});\n int in_w = w / ${t};\n int offset_w = imod(w, ${t});\n int offset_d = (offset_h * ${t} + offset_w) *\n ${this.getOutputDepthSize()};\n int in_d = d + offset_d;\n\n float result = ${this.getInputSamplingString()};\n setOutput(result);\n }\n `}getHeightCoordString(){return"NHWC"===this.dataFormat?"coords[1]":"coords[2]"}getWidthCoordString(){return"NHWC"===this.dataFormat?"coords[2]":"coords[3]"}getDepthCoordString(){return"NHWC"===this.dataFormat?"coords[3]":"coords[1]"}getOutputDepthSize(){return"NHWC"===this.dataFormat?this.outputShape[3]:this.outputShape[1]}getInputSamplingString(){return"NHWC"===this.dataFormat?"getX(b, in_h, in_w, in_d)":"getX(b, in_d, in_h, in_w)"}}const Qz={kernelName:ys,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:n,attrs:s}=e,{x:r}=t,{blockSize:a,dataFormat:i}=s,o=r.shape[0],l=("NHWC"===i?r.shape[1]:r.shape[2])*a,u=("NHWC"===i?r.shape[2]:r.shape[3])*a,c=("NHWC"===i?r.shape[3]:r.shape[1])/(a*a),h=new Yz("NHWC"===i?[o,l,u,c]:[o,c,l,u],a,i);return n.runWebGLProgram(h,[r],r.dtype)}};class Jz{constructor(e,t=!1,n=null,s=!1,r=!1){this.variableNames=["x","W"],this.customUniforms=[{name:"pads",type:"ivec2"},{name:"strides",type:"ivec2"},{name:"dilations",type:"ivec2"},{name:"inDims",type:"ivec2"}],this.outputShape=e.outShape,this.enableShapeUniforms=SD(this.outputShape.length);const a=e.filterHeight,i=e.filterWidth,o=e.outChannels/e.inChannels;let l="",u="";n&&(l=s?`float activation(float a) {\n float b = getPreluActivationWeightsAtOutCoords();\n ${n}\n }`:r?`float activation(float a) {\n float b = getLeakyreluAlphaAtOutCoords();\n ${n}\n }`:`\n float activation(float x) {\n ${n}\n }\n `,u="result = activation(result);");const c=t?"result += getBiasAtOutCoords();":"";t&&this.variableNames.push("bias"),s&&this.variableNames.push("preluActivationWeights"),r&&this.variableNames.push("leakyreluAlpha"),this.userCode=`\n ${l}\n\n void main() {\n ivec4 coords = getOutputCoords();\n int batch = coords.x;\n ivec2 xRCCorner = coords.yz * strides - pads;\n int d2 = coords.w;\n int d1 = d2 / ${o};\n int q = d2 - d1 * ${o};\n\n int xRCorner = xRCCorner.x;\n int xCCorner = xRCCorner.y;\n\n // Convolve x(?, ?, d1) with w(:, :, d1, q) to get y(yR, yC, d2).\n // ? = to be determined. : = across all values in that axis.\n float dotProd = 0.0;\n // TO DO(dsmilkov): Flatten the two for loops and vec4 the operations.\n for (int wR = 0; wR < ${a}; wR++) {\n int xR = xRCorner + wR * dilations[0];\n\n if (xR < 0 || xR >= inDims[0]) {\n continue;\n }\n\n for (int wC = 0; wC < ${i}; wC++) {\n int xC = xCCorner + wC * dilations[1];\n\n if (xC < 0 || xC >= inDims[1]) {\n continue;\n }\n\n float xVal = getX(batch, xR, xC, d1);\n float wVal = getW(wR, wC, d1, q);\n dotProd += xVal * wVal;\n }\n }\n\n float result = dotProd;\n ${c}\n ${u}\n setOutput(result);\n }\n `}}class eL{constructor(e,t=!1,n=null,s=!1,r=!1){this.variableNames=["x","W"],this.packedInputs=!0,this.packedOutput=!0,this.customUniforms=[{name:"pads",type:"ivec2"},{name:"strides",type:"ivec2"},{name:"dilations",type:"ivec2"},{name:"inDims",type:"ivec2"}],this.outputShape=e.outShape,this.enableShapeUniforms=SD(this.outputShape.length);const a=e.outChannels/e.inChannels,i=e.padInfo.left,o=e.strideWidth,l=e.dilationWidth,u=e.filterHeight,c=e.filterWidth,h=c;let d="\n int xR; int xC; int xCOffset;\n vec4 wTexel; vec4 previous; vec4 final;";for(let e=0;e=0 && xR < inDims[0]) {\n ";for(let e=0;e<(h+1)/2;e++){const t=2*e;if(d+=`\n xC = xCCorner + ${t*l};\n `,1===o){if(t= 0 && xCOffset < inDims[1] && xTexelC${t}Ready == 0) {\n xTexelC${t} = getX(batch, xR, xCOffset, d1);\n\n // Need to manually clear unused channels in case\n // we're reading from recycled texture.\n if (xCOffset + 1 >= inDims[1]) {\n xTexelC${t}.zw = vec2(0.0);\n }\n xTexelC${t}Ready = 1;\n }\n `,d+=1===l&&t>0?`\n xC${t} = vec4(xTexelC${t-2}.zw, xTexelC${t}.xy);\n `:`\n xCOffset = xC + 1 - 2;\n\n if (xCOffset >= 0 && xCOffset < inDims[1]) {\n previous = getX(batch, xR, xCOffset, d1);\n\n // Need to manually clear unused channels in case\n // we're reading from recycled texture.\n if (xCOffset + 1 >= inDims[1]) {\n previous.zw = vec2(0.0);\n }\n\n xC${t} = vec4(previous.zw, xTexelC${t}.xy);\n } else {\n xC${t} = vec4(0.0, 0.0, xTexelC${t}.xy);\n }\n `):d+=`\n if (xC >= 0 && xC < inDims[1] && xTexelC${t}Ready == 0) {\n xTexelC${t} = getX(batch, xR, xC, d1);\n if (xC + 1 >= inDims[1]) {\n xTexelC${t}.zw = vec2(0.0);\n }\n xTexelC${t}Ready = 1;\n }\n\n xC${t} = xTexelC${t};\n `,t+1= 0 && xCOffset < inDims[1] && xTexelC${t+1}Ready == 0) {\n xTexelC${t+1} = getX(batch, xR, xCOffset, d1);\n\n // Need to manually clear unused channels in case\n // we're reading from recycled texture.\n if (xCOffset + 1 >= inDims[1]) {\n xTexelC${t+1}.zw = vec2(0.0);\n }\n xTexelC${t+1}Ready = 1;\n }\n `,d+=l>1?`\n xCOffset -= 2;\n if (xCOffset >= 0 && xCOffset < inDims[1]) {\n previous = getX(batch, xR, xCOffset, d1);\n xC${t+1} = vec4(previous.zw, xTexelC${t+1}.xy);\n } else {\n xC${t+1} = vec4(0.0, 0.0, xTexelC${t+1}.xy);\n }\n `:`\n xC${t+1} = vec4(xTexelC${t}.zw, xTexelC${t+1}.xy);\n `):d+=1===e?`\n xC${t+1} = xTexelC${t};\n `:`\n xCOffset = xC + ${e};\n\n if (xCOffset >= 0 && xCOffset < inDims[1] && xTexelC${t+1}Ready == 0) {\n xTexelC${t+1} = getX(batch, xR, xCOffset, d1);\n if (xCOffset + 1 >= inDims[1]) {\n xTexelC${t+1}.zw = vec2(0.0);\n }\n xTexelC${t+1}Ready = 1;\n }\n\n xC${t+1} = xTexelC${t+1};\n `}}else t= 0 && xCOffset < inDims[1] && xTexelC${t}Ready == 0) {\n xTexelC${t} = getX(batch, xR, xCOffset, d1);\n // Need to manually clear unused channels in case\n // we're reading from recycled texture.\n if (xCOffset + 1 >= inDims[1]) {\n xTexelC${t}.zw = vec2(0.0);\n }\n xTexelC${t}Ready = 1;\n }\n\n if(xC + 1 >= 0 && xC + 1 < inDims[1] && xTexelC${t+1}Ready == 0) {\n xTexelC${t+1} = getX(batch, xR, xC + 1, d1);\n // Need to manually clear unused channels in case\n // we're reading from recycled texture.\n if (xC + 2 >= inDims[1]) {\n xTexelC${t+1}.zw = vec2(0.0);\n }\n xTexelC${t+1}Ready = 1;\n }\n\n xC${t} = vec4(xTexelC${t}.zw, xTexelC${t+1}.zw);\n `,t+1= 0 && xCOffset < inDims[1]) {\n final = getX(batch, xR, xCOffset, d1);\n }\n xC${t+1} = vec4(xTexelC${t+1}.xy, final.xy);\n `)):(d+=`\n if(xC >= 0 && xC < inDims[1] && xTexelC${t}Ready == 0) {\n xTexelC${t} = getX(batch, xR, xC, d1);\n if (xC + 1 >= inDims[1]) {\n xTexelC${t}.zw = vec2(0.0);\n }\n xTexelC${t}Ready = 1;\n }\n\n xCOffset = xC + strides[1];\n if(xCOffset >= 0 && xCOffset < inDims[1] && xTexelC${t+1}Ready == 0) {\n xTexelC${t+1} = getX(batch, xR, xCOffset, d1);\n if (xCOffset + 1 >= inDims[1]) {\n xTexelC${t+1}.zw = vec2(0.);\n }\n xTexelC${t+1}Ready = 1;\n }\n\n xC${t} = vec4(\n xTexelC${t}.xy, xTexelC${t+1}.xy);\n `,t+1`Error in depthwiseConv2d: Either strides or dilations must be 1. Got strides ${i} and dilations '${c}'`));const h=yc(r.shape,a.shape,i,c,o,u,!0);let d;d=Sn().getBool("WEBGL_PACK_DEPTHWISECONV")&&h.strideWidth<=2&&h.outChannels/h.inChannels==1?new eL(h):new Jz(h);const p=[[h.padInfo.top,h.padInfo.left],[h.strideHeight,h.strideWidth],[h.dilationHeight,h.dilationWidth],[h.inHeight,h.inWidth]];return n.runWebGLProgram(d,[r,a],"float32",p)}};class nL{constructor(e){this.variableNames=["x","dy"],this.outputShape=e.filterShape;const t=e.strideHeight,n=e.strideWidth,s=e.padInfo.top,r=e.padInfo.left,a=e.outChannels/e.inChannels;this.userCode=`\n void main() {\n ivec4 coords = getOutputCoords();\n int wR = coords.x;\n int wC = coords.y;\n int d1 = coords.z;\n int dm = coords.w;\n int d2 = d1 * ${a} + dm;\n\n float dotProd = 0.0;\n\n // TO DO: Vec4 over the batch size\n for (int b = 0; b < ${e.batchSize}; b++) {\n for (int yR = 0; yR < ${e.outHeight}; yR++) {\n int xR = wR + yR * ${t} - ${s};\n\n if (xR < 0 || xR >= ${e.inHeight}) {\n continue;\n }\n\n for (int yC = 0; yC < ${e.outWidth}; yC++) {\n int xC = wC + yC * ${n} - ${r};\n\n if (xC < 0 || xC >= ${e.inWidth}) {\n continue;\n }\n\n float dyValue = getDy(b, yR, yC, d2);\n float xValue = getX(b, xR, xC, d1);\n dotProd += (xValue * dyValue);\n }\n }\n }\n setOutput(dotProd);\n }\n `}}class sL{constructor(e){this.variableNames=["dy","W"],this.outputShape=e.inShape;const t=e.filterHeight,n=e.filterWidth,s=e.strideHeight,r=e.strideWidth,a=t-1-e.padInfo.top,i=n-1-e.padInfo.left,o=e.outChannels/e.inChannels;this.userCode=`\n const ivec2 pads = ivec2(${a}, ${i});\n\n void main() {\n ivec4 coords = getOutputCoords();\n int batch = coords[0];\n int d1 = coords[3];\n ivec2 dyCorner = coords.yz - pads;\n int dyRCorner = dyCorner.x;\n int dyCCorner = dyCorner.y;\n\n float dotProd = 0.0;\n\n for (int wR = 0; wR < ${t}; wR++) {\n float dyR = float(dyRCorner + wR) / ${s}.0;\n\n if (dyR < 0.0 || dyR >= ${e.outHeight}.0 || fract(dyR) > 0.0) {\n continue;\n }\n int idyR = int(dyR);\n\n int wRPerm = ${t} - 1 - wR;\n\n for (int wC = 0; wC < ${n}; wC++) {\n float dyC = float(dyCCorner + wC) / ${r}.0;\n\n if (dyC < 0.0 || dyC >= ${e.outWidth}.0 ||\n fract(dyC) > 0.0) {\n continue;\n }\n int idyC = int(dyC);\n\n int wCPerm = ${n} - 1 - wC;\n\n // TO DO: Vec4 over the channelMul\n for (int dm = 0; dm < ${o}; dm++) {\n int d2 = d1 * ${o} + dm;\n float xValue = getDy(batch, idyR, idyC, d2);\n float wValue = getW(wRPerm, wCPerm, d1, dm);\n dotProd += xValue * wValue;\n }\n }\n }\n setOutput(dotProd);\n }\n `}}const rL={kernelName:ws,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:n,attrs:s}=e,{x:r,dy:a}=t,{strides:i,dilations:o,pad:l,dimRoundingMode:u,filterShape:c}=s,h=yc(r.shape,c,i,o,l,u,!0),d=new nL(h);return n.runWebGLProgram(d,[r,a],"float32")}};const aL={kernelName:vs,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:n,attrs:s}=e,{dy:r,filter:a}=t,{strides:i,dilations:o,pad:l,dimRoundingMode:u,inputShape:c}=s,h=yc(c,a.shape,i,o,l,u,!0),d=new sL(h);return n.runWebGLProgram(d,[r,a],"float32")}};class iL{constructor(e){this.variableNames=["X"],this.outputShape=[e,e],this.userCode="\n void main() {\n ivec2 coords = getOutputCoords();\n float val = coords[0] == coords[1] ? getX(coords[0]) : 0.0;\n setOutput(val);\n }\n "}}const oL={kernelName:xs,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:n}=e,{x:s}=t,r=[...s.shape,...s.shape],a=$t(s.shape),i=zF({inputs:{x:s},backend:n,attrs:{shape:[a]}}),o=new iL(a),l=n.runWebGLProgram(o,[i],i.dtype),u=zF({inputs:{x:l},backend:n,attrs:{shape:r}});return n.disposeIntermediateTensorInfo(i),n.disposeIntermediateTensorInfo(l),u}};class lL{constructor(e){this.variableNames=["x","W"],this.outputShape=e.outShape;const{inHeight:t,inWidth:n,padInfo:s,strideHeight:r,strideWidth:a,filterHeight:i,filterWidth:o,dilationHeight:l,dilationWidth:u}=e,{top:c,left:h}=s;this.userCode=`\n const ivec2 strides = ivec2(${r}, ${a});\n const ivec2 pads = ivec2(${c}, ${h});\n const float neg_infinity = -3.4e38;\n\n void main() {\n ivec4 coords = getOutputCoords();\n int batch = coords.x;\n int d1 = coords.w;\n ivec2 outTopLeftCorner =\n coords.yz * strides - pads;\n int hBeg = outTopLeftCorner.x;\n int wBeg = outTopLeftCorner.y;\n\n float curVal = neg_infinity;\n for (int h = 0; h < ${i}; h++) {\n int hIn = hBeg + h * ${l};\n\n if (hIn >= 0 && hIn < ${t}) {\n for (int w = 0; w < ${o}; w++) {\n int wIn = wBeg + w * ${u};\n\n if (wIn >= 0 && wIn < ${n}) {\n float xVal = getX(batch, hIn, wIn, d1);\n float wVal = getW(h, w, d1);\n\n float val = xVal + wVal;\n if (val > curVal) {\n curVal = val;\n }\n }\n }\n }\n }\n\n float result = curVal;\n setOutput(result);\n }\n `}}const uL={kernelName:As,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:n,attrs:s}=e,{x:r,filter:a}=t,{strides:i,pad:o,dilations:l}=s,u=fc(r.shape,a.shape,i,o,"NHWC",l);let c;const h=new lL(u);c=n.runWebGLProgram(h,[r,a],"float32");const d=zF({inputs:{x:c},backend:n,attrs:{shape:u.outShape}});return n.disposeIntermediateTensorInfo(c),d}};const cL={kernelName:_s,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:n,attrs:s}=e,{equation:r}=s,a=t,{allDims:i,summedDims:o,idDims:l}=lg(r,a.length);cg(i.length,l,a);const{path:u,steps:c}=hg(o,l),h=c.length;let d=null,p=i.length;const f=[];for(let e=0;e=0&&(d=jF({inputs:{x:d},backend:n,attrs:{axis:u[e]-(i.length-p),keepDims:!1}}),f.push(d)),p--)}for(const e of f)e!==d&&n.disposeIntermediateTensorInfo(e);return d}},hL=IF({opSnippet:"return (x >= 0.0) ? x : (exp(x) - 1.0);",packedOpSnippet:"\n vec4 result;\n\n result.r = (x.r >= 0.0) ? x.r : (exp(x.r) - 1.0);\n result.g = (x.g >= 0.0) ? x.g : (exp(x.g) - 1.0);\n result.b = (x.b >= 0.0) ? x.b : (exp(x.b) - 1.0);\n result.a = (x.a >= 0.0) ? x.a : (exp(x.a) - 1.0);\n\n return result;\n"}),dL={kernelName:Is,backendName:"webgl",kernelFunc:hL},pL={kernelName:Ts,backendName:"webgl",kernelFunc:e=>{const{inputs:t,backend:n}=e,{dy:s,y:r}=t,a=Sn().getBool("WEBGL_PACK_BINARY_OPERATIONS")?new gF("\n vec4 bGTEZero = vec4(greaterThanEqual(b, vec4(0.)));\n return (bGTEZero * a) + ((vec4(1.0) - bGTEZero) * (a * (b + vec4(1.0))));\n",s.shape,r.shape):new fF("return (b >= 0.0) ? a : a * (b + 1.0);",s.shape,r.shape);return n.runWebGLProgram(a,[s,r],s.dtype)}},fL=TF({opSnippet:"return float(a == b);",packedOpSnippet:"\n return vec4(equal(a, b));\n",dtype:"bool",cpuKernelImpl:YD}),mL={kernelName:Os,backendName:"webgl",kernelFunc:fL},gL=IF({opSnippet:`\n // Error function is calculated approximately with elementary function.\n // See "Handbook of Mathematical Functions with Formulas,\n // Graphs, and Mathematical Tables", Abramowitz and Stegun.\n float p = ${qm};\n float a1 = ${jm};\n float a2 = ${Hm};\n float a3 = ${$m};\n float a4 = ${Km};\n float a5 = ${Xm};\n\n float sign = sign(x);\n x = abs(x);\n float t = 1.0 / (1.0 + p * x);\n return sign * (1.0 - (((((a5*t + a4)*t) + a3)*t + a2)*t + a1)*t*exp(-x*x));\n`}),yL={kernelName:Ns,backendName:"webgl",kernelFunc:gL},bL=IF({opSnippet:_F+"\n return exp(x);\n",packedOpSnippet:"\n vec4 result = exp(x);\n bvec4 isNaN = isnan(x);\n result.r = isNaN.r ? x.r : result.r;\n result.g = isNaN.g ? x.g : result.g;\n result.b = isNaN.b ? x.b : result.b;\n result.a = isNaN.a ? x.a : result.a;\n\n return result;\n",cpuKernelImpl:QD,dtype:"float32"}),wL={kernelName:Rs,backendName:"webgl",kernelFunc:bL};function vL(e){const{inputs:t,attrs:n,backend:s}=e,{dim:r}=n,{input:a}=t,i=a.shape.length,o=a.shape.slice();let l=r;return r<0&&(qt(-(i+1)<=r,(()=>`Axis must be in the interval [${-(i+1)}, ${i}]`)),l=i+r+1),o.splice(l,0,1),zF({inputs:{x:a},backend:s,attrs:{shape:o}})}const xL={kernelName:Ds,backendName:"webgl",kernelFunc:vL},AL="return exp(x) - 1.0;",kL=IF({opSnippet:AL,packedOpSnippet:AL,cpuKernelImpl:JD}),CL={kernelName:Ms,backendName:"webgl",kernelFunc:kL};class SL{constructor(e,t,n){this.variableNames=["real","imag"];const s=t[1];this.outputShape=t;const r=n?`2.0 * ${Math.PI}`:`-2.0 * ${Math.PI}`,a=n?`${s}.0`:"1.0";let i;if("real"===e)i="return real * expR - imag * expI;";else{if("imag"!==e)throw new Error(`FFT component must be either "real" or "imag", got ${e}.`);i="return real * expI + imag * expR;"}this.userCode=`\n const float exponentMultiplier = ${r};\n\n float unaryOpComplex(float real, float expR, float imag, float expI) {\n ${i}\n }\n\n float mulMatDFT(int batch, int index) {\n float indexRatio = float(index) / float(${s});\n float exponentMultiplierTimesIndexRatio =\n exponentMultiplier * indexRatio;\n\n float result = 0.0;\n\n for (int i = 0; i < ${s}; i++) {\n // x = (-2|2 * PI / N) * index * i;\n float x = exponentMultiplierTimesIndexRatio * float(i);\n float expR = cos(x);\n float expI = sin(x);\n float real = getReal(batch, i);\n float imag = getImag(batch, i);\n\n result +=\n unaryOpComplex(real, expR, imag, expI) / ${a};\n }\n\n return result;\n }\n\n void main() {\n ivec2 coords = getOutputCoords();\n setOutput(mulMatDFT(coords[0], coords[1]));\n }\n `}}function EL(e,t,n){const s=n.texData.get(e.dataId),r=$t(e.shape),a=e.shape[e.shape.length-1],i=zF({inputs:{x:e},backend:n,attrs:{shape:[r/a,a]}}),o=i.shape,l=new SL("real",o,t),u=new SL("imag",o,t),c=[{dataId:s.complexTensorInfos.real.dataId,dtype:s.complexTensorInfos.real.dtype,shape:o},{dataId:s.complexTensorInfos.imag.dataId,dtype:s.complexTensorInfos.imag.dtype,shape:o}],h=n.runWebGLProgram(l,c,"float32"),d=n.runWebGLProgram(u,c,"float32"),p=wF({inputs:{real:h,imag:d},backend:n});n.disposeIntermediateTensorInfo(h),n.disposeIntermediateTensorInfo(d);const f=zF({inputs:{x:p},backend:n,attrs:{shape:e.shape}});return n.disposeIntermediateTensorInfo(i),n.disposeIntermediateTensorInfo(p),f}const _L={kernelName:Fs,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:n}=e,{input:s}=t;return EL(s,!1,n)}};class IL{constructor(e,t){this.outputShape=[],this.customUniforms=[{name:"value",type:"float"}],this.variableNames=["x"],this.outputShape=e,this.userCode="\n void main() {\n // Input can be obtained from uniform value.\n setOutput(value);\n }\n "}}function TL(e){const{backend:t,attrs:n}=e,{shape:s,value:r}=n;let{dtype:a}=n;if(a=a||un(r),"string"===a){const e=sn(a,$t(s));return e.fill(r),t.makeTensorInfo(s,a,e)}{const e=new IL(s,r),n=[[r]];return t.runWebGLProgram(e,[],a,n)}}const NL={kernelName:Bs,backendName:"webgl",kernelFunc:TL};class OL{constructor(e){this.variableNames=["Image"],this.outputShape=[];const t=e[2];this.outputShape=e,this.userCode=`\n void main() {\n ivec4 coords = getOutputCoords();\n int x = coords[2];\n\n int coordX = ${t} - x - 1;\n float outputValue;\n if(coordX >= 0 && coordX < ${t}) {\n outputValue = getImage(coords[0], coords[1], coordX, coords[3]);\n } else {\n outputValue = getImage(coords[0], coords[1], coords[2], coords[3]);\n }\n setOutput(outputValue);\n }\n `}}const RL={kernelName:zs,backendName:"webgl",kernelFunc:({inputs:e,backend:t})=>{const{image:n}=e,s=t,r=new OL(n.shape);return s.runWebGLProgram(r,[n],n.dtype)}},DL="return floor(x);",ML=IF({opSnippet:DL,packedOpSnippet:DL,cpuKernelImpl:eM}),FL={kernelName:Ls,backendName:"webgl",kernelFunc:ML},BL=TF({opSnippet:"\n float s = sign(a) * sign(b);\n int ia = round(a);\n int ib = round(b);\n if (ib != 0) {\n // Windows (D3D) wants guaranteed non-zero int division at compile-time.\n return float(idiv(ia, ib, s));\n } else {\n return NAN;\n }\n",packedOpSnippet:"\n ivec4 ia = round(a);\n ivec4 ib = round(b);\n bvec4 cond = notEqual(ib, ivec4(0));\n ivec4 result = ivec4(0);\n vec4 s = sign(a) * sign(b);\n\n // Windows (D3D) wants guaranteed non-zero int division at compile-time.\n if (cond[0]) {\n result[0] = idiv(ia[0], ib[0], s[0]);\n }\n if (cond[1]) {\n result[1] = idiv(ia[1], ib[1], s[1]);\n }\n if (cond[2]) {\n result[2] = idiv(ia[2], ib[2], s[2]);\n }\n if (cond[3]) {\n result[3] = idiv(ia[3], ib[3], s[3]);\n }\n return vec4(result);\n",dtype:"int32"}),zL={kernelName:Ps,backendName:"webgl",kernelFunc:BL};class LL{constructor(e){this.variableNames=["A"];const t=tD(),[n,s]=e;this.outputShape=e,this.userCode=`\n void main() {\n ivec3 coords = getOutputCoords();\n int texR = coords[0];\n int texC = coords[1];\n int depth = coords[2];\n vec2 uv = (vec2(texC, texR) + halfCR) / vec2(${s}.0, ${n}.0);\n\n vec4 values = ${t.texture2D}(A, uv);\n float value;\n if (depth == 0) {\n value = values.r;\n } else if (depth == 1) {\n value = values.g;\n } else if (depth == 2) {\n value = values.b;\n } else if (depth == 3) {\n value = values.a;\n }\n\n setOutput(floor(value * 255.0 + 0.5));\n }\n `}}class PL{constructor(e){this.variableNames=["A"],this.packedInputs=!1,this.packedOutput=!0;const t=tD(),[n,s]=e;this.outputShape=e,this.userCode=`\n void main() {\n ivec3 coords = getOutputCoords();\n int texR = coords[0];\n int texC = coords[1];\n int depth = coords[2];\n\n vec4 result = vec4(0.);\n\n for(int row=0; row<=1; row++) {\n for(int col=0; col<=1; col++) {\n texC = coords[1] + row;\n depth = coords[2] + col;\n\n vec2 uv = (vec2(texC, texR) + halfCR) /\n vec2(${s}.0, ${n}.0);\n vec4 values = ${t.texture2D}(A, uv);\n float value;\n if (depth == 0) {\n value = values.r;\n } else if (depth == 1) {\n value = values.g;\n } else if (depth == 2) {\n value = values.b;\n } else if (depth == 3) {\n value = values.a;\n }\n\n result[row * 2 + col] = floor(value * 255.0 + 0.5);\n }\n }\n\n ${t.output} = result;\n }\n `}}const VL={kernelName:Ba,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:n,attrs:s}=e;let{pixels:r}=t;const{numChannels:a}=s,i="undefined"!=typeof HTMLVideoElement&&r instanceof HTMLVideoElement,o="undefined"!=typeof HTMLImageElement&&r instanceof HTMLImageElement,[l,u]=i?[r.videoWidth,r.videoHeight]:[r.width,r.height],c=[u,l],h=[u,l,a];if(o||i){const e=Sn().getBool("CANVAS2D_WILL_READ_FREQUENTLY_FOR_GPU");null!=WL&&e===UL||(UL=e,WL=document.createElement("canvas").getContext("2d",{willReadFrequently:UL})),WL.canvas.width=l,WL.canvas.height=u,WL.drawImage(r,0,0,l,u),r=WL.canvas}const d=n.makeTensorInfo(c,"int32");n.texData.get(d.dataId).usage=kR.PIXELS,n.gpgpu.uploadPixelDataToTexture(n.getTexture(d.dataId),r);const p=Sn().getBool("WEBGL_PACK")?new PL(h):new LL(h),f=n.runWebGLProgram(p,[d],"int32");return n.disposeData(d.dataId),f}};let WL,UL=Sn().getBool("CANVAS2D_WILL_READ_FREQUENTLY_FOR_GPU");const GL={kernelName:Pa,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:n,attrs:s}=e,{x:r,filter:a,bias:i,preluActivationWeights:o}=t,{strides:l,pad:u,dataFormat:c,dilations:h,dimRoundingMode:d,activation:p,leakyreluAlpha:f}=s,m=_c(c),g=yc(r.shape,a.shape,l,h,u,d,!1,m);let y;const b=[],w=null!=i,v=null!=o,x="leakyrelu"===p,A=()=>{const e=[r,a],t=(e,t)=>{if("NCHW"===t&&1===e.shape.length&&1!==e.shape[0]){const t=zF({inputs:{x:e},backend:n,attrs:{shape:[e.shape[0],1,1]}});return b.push(t),t}return e};if(w&&e.push(t(i,c)),v&&e.push(t(o,c)),x){const t=n.makeTensorInfo([],"float32",di(f,"float32"));e.push(t),b.push(t)}return e};if(1!==g.filterHeight||1!==g.filterWidth||1!==g.dilationHeight||1!==g.dilationWidth||1!==g.strideHeight||1!==g.strideWidth||"SAME"!==g.padInfo.type&&"VALID"!==g.padInfo.type)if(g.strideWidth<=2&&"channelsLast"===m&&Sn().getBool("WEBGL_EXP_CONV")){const e=p?NF(p,!0):null,t=new xz(g,w,e,v,x),s=[[g.padInfo.top,g.padInfo.left],[g.strideHeight,g.strideWidth],[g.dilationHeight,g.dilationWidth],[g.inHeight,g.inWidth]],r=A();y=n.runWebGLProgram(t,r,"float32",s)}else if(Sn().getBool("WEBGL_CONV_IM2COL"))y=Sz({x:r,filter:a,convInfo:g,backend:n,bias:i,activation:p,preluActivationWeights:o,leakyreluAlpha:f});else{const e=p?NF(p,!1):null,t=new wz(g,w,e,v,x),s=A();y=n.runWebGLProgram(t,s,"float32")}else y=Cz({x:r,filter:a,convInfo:g,backend:n,bias:i,activation:p,preluActivationWeights:o,leakyreluAlpha:f});const k=zF({inputs:{x:y},backend:n,attrs:{shape:g.outShape}});return b.push(y),b.forEach((e=>n.disposeIntermediateTensorInfo(e))),k}};const qL={kernelName:Va,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:n,attrs:s}=e,{x:r,filter:a,bias:i,preluActivationWeights:o}=t,{strides:l,pad:u,dilations:c,dimRoundingMode:h,activation:d,leakyreluAlpha:p}=s,f=[];let m=c;null==m&&(m=[1,1]),qt(Sc(l,m),(()=>`Error in depthwiseConv2d: Either strides or dilations must be 1. Got strides ${l} and dilations '${m}'`));const g=yc(r.shape,a.shape,l,m,u,h,!0),y=Sn().getBool("WEBGL_PACK_DEPTHWISECONV")&&g.strideWidth<=2&&g.outChannels/g.inChannels==1,b=d?NF(d,y):null,w=[r,a],v=null!=i,x=null!=o,A="leakyrelu"===d;if(v&&w.push(i),x&&w.push(o),A){const e=n.makeTensorInfo([],"float32",di(p,"float32"));w.push(e),f.push(e)}let k;k=y?new eL(g,v,b,x,A):new Jz(g,v,b,x,A);const C=[[g.padInfo.top,g.padInfo.left],[g.strideHeight,g.strideWidth],[g.dilationHeight,g.dilationWidth],[g.inHeight,g.inWidth]],S=n.runWebGLProgram(k,w,"float32",C);return f.forEach((e=>n.disposeIntermediateTensorInfo(e))),S}};class jL{constructor(e,t,n,s){this.sliceDim=e,this.strides=t,this.paramsShape=s,this.variableNames=["x","indices"],this.outputShape=n;const r=bD(n.length);let a="\n int index;";for(let e=0;e= ${this.paramsShape[e]};\n flattenIndex += index * ${this.strides[e]};`;this.userCode=`\n void main() {\n ${r} coords = getOutputCoords();\n int flattenIndex = 0;\n bool out_of_bounds = false;\n\n ${a}\n\n setOutput(out_of_bounds ? 0.0 : getX(flattenIndex, coords[1]));\n }\n `}}const HL={kernelName:Us,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:n}=e,{params:s,indices:r}=t,a=r.shape,i=a[a.length-1],o=$t(s.shape),[l,u,c,h]=Wm(s,r),d=zF({inputs:{x:r},backend:n,attrs:{shape:[u,i]}}),p=zF({inputs:{x:s},backend:n,attrs:{shape:[$t(s.shape)/c,c]}});if(n.shouldExecuteOnCPU([s,r])||"string"===s.dtype){const e=n.readSync(r.dataId),t=n.bufferSync(s),a=tM(e,t,s.dtype,u,i,c,h,s.shape,o);return n.makeTensorInfo(l,s.dtype,a.values)}const f=new jL(i,h,[u,c],s.shape),m=n.runWebGLProgram(f,[p,d],p.dtype),g=zF({inputs:{x:m},backend:n,attrs:{shape:l}});return n.disposeIntermediateTensorInfo(d),n.disposeIntermediateTensorInfo(p),n.disposeIntermediateTensorInfo(m),g}};class $L{constructor(e,t){this.variableNames=["A","indices"],this.outputShape=t,this.rank=t.length;const n=bD(this.rank),s=function(e,t){const n=["resRC.x","resRC.y","resRC.z","resRC.w"],s=[];for(let t=0;t= 0) && (index < ${e[2]}) ? 1.0 : 0.0;\n setOutput(inBounds * getA(${s}));\n }\n `}}function KL(e){const{inputs:t,backend:n,attrs:s}=e,{x:r,indices:a}=t,{axis:i,batchDims:o}=s,l=en(i,r.shape)[0];if(Sn().get("DEBUG")){const e=n.readSync(a.dataId),t=r.shape[l];for(let n=0;n=0,(()=>`GatherV2: the index value ${s} is not in [0, ${t-1}]`))}}const u=Tg(r,a,l,o),c=$t(a.shape),h=[],d=zF({inputs:{x:r},backend:n,attrs:{shape:[u.batchSize,u.outerSize,u.dimSize,u.sliceSize]}}),p=zF({inputs:{x:a},backend:n,attrs:{shape:[u.batchSize,c/u.batchSize]}});h.push(d),h.push(p);const f=[u.batchSize,u.outerSize,c/u.batchSize,u.sliceSize];if(n.shouldExecuteOnCPU([r,a])||"string"===r.dtype){const e=n.bufferSync(p),t=n.bufferSync(d),s=nM(t,e,f);return h.forEach((e=>n.disposeIntermediateTensorInfo(e))),n.makeTensorInfo(u.outputShape,s.dtype,s.values)}const m=new $L(d.shape,f),g=n.runWebGLProgram(m,[d,p],d.dtype);h.push(g);const y=zF({inputs:{x:g},backend:n,attrs:{shape:u.outputShape}});return h.forEach((e=>n.disposeIntermediateTensorInfo(e))),y}const XL={kernelName:Ws,backendName:"webgl",kernelFunc:KL},ZL=TF({opSnippet:"return float(a > b);",packedOpSnippet:"\n return vec4(greaterThan(a, b));\n",cpuKernelImpl:sM,dtype:"bool"}),YL={kernelName:Gs,backendName:"webgl",kernelFunc:ZL},QL=TF({opSnippet:"return float(a >= b);",packedOpSnippet:"\n return vec4(greaterThanEqual(a, b));\n",dtype:"bool",cpuKernelImpl:rM}),JL={kernelName:qs,backendName:"webgl",kernelFunc:QL};const eP={kernelName:Hs,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:n}=e,{input:s}=t;return EL(s,!0,n)}},tP=IF({opSnippet:"return float(!isnan(x) && !isinf(x));",dtype:"bool"}),nP={kernelName:Ks,backendName:"webgl",kernelFunc:tP},sP=IF({opSnippet:"return float(isinf(x));",dtype:"bool"}),rP={kernelName:Xs,backendName:"webgl",kernelFunc:sP},aP=IF({opSnippet:"return float(isnan(x));",dtype:"bool"}),iP={kernelName:Zs,backendName:"webgl",kernelFunc:aP},oP=TF({opSnippet:"return float(a < b);",packedOpSnippet:"\n return vec4(lessThan(a, b));\n",cpuKernelImpl:aM,dtype:"bool"}),lP={kernelName:Qs,backendName:"webgl",kernelFunc:oP},uP=TF({opSnippet:"return float(a <= b);",packedOpSnippet:"\n return vec4(lessThanEqual(a, b));\n",cpuKernelImpl:iM,dtype:"bool"}),cP={kernelName:Js,backendName:"webgl",kernelFunc:uP};const hP={kernelName:er,backendName:"webgl",kernelFunc:function(e){const{backend:t,attrs:n}=e,{start:s,stop:r,num:a}=n,i=oM(s,r,a);return t.makeTensorInfo([i.length],"float32",i)}},dP=IF({opSnippet:_F+"\n return x < 0.0 ? 0./0. : log(x);\n",packedOpSnippet:"\n vec4 result = log(x);\n bvec4 isNaN = isnan(x);\n result.r = isNaN.r ? x.r : (x.r < 0.0 ? 0./0. : result.r);\n result.g = isNaN.g ? x.g : (x.g < 0.0 ? 0./0. : result.g);\n result.b = isNaN.b ? x.b : (x.b < 0.0 ? 0./0. : result.b);\n result.a = isNaN.a ? x.a : (x.a < 0.0 ? 0./0. : result.a);\n return result;\n",cpuKernelImpl:lM}),pP={kernelName:tr,backendName:"webgl",kernelFunc:dP},fP=IF({opSnippet:_F+"\n return log(1.0 + x);\n"}),mP={kernelName:nr,backendName:"webgl",kernelFunc:fP},gP=TF({opSnippet:"return float(a >= 1.0 && b >= 1.0);",packedOpSnippet:"\n return vec4(\n vec4(greaterThanEqual(a, vec4(1.0))) *\n vec4(greaterThanEqual(b, vec4(1.0))));\n",dtype:"bool"}),yP={kernelName:sr,backendName:"webgl",kernelFunc:gP},bP=IF({opSnippet:"return float(!(x >= 1.0));"}),wP={kernelName:rr,backendName:"webgl",kernelFunc:bP},vP=TF({opSnippet:"return float(a >= 1.0 || b >= 1.0);",packedOpSnippet:"\n return min(\n vec4(greaterThanEqual(a, vec4(1.0))) +\n vec4(greaterThanEqual(b, vec4(1.0))),\n vec4(1.0));\n",dtype:"bool"}),xP={kernelName:ar,backendName:"webgl",kernelFunc:vP};class AP{constructor(e,t,n,s,r){this.variableNames=["x"],this.outputShape=[];const a=t,i=e[3]-1;let o;this.outputShape=e;const l=`float(${n}) + float(${s}) * sum`;o=.5===r?`inversesqrt(${l})`:1===r?`1.0/(${l})`:`exp(log(${l}) * float(-${r}));`,this.userCode=`\n void main() {\n ivec4 coords = getOutputCoords();\n int b = coords[0];\n int r = coords[1];\n int c = coords[2];\n int d = coords[3];\n float x = getX(b, r, c, d);\n float sum = 0.0;\n for (int j = -${a}; j <= ${a}; j++) {\n int idx = d + j;\n if (idx >= 0 && idx <= ${i}) {\n float z = getX(b, r, c, idx);\n sum += z * z;\n }\n }\n float val = x * ${o};\n setOutput(val);\n }\n `}}class kP{constructor(e,t,n,s,r){this.variableNames=["x"],this.outputShape=[],this.packedInputs=!0,this.packedOutput=!0;const a=t,i=e[3]-1;let o;this.outputShape=e;const l=`float(${n}) + float(${s}) * sum`;o=.5===r?`inversesqrt(${l})`:1===r?`1.0/(${l})`:`exp(log(${l}) * float(-${r}));`,this.userCode=`\n void main() {\n ivec4 coords = getOutputCoords();\n int b = coords.x;\n int r = coords.y;\n int c = coords.z;\n int d = coords.w;\n\n bool hasNextCol = d < ${this.outputShape[3]};\n bool hasNextRow = c < ${this.outputShape[2]};\n\n vec4 sum = vec4(0.);\n vec4 xFragAtOutputCoords = getX(b, r, c, d);\n\n vec4 xAtOutputCoords = vec4(\n getChannel(xFragAtOutputCoords, vec2(c, d)),\n hasNextCol ?\n getChannel(xFragAtOutputCoords, vec2(c, d + 1)) : 0.0,\n hasNextRow ?\n getChannel(xFragAtOutputCoords , vec2(c + 1, d)) : 0.0,\n (hasNextRow && hasNextCol) ?\n getChannel(xFragAtOutputCoords, vec2(c + 1, d + 1)) : 0.0\n );\n\n int firstChannel = d - ${a};\n vec2 cache = vec2(0.);\n if(firstChannel >= 0){\n vec4 firstChannelFrag = getX(b, r, c, firstChannel);\n cache.x = getChannel(firstChannelFrag, vec2(c, firstChannel));\n if(hasNextRow){\n cache.y = getChannel(firstChannelFrag, vec2(c + 1, firstChannel));\n }\n }\n\n ivec2 depth = ivec2(d, d + 1);\n for (int j = - ${a}; j <= ${a}; j++) {\n ivec2 idx = depth + j;\n bvec2 aboveLowerBound = greaterThanEqual(idx, ivec2(0));\n bvec2 belowUpperBound = lessThanEqual(idx, ivec2(${i}));\n\n bool depthInRange = aboveLowerBound.x && belowUpperBound.x;\n bool depthPlusOneInRange = aboveLowerBound.y && belowUpperBound.y;\n\n if(depthInRange || depthPlusOneInRange){\n vec4 z = vec4(0.);\n vec4 xFragAtCurrentDepth;\n z.xz = cache.xy;\n if(depthPlusOneInRange && hasNextCol){\n xFragAtCurrentDepth = idx.y != d ?\n getX(b, r, c, idx.y) : xFragAtOutputCoords;\n z.y = getChannel(xFragAtCurrentDepth, vec2(c, idx.y));\n if(hasNextRow){\n z.w = getChannel(xFragAtCurrentDepth, vec2(c + 1, idx.y));\n }\n }\n cache.xy = z.yw;\n sum += z * z;\n }\n }\n vec4 result = xAtOutputCoords * ${o};\n setOutput(result);\n }\n `}}const CP={kernelName:ir,backendName:"webgl",kernelFunc:e=>{const{inputs:t,backend:n,attrs:s}=e,{x:r}=t,{depthRadius:a,bias:i,alpha:o,beta:l}=s,u=Sn().getBool("WEBGL_PACK_NORMALIZATION")?new kP(r.shape,a,i,o,l):new AP(r.shape,a,i,o,l);return n.runWebGLProgram(u,[r],r.dtype)}};class SP{constructor(e,t,n,s,r){this.variableNames=["inputImage","outputImage","dy"],this.outputShape=[],this.outputShape=e,this.depth=e[3],this.depthRadius=t,this.bias=n,this.alpha=s,this.beta=r,this.userCode=`\n void main() {\n ivec4 coords = getOutputCoords();\n int b = coords[0];\n int r = coords[1];\n int c = coords[2];\n\n float result = 0.0;\n for (int d = 0; d < ${this.depth}; ++d) {\n int depthBegin = int(max(0.0, float(d - ${t})));\n int depthEnd = int(min(float(${this.depth}),\n float(d + ${t} + 1)));\n\n const int MIN_DEPTH_BEGIN = 0;\n const int MAX_DEPTH_END = ${this.depth};\n\n float norm = 0.0;\n for (int k = MIN_DEPTH_BEGIN; k < MAX_DEPTH_END; ++k) {\n if (k < depthBegin){\n continue;\n }\n else if (k >= depthBegin && k < depthEnd) {\n norm += getInputImage(b, r, c, k) * getInputImage(b, r, c, k);\n }\n else {\n break;\n }\n }\n\n norm = float(${s}) * norm + float(${n});\n\n for(int k = MIN_DEPTH_BEGIN; k < MAX_DEPTH_END; ++k){\n if (k < depthBegin){\n continue;\n }\n else if (k >= depthBegin && k < depthEnd){\n float dyi = -2.0 * float(${s})\n * float(${r})\n * getInputImage(b, r, c, k) * getOutputImage(b, r, c, d)\n / norm;\n if (k == d) {\n dyi += pow(norm, -1.0 * ${r});\n }\n if (k == coords[3]) {\n dyi *= getDy(b, r, c, d);\n result += dyi;\n }\n }\n else {\n break;\n }\n }\n }\n setOutput(result);\n }\n `}}const EP={kernelName:or,backendName:"webgl",kernelFunc:e=>{const{inputs:t,backend:n,attrs:s}=e,{x:r,y:a,dy:i}=t,{depthRadius:o,bias:l,alpha:u,beta:c}=s,h=new SP(r.shape,o,l,u,c);return n.runWebGLProgram(h,[r,a,i],r.dtype)}};function _P(e){const{inputs:t,backend:n,attrs:s}=e,{x:r}=t,{reductionIndices:a,keepDims:i}=s,o=r.shape.length,l=en(a,r.shape);let u=l;const c=Ih(u,o),h=null!=c,d=n.shouldExecuteOnCPU([r]);let p=r;if(h){if(d){const e=n.texData.get(p.dataId).values,t=new Array(o);for(let e=0;e`Error in maxPool: Either strides or dilations must be 1. Got strides ${i} and dilations '1'`));const u=mc(r.shape,a,i,1,o,l);if(1===u.filterWidth&&1===u.filterHeight&&Kt(u.inShape,u.outShape))return yF({inputs:{x:r},backend:n});const c=new TB(u,"max",!1);return n.runWebGLProgram(c,[r],r.dtype)}};const RP={kernelName:dr,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:n,attrs:s}=e,{x:r}=t,{filterSize:a,strides:i,pad:o,dataFormat:l,dimRoundingMode:u}=s,c=gc(r.shape,a,i,[1,1,1],o,u,l),h=new NB(c,"max",!1);return n.runWebGLProgram(h,[r],r.dtype)}};class DP{constructor(e){this.variableNames=["dy","maxPos"],this.outputShape=e.inShape;const t=e.strideHeight,n=e.strideWidth,s=e.dilationHeight,r=e.effectiveFilterHeight,a=e.effectiveFilterWidth,i=r-1-e.padInfo.top,o=a-1-e.padInfo.left,l=r*a-1;this.userCode=`\n const ivec2 pads = ivec2(${i}, ${o});\n\n void main() {\n ivec4 coords = getOutputCoords();\n int b = coords[0];\n int d = coords[3];\n\n ivec2 dyRCCorner = coords.yz - pads;\n int dyRCorner = dyRCCorner.x;\n int dyCCorner = dyRCCorner.y;\n\n // Convolve dy(?, ?, d) with pos mask(:, :, d) to get dx(xR, xC, d).\n // ? = to be determined. : = across all values in that axis.\n float dotProd = 0.0;\n for (int wR = 0; wR < ${r};\n wR += ${s}) {\n float dyR = float(dyRCorner + wR) / ${t}.0;\n\n if (dyR < 0.0 || dyR >= ${e.outHeight}.0 || fract(dyR) > 0.0) {\n continue;\n }\n int idyR = int(dyR);\n\n for (int wC = 0; wC < ${a}; wC++) {\n float dyC = float(dyCCorner + wC) / ${n}.0;\n\n if (dyC < 0.0 || dyC >= ${e.outWidth}.0 ||\n fract(dyC) > 0.0) {\n continue;\n }\n int idyC = int(dyC);\n\n float dyValue = getDy(b, idyR, idyC, d);\n int maxPosValue = ${l} - int(getMaxPos(b, idyR, idyC, d));\n\n // Get the current value, check it against the value from the\n // position matrix.\n int curPosValue = wR * ${a} + wC;\n float mask = float(maxPosValue == curPosValue ? 1.0 : 0.0);\n\n dotProd += dyValue * mask;\n }\n }\n setOutput(dotProd);\n }\n `}}class MP{constructor(e){this.variableNames=["dy","maxPos"],this.outputShape=e.inShape;const t=e.strideDepth,n=e.strideHeight,s=e.strideWidth,r=e.dilationDepth,a=e.dilationHeight,i=e.dilationWidth,o=e.effectiveFilterDepth,l=e.effectiveFilterHeight,u=e.effectiveFilterWidth,c=o-1-e.padInfo.front,h=l-1-e.padInfo.top,d=u-1-e.padInfo.left,p=o*l*u-1;this.userCode=`\n const ivec3 pads = ivec3(${c}, ${h}, ${d});\n\n void main() {\n ivec5 coords = getOutputCoords();\n int batch = coords.x;\n int ch = coords.u;\n\n ivec3 dyCorner = ivec3(coords.y, coords.z, coords.w) - pads;\n int dyDCorner = dyCorner.x;\n int dyRCorner = dyCorner.y;\n int dyCCorner = dyCorner.z;\n\n // Convolve dy(?, ?, ?, ch) with pos mask(:, :, :, d) to get\n // dx(xD, xR, xC, ch).\n // ? = to be determined. : = across all values in that axis.\n float dotProd = 0.0;\n\n for (int wD = 0; wD < ${o};\n wD += ${r}) {\n float dyD = float(dyDCorner + wD) / ${t}.0;\n\n if (dyD < 0.0 || dyD >= ${e.outDepth}.0 || fract(dyD) > 0.0) {\n continue;\n }\n int idyD = int(dyD);\n\n for (int wR = 0; wR < ${l};\n wR += ${a}) {\n float dyR = float(dyRCorner + wR) / ${n}.0;\n\n if (dyR < 0.0 || dyR >= ${e.outHeight}.0 ||\n fract(dyR) > 0.0) {\n continue;\n }\n int idyR = int(dyR);\n\n for (int wC = 0; wC < ${u};\n wC += ${i}) {\n float dyC = float(dyCCorner + wC) / ${s}.0;\n\n if (dyC < 0.0 || dyC >= ${e.outWidth}.0 ||\n fract(dyC) > 0.0) {\n continue;\n }\n int idyC = int(dyC);\n\n float dyValue = getDy(batch, idyD, idyR, idyC, ch);\n int maxPosValue = ${p} -\n int(getMaxPos(batch, idyD, idyR, idyC, ch));\n\n // Get the current value, check it against the value from the\n // position matrix.\n int curPosValue =\n wD * ${l} * ${u} +\n wR * ${u} + wC;\n float mask = float(maxPosValue == curPosValue ? 1.0 : 0.0);\n\n dotProd += dyValue * mask;\n }\n }\n }\n setOutput(dotProd);\n }\n `}}const FP={kernelName:pr,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:n,attrs:s}=e,{dy:r,input:a}=t,i=a,{filterSize:o,strides:l,pad:u,dimRoundingMode:c}=s,h=gc(i.shape,o,l,[1,1,1],u,c),d=new NB(h,"max",!0),p=n.runWebGLProgram(d,[i],i.dtype),f=new MP(h),m=n.runWebGLProgram(f,[r,p],i.dtype);return n.disposeIntermediateTensorInfo(p),m}};const BP={kernelName:hr,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:n,attrs:s}=e,{dy:r,input:a,output:i}=t,o=a;JR([a,i],"maxPoolGrad");const{filterSize:l,strides:u,pad:c,dimRoundingMode:h}=s,d=mc(o.shape,l,u,1,c,h),p=new TB(d,"max",!0),f=n.runWebGLProgram(p,[o],o.dtype),m=new DP(d),g=n.runWebGLProgram(m,[r,f],o.dtype);return n.disposeIntermediateTensorInfo(f),g}};const zP={kernelName:fr,backendName:"webgl",kernelFunc:({inputs:e,attrs:t,backend:n})=>{const{x:s}=e,{filterSize:r,strides:a,pad:i,includeBatchInIndex:o}=t,l=n;qt(4===s.shape.length,(()=>`Error in maxPool: input must be rank 4 but got rank ${s.shape.length}.`));const u=[1,1];qt(Sc(a,u),(()=>`Error in maxPool: Either strides or dilations must be 1. Got strides ${a} and dilations '${u}'`));const c=mc(s.shape,r,a,u,i),[h,d]=function(e,t,n,s){let r=new TB(n,"max",!1);const a=s.runWebGLProgram(r,[e],"float32");return r=new TB(n,"max",!0,!0,t),[a,s.runWebGLProgram(r,[e],"float32")]}(s,o,c,l);return[h,d]}};const LP={kernelName:mr,backendName:"webgl",kernelFunc:({inputs:e,attrs:t,backend:n})=>{const{x:s}=e,{keepDims:r,axis:a}=t,i=n,o=s.shape.length,l=en(a,s.shape);let u=l;const c=Ih(u,o),h=null!=c,d=i.shouldExecuteOnCPU([s]),p=[];let f=s;if(h){if(d){const e=i.texData.get(f.dataId).values,t=new Array(o);for(let e=0;et[0]+e[n]+t[1]));const s=e.length,r=bD(s),a=t.map((e=>e[0])).join(","),i=t.map(((t,n)=>t[0]+e[n])).join(","),o=["coords[0]","coords[1]","coords[2]","coords[3]"].slice(0,s),l="reflect"===n?0:1;this.userCode=1!==s?`\n ${r} start = ${r}(${a});\n ${r} end = ${r}(${i});\n\n void main() {\n ${r} outC = getOutputCoords();\n for (int i = 0; i < ${s}; i++) {\n if (outC[i] < start[i]) {\n outC[i] = start[i] * 2 - outC[i] - ${l};\n } else if(outC[i] >= end[i]) {\n outC[i] = (end[i] - 1) * 2 - outC[i] + ${l};\n }\n }\n ${r} coords = outC - start;\n setOutput(getX(${o}));\n }\n `:`\n int start = ${a};\n int end = ${i};\n\n void main() {\n int outC = getOutputCoords();\n if (outC < start) {\n outC = start * 2 - outC - ${l};\n } else if(outC >= end) {\n outC = (end - 1) * 2 - outC + ${l};\n }\n setOutput(getX(outC - start));\n }\n `}}class GP{constructor(e,t,n){this.variableNames=["x"],this.packedInputs=!0,this.packedOutput=!0,this.outputShape=t.map(((t,n)=>t[0]+e[n]+t[1]));const s=e.length,r=bD(s),a=t.map((e=>e[0])).join(","),i=t.map(((t,n)=>t[0]+e[n])).join(","),o=VM("rc",s),l=VM("source",s),u=`${o[s-1]} < ${this.outputShape[s-1]}`,c=1===s?"source":`vec2(${l.slice(-2).join()})`,h="reflect"===n?0:1;let d="";if(1===s){const e=`\n ${r} source = rc;\n if (source < start) {\n source = start * 2 - source - ${h};\n } else if (source >= end) {\n source = (end - 1) * 2 - source + ${h};\n }\n source -= start;\n `;d=`\n ${r} rc = outputLoc;\n ${e}\n result[0] = getChannel(getX(${l.join()}), ${c});\n ${o[s-1]} += 1;\n if(${u}) {\n ${e}\n result[1] = getChannel(getX(${l.join()}), ${c});\n }\n `}else{const e=`\n ${r} source = rc;\n ${r} lt = ${r}(lessThan(source, start));\n ${r} gte = ${r}(greaterThanEqual(source, end));\n ${r} orig = 1 - (lt + gte);\n source = orig * source +\n lt * (start * 2 - source - ${h}) +\n gte * ((end - 1) * 2 - source + ${h});\n source -= start;\n `;d=`\n ${r} rc = outputLoc;\n ${e}\n result[0] = getChannel(getX(${l.join()}), ${c});\n ${o[s-1]} += 1;\n if(${u}) {\n ${e}\n result[1] = getChannel(getX(${l.join()}), ${c});\n }\n rc = outputLoc;\n ${o[s-2]} += 1;\n if(${o[s-2]} < ${this.outputShape[s-2]}) {\n ${e}\n result[2] = getChannel(getX(${l.join()}), ${c});\n ${o[s-1]} += 1;\n if(${u}) {\n ${e}\n result[3] = getChannel(getX(${l.join()}), ${c});\n }\n }\n `}this.userCode=`\n const ${r} start = ${r}(${a});\n const ${r} end = ${r}(${i});\n\n void main() {\n ${r} outputLoc = getOutputCoords();\n vec4 result = vec4(0.);\n ${d}\n setOutput(result);\n }\n `}}const qP={kernelName:br,backendName:"webgl",kernelFunc:({inputs:e,backend:t,attrs:n})=>{const{x:s}=e,{paddings:r,mode:a}=n,i=Sn().getBool("WEBGL_PACK_ARRAY_OPERATIONS")?new GP(s.shape,r,a):new UP(s.shape,r,a);return t.runWebGLProgram(i,[s],s.dtype)}},jP=TF({opSnippet:"if (b == 0.0) return NAN;\n return mod(a, b);",packedOpSnippet:"\n vec4 result = mod(a, b);\n bvec4 isNaN = equal(b, vec4(0.0));\n "+mF+"\n return result;\n"}),HP={kernelName:wr,backendName:"webgl",kernelFunc:jP};class $P{constructor(e,t,n){this.variableNames=["probs"],this.customUniforms=[{name:"seed",type:"float"}],this.outputShape=[e,n],this.userCode=`\n void main() {\n ivec2 coords = getOutputCoords();\n int batch = coords[0];\n\n float r = random(seed);\n float cdf = 0.0;\n\n for (int i = 0; i < ${t-1}; i++) {\n cdf += getProbs(batch, i);\n\n if (r < cdf) {\n setOutput(float(i));\n return;\n }\n }\n\n // If no other event happened, last event happened.\n setOutput(float(${t-1}));\n }\n `}}const KP=TF({opSnippet:"\nif (a == b) {\n return 1.0;\n};\nreturn a / b;",packedOpSnippet:"\n // vec4 one = vec4(equal(a, b));\n // return one + (vec4(1.0) - one) * a / b;\n vec4 result = a / b;\n if(a.x == b.x) {\n result.x = 1.;\n }\n if(a.y == b.y) {\n result.y = 1.;\n }\n if(a.z == b.z) {\n result.z = 1.;\n }\n if(a.w == b.w) {\n result.w = 1.;\n }\n\n return result;\n",checkOutOfBounds:!0}),XP={kernelName:Es,backendName:"webgl",kernelFunc:KP},ZP="return a - b;",YP=TF({opSnippet:ZP,packedOpSnippet:ZP,supportsComplex:!0,cpuKernelImpl:MM}),QP={kernelName:Ca,backendName:"webgl",kernelFunc:YP};function JP(e){const{inputs:t,backend:n,attrs:s}=e,{logits:r}=t,{dim:a}=s,i=en([a],r.shape),o=_P({inputs:{x:r},backend:n,attrs:{reductionIndices:i,keepDims:!1}}),l=Eh(o.shape,i),u=zF({inputs:{x:o},backend:n,attrs:{shape:l}}),c=YP({inputs:{a:r,b:u},backend:n}),h=bL({inputs:{x:c},backend:n}),d=jF({inputs:{x:h},backend:n,attrs:{axis:i,keepDims:!1}}),p=zF({inputs:{x:d},backend:n,attrs:{shape:l}}),f=KP({inputs:{a:h,b:p},backend:n});return n.disposeIntermediateTensorInfo(o),n.disposeIntermediateTensorInfo(u),n.disposeIntermediateTensorInfo(c),n.disposeIntermediateTensorInfo(h),n.disposeIntermediateTensorInfo(d),n.disposeIntermediateTensorInfo(p),f}const eV={kernelName:ha,backendName:"webgl",kernelFunc:JP};const tV={kernelName:vr,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:n,attrs:s}=e,{logits:r}=t,{numSamples:a,seed:i,normalized:o}=s,l=o?r:JP({inputs:{logits:r},backend:n,attrs:{dim:r.shape.length-1}}),u=l.shape[0],c=l.shape[1],h=new $P(u,c,a),d=[[i]],p=n.runWebGLProgram(h,[l],"int32",d);return o||n.disposeIntermediateTensorInfo(l),p}},nV=KM+"\n return -x;\n";const sV={kernelName:Ar,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:n}=e,{x:s}=t;if(n.shouldExecuteOnCPU([s])){const e=n.texData.get(s.dataId),[t,r]=pM(e.values,s.shape,s.dtype);return n.makeTensorInfo(r,s.dtype,t)}let r;return r=Sn().getBool("WEBGL_PACK_UNARY_OPERATIONS")?new oF(s.shape,"\n vec4 result = -x;\n bvec4 isNaN = isnan(x);\n\n result.r = isNaN.r ? x.r : result.r;\n result.g = isNaN.g ? x.g : result.g;\n result.b = isNaN.b ? x.b : result.b;\n result.a = isNaN.a ? x.a : result.a;\n\n return result;\n"):new $M(s.shape,nV),n.runWebGLProgram(r,[s],s.dtype)}},rV=Rf;const aV={kernelName:Cr,backendName:"webgl",kernelFunc:function(e){Wa();const{inputs:t,backend:n,attrs:s}=e,{boxes:r,scores:a}=t,{maxOutputSize:i,iouThreshold:o,scoreThreshold:l}=s,u=n.readSync(r.dataId),c=n.readSync(a.dataId),{selectedIndices:h}=rV(u,c,i,o,l);return n.makeTensorInfo([h.length],"int32",new Int32Array(h))}},iV=Df;const oV={kernelName:Sr,backendName:"webgl",kernelFunc:function(e){Wa();const{inputs:t,backend:n,attrs:s}=e,{boxes:r,scores:a}=t,{maxOutputSize:i,iouThreshold:o,scoreThreshold:l,padToMaxOutputSize:u}=s,c=n.readSync(r.dataId),h=n.readSync(a.dataId),{selectedIndices:d,validOutputs:p}=iV(c,h,i,o,l,u);return[n.makeTensorInfo([d.length],"int32",new Int32Array(d)),n.makeTensorInfo([],"int32",new Int32Array([p]))]}},lV=Mf;const uV={kernelName:Er,backendName:"webgl",kernelFunc:function(e){Wa();const{inputs:t,backend:n,attrs:s}=e,{boxes:r,scores:a}=t,{maxOutputSize:i,iouThreshold:o,scoreThreshold:l,softNmsSigma:u}=s,c=n.readSync(r.dataId),h=n.readSync(a.dataId),d=i,p=o,f=l,m=u,{selectedIndices:g,selectedScores:y}=lV(c,h,d,p,f,m);return[n.makeTensorInfo([g.length],"int32",new Int32Array(g)),n.makeTensorInfo([y.length],"float32",new Float32Array(y))]}};class cV{constructor(e,t,n,s){this.variableNames=["indices"],this.outputShape=[e,t],this.userCode=`\n void main() {\n ivec2 coords = getOutputCoords();\n int index = round(getIndices(coords.x));\n setOutput(mix(float(${s}), float(${n}),\n float(index == coords.y)));\n }\n `}}const hV={kernelName:Ir,backendName:"webgl",kernelFunc:e=>{const{inputs:t,backend:n,attrs:s}=e,{indices:r}=t,{dtype:a,depth:i,onValue:o,offValue:l}=s,u=$t(r.shape),c=new cV(u,i,o,l),h=zF({inputs:{x:r},backend:n,attrs:{shape:[u]}}),d=n.runWebGLProgram(c,[h],a);n.disposeIntermediateTensorInfo(h);const p=zF({inputs:{x:d},backend:n,attrs:{shape:[...r.shape,i]}});return n.disposeIntermediateTensorInfo(d),p}};function dV(e){const{inputs:t,backend:n}=e,{x:s}=t;if("complex64"===s.dtype){const e=QB({inputs:{input:s},backend:n}),t=dV({inputs:{x:e},backend:n}),r=fz({inputs:{input:s},backend:n}),a=dV({inputs:{x:r},backend:n}),i=wF({inputs:{real:t,imag:a},backend:n});return n.disposeIntermediateTensorInfo(e),n.disposeIntermediateTensorInfo(t),n.disposeIntermediateTensorInfo(r),n.disposeIntermediateTensorInfo(a),i}return TL({attrs:{shape:s.shape,dtype:s.dtype,value:"string"===s.dtype?"":0},backend:n})}const pV={kernelName:Ma,backendName:"webgl",kernelFunc:dV};const fV={kernelName:_r,backendName:"webgl",kernelFunc:function e(t){const{inputs:n,backend:s}=t,{x:r}=n;if("string"===r.dtype)throw new Error("onesLike is not supported under string dtype");if("complex64"===r.dtype){const t=QB({inputs:{input:r},backend:s}),n=e({inputs:{x:t},backend:s}),a=fz({inputs:{input:r},backend:s}),i=dV({inputs:{x:a},backend:s}),o=wF({inputs:{real:n,imag:i},backend:s});return s.disposeIntermediateTensorInfo(t),s.disposeIntermediateTensorInfo(n),s.disposeIntermediateTensorInfo(a),s.disposeIntermediateTensorInfo(i),o}return TL({attrs:{shape:r.shape,dtype:r.dtype,value:1},backend:s})}};const mV={kernelName:Tr,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:n,attrs:s}=e,{axis:r}=s;if(1===t.length)return vL({inputs:{input:t[0]},backend:n,attrs:{dim:r}});const a=t[0].shape,i=t[0].dtype;t.forEach((e=>{jt(a,e.shape,"All tensors passed to stack must have matching shapes"),qt(i===e.dtype,(()=>"All tensors passed to stack must have matching dtypes"))}));const o=[],l=yz({inputs:t.map((e=>{const t=vL({inputs:{input:e},backend:n,attrs:{dim:r}});return o.push(t),t})),backend:n,attrs:{axis:r}});return o.forEach((e=>n.disposeIntermediateTensorInfo(e))),l}};class gV{constructor(e,t,n){this.variableNames=["x"],this.customUniforms=[{name:"value",type:"float"}],this.outputShape=t.map(((t,n)=>t[0]+e[n]+t[1]));const s=e.length,r=bD(s),a=t.map((e=>e[0])).join(","),i=t.map(((t,n)=>t[0]+e[n])).join(","),o=["coords[0]","coords[1]","coords[2]","coords[3]"].slice(0,s);this.userCode=1!==s?`\n ${r} start = ${r}(${a});\n ${r} end = ${r}(${i});\n\n void main() {\n ${r} outC = getOutputCoords();\n if (any(lessThan(outC, start)) || any(greaterThanEqual(outC, end))) {\n setOutput(value);\n } else {\n ${r} coords = outC - start;\n setOutput(getX(${o}));\n }\n }\n `:`\n int start = ${a};\n int end = ${i};\n\n void main() {\n int outC = getOutputCoords();\n if (outC < start || outC >= end) {\n setOutput(value);\n } else {\n setOutput(getX(outC - start));\n }\n }\n `}}class yV{constructor(e,t,n){this.variableNames=["x"],this.packedInputs=!0,this.packedOutput=!0,this.customUniforms=[{name:"value",type:"float"}],this.outputShape=t.map(((t,n)=>t[0]+e[n]+t[1]));const s=e.length,r=bD(s),a=t.map((e=>e[0])).join(","),i=t.map(((t,n)=>t[0]+e[n])).join(","),o=VM("rc",s),l=VM("source",s),u=`${o[s-1]} < ${this.outputShape[s-1]}`,c=1===s?"source":`vec2(${l.slice(-2).join()})`,h=[`${r} rc = outputLoc;`,`${o[s-1]} += 1;\n if(${u}) {\n `,1===s?"":`}\n rc = outputLoc;\n ${o[s-2]} += 1;\n if(${o[s-2]} < ${this.outputShape[s-2]}) {`,1===s?"":` ${o[s-1]} += 1;\n if(${u}) {`],d=1===s?"rc < start || rc >= end":"any(lessThan(rc, start)) || any(greaterThanEqual(rc, end))";let p="";for(let e=0,t=1===s?2:4;e{const{inputs:t,backend:n,attrs:s}=e,{x:r}=t,{paddings:a,constantValue:i}=s;if(0===$t(r.shape)){const e=a.map(((e,t)=>e[0]+r.shape[t]+e[1]));return TL({backend:n,attrs:{shape:e,value:i,dtype:r.dtype}})}const o=Sn().getBool("WEBGL_PACK_ARRAY_OPERATIONS")?new yV(r.shape,a,i):new gV(r.shape,a,i),l=[[i]];return n.runWebGLProgram(o,[r],r.dtype,l)},wV={kernelName:Nr,backendName:"webgl",kernelFunc:bV},vV=TF({opSnippet:"\n if(a < 0.0 && floor(b) < b){\n return NAN;\n }\n if (b == 0.0) {\n return 1.0;\n }\n return (round(mod(b, 2.0)) != 1) ?\n pow(abs(a), b) : sign(a) * pow(abs(a), b);\n",packedOpSnippet:"\n // isModRound1 has 1 for components with round(mod(b, 2.0)) == 1, 0 otherwise.\n vec4 isModRound1 = vec4(equal(round(mod(b, 2.0)), ivec4(1)));\n vec4 multiplier = sign(a) * isModRound1 + (vec4(1.0) - isModRound1);\n vec4 result = multiplier * pow(abs(a), b);\n\n // Ensure that a^0 = 1, including 0^0 = 1 as this correspond to TF and JS\n bvec4 isExpZero = equal(b, vec4(0.0));\n result.r = isExpZero.r ? 1.0 : result.r;\n result.g = isExpZero.g ? 1.0 : result.g;\n result.b = isExpZero.b ? 1.0 : result.b;\n result.a = isExpZero.a ? 1.0 : result.a;\n\n bvec4 isNaN1 = lessThan(a, vec4(0.0));\n bvec4 isNaN2 = lessThan(floor(b), b);\n bvec4 isNaN = bvec4(isNaN1.x && isNaN2.x, isNaN1.y && isNaN2.y, isNaN1.z && isNaN2.z, isNaN1.w && isNaN2.w);\n "+mF+"\n return result;\n"}),xV={kernelName:Or,backendName:"webgl",kernelFunc:vV};const AV={kernelName:Dr,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:n,attrs:s}=e,{x:r}=t,{axis:a,keepDims:i}=s,o=r.shape.length,l=[],u=en(a,r.shape);let c=u;const h=Ih(c,o);let d,p=r;if(null!=h&&(p=$F({inputs:{x:r},backend:n,attrs:{perm:h}}),c=Nh(c.length,o),l.push(p)),_h("prod",c,o),n.shouldExecuteOnCPU([p])){const e=n.texData.get(p.dataId).values,{outVals:t,outShape:s,outDtype:r}=mM(p.shape,p.dtype,e,c);d=n.makeTensorInfo(s,r,t)}else{const[e,t]=Sh(p.shape,c),s=$t(t),a=zF({inputs:{x:p},backend:n,attrs:{shape:[-1,s]}}),i=WF(a,qi(r.dtype),"prod",n);d=zF({inputs:{x:i},backend:n,attrs:{shape:e}}),l.push(a),l.push(i)}if(i){l.push(d);const e=Eh(d.shape,u);d=zF({inputs:{x:d},backend:n,attrs:{shape:e}})}return l.forEach((e=>n.disposeIntermediateTensorInfo(e))),d}};const kV={kernelName:Mr,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:n,attrs:s}=e,{paramsNestedSplits:r,paramsDenseValues:a,indices:i}=t,{outputRaggedRank:o}=s,l=r.map((e=>n.readSync(e.dataId))),u=r.map((e=>e.shape)),c=n.readSync(a.dataId),h=n.readSync(i.dataId),[d,p,f]=gM(l,u,c,a.shape,a.dtype,h,i.shape,o),m=d.map((e=>n.makeTensorInfo([e.length],"int32",e))),g=n.makeTensorInfo(f,a.dtype,p);return m.concat([g])}};const CV={kernelName:Fr,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:n}=e,{starts:s,limits:r,deltas:a}=t,i=n.readSync(s.dataId),o=n.readSync(r.dataId),l=n.readSync(a.dataId),[u,c]=yM(i,s.shape,s.dtype,o,r.shape,l,a.shape);return[n.makeTensorInfo([u.length],"int32",u),n.makeTensorInfo([c.length],s.dtype,c)]}};const SV={kernelName:Br,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:n,attrs:s}=e,{shape:r,values:a,defaultValue:i,rowPartitionTensors:o}=t,{rowPartitionTypes:l}=s,u=n.readSync(r.dataId),c=n.readSync(a.dataId),h=n.readSync(i.dataId),d=o.map((e=>n.readSync(e.dataId))),p=o.map((e=>e.shape)),[f,m]=bM(u,r.shape,c,a.shape,a.dtype,h,i.shape,d,p,l);return n.makeTensorInfo(f,a.dtype,m)}},EV=e=>{const{backend:t,attrs:n}=e,{start:s,stop:r,step:a,dtype:i}=n,o=wM(s,r,a,i);return t.makeTensorInfo([o.length],i,o)},_V={kernelName:zr,backendName:"webgl",kernelFunc:EV},IV=IF({opSnippet:"return 1.0 / x;"}),TV={kernelName:Pr,backendName:"webgl",kernelFunc:IV},NV=IF({opSnippet:KM+"\n return (x < 0.0) ? 0.0 : x;\n",packedOpSnippet:"\n vec4 result = x * vec4(greaterThanEqual(x, vec4(0.0)));\n bvec4 isNaN = isnan(x);\n\n result.r = isNaN.r ? x.r : result.r;\n result.g = isNaN.g ? x.g : result.g;\n result.b = isNaN.b ? x.b : result.b;\n result.a = isNaN.a ? x.a : result.a;\n\n return result;\n"}),OV={kernelName:Vr,backendName:"webgl",kernelFunc:NV},RV=IF({opSnippet:KM+"\n return (x < 0.0) ? 0.0 : min(6.0, x);\n",packedOpSnippet:"\n vec4 result = min(x, vec4(6.)) * vec4(greaterThanEqual(x, vec4(0.0)));\n bvec4 isNaN = isnan(x);\n\n result.r = isNaN.r ? x.r : result.r;\n result.g = isNaN.g ? x.g : result.g;\n result.b = isNaN.b ? x.b : result.b;\n result.a = isNaN.a ? x.a : result.a;\n\n return result;\n"}),DV={kernelName:Hr,backendName:"webgl",kernelFunc:RV};class MV{constructor(e,t,n,s,r){this.variableNames=["A"],this.outputShape=[];const[a,i,o,l]=e;this.outputShape=[a,t,n,l];const u=[s&&t>1?i-1:i,s&&n>1?o-1:o],c=[s&&t>1?t-1:t,s&&n>1?n-1:n];let h;h=r?"(vec2(yRC) + vec2(0.5)) * effectiveInputOverOutputRatioRC - vec2(0.5)":"vec2(yRC) * effectiveInputOverOutputRatioRC",this.userCode=`\n const vec2 effectiveInputOverOutputRatioRC = vec2(\n ${u[0]/c[0]},\n ${u[1]/c[1]});\n const vec2 inputShapeRC = vec2(${i}.0, ${o}.0);\n\n void main() {\n ivec4 coords = getOutputCoords();\n int b = coords[0];\n int d = coords[3];\n ivec2 yRC = coords.yz;\n\n // Fractional source index.\n vec2 sourceFracIndexRC = ${h};\n\n // Compute the four integer indices.\n ivec2 sourceFloorRC = ivec2(max(sourceFracIndexRC, vec2(0.0)));\n ivec2 sourceCeilRC = ivec2(\n min(inputShapeRC - 1.0, ceil(sourceFracIndexRC)));\n\n float topLeft = getA(b, sourceFloorRC.x, sourceFloorRC.y, d);\n float bottomLeft = getA(b, sourceCeilRC.x, sourceFloorRC.y, d);\n float topRight = getA(b, sourceFloorRC.x, sourceCeilRC.y, d);\n float bottomRight = getA(b, sourceCeilRC.x, sourceCeilRC.y, d);\n\n vec2 fracRC = sourceFracIndexRC - vec2(sourceFloorRC);\n\n float top = topLeft + (topRight - topLeft) * fracRC.y;\n float bottom = bottomLeft + (bottomRight - bottomLeft) * fracRC.y;\n float newValue = top + (bottom - top) * fracRC.x;\n\n setOutput(newValue);\n }\n `}}class FV{constructor(e,t,n,s,r){this.variableNames=["A"],this.packedInputs=!0,this.packedOutput=!0,this.outputShape=[];const[a,i,o,l]=e;this.outputShape=[a,t,n,l];const u=[s&&t>1?i-1:i,s&&n>1?o-1:o],c=[s&&t>1?t-1:t,s&&n>1?n-1:n];let h;h=r?"(vec3(yRC) + vec3(0.5)) * effectiveInputOverOutputRatioRC - vec3(0.5)":"vec3(yRC) * effectiveInputOverOutputRatioRC",this.userCode=`\n const vec3 effectiveInputOverOutputRatioRC = vec3(\n ${u[0]/c[0]},\n ${u[1]/c[1]},\n ${u[1]/c[1]});\n const vec3 inputShapeRC = vec3(${i}.0, ${o}.0,\n ${o}.0);\n\n float getAValue(int b, int r, int c, int d) {\n return getChannel(getA(b, r, c, d), vec2(c, d));\n }\n\n void main() {\n ivec4 coords = getOutputCoords();\n int b = coords[0];\n int d = coords[3];\n // Calculate values for next column in yRC.z.\n ivec3 yRC = coords.yzz + ivec3(0, 0, 1);\n\n // Fractional source index.\n vec3 sourceFracIndexRC = ${h};\n\n // Compute the four integer indices.\n ivec3 sourceFloorRC = ivec3(max(sourceFracIndexRC, vec3(0.0)));\n ivec3 sourceCeilRC = ivec3(\n min(inputShapeRC - 1.0, ceil(sourceFracIndexRC)));\n\n // Should we calculate next column and row elements in 2x2 packed cell.\n bool hasNextCol = d < ${l-1};\n bool hasNextRow = coords.z < ${n-1};\n\n // In parallel, construct four corners for all four components in\n // packed 2x2 cell.\n vec4 topLeft = vec4(\n getAValue(b, sourceFloorRC.x, sourceFloorRC.y, d),\n hasNextCol ? getAValue(b, sourceFloorRC.x, sourceFloorRC.y, d + 1)\n : 0.0,\n hasNextRow ? getAValue(b, sourceFloorRC.x, sourceFloorRC.z, d)\n : 0.0,\n (hasNextRow && hasNextCol) ?\n getAValue(b, sourceFloorRC.x, sourceFloorRC.z, d + 1) : 0.0);\n\n vec4 bottomLeft = vec4(\n getAValue(b, sourceCeilRC.x, sourceFloorRC.y, d),\n hasNextCol ? getAValue(b, sourceCeilRC.x, sourceFloorRC.y, d + 1)\n : 0.0,\n hasNextRow ? getAValue(b, sourceCeilRC.x, sourceFloorRC.z, d)\n : 0.0,\n (hasNextRow && hasNextCol) ?\n getAValue(b, sourceCeilRC.x, sourceFloorRC.z, d + 1) : 0.0);\n\n vec4 topRight = vec4(\n getAValue(b, sourceFloorRC.x, sourceCeilRC.y, d),\n hasNextCol ? getAValue(b, sourceFloorRC.x, sourceCeilRC.y, d + 1)\n : 0.0,\n hasNextRow ? getAValue(b, sourceFloorRC.x, sourceCeilRC.z, d)\n : 0.0,\n (hasNextRow && hasNextCol) ?\n getAValue(b, sourceFloorRC.x, sourceCeilRC.z, d + 1) : 0.0);\n\n vec4 bottomRight = vec4(\n getAValue(b, sourceCeilRC.x, sourceCeilRC.y, d),\n hasNextCol ? getAValue(b, sourceCeilRC.x, sourceCeilRC.y, d + 1)\n : 0.0,\n hasNextRow ? getAValue(b, sourceCeilRC.x, sourceCeilRC.z, d)\n : 0.0,\n (hasNextRow && hasNextCol) ?\n getAValue(b, sourceCeilRC.x, sourceCeilRC.z, d + 1) : 0.0);\n\n vec3 fracRC = sourceFracIndexRC - vec3(sourceFloorRC);\n\n vec4 top = mix(topLeft, topRight, fracRC.yyzz);\n vec4 bottom = mix(bottomLeft, bottomRight, fracRC.yyzz);\n vec4 newValue = mix(top, bottom, fracRC.x);\n\n setOutput(newValue);\n }\n `}}const BV={kernelName:qr,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:n,attrs:s}=e,{images:r}=t,{alignCorners:a,halfPixelCenters:i,size:o}=s,[l,u]=o,c=Sn().getBool("WEBGL_PACK_IMAGE_OPERATIONS")?new FV(r.shape,l,u,a,i):new MV(r.shape,l,u,a,i);return n.runWebGLProgram(c,[r],"float32")}};class zV{constructor(e,t,n){this.variableNames=["dy"],this.outputShape=[],this.outputShape=t;const[,s,r]=t,[,a,i]=e,o=[n&&a>1?s-1:s,n&&i>1?r-1:r],l=[n&&a>1?a-1:a,n&&i>1?i-1:i],u=o[0]/l[0],c=o[1]/l[1],h=1/u,d=1/c,p=2*Math.ceil(h)+2,f=2*Math.ceil(d)+2;this.userCode=`\n void main() {\n ivec4 coords = getOutputCoords();\n int b = coords[0];\n int d = coords[3];\n int r = coords[1];\n int c = coords[2];\n\n float accumulator = 0.0;\n\n const float heightScale = float(${u});\n const float widthScale = float(${c});\n\n const float invHeightScale = float(${h});\n const float invWidthScale = float(${d});\n\n const int winHeight = int(${p});\n const int winWidth = int(${f});\n\n // Compute bounds for where in dy we will look\n float startRLerp = floor(float(r) * invHeightScale);\n int startDyR = int(startRLerp - float(winHeight / 2));\n\n float startCLerp = floor(float(c) * invWidthScale);\n int startDyC = int(startCLerp - float(winWidth / 2));\n\n // Loop over dy\n for (int dyROffset = 0; dyROffset < winHeight; dyROffset++) {\n int dyR = dyROffset + startDyR;\n\n // Guard against the window exceeding the bounds of dy\n if (dyR < 0 || dyR >= ${a}) {\n continue;\n }\n\n for (int dyCOffset = 0; dyCOffset < winWidth; dyCOffset++) {\n int dyC = dyCOffset + startDyC;\n\n // Guard against the window exceeding the bounds of dy\n if (dyC < 0 || dyC >= ${i}) {\n continue;\n }\n\n float dxR = float(dyR) * heightScale;\n int topDxRIndex = int(floor(dxR));\n int bottomDxRIndex = int(min(ceil(dxR), ${s-1}.0));\n float dxRLerp = dxR - float(topDxRIndex);\n float inverseDxRLerp = 1.0 - dxRLerp;\n\n float dxC = float(dyC) * widthScale;\n int leftDxCIndex = int(floor(dxC));\n int rightDxCIndex = int(min(ceil(dxC), ${r-1}.0));\n float dxCLerp = dxC - float(leftDxCIndex);\n float inverseDxCLerp = 1.0 - dxCLerp;\n\n if (r == topDxRIndex && c == leftDxCIndex) {\n // topLeft\n accumulator +=\n getDy(b, dyR, dyC, d) * inverseDxRLerp * inverseDxCLerp;\n }\n\n if (r == topDxRIndex && c == rightDxCIndex) {\n // topRight\n accumulator += getDy(b, dyR, dyC, d) * inverseDxRLerp * dxCLerp;\n }\n\n if (r == bottomDxRIndex && c == leftDxCIndex) {\n // bottomLeft\n accumulator += getDy(b, dyR, dyC, d) * dxRLerp * inverseDxCLerp;\n }\n\n if (r == bottomDxRIndex && c == rightDxCIndex) {\n // bottomRight\n accumulator += getDy(b, dyR, dyC, d) * dxRLerp * dxCLerp;\n }\n }\n }\n // End loop over dy\n\n setOutput(accumulator);\n }\n `}}const LV={kernelName:jr,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:n,attrs:s}=e,{images:r,dy:a}=t,{alignCorners:i}=s,o=new zV(a.shape,r.shape,i);return n.runWebGLProgram(o,[a],a.dtype)}};class PV{constructor(e,t,n,s,r){this.variableNames=["A"],this.outputShape=[];const[a,i,o,l]=e;this.outputShape=[a,t,n,l];const u=[s&&t>1?i-1:i,s&&n>1?o-1:o],c=[s&&t>1?t-1:t,s&&n>1?n-1:n],h=s?"0.5":"0.0";let d;d=r?"max((vec2(yRC) + vec2(0.5)) * effectiveInputOverOutputRatioRC, vec2(0.0))":"vec2(yRC) * effectiveInputOverOutputRatioRC",this.userCode=`\n const vec2 effectiveInputOverOutputRatioRC = vec2(\n ${u[0]/c[0]},\n ${u[1]/c[1]});\n const vec2 inputShapeRC = vec2(${i}.0, ${o}.0);\n\n void main() {\n ivec4 coords = getOutputCoords();\n int b = coords[0];\n int d = coords[3];\n ivec2 yRC = coords.yz;\n\n // Fractional source index.\n vec2 sourceFracIndexRC = ${d};\n\n // Compute the coordinators of nearest neighbor point.\n ivec2 sourceNearestRC = ivec2(\n min(inputShapeRC - 1.0, floor(sourceFracIndexRC + ${h})));\n float newValue = getA(b, sourceNearestRC.x, sourceNearestRC.y, d);\n\n setOutput(newValue);\n }\n `}}class VV{constructor(e,t,n,s,r){this.variableNames=["A"],this.packedInputs=!0,this.packedOutput=!0,this.outputShape=[];const[a,i,o,l]=e;this.outputShape=[a,t,n,l];const u=[s&&t>1?i-1:i,s&&n>1?o-1:o],c=[s&&t>1?t-1:t,s&&n>1?n-1:n],h=s?"0.5":"0.0";let d;d=r?"max((vec3(yRC) + vec3(0.5)) * effectiveInputOverOutputRatioRC, vec3(0.0))":"vec3(yRC) * effectiveInputOverOutputRatioRC",this.userCode=`\n const vec3 effectiveInputOverOutputRatioRC = vec3(\n ${u[0]/c[0]},\n ${u[1]/c[1]},\n ${u[1]/c[1]});\n const vec3 inputShapeRC = vec3(${i}.0, ${o}.0,\n ${o}.0);\n\n float getAValue(int b, int r, int c, int d) {\n return getChannel(getA(b, r, c, d), vec2(c, d));\n }\n\n void main() {\n ivec4 coords = getOutputCoords();\n int b = coords[0];\n int d = coords[3];\n // Calculate values for next column in yRC.z.\n ivec3 yRC = coords.yzz + ivec3(0, 0, 1);\n\n // Fractional source index.\n vec3 sourceFracIndexRC = ${d};\n\n // Compute the coordinators of nearest neighbor point.\n ivec3 sourceNearestRC = ivec3(\n min(inputShapeRC - 1.0, floor(sourceFracIndexRC + ${h})));\n\n // Should we calculate next column and row elements in 2x2 packed cell.\n bool hasNextCol = d < ${l-1};\n bool hasNextRow = coords.z < ${n-1};\n\n vec4 newValue = vec4(\n getAValue(b, sourceNearestRC.x, sourceNearestRC.y, d),\n hasNextCol ? getAValue(b, sourceNearestRC.x, sourceNearestRC.y, d + 1)\n : 0.0,\n hasNextRow ? getAValue(b, sourceNearestRC.x, sourceNearestRC.z, d)\n : 0.0,\n (hasNextRow && hasNextCol) ?\n getAValue(b, sourceNearestRC.x, sourceNearestRC.z, d + 1) : 0.0);\n\n setOutput(newValue);\n }\n `}}const WV={kernelName:Ur,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:n,attrs:s}=e,{images:r}=t,{alignCorners:a,halfPixelCenters:i,size:o}=s,[l,u]=o,c=Sn().getBool("WEBGL_PACK_IMAGE_OPERATIONS")?new VV(r.shape,l,u,a,i):new PV(r.shape,l,u,a,i);return n.runWebGLProgram(c,[r],r.dtype)}};class UV{constructor(e,t,n){this.variableNames=["dy"],this.outputShape=[],this.outputShape=t;const[,s,r]=t,[,a,i]=e,o=[n&&a>1?s-1:s,n&&i>1?r-1:r],l=[n&&a>1?a-1:a,n&&i>1?i-1:i],u=o[0]/l[0],c=o[1]/l[1],h=1/u,d=1/c,p=2*Math.ceil(h)+2,f=2*Math.ceil(d)+2;this.userCode=`\n void main() {\n ivec4 coords = getOutputCoords();\n int b = coords[0];\n int d = coords[3];\n int r = coords[1];\n int c = coords[2];\n\n float accumulator = 0.0;\n\n const float heightScale = float(${u});\n const float widthScale = float(${c});\n\n const float invHeightScale = float(${h});\n const float invWidthScale = float(${d});\n\n const int winHeight = int(${p});\n const int winWidth = int(${f});\n\n // Compute bounds for where in dy we will look\n float startRLerp = floor(float(r) * invHeightScale);\n int startDyR = int(floor(startRLerp - float(winHeight / 2)));\n\n float startCLerp = floor(float(c) * invWidthScale);\n int startDyC = int(floor(startCLerp - float(winWidth / 2)));\n\n // Loop over dy\n for (int dyROffset = 0; dyROffset < winHeight; dyROffset++) {\n int dyR = dyROffset + startDyR;\n\n // Guard against the window exceeding the bounds of dy\n if (dyR < 0 || dyR >= ${a}) {\n continue;\n }\n\n for (int dyCOffset = 0; dyCOffset < winWidth; dyCOffset++) {\n int dyC = dyCOffset + startDyC;\n\n // Guard against the window exceeding the bounds of dy\n if (dyC < 0 || dyC >= ${i}) {\n continue;\n }\n\n float sourceFracRow =\n float(${o[0]}) *\n (float(dyR) / float(${l[0]}));\n\n float sourceFracCol =\n float(${o[1]}) *\n (float(dyC) / float(${l[1]}));\n\n int sourceNearestRow = int(min(\n float(int(${s}) - 1),\n ${n} ? float(round(sourceFracRow)) :\n float(floor(sourceFracRow))));\n\n int sourceNearestCol = int(min(\n float(int(${r}) - 1),\n ${n} ? float(round(sourceFracCol)) :\n float(floor(sourceFracCol))));\n\n if (r == sourceNearestRow && c == sourceNearestCol) {\n accumulator += getDy(b, dyR, dyC, d);\n }\n }\n }\n // End loop over dy\n\n setOutput(accumulator);\n }\n `}}const GV={kernelName:Gr,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:n,attrs:s}=e,{images:r,dy:a}=t,{alignCorners:i}=s,o=new UV(a.shape,r.shape,i);return n.runWebGLProgram(o,[a],a.dtype)}};class qV{constructor(e,t){this.variableNames=["x"];const n=e.length;if(n>4)throw new Error(`WebGL backend: Reverse of rank-${n} tensor is not yet supported`);if(this.outputShape=e,1===n)return void(this.userCode=`\n void main() {\n int coord = getOutputCoords();\n setOutput(getX(${e[0]} - coord - 1));\n }\n `);const s=e.map(((n,s)=>(n=>-1!==t.indexOf(n)&&1!==e[n]?`${e[n]} - coords[${n}] - 1`:`coords[${n}]`)(s))).join(","),r=bD(n);this.userCode=`\n void main() {\n ${r} coords = getOutputCoords();\n setOutput(getX(${s}));\n }\n `}}class jV{constructor(e,t){this.variableNames=["x"],this.packedInputs=!0,this.packedOutput=!0;const n=e.length;if(n>4)throw new Error(`WebGL backend: Reverse of rank-${n} tensor is not yet supported`);this.outputShape=e;const s=VM("rc",n),r=`${s[n-1]} + 1 < ${this.outputShape[n-1]}`,a=`${s[n-2]} + 1 < ${this.outputShape[n-2]}`,i=bD(n);function o(n){const s=e.map(((s,r)=>function(n,s){return-1!==t.indexOf(n)&&1!==e[n]?`${e[n]} - ${s[n]} - 1`:`${s[n]}`}(r,n)));return`getChannel(getX(${s.join(",")}), vec2(${s.slice(-2).join(",")}))`}this.userCode=1===n?`\n void main(){\n int rc = getOutputCoords();\n vec4 result = vec4(0.);\n result.r = getChannel(getX(${e[0]} - rc - 1),\n ${e[0]} - rc - 1);\n if(${r}){\n result.g = getChannel(getX(${e[0]} - (rc + 1) - 1),\n ${e[0]} - (rc + 1) - 1);\n }\n setOutput(result);\n }\n `:`\n void main() {\n ${i} rc = getOutputCoords();\n vec4 result = vec4(0.);\n result.r = ${function(e){return o(e)}(s.slice())};\n if(${r}){\n result.g = ${function(e){return e[n-1]="("+e[n-1]+" + 1)",o(e)}(s.slice())};\n }\n if(${a}) {\n result.b = ${function(e){return e[n-2]="("+e[n-2]+" + 1)",o(e)}(s.slice())};\n if(${r}) {\n result.a = ${function(e){return e[n-1]="("+e[n-1]+" + 1)",e[n-2]="("+e[n-2]+" + 1)",o(e)}(s.slice())};\n }\n }\n setOutput(result);\n }\n `}}const HV={kernelName:$r,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:n,attrs:s}=e,{x:r}=t,{dims:a}=s,i=r.shape.length,o=en(a,r.shape);if(0===i)return yF({inputs:{x:r},backend:n});const l=Sn().getBool("WEBGL_PACK_ARRAY_OPERATIONS")?new jV(r.shape,o):new qV(r.shape,o);return n.runWebGLProgram(l,[r],r.dtype)}};class $V{constructor(e,t){this.variableNames=["Image"],this.outputShape=[],this.customUniforms=[{name:"params",type:"vec4"}];const n=e[1],s=e[2];this.outputShape=e;let r="";r="number"==typeof t?`float outputValue = ${t.toFixed(2)};`:`\n vec3 fill = vec3(${t.join(",")});\n float outputValue = fill[coords[3]];`,this.userCode=`\n void main() {\n ivec4 coords = getOutputCoords();\n int x = coords[2];\n int y = coords[1];\n float coordXFloat = (float(x) - params[0]) * params[3] -\n (float(y) - params[1]) * params[2];\n float coordYFloat = (float(x) - params[0]) * params[2] +\n (float(y) - params[1]) * params[3];\n int coordX = int(round(coordXFloat + params[0]));\n int coordY = int(round(coordYFloat + params[1]));\n ${r}\n if(coordX >= 0 && coordX < ${s} && coordY >= 0 && coordY < ${n}) {\n outputValue = getImage(coords[0], coordY, coordX, coords[3]);\n }\n setOutput(outputValue);\n }\n `}}const KV={kernelName:za,backendName:"webgl",kernelFunc:({inputs:e,attrs:t,backend:n})=>{const{image:s}=e,{radians:r,fillValue:a,center:i}=t,o=n,l=new $V(s.shape,a),[u,c]=Fm(i,s.shape[1],s.shape[2]),h=[[u,c,Math.sin(r),Math.cos(r)]];return o.runWebGLProgram(l,[s],s.dtype,h)}},XV=IF({opSnippet:"\n // OpenGL ES does not support round function.\n // The algorithm is based on banker's rounding.\n float base = floor(x);\n if ((x - base) < 0.5) {\n return floor(x);\n } else if ((x - base) > 0.5) {\n return ceil(x);\n } else {\n if (mod(base, 2.0) == 0.0) {\n return base;\n } else {\n return base + 1.0;\n }\n }\n"}),ZV={kernelName:Kr,backendName:"webgl",kernelFunc:XV},YV=IF({opSnippet:"return inversesqrt(x);",cpuKernelImpl:vM}),QV={kernelName:Xr,backendName:"webgl",kernelFunc:YV};class JV{constructor(e,t,n,s,r,a,i=!0,o=!1){this.variableNames=["updates","indices","defaultValue"],this.outputShape=a;const l=bD(r.length),u=bD(a.length);let c="";1===n?c="i":2===n&&(c="i, j");const h=`getIndices(${c})`;let d="";1===s?d="i":2===s&&(d="i, coords[1]");const p=`getUpdates(${d})`;let f="";o&&(f="coords[0], coords[1]");const m=`getDefaultValue(${f})`,g=t>1?"strides[j]":"strides";this.userCode=`\n ${l} strides = ${l}(${r});\n\n void main() {\n ${u} coords = getOutputCoords();\n float sum = 0.0;\n bool found = false;\n for (int i = 0; i < ${e}; i++) {\n int flattenedIndex = 0;\n for (int j = 0; j < ${t}; j++) {\n int index = round(${h});\n flattenedIndex += index * ${g};\n }\n if (flattenedIndex == coords[0]) {\n sum += ${p};\n found = true;\n }\n }\n setOutput(mix(${m}, sum, float(found)));\n }\n `}}class eW{constructor(e,t,n,s,r,a,i=!0,o=!1){this.variableNames=["updates","indices","defaultValue"],this.packedInputs=!0,this.packedOutput=!0,this.outputShape=a;const l=bD(r.length),u=bD(a.length);let c="";1===n?c="i":2===n&&(c="i, j");const h=`getIndices(${c})`;let d="";1===s?d="i":2===s&&(d="i, coords[1]");const p=`getUpdates(${d})`;let f="";o&&(f="coords[0], coords[1]");const m=`getDefaultValue(${f})`,g=t>1?"strides[j]":"strides",y=t>1?"strides[j + 1]":"strides";this.userCode=`\n ${l} strides = ${l}(${r});\n\n void main() {\n ${u} coords = getOutputCoords();\n vec4 sum = vec4(0.);\n vec4 found = vec4(0.);\n for (int i = 0; i < ${e}; i+=2) {\n ivec2 flattenedIndex = ivec2(0);\n for (int j = 0; j < ${t}; j+=2) {\n ivec4 index = round(${h});\n flattenedIndex += index.xz * ${g};\n if (j + 1 < ${t}) {\n flattenedIndex += index.yw * ${y};\n }\n }\n if (flattenedIndex[0] == coords[0] || flattenedIndex[1] == coords[0] ||\n flattenedIndex[0] == coords[0] + 1 || flattenedIndex[1] == coords[0] + 1) {\n vec4 updVals = ${p};\n if (flattenedIndex[0] == coords[0]) {\n sum.xy += updVals.xy;\n found.xy = vec2(1.);\n } else if (flattenedIndex[0] == coords[0] + 1) {\n sum.zw += updVals.xy;\n found.zw = vec2(1.);\n }\n if (flattenedIndex[1] == coords[0]) {\n sum.xy += updVals.zw;\n found.xy = vec2(1.);\n } else if (flattenedIndex[1] == coords[0] + 1) {\n sum.zw += updVals.zw;\n found.zw = vec2(1.);\n }\n }\n }\n setOutput(mix(${m}, sum, found));\n }\n `}}const tW={kernelName:Zr,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:n,attrs:s}=e,{indices:r,updates:a}=t,{shape:i}=s,{sliceRank:o,numUpdates:l,sliceSize:u,strides:c,outputSize:h}=Wp(0,r,i),d=[h/u,u];if(0===h)return n.makeTensorInfo(i,r.dtype);const p=zF({inputs:{x:r},backend:n,attrs:{shape:[l,o]}}),f=zF({inputs:{x:a},backend:n,attrs:{shape:[l,u]}}),m=n.makeTensorInfo([],"float32",new Float32Array([0]));let g;g=Sn().getBool("WEBGL_PACK")?new eW(l,o,p.shape.length,f.shape.length,c,d):new JV(l,o,p.shape.length,f.shape.length,c,d);const y=n.runWebGLProgram(g,[f,p,m],f.dtype),b=zF({inputs:{x:y},backend:n,attrs:{shape:i}});return n.disposeIntermediateTensorInfo(p),n.disposeIntermediateTensorInfo(f),n.disposeIntermediateTensorInfo(y),n.disposeIntermediateTensorInfo(m),b}};class nW{constructor(e,t,n,s){this.variableNames=["sortedSequence","values"],this.customUniforms=[{name:"numInputs",type:"int"}],this.outputShape=[e,n];const r=`for (int i = 0; i < ${Math.ceil(Math.log2(t+1))}; ++i) { if (left >= right) break;`,a=2===Sn().getNumber("WEBGL_VERSION")?"while (left < right) {":r,i="left"===s?"<":"<=";this.userCode=`\n int findBound(int batch, float value) {\n int left = 0;\n int right = numInputs;\n int mid;\n ${a}\n mid = (left + right) / 2;\n if (getSortedSequence(batch, mid) ${i} value) {\n left = mid + 1;\n } else {\n right = mid;\n }\n }\n return right;\n }\n\n void main() {\n ivec2 coords = getOutputCoords();\n int batch = coords[0];\n int valueIndex = coords[1];\n\n float value = getValues(batch, valueIndex);\n\n setOutput(float(findBound(batch, value)));\n }\n `}}const sW={kernelName:Qr,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:n,attrs:s}=e,{sortedSequence:r,values:a}=t,{side:i}=s,o=new nW(r.shape[0],r.shape[1],a.shape[1],i),l=[[r.shape[1]]];return n.runWebGLProgram(o,[r,a],"int32",l)}};class rW{constructor(e,t,n){let s,r;if(this.variableNames=["c","a","b"],this.outputShape=t,n>4)throw Error(`Where for rank ${n} is not yet supported`);if(1===n)r="resRC",s="resRC";else{const n=["resRC.x","resRC.y","resRC.z","resRC.w"],a=[],i=[];for(let s=0;s= 1.0) {\n setOutput(getA(${r}));\n } else {\n setOutput(getB(${r}));\n }\n }\n `}}const aW={kernelName:Jr,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:n}=e,{condition:s,t:r,e:a}=t,i=new rW(s.shape.length,r.shape,r.shape.length);return n.runWebGLProgram(i,[s,r,a],Gi(r.dtype,a.dtype))}},iW=IF({opSnippet:`\n // Stable and Attracting Fixed Point (0, 1) for Normalized Weights.\n // see: https://arxiv.org/abs/1706.02515\n float scaleAlpha = ${Um};\n float scale = ${Gm};\n return (x >= 0.0) ? scale * x : scaleAlpha * (exp(x) - 1.0);\n`}),oW={kernelName:ea,backendName:"webgl",kernelFunc:iW},lW=IF({opSnippet:_F+"\n return 1.0 / (1.0 + exp(-1.0 * x));\n",packedOpSnippet:"\n vec4 result = 1.0 / (1.0 + exp(-1.0 * x));\n bvec4 isNaN = isnan(x);\n\n result.r = isNaN.r ? x.r : result.r;\n result.g = isNaN.g ? x.g : result.g;\n result.b = isNaN.b ? x.b : result.b;\n result.a = isNaN.a ? x.a : result.a;\n\n return result;\n",cpuKernelImpl:AM}),uW={kernelName:aa,backendName:"webgl",kernelFunc:lW},cW=IF({opSnippet:"\n if (isnan(x)) { return 0.0; }\n return sign(x);\n"}),hW={kernelName:ra,backendName:"webgl",kernelFunc:cW},dW=IF({opSnippet:_F+"\n return sin(x);\n",packedOpSnippet:`\n vec4 result = sin(x);\n bvec4 isNaN = isnan(x);\n ${mF}\n return result;\n`}),pW={kernelName:na,backendName:"webgl",kernelFunc:dW},fW=IF({opSnippet:"\n float e2x = exp(x);\n return (e2x - 1.0 / e2x) / 2.0;\n"}),mW={kernelName:sa,backendName:"webgl",kernelFunc:fW},gW=IF({opSnippet:"\n float epsilon = 1.1920928955078125e-7;\n float threshold = log(epsilon) + 2.0;\n\n bool too_large = x > -threshold;\n bool too_small = x < threshold;\n\n float result;\n float exp_x = exp(x);\n\n if (too_large){\n result = x;\n }\n else if (too_small){\n result = exp_x;\n }\n else{\n result = log(exp_x + 1.0);\n }\n return result;\n"}),yW={kernelName:ia,backendName:"webgl",kernelFunc:gW},bW={kernelName:ua,backendName:"webgl",kernelFunc:e=>{const{inputs:t,backend:n,attrs:s}=e,{x:r}=t,{blockShape:a,paddings:i}=s;qt(r.shape.length<=4,(()=>"spaceToBatchND for rank > 4 with a WebGL backend not implemented yet"));const o=a.reduce(((e,t)=>e*t)),l=[[0,0]];l.push(...i);for(let e=1+a.length;en.disposeIntermediateTensorInfo(e))),g}};const wW={kernelName:da,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:n}=e,{indices:s,values:r,denseShape:a,defaultValue:i}=t;if(1!==a.shape.length)throw new Error(`Dense shape must be a vector, saw:\n ${a.shape}`);if(2!==s.shape.length)throw new Error(`Indices must be a matrix, saw:\n ${s.shape}`);if(1!==r.shape.length)throw new Error(`Values must be a vector, saw:\n ${r.shape}`);if(0!==i.shape.length)throw new Error(`Default value must be a scalar, saw:\n ${i.shape}`);const o=n.readSync(s.dataId),l=n.readSync(r.dataId),u=n.readSync(a.dataId),c=n.readSync(i.dataId)[0],[h,d,p,f,m]=SM(o,s.shape,s.dtype,l,r.dtype,u,c);return[n.makeTensorInfo(d,s.dtype,h),n.makeTensorInfo([d[0]],r.dtype,p),n.makeTensorInfo([f.length],"bool",new Uint8Array(f.map((e=>Number(e))))),n.makeTensorInfo([m.length],s.dtype,new Int32Array(m))]}};const vW={kernelName:pa,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:n}=e,{inputIndices:s,inputShape:r,newShape:a}=t;if(2!==s.shape.length)throw new Error(`Input indices should be a matrix but received shape ${s.shape}`);if(1!==r.shape.length)throw new Error(`Input shape should be a vector but received shape ${r.shape}`);if(1!==a.shape.length)throw new Error(`Target shape should be a vector but received shape ${a.shape}`);const i=Array.from(n.readSync(r.dataId)),o=n.readSync(s.dataId),l=Array.from(n.readSync(a.dataId)),[u,c,h]=EM(o,s.shape,s.dtype,i,l);return[n.makeTensorInfo(c,s.dtype,u),n.makeTensorInfo([h.length],a.dtype,new Int32Array(h))]}};const xW={kernelName:fa,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:n}=e,{data:s,indices:r,segmentIds:a}=t;if(s.shape.length<1)throw new Error("Data should be at least 1 dimensional but received scalar");if(1!==r.shape.length)throw new Error(`Indices should be a vector but received shape\n ${r.shape}`);if(1!==a.shape.length)throw new Error(`Segment ids should be a vector but received shape\n ${a.shape}`);const i=n.readSync(s.dataId),o=n.readSync(r.dataId),l=n.readSync(a.dataId),[u,c]=_M(i,s.shape,s.dtype,o,l,!0);return n.makeTensorInfo(c,s.dtype,u)}};const AW={kernelName:ma,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:n}=e,{data:s,indices:r,segmentIds:a}=t;if(s.shape.length<1)throw new Error("Data should be at least 1 dimensional but received scalar");if(1!==r.shape.length)throw new Error(`Indices should be a vector but received shape\n ${r.shape}`);if(1!==a.shape.length)throw new Error(`Segment ids should be a vector but received shape\n ${a.shape}`);const i=n.readSync(s.dataId),o=n.readSync(r.dataId),l=n.readSync(a.dataId),[u,c]=_M(i,s.shape,s.dtype,o,l);return n.makeTensorInfo(c,s.dtype,u)}};const kW={kernelName:ga,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:n,attrs:s}=e,{sparseIndices:r,sparseValues:a,defaultValue:i}=t,{outputShape:o}=s,{sliceRank:l,numUpdates:u,sliceSize:c,strides:h,outputSize:d}=Wp(0,r,o),p=!1;if("string"===a.dtype){const e=n.bufferSync(r),t=n.bufferSync(a),s=gi(n.readSync(i.dataId)[0]),f=xM(e,t,o,d,c,u,l,h,s,p);return n.makeTensorInfo(o,f.dtype,f.values)}const f=new JV(u,l,r.shape.length,a.shape.length,h,[d,1],p),m=n.runWebGLProgram(f,[a,r,i],a.dtype),g=zF({inputs:{x:m},backend:n,attrs:{shape:o}});return n.disposeIntermediateTensorInfo(m),g}};const CW={kernelName:ca,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:n,attrs:s}=e,{x:r}=t,{numOrSizeSplits:a,axis:i}=s,o=en(i,r.shape)[0],l=fg(r,a,o),u=r.shape.length,c=new Array(u).fill(0),h=r.shape.slice();return l.map((e=>{const t=[...h];t[o]=e;const s=qB({inputs:{x:r},backend:n,attrs:{begin:c,size:t}});return c[o]+=e,s}))}},SW="return sqrt(x);",EW=IF({opSnippet:SW,packedOpSnippet:SW,cpuKernelImpl:IM}),_W={kernelName:oa,backendName:"webgl",kernelFunc:EW},IW={kernelName:ba,backendName:"webgl",kernelFunc:IF({opSnippet:"return x * x;"})},TW="return (a - b) * (a - b);",NW=TF({opSnippet:TW,packedOpSnippet:TW}),OW={kernelName:ya,backendName:"webgl",kernelFunc:NW};const RW={kernelName:wa,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:n,attrs:s}=e,{x:r}=t;if("string"!==r.dtype)throw new Error("Input must be of datatype string");const a=Ng(n.readSync(r.dataId)),i=TM(a,"string",s);return n.makeTensorInfo(r.shape,"string",i)}};const DW={kernelName:Fa,backendName:"webgl",kernelFunc:function({inputs:e,attrs:t,backend:n}){const{x:s}=e,r=KM+`\n return x > 0.0 ? 1.0 : float(${t.alpha});\n `,a=new $M(s.shape,r);return n.runWebGLProgram(a,[s],s.dtype)}};class MW{constructor(e,t,n){this.variableNames=["x"],this.outputShape=n;const s=n.length,r=bD(n.length),a=bD(n.length);let i="";if(1===s)i="coords * strides + begin";else{let e=0;i=n.map(((t,s)=>(e++,1===n.length?`coords * strides[${s}] + begin[${s}]`:`coords[${e-1}] * strides[${s}] + begin[${s}]`))).join(",")}this.userCode=`\n ${r} begin = ${r}(${e});\n ${r} strides = ${r}(${t});\n\n void main() {\n ${a} coords = getOutputCoords();\n setOutput(getX(${i}));\n }\n `}}const FW={kernelName:va,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:n,attrs:s}=e,{x:r}=t,{begin:a,end:i,strides:o,beginMask:l,endMask:u,ellipsisMask:c,newAxisMask:h,shrinkAxisMask:d}=s,{finalShapeSparse:p,finalShape:f,isIdentity:m,sliceDim0:g,isSimpleSlice:y,begin:b,end:w,strides:v}=ec(r.shape,a,i,o,l,u,c,h,d);let x;if(m)x=zF({inputs:{x:r},backend:n,attrs:{shape:f}});else if(g||y){qt(r.shape.length>=1,(()=>`Input must have rank at least 1, got: ${r.shape.length}`));const e=Wu(b,w,v),t=qB({inputs:{x:r},backend:n,attrs:{begin:b,size:e}});x=zF({inputs:{x:t},backend:n,attrs:{shape:f}}),n.disposeIntermediateTensorInfo(t)}else{if(n.shouldExecuteOnCPU([r])){const e=n.readSync(r.dataId),t=Tl(r.shape,r.dtype,e),s=NM(p,t,v,b);x=n.makeTensorInfo(f,r.dtype,s.values)}else{const e=new MW(b,v,p);x=n.runWebGLProgram(e,[r],r.dtype)}}const A=zF({inputs:{x},backend:n,attrs:{shape:f}});return n.disposeIntermediateTensorInfo(x),A}};const BW={kernelName:xa,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:n,attrs:s}=e,{separator:r,nGramWidths:a,leftPad:i,rightPad:o,padWidth:l,preserveShortSequences:u}=s,{data:c,dataSplits:h}=t,d=n.readSync(c.dataId),p=n.readSync(h.dataId),[f,m]=OM(d,p,r,a,i,o,l,u);return[n.makeTensorInfo([f.length],"string",f),n.makeTensorInfo(h.shape,"int32",m)]}};const zW={kernelName:Aa,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:n,attrs:s}=e,{skipEmpty:r}=s,{input:a,delimiter:i}=t;if("string"!==a.dtype)throw new Error("Input must be of datatype string");if(1!==a.shape.length)throw new Error(`Input must be a vector, got shape: ${a.shape}`);if(0!==i.shape.length)throw new Error(`Delimiter must be a scalar, got shape: ${i.shape}`);const o=n.readSync(a.dataId),l=n.readSync(i.dataId)[0],[u,c,h]=RM(o,l,r),d=c.length;return[n.makeTensorInfo([d,2],"int32",u),n.makeTensorInfo([d],"string",c),n.makeTensorInfo([2],"int32",new Int32Array(h))]}};const LW={kernelName:ka,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:n,attrs:s}=e,{numBuckets:r}=s,{input:a}=t;if("string"!==a.dtype)throw new Error("Input must be of datatype string");if(r<=0)throw new Error("Number of buckets must be at least 1");const i=n.readSync(a.dataId),o=DM(i,r);return n.makeTensorInfo(a.shape,"int32",o)}},PW=IF({opSnippet:"return tan(x);"}),VW={kernelName:Sa,backendName:"webgl",kernelFunc:PW},WW=IF({opSnippet:"\n float e2x = exp(-2.0 * abs(x));\n return sign(x) * (1.0 - e2x) / (1.0 + e2x);\n"}),UW={kernelName:Ea,backendName:"webgl",kernelFunc:WW};const GW={kernelName:Yr,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:n,attrs:s}=e,{tensor:r,indices:a,updates:i}=t,{}=s,{sliceRank:o,numUpdates:l,sliceSize:u,strides:c,outputSize:h}=Wp(0,a,r.shape),d=[h/u,u];if(0===h)return n.makeTensorInfo(r.shape,a.dtype);const p=zF({inputs:{x:a},backend:n,attrs:{shape:[l,o]}}),f=zF({inputs:{x:i},backend:n,attrs:{shape:[l,u]}}),m=zF({inputs:{x:r},backend:n,attrs:{shape:d}}),g=new JV(l,o,p.shape.length,f.shape.length,c,d,!1,!0),y=n.runWebGLProgram(g,[f,p,m],m.dtype),b=zF({inputs:{x:y},backend:n,attrs:{shape:r.shape}});return n.disposeIntermediateTensorInfo(p),n.disposeIntermediateTensorInfo(f),n.disposeIntermediateTensorInfo(m),n.disposeIntermediateTensorInfo(y),b}};class qW{constructor(e,t){this.variableNames=["A"];const n=new Array(e.length);for(let s=0;s5)throw Error(`Tile for rank ${t} is not yet supported`);if(1===t)return`imod(resRC, ${e[0]})`;const n=["resRC.x","resRC.y","resRC.z","resRC.w","resRC.u"],s=[];for(let t=0;t5){const e=n.readSync(r.dataId),t="string"===r.dtype?e.map((e=>gi(e))):e,s=Tl(r.shape,r.dtype,t),i=FM(s,a);return n.makeTensorInfo(i.shape,i.dtype,i.values)}const i=new qW(r.shape,a);return n.runWebGLProgram(i,[r],r.dtype)}const HW={kernelName:_a,backendName:"webgl",kernelFunc:jW};class $W{constructor(e){this.variableNames=["x","indices"],this.customUniforms=[{name:"n",type:"int"},{name:"firstPass",type:"int"},{name:"negativeInf",type:"float"},{name:"dir",type:"int"},{name:"inc",type:"int"}],this.outputShape=e,this.userCode="\n void main() {\n ivec2 coords = getOutputCoords();\n int batch = coords[0];\n int elemIdx = coords[1];\n\n // We compare elements pair-wise within a group of size 2 * inc.\n // The comparing rule for each group alternates between ascending\n // and descending. Within each group, we compare each pair at\n // positions i and i+inc. To decide whether an element at position i\n // is x0 or x1, we mod it by 2 * inc, if the result is smaller than\n // inc, it is in the first half of the group, we denote it as x0,\n // otherwise we denote it as x1.\n // For example, as shown in the Bitonic top K paper referenced above,\n // Figure5(a) shows that element[1] is in the\n // second half of the group when group size is 2, but it is in the\n // first half of the group when group size is 4.\n\n bool isFirstInPair = imod(elemIdx, 2 * inc) < inc;\n int i = isFirstInPair ? elemIdx : elemIdx - inc;\n\n int i0 = firstPass == 1 ? i : int(getIndices(batch, i));\n int i1 = firstPass == 1 ? i + inc : int(getIndices(batch, i + inc));\n float x0 = i0 < n ? getX(batch, i0) : negativeInf;\n float x1 = i1 < n ? getX(batch, i1) : negativeInf;\n\n // Denotes which direction indices are in (ascending or descending).\n bool reverse = imod(elemIdx, 2 * dir) >= dir;\n bool isGreater = x0 > x1 || (x0 == x1 && i1 > i0);\n if (reverse == isGreater) { // Elements in opposite order of direction\n int iTemp = i0;\n i0 = i1;\n i1 = iTemp;\n }\n if (isFirstInPair) {\n setOutput(float(i0));\n } else {\n setOutput(float(i1));\n }\n }\n "}}class KW{constructor(e){this.variableNames=["x","indices"],this.customUniforms=[{name:"n",type:"int"},{name:"firstPass",type:"int"},{name:"k",type:"int"}],this.outputShape=e,this.userCode="\n void main() {\n // Takes max of indices (0, k), (1, k + 1), (2, k + 2) ...\n ivec2 coords = getOutputCoords();\n int batch = coords[0];\n int elemIdx = coords[1];\n\n // The output size is half of the previous size.\n // If the previous sequence is | | | | _ _ _ _ | | | | _ _ _ _ (k=4),\n // we only need to output the indices at positions |, the indices at\n // positions _ can be thrown away, see Figure5(b) After Phase 2\n // (Merge phase) in the Bitonic Top K paper referenced above.\n // For example, the paper shows we only need to output the orange bars.\n // The output sequence should look like this | | | | | | | |.\n // Because the sequence is halved, to map the output index back\n // to the previous sequence to find the corresponding value,\n // we need to double the index. When we double the index,\n // we basically interpolate a position, so 2i looks like\n // | _ | _ | _ | _ | _ | _ | _. We move the | to the first k position\n // of each 2k positions by - elemIdx % k. E.g. for output at\n // index 4,5,6,7, we want to get the corresponding element at\n // original index 8,9,10,11, for output at index 8,9,10,11,\n // we want to get the corresponding element at original index\n // 16,17,18,19, so on and so forth.\n\n int i = elemIdx < k ? elemIdx : (elemIdx * 2 - imod(elemIdx, k));\n int i0 = firstPass == 1 ? i : int(getIndices(batch, i));\n int i1 = firstPass == 1 ? i + k : int(getIndices(batch, i + k));\n\n float x0 = getX(batch, i0);\n float x1 = i1 < n ? getX(batch, i1) : x0;\n\n setOutput(x0 >= x1 ? float(i0) : float(i1));\n }\n "}}function XW(e,t){null!==t&&e.disposeIntermediateTensorInfo(t)}function ZW(e){let t=1;for(;tl){const e=n.readSync(r.dataId),[t,s]=BM(e,u,r.dtype,a,i);return[n.makeTensorInfo(t.shape,t.dtype,t.values),n.makeTensorInfo(s.shape,s.dtype,s.values)]}if(0===a)return u[u.length-1]=0,[n.makeTensorInfo(u,r.dtype,[]),n.makeTensorInfo(u,"int32",[])];if(1===c)return[r,TL({attrs:{shape:u,dtype:"int32",value:0},backend:n})];const h=n.texData.get(r.dataId),d=null!==h&&h.isPacked,p=d?n.unpackTensor(r):r,f=$t(u)/c,m=zF({inputs:{x:p},attrs:{shape:[f,c]},backend:n});d&&XW(n,p);const g=ZW(a),y=ZW(c);let b=null;const w=()=>null===b?[m,m]:[m,b],v=(e,t,s)=>{const r=w(),a=new $W(s),i=[[c],[null===b?1:0],[Number.NEGATIVE_INFINITY],[e],[t]],o=b;b=n.runWebGLProgram(a,r,"int32",i),XW(n,o)};for(let e=1;e=1;n/=2)v(t,n,[f,y])}for(let e=y;e>g;e/=2){const t=w(),s=new KW([f,e/2]),r=[[c],[null===b?1:0],[g]],a=b;b=n.runWebGLProgram(s,t,"int32",r),XW(n,a);const i=g/2,o=2*i;for(let e=i;e>=1;e/=2)v(o,e,b.shape)}let x=b;b=qB({inputs:{x:b},backend:n,attrs:{begin:0,size:[f,a]}}),XW(n,x);let A=KL({inputs:{x:m,indices:b},backend:n,attrs:{axis:1,batchDims:1}});XW(n,m);const k=u.slice(0,-1);k.push(a),x=b,b=zF({inputs:{x:b},attrs:{shape:k},backend:n}),XW(n,x);const C=A;return A=zF({inputs:{x:A},attrs:{shape:k},backend:n}),XW(n,C),[A,b]}};class QW{constructor(e,t,n,s,r,a){this.variableNames=["Image","Transforms"],this.outputShape=a;const i="nearest"===n?1:2;let o;switch(s){case"constant":default:o=1;break;case"reflect":o=2;break;case"wrap":o=3;break;case"nearest":o=4}this.userCode=`\n float mapCoord(float outCoord, float len) {\n float inCoord = outCoord;\n if(${o} == 2) {\n if (inCoord < 0.0) {\n if (len <= 1.0) {\n inCoord = 0.0;\n } else {\n float sz2 = 2.0 * len;\n if (inCoord < sz2) {\n inCoord = sz2 * float(int(float(-inCoord / sz2))) +\n inCoord;\n }\n inCoord = inCoord < -len ? inCoord + sz2 : -inCoord - 1.0;\n }\n } else if (inCoord > len - 1.0) {\n if (len <= 1.0) {\n inCoord = 0.0;\n } else {\n float sz2 = 2.0 * len;\n inCoord -= sz2 * float(int(float(inCoord / sz2)));\n if (inCoord >= len) {\n inCoord = sz2 - inCoord - 1.0;\n }\n }\n }\n return clamp(inCoord, 0.0, len - 1.0);\n } else if (${o} == 3) {\n if (inCoord < 0.0) {\n if (len <= 1.0) {\n inCoord = 0.0;\n } else {\n float sz = len - 1.0;\n inCoord += len * (float(int(float(-inCoord / sz))) + 1.0);\n }\n } else if (inCoord > len - 1.0) {\n if (len <= 1.0) {\n inCoord = 0.0;\n } else {\n float sz = len - 1.0;\n inCoord -= len * float(int(float(inCoord / sz)));\n }\n }\n return clamp(inCoord, 0.0, len - 1.0);\n } else if (${o} == 4) {\n return clamp(outCoord, 0.0, len - 1.0);\n } else {\n return outCoord;\n }\n }\n\n float readWithFillValue(int batch, int coordY, int coordX,\n int channel) {\n float outputValue;\n if (0 <= coordY && coordY < ${e} && 0 <= coordX && coordX < ${t}) {\n outputValue = getImage(batch, coordY, coordX, channel);\n } else {\n outputValue = float(${r});\n }\n return outputValue;\n }\n\n void main() {\n ivec4 coords = getOutputCoords();\n float outputValue;\n int batch = coords[0];\n int x = coords[2];\n int y = coords[1];\n int channel = coords[3];\n float xf = float(x);\n float yf = float(y);\n float a1 = getTransforms(batch, 0);\n float a2 = getTransforms(batch, 1);\n float a3 = getTransforms(batch, 2);\n float b1 = getTransforms(batch, 3);\n float b2 = getTransforms(batch, 4);\n float b3 = getTransforms(batch, 5);\n float c1 = getTransforms(batch, 6);\n float c2 = getTransforms(batch, 7);\n float projection = c1 * xf + c2 * yf + 1.0;\n if (projection == 0.0) {\n outputValue = float(${r});\n } else {\n float inX = (a1 * xf + a2 * yf + a3) / projection;\n float inY = (b1 * xf + b2 * yf + b3) / projection;\n float mapX = mapCoord(inX, float(${t}));\n float mapY = mapCoord(inY, float(${e}));\n\n if (${i} == 1) {\n int coordY = int(round(mapY));\n int coordX = int(round(mapX));\n outputValue = readWithFillValue(batch, coordY, coordX,\n channel);\n } else {\n float yFloor = floor(mapY);\n float xFloor = floor(mapX);\n float yCeil = yFloor + 1.0;\n float xCeil = xFloor + 1.0;\n float valueYFloor = (xCeil - mapX) *\n readWithFillValue(batch, int(yFloor), int(xFloor), channel) +\n (mapX - xFloor) *\n readWithFillValue(batch, int(yFloor), int(xCeil), channel);\n float valueYCeil = (xCeil - mapX) *\n readWithFillValue(batch, int(yCeil), int(xFloor), channel) +\n (mapX - xFloor) *\n readWithFillValue(batch, int(yCeil), int(xCeil), channel);\n outputValue = (yCeil - mapY) * valueYFloor +\n (mapY - yFloor) * valueYCeil;\n }\n }\n setOutput(outputValue);\n }\n `}}const JW={kernelName:Ta,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:n,attrs:s}=e,{image:r,transforms:a}=t,{interpolation:i,fillMode:o,fillValue:l,outputShape:u}=s,[c,h,d,p]=r.shape,[f,m]=null!=u?u:[h,d],g=new QW(h,d,i,o,l,[c,f,m,p]);return n.runWebGLProgram(g,[r,a],"float32")}};const eU={kernelName:Oa,backendName:"webgl",kernelFunc:function(e){const{inputs:t,attrs:n,backend:s}=e,{axis:r}=n,{x:a}=t;JR(a,"unique");const i=s.readSync(a.dataId),{outputValues:o,outputShape:l,indices:u}=LM(i,r,a.shape,a.dtype);return[s.makeTensorInfo(l,a.dtype,o),s.makeTensorInfo([u.length],"int32",u)]}};const tU={kernelName:Ra,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:n,attrs:s}=e,{value:r}=t;let{axis:a}=s;a<0&&(a+=r.shape.length);const i=r,o=i.shape.length,l=r.shape[a],u=new Array(o-1);let c=0;for(let e=0;en.disposeIntermediateTensorInfo(e))),f}};class nU{constructor(e,t){this.variableNames=["x","segmentIds"];const n=e.windowSize,s=e.batchSize,r=e.inSize,a=e.numSegments,i=a*Math.ceil(r/n);this.outputShape=[s,i];const o=4*Math.floor(n/4),l=n%4,u="\n sumValue += dot(values, segFilter);\n ";let c="";r%n>0&&(c=`\n if (inIdx < 0 || inIdx >= ${r}) {\n return initializationValue;\n }\n `);let h="";r%n>0&&(h=`\n if (inIdx < 0 || inIdx >= ${r}) {\n return -1.0;\n }\n `),this.userCode=`\n const float initializationValue = 0.0;\n\n float getValue(int batch, int inIdx) {\n ${c}\n return getX(batch, inIdx);\n }\n\n float getSegmentIdAtIndex(int inIdx) {\n ${h}\n return getSegmentIds(inIdx);\n }\n\n void main() {\n ivec2 coords = getOutputCoords();\n int batch = coords[0];\n int outIdx = coords[1];\n int inOffset = int(floor(float(outIdx) / float(\n ${a})) * float(${n}));\n int currentSeg = int(mod(float(outIdx), float(${a})));\n\n float sumValue = 0.0;\n\n for (int i = 0; i < ${o}; i += 4) {\n int inIdx = inOffset + i;\n vec4 values = vec4(\n getValue(batch, inIdx),\n getValue(batch, inIdx + 1),\n getValue(batch, inIdx + 2),\n getValue(batch, inIdx + 3)\n );\n\n vec4 segFilter = vec4(\n int(getSegmentIdAtIndex(inIdx)) == currentSeg ? 1 : 0,\n int(getSegmentIdAtIndex(inIdx + 1)) == currentSeg ? 1 : 0,\n int(getSegmentIdAtIndex(inIdx + 2)) == currentSeg ? 1 : 0,\n int(getSegmentIdAtIndex(inIdx + 3)) == currentSeg ? 1 : 0\n );\n\n ${u}\n }\n\n int inIdx = inOffset + ${o};\n if (${1===l}) {\n vec4 values = vec4(\n getValue(batch, inIdx),\n initializationValue,\n initializationValue,\n initializationValue\n );\n\n int inIdxSeg = int(getSegmentIdAtIndex(inIdx));\n\n vec4 segFilter = vec4(\n int(getSegmentIdAtIndex(inIdx)) == currentSeg ? 1 : 0,\n 0,\n 0,\n 0\n );\n\n ${u}\n } else if (${2===l}) {\n vec4 values = vec4(\n getValue(batch, inIdx),\n getValue(batch, inIdx + 1),\n initializationValue,\n initializationValue\n );\n\n vec4 segFilter = vec4(\n int(getSegmentIdAtIndex(inIdx)) == currentSeg ? 1 : 0,\n int(getSegmentIdAtIndex(inIdx + 1)) == currentSeg ? 1 : 0,\n 0,\n 0\n );\n\n ${u}\n } else if (${3===l}) {\n vec4 values = vec4(\n getValue(batch, inIdx),\n getValue(batch, inIdx + 1),\n getValue(batch, inIdx + 2),\n initializationValue\n );\n\n vec4 segFilter = vec4(\n int(getSegmentIdAtIndex(inIdx)) == currentSeg ? 1 : 0,\n int(getSegmentIdAtIndex(inIdx + 1)) == currentSeg ? 1 : 0,\n int(getSegmentIdAtIndex(inIdx + 2)) == currentSeg ? 1 : 0,\n 0\n );\n\n ${u}\n }\n setOutput(sumValue);\n }\n `}}const sU={kernelName:Da,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:n,attrs:s}=e,{x:r,segmentIds:a}=t,{numSegments:i}=s,o=r.shape.length,l=[];let u=0;const c=Ih([u],o);let h=r;null!=c&&(h=$F({inputs:{x:r},backend:n,attrs:{perm:c}}),l.push(h),u=Nh(1,o)[0]);const d=Ig(h.shape,u,i),p=$t([h.shape[u]]),f=zF({inputs:{x:h},backend:n,attrs:{shape:[-1,p]}});l.push(f);const m=qi(r.dtype),g=(e,t,s,r,a)=>{const i=e.shape[0],o=e.shape[1],u=_g(o,a),c=new nU({windowSize:u,inSize:o,batchSize:i,numSegments:a},t),h=n.compileAndRun(c,[e,s],r);if(l.push(h),h.shape[1]===a)return h;const d=EV({backend:n,attrs:{start:0,stop:a,step:1,dtype:"float32"}}),p=jW({inputs:{x:d},backend:n,attrs:{reps:[o/u]}});l.push(d),l.push(p);return g(h,t,p,r,a)},y=zF({inputs:{x:g(f,"unsortedSegmentSum",a,m,i)},backend:n,attrs:{shape:d}});let b=y;if(null!=c){l.push(y);const e=Th(c);b=$F({inputs:{x:b},backend:n,attrs:{perm:e}})}return l.forEach((e=>n.disposeIntermediateTensorInfo(e))),b}},rU=[YF,JF,tB,sB,iB,uB,cB,hB,yB,bB,vB,AB,CB,EB,IB,OB,RB,FB,BB,zB,VB,HB,$B,KB,XB,tz,rz,oz,vF,cz,bz,Ez,Oz,Dz,Mz,Fz,Bz,Lz,Vz,Uz,Kz,Xz,Zz,Qz,tL,rL,aL,oL,uL,cL,dL,pL,mL,yL,wL,xL,CL,_L,NL,RL,FL,zL,VL,GL,qL,HL,XL,YL,JL,bF,eP,mz,nP,rP,iP,kF,lP,cP,hP,pP,mP,yP,wP,xP,CP,EP,IP,NP,OP,RP,FP,BP,zP,LP,PP,WP,qP,HP,tV,BF,sV,aV,oV,uV,YB,hV,fV,mV,wV,xV,EF,AV,kV,CV,SV,_V,JB,XP,TV,OV,DV,LF,BV,LV,WV,GV,HV,KV,ZV,QV,tW,sW,aW,oW,uW,hW,pW,mW,jB,eV,yW,bW,wW,vW,xW,AW,kW,CW,_W,IW,OW,RW,DW,FW,BW,zW,LW,QP,HF,VW,UW,GW,HW,YW,JW,KF,eU,tU,sU,pV];for(const e of rU)Ka(e);__webpack_require__(9464);const aU={moveTickSize:50,videoContainerId:"webgazerVideoContainer",videoElementId:"webgazerVideoFeed",videoElementCanvasId:"webgazerVideoCanvas",faceOverlayId:"webgazerFaceOverlay",faceFeedbackBoxId:"webgazerFaceFeedbackBox",gazeDotId:"webgazerGazeDot",videoViewerWidth:320,videoViewerHeight:240,faceFeedbackBoxRatio:.66,showVideo:!0,mirrorVideo:!0,showFaceOverlay:!0,showFaceFeedbackBox:!0,showGazeDot:!0,camConstraints:{video:{width:{min:320,ideal:640,max:1920},height:{min:240,ideal:480,max:1080},facingMode:"user"}},dataTimestep:50,showVideoPreview:!0,applyKalmanFilter:!0,saveDataAcrossSessions:!0,storingPoints:!1,videoIsOn:!1,trackEye:"both"};__webpack_require__(6003);var iU=__webpack_require__(7350),oU=__webpack_require__.n(iU),lU=__webpack_require__(8990),uU=function(){return uU=Object.assign||function(e){for(var t,n=1,s=arguments.length;n0&&r[r.length-1])||6!==a[0]&&2!==a[0])){i=0;continue}if(3===a[0]&&(!r||a[1]>r[0]&&a[1]>>0)+"_",r=0;return function e(n){if(this instanceof e)throw new TypeError("Symbol is not a constructor");return new t(s+(n||"")+"_"+r++,n)}})),r("Symbol.iterator",(function(e){if(e)return e;e=Symbol("Symbol.iterator");for(var r="Array Int8Array Uint8Array Uint8ClampedArray Int16Array Uint16Array Int32Array Uint32Array Float32Array Float64Array".split(" "),i=0;i(t=t||0)&&(t=Math.max(t+s,0));t>2];i=t[(3&i)<<4|o>>4],o=t[(15&o)<<2|l>>6],l=t[63&l],n[a++]=u+i+o+l}switch(u=0,l=s,e.length-r){case 2:l=t[(15&(u=e[r+1]))<<2]||s;case 1:e=e[r],n[a]=t[e>>2]+t[(3&e)<<4|u>>4]+l+s}return n.join("")}function F(e){var t=e.length,n=3*t/4;n%3?n=Math.floor(n):-1!="=.".indexOf(e[t-1])&&(n=-1!="=.".indexOf(e[t-2])?n-2:n-1);var s=new Uint8Array(n),r=0;return function(e,t){function n(t){for(;s>4),64!=i&&(t(a<<4&240|i>>2),64!=o&&t(i<<6&192|o))}}(e,(function(e){s[r++]=e})),r!==n?s.subarray(0,r):s}function B(){if(!D){D={};for(var e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789".split(""),t=["+/=","+/","-_=","-_.","-_"],n=0;5>n;n++){var s=e.concat(t[n].split(""));R[n]=s;for(var r=0;re.i)throw Error("Tried to read past the end of the data "+e.g+" > "+e.i)}function K(e){var t=e.h,n=t[e.g],s=127&n;if(128>n)return e.g+=1,$(e),s;if(s|=(127&(n=t[e.g+1]))<<7,128>n)return e.g+=2,$(e),s;if(s|=(127&(n=t[e.g+2]))<<14,128>n)return e.g+=3,$(e),s;if(s|=(127&(n=t[e.g+3]))<<21,128>n)return e.g+=4,$(e),s;if(n=t[e.g+4],e.g+=5,s|=(15&n)<<28,128>n)return $(e),s;if(128<=t[e.g++]&&128<=t[e.g++]&&128<=t[e.g++]&&128<=t[e.g++]&&128<=t[e.g++])throw q();return $(e),s}j.prototype.reset=function(){this.g=this.j};var X=[];function Z(){this.g=[]}function Y(e,t){for(;127>>=7;e.g.push(t)}function Q(e){var t={},n=void 0!==t.W&&t.W;this.l={v:void 0!==t.v&&t.v},this.W=n,t=this.l,X.length?(n=X.pop(),t&&(n.v=t.v),e&&H(n,e),e=n):e=new j(e,t),this.g=e,this.j=this.g.g,this.h=this.i=-1}function J(e){var t=e.g;if(t.g==t.i)return!1;e.j=e.g.g;var n=K(e.g)>>>0;if(t=n>>>3,!(0<=(n&=7)&&5>=n))throw G(n,e.j);if(1>t)throw Error("Invalid field number: "+t+" (at position "+e.j+")");return e.i=t,e.h=n,!0}function ee(e){switch(e.h){case 0:if(0!=e.h)ee(e);else e:{for(var t=(e=e.g).g,n=t+10;t>>0,(e=e.g).g+=t,$(e));break;case 5:(e=e.g).g+=4,$(e);break;case 3:for(t=e.i;;){if(!J(e))throw Error("Unmatched start-group tag: stream EOF");if(4==e.h){if(e.i!=t)throw Error("Unmatched end-group tag");break}ee(e)}break;default:throw G(e.h,e.j)}}Z.prototype.length=function(){return this.g.length},Z.prototype.end=function(){var e=this.g;return this.g=[],e},Q.prototype.reset=function(){this.g.reset(),this.j=this.g.g,this.h=this.i=-1};var te=[];function ne(){this.i=[],this.h=0,this.g=new Z}function se(e,t){0!==t.length&&(e.i.push(t),e.h+=t.length)}var re="function"==typeof Symbol&&"symbol"==typeof Symbol()?Symbol(void 0):void 0;function ae(e,t){Object.isFrozen(e)||(re?e[re]|=t:void 0!==e.N?e.N|=t:Object.defineProperties(e,{N:{value:t,configurable:!0,writable:!0,enumerable:!1}}))}function ie(e){var t;return null==(t=re?e[re]:e.N)?0:t}function oe(e){return ae(e,1),e}function le(e){return!!Array.isArray(e)&&!!(2&ie(e))}function ue(e){if(!Array.isArray(e))throw Error("cannot mark non-array as immutable");ae(e,2)}function ce(e){return null!==e&&"object"==typeof e&&!Array.isArray(e)&&e.constructor===Object}var he=Object.freeze(oe([]));function de(e){if(le(e.m))throw Error("Cannot mutate an immutable Message")}var pe,fe="undefined"!=typeof Symbol&&void 0!==Symbol.hasInstance;function me(e){return{value:e,configurable:!1,writable:!1,enumerable:!1}}function ge(e,t,n){return-1===t?null:t>=e.i?e.g?e.g[t]:void 0:void 0!==n&&n&&e.g&&null!=(n=e.g[t])?n:e.m[t+e.h]}function ye(e,t,n,s){s=void 0!==s&&s,de(e),tte.length&&te.push(e)}}function tt(e,t,n){for(var s=n.length,r=1==s%2,a=r?1:0;a>>0)>>31)+1,s=r>>>23&255,r&=8388607,ye(t,n,255==s?r?NaN:1/0*e:0==s?e*Math.pow(2,-149)*r:e*Math.pow(2,s-150)*(r+Math.pow(2,23))),!0}),(function(e,t,n){if(null!=(t=ge(t,n))){Y(e.g,8*n+5),e=e.g;var s=t;0===(s=(n=0>s?1:0)?-s:s)?U=0<1/s?0:2147483648:isNaN(s)?U=2147483647:34028234663852886e22>>0:11754943508222875e-54>s?(s=Math.round(s/Math.pow(2,-149)),U=(n<<31|s)>>>0):(t=Math.floor(Math.log(s)/Math.LN2),s*=Math.pow(2,-t),16777216<=(s=Math.round(8388608*s))&&++t,U=(n<<31|t+127<<23|8388607&s)>>>0),n=U,e.g.push(n>>>0&255),e.g.push(n>>>8&255),e.g.push(n>>>16&255),e.g.push(n>>>24&255)}})),at=st((function(e,t,n){if(0!==e.h)return!1;for(var s=e.g,r=128,a=0,i=e=0;4>i&&128<=r;i++)r=s.h[s.g++],$(s),a|=(127&r)<<7*i;if(128<=r&&(r=s.h[s.g++],$(s),a|=(127&r)<<28,e|=(127&r)>>4),128<=r)for(i=0;5>i&&128<=r;i++)r=s.h[s.g++],$(s),e|=(127&r)<<7*i+3;if(!(128>r))throw q();return s=a>>>0,(e=2147483648&(r=e>>>0))&&(r=~r>>>0,0==(s=1+~s>>>0)&&(r=r+1>>>0)),s=4294967296*r+(s>>>0),ye(t,n,e?-s:s),!0}),(function(e,t,n){if(null!=(t=ge(t,n))&&null!=t){Y(e.g,8*n),e=e.g;var s=t;for(n=0>s,t=(s=Math.abs(s))>>>0,s=Math.floor((s-t)/4294967296),s>>>=0,n&&(s=~s>>>0,4294967295<(t=1+(~t>>>0))&&(t=0,4294967295<++s&&(s=0))),n=U=t,t=s;0>>7|t<<25)>>>0,t>>>=7;e.g.push(n)}})),it=st((function(e,t,n){return 0===e.h&&(ye(t,n,K(e.g)),!0)}),(function(e,t,n){if(null!=(t=ge(t,n))&&null!=t)if(Y(e.g,8*n),e=e.g,0<=(n=t))Y(e,n);else{for(t=0;9>t;t++)e.g.push(127&n|128),n>>=7;e.g.push(1)}})),ot=st((function(e,t,n){if(2!==e.h)return!1;var s,r=K(e.g)>>>0,a=(e=e.g).g;if(e.g+=r,$(e),e=e.h,N)(s=I)||(s=I=new TextDecoder("utf-8",{fatal:!0})),s=s.decode(e.subarray(a,a+r));else{r=a+r;for(var i,o,l,u=[],c=null;a(i=e[a++])?u.push(i):224>i?a>=r?E():(o=e[a++],194>i||128!=(192&o)?(a--,E()):u.push((31&i)<<6|63&o)):240>i?a>=r-1?E():128!=(192&(o=e[a++]))||224===i&&160>o||237===i&&160<=o||128!=(192&(s=e[a++]))?(a--,E()):u.push((15&i)<<12|(63&o)<<6|63&s):244>=i?a>=r-2?E():128!=(192&(o=e[a++]))||o-144+(i<<28)>>30||128!=(192&(s=e[a++]))||128!=(192&(l=e[a++]))?(a--,E()):(i=(7&i)<<18|(63&o)<<12|(63&s)<<6|63&l,i-=65536,u.push(55296+(i>>10&1023),56320+(1023&i))):E(),8192<=u.length&&(c=_(c,u),u.length=0);s=_(c,u)}return ye(t,n,s),!0}),(function(e,t,n){if(null!=(t=ge(t,n))){var s=!1;if(s=void 0!==s&&s,O){if(s&&/(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])/.test(t))throw Error("Found an unpaired surrogate");t=(T||(T=new TextEncoder)).encode(t)}else{for(var r=0,a=new Uint8Array(3*t.length),i=0;io)a[r++]=o;else{if(2048>o)a[r++]=o>>6|192;else{if(55296<=o&&57343>=o){if(56319>=o&&i=l){o=1024*(o-55296)+l-56320+65536,a[r++]=o>>18|240,a[r++]=o>>12&63|128,a[r++]=o>>6&63|128,a[r++]=63&o|128;continue}i--}if(s)throw Error("Found an unpaired surrogate");o=65533}a[r++]=o>>12|224,a[r++]=o>>6&63|128}a[r++]=63&o|128}}t=a.subarray(0,r)}Y(e.g,8*n+2),Y(e.g,t.length),se(e,e.g.end()),se(e,t)}})),lt=st((function(e,t,n,s,r){if(2!==e.h)return!1;t=xe(t,n,s),n=e.g.i,s=K(e.g)>>>0;var a=e.g.g+s,i=a-n;if(0>=i&&(e.g.i=a,r(t,e),i=a-e.g.g),i)throw Error("Message parsing ended unexpectedly. Expected to read "+s+" bytes, instead read "+(s-i)+" bytes, either the data ended unexpectedly or the message misreported its own length");return e.g.g=a,e.g.i=n,!0}),(function(e,t,n,s,r){if(null!=(t=ve(t,s,n)))for(s=0;s>>=7,i.h++;a.push(o),i.h++}}));function ut(){Ne.apply(this,arguments)}if(p(ut,Ne),fe){var ct={};Object.defineProperties(ut,(ct[Symbol.hasInstance]=me(Object[Symbol.hasInstance]),ct))}function ht(e){ut.call(this,e)}function dt(){return[1,it,2,rt,3,ot,4,ot]}function pt(e){ut.call(this,e,-1,mt)}function ft(){return[1,lt,ht,dt]}p(ht,ut),p(pt,ut),pt.prototype.addClassification=function(e,t){return xe(this,1,ht,e,t),this};var mt=[1];function gt(e){ut.call(this,e)}function yt(){return[1,rt,2,rt,3,rt,4,rt,5,rt]}function bt(e){ut.call(this,e,-1,vt)}function wt(){return[1,lt,gt,yt]}p(gt,ut),p(bt,ut);var vt=[1];function xt(e){ut.call(this,e)}function At(){return[1,rt,2,rt,3,rt,4,rt,5,rt,6,at]}p(xt,ut);var kt=[[61,146],[146,91],[91,181],[181,84],[84,17],[17,314],[314,405],[405,321],[321,375],[375,291],[61,185],[185,40],[40,39],[39,37],[37,0],[0,267],[267,269],[269,270],[270,409],[409,291],[78,95],[95,88],[88,178],[178,87],[87,14],[14,317],[317,402],[402,318],[318,324],[324,308],[78,191],[191,80],[80,81],[81,82],[82,13],[13,312],[312,311],[311,310],[310,415],[415,308]],Ct=[[263,249],[249,390],[390,373],[373,374],[374,380],[380,381],[381,382],[382,362],[263,466],[466,388],[388,387],[387,386],[386,385],[385,384],[384,398],[398,362]],St=[[276,283],[283,282],[282,295],[295,285],[300,293],[293,334],[334,296],[296,336]],Et=[[33,7],[7,163],[163,144],[144,145],[145,153],[153,154],[154,155],[155,133],[33,246],[246,161],[161,160],[160,159],[159,158],[158,157],[157,173],[173,133]],_t=[[46,53],[53,52],[52,65],[65,55],[70,63],[63,105],[105,66],[66,107]],It=[[10,338],[338,297],[297,332],[332,284],[284,251],[251,389],[389,356],[356,454],[454,323],[323,361],[361,288],[288,397],[397,365],[365,379],[379,378],[378,400],[400,377],[377,152],[152,148],[148,176],[176,149],[149,150],[150,136],[136,172],[172,58],[58,132],[132,93],[93,234],[234,127],[127,162],[162,21],[21,54],[54,103],[103,67],[67,109],[109,10]],Tt=[].concat(o(kt),o(Ct),o(St),o(Et),o(_t),o(It));function Nt(e,t,n){if(n=e.createShader(0===n?e.VERTEX_SHADER:e.FRAGMENT_SHADER),e.shaderSource(n,t),e.compileShader(n),!e.getShaderParameter(n,e.COMPILE_STATUS))throw Error("Could not compile WebGL shader.\n\n"+e.getShaderInfoLog(n));return n}function Ot(e){return ve(e,ht,1).map((function(e){return{index:Ae(e,1),ga:we(e,2),label:null!=ge(e,3)?ke(e,3):void 0,displayName:null!=ge(e,4)?ke(e,4):void 0}}))}function Rt(e){return{x:we(e,1),y:we(e,2),z:we(e,3),visibility:null!=ge(e,4)?we(e,4):void 0}}function Dt(e,t){this.h=e,this.g=t,this.l=0}function Mt(e,t,n){return function(e,t){var n=e.g;if(void 0===e.o){var s=Nt(n,"\n attribute vec2 aVertex;\n attribute vec2 aTex;\n varying vec2 vTex;\n void main(void) {\n gl_Position = vec4(aVertex, 0.0, 1.0);\n vTex = aTex;\n }",0),r=Nt(n,"\n precision mediump float;\n varying vec2 vTex;\n uniform sampler2D sampler0;\n void main(){\n gl_FragColor = texture2D(sampler0, vTex);\n }",1),a=n.createProgram();if(n.attachShader(a,s),n.attachShader(a,r),n.linkProgram(a),!n.getProgramParameter(a,n.LINK_STATUS))throw Error("Could not compile WebGL program.\n\n"+n.getProgramInfoLog(a));s=e.o=a,n.useProgram(s),r=n.getUniformLocation(s,"sampler0"),e.j={K:n.getAttribLocation(s,"aVertex"),J:n.getAttribLocation(s,"aTex"),ma:r},e.u=n.createBuffer(),n.bindBuffer(n.ARRAY_BUFFER,e.u),n.enableVertexAttribArray(e.j.K),n.vertexAttribPointer(e.j.K,2,n.FLOAT,!1,0,0),n.bufferData(n.ARRAY_BUFFER,new Float32Array([-1,-1,-1,1,1,1,1,-1]),n.STATIC_DRAW),n.bindBuffer(n.ARRAY_BUFFER,null),e.s=n.createBuffer(),n.bindBuffer(n.ARRAY_BUFFER,e.s),n.enableVertexAttribArray(e.j.J),n.vertexAttribPointer(e.j.J,2,n.FLOAT,!1,0,0),n.bufferData(n.ARRAY_BUFFER,new Float32Array([0,1,0,0,1,0,1,1]),n.STATIC_DRAW),n.bindBuffer(n.ARRAY_BUFFER,null),n.uniform1i(r,0)}s=e.j,n.useProgram(e.o),n.canvas.width=t.width,n.canvas.height=t.height,n.viewport(0,0,t.width,t.height),n.activeTexture(n.TEXTURE0),e.h.bindTexture2d(t.glName),n.enableVertexAttribArray(s.K),n.bindBuffer(n.ARRAY_BUFFER,e.u),n.vertexAttribPointer(s.K,2,n.FLOAT,!1,0,0),n.enableVertexAttribArray(s.J),n.bindBuffer(n.ARRAY_BUFFER,e.s),n.vertexAttribPointer(s.J,2,n.FLOAT,!1,0,0),n.bindFramebuffer(n.DRAW_FRAMEBUFFER?n.DRAW_FRAMEBUFFER:n.FRAMEBUFFER,null),n.clearColor(0,0,0,0),n.clear(n.COLOR_BUFFER_BIT),n.colorMask(!0,!0,!0,!0),n.drawArrays(n.TRIANGLE_FAN,0,4),n.disableVertexAttribArray(s.K),n.disableVertexAttribArray(s.J),n.bindBuffer(n.ARRAY_BUFFER,null),e.h.bindTexture2d(0)}(e,t),"function"==typeof e.g.canvas.transferToImageBitmap?Promise.resolve(e.g.canvas.transferToImageBitmap()):n?Promise.resolve(e.g.canvas):"function"==typeof createImageBitmap?createImageBitmap(e.g.canvas):(void 0===e.i&&(e.i=document.createElement("canvas")),new Promise((function(t){e.i.height=e.g.canvas.height,e.i.width=e.g.canvas.width,e.i.getContext("2d",{}).drawImage(e.g.canvas,0,0,e.g.canvas.width,e.g.canvas.height),t(e.i)})))}function Ft(e){this.g=e}var Bt=new Uint8Array([0,97,115,109,1,0,0,0,1,4,1,96,0,0,3,2,1,0,10,9,1,7,0,65,0,253,15,26,11]);function zt(e,t){return t+e}function Lt(e,t){window[e]=t}function Pt(e){if(this.g=e,this.listeners={},this.j={},this.H={},this.o={},this.u={},this.I=this.s=this.Z=!0,this.D=Promise.resolve(),this.Y="",this.C={},this.locateFile=e&&e.locateFile||zt,"object"==typeof window)var t=window.location.pathname.toString().substring(0,window.location.pathname.toString().lastIndexOf("/"))+"/";else{if("undefined"==typeof location)throw Error("solutions can only be loaded on a web page or in a web worker");t=location.pathname.toString().substring(0,location.pathname.toString().lastIndexOf("/"))+"/"}if(this.$=t,e.options)for(var n=(t=i(Object.keys(e.options))).next();!n.done;n=t.next()){n=n.value;var s=e.options[n].default;void 0!==s&&(this.j[n]="function"==typeof s?s():s)}}function Vt(e,t){var n,s;return A((function(r){return t in e.H?r.return(e.H[t]):(n=e.locateFile(t,""),s=fetch(n).then((function(e){return e.arrayBuffer()})),e.H[t]=s,r.return(s))}))}function Wt(e,t,n){var s,r,a,o,l,u,c,h,d,p,f,m,g,b;return A((function(w){switch(w.g){case 1:if(!n)return w.return(t);for(s={},r=0,a=i(Object.keys(n)),o=a.next();!o.done;o=a.next())l=o.value,"string"!=typeof(u=n[l])&&"texture"===u.type&&void 0!==t[u.stream]&&++r;10&&r[r.length-1])||6!==a[0]&&2!==a[0])){i=0;continue}if(3===a[0]&&(!r||a[1]>r[0]&&a[1]0){var c=o===e.strides.length-1?1:MU(e.minScale,e.maxScale,o+1,e.strides.length);i.push(Math.sqrt(l*c)),a.push(e.interpolatedScaleAspectRatio)}}o++}for(var h=0;h0)p=e.featureMapHeight[n],f=e.featureMapWidth[n];else{var m=e.strides[n];p=Math.ceil(e.inputSizeHeight/m),f=Math.ceil(e.inputSizeWidth/m)}for(var g=0;g-1})),ko([s,r,a]),[2,o]}}))}))}function zU(e,t,n){return CU(this,void 0,void 0,(function(){var s,r,a,i,o;return SU(this,(function(l){switch(l.label){case 0:return s=e[0],r=e[1],a=function(e,t,n){return Ao((function(){var s,r,a,i;n.reverseOutputOrder?(r=Tp(Fc(e,[0,n.boxCoordOffset+0],[-1,1])),s=Tp(Fc(e,[0,n.boxCoordOffset+1],[-1,1])),i=Tp(Fc(e,[0,n.boxCoordOffset+2],[-1,1])),a=Tp(Fc(e,[0,n.boxCoordOffset+3],[-1,1]))):(s=Tp(Fc(e,[0,n.boxCoordOffset+0],[-1,1])),r=Tp(Fc(e,[0,n.boxCoordOffset+1],[-1,1])),a=Tp(Fc(e,[0,n.boxCoordOffset+2],[-1,1])),i=Tp(Fc(e,[0,n.boxCoordOffset+3],[-1,1]))),r=Dl(Bl(Fl(r,n.xScale),t.w),t.x),s=Dl(Bl(Fl(s,n.yScale),t.h),t.y),n.applyExponentialOnBoxSize?(a=Bl(zh(Fl(a,n.hScale)),t.h),i=Bl(zh(Fl(i,n.wScale)),t.w)):(a=Bl(Fl(a,n.hScale),t.h),i=Bl(Fl(i,n.wScale),t.h));var o=Ql(s,Fl(a,2)),l=Ql(r,Fl(i,2)),u=Dl(s,Fl(a,2)),c=Dl(r,Fl(i,2)),h=Rc([Tc(o,[n.numBoxes,1]),Tc(l,[n.numBoxes,1]),Tc(u,[n.numBoxes,1]),Tc(c,[n.numBoxes,1])],1);if(n.numKeypoints)for(var d=0;d0)for((c=l.locationData).relativeKeypoints=[],h=n.numKeypoints*n.numValuesPerKeypoint,d=0;dl?(a=e.width,i=e.width*o,c=(1-l/o)/2):(a=e.height/o,i=e.height,u=(1-o/l)/2),e.width=a,e.height=i,{top:c,left:u,right:u,bottom:c}}(l,s,r),c=function(e,t,n,s){var r=e.width,a=e.height,i=Math.cos(e.rotation),o=Math.sin(e.rotation),l=e.xCenter,u=e.yCenter,c=1/t,h=1/n,d=new Array(16);return d[0]=r*i*1*c,d[1]=-a*o*c,d[2]=0,d[3]=(-.5*r*i*1+.5*a*o+l)*c,d[4]=r*o*1*h,d[5]=a*i*h,d[6]=0,d[7]=(-.5*a*i-.5*r*o*1+u)*h,d[8]=0,d[9]=0,d[10]=r*c,d[11]=0,d[12]=0,d[13]=0,d[14]=0,d[15]=1,function(e){if(16!==e.length)throw new Error("Array length must be 16 but got "+e.length);return[[e[0],e[1],e[2],e[3]],[e[4],e[5],e[6],e[7]],[e[8],e[9],e[10],e[11]],[e[12],e[13],e[14],e[15]]]}(d)}(l,o.width,o.height),h=Ao((function(){var t=OU(e),n=Fp(function(e,t,n){return RU(n,"inputResolution"),[1/n.width*e[0][0]*t.width,1/n.height*e[0][1]*t.width,e[0][3]*t.width,1/n.width*e[1][0]*t.height,1/n.height*e[1][1]*t.height,e[1][3]*t.height,0,0]}(c,o,s),[1,8]),r="zero"===a?"constant":"nearest",l=bm.transform(Lh(Nl(t,"float32")),n,"bilinear",r,0,[s.height,s.width]);return null!=i?function(e,t){var n=function(e,t,n,s){var r=(s-n)/255;return{scale:r,offset:n-0*r}}(0,0,t[0],t[1]);return Ao((function(){return Dl(Bl(e,n.scale),n.offset)}))}(l,i):l}));return{imageTensor:h,padding:u,transformationMatrix:c}}(n,this.imageToTensorConfig),r=s.imageTensor,a=s.transformationMatrix,i=this.detectorModel.execute(r,"Identity:0"),o=function(e){return Ao((function(){var t=function(e){return Ao((function(){return[Fc(e,[0,0,0],[1,-1,1]),Fc(e,[0,0,1],[1,-1,-1])]}))}(e),n=t[0],s=t[1];return{boxes:Tp(s),logits:Tp(n)}}))}(i),l=o.boxes,[4,zU([u=o.logits,l],this.anchorTensor,this.tensorsToDetectionConfig)]);case 1:return 0===(c=p.sent()).length?(ko([n,r,i,u,l]),[2,c]):[4,BU(c,this.maxFaces,.3)];case 2:return h=p.sent(),d=function(e,t){void 0===e&&(e=[]);var n,s=(n=t,[].concat.apply([],n));return e.forEach((function(e){var t=e.locationData;t.relativeKeypoints.forEach((function(e){var t=FU(s,[e.x,e.y]),n=t[0],r=t[1];e.x=n,e.y=r}));var n=t.relativeBoundingBox,r=Number.MAX_VALUE,a=Number.MAX_VALUE,i=Number.MIN_VALUE,o=Number.MIN_VALUE;[[n.xMin,n.yMin],[n.xMin+n.width,n.yMin],[n.xMin+n.width,n.yMin+n.height],[n.xMin,n.yMin+n.height]].forEach((function(e){var t=FU(s,e),n=t[0],l=t[1];r=Math.min(r,n),i=Math.max(i,n),a=Math.min(a,l),o=Math.max(o,l)})),t.relativeBoundingBox={xMin:r,xMax:i,yMin:a,yMax:o,width:i-r,height:o-a}})),e}(h,a),ko([n,r,i,u,l]),[2,d]}}))}))},e.prototype.estimateFaces=function(e,t){return CU(this,void 0,void 0,(function(){var n,s;return SU(this,(function(r){return n=NU(e),s=!!t&&t.flipHorizontal,[2,this.detectFaces(e,s).then((function(e){return e.map((function(e){for(var t=e.locationData.relativeKeypoints.map((function(e,t){return kU(kU({},e),{x:e.x*n.width,y:e.y*n.height,name:EU[t]})})),s=e.locationData.relativeBoundingBox,r=0,a=["width","xMax","xMin"];r-1,[4,oS(t.detectorModelUrl,{fromTFHub:n})];case 1:return s=r.sent(),[2,new KU(t.modelType,s,t.maxFaces)]}}))}))}function ZU(e,t){return CU(this,void 0,void 0,(function(){var n,s;return SU(this,(function(r){if(e===VU.MediaPipeFaceDetector){if(s=void 0,null!=(n=t)){if("tfjs"===n.runtime)return[2,XU(n)];if("mediapipe"===n.runtime)return[2,TU(n)];s=n.runtime}throw new Error("Expect modelConfig.runtime to be either 'tfjs' or 'mediapipe', but got "+s)}throw new Error(e+" is not a supported model name.")}))}))}function YU(e){return e.width*e.height}function QU(e){var t=e.xCenter-e.width/2,n=t+e.width,s=e.yCenter-e.height/2;return{xMin:t,xMax:n,yMin:s,yMax:s+e.height,width:e.width,height:e.height}}function JU(e){return e instanceof Mi?{height:e.shape[0],width:e.shape[1]}:{height:e.height,width:e.width}}function eG(e){return e-2*Math.PI*Math.floor((e+Math.PI)/(2*Math.PI))}function tG(e){return e instanceof Mi?e:Bu(e)}function nG(e,t){qt(0!==e.width,(function(){return t+" width cannot be 0."})),qt(0!==e.height,(function(){return t+" height cannot be 0."}))}function sG(e,t,n){var s=t.outputTensorSize,r=t.keepAspectRatio,a=t.borderMode,i=t.outputTensorFloatRange,o=JU(e),l=function(e,t){return t?{xCenter:t.xCenter*e.width,yCenter:t.yCenter*e.height,width:t.width*e.width,height:t.height*e.height,rotation:t.rotation}:{xCenter:.5*e.width,yCenter:.5*e.height,width:e.width,height:e.height,rotation:0}}(o,n),u=function(e,t,n){if(void 0===n&&(n=!1),!n)return{top:0,left:0,right:0,bottom:0};var s=t.height,r=t.width;nG(t,"targetSize"),nG(e,"roi");var a,i,o=s/r,l=e.height/e.width,u=0,c=0;return o>l?(a=e.width,i=e.width*o,c=(1-l/o)/2):(a=e.height/o,i=e.height,u=(1-o/l)/2),e.width=a,e.height=i,{top:c,left:u,right:u,bottom:c}}(l,s,r),c=function(e,t,n,s){var r=e.width,a=e.height,i=s?-1:1,o=Math.cos(e.rotation),l=Math.sin(e.rotation),u=e.xCenter,c=e.yCenter,h=1/t,d=1/n,p=new Array(16);return p[0]=r*o*i*h,p[1]=-a*l*h,p[2]=0,p[3]=(-.5*r*o*i+.5*a*l+u)*h,p[4]=r*l*i*d,p[5]=a*o*d,p[6]=0,p[7]=(-.5*a*o-.5*r*l*i+c)*d,p[8]=0,p[9]=0,p[10]=r*h,p[11]=0,p[12]=0,p[13]=0,p[14]=0,p[15]=1,function(e){if(16!==e.length)throw new Error("Array length must be 16 but got "+e.length);return[[e[0],e[1],e[2],e[3]],[e[4],e[5],e[6],e[7]],[e[8],e[9],e[10],e[11]],[e[12],e[13],e[14],e[15]]]}(p)}(l,o.width,o.height,!1),h=Ao((function(){var t=tG(e),n=Fp(function(e,t,n){return nG(n,"inputResolution"),[1/n.width*e[0][0]*t.width,1/n.height*e[0][1]*t.width,e[0][3]*t.width,1/n.width*e[1][0]*t.height,1/n.height*e[1][1]*t.height,e[1][3]*t.height,0,0]}(c,o,s),[1,8]),r="zero"===a?"constant":"nearest",l=bm.transform(Lh(Nl(t,"float32")),n,"bilinear",r,0,[s.height,s.width]);return null!=i?function(e,t){var n=function(e,t,n,s){var r=(s-n)/255;return{scale:r,offset:n-0*r}}(0,0,t[0],t[1]);return Ao((function(){return Dl(Bl(e,n.scale),n.offset)}))}(l,i):l}));return{imageTensor:h,padding:u,transformationMatrix:c}}function rG(e){return{xCenter:e.xMin+e.width/2,yCenter:e.yMin+e.height/2,width:e.width,height:e.height}}function aG(e){var t=e.relativeKeypoints;if(t.length<=1)throw new Error("2 or more keypoints required to calculate a rect.");var n=Number.MAX_VALUE,s=Number.MAX_VALUE,r=Number.MIN_VALUE,a=Number.MIN_VALUE;return t.forEach((function(e){n=Math.min(n,e.x),r=Math.max(r,e.x),s=Math.min(s,e.y),a=Math.max(a,e.y)})),{xCenter:(n+r)/2,yCenter:(s+a)/2,width:r-n,height:a-s}}function iG(e,t,n,s,r){var a="rect"===n?function(e,t,n){var s,r=e.locationData;if("boundingbox"===t)s=rG(r.boundingBox);else{s=aG(r);var a=n.width,i=n.height;s.xCenter=Math.round(s.xCenter*a),s.yCenter=Math.round(s.yCenter*i),s.width=Math.round(s.width*a),s.height=Math.round(s.height*i)}return s}(e,t,s):function(e,t){var n=e.locationData;return"boundingbox"===t?rG(n.relativeBoundingBox):aG(n)}(e,t);return r&&(a.rotation=function(e,t,n){var s,r=e.locationData,a=n.rotationVectorStartKeypointIndex,i=n.rotationVectorEndKeypointIndex;s=n.rotationVectorTargetAngle?n.rotationVectorTargetAngle:Math.PI*n.rotationVectorTargetAngleDegree/180;var o=r.relativeKeypoints[a].x*t.width,l=r.relativeKeypoints[a].y*t.height,u=r.relativeKeypoints[i].x*t.width,c=r.relativeKeypoints[i].y*t.height;return eG(s-Math.atan2(-(c-l),u-o))}(e,s,r)),a}function oG(e,t,n){for(var s=0;s1&&(h.y=s?t.inputImageHeight-i[u+1]:i[u+1]),a>2&&(h.z=i[u+2]),a>3&&(h.score=hG(t.visibilityActivation,i[u+3])),o.push(h);for(c=0;c0?r/a:0}(e,t)<=.5}))).push(e)}))})),l=y,[4,Promise.all(l.map((function(e){return m.faceLandmark(e,r)})))];case 4:for(u=g.sent(),c=[],this.prevFaceRectsFromLandmarks=[],h=0;h-1,[4,oS(t.landmarkModelUrl,{fromTFHub:n})];case 1:return s=a.sent(),[4,ZU(VU.MediaPipeFaceDetector,{modelType:"short",maxFaces:t.maxFaces,detectorModelUrl:t.detectorModelUrl,runtime:t.runtime})];case 2:return r=a.sent(),[2,new TG(r,s,t.maxFaces,t.refineLandmarks)]}}))}))}(fG||(fG={})).MediaPipeFaceMesh="MediaPipeFaceMesh";Object.freeze({__proto__:null,getKeypointIndexByContour:function(e){if(e===fG.MediaPipeFaceMesh)return pU;throw new Error("Model "+e+" is not supported.")},getAdjacentPairs:function(e){if(e===fG.MediaPipeFaceMesh)return fU;throw new Error("Model "+e+" is not supported.")}});const OG=(e,t,n,s)=>1===s?.5*(e+t):e+(t-e)*n/(s-1),RG={applyExponentialOnBoxSize:!1,flipVertically:!1,ignoreClasses:[],numClasses:1,numBoxes:2304,numCoords:16,boxCoordOffset:0,keypointCoordOffset:4,numKeypoints:6,numValuesPerKeypoint:2,sigmoidScore:!0,scoreClippingThresh:100,reverseOutputOrder:!0,xScale:192,yScale:192,hScale:192,wScale:192,minScoreThresh:.6},DG={reduceBoxesInLowestLayer:!1,interpolatedScaleAspectRatio:0,featureMapHeight:[],featureMapWidth:[],numLayers:1,minScale:.1484375,maxScale:.75,inputSizeHeight:192,inputSizeWidth:192,anchorOffsetX:.5,anchorOffsetY:.5,strides:[4],aspectRatios:[1],fixedAnchorSize:!0},MG={outputTensorSize:{width:192,height:192},keepAspectRatio:!0,outputTensorFloatRange:[-1,1],borderMode:"zero"},FG=e=>{e.detector.imageToTensorConfig=MG,e.detector.tensorsToDetectionConfig=RG,e.detector.anchors=(e=>{null===e.reduceBoxesInLowestLayer&&(e.reduceBoxesInLowestLayer=!1),null===e.interpolatedScaleAspectRatio&&(e.interpolatedScaleAspectRatio=1),null===e.fixedAnchorSize&&(e.fixedAnchorSize=!1);const t=[];let n=0;for(;n0){const n=o===e.strides.length-1?1:OG(e.minScale,e.maxScale,o+1,e.strides.length);i.push(Math.sqrt(t*n)),a.push(e.interpolatedScaleAspectRatio)}}o++}for(let e=0;e0)l=e.featureMapHeight[n],u=e.featureMapWidth[n];else{const t=e.strides[n];l=Math.ceil(e.inputSizeHeight/t),u=Math.ceil(e.inputSizeWidth/t)}for(let n=0;ne.width))),n=Mp(e.detector.anchors.map((e=>e.height))),s=Mp(e.detector.anchors.map((e=>e.xCenter))),r=Mp(e.detector.anchors.map((e=>e.yCenter)));e.detector.anchorTensor={x:s,y:r,w:t,h:n}},BG=function(){this.model=function(e,t){return cU(this,void 0,void 0,(function(){var n,s;return hU(this,(function(r){if(e===fG.MediaPipeFaceMesh){if(s=void 0,null!=(n=t)){if("tfjs"===n.runtime)return[2,NG(n)];if("mediapipe"===n.runtime)return[2,vU(n)];s=n.runtime}throw new Error("Expect modelConfig.runtime to be either 'tfjs' or 'mediapipe', but got "+s)}throw new Error(e+" is not a supported model name.")}))}))}(fG.MediaPipeFaceMesh,{runtime:"tfjs",detectorModelUrl:"https://tfhub.dev/mediapipe/tfjs-model/face_detection/full/1"}),this.predictionReady=!1};BG.prototype.positionsArray=null,BG.prototype.getEyePatches=async function(e,t,n,s){if(0===t.width)return null;const r=await this.model;FG(r);const a=await r.estimateFaces(t,{flipHorizontal:!1});if(0===a.length)return!1;this.positionsArray=a[0].keypoints;const i=a[0],[o,l]=[{eyeTopArc:[466,388,387,386,385,384,398].map((e=>i.keypoints[e])),eyeBottomArc:[263,249,390,373,374,380,381,382,362].map((e=>i.keypoints[e]))},{eyeTopArc:[246,161,160,159,158,157,173].map((e=>i.keypoints[e])),eyeBottomArc:[33,7,163,144,145,153,154,155,133].map((e=>i.keypoints[e]))}].map((({eyeTopArc:e,eyeBottomArc:t})=>{const n={x:Math.round(Math.min(...e.map((e=>e.x)))),y:Math.round(Math.min(...e.map((e=>e.y))))},s=Math.round(Math.max(...t.map((e=>e.x)))),r=Math.round(Math.max(...t.map((e=>e.y))));return{origin:n,width:s-n.x,height:r-n.y}}));var u=o.origin.x,c=o.origin.y,h=o.width,d=o.height,p=l.origin.x,f=l.origin.y,m=l.width,g=l.height;if(0===h||0===m)return null;if(0===d||0===g)return null;var y={},b=t.getContext("2d").getImageData(u,c,h,d);y.left={patch:b,imagex:u,imagey:c,width:h,height:d};var w=t.getContext("2d").getImageData(p,f,m,g);return y.right={patch:w,imagex:p,imagey:f,width:m,height:g},this.predictionReady=!0,y},BG.prototype.getPositions=function(){return this.positionsArray},BG.prototype.reset=function(){},BG.prototype.drawFaceOverlay=function(e,t){if(t){e.fillStyle="#32EEDB",e.strokeStyle="#32EEDB",e.lineWidth=.5;for(let n=0;nn?n:e}LG.Eye=function(e,t,n,s,r){this.patch=e,this.imagex=t,this.imagey=n,this.width=s,this.height=r},LG.getEyeFeats=function(e){var t=this.resizeEye(e.left,10,6),n=this.resizeEye(e.right,10,6),s=this.grayscale(t.data,t.width,t.height),r=this.grayscale(n.data,n.width,n.height),a=[];this.equalizeHistogram(s,5,a);var i=[];return this.equalizeHistogram(r,5,i),a.concat(i)},LG.DataWindow=function(e,t){this.data=[],this.windowSize=e,this.index=0,this.length=0,t&&(this.data=t.slice(t.length-e,t.length),this.length=this.data.length)},LG.DataWindow.prototype.push=function(e){return this.data.length>2),r=0,a=0,i=0;it?255:0;return e},LG.correlation=function(e,t){const n=Math.min(e.length,t.length);let s=0;for(let r=0;rWG(e,t,((e,t)=>e+t)),sub:(e,t)=>WG(e,t,((e,t)=>e-t)),inv:e=>UG.solve(e,UG.identity(e.length,e[0].length)),identity(e,t=e){const n=new Array(e);for(let s=0;se.length===e[0].length?UG.LUDecomposition(e,t):UG.QRDecomposition(e,t),LUDecomposition(e,t){for(var n=new Array(e.length),s=0;sMath.abs(c[f])&&(f=s);if(f!=r){for(p=0;p=0;p--){for(r=0;r=0;u--){for(r=0;r=0;n--){var s=this.screenXTrailArray.get(n),r=this.screenYTrailArray.get(n);if(Math.sqrt(Math.pow(s-e,2)+Math.pow(r-t,2))>72)return n+1}return n},qG.addData=function(e,t,n){e&&("click"===n?(this.screenXClicksArray.push([t[0]]),this.screenYClicksArray.push([t[1]]),this.eyeFeaturesClicks.push(VG.getEyeFeats(e)),this.dataClicks.push({eyes:e,screenPos:t,type:n})):"move"===n&&(this.screenXTrailArray.push([t[0]]),this.screenYTrailArray.push([t[1]]),this.eyeFeaturesTrail.push(VG.getEyeFeats(e)),this.trailTimes.push(performance.now()),this.dataTrail.push({eyes:e,screenPos:t,type:n})))};const jG=qG,HG={RidgeReg:function(){this.init()}};HG.RidgeReg.prototype.init=jG.InitRegression,HG.RidgeReg.prototype.addData=jG.addData,HG.RidgeReg.prototype.predict=function(e){if(!e||0===this.eyeFeaturesClicks.length)return null;for(var t=performance.now()-this.trailTime,n=[],s=[],r=[],a=0;at&&(n.push(this.screenXTrailArray.get(a)),s.push(this.screenYTrailArray.get(a)),r.push(this.eyeFeaturesTrail.get(a)));var i=this.screenXClicksArray.data.concat(n),o=this.screenYClicksArray.data.concat(s),l=this.eyeFeaturesClicks.data.concat(r),u=jG.ridge(i,l,this.ridgeParameter),c=jG.ridge(o,l,this.ridgeParameter),h=VG.getEyeFeats(e),d=0;for(a=0;at&&(n.push(this.screenXTrailArray.get(a)),s.push(this.screenYTrailArray.get(a)),r.push(this.eyeFeaturesTrail.get(a)));var i=this.eyeFeaturesClicks.data.length,o=Array(i),l=Array(i),u=Array(i);for(a=0;asetTimeout(t,e)))}function tq(e,t){let n=Math.pow(10,t);return Math.round(e*n)/n}const nq={tracker:{}};nq.tracker.TFFaceMesh=zG,nq.reg=$G,nq.reg.RidgeWeightedReg=XG.RidgeWeightedReg,nq.reg.RidgeRegThreaded=JG.RidgeRegThreaded,nq.util=VG,nq.params=aU;var sq=null,rq=null,aq=null,iq=null,oq=null,lq=null,uq=null,cq=!1,hq=new Array(50),dq=new Array(50),pq=(performance.now(),null),fq=null;nq.params.paused=!1,nq.params.greedyLearner=!1,nq.params.framerate=60,nq.params.showGazeDot=!1,nq.params.getLatestVideoFrameTimestamp=()=>{},nq.params.activeCamera={label:"",id:""};let mq=[];var gq=function(e){},yq=gq,bq=["click","move"],wq=performance.now(),vq=new nq.tracker.TFFaceMesh,xq=[new nq.reg.RidgeReg],Aq={TFFacemesh:function(){return new nq.tracker.TFFaceMesh}},kq={ridge:function(){return new nq.reg.RidgeReg},weightedRidge:function(){return new nq.reg.RidgeWeightedReg},threadedRidge:function(){return new nq.reg.RidgeRegThreaded}},Cq="webgazerGlobalData",Sq="webgazerGlobalSettings",Eq={},_q=[];let Iq,Tq,Nq,Oq,Rq,Dq,Mq,Fq,Bq,zq,Lq,Pq;nq.computeValidationBoxSize=function(){var e=aq.videoWidth,t=aq.videoHeight,n=parseInt(aq.style.width),s=parseInt(aq.style.height),r=Math.min(e,t),a=e==Math.max(e,t)?n/e:s/t,i=r*nq.params.faceFeedbackBoxRatio*a;return[(s-i)/2,(n-i)/2,i,i]};let Vq=!1,Wq=!1;function Uq(){null!==lq&&pq?(Vq||Wq||(Wq=!0,setTimeout((()=>{Iq=aq.videoWidth,Tq=aq.videoHeight,Nq=Math.min(Iq,Tq),Oq=Nq*nq.params.faceFeedbackBoxRatio,Rq=(Tq-Oq)/2,Dq=(Iq-Oq)/2,Mq=Dq+Oq,Fq=Rq+Oq,Vq=!0,Wq=!1}),500)),Bq=Iq-pq.left.imagex,Lq=Iq-pq.right.imagex,zq=pq.left.imagey,Pq=pq.right.imagey,lq.style.border=Vq&&Bq>Dq&&BqDq&&LqRq&&zqRq&&Pq=1e3/nq.params.framerate&&(Xq=Kq,fq=jq(),fq=await fq,yq(fq),Zq=!0,fq)){Hq.push(fq);var e=0,t=0,n=Hq.length;for(var s in Hq.data)e+=Hq.get(s).x,t+=Hq.get(s).y;var r=VG.bound({x:e/n,y:t/n});nq.params.storingPoints&&(nq.storePoints(r.x,r.y,$q),50==++$q&&($q=0)),uq.style.opacity="",uq.style.left=`${r.x}px`,uq.style.top=`${r.y}px`}requestAnimationFrame(Qq)}var Jq=function(e,t,n){if(!nq.params.paused){if(0===xq.length)return null;for(var s in xq)pq&&xq[s].addData(pq,[e,t],n)}},ej=async function(e){Jq(e.clientX,e.clientY,bq[0]),nq.params.saveDataAcrossSessions&&await async function(){var e=xq[0].getData()||_q;oU().setItem(Sq,Eq),oU().setItem(Cq,e)}()},tj=function(e){if(!nq.params.paused){var t=performance.now();tnq.params.activeCamera.id?{video:{...e.video,deviceId:nq.params.activeCamera.id}}:e;function ij(e){navigator.vendor&&navigator.vendor.indexOf("Apple")>-1?(e.style.opacity=nq.params.showVideo?"1":"0",e.style.display="block"):e.style.display=nq.params.showVideo?"block":"none"}nq._begin=function(e,t){if(!nq.params.videoIsOn)return void 0===navigator.mediaDevices&&(navigator.mediaDevices={}),void 0===navigator.mediaDevices.getUserMedia&&(navigator.mediaDevices.getUserMedia=function(e){var t=navigator.webkitGetUserMedia||navigator.mozGetUserMedia;return t?new Promise((function(n,s){t.call(navigator,e,n,s)})):Promise.reject(new Error("Unfortunately, your browser does not support access to the webcam through the getUserMedia API. Try to use the latest version of Google Chrome, Mozilla Firefox, Opera, or Microsoft Edge instead."))}),new Promise((async(n,s)=>{let r;try{if(void 0!==navigator.mediaDevices&&"function"==typeof navigator.mediaDevices.enumerateDevices){const s=await navigator.mediaDevices.enumerateDevices();if((e=>{let t,n;mq=[],e.forEach((e=>{"videoinput"===e.kind&&mq.push(e),e.label.includes("FaceTime")&&(t=e.label,n=e.deviceId)})),mq.length&&(nq.params.activeCamera.label=t||mq[0].label,nq.params.activeCamera.id=n||mq[0].deviceId)})(s),0===mq.length)throw t(mq),JSON.stringify({message:"We can't find any video input devices.",devices:s});try{r=await navigator.mediaDevices.getUserMedia(aj(nq.params.camConstraints))}catch(e){throw t(mq),e}rj(e?"video":"all",r).then((()=>{mq.length>1&&(e=>{const t=rq,n=document.createElement("select");n.className=n.id="webgazer-videoinput-select",n.name="videoinput",e.forEach(((e,t)=>{var s;n.innerHTML+=``})),n.onchange=e=>{const[t,s]=n.value.split("%");nq.params.activeCamera.label=s,nq.params.activeCamera.id=t,nq.setCameraConstraints(aj(nq.params.camConstraints))},t.appendChild(n)})(mq)})),nq.params.videoIsOn=!0,e||n(nq)}else t([])}catch(e){throw aq=null,r=null,t([]),s(e),JSON.stringify({error:e,devices:await navigator.mediaDevices.enumerateDevices()})}}));rj("gaze")},nq.isReady=function(){return null!==iq&&iq.width>0},nq.pause=function(){return nq.params.paused=!0,nq},nq.stopLearning=function(e){return sj(e),nq},nq.startLearning=function(e){return nj(e),nq},nq.resume=async function(){return nq.params.paused?(nq.params.paused=!1,Zq=!0,oj.current&&(clearInterval(oj.current),oj.current=void 0,cq=!1,uq.style.backgroundColor="",uq.style.opacity=""),await Qq(),nq):nq},nq.end=function(e=!1){return e&&(Hq=new VG.DataWindow(4),$q=0,Kq=null,Xq=-1,Vq=!1,nq.params.videoIsOn=!1,setTimeout((()=>{nq.stopVideo(),rq.remove()}),500)),nq},nq.stopVideo=function(){return sq.getTracks()[0].stop(),nq},nq.detectCompatibility=function(){return void 0!==(navigator.mediaDevices.getUserMedia||navigator.getUserMedia||navigator.webkitGetUserMedia||navigator.mozGetUserMedia)},nq.showVideoPreview=function(e){return nq.params.showVideoPreview=e,nq.showVideo(e&&nq.params.showVideo),nq.showFaceOverlay(e&&nq.params.showFaceOverlay),nq.showFaceFeedbackBox(e&&nq.params.showFaceFeedbackBox),nq},nq.showVideo=function(e,t=.8){return nq.params.showVideo=e,aq&&ij(aq),rq&&ij(rq),nq},nq.showFaceOverlay=function(e){return nq.params.showFaceOverlay=e,oq&&(oq.style.display=e?"block":"none"),nq},nq.showFaceFeedbackBox=function(e){return nq.params.showFaceFeedbackBox=e,lq&&(lq.style.display=e?"block":"none"),nq},nq.showPredictionPoints=function(e){return nq.params.showGazeDot=e,uq&&(uq.style.display=e?"block":"none"),nq};const oj={current:void 0};function lj(e,t){iq&&(iq.width=e,iq.height=t),oq&&(oq.width=e,oq.height=t)}nq.popPredictionPoints=function(){return oj.current&&(clearInterval(oj.current),oj.current=void 0,cq=!1),uq&&nq.params.showGazeDot&&(cq=!0,uq.style.backgroundColor="red",uq.style.opacity=1,oj.current=setInterval((()=>{uq.style.opacity-=.02,uq.style.opacity<=.02&&(clearInterval(oj.current),oj.current=void 0,cq=!1,uq.style.backgroundColor="",uq.style.opacity="")}),50)),nq},nq.saveDataAcrossSessions=function(e){return nq.params.saveDataAcrossSessions=e,nq},nq.applyKalmanFilter=function(e){return nq.params.applyKalmanFilter=e,nq},nq.setCameraConstraints=async function(e){if(nq.params.camConstraints=e,sq){nq.pause();try{sq.getVideoTracks().forEach((e=>{e.stop()}));const e=await navigator.mediaDevices.getUserMedia(nq.params.camConstraints);setTimeout((()=>{const t=e.getVideoTracks()[0].getSettings();sq=e,aq.srcObject=e,lj(t.width,t.height)}),1500)}catch(e){return}await nq.resume()}},nq.setStaticVideo=function(e){return e,nq},nq.setVideoViewerSize=function(e,t){nq.params.videoViewerWidth=e,nq.params.videoViewerHeight=t,aq.style.width=e+"px",aq.style.height=t+"px",rq.style.width=e+"px",rq.style.height=t+"px",oq.style.width=e+"px",oq.style.height=t+"px";var n=nq.computeValidationBoxSize();lq.style.top=n[0]+"px",lq.style.left=n[1]+"px",lq.style.width=n[2]+"px",lq.style.height=n[3]+"px"},nq.addMouseEventListeners=function(){return nj(),nq},nq.removeMouseEventListeners=function(){return sj(),nq},nq.recordScreenPosition=function(e,t,n){return Jq(e,t,n||bq[0]),nq},nq.storePoints=function(e,t,n){hq[n]=e,dq[n]=t},nq.setTracker=function(e){if(void 0===Aq[e]){for(var t in Aq);return nq}return vq=Aq[e](),nq},nq.setRegression=function(e){if(void 0===kq[e]){for(var t in kq);return nq}return _q=xq[0].getData(),(xq=[kq[e]()])[0].setData(_q),nq},nq.addTrackerModule=function(e,t){Aq[e]=function(){return new t}},nq.addRegressionModule=function(e,t){kq[e]=function(){return new t}},nq.addRegression=function(e){var t=kq[e]();return _q=xq[0].getData(),t.setData(_q),xq.push(t),nq},nq.setGazeListener=function(e){return yq=e,nq},nq.clearGazeListener=function(){return yq=gq,nq},nq.setVideoElementCanvas=function(e){return iq=e},nq.clearData=async function(){!function(){for(var e in oU().clear(),xq)xq[e].init()}()},nq.getTracker=function(){return vq},nq.getRegression=function(){return xq},nq.getCurrentPrediction=async function(e=0,t=150,n=5){let s=0;const r=[],a=[];for(let e=0;et.x>=0&&t.x<=window.innerWidth?e+t.x:e),0)/a.length),l=Math.round(a.reduce(((e,t)=>t.y>=0&&t.y<=window.innerHeight?e+t.y:e),0)/a.length);return uq&&(uq.style.left=`${o}px`,uq.style.top=`${l}px`),{x:o,y:l,raw:a.map((e=>({x:tq(e.x,0),y:tq(e.y,0)})))}},nq.params.getEventTypes=function(){return bq.slice()},nq.getVideoElementCanvas=function(){return iq},nq.getVideoPreviewToCameraResolutionRatio=function(){return[nq.params.videoViewerWidth/aq.videoWidth,nq.params.videoViewerHeight/aq.videoHeight]},nq.getStoredPoints=function(){return[hq,dq]};const uj=nq;class cj{constructor(e){this.calibrator=e,this.webgazer=uj,this.defaultGazeCallback=null,this.defaultDistanceTrackCallback=null,this._initialized={distance:!1,gaze:!1},this._learning=!0,this._running={distance:!1,gaze:!1},this._runningVideo=!1,this._toFixedN=1}begin({pipWidthPx:e},t){this.checkInitialized("gaze",!0)&&(this._running.gaze||(this.webgazer.begin(this.videoFailed.bind(this)),this._running.gaze=!0,this._runningVideo=!0),Re(this.calibrator,e,this.calibrator.params.videoOpacity,this.webgazer,t))}beginVideo({pipWidthPx:e},t){this.checkInitialized("distance",!0)&&(this._runningVideo||(this.webgazer.beginVideo(this.videoFailed.bind(this)),this._runningVideo=!0),Re(this.calibrator,e,this.calibrator.params.videoOpacity,this.webgazer,t))}videoFailed(e){const t=ae(this.calibrator,{showIcon:!0});Q().fire({...t,icon:"error",iconColor:this.calibrator._CONST.COLOR.DARK_RED,showConfirmButton:!1,html:e.length?U.H.RC_errorCameraUseDenied[this.calibrator.L]:U.H.RC_errorNoCamera[this.calibrator.L]})}attachNewCallback(e){this.checkInitialized("gaze",!0)&&this.webgazer.setGazeListener((t=>{if(t){const n=this.calibrator.newGazePositionData=this.getData(t);(0,_.nB)(e,n)}}))}async getGazeNow(e={},t){e=Object.assign({wait:0,frames:5},e);let n=this.calibrator.newGazePositionData=this.getData(await this.webgazer.getCurrentPrediction(0,e.wait,e.frames));return this.webgazer.popPredictionPoints(),(0,_.nB)(t,n),n}end(){this.webgazer.end()}}cj.prototype._init=function({greedyLearner:e,framerate:t,toFixedN:n,showVideo:s,showFaceOverlay:r,showGazer:a},i){this.checkInitialized(i)||("gaze"===i&&(this.webgazer.params.greedyLearner=e,this.webgazer.params.framerate=t,this.webgazer.params.getLatestVideoFrameTimestamp=this._getLatestVideoTimestamp.bind(this),this.showGazer(a)),this._toFixedN=n,this.showVideo(s),this.showFaceOverlay(r),this._initialized[i]=!0)},cj.prototype.checkInitialized=function(e,t=!1){return!!(""===e?this._initialized.gaze||this._initialized.distance:this._initialized[e])},cj.prototype.getData=function(e){let t=performance.now();return{value:{x:(0,_.Nh)(e.x,this._toFixedN),y:(0,_.Nh)(e.y,this._toFixedN),latencyMs:t-this.calibrator._trackingVideoFrameTimestamps.gaze},timestamp:t,raw:e.raw?e.raw:void 0}},cj.prototype.pause=function(){this.webgazer.pause()},cj.prototype.resume=function(){this.webgazer.resume()},cj.prototype.end=function(e,t=!1){if(!this.checkInitialized(e,!0))return;const n=t||!this._initialized.gaze||!this._initialized.distance;"gaze"===e?(this._endGaze(),n&&this.checkInitialized("distance")&&this.calibrator.endDistance(!1,!1),this.calibrator._trackingVideoFrameTimestamps.gaze=0):(this.defaultDistanceTrackCallback=null,n&&this.checkInitialized("gaze")&&this._endGaze()),n?(this._initialized={distance:!1,gaze:!1},this._running={distance:!1,gaze:!1},this.webgazer.end(!0),this._runningVideo=!1):(this._initialized[e]=!1,this._running[e]=!1)},cj.prototype._endGaze=function(){this.webgazer.params.paused=!0,this._learning=!0,this.defaultGazeCallback=null,this.webgazer.clearData(),this.webgazer.params.greedyLearner=!1,this.webgazer.params.framerate=60,this.webgazer.params.getLatestVideoFrameTimestamp=()=>{}},cj.prototype._getLatestVideoTimestamp=function(e){this.calibrator._trackingVideoFrameTimestamps.gaze=e},cj.prototype.startStoringPoints=function(){this.webgazer.params.storingPoints=!0},cj.prototype.stopStoringPoints=function(){this.webgazer.params.storingPoints=!1},cj.prototype.startLearning=function(e){this._learning||(this.webgazer.startLearning(e),this._learning=!0)},cj.prototype.stopLearning=function(e){this._learning&&(this.webgazer.stopLearning(e),this._learning=!1)},cj.prototype.showGazer=function(e){this.webgazer.showPredictionPoints(e)},cj.prototype.showVideo=function(e){this.webgazer.showVideo(e,this.calibrator._params.videoOpacity)},cj.prototype.showFaceOverlay=function(e){this.webgazer.showFaceOverlay(e)},E.A.prototype.performanceCompute=async function(e,t=!1){if(!this.checkInitialized())return;const n=performance.now();let s={_useless:void 0,time:0,randomTime:0};for(;performance.now()-n<500;)s._useless=Array(5e3).fill(Math.floor(10*Math.random())),s.time++;const r=performance.now();for(s._useless=0;performance.now()-r<500;)s._useless+=Math.random(),s.randomTime++;const a={value:{computeArrayFillMHz:(0,_.Nh)(2*s.time/1e6,3),computeRandomMHz:(0,_.Nh)(2*s.randomTime/1e6,3),idealFps:void 0,stressFps:void 0},timestamp:performance.now()};return t||(this.newPerformanceData=a),(0,_.nB)(e,a),a},E.A.prototype.performance=async function(e={},t){if(!this.checkInitialized())return;e=Object.assign({testComputation:!0,testFrameCount:180,testObjectCount:1e4,headline:"🚀 "+U.H.RC_performanceTitle[this.L],description:U.H.RC_performanceIntro[this.L]},e),this._addBackground(),this._addBackgroundText(e.headline,e.description),await(0,_.yy)(200);const n=e.testComputation?await this.performanceCompute(null,!0):{value:{computeArrayFillMHz:void 0,computeRandomMHz:void 0}},s=document.createElement("canvas"),r=s.getContext("2d");s.width=window.innerWidth,s.height=window.innerHeight,this.background.appendChild(s);const a=await hj(r),i=await dj(r,e.testFrameCount,e.testObjectCount),o=this.newPerformanceData={value:{computeArrayFillMHz:n.value.computeArrayFillMHz,computeRandomMHz:n.value.computeRandomMHz,idealFps:Math.round(6e4/(a.end-a.start)),stressFps:Math.round(1e3*e.testFrameCount/(i.end-i.start))},timestamp:performance.now()};return this._removeBackground(),(0,_.nB)(t,o),o};const hj=()=>{let e=60;const t=performance.now();return new Promise((n=>{const s=()=>{e--,e>0?requestAnimationFrame(s):n({start:t,end:performance.now()})};requestAnimationFrame(s)}))},dj=async(e,t,n)=>{let s=t;const r=[],a=["#000000","#333333","#999999"];for(let e=0;e{const n=()=>{e.clearRect(0,0,window.innerWidth,window.innerHeight),e.beginPath();for(let t of r)t.move(),t.draw(e);s--,s>0?requestAnimationFrame(n):t({start:i,end:performance.now()})};requestAnimationFrame(n)}))};class pj{constructor(e){this.w=(0,_.Av)(20,70),this.h=(0,_.Av)(30,70),this.x=-this.w+Math.random()*window.innerWidth,this.y=-this.h/2+Math.random()*(window.innerHeight+this.h/2),this.speed=(0,_.Av)(1,5),this.stroke=e[Math.floor(Math.random()*e.length)]}move(){this.x+=this.speed+.5*Math.random(),this.x>window.innerWidth&&(this.x=-this.w)}draw(e){e.strokeStyle=this.stroke,e.fillRect(this.x,this.y,this.w,this.h),e.strokeRect(this.x,this.y,this.w,this.h)}}E.A.prototype.getEquipment=async function(e,t=!1){if(this.equipment&&!t)return(0,_.nB)(e);this._replaceBackground();const n=this,{CM:s,IN_D:r,IN_F:a}=n._CONST.UNITS,i={};i[s]="centimeter",i[r]="inch (decimal, e.g. 11.5 in)",i[a]="inch (fractional, e.g. 12 3/8 in)";const{value:o}=await Q().fire({...ae(n,{showIcon:!1}),title:"Do you have a ruler or tape measure?",html:"Ideally, it should be long enough to measure your viewing distance, but even a 6 inch (15 cm) ruler can be useful. Please select the units you'll use, or indicate that no ruler or tape measure is available.",input:"select",inputOptions:{...i,none:"No ruler or tape measure is available"},inputPlaceholder:"Select an option",inputValidator:e=>new Promise((t=>{e.length||t("Please select an option.");const s="none"!==e;n.newEquipmentData={value:{has:s,unit:s?e:null,equipment:s?"":null},timestamp:performance.now()},t()}))});return o?(0,_.nB)(e):void 0};var fj=__webpack_require__(2016),mj=__webpack_require__(980),gj=__webpack_require__.n(mj),yj=__webpack_require__(3890),bj=__webpack_require__.n(yj);E.A.prototype._checkScreenSize=async function(e,t,n){await this.getEquipment((()=>{wj(this,e,t,n)}))};const wj=async(e,t,n,s)=>{if(e.equipment&&e.equipment.value.has){e._replaceBackground((0,_.$O)("📏 Measure the Length of the Arrow",'Use your ruler (or tape measure) to measure the length of the arrow. Type your numerical answer into the box. Just digits, period, decimal comma, and / (forward slash) for fractional inches. Then click OK or hit RETURN.'));const t=t=>[()=>{const n=document.createElement("div");e.background.appendChild(n),n.outerHTML=t},()=>{for(let t of e.background.getElementsByClassName("arrow-two-sided-svg"))t.remove()},{callback:()=>{},content:"Ruler is too short"}],n=await(0,fj.K)(e,...t(gj())),r=await(0,fj.K)(e,...t(bj())),a={};if(n){const t=n.value,s=e.windowWidthPx.value,r=(0,_.Nh)(2.54*s/e.screenPpi.value,1);a.horizontal={...t,calibratorArrowWidthCm:r,arrowWidthPx:s}}if(r){const t=r.value,n=e.windowHeightPx.value,s=(0,_.Nh)(2.54*n/e.screenPpi.value,1);a.vertical={...t,calibratorArrowHeightCm:s,arrowHeightPx:n}}if(a.vertical||a.horizontal){const t={value:a,timestamp:n?n.timestamp:r.timestamp,measure:"screenSize"};e.newCheckData=t,(0,_.nB)(s,t)}}e._removeBackground(),(0,_.nB)(t,n)};E.A.prototype._checkDistance=async function(e,t,n,s){await this.getEquipment((()=>vj(this,e,t,n,s)))};const vj=async(e,t,n,s,r)=>{const a="trackDistance"===s,i=()=>{e._removeBackground(),a||(0,_.nB)(t,n)};if(a&&(0,_.nB)(t,n),e.equipment&&e.equipment.value.has){e._replaceBackground((0,_.$O)("📏 Hold Still and Measure Viewing Distance with Ruler",'Hold still so that your viewing distance from the screen stays unchanged from the last measurement. Please measure the distance from the middle of your screen to one of your eyes using your ruler (or measuring tape). If your ruler is not long enough, then select "Ruler is too short" below. Type your numerical answer into the box, then click OK or hit RETURN.'));const t=await(0,fj.K)(e,null,null,{callback:()=>{},content:"Ruler is too short"});if(t){const n={value:{...t.value,calibratorCm:e.viewingDistanceCm.value,calibratorMethod:e.viewingDistanceCm.method},timestamp:t.timestamp,measure:s};return e.newCheckData=n,i(),void(0,_.nB)(r,n)}}i()};var xj=__webpack_require__(7790),Aj=__webpack_require__(627),kj=__webpack_require__.n(Aj),Cj=__webpack_require__(8110),Sj=__webpack_require__.n(Cj),Ej=__webpack_require__(5072),_j=__webpack_require__.n(Ej),Ij=__webpack_require__(7825),Tj=__webpack_require__.n(Ij),Nj=__webpack_require__(7659),Oj=__webpack_require__.n(Nj),Rj=__webpack_require__(5056),Dj=__webpack_require__.n(Rj),Mj=__webpack_require__(540),Fj=__webpack_require__.n(Mj),Bj=__webpack_require__(1113),zj=__webpack_require__.n(Bj),Lj=__webpack_require__(4636),Pj={};Pj.styleTagTransform=zj(),Pj.setAttributes=Dj(),Pj.insert=Oj().bind(null,"head"),Pj.domAPI=Tj(),Pj.insertStyleElement=Fj();_j()(Lj.A,Pj);Lj.A&&Lj.A.locals&&Lj.A.locals;E.A.prototype.removePanel=function(){return!!this._panelStatus.hasPanel&&(this._panel.panelObserver.unobserve(this._panel.panel),this._panel.panel.remove(),this._panel.panel=null,this._panel.panelObserver=null,this._panel.panelTasks=[],this._panel.panelParent=null,this._panel.panelOptions={},this._panel.panelCallback=null,this._panel.panelResolve=null,this._panelStatus.hasPanel=!1,this._panelStatus.panelFinished=!1,Zj(this),!0)},E.A.prototype.resetPanel=function(e=null,t=null,n=null,s=null,r=null){if(!this._panelStatus.hasPanel)return!1;const a=e||[...this._panel.panelTasks],i=n||{...this._panel.panelOptions},o=s&&"function"==typeof s?s:this._panel.panelCallback,l=r||this._panel.panelResolve;return null!==t&&t!==this._panel.panelParent?(this.removePanel(),this.panel(a,t,i,o,l)):(Zj(this),this.panel(a,this._panel.panelParent,i,o,l,!0))},E.A.prototype.panel=async function(e,t,n={},s=null,r=null,a=!1){if(this._panelStatus.hasPanel^a)return!1;if(!Uj(e))return!1;const i=document.querySelector(t);if(!i)return!1;const o=Ge((n=Object.assign({headline:U.H.RC_panelTitle[this.L],description:U.H.RC_panelIntro[this.L],showNextButton:!1,nextHeadline:U.H.RC_panelTitleNext[this.L],nextDescription:U.H.RC_panelIntroNext[this.L],nextButton:U.H.RC_panelButton[this.L],color:"#3490de",debug:!1,i18n:!0,_demoActivateAll:!1},n)).color).darken(20).toString();document.documentElement.style.setProperty("--rc-panel-theme-color",n.color),document.documentElement.style.setProperty("--rc-panel-darken-color",o),document.documentElement.style.setProperty("--rc-panel-theme-color-semi",n.color+"66"),document.documentElement.style.setProperty("--rc-panel-darken-color-semi",o+"88");const l=document.createElement("div");l.className=l.id="rc-panel",this.LD===this._CONST.RTL?l.className+=" rc-lang-rtl":l.className+=" rc-lang-ltr",n.i18n&&(l.innerHTML+='
      '),l.innerHTML+=`

      ${n.headline}

      `,l.innerHTML+=`

      ${n.description}

      `,l.innerHTML+='
      ',a?i.replaceChild(l,this._panel.panel):i.appendChild(l);const u=l.querySelector("#rc-panel-steps"),c=this,h=new ResizeObserver((()=>{jj(u,l.offsetWidth,c.LD)}));if(h.observe(l),jj(u,l.offsetWidth,this.LD),0===e.length)u.className+=" rc-panel-no-steps";else for(let t in e){const s=Gj(this,t,e[t],n);u.appendChild(s)}(n.showNextButton||n._demoActivateAll)&&u.appendChild(qj(e.length,n));Hj(this,{index:0,finished:[]},e,n,s),this._panel.panel=l,this._panel.panelObserver=h,this._panel.panelTasks=e,this._panel.panelParent=t;const d={...n};return n.headline===U.H.RC_panelTitle[this.L]&&delete d.headline,n.description===U.H.RC_panelIntro[this.L]&&delete d.description,n.nextHeadline===U.H.RC_panelTitleNext[this.L]&&delete d.nextHeadline,n.nextDescription===U.H.RC_panelIntroNext[this.L]&&delete d.nextDescription,n.nextButton===U.H.RC_panelButton[this.L]&&delete d.nextButton,this._panel.panelOptions=d,this._panel.panelCallback=s,this._panel.panelResolve=r,this._panelStatus.hasPanel=!0,this._panelStatus.panelFinished=!1,n.i18n&&Yj(this,document.querySelector("#rc-panel-language-parent"),o),n.debug&&(0,xj.K)(this,l,e,s),null===r&&(r=!0),new Promise((e=>{const t=setInterval((()=>{this._panelStatus.panelFinished&&(clearInterval(t),e(r))}),100);this._panelStatus.panelResolveIntervals.push(t)}))};const Vj={screenSize:{use:1,name:U.H.RC_screenSize["en-US"],phraseHandle:"RC_screenSize"},measureDistance:{use:1,name:U.H.RC_viewingDistance["en-US"],phraseHandle:"RC_viewingDistance"},trackDistance:{use:2,name:U.H.RC_distanceTracking["en-US"],phraseHandle:"RC_distanceTracking"},trackGaze:{use:2,name:U.H.RC_gazeTracking["en-US"],phraseHandle:"RC_gazeTracking"},performance:{use:1,name:U.H.RC_performance["en-US"],phraseHandle:"RC_performance"}},Wj=Object.keys(Vj),Uj=e=>{if(!Array.isArray(e))return!1;for(let t of e){if(!("object"!=typeof t||null!==t&&Wj.includes(t.name)))return!1;if("string"==typeof t&&!Wj.includes(t))return!1}return!0},Gj=(e,t,n,s)=>{let r,a;switch(Vj[Kj(n)].use){case 0:case 1:default:r="",a="";break;case 2:r=kj(),a=U.H.RC_panelUsesWebcam[e.L];break;case 3:r=kj()+Sj(),a=U.H.RC_panelUsesWebcamPhone[e.L]}const i=document.createElement("button");return i.className="rc-panel-step rc-panel-step-todo"+(s._demoActivateAll?" rc-panel-step-active":" rc-panel-step-inactive"),i.dataset.index=t,i.innerHTML=(r.length?`

      ${r}

      `:"")+`

      ${Number(t)+1}  ${U.H[Vj[Kj(n)].phraseHandle][e.L]}

      `+(r.length?`

      ${r} ${a}

      `:""),i},qj=(e,t)=>{const n=document.createElement("button");return n.className="rc-panel-step rc-panel-next-button rc-panel-step-inactive",n.dataset.index=e,n.innerHTML=`

      ${t.nextButton}

      `,n},jj=(e,t,n)=>{t<640?(e.classList.add("rc-panel-steps-s"),e.classList.remove("rc-panel-steps-l"),e.childNodes.forEach((e=>{e.classList.add(`rc-lang-${n.toLowerCase()}`)}))):(e.classList.add("rc-panel-steps-l"),e.classList.remove("rc-panel-steps-s"),e.childNodes.forEach((e=>{e.classList.remove("rc-lang-ltr"),e.classList.remove("rc-lang-rtl")})))},Hj=(e,t,n,s,r)=>{document.querySelectorAll(".rc-panel-step").forEach(((a,i)=>{const o=Number(a.dataset.index);if(s._demoActivateAll)a.onclick=()=>{e[Kj(n[i])](...Xj(n[i])),$j(i),t.finished.push(Kj(n[i]));for(let e of n)if(!t.finished.includes(Kj(e)))return;let s=document.querySelector(".rc-panel-next-button");s.classList.replace("rc-panel-step-inactive","rc-panel-step-active"),s.onclick=()=>{e._panelStatus.panelFinished=!0,(0,_.nB)(r,{timestamp:performance.now()})}};else if(o===t.index)if(a.classList.replace("rc-panel-step-inactive","rc-panel-step-active"),a.focus(),o!==n.length)o!==n.length-1||s.showNextButton?a.onclick=()=>{e[Kj(n[t.index])](...Xj(n[t.index],(()=>{$j(t.index),t.index++,Hj(e,t,n,s,r)})))}:a.onclick=()=>{e[Kj(n[t.index])](...Xj(n[t.index],(()=>{$j(t.index)}),r,(()=>{e._panelStatus.panelFinished=!0})))};else if(o===n.length&&s.showNextButton){const{headline:t,nextHeadline:n,description:i,nextDescription:o}=s;t!==n&&(document.querySelector("#rc-panel-title").innerHTML=n),i!==o&&(document.querySelector("#rc-panel-description").innerHTML=o),a.onclick=()=>{e._panelStatus.panelFinished=!0,(0,_.nB)(r,{timestamp:performance.now()})}}}))},$j=e=>{document.querySelectorAll(".rc-panel-step").forEach((t=>{Number(t.dataset.index)===e&&(t.classList.replace("rc-panel-step-todo","rc-panel-step-finished"),t.classList.replace("rc-panel-step-active","rc-panel-step-inactive"))}))},Kj=e=>"string"==typeof e?e:e.name,Xj=(e,t,n=null,s=null)=>{"string"==typeof e&&(e={name:e});const r=()=>{(0,_.nB)(t),(0,_.nB)(n,{timestamp:performance.now()}),(0,_.nB)(s)};return["screenSize","measureDistance","performance"].includes(e.name)?[e.options||{},t=>{(0,_.nB)(e.callback,t),r()}]:"trackGaze"===e.name?[e.options||{},t=>{(0,_.nB)(e.callbackOnCalibrationEnd,t),r()},e.callbackTrack||null]:"trackDistance"===e.name?[e.options||{},t=>{(0,_.nB)(e.callbackStatic,t),r()},e.callbackTrack||null]:void 0},Zj=e=>{e._panelStatus.panelResolveIntervals.forEach((e=>clearInterval(e))),e._panelStatus.panelResolveIntervals=[]},Yj=(e,t,n)=>{let s=`",t.innerHTML=s,document.querySelector("#rc-panel-lang-picker").onchange=()=>{e.newLanguage(document.querySelector("#rc-panel-lang-picker").value),e.resetPanel()}};E.A.prototype.backgroundColor=function(e=null){if(!this.checkInitialized())return null;null!==e&&/^#([0-9A-F]{3}){1,2}$/i.test(e)?this._params.backgroundColor=e:this._params.backgroundColor="#eee";let t=document.querySelector("#calibration-background");return t&&(t.style.background=this.params.backgroundColor),this.params.backgroundColor},E.A.prototype.videoOpacity=function(e=null){if(!this.checkInitialized())return null;null===e||Number(e)!==e||Number(e)>1||Number(e)<0?this._params.videoOpacity=.8:this._params.videoOpacity=e;let t=document.querySelector("#webgazerVideoContainer");return t&&(t.style.opacity=this.params.videoOpacity),this.params.videoOpacity},E.A.prototype.showCancelButton=function(e=!0){return this.checkInitialized()?(this._params.showCancelButton=!!e,this.params.showCancelButton):null};var Qj=__webpack_require__(9725),Jj={};Jj.styleTagTransform=zj(),Jj.setAttributes=Dj(),Jj.insert=Oj().bind(null,"head"),Jj.domAPI=Tj(),Jj.insertStyleElement=Fj();_j()(Qj.A,Jj);Qj.A&&Qj.A.locals&&Qj.A.locals;var eH=__webpack_require__(5151),tH={};tH.styleTagTransform=zj(),tH.setAttributes=Dj(),tH.insert=Oj().bind(null,"head"),tH.domAPI=Tj(),tH.insertStyleElement=Fj();_j()(eH.A,tH);eH.A&&eH.A.locals&&eH.A.locals;var nH=__webpack_require__(2945),sH={};sH.styleTagTransform=zj(),sH.setAttributes=Dj(),sH.insert=Oj().bind(null,"head"),sH.domAPI=Tj(),sH.insertStyleElement=Fj();_j()(nH.A,sH);nH.A&&nH.A.locals&&nH.A.locals;var rH=__webpack_require__(9057),aH={};aH.styleTagTransform=zj(),aH.setAttributes=Dj(),aH.insert=Oj().bind(null,"head"),aH.domAPI=Tj(),aH.insertStyleElement=Fj();_j()(rH.A,aH);rH.A&&rH.A.locals&&rH.A.locals;var iH=__webpack_require__(4889),oH={};oH.styleTagTransform=zj(),oH.setAttributes=Dj(),oH.insert=Oj().bind(null,"head"),oH.domAPI=Tj(),oH.insertStyleElement=Fj();_j()(iH.A,oH);iH.A&&iH.A.locals&&iH.A.locals;var lH=__webpack_require__(2636),uH={};uH.styleTagTransform=zj(),uH.setAttributes=Dj(),uH.insert=Oj().bind(null,"head"),uH.domAPI=Tj(),uH.insertStyleElement=Fj();_j()(lH.A,uH);lH.A&&lH.A.locals&&lH.A.locals;var cH=__webpack_require__(2921),hH={};hH.styleTagTransform=zj(),hH.setAttributes=Dj(),hH.insert=Oj().bind(null,"head"),hH.domAPI=Tj(),hH.insertStyleElement=Fj();_j()(cH.A,hH);cH.A&&cH.A.locals&&cH.A.locals;var dH=__webpack_require__(7271),pH={};pH.styleTagTransform=zj(),pH.setAttributes=Dj(),pH.insert=Oj().bind(null,"head"),pH.domAPI=Tj(),pH.insertStyleElement=Fj();_j()(dH.A,pH);dH.A&&dH.A.locals&&dH.A.locals;var fH=__webpack_require__(2551),mH={};mH.styleTagTransform=zj(),mH.setAttributes=Dj(),mH.insert=Oj().bind(null,"head"),mH.domAPI=Tj(),mH.insertStyleElement=Fj();_j()(fH.A,mH);fH.A&&fH.A.locals&&fH.A.locals;var gH=__webpack_require__(8470),yH={};yH.styleTagTransform=zj(),yH.setAttributes=Dj(),yH.insert=Oj().bind(null,"head"),yH.domAPI=Tj(),yH.insertStyleElement=Fj();_j()(gH.A,yH);gH.A&&gH.A.locals&&gH.A.locals;var bH=__webpack_require__(2535),wH={};wH.styleTagTransform=zj(),wH.setAttributes=Dj(),wH.insert=Oj().bind(null,"head"),wH.domAPI=Tj(),wH.insertStyleElement=Fj();_j()(bH.A,wH);bH.A&&bH.A.locals&&bH.A.locals;var vH=__webpack_require__(663),xH={};xH.styleTagTransform=zj(),xH.setAttributes=Dj(),xH.insert=Oj().bind(null,"head"),xH.domAPI=Tj(),xH.insertStyleElement=Fj();_j()(vH.A,xH);vH.A&&vH.A.locals&&vH.A.locals;var AH=__webpack_require__(5319),kH={};kH.styleTagTransform=zj(),kH.setAttributes=Dj(),kH.insert=Oj().bind(null,"head"),kH.domAPI=Tj(),kH.insertStyleElement=Fj();_j()(AH.A,kH);AH.A&&AH.A.locals&&AH.A.locals;var CH=__webpack_require__(290),SH={};SH.styleTagTransform=zj(),SH.setAttributes=Dj(),SH.insert=Oj().bind(null,"head"),SH.domAPI=Tj(),SH.insertStyleElement=Fj();_j()(CH.A,SH);CH.A&&CH.A.locals&&CH.A.locals;const EH=new E.A;EH.gazeTracker=new cj(EH);const _H=EH})(),__webpack_exports__=__webpack_exports__.default,__webpack_exports__})())); +!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.RemoteCalibrator=t():e.RemoteCalibrator=t()}(self,(()=>(()=>{var __webpack_modules__={6003:()=>{window.requestAnimFrame=window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||function(e,t){return window.setTimeout(e,1e3/60)},window.cancelRequestAnimFrame=window.cancelCancelRequestAnimationFrame||window.webkitCancelRequestAnimationFrame||window.mozCancelRequestAnimationFrame||window.oCancelRequestAnimationFrame||window.msCancelRequestAnimationFrame||window.clearTimeout},359:(e,t,n)=>{"use strict";n.d(t,{F:()=>r,a:()=>a});var s=n(9677);const r=(e,t,{go:n,cancel:r,custom:a},i,o=!0)=>{const l=document.createElement("div");let u,c,h;if(l.className="rc-buttons"+(o?" rc-absolute-buttons":""),l.id="rc-buttons",n&&(u=document.createElement("button"),u.className="rc-button rc-go-button",u.onclick=n,u.innerHTML=s.H.RC_ok[e],l.appendChild(u)),r&&i&&(c=document.createElement("button"),c.className="rc-button rc-cancel-button",c.onclick=r,c.innerHTML=s.H.RC_cancel[e],l.appendChild(c)),a){const{callback:e,content:t}=a;h=document.createElement("button"),h.className="rc-button rc-custom-button",h.onclick=e,h.innerHTML=t,l.appendChild(h)}return t.appendChild(l),[l,u,c,h]},a=e=>{e.querySelector("#rc-buttons").remove()}},2016:(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{"use strict";__webpack_require__.d(__webpack_exports__,{K:()=>takeInput});var _buttons__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__(359),_keyBinder__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__(9853),_utils__WEBPACK_IMPORTED_MODULE_2__=__webpack_require__(9043);const takeInput=async(RC,extraFunction=null,extraFunctionOut=null,customButtonConfig=null)=>{const unit=RC.equipment.value.unit,unitDisplay=unit===RC._CONST.UNITS.CM?"cm":"in",unitIsFraction=unit===RC._CONST.UNITS.IN_F,formItem=`
      \n
      \n ${unitIsFraction?`${unitDisplay}`:`${unitDisplay}`}\n
      \n
      `,instruction=RC.background.querySelector(".calibration-instruction");instruction.innerHTML+=formItem;const formElement=instruction.querySelector(".rc-form"),formInputElement=instruction.querySelector(".rc-form-input"),formInputElementFInteger=instruction.querySelector(".rc-form-input-f-integer"),formInputElementFFraction=instruction.querySelector(".rc-form-input-f-fraction");unitIsFraction?formInputElementFInteger.focus():formInputElement.focus();const addedButtons=(0,_buttons__WEBPACK_IMPORTED_MODULE_0__.F)(RC.L,formElement,{go:()=>{},custom:customButtonConfig||void 0},!0,!1),goButton=addedButtons[1],customButton=addedButtons[3];goButton.disabled=!0;const eleOkay=e=>{e.classList.remove("rc-input-error"),goButton.disabled=!1},eleError=e=>{isAcceptedSingleInput(e.value.slice(-1))?(e.classList.add("rc-input-error"),goButton.disabled=!0):e.value=e.value.substring(0,e.value.length-1)},setupEleOninput=(e,t)=>{e.oninput=()=>{t(e.value)?eleOkay(e):eleError(e)}},_validationForFraction=()=>{let e=!0;return validInputInteger(formInputElementFInteger.value)?eleOkay(formInputElementFInteger):(eleError(formInputElementFInteger),e=!1),validInputFraction(formInputElementFFraction.value)?eleOkay(formInputElementFFraction):(eleError(formInputElementFFraction),e=!1),e};return unitIsFraction?(formInputElementFInteger.oninput=_validationForFraction,formInputElementFFraction.oninput=_validationForFraction):setupEleOninput(formInputElement,validInput),(0,_utils__WEBPACK_IMPORTED_MODULE_2__.nB)(extraFunction),new Promise((resolve=>{const bFunction=()=>{removeInputElements(formElement,extraFunctionOut),(0,_keyBinder__WEBPACK_IMPORTED_MODULE_1__.l)(bindKeysFunction),resolve(null)},fFunction=()=>{let valid=!1,numericalValue,inputValue;unitIsFraction&&validInputInteger(formInputElementFInteger.value)&&validInputFraction(formInputElementFFraction.value)?(valid=!0,numericalValue=parseInt(formInputElementFInteger.value)+eval(formInputElementFFraction.value),inputValue=formInputElementFInteger.value+" "+formInputElementFFraction.value):!unitIsFraction&&validInput(formInputElement.value)&&(valid=!0,numericalValue=Number(formInputElement.value)||Number(formInputElement.value.replace(",",".")),inputValue=formInputElement.value),valid&&(removeInputElements(formElement,extraFunctionOut),(0,_keyBinder__WEBPACK_IMPORTED_MODULE_1__.l)(bindKeysFunction),resolve({value:{numerical:numericalValue,input:inputValue,unit},timestamp:performance.now()}))};goButton.onclick=fFunction,customButton.onclick=bFunction;const bindKeysFunction=(0,_keyBinder__WEBPACK_IMPORTED_MODULE_1__.m)({Enter:fFunction,Escape:bFunction})}))},removeInputElements=(e,t)=>{(0,_buttons__WEBPACK_IMPORTED_MODULE_0__.a)(e);for(let t of e.children)t.remove();e.remove(),(0,_utils__WEBPACK_IMPORTED_MODULE_2__.nB)(t)},validInput=e=>e.length>0&&!e.includes(" ")&&(!isNaN(e)||!isNaN(e.replace(",","."))),validInputInteger=e=>!!validInput(e)&&(parseInt(e)===Number(e)&&Number(e)>0),validInputFraction=text=>{if("0"===text)return!0;if(!text.includes("/")||text.match(/\//g).length>1)return!1;const numbers=text.split("/");return validInputInteger(numbers[0])&&validInputInteger(numbers[1])&&(0,_utils__WEBPACK_IMPORTED_MODULE_2__.DW)(numbers[1])&&eval(text)<1},isAcceptedSingleInput=e=>/[0-9]/.test(e)||[".","/",","].includes(e)},9853:(e,t,n)=>{"use strict";n.d(t,{l:()=>a,m:()=>r});var s=n(9043);function r(e,t="keydown"){const n=t=>{t.key in e&&(t.preventDefault(),(0,s.nB)(e[t.key],t))};return document.body.addEventListener(t,n),n}function a(e,t="keydown"){document.body.removeEventListener(t,e)}},2646:(e,t,n)=>{"use strict";n.d(t,{G:()=>i,t:()=>r});var s=n(9677);function r(e){const t=Object.keys(s.H.EE_languageNameNative);if(t.includes(e))return a(e);const n=[];t.forEach((e=>{n.push(e.split("-")[0])}));const r=e.split("-")[0].toLowerCase();return n.includes(r)?a(t[n.indexOf(r)]):a("en-US")}function a(e){return{value:{language:e,languageNameEnglish:s.H.EE_languageNameEnglish[e],languageNameNative:s.H.EE_languageNameNative[e],languageDirection:s.H.EE_languageDirection[e],languagePhraseSource:s.H.EE_phraseSource[e]},timestamp:performance.now()}}function i(e){return"1"===s.H.EE_languageUseSpace[e]?" ":""}},477:(e,t,n)=>{"use strict";n.d(t,{l:()=>u});const s="mocha"===n(7999)._;let r,a;if(!s){const e=n(9171);r=e.Synth,a=e.Volume}class i{triggerAttackRelease(){}}const o=s?new i:new r({oscillator:{type:"sine"},envelope:{attack:.001,decay:.001,sustain:1,release:.001}}).connect(new a(-17).toDestination()),l=s?new i:new r({oscillator:{type:"sine"}}).connect(new a(-5).toDestination()),u=(e=0)=>{switch(e){case 0:default:return void o.triggerAttackRelease(2e3,.05);case 1:return void o.triggerAttackRelease(500,.5);case 2:return void o.triggerAttackRelease(200,.6);case 3:return void l.triggerAttackRelease(200,.2)}}},9043:(e,t,n)=>{"use strict";function s(e,...t){if(e&&"function"==typeof e)return t.length?e(...t):e()}n.d(t,{$O:()=>l,$k:()=>w,AU:()=>u,Av:()=>y,DW:()=>d,Ew:()=>c,G8:()=>g,JZ:()=>m,KY:()=>v,Md:()=>r,Nh:()=>f,Sf:()=>i,aS:()=>o,k4:()=>p,ll:()=>h,ln:()=>b,nB:()=>s,yy:()=>a}),function(){for(var e=0,t=["ms","moz","webkit","o"],n=0;n{};function a(e){return new Promise((t=>setTimeout(t,e)))}function i(){if(document.fullscreenEnabled||document.webkitFullscreenEnabled||document.mozFullScreenEnabled||document.msFullscreenEnabled){const e=document.documentElement;return e.requestFullscreen?(e.requestFullscreen(),!0):e.mozRequestFullScreen?(e.mozRequestFullScreen(),!0):e.webkitRequestFullscreen?(e.webkitRequestFullscreen(),!0):!!e.msRequestFullscreen&&(e.msRequestFullscreen(),!0)}return!1}function o(){return Math.abs(window.innerHeight-screen.height)<5&&Math.abs(window.innerWidth-screen.width)<5&&window.screenX<5&&window.screenY<5}function l(e,t=null,n=!1,s=""){return`

      ${e}

      `+(t?`

      ${t}

      `:"")}function u(e,t,n){return en?n:e}function c(e,t,n,s,r){return s+1*(e-t)/(n-t)*(r-s)}function h(e,t,n,s){return Math.sqrt(Math.pow(e-n,2)+Math.pow(t-s,2))}function d(e){return e&&!(e&e-1)}function p(e){for(let t=e.length-1;t>0;t--){const n=Math.floor(Math.random()*(t+1));[e[t],e[n]]=[e[n],e[t]]}return e}function f(e,t){let n=Math.pow(10,t);return Math.round(e*n)/n}const m=e=>{const t=Math.floor(e.length/2),n=[...e].sort(((e,t)=>e-t));return e.length%2!=0?n[t]:(n[t-1]+n[t])/2},g=e=>e.reduce(((e,t)=>e+t))/e.length;function y(e,t,n=1){let s=0,r=0;for(;0===s;)s=Math.random();for(;0===r;)r=Math.random();let a=Math.sqrt(-2*Math.log(s))*Math.cos(2*Math.PI*r);return a=a/10+.5,a>1||a<0?a=y(e,t,n):(a=Math.pow(a,n),a*=t-e,a+=e),a}const b=e=>JSON.parse(JSON.stringify(e));function w(){"activeElement"in document&&document.activeElement.blur()}const v=e=>{if("touchstart"===e.type||"touchmove"===e.type){const t=e.touches[0];return{x:t.clientX,y:t.clientY}}return{x:e.clientX,y:e.clientY}}},7999:(e,t,n)=>{"use strict";n.d(t,{A:()=>w,_:()=>y});var s=n(7503),r=n.n(s),a=n(115),i=n.n(a);const o=["tall","short","up","down","fancy","busy","loud","crazy","kind","nice","real","speedy","handy","active","alert","bold","brave","bright","calm","clever","cool","free","grand","great","happy","jolly","lucky","spicy","sunny","super","wise"],l=["bat","bear","bird","cat","cow","deer","dog","dove","dragon","duck","eagle","fish","fox","frog","goose","lion","mouse","owl","pig","rat","seal","shark","sheep","snake","spider","tiger","turkey","viper","whale","wolf","onion","carrot","pear","bean","corn","bread","apple","banana","fig","grape","lemon","lime","orange","peach","plum","dumpling","cake","pasta","pot","sushi"],u=["blue","bronze","fire","forest","gold","gray","green","navy","purple","red","silver","sky","yellow","neon","black","white","brown","aqua"];function c(e){return e[Math.floor(Math.random()*e.length)]}function h(e){return e.charAt(0).toUpperCase()+e.slice(1)}function d(){const e="000"+(new Date).getMilliseconds().toString();return h(c(o))+h(c(u))+h(c(l))+e.substring(e.length-3)}var p=n(782),f=n(9043),m=n(2646),g=n(9677);const y="production";class b{constructor(){window.console.log(`%c\nEasyEyes Remote Calibrator ${this.version.value}\n`,`color: ${this._CONST.COLOR.ORANGE}`),this._initialized=!1,this._id=null,this._lang=null,this._langData=[],this._panelStatus={hasPanel:!1,panelFinished:!1,panelResolveIntervals:[]},this._panel={panel:null,panelObserver:null,panelTasks:[],panelParent:null,panelOptions:{},panelCallback:null,panelResolve:null},this._participantCheckEquipment={has:null,equipment:null,unit:null},this._trackingSetupFinishedStatus={gaze:!0,distance:!0},this._trackingPaused={gaze:!1,distance:!1},this._trackingVideoFrameTimestamps={gaze:0,distance:0},this._distanceTrackNudging={distanceCorrecting:null,distanceCorrectEnabled:!1,distanceDesired:null,distanceAllowedRatio:null},this._gazeTrackNudging={isCorrectingGaze:!1},this._environmentData=[],this._displayData=[],this._screenData=[],this._viewingDistanceData=[],this._nearPointData=[],this._PDData=[],this._gazePositionData=[],this._gazeAccuracyData=[],this._performanceData=[],this._fullscreenData=[],this._equipmentData=[],this._checkData=[],this._background={element:null,instructionElement:null},this._nudger={element:null,gazeElement:null},this._params={backgroundColor:"#eee",videoOpacity:.8,showCancelButton:!0}}get background(){return this._background.element}get instructionElement(){return this._background.instructionElement}get nudger(){return this._nudger.element}get params(){return this._params}get id(){return this._id?{value:this._id.value,timestamp:this._id.timestamp,date:this._id.date}:null}_helper_get(e,t){if(!e.length)return null;let n=e[e.length-1];return t?{value:n.value[t],timestamp:n.timestamp}:n}get version(){return{value:"0.7.8"}}get supportedLanguages(){const e=[];for(let t in g.H.EE_languageNameEnglish)e.push({language:t,languageNameEnglish:g.H.EE_languageNameEnglish[t],languageNameNative:g.H.EE_languageNameNative[t]});return e}get L(){return this._lang}get LD(){return this.languageDirection.value}get language(){return this._helper_get(this._langData,"language")}get languageNameEnglish(){return this._helper_get(this._langData,"languageNameEnglish")}get languageNameNative(){return this._helper_get(this._langData,"languageNameNative")}get languageDirection(){return this._helper_get(this._langData,"languageDirection")}get languagePhraseSource(){return this._helper_get(this._langData,"languagePhraseSource")}get computeArrayFillMHz(){return this._helper_get(this._performanceData,"computeArrayFillMHz")}get computeRandomMHz(){return this._helper_get(this._performanceData,"computeRandomMHz")}get idealFps(){return this._helper_get(this._performanceData,"idealFps")}get stressFps(){return this._helper_get(this._performanceData,"stressFps")}get isFullscreen(){return this.fullscreenData.length&&i()((0,f.aS)(),this._helper_get(this._fullscreenData).value)||(this.newFullscreenData={value:(0,f.aS)(),timestamp:performance.now()}),this._helper_get(this._fullscreenData)}get concurrency(){return this._helper_get(this._environmentData,"concurrency")}get browser(){return this._helper_get(this._environmentData,"browser")}get browserVersion(){return this._helper_get(this._environmentData,"browserVersion")}get deviceType(){return this._helper_get(this._environmentData,"deviceType")}get isMobile(){const e=this._helper_get(this._environmentData,"deviceType");return{value:"desktop"!==e.value,timestamp:e.timestamp}}get model(){return this._helper_get(this._environmentData,"model")}get manufacturer(){return this._helper_get(this._environmentData,"manufacturer")}get engine(){return this._helper_get(this._environmentData,"engine")}get system(){return this._helper_get(this._environmentData,"system")}get systemFamily(){return this._helper_get(this._environmentData,"systemFamily")}get description(){return this._helper_get(this._environmentData,"description")}get fullDescription(){return this._helper_get(this._environmentData,"fullDescription")}get userLanguage(){return this._helper_get(this._environmentData,"userLanguage")}get equipment(){return this._helper_get(this._equipmentData)}get displayWidthPx(){return this._displaySize(),this._helper_get(this._displayData,"displayWidthPx")}get displayHeightPx(){return this._displaySize(),this._helper_get(this._displayData,"displayHeightPx")}get windowWidthPx(){return this._displaySize(),this._helper_get(this._displayData,"windowWidthPx")}get windowHeightPx(){return this._displaySize(),this._helper_get(this._displayData,"windowHeightPx")}get screenWidthCm(){return this._helper_get(this._screenData,"screenWidthCm")}get screenHeightCm(){return this._helper_get(this._screenData,"screenHeightCm")}get screenDiagonalCm(){return this._helper_get(this._screenData,"screenDiagonalCm")}get screenDiagonalIn(){return this._helper_get(this._screenData,"screenDiagonalIn")}get screenPpi(){return this._helper_get(this._screenData,"screenPpi")}get screenPhysicalPpi(){return this._helper_get(this._screenData,"screenPhysicalPpi")}get viewingDistanceCm(){return this._helper_get(this._viewingDistanceData)}get nearPointCm(){return this._helper_get(this._nearPointData)}get PDCm(){return this._helper_get(this._PDData)}get gazePositionPx(){return this._helper_get(this._gazePositionData)}get gazeAccuracyDeg(){return this._helper_get(this._gazeAccuracyData)}get displayData(){return this._displayData}get screenData(){return this._screenData}get viewingDistanceData(){return this._viewingDistanceData}get nearPointData(){return this._nearPointData}get PDData(){return this._PDData}get gazeData(){return this._gazePositionData}get performanceData(){return this._performanceData}get fullscreenData(){return this._fullscreenData}get environmentData(){return this._environmentData}get languageData(){return this._langData}get equipmentData(){return this._equipmentData}get checkData(){return this._checkData}set newDisplayData(e){this._displayData.push(e)}set newScreenData(e){this._screenData.push(e)}set newViewingDistanceData(e){this._viewingDistanceData.push(e)}set newNearPointData(e){this._nearPointData.push(e)}set newPDData(e){this._PDData.push(e)}set newGazePositionData(e){this._gazePositionData.push(e)}set newGazeAccuracyData(e){this._gazeAccuracyData.push(e)}set newEnvironmentData(e){this._environmentData.push(e)}set newPerformanceData(e){this._performanceData.push(e)}set newFullscreenData(e){this._fullscreenData.push(e)}set newLanguageData(e){this._langData.push(e)}set newEquipmentData(e){this._equipmentData.push(e)}set newCheckData(e){this._checkData.push(e)}}b.prototype.init=async function(e={},t){this._initialized||(this._initialized=!0,e=Object.assign({id:d(),language:"AUTO",languagePhrasesJSON:null,fullscreen:!1},e),await(async(e=null)=>{const{remoteCalibratorPhrases:t}=await import("https://cdn.jsdelivr.net/gh/EasyEyes/remote-calibrator-phrases@latest/phrases/main.js");Object.assign(g.H,t),e&&Object.assign(g.H,e)})(e.languagePhrasesJSON),e.fullscreen&&!p.Y&&(0,f.Sf)(),this._id={value:e.id,timestamp:performance.now(),date:new Date},this._environment(),this._displaySize(),this._CONST.S.AUTO===e.language?this.newLanguageData=(0,m.t)(this.userLanguage.value):this.newLanguageData=(0,m.t)(e.language),this._lang=this.language.value,(0,f.nB)(t,this._id))},b.prototype._environment=function(){if(this.checkInitialized()){(0,f.$k)();const e=e=>e.match(/Mobi/i)?"mobile":"desktop",t={value:{concurrency:window.navigator.hardwareConcurrency||-1,browser:r().name,browserVersion:r().version,deviceType:e(navigator.userAgent),model:r().product||"unknown",manufacturer:r().manufacturer||"unknown",engine:r().layout,system:`${r().os.family} ${r().os.version}`,systemFamily:r().os.family,description:r().description,fullDescription:r().ua,userLanguage:window.navigator.userLanguage||window.navigator.language},timestamp:this.id.timestamp};this.newEnvironmentData=t}},b.prototype.checkInitialized=function(){return!!this._initialized},b.prototype.getFullscreen=function(e=!0){return!!(0,f.aS)()||(this.newFullscreenData={value:!(!e||p.Y)&&(0,f.Sf)(),timestamp:performance.now()},this.isMobile.value&&window.scrollBy(0,1),this.isFullscreen)},b.prototype.newLanguage=function(e){if(this.checkInitialized()){let t;return this.newLanguageData=t=(0,m.t)(e),this._lang=this.language.value,t}},b.prototype._addBackground=function(e){if(null!==this.background)return;let t=document.getElementById("calibration-background");return t||(t=document.createElement("div"),t.id="calibration-background",t.className=`calibration-background rc-lang-${this.LD.toLowerCase()}`,document.body.classList.add("lock-view"),document.body.appendChild(t),t.style.background=this.params.backgroundColor),e&&(t.innerHTML=e),this._background.element=t,this.background},b.prototype._replaceBackground=function(e){return null!==this.background&&this._removeBackground(),this._addBackground(e)},b.prototype._removeBackground=function(){let e=document.getElementById("calibration-background");return!!e&&(document.body.classList.remove("lock-view"),document.body.removeChild(e),this._background={element:null,instructionElement:null},!0)},b.prototype._addBackgroundText=function(e,t){let n=this.background.getElementsByClassName("calibration-instruction");for(let e=0;e{"use strict";n.d(t,{Y:()=>s});const s=!1},9677:(e,t,n)=>{"use strict";n.d(t,{H:()=>s});const s={EE_languageDirection:{"en-US":"",de:"",fr:"",es:"",pt:"",it:"",ro:"",pl:"",ru:"",hy:"",fi:"",ka:"",he:"",ar:"",ur:"",hi:"",ta:"",ml:"",te:"",kn:"",bn:"",id:"","zh-CN":"","zh-HK":"",ja:"",ko:""},EE_languageUseSpace:{"en-US":"",de:"",fr:"",es:"",pt:"",it:"",ro:"",pl:"",ru:"",hy:"",fi:"",ka:"",he:"",ar:"",ur:"",hi:"",ta:"",ml:"",te:"",kn:"",bn:"",id:"","zh-CN":"","zh-HK":"",ja:"",ko:""},EE_languageUsesSpaces:{"en-US":"",de:"",fr:"",es:"",pt:"",it:"",ro:"",pl:"",ru:"",hy:"",fi:"",ka:"",he:"",ar:"",ur:"",hi:"",ta:"",ml:"",te:"",kn:"",bn:"",id:"","zh-CN":"","zh-HK":"",ja:"",ko:""},EE_languageFont:{"en-US":"",de:"",fr:"",es:"",pt:"",it:"",ro:"",pl:"",ru:"",hy:"",fi:"",ka:"",he:"",ar:"",ur:"",hi:"",ta:"",ml:"",te:"",kn:"",bn:"",id:"","zh-CN":"","zh-HK":"",ja:"",ko:""},EE_languageNameEnglish:{"en-US":"",de:"",fr:"",es:"",pt:"",it:"",ro:"",pl:"",ru:"",hy:"",fi:"",ka:"",he:"",ar:"",ur:"",hi:"",ta:"",ml:"",te:"",kn:"",bn:"",id:"","zh-CN":"","zh-HK":"",ja:"",ko:""},EE_languageNameNative:{"en-US":"",de:"",fr:"",es:"",pt:"",it:"",ro:"",pl:"",ru:"",hy:"",fi:"",ka:"",he:"",ar:"",ur:"",hi:"",ta:"",ml:"",te:"",kn:"",bn:"",id:"","zh-CN":"","zh-HK":"",ja:"",ko:""},EE_languageChoose:{"en-US":"",de:"",fr:"",es:"",pt:"",it:"",ro:"",pl:"",ru:"",hy:"",fi:"",ka:"",he:"",ar:"",ur:"",hi:"",ta:"",ml:"",te:"",kn:"",bn:"",id:"","zh-CN":"","zh-HK":"",ja:"",ko:""},EE_phraseSource:{"en-US":"",de:"",fr:"",es:"",pt:"",it:"",ro:"",pl:"",ru:"",hy:"",fi:"",ka:"",he:"",ar:"",ur:"",hi:"",ta:"",ml:"",te:"",kn:"",bn:"",id:"","zh-CN":"","zh-HK":"",ja:"",ko:""},EE_compatibilityTitle:{"en-US":"",de:"",fr:"",es:"",pt:"",it:"",ro:"",pl:"",ru:"",hy:"",fi:"",ka:"",he:"",ar:"",ur:"",hi:"",ta:"",ml:"",te:"",kn:"",bn:"",id:"","zh-CN":"","zh-HK":"",ja:"",ko:""},EE_compatible:{"en-US":"",de:"",fr:"",es:"",pt:"",it:"",ro:"",pl:"",ru:"",hy:"",fi:"",ka:"",he:"",ar:"",ur:"",hi:"",ta:"",ml:"",te:"",kn:"",bn:"",id:"","zh-CN":"","zh-HK":"",ja:"",ko:""},EE_compatibleBrowserDeviceCores:{"en-US":"",de:"",fr:"",es:"",pt:"",it:"",ro:"",pl:"",ru:"",hy:"",fi:"",ka:"",he:"",ar:"",ur:"",hi:"",ta:"",ml:"",te:"",kn:"",bn:"",id:"","zh-CN":"","zh-HK":"",ja:"",ko:""},EE_compatibleBrowserNotOSDeviceCores:{"en-US":"",de:"",fr:"",es:"",pt:"",it:"",ro:"",pl:"",ru:"",hy:"",fi:"",ka:"",he:"",ar:"",ur:"",hi:"",ta:"",ml:"",te:"",kn:"",bn:"",id:"","zh-CN":"","zh-HK":"",ja:"",ko:""},EE_compatibleBrowserOSDeviceCores:{"en-US":"",de:"",fr:"",es:"",pt:"",it:"",ro:"",pl:"",ru:"",hy:"",fi:"",ka:"",he:"",ar:"",ur:"",hi:"",ta:"",ml:"",te:"",kn:"",bn:"",id:"","zh-CN":"","zh-HK":"",ja:"",ko:""},EE_compatibleBrowserVersionDeviceCores:{"en-US":"",de:"",fr:"",es:"",pt:"",it:"",ro:"",pl:"",ru:"",hy:"",fi:"",ka:"",he:"",ar:"",ur:"",hi:"",ta:"",ml:"",te:"",kn:"",bn:"",id:"","zh-CN":"","zh-HK":"",ja:"",ko:""},EE_compatibleBrowserVersionNotOSDeviceCores:{"en-US":"",de:"",fr:"",es:"",pt:"",it:"",ro:"",pl:"",ru:"",hy:"",fi:"",ka:"",he:"",ar:"",ur:"",hi:"",ta:"",ml:"",te:"",kn:"",bn:"",id:"","zh-CN":"","zh-HK":"",ja:"",ko:""},EE_compatibleBrowserVersionOSDeviceCores:{"en-US":"",de:"",fr:"",es:"",pt:"",it:"",ro:"",pl:"",ru:"",hy:"",fi:"",ka:"",he:"",ar:"",ur:"",hi:"",ta:"",ml:"",te:"",kn:"",bn:"",id:"","zh-CN":"","zh-HK":"",ja:"",ko:""},EE_compatibleDeviceCores:{"en-US":"",de:"",fr:"",es:"",pt:"",it:"",ro:"",pl:"",ru:"",hy:"",fi:"",ka:"",he:"",ar:"",ur:"",hi:"",ta:"",ml:"",te:"",kn:"",bn:"",id:"","zh-CN":"","zh-HK":"",ja:"",ko:""},EE_compatibleExceptForScreenResolution:{"en-US":"",de:"",fr:"",es:"",pt:"",it:"",ro:"",pl:"",ru:"",hy:"",fi:"",ka:"",he:"",ar:"",ur:"",hi:"",ta:"",ml:"",te:"",kn:"",bn:"",id:"","zh-CN":"","zh-HK":"",ja:"",ko:""},EE_compatibleNotBrowserDeviceCores:{"en-US":"",de:"",fr:"",es:"",pt:"",it:"",ro:"",pl:"",ru:"",hy:"",fi:"",ka:"",he:"",ar:"",ur:"",hi:"",ta:"",ml:"",te:"",kn:"",bn:"",id:"","zh-CN":"","zh-HK":"",ja:"",ko:""},EE_compatibleNotBrowserNotOSDeviceCores:{"en-US":"",de:"",fr:"",es:"",pt:"",it:"",ro:"",pl:"",ru:"",hy:"",fi:"",ka:"",he:"",ar:"",ur:"",hi:"",ta:"",ml:"",te:"",kn:"",bn:"",id:"","zh-CN":"","zh-HK":"",ja:"",ko:""},EE_compatibleNotBrowserOSDeviceCores:{"en-US":"",de:"",fr:"",es:"",pt:"",it:"",ro:"",pl:"",ru:"",hy:"",fi:"",ka:"",he:"",ar:"",ur:"",hi:"",ta:"",ml:"",te:"",kn:"",bn:"",id:"","zh-CN":"","zh-HK":"",ja:"",ko:""},EE_compatibleNotOSDeviceCores:{"en-US":"",de:"",fr:"",es:"",pt:"",it:"",ro:"",pl:"",ru:"",hy:"",fi:"",ka:"",he:"",ar:"",ur:"",hi:"",ta:"",ml:"",te:"",kn:"",bn:"",id:"","zh-CN":"","zh-HK":"",ja:"",ko:""},EE_compatibleOSDeviceCores:{"en-US":"",de:"",fr:"",es:"",pt:"",it:"",ro:"",pl:"",ru:"",hy:"",fi:"",ka:"",he:"",ar:"",ur:"",hi:"",ta:"",ml:"",te:"",kn:"",bn:"",id:"","zh-CN":"","zh-HK":"",ja:"",ko:""},EE_compatibleScreenHeight:{"en-US":"",de:"",fr:"",es:"",pt:"",it:"",ro:"",pl:"",ru:"",hy:"",fi:"",ka:"",he:"",ar:"",ur:"",hi:"",ta:"",ml:"",te:"",kn:"",bn:"",id:"","zh-CN":"","zh-HK":"",ja:"",ko:""},EE_compatibleScreenSize:{"en-US":"",de:"",fr:"",es:"",pt:"",it:"",ro:"",pl:"",ru:"",hy:"",fi:"",ka:"",he:"",ar:"",ur:"",hi:"",ta:"",ml:"",te:"",kn:"",bn:"",id:"","zh-CN":"","zh-HK":"",ja:"",ko:""},EE_compatibleScreenWidth:{"en-US":"",de:"",fr:"",es:"",pt:"",it:"",ro:"",pl:"",ru:"",hy:"",fi:"",ka:"",he:"",ar:"",ur:"",hi:"",ta:"",ml:"",te:"",kn:"",bn:"",id:"","zh-CN":"","zh-HK":"",ja:"",ko:""},EE_ok:{"en-US":"",de:"",fr:"",es:"",pt:"",it:"",ro:"",pl:"",ru:"",hy:"",fi:"",ka:"",he:"",ar:"",ur:"",hi:"",ta:"",ml:"",te:"",kn:"",bn:"",id:"","zh-CN":"","zh-HK":"",ja:"",ko:""},EE_or:{"en-US":"",de:"",fr:"",es:"",pt:"",it:"",ro:"",pl:"",ru:"",hy:"",fi:"",ka:"",he:"",ar:"",ur:"",hi:"",ta:"",ml:"",te:"",kn:"",bn:"",id:"","zh-CN":"","zh-HK":"",ja:"",ko:""},EE_refresh:{"en-US":"",de:"",fr:"",es:"",pt:"",it:"",ro:"",pl:"",ru:"",hy:"",fi:"",ka:"",he:"",ar:"",ur:"",hi:"",ta:"",ml:"",te:"",kn:"",bn:"",id:"","zh-CN":"","zh-HK":"",ja:"",ko:""},EE_describeDevice:{"en-US":"",de:"",fr:"",es:"",pt:"",it:"",ro:"",pl:"",ru:"",hy:"",fi:"",ka:"",he:"",ar:"",ur:"",hi:"",ta:"",ml:"",te:"",kn:"",bn:"",id:"","zh-CN":"","zh-HK":"",ja:"",ko:""},EE_describeScreenSize:{"en-US":"",de:"",fr:"",es:"",pt:"",it:"",ro:"",pl:"",ru:"",hy:"",fi:"",ka:"",he:"",ar:"",ur:"",hi:"",ta:"",ml:"",te:"",kn:"",bn:"",id:"","zh-CN":"","zh-HK":"",ja:"",ko:""},EE_IDRequested:{"en-US":"",de:"",fr:"",es:"",pt:"",it:"",ro:"",pl:"",ru:"",hy:"",fi:"",ka:"",he:"",ar:"",ur:"",hi:"",ta:"",ml:"",te:"",kn:"",bn:"",id:"","zh-CN":"","zh-HK":"",ja:"",ko:""},EE_noFileSelected:{"en-US":"",de:"",fr:"",es:"",pt:"",it:"",ro:"",pl:"",ru:"",hy:"",fi:"",ka:"",he:"",ar:"",ur:"",hi:"",ta:"",ml:"",te:"",kn:"",bn:"",id:"","zh-CN":"","zh-HK":"",ja:"",ko:""},EE_browseForID:{"en-US":"",de:"",fr:"",es:"",pt:"",it:"",ro:"",pl:"",ru:"",hy:"",fi:"",ka:"",he:"",ar:"",ur:"",hi:"",ta:"",ml:"",te:"",kn:"",bn:"",id:"","zh-CN":"","zh-HK":"",ja:"",ko:""},EE_ID_noLocalStorage:{"en-US":"",de:"",fr:"",es:"",pt:"",it:"",ro:"",pl:"",ru:"",hy:"",fi:"",ka:"",he:"",ar:"",ur:"",hi:"",ta:"",ml:"",te:"",kn:"",bn:"",id:"","zh-CN":"","zh-HK":"",ja:"",ko:""},EE_ID:{"en-US":"",de:"",fr:"",es:"",pt:"",it:"",ro:"",pl:"",ru:"",hy:"",fi:"",ka:"",he:"",ar:"",ur:"",hi:"",ta:"",ml:"",te:"",kn:"",bn:"",id:"","zh-CN":"","zh-HK":"",ja:"",ko:""},EE_ID_uploadOrValidID:{"en-US":"",de:"",fr:"",es:"",pt:"",it:"",ro:"",pl:"",ru:"",hy:"",fi:"",ka:"",he:"",ar:"",ur:"",hi:"",ta:"",ml:"",te:"",kn:"",bn:"",id:"","zh-CN":"","zh-HK":"",ja:"",ko:""},EE_ID_invalidID:{"en-US":"",de:"",fr:"",es:"",pt:"",it:"",ro:"",pl:"",ru:"",hy:"",fi:"",ka:"",he:"",ar:"",ur:"",hi:"",ta:"",ml:"",te:"",kn:"",bn:"",id:"","zh-CN":"","zh-HK":"",ja:"",ko:""},EE_ID_invalidFile:{"en-US":"",de:"",fr:"",es:"",pt:"",it:"",ro:"",pl:"",ru:"",hy:"",fi:"",ka:"",he:"",ar:"",ur:"",hi:"",ta:"",ml:"",te:"",kn:"",bn:"",id:"","zh-CN":"","zh-HK":"",ja:"",ko:""},EE_incompatible:{"en-US":"",de:"",fr:"",es:"",pt:"",it:"",ro:"",pl:"",ru:"",hy:"",fi:"",ka:"",he:"",ar:"",ur:"",hi:"",ta:"",ml:"",te:"",kn:"",bn:"",id:"","zh-CN":"","zh-HK":"",ja:"",ko:""},EE_incompatibleReturnToProlific:{"en-US":"",de:"",fr:"",es:"",pt:"",it:"",ro:"",pl:"",ru:"",hy:"",fi:"",ka:"",he:"",ar:"",ur:"",hi:"",ta:"",ml:"",te:"",kn:"",bn:"",id:"","zh-CN":"","zh-HK":"",ja:"",ko:""},EE_studyURL:{"en-US":"",de:"",fr:"",es:"",pt:"",it:"",ro:"",pl:"",ru:"",hy:"",fi:"",ka:"",he:"",ar:"",ur:"",hi:"",ta:"",ml:"",te:"",kn:"",bn:"",id:"","zh-CN":"","zh-HK":"",ja:"",ko:""},RC_angleDistanceIntro:{"en-US":"",de:"",fr:"",es:"",pt:"",it:"",ro:"",pl:"",ru:"",hy:"",fi:"",ka:"",he:"",ar:"",ur:"",hi:"",ta:"",ml:"",te:"",kn:"",bn:"",id:"","zh-CN":"","zh-HK":"",ja:"",ko:""},RC_angleDistanceTitle:{"en-US":"",de:"",fr:"",es:"",pt:"",it:"",ro:"",pl:"",ru:"",hy:"",fi:"",ka:"",he:"",ar:"",ur:"",hi:"",ta:"",ml:"",te:"",kn:"",bn:"",id:"","zh-CN":"","zh-HK":"",ja:"",ko:""},RC_cancel:{"en-US":"",de:"",fr:"",es:"",pt:"",it:"",ro:"",pl:"",ru:"",hy:"",fi:"",ka:"",he:"",ar:"",ur:"",hi:"",ta:"",ml:"",te:"",kn:"",bn:"",id:"","zh-CN":"","zh-HK":"",ja:"",ko:""},RC_distanceTracking:{"en-US":"",de:"",fr:"",es:"",pt:"",it:"",ro:"",pl:"",ru:"",hy:"",fi:"",ka:"",he:"",ar:"",ur:"",hi:"",ta:"",ml:"",te:"",kn:"",bn:"",id:"","zh-CN":"","zh-HK":"",ja:"",ko:""},RC_distanceTrackingCloseL:{"en-US":"",de:"",fr:"",es:"",pt:"",it:"",ro:"",pl:"",ru:"",hy:"",fi:"",ka:"",he:"",ar:"",ur:"",hi:"",ta:"",ml:"",te:"",kn:"",bn:"",id:"","zh-CN":"","zh-HK":"",ja:"",ko:""},RC_distanceTrackingCloseR:{"en-US":"",de:"",fr:"",es:"",pt:"",it:"",ro:"",pl:"",ru:"",hy:"",fi:"",ka:"",he:"",ar:"",ur:"",hi:"",ta:"",ml:"",te:"",kn:"",bn:"",id:"","zh-CN":"","zh-HK":"",ja:"",ko:""},RC_distanceTrackingGuide:{"en-US":"",de:"",fr:"",es:"",pt:"",it:"",ro:"",pl:"",ru:"",hy:"",fi:"",ka:"",he:"",ar:"",ur:"",hi:"",ta:"",ml:"",te:"",kn:"",bn:"",id:"","zh-CN":"","zh-HK":"",ja:"",ko:""},RC_distanceTrackingIntroEnd:{"en-US":"",de:"",fr:"",es:"",pt:"",it:"",ro:"",pl:"",ru:"",hy:"",fi:"",ka:"",he:"",ar:"",ur:"",hi:"",ta:"",ml:"",te:"",kn:"",bn:"",id:"","zh-CN":"","zh-HK":"",ja:"",ko:""},RC_distanceTrackingIntroStart:{"en-US":"",de:"",fr:"",es:"",pt:"",it:"",ro:"",pl:"",ru:"",hy:"",fi:"",ka:"",he:"",ar:"",ur:"",hi:"",ta:"",ml:"",te:"",kn:"",bn:"",id:"","zh-CN":"","zh-HK":"",ja:"",ko:""},RC_distanceTrackingMoveCloser:{"en-US":"",de:"",fr:"",es:"",pt:"",it:"",ro:"",pl:"",ru:"",hy:"",fi:"",ka:"",he:"",ar:"",ur:"",hi:"",ta:"",ml:"",te:"",kn:"",bn:"",id:"","zh-CN":"","zh-HK":"",ja:"",ko:""},RC_distanceTrackingMoveFurther:{"en-US":"",de:"",fr:"",es:"",pt:"",it:"",ro:"",pl:"",ru:"",hy:"",fi:"",ka:"",he:"",ar:"",ur:"",hi:"",ta:"",ml:"",te:"",kn:"",bn:"",id:"","zh-CN":"","zh-HK":"",ja:"",ko:""},RC_distanceTrackingRedo:{"en-US":"",de:"",fr:"",es:"",pt:"",it:"",ro:"",pl:"",ru:"",hy:"",fi:"",ka:"",he:"",ar:"",ur:"",hi:"",ta:"",ml:"",te:"",kn:"",bn:"",id:"","zh-CN":"","zh-HK":"",ja:"",ko:""},RC_distanceTrackingTitle:{"en-US":"",de:"",fr:"",es:"",pt:"",it:"",ro:"",pl:"",ru:"",hy:"",fi:"",ka:"",he:"",ar:"",ur:"",hi:"",ta:"",ml:"",te:"",kn:"",bn:"",id:"","zh-CN":"","zh-HK":"",ja:"",ko:""},RC_environment:{"en-US":"",de:"",fr:"",es:"",pt:"",it:"",ro:"",pl:"",ru:"",hy:"",fi:"",ka:"",he:"",ar:"",ur:"",hi:"",ta:"",ml:"",te:"",kn:"",bn:"",id:"","zh-CN":"","zh-HK":"",ja:"",ko:""},RC_errorCameraUseDenied:{"en-US":"",de:"",fr:"",es:"",pt:"",it:"",ro:"",pl:"",ru:"",hy:"",fi:"",ka:"",he:"",ar:"",ur:"",hi:"",ta:"",ml:"",te:"",kn:"",bn:"",id:"","zh-CN":"","zh-HK":"",ja:"",ko:""},RC_errorNoCamera:{"en-US":"",de:"",fr:"",es:"",pt:"",it:"",ro:"",pl:"",ru:"",hy:"",fi:"",ka:"",he:"",ar:"",ur:"",hi:"",ta:"",ml:"",te:"",kn:"",bn:"",id:"","zh-CN":"","zh-HK":"",ja:"",ko:""},RC_gazeTracking:{"en-US":"",de:"",fr:"",es:"",pt:"",it:"",ro:"",pl:"",ru:"",hy:"",fi:"",ka:"",he:"",ar:"",ur:"",hi:"",ta:"",ml:"",te:"",kn:"",bn:"",id:"","zh-CN":"","zh-HK":"",ja:"",ko:""},RC_gazeTrackingIntro:{"en-US":"",de:"",fr:"",es:"",pt:"",it:"",ro:"",pl:"",ru:"",hy:"",fi:"",ka:"",he:"",ar:"",ur:"",hi:"",ta:"",ml:"",te:"",kn:"",bn:"",id:"","zh-CN":"","zh-HK":"",ja:"",ko:""},RC_gazeTrackingNudge:{"en-US":"",de:"",fr:"",es:"",pt:"",it:"",ro:"",pl:"",ru:"",hy:"",fi:"",ka:"",he:"",ar:"",ur:"",hi:"",ta:"",ml:"",te:"",kn:"",bn:"",id:"","zh-CN":"","zh-HK":"",ja:"",ko:""},RC_gazeTrackingTitle:{"en-US":"",de:"",fr:"",es:"",pt:"",it:"",ro:"",pl:"",ru:"",hy:"",fi:"",ka:"",he:"",ar:"",ur:"",hi:"",ta:"",ml:"",te:"",kn:"",bn:"",id:"","zh-CN":"","zh-HK":"",ja:"",ko:""},RC_ifStuckPleaseReturn:{"en-US":"",de:"",fr:"",es:"",pt:"",it:"",ro:"",pl:"",ru:"",hy:"",fi:"",ka:"",he:"",ar:"",ur:"",hi:"",ta:"",ml:"",te:"",kn:"",bn:"",id:"","zh-CN":"","zh-HK":"",ja:"",ko:""},RC_nearPointIntro:{"en-US":"",de:"",fr:"",es:"",pt:"",it:"",ro:"",pl:"",ru:"",hy:"",fi:"",ka:"",he:"",ar:"",ur:"",hi:"",ta:"",ml:"",te:"",kn:"",bn:"",id:"","zh-CN":"","zh-HK":"",ja:"",ko:""},RC_nearPointTitle:{"en-US":"",de:"",fr:"",es:"",pt:"",it:"",ro:"",pl:"",ru:"",hy:"",fi:"",ka:"",he:"",ar:"",ur:"",hi:"",ta:"",ml:"",te:"",kn:"",bn:"",id:"","zh-CN":"","zh-HK":"",ja:"",ko:""},RC_ok:{"en-US":"",de:"",fr:"",es:"",pt:"",it:"",ro:"",pl:"",ru:"",hy:"",fi:"",ka:"",he:"",ar:"",ur:"",hi:"",ta:"",ml:"",te:"",kn:"",bn:"",id:"","zh-CN":"","zh-HK":"",ja:"",ko:""},RC_panelButton:{"en-US":"",de:"",fr:"",es:"",pt:"",it:"",ro:"",pl:"",ru:"",hy:"",fi:"",ka:"",he:"",ar:"",ur:"",hi:"",ta:"",ml:"",te:"",kn:"",bn:"",id:"","zh-CN":"","zh-HK":"",ja:"",ko:""},RC_panelIntro:{"en-US":"",de:"",fr:"",es:"",pt:"",it:"",ro:"",pl:"",ru:"",hy:"",fi:"",ka:"",he:"",ar:"",ur:"",hi:"",ta:"",ml:"",te:"",kn:"",bn:"",id:"","zh-CN":"","zh-HK":"",ja:"",ko:""},RC_panelIntroNext:{"en-US":"",de:"",fr:"",es:"",pt:"",it:"",ro:"",pl:"",ru:"",hy:"",fi:"",ka:"",he:"",ar:"",ur:"",hi:"",ta:"",ml:"",te:"",kn:"",bn:"",id:"","zh-CN":"","zh-HK":"",ja:"",ko:""},RC_panelTitle:{"en-US":"",de:"",fr:"",es:"",pt:"",it:"",ro:"",pl:"",ru:"",hy:"",fi:"",ka:"",he:"",ar:"",ur:"",hi:"",ta:"",ml:"",te:"",kn:"",bn:"",id:"","zh-CN":"","zh-HK":"",ja:"",ko:""},RC_panelTitleNext:{"en-US":"",de:"",fr:"",es:"",pt:"",it:"",ro:"",pl:"",ru:"",hy:"",fi:"",ka:"",he:"",ar:"",ur:"",hi:"",ta:"",ml:"",te:"",kn:"",bn:"",id:"","zh-CN":"","zh-HK":"",ja:"",ko:""},RC_panelUsesWebcam:{"en-US":"",de:"",fr:"",es:"",pt:"",it:"",ro:"",pl:"",ru:"",hy:"",fi:"",ka:"",he:"",ar:"",ur:"",hi:"",ta:"",ml:"",te:"",kn:"",bn:"",id:"","zh-CN":"","zh-HK":"",ja:"",ko:""},RC_panelUsesWebcamPhone:{"en-US":"",de:"",fr:"",es:"",pt:"",it:"",ro:"",pl:"",ru:"",hy:"",fi:"",ka:"",he:"",ar:"",ur:"",hi:"",ta:"",ml:"",te:"",kn:"",bn:"",id:"","zh-CN":"","zh-HK":"",ja:"",ko:""},RC_performance:{"en-US":"",de:"",fr:"",es:"",pt:"",it:"",ro:"",pl:"",ru:"",hy:"",fi:"",ka:"",he:"",ar:"",ur:"",hi:"",ta:"",ml:"",te:"",kn:"",bn:"",id:"","zh-CN":"","zh-HK":"",ja:"",ko:""},RC_performanceIntro:{"en-US":"",de:"",fr:"",es:"",pt:"",it:"",ro:"",pl:"",ru:"",hy:"",fi:"",ka:"",he:"",ar:"",ur:"",hi:"",ta:"",ml:"",te:"",kn:"",bn:"",id:"","zh-CN":"","zh-HK":"",ja:"",ko:""},RC_performanceTitle:{"en-US":"",de:"",fr:"",es:"",pt:"",it:"",ro:"",pl:"",ru:"",hy:"",fi:"",ka:"",he:"",ar:"",ur:"",hi:"",ta:"",ml:"",te:"",kn:"",bn:"",id:"","zh-CN":"","zh-HK":"",ja:"",ko:""},RC_privacyCamera:{"en-US":"",de:"",fr:"",es:"",pt:"",it:"",ro:"",pl:"",ru:"",hy:"",fi:"",ka:"",he:"",ar:"",ur:"",hi:"",ta:"",ml:"",te:"",kn:"",bn:"",id:"","zh-CN":"","zh-HK":"",ja:"",ko:""},RC_privacyIphoneMicrophone:{"en-US":"",de:"",fr:"",es:"",pt:"",it:"",ro:"",pl:"",ru:"",hy:"",fi:"",ka:"",he:"",ar:"",ur:"",hi:"",ta:"",ml:"",te:"",kn:"",bn:"",id:"","zh-CN":"","zh-HK":"",ja:"",ko:""},RC_requestCamera:{"en-US":"",de:"",fr:"",es:"",pt:"",it:"",ro:"",pl:"",ru:"",hy:"",fi:"",ka:"",he:"",ar:"",ur:"",hi:"",ta:"",ml:"",te:"",kn:"",bn:"",id:"","zh-CN":"","zh-HK":"",ja:"",ko:""},RC_screenSize:{"en-US":"",de:"",fr:"",es:"",pt:"",it:"",ro:"",pl:"",ru:"",hy:"",fi:"",ka:"",he:"",ar:"",ur:"",hi:"",ta:"",ml:"",te:"",kn:"",bn:"",id:"","zh-CN":"","zh-HK":"",ja:"",ko:""},RC_screenSizeCredit:{"en-US":"",de:"",fr:"",es:"",pt:"",it:"",ro:"",pl:"",ru:"",hy:"",fi:"",ka:"",he:"",ar:"",ur:"",hi:"",ta:"",ml:"",te:"",kn:"",bn:"",id:"","zh-CN":"","zh-HK":"",ja:"",ko:""},RC_screenSizeCreditCard:{"en-US":"",de:"",fr:"",es:"",pt:"",it:"",ro:"",pl:"",ru:"",hy:"",fi:"",ka:"",he:"",ar:"",ur:"",hi:"",ta:"",ml:"",te:"",kn:"",bn:"",id:"","zh-CN":"","zh-HK":"",ja:"",ko:""},RC_screenSizeHave:{"en-US":"",de:"",fr:"",es:"",pt:"",it:"",ro:"",pl:"",ru:"",hy:"",fi:"",ka:"",he:"",ar:"",ur:"",hi:"",ta:"",ml:"",te:"",kn:"",bn:"",id:"","zh-CN":"","zh-HK":"",ja:"",ko:""},RC_screenSizeIntro:{"en-US":"",de:"",fr:"",es:"",pt:"",it:"",ro:"",pl:"",ru:"",hy:"",fi:"",ka:"",he:"",ar:"",ur:"",hi:"",ta:"",ml:"",te:"",kn:"",bn:"",id:"","zh-CN":"","zh-HK":"",ja:"",ko:""},RC_screenSizeTitle:{"en-US":"",de:"",fr:"",es:"",pt:"",it:"",ro:"",pl:"",ru:"",hy:"",fi:"",ka:"",he:"",ar:"",ur:"",hi:"",ta:"",ml:"",te:"",kn:"",bn:"",id:"","zh-CN":"","zh-HK":"",ja:"",ko:""},RC_screenSizeUSBA:{"en-US":"",de:"",fr:"",es:"",pt:"",it:"",ro:"",pl:"",ru:"",hy:"",fi:"",ka:"",he:"",ar:"",ur:"",hi:"",ta:"",ml:"",te:"",kn:"",bn:"",id:"","zh-CN":"","zh-HK":"",ja:"",ko:""},RC_screenSizeUSBC:{"en-US":"",de:"",fr:"",es:"",pt:"",it:"",ro:"",pl:"",ru:"",hy:"",fi:"",ka:"",he:"",ar:"",ur:"",hi:"",ta:"",ml:"",te:"",kn:"",bn:"",id:"","zh-CN":"","zh-HK":"",ja:"",ko:""},RC_starting:{"en-US":"",de:"",fr:"",es:"",pt:"",it:"",ro:"",pl:"",ru:"",hy:"",fi:"",ka:"",he:"",ar:"",ur:"",hi:"",ta:"",ml:"",te:"",kn:"",bn:"",id:"","zh-CN":"","zh-HK":"",ja:"",ko:""},RC_viewingBlindSpotCredit:{"en-US":"",de:"",fr:"",es:"",pt:"",it:"",ro:"",pl:"",ru:"",hy:"",fi:"",ka:"",he:"",ar:"",ur:"",hi:"",ta:"",ml:"",te:"",kn:"",bn:"",id:"","zh-CN":"","zh-HK":"",ja:"",ko:""},RC_viewingBlindSpotRejected:{"en-US":"",de:"",fr:"",es:"",pt:"",it:"",ro:"",pl:"",ru:"",hy:"",fi:"",ka:"",he:"",ar:"",ur:"",hi:"",ta:"",ml:"",te:"",kn:"",bn:"",id:"","zh-CN":"","zh-HK":"",ja:"",ko:""},RC_viewingDistance:{"en-US":"",de:"",fr:"",es:"",pt:"",it:"",ro:"",pl:"",ru:"",hy:"",fi:"",ka:"",he:"",ar:"",ur:"",hi:"",ta:"",ml:"",te:"",kn:"",bn:"",id:"","zh-CN":"","zh-HK":"",ja:"",ko:""},RC_viewingDistanceIntro:{"en-US":"",de:"",fr:"",es:"",pt:"",it:"",ro:"",pl:"",ru:"",hy:"",fi:"",ka:"",he:"",ar:"",ur:"",hi:"",ta:"",ml:"",te:"",kn:"",bn:"",id:"","zh-CN":"","zh-HK":"",ja:"",ko:""},RC_viewingDistanceIntroTitle:{"en-US":"",de:"",fr:"",es:"",pt:"",it:"",ro:"",pl:"",ru:"",hy:"",fi:"",ka:"",he:"",ar:"",ur:"",hi:"",ta:"",ml:"",te:"",kn:"",bn:"",id:"","zh-CN":"","zh-HK":"",ja:"",ko:""},RC_viewingDistanceIntroLiMethod:{"en-US":"",de:"",fr:"",es:"",pt:"",it:"",ro:"",pl:"",ru:"",hy:"",fi:"",ka:"",he:"",ar:"",ur:"",hi:"",ta:"",ml:"",te:"",kn:"",bn:"",id:"","zh-CN":"","zh-HK":"",ja:"",ko:""},RC_viewingDistanceRedo:{"en-US":"",de:"",fr:"",es:"",pt:"",it:"",ro:"",pl:"",ru:"",hy:"",fi:"",ka:"",he:"",ar:"",ur:"",hi:"",ta:"",ml:"",te:"",kn:"",bn:"",id:"","zh-CN":"","zh-HK":"",ja:"",ko:""},RC_viewingDistanceTitle:{"en-US":"",de:"",fr:"",es:"",pt:"",it:"",ro:"",pl:"",ru:"",hy:"",fi:"",ka:"",he:"",ar:"",ur:"",hi:"",ta:"",ml:"",te:"",kn:"",bn:"",id:"","zh-CN":"","zh-HK":"",ja:"",ko:""}}},7790:(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{"use strict";__webpack_require__.d(__webpack_exports__,{K:()=>_setDebugControl});var _components_utils__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__(9043);const _setDebugControl=(e,t,n,s)=>{const r=document.createElement("div");r.className="rc-panel-debug-control",r.innerHTML='

      DEBUG CONTROL

      REMEMBER TO SET debug TO false FOR PRODUCTION MODE!

      ',t.appendChild(r);const a=[];for(let t of n){let n=t.name?t.name:t;const s=document.createElement("div");s.className="rc-panel-debug-control-task-row",s.id="rc-debugger-row-"+n;let i=e._debuggerDefault[n];if(i){r.innerHTML+=`

      ${n}

      `;const e={n:"number",s:"string"};switch(n){case"screenSize":for(let t in i.value)s.innerHTML+=_createValueElement(n,t,i.value[t],".value."+t,e.n);break;case"measureDistance":s.innerHTML+=_createValueElement(n,"value",i.value,".value",e.n),s.innerHTML+=_createValueElement(n,"method",i.method,".method",e.s,!0);break;case"trackDistance":s.innerHTML+=_createValueElement(n,"viewingDistanceCm",i.value.viewingDistanceCm,".value",e.n),s.innerHTML+=_createValueElement(n,"PDCm",i.value.PDCm,".value",e.n),s.innerHTML+=_createValueElement(n,"nearPointCm.x",i.value.nearPointCm.x,".value.x",e.n),s.innerHTML+=_createValueElement(n,"nearPointCm.y",i.value.nearPointCm.y,".value.y",e.n),s.innerHTML+=_createValueElement(n,"latencyMs",i.value.latencyMs,".latencyMs",e.n),s.innerHTML+=_createValueElement(n,"method",i.method,".method",e.s,!0);break;case"trackGaze":s.innerHTML+=_createValueElement(n,"x",i.value.x,".value.x",e.n),s.innerHTML+=_createValueElement(n,"y",i.value.y,".value.y",e.n),s.innerHTML+=_createValueElement(n,"latencyMs",i.value.latencyMs,".value.latencyMs",e.n);break;case"performance":s.innerHTML+=_createValueElement(n,"computeArrayFillMHz",i.value.computeArrayFillMHz,".value.computeArrayFillMHz",e.n),s.innerHTML+=_createValueElement(n,"computeRandomMHz",i.value.computeRandomMHz,".value.computeRandomMHz",e.n),s.innerHTML+=_createValueElement(n,"idealFps",i.value.idealFps,".value.idealFps",e.n),s.innerHTML+=_createValueElement(n,"stressFps",i.value.stressFps,".value.stressFps",e.n)}r.appendChild(s),a.push(n)}}const i=document.createElement("button");i.className="rc-panel-debug-control-next",i.innerHTML="Simulate calibration and continue",i.onclick=()=>{_wrapValues(e,a),(0,_components_utils__WEBPACK_IMPORTED_MODULE_0__.nB)(s,{timestamp:performance.now()}),e._panelStatus.panelFinished=!0},r.appendChild(i)},_createValueElement=(e,t,n,s,r,a=!1)=>`
      \n \n

      ${t}

      \n
      `,_wrapValues=(e,t)=>{for(let n of t){const t=document.querySelector("#rc-debugger-row-"+n),s={};switch(n){case"screenSize":s.value={},_putData(e,s,t),e.newScreenData=(0,_components_utils__WEBPACK_IMPORTED_MODULE_0__.ln)(s);break;case"measureDistance":_putData(e,s,t),e.newViewingDistanceData=(0,_components_utils__WEBPACK_IMPORTED_MODULE_0__.ln)(s);break;case"trackDistance":e.newViewingDistanceData={value:_get(t,"#trackDistance-viewingDistanceCm"),latencyMs:_get(t,"#trackDistance-latencyMs"),method:_get(t,"#trackDistance-method","string"),timestamp:e._debuggerDefault.timestamp},e.newNearPointData={value:{x:_get(t,"#trackDistance-nearPointCm-x"),y:_get(t,"#trackDistance-nearPointCm-y")},timestamp:e._debuggerDefault.timestamp},e.newPDData={value:_get(t,"#trackDistance-PDCm"),timestamp:e._debuggerDefault.timestamp};break;case"trackGaze":s.value={},_putData(e,s,t),e.newGazePositionData=(0,_components_utils__WEBPACK_IMPORTED_MODULE_0__.ln)(s);break;case"performance":s.value={},_putData(e,s,t),e.newPerformanceData=(0,_components_utils__WEBPACK_IMPORTED_MODULE_0__.ln)(s)}}},_get=(e,t)=>{const n=e.querySelector(t);return"number"===n.dataset.type?Number(n.value):n.value},_putData=(RC,newData,taskRow)=>{for(let ele of taskRow.childNodes){const eleInput=ele.querySelector("input");try{eval(`newData${eleInput.dataset.source} = eleInput.dataset.type === 'number' ? Number(eleInput.value) : eleInput.value`)}catch(e){}newData.timestamp=RC._debuggerDefault.timestamp}return newData}},2921:(e,t,n)=>{"use strict";n.d(t,{A:()=>o});var s=n(1354),r=n.n(s),a=n(6314),i=n.n(a)()(r());i.push([e.id,".animated{-webkit-animation-duration:var(--animate-duration);animation-duration:var(--animate-duration);-webkit-animation-fill-mode:both;animation-fill-mode:both}.animated.infinite{-webkit-animation-iteration-count:infinite;animation-iteration-count:infinite}.animated.repeat-1{-webkit-animation-iteration-count:var(--animate-repeat);animation-iteration-count:var(--animate-repeat)}.animated.repeat-2{-webkit-animation-iteration-count:calc(var(--animate-repeat)*2);animation-iteration-count:calc(var(--animate-repeat)*2)}.animated.repeat-3{-webkit-animation-iteration-count:calc(var(--animate-repeat)*3);animation-iteration-count:calc(var(--animate-repeat)*3)}.animated.delay-1s{-webkit-animation-delay:var(--animate-delay);animation-delay:var(--animate-delay)}.animated.delay-2s{-webkit-animation-delay:calc(var(--animate-delay)*2);animation-delay:calc(var(--animate-delay)*2)}.animated.delay-3s{-webkit-animation-delay:calc(var(--animate-delay)*3);animation-delay:calc(var(--animate-delay)*3)}.animated.delay-4s{-webkit-animation-delay:calc(var(--animate-delay)*4);animation-delay:calc(var(--animate-delay)*4)}.animated.delay-5s{-webkit-animation-delay:calc(var(--animate-delay)*5);animation-delay:calc(var(--animate-delay)*5)}.animated.faster{-webkit-animation-duration:calc(var(--animate-duration)/2);animation-duration:calc(var(--animate-duration)/2)}.animated.fast{-webkit-animation-duration:calc(var(--animate-duration)*.8);animation-duration:calc(var(--animate-duration)*.8)}.animated.slow{-webkit-animation-duration:calc(var(--animate-duration)*2);animation-duration:calc(var(--animate-duration)*2)}.animated.slower{-webkit-animation-duration:calc(var(--animate-duration)*3);animation-duration:calc(var(--animate-duration)*3)}@media (prefers-reduced-motion:reduce),print{.animated{-webkit-animation-duration:1ms!important;animation-duration:1ms!important;-webkit-animation-iteration-count:1!important;animation-iteration-count:1!important;-webkit-transition-duration:1ms!important;transition-duration:1ms!important}.animated[class*=Out]{opacity:0}}","",{version:3,sources:["webpack://./node_modules/animate.css/source/_base.css"],names:[],mappings:"AAAA,UACE,kDAA2C,CAA3C,0CAA2C,CAC3C,gCAAyB,CAAzB,wBACF,CAEA,mBACE,0CAAmC,CAAnC,kCACF,CAEA,mBACE,uDAAgD,CAAhD,+CACF,CAEA,mBACE,+DAA0D,CAA1D,uDACF,CAEA,mBACE,+DAA0D,CAA1D,uDACF,CAEA,mBACE,4CAAqC,CAArC,oCACF,CAEA,mBACE,oDAA+C,CAA/C,4CACF,CAEA,mBACE,oDAA+C,CAA/C,4CACF,CAEA,mBACE,oDAA+C,CAA/C,4CACF,CAEA,mBACE,oDAA+C,CAA/C,4CACF,CAEA,iBACE,0DAAqD,CAArD,kDACF,CAEA,eACE,2DAAuD,CAAvD,mDACF,CAEA,eACE,0DAAqD,CAArD,kDACF,CAEA,iBACE,0DAAqD,CAArD,kDACF,CAEA,6CACE,UACE,wCAAkC,CAAlC,gCAAkC,CAElC,6CAAuC,CAAvC,qCAAuC,CADvC,yCAAmC,CAAnC,iCAEF,CAEA,sBACE,SACF,CACF",sourcesContent:[".animated {\n animation-duration: var(--animate-duration);\n animation-fill-mode: both;\n}\n\n.animated.infinite {\n animation-iteration-count: infinite;\n}\n\n.animated.repeat-1 {\n animation-iteration-count: var(--animate-repeat);\n}\n\n.animated.repeat-2 {\n animation-iteration-count: calc(var(--animate-repeat) * 2);\n}\n\n.animated.repeat-3 {\n animation-iteration-count: calc(var(--animate-repeat) * 3);\n}\n\n.animated.delay-1s {\n animation-delay: var(--animate-delay);\n}\n\n.animated.delay-2s {\n animation-delay: calc(var(--animate-delay) * 2);\n}\n\n.animated.delay-3s {\n animation-delay: calc(var(--animate-delay) * 3);\n}\n\n.animated.delay-4s {\n animation-delay: calc(var(--animate-delay) * 4);\n}\n\n.animated.delay-5s {\n animation-delay: calc(var(--animate-delay) * 5);\n}\n\n.animated.faster {\n animation-duration: calc(var(--animate-duration) / 2);\n}\n\n.animated.fast {\n animation-duration: calc(var(--animate-duration) * 0.8);\n}\n\n.animated.slow {\n animation-duration: calc(var(--animate-duration) * 2);\n}\n\n.animated.slower {\n animation-duration: calc(var(--animate-duration) * 3);\n}\n\n@media print, (prefers-reduced-motion: reduce) {\n .animated {\n animation-duration: 1ms !important;\n transition-duration: 1ms !important;\n animation-iteration-count: 1 !important;\n }\n\n .animated[class*='Out'] {\n opacity: 0;\n }\n}\n"],sourceRoot:""}]);const o=i},2636:(e,t,n)=>{"use strict";n.d(t,{A:()=>o});var s=n(1354),r=n.n(s),a=n(6314),i=n.n(a)()(r());i.push([e.id,":root{--animate-duration:1s;--animate-delay:1s;--animate-repeat:1}","",{version:3,sources:["webpack://./node_modules/animate.css/source/_vars.css"],names:[],mappings:"AAAA,MACE,qBAAsB,CACtB,kBAAmB,CACnB,kBACF",sourcesContent:[":root {\n --animate-duration: 1s;\n --animate-delay: 1s;\n --animate-repeat: 1;\n}\n"],sourceRoot:""}]);const o=i},7271:(e,t,n)=>{"use strict";n.d(t,{A:()=>o});var s=n(1354),r=n.n(s),a=n(6314),i=n.n(a)()(r());i.push([e.id,"@-webkit-keyframes fadeInUp{0%{opacity:0;-webkit-transform:translate3d(0,100%,0);transform:translate3d(0,100%,0)}to{opacity:1;-webkit-transform:translateZ(0);transform:translateZ(0)}}@keyframes fadeInUp{0%{opacity:0;-webkit-transform:translate3d(0,100%,0);transform:translate3d(0,100%,0)}to{opacity:1;-webkit-transform:translateZ(0);transform:translateZ(0)}}.fadeInUp{-webkit-animation-name:fadeInUp;animation-name:fadeInUp}","",{version:3,sources:["webpack://./node_modules/animate.css/source/fading_entrances/fadeInUp.css"],names:[],mappings:"AAAA,4BACE,GACE,SAAU,CACV,uCAAkC,CAAlC,+BACF,CAEA,GACE,SAAU,CACV,+BAA+B,CAA/B,uBACF,CACF,CAVA,oBACE,GACE,SAAU,CACV,uCAAkC,CAAlC,+BACF,CAEA,GACE,SAAU,CACV,+BAA+B,CAA/B,uBACF,CACF,CAEA,UACE,+BAAwB,CAAxB,uBACF",sourcesContent:["@keyframes fadeInUp {\n from {\n opacity: 0;\n transform: translate3d(0, 100%, 0);\n }\n\n to {\n opacity: 1;\n transform: translate3d(0, 0, 0);\n }\n}\n\n.fadeInUp {\n animation-name: fadeInUp;\n}\n"],sourceRoot:""}]);const o=i},2551:(e,t,n)=>{"use strict";n.d(t,{A:()=>o});var s=n(1354),r=n.n(s),a=n(6314),i=n.n(a)()(r());i.push([e.id,"@-webkit-keyframes fadeOutDown{0%{opacity:1}to{opacity:0;-webkit-transform:translate3d(0,100%,0);transform:translate3d(0,100%,0)}}@keyframes fadeOutDown{0%{opacity:1}to{opacity:0;-webkit-transform:translate3d(0,100%,0);transform:translate3d(0,100%,0)}}.fadeOutDown{-webkit-animation-name:fadeOutDown;animation-name:fadeOutDown}","",{version:3,sources:["webpack://./node_modules/animate.css/source/fading_exits/fadeOutDown.css"],names:[],mappings:"AAAA,+BACE,GACE,SACF,CAEA,GACE,SAAU,CACV,uCAAkC,CAAlC,+BACF,CACF,CATA,uBACE,GACE,SACF,CAEA,GACE,SAAU,CACV,uCAAkC,CAAlC,+BACF,CACF,CAEA,aACE,kCAA2B,CAA3B,0BACF",sourcesContent:["@keyframes fadeOutDown {\n from {\n opacity: 1;\n }\n\n to {\n opacity: 0;\n transform: translate3d(0, 100%, 0);\n }\n}\n\n.fadeOutDown {\n animation-name: fadeOutDown;\n}\n"],sourceRoot:""}]);const o=i},8470:(e,t,n)=>{"use strict";n.d(t,{A:()=>o});var s=n(1354),r=n.n(s),a=n(6314),i=n.n(a)()(r());i.push([e.id,'.swal2-popup.swal2-toast{background:#fff;box-shadow:0 0 1px rgba(0,0,0,.075),0 1px 2px rgba(0,0,0,.075),1px 2px 4px rgba(0,0,0,.075),1px 3px 8px rgba(0,0,0,.075),2px 4px 16px rgba(0,0,0,.075);box-sizing:border-box;grid-column:1/4!important;grid-row:1/4!important;grid-template-columns:min-content auto min-content;overflow-y:hidden;padding:1em;pointer-events:all}.swal2-popup.swal2-toast>*{grid-column:2}.swal2-popup.swal2-toast .swal2-title{font-size:1em;margin:.5em 1em;padding:0;text-align:initial}.swal2-popup.swal2-toast .swal2-loading{justify-content:center}.swal2-popup.swal2-toast .swal2-input{font-size:1em;height:2em;margin:.5em}.swal2-popup.swal2-toast .swal2-validation-message{font-size:1em}.swal2-popup.swal2-toast .swal2-footer{font-size:.8em;margin:.5em 0 0;padding:.5em 0 0}.swal2-popup.swal2-toast .swal2-close{align-self:center;font-size:2em;grid-column:3/3;grid-row:1/99;height:.8em;margin:0;width:.8em}.swal2-popup.swal2-toast .swal2-html-container{font-size:1em;margin:.5em 1em;overflow:initial;padding:0;text-align:initial}.swal2-popup.swal2-toast .swal2-html-container:empty{padding:0}.swal2-popup.swal2-toast .swal2-loader{align-self:center;grid-column:1;grid-row:1/99;height:2em;margin:.25em;width:2em}.swal2-popup.swal2-toast .swal2-icon{align-self:center;grid-column:1;grid-row:1/99;height:2em;margin:0 .5em 0 0;min-width:2em;width:2em}.swal2-popup.swal2-toast .swal2-icon .swal2-icon-content{align-items:center;display:flex;font-size:1.8em;font-weight:700}.swal2-popup.swal2-toast .swal2-icon.swal2-success .swal2-success-ring{height:2em;width:2em}.swal2-popup.swal2-toast .swal2-icon.swal2-error [class^=swal2-x-mark-line]{top:.875em;width:1.375em}.swal2-popup.swal2-toast .swal2-icon.swal2-error [class^=swal2-x-mark-line][class$=left]{left:.3125em}.swal2-popup.swal2-toast .swal2-icon.swal2-error [class^=swal2-x-mark-line][class$=right]{right:.3125em}.swal2-popup.swal2-toast .swal2-actions{height:auto;justify-content:flex-start;margin:.5em 0 0;padding:0 .5em}.swal2-popup.swal2-toast .swal2-styled{font-size:1em;margin:.25em .5em;padding:.4em .6em}.swal2-popup.swal2-toast .swal2-success{border-color:#a5dc86}.swal2-popup.swal2-toast .swal2-success [class^=swal2-success-circular-line]{border-radius:50%;height:3em;position:absolute;width:1.6em}.swal2-popup.swal2-toast .swal2-success [class^=swal2-success-circular-line][class$=left]{border-radius:4em 0 0 4em;left:-.5em;top:-.8em;transform:rotate(-45deg);transform-origin:2em 2em}.swal2-popup.swal2-toast .swal2-success [class^=swal2-success-circular-line][class$=right]{border-radius:0 4em 4em 0;left:.9375em;top:-.25em;transform-origin:0 1.5em}.swal2-popup.swal2-toast .swal2-success .swal2-success-ring{height:2em;width:2em}.swal2-popup.swal2-toast .swal2-success .swal2-success-fix{height:2.6875em;left:.4375em;top:0;width:.4375em}.swal2-popup.swal2-toast .swal2-success [class^=swal2-success-line]{height:.3125em}.swal2-popup.swal2-toast .swal2-success [class^=swal2-success-line][class$=tip]{left:.1875em;top:1.125em;width:.75em}.swal2-popup.swal2-toast .swal2-success [class^=swal2-success-line][class$=long]{right:.1875em;top:.9375em;width:1.375em}.swal2-popup.swal2-toast .swal2-success.swal2-icon-show .swal2-success-line-tip{animation:swal2-toast-animate-success-line-tip .75s}.swal2-popup.swal2-toast .swal2-success.swal2-icon-show .swal2-success-line-long{animation:swal2-toast-animate-success-line-long .75s}.swal2-popup.swal2-toast.swal2-show{animation:swal2-toast-show .5s}.swal2-popup.swal2-toast.swal2-hide{animation:swal2-toast-hide .1s forwards}div:where(.swal2-container){box-sizing:border-box;display:grid;grid-template-areas:"top-start top top-end" "center-start center center-end" "bottom-start bottom-center bottom-end";grid-template-rows:minmax(min-content,auto) minmax(min-content,auto) minmax(min-content,auto);height:100%;inset:0;overflow-x:hidden;padding:.625em;position:fixed;transition:background-color .1s;z-index:1060;-webkit-overflow-scrolling:touch}div:where(.swal2-container).swal2-backdrop-show,div:where(.swal2-container).swal2-noanimation{background:rgba(0,0,0,.4)}div:where(.swal2-container).swal2-backdrop-hide{background:transparent!important}div:where(.swal2-container).swal2-bottom-start,div:where(.swal2-container).swal2-center-start,div:where(.swal2-container).swal2-top-start{grid-template-columns:minmax(0,1fr) auto auto}div:where(.swal2-container).swal2-bottom,div:where(.swal2-container).swal2-center,div:where(.swal2-container).swal2-top{grid-template-columns:auto minmax(0,1fr) auto}div:where(.swal2-container).swal2-bottom-end,div:where(.swal2-container).swal2-center-end,div:where(.swal2-container).swal2-top-end{grid-template-columns:auto auto minmax(0,1fr)}div:where(.swal2-container).swal2-top-start>.swal2-popup{align-self:start}div:where(.swal2-container).swal2-top>.swal2-popup{grid-column:2;place-self:start center}div:where(.swal2-container).swal2-top-end>.swal2-popup,div:where(.swal2-container).swal2-top-right>.swal2-popup{grid-column:3;place-self:start end}div:where(.swal2-container).swal2-center-left>.swal2-popup,div:where(.swal2-container).swal2-center-start>.swal2-popup{align-self:center;grid-row:2}div:where(.swal2-container).swal2-center>.swal2-popup{grid-column:2;grid-row:2;place-self:center center}div:where(.swal2-container).swal2-center-end>.swal2-popup,div:where(.swal2-container).swal2-center-right>.swal2-popup{grid-column:3;grid-row:2;place-self:center end}div:where(.swal2-container).swal2-bottom-left>.swal2-popup,div:where(.swal2-container).swal2-bottom-start>.swal2-popup{align-self:end;grid-column:1;grid-row:3}div:where(.swal2-container).swal2-bottom>.swal2-popup{grid-column:2;grid-row:3;place-self:end center}div:where(.swal2-container).swal2-bottom-end>.swal2-popup,div:where(.swal2-container).swal2-bottom-right>.swal2-popup{grid-column:3;grid-row:3;place-self:end end}div:where(.swal2-container).swal2-grow-fullscreen>.swal2-popup,div:where(.swal2-container).swal2-grow-row>.swal2-popup{grid-column:1/4;width:100%}div:where(.swal2-container).swal2-grow-column>.swal2-popup,div:where(.swal2-container).swal2-grow-fullscreen>.swal2-popup{align-self:stretch;grid-row:1/4}div:where(.swal2-container).swal2-no-transition{transition:none!important}div:where(.swal2-container) div:where(.swal2-popup){background:#fff;border:none;border-radius:5px;box-sizing:border-box;color:#545454;display:none;font-family:inherit;font-size:1rem;grid-template-columns:minmax(0,100%);max-width:100%;padding:0 0 1.25em;position:relative;width:32em}div:where(.swal2-container) div:where(.swal2-popup):focus{outline:none}div:where(.swal2-container) div:where(.swal2-popup).swal2-loading{overflow-y:hidden}div:where(.swal2-container) h2:where(.swal2-title){color:inherit;font-size:1.875em;font-weight:600;margin:0;max-width:100%;padding:.8em 1em 0;position:relative;text-align:center;text-transform:none;word-wrap:break-word}div:where(.swal2-container) div:where(.swal2-actions){align-items:center;box-sizing:border-box;display:flex;flex-wrap:wrap;justify-content:center;margin:1.25em auto 0;padding:0;width:auto;z-index:1}div:where(.swal2-container) div:where(.swal2-actions):not(.swal2-loading) .swal2-styled[disabled]{opacity:.4}div:where(.swal2-container) div:where(.swal2-actions):not(.swal2-loading) .swal2-styled:hover{background-image:linear-gradient(rgba(0,0,0,.1),rgba(0,0,0,.1))}div:where(.swal2-container) div:where(.swal2-actions):not(.swal2-loading) .swal2-styled:active{background-image:linear-gradient(rgba(0,0,0,.2),rgba(0,0,0,.2))}div:where(.swal2-container) div:where(.swal2-loader){align-items:center;animation:swal2-rotate-loading 1.5s linear 0s infinite normal;border-color:#2778c4 transparent;border-radius:100%;border-style:solid;border-width:.25em;display:none;height:2.2em;justify-content:center;margin:0 1.875em;width:2.2em}div:where(.swal2-container) button:where(.swal2-styled){box-shadow:0 0 0 3px transparent;font-weight:500;margin:.3125em;padding:.625em 1.1em;transition:box-shadow .1s}div:where(.swal2-container) button:where(.swal2-styled):not([disabled]){cursor:pointer}div:where(.swal2-container) button:where(.swal2-styled).swal2-confirm{background:initial;background-color:#7066e0;border:0;border-radius:.25em;color:#fff;font-size:1em}div:where(.swal2-container) button:where(.swal2-styled).swal2-confirm:focus{box-shadow:0 0 0 3px rgba(112,102,224,.5)}div:where(.swal2-container) button:where(.swal2-styled).swal2-deny{background:initial;background-color:#dc3741;border:0;border-radius:.25em;color:#fff;font-size:1em}div:where(.swal2-container) button:where(.swal2-styled).swal2-deny:focus{box-shadow:0 0 0 3px rgba(220,55,65,.5)}div:where(.swal2-container) button:where(.swal2-styled).swal2-cancel{background:initial;background-color:#6e7881;border:0;border-radius:.25em;color:#fff;font-size:1em}div:where(.swal2-container) button:where(.swal2-styled).swal2-cancel:focus{box-shadow:0 0 0 3px hsla(208,8%,47%,.5)}div:where(.swal2-container) button:where(.swal2-styled).swal2-default-outline:focus{box-shadow:0 0 0 3px rgba(100,150,200,.5)}div:where(.swal2-container) button:where(.swal2-styled):focus{outline:none}div:where(.swal2-container) button:where(.swal2-styled)::-moz-focus-inner{border:0}div:where(.swal2-container) div:where(.swal2-footer){border-top:1px solid #eee;color:inherit;font-size:1em;margin:1em 0 0;padding:1em 1em 0;text-align:center}div:where(.swal2-container) .swal2-timer-progress-bar-container{border-bottom-left-radius:5px;border-bottom-right-radius:5px;bottom:0;grid-column:auto!important;left:0;overflow:hidden;position:absolute;right:0}div:where(.swal2-container) div:where(.swal2-timer-progress-bar){background:rgba(0,0,0,.2);height:.25em;width:100%}div:where(.swal2-container) img:where(.swal2-image){margin:2em auto 1em;max-width:100%}div:where(.swal2-container) button:where(.swal2-close){align-items:center;background:transparent;border:none;border-radius:5px;color:#ccc;cursor:pointer;font-family:monospace;font-size:2.5em;height:1.2em;justify-content:center;justify-self:end;margin-bottom:-1.2em;margin-right:0;margin-top:0;overflow:hidden;padding:0;transition:color .1s,box-shadow .1s;width:1.2em;z-index:2}div:where(.swal2-container) button:where(.swal2-close):hover{background:transparent;color:#f27474;transform:none}div:where(.swal2-container) button:where(.swal2-close):focus{box-shadow:inset 0 0 0 3px rgba(100,150,200,.5);outline:none}div:where(.swal2-container) button:where(.swal2-close)::-moz-focus-inner{border:0}div:where(.swal2-container) .swal2-html-container{color:inherit;font-size:1.125em;font-weight:400;justify-content:center;line-height:normal;margin:1em 1.6em .3em;overflow:auto;padding:0;text-align:center;z-index:1;word-wrap:break-word;word-break:break-word}div:where(.swal2-container) div:where(.swal2-radio),div:where(.swal2-container) input:where(.swal2-file),div:where(.swal2-container) input:where(.swal2-input),div:where(.swal2-container) label:where(.swal2-checkbox),div:where(.swal2-container) select:where(.swal2-select),div:where(.swal2-container) textarea:where(.swal2-textarea){margin:1em 2em 3px}div:where(.swal2-container) input:where(.swal2-file),div:where(.swal2-container) input:where(.swal2-input),div:where(.swal2-container) textarea:where(.swal2-textarea){background:transparent;border:1px solid #d9d9d9;border-radius:.1875em;box-shadow:inset 0 1px 1px rgba(0,0,0,.06),0 0 0 3px transparent;box-sizing:border-box;color:inherit;font-size:1.125em;transition:border-color .1s,box-shadow .1s;width:auto}div:where(.swal2-container) input:where(.swal2-file).swal2-inputerror,div:where(.swal2-container) input:where(.swal2-input).swal2-inputerror,div:where(.swal2-container) textarea:where(.swal2-textarea).swal2-inputerror{border-color:#f27474!important;box-shadow:0 0 2px #f27474!important}div:where(.swal2-container) input:where(.swal2-file):focus,div:where(.swal2-container) input:where(.swal2-input):focus,div:where(.swal2-container) textarea:where(.swal2-textarea):focus{border:1px solid #b4dbed;box-shadow:inset 0 1px 1px rgba(0,0,0,.06),0 0 0 3px rgba(100,150,200,.5);outline:none}div:where(.swal2-container) input:where(.swal2-file)::-moz-placeholder,div:where(.swal2-container) input:where(.swal2-input)::-moz-placeholder,div:where(.swal2-container) textarea:where(.swal2-textarea)::-moz-placeholder{color:#ccc}div:where(.swal2-container) input:where(.swal2-file)::placeholder,div:where(.swal2-container) input:where(.swal2-input)::placeholder,div:where(.swal2-container) textarea:where(.swal2-textarea)::placeholder{color:#ccc}div:where(.swal2-container) .swal2-range{background:#fff;margin:1em 2em 3px}div:where(.swal2-container) .swal2-range input{width:80%}div:where(.swal2-container) .swal2-range output{color:inherit;font-weight:600;text-align:center;width:20%}div:where(.swal2-container) .swal2-range input,div:where(.swal2-container) .swal2-range output{font-size:1.125em;height:2.625em;line-height:2.625em;padding:0}div:where(.swal2-container) .swal2-input{height:2.625em;padding:0 .75em}div:where(.swal2-container) .swal2-file{background:transparent;font-size:1.125em;margin-left:auto;margin-right:auto;width:75%}div:where(.swal2-container) .swal2-textarea{height:6.75em;padding:.75em}div:where(.swal2-container) .swal2-select{background:transparent;color:inherit;font-size:1.125em;max-width:100%;min-width:50%;padding:.375em .625em}div:where(.swal2-container) .swal2-checkbox,div:where(.swal2-container) .swal2-radio{align-items:center;background:#fff;color:inherit;justify-content:center}div:where(.swal2-container) .swal2-checkbox label,div:where(.swal2-container) .swal2-radio label{font-size:1.125em;margin:0 .6em}div:where(.swal2-container) .swal2-checkbox input,div:where(.swal2-container) .swal2-radio input{flex-shrink:0;margin:0 .4em}div:where(.swal2-container) label:where(.swal2-input-label){display:flex;justify-content:center;margin:1em auto 0}div:where(.swal2-container) div:where(.swal2-validation-message){align-items:center;background:#f0f0f0;color:#666;font-size:1em;font-weight:300;justify-content:center;margin:1em 0 0;overflow:hidden;padding:.625em}div:where(.swal2-container) div:where(.swal2-validation-message):before{background-color:#f27474;border-radius:50%;color:#fff;content:"!";display:inline-block;font-weight:600;height:1.5em;line-height:1.5em;margin:0 .625em;min-width:1.5em;text-align:center;width:1.5em}div:where(.swal2-container) .swal2-progress-steps{align-items:center;background:transparent;flex-wrap:wrap;font-weight:600;margin:1.25em auto;max-width:100%;padding:0}div:where(.swal2-container) .swal2-progress-steps li{display:inline-block;position:relative}div:where(.swal2-container) .swal2-progress-steps .swal2-progress-step{background:#2778c4;border-radius:2em;color:#fff;flex-shrink:0;height:2em;line-height:2em;text-align:center;width:2em;z-index:20}div:where(.swal2-container) .swal2-progress-steps .swal2-progress-step.swal2-active-progress-step{background:#2778c4}div:where(.swal2-container) .swal2-progress-steps .swal2-progress-step.swal2-active-progress-step~.swal2-progress-step{background:#add8e6;color:#fff}div:where(.swal2-container) .swal2-progress-steps .swal2-progress-step.swal2-active-progress-step~.swal2-progress-step-line{background:#add8e6}div:where(.swal2-container) .swal2-progress-steps .swal2-progress-step-line{background:#2778c4;flex-shrink:0;height:.4em;margin:0 -1px;width:2.5em;z-index:10}div:where(.swal2-icon){border:.25em solid #000;border-radius:50%;box-sizing:content-box;cursor:default;font-family:inherit;height:5em;justify-content:center;line-height:5em;margin:2.5em auto .6em;position:relative;-webkit-user-select:none;-moz-user-select:none;user-select:none;width:5em}div:where(.swal2-icon) .swal2-icon-content{align-items:center;display:flex;font-size:3.75em}div:where(.swal2-icon).swal2-error{border-color:#f27474;color:#f27474}div:where(.swal2-icon).swal2-error .swal2-x-mark{flex-grow:1;position:relative}div:where(.swal2-icon).swal2-error [class^=swal2-x-mark-line]{background-color:#f27474;border-radius:.125em;display:block;height:.3125em;position:absolute;top:2.3125em;width:2.9375em}div:where(.swal2-icon).swal2-error [class^=swal2-x-mark-line][class$=left]{left:1.0625em;transform:rotate(45deg)}div:where(.swal2-icon).swal2-error [class^=swal2-x-mark-line][class$=right]{right:1em;transform:rotate(-45deg)}div:where(.swal2-icon).swal2-error.swal2-icon-show{animation:swal2-animate-error-icon .5s}div:where(.swal2-icon).swal2-error.swal2-icon-show .swal2-x-mark{animation:swal2-animate-error-x-mark .5s}div:where(.swal2-icon).swal2-warning{border-color:#facea8;color:#f8bb86}div:where(.swal2-icon).swal2-warning.swal2-icon-show{animation:swal2-animate-error-icon .5s}div:where(.swal2-icon).swal2-warning.swal2-icon-show .swal2-icon-content{animation:swal2-animate-i-mark .5s}div:where(.swal2-icon).swal2-info{border-color:#9de0f6;color:#3fc3ee}div:where(.swal2-icon).swal2-info.swal2-icon-show{animation:swal2-animate-error-icon .5s}div:where(.swal2-icon).swal2-info.swal2-icon-show .swal2-icon-content{animation:swal2-animate-i-mark .8s}div:where(.swal2-icon).swal2-question{border-color:#c9dae1;color:#87adbd}div:where(.swal2-icon).swal2-question.swal2-icon-show{animation:swal2-animate-error-icon .5s}div:where(.swal2-icon).swal2-question.swal2-icon-show .swal2-icon-content{animation:swal2-animate-question-mark .8s}div:where(.swal2-icon).swal2-success{border-color:#a5dc86;color:#a5dc86}div:where(.swal2-icon).swal2-success [class^=swal2-success-circular-line]{border-radius:50%;height:7.5em;position:absolute;width:3.75em}div:where(.swal2-icon).swal2-success [class^=swal2-success-circular-line][class$=left]{border-radius:7.5em 0 0 7.5em;left:-2.0635em;top:-.4375em;transform:rotate(-45deg);transform-origin:3.75em 3.75em}div:where(.swal2-icon).swal2-success [class^=swal2-success-circular-line][class$=right]{border-radius:0 7.5em 7.5em 0;left:1.875em;top:-.6875em;transform:rotate(-45deg);transform-origin:0 3.75em}div:where(.swal2-icon).swal2-success .swal2-success-ring{border:.25em solid hsla(98,55%,69%,.3);border-radius:50%;box-sizing:content-box;height:100%;left:-.25em;position:absolute;top:-.25em;width:100%;z-index:2}div:where(.swal2-icon).swal2-success .swal2-success-fix{height:5.625em;left:1.625em;position:absolute;top:.5em;transform:rotate(-45deg);width:.4375em;z-index:1}div:where(.swal2-icon).swal2-success [class^=swal2-success-line]{background-color:#a5dc86;border-radius:.125em;display:block;height:.3125em;position:absolute;z-index:2}div:where(.swal2-icon).swal2-success [class^=swal2-success-line][class$=tip]{left:.8125em;top:2.875em;transform:rotate(45deg);width:1.5625em}div:where(.swal2-icon).swal2-success [class^=swal2-success-line][class$=long]{right:.5em;top:2.375em;transform:rotate(-45deg);width:2.9375em}div:where(.swal2-icon).swal2-success.swal2-icon-show .swal2-success-line-tip{animation:swal2-animate-success-line-tip .75s}div:where(.swal2-icon).swal2-success.swal2-icon-show .swal2-success-line-long{animation:swal2-animate-success-line-long .75s}div:where(.swal2-icon).swal2-success.swal2-icon-show .swal2-success-circular-line-right{animation:swal2-rotate-success-circular-line 4.25s ease-in}[class^=swal2]{-webkit-tap-highlight-color:rgba(0,0,0,0)}.swal2-show{animation:swal2-show .3s}.swal2-hide{animation:swal2-hide .15s forwards}.swal2-noanimation{transition:none}.swal2-scrollbar-measure{height:50px;overflow:scroll;position:absolute;top:-9999px;width:50px}.swal2-rtl .swal2-close{margin-left:0;margin-right:0}.swal2-rtl .swal2-timer-progress-bar{left:auto;right:0}@keyframes swal2-toast-show{0%{transform:translateY(-.625em) rotate(2deg)}33%{transform:translateY(0) rotate(-2deg)}66%{transform:translateY(.3125em) rotate(2deg)}to{transform:translateY(0) rotate(0deg)}}@keyframes swal2-toast-hide{to{opacity:0;transform:rotate(1deg)}}@keyframes swal2-toast-animate-success-line-tip{0%{left:.0625em;top:.5625em;width:0}54%{left:.125em;top:.125em;width:0}70%{left:-.25em;top:.625em;width:1.625em}84%{left:.75em;top:1.0625em;width:.5em}to{left:.1875em;top:1.125em;width:.75em}}@keyframes swal2-toast-animate-success-line-long{0%{right:1.375em;top:1.625em;width:0}65%{right:.9375em;top:1.25em;width:0}84%{right:0;top:.9375em;width:1.125em}to{right:.1875em;top:.9375em;width:1.375em}}@keyframes swal2-show{0%{transform:scale(.7)}45%{transform:scale(1.05)}80%{transform:scale(.95)}to{transform:scale(1)}}@keyframes swal2-hide{0%{opacity:1;transform:scale(1)}to{opacity:0;transform:scale(.5)}}@keyframes swal2-animate-success-line-tip{0%{left:.0625em;top:1.1875em;width:0}54%{left:.125em;top:1.0625em;width:0}70%{left:-.375em;top:2.1875em;width:3.125em}84%{left:1.3125em;top:3em;width:1.0625em}to{left:.8125em;top:2.8125em;width:1.5625em}}@keyframes swal2-animate-success-line-long{0%{right:2.875em;top:3.375em;width:0}65%{right:2.875em;top:3.375em;width:0}84%{right:0;top:2.1875em;width:3.4375em}to{right:.5em;top:2.375em;width:2.9375em}}@keyframes swal2-rotate-success-circular-line{0%{transform:rotate(-45deg)}5%{transform:rotate(-45deg)}12%{transform:rotate(-405deg)}to{transform:rotate(-405deg)}}@keyframes swal2-animate-error-x-mark{0%{margin-top:1.625em;opacity:0;transform:scale(.4)}50%{margin-top:1.625em;opacity:0;transform:scale(.4)}80%{margin-top:-.375em;transform:scale(1.15)}to{margin-top:0;opacity:1;transform:scale(1)}}@keyframes swal2-animate-error-icon{0%{opacity:0;transform:rotateX(100deg)}to{opacity:1;transform:rotateX(0deg)}}@keyframes swal2-rotate-loading{0%{transform:rotate(0deg)}to{transform:rotate(1turn)}}@keyframes swal2-animate-question-mark{0%{transform:rotateY(-1turn)}to{transform:rotateY(0)}}@keyframes swal2-animate-i-mark{0%{opacity:0;transform:rotate(45deg)}25%{opacity:.4;transform:rotate(-25deg)}50%{opacity:.8;transform:rotate(15deg)}75%{opacity:1;transform:rotate(-5deg)}to{opacity:1;transform:rotateX(0)}}body.swal2-shown:not(.swal2-no-backdrop):not(.swal2-toast-shown){overflow:hidden}body.swal2-height-auto{height:auto!important}body.swal2-no-backdrop .swal2-container{background-color:transparent!important;pointer-events:none}body.swal2-no-backdrop .swal2-container .swal2-popup{pointer-events:all}body.swal2-no-backdrop .swal2-container .swal2-modal{box-shadow:0 0 10px rgba(0,0,0,.4)}@media print{body.swal2-shown:not(.swal2-no-backdrop):not(.swal2-toast-shown){overflow-y:scroll!important}body.swal2-shown:not(.swal2-no-backdrop):not(.swal2-toast-shown)>[aria-hidden=true]{display:none}body.swal2-shown:not(.swal2-no-backdrop):not(.swal2-toast-shown) .swal2-container{position:static!important}}body.swal2-toast-shown .swal2-container{background-color:transparent;box-sizing:border-box;max-width:100%;pointer-events:none;width:360px}body.swal2-toast-shown .swal2-container.swal2-top{inset:0 auto auto 50%;transform:translateX(-50%)}body.swal2-toast-shown .swal2-container.swal2-top-end,body.swal2-toast-shown .swal2-container.swal2-top-right{inset:0 0 auto auto}body.swal2-toast-shown .swal2-container.swal2-top-left,body.swal2-toast-shown .swal2-container.swal2-top-start{inset:0 auto auto 0}body.swal2-toast-shown .swal2-container.swal2-center-left,body.swal2-toast-shown .swal2-container.swal2-center-start{inset:50% auto auto 0;transform:translateY(-50%)}body.swal2-toast-shown .swal2-container.swal2-center{inset:50% auto auto 50%;transform:translate(-50%,-50%)}body.swal2-toast-shown .swal2-container.swal2-center-end,body.swal2-toast-shown .swal2-container.swal2-center-right{inset:50% 0 auto auto;transform:translateY(-50%)}body.swal2-toast-shown .swal2-container.swal2-bottom-left,body.swal2-toast-shown .swal2-container.swal2-bottom-start{inset:auto auto 0 0}body.swal2-toast-shown .swal2-container.swal2-bottom{inset:auto auto 0 50%;transform:translateX(-50%)}body.swal2-toast-shown .swal2-container.swal2-bottom-end,body.swal2-toast-shown .swal2-container.swal2-bottom-right{inset:auto 0 0 auto}',"",{version:3,sources:["webpack://./node_modules/sweetalert2/src/scss/_toasts.scss","webpack://./node_modules/sweetalert2/src/variables.scss","webpack://./node_modules/sweetalert2/src/scss/_core.scss","webpack://./node_modules/sweetalert2/src/scss/_icons.scss","webpack://./node_modules/sweetalert2/src/scss/_toasts-animations.scss","webpack://./node_modules/sweetalert2/src/scss/_animations.scss","webpack://./node_modules/sweetalert2/src/scss/_mixins.scss","webpack://./node_modules/sweetalert2/src/scss/_body.scss","webpack://./node_modules/sweetalert2/src/scss/_toasts-body.scss"],names:[],mappings:"AACE,yBAOE,eCRU,CDSV,sJCqOF,CD5OE,qBAAA,CACA,yBAAA,CACA,sBAAA,CACA,kDAAA,CAEA,iBAAA,CADA,WCmPkB,CD/OlB,kBAAA,CAEA,2BACE,aAAA,CAGF,sCAGE,aCyOwB,CD3OxB,eCyOqB,CDxOrB,SCyOsB,CDvOtB,kBAAA,CAGF,wCACE,sBAAA,CAGF,sCAGE,aCqOwB,CDvOxB,UCqOqB,CDpOrB,WCsOwB,CDlO1B,mDACE,aCkO6B,CD/N/B,uCAGE,cCgOyB,CDlOzB,eCgOsB,CD/NtB,gBCiOyB,CD7N3B,sCAGE,iBAAA,CAIA,aCqM+B,CD3M/B,eAAA,CACA,aAAA,CAGA,WCqM4B,CDpM5B,QCqM4B,CDvM5B,UCwM+B,CDlMjC,+CAIE,aCuMiC,CD1MjC,eCwM8B,CDtM9B,gBAAA,CADA,SCwM+B,CDrM/B,kBAAA,CAEA,qDACE,SAAA,CAIJ,uCAGE,iBAAA,CAFA,aAAA,CACA,aAAA,CAGA,UAAA,CACA,YAAA,CAFA,SAEA,CAGF,qCAGE,iBAAA,CAFA,aAAA,CACA,aAAA,CAIA,UAAA,CACA,iBAAA,CAFA,aAAA,CADA,SAGA,CAEA,yDA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A,CADA,uBACA,CAGF,IAEE,UAAA,CADA,wBACA,CAGF,IAEE,UAAA,CADA,uBACA,CAGF,IAEE,SAAA,CADA,uBACA,CAGF,GAEE,SAAA,CADA,oBACA,CAAA,CCtLF,iECPI,eAAA,CAIJ,uBACE,qBAAA,CAIA,wCACE,sCAAA,CACA,mBAAA,CAEA,qDACE,kBAAA,CAGF,qDACE,kCAAA,CAKN,aDhBA,iECmBM,2BAAA,CAEA,oFACE,YAAA,CAGF,kFACE,yBAAA,CAAA,CCpCN,wCAIE,4BAAA,CAHA,qBAAA,CAEA,cAAA,CAEA,mBAAA,CAHA,WAGA,CAEA,kDACE,qBAAA,CACA,0BAAA,CAGF,8GAEE,mBAAA,CAGF,+GAEE,mBAAA,CAGF,qHAEE,qBAAA,CACA,0BAAA,CAGF,qDACE,uBAAA,CACA,8BAAA,CAGF,oHAEE,qBAAA,CACA,0BAAA,CAGF,qHAEE,mBAAA,CAGF,qDACE,qBAAA,CACA,0BAAA,CAGF,oHAEE,mBAAA",sourcesContent:[".swal2-popup {\n &.swal2-toast {\n box-sizing: border-box;\n grid-column: 1/4 !important;\n grid-row: 1/4 !important;\n grid-template-columns: min-content auto min-content;\n padding: $swal2-toast-padding;\n overflow-y: hidden;\n background: $swal2-toast-background;\n box-shadow: $swal2-toast-box-shadow;\n pointer-events: all;\n\n > * {\n grid-column: 2;\n }\n\n .swal2-title {\n margin: $swal2-toast-title-margin;\n padding: $swal2-toast-title-padding;\n font-size: $swal2-toast-title-font-size;\n text-align: initial;\n }\n\n .swal2-loading {\n justify-content: center;\n }\n\n .swal2-input {\n height: $swal2-toast-input-height;\n margin: $swal2-toast-input-margin;\n font-size: $swal2-toast-input-font-size;\n }\n\n .swal2-validation-message {\n font-size: $swal2-toast-validation-font-size;\n }\n\n .swal2-footer {\n margin: $swal2-toast-footer-margin;\n padding: $swal2-toast-footer-margin;\n font-size: $swal2-toast-footer-font-size;\n }\n\n .swal2-close {\n grid-column: 3/3;\n grid-row: 1/99;\n align-self: center;\n width: $swal2-toast-close-button-width;\n height: $swal2-toast-close-button-height;\n margin: $swal2-toast-close-button-margin;\n font-size: $swal2-toast-close-button-font-size;\n }\n\n .swal2-html-container {\n margin: $swal2-toast-html-container-margin;\n padding: $swal2-toast-html-container-padding;\n overflow: initial;\n font-size: $swal2-toast-html-container-font-size;\n text-align: initial;\n\n &:empty {\n padding: 0;\n }\n }\n\n .swal2-loader {\n grid-column: 1;\n grid-row: 1/99;\n align-self: center;\n width: 2em;\n height: 2em;\n margin: 0.25em;\n }\n\n .swal2-icon {\n grid-column: 1;\n grid-row: 1/99;\n align-self: center;\n width: 2em;\n min-width: 2em;\n height: 2em;\n margin: 0 0.5em 0 0;\n\n .swal2-icon-content {\n display: flex;\n align-items: center;\n font-size: $swal2-toast-icon-font-size;\n font-weight: bold;\n }\n\n &.swal2-success {\n .swal2-success-ring {\n width: 2em;\n height: 2em;\n }\n }\n\n &.swal2-error {\n [class^='swal2-x-mark-line'] {\n top: 0.875em;\n width: 1.375em;\n\n &[class$='left'] {\n left: 0.3125em;\n }\n\n &[class$='right'] {\n right: 0.3125em;\n }\n }\n }\n }\n\n .swal2-actions {\n justify-content: flex-start;\n height: auto;\n margin: 0;\n margin-top: 0.5em;\n padding: 0 0.5em;\n }\n\n .swal2-styled {\n margin: 0.25em 0.5em;\n padding: 0.4em 0.6em;\n font-size: $swal2-toast-buttons-font-size;\n }\n\n .swal2-success {\n border-color: $swal2-success;\n\n [class^='swal2-success-circular-line'] {\n // Emulate moving circular line\n position: absolute;\n width: 1.6em;\n height: 3em;\n border-radius: 50%;\n\n &[class$='left'] {\n top: -0.8em;\n left: -0.5em;\n transform: rotate(-45deg);\n transform-origin: 2em 2em;\n border-radius: 4em 0 0 4em;\n }\n\n &[class$='right'] {\n top: -0.25em;\n left: 0.9375em;\n transform-origin: 0 1.5em;\n border-radius: 0 4em 4em 0;\n }\n }\n\n .swal2-success-ring {\n width: 2em;\n height: 2em;\n }\n\n .swal2-success-fix {\n top: 0;\n left: 0.4375em;\n width: 0.4375em;\n height: 2.6875em;\n }\n\n [class^='swal2-success-line'] {\n height: 0.3125em;\n\n &[class$='tip'] {\n top: 1.125em;\n left: 0.1875em;\n width: 0.75em;\n }\n\n &[class$='long'] {\n top: 0.9375em;\n right: 0.1875em;\n width: 1.375em;\n }\n }\n\n &.swal2-icon-show {\n @if $swal2-icon-animations {\n .swal2-success-line-tip {\n animation: swal2-toast-animate-success-line-tip 0.75s;\n }\n\n .swal2-success-line-long {\n animation: swal2-toast-animate-success-line-long 0.75s;\n }\n }\n }\n }\n\n &.swal2-show {\n animation: $swal2-toast-show-animation;\n }\n\n &.swal2-hide {\n animation: $swal2-toast-hide-animation;\n }\n }\n}\n","$swal2-white: #fff !default;\n$swal2-black: #000 !default;\n$swal2-outline-color: rgba(100, 150, 200, 0.5) !default;\n\n// CONTAINER\n$swal2-container-padding: 0.625em !default;\n\n// POPUP\n$swal2-width: 32em !default;\n$swal2-padding: 0 0 1.25em !default;\n$swal2-border: none !default;\n$swal2-color: lighten($swal2-black, 33) !default;\n$swal2-border-radius: 5px !default;\n$swal2-box-shadow: #d9d9d9 !default;\n\n// ANIMATIONS\n$swal2-show-animation: swal2-show 0.3s !default;\n$swal2-hide-animation: swal2-hide 0.15s forwards !default;\n\n// BACKGROUND\n$swal2-background: $swal2-white !default;\n\n// TYPOGRAPHY\n$swal2-font: inherit !default;\n$swal2-font-size: 1rem !default;\n\n// BACKDROP\n$swal2-backdrop: rgba($swal2-black, 0.4) !default;\n$swal2-backdrop-transition: background-color 0.1s !default;\n\n// ICONS\n$swal2-icon-size: 5em !default;\n$swal2-icon-animations: true !default;\n$swal2-icon-margin: 2.5em auto 0.6em !default;\n$swal2-icon-font-family: inherit !default;\n$swal2-icon-font-size: 3.75em !default;\n$swal2-icon-border-color: #000 !default;\n$swal2-icon-zoom: null !default;\n$swal2-success: #a5dc86 !default;\n$swal2-success-border: rgba($swal2-success, 0.3) !default;\n$swal2-error: #f27474 !default;\n$swal2-warning: #f8bb86 !default;\n$swal2-info: #3fc3ee !default;\n$swal2-question: #87adbd !default;\n\n// IMAGE\n$swal2-image-margin: 2em auto 1em !default;\n\n// TITLE\n$swal2-title-position: relative !default;\n$swal2-title-max-width: 100% !default;\n$swal2-title-margin: 0 !default;\n$swal2-title-padding: 0.8em 1em 0 !default;\n$swal2-title-color: inherit !default;\n$swal2-title-font-size: 1.875em !default;\n$swal2-title-font-weight: 600 !default;\n$swal2-title-text-align: center !default;\n\n// HTML CONTAINER\n$swal2-html-container-justify-content: center !default;\n$swal2-html-container-margin: 1em 1.6em 0.3em !default;\n$swal2-html-container-padding: 0 !default;\n$swal2-html-container-overflow: auto !default;\n$swal2-html-container-color: inherit !default;\n$swal2-html-container-font-size: 1.125em !default;\n$swal2-html-container-font-weight: normal !default;\n$swal2-html-container-line-height: normal !default;\n$swal2-html-container-text-align: center !default;\n$swal2-html-container-word-wrap: break-word !default;\n$swal2-html-container-word-break: break-word !default;\n\n// INPUT\n$swal2-input-margin: 1em 2em 3px !default;\n$swal2-input-width: auto !default;\n$swal2-input-height: 2.625em !default;\n$swal2-input-padding: 0 0.75em !default;\n$swal2-input-border: 1px solid lighten($swal2-black, 85) !default;\n$swal2-input-border-radius: 0.1875em !default;\n$swal2-input-box-shadow:\n inset 0 1px 1px rgba($swal2-black, 0.06),\n 0 0 0 3px transparent !default;\n$swal2-input-font-size: 1.125em !default;\n$swal2-input-background: transparent !default;\n$swal2-input-color: inherit !default;\n$swal2-input-transition:\n border-color 0.1s,\n box-shadow 0.1s !default;\n\n// INPUT:FOCUS\n$swal2-input-focus-border: 1px solid #b4dbed !default;\n$swal2-input-focus-outline: none !default;\n$swal2-input-focus-box-shadow:\n inset 0 1px 1px rgba($swal2-black, 0.06),\n 0 0 0 3px $swal2-outline-color !default;\n\n// TEXTAREA SPECIFIC VARIABLES\n$swal2-textarea-height: 6.75em !default;\n$swal2-textarea-padding: 0.75em !default;\n\n// INPUT LABEL\n$swal2-input-label-margin: 1em auto 0 !default;\n$swal2-input-label-justify-content: center !default;\n\n// VALIDATION MESSAGE\n$swal2-validation-message-align-items: center !default;\n$swal2-validation-message-justify-content: center !default;\n$swal2-validation-message-margin: 1em 0 0 !default;\n$swal2-validation-message-padding: 0.625em !default;\n$swal2-validation-message-background: lighten($swal2-black, 94) !default;\n$swal2-validation-message-color: lighten($swal2-black, 40) !default;\n$swal2-validation-message-font-size: 1em !default;\n$swal2-validation-message-font-weight: 300 !default;\n$swal2-validation-message-icon-background: $swal2-error !default;\n$swal2-validation-message-icon-color: $swal2-white !default;\n$swal2-validation-message-icon-zoom: null !default;\n\n// PROGRESS STEPS\n$swal2-progress-steps-flex-wrap: wrap !default;\n$swal2-progress-steps-align-items: center !default;\n$swal2-progress-steps-max-width: 100% !default;\n$swal2-progress-steps-background: transparent !default;\n$swal2-progress-steps-margin: 1.25em auto !default;\n$swal2-progress-steps-padding: 0 !default;\n$swal2-progress-steps-font-weight: 600 !default;\n$swal2-progress-steps-distance: 2.5em !default;\n$swal2-progress-step-width: 2em;\n$swal2-progress-step-height: 2em;\n$swal2-progress-step-border-radius: 2em;\n$swal2-progress-step-background: #add8e6 !default;\n$swal2-progress-step-color: $swal2-white !default;\n$swal2-active-step-background: #2778c4 !default;\n$swal2-active-step-color: $swal2-white !default;\n\n// FOOTER\n$swal2-footer-margin: 1em 0 0 !default;\n$swal2-footer-padding: 1em 1em 0 !default;\n$swal2-footer-border-color: #eee !default;\n$swal2-footer-color: inherit !default;\n$swal2-footer-font-size: 1em !default;\n$swal2-footer-text-align: center !default;\n\n// TIMER PROGRESS BAR\n$swal2-timer-progress-bar-height: 0.25em;\n$swal2-timer-progress-bar-background: rgba($swal2-black, 0.2) !default;\n\n// CLOSE BUTTON\n$swal2-close-button-justify-self: end !default;\n$swal2-close-button-align-items: center !default;\n$swal2-close-button-justify-content: center !default;\n$swal2-close-button-width: 1.2em !default;\n$swal2-close-button-height: 1.2em !default;\n$swal2-close-button-position: null !default;\n$swal2-close-button-gap: 0 !default;\n$swal2-close-button-padding: 0 !default;\n$swal2-close-button-transition:\n color 0.1s,\n box-shadow 0.1s !default;\n$swal2-close-button-border: none !default;\n$swal2-close-button-border-radius: $swal2-border-radius !default;\n$swal2-close-button-outline: null !default;\n$swal2-close-button-background: transparent !default;\n$swal2-close-button-color: #ccc !default;\n$swal2-close-button-font-family: monospace !default;\n$swal2-close-button-font-size: 2.5em !default;\n$swal2-close-button-box-shadow: inset 0 0 0 3px transparent !default;\n\n// CLOSE BUTTON:HOVER\n$swal2-close-button-hover-transform: none !default;\n$swal2-close-button-hover-color: $swal2-error !default;\n$swal2-close-button-hover-background: transparent !default;\n\n// CLOSE BUTTON:FOCUS\n$swal2-close-button-focus-outline: none !default;\n$swal2-close-button-focus-box-shadow: inset 0 0 0 3px $swal2-outline-color !default;\n\n// ACTIONS\n$swal2-actions-flex-wrap: wrap !default;\n$swal2-actions-align-items: center !default;\n$swal2-actions-justify-content: center !default;\n$swal2-actions-width: auto !default;\n$swal2-actions-margin: 1.25em auto 0 !default;\n$swal2-actions-padding: 0 !default;\n\n// COMMON VARIABLES FOR ALL ACTION BUTTONS\n$swal2-button-margin: 0.3125em !default;\n$swal2-button-padding: 0.625em 1.1em !default;\n$swal2-button-transition: box-shadow 0.1s !default;\n$swal2-button-box-shadow: 0 0 0 3px transparent !default;\n$swal2-button-font-weight: 500 !default;\n$swal2-button-darken-hover: rgba($swal2-black, 0.1) !default;\n$swal2-button-darken-active: rgba($swal2-black, 0.2) !default;\n$swal2-button-focus-outline: none !default;\n$swal2-button-focus-box-shadow: 0 0 0 3px $swal2-outline-color !default;\n\n// CONFIRM BUTTON\n$swal2-confirm-button-order: null !default;\n$swal2-confirm-button-border: 0 !default;\n$swal2-confirm-button-border-radius: 0.25em !default;\n$swal2-confirm-button-background-color: #7066e0 !default;\n$swal2-confirm-button-color: $swal2-white !default;\n$swal2-confirm-button-font-size: 1em !default;\n$swal2-confirm-button-focus-box-shadow: 0 0 0 3px rgba($swal2-confirm-button-background-color, 0.5) !default;\n\n// DENY BUTTON\n$swal2-deny-button-order: null !default;\n$swal2-deny-button-border: 0 !default;\n$swal2-deny-button-border-radius: 0.25em !default;\n$swal2-deny-button-background-color: #dc3741 !default;\n$swal2-deny-button-color: $swal2-white !default;\n$swal2-deny-button-font-size: 1em !default;\n$swal2-deny-button-focus-box-shadow: 0 0 0 3px rgba($swal2-deny-button-background-color, 0.5) !default;\n\n// CANCEL BUTTON\n$swal2-cancel-button-order: null !default;\n$swal2-cancel-button-border: 0 !default;\n$swal2-cancel-button-border-radius: 0.25em !default;\n$swal2-cancel-button-background-color: #6e7881 !default;\n$swal2-cancel-button-color: $swal2-white !default;\n$swal2-cancel-button-font-size: 1em !default;\n$swal2-cancel-button-focus-box-shadow: 0 0 0 3px rgba($swal2-cancel-button-background-color, 0.5) !default;\n\n// LOADER\n$swal2-loader-align-items: center !default;\n$swal2-loader-justify-content: center !default;\n$swal2-loader-width: 2.2em !default;\n$swal2-loader-height: 2.2em !default;\n$swal2-loader-margin: 0 1.875em !default;\n$swal2-loader-animation: swal2-rotate-loading 1.5s linear 0s infinite normal !default;\n$swal2-loader-border-width: 0.25em !default;\n$swal2-loader-border-style: solid !default;\n$swal2-loader-border-radius: 100% !default;\n$swal2-loader-border-color: #2778c4 transparent #2778c4 transparent !default;\n\n// TOASTS\n$swal2-toast-show-animation: swal2-toast-show 0.5s !default;\n$swal2-toast-hide-animation: swal2-toast-hide 0.1s forwards !default;\n$swal2-toast-border: none !default;\n$swal2-toast-box-shadow:\n 0 0 1px hsl(0deg 0% 0% / 0.075),\n 0 1px 2px hsl(0deg 0% 0% / 0.075),\n 1px 2px 4px hsl(0deg 0% 0% / 0.075),\n 1px 3px 8px hsl(0deg 0% 0% / 0.075),\n 2px 4px 16px hsl(0deg 0% 0% / 0.075) !default;\n$swal2-toast-background: $swal2-white !default;\n$swal2-toast-close-button-width: 0.8em !default;\n$swal2-toast-close-button-height: 0.8em !default;\n$swal2-toast-close-button-margin: 0 !default;\n$swal2-toast-close-button-font-size: 2em !default;\n$swal2-toast-width: 360px !default;\n$swal2-toast-padding: 1em !default;\n$swal2-toast-title-margin: 0.5em 1em !default;\n$swal2-toast-title-padding: 0 !default;\n$swal2-toast-title-font-size: 1em !default;\n$swal2-toast-icon-font-size: 1.8em !default;\n$swal2-toast-html-container-margin: 0.5em 1em !default;\n$swal2-toast-html-container-padding: 0 !default;\n$swal2-toast-html-container-font-size: 1em !default;\n$swal2-toast-input-height: 2em !default;\n$swal2-toast-input-margin: 0.5em !default;\n$swal2-toast-input-font-size: 1em !default;\n$swal2-toast-validation-font-size: 1em !default;\n$swal2-toast-buttons-font-size: 1em !default;\n$swal2-toast-footer-margin: 0.5em 0 0 !default;\n$swal2-toast-footer-padding: 0.5em 0 0 !default;\n$swal2-toast-footer-font-size: 0.8em !default;\n","@use 'sass:math';\n\ndiv:where(.swal2-container) {\n display: grid;\n position: fixed;\n z-index: 1060;\n inset: 0;\n box-sizing: border-box;\n grid-template-areas:\n 'top-start top top-end'\n 'center-start center center-end'\n 'bottom-start bottom-center bottom-end';\n grid-template-rows: minmax(min-content, auto) minmax(min-content, auto) minmax(min-content, auto);\n height: 100%; // Safari\n padding: $swal2-container-padding;\n overflow-x: hidden;\n transition: $swal2-backdrop-transition;\n\n // sweetalert2/issues/905\n -webkit-overflow-scrolling: touch;\n\n &.swal2-backdrop-show,\n &.swal2-noanimation {\n background: $swal2-backdrop;\n }\n\n &.swal2-backdrop-hide {\n background: transparent !important;\n }\n\n &.swal2-top-start,\n &.swal2-center-start,\n &.swal2-bottom-start {\n grid-template-columns: minmax(0, 1fr) auto auto;\n }\n\n &.swal2-top,\n &.swal2-center,\n &.swal2-bottom {\n grid-template-columns: auto minmax(0, 1fr) auto;\n }\n\n &.swal2-top-end,\n &.swal2-center-end,\n &.swal2-bottom-end {\n grid-template-columns: auto auto minmax(0, 1fr);\n }\n\n &.swal2-top-start > .swal2-popup {\n align-self: start;\n }\n\n &.swal2-top > .swal2-popup {\n grid-column: 2;\n place-self: start center;\n }\n\n &.swal2-top-end > .swal2-popup,\n &.swal2-top-right > .swal2-popup {\n grid-column: 3;\n place-self: start end;\n }\n\n &.swal2-center-start > .swal2-popup,\n &.swal2-center-left > .swal2-popup {\n grid-row: 2;\n align-self: center;\n }\n\n &.swal2-center > .swal2-popup {\n grid-column: 2;\n grid-row: 2;\n place-self: center center;\n }\n\n &.swal2-center-end > .swal2-popup,\n &.swal2-center-right > .swal2-popup {\n grid-column: 3;\n grid-row: 2;\n place-self: center end;\n }\n\n &.swal2-bottom-start > .swal2-popup,\n &.swal2-bottom-left > .swal2-popup {\n grid-column: 1;\n grid-row: 3;\n align-self: end;\n }\n\n &.swal2-bottom > .swal2-popup {\n grid-column: 2;\n grid-row: 3;\n place-self: end center;\n }\n\n &.swal2-bottom-end > .swal2-popup,\n &.swal2-bottom-right > .swal2-popup {\n grid-column: 3;\n grid-row: 3;\n place-self: end end;\n }\n\n &.swal2-grow-row > .swal2-popup,\n &.swal2-grow-fullscreen > .swal2-popup {\n grid-column: 1/4;\n width: 100%;\n }\n\n &.swal2-grow-column > .swal2-popup,\n &.swal2-grow-fullscreen > .swal2-popup {\n grid-row: 1/4;\n align-self: stretch;\n }\n\n &.swal2-no-transition {\n transition: none !important;\n }\n\n div:where(.swal2-popup) {\n display: none;\n position: relative;\n box-sizing: border-box;\n grid-template-columns: minmax(0, 100%);\n width: $swal2-width;\n max-width: 100%;\n padding: $swal2-padding;\n border: $swal2-border;\n border-radius: $swal2-border-radius;\n background: $swal2-background;\n color: $swal2-color;\n font-family: $swal2-font;\n font-size: $swal2-font-size;\n\n &:focus {\n outline: none;\n }\n\n &.swal2-loading {\n overflow-y: hidden;\n }\n }\n\n h2:where(.swal2-title) {\n position: $swal2-title-position;\n max-width: $swal2-title-max-width;\n margin: $swal2-title-margin;\n padding: $swal2-title-padding;\n color: $swal2-title-color;\n font-size: $swal2-title-font-size;\n font-weight: $swal2-title-font-weight;\n text-align: $swal2-title-text-align;\n text-transform: none;\n word-wrap: break-word;\n }\n\n div:where(.swal2-actions) {\n display: flex;\n z-index: 1; // prevent success icon from overlapping buttons\n box-sizing: border-box;\n flex-wrap: $swal2-actions-flex-wrap;\n align-items: $swal2-actions-align-items;\n justify-content: $swal2-actions-justify-content;\n width: $swal2-actions-width;\n margin: $swal2-actions-margin;\n padding: $swal2-actions-padding;\n\n &:not(.swal2-loading) {\n .swal2-styled {\n &[disabled] {\n opacity: 0.4;\n }\n\n &:hover {\n background-image: linear-gradient($swal2-button-darken-hover, $swal2-button-darken-hover);\n }\n\n &:active {\n background-image: linear-gradient($swal2-button-darken-active, $swal2-button-darken-active);\n }\n }\n }\n }\n\n div:where(.swal2-loader) {\n display: none;\n align-items: $swal2-loader-align-items;\n justify-content: $swal2-loader-justify-content;\n width: $swal2-loader-width;\n height: $swal2-loader-height;\n margin: $swal2-loader-margin;\n animation: $swal2-loader-animation;\n border-width: $swal2-loader-border-width;\n border-style: $swal2-loader-border-style;\n border-radius: $swal2-loader-border-radius;\n border-color: $swal2-loader-border-color;\n }\n\n button:where(.swal2-styled) {\n margin: $swal2-button-margin;\n padding: $swal2-button-padding;\n transition: $swal2-button-transition;\n box-shadow: $swal2-button-box-shadow;\n font-weight: $swal2-button-font-weight;\n\n &:not([disabled]) {\n cursor: pointer;\n }\n\n &.swal2-confirm {\n order: $swal2-confirm-button-order;\n border: $swal2-confirm-button-border;\n border-radius: $swal2-confirm-button-border-radius;\n background: initial;\n background-color: $swal2-confirm-button-background-color;\n color: $swal2-confirm-button-color;\n font-size: $swal2-confirm-button-font-size;\n\n &:focus {\n box-shadow: $swal2-confirm-button-focus-box-shadow;\n }\n }\n\n &.swal2-deny {\n order: $swal2-deny-button-order;\n border: $swal2-deny-button-border;\n border-radius: $swal2-deny-button-border-radius;\n background: initial;\n background-color: $swal2-deny-button-background-color;\n color: $swal2-deny-button-color;\n font-size: $swal2-deny-button-font-size;\n\n &:focus {\n box-shadow: $swal2-deny-button-focus-box-shadow;\n }\n }\n\n &.swal2-cancel {\n order: $swal2-cancel-button-order;\n border: $swal2-cancel-button-border;\n border-radius: $swal2-cancel-button-border-radius;\n background: initial;\n background-color: $swal2-cancel-button-background-color;\n color: $swal2-cancel-button-color;\n font-size: $swal2-cancel-button-font-size;\n\n &:focus {\n box-shadow: $swal2-cancel-button-focus-box-shadow;\n }\n }\n\n &.swal2-default-outline {\n &:focus {\n box-shadow: $swal2-button-focus-box-shadow;\n }\n }\n\n &:focus {\n outline: $swal2-button-focus-outline;\n }\n\n &::-moz-focus-inner {\n border: 0;\n }\n }\n\n div:where(.swal2-footer) {\n margin: $swal2-footer-margin;\n padding: $swal2-footer-padding;\n border-top: 1px solid $swal2-footer-border-color;\n color: $swal2-footer-color;\n font-size: $swal2-footer-font-size;\n text-align: $swal2-footer-text-align;\n }\n\n .swal2-timer-progress-bar-container {\n position: absolute;\n right: 0;\n bottom: 0;\n left: 0;\n grid-column: auto !important;\n overflow: hidden;\n border-bottom-right-radius: $swal2-border-radius;\n border-bottom-left-radius: $swal2-border-radius;\n }\n\n div:where(.swal2-timer-progress-bar) {\n width: 100%;\n height: $swal2-timer-progress-bar-height;\n background: $swal2-timer-progress-bar-background;\n }\n\n img:where(.swal2-image) {\n max-width: 100%;\n margin: $swal2-image-margin;\n }\n\n button:where(.swal2-close) {\n position: $swal2-close-button-position;\n z-index: 2; // sweetalert2/issues/1617\n align-items: $swal2-close-button-align-items;\n justify-content: $swal2-close-button-justify-content;\n width: $swal2-close-button-width;\n height: $swal2-close-button-height;\n margin-top: $swal2-close-button-gap;\n margin-right: $swal2-close-button-gap;\n margin-bottom: -$swal2-close-button-height;\n padding: $swal2-close-button-padding;\n overflow: hidden;\n transition: $swal2-close-button-transition;\n border: $swal2-close-button-border;\n border-radius: $swal2-close-button-border-radius;\n outline: $swal2-close-button-outline;\n background: $swal2-close-button-background;\n color: $swal2-close-button-color;\n font-family: $swal2-close-button-font-family;\n font-size: $swal2-close-button-font-size;\n cursor: pointer;\n justify-self: $swal2-close-button-justify-self;\n\n &:hover {\n transform: $swal2-close-button-hover-transform;\n background: $swal2-close-button-hover-background;\n color: $swal2-close-button-hover-color;\n }\n\n &:focus {\n outline: $swal2-close-button-focus-outline;\n box-shadow: $swal2-close-button-focus-box-shadow;\n }\n\n &::-moz-focus-inner {\n border: 0;\n }\n }\n\n .swal2-html-container {\n z-index: 1; // prevent success icon overlapping the content\n justify-content: $swal2-html-container-justify-content;\n margin: $swal2-html-container-margin;\n padding: $swal2-html-container-padding;\n overflow: $swal2-html-container-overflow;\n color: $swal2-html-container-color;\n font-size: $swal2-html-container-font-size;\n font-weight: $swal2-html-container-font-weight;\n line-height: $swal2-html-container-line-height;\n text-align: $swal2-html-container-text-align;\n word-wrap: $swal2-html-container-word-wrap;\n word-break: $swal2-html-container-word-break;\n }\n\n input:where(.swal2-input),\n input:where(.swal2-file),\n textarea:where(.swal2-textarea),\n select:where(.swal2-select),\n div:where(.swal2-radio),\n label:where(.swal2-checkbox) {\n margin: $swal2-input-margin;\n }\n\n input:where(.swal2-input),\n input:where(.swal2-file),\n textarea:where(.swal2-textarea) {\n box-sizing: border-box;\n width: $swal2-input-width;\n transition: $swal2-input-transition;\n border: $swal2-input-border;\n border-radius: $swal2-input-border-radius;\n background: $swal2-input-background;\n box-shadow: $swal2-input-box-shadow;\n color: $swal2-input-color;\n font-size: $swal2-input-font-size;\n\n &.swal2-inputerror {\n border-color: $swal2-error !important;\n box-shadow: 0 0 2px $swal2-error !important;\n }\n\n &:focus {\n border: $swal2-input-focus-border;\n outline: $swal2-input-focus-outline;\n box-shadow: $swal2-input-focus-box-shadow;\n }\n\n &::placeholder {\n color: #ccc;\n }\n }\n\n .swal2-range {\n margin: $swal2-input-margin;\n background: $swal2-background;\n\n input {\n width: 80%;\n }\n\n output {\n width: 20%;\n color: $swal2-input-color;\n font-weight: 600;\n text-align: center;\n }\n\n input,\n output {\n height: $swal2-input-height;\n padding: 0;\n font-size: $swal2-input-font-size;\n line-height: $swal2-input-height;\n }\n }\n\n .swal2-input {\n height: $swal2-input-height;\n padding: $swal2-input-padding;\n }\n\n .swal2-file {\n width: 75%;\n margin-right: auto;\n margin-left: auto;\n background: $swal2-input-background;\n font-size: $swal2-input-font-size;\n }\n\n .swal2-textarea {\n height: $swal2-textarea-height;\n padding: $swal2-textarea-padding;\n }\n\n .swal2-select {\n min-width: 50%;\n max-width: 100%;\n padding: 0.375em 0.625em;\n background: $swal2-input-background;\n color: $swal2-input-color;\n font-size: $swal2-input-font-size;\n }\n\n .swal2-radio,\n .swal2-checkbox {\n align-items: center;\n justify-content: center;\n background: $swal2-background;\n color: $swal2-input-color;\n\n label {\n margin: 0 0.6em;\n font-size: $swal2-input-font-size;\n }\n\n input {\n flex-shrink: 0;\n margin: 0 0.4em;\n }\n }\n\n label:where(.swal2-input-label) {\n display: flex;\n justify-content: $swal2-input-label-justify-content;\n margin: $swal2-input-label-margin;\n }\n\n div:where(.swal2-validation-message) {\n align-items: $swal2-validation-message-align-items;\n justify-content: $swal2-validation-message-justify-content;\n margin: $swal2-validation-message-margin;\n padding: $swal2-validation-message-padding;\n overflow: hidden;\n background: $swal2-validation-message-background;\n color: $swal2-validation-message-color;\n font-size: $swal2-validation-message-font-size;\n font-weight: $swal2-validation-message-font-weight;\n\n &::before {\n content: '!';\n display: inline-block;\n width: 1.5em;\n min-width: 1.5em;\n height: 1.5em;\n margin: 0 0.625em;\n zoom: $swal2-validation-message-icon-zoom;\n border-radius: 50%;\n background-color: $swal2-validation-message-icon-background;\n color: $swal2-validation-message-icon-color;\n font-weight: 600;\n line-height: 1.5em;\n text-align: center;\n }\n }\n\n .swal2-progress-steps {\n flex-wrap: $swal2-progress-steps-flex-wrap;\n align-items: $swal2-progress-steps-align-items;\n max-width: $swal2-progress-steps-max-width;\n margin: $swal2-progress-steps-margin;\n padding: $swal2-progress-steps-padding;\n background: $swal2-progress-steps-background;\n font-weight: $swal2-progress-steps-font-weight;\n\n li {\n display: inline-block;\n position: relative;\n }\n\n .swal2-progress-step {\n z-index: 20;\n flex-shrink: 0;\n width: $swal2-progress-step-width;\n height: $swal2-progress-step-height;\n border-radius: $swal2-progress-step-border-radius;\n background: $swal2-active-step-background;\n color: $swal2-active-step-color;\n line-height: $swal2-progress-step-height;\n text-align: center;\n\n &.swal2-active-progress-step {\n background: $swal2-active-step-background;\n\n ~ .swal2-progress-step {\n background: $swal2-progress-step-background;\n color: $swal2-progress-step-color;\n }\n\n ~ .swal2-progress-step-line {\n background: $swal2-progress-step-background;\n }\n }\n }\n\n .swal2-progress-step-line {\n z-index: 10;\n flex-shrink: 0;\n width: $swal2-progress-steps-distance;\n height: 0.4em;\n margin: 0 -1px;\n background: $swal2-active-step-background;\n }\n }\n}\n\n@import 'icons';\n\n// github.com/sweetalert2/sweetalert2/issues/268\n[class^='swal2'] {\n -webkit-tap-highlight-color: transparent;\n}\n\n.swal2-show {\n animation: $swal2-show-animation;\n}\n\n.swal2-hide {\n animation: $swal2-hide-animation;\n}\n\n.swal2-noanimation {\n transition: none;\n}\n\n// Measure scrollbar width for padding body during modal show/hide\n.swal2-scrollbar-measure {\n position: absolute;\n top: -9999px;\n width: 50px;\n height: 50px;\n overflow: scroll;\n}\n\n// Right-to-left support\n.swal2-rtl {\n .swal2-close {\n margin-right: initial;\n margin-left: $swal2-close-button-gap;\n }\n\n .swal2-timer-progress-bar {\n right: 0;\n left: auto;\n }\n}\n","// https://stackoverflow.com/a/12335841/1331425\n@function strip-units($number) {\n @return math.div($number, ($number * 0 + 1));\n}\n$icon-zoom: math.div(strip-units($swal2-icon-size), 5);\n\ndiv:where(.swal2-icon) {\n position: relative;\n box-sizing: content-box;\n justify-content: center;\n width: $swal2-icon-size;\n height: $swal2-icon-size;\n margin: $swal2-icon-margin;\n zoom: $swal2-icon-zoom;\n border: #{0.25em * $icon-zoom} solid transparent;\n border-radius: 50%;\n border-color: $swal2-icon-border-color;\n font-family: $swal2-icon-font-family;\n line-height: $swal2-icon-size;\n cursor: default;\n user-select: none;\n\n .swal2-icon-content {\n display: flex;\n align-items: center;\n font-size: $swal2-icon-font-size;\n }\n\n &.swal2-error {\n border-color: $swal2-error;\n color: $swal2-error;\n\n .swal2-x-mark {\n position: relative;\n flex-grow: 1;\n\n @if $icon-zoom != 1 {\n zoom: $icon-zoom;\n }\n }\n\n [class^='swal2-x-mark-line'] {\n display: block;\n position: absolute;\n top: 2.3125em;\n width: 2.9375em;\n height: 0.3125em;\n border-radius: 0.125em;\n background-color: $swal2-error;\n\n &[class$='left'] {\n left: 1.0625em;\n transform: rotate(45deg);\n }\n\n &[class$='right'] {\n right: 1em;\n transform: rotate(-45deg);\n }\n }\n\n // Error icon animation\n &.swal2-icon-show {\n @if $swal2-icon-animations {\n animation: swal2-animate-error-icon 0.5s;\n\n .swal2-x-mark {\n animation: swal2-animate-error-x-mark 0.5s;\n }\n }\n }\n }\n\n &.swal2-warning {\n border-color: lighten($swal2-warning, 7);\n color: $swal2-warning;\n\n // Warning icon animation\n &.swal2-icon-show {\n @if $swal2-icon-animations {\n animation: swal2-animate-error-icon 0.5s;\n\n .swal2-icon-content {\n animation: swal2-animate-i-mark 0.5s;\n }\n }\n }\n }\n\n &.swal2-info {\n border-color: lighten($swal2-info, 20);\n color: $swal2-info;\n\n // Info icon animation\n &.swal2-icon-show {\n @if $swal2-icon-animations {\n animation: swal2-animate-error-icon 0.5s;\n\n .swal2-icon-content {\n animation: swal2-animate-i-mark 0.8s;\n }\n }\n }\n }\n\n &.swal2-question {\n border-color: lighten($swal2-question, 20);\n color: $swal2-question;\n\n // Question icon animation\n &.swal2-icon-show {\n @if $swal2-icon-animations {\n animation: swal2-animate-error-icon 0.5s;\n\n .swal2-icon-content {\n animation: swal2-animate-question-mark 0.8s;\n }\n }\n }\n }\n\n &.swal2-success {\n border-color: $swal2-success;\n color: $swal2-success;\n\n [class^='swal2-success-circular-line'] {\n // Emulate moving circular line\n position: absolute;\n width: 3.75em;\n height: 7.5em;\n border-radius: 50%;\n\n &[class$='left'] {\n top: -0.4375em;\n left: -2.0635em;\n transform: rotate(-45deg);\n transform-origin: 3.75em 3.75em;\n border-radius: 7.5em 0 0 7.5em;\n\n @if $icon-zoom != 1 {\n zoom: $icon-zoom;\n }\n }\n\n &[class$='right'] {\n top: -0.6875em;\n left: 1.875em;\n transform: rotate(-45deg);\n transform-origin: 0 3.75em;\n border-radius: 0 7.5em 7.5em 0;\n\n @if $icon-zoom != 1 {\n zoom: $icon-zoom;\n }\n }\n }\n\n .swal2-success-ring {\n // Ring\n position: absolute;\n z-index: 2;\n top: -0.25em;\n left: -0.25em;\n box-sizing: content-box;\n width: 100%;\n height: 100%;\n border: 0.25em solid $swal2-success-border;\n border-radius: 50%;\n\n @if $icon-zoom != 1 {\n zoom: $icon-zoom;\n }\n }\n\n .swal2-success-fix {\n // Hide corners left from animation\n position: absolute;\n z-index: 1;\n top: 0.5em;\n left: 1.625em;\n width: 0.4375em;\n height: 5.625em;\n transform: rotate(-45deg);\n\n @if $icon-zoom != 1 {\n zoom: $icon-zoom;\n }\n }\n\n [class^='swal2-success-line'] {\n display: block;\n position: absolute;\n z-index: 2;\n height: 0.3125em;\n border-radius: 0.125em;\n background-color: $swal2-success;\n\n &[class$='tip'] {\n top: 2.875em;\n left: 0.8125em;\n width: 1.5625em;\n transform: rotate(45deg);\n }\n\n &[class$='long'] {\n top: 2.375em;\n right: 0.5em;\n width: 2.9375em;\n transform: rotate(-45deg);\n }\n\n @if $icon-zoom != 1 {\n zoom: $icon-zoom;\n }\n }\n\n // Success icon animation\n &.swal2-icon-show {\n @if $swal2-icon-animations {\n .swal2-success-line-tip {\n animation: swal2-animate-success-line-tip 0.75s;\n }\n\n .swal2-success-line-long {\n animation: swal2-animate-success-line-long 0.75s;\n }\n\n .swal2-success-circular-line-right {\n animation: swal2-rotate-success-circular-line 4.25s ease-in;\n }\n }\n }\n }\n}\n","// Animations\n@keyframes swal2-toast-show {\n 0% {\n transform: translateY(-0.625em) rotateZ(2deg);\n }\n\n 33% {\n transform: translateY(0) rotateZ(-2deg);\n }\n\n 66% {\n transform: translateY(0.3125em) rotateZ(2deg);\n }\n\n 100% {\n transform: translateY(0) rotateZ(0deg);\n }\n}\n\n@keyframes swal2-toast-hide {\n 100% {\n transform: rotateZ(1deg);\n opacity: 0;\n }\n}\n\n@keyframes swal2-toast-animate-success-line-tip {\n 0% {\n top: 0.5625em;\n left: 0.0625em;\n width: 0;\n }\n\n 54% {\n top: 0.125em;\n left: 0.125em;\n width: 0;\n }\n\n 70% {\n top: 0.625em;\n left: -0.25em;\n width: 1.625em;\n }\n\n 84% {\n top: 1.0625em;\n left: 0.75em;\n width: 0.5em;\n }\n\n 100% {\n top: 1.125em;\n left: 0.1875em;\n width: 0.75em;\n }\n}\n\n@keyframes swal2-toast-animate-success-line-long {\n 0% {\n top: 1.625em;\n right: 1.375em;\n width: 0;\n }\n\n 65% {\n top: 1.25em;\n right: 0.9375em;\n width: 0;\n }\n\n 84% {\n top: 0.9375em;\n right: 0;\n width: 1.125em;\n }\n\n 100% {\n top: 0.9375em;\n right: 0.1875em;\n width: 1.375em;\n }\n}\n","@import 'toasts-animations';\n\n// Appearance animation\n@keyframes swal2-show {\n 0% {\n transform: scale(0.7);\n }\n\n 45% {\n transform: scale(1.05);\n }\n\n 80% {\n transform: scale(0.95);\n }\n\n 100% {\n transform: scale(1);\n }\n}\n\n// Disppearance animation\n@keyframes swal2-hide {\n 0% {\n transform: scale(1);\n opacity: 1;\n }\n\n 100% {\n transform: scale(0.5);\n opacity: 0;\n }\n}\n\n// Success icon animations\n@keyframes swal2-animate-success-line-tip {\n 0% {\n top: 1.1875em;\n left: 0.0625em;\n width: 0;\n }\n\n 54% {\n top: 1.0625em;\n left: 0.125em;\n width: 0;\n }\n\n 70% {\n top: 2.1875em;\n left: -0.375em;\n width: 3.125em;\n }\n\n 84% {\n top: 3em;\n left: 1.3125em;\n width: 1.0625em;\n }\n\n 100% {\n top: 2.8125em;\n left: 0.8125em;\n width: 1.5625em;\n }\n}\n\n@keyframes swal2-animate-success-line-long {\n 0% {\n top: 3.375em;\n right: 2.875em;\n width: 0;\n }\n\n 65% {\n top: 3.375em;\n right: 2.875em;\n width: 0;\n }\n\n 84% {\n top: 2.1875em;\n right: 0;\n width: 3.4375em;\n }\n\n 100% {\n top: 2.375em;\n right: 0.5em;\n width: 2.9375em;\n }\n}\n\n@keyframes swal2-rotate-success-circular-line {\n 0% {\n transform: rotate(-45deg);\n }\n\n 5% {\n transform: rotate(-45deg);\n }\n\n 12% {\n transform: rotate(-405deg);\n }\n\n 100% {\n transform: rotate(-405deg);\n }\n}\n\n// Error icon animations\n@keyframes swal2-animate-error-x-mark {\n 0% {\n margin-top: 1.625em;\n transform: scale(0.4);\n opacity: 0;\n }\n\n 50% {\n margin-top: 1.625em;\n transform: scale(0.4);\n opacity: 0;\n }\n\n 80% {\n margin-top: -0.375em;\n transform: scale(1.15);\n }\n\n 100% {\n margin-top: 0;\n transform: scale(1);\n opacity: 1;\n }\n}\n\n@keyframes swal2-animate-error-icon {\n 0% {\n transform: rotateX(100deg);\n opacity: 0;\n }\n\n 100% {\n transform: rotateX(0deg);\n opacity: 1;\n }\n}\n\n@keyframes swal2-rotate-loading {\n 0% {\n transform: rotate(0deg);\n }\n\n 100% {\n transform: rotate(360deg);\n }\n}\n\n// Question mark animation\n@keyframes swal2-animate-question-mark {\n 0% {\n transform: rotateY(-360deg);\n }\n\n 100% {\n transform: rotateY(0);\n }\n}\n\n// Info and Warning mark animation\n@keyframes swal2-animate-i-mark {\n 0% {\n transform: rotateZ(45deg);\n opacity: 0;\n }\n\n 25% {\n transform: rotateZ(-25deg);\n opacity: 0.4;\n }\n\n 50% {\n transform: rotateZ(15deg);\n opacity: 0.8;\n }\n\n 75% {\n transform: rotateZ(-5deg);\n opacity: 1;\n }\n\n 100% {\n transform: rotateX(0);\n opacity: 1;\n }\n}\n","// https://stackoverflow.com/a/30250161\n@mixin not($ignor-list...) {\n @if (length($ignor-list) == 1) {\n $ignor-list: nth($ignor-list, 1);\n }\n\n $not-output: '';\n\n @each $not in $ignor-list {\n $not-output: $not-output + ':not(#{$not})'; // stylelint-disable-line scss/no-duplicate-dollar-variables\n }\n\n &#{$not-output} {\n @content;\n }\n}\n","@import 'toasts-body';\n\n@mixin sweetalert2-body() {\n &.swal2-shown {\n @include not('.swal2-no-backdrop', '.swal2-toast-shown') {\n overflow: hidden; // not overflow-y because of Sarari, #1253\n }\n }\n\n &.swal2-height-auto {\n height: auto !important; // #781 #1107\n }\n\n &.swal2-no-backdrop {\n .swal2-container {\n background-color: transparent !important;\n pointer-events: none;\n\n .swal2-popup {\n pointer-events: all;\n }\n\n .swal2-modal {\n box-shadow: 0 0 10px $swal2-backdrop;\n }\n }\n }\n\n @media print {\n &.swal2-shown {\n @include not('.swal2-no-backdrop', '.swal2-toast-shown') {\n overflow-y: scroll !important;\n\n > [aria-hidden='true'] {\n display: none;\n }\n\n .swal2-container {\n position: static !important;\n }\n }\n }\n }\n}\n","@mixin sweetalert2-toasts-body() {\n &.swal2-toast-shown {\n .swal2-container {\n box-sizing: border-box;\n width: $swal2-toast-width;\n max-width: 100%;\n background-color: transparent;\n pointer-events: none;\n\n &.swal2-top {\n inset: 0 auto auto 50%;\n transform: translateX(-50%);\n }\n\n &.swal2-top-end,\n &.swal2-top-right {\n inset: 0 0 auto auto;\n }\n\n &.swal2-top-start,\n &.swal2-top-left {\n inset: 0 auto auto 0;\n }\n\n &.swal2-center-start,\n &.swal2-center-left {\n inset: 50% auto auto 0;\n transform: translateY(-50%);\n }\n\n &.swal2-center {\n inset: 50% auto auto 50%;\n transform: translate(-50%, -50%);\n }\n\n &.swal2-center-end,\n &.swal2-center-right {\n inset: 50% 0 auto auto;\n transform: translateY(-50%);\n }\n\n &.swal2-bottom-start,\n &.swal2-bottom-left {\n inset: auto auto 0 0;\n }\n\n &.swal2-bottom {\n inset: auto auto 0 50%;\n transform: translateX(-50%);\n }\n\n &.swal2-bottom-end,\n &.swal2-bottom-right {\n inset: auto 0 0 auto;\n }\n }\n }\n}\n"],sourceRoot:""}]);const o=i},663:(e,t,n)=>{"use strict";n.d(t,{A:()=>o});var s=n(1354),r=n.n(s),a=n(6314),i=n.n(a)()(r());i.push([e.id,".rc-buttons{z-index:10}.rc-absolute-buttons{bottom:1.25rem;position:fixed;right:1.25rem;text-align:right}.rc-button{border:none!important;border-radius:7px!important;cursor:pointer;font-size:1rem!important;font-weight:700!important;line-height:150%!important;margin:.25rem!important;padding:1rem 1.5rem!important;text-align:center!important}.rc-go-button{background:rgba(255,154,0,.667)!important;color:#fff!important}.rc-go-button:hover{background:#ff9a00!important}.rc-go-button:active{background:#d68200!important}.rc-cancel-button,.rc-custom-button{background:hsla(0,0%,100%,.933)!important;color:#333!important}.rc-cancel-button:hover,.rc-custom-button:hover{background:#ddd!important}.rc-cancel-button:active,.rc-custom-button:active{background:#aaa!important;color:#000!important}.rc-button:disabled{background:#ddd!important;color:#999!important;cursor:default!important}","",{version:3,sources:["webpack://./src/css/buttons.scss"],names:[],mappings:"AAAA,YACE,UAAA,CAGF,qBAGE,cAAA,CAFA,cAAA,CAGA,aAAA,CAFA,gBAEA,CAGF,WAEE,qBAAA,CAMA,2BAAA,CACA,cAAA,CALA,wBAAA,CACA,yBAAA,CAFA,0BAAA,CAIA,uBAAA,CADA,6BAAA,CALA,2BAQA,CAGF,cACE,yCAAA,CACA,oBAAA,CAEA,oBACE,4BAAA,CAGF,qBACE,4BAAA,CAIJ,oCAEE,yCAAA,CACA,oBAAA,CAEA,gDACE,yBAAA,CAGF,kDACE,yBAAA,CACA,oBAAA,CAIJ,oBACE,yBAAA,CACA,oBAAA,CACA,wBAAA",sourcesContent:[".rc-buttons {\n z-index: 10;\n}\n\n.rc-absolute-buttons {\n position: fixed;\n text-align: right;\n bottom: 1.25rem;\n right: 1.25rem;\n}\n\n.rc-button {\n text-align: center !important;\n border: none !important;\n line-height: 150% !important;\n font-size: 1rem !important;\n font-weight: 700 !important;\n padding: 1rem 1.5rem !important;\n margin: 0.25rem !important;\n border-radius: 7px !important;\n cursor: pointer;\n}\n\n.rc-go-button {\n background: #ff9a00aa !important;\n color: #fff !important;\n\n &:hover {\n background: #ff9a00 !important;\n }\n\n &:active {\n background: #d68200 !important;\n }\n}\n\n.rc-cancel-button,\n.rc-custom-button {\n background: #ffffffee !important;\n color: #333 !important;\n\n &:hover {\n background: #ddd !important;\n }\n\n &:active {\n background: #aaa !important;\n color: #000 !important;\n }\n}\n\n.rc-button:disabled {\n background: #ddd !important;\n color: #999 !important;\n cursor: default !important;\n}\n"],sourceRoot:""}]);const o=i},290:(e,t,n)=>{"use strict";n.d(t,{A:()=>o});var s=n(1354),r=n.n(s),a=n(6314),i=n.n(a)()(r());i.push([e.id,".my__swal2__container .swal2-select{border:2px solid #aaa!important;border-radius:5px!important;font-family:inherit!important;font-size:1.2rem!important;margin:auto 1.6rem!important;outline:none!important;padding-top:.5rem!important}.rc-form{font-family:inherit;font-size:2rem;pointer-events:auto!important}.rc-form .rc-form-inputs{display:flex;justify-content:space-between!important;margin:1rem 0}.rc-form .rc-form-inputs .rc-form-input,.rc-form .rc-form-inputs span{flex-grow:1;font-family:inherit;font-size:inherit;padding:.5rem}.rc-form .rc-form-inputs span{font-weight:700}.rc-form .rc-form-input{border:2px solid #aaa;border-radius:5px;outline:none;width:min(100%,10rem)}.rc-form .rc-form-input.rc-input-error{border-color:#ac0d0d!important;color:#ac0d0d!important}.rc-form .rc-form-input+.rc-form-input{margin-left:.5rem}.arrow-two-sided-svg{position:fixed}.arrow-two-sided-svg .arrow-two-sided{fill:#ff9a00}.arrow-two-sided-horizontal{bottom:10%;left:0;right:0;width:100%}.arrow-two-sided-vertical{bottom:0;height:100%;right:5%;top:0}","",{version:3,sources:["webpack://./src/css/check.scss"],names:[],mappings:"AAAA,oCAME,+BAAA,CADA,2BAAA,CADA,6BAAA,CAHA,0BAAA,CACA,4BAAA,CAKA,sBAAA,CAJA,2BAIA,CAOF,SAEE,mBAAA,CADA,cAAA,CAEA,6BAAA,CAEA,yBACE,YAAA,CACA,uCAAA,CACA,aAAA,CAEA,sEAEE,WAAA,CAEA,mBAAA,CACA,iBAAA,CAFA,aAEA,CAGF,8BACE,eAAA,CAIJ,wBACE,qBAAA,CAEA,iBAAA,CADA,YAAA,CAEA,qBAAA,CAEA,uCACE,8BAAA,CACA,uBAAA,CAIJ,uCACE,iBAAA,CAIJ,qBACE,cAAA,CAEA,sCACE,YAAA,CAIJ,4BAEE,UAAA,CACA,MAAA,CACA,OAAA,CAHA,UAGA,CAGF,0BAIE,QAAA,CAHA,WAAA,CACA,QAAA,CACA,KACA",sourcesContent:[".my__swal2__container .swal2-select {\n font-size: 1.2rem !important;\n margin: auto 1.6rem !important;\n padding-top: 0.5rem !important;\n font-family: inherit !important;\n border-radius: 5px !important;\n border: 2px solid #aaa !important;\n outline: none !important;\n}\n\n/* -------------------------------------------------------------------------- */\n/* Measure Input */\n/* -------------------------------------------------------------------------- */\n\n.rc-form {\n font-size: 2rem;\n font-family: inherit;\n pointer-events: auto !important;\n\n .rc-form-inputs {\n display: flex;\n justify-content: space-between !important;\n margin: 1rem 0;\n\n .rc-form-input,\n span {\n flex-grow: 1;\n padding: 0.5rem;\n font-family: inherit;\n font-size: inherit;\n }\n\n span {\n font-weight: 700;\n }\n }\n\n .rc-form-input {\n border: 2px solid #aaa;\n outline: none;\n border-radius: 5px;\n width: min(100%, 10rem);\n\n &.rc-input-error {\n border-color: #ac0d0d !important;\n color: #ac0d0d !important;\n }\n }\n\n .rc-form-input + .rc-form-input {\n margin-left: 0.5rem;\n }\n}\n\n.arrow-two-sided-svg {\n position: fixed;\n\n .arrow-two-sided {\n fill: #ff9a00;\n }\n}\n\n.arrow-two-sided-horizontal {\n width: 100%;\n bottom: 10%;\n left: 0;\n right: 0;\n}\n\n.arrow-two-sided-vertical {\n height: 100%;\n right: 5%;\n top: 0;\n bottom: 0;\n}\n"],sourceRoot:""}]);const o=i},2945:(e,t,n)=>{"use strict";n.d(t,{A:()=>o});var s=n(1354),r=n.n(s),a=n(6314),i=n.n(a)()(r());i.push([e.id,"#eye-side{font-weight:700}#blind-spot-canvas{bottom:0;display:block;left:0;margin:0;padding:0;position:fixed;right:0;top:0;z-index:-1}#blind-spot-instruction{max-width:unset!important}@media(min-width:641px){#blind-spot-instruction{font-size:1.1rem!important;width:65%!important}}@media(max-width:640px){#blind-spot-instruction{font-size:.9rem!important;width:90%!important}}#pip-video{display:none}#video-canvas{border-radius:6px;bottom:1rem;display:block;left:1rem;position:absolute;z-index:1000}#rc-ruler{cursor:pointer;max-height:120px;overflow:hidden;position:fixed;-webkit-user-select:none;-moz-user-select:none;user-select:none}#rc-ruler-scales{left:30px;pointer-events:none;position:absolute;top:0;z-index:1}#rc-ruler-scales #size-arrow{opacity:.5;transform:rotate(90deg) translateY(calc(50% + 3px))}#rc-ruler-scales .rc-ruler-scale-text{color:rgba(44,46,67,.667);font-weight:700;margin:0!important;padding:0;position:absolute;top:32px!important;transform:translate(-50%)!important}#rc-ruler-scales .rc-ruler-scale{display:block;position:absolute;top:0;transform:translate(-1px);width:2px;z-index:2}#rc-ruler-scales .rc-ruler-major{background-color:rgba(44,46,67,.933);height:30px}#rc-ruler-scales .rc-ruler-secondary{background-color:rgba(89,82,96,.867);height:24px}#rc-ruler-scales .rc-ruler-minor{background-color:rgba(89,82,96,.4);height:16px}.hide-nudger .calibration-nudger{display:none!important;opacity:0!important}.calibration-nudger,.gaze-nudger{bottom:0;box-sizing:border-box;height:100%;left:0;margin:0;overflow:hidden;position:fixed;right:0;scrollbar-width:none;text-align:center;top:0;-webkit-user-select:none;-moz-user-select:none;user-select:none;width:100%;z-index:999999999}.calibration-nudger *,.gaze-nudger *{font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen,Ubuntu,Cantarell,Open Sans,Helvetica Neue,sans-serif}#rc-distance-correct{margin:0 auto auto;overflow-wrap:break-word;padding:2rem;text-align:center;width:100%}#rc-distance-correct #rc-distance-correct-instruction{font-size:7rem;font-weight:700;line-height:100%;margin:0 auto 2rem}#rc-distance-correct #rc-distance-correct-guide{font-size:3rem;font-weight:500;line-height:200%}#rc-distance-correct #rc-distance-correct-guide .rc-distance-num{border-radius:7px!important;font-family:monospace!important;font-size:9rem;font-weight:700;padding:.5rem;vertical-align:middle}","",{version:3,sources:["webpack://./src/css/distance.scss"],names:[],mappings:"AAAA,UACE,eAAA,CAGF,mBAME,QAAA,CAJA,aAAA,CAGA,MAAA,CAIA,QAAA,CADA,SAAA,CAPA,cAAA,CAMA,OAAA,CAHA,KAAA,CADA,UAMA,CAGF,wBAEE,yBAAA,CAGF,wBACE,wBAEE,0BAAA,CADA,mBACA,CAAA,CAIJ,wBACE,wBAEE,yBAAA,CADA,mBACA,CAAA,CAIJ,WACE,YAAA,CAGF,cAME,iBAAA,CAFA,WAAA,CADA,aAAA,CAEA,SAAA,CAHA,iBAAA,CADA,YAKA,CAKF,UAKE,cAAA,CAHA,gBAAA,CACA,eAAA,CAFA,cAAA,CAKA,wBAAA,CAAA,qBAAA,CAAA,gBAAA,CAGF,iBAGE,SAAA,CAEA,mBAAA,CAJA,iBAAA,CACA,KAAA,CAEA,SACA,CAEA,6BAEE,UAAA,CADA,mDACA,CAGF,sCAKE,yBAAA,CACA,eAAA,CAHA,kBAAA,CACA,SAAA,CAHA,iBAAA,CACA,kBAAA,CAKA,mCAAA,CAGF,iCAEE,aAAA,CADA,iBAAA,CAEA,KAAA,CAEA,yBAAA,CADA,SAAA,CAEA,SAAA,CAGF,iCACE,oCAAA,CACA,WAAA,CAGF,qCACE,oCAAA,CACA,WAAA,CAGF,iCACE,kCAAA,CACA,WAAA,CAOF,iCACE,sBAAA,CACA,mBAAA,CAIJ,iCASE,QAAA,CAIA,qBAAA,CARA,WAAA,CAEA,MAAA,CAGA,QAAA,CACA,eAAA,CARA,cAAA,CAKA,OAAA,CAOA,oBAAA,CADA,iBAAA,CARA,KAAA,CAMA,wBAAA,CAAA,qBAAA,CAAA,gBAAA,CARA,UAAA,CAFA,iBAaA,CAEA,qCACE,wHAAA,CAKJ,qBAGE,kBAAA,CAEA,wBAAA,CADA,YAAA,CAHA,iBAAA,CACA,UAGA,CAEA,sDAEE,cAAA,CADA,eAAA,CAGA,gBAAA,CADA,kBACA,CAGF,gDAEE,cAAA,CADA,eAAA,CAEA,gBAAA,CAEA,iEAEE,2BAAA,CAEA,+BAAA,CAEA,cAAA,CAHA,eAAA,CAFA,aAAA,CAIA,qBACA",sourcesContent:["#eye-side {\n font-weight: bold;\n}\n\n#blind-spot-canvas {\n position: fixed;\n display: block;\n z-index: -1;\n top: 0;\n left: 0;\n bottom: 0;\n right: 0;\n padding: 0;\n margin: 0;\n}\n\n#blind-spot-instruction {\n // max-width: min(32rem, 100%) !important;\n max-width: unset !important;\n}\n\n@media (min-width: 641px) {\n #blind-spot-instruction {\n width: 65% !important;\n font-size: 1.1rem !important;\n }\n}\n\n@media (max-width: 640px) {\n #blind-spot-instruction {\n width: 90% !important;\n font-size: 0.9rem !important;\n }\n}\n\n#pip-video {\n display: none;\n}\n\n#video-canvas {\n z-index: 1000;\n position: absolute;\n display: block;\n bottom: 1rem;\n left: 1rem;\n border-radius: 6px;\n}\n\n/* ----------------------------------- PD ----------------------------------- */\n\n#rc-ruler {\n position: fixed;\n max-height: 120px;\n overflow: hidden;\n\n cursor: pointer;\n user-select: none;\n}\n\n#rc-ruler-scales {\n position: absolute;\n top: 0;\n left: 30px;\n z-index: 1;\n pointer-events: none;\n\n #size-arrow {\n transform: rotate(90deg) translate(0, calc(50% + 3px));\n opacity: 0.5;\n }\n\n .rc-ruler-scale-text {\n position: absolute;\n top: 32px !important;\n margin: 0 !important;\n padding: 0;\n color: #2c2e43aa;\n font-weight: 700;\n transform: translate(-50%, 0) !important;\n }\n\n .rc-ruler-scale {\n position: absolute;\n display: block;\n top: 0;\n width: 2px;\n transform: translate(-1px, 0);\n z-index: 2;\n }\n\n .rc-ruler-major {\n background-color: #2c2e43ee;\n height: 30px;\n }\n\n .rc-ruler-secondary {\n background-color: #595260dd;\n height: 24px;\n }\n\n .rc-ruler-minor {\n background-color: #59526066;\n height: 16px;\n }\n}\n\n/* ---------------------------------- Check --------------------------------- */\n\n.hide-nudger {\n .calibration-nudger {\n display: none !important;\n opacity: 0 !important;\n }\n}\n\n.calibration-nudger,\n.gaze-nudger {\n z-index: 999999999;\n position: fixed;\n width: 100%;\n height: 100%;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n margin: 0;\n overflow: hidden;\n user-select: none;\n box-sizing: border-box;\n text-align: center;\n scrollbar-width: none;\n\n * {\n font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen,\n Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;\n }\n}\n\n#rc-distance-correct {\n text-align: center;\n width: 100%;\n margin: 0 auto auto auto;\n padding: 2rem;\n overflow-wrap: break-word;\n\n #rc-distance-correct-instruction {\n font-weight: 700;\n font-size: 7rem;\n margin: 0 auto 2rem auto;\n line-height: 100%;\n }\n\n #rc-distance-correct-guide {\n font-weight: 500;\n font-size: 3rem;\n line-height: 200%;\n\n .rc-distance-num {\n padding: 0.5rem;\n border-radius: 7px !important;\n font-weight: 700;\n font-family: monospace !important;\n vertical-align: middle;\n font-size: 9rem;\n }\n\n // .rc-distance-now {\n // border: 2px solid #ff9a00;\n // background-color: #ff9a0066;\n // }\n\n // .rc-distance-desired {\n // border: 2px solid #3490de;\n // background-color: #3490de66;\n // }\n }\n}\n"],sourceRoot:""}]);const o=i},4636:(e,t,n)=>{"use strict";n.d(t,{A:()=>o});var s=n(1354),r=n.n(s),a=n(6314),i=n.n(a)()(r());i.push([e.id,":root{--rc-panel-theme-color:#3490de;--rc-panel-darken-color:#185b94;--rc-panel-theme-color-semi:#3490de66;--rc-panel-darken-color-semi:#185b9488}.rc-panel{background-color:var(--rc-panel-theme-color);border-radius:10px!important;box-shadow:var(--rc-panel-darken-color-semi) 0 50px 100px -20px,var(--rc-panel-theme-color-semi) 0 30px 60px -30px!important;display:block;margin-left:auto!important;margin-right:auto!important;max-width:720px!important;overflow:hidden;padding:.75rem!important;position:relative;width:100%}.rc-panel *{box-sizing:border-box;outline:none;text-rendering:optimizeLegibility;vertical-align:baseline;-webkit-font-smoothing:auto;-moz-osx-font-smoothing:grayscale;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen,Ubuntu,Cantarell,Open Sans,Helvetica Neue,sans-serif;font-kerning:normal;scrollbar-width:none;-webkit-user-select:none;-moz-user-select:none;user-select:none}.rc-panel .rc-panel-title{color:#fff!important;font-size:2rem!important;font-weight:600!important;margin:1rem 1rem 0!important}.rc-panel .rc-panel-description{color:hsla(0,0%,100%,.8)!important;font-size:1rem!important;font-weight:500!important;margin:.5rem 1rem 0!important}.rc-panel #rc-panel-language-parent{display:flex;flex-direction:row-reverse;margin:0;padding:0}.rc-panel #rc-panel-language-parent #rc-panel-lang-picker{background-color:hsla(0,0%,100%,.8)!important;border:none!important;border-radius:5px!important;display:block;font-size:1rem!important;font-weight:500!important;margin:.25rem .25rem 0!important;outline:none!important;padding:.25rem!important}.rc-panel .rc-panel-steps{margin:-3rem 0 0!important;padding-top:4rem!important}.rc-panel .rc-panel-steps.rc-panel-steps-l,.rc-panel .rc-panel-steps.rc-panel-steps-s{display:flex!important;justify-content:space-between!important}.rc-panel .rc-panel-steps.rc-panel-steps-l .rc-panel-step,.rc-panel .rc-panel-steps.rc-panel-steps-s .rc-panel-step{background:hsla(0,0%,100%,.8);flex-grow:1!important;margin:.25rem!important;padding:0!important;position:relative;text-align:center;transition:background-color .2s}.rc-panel .rc-panel-steps.rc-panel-steps-l .rc-panel-step .rc-panel-step-use,.rc-panel .rc-panel-steps.rc-panel-steps-s .rc-panel-step .rc-panel-step-use{font-size:1rem!important;line-height:170%!important;margin:0!important;padding:0 .3rem!important;position:absolute;right:0;top:0}.rc-panel .rc-panel-steps.rc-panel-steps-l .rc-panel-step .rc-panel-step-use svg,.rc-panel .rc-panel-steps.rc-panel-steps-s .rc-panel-step .rc-panel-step-use svg{height:1rem;width:1rem;fill:var(--rc-panel-darken-color)}.rc-panel .rc-panel-steps.rc-panel-steps-l .rc-panel-step .rc-panel-step-name,.rc-panel .rc-panel-steps.rc-panel-steps-s .rc-panel-step .rc-panel-step-name{color:var(--rc-panel-darken-color);font-size:1rem!important;font-weight:700!important;line-height:150%!important;white-space:nowrap}.rc-panel .rc-panel-steps.rc-panel-steps-l{flex-flow:row nowrap;max-width:100%;overflow-x:scroll}.rc-panel .rc-panel-steps.rc-panel-steps-l .rc-panel-step-name{margin:1.5rem .5rem!important}.rc-panel .rc-panel-steps.rc-panel-steps-l .rc-panel-step-use-tip{bottom:110%!important;display:flex!important;left:50%!important;position:absolute!important;transform:translate(-50%)!important}.rc-panel .rc-panel-steps.rc-panel-steps-s{flex-flow:column nowrap;overflow-x:hidden}.rc-panel .rc-panel-steps.rc-panel-steps-s .rc-panel-step{overflow-x:hidden;text-align:left;white-space:nowrap}.rc-panel .rc-panel-steps.rc-panel-steps-s .rc-panel-step-name{margin:1.2rem .75rem 1.2rem 1.5rem!important}.rc-panel .rc-panel-steps.rc-panel-steps-s .rc-panel-step-use-tip{display:inline-flex!important;position:relative!important}.rc-panel .rc-panel-steps .rc-panel-step{border:none!important;border-radius:7px!important}.rc-panel .rc-panel-steps .rc-panel-step .rc-panel-step-name{display:inline-block!important;position:relative!important}.rc-panel .rc-panel-steps .rc-panel-step-use-tip{align-items:center!important;background-color:rgba(255,154,0,.933)!important;border:none!important;border-radius:7px!important;color:#fff!important;font-size:.75rem!important;font-weight:500!important;justify-content:center!important;line-height:100%!important;margin:0!important;opacity:0;padding:.7rem .5rem!important;pointer-events:none;text-align:center!important;transition:opacity .2s;width:-moz-max-content!important;width:max-content!important;z-index:10!important}.rc-panel .rc-panel-steps .rc-panel-step-use-tip svg{height:.75rem;width:.75rem;fill:#fff}.rc-panel .rc-panel-steps .rc-panel-step-use-tip svg:last-of-type{margin-right:5px}.rc-panel .rc-panel-steps .rc-panel-step-todo:focus,.rc-panel .rc-panel-steps .rc-panel-step-todo:hover{background-color:#fff}.rc-panel .rc-panel-steps .rc-panel-step-todo:focus .rc-panel-step-use-tip,.rc-panel .rc-panel-steps .rc-panel-step-todo:hover .rc-panel-step-use-tip{opacity:1!important}.rc-panel .rc-panel-steps .rc-panel-step-todo:active{background-color:hsla(0,0%,93%,.8)}.rc-panel .rc-panel-steps .rc-panel-step-finished{background-color:hsla(0,0%,73%,.8)!important}.rc-panel .rc-panel-steps .rc-panel-step-inactive{opacity:.6;pointer-events:none}.rc-panel .rc-panel-steps .rc-panel-step-active{cursor:pointer;opacity:1}.rc-panel ::-webkit-scrollbar{display:none;width:0}.rc-panel .rc-panel-debug-control{background-color:hsla(0,0%,100%,.8);border:3px solid #e00;border-radius:7px;margin:1rem 0 0;overflow:hidden;padding:.5rem}.rc-panel .rc-panel-debug-control *{color:#ac0d0d}.rc-panel .rc-panel-debug-control h2,.rc-panel .rc-panel-debug-control h3,.rc-panel .rc-panel-debug-control p{margin:0!important}.rc-panel .rc-panel-debug-control h2{font-size:1.2rem!important;font-weight:700!important}.rc-panel .rc-panel-debug-control h3{font-size:.9rem;font-variant:small-caps;font-weight:500;padding-bottom:.3rem;padding-top:.5rem}.rc-panel .rc-panel-debug-control .rc-panel-debug-bold-text{font-size:1rem!important;font-weight:700}.rc-panel .rc-panel-debug-control .rc-panel-debug-control-next{background-color:#e00;border:none;border-radius:5px;color:#fff;cursor:pointer;font-size:.9rem!important;margin:1rem 0 0;padding:.5rem 1.2rem!important}.rc-panel .rc-panel-debug-control .rc-panel-debug-control-next:hover{background-color:#ac0d0d}.rc-panel .rc-panel-debug-control .rc-panel-debug-control-task-row{display:inline-flex;justify-content:flex-start!important;width:100%}.rc-panel .rc-panel-debug-control .rc-panel-debug-control-task-row .value-element{flex-grow:1;overflow-x:hidden;padding:0 .1rem;pointer-events:none;-webkit-user-select:none;-moz-user-select:none;user-select:none;white-space:nowrap}.rc-panel .rc-panel-debug-control .rc-panel-debug-control-task-row .value-element:first-of-type{padding-left:0}.rc-panel .rc-panel-debug-control .rc-panel-debug-control-task-row .value-element:last-of-type{padding-right:0}.rc-panel .rc-panel-debug-control .rc-panel-debug-control-task-row .value-element p{color:#ac0d0d;font-size:.65rem!important;line-height:150%!important;padding-left:1px!important}.rc-panel .rc-panel-debug-control .rc-panel-debug-control-task-row .value-element input{background-color:hsla(0,0%,100%,.8);border:1px solid #e99!important;border-radius:3px!important;font-size:.8rem;margin:0!important;padding:.3rem!important;pointer-events:auto;-webkit-user-select:auto;-moz-user-select:auto;user-select:auto;width:100%}","",{version:3,sources:["webpack://./src/css/panel.scss"],names:[],mappings:"AAAA,MACE,8BAAA,CACA,+BAAA,CACA,qCAAA,CACA,sCAAA,CAGF,UAKE,4CAAA,CAIA,4BAAA,CACA,4HACE,CATF,aAAA,CACA,0BAAA,CACA,2BAAA,CAGA,yBAAA,CAMA,eAAA,CALA,wBAAA,CAPA,iBAAA,CAKA,UAOA,CAEA,YAGE,qBAAA,CAFA,YAAA,CAGA,iCAAA,CAFA,uBAAA,CAGA,2BAAA,CACA,iCAAA,CAGA,wHAAA,CAFA,mBAAA,CAIA,oBAAA,CAHA,wBAAA,CAAA,qBAAA,CAAA,gBAGA,CAGF,0BACE,oBAAA,CAEA,wBAAA,CACA,yBAAA,CAFA,4BAEA,CAGF,gCACE,kCAAA,CAEA,wBAAA,CACA,yBAAA,CAFA,6BAEA,CAGF,oCACE,YAAA,CACA,0BAAA,CACA,QAAA,CACA,SAAA,CAEA,0DAEE,6CAAA,CACA,qBAAA,CAMA,2BAAA,CARA,aAAA,CAMA,wBAAA,CACA,yBAAA,CAHA,gCAAA,CADA,sBAAA,CAEA,wBAGA,CAIJ,0BACE,0BAAA,CACA,0BAAA,CAEA,sFAEE,sBAAA,CACA,uCAAA,CAEA,oHAME,6BAAA,CAJA,qBAAA,CACA,uBAAA,CAEA,mBAAA,CAJA,iBAAA,CAGA,iBAAA,CAGA,+BAAA,CAMA,0JAME,wBAAA,CACA,0BAAA,CAFA,kBAAA,CADA,yBAAA,CAH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BAAA,CAHA,UAAA,CAKA,cAAA,CAPA,yBAAA,CACA,eAAA,CAGA,8BAGA,CAEA,qEACE,wBAAA,CAIJ,mEACE,mBAAA,CACA,oCAAA,CACA,UAAA,CAEA,kFACE,WAAA,CAEA,iBAAA,CADA,eAAA,CAKA,mBAAA,CADA,wBAAA,CAAA,qBAAA,CAAA,gBAAA,CAFA,kBAGA,CAEA,gGACE,cAAA,CAGF,+FACE,eAAA,CAGF,oFAIE,aAAA,CADA,0BAAA,CADA,0BAAA,CADA,0BAGA,CAGF,wFAOE,mCAAA,CAFA,+BAAA,CACA,2BAAA,CAHA,eAAA,CAFA,kBAAA,CACA,uBAAA,CAOA,mBAAA,CADA,wBAAA,CAAA,qBAAA,CAAA,gBAAA,CAJA,UAKA",sourcesContent:[":root {\n --rc-panel-theme-color: #3490de;\n --rc-panel-darken-color: #185b94;\n --rc-panel-theme-color-semi: #3490de66;\n --rc-panel-darken-color-semi: #185b9488;\n}\n\n.rc-panel {\n position: relative;\n display: block;\n margin-left: auto !important;\n margin-right: auto !important;\n background-color: var(--rc-panel-theme-color);\n width: 100%;\n max-width: 720px !important;\n padding: 0.75rem !important;\n border-radius: 10px !important;\n box-shadow:\n var(--rc-panel-darken-color-semi) 0px 50px 100px -20px,\n var(--rc-panel-theme-color-semi) 0px 30px 60px -30px !important;\n overflow: hidden;\n\n * {\n outline: none;\n vertical-align: baseline;\n box-sizing: border-box;\n text-rendering: optimizeLegibility;\n -webkit-font-smoothing: auto;\n -moz-osx-font-smoothing: grayscale;\n font-kerning: normal;\n user-select: none;\n font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen,\n Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;\n scrollbar-width: none;\n }\n\n .rc-panel-title {\n color: #fff !important;\n margin: 1rem 1rem 0 1rem !important;\n font-size: 2rem !important;\n font-weight: 600 !important;\n }\n\n .rc-panel-description {\n color: #ffffffcc !important;\n margin: 0.5rem 1rem 0 1rem !important;\n font-size: 1rem !important;\n font-weight: 500 !important;\n }\n\n #rc-panel-language-parent {\n display: flex;\n flex-direction: row-reverse;\n margin: 0;\n padding: 0;\n\n #rc-panel-lang-picker {\n display: block;\n background-color: #ffffffcc !important;\n border: none !important;\n outline: none !important;\n margin: 0.25rem 0.25rem 0 0.25rem !important;\n padding: 0.25rem !important;\n font-size: 1rem !important;\n font-weight: 500 !important;\n border-radius: 5px !important;\n }\n }\n\n .rc-panel-steps {\n margin: -3rem 0 0 0 !important;\n padding-top: 4rem !important;\n\n &.rc-panel-steps-l,\n &.rc-panel-steps-s {\n display: flex !important;\n justify-content: space-between !important;\n\n .rc-panel-step {\n position: relative;\n flex-grow: 1 !important;\n margin: 0.25rem !important;\n text-align: center;\n padding: 0 !important;\n background: #ffffffcc;\n transition: background-color 0.2s;\n\n // &:focus {\n // outline: 3px solid black !important;\n // }\n\n .rc-panel-step-use {\n position: absolute;\n right: 0;\n top: 0;\n padding: 0 0.3rem !important;\n margin: 0 !important;\n font-size: 1rem !important;\n line-height: 170% !important;\n\n svg {\n width: 1rem;\n height: 1rem;\n fill: var(--rc-panel-darken-color);\n }\n }\n\n .rc-panel-step-name {\n line-height: 150% !important;\n font-size: 1rem !important;\n font-weight: 700 !important;\n color: var(--rc-panel-darken-color);\n white-space: nowrap;\n }\n }\n }\n\n &.rc-panel-steps-l {\n flex-flow: row nowrap;\n max-width: 100%;\n overflow-x: scroll;\n\n .rc-panel-step-name {\n margin: 1.5rem 0.5rem !important;\n }\n\n .rc-panel-step-use-tip {\n position: absolute !important;\n display: flex !important;\n bottom: 110% !important;\n left: 50% !important;\n transform: translate(-50%, 0) !important;\n }\n }\n\n &.rc-panel-steps-s {\n flex-flow: column nowrap;\n overflow-x: hidden;\n\n .rc-panel-step {\n text-align: left;\n overflow-x: hidden;\n white-space: nowrap;\n }\n\n .rc-panel-step-name {\n margin: 1.2rem 0.75rem 1.2rem 1.5rem !important;\n }\n\n .rc-panel-step-use-tip {\n position: relative !important;\n display: inline-flex !important;\n }\n }\n\n .rc-panel-step {\n border-radius: 7px !important;\n border: none !important;\n\n .rc-panel-step-name {\n position: relative !important;\n display: inline-block !important;\n }\n }\n\n // .rc-panel-next-button {\n // .rc-panel-step-name::after {\n // content: ' →' !important;\n // }\n // }\n\n .rc-panel-step-use-tip {\n // visibility: hidden;\n // backdrop-filter: blur(2px);\n // box-shadow: rgba(0, 0, 0, 0.1) 0px 0px 8px !important;\n opacity: 0;\n width: max-content !important;\n background-color: #ff9a00ee !important;\n color: #fff !important;\n text-align: center !important;\n justify-content: center !important;\n align-items: center !important;\n font-size: 0.75rem !important;\n font-weight: 500 !important;\n border-radius: 7px !important;\n border: none !important;\n padding: 0.7rem 0.5rem !important;\n margin: 0 !important;\n z-index: 10 !important;\n line-height: 100% !important;\n transition: opacity 0.2s;\n pointer-events: none;\n\n svg {\n width: 0.75rem;\n height: 0.75rem;\n fill: #fff;\n }\n\n svg:last-of-type {\n margin-right: 5px;\n }\n }\n\n .rc-panel-step-todo {\n &:hover,\n &:focus {\n background-color: #fff;\n\n .rc-panel-step-use-tip {\n // visibility: visible !important;\n opacity: 1 !important;\n }\n }\n\n &:active {\n background-color: #eeeeeecc;\n }\n }\n\n .rc-panel-step-finished {\n background-color: #bbbbbbcc !important;\n }\n\n .rc-panel-step-inactive {\n opacity: 0.6;\n pointer-events: none;\n }\n\n .rc-panel-step-active {\n opacity: 1;\n cursor: pointer;\n }\n }\n\n ::-webkit-scrollbar {\n width: 0;\n display: none;\n }\n\n /* ---------------------------------- DEBUG --------------------------------- */\n\n .rc-panel-debug-control {\n margin: 0;\n margin-top: 1rem;\n padding: 0.5rem;\n border: 3px solid #ee0000;\n border-radius: 7px;\n background-color: #ffffffcc;\n overflow: hidden;\n\n * {\n color: #ac0d0d;\n }\n\n h2,\n h3,\n p {\n margin: 0 !important;\n }\n\n h2 {\n font-weight: 700 !important;\n font-size: 1.2rem !important;\n }\n\n h3 {\n font-variant: small-caps;\n font-size: 0.9rem;\n font-weight: 500;\n padding-top: 0.5rem;\n padding-bottom: 0.3rem;\n }\n\n .rc-panel-debug-bold-text {\n font-size: 1rem !important;\n font-weight: bold;\n }\n\n .rc-panel-debug-control-next {\n font-size: 0.9rem !important;\n margin: 1rem 0 0 0;\n color: #fff;\n background-color: #ee0000;\n padding: 0.5rem 1.2rem !important;\n border-radius: 5px;\n border: none;\n cursor: pointer;\n\n &:hover {\n background-color: #ac0d0d;\n }\n }\n\n .rc-panel-debug-control-task-row {\n display: inline-flex;\n justify-content: flex-start !important;\n width: 100%;\n\n .value-element {\n flex-grow: 1;\n padding: 0 0.1rem;\n overflow-x: hidden;\n white-space: nowrap;\n // max-width: 10rem;\n user-select: none;\n pointer-events: none;\n\n &:first-of-type {\n padding-left: 0;\n }\n\n &:last-of-type {\n padding-right: 0;\n }\n\n p {\n padding-left: 1px !important;\n line-height: 150% !important;\n font-size: 0.65rem !important;\n color: #ac0d0d;\n }\n\n input {\n margin: 0 !important;\n padding: 0.3rem !important;\n font-size: 0.8rem;\n width: 100%;\n border: 1px solid #ee9999 !important;\n border-radius: 3px !important;\n background-color: #ffffffcc;\n user-select: auto;\n pointer-events: auto;\n }\n }\n }\n }\n}\n"],sourceRoot:""}]);const o=i},5151:(e,t,n)=>{"use strict";n.d(t,{A:()=>o});var s=n(1354),r=n.n(s),a=n(6314),i=n.n(a)()(r());i.push([e.id,"#size-card,#size-usba,#size-usbc{display:block;height:auto;left:2rem;position:absolute;z-index:2}#size-arrow{display:block;height:auto;position:absolute;width:70px;z-index:1}#size-arrow-fill{transition:fill .3s}.minor{transition:opacity .25s}.rc-slider:active~.size-obj .minor{opacity:0}#matching-obj{background-color:#fff;border:none;border-radius:7px;font-size:1.1rem;font-weight:600;margin-bottom:unset;margin-left:.3rem;margin-right:.3rem;margin-top:unset;padding-bottom:unset;padding-left:.3rem;padding-right:.3rem;padding-top:unset;pointer-events:auto!important;vertical-align:middle}@media(min-width:481px){.rc-size-obj-selection{display:inline-flex}}@media(max-width:480px){.rc-size-obj-selection{display:inline-block}}","",{version:3,sources:["webpack://./src/css/screenSize.scss"],names:[],mappings:"AAAA,iCAIE,aAAA,CAGA,WAAA,CADA,SAAA,CAHA,iBAAA,CAKA,SAAA,CAGF,YAEE,aAAA,CAGA,WAAA,CAJA,iBAAA,CAGA,UAAA,CAEA,SAAA,CAGF,iBACE,mBAAA,CAGF,OACE,uBAAA,CAIF,mCACE,SAAA,CAKF,cAGE,qBAAA,CADA,WAAA,CADA,iBAAA,CAMA,gBAAA,CADA,eAAA,CADA,mBAAA,CAAA,iBAAA,CAAA,kBAAA,CAAA,gBAAA,CADA,oBAAA,CAAA,kBAAA,CAAA,mBAAA,CAAA,iBAAA,CAKA,6BAAA,CADA,qBACA,CAGF,wBACE,uBACE,mBAAA,CAAA,CAIJ,wBACE,uBACE,oBAAA,CAAA",sourcesContent:["#size-card,\n#size-usba,\n#size-usbc {\n position: absolute;\n display: block;\n /* top: calc(max(45%, 200px) + 50px); */\n left: 2rem;\n height: auto;\n z-index: 2;\n}\n\n#size-arrow {\n position: absolute;\n display: block;\n /* display: none; */\n width: 70px;\n height: auto;\n z-index: 1;\n}\n\n#size-arrow-fill {\n transition: fill 0.3s;\n}\n\n.minor {\n transition: opacity 0.25s;\n}\n\n/* .rc-slider:hover ~ .size-obj .minor, */\n.rc-slider:active ~ .size-obj .minor {\n opacity: 0;\n}\n\n/* -------------------------------------------------------------------------- */\n\n#matching-obj {\n border-radius: 7px;\n border: none;\n background-color: #fff;\n padding: unset 0.3rem;\n margin: unset 0.3rem;\n font-weight: 600;\n font-size: 1.1rem;\n vertical-align: middle;\n pointer-events: auto !important;\n}\n\n@media (min-width: 481px) {\n .rc-size-obj-selection {\n display: inline-flex;\n }\n}\n\n@media (max-width: 480px) {\n .rc-size-obj-selection {\n display: inline-block;\n }\n}\n"],sourceRoot:""}]);const o=i},5319:(e,t,n)=>{"use strict";n.d(t,{A:()=>o});var s=n(1354),r=n.n(s),a=n(6314),i=n.n(a)()(r());i.push([e.id,".rc-slider{-webkit-appearance:none;-moz-appearance:none;appearance:none;background:linear-gradient(90deg,#ffc772,#ffc772 60%,#fff 0);border-radius:5px;cursor:grab;direction:ltr!important;display:block;height:10px;left:2rem;opacity:1;position:absolute;transition:opacity .3s;width:calc(100% - 4rem);z-index:10}.rc-slider::-webkit-slider-thumb{-webkit-appearance:none;appearance:none;background:#ff9a00;border:1px solid #cc7a00;border-radius:15px;box-shadow:0 0 12px 0 rgba(136,82,0,.2);cursor:inherit;height:30px;width:30px}.rc-slider::-moz-range-thumb{-moz-appearance:none;appearance:none;background:#ff9a00;border:1px solid #cc7a00;border-radius:15px;box-shadow:0 0 12px 0 rgba(136,82,0,.2);cursor:inherit;height:30px;width:30px}.rc-slider::-ms-thumb{appearance:none;background:#ff9a00;border:1px solid #cc7a00;border-radius:15px;box-shadow:0 0 12px 0 rgba(136,82,0,.2);cursor:inherit;height:30px;width:30px}","",{version:3,sources:["webpack://./src/css/slider.scss"],names:[],mappings:"AAAA,WAGE,uBAAA,CAAA,oBAAA,CAAA,eAAA,CAGA,4DAAA,CAIA,iBAAA,CAEA,WAAA,CAEA,uBAAA,CAZA,aAAA,CAGA,WAAA,CAIA,SAAA,CAFA,SAAA,CANA,iBAAA,CAYA,sBAAA,CATA,uBAAA,CAOA,UAGA,CAkBF,iCAVE,uBAAA,CAAA,eAAA,CAKA,kBAAA,CADA,wBAAA,CADA,kBAAA,CAGA,uCAAA,CACA,cAAA,CALA,WAAA,CADA,UAMA,CAOF,6BAdE,oBAAA,CAAA,eAAA,CAKA,kBAAA,CADA,wBAAA,CADA,kBAAA,CAGA,uCAAA,CACA,cAAA,CALA,WAAA,CADA,UAMA,CAWF,sBAlBE,eAAA,CAKA,kBAAA,CADA,wBAAA,CADA,kBAAA,CAGA,uCAAA,CACA,cAAA,CALA,WAAA,CADA,UAMA",sourcesContent:[".rc-slider {\n position: absolute;\n display: block;\n appearance: none;\n width: calc(100% - 4rem);\n height: 10px;\n background: linear-gradient(90deg, #ffc772, #ffc772 60%, #fff 60%);\n opacity: 1;\n /* top: max(45%, 200px); */\n left: 2rem;\n border-radius: 5px;\n z-index: 10;\n cursor: grab;\n transition: opacity 0.3s;\n direction: ltr !important;\n}\n\n// .rc-slider:hover {\n// opacity: 1;\n// }\n\n@mixin thumb-style {\n appearance: none;\n width: 30px;\n height: 30px;\n border-radius: 15px;\n border: 1px solid #cc7a00;\n background: #ff9a00;\n box-shadow: 0 0 12px 0 #88520033;\n cursor: inherit;\n}\n\n.rc-slider::-webkit-slider-thumb {\n @include thumb-style;\n}\n\n.rc-slider::-moz-range-thumb {\n @include thumb-style;\n}\n\n.rc-slider::-ms-thumb {\n @include thumb-style;\n}\n"],sourceRoot:""}]);const o=i},4889:(e,t,n)=>{"use strict";n.d(t,{A:()=>o});var s=n(1354),r=n.n(s),a=n(6314),i=n.n(a)()(r());i.push([e.id,"#webgazerVideoContainer .webgazer-videoinput-select{background:hsla(0,0%,100%,.8)!important;border:none!important;border-radius:.6rem!important;color:#666;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen,Ubuntu,Cantarell,Open Sans,Helvetica Neue,sans-serif;font-size:.6rem;left:0;line-height:100%;margin:.3rem;outline:none!important;padding:.2rem .3rem;position:absolute;top:0;z-index:9}","",{version:3,sources:["webpack://./src/css/video.scss"],names:[],mappings:"AACE,oDAcE,uCAAA,CAHA,qBAAA,CAEA,6BAAA,CAEA,UAAA,CARA,wHAAA,CAEA,eAAA,CALA,MAAA,CAMA,gBAAA,CALA,YAAA,CAOA,sBAAA,CANA,mBAAA,CAJA,iBAAA,CACA,KAAA,CAFA,SAcA",sourcesContent:["#webgazerVideoContainer {\n .webgazer-videoinput-select {\n z-index: 9;\n position: absolute;\n top: 0;\n left: 0;\n margin: 0.3rem;\n padding: 0.2rem 0.3rem;\n font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen,\n Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;\n font-size: 0.6rem;\n line-height: 100%;\n border: none !important;\n outline: none !important;\n border-radius: 0.6rem !important;\n background: #ffffffcc !important;\n color: #666;\n }\n}\n"],sourceRoot:""}]);const o=i},9057:(e,t,n)=>{"use strict";n.d(t,{A:()=>o});var s=n(1354),r=n.n(s),a=n(6314),i=n.n(a)()(r());i.push([e.id,"#gaze-system-instruction{top:65%;white-space:pre}.gaze-nudge-instruction{top:65%}.gaze-calibration-dot{background:#ff005c80;cursor:auto;display:block;position:fixed!important;transition-timing-function:ease-in-out;transition:left .5s,right .5s,top .5s,bottom .5s;z-index:999999998}.gaze-calibration-dot-click{background:#ff005c;cursor:pointer;margin:auto;position:absolute;text-align:center;vertical-align:middle}.gaze-calibration-dot-click:active{opacity:.3}.gaze-calibration-dot-text{color:#fff;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen,Ubuntu,Cantarell,Open Sans,Helvetica Neue,sans-serif;font-size:.9rem;font-weight:500;vertical-align:text-bottom}#webgazerGazeDot,#webgazerGazeDot-tempClone,.gaze-calibration-dot-text{pointer-events:none;-webkit-user-select:none;-moz-user-select:none;user-select:none}#webgazerGazeDot,#webgazerGazeDot-tempClone{background-color:#111d5e;border-radius:5px;opacity:.5;position:fixed;z-index:9999999999}#webgazerVideoContainer{border-radius:5px;display:block;overflow:hidden;position:fixed!important;transform-origin:bottom left;z-index:999999997}#webgazerFaceFeedbackBox,#webgazerVideoContainer,#webgazerVideoContainer *{-webkit-user-select:none;-moz-user-select:none;user-select:none}#webgazerFaceFeedbackBox{border-radius:10px;box-sizing:border-box;opacity:.6;pointer-events:none}.rc-crosshair,.rc-gaze-nudger-arrows{position:absolute;-webkit-user-select:none;-moz-user-select:none;user-select:none}.rc-crosshair{border-radius:50%;cursor:pointer;display:block;height:40px;position:fixed!important;transition-timing-function:ease-in-out;transition:left .5s,right .5s,top .5s,bottom .5s;width:40px;z-index:999999999}.rc-crosshair-component{background-color:#000;left:50%;margin:auto;pointer-events:none;position:absolute;top:50%;transform:translate(-50%,-50%);-webkit-user-select:none;-moz-user-select:none;user-select:none}","",{version:3,sources:["webpack://./src/css/gaze.css"],names:[],mappings:"AAAA,yBACE,OAAQ,CACR,eACF,CAEA,wBACE,OACF,CAEA,sBACE,oBAAqB,CAGrB,WAAe,CADf,aAAc,CADd,wBAA0B,CAI1B,sCAAuC,CACvC,gDAIa,CANb,iBAOF,CAEA,4BAEE,kBAAmB,CAEnB,cAAe,CADf,WAAY,CAFZ,iBAAkB,CAIlB,iBAAkB,CAClB,qBACF,CAEA,mCACE,UACF,CAEA,2BAIE,UAAW,CAHX,wHAC8D,CAG9D,eAAiB,CAFjB,eAAgB,CAGhB,0BAGF,CAIA,uEALE,mBAAoB,CADpB,wBAAiB,CAAjB,qBAAiB,CAAjB,gBAeF,CATA,4CAKE,wBAAyB,CACzB,iBAAkB,CAFlB,UAAY,CAFZ,cAAe,CACf,kBAMF,CAEA,wBAKE,iBAAkB,CAHlB,aAAc,CAKd,eAAgB,CAJhB,wBAA0B,CAC1B,4BAA6B,CAH7B,iBASF,CAMA,2EAPE,wBAAiB,CAAjB,qBAAiB,CAAjB,gBAcF,CAPA,yBAGE,kBAAmB,CADnB,qBAAsB,CAEtB,UAAY,CACZ,mBAEF,CAIA,qCAEE,iBAAkB,CAIlB,wBAAiB,CAAjB,qBAAiB,CAAjB,gBACF,CAEA,cAcE,iBAAkB,CARlB,cAAe,CAJf,aAAc,CAEd,WAAY,CAHZ,wBAA0B,CAM1B,sCAAuC,CACvC,gDAIa,CATb,UAAW,CAEX,iBAUF,CAEA,wBAQE,qBAAsB,CALtB,QAAS,CAET,WAAY,CACZ,mBAAoB,CALpB,iBAAkB,CAClB,OAAQ,CAER,8BAAgC,CAGhC,wBAAiB,CAAjB,qBAAiB,CAAjB,gBAEF",sourcesContent:["#gaze-system-instruction {\n top: 65%;\n white-space: pre;\n}\n\n.gaze-nudge-instruction {\n top: 65%;\n}\n\n.gaze-calibration-dot {\n background: #ff005c80;\n position: fixed !important;\n display: block;\n cursor: initial;\n z-index: 999999998;\n transition-timing-function: ease-in-out;\n transition:\n left 0.5s,\n right 0.5s,\n top 0.5s,\n bottom 0.5s;\n}\n\n.gaze-calibration-dot-click {\n position: absolute;\n background: #ff005c;\n margin: auto;\n cursor: pointer;\n text-align: center;\n vertical-align: middle;\n}\n\n.gaze-calibration-dot-click:active {\n opacity: 0.3;\n}\n\n.gaze-calibration-dot-text {\n font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen,\n Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;\n font-weight: 500;\n color: #fff;\n font-size: 0.9rem;\n vertical-align: text-bottom;\n user-select: none;\n pointer-events: none;\n}\n\n/* ----------------------------- WebGazer Native ---------------------------- */\n\n#webgazerGazeDot,\n#webgazerGazeDot-tempClone {\n position: fixed;\n z-index: 9999999999;\n opacity: 0.5;\n background-color: #111d5e;\n border-radius: 5px;\n pointer-events: none;\n user-select: none;\n}\n\n#webgazerVideoContainer {\n z-index: 999999997;\n display: block;\n position: fixed !important;\n transform-origin: bottom left;\n border-radius: 5px;\n /* opacity: 0.8; */\n overflow: hidden;\n /* pointer-events: none; */\n user-select: none;\n}\n\n#webgazerVideoContainer * {\n user-select: none;\n}\n\n#webgazerFaceFeedbackBox {\n /* TODO Set style in sub-module */\n box-sizing: border-box;\n border-radius: 10px;\n opacity: 0.6;\n pointer-events: none;\n user-select: none;\n}\n\n/* ------------------------------- Gaze Nudger ------------------------------ */\n\n.rc-crosshair,\n.rc-gaze-nudger-arrows {\n position: absolute;\n /* top: 50%;\n left: 50%;\n transform: translate(-50%, -50%); */\n user-select: none;\n}\n\n.rc-crosshair {\n position: fixed !important;\n display: block;\n width: 40px;\n height: 40px;\n z-index: 999999999;\n cursor: pointer;\n transition-timing-function: ease-in-out;\n transition:\n left 0.5s,\n right 0.5s,\n top 0.5s,\n bottom 0.5s;\n /* filter: drop-shadow(0 0 3px #fff); */\n border-radius: 50%;\n}\n\n.rc-crosshair-component {\n position: absolute;\n top: 50%;\n left: 50%;\n transform: translate(-50%, -50%);\n margin: auto;\n pointer-events: none;\n user-select: none;\n background-color: #000;\n}\n"],sourceRoot:""}]);const o=i},9725:(e,t,n)=>{"use strict";n.d(t,{A:()=>o});var s=n(1354),r=n.n(s),a=n(6314),i=n.n(a)()(r());i.push([e.id,"#calibration-background{bottom:0;box-sizing:border-box;height:100%;left:0;margin:0;overflow:hidden;overflow-y:scroll;position:fixed;right:0;scrollbar-width:none;text-align:center;top:0;-webkit-user-select:none;-moz-user-select:none;user-select:none;width:100%;z-index:999999990}#calibration-background::-webkit-scrollbar{display:none;width:0}#calibration-background *{font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen,Ubuntu,Cantarell,Open Sans,Helvetica Neue,sans-serif}#calibration-background p{line-height:150%}.calibration-instruction{pointer-events:none;position:absolute;-webkit-user-select:none;-moz-user-select:none;user-select:none}.calibration-instruction-scrollable{height:200%}.calibration-instruction h1{font-weight:700;min-width:360px}.calibration-instruction *{font-size:1.2rem;line-height:170%;margin:0;padding:0}.calibration-instruction p{margin-top:1rem;white-space:pre-line}.calibration-description{line-height:170%}.rc-hang-description{font-size:1rem!important;margin-top:50vh!important}@media (min-width:481px){.calibration-instruction{margin:2rem}.calibration-instruction h1{font-size:2.5rem!important;line-height:100%}.calibration-description{width:calc(100% - 4rem);width:max(min(100% - 4rem,960px),300px)}.calibration-description,.calibration-description *{font-size:1.2rem}.calibration-credit-text{font-size:.9rem!important}}@media (max-width:480px){.calibration-instruction{margin:1rem}.calibration-instruction h1{font-size:1.8rem!important;line-height:120%}.calibration-description{width:calc(100% - 1rem)}.calibration-description,.calibration-description *{font-size:1rem}.calibration-credit-text{font-size:.7rem!important}}.float-instruction{background:hsla(0,0%,100%,.9);border-radius:10px;font-size:1rem;font-weight:500;left:50%;margin:0;max-width:25rem;padding:10px 17px;position:fixed;text-align:center;transform:translate(-50%);-webkit-user-select:none;-moz-user-select:none;user-select:none;z-index:999999991}.swal2-container{z-index:999999999!important}.calibration-credit-text{bottom:3px!important;color:#999!important;line-height:100%!important;margin:0!important;padding:0!important;position:fixed!important;text-align:center!important;width:100%!important}.lock-view{overflow:hidden!important}.rc-lang-ltr{direction:ltr!important;text-align:left!important}.rc-lang-rtl{direction:rtl!important;text-align:right!important}.cursor-grab{cursor:grab}.cursor-grabbing{cursor:grabbing}","",{version:3,sources:["webpack://./src/css/main.css"],names:[],mappings:"AACA,wBAQE,QAAS,CAMT,qBAAsB,CAVtB,WAAY,CAEZ,MAAO,CAGP,QAAS,CAET,eAAgB,CAChB,iBAAkB,CAVlB,cAAe,CAKf,OAAQ,CASR,oBAAqB,CADrB,iBAAkB,CAVlB,KAAM,CAQN,wBAAiB,CAAjB,qBAAiB,CAAjB,gBAAiB,CAVjB,UAAW,CAFX,iBAgBF,CAEA,2CAEE,YAAa,CADb,OAEF,CAEA,0BACE,wHAEF,CAEA,0BACE,gBACF,CAEA,yBAGE,mBAAoB,CAFpB,iBAAkB,CAClB,wBAAiB,CAAjB,qBAAiB,CAAjB,gBAEF,CAEA,oCACE,WACF,CAEA,4BAEE,eAAgB,CADhB,eAEF,CAEA,2BACE,gBAAiB,CACjB,gBAAiB,CACjB,QAAS,CACT,SACF,CAEA,2BAEE,eAAgB,CADhB,oBAEF,CAEA,yBACE,gBACF,CAEA,qBAEE,wBAA0B,CAD1B,yBAEF,CAKA,yBACE,yBACE,WACF,CAEA,4BAEE,0BAA4B,CAD5B,gBAEF,CAEA,yBACE,uBAAwB,CACxB,uCACF,CAEA,oDAEE,gBACF,CAEA,yBACE,yBACF,CACF,CAEA,yBACE,yBACE,WACF,CAEA,4BAEE,0BAA4B,CAD5B,gBAEF,CAEA,yBACE,uBACF,CAEA,oDAEE,cACF,CAEA,yBACE,yBACF,CACF,CAEA,mBAIE,6BAAoC,CAMpC,kBAAmB,CACnB,cAAe,CACf,eAAgB,CALhB,QAAS,CADT,QAAS,CAET,eAAgB,CAHhB,iBAAkB,CAJlB,cAAe,CACf,iBAAkB,CAOlB,yBAA6B,CAN7B,wBAAiB,CAAjB,qBAAiB,CAAjB,gBAAiB,CAUjB,iBACF,CAIA,iBACE,2BACF,CAIA,yBAGE,oBAAsB,CACtB,oBAAsB,CAGtB,0BAA4B,CAF5B,kBAAoB,CACpB,mBAAqB,CALrB,wBAA0B,CAO1B,2BAA6B,CAN7B,oBAOF,CAIA,WACE,yBACF,CAIA,aACE,uBAAyB,CACzB,yBACF,CAEA,aACE,uBAAyB,CACzB,0BACF,CAMA,aACE,WACF,CAEA,iBACE,eACF",sourcesContent:["/* background div */\n#calibration-background {\n z-index: 999999990;\n position: fixed;\n width: 100%;\n height: 100%;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n margin: 0;\n /* background: #eee; */\n overflow: hidden;\n overflow-y: scroll;\n user-select: none;\n box-sizing: border-box;\n text-align: center;\n scrollbar-width: none;\n}\n\n#calibration-background::-webkit-scrollbar {\n width: 0;\n display: none;\n}\n\n#calibration-background * {\n font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen,\n Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;\n}\n\n#calibration-background p {\n line-height: 150%;\n}\n\n.calibration-instruction {\n position: absolute;\n user-select: none;\n pointer-events: none;\n}\n\n.calibration-instruction-scrollable {\n height: 200%;\n}\n\n.calibration-instruction h1 {\n min-width: 360px;\n font-weight: 700;\n}\n\n.calibration-instruction * {\n font-size: 1.2rem;\n line-height: 170%;\n margin: 0;\n padding: 0;\n}\n\n.calibration-instruction p {\n white-space: pre-line;\n margin-top: 1rem;\n}\n\n.calibration-description {\n line-height: 170%;\n}\n\n.rc-hang-description {\n margin-top: 50vh !important;\n font-size: 1rem !important;\n}\n\n/* -------------------------------------------------------------------------- */\n/* Screen size specific */\n\n@media (min-width: 481px) {\n .calibration-instruction {\n margin: 2rem;\n }\n\n .calibration-instruction h1 {\n line-height: 100%;\n font-size: 2.5rem !important;\n }\n\n .calibration-description {\n width: calc(100% - 4rem);\n width: max(min(100% - 4rem, 960px), 300px);\n }\n\n .calibration-description,\n .calibration-description * {\n font-size: 1.2rem;\n }\n\n .calibration-credit-text {\n font-size: 0.9rem !important;\n }\n}\n\n@media (max-width: 480px) {\n .calibration-instruction {\n margin: 1rem;\n }\n\n .calibration-instruction h1 {\n line-height: 120%;\n font-size: 1.8rem !important;\n }\n\n .calibration-description {\n width: calc(100% - 1rem);\n }\n\n .calibration-description,\n .calibration-description * {\n font-size: 1rem;\n }\n\n .calibration-credit-text {\n font-size: 0.7rem !important;\n }\n}\n\n.float-instruction {\n position: fixed;\n text-align: center;\n user-select: none;\n background: rgba(255, 255, 255, 0.9);\n padding: 10px 17px;\n margin: 0;\n left: 50%;\n max-width: 25rem;\n transform: translate(-50%, 0);\n border-radius: 10px;\n font-size: 1rem;\n font-weight: 500;\n z-index: 999999991;\n}\n\n/* -------------------------------------------------------------------------- */\n\n.swal2-container {\n z-index: 999999999 !important;\n}\n\n/* -------------------------------------------------------------------------- */\n\n.calibration-credit-text {\n position: fixed !important;\n width: 100% !important;\n bottom: 3px !important;\n color: #999 !important;\n margin: 0 !important;\n padding: 0 !important;\n line-height: 100% !important;\n text-align: center !important;\n}\n\n/* -------------------------------------------------------------------------- */\n\n.lock-view {\n overflow: hidden !important;\n}\n\n/* -------------------------------------------------------------------------- */\n\n.rc-lang-ltr {\n direction: ltr !important;\n text-align: left !important;\n}\n\n.rc-lang-rtl {\n direction: rtl !important;\n text-align: right !important;\n}\n\n/* -------------------------------------------------------------------------- */\n/* --------------------------------- CURSOR --------------------------------- */\n/* -------------------------------------------------------------------------- */\n\n.cursor-grab {\n cursor: grab;\n}\n\n.cursor-grabbing {\n cursor: grabbing;\n}\n"],sourceRoot:""}]);const o=i},2535:(e,t,n)=>{"use strict";n.d(t,{A:()=>o});var s=n(1354),r=n.n(s),a=n(6314),i=n.n(a)()(r());i.push([e.id,".swal2-container{font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen,Ubuntu,Cantarell,Open Sans,Helvetica Neue,sans-serif!important}.my__swal2__icon{font-weight:700!important;-webkit-user-select:none!important;-moz-user-select:none!important;user-select:none!important}.my__swal2__icon *{color:#ff9a00!important}.my__swal2__title{color:#000!important;font-size:2rem!important;font-weight:700!important}.my__swal2__html,.my__swal2__title{-webkit-user-select:none!important;-moz-user-select:none!important;user-select:none!important}.my__swal2__html{color:#444!important;font-size:1.2rem!important;font-weight:400!important;line-height:150%!important;margin:1.6rem}.my__swal2__html__center{text-align:center!important}.animate__animated.animate__fadeInUp,.animate__animated.animate__fadeOutDown{--animate-duration:400ms!important;--animate-delay:0!important}.fadeInUp,.fadeOutDown{animation-delay:0!important;animation-duration:.4s!important}","",{version:3,sources:["webpack://./src/css/swal.css"],names:[],mappings:"AAAA,iBACE,kIAEF,CAEA,iBACE,yBAA4B,CAC5B,kCAA4B,CAA5B,+BAA4B,CAA5B,0BACF,CAEA,mBACE,uBACF,CAEA,kBACE,oBAAsB,CACtB,wBAA0B,CAC1B,yBAEF,CAEA,mCAHE,kCAA4B,CAA5B,+BAA4B,CAA5B,0BAUF,CAPA,iBAEE,oBAAsB,CACtB,0BAA4B,CAE5B,yBAA8B,CAD9B,0BAA4B,CAH5B,aAMF,CAEA,yBACE,2BACF,CAEA,6EAEE,kCAAoC,CACpC,2BACF,CAEA,uBAGE,2BAA6B,CAD7B,gCAEF",sourcesContent:[".swal2-container {\n font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen,\n Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif !important;\n}\n\n.my__swal2__icon {\n font-weight: bold !important;\n user-select: none !important;\n}\n\n.my__swal2__icon * {\n color: #ff9a00 !important;\n}\n\n.my__swal2__title {\n color: #000 !important;\n font-size: 2rem !important;\n font-weight: bold !important;\n user-select: none !important;\n}\n\n.my__swal2__html {\n margin: 1.6rem;\n color: #444 !important;\n font-size: 1.2rem !important;\n line-height: 150% !important;\n font-weight: normal !important;\n user-select: none !important;\n}\n\n.my__swal2__html__center {\n text-align: center !important;\n}\n\n.animate__animated.animate__fadeInUp,\n.animate__animated.animate__fadeOutDown {\n --animate-duration: 400ms !important;\n --animate-delay: 0 !important;\n}\n\n.fadeInUp,\n.fadeOutDown {\n animation-duration: 400ms !important;\n animation-delay: 0 !important;\n}\n"],sourceRoot:""}]);const o=i},6314:e=>{"use strict";e.exports=function(e){var t=[];return t.toString=function(){return this.map((function(t){var n="",s=void 0!==t[5];return t[4]&&(n+="@supports (".concat(t[4],") {")),t[2]&&(n+="@media ".concat(t[2]," {")),s&&(n+="@layer".concat(t[5].length>0?" ".concat(t[5]):""," {")),n+=e(t),s&&(n+="}"),t[2]&&(n+="}"),t[4]&&(n+="}"),n})).join("")},t.i=function(e,n,s,r,a){"string"==typeof e&&(e=[[null,e,void 0]]);var i={};if(s)for(var o=0;o0?" ".concat(c[5]):""," {").concat(c[1],"}")),c[5]=a),n&&(c[2]?(c[1]="@media ".concat(c[2]," {").concat(c[1],"}"),c[2]=n):c[2]=n),r&&(c[4]?(c[1]="@supports (".concat(c[4],") {").concat(c[1],"}"),c[4]=r):c[4]="".concat(r)),t.push(c))}},t}},1354:e=>{"use strict";e.exports=function(e){var t=e[1],n=e[3];if(!n)return t;if("function"==typeof btoa){var s=btoa(unescape(encodeURIComponent(JSON.stringify(n)))),r="sourceMappingURL=data:application/json;charset=utf-8;base64,".concat(s),a="/*# ".concat(r," */");return[t].concat([a]).join("\n")}return[t].join("\n")}},7158:function(e){var t=function(){"use strict";var e,t,n,s,r,a,i,o,l,u,c,h,d,p,f,m,g,y,b,w,v,x,A,k="leader-line",C=1,S=2,E=3,_=4,I={top:C,right:S,bottom:E,left:_},T=1,N=2,O=3,R=4,D=5,M={straight:T,arc:N,fluid:O,magnet:R,grid:D},F="behind",B=k+"-defs",z='',L={disc:{elmId:"leader-line-disc",noRotate:!0,bBox:{left:-5,top:-5,width:10,height:10,right:5,bottom:5},widthR:2.5,heightR:2.5,bCircle:5,sideLen:5,backLen:5,overhead:0,outlineBase:1,outlineMax:4},square:{elmId:"leader-line-square",noRotate:!0,bBox:{left:-5,top:-5,width:10,height:10,right:5,bottom:5},widthR:2.5,heightR:2.5,bCircle:5,sideLen:5,backLen:5,overhead:0,outlineBase:1,outlineMax:4},arrow1:{elmId:"leader-line-arrow1",bBox:{left:-8,top:-8,width:16,height:16,right:8,bottom:8},widthR:4,heightR:4,bCircle:8,sideLen:8,backLen:8,overhead:8,outlineBase:2,outlineMax:1.5},arrow2:{elmId:"leader-line-arrow2",bBox:{left:-7,top:-8,width:11,height:16,right:4,bottom:8},widthR:2.75,heightR:4,bCircle:8,sideLen:8,backLen:7,overhead:4,outlineBase:1,outlineMax:1.75},arrow3:{elmId:"leader-line-arrow3",bBox:{left:-4,top:-5,width:12,height:10,right:8,bottom:5},widthR:3,heightR:2.5,bCircle:8,sideLen:5,backLen:4,overhead:8,outlineBase:1,outlineMax:2.5},hand:{elmId:"leader-line-hand",bBox:{left:-3,top:-12,width:40,height:24,right:37,bottom:12},widthR:10,heightR:6,bCircle:37,sideLen:12,backLen:3,overhead:37},crosshair:{elmId:"leader-line-crosshair",noRotate:!0,bBox:{left:-96,top:-96,width:192,height:192,right:96,bottom:96},widthR:48,heightR:48,bCircle:96,sideLen:96,backLen:96,overhead:0}},P={behind:F,disc:"disc",square:"square",arrow1:"arrow1",arrow2:"arrow2",arrow3:"arrow3",hand:"hand",crosshair:"crosshair"},V={disc:"disc",square:"square",arrow1:"arrow1",arrow2:"arrow2",arrow3:"arrow3",hand:"hand",crosshair:"crosshair"},W=[C,S,E,_],U="auto",G={x:"left",y:"top",width:"width",height:"height"},q=80,j=4,H=5,$=120,K=8,X=3.75,Z=10,Y=30,Q=.5522847,J=.25*Math.PI,ee=/^\s*(\-?[\d\.]+)\s*(\%)?\s*$/,te="http://www.w3.org/2000/svg",ne="-ms-scroll-limit"in document.documentElement.style&&"-ms-ime-align"in document.documentElement.style&&!window.navigator.msPointerEnabled,se=!ne&&!!document.uniqueID,re="MozAppearance"in document.documentElement.style,ae=!(ne||re||!window.chrome||!window.CSS),ie=!(ne||se||re||ae||window.chrome||!("WebkitAppearance"in document.documentElement.style)),oe=se||ne?.2:.1,le={path:O,lineColor:"coral",lineSize:4,plugSE:[F,"arrow1"],plugSizeSE:[1,1],lineOutlineEnabled:!1,lineOutlineColor:"indianred",lineOutlineSize:.25,plugOutlineEnabledSE:[!1,!1],plugOutlineSizeSE:[1,1]},ue=(v={}.toString,x={}.hasOwnProperty.toString,A=x.call(Object),function(e){var t,n;return e&&"[object Object]"===v.call(e)&&(!(t=Object.getPrototypeOf(e))||(n=t.hasOwnProperty("constructor")&&t.constructor)&&"function"==typeof n&&x.call(n)===A)}),ce=Number.isFinite||function(e){return"number"==typeof e&&window.isFinite(e)},he=(p={ease:[.25,.1,.25,1],linear:[0,0,1,1],"ease-in":[.42,0,1,1],"ease-out":[0,0,.58,1],"ease-in-out":[.42,0,.58,1]},f=1e3/60/2,m=window.requestAnimationFrame||window.mozRequestAnimationFrame||window.webkitRequestAnimationFrame||window.msRequestAnimationFrame||function(e){setTimeout(e,f)},g=window.cancelAnimationFrame||window.mozCancelAnimationFrame||window.webkitCancelAnimationFrame||window.msCancelAnimationFrame||function(e){clearTimeout(e)},y=Number.isFinite||function(e){return"number"==typeof e&&window.isFinite(e)},b=[],w=0,{add:function(e,t,n,s,r,a,i){var o,l,u,c,h,d,m,g,y,v,x,A,k,C=++w;function S(t,n){return{value:e(n),timeRatio:t,outputRatio:n}}if("string"==typeof r&&(r=p[r]),e=e||function(){},n=this._endIndex||this._string[this._currentIndex]<"0"||"9"=this._endIndex||this._string[this._currentIndex]<"0"||"9"=this._endIndex)return null;var e=null,t=this._string[this._currentIndex];if(this._currentIndex+=1,"0"===t)e=0;else{if("1"!==t)return null;e=1}return this._skipOptionalSpacesOrDelimiter(),e}};var o=e.SVGPathElement.prototype.setAttribute,l=e.SVGPathElement.prototype.removeAttribute,u=e.Symbol?e.Symbol():"__cachedPathData",c=e.Symbol?e.Symbol():"__cachedNormalizedPathData",h=function(e,t,n,s,r,a,i,o,l,u){function c(e,t,n){return{x:e*Math.cos(n)-t*Math.sin(n),y:e*Math.sin(n)+t*Math.cos(n)}}var d,p,f,m,g,y,b,w,v,x,A,k,C,S,E,_=(d=i,Math.PI*d/180),I=[];u?(S=u[0],E=u[1],k=u[2],C=u[3]):(e=(p=c(e,t,-_)).x,t=p.y,1<(y=(m=(e-(n=(f=c(n,s,-_)).x))/2)*m/(r*r)+(g=(t-(s=f.y))/2)*g/(a*a))&&(r*=y=Math.sqrt(y),a*=y),v=(b=r*r)*(w=a*a)-b*g*g-w*m*m,x=b*g*g+w*m*m,k=(A=(o===l?-1:1)*Math.sqrt(Math.abs(v/x)))*r*g/a+(e+n)/2,C=A*-a*m/r+(t+s)/2,S=Math.asin(parseFloat(((t-C)/a).toFixed(9))),E=Math.asin(parseFloat(((s-C)/a).toFixed(9))),e120*Math.PI/180&&(T=E,N=n,O=s,E=l&&S=n.duration&&n.count&&n.loopsLeft<=1)return a=n.frames[n.lastFrame=n.reverse?0:n.frames.length-1],n.frameCallback(a.value,!0,a.timeRatio,a.outputRatio),void(n.framesStart=null);if(s>n.duration){if(r=Math.floor(s/n.duration),n.count){if(r>=n.loopsLeft)return a=n.frames[n.lastFrame=n.reverse?0:n.frames.length-1],n.frameCallback(a.value,!0,a.timeRatio,a.outputRatio),void(n.framesStart=null);n.loopsLeft-=r}n.framesStart+=n.duration*r,s=e-n.framesStart}n.reverse&&(s=n.duration-s),a=n.frames[n.lastFrame=Math.round(s/f)],!1!==n.frameCallback(a.value,!1,a.timeRatio,a.outputRatio)?t=!0:n.framesStart=null}})),t&&(d=m.call(window,ke))}function Ce(e,t){e.framesStart=Date.now(),null!=t&&(e.framesStart-=e.duration*(e.reverse?1-t:t)),e.loopsLeft=e.count,e.lastFrame=null,ke()}function Se(e,t){var n,s;return typeof e!=typeof t||(n=ue(e)?"obj":Array.isArray(e)?"array":"")!=(ue(t)?"obj":Array.isArray(t)?"array":"")||("obj"===n?Se(s=Object.keys(e).sort(),Object.keys(t).sort())||s.some((function(n){return Se(e[n],t[n])})):"array"===n?e.length!==t.length||e.some((function(e,n){return Se(e,t[n])})):e!==t)}function Ee(e){return e?ue(e)?Object.keys(e).reduce((function(t,n){return t[n]=Ee(e[n]),t}),{}):Array.isArray(e)?e.map(Ee):e:e}function _e(e){var t,n,s,r=1,a=e=(e+"").trim();function i(e){var t=1,n=ee.exec(e);return n&&(t=parseFloat(n[1]),n[2]?t=0<=t&&t<=100?t/100:1:(t<0||1=Math.abs(s)?0<=t?S:_:0<=s?E:C))}))),x.position_path!==A.position_path||x.position_lineStrokeWidth!==A.position_lineStrokeWidth||[0,1].some((function(e){return x.position_plugOverheadSE[e]!==A.position_plugOverheadSE[e]||(a=k[e],i=A.position_socketXYSE[e],a.x!==i.x||a.y!==i.y||a.socketId!==i.socketId)||(n=t[e],s=A.position_socketGravitySE[e],(r=null==n?"auto":Array.isArray(n)?"array":"number")!=(null==s?"auto":Array.isArray(s)?"array":"number")||("array"==r?n[0]!==s[0]||n[1]!==s[1]:n!==s));var n,s,r,a,i}))){switch(e.pathList.baseVal=s=[],e.pathList.animVal=null,x.position_path){case T:s.push([F(k[0]),F(k[1])]);break;case N:d="number"==typeof t[0]&&0j?(x.position_lineStrokeWidth-j)*H:0),e.socketId===C?((a=(e.y-n.y)/2)=t.x:t.dirId===a?e.y>=t.y:e.x<=t.x}function p(e,t){return t.dirId===n||t.dirId===a?e.x===t.x:e.y===t.y}function f(e){return e[0]?{contain:0,notContain:1}:{contain:1,notContain:0}}function m(e,t,n){return Math.abs(t[n]-e[n])}function g(e,t,s){return"x"===s?e.x=Y?g(l[t.notContain],l[t.contain],u[t.contain]):l[t.contain].dirId)):(s=[{x:l[0].x,y:l[0].y},{x:l[1].x,y:l[1].y}],o.forEach((function(e,t){var n=0===t?1:0,r=m(s[t],s[n],u[t]);rZ&&(l[a]-eZ&&(l[a]-es.outlineMax&&(t=s.outlineMax),t*=2*s.outlineBase,x=Xe(b,v.plugOutline_strokeWidthSE,e,t)||x,x=Xe(b,v.plugOutline_inStrokeWidthSE,e,v.plugOutline_colorTraSE[e]?t-oe/(v.line_strokeWidth/le.lineSize)/w.plugSizeSE[e]*2:t/2)||x)})),x)),(n.faces||he.line||he.plug||he.lineOutline||he.plugOutline)&&(he.faces=(C=(A=t).curStats,S=A.aplStats,E=A.events,_=!1,!C.line_altColor&&Xe(A,S,"line_color",k=C.line_color,E.apl_line_color)&&(A.lineFace.style.stroke=k,_=!0),Xe(A,S,"line_strokeWidth",k=C.line_strokeWidth,E.apl_line_strokeWidth)&&(A.lineShape.style.strokeWidth=k+"px",_=!0,(re||se)&&(qe(A,A.lineShape),se&&(qe(A,A.lineFace),qe(A,A.lineMaskCaps)))),Xe(A,S,"lineOutline_enabled",k=C.lineOutline_enabled,E.apl_lineOutline_enabled)&&(A.lineOutlineFace.style.display=k?"inline":"none",_=!0),C.lineOutline_enabled&&(Xe(A,S,"lineOutline_color",k=C.lineOutline_color,E.apl_lineOutline_color)&&(A.lineOutlineFace.style.stroke=k,_=!0),Xe(A,S,"lineOutline_strokeWidth",k=C.lineOutline_strokeWidth,E.apl_lineOutline_strokeWidth)&&(A.lineOutlineMaskShape.style.strokeWidth=k+"px",_=!0,se&&(qe(A,A.lineOutlineMaskCaps),qe(A,A.lineOutlineFace))),Xe(A,S,"lineOutline_inStrokeWidth",k=C.lineOutline_inStrokeWidth,E.apl_lineOutline_inStrokeWidth)&&(A.lineMaskShape.style.strokeWidth=k+"px",_=!0,se&&(qe(A,A.lineOutlineMaskCaps),qe(A,A.lineOutlineFace)))),Xe(A,S,"plug_enabled",k=C.plug_enabled,E.apl_plug_enabled)&&(A.plugsFace.style.display=k?"inline":"none",_=!0),C.plug_enabled&&[0,1].forEach((function(e){var t=C.plug_plugSE[e],n=t!==F?L[V[t]]:null,s=$e(e,n);Xe(A,S.plug_enabledSE,e,k=C.plug_enabledSE[e],E.apl_plug_enabledSE)&&(A.plugsFace.style[s.prop]=k?"url(#"+A.plugMarkerIdSE[e]+")":"none",_=!0),C.plug_enabledSE[e]&&(Xe(A,S.plug_plugSE,e,t,E.apl_plug_plugSE)&&(A.plugFaceSE[e].href.baseVal="#"+n.elmId,He(A,A.plugMarkerSE[e],s.orient,n.bBox,A.svg,A.plugMarkerShapeSE[e],A.plugsFace),_=!0,re&&qe(A,A.plugsFace)),Xe(A,S.plug_colorSE,e,k=C.plug_colorSE[e],E.apl_plug_colorSE)&&(A.plugFaceSE[e].style.fill=k,_=!0,(ae||ie||se)&&!C.line_colorTra&&qe(A,se?A.lineMaskCaps:A.capsMaskLine)),["markerWidth","markerHeight"].forEach((function(t){var n="plug_"+t+"SE";Xe(A,S[n],e,k=C[n][e],E["apl_"+n])&&(A.plugMarkerSE[e][t].baseVal.value=k,_=!0)})),Xe(A,S.plugOutline_enabledSE,e,k=C.plugOutline_enabledSE[e],E.apl_plugOutline_enabledSE)&&(k?(A.plugFaceSE[e].style.mask="url(#"+A.plugMaskIdSE[e]+")",A.plugOutlineFaceSE[e].style.display="inline"):(A.plugFaceSE[e].style.mask="none",A.plugOutlineFaceSE[e].style.display="none"),_=!0),C.plugOutline_enabledSE[e]&&(Xe(A,S.plugOutline_plugSE,e,t,E.apl_plugOutline_plugSE)&&(A.plugOutlineFaceSE[e].href.baseVal=A.plugMaskShapeSE[e].href.baseVal=A.plugOutlineMaskShapeSE[e].href.baseVal="#"+n.elmId,[A.plugMaskSE[e],A.plugOutlineMaskSE[e]].forEach((function(e){e.x.baseVal.value=n.bBox.left,e.y.baseVal.value=n.bBox.top,e.width.baseVal.value=n.bBox.width,e.height.baseVal.value=n.bBox.height})),_=!0),Xe(A,S.plugOutline_colorSE,e,k=C.plugOutline_colorSE[e],E.apl_plugOutline_colorSE)&&(A.plugOutlineFaceSE[e].style.fill=k,_=!0,se&&(qe(A,A.lineMaskCaps),qe(A,A.lineOutlineMaskCaps))),Xe(A,S.plugOutline_strokeWidthSE,e,k=C.plugOutline_strokeWidthSE[e],E.apl_plugOutline_strokeWidthSE)&&(A.plugOutlineMaskShapeSE[e].style.strokeWidth=k+"px",_=!0),Xe(A,S.plugOutline_inStrokeWidthSE,e,k=C.plugOutline_inStrokeWidthSE[e],E.apl_plugOutline_inStrokeWidthSE)&&(A.plugMaskShapeSE[e].style.strokeWidth=k+"px",_=!0)))})),_)),(n.position||he.line||he.plug)&&(he.position=Qe(t)),(n.path||he.position)&&(he.path=(N=(I=t).curStats,O=I.aplStats,R=I.pathList.animVal||I.pathList.baseVal,D=N.path_edge,M=!1,R&&(D.x1=D.x2=R[0][0].x,D.y1=D.y2=R[0][0].y,N.path_pathData=T=Le(R,(function(e){e.xD.x2&&(D.x2=e.x),e.y>D.y2&&(D.y2=e.y)})),Ve(T,O.path_pathData)&&(I.linePath.setPathData(T),O.path_pathData=T,M=!0,se?(qe(I,I.plugsFace),qe(I,I.lineMaskCaps)):re&&qe(I,I.linePath),I.events.apl_path&&I.events.apl_path.forEach((function(e){e(I,T)})))),M)),he.viewBox=(z=(B=t).curStats,P=B.aplStats,W=z.path_edge,U=z.viewBox_bBox,q=P.viewBox_bBox,j=B.svg.viewBox.baseVal,H=B.svg.style,$=!1,K=Math.max(z.line_strokeWidth/2,z.viewBox_plugBCircleSE[0]||0,z.viewBox_plugBCircleSE[1]||0),X={x1:W.x1-K,y1:W.y1-K,x2:W.x2+K,y2:W.y2+K},B.events.new_edge4viewBox&&B.events.new_edge4viewBox.forEach((function(e){e(B,X)})),U.x=z.lineMask_x=z.lineOutlineMask_x=z.maskBGRect_x=X.x1,U.y=z.lineMask_y=z.lineOutlineMask_y=z.maskBGRect_y=X.y1,U.width=X.x2-X.x1,U.height=X.y2-X.y1,["x","y","width","height"].forEach((function(e){var t;(t=U[e])!==q[e]&&(j[e]=q[e]=t,H[G[e]]=t+("x"===e||"y"===e?B.bodyOffset[e]:0)+"px",$=!0)})),$),he.mask=(Q=(Z=t).curStats,J=Z.aplStats,ee=!1,Q.plug_enabled?[0,1].forEach((function(e){Q.capsMaskMarker_enabledSE[e]=Q.plug_enabledSE[e]&&Q.plug_colorTraSE[e]||Q.plugOutline_enabledSE[e]&&Q.plugOutline_colorTraSE[e]})):Q.capsMaskMarker_enabledSE[0]=Q.capsMaskMarker_enabledSE[1]=!1,Q.capsMaskMarker_enabled=Q.capsMaskMarker_enabledSE[0]||Q.capsMaskMarker_enabledSE[1],Q.lineMask_outlineMode=Q.lineOutline_enabled,Q.caps_enabled=Q.capsMaskMarker_enabled||Q.capsMaskAnchor_enabledSE[0]||Q.capsMaskAnchor_enabledSE[1],Q.lineMask_enabled=Q.caps_enabled||Q.lineMask_outlineMode,(Q.lineMask_enabled&&!Q.lineMask_outlineMode||Q.lineOutline_enabled)&&["x","y"].forEach((function(e){var t="maskBGRect_"+e;Xe(Z,J,t,Y=Q[t])&&(Z.maskBGRect[e].baseVal.value=Y,ee=!0)})),Xe(Z,J,"lineMask_enabled",Y=Q.lineMask_enabled)&&(Z.lineFace.style.mask=Y?"url(#"+Z.lineMaskId+")":"none",ee=!0,ie&&qe(Z,Z.lineMask)),Q.lineMask_enabled&&(Xe(Z,J,"lineMask_outlineMode",Y=Q.lineMask_outlineMode)&&(Y?(Z.lineMaskBG.style.display="none",Z.lineMaskShape.style.display="inline"):(Z.lineMaskBG.style.display="inline",Z.lineMaskShape.style.display="none"),ee=!0),["x","y"].forEach((function(e){var t="lineMask_"+e;Xe(Z,J,t,Y=Q[t])&&(Z.lineMask[e].baseVal.value=Y,ee=!0)})),Xe(Z,J,"caps_enabled",Y=Q.caps_enabled)&&(Z.lineMaskCaps.style.display=Z.lineOutlineMaskCaps.style.display=Y?"inline":"none",ee=!0,ie&&qe(Z,Z.capsMaskLine)),Q.caps_enabled&&([0,1].forEach((function(e){var t;Xe(Z,J.capsMaskAnchor_enabledSE,e,Y=Q.capsMaskAnchor_enabledSE[e])&&(Z.capsMaskAnchorSE[e].style.display=Y?"inline":"none",ee=!0,ie&&qe(Z,Z.lineMask)),Q.capsMaskAnchor_enabledSE[e]&&(Ve(t=Q.capsMaskAnchor_pathDataSE[e],J.capsMaskAnchor_pathDataSE[e])&&(Z.capsMaskAnchorSE[e].setPathData(t),J.capsMaskAnchor_pathDataSE[e]=t,ee=!0),Xe(Z,J.capsMaskAnchor_strokeWidthSE,e,Y=Q.capsMaskAnchor_strokeWidthSE[e])&&(Z.capsMaskAnchorSE[e].style.strokeWidth=Y+"px",ee=!0))})),Xe(Z,J,"capsMaskMarker_enabled",Y=Q.capsMaskMarker_enabled)&&(Z.capsMaskLine.style.display=Y?"inline":"none",ee=!0),Q.capsMaskMarker_enabled&&[0,1].forEach((function(e){var t=Q.capsMaskMarker_plugSE[e],n=t!==F?L[V[t]]:null,s=$e(e,n);Xe(Z,J.capsMaskMarker_enabledSE,e,Y=Q.capsMaskMarker_enabledSE[e])&&(Z.capsMaskLine.style[s.prop]=Y?"url(#"+Z.lineMaskMarkerIdSE[e]+")":"none",ee=!0),Q.capsMaskMarker_enabledSE[e]&&(Xe(Z,J.capsMaskMarker_plugSE,e,t)&&(Z.capsMaskMarkerShapeSE[e].href.baseVal="#"+n.elmId,He(Z,Z.capsMaskMarkerSE[e],s.orient,n.bBox,Z.svg,Z.capsMaskMarkerShapeSE[e],Z.capsMaskLine),ee=!0,re&&(qe(Z,Z.capsMaskLine),qe(Z,Z.lineFace))),["markerWidth","markerHeight"].forEach((function(t){var n="capsMaskMarker_"+t+"SE";Xe(Z,J[n],e,Y=Q[n][e])&&(Z.capsMaskMarkerSE[e][t].baseVal.value=Y,ee=!0)})))})))),Q.lineOutline_enabled&&["x","y"].forEach((function(e){var t="lineOutlineMask_"+e;Xe(Z,J,t,Y=Q[t])&&(Z.lineOutlineMask[e].baseVal.value=Y,ee=!0)})),ee),n.effect&&(ue=(te=t).curStats,ce=te.aplStats,Object.keys(e).forEach((function(t){var n=e[t],s=t+"_enabled",r=t+"_options",a=ue[r];Xe(te,ce,s,ne=ue[s])?(ne&&(ce[r]=Ee(a)),n[ne?"init":"remove"](te)):ne&&Se(a,ce[r])&&(n.remove(te),ce[s]=!0,ce[r]=Ee(a),n.init(te))}))),(ae||ie)&&he.line&&!he.path&&qe(t,t.lineShape),ae&&he.plug&&!he.line&&qe(t,t.plugsFace),je(t)}function tt(e,t){return{duration:ce(e.duration)&&0t.x2&&(t.x2=s.x2),s.y2>t.y2&&(t.y2=s.y2),["x","y"].forEach((function(n){var s,i="dropShadow_"+n;r[i]=s=t[n+"1"],Xe(e,a,i,s)&&(e.efc_dropShadow_elmFilter[n].baseVal.value=s)})))}}},Object.keys(e).forEach((function(t){var n=e[t],s=n.stats;s[t+"_enabled"]={iniValue:!1},s[t+"_options"]={hasProps:!0},n.anim&&(s[t+"_animOptions"]={},s[t+"_animId"]={})})),t={none:{defaultAnimOptions:{},init:function(e,n){var s=e.curStats;s.show_animId&&(he.remove(s.show_animId),s.show_animId=null),t.none.start(e,n)},start:function(e,n){t.none.stop(e,!0)},stop:function(e,t,n){var s=e.curStats;return n=null!=n?n:e.aplStats.show_on,s.show_inAnim=!1,t&&Je(e,n),n?1:0}},fade:{defaultAnimOptions:{duration:300,timing:"linear"},init:function(e,n){var s=e.curStats,r=e.aplStats;s.show_animId&&he.remove(s.show_animId),s.show_animId=he.add((function(e){return e}),(function(n,s){s?t.fade.stop(e,!0):(e.svg.style.opacity=n+"",se&&(qe(e,e.svg),je(e)))}),r.show_animOptions.duration,1,r.show_animOptions.timing,null,!1),t.fade.start(e,n)},start:function(e,t){var n,s=e.curStats;s.show_inAnim&&(n=he.stop(s.show_animId)),Je(e,1),s.show_inAnim=!0,he.start(s.show_animId,!e.aplStats.show_on,null!=t?t:n)},stop:function(e,t,n){var s,r=e.curStats;return n=null!=n?n:e.aplStats.show_on,s=r.show_inAnim?he.stop(r.show_animId):n?1:0,r.show_inAnim=!1,t&&(e.svg.style.opacity=n?"":"0",Je(e,n)),s}},draw:{defaultAnimOptions:{duration:500,timing:[.58,0,.42,1]},init:function(e,n){var s=e.curStats,r=e.aplStats,a=e.pathList.baseVal,i=Pe(a),o=i.segsLen,l=i.lenAll;s.show_animId&&he.remove(s.show_animId),s.show_animId=he.add((function(e){var t,n,s,r,i=-1;if(0===e)n=[[a[0][0],a[0][0]]];else if(1===e)n=a;else{for(t=l*e,n=[];t>=o[++i];)n.push(a[i]),t-=o[i];t&&(2===(s=a[i]).length?n.push([s[0],De(s[0],s[1],t/o[i])]):(r=Fe(s[0],s[1],s[2],s[3],ze(s[0],s[1],s[2],s[3],t)),n.push([s[0],r.fromP1,r.fromP2,r])))}return n}),(function(n,s){s?t.draw.stop(e,!0):(e.pathList.animVal=n,et(e,{path:!0}))}),r.show_animOptions.duration,1,r.show_animOptions.timing,null,!1),t.draw.start(e,n)},start:function(e,n){var s,r=e.curStats;r.show_inAnim&&(s=he.stop(r.show_animId)),Je(e,1),r.show_inAnim=!0,We(e,"apl_position",t.draw.update),he.start(r.show_animId,!e.aplStats.show_on,null!=n?n:s)},stop:function(e,t,n){var s,r=e.curStats;return n=null!=n?n:e.aplStats.show_on,s=r.show_inAnim?he.stop(r.show_animId):n?1:0,r.show_inAnim=!1,t&&(e.pathList.animVal=n?null:[[e.pathList.baseVal[0][0],e.pathList.baseVal[0][0]]],et(e,{path:!0}),Je(e,n)),s},update:function(e){Ue(e,"apl_position",t.draw.update),e.curStats.show_inAnim?t.draw.init(e,t.draw.stop(e)):e.aplStats.show_animOptions={}}}},[["start","anchorSE",0],["end","anchorSE",1],["color","lineColor"],["size","lineSize"],["startSocketGravity","socketGravitySE",0],["endSocketGravity","socketGravitySE",1],["startPlugColor","plugColorSE",0],["endPlugColor","plugColorSE",1],["startPlugSize","plugSizeSE",0],["endPlugSize","plugSizeSE",1],["outline","lineOutlineEnabled"],["outlineColor","lineOutlineColor"],["outlineSize","lineOutlineSize"],["startPlugOutline","plugOutlineEnabledSE",0],["endPlugOutline","plugOutlineEnabledSE",1],["startPlugOutlineColor","plugOutlineColorSE",0],["endPlugOutlineColor","plugOutlineColorSE",1],["startPlugOutlineSize","plugOutlineSizeSE",0],["endPlugOutlineSize","plugOutlineSizeSE",1]].forEach((function(e){var t=e[0],n=e[1],s=e[2];Object.defineProperty(it.prototype,t,{get:function(){var e=null!=s?be[this._id].options[n][s]:n?be[this._id].options[n]:be[this._id].options[t];return null==e?U:Ee(e)},set:ot(t),enumerable:!0})})),[["path",M],["startSocket",I,"socketSE",0],["endSocket",I,"socketSE",1],["startPlug",P,"plugSE",0],["endPlug",P,"plugSE",1]].forEach((function(e){var t=e[0],n=e[1],s=e[2],r=e[3];Object.defineProperty(it.prototype,t,{get:function(){var e,a=null!=r?be[this._id].options[s][r]:s?be[this._id].options[s]:be[this._id].options[t];return a?Object.keys(n).some((function(t){return n[t]===a&&(e=t,!0)}))?e:new Error("It's broken"):U},set:ot(t),enumerable:!0})})),Object.keys(e).forEach((function(t){var n=e[t];Object.defineProperty(it.prototype,t,{get:function(){var e,s,r=be[this._id].options[t];return ue(r)?(e=r,s=n.optionsConf.reduce((function(t,n){var s,r=n[0],a=n[1],i=n[2],o=n[3],l=n[4],u=null!=l?e[o][l]:o?e[o]:e[a];return t[a]="id"===r?u?Object.keys(i).some((function(e){return i[e]===u&&(s=e,!0)}))?s:new Error("It's broken"):U:null==u?U:Ee(u),t}),{}),n.anim&&(s.animation=Ee(e.animation)),s):r},set:ot(t),enumerable:!0})})),["startLabel","endLabel","middleLabel"].forEach((function(e,t){Object.defineProperty(it.prototype,e,{get:function(){var e=be[this._id],n=e.options;return n.labelSEM[t]&&!e.optionIsAttach.labelSEM[t]?ve[n.labelSEM[t]._id].text:n.labelSEM[t]||""},set:ot(e),enumerable:!0})})),it.prototype.setOptions=function(e){return at(be[this._id],e),this},it.prototype.position=function(){return et(be[this._id],{position:!0}),this},it.prototype.remove=function(){var t=be[this._id],n=t.curStats;Object.keys(e).forEach((function(e){var t=e+"_animId";n[t]&&he.remove(n[t])})),n.show_animId&&he.remove(n.show_animId),t.attachments.slice().forEach((function(e){rt(t,e)})),t.baseWindow&&t.svg&&t.baseWindow.document.body.removeChild(t.svg),delete be[this._id]},it.prototype.show=function(e,t){return nt(be[this._id],!0,e,t),this},it.prototype.hide=function(e,t){return nt(be[this._id],!1,e,t),this},a=function(e){e&&ve[e._id]&&(e.boundTargets.slice().forEach((function(t){rt(t.props,e,!0)})),e.conf.remove&&e.conf.remove(e),delete ve[e._id])},lt.prototype.remove=function(){var e=this,t=ve[e._id];t&&(t.boundTargets.slice().forEach((function(e){t.conf.removeOption(t,e)})),Ge((function(){var t=ve[e._id];t&&a(t)})))},s=lt,window.LeaderLineAttachment=s,r=function(e,t){return e instanceof s&&(!(e.isRemoved||t&&ve[e._id].conf.type!==t)||null)},n={pointAnchor:{type:"anchor",argOptions:[{optionName:"element",type:Ie}],init:function(e,t){return e.element=n.pointAnchor.checkElement(t.element),e.x=n.pointAnchor.parsePercent(t.x,!0)||[.5,!0],e.y=n.pointAnchor.parsePercent(t.y,!0)||[.5,!0],!0},removeOption:function(e,t){var r=t.props,a={},i=e.element,o=r.options.anchorSE["start"===t.optionName?1:0];i===o&&(i=o===document.body?new s(n.pointAnchor,[i]):document.body),a[t.optionName]=i,at(r,a)},getBBoxNest:function(e,t){var n=Oe(e.element,t.baseWindow),s=n.width,r=n.height;return n.width=n.height=0,n.left=n.right=n.left+e.x[0]*(e.x[1]?s:1),n.top=n.bottom=n.top+e.y[0]*(e.y[1]?r:1),n},parsePercent:function(e,t){var n,s,r=!1;return ce(e)?s=e:"string"==typeof e&&(n=ee.exec(e))&&n[2]&&(r=0!=(s=parseFloat(n[1])/100)),null!=s&&(t||0<=s)?[s,r]:null},checkElement:function(e){if(null==e)e=document.body;else if(!Ie(e))throw new Error("`element` must be Element");return e}},areaAnchor:{type:"anchor",argOptions:[{optionName:"element",type:Ie},{optionName:"shape",type:"string"}],stats:{color:{},strokeWidth:{},elementWidth:{},elementHeight:{},elementLeft:{},elementTop:{},pathListRel:{},bBoxRel:{},pathData:{},viewBoxBBox:{hasProps:!0},dashLen:{},dashGap:{}},init:function(e,t){var s,r,a,i=[];return e.element=n.pointAnchor.checkElement(t.element),"string"==typeof t.color&&(e.color=t.color.trim()),"string"==typeof t.fillColor&&(e.fill=t.fillColor.trim()),ce(t.size)&&0<=t.size&&(e.size=t.size),t.dash&&(e.dash=!0,ce(t.dash.len)&&0s.right&&(s.right=n),as.bottom&&(s.bottom=a)):s={left:n,right:n,top:a,bottom:a},r?D.pathListRel.push([r,{x:n,y:a}]):D.pathListRel=[],r={x:n,y:a}})),D.pathListRel.push([]),a=D.strokeWidth/2,i=[{x:s.left-a,y:s.top-a},{x:s.right+a,y:s.bottom+a}],D.bBoxRel={left:i[0].x,top:i[0].y,right:i[1].x,bottom:i[1].y,width:i[1].x-i[0].x,height:i[1].y-i[0].y}}B.pathListRel=B.bBoxRel=!0}return(B.pathListRel||B.elementLeft||B.elementTop)&&(D.pathData=Le(D.pathListRel,(function(e){e.x+=t.left,e.y+=t.top}))),Xe(e,M,"strokeWidth",n=D.strokeWidth)&&(e.path.style.strokeWidth=n+"px"),Ve(n=D.pathData,M.pathData)&&(e.path.setPathData(n),M.pathData=n,B.pathData=!0),e.dash&&(!B.pathData&&(!B.strokeWidth||e.dashLen&&e.dashGap)||(D.dashLen=e.dashLen||2*D.strokeWidth,D.dashGap=e.dashGap||D.strokeWidth),B.dash=Xe(e,M,"dashLen",D.dashLen)||B.dash,B.dash=Xe(e,M,"dashGap",D.dashGap)||B.dash,B.dash&&(e.path.style.strokeDasharray=M.dashLen+","+M.dashGap)),T=D.viewBoxBBox,N=M.viewBoxBBox,O=e.svg.viewBox.baseVal,R=e.svg.style,T.x=D.bBoxRel.left+t.left,T.y=D.bBoxRel.top+t.top,T.width=D.bBoxRel.width,T.height=D.bBoxRel.height,["x","y","width","height"].forEach((function(t){(n=T[t])!==N[t]&&(O[t]=N[t]=n,R[G[t]]=n+("x"===t||"y"===t?e.bodyOffset[t]:0)+"px")})),B.strokeWidth||B.pathListRel||B.bBoxRel}},mouseHoverAnchor:{type:"anchor",argOptions:[{optionName:"element",type:Ie},{optionName:"showEffectName",type:"string"}],style:{backgroundImage:"url('data:image/svg+xml;charset=utf-8;base64,PHN2ZyB2ZXJzaW9uPSIxLjEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgd2lkdGg9IjI0IiBoZWlnaHQ9IjI0Ij48cG9seWdvbiBwb2ludHM9IjI0LDAgMCw4IDgsMTEgMCwxOSA1LDI0IDEzLDE2IDE2LDI0IiBmaWxsPSJjb3JhbCIvPjwvc3ZnPg==')",backgroundSize:"",backgroundRepeat:"no-repeat",backgroundColor:"#f8f881",cursor:"default"},hoverStyle:{backgroundImage:"none",backgroundColor:"#fadf8f"},padding:{top:1,right:15,bottom:1,left:2},minHeight:15,backgroundPosition:{right:2,top:2},backgroundSize:{width:12,height:12},dirKeys:[["top","Top"],["right","Right"],["bottom","Bottom"],["left","Left"]],init:function(e,s){var r,a,i,o,l,u,c,h,d,p,f,m=n.mouseHoverAnchor,g={};if(e.element=n.pointAnchor.checkElement(s.element),!((p=(h=e.element).ownerDocument)&&(d=p.defaultView)&&d.HTMLElement&&h instanceof d.HTMLElement))throw new Error("`element` must be HTML element");return m.style.backgroundSize=m.backgroundSize.width+"px "+m.backgroundSize.height+"px",["style","hoverStyle"].forEach((function(t){var n=m[t];e[t]=Object.keys(n).reduce((function(e,t){return e[t]=n[t],e}),{})})),"inline"===(r=e.element.ownerDocument.defaultView.getComputedStyle(e.element,"")).display?e.style.display="inline-block":"none"===r.display&&(e.style.display="block"),n.mouseHoverAnchor.dirKeys.forEach((function(t){var n=t[0],s="padding"+t[1];parseFloat(r[s])e.x2&&(e.x2=s.x2),s.y2>e.y2&&(e.y2=s.y2)},newText:function(e,t,n,s,r){var a,i,o,u,c,h=t.createElementNS(te,"text");return h.textContent=e,[h.x,h.y].forEach((function(e){var t=n.createSVGLength();t.newValueSpecifiedUnits(SVGLength.SVG_LENGTHTYPE_PX,0),e.baseVal.initialize(t)})),"boolean"!=typeof l&&(l="paintOrder"in h.style),r&&!l?(i=t.createElementNS(te,"defs"),h.id=s,i.appendChild(h),(u=(a=t.createElementNS(te,"g")).appendChild(t.createElementNS(te,"use"))).href.baseVal="#"+s,(o=a.appendChild(t.createElementNS(te,"use"))).href.baseVal="#"+s,(c=u.style).strokeLinejoin="round",{elmPosition:h,styleText:h.style,styleFill:o.style,styleStroke:c,styleShow:a.style,elmsAppend:[i,a]}):(c=h.style,r&&(c.strokeLinejoin="round",c.paintOrder="stroke"),{elmPosition:h,styleText:c,styleFill:c,styleStroke:r?c:null,styleShow:c,elmsAppend:[h]})},getMidPoint:function(e,t){var n,s,r=Pe(e),a=r.segsLen,i=r.lenAll,o=-1,l=i/2+(t||0);if(l<=0)return 2===(n=e[0]).length?De(n[0],n[1],0):Fe(n[0],n[1],n[2],n[3],0);if(i<=l)return 2===(n=e[e.length-1]).length?De(n[0],n[1],1):Fe(n[0],n[1],n[2],n[3],1);for(s=[];l>a[++o];)s.push(e[o]),l-=a[o];return 2===(n=e[o]).length?De(n[0],n[1],l/a[o]):Fe(n[0],n[1],n[2],n[3],ze(n[0],n[1],n[2],n[3],l))},initSvg:function(e,t){var s,r,a=n.captionLabel.newText(e.text,t.baseWindow.document,t.svg,k+"-captionLabel-"+e._id,e.outlineColor);["elmPosition","styleFill","styleShow","elmsAppend"].forEach((function(t){e[t]=a[t]})),e.isShown=!1,e.styleShow.visibility="hidden",n.captionLabel.textStyleProps.forEach((function(t){null!=e[t]&&(a.styleText[t]=e[t])})),a.elmsAppend.forEach((function(e){t.svg.appendChild(e)})),s=a.elmPosition.getBBox(),e.width=s.width,e.height=s.height,e.outlineColor&&(r=10<(r=s.height/9)?10:r<2?2:r,a.styleStroke.strokeWidth=r+"px",a.styleStroke.stroke=e.outlineColor),e.strokeWidth=r||0,Ke(e.aplStats,n.captionLabel.stats),e.updateColor(t),e.refSocketXY?e.updateSocketXY(t):e.updatePath(t),ie&&et(t,{}),e.updateShow(t)},bind:function(e,t){var s=t.props;return e.color||We(s,"cur_line_color",e.updateColor),(e.refSocketXY="startLabel"===t.optionName||"endLabel"===t.optionName)?(e.socketIndex="startLabel"===t.optionName?0:1,We(s,"apl_position",e.updateSocketXY),e.offset||(We(s,"cur_attach_plugSideLenSE",e.updateSocketXY),We(s,"cur_line_strokeWidth",e.updateSocketXY))):We(s,"apl_path",e.updatePath),We(s,"svgShow",e.updateShow),ie&&We(s,"new_edge4viewBox",e.adjustEdge),n.captionLabel.initSvg(e,s),!0},unbind:function(e,t){var s=t.props;e.elmsAppend&&(e.elmsAppend.forEach((function(e){s.svg.removeChild(e)})),e.elmPosition=e.styleFill=e.styleShow=e.elmsAppend=null),Ke(e.curStats,n.captionLabel.stats),Ke(e.aplStats,n.captionLabel.stats),e.color||Ue(s,"cur_line_color",e.updateColor),e.refSocketXY?(Ue(s,"apl_position",e.updateSocketXY),e.offset||(Ue(s,"cur_attach_plugSideLenSE",e.updateSocketXY),Ue(s,"cur_line_strokeWidth",e.updateSocketXY))):Ue(s,"apl_path",e.updatePath),Ue(s,"svgShow",e.updateShow),ie&&(Ue(s,"new_edge4viewBox",e.adjustEdge),et(s,{}))},removeOption:function(e,t){var n=t.props,s={};s[t.optionName]="",at(n,s)},remove:function(e){e.boundTargets.length&&e.boundTargets.forEach((function(t){n.captionLabel.unbind(e,t)}))}},pathLabel:{type:"label",argOptions:[{optionName:"text",type:"string"}],stats:{color:{},startOffset:{},pathData:{}},init:function(e,t){return"string"==typeof t.text&&(e.text=t.text.trim()),!!e.text&&("string"==typeof t.color&&(e.color=t.color.trim()),e.outlineColor="string"==typeof t.outlineColor?t.outlineColor.trim():"#fff",ce(t.lineOffset)&&(e.lineOffset=t.lineOffset),n.captionLabel.textStyleProps.forEach((function(n){null!=t[n]&&(e[n]=t[n])})),e.updateColor=function(t){n.captionLabel.updateColor(e,t)},e.updatePath=function(t){var s,r=e.curStats,a=e.aplStats,i=t.curStats,o=t.pathList.animVal||t.pathList.baseVal;o&&(r.pathData=s=n.pathLabel.getOffsetPathData(o,i.line_strokeWidth/2+e.strokeWidth/2+e.height/4,1.25*e.height),Ve(s,a.pathData)&&(e.elmPath.setPathData(s),a.pathData=s,e.bBox=e.elmPosition.getBBox(),e.updateStartOffset(t)))},e.updateStartOffset=function(t){var n,s,r,a,i=e.curStats,o=e.aplStats,l=t.curStats;i.pathData&&(2===e.semIndex&&!e.lineOffset||(r=i.pathData.reduce((function(e,t){var n,r=t.values;switch(t.type){case"M":s={x:r[0],y:r[1]};break;case"L":n={x:r[0],y:r[1]},s&&(e+=Re(s,n)),s=n;break;case"C":n={x:r[4],y:r[5]},s&&(e+=Be(s,{x:r[0],y:r[1]},{x:r[2],y:r[3]},n)),s=n}return e}),0),a=0===e.semIndex?0:1===e.semIndex?r:r/2,2!==e.semIndex&&(n=Math.max(l.attach_plugBackLenSE[e.semIndex]||0,l.line_strokeWidth/2)+e.strokeWidth/2+e.height/4,a=(a+=0===e.semIndex?n:-n)<0?0:rt?((r=s.points)[1]=Me(r[0],r[1],-t),s.len=Re(r[0],r[1])):(s.points=null,s.len=0),e.len>t+n?((r=e.points)[0]=Me(r[1],r[0],-(t+n)),e.len=Re(r[0],r[1])):(e.points=null,e.len=0)),e):null})),a.reduce((function(e,t){var n=t.points;return n&&(r&&i(n[0],r)||e.push({type:"M",values:[n[0].x,n[0].y]}),"line"===t.type?e.push({type:"L",values:[n[1].x,n[1].y]}):(n.shift(),n.forEach((function(t){e.push({type:"L",values:[t.x,t.y]})}))),r=n[n.length-1]),e}),[])},newText:function(e,t,n,s){var r,a,i,o,u,c,h,d,p=t.createElementNS(te,"defs"),f=p.appendChild(t.createElementNS(te,"path"));return f.id=r=n+"-path",(o=(i=t.createElementNS(te,"text")).appendChild(t.createElementNS(te,"textPath"))).href.baseVal="#"+r,o.startOffset.baseVal.newValueSpecifiedUnits(SVGLength.SVG_LENGTHTYPE_PX,0),o.textContent=e,"boolean"!=typeof l&&(l="paintOrder"in i.style),s&&!l?(i.id=a=n+"-text",p.appendChild(i),(h=(u=t.createElementNS(te,"g")).appendChild(t.createElementNS(te,"use"))).href.baseVal="#"+a,(c=u.appendChild(t.createElementNS(te,"use"))).href.baseVal="#"+a,(d=h.style).strokeLinejoin="round",{elmPosition:i,elmPath:f,elmOffset:o,styleText:i.style,styleFill:c.style,styleStroke:d,styleShow:u.style,elmsAppend:[p,u]}):(d=i.style,s&&(d.strokeLinejoin="round",d.paintOrder="stroke"),{elmPosition:i,elmPath:f,elmOffset:o,styleText:d,styleFill:d,styleStroke:s?d:null,styleShow:d,elmsAppend:[p,i]})},initSvg:function(e,t){var s,r,a=n.pathLabel.newText(e.text,t.baseWindow.document,k+"-pathLabel-"+e._id,e.outlineColor);["elmPosition","elmPath","elmOffset","styleFill","styleShow","elmsAppend"].forEach((function(t){e[t]=a[t]})),e.isShown=!1,e.styleShow.visibility="hidden",n.captionLabel.textStyleProps.forEach((function(t){null!=e[t]&&(a.styleText[t]=e[t])})),a.elmsAppend.forEach((function(e){t.svg.appendChild(e)})),a.elmPath.setPathData([{type:"M",values:[0,100]},{type:"h",values:[100]}]),s=a.elmPosition.getBBox(),a.styleText.textAnchor=["start","end","middle"][e.semIndex],2!==e.semIndex||e.lineOffset||a.elmOffset.startOffset.baseVal.newValueSpecifiedUnits(SVGLength.SVG_LENGTHTYPE_PERCENTAGE,50),e.height=s.height,e.outlineColor&&(r=10<(r=s.height/9)?10:r<2?2:r,a.styleStroke.strokeWidth=r+"px",a.styleStroke.stroke=e.outlineColor),e.strokeWidth=r||0,Ke(e.aplStats,n.pathLabel.stats),e.updateColor(t),e.updatePath(t),e.updateStartOffset(t),ie&&et(t,{}),e.updateShow(t)},bind:function(e,t){var s=t.props;return e.color||We(s,"cur_line_color",e.updateColor),We(s,"cur_line_strokeWidth",e.updatePath),We(s,"apl_path",e.updatePath),e.semIndex="startLabel"===t.optionName?0:"endLabel"===t.optionName?1:2,2===e.semIndex&&!e.lineOffset||We(s,"cur_attach_plugBackLenSE",e.updateStartOffset),We(s,"svgShow",e.updateShow),ie&&We(s,"new_edge4viewBox",e.adjustEdge),n.pathLabel.initSvg(e,s),!0},unbind:function(e,t){var s=t.props;e.elmsAppend&&(e.elmsAppend.forEach((function(e){s.svg.removeChild(e)})),e.elmPosition=e.elmPath=e.elmOffset=e.styleFill=e.styleShow=e.elmsAppend=null),Ke(e.curStats,n.pathLabel.stats),Ke(e.aplStats,n.pathLabel.stats),e.color||Ue(s,"cur_line_color",e.updateColor),Ue(s,"cur_line_strokeWidth",e.updatePath),Ue(s,"apl_path",e.updatePath),2===e.semIndex&&!e.lineOffset||Ue(s,"cur_attach_plugBackLenSE",e.updateStartOffset),Ue(s,"svgShow",e.updateShow),ie&&(Ue(s,"new_edge4viewBox",e.adjustEdge),et(s,{}))},removeOption:function(e,t){var n=t.props,s={};s[t.optionName]="",at(n,s)},remove:function(e){e.boundTargets.length&&e.boundTargets.forEach((function(t){n.pathLabel.unbind(e,t)}))}}},Object.keys(n).forEach((function(e){it[e]=function(){return new s(n[e],Array.prototype.slice.call(arguments))}})),it.positionByWindowResize=!0,window.addEventListener("resize",pe.add((function(){it.positionByWindowResize&&Object.keys(be).forEach((function(e){et(be[e],{position:!0})}))})),!1),it}();e.exports=t},7503:function(e,t,n){var s;e=n.nmd(e),function(){"use strict";var r={function:!0,object:!0},a=r[typeof window]&&window||this,i=r[typeof t]&&t,o=r.object&&e&&!e.nodeType&&e,l=i&&o&&"object"==typeof n.g&&n.g;!l||l.global!==l&&l.window!==l&&l.self!==l||(a=l);var u=Math.pow(2,53)-1,c=/\bOpera/,h=Object.prototype,d=h.hasOwnProperty,p=h.toString;function f(e){return(e=String(e)).charAt(0).toUpperCase()+e.slice(1)}function m(e){return e=v(e),/^(?:webOS|i(?:OS|P))/.test(e)?e:f(e)}function g(e,t){for(var n in e)d.call(e,n)&&t(e[n],n,e)}function y(e){return null==e?f(e):p.call(e).slice(8,-1)}function b(e){return String(e).replace(/([ -])(?!$)/g,"$1?")}function w(e,t){var n=null;return function(e,t){var n=-1,s=e?e.length:0;if("number"==typeof s&&s>-1&&s<=u)for(;++n3?"WebKit":/\bOpera\b/.test(P)&&(/\bOPR\b/.test(t)?"Blink":"Presto"))||/\b(?:Midori|Nook|Safari)\b/i.test(t)&&!/^(?:Trident|EdgeHTML)$/.test(L)&&"WebKit"||!L&&/\bMSIE\b/i.test(t)&&("Mac OS"==U?"Tasman":"Trident")||"WebKit"==L&&/\bPlayStation\b(?! Vita\b)/i.test(P)&&"NetFront")&&(L=[o]),"IE"==P&&(o=(/; *(?:XBLWP|ZuneWP)(\d+)/i.exec(t)||0)[1])?(P+=" Mobile",U="Windows Phone "+(/\+$/.test(o)?o:o+".x"),M.unshift("desktop mode")):/\bWPDesktop\b/i.test(t)?(P="IE Mobile",U="Windows Phone 8.x",M.unshift("desktop mode"),z||(z=(/\brv:([\d.]+)/.exec(t)||0)[1])):"IE"!=P&&"Trident"==L&&(o=/\brv:([\d.]+)/.exec(t))&&(P&&M.push("identifying as "+P+(z?" "+z:"")),P="IE",z=o[1]),B){if(h="global",d=null!=(u=n)?typeof u[h]:"number",/^(?:boolean|number|string|undefined)$/.test(d)||"object"==d&&!u[h])y(o=n.runtime)==A?(P="Adobe AIR",U=o.flash.system.Capabilities.os):y(o=n.phantom)==S?(P="PhantomJS",z=(o=o.version||null)&&o.major+"."+o.minor+"."+o.patch):"number"==typeof N.documentMode&&(o=/\bTrident\/(\d+)/i.exec(t))?(z=[z,N.documentMode],(o=+o[1]+4)!=z[1]&&(M.push("IE "+z[1]+" mode"),L&&(L[1]=""),z[1]=o),z="IE"==P?String(z[1].toFixed(1)):z[0]):"number"==typeof N.documentMode&&/^(?:Chrome|Firefox)\b/.test(P)&&(M.push("masking as "+P+" "+z),P="IE",z="11.0",L=["Trident"],U="Windows");else if(E&&(D=(o=E.lang.System).getProperty("os.arch"),U=U||o.getProperty("os.name")+" "+o.getProperty("os.version")),_){try{z=n.require("ringo/engine").version.join("."),P="RingoJS"}catch(e){(o=n.system)&&o.global.system==n.system&&(P="Narwhal",U||(U=o[0].os||null))}P||(P="Rhino")}else"object"==typeof n.process&&!n.process.browser&&(o=n.process)&&("object"==typeof o.versions&&("string"==typeof o.versions.electron?(M.push("Node "+o.versions.node),P="Electron",z=o.versions.electron):"string"==typeof o.versions.nw&&(M.push("Chromium "+z,"Node "+o.versions.node),P="NW.js",z=o.versions.nw)),P||(P="Node.js",D=o.arch,U=o.platform,z=(z=/[\d.]+/.exec(o.version))?z[0]:null));U=U&&m(U)}if(z&&(o=/(?:[ab]|dp|pre|[ab]\d+pre)(?:\d+\+?)?$/i.exec(z)||/(?:alpha|beta)(?: ?\d)?/i.exec(t+";"+(B&&r.appMinorVersion))||/\bMinefield\b/i.test(t)&&"a")&&(F=/b/i.test(o)?"beta":"alpha",z=z.replace(RegExp(o+"\\+?$"),"")+("beta"==F?T:I)+(/\d+\+?/.exec(o)||"")),"Fennec"==P||"Firefox"==P&&/\b(?:Android|Firefox OS|KaiOS)\b/.test(U))P="Firefox Mobile";else if("Maxthon"==P&&z)z=z.replace(/\.[\d.]+/,".x");else if(/\bXbox\b/i.test(V))"Xbox 360"==V&&(U=null),"Xbox 360"==V&&/\bIEMobile\b/.test(t)&&M.unshift("mobile mode");else if(!/^(?:Chrome|IE|Opera)$/.test(P)&&(!P||V||/Browser|Mobi/.test(P))||"Windows CE"!=U&&!/Mobi/i.test(t))if("IE"==P&&B)try{null===n.external&&M.unshift("platform preview")}catch(e){M.unshift("embedded")}else(/\bBlackBerry\b/.test(V)||/\bBB10\b/.test(t))&&(o=(RegExp(V.replace(/ +/g," *")+"/([.\\d]+)","i").exec(t)||0)[1]||z)?(U=((o=[o,/BB10/.test(t)])[1]?(V=null,W="BlackBerry"):"Device Software")+" "+o[0],z=null):this!=g&&"Wii"!=V&&(B&&O||/Opera/.test(P)&&/\b(?:MSIE|Firefox)\b/i.test(t)||"Firefox"==P&&/\bOS X (?:\d+\.){2,}/.test(U)||"IE"==P&&(U&&!/^Win/.test(U)&&z>5.5||/\bWindows XP\b/.test(U)&&z>8||8==z&&!/\bTrident\b/.test(t)))&&!c.test(o=e.call(g,t.replace(c,"")+";"))&&o.name&&(o="ing as "+o.name+((o=o.version)?" "+o:""),c.test(P)?(/\bIE\b/.test(o)&&"Mac OS"==U&&(U=null),o="identify"+o):(o="mask"+o,P=R?m(R.replace(/([a-z])([A-Z])/g,"$1 $2")):"Opera",/\bIE\b/.test(o)&&(U=null),B||(z=null)),L=["Presto"],M.push(o));else P+=" Mobile";(o=(/\bAppleWebKit\/([\d.]+\+?)/i.exec(t)||0)[1])&&(o=[parseFloat(o.replace(/\.(\d)$/,".0$1")),o],"Safari"==P&&"+"==o[1].slice(-1)?(P="WebKit Nightly",F="alpha",z=o[1].slice(0,-1)):z!=o[1]&&z!=(o[2]=(/\bSafari\/([\d.]+\+?)/i.exec(t)||0)[1])||(z=null),o[1]=(/\b(?:Headless)?Chrome\/([\d.]+)/i.exec(t)||0)[1],537.36==o[0]&&537.36==o[2]&&parseFloat(o[1])>=28&&"WebKit"==L&&(L=["Blink"]),B&&(f||o[1])?(L&&(L[1]="like Chrome"),o=o[1]||((o=o[0])<530?1:o<532?2:o<532.05?3:o<533?4:o<534.03?5:o<534.07?6:o<534.1?7:o<534.13?8:o<534.16?9:o<534.24?10:o<534.3?11:o<535.01?12:o<535.02?"13+":o<535.07?15:o<535.11?16:o<535.19?17:o<536.05?18:o<536.1?19:o<537.01?20:o<537.11?"21+":o<537.13?23:o<537.18?24:o<537.24?25:o<537.36?26:"Blink"!=L?"27":"28")):(L&&(L[1]="like Safari"),o=(o=o[0])<400?1:o<500?2:o<526?3:o<533?4:o<534?"4+":o<535?5:o<537?6:o<538?7:o<601?8:o<602?9:o<604?10:o<606?11:o<608?12:"12"),L&&(L[1]+=" "+(o+="number"==typeof o?".x":/[.+]/.test(o)?"":"+")),"Safari"==P&&(!z||parseInt(z)>45)?z=o:"Chrome"==P&&/\bHeadlessChrome/i.test(t)&&M.unshift("headless")),"Opera"==P&&(o=/\bzbov|zvav$/.exec(U))?(P+=" ",M.unshift("desktop mode"),"zvav"==o?(P+="Mini",z=null):P+="Mobile",U=U.replace(RegExp(" *"+o+"$"),"")):"Safari"==P&&/\bChrome\b/.exec(L&&L[1])?(M.unshift("desktop mode"),P="Chrome Mobile",z=null,/\bOS X\b/.test(U)?(W="Apple",U="iOS 4.3+"):U=null):/\bSRWare Iron\b/.test(P)&&!z&&(z=q("Chrome")),z&&0==z.indexOf(o=/[\d.]+$/.exec(U))&&t.indexOf("/"+o+"-")>-1&&(U=v(U.replace(o,""))),U&&-1!=U.indexOf(P)&&!RegExp(P+" OS").test(U)&&(U=U.replace(RegExp(" *"+b(P)+" *"),"")),L&&!/\b(?:Avant|Nook)\b/.test(P)&&(/Browser|Lunascape|Maxthon/.test(P)||"Safari"!=P&&/^iOS/.test(U)&&/\bSafari\b/.test(L[1])||/^(?:Adobe|Arora|Breach|Midori|Opera|Phantom|Rekonq|Rock|Samsung Internet|Sleipnir|SRWare Iron|Vivaldi|Web)/.test(P)&&L[1])&&(o=L[L.length-1])&&M.push(o),M.length&&(M=["("+M.join("; ")+")"]),W&&V&&V.indexOf(W)<0&&M.push("on "+W),V&&M.push((/^on /.test(M[M.length-1])?"":"on ")+V),U&&(o=/ ([\d.+]+)$/.exec(U),l=o&&"/"==U.charAt(U.length-o[0].length-1),U={architecture:32,family:o&&!l?U.replace(o[0],""):U,version:o?o[1]:null,toString:function(){var e=this.version;return this.family+(e&&!l?" "+e:"")+(64==this.architecture?" 64-bit":"")}}),(o=/\b(?:AMD|IA|Win|WOW|x86_|x)64\b/i.exec(D))&&!/\bi686\b/i.test(D)?(U&&(U.architecture=64,U.family=U.family.replace(RegExp(" *"+o),"")),P&&(/\bWOW64\b/i.test(t)||B&&/\w(?:86|32)$/.test(r.cpuClass||r.platform)&&!/\bWin64; x64\b/i.test(t))&&M.unshift("32-bit")):U&&/^OS X/.test(U.family)&&"Chrome"==P&&parseFloat(z)>=39&&(U.architecture=64),t||(t=null);var j={};return j.description=t,j.layout=L&&L[0],j.manufacturer=W,j.name=P,j.prerelease=F,j.product=V,j.ua=t,j.version=P&&z,j.os=U||{architecture:null,family:null,version:null,toString:function(){return"null"}},j.parse=e,j.toString=function(){return this.description||""},j.version&&M.unshift(z),j.name&&M.unshift(P),U&&P&&(U!=String(U).split(" ")[0]||U!=P.split(" ")[0]&&!V)&&M.push(V?"("+U+")":"on "+U),M.length&&(j.description=M.join(" ")),j}();a.platform=x,void 0===(s=function(){return x}.call(t,n,t,e))||(e.exports=s)}.call(this)},115:e=>{var t="undefined"!=typeof Element,n="function"==typeof Map,s="function"==typeof Set,r="function"==typeof ArrayBuffer&&!!ArrayBuffer.isView;function a(e,i){if(e===i)return!0;if(e&&i&&"object"==typeof e&&"object"==typeof i){if(e.constructor!==i.constructor)return!1;var o,l,u,c;if(Array.isArray(e)){if((o=e.length)!=i.length)return!1;for(l=o;0!=l--;)if(!a(e[l],i[l]))return!1;return!0}if(n&&e instanceof Map&&i instanceof Map){if(e.size!==i.size)return!1;for(c=e.entries();!(l=c.next()).done;)if(!i.has(l.value[0]))return!1;for(c=e.entries();!(l=c.next()).done;)if(!a(l.value[1],i.get(l.value[0])))return!1;return!0}if(s&&e instanceof Set&&i instanceof Set){if(e.size!==i.size)return!1;for(c=e.entries();!(l=c.next()).done;)if(!i.has(l.value[0]))return!1;return!0}if(r&&ArrayBuffer.isView(e)&&ArrayBuffer.isView(i)){if((o=e.length)!=i.length)return!1;for(l=o;0!=l--;)if(e[l]!==i[l])return!1;return!0}if(e.constructor===RegExp)return e.source===i.source&&e.flags===i.flags;if(e.valueOf!==Object.prototype.valueOf&&"function"==typeof e.valueOf&&"function"==typeof i.valueOf)return e.valueOf()===i.valueOf();if(e.toString!==Object.prototype.toString&&"function"==typeof e.toString&&"function"==typeof i.toString)return e.toString()===i.toString();if((o=(u=Object.keys(e)).length)!==Object.keys(i).length)return!1;for(l=o;0!=l--;)if(!Object.prototype.hasOwnProperty.call(i,u[l]))return!1;if(t&&e instanceof Element)return!1;for(l=o;0!=l--;)if(("_owner"!==u[l]&&"__v"!==u[l]&&"__o"!==u[l]||!e.$$typeof)&&!a(e[u[l]],i[u[l]]))return!1;return!0}return e!=e&&i!=i}e.exports=function(e,t){try{return a(e,t)}catch(e){if((e.message||"").match(/stack|recursion/i))return!1;throw e}}},5072:e=>{"use strict";var t=[];function n(e){for(var n=-1,s=0;s{"use strict";var t={};e.exports=function(e,n){var s=function(e){if(void 0===t[e]){var n=document.querySelector(e);if(window.HTMLIFrameElement&&n instanceof window.HTMLIFrameElement)try{n=n.contentDocument.head}catch(e){n=null}t[e]=n}return t[e]}(e);if(!s)throw new Error("Couldn't find a style target. This probably means that the value for the 'insert' parameter is invalid.");s.appendChild(n)}},540:e=>{"use strict";e.exports=function(e){var t=document.createElement("style");return e.setAttributes(t,e.attributes),e.insert(t,e.options),t}},5056:(e,t,n)=>{"use strict";e.exports=function(e){var t=n.nc;t&&e.setAttribute("nonce",t)}},7825:e=>{"use strict";e.exports=function(e){if("undefined"==typeof document)return{update:function(){},remove:function(){}};var t=e.insertStyleElement(e);return{update:function(n){!function(e,t,n){var s="";n.supports&&(s+="@supports (".concat(n.supports,") {")),n.media&&(s+="@media ".concat(n.media," {"));var r=void 0!==n.layer;r&&(s+="@layer".concat(n.layer.length>0?" ".concat(n.layer):""," {")),s+=n.css,r&&(s+="}"),n.media&&(s+="}"),n.supports&&(s+="}");var a=n.sourceMap;a&&"undefined"!=typeof btoa&&(s+="\n/*# sourceMappingURL=data:application/json;base64,".concat(btoa(unescape(encodeURIComponent(JSON.stringify(a))))," */")),t.styleTagTransform(s,e,t.options)}(t,e,n)},remove:function(){!function(e){if(null===e.parentNode)return!1;e.parentNode.removeChild(e)}(t)}}}},1113:e=>{"use strict";e.exports=function(e,t){if(t.styleSheet)t.styleSheet.cssText=e;else{for(;t.firstChild;)t.removeChild(t.firstChild);t.appendChild(document.createTextNode(e))}}},402:e=>{e.exports=''},3389:e=>{e.exports=''},627:e=>{e.exports=''},8110:e=>{e.exports=''},980:e=>{e.exports=''},3890:e=>{e.exports=''},880:e=>{e.exports=''},3282:e=>{e.exports=''},8465:function(e){e.exports=function(){"use strict";function e(e,t,n){if("function"==typeof e?e===t:e.has(t))return arguments.length<3?t:n;throw new TypeError("Private element is not present on this object")}function t(e,t,n){return t=f(t),y(e,a()?Reflect.construct(t,n||[],f(e).constructor):t.apply(e,n))}function n(t,n){return t.get(e(t,n))}function s(t,n,s){return t.set(e(t,n),s),s}function r(e,t,n){if(a())return Reflect.construct.apply(null,arguments);var s=[null];s.push.apply(s,t);var r=new(e.bind.apply(e,s));return n&&m(r,n.prototype),r}function a(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(a=function(){return!!e})()}function i(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var s,r,a,i,o=[],l=!0,u=!1;try{if(a=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;l=!1}else for(;!(l=(s=a.call(n)).done)&&(o.push(s.value),o.length!==t);l=!0);}catch(e){u=!0,r=e}finally{try{if(!l&&null!=n.return&&(i=n.return(),Object(i)!==i))return}finally{if(u)throw r}}return o}}function o(e,t){if("object"!=typeof e||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var s=n.call(e,t||"default");if("object"!=typeof s)return s;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}function l(e){var t=o(e,"string");return"symbol"==typeof t?t:t+""}function u(e){return u="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},u(e)}function c(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function h(e,t){for(var n=0;ne.length)&&(t=e.length);for(var n=0,s=new Array(t);ns?1:n .").concat(B[t]));case"checkbox":return e.querySelector(".".concat(B.popup," > .").concat(B.checkbox," input"));case"radio":return e.querySelector(".".concat(B.popup," > .").concat(B.radio," input:checked"))||e.querySelector(".".concat(B.popup," > .").concat(B.radio," input:first-child"));case"range":return e.querySelector(".".concat(B.popup," > .").concat(B.range," input"));default:return e.querySelector(".".concat(B.popup," > .").concat(B.input))}},Ce=function(e){if(e.focus(),"file"!==e.type){var t=e.value;e.value="",e.value=t}},Se=function(e,t,n){e&&t&&("string"==typeof t&&(t=t.split(/\s+/).filter(Boolean)),t.forEach((function(t){Array.isArray(e)?e.forEach((function(e){n?e.classList.add(t):e.classList.remove(t)})):n?e.classList.add(t):e.classList.remove(t)})))},Ee=function(e,t){Se(e,t,!0)},_e=function(e,t){Se(e,t,!1)},Ie=function(e,t){for(var n=Array.from(e.children),s=0;s1&&void 0!==arguments[1]?arguments[1]:"flex";e&&(e.style.display=t)},Oe=function(e){e&&(e.style.display="none")},Re=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"block";e&&new MutationObserver((function(){Me(e,e.innerHTML,t)})).observe(e,{childList:!0,subtree:!0})},De=function(e,t,n,s){var r=e.querySelector(t);r&&r.style.setProperty(n,s)},Me=function(e,t){t?Ne(e,arguments.length>2&&void 0!==arguments[2]?arguments[2]:"flex"):Oe(e)},Fe=function(e){return!(!e||!(e.offsetWidth||e.offsetHeight||e.getClientRects().length))},Be=function(){return!Fe(ae())&&!Fe(oe())&&!Fe(ie())},ze=function(e){return!!(e.scrollHeight>e.clientHeight)},Le=function(e){var t=window.getComputedStyle(e),n=parseFloat(t.getPropertyValue("animation-duration")||"0"),s=parseFloat(t.getPropertyValue("transition-duration")||"0");return n>0||s>0},Pe=function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=de();n&&Fe(n)&&(t&&(n.style.transition="none",n.style.width="100%"),setTimeout((function(){n.style.transition="width ".concat(e/1e3,"s linear"),n.style.width="0%"}),10))},Ve=function(){var e=de();if(e){var t=parseInt(window.getComputedStyle(e).width);e.style.removeProperty("transition"),e.style.width="100%";var n=t/parseInt(window.getComputedStyle(e).width)*100;e.style.width="".concat(n,"%")}},We=function(){return"undefined"==typeof window||"undefined"==typeof document},Ue='\n
      \n \n
        \n
        \n \n

        \n
        \n \n \n
        \n \n \n
        \n \n
        \n \n \n
        \n
        \n
        \n \n \n \n
        \n
        \n
        \n
        \n
        \n
        \n').replace(/(^|\n)\s*/g,""),Ge=function(){var e=K();return!!e&&(e.remove(),_e([document.documentElement,document.body],[B["no-backdrop"],B["toast-shown"],B["has-column"]]),!0)},qe=function(){R.currentInstance.resetValidationMessage()},je=function(){var e=Y(),t=Ie(e,B.input),n=Ie(e,B.file),s=e.querySelector(".".concat(B.range," input")),r=e.querySelector(".".concat(B.range," output")),a=Ie(e,B.select),i=e.querySelector(".".concat(B.checkbox," input")),o=Ie(e,B.textarea);t.oninput=qe,n.onchange=qe,a.onchange=qe,i.onchange=qe,o.oninput=qe,s.oninput=function(){qe(),r.value=s.value},s.onchange=function(){qe(),r.value=s.value}},He=function(e){return"string"==typeof e?document.querySelector(e):e},$e=function(e){var t=Y();t.setAttribute("role",e.toast?"alert":"dialog"),t.setAttribute("aria-live",e.toast?"polite":"assertive"),e.toast||t.setAttribute("aria-modal","true")},Ke=function(e){"rtl"===window.getComputedStyle(e).direction&&Ee(K(),B.rtl)},Xe=function(e){var t=Ge();if(We())V("SweetAlert2 requires document to initialize");else{var n=document.createElement("div");n.className=B.container,t&&Ee(n,B["no-transition"]),we(n,Ue);var s=He(e.target);s.appendChild(n),$e(e),Ke(s),je()}},Ze=function(e,t){e instanceof HTMLElement?t.appendChild(e):"object"===u(e)?Ye(e,t):e&&we(t,e)},Ye=function(e,t){e.jquery?Qe(t,e):we(t,e.toString())},Qe=function(e,t){if(e.textContent="",0 in t)for(var n=0;n in t;n++)e.appendChild(t[n].cloneNode(!0));else e.appendChild(t.cloneNode(!0))},Je=function(){if(We())return!1;var e=document.createElement("div");return void 0!==e.style.webkitAnimation?"webkitAnimationEnd":void 0!==e.style.animation&&"animationend"}(),et=function(e,t){var n=ce(),s=ue();n&&s&&(t.showConfirmButton||t.showDenyButton||t.showCancelButton?Ne(n):Oe(n),Ae(n,t,"actions"),tt(n,s,t),we(s,t.loaderHtml||""),Ae(s,t,"loader"))};function tt(e,t,n){var s=ae(),r=oe(),a=ie();s&&r&&a&&(st(s,"confirm",n),st(r,"deny",n),st(a,"cancel",n),nt(s,r,a,n),n.reverseButtons&&(n.toast?(e.insertBefore(a,s),e.insertBefore(r,s)):(e.insertBefore(a,t),e.insertBefore(r,t),e.insertBefore(s,t))))}function nt(e,t,n,s){s.buttonsStyling?(Ee([e,t,n],B.styled),s.confirmButtonColor&&(e.style.backgroundColor=s.confirmButtonColor,Ee(e,B["default-outline"])),s.denyButtonColor&&(t.style.backgroundColor=s.denyButtonColor,Ee(t,B["default-outline"])),s.cancelButtonColor&&(n.style.backgroundColor=s.cancelButtonColor,Ee(n,B["default-outline"]))):_e([e,t,n],B.styled)}function st(e,t,n){var s=L(t);Me(e,n["show".concat(s,"Button")],"inline-block"),we(e,n["".concat(t,"ButtonText")]||""),e.setAttribute("aria-label",n["".concat(t,"ButtonAriaLabel")]||""),e.className=B[t],Ae(e,n,"".concat(t,"Button"))}var rt=function(e,t){var n=pe();n&&(we(n,t.closeButtonHtml||""),Ae(n,t,"closeButton"),Me(n,t.showCloseButton),n.setAttribute("aria-label",t.closeButtonAriaLabel||""))},at=function(e,t){var n=K();n&&(it(n,t.backdrop),ot(n,t.position),lt(n,t.grow),Ae(n,t,"container"))};function it(e,t){"string"==typeof t?e.style.background=t:t||Ee([document.documentElement,document.body],B["no-backdrop"])}function ot(e,t){t&&(t in B?Ee(e,B[t]):(P('The "position" parameter is not valid, defaulting to "center"'),Ee(e,B.center)))}function lt(e,t){t&&Ee(e,B["grow-".concat(t)])}var ut={innerParams:new WeakMap,domCache:new WeakMap},ct=["input","file","range","select","radio","checkbox","textarea"],ht=function(e,t){var n=Y();if(n){var s=ut.innerParams.get(e),r=!s||t.input!==s.input;ct.forEach((function(e){var s=Ie(n,B[e]);s&&(ft(e,t.inputAttributes),s.className=B[e],r&&Oe(s))})),t.input&&(r&&dt(t),mt(t))}},dt=function(e){if(e.input)if(vt[e.input]){var t=bt(e.input),n=vt[e.input](t,e);Ne(t),e.inputAutoFocus&&setTimeout((function(){Ce(n)}))}else V("Unexpected type of input! Expected ".concat(Object.keys(vt).join(" | "),', got "').concat(e.input,'"'))},pt=function(e){for(var t=0;ts?Y().style.width="".concat(r,"px"):Te(Y(),"width",t.width)}})).observe(e,{attributes:!0,attributeFilter:["style"]})}})),e};var xt=function(e,t){var n=te();n&&(Re(n),Ae(n,t,"htmlContainer"),t.html?(Ze(t.html,n),Ne(n,"block")):t.text?(n.textContent=t.text,Ne(n,"block")):Oe(n),ht(e,t))},At=function(e,t){var n=he();n&&(Re(n),Me(n,t.footer,"block"),t.footer&&Ze(t.footer,n),Ae(n,t,"footer"))},kt=function(e,t){var n=ut.innerParams.get(e),s=Q();if(s){if(n&&t.icon===n.icon)return It(s,t),void Ct(s,t);if(t.icon||t.iconHtml){if(t.icon&&-1===Object.keys(z).indexOf(t.icon))return V('Unknown icon! Expected "success", "error", "warning", "info" or "question", got "'.concat(t.icon,'"')),void Oe(s);Ne(s),It(s,t),Ct(s,t),Ee(s,t.showClass&&t.showClass.icon)}else Oe(s)}},Ct=function(e,t){for(var n=0,s=Object.entries(z);n\n \n
        \n
        \n',_t='\n \n \n \n \n',It=function(e,t){if(t.icon||t.iconHtml){var n=e.innerHTML,s="";t.iconHtml?s=Nt(t.iconHtml):"success"===t.icon?(s=Et,n=n.replace(/ style=".*?"/g,"")):"error"===t.icon?s=_t:t.icon&&(s=Nt({question:"?",warning:"!",info:"i"}[t.icon])),n.trim()!==s.trim()&&we(e,s)}},Tt=function(e,t){if(t.iconColor){e.style.color=t.iconColor,e.style.borderColor=t.iconColor;for(var n=0,s=[".swal2-success-line-tip",".swal2-success-line-long",".swal2-x-mark-line-left",".swal2-x-mark-line-right"];n').concat(e,"")},Ot=function(e,t){var n=ne();n&&(t.imageUrl?(Ne(n,""),n.setAttribute("src",t.imageUrl),n.setAttribute("alt",t.imageAlt||""),Te(n,"width",t.imageWidth),Te(n,"height",t.imageHeight),n.className=B.image,Ae(n,t,"image")):Oe(n))},Rt=function(e,t){var n=K(),s=Y();if(n&&s){if(t.toast){Te(n,"width",t.width),s.style.width="100%";var r=ue();r&&s.insertBefore(r,Q())}else Te(s,"width",t.width);Te(s,"padding",t.padding),t.color&&(s.style.color=t.color),t.background&&(s.style.background=t.background),Oe(re()),Dt(s,t)}},Dt=function(e,t){var n=t.showClass||{};e.className="".concat(B.popup," ").concat(Fe(e)?n.popup:""),t.toast?(Ee([document.documentElement,document.body],B["toast-shown"]),Ee(e,B.toast)):Ee(e,B.modal),Ae(e,t,"popup"),"string"==typeof t.customClass&&Ee(e,t.customClass),t.icon&&Ee(e,B["icon-".concat(t.icon)])},Mt=function(e,t){var n=se();if(n){var s=t.progressSteps,r=t.currentProgressStep;s&&0!==s.length&&void 0!==r?(Ne(n),n.textContent="",r>=s.length&&P("Invalid currentProgressStep parameter, it should be less than progressSteps.length (currentProgressStep like JS arrays starts from 0)"),s.forEach((function(e,a){var i=Ft(e);if(n.appendChild(i),a===r&&Ee(i,B["active-progress-step"]),a!==s.length-1){var o=Bt(t);n.appendChild(o)}}))):Oe(n)}},Ft=function(e){var t=document.createElement("li");return Ee(t,B["progress-step"]),we(t,e),t},Bt=function(e){var t=document.createElement("li");return Ee(t,B["progress-step-line"]),e.progressStepsDistance&&Te(t,"width",e.progressStepsDistance),t},zt=function(e,t){var n=ee();n&&(Re(n),Me(n,t.title||t.titleText,"block"),t.title&&Ze(t.title,n),t.titleText&&(n.innerText=t.titleText),Ae(n,t,"title"))},Lt=function(e,t){Rt(e,t),at(e,t),Mt(e,t),kt(e,t),Ot(e,t),zt(e,t),rt(e,t),xt(e,t),et(e,t),At(e,t);var n=Y();"function"==typeof t.didRender&&n&&t.didRender(n)},Pt=function(){return Fe(Y())},Vt=function(){var e;return null===(e=ae())||void 0===e?void 0:e.click()},Wt=function(){var e;return null===(e=oe())||void 0===e?void 0:e.click()},Ut=function(){var e;return null===(e=ie())||void 0===e?void 0:e.click()},Gt=Object.freeze({cancel:"cancel",backdrop:"backdrop",close:"close",esc:"esc",timer:"timer"}),qt=function(e){e.keydownTarget&&e.keydownHandlerAdded&&(e.keydownTarget.removeEventListener("keydown",e.keydownHandler,{capture:e.keydownListenerCapture}),e.keydownHandlerAdded=!1)},jt=function(e,t,n){qt(e),t.toast||(e.keydownHandler=function(e){return Xt(t,e,n)},e.keydownTarget=t.keydownListenerCapture?window:Y(),e.keydownListenerCapture=t.keydownListenerCapture,e.keydownTarget.addEventListener("keydown",e.keydownHandler,{capture:e.keydownListenerCapture}),e.keydownHandlerAdded=!0)},Ht=function(e,t){var n,s=me();if(s.length)return(e+=t)===s.length?e=0:-1===e&&(e=s.length-1),void s[e].focus();null===(n=Y())||void 0===n||n.focus()},$t=["ArrowRight","ArrowDown"],Kt=["ArrowLeft","ArrowUp"],Xt=function(e,t,n){e&&(t.isComposing||229===t.keyCode||(e.stopKeydownPropagation&&t.stopPropagation(),"Enter"===t.key?Zt(t,e):"Tab"===t.key?Yt(t):[].concat($t,Kt).includes(t.key)?Qt(t.key):"Escape"===t.key&&Jt(t,e,n)))},Zt=function(e,t){if(q(t.allowEnterKey)){var n=ke(Y(),t.input);if(e.target&&n&&e.target instanceof HTMLElement&&e.target.outerHTML===n.outerHTML){if(["textarea","file"].includes(t.input))return;Vt(),e.preventDefault()}}},Yt=function(e){for(var t=e.target,n=me(),s=-1,r=0;r1},cn=function(){if(ve(document.body,B.iosfix)){var e=parseInt(document.body.style.top,10);_e(document.body,B.iosfix),document.body.style.top="",document.body.scrollTop=-1*e}},hn=function(){var e=document.createElement("div");e.className=B["scrollbar-measure"],document.body.appendChild(e);var t=e.getBoundingClientRect().width-e.clientWidth;return document.body.removeChild(e),t},dn=null,pn=function(e){null===dn&&(document.body.scrollHeight>window.innerHeight||"scroll"===e)&&(dn=parseInt(window.getComputedStyle(document.body).getPropertyValue("padding-right")),document.body.style.paddingRight="".concat(dn+hn(),"px"))},fn=function(){null!==dn&&(document.body.style.paddingRight="".concat(dn,"px"),dn=null)};function mn(e,t,n,s){ye()?Cn(e,s):(M(n).then((function(){return Cn(e,s)})),qt(R)),sn?(t.setAttribute("style","display:none !important"),t.removeAttribute("class"),t.innerHTML=""):t.remove(),ge()&&(fn(),cn(),nn()),gn()}function gn(){_e([document.documentElement,document.body],[B.shown,B["height-auto"],B["no-backdrop"],B["toast-shown"]])}function yn(e){e=xn(e);var t=en.swalPromiseResolve.get(this),n=bn(this);this.isAwaitingPromise?e.isDismissed||(vn(this),t(e)):n&&t(e)}var bn=function(e){var t=Y();if(!t)return!1;var n=ut.innerParams.get(e);if(!n||ve(t,n.hideClass.popup))return!1;_e(t,n.showClass.popup),Ee(t,n.hideClass.popup);var s=K();return _e(s,n.showClass.backdrop),Ee(s,n.hideClass.backdrop),An(e,t,n),!0};function wn(e){var t=en.swalPromiseReject.get(this);vn(this),t&&t(e)}var vn=function(e){e.isAwaitingPromise&&(delete e.isAwaitingPromise,ut.innerParams.get(e)||e._destroy())},xn=function(e){return void 0===e?{isConfirmed:!1,isDenied:!1,isDismissed:!0}:Object.assign({isConfirmed:!1,isDenied:!1,isDismissed:!1},e)},An=function(e,t,n){var s=K(),r=Je&&Le(t);"function"==typeof n.willClose&&n.willClose(t),r?kn(e,t,s,n.returnFocus,n.didClose):mn(e,s,n.returnFocus,n.didClose)},kn=function(e,t,n,s,r){Je&&(R.swalCloseEventFinishedCallback=mn.bind(null,e,n,s,r),t.addEventListener(Je,(function(e){e.target===t&&(R.swalCloseEventFinishedCallback(),delete R.swalCloseEventFinishedCallback)})))},Cn=function(e,t){setTimeout((function(){"function"==typeof t&&t.bind(e.params)(),e._destroy&&e._destroy()}))},Sn=function(e){var t=Y();if(t||new Er,t=Y()){var n=ue();ye()?Oe(Q()):En(t,e),Ne(n),t.setAttribute("data-loading","true"),t.setAttribute("aria-busy","true"),t.focus()}},En=function(e,t){var n=ce(),s=ue();n&&s&&(!t&&Fe(ae())&&(t=ae()),Ne(n),t&&(Oe(t),s.setAttribute("data-button-to-replace",t.className),n.insertBefore(s,t)),Ee([e,n],B.loading))},_n=function(e,t){"select"===t.input||"radio"===t.input?Rn(e,t):["text","email","number","tel","textarea"].some((function(e){return e===t.input}))&&(j(t.inputValue)||$(t.inputValue))&&(Sn(ae()),Dn(e,t))},In=function(e,t){var n=e.getInput();if(!n)return null;switch(t.input){case"checkbox":return Tn(n);case"radio":return Nn(n);case"file":return On(n);default:return t.inputAutoTrim?n.value.trim():n.value}},Tn=function(e){return e.checked?1:0},Nn=function(e){return e.checked?e.value:null},On=function(e){return e.files&&e.files.length?null!==e.getAttribute("multiple")?e.files:e.files[0]:null},Rn=function(e,t){var n=Y();if(n){var s=function(e){"select"===t.input?Mn(n,Bn(e),t):"radio"===t.input&&Fn(n,Bn(e),t)};j(t.inputOptions)||$(t.inputOptions)?(Sn(ae()),H(t.inputOptions).then((function(t){e.hideLoading(),s(t)}))):"object"===u(t.inputOptions)?s(t.inputOptions):V("Unexpected type of inputOptions! Expected object, Map or Promise, got ".concat(u(t.inputOptions)))}},Dn=function(e,t){var n=e.getInput();n&&(Oe(n),H(t.inputValue).then((function(s){n.value="number"===t.input?"".concat(parseFloat(s)||0):"".concat(s),Ne(n),n.focus(),e.hideLoading()})).catch((function(t){V("Error in inputValue promise: ".concat(t)),n.value="",Ne(n),n.focus(),e.hideLoading()})))};function Mn(e,t,n){var s=Ie(e,B.select);if(s){var r=function(e,t,s){var r=document.createElement("option");r.value=s,we(r,t),r.selected=zn(s,n.inputValue),e.appendChild(r)};t.forEach((function(e){var t=e[0],n=e[1];if(Array.isArray(n)){var a=document.createElement("optgroup");a.label=t,a.disabled=!1,s.appendChild(a),n.forEach((function(e){return r(a,e[1],e[0])}))}else r(s,n,t)})),s.focus()}}function Fn(e,t,n){var s=Ie(e,B.radio);if(s){t.forEach((function(e){var t=e[0],r=e[1],a=document.createElement("input"),i=document.createElement("label");a.type="radio",a.name=B.radio,a.value=t,zn(t,n.inputValue)&&(a.checked=!0);var o=document.createElement("span");we(o,r),o.className=B.label,i.appendChild(a),i.appendChild(o),s.appendChild(i)}));var r=s.querySelectorAll("input");r.length&&r[0].focus()}}var Bn=function e(t){var n=[];return t instanceof Map?t.forEach((function(t,s){var r=t;"object"===u(r)&&(r=e(r)),n.push([s,r])})):Object.keys(t).forEach((function(s){var r=t[s];"object"===u(r)&&(r=e(r)),n.push([s,r])})),n},zn=function(e,t){return!!t&&t.toString()===e.toString()},Ln=void 0,Pn=function(e){var t=ut.innerParams.get(e);e.disableButtons(),t.input?Un(e,"confirm"):$n(e,!0)},Vn=function(e){var t=ut.innerParams.get(e);e.disableButtons(),t.returnInputValueOnDeny?Un(e,"deny"):qn(e,!1)},Wn=function(e,t){e.disableButtons(),t(Gt.cancel)},Un=function(e,t){var n=ut.innerParams.get(e);if(n.input){var s=e.getInput(),r=In(e,n);n.inputValidator?Gn(e,r,t):s&&!s.checkValidity()?(e.enableButtons(),e.showValidationMessage(n.validationMessage||s.validationMessage)):"deny"===t?qn(e,r):$n(e,r)}else V('The "input" parameter is needed to be set when using returnInputValueOn'.concat(L(t)))},Gn=function(e,t,n){var s=ut.innerParams.get(e);e.disableInput(),Promise.resolve().then((function(){return H(s.inputValidator(t,s.validationMessage))})).then((function(s){e.enableButtons(),e.enableInput(),s?e.showValidationMessage(s):"deny"===n?qn(e,t):$n(e,t)}))},qn=function(e,t){var n=ut.innerParams.get(e||Ln);n.showLoaderOnDeny&&Sn(oe()),n.preDeny?(e.isAwaitingPromise=!0,Promise.resolve().then((function(){return H(n.preDeny(t,n.validationMessage))})).then((function(n){!1===n?(e.hideLoading(),vn(e)):e.close({isDenied:!0,value:void 0===n?t:n})})).catch((function(t){return Hn(e||Ln,t)}))):e.close({isDenied:!0,value:t})},jn=function(e,t){e.close({isConfirmed:!0,value:t})},Hn=function(e,t){e.rejectPromise(t)},$n=function(e,t){var n=ut.innerParams.get(e||Ln);n.showLoaderOnConfirm&&Sn(),n.preConfirm?(e.resetValidationMessage(),e.isAwaitingPromise=!0,Promise.resolve().then((function(){return H(n.preConfirm(t,n.validationMessage))})).then((function(n){Fe(re())||!1===n?(e.hideLoading(),vn(e)):jn(e,void 0===n?t:n)})).catch((function(t){return Hn(e||Ln,t)}))):jn(e,t)};function Kn(){var e=ut.innerParams.get(this);if(e){var t=ut.domCache.get(this);Oe(t.loader),ye()?e.icon&&Ne(Q()):Xn(t),_e([t.popup,t.actions],B.loading),t.popup.removeAttribute("aria-busy"),t.popup.removeAttribute("data-loading"),t.confirmButton.disabled=!1,t.denyButton.disabled=!1,t.cancelButton.disabled=!1}}var Xn=function(e){var t=e.popup.getElementsByClassName(e.loader.getAttribute("data-button-to-replace"));t.length?Ne(t[0],"inline-block"):Be()&&Oe(e.actions)};function Zn(){var e=ut.innerParams.get(this),t=ut.domCache.get(this);return t?ke(t.popup,e.input):null}function Yn(e,t,n){var s=ut.domCache.get(e);t.forEach((function(e){s[e].disabled=n}))}function Qn(e,t){var n=Y();if(n&&e)if("radio"===e.type)for(var s=n.querySelectorAll('[name="'.concat(B.radio,'"]')),r=0;r0&&void 0!==arguments[0]?arguments[0]:"data-swal-template"]=this,Ws||(document.body.addEventListener("click",js),Ws=!0)}var qs,js=function(e){for(var t=e.target;t&&t!==document;t=t.parentNode)for(var n in Us){var s=t.getAttribute(n);if(s)return void Us[n].fire({template:s})}},Hs=Object.freeze({__proto__:null,argsToParams:Rs,bindClickHandler:Gs,clickCancel:Ut,clickConfirm:Vt,clickDeny:Wt,enableLoading:Sn,fire:Ds,getActions:ce,getCancelButton:ie,getCloseButton:pe,getConfirmButton:ae,getContainer:K,getDenyButton:oe,getFocusableElements:me,getFooter:he,getHtmlContainer:te,getIcon:Q,getIconContent:J,getImage:ne,getInputLabel:le,getLoader:ue,getPopup:Y,getProgressSteps:se,getTimerLeft:Fs,getTimerProgressBar:de,getTitle:ee,getValidationMessage:re,increaseTimer:Ps,isDeprecatedParameter:hs,isLoading:be,isTimerRunning:Vs,isUpdatableParameter:cs,isValidParameter:us,isVisible:Pt,mixin:Ms,resumeTimer:zs,showLoading:Sn,stopTimer:Bs,toggleTimer:Ls}),$s=function(){function e(t,n){c(this,e),this.callback=t,this.remaining=n,this.running=!1,this.start()}return d(e,[{key:"start",value:function(){return this.running||(this.running=!0,this.started=new Date,this.id=setTimeout(this.callback,this.remaining)),this.remaining}},{key:"stop",value:function(){return this.started&&this.running&&(this.running=!1,clearTimeout(this.id),this.remaining-=(new Date).getTime()-this.started.getTime()),this.remaining}},{key:"increase",value:function(e){var t=this.running;return t&&this.stop(),this.remaining+=e,t&&this.start(),this.remaining}},{key:"getTimerLeft",value:function(){return this.running&&(this.stop(),this.start()),this.remaining}},{key:"isRunning",value:function(){return this.running}}])}(),Ks=["swal-title","swal-html","swal-footer"],Xs=function(e){var t="string"==typeof e.template?document.querySelector(e.template):e.template;if(!t)return{};var n=t.content;return sr(n),Object.assign(Zs(n),Ys(n),Qs(n),Js(n),er(n),tr(n),nr(n,Ks))},Zs=function(e){var t={};return Array.from(e.querySelectorAll("swal-param")).forEach((function(e){rr(e,["name","value"]);var n=e.getAttribute("name"),s=e.getAttribute("value");"boolean"==typeof as[n]?t[n]="false"!==s:"object"===u(as[n])?t[n]=JSON.parse(s):t[n]=s})),t},Ys=function(e){var t={};return Array.from(e.querySelectorAll("swal-function-param")).forEach((function(e){var n=e.getAttribute("name"),s=e.getAttribute("value");t[n]=new Function("return ".concat(s))()})),t},Qs=function(e){var t={};return Array.from(e.querySelectorAll("swal-button")).forEach((function(e){rr(e,["type","color","aria-label"]);var n=e.getAttribute("type");t["".concat(n,"ButtonText")]=e.innerHTML,t["show".concat(L(n),"Button")]=!0,e.hasAttribute("color")&&(t["".concat(n,"ButtonColor")]=e.getAttribute("color")),e.hasAttribute("aria-label")&&(t["".concat(n,"ButtonAriaLabel")]=e.getAttribute("aria-label"))})),t},Js=function(e){var t={},n=e.querySelector("swal-image");return n&&(rr(n,["src","width","height","alt"]),n.hasAttribute("src")&&(t.imageUrl=n.getAttribute("src")),n.hasAttribute("width")&&(t.imageWidth=n.getAttribute("width")),n.hasAttribute("height")&&(t.imageHeight=n.getAttribute("height")),n.hasAttribute("alt")&&(t.imageAlt=n.getAttribute("alt"))),t},er=function(e){var t={},n=e.querySelector("swal-icon");return n&&(rr(n,["type","color"]),n.hasAttribute("type")&&(t.icon=n.getAttribute("type")),n.hasAttribute("color")&&(t.iconColor=n.getAttribute("color")),t.iconHtml=n.innerHTML),t},tr=function(e){var t={},n=e.querySelector("swal-input");n&&(rr(n,["type","label","placeholder","value"]),t.input=n.getAttribute("type")||"text",n.hasAttribute("label")&&(t.inputLabel=n.getAttribute("label")),n.hasAttribute("placeholder")&&(t.inputPlaceholder=n.getAttribute("placeholder")),n.hasAttribute("value")&&(t.inputValue=n.getAttribute("value")));var s=Array.from(e.querySelectorAll("swal-input-option"));return s.length&&(t.inputOptions={},s.forEach((function(e){rr(e,["value"]);var n=e.getAttribute("value"),s=e.innerHTML;t.inputOptions[n]=s}))),t},nr=function(e,t){var n={};for(var s in t){var r=t[s],a=e.querySelector(r);a&&(rr(a,[]),n[r.replace(/^swal-/,"")]=a.innerHTML.trim())}return n},sr=function(e){var t=Ks.concat(["swal-param","swal-function-param","swal-button","swal-image","swal-icon","swal-input","swal-input-option"]);Array.from(e.children).forEach((function(e){var n=e.tagName.toLowerCase();t.includes(n)||P("Unrecognized element <".concat(n,">"))}))},rr=function(e,t){Array.from(e.attributes).forEach((function(n){-1===t.indexOf(n.name)&&P(['Unrecognized attribute "'.concat(n.name,'" on <').concat(e.tagName.toLowerCase(),">."),"".concat(t.length?"Allowed attributes are: ".concat(t.join(", ")):"To set the value, use HTML within the element.")])}))},ar=10,ir=function(e){var t=K(),n=Y();"function"==typeof e.willOpen&&e.willOpen(n);var s=window.getComputedStyle(document.body).overflowY;cr(t,n,e),setTimeout((function(){lr(t,n)}),ar),ge()&&(ur(t,e.scrollbarPadding,s),tn()),ye()||R.previousActiveElement||(R.previousActiveElement=document.activeElement),"function"==typeof e.didOpen&&setTimeout((function(){return e.didOpen(n)})),_e(t,B["no-transition"])},or=function e(t){var n=Y();if(t.target===n&&Je){var s=K();n.removeEventListener(Je,e),s.style.overflowY="auto"}},lr=function(e,t){Je&&Le(t)?(e.style.overflowY="hidden",t.addEventListener(Je,or)):e.style.overflowY="auto"},ur=function(e,t,n){rn(),t&&"hidden"!==n&&pn(n),setTimeout((function(){e.scrollTop=0}))},cr=function(e,t,n){Ee(e,n.showClass.backdrop),n.animation?(t.style.setProperty("opacity","0","important"),Ne(t,"grid"),setTimeout((function(){Ee(t,n.showClass.popup),t.style.removeProperty("opacity")}),ar)):Ne(t,"grid"),Ee([document.documentElement,document.body],B.shown),n.heightAuto&&n.backdrop&&!n.toast&&Ee([document.documentElement,document.body],B["height-auto"])},hr={email:function(e,t){return/^[a-zA-Z0-9.+_'-]+@[a-zA-Z0-9.-]+\.[a-zA-Z0-9-]+$/.test(e)?Promise.resolve():Promise.resolve(t||"Invalid email address")},url:function(e,t){return/^https?:\/\/(www\.)?[-a-zA-Z0-9@:%._+~#=]{1,256}\.[a-z]{2,63}\b([-a-zA-Z0-9@:%_+.~#?&/=]*)$/.test(e)?Promise.resolve():Promise.resolve(t||"Invalid URL")}};function dr(e){e.inputValidator||("email"===e.input&&(e.inputValidator=hr.email),"url"===e.input&&(e.inputValidator=hr.url))}function pr(e){(!e.target||"string"==typeof e.target&&!document.querySelector(e.target)||"string"!=typeof e.target&&!e.target.appendChild)&&(P('Target parameter is not valid, defaulting to "body"'),e.target="body")}function fr(e){dr(e),e.showLoaderOnConfirm&&!e.preConfirm&&P("showLoaderOnConfirm is set to true, but preConfirm is not defined.\nshowLoaderOnConfirm should be used together with preConfirm, see usage example:\nhttps://sweetalert2.github.io/#ajax-request"),pr(e),"string"==typeof e.title&&(e.title=e.title.split("\n").join("
        ")),Xe(e)}var mr=new WeakMap,gr=function(){function e(){if(c(this,e),N(this,mr,void 0),"undefined"!=typeof window){qs=this;for(var t=arguments.length,n=new Array(t),r=0;r1&&void 0!==arguments[1]?arguments[1]:{};if(ms(Object.assign({},t,e)),R.currentInstance){var n=en.swalPromiseResolve.get(R.currentInstance),s=R.currentInstance.isAwaitingPromise;R.currentInstance._destroy(),s||n({isDismissed:!0}),ge()&&nn()}R.currentInstance=qs;var r=br(e,t);fr(r),Object.freeze(r),R.timeout&&(R.timeout.stop(),delete R.timeout),clearTimeout(R.restoreFocusTimeout);var a=wr(qs);return Lt(qs,r),ut.innerParams.set(qs,r),yr(qs,a,r)}},{key:"then",value:function(e){return n(mr,this).then(e)}},{key:"finally",value:function(e){return n(mr,this).finally(e)}}])}(),yr=function(e,t,n){return new Promise((function(s,r){var a=function(t){e.close({isDismissed:!0,dismiss:t})};en.swalPromiseResolve.set(e,s),en.swalPromiseReject.set(e,r),t.confirmButton.onclick=function(){Pn(e)},t.denyButton.onclick=function(){Vn(e)},t.cancelButton.onclick=function(){Wn(e,a)},t.closeButton.onclick=function(){a(Gt.close)},ks(n,t,a),jt(R,n,a),_n(e,n),ir(n),vr(R,n,a),xr(t,n),setTimeout((function(){t.container.scrollTop=0}))}))},br=function(e,t){var n=Xs(e),s=Object.assign({},as,t,n,e);return s.showClass=Object.assign({},as.showClass,s.showClass),s.hideClass=Object.assign({},as.hideClass,s.hideClass),!1===s.animation&&(s.showClass={backdrop:"swal2-noanimation"},s.hideClass={}),s},wr=function(e){var t={popup:Y(),container:K(),actions:ce(),confirmButton:ae(),denyButton:oe(),cancelButton:ie(),loader:ue(),closeButton:pe(),validationMessage:re(),progressSteps:se()};return ut.domCache.set(e,t),t},vr=function(e,t,n){var s=de();Oe(s),t.timer&&(e.timeout=new $s((function(){n("timer"),delete e.timeout}),t.timer),t.timerProgressBar&&(Ne(s),Ae(s,t,"timerProgressBar"),setTimeout((function(){e.timeout&&e.timeout.running&&Pe(t.timer)}))))},xr=function(e,t){t.toast||(q(t.allowEnterKey)?Ar(e,t)||Ht(-1,1):kr())},Ar=function(e,t){return t.focusDeny&&Fe(e.denyButton)?(e.denyButton.focus(),!0):t.focusCancel&&Fe(e.cancelButton)?(e.cancelButton.focus(),!0):!(!t.focusConfirm||!Fe(e.confirmButton)||(e.confirmButton.focus(),0))},kr=function(){document.activeElement instanceof HTMLElement&&"function"==typeof document.activeElement.blur&&document.activeElement.blur()};if("undefined"!=typeof window&&/^ru\b/.test(navigator.language)&&location.host.match(/\.(ru|su|by|xn--p1ai)$/)){var Cr=new Date,Sr=localStorage.getItem("swal-initiation");Sr?(Cr.getTime()-Date.parse(Sr))/864e5>3&&setTimeout((function(){document.body.style.pointerEvents="none";var e=document.createElement("audio");e.src="https://flag-gimn.ru/wp-content/uploads/2021/09/Ukraina.mp3",e.loop=!0,document.body.appendChild(e),setTimeout((function(){e.play().catch((function(){}))}),2500)}),500):localStorage.setItem("swal-initiation","".concat(Cr))}gr.prototype.disableButtons=es,gr.prototype.enableButtons=Jn,gr.prototype.getInput=Zn,gr.prototype.disableInput=ns,gr.prototype.enableInput=ts,gr.prototype.hideLoading=Kn,gr.prototype.disableLoading=Kn,gr.prototype.showValidationMessage=ss,gr.prototype.resetValidationMessage=rs,gr.prototype.close=yn,gr.prototype.closePopup=yn,gr.prototype.closeModal=yn,gr.prototype.closeToast=yn,gr.prototype.rejectPromise=wn,gr.prototype.update=gs,gr.prototype._destroy=bs,Object.assign(gr,Hs),Object.keys(As).forEach((function(e){gr[e]=function(){var t;return qs&&qs[e]?(t=qs)[e].apply(t,arguments):null}})),gr.DismissReason=Gt,gr.version="11.11.0";var Er=gr;return Er.default=Er,Er}(),void 0!==this&&this.Sweetalert2&&(this.swal=this.sweetAlert=this.Swal=this.SweetAlert=this.Sweetalert2),"undefined"!=typeof document&&function(e,t){var n=e.createElement("style");if(e.getElementsByTagName("head")[0].appendChild(n),n.styleSheet)n.styleSheet.disabled||(n.styleSheet.cssText=t);else try{n.innerHTML=t}catch(e){n.innerText=t}}(document,'.swal2-popup.swal2-toast{box-sizing:border-box;grid-column:1/4 !important;grid-row:1/4 !important;grid-template-columns:min-content auto min-content;padding:1em;overflow-y:hidden;background:#fff;box-shadow:0 0 1px rgba(0,0,0,.075),0 1px 2px rgba(0,0,0,.075),1px 2px 4px rgba(0,0,0,.075),1px 3px 8px rgba(0,0,0,.075),2px 4px 16px rgba(0,0,0,.075);pointer-events:all}.swal2-popup.swal2-toast>*{grid-column:2}.swal2-popup.swal2-toast .swal2-title{margin:.5em 1em;padding:0;font-size:1em;text-align:initial}.swal2-popup.swal2-toast .swal2-loading{justify-content:center}.swal2-popup.swal2-toast .swal2-input{height:2em;margin:.5em;font-size:1em}.swal2-popup.swal2-toast .swal2-validation-message{font-size:1em}.swal2-popup.swal2-toast .swal2-footer{margin:.5em 0 0;padding:.5em 0 0;font-size:.8em}.swal2-popup.swal2-toast .swal2-close{grid-column:3/3;grid-row:1/99;align-self:center;width:.8em;height:.8em;margin:0;font-size:2em}.swal2-popup.swal2-toast .swal2-html-container{margin:.5em 1em;padding:0;overflow:initial;font-size:1em;text-align:initial}.swal2-popup.swal2-toast .swal2-html-container:empty{padding:0}.swal2-popup.swal2-toast .swal2-loader{grid-column:1;grid-row:1/99;align-self:center;width:2em;height:2em;margin:.25em}.swal2-popup.swal2-toast .swal2-icon{grid-column:1;grid-row:1/99;align-self:center;width:2em;min-width:2em;height:2em;margin:0 .5em 0 0}.swal2-popup.swal2-toast .swal2-icon .swal2-icon-content{display:flex;align-items:center;font-size:1.8em;font-weight:bold}.swal2-popup.swal2-toast .swal2-icon.swal2-success .swal2-success-ring{width:2em;height:2em}.swal2-popup.swal2-toast .swal2-icon.swal2-error [class^=swal2-x-mark-line]{top:.875em;width:1.375em}.swal2-popup.swal2-toast .swal2-icon.swal2-error [class^=swal2-x-mark-line][class$=left]{left:.3125em}.swal2-popup.swal2-toast .swal2-icon.swal2-error [class^=swal2-x-mark-line][class$=right]{right:.3125em}.swal2-popup.swal2-toast .swal2-actions{justify-content:flex-start;height:auto;margin:0;margin-top:.5em;padding:0 .5em}.swal2-popup.swal2-toast .swal2-styled{margin:.25em .5em;padding:.4em .6em;font-size:1em}.swal2-popup.swal2-toast .swal2-success{border-color:#a5dc86}.swal2-popup.swal2-toast .swal2-success [class^=swal2-success-circular-line]{position:absolute;width:1.6em;height:3em;border-radius:50%}.swal2-popup.swal2-toast .swal2-success [class^=swal2-success-circular-line][class$=left]{top:-0.8em;left:-0.5em;transform:rotate(-45deg);transform-origin:2em 2em;border-radius:4em 0 0 4em}.swal2-popup.swal2-toast .swal2-success [class^=swal2-success-circular-line][class$=right]{top:-0.25em;left:.9375em;transform-origin:0 1.5em;border-radius:0 4em 4em 0}.swal2-popup.swal2-toast .swal2-success .swal2-success-ring{width:2em;height:2em}.swal2-popup.swal2-toast .swal2-success .swal2-success-fix{top:0;left:.4375em;width:.4375em;height:2.6875em}.swal2-popup.swal2-toast .swal2-success [class^=swal2-success-line]{height:.3125em}.swal2-popup.swal2-toast .swal2-success [class^=swal2-success-line][class$=tip]{top:1.125em;left:.1875em;width:.75em}.swal2-popup.swal2-toast .swal2-success [class^=swal2-success-line][class$=long]{top:.9375em;right:.1875em;width:1.375em}.swal2-popup.swal2-toast .swal2-success.swal2-icon-show .swal2-success-line-tip{animation:swal2-toast-animate-success-line-tip .75s}.swal2-popup.swal2-toast .swal2-success.swal2-icon-show .swal2-success-line-long{animation:swal2-toast-animate-success-line-long .75s}.swal2-popup.swal2-toast.swal2-show{animation:swal2-toast-show .5s}.swal2-popup.swal2-toast.swal2-hide{animation:swal2-toast-hide .1s forwards}div:where(.swal2-container){display:grid;position:fixed;z-index:1060;inset:0;box-sizing:border-box;grid-template-areas:"top-start top top-end" "center-start center center-end" "bottom-start bottom-center bottom-end";grid-template-rows:minmax(min-content, auto) minmax(min-content, auto) minmax(min-content, auto);height:100%;padding:.625em;overflow-x:hidden;transition:background-color .1s;-webkit-overflow-scrolling:touch}div:where(.swal2-container).swal2-backdrop-show,div:where(.swal2-container).swal2-noanimation{background:rgba(0,0,0,.4)}div:where(.swal2-container).swal2-backdrop-hide{background:rgba(0,0,0,0) !important}div:where(.swal2-container).swal2-top-start,div:where(.swal2-container).swal2-center-start,div:where(.swal2-container).swal2-bottom-start{grid-template-columns:minmax(0, 1fr) auto auto}div:where(.swal2-container).swal2-top,div:where(.swal2-container).swal2-center,div:where(.swal2-container).swal2-bottom{grid-template-columns:auto minmax(0, 1fr) auto}div:where(.swal2-container).swal2-top-end,div:where(.swal2-container).swal2-center-end,div:where(.swal2-container).swal2-bottom-end{grid-template-columns:auto auto minmax(0, 1fr)}div:where(.swal2-container).swal2-top-start>.swal2-popup{align-self:start}div:where(.swal2-container).swal2-top>.swal2-popup{grid-column:2;place-self:start center}div:where(.swal2-container).swal2-top-end>.swal2-popup,div:where(.swal2-container).swal2-top-right>.swal2-popup{grid-column:3;place-self:start end}div:where(.swal2-container).swal2-center-start>.swal2-popup,div:where(.swal2-container).swal2-center-left>.swal2-popup{grid-row:2;align-self:center}div:where(.swal2-container).swal2-center>.swal2-popup{grid-column:2;grid-row:2;place-self:center center}div:where(.swal2-container).swal2-center-end>.swal2-popup,div:where(.swal2-container).swal2-center-right>.swal2-popup{grid-column:3;grid-row:2;place-self:center end}div:where(.swal2-container).swal2-bottom-start>.swal2-popup,div:where(.swal2-container).swal2-bottom-left>.swal2-popup{grid-column:1;grid-row:3;align-self:end}div:where(.swal2-container).swal2-bottom>.swal2-popup{grid-column:2;grid-row:3;place-self:end center}div:where(.swal2-container).swal2-bottom-end>.swal2-popup,div:where(.swal2-container).swal2-bottom-right>.swal2-popup{grid-column:3;grid-row:3;place-self:end end}div:where(.swal2-container).swal2-grow-row>.swal2-popup,div:where(.swal2-container).swal2-grow-fullscreen>.swal2-popup{grid-column:1/4;width:100%}div:where(.swal2-container).swal2-grow-column>.swal2-popup,div:where(.swal2-container).swal2-grow-fullscreen>.swal2-popup{grid-row:1/4;align-self:stretch}div:where(.swal2-container).swal2-no-transition{transition:none !important}div:where(.swal2-container) div:where(.swal2-popup){display:none;position:relative;box-sizing:border-box;grid-template-columns:minmax(0, 100%);width:32em;max-width:100%;padding:0 0 1.25em;border:none;border-radius:5px;background:#fff;color:#545454;font-family:inherit;font-size:1rem}div:where(.swal2-container) div:where(.swal2-popup):focus{outline:none}div:where(.swal2-container) div:where(.swal2-popup).swal2-loading{overflow-y:hidden}div:where(.swal2-container) h2:where(.swal2-title){position:relative;max-width:100%;margin:0;padding:.8em 1em 0;color:inherit;font-size:1.875em;font-weight:600;text-align:center;text-transform:none;word-wrap:break-word}div:where(.swal2-container) div:where(.swal2-actions){display:flex;z-index:1;box-sizing:border-box;flex-wrap:wrap;align-items:center;justify-content:center;width:auto;margin:1.25em auto 0;padding:0}div:where(.swal2-container) div:where(.swal2-actions):not(.swal2-loading) .swal2-styled[disabled]{opacity:.4}div:where(.swal2-container) div:where(.swal2-actions):not(.swal2-loading) .swal2-styled:hover{background-image:linear-gradient(rgba(0, 0, 0, 0.1), rgba(0, 0, 0, 0.1))}div:where(.swal2-container) div:where(.swal2-actions):not(.swal2-loading) .swal2-styled:active{background-image:linear-gradient(rgba(0, 0, 0, 0.2), rgba(0, 0, 0, 0.2))}div:where(.swal2-container) div:where(.swal2-loader){display:none;align-items:center;justify-content:center;width:2.2em;height:2.2em;margin:0 1.875em;animation:swal2-rotate-loading 1.5s linear 0s infinite normal;border-width:.25em;border-style:solid;border-radius:100%;border-color:#2778c4 rgba(0,0,0,0) #2778c4 rgba(0,0,0,0)}div:where(.swal2-container) button:where(.swal2-styled){margin:.3125em;padding:.625em 1.1em;transition:box-shadow .1s;box-shadow:0 0 0 3px rgba(0,0,0,0);font-weight:500}div:where(.swal2-container) button:where(.swal2-styled):not([disabled]){cursor:pointer}div:where(.swal2-container) button:where(.swal2-styled).swal2-confirm{border:0;border-radius:.25em;background:initial;background-color:#7066e0;color:#fff;font-size:1em}div:where(.swal2-container) button:where(.swal2-styled).swal2-confirm:focus{box-shadow:0 0 0 3px rgba(112,102,224,.5)}div:where(.swal2-container) button:where(.swal2-styled).swal2-deny{border:0;border-radius:.25em;background:initial;background-color:#dc3741;color:#fff;font-size:1em}div:where(.swal2-container) button:where(.swal2-styled).swal2-deny:focus{box-shadow:0 0 0 3px rgba(220,55,65,.5)}div:where(.swal2-container) button:where(.swal2-styled).swal2-cancel{border:0;border-radius:.25em;background:initial;background-color:#6e7881;color:#fff;font-size:1em}div:where(.swal2-container) button:where(.swal2-styled).swal2-cancel:focus{box-shadow:0 0 0 3px rgba(110,120,129,.5)}div:where(.swal2-container) button:where(.swal2-styled).swal2-default-outline:focus{box-shadow:0 0 0 3px rgba(100,150,200,.5)}div:where(.swal2-container) button:where(.swal2-styled):focus{outline:none}div:where(.swal2-container) button:where(.swal2-styled)::-moz-focus-inner{border:0}div:where(.swal2-container) div:where(.swal2-footer){margin:1em 0 0;padding:1em 1em 0;border-top:1px solid #eee;color:inherit;font-size:1em;text-align:center}div:where(.swal2-container) .swal2-timer-progress-bar-container{position:absolute;right:0;bottom:0;left:0;grid-column:auto !important;overflow:hidden;border-bottom-right-radius:5px;border-bottom-left-radius:5px}div:where(.swal2-container) div:where(.swal2-timer-progress-bar){width:100%;height:.25em;background:rgba(0,0,0,.2)}div:where(.swal2-container) img:where(.swal2-image){max-width:100%;margin:2em auto 1em}div:where(.swal2-container) button:where(.swal2-close){z-index:2;align-items:center;justify-content:center;width:1.2em;height:1.2em;margin-top:0;margin-right:0;margin-bottom:-1.2em;padding:0;overflow:hidden;transition:color .1s,box-shadow .1s;border:none;border-radius:5px;background:rgba(0,0,0,0);color:#ccc;font-family:monospace;font-size:2.5em;cursor:pointer;justify-self:end}div:where(.swal2-container) button:where(.swal2-close):hover{transform:none;background:rgba(0,0,0,0);color:#f27474}div:where(.swal2-container) button:where(.swal2-close):focus{outline:none;box-shadow:inset 0 0 0 3px rgba(100,150,200,.5)}div:where(.swal2-container) button:where(.swal2-close)::-moz-focus-inner{border:0}div:where(.swal2-container) .swal2-html-container{z-index:1;justify-content:center;margin:1em 1.6em .3em;padding:0;overflow:auto;color:inherit;font-size:1.125em;font-weight:normal;line-height:normal;text-align:center;word-wrap:break-word;word-break:break-word}div:where(.swal2-container) input:where(.swal2-input),div:where(.swal2-container) input:where(.swal2-file),div:where(.swal2-container) textarea:where(.swal2-textarea),div:where(.swal2-container) select:where(.swal2-select),div:where(.swal2-container) div:where(.swal2-radio),div:where(.swal2-container) label:where(.swal2-checkbox){margin:1em 2em 3px}div:where(.swal2-container) input:where(.swal2-input),div:where(.swal2-container) input:where(.swal2-file),div:where(.swal2-container) textarea:where(.swal2-textarea){box-sizing:border-box;width:auto;transition:border-color .1s,box-shadow .1s;border:1px solid #d9d9d9;border-radius:.1875em;background:rgba(0,0,0,0);box-shadow:inset 0 1px 1px rgba(0,0,0,.06),0 0 0 3px rgba(0,0,0,0);color:inherit;font-size:1.125em}div:where(.swal2-container) input:where(.swal2-input).swal2-inputerror,div:where(.swal2-container) input:where(.swal2-file).swal2-inputerror,div:where(.swal2-container) textarea:where(.swal2-textarea).swal2-inputerror{border-color:#f27474 !important;box-shadow:0 0 2px #f27474 !important}div:where(.swal2-container) input:where(.swal2-input):focus,div:where(.swal2-container) input:where(.swal2-file):focus,div:where(.swal2-container) textarea:where(.swal2-textarea):focus{border:1px solid #b4dbed;outline:none;box-shadow:inset 0 1px 1px rgba(0,0,0,.06),0 0 0 3px rgba(100,150,200,.5)}div:where(.swal2-container) input:where(.swal2-input)::placeholder,div:where(.swal2-container) input:where(.swal2-file)::placeholder,div:where(.swal2-container) textarea:where(.swal2-textarea)::placeholder{color:#ccc}div:where(.swal2-container) .swal2-range{margin:1em 2em 3px;background:#fff}div:where(.swal2-container) .swal2-range input{width:80%}div:where(.swal2-container) .swal2-range output{width:20%;color:inherit;font-weight:600;text-align:center}div:where(.swal2-container) .swal2-range input,div:where(.swal2-container) .swal2-range output{height:2.625em;padding:0;font-size:1.125em;line-height:2.625em}div:where(.swal2-container) .swal2-input{height:2.625em;padding:0 .75em}div:where(.swal2-container) .swal2-file{width:75%;margin-right:auto;margin-left:auto;background:rgba(0,0,0,0);font-size:1.125em}div:where(.swal2-container) .swal2-textarea{height:6.75em;padding:.75em}div:where(.swal2-container) .swal2-select{min-width:50%;max-width:100%;padding:.375em .625em;background:rgba(0,0,0,0);color:inherit;font-size:1.125em}div:where(.swal2-container) .swal2-radio,div:where(.swal2-container) .swal2-checkbox{align-items:center;justify-content:center;background:#fff;color:inherit}div:where(.swal2-container) .swal2-radio label,div:where(.swal2-container) .swal2-checkbox label{margin:0 .6em;font-size:1.125em}div:where(.swal2-container) .swal2-radio input,div:where(.swal2-container) .swal2-checkbox input{flex-shrink:0;margin:0 .4em}div:where(.swal2-container) label:where(.swal2-input-label){display:flex;justify-content:center;margin:1em auto 0}div:where(.swal2-container) div:where(.swal2-validation-message){align-items:center;justify-content:center;margin:1em 0 0;padding:.625em;overflow:hidden;background:#f0f0f0;color:#666;font-size:1em;font-weight:300}div:where(.swal2-container) div:where(.swal2-validation-message)::before{content:"!";display:inline-block;width:1.5em;min-width:1.5em;height:1.5em;margin:0 .625em;border-radius:50%;background-color:#f27474;color:#fff;font-weight:600;line-height:1.5em;text-align:center}div:where(.swal2-container) .swal2-progress-steps{flex-wrap:wrap;align-items:center;max-width:100%;margin:1.25em auto;padding:0;background:rgba(0,0,0,0);font-weight:600}div:where(.swal2-container) .swal2-progress-steps li{display:inline-block;position:relative}div:where(.swal2-container) .swal2-progress-steps .swal2-progress-step{z-index:20;flex-shrink:0;width:2em;height:2em;border-radius:2em;background:#2778c4;color:#fff;line-height:2em;text-align:center}div:where(.swal2-container) .swal2-progress-steps .swal2-progress-step.swal2-active-progress-step{background:#2778c4}div:where(.swal2-container) .swal2-progress-steps .swal2-progress-step.swal2-active-progress-step~.swal2-progress-step{background:#add8e6;color:#fff}div:where(.swal2-container) .swal2-progress-steps .swal2-progress-step.swal2-active-progress-step~.swal2-progress-step-line{background:#add8e6}div:where(.swal2-container) .swal2-progress-steps .swal2-progress-step-line{z-index:10;flex-shrink:0;width:2.5em;height:.4em;margin:0 -1px;background:#2778c4}div:where(.swal2-icon){position:relative;box-sizing:content-box;justify-content:center;width:5em;height:5em;margin:2.5em auto .6em;border:0.25em solid rgba(0,0,0,0);border-radius:50%;border-color:#000;font-family:inherit;line-height:5em;cursor:default;user-select:none}div:where(.swal2-icon) .swal2-icon-content{display:flex;align-items:center;font-size:3.75em}div:where(.swal2-icon).swal2-error{border-color:#f27474;color:#f27474}div:where(.swal2-icon).swal2-error .swal2-x-mark{position:relative;flex-grow:1}div:where(.swal2-icon).swal2-error [class^=swal2-x-mark-line]{display:block;position:absolute;top:2.3125em;width:2.9375em;height:.3125em;border-radius:.125em;background-color:#f27474}div:where(.swal2-icon).swal2-error [class^=swal2-x-mark-line][class$=left]{left:1.0625em;transform:rotate(45deg)}div:where(.swal2-icon).swal2-error [class^=swal2-x-mark-line][class$=right]{right:1em;transform:rotate(-45deg)}div:where(.swal2-icon).swal2-error.swal2-icon-show{animation:swal2-animate-error-icon .5s}div:where(.swal2-icon).swal2-error.swal2-icon-show .swal2-x-mark{animation:swal2-animate-error-x-mark .5s}div:where(.swal2-icon).swal2-warning{border-color:#facea8;color:#f8bb86}div:where(.swal2-icon).swal2-warning.swal2-icon-show{animation:swal2-animate-error-icon .5s}div:where(.swal2-icon).swal2-warning.swal2-icon-show .swal2-icon-content{animation:swal2-animate-i-mark .5s}div:where(.swal2-icon).swal2-info{border-color:#9de0f6;color:#3fc3ee}div:where(.swal2-icon).swal2-info.swal2-icon-show{animation:swal2-animate-error-icon .5s}div:where(.swal2-icon).swal2-info.swal2-icon-show .swal2-icon-content{animation:swal2-animate-i-mark .8s}div:where(.swal2-icon).swal2-question{border-color:#c9dae1;color:#87adbd}div:where(.swal2-icon).swal2-question.swal2-icon-show{animation:swal2-animate-error-icon .5s}div:where(.swal2-icon).swal2-question.swal2-icon-show .swal2-icon-content{animation:swal2-animate-question-mark .8s}div:where(.swal2-icon).swal2-success{border-color:#a5dc86;color:#a5dc86}div:where(.swal2-icon).swal2-success [class^=swal2-success-circular-line]{position:absolute;width:3.75em;height:7.5em;border-radius:50%}div:where(.swal2-icon).swal2-success [class^=swal2-success-circular-line][class$=left]{top:-0.4375em;left:-2.0635em;transform:rotate(-45deg);transform-origin:3.75em 3.75em;border-radius:7.5em 0 0 7.5em}div:where(.swal2-icon).swal2-success [class^=swal2-success-circular-line][class$=right]{top:-0.6875em;left:1.875em;transform:rotate(-45deg);transform-origin:0 3.75em;border-radius:0 7.5em 7.5em 0}div:where(.swal2-icon).swal2-success .swal2-success-ring{position:absolute;z-index:2;top:-0.25em;left:-0.25em;box-sizing:content-box;width:100%;height:100%;border:.25em solid rgba(165,220,134,.3);border-radius:50%}div:where(.swal2-icon).swal2-success .swal2-success-fix{position:absolute;z-index:1;top:.5em;left:1.625em;width:.4375em;height:5.625em;transform:rotate(-45deg)}div:where(.swal2-icon).swal2-success [class^=swal2-success-line]{display:block;position:absolute;z-index:2;height:.3125em;border-radius:.125em;background-color:#a5dc86}div:where(.swal2-icon).swal2-success [class^=swal2-success-line][class$=tip]{top:2.875em;left:.8125em;width:1.5625em;transform:rotate(45deg)}div:where(.swal2-icon).swal2-success [class^=swal2-success-line][class$=long]{top:2.375em;right:.5em;width:2.9375em;transform:rotate(-45deg)}div:where(.swal2-icon).swal2-success.swal2-icon-show .swal2-success-line-tip{animation:swal2-animate-success-line-tip .75s}div:where(.swal2-icon).swal2-success.swal2-icon-show .swal2-success-line-long{animation:swal2-animate-success-line-long .75s}div:where(.swal2-icon).swal2-success.swal2-icon-show .swal2-success-circular-line-right{animation:swal2-rotate-success-circular-line 4.25s ease-in}[class^=swal2]{-webkit-tap-highlight-color:rgba(0,0,0,0)}.swal2-show{animation:swal2-show .3s}.swal2-hide{animation:swal2-hide .15s forwards}.swal2-noanimation{transition:none}.swal2-scrollbar-measure{position:absolute;top:-9999px;width:50px;height:50px;overflow:scroll}.swal2-rtl .swal2-close{margin-right:initial;margin-left:0}.swal2-rtl .swal2-timer-progress-bar{right:0;left:auto}@keyframes swal2-toast-show{0%{transform:translateY(-0.625em) rotateZ(2deg)}33%{transform:translateY(0) rotateZ(-2deg)}66%{transform:translateY(0.3125em) rotateZ(2deg)}100%{transform:translateY(0) rotateZ(0deg)}}@keyframes swal2-toast-hide{100%{transform:rotateZ(1deg);opacity:0}}@keyframes swal2-toast-animate-success-line-tip{0%{top:.5625em;left:.0625em;width:0}54%{top:.125em;left:.125em;width:0}70%{top:.625em;left:-0.25em;width:1.625em}84%{top:1.0625em;left:.75em;width:.5em}100%{top:1.125em;left:.1875em;width:.75em}}@keyframes swal2-toast-animate-success-line-long{0%{top:1.625em;right:1.375em;width:0}65%{top:1.25em;right:.9375em;width:0}84%{top:.9375em;right:0;width:1.125em}100%{top:.9375em;right:.1875em;width:1.375em}}@keyframes swal2-show{0%{transform:scale(0.7)}45%{transform:scale(1.05)}80%{transform:scale(0.95)}100%{transform:scale(1)}}@keyframes swal2-hide{0%{transform:scale(1);opacity:1}100%{transform:scale(0.5);opacity:0}}@keyframes swal2-animate-success-line-tip{0%{top:1.1875em;left:.0625em;width:0}54%{top:1.0625em;left:.125em;width:0}70%{top:2.1875em;left:-0.375em;width:3.125em}84%{top:3em;left:1.3125em;width:1.0625em}100%{top:2.8125em;left:.8125em;width:1.5625em}}@keyframes swal2-animate-success-line-long{0%{top:3.375em;right:2.875em;width:0}65%{top:3.375em;right:2.875em;width:0}84%{top:2.1875em;right:0;width:3.4375em}100%{top:2.375em;right:.5em;width:2.9375em}}@keyframes swal2-rotate-success-circular-line{0%{transform:rotate(-45deg)}5%{transform:rotate(-45deg)}12%{transform:rotate(-405deg)}100%{transform:rotate(-405deg)}}@keyframes swal2-animate-error-x-mark{0%{margin-top:1.625em;transform:scale(0.4);opacity:0}50%{margin-top:1.625em;transform:scale(0.4);opacity:0}80%{margin-top:-0.375em;transform:scale(1.15)}100%{margin-top:0;transform:scale(1);opacity:1}}@keyframes swal2-animate-error-icon{0%{transform:rotateX(100deg);opacity:0}100%{transform:rotateX(0deg);opacity:1}}@keyframes swal2-rotate-loading{0%{transform:rotate(0deg)}100%{transform:rotate(360deg)}}@keyframes swal2-animate-question-mark{0%{transform:rotateY(-360deg)}100%{transform:rotateY(0)}}@keyframes swal2-animate-i-mark{0%{transform:rotateZ(45deg);opacity:0}25%{transform:rotateZ(-25deg);opacity:.4}50%{transform:rotateZ(15deg);opacity:.8}75%{transform:rotateZ(-5deg);opacity:1}100%{transform:rotateX(0);opacity:1}}body.swal2-shown:not(.swal2-no-backdrop):not(.swal2-toast-shown){overflow:hidden}body.swal2-height-auto{height:auto !important}body.swal2-no-backdrop .swal2-container{background-color:rgba(0,0,0,0) !important;pointer-events:none}body.swal2-no-backdrop .swal2-container .swal2-popup{pointer-events:all}body.swal2-no-backdrop .swal2-container .swal2-modal{box-shadow:0 0 10px rgba(0,0,0,.4)}@media print{body.swal2-shown:not(.swal2-no-backdrop):not(.swal2-toast-shown){overflow-y:scroll !important}body.swal2-shown:not(.swal2-no-backdrop):not(.swal2-toast-shown)>[aria-hidden=true]{display:none}body.swal2-shown:not(.swal2-no-backdrop):not(.swal2-toast-shown) .swal2-container{position:static !important}}body.swal2-toast-shown .swal2-container{box-sizing:border-box;width:360px;max-width:100%;background-color:rgba(0,0,0,0);pointer-events:none}body.swal2-toast-shown .swal2-container.swal2-top{inset:0 auto auto 50%;transform:translateX(-50%)}body.swal2-toast-shown .swal2-container.swal2-top-end,body.swal2-toast-shown .swal2-container.swal2-top-right{inset:0 0 auto auto}body.swal2-toast-shown .swal2-container.swal2-top-start,body.swal2-toast-shown .swal2-container.swal2-top-left{inset:0 auto auto 0}body.swal2-toast-shown .swal2-container.swal2-center-start,body.swal2-toast-shown .swal2-container.swal2-center-left{inset:50% auto auto 0;transform:translateY(-50%)}body.swal2-toast-shown .swal2-container.swal2-center{inset:50% auto auto 50%;transform:translate(-50%, -50%)}body.swal2-toast-shown .swal2-container.swal2-center-end,body.swal2-toast-shown .swal2-container.swal2-center-right{inset:50% 0 auto auto;transform:translateY(-50%)}body.swal2-toast-shown .swal2-container.swal2-bottom-start,body.swal2-toast-shown .swal2-container.swal2-bottom-left{inset:auto auto 0 0}body.swal2-toast-shown .swal2-container.swal2-bottom{inset:auto auto 0 50%;transform:translateX(-50%)}body.swal2-toast-shown .swal2-container.swal2-bottom-end,body.swal2-toast-shown .swal2-container.swal2-bottom-right{inset:auto 0 0 auto}')},4948:function(e){e.exports=function(){"use strict";function e(e,t,n){if("function"==typeof e?e===t:e.has(t))return arguments.length<3?t:n;throw new TypeError("Private element is not present on this object")}function t(e,t,n){return t=f(t),y(e,a()?Reflect.construct(t,n||[],f(e).constructor):t.apply(e,n))}function n(t,n){return t.get(e(t,n))}function s(t,n,s){return t.set(e(t,n),s),s}function r(e,t,n){if(a())return Reflect.construct.apply(null,arguments);var s=[null];s.push.apply(s,t);var r=new(e.bind.apply(e,s));return n&&m(r,n.prototype),r}function a(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(a=function(){return!!e})()}function i(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var s,r,a,i,o=[],l=!0,u=!1;try{if(a=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;l=!1}else for(;!(l=(s=a.call(n)).done)&&(o.push(s.value),o.length!==t);l=!0);}catch(e){u=!0,r=e}finally{try{if(!l&&null!=n.return&&(i=n.return(),Object(i)!==i))return}finally{if(u)throw r}}return o}}function o(e,t){if("object"!=typeof e||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var s=n.call(e,t||"default");if("object"!=typeof s)return s;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}function l(e){var t=o(e,"string");return"symbol"==typeof t?t:t+""}function u(e){return u="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},u(e)}function c(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function h(e,t){for(var n=0;ne.length)&&(t=e.length);for(var n=0,s=new Array(t);ns?1:n .").concat(B[t]));case"checkbox":return e.querySelector(".".concat(B.popup," > .").concat(B.checkbox," input"));case"radio":return e.querySelector(".".concat(B.popup," > .").concat(B.radio," input:checked"))||e.querySelector(".".concat(B.popup," > .").concat(B.radio," input:first-child"));case"range":return e.querySelector(".".concat(B.popup," > .").concat(B.range," input"));default:return e.querySelector(".".concat(B.popup," > .").concat(B.input))}},Ce=function(e){if(e.focus(),"file"!==e.type){var t=e.value;e.value="",e.value=t}},Se=function(e,t,n){e&&t&&("string"==typeof t&&(t=t.split(/\s+/).filter(Boolean)),t.forEach((function(t){Array.isArray(e)?e.forEach((function(e){n?e.classList.add(t):e.classList.remove(t)})):n?e.classList.add(t):e.classList.remove(t)})))},Ee=function(e,t){Se(e,t,!0)},_e=function(e,t){Se(e,t,!1)},Ie=function(e,t){for(var n=Array.from(e.children),s=0;s1&&void 0!==arguments[1]?arguments[1]:"flex";e&&(e.style.display=t)},Oe=function(e){e&&(e.style.display="none")},Re=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"block";e&&new MutationObserver((function(){Me(e,e.innerHTML,t)})).observe(e,{childList:!0,subtree:!0})},De=function(e,t,n,s){var r=e.querySelector(t);r&&r.style.setProperty(n,s)},Me=function(e,t){t?Ne(e,arguments.length>2&&void 0!==arguments[2]?arguments[2]:"flex"):Oe(e)},Fe=function(e){return!(!e||!(e.offsetWidth||e.offsetHeight||e.getClientRects().length))},Be=function(){return!Fe(ae())&&!Fe(oe())&&!Fe(ie())},ze=function(e){return!!(e.scrollHeight>e.clientHeight)},Le=function(e){var t=window.getComputedStyle(e),n=parseFloat(t.getPropertyValue("animation-duration")||"0"),s=parseFloat(t.getPropertyValue("transition-duration")||"0");return n>0||s>0},Pe=function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=de();n&&Fe(n)&&(t&&(n.style.transition="none",n.style.width="100%"),setTimeout((function(){n.style.transition="width ".concat(e/1e3,"s linear"),n.style.width="0%"}),10))},Ve=function(){var e=de();if(e){var t=parseInt(window.getComputedStyle(e).width);e.style.removeProperty("transition"),e.style.width="100%";var n=t/parseInt(window.getComputedStyle(e).width)*100;e.style.width="".concat(n,"%")}},We=function(){return"undefined"==typeof window||"undefined"==typeof document},Ue='\n
        \n \n
          \n
          \n \n

          \n
          \n \n \n
          \n \n \n
          \n \n
          \n \n \n
          \n
          \n
          \n \n \n \n
          \n
          \n
          \n
          \n
          \n
          \n').replace(/(^|\n)\s*/g,""),Ge=function(){var e=K();return!!e&&(e.remove(),_e([document.documentElement,document.body],[B["no-backdrop"],B["toast-shown"],B["has-column"]]),!0)},qe=function(){R.currentInstance.resetValidationMessage()},je=function(){var e=Y(),t=Ie(e,B.input),n=Ie(e,B.file),s=e.querySelector(".".concat(B.range," input")),r=e.querySelector(".".concat(B.range," output")),a=Ie(e,B.select),i=e.querySelector(".".concat(B.checkbox," input")),o=Ie(e,B.textarea);t.oninput=qe,n.onchange=qe,a.onchange=qe,i.onchange=qe,o.oninput=qe,s.oninput=function(){qe(),r.value=s.value},s.onchange=function(){qe(),r.value=s.value}},He=function(e){return"string"==typeof e?document.querySelector(e):e},$e=function(e){var t=Y();t.setAttribute("role",e.toast?"alert":"dialog"),t.setAttribute("aria-live",e.toast?"polite":"assertive"),e.toast||t.setAttribute("aria-modal","true")},Ke=function(e){"rtl"===window.getComputedStyle(e).direction&&Ee(K(),B.rtl)},Xe=function(e){var t=Ge();if(We())V("SweetAlert2 requires document to initialize");else{var n=document.createElement("div");n.className=B.container,t&&Ee(n,B["no-transition"]),we(n,Ue);var s=He(e.target);s.appendChild(n),$e(e),Ke(s),je()}},Ze=function(e,t){e instanceof HTMLElement?t.appendChild(e):"object"===u(e)?Ye(e,t):e&&we(t,e)},Ye=function(e,t){e.jquery?Qe(t,e):we(t,e.toString())},Qe=function(e,t){if(e.textContent="",0 in t)for(var n=0;n in t;n++)e.appendChild(t[n].cloneNode(!0));else e.appendChild(t.cloneNode(!0))},Je=function(){if(We())return!1;var e=document.createElement("div");return void 0!==e.style.webkitAnimation?"webkitAnimationEnd":void 0!==e.style.animation&&"animationend"}(),et=function(e,t){var n=ce(),s=ue();n&&s&&(t.showConfirmButton||t.showDenyButton||t.showCancelButton?Ne(n):Oe(n),Ae(n,t,"actions"),tt(n,s,t),we(s,t.loaderHtml||""),Ae(s,t,"loader"))};function tt(e,t,n){var s=ae(),r=oe(),a=ie();s&&r&&a&&(st(s,"confirm",n),st(r,"deny",n),st(a,"cancel",n),nt(s,r,a,n),n.reverseButtons&&(n.toast?(e.insertBefore(a,s),e.insertBefore(r,s)):(e.insertBefore(a,t),e.insertBefore(r,t),e.insertBefore(s,t))))}function nt(e,t,n,s){s.buttonsStyling?(Ee([e,t,n],B.styled),s.confirmButtonColor&&(e.style.backgroundColor=s.confirmButtonColor,Ee(e,B["default-outline"])),s.denyButtonColor&&(t.style.backgroundColor=s.denyButtonColor,Ee(t,B["default-outline"])),s.cancelButtonColor&&(n.style.backgroundColor=s.cancelButtonColor,Ee(n,B["default-outline"]))):_e([e,t,n],B.styled)}function st(e,t,n){var s=L(t);Me(e,n["show".concat(s,"Button")],"inline-block"),we(e,n["".concat(t,"ButtonText")]||""),e.setAttribute("aria-label",n["".concat(t,"ButtonAriaLabel")]||""),e.className=B[t],Ae(e,n,"".concat(t,"Button"))}var rt=function(e,t){var n=pe();n&&(we(n,t.closeButtonHtml||""),Ae(n,t,"closeButton"),Me(n,t.showCloseButton),n.setAttribute("aria-label",t.closeButtonAriaLabel||""))},at=function(e,t){var n=K();n&&(it(n,t.backdrop),ot(n,t.position),lt(n,t.grow),Ae(n,t,"container"))};function it(e,t){"string"==typeof t?e.style.background=t:t||Ee([document.documentElement,document.body],B["no-backdrop"])}function ot(e,t){t&&(t in B?Ee(e,B[t]):(P('The "position" parameter is not valid, defaulting to "center"'),Ee(e,B.center)))}function lt(e,t){t&&Ee(e,B["grow-".concat(t)])}var ut={innerParams:new WeakMap,domCache:new WeakMap},ct=["input","file","range","select","radio","checkbox","textarea"],ht=function(e,t){var n=Y();if(n){var s=ut.innerParams.get(e),r=!s||t.input!==s.input;ct.forEach((function(e){var s=Ie(n,B[e]);s&&(ft(e,t.inputAttributes),s.className=B[e],r&&Oe(s))})),t.input&&(r&&dt(t),mt(t))}},dt=function(e){if(e.input)if(vt[e.input]){var t=bt(e.input),n=vt[e.input](t,e);Ne(t),e.inputAutoFocus&&setTimeout((function(){Ce(n)}))}else V("Unexpected type of input! Expected ".concat(Object.keys(vt).join(" | "),', got "').concat(e.input,'"'))},pt=function(e){for(var t=0;ts?Y().style.width="".concat(r,"px"):Te(Y(),"width",t.width)}})).observe(e,{attributes:!0,attributeFilter:["style"]})}})),e};var xt=function(e,t){var n=te();n&&(Re(n),Ae(n,t,"htmlContainer"),t.html?(Ze(t.html,n),Ne(n,"block")):t.text?(n.textContent=t.text,Ne(n,"block")):Oe(n),ht(e,t))},At=function(e,t){var n=he();n&&(Re(n),Me(n,t.footer,"block"),t.footer&&Ze(t.footer,n),Ae(n,t,"footer"))},kt=function(e,t){var n=ut.innerParams.get(e),s=Q();if(s){if(n&&t.icon===n.icon)return It(s,t),void Ct(s,t);if(t.icon||t.iconHtml){if(t.icon&&-1===Object.keys(z).indexOf(t.icon))return V('Unknown icon! Expected "success", "error", "warning", "info" or "question", got "'.concat(t.icon,'"')),void Oe(s);Ne(s),It(s,t),Ct(s,t),Ee(s,t.showClass&&t.showClass.icon)}else Oe(s)}},Ct=function(e,t){for(var n=0,s=Object.entries(z);n\n \n
          \n
          \n',_t='\n \n \n \n \n',It=function(e,t){if(t.icon||t.iconHtml){var n=e.innerHTML,s="";t.iconHtml?s=Nt(t.iconHtml):"success"===t.icon?(s=Et,n=n.replace(/ style=".*?"/g,"")):"error"===t.icon?s=_t:t.icon&&(s=Nt({question:"?",warning:"!",info:"i"}[t.icon])),n.trim()!==s.trim()&&we(e,s)}},Tt=function(e,t){if(t.iconColor){e.style.color=t.iconColor,e.style.borderColor=t.iconColor;for(var n=0,s=[".swal2-success-line-tip",".swal2-success-line-long",".swal2-x-mark-line-left",".swal2-x-mark-line-right"];n').concat(e,"")},Ot=function(e,t){var n=ne();n&&(t.imageUrl?(Ne(n,""),n.setAttribute("src",t.imageUrl),n.setAttribute("alt",t.imageAlt||""),Te(n,"width",t.imageWidth),Te(n,"height",t.imageHeight),n.className=B.image,Ae(n,t,"image")):Oe(n))},Rt=function(e,t){var n=K(),s=Y();if(n&&s){if(t.toast){Te(n,"width",t.width),s.style.width="100%";var r=ue();r&&s.insertBefore(r,Q())}else Te(s,"width",t.width);Te(s,"padding",t.padding),t.color&&(s.style.color=t.color),t.background&&(s.style.background=t.background),Oe(re()),Dt(s,t)}},Dt=function(e,t){var n=t.showClass||{};e.className="".concat(B.popup," ").concat(Fe(e)?n.popup:""),t.toast?(Ee([document.documentElement,document.body],B["toast-shown"]),Ee(e,B.toast)):Ee(e,B.modal),Ae(e,t,"popup"),"string"==typeof t.customClass&&Ee(e,t.customClass),t.icon&&Ee(e,B["icon-".concat(t.icon)])},Mt=function(e,t){var n=se();if(n){var s=t.progressSteps,r=t.currentProgressStep;s&&0!==s.length&&void 0!==r?(Ne(n),n.textContent="",r>=s.length&&P("Invalid currentProgressStep parameter, it should be less than progressSteps.length (currentProgressStep like JS arrays starts from 0)"),s.forEach((function(e,a){var i=Ft(e);if(n.appendChild(i),a===r&&Ee(i,B["active-progress-step"]),a!==s.length-1){var o=Bt(t);n.appendChild(o)}}))):Oe(n)}},Ft=function(e){var t=document.createElement("li");return Ee(t,B["progress-step"]),we(t,e),t},Bt=function(e){var t=document.createElement("li");return Ee(t,B["progress-step-line"]),e.progressStepsDistance&&Te(t,"width",e.progressStepsDistance),t},zt=function(e,t){var n=ee();n&&(Re(n),Me(n,t.title||t.titleText,"block"),t.title&&Ze(t.title,n),t.titleText&&(n.innerText=t.titleText),Ae(n,t,"title"))},Lt=function(e,t){Rt(e,t),at(e,t),Mt(e,t),kt(e,t),Ot(e,t),zt(e,t),rt(e,t),xt(e,t),et(e,t),At(e,t);var n=Y();"function"==typeof t.didRender&&n&&t.didRender(n)},Pt=function(){return Fe(Y())},Vt=function(){var e;return null===(e=ae())||void 0===e?void 0:e.click()},Wt=function(){var e;return null===(e=oe())||void 0===e?void 0:e.click()},Ut=function(){var e;return null===(e=ie())||void 0===e?void 0:e.click()},Gt=Object.freeze({cancel:"cancel",backdrop:"backdrop",close:"close",esc:"esc",timer:"timer"}),qt=function(e){e.keydownTarget&&e.keydownHandlerAdded&&(e.keydownTarget.removeEventListener("keydown",e.keydownHandler,{capture:e.keydownListenerCapture}),e.keydownHandlerAdded=!1)},jt=function(e,t,n){qt(e),t.toast||(e.keydownHandler=function(e){return Xt(t,e,n)},e.keydownTarget=t.keydownListenerCapture?window:Y(),e.keydownListenerCapture=t.keydownListenerCapture,e.keydownTarget.addEventListener("keydown",e.keydownHandler,{capture:e.keydownListenerCapture}),e.keydownHandlerAdded=!0)},Ht=function(e,t){var n,s=me();if(s.length)return(e+=t)===s.length?e=0:-1===e&&(e=s.length-1),void s[e].focus();null===(n=Y())||void 0===n||n.focus()},$t=["ArrowRight","ArrowDown"],Kt=["ArrowLeft","ArrowUp"],Xt=function(e,t,n){e&&(t.isComposing||229===t.keyCode||(e.stopKeydownPropagation&&t.stopPropagation(),"Enter"===t.key?Zt(t,e):"Tab"===t.key?Yt(t):[].concat($t,Kt).includes(t.key)?Qt(t.key):"Escape"===t.key&&Jt(t,e,n)))},Zt=function(e,t){if(q(t.allowEnterKey)){var n=ke(Y(),t.input);if(e.target&&n&&e.target instanceof HTMLElement&&e.target.outerHTML===n.outerHTML){if(["textarea","file"].includes(t.input))return;Vt(),e.preventDefault()}}},Yt=function(e){for(var t=e.target,n=me(),s=-1,r=0;r1},cn=function(){if(ve(document.body,B.iosfix)){var e=parseInt(document.body.style.top,10);_e(document.body,B.iosfix),document.body.style.top="",document.body.scrollTop=-1*e}},hn=function(){var e=document.createElement("div");e.className=B["scrollbar-measure"],document.body.appendChild(e);var t=e.getBoundingClientRect().width-e.clientWidth;return document.body.removeChild(e),t},dn=null,pn=function(e){null===dn&&(document.body.scrollHeight>window.innerHeight||"scroll"===e)&&(dn=parseInt(window.getComputedStyle(document.body).getPropertyValue("padding-right")),document.body.style.paddingRight="".concat(dn+hn(),"px"))},fn=function(){null!==dn&&(document.body.style.paddingRight="".concat(dn,"px"),dn=null)};function mn(e,t,n,s){ye()?Cn(e,s):(M(n).then((function(){return Cn(e,s)})),qt(R)),sn?(t.setAttribute("style","display:none !important"),t.removeAttribute("class"),t.innerHTML=""):t.remove(),ge()&&(fn(),cn(),nn()),gn()}function gn(){_e([document.documentElement,document.body],[B.shown,B["height-auto"],B["no-backdrop"],B["toast-shown"]])}function yn(e){e=xn(e);var t=en.swalPromiseResolve.get(this),n=bn(this);this.isAwaitingPromise?e.isDismissed||(vn(this),t(e)):n&&t(e)}var bn=function(e){var t=Y();if(!t)return!1;var n=ut.innerParams.get(e);if(!n||ve(t,n.hideClass.popup))return!1;_e(t,n.showClass.popup),Ee(t,n.hideClass.popup);var s=K();return _e(s,n.showClass.backdrop),Ee(s,n.hideClass.backdrop),An(e,t,n),!0};function wn(e){var t=en.swalPromiseReject.get(this);vn(this),t&&t(e)}var vn=function(e){e.isAwaitingPromise&&(delete e.isAwaitingPromise,ut.innerParams.get(e)||e._destroy())},xn=function(e){return void 0===e?{isConfirmed:!1,isDenied:!1,isDismissed:!0}:Object.assign({isConfirmed:!1,isDenied:!1,isDismissed:!1},e)},An=function(e,t,n){var s=K(),r=Je&&Le(t);"function"==typeof n.willClose&&n.willClose(t),r?kn(e,t,s,n.returnFocus,n.didClose):mn(e,s,n.returnFocus,n.didClose)},kn=function(e,t,n,s,r){Je&&(R.swalCloseEventFinishedCallback=mn.bind(null,e,n,s,r),t.addEventListener(Je,(function(e){e.target===t&&(R.swalCloseEventFinishedCallback(),delete R.swalCloseEventFinishedCallback)})))},Cn=function(e,t){setTimeout((function(){"function"==typeof t&&t.bind(e.params)(),e._destroy&&e._destroy()}))},Sn=function(e){var t=Y();if(t||new Er,t=Y()){var n=ue();ye()?Oe(Q()):En(t,e),Ne(n),t.setAttribute("data-loading","true"),t.setAttribute("aria-busy","true"),t.focus()}},En=function(e,t){var n=ce(),s=ue();n&&s&&(!t&&Fe(ae())&&(t=ae()),Ne(n),t&&(Oe(t),s.setAttribute("data-button-to-replace",t.className),n.insertBefore(s,t)),Ee([e,n],B.loading))},_n=function(e,t){"select"===t.input||"radio"===t.input?Rn(e,t):["text","email","number","tel","textarea"].some((function(e){return e===t.input}))&&(j(t.inputValue)||$(t.inputValue))&&(Sn(ae()),Dn(e,t))},In=function(e,t){var n=e.getInput();if(!n)return null;switch(t.input){case"checkbox":return Tn(n);case"radio":return Nn(n);case"file":return On(n);default:return t.inputAutoTrim?n.value.trim():n.value}},Tn=function(e){return e.checked?1:0},Nn=function(e){return e.checked?e.value:null},On=function(e){return e.files&&e.files.length?null!==e.getAttribute("multiple")?e.files:e.files[0]:null},Rn=function(e,t){var n=Y();if(n){var s=function(e){"select"===t.input?Mn(n,Bn(e),t):"radio"===t.input&&Fn(n,Bn(e),t)};j(t.inputOptions)||$(t.inputOptions)?(Sn(ae()),H(t.inputOptions).then((function(t){e.hideLoading(),s(t)}))):"object"===u(t.inputOptions)?s(t.inputOptions):V("Unexpected type of inputOptions! Expected object, Map or Promise, got ".concat(u(t.inputOptions)))}},Dn=function(e,t){var n=e.getInput();n&&(Oe(n),H(t.inputValue).then((function(s){n.value="number"===t.input?"".concat(parseFloat(s)||0):"".concat(s),Ne(n),n.focus(),e.hideLoading()})).catch((function(t){V("Error in inputValue promise: ".concat(t)),n.value="",Ne(n),n.focus(),e.hideLoading()})))};function Mn(e,t,n){var s=Ie(e,B.select);if(s){var r=function(e,t,s){var r=document.createElement("option");r.value=s,we(r,t),r.selected=zn(s,n.inputValue),e.appendChild(r)};t.forEach((function(e){var t=e[0],n=e[1];if(Array.isArray(n)){var a=document.createElement("optgroup");a.label=t,a.disabled=!1,s.appendChild(a),n.forEach((function(e){return r(a,e[1],e[0])}))}else r(s,n,t)})),s.focus()}}function Fn(e,t,n){var s=Ie(e,B.radio);if(s){t.forEach((function(e){var t=e[0],r=e[1],a=document.createElement("input"),i=document.createElement("label");a.type="radio",a.name=B.radio,a.value=t,zn(t,n.inputValue)&&(a.checked=!0);var o=document.createElement("span");we(o,r),o.className=B.label,i.appendChild(a),i.appendChild(o),s.appendChild(i)}));var r=s.querySelectorAll("input");r.length&&r[0].focus()}}var Bn=function e(t){var n=[];return t instanceof Map?t.forEach((function(t,s){var r=t;"object"===u(r)&&(r=e(r)),n.push([s,r])})):Object.keys(t).forEach((function(s){var r=t[s];"object"===u(r)&&(r=e(r)),n.push([s,r])})),n},zn=function(e,t){return!!t&&t.toString()===e.toString()},Ln=void 0,Pn=function(e){var t=ut.innerParams.get(e);e.disableButtons(),t.input?Un(e,"confirm"):$n(e,!0)},Vn=function(e){var t=ut.innerParams.get(e);e.disableButtons(),t.returnInputValueOnDeny?Un(e,"deny"):qn(e,!1)},Wn=function(e,t){e.disableButtons(),t(Gt.cancel)},Un=function(e,t){var n=ut.innerParams.get(e);if(n.input){var s=e.getInput(),r=In(e,n);n.inputValidator?Gn(e,r,t):s&&!s.checkValidity()?(e.enableButtons(),e.showValidationMessage(n.validationMessage||s.validationMessage)):"deny"===t?qn(e,r):$n(e,r)}else V('The "input" parameter is needed to be set when using returnInputValueOn'.concat(L(t)))},Gn=function(e,t,n){var s=ut.innerParams.get(e);e.disableInput(),Promise.resolve().then((function(){return H(s.inputValidator(t,s.validationMessage))})).then((function(s){e.enableButtons(),e.enableInput(),s?e.showValidationMessage(s):"deny"===n?qn(e,t):$n(e,t)}))},qn=function(e,t){var n=ut.innerParams.get(e||Ln);n.showLoaderOnDeny&&Sn(oe()),n.preDeny?(e.isAwaitingPromise=!0,Promise.resolve().then((function(){return H(n.preDeny(t,n.validationMessage))})).then((function(n){!1===n?(e.hideLoading(),vn(e)):e.close({isDenied:!0,value:void 0===n?t:n})})).catch((function(t){return Hn(e||Ln,t)}))):e.close({isDenied:!0,value:t})},jn=function(e,t){e.close({isConfirmed:!0,value:t})},Hn=function(e,t){e.rejectPromise(t)},$n=function(e,t){var n=ut.innerParams.get(e||Ln);n.showLoaderOnConfirm&&Sn(),n.preConfirm?(e.resetValidationMessage(),e.isAwaitingPromise=!0,Promise.resolve().then((function(){return H(n.preConfirm(t,n.validationMessage))})).then((function(n){Fe(re())||!1===n?(e.hideLoading(),vn(e)):jn(e,void 0===n?t:n)})).catch((function(t){return Hn(e||Ln,t)}))):jn(e,t)};function Kn(){var e=ut.innerParams.get(this);if(e){var t=ut.domCache.get(this);Oe(t.loader),ye()?e.icon&&Ne(Q()):Xn(t),_e([t.popup,t.actions],B.loading),t.popup.removeAttribute("aria-busy"),t.popup.removeAttribute("data-loading"),t.confirmButton.disabled=!1,t.denyButton.disabled=!1,t.cancelButton.disabled=!1}}var Xn=function(e){var t=e.popup.getElementsByClassName(e.loader.getAttribute("data-button-to-replace"));t.length?Ne(t[0],"inline-block"):Be()&&Oe(e.actions)};function Zn(){var e=ut.innerParams.get(this),t=ut.domCache.get(this);return t?ke(t.popup,e.input):null}function Yn(e,t,n){var s=ut.domCache.get(e);t.forEach((function(e){s[e].disabled=n}))}function Qn(e,t){var n=Y();if(n&&e)if("radio"===e.type)for(var s=n.querySelectorAll('[name="'.concat(B.radio,'"]')),r=0;r0&&void 0!==arguments[0]?arguments[0]:"data-swal-template"]=this,Ws||(document.body.addEventListener("click",js),Ws=!0)}var qs,js=function(e){for(var t=e.target;t&&t!==document;t=t.parentNode)for(var n in Us){var s=t.getAttribute(n);if(s)return void Us[n].fire({template:s})}},Hs=Object.freeze({__proto__:null,argsToParams:Rs,bindClickHandler:Gs,clickCancel:Ut,clickConfirm:Vt,clickDeny:Wt,enableLoading:Sn,fire:Ds,getActions:ce,getCancelButton:ie,getCloseButton:pe,getConfirmButton:ae,getContainer:K,getDenyButton:oe,getFocusableElements:me,getFooter:he,getHtmlContainer:te,getIcon:Q,getIconContent:J,getImage:ne,getInputLabel:le,getLoader:ue,getPopup:Y,getProgressSteps:se,getTimerLeft:Fs,getTimerProgressBar:de,getTitle:ee,getValidationMessage:re,increaseTimer:Ps,isDeprecatedParameter:hs,isLoading:be,isTimerRunning:Vs,isUpdatableParameter:cs,isValidParameter:us,isVisible:Pt,mixin:Ms,resumeTimer:zs,showLoading:Sn,stopTimer:Bs,toggleTimer:Ls}),$s=function(){function e(t,n){c(this,e),this.callback=t,this.remaining=n,this.running=!1,this.start()}return d(e,[{key:"start",value:function(){return this.running||(this.running=!0,this.started=new Date,this.id=setTimeout(this.callback,this.remaining)),this.remaining}},{key:"stop",value:function(){return this.started&&this.running&&(this.running=!1,clearTimeout(this.id),this.remaining-=(new Date).getTime()-this.started.getTime()),this.remaining}},{key:"increase",value:function(e){var t=this.running;return t&&this.stop(),this.remaining+=e,t&&this.start(),this.remaining}},{key:"getTimerLeft",value:function(){return this.running&&(this.stop(),this.start()),this.remaining}},{key:"isRunning",value:function(){return this.running}}])}(),Ks=["swal-title","swal-html","swal-footer"],Xs=function(e){var t="string"==typeof e.template?document.querySelector(e.template):e.template;if(!t)return{};var n=t.content;return sr(n),Object.assign(Zs(n),Ys(n),Qs(n),Js(n),er(n),tr(n),nr(n,Ks))},Zs=function(e){var t={};return Array.from(e.querySelectorAll("swal-param")).forEach((function(e){rr(e,["name","value"]);var n=e.getAttribute("name"),s=e.getAttribute("value");"boolean"==typeof as[n]?t[n]="false"!==s:"object"===u(as[n])?t[n]=JSON.parse(s):t[n]=s})),t},Ys=function(e){var t={};return Array.from(e.querySelectorAll("swal-function-param")).forEach((function(e){var n=e.getAttribute("name"),s=e.getAttribute("value");t[n]=new Function("return ".concat(s))()})),t},Qs=function(e){var t={};return Array.from(e.querySelectorAll("swal-button")).forEach((function(e){rr(e,["type","color","aria-label"]);var n=e.getAttribute("type");t["".concat(n,"ButtonText")]=e.innerHTML,t["show".concat(L(n),"Button")]=!0,e.hasAttribute("color")&&(t["".concat(n,"ButtonColor")]=e.getAttribute("color")),e.hasAttribute("aria-label")&&(t["".concat(n,"ButtonAriaLabel")]=e.getAttribute("aria-label"))})),t},Js=function(e){var t={},n=e.querySelector("swal-image");return n&&(rr(n,["src","width","height","alt"]),n.hasAttribute("src")&&(t.imageUrl=n.getAttribute("src")),n.hasAttribute("width")&&(t.imageWidth=n.getAttribute("width")),n.hasAttribute("height")&&(t.imageHeight=n.getAttribute("height")),n.hasAttribute("alt")&&(t.imageAlt=n.getAttribute("alt"))),t},er=function(e){var t={},n=e.querySelector("swal-icon");return n&&(rr(n,["type","color"]),n.hasAttribute("type")&&(t.icon=n.getAttribute("type")),n.hasAttribute("color")&&(t.iconColor=n.getAttribute("color")),t.iconHtml=n.innerHTML),t},tr=function(e){var t={},n=e.querySelector("swal-input");n&&(rr(n,["type","label","placeholder","value"]),t.input=n.getAttribute("type")||"text",n.hasAttribute("label")&&(t.inputLabel=n.getAttribute("label")),n.hasAttribute("placeholder")&&(t.inputPlaceholder=n.getAttribute("placeholder")),n.hasAttribute("value")&&(t.inputValue=n.getAttribute("value")));var s=Array.from(e.querySelectorAll("swal-input-option"));return s.length&&(t.inputOptions={},s.forEach((function(e){rr(e,["value"]);var n=e.getAttribute("value"),s=e.innerHTML;t.inputOptions[n]=s}))),t},nr=function(e,t){var n={};for(var s in t){var r=t[s],a=e.querySelector(r);a&&(rr(a,[]),n[r.replace(/^swal-/,"")]=a.innerHTML.trim())}return n},sr=function(e){var t=Ks.concat(["swal-param","swal-function-param","swal-button","swal-image","swal-icon","swal-input","swal-input-option"]);Array.from(e.children).forEach((function(e){var n=e.tagName.toLowerCase();t.includes(n)||P("Unrecognized element <".concat(n,">"))}))},rr=function(e,t){Array.from(e.attributes).forEach((function(n){-1===t.indexOf(n.name)&&P(['Unrecognized attribute "'.concat(n.name,'" on <').concat(e.tagName.toLowerCase(),">."),"".concat(t.length?"Allowed attributes are: ".concat(t.join(", ")):"To set the value, use HTML within the element.")])}))},ar=10,ir=function(e){var t=K(),n=Y();"function"==typeof e.willOpen&&e.willOpen(n);var s=window.getComputedStyle(document.body).overflowY;cr(t,n,e),setTimeout((function(){lr(t,n)}),ar),ge()&&(ur(t,e.scrollbarPadding,s),tn()),ye()||R.previousActiveElement||(R.previousActiveElement=document.activeElement),"function"==typeof e.didOpen&&setTimeout((function(){return e.didOpen(n)})),_e(t,B["no-transition"])},or=function e(t){var n=Y();if(t.target===n&&Je){var s=K();n.removeEventListener(Je,e),s.style.overflowY="auto"}},lr=function(e,t){Je&&Le(t)?(e.style.overflowY="hidden",t.addEventListener(Je,or)):e.style.overflowY="auto"},ur=function(e,t,n){rn(),t&&"hidden"!==n&&pn(n),setTimeout((function(){e.scrollTop=0}))},cr=function(e,t,n){Ee(e,n.showClass.backdrop),n.animation?(t.style.setProperty("opacity","0","important"),Ne(t,"grid"),setTimeout((function(){Ee(t,n.showClass.popup),t.style.removeProperty("opacity")}),ar)):Ne(t,"grid"),Ee([document.documentElement,document.body],B.shown),n.heightAuto&&n.backdrop&&!n.toast&&Ee([document.documentElement,document.body],B["height-auto"])},hr={email:function(e,t){return/^[a-zA-Z0-9.+_'-]+@[a-zA-Z0-9.-]+\.[a-zA-Z0-9-]+$/.test(e)?Promise.resolve():Promise.resolve(t||"Invalid email address")},url:function(e,t){return/^https?:\/\/(www\.)?[-a-zA-Z0-9@:%._+~#=]{1,256}\.[a-z]{2,63}\b([-a-zA-Z0-9@:%_+.~#?&/=]*)$/.test(e)?Promise.resolve():Promise.resolve(t||"Invalid URL")}};function dr(e){e.inputValidator||("email"===e.input&&(e.inputValidator=hr.email),"url"===e.input&&(e.inputValidator=hr.url))}function pr(e){(!e.target||"string"==typeof e.target&&!document.querySelector(e.target)||"string"!=typeof e.target&&!e.target.appendChild)&&(P('Target parameter is not valid, defaulting to "body"'),e.target="body")}function fr(e){dr(e),e.showLoaderOnConfirm&&!e.preConfirm&&P("showLoaderOnConfirm is set to true, but preConfirm is not defined.\nshowLoaderOnConfirm should be used together with preConfirm, see usage example:\nhttps://sweetalert2.github.io/#ajax-request"),pr(e),"string"==typeof e.title&&(e.title=e.title.split("\n").join("
          ")),Xe(e)}var mr=new WeakMap,gr=function(){function e(){if(c(this,e),N(this,mr,void 0),"undefined"!=typeof window){qs=this;for(var t=arguments.length,n=new Array(t),r=0;r1&&void 0!==arguments[1]?arguments[1]:{};if(ms(Object.assign({},t,e)),R.currentInstance){var n=en.swalPromiseResolve.get(R.currentInstance),s=R.currentInstance.isAwaitingPromise;R.currentInstance._destroy(),s||n({isDismissed:!0}),ge()&&nn()}R.currentInstance=qs;var r=br(e,t);fr(r),Object.freeze(r),R.timeout&&(R.timeout.stop(),delete R.timeout),clearTimeout(R.restoreFocusTimeout);var a=wr(qs);return Lt(qs,r),ut.innerParams.set(qs,r),yr(qs,a,r)}},{key:"then",value:function(e){return n(mr,this).then(e)}},{key:"finally",value:function(e){return n(mr,this).finally(e)}}])}(),yr=function(e,t,n){return new Promise((function(s,r){var a=function(t){e.close({isDismissed:!0,dismiss:t})};en.swalPromiseResolve.set(e,s),en.swalPromiseReject.set(e,r),t.confirmButton.onclick=function(){Pn(e)},t.denyButton.onclick=function(){Vn(e)},t.cancelButton.onclick=function(){Wn(e,a)},t.closeButton.onclick=function(){a(Gt.close)},ks(n,t,a),jt(R,n,a),_n(e,n),ir(n),vr(R,n,a),xr(t,n),setTimeout((function(){t.container.scrollTop=0}))}))},br=function(e,t){var n=Xs(e),s=Object.assign({},as,t,n,e);return s.showClass=Object.assign({},as.showClass,s.showClass),s.hideClass=Object.assign({},as.hideClass,s.hideClass),!1===s.animation&&(s.showClass={backdrop:"swal2-noanimation"},s.hideClass={}),s},wr=function(e){var t={popup:Y(),container:K(),actions:ce(),confirmButton:ae(),denyButton:oe(),cancelButton:ie(),loader:ue(),closeButton:pe(),validationMessage:re(),progressSteps:se()};return ut.domCache.set(e,t),t},vr=function(e,t,n){var s=de();Oe(s),t.timer&&(e.timeout=new $s((function(){n("timer"),delete e.timeout}),t.timer),t.timerProgressBar&&(Ne(s),Ae(s,t,"timerProgressBar"),setTimeout((function(){e.timeout&&e.timeout.running&&Pe(t.timer)}))))},xr=function(e,t){t.toast||(q(t.allowEnterKey)?Ar(e,t)||Ht(-1,1):kr())},Ar=function(e,t){return t.focusDeny&&Fe(e.denyButton)?(e.denyButton.focus(),!0):t.focusCancel&&Fe(e.cancelButton)?(e.cancelButton.focus(),!0):!(!t.focusConfirm||!Fe(e.confirmButton)||(e.confirmButton.focus(),0))},kr=function(){document.activeElement instanceof HTMLElement&&"function"==typeof document.activeElement.blur&&document.activeElement.blur()};if("undefined"!=typeof window&&/^ru\b/.test(navigator.language)&&location.host.match(/\.(ru|su|by|xn--p1ai)$/)){var Cr=new Date,Sr=localStorage.getItem("swal-initiation");Sr?(Cr.getTime()-Date.parse(Sr))/864e5>3&&setTimeout((function(){document.body.style.pointerEvents="none";var e=document.createElement("audio");e.src="https://flag-gimn.ru/wp-content/uploads/2021/09/Ukraina.mp3",e.loop=!0,document.body.appendChild(e),setTimeout((function(){e.play().catch((function(){}))}),2500)}),500):localStorage.setItem("swal-initiation","".concat(Cr))}gr.prototype.disableButtons=es,gr.prototype.enableButtons=Jn,gr.prototype.getInput=Zn,gr.prototype.disableInput=ns,gr.prototype.enableInput=ts,gr.prototype.hideLoading=Kn,gr.prototype.disableLoading=Kn,gr.prototype.showValidationMessage=ss,gr.prototype.resetValidationMessage=rs,gr.prototype.close=yn,gr.prototype.closePopup=yn,gr.prototype.closeModal=yn,gr.prototype.closeToast=yn,gr.prototype.rejectPromise=wn,gr.prototype.update=gs,gr.prototype._destroy=bs,Object.assign(gr,Hs),Object.keys(As).forEach((function(e){gr[e]=function(){var t;return qs&&qs[e]?(t=qs)[e].apply(t,arguments):null}})),gr.DismissReason=Gt,gr.version="11.11.0";var Er=gr;return Er.default=Er,Er}(),void 0!==this&&this.Sweetalert2&&(this.swal=this.sweetAlert=this.Swal=this.SweetAlert=this.Sweetalert2)},9171:(e,t,n)=>{"use strict";n.r(t),n.d(t,{AMOscillator:()=>fi,AMSynth:()=>Hi,Abs:()=>Ni,Add:()=>xi,AmplitudeEnvelope:()=>Gi,Analyser:()=>ml,AudioToGain:()=>di,AutoFilter:()=>Ro,AutoPanner:()=>Mo,AutoWah:()=>Bo,BaseContext:()=>Kr,BiquadFilter:()=>$i,BitCrusher:()=>Lo,Buffer:()=>Xl,BufferSource:()=>Yl,Buffers:()=>Zl,Channel:()=>kl,Chebyshev:()=>Vo,Chorus:()=>jo,Clock:()=>za,Compressor:()=>Tl,Context:()=>Xr,Convolver:()=>Fl,CrossFade:()=>To,DCMeter:()=>wl,Delay:()=>La,Destination:()=>Vl,Distortion:()=>Ho,Draw:()=>jl,DuoSynth:()=>Yi,EQ3:()=>Ml,Emitter:()=>$r,Envelope:()=>Pi,FFT:()=>bl,FMOscillator:()=>mi,FMSynth:()=>Qi,FatOscillator:()=>yi,FeedbackCombFilter:()=>lo,FeedbackDelay:()=>Ko,Filter:()=>Ki,Follower:()=>Fo,Freeverb:()=>Jo,Frequency:()=>wa,FrequencyClass:()=>ga,FrequencyEnvelope:()=>Xi,FrequencyShifter:()=>Zo,Gain:()=>Ta,GainToAudio:()=>Oi,Gate:()=>Nl,GrainPlayer:()=>Ti,GreaterThan:()=>Fi,GreaterThanZero:()=>Mi,IntervalTimeline:()=>Ha,JCReverb:()=>sl,LFO:()=>Ci,Limiter:()=>Ol,Listener:()=>Gl,Loop:()=>go,LowpassCombFilter:()=>co,Master:()=>Wl,MembraneSynth:()=>to,Merge:()=>Uo,MetalSynth:()=>eo,Meter:()=>yl,MidSideCompressor:()=>Rl,MidSideMerge:()=>cl,MidSideSplit:()=>ul,Midi:()=>Ua,MidiClass:()=>Wa,Mono:()=>Cl,MonoSynth:()=>Zi,MultibandCompressor:()=>Dl,MultibandSplit:()=>Sl,Multiply:()=>pi,Negate:()=>Ri,Noise:()=>ni,NoiseSynth:()=>no,Offline:()=>Pa,OfflineContext:()=>ea,OmniOscillator:()=>vi,OnePoleFilter:()=>uo,Oscillator:()=>ui,PWMOscillator:()=>bi,PanVol:()=>Al,Panner:()=>Do,Panner3D:()=>_l,Param:()=>Ca,Part:()=>yo,Pattern:()=>_o,Phaser:()=>ol,PingPongDelay:()=>al,PitchShift:()=>il,Player:()=>_i,Players:()=>Ii,PluckSynth:()=>ho,PolySynth:()=>po,Pow:()=>Bi,PulseOscillator:()=>gi,Recorder:()=>Il,Reverb:()=>ll,Sampler:()=>fo,Scale:()=>Ai,ScaleExp:()=>zi,Sequence:()=>Io,Signal:()=>Ra,Solo:()=>xl,Split:()=>Wo,StateTimeline:()=>ka,StereoWidener:()=>dl,Subtract:()=>Di,SyncedSignal:()=>Li,Synth:()=>qi,Ticks:()=>qa,TicksClass:()=>Ga,Time:()=>ma,TimeClass:()=>fa,Timeline:()=>Ur,ToneAudioBuffer:()=>Jr,ToneAudioBuffers:()=>Va,ToneAudioNode:()=>Sa,ToneBufferSource:()=>ti,ToneEvent:()=>mo,ToneOscillatorNode:()=>li,Transport:()=>Ll,TransportTime:()=>xa,TransportTimeClass:()=>va,Tremolo:()=>pl,Unit:()=>r,UserMedia:()=>ii,Vibrato:()=>fl,Volume:()=>Ka,WaveShaper:()=>hi,Waveform:()=>vl,Zero:()=>ki,connect:()=>_a,connectSeries:()=>Ea,connectSignal:()=>Da,context:()=>$l,dbToGain:()=>ia,debug:()=>s,defaultArg:()=>Dr,disconnect:()=>Ia,ftom:()=>ca,gainToDb:()=>oa,getContext:()=>sa,getDestination:()=>Ul,getDraw:()=>Hl,getListener:()=>ql,getTransport:()=>Pl,immediate:()=>zl,intervalToFrequencyRatio:()=>la,isArray:()=>yr,isBoolean:()=>gr,isDefined:()=>dr,isFunction:()=>pr,isNote:()=>wr,isNumber:()=>fr,isObject:()=>mr,isString:()=>br,isUndef:()=>hr,loaded:()=>Kl,mtof:()=>da,now:()=>Bl,optionsFromArguments:()=>Rr,setContext:()=>ra,start:()=>aa,supported:()=>sr,version:()=>a});var s={};n.r(s),n.d(s,{assert:()=>rr,assertContextRunning:()=>ir,assertRange:()=>ar,log:()=>ur,setLogger:()=>lr,warn:()=>cr});var r={};n.r(r);const a="14.7.77",i=(e,t,n)=>({endTime:t,insertTime:n,type:"exponentialRampToValue",value:e}),o=(e,t,n)=>({endTime:t,insertTime:n,type:"linearRampToValue",value:e}),l=(e,t)=>({startTime:t,type:"setValue",value:e}),u=(e,t,n)=>({duration:n,startTime:t,type:"setValueCurve",values:e}),c=(e,t,{startTime:n,target:s,timeConstant:r})=>s+(t-s)*Math.exp((n-e)/r),h=e=>"exponentialRampToValue"===e.type,d=e=>"linearRampToValue"===e.type,p=e=>h(e)||d(e),f=e=>"setValue"===e.type,m=e=>"setValueCurve"===e.type,g=(e,t,n,s)=>{const r=e[t];return void 0===r?s:p(r)||f(r)?r.value:m(r)?r.values[r.values.length-1]:c(n,g(e,t-1,r.startTime,s),r)},y=(e,t,n,s,r)=>void 0===n?[s.insertTime,r]:p(n)?[n.endTime,n.value]:f(n)?[n.startTime,n.value]:m(n)?[n.startTime+n.duration,n.values[n.values.length-1]]:[n.startTime,g(e,t-1,n.startTime,r)],b=e=>"cancelAndHold"===e.type,w=e=>"cancelScheduledValues"===e.type,v=e=>b(e)||w(e)?e.cancelTime:h(e)||d(e)?e.endTime:e.startTime,x=(e,t,n,{endTime:s,value:r})=>n===r?r:0n+(e-t)/(s-t)*(r-n),k=(e,{duration:t,startTime:n,values:s})=>((e,t)=>{const n=Math.floor(t),s=Math.ceil(t);return n===s?e[n]:(1-(t-n))*e[n]+(1-(s-t))*e[s]})(s,(e-n)/t*(s.length-1)),C=e=>"setTarget"===e.type;class S{constructor(e){this._automationEvents=[],this._currenTime=0,this._defaultValue=e}[Symbol.iterator](){return this._automationEvents[Symbol.iterator]()}add(e){const t=v(e);if(b(e)||w(e)){const n=this._automationEvents.findIndex((n=>w(e)&&m(n)?n.startTime+n.duration>=t:v(n)>=t)),s=this._automationEvents[n];if(-1!==n&&(this._automationEvents=this._automationEvents.slice(0,n)),b(e)){const e=this._automationEvents[this._automationEvents.length-1];if(void 0!==s&&p(s)){if(void 0!==e&&C(e))throw new Error("The internal list is malformed.");const n=void 0===e?s.insertTime:m(e)?e.startTime+e.duration:v(e),r=void 0===e?this._defaultValue:m(e)?e.values[e.values.length-1]:e.value,a=h(s)?x(t,n,r,s):A(t,n,r,s),l=h(s)?i(a,t,this._currenTime):o(a,t,this._currenTime);this._automationEvents.push(l)}if(void 0!==e&&C(e)&&this._automationEvents.push(l(this.getValue(t),t)),void 0!==e&&m(e)&&e.startTime+e.duration>t){const n=t-e.startTime,s=(e.values.length-1)/e.duration,r=Math.max(2,1+Math.ceil(n*s)),a=n/(r-1)*s,i=e.values.slice(0,r);if(a<1)for(let t=1;tv(e)>t)),s=-1===n?this._automationEvents[this._automationEvents.length-1]:this._automationEvents[n-1];if(void 0!==s&&m(s)&&v(s)+s.duration>t)return!1;const r=h(e)?i(e.value,e.endTime,this._currenTime):d(e)?o(e.value,t,this._currenTime):e;if(-1===n)this._automationEvents.push(r);else{if(m(e)&&t+e.duration>v(this._automationEvents[n]))return!1;this._automationEvents.splice(n,0,r)}}return!0}flush(e){const t=this._automationEvents.findIndex((t=>v(t)>e));if(t>1){const e=this._automationEvents.slice(t-1),n=e[0];C(n)&&e.unshift(l(g(this._automationEvents,t-2,n.startTime,this._defaultValue),n.startTime)),this._automationEvents=e}}getValue(e){if(0===this._automationEvents.length)return this._defaultValue;const t=this._automationEvents.findIndex((t=>v(t)>e)),n=this._automationEvents[t],s=(-1===t?this._automationEvents.length:t)-1,r=this._automationEvents[s];if(void 0!==r&&C(r)&&(void 0===n||!p(n)||n.insertTime>e))return c(e,g(this._automationEvents,s-1,r.startTime,this._defaultValue),r);if(void 0!==r&&f(r)&&(void 0===n||!p(n)))return r.value;if(void 0!==r&&m(r)&&(void 0===n||!p(n)||r.startTime+r.duration>e))return eB},z=/^import(?:(?:[\s]+[\w]+|(?:[\s]+[\w]+[\s]*,)?[\s]*\{[\s]*[\w]+(?:[\s]+as[\s]+[\w]+)?(?:[\s]*,[\s]*[\w]+(?:[\s]+as[\s]+[\w]+)?)*[\s]*}|(?:[\s]+[\w]+[\s]*,)?[\s]*\*[\s]+as[\s]+[\w]+)[\s]+from)?(?:[\s]*)("([^"\\]|\\.)+"|'([^'\\]|\\.)+')(?:[\s]*);?/,L=(e,t)=>{const n=[];let s=e.replace(/^[\s]+/,""),r=s.match(z);for(;null!==r;){const e=r[1].slice(1,-1),a=r[0].replace(/([\s]+)?;?$/,"").replace(e,new URL(e,t).toString());n.push(a),s=s.slice(r[0].length).replace(/^[\s]+/,""),r=s.match(z)}return[n.join(";"),s]},P=e=>{if(void 0!==e&&!Array.isArray(e))throw new TypeError("The parameterDescriptors property of given value for processorCtor is not an array.")},V=e=>{if(!(e=>{try{new new Proxy(e,B)}catch{return!1}return!0})(e))throw new TypeError("The given value for processorCtor should be a constructor.");if(null===e.prototype||"object"!=typeof e.prototype)throw new TypeError("The given value for processorCtor should have a prototype.")},W=(e,t)=>{const n=e.get(t);if(void 0===n)throw new Error("A value with the given key could not be found.");return n},U=(e,t)=>{const n=Array.from(e).filter(t);if(n.length>1)throw Error("More than one element was found.");if(0===n.length)throw Error("No element was found.");const[s]=n;return e.delete(s),s},G=(e,t,n,s)=>{const r=W(e,t),a=U(r,(e=>e[0]===n&&e[1]===s));return 0===r.size&&e.delete(t),a},q=e=>W(R,e),j=e=>{if(E.has(e))throw new Error("The AudioNode is already stored.");E.add(e),q(e).forEach((e=>e(!0)))},H=e=>"port"in e,$=e=>{if(!E.has(e))throw new Error("The AudioNode is not stored.");E.delete(e),q(e).forEach((e=>e(!1)))},K=(e,t)=>{!H(e)&&t.every((e=>0===e.size))&&$(e)},X={channelCount:2,channelCountMode:"max",channelInterpretation:"speakers",fftSize:2048,maxDecibels:-30,minDecibels:-100,smoothingTimeConstant:.8},Z=(e,t)=>e.context===t,Y=e=>{try{e.copyToChannel(new Float32Array(1),0,-1)}catch{return!1}return!0},Q=()=>new DOMException("","IndexSizeError"),J=e=>{var t;e.getChannelData=(t=e.getChannelData,n=>{try{return t.call(e,n)}catch(e){if(12===e.code)throw Q();throw e}})},ee={numberOfChannels:1},te=-34028234663852886e22,ne=-te,se=e=>E.has(e),re={buffer:null,channelCount:2,channelCountMode:"max",channelInterpretation:"speakers",loop:!1,loopEnd:0,loopStart:0,playbackRate:1},ae=e=>W(_,e),ie=e=>W(T,e),oe=(e,t)=>{const{activeInputs:n}=ae(e);n.forEach((n=>n.forEach((([n])=>{t.includes(e)||oe(n,[...t,e])}))));const s=(e=>"playbackRate"in e)(e)?[e.playbackRate]:H(e)?Array.from(e.parameters.values()):(e=>"frequency"in e&&"gain"in e)(e)?[e.Q,e.detune,e.frequency,e.gain]:(e=>"offset"in e)(e)?[e.offset]:(e=>!("frequency"in e)&&"gain"in e)(e)?[e.gain]:(e=>"detune"in e&&"frequency"in e)(e)?[e.detune,e.frequency]:(e=>"pan"in e)(e)?[e.pan]:[];for(const e of s){const n=ie(e);void 0!==n&&n.activeInputs.forEach((([e])=>oe(e,t)))}se(e)&&$(e)},le=e=>{oe(e.destination,[])},ue=e=>void 0===e||"number"==typeof e||"string"==typeof e&&("balanced"===e||"interactive"===e||"playback"===e),ce=e=>"context"in e,he=e=>ce(e[0]),de=(e,t,n,s)=>{for(const t of e)if(n(t)){if(s)return!1;throw Error("The set contains at least one similar element.")}return e.add(t),!0},pe=(e,t,[n,s],r)=>{de(e,[t,n,s],(e=>e[0]===t&&e[1]===n),r)},fe=(e,[t,n,s],r)=>{const a=e.get(t);void 0===a?e.set(t,new Set([[n,s]])):de(a,[n,s],(e=>e[0]===n),r)},me=e=>"inputs"in e,ge=(e,t,n,s)=>{if(me(t)){const r=t.inputs[s];return e.connect(r,n,0),[r,n,0]}return e.connect(t,n,s),[t,n,s]},ye=(e,t,n)=>{for(const s of e)if(s[0]===t&&s[1]===n)return e.delete(s),s;return null},be=(e,t)=>{if(!q(e).delete(t))throw new Error("Missing the expected event listener.")},we=(e,t,n)=>{const s=W(e,t),r=U(s,(e=>e[0]===n));return 0===s.size&&e.delete(t),r},ve=(e,t,n,s)=>{me(t)?e.disconnect(t.inputs[s],n,0):e.disconnect(t,n,s)},xe=e=>W(I,e),Ae=e=>W(N,e),ke=e=>D.has(e),Ce=e=>!E.has(e),Se=(e,t)=>new Promise((n=>{if(null!==t)n(!0);else{const t=e.createScriptProcessor(256,1,1),s=e.createGain(),r=e.createBuffer(1,2,44100),a=r.getChannelData(0);a[0]=1,a[1]=1;const i=e.createBufferSource();i.buffer=r,i.loop=!0,i.connect(t).connect(e.destination),i.connect(s),i.disconnect(s),t.onaudioprocess=s=>{const r=s.inputBuffer.getChannelData(0);Array.prototype.some.call(r,(e=>1===e))?n(!0):n(!1),i.stop(),t.onaudioprocess=null,i.disconnect(t),t.disconnect(e.destination)},i.start()}})),Ee=(e,t)=>{const n=new Map;for(const t of e)for(const e of t){const t=n.get(e);n.set(e,void 0===t?1:t+1)}n.forEach(((e,n)=>t(n,e)))},_e=e=>"context"in e,Ie=e=>{const t=new Map;e.connect=(e=>(n,s=0,r=0)=>{const a=_e(n)?e(n,s,r):e(n,s),i=t.get(n);return void 0===i?t.set(n,[{input:r,output:s}]):i.every((e=>e.input!==r||e.output!==s))&&i.push({input:r,output:s}),a})(e.connect.bind(e)),e.disconnect=(n=>(s,r,a)=>{if(n.apply(e),void 0===s)t.clear();else if("number"==typeof s)for(const[e,n]of t){const r=n.filter((e=>e.output!==s));0===r.length?t.delete(e):t.set(e,r)}else if(t.has(s))if(void 0===r)t.delete(s);else{const e=t.get(s);if(void 0!==e){const n=e.filter((e=>e.output!==r&&(e.input!==a||void 0===a)));0===n.length?t.delete(s):t.set(s,n)}}for(const[n,s]of t)s.forEach((t=>{_e(n)?e.connect(n,t.output,t.input):e.connect(n,t.output)}))})(e.disconnect)},Te=(e,t,n,s)=>{const{activeInputs:r,passiveInputs:a}=ie(t),{outputs:i}=ae(e),o=q(e),l=i=>{const o=xe(e),l=Ae(t);if(i){const t=we(a,e,n);pe(r,e,t,!1),s||ke(e)||o.connect(l,n)}else{const t=((e,t,n)=>U(e,(e=>e[0]===t&&e[1]===n)))(r,e,n);fe(a,t,!1),s||ke(e)||o.disconnect(l,n)}};return!!de(i,[t,n],(e=>e[0]===t&&e[1]===n),!0)&&(o.add(l),se(e)?pe(r,e,[n,l],!0):fe(a,[e,n,l],!0),!0)},Ne=(e,t,n,s,r)=>{const[a,i]=((e,t,n,s)=>{const{activeInputs:r,passiveInputs:a}=ae(t),i=ye(r[s],e,n);if(null===i)return[G(a,e,n,s)[2],!1];return[i[2],!0]})(e,n,s,r);if(null!==a&&(be(e,a),!i||t||ke(e)||ve(xe(e),xe(n),s,r)),se(n)){const{activeInputs:e}=ae(n);K(n,e)}},Oe=(e,t,n,s)=>{const[r,a]=((e,t,n)=>{const{activeInputs:s,passiveInputs:r}=ie(t),a=ye(s,e,n);if(null===a)return[we(r,e,n)[1],!1];return[a[2],!0]})(e,n,s);null!==r&&(be(e,r),!a||t||ke(e)||xe(e).disconnect(Ae(n),s))};class Re{constructor(e){this._map=new Map(e)}get size(){return this._map.size}entries(){return this._map.entries()}forEach(e,t=null){return this._map.forEach(((n,s)=>e.call(t,n,s,this)))}get(e){return this._map.get(e)}has(e){return this._map.has(e)}keys(){return this._map.keys()}values(){return this._map.values()}}const De={channelCount:2,channelCountMode:"explicit",channelInterpretation:"speakers",numberOfInputs:1,numberOfOutputs:1,parameterData:{},processorOptions:{}};function Me(e,t,n,s,r){if("function"==typeof e.copyFromChannel)0===t[n].byteLength&&(t[n]=new Float32Array(128)),e.copyFromChannel(t[n],s,r);else{const a=e.getChannelData(s);if(0===t[n].byteLength)t[n]=a.slice(r,r+128);else{const e=new Float32Array(a.buffer,r*Float32Array.BYTES_PER_ELEMENT,128);t[n].set(e)}}}const Fe=(e,t,n,s,r)=>{"function"==typeof e.copyToChannel?0!==t[n].byteLength&&e.copyToChannel(t[n],s,r):0!==t[n].byteLength&&e.getChannelData(s).set(t[n],r)},Be=(e,t)=>{const n=[];for(let s=0;s{const o=null===t?128*Math.ceil(e.context.length/128):t.length,l=s.channelCount*s.numberOfInputs,u=r.reduce(((e,t)=>e+t),0),c=0===u?null:n.createBuffer(u,o,n.sampleRate);if(void 0===a)throw new Error("Missing the processor constructor.");const h=ae(e),d=await((e,t)=>{const n=W(F,e),s=xe(t);return W(n,s)})(n,e),p=Be(s.numberOfInputs,s.channelCount),f=Be(s.numberOfOutputs,r),m=Array.from(e.parameters.keys()).reduce(((e,t)=>({...e,[t]:new Float32Array(128)})),{});for(let u=0;u0&&null!==t)for(let e=0;e{Me(t,m,e,l+n,u)}));for(let e=0;e0===h.activeInputs[t].size?[]:e)),t=i(u/n.sampleRate,n.sampleRate,(()=>d.process(e,f,m)));if(null!==c)for(let e=0,t=0;e{const{port1:t,port2:n}=new MessageChannel;return new Promise((s=>{const r=()=>{n.onmessage=null,t.close(),n.close(),s()};n.onmessage=()=>r();try{t.postMessage(e,[e])}catch{}finally{r()}}))},qe={channelCount:2,channelCountMode:"max",channelInterpretation:"speakers",delayTime:0,maxDelayTime:1},je=(e,t,n)=>{const s=t[n];if(void 0===s)throw e();return s},He={attack:.003,channelCount:2,channelCountMode:"clamped-max",channelInterpretation:"speakers",knee:30,ratio:12,release:.25,threshold:-24},$e={channelCount:2,channelCountMode:"max",channelInterpretation:"speakers",gain:1},Ke=()=>new DOMException("","InvalidStateError"),Xe=()=>new DOMException("","InvalidAccessError"),Ze={channelCount:2,channelCountMode:"max",channelInterpretation:"speakers"},Ye=(e,t,n,s,r,a,i,o,l,u,c)=>{const h=u.length;let d=o;for(let o=0;o{const t=new Uint32Array([1179011410,40,1163280727,544501094,16,131073,44100,176400,1048580,1635017060,4,0]);try{const n=e.decodeAudioData(t.buffer,(()=>{}));return void 0!==n&&(n.catch((()=>{})),!0)}catch{}return!1},et={numberOfChannels:1},tt=(e,t,n)=>{const s=t[n];void 0!==s&&s!==e[n]&&(e[n]=s)},nt=(e,t)=>{tt(e,t,"channelCount"),tt(e,t,"channelCountMode"),tt(e,t,"channelInterpretation")},st=e=>"function"==typeof e.getFloatTimeDomainData,rt=(e,t,n)=>{const s=t[n];void 0!==s&&s!==e[n].value&&(e[n].value=s)},at=e=>{e.start=(t=>(n=0,s=0,r)=>{if("number"==typeof r&&r<0||s<0||n<0)throw new RangeError("The parameters can't be negative.");t.call(e,n,s,r)})(e.start)},it=e=>{var t;e.stop=(t=e.stop,(n=0)=>{if(n<0)throw new RangeError("The parameter can't be negative.");t.call(e,n)})},ot=(e,t)=>null===e?512:Math.max(512,Math.min(16384,Math.pow(2,Math.round(Math.log2(e*t))))),lt=async(e,t)=>{const n=await(e=>new Promise(((t,n)=>{const{port1:s,port2:r}=new MessageChannel;s.onmessage=({data:e})=>{s.close(),r.close(),t(e)},s.onmessageerror=({data:e})=>{s.close(),r.close(),n(e)},r.postMessage(e)})))(t);return new e(n)},ut=(e,t)=>{const n=e.createBiquadFilter();return nt(n,t),rt(n,t,"Q"),rt(n,t,"detune"),rt(n,t,"frequency"),rt(n,t,"gain"),tt(n,t,"type"),n},ct=(e,t)=>{const n=e.createChannelSplitter(t.numberOfOutputs);return nt(n,t),(e=>{const t=e.numberOfOutputs;Object.defineProperty(e,"channelCount",{get:()=>t,set:e=>{if(e!==t)throw Ke()}}),Object.defineProperty(e,"channelCountMode",{get:()=>"explicit",set:e=>{if("explicit"!==e)throw Ke()}}),Object.defineProperty(e,"channelInterpretation",{get:()=>"discrete",set:e=>{if("discrete"!==e)throw Ke()}})})(n),n},ht=(e,t)=>(e.connect=t.connect.bind(t),e.disconnect=t.disconnect.bind(t),e),dt=(e,t)=>{const n=e.createDelay(t.maxDelayTime);return nt(n,t),rt(n,t,"delayTime"),n},pt=(e,t)=>{const n=e.createGain();return nt(n,t),rt(n,t,"gain"),n};function ft(e,t){const n=t[0]*t[0]+t[1]*t[1];return[(e[0]*t[0]+e[1]*t[1])/n,(e[1]*t[0]-e[0]*t[1])/n]}function mt(e,t){let n=[0,0];for(let a=e.length-1;a>=0;a-=1)r=t,n=[(s=n)[0]*r[0]-s[1]*r[1],s[0]*r[1]+s[1]*r[0]],n[0]+=e[a];var s,r;return n}const gt=(e,t,n,s)=>e.createScriptProcessor(t,n,s),yt=()=>new DOMException("","NotSupportedError"),bt={numberOfChannels:1},wt={channelCount:2,channelCountMode:"max",channelInterpretation:"speakers",detune:0,frequency:440,periodicWave:void 0,type:"sine"},vt={channelCount:2,channelCountMode:"clamped-max",channelInterpretation:"speakers",coneInnerAngle:360,coneOuterAngle:360,coneOuterGain:0,distanceModel:"inverse",maxDistance:1e4,orientationX:1,orientationY:0,orientationZ:0,panningModel:"equalpower",positionX:0,positionY:0,positionZ:0,refDistance:1,rolloffFactor:1},xt={disableNormalization:!1},At={channelCount:2,channelCountMode:"explicit",channelInterpretation:"speakers",pan:0},kt=()=>new DOMException("","UnknownError"),Ct={channelCount:2,channelCountMode:"max",channelInterpretation:"speakers",curve:null,oversample:"none"},St=(e,t,n)=>void 0===e.copyFromChannel?e.getChannelData(n)[0]:(e.copyFromChannel(t,n),t[0]),Et=e=>{if(null===e)return!1;const t=e.length;return t%2!=0?0!==e[Math.floor(t/2)]:e[t/2-1]+e[t/2]!==0},_t=(e,t,n,s)=>{let r=e;for(;!r.hasOwnProperty(t);)r=Object.getPrototypeOf(r);const{get:a,set:i}=Object.getOwnPropertyDescriptor(r,t);Object.defineProperty(e,t,{get:n(a),set:s(i)})},It=(e,t,n)=>{try{e.setValueAtTime(t,n)}catch(s){if(9!==s.code)throw s;It(e,t,n+1e-7)}},Tt=e=>{const t=e.createOscillator();try{t.start(-1)}catch(e){return e instanceof RangeError}return!1},Nt=e=>{const t=e.createBuffer(1,1,44100),n=e.createBufferSource();n.buffer=t,n.start(),n.stop();try{return n.stop(),!0}catch{return!1}},Ot=e=>{const t=e.createOscillator();try{t.stop(-1)}catch(e){return e instanceof RangeError}return!1},Rt=()=>{try{new DOMException}catch{return!1}return!0},Dt=()=>new Promise((e=>{const t=new ArrayBuffer(0),{port1:n,port2:s}=new MessageChannel;n.onmessage=({data:t})=>e(null!==t),s.postMessage(t,[t])})),Mt=(e,t)=>{const n=t.createGain();e.connect(n);const s=(t=>()=>{t.call(e,n),e.removeEventListener("ended",s)})(e.disconnect);e.addEventListener("ended",s),ht(e,n),e.stop=(t=>{let s=!1;return(r=0)=>{if(s)try{t.call(e,r)}catch{n.gain.setValueAtTime(0,r)}else t.call(e,r),s=!0}})(e.stop)},Ft=(e,t)=>n=>{const s={value:e};return Object.defineProperties(n,{currentTarget:s,target:s}),"function"==typeof t?t.call(e,n):t.handleEvent.call(e,n)},Bt=(e=>(t,n,[s,r,a],i)=>{e(t[r],[n,s,a],(e=>e[0]===n&&e[1]===s),i)})(de),zt=(e=>(t,n,[s,r,a],i)=>{const o=t.get(s);void 0===o?t.set(s,new Set([[r,n,a]])):e(o,[r,n,a],(e=>e[0]===r&&e[1]===n),i)})(de),Lt=(e=>(t,n,s,r)=>e(t[r],(e=>e[0]===n&&e[1]===s)))(U),Pt=new WeakMap,Vt=(e=>t=>{var n;return null!==(n=e.get(t))&&void 0!==n?n:0})(Pt),Wt=(Ut=new Map,Gt=new WeakMap,(e,t)=>{const n=Gt.get(e);if(void 0!==n)return n;const s=Ut.get(e);if(void 0!==s)return s;try{const n=t();return n instanceof Promise?(Ut.set(e,n),n.catch((()=>!1)).then((t=>(Ut.delete(e),Gt.set(e,t),t)))):(Gt.set(e,n),n)}catch{return Gt.set(e,!1),!1}});var Ut,Gt;const qt="undefined"==typeof window?null:window,jt=((e,t)=>(n,s)=>{const r=n.createAnalyser();if(nt(r,s),!(s.maxDecibels>s.minDecibels))throw t();return tt(r,s,"fftSize"),tt(r,s,"maxDecibels"),tt(r,s,"minDecibels"),tt(r,s,"smoothingTimeConstant"),e(st,(()=>st(r)))||(e=>{e.getFloatTimeDomainData=t=>{const n=new Uint8Array(t.length);e.getByteTimeDomainData(n);const s=Math.max(n.length,e.fftSize);for(let e=0;et=>{const n=e(t);if(null===n.renderer)throw new Error("Missing the renderer of the given AudioNode in the audio graph.");return n.renderer})(ae),$t=((e,t,n)=>async(s,r,a)=>{const i=e(s);await Promise.all(i.activeInputs.map(((e,i)=>Array.from(e).map((async([e,o])=>{const l=t(e),u=await l.render(e,r),c=s.context.destination;n(e)||s===c&&n(s)||u.connect(a,o,i)})))).reduce(((e,t)=>[...e,...t]),[]))})(ae,Ht,ke),Kt=((e,t,n)=>()=>{const s=new WeakMap;return{render(r,a){const i=s.get(a);return void 0!==i?Promise.resolve(i):(async(r,a)=>{let i=t(r);if(!Z(i,a)){const t={channelCount:i.channelCount,channelCountMode:i.channelCountMode,channelInterpretation:i.channelInterpretation,fftSize:i.fftSize,maxDecibels:i.maxDecibels,minDecibels:i.minDecibels,smoothingTimeConstant:i.smoothingTimeConstant};i=e(a,t)}return s.set(a,i),await n(r,a,i),i})(r,a)}}})(jt,xe,$t),Xt=(Zt=O,e=>{const t=Zt.get(e);if(void 0===t)throw Ke();return t});var Zt;const Yt=(e=>null===e?null:e.hasOwnProperty("OfflineAudioContext")?e.OfflineAudioContext:e.hasOwnProperty("webkitOfflineAudioContext")?e.webkitOfflineAudioContext:null)(qt),Qt=(e=>t=>null!==e&&t instanceof e)(Yt),Jt=new WeakMap,en=(e=>class{constructor(e){this._nativeEventTarget=e,this._listeners=new WeakMap}addEventListener(t,n,s){if(null!==n){let r=this._listeners.get(n);void 0===r&&(r=e(this,n),"function"==typeof n&&this._listeners.set(n,r)),this._nativeEventTarget.addEventListener(t,r,s)}}dispatchEvent(e){return this._nativeEventTarget.dispatchEvent(e)}removeEventListener(e,t,n){const s=null===t?void 0:this._listeners.get(t);this._nativeEventTarget.removeEventListener(e,void 0===s?null:s,n)}})(Ft),tn=(e=>null===e?null:e.hasOwnProperty("AudioContext")?e.AudioContext:e.hasOwnProperty("webkitAudioContext")?e.webkitAudioContext:null)(qt),nn=(e=>t=>null!==e&&t instanceof e)(tn),sn=(e=>t=>null!==e&&"function"==typeof e.AudioNode&&t instanceof e.AudioNode)(qt),rn=(e=>t=>null!==e&&"function"==typeof e.AudioParam&&t instanceof e.AudioParam)(qt),an=(e=>null===e?null:e.hasOwnProperty("AudioWorkletNode")?e.AudioWorkletNode:null)(qt),on=((e,t,n,s,r,a,i,o,l,u,c,h,d,p,f,m)=>class extends u{constructor(t,s,r,a){super(r),this._context=t,this._nativeAudioNode=r;const i=c(t);h(i)&&!0!==n(Se,(()=>Se(i,m)))&&Ie(r),I.set(this,r),R.set(this,new Set),"closed"!==t.state&&s&&j(this),e(this,a,r)}get channelCount(){return this._nativeAudioNode.channelCount}set channelCount(e){this._nativeAudioNode.channelCount=e}get channelCountMode(){return this._nativeAudioNode.channelCountMode}set channelCountMode(e){this._nativeAudioNode.channelCountMode=e}get channelInterpretation(){return this._nativeAudioNode.channelInterpretation}set channelInterpretation(e){this._nativeAudioNode.channelInterpretation=e}get context(){return this._context}get numberOfInputs(){return this._nativeAudioNode.numberOfInputs}get numberOfOutputs(){return this._nativeAudioNode.numberOfOutputs}connect(e,n=0,o=0){if(n<0||n>=this._nativeAudioNode.numberOfOutputs)throw r();const u=c(this._context),h=f(u);if(d(e)||p(e))throw a();if(ce(e)){const r=xe(e);try{const t=ge(this._nativeAudioNode,r,n,o),s=Ce(this);(h||s)&&this._nativeAudioNode.disconnect(...t),"closed"!==this.context.state&&!s&&Ce(e)&&j(e)}catch(e){if(12===e.code)throw a();throw e}if(t(this,e,n,o,h)){const t=l([this],e);Ee(t,s(h))}return e}const m=Ae(e);if("playbackRate"===m.name&&1024===m.maxValue)throw i();try{this._nativeAudioNode.connect(m,n),(h||Ce(this))&&this._nativeAudioNode.disconnect(m,n)}catch(e){if(12===e.code)throw a();throw e}if(Te(this,e,n,h)){const t=l([this],e);Ee(t,s(h))}}disconnect(e,t,n){let s;const i=c(this._context),u=f(i);if(void 0===e)s=((e,t)=>{const n=ae(e),s=[];for(const r of n.outputs)he(r)?Ne(e,t,...r):Oe(e,t,...r),s.push(r[0]);return n.outputs.clear(),s})(this,u);else if("number"==typeof e){if(e<0||e>=this.numberOfOutputs)throw r();s=((e,t,n)=>{const s=ae(e),r=[];for(const a of s.outputs)a[1]===n&&(he(a)?Ne(e,t,...a):Oe(e,t,...a),r.push(a[0]),s.outputs.delete(a));return r})(this,u,e)}else{if(void 0!==t&&(t<0||t>=this.numberOfOutputs))throw r();if(ce(e)&&void 0!==n&&(n<0||n>=e.numberOfInputs))throw r();if(s=((e,t,n,s,r)=>{const a=ae(e);return Array.from(a.outputs).filter((e=>!(e[0]!==n||void 0!==s&&e[1]!==s||void 0!==r&&e[2]!==r))).map((n=>(he(n)?Ne(e,t,...n):Oe(e,t,...n),a.outputs.delete(n),n[0])))})(this,u,e,t,n),0===s.length)throw a()}for(const e of s){const t=l([this],e);Ee(t,o)}}})((ln=_,(e,t,n)=>{const s=[];for(let e=0;e{const p=new WeakMap;return(f,m,g,y,b)=>{const{activeInputs:w,passiveInputs:v}=a(m),{outputs:x}=a(f),A=o(f),k=a=>{const o=l(m),u=l(f);if(a){const t=G(v,f,g,y);e(w,f,t,!1),b||h(f)||n(u,o,g,y),d(m)&&j(m)}else{const e=s(w,f,g,y);t(v,y,e,!1),b||h(f)||r(u,o,g,y);const n=i(m);if(0===n)c(m)&&K(m,w);else{const e=p.get(m);void 0!==e&&clearTimeout(e),p.set(m,setTimeout((()=>{c(m)&&K(m,w)}),1e3*n))}}};return!!u(x,[m,g,y],(e=>e[0]===m&&e[1]===g&&e[2]===y),!0)&&(A.add(k),c(f)?e(w,f,[g,y,k],!0):t(v,y,[f,g,k],!0),!0)}})(Bt,zt,ge,Lt,ve,ae,Vt,q,xe,de,se,ke,Ce),Wt,((e,t,n,s,r,a)=>i=>(o,l)=>{const u=e.get(o);if(void 0===u){if(!i&&a(o)){const e=s(o),{outputs:a}=n(o);for(const n of a)if(he(n)){const r=s(n[0]);t(e,r,n[1],n[2])}else{const t=r(n[0]);e.disconnect(t,n[1])}}e.set(o,l)}else e.set(o,u+l)})(D,ve,ae,xe,Ae,se),Q,Xe,yt,((e,t,n,s,r,a,i,o)=>(l,u)=>{const c=t.get(l);if(void 0===c)throw new Error("Missing the expected cycle count.");const h=a(l.context),d=o(h);if(c===u){if(t.delete(l),!d&&i(l)){const t=s(l),{outputs:a}=n(l);for(const n of a)if(he(n)){const r=s(n[0]);e(t,r,n[1],n[2])}else{const e=r(n[0]);t.connect(e,n[1])}}}else t.set(l,c-u)})(ge,D,ae,xe,Ae,Xt,se,Qt),((e,t,n)=>function s(r,a){const i=ce(a)?a:n(e,a);if((e=>"delayTime"in e)(i))return[];if(r[0]===i)return[r];if(r.includes(i))return[];const{outputs:o}=t(i);return Array.from(o).map((e=>s([...r,i],e[0]))).reduce(((e,t)=>e.concat(t)),[])})(Jt,ae,W),en,Xt,nn,sn,rn,Qt,an);var ln;const un=((e,t,n,s,r,a)=>class extends e{constructor(e,n){const i=r(e),o={...X,...n},l=s(i,o);super(e,!1,l,a(i)?t():null),this._nativeAnalyserNode=l}get fftSize(){return this._nativeAnalyserNode.fftSize}set fftSize(e){this._nativeAnalyserNode.fftSize=e}get frequencyBinCount(){return this._nativeAnalyserNode.frequencyBinCount}get maxDecibels(){return this._nativeAnalyserNode.maxDecibels}set maxDecibels(e){const t=this._nativeAnalyserNode.maxDecibels;if(this._nativeAnalyserNode.maxDecibels=e,!(e>this._nativeAnalyserNode.minDecibels))throw this._nativeAnalyserNode.maxDecibels=t,n()}get minDecibels(){return this._nativeAnalyserNode.minDecibels}set minDecibels(e){const t=this._nativeAnalyserNode.minDecibels;if(this._nativeAnalyserNode.minDecibels=e,!(this._nativeAnalyserNode.maxDecibels>e))throw this._nativeAnalyserNode.minDecibels=t,n()}get smoothingTimeConstant(){return this._nativeAnalyserNode.smoothingTimeConstant}set smoothingTimeConstant(e){this._nativeAnalyserNode.smoothingTimeConstant=e}getByteFrequencyData(e){this._nativeAnalyserNode.getByteFrequencyData(e)}getByteTimeDomainData(e){this._nativeAnalyserNode.getByteTimeDomainData(e)}getFloatFrequencyData(e){this._nativeAnalyserNode.getFloatFrequencyData(e)}getFloatTimeDomainData(e){this._nativeAnalyserNode.getFloatTimeDomainData(e)}})(on,Kt,Q,jt,Xt,Qt),cn=new WeakSet,hn=(e=>null===e?null:e.hasOwnProperty("AudioBuffer")?e.AudioBuffer:null)(qt),dn=(pn=new Uint32Array(1),e=>(pn[0]=e,pn[0]));var pn;const fn=((e,t)=>n=>{n.copyFromChannel=(s,r,a=0)=>{const i=e(a),o=e(r);if(o>=n.numberOfChannels)throw t();const l=n.length,u=n.getChannelData(o),c=s.length;for(let e=i<0?-i:0;e+i{const i=e(a),o=e(r);if(o>=n.numberOfChannels)throw t();const l=n.length,u=n.getChannelData(o),c=s.length;for(let e=i<0?-i:0;e+it=>{t.copyFromChannel=(n=>(s,r,a=0)=>{const i=e(a),o=e(r);if(i(s,r,a=0)=>{const i=e(a),o=e(r);if(i{let l=null;return class u{constructor(u){if(null===r)throw new Error("Missing the native OfflineAudioContext constructor.");const{length:c,numberOfChannels:h,sampleRate:d}={...ee,...u};null===l&&(l=new r(1,1,44100));const p=null!==s&&t(a,a)?new s({length:c,numberOfChannels:h,sampleRate:d}):l.createBuffer(h,c,d);if(0===p.numberOfChannels)throw n();return"function"!=typeof p.copyFromChannel?(i(p),J(p)):t(Y,(()=>Y(p)))||o(p),e.add(p),p}static[Symbol.hasInstance](t){return null!==t&&"object"==typeof t&&Object.getPrototypeOf(t)===u.prototype||e.has(t)}}})(cn,Wt,yt,hn,Yt,(e=>()=>{if(null===e)return!1;try{new e({length:1,sampleRate:44100})}catch{return!1}return!0})(hn),fn,mn),yn=(e=>(t,n)=>{const s=e(t,{channelCount:1,channelCountMode:"explicit",channelInterpretation:"discrete",gain:0});n.connect(s).connect(t.destination);const r=()=>{n.removeEventListener("ended",r),n.disconnect(s),s.disconnect()};n.addEventListener("ended",r)})(pt),bn=((e,t,n)=>async(s,r,a)=>{const i=t(s);await Promise.all(Array.from(i.activeInputs).map((async([t,s])=>{const i=e(t),o=await i.render(t,r);n(t)||o.connect(a,s)})))})(Ht,ie,ke),wn=(e=>(t,n,s)=>e(n,t,s))(bn),vn=((e,t,n,s,r,a,i,o,l,u,c)=>(h,d)=>{const p=h.createBufferSource();return nt(p,d),rt(p,d,"playbackRate"),tt(p,d,"buffer"),tt(p,d,"loop"),tt(p,d,"loopEnd"),tt(p,d,"loopStart"),t(n,(()=>n(h)))||(e=>{e.start=(t=>{let n=!1;return(s=0,r=0,a)=>{if(n)throw Ke();t.call(e,s,r,a),n=!0}})(e.start)})(p),t(s,(()=>s(h)))||l(p),t(r,(()=>r(h)))||u(p,h),t(a,(()=>a(h)))||at(p),t(i,(()=>i(h)))||c(p,h),t(o,(()=>o(h)))||it(p),e(h,p),p})(yn,Wt,(e=>{const t=e.createBufferSource();t.start();try{t.start()}catch{return!0}return!1}),(e=>{const t=e.createBufferSource(),n=e.createBuffer(1,1,44100);t.buffer=n;try{t.start(0,1)}catch{return!1}return!0}),(e=>{const t=e.createBufferSource();t.start();try{t.stop()}catch{return!1}return!0}),Tt,Nt,Ot,(e=>{e.start=(t=>(n=0,s=0,r)=>{const a=e.buffer,i=null===a?s:Math.min(a.duration,s);null!==a&&i>a.duration-.5/e.context.sampleRate?t.call(e,n,0,0):t.call(e,n,i,r)})(e.start)}),(e=>(t,n)=>{const s=n.createBuffer(1,1,44100);null===t.buffer&&(t.buffer=s),e(t,"buffer",(e=>()=>{const n=e.call(t);return n===s?null:n}),(e=>n=>e.call(t,null===n?s:n)))})(_t),Mt),xn=((e,t)=>(n,s,r)=>(e(s).replay(r),t(s,n,r)))((e=>t=>{const n=e(t);if(null===n.renderer)throw new Error("Missing the renderer of the given AudioParam in the audio graph.");return n.renderer})(ie),bn),An=((e,t,n,s,r)=>()=>{const a=new WeakMap;let i=null,o=null;return{set start(e){i=e},set stop(e){o=e},render(l,u){const c=a.get(u);return void 0!==c?Promise.resolve(c):(async(l,u)=>{let c=n(l);const h=Z(c,u);if(!h){const e={buffer:c.buffer,channelCount:c.channelCount,channelCountMode:c.channelCountMode,channelInterpretation:c.channelInterpretation,loop:c.loop,loopEnd:c.loopEnd,loopStart:c.loopStart,playbackRate:c.playbackRate.value};c=t(u,e),null!==i&&c.start(...i),null!==o&&c.stop(o)}return a.set(u,c),h?await e(u,l.playbackRate,c.playbackRate):await s(u,l.playbackRate,c.playbackRate),await r(l,u,c),c})(l,u)}}})(wn,vn,xe,xn,$t),kn=((e,t,n,s,r,a,i,o,l,u,c,h,d)=>(p,f,m,g=null,y=null)=>{const b=m.value,w=new S(b),v=f?s(w):null,x={get defaultValue(){return b},get maxValue(){return null===g?m.maxValue:g},get minValue(){return null===y?m.minValue:y},get value(){return m.value},set value(e){m.value=e,x.setValueAtTime(e,p.context.currentTime)},cancelAndHoldAtTime(e){if("function"==typeof m.cancelAndHoldAtTime)null===v&&w.flush(p.context.currentTime),w.add(r(e)),m.cancelAndHoldAtTime(e);else{const t=Array.from(w).pop();null===v&&w.flush(p.context.currentTime),w.add(r(e));const n=Array.from(w).pop();m.cancelScheduledValues(e),t!==n&&void 0!==n&&("exponentialRampToValue"===n.type?m.exponentialRampToValueAtTime(n.value,n.endTime):"linearRampToValue"===n.type?m.linearRampToValueAtTime(n.value,n.endTime):"setValue"===n.type?m.setValueAtTime(n.value,n.startTime):"setValueCurve"===n.type&&m.setValueCurveAtTime(n.values,n.startTime,n.duration))}return x},cancelScheduledValues:e=>(null===v&&w.flush(p.context.currentTime),w.add(a(e)),m.cancelScheduledValues(e),x),exponentialRampToValueAtTime(e,t){if(0===e)throw new RangeError;if(!Number.isFinite(t)||t<0)throw new RangeError;const n=p.context.currentTime;return null===v&&w.flush(n),0===Array.from(w).length&&(w.add(u(b,n)),m.setValueAtTime(b,n)),w.add(i(e,t)),m.exponentialRampToValueAtTime(e,t),x},linearRampToValueAtTime(e,t){const n=p.context.currentTime;return null===v&&w.flush(n),0===Array.from(w).length&&(w.add(u(b,n)),m.setValueAtTime(b,n)),w.add(o(e,t)),m.linearRampToValueAtTime(e,t),x},setTargetAtTime:(e,t,n)=>(null===v&&w.flush(p.context.currentTime),w.add(l(e,t,n)),m.setTargetAtTime(e,t,n),x),setValueAtTime:(e,t)=>(null===v&&w.flush(p.context.currentTime),w.add(u(e,t)),m.setValueAtTime(e,t),x),setValueCurveAtTime(e,t,n){const s=e instanceof Float32Array?e:new Float32Array(e);if(null!==h&&"webkitAudioContext"===h.name){const e=t+n,r=p.context.sampleRate,a=Math.ceil(t*r),i=Math.floor(e*r),o=i-a,l=new Float32Array(o);for(let e=0;e{Cn.set(e,{activeInputs:new Set,passiveInputs:new WeakMap,renderer:t})}),Jt,N,(e=>({replay(t){for(const n of e)if("exponentialRampToValue"===n.type){const{endTime:e,value:s}=n;t.exponentialRampToValueAtTime(s,e)}else if("linearRampToValue"===n.type){const{endTime:e,value:s}=n;t.linearRampToValueAtTime(s,e)}else if("setTarget"===n.type){const{startTime:e,target:s,timeConstant:r}=n;t.setTargetAtTime(s,e,r)}else if("setValue"===n.type){const{startTime:e,value:s}=n;t.setValueAtTime(s,e)}else{if("setValueCurve"!==n.type)throw new Error("Can't apply an unknown automation.");{const{duration:e,startTime:s,values:r}=n;t.setValueCurveAtTime(r,s,e)}}}})),(e=>({cancelTime:e,type:"cancelAndHold"})),(e=>({cancelTime:e,type:"cancelScheduledValues"})),((e,t)=>({endTime:t,type:"exponentialRampToValue",value:e})),((e,t)=>({endTime:t,type:"linearRampToValue",value:e})),((e,t,n)=>({startTime:t,target:e,timeConstant:n,type:"setTarget"})),l,u,tn,It);var Cn;const Sn=((e,t,n,s,r,a,i,o)=>class extends e{constructor(e,s){const o=a(e),l={...re,...s},u=r(o,l),c=i(o),h=c?t():null;super(e,!1,u,h),this._audioBufferSourceNodeRenderer=h,this._isBufferNullified=!1,this._isBufferSet=null!==l.buffer,this._nativeAudioBufferSourceNode=u,this._onended=null,this._playbackRate=n(this,c,u.playbackRate,ne,te)}get buffer(){return this._isBufferNullified?null:this._nativeAudioBufferSourceNode.buffer}set buffer(e){if(this._nativeAudioBufferSourceNode.buffer=e,null!==e){if(this._isBufferSet)throw s();this._isBufferSet=!0}}get loop(){return this._nativeAudioBufferSourceNode.loop}set loop(e){this._nativeAudioBufferSourceNode.loop=e}get loopEnd(){return this._nativeAudioBufferSourceNode.loopEnd}set loopEnd(e){this._nativeAudioBufferSourceNode.loopEnd=e}get loopStart(){return this._nativeAudioBufferSourceNode.loopStart}set loopStart(e){this._nativeAudioBufferSourceNode.loopStart=e}get onended(){return this._onended}set onended(e){const t="function"==typeof e?o(this,e):null;this._nativeAudioBufferSourceNode.onended=t;const n=this._nativeAudioBufferSourceNode.onended;this._onended=null!==n&&n===t?e:n}get playbackRate(){return this._playbackRate}start(e=0,t=0,n){if(this._nativeAudioBufferSourceNode.start(e,t,n),null!==this._audioBufferSourceNodeRenderer&&(this._audioBufferSourceNodeRenderer.start=void 0===n?[e,t]:[e,t,n]),"closed"!==this.context.state){j(this);const e=()=>{this._nativeAudioBufferSourceNode.removeEventListener("ended",e),se(this)&&$(this)};this._nativeAudioBufferSourceNode.addEventListener("ended",e)}}stop(e=0){this._nativeAudioBufferSourceNode.stop(e),null!==this._audioBufferSourceNodeRenderer&&(this._audioBufferSourceNodeRenderer.stop=e)}})(on,An,kn,Ke,vn,Xt,Qt,Ft),En=((e,t,n,s,r,a,i,o)=>class extends e{constructor(e,n){const s=a(e),l=i(s),u=r(s,n,l);super(e,!1,u,l?t(o):null),this._isNodeOfNativeOfflineAudioContext=l,this._nativeAudioDestinationNode=u}get channelCount(){return this._nativeAudioDestinationNode.channelCount}set channelCount(e){if(this._isNodeOfNativeOfflineAudioContext)throw s();if(e>this._nativeAudioDestinationNode.maxChannelCount)throw n();this._nativeAudioDestinationNode.channelCount=e}get channelCountMode(){return this._nativeAudioDestinationNode.channelCountMode}set channelCountMode(e){if(this._isNodeOfNativeOfflineAudioContext)throw s();this._nativeAudioDestinationNode.channelCountMode=e}get maxChannelCount(){return this._nativeAudioDestinationNode.maxChannelCount}})(on,(e=>{const t=new WeakMap;return{render(n,s){const r=t.get(s);return void 0!==r?Promise.resolve(r):(async(n,s)=>{const r=s.destination;return t.set(s,r),await e(n,s,r),r})(n,s)}}}),Q,Ke,((e,t)=>(n,s,r)=>{const a=n.destination;if(a.channelCount!==s)try{a.channelCount=s}catch{}r&&"explicit"!==a.channelCountMode&&(a.channelCountMode="explicit"),0===a.maxChannelCount&&Object.defineProperty(a,"maxChannelCount",{value:s});const i=e(n,{channelCount:s,channelCountMode:a.channelCountMode,channelInterpretation:a.channelInterpretation,gain:1});return t(i,"channelCount",(e=>()=>e.call(i)),(e=>t=>{e.call(i,t);try{a.channelCount=t}catch(e){if(t>a.maxChannelCount)throw e}})),t(i,"channelCountMode",(e=>()=>e.call(i)),(e=>t=>{e.call(i,t),a.channelCountMode=t})),t(i,"channelInterpretation",(e=>()=>e.call(i)),(e=>t=>{e.call(i,t),a.channelInterpretation=t})),Object.defineProperty(i,"maxChannelCount",{get:()=>a.maxChannelCount}),i.connect(a),i})(pt,_t),Xt,Qt,$t),_n=((e,t,n,s,r)=>()=>{const a=new WeakMap;return{render(i,o){const l=a.get(o);return void 0!==l?Promise.resolve(l):(async(i,o)=>{let l=n(i);const u=Z(l,o);if(!u){const e={Q:l.Q.value,channelCount:l.channelCount,channelCountMode:l.channelCountMode,channelInterpretation:l.channelInterpretation,detune:l.detune.value,frequency:l.frequency.value,gain:l.gain.value,type:l.type};l=t(o,e)}return a.set(o,l),u?(await e(o,i.Q,l.Q),await e(o,i.detune,l.detune),await e(o,i.frequency,l.frequency),await e(o,i.gain,l.gain)):(await s(o,i.Q,l.Q),await s(o,i.detune,l.detune),await s(o,i.frequency,l.frequency),await s(o,i.gain,l.gain)),await r(i,o,l),l})(i,o)}}})(wn,ut,xe,xn,$t),In=(e=>(t,n)=>e.set(t,n))(Pt),Tn=((e,t,n,s,r,a,i,o)=>class extends e{constructor(e,s){const l=a(e),u={...Le,...s},c=r(l,u),h=i(l);super(e,!1,c,h?n():null),this._Q=t(this,h,c.Q,ne,te),this._detune=t(this,h,c.detune,1200*Math.log2(ne),-1200*Math.log2(ne)),this._frequency=t(this,h,c.frequency,e.sampleRate/2,0),this._gain=t(this,h,c.gain,40*Math.log10(ne),te),this._nativeBiquadFilterNode=c,o(this,1)}get detune(){return this._detune}get frequency(){return this._frequency}get gain(){return this._gain}get Q(){return this._Q}get type(){return this._nativeBiquadFilterNode.type}set type(e){this._nativeBiquadFilterNode.type=e}getFrequencyResponse(e,t,n){try{this._nativeBiquadFilterNode.getFrequencyResponse(e,t,n)}catch(e){if(11===e.code)throw s();throw e}if(e.length!==t.length||t.length!==n.length)throw s()}})(on,kn,_n,Xe,ut,Xt,Qt,In),Nn=((e,t)=>(n,s,r)=>{const a=new Set;return n.connect=(r=>(i,o=0,l=0)=>{const u=0===a.size;if(t(i))return r.call(n,i,o,l),e(a,[i,o,l],(e=>e[0]===i&&e[1]===o&&e[2]===l),!0),u&&s(),i;r.call(n,i,o),e(a,[i,o],(e=>e[0]===i&&e[1]===o),!0),u&&s()})(n.connect),n.disconnect=(e=>(s,i,o)=>{const l=a.size>0;if(void 0===s)e.apply(n),a.clear();else if("number"==typeof s){e.call(n,s);for(const e of a)e[1]===s&&a.delete(e)}else{t(s)?e.call(n,s,i,o):e.call(n,s,i);for(const e of a)e[0]!==s||void 0!==i&&e[1]!==i||void 0!==o&&e[2]!==o||a.delete(e)}const u=0===a.size;l&&u&&r()})(n.disconnect),n})(de,sn),On=((e,t)=>(n,s)=>{s.channelCount=1,s.channelCountMode="explicit",Object.defineProperty(s,"channelCount",{get:()=>1,set:()=>{throw e()}}),Object.defineProperty(s,"channelCountMode",{get:()=>"explicit",set:()=>{throw e()}});const r=n.createBufferSource();t(s,(()=>{const e=s.numberOfInputs;for(let t=0;tr.disconnect(s)))})(Ke,Nn),Rn=((e,t)=>(n,s)=>{const r=n.createChannelMerger(s.numberOfInputs);return null!==e&&"webkitAudioContext"===e.name&&t(n,r),nt(r,s),r})(tn,On),Dn=((e,t,n)=>()=>{const s=new WeakMap;return{render(r,a){const i=s.get(a);return void 0!==i?Promise.resolve(i):(async(r,a)=>{let i=t(r);if(!Z(i,a)){const t={channelCount:i.channelCount,channelCountMode:i.channelCountMode,channelInterpretation:i.channelInterpretation,numberOfInputs:i.numberOfInputs};i=e(a,t)}return s.set(a,i),await n(r,a,i),i})(r,a)}}})(Rn,xe,$t),Mn=((e,t,n,s,r)=>class extends e{constructor(e,a){const i=s(e),o={...Pe,...a};super(e,!1,n(i,o),r(i)?t():null)}})(on,Dn,Rn,Xt,Qt),Fn=((e,t,n)=>()=>{const s=new WeakMap;return{render(r,a){const i=s.get(a);return void 0!==i?Promise.resolve(i):(async(r,a)=>{let i=t(r);if(!Z(i,a)){const t={channelCount:i.channelCount,channelCountMode:i.channelCountMode,channelInterpretation:i.channelInterpretation,numberOfOutputs:i.numberOfOutputs};i=e(a,t)}return s.set(a,i),await n(r,a,i),i})(r,a)}}})(ct,xe,$t),Bn=((e,t,n,s,r,a)=>class extends e{constructor(e,i){const o=s(e),l=a({...Ve,...i});super(e,!1,n(o,l),r(o)?t():null)}})(on,Fn,ct,Xt,Qt,(e=>({...e,channelCount:e.numberOfOutputs}))),zn=((e,t,n,s)=>(r,{offset:a,...i})=>{const o=r.createBuffer(1,2,44100),l=t(r,{buffer:null,channelCount:2,channelCountMode:"max",channelInterpretation:"speakers",loop:!1,loopEnd:0,loopStart:0,playbackRate:1}),u=n(r,{...i,gain:a}),c=o.getChannelData(0);c[0]=1,c[1]=1,l.buffer=o,l.loop=!0;const h={get bufferSize(){},get channelCount(){return u.channelCount},set channelCount(e){u.channelCount=e},get channelCountMode(){return u.channelCountMode},set channelCountMode(e){u.channelCountMode=e},get channelInterpretation(){return u.channelInterpretation},set channelInterpretation(e){u.channelInterpretation=e},get context(){return u.context},get inputs(){return[]},get numberOfInputs(){return l.numberOfInputs},get numberOfOutputs(){return u.numberOfOutputs},get offset(){return u.gain},get onended(){return l.onended},set onended(e){l.onended=e},addEventListener:(...e)=>l.addEventListener(e[0],e[1],e[2]),dispatchEvent:(...e)=>l.dispatchEvent(e[0]),removeEventListener:(...e)=>l.removeEventListener(e[0],e[1],e[2]),start(e=0){l.start.call(l,e)},stop(e=0){l.stop.call(l,e)}};return e(r,l),s(ht(h,u),(()=>l.connect(u)),(()=>l.disconnect(u)))})(yn,vn,pt,Nn),Ln=((e,t,n,s,r)=>(a,i)=>{if(void 0===a.createConstantSource)return n(a,i);const o=a.createConstantSource();return nt(o,i),rt(o,i,"offset"),t(s,(()=>s(a)))||at(o),t(r,(()=>r(a)))||it(o),e(a,o),o})(yn,Wt,zn,Tt,Ot),Pn=((e,t,n,s,r)=>()=>{const a=new WeakMap;let i=null,o=null;return{set start(e){i=e},set stop(e){o=e},render(l,u){const c=a.get(u);return void 0!==c?Promise.resolve(c):(async(l,u)=>{let c=n(l);const h=Z(c,u);if(!h){const e={channelCount:c.channelCount,channelCountMode:c.channelCountMode,channelInterpretation:c.channelInterpretation,offset:c.offset.value};c=t(u,e),null!==i&&c.start(i),null!==o&&c.stop(o)}return a.set(u,c),h?await e(u,l.offset,c.offset):await s(u,l.offset,c.offset),await r(l,u,c),c})(l,u)}}})(wn,Ln,xe,xn,$t),Vn=((e,t,n,s,r,a,i)=>class extends e{constructor(e,i){const o=r(e),l={...We,...i},u=s(o,l),c=a(o),h=c?n():null;super(e,!1,u,h),this._constantSourceNodeRenderer=h,this._nativeConstantSourceNode=u,this._offset=t(this,c,u.offset,ne,te),this._onended=null}get offset(){return this._offset}get onended(){return this._onended}set onended(e){const t="function"==typeof e?i(this,e):null;this._nativeConstantSourceNode.onended=t;const n=this._nativeConstantSourceNode.onended;this._onended=null!==n&&n===t?e:n}start(e=0){if(this._nativeConstantSourceNode.start(e),null!==this._constantSourceNodeRenderer&&(this._constantSourceNodeRenderer.start=e),"closed"!==this.context.state){j(this);const e=()=>{this._nativeConstantSourceNode.removeEventListener("ended",e),se(this)&&$(this)};this._nativeConstantSourceNode.addEventListener("ended",e)}}stop(e=0){this._nativeConstantSourceNode.stop(e),null!==this._constantSourceNodeRenderer&&(this._constantSourceNodeRenderer.stop=e)}})(on,kn,Pn,Ln,Xt,Qt,Ft),Wn=((e,t)=>(n,s)=>{const r=n.createConvolver();if(nt(r,s),s.disableNormalization===r.normalize&&(r.normalize=!s.disableNormalization),tt(r,s,"buffer"),s.channelCount>2)throw e();if(t(r,"channelCount",(e=>()=>e.call(r)),(t=>n=>{if(n>2)throw e();return t.call(r,n)})),"max"===s.channelCountMode)throw e();return t(r,"channelCountMode",(e=>()=>e.call(r)),(t=>n=>{if("max"===n)throw e();return t.call(r,n)})),r})(yt,_t),Un=((e,t,n)=>()=>{const s=new WeakMap;return{render(r,a){const i=s.get(a);return void 0!==i?Promise.resolve(i):(async(r,a)=>{let i=t(r);if(!Z(i,a)){const t={buffer:i.buffer,channelCount:i.channelCount,channelCountMode:i.channelCountMode,channelInterpretation:i.channelInterpretation,disableNormalization:!i.normalize};i=e(a,t)}return s.set(a,i),me(i)?await n(r,a,i.inputs[0]):await n(r,a,i),i})(r,a)}}})(Wn,xe,$t),Gn=((e,t,n,s,r,a)=>class extends e{constructor(e,i){const o=s(e),l={...Ue,...i},u=n(o,l);super(e,!1,u,r(o)?t():null),this._isBufferNullified=!1,this._nativeConvolverNode=u,null!==l.buffer&&a(this,l.buffer.duration)}get buffer(){return this._isBufferNullified?null:this._nativeConvolverNode.buffer}set buffer(e){if(this._nativeConvolverNode.buffer=e,null===e&&null!==this._nativeConvolverNode.buffer){const e=this._nativeConvolverNode.context;this._nativeConvolverNode.buffer=e.createBuffer(1,1,e.sampleRate),this._isBufferNullified=!0,a(this,0)}else this._isBufferNullified=!1,a(this,null===this._nativeConvolverNode.buffer?0:this._nativeConvolverNode.buffer.duration)}get normalize(){return this._nativeConvolverNode.normalize}set normalize(e){this._nativeConvolverNode.normalize=e}})(on,Un,Wn,Xt,Qt,In),qn=((e,t,n,s,r)=>a=>{const i=new WeakMap;return{render(o,l){const u=i.get(l);return void 0!==u?Promise.resolve(u):(async(o,l)=>{let u=n(o);const c=Z(u,l);if(!c){const e={channelCount:u.channelCount,channelCountMode:u.channelCountMode,channelInterpretation:u.channelInterpretation,delayTime:u.delayTime.value,maxDelayTime:a};u=t(l,e)}return i.set(l,u),c?await e(l,o.delayTime,u.delayTime):await s(l,o.delayTime,u.delayTime),await r(o,l,u),u})(o,l)}}})(wn,dt,xe,xn,$t),jn=((e,t,n,s,r,a,i)=>class extends e{constructor(e,o){const l=r(e),u={...qe,...o},c=s(l,u),h=a(l);super(e,!1,c,h?n(u.maxDelayTime):null),this._delayTime=t(this,h,c.delayTime),i(this,u.maxDelayTime)}get delayTime(){return this._delayTime}})(on,kn,qn,dt,Xt,Qt,In),Hn=(e=>(t,n)=>{const s=t.createDynamicsCompressor();if(nt(s,n),n.channelCount>2)throw e();if("max"===n.channelCountMode)throw e();return rt(s,n,"attack"),rt(s,n,"knee"),rt(s,n,"ratio"),rt(s,n,"release"),rt(s,n,"threshold"),s})(yt),$n=((e,t,n,s,r)=>()=>{const a=new WeakMap;return{render(i,o){const l=a.get(o);return void 0!==l?Promise.resolve(l):(async(i,o)=>{let l=n(i);const u=Z(l,o);if(!u){const e={attack:l.attack.value,channelCount:l.channelCount,channelCountMode:l.channelCountMode,channelInterpretation:l.channelInterpretation,knee:l.knee.value,ratio:l.ratio.value,release:l.release.value,threshold:l.threshold.value};l=t(o,e)}return a.set(o,l),u?(await e(o,i.attack,l.attack),await e(o,i.knee,l.knee),await e(o,i.ratio,l.ratio),await e(o,i.release,l.release),await e(o,i.threshold,l.threshold)):(await s(o,i.attack,l.attack),await s(o,i.knee,l.knee),await s(o,i.ratio,l.ratio),await s(o,i.release,l.release),await s(o,i.threshold,l.threshold)),await r(i,o,l),l})(i,o)}}})(wn,Hn,xe,xn,$t),Kn=((e,t,n,s,r,a,i,o)=>class extends e{constructor(e,r){const l=a(e),u={...He,...r},c=s(l,u),h=i(l);super(e,!1,c,h?n():null),this._attack=t(this,h,c.attack),this._knee=t(this,h,c.knee),this._nativeDynamicsCompressorNode=c,this._ratio=t(this,h,c.ratio),this._release=t(this,h,c.release),this._threshold=t(this,h,c.threshold),o(this,.006)}get attack(){return this._attack}get channelCount(){return this._nativeDynamicsCompressorNode.channelCount}set channelCount(e){const t=this._nativeDynamicsCompressorNode.channelCount;if(this._nativeDynamicsCompressorNode.channelCount=e,e>2)throw this._nativeDynamicsCompressorNode.channelCount=t,r()}get channelCountMode(){return this._nativeDynamicsCompressorNode.channelCountMode}set channelCountMode(e){const t=this._nativeDynamicsCompressorNode.channelCountMode;if(this._nativeDynamicsCompressorNode.channelCountMode=e,"max"===e)throw this._nativeDynamicsCompressorNode.channelCountMode=t,r()}get knee(){return this._knee}get ratio(){return this._ratio}get reduction(){return"number"==typeof this._nativeDynamicsCompressorNode.reduction.value?this._nativeDynamicsCompressorNode.reduction.value:this._nativeDynamicsCompressorNode.reduction}get release(){return this._release}get threshold(){return this._threshold}})(on,kn,$n,Hn,yt,Xt,Qt,In),Xn=((e,t,n,s,r)=>()=>{const a=new WeakMap;return{render(i,o){const l=a.get(o);return void 0!==l?Promise.resolve(l):(async(i,o)=>{let l=n(i);const u=Z(l,o);if(!u){const e={channelCount:l.channelCount,channelCountMode:l.channelCountMode,channelInterpretation:l.channelInterpretation,gain:l.gain.value};l=t(o,e)}return a.set(o,l),u?await e(o,i.gain,l.gain):await s(o,i.gain,l.gain),await r(i,o,l),l})(i,o)}}})(wn,pt,xe,xn,$t),Zn=((e,t,n,s,r,a)=>class extends e{constructor(e,i){const o=r(e),l={...$e,...i},u=s(o,l),c=a(o);super(e,!1,u,c?n():null),this._gain=t(this,c,u.gain,ne,te)}get gain(){return this._gain}})(on,kn,Xn,pt,Xt,Qt),Yn=((e,t,n,s)=>(r,a,{channelCount:i,channelCountMode:o,channelInterpretation:l,feedback:u,feedforward:c})=>{const h=ot(a,r.sampleRate),d=u instanceof Float64Array?u:new Float64Array(u),p=c instanceof Float64Array?c:new Float64Array(c),f=d.length,m=p.length,g=Math.min(f,m);if(0===f||f>20)throw s();if(0===d[0])throw t();if(0===m||m>20)throw s();if(0===p[0])throw t();if(1!==d[0]){for(let e=0;e{const t=e.inputBuffer,n=e.outputBuffer,s=t.numberOfChannels;for(let e=0;ey.addEventListener(e[0],e[1],e[2]),dispatchEvent:(...e)=>y.dispatchEvent(e[0]),getFrequencyResponse(t,n,s){if(t.length!==n.length||n.length!==s.length)throw e();const r=t.length;for(let e=0;ey.removeEventListener(e[0],e[1],e[2])},y)})(Xe,Ke,gt,yt),Qn=((e,t,n,s)=>r=>e(Je,(()=>Je(r)))?Promise.resolve(e(s,s)).then((e=>{if(!e){const e=n(r,512,0,1);r.oncomplete=()=>{e.onaudioprocess=null,e.disconnect()},e.onaudioprocess=()=>r.currentTime,e.connect(r.destination)}return r.startRendering()})):new Promise((e=>{const n=t(r,{channelCount:1,channelCountMode:"explicit",channelInterpretation:"discrete",gain:0});r.oncomplete=t=>{n.disconnect(),e(t.renderedBuffer)},n.connect(r.destination),r.startRendering()})))(Wt,pt,gt,((e,t)=>()=>{if(null===t)return Promise.resolve(!1);const n=new t(1,1,44100),s=e(n,{channelCount:1,channelCountMode:"explicit",channelInterpretation:"discrete",gain:0});return new Promise((e=>{n.oncomplete=()=>{s.disconnect(),e(0!==n.currentTime)},n.startRendering()}))})(pt,Yt)),Jn=((e,t,n,s,r)=>(a,i)=>{const o=new WeakMap;let l=null;const u=async(u,c)=>{let h=null,d=t(u);const p=Z(d,c);if(void 0===c.createIIRFilter?h=e(c,{buffer:null,channelCount:2,channelCountMode:"max",channelInterpretation:"speakers",loop:!1,loopEnd:0,loopStart:0,playbackRate:1}):p||(d=c.createIIRFilter(i,a)),o.set(c,null===h?d:h),null!==h){if(null===l){if(null===n)throw new Error("Missing the native OfflineAudioContext constructor.");const e=new n(u.context.destination.channelCount,u.context.length,c.sampleRate);l=(async()=>{await s(u,e,e.destination);return((e,t,n,s)=>{const r=n instanceof Float64Array?n:new Float64Array(n),a=s instanceof Float64Array?s:new Float64Array(s),i=r.length,o=a.length,l=Math.min(i,o);if(1!==r[0]){for(let e=0;e(t,n,s)=>{if(void 0===t.createIIRFilter)return e(t,n,s);const r=t.createIIRFilter(s.feedforward,s.feedback);return nt(r,s),r})(Yn),ts=((e,t,n,s,r,a)=>class extends e{constructor(e,i){const o=s(e),l=r(o),u={...Ze,...i},c=t(o,l?null:e.baseLatency,u);super(e,!1,c,l?n(u.feedback,u.feedforward):null),(e=>{var t;e.getFrequencyResponse=(t=e.getFrequencyResponse,(n,s,r)=>{if(n.length!==s.length||s.length!==r.length)throw Xe();return t.call(e,n,s,r)})})(c),this._nativeIIRFilterNode=c,a(this,1)}getFrequencyResponse(e,t,n){return this._nativeIIRFilterNode.getFrequencyResponse(e,t,n)}})(on,es,Jn,Xt,Qt,In),ns=((e,t,n,s,r,a,i,o)=>(l,u)=>{const c=u.listener,{forwardX:h,forwardY:d,forwardZ:p,positionX:f,positionY:m,positionZ:g,upX:y,upY:b,upZ:w}=void 0===c.forwardX?(()=>{const h=new Float32Array(1),d=t(u,{channelCount:1,channelCountMode:"explicit",channelInterpretation:"speakers",numberOfInputs:9}),p=i(u);let f=!1,m=[0,0,-1,0,1,0],g=[0,0,0];const y=()=>{if(f)return;f=!0;const e=s(u,256,9,0);e.onaudioprocess=({inputBuffer:e})=>{const t=[a(e,h,0),a(e,h,1),a(e,h,2),a(e,h,3),a(e,h,4),a(e,h,5)];t.some(((e,t)=>e!==m[t]))&&(c.setOrientation(...t),m=t);const n=[a(e,h,6),a(e,h,7),a(e,h,8)];n.some(((e,t)=>e!==g[t]))&&(c.setPosition(...n),g=n)},d.connect(e)},b=e=>t=>{t!==m[e]&&(m[e]=t,c.setOrientation(...m))},w=e=>t=>{t!==g[e]&&(g[e]=t,c.setPosition(...g))},v=(t,s,a)=>{const i=n(u,{channelCount:1,channelCountMode:"explicit",channelInterpretation:"discrete",offset:s});i.connect(d,0,t),i.start(),Object.defineProperty(i.offset,"defaultValue",{get:()=>s});const c=e({context:l},p,i.offset,ne,te);var h,f,m,g,b,w,v;return o(c,"value",(e=>()=>e.call(c)),(e=>t=>{try{e.call(c,t)}catch(e){if(9!==e.code)throw e}y(),p&&a(t)})),c.cancelAndHoldAtTime=(h=c.cancelAndHoldAtTime,p?()=>{throw r()}:(...e)=>{const t=h.apply(c,e);return y(),t}),c.cancelScheduledValues=(f=c.cancelScheduledValues,p?()=>{throw r()}:(...e)=>{const t=f.apply(c,e);return y(),t}),c.exponentialRampToValueAtTime=(m=c.exponentialRampToValueAtTime,p?()=>{throw r()}:(...e)=>{const t=m.apply(c,e);return y(),t}),c.linearRampToValueAtTime=(g=c.linearRampToValueAtTime,p?()=>{throw r()}:(...e)=>{const t=g.apply(c,e);return y(),t}),c.setTargetAtTime=(b=c.setTargetAtTime,p?()=>{throw r()}:(...e)=>{const t=b.apply(c,e);return y(),t}),c.setValueAtTime=(w=c.setValueAtTime,p?()=>{throw r()}:(...e)=>{const t=w.apply(c,e);return y(),t}),c.setValueCurveAtTime=(v=c.setValueCurveAtTime,p?()=>{throw r()}:(...e)=>{const t=v.apply(c,e);return y(),t}),c};return{forwardX:v(0,0,b(0)),forwardY:v(1,0,b(1)),forwardZ:v(2,-1,b(2)),positionX:v(6,0,w(0)),positionY:v(7,0,w(1)),positionZ:v(8,0,w(2)),upX:v(3,0,b(3)),upY:v(4,1,b(4)),upZ:v(5,0,b(5))}})():c;return{get forwardX(){return h},get forwardY(){return d},get forwardZ(){return p},get positionX(){return f},get positionY(){return m},get positionZ(){return g},get upX(){return y},get upY(){return b},get upZ(){return w}}})(kn,Rn,Ln,gt,yt,St,Qt,_t),ss=new WeakMap,rs=((e,t,n,s,r,a)=>class extends n{constructor(n,a){super(n),this._nativeContext=n,O.set(this,n),s(n)&&r.set(n,new Set),this._destination=new e(this,a),this._listener=t(this,n),this._onstatechange=null}get currentTime(){return this._nativeContext.currentTime}get destination(){return this._destination}get listener(){return this._listener}get onstatechange(){return this._onstatechange}set onstatechange(e){const t="function"==typeof e?a(this,e):null;this._nativeContext.onstatechange=t;const n=this._nativeContext.onstatechange;this._onstatechange=null!==n&&n===t?e:n}get sampleRate(){return this._nativeContext.sampleRate}get state(){return this._nativeContext.state}})(En,ns,en,Qt,ss,Ft),as=((e,t,n,s,r,a)=>(i,o)=>{const l=i.createOscillator();return nt(l,o),rt(l,o,"detune"),rt(l,o,"frequency"),void 0!==o.periodicWave?l.setPeriodicWave(o.periodicWave):tt(l,o,"type"),t(n,(()=>n(i)))||at(l),t(s,(()=>s(i)))||a(l,i),t(r,(()=>r(i)))||it(l),e(i,l),l})(yn,Wt,Tt,Nt,Ot,Mt),is=((e,t,n,s,r)=>()=>{const a=new WeakMap;let i=null,o=null,l=null;return{set periodicWave(e){i=e},set start(e){o=e},set stop(e){l=e},render(u,c){const h=a.get(c);return void 0!==h?Promise.resolve(h):(async(u,c)=>{let h=n(u);const d=Z(h,c);if(!d){const e={channelCount:h.channelCount,channelCountMode:h.channelCountMode,channelInterpretation:h.channelInterpretation,detune:h.detune.value,frequency:h.frequency.value,periodicWave:null===i?void 0:i,type:h.type};h=t(c,e),null!==o&&h.start(o),null!==l&&h.stop(l)}return a.set(c,h),d?(await e(c,u.detune,h.detune),await e(c,u.frequency,h.frequency)):(await s(c,u.detune,h.detune),await s(c,u.frequency,h.frequency)),await r(u,c,h),h})(u,c)}}})(wn,as,xe,xn,$t),os=((e,t,n,s,r,a,i)=>class extends e{constructor(e,i){const o=r(e),l={...wt,...i},u=n(o,l),c=a(o),h=c?s():null,d=e.sampleRate/2;super(e,!1,u,h),this._detune=t(this,c,u.detune,153600,-153600),this._frequency=t(this,c,u.frequency,d,-d),this._nativeOscillatorNode=u,this._onended=null,this._oscillatorNodeRenderer=h,null!==this._oscillatorNodeRenderer&&void 0!==l.periodicWave&&(this._oscillatorNodeRenderer.periodicWave=l.periodicWave)}get detune(){return this._detune}get frequency(){return this._frequency}get onended(){return this._onended}set onended(e){const t="function"==typeof e?i(this,e):null;this._nativeOscillatorNode.onended=t;const n=this._nativeOscillatorNode.onended;this._onended=null!==n&&n===t?e:n}get type(){return this._nativeOscillatorNode.type}set type(e){this._nativeOscillatorNode.type=e,null!==this._oscillatorNodeRenderer&&(this._oscillatorNodeRenderer.periodicWave=null)}setPeriodicWave(e){this._nativeOscillatorNode.setPeriodicWave(e),null!==this._oscillatorNodeRenderer&&(this._oscillatorNodeRenderer.periodicWave=e)}start(e=0){if(this._nativeOscillatorNode.start(e),null!==this._oscillatorNodeRenderer&&(this._oscillatorNodeRenderer.start=e),"closed"!==this.context.state){j(this);const e=()=>{this._nativeOscillatorNode.removeEventListener("ended",e),se(this)&&$(this)};this._nativeOscillatorNode.addEventListener("ended",e)}}stop(e=0){this._nativeOscillatorNode.stop(e),null!==this._oscillatorNodeRenderer&&(this._oscillatorNodeRenderer.stop=e)}})(on,kn,as,is,Xt,Qt,Ft),ls=(e=>(t,n)=>{const s=e(t,{buffer:null,channelCount:2,channelCountMode:"max",channelInterpretation:"speakers",loop:!1,loopEnd:0,loopStart:0,playbackRate:1}),r=t.createBuffer(1,2,44100);return s.buffer=r,s.loop=!0,s.connect(n),s.start(),()=>{s.stop(),s.disconnect(n)}})(vn),us=((e,t,n,s,r)=>(a,{curve:i,oversample:o,...l})=>{const u=a.createWaveShaper(),c=a.createWaveShaper();nt(u,l),nt(c,l);const h=n(a,{...l,gain:1}),d=n(a,{...l,gain:-1}),p=n(a,{...l,gain:1}),f=n(a,{...l,gain:-1});let m=null,g=!1,y=null;const b={get bufferSize(){},get channelCount(){return u.channelCount},set channelCount(e){h.channelCount=e,d.channelCount=e,u.channelCount=e,p.channelCount=e,c.channelCount=e,f.channelCount=e},get channelCountMode(){return u.channelCountMode},set channelCountMode(e){h.channelCountMode=e,d.channelCountMode=e,u.channelCountMode=e,p.channelCountMode=e,c.channelCountMode=e,f.channelCountMode=e},get channelInterpretation(){return u.channelInterpretation},set channelInterpretation(e){h.channelInterpretation=e,d.channelInterpretation=e,u.channelInterpretation=e,p.channelInterpretation=e,c.channelInterpretation=e,f.channelInterpretation=e},get context(){return u.context},get curve(){return y},set curve(n){if(null!==n&&n.length<2)throw t();if(null===n)u.curve=n,c.curve=n;else{const e=n.length,t=new Float32Array(e+2-e%2),s=new Float32Array(e+2-e%2);t[0]=n[0],s[0]=-n[e-1];const r=Math.ceil((e+1)/2),a=(e+1)/2-1;for(let i=1;ih.addEventListener(e[0],e[1],e[2]),dispatchEvent:(...e)=>h.dispatchEvent(e[0]),removeEventListener:(...e)=>h.removeEventListener(e[0],e[1],e[2])};null!==i&&(b.curve=i instanceof Float32Array?i:new Float32Array(i)),o!==b.oversample&&(b.oversample=o);return r(ht(b,p),(()=>{h.connect(u).connect(p),h.connect(d).connect(c).connect(f).connect(p),g=!0,s(y)&&(m=e(a,h))}),(()=>{h.disconnect(u),u.disconnect(p),h.disconnect(d),d.disconnect(c),c.disconnect(f),f.disconnect(p),g=!1,null!==m&&(m(),m=null)}))})(ls,Ke,pt,Et,Nn),cs=((e,t,n,s,r,a,i)=>(o,l)=>{const u=o.createWaveShaper();if(null!==a&&"webkitAudioContext"===a.name&&void 0===o.createGain().gain.automationRate)return n(o,l);nt(u,l);const c=null===l.curve||l.curve instanceof Float32Array?l.curve:new Float32Array(l.curve);if(null!==c&&c.length<2)throw t();tt(u,{curve:c},"curve"),tt(u,l,"oversample");let h=null,d=!1;i(u,"curve",(e=>()=>e.call(u)),(t=>n=>(t.call(u,n),d&&(s(n)&&null===h?h=e(o,u):s(n)||null===h||(h(),h=null)),n)));return r(u,(()=>{d=!0,s(u.curve)&&(h=e(o,u))}),(()=>{d=!1,null!==h&&(h(),h=null)}))})(ls,Ke,us,Et,Nn,tn,_t),hs=((e,t,n,s,r,a,i,o,l,u)=>(c,{coneInnerAngle:h,coneOuterAngle:d,coneOuterGain:p,distanceModel:f,maxDistance:m,orientationX:g,orientationY:y,orientationZ:b,panningModel:w,positionX:v,positionY:x,positionZ:A,refDistance:k,rolloffFactor:C,...S})=>{const E=c.createPanner();if(S.channelCount>2)throw i();if("max"===S.channelCountMode)throw i();nt(E,S);const _={channelCount:1,channelCountMode:"explicit",channelInterpretation:"discrete"},I=n(c,{..._,channelInterpretation:"speakers",numberOfInputs:6}),T=s(c,{...S,gain:1}),N=s(c,{..._,gain:1}),O=s(c,{..._,gain:0}),R=s(c,{..._,gain:0}),D=s(c,{..._,gain:0}),M=s(c,{..._,gain:0}),F=s(c,{..._,gain:0}),B=r(c,256,6,1),z=a(c,{..._,curve:new Float32Array([1,1]),oversample:"none"});let L=[g,y,b],P=[v,x,A];const V=new Float32Array(1);B.onaudioprocess=({inputBuffer:e})=>{const t=[l(e,V,0),l(e,V,1),l(e,V,2)];t.some(((e,t)=>e!==L[t]))&&(E.setOrientation(...t),L=t);const n=[l(e,V,3),l(e,V,4),l(e,V,5)];n.some(((e,t)=>e!==P[t]))&&(E.setPosition(...n),P=n)},Object.defineProperty(O.gain,"defaultValue",{get:()=>0}),Object.defineProperty(R.gain,"defaultValue",{get:()=>0}),Object.defineProperty(D.gain,"defaultValue",{get:()=>0}),Object.defineProperty(M.gain,"defaultValue",{get:()=>0}),Object.defineProperty(F.gain,"defaultValue",{get:()=>0});const W={get bufferSize(){},get channelCount(){return E.channelCount},set channelCount(e){if(e>2)throw i();T.channelCount=e,E.channelCount=e},get channelCountMode(){return E.channelCountMode},set channelCountMode(e){if("max"===e)throw i();T.channelCountMode=e,E.channelCountMode=e},get channelInterpretation(){return E.channelInterpretation},set channelInterpretation(e){T.channelInterpretation=e,E.channelInterpretation=e},get coneInnerAngle(){return E.coneInnerAngle},set coneInnerAngle(e){E.coneInnerAngle=e},get coneOuterAngle(){return E.coneOuterAngle},set coneOuterAngle(e){E.coneOuterAngle=e},get coneOuterGain(){return E.coneOuterGain},set coneOuterGain(e){if(e<0||e>1)throw t();E.coneOuterGain=e},get context(){return E.context},get distanceModel(){return E.distanceModel},set distanceModel(e){E.distanceModel=e},get inputs(){return[T]},get maxDistance(){return E.maxDistance},set maxDistance(e){if(e<0)throw new RangeError;E.maxDistance=e},get numberOfInputs(){return E.numberOfInputs},get numberOfOutputs(){return E.numberOfOutputs},get orientationX(){return N.gain},get orientationY(){return O.gain},get orientationZ(){return R.gain},get panningModel(){return E.panningModel},set panningModel(e){E.panningModel=e},get positionX(){return D.gain},get positionY(){return M.gain},get positionZ(){return F.gain},get refDistance(){return E.refDistance},set refDistance(e){if(e<0)throw new RangeError;E.refDistance=e},get rolloffFactor(){return E.rolloffFactor},set rolloffFactor(e){if(e<0)throw new RangeError;E.rolloffFactor=e},addEventListener:(...e)=>T.addEventListener(e[0],e[1],e[2]),dispatchEvent:(...e)=>T.dispatchEvent(e[0]),removeEventListener:(...e)=>T.removeEventListener(e[0],e[1],e[2])};h!==W.coneInnerAngle&&(W.coneInnerAngle=h),d!==W.coneOuterAngle&&(W.coneOuterAngle=d),p!==W.coneOuterGain&&(W.coneOuterGain=p),f!==W.distanceModel&&(W.distanceModel=f),m!==W.maxDistance&&(W.maxDistance=m),g!==W.orientationX.value&&(W.orientationX.value=g),y!==W.orientationY.value&&(W.orientationY.value=y),b!==W.orientationZ.value&&(W.orientationZ.value=b),w!==W.panningModel&&(W.panningModel=w),v!==W.positionX.value&&(W.positionX.value=v),x!==W.positionY.value&&(W.positionY.value=x),A!==W.positionZ.value&&(W.positionZ.value=A),k!==W.refDistance&&(W.refDistance=k),C!==W.rolloffFactor&&(W.rolloffFactor=C),1===L[0]&&0===L[1]&&0===L[2]||E.setOrientation(...L),0===P[0]&&0===P[1]&&0===P[2]||E.setPosition(...P);return u(ht(W,E),(()=>{T.connect(E),e(T,z,0,0),z.connect(N).connect(I,0,0),z.connect(O).connect(I,0,1),z.connect(R).connect(I,0,2),z.connect(D).connect(I,0,3),z.connect(M).connect(I,0,4),z.connect(F).connect(I,0,5),I.connect(B).connect(c.destination)}),(()=>{T.disconnect(E),o(T,z,0,0),z.disconnect(N),N.disconnect(I),z.disconnect(O),O.disconnect(I),z.disconnect(R),R.disconnect(I),z.disconnect(D),D.disconnect(I),z.disconnect(M),M.disconnect(I),z.disconnect(F),F.disconnect(I),I.disconnect(B),B.disconnect(c.destination)}))})(ge,Ke,Rn,pt,gt,cs,yt,ve,St,Nn),ds=(e=>(t,n)=>{const s=t.createPanner();return void 0===s.orientationX?e(t,n):(nt(s,n),rt(s,n,"orientationX"),rt(s,n,"orientationY"),rt(s,n,"orientationZ"),rt(s,n,"positionX"),rt(s,n,"positionY"),rt(s,n,"positionZ"),tt(s,n,"coneInnerAngle"),tt(s,n,"coneOuterAngle"),tt(s,n,"coneOuterGain"),tt(s,n,"distanceModel"),tt(s,n,"maxDistance"),tt(s,n,"panningModel"),tt(s,n,"refDistance"),tt(s,n,"rolloffFactor"),s)})(hs),ps=((e,t,n,s,r,a,i,o,l,u)=>()=>{const c=new WeakMap;let h=null;return{render(d,p){const f=c.get(p);return void 0!==f?Promise.resolve(f):(async(d,p)=>{let f=null,m=a(d);const g={channelCount:m.channelCount,channelCountMode:m.channelCountMode,channelInterpretation:m.channelInterpretation},y={...g,coneInnerAngle:m.coneInnerAngle,coneOuterAngle:m.coneOuterAngle,coneOuterGain:m.coneOuterGain,distanceModel:m.distanceModel,maxDistance:m.maxDistance,panningModel:m.panningModel,refDistance:m.refDistance,rolloffFactor:m.rolloffFactor},b=Z(m,p);if("bufferSize"in m)f=s(p,{...g,gain:1});else if(!b){const e={...y,orientationX:m.orientationX.value,orientationY:m.orientationY.value,orientationZ:m.orientationZ.value,positionX:m.positionX.value,positionY:m.positionY.value,positionZ:m.positionZ.value};m=r(p,e)}if(c.set(p,null===f?m:f),null!==f){if(null===h){if(null===i)throw new Error("Missing the native OfflineAudioContext constructor.");const e=new i(6,d.context.length,p.sampleRate),s=t(e,{channelCount:1,channelCountMode:"explicit",channelInterpretation:"speakers",numberOfInputs:6});s.connect(e.destination),h=(async()=>{const t=await Promise.all([d.orientationX,d.orientationY,d.orientationZ,d.positionX,d.positionY,d.positionZ].map((async(t,s)=>{const r=n(e,{channelCount:1,channelCountMode:"explicit",channelInterpretation:"discrete",offset:0===s?1:0});return await o(e,t,r.offset),r})));for(let e=0;e<6;e+=1)t[e].connect(s,0,e),t[e].start(0);return u(e)})()}const e=await h,a=s(p,{...g,gain:1});await l(d,p,a);const c=[];for(let t=0;te!==m[t]))||n.some(((e,t)=>e!==b[t]))){m=e,b=n;const i=t/p.sampleRate;w.gain.setValueAtTime(0,i),w=s(p,{...g,gain:0}),v=r(p,{...y,orientationX:m[0],orientationY:m[1],orientationZ:m[2],positionX:b[0],positionY:b[1],positionZ:b[2]}),w.gain.setValueAtTime(1,i),a.connect(w).connect(v.inputs[0]),v.connect(f)}}return f}return b?(await e(p,d.orientationX,m.orientationX),await e(p,d.orientationY,m.orientationY),await e(p,d.orientationZ,m.orientationZ),await e(p,d.positionX,m.positionX),await e(p,d.positionY,m.positionY),await e(p,d.positionZ,m.positionZ)):(await o(p,d.orientationX,m.orientationX),await o(p,d.orientationY,m.orientationY),await o(p,d.orientationZ,m.orientationZ),await o(p,d.positionX,m.positionX),await o(p,d.positionY,m.positionY),await o(p,d.positionZ,m.positionZ)),me(m)?await l(d,p,m.inputs[0]):await l(d,p,m),m})(d,p)}}})(wn,Rn,Ln,pt,ds,xe,Yt,xn,$t,Qn),fs=((e,t,n,s,r,a,i)=>class extends e{constructor(e,o){const l=r(e),u={...vt,...o},c=n(l,u),h=a(l);super(e,!1,c,h?s():null),this._nativePannerNode=c,this._orientationX=t(this,h,c.orientationX,ne,te),this._orientationY=t(this,h,c.orientationY,ne,te),this._orientationZ=t(this,h,c.orientationZ,ne,te),this._positionX=t(this,h,c.positionX,ne,te),this._positionY=t(this,h,c.positionY,ne,te),this._positionZ=t(this,h,c.positionZ,ne,te),i(this,1)}get coneInnerAngle(){return this._nativePannerNode.coneInnerAngle}set coneInnerAngle(e){this._nativePannerNode.coneInnerAngle=e}get coneOuterAngle(){return this._nativePannerNode.coneOuterAngle}set coneOuterAngle(e){this._nativePannerNode.coneOuterAngle=e}get coneOuterGain(){return this._nativePannerNode.coneOuterGain}set coneOuterGain(e){this._nativePannerNode.coneOuterGain=e}get distanceModel(){return this._nativePannerNode.distanceModel}set distanceModel(e){this._nativePannerNode.distanceModel=e}get maxDistance(){return this._nativePannerNode.maxDistance}set maxDistance(e){this._nativePannerNode.maxDistance=e}get orientationX(){return this._orientationX}get orientationY(){return this._orientationY}get orientationZ(){return this._orientationZ}get panningModel(){return this._nativePannerNode.panningModel}set panningModel(e){this._nativePannerNode.panningModel=e}get positionX(){return this._positionX}get positionY(){return this._positionY}get positionZ(){return this._positionZ}get refDistance(){return this._nativePannerNode.refDistance}set refDistance(e){this._nativePannerNode.refDistance=e}get rolloffFactor(){return this._nativePannerNode.rolloffFactor}set rolloffFactor(e){this._nativePannerNode.rolloffFactor=e}})(on,kn,ds,ps,Xt,Qt,In),ms=(e=>(t,{disableNormalization:n,imag:s,real:r})=>{const a=s instanceof Float32Array?s:new Float32Array(s),i=r instanceof Float32Array?r:new Float32Array(r),o=t.createPeriodicWave(i,a,{disableNormalization:n});if(Array.from(s).length<2)throw e();return o})(Q),gs=((e,t,n,s)=>class r{constructor(r,a){const i=t(r),o=s({...xt,...a}),l=e(i,o);return n.add(l),l}static[Symbol.hasInstance](e){return null!==e&&"object"==typeof e&&Object.getPrototypeOf(e)===r.prototype||n.has(e)}})(ms,Xt,new WeakSet,(e=>{const{imag:t,real:n}=e;return void 0===t?void 0===n?{...e,imag:[0,0],real:[0,0]}:{...e,imag:Array.from(n,(()=>0)),real:n}:void 0===n?{...e,imag:t,real:Array.from(t,(()=>0))}:{...e,imag:t,real:n}})),ys=((e,t,n,s,r,a)=>{const i=16385,o=new Float32Array([1,1]),l=Math.PI/2,u={channelCount:1,channelCountMode:"explicit",channelInterpretation:"discrete"},c={...u,oversample:"none"},h=(e,a,h,d,p)=>{if(1===a)return((e,t,r,a)=>{const h=new Float32Array(i),d=new Float32Array(i);for(let e=0;e{const d=new Float32Array(i),p=new Float32Array(i),f=new Float32Array(i),m=new Float32Array(i),g=Math.floor(8192.5);for(let e=0;eg){const t=(e-g)/(16384-g)*l;d[e]=Math.cos(t),p[e]=Math.sin(t),f[e]=0,m[e]=1}else{const t=e/(16384-g)*l;d[e]=1,p[e]=0,f[e]=Math.cos(t),m[e]=Math.sin(t)}const y=t(e,{channelCount:2,channelCountMode:"explicit",channelInterpretation:"discrete",numberOfOutputs:2}),b=n(e,{...u,gain:0}),w=s(e,{...c,curve:d}),v=n(e,{...u,gain:0}),x=s(e,{...c,curve:p}),A=s(e,{...c,curve:o}),k=n(e,{...u,gain:0}),C=s(e,{...c,curve:f}),S=n(e,{...u,gain:0}),E=s(e,{...c,curve:m});return{connectGraph(){r.connect(y),r.connect(void 0===A.inputs?A:A.inputs[0]),y.connect(b,0),y.connect(v,0),y.connect(k,1),y.connect(S,1),A.connect(a),a.connect(void 0===w.inputs?w:w.inputs[0]),a.connect(void 0===x.inputs?x:x.inputs[0]),a.connect(void 0===C.inputs?C:C.inputs[0]),a.connect(void 0===E.inputs?E:E.inputs[0]),w.connect(b.gain),x.connect(v.gain),C.connect(k.gain),E.connect(S.gain),b.connect(h,0,0),k.connect(h,0,0),v.connect(h,0,1),S.connect(h,0,1)},disconnectGraph(){r.disconnect(y),r.disconnect(void 0===A.inputs?A:A.inputs[0]),y.disconnect(b,0),y.disconnect(v,0),y.disconnect(k,1),y.disconnect(S,1),A.disconnect(a),a.disconnect(void 0===w.inputs?w:w.inputs[0]),a.disconnect(void 0===x.inputs?x:x.inputs[0]),a.disconnect(void 0===C.inputs?C:C.inputs[0]),a.disconnect(void 0===E.inputs?E:E.inputs[0]),w.disconnect(b.gain),x.disconnect(v.gain),C.disconnect(k.gain),E.disconnect(S.gain),b.disconnect(h,0,0),k.disconnect(h,0,0),v.disconnect(h,0,1),S.disconnect(h,0,1)}}})(e,h,d,p);throw r()};return(t,{channelCount:s,channelCountMode:i,pan:o,...l})=>{if("max"===i)throw r();const u=e(t,{...l,channelCount:1,channelCountMode:i,numberOfInputs:2}),c=n(t,{...l,channelCount:s,channelCountMode:i,gain:1}),d=n(t,{channelCount:1,channelCountMode:"explicit",channelInterpretation:"discrete",gain:o});let{connectGraph:p,disconnectGraph:f}=h(t,s,c,d,u);Object.defineProperty(d.gain,"defaultValue",{get:()=>0}),Object.defineProperty(d.gain,"maxValue",{get:()=>1}),Object.defineProperty(d.gain,"minValue",{get:()=>-1});const m={get bufferSize(){},get channelCount(){return c.channelCount},set channelCount(e){c.channelCount!==e&&(g&&f(),({connectGraph:p,disconnectGraph:f}=h(t,e,c,d,u)),g&&p()),c.channelCount=e},get channelCountMode(){return c.channelCountMode},set channelCountMode(e){if("clamped-max"===e||"max"===e)throw r();c.channelCountMode=e},get channelInterpretation(){return c.channelInterpretation},set channelInterpretation(e){c.channelInterpretation=e},get context(){return c.context},get inputs(){return[c]},get numberOfInputs(){return c.numberOfInputs},get numberOfOutputs(){return c.numberOfOutputs},get pan(){return d.gain},addEventListener:(...e)=>c.addEventListener(e[0],e[1],e[2]),dispatchEvent:(...e)=>c.dispatchEvent(e[0]),removeEventListener:(...e)=>c.removeEventListener(e[0],e[1],e[2])};let g=!1;return a(ht(m,u),(()=>{p(),g=!0}),(()=>{f(),g=!1}))}})(Rn,ct,pt,cs,yt,Nn),bs=((e,t)=>(n,s)=>{const r=s.channelCountMode;if("clamped-max"===r)throw t();if(void 0===n.createStereoPanner)return e(n,s);const a=n.createStereoPanner();return nt(a,s),rt(a,s,"pan"),Object.defineProperty(a,"channelCountMode",{get:()=>r,set:e=>{if(e!==r)throw t()}}),a})(ys,yt),ws=((e,t,n,s,r)=>()=>{const a=new WeakMap;return{render(i,o){const l=a.get(o);return void 0!==l?Promise.resolve(l):(async(i,o)=>{let l=n(i);const u=Z(l,o);if(!u){const e={channelCount:l.channelCount,channelCountMode:l.channelCountMode,channelInterpretation:l.channelInterpretation,pan:l.pan.value};l=t(o,e)}return a.set(o,l),u?await e(o,i.pan,l.pan):await s(o,i.pan,l.pan),me(l)?await r(i,o,l.inputs[0]):await r(i,o,l),l})(i,o)}}})(wn,bs,xe,xn,$t),vs=((e,t,n,s,r,a)=>class extends e{constructor(e,i){const o=r(e),l={...At,...i},u=n(o,l),c=a(o);super(e,!1,u,c?s():null),this._pan=t(this,c,u.pan)}get pan(){return this._pan}})(on,kn,bs,ws,Xt,Qt),xs=((e,t,n)=>()=>{const s=new WeakMap;return{render(r,a){const i=s.get(a);return void 0!==i?Promise.resolve(i):(async(r,a)=>{let i=t(r);if(!Z(i,a)){const t={channelCount:i.channelCount,channelCountMode:i.channelCountMode,channelInterpretation:i.channelInterpretation,curve:i.curve,oversample:i.oversample};i=e(a,t)}return s.set(a,i),me(i)?await n(r,a,i.inputs[0]):await n(r,a,i),i})(r,a)}}})(cs,xe,$t),As=((e,t,n,s,r,a,i)=>class extends e{constructor(e,t){const o=r(e),l={...Ct,...t},u=n(o,l);super(e,!0,u,a(o)?s():null),this._isCurveNullified=!1,this._nativeWaveShaperNode=u,i(this,1)}get curve(){return this._isCurveNullified?null:this._nativeWaveShaperNode.curve}set curve(e){if(null===e)this._isCurveNullified=!0,this._nativeWaveShaperNode.curve=new Float32Array([0,0]);else{if(e.length<2)throw t();this._isCurveNullified=!1,this._nativeWaveShaperNode.curve=e}}get oversample(){return this._nativeWaveShaperNode.oversample}set oversample(e){this._nativeWaveShaperNode.oversample=e}})(on,Ke,cs,xs,Xt,Qt,In),ks=(e=>null!==e&&e.isSecureContext)(qt),Cs=(e=>(t,n,s)=>{Object.defineProperties(e,{currentFrame:{configurable:!0,get:()=>Math.round(t*n)},currentTime:{configurable:!0,get:()=>t}});try{return s()}finally{null!==e&&(delete e.currentFrame,delete e.currentTime)}})(qt),Ss=new WeakMap,Es=((e,t)=>n=>{let s=e.get(n);if(void 0!==s)return s;if(null===t)throw new Error("Missing the native OfflineAudioContext constructor.");return s=new t(1,1,44100),e.set(n,s),s})(Ss,Yt),_s=ks?((e,t,n,s,r,a,i,o,l,u,c,h,d)=>{let p=0;return(f,m,g={credentials:"omit"})=>{const y=c.get(f);if(void 0!==y&&y.has(m))return Promise.resolve();const b=u.get(f);if(void 0!==b){const e=b.get(m);if(void 0!==e)return e}const w=a(f),v=void 0===w.audioWorklet?r(m).then((([e,t])=>{const[s,r]=L(e,t);return n(`${s};((a,b)=>{(a[b]=a[b]||[]).push((AudioWorkletProcessor,global,registerProcessor,sampleRate,self,window)=>{${r}\n})})(window,'_AWGS')`)})).then((()=>{const e=d._AWGS.pop();if(void 0===e)throw new SyntaxError;s(w.currentTime,w.sampleRate,(()=>e(class{},void 0,((e,n)=>{if(""===e.trim())throw t();const s=M.get(w);if(void 0!==s){if(s.has(e))throw t();V(n),P(n.parameterDescriptors),s.set(e,n)}else V(n),P(n.parameterDescriptors),M.set(w,new Map([[e,n]]))}),w.sampleRate,void 0,void 0)))})):Promise.all([r(m),Promise.resolve(e(h,h))]).then((([[e,t],n])=>{const s=p+1;p=s;const[r,a]=L(e,t),u=new Blob([`${r};((AudioWorkletProcessor,registerProcessor)=>{${a}\n})(${n?"AudioWorkletProcessor":"class extends AudioWorkletProcessor {__b=new WeakSet();constructor(){super();(p=>p.postMessage=(q=>(m,t)=>q.call(p,m,t?t.filter(u=>!this.__b.has(u)):t))(p.postMessage))(this.port)}}"},(n,p)=>registerProcessor(n,class extends p{${n?"":"__c = (a) => a.forEach(e=>this.__b.add(e.buffer));"}process(i,o,p){${n?"":"i.forEach(this.__c);o.forEach(this.__c);this.__c(Object.values(p));"}return super.process(i.map(j=>j.some(k=>k.length===0)?[]:j),o,p)}}));registerProcessor('__sac${s}',class extends AudioWorkletProcessor{process(){return !1}})`],{type:"application/javascript; charset=utf-8"}),c=URL.createObjectURL(u);return w.audioWorklet.addModule(c,g).then((()=>{if(o(w))return w;const e=i(w);return e.audioWorklet.addModule(c,g).then((()=>e))})).then((e=>{if(null===l)throw new SyntaxError;try{new l(e,`__sac${s}`)}catch{throw new SyntaxError}})).finally((()=>URL.revokeObjectURL(c)))}));return void 0===b?u.set(f,new Map([[m,v]])):b.set(m,v),v.then((()=>{const e=c.get(f);void 0===e?c.set(f,new Set([m])):e.add(m)})).finally((()=>{const e=u.get(f);void 0!==e&&e.delete(m)})),v}})(Wt,yt,(e=>t=>new Promise(((n,s)=>{if(null===e)return void s(new SyntaxError);const r=e.document.head;if(null===r)s(new SyntaxError);else{const a=e.document.createElement("script"),i=new Blob([t],{type:"application/javascript"}),o=URL.createObjectURL(i),l=e.onerror,u=()=>{e.onerror=l,URL.revokeObjectURL(o)};e.onerror=(t,n,r,a,i)=>n===o||n===e.location.href&&1===r&&1===a?(u(),s(i),!1):null!==l?l(t,n,r,a,i):void 0,a.onerror=()=>{u(),s(new SyntaxError)},a.onload=()=>{u(),n()},a.src=o,a.type="module",r.appendChild(a)}})))(qt),Cs,(e=>async t=>{try{const e=await fetch(t);if(e.ok)return[await e.text(),e.url]}catch{}throw e()})((()=>new DOMException("","AbortError"))),Xt,Es,Qt,an,new WeakMap,new WeakMap,((e,t)=>async()=>{if(null===e)return!0;if(null===t)return!1;const n=new Blob(['class A extends AudioWorkletProcessor{process(i){this.port.postMessage(i,[i[0][0].buffer])}}registerProcessor("a",A)'],{type:"application/javascript; charset=utf-8"}),s=new t(1,128,44100),r=URL.createObjectURL(n);let a=!1,i=!1;try{await s.audioWorklet.addModule(r);const t=new e(s,"a",{numberOfOutputs:0}),n=s.createOscillator();t.port.onmessage=()=>a=!0,t.onprocessorerror=()=>i=!0,n.connect(t),n.start(0),await s.startRendering(),await new Promise((e=>setTimeout(e)))}catch{}finally{URL.revokeObjectURL(r)}return a&&!i})(an,Yt),qt):void 0,Is=((e,t)=>n=>e(n)||t(n))(nn,Qt),Ts=((e,t,n,s,r,a,i,o,l,u,c)=>(h,d)=>{const p=i(h)?h:a(h);if(r.has(d)){const e=n();return Promise.reject(e)}try{r.add(d)}catch{}return t(l,(()=>l(p)))?p.decodeAudioData(d).then((n=>(Ge(d).catch((()=>{})),t(o,(()=>o(n)))||c(n),e.add(n),n))):new Promise(((t,n)=>{const r=async()=>{try{await Ge(d)}catch{}},a=e=>{n(e),r()};try{p.decodeAudioData(d,(n=>{"function"!=typeof n.copyFromChannel&&(u(n),J(n)),e.add(n),r().then((()=>t(n)))}),(e=>{a(null===e?s():e)}))}catch(e){a(e)}}))})(cn,Wt,(()=>new DOMException("","DataCloneError")),(()=>new DOMException("","EncodingError")),new WeakSet,Xt,Is,Y,Je,fn,mn),Ns=((e,t,n,s,r,a,i,o,l,u,c,h,d,p,f,m,g,y,b,w)=>class extends f{constructor(t,n){super(t,n),this._nativeContext=t,this._audioWorklet=void 0===e?void 0:{addModule:(t,n)=>e(this,t,n)}}get audioWorklet(){return this._audioWorklet}createAnalyser(){return new t(this)}createBiquadFilter(){return new r(this)}createBuffer(e,t,s){return new n({length:t,numberOfChannels:e,sampleRate:s})}createBufferSource(){return new s(this)}createChannelMerger(e=6){return new a(this,{numberOfInputs:e})}createChannelSplitter(e=6){return new i(this,{numberOfOutputs:e})}createConstantSource(){return new o(this)}createConvolver(){return new l(this)}createDelay(e=1){return new c(this,{maxDelayTime:e})}createDynamicsCompressor(){return new h(this)}createGain(){return new d(this)}createIIRFilter(e,t){return new p(this,{feedback:t,feedforward:e})}createOscillator(){return new m(this)}createPanner(){return new g(this)}createPeriodicWave(e,t,n={disableNormalization:!1}){return new y(this,{...n,imag:t,real:e})}createStereoPanner(){return new b(this)}createWaveShaper(){return new w(this)}decodeAudioData(e,t,n){return u(this._nativeContext,e).then((e=>("function"==typeof t&&t(e),e)),(e=>{throw"function"==typeof n&&n(e),e}))}})(_s,un,gn,Sn,Tn,Mn,Bn,Vn,Gn,Ts,jn,Kn,Zn,ts,rs,os,fs,gs,vs,As),Os=((e,t,n,s)=>class extends e{constructor(e,r){const a=n(e),i=t(a,r);if(s(a))throw TypeError();super(e,!0,i,null),this._nativeMediaElementAudioSourceNode=i}get mediaElement(){return this._nativeMediaElementAudioSourceNode.mediaElement}})(on,((e,t)=>e.createMediaElementSource(t.mediaElement)),Xt,Qt),Rs=((e,t,n,s)=>class extends e{constructor(e,r){const a=n(e);if(s(a))throw new TypeError;const i={...Qe,...r},o=t(a,i);super(e,!1,o,null),this._nativeMediaStreamAudioDestinationNode=o}get stream(){return this._nativeMediaStreamAudioDestinationNode.stream}})(on,((e,t)=>{const n=e.createMediaStreamDestination();return nt(n,t),1===n.numberOfOutputs&&Object.defineProperty(n,"numberOfOutputs",{get:()=>0}),n}),Xt,Qt),Ds=((e,t,n,s)=>class extends e{constructor(e,r){const a=n(e),i=t(a,r);if(s(a))throw new TypeError;super(e,!0,i,null),this._nativeMediaStreamAudioSourceNode=i}get mediaStream(){return this._nativeMediaStreamAudioSourceNode.mediaStream}})(on,((e,{mediaStream:t})=>{const n=t.getAudioTracks();n.sort(((e,t)=>e.idt.id?1:0));const s=n.slice(0,1),r=e.createMediaStreamSource(new MediaStream(s));return Object.defineProperty(r,"mediaStream",{value:t}),r}),Xt,Qt),Ms=((e,t)=>(n,{mediaStreamTrack:s})=>{if("function"==typeof n.createMediaStreamTrackSource)return n.createMediaStreamTrackSource(s);const r=new MediaStream([s]),a=n.createMediaStreamSource(r);if("audio"!==s.kind)throw e();if(t(n))throw new TypeError;return a})(Ke,Qt),Fs=((e,t,n)=>class extends e{constructor(e,s){const r=n(e);super(e,!0,t(r,s),null)}})(on,Ms,Xt),Bs=((e,t,n,s,r,a,i,o,l)=>class extends e{constructor(e={}){if(null===l)throw new Error("Missing the native AudioContext constructor.");let t;try{t=new l(e)}catch(e){if(12===e.code&&"sampleRate is not in range"===e.message)throw n();throw e}if(null===t)throw s();if(!ue(e.latencyHint))throw new TypeError(`The provided value '${e.latencyHint}' is not a valid enum value of type AudioContextLatencyCategory.`);if(void 0!==e.sampleRate&&t.sampleRate!==e.sampleRate)throw n();super(t,2);const{latencyHint:r}=e,{sampleRate:a}=t;if(this._baseLatency="number"==typeof t.baseLatency?t.baseLatency:"balanced"===r?512/a:"interactive"===r||void 0===r?256/a:"playback"===r?1024/a:128*Math.max(2,Math.min(128,Math.round(r*a/128)))/a,this._nativeAudioContext=t,"webkitAudioContext"===l.name?(this._nativeGainNode=t.createGain(),this._nativeOscillatorNode=t.createOscillator(),this._nativeGainNode.gain.value=1e-37,this._nativeOscillatorNode.connect(this._nativeGainNode).connect(t.destination),this._nativeOscillatorNode.start()):(this._nativeGainNode=null,this._nativeOscillatorNode=null),this._state=null,"running"===t.state){this._state="suspended";const e=()=>{"suspended"===this._state&&(this._state=null),t.removeEventListener("statechange",e)};t.addEventListener("statechange",e)}}get baseLatency(){return this._baseLatency}get state(){return null!==this._state?this._state:this._nativeAudioContext.state}close(){return"closed"===this.state?this._nativeAudioContext.close().then((()=>{throw t()})):("suspended"===this._state&&(this._state=null),this._nativeAudioContext.close().then((()=>{null!==this._nativeGainNode&&null!==this._nativeOscillatorNode&&(this._nativeOscillatorNode.stop(),this._nativeGainNode.disconnect(),this._nativeOscillatorNode.disconnect()),le(this)})))}createMediaElementSource(e){return new r(this,{mediaElement:e})}createMediaStreamDestination(){return new a(this)}createMediaStreamSource(e){return new i(this,{mediaStream:e})}createMediaStreamTrackSource(e){return new o(this,{mediaStreamTrack:e})}resume(){return"suspended"===this._state?new Promise(((e,t)=>{const n=()=>{this._nativeAudioContext.removeEventListener("statechange",n),"running"===this._nativeAudioContext.state?e():this.resume().then(e,t)};this._nativeAudioContext.addEventListener("statechange",n)})):this._nativeAudioContext.resume().catch((e=>{if(void 0===e||15===e.code)throw t();throw e}))}suspend(){return this._nativeAudioContext.suspend().catch((e=>{if(void 0===e)throw t();throw e}))}})(Ns,Ke,yt,kt,Os,Rs,Ds,Fs,tn),zs=(e=>t=>{const n=e.get(t);if(void 0===n)throw new Error("The context has no set of AudioWorkletNodes.");return n})(ss),Ls=(e=>(t,n)=>{e(t).add(n)})(zs),Ps=(e=>(t,n,s=0,r=0)=>{const a=t[s];if(void 0===a)throw e();return _e(n)?a.connect(n,0,r):a.connect(n,0)})(Q),Vs=(e=>(t,n)=>{e(t).delete(n)})(zs),Ws=(e=>(t,n=void 0,s=void 0,r=0)=>void 0===n?t.forEach((e=>e.disconnect())):"number"==typeof n?je(e,t,n).disconnect():_e(n)?void 0===s?t.forEach((e=>e.disconnect(n))):void 0===r?je(e,t,s).disconnect(n,0):je(e,t,s).disconnect(n,0,r):void 0===s?t.forEach((e=>e.disconnect(n))):je(e,t,s).disconnect(n,0))(Q),Us=new WeakMap,Gs=((e,t)=>n=>t(e,n))(Us,W),qs=((e,t,n,s,r,a,i,o,l,u,c,h,d)=>(p,f,m,g)=>{if(0===g.numberOfInputs&&0===g.numberOfOutputs)throw l();const y=Array.isArray(g.outputChannelCount)?g.outputChannelCount:Array.from(g.outputChannelCount);if(y.some((e=>e<1)))throw l();if(y.length!==g.numberOfOutputs)throw t();if("explicit"!==g.channelCountMode)throw l();const b=g.channelCount*g.numberOfInputs,w=y.reduce(((e,t)=>e+t),0),v=void 0===m.parameterDescriptors?0:m.parameterDescriptors.length;if(b+v>6||w>6)throw l();const x=new MessageChannel,A=[],k=[];for(let e=0;evoid 0===e?0:e},maxValue:{get:()=>void 0===t?ne:t},minValue:{get:()=>void 0===n?te:n}}),C.push(r)}const S=s(p,{channelCount:1,channelCountMode:"explicit",channelInterpretation:"speakers",numberOfInputs:Math.max(1,b+v)}),E=ot(f,p.sampleRate),_=o(p,E,b+v,Math.max(1,w)),I=r(p,{channelCount:Math.max(1,w),channelCountMode:"explicit",channelInterpretation:"discrete",numberOfOutputs:Math.max(1,w)}),T=[];for(let e=0;e{const n=C[t];return n.connect(S,0,b+t),n.start(0),[e,n.offset]})));S.connect(_);let O=g.channelInterpretation,R=null;const D=0===g.numberOfOutputs?[_]:T,M={get bufferSize(){return E},get channelCount(){return g.channelCount},set channelCount(e){throw n()},get channelCountMode(){return g.channelCountMode},set channelCountMode(e){throw n()},get channelInterpretation(){return O},set channelInterpretation(e){for(const t of A)t.channelInterpretation=e;O=e},get context(){return _.context},get inputs(){return A},get numberOfInputs(){return g.numberOfInputs},get numberOfOutputs(){return g.numberOfOutputs},get onprocessorerror(){return R},set onprocessorerror(e){"function"==typeof R&&M.removeEventListener("processorerror",R),R="function"==typeof e?e:null,"function"==typeof R&&M.addEventListener("processorerror",R)},get parameters(){return N},get port(){return x.port2},addEventListener:(...e)=>_.addEventListener(e[0],e[1],e[2]),connect:e.bind(null,D),disconnect:u.bind(null,D),dispatchEvent:(...e)=>_.dispatchEvent(e[0]),removeEventListener:(...e)=>_.removeEventListener(e[0],e[1],e[2])},B=new Map;var z,L;x.port1.addEventListener=(z=x.port1.addEventListener,(...e)=>{if("message"===e[0]){const t="function"==typeof e[1]?e[1]:"object"==typeof e[1]&&null!==e[1]&&"function"==typeof e[1].handleEvent?e[1].handleEvent:null;if(null!==t){const n=B.get(e[1]);void 0!==n?e[1]=n:(e[1]=e=>{c(p.currentTime,p.sampleRate,(()=>t(e)))},B.set(t,e[1]))}}return z.call(x.port1,e[0],e[1],e[2])}),x.port1.removeEventListener=(L=x.port1.removeEventListener,(...e)=>{if("message"===e[0]){const t=B.get(e[1]);void 0!==t&&(B.delete(e[1]),e[1]=t)}return L.call(x.port1,e[0],e[1],e[2])});let P=null;Object.defineProperty(x.port1,"onmessage",{get:()=>P,set:e=>{"function"==typeof P&&x.port1.removeEventListener("message",P),P="function"==typeof e?e:null,"function"==typeof P&&(x.port1.addEventListener("message",P),x.port1.start())}}),m.prototype.port=x.port1;let V=null;const W=((e,t,n,s)=>{let r=F.get(e);void 0===r&&(r=new WeakMap,F.set(e,r));const a=lt(n,s);return r.set(t,a),a})(p,M,m,g);W.then((e=>V=e));const U=Be(g.numberOfInputs,g.channelCount),G=Be(g.numberOfOutputs,y),q=void 0===m.parameterDescriptors?[]:m.parameterDescriptors.reduce(((e,{name:t})=>({...e,[t]:new Float32Array(128)})),{});let j=!0;const H=()=>{g.numberOfOutputs>0&&_.disconnect(I);for(let e=0,t=0;e{if(null!==V){const n=h(M);for(let s=0;s{Me(e,q,t,b+n,s)}));for(let e=0;e{if(n[t].size>0)return $.set(t,E/128),e;const s=$.get(t);return void 0===s?[]:(e.every((e=>e.every((e=>0===e))))&&(1===s?$.delete(t):$.set(t,s-1)),e)})),r=c(p.currentTime+s/p.sampleRate,p.sampleRate,(()=>V.process(e,G,q)));j=r;for(let e=0,n=0;e_.connect(X).connect(p.destination),Y=()=>{_.disconnect(X),X.disconnect()};return Z(),d(M,(()=>{if(j){Y(),g.numberOfOutputs>0&&_.connect(I);for(let e=0,t=0;e{j&&(Z(),H()),K=!1}))})(Ps,Q,Ke,Rn,ct,Ln,pt,gt,yt,Ws,Cs,Gs,Nn),js=((e,t,n,s,r)=>(a,i,o,l,u,c)=>{if(null!==o)try{const t=new o(a,l,c),s=new Map;let i=null;if(Object.defineProperties(t,{channelCount:{get:()=>c.channelCount,set:()=>{throw e()}},channelCountMode:{get:()=>"explicit",set:()=>{throw e()}},onprocessorerror:{get:()=>i,set:e=>{"function"==typeof i&&t.removeEventListener("processorerror",i),i="function"==typeof e?e:null,"function"==typeof i&&t.addEventListener("processorerror",i)}}}),t.addEventListener=(d=t.addEventListener,(...e)=>{if("processorerror"===e[0]){const t="function"==typeof e[1]?e[1]:"object"==typeof e[1]&&null!==e[1]&&"function"==typeof e[1].handleEvent?e[1].handleEvent:null;if(null!==t){const n=s.get(e[1]);void 0!==n?e[1]=n:(e[1]=n=>{"error"===n.type?(Object.defineProperties(n,{type:{value:"processorerror"}}),t(n)):t(new ErrorEvent(e[0],{...n}))},s.set(t,e[1]))}}return d.call(t,"error",e[1],e[2]),d.call(t,...e)}),t.removeEventListener=(h=t.removeEventListener,(...e)=>{if("processorerror"===e[0]){const t=s.get(e[1]);void 0!==t&&(s.delete(e[1]),e[1]=t)}return h.call(t,"error",e[1],e[2]),h.call(t,e[0],e[1],e[2])}),0!==c.numberOfOutputs){const e=n(a,{channelCount:1,channelCountMode:"explicit",channelInterpretation:"discrete",gain:0});t.connect(e).connect(a.destination);return r(t,(()=>e.disconnect()),(()=>e.connect(a.destination)))}return t}catch(e){if(11===e.code)throw s();throw e}var h,d;if(void 0===u)throw s();return(e=>{const{port1:t}=new MessageChannel;try{t.postMessage(e)}finally{t.close()}})(c),t(a,i,u,c)})(Ke,qs,pt,yt,Nn),Hs=((e,t,n,s,r,a,i,o,l,u,c,h,d,p,f,m)=>(g,y,b)=>{const w=new WeakMap;let v=null;return{render(x,A){o(A,x);const k=w.get(A);return void 0!==k?Promise.resolve(k):(async(o,x)=>{let A=c(o),k=null;const C=Z(A,x),S=Array.isArray(y.outputChannelCount)?y.outputChannelCount:Array.from(y.outputChannelCount);if(null===h){const e=S.reduce(((e,t)=>e+t),0),n=r(x,{channelCount:Math.max(1,e),channelCountMode:"explicit",channelInterpretation:"discrete",numberOfOutputs:Math.max(1,e)}),a=[];for(let e=0;e{const l=new d(n,128*Math.ceil(o.context.length/128),x.sampleRate),u=[],c=[];for(let e=0;e{const t=a(l,{channelCount:1,channelCountMode:"explicit",channelInterpretation:"discrete",offset:e.value});return await p(l,e,t.offset),t}))),g=s(l,{channelCount:1,channelCountMode:"explicit",channelInterpretation:"speakers",numberOfInputs:Math.max(1,e+t)});for(let e=0;ef(o,l,e)))),m(l)};v=ze(o,0===n?null:await l(),x,y,S,b,u)}const e=await v,t=n(x,{buffer:null,channelCount:2,channelCountMode:"max",channelInterpretation:"speakers",loop:!1,loopEnd:0,loopStart:0,playbackRate:1}),[l,c,h]=k;null!==e&&(t.buffer=e,t.start(0)),t.connect(l);for(let e=0,t=0;et=>e.get(t))(Ss),Ks=(e=>(t,n)=>{e.set(t,n)})(Us),Xs=ks?((e,t,n,s,r,a,i,o,l,u,c,h,d,p)=>class extends t{constructor(t,p,f){var m;const g=o(t),y=l(g),b=c({...De,...f});d(b);const w=M.get(g),v=null==w?void 0:w.get(p),x=y||"closed"!==g.state?g:null!==(m=i(g))&&void 0!==m?m:g,A=r(x,y?null:t.baseLatency,u,p,v,b);super(t,!0,A,y?s(p,b,v):null);const k=[];A.parameters.forEach(((e,t)=>{const s=n(this,y,e);k.push([t,s])})),this._nativeAudioWorkletNode=A,this._onprocessorerror=null,this._parameters=new Re(k),y&&e(g,this);const{activeInputs:C}=a(this);h(A,C)}get onprocessorerror(){return this._onprocessorerror}set onprocessorerror(e){const t="function"==typeof e?p(this,e):null;this._nativeAudioWorkletNode.onprocessorerror=t;const n=this._nativeAudioWorkletNode.onprocessorerror;this._onprocessorerror=null!==n&&n===t?e:n}get parameters(){return null===this._parameters?this._nativeAudioWorkletNode.parameters:this._parameters}get port(){return this._nativeAudioWorkletNode.port}})(Ls,on,kn,Hs,js,ae,$s,Xt,Qt,an,(e=>({...e,outputChannelCount:void 0!==e.outputChannelCount?e.outputChannelCount:1===e.numberOfInputs&&1===e.numberOfOutputs?[e.channelCount]:Array.from({length:e.numberOfOutputs},(()=>1))})),Ks,(e=>{const{port1:t,port2:n}=new MessageChannel;try{t.postMessage(e)}finally{t.close(),n.close()}}),Ft):void 0,Zs=(((e,t,n,s,r)=>{})(Ke,yt,kt,rs,tn),((e,t)=>(n,s,r)=>{if(null===t)throw new Error("Missing the native OfflineAudioContext constructor.");try{return new t(n,s,r)}catch(t){if("SyntaxError"===t.name)throw e();throw t}})(yt,Yt)),Ys=((e,t,n,s,r,a,i,o)=>(l,u)=>n(l).render(l,u).then((()=>Promise.all(Array.from(s(u)).map((e=>n(e).render(e,u)))))).then((()=>r(u))).then((n=>("function"!=typeof n.copyFromChannel?(i(n),J(n)):t(a,(()=>a(n)))||o(n),e.add(n),n))))(cn,Wt,Ht,zs,Qn,Y,fn,mn),Qs=(((e,t,n,s,r)=>{})(Wt,Ke,Zs,rs,Ys),((e,t,n,s,r)=>class extends e{constructor(e,n,r){let a;if("number"==typeof e&&void 0!==n&&void 0!==r)a={length:n,numberOfChannels:e,sampleRate:r};else{if("object"!=typeof e)throw new Error("The given parameters are not valid.");a=e}const{length:i,numberOfChannels:o,sampleRate:l}={...bt,...a},u=s(o,i,l);t(Je,(()=>Je(u)))||u.addEventListener("statechange",(()=>{let e=0;const t=n=>{"running"===this._state&&(e>0?(u.removeEventListener("statechange",t),n.stopImmediatePropagation(),this._waitForThePromiseToSettle(n)):e+=1)};return t})()),super(u,o),this._length=i,this._nativeOfflineAudioContext=u,this._state=null}get length(){return void 0===this._nativeOfflineAudioContext.length?this._length:this._nativeOfflineAudioContext.length}get state(){return null===this._state?this._nativeOfflineAudioContext.state:this._state}startRendering(){return"running"===this._state?Promise.reject(n()):(this._state="running",r(this.destination,this._nativeOfflineAudioContext).finally((()=>{this._state=null,le(this)})))}_waitForThePromiseToSettle(e){null===this._state?this._nativeOfflineAudioContext.dispatchEvent(e):setTimeout((()=>this._waitForThePromiseToSettle(e)))}})(Ns,Wt,Ke,Zs,Ys)),Js=((e,t)=>n=>{const s=e.get(n);return t(s)||t(n)})(O,nn),er=((e,t)=>n=>e.has(n)||t(n))(I,sn),tr=((e,t)=>n=>e.has(n)||t(n))(N,rn),nr=((e,t)=>n=>{const s=e.get(n);return t(s)||t(n)})(O,Qt),sr=()=>(async(e,t,n,s,r,a,i,o,l,u,c,h,d,p,f,m)=>{if(e(t,t)&&e(n,n)&&e(r,r)&&e(a,a)&&e(o,o)&&e(l,l)&&e(u,u)&&e(c,c)&&e(h,h)&&e(d,d)&&e(p,p))return(await Promise.all([e(s,s),e(i,i),e(f,f),e(m,m)])).every((e=>e));return!1})(Wt,(e=>()=>{if(null===e)return!1;const t=new e(1,1,44100).createBuffer(1,1,44100);if(void 0===t.copyToChannel)return!0;const n=new Float32Array(2);try{t.copyFromChannel(n,0,0)}catch{return!1}return!0})(Yt),(e=>()=>{if(null===e)return!1;if(void 0!==e.prototype&&void 0!==e.prototype.close)return!0;const t=new e,n=void 0!==t.close;try{t.close()}catch{}return n})(tn),(e=>()=>{if(null===e)return Promise.resolve(!1);const t=new e(1,1,44100);return new Promise((e=>{let n=!0;const s=s=>{n&&(n=!1,t.startRendering(),e(s instanceof TypeError))};let r;try{r=t.decodeAudioData(null,(()=>{}),s)}catch(e){s(e)}void 0!==r&&r.catch(s)}))})(Yt),(e=>()=>{if(null===e)return!1;let t;try{t=new e({latencyHint:"balanced"})}catch{return!1}return t.close(),!0})(tn),(e=>()=>{if(null===e)return!1;const t=new e(1,1,44100).createGain(),n=t.connect(t)===t;return t.disconnect(t),n})(Yt),((e,t)=>async()=>{if(null===e)return!0;if(null===t)return!1;const n=new Blob(['let c,p;class A extends AudioWorkletProcessor{constructor(){super();this.port.onmessage=(e)=>{p=e.data;p.onmessage=()=>{p.postMessage(c);p.close()};this.port.postMessage(0)}}process(){c=1}}registerProcessor("a",A)'],{type:"application/javascript; charset=utf-8"}),s=new MessageChannel,r=new t(1,128,44100),a=URL.createObjectURL(n);let i=!1;try{await r.audioWorklet.addModule(a);const t=new e(r,"a",{numberOfOutputs:0}),n=r.createOscillator();await new Promise((e=>{t.port.onmessage=()=>e(),t.port.postMessage(s.port2,[s.port2])})),t.port.onmessage=()=>i=!0,n.connect(t),n.start(0),await r.startRendering(),i=await new Promise((e=>{s.port1.onmessage=({data:t})=>e(1===t),s.port1.postMessage(0)}))}catch{}finally{s.port1.close(),URL.revokeObjectURL(a)}return i})(an,Yt),(e=>()=>{if(null===e)return!1;const t=new e(1,1,44100).createChannelMerger();if("max"===t.channelCountMode)return!0;try{t.channelCount=2}catch{return!0}return!1})(Yt),(e=>()=>{if(null===e)return!1;const t=new e(1,1,44100);return void 0===t.createConstantSource||t.createConstantSource().offset.maxValue!==Number.POSITIVE_INFINITY})(Yt),(e=>()=>{if(null===e)return!1;const t=new e(1,1,44100),n=t.createConvolver();n.buffer=t.createBuffer(1,1,t.sampleRate);try{n.buffer=t.createBuffer(1,1,t.sampleRate)}catch{return!1}return!0})(Yt),(e=>()=>{if(null===e)return!1;const t=new e(1,1,44100).createConvolver();try{t.channelCount=1}catch{return!1}return!0})(Yt),Rt,(e=>()=>null!==e&&e.hasOwnProperty("isSecureContext"))(qt),(e=>()=>{if(null===e)return!1;const t=new e;try{return t.createMediaStreamSource(new MediaStream),!1}catch(e){return!0}finally{t.close()}})(tn),(e=>()=>{if(null===e)return Promise.resolve(!1);const t=new e(1,1,44100);if(void 0===t.createStereoPanner)return Promise.resolve(!0);if(void 0===t.createConstantSource)return Promise.resolve(!0);const n=t.createConstantSource(),s=t.createStereoPanner();return n.channelCount=1,n.offset.value=1,s.channelCount=1,n.start(),n.connect(s).connect(t.destination),t.startRendering().then((e=>1!==e.getChannelData(0)[0]))})(Yt),Dt);function rr(e,t){if(!e)throw new Error(t)}function ar(e,t,n=1/0){if(!(t<=e&&e<=n))throw new RangeError(`Value must be within [${t}, ${n}], got: ${e}`)}function ir(e){e.isOffline||"running"===e.state||cr('The AudioContext is "suspended". Invoke Tone.start() from a user action to start the audio.')}let or=console;function lr(e){or=e}function ur(...e){or.log(...e)}function cr(...e){or.warn(...e)}function hr(e){return void 0===e}function dr(e){return!hr(e)}function pr(e){return"function"==typeof e}function fr(e){return"number"==typeof e}function mr(e){return"[object Object]"===Object.prototype.toString.call(e)&&e.constructor===Object}function gr(e){return"boolean"==typeof e}function yr(e){return Array.isArray(e)}function br(e){return"string"==typeof e}function wr(e){return br(e)&&/^([a-g]{1}(?:b|#|x|bb)?)(-?[0-9]+)/i.test(e)}const vr="object"==typeof self?self:null,xr=vr&&(vr.hasOwnProperty("AudioContext")||vr.hasOwnProperty("webkitAudioContext"));function Ar(e,t,n,s){var r,a=arguments.length,i=a<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,n):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)i=Reflect.decorate(e,t,n,s);else for(var o=e.length-1;o>=0;o--)(r=e[o])&&(i=(a<3?r(i):a>3?r(t,n,i):r(t,n))||i);return a>3&&i&&Object.defineProperty(t,n,i),i}function kr(e,t,n,s){return new(n||(n=Promise))((function(r,a){function i(e){try{l(s.next(e))}catch(e){a(e)}}function o(e){try{l(s.throw(e))}catch(e){a(e)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(i,o)}l((s=s.apply(e,t||[])).next())}))}Object.create;Object.create;"function"==typeof SuppressedError&&SuppressedError;class Cr{constructor(e,t,n){this._callback=e,this._type=t,this._updateInterval=n,this._createClock()}_createWorker(){const e=new Blob([`\n\t\t\t// the initial timeout time\n\t\t\tlet timeoutTime = ${(1e3*this._updateInterval).toFixed(1)};\n\t\t\t// onmessage callback\n\t\t\tself.onmessage = function(msg){\n\t\t\t\ttimeoutTime = parseInt(msg.data);\n\t\t\t};\n\t\t\t// the tick function which posts a message\n\t\t\t// and schedules a new tick\n\t\t\tfunction tick(){\n\t\t\t\tsetTimeout(tick, timeoutTime);\n\t\t\t\tself.postMessage('tick');\n\t\t\t}\n\t\t\t// call tick initially\n\t\t\ttick();\n\t\t\t`],{type:"text/javascript"}),t=URL.createObjectURL(e),n=new Worker(t);n.onmessage=this._callback.bind(this),this._worker=n}_createTimeout(){this._timeout=setTimeout((()=>{this._createTimeout(),this._callback()}),1e3*this._updateInterval)}_createClock(){if("worker"===this._type)try{this._createWorker()}catch(e){this._type="timeout",this._createClock()}else"timeout"===this._type&&this._createTimeout()}_disposeClock(){this._timeout&&(clearTimeout(this._timeout),this._timeout=0),this._worker&&(this._worker.terminate(),this._worker.onmessage=null)}get updateInterval(){return this._updateInterval}set updateInterval(e){this._updateInterval=Math.max(e,128/44100),"worker"===this._type&&this._worker.postMessage(Math.max(1e3*e,1))}get type(){return this._type}set type(e){this._disposeClock(),this._type=e,this._createClock()}dispose(){this._disposeClock()}}function Sr(e){return tr(e)}function Er(e){return er(e)}function _r(e){return nr(e)}function Ir(e){return Js(e)}function Tr(e){return e instanceof AudioBuffer}function Nr(e,t){return"value"===e||Sr(t)||Er(t)||Tr(t)}function Or(e,...t){if(!t.length)return e;const n=t.shift();if(mr(e)&&mr(n))for(const t in n)Nr(t,n[t])?e[t]=n[t]:mr(n[t])?(e[t]||Object.assign(e,{[t]:{}}),Or(e[t],n[t])):Object.assign(e,{[t]:n[t]});return Or(e,...t)}function Rr(e,t,n=[],s){const r={},a=Array.from(t);if(mr(a[0])&&s&&!Reflect.has(a[0],s)){Object.keys(a[0]).some((t=>Reflect.has(e,t)))||(Or(r,{[s]:a[0]}),n.splice(n.indexOf(s),1),a.shift())}if(1===a.length&&mr(a[0]))Or(r,a[0]);else for(let e=0;e{Reflect.has(e,t)&&delete e[t]})),e}class Fr{constructor(){this.debug=!1,this._wasDisposed=!1}static getDefaults(){return{}}log(...e){(this.debug||vr&&this.toString()===vr.TONE_DEBUG_CLASS)&&ur(this,...e)}dispose(){return this._wasDisposed=!0,this}get disposed(){return this._wasDisposed}toString(){return this.name}}Fr.version=a;const Br=1e-6;function zr(e,t){return e>t+Br}function Lr(e,t){return zr(e,t)||Vr(e,t)}function Pr(e,t){return e+Brthis.memory){const e=this.length-this.memory;this._timeline.splice(0,e)}return this}remove(e){const t=this._timeline.indexOf(e);return-1!==t&&this._timeline.splice(t,1),this}get(e,t="time"){const n=this._search(e,t);return-1!==n?this._timeline[n]:null}peek(){return this._timeline[0]}shift(){return this._timeline.shift()}getAfter(e,t="time"){const n=this._search(e,t);return n+10&&this._timeline[t-1].time=0?this._timeline[n-1]:null}cancel(e){if(this._timeline.length>1){let t=this._search(e);if(t>=0)if(Vr(this._timeline[t].time,e)){for(let n=t;n>=0&&Vr(this._timeline[n].time,e);n--)t=n;this._timeline=this._timeline.slice(0,t)}else this._timeline=this._timeline.slice(0,t+1);else this._timeline=[]}else 1===this._timeline.length&&Lr(this._timeline[0].time,e)&&(this._timeline=[]);return this}cancelBefore(e){const t=this._search(e);return t>=0&&(this._timeline=this._timeline.slice(t+1)),this}previousEvent(e){const t=this._timeline.indexOf(e);return t>0?this._timeline[t-1]:null}_search(e,t="time"){if(0===this._timeline.length)return-1;let n=0;const s=this._timeline.length;let r=s;if(s>0&&this._timeline[s-1][t]<=e)return s-1;for(;n=0&&this._timeline[n].time>=e;)n--;return this._iterate(t,n+1),this}forEachAtTime(e,t){const n=this._search(e);if(-1!==n&&Vr(this._timeline[n].time,e)){let s=n;for(let t=n;t>=0&&Vr(this._timeline[t].time,e);t--)s=t;this._iterate((e=>{t(e)}),s,n)}return this}dispose(){return super.dispose(),this._timeline=[],this}}const Gr=[];function qr(e){Gr.push(e)}const jr=[];function Hr(e){jr.push(e)}class $r extends Fr{constructor(){super(...arguments),this.name="Emitter"}on(e,t){return e.split(/\W+/).forEach((e=>{hr(this._events)&&(this._events={}),this._events.hasOwnProperty(e)||(this._events[e]=[]),this._events[e].push(t)})),this}once(e,t){const n=(...s)=>{t(...s),this.off(e,n)};return this.on(e,n),this}off(e,t){return e.split(/\W+/).forEach((n=>{if(hr(this._events)&&(this._events={}),this._events.hasOwnProperty(e))if(hr(t))this._events[e]=[];else{const n=this._events[e];for(let e=n.length-1;e>=0;e--)n[e]===t&&n.splice(e,1)}})),this}emit(e,...t){if(this._events&&this._events.hasOwnProperty(e)){const n=this._events[e].slice(0);for(let e=0,s=n.length;e{const n=Object.getOwnPropertyDescriptor($r.prototype,t);Object.defineProperty(e.prototype,t,n)}))}dispose(){return super.dispose(),this._events=void 0,this}}class Kr extends $r{constructor(){super(...arguments),this.isOffline=!1}toJSON(){return{}}}class Xr extends Kr{constructor(){super(),this.name="Context",this._constants=new Map,this._timeouts=new Ur,this._timeoutIds=0,this._initialized=!1,this.isOffline=!1,this._workletModules=new Map;const e=Rr(Xr.getDefaults(),arguments,["context"]);e.context?this._context=e.context:this._context=function(e){return new Bs(e)}({latencyHint:e.latencyHint}),this._ticker=new Cr(this.emit.bind(this,"tick"),e.clockSource,e.updateInterval),this.on("tick",this._timeoutLoop.bind(this)),this._context.onstatechange=()=>{this.emit("statechange",this.state)},this._setLatencyHint(e.latencyHint),this.lookAhead=e.lookAhead}static getDefaults(){return{clockSource:"worker",latencyHint:"interactive",lookAhead:.1,updateInterval:.05}}initialize(){var e;return this._initialized||(e=this,Gr.forEach((t=>t(e))),this._initialized=!0),this}createAnalyser(){return this._context.createAnalyser()}createOscillator(){return this._context.createOscillator()}createBufferSource(){return this._context.createBufferSource()}createBiquadFilter(){return this._context.createBiquadFilter()}createBuffer(e,t,n){return this._context.createBuffer(e,t,n)}createChannelMerger(e){return this._context.createChannelMerger(e)}createChannelSplitter(e){return this._context.createChannelSplitter(e)}createConstantSource(){return this._context.createConstantSource()}createConvolver(){return this._context.createConvolver()}createDelay(e){return this._context.createDelay(e)}createDynamicsCompressor(){return this._context.createDynamicsCompressor()}createGain(){return this._context.createGain()}createIIRFilter(e,t){return this._context.createIIRFilter(e,t)}createPanner(){return this._context.createPanner()}createPeriodicWave(e,t,n){return this._context.createPeriodicWave(e,t,n)}createStereoPanner(){return this._context.createStereoPanner()}createWaveShaper(){return this._context.createWaveShaper()}createMediaStreamSource(e){rr(Ir(this._context),"Not available if OfflineAudioContext");return this._context.createMediaStreamSource(e)}createMediaElementSource(e){rr(Ir(this._context),"Not available if OfflineAudioContext");return this._context.createMediaElementSource(e)}createMediaStreamDestination(){rr(Ir(this._context),"Not available if OfflineAudioContext");return this._context.createMediaStreamDestination()}decodeAudioData(e){return this._context.decodeAudioData(e)}get currentTime(){return this._context.currentTime}get state(){return this._context.state}get sampleRate(){return this._context.sampleRate}get listener(){return this.initialize(),this._listener}set listener(e){rr(!this._initialized,"The listener cannot be set after initialization."),this._listener=e}get transport(){return this.initialize(),this._transport}set transport(e){rr(!this._initialized,"The transport cannot be set after initialization."),this._transport=e}get draw(){return this.initialize(),this._draw}set draw(e){rr(!this._initialized,"Draw cannot be set after initialization."),this._draw=e}get destination(){return this.initialize(),this._destination}set destination(e){rr(!this._initialized,"The destination cannot be set after initialization."),this._destination=e}createAudioWorkletNode(e,t){return function(e,t,n){return rr(dr(Xs),"This node only works in a secure context (https or localhost)"),new Xs(e,t,n)}(this.rawContext,e,t)}addAudioWorkletModule(e,t){return kr(this,void 0,void 0,(function*(){rr(dr(this.rawContext.audioWorklet),"AudioWorkletNode is only available in a secure context (https or localhost)"),this._workletModules.has(t)||this._workletModules.set(t,this.rawContext.audioWorklet.addModule(e)),yield this._workletModules.get(t)}))}workletsAreReady(){return kr(this,void 0,void 0,(function*(){const e=[];this._workletModules.forEach((t=>e.push(t))),yield Promise.all(e)}))}get updateInterval(){return this._ticker.updateInterval}set updateInterval(e){this._ticker.updateInterval=e}get clockSource(){return this._ticker.type}set clockSource(e){this._ticker.type=e}get latencyHint(){return this._latencyHint}_setLatencyHint(e){let t=0;if(this._latencyHint=e,br(e))switch(e){case"interactive":t=.1;break;case"playback":t=.5;break;case"balanced":t=.25}this.lookAhead=t,this.updateInterval=t/2}get rawContext(){return this._context}now(){return this._context.currentTime+this.lookAhead}immediate(){return this._context.currentTime}resume(){return Ir(this._context)?this._context.resume():Promise.resolve()}close(){return kr(this,void 0,void 0,(function*(){var e;Ir(this._context)&&(yield this._context.close()),this._initialized&&(e=this,jr.forEach((t=>t(e))))}))}getConstant(e){if(this._constants.has(e))return this._constants.get(e);{const t=this._context.createBuffer(1,128,this._context.sampleRate),n=t.getChannelData(0);for(let t=0;tthis._constants[e].disconnect())),this}_timeoutLoop(){const e=this.now();let t=this._timeouts.peek();for(;this._timeouts.length&&t&&t.time<=e;)t.callback(),this._timeouts.shift(),t=this._timeouts.peek()}setTimeout(e,t){this._timeoutIds++;const n=this.now();return this._timeouts.add({callback:e,id:this._timeoutIds,time:n+t}),this._timeoutIds}clearTimeout(e){return this._timeouts.forEach((t=>{t.id===e&&this._timeouts.remove(t)})),this}clearInterval(e){return this.clearTimeout(e)}setInterval(e,t){const n=++this._timeoutIds,s=()=>{const r=this.now();this._timeouts.add({callback:()=>{e(),s()},id:n,time:r+t})};return s(),n}}function Zr(e,t){yr(t)?t.forEach((t=>Zr(e,t))):Object.defineProperty(e,t,{enumerable:!0,writable:!1})}function Yr(e,t){yr(t)?t.forEach((t=>Yr(e,t))):Object.defineProperty(e,t,{writable:!0})}const Qr=()=>{};class Jr extends Fr{constructor(){super(),this.name="ToneAudioBuffer",this.onload=Qr;const e=Rr(Jr.getDefaults(),arguments,["url","onload","onerror"]);this.reverse=e.reverse,this.onload=e.onload,e.url&&Tr(e.url)||e.url instanceof Jr?this.set(e.url):br(e.url)&&this.load(e.url).catch(e.onerror)}static getDefaults(){return{onerror:Qr,onload:Qr,reverse:!1}}get sampleRate(){return this._buffer?this._buffer.sampleRate:sa().sampleRate}set(e){return e instanceof Jr?e.loaded?this._buffer=e.get():e.onload=()=>{this.set(e),this.onload(this)}:this._buffer=e,this._reversed&&this._reverse(),this}get(){return this._buffer}load(e){return kr(this,void 0,void 0,(function*(){const t=Jr.load(e).then((e=>{this.set(e),this.onload(this)}));Jr.downloads.push(t);try{yield t}finally{const e=Jr.downloads.indexOf(t);Jr.downloads.splice(e,1)}return this}))}dispose(){return super.dispose(),this._buffer=void 0,this}fromArray(e){const t=yr(e)&&e[0].length>0,n=t?e.length:1,s=t?e[0].length:e.length,r=sa(),a=r.createBuffer(n,s,r.sampleRate),i=t||1!==n?e:[e];for(let e=0;ee/t)),this.fromArray(e)}return this}toArray(e){if(fr(e))return this.getChannelData(e);if(1===this.numberOfChannels)return this.toArray(0);{const e=[];for(let t=0;t0}get duration(){return this._buffer?this._buffer.duration:0}get length(){return this._buffer?this._buffer.length:0}get numberOfChannels(){return this._buffer?this._buffer.numberOfChannels:0}get reverse(){return this._reversed}set reverse(e){this._reversed!==e&&(this._reversed=e,this._reverse())}static fromArray(e){return(new Jr).fromArray(e)}static fromUrl(e){return kr(this,void 0,void 0,(function*(){const t=new Jr;return yield t.load(e)}))}static load(e){return kr(this,void 0,void 0,(function*(){const t=e.match(/\[([^\]\[]+\|.+)\]$/);if(t){const n=t[1].split("|");let s=n[0];for(const e of n)if(Jr.supportsType(e)){s=e;break}e=e.replace(t[0],s)}const n=""===Jr.baseUrl||Jr.baseUrl.endsWith("/")?Jr.baseUrl:Jr.baseUrl+"/",s=yield fetch(n+e);if(!s.ok)throw new Error(`could not load url: ${e}`);const r=yield s.arrayBuffer();return yield sa().decodeAudioData(r)}))}static supportsType(e){const t=e.split("."),n=t[t.length-1];return""!==document.createElement("audio").canPlayType("audio/"+n)}static loaded(){return kr(this,void 0,void 0,(function*(){for(yield Promise.resolve();Jr.downloads.length;)yield Jr.downloads[0]}))}}Jr.baseUrl="",Jr.downloads=[];class ea extends Xr{constructor(){var e,t,n;super({clockSource:"offline",context:_r(arguments[0])?arguments[0]:(e=arguments[0],t=arguments[1]*arguments[2],n=arguments[2],new Qs(e,t,n)),lookAhead:0,updateInterval:_r(arguments[0])?128/arguments[0].sampleRate:128/arguments[2]}),this.name="OfflineContext",this._currentTime=0,this.isOffline=!0,this._duration=_r(arguments[0])?arguments[0].length/arguments[0].sampleRate:arguments[1]}now(){return this._currentTime}get currentTime(){return this._currentTime}_renderClock(e){return kr(this,void 0,void 0,(function*(){let t=0;for(;this._duration-this._currentTime>=0;){this.emit("tick"),this._currentTime+=128/this.sampleRate,t++;const n=Math.floor(this.sampleRate/128);e&&t%n==0&&(yield new Promise((e=>setTimeout(e,1))))}}))}render(e=!0){return kr(this,void 0,void 0,(function*(){yield this.workletsAreReady(),yield this._renderClock(e);const t=yield this._context.startRendering();return new Jr(t)}))}close(){return Promise.resolve()}}const ta=new class extends Kr{constructor(){super(...arguments),this.lookAhead=0,this.latencyHint=0,this.isOffline=!1}createAnalyser(){return{}}createOscillator(){return{}}createBufferSource(){return{}}createBiquadFilter(){return{}}createBuffer(e,t,n){return{}}createChannelMerger(e){return{}}createChannelSplitter(e){return{}}createConstantSource(){return{}}createConvolver(){return{}}createDelay(e){return{}}createDynamicsCompressor(){return{}}createGain(){return{}}createIIRFilter(e,t){return{}}createPanner(){return{}}createPeriodicWave(e,t,n){return{}}createStereoPanner(){return{}}createWaveShaper(){return{}}createMediaStreamSource(e){return{}}createMediaElementSource(e){return{}}createMediaStreamDestination(){return{}}decodeAudioData(e){return Promise.resolve({})}createAudioWorkletNode(e,t){return{}}get rawContext(){return{}}addAudioWorkletModule(e,t){return kr(this,void 0,void 0,(function*(){return Promise.resolve()}))}resume(){return Promise.resolve()}setTimeout(e,t){return 0}clearTimeout(e){return this}setInterval(e,t){return 0}clearInterval(e){return this}getConstant(e){return{}}get currentTime(){return 0}get state(){return{}}get sampleRate(){return 0}get listener(){return{}}get transport(){return{}}get draw(){return{}}set draw(e){}get destination(){return{}}set destination(e){}now(){return 0}immediate(){return 0}};let na=ta;function sa(){return na===ta&&xr&&ra(new Xr),na}function ra(e){na=Ir(e)?new Xr(e):_r(e)?new ea(e):e}function aa(){return na.resume()}if(vr&&!vr.TONE_SILENCE_LOGGING){let e="v";"dev"===a&&(e="")}function ia(e){return Math.pow(10,e/20)}function oa(e){return Math.log(e)/Math.LN10*20}function la(e){return Math.pow(2,e/12)}let ua=440;function ca(e){return Math.round(ha(e))}function ha(e){return 69+12*Math.log2(e/ua)}function da(e){return ua*Math.pow(2,(e-69)/12)}class pa extends Fr{constructor(e,t,n){super(),this.defaultUnits="s",this._val=t,this._units=n,this.context=e,this._expressions=this._getExpressions()}_getExpressions(){return{hz:{method:e=>this._frequencyToUnits(parseFloat(e)),regexp:/^(\d+(?:\.\d+)?)hz$/i},i:{method:e=>this._ticksToUnits(parseInt(e,10)),regexp:/^(\d+)i$/i},m:{method:e=>this._beatsToUnits(parseInt(e,10)*this._getTimeSignature()),regexp:/^(\d+)m$/i},n:{method:(e,t)=>{const n=parseInt(e,10),s="."===t?1.5:1;return 1===n?this._beatsToUnits(this._getTimeSignature())*s:this._beatsToUnits(4/n)*s},regexp:/^(\d+)n(\.?)$/i},number:{method:e=>this._expressions[this.defaultUnits].method.call(this,e),regexp:/^(\d+(?:\.\d+)?)$/},s:{method:e=>this._secondsToUnits(parseFloat(e)),regexp:/^(\d+(?:\.\d+)?)s$/},samples:{method:e=>parseInt(e,10)/this.context.sampleRate,regexp:/^(\d+)samples$/},t:{method:e=>{const t=parseInt(e,10);return this._beatsToUnits(8/(3*Math.floor(t)))},regexp:/^(\d+)t$/i},tr:{method:(e,t,n)=>{let s=0;return e&&"0"!==e&&(s+=this._beatsToUnits(this._getTimeSignature()*parseFloat(e))),t&&"0"!==t&&(s+=this._beatsToUnits(parseFloat(t))),n&&"0"!==n&&(s+=this._beatsToUnits(parseFloat(n)/4)),s},regexp:/^(\d+(?:\.\d+)?):(\d+(?:\.\d+)?):?(\d+(?:\.\d+)?)?$/}}}valueOf(){if(this._val instanceof pa&&this.fromType(this._val),hr(this._val))return this._noArg();if(br(this._val)&&hr(this._units)){for(const e in this._expressions)if(this._expressions[e].regexp.test(this._val.trim())){this._units=e;break}}else if(mr(this._val)){let e=0;for(const t in this._val)if(dr(this._val[t])){const n=this._val[t];e+=new this.constructor(this.context,t).valueOf()*n}return e}if(dr(this._units)){const e=this._expressions[this._units],t=this._val.toString().trim().match(e.regexp);return t?e.method.apply(this,t.slice(1)):e.method.call(this,this._val)}return br(this._val)?parseFloat(this._val):this._val}_frequencyToUnits(e){return 1/e}_beatsToUnits(e){return 60/this._getBpm()*e}_secondsToUnits(e){return e}_ticksToUnits(e){return e*this._beatsToUnits(1)/this._getPPQ()}_noArg(){return this._now()}_getBpm(){return this.context.transport.bpm.value}_getTimeSignature(){return this.context.transport.timeSignature}_getPPQ(){return this.context.transport.PPQ}fromType(e){switch(this._units=void 0,this.defaultUnits){case"s":this._val=e.toSeconds();break;case"i":this._val=e.toTicks();break;case"hz":this._val=e.toFrequency();break;case"midi":this._val=e.toMidi()}return this}toFrequency(){return 1/this.toSeconds()}toSamples(){return this.toSeconds()*this.context.sampleRate}toMilliseconds(){return 1e3*this.toSeconds()}}class fa extends pa{constructor(){super(...arguments),this.name="TimeClass"}_getExpressions(){return Object.assign(super._getExpressions(),{now:{method:e=>this._now()+new this.constructor(this.context,e).valueOf(),regexp:/^\+(.+)/},quantize:{method:e=>{const t=new fa(this.context,e).valueOf();return this._secondsToUnits(this.context.transport.nextSubdivision(t))},regexp:/^@(.+)/}})}quantize(e,t=1){const n=new this.constructor(this.context,e).valueOf(),s=this.valueOf();return s+(Math.round(s/n)*n-s)*t}toNotation(){const e=this.toSeconds(),t=["1m"];for(let e=1;e<9;e++){const n=Math.pow(2,e);t.push(n+"n."),t.push(n+"n"),t.push(n+"t")}t.push("0");let n=t[0],s=new fa(this.context,t[0]).toSeconds();return t.forEach((t=>{const r=new fa(this.context,t).toSeconds();Math.abs(r-e)3&&(s=parseFloat(parseFloat(r).toFixed(3)));return[n,t,s].join(":")}toTicks(){const e=this._beatsToUnits(1),t=this.valueOf()/e;return Math.round(t*this._getPPQ())}toSeconds(){return this.valueOf()}toMidi(){return ca(this.toFrequency())}_now(){return this.context.now()}}function ma(e,t){return new fa(sa(),e,t)}class ga extends fa{constructor(){super(...arguments),this.name="Frequency",this.defaultUnits="hz"}static get A4(){return ua}static set A4(e){!function(e){ua=e}(e)}_getExpressions(){return Object.assign({},super._getExpressions(),{midi:{regexp:/^(\d+(?:\.\d+)?midi)/,method(e){return"midi"===this.defaultUnits?e:ga.mtof(e)}},note:{regexp:/^([a-g]{1}(?:b|#|x|bb)?)(-?[0-9]+)/i,method(e,t){const n=ya[e.toLowerCase()]+12*(parseInt(t,10)+1);return"midi"===this.defaultUnits?n:ga.mtof(n)}},tr:{regexp:/^(\d+(?:\.\d+)?):(\d+(?:\.\d+)?):?(\d+(?:\.\d+)?)?/,method(e,t,n){let s=1;return e&&"0"!==e&&(s*=this._beatsToUnits(this._getTimeSignature()*parseFloat(e))),t&&"0"!==t&&(s*=this._beatsToUnits(parseFloat(t))),n&&"0"!==n&&(s*=this._beatsToUnits(parseFloat(n)/4)),s}}})}transpose(e){return new ga(this.context,this.valueOf()*la(e))}harmonize(e){return e.map((e=>this.transpose(e)))}toMidi(){return ca(this.valueOf())}toNote(){const e=this.toFrequency(),t=Math.log2(e/ga.A4);let n=Math.round(12*t)+57;const s=Math.floor(n/12);s<0&&(n+=-12*s);return ba[n%12]+s.toString()}toSeconds(){return 1/super.toSeconds()}toTicks(){const e=this._beatsToUnits(1),t=this.valueOf()/e;return Math.floor(t*this._getPPQ())}_noArg(){return 0}_frequencyToUnits(e){return e}_ticksToUnits(e){return 1/(60*e/(this._getBpm()*this._getPPQ()))}_beatsToUnits(e){return 1/super._beatsToUnits(e)}_secondsToUnits(e){return 1/e}static mtof(e){return da(e)}static ftom(e){return ca(e)}}const ya={cbb:-2,cb:-1,c:0,"c#":1,cx:2,dbb:0,db:1,d:2,"d#":3,dx:4,ebb:2,eb:3,e:4,"e#":5,ex:6,fbb:3,fb:4,f:5,"f#":6,fx:7,gbb:5,gb:6,g:7,"g#":8,gx:9,abb:7,ab:8,a:9,"a#":10,ax:11,bbb:9,bb:10,b:11,"b#":12,bx:13},ba=["C","C#","D","D#","E","F","F#","G","G#","A","A#","B"];function wa(e,t){return new ga(sa(),e,t)}class va extends fa{constructor(){super(...arguments),this.name="TransportTime"}_now(){return this.context.transport.seconds}}function xa(e,t){return new va(sa(),e,t)}class Aa extends Fr{constructor(){super();const e=Rr(Aa.getDefaults(),arguments,["context"]);this.defaultContext?this.context=this.defaultContext:this.context=e.context}static getDefaults(){return{context:sa()}}now(){return this.context.currentTime+this.context.lookAhead}immediate(){return this.context.currentTime}get sampleTime(){return 1/this.context.sampleRate}get blockTime(){return 128/this.context.sampleRate}toSeconds(e){return new fa(this.context,e).toSeconds()}toFrequency(e){return new ga(this.context,e).toFrequency()}toTicks(e){return new va(this.context,e).toTicks()}_getPartialProperties(e){const t=this.get();return Object.keys(t).forEach((n=>{hr(e[n])&&delete t[n]})),t}get(){const e=this.constructor.getDefaults();return Object.keys(e).forEach((t=>{if(Reflect.has(this,t)){const n=this[t];dr(n)&&dr(n.value)&&dr(n.setValueAtTime)?e[t]=n.value:n instanceof Aa?e[t]=n._getPartialProperties(e[t]):yr(n)||fr(n)||br(n)||gr(n)?e[t]=n:delete e[t]}})),e}set(e){return Object.keys(e).forEach((t=>{Reflect.has(this,t)&&dr(this[t])&&(this[t]&&dr(this[t].value)&&dr(this[t].setValueAtTime)?this[t].value!==e[t]&&(this[t].value=e[t]):this[t]instanceof Aa?this[t].set(e[t]):this[t]=e[t])})),this}}class ka extends Ur{constructor(e="stopped"){super(),this.name="StateTimeline",this._initial=e,this.setStateAtTime(this._initial,0)}getValueAtTime(e){const t=this.get(e);return null!==t?t.state:this._initial}setStateAtTime(e,t,n){return ar(t,0),this.add(Object.assign({},n,{state:e,time:t})),this}getLastState(e,t){for(let n=this._search(t);n>=0;n--){const t=this._timeline[n];if(t.state===e)return t}}getNextState(e,t){const n=this._search(t);if(-1!==n)for(let t=n;t0,"timeConstant must be a number greater than 0");const r=this.toSeconds(t);return this._assertRange(s),rr(isFinite(s)&&isFinite(r),`Invalid argument(s) to setTargetAtTime: ${JSON.stringify(e)}, ${JSON.stringify(t)}`),this._events.add({constant:n,time:r,type:"setTargetAtTime",value:s}),this.log(this.units,"setTargetAtTime",e,r,n),this._param.setTargetAtTime(s,r,n),this}setValueCurveAtTime(e,t,n,s=1){n=this.toSeconds(n),t=this.toSeconds(t);const r=this._fromType(e[0])*s;this.setValueAtTime(this._toType(r),t);const a=n/(e.length-1);for(let n=1;n{"cancelScheduledValues"===t.type?e.cancelScheduledValues(t.time):"setTargetAtTime"===t.type?e.setTargetAtTime(t.value,t.time,t.constant):e[t.type](t.value,t.time)})),this}setParam(e){rr(this._swappable,"The Param must be assigned as 'swappable' in the constructor");const t=this.input;return t.disconnect(this._param),this.apply(e),this._param=e,t.connect(this._param),this}dispose(){return super.dispose(),this._events.dispose(),this}get defaultValue(){return this._toType(this._param.defaultValue)}_exponentialApproach(e,t,n,s,r){return n+(t-n)*Math.exp(-(r-e)/s)}_linearInterpolate(e,t,n,s,r){return t+(r-e)/(n-e)*(s-t)}_exponentialInterpolate(e,t,n,s,r){return t*Math.pow(s/t,(r-e)/(n-e))}}class Sa extends Aa{constructor(){super(...arguments),this.name="ToneAudioNode",this._internalChannels=[]}get numberOfInputs(){return dr(this.input)?Sr(this.input)||this.input instanceof Ca?1:this.input.numberOfInputs:0}get numberOfOutputs(){return dr(this.output)?this.output.numberOfOutputs:0}_isAudioNode(e){return dr(e)&&(e instanceof Sa||Er(e))}_getInternalNodes(){const e=this._internalChannels.slice(0);return this._isAudioNode(this.input)&&e.push(this.input),this._isAudioNode(this.output)&&this.input!==this.output&&e.push(this.output),e}_setChannelProperties(e){this._getInternalNodes().forEach((t=>{t.channelCount=e.channelCount,t.channelCountMode=e.channelCountMode,t.channelInterpretation=e.channelInterpretation}))}_getChannelProperties(){const e=this._getInternalNodes();rr(e.length>0,"ToneAudioNode does not have any internal nodes");const t=e[0];return{channelCount:t.channelCount,channelCountMode:t.channelCountMode,channelInterpretation:t.channelInterpretation}}get channelCount(){return this._getChannelProperties().channelCount}set channelCount(e){const t=this._getChannelProperties();this._setChannelProperties(Object.assign(t,{channelCount:e}))}get channelCountMode(){return this._getChannelProperties().channelCountMode}set channelCountMode(e){const t=this._getChannelProperties();this._setChannelProperties(Object.assign(t,{channelCountMode:e}))}get channelInterpretation(){return this._getChannelProperties().channelInterpretation}set channelInterpretation(e){const t=this._getChannelProperties();this._setChannelProperties(Object.assign(t,{channelInterpretation:e}))}connect(e,t=0,n=0){return _a(this,e,t,n),this}toDestination(){return this.connect(this.context.destination),this}toMaster(){return cr("toMaster() has been renamed toDestination()"),this.toDestination()}disconnect(e,t=0,n=0){return Ia(this,e,t,n),this}chain(...e){return Ea(this,...e),this}fan(...e){return e.forEach((e=>this.connect(e))),this}dispose(){return super.dispose(),dr(this.input)&&(this.input instanceof Sa?this.input.dispose():Er(this.input)&&this.input.disconnect()),dr(this.output)&&(this.output instanceof Sa?this.output.dispose():Er(this.output)&&this.output.disconnect()),this._internalChannels=[],this}}function Ea(...e){const t=e.shift();e.reduce(((e,t)=>(e instanceof Sa?e.connect(t):Er(e)&&_a(e,t),t)),t)}function _a(e,t,n=0,s=0){for(rr(dr(e),"Cannot connect from undefined node"),rr(dr(t),"Cannot connect to undefined node"),(t instanceof Sa||Er(t))&&rr(t.numberOfInputs>0,"Cannot connect to node with no inputs"),rr(e.numberOfOutputs>0,"Cannot connect from node with no outputs");t instanceof Sa||t instanceof Ca;)dr(t.input)&&(t=t.input);for(;e instanceof Sa;)dr(e.output)&&(e=e.output);Sr(t)?e.connect(t,n):e.connect(t,n,s)}function Ia(e,t,n=0,s=0){if(dr(t))for(;t instanceof Sa;)t=t.input;for(;!Er(e);)dr(e.output)&&(e=e.output);Sr(t)?e.disconnect(t,n):Er(t)?e.disconnect(t,n,s):e.disconnect()}class Ta extends Sa{constructor(){super(Rr(Ta.getDefaults(),arguments,["gain","units"])),this.name="Gain",this._gainNode=this.context.createGain(),this.input=this._gainNode,this.output=this._gainNode;const e=Rr(Ta.getDefaults(),arguments,["gain","units"]);this.gain=new Ca({context:this.context,convert:e.convert,param:this._gainNode.gain,units:e.units,value:e.gain,minValue:e.minValue,maxValue:e.maxValue}),Zr(this,"gain")}static getDefaults(){return Object.assign(Sa.getDefaults(),{convert:!0,gain:1,units:"gain"})}dispose(){return super.dispose(),this._gainNode.disconnect(),this.gain.dispose(),this}}class Na extends Sa{constructor(e){super(e),this.onended=Qr,this._startTime=-1,this._stopTime=-1,this._timeout=-1,this.output=new Ta({context:this.context,gain:0}),this._gainNode=this.output,this.getStateAtTime=function(e){const t=this.toSeconds(e);return-1!==this._startTime&&t>=this._startTime&&(-1===this._stopTime||t<=this._stopTime)?"started":"stopped"},this._fadeIn=e.fadeIn,this._fadeOut=e.fadeOut,this._curve=e.curve,this.onended=e.onended}static getDefaults(){return Object.assign(Sa.getDefaults(),{curve:"linear",fadeIn:0,fadeOut:0,onended:Qr})}_startGain(e,t=1){rr(-1===this._startTime,"Source cannot be started more than once");const n=this.toSeconds(this._fadeIn);return this._startTime=e+n,this._startTime=Math.max(this._startTime,this.context.currentTime),n>0?(this._gainNode.gain.setValueAtTime(0,e),"linear"===this._curve?this._gainNode.gain.linearRampToValueAtTime(t,e+n):this._gainNode.gain.exponentialApproachValueAtTime(t,e,n)):this._gainNode.gain.setValueAtTime(t,e),this}stop(e){return this.log("stop",e),this._stopGain(this.toSeconds(e)),this}_stopGain(e){rr(-1!==this._startTime,"'start' must be called before 'stop'"),this.cancelStop();const t=this.toSeconds(this._fadeOut);return this._stopTime=this.toSeconds(e)+t,this._stopTime=Math.max(this._stopTime,this.context.currentTime),t>0?"linear"===this._curve?this._gainNode.gain.linearRampTo(0,t,e):this._gainNode.gain.targetRampTo(0,t,e):(this._gainNode.gain.cancelAndHoldAtTime(e),this._gainNode.gain.setValueAtTime(0,e)),this.context.clearTimeout(this._timeout),this._timeout=this.context.setTimeout((()=>{const e="exponential"===this._curve?2*t:0;this._stopSource(this.now()+e),this._onended()}),this._stopTime-this.context.currentTime),this}_onended(){if(this.onended!==Qr&&(this.onended(this),this.onended=Qr,!this.context.isOffline)){const e=()=>this.dispose();void 0!==window.requestIdleCallback?window.requestIdleCallback(e):setTimeout(e,1e3)}}get state(){return this.getStateAtTime(this.now())}cancelStop(){return this.log("cancelStop"),rr(-1!==this._startTime,"Source is not started"),this._gainNode.gain.cancelScheduledValues(this._startTime+this.sampleTime),this.context.clearTimeout(this._timeout),this._stopTime=-1,this}dispose(){return super.dispose(),this._gainNode.disconnect(),this}}class Oa extends Na{constructor(){super(Rr(Oa.getDefaults(),arguments,["offset"])),this.name="ToneConstantSource",this._source=this.context.createConstantSource();const e=Rr(Oa.getDefaults(),arguments,["offset"]);_a(this._source,this._gainNode),this.offset=new Ca({context:this.context,convert:e.convert,param:this._source.offset,units:e.units,value:e.offset,minValue:e.minValue,maxValue:e.maxValue})}static getDefaults(){return Object.assign(Na.getDefaults(),{convert:!0,offset:1,units:"number"})}start(e){const t=this.toSeconds(e);return this.log("start",t),this._startGain(t),this._source.start(t),this}_stopSource(e){this._source.stop(e)}dispose(){return super.dispose(),"started"===this.state&&this.stop(),this._source.disconnect(),this.offset.dispose(),this}}class Ra extends Sa{constructor(){super(Rr(Ra.getDefaults(),arguments,["value","units"])),this.name="Signal",this.override=!0;const e=Rr(Ra.getDefaults(),arguments,["value","units"]);this.output=this._constantSource=new Oa({context:this.context,convert:e.convert,offset:e.value,units:e.units,minValue:e.minValue,maxValue:e.maxValue}),this._constantSource.start(0),this.input=this._param=this._constantSource.offset}static getDefaults(){return Object.assign(Sa.getDefaults(),{convert:!0,units:"number",value:0})}connect(e,t=0,n=0){return Da(this,e,t,n),this}dispose(){return super.dispose(),this._param.dispose(),this._constantSource.dispose(),this}setValueAtTime(e,t){return this._param.setValueAtTime(e,t),this}getValueAtTime(e){return this._param.getValueAtTime(e)}setRampPoint(e){return this._param.setRampPoint(e),this}linearRampToValueAtTime(e,t){return this._param.linearRampToValueAtTime(e,t),this}exponentialRampToValueAtTime(e,t){return this._param.exponentialRampToValueAtTime(e,t),this}exponentialRampTo(e,t,n){return this._param.exponentialRampTo(e,t,n),this}linearRampTo(e,t,n){return this._param.linearRampTo(e,t,n),this}targetRampTo(e,t,n){return this._param.targetRampTo(e,t,n),this}exponentialApproachValueAtTime(e,t,n){return this._param.exponentialApproachValueAtTime(e,t,n),this}setTargetAtTime(e,t,n){return this._param.setTargetAtTime(e,t,n),this}setValueCurveAtTime(e,t,n,s){return this._param.setValueCurveAtTime(e,t,n,s),this}cancelScheduledValues(e){return this._param.cancelScheduledValues(e),this}cancelAndHoldAtTime(e){return this._param.cancelAndHoldAtTime(e),this}rampTo(e,t,n){return this._param.rampTo(e,t,n),this}get value(){return this._param.value}set value(e){this._param.value=e}get convert(){return this._param.convert}set convert(e){this._param.convert=e}get units(){return this._param.units}get overridden(){return this._param.overridden}set overridden(e){this._param.overridden=e}get maxValue(){return this._param.maxValue}get minValue(){return this._param.minValue}apply(e){return this._param.apply(e),this}}function Da(e,t,n,s){(t instanceof Ca||Sr(t)||t instanceof Ra&&t.override)&&(t.cancelScheduledValues(0),t.setValueAtTime(0,0),t instanceof Ra&&(t.overridden=!0)),_a(e,t,n,s)}class Ma extends Ca{constructor(){super(Rr(Ma.getDefaults(),arguments,["value"])),this.name="TickParam",this._events=new Ur(1/0),this._multiplier=1;const e=Rr(Ma.getDefaults(),arguments,["value"]);this._multiplier=e.multiplier,this._events.cancel(0),this._events.add({ticks:0,time:0,type:"setValueAtTime",value:this._fromType(e.value)}),this.setValueAtTime(e.value,0)}static getDefaults(){return Object.assign(Ca.getDefaults(),{multiplier:1,units:"hertz",value:1})}setTargetAtTime(e,t,n){t=this.toSeconds(t),this.setRampPoint(t);const s=this._fromType(e),r=this._events.get(t),a=Math.round(Math.max(1/n,1));for(let e=0;e<=a;e++){const a=n*e+t,i=this._exponentialApproach(r.time,r.value,s,n,a);this.linearRampToValueAtTime(this._toType(i),a)}return this}setValueAtTime(e,t){const n=this.toSeconds(t);super.setValueAtTime(e,t);const s=this._events.get(n),r=this._events.previousEvent(s),a=this._getTicksUntilEvent(r,n);return s.ticks=Math.max(a,0),this}linearRampToValueAtTime(e,t){const n=this.toSeconds(t);super.linearRampToValueAtTime(e,t);const s=this._events.get(n),r=this._events.previousEvent(s),a=this._getTicksUntilEvent(r,n);return s.ticks=Math.max(a,0),this}exponentialRampToValueAtTime(e,t){t=this.toSeconds(t);const n=this._fromType(e),s=this._events.get(t),r=Math.round(Math.max(10*(t-s.time),1)),a=(t-s.time)/r;for(let e=0;e<=r;e++){const r=a*e+s.time,i=this._exponentialInterpolate(s.time,s.value,t,n,r);this.linearRampToValueAtTime(this._toType(i),r)}return this}_getTicksUntilEvent(e,t){if(null===e)e={ticks:0,time:0,type:"setValueAtTime",value:0};else if(hr(e.ticks)){const t=this._events.previousEvent(e);e.ticks=this._getTicksUntilEvent(t,e.time)}const n=this._fromType(this.getValueAtTime(e.time));let s=this._fromType(this.getValueAtTime(t));const r=this._events.get(t);return r&&r.time===t&&"setValueAtTime"===r.type&&(s=this._fromType(this.getValueAtTime(t-this.sampleTime))),.5*(t-e.time)*(n+s)+e.ticks}getTicksAtTime(e){const t=this.toSeconds(e),n=this._events.get(t);return Math.max(this._getTicksUntilEvent(n,t),0)}getDurationOfTicks(e,t){const n=this.toSeconds(t),s=this.getTicksAtTime(t);return this.getTimeOfTick(s+e)-n}getTimeOfTick(e){const t=this._events.get(e,"ticks"),n=this._events.getAfter(e,"ticks");if(t&&t.ticks===e)return t.time;if(t&&n&&"linearRampToValueAtTime"===n.type&&t.value!==n.value){const s=this._fromType(this.getValueAtTime(t.time)),r=(this._fromType(this.getValueAtTime(n.time))-s)/(n.time-t.time),a=Math.sqrt(Math.pow(s,2)-2*r*(t.ticks-e)),i=(-s+a)/r;return(i>0?i:(-s-a)/r)+t.time}return t?0===t.value?1/0:t.time+(e-t.ticks)/t.value:e/this._initialValue}ticksToTime(e,t){return this.getDurationOfTicks(e,t)}timeToTicks(e,t){const n=this.toSeconds(t),s=this.toSeconds(e),r=this.getTicksAtTime(n);return this.getTicksAtTime(n+s)-r}_fromType(e){return"bpm"===this.units&&this.multiplier?1/(60/e/this.multiplier):super._fromType(e)}_toType(e){return"bpm"===this.units&&this.multiplier?e/this.multiplier*60:super._toType(e)}get multiplier(){return this._multiplier}set multiplier(e){const t=this.value;this._multiplier=e,this.cancelScheduledValues(0),this.setValueAtTime(t,0)}}class Fa extends Ra{constructor(){super(Rr(Fa.getDefaults(),arguments,["value"])),this.name="TickSignal";const e=Rr(Fa.getDefaults(),arguments,["value"]);this.input=this._param=new Ma({context:this.context,convert:e.convert,multiplier:e.multiplier,param:this._constantSource.offset,units:e.units,value:e.value})}static getDefaults(){return Object.assign(Ra.getDefaults(),{multiplier:1,units:"hertz",value:1})}ticksToTime(e,t){return this._param.ticksToTime(e,t)}timeToTicks(e,t){return this._param.timeToTicks(e,t)}getTimeOfTick(e){return this._param.getTimeOfTick(e)}getDurationOfTicks(e,t){return this._param.getDurationOfTicks(e,t)}getTicksAtTime(e){return this._param.getTicksAtTime(e)}get multiplier(){return this._param.multiplier}set multiplier(e){this._param.multiplier=e}dispose(){return super.dispose(),this._param.dispose(),this}}class Ba extends Aa{constructor(){super(Rr(Ba.getDefaults(),arguments,["frequency"])),this.name="TickSource",this._state=new ka,this._tickOffset=new Ur;const e=Rr(Ba.getDefaults(),arguments,["frequency"]);this.frequency=new Fa({context:this.context,units:e.units,value:e.frequency}),Zr(this,"frequency"),this._state.setStateAtTime("stopped",0),this.setTicksAtTime(0,0)}static getDefaults(){return Object.assign({frequency:1,units:"hertz"},Aa.getDefaults())}get state(){return this.getStateAtTime(this.now())}start(e,t){const n=this.toSeconds(e);return"started"!==this._state.getValueAtTime(n)&&(this._state.setStateAtTime("started",n),dr(t)&&this.setTicksAtTime(t,n)),this}stop(e){const t=this.toSeconds(e);if("stopped"===this._state.getValueAtTime(t)){const e=this._state.get(t);e&&e.time>0&&(this._tickOffset.cancel(e.time),this._state.cancel(e.time))}return this._state.cancel(t),this._state.setStateAtTime("stopped",t),this.setTicksAtTime(0,t),this}pause(e){const t=this.toSeconds(e);return"started"===this._state.getValueAtTime(t)&&this._state.setStateAtTime("paused",t),this}cancel(e){return e=this.toSeconds(e),this._state.cancel(e),this._tickOffset.cancel(e),this}getTicksAtTime(e){const t=this.toSeconds(e),n=this._state.getLastState("stopped",t),s={state:"paused",time:t};this._state.add(s);let r=n,a=0;return this._state.forEachBetween(n.time,t+this.sampleTime,(e=>{let t=r.time;const n=this._tickOffset.get(e.time);n&&n.time>=r.time&&(a=n.ticks,t=n.time),"started"===r.state&&"started"!==e.state&&(a+=this.frequency.getTicksAtTime(e.time)-this.frequency.getTicksAtTime(t)),r=e})),this._state.remove(s),a}get ticks(){return this.getTicksAtTime(this.now())}set ticks(e){this.setTicksAtTime(e,this.now())}get seconds(){return this.getSecondsAtTime(this.now())}set seconds(e){const t=this.now(),n=this.frequency.timeToTicks(e,t);this.setTicksAtTime(n,t)}getSecondsAtTime(e){e=this.toSeconds(e);const t=this._state.getLastState("stopped",e),n={state:"paused",time:e};this._state.add(n);let s=t,r=0;return this._state.forEachBetween(t.time,e+this.sampleTime,(e=>{let t=s.time;const n=this._tickOffset.get(e.time);n&&n.time>=s.time&&(r=n.seconds,t=n.time),"started"===s.state&&"started"!==e.state&&(r+=e.time-t),s=e})),this._state.remove(n),r}setTicksAtTime(e,t){return t=this.toSeconds(t),this._tickOffset.cancel(t),this._tickOffset.add({seconds:this.frequency.getDurationOfTicks(e,t),ticks:e,time:t}),this}getStateAtTime(e){return e=this.toSeconds(e),this._state.getValueAtTime(e)}getTimeOfTick(e,t=this.now()){const n=this._tickOffset.get(t),s=this._state.get(t),r=Math.max(n.time,s.time),a=this.frequency.getTicksAtTime(r)+e-n.ticks;return this.frequency.getTimeOfTick(a)}forEachTickBetween(e,t,n){let s=this._state.get(e);this._state.forEachBetween(e,t,(t=>{s&&"started"===s.state&&"started"!==t.state&&this.forEachTickBetween(Math.max(s.time,e),t.time-this.sampleTime,n),s=t}));let r=null;if(s&&"started"===s.state){const a=Math.max(s.time,e),i=this.frequency.getTicksAtTime(a),o=i-this.frequency.getTicksAtTime(s.time);let l=Math.ceil(o)-o;l=Vr(l,1)?0:l;let u=this.frequency.getTimeOfTick(i+l);for(;u{switch(e.state){case"started":const t=this._tickSource.getTicksAtTime(e.time);this.emit("start",e.time,t);break;case"stopped":0!==e.time&&this.emit("stop",e.time);break;case"paused":this.emit("pause",e.time)}})),this._tickSource.forEachTickBetween(e,t,((e,t)=>{this.callback(e,t)})))}getStateAtTime(e){const t=this.toSeconds(e);return this._state.getValueAtTime(t)}dispose(){return super.dispose(),this.context.off("tick",this._boundLoop),this._tickSource.dispose(),this._state.dispose(),this}}$r.mixin(za);class La extends Sa{constructor(){super(Rr(La.getDefaults(),arguments,["delayTime","maxDelay"])),this.name="Delay";const e=Rr(La.getDefaults(),arguments,["delayTime","maxDelay"]),t=this.toSeconds(e.maxDelay);this._maxDelay=Math.max(t,this.toSeconds(e.delayTime)),this._delayNode=this.input=this.output=this.context.createDelay(t),this.delayTime=new Ca({context:this.context,param:this._delayNode.delayTime,units:"time",value:e.delayTime,minValue:0,maxValue:this.maxDelay}),Zr(this,"delayTime")}static getDefaults(){return Object.assign(Sa.getDefaults(),{delayTime:0,maxDelay:1})}get maxDelay(){return this._maxDelay}dispose(){return super.dispose(),this._delayNode.disconnect(),this.delayTime.dispose(),this}}function Pa(e,t,n=2,s=sa().sampleRate){return kr(this,void 0,void 0,(function*(){const r=sa(),a=new ea(n,t,s);ra(a),yield e(a);const i=a.render();ra(r);const o=yield i;return new Jr(o)}))}class Va extends Fr{constructor(){super(),this.name="ToneAudioBuffers",this._buffers=new Map,this._loadingCount=0;const e=Rr(Va.getDefaults(),arguments,["urls","onload","baseUrl"],"urls");this.baseUrl=e.baseUrl,Object.keys(e.urls).forEach((t=>{this._loadingCount++;const n=e.urls[t];this.add(t,n,this._bufferLoaded.bind(this,e.onload),e.onerror)}))}static getDefaults(){return{baseUrl:"",onerror:Qr,onload:Qr,urls:{}}}has(e){return this._buffers.has(e.toString())}get(e){return rr(this.has(e),`ToneAudioBuffers has no buffer named: ${e}`),this._buffers.get(e.toString())}_bufferLoaded(e){this._loadingCount--,0===this._loadingCount&&e&&e()}get loaded(){return Array.from(this._buffers).every((([e,t])=>t.loaded))}add(e,t,n=Qr,s=Qr){return br(t)?this._buffers.set(e.toString(),new Jr(this.baseUrl+t,n,s)):this._buffers.set(e.toString(),new Jr(t,n,s)),this}dispose(){return super.dispose(),this._buffers.forEach((e=>e.dispose())),this._buffers.clear(),this}}class Wa extends ga{constructor(){super(...arguments),this.name="MidiClass",this.defaultUnits="midi"}_frequencyToUnits(e){return ca(super._frequencyToUnits(e))}_ticksToUnits(e){return ca(super._ticksToUnits(e))}_beatsToUnits(e){return ca(super._beatsToUnits(e))}_secondsToUnits(e){return ca(super._secondsToUnits(e))}toMidi(){return this.valueOf()}toFrequency(){return da(this.toMidi())}transpose(e){return new Wa(this.context,this.toMidi()+e)}}function Ua(e,t){return new Wa(sa(),e,t)}class Ga extends va{constructor(){super(...arguments),this.name="Ticks",this.defaultUnits="i"}_now(){return this.context.transport.ticks}_beatsToUnits(e){return this._getPPQ()*e}_secondsToUnits(e){return Math.floor(e/(60/this._getBpm())*this._getPPQ())}_ticksToUnits(e){return e}toTicks(){return this.valueOf()}toSeconds(){return this.valueOf()/this._getPPQ()*(60/this._getBpm())}}function qa(e,t){return new Ga(sa(),e,t)}class ja extends Aa{constructor(){super(...arguments),this.name="Draw",this.expiration=.25,this.anticipation=.008,this._events=new Ur,this._boundDrawLoop=this._drawLoop.bind(this),this._animationFrame=-1}schedule(e,t){return this._events.add({callback:e,time:this.toSeconds(t)}),1===this._events.length&&(this._animationFrame=requestAnimationFrame(this._boundDrawLoop)),this}cancel(e){return this._events.cancel(this.toSeconds(e)),this}_drawLoop(){const e=this.context.currentTime;for(;this._events.length&&this._events.peek().time-this.anticipation<=e;){const t=this._events.shift();t&&e-t.time<=this.expiration&&t.callback()}this._events.length>0&&(this._animationFrame=requestAnimationFrame(this._boundDrawLoop))}dispose(){return super.dispose(),this._events.dispose(),cancelAnimationFrame(this._animationFrame),this}}qr((e=>{e.draw=new ja({context:e})})),Hr((e=>{e.draw.dispose()}));class Ha extends Fr{constructor(){super(...arguments),this.name="IntervalTimeline",this._root=null,this._length=0}add(e){rr(dr(e.time),"Events must have a time property"),rr(dr(e.duration),"Events must have a duration parameter"),e.time=e.time.valueOf();let t=new $a(e.time,e.time+e.duration,e);for(null===this._root?this._root=t:this._root.insert(t),this._length++;null!==t;)t.updateHeight(),t.updateMax(),this._rebalance(t),t=t.parent;return this}remove(e){if(null!==this._root){const t=[];this._root.search(e.time,t);for(const n of t)if(n.event===e){this._removeNode(n),this._length--;break}}return this}get length(){return this._length}cancel(e){return this.forEachFrom(e,(e=>this.remove(e))),this}_setRoot(e){this._root=e,null!==this._root&&(this._root.parent=null)}_replaceNodeInParent(e,t){null!==e.parent?(e.isLeftChild()?e.parent.left=t:e.parent.right=t,this._rebalance(e.parent)):this._setRoot(t)}_removeNode(e){if(null===e.left&&null===e.right)this._replaceNodeInParent(e,null);else if(null===e.right)this._replaceNodeInParent(e,e.left);else if(null===e.left)this._replaceNodeInParent(e,e.right);else{let t,n=null;if(e.getBalance()>0)if(null===e.left.right)t=e.left,t.right=e.right,n=t;else{for(t=e.left.right;null!==t.right;)t=t.right;t.parent&&(t.parent.right=t.left,n=t.parent,t.left=e.left,t.right=e.right)}else if(null===e.right.left)t=e.right,t.left=e.left,n=t;else{for(t=e.right.left;null!==t.left;)t=t.left;t.parent&&(t.parent.left=t.right,n=t.parent,t.left=e.left,t.right=e.right)}null!==e.parent?e.isLeftChild()?e.parent.left=t:e.parent.right=t:this._setRoot(t),n&&this._rebalance(n)}e.dispose()}_rotateLeft(e){const t=e.parent,n=e.isLeftChild(),s=e.right;s&&(e.right=s.left,s.left=e),null!==t?n?t.left=s:t.right=s:this._setRoot(s)}_rotateRight(e){const t=e.parent,n=e.isLeftChild(),s=e.left;s&&(e.left=s.right,s.right=e),null!==t?n?t.left=s:t.right=s:this._setRoot(s)}_rebalance(e){const t=e.getBalance();t>1&&e.left?e.left.getBalance()<0?this._rotateLeft(e.left):this._rotateRight(e):t<-1&&e.right&&(e.right.getBalance()>0?this._rotateRight(e.right):this._rotateLeft(e))}get(e){if(null!==this._root){const t=[];if(this._root.search(e,t),t.length>0){let e=t[0];for(let n=1;ne.low&&(e=t[n]);return e.event}}return null}forEach(e){if(null!==this._root){const t=[];this._root.traverse((e=>t.push(e))),t.forEach((t=>{t.event&&e(t.event)}))}return this}forEachAtTime(e,t){if(null!==this._root){const n=[];this._root.search(e,n),n.forEach((e=>{e.event&&t(e.event)}))}return this}forEachFrom(e,t){if(null!==this._root){const n=[];this._root.searchAfter(e,n),n.forEach((e=>{e.event&&t(e.event)}))}return this}dispose(){return super.dispose(),null!==this._root&&this._root.traverse((e=>e.dispose())),this._root=null,this}}class $a{constructor(e,t,n){this._left=null,this._right=null,this.parent=null,this.height=0,this.event=n,this.low=e,this.high=t,this.max=this.high}insert(e){e.low<=this.low?null===this.left?this.left=e:this.left.insert(e):null===this.right?this.right=e:this.right.insert(e)}search(e,t){e>this.max||(null!==this.left&&this.left.search(e,t),this.low<=e&&this.high>e&&t.push(this),this.low>e||null!==this.right&&this.right.search(e,t))}searchAfter(e,t){this.low>=e&&(t.push(this),null!==this.left&&this.left.searchAfter(e,t)),null!==this.right&&this.right.searchAfter(e,t)}traverse(e){e(this),null!==this.left&&this.left.traverse(e),null!==this.right&&this.right.traverse(e)}updateHeight(){null!==this.left&&null!==this.right?this.height=Math.max(this.left.height,this.right.height)+1:null!==this.right?this.height=this.right.height+1:null!==this.left?this.height=this.left.height+1:this.height=0}updateMax(){this.max=this.high,null!==this.left&&(this.max=Math.max(this.max,this.left.max)),null!==this.right&&(this.max=Math.max(this.max,this.right.max))}getBalance(){let e=0;return null!==this.left&&null!==this.right?e=this.left.height-this.right.height:null!==this.left?e=this.left.height+1:null!==this.right&&(e=-(this.right.height+1)),e}isLeftChild(){return null!==this.parent&&this.parent.left===this}get left(){return this._left}set left(e){this._left=e,null!==e&&(e.parent=this),this.updateHeight(),this.updateMax()}get right(){return this._right}set right(e){this._right=e,null!==e&&(e.parent=this),this.updateHeight(),this.updateMax()}dispose(){this.parent=null,this._left=null,this._right=null,this.event=null}}class Ka extends Sa{constructor(){super(Rr(Ka.getDefaults(),arguments,["volume"])),this.name="Volume";const e=Rr(Ka.getDefaults(),arguments,["volume"]);this.input=this.output=new Ta({context:this.context,gain:e.volume,units:"decibels"}),this.volume=this.output.gain,Zr(this,"volume"),this._unmutedVolume=e.volume,this.mute=e.mute}static getDefaults(){return Object.assign(Sa.getDefaults(),{mute:!1,volume:0})}get mute(){return this.volume.value===-1/0}set mute(e){!this.mute&&e?(this._unmutedVolume=this.volume.value,this.volume.value=-1/0):this.mute&&!e&&(this.volume.value=this._unmutedVolume)}dispose(){return super.dispose(),this.input.dispose(),this.volume.dispose(),this}}class Xa extends Sa{constructor(){super(Rr(Xa.getDefaults(),arguments)),this.name="Destination",this.input=new Ka({context:this.context}),this.output=new Ta({context:this.context}),this.volume=this.input.volume;const e=Rr(Xa.getDefaults(),arguments);Ea(this.input,this.output,this.context.rawContext.destination),this.mute=e.mute,this._internalChannels=[this.input,this.context.rawContext.destination,this.output]}static getDefaults(){return Object.assign(Sa.getDefaults(),{mute:!1,volume:0})}get mute(){return this.input.mute}set mute(e){this.input.mute=e}chain(...e){return this.input.disconnect(),e.unshift(this.input),e.push(this.output),Ea(...e),this}get maxChannelCount(){return this.context.rawContext.destination.maxChannelCount}dispose(){return super.dispose(),this.volume.dispose(),this}}qr((e=>{e.destination=new Xa({context:e})})),Hr((e=>{e.destination.dispose()}));class Za extends Fr{constructor(e){super(),this.name="TimelineValue",this._timeline=new Ur({memory:10}),this._initialValue=e}set(e,t){return this._timeline.add({value:e,time:t}),this}get(e){const t=this._timeline.get(e);return t?t.value:this._initialValue}}class Ya{constructor(e,t){this.id=Ya._eventId++;const n=Object.assign(Ya.getDefaults(),t);this.transport=e,this.callback=n.callback,this._once=n.once,this.time=n.time}static getDefaults(){return{callback:Qr,once:!1,time:0}}invoke(e){this.callback&&(this.callback(e),this._once&&this.transport.clear(this.id))}dispose(){return this.callback=void 0,this}}Ya._eventId=0;class Qa extends Ya{constructor(e,t){super(e,t),this._currentId=-1,this._nextId=-1,this._nextTick=this.time,this._boundRestart=this._restart.bind(this);const n=Object.assign(Qa.getDefaults(),t);this.duration=new Ga(e.context,n.duration).valueOf(),this._interval=new Ga(e.context,n.interval).valueOf(),this._nextTick=n.time,this.transport.on("start",this._boundRestart),this.transport.on("loopStart",this._boundRestart),this.context=this.transport.context,this._restart()}static getDefaults(){return Object.assign({},Ya.getDefaults(),{duration:1/0,interval:1,once:!1})}invoke(e){this._createEvents(e),super.invoke(e)}_createEvents(e){const t=this.transport.getTicksAtTime(e);t>=this.time&&t>=this._nextTick&&this._nextTick+this._intervalthis.time&&(this._nextTick=this.time+Math.ceil((t-this.time)/this._interval)*this._interval),this._currentId=this.transport.scheduleOnce(this.invoke.bind(this),new Ga(this.context,this._nextTick).toSeconds()),this._nextTick+=this._interval,this._nextId=this.transport.scheduleOnce(this.invoke.bind(this),new Ga(this.context,this._nextTick).toSeconds())}dispose(){return super.dispose(),this.transport.clear(this._currentId),this.transport.clear(this._nextId),this.transport.off("start",this._boundRestart),this.transport.off("loopStart",this._boundRestart),this}}class Ja extends Aa{constructor(){super(Rr(Ja.getDefaults(),arguments)),this.name="Transport",this._loop=new Za(!1),this._loopStart=0,this._loopEnd=0,this._scheduledEvents={},this._timeline=new Ur,this._repeatedEvents=new Ha,this._syncedSignals=[],this._swingAmount=0;const e=Rr(Ja.getDefaults(),arguments);this._ppq=e.ppq,this._clock=new za({callback:this._processTick.bind(this),context:this.context,frequency:0,units:"bpm"}),this._bindClockEvents(),this.bpm=this._clock.frequency,this._clock.frequency.multiplier=e.ppq,this.bpm.setValueAtTime(e.bpm,0),Zr(this,"bpm"),this._timeSignature=e.timeSignature,this._swingTicks=e.ppq/2}static getDefaults(){return Object.assign(Aa.getDefaults(),{bpm:120,loopEnd:"4m",loopStart:0,ppq:192,swing:0,swingSubdivision:"8n",timeSignature:4})}_processTick(e,t){if(this._loop.get(e)&&t>=this._loopEnd&&(this.emit("loopEnd",e),this._clock.setTicksAtTime(this._loopStart,e),t=this._loopStart,this.emit("loopStart",e,this._clock.getSecondsAtTime(e)),this.emit("loop",e)),this._swingAmount>0&&t%this._ppq!=0&&t%(2*this._swingTicks)!=0){const n=t%(2*this._swingTicks)/(2*this._swingTicks),s=Math.sin(n*Math.PI)*this._swingAmount;e+=new Ga(this.context,2*this._swingTicks/3).toSeconds()*s}this._timeline.forEachAtTime(t,(t=>t.invoke(e)))}schedule(e,t){const n=new Ya(this,{callback:e,time:new va(this.context,t).toTicks()});return this._addEvent(n,this._timeline)}scheduleRepeat(e,t,n,s=1/0){const r=new Qa(this,{callback:e,duration:new fa(this.context,s).toTicks(),interval:new fa(this.context,t).toTicks(),time:new va(this.context,n).toTicks()});return this._addEvent(r,this._repeatedEvents)}scheduleOnce(e,t){const n=new Ya(this,{callback:e,once:!0,time:new va(this.context,t).toTicks()});return this._addEvent(n,this._timeline)}clear(e){if(this._scheduledEvents.hasOwnProperty(e)){const t=this._scheduledEvents[e.toString()];t.timeline.remove(t.event),t.event.dispose(),delete this._scheduledEvents[e.toString()]}return this}_addEvent(e,t){return this._scheduledEvents[e.id.toString()]={event:e,timeline:t},t.add(e),e.id}cancel(e=0){const t=this.toTicks(e);return this._timeline.forEachFrom(t,(e=>this.clear(e.id))),this._repeatedEvents.forEachFrom(t,(e=>this.clear(e.id))),this}_bindClockEvents(){this._clock.on("start",((e,t)=>{t=new Ga(this.context,t).toSeconds(),this.emit("start",e,t)})),this._clock.on("stop",(e=>{this.emit("stop",e)})),this._clock.on("pause",(e=>{this.emit("pause",e)}))}get state(){return this._clock.getStateAtTime(this.now())}start(e,t){let n;return dr(t)&&(n=this.toTicks(t)),this._clock.start(e,n),this}stop(e){return this._clock.stop(e),this}pause(e){return this._clock.pause(e),this}toggle(e){return e=this.toSeconds(e),"started"!==this._clock.getStateAtTime(e)?this.start(e):this.stop(e),this}get timeSignature(){return this._timeSignature}set timeSignature(e){yr(e)&&(e=e[0]/e[1]*4),this._timeSignature=e}get loopStart(){return new fa(this.context,this._loopStart,"i").toSeconds()}set loopStart(e){this._loopStart=this.toTicks(e)}get loopEnd(){return new fa(this.context,this._loopEnd,"i").toSeconds()}set loopEnd(e){this._loopEnd=this.toTicks(e)}get loop(){return this._loop.get(this.now())}set loop(e){this._loop.set(e,this.now())}setLoopPoints(e,t){return this.loopStart=e,this.loopEnd=t,this}get swing(){return this._swingAmount}set swing(e){this._swingAmount=e}get swingSubdivision(){return new Ga(this.context,this._swingTicks).toNotation()}set swingSubdivision(e){this._swingTicks=this.toTicks(e)}get position(){const e=this.now(),t=this._clock.getTicksAtTime(e);return new Ga(this.context,t).toBarsBeatsSixteenths()}set position(e){const t=this.toTicks(e);this.ticks=t}get seconds(){return this._clock.seconds}set seconds(e){const t=this.now(),n=this._clock.frequency.timeToTicks(e,t);this.ticks=n}get progress(){if(this.loop){const e=this.now();return(this._clock.getTicksAtTime(e)-this._loopStart)/(this._loopEnd-this._loopStart)}return 0}get ticks(){return this._clock.ticks}set ticks(e){if(this._clock.ticks!==e){const t=this.now();if("started"===this.state){const n=this._clock.getTicksAtTime(t),s=t+this._clock.frequency.getDurationOfTicks(Math.ceil(n)-n,t);this.emit("stop",s),this._clock.setTicksAtTime(e,s),this.emit("start",s,this._clock.getSecondsAtTime(s))}else this._clock.setTicksAtTime(e,t)}}getTicksAtTime(e){return Math.round(this._clock.getTicksAtTime(e))}getSecondsAtTime(e){return this._clock.getSecondsAtTime(e)}get PPQ(){return this._clock.frequency.multiplier}set PPQ(e){this._clock.frequency.multiplier=e}nextSubdivision(e){if(e=this.toTicks(e),"started"!==this.state)return 0;{const t=this.now(),n=e-this.getTicksAtTime(t)%e;return this._clock.nextTickTime(n,t)}}syncSignal(e,t){if(!t){const n=this.now();if(0!==e.getValueAtTime(n)){const s=1/(60/this.bpm.getValueAtTime(n)/this.PPQ);t=e.getValueAtTime(n)/s}else t=0}const n=new Ta(t);return this.bpm.connect(n),n.connect(e._param),this._syncedSignals.push({initial:e.value,ratio:n,signal:e}),e.value=0,this}unsyncSignal(e){for(let t=this._syncedSignals.length-1;t>=0;t--){const n=this._syncedSignals[t];n.signal===e&&(n.ratio.dispose(),n.signal.value=n.initial,this._syncedSignals.splice(t,1))}return this}dispose(){return super.dispose(),this._clock.dispose(),Yr(this,"bpm"),this._timeline.dispose(),this._repeatedEvents.dispose(),this}}$r.mixin(Ja),qr((e=>{e.transport=new Ja({context:e})})),Hr((e=>{e.transport.dispose()}));class ei extends Sa{constructor(e){super(e),this.input=void 0,this._state=new ka("stopped"),this._synced=!1,this._scheduled=[],this._syncedStart=Qr,this._syncedStop=Qr,this._state.memory=100,this._state.increasing=!0,this._volume=this.output=new Ka({context:this.context,mute:e.mute,volume:e.volume}),this.volume=this._volume.volume,Zr(this,"volume"),this.onstop=e.onstop}static getDefaults(){return Object.assign(Sa.getDefaults(),{mute:!1,onstop:Qr,volume:0})}get state(){return this._synced?"started"===this.context.transport.state?this._state.getValueAtTime(this.context.transport.seconds):"stopped":this._state.getValueAtTime(this.now())}get mute(){return this._volume.mute}set mute(e){this._volume.mute=e}_clampToCurrentTime(e){return this._synced?e:Math.max(e,this.context.currentTime)}start(e,t,n){let s=hr(e)&&this._synced?this.context.transport.seconds:this.toSeconds(e);if(s=this._clampToCurrentTime(s),this._synced||"started"!==this._state.getValueAtTime(s))if(this.log("start",s),this._state.setStateAtTime("started",s),this._synced){const e=this._state.get(s);e&&(e.offset=this.toSeconds(Dr(t,0)),e.duration=n?this.toSeconds(n):void 0);const r=this.context.transport.schedule((e=>{this._start(e,t,n)}),s);this._scheduled.push(r),"started"===this.context.transport.state&&this.context.transport.getSecondsAtTime(this.immediate())>s&&this._syncedStart(this.now(),this.context.transport.seconds)}else ir(this.context),this._start(s,t,n);else rr(zr(s,this._state.get(s).time),"Start time must be strictly greater than previous start time"),this._state.cancel(s),this._state.setStateAtTime("started",s),this.log("restart",s),this.restart(s,t,n);return this}stop(e){let t=hr(e)&&this._synced?this.context.transport.seconds:this.toSeconds(e);if(t=this._clampToCurrentTime(t),"started"===this._state.getValueAtTime(t)||dr(this._state.getNextState("started",t))){if(this.log("stop",t),this._synced){const e=this.context.transport.schedule(this._stop.bind(this),t);this._scheduled.push(e)}else this._stop(t);this._state.cancel(t),this._state.setStateAtTime("stopped",t)}return this}restart(e,t,n){return e=this.toSeconds(e),"started"===this._state.getValueAtTime(e)&&(this._state.cancel(e),this._restart(e,t,n)),this}sync(){return this._synced||(this._synced=!0,this._syncedStart=(e,t)=>{if(t>0){const n=this._state.get(t);if(n&&"started"===n.state&&n.time!==t){const s=t-this.toSeconds(n.time);let r;n.duration&&(r=this.toSeconds(n.duration)-s),this._start(e,this.toSeconds(n.offset)+s,r)}}},this._syncedStop=e=>{const t=this.context.transport.getSecondsAtTime(Math.max(e-this.sampleTime,0));"started"===this._state.getValueAtTime(t)&&this._stop(e)},this.context.transport.on("start",this._syncedStart),this.context.transport.on("loopStart",this._syncedStart),this.context.transport.on("stop",this._syncedStop),this.context.transport.on("pause",this._syncedStop),this.context.transport.on("loopEnd",this._syncedStop)),this}unsync(){return this._synced&&(this.context.transport.off("stop",this._syncedStop),this.context.transport.off("pause",this._syncedStop),this.context.transport.off("loopEnd",this._syncedStop),this.context.transport.off("start",this._syncedStart),this.context.transport.off("loopStart",this._syncedStart)),this._synced=!1,this._scheduled.forEach((e=>this.context.transport.clear(e))),this._scheduled=[],this._state.cancel(0),this._stop(0),this}dispose(){return super.dispose(),this.onstop=Qr,this.unsync(),this._volume.dispose(),this._state.dispose(),this}}class ti extends Na{constructor(){super(Rr(ti.getDefaults(),arguments,["url","onload"])),this.name="ToneBufferSource",this._source=this.context.createBufferSource(),this._internalChannels=[this._source],this._sourceStarted=!1,this._sourceStopped=!1;const e=Rr(ti.getDefaults(),arguments,["url","onload"]);_a(this._source,this._gainNode),this._source.onended=()=>this._stopSource(),this.playbackRate=new Ca({context:this.context,param:this._source.playbackRate,units:"positive",value:e.playbackRate}),this.loop=e.loop,this.loopStart=e.loopStart,this.loopEnd=e.loopEnd,this._buffer=new Jr(e.url,e.onload,e.onerror),this._internalChannels.push(this._source)}static getDefaults(){return Object.assign(Na.getDefaults(),{url:new Jr,loop:!1,loopEnd:0,loopStart:0,onload:Qr,onerror:Qr,playbackRate:1})}get fadeIn(){return this._fadeIn}set fadeIn(e){this._fadeIn=e}get fadeOut(){return this._fadeOut}set fadeOut(e){this._fadeOut=e}get curve(){return this._curve}set curve(e){this._curve=e}start(e,t,n,s=1){rr(this.buffer.loaded,"buffer is either not set or not loaded");const r=this.toSeconds(e);this._startGain(r,s),t=this.loop?Dr(t,this.loopStart):Dr(t,0);let a=Math.max(this.toSeconds(t),0);if(this.loop){const e=this.toSeconds(this.loopEnd)||this.buffer.duration,t=this.toSeconds(this.loopStart),n=e-t;Lr(a,e)&&(a=(a-t)%n+t),Vr(a,this.buffer.duration)&&(a=0)}if(this._source.buffer=this.buffer.get(),this._source.loopEnd=this.toSeconds(this.loopEnd)||this.buffer.duration,Pr(a,this.buffer.duration)&&(this._sourceStarted=!0,this._source.start(r,a)),dr(n)){let e=this.toSeconds(n);e=Math.max(e,0),this.stop(r+e)}return this}_stopSource(e){!this._sourceStopped&&this._sourceStarted&&(this._sourceStopped=!0,this._source.stop(this.toSeconds(e)),this._onended())}get loopStart(){return this._source.loopStart}set loopStart(e){this._source.loopStart=this.toSeconds(e)}get loopEnd(){return this._source.loopEnd}set loopEnd(e){this._source.loopEnd=this.toSeconds(e)}get buffer(){return this._buffer}set buffer(e){this._buffer.set(e)}get loop(){return this._source.loop}set loop(e){this._source.loop=e,this._sourceStarted&&this.cancelStop()}dispose(){return super.dispose(),this._source.onended=null,this._source.disconnect(),this._buffer.dispose(),this.playbackRate.dispose(),this}}class ni extends ei{constructor(){super(Rr(ni.getDefaults(),arguments,["type"])),this.name="Noise",this._source=null;const e=Rr(ni.getDefaults(),arguments,["type"]);this._playbackRate=e.playbackRate,this.type=e.type,this._fadeIn=e.fadeIn,this._fadeOut=e.fadeOut}static getDefaults(){return Object.assign(ei.getDefaults(),{fadeIn:0,fadeOut:0,playbackRate:1,type:"white"})}get type(){return this._type}set type(e){if(rr(e in ai,"Noise: invalid type: "+e),this._type!==e&&(this._type=e,"started"===this.state)){const e=this.now();this._stop(e),this._start(e)}}get playbackRate(){return this._playbackRate}set playbackRate(e){this._playbackRate=e,this._source&&(this._source.playbackRate.value=e)}_start(e){const t=ai[this._type];this._source=new ti({url:t,context:this.context,fadeIn:this._fadeIn,fadeOut:this._fadeOut,loop:!0,onended:()=>this.onstop(this),playbackRate:this._playbackRate}).connect(this.output),this._source.start(this.toSeconds(e),Math.random()*(t.duration-.001))}_stop(e){this._source&&(this._source.stop(this.toSeconds(e)),this._source=null)}get fadeIn(){return this._fadeIn}set fadeIn(e){this._fadeIn=e,this._source&&(this._source.fadeIn=this._fadeIn)}get fadeOut(){return this._fadeOut}set fadeOut(e){this._fadeOut=e,this._source&&(this._source.fadeOut=this._fadeOut)}_restart(e){this._stop(e),this._start(e)}dispose(){return super.dispose(),this._source&&this._source.disconnect(),this}}const si=220500,ri={brown:null,pink:null,white:null},ai={get brown(){if(!ri.brown){const e=[];for(let t=0;t<2;t++){const n=new Float32Array(si);e[t]=n;let s=0;for(let e=0;et.label===e||t.deviceId===e)),!this._device&&t.length>0&&(this._device=t[0]),rr(dr(this._device),`No matching device ${e}`));const n={audio:{echoCancellation:!1,sampleRate:this.context.sampleRate,noiseSuppression:!1,mozNoiseSuppression:!1}};this._device&&(n.audio.deviceId=this._device.deviceId);const s=yield navigator.mediaDevices.getUserMedia(n);if(!this._stream){this._stream=s;const e=this.context.createMediaStreamSource(s);_a(e,this.output),this._mediaStream=e}return this}))}close(){return this._stream&&this._mediaStream&&(this._stream.getAudioTracks().forEach((e=>{e.stop()})),this._stream=void 0,this._mediaStream.disconnect(),this._mediaStream=void 0),this._device=void 0,this}static enumerateDevices(){return kr(this,void 0,void 0,(function*(){return(yield navigator.mediaDevices.enumerateDevices()).filter((e=>"audioinput"===e.kind))}))}get state(){return this._stream&&this._stream.active?"started":"stopped"}get deviceId(){return this._device?this._device.deviceId:void 0}get groupId(){return this._device?this._device.groupId:void 0}get label(){return this._device?this._device.label:void 0}get mute(){return this._volume.mute}set mute(e){this._volume.mute=e}dispose(){return super.dispose(),this.close(),this._volume.dispose(),this.volume.dispose(),this}static get supported(){return dr(navigator.mediaDevices)&&dr(navigator.mediaDevices.getUserMedia)}}function oi(e,t){return kr(this,void 0,void 0,(function*(){const n=t/e.context.sampleRate,s=new ea(1,n,e.context.sampleRate);new e.constructor(Object.assign(e.get(),{frequency:2/n,detune:0,context:s})).toDestination().start(0);return(yield s.render()).getChannelData(0)}))}class li extends Na{constructor(){super(Rr(li.getDefaults(),arguments,["frequency","type"])),this.name="ToneOscillatorNode",this._oscillator=this.context.createOscillator(),this._internalChannels=[this._oscillator];const e=Rr(li.getDefaults(),arguments,["frequency","type"]);_a(this._oscillator,this._gainNode),this.type=e.type,this.frequency=new Ca({context:this.context,param:this._oscillator.frequency,units:"frequency",value:e.frequency}),this.detune=new Ca({context:this.context,param:this._oscillator.detune,units:"cents",value:e.detune}),Zr(this,["frequency","detune"])}static getDefaults(){return Object.assign(Na.getDefaults(),{detune:0,frequency:440,type:"sine"})}start(e){const t=this.toSeconds(e);return this.log("start",t),this._startGain(t),this._oscillator.start(t),this}_stopSource(e){this._oscillator.stop(e)}setPeriodicWave(e){return this._oscillator.setPeriodicWave(e),this}get type(){return this._oscillator.type}set type(e){this._oscillator.type=e}dispose(){return super.dispose(),"started"===this.state&&this.stop(),this._oscillator.disconnect(),this.frequency.dispose(),this.detune.dispose(),this}}class ui extends ei{constructor(){super(Rr(ui.getDefaults(),arguments,["frequency","type"])),this.name="Oscillator",this._oscillator=null;const e=Rr(ui.getDefaults(),arguments,["frequency","type"]);this.frequency=new Ra({context:this.context,units:"frequency",value:e.frequency}),Zr(this,"frequency"),this.detune=new Ra({context:this.context,units:"cents",value:e.detune}),Zr(this,"detune"),this._partials=e.partials,this._partialCount=e.partialCount,this._type=e.type,e.partialCount&&"custom"!==e.type&&(this._type=this.baseType+e.partialCount.toString()),this.phase=e.phase}static getDefaults(){return Object.assign(ei.getDefaults(),{detune:0,frequency:440,partialCount:0,partials:[],phase:0,type:"sine"})}_start(e){const t=this.toSeconds(e),n=new li({context:this.context,onended:()=>this.onstop(this)});this._oscillator=n,this._wave?this._oscillator.setPeriodicWave(this._wave):this._oscillator.type=this._type,this._oscillator.connect(this.output),this.frequency.connect(this._oscillator.frequency),this.detune.connect(this._oscillator.detune),this._oscillator.start(t)}_stop(e){const t=this.toSeconds(e);this._oscillator&&this._oscillator.stop(t)}_restart(e){const t=this.toSeconds(e);return this.log("restart",t),this._oscillator&&this._oscillator.cancelStop(),this._state.cancel(t),this}syncFrequency(){return this.context.transport.syncSignal(this.frequency),this}unsyncFrequency(){return this.context.transport.unsyncSignal(this.frequency),this}_getCachedPeriodicWave(){if("custom"===this._type){return ui._periodicWaveCache.find((e=>{return e.phase===this._phase&&(t=e.partials,n=this._partials,t.length===n.length&&t.every(((e,t)=>n[t]===e)));var t,n}))}{const e=ui._periodicWaveCache.find((e=>e.type===this._type&&e.phase===this._phase));return this._partialCount=e?e.partialCount:this._partialCount,e}}get type(){return this._type}set type(e){this._type=e;const t=-1!==["sine","square","sawtooth","triangle"].indexOf(e);if(0===this._phase&&t)this._wave=void 0,this._partialCount=0,null!==this._oscillator&&(this._oscillator.type=e);else{const t=this._getCachedPeriodicWave();if(dr(t)){const{partials:e,wave:n}=t;this._wave=n,this._partials=e,null!==this._oscillator&&this._oscillator.setPeriodicWave(this._wave)}else{const[t,n]=this._getRealImaginary(e,this._phase),s=this.context.createPeriodicWave(t,n);this._wave=s,null!==this._oscillator&&this._oscillator.setPeriodicWave(this._wave),ui._periodicWaveCache.push({imag:n,partialCount:this._partialCount,partials:this._partials,phase:this._phase,real:t,type:this._type,wave:this._wave}),ui._periodicWaveCache.length>100&&ui._periodicWaveCache.shift()}}}get baseType(){return this._type.replace(this.partialCount.toString(),"")}set baseType(e){this.partialCount&&"custom"!==this._type&&"custom"!==e?this.type=e+this.partialCount:this.type=e}get partialCount(){return this._partialCount}set partialCount(e){ar(e,0);let t=this._type;const n=/^(sine|triangle|square|sawtooth)(\d+)$/.exec(this._type);if(n&&(t=n[1]),"custom"!==this._type)this.type=0===e?t:t+e.toString();else{const t=new Float32Array(e);this._partials.forEach(((e,n)=>t[n]=e)),this._partials=Array.from(t),this.type=this._type}}_getRealImaginary(e,t){let n=2048;const s=new Float32Array(n),r=new Float32Array(n);let a=1;if("custom"===e){if(a=this._partials.length+1,this._partialCount=this._partials.length,n=a,0===this._partials.length)return[s,r]}else{const t=/^(sine|triangle|square|sawtooth)(\d+)$/.exec(e);t?(a=parseInt(t[2],10)+1,this._partialCount=parseInt(t[2],10),e=t[1],a=Math.max(a,2),n=a):this._partialCount=0,this._partials=[]}for(let i=1;i>1&1?-1:1):0,this._partials[i-1]=o;break;case"custom":o=this._partials[i-1];break;default:throw new TypeError("Oscillator: invalid type: "+e)}0!==o?(s[i]=-o*Math.sin(t*i),r[i]=o*Math.cos(t*i)):(s[i]=0,r[i]=0)}return[s,r]}_inverseFFT(e,t,n){let s=0;const r=e.length;for(let a=0;at.includes(e))),"oversampling must be either 'none', '2x', or '4x'"),this._shaper.oversample=e}dispose(){return super.dispose(),this._shaper.disconnect(),this}}class di extends ci{constructor(){super(...arguments),this.name="AudioToGain",this._norm=new hi({context:this.context,mapping:e=>(e+1)/2}),this.input=this._norm,this.output=this._norm}dispose(){return super.dispose(),this._norm.dispose(),this}}class pi extends Ra{constructor(){super(Object.assign(Rr(pi.getDefaults(),arguments,["value"]))),this.name="Multiply",this.override=!1;const e=Rr(pi.getDefaults(),arguments,["value"]);this._mult=this.input=this.output=new Ta({context:this.context,minValue:e.minValue,maxValue:e.maxValue}),this.factor=this._param=this._mult.gain,this.factor.setValueAtTime(e.value,0)}static getDefaults(){return Object.assign(Ra.getDefaults(),{value:0})}dispose(){return super.dispose(),this._mult.dispose(),this}}class fi extends ei{constructor(){super(Rr(fi.getDefaults(),arguments,["frequency","type","modulationType"])),this.name="AMOscillator",this._modulationScale=new di({context:this.context}),this._modulationNode=new Ta({context:this.context});const e=Rr(fi.getDefaults(),arguments,["frequency","type","modulationType"]);this._carrier=new ui({context:this.context,detune:e.detune,frequency:e.frequency,onstop:()=>this.onstop(this),phase:e.phase,type:e.type}),this.frequency=this._carrier.frequency,this.detune=this._carrier.detune,this._modulator=new ui({context:this.context,phase:e.phase,type:e.modulationType}),this.harmonicity=new pi({context:this.context,units:"positive",value:e.harmonicity}),this.frequency.chain(this.harmonicity,this._modulator.frequency),this._modulator.chain(this._modulationScale,this._modulationNode.gain),this._carrier.chain(this._modulationNode,this.output),Zr(this,["frequency","detune","harmonicity"])}static getDefaults(){return Object.assign(ui.getDefaults(),{harmonicity:1,modulationType:"square"})}_start(e){this._modulator.start(e),this._carrier.start(e)}_stop(e){this._modulator.stop(e),this._carrier.stop(e)}_restart(e){this._modulator.restart(e),this._carrier.restart(e)}get type(){return this._carrier.type}set type(e){this._carrier.type=e}get baseType(){return this._carrier.baseType}set baseType(e){this._carrier.baseType=e}get partialCount(){return this._carrier.partialCount}set partialCount(e){this._carrier.partialCount=e}get modulationType(){return this._modulator.type}set modulationType(e){this._modulator.type=e}get phase(){return this._carrier.phase}set phase(e){this._carrier.phase=e,this._modulator.phase=e}get partials(){return this._carrier.partials}set partials(e){this._carrier.partials=e}asArray(e=1024){return kr(this,void 0,void 0,(function*(){return oi(this,e)}))}dispose(){return super.dispose(),this.frequency.dispose(),this.detune.dispose(),this.harmonicity.dispose(),this._carrier.dispose(),this._modulator.dispose(),this._modulationNode.dispose(),this._modulationScale.dispose(),this}}class mi extends ei{constructor(){super(Rr(mi.getDefaults(),arguments,["frequency","type","modulationType"])),this.name="FMOscillator",this._modulationNode=new Ta({context:this.context,gain:0});const e=Rr(mi.getDefaults(),arguments,["frequency","type","modulationType"]);this._carrier=new ui({context:this.context,detune:e.detune,frequency:0,onstop:()=>this.onstop(this),phase:e.phase,type:e.type}),this.detune=this._carrier.detune,this.frequency=new Ra({context:this.context,units:"frequency",value:e.frequency}),this._modulator=new ui({context:this.context,phase:e.phase,type:e.modulationType}),this.harmonicity=new pi({context:this.context,units:"positive",value:e.harmonicity}),this.modulationIndex=new pi({context:this.context,units:"positive",value:e.modulationIndex}),this.frequency.connect(this._carrier.frequency),this.frequency.chain(this.harmonicity,this._modulator.frequency),this.frequency.chain(this.modulationIndex,this._modulationNode),this._modulator.connect(this._modulationNode.gain),this._modulationNode.connect(this._carrier.frequency),this._carrier.connect(this.output),this.detune.connect(this._modulator.detune),Zr(this,["modulationIndex","frequency","detune","harmonicity"])}static getDefaults(){return Object.assign(ui.getDefaults(),{harmonicity:1,modulationIndex:2,modulationType:"square"})}_start(e){this._modulator.start(e),this._carrier.start(e)}_stop(e){this._modulator.stop(e),this._carrier.stop(e)}_restart(e){return this._modulator.restart(e),this._carrier.restart(e),this}get type(){return this._carrier.type}set type(e){this._carrier.type=e}get baseType(){return this._carrier.baseType}set baseType(e){this._carrier.baseType=e}get partialCount(){return this._carrier.partialCount}set partialCount(e){this._carrier.partialCount=e}get modulationType(){return this._modulator.type}set modulationType(e){this._modulator.type=e}get phase(){return this._carrier.phase}set phase(e){this._carrier.phase=e,this._modulator.phase=e}get partials(){return this._carrier.partials}set partials(e){this._carrier.partials=e}asArray(e=1024){return kr(this,void 0,void 0,(function*(){return oi(this,e)}))}dispose(){return super.dispose(),this.frequency.dispose(),this.harmonicity.dispose(),this._carrier.dispose(),this._modulator.dispose(),this._modulationNode.dispose(),this.modulationIndex.dispose(),this}}class gi extends ei{constructor(){super(Rr(gi.getDefaults(),arguments,["frequency","width"])),this.name="PulseOscillator",this._widthGate=new Ta({context:this.context,gain:0}),this._thresh=new hi({context:this.context,mapping:e=>e<=0?-1:1});const e=Rr(gi.getDefaults(),arguments,["frequency","width"]);this.width=new Ra({context:this.context,units:"audioRange",value:e.width}),this._triangle=new ui({context:this.context,detune:e.detune,frequency:e.frequency,onstop:()=>this.onstop(this),phase:e.phase,type:"triangle"}),this.frequency=this._triangle.frequency,this.detune=this._triangle.detune,this._triangle.chain(this._thresh,this.output),this.width.chain(this._widthGate,this._thresh),Zr(this,["width","frequency","detune"])}static getDefaults(){return Object.assign(ei.getDefaults(),{detune:0,frequency:440,phase:0,type:"pulse",width:.2})}_start(e){e=this.toSeconds(e),this._triangle.start(e),this._widthGate.gain.setValueAtTime(1,e)}_stop(e){e=this.toSeconds(e),this._triangle.stop(e),this._widthGate.gain.cancelScheduledValues(e),this._widthGate.gain.setValueAtTime(0,e)}_restart(e){this._triangle.restart(e),this._widthGate.gain.cancelScheduledValues(e),this._widthGate.gain.setValueAtTime(1,e)}get phase(){return this._triangle.phase}set phase(e){this._triangle.phase=e}get type(){return"pulse"}get baseType(){return"pulse"}get partials(){return[]}get partialCount(){return 0}set carrierType(e){this._triangle.type=e}asArray(e=1024){return kr(this,void 0,void 0,(function*(){return oi(this,e)}))}dispose(){return super.dispose(),this._triangle.dispose(),this.width.dispose(),this._widthGate.dispose(),this._thresh.dispose(),this}}class yi extends ei{constructor(){super(Rr(yi.getDefaults(),arguments,["frequency","type","spread"])),this.name="FatOscillator",this._oscillators=[];const e=Rr(yi.getDefaults(),arguments,["frequency","type","spread"]);this.frequency=new Ra({context:this.context,units:"frequency",value:e.frequency}),this.detune=new Ra({context:this.context,units:"cents",value:e.detune}),this._spread=e.spread,this._type=e.type,this._phase=e.phase,this._partials=e.partials,this._partialCount=e.partialCount,this.count=e.count,Zr(this,["frequency","detune"])}static getDefaults(){return Object.assign(ui.getDefaults(),{count:3,spread:20,type:"sawtooth"})}_start(e){e=this.toSeconds(e),this._forEach((t=>t.start(e)))}_stop(e){e=this.toSeconds(e),this._forEach((t=>t.stop(e)))}_restart(e){this._forEach((t=>t.restart(e)))}_forEach(e){for(let t=0;tt.type=e))}get spread(){return this._spread}set spread(e){if(this._spread=e,this._oscillators.length>1){const t=-e/2,n=e/(this._oscillators.length-1);this._forEach(((e,s)=>e.detune.value=t+n*s))}}get count(){return this._oscillators.length}set count(e){if(ar(e,1),this._oscillators.length!==e){this._forEach((e=>e.dispose())),this._oscillators=[];for(let t=0;tthis.onstop(this):Qr});"custom"===this.type&&(n.partials=this._partials),this.frequency.connect(n.frequency),this.detune.connect(n.detune),n.detune.overridden=!1,n.connect(this.output),this._oscillators[t]=n}this.spread=this._spread,"started"===this.state&&this._forEach((e=>e.start()))}}get phase(){return this._phase}set phase(e){this._phase=e,this._forEach(((e,t)=>e.phase=this._phase+t/this.count*360))}get baseType(){return this._oscillators[0].baseType}set baseType(e){this._forEach((t=>t.baseType=e)),this._type=this._oscillators[0].type}get partials(){return this._oscillators[0].partials}set partials(e){this._partials=e,this._partialCount=this._partials.length,e.length&&(this._type="custom",this._forEach((t=>t.partials=e)))}get partialCount(){return this._oscillators[0].partialCount}set partialCount(e){this._partialCount=e,this._forEach((t=>t.partialCount=e)),this._type=this._oscillators[0].type}asArray(e=1024){return kr(this,void 0,void 0,(function*(){return oi(this,e)}))}dispose(){return super.dispose(),this.frequency.dispose(),this.detune.dispose(),this._forEach((e=>e.dispose())),this}}class bi extends ei{constructor(){super(Rr(bi.getDefaults(),arguments,["frequency","modulationFrequency"])),this.name="PWMOscillator",this.sourceType="pwm",this._scale=new pi({context:this.context,value:2});const e=Rr(bi.getDefaults(),arguments,["frequency","modulationFrequency"]);this._pulse=new gi({context:this.context,frequency:e.modulationFrequency}),this._pulse.carrierType="sine",this.modulationFrequency=this._pulse.frequency,this._modulator=new ui({context:this.context,detune:e.detune,frequency:e.frequency,onstop:()=>this.onstop(this),phase:e.phase}),this.frequency=this._modulator.frequency,this.detune=this._modulator.detune,this._modulator.chain(this._scale,this._pulse.width),this._pulse.connect(this.output),Zr(this,["modulationFrequency","frequency","detune"])}static getDefaults(){return Object.assign(ei.getDefaults(),{detune:0,frequency:440,modulationFrequency:.4,phase:0,type:"pwm"})}_start(e){e=this.toSeconds(e),this._modulator.start(e),this._pulse.start(e)}_stop(e){e=this.toSeconds(e),this._modulator.stop(e),this._pulse.stop(e)}_restart(e){this._modulator.restart(e),this._pulse.restart(e)}get type(){return"pwm"}get baseType(){return"pwm"}get partials(){return[]}get partialCount(){return 0}get phase(){return this._modulator.phase}set phase(e){this._modulator.phase=e}asArray(e=1024){return kr(this,void 0,void 0,(function*(){return oi(this,e)}))}dispose(){return super.dispose(),this._pulse.dispose(),this._scale.dispose(),this._modulator.dispose(),this}}const wi={am:fi,fat:yi,fm:mi,oscillator:ui,pulse:gi,pwm:bi};class vi extends ei{constructor(){super(Rr(vi.getDefaults(),arguments,["frequency","type"])),this.name="OmniOscillator";const e=Rr(vi.getDefaults(),arguments,["frequency","type"]);this.frequency=new Ra({context:this.context,units:"frequency",value:e.frequency}),this.detune=new Ra({context:this.context,units:"cents",value:e.detune}),Zr(this,["frequency","detune"]),this.set(e)}static getDefaults(){return Object.assign(ui.getDefaults(),mi.getDefaults(),fi.getDefaults(),yi.getDefaults(),gi.getDefaults(),bi.getDefaults())}_start(e){this._oscillator.start(e)}_stop(e){this._oscillator.stop(e)}_restart(e){return this._oscillator.restart(e),this}get type(){let e="";return["am","fm","fat"].some((e=>this._sourceType===e))&&(e=this._sourceType),e+this._oscillator.type}set type(e){"fm"===e.substr(0,2)?(this._createNewOscillator("fm"),this._oscillator=this._oscillator,this._oscillator.type=e.substr(2)):"am"===e.substr(0,2)?(this._createNewOscillator("am"),this._oscillator=this._oscillator,this._oscillator.type=e.substr(2)):"fat"===e.substr(0,3)?(this._createNewOscillator("fat"),this._oscillator=this._oscillator,this._oscillator.type=e.substr(3)):"pwm"===e?(this._createNewOscillator("pwm"),this._oscillator=this._oscillator):"pulse"===e?this._createNewOscillator("pulse"):(this._createNewOscillator("oscillator"),this._oscillator=this._oscillator,this._oscillator.type=e)}get partials(){return this._oscillator.partials}set partials(e){this._getOscType(this._oscillator,"pulse")||this._getOscType(this._oscillator,"pwm")||(this._oscillator.partials=e)}get partialCount(){return this._oscillator.partialCount}set partialCount(e){this._getOscType(this._oscillator,"pulse")||this._getOscType(this._oscillator,"pwm")||(this._oscillator.partialCount=e)}set(e){return Reflect.has(e,"type")&&e.type&&(this.type=e.type),super.set(e),this}_createNewOscillator(e){if(e!==this._sourceType){this._sourceType=e;const t=wi[e],n=this.now();if(this._oscillator){const e=this._oscillator;e.stop(n),this.context.setTimeout((()=>e.dispose()),this.blockTime)}this._oscillator=new t({context:this.context}),this.frequency.connect(this._oscillator.frequency),this.detune.connect(this._oscillator.detune),this._oscillator.connect(this.output),this._oscillator.onstop=()=>this.onstop(this),"started"===this.state&&this._oscillator.start(n)}}get phase(){return this._oscillator.phase}set phase(e){this._oscillator.phase=e}get sourceType(){return this._sourceType}set sourceType(e){let t="sine";"pwm"!==this._oscillator.type&&"pulse"!==this._oscillator.type&&(t=this._oscillator.type),"fm"===e?this.type="fm"+t:"am"===e?this.type="am"+t:"fat"===e?this.type="fat"+t:"oscillator"===e?this.type=t:"pulse"===e?this.type="pulse":"pwm"===e&&(this.type="pwm")}_getOscType(e,t){return e instanceof wi[t]}get baseType(){return this._oscillator.baseType}set baseType(e){this._getOscType(this._oscillator,"pulse")||this._getOscType(this._oscillator,"pwm")||"pulse"===e||"pwm"===e||(this._oscillator.baseType=e)}get width(){return this._getOscType(this._oscillator,"pulse")?this._oscillator.width:void 0}get count(){return this._getOscType(this._oscillator,"fat")?this._oscillator.count:void 0}set count(e){this._getOscType(this._oscillator,"fat")&&fr(e)&&(this._oscillator.count=e)}get spread(){return this._getOscType(this._oscillator,"fat")?this._oscillator.spread:void 0}set spread(e){this._getOscType(this._oscillator,"fat")&&fr(e)&&(this._oscillator.spread=e)}get modulationType(){return this._getOscType(this._oscillator,"fm")||this._getOscType(this._oscillator,"am")?this._oscillator.modulationType:void 0}set modulationType(e){(this._getOscType(this._oscillator,"fm")||this._getOscType(this._oscillator,"am"))&&br(e)&&(this._oscillator.modulationType=e)}get modulationIndex(){return this._getOscType(this._oscillator,"fm")?this._oscillator.modulationIndex:void 0}get harmonicity(){return this._getOscType(this._oscillator,"fm")||this._getOscType(this._oscillator,"am")?this._oscillator.harmonicity:void 0}get modulationFrequency(){return this._getOscType(this._oscillator,"pwm")?this._oscillator.modulationFrequency:void 0}asArray(e=1024){return kr(this,void 0,void 0,(function*(){return oi(this,e)}))}dispose(){return super.dispose(),this.detune.dispose(),this.frequency.dispose(),this._oscillator.dispose(),this}}class xi extends Ra{constructor(){super(Object.assign(Rr(xi.getDefaults(),arguments,["value"]))),this.override=!1,this.name="Add",this._sum=new Ta({context:this.context}),this.input=this._sum,this.output=this._sum,this.addend=this._param,Ea(this._constantSource,this._sum)}static getDefaults(){return Object.assign(Ra.getDefaults(),{value:0})}dispose(){return super.dispose(),this._sum.dispose(),this}}class Ai extends ci{constructor(){super(Object.assign(Rr(Ai.getDefaults(),arguments,["min","max"]))),this.name="Scale";const e=Rr(Ai.getDefaults(),arguments,["min","max"]);this._mult=this.input=new pi({context:this.context,value:e.max-e.min}),this._add=this.output=new xi({context:this.context,value:e.min}),this._min=e.min,this._max=e.max,this.input.connect(this.output)}static getDefaults(){return Object.assign(ci.getDefaults(),{max:1,min:0})}get min(){return this._min}set min(e){this._min=e,this._setRange()}get max(){return this._max}set max(e){this._max=e,this._setRange()}_setRange(){this._add.value=this._min,this._mult.value=this._max-this._min}dispose(){return super.dispose(),this._add.dispose(),this._mult.dispose(),this}}class ki extends ci{constructor(){super(Object.assign(Rr(ki.getDefaults(),arguments))),this.name="Zero",this._gain=new Ta({context:this.context}),this.output=this._gain,this.input=void 0,_a(this.context.getConstant(0),this._gain)}dispose(){return super.dispose(),Ia(this.context.getConstant(0),this._gain),this}}class Ci extends Sa{constructor(){super(Rr(Ci.getDefaults(),arguments,["frequency","min","max"])),this.name="LFO",this._stoppedValue=0,this._units="number",this.convert=!0,this._fromType=Ca.prototype._fromType,this._toType=Ca.prototype._toType,this._is=Ca.prototype._is,this._clampValue=Ca.prototype._clampValue;const e=Rr(Ci.getDefaults(),arguments,["frequency","min","max"]);this._oscillator=new ui(e),this.frequency=this._oscillator.frequency,this._amplitudeGain=new Ta({context:this.context,gain:e.amplitude,units:"normalRange"}),this.amplitude=this._amplitudeGain.gain,this._stoppedSignal=new Ra({context:this.context,units:"audioRange",value:0}),this._zeros=new ki({context:this.context}),this._a2g=new di({context:this.context}),this._scaler=this.output=new Ai({context:this.context,max:e.max,min:e.min}),this.units=e.units,this.min=e.min,this.max=e.max,this._oscillator.chain(this._amplitudeGain,this._a2g,this._scaler),this._zeros.connect(this._a2g),this._stoppedSignal.connect(this._a2g),Zr(this,["amplitude","frequency"]),this.phase=e.phase}static getDefaults(){return Object.assign(ui.getDefaults(),{amplitude:1,frequency:"4n",max:1,min:0,type:"sine",units:"number"})}start(e){return e=this.toSeconds(e),this._stoppedSignal.setValueAtTime(0,e),this._oscillator.start(e),this}stop(e){return e=this.toSeconds(e),this._stoppedSignal.setValueAtTime(this._stoppedValue,e),this._oscillator.stop(e),this}sync(){return this._oscillator.sync(),this._oscillator.syncFrequency(),this}unsync(){return this._oscillator.unsync(),this._oscillator.unsyncFrequency(),this}_setStoppedValue(){this._stoppedValue=this._oscillator.getInitialValue(),this._stoppedSignal.value=this._stoppedValue}get min(){return this._toType(this._scaler.min)}set min(e){e=this._fromType(e),this._scaler.min=e}get max(){return this._toType(this._scaler.max)}set max(e){e=this._fromType(e),this._scaler.max=e}get type(){return this._oscillator.type}set type(e){this._oscillator.type=e,this._setStoppedValue()}get partials(){return this._oscillator.partials}set partials(e){this._oscillator.partials=e,this._setStoppedValue()}get phase(){return this._oscillator.phase}set phase(e){this._oscillator.phase=e,this._setStoppedValue()}get units(){return this._units}set units(e){const t=this.min,n=this.max;this._units=e,this.min=t,this.max=n}get state(){return this._oscillator.state}connect(e,t,n){return(e instanceof Ca||e instanceof Ra)&&(this.convert=e.convert,this.units=e.units),Da(this,e,t,n),this}dispose(){return super.dispose(),this._oscillator.dispose(),this._stoppedSignal.dispose(),this._zeros.dispose(),this._scaler.dispose(),this._a2g.dispose(),this._amplitudeGain.dispose(),this.amplitude.dispose(),this}}function Si(e,t=1/0){const n=new WeakMap;return function(s,r){Reflect.defineProperty(s,r,{configurable:!0,enumerable:!0,get:function(){return n.get(this)},set:function(s){ar(s,e,t),n.set(this,s)}})}}function Ei(e,t=1/0){const n=new WeakMap;return function(s,r){Reflect.defineProperty(s,r,{configurable:!0,enumerable:!0,get:function(){return n.get(this)},set:function(s){ar(this.toSeconds(s),e,t),n.set(this,s)}})}}class _i extends ei{constructor(){super(Rr(_i.getDefaults(),arguments,["url","onload"])),this.name="Player",this._activeSources=new Set;const e=Rr(_i.getDefaults(),arguments,["url","onload"]);this._buffer=new Jr({onload:this._onload.bind(this,e.onload),onerror:e.onerror,reverse:e.reverse,url:e.url}),this.autostart=e.autostart,this._loop=e.loop,this._loopStart=e.loopStart,this._loopEnd=e.loopEnd,this._playbackRate=e.playbackRate,this.fadeIn=e.fadeIn,this.fadeOut=e.fadeOut}static getDefaults(){return Object.assign(ei.getDefaults(),{autostart:!1,fadeIn:0,fadeOut:0,loop:!1,loopEnd:0,loopStart:0,onload:Qr,onerror:Qr,playbackRate:1,reverse:!1})}load(e){return kr(this,void 0,void 0,(function*(){return yield this._buffer.load(e),this._onload(),this}))}_onload(e=Qr){e(),this.autostart&&this.start()}_onSourceEnd(e){this.onstop(this),this._activeSources.delete(e),0!==this._activeSources.size||this._synced||"started"!==this._state.getValueAtTime(this.now())||(this._state.cancel(this.now()),this._state.setStateAtTime("stopped",this.now()))}start(e,t,n){return super.start(e,t,n),this}_start(e,t,n){t=this._loop?Dr(t,this._loopStart):Dr(t,0);const s=this.toSeconds(t),r=n;n=Dr(n,Math.max(this._buffer.duration-s,0));let a=this.toSeconds(n);a/=this._playbackRate,e=this.toSeconds(e);const i=new ti({url:this._buffer,context:this.context,fadeIn:this.fadeIn,fadeOut:this.fadeOut,loop:this._loop,loopEnd:this._loopEnd,loopStart:this._loopStart,onended:this._onSourceEnd.bind(this),playbackRate:this._playbackRate}).connect(this.output);this._loop||this._synced||(this._state.cancel(e+a),this._state.setStateAtTime("stopped",e+a,{implicitEnd:!0})),this._activeSources.add(i),this._loop&&hr(r)?i.start(e,s):i.start(e,s,a-this.toSeconds(this.fadeOut))}_stop(e){const t=this.toSeconds(e);this._activeSources.forEach((e=>e.stop(t)))}restart(e,t,n){return super.restart(e,t,n),this}_restart(e,t,n){this._stop(e),this._start(e,t,n)}seek(e,t){const n=this.toSeconds(t);if("started"===this._state.getValueAtTime(n)){const t=this.toSeconds(e);this._stop(n),this._start(n,t)}return this}setLoopPoints(e,t){return this.loopStart=e,this.loopEnd=t,this}get loopStart(){return this._loopStart}set loopStart(e){this._loopStart=e,this.buffer.loaded&&ar(this.toSeconds(e),0,this.buffer.duration),this._activeSources.forEach((t=>{t.loopStart=e}))}get loopEnd(){return this._loopEnd}set loopEnd(e){this._loopEnd=e,this.buffer.loaded&&ar(this.toSeconds(e),0,this.buffer.duration),this._activeSources.forEach((t=>{t.loopEnd=e}))}get buffer(){return this._buffer}set buffer(e){this._buffer.set(e)}get loop(){return this._loop}set loop(e){if(this._loop!==e&&(this._loop=e,this._activeSources.forEach((t=>{t.loop=e})),e)){const e=this._state.getNextState("stopped",this.now());e&&this._state.cancel(e.time)}}get playbackRate(){return this._playbackRate}set playbackRate(e){this._playbackRate=e;const t=this.now(),n=this._state.getNextState("stopped",t);n&&n.implicitEnd&&(this._state.cancel(n.time),this._activeSources.forEach((e=>e.cancelStop()))),this._activeSources.forEach((n=>{n.playbackRate.setValueAtTime(e,t)}))}get reverse(){return this._buffer.reverse}set reverse(e){this._buffer.reverse=e}get loaded(){return this._buffer.loaded}dispose(){return super.dispose(),this._activeSources.forEach((e=>e.dispose())),this._activeSources.clear(),this._buffer.dispose(),this}}Ar([Ei(0)],_i.prototype,"fadeIn",void 0),Ar([Ei(0)],_i.prototype,"fadeOut",void 0);class Ii extends Sa{constructor(){super(Rr(Ii.getDefaults(),arguments,["urls","onload"],"urls")),this.name="Players",this.input=void 0,this._players=new Map;const e=Rr(Ii.getDefaults(),arguments,["urls","onload"],"urls");this._volume=this.output=new Ka({context:this.context,volume:e.volume}),this.volume=this._volume.volume,Zr(this,"volume"),this._buffers=new Va({urls:e.urls,onload:e.onload,baseUrl:e.baseUrl,onerror:e.onerror}),this.mute=e.mute,this._fadeIn=e.fadeIn,this._fadeOut=e.fadeOut}static getDefaults(){return Object.assign(ei.getDefaults(),{baseUrl:"",fadeIn:0,fadeOut:0,mute:!1,onload:Qr,onerror:Qr,urls:{},volume:0})}get mute(){return this._volume.mute}set mute(e){this._volume.mute=e}get fadeIn(){return this._fadeIn}set fadeIn(e){this._fadeIn=e,this._players.forEach((t=>{t.fadeIn=e}))}get fadeOut(){return this._fadeOut}set fadeOut(e){this._fadeOut=e,this._players.forEach((t=>{t.fadeOut=e}))}get state(){return Array.from(this._players).some((([e,t])=>"started"===t.state))?"started":"stopped"}has(e){return this._buffers.has(e)}player(e){if(rr(this.has(e),`No Player with the name ${e} exists on this object`),!this._players.has(e)){const t=new _i({context:this.context,fadeIn:this._fadeIn,fadeOut:this._fadeOut,url:this._buffers.get(e)}).connect(this.output);this._players.set(e,t)}return this._players.get(e)}get loaded(){return this._buffers.loaded}add(e,t,n){return rr(!this._buffers.has(e),"A buffer with that name already exists on this object"),this._buffers.add(e,t,n),this}stopAll(e){return this._players.forEach((t=>t.stop(e))),this}dispose(){return super.dispose(),this._volume.dispose(),this.volume.dispose(),this._players.forEach((e=>e.dispose())),this._buffers.dispose(),this}}class Ti extends ei{constructor(){super(Rr(Ti.getDefaults(),arguments,["url","onload"])),this.name="GrainPlayer",this._loopStart=0,this._loopEnd=0,this._activeSources=[];const e=Rr(Ti.getDefaults(),arguments,["url","onload"]);this.buffer=new Jr({onload:e.onload,onerror:e.onerror,reverse:e.reverse,url:e.url}),this._clock=new za({context:this.context,callback:this._tick.bind(this),frequency:1/e.grainSize}),this._playbackRate=e.playbackRate,this._grainSize=e.grainSize,this._overlap=e.overlap,this.detune=e.detune,this.overlap=e.overlap,this.loop=e.loop,this.playbackRate=e.playbackRate,this.grainSize=e.grainSize,this.loopStart=e.loopStart,this.loopEnd=e.loopEnd,this.reverse=e.reverse,this._clock.on("stop",this._onstop.bind(this))}static getDefaults(){return Object.assign(ei.getDefaults(),{onload:Qr,onerror:Qr,overlap:.1,grainSize:.2,playbackRate:1,detune:0,loop:!1,loopStart:0,loopEnd:0,reverse:!1})}_start(e,t,n){t=Dr(t,0),t=this.toSeconds(t),e=this.toSeconds(e);const s=1/this._clock.frequency.getValueAtTime(e);this._clock.start(e,t/s),n&&this.stop(e+this.toSeconds(n))}restart(e,t,n){return super.restart(e,t,n),this}_restart(e,t,n){this._stop(e),this._start(e,t,n)}_stop(e){this._clock.stop(e)}_onstop(e){this._activeSources.forEach((t=>{t.fadeOut=0,t.stop(e)})),this.onstop(this)}_tick(e){const t=this._clock.getTicksAtTime(e),n=t*this._grainSize;if(this.log("offset",n),!this.loop&&n>this.buffer.duration)return void this.stop(e);const s=n{const e=this._activeSources.indexOf(r);-1!==e&&this._activeSources.splice(e,1)}}get playbackRate(){return this._playbackRate}set playbackRate(e){ar(e,.001),this._playbackRate=e,this.grainSize=this._grainSize}get loopStart(){return this._loopStart}set loopStart(e){this.buffer.loaded&&ar(this.toSeconds(e),0,this.buffer.duration),this._loopStart=this.toSeconds(e)}get loopEnd(){return this._loopEnd}set loopEnd(e){this.buffer.loaded&&ar(this.toSeconds(e),0,this.buffer.duration),this._loopEnd=this.toSeconds(e)}get reverse(){return this.buffer.reverse}set reverse(e){this.buffer.reverse=e}get grainSize(){return this._grainSize}set grainSize(e){this._grainSize=this.toSeconds(e),this._clock.frequency.setValueAtTime(this._playbackRate/this._grainSize,this.now())}get overlap(){return this._overlap}set overlap(e){const t=this.toSeconds(e);ar(t,0),this._overlap=t}get loaded(){return this.buffer.loaded}dispose(){return super.dispose(),this.buffer.dispose(),this._clock.dispose(),this._activeSources.forEach((e=>e.dispose())),this}}class Ni extends ci{constructor(){super(...arguments),this.name="Abs",this._abs=new hi({context:this.context,mapping:e=>Math.abs(e)<.001?0:Math.abs(e)}),this.input=this._abs,this.output=this._abs}dispose(){return super.dispose(),this._abs.dispose(),this}}class Oi extends ci{constructor(){super(...arguments),this.name="GainToAudio",this._norm=new hi({context:this.context,mapping:e=>2*Math.abs(e)-1}),this.input=this._norm,this.output=this._norm}dispose(){return super.dispose(),this._norm.dispose(),this}}class Ri extends ci{constructor(){super(...arguments),this.name="Negate",this._multiply=new pi({context:this.context,value:-1}),this.input=this._multiply,this.output=this._multiply}dispose(){return super.dispose(),this._multiply.dispose(),this}}class Di extends Ra{constructor(){super(Object.assign(Rr(Di.getDefaults(),arguments,["value"]))),this.override=!1,this.name="Subtract",this._sum=new Ta({context:this.context}),this.input=this._sum,this.output=this._sum,this._neg=new Ri({context:this.context}),this.subtrahend=this._param,Ea(this._constantSource,this._neg,this._sum)}static getDefaults(){return Object.assign(Ra.getDefaults(),{value:0})}dispose(){return super.dispose(),this._neg.dispose(),this._sum.dispose(),this}}class Mi extends ci{constructor(){super(Object.assign(Rr(Mi.getDefaults(),arguments))),this.name="GreaterThanZero",this._thresh=this.output=new hi({context:this.context,length:127,mapping:e=>e<=0?0:1}),this._scale=this.input=new pi({context:this.context,value:1e4}),this._scale.connect(this._thresh)}dispose(){return super.dispose(),this._scale.dispose(),this._thresh.dispose(),this}}class Fi extends Ra{constructor(){super(Object.assign(Rr(Fi.getDefaults(),arguments,["value"]))),this.name="GreaterThan",this.override=!1;const e=Rr(Fi.getDefaults(),arguments,["value"]);this._subtract=this.input=new Di({context:this.context,value:e.value}),this._gtz=this.output=new Mi({context:this.context}),this.comparator=this._param=this._subtract.subtrahend,Zr(this,"comparator"),this._subtract.connect(this._gtz)}static getDefaults(){return Object.assign(Ra.getDefaults(),{value:0})}dispose(){return super.dispose(),this._gtz.dispose(),this._subtract.dispose(),this.comparator.dispose(),this}}class Bi extends ci{constructor(){super(Object.assign(Rr(Bi.getDefaults(),arguments,["value"]))),this.name="Pow";const e=Rr(Bi.getDefaults(),arguments,["value"]);this._exponentScaler=this.input=this.output=new hi({context:this.context,mapping:this._expFunc(e.value),length:8192}),this._exponent=e.value}static getDefaults(){return Object.assign(ci.getDefaults(),{value:1})}_expFunc(e){return t=>Math.pow(Math.abs(t),e)}get value(){return this._exponent}set value(e){this._exponent=e,this._exponentScaler.setMap(this._expFunc(this._exponent))}dispose(){return super.dispose(),this._exponentScaler.dispose(),this}}class zi extends Ai{constructor(){super(Object.assign(Rr(zi.getDefaults(),arguments,["min","max","exponent"]))),this.name="ScaleExp";const e=Rr(zi.getDefaults(),arguments,["min","max","exponent"]);this.input=this._exp=new Bi({context:this.context,value:e.exponent}),this._exp.connect(this._mult)}static getDefaults(){return Object.assign(Ai.getDefaults(),{exponent:1})}get exponent(){return this._exp.value}set exponent(e){this._exp.value=e}dispose(){return super.dispose(),this._exp.dispose(),this}}class Li extends Ra{constructor(){super(Rr(Ra.getDefaults(),arguments,["value","units"])),this.name="SyncedSignal",this.override=!1;const e=Rr(Ra.getDefaults(),arguments,["value","units"]);this._lastVal=e.value,this._synced=this.context.transport.scheduleRepeat(this._onTick.bind(this),"1i"),this._syncedCallback=this._anchorValue.bind(this),this.context.transport.on("start",this._syncedCallback),this.context.transport.on("pause",this._syncedCallback),this.context.transport.on("stop",this._syncedCallback),this._constantSource.disconnect(),this._constantSource.stop(0),this._constantSource=this.output=new Oa({context:this.context,offset:e.value,units:e.units}).start(0),this.setValueAtTime(e.value,0)}_onTick(e){const t=super.getValueAtTime(this.context.transport.seconds);this._lastVal!==t&&(this._lastVal=t,this._constantSource.offset.setValueAtTime(t,e))}_anchorValue(e){const t=super.getValueAtTime(this.context.transport.seconds);this._lastVal=t,this._constantSource.offset.cancelAndHoldAtTime(e),this._constantSource.offset.setValueAtTime(t,e)}getValueAtTime(e){const t=new va(this.context,e).toSeconds();return super.getValueAtTime(t)}setValueAtTime(e,t){const n=new va(this.context,t).toSeconds();return super.setValueAtTime(e,n),this}linearRampToValueAtTime(e,t){const n=new va(this.context,t).toSeconds();return super.linearRampToValueAtTime(e,n),this}exponentialRampToValueAtTime(e,t){const n=new va(this.context,t).toSeconds();return super.exponentialRampToValueAtTime(e,n),this}setTargetAtTime(e,t,n){const s=new va(this.context,t).toSeconds();return super.setTargetAtTime(e,s,n),this}cancelScheduledValues(e){const t=new va(this.context,e).toSeconds();return super.cancelScheduledValues(t),this}setValueCurveAtTime(e,t,n,s){const r=new va(this.context,t).toSeconds();return n=this.toSeconds(n),super.setValueCurveAtTime(e,r,n,s),this}cancelAndHoldAtTime(e){const t=new va(this.context,e).toSeconds();return super.cancelAndHoldAtTime(t),this}setRampPoint(e){const t=new va(this.context,e).toSeconds();return super.setRampPoint(t),this}exponentialRampTo(e,t,n){const s=new va(this.context,n).toSeconds();return super.exponentialRampTo(e,t,s),this}linearRampTo(e,t,n){const s=new va(this.context,n).toSeconds();return super.linearRampTo(e,t,s),this}targetRampTo(e,t,n){const s=new va(this.context,n).toSeconds();return super.targetRampTo(e,t,s),this}dispose(){return super.dispose(),this.context.transport.clear(this._synced),this.context.transport.off("start",this._syncedCallback),this.context.transport.off("pause",this._syncedCallback),this.context.transport.off("stop",this._syncedCallback),this._constantSource.dispose(),this}}class Pi extends Sa{constructor(){super(Rr(Pi.getDefaults(),arguments,["attack","decay","sustain","release"])),this.name="Envelope",this._sig=new Ra({context:this.context,value:0}),this.output=this._sig,this.input=void 0;const e=Rr(Pi.getDefaults(),arguments,["attack","decay","sustain","release"]);this.attack=e.attack,this.decay=e.decay,this.sustain=e.sustain,this.release=e.release,this.attackCurve=e.attackCurve,this.releaseCurve=e.releaseCurve,this.decayCurve=e.decayCurve}static getDefaults(){return Object.assign(Sa.getDefaults(),{attack:.01,attackCurve:"linear",decay:.1,decayCurve:"exponential",release:1,releaseCurve:"exponential",sustain:.5})}get value(){return this.getValueAtTime(this.now())}_getCurve(e,t){if(br(e))return e;{let n;for(n in Vi)if(Vi[n][t]===e)return n;return e}}_setCurve(e,t,n){if(br(n)&&Reflect.has(Vi,n)){const s=Vi[n];mr(s)?"_decayCurve"!==e&&(this[e]=s[t]):this[e]=s}else{if(!yr(n)||"_decayCurve"===e)throw new Error("Envelope: invalid curve: "+n);this[e]=n}}get attackCurve(){return this._getCurve(this._attackCurve,"In")}set attackCurve(e){this._setCurve("_attackCurve","In",e)}get releaseCurve(){return this._getCurve(this._releaseCurve,"Out")}set releaseCurve(e){this._setCurve("_releaseCurve","Out",e)}get decayCurve(){return this._decayCurve}set decayCurve(e){rr(["linear","exponential"].some((t=>t===e)),`Invalid envelope curve: ${e}`),this._decayCurve=e}triggerAttack(e,t=1){this.log("triggerAttack",e,t),e=this.toSeconds(e);let n=this.toSeconds(this.attack);const s=this.toSeconds(this.decay),r=this.getValueAtTime(e);if(r>0){n=(1-r)/(1/n)}if(n0){const n=this.toSeconds(this.release);n{const e=128;let t,n;const s=[];for(t=0;t{const s=e[t],r=this.context.transport.schedule((s=>{e[t]=s,n.apply(this,e)}),s);this._scheduledEvents.push(r)}}unsync(){return this._scheduledEvents.forEach((e=>this.context.transport.clear(e))),this._scheduledEvents=[],this._synced&&(this._synced=!1,this.triggerAttack=this._original_triggerAttack,this.triggerRelease=this._original_triggerRelease),this}triggerAttackRelease(e,t,n,s){const r=this.toSeconds(n),a=this.toSeconds(t);return this.triggerAttack(e,r,s),this.triggerRelease(r+a),this}dispose(){return super.dispose(),this._volume.dispose(),this.unsync(),this._scheduledEvents=[],this}}class Ui extends Wi{constructor(){super(Rr(Ui.getDefaults(),arguments));const e=Rr(Ui.getDefaults(),arguments);this.portamento=e.portamento,this.onsilence=e.onsilence}static getDefaults(){return Object.assign(Wi.getDefaults(),{detune:0,onsilence:Qr,portamento:0})}triggerAttack(e,t,n=1){this.log("triggerAttack",e,t,n);const s=this.toSeconds(t);return this._triggerEnvelopeAttack(s,n),this.setNote(e,s),this}triggerRelease(e){this.log("triggerRelease",e);const t=this.toSeconds(e);return this._triggerEnvelopeRelease(t),this}setNote(e,t){const n=this.toSeconds(t),s=e instanceof ga?e.toFrequency():e;if(this.portamento>0&&this.getLevelAtTime(n)>.05){const e=this.toSeconds(this.portamento);this.frequency.exponentialRampTo(s,e,n)}else this.frequency.setValueAtTime(s,n);return this}}Ar([Ei(0)],Ui.prototype,"portamento",void 0);class Gi extends Pi{constructor(){super(Rr(Gi.getDefaults(),arguments,["attack","decay","sustain","release"])),this.name="AmplitudeEnvelope",this._gainNode=new Ta({context:this.context,gain:0}),this.output=this._gainNode,this.input=this._gainNode,this._sig.connect(this._gainNode.gain),this.output=this._gainNode,this.input=this._gainNode}dispose(){return super.dispose(),this._gainNode.dispose(),this}}class qi extends Ui{constructor(){super(Rr(qi.getDefaults(),arguments)),this.name="Synth";const e=Rr(qi.getDefaults(),arguments);this.oscillator=new vi(Object.assign({context:this.context,detune:e.detune,onstop:()=>this.onsilence(this)},e.oscillator)),this.frequency=this.oscillator.frequency,this.detune=this.oscillator.detune,this.envelope=new Gi(Object.assign({context:this.context},e.envelope)),this.oscillator.chain(this.envelope,this.output),Zr(this,["oscillator","frequency","detune","envelope"])}static getDefaults(){return Object.assign(Ui.getDefaults(),{envelope:Object.assign(Mr(Pi.getDefaults(),Object.keys(Sa.getDefaults())),{attack:.005,decay:.1,release:1,sustain:.3}),oscillator:Object.assign(Mr(vi.getDefaults(),[...Object.keys(ei.getDefaults()),"frequency","detune"]),{type:"triangle"})})}_triggerEnvelopeAttack(e,t){if(this.envelope.triggerAttack(e,t),this.oscillator.start(e),0===this.envelope.sustain){const t=this.toSeconds(this.envelope.attack),n=this.toSeconds(this.envelope.decay);this.oscillator.stop(e+t+n)}}_triggerEnvelopeRelease(e){this.envelope.triggerRelease(e),this.oscillator.stop(e+this.toSeconds(this.envelope.release))}getLevelAtTime(e){return e=this.toSeconds(e),this.envelope.getValueAtTime(e)}dispose(){return super.dispose(),this.oscillator.dispose(),this.envelope.dispose(),this}}class ji extends Ui{constructor(){super(Rr(ji.getDefaults(),arguments)),this.name="ModulationSynth";const e=Rr(ji.getDefaults(),arguments);this._carrier=new qi({context:this.context,oscillator:e.oscillator,envelope:e.envelope,onsilence:()=>this.onsilence(this),volume:-10}),this._modulator=new qi({context:this.context,oscillator:e.modulation,envelope:e.modulationEnvelope,volume:-10}),this.oscillator=this._carrier.oscillator,this.envelope=this._carrier.envelope,this.modulation=this._modulator.oscillator,this.modulationEnvelope=this._modulator.envelope,this.frequency=new Ra({context:this.context,units:"frequency"}),this.detune=new Ra({context:this.context,value:e.detune,units:"cents"}),this.harmonicity=new pi({context:this.context,value:e.harmonicity,minValue:0}),this._modulationNode=new Ta({context:this.context,gain:0}),Zr(this,["frequency","harmonicity","oscillator","envelope","modulation","modulationEnvelope","detune"])}static getDefaults(){return Object.assign(Ui.getDefaults(),{harmonicity:3,oscillator:Object.assign(Mr(vi.getDefaults(),[...Object.keys(ei.getDefaults()),"frequency","detune"]),{type:"sine"}),envelope:Object.assign(Mr(Pi.getDefaults(),Object.keys(Sa.getDefaults())),{attack:.01,decay:.01,sustain:1,release:.5}),modulation:Object.assign(Mr(vi.getDefaults(),[...Object.keys(ei.getDefaults()),"frequency","detune"]),{type:"square"}),modulationEnvelope:Object.assign(Mr(Pi.getDefaults(),Object.keys(Sa.getDefaults())),{attack:.5,decay:0,sustain:1,release:.5})})}_triggerEnvelopeAttack(e,t){this._carrier._triggerEnvelopeAttack(e,t),this._modulator._triggerEnvelopeAttack(e,t)}_triggerEnvelopeRelease(e){return this._carrier._triggerEnvelopeRelease(e),this._modulator._triggerEnvelopeRelease(e),this}getLevelAtTime(e){return e=this.toSeconds(e),this.envelope.getValueAtTime(e)}dispose(){return super.dispose(),this._carrier.dispose(),this._modulator.dispose(),this.frequency.dispose(),this.detune.dispose(),this.harmonicity.dispose(),this._modulationNode.dispose(),this}}class Hi extends ji{constructor(){super(Rr(Hi.getDefaults(),arguments)),this.name="AMSynth",this._modulationScale=new di({context:this.context}),this.frequency.connect(this._carrier.frequency),this.frequency.chain(this.harmonicity,this._modulator.frequency),this.detune.fan(this._carrier.detune,this._modulator.detune),this._modulator.chain(this._modulationScale,this._modulationNode.gain),this._carrier.chain(this._modulationNode,this.output)}dispose(){return super.dispose(),this._modulationScale.dispose(),this}}class $i extends Sa{constructor(){super(Rr($i.getDefaults(),arguments,["frequency","type"])),this.name="BiquadFilter";const e=Rr($i.getDefaults(),arguments,["frequency","type"]);this._filter=this.context.createBiquadFilter(),this.input=this.output=this._filter,this.Q=new Ca({context:this.context,units:"number",value:e.Q,param:this._filter.Q}),this.frequency=new Ca({context:this.context,units:"frequency",value:e.frequency,param:this._filter.frequency}),this.detune=new Ca({context:this.context,units:"cents",value:e.detune,param:this._filter.detune}),this.gain=new Ca({context:this.context,units:"decibels",convert:!1,value:e.gain,param:this._filter.gain}),this.type=e.type}static getDefaults(){return Object.assign(Sa.getDefaults(),{Q:1,type:"lowpass",frequency:350,detune:0,gain:0})}get type(){return this._filter.type}set type(e){rr(-1!==["lowpass","highpass","bandpass","lowshelf","highshelf","notch","allpass","peaking"].indexOf(e),`Invalid filter type: ${e}`),this._filter.type=e}getFrequencyResponse(e=128){const t=new Float32Array(e);for(let n=0;nt.type=e))}get rolloff(){return this._rolloff}set rolloff(e){const t=fr(e)?e:parseInt(e,10),n=[-12,-24,-48,-96];let s=n.indexOf(t);rr(-1!==s,`rolloff can only be ${n.join(", ")}`),s+=1,this._rolloff=t,this.input.disconnect(),this._filters.forEach((e=>e.disconnect())),this._filters=new Array(s);for(let e=0;e1));return this._filters.forEach((()=>{t.getFrequencyResponse(e).forEach(((e,t)=>n[t]*=e))})),t.dispose(),n}dispose(){return super.dispose(),this._filters.forEach((e=>{e.dispose()})),Yr(this,["detune","frequency","gain","Q"]),this.frequency.dispose(),this.Q.dispose(),this.detune.dispose(),this.gain.dispose(),this}}class Xi extends Pi{constructor(){super(Rr(Xi.getDefaults(),arguments,["attack","decay","sustain","release"])),this.name="FrequencyEnvelope";const e=Rr(Xi.getDefaults(),arguments,["attack","decay","sustain","release"]);this._octaves=e.octaves,this._baseFrequency=this.toFrequency(e.baseFrequency),this._exponent=this.input=new Bi({context:this.context,value:e.exponent}),this._scale=this.output=new Ai({context:this.context,min:this._baseFrequency,max:this._baseFrequency*Math.pow(2,this._octaves)}),this._sig.chain(this._exponent,this._scale)}static getDefaults(){return Object.assign(Pi.getDefaults(),{baseFrequency:200,exponent:1,octaves:4})}get baseFrequency(){return this._baseFrequency}set baseFrequency(e){const t=this.toFrequency(e);ar(t,0),this._baseFrequency=t,this._scale.min=this._baseFrequency,this.octaves=this._octaves}get octaves(){return this._octaves}set octaves(e){this._octaves=e,this._scale.max=this._baseFrequency*Math.pow(2,e)}get exponent(){return this._exponent.value}set exponent(e){this._exponent.value=e}dispose(){return super.dispose(),this._exponent.dispose(),this._scale.dispose(),this}}class Zi extends Ui{constructor(){super(Rr(Zi.getDefaults(),arguments)),this.name="MonoSynth";const e=Rr(Zi.getDefaults(),arguments);this.oscillator=new vi(Object.assign(e.oscillator,{context:this.context,detune:e.detune,onstop:()=>this.onsilence(this)})),this.frequency=this.oscillator.frequency,this.detune=this.oscillator.detune,this.filter=new Ki(Object.assign(e.filter,{context:this.context})),this.filterEnvelope=new Xi(Object.assign(e.filterEnvelope,{context:this.context})),this.envelope=new Gi(Object.assign(e.envelope,{context:this.context})),this.oscillator.chain(this.filter,this.envelope,this.output),this.filterEnvelope.connect(this.filter.frequency),Zr(this,["oscillator","frequency","detune","filter","filterEnvelope","envelope"])}static getDefaults(){return Object.assign(Ui.getDefaults(),{envelope:Object.assign(Mr(Pi.getDefaults(),Object.keys(Sa.getDefaults())),{attack:.005,decay:.1,release:1,sustain:.9}),filter:Object.assign(Mr(Ki.getDefaults(),Object.keys(Sa.getDefaults())),{Q:1,rolloff:-12,type:"lowpass"}),filterEnvelope:Object.assign(Mr(Xi.getDefaults(),Object.keys(Sa.getDefaults())),{attack:.6,baseFrequency:200,decay:.2,exponent:2,octaves:3,release:2,sustain:.5}),oscillator:Object.assign(Mr(vi.getDefaults(),Object.keys(ei.getDefaults())),{type:"sawtooth"})})}_triggerEnvelopeAttack(e,t=1){if(this.envelope.triggerAttack(e,t),this.filterEnvelope.triggerAttack(e),this.oscillator.start(e),0===this.envelope.sustain){const t=this.toSeconds(this.envelope.attack),n=this.toSeconds(this.envelope.decay);this.oscillator.stop(e+t+n)}}_triggerEnvelopeRelease(e){this.envelope.triggerRelease(e),this.filterEnvelope.triggerRelease(e),this.oscillator.stop(e+this.toSeconds(this.envelope.release))}getLevelAtTime(e){return e=this.toSeconds(e),this.envelope.getValueAtTime(e)}dispose(){return super.dispose(),this.oscillator.dispose(),this.envelope.dispose(),this.filterEnvelope.dispose(),this.filter.dispose(),this}}class Yi extends Ui{constructor(){super(Rr(Yi.getDefaults(),arguments)),this.name="DuoSynth";const e=Rr(Yi.getDefaults(),arguments);this.voice0=new Zi(Object.assign(e.voice0,{context:this.context,onsilence:()=>this.onsilence(this)})),this.voice1=new Zi(Object.assign(e.voice1,{context:this.context})),this.harmonicity=new pi({context:this.context,units:"positive",value:e.harmonicity}),this._vibrato=new Ci({frequency:e.vibratoRate,context:this.context,min:-50,max:50}),this._vibrato.start(),this.vibratoRate=this._vibrato.frequency,this._vibratoGain=new Ta({context:this.context,units:"normalRange",gain:e.vibratoAmount}),this.vibratoAmount=this._vibratoGain.gain,this.frequency=new Ra({context:this.context,units:"frequency",value:440}),this.detune=new Ra({context:this.context,units:"cents",value:e.detune}),this.frequency.connect(this.voice0.frequency),this.frequency.chain(this.harmonicity,this.voice1.frequency),this._vibrato.connect(this._vibratoGain),this._vibratoGain.fan(this.voice0.detune,this.voice1.detune),this.detune.fan(this.voice0.detune,this.voice1.detune),this.voice0.connect(this.output),this.voice1.connect(this.output),Zr(this,["voice0","voice1","frequency","vibratoAmount","vibratoRate"])}getLevelAtTime(e){return e=this.toSeconds(e),this.voice0.envelope.getValueAtTime(e)+this.voice1.envelope.getValueAtTime(e)}static getDefaults(){return Or(Ui.getDefaults(),{vibratoAmount:.5,vibratoRate:5,harmonicity:1.5,voice0:Or(Mr(Zi.getDefaults(),Object.keys(Ui.getDefaults())),{filterEnvelope:{attack:.01,decay:0,sustain:1,release:.5},envelope:{attack:.01,decay:0,sustain:1,release:.5}}),voice1:Or(Mr(Zi.getDefaults(),Object.keys(Ui.getDefaults())),{filterEnvelope:{attack:.01,decay:0,sustain:1,release:.5},envelope:{attack:.01,decay:0,sustain:1,release:.5}})})}_triggerEnvelopeAttack(e,t){this.voice0._triggerEnvelopeAttack(e,t),this.voice1._triggerEnvelopeAttack(e,t)}_triggerEnvelopeRelease(e){return this.voice0._triggerEnvelopeRelease(e),this.voice1._triggerEnvelopeRelease(e),this}dispose(){return super.dispose(),this.voice0.dispose(),this.voice1.dispose(),this.frequency.dispose(),this.detune.dispose(),this._vibrato.dispose(),this.vibratoRate.dispose(),this._vibratoGain.dispose(),this.harmonicity.dispose(),this}}class Qi extends ji{constructor(){super(Rr(Qi.getDefaults(),arguments)),this.name="FMSynth";const e=Rr(Qi.getDefaults(),arguments);this.modulationIndex=new pi({context:this.context,value:e.modulationIndex}),this.frequency.connect(this._carrier.frequency),this.frequency.chain(this.harmonicity,this._modulator.frequency),this.frequency.chain(this.modulationIndex,this._modulationNode),this.detune.fan(this._carrier.detune,this._modulator.detune),this._modulator.connect(this._modulationNode.gain),this._modulationNode.connect(this._carrier.frequency),this._carrier.connect(this.output)}static getDefaults(){return Object.assign(ji.getDefaults(),{modulationIndex:10})}dispose(){return super.dispose(),this.modulationIndex.dispose(),this}}const Ji=[1,1.483,1.932,2.546,2.63,3.897];class eo extends Ui{constructor(){super(Rr(eo.getDefaults(),arguments)),this.name="MetalSynth",this._oscillators=[],this._freqMultipliers=[];const e=Rr(eo.getDefaults(),arguments);this.detune=new Ra({context:this.context,units:"cents",value:e.detune}),this.frequency=new Ra({context:this.context,units:"frequency"}),this._amplitude=new Ta({context:this.context,gain:0}).connect(this.output),this._highpass=new Ki({Q:0,context:this.context,type:"highpass"}).connect(this._amplitude);for(let t=0;tthis.onsilence(this):Qr,type:"square"});n.connect(this._highpass),this._oscillators[t]=n;const s=new pi({context:this.context,value:Ji[t]});this._freqMultipliers[t]=s,this.frequency.chain(s,n.frequency),this.detune.connect(n.detune)}this._filterFreqScaler=new Ai({context:this.context,max:7e3,min:this.toFrequency(e.resonance)}),this.envelope=new Pi({attack:e.envelope.attack,attackCurve:"linear",context:this.context,decay:e.envelope.decay,release:e.envelope.release,sustain:0}),this.envelope.chain(this._filterFreqScaler,this._highpass.frequency),this.envelope.connect(this._amplitude.gain),this._octaves=e.octaves,this.octaves=e.octaves}static getDefaults(){return Or(Ui.getDefaults(),{envelope:Object.assign(Mr(Pi.getDefaults(),Object.keys(Sa.getDefaults())),{attack:.001,decay:1.4,release:.2}),harmonicity:5.1,modulationIndex:32,octaves:1.5,resonance:4e3})}_triggerEnvelopeAttack(e,t=1){return this.envelope.triggerAttack(e,t),this._oscillators.forEach((t=>t.start(e))),0===this.envelope.sustain&&this._oscillators.forEach((t=>{t.stop(e+this.toSeconds(this.envelope.attack)+this.toSeconds(this.envelope.decay))})),this}_triggerEnvelopeRelease(e){return this.envelope.triggerRelease(e),this._oscillators.forEach((t=>t.stop(e+this.toSeconds(this.envelope.release)))),this}getLevelAtTime(e){return e=this.toSeconds(e),this.envelope.getValueAtTime(e)}get modulationIndex(){return this._oscillators[0].modulationIndex.value}set modulationIndex(e){this._oscillators.forEach((t=>t.modulationIndex.value=e))}get harmonicity(){return this._oscillators[0].harmonicity.value}set harmonicity(e){this._oscillators.forEach((t=>t.harmonicity.value=e))}get resonance(){return this._filterFreqScaler.min}set resonance(e){this._filterFreqScaler.min=this.toFrequency(e),this.octaves=this._octaves}get octaves(){return this._octaves}set octaves(e){this._octaves=e,this._filterFreqScaler.max=this._filterFreqScaler.min*Math.pow(2,e)}dispose(){return super.dispose(),this._oscillators.forEach((e=>e.dispose())),this._freqMultipliers.forEach((e=>e.dispose())),this.frequency.dispose(),this.detune.dispose(),this._filterFreqScaler.dispose(),this._amplitude.dispose(),this.envelope.dispose(),this._highpass.dispose(),this}}class to extends qi{constructor(){super(Rr(to.getDefaults(),arguments)),this.name="MembraneSynth",this.portamento=0;const e=Rr(to.getDefaults(),arguments);this.pitchDecay=e.pitchDecay,this.octaves=e.octaves,Zr(this,["oscillator","envelope"])}static getDefaults(){return Or(Ui.getDefaults(),qi.getDefaults(),{envelope:{attack:.001,attackCurve:"exponential",decay:.4,release:1.4,sustain:.01},octaves:10,oscillator:{type:"sine"},pitchDecay:.05})}setNote(e,t){const n=this.toSeconds(t),s=this.toFrequency(e instanceof ga?e.toFrequency():e),r=s*this.octaves;return this.oscillator.frequency.setValueAtTime(r,n),this.oscillator.frequency.exponentialRampToValueAtTime(s,n+this.toSeconds(this.pitchDecay)),this}dispose(){return super.dispose(),this}}Ar([Si(0)],to.prototype,"octaves",void 0),Ar([Ei(0)],to.prototype,"pitchDecay",void 0);class no extends Wi{constructor(){super(Rr(no.getDefaults(),arguments)),this.name="NoiseSynth";const e=Rr(no.getDefaults(),arguments);this.noise=new ni(Object.assign({context:this.context},e.noise)),this.envelope=new Gi(Object.assign({context:this.context},e.envelope)),this.noise.chain(this.envelope,this.output)}static getDefaults(){return Object.assign(Wi.getDefaults(),{envelope:Object.assign(Mr(Pi.getDefaults(),Object.keys(Sa.getDefaults())),{decay:.1,sustain:0}),noise:Object.assign(Mr(ni.getDefaults(),Object.keys(ei.getDefaults())),{type:"white"})})}triggerAttack(e,t=1){return e=this.toSeconds(e),this.envelope.triggerAttack(e,t),this.noise.start(e),0===this.envelope.sustain&&this.noise.stop(e+this.toSeconds(this.envelope.attack)+this.toSeconds(this.envelope.decay)),this}triggerRelease(e){return e=this.toSeconds(e),this.envelope.triggerRelease(e),this.noise.stop(e+this.toSeconds(this.envelope.release)),this}sync(){return this._syncState()&&(this._syncMethod("triggerAttack",0),this._syncMethod("triggerRelease",0)),this}triggerAttackRelease(e,t,n=1){return t=this.toSeconds(t),e=this.toSeconds(e),this.triggerAttack(t,n),this.triggerRelease(t+e),this}dispose(){return super.dispose(),this.noise.dispose(),this.envelope.dispose(),this}}const so=new Set;function ro(e){so.add(e)}function ao(e,t){const n=`registerProcessor("${e}", ${t})`;so.add(n)}class io extends Sa{constructor(e){super(e),this.name="ToneAudioWorklet",this.workletOptions={},this.onprocessorerror=Qr;const t=URL.createObjectURL(new Blob([Array.from(so).join("\n")],{type:"text/javascript"})),n=this._audioWorkletName();this._dummyGain=this.context.createGain(),this._dummyParam=this._dummyGain.gain,this.context.addAudioWorkletModule(t,n).then((()=>{this.disposed||(this._worklet=this.context.createAudioWorkletNode(n,this.workletOptions),this._worklet.onprocessorerror=this.onprocessorerror.bind(this),this.onReady(this._worklet))}))}dispose(){return super.dispose(),this._dummyGain.disconnect(),this._worklet&&(this._worklet.port.postMessage("dispose"),this._worklet.disconnect()),this}}ro('\n\t/**\n\t * The base AudioWorkletProcessor for use in Tone.js. Works with the [[ToneAudioWorklet]]. \n\t */\n\tclass ToneAudioWorkletProcessor extends AudioWorkletProcessor {\n\n\t\tconstructor(options) {\n\t\t\t\n\t\t\tsuper(options);\n\t\t\t/**\n\t\t\t * If the processor was disposed or not. Keep alive until it\'s disposed.\n\t\t\t */\n\t\t\tthis.disposed = false;\n\t\t \t/** \n\t\t\t * The number of samples in the processing block\n\t\t\t */\n\t\t\tthis.blockSize = 128;\n\t\t\t/**\n\t\t\t * the sample rate\n\t\t\t */\n\t\t\tthis.sampleRate = sampleRate;\n\n\t\t\tthis.port.onmessage = (event) => {\n\t\t\t\t// when it receives a dispose \n\t\t\t\tif (event.data === "dispose") {\n\t\t\t\t\tthis.disposed = true;\n\t\t\t\t}\n\t\t\t};\n\t\t}\n\t}\n');ro("\n\t/**\n\t * Abstract class for a single input/output processor. \n\t * has a 'generate' function which processes one sample at a time\n\t */\n\tclass SingleIOProcessor extends ToneAudioWorkletProcessor {\n\n\t\tconstructor(options) {\n\t\t\tsuper(Object.assign(options, {\n\t\t\t\tnumberOfInputs: 1,\n\t\t\t\tnumberOfOutputs: 1\n\t\t\t}));\n\t\t\t/**\n\t\t\t * Holds the name of the parameter and a single value of that\n\t\t\t * parameter at the current sample\n\t\t\t * @type { [name: string]: number }\n\t\t\t */\n\t\t\tthis.params = {}\n\t\t}\n\n\t\t/**\n\t\t * Generate an output sample from the input sample and parameters\n\t\t * @abstract\n\t\t * @param input number\n\t\t * @param channel number\n\t\t * @param parameters { [name: string]: number }\n\t\t * @returns number\n\t\t */\n\t\tgenerate(){}\n\n\t\t/**\n\t\t * Update the private params object with the \n\t\t * values of the parameters at the given index\n\t\t * @param parameters { [name: string]: Float32Array },\n\t\t * @param index number\n\t\t */\n\t\tupdateParams(parameters, index) {\n\t\t\tfor (const paramName in parameters) {\n\t\t\t\tconst param = parameters[paramName];\n\t\t\t\tif (param.length > 1) {\n\t\t\t\t\tthis.params[paramName] = parameters[paramName][index];\n\t\t\t\t} else {\n\t\t\t\t\tthis.params[paramName] = parameters[paramName][0];\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * Process a single frame of the audio\n\t\t * @param inputs Float32Array[][]\n\t\t * @param outputs Float32Array[][]\n\t\t */\n\t\tprocess(inputs, outputs, parameters) {\n\t\t\tconst input = inputs[0];\n\t\t\tconst output = outputs[0];\n\t\t\t// get the parameter values\n\t\t\tconst channelCount = Math.max(input && input.length || 0, output.length);\n\t\t\tfor (let sample = 0; sample < this.blockSize; sample++) {\n\t\t\t\tthis.updateParams(parameters, sample);\n\t\t\t\tfor (let channel = 0; channel < channelCount; channel++) {\n\t\t\t\t\tconst inputSample = input && input.length ? input[channel][sample] : 0;\n\t\t\t\t\toutput[channel][sample] = this.generate(inputSample, channel, this.params);\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn !this.disposed;\n\t\t}\n\t};\n");ro("\n\t/**\n\t * A multichannel buffer for use within an AudioWorkletProcessor as a delay line\n\t */\n\tclass DelayLine {\n\t\t\n\t\tconstructor(size, channels) {\n\t\t\tthis.buffer = [];\n\t\t\tthis.writeHead = []\n\t\t\tthis.size = size;\n\n\t\t\t// create the empty channels\n\t\t\tfor (let i = 0; i < channels; i++) {\n\t\t\t\tthis.buffer[i] = new Float32Array(this.size);\n\t\t\t\tthis.writeHead[i] = 0;\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * Push a value onto the end\n\t\t * @param channel number\n\t\t * @param value number\n\t\t */\n\t\tpush(channel, value) {\n\t\t\tthis.writeHead[channel] += 1;\n\t\t\tif (this.writeHead[channel] > this.size) {\n\t\t\t\tthis.writeHead[channel] = 0;\n\t\t\t}\n\t\t\tthis.buffer[channel][this.writeHead[channel]] = value;\n\t\t}\n\n\t\t/**\n\t\t * Get the recorded value of the channel given the delay\n\t\t * @param channel number\n\t\t * @param delay number delay samples\n\t\t */\n\t\tget(channel, delay) {\n\t\t\tlet readHead = this.writeHead[channel] - Math.floor(delay);\n\t\t\tif (readHead < 0) {\n\t\t\t\treadHead += this.size;\n\t\t\t}\n\t\t\treturn this.buffer[channel][readHead];\n\t\t}\n\t}\n");const oo="feedback-comb-filter";ao(oo,'\n\tclass FeedbackCombFilterWorklet extends SingleIOProcessor {\n\n\t\tconstructor(options) {\n\t\t\tsuper(options);\n\t\t\tthis.delayLine = new DelayLine(this.sampleRate, options.channelCount || 2);\n\t\t}\n\n\t\tstatic get parameterDescriptors() {\n\t\t\treturn [{\n\t\t\t\tname: "delayTime",\n\t\t\t\tdefaultValue: 0.1,\n\t\t\t\tminValue: 0,\n\t\t\t\tmaxValue: 1,\n\t\t\t\tautomationRate: "k-rate"\n\t\t\t}, {\n\t\t\t\tname: "feedback",\n\t\t\t\tdefaultValue: 0.5,\n\t\t\t\tminValue: 0,\n\t\t\t\tmaxValue: 0.9999,\n\t\t\t\tautomationRate: "k-rate"\n\t\t\t}];\n\t\t}\n\n\t\tgenerate(input, channel, parameters) {\n\t\t\tconst delayedSample = this.delayLine.get(channel, parameters.delayTime * this.sampleRate);\n\t\t\tthis.delayLine.push(channel, input + delayedSample * parameters.feedback);\n\t\t\treturn delayedSample;\n\t\t}\n\t}\n');class lo extends io{constructor(){super(Rr(lo.getDefaults(),arguments,["delayTime","resonance"])),this.name="FeedbackCombFilter";const e=Rr(lo.getDefaults(),arguments,["delayTime","resonance"]);this.input=new Ta({context:this.context}),this.output=new Ta({context:this.context}),this.delayTime=new Ca({context:this.context,value:e.delayTime,units:"time",minValue:0,maxValue:1,param:this._dummyParam,swappable:!0}),this.resonance=new Ca({context:this.context,value:e.resonance,units:"normalRange",param:this._dummyParam,swappable:!0}),Zr(this,["resonance","delayTime"])}_audioWorkletName(){return oo}static getDefaults(){return Object.assign(Sa.getDefaults(),{delayTime:.1,resonance:.5})}onReady(e){Ea(this.input,e,this.output);const t=e.parameters.get("delayTime");this.delayTime.setParam(t);const n=e.parameters.get("feedback");this.resonance.setParam(n)}dispose(){return super.dispose(),this.input.dispose(),this.output.dispose(),this.delayTime.dispose(),this.resonance.dispose(),this}}class uo extends Sa{constructor(){super(Rr(uo.getDefaults(),arguments,["frequency","type"])),this.name="OnePoleFilter";const e=Rr(uo.getDefaults(),arguments,["frequency","type"]);this._frequency=e.frequency,this._type=e.type,this.input=new Ta({context:this.context}),this.output=new Ta({context:this.context}),this._createFilter()}static getDefaults(){return Object.assign(Sa.getDefaults(),{frequency:880,type:"lowpass"})}_createFilter(){const e=this._filter,t=this.toFrequency(this._frequency),n=1/(2*Math.PI*t);if("lowpass"===this._type){const e=1/(n*this.context.sampleRate),t=e-1;this._filter=this.context.createIIRFilter([e,0],[1,t])}else{const e=1/(n*this.context.sampleRate)-1;this._filter=this.context.createIIRFilter([1,-1],[1,e])}this.input.chain(this._filter,this.output),e&&this.context.setTimeout((()=>{this.disposed||(this.input.disconnect(e),e.disconnect())}),this.blockTime)}get frequency(){return this._frequency}set frequency(e){this._frequency=e,this._createFilter()}get type(){return this._type}set type(e){this._type=e,this._createFilter()}getFrequencyResponse(e=128){const t=new Float32Array(e);for(let n=0;nt.voice===e));this._activeVoices.splice(t,1)}_getNextAvailableVoice(){if(this._availableVoices.length)return this._availableVoices.shift();if(this._voices.lengthMath.ceil(this._averageActiveVoices+1)){const e=this._availableVoices.shift(),t=this._voices.indexOf(e);this._voices.splice(t,1),this.context.isOffline||e.dispose()}}_triggerAttack(e,t,n){e.forEach((e=>{const s=new Wa(this.context,e).toMidi(),r=this._getNextAvailableVoice();r&&(r.triggerAttack(e,t,n),this._activeVoices.push({midi:s,voice:r,released:!1}),this.log("triggerAttack",e,t))}))}_triggerRelease(e,t){e.forEach((e=>{const n=new Wa(this.context,e).toMidi(),s=this._activeVoices.find((({midi:e,released:t})=>e===n&&!t));s&&(s.voice.triggerRelease(t),s.released=!0,this.log("triggerRelease",e,t))}))}_scheduleEvent(e,t,n,s){rr(!this.disposed,"Synth was already disposed"),n<=this.now()?"attack"===e?this._triggerAttack(t,n,s):this._triggerRelease(t,n):this.context.setTimeout((()=>{this._scheduleEvent(e,t,n,s)}),n-this.now())}triggerAttack(e,t,n){Array.isArray(e)||(e=[e]);const s=this.toSeconds(t);return this._scheduleEvent("attack",e,s,n),this}triggerRelease(e,t){Array.isArray(e)||(e=[e]);const n=this.toSeconds(t);return this._scheduleEvent("release",e,n),this}triggerAttackRelease(e,t,n,s){const r=this.toSeconds(n);if(this.triggerAttack(e,r,s),yr(t)){rr(yr(e),"If the duration is an array, the notes must also be an array");for(let n=0;n0,"The duration must be greater than 0"),this.triggerRelease(e[n],r+a)}}else{const n=this.toSeconds(t);rr(n>0,"The duration must be greater than 0"),this.triggerRelease(e,r+n)}return this}sync(){return this._syncState()&&(this._syncMethod("triggerAttack",1),this._syncMethod("triggerRelease",1)),this}set(e){const t=Mr(e,["onsilence","context"]);return this.options=Or(this.options,t),this._voices.forEach((e=>e.set(t))),this._dummyVoice.set(t),this}get(){return this._dummyVoice.get()}releaseAll(e){const t=this.toSeconds(e);return this._activeVoices.forEach((({voice:e})=>{e.triggerRelease(t)})),this}dispose(){return super.dispose(),this._dummyVoice.dispose(),this._voices.forEach((e=>e.dispose())),this._activeVoices=[],this._availableVoices=[],this.context.clearInterval(this._gcTimeout),this}}class fo extends Wi{constructor(){super(Rr(fo.getDefaults(),arguments,["urls","onload","baseUrl"],"urls")),this.name="Sampler",this._activeSources=new Map;const e=Rr(fo.getDefaults(),arguments,["urls","onload","baseUrl"],"urls"),t={};Object.keys(e.urls).forEach((n=>{const s=parseInt(n,10);if(rr(wr(n)||fr(s)&&isFinite(s),`url key is neither a note or midi pitch: ${n}`),wr(n)){const s=new ga(this.context,n).toMidi();t[s]=e.urls[n]}else fr(s)&&isFinite(s)&&(t[s]=e.urls[s])})),this._buffers=new Va({urls:t,onload:e.onload,baseUrl:e.baseUrl,onerror:e.onerror}),this.attack=e.attack,this.release=e.release,this.curve=e.curve,this._buffers.loaded&&Promise.resolve().then(e.onload)}static getDefaults(){return Object.assign(Wi.getDefaults(),{attack:0,baseUrl:"",curve:"exponential",onload:Qr,onerror:Qr,release:.1,urls:{}})}_findClosest(e){let t=0;for(;t<96;){if(this._buffers.has(e+t))return-t;if(this._buffers.has(e-t))return t;t++}throw new Error(`No available buffers for note: ${e}`)}triggerAttack(e,t,n=1){return this.log("triggerAttack",e,t,n),Array.isArray(e)||(e=[e]),e.forEach((e=>{const s=ha(new ga(this.context,e).toFrequency()),r=Math.round(s),a=s-r,i=this._findClosest(r),o=r-i,l=this._buffers.get(o),u=la(i+a),c=new ti({url:l,context:this.context,curve:this.curve,fadeIn:this.attack,fadeOut:this.release,playbackRate:u}).connect(this.output);c.start(t,0,l.duration/u,n),yr(this._activeSources.get(r))||this._activeSources.set(r,[]),this._activeSources.get(r).push(c),c.onended=()=>{if(this._activeSources&&this._activeSources.has(r)){const e=this._activeSources.get(r),t=e.indexOf(c);-1!==t&&e.splice(t,1)}}})),this}triggerRelease(e,t){return this.log("triggerRelease",e,t),Array.isArray(e)||(e=[e]),e.forEach((e=>{const n=new ga(this.context,e).toMidi();if(this._activeSources.has(n)&&this._activeSources.get(n).length){const e=this._activeSources.get(n);t=this.toSeconds(t),e.forEach((e=>{e.stop(t)})),this._activeSources.set(n,[])}})),this}releaseAll(e){const t=this.toSeconds(e);return this._activeSources.forEach((e=>{for(;e.length;){e.shift().stop(t)}})),this}sync(){return this._syncState()&&(this._syncMethod("triggerAttack",1),this._syncMethod("triggerRelease",1)),this}triggerAttackRelease(e,t,n,s=1){const r=this.toSeconds(n);return this.triggerAttack(e,r,s),yr(t)?(rr(yr(e),"notes must be an array when duration is array"),e.forEach(((e,n)=>{const s=t[Math.min(n,t.length-1)];this.triggerRelease(e,r+this.toSeconds(s))}))):this.triggerRelease(e,r+this.toSeconds(t)),this}add(e,t,n){if(rr(wr(e)||isFinite(e),`note must be a pitch or midi: ${e}`),wr(e)){const s=new ga(this.context,e).toMidi();this._buffers.add(s,t,n)}else this._buffers.add(e,t,n);return this}get loaded(){return this._buffers.loaded}dispose(){return super.dispose(),this._buffers.dispose(),this._activeSources.forEach((e=>{e.forEach((e=>e.dispose()))})),this._activeSources.clear(),this}}Ar([Ei(0)],fo.prototype,"attack",void 0),Ar([Ei(0)],fo.prototype,"release",void 0);class mo extends Aa{constructor(){super(Rr(mo.getDefaults(),arguments,["callback","value"])),this.name="ToneEvent",this._state=new ka("stopped"),this._startOffset=0;const e=Rr(mo.getDefaults(),arguments,["callback","value"]);this._loop=e.loop,this.callback=e.callback,this.value=e.value,this._loopStart=this.toTicks(e.loopStart),this._loopEnd=this.toTicks(e.loopEnd),this._playbackRate=e.playbackRate,this._probability=e.probability,this._humanize=e.humanize,this.mute=e.mute,this._playbackRate=e.playbackRate,this._state.increasing=!0,this._rescheduleEvents()}static getDefaults(){return Object.assign(Aa.getDefaults(),{callback:Qr,humanize:!1,loop:!1,loopEnd:"1m",loopStart:0,mute:!1,playbackRate:1,probability:1,value:null})}_rescheduleEvents(e=-1){this._state.forEachFrom(e,(e=>{let t;if("started"===e.state){-1!==e.id&&this.context.transport.clear(e.id);const n=e.time+Math.round(this.startOffset/this._playbackRate);if(!0===this._loop||fr(this._loop)&&this._loop>1){t=1/0,fr(this._loop)&&(t=this._loop*this._getLoopDuration());const s=this._state.getAfter(n);null!==s&&(t=Math.min(t,s.time-n)),t!==1/0&&(this._state.setStateAtTime("stopped",n+t+1,{id:-1}),t=new Ga(this.context,t));const r=new Ga(this.context,this._getLoopDuration());e.id=this.context.transport.scheduleRepeat(this._tick.bind(this),r,new Ga(this.context,n),t)}else e.id=this.context.transport.schedule(this._tick.bind(this),new Ga(this.context,n))}}))}get state(){return this._state.getValueAtTime(this.context.transport.ticks)}get startOffset(){return this._startOffset}set startOffset(e){this._startOffset=e}get probability(){return this._probability}set probability(e){this._probability=e}get humanize(){return this._humanize}set humanize(e){this._humanize=e}start(e){const t=this.toTicks(e);return"stopped"===this._state.getValueAtTime(t)&&(this._state.add({id:-1,state:"started",time:t}),this._rescheduleEvents(t)),this}stop(e){this.cancel(e);const t=this.toTicks(e);if("started"===this._state.getValueAtTime(t)){this._state.setStateAtTime("stopped",t,{id:-1});const e=this._state.getBefore(t);let n=t;null!==e&&(n=e.time),this._rescheduleEvents(n)}return this}cancel(e){e=Dr(e,-1/0);const t=this.toTicks(e);return this._state.forEachFrom(t,(e=>{this.context.transport.clear(e.id)})),this._state.cancel(t),this}_tick(e){const t=this.context.transport.getTicksAtTime(e);if(!this.mute&&"started"===this._state.getValueAtTime(t)){if(this.probability<1&&Math.random()>this.probability)return;if(this.humanize){let t=.02;gr(this.humanize)||(t=this.toSeconds(this.humanize)),e+=(2*Math.random()-1)*t}this.callback(e,this.value)}}_getLoopDuration(){return Math.round((this._loopEnd-this._loopStart)/this._playbackRate)}get loop(){return this._loop}set loop(e){this._loop=e,this._rescheduleEvents()}get playbackRate(){return this._playbackRate}set playbackRate(e){this._playbackRate=e,this._rescheduleEvents()}get loopEnd(){return new Ga(this.context,this._loopEnd).toSeconds()}set loopEnd(e){this._loopEnd=this.toTicks(e),this._loop&&this._rescheduleEvents()}get loopStart(){return new Ga(this.context,this._loopStart).toSeconds()}set loopStart(e){this._loopStart=this.toTicks(e),this._loop&&this._rescheduleEvents()}get progress(){if(this._loop){const e=this.context.transport.ticks,t=this._state.get(e);if(null!==t&&"started"===t.state){const n=this._getLoopDuration();return(e-t.time)%n/n}return 0}return 0}dispose(){return super.dispose(),this.cancel(),this._state.dispose(),this}}class go extends Aa{constructor(){super(Rr(go.getDefaults(),arguments,["callback","interval"])),this.name="Loop";const e=Rr(go.getDefaults(),arguments,["callback","interval"]);this._event=new mo({context:this.context,callback:this._tick.bind(this),loop:!0,loopEnd:e.interval,playbackRate:e.playbackRate,probability:e.probability}),this.callback=e.callback,this.iterations=e.iterations}static getDefaults(){return Object.assign(Aa.getDefaults(),{interval:"4n",callback:Qr,playbackRate:1,iterations:1/0,probability:1,mute:!1,humanize:!1})}start(e){return this._event.start(e),this}stop(e){return this._event.stop(e),this}cancel(e){return this._event.cancel(e),this}_tick(e){this.callback(e)}get state(){return this._event.state}get progress(){return this._event.progress}get interval(){return this._event.loopEnd}set interval(e){this._event.loopEnd=e}get playbackRate(){return this._event.playbackRate}set playbackRate(e){this._event.playbackRate=e}get humanize(){return this._event.humanize}set humanize(e){this._event.humanize=e}get probability(){return this._event.probability}set probability(e){this._event.probability=e}get mute(){return this._event.mute}set mute(e){this._event.mute=e}get iterations(){return!0===this._event.loop?1/0:this._event.loop}set iterations(e){this._event.loop=e===1/0||e}dispose(){return super.dispose(),this._event.dispose(),this}}class yo extends mo{constructor(){super(Rr(yo.getDefaults(),arguments,["callback","events"])),this.name="Part",this._state=new ka("stopped"),this._events=new Set;const e=Rr(yo.getDefaults(),arguments,["callback","events"]);this._state.increasing=!0,e.events.forEach((e=>{yr(e)?this.add(e[0],e[1]):this.add(e)}))}static getDefaults(){return Object.assign(mo.getDefaults(),{events:[]})}start(e,t){const n=this.toTicks(e);if("started"!==this._state.getValueAtTime(n)){t=Dr(t,this._loop?this._loopStart:0),t=this._loop?Dr(t,this._loopStart):Dr(t,0);const e=this.toTicks(t);this._state.add({id:-1,offset:e,state:"started",time:n}),this._forEach((t=>{this._startNote(t,n,e)}))}return this}_startNote(e,t,n){t-=n,this._loop?e.startOffset>=this._loopStart&&e.startOffset=n&&(e.loop=!1,e.start(new Ga(this.context,t))):e.startOffset>=n&&e.start(new Ga(this.context,t))}get startOffset(){return this._startOffset}set startOffset(e){this._startOffset=e,this._forEach((e=>{e.startOffset+=this._startOffset}))}stop(e){const t=this.toTicks(e);return this._state.cancel(t),this._state.setStateAtTime("stopped",t),this._forEach((t=>{t.stop(e)})),this}at(e,t){const n=new va(this.context,e).toTicks(),s=new Ga(this.context,1).toSeconds(),r=this._events.values();let a=r.next();for(;!a.done;){const e=a.value;if(Math.abs(n-e.startOffset){"started"===t.state?this._startNote(e,t.time,t.offset):e.stop(new Ga(this.context,t.time))}))}remove(e,t){return mr(e)&&e.hasOwnProperty("time")&&(e=(t=e).time),e=this.toTicks(e),this._events.forEach((n=>{n.startOffset===e&&(hr(t)||dr(t)&&n.value===t)&&(this._events.delete(n),n.dispose())})),this}clear(){return this._forEach((e=>e.dispose())),this._events.clear(),this}cancel(e){return this._forEach((t=>t.cancel(e))),this._state.cancel(this.toTicks(e)),this}_forEach(e){return this._events&&this._events.forEach((t=>{t instanceof yo?t._forEach(e):e(t)})),this}_setAll(e,t){this._forEach((n=>{n[e]=t}))}_tick(e,t){this.mute||this.callback(e,t)}_testLoopBoundries(e){this._loop&&(e.startOffset=this._loopEnd)?e.cancel(0):"stopped"===e.state&&this._restartEvent(e)}get probability(){return this._probability}set probability(e){this._probability=e,this._setAll("probability",e)}get humanize(){return this._humanize}set humanize(e){this._humanize=e,this._setAll("humanize",e)}get loop(){return this._loop}set loop(e){this._loop=e,this._forEach((t=>{t.loopStart=this.loopStart,t.loopEnd=this.loopEnd,t.loop=e,this._testLoopBoundries(t)}))}get loopEnd(){return new Ga(this.context,this._loopEnd).toSeconds()}set loopEnd(e){this._loopEnd=this.toTicks(e),this._loop&&this._forEach((t=>{t.loopEnd=e,this._testLoopBoundries(t)}))}get loopStart(){return new Ga(this.context,this._loopStart).toSeconds()}set loopStart(e){this._loopStart=this.toTicks(e),this._loop&&this._forEach((e=>{e.loopStart=this.loopStart,this._testLoopBoundries(e)}))}get playbackRate(){return this._playbackRate}set playbackRate(e){this._playbackRate=e,this._setAll("playbackRate",e)}get length(){return this._events.size}dispose(){return super.dispose(),this.clear(),this}}function*bo(e){let t=0;for(;t=0;)t=xo(t,e),yield e[t],t--}function*vo(e,t){for(;;)yield*t(e)}function xo(e,t){return Wr(e,0,t.length-1)}function*Ao(e,t){let n=t?0:e.length-1;for(;;)n=xo(n,e),yield e[n],t?(n++,n>=e.length-1&&(t=!1)):(n--,n<=0&&(t=!0))}function*ko(e){let t=0,n=0;for(;t=0;)t=xo(t,e),yield e[t],n++,t+=n%2?-2:1}function*So(e){const t=[];for(let n=0;n0;){const n=xo(t.splice(Math.floor(t.length*Math.random()),1)[0],e);yield e[n]}}function*Eo(e,t="up",n=0){switch(rr(e.length>0,"The array must have more than one value in it"),t){case"up":yield*vo(e,bo);case"down":yield*vo(e,wo);case"upDown":yield*Ao(e,!0);case"downUp":yield*Ao(e,!1);case"alternateUp":yield*vo(e,ko);case"alternateDown":yield*vo(e,Co);case"random":yield*function*(e){for(;;){const t=Math.floor(Math.random()*e.length);yield e[t]}}(e);case"randomOnce":yield*vo(e,So);case"randomWalk":yield*function*(e){let t=Math.floor(Math.random()*e.length);for(;;)0===t?t++:t===e.length-1||Math.random()<.5?t--:t++,yield e[t]}(e)}}class _o extends go{constructor(){super(Rr(_o.getDefaults(),arguments,["callback","values","pattern"])),this.name="Pattern";const e=Rr(_o.getDefaults(),arguments,["callback","values","pattern"]);this.callback=e.callback,this._values=e.values,this._pattern=Eo(e.values,e.pattern),this._type=e.pattern}static getDefaults(){return Object.assign(go.getDefaults(),{pattern:"up",values:[],callback:Qr})}_tick(e){const t=this._pattern.next();this._value=t.value,this.callback(e,this._value)}get values(){return this._values}set values(e){this._values=e,this.pattern=this._type}get value(){return this._value}get pattern(){return this._type}set pattern(e){this._type=e,this._pattern=Eo(this._values,this._type)}}class Io extends mo{constructor(){super(Rr(Io.getDefaults(),arguments,["callback","events","subdivision"])),this.name="Sequence",this._part=new yo({callback:this._seqCallback.bind(this),context:this.context}),this._events=[],this._eventsArray=[];const e=Rr(Io.getDefaults(),arguments,["callback","events","subdivision"]);this._subdivision=this.toTicks(e.subdivision),this.events=e.events,this.loop=e.loop,this.loopStart=e.loopStart,this.loopEnd=e.loopEnd,this.playbackRate=e.playbackRate,this.probability=e.probability,this.humanize=e.humanize,this.mute=e.mute,this.playbackRate=e.playbackRate}static getDefaults(){return Object.assign(Mr(mo.getDefaults(),["value"]),{events:[],loop:!0,loopEnd:0,loopStart:0,subdivision:"8n"})}_seqCallback(e,t){null!==t&&this.callback(e,t)}get events(){return this._events}set events(e){this.clear(),this._eventsArray=e,this._events=this._createSequence(this._eventsArray),this._eventsUpdated()}start(e,t){return this._part.start(e,t?this._indexTime(t):t),this}stop(e){return this._part.stop(e),this}get subdivision(){return new Ga(this.context,this._subdivision).toSeconds()}_createSequence(e){return new Proxy(e,{get:(e,t)=>e[t],set:(e,t,n)=>(br(t)&&isFinite(parseInt(t,10))&&yr(n)?e[t]=this._createSequence(n):e[t]=n,this._eventsUpdated(),!0)})}_eventsUpdated(){this._part.clear(),this._rescheduleSequence(this._eventsArray,this._subdivision,this.startOffset),this.loopEnd=this.loopEnd}_rescheduleSequence(e,t,n){e.forEach(((e,s)=>{const r=s*t+n;if(yr(e))this._rescheduleSequence(e,t/e.length,r);else{const t=new Ga(this.context,r,"i").toSeconds();this._part.add(t,e)}}))}_indexTime(e){return new Ga(this.context,e*this._subdivision+this.startOffset).toSeconds()}clear(){return this._part.clear(),this}dispose(){return super.dispose(),this._part.dispose(),this}get loop(){return this._part.loop}set loop(e){this._part.loop=e}get loopStart(){return this._loopStart}set loopStart(e){this._loopStart=e,this._part.loopStart=this._indexTime(e)}get loopEnd(){return this._loopEnd}set loopEnd(e){this._loopEnd=e,this._part.loopEnd=0===e?this._indexTime(this._eventsArray.length):this._indexTime(e)}get startOffset(){return this._part.startOffset}set startOffset(e){this._part.startOffset=e}get playbackRate(){return this._part.playbackRate}set playbackRate(e){this._part.playbackRate=e}get probability(){return this._part.probability}set probability(e){this._part.probability=e}get progress(){return this._part.progress}get humanize(){return this._part.humanize}set humanize(e){this._part.humanize=e}get length(){return this._part.length}}class To extends Sa{constructor(){super(Object.assign(Rr(To.getDefaults(),arguments,["fade"]))),this.name="CrossFade",this._panner=this.context.createStereoPanner(),this._split=this.context.createChannelSplitter(2),this._g2a=new Oi({context:this.context}),this.a=new Ta({context:this.context,gain:0}),this.b=new Ta({context:this.context,gain:0}),this.output=new Ta({context:this.context}),this._internalChannels=[this.a,this.b];const e=Rr(To.getDefaults(),arguments,["fade"]);this.fade=new Ra({context:this.context,units:"normalRange",value:e.fade}),Zr(this,"fade"),this.context.getConstant(1).connect(this._panner),this._panner.connect(this._split),this._panner.channelCount=1,this._panner.channelCountMode="explicit",_a(this._split,this.a.gain,0),_a(this._split,this.b.gain,1),this.fade.chain(this._g2a,this._panner.pan),this.a.connect(this.output),this.b.connect(this.output)}static getDefaults(){return Object.assign(Sa.getDefaults(),{fade:.5})}dispose(){return super.dispose(),this.a.dispose(),this.b.dispose(),this.output.dispose(),this.fade.dispose(),this._g2a.dispose(),this._panner.disconnect(),this._split.disconnect(),this}}class No extends Sa{constructor(e){super(e),this.name="Effect",this._dryWet=new To({context:this.context}),this.wet=this._dryWet.fade,this.effectSend=new Ta({context:this.context}),this.effectReturn=new Ta({context:this.context}),this.input=new Ta({context:this.context}),this.output=this._dryWet,this.input.fan(this._dryWet.a,this.effectSend),this.effectReturn.connect(this._dryWet.b),this.wet.setValueAtTime(e.wet,0),this._internalChannels=[this.effectReturn,this.effectSend],Zr(this,"wet")}static getDefaults(){return Object.assign(Sa.getDefaults(),{wet:1})}connectEffect(e){return this._internalChannels.push(e),this.effectSend.chain(e,this.effectReturn),this}dispose(){return super.dispose(),this._dryWet.dispose(),this.effectSend.dispose(),this.effectReturn.dispose(),this.wet.dispose(),this}}class Oo extends No{constructor(e){super(e),this.name="LFOEffect",this._lfo=new Ci({context:this.context,frequency:e.frequency,amplitude:e.depth}),this.depth=this._lfo.amplitude,this.frequency=this._lfo.frequency,this.type=e.type,Zr(this,["frequency","depth"])}static getDefaults(){return Object.assign(No.getDefaults(),{frequency:1,type:"sine",depth:1})}start(e){return this._lfo.start(e),this}stop(e){return this._lfo.stop(e),this}sync(){return this._lfo.sync(),this}unsync(){return this._lfo.unsync(),this}get type(){return this._lfo.type}set type(e){this._lfo.type=e}dispose(){return super.dispose(),this._lfo.dispose(),this.frequency.dispose(),this.depth.dispose(),this}}class Ro extends Oo{constructor(){super(Rr(Ro.getDefaults(),arguments,["frequency","baseFrequency","octaves"])),this.name="AutoFilter";const e=Rr(Ro.getDefaults(),arguments,["frequency","baseFrequency","octaves"]);this.filter=new Ki(Object.assign(e.filter,{context:this.context})),this.connectEffect(this.filter),this._lfo.connect(this.filter.frequency),this.octaves=e.octaves,this.baseFrequency=e.baseFrequency}static getDefaults(){return Object.assign(Oo.getDefaults(),{baseFrequency:200,octaves:2.6,filter:{type:"lowpass",rolloff:-12,Q:1}})}get baseFrequency(){return this._lfo.min}set baseFrequency(e){this._lfo.min=this.toFrequency(e),this.octaves=this._octaves}get octaves(){return this._octaves}set octaves(e){this._octaves=e,this._lfo.max=this._lfo.min*Math.pow(2,e)}dispose(){return super.dispose(),this.filter.dispose(),this}}class Do extends Sa{constructor(){super(Object.assign(Rr(Do.getDefaults(),arguments,["pan"]))),this.name="Panner",this._panner=this.context.createStereoPanner(),this.input=this._panner,this.output=this._panner;const e=Rr(Do.getDefaults(),arguments,["pan"]);this.pan=new Ca({context:this.context,param:this._panner.pan,value:e.pan,minValue:-1,maxValue:1}),this._panner.channelCount=e.channelCount,this._panner.channelCountMode="explicit",Zr(this,"pan")}static getDefaults(){return Object.assign(Sa.getDefaults(),{pan:0,channelCount:1})}dispose(){return super.dispose(),this._panner.disconnect(),this.pan.dispose(),this}}class Mo extends Oo{constructor(){super(Rr(Mo.getDefaults(),arguments,["frequency"])),this.name="AutoPanner";const e=Rr(Mo.getDefaults(),arguments,["frequency"]);this._panner=new Do({context:this.context,channelCount:e.channelCount}),this.connectEffect(this._panner),this._lfo.connect(this._panner.pan),this._lfo.min=-1,this._lfo.max=1}static getDefaults(){return Object.assign(Oo.getDefaults(),{channelCount:1})}dispose(){return super.dispose(),this._panner.dispose(),this}}class Fo extends Sa{constructor(){super(Rr(Fo.getDefaults(),arguments,["smoothing"])),this.name="Follower";const e=Rr(Fo.getDefaults(),arguments,["smoothing"]);this._abs=this.input=new Ni({context:this.context}),this._lowpass=this.output=new uo({context:this.context,frequency:1/this.toSeconds(e.smoothing),type:"lowpass"}),this._abs.connect(this._lowpass),this._smoothing=e.smoothing}static getDefaults(){return Object.assign(Sa.getDefaults(),{smoothing:.05})}get smoothing(){return this._smoothing}set smoothing(e){this._smoothing=e,this._lowpass.frequency=1/this.toSeconds(this.smoothing)}dispose(){return super.dispose(),this._abs.dispose(),this._lowpass.dispose(),this}}class Bo extends No{constructor(){super(Rr(Bo.getDefaults(),arguments,["baseFrequency","octaves","sensitivity"])),this.name="AutoWah";const e=Rr(Bo.getDefaults(),arguments,["baseFrequency","octaves","sensitivity"]);this._follower=new Fo({context:this.context,smoothing:e.follower}),this._sweepRange=new zi({context:this.context,min:0,max:1,exponent:.5}),this._baseFrequency=this.toFrequency(e.baseFrequency),this._octaves=e.octaves,this._inputBoost=new Ta({context:this.context}),this._bandpass=new Ki({context:this.context,rolloff:-48,frequency:0,Q:e.Q}),this._peaking=new Ki({context:this.context,type:"peaking"}),this._peaking.gain.value=e.gain,this.gain=this._peaking.gain,this.Q=this._bandpass.Q,this.effectSend.chain(this._inputBoost,this._follower,this._sweepRange),this._sweepRange.connect(this._bandpass.frequency),this._sweepRange.connect(this._peaking.frequency),this.effectSend.chain(this._bandpass,this._peaking,this.effectReturn),this._setSweepRange(),this.sensitivity=e.sensitivity,Zr(this,["gain","Q"])}static getDefaults(){return Object.assign(No.getDefaults(),{baseFrequency:100,octaves:6,sensitivity:0,Q:2,gain:2,follower:.2})}get octaves(){return this._octaves}set octaves(e){this._octaves=e,this._setSweepRange()}get follower(){return this._follower.smoothing}set follower(e){this._follower.smoothing=e}get baseFrequency(){return this._baseFrequency}set baseFrequency(e){this._baseFrequency=this.toFrequency(e),this._setSweepRange()}get sensitivity(){return oa(1/this._inputBoost.gain.value)}set sensitivity(e){this._inputBoost.gain.value=1/ia(e)}_setSweepRange(){this._sweepRange.min=this._baseFrequency,this._sweepRange.max=Math.min(this._baseFrequency*Math.pow(2,this._octaves),this.context.sampleRate/2)}dispose(){return super.dispose(),this._follower.dispose(),this._sweepRange.dispose(),this._bandpass.dispose(),this._peaking.dispose(),this._inputBoost.dispose(),this}}const zo="bit-crusher";ao(zo,"\n\tclass BitCrusherWorklet extends SingleIOProcessor {\n\n\t\tstatic get parameterDescriptors() {\n\t\t\treturn [{\n\t\t\t\tname: \"bits\",\n\t\t\t\tdefaultValue: 12,\n\t\t\t\tminValue: 1,\n\t\t\t\tmaxValue: 16,\n\t\t\t\tautomationRate: 'k-rate'\n\t\t\t}];\n\t\t}\n\n\t\tgenerate(input, _channel, parameters) {\n\t\t\tconst step = Math.pow(0.5, parameters.bits - 1);\n\t\t\tconst val = step * Math.floor(input / step + 0.5);\n\t\t\treturn val;\n\t\t}\n\t}\n");class Lo extends No{constructor(){super(Rr(Lo.getDefaults(),arguments,["bits"])),this.name="BitCrusher";const e=Rr(Lo.getDefaults(),arguments,["bits"]);this._bitCrusherWorklet=new Po({context:this.context,bits:e.bits}),this.connectEffect(this._bitCrusherWorklet),this.bits=this._bitCrusherWorklet.bits}static getDefaults(){return Object.assign(No.getDefaults(),{bits:4})}dispose(){return super.dispose(),this._bitCrusherWorklet.dispose(),this}}class Po extends io{constructor(){super(Rr(Po.getDefaults(),arguments)),this.name="BitCrusherWorklet";const e=Rr(Po.getDefaults(),arguments);this.input=new Ta({context:this.context}),this.output=new Ta({context:this.context}),this.bits=new Ca({context:this.context,value:e.bits,units:"positive",minValue:1,maxValue:16,param:this._dummyParam,swappable:!0})}static getDefaults(){return Object.assign(io.getDefaults(),{bits:12})}_audioWorkletName(){return zo}onReady(e){Ea(this.input,e,this.output);const t=e.parameters.get("bits");this.bits.setParam(t)}dispose(){return super.dispose(),this.input.dispose(),this.output.dispose(),this.bits.dispose(),this}}class Vo extends No{constructor(){super(Rr(Vo.getDefaults(),arguments,["order"])),this.name="Chebyshev";const e=Rr(Vo.getDefaults(),arguments,["order"]);this._shaper=new hi({context:this.context,length:4096}),this._order=e.order,this.connectEffect(this._shaper),this.order=e.order,this.oversample=e.oversample}static getDefaults(){return Object.assign(No.getDefaults(),{order:1,oversample:"none"})}_getCoefficient(e,t,n){return n.has(t)||(0===t?n.set(t,0):1===t?n.set(t,e):n.set(t,2*e*this._getCoefficient(e,t-1,n)-this._getCoefficient(e,t-2,n))),n.get(t)}get order(){return this._order}set order(e){this._order=e,this._shaper.setMap((t=>this._getCoefficient(t,e,new Map)))}get oversample(){return this._shaper.oversample}set oversample(e){this._shaper.oversample=e}dispose(){return super.dispose(),this._shaper.dispose(),this}}class Wo extends Sa{constructor(){super(Rr(Wo.getDefaults(),arguments,["channels"])),this.name="Split";const e=Rr(Wo.getDefaults(),arguments,["channels"]);this._splitter=this.input=this.output=this.context.createChannelSplitter(e.channels),this._internalChannels=[this._splitter]}static getDefaults(){return Object.assign(Sa.getDefaults(),{channels:2})}dispose(){return super.dispose(),this._splitter.disconnect(),this}}class Uo extends Sa{constructor(){super(Rr(Uo.getDefaults(),arguments,["channels"])),this.name="Merge";const e=Rr(Uo.getDefaults(),arguments,["channels"]);this._merger=this.output=this.input=this.context.createChannelMerger(e.channels)}static getDefaults(){return Object.assign(Sa.getDefaults(),{channels:2})}dispose(){return super.dispose(),this._merger.disconnect(),this}}class Go extends Sa{constructor(e){super(e),this.name="StereoEffect",this.input=new Ta({context:this.context}),this.input.channelCount=2,this.input.channelCountMode="explicit",this._dryWet=this.output=new To({context:this.context,fade:e.wet}),this.wet=this._dryWet.fade,this._split=new Wo({context:this.context,channels:2}),this._merge=new Uo({context:this.context,channels:2}),this.input.connect(this._split),this.input.connect(this._dryWet.a),this._merge.connect(this._dryWet.b),Zr(this,["wet"])}connectEffectLeft(...e){this._split.connect(e[0],0,0),Ea(...e),_a(e[e.length-1],this._merge,0,0)}connectEffectRight(...e){this._split.connect(e[0],1,0),Ea(...e),_a(e[e.length-1],this._merge,0,1)}static getDefaults(){return Object.assign(Sa.getDefaults(),{wet:1})}dispose(){return super.dispose(),this._dryWet.dispose(),this._split.dispose(),this._merge.dispose(),this}}class qo extends Go{constructor(e){super(e),this.feedback=new Ra({context:this.context,value:e.feedback,units:"normalRange"}),this._feedbackL=new Ta({context:this.context}),this._feedbackR=new Ta({context:this.context}),this._feedbackSplit=new Wo({context:this.context,channels:2}),this._feedbackMerge=new Uo({context:this.context,channels:2}),this._merge.connect(this._feedbackSplit),this._feedbackMerge.connect(this._split),this._feedbackSplit.connect(this._feedbackL,0,0),this._feedbackL.connect(this._feedbackMerge,0,0),this._feedbackSplit.connect(this._feedbackR,1,0),this._feedbackR.connect(this._feedbackMerge,0,1),this.feedback.fan(this._feedbackL.gain,this._feedbackR.gain),Zr(this,["feedback"])}static getDefaults(){return Object.assign(Go.getDefaults(),{feedback:.5})}dispose(){return super.dispose(),this.feedback.dispose(),this._feedbackL.dispose(),this._feedbackR.dispose(),this._feedbackSplit.dispose(),this._feedbackMerge.dispose(),this}}class jo extends qo{constructor(){super(Rr(jo.getDefaults(),arguments,["frequency","delayTime","depth"])),this.name="Chorus";const e=Rr(jo.getDefaults(),arguments,["frequency","delayTime","depth"]);this._depth=e.depth,this._delayTime=e.delayTime/1e3,this._lfoL=new Ci({context:this.context,frequency:e.frequency,min:0,max:1}),this._lfoR=new Ci({context:this.context,frequency:e.frequency,min:0,max:1,phase:180}),this._delayNodeL=new La({context:this.context}),this._delayNodeR=new La({context:this.context}),this.frequency=this._lfoL.frequency,Zr(this,["frequency"]),this._lfoL.frequency.connect(this._lfoR.frequency),this.connectEffectLeft(this._delayNodeL),this.connectEffectRight(this._delayNodeR),this._lfoL.connect(this._delayNodeL.delayTime),this._lfoR.connect(this._delayNodeR.delayTime),this.depth=this._depth,this.type=e.type,this.spread=e.spread}static getDefaults(){return Object.assign(qo.getDefaults(),{frequency:1.5,delayTime:3.5,depth:.7,type:"sine",spread:180,feedback:0,wet:.5})}get depth(){return this._depth}set depth(e){this._depth=e;const t=this._delayTime*e;this._lfoL.min=Math.max(this._delayTime-t,0),this._lfoL.max=this._delayTime+t,this._lfoR.min=Math.max(this._delayTime-t,0),this._lfoR.max=this._delayTime+t}get delayTime(){return 1e3*this._delayTime}set delayTime(e){this._delayTime=e/1e3,this.depth=this._depth}get type(){return this._lfoL.type}set type(e){this._lfoL.type=e,this._lfoR.type=e}get spread(){return this._lfoR.phase-this._lfoL.phase}set spread(e){this._lfoL.phase=90-e/2,this._lfoR.phase=e/2+90}start(e){return this._lfoL.start(e),this._lfoR.start(e),this}stop(e){return this._lfoL.stop(e),this._lfoR.stop(e),this}sync(){return this._lfoL.sync(),this._lfoR.sync(),this}unsync(){return this._lfoL.unsync(),this._lfoR.unsync(),this}dispose(){return super.dispose(),this._lfoL.dispose(),this._lfoR.dispose(),this._delayNodeL.dispose(),this._delayNodeR.dispose(),this.frequency.dispose(),this}}class Ho extends No{constructor(){super(Rr(Ho.getDefaults(),arguments,["distortion"])),this.name="Distortion";const e=Rr(Ho.getDefaults(),arguments,["distortion"]);this._shaper=new hi({context:this.context,length:4096}),this._distortion=e.distortion,this.connectEffect(this._shaper),this.distortion=e.distortion,this.oversample=e.oversample}static getDefaults(){return Object.assign(No.getDefaults(),{distortion:.4,oversample:"none"})}get distortion(){return this._distortion}set distortion(e){this._distortion=e;const t=100*e,n=Math.PI/180;this._shaper.setMap((e=>Math.abs(e)<.001?0:(3+t)*e*20*n/(Math.PI+t*Math.abs(e))))}get oversample(){return this._shaper.oversample}set oversample(e){this._shaper.oversample=e}dispose(){return super.dispose(),this._shaper.dispose(),this}}class $o extends No{constructor(e){super(e),this.name="FeedbackEffect",this._feedbackGain=new Ta({context:this.context,gain:e.feedback,units:"normalRange"}),this.feedback=this._feedbackGain.gain,Zr(this,"feedback"),this.effectReturn.chain(this._feedbackGain,this.effectSend)}static getDefaults(){return Object.assign(No.getDefaults(),{feedback:.125})}dispose(){return super.dispose(),this._feedbackGain.dispose(),this.feedback.dispose(),this}}class Ko extends $o{constructor(){super(Rr(Ko.getDefaults(),arguments,["delayTime","feedback"])),this.name="FeedbackDelay";const e=Rr(Ko.getDefaults(),arguments,["delayTime","feedback"]);this._delayNode=new La({context:this.context,delayTime:e.delayTime,maxDelay:e.maxDelay}),this.delayTime=this._delayNode.delayTime,this.connectEffect(this._delayNode),Zr(this,"delayTime")}static getDefaults(){return Object.assign($o.getDefaults(),{delayTime:.25,maxDelay:1})}dispose(){return super.dispose(),this._delayNode.dispose(),this.delayTime.dispose(),this}}class Xo extends Sa{constructor(e){super(e),this.name="PhaseShiftAllpass",this.input=new Ta({context:this.context}),this.output=new Ta({context:this.context}),this.offset90=new Ta({context:this.context});this._bank0=this._createAllPassFilterBank([.6923878,.9360654322959,.988229522686,.9987488452737]),this._bank1=this._createAllPassFilterBank([.4021921162426,.856171088242,.9722909545651,.9952884791278]),this._oneSampleDelay=this.context.createIIRFilter([0,1],[1,0]),Ea(this.input,...this._bank0,this._oneSampleDelay,this.output),Ea(this.input,...this._bank1,this.offset90)}_createAllPassFilterBank(e){return e.map((e=>{const t=[[e*e,0,-1],[1,0,-e*e]];return this.context.createIIRFilter(t[0],t[1])}))}dispose(){return super.dispose(),this.input.dispose(),this.output.dispose(),this.offset90.dispose(),this._bank0.forEach((e=>e.disconnect())),this._bank1.forEach((e=>e.disconnect())),this._oneSampleDelay.disconnect(),this}}class Zo extends No{constructor(){super(Rr(Zo.getDefaults(),arguments,["frequency"])),this.name="FrequencyShifter";const e=Rr(Zo.getDefaults(),arguments,["frequency"]);this.frequency=new Ra({context:this.context,units:"frequency",value:e.frequency,minValue:-this.context.sampleRate/2,maxValue:this.context.sampleRate/2}),this._sine=new li({context:this.context,type:"sine"}),this._cosine=new ui({context:this.context,phase:-90,type:"sine"}),this._sineMultiply=new pi({context:this.context}),this._cosineMultiply=new pi({context:this.context}),this._negate=new Ri({context:this.context}),this._add=new xi({context:this.context}),this._phaseShifter=new Xo({context:this.context}),this.effectSend.connect(this._phaseShifter),this.frequency.fan(this._sine.frequency,this._cosine.frequency),this._phaseShifter.offset90.connect(this._cosineMultiply),this._cosine.connect(this._cosineMultiply.factor),this._phaseShifter.connect(this._sineMultiply),this._sine.connect(this._sineMultiply.factor),this._sineMultiply.connect(this._negate),this._cosineMultiply.connect(this._add),this._negate.connect(this._add.addend),this._add.connect(this.effectReturn);const t=this.immediate();this._sine.start(t),this._cosine.start(t)}static getDefaults(){return Object.assign(No.getDefaults(),{frequency:0})}dispose(){return super.dispose(),this.frequency.dispose(),this._add.dispose(),this._cosine.dispose(),this._cosineMultiply.dispose(),this._negate.dispose(),this._phaseShifter.dispose(),this._sine.dispose(),this._sineMultiply.dispose(),this}}const Yo=[1557/44100,1617/44100,1491/44100,1422/44100,1277/44100,1356/44100,1188/44100,1116/44100],Qo=[225,556,441,341];class Jo extends Go{constructor(){super(Rr(Jo.getDefaults(),arguments,["roomSize","dampening"])),this.name="Freeverb",this._combFilters=[],this._allpassFiltersL=[],this._allpassFiltersR=[];const e=Rr(Jo.getDefaults(),arguments,["roomSize","dampening"]);this.roomSize=new Ra({context:this.context,value:e.roomSize,units:"normalRange"}),this._allpassFiltersL=Qo.map((e=>{const t=this.context.createBiquadFilter();return t.type="allpass",t.frequency.value=e,t})),this._allpassFiltersR=Qo.map((e=>{const t=this.context.createBiquadFilter();return t.type="allpass",t.frequency.value=e,t})),this._combFilters=Yo.map(((t,n)=>{const s=new co({context:this.context,dampening:e.dampening,delayTime:t});return nt.dampening=e))}dispose(){return super.dispose(),this._allpassFiltersL.forEach((e=>e.disconnect())),this._allpassFiltersR.forEach((e=>e.disconnect())),this._combFilters.forEach((e=>e.dispose())),this.roomSize.dispose(),this}}const el=[.06748,.06404,.08212,.09004],tl=[.773,.802,.753,.733],nl=[347,113,37];class sl extends Go{constructor(){super(Rr(sl.getDefaults(),arguments,["roomSize"])),this.name="JCReverb",this._allpassFilters=[],this._feedbackCombFilters=[];const e=Rr(sl.getDefaults(),arguments,["roomSize"]);this.roomSize=new Ra({context:this.context,value:e.roomSize,units:"normalRange"}),this._scaleRoomSize=new Ai({context:this.context,min:-.733,max:.197}),this._allpassFilters=nl.map((e=>{const t=this.context.createBiquadFilter();return t.type="allpass",t.frequency.value=e,t})),this._feedbackCombFilters=el.map(((e,t)=>{const n=new lo({context:this.context,delayTime:e});return this._scaleRoomSize.connect(n.resonance),n.resonance.value=tl[t],te.disconnect())),this._feedbackCombFilters.forEach((e=>e.dispose())),this.roomSize.dispose(),this._scaleRoomSize.dispose(),this}}class rl extends qo{constructor(e){super(e),this._feedbackL.disconnect(),this._feedbackL.connect(this._feedbackMerge,0,1),this._feedbackR.disconnect(),this._feedbackR.connect(this._feedbackMerge,0,0),Zr(this,["feedback"])}}class al extends rl{constructor(){super(Rr(al.getDefaults(),arguments,["delayTime","feedback"])),this.name="PingPongDelay";const e=Rr(al.getDefaults(),arguments,["delayTime","feedback"]);this._leftDelay=new La({context:this.context,maxDelay:e.maxDelay}),this._rightDelay=new La({context:this.context,maxDelay:e.maxDelay}),this._rightPreDelay=new La({context:this.context,maxDelay:e.maxDelay}),this.delayTime=new Ra({context:this.context,units:"time",value:e.delayTime}),this.connectEffectLeft(this._leftDelay),this.connectEffectRight(this._rightPreDelay,this._rightDelay),this.delayTime.fan(this._leftDelay.delayTime,this._rightDelay.delayTime,this._rightPreDelay.delayTime),this._feedbackL.disconnect(),this._feedbackL.connect(this._rightDelay),Zr(this,["delayTime"])}static getDefaults(){return Object.assign(rl.getDefaults(),{delayTime:.25,maxDelay:1})}dispose(){return super.dispose(),this._leftDelay.dispose(),this._rightDelay.dispose(),this._rightPreDelay.dispose(),this.delayTime.dispose(),this}}class il extends $o{constructor(){super(Rr(il.getDefaults(),arguments,["pitch"])),this.name="PitchShift";const e=Rr(il.getDefaults(),arguments,["pitch"]);this._frequency=new Ra({context:this.context}),this._delayA=new La({maxDelay:1,context:this.context}),this._lfoA=new Ci({context:this.context,min:0,max:.1,type:"sawtooth"}).connect(this._delayA.delayTime),this._delayB=new La({maxDelay:1,context:this.context}),this._lfoB=new Ci({context:this.context,min:0,max:.1,type:"sawtooth",phase:180}).connect(this._delayB.delayTime),this._crossFade=new To({context:this.context}),this._crossFadeLFO=new Ci({context:this.context,min:0,max:1,type:"triangle",phase:90}).connect(this._crossFade.fade),this._feedbackDelay=new La({delayTime:e.delayTime,context:this.context}),this.delayTime=this._feedbackDelay.delayTime,Zr(this,"delayTime"),this._pitch=e.pitch,this._windowSize=e.windowSize,this._delayA.connect(this._crossFade.a),this._delayB.connect(this._crossFade.b),this._frequency.fan(this._lfoA.frequency,this._lfoB.frequency,this._crossFadeLFO.frequency),this.effectSend.fan(this._delayA,this._delayB),this._crossFade.chain(this._feedbackDelay,this.effectReturn);const t=this.now();this._lfoA.start(t),this._lfoB.start(t),this._crossFadeLFO.start(t),this.windowSize=this._windowSize}static getDefaults(){return Object.assign($o.getDefaults(),{pitch:0,windowSize:.1,delayTime:0,feedback:0})}get pitch(){return this._pitch}set pitch(e){this._pitch=e;let t=0;e<0?(this._lfoA.min=0,this._lfoA.max=this._windowSize,this._lfoB.min=0,this._lfoB.max=this._windowSize,t=la(e-1)+1):(this._lfoA.min=this._windowSize,this._lfoA.max=0,this._lfoB.min=this._windowSize,this._lfoB.max=0,t=la(e)-1),this._frequency.value=t*(1.2/this._windowSize)}get windowSize(){return this._windowSize}set windowSize(e){this._windowSize=this.toSeconds(e),this.pitch=this._pitch}dispose(){return super.dispose(),this._frequency.dispose(),this._delayA.dispose(),this._delayB.dispose(),this._lfoA.dispose(),this._lfoB.dispose(),this._crossFade.dispose(),this._crossFadeLFO.dispose(),this._feedbackDelay.dispose(),this}}class ol extends Go{constructor(){super(Rr(ol.getDefaults(),arguments,["frequency","octaves","baseFrequency"])),this.name="Phaser";const e=Rr(ol.getDefaults(),arguments,["frequency","octaves","baseFrequency"]);this._lfoL=new Ci({context:this.context,frequency:e.frequency,min:0,max:1}),this._lfoR=new Ci({context:this.context,frequency:e.frequency,min:0,max:1,phase:180}),this._baseFrequency=this.toFrequency(e.baseFrequency),this._octaves=e.octaves,this.Q=new Ra({context:this.context,value:e.Q,units:"positive"}),this._filtersL=this._makeFilters(e.stages,this._lfoL),this._filtersR=this._makeFilters(e.stages,this._lfoR),this.frequency=this._lfoL.frequency,this.frequency.value=e.frequency,this.connectEffectLeft(...this._filtersL),this.connectEffectRight(...this._filtersR),this._lfoL.frequency.connect(this._lfoR.frequency),this.baseFrequency=e.baseFrequency,this.octaves=e.octaves,this._lfoL.start(),this._lfoR.start(),Zr(this,["frequency","Q"])}static getDefaults(){return Object.assign(Go.getDefaults(),{frequency:.5,octaves:3,stages:10,Q:10,baseFrequency:350})}_makeFilters(e,t){const n=[];for(let s=0;se.disconnect())),this._filtersR.forEach((e=>e.disconnect())),this.frequency.dispose(),this}}class ll extends No{constructor(){super(Rr(ll.getDefaults(),arguments,["decay"])),this.name="Reverb",this._convolver=this.context.createConvolver(),this.ready=Promise.resolve();const e=Rr(ll.getDefaults(),arguments,["decay"]);this._decay=e.decay,this._preDelay=e.preDelay,this.generate(),this.connectEffect(this._convolver)}static getDefaults(){return Object.assign(No.getDefaults(),{decay:1.5,preDelay:.01})}get decay(){return this._decay}set decay(e){ar(e=this.toSeconds(e),.001),this._decay=e,this.generate()}get preDelay(){return this._preDelay}set preDelay(e){ar(e=this.toSeconds(e),0),this._preDelay=e,this.generate()}generate(){return kr(this,void 0,void 0,(function*(){const e=this.ready,t=new ea(2,this._decay+this._preDelay,this.context.sampleRate),n=new ni({context:t}),s=new ni({context:t}),r=new Uo({context:t});n.connect(r,0,0),s.connect(r,0,1);const a=new Ta({context:t}).toDestination();r.connect(a),n.start(0),s.start(0),a.gain.setValueAtTime(0,0),a.gain.setValueAtTime(1,this._preDelay),a.gain.exponentialApproachValueAtTime(0,this._preDelay,this.decay);const i=t.render();return this.ready=i.then(Qr),yield e,this._convolver.buffer=(yield i).get(),this}))}dispose(){return super.dispose(),this._convolver.disconnect(),this}}class ul extends Sa{constructor(){super(Rr(ul.getDefaults(),arguments)),this.name="MidSideSplit",this._split=this.input=new Wo({channels:2,context:this.context}),this._midAdd=new xi({context:this.context}),this.mid=new pi({context:this.context,value:Math.SQRT1_2}),this._sideSubtract=new Di({context:this.context}),this.side=new pi({context:this.context,value:Math.SQRT1_2}),this._split.connect(this._midAdd,0),this._split.connect(this._midAdd.addend,1),this._split.connect(this._sideSubtract,0),this._split.connect(this._sideSubtract.subtrahend,1),this._midAdd.connect(this.mid),this._sideSubtract.connect(this.side)}dispose(){return super.dispose(),this.mid.dispose(),this.side.dispose(),this._midAdd.dispose(),this._sideSubtract.dispose(),this._split.dispose(),this}}class cl extends Sa{constructor(){super(Rr(cl.getDefaults(),arguments)),this.name="MidSideMerge",this.mid=new Ta({context:this.context}),this.side=new Ta({context:this.context}),this._left=new xi({context:this.context}),this._leftMult=new pi({context:this.context,value:Math.SQRT1_2}),this._right=new Di({context:this.context}),this._rightMult=new pi({context:this.context,value:Math.SQRT1_2}),this._merge=this.output=new Uo({context:this.context}),this.mid.fan(this._left),this.side.connect(this._left.addend),this.mid.connect(this._right),this.side.connect(this._right.subtrahend),this._left.connect(this._leftMult),this._right.connect(this._rightMult),this._leftMult.connect(this._merge,0,0),this._rightMult.connect(this._merge,0,1)}dispose(){return super.dispose(),this.mid.dispose(),this.side.dispose(),this._leftMult.dispose(),this._rightMult.dispose(),this._left.dispose(),this._right.dispose(),this}}class hl extends No{constructor(e){super(e),this.name="MidSideEffect",this._midSideMerge=new cl({context:this.context}),this._midSideSplit=new ul({context:this.context}),this._midSend=this._midSideSplit.mid,this._sideSend=this._midSideSplit.side,this._midReturn=this._midSideMerge.mid,this._sideReturn=this._midSideMerge.side,this.effectSend.connect(this._midSideSplit),this._midSideMerge.connect(this.effectReturn)}connectEffectMid(...e){this._midSend.chain(...e,this._midReturn)}connectEffectSide(...e){this._sideSend.chain(...e,this._sideReturn)}dispose(){return super.dispose(),this._midSideSplit.dispose(),this._midSideMerge.dispose(),this._midSend.dispose(),this._sideSend.dispose(),this._midReturn.dispose(),this._sideReturn.dispose(),this}}class dl extends hl{constructor(){super(Rr(dl.getDefaults(),arguments,["width"])),this.name="StereoWidener";const e=Rr(dl.getDefaults(),arguments,["width"]);this.width=new Ra({context:this.context,value:e.width,units:"normalRange"}),Zr(this,["width"]),this._twoTimesWidthMid=new pi({context:this.context,value:2}),this._twoTimesWidthSide=new pi({context:this.context,value:2}),this._midMult=new pi({context:this.context}),this._twoTimesWidthMid.connect(this._midMult.factor),this.connectEffectMid(this._midMult),this._oneMinusWidth=new Di({context:this.context}),this._oneMinusWidth.connect(this._twoTimesWidthMid),_a(this.context.getConstant(1),this._oneMinusWidth),this.width.connect(this._oneMinusWidth.subtrahend),this._sideMult=new pi({context:this.context}),this.width.connect(this._twoTimesWidthSide),this._twoTimesWidthSide.connect(this._sideMult.factor),this.connectEffectSide(this._sideMult)}static getDefaults(){return Object.assign(hl.getDefaults(),{width:.5})}dispose(){return super.dispose(),this.width.dispose(),this._midMult.dispose(),this._sideMult.dispose(),this._twoTimesWidthMid.dispose(),this._twoTimesWidthSide.dispose(),this._oneMinusWidth.dispose(),this}}class pl extends Go{constructor(){super(Rr(pl.getDefaults(),arguments,["frequency","depth"])),this.name="Tremolo";const e=Rr(pl.getDefaults(),arguments,["frequency","depth"]);this._lfoL=new Ci({context:this.context,type:e.type,min:1,max:0}),this._lfoR=new Ci({context:this.context,type:e.type,min:1,max:0}),this._amplitudeL=new Ta({context:this.context}),this._amplitudeR=new Ta({context:this.context}),this.frequency=new Ra({context:this.context,value:e.frequency,units:"frequency"}),this.depth=new Ra({context:this.context,value:e.depth,units:"normalRange"}),Zr(this,["frequency","depth"]),this.connectEffectLeft(this._amplitudeL),this.connectEffectRight(this._amplitudeR),this._lfoL.connect(this._amplitudeL.gain),this._lfoR.connect(this._amplitudeR.gain),this.frequency.fan(this._lfoL.frequency,this._lfoR.frequency),this.depth.fan(this._lfoR.amplitude,this._lfoL.amplitude),this.spread=e.spread}static getDefaults(){return Object.assign(Go.getDefaults(),{frequency:10,type:"sine",depth:.5,spread:180})}start(e){return this._lfoL.start(e),this._lfoR.start(e),this}stop(e){return this._lfoL.stop(e),this._lfoR.stop(e),this}sync(){return this._lfoL.sync(),this._lfoR.sync(),this.context.transport.syncSignal(this.frequency),this}unsync(){return this._lfoL.unsync(),this._lfoR.unsync(),this.context.transport.unsyncSignal(this.frequency),this}get type(){return this._lfoL.type}set type(e){this._lfoL.type=e,this._lfoR.type=e}get spread(){return this._lfoR.phase-this._lfoL.phase}set spread(e){this._lfoL.phase=90-e/2,this._lfoR.phase=e/2+90}dispose(){return super.dispose(),this._lfoL.dispose(),this._lfoR.dispose(),this._amplitudeL.dispose(),this._amplitudeR.dispose(),this.frequency.dispose(),this.depth.dispose(),this}}class fl extends No{constructor(){super(Rr(fl.getDefaults(),arguments,["frequency","depth"])),this.name="Vibrato";const e=Rr(fl.getDefaults(),arguments,["frequency","depth"]);this._delayNode=new La({context:this.context,delayTime:0,maxDelay:e.maxDelay}),this._lfo=new Ci({context:this.context,type:e.type,min:0,max:e.maxDelay,frequency:e.frequency,phase:-90}).start().connect(this._delayNode.delayTime),this.frequency=this._lfo.frequency,this.depth=this._lfo.amplitude,this.depth.value=e.depth,Zr(this,["frequency","depth"]),this.effectSend.chain(this._delayNode,this.effectReturn)}static getDefaults(){return Object.assign(No.getDefaults(),{maxDelay:.005,frequency:5,depth:.1,type:"sine"})}get type(){return this._lfo.type}set type(e){this._lfo.type=e}dispose(){return super.dispose(),this._delayNode.dispose(),this._lfo.dispose(),this.frequency.dispose(),this.depth.dispose(),this}}class ml extends Sa{constructor(){super(Rr(ml.getDefaults(),arguments,["type","size"])),this.name="Analyser",this._analysers=[],this._buffers=[];const e=Rr(ml.getDefaults(),arguments,["type","size"]);this.input=this.output=this._gain=new Ta({context:this.context}),this._split=new Wo({context:this.context,channels:e.channels}),this.input.connect(this._split),ar(e.channels,1);for(let t=0;t{const n=this._buffers[t];"fft"===this._type?e.getFloatFrequencyData(n):"waveform"===this._type&&e.getFloatTimeDomainData(n)})),1===this.channels?this._buffers[0]:this._buffers}get size(){return this._analysers[0].frequencyBinCount}set size(e){this._analysers.forEach(((t,n)=>{t.fftSize=2*e,this._buffers[n]=new Float32Array(e)}))}get channels(){return this._analysers.length}get type(){return this._type}set type(e){rr("waveform"===e||"fft"===e,`Analyser: invalid type: ${e}`),this._type=e}get smoothing(){return this._analysers[0].smoothingTimeConstant}set smoothing(e){this._analysers.forEach((t=>t.smoothingTimeConstant=e))}dispose(){return super.dispose(),this._analysers.forEach((e=>e.disconnect())),this._split.dispose(),this._gain.dispose(),this}}class gl extends Sa{constructor(){super(Rr(gl.getDefaults(),arguments)),this.name="MeterBase",this.input=this.output=this._analyser=new ml({context:this.context,size:256,type:"waveform"})}dispose(){return super.dispose(),this._analyser.dispose(),this}}class yl extends gl{constructor(){super(Rr(yl.getDefaults(),arguments,["smoothing"])),this.name="Meter",this._rms=0;const e=Rr(yl.getDefaults(),arguments,["smoothing"]);this.input=this.output=this._analyser=new ml({context:this.context,size:256,type:"waveform",channels:e.channels}),this.smoothing=e.smoothing,this.normalRange=e.normalRange}static getDefaults(){return Object.assign(gl.getDefaults(),{smoothing:.8,normalRange:!1,channels:1})}getLevel(){return cr("'getLevel' has been changed to 'getValue'"),this.getValue()}getValue(){const e=this._analyser.getValue(),t=(1===this.channels?[e]:e).map((e=>{const t=e.reduce(((e,t)=>e+t*t),0),n=Math.sqrt(t/e.length);return this._rms=Math.max(n,this._rms*this.smoothing),this.normalRange?this._rms:oa(this._rms)}));return 1===this.channels?t[0]:t}get channels(){return this._analyser.channels}dispose(){return super.dispose(),this._analyser.dispose(),this}}class bl extends gl{constructor(){super(Rr(bl.getDefaults(),arguments,["size"])),this.name="FFT";const e=Rr(bl.getDefaults(),arguments,["size"]);this.normalRange=e.normalRange,this._analyser.type="fft",this.size=e.size}static getDefaults(){return Object.assign(Sa.getDefaults(),{normalRange:!1,size:1024,smoothing:.8})}getValue(){return this._analyser.getValue().map((e=>this.normalRange?ia(e):e))}get size(){return this._analyser.size}set size(e){this._analyser.size=e}get smoothing(){return this._analyser.smoothing}set smoothing(e){this._analyser.smoothing=e}getFrequencyOfIndex(e){return rr(0<=e&&ee._updateSolo()))}get muted(){return 0===this.input.gain.value}_addSolo(){xl._soloed.has(this.context)||xl._soloed.set(this.context,new Set),xl._soloed.get(this.context).add(this)}_removeSolo(){xl._soloed.has(this.context)&&xl._soloed.get(this.context).delete(this)}_isSoloed(){return xl._soloed.has(this.context)&&xl._soloed.get(this.context).has(this)}_noSolos(){return!xl._soloed.has(this.context)||xl._soloed.has(this.context)&&0===xl._soloed.get(this.context).size}_updateSolo(){this._isSoloed()||this._noSolos()?this.input.gain.value=1:this.input.gain.value=0}dispose(){return super.dispose(),xl._allSolos.get(this.context).delete(this),this._removeSolo(),this}}xl._allSolos=new Map,xl._soloed=new Map;class Al extends Sa{constructor(){super(Rr(Al.getDefaults(),arguments,["pan","volume"])),this.name="PanVol";const e=Rr(Al.getDefaults(),arguments,["pan","volume"]);this._panner=this.input=new Do({context:this.context,pan:e.pan,channelCount:e.channelCount}),this.pan=this._panner.pan,this._volume=this.output=new Ka({context:this.context,volume:e.volume}),this.volume=this._volume.volume,this._panner.connect(this._volume),this.mute=e.mute,Zr(this,["pan","volume"])}static getDefaults(){return Object.assign(Sa.getDefaults(),{mute:!1,pan:0,volume:0,channelCount:1})}get mute(){return this._volume.mute}set mute(e){this._volume.mute=e}dispose(){return super.dispose(),this._panner.dispose(),this.pan.dispose(),this._volume.dispose(),this.volume.dispose(),this}}class kl extends Sa{constructor(){super(Rr(kl.getDefaults(),arguments,["volume","pan"])),this.name="Channel";const e=Rr(kl.getDefaults(),arguments,["volume","pan"]);this._solo=this.input=new xl({solo:e.solo,context:this.context}),this._panVol=this.output=new Al({context:this.context,pan:e.pan,volume:e.volume,mute:e.mute,channelCount:e.channelCount}),this.pan=this._panVol.pan,this.volume=this._panVol.volume,this._solo.connect(this._panVol),Zr(this,["pan","volume"])}static getDefaults(){return Object.assign(Sa.getDefaults(),{pan:0,volume:0,mute:!1,solo:!1,channelCount:1})}get solo(){return this._solo.solo}set solo(e){this._solo.solo=e}get muted(){return this._solo.muted||this.mute}get mute(){return this._panVol.mute}set mute(e){this._panVol.mute=e}_getBus(e){return kl.buses.has(e)||kl.buses.set(e,new Ta({context:this.context})),kl.buses.get(e)}send(e,t=0){const n=this._getBus(e),s=new Ta({context:this.context,units:"decibels",gain:t});return this.connect(s),s.connect(n),s}receive(e){return this._getBus(e).connect(this),this}dispose(){return super.dispose(),this._panVol.dispose(),this.pan.dispose(),this.volume.dispose(),this._solo.dispose(),this}}kl.buses=new Map;class Cl extends Sa{constructor(){super(Rr(Cl.getDefaults(),arguments)),this.name="Mono",this.input=new Ta({context:this.context}),this._merge=this.output=new Uo({channels:2,context:this.context}),this.input.connect(this._merge,0,0),this.input.connect(this._merge,0,1)}dispose(){return super.dispose(),this._merge.dispose(),this.input.dispose(),this}}class Sl extends Sa{constructor(){super(Rr(Sl.getDefaults(),arguments,["lowFrequency","highFrequency"])),this.name="MultibandSplit",this.input=new Ta({context:this.context}),this.output=void 0,this.low=new Ki({context:this.context,frequency:0,type:"lowpass"}),this._lowMidFilter=new Ki({context:this.context,frequency:0,type:"highpass"}),this.mid=new Ki({context:this.context,frequency:0,type:"lowpass"}),this.high=new Ki({context:this.context,frequency:0,type:"highpass"}),this._internalChannels=[this.low,this.mid,this.high];const e=Rr(Sl.getDefaults(),arguments,["lowFrequency","highFrequency"]);this.lowFrequency=new Ra({context:this.context,units:"frequency",value:e.lowFrequency}),this.highFrequency=new Ra({context:this.context,units:"frequency",value:e.highFrequency}),this.Q=new Ra({context:this.context,units:"positive",value:e.Q}),this.input.fan(this.low,this.high),this.input.chain(this._lowMidFilter,this.mid),this.lowFrequency.fan(this.low.frequency,this._lowMidFilter.frequency),this.highFrequency.fan(this.mid.frequency,this.high.frequency),this.Q.connect(this.low.Q),this.Q.connect(this._lowMidFilter.Q),this.Q.connect(this.mid.Q),this.Q.connect(this.high.Q),Zr(this,["high","mid","low","highFrequency","lowFrequency"])}static getDefaults(){return Object.assign(Sa.getDefaults(),{Q:1,highFrequency:2500,lowFrequency:400})}dispose(){return super.dispose(),Yr(this,["high","mid","low","highFrequency","lowFrequency"]),this.low.dispose(),this._lowMidFilter.dispose(),this.mid.dispose(),this.high.dispose(),this.lowFrequency.dispose(),this.highFrequency.dispose(),this.Q.dispose(),this}}class El extends Sa{constructor(){super(...arguments),this.name="Listener",this.positionX=new Ca({context:this.context,param:this.context.rawContext.listener.positionX}),this.positionY=new Ca({context:this.context,param:this.context.rawContext.listener.positionY}),this.positionZ=new Ca({context:this.context,param:this.context.rawContext.listener.positionZ}),this.forwardX=new Ca({context:this.context,param:this.context.rawContext.listener.forwardX}),this.forwardY=new Ca({context:this.context,param:this.context.rawContext.listener.forwardY}),this.forwardZ=new Ca({context:this.context,param:this.context.rawContext.listener.forwardZ}),this.upX=new Ca({context:this.context,param:this.context.rawContext.listener.upX}),this.upY=new Ca({context:this.context,param:this.context.rawContext.listener.upY}),this.upZ=new Ca({context:this.context,param:this.context.rawContext.listener.upZ})}static getDefaults(){return Object.assign(Sa.getDefaults(),{positionX:0,positionY:0,positionZ:0,forwardX:0,forwardY:0,forwardZ:-1,upX:0,upY:1,upZ:0})}dispose(){return super.dispose(),this.positionX.dispose(),this.positionY.dispose(),this.positionZ.dispose(),this.forwardX.dispose(),this.forwardY.dispose(),this.forwardZ.dispose(),this.upX.dispose(),this.upY.dispose(),this.upZ.dispose(),this}}qr((e=>{e.listener=new El({context:e})})),Hr((e=>{e.listener.dispose()}));class _l extends Sa{constructor(){super(Rr(_l.getDefaults(),arguments,["positionX","positionY","positionZ"])),this.name="Panner3D";const e=Rr(_l.getDefaults(),arguments,["positionX","positionY","positionZ"]);this._panner=this.input=this.output=this.context.createPanner(),this.panningModel=e.panningModel,this.maxDistance=e.maxDistance,this.distanceModel=e.distanceModel,this.coneOuterGain=e.coneOuterGain,this.coneOuterAngle=e.coneOuterAngle,this.coneInnerAngle=e.coneInnerAngle,this.refDistance=e.refDistance,this.rolloffFactor=e.rolloffFactor,this.positionX=new Ca({context:this.context,param:this._panner.positionX,value:e.positionX}),this.positionY=new Ca({context:this.context,param:this._panner.positionY,value:e.positionY}),this.positionZ=new Ca({context:this.context,param:this._panner.positionZ,value:e.positionZ}),this.orientationX=new Ca({context:this.context,param:this._panner.orientationX,value:e.orientationX}),this.orientationY=new Ca({context:this.context,param:this._panner.orientationY,value:e.orientationY}),this.orientationZ=new Ca({context:this.context,param:this._panner.orientationZ,value:e.orientationZ})}static getDefaults(){return Object.assign(Sa.getDefaults(),{coneInnerAngle:360,coneOuterAngle:360,coneOuterGain:0,distanceModel:"inverse",maxDistance:1e4,orientationX:0,orientationY:0,orientationZ:0,panningModel:"equalpower",positionX:0,positionY:0,positionZ:0,refDistance:1,rolloffFactor:1})}setPosition(e,t,n){return this.positionX.value=e,this.positionY.value=t,this.positionZ.value=n,this}setOrientation(e,t,n){return this.orientationX.value=e,this.orientationY.value=t,this.orientationZ.value=n,this}get panningModel(){return this._panner.panningModel}set panningModel(e){this._panner.panningModel=e}get refDistance(){return this._panner.refDistance}set refDistance(e){this._panner.refDistance=e}get rolloffFactor(){return this._panner.rolloffFactor}set rolloffFactor(e){this._panner.rolloffFactor=e}get distanceModel(){return this._panner.distanceModel}set distanceModel(e){this._panner.distanceModel=e}get coneInnerAngle(){return this._panner.coneInnerAngle}set coneInnerAngle(e){this._panner.coneInnerAngle=e}get coneOuterAngle(){return this._panner.coneOuterAngle}set coneOuterAngle(e){this._panner.coneOuterAngle=e}get coneOuterGain(){return this._panner.coneOuterGain}set coneOuterGain(e){this._panner.coneOuterGain=e}get maxDistance(){return this._panner.maxDistance}set maxDistance(e){this._panner.maxDistance=e}dispose(){return super.dispose(),this._panner.disconnect(),this.orientationX.dispose(),this.orientationY.dispose(),this.orientationZ.dispose(),this.positionX.dispose(),this.positionY.dispose(),this.positionZ.dispose(),this}}class Il extends Sa{constructor(){super(Rr(Il.getDefaults(),arguments)),this.name="Recorder";const e=Rr(Il.getDefaults(),arguments);this.input=new Ta({context:this.context}),rr(Il.supported,"Media Recorder API is not available"),this._stream=this.context.createMediaStreamDestination(),this.input.connect(this._stream),this._recorder=new MediaRecorder(this._stream.stream,{mimeType:e.mimeType})}static getDefaults(){return Sa.getDefaults()}get mimeType(){return this._recorder.mimeType}static get supported(){return null!==vr&&Reflect.has(vr,"MediaRecorder")}get state(){return"inactive"===this._recorder.state?"stopped":"paused"===this._recorder.state?"paused":"started"}start(){return kr(this,void 0,void 0,(function*(){rr("started"!==this.state,"Recorder is already started");const e=new Promise((e=>{const t=()=>{this._recorder.removeEventListener("start",t,!1),e()};this._recorder.addEventListener("start",t,!1)}));return this._recorder.start(),yield e}))}stop(){return kr(this,void 0,void 0,(function*(){rr("stopped"!==this.state,"Recorder is not started");const e=new Promise((e=>{const t=n=>{this._recorder.removeEventListener("dataavailable",t,!1),e(n.data)};this._recorder.addEventListener("dataavailable",t,!1)}));return this._recorder.stop(),yield e}))}pause(){return rr("started"===this.state,"Recorder must be started"),this._recorder.pause(),this}dispose(){return super.dispose(),this.input.dispose(),this._stream.disconnect(),this}}class Tl extends Sa{constructor(){super(Rr(Tl.getDefaults(),arguments,["threshold","ratio"])),this.name="Compressor",this._compressor=this.context.createDynamicsCompressor(),this.input=this._compressor,this.output=this._compressor;const e=Rr(Tl.getDefaults(),arguments,["threshold","ratio"]);this.threshold=new Ca({minValue:this._compressor.threshold.minValue,maxValue:this._compressor.threshold.maxValue,context:this.context,convert:!1,param:this._compressor.threshold,units:"decibels",value:e.threshold}),this.attack=new Ca({minValue:this._compressor.attack.minValue,maxValue:this._compressor.attack.maxValue,context:this.context,param:this._compressor.attack,units:"time",value:e.attack}),this.release=new Ca({minValue:this._compressor.release.minValue,maxValue:this._compressor.release.maxValue,context:this.context,param:this._compressor.release,units:"time",value:e.release}),this.knee=new Ca({minValue:this._compressor.knee.minValue,maxValue:this._compressor.knee.maxValue,context:this.context,convert:!1,param:this._compressor.knee,units:"decibels",value:e.knee}),this.ratio=new Ca({minValue:this._compressor.ratio.minValue,maxValue:this._compressor.ratio.maxValue,context:this.context,convert:!1,param:this._compressor.ratio,units:"positive",value:e.ratio}),Zr(this,["knee","release","attack","ratio","threshold"])}static getDefaults(){return Object.assign(Sa.getDefaults(),{attack:.003,knee:30,ratio:12,release:.25,threshold:-24})}get reduction(){return this._compressor.reduction}dispose(){return super.dispose(),this._compressor.disconnect(),this.attack.dispose(),this.release.dispose(),this.threshold.dispose(),this.ratio.dispose(),this.knee.dispose(),this}}class Nl extends Sa{constructor(){super(Object.assign(Rr(Nl.getDefaults(),arguments,["threshold","smoothing"]))),this.name="Gate";const e=Rr(Nl.getDefaults(),arguments,["threshold","smoothing"]);this._follower=new Fo({context:this.context,smoothing:e.smoothing}),this._gt=new Fi({context:this.context,value:ia(e.threshold)}),this.input=new Ta({context:this.context}),this._gate=this.output=new Ta({context:this.context}),this.input.connect(this._gate),this.input.chain(this._follower,this._gt,this._gate.gain)}static getDefaults(){return Object.assign(Sa.getDefaults(),{smoothing:.1,threshold:-40})}get threshold(){return oa(this._gt.value)}set threshold(e){this._gt.value=ia(e)}get smoothing(){return this._follower.smoothing}set smoothing(e){this._follower.smoothing=e}dispose(){return super.dispose(),this.input.dispose(),this._follower.dispose(),this._gt.dispose(),this._gate.dispose(),this}}class Ol extends Sa{constructor(){super(Object.assign(Rr(Ol.getDefaults(),arguments,["threshold"]))),this.name="Limiter";const e=Rr(Ol.getDefaults(),arguments,["threshold"]);this._compressor=this.input=this.output=new Tl({context:this.context,ratio:20,attack:.003,release:.01,threshold:e.threshold}),this.threshold=this._compressor.threshold,Zr(this,"threshold")}static getDefaults(){return Object.assign(Sa.getDefaults(),{threshold:-12})}get reduction(){return this._compressor.reduction}dispose(){return super.dispose(),this._compressor.dispose(),this.threshold.dispose(),this}}class Rl extends Sa{constructor(){super(Object.assign(Rr(Rl.getDefaults(),arguments))),this.name="MidSideCompressor";const e=Rr(Rl.getDefaults(),arguments);this._midSideSplit=this.input=new ul({context:this.context}),this._midSideMerge=this.output=new cl({context:this.context}),this.mid=new Tl(Object.assign(e.mid,{context:this.context})),this.side=new Tl(Object.assign(e.side,{context:this.context})),this._midSideSplit.mid.chain(this.mid,this._midSideMerge.mid),this._midSideSplit.side.chain(this.side,this._midSideMerge.side),Zr(this,["mid","side"])}static getDefaults(){return Object.assign(Sa.getDefaults(),{mid:{ratio:3,threshold:-24,release:.03,attack:.02,knee:16},side:{ratio:6,threshold:-30,release:.25,attack:.03,knee:10}})}dispose(){return super.dispose(),this.mid.dispose(),this.side.dispose(),this._midSideSplit.dispose(),this._midSideMerge.dispose(),this}}class Dl extends Sa{constructor(){super(Object.assign(Rr(Dl.getDefaults(),arguments))),this.name="MultibandCompressor";const e=Rr(Dl.getDefaults(),arguments);this._splitter=this.input=new Sl({context:this.context,lowFrequency:e.lowFrequency,highFrequency:e.highFrequency}),this.lowFrequency=this._splitter.lowFrequency,this.highFrequency=this._splitter.highFrequency,this.output=new Ta({context:this.context}),this.low=new Tl(Object.assign(e.low,{context:this.context})),this.mid=new Tl(Object.assign(e.mid,{context:this.context})),this.high=new Tl(Object.assign(e.high,{context:this.context})),this._splitter.low.chain(this.low,this.output),this._splitter.mid.chain(this.mid,this.output),this._splitter.high.chain(this.high,this.output),Zr(this,["high","mid","low","highFrequency","lowFrequency"])}static getDefaults(){return Object.assign(Sa.getDefaults(),{lowFrequency:250,highFrequency:2e3,low:{ratio:6,threshold:-30,release:.25,attack:.03,knee:10},mid:{ratio:3,threshold:-24,release:.03,attack:.02,knee:16},high:{ratio:3,threshold:-24,release:.03,attack:.02,knee:16}})}dispose(){return super.dispose(),this._splitter.dispose(),this.low.dispose(),this.mid.dispose(),this.high.dispose(),this.output.dispose(),this}}class Ml extends Sa{constructor(){super(Rr(Ml.getDefaults(),arguments,["low","mid","high"])),this.name="EQ3",this.output=new Ta({context:this.context}),this._internalChannels=[];const e=Rr(Ml.getDefaults(),arguments,["low","mid","high"]);this.input=this._multibandSplit=new Sl({context:this.context,highFrequency:e.highFrequency,lowFrequency:e.lowFrequency}),this._lowGain=new Ta({context:this.context,gain:e.low,units:"decibels"}),this._midGain=new Ta({context:this.context,gain:e.mid,units:"decibels"}),this._highGain=new Ta({context:this.context,gain:e.high,units:"decibels"}),this.low=this._lowGain.gain,this.mid=this._midGain.gain,this.high=this._highGain.gain,this.Q=this._multibandSplit.Q,this.lowFrequency=this._multibandSplit.lowFrequency,this.highFrequency=this._multibandSplit.highFrequency,this._multibandSplit.low.chain(this._lowGain,this.output),this._multibandSplit.mid.chain(this._midGain,this.output),this._multibandSplit.high.chain(this._highGain,this.output),Zr(this,["low","mid","high","lowFrequency","highFrequency"]),this._internalChannels=[this._multibandSplit]}static getDefaults(){return Object.assign(Sa.getDefaults(),{high:0,highFrequency:2500,low:0,lowFrequency:400,mid:0})}dispose(){return super.dispose(),Yr(this,["low","mid","high","lowFrequency","highFrequency"]),this._multibandSplit.dispose(),this.lowFrequency.dispose(),this.highFrequency.dispose(),this._lowGain.dispose(),this._midGain.dispose(),this._highGain.dispose(),this.low.dispose(),this.mid.dispose(),this.high.dispose(),this.Q.dispose(),this}}class Fl extends Sa{constructor(){super(Rr(Fl.getDefaults(),arguments,["url","onload"])),this.name="Convolver",this._convolver=this.context.createConvolver();const e=Rr(Fl.getDefaults(),arguments,["url","onload"]);this._buffer=new Jr(e.url,(t=>{this.buffer=t,e.onload()})),this.input=new Ta({context:this.context}),this.output=new Ta({context:this.context}),this._buffer.loaded&&(this.buffer=this._buffer),this.normalize=e.normalize,this.input.chain(this._convolver,this.output)}static getDefaults(){return Object.assign(Sa.getDefaults(),{normalize:!0,onload:Qr})}load(e){return kr(this,void 0,void 0,(function*(){this.buffer=yield this._buffer.load(e)}))}get buffer(){return this._buffer.length?this._buffer:null}set buffer(e){e&&this._buffer.set(e),this._convolver.buffer&&(this.input.disconnect(),this._convolver.disconnect(),this._convolver=this.context.createConvolver(),this.input.chain(this._convolver,this.output));const t=this._buffer.get();this._convolver.buffer=t||null}get normalize(){return this._convolver.normalize}set normalize(e){this._convolver.normalize=e}dispose(){return super.dispose(),this._buffer.dispose(),this._convolver.disconnect(),this}}function Bl(){return sa().now()}function zl(){return sa().immediate()}const Ll=sa().transport;function Pl(){return sa().transport}const Vl=sa().destination,Wl=sa().destination;function Ul(){return sa().destination}const Gl=sa().listener;function ql(){return sa().listener}const jl=sa().draw;function Hl(){return sa().draw}const $l=sa();function Kl(){return Jr.loaded()}const Xl=Jr,Zl=Va,Yl=ti},8990:function(e,t,n){(function(){"use strict";var e;function t(e){var t=0;return function(){return t>>0)+"_",r=0;return function e(s){if(this instanceof e)throw new TypeError("Symbol is not a constructor");return new t(n+(s||"")+"_"+r++,s)}})),a("Symbol.iterator",(function(e){if(e)return e;e=Symbol("Symbol.iterator");for(var n="Array Int8Array Uint8Array Uint8ClampedArray Int16Array Uint16Array Int32Array Uint32Array Float32Array Float64Array".split(" "),a=0;a(t=t||0)&&(t=Math.max(t+s,0));ta)s[n++]=a;else{if(2048>a)s[n++]=a>>6|192;else{if(55296<=a&&57343>=a){if(56319>=a&&r=i){a=1024*(a-55296)+i-56320+65536,s[n++]=a>>18|240,s[n++]=a>>12&63|128,s[n++]=a>>6&63|128,s[n++]=63&a|128;continue}r--}if(t)throw Error("Found an unpaired surrogate");a=65533}s[n++]=a>>12|224,s[n++]=a>>6&63|128}s[n++]=63&a|128}}e=s.subarray(0,n)}return e}var D={},M=null;function F(e,t){void 0===t&&(t=0),z(),t=D[t];for(var n=Array(Math.floor(e.length/3)),s=t[64]||"",r=0,a=0;r>2];i=t[(3&i)<<4|o>>4],o=t[(15&o)<<2|l>>6],l=t[63&l],n[a++]=u+i+o+l}switch(u=0,l=s,e.length-r){case 2:l=t[(15&(u=e[r+1]))<<2]||s;case 1:e=e[r],n[a]=t[e>>2]+t[(3&e)<<4|u>>4]+l+s}return n.join("")}function B(e){var t=e.length,n=3*t/4;n%3?n=Math.floor(n):-1!="=.".indexOf(e[t-1])&&(n=-1!="=.".indexOf(e[t-2])?n-2:n-1);var s=new Uint8Array(n),r=0;return function(e,t){function n(t){for(;s>4),64!=i&&(t(a<<4&240|i>>2),64!=o&&t(i<<6&192|o))}}(e,(function(e){s[r++]=e})),s.subarray(0,r)}function z(){if(!M){M={};for(var e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789".split(""),t=["+/=","+/","-_=","-_.","-_"],n=0;5>n;n++){var s=e.concat(t[n].split(""));D[n]=s;for(var r=0;rr&&128<=t;r++)n|=(127&(t=e.h[e.g++]))<<7*r;if(128<=t&&(n|=(127&(t=e.h[e.g++]))<<28,s|=(127&t)>>4),128<=t)for(r=0;5>r&&128<=t;r++)s|=(127&(t=e.h[e.g++]))<<7*r+3;if(128>t)return e=n>>>0,(s=2147483648&(t=s>>>0))&&(t=~t>>>0,0==(e=1+~e>>>0)&&(t=t+1>>>0)),e=4294967296*t+(e>>>0),s?-e:e;e.m=!0}U.prototype.reset=function(){this.g=this.l},U.prototype.i=function(){var e=this.h,t=e[this.g],n=127&t;return 128>t?(this.g+=1,n):(n|=(127&(t=e[this.g+1]))<<7,128>t?(this.g+=2,n):(n|=(127&(t=e[this.g+2]))<<14,128>t?(this.g+=3,n):(n|=(127&(t=e[this.g+3]))<<21,128>t?(this.g+=4,n):(n|=(15&(t=e[this.g+4]))<<28,128>t?(this.g+=5,n>>>0):(this.g+=5,128<=e[this.g++]&&128<=e[this.g++]&&128<=e[this.g++]&&128<=e[this.g++]&&this.g++,n)))))},U.prototype.o=function(){var e=this.h[this.g],t=this.h[this.g+1],n=this.h[this.g+2],s=this.h[this.g+3];return this.g+=4,e=2*((n=(e|t<<8|n<<16|s<<24)>>>0)>>31)+1,t=n>>>23&255,n&=8388607,255==t?n?NaN:1/0*e:0==t?e*Math.pow(2,-149)*n:e*Math.pow(2,t-150)*(n+Math.pow(2,23))};var j=[];function H(){this.g=new Uint8Array(64),this.h=0}function $(e,t){for(;127>>=7;e.push(t)}function K(e){var t={},n=void 0!==t.N&&t.N;this.o={v:void 0!==t.v&&t.v},this.N=n,t=this.o,j.length?(n=j.pop(),t&&(n.v=t.v),e&&G(n,e),e=n):e=new U(e,t),this.g=e,this.m=this.g.g,this.h=this.i=this.l=-1,this.j=!1}function X(e){var t=e.g;if((t=t.g==t.j)||(t=e.j)||(t=(t=e.g).m||0>t.g||t.g>t.j),t)return!1;e.m=e.g.g;var n=7&(t=e.g.i());return 0!=n&&5!=n&&1!=n&&2!=n&&3!=n&&4!=n?(e.j=!0,!1):(e.i=t,e.l=t>>>3,e.h=n,!0)}function Z(e){switch(e.h){case 0:if(0!=e.h)Z(e);else{for(e=e.g;128&e.h[e.g];)e.g++;e.g++}break;case 1:1!=e.h?Z(e):(e=e.g).g+=8;break;case 2:if(2!=e.h)Z(e);else{var t=e.g.i();(e=e.g).g+=t}break;case 5:5!=e.h?Z(e):(e=e.g).g+=4;break;case 3:for(t=e.l;;){if(!X(e)){e.j=!0;break}if(4==e.h){e.l!=t&&(e.j=!0);break}Z(e)}break;default:e.j=!0}}function Y(e,t,n){var s=e.g.j,r=e.g.i(),a=e.g.g+r;if(e.g.j=a,n(t,e),0!==(n=a-e.g.g))throw Error("Message parsing ended unexpectedly. Expected to read "+r+" bytes, instead read "+(r-n)+" bytes, either the data ended unexpectedly or the message misreported its own length");return e.g.g=a,e.g.j=s,t}function Q(e){return e.g.o()}function J(e){var t,n=e.g.i(),s=(e=e.g).g;if(e.g+=n,e=e.h,N)(t=I)||(t=I=new TextDecoder("utf-8",{fatal:!1})),t=t.decode(e.subarray(s,s+n));else{n=s+n;for(var r,a,i,o=[],l=null;s(r=e[s++])?o.push(r):224>r?s>=n?o.push(65533):(a=e[s++],194>r||128!=(192&a)?(s--,o.push(65533)):o.push((31&r)<<6|63&a)):240>r?s>=n-1?o.push(65533):128!=(192&(a=e[s++]))||224===r&&160>a||237===r&&160<=a||128!=(192&(t=e[s++]))?(s--,o.push(65533)):o.push((15&r)<<12|(63&a)<<6|63&t):244>=r?s>=n-2?o.push(65533):128!=(192&(a=e[s++]))||a-144+(r<<28)>>30||128!=(192&(t=e[s++]))||128!=(192&(i=e[s++]))?(s--,o.push(65533)):(r=(7&r)<<18|(63&a)<<12|(63&t)<<6|63&i,r-=65536,o.push(55296+(r>>10&1023),56320+(1023&r))):o.push(65533),8192<=o.length&&(l=_(l,o),o.length=0);t=_(l,o)}return t}function ee(e,t,n){var s=e.g.i();for(s=e.g.g+s;e.g.gs?1:0)?-s:s)?0<1/s?W=0:(0,W=2147483648):isNaN(s)?(0,W=2147483647):34028234663852886e22>>0):11754943508222875e-54>s?(s=Math.round(s/Math.pow(2,-149)),0,W=(n<<31|s)>>>0):(t=Math.floor(Math.log(s)/Math.LN2),s*=Math.pow(2,-t),16777216<=(s=Math.round(8388608*s))&&++t,0,W=(n<<31|t+127<<23|8388607&s)>>>0),n=W,e.push(n>>>0&255),e.push(n>>>8&255),e.push(n>>>16&255),e.push(n>>>24&255)}}H.prototype.push=function(e){if(!(this.h+1=e.l?e.i?e.i[t]:void 0:e.h[t+e.j]}function ye(e,t){var n=void 0!==n&&n,s=ge(e,t,n);return null==s&&(s=fe),s===fe&&xe(e,t,s=de([]),n),s}function be(e){var t=ye(e,3);if(e.m||(e.m={}),!e.m[3]){for(var n=0;n=e.l?(me(e),e.i[t]=n):e.h[t+e.j]=n}function Ae(e,t,n){if(-1===n)return null;if(e.g||(e.g={}),!e.g[n]){var s=ge(e,n,!1);s&&(e.g[n]=new t(s))}return e.g[n]}function ke(e,t){e.g||(e.g={});var n=e.g[1];if(!n){var s=ye(e,1);n=[];for(var r=0;r_;var I=(_=Math.abs(_))>>>0;for(_=Math.floor((_-I)/4294967296),_>>>=0,S&&(_=~_>>>0,4294967295<(I=1+(~I>>>0))&&(I=0,4294967295<++_&&(_=0))),S=W=I,I=_;0>>7|I<<25)>>>0,I>>>=7;E.push(S)}if(_e(k,C),A=re(A),v.call(w,x,A),y.O)for(w=0;w_;_++)S.push(127&I|128),I>>=7;S.push(1)}ae(E,2,ge(C,2)),null!=(S=ge(C,3))&&(S=R(S),$(E.g,26),$(E.g,S.length),se(E,E.g.end()),se(E,S)),null!=(S=ge(C,4))&&(S=R(S),$(E.g,34),$(E.g,S.length),se(E,E.g.end()),se(E,S)),_e(C,E),k=re(k),x.call(v,A,k)}}f=f.data;break e;default:f={}}}switch(c=f,h=u.stream,u.type){case"video":r.pushTexture2d(Object.assign(Object.assign({},c),{stream:h,timestamp:s}));break;case"detections":(d=c).stream=h,d.timestamp=s,r.pushDetectionList(d);break;default:throw Error("Unknown input config type: '"+u.type+"'")}}return p.i.send(r),b(n,p.C,4);case 4:r.delete(),n.g=0}}))}))},e.onResults=function(e,t){this.listeners[t||"$"]=e},E("Solution",nt),E("OptionType",{BOOL:0,NUMBER:1,aa:2,0:"BOOL",1:"NUMBER",2:"STRING"});var lt={files:[{url:"face_mesh_solution_packed_assets_loader.js"},{simd:!0,url:"face_mesh_solution_simd_wasm_bin.js"},{simd:!1,url:"face_mesh_solution_wasm_bin.js"}],graph:{url:"face_mesh.binarypb"},listeners:[{wants:["multi_face_geometry","image_transformed","multi_face_landmarks"],outs:{image:"image_transformed",multiFaceGeometry:{type:"proto_list",stream:"multi_face_geometry",transform:function(e){return e.map(ot)}},multiFaceLandmarks:{type:"proto_list",stream:"multi_face_landmarks",transform:function(e){return e.map((function(e){return ke(Ve(e),ze).map(Xe)}))}}}}],inputs:{image:{type:"video",stream:"input_frames_gpu"}},options:{useCpuInference:{type:0,graphOptionXref:{calculatorType:"InferenceCalculator",fieldName:"use_cpu_inference"},default:"iPad Simulator;iPhone Simulator;iPod Simulator;iPad;iPhone;iPod".split(";").includes(navigator.platform)||navigator.userAgent.includes("Mac")&&"ontouchend"in document},enableFaceGeometry:{type:0,graphOptionXref:{calculatorName:"EnableFaceGeometryConstant",calculatorType:"ConstantSidePacketCalculator",fieldName:"bool_value"}},selfieMode:{type:0,graphOptionXref:{calculatorType:"GlScalerCalculator",calculatorIndex:1,fieldName:"flip_horizontal"}},maxNumFaces:{type:1,graphOptionXref:{calculatorType:"ConstantSidePacketCalculator",calculatorName:"ConstantSidePacketCalculatorNumFaces",fieldName:"int_value"}},refineLandmarks:{type:0,graphOptionXref:{calculatorType:"ConstantSidePacketCalculator",calculatorName:"ConstantSidePacketCalculatorRefineLandmarks",fieldName:"bool_value"}},minDetectionConfidence:{type:1,graphOptionXref:{calculatorType:"TensorsToDetectionsCalculator",calculatorName:"facelandmarkfrontgpu__facedetectionshortrangegpu__facedetectionshortrangecommon__TensorsToDetectionsCalculator",fieldName:"min_score_thresh"}},minTrackingConfidence:{type:1,graphOptionXref:{calculatorType:"ThresholdingCalculator",calculatorName:"facelandmarkfrontgpu__facelandmarkgpu__ThresholdingCalculator",fieldName:"threshold"}},cameraNear:{type:1,graphOptionXref:{calculatorType:"FaceGeometryEnvGeneratorCalculator",fieldName:"near"}},cameraFar:{type:1,graphOptionXref:{calculatorType:"FaceGeometryEnvGeneratorCalculator",fieldName:"far"}},cameraVerticalFovDegrees:{type:1,graphOptionXref:{calculatorType:"FaceGeometryEnvGeneratorCalculator",fieldName:"vertical_fov_degrees"}}}},ut=[[61,146],[146,91],[91,181],[181,84],[84,17],[17,314],[314,405],[405,321],[321,375],[375,291],[61,185],[185,40],[40,39],[39,37],[37,0],[0,267],[267,269],[269,270],[270,409],[409,291],[78,95],[95,88],[88,178],[178,87],[87,14],[14,317],[317,402],[402,318],[318,324],[324,308],[78,191],[191,80],[80,81],[81,82],[82,13],[13,312],[312,311],[311,310],[310,415],[415,308]],ct=[[263,249],[249,390],[390,373],[373,374],[374,380],[380,381],[381,382],[382,362],[263,466],[466,388],[388,387],[387,386],[386,385],[385,384],[384,398],[398,362]],ht=[[276,283],[283,282],[282,295],[295,285],[300,293],[293,334],[334,296],[296,336]],dt=[[33,7],[7,163],[163,144],[144,145],[145,153],[153,154],[154,155],[155,133],[33,246],[246,161],[161,160],[160,159],[159,158],[158,157],[157,173],[173,133]],pt=[[46,53],[53,52],[52,65],[65,55],[70,63],[63,105],[105,66],[66,107]],ft=[[10,338],[338,297],[297,332],[332,284],[284,251],[251,389],[389,356],[356,454],[454,323],[323,361],[361,288],[288,397],[397,365],[365,379],[379,378],[378,400],[400,377],[377,152],[152,148],[148,176],[176,149],[149,150],[150,136],[136,172],[172,58],[58,132],[132,93],[93,234],[234,127],[127,162],[162,21],[21,54],[54,103],[103,67],[67,109],[109,10]],mt=[].concat(l(ut),l(ct),l(ht),l(dt),l(pt),l(ft));function gt(e){e=e||{},e=Object.assign(Object.assign({},lt),e),this.g=new nt(e)}(e=gt.prototype).close=function(){return this.g.close(),Promise.resolve()},e.onResults=function(e){this.g.onResults(e)},e.initialize=function(){return Re(this,(function e(){var t=this;return k(e,(function(e){return b(e,t.g.initialize(),0)}))}))},e.reset=function(){this.g.reset()},e.send=function(e){return Re(this,(function t(){var n=this;return k(t,(function(t){return b(t,n.g.send(e),0)}))}))},e.setOptions=function(e){this.g.setOptions(e)},E("FACE_GEOMETRY",{Layout:{COLUMN_MAJOR:0,ROW_MAJOR:1,0:"COLUMN_MAJOR",1:"ROW_MAJOR"},PrimitiveType:{TRIANGLE:0,0:"TRIANGLE"},VertexType:{VERTEX_PT:0,0:"VERTEX_PT"},DEFAULT_CAMERA_PARAMS:{verticalFovDegrees:63,near:1,far:1e4}}),E("FaceMesh",gt),E("FACEMESH_LIPS",ut),E("FACEMESH_LEFT_EYE",ct),E("FACEMESH_LEFT_EYEBROW",ht),E("FACEMESH_LEFT_IRIS",[[474,475],[475,476],[476,477],[477,474]]),E("FACEMESH_RIGHT_EYE",dt),E("FACEMESH_RIGHT_EYEBROW",pt),E("FACEMESH_RIGHT_IRIS",[[469,470],[470,471],[471,472],[472,469]]),E("FACEMESH_FACE_OVAL",ft),E("FACEMESH_CONTOURS",mt),E("FACEMESH_TESSELATION",[[127,34],[34,139],[139,127],[11,0],[0,37],[37,11],[232,231],[231,120],[120,232],[72,37],[37,39],[39,72],[128,121],[121,47],[47,128],[232,121],[121,128],[128,232],[104,69],[69,67],[67,104],[175,171],[171,148],[148,175],[118,50],[50,101],[101,118],[73,39],[39,40],[40,73],[9,151],[151,108],[108,9],[48,115],[115,131],[131,48],[194,204],[204,211],[211,194],[74,40],[40,185],[185,74],[80,42],[42,183],[183,80],[40,92],[92,186],[186,40],[230,229],[229,118],[118,230],[202,212],[212,214],[214,202],[83,18],[18,17],[17,83],[76,61],[61,146],[146,76],[160,29],[29,30],[30,160],[56,157],[157,173],[173,56],[106,204],[204,194],[194,106],[135,214],[214,192],[192,135],[203,165],[165,98],[98,203],[21,71],[71,68],[68,21],[51,45],[45,4],[4,51],[144,24],[24,23],[23,144],[77,146],[146,91],[91,77],[205,50],[50,187],[187,205],[201,200],[200,18],[18,201],[91,106],[106,182],[182,91],[90,91],[91,181],[181,90],[85,84],[84,17],[17,85],[206,203],[203,36],[36,206],[148,171],[171,140],[140,148],[92,40],[40,39],[39,92],[193,189],[189,244],[244,193],[159,158],[158,28],[28,159],[247,246],[246,161],[161,247],[236,3],[3,196],[196,236],[54,68],[68,104],[104,54],[193,168],[168,8],[8,193],[117,228],[228,31],[31,117],[189,193],[193,55],[55,189],[98,97],[97,99],[99,98],[126,47],[47,100],[100,126],[166,79],[79,218],[218,166],[155,154],[154,26],[26,155],[209,49],[49,131],[131,209],[135,136],[136,150],[150,135],[47,126],[126,217],[217,47],[223,52],[52,53],[53,223],[45,51],[51,134],[134,45],[211,170],[170,140],[140,211],[67,69],[69,108],[108,67],[43,106],[106,91],[91,43],[230,119],[119,120],[120,230],[226,130],[130,247],[247,226],[63,53],[53,52],[52,63],[238,20],[20,242],[242,238],[46,70],[70,156],[156,46],[78,62],[62,96],[96,78],[46,53],[53,63],[63,46],[143,34],[34,227],[227,143],[123,117],[117,111],[111,123],[44,125],[125,19],[19,44],[236,134],[134,51],[51,236],[216,206],[206,205],[205,216],[154,153],[153,22],[22,154],[39,37],[37,167],[167,39],[200,201],[201,208],[208,200],[36,142],[142,100],[100,36],[57,212],[212,202],[202,57],[20,60],[60,99],[99,20],[28,158],[158,157],[157,28],[35,226],[226,113],[113,35],[160,159],[159,27],[27,160],[204,202],[202,210],[210,204],[113,225],[225,46],[46,113],[43,202],[202,204],[204,43],[62,76],[76,77],[77,62],[137,123],[123,116],[116,137],[41,38],[38,72],[72,41],[203,129],[129,142],[142,203],[64,98],[98,240],[240,64],[49,102],[102,64],[64,49],[41,73],[73,74],[74,41],[212,216],[216,207],[207,212],[42,74],[74,184],[184,42],[169,170],[170,211],[211,169],[170,149],[149,176],[176,170],[105,66],[66,69],[69,105],[122,6],[6,168],[168,122],[123,147],[147,187],[187,123],[96,77],[77,90],[90,96],[65,55],[55,107],[107,65],[89,90],[90,180],[180,89],[101,100],[100,120],[120,101],[63,105],[105,104],[104,63],[93,137],[137,227],[227,93],[15,86],[86,85],[85,15],[129,102],[102,49],[49,129],[14,87],[87,86],[86,14],[55,8],[8,9],[9,55],[100,47],[47,121],[121,100],[145,23],[23,22],[22,145],[88,89],[89,179],[179,88],[6,122],[122,196],[196,6],[88,95],[95,96],[96,88],[138,172],[172,136],[136,138],[215,58],[58,172],[172,215],[115,48],[48,219],[219,115],[42,80],[80,81],[81,42],[195,3],[3,51],[51,195],[43,146],[146,61],[61,43],[171,175],[175,199],[199,171],[81,82],[82,38],[38,81],[53,46],[46,225],[225,53],[144,163],[163,110],[110,144],[52,65],[65,66],[66,52],[229,228],[228,117],[117,229],[34,127],[127,234],[234,34],[107,108],[108,69],[69,107],[109,108],[108,151],[151,109],[48,64],[64,235],[235,48],[62,78],[78,191],[191,62],[129,209],[209,126],[126,129],[111,35],[35,143],[143,111],[117,123],[123,50],[50,117],[222,65],[65,52],[52,222],[19,125],[125,141],[141,19],[221,55],[55,65],[65,221],[3,195],[195,197],[197,3],[25,7],[7,33],[33,25],[220,237],[237,44],[44,220],[70,71],[71,139],[139,70],[122,193],[193,245],[245,122],[247,130],[130,33],[33,247],[71,21],[21,162],[162,71],[170,169],[169,150],[150,170],[188,174],[174,196],[196,188],[216,186],[186,92],[92,216],[2,97],[97,167],[167,2],[141,125],[125,241],[241,141],[164,167],[167,37],[37,164],[72,38],[38,12],[12,72],[38,82],[82,13],[13,38],[63,68],[68,71],[71,63],[226,35],[35,111],[111,226],[101,50],[50,205],[205,101],[206,92],[92,165],[165,206],[209,198],[198,217],[217,209],[165,167],[167,97],[97,165],[220,115],[115,218],[218,220],[133,112],[112,243],[243,133],[239,238],[238,241],[241,239],[214,135],[135,169],[169,214],[190,173],[173,133],[133,190],[171,208],[208,32],[32,171],[125,44],[44,237],[237,125],[86,87],[87,178],[178,86],[85,86],[86,179],[179,85],[84,85],[85,180],[180,84],[83,84],[84,181],[181,83],[201,83],[83,182],[182,201],[137,93],[93,132],[132,137],[76,62],[62,183],[183,76],[61,76],[76,184],[184,61],[57,61],[61,185],[185,57],[212,57],[57,186],[186,212],[214,207],[207,187],[187,214],[34,143],[143,156],[156,34],[79,239],[239,237],[237,79],[123,137],[137,177],[177,123],[44,1],[1,4],[4,44],[201,194],[194,32],[32,201],[64,102],[102,129],[129,64],[213,215],[215,138],[138,213],[59,166],[166,219],[219,59],[242,99],[99,97],[97,242],[2,94],[94,141],[141,2],[75,59],[59,235],[235,75],[24,110],[110,228],[228,24],[25,130],[130,226],[226,25],[23,24],[24,229],[229,23],[22,23],[23,230],[230,22],[26,22],[22,231],[231,26],[112,26],[26,232],[232,112],[189,190],[190,243],[243,189],[221,56],[56,190],[190,221],[28,56],[56,221],[221,28],[27,28],[28,222],[222,27],[29,27],[27,223],[223,29],[30,29],[29,224],[224,30],[247,30],[30,225],[225,247],[238,79],[79,20],[20,238],[166,59],[59,75],[75,166],[60,75],[75,240],[240,60],[147,177],[177,215],[215,147],[20,79],[79,166],[166,20],[187,147],[147,213],[213,187],[112,233],[233,244],[244,112],[233,128],[128,245],[245,233],[128,114],[114,188],[188,128],[114,217],[217,174],[174,114],[131,115],[115,220],[220,131],[217,198],[198,236],[236,217],[198,131],[131,134],[134,198],[177,132],[132,58],[58,177],[143,35],[35,124],[124,143],[110,163],[163,7],[7,110],[228,110],[110,25],[25,228],[356,389],[389,368],[368,356],[11,302],[302,267],[267,11],[452,350],[350,349],[349,452],[302,303],[303,269],[269,302],[357,343],[343,277],[277,357],[452,453],[453,357],[357,452],[333,332],[332,297],[297,333],[175,152],[152,377],[377,175],[347,348],[348,330],[330,347],[303,304],[304,270],[270,303],[9,336],[336,337],[337,9],[278,279],[279,360],[360,278],[418,262],[262,431],[431,418],[304,408],[408,409],[409,304],[310,415],[415,407],[407,310],[270,409],[409,410],[410,270],[450,348],[348,347],[347,450],[422,430],[430,434],[434,422],[313,314],[314,17],[17,313],[306,307],[307,375],[375,306],[387,388],[388,260],[260,387],[286,414],[414,398],[398,286],[335,406],[406,418],[418,335],[364,367],[367,416],[416,364],[423,358],[358,327],[327,423],[251,284],[284,298],[298,251],[281,5],[5,4],[4,281],[373,374],[374,253],[253,373],[307,320],[320,321],[321,307],[425,427],[427,411],[411,425],[421,313],[313,18],[18,421],[321,405],[405,406],[406,321],[320,404],[404,405],[405,320],[315,16],[16,17],[17,315],[426,425],[425,266],[266,426],[377,400],[400,369],[369,377],[322,391],[391,269],[269,322],[417,465],[465,464],[464,417],[386,257],[257,258],[258,386],[466,260],[260,388],[388,466],[456,399],[399,419],[419,456],[284,332],[332,333],[333,284],[417,285],[285,8],[8,417],[346,340],[340,261],[261,346],[413,441],[441,285],[285,413],[327,460],[460,328],[328,327],[355,371],[371,329],[329,355],[392,439],[439,438],[438,392],[382,341],[341,256],[256,382],[429,420],[420,360],[360,429],[364,394],[394,379],[379,364],[277,343],[343,437],[437,277],[443,444],[444,283],[283,443],[275,440],[440,363],[363,275],[431,262],[262,369],[369,431],[297,338],[338,337],[337,297],[273,375],[375,321],[321,273],[450,451],[451,349],[349,450],[446,342],[342,467],[467,446],[293,334],[334,282],[282,293],[458,461],[461,462],[462,458],[276,353],[353,383],[383,276],[308,324],[324,325],[325,308],[276,300],[300,293],[293,276],[372,345],[345,447],[447,372],[352,345],[345,340],[340,352],[274,1],[1,19],[19,274],[456,248],[248,281],[281,456],[436,427],[427,425],[425,436],[381,256],[256,252],[252,381],[269,391],[391,393],[393,269],[200,199],[199,428],[428,200],[266,330],[330,329],[329,266],[287,273],[273,422],[422,287],[250,462],[462,328],[328,250],[258,286],[286,384],[384,258],[265,353],[353,342],[342,265],[387,259],[259,257],[257,387],[424,431],[431,430],[430,424],[342,353],[353,276],[276,342],[273,335],[335,424],[424,273],[292,325],[325,307],[307,292],[366,447],[447,345],[345,366],[271,303],[303,302],[302,271],[423,266],[266,371],[371,423],[294,455],[455,460],[460,294],[279,278],[278,294],[294,279],[271,272],[272,304],[304,271],[432,434],[434,427],[427,432],[272,407],[407,408],[408,272],[394,430],[430,431],[431,394],[395,369],[369,400],[400,395],[334,333],[333,299],[299,334],[351,417],[417,168],[168,351],[352,280],[280,411],[411,352],[325,319],[319,320],[320,325],[295,296],[296,336],[336,295],[319,403],[403,404],[404,319],[330,348],[348,349],[349,330],[293,298],[298,333],[333,293],[323,454],[454,447],[447,323],[15,16],[16,315],[315,15],[358,429],[429,279],[279,358],[14,15],[15,316],[316,14],[285,336],[336,9],[9,285],[329,349],[349,350],[350,329],[374,380],[380,252],[252,374],[318,402],[402,403],[403,318],[6,197],[197,419],[419,6],[318,319],[319,325],[325,318],[367,364],[364,365],[365,367],[435,367],[367,397],[397,435],[344,438],[438,439],[439,344],[272,271],[271,311],[311,272],[195,5],[5,281],[281,195],[273,287],[287,291],[291,273],[396,428],[428,199],[199,396],[311,271],[271,268],[268,311],[283,444],[444,445],[445,283],[373,254],[254,339],[339,373],[282,334],[334,296],[296,282],[449,347],[347,346],[346,449],[264,447],[447,454],[454,264],[336,296],[296,299],[299,336],[338,10],[10,151],[151,338],[278,439],[439,455],[455,278],[292,407],[407,415],[415,292],[358,371],[371,355],[355,358],[340,345],[345,372],[372,340],[346,347],[347,280],[280,346],[442,443],[443,282],[282,442],[19,94],[94,370],[370,19],[441,442],[442,295],[295,441],[248,419],[419,197],[197,248],[263,255],[255,359],[359,263],[440,275],[275,274],[274,440],[300,383],[383,368],[368,300],[351,412],[412,465],[465,351],[263,467],[467,466],[466,263],[301,368],[368,389],[389,301],[395,378],[378,379],[379,395],[412,351],[351,419],[419,412],[436,426],[426,322],[322,436],[2,164],[164,393],[393,2],[370,462],[462,461],[461,370],[164,0],[0,267],[267,164],[302,11],[11,12],[12,302],[268,12],[12,13],[13,268],[293,300],[300,301],[301,293],[446,261],[261,340],[340,446],[330,266],[266,425],[425,330],[426,423],[423,391],[391,426],[429,355],[355,437],[437,429],[391,327],[327,326],[326,391],[440,457],[457,438],[438,440],[341,382],[382,362],[362,341],[459,457],[457,461],[461,459],[434,430],[430,394],[394,434],[414,463],[463,362],[362,414],[396,369],[369,262],[262,396],[354,461],[461,457],[457,354],[316,403],[403,402],[402,316],[315,404],[404,403],[403,315],[314,405],[405,404],[404,314],[313,406],[406,405],[405,313],[421,418],[418,406],[406,421],[366,401],[401,361],[361,366],[306,408],[408,407],[407,306],[291,409],[409,408],[408,291],[287,410],[410,409],[409,287],[432,436],[436,410],[410,432],[434,416],[416,411],[411,434],[264,368],[368,383],[383,264],[309,438],[438,457],[457,309],[352,376],[376,401],[401,352],[274,275],[275,4],[4,274],[421,428],[428,262],[262,421],[294,327],[327,358],[358,294],[433,416],[416,367],[367,433],[289,455],[455,439],[439,289],[462,370],[370,326],[326,462],[2,326],[326,370],[370,2],[305,460],[460,455],[455,305],[254,449],[449,448],[448,254],[255,261],[261,446],[446,255],[253,450],[450,449],[449,253],[252,451],[451,450],[450,252],[256,452],[452,451],[451,256],[341,453],[453,452],[452,341],[413,464],[464,463],[463,413],[441,413],[413,414],[414,441],[258,442],[442,441],[441,258],[257,443],[443,442],[442,257],[259,444],[444,443],[443,259],[260,445],[445,444],[444,260],[467,342],[342,445],[445,467],[459,458],[458,250],[250,459],[289,392],[392,290],[290,289],[290,328],[328,460],[460,290],[376,433],[433,435],[435,376],[250,290],[290,392],[392,250],[411,416],[416,433],[433,411],[341,463],[463,464],[464,341],[453,464],[464,465],[465,453],[357,465],[465,412],[412,357],[343,412],[412,399],[399,343],[360,363],[363,440],[440,360],[437,399],[399,456],[456,437],[420,456],[456,363],[363,420],[401,435],[435,288],[288,401],[372,383],[383,353],[353,372],[339,255],[255,249],[249,339],[448,261],[261,255],[255,448],[133,243],[243,190],[190,133],[133,155],[155,112],[112,133],[33,246],[246,247],[247,33],[33,130],[130,25],[25,33],[398,384],[384,286],[286,398],[362,398],[398,414],[414,362],[362,463],[463,341],[341,362],[263,359],[359,467],[467,263],[263,249],[249,255],[255,263],[466,467],[467,260],[260,466],[75,60],[60,166],[166,75],[238,239],[239,79],[79,238],[162,127],[127,139],[139,162],[72,11],[11,37],[37,72],[121,232],[232,120],[120,121],[73,72],[72,39],[39,73],[114,128],[128,47],[47,114],[233,232],[232,128],[128,233],[103,104],[104,67],[67,103],[152,175],[175,148],[148,152],[119,118],[118,101],[101,119],[74,73],[73,40],[40,74],[107,9],[9,108],[108,107],[49,48],[48,131],[131,49],[32,194],[194,211],[211,32],[184,74],[74,185],[185,184],[191,80],[80,183],[183,191],[185,40],[40,186],[186,185],[119,230],[230,118],[118,119],[210,202],[202,214],[214,210],[84,83],[83,17],[17,84],[77,76],[76,146],[146,77],[161,160],[160,30],[30,161],[190,56],[56,173],[173,190],[182,106],[106,194],[194,182],[138,135],[135,192],[192,138],[129,203],[203,98],[98,129],[54,21],[21,68],[68,54],[5,51],[51,4],[4,5],[145,144],[144,23],[23,145],[90,77],[77,91],[91,90],[207,205],[205,187],[187,207],[83,201],[201,18],[18,83],[181,91],[91,182],[182,181],[180,90],[90,181],[181,180],[16,85],[85,17],[17,16],[205,206],[206,36],[36,205],[176,148],[148,140],[140,176],[165,92],[92,39],[39,165],[245,193],[193,244],[244,245],[27,159],[159,28],[28,27],[30,247],[247,161],[161,30],[174,236],[236,196],[196,174],[103,54],[54,104],[104,103],[55,193],[193,8],[8,55],[111,117],[117,31],[31,111],[221,189],[189,55],[55,221],[240,98],[98,99],[99,240],[142,126],[126,100],[100,142],[219,166],[166,218],[218,219],[112,155],[155,26],[26,112],[198,209],[209,131],[131,198],[169,135],[135,150],[150,169],[114,47],[47,217],[217,114],[224,223],[223,53],[53,224],[220,45],[45,134],[134,220],[32,211],[211,140],[140,32],[109,67],[67,108],[108,109],[146,43],[43,91],[91,146],[231,230],[230,120],[120,231],[113,226],[226,247],[247,113],[105,63],[63,52],[52,105],[241,238],[238,242],[242,241],[124,46],[46,156],[156,124],[95,78],[78,96],[96,95],[70,46],[46,63],[63,70],[116,143],[143,227],[227,116],[116,123],[123,111],[111,116],[1,44],[44,19],[19,1],[3,236],[236,51],[51,3],[207,216],[216,205],[205,207],[26,154],[154,22],[22,26],[165,39],[39,167],[167,165],[199,200],[200,208],[208,199],[101,36],[36,100],[100,101],[43,57],[57,202],[202,43],[242,20],[20,99],[99,242],[56,28],[28,157],[157,56],[124,35],[35,113],[113,124],[29,160],[160,27],[27,29],[211,204],[204,210],[210,211],[124,113],[113,46],[46,124],[106,43],[43,204],[204,106],[96,62],[62,77],[77,96],[227,137],[137,116],[116,227],[73,41],[41,72],[72,73],[36,203],[203,142],[142,36],[235,64],[64,240],[240,235],[48,49],[49,64],[64,48],[42,41],[41,74],[74,42],[214,212],[212,207],[207,214],[183,42],[42,184],[184,183],[210,169],[169,211],[211,210],[140,170],[170,176],[176,140],[104,105],[105,69],[69,104],[193,122],[122,168],[168,193],[50,123],[123,187],[187,50],[89,96],[96,90],[90,89],[66,65],[65,107],[107,66],[179,89],[89,180],[180,179],[119,101],[101,120],[120,119],[68,63],[63,104],[104,68],[234,93],[93,227],[227,234],[16,15],[15,85],[85,16],[209,129],[129,49],[49,209],[15,14],[14,86],[86,15],[107,55],[55,9],[9,107],[120,100],[100,121],[121,120],[153,145],[145,22],[22,153],[178,88],[88,179],[179,178],[197,6],[6,196],[196,197],[89,88],[88,96],[96,89],[135,138],[138,136],[136,135],[138,215],[215,172],[172,138],[218,115],[115,219],[219,218],[41,42],[42,81],[81,41],[5,195],[195,51],[51,5],[57,43],[43,61],[61,57],[208,171],[171,199],[199,208],[41,81],[81,38],[38,41],[224,53],[53,225],[225,224],[24,144],[144,110],[110,24],[105,52],[52,66],[66,105],[118,229],[229,117],[117,118],[227,34],[34,234],[234,227],[66,107],[107,69],[69,66],[10,109],[109,151],[151,10],[219,48],[48,235],[235,219],[183,62],[62,191],[191,183],[142,129],[129,126],[126,142],[116,111],[111,143],[143,116],[118,117],[117,50],[50,118],[223,222],[222,52],[52,223],[94,19],[19,141],[141,94],[222,221],[221,65],[65,222],[196,3],[3,197],[197,196],[45,220],[220,44],[44,45],[156,70],[70,139],[139,156],[188,122],[122,245],[245,188],[139,71],[71,162],[162,139],[149,170],[170,150],[150,149],[122,188],[188,196],[196,122],[206,216],[216,92],[92,206],[164,2],[2,167],[167,164],[242,141],[141,241],[241,242],[0,164],[164,37],[37,0],[11,72],[72,12],[12,11],[12,38],[38,13],[13,12],[70,63],[63,71],[71,70],[31,226],[226,111],[111,31],[36,101],[101,205],[205,36],[203,206],[206,165],[165,203],[126,209],[209,217],[217,126],[98,165],[165,97],[97,98],[237,220],[220,218],[218,237],[237,239],[239,241],[241,237],[210,214],[214,169],[169,210],[140,171],[171,32],[32,140],[241,125],[125,237],[237,241],[179,86],[86,178],[178,179],[180,85],[85,179],[179,180],[181,84],[84,180],[180,181],[182,83],[83,181],[181,182],[194,201],[201,182],[182,194],[177,137],[137,132],[132,177],[184,76],[76,183],[183,184],[185,61],[61,184],[184,185],[186,57],[57,185],[185,186],[216,212],[212,186],[186,216],[192,214],[214,187],[187,192],[139,34],[34,156],[156,139],[218,79],[79,237],[237,218],[147,123],[123,177],[177,147],[45,44],[44,4],[4,45],[208,201],[201,32],[32,208],[98,64],[64,129],[129,98],[192,213],[213,138],[138,192],[235,59],[59,219],[219,235],[141,242],[242,97],[97,141],[97,2],[2,141],[141,97],[240,75],[75,235],[235,240],[229,24],[24,228],[228,229],[31,25],[25,226],[226,31],[230,23],[23,229],[229,230],[231,22],[22,230],[230,231],[232,26],[26,231],[231,232],[233,112],[112,232],[232,233],[244,189],[189,243],[243,244],[189,221],[221,190],[190,189],[222,28],[28,221],[221,222],[223,27],[27,222],[222,223],[224,29],[29,223],[223,224],[225,30],[30,224],[224,225],[113,247],[247,225],[225,113],[99,60],[60,240],[240,99],[213,147],[147,215],[215,213],[60,20],[20,166],[166,60],[192,187],[187,213],[213,192],[243,112],[112,244],[244,243],[244,233],[233,245],[245,244],[245,128],[128,188],[188,245],[188,114],[114,174],[174,188],[134,131],[131,220],[220,134],[174,217],[217,236],[236,174],[236,198],[198,134],[134,236],[215,177],[177,58],[58,215],[156,143],[143,124],[124,156],[25,110],[110,7],[7,25],[31,228],[228,25],[25,31],[264,356],[356,368],[368,264],[0,11],[11,267],[267,0],[451,452],[452,349],[349,451],[267,302],[302,269],[269,267],[350,357],[357,277],[277,350],[350,452],[452,357],[357,350],[299,333],[333,297],[297,299],[396,175],[175,377],[377,396],[280,347],[347,330],[330,280],[269,303],[303,270],[270,269],[151,9],[9,337],[337,151],[344,278],[278,360],[360,344],[424,418],[418,431],[431,424],[270,304],[304,409],[409,270],[272,310],[310,407],[407,272],[322,270],[270,410],[410,322],[449,450],[450,347],[347,449],[432,422],[422,434],[434,432],[18,313],[313,17],[17,18],[291,306],[306,375],[375,291],[259,387],[387,260],[260,259],[424,335],[335,418],[418,424],[434,364],[364,416],[416,434],[391,423],[423,327],[327,391],[301,251],[251,298],[298,301],[275,281],[281,4],[4,275],[254,373],[373,253],[253,254],[375,307],[307,321],[321,375],[280,425],[425,411],[411,280],[200,421],[421,18],[18,200],[335,321],[321,406],[406,335],[321,320],[320,405],[405,321],[314,315],[315,17],[17,314],[423,426],[426,266],[266,423],[396,377],[377,369],[369,396],[270,322],[322,269],[269,270],[413,417],[417,464],[464,413],[385,386],[386,258],[258,385],[248,456],[456,419],[419,248],[298,284],[284,333],[333,298],[168,417],[417,8],[8,168],[448,346],[346,261],[261,448],[417,413],[413,285],[285,417],[326,327],[327,328],[328,326],[277,355],[355,329],[329,277],[309,392],[392,438],[438,309],[381,382],[382,256],[256,381],[279,429],[429,360],[360,279],[365,364],[364,379],[379,365],[355,277],[277,437],[437,355],[282,443],[443,283],[283,282],[281,275],[275,363],[363,281],[395,431],[431,369],[369,395],[299,297],[297,337],[337,299],[335,273],[273,321],[321,335],[348,450],[450,349],[349,348],[359,446],[446,467],[467,359],[283,293],[293,282],[282,283],[250,458],[458,462],[462,250],[300,276],[276,383],[383,300],[292,308],[308,325],[325,292],[283,276],[276,293],[293,283],[264,372],[372,447],[447,264],[346,352],[352,340],[340,346],[354,274],[274,19],[19,354],[363,456],[456,281],[281,363],[426,436],[436,425],[425,426],[380,381],[381,252],[252,380],[267,269],[269,393],[393,267],[421,200],[200,428],[428,421],[371,266],[266,329],[329,371],[432,287],[287,422],[422,432],[290,250],[250,328],[328,290],[385,258],[258,384],[384,385],[446,265],[265,342],[342,446],[386,387],[387,257],[257,386],[422,424],[424,430],[430,422],[445,342],[342,276],[276,445],[422,273],[273,424],[424,422],[306,292],[292,307],[307,306],[352,366],[366,345],[345,352],[268,271],[271,302],[302,268],[358,423],[423,371],[371,358],[327,294],[294,460],[460,327],[331,279],[279,294],[294,331],[303,271],[271,304],[304,303],[436,432],[432,427],[427,436],[304,272],[272,408],[408,304],[395,394],[394,431],[431,395],[378,395],[395,400],[400,378],[296,334],[334,299],[299,296],[6,351],[351,168],[168,6],[376,352],[352,411],[411,376],[307,325],[325,320],[320,307],[285,295],[295,336],[336,285],[320,319],[319,404],[404,320],[329,330],[330,349],[349,329],[334,293],[293,333],[333,334],[366,323],[323,447],[447,366],[316,15],[15,315],[315,316],[331,358],[358,279],[279,331],[317,14],[14,316],[316,317],[8,285],[285,9],[9,8],[277,329],[329,350],[350,277],[253,374],[374,252],[252,253],[319,318],[318,403],[403,319],[351,6],[6,419],[419,351],[324,318],[318,325],[325,324],[397,367],[367,365],[365,397],[288,435],[435,397],[397,288],[278,344],[344,439],[439,278],[310,272],[272,311],[311,310],[248,195],[195,281],[281,248],[375,273],[273,291],[291,375],[175,396],[396,199],[199,175],[312,311],[311,268],[268,312],[276,283],[283,445],[445,276],[390,373],[373,339],[339,390],[295,282],[282,296],[296,295],[448,449],[449,346],[346,448],[356,264],[264,454],[454,356],[337,336],[336,299],[299,337],[337,338],[338,151],[151,337],[294,278],[278,455],[455,294],[308,292],[292,415],[415,308],[429,358],[358,355],[355,429],[265,340],[340,372],[372,265],[352,346],[346,280],[280,352],[295,442],[442,282],[282,295],[354,19],[19,370],[370,354],[285,441],[441,295],[295,285],[195,248],[248,197],[197,195],[457,440],[440,274],[274,457],[301,300],[300,368],[368,301],[417,351],[351,465],[465,417],[251,301],[301,389],[389,251],[394,395],[395,379],[379,394],[399,412],[412,419],[419,399],[410,436],[436,322],[322,410],[326,2],[2,393],[393,326],[354,370],[370,461],[461,354],[393,164],[164,267],[267,393],[268,302],[302,12],[12,268],[312,268],[268,13],[13,312],[298,293],[293,301],[301,298],[265,446],[446,340],[340,265],[280,330],[330,425],[425,280],[322,426],[426,391],[391,322],[420,429],[429,437],[437,420],[393,391],[391,326],[326,393],[344,440],[440,438],[438,344],[458,459],[459,461],[461,458],[364,434],[434,394],[394,364],[428,396],[396,262],[262,428],[274,354],[354,457],[457,274],[317,316],[316,402],[402,317],[316,315],[315,403],[403,316],[315,314],[314,404],[404,315],[314,313],[313,405],[405,314],[313,421],[421,406],[406,313],[323,366],[366,361],[361,323],[292,306],[306,407],[407,292],[306,291],[291,408],[408,306],[291,287],[287,409],[409,291],[287,432],[432,410],[410,287],[427,434],[434,411],[411,427],[372,264],[264,383],[383,372],[459,309],[309,457],[457,459],[366,352],[352,401],[401,366],[1,274],[274,4],[4,1],[418,421],[421,262],[262,418],[331,294],[294,358],[358,331],[435,433],[433,367],[367,435],[392,289],[289,439],[439,392],[328,462],[462,326],[326,328],[94,2],[2,370],[370,94],[289,305],[305,455],[455,289],[339,254],[254,448],[448,339],[359,255],[255,446],[446,359],[254,253],[253,449],[449,254],[253,252],[252,450],[450,253],[252,256],[256,451],[451,252],[256,341],[341,452],[452,256],[414,413],[413,463],[463,414],[286,441],[441,414],[414,286],[286,258],[258,441],[441,286],[258,257],[257,442],[442,258],[257,259],[259,443],[443,257],[259,260],[260,444],[444,259],[260,467],[467,445],[445,260],[309,459],[459,250],[250,309],[305,289],[289,290],[290,305],[305,290],[290,460],[460,305],[401,376],[376,435],[435,401],[309,250],[250,392],[392,309],[376,411],[411,433],[433,376],[453,341],[341,464],[464,453],[357,453],[453,465],[465,357],[343,357],[357,412],[412,343],[437,343],[343,399],[399,437],[344,360],[360,440],[440,344],[420,437],[437,456],[456,420],[360,420],[420,363],[363,360],[361,401],[401,288],[288,361],[265,372],[372,353],[353,265],[390,339],[339,249],[249,390],[339,448],[448,255],[255,339]]),E("matrixDataToMatrix",(function(e){for(var t=e.getCols(),n=e.getRows(),s=e.getPackedDataList(),r=[],a=0;a{e.exports=function e(t,n,s){function r(i,o){if(!n[i]){if(!t[i]){if(a)return a(i,!0);var l=new Error("Cannot find module '"+i+"'");throw l.code="MODULE_NOT_FOUND",l}var u=n[i]={exports:{}};t[i][0].call(u.exports,(function(e){var n=t[i][1][e];return r(n||e)}),u,u.exports,e,t,n,s)}return n[i].exports}for(var a=void 0,i=0;i=43)}})).catch((function(){return!1}))}function A(e){return"boolean"==typeof m?u.resolve(m):x(e).then((function(e){return m=e}))}function k(e){var t=g[e.name],n={};n.promise=new u((function(e,t){n.resolve=e,n.reject=t})),t.deferredOperations.push(n),t.dbReady?t.dbReady=t.dbReady.then((function(){return n.promise})):t.dbReady=n.promise}function C(e){var t=g[e.name].deferredOperations.pop();if(t)return t.resolve(),t.promise}function S(e,t){var n=g[e.name].deferredOperations.pop();if(n)return n.reject(t),n.promise}function E(e,t){return new u((function(n,s){if(g[e.name]=g[e.name]||B(),e.db){if(!t)return n(e.db);k(e),e.db.close()}var r=[e.name];t&&r.push(e.version);var a=i.open.apply(i,r);t&&(a.onupgradeneeded=function(t){var n=a.result;try{n.createObjectStore(e.storeName),t.oldVersion<=1&&n.createObjectStore(f)}catch(e){if("ConstraintError"!==e.name)throw e}}),a.onerror=function(e){e.preventDefault(),s(a.error)},a.onsuccess=function(){var t=a.result;t.onversionchange=function(e){e.target.close()},n(t),C(e)}}))}function _(e){return E(e,!1)}function I(e){return E(e,!0)}function T(e,t){if(!e.db)return!0;var n=!e.db.objectStoreNames.contains(e.storeName),s=e.versione.db.version;if(s&&(e.version,e.version=e.db.version),r||n){if(n){var a=e.db.version+1;a>e.version&&(e.version=a)}return!0}return!1}function N(e){return new u((function(t,n){var s=new FileReader;s.onerror=n,s.onloadend=function(n){var s=btoa(n.target.result||"");t({__local_forage_encoded_blob:!0,data:s,type:e.type})},s.readAsBinaryString(e)}))}function O(e){return l([v(atob(e.data))],{type:e.type})}function R(e){return e&&e.__local_forage_encoded_blob}function D(e){var t=this,n=t._initReady().then((function(){var e=g[t._dbInfo.name];if(e&&e.dbReady)return e.dbReady}));return h(n,e,e),n}function M(e){k(e);for(var t=g[e.name],n=t.forages,s=0;s0&&(!e.db||"InvalidStateError"===r.name||"NotFoundError"===r.name))return u.resolve().then((function(){if(!e.db||"NotFoundError"===r.name&&!e.db.objectStoreNames.contains(e.storeName)&&e.version<=e.db.version)return e.db&&(e.version=e.db.version+1),I(e)})).then((function(){return M(e).then((function(){F(e,t,n,s-1)}))})).catch(n);n(r)}}function B(){return{forages:[],db:null,dbReady:null,deferredOperations:[]}}function z(e){var t=this,n={db:null};if(e)for(var s in e)n[s]=e[s];var r=g[n.name];r||(r=B(),g[n.name]=r),r.forages.push(t),t._initReady||(t._initReady=t.ready,t.ready=D);var a=[];function i(){return u.resolve()}for(var o=0;o>4,c[l++]=(15&s)<<4|r>>2,c[l++]=(3&r)<<6|63&a;return u}function fe(e){var t,n=new Uint8Array(e),s="";for(t=0;t>2],s+=X[(3&n[t])<<4|n[t+1]>>4],s+=X[(15&n[t+1])<<2|n[t+2]>>6],s+=X[63&n[t+2]];return n.length%3==2?s=s.substring(0,s.length-1)+"=":n.length%3==1&&(s=s.substring(0,s.length-2)+"=="),s}function me(e,t){var n="";if(e&&(n=de.call(e)),e&&("[object ArrayBuffer]"===n||e.buffer&&"[object ArrayBuffer]"===de.call(e.buffer))){var s,r=Q;e instanceof ArrayBuffer?(s=e,r+=ee):(s=e.buffer,"[object Int8Array]"===n?r+=ne:"[object Uint8Array]"===n?r+=se:"[object Uint8ClampedArray]"===n?r+=re:"[object Int16Array]"===n?r+=ae:"[object Uint16Array]"===n?r+=oe:"[object Int32Array]"===n?r+=ie:"[object Uint32Array]"===n?r+=le:"[object Float32Array]"===n?r+=ue:"[object Float64Array]"===n?r+=ce:t(new Error("Failed to get type for BinaryArray"))),t(r+fe(s))}else if("[object Blob]"===n){var a=new FileReader;a.onload=function(){var n=Z+e.type+"~"+fe(this.result);t(Q+te+n)},a.readAsArrayBuffer(e)}else try{t(JSON.stringify(e))}catch(e){t(null,e)}}function ge(e){if(e.substring(0,J)!==Q)return JSON.parse(e);var t,n=e.substring(he),s=e.substring(J,he);if(s===te&&Y.test(n)){var r=n.match(Y);t=r[1],n=n.substring(r[0].length)}var a=pe(n);switch(s){case ee:return a;case te:return l([a],{type:t});case ne:return new Int8Array(a);case se:return new Uint8Array(a);case re:return new Uint8ClampedArray(a);case ae:return new Int16Array(a);case oe:return new Uint16Array(a);case ie:return new Int32Array(a);case le:return new Uint32Array(a);case ue:return new Float32Array(a);case ce:return new Float64Array(a);default:throw new Error("Unkown type: "+s)}}var ye={serialize:me,deserialize:ge,stringToBuffer:pe,bufferToString:fe};function be(e,t,n,s){e.executeSql("CREATE TABLE IF NOT EXISTS "+t.storeName+" (id INTEGER PRIMARY KEY, key unique, value)",[],n,s)}function we(e){var t=this,n={db:null};if(e)for(var s in e)n[s]="string"!=typeof e[s]?e[s].toString():e[s];var r=new u((function(e,s){try{n.db=openDatabase(n.name,String(n.version),n.description,n.size)}catch(e){return s(e)}n.db.transaction((function(r){be(r,n,(function(){t._dbInfo=n,e()}),(function(e,t){s(t)}))}),s)}));return n.serializer=ye,r}function ve(e,t,n,s,r,a){e.executeSql(n,s,r,(function(e,i){i.code===i.SYNTAX_ERR?e.executeSql("SELECT name FROM sqlite_master WHERE type='table' AND name = ?",[t.storeName],(function(e,o){o.rows.length?a(e,i):be(e,t,(function(){e.executeSql(n,s,r,a)}),a)}),a):a(e,i)}),a)}function xe(e,t){var n=this;e=d(e);var s=new u((function(t,s){n.ready().then((function(){var r=n._dbInfo;r.db.transaction((function(n){ve(n,r,"SELECT * FROM "+r.storeName+" WHERE key = ? LIMIT 1",[e],(function(e,n){var s=n.rows.length?n.rows.item(0).value:null;s&&(s=r.serializer.deserialize(s)),t(s)}),(function(e,t){s(t)}))}))})).catch(s)}));return c(s,t),s}function Ae(e,t){var n=this,s=new u((function(t,s){n.ready().then((function(){var r=n._dbInfo;r.db.transaction((function(n){ve(n,r,"SELECT * FROM "+r.storeName,[],(function(n,s){for(var a=s.rows,i=a.length,o=0;o0)return void a(ke.apply(r,[e,o,n,s-1]));i(t)}}))}))})).catch(i)}));return c(a,n),a}function Ce(e,t,n){return ke.apply(this,[e,t,n,1])}function Se(e,t){var n=this;e=d(e);var s=new u((function(t,s){n.ready().then((function(){var r=n._dbInfo;r.db.transaction((function(n){ve(n,r,"DELETE FROM "+r.storeName+" WHERE key = ?",[e],(function(){t()}),(function(e,t){s(t)}))}))})).catch(s)}));return c(s,t),s}function Ee(e){var t=this,n=new u((function(e,n){t.ready().then((function(){var s=t._dbInfo;s.db.transaction((function(t){ve(t,s,"DELETE FROM "+s.storeName,[],(function(){e()}),(function(e,t){n(t)}))}))})).catch(n)}));return c(n,e),n}function _e(e){var t=this,n=new u((function(e,n){t.ready().then((function(){var s=t._dbInfo;s.db.transaction((function(t){ve(t,s,"SELECT COUNT(key) as c FROM "+s.storeName,[],(function(t,n){var s=n.rows.item(0).c;e(s)}),(function(e,t){n(t)}))}))})).catch(n)}));return c(n,e),n}function Ie(e,t){var n=this,s=new u((function(t,s){n.ready().then((function(){var r=n._dbInfo;r.db.transaction((function(n){ve(n,r,"SELECT key FROM "+r.storeName+" WHERE id = ? LIMIT 1",[e+1],(function(e,n){var s=n.rows.length?n.rows.item(0).key:null;t(s)}),(function(e,t){s(t)}))}))})).catch(s)}));return c(s,t),s}function Te(e){var t=this,n=new u((function(e,n){t.ready().then((function(){var s=t._dbInfo;s.db.transaction((function(t){ve(t,s,"SELECT key FROM "+s.storeName,[],(function(t,n){for(var s=[],r=0;r '__WebKitDatabaseInfoTable__'",[],(function(n,s){for(var r=[],a=0;a0}function ze(e){var t=this,n={};if(e)for(var s in e)n[s]=e[s];return n.keyPrefix=Me(e,t._defaultConfig),Be()?(t._dbInfo=n,n.serializer=ye,u.resolve()):u.reject()}function Le(e){var t=this,n=t.ready().then((function(){for(var e=t._dbInfo.keyPrefix,n=localStorage.length-1;n>=0;n--){var s=localStorage.key(n);0===s.indexOf(e)&&localStorage.removeItem(s)}}));return c(n,e),n}function Pe(e,t){var n=this;e=d(e);var s=n.ready().then((function(){var t=n._dbInfo,s=localStorage.getItem(t.keyPrefix+e);return s&&(s=t.serializer.deserialize(s)),s}));return c(s,t),s}function Ve(e,t){var n=this,s=n.ready().then((function(){for(var t=n._dbInfo,s=t.keyPrefix,r=s.length,a=localStorage.length,i=1,o=0;o=0;t--){var n=localStorage.key(t);0===n.indexOf(e)&&localStorage.removeItem(n)}})):u.reject("Invalid arguments"),c(s,t),s}var $e={_driver:"localStorageWrapper",_initStorage:ze,_support:De(),iterate:Ve,getItem:Pe,setItem:je,removeItem:qe,clear:Le,length:Ge,key:We,keys:Ue,dropInstance:He},Ke=function(e,t){return e===t||"number"==typeof e&&"number"==typeof t&&isNaN(e)&&isNaN(t)},Xe=function(e,t){for(var n=e.length,s=0;s{e.exports=n;var t=null;try{t=new WebAssembly.Instance(new WebAssembly.Module(new Uint8Array([0,97,115,109,1,0,0,0,1,13,2,96,0,1,127,96,4,127,127,127,127,1,127,3,7,6,0,1,1,1,1,1,6,6,1,127,1,65,0,11,7,50,6,3,109,117,108,0,1,5,100,105,118,95,115,0,2,5,100,105,118,95,117,0,3,5,114,101,109,95,115,0,4,5,114,101,109,95,117,0,5,8,103,101,116,95,104,105,103,104,0,0,10,191,1,6,4,0,35,0,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,126,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,127,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,128,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,129,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,130,34,4,66,32,135,167,36,0,32,4,167,11])),{}).exports}catch(e){}function n(e,t,n){this.low=0|e,this.high=0|t,this.unsigned=!!n}function s(e){return!0===(e&&e.__isLong__)}n.prototype.__isLong__,Object.defineProperty(n.prototype,"__isLong__",{value:!0}),n.isLong=s;var r={},a={};function i(e,t){var n,s,i;return t?(i=0<=(e>>>=0)&&e<256)&&(s=a[e])?s:(n=l(e,(0|e)<0?-1:0,!0),i&&(a[e]=n),n):(i=-128<=(e|=0)&&e<128)&&(s=r[e])?s:(n=l(e,e<0?-1:0,!1),i&&(r[e]=n),n)}function o(e,t){if(isNaN(e))return t?y:g;if(t){if(e<0)return y;if(e>=p)return A}else{if(e<=-f)return k;if(e+1>=f)return x}return e<0?o(-e,t).neg():l(e%d|0,e/d|0,t)}function l(e,t,s){return new n(e,t,s)}n.fromInt=i,n.fromNumber=o,n.fromBits=l;var u=Math.pow;function c(e,t,n){if(0===e.length)throw Error("empty string");if("NaN"===e||"Infinity"===e||"+Infinity"===e||"-Infinity"===e)return g;if("number"==typeof t?(n=t,t=!1):t=!!t,(n=n||10)<2||360)throw Error("interior hyphen");if(0===s)return c(e.substring(1),t,n).neg();for(var r=o(u(n,8)),a=g,i=0;i>>0:this.low},C.toNumber=function(){return this.unsigned?(this.high>>>0)*d+(this.low>>>0):this.high*d+(this.low>>>0)},C.toString=function(e){if((e=e||10)<2||36>>0).toString(e);if((a=l).isZero())return c+i;for(;c.length<6;)c="0"+c;i=""+c+i}},C.getHighBits=function(){return this.high},C.getHighBitsUnsigned=function(){return this.high>>>0},C.getLowBits=function(){return this.low},C.getLowBitsUnsigned=function(){return this.low>>>0},C.getNumBitsAbs=function(){if(this.isNegative())return this.eq(k)?64:this.neg().getNumBitsAbs();for(var e=0!=this.high?this.high:this.low,t=31;t>0&&!(e&1<=0},C.isOdd=function(){return!(1&~this.low)},C.isEven=function(){return!(1&this.low)},C.equals=function(e){return s(e)||(e=h(e)),(this.unsigned===e.unsigned||this.high>>>31!=1||e.high>>>31!=1)&&(this.high===e.high&&this.low===e.low)},C.eq=C.equals,C.notEquals=function(e){return!this.eq(e)},C.neq=C.notEquals,C.ne=C.notEquals,C.lessThan=function(e){return this.comp(e)<0},C.lt=C.lessThan,C.lessThanOrEqual=function(e){return this.comp(e)<=0},C.lte=C.lessThanOrEqual,C.le=C.lessThanOrEqual,C.greaterThan=function(e){return this.comp(e)>0},C.gt=C.greaterThan,C.greaterThanOrEqual=function(e){return this.comp(e)>=0},C.gte=C.greaterThanOrEqual,C.ge=C.greaterThanOrEqual,C.compare=function(e){if(s(e)||(e=h(e)),this.eq(e))return 0;var t=this.isNegative(),n=e.isNegative();return t&&!n?-1:!t&&n?1:this.unsigned?e.high>>>0>this.high>>>0||e.high===this.high&&e.low>>>0>this.low>>>0?-1:1:this.sub(e).isNegative()?-1:1},C.comp=C.compare,C.negate=function(){return!this.unsigned&&this.eq(k)?k:this.not().add(b)},C.neg=C.negate,C.add=function(e){s(e)||(e=h(e));var t=this.high>>>16,n=65535&this.high,r=this.low>>>16,a=65535&this.low,i=e.high>>>16,o=65535&e.high,u=e.low>>>16,c=0,d=0,p=0,f=0;return p+=(f+=a+(65535&e.low))>>>16,d+=(p+=r+u)>>>16,c+=(d+=n+o)>>>16,c+=t+i,l((p&=65535)<<16|(f&=65535),(c&=65535)<<16|(d&=65535),this.unsigned)},C.subtract=function(e){return s(e)||(e=h(e)),this.add(e.neg())},C.sub=C.subtract,C.multiply=function(e){if(this.isZero())return g;if(s(e)||(e=h(e)),t)return l(t.mul(this.low,this.high,e.low,e.high),t.get_high(),this.unsigned);if(e.isZero())return g;if(this.eq(k))return e.isOdd()?k:g;if(e.eq(k))return this.isOdd()?k:g;if(this.isNegative())return e.isNegative()?this.neg().mul(e.neg()):this.neg().mul(e).neg();if(e.isNegative())return this.mul(e.neg()).neg();if(this.lt(m)&&e.lt(m))return o(this.toNumber()*e.toNumber(),this.unsigned);var n=this.high>>>16,r=65535&this.high,a=this.low>>>16,i=65535&this.low,u=e.high>>>16,c=65535&e.high,d=e.low>>>16,p=65535&e.low,f=0,y=0,b=0,w=0;return b+=(w+=i*p)>>>16,y+=(b+=a*p)>>>16,b&=65535,y+=(b+=i*d)>>>16,f+=(y+=r*p)>>>16,y&=65535,f+=(y+=a*d)>>>16,y&=65535,f+=(y+=i*c)>>>16,f+=n*p+r*d+a*c+i*u,l((b&=65535)<<16|(w&=65535),(f&=65535)<<16|(y&=65535),this.unsigned)},C.mul=C.multiply,C.divide=function(e){if(s(e)||(e=h(e)),e.isZero())throw Error("division by zero");var n,r,a;if(t)return this.unsigned||-2147483648!==this.high||-1!==e.low||-1!==e.high?l((this.unsigned?t.div_u:t.div_s)(this.low,this.high,e.low,e.high),t.get_high(),this.unsigned):this;if(this.isZero())return this.unsigned?y:g;if(this.unsigned){if(e.unsigned||(e=e.toUnsigned()),e.gt(this))return y;if(e.gt(this.shru(1)))return w;a=y}else{if(this.eq(k))return e.eq(b)||e.eq(v)?k:e.eq(k)?b:(n=this.shr(1).div(e).shl(1)).eq(g)?e.isNegative()?b:v:(r=this.sub(e.mul(n)),a=n.add(r.div(e)));if(e.eq(k))return this.unsigned?y:g;if(this.isNegative())return e.isNegative()?this.neg().div(e.neg()):this.neg().div(e).neg();if(e.isNegative())return this.div(e.neg()).neg();a=g}for(r=this;r.gte(e);){n=Math.max(1,Math.floor(r.toNumber()/e.toNumber()));for(var i=Math.ceil(Math.log(n)/Math.LN2),c=i<=48?1:u(2,i-48),d=o(n),p=d.mul(e);p.isNegative()||p.gt(r);)p=(d=o(n-=c,this.unsigned)).mul(e);d.isZero()&&(d=b),a=a.add(d),r=r.sub(p)}return a},C.div=C.divide,C.modulo=function(e){return s(e)||(e=h(e)),t?l((this.unsigned?t.rem_u:t.rem_s)(this.low,this.high,e.low,e.high),t.get_high(),this.unsigned):this.sub(this.div(e).mul(e))},C.mod=C.modulo,C.rem=C.modulo,C.not=function(){return l(~this.low,~this.high,this.unsigned)},C.and=function(e){return s(e)||(e=h(e)),l(this.low&e.low,this.high&e.high,this.unsigned)},C.or=function(e){return s(e)||(e=h(e)),l(this.low|e.low,this.high|e.high,this.unsigned)},C.xor=function(e){return s(e)||(e=h(e)),l(this.low^e.low,this.high^e.high,this.unsigned)},C.shiftLeft=function(e){return s(e)&&(e=e.toInt()),0==(e&=63)?this:e<32?l(this.low<>>32-e,this.unsigned):l(0,this.low<>>e|this.high<<32-e,this.high>>e,this.unsigned):l(this.high>>e-32,this.high>=0?0:-1,this.unsigned)},C.shr=C.shiftRight,C.shiftRightUnsigned=function(e){if(s(e)&&(e=e.toInt()),0===(e&=63))return this;var t=this.high;return e<32?l(this.low>>>e|t<<32-e,t>>>e,this.unsigned):l(32===e?t:t>>>e-32,0,this.unsigned)},C.shru=C.shiftRightUnsigned,C.shr_u=C.shiftRightUnsigned,C.toSigned=function(){return this.unsigned?l(this.low,this.high,!1):this},C.toUnsigned=function(){return this.unsigned?this:l(this.low,this.high,!0)},C.toBytes=function(e){return e?this.toBytesLE():this.toBytesBE()},C.toBytesLE=function(){var e=this.high,t=this.low;return[255&t,t>>>8&255,t>>>16&255,t>>>24,255&e,e>>>8&255,e>>>16&255,e>>>24]},C.toBytesBE=function(){var e=this.high,t=this.low;return[e>>>24,e>>>16&255,e>>>8&255,255&e,t>>>24,t>>>16&255,t>>>8&255,255&t]},n.fromBytes=function(e,t,s){return s?n.fromBytesLE(e,t):n.fromBytesBE(e,t)},n.fromBytesLE=function(e,t){return new n(e[0]|e[1]<<8|e[2]<<16|e[3]<<24,e[4]|e[5]<<8|e[6]<<16|e[7]<<24,t)},n.fromBytesBE=function(e,t){return new n(e[4]<<24|e[5]<<16|e[6]<<8|e[7],e[0]<<24|e[1]<<16|e[2]<<8|e[3],t)}},9464:function(e,t){var n,s,r;s=[e],n=function(e){"use strict";function t(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var n=Object.assign||function(e){for(var t=1;tMath.abs(n[a][i])&&(i=o);for(var l=a;l=a;h--)n[h][c]-=n[h][a]*n[a][c]/n[a][a]}for(var d=s-1;d>=0;d--){for(var p=0,f=d+1;f=0;x--)v+=x>1?y[x]+"x^"+x+" + ":1===x?y[x]+"x + ":y[x];return{string:v,points:w,predict:b,equation:[].concat(s(y)).reverse(),r2:o(a(e,w),t.precision)}}};function u(){var e=function(e,s){return n({_round:o},e,t({},s,(function(e,t){return l[s](e,n({},r,t))})))};return Object.keys(l).reduce(e,{})}e.exports=u()},void 0===(r="function"==typeof n?n.apply(t,s):n)||(e.exports=r)},2183:(e,t,n)=>{var s=n(1812),r=n(6357),a=n(1119),i=n(147),o=n(6297),l=n(9181),u=n(7529);u.alea=s,u.xor128=r,u.xorwow=a,u.xorshift7=i,u.xor4096=o,u.tychei=l,e.exports=u},1812:function(e,t,n){var s;!function(e,r,a){function i(e){var t=this,n=function(){var e=4022871197,t=function(t){t=String(t);for(var n=0;n>>0,e=(s*=e)>>>0,e+=4294967296*(s-=e)}return 2.3283064365386963e-10*(e>>>0)};return t}();t.next=function(){var e=2091639*t.s0+2.3283064365386963e-10*t.c;return t.s0=t.s1,t.s1=t.s2,t.s2=e-(t.c=0|e)},t.c=1,t.s0=n(" "),t.s1=n(" "),t.s2=n(" "),t.s0-=n(e),t.s0<0&&(t.s0+=1),t.s1-=n(e),t.s1<0&&(t.s1+=1),t.s2-=n(e),t.s2<0&&(t.s2+=1),n=null}function o(e,t){return t.c=e.c,t.s0=e.s0,t.s1=e.s1,t.s2=e.s2,t}function l(e,t){var n=new i(e),s=t&&t.state,r=n.next;return r.int32=function(){return 4294967296*n.next()|0},r.double=function(){return r()+11102230246251565e-32*(2097152*r()|0)},r.quick=r,s&&("object"==typeof s&&o(s,n),r.state=function(){return o(n,{})}),r}r&&r.exports?r.exports=l:n.amdD&&n.amdO?void 0===(s=function(){return l}.call(t,n,t,r))||(r.exports=s):this.alea=l}(0,e=n.nmd(e),n.amdD)},9181:function(e,t,n){var s;!function(e,r,a){function i(e){var t=this,n="";t.next=function(){var e=t.b,n=t.c,s=t.d,r=t.a;return e=e<<25^e>>>7^n,n=n-s|0,s=s<<24^s>>>8^r,r=r-e|0,t.b=e=e<<20^e>>>12^n,t.c=n=n-s|0,t.d=s<<16^n>>>16^r,t.a=r-e|0},t.a=0,t.b=0,t.c=-1640531527,t.d=1367130551,e===Math.floor(e)?(t.a=e/4294967296|0,t.b=0|e):n+=e;for(var s=0;s>>0)/4294967296};return r.double=function(){do{var e=((n.next()>>>11)+(n.next()>>>0)/4294967296)/(1<<21)}while(0===e);return e},r.int32=n.next,r.quick=r,s&&("object"==typeof s&&o(s,n),r.state=function(){return o(n,{})}),r}r&&r.exports?r.exports=l:n.amdD&&n.amdO?void 0===(s=function(){return l}.call(t,n,t,r))||(r.exports=s):this.tychei=l}(0,e=n.nmd(e),n.amdD)},6357:function(e,t,n){var s;!function(e,r,a){function i(e){var t=this,n="";t.x=0,t.y=0,t.z=0,t.w=0,t.next=function(){var e=t.x^t.x<<11;return t.x=t.y,t.y=t.z,t.z=t.w,t.w^=t.w>>>19^e^e>>>8},e===(0|e)?t.x=e:n+=e;for(var s=0;s>>0)/4294967296};return r.double=function(){do{var e=((n.next()>>>11)+(n.next()>>>0)/4294967296)/(1<<21)}while(0===e);return e},r.int32=n.next,r.quick=r,s&&("object"==typeof s&&o(s,n),r.state=function(){return o(n,{})}),r}r&&r.exports?r.exports=l:n.amdD&&n.amdO?void 0===(s=function(){return l}.call(t,n,t,r))||(r.exports=s):this.xor128=l}(0,e=n.nmd(e),n.amdD)},6297:function(e,t,n){var s;!function(e,r,a){function i(e){var t=this;t.next=function(){var e,n,s=t.w,r=t.X,a=t.i;return t.w=s=s+1640531527|0,n=r[a+34&127],e=r[a=a+1&127],n^=n<<13,e^=e<<17,n^=n>>>15,e^=e>>>12,n=r[a]=n^e,t.i=a,n+(s^s>>>16)|0},function(e,t){var n,s,r,a,i,o=[],l=128;for(t===(0|t)?(s=t,t=null):(t+="\0",s=0,l=Math.max(l,t.length)),r=0,a=-32;a>>15,s^=s<<4,s^=s>>>13,a>=0&&(i=i+1640531527|0,r=0==(n=o[127&a]^=s+i)?r+1:0);for(r>=128&&(o[127&(t&&t.length||0)]=-1),r=127,a=512;a>0;--a)s=o[r+34&127],n=o[r=r+1&127],s^=s<<13,n^=n<<17,s^=s>>>15,n^=n>>>12,o[r]=s^n;e.w=i,e.X=o,e.i=r}(t,e)}function o(e,t){return t.i=e.i,t.w=e.w,t.X=e.X.slice(),t}function l(e,t){null==e&&(e=+new Date);var n=new i(e),s=t&&t.state,r=function(){return(n.next()>>>0)/4294967296};return r.double=function(){do{var e=((n.next()>>>11)+(n.next()>>>0)/4294967296)/(1<<21)}while(0===e);return e},r.int32=n.next,r.quick=r,s&&(s.X&&o(s,n),r.state=function(){return o(n,{})}),r}r&&r.exports?r.exports=l:n.amdD&&n.amdO?void 0===(s=function(){return l}.call(t,n,t,r))||(r.exports=s):this.xor4096=l}(0,e=n.nmd(e),n.amdD)},147:function(e,t,n){var s;!function(e,r,a){function i(e){var t=this;t.next=function(){var e,n,s=t.x,r=t.i;return e=s[r],n=(e^=e>>>7)^e<<24,n^=(e=s[r+1&7])^e>>>10,n^=(e=s[r+3&7])^e>>>3,n^=(e=s[r+4&7])^e<<7,e=s[r+7&7],n^=(e^=e<<13)^e<<9,s[r]=n,t.i=r+1&7,n},function(e,t){var n,s=[];if(t===(0|t))s[0]=t;else for(t=""+t,n=0;n0;--n)e.next()}(t,e)}function o(e,t){return t.x=e.x.slice(),t.i=e.i,t}function l(e,t){null==e&&(e=+new Date);var n=new i(e),s=t&&t.state,r=function(){return(n.next()>>>0)/4294967296};return r.double=function(){do{var e=((n.next()>>>11)+(n.next()>>>0)/4294967296)/(1<<21)}while(0===e);return e},r.int32=n.next,r.quick=r,s&&(s.x&&o(s,n),r.state=function(){return o(n,{})}),r}r&&r.exports?r.exports=l:n.amdD&&n.amdO?void 0===(s=function(){return l}.call(t,n,t,r))||(r.exports=s):this.xorshift7=l}(0,e=n.nmd(e),n.amdD)},1119:function(e,t,n){var s;!function(e,r,a){function i(e){var t=this,n="";t.next=function(){var e=t.x^t.x>>>2;return t.x=t.y,t.y=t.z,t.z=t.w,t.w=t.v,(t.d=t.d+362437|0)+(t.v=t.v^t.v<<4^e^e<<1)|0},t.x=0,t.y=0,t.z=0,t.w=0,t.v=0,e===(0|e)?t.x=e:n+=e;for(var s=0;s>>4),t.next()}function o(e,t){return t.x=e.x,t.y=e.y,t.z=e.z,t.w=e.w,t.v=e.v,t.d=e.d,t}function l(e,t){var n=new i(e),s=t&&t.state,r=function(){return(n.next()>>>0)/4294967296};return r.double=function(){do{var e=((n.next()>>>11)+(n.next()>>>0)/4294967296)/(1<<21)}while(0===e);return e},r.int32=n.next,r.quick=r,s&&("object"==typeof s&&o(s,n),r.state=function(){return o(n,{})}),r}r&&r.exports?r.exports=l:n.amdD&&n.amdO?void 0===(s=function(){return l}.call(t,n,t,r))||(r.exports=s):this.xorwow=l}(0,e=n.nmd(e),n.amdD)},7529:function(e,t,n){var s;!function(r,a,i){var o,l=256,u=i.pow(l,6),c=i.pow(2,52),h=2*c,d=l-1;function p(e,t,n){var s=[],d=y(g((t=1==t?{entropy:!0}:t||{}).entropy?[e,b(a)]:null==e?function(){try{var e;return o&&(e=o.randomBytes)?e=e(l):(e=new Uint8Array(l),(r.crypto||r.msCrypto).getRandomValues(e)),b(e)}catch(e){var t=r.navigator,n=t&&t.plugins;return[+new Date,r,n,r.screen,b(a)]}}():e,3),s),p=new f(s),w=function(){for(var e=p.g(6),t=u,n=0;e=h;)e/=2,t/=2,n>>>=1;return(e+n)/t};return w.int32=function(){return 0|p.g(4)},w.quick=function(){return p.g(4)/4294967296},w.double=w,y(b(p.S),a),(t.pass||n||function(e,t,n,s){return s&&(s.S&&m(s,p),e.state=function(){return m(p,{})}),n?(i.random=e,t):e})(w,d,"global"in t?t.global:this==i,t.state)}function f(e){var t,n=e.length,s=this,r=0,a=s.i=s.j=0,i=s.S=[];for(n||(e=[n++]);r{},9830:()=>{},3818:()=>{},6308:()=>{},7695:()=>{},170:()=>{}},__webpack_module_cache__={};function __webpack_require__(e){var t=__webpack_module_cache__[e];if(void 0!==t)return t.exports;var n=__webpack_module_cache__[e]={id:e,loaded:!1,exports:{}};return __webpack_modules__[e].call(n.exports,n,n.exports,__webpack_require__),n.loaded=!0,n.exports}__webpack_require__.amdD=function(){throw new Error("define cannot be used indirect")},__webpack_require__.amdO={},__webpack_require__.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return __webpack_require__.d(t,{a:t}),t},__webpack_require__.d=(e,t)=>{for(var n in t)__webpack_require__.o(t,n)&&!__webpack_require__.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},__webpack_require__.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),__webpack_require__.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),__webpack_require__.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},__webpack_require__.nmd=e=>(e.paths=[],e.children||(e.children=[]),e),__webpack_require__.nc=void 0;var __webpack_exports__={};return(()=>{"use strict";__webpack_require__.d(__webpack_exports__,{default:()=>_H});var e={};__webpack_require__.r(e),__webpack_require__.d(e,{CompositeArrayBuffer:()=>wo,browserFiles:()=>pu,browserHTTPRequest:()=>Au,concatenateArrayBuffers:()=>Lo,copyModel:()=>kl,decodeWeights:()=>To,decodeWeightsStream:()=>Mo,encodeWeights:()=>Io,fromMemory:()=>Eu,fromMemorySync:()=>_u,getLoadHandlers:()=>Xo,getModelArtifactsForJSON:()=>Uo,getModelArtifactsForJSONSync:()=>Wo,getModelArtifactsInfoForJSON:()=>Go,getSaveHandlers:()=>Ko,getWeightSpecs:()=>qo,http:()=>xu,isHTTPScheme:()=>wu,listModels:()=>xl,loadWeights:()=>gu,moveModel:()=>Cl,registerLoadRouter:()=>$o,registerSaveRouter:()=>Ho,removeModel:()=>Al,weightsLoaderFactory:()=>yu,withSaveHandler:()=>Iu,withSaveHandlerSync:()=>Tu});var t={};__webpack_require__.r(t),__webpack_require__.d(t,{assertParamsValid:()=>Pu,computeFlatOffset:()=>Qu,computeOutShape:()=>Wu,getNormalizedAxes:()=>ju,isSliceContinous:()=>Yu,maskToAxes:()=>Vu,parseSliceParams:()=>Ju,sliceInfo:()=>ec,startForAxis:()=>Xu,startIndicesWithElidedDims:()=>Hu,stopForAxis:()=>Zu,stopIndicesWithElidedDims:()=>$u,stridesForAxis:()=>Ku,stridesWithElidedDims:()=>Uu});var n={};__webpack_require__.r(n),__webpack_require__.d(n,{conv2d:()=>ff,depthwiseConv2d:()=>yf,matMul:()=>bf});var s={};__webpack_require__.r(s),__webpack_require__.d(s,{collectGatherOpShapeInfo:()=>Tg,computeOutShape:()=>Ig,segOpComputeOptimalWindowSize:()=>_g});var r={};__webpack_require__.r(r),__webpack_require__.d(r,{ERF_A1:()=>jm,ERF_A2:()=>Hm,ERF_A3:()=>$m,ERF_A4:()=>Km,ERF_A5:()=>Xm,ERF_P:()=>qm,PARALLELIZE_THRESHOLD:()=>Dm,RowPartitionType:()=>Im,SELU_SCALE:()=>Gm,SELU_SCALEALPHA:()=>Um,applyActivation:()=>df,assertAndGetBroadcastShape:()=>su,assertAxesAreInnerMostDims:()=>_h,assertParamsConsistent:()=>Em,assignToTypedArray:()=>tg,axesAreInnerMostDims:()=>kh,calculateShapes:()=>Wp,checkEinsumDimSizes:()=>cg,checkPadOnDimRoundingMode:()=>Ic,combineLocations:()=>Ch,combineRaggedTensorToTensorShapes:()=>Tm,complexWithEvenIndex:()=>Qm,complexWithOddIndex:()=>Jm,computeConv2DInfo:()=>yc,computeConv3DInfo:()=>bc,computeDefaultPad:()=>wc,computeDilation2DInfo:()=>fc,computeOptimalWindowSize:()=>Mm,computeOutAndReduceShapes:()=>Sh,computeOutShape:()=>_m,computePool2DInfo:()=>mc,computePool3DInfo:()=>gc,convertConv2DDataFormat:()=>_c,decodeEinsumEquation:()=>lg,eitherStridesOrDilationsAreOne:()=>Sc,expandShapeToKeepDim:()=>Eh,exponent:()=>sg,exponents:()=>ng,fromStringArrayToUint8:()=>Og,fromUint8ToStringArray:()=>Ng,getAxesPermutation:()=>Ih,getBroadcastDims:()=>tu,getComplexWithIndex:()=>eg,getEinsumComputePath:()=>hg,getEinsumPermutation:()=>ug,getFusedBiasGradient:()=>hf,getFusedDyActivation:()=>cf,getImageCenter:()=>Fm,getInnerMostAxes:()=>Nh,getPermuted:()=>zm,getRaggedRank:()=>Om,getReductionAxes:()=>nu,getReshaped:()=>Bm,getReshapedPermuted:()=>Lm,getRowPartitionTypesHelper:()=>Nm,getSliceBeginCoords:()=>Pm,getSliceSize:()=>Vm,getSparseFillEmptyRowsIndicesDenseShapeMismatch:()=>mg,getSparseFillEmptyRowsNegativeIndexErrorMessage:()=>gg,getSparseFillEmptyRowsOutOfRangeIndexErrorMessage:()=>yg,getSparseReshapeEmptyTensorZeroOutputDimErrorMessage:()=>vg,getSparseReshapeInputOutputMismatchErrorMessage:()=>Ag,getSparseReshapeInputOutputMultipleErrorMessage:()=>xg,getSparseReshapeMultipleNegativeOneOutputDimErrorMessage:()=>bg,getSparseReshapeNegativeOutputDimErrorMessage:()=>wg,getSparseSegmentReductionIndicesOutOfRangeErrorMessage:()=>Eg,getSparseSegmentReductionNegativeSegmentIdsErrorMessage:()=>kg,getSparseSegmentReductionNonIncreasingSegmentIdsErrorMessage:()=>Cg,getSparseSegmentReductionSegmentIdOutOfRangeErrorMessage:()=>Sg,getUndoAxesPermutation:()=>Th,isIdentityPermutation:()=>dg,log:()=>Ua,mergeRealAndImagArrays:()=>Zm,prepareAndValidate:()=>Wm,prepareSplitSize:()=>fg,segment_util:()=>s,shouldFuse:()=>pf,slice_util:()=>t,splitRealAndImagArrays:()=>Ym,stridesOrDilationsArePositive:()=>Ec,tupleValuesAreOne:()=>Cc,upcastType:()=>Gi,validateDefaultValueShape:()=>Rm,validateInput:()=>Vp,validateUpdateShape:()=>Pp,warn:()=>Wa});var a={};__webpack_require__.r(a),__webpack_require__.d(a,{json:()=>eC});var i={};__webpack_require__.r(i),__webpack_require__.d(i,{json:()=>tC});var o={};__webpack_require__.r(o),__webpack_require__.d(o,{json:()=>nC});var l={};__webpack_require__.r(l),__webpack_require__.d(l,{json:()=>sC});var u={};__webpack_require__.r(u),__webpack_require__.d(u,{json:()=>rC});var c={};__webpack_require__.r(c),__webpack_require__.d(c,{json:()=>aC});var h={};__webpack_require__.r(h),__webpack_require__.d(h,{json:()=>iC});var d={};__webpack_require__.r(d),__webpack_require__.d(d,{json:()=>oC});var p={};__webpack_require__.r(p),__webpack_require__.d(p,{json:()=>lC});var f={};__webpack_require__.r(f),__webpack_require__.d(f,{json:()=>uC});var m={};__webpack_require__.r(m),__webpack_require__.d(m,{json:()=>cC});var g={};__webpack_require__.r(g),__webpack_require__.d(g,{json:()=>hC});var y={};__webpack_require__.r(y),__webpack_require__.d(y,{json:()=>dC});var b={};__webpack_require__.r(b),__webpack_require__.d(b,{json:()=>pC});var w={};__webpack_require__.r(w),__webpack_require__.d(w,{json:()=>fC});var v={};__webpack_require__.r(v),__webpack_require__.d(v,{json:()=>mC});var x={};__webpack_require__.r(x),__webpack_require__.d(x,{json:()=>gC});var A={};__webpack_require__.r(A),__webpack_require__.d(A,{json:()=>yC});var k={};__webpack_require__.r(k),__webpack_require__.d(k,{json:()=>bC});var C={};__webpack_require__.r(C),__webpack_require__.d(C,{OP_SCOPE_SUFFIX:()=>po,abs:()=>eu,acos:()=>nc,acosh:()=>sc,add:()=>Dl,addN:()=>rc,all:()=>ac,any:()=>ic,argMax:()=>oc,argMin:()=>lc,asin:()=>uc,asinh:()=>cc,atan:()=>hc,atan2:()=>dc,atanh:()=>pc,avgPool:()=>Nc,avgPool3d:()=>Oc,basicLSTMCell:()=>zc,batchNorm:()=>Pc,batchNorm2d:()=>Vc,batchNorm3d:()=>Wc,batchNorm4d:()=>Uc,batchToSpaceND:()=>Lc,bincount:()=>Gc,bitwiseAnd:()=>qc,booleanMaskAsync:()=>Qp,broadcastArgs:()=>jc,broadcastTo:()=>Hc,buffer:()=>Tl,cast:()=>Nl,ceil:()=>$c,clipByValue:()=>Kc,clone:()=>Ol,complex:()=>mo,concat:()=>Rc,concat1d:()=>Xc,concat2d:()=>Zc,concat3d:()=>Yc,concat4d:()=>Qc,conv1d:()=>eh,conv2d:()=>Jc,conv2dTranspose:()=>nh,conv3d:()=>sh,conv3dTranspose:()=>ah,cos:()=>ih,cosh:()=>oh,cosineWindow:()=>of,cumprod:()=>lh,cumsum:()=>uh,denseBincount:()=>ch,depthToSpace:()=>hh,depthwiseConv2d:()=>dh,diag:()=>ph,dilation2d:()=>fh,div:()=>Fl,divNoNan:()=>yh,dot:()=>bh,dropout:()=>rf,einsum:()=>wh,elu:()=>vh,enclosingPowerOfTwo:()=>af,ensureShape:()=>xh,equal:()=>mh,erf:()=>Ah,euclideanNorm:()=>Bh,exp:()=>zh,expandDims:()=>Lh,expm1:()=>Ph,eye:()=>Wh,fft:()=>kp,fill:()=>Xl,floor:()=>Uh,floorDiv:()=>Ml,fused:()=>n,gather:()=>Gh,gatherND:()=>sf,greater:()=>qh,greaterEqual:()=>jh,ifft:()=>Cp,imag:()=>Hh,image:()=>bm,inTopKAsync:()=>lf,irfft:()=>Sp,isFinite:()=>$h,isInf:()=>Kh,isNaN:()=>Xh,leakyRelu:()=>Zh,less:()=>Yh,lessEqual:()=>Qh,linalg:()=>wm,linspace:()=>Jh,localResponseNormalization:()=>ed,log:()=>td,log1p:()=>nd,logSigmoid:()=>ad,logSoftmax:()=>id,logSumExp:()=>od,logicalAnd:()=>ld,logicalNot:()=>ud,logicalOr:()=>cd,logicalXor:()=>hd,losses:()=>vm,lowerBound:()=>fd,matMul:()=>Dc,max:()=>Oh,maxPool:()=>md,maxPool3d:()=>gd,maxPoolWithArgmax:()=>yd,maximum:()=>ru,mean:()=>bd,meshgrid:()=>xd,min:()=>Rh,minimum:()=>Ad,mirrorPad:()=>kd,mod:()=>Cd,moments:()=>Sd,movingAverage:()=>ef,mul:()=>Bl,multiRNNCell:()=>Ed,multinomial:()=>_d,neg:()=>sd,norm:()=>Fh,notEqual:()=>Id,oneHot:()=>Td,ones:()=>vd,onesLike:()=>Nd,op:()=>fo,outerProduct:()=>Od,pad:()=>Rd,pad1d:()=>Dd,pad2d:()=>Md,pad3d:()=>Fd,pad4d:()=>Bd,pool:()=>Ld,pow:()=>Yl,prelu:()=>Pd,print:()=>Rl,prod:()=>Vd,raggedGather:()=>Wd,raggedRange:()=>Ud,raggedTensorToTensor:()=>Gd,rand:()=>qd,randomGamma:()=>Xd,randomNormal:()=>Zd,randomStandardNormal:()=>Yd,randomUniform:()=>Qd,randomUniformInt:()=>Jd,range:()=>ep,real:()=>tp,reciprocal:()=>np,relu:()=>sp,relu6:()=>rp,reshape:()=>Tc,reverse:()=>ap,reverse1d:()=>ip,reverse2d:()=>op,reverse3d:()=>lp,reverse4d:()=>up,rfft:()=>_p,round:()=>cp,rsqrt:()=>hp,scalar:()=>Wl,scatterND:()=>tf,searchSorted:()=>pd,selu:()=>dp,separableConv2d:()=>pp,setdiff1dAsync:()=>fp,sigmoid:()=>Mc,sign:()=>mp,signal:()=>ym,sin:()=>gp,sinh:()=>yp,slice:()=>Fc,slice1d:()=>bp,slice2d:()=>wp,slice3d:()=>vp,slice4d:()=>xp,softmax:()=>Ap,softplus:()=>rd,spaceToBatchND:()=>zd,sparse:()=>xm,sparseToDense:()=>nf,spectral:()=>gm,split:()=>Ep,sqrt:()=>zl,square:()=>Ll,squaredDifference:()=>Ip,squeeze:()=>Tp,stack:()=>Np,step:()=>Op,stridedSlice:()=>Rp,string:()=>Am,sub:()=>Ql,sum:()=>Dh,tan:()=>Dp,tanh:()=>Bc,tensor:()=>yo,tensor1d:()=>Mp,tensor2d:()=>Fp,tensor3d:()=>Nu,tensor4d:()=>Bp,tensor5d:()=>zp,tensor6d:()=>Lp,tensorScatterUpdate:()=>Up,tile:()=>Vh,topk:()=>Gp,transpose:()=>Jp,truncatedNormal:()=>qp,unique:()=>jp,unsortedSegmentSum:()=>Hp,unstack:()=>$p,upperBound:()=>Kp,variable:()=>Xp,where:()=>gh,whereAsync:()=>Yp,zeros:()=>wd,zerosLike:()=>Pl});var S={};__webpack_require__.r(S),__webpack_require__.d(S,{addImpl:()=>wE,bincountImpl:()=>h_,bincountReduceImpl:()=>d_,bitwiseAndImpl:()=>f_,castImpl:()=>fE,ceilImpl:()=>b_,concatImpl:()=>C_,equalImpl:()=>lI,expImpl:()=>wI,expm1Impl:()=>CI,floorImpl:()=>WI,gatherNdImpl:()=>XI,gatherV2Impl:()=>YI,greaterEqualImpl:()=>nT,greaterImpl:()=>JI,lessEqualImpl:()=>mT,lessImpl:()=>dT,linSpaceImpl:()=>bT,logImpl:()=>vT,maxImpl:()=>FT,maximumImpl:()=>LT,minimumImpl:()=>KT,multiplyImpl:()=>eI,negImpl:()=>rN,notEqualImpl:()=>dN,prodImpl:()=>SN,raggedGatherImpl:()=>NN,raggedRangeImpl:()=>DN,raggedTensorToTensorImpl:()=>PN,rangeImpl:()=>WN,rsqrtImpl:()=>JN,scatterImpl:()=>nO,sigmoidImpl:()=>aE,simpleAbsImpl:()=>IE,sliceImpl:()=>o_,sparseFillEmptyRowsImpl:()=>AO,sparseReshapeImpl:()=>CO,sparseSegmentReductionImpl:()=>EO,sqrtImpl:()=>OO,staticRegexReplaceImpl:()=>LO,stridedSliceImpl:()=>GO,stringNGramsImpl:()=>HO,stringSplitImpl:()=>XO,stringToHashBucketFastImpl:()=>YO,subImpl:()=>NI,tileImpl:()=>sR,topKImpl:()=>oR,transposeImpl:()=>FE,uniqueImpl:()=>fR});var E=__webpack_require__(7999),_=__webpack_require__(9043);E.A.prototype._CONST=Object.freeze({N:{VIDEO_W:{DESKTOP:208,MOBILE:144},VIDEO_MARGIN:"10px",GAZE_CALIBRATION:{R:40,MARGIN:32,BORDER:8,CENTER_EXTRA_CHECK_OFFSET:2,MID_EXTRA_CHECK_OFFSET:6},PPI_DONT_USE:127.7,PD_DONT_USE:6.4,VIEW_DIST_DONT_USE:40},S:{AUTO:"AUTO",CLICK_TYPE:{MOUSE:"mouse",TOUCH:"touch"}},COLOR:{LIGHT_GREY:"#cccccc",ORANGE:"#ff9a00",DARK_RED:"#ac0d0d",RED:"#ee0000"},LTR:"LTR",RTL:"RTL",VIEW_METHOD:{B:"BlindSpot",F:"FaceMesh"},IN_TO_CM:2.54,UNITS:{CM:"cm",IN_D:"inDecimal",IN_F:"inFractional"}}),E.A.prototype._debuggerDefault=Object.freeze({date:new Date("July 20, 69 20:17:40 GMT+00:00"),timestamp:performance.now(),screenSize:{value:{screenWidthCm:28.6,screenHeightCm:17.9,screenPhysicalPpi:250,screenPpi:125,screenDiagonalCm:33.8,screenDiagonalIn:13.3}},measureDistance:{value:40,method:"BlindSpot"},trackDistance:{value:{viewingDistanceCm:40,PDCm:6.4,nearPointCm:{x:0,y:0},latencyMs:50},method:"FaceMesh"},trackGaze:{value:{x:screen.width/2,y:screen.height/2,latencyMs:50}},performance:{value:{computeArrayFillMHz:(0,_.Nh)(.5,3),computeRandomMHz:(0,_.Nh)(5,3),idealFps:60,stressFps:60}}});var I=__webpack_require__(115),T=__webpack_require__.n(I),N=__webpack_require__(3389),O=__webpack_require__.n(N),R=__webpack_require__(402),D=__webpack_require__.n(R),M=__webpack_require__(880),F=__webpack_require__.n(M),B=__webpack_require__(3282),z=__webpack_require__.n(B);const L=(e,t)=>{e.style.top=Math.round(t.querySelector(".calibration-instruction").getBoundingClientRect().bottom)+25+"px"},P=e=>{const t=e.value/e.max;e.style.background=`linear-gradient(90deg, #ffc772, #ffc772 ${100*t}%, #fff ${100*t}%)`};var V=__webpack_require__(9853),W=__webpack_require__(359),U=__webpack_require__(9677);E.A.prototype._displaySize=function(){if(!this.checkInitialized())return;const e={value:{displayWidthPx:screen.width,displayHeightPx:screen.height,windowWidthPx:window.innerWidth,windowHeightPx:window.innerHeight},timestamp:performance.now()};this.displayData.length&&T()(e.value,this.displayData[this.displayData.length-1].value)||(this.newDisplayData=e)};const G={card:O(),arrow:D(),usba:F(),usbc:z()},q={card:3.375,usba:.787402,usbc:.787402};E.A.prototype.screenSize=function(e={},t){this.checkInitialized()&&((0,_.$k)(),e=Object.assign({fullscreen:!1,repeatTesting:1,decimalPlace:1,defaultObject:"card",headline:"🖥️ "+U.H.RC_screenSizeTitle[this.L],description:U.H.RC_screenSizeIntro[this.L],check:!1,checkCallback:null},e),this.getFullscreen(e.fullscreen),["usba","usbc","card"].includes(e.defaultObject)||(e.defaultObject="card"),e.description+=`

          ${U.H.RC_screenSizeHave[this.L].replace("xxx",``)}`,this._addBackground(),this._addBackgroundText(e.headline,e.description),this._addCreditOnBackground(U.H.RC_screenSizeCredit[this.L]),function(e,t,n,s){const r=((e,t,n)=>{const s=document.createElement("input");return s.id="rc-size-slider",s.className="rc-slider",s.type="range",s.min=t,s.max=n,s.value=Math.max(Math.min(Math.round(100*Math.random()),80),20),s.step=.1,L(s,e),P(s),e.appendChild(s),s})(t,0,100),a=(t,n)=>{if("rc-slider"===t.target.className&&"rc-size-slider"===t.target.id&&(n===e._CONST.S.CLICK_TYPE.MOUSE&&1===t.which||n===e._CONST.S.CLICK_TYPE.TOUCH)){t.target.style.cursor="grabbing",c.setAttribute("fill",e._CONST.COLOR.ORANGE);const s=()=>{r.style.cursor="grab",c.setAttribute("fill",e._CONST.COLOR.LIGHT_GREY),document.removeEventListener("mouseup",s,!1)};n===e._CONST.S.CLICK_TYPE.MOUSE?document.addEventListener("mouseup",s,!1):n===e._CONST.S.CLICK_TYPE.TOUCH&&document.addEventListener("touchend",s,!1)}},i=e=>{a(e,"mouse")},o=e=>{a(e,"touch")};document.addEventListener("mousedown",i,!1),document.addEventListener("touchstart",o,!1);const l=$(["card","arrow","usba","usbc"],t);let u=n.defaultObject;document.getElementById("matching-obj").addEventListener("change",(e=>{K(e.target.value,l,d),u=e.target.value})),K("card",l);let c=document.getElementById("size-arrow-fill");c.setAttribute("fill",e._CONST.COLOR.LIGHT_GREY);let h={width:l.arrow.getBoundingClientRect().width,height:l.arrow.getBoundingClientRect().height};const d=()=>{j(e,r,l.card,l.arrow,h),H(r,l.usba),H(r,l.usbc)};d();const p=()=>{P(r),d()},f=new ResizeObserver((()=>{d(),L(r,t),Z(l,r)}));f.observe(t);const m=()=>{document.removeEventListener("mousedown",i,!1),document.removeEventListener("touchstart",o,!1),document.removeEventListener("input",p,!1),f.unobserve(t),e._removeBackground(),(0,V.l)(y)},g=()=>{let t=(l[u].getBoundingClientRect().width||parseInt(l[u].style.width))/q[u];const r=n.decimalPlace,a=X(t,r);e.newScreenData=a,m(),n.check?e._checkScreenSize(s,a,n.checkCallback):(0,_.nB)(s,a)};r.addEventListener("input",p,!1);const y=(0,V.m)({Escape:m,Enter:g," ":g});(0,W.F)(e.L,e.background,{go:g,cancel:m},e.params.showCancelButton),K(u,l,d)}(this,this.background,e,t))};const j=(e,t,n,s,r)=>{const a=(t.offsetWidth-30)*(t.value/100)*(window.innerWidth<480?2:1)+15;n.style.width=a+"px";let i=n.getBoundingClientRect();0!==i.width&&(s.style.left=i.left+a+"px",s.style.top=i.top+e.background.scrollTop+(.63*a-r.height)/2+"px")},H=(e,t)=>{t.style.width=(0,_.Ew)(Math.pow(e.value,1.5),0,1e3,50,400)+"px"},$=(e,t)=>{let n=document.getElementsByClassName("size-obj");for(;n.length;)n[0].parentNode.removeChild(n[0]);const s={};for(let n of e){let e=document.createElement("div");t.appendChild(e),e.outerHTML=G[n],e=document.getElementById("size-"+n),e.setAttribute("preserveAspectRatio","none"),e.style.visibility="hidden",s[n]=e}return Z(s,document.querySelector("#rc-size-slider")),s},K=(e,t,n)=>{for(let n in t)t[n].style.visibility=n===e?"visible":"hidden";t.arrow.style.visibility="hidden",(0,_.nB)(n)},X=(e,t)=>{const n={value:{screenWidthCm:(0,_.Nh)(2.54*window.screen.width/e,t),screenHeightCm:(0,_.Nh)(2.54*window.screen.height/e,t),screenPhysicalPpi:(0,_.Nh)(e*window.devicePixelRatio,t),screenPpi:(0,_.Nh)(e,t)},timestamp:performance.now()};return n.value.screenDiagonalCm=(0,_.Nh)(Math.hypot(n.value.screenWidthCm,n.value.screenHeightCm),t),n.value.screenDiagonalIn=(0,_.Nh)(n.value.screenDiagonalCm/2.54,t),n},Z=(e,t)=>{for(let n in e)e[n].style.top=t.getBoundingClientRect().top+50+"px"};var Y=__webpack_require__(8465),Q=__webpack_require__.n(Y);const J=32,ee=3,te=(e,t)=>"left"===e?.1*t:.9*t;function ne(e,t,n){e.fillStyle="#000",e.fillRect(t-(J>>1),n-(ee>>1),J,ee),e.fillRect(t-(ee>>1),n-(J>>1),ee,J)}const se=30;function re(e,t,n){return"left"===e?[t+(J+se)/2,n-(se>>1)]:[se>>1,t-(J+se)/2]}const ae=(e,{showIcon:t})=>({icon:t?"info":void 0,allowEscapeKey:!1,allowEnterKey:!1,allowOutsideClick:!1,showConfirmButton:!0,confirmButtonText:U.H.RC_ok[e.L],showClass:{popup:"fadeInUp",icon:""},hideClass:{popup:"fadeOutDown"},iconColor:e._CONST.COLOR.ORANGE,confirmButtonColor:"#aaa",customClass:{popup:"my__swal2__container",icon:"my__swal2__icon",title:"my__swal2__title",htmlContainer:`my__swal2__html rc-lang-${e.LD.toLowerCase()}`,confirmButton:"rc-button rc-go-button"}});let ie;"mocha"!==E._&&(ie=__webpack_require__(477).l);function oe(e,t,n=!1,s){const r=t.control;let a=e._CONST.N.PPI_DONT_USE;e.screenPpi&&(a=e.screenPpi.value);let i=!0,o=[],l=0;const u=document.createElement("div");u.innerHTML='',e.background.appendChild(u),e._constructFloatInstructionElement("blind-spot-instruction",U.H.RC_distanceTrackingCloseL[e.L]),e._addCreditOnBackground(U.H.RC_viewingBlindSpotCredit[e.L]);const c=document.querySelector("#blind-spot-canvas"),h=c.getContext("2d"),d=document.getElementById("blind-spot-instruction");let p="left";e._setFloatInstructionElementPos(p,16);let f,m=te(p,c.width);const g=()=>{c.style.width=(c.width=window.innerWidth)+"px",c.style.height=(c.height=window.innerHeight)+"px",m=te(p,c.width),f=re(p,m,c.width)},y=new ResizeObserver((()=>{g()}));y.observe(e.background),g();let b=f["left"===p?0:1],w=b,v=e._CONST.COLOR.DARK_RED,x="left"===p?1:-1;const A=(t=!0)=>{i=!1,r&&function(e,t){document.getElementById(e).removeEventListener("mousedown",t),document.getElementById(e).removeEventListener("touchstart",t)}("blind-spot-canvas",B),y.unobserve(e.background),e._removeBackground(),!e._trackingSetupFinishedStatus.distance&&t&&(e._trackingSetupFinishedStatus.distance=!0,e.gazeTracker.checkInitialized("distance",!1)&&e.endDistance()),(0,V.l)(D),(0,V.l)(M,"keyup")},k=async()=>{if("mocha"!==E._&&ie(),l+=1,o.push({dist:(0,_.Nh)(le(b,m,a),t.decimalPlace),v:x,closedEyeSide:p,crossX:m,circleX:b,ppi:a,timestamp:performance.now()}),2===Math.floor(l/t.repeatTesting))if(function(e){let t=[],n=[];for(let s of e)"left"===s.closedEyeSide?t.push(s.dist):n.push(s.dist);const s=(0,_.G8)(t),r=(0,_.G8)(n);return Math.abs(s-r)<.2*Math.min(s,r)}(o)){const r=e.newViewingDistanceData={value:(0,_.Nh)((0,_.JZ)(ue(o)),t.decimalPlace),timestamp:performance.now(),method:e._CONST.VIEW_METHOD.B,raw:{...o}};let a;n?(a="trackDistance",i=!1,y.unobserve(e.background),(0,V.l)(D),(0,V.l)(M,"keyup")):(a="measureDistance",A(!1)),t.check?await e._checkDistance(s,r,a,t.checkCallback):(0,_.nB)(s,r)}else{l=0;const t=o[0];R(t.v,t.closedEyeSide,t.crossX),o=[],Q().fire({...ae(e,{showIcon:!1}),icon:void 0,html:U.H.RC_viewingBlindSpotRejected[e.L],allowEnterKey:!0})}else l%t.repeatTesting==0?("left"===p?(p="right",d.innerHTML=U.H.RC_distanceTrackingCloseR[e.L]):(p="left",d.innerHTML=U.H.RC_distanceTrackingCloseL[e.L]),e._setFloatInstructionElementPos(p,16),R(1,p,te(p,c.width),!1,!0)):(x=-x,O(p,f))};let C=!1,S=null;const I=t=>{C||(T(),C=!0,v=e._CONST.COLOR.RED,S=setInterval((()=>{"ArrowLeft"===t.key?(b-=10,N()):"ArrowRight"===t.key&&(b+=10,N())}),30))},T=()=>{C=!1,v=e._CONST.COLOR.DARK_RED,S&&(clearInterval(S),S=null)},N=()=>{w=(0,_.AU)(b,...f),b=w},O=(e,t)=>{let n=t["left"===e?0:1],s=Math.abs(t[1]-t[0])/4,r=(0,_.Av)(n-s,n+s);(r-t[0])*(r-t[1])>0&&(r=2*n-r),b=r},R=(t,n,s,r=!0,a=!0)=>{x=t,p=n,m=s,f=re(p,m,c.width),r&&(d.innerHTML="left"===p?U.H.RC_distanceTrackingCloseL[e.L]:U.H.RC_distanceTrackingCloseR[e.L],e._setFloatInstructionElementPos(p,16)),a&&(b=f["left"===p?0:1],O(n,f))},D=(0,V.m)({Escape:t.showCancelButton?A:void 0,Enter:k," ":k,ArrowLeft:r?I:_.Md,ArrowRight:r?I:_.Md}),M=(0,V.m)({ArrowLeft:r?T:_.Md,ArrowRight:r?T:_.Md},"keyup");(0,W.F)(e.L,e.background,{go:k,cancel:t.showCancelButton?A:void 0,custom:{callback:()=>{Q().fire({...ae(e,{showIcon:!1}),icon:void 0,html:U.H.RC_viewingDistanceIntroLiMethod[e.L],allowEnterKey:!0})},content:U.H.RC_viewingDistanceIntroTitle[e.L]}},e.params.showCancelButton);const F={x:null,circleX:null},B=t=>{const n=!(!t.touches||!t.touches[0]);let s,r;if(n||t.preventDefault(),n?(s=t.touches[0].clientX,r=t.touches[0].clientY):(s=t.clientX,r=t.clientY),a=b,i=c.height/2,o=s,l=r,(0,_.ll)(a,i,o,l)>1){F.x=s,F.circleX=b;const r=document.getElementById("blind-spot-canvas");v=e._CONST.COLOR.RED,r.classList.replace("cursor-grab","cursor-grabbing");const a=e=>{let s;t.preventDefault(),e.preventDefault(),s=n?e.touches[0].clientX:e.clientX,b=F.circleX+s-F.x,b=(0,_.AU)(b,...re(p,m,c.width))};n?document.addEventListener("touchmove",a):document.addEventListener("mousemove",a);const i=()=>{n?(document.removeEventListener("touchend",i),document.removeEventListener("touchmove",a)):(document.removeEventListener("mouseup",i),document.removeEventListener("mousemove",a)),F.x=null,F.circleX=null,v=e._CONST.COLOR.DARK_RED,r.classList.replace("cursor-grabbing","cursor-grab")};n?document.addEventListener("touchend",i):document.addEventListener("mouseup",i)}var a,i,o,l};r&&function(e,t){document.getElementById(e).addEventListener("mousedown",t),document.getElementById(e).addEventListener("touchstart",t)}("blind-spot-canvas",B);const z=performance.now();let L=z;const P=()=>{h.clearRect(0,0,c.width,c.height),ne(h,m,c.height/2),L=performance.now(),function(e,t,n,s,r,a,i=!0){t.beginPath(),t.arc(n,s,se>>1,0,2*Math.PI),t.closePath(),t.fillStyle=i?r%125<63?a:"#fff":a,t.fill()}(0,h,b,c.height/2,Math.round(L-z),v,t.sparkle),r||(b+=5*x,N()),i?requestAnimationFrame(P):h.clearRect(0,0,c.width,c.height)};requestAnimationFrame(P)}function le(e,t,n){return Math.abs(t-e)/n/(s=15,Math.tan(s*Math.PI/180))/.3937;var s}function ue(e){const t=[];for(let n of e)t.push(n.dist);return t}function ce(e,t={framerate:60,break:!1}){let n=0,s=0,r=0;const a=1e3/t.framerate,i=()=>{t.break||requestAnimationFrame(i),n=performance.now(),r=n-s,r>a&&(s=n-r%a,e())};requestAnimationFrame(i)}E.A.prototype.measureDistance=function(e={},t){if(!this.checkInitialized())return;let n;(0,_.$k)(),n=(void 0!==e.control&&e.control,U.H.RC_viewingDistanceIntroLiMethod[this.L]),e=Object.assign({fullscreen:!1,repeatTesting:1,sparkle:!0,decimalPlace:1,control:!0,headline:"📏 "+U.H.RC_viewingDistanceTitle[this.L],description:n,check:!1,checkCallback:!1,showCancelButton:!0},e),this.getFullscreen(e.fullscreen),this._addBackground(),this._replaceBackground((0,_.$O)(e.headline,null,!0,"")),oe(this,e,!1,t)};var he=__webpack_require__(2646);const de=async e=>{if(navigator.permissions&&navigator.permissions.query)return navigator.permissions.query({name:"camera"}).then((async t=>{if("prompt"===t.state)return await Q().fire({...ae(e,{showIcon:!1}),icon:void 0,imageUrl:"data:image/png;base64,iVBORw0KGg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NEYe1xFKYlTh+3z3cU3t/rvhz+nPgXMOuvBGXNGuesHD496x+VC7m11P+W+KNri54j0XXyzxcft1qXUDrZOYryGF1vu43ywfq/ndb6Xzs/0b2J7qkoL4TsJv4z+hgOOCHGmwAAAAAASUVORK5CYII=",imageWidth:480,imageAlt:"Please allow camera access",html:U.H.RC_requestCamera[e.L]+"
          "+U.H.RC_privacyCamera[e.L]})})).catch((e=>{}))},pe={video:!1};E.A.prototype.trackDistance=async function(e={},t,n){if(!this.checkInitialized())return;let s;if((0,_.$k)(),s=(void 0!==e.control&&e.control,U.H.RC_viewingDistanceIntroLiMethod[this.L]),e=Object.assign({fullscreen:!1,repeatTesting:1,sparkle:!0,pipWidthPx:this._CONST.N.VIDEO_W[this.isMobile.value?"MOBILE":"DESKTOP"],showVideo:!0,showFaceOverlay:!1,decimalPlace:1,framerate:3,desiredDistanceCm:void 0,desiredDistanceTolerance:1.2,desiredDistanceMonitor:!1,desiredDistanceMonitorCancelable:!1,desiredDistanceMonitorAllowRecalibrate:!0,nearPoint:!0,showNearPoint:!1,control:!0,headline:"📏 "+U.H.RC_distanceTrackingTitle[this.L],description:U.H.RC_distanceTrackingIntroStart[this.L]+(0,he.G)(this.L)+s+(0,he.G)(this.L)+U.H.RC_distanceTrackingIntroEnd[this.L],check:!1,checkCallback:null,showCancelButton:!0},e),this.getFullscreen(e.fullscreen),this.gazeTracker.checkInitialized("distance"))return this.gazeTracker._toFixedN=e.decimalPlace,this.showNearPoint(e.showNearPoint),this.showVideo(e.showVideo),void this.showFaceOverlay(e.showFaceOverlay);this._addBackground(),this._constructFloatInstructionElement("gaze-system-instruction",U.H.RC_starting[this.L]),await de(this);const r=e=>{this.showVideo(pe.video),pe.video=!1,this.gazeTracker.checkInitialized("gaze",!1)&&this.showGazer(a),(0,_.nB)(t,e),ye.current=e},a=this.gazeTracker.webgazer.params.showGazeDot,i=async()=>{this._addBackground(),this._replaceBackground((0,_.$O)(e.headline,null,!0,"")),this.gazeTracker.checkInitialized("gaze",!1)&&this.showGazer(!1),oe(this,e,!0,r)};ge.pipWidthPx=e.pipWidthPx,ge.decimalPlace=e.decimalPlace,ge.framerate=e.framerate,ge.nearPoint=e.nearPoint,ge.showNearPoint=e.showNearPoint,ge.desiredDistanceCm=e.desiredDistanceCm,ge.desiredDistanceTolerance=e.desiredDistanceTolerance,ge.desiredDistanceMonitor=e.desiredDistanceMonitor,ge.desiredDistanceMonitorCancelable=e.desiredDistanceMonitorCancelable,ge.desiredDistanceMonitorAllowRecalibrate=e.desiredDistanceMonitorAllowRecalibrate,pe.video=e.showVideo,this.gazeTracker._init({toFixedN:1,showVideo:!0,showFaceOverlay:e.showFaceOverlay},"distance"),this._trackingSetupFinishedStatus.distance=!1;const o={options:e,callbackStatic:t,callbackTrack:n};e.nearPoint?fe(this,(()=>this._measurePD({},i)),n,o):fe(this,i,n,o)};const fe=async(e,t,n,s)=>{e.gazeTracker.beginVideo({pipWidthPx:ge.pipWidthPx},(()=>{e._removeFloatInstructionElement(),(0,_.nB)(t),Se(e,ge,n,s)}))},me=(e,t)=>Math.hypot(e.x-t.x,e.y-t.y,e.z-t.z),ge={pipWidthPx:0,decimalPlace:2,framerate:3,nearPoint:!0,showNearPoint:!1,desiredDistanceCm:void 0,desiredDistanceTolerance:1.2,desiredDistanceMonitor:!1,desiredDistanceMonitorCancelable:!1,desiredDistanceMonitorAllowRecalibrate:!0},ye={current:null};let be,we,ve={framerate:20,break:!0},xe=null,Ae=!1,ke=0,Ce=1;const Se=async(e,t,n,s)=>{const r=document.querySelector("#webgazerVideoCanvas");(0,_.yy)(1e3).then((async()=>{let a,i;ke=0,Ce=1;a=await e.gazeTracker.webgazer.getTracker().model;let o=e.screenPpi?e.screenPpi.value:e._CONST.N.PPI_DONT_USE;!e.screenPpi&&t.nearPoint,t.nearPoint&&t.showNearPoint&&(xe=document.createElement("div"),xe.id="rc-near-point-dot",document.body.appendChild(xe),Object.assign(xe.style,{display:"block",zIndex:999999,width:"10px",height:"10px",background:"green",position:"fixed",top:"-15px",left:"-15px"})),Ae=!1;const{desiredDistanceCm:l,desiredDistanceTolerance:u,desiredDistanceMonitor:c,desiredDistanceMonitorCancelable:h,desiredDistanceMonitorAllowRecalibrate:d}=t;e._distanceTrackNudging.distanceCorrectEnabled=!0,e._distanceTrackNudging.distanceDesired=l,e._distanceTrackNudging.distanceAllowedRatio=u,we=async()=>{const u=performance.now();if(i=await a.estimateFaces(r),i.length){e._trackingVideoFrameTimestamps.distance+=u;const a=i[0].keypoints;if(5===Ce){if(ke+=me(a[133],a[362]),ke/=5,e._trackingVideoFrameTimestamps.distance/=5,null!==ye.current){if(!be){const t=_e(o),n=Math.sqrt(Math.pow(ye.current.value,2)-Math.pow(t,2));ye.current.value=n,be=ke*ye.current.value,s.options.check||e._removeBackground(),e._trackingSetupFinishedStatus.distance=!0,Ae=!0}const i=performance.now(),u=Math.round(i-e._trackingVideoFrameTimestamps.distance),p=e.newViewingDistanceData={value:(0,_.Nh)(be/ke,t.decimalPlace),timestamp:i,method:e._CONST.VIEW_METHOD.F,latencyMs:u};let f;(Ae||c)&&(l&&e.nudgeDistance(h,d,s),Ae=!1),t.nearPoint&&(f=Ee(e,t,r,a,ke,i,o,u)),n&&"function"==typeof n&&(e.gazeTracker.defaultDistanceTrackCallback=n,n({value:{viewingDistanceCm:p.value,nearPointCm:f?f.value:[null,null],latencyMs:u},timestamp:i,method:e._CONST.VIEW_METHOD.F}))}ke=0,Ce=1,e._trackingVideoFrameTimestamps.distance=0}else ke+=me(a[133],a[362]),++Ce}},ve.break=!1,ve.framerate=5*t.framerate,ce(we,ve)}))},Ee=(e,t,n,s,r,a,i,o)=>{let l=((e,t,n)=>[(-t.x-n.x+e.videoWidth)/2,(-t.y-n.y+e.videoHeight)/2])(n,s[133],s[362]);l.forEach(((t,n)=>{l[n]=(e.PDCm?e.PDCm.value:e._CONST.N.PD_DONT_USE)*t/r}));let u=e.newNearPointData={value:{x:(0,_.Nh)(l[0],t.decimalPlace),y:(0,_.Nh)(l[1]+screen.height/2*2.54/i,t.decimalPlace),latencyMs:o},timestamp:a};if(t.showNearPoint){let e=u.value.x*i/2.54,t=u.value.y*i/2.54;Object.assign(xe.style,{left:screen.width/2-window.screenLeft+e-5+"px",top:screen.height/2-window.screenTop-(window.outerHeight-window.innerHeight)-t-5+"px"})}return u};E.A.prototype.pauseDistance=function(){return this.gazeTracker.checkInitialized("distance",!0)&&!this._trackingPaused.distance?(ve.break=!0,xe&&(xe.style.display="none"),this._trackingVideoFrameTimestamps.distance=0,this._trackingPaused.distance=!0,this.pauseNudger(),this):null},E.A.prototype.resumeDistance=function(){return this.gazeTracker.checkInitialized("distance",!0)&&this._trackingPaused.distance?(ve.break=!1,xe&&(xe.style.display="block"),ke=0,Ce=1,this._trackingVideoFrameTimestamps.distance=0,ce(we,ve),this._trackingPaused.distance=!1,this.resumeNudger(),this):null},E.A.prototype.endDistance=function(e=!1,t=!0){return this.gazeTracker.checkInitialized("distance",!0)?(ve.break=!0,ve.framerate=20,ge.pipWidthPx=0,ge.decimalPlace=2,ge.framerate=3,ge.nearPoint=!0,ge.showNearPoint=!1,ge.desiredDistanceCm=void 0,ge.desiredDistanceTolerance=1.2,ge.desiredDistanceMonitor=!1,ge.desiredDistanceMonitorCancelable=!1,ge.desiredDistanceMonitorAllowRecalibrate=!0,ye.current=null,be=null,we=null,Ae=!1,this._trackingVideoFrameTimestamps.distance=0,this._trackingPaused.distance=!1,xe&&(document.body.removeChild(xe),xe=null),this.endNudger(),t&&this.gazeTracker.end("distance",e),this):null},E.A.prototype.getDistanceNow=async function(e=null){if(!this.checkInitialized()||!this.gazeTracker.checkInitialized("distance",!0)||!ve.break)return;let t=e||this.gazeTracker.defaultDistanceTrackCallback,n=document.querySelector("#webgazerVideoFeed"),s=await this.gazeTracker.webgazer.getTracker().model;const r=performance.now();let a=await s.estimateFaces(n);if(a.length){const e=a[0].scaledMesh,s=me(e[133],e[362]);let i=performance.now();const o=i-r,l=this.newViewingDistanceData={value:(0,_.Nh)(be/s,ge.decimalPlace),timestamp:i,method:this._CONST.VIEW_METHOD.F,latencyMs:o};let u;return ge.nearPoint&&(u=Ee(this,ge,n,e,s,i,this.screenPpi?this.screenPpi.value:this._CONST.N.PPI_DONT_USE,o)),(0,_.nB)(t,{value:{viewingDistanceCm:l.value,nearPointCm:u?u.value:null,latencyMs:o},timestamp:i,method:this._CONST.VIEW_METHOD.F}),l}return null},E.A.prototype.showNearPoint=function(e=!0){if(this.gazeTracker.checkInitialized("distance",!1)){const t=document.querySelector("#rc-near-point-dot");t&&(t.display=e?"block":"none")}};const _e=e=>2.54*(window.screen.height/2/e);E.A.prototype.nudgeDistance=function(e=!1,t=!0,n){if(!this.checkInitialized())return;const{distanceDesired:s,distanceAllowedRatio:r}=this._distanceTrackNudging;if(s){if(this.viewingDistanceCm&&this.viewingDistanceCm.method===this._CONST.VIEW_METHOD.F){if(Ie(this.viewingDistanceCm.value,s,r))return!0;{const a=()=>{this._removeNudger(),clearInterval(this._distanceTrackNudging.distanceCorrecting),this._distanceTrackNudging.distanceCorrecting=null,(0,V.l)(o)},i=async()=>{this.endDistance(),this._addBackground(),await(0,_.yy)(2e3),this.trackDistance(n.options,n.callbackStatic,n.callbackTrack)},o=(0,V.m)(e?{Escape:this.endNudger}:{});if(null===this._distanceTrackNudging.distanceCorrecting&&this._distanceTrackNudging.distanceCorrectEnabled){const[n,l,u]=Te(this);let c=e?{cancel:()=>{this.endNudger()}}:{};t&&(c={...c,custom:{callback:i,content:U.H.RC_distanceTrackingRedo[this.L]}}),(e||t)&&(0,W.F)(this.L,this.nudger,c,this.params.showCancelButton);const h=()=>{n.innerHTML=Ne(this,this.viewingDistanceCm.value,s),l.innerHTML=Math.round(this.viewingDistanceCm.value),u.innerHTML=Math.round(s)};h(),this._distanceTrackNudging.distanceCorrecting=setInterval((()=>{h(),Ie(this.viewingDistanceCm.value,s,r)&&(a(),(0,V.l)(o))}),200)}else this._distanceTrackNudging.distanceCorrecting&&!this._distanceTrackNudging.distanceCorrectEnabled&&a();return!1}}return!1}};const Ie=(e,t,n)=>{if(!Oe(n))return!1;let s=t*n,r=t/n;return e<=Math.max(s,r)&&e>=Math.min(s,r)},Te=e=>(e._addNudger(`
          \n

          \n

          ${U.H.RC_distanceTrackingGuide[e.L].replace("xx1",'').replace("xx2",'')}

          \n
          \n `),[document.querySelector("#rc-distance-correct-instruction"),document.querySelector("#rc-distance-now"),document.querySelector("#rc-distance-desired")]),Ne=(e,t,n)=>t>=n?U.H.RC_distanceTrackingMoveCloser[e.L]:U.H.RC_distanceTrackingMoveFurther[e.L],Oe=e=>!isNaN(e)&&(e>0&&1!==e);E.A.prototype.setDistanceDesired=function(e,t=null){return this._distanceTrackNudging.distanceDesired=e,t&&Oe(t)&&(this._distanceTrackNudging.distanceAllowedRatio=t),e},E.A.prototype._addNudger=function(e){if(null!==this.nudger)return;let t=document.getElementById("calibration-nudger");return t||(t=document.createElement("div"),t.id="calibration-nudger",t.className=`calibration-nudger rc-lang-${this.LD.toLowerCase()}`,document.body.classList.add("lock-view"),document.body.appendChild(t),t.style.background=this.params.backgroundColor),e&&(t.innerHTML=e),this._nudger.element=t,this.nudger},E.A.prototype._removeNudger=function(){let e=document.getElementById("calibration-nudger");return!!e&&(document.body.classList.remove("lock-view"),document.body.removeChild(e),this._nudger={element:null},!0)},E.A.prototype.pauseNudger=function(){document.body.classList.add("hide-nudger")},E.A.prototype.resumeNudger=function(){document.body.classList.remove("hide-nudger")},E.A.prototype.endNudger=function(){return!!this._distanceTrackNudging.distanceCorrectEnabled&&(this._removeNudger(),this._distanceTrackNudging.distanceCorrectEnabled=!1,this._distanceTrackNudging.distanceCorrecting&&clearInterval(this._distanceTrackNudging.distanceCorrecting),this._distanceTrackNudging.distanceCorrecting=null,this._distanceTrackNudging.distanceDesired=null,this._distanceAllowedRatio=null,!0)};function Re(e,t,n,s,r){let a=setInterval((()=>{let i=document.getElementById("webgazerVideoContainer");i&&(clearInterval(a),i.style.height=t/parseInt(i.style.width)*parseInt(i.style.height)+"px",i.style.width=t+"px",i.style.opacity=n,s.setVideoViewerSize(parseInt(i.style.width),parseInt(i.style.height)),De(e,i),setTimeout((()=>{e.videoOpacity(),e.isMobile.value?i.style.transition="right 0.5s, top 0.5s, width 0.5s, height 0.5s, border-radius 0.5s":i.style.transition="left 0.5s, bottom 0.5s, width 0.5s, height 0.5s, border-radius 0.5s",(0,_.nB)(r)}),700))}),100)}function De(e,t){e.isMobile.value?(t.style.left="unset",t.style.right=e._CONST.N.VIDEO_MARGIN,t.style.top=e._CONST.N.VIDEO_MARGIN,t.style.bottom="unset"):(t.style.left=e._CONST.N.VIDEO_MARGIN,t.style.right="unset",t.style.top="unset",t.style.bottom=e._CONST.N.VIDEO_MARGIN)}const Me={video:!1,videoWidth:0,videoHeight:0,opacity:1,gaze:!1,faceOverlay:!1},Fe=.9;E.A.prototype._measurePD=async function(e={},t){if(!this.checkInitialized())return;(0,_.$k)(),e=Object.assign({fullscreen:!1,headline:"👁️ "+U.H.RC_nearPointTitle[this.L],description:U.H.RC_nearPointIntro[this.L],shortDescription:U.H.RC_nearPointIntro[this.L]},e),this.getFullscreen(e.fullscreen),await(0,_.yy)(1e3),this._replaceBackground(),this._replaceBackground((0,_.$O)(e.headline,e.shortDescription,!0));const n=this.screenPpi?this.screenPpi.value:this._CONST.N.PPI_DONT_USE;let[s,r]=Be(this),[a,i]=Pe(this,n,s,r);const o=this,l=(e=!0)=>{a.removeEventListener("mousedown",i),this._removeBackground(),this.showVideo(Me.video),this.showGazer(Me.gaze),this.showFaceOverlay(Me.faceOverlay),this.gazeTracker.webgazer.showFaceFeedbackBox(!0),Object.assign(document.querySelector("#webgazerVideoContainer").style,{height:Me.videoHeight,width:Me.videoWidth,opacity:Me.opacity,borderRadius:"5px"}),De(o,document.querySelector("#webgazerVideoContainer")),Object.assign(document.querySelector("#webgazerVideoFeed").style,{height:Me.videoHeight,width:Me.videoWidth,top:"unset",transform:"scale(-1, 1)",transformOrigin:"unset"}),Me.video=!1,Me.videoWidth=0,Me.videoHeight=0,Me.opacity=1,Me.gaze=!1,Me.faceOverlay=!1,!o._trackingSetupFinishedStatus.distance&&e&&(o._trackingSetupFinishedStatus.distance=!0,o.endDistance()),(0,V.l)(c)},u=()=>{if(-100!==Le){const e={value:2.54*Le/n,timestamp:performance.now()};return this.newPDData=e,l(!1),(0,_.nB)(t,e)}},c=(0,V.m)({Escape:l,Enter:u," ":u});(0,W.F)(this.L,this.background,{go:u,cancel:l},this.params.showCancelButton),setTimeout((()=>{Q().fire({...ae(this,{showIcon:!1}),icon:void 0,imageUrl:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAeAAAADwCAIAAABXFyDtAAAACXBIWXMAAAsTAAALEwEAmpwYAAAGx2lUWHRYTUw6Y29tLmFkb2JlLnhtcAAAAAAAPD94cGFja2V0IGJlZ2luPSLvu78iIGlkPSJXNU0wTXBDZWhpSHpyZVN6TlRjemtjOWQiPz4gPHg6eG1wbWV0YSB4bWxuczp4PSJhZG9iZTpuczptZXRhLyIgeDp4bXB0az0iQWRvYmUgWE1QIENvcmUgNi4wLWMwMDYgNzkuZGFiYWNiYiwgMjAyMS8wNC8xNC0wMDozOTo0NCAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczpkYz0iaHR0cDovL3B1cmwub3JnL2RjL2VsZW1lbnRzLzEuMS8iIHhtbG5zOnBob3Rvc2hvcD0iaHR0cDovL25zLmFkb2JlLmNvbS9waG90b3Nob3AvMS4wLyIgeG1sbnM6eG1wTU09Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9tbS8iIHhtbG5zOnN0RXZ0PSJodHRwOi8vbnMuYWRvYmUuY29tL3hh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zKRmDt18oZ9x3/yf483VPlzLbdLDtAep/3I6VZRkWoqytThDJ2pKdQsvw+lECNN03RNQRgNw4sU0UaZOxJKGJbFGIF0qrSkQrC7IQWyLIXjcYuFlyUplUgihhn3owAgJt17qrSxacVttyVjUcFmc5eVEkL3v7rpxNYdkMHIxB7w3vKdzz/d3xe8/avf1iLnNO3Syr+yzuQFT8F7yra88qyK+A/ecWcwHhjSF9Fldx4/c6KjvaWystzmdF3Mvk9V1BJnia/E8+prW5Cz/FIQwtCUeUJBodc4AJRC8q8plX9RHCMD1svJg0EIJUmcO2PqXzZue+rl16vKSoxn/39nE9KqgqMETAAAAABJRU5ErkJggg==",imageWidth:480,imageAlt:"Measurement Instruction",html:e.description})}),700)};const Be=e=>{let t=document.querySelector("#webgazerVideoFeed");if(t)return ze(e,t,document.querySelector("#webgazerVideoCanvas"),document.querySelector("#webgazerVideoContainer"))},ze=(e,t,n,s,r=null)=>{r||t.captureStream&&(r=t.captureStream());let a=.3*window.innerWidth/parseInt(t.style.width)*parseInt(t.style.height);Me.videoWidth=s.style.width,Me.videoHeight=s.style.height,Me.opacity=s.style.opacity;const i={height:Math.round(a)+"px",width:Math.round(window.innerWidth*Fe)+"px",opacity:1,borderRadius:"15px"};Object.assign(s.style,i),e.isMobile.value?Object.assign(s.style,{right:Math.round(.5*window.innerWidth*(1-Fe))+"px",top:Math.round(.5*(window.innerHeight-a))+"px"}):Object.assign(s.style,{left:Math.round(.5*window.innerWidth*(1-Fe))+"px",bottom:Math.round(.5*(window.innerHeight-a))+"px"});const o={height:Math.round(a*Fe/.3)+"px",width:Math.round(window.innerWidth*Fe)+"px",top:Math.round(.6000000000000001*-a)+"px",transform:"scale(-2, 2)",transformOrigin:"center"};return Object.assign(t.style,o),Me.video=e.gazeTracker.webgazer.params.showVideo,Me.gaze=e.gazeTracker.webgazer.params.showGazeDot,Me.faceOverlay=e.gazeTracker.webgazer.params.showFaceOverlay,Me.video||e.showVideo(!0),Me.gaze&&e.showGazer(!1),Me.faceOverlay&&e.showFaceOverlay(!1),e.gazeTracker.webgazer.showFaceFeedbackBox(!1),[window.innerWidth*Fe,a]};let Le=-100;const Pe=(e,t,n,s)=>{const r=document.createElement("div");r.id="rc-ruler",Object.assign(r.style,{height:.9*(window.innerHeight-s)/2+"px",width:2*window.innerWidth+"px",left:.25*(window.innerWidth-n)+"px",bottom:0,backgroundColor:"#FFD523dd",borderRadius:"7px 0 0 0",boxSizing:"border-box",borderBottom:"5px solid #bb6600"}),e.background.appendChild(r);const a=document.createElement("div");a.id="rc-ruler-scales",r.appendChild(a);const i=2.54*(r.clientWidth-60)/t;for(let n=0;n<=10*(0,_.Nh)(i,1);n++){let s=document.createElement("div"),r=.1*n*t/2.54+"px";if(s.className="rc-ruler-scale "+(n%10==0?"rc-ruler-major":n%5==0?"rc-ruler-secondary":"rc-ruler-minor"),s.style.left=r,a.appendChild(s),n%10==0){let t=document.createElement("p");t.className="rc-ruler-scale-text",t.style.left=r,t.innerHTML=n/10,a.appendChild(t),0===n&&(t.style.color=e._CONST.COLOR.DARK_RED)}}let o=document.createElement("div");a.appendChild(o),o.outerHTML=D(),o=document.querySelector("#size-arrow"),o.setAttribute("preserveAspectRatio","none"),o.style.left="-100px",o.style.top="40px",document.getElementById("size-arrow-fill").setAttribute("fill",e._CONST.COLOR.DARK_RED);const l=e=>{o.style.left=(Le=e.offsetX-30)+"px";const t=e=>{o.style.left=(Le=e.offsetX-30)+"px"};r.addEventListener("mousemove",t),r.addEventListener("mouseup",(function e(){r.removeEventListener("mousemove",t),r.removeEventListener("mouseup",e)}))};return r.addEventListener("mousedown",l),[r,l]};function Ve(e){return Ve="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Ve(e)}var We=/^\s+/,Ue=/\s+$/;function Ge(e,t){if(t=t||{},(e=e||"")instanceof Ge)return e;if(!(this instanceof Ge))return new Ge(e,t);var n=function(e){var t={r:0,g:0,b:0},n=1,s=null,r=null,a=null,i=!1,o=!1;"string"==typeof e&&(e=function(e){e=e.replace(We,"").replace(Ue,"").toLowerCase();var t,n=!1;if(it[e])e=it[e],n=!0;else if("transparent"==e)return{r:0,g:0,b:0,a:0,format:"name"};if(t=wt.rgb.exec(e))return{r:t[1],g:t[2],b:t[3]};if(t=wt.rgba.exec(e))return{r:t[1],g:t[2],b:t[3],a:t[4]};if(t=wt.hsl.exec(e))return{h:t[1],s:t[2],l:t[3]};if(t=wt.hsla.exec(e))return{h:t[1],s:t[2],l:t[3],a:t[4]};if(t=wt.hsv.exec(e))return{h:t[1],s:t[2],v:t[3]};if(t=wt.hsva.exec(e))return{h:t[1],s:t[2],v:t[3],a:t[4]};if(t=wt.hex8.exec(e))return{r:ht(t[1]),g:ht(t[2]),b:ht(t[3]),a:mt(t[4]),format:n?"name":"hex8"};if(t=wt.hex6.exec(e))return{r:ht(t[1]),g:ht(t[2]),b:ht(t[3]),format:n?"name":"hex"};if(t=wt.hex4.exec(e))return{r:ht(t[1]+""+t[1]),g:ht(t[2]+""+t[2]),b:ht(t[3]+""+t[3]),a:mt(t[4]+""+t[4]),format:n?"name":"hex8"};if(t=wt.hex3.exec(e))return{r:ht(t[1]+""+t[1]),g:ht(t[2]+""+t[2]),b:ht(t[3]+""+t[3]),format:n?"name":"hex"};return!1}(e));"object"==Ve(e)&&(vt(e.r)&&vt(e.g)&&vt(e.b)?(t=function(e,t,n){return{r:255*ut(e,255),g:255*ut(t,255),b:255*ut(n,255)}}(e.r,e.g,e.b),i=!0,o="%"===String(e.r).substr(-1)?"prgb":"rgb"):vt(e.h)&&vt(e.s)&&vt(e.v)?(s=pt(e.s),r=pt(e.v),t=function(e,t,n){e=6*ut(e,360),t=ut(t,100),n=ut(n,100);var s=Math.floor(e),r=e-s,a=n*(1-t),i=n*(1-r*t),o=n*(1-(1-r)*t),l=s%6,u=[n,i,a,a,o,n][l],c=[o,n,n,i,a,a][l],h=[a,a,o,n,n,i][l];return{r:255*u,g:255*c,b:255*h}}(e.h,s,r),i=!0,o="hsv"):vt(e.h)&&vt(e.s)&&vt(e.l)&&(s=pt(e.s),a=pt(e.l),t=function(e,t,n){var s,r,a;function i(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?e+6*(t-e)*n:n<.5?t:n<2/3?e+(t-e)*(2/3-n)*6:e}if(e=ut(e,360),t=ut(t,100),n=ut(n,100),0===t)s=r=a=n;else{var o=n<.5?n*(1+t):n+t-n*t,l=2*n-o;s=i(l,o,e+1/3),r=i(l,o,e),a=i(l,o,e-1/3)}return{r:255*s,g:255*r,b:255*a}}(e.h,s,a),i=!0,o="hsl"),e.hasOwnProperty("a")&&(n=e.a));return n=lt(n),{ok:i,format:e.format||o,r:Math.min(255,Math.max(t.r,0)),g:Math.min(255,Math.max(t.g,0)),b:Math.min(255,Math.max(t.b,0)),a:n}}(e);this._originalInput=e,this._r=n.r,this._g=n.g,this._b=n.b,this._a=n.a,this._roundA=Math.round(100*this._a)/100,this._format=t.format||n.format,this._gradientType=t.gradientType,this._r<1&&(this._r=Math.round(this._r)),this._g<1&&(this._g=Math.round(this._g)),this._b<1&&(this._b=Math.round(this._b)),this._ok=n.ok}function qe(e,t,n){e=ut(e,255),t=ut(t,255),n=ut(n,255);var s,r,a=Math.max(e,t,n),i=Math.min(e,t,n),o=(a+i)/2;if(a==i)s=r=0;else{var l=a-i;switch(r=o>.5?l/(2-a-i):l/(a+i),a){case e:s=(t-n)/l+(t>1)+720)%360;--t;)s.h=(s.h+r)%360,a.push(Ge(s));return a}function at(e,t){t=t||6;for(var n=Ge(e).toHsv(),s=n.h,r=n.s,a=n.v,i=[],o=1/t;t--;)i.push(Ge({h:s,s:r,v:a})),a=(a+o)%1;return i}Ge.prototype={isDark:function(){return this.getBrightness()<128},isLight:function(){return!this.isDark()},isValid:function(){return this._ok},getOriginalInput:function(){return this._originalInput},getFormat:function(){return this._format},getAlpha:function(){return this._a},getBrightness:function(){var e=this.toRgb();return(299*e.r+587*e.g+114*e.b)/1e3},getLuminance:function(){var e,t,n,s=this.toRgb();return e=s.r/255,t=s.g/255,n=s.b/255,.2126*(e<=.03928?e/12.92:Math.pow((e+.055)/1.055,2.4))+.7152*(t<=.03928?t/12.92:Math.pow((t+.055)/1.055,2.4))+.0722*(n<=.03928?n/12.92:Math.pow((n+.055)/1.055,2.4))},setAlpha:function(e){return this._a=lt(e),this._roundA=Math.round(100*this._a)/100,this},toHsv:function(){var e=je(this._r,this._g,this._b);return{h:360*e.h,s:e.s,v:e.v,a:this._a}},toHsvString:function(){var e=je(this._r,this._g,this._b),t=Math.round(360*e.h),n=Math.round(100*e.s),s=Math.round(100*e.v);return 1==this._a?"hsv("+t+", "+n+"%, "+s+"%)":"hsva("+t+", "+n+"%, "+s+"%, "+this._roundA+")"},toHsl:function(){var e=qe(this._r,this._g,this._b);return{h:360*e.h,s:e.s,l:e.l,a:this._a}},toHslString:function(){var e=qe(this._r,this._g,this._b),t=Math.round(360*e.h),n=Math.round(100*e.s),s=Math.round(100*e.l);return 1==this._a?"hsl("+t+", "+n+"%, "+s+"%)":"hsla("+t+", "+n+"%, "+s+"%, "+this._roundA+")"},toHex:function(e){return He(this._r,this._g,this._b,e)},toHexString:function(e){return"#"+this.toHex(e)},toHex8:function(e){return function(e,t,n,s,r){var a=[dt(Math.round(e).toString(16)),dt(Math.round(t).toString(16)),dt(Math.round(n).toString(16)),dt(ft(s))];if(r&&a[0].charAt(0)==a[0].charAt(1)&&a[1].charAt(0)==a[1].charAt(1)&&a[2].charAt(0)==a[2].charAt(1)&&a[3].charAt(0)==a[3].charAt(1))return a[0].charAt(0)+a[1].charAt(0)+a[2].charAt(0)+a[3].charAt(0);return a.join("")}(this._r,this._g,this._b,this._a,e)},toHex8String:function(e){return"#"+this.toHex8(e)},toRgb:function(){return{r:Math.round(this._r),g:Math.round(this._g),b:Math.round(this._b),a:this._a}},toRgbString:function(){return 1==this._a?"rgb("+Math.round(this._r)+", "+Math.round(this._g)+", "+Math.round(this._b)+")":"rgba("+Math.round(this._r)+", "+Math.round(this._g)+", "+Math.round(this._b)+", "+this._roundA+")"},toPercentageRgb:function(){return{r:Math.round(100*ut(this._r,255))+"%",g:Math.round(100*ut(this._g,255))+"%",b:Math.round(100*ut(this._b,255))+"%",a:this._a}},toPercentageRgbString:function(){return 1==this._a?"rgb("+Math.round(100*ut(this._r,255))+"%, "+Math.round(100*ut(this._g,255))+"%, "+Math.round(100*ut(this._b,255))+"%)":"rgba("+Math.round(100*ut(this._r,255))+"%, "+Math.round(100*ut(this._g,255))+"%, "+Math.round(100*ut(this._b,255))+"%, "+this._roundA+")"},toName:function(){return 0===this._a?"transparent":!(this._a<1)&&(ot[He(this._r,this._g,this._b,!0)]||!1)},toFilter:function(e){var t="#"+$e(this._r,this._g,this._b,this._a),n=t,s=this._gradientType?"GradientType = 1, ":"";if(e){var r=Ge(e);n="#"+$e(r._r,r._g,r._b,r._a)}return"progid:DXImageTransform.Microsoft.gradient("+s+"startColorstr="+t+",endColorstr="+n+")"},toString:function(e){var t=!!e;e=e||this._format;var n=!1,s=this._a<1&&this._a>=0;return t||!s||"hex"!==e&&"hex6"!==e&&"hex3"!==e&&"hex4"!==e&&"hex8"!==e&&"name"!==e?("rgb"===e&&(n=this.toRgbString()),"prgb"===e&&(n=this.toPercentageRgbString()),"hex"!==e&&"hex6"!==e||(n=this.toHexString()),"hex3"===e&&(n=this.toHexString(!0)),"hex4"===e&&(n=this.toHex8String(!0)),"hex8"===e&&(n=this.toHex8String()),"name"===e&&(n=this.toName()),"hsl"===e&&(n=this.toHslString()),"hsv"===e&&(n=this.toHsvString()),n||this.toHexString()):"name"===e&&0===this._a?this.toName():this.toRgbString()},clone:function(){return Ge(this.toString())},_applyModification:function(e,t){var n=e.apply(null,[this].concat([].slice.call(t)));return this._r=n._r,this._g=n._g,this._b=n._b,this.setAlpha(n._a),this},lighten:function(){return this._applyModification(Ye,arguments)},brighten:function(){return this._applyModification(Qe,arguments)},darken:function(){return this._applyModification(Je,arguments)},desaturate:function(){return this._applyModification(Ke,arguments)},saturate:function(){return this._applyModification(Xe,arguments)},greyscale:function(){return this._applyModification(Ze,arguments)},spin:function(){return this._applyModification(et,arguments)},_applyCombination:function(e,t){return e.apply(null,[this].concat([].slice.call(t)))},analogous:function(){return this._applyCombination(rt,arguments)},complement:function(){return this._applyCombination(tt,arguments)},monochromatic:function(){return this._applyCombination(at,arguments)},splitcomplement:function(){return this._applyCombination(st,arguments)},triad:function(){return this._applyCombination(nt,[3])},tetrad:function(){return this._applyCombination(nt,[4])}},Ge.fromRatio=function(e,t){if("object"==Ve(e)){var n={};for(var s in e)e.hasOwnProperty(s)&&(n[s]="a"===s?e[s]:pt(e[s]));e=n}return Ge(e,t)},Ge.equals=function(e,t){return!(!e||!t)&&Ge(e).toRgbString()==Ge(t).toRgbString()},Ge.random=function(){return Ge.fromRatio({r:Math.random(),g:Math.random(),b:Math.random()})},Ge.mix=function(e,t,n){n=0===n?0:n||50;var s=Ge(e).toRgb(),r=Ge(t).toRgb(),a=n/100;return Ge({r:(r.r-s.r)*a+s.r,g:(r.g-s.g)*a+s.g,b:(r.b-s.b)*a+s.b,a:(r.a-s.a)*a+s.a})},Ge.readability=function(e,t){var n=Ge(e),s=Ge(t);return(Math.max(n.getLuminance(),s.getLuminance())+.05)/(Math.min(n.getLuminance(),s.getLuminance())+.05)},Ge.isReadable=function(e,t,n){var s,r,a=Ge.readability(e,t);switch(r=!1,(s=function(e){var t,n;t=((e=e||{level:"AA",size:"small"}).level||"AA").toUpperCase(),n=(e.size||"small").toLowerCase(),"AA"!==t&&"AAA"!==t&&(t="AA");"small"!==n&&"large"!==n&&(n="small");return{level:t,size:n}}(n)).level+s.size){case"AAsmall":case"AAAlarge":r=a>=4.5;break;case"AAlarge":r=a>=3;break;case"AAAsmall":r=a>=7}return r},Ge.mostReadable=function(e,t,n){var s,r,a,i,o=null,l=0;r=(n=n||{}).includeFallbackColors,a=n.level,i=n.size;for(var u=0;ul&&(l=s,o=Ge(t[u]));return Ge.isReadable(e,o,{level:a,size:i})||!r?o:(n.includeFallbackColors=!1,Ge.mostReadable(e,["#fff","#000"],n))};var it=Ge.names={aliceblue:"f0f8ff",antiquewhite:"faebd7",aqua:"0ff",aquamarine:"7fffd4",azure:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"000",blanchedalmond:"ffebcd",blue:"00f",blueviolet:"8a2be2",brown:"a52a2a",burlywood:"deb887",burntsienna:"ea7e5d",cadetblue:"5f9ea0",chartreuse:"7fff00",chocolate:"d2691e",coral:"ff7f50",cornflowerblue:"6495ed",cornsilk:"fff8dc",crimson:"dc143c",cyan:"0ff",darkblue:"00008b",darkcyan:"008b8b",darkgoldenrod:"b8860b",darkgray:"a9a9a9",darkgreen:"006400",darkgrey:"a9a9a9",darkkhaki:"bdb76b",darkmagenta:"8b008b",darkolivegreen:"556b2f",darkorange:"ff8c00",darkorchid:"9932cc",darkred:"8b0000",darksalmon:"e9967a",darkseagreen:"8fbc8f",darkslateblue:"483d8b",darkslategray:"2f4f4f",darkslategrey:"2f4f4f",darkturquoise:"00ced1",darkviolet:"9400d3",deeppink:"ff1493",deepskyblue:"00bfff",dimgray:"696969",dimgrey:"696969",dodgerblue:"1e90ff",firebrick:"b22222",floralwhite:"fffaf0",forestgreen:"228b22",fuchsia:"f0f",gainsboro:"dcdcdc",ghostwhite:"f8f8ff",gold:"ffd700",goldenrod:"daa520",gray:"808080",green:"008000",greenyellow:"adff2f",grey:"808080",honeydew:"f0fff0",hotpink:"ff69b4",indianred:"cd5c5c",indigo:"4b0082",ivory:"fffff0",khaki:"f0e68c",lavender:"e6e6fa",lavenderblush:"fff0f5",lawngreen:"7cfc00",lemonchiffon:"fffacd",lightblue:"add8e6",lightcoral:"f08080",lightcyan:"e0ffff",lightgoldenrodyellow:"fafad2",lightgray:"d3d3d3",lightgreen:"90ee90",lightgrey:"d3d3d3",lightpink:"ffb6c1",lightsalmon:"ffa07a",lightseagreen:"20b2aa",lightskyblue:"87cefa",lightslategray:"789",lightslategrey:"789",lightsteelblue:"b0c4de",lightyellow:"ffffe0",lime:"0f0",limegreen:"32cd32",linen:"faf0e6",magenta:"f0f",maroon:"800000",mediumaquamarine:"66cdaa",mediumblue:"0000cd",mediumorchid:"ba55d3",mediumpurple:"9370db",mediumseagreen:"3cb371",mediumslateblue:"7b68ee",mediumspringgreen:"00fa9a",mediumturquoise:"48d1cc",mediumvioletred:"c71585",midnightblue:"191970",mintcream:"f5fffa",mistyrose:"ffe4e1",moccasin:"ffe4b5",navajowhite:"ffdead",navy:"000080",oldlace:"fdf5e6",olive:"808000",olivedrab:"6b8e23",orange:"ffa500",orangered:"ff4500",orchid:"da70d6",palegoldenrod:"eee8aa",palegreen:"98fb98",paleturquoise:"afeeee",palevioletred:"db7093",papayawhip:"ffefd5",peachpuff:"ffdab9",peru:"cd853f",pink:"ffc0cb",plum:"dda0dd",powderblue:"b0e0e6",purple:"800080",rebeccapurple:"663399",red:"f00",rosybrown:"bc8f8f",royalblue:"4169e1",saddlebrown:"8b4513",salmon:"fa8072",sandybrown:"f4a460",seagreen:"2e8b57",seashell:"fff5ee",sienna:"a0522d",silver:"c0c0c0",skyblue:"87ceeb",slateblue:"6a5acd",slategray:"708090",slategrey:"708090",snow:"fffafa",springgreen:"00ff7f",steelblue:"4682b4",tan:"d2b48c",teal:"008080",thistle:"d8bfd8",tomato:"ff6347",turquoise:"40e0d0",violet:"ee82ee",wheat:"f5deb3",white:"fff",whitesmoke:"f5f5f5",yellow:"ff0",yellowgreen:"9acd32"},ot=Ge.hexNames=function(e){var t={};for(var n in e)e.hasOwnProperty(n)&&(t[e[n]]=n);return t}(it);function lt(e){return e=parseFloat(e),(isNaN(e)||e<0||e>1)&&(e=1),e}function ut(e,t){(function(e){return"string"==typeof e&&-1!=e.indexOf(".")&&1===parseFloat(e)})(e)&&(e="100%");var n=function(e){return"string"==typeof e&&-1!=e.indexOf("%")}(e);return e=Math.min(t,Math.max(0,parseFloat(e))),n&&(e=parseInt(e*t,10)/100),Math.abs(e-t)<1e-6?1:e%t/parseFloat(t)}function ct(e){return Math.min(1,Math.max(0,e))}function ht(e){return parseInt(e,16)}function dt(e){return 1==e.length?"0"+e:""+e}function pt(e){return e<=1&&(e=100*e+"%"),e}function ft(e){return Math.round(255*parseFloat(e)).toString(16)}function mt(e){return ht(e)/255}var gt,yt,bt,wt=(yt="[\\s|\\(]+("+(gt="(?:[-\\+]?\\d*\\.\\d+%?)|(?:[-\\+]?\\d+%?)")+")[,|\\s]+("+gt+")[,|\\s]+("+gt+")\\s*\\)?",bt="[\\s|\\(]+("+gt+")[,|\\s]+("+gt+")[,|\\s]+("+gt+")[,|\\s]+("+gt+")\\s*\\)?",{CSS_UNIT:new RegExp(gt),rgb:new RegExp("rgb"+yt),rgba:new RegExp("rgba"+bt),hsl:new RegExp("hsl"+yt),hsla:new RegExp("hsla"+bt),hsv:new RegExp("hsv"+yt),hsva:new RegExp("hsva"+bt),hex3:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex6:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,hex4:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex8:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/});function vt(e){return!!wt.CSS_UNIT.exec(e)}var xt=__webpack_require__(782);const At=e=>e/2.54,kt={video:!1,gazer:!1};function Ct(e,t){e.background?e._replaceBackground((0,_.$O)(t.headline,t.description)):e._addBackground((0,_.$O)(t.headline,t.description)),e._constructFloatInstructionElement("gaze-system-instruction",U.H.RC_starting[e.L])}E.A.prototype.calibrateGaze=function(e={},t){if(!this.gazeTracker.checkInitialized("gaze",!0))return;(0,_.$k)(),(e=Object.assign({greedyLearner:!1,calibrationCount:1,headline:"👀 "+U.H.RC_gazeTrackingTitle[this.L],description:U.H.RC_gazeTrackingIntro[this.L]},e)).nudge=!1,kt.video=this.gazeTracker.webgazer.params.showVideo,kt.gazer=this.gazeTracker.webgazer.params.showGazeDot,kt.video||this.showVideo(!0),kt.gazer||this.showGazer(!0),this.gazeTracker.webgazer.params.greedyLearner=e.greedyLearner,Ct(this,e);const n=St(this,e,(()=>{this._removeBackground(),(0,V.l)(s),(0,_.nB)(t,{timestamp:performance.now()})})),s=(0,V.m)({Escape:()=>{n.deleteSelf(!1),this._removeBackground(),this.showVideo(kt.video),this.showGazer(kt.gazer),kt.video=!1,kt.gazer=!1,this._trackingSetupFinishedStatus.gaze||(this._trackingSetupFinishedStatus.gaze=!0,this.endGaze()),(0,V.l)(s)}})};const St=(e,t,n)=>(e._removeFloatInstructionElement(),new Et(e,document.body,t,kt,n));class Et{constructor(e,t,n,s,r){this._sequentialOrder(n.nudge),this.nudge=n.nudge,this.RC=e,this.clickThresholdBase=xt.Y?1:n.calibrationCount,this.clicks=0,this.position=this.order.shift(),this.clickThreshold=this.clickThresholdBase,this.r=this.RC._CONST.N.GAZE_CALIBRATION.R,this.div=document.createElement("div");const a=document.createElement("div"),i=document.createElement("div");this.div.className="rc-crosshair",this.div.id="rc-crosshair",a.className="rc-crosshair-component rc-crosshair-vertical",i.className="rc-crosshair-component rc-crosshair-horizontal",i.style.height=a.style.width=`${ee}px`,i.style.width=a.style.height=`${J}px`,this.div.style.background=e.params.backgroundColor;const o=Ge(e.params.backgroundColor).toRgb();return this.div.style.background=`rgba(${o.r}, ${o.g}, ${o.b}, 0.75)`,this.div.appendChild(a),this.div.appendChild(i),this.parent=t,this.parent.appendChild(this.div),this.placeDot(),this.handleClick=this.takeClick.bind(this),this.div.addEventListener("click",this.handleClick,!1),this.originalStyles=s,this.endCalibrationCallback=r,this.div}placeDot(){Object.assign(this.div.style,[{left:this.RC._CONST.N.GAZE_CALIBRATION.MARGIN+"px",right:"unset"},{left:`calc(50% - ${this.RC._CONST.N.GAZE_CALIBRATION.R/2}px)`,right:"unset"},{left:window.innerWidth-this.RC._CONST.N.GAZE_CALIBRATION.R-this.RC._CONST.N.GAZE_CALIBRATION.MARGIN+"px",right:"unset"},{left:`calc(50% - ${this.RC._CONST.N.GAZE_CALIBRATION.R/2}px - ${this.getOffsetPx(this.RC._CONST.N.GAZE_CALIBRATION.CENTER_EXTRA_CHECK_OFFSET)}px)`,right:"unset"},{left:`calc(50% - ${this.RC._CONST.N.GAZE_CALIBRATION.R/2}px + ${this.getOffsetPx(this.RC._CONST.N.GAZE_CALIBRATION.CENTER_EXTRA_CHECK_OFFSET)}px)`,right:"unset"},{left:`calc(50% - ${this.RC._CONST.N.GAZE_CALIBRATION.R/2}px - ${this.getOffsetPx(this.RC._CONST.N.GAZE_CALIBRATION.MID_EXTRA_CHECK_OFFSET,.3*window.innerWidth)}px)`,right:"unset"},{left:`calc(50% - ${this.RC._CONST.N.GAZE_CALIBRATION.R/2}px + ${this.getOffsetPx(this.RC._CONST.N.GAZE_CALIBRATION.MID_EXTRA_CHECK_OFFSET,.3*window.innerWidth)}px)`,right:"unset"}][this.position[0]],[{top:this.RC._CONST.N.GAZE_CALIBRATION.MARGIN+"px",bottom:"unset"},{top:`calc(50% - ${this.RC._CONST.N.GAZE_CALIBRATION.R/2}px)`,bottom:"unset"},{top:window.innerHeight-this.RC._CONST.N.GAZE_CALIBRATION.R-this.RC._CONST.N.GAZE_CALIBRATION.MARGIN+"px",bottom:"unset"},{top:`calc(50% - ${this.RC._CONST.N.GAZE_CALIBRATION.R/2}px - ${this.getOffsetPx(this.RC._CONST.N.GAZE_CALIBRATION.CENTER_EXTRA_CHECK_OFFSET)}px)`,bottom:"unset"},{top:`calc(50% - ${this.RC._CONST.N.GAZE_CALIBRATION.R/2}px + ${this.getOffsetPx(this.RC._CONST.N.GAZE_CALIBRATION.CENTER_EXTRA_CHECK_OFFSET)}px)`,bottom:"unset"},{top:`calc(50% - ${this.RC._CONST.N.GAZE_CALIBRATION.R/2}px - ${this.getOffsetPx(this.RC._CONST.N.GAZE_CALIBRATION.MID_EXTRA_CHECK_OFFSET,.3*window.innerHeight)}px)`,bottom:"unset"},{top:`calc(50% - ${this.RC._CONST.N.GAZE_CALIBRATION.R/2}px + ${this.getOffsetPx(this.RC._CONST.N.GAZE_CALIBRATION.MID_EXTRA_CHECK_OFFSET,.3*window.innerHeight)}px)`,bottom:"unset"}][this.position[1]])}takeClick(e){if(this.clickAtCenter(e)){this.clicks++,this.clicks>=this.clickThreshold&&(this.order.length?(this.position=this.order.shift(),this.clickThreshold=this.clickThresholdBase,this.placeDot(),this.clicks=0):this.deleteSelf(!0));let e=document.querySelectorAll(".leader-line");e&&e.forEach((e=>e.style.opacity=0))}}deleteSelf(e=!0){this.div.removeEventListener("click",this.handleClick,!1),this.parent.removeChild(this.div),e&&(this.nudge||this.RC.showVideo(this.originalStyles.video),this.nudge||(this.originalStyles.video=!1),this.RC.showGazer(this.originalStyles.gazer),this.originalStyles.gazer=!1,(0,_.nB)(this.endCalibrationCallback),this.nudge||(this.RC._trackingSetupFinishedStatus.gaze=!0))}clickAtCenter(e){const{x:t,y:n}=(0,_.KY)(e),{left:s,top:r,right:a,bottom:i}=this.div.getBoundingClientRect(),o=(s+a)/2,l=(r+i)/2;return t>=o-5&&t<=o+5&&n>=l-5&&n<=l+5}_randomOrder(){this.order=[];for(let e of[0,1,2])for(let t of[0,1,2])this.order.push([e,t]);(0,_.k4)(this.order)}_sequentialOrder(e=!1){this.order=e?[[1,1],[1,3],[4,1],[1,4],[3,1],[1,1],[1,4],[4,1],[1,3],[3,1],[1,1]]:xt.Y?[[0,0],[2,0],[2,2],[0,2],[1,1]]:[[1,1],[1,0],[2,0],[2,1],[2,2],[1,2],[0,2],[0,1],[0,0],[1,1],[1,2],[2,2],[2,1],[2,0],[1,0],[0,0],[0,1],[0,2],[1,1],[1,5],[6,5],[6,1],[6,6],[1,6],[5,6],[5,1],[5,5],[1,1],[1,6],[6,6],[6,1],[6,5],[1,5],[5,5],[5,1],[5,6],[1,1],[1,4],[4,1],[1,3],[3,1],[1,1],[1,3],[4,1],[1,4],[3,1],[1,1]]}getOffsetPx(e,t=null){const n=(s=e,r=this.RC.screenPpi?this.RC.screenPpi.value:this.RC._CONST.N.PPI_DONT_USE,a=this.RC.viewingDistanceCm?this.RC.viewingDistanceCm.value:this.RC._CONST.N.VIEW_DIST_DONT_USE,At(r)*a*Math.tan(s*(Math.PI/180)));var s,r,a;return t?Math.min(n,t):n}}E.A.prototype.trackGaze=async function(e={},t=null,n=null){if(!this.checkInitialized())return;if((0,_.$k)(),e=Object.assign({fullscreen:!1,greedyLearner:!1,framerate:60,showGazer:!0,showVideo:!0,pipWidthPx:this._CONST.N.VIDEO_W[this.isMobile.value?"MOBILE":"DESKTOP"],showFaceOverlay:!1,calibrationCount:1,thresholdDeg:10,decimalPlace:0,headline:"👀 "+U.H.RC_gazeTrackingTitle[this.L],description:U.H.RC_gazeTrackingIntro[this.L]},e),this.getFullscreen(e.fullscreen),this.gazeTracker.checkInitialized("gaze"))return this.gazeTracker._toFixedN=e.decimalPlace,this.showGazer(e.showGazer),this.showVideo(e.showVideo),this.showFaceOverlay(e.showFaceOverlay),this.gazeTracker.attachNewCallback(n),void(this.gazeTracker.defaultGazeCallback=n);this._addBackground(),await de(this),this.gazeTracker._init({greedyLearner:e.greedyLearner,framerate:e.framerate,toFixedN:e.decimalPlace,showVideo:e.showVideo,showFaceOverlay:e.showFaceOverlay,showGazer:e.showGazer},"gaze"),Ct(this,e);const s={pipWidthPx:e.pipWidthPx},r={greedyLearner:e.greedyLearner,calibrationCount:e.calibrationCount,headline:e.headline,description:e.description};this.gazeTracker.begin(s,(()=>{this._trackingSetupFinishedStatus.gaze=!1,this.calibrateGaze(r,a)}));const a=s=>{(0,_.nB)(t,s),this.gazeTracker.webgazer.params.greedyLearner||this.gazeTracker.stopLearning({click:!0,move:!0});return e.thresholdDeg,this.gazeTracker.attachNewCallback(n),void(this.gazeTracker.defaultGazeCallback=n)}},E.A.prototype.getGazeNow=async function(e={},t=null){if(!(this.checkInitialized()&&this.gazeTracker.checkInitialized("gaze",!0)&&this.gazeTracker.webgazer.params.paused&&this._trackingPaused.gaze))return;e=Object.assign({wait:0,frames:5},e);let n=t||this.gazeTracker.defaultGazeCallback;return await this.gazeTracker.getGazeNow(e,n)},E.A.prototype.pauseGaze=function(){!this.gazeTracker.checkInitialized("gaze",!0)&&this._trackingPaused.gaze||(this._trackingPaused.gaze=!0,this.gazeTracker.pause())},E.A.prototype.resumeGaze=function(){(this.gazeTracker.checkInitialized("gaze",!0)||this._trackingPaused.gaze)&&(this._trackingPaused.gaze=!1,this.gazeTracker.resume())},E.A.prototype.endGaze=function(e=!1){this.gazeTracker.checkInitialized("gaze",!0)&&(this._trackingPaused.gaze=!1,this.gazeTracker.end("gaze",e))},E.A.prototype.gazeLearning=function(e=!0,t){t=Object.assign({click:!0,move:!0},t),e?this.gazeTracker.startLearning(t):this.gazeTracker.stopLearning(t)},E.A.prototype.showGazer=function(e=!0){this.gazeTracker.checkInitialized("gaze",!1)&&this.gazeTracker.showGazer(e)},E.A.prototype.showVideo=function(e=!0){this.gazeTracker.checkInitialized("",!1)&&this.gazeTracker.showVideo(e)},E.A.prototype.showFaceOverlay=function(e=!0){this.gazeTracker.checkInitialized("gaze",!1)&&this.gazeTracker.showFaceOverlay(e)};var _t=__webpack_require__(7158),It=__webpack_require__.n(_t);const Tt={gazer:!1,gazeLearning:!1,gazePaused:!1},Nt={current:null};E.A.prototype.nudgeGaze=function(e={},t){if(!this.checkInitialized()||!this.gazeTracker.checkInitialized("gaze",!0))return;if(e=Object.assign({showOffset:!0},e),this._gazeTrackNudging.isCorrectingGaze)return;this._gazeTrackNudging.isCorrectingGaze=!0;let n=document.getElementById("gaze-nudger");n||(n=document.createElement("div"),n.id="gaze-nudger",n.className=`gaze-nudger rc-lang-${this.LD.toLowerCase()}`,document.body.classList.add("lock-view"),document.body.appendChild(n),n.style.background=this.params.backgroundColor);const s=`

          ${U.H.RC_gazeTrackingNudge[this.L]}

          `;n.innerHTML+=s;const r=Ot(this,n,t);if(this._nudger.gazeElement=n,e.showOffset){const e=document.createElement("div");e.id="fake-gaze-dot",e.style.position="absolute",e.style.left=this.gazePositionPx.value.x-5+"px",e.style.top=this.gazePositionPx.value.y-5+"px",e.style.width="10px",e.style.height="10px",e.style.borderRadius="50%",e.style.background="transparent",e.style.zIndex="9999999999",document.body.appendChild(e),Nt.current=new(It())(It().pointAnchor(e,{x:"50%",y:"50%"}),It().pointAnchor(r,{x:"50%",y:"50%"}),{path:"straight",color:this._CONST.COLOR.DARK_RED,startPlug:"disc"});const t=document.querySelector(".leader-line");t.style.zIndex=9999999999,t.style.opacity=.7,t.style.transitionDuration="0.2s"}Tt.gazePaused=this._trackingPaused.gaze,Tt.gazer=this.gazeTracker.webgazer.params.showGazeDot,Tt.gazeLearning=this.gazeTracker._learning,Tt.gazePaused&&this.resumeGaze(),Tt.gazer||this.showGazer(!0),Tt.gazeLearning||this.gazeLearning(!0,{click:!0,move:!1})};const Ot=(e,t,n)=>new Et(e,t,{greedyLearner:!1,calibrationCount:1,nudge:!0},Tt,(()=>{t.remove(),t=null,e._nudgerElement=null,document.body.classList.remove("lock-view"),Tt.gazePaused&&e.pauseGaze(),Tt.gazePaused=!1,Nt.current&&(Nt.current.remove(),Nt.current=null),e._gazeTrackNudging.isCorrectingGaze=!1,(0,_.nB)(n)}));var Rt=__webpack_require__(4948),Dt=__webpack_require__.n(Rt);let Mt=!1;E.A.prototype.getGazeAccuracy=function(e={},t,n){if(!this.checkInitialized())return!1;(0,_.$k)();const s=this.screenPpi,r=this.viewingDistanceCm;if(!s||!r)return!1;e=Object.assign({backgroundColor:"#eee",thresholdDeg:10,decimalPlace:3},e),this._addBackground();const a=document.createElement("div");a.innerHTML='',this.background.appendChild(a);const i=document.querySelector("#gaze-accuracy-canvas"),o=i.getContext("2d"),l=()=>{i.style.width=(i.width=window.innerWidth)+"px",i.style.height=(i.height=window.innerHeight)+"px"},u=new ResizeObserver((()=>{l()}));return u.observe(this.background),l(),Dt().fire({...ae(this,{showIcon:!0}),html:"We will measure your gaze accuracy. Please do not move the mouse and look at the fixation at the middle of the screen for the next 5 seconds."}).then((()=>{Mt=!0,Ft(i,o,e),this.gazeTracker.startStoringPoints(),(0,_.yy)(5e3).then((()=>{Mt=!1,this.gazeTracker.stopStoringPoints();const a=this.gazeTracker.webgazer.getStoredPoints(),l=Bt({x:i.width/2,y:i.height/2},a,s.value,r.value);this.newGazeAccuracyData={value:(0,_.Nh)(l,e.decimalPlace),timestamp:performance.now()},l{const s=()=>{t.fillStyle=n.backgroundColor,t.fillRect(0,0,e.width,e.height),ne(t,e.width/2,e.height/2),Mt&&requestAnimationFrame(s)};requestAnimationFrame(s)},Bt=(e,t,n,s)=>{let r=0;for(let a=0;a0;)n=Math.random()*t|0,t--,Gt(e,t,n)}function Wt(e,t,n){return Math.max(e,Math.min(t,n))}function Ut(e){return e%2==0?e:e+1}function Gt(e,t,n){const s=e[t];e[t]=e[n],e[n]=s}function qt(e,t){if(!e)throw new Error("string"==typeof t?t:t())}function jt(e,t,n=""){qt(Kt(e,t),(()=>n+` Shapes ${e} and ${t} must match`))}function Ht(e){qt(null!=e,(()=>"The input to the tensor constructor must be a non-null value."))}function $t(e){if(0===e.length)return 1;let t=e[0];for(let n=1;n0),n,s){return new Promise(((r,a)=>{let i=0;const o=()=>{if(e())return void r();i++;const l=t(i);null!=n&&i>=n?a():null!=s?s(o,l):setTimeout(o,l)};o()}))}function Jt(e,t){let n=1,s=-1;for(let t=0;t=0)n*=e[t];else if(-1===e[t]){if(-1!==s)throw Error(`Shapes can only have 1 implicit size. Found -1 at dim ${s} and dim ${t}`);s=t}else if(e[t]<0)throw Error(`Shapes can not be < 0. Found ${e[t]} at dim ${t}`);if(-1===s){if(t>0&&t!==n)throw Error(`Size(${t}) must match the product of shape ${e}`);return e}if(0===n)throw Error(`Cannot infer the missing size in [${e}] when there are 0 elements`);if(t%n!=0)throw Error(`The implicit shape can't be a fractional number. Got ${t} / ${n}`);const r=e.slice();return r[s]=t/n,r}function en(e,t){const n=t.length;return qt((e=null==e?t.map(((e,t)=>t)):[].concat(e)).every((e=>e>=-n&&e`All values in axis param must be in range [-${n}, ${n}) but got axis ${e}`)),qt(e.every((e=>Xt(e))),(()=>`All values in axis param must be integers but got axis ${e}`)),e.map((e=>e<0?n+e:e))}function tn(e,t){const n=[],s=[],r=null!=t&&Array.isArray(t)&&0===t.length,a=null==t||r?null:en(t,e).sort();let i=0;for(let t=0;tt)&&1===e[t]&&(n.push(e[t]),s.push(t)),a[i]<=t&&i++}1!==e[t]&&(n.push(e[t]),s.push(t))}return{newShape:n,keptDims:s}}function nn(e,t){return sn(e,t)}function sn(e,t){let n=null;if(null==e||"float32"===e)n=new Float32Array(t);else if("int32"===e)n=new Int32Array(t);else if("bool"===e)n=new Uint8Array(t);else{if("string"!==e)throw new Error(`Unknown data type ${e}`);n=new Array(t)}return n}function rn(e,t){return"complex64"!==t&&(("float32"!==t||"complex64"===e)&&(("int32"!==t||"float32"===e||"complex64"===e)&&("bool"!==t||"bool"!==e)))}function an(e){if("float32"===e||"int32"===e)return 4;if("complex64"===e)return 8;if("bool"===e)return 1;throw new Error(`Unknown dtype ${e}`)}function on(e){return"string"==typeof e||e instanceof String}function ln(e){return"number"==typeof e}function un(e){return Array.isArray(e)?un(e[0]):e instanceof Float32Array?"float32":e instanceof Int32Array||e instanceof Uint8Array||e instanceof Uint8ClampedArray?"int32":ln(e)?"float32":on(e)?"string":"boolean"==typeof e?"bool":"float32"}function cn(e){return!!(e&&e.constructor&&e.call&&e.apply)}function hn(e,t){for(let n=t;n=0;--s)n[s]=n[s+1]*e[s+1];return n}function pn(e,t,n,s=!1){const r=new Array;if(1===t.length){const a=t[0]*(s?2:1);for(let t=0;te*t))*(s?2:1);for(let t=0;te*t))*(n?2:1);if(0===s)return[];if(s!==t.length)throw new Error(`[${e}] does not match the input size ${t.length}${n?" for a complex tensor":""}.`);return pn(0,e,t,n)}function mn(e,t){const n=gn(e,t);for(let e=0;ee*t),1);if(null==t||"float32"===t)return fn(e,new Float32Array(n));if("int32"===t)return fn(e,new Int32Array(n));if("bool"===t)return fn(e,new Uint8Array(n));throw new Error(`Unknown data type ${t}`)}function bn(e){e.forEach((t=>{qt(Number.isInteger(t)&&t>=0,(()=>`Tensor must have a shape comprised of positive integers but got shape [${e}].`))}))}function wn(e,t,n){if(0===t)return 0;if(1===t)return e[0];let s=e[e.length-1];for(let t=0;t{const[t,n]=e.split(":");this.urlFlags[t]=function(e,t){const n=t.toLowerCase();return"true"===n||"false"===n?"true"===n:""+ +n===n?+n:t}(0,n)}))}}}function Cn(e){const t={};return e.replace(/[?&]([^=?&]+)(?:=([^&]*))?/g,((e,...n)=>(function(e,t,n){e[decodeURIComponent(t)]=decodeURIComponent(n||"")}(t,n[0],n[1]),n.join("=")))),t}function Sn(){return _n}let En,_n=null;function In(){if(null==En){let e;if("undefined"!=typeof window)e=window;else if(void 0!==__webpack_require__.g)e=__webpack_require__.g;else if("undefined"!=typeof process)e=process;else{if("undefined"==typeof self)throw new Error("Could not find a global object");e=self}En=e}return En}function Tn(e,t){const n=function(){const e=In();return null==e._tfGlobals&&(e._tfGlobals=new Map),e._tfGlobals}();if(n.has(e))return n.get(e);{const s=t();return n.set(e,s),n.get(e)}}const Nn="Abs",On="Acos",Rn="Acosh",Dn="Add",Mn="AddN",Fn="All",Bn="Any",zn="ArgMax",Ln="ArgMin",Pn="Asin",Vn="Asinh",Wn="Atan",Un="Atanh",Gn="Atan2",qn="AvgPool",jn="AvgPoolGrad",Hn="AvgPool3D",$n="AvgPool3DGrad",Kn="BatchMatMul",Xn="BatchToSpaceND",Zn="Bincount",Yn="BitwiseAnd",Qn="BroadcastArgs",Jn="Cast",es="Ceil",ts="ClipByValue",ns="Complex",ss="ComplexAbs",rs="Concat",as="Conv2D",is="Conv2DBackpropFilter",os="Conv2DBackpropInput",ls="Conv3D",us="Conv3DBackpropFilterV2",cs="Conv3DBackpropInputV2",hs="Cos",ds="Cosh",ps="Cumprod",fs="Cumsum",ms="CropAndResize",gs="DenseBincount",ys="DepthToSpace",bs="DepthwiseConv2dNative",ws="DepthwiseConv2dNativeBackpropFilter",vs="DepthwiseConv2dNativeBackpropInput",xs="Diag",As="Dilation2D",ks="Dilation2DBackpropInput",Cs="Dilation2DBackpropFilter",Ss="Draw",Es="RealDiv",_s="Einsum",Is="Elu",Ts="EluGrad",Ns="Erf",Os="Equal",Rs="Exp",Ds="ExpandDims",Ms="Expm1",Fs="FFT",Bs="Fill",zs="FlipLeftRight",Ls="Floor",Ps="FloorDiv",Vs="FusedBatchNorm",Ws="GatherV2",Us="GatherNd",Gs="Greater",qs="GreaterEqual",js="Identity",Hs="IFFT",$s="Imag",Ks="IsFinite",Xs="IsInf",Zs="IsNan",Ys="LeakyRelu",Qs="Less",Js="LessEqual",er="LinSpace",tr="Log",nr="Log1p",sr="LogicalAnd",rr="LogicalNot",ar="LogicalOr",ir="LRN",or="LRNGrad",lr="Max",ur="Maximum",cr="MaxPool",hr="MaxPoolGrad",dr="MaxPool3D",pr="MaxPool3DGrad",fr="MaxPoolWithArgmax",mr="Mean",gr="Min",yr="Minimum",br="MirrorPad",wr="Mod",vr="Multinomial",xr="Multiply",Ar="Neg",kr="NotEqual",Cr="NonMaxSuppressionV3",Sr="NonMaxSuppressionV4",Er="NonMaxSuppressionV5",_r="OnesLike",Ir="OneHot",Tr="Pack",Nr="PadV2",Or="Pow",Rr="Prelu",Dr="Prod",Mr="RaggedGather",Fr="RaggedRange",Br="RaggedTensorToTensor",zr="Range",Lr="Real",Pr="Reciprocal",Vr="Relu",Wr="Reshape",Ur="ResizeNearestNeighbor",Gr="ResizeNearestNeighborGrad",qr="ResizeBilinear",jr="ResizeBilinearGrad",Hr="Relu6",$r="Reverse",Kr="Round",Xr="Rsqrt",Zr="ScatterNd",Yr="TensorScatterUpdate",Qr="SearchSorted",Jr="Select",ea="Selu",ta="Slice",na="Sin",sa="Sinh",ra="Sign",aa="Sigmoid",ia="Softplus",oa="Sqrt",la="Sum",ua="SpaceToBatchND",ca="SplitV",ha="Softmax",da="SparseFillEmptyRows",pa="SparseReshape",fa="SparseSegmentMean",ma="SparseSegmentSum",ga="SparseToDense",ya="SquaredDifference",ba="Square",wa="StaticRegexReplace",va="StridedSlice",xa="StringNGrams",Aa="StringSplit",ka="StringToHashBucketFast",Ca="Sub",Sa="Tan",Ea="Tanh",_a="Tile",Ia="TopK",Ta="Transform",Na="Transpose",Oa="Unique",Ra="Unpack",Da="UnsortedSegmentSum",Ma="ZerosLike",Fa="Step",Ba="FromPixels",za="RotateWithOffset",La="_FusedMatMul",Pa="FusedConv2D",Va="FusedDepthwiseConv2D";function Wa(...e){!Sn().getBool("IS_TEST")&&Sn().getBool("PROD")}function Ua(...e){!Sn().getBool("IS_TEST")&&Sn().getBool("PROD")}const Ga=Tn("kernelRegistry",(()=>new Map)),qa=Tn("gradRegistry",(()=>new Map));function ja(e,t){const n=Za(e,t);return Ga.get(n)}function Ha(e){return qa.get(e)}function $a(e){const t=Ga.entries(),n=[];for(;;){const{done:s,value:r}=t.next();if(s)break;const[a,i]=r,[o]=a.split("_");o===e&&n.push(i)}return n}function Ka(e){const{kernelName:t,backendName:n}=e,s=Za(t,n);Ga.has(s)&&Wa(),Ga.set(s,e)}function Xa(e){const{kernelName:t}=e;qa.has(t)&&Sn().getBool("DEBUG")&&Wa(),qa.set(t,e)}function Za(e,t){return`${t}_${e}`}function Ya(e){return e instanceof Float32Array||e instanceof Int32Array||e instanceof Uint8Array||e instanceof Uint8ClampedArray}var Qa=__webpack_require__(3122);const Ja=__webpack_require__.n(Qa)()||Qa;function ei(e){return Ja.fromString(e,!0,16)}const ti=ei("c3a5c85c97cb3127"),ni=ei("b492b66fbe98f273"),si=ei("9ae16a3b2f90404f");function ri(e){return e.xor(e.shru(47))}function ai(e,t,n){const s=e.slice(t,t+n);return Ja.fromBytes(Array.from(s),!0,!0)}function ii(e,t){return ai(e,t,8)}function oi(e,t){return ai(e,t,4)}function li(e,t){return 0===t?e:e.shru(t).or(e.shl(64-t))}function ui(e,t,n=ei("9ddfea08eb382d69")){let s=e.xor(t).mul(n);s=s.xor(s.shru(47));let r=t.xor(s).mul(n);return r=r.xor(r.shru(47)),r=r.mul(n),r}function ci(e,t,n,s){return function(e,t,n,s,r,a){r=r.add(e),a=li(a.add(r).add(s),21);const i=r;return r=(r=r.add(t)).add(n),a=a.add(li(r,44)),[r.add(s),a.add(i)]}(ii(e,t),ii(e,t+8),ii(e,t+16),ii(e,t+24),n,s)}function hi(e,t=e.length){const n=Ja.fromNumber(81,!0);if(t<=32)return t<=16?function(e,t=e.length){if(t>=8){const n=si.add(2*t),s=ii(e,0).add(si),r=ii(e,t-8);return ui(li(r,37).mul(n).add(s),li(s,25).add(r).mul(n),n)}if(t>=4){const n=si.add(2*t);return ui(oi(e,0).shl(3).add(t),oi(e,t-4),n)}if(t>0){const n=e[0]+(e[t>>1]<<8),s=t+(e[t-1]<<2);return ri(si.mul(n).xor(ti.mul(s))).mul(si)}return si}(e,t):function(e,t=e.length){const n=si.add(2*t),s=ii(e,0).mul(ni),r=ii(e,8),a=ii(e,t-8).mul(n),i=ii(e,t-16).mul(si);return ui(li(s.add(r),43).add(li(a,30)).add(i),s.add(li(r.add(si),18)).add(a),n)}(e,t);if(t<=64)return function(e,t=e.length){const n=si.add(2*t),s=ii(e,0).mul(si),r=ii(e,8),a=ii(e,t-8).mul(n),i=ii(e,t-16).mul(si),o=li(s.add(r),43).add(li(a,30)).add(i),l=ui(o,s.add(li(r.add(si),18)).add(a),n),u=ii(e,16).mul(n),c=ii(e,24),h=o.add(ii(e,t-32)).mul(n),d=l.add(ii(e,t-24)).mul(n);return ui(li(u.add(c),43).add(li(h,30)).add(d),u.add(li(c.add(s),18)).add(h),n)}(e,t);let s=n,r=n.mul(ni).add(113),a=ri(r.mul(si).add(113)).mul(si),i=[Ja.UZERO,Ja.UZERO],o=[Ja.UZERO,Ja.UZERO];s=s.mul(si).add(ii(e,0));let l=0;const u=64*(t-1>>6),c=u+(t-1&63)-63;do{s=li(s.add(r).add(i[0]).add(ii(e,l+8)),37).mul(ni),r=li(r.add(i[1]).add(ii(e,l+48)),42).mul(ni),s=s.xor(o[1]),r=r.add(i[0]).add(ii(e,l+40)),a=li(a.add(o[0]),33).mul(ni),i=ci(e,l,i[1].mul(ni),s.add(o[0])),o=ci(e,l+32,a.add(o[1]),r.add(ii(e,l+16))),[a,s]=[s,a],l+=64}while(l!==u);const h=ni.add(a.and(255).shl(1));return l=c,o[0]=o[0].add(t-1&63),i[0]=i[0].add(o[0]),o[0]=o[0].add(i[0]),s=li(s.add(r).add(i[0]).add(ii(e,l+8)),37).mul(h),r=li(r.add(i[1]).add(ii(e,l+48)),42).mul(h),s=s.xor(o[1].mul(9)),r=r.add(i[0].mul(9).add(ii(e,l+40))),a=li(a.add(o[0]),33).mul(h),i=ci(e,l,i[1].mul(h),s.add(o[0])),o=ci(e,l+32,a.add(o[1]),r.add(ii(e,l+16))),[a,s]=[s,a],ui(ui(i[0],o[0],h).add(ri(r).mul(ti)).add(a),ui(i[1],o[1],h).add(s),h)}function di(e,t){return"string"===t?mi(e):pi([e],t)}function pi(e,t){if("string"===t)throw new Error("Cannot convert a string[] to a TypedArray");if(Array.isArray(e)&&(e=bi(e)),Sn().getBool("DEBUG")&&function(e,t){for(let n=0;n{s=n()};let a;const i=fi();if(this.backendTimer.timerAvailable())a=this.backendTimer.time(r);else{r();for(const e of s)e.dataSync();a=Promise.resolve({kernelMs:fi()-i})}if(Sn().getBool("CHECK_COMPUTATION_FOR_ERRORS"))for(let t=0;t{vi(t,n.dtype,e)}))}return{kernelName:e,outputs:s,inputs:t,timeMs:a.then((e=>e.kernelMs)),extraInfo:a.then((e=>null!=e.getExtraProfileInfo?e.getExtraProfileInfo():""))}}logKernelProfile(e){const{kernelName:t,outputs:n,timeMs:s,inputs:r,extraInfo:a}=e;n.forEach((e=>{Promise.all([e.data(),s,a]).then((n=>{this.logger.logKernelProfile(t,e,n[0],n[1],r,n[2])}))}))}}function vi(e,t,n){if("float32"!==t)return!1;for(let t=0;t0?s:""} `}}}}const Ai=20,ki=3,Ci=7;function Si(e,t,n,s){const r=dn(t),a=function(e,t,n,s){const r=$t(t),a=s[s.length-1],i=new Array(a).fill(0),o=t.length,l="complex64"===n?Ti(e):e;if(o>1)for(let e=0;e" "+e)).join("\n")),l.join("\n")}function Ei(e,t,n){let s;return s=Array.isArray(e)?`${parseFloat(e[0].toFixed(Ci))} + ${parseFloat(e[1].toFixed(Ci))}j`:on(e)?`'${e}'`:"bool"===n?_i(e):parseFloat(e.toFixed(Ci)).toString(),Yt(s,t)}function _i(e){return 0===e?"false":"true"}function Ii(e,t,n,s,r,a=!0){const i="complex64"===n?2:1,o=t[0],l=t.length;if(0===l){if("complex64"===n){return[Ei(Ti(e)[0],0,n)]}return"bool"===n?[_i(e[0])]:[e[0].toString()]}if(1===l){if(o>Ai){const t=ki*i;let s=Array.from(e.slice(0,t)),a=Array.from(e.slice((o-ki)*i,o*i));return"complex64"===n&&(s=Ti(s),a=Ti(a)),["["+s.map(((e,t)=>Ei(e,r[t],n))).join(", ")+", ..., "+a.map(((e,t)=>Ei(e,r[o-ki+t],n))).join(", ")+"]"]}return["["+("complex64"===n?Ti(e):Array.from(e)).map(((e,t)=>Ei(e,r[t],n))).join(", ")+"]"]}const u=t.slice(1),c=s.slice(1),h=s[0]*i,d=[];if(o>Ai){for(let t=0;t0?d[0]+p:"");for(let e=1;e`Length of values '${e}' does not match the size inferred by the shape '${this.size}'.`))}if("complex64"===t)throw new Error("complex64 dtype TensorBuffers are not supported. Please create a TensorBuffer for the real and imaginary parts separately and call tf.complex(real, imag).");this.values=n||sn(t,this.size),this.strides=dn(e)}set(e,...t){0===t.length&&(t=[0]),qt(t.length===this.rank,(()=>`The number of provided coordinates (${t.length}) must match the rank (${this.rank})`));const n=this.locToIndex(t);this.values[n]=e}get(...e){0===e.length&&(e=[0]);let t=0;for(const n of e){if(n<0||n>=this.shape[t]){const t=`Requested out of range element at ${e}. Buffer shape=${this.shape}`;throw new Error(t)}t++}let n=e[e.length-1];for(let t=0;tgi(e)))}catch(e){throw new Error("Failed to decode the string bytes into utf-8. To get the original bytes, call tensor.bytes().")}}return e}dataToGPU(e){return this.throwIfDisposed(),Oi().readToGPU(this.dataId,e)}dataSync(){this.throwIfDisposed();const e=Oi().readSync(this.dataId);if("string"===this.dtype)try{return e.map((e=>gi(e)))}catch(e){throw new Error("Failed to decode the string bytes into utf-8. To get the original bytes, call tensor.bytes().")}return e}async bytes(){this.throwIfDisposed();const e=await Oi().read(this.dataId);return"string"===this.dtype?e:new Uint8Array(e.buffer)}dispose(){this.isDisposed||(this.kerasMask&&this.kerasMask.dispose(),Oi().disposeTensor(this),this.isDisposedInternal=!0)}get isDisposed(){return this.isDisposedInternal}throwIfDisposed(){if(this.isDisposed)throw new Error("Tensor is disposed.")}print(e=!1){return Ri.print(this,e)}clone(){return this.throwIfDisposed(),Ri.clone(this)}toString(e=!1){return Si(this.dataSync(),this.shape,this.dtype,e)}cast(e){return this.throwIfDisposed(),Ri.cast(this,e)}variable(e=!0,t,n){return this.throwIfDisposed(),Oi().makeVariable(this,e,t,n)}}function Fi(){return Tn("Tensor",(()=>Mi))}Object.defineProperty(Mi,Symbol.hasInstance,{value:e=>!!e&&null!=e.data&&null!=e.dataSync&&null!=e.throwIfDisposed}),Fi();class Bi extends Mi{constructor(e,t,n,s){super(e.shape,e.dtype,e.dataId,s),this.trainable=t,this.name=n}assign(e){if(e.dtype!==this.dtype)throw new Error(`dtype of the new value (${e.dtype}) and previous value (${this.dtype}) must match`);if(!Kt(e.shape,this.shape))throw new Error(`shape of the new value (${e.shape}) and previous value (${this.shape}) must match`);Oi().disposeTensor(this),this.dataId=e.dataId,Oi().incRef(this,null)}dispose(){Oi().disposeVariable(this),this.isDisposedInternal=!0}}var zi,Li,Pi,Vi,Wi;Object.defineProperty(Bi,Symbol.hasInstance,{value:e=>e instanceof Mi&&null!=e.assign&&e.assign instanceof Function}),function(e){e.R0="R0",e.R1="R1",e.R2="R2",e.R3="R3",e.R4="R4",e.R5="R5",e.R6="R6"}(zi||(zi={})),function(e){e.float32="float32",e.int32="int32",e.bool="int32",e.complex64="complex64"}(Li||(Li={})),function(e){e.float32="float32",e.int32="int32",e.bool="bool",e.complex64="complex64"}(Pi||(Pi={})),function(e){e.float32="float32",e.int32="float32",e.bool="float32",e.complex64="complex64"}(Vi||(Vi={})),function(e){e.float32="complex64",e.int32="complex64",e.bool="complex64",e.complex64="complex64"}(Wi||(Wi={}));const Ui={float32:Vi,int32:Li,bool:Pi,complex64:Wi};function Gi(e,t){if("string"===e||"string"===t){if("string"===e&&"string"===t)return"string";throw new Error(`Can not upcast ${e} with ${t}`)}return Ui[e][t]}function qi(e){return Gi(e,"int32")}function ji(e){return null!=e&&"object"==typeof e&&"texture"in e&&e.texture instanceof WebGLTexture}function Hi(e){return"undefined"!=typeof GPUBuffer&&null!=e&&"object"==typeof e&&"buffer"in e&&e.buffer instanceof GPUBuffer}function $i(e,t){if(e.dtype===t.dtype)return[e,t];const n=Gi(e.dtype,t.dtype);return[e.cast(n),t.cast(n)]}function Ki(e,t){return t.some((t=>t.id===e.id))}function Xi(e){const t=[];return Zi(e,t,new Set),t}function Zi(e,t,n){if(null==e)return;if(e instanceof Mi)return void t.push(e);if(s=e,!Array.isArray(s)&&"object"!=typeof s)return;var s;const r=e;for(const e in r){const s=r[e];n.has(s)||(n.add(s),Zi(s,t,n))}}function Yi(e){return null!=e.kernelName}class Qi{constructor(){this.registeredVariables={},this.nextTapeNodeId=0,this.numBytes=0,this.numTensors=0,this.numStringTensors=0,this.numDataBuffers=0,this.gradientDepth=0,this.kernelDepth=0,this.scopeStack=[],this.numDataMovesStack=[],this.nextScopeId=0,this.tensorInfo=new WeakMap,this.profiling=!1,this.activeProfile={newBytes:0,newTensors:0,peakBytes:0,kernels:[],result:null,get kernelNames(){return Array.from(new Set(this.kernels.map((e=>e.name))))}}}dispose(){for(const e in this.registeredVariables)this.registeredVariables[e].dispose()}}class Ji{constructor(e){this.ENV=e,this.registry={},this.registryFactory={},this.pendingBackendInitId=0,this.state=new Qi}async ready(){if(null!=this.pendingBackendInit)return this.pendingBackendInit.then((()=>{}));if(null!=this.backendInstance)return;const e=this.getSortedBackends();for(let t=0;t{null!=e.setupFunc&&e.setupFunc(this.backendInstance)}))}disposeRegisteredKernels(e){$a(e).forEach((t=>{null!=t.disposeFunc&&t.disposeFunc(this.registry[e])}))}initializeBackend(e){const t=this.registryFactory[e];if(null==t)throw new Error(`Cannot initialize backend ${e}, no registration found.`);try{const n=t.factory();if(!n||n instanceof Lt||"function"!=typeof n.then)return this.registry[e]=n,{success:!0,asyncInit:!1};{const t=++this.pendingBackendInitId,s=n.then((n=>!(t(tthis.registryFactory[t].priority-this.registryFactory[e].priority))}initializeBackendsAndReturnBest(){const e=this.getSortedBackends();for(let t=0;tthis.startScope(s)),(()=>this.endScope(n)),(()=>(n=t(),n)))}scopedRun(e,t,n){e();try{const e=n();return t(),e}catch(e){throw t(),e}}nextTensorId(){return Ji.nextTensorId++}nextVariableId(){return Ji.nextVariableId++}clone(e){const t=to.runKernel(js,{x:e}),n={x:e};return this.addTapeNode(this.state.activeScope.name,n,[t],(e=>({x:()=>{const t={x:e},n={dtype:"float32"};return to.runKernel(Jn,t,n)}})),[],{}),t}runKernel(e,t,n){null==this.backendName&&this.backend;if(!(null!=ja(e,this.backendName)))throw new Error(`Kernel '${e}' not registered for backend '${this.backendName}'`);return this.runKernelFunc({kernelName:e,inputs:t,attrs:n})}shouldCheckForMemLeaks(){return this.ENV.getBool("IS_TEST")}checkKernelForMemLeak(e,t,n){const s=this.backend.numDataIds();let r=0;n.forEach((e=>{r+="complex64"===e.dtype?3:1}));const a=this.state.numDataMovesStack[this.state.numDataMovesStack.length-1],i=s-t-r-a;if(i>0)throw new Error(`Backend '${this.backendName}' has an internal memory leak (${i} data ids) after running '${e}'`)}runKernelFunc(e){let t,n=[];const s=this.isTapeOn(),r=this.state.numBytes,a=this.state.numTensors;let i,o;this.shouldCheckForMemLeaks()&&this.state.numDataMovesStack.push(0),null==this.backendName&&this.backend;const l=Yi(e)?e.kernelName:null!=this.state.activeScope?this.state.activeScope.name:"";if(Yi(e)){const{kernelName:t,inputs:r,attrs:a}=e;null==this.backendName&&this.backend;const l=ja(t,this.backendName);qt(null!=l,(()=>`Cannot find registered kernel '${t}' for backend '${this.backendName}'`)),i=()=>{const e=this.backend.numDataIds();o=l.kernelFunc({inputs:r,attrs:a,backend:this.backend});const i=Array.isArray(o)?o:[o];this.shouldCheckForMemLeaks()&&this.checkKernelForMemLeak(t,e,i);const u=i.map((e=>null!=e.rank?e:this.makeTensorFromTensorInfo(e)));if(s){const e=this.getTensorsForGradient(t,r,u);n=this.saveTensorsForBackwardMode(e)}return u}}else{const{forwardFunc:t}=e,r=e=>{s&&(n=e.map((e=>this.keep(this.clone(e)))))};i=()=>{const e=this.backend.numDataIds();o=this.tidy((()=>t(this.backend,r)));const n=Array.isArray(o)?o:[o];return this.shouldCheckForMemLeaks()&&this.checkKernelForMemLeak(l,e,n),n}}const{inputs:u,attrs:c}=e,h=Yi(e)?null:e.backwardsFunc;let d;return this.scopedRun((()=>this.state.kernelDepth++),(()=>this.state.kernelDepth--),(()=>{this.ENV.getBool("DEBUG")||this.state.profiling?(d=this.profiler.profileKernel(l,u,(()=>i())),this.ENV.getBool("DEBUG")&&this.profiler.logKernelProfile(d),t=d.outputs):t=i()})),s&&this.addTapeNode(l,u,t,h,n,c),this.state.profiling&&this.state.activeProfile.kernels.push({name:l,bytesAdded:this.state.numBytes-r,totalBytesSnapshot:this.state.numBytes,tensorsAdded:this.state.numTensors-a,totalTensorsSnapshot:this.state.numTensors,inputShapes:Object.keys(u).map((e=>null!=u[e]?u[e].shape:null)),outputShapes:t.map((e=>e.shape)),kernelTimeMs:d.timeMs,extraInfo:d.extraInfo}),Array.isArray(o)?t:t[0]}saveTensorsForBackwardMode(e){const t=e.map((e=>this.keep(this.clone(e))));return t}getTensorsForGradient(e,t,n){const s=Ha(e);if(null!=s){const e=s.inputsToSave||[],r=s.outputsToSave||[];let a;s.saveAllInputs?(qt(Array.isArray(t),(()=>"saveAllInputs is true, expected inputs to be an array.")),a=Object.keys(t).map((e=>t[e]))):a=e.map((e=>t[e]));const i=n.filter(((e,t)=>r[t]));return a.concat(i)}return[]}makeTensor(e,t,n,s){if(null==e)throw new Error("Values passed to engine.makeTensor() are null");n=n||"float32",s=s||this.backend;let r=e;"string"===n&&on(e[0])&&(r=e.map((e=>mi(e))));const a=s.write(r,t,n),i=new Mi(t,n,a,this.nextTensorId());if(this.trackTensor(i,s),"string"===n){const e=this.state.tensorInfo.get(a),t=function(e){if(null==e)return 0;let t=0;return e.forEach((e=>t+=e.length)),t}(r);this.state.numBytes+=t-e.bytes,e.bytes=t}return i}makeTensorFromDataId(e,t,n,s){const r={dataId:e,shape:t,dtype:n=n||"float32"};return this.makeTensorFromTensorInfo(r,s)}makeTensorFromTensorInfo(e,t){const{dataId:n,shape:s,dtype:r}=e,a=new Mi(s,r,n,this.nextTensorId());return this.trackTensor(a,t),a}makeVariable(e,t=!0,n,s){n=n||this.nextVariableId().toString(),null!=s&&s!==e.dtype&&(e=e.cast(s));const r=new Bi(e,t,n,this.nextTensorId());if(null!=this.state.registeredVariables[r.name])throw new Error(`Variable with name ${r.name} was already registered`);return this.state.registeredVariables[r.name]=r,this.incRef(r,this.backend),r}trackTensor(e,t){this.state.numTensors++,"string"===e.dtype&&this.state.numStringTensors++;let n=0;"complex64"!==e.dtype&&"string"!==e.dtype&&(n=e.size*an(e.dtype)),this.state.numBytes+=n,this.state.tensorInfo.has(e.dataId)||(this.state.numDataBuffers++,this.state.tensorInfo.set(e.dataId,{backend:t||this.backend,dtype:e.dtype,shape:e.shape,bytes:n})),e instanceof Bi||this.track(e)}incRef(e,t){this.trackTensor(e,t),this.backend.incRef(e.dataId)}removeDataId(e,t){this.state.tensorInfo.has(e)&&this.state.tensorInfo.get(e).backend===t&&(this.state.tensorInfo.delete(e),this.state.numDataBuffers--)}disposeTensor(e){if(!this.state.tensorInfo.has(e.dataId))return;const t=this.state.tensorInfo.get(e.dataId);if(this.state.numTensors--,"string"===e.dtype&&(this.state.numStringTensors--,this.state.numBytes-=t.bytes),"complex64"!==e.dtype&&"string"!==e.dtype){const t=e.size*an(e.dtype);this.state.numBytes-=t}t.backend.disposeData(e.dataId)&&this.removeDataId(e.dataId,t.backend)}disposeVariables(){for(const e in this.state.registeredVariables){const t=this.state.registeredVariables[e];this.disposeVariable(t)}}disposeVariable(e){this.disposeTensor(e),null!=this.state.registeredVariables[e.name]&&delete this.state.registeredVariables[e.name]}memory(){const e=this.backend.memory();return e.numTensors=this.state.numTensors,e.numDataBuffers=this.state.numDataBuffers,e.numBytes=this.state.numBytes,this.state.numStringTensors>0&&(e.unreliable=!0,null==e.reasons&&(e.reasons=[]),e.reasons.push("Memory usage by string tensors is approximate (2 bytes per character)")),e}async profile(e){this.state.profiling=!0;const t=this.state.numBytes,n=this.state.numTensors;this.state.activeProfile.kernels=[],this.state.activeProfile.result=await e(),this.state.profiling=!1,this.state.activeProfile.peakBytes=Math.max(...this.state.activeProfile.kernels.map((e=>e.totalBytesSnapshot))),this.state.activeProfile.newBytes=this.state.numBytes-t,this.state.activeProfile.newTensors=this.state.numTensors-n;for(const e of this.state.activeProfile.kernels)e.kernelTimeMs=await e.kernelTimeMs,e.extraInfo=await e.extraInfo;return this.state.activeProfile}isTapeOn(){return this.state.gradientDepth>0&&0===this.state.kernelDepth}addTapeNode(e,t,n,s,r,a){const i={id:this.state.nextTapeNodeId++,kernelName:e,inputs:t,outputs:n,saved:r},o=Ha(e);null!=o&&(s=o.gradFunc),null!=s&&(i.gradient=e=>(e=e.map(((e,t)=>{if(null==e){const e=n[t],s=gn(e.size,e.dtype);return this.makeTensor(s,e.shape,e.dtype)}return e})),s(e.length>1?e:e[0],r,a))),this.state.activeTape.push(i)}keep(e){return e.kept=!0,e}startTape(){0===this.state.gradientDepth&&(this.state.activeTape=[]),this.state.gradientDepth++}endTape(){this.state.gradientDepth--}startScope(e){const t={track:[],name:"unnamed scope",id:this.state.nextScopeId++};e&&(t.name=e),this.state.scopeStack.push(t),this.state.activeScope=t}endScope(e){const t=Xi(e),n=new Set(t.map((e=>e.id)));for(let e=0;e{e.kept||e.scopeId!==s.id||this.track(e)}))}gradients(e,t,n,s=!1){if(qt(t.length>0,(()=>"gradients() received an empty list of xs.")),null!=n&&"float32"!==n.dtype)throw new Error(`dy must have 'float32' dtype, but has '${n.dtype}'`);const r=this.scopedRun((()=>this.startTape()),(()=>this.endTape()),(()=>this.tidy("forward",e)));qt(r instanceof Mi,(()=>"The result y returned by f() must be a tensor."));const a=function(e,t,n){const s={},r={};for(let e=0;es[e.id]=!0)),o=!0,r[a.id]=!0;break}if(o)break}}const a={};a[n.id]=!0;const i={};for(let t=e.length-1;t>=0;t--){const n=e[t],s=n.inputs;for(let e=0;e0)throw new Error("Cannot compute gradient of y=f(x) with respect to x. Make sure that the f you passed encloses all operations that lead from x to y.");return this.tidy("backward",(()=>{const e={};e[r.id]=null==n?function(e){const t=mn($t(e),"float32");return to.makeTensor(t,e,"float32")}(r.shape):n,function(e,t,n,s){for(let r=t.length-1;r>=0;r--){const a=t[r],i=[];if(a.outputs.forEach((t=>{const n=e[t.id];null!=n?i.push(n):i.push(null)})),null==a.gradient)throw new Error(`Cannot compute gradient: gradient function not found for ${a.kernelName}.`);const o=a.gradient(i);for(const t in a.inputs){if(!(t in o))throw new Error(`Cannot backprop through input ${t}. Available gradients found: ${Object.keys(o)}.`);const r=n((()=>o[t]()));if("float32"!==r.dtype)throw new Error(`Error in gradient for op ${a.kernelName}. The gradient of input ${t} must have 'float32' dtype, but has '${r.dtype}'`);const i=a.inputs[t];if(!Kt(r.shape,i.shape))throw new Error(`Error in gradient for op ${a.kernelName}. The gradient of input '${t}' has shape '${r.shape}', which does not match the shape of the input '${i.shape}'`);if(null==e[i.id])e[i.id]=r;else{const t=e[i.id];e[i.id]=s(t,r),t.dispose()}}}}(e,a,(e=>this.tidy(e)),no);const s=t.map((t=>e[t.id]));return 0===this.state.gradientDepth&&(this.state.activeTape.forEach((e=>{for(const t of e.saved)t.dispose()})),this.state.activeTape=null),{value:r,grads:s}}))}customGrad(e){return qt(cn(e),(()=>"The f passed in customGrad(f) must be a function.")),(...t)=>{let n;qt(t.every((e=>e instanceof Mi)),(()=>"The args passed in customGrad(f)(x1, x2,...) must all be tensors"));const s={};t.forEach(((e,t)=>{s[t]=e}));return this.runKernelFunc({forwardFunc:(s,r)=>(n=e(...t,r),qt(n.value instanceof Mi,(()=>"The function f passed in customGrad(f) must return an object where `obj.value` is a tensor")),qt(cn(n.gradFunc),(()=>"The function f passed in customGrad(f) must return an object where `obj.gradFunc` is a function.")),n.value),backwardsFunc:(e,s)=>{const r=n.gradFunc(e,s),a=Array.isArray(r)?r:[r];qt(a.length===t.length,(()=>"The function f passed in customGrad(f) must return an object where `obj.gradFunc` is a function that returns the same number of tensors as inputs passed to f(...).")),qt(a.every((e=>e instanceof Mi)),(()=>"The function f passed in customGrad(f) must return an object where `obj.gradFunc` is a function that returns a list of only tensors."));const i={};return a.forEach(((e,t)=>{i[t]=()=>e})),i},inputs:s})}}readSync(e){return this.state.tensorInfo.get(e).backend.readSync(e)}read(e){return this.state.tensorInfo.get(e).backend.read(e)}readToGPU(e,t){return this.state.tensorInfo.get(e).backend.readToGPU(e,t)}async time(e){const t=fi(),n=await this.backend.time(e);return n.wallMs=fi()-t,n}track(e){return null!=this.state.activeScope&&(e.scopeId=this.state.activeScope.id,this.state.activeScope.track.push(e)),e}get registeredVariables(){return this.state.registeredVariables}reset(){this.pendingBackendInitId++,this.state.dispose(),this.ENV.reset(),this.state=new Qi;for(const e in this.registry)this.disposeRegisteredKernels(e),this.registry[e].dispose(),delete this.registry[e];this.backendName=null,this.backendInstance=null,this.pendingBackendInit=null}}function eo(){const e=In();if(null==e._tfengine){const t=new kn(e);e._tfengine=new Ji(t)}var t;return t=e._tfengine.ENV,_n=t,Oi=()=>e._tfengine,e._tfengine}Ji.nextTensorId=0,Ji.nextVariableId=0;const to=eo();function no(e,t){const n={a:e,b:t};return to.runKernel(Dn,n)}let so;function ro(e){if(void 0!==so)return so;if(e||"undefined"!=typeof navigator&&null!=navigator){if(e||(e=navigator),"ReactNative"===e.product)return!0;const t=e.userAgent||e.vendor||("undefined"!=typeof window?window.opera:"");if(!t){const t=e;return t.userAgentData&&t.userAgentData.mobile}return/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino/i.test(t)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i.test(t.substr(0,4))}return!1}function ao(){return"undefined"!=typeof window&&null!=window.document||"undefined"!=typeof WorkerGlobalScope}const io=Sn();function oo(e,t){let n=e;if(yi(e))return"string"===t?[]:[e.length];if(ji(e)){const t=e.channels||"RGBA";return[e.height,e.width*t.length]}if(Hi(e))return[e.buffer.size/(null==t?4:an(t))];if(!Array.isArray(e))return[];const s=[];for(;Array.isArray(n)||yi(n)&&"string"!==t;)s.push(n.length),n=n[0];return Array.isArray(e)&&Sn().getBool("TENSORLIKE_CHECK_SHAPE_CONSISTENCY")&&lo(e,s,[]),s}function lo(e,t,n){if(n=n||[],!Array.isArray(e)&&!yi(e))return void qt(0===t.length,(()=>`Element arr[${n.join("][")}] is a primitive, but should be an array/TypedArray of ${t[0]} elements`));qt(t.length>0,(()=>`Element arr[${n.join("][")}] should be a primitive, but is an array of ${e.length} elements`)),qt(e.length===t[0],(()=>`Element arr[${n.join("][")}] should have ${t[0]} elements, but has ${e.length} elements`));const s=t.slice(1);for(let t=0;t=0&&(r=s),uo(s,r,t,n),null==e||!yi(e)&&!Array.isArray(e)&&"number"!=typeof e&&"boolean"!=typeof e&&"string"!=typeof e){const s=null==e?"null":e.constructor.name;throw new Error(`Argument '${t}' passed to '${n}' must be a Tensor or TensorLike, but got '${s}'`)}const a=oo(e,r);yi(e)||Array.isArray(e)||(e=[e]);const i="string"!==r?pi(e,r):bi(e,[],!0);return to.makeTensor(i,a,r)}function ho(e,t,n,s="numeric"){if(!Array.isArray(e))throw new Error(`Argument ${t} passed to ${n} must be a \`Tensor[]\` or \`TensorLike[]\``);return e.map(((e,r)=>co(e,`${t}[${r}]`,n,s)))}io.registerFlag("DEBUG",(()=>!1),(e=>{})),io.registerFlag("IS_BROWSER",(()=>ao())),io.registerFlag("IS_NODE",(()=>"undefined"!=typeof process&&void 0!==process.versions&&void 0!==process.versions.node)),io.registerFlag("IS_CHROME",(()=>"undefined"!=typeof navigator&&null!=navigator&&null!=navigator.userAgent&&/Chrome/.test(navigator.userAgent)&&/Google Inc/.test(navigator.vendor))),io.registerFlag("IS_SAFARI",(()=>"undefined"!=typeof navigator&&null!=navigator&&null!=navigator.userAgent&&/Safari/.test(navigator.userAgent)&&/Apple/.test(navigator.vendor))),io.registerFlag("PROD",(()=>!1)),io.registerFlag("TENSORLIKE_CHECK_SHAPE_CONSISTENCY",(()=>io.getBool("DEBUG"))),io.registerFlag("DEPRECATION_WARNINGS_ENABLED",(()=>!0)),io.registerFlag("IS_TEST",(()=>!1)),io.registerFlag("CHECK_COMPUTATION_FOR_ERRORS",(()=>io.getBool("DEBUG"))),io.registerFlag("WRAP_TO_IMAGEBITMAP",(()=>!1)),io.registerFlag("CANVAS2D_WILL_READ_FREQUENTLY_FOR_GPU",(()=>!1)),io.registerFlag("USE_SETTIMEOUTCUSTOM",(()=>!1));const po="__op";function fo(e){const t=Object.keys(e);if(1!==t.length)throw new Error(`Please provide an object with a single key (operation name) mapping to a function. Got an object with ${t.length} keys.`);let n=t[0];const s=e[n];n.endsWith("_")&&(n=n.substring(0,n.length-1)),n+=po;const r=(...e)=>{to.startScope(n);try{const t=s(...e);return xn(t),to.endScope(t),t}catch(e){throw to.endScope(null),e}};return Object.defineProperty(r,"name",{value:n,configurable:!0}),r}const mo=fo({complex_:function(e,t){const n=co(e,"real","complex"),s=co(t,"imag","complex");jt(n.shape,s.shape,`real and imag shapes, ${n.shape} and ${s.shape}, must match in call to tf.complex().`);const r={real:n,imag:s};return to.runKernel(ns,r)}});function go(e,t,n,s){if(null==s)s=un(e);else if("complex64"===s)throw new Error("Cannot construct a complex64 tensor directly. Please use tf.complex(real, imag).");if(Hi(e)||ji(e)){if("float32"!==s&&"int32"!==s)throw new Error(`Creating tensor from GPU data only supports 'float32'|'int32' dtype, while the dtype is ${s}.`);return to.backend.createTensorFromGPUData(e,t||n,s)}if(!yi(e)&&!Array.isArray(e)&&"number"!=typeof e&&"boolean"!=typeof e&&"string"!=typeof e)throw new Error("values passed to tensor(values) must be a number/boolean/string or an array of numbers/booleans/strings, or a TypedArray");if(null!=t){bn(t);const e=$t(t),s=$t(n);qt(e===s,(()=>`Based on the provided shape, [${t}], the tensor should have ${e} values but has ${s}`));for(let e=0;e`Error creating a new Tensor. Inferred shape (${n}) does not match the provided shape (${t}). `))}}return yi(e)||Array.isArray(e)||(e=[e]),t=t||n,e="string"!==s?pi(e,s):bi(e,[],!0),to.makeTensor(e,t,s)}function yo(e,t,n){return go(e,t,oo(e,n),n)}const bo={float32:4,float16:2,int32:4,uint16:2,uint8:1,bool:1,complex64:8};class wo{static join(e){return new wo(e).slice()}constructor(e){if(this.shards=[],this.previousShardIndex=0,null==e)return;if(e instanceof Array||(e=[e]),0===(e=e.map((e=>yi(e)?e.buffer:e))).length)return;this.bufferUniformSize=e[0].byteLength;let t=0;for(let n=0;n=this.byteLength)return-1;if(null!=this.bufferUniformSize)return this.previousShardIndex=Math.floor(e/this.bufferUniformSize),this.previousShardIndex;function t(t){return e=t.end?1:0}if(0===t(this.shards[this.previousShardIndex]))return this.previousShardIndex;const n=function(e,t){let n=0,s=e.length;for(;n<=s;){const r=Math.floor((s-n)/2)+n,a=t(e[r]);if(0===a)return r;a<0?s=r:n=r+1}return-1}(this.shards,t);return-1===n?-1:(this.previousShardIndex=n,this.previousShardIndex)}}function vo(){return to}function xo(){return to.memory()}function Ao(e,t){return to.tidy(e,t)}function ko(e){Xi(e).forEach((e=>e.dispose()))}function Co(e){return to.keep(e)}function So(e,t,n=1){return to.registerBackend(e,t,n)}function Eo(){return to.backend}Di=function(e){Sn().getBool("DEPRECATION_WARNINGS_ENABLED")};const _o=4;async function Io(e,t){const n=[],s=[],r=Array.isArray(e)?e.map((e=>e.name)):Object.keys(e);for(let a=0;a{const t=await o.bytes(),n=t.reduce(((e,t)=>e+t.length),0)+_o*t.length,s=new Uint8Array(n);let r=0;for(let e=0;en.slice(r+e,r+t)));s[e.name]=Ro(e,n.slice(r,r+t)),r+=t}return s}function No(e,t){const n=$t(e.shape);let s;if("quantization"in e){const t=e.quantization;s=bo[t.dtype]}else{if("string"===e.dtype){let e=0;for(let s=0;s{let t=e<<13,n=0;for(;!(8388608&t);)n-=8388608,t<<=1;return t&=-8388609,n+=947912704,t|n},t=new Uint32Array(2048);t[0]=0;for(let n=1;n<1024;n++)t[n]=e(n);for(let e=1024;e<2048;e++)t[e]=939524096+(e-1024<<13);return t}(),t=function(){const e=new Uint32Array(64);e[0]=0,e[31]=1199570944,e[32]=2147483648,e[63]=3347054592;for(let t=1;t<31;t++)e[t]=t<<23;for(let t=33;t<63;t++)e[t]=2147483648+(t-32<<23);return e}(),n=function(){const e=new Uint32Array(64);for(let t=0;t<64;t++)e[t]=1024;return e[0]=e[32]=0,e}();return s=>{const r=new ArrayBuffer(4*s.length),a=new Uint32Array(r);for(let r=0;r>10]+(1023&i)]+t[i>>10];a[r]=o}return new Float32Array(r)}}();i=e(u)}}else{if("int32"!==s)throw new Error(`Unsupported dtype in weight '${n}': ${s}`);if("uint8"!==r.dtype&&"uint16"!==r.dtype)throw new Error(`Unsupported quantization type ${r.dtype} for weight type int32.`);i=new Int32Array(u.length);for(let e=0;e(r=await Do(s,r,t),r.slice(e,t))));r=await Do(s,r,t);const a=r.slice(0,t);r=r.slice(t);const i=Ro(e,a);if(n[e.name]=i,"webgpu"===to.backendName){const e=Eo();"uploadToGPU"in e&&$t(i.shape)>=Sn().get("WEBGPU_CPU_HANDOFF_SIZE_THRESHOLD")&&e.uploadToGPU(i.dataId)}}return n}function Fo(e){if(null===e)throw new Error(`Invalid input value: ${JSON.stringify(e)}`);let t=0;const n=[];e.forEach((e=>{if(t+=e.byteLength,n.push(e.byteLength===e.buffer.byteLength?e:new e.constructor(e)),!(e instanceof Float32Array||e instanceof Int32Array||e instanceof Uint8Array))throw new Error(`Unsupported TypedArray subtype: ${e.constructor.name}`)}));const s=new Uint8Array(t);let r=0;return n.forEach((e=>{s.set(new Uint8Array(e.buffer),r),r+=e.byteLength})),s.buffer}const Bo="undefined"!=typeof Buffer&&("undefined"==typeof Blob||"undefined"==typeof atob||"undefined"==typeof btoa);function zo(e){return Bo?Buffer.byteLength(e,"utf8"):new Blob([e]).size}function Lo(e){return wo.join(e)}function Po(e){for(e=e.trim();e.endsWith("/");)e=e.slice(0,e.length-1);const t=e.split("/");return t[t.length-1]}function Vo(e,t){const n={modelTopology:e.modelTopology,format:e.format,generatedBy:e.generatedBy,convertedBy:e.convertedBy,weightsManifest:t};return null!=e.signature&&(n.signature=e.signature),null!=e.userDefinedMetadata&&(n.userDefinedMetadata=e.userDefinedMetadata),null!=e.modelInitializer&&(n.modelInitializer=e.modelInitializer),null!=e.initializerSignature&&(n.initializerSignature=e.initializerSignature),null!=e.trainingConfig&&(n.trainingConfig=e.trainingConfig),n}function Wo(e,t,n){const s={modelTopology:e.modelTopology,format:e.format,generatedBy:e.generatedBy,convertedBy:e.convertedBy};if(null!=e.trainingConfig&&(s.trainingConfig=e.trainingConfig),null!=e.weightsManifest){if(!t)throw new Error("modelJSON has weightsManifest but weightSpecs is null");if(!n)throw new Error("modelJSON has weightsManifest but weightData is null");s.weightSpecs=t,s.weightData=n}return null!=e.signature&&(s.signature=e.signature),null!=e.userDefinedMetadata&&(s.userDefinedMetadata=e.userDefinedMetadata),null!=e.modelInitializer&&(s.modelInitializer=e.modelInitializer),null!=e.initializerSignature&&(s.initializerSignature=e.initializerSignature),s}async function Uo(e,t){let n,s;return null!=e.weightsManifest&&([n,s]=await t(e.weightsManifest)),Wo(e,n,s)}function Go(e){if(e.modelTopology instanceof ArrayBuffer)throw new Error("Expected JSON model topology, received ArrayBuffer.");return{dateSaved:new Date,modelTopologyType:"JSON",modelTopologyBytes:null==e.modelTopology?0:zo(JSON.stringify(e.modelTopology)),weightSpecsBytes:null==e.weightSpecs?0:zo(JSON.stringify(e.weightSpecs)),weightDataBytes:null==e.weightData?0:new wo(e.weightData).byteLength}}function qo(e){const t=[];for(const n of e)t.push(...n.weights);return t}class jo{constructor(){this.saveRouters=[],this.loadRouters=[]}static getInstance(){return null==jo.instance&&(jo.instance=new jo),jo.instance}static registerSaveRouter(e){jo.getInstance().saveRouters.push(e)}static registerLoadRouter(e){jo.getInstance().loadRouters.push(e)}static getSaveHandlers(e){return jo.getHandlers(e,"save")}static getLoadHandlers(e,t){return jo.getHandlers(e,"load",t)}static getHandlers(e,t,n){const s=[];return("load"===t?jo.getInstance().loadRouters:jo.getInstance().saveRouters).forEach((t=>{const r=t(e,n);null!==r&&s.push(r)})),s}}const Ho=e=>jo.registerSaveRouter(e),$o=e=>jo.registerLoadRouter(e),Ko=e=>jo.getSaveHandlers(e),Xo=(e,t)=>jo.getLoadHandlers(e,t),Zo="tensorflowjs",Yo="models_store",Qo="model_info_store";function Jo(){if(!Sn().getBool("IS_BROWSER"))throw new Error("Failed to obtain IndexedDB factory because the current environmentis not a web browser.");const e="undefined"==typeof window?self:window,t=e.indexedDB||e.mozIndexedDB||e.webkitIndexedDB||e.msIndexedDB||e.shimIndexedDB;if(null==t)throw new Error("The current browser does not appear to support IndexedDB.");return t}function el(e){const t=e.result;t.createObjectStore(Yo,{keyPath:"modelPath"}),t.createObjectStore(Qo,{keyPath:"modelPath"})}class tl{constructor(e){if(this.indexedDB=Jo(),null==e||!e)throw new Error("For IndexedDB, modelPath must not be null, undefined or empty.");this.modelPath=e}async save(e){if(e.modelTopology instanceof ArrayBuffer)throw new Error("BrowserLocalStorage.save() does not support saving model topology in binary formats yet.");return this.databaseAction(this.modelPath,e)}async load(){return this.databaseAction(this.modelPath)}databaseAction(e,t){return new Promise(((e,n)=>{const s=this.indexedDB.open(Zo,1);s.onupgradeneeded=()=>el(s),s.onsuccess=()=>{const r=s.result;if(null==t){const t=r.transaction(Yo,"readonly"),s=t.objectStore(Yo).get(this.modelPath);s.onsuccess=()=>{if(null==s.result)return r.close(),n(new Error(`Cannot find model with path '${this.modelPath}' in IndexedDB.`));e(s.result.modelArtifacts)},s.onerror=e=>(r.close(),n(s.error)),t.oncomplete=()=>r.close()}else{t.weightData=wo.join(t.weightData);const s=Go(t),a=r.transaction(Qo,"readwrite");let i,o,l=a.objectStore(Qo);try{i=l.put({modelPath:this.modelPath,modelArtifactsInfo:s})}catch(e){return n(e)}i.onsuccess=()=>{o=r.transaction(Yo,"readwrite");const i=o.objectStore(Yo);let u;try{u=i.put({modelPath:this.modelPath,modelArtifacts:t,modelArtifactsInfo:s})}catch(e){return n(e)}u.onsuccess=()=>e({modelArtifactsInfo:s}),u.onerror=e=>{l=a.objectStore(Qo);const t=l.delete(this.modelPath);t.onsuccess=()=>(r.close(),n(u.error)),t.onerror=e=>(r.close(),n(u.error))}},i.onerror=e=>(r.close(),n(i.error)),a.oncomplete=()=>{null==o?r.close():o.oncomplete=()=>r.close()}}},s.onerror=e=>n(s.error)}))}}tl.URL_SCHEME="indexeddb://";const nl=e=>{return Sn().getBool("IS_BROWSER")&&!Array.isArray(e)&&e.startsWith(tl.URL_SCHEME)?(t=e.slice(tl.URL_SCHEME.length),new tl(t)):null;var t};jo.registerSaveRouter(nl),jo.registerLoadRouter(nl);class sl{constructor(){this.indexedDB=Jo()}async listModels(){return new Promise(((e,t)=>{const n=this.indexedDB.open(Zo,1);n.onupgradeneeded=()=>el(n),n.onsuccess=()=>{const s=n.result,r=s.transaction(Qo,"readonly"),a=r.objectStore(Qo).getAll();a.onsuccess=()=>{const t={};for(const e of a.result)t[e.modelPath]=e.modelArtifactsInfo;e(t)},a.onerror=e=>(s.close(),t(a.error)),r.oncomplete=()=>s.close()},n.onerror=e=>t(n.error)}))}async removeModel(e){var t;return e=(t=e).startsWith(tl.URL_SCHEME)?t.slice(tl.URL_SCHEME.length):t,new Promise(((t,n)=>{const s=this.indexedDB.open(Zo,1);s.onupgradeneeded=()=>el(s),s.onsuccess=()=>{const r=s.result,a=r.transaction(Qo,"readwrite"),i=a.objectStore(Qo),o=i.get(e);let l;o.onsuccess=()=>{if(null==o.result)return r.close(),n(new Error(`Cannot find model with path '${e}' in IndexedDB.`));{const s=i.delete(e),a=()=>{l=r.transaction(Yo,"readwrite");const s=l.objectStore(Yo).delete(e);s.onsuccess=()=>t(o.result.modelArtifactsInfo),s.onerror=e=>n(o.error)};s.onsuccess=a,s.onerror=e=>(a(),r.close(),n(o.error))}},o.onerror=e=>(r.close(),n(o.error)),a.oncomplete=()=>{null==l?r.close():l.oncomplete=()=>r.close()}},s.onerror=e=>n(s.error)}))}}const rl="/",al="tensorflowjs_models",il="info",ol="model_topology",ll="weight_specs",ul="weight_data",cl="model_metadata";function hl(e){return{info:[al,e,il].join(rl),topology:[al,e,ol].join(rl),weightSpecs:[al,e,ll].join(rl),weightData:[al,e,ul].join(rl),modelMetadata:[al,e,cl].join(rl)}}function dl(e){for(const t of Object.values(e))window.localStorage.removeItem(t)}function pl(e){const t=e.split(rl);if(t.length<3)throw new Error(`Invalid key format: ${e}`);return t.slice(1,t.length-1).join(rl)}class fl{constructor(e){if(!Sn().getBool("IS_BROWSER")||"undefined"==typeof window||void 0===window.localStorage)throw new Error("The current environment does not support local storage.");if(this.LS=window.localStorage,null==e||!e)throw new Error("For local storage, modelPath must not be null, undefined or empty.");this.modelPath=e,this.keys=hl(this.modelPath)}async save(e){if(e.modelTopology instanceof ArrayBuffer)throw new Error("BrowserLocalStorage.save() does not support saving model topology in binary formats yet.");{const t=JSON.stringify(e.modelTopology),n=JSON.stringify(e.weightSpecs),s=Go(e),r=wo.join(e.weightData);try{this.LS.setItem(this.keys.info,JSON.stringify(s)),this.LS.setItem(this.keys.topology,t),this.LS.setItem(this.keys.weightSpecs,n),this.LS.setItem(this.keys.weightData,function(e){if(Bo)return Buffer.from(e).toString("base64");const t=new Uint8Array(e);let n="";for(let e=0,s=t.length;e{return Sn().getBool("IS_BROWSER")&&!Array.isArray(e)&&e.startsWith(fl.URL_SCHEME)?(t=e.slice(fl.URL_SCHEME.length),new fl(t)):null;var t};jo.registerSaveRouter(ml),jo.registerLoadRouter(ml);class gl{constructor(){qt(Sn().getBool("IS_BROWSER"),(()=>"Current environment is not a web browser")),qt("undefined"==typeof window||void 0!==window.localStorage,(()=>"Current browser does not appear to support localStorage")),this.LS=window.localStorage}async listModels(){const e={},t=al+rl,n=rl+il;for(let s=0;s"scheme must not be undefined or null.")),e.endsWith(yl)&&(e=e.slice(0,e.indexOf(yl))),qt(e.length>0,(()=>"scheme must not be an empty string."));const n=bl.getInstance();qt(null==n.managers[e],(()=>`A model store manager is already registered for scheme '${e}'.`)),n.managers[e]=t}static getManager(e){const t=bl.getInstance().managers[e];if(null==t)throw new Error(`Cannot find model manager for scheme '${e}'`);return t}static getSchemes(){return Object.keys(bl.getInstance().managers)}}function wl(e){if(-1===e.indexOf(yl))throw new Error(`The url string provided does not contain a scheme. Supported schemes are: ${bl.getSchemes().join(",")}`);return{scheme:e.split(yl)[0],path:e.split(yl)[1]}}async function vl(e,t,n=!1){qt(e!==t,(()=>`Old path and new path are the same: '${e}'`));const s=jo.getLoadHandlers(e);qt(s.length>0,(()=>`Copying failed because no load handler is found for source URL ${e}.`)),qt(s.length<2,(()=>`Copying failed because more than one (${s.length}) load handlers for source URL ${e}.`));const r=s[0],a=jo.getSaveHandlers(t);qt(a.length>0,(()=>`Copying failed because no save handler is found for destination URL ${t}.`)),qt(a.length<2,(()=>`Copying failed because more than one (${s.length}) save handlers for destination URL ${t}.`));const i=a[0],o=wl(e).scheme,l=wl(e).path,u=o===wl(e).scheme,c=await r.load();n&&u&&await bl.getManager(o).removeModel(l);const h=await i.save(c);return n&&!u&&await bl.getManager(o).removeModel(l),h.modelArtifactsInfo}async function xl(){const e=bl.getSchemes(),t={};for(const n of e){const e=await bl.getManager(n).listModels();for(const s in e){t[n+yl+s]=e[s]}}return t}async function Al(e){const t=wl(e);return bl.getManager(t.scheme).removeModel(t.path)}async function kl(e,t){return vl(e,t,!1)}async function Cl(e,t){return vl(e,t,!0)}class Sl{constructor(){this.messageName="setTimeoutCustom",this.functionRefs=[],this.handledMessageCount=0,this.hasEventListener=!1}fetch(e,t){return fetch(e,t)}now(){return performance.now()}encode(e,t){if("utf-8"!==t&&"utf8"!==t)throw new Error(`Browser's encoder only supports utf-8, but got ${t}`);return null==this.textEncoder&&(this.textEncoder=new TextEncoder),this.textEncoder.encode(e)}decode(e,t){return new TextDecoder(t).decode(e)}setTimeoutCustom(e,t){"undefined"!=typeof window&&Sn().getBool("USE_SETTIMEOUTCUSTOM")?(this.functionRefs.push(e),setTimeout((()=>{window.postMessage({name:this.messageName,index:this.functionRefs.length-1},"*")}),t),this.hasEventListener||(this.hasEventListener=!0,window.addEventListener("message",(e=>{if(e.source===window&&e.data.name===this.messageName){e.stopPropagation();(0,this.functionRefs[e.data.index])(),this.handledMessageCount++,this.handledMessageCount===this.functionRefs.length&&(this.functionRefs=[],this.handledMessageCount=0)}}),!0))):setTimeout(e,t)}isTypedArray(e){return Ya(e)}}if(Sn().get("IS_BROWSER")){Sn().setPlatform("browser",new Sl);try{bl.registerManager(fl.URL_SCHEME,new gl)}catch(e){}try{bl.registerManager(tl.URL_SCHEME,new sl)}catch(e){}}const El=()=>__webpack_require__(8273);let _l;class Il{constructor(){this.util=__webpack_require__(9830),this.textEncoder=new this.util.TextEncoder}fetch(e,t){return null!=Sn().global.fetch?Sn().global.fetch(e,t):(null==_l&&(_l=El()),_l(e,t))}now(){const e=process.hrtime();return 1e3*e[0]+e[1]/1e6}encode(e,t){if("utf-8"!==t&&"utf8"!==t)throw new Error(`Node built-in encoder only supports utf-8, but got ${t}`);return this.textEncoder.encode(e)}decode(e,t){return 0===e.length?"":new this.util.TextDecoder(t).decode(e)}isTypedArray(e){return this.util.types.isFloat32Array(e)||this.util.types.isInt32Array(e)||this.util.types.isUint8Array(e)||this.util.types.isUint8ClampedArray(e)}}function Tl(e,t="float32",n){return t=t||"float32",bn(e),new Ni(e,t,n)}Sn().get("IS_NODE")&&!Sn().get("IS_BROWSER")&&Sn().setPlatform("node",new Il);const Nl=fo({cast_:function(e,t){const n=co(e,"x","cast");if(!function(e){return"bool"===e||"complex64"===e||"float32"===e||"int32"===e||"string"===e}(t))throw new Error(`Failed to cast to unknown dtype ${t}`);if("string"===t&&"string"!==n.dtype||"string"!==t&&"string"===n.dtype)throw new Error("Only strings can be casted to strings");const s={x:n},r={dtype:t};return to.runKernel(Jn,s,r)}});const Ol=fo({clone_:function(e){const t={x:co(e,"x","clone","string_or_numeric")};return to.runKernel(js,t)}});function Rl(e,t=!1){}eo();Ri={buffer:Tl,cast:Nl,clone:Ol,print:Rl};const Dl=fo({add_:function(e,t){let n=co(e,"a","add"),s=co(t,"b","add");[n,s]=$i(n,s);const r={a:n,b:s};return to.runKernel(Dn,r)}});const Ml=fo({floorDiv_:function(e,t){let n=co(e,"a","floorDiv"),s=co(t,"b","floorDiv");[n,s]=$i(n,s);const r={a:n,b:s};return to.runKernel(Ps,r)}});const Fl=fo({div_:function(e,t){let n=co(e,"a","div"),s=co(t,"b","div");if([n,s]=$i(n,s),"int32"===n.dtype&&"int32"===s.dtype)return Ml(n,s);const r={a:n,b:s};return to.runKernel(Es,r,{})}});const Bl=fo({mul_:function(e,t){let n=co(e,"a","mul"),s=co(t,"b","mul");[n,s]=$i(n,s);const r={a:n,b:s};return to.runKernel(xr,r)}});const zl=fo({sqrt_:function(e){const t={x:co(e,"x","sqrt","float32")};return to.runKernel(oa,t)}});const Ll=fo({square_:function(e){const t=co(e,"x","square");return to.runKernel("Square",{x:t},{})}});const Pl=fo({zerosLike_:function(e){const t={x:co(e,"x","zerosLike")};return to.runKernel(Ma,t)}});function Vl(e){return to.customGrad(e)}function Wl(e,t){if((yi(e)&&"string"!==t||Array.isArray(e))&&"complex64"!==t)throw new Error("Error creating a new Scalar: value must be a primitive (number|boolean|string)");if("string"===t&&yi(e)&&!(e instanceof Uint8Array))throw new Error("When making a scalar from encoded string, the value must be `Uint8Array`.");return go(e,[],[],t)}const Ul=new Map,Gl=new Map;class ql{getClassName(){return this.constructor.className}static fromConfig(e,t){return new e(t)}}class jl{constructor(){this.classNameMap={}}static getMap(){return null==jl.instance&&(jl.instance=new jl),jl.instance}static register(e){jl.getMap().classNameMap[e.className]=[e,e.fromConfig]}}function Hl(e,t,n){qt(null!=e.className,(()=>"Class being registered does not have the static className property defined.")),qt("string"==typeof e.className,(()=>"className is required to be a string, but got type "+typeof e.className)),qt(e.className.length>0,(()=>"Class being registered has an empty-string as its className, which is disallowed.")),void 0===t&&(t="Custom"),void 0===n&&(n=e.className);const s=t+">"+n;return jl.register(e),Ul.set(s,e),Gl.set(e,s),e}class $l extends ql{minimize(e,t=!1,n){const{value:s,grads:r}=this.computeGradients(e,n);if(null!=n){const e=n.map((e=>({name:e.name,tensor:r[e.name]})));this.applyGradients(e)}else this.applyGradients(r);return ko(r),t?s:(s.dispose(),null)}get iterations(){return null==this.iterations_&&(this.iterations_=0),this.iterations_}incrementIterations(){this.iterations_=this.iterations+1}computeGradients(e,t){return function(e,t){qt(cn(e),(()=>"The f passed in variableGrads(f) must be a function")),qt(null==t||Array.isArray(t)&&t.every((e=>e instanceof Bi)),(()=>"The varList passed in variableGrads(f, varList) must be an array of variables"));const n=null!=t;if(!n){t=[];for(const e in to.registeredVariables)t.push(to.registeredVariables[e])}const s=n?t.filter((e=>!e.trainable)):null,r=t.length;t=t.filter((e=>e.trainable)),qt(t.length>0,(()=>`variableGrads() expects at least one of the input variables to be trainable, but none of the ${r} variables is trainable.`));const{value:a,grads:i}=to.gradients(e,t,null,!0);qt(i.some((e=>null!=e)),(()=>"Cannot find a connection between any variable and the result of the loss function y=f(x). Please make sure the operations that use variables are inside the function f passed to minimize().")),qt(0===a.rank,(()=>`The f passed in variableGrads(f) must return a scalar, but it returned a rank-${a.rank} tensor`));const o={};return t.forEach(((e,t)=>{null!=i[t]&&(o[e.name]=i[t])})),null!=s&&s.forEach((e=>o[e.name]=null)),{value:a,grads:o}}(e,t)}dispose(){null!=this.iterations_&&ko(this.iterations_)}async saveIterations(){return null==this.iterations_&&(this.iterations_=0),{name:"iter",tensor:Wl(this.iterations_,"int32")}}async getWeights(){throw new Error("getWeights() is not implemented for this optimizer yet.")}async setWeights(e){throw new Error(`setWeights() is not implemented for this optimizer class ${this.getClassName()}`)}async extractIterations(e){return this.iterations_=(await e[0].tensor.data())[0],e.slice(1)}}Object.defineProperty($l,Symbol.hasInstance,{value:e=>null!=e.minimize&&null!=e.computeGradients&&null!=e.applyGradients});class Kl extends $l{static get className(){return"Adadelta"}constructor(e,t,n=null){super(),this.learningRate=e,this.rho=t,this.epsilon=n,this.accumulatedGrads=[],this.accumulatedUpdates=[],null==n&&(this.epsilon=to.backend.epsilon())}applyGradients(e){(Array.isArray(e)?e.map((e=>e.name)):Object.keys(e)).forEach(((t,n)=>{const s=to.registeredVariables[t],r=!1;null==this.accumulatedGrads[n]&&(this.accumulatedGrads[n]={originalName:`${t}/accum_grad`,variable:Ao((()=>Pl(s).variable(r)))}),null==this.accumulatedUpdates[n]&&(this.accumulatedUpdates[n]={originalName:`${t}/accum_var`,variable:Ao((()=>Pl(s).variable(r)))});const a=Array.isArray(e)?e[n].tensor:e[t];if(null==a)return;const i=this.accumulatedGrads[n].variable,o=this.accumulatedUpdates[n].variable;Ao((()=>{const e=Dl(Bl(i,this.rho),Bl(Ll(a),1-this.rho)),t=Bl(Fl(zl(Dl(o,this.epsilon)),zl(Dl(i,this.epsilon))),a),n=Dl(Bl(o,this.rho),Bl(Ll(t),1-this.rho));i.assign(e),o.assign(n);const r=Dl(Bl(t,-this.learningRate),s);s.assign(r)}))})),this.incrementIterations()}dispose(){null!=this.accumulatedUpdates&&(ko(this.accumulatedGrads.map((e=>e.variable))),ko(this.accumulatedUpdates.map((e=>e.variable))))}async getWeights(){const e=[...this.accumulatedGrads,...this.accumulatedUpdates];return[await this.saveIterations()].concat(e.map((e=>({name:e.originalName,tensor:e.variable}))))}async setWeights(e){const t=(e=await this.extractIterations(e)).length/2,n=!1;this.accumulatedGrads=e.slice(0,t).map((e=>({originalName:e.name,variable:e.tensor.variable(n)}))),this.accumulatedUpdates=e.slice(t,2*t).map((e=>({originalName:e.name,variable:e.tensor.variable(n)})))}getConfig(){return{learningRate:this.learningRate,rho:this.rho,epsilon:this.epsilon}}static fromConfig(e,t){return new e(t.learningRate,t.rho,t.epsilon)}}function Xl(e,t,n){bn(e);const s={shape:e,value:t,dtype:n=n||un(t)};return to.runKernel(Bs,{},s)}class Zl extends $l{static get className(){return"Adagrad"}constructor(e,t=.1){super(),this.learningRate=e,this.initialAccumulatorValue=t,this.accumulatedGrads=[]}applyGradients(e){(Array.isArray(e)?e.map((e=>e.name)):Object.keys(e)).forEach(((t,n)=>{const s=to.registeredVariables[t];if(null==this.accumulatedGrads[n]){const e=!1;this.accumulatedGrads[n]={originalName:`${t}/accumulator`,variable:Ao((()=>Xl(s.shape,this.initialAccumulatorValue).variable(e)))}}const r=Array.isArray(e)?e[n].tensor:e[t];if(null==r)return;const a=this.accumulatedGrads[n].variable;Ao((()=>{const e=Dl(a,Ll(r));a.assign(e);const t=Dl(Bl(Fl(r,zl(Dl(e,to.backend.epsilon()))),-this.learningRate),s);s.assign(t)}))})),this.incrementIterations()}dispose(){null!=this.accumulatedGrads&&ko(this.accumulatedGrads.map((e=>e.variable)))}async getWeights(){return[await this.saveIterations()].concat(this.accumulatedGrads.map((e=>({name:e.originalName,tensor:e.variable}))))}async setWeights(e){e=await this.extractIterations(e);this.accumulatedGrads=e.map((e=>({originalName:e.name,variable:e.tensor.variable(false)})))}getConfig(){return{learningRate:this.learningRate,initialAccumulatorValue:this.initialAccumulatorValue}}static fromConfig(e,t){return new e(t.learningRate,t.initialAccumulatorValue)}}const Yl=fo({pow_:function(e,t){let n=co(e,"base","pow"),s=co(t,"exp","pow");[n,s]=$i(n,s);const r={a:n,b:s};return to.runKernel(Or,r)}});const Ql=fo({sub_:function(e,t){let n=co(e,"a","sub"),s=co(t,"b","sub");[n,s]=$i(n,s);const r={a:n,b:s};return to.runKernel(Ca,r)}});class Jl extends $l{static get className(){return"Adam"}constructor(e,t,n,s=null){super(),this.learningRate=e,this.beta1=t,this.beta2=n,this.epsilon=s,this.accumulatedFirstMoment=[],this.accumulatedSecondMoment=[],Ao((()=>{this.accBeta1=Wl(t).variable(),this.accBeta2=Wl(n).variable()})),null==s&&(this.epsilon=to.backend.epsilon())}applyGradients(e){const t=Array.isArray(e)?e.map((e=>e.name)):Object.keys(e);Ao((()=>{const n=Ql(1,this.accBeta1),s=Ql(1,this.accBeta2);t.forEach(((t,r)=>{const a=to.registeredVariables[t],i=!1;null==this.accumulatedFirstMoment[r]&&(this.accumulatedFirstMoment[r]={originalName:`${t}/m`,variable:Ao((()=>Pl(a).variable(i)))}),null==this.accumulatedSecondMoment[r]&&(this.accumulatedSecondMoment[r]={originalName:`${t}/v`,variable:Ao((()=>Pl(a).variable(i)))});const o=Array.isArray(e)?e[r].tensor:e[t];if(null==o)return;const l=this.accumulatedFirstMoment[r].variable,u=this.accumulatedSecondMoment[r].variable,c=Dl(Bl(l,this.beta1),Bl(o,1-this.beta1)),h=Dl(Bl(u,this.beta2),Bl(Ll(o),1-this.beta2)),d=Fl(c,n),p=Fl(h,s);l.assign(c),u.assign(h);const f=Dl(Bl(Fl(d,Dl(zl(p),this.epsilon)),-this.learningRate),a);a.assign(f)})),this.accBeta1.assign(Bl(this.accBeta1,this.beta1)),this.accBeta2.assign(Bl(this.accBeta2,this.beta2))})),this.incrementIterations()}dispose(){this.accBeta1.dispose(),this.accBeta2.dispose(),null!=this.accumulatedFirstMoment&&ko(this.accumulatedFirstMoment.map((e=>e.variable))),null!=this.accumulatedSecondMoment&&ko(this.accumulatedSecondMoment.map((e=>e.variable)))}async getWeights(){const e=[...this.accumulatedFirstMoment,...this.accumulatedSecondMoment];return[await this.saveIterations()].concat(e.map((e=>({name:e.originalName,tensor:e.variable}))))}async setWeights(e){e=await this.extractIterations(e),Ao((()=>{this.accBeta1.assign(Yl(this.beta1,this.iterations_+1)),this.accBeta2.assign(Yl(this.beta2,this.iterations_+1))}));const t=e.length/2,n=!1;this.accumulatedFirstMoment=e.slice(0,t).map((e=>({originalName:e.name,variable:e.tensor.variable(n)}))),this.accumulatedSecondMoment=e.slice(t,2*t).map((e=>({originalName:e.name,variable:e.tensor.variable(n)})))}getConfig(){return{learningRate:this.learningRate,beta1:this.beta1,beta2:this.beta2,epsilon:this.epsilon}}static fromConfig(e,t){return new e(t.learningRate,t.beta1,t.beta2,t.epsilon)}}const eu=fo({abs_:function(e){const t=co(e,"x","abs");if("complex64"===t.dtype){const e={x:t};return to.runKernel(ss,e)}{const e={x:t};return to.runKernel(Nn,e)}}});function tu(e,t){const n=e.length,s=[];for(let r=0;r1&&1===i&&s.unshift(a)}return s}function nu(e,t){const n=[];for(let s=0;s1)&&n.unshift(a)}return n}function su(e,t){const n=Math.max(e.length,t.length),s=new Array(n);for(let r=0;r{this.iteration=Wl(0).variable(),this.accBeta1=Wl(t).variable()})),null==s&&(this.epsilon=to.backend.epsilon())}applyGradients(e){const t=Array.isArray(e)?e.map((e=>e.name)):Object.keys(e);Ao((()=>{const n=Ql(1,this.accBeta1),s=Fl(-this.learningRate,Dl(Bl(this.iteration,this.decay),1));t.forEach(((t,r)=>{const a=to.registeredVariables[t],i=!1;null==this.accumulatedFirstMoment[r]&&(this.accumulatedFirstMoment[r]={originalName:`${t}/m`,variable:Pl(a).variable(i)}),null==this.accumulatedWeightedInfNorm[r]&&(this.accumulatedWeightedInfNorm[r]={originalName:`${t}/v`,variable:Pl(a).variable(i)});const o=Array.isArray(e)?e[r].tensor:e[t];if(null==o)return;const l=this.accumulatedFirstMoment[r].variable,u=this.accumulatedWeightedInfNorm[r].variable,c=Dl(Bl(l,this.beta1),Bl(o,1-this.beta1)),h=Bl(u,this.beta2),d=eu(o),p=ru(h,d);l.assign(c),u.assign(p);const f=Dl(Bl(Fl(s,n),Fl(c,Dl(p,this.epsilon))),a);a.assign(f)})),this.iteration.assign(Dl(this.iteration,1)),this.accBeta1.assign(Bl(this.accBeta1,this.beta1))})),this.incrementIterations()}dispose(){this.accBeta1.dispose(),this.iteration.dispose(),null!=this.accumulatedFirstMoment&&ko(this.accumulatedFirstMoment.map((e=>e.variable))),null!=this.accumulatedWeightedInfNorm&&ko(this.accumulatedWeightedInfNorm.map((e=>e.variable)))}async getWeights(){throw new Error("getWeights() is not implemented for Adamax yet.")}async setWeights(e){throw new Error("setWeights() is not implemented for Adamax yet.")}getConfig(){return{learningRate:this.learningRate,beta1:this.beta1,beta2:this.beta2,epsilon:this.epsilon,decay:this.decay}}static fromConfig(e,t){return new e(t.learningRate,t.beta1,t.beta2,t.epsilon,t.decay)}}class iu extends $l{static get className(){return"SGD"}constructor(e){super(),this.learningRate=e,this.setLearningRate(e)}applyGradients(e){(Array.isArray(e)?e.map((e=>e.name)):Object.keys(e)).forEach(((t,n)=>{const s=Array.isArray(e)?e[n].tensor:e[t];if(null==s)return;const r=to.registeredVariables[t];Ao((()=>{const e=Dl(Bl(this.c,s),r);r.assign(e)}))})),this.incrementIterations()}setLearningRate(e){this.learningRate=e,null!=this.c&&this.c.dispose(),this.c=Co(Wl(-e))}dispose(){this.c.dispose()}async getWeights(){return[await this.saveIterations()]}async setWeights(e){if(0!==(e=await this.extractIterations(e)).length)throw new Error("SGD optimizer does not have settable weights.")}getConfig(){return{learningRate:this.learningRate}}static fromConfig(e,t){return new e(t.learningRate)}}class ou extends iu{static get className(){return"Momentum"}constructor(e,t,n=!1){super(e),this.learningRate=e,this.momentum=t,this.useNesterov=n,this.accumulations=[],this.m=Wl(this.momentum)}applyGradients(e){(Array.isArray(e)?e.map((e=>e.name)):Object.keys(e)).forEach(((t,n)=>{const s=to.registeredVariables[t];if(null==this.accumulations[n]){const e=!1;this.accumulations[n]={originalName:`${t}/momentum`,variable:Ao((()=>Pl(s).variable(e)))}}const r=this.accumulations[n].variable,a=Array.isArray(e)?e[n].tensor:e[t];null!=a&&Ao((()=>{let e;const t=Dl(Bl(this.m,r),a);e=this.useNesterov?Dl(Bl(this.c,Dl(a,Bl(t,this.m))),s):Dl(Bl(this.c,t),s),r.assign(t),s.assign(e)}))})),this.incrementIterations()}dispose(){this.m.dispose(),null!=this.accumulations&&ko(this.accumulations.map((e=>e.variable)))}setMomentum(e){this.momentum=e}async getWeights(){return[await this.saveIterations()].concat(this.accumulations.map((e=>({name:e.originalName,tensor:e.variable}))))}async setWeights(e){e=await this.extractIterations(e);this.accumulations=e.map((e=>({originalName:e.name,variable:e.tensor.variable(false)})))}getConfig(){return{learningRate:this.learningRate,momentum:this.momentum,useNesterov:this.useNesterov}}static fromConfig(e,t){return new e(t.learningRate,t.momentum,t.useNesterov)}}class lu extends $l{static get className(){return"RMSProp"}constructor(e,t=.9,n=0,s=null,r=!1){if(super(),this.learningRate=e,this.decay=t,this.momentum=n,this.epsilon=s,this.accumulatedMeanSquares=[],this.accumulatedMoments=[],this.accumulatedMeanGrads=[],this.centered=r,null==s&&(this.epsilon=to.backend.epsilon()),null==e)throw new Error("learningRate for RMSPropOptimizer must be defined.")}applyGradients(e){(Array.isArray(e)?e.map((e=>e.name)):Object.keys(e)).forEach(((t,n)=>{const s=to.registeredVariables[t],r=!1;null==this.accumulatedMeanSquares[n]&&(this.accumulatedMeanSquares[n]={originalName:`${t}/rms`,variable:Ao((()=>Pl(s).variable(r)))}),null==this.accumulatedMoments[n]&&(this.accumulatedMoments[n]={originalName:`${t}/momentum`,variable:Ao((()=>Pl(s).variable(r)))}),null==this.accumulatedMeanGrads[n]&&this.centered&&(this.accumulatedMeanGrads[n]={originalName:`${t}/mg`,variable:Ao((()=>Pl(s).variable(r)))});const a=Array.isArray(e)?e[n].tensor:e[t];if(null==a)return;const i=this.accumulatedMeanSquares[n].variable,o=this.accumulatedMoments[n].variable;Ao((()=>{const e=Dl(Bl(i,this.decay),Bl(Ll(a),1-this.decay));if(this.centered){const t=this.accumulatedMeanGrads[n].variable,r=Dl(Bl(t,this.decay),Bl(a,1-this.decay)),l=Fl(Bl(a,this.learningRate),zl(Ql(e,Dl(Ll(r),this.epsilon)))),u=Dl(Bl(o,this.momentum),l);i.assign(e),t.assign(r),o.assign(u);const c=Ql(s,u);s.assign(c)}else{const e=Dl(Bl(i,this.decay),Bl(Ll(a),1-this.decay)),t=Dl(Bl(o,this.momentum),Fl(Bl(a,this.learningRate),zl(Dl(e,this.epsilon))));i.assign(e),o.assign(t);const n=Ql(s,t);s.assign(n)}}))})),this.incrementIterations()}dispose(){null!=this.accumulatedMeanSquares&&ko(this.accumulatedMeanSquares.map((e=>e.variable))),null!=this.accumulatedMeanGrads&&this.centered&&ko(this.accumulatedMeanGrads.map((e=>e.variable))),null!=this.accumulatedMoments&&ko(this.accumulatedMoments.map((e=>e.variable)))}async getWeights(){const e=[...this.accumulatedMeanSquares,...this.accumulatedMoments];return this.centered&&e.push(...this.accumulatedMeanGrads),[await this.saveIterations()].concat(e.map((e=>({name:e.originalName,tensor:e.variable}))))}async setWeights(e){e=await this.extractIterations(e);const t=this.centered?e.length/3:e.length/2,n=!1;this.accumulatedMeanSquares=e.slice(0,t).map((e=>({originalName:e.name,variable:e.tensor.variable(n)}))),this.accumulatedMoments=e.slice(t,2*t).map((e=>({originalName:e.name,variable:e.tensor.variable(n)}))),this.centered&&(this.accumulatedMeanGrads=e.slice(2*t,3*t).map((e=>({originalName:e.name,variable:e.tensor.variable(n)}))))}getConfig(){return{learningRate:this.learningRate,decay:this.decay,momentum:this.momentum,epsilon:this.epsilon,centered:this.centered}}static fromConfig(e,t){return new e(t.learningRate,t.decay,t.momentum,t.epsilon,t.centered)}}const uu=[Kl,Zl,Jl,au,ou,lu,iu];function cu(e){return new Promise((e=>setTimeout(e))).then(e)}class hu{constructor(e){if(!Sn().getBool("IS_BROWSER"))throw new Error("browserDownloads() cannot proceed because the current environment is not a browser.");e.startsWith(hu.URL_SCHEME)&&(e=e.slice(hu.URL_SCHEME.length)),null!=e&&0!==e.length||(e="model"),this.modelJsonFileName=e+".json",this.weightDataFileName=e+".weights.bin"}async save(e){if("undefined"==typeof document)throw new Error("Browser downloads are not supported in this environment since `document` is not present");const t=wo.join(e.weightData),n=window.URL.createObjectURL(new Blob([t],{type:"application/octet-stream"}));if(e.modelTopology instanceof ArrayBuffer)throw new Error("BrowserDownloads.save() does not support saving model topology in binary formats yet.");{const t=Vo(e,[{paths:["./"+this.weightDataFileName],weights:e.weightSpecs}]),s=window.URL.createObjectURL(new Blob([JSON.stringify(t)],{type:"application/json"})),r=null==this.modelJsonAnchor?document.createElement("a"):this.modelJsonAnchor;if(r.download=this.modelJsonFileName,r.href=s,await cu((()=>r.dispatchEvent(new MouseEvent("click")))),null!=e.weightData){const e=null==this.weightDataAnchor?document.createElement("a"):this.weightDataAnchor;e.download=this.weightDataFileName,e.href=n,await cu((()=>e.dispatchEvent(new MouseEvent("click"))))}return{modelArtifactsInfo:Go(e)}}}}hu.URL_SCHEME="downloads://";class du{constructor(e){if(null==e||e.length<1)throw new Error(`When calling browserFiles, at least 1 file is required, but received ${e}`);this.jsonFile=e[0],this.weightsFiles=e.slice(1)}async load(){return new Promise(((e,t)=>{const n=new FileReader;n.onload=n=>{const s=JSON.parse(n.target.result),r=s.modelTopology;if(null==r)return void t(new Error(`modelTopology field is missing from file ${this.jsonFile.name}`));if(null==s.weightsManifest)return void t(new Error(`weightManifest field is missing from file ${this.jsonFile.name}`));if(0===this.weightsFiles.length)return void e({modelTopology:r});const a=Uo(s,(e=>this.loadWeights(e)));e(a)},n.onerror=e=>t(`Failed to read model topology and weights manifest JSON from file '${this.jsonFile.name}'. BrowserFiles supports loading Keras-style tf.Model artifacts only.`),n.readAsText(this.jsonFile)}))}loadWeights(e){const t=[],n=[];for(const s of e)t.push(...s.weights),n.push(...s.paths);const s=this.checkManifestAndWeightFiles(e),r=n.map((e=>this.loadWeightsFile(e,s[e])));return Promise.all(r).then((e=>[t,e]))}loadWeightsFile(e,t){return new Promise(((n,s)=>{const r=new FileReader;r.onload=e=>{const t=e.target.result;n(t)},r.onerror=t=>s(`Failed to weights data from file of path '${e}'.`),r.readAsArrayBuffer(t)}))}checkManifestAndWeightFiles(e){const t=[],n=this.weightsFiles.map((e=>Po(e.name))),s={};for(const r of e)r.paths.forEach((e=>{const r=Po(e);if(-1!==t.indexOf(r))throw new Error(`Duplicate file basename found in weights manifest: '${r}'`);if(t.push(r),-1===n.indexOf(r))throw new Error(`Weight file with basename '${r}' is not provided.`);s[e]=this.weightsFiles[n.indexOf(r)]}));if(t.length!==this.weightsFiles.length)throw new Error(`Mismatch in the number of files in weights manifest (${t.length}) and the number of weight files provided (${this.weightsFiles.length}).`);return s}}function pu(e){return new du(e)}function fu(e,t,n,s){!function(e){qt(null!=e&&Array.isArray(e)&&e.length>0,(()=>"promises must be a none empty array"))}(e),function(e,t){qt(e>=0&&e<=1,(()=>`Progress fraction must be in range [0, 1], but got startFraction ${e}`)),qt(t>=0&&t<=1,(()=>`Progress fraction must be in range [0, 1], but got endFraction ${t}`)),qt(t>=e,(()=>`startFraction must be no more than endFraction, but got startFraction ${e} and endFraction ${t}`))}(n=null==n?0:n,s=null==s?1:s);let r=0;return Promise.all(e.map((a=>(a.then((a=>{const i=n+ ++r/e.length*(s-n);return t(i),a})),a))))}async function mu(e,t){null==t&&(t={});const n=null==t.fetchFunc?Sn().platform.fetch:t.fetchFunc,s=e.map((e=>n(e,t.requestInit,{isBinary:!0}))),r=(null==t.onProgress?await Promise.all(s):await fu(s,t.onProgress,0,.5)).map((e=>e.arrayBuffer()));return null==t.onProgress?await Promise.all(r):await fu(r,t.onProgress,.5,1)}async function gu(e,t="",n,s){return yu((e=>mu(e,{requestInit:s})))(e,t,n)}function yu(e){return async(t,n="",s)=>{const r=t.map((()=>!1)),a={},i=null!=s?s.map((()=>!1)):[],o=[];if(t.forEach(((e,t)=>{let n=0;e.weights.forEach((e=>{const l="quantization"in e?e.quantization.dtype:e.dtype,u=bo[l]*$t(e.shape),c=()=>{r[t]=!0,null==a[t]&&(a[t]=[]),a[t].push({manifestEntry:e,groupOffset:n,sizeBytes:u})};null!=s?s.forEach(((t,n)=>{t===e.name&&(c(),i[n]=!0)})):c(),o.push(e.name),n+=u}))})),!i.every((e=>e))){const e=s.filter(((e,t)=>!i[t]));throw new Error(`Could not find weights in manifest with names: ${e.join(", ")}. \nManifest JSON has weights with names: ${o.join(", ")}.`)}const l=r.reduce(((e,t,n)=>(t&&e.push(n),e)),[]),u=[];l.forEach((e=>{t[e].paths.forEach((e=>{const t=n+(n.endsWith("/")?"":"/")+e;u.push(t)}))}));const c=await e(u),h={};let d=0;return l.forEach((e=>{const n=t[e].paths.length,s=new wo(c.slice(d,d+n));a[e].forEach((e=>{const t=To(s.slice(e.groupOffset,e.groupOffset+e.sizeBytes),[e.manifestEntry]);for(const e in t)h[e]=t[e]})),d+=n})),h}}jo.registerSaveRouter((e=>Sn().getBool("IS_BROWSER")&&!Array.isArray(e)&&e.startsWith(hu.URL_SCHEME)?function(e="model"){return new hu(e)}(e.slice(hu.URL_SCHEME.length)):null));class bu{constructor(e,t){if(this.DEFAULT_METHOD="POST",null==t&&(t={}),this.weightPathPrefix=t.weightPathPrefix,this.weightUrlConverter=t.weightUrlConverter,null!=t.fetchFunc?(qt("function"==typeof t.fetchFunc,(()=>"Must pass a function that matches the signature of `fetch` (see https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API)")),this.fetch=t.fetchFunc):this.fetch=Sn().platform.fetch,qt(null!=e&&e.length>0,(()=>"URL path for http must not be null, undefined or empty.")),Array.isArray(e)&&qt(2===e.length,(()=>`URL paths for http must have a length of 2, (actual length is ${e.length}).`)),this.path=e,null!=t.requestInit&&null!=t.requestInit.body)throw new Error("requestInit is expected to have no pre-existing body, but has one.");this.requestInit=t.requestInit||{},this.loadOptions=t}async save(e){if(e.modelTopology instanceof ArrayBuffer)throw new Error("BrowserHTTPRequest.save() does not support saving model topology in binary formats yet.");const t=Object.assign({method:this.DEFAULT_METHOD},this.requestInit);t.body=new FormData;const n=Vo(e,[{paths:["./model.weights.bin"],weights:e.weightSpecs}]);if(t.body.append("model.json",new Blob([JSON.stringify(n)],{type:"application/json"}),"model.json"),null!=e.weightData){const n=wo.join(e.weightData);t.body.append("model.weights.bin",new Blob([n],{type:"application/octet-stream"}),"model.weights.bin")}const s=await this.fetch(this.path,t);if(s.ok)return{modelArtifactsInfo:Go(e),responses:[s]};throw new Error(`BrowserHTTPRequest.save() failed due to HTTP response status ${s.status}.`)}async loadModelJSON(){const e=await this.fetch(this.path,this.requestInit);if(!e.ok)throw new Error(`Request to ${this.path} failed with status code ${e.status}. Please verify this URL points to the model JSON of the model to load.`);let t;try{t=await e.json()}catch(e){let t=`Failed to parse model JSON of response from ${this.path}.`;throw this.path.endsWith(".pb")?t+=" Your path contains a .pb file extension. Support for .pb models have been removed in TensorFlow.js 1.0 in favor of .json models. You can re-convert your Python TensorFlow model using the TensorFlow.js 1.0 conversion scripts or you can convert your.pb models with the 'pb2json'NPM script in the tensorflow/tfjs-converter repository.":t+=" Please make sure the server is serving valid JSON for this request.",new Error(t)}const n=t.modelTopology,s=t.weightsManifest;if(null==n&&null==s)throw new Error(`The JSON from HTTP path ${this.path} contains neither model topology or manifest for weights.`);return t}async load(){if(this.loadOptions.streamWeights)return this.loadStream();return Uo(await this.loadModelJSON(),(e=>this.loadWeights(e)))}async loadStream(){const e=await this.loadModelJSON(),t=await this.getWeightUrls(e.weightsManifest),n=qo(e.weightsManifest);return Object.assign(Object.assign({},e),{weightSpecs:n,getWeightStream:()=>function(e,t){var n;const s=null==t.fetchFunc?Sn().platform.fetch:t.fetchFunc;let r,a=0;return null===(n=t.onProgress)||void 0===n||n.call(t,0),new ReadableStream({pull:async n=>{for(var i;at?e.substring(n):"";return[s+"/",r]}(t),r=this.weightPathPrefix||n,a=[],i=[];for(const t of e)for(const e of t.paths)null!=this.weightUrlConverter?i.push(this.weightUrlConverter(e)):a.push(r+e+s);return this.weightUrlConverter&&a.push(...await Promise.all(i)),a}async loadWeights(e){const t=await this.getWeightUrls(e);return[qo(e),await mu(t,this.loadOptions)]}}function wu(e){return null!=e.match(bu.URL_SCHEME_REGEX)}bu.URL_SCHEME_REGEX=/^https?:\/\//;const vu=(e,t)=>{if("undefined"==typeof fetch&&(null==t||null==t.fetchFunc))return null;{let n=!0;if(n=Array.isArray(e)?e.every((e=>wu(e))):wu(e),n)return xu(e,t)}return null};function xu(e,t){return new bu(e,t)}function Au(e,t){return xu(e,t)}jo.registerSaveRouter(vu),jo.registerLoadRouter(vu);class ku{constructor(e){this.modelArtifacts=e}load(){return this.modelArtifacts}}class Cu{constructor(e){this.saveHandler=e}save(e){return this.saveHandler(e)}}class Su{constructor(e){e.load&&(this.load=()=>Promise.resolve(e.load())),e.save&&(this.save=t=>Promise.resolve(e.save(t)))}}function Eu(e,t,n,s){return new Su(_u(...arguments))}function _u(e,t,n,s){if(1===arguments.length){const t=null!=e.modelTopology||null!=e.weightSpecs;return new ku(t?e:{modelTopology:e})}return new ku({modelTopology:e,weightSpecs:t,weightData:n,trainingConfig:s})}function Iu(e){return new Cu(e)}function Tu(e){return new Cu(e)}function Nu(e,t,n){if(Ht(e),null!=t&&3!==t.length)throw new Error("tensor3d() requires shape to have three numbers");const s=oo(e,n);if(3!==s.length&&1!==s.length)throw new Error("tensor3d() requires values to be number[][][] or flat/TypedArray");if(1===s.length&&null==t)throw new Error("tensor3d() requires shape to be provided when `values` are a flat array");return go(e,t,s,n)}let Ou,Ru=!1;function Du(e,t=3){if(t>4)throw new Error("Cannot construct Tensor with more than 4 channels from pixels.");if(null==e)throw new Error("pixels passed to tf.browser.fromPixels() can not be null");let n=!1,s=!1,r=!1,a=!1,i=!1,o=!1;if(e.data instanceof Uint8Array)n=!0;else if("undefined"!=typeof ImageData&&e instanceof ImageData)s=!0;else if("undefined"!=typeof HTMLVideoElement&&e instanceof HTMLVideoElement)r=!0;else if("undefined"!=typeof HTMLImageElement&&e instanceof HTMLImageElement)a=!0;else if(null!=e.getContext)i=!0;else{if(!("undefined"!=typeof ImageBitmap&&e instanceof ImageBitmap))throw new Error(`pixels passed to tf.browser.fromPixels() must be either an HTMLVideoElement, HTMLImageElement, HTMLCanvasElement, ImageData in browser, or OffscreenCanvas, ImageData in webworker or {data: Uint32Array, width: number, height: number}, but was ${e.constructor.name}`);o=!0}if(null!=ja(Ba,to.backendName)){const n={pixels:e},s={numChannels:t};return to.runKernel(Ba,n,s)}const[l,u]=r?[e.videoWidth,e.videoHeight]:[e.width,e.height];let c,h;if(i)c=e.getContext("2d").getImageData(0,0,l,u).data;else if(s||n)c=e.data;else if(a||r||o){if(null==Ou)if("undefined"==typeof document){if("undefined"==typeof OffscreenCanvas||"undefined"==typeof OffscreenCanvasRenderingContext2D)throw new Error("Cannot parse input in current context. Reason: OffscreenCanvas Context2D rendering is not supported.");Ou=new OffscreenCanvas(1,1).getContext("2d")}else Ou=document.createElement("canvas").getContext("2d",{willReadFrequently:!0});Ou.canvas.width=l,Ou.canvas.height=u,Ou.drawImage(e,0,0,l,u),c=Ou.getImageData(0,0,l,u).data}if(4===t)h=new Int32Array(c);else{const e=l*u;h=new Int32Array(e*t);for(let n=0;n4||2===t)throw new Error(`toPixels only supports depth of size 1, 3 or 4 but got ${t}`);if("float32"!==e.dtype&&"int32"!==e.dtype)throw new Error(`Unsupported type for toPixels: ${e.dtype}. Please use float32 or int32 tensors.`)}async function Fu(e,t){let n=co(e,"img","toPixels");if(!(e instanceof Mi)){const e=n;n=Nl(e,"int32"),e.dispose()}Mu(n);const[s,r]=n.shape.slice(0,2),a=2===n.rank?1:n.shape[2],i=await n.data(),o="float32"===n.dtype?255:1,l=new Uint8ClampedArray(r*s*4);for(let e=0;e1)throw new Error(`Tensor values for a float32 Tensor must be in the range [0 - 1] but encountered ${r}.`)}else if("int32"===n.dtype&&(r<0||r>255))throw new Error(`Tensor values for a int32 Tensor must be in the range [0 - 255] but encountered ${r}.`);1===a?(t[0]=r*o,t[1]=r*o,t[2]=r*o):t[s]=r*o}const s=4*e;l[s+0]=Math.round(t[0]),l[s+1]=Math.round(t[1]),l[s+2]=Math.round(t[2]),l[s+3]=Math.round(t[3])}if(null!=t){if(!Ru){null!=ja(Ss,to.backendName)&&(Ru=!0)}t.width=r,t.height=s;const e=t.getContext("2d"),n=new ImageData(l,r,s);e.putImageData(n,0,0)}return n!==e&&n.dispose(),l}const Bu=fo({fromPixels_:Du}),zu=-2,Lu=-1;function Pu(e,t,n){const s=e.shape.length;qt(s===t.length,(()=>`Error in slice${s}D: Length of begin ${t} must match the rank of the array (${s}).`)),qt(s===n.length,(()=>`Error in slice${s}D: Length of size ${n} must match the rank of the array (${s}).`));for(let r=0;r`Error in slice${s}D: begin[${r}] + size[${r}] (${t[r]+n[r]}) would overflow input.shape[${r}] (${e.shape[r]})`))}function Vu(e){const t=[];let n=0;for(;e>0;)1&e&&t.push(n),e/=2,n++;return t}function Wu(e,t,n){const s=[];for(let r=0;r0){const l=t[0],u=n+1;c=Hu(i,l,u,s,e),h=$u(o,l,u,r,e),d=Uu(a,l,u,e)}else for(let t=0;t-1)a[r]=0;else{const i=Gu(t,n,r);let o=s[i];e&1<-1)a[r]=Number.MAX_SAFE_INTEGER;else{const i=Gu(t,n,r);let o=s[i];e&1<0?Number.MIN_SAFE_INTEGER:Number.MAX_SAFE_INTEGER);const l=s[r];return i<0&&(i+=l),i=Wt(0,i,l-1),i}function Zu(e,t,n,s,r,a){let i=t[r];const o=n[r]||1;(e&1<0?Number.MAX_SAFE_INTEGER:Number.MIN_SAFE_INTEGER);const l=s[r];return i<0&&(i+=l),i=o>0?Wt(0,i,l):Wt(-1,i,l-1),i}function Yu(e,t,n){let s=n.length;for(let e=0;e1){s=e;break}for(let r=s+1;r0||n[r]!==e[r])return!1;return!0}function Qu(e,t){let n=e.length>0?e[e.length-1]:1;for(let s=0;s{qt(-1!==e,(()=>"slice() does not support negative begin indexing."))})),a=null==n?new Array(r).fill(-1):"number"==typeof n?[n,...new Array(r-1).fill(-1)]:n.lengtht>=0?t:(qt(-1===t,(()=>`Negative size values should be exactly -1 but got ${t} for the slice() size at index ${n}.`)),e.shape[n]-s[n]))),[s,a]}function ec(e,t,n,s,r,a,i,o,l){let u;if(null==s?(u=new Array(t.length),u.fill(1)):u=s,null!=i&&i&i-1)throw new Error("Multiple ellipses in slice is not allowed.");let c=!1;const h={dims:u.length,numAddAxisAfterEllipsis:0,begin:t.slice(),end:n.slice(),strides:u.slice(),beginMask:r,endMask:a,ellipsisMask:i,newAxisMask:o,shrinkAxisMask:l};for(let e=0;e0?0:-1,d.strides[t]>0?s:s-1];if(n&&d.strides[t]<=0)throw Error("only stride 1 allowed on non-range indexing.");m=m&&1===d.strides[t];const i=!!(d.beginMask&1<=s)throw Error(`slice index ${d.begin[t]} of dimension ${t} out of bounds.`)}else d.begin[t]=tc(d.begin[t],0,d.strides[t],s,r,a),d.end[t]=tc(d.end[t],1,d.strides[t],s,r,a);const e=1===d.strides[t]&&0===d.begin[t]&&d.end[t]===s;p=p&&e,f=f&&(0===t&&1===d.strides[t]||e)}else p=p&&1===d.strides[t]&&i,f=f&&(0===t&&1===d.strides[t]||i);let o,l=!1;if(d.beginValid&&d.endValid?(o=d.end[t]-d.begin[t],l=!0):n?(o=1,l=!0):i&&s>=0&&(o=d.strides[t]<0?-s:s,l=!0),l){let e;e=0===o||o<0!=d.strides[t]<0?0:Math.trunc(o/d.strides[t])+(o%d.strides[t]!=0?1:0),g.push(e)}else g.push(-1)}for(let e=0;e=0?y.push(g[t]):t===zu&&y.push(1)}return{finalShapeSparse:y.filter(((e,t)=>d.finalShapeGatherIndices[t]!==zu)),finalShape:y,isIdentity:p,sliceDim0:f,isSimpleSlice:m,begin:d.begin,end:d.end,strides:d.strides}}function tc(e,t,n,s,r,a){if(r[t])return n>0?a[t]:a[t+1&1];{const t=e<0?s+e:e;return ta[1]?a[1]:t}}const nc=fo({acos_:function(e){const t={x:co(e,"x","acos")};return to.runKernel(On,t)}});const sc=fo({acosh_:function(e){const t={x:co(e,"x","acosh")};return to.runKernel(Rn,t)}});const rc=fo({addN_:function(e){qt(Array.isArray(e),(()=>"The argument passed to tf.addN() must be a list of tensors")),qt(e.length>=1,(()=>`Must pass at least one tensor to tf.addN(), but got ${e.length}`));const t=e.map(((e,t)=>co(e,`tensors${t}`,"addN"))),n=t[0];t.forEach((e=>{if(e.dtype!==n.dtype)throw new Error("All tensors passed to tf.addN() must have the same dtype")})),t.forEach((e=>{if(!Kt(e.shape,n.shape))throw new Error("All tensors passed to tf.addN() must have the same shape")}));const s=t;return to.runKernel(Mn,s)}});const ac=fo({all_:function(e,t=null,n=!1){const s={x:co(e,"x","all","bool")},r={axis:t,keepDims:n};return to.runKernel(Fn,s,r)}});const ic=fo({any_:function(e,t=null,n=!1){const s={x:co(e,"x","any","bool")},r={axis:t,keepDims:n};return to.runKernel(Bn,s,r)}});const oc=fo({argMax_:function(e,t=0){const n={x:co(e,"x","argMax")},s={axis:t};return to.runKernel(zn,n,s)}});const lc=fo({argMin_:function(e,t=0){const n={x:co(e,"x","argMin")},s={axis:t};return to.runKernel(Ln,n,s)}});const uc=fo({asin_:function(e){const t={x:co(e,"x","asin")};return to.runKernel(Pn,t)}});const cc=fo({asinh_:function(e){const t={x:co(e,"x","asinh")};return to.runKernel(Vn,t)}});const hc=fo({atan_:function(e){const t={x:co(e,"x","atan")};return to.runKernel(Wn,t)}});const dc=fo({atan2_:function(e,t){let n=co(e,"a","atan2"),s=co(t,"b","atan2");[n,s]=$i(n,s);const r={a:n,b:s};return to.runKernel(Gn,r)}});const pc=fo({atanh_:function(e){const t={x:co(e,"x","atanh")};return to.runKernel(Un,t)}});function fc(e,t,n,s,r="NHWC",a){return yc(e,[...t,e[3]],n,a,s,null,null,_c(r))}function mc(e,t,n,s,r,a,i="channelsLast"){const[o,l]=vc(t);let u;if("channelsLast"===i)u=[o,l,e[3],e[3]];else{if("channelsFirst"!==i)throw new Error(`Unknown dataFormat ${i}`);u=[o,l,e[1],e[1]]}return yc(e,u,n,s,r,a,!1,i)}function gc(e,t,n,s,r,a,i="NDHWC"){const[o,l,u]=xc(t);let c,h;if("NDHWC"===i)h="channelsLast",c=[o,l,u,e[4],e[4]];else{if("NCDHW"!==i)throw new Error(`Unknown dataFormat ${i}`);h="channelsFirst",c=[o,l,u,e[1],e[1]]}return bc(e,c,n,s,r,!1,h,a)}function yc(e,t,n,s,r,a,i=!1,o="channelsLast"){let[l,u,c,h]=[-1,-1,-1,-1];if("channelsLast"===o)[l,u,c,h]=e;else{if("channelsFirst"!==o)throw new Error(`Unknown dataFormat ${o}`);[l,h,u,c]=e}const[d,p,,f]=t,[m,g]=vc(n),[y,b]=vc(s),w=Ac(d,y),v=Ac(p,b),{padInfo:x,outHeight:A,outWidth:k}=function(e,t,n,s,r,a,i,o,l){let u,c,h;if("number"==typeof e){u={top:e,bottom:e,left:e,right:e,type:0===e?"VALID":"NUMBER"};const r=function(e,t,n,s,r){null==s&&(s=wc(e,t,n));const a=e[0],i=e[1],o=kc((a-t+2*s)/n+1,r),l=kc((i-t+2*s)/n+1,r);return[o,l]}([t,n],a,s,e,o);c=r[0],h=r[1]}else if("same"===e){c=Math.ceil(t/s),h=Math.ceil(n/r);const e=Math.max(0,(c-1)*s+a-t),o=Math.max(0,(h-1)*r+i-n),l=Math.floor(e/2),d=e-l,p=Math.floor(o/2);u={top:l,bottom:d,left:p,right:o-p,type:"SAME"}}else if("valid"===e)u={top:0,bottom:0,left:0,right:0,type:"VALID"},c=Math.ceil((t-a+1)/s),h=Math.ceil((n-i+1)/r);else{if("object"!=typeof e)throw Error(`Unknown padding parameter: ${e}`);{const d="channelsLast"===l?e[1][0]:e[2][0],p="channelsLast"===l?e[1][1]:e[2][1],f="channelsLast"===l?e[2][0]:e[3][0],m="channelsLast"===l?e[2][1]:e[3][1];u={top:d,bottom:p,left:f,right:m,type:0===d&&0===p&&0===f&&0===m?"VALID":"EXPLICIT"},c=kc((t-a+d+p)/s+1,o),h=kc((n-i+f+m)/r+1,o)}}return{padInfo:u,outHeight:c,outWidth:h}}(r,u,c,m,g,w,v,a,o),C=i?f*h:f;let S;return"channelsFirst"===o?S=[l,C,A,k]:"channelsLast"===o&&(S=[l,A,k,C]),{batchSize:l,dataFormat:o,inHeight:u,inWidth:c,inChannels:h,outHeight:A,outWidth:k,outChannels:C,padInfo:x,strideHeight:m,strideWidth:g,filterHeight:d,filterWidth:p,effectiveFilterHeight:w,effectiveFilterWidth:v,dilationHeight:y,dilationWidth:b,inShape:e,outShape:S,filterShape:t}}function bc(e,t,n,s,r,a=!1,i="channelsLast",o){let[l,u,c,h,d]=[-1,-1,-1,-1,-1];if("channelsLast"===i)[l,u,c,h,d]=e;else{if("channelsFirst"!==i)throw new Error(`Unknown dataFormat ${i}`);[l,d,u,c,h]=e}const[p,f,m,,g]=t,[y,b,w]=xc(n),[v,x,A]=xc(s),k=Ac(p,v),C=Ac(f,x),S=Ac(m,A),{padInfo:E,outDepth:_,outHeight:I,outWidth:T}=function(e,t,n,s,r,a,i,o,l,u,c){let h,d,p,f;"valid"===e&&(e=0);if("number"==typeof e){h={top:e,bottom:e,left:e,right:e,front:e,back:e,type:0===e?"VALID":"NUMBER"};const m=function(e,t,n,s,r,a){null==r&&(r=wc(e,t[0],s[0]));const i=[0,0,0,n];for(let n=0;n<3;n++)e[n]+2*r>=t[n]&&(i[n]=kc((e[n]-t[n]+2*r)/s[n]+1,a));return i}([t,n,s,1],[o,l,u],1,[r,a,i],e,c);d=m[0],p=m[1],f=m[2]}else{if("same"!==e)throw Error(`Unknown padding parameter: ${e}`);{d=Math.ceil(t/r),p=Math.ceil(n/a),f=Math.ceil(s/i);const e=(d-1)*r+o-t,c=(p-1)*a+l-n,m=(f-1)*i+u-s,g=Math.floor(e/2),y=e-g,b=Math.floor(c/2),w=c-b,v=Math.floor(m/2);h={top:b,bottom:w,left:v,right:m-v,front:g,back:y,type:"SAME"}}}return{padInfo:h,outDepth:d,outHeight:p,outWidth:f}}(r,u,c,h,y,b,w,k,C,S,o),N=a?g*d:g;let O;return"channelsFirst"===i?O=[l,N,_,I,T]:"channelsLast"===i&&(O=[l,_,I,T,N]),{batchSize:l,dataFormat:i,inDepth:u,inHeight:c,inWidth:h,inChannels:d,outDepth:_,outHeight:I,outWidth:T,outChannels:N,padInfo:E,strideDepth:y,strideHeight:b,strideWidth:w,filterDepth:p,filterHeight:f,filterWidth:m,effectiveFilterDepth:k,effectiveFilterHeight:C,effectiveFilterWidth:S,dilationDepth:v,dilationHeight:x,dilationWidth:A,inShape:e,outShape:O,filterShape:t}}function wc(e,t,n,s=1){const r=Ac(t,s);return Math.floor((e[0]*(n-1)-n+r)/2)}function vc(e){return"number"==typeof e?[e,e,e]:2===e.length?[e[0],e[1],1]:e}function xc(e){return"number"==typeof e?[e,e,e]:e}function Ac(e,t){return t<=1?e:e+(e-1)*(t-1)}function kc(e,t){if(!t)return Math.trunc(e);switch(t){case"round":return Math.round(e);case"ceil":return Math.ceil(e);case"floor":return Math.floor(e);default:throw new Error(`Unknown roundingMode ${t}`)}}function Cc(e){const[t,n,s]=vc(e);return 1===t&&1===n&&1===s}function Sc(e,t){return Cc(e)||Cc(t)}function Ec(e){return vc(e).every((e=>e>0))}function _c(e){if("NHWC"===e)return"channelsLast";if("NCHW"===e)return"channelsFirst";throw new Error(`Unknown dataFormat ${e}`)}function Ic(e,t,n){if(null!=n){if("string"==typeof t)throw Error(`Error in ${e}: pad must be an integer when using dimRoundingMode ${n} but got pad ${t}.`);if("number"==typeof t)qt(Xt(t),(()=>`Error in ${e}: pad must be an integer when using dimRoundingMode ${n} but got pad ${t}.`));else{if("object"!=typeof t)throw Error(`Error in ${e}: Unknown padding parameter: ${t}`);t.forEach((t=>{t.forEach((t=>{qt(Xt(t),(()=>`Error in ${e}: pad must be an integer when using dimRoundingMode ${n} but got pad ${t}.`))}))}))}}}const Tc=fo({reshape_:function(e,t){const n={x:co(e,"x","reshape","string_or_numeric")},s={shape:t};return to.runKernel(Wr,n,s)}});const Nc=fo({avgPool_:function(e,t,n,s,r){const a=co(e,"x","avgPool","float32");qt(Sc(n,1),(()=>`Error in avgPool: Either strides or dilations must be 1. Got strides ${n} and dilations '1'`));let i=a,o=!1;3===a.rank&&(o=!0,i=Tc(a,[1,a.shape[0],a.shape[1],a.shape[2]])),qt(4===i.rank,(()=>`Error in avgPool: x must be rank 4 but got rank ${i.rank}.`)),Ic("avgPool",s,r);const l={x:i},u={filterSize:t,strides:n,pad:s,dimRoundingMode:r};let c=to.runKernel(qn,l,u);return c=Nl(c,a.dtype),o?Tc(c,[c.shape[1],c.shape[2],c.shape[3]]):c}});const Oc=fo({avgPool3d_:function(e,t,n,s,r,a="NDHWC"){const i=co(e,"x","avgPool3d","float32");let o=i,l=!1;4===i.rank&&(l=!0,o=Tc(i,[1,i.shape[0],i.shape[1],i.shape[2],i.shape[3]])),qt(5===o.rank,(()=>`Error in avgPool3d: x must be rank 5 but got rank ${o.rank}.`)),qt("NDHWC"===a,(()=>`Error in avgPool3d: Only NDHWC is currently supported, but got dataFormat of ${a}`)),qt("number"==typeof n&&n>0||Array.isArray(n)&&n[0]>0&&n[1]>0&&n[2]>0,(()=>`Error in avgPool3d: Stride must be > 0, but got '${n}'`)),Ic("avgPool3d",s,r);const u={x:o},c={filterSize:t,strides:n,pad:s,dimRoundingMode:r,dataFormat:a};let h=to.runKernel(Hn,u,c);return h=Nl(h,o.dtype),l?Tc(h,[h.shape[1],h.shape[2],h.shape[3],h.shape[4]]):h}});const Rc=fo({concat_:function(e,t=0){qt(e.length>=1,(()=>"Pass at least one tensor to concat"));const n=ho(e,"tensors","concat","string_or_numeric");if("complex64"===n[0].dtype&&n.forEach((e=>{if("complex64"!==e.dtype)throw new Error(`Cannot concatenate complex64 tensors with a tensor\n with dtype ${e.dtype}. `)})),1===n.length)return Ol(n[0]);const s=n,r={axis:t};return to.runKernel(rs,s,r)}});const Dc=fo({matMul_:function(e,t,n=!1,s=!1){let r=co(e,"a","matMul"),a=co(t,"b","matMul");[r,a]=$i(r,a);const i={a:r,b:a},o={transposeA:n,transposeB:s};return to.runKernel(Kn,i,o)}});const Mc=fo({sigmoid_:function(e){const t={x:co(e,"x","sigmoid","float32")};return to.runKernel(aa,t)}});const Fc=fo({slice_:function(e,t,n){const s=co(e,"x","slice","string_or_numeric");if(0===s.rank)throw new Error("Slicing scalar is not possible");const r={x:s},a={begin:t,size:n};return to.runKernel(ta,r,a)}});const Bc=fo({tanh_:function(e){const t={x:co(e,"x","tanh","float32")};return to.runKernel(Ea,t)}});const zc=fo({basicLSTMCell_:function(e,t,n,s,r,a){const i=co(e,"forgetBias","basicLSTMCell"),o=co(t,"lstmKernel","basicLSTMCell"),l=co(n,"lstmBias","basicLSTMCell"),u=co(s,"data","basicLSTMCell"),c=co(r,"c","basicLSTMCell"),h=co(a,"h","basicLSTMCell"),d=Rc([u,h],1),p=Dc(d,o),f=Dl(p,l),m=f.shape[0],g=f.shape[1]/4,y=[m,g],b=Fc(f,[0,0],y),w=Fc(f,[0,g],y),v=Fc(f,[0,2*g],y),x=Fc(f,[0,3*g],y),A=Dl(Bl(Mc(b),Bc(w)),Bl(c,Mc(Dl(i,v))));return[A,Bl(Bc(A),Mc(x))]}});const Lc=fo({batchToSpaceND_:function(e,t,n){const s=co(e,"x","batchToSpaceND"),r=t.reduce(((e,t)=>e*t));qt(s.rank>=1+t.length,(()=>`input rank is ${s.rank} but should be > than blockShape.length ${t.length}`)),qt(n.length===t.length,(()=>`crops.length is ${n.length} but should be equal to blockShape.length ${t.length}`)),qt(s.shape[0]%r==0,(()=>`input tensor batch is ${s.shape[0]} but is not divisible by the product of the elements of blockShape ${t.join(" * ")} === ${r}`));const a={x:s},i={blockShape:t,crops:n};return to.runKernel(Xn,a,i)}});const Pc=fo({batchNorm_:function(e,t,n,s,r,a){null==a&&(a=.001);const i=co(e,"x","batchNorm"),o=co(t,"mean","batchNorm"),l=co(n,"variance","batchNorm");let u,c;null!=r&&(u=co(r,"scale","batchNorm")),null!=s&&(c=co(s,"offset","batchNorm")),qt(o.rank===l.rank,(()=>"Batch normalization gradient requires mean and variance to have equal ranks.")),qt(null==c||o.rank===c.rank,(()=>"Batch normalization gradient requires mean and offset to have equal ranks.")),qt(null==u||o.rank===u.rank,(()=>"Batch normalization gradient requires mean and scale to have equal ranks."));const h={x:function(e){let t;return t=0===e.rank||1===e.rank?Tc(e,[1,1,1,e.size]):2===e.rank?Tc(e,[1,1,e.shape[0],e.shape[1]]):3===e.rank?Tc(e,[1,e.shape[0],e.shape[1],e.shape[2]]):e,t}(i),scale:u,offset:c,mean:o,variance:l},d={varianceEpsilon:a},p=to.runKernel(Vs,h,d);return Tc(p,i.shape)}});const Vc=fo({batchNorm2d_:function(e,t,n,s,r,a){const i=co(e,"x","batchNorm"),o=co(t,"mean","batchNorm"),l=co(n,"variance","batchNorm");let u,c;return null!=r&&(u=co(r,"scale","batchNorm")),null!=s&&(c=co(s,"offset","batchNorm")),qt(2===i.rank,(()=>`Error in batchNorm2D: x must be rank 2 but got rank ${i.rank}.`)),qt(2===o.rank||1===o.rank,(()=>`Error in batchNorm2D: mean must be rank 2 or rank 1 but got rank ${o.rank}.`)),qt(2===l.rank||1===l.rank,(()=>`Error in batchNorm2D: variance must be rank 2 or rank 1 but got rank ${l.rank}.`)),null!=u&&qt(2===u.rank||1===u.rank,(()=>`Error in batchNorm2D: scale must be rank 2 or rank 1 but got rank ${u.rank}.`)),null!=c&&qt(2===c.rank||1===c.rank,(()=>`Error in batchNorm2D: offset must be rank 2 or rank 1 but got rank ${c.rank}.`)),Pc(i,o,l,c,u,a)}});const Wc=fo({batchNorm3d_:function(e,t,n,s,r,a){const i=co(e,"x","batchNorm"),o=co(t,"mean","batchNorm"),l=co(n,"variance","batchNorm");let u,c;return null!=r&&(u=co(r,"scale","batchNorm")),null!=s&&(c=co(s,"offset","batchNorm")),qt(3===i.rank,(()=>`Error in batchNorm3D: x must be rank 3 but got rank ${i.rank}.`)),qt(3===o.rank||1===o.rank,(()=>`Error in batchNorm3D: mean must be rank 3 or rank 1 but got rank ${o.rank}.`)),qt(3===l.rank||1===l.rank,(()=>`Error in batchNorm3D: variance must be rank 3 or rank 1 but got rank ${l.rank}.`)),null!=u&&qt(3===u.rank||1===u.rank,(()=>`Error in batchNorm3D: scale must be rank 3 or rank 1 but got rank ${u.rank}.`)),null!=c&&qt(3===c.rank||1===c.rank,(()=>`Error in batchNorm3D: offset must be rank 3 or rank 1 but got rank ${c.rank}.`)),Pc(i,o,l,c,u,a)}});const Uc=fo({batchNorm4d_:function(e,t,n,s,r,a){const i=co(e,"x","batchNorm"),o=co(t,"mean","batchNorm"),l=co(n,"variance","batchNorm");let u,c;return null!=r&&(u=co(r,"scale","batchNorm")),null!=s&&(c=co(s,"offset","batchNorm")),qt(4===i.rank,(()=>`Error in batchNorm4D: x must be rank 4 but got rank ${i.rank}.`)),qt(4===o.rank||1===o.rank,(()=>`Error in batchNorm4D: mean must be rank 4 or rank 1 but got rank ${o.rank}.`)),qt(4===l.rank||1===l.rank,(()=>`Error in batchNorm4D: variance must be rank 4 or rank 1 but got rank ${l.rank}.`)),null!=u&&qt(4===u.rank||1===u.rank,(()=>`Error in batchNorm4D: scale must be rank 4 or rank 1 but got rank ${u.rank}.`)),null!=c&&qt(4===c.rank||1===c.rank,(()=>`Error in batchNorm4D: offset must be rank 4 or rank 1 but got rank ${c.rank}.`)),Pc(i,o,l,c,u,a)}});const Gc=fo({bincount_:function(e,t,n){const s=co(e,"x","bincount"),r=co(t,"weights","bincount");qt("int32"===s.dtype,(()=>`Error in bincount: input dtype must be int32, but got ${s.dtype}`)),qt(n>=0,(()=>`size must be non-negative, but got ${n}.`)),qt(r.size===s.size||0===r.size,(()=>`Error in bincount: weights must have the same size as input or0-length, but got input shape: ${s.shape}, weights shape: ${r.shape}.`));const a={x:s,weights:r},i={size:n};return to.runKernel(Zn,a,i)}});const qc=fo({bitwiseAnd_:function(e,t){const n=co(e,"x","bitwiseAnd"),s=co(t,"y","bitwiseAnd");if(!Kt(n.shape,s.shape))throw new Error(`BitwiseAnd: Tensors must have the same shape. x: ${n.shape}, y: ${s.shape}`);if("int32"!==n.dtype||"int32"!==s.dtype)throw new Error(`BitwiseAnd: Only supports 'int32' values in tensor, found type of x: ${n.dtype} and type of y: ${s.dtype}`);const r={a:n,b:s};return to.runKernel(Yn,r)}});const jc=fo({broadcastArgs_:function(e,t){const n=co(e,"s0","broadcastArgs","int32"),s=co(t,"s1","broadcastArgs","int32");if(1!==n.rank)throw new Error(`broadcastArgs(): first input must be a vector (rank=1). Has rank ${n.rank}`);if(1!==s.rank)throw new Error(`broadcastArgs(): second input must be a vector (rank=1). Has rank ${s.rank}`);const r={s0:n,s1:s};return to.runKernel(Qn,r)}});const Hc=fo({broadcastTo_:function(e,t){let n=co(e,"broadcastTo","x");const s=n.shape;if(bn(t),t.lengthn.rank){const e=n.shape.slice();for(;e.length=0;e--)if(r[e]===t[e])a[e]=1;else if(1!==n.shape[e])throw new Error(`broadcastTo(): [${s}] cannot be broadcast to [${t}].`);if(0===a.map(((e,t)=>e>1?t:-1)).filter((e=>e>=0)).length)return Ol(n);const i={x:n},o={reps:a};return to.runKernel(_a,i,o)}});const $c=fo({ceil_:function(e){const t={x:co(e,"x","ceil","float32")};return to.runKernel(es,t)}});const Kc=fo({clipByValue_:function(e,t,n){const s=co(e,"x","clipByValue");if(qt(t<=n,(()=>`Error in clip: min (${t}) must be less than or equal to max (${n}).`)),t===n)return Xl(s.shape,t,s.dtype);const r={x:s},a={clipValueMin:t,clipValueMax:n};return to.runKernel(ts,r,a)}});const Xc=fo({concat1d_:function(e){return Rc(e,0)}});const Zc=fo({concat2d_:function(e,t){return Rc(e,t)}});const Yc=fo({concat3d_:function(e,t){return Rc(e,t)}});const Qc=fo({concat4d_:function(e,t){return Rc(e,t)}});const Jc=fo({conv2d_:function(e,t,n,s,r="NHWC",a=[1,1],i){const o=co(e,"x","conv2d","float32"),l=co(t,"filter","conv2d","float32");let u=o,c=!1;3===o.rank&&(c=!0,u=Tc(o,[1,o.shape[0],o.shape[1],o.shape[2]])),qt(4===u.rank,(()=>`Error in conv2d: input must be rank 4, but got rank ${u.rank}.`)),qt(4===l.rank,(()=>`Error in conv2d: filter must be rank 4, but got rank ${l.rank}.`)),Ic("conv2d",s,i);const h="NHWC"===r?u.shape[3]:u.shape[1];qt(h===l.shape[2],(()=>`Error in conv2d: depth of input (${h}) must match input depth for filter ${l.shape[2]}.`)),qt(Sc(n,a),(()=>`Error in conv2D: Either strides or dilations must be 1. Got strides ${n} and dilations '${a}'`)),qt(Ec(a),(()=>"Error in conv2D: Dilated rates should be larger than 0.")),qt(Ec(n),(()=>"Error in conv2D: Strides should be larger than 0."));const d={x:u,filter:l},p={strides:n,pad:s,dataFormat:r,dilations:a,dimRoundingMode:i},f=to.runKernel(as,d,p);return c?Tc(f,[f.shape[1],f.shape[2],f.shape[3]]):f}});const eh=fo({conv1d_:function(e,t,n,s,r="NWC",a=1,i){const o=co(e,"x","conv1d"),l=co(t,"filter","conv1d");let u=o,c=!1;2===o.rank&&(c=!0,u=Tc(o,[1,o.shape[0],o.shape[1]])),qt(3===u.rank,(()=>`Error in conv1d: input must be rank 3, but got rank ${u.rank}.`)),qt(3===l.rank,(()=>`Error in conv1d: filter must be rank 3, but got rank ${l.rank}.`)),Ic("conv1d",s,i),qt(u.shape[2]===l.shape[1],(()=>`Error in conv1d: depth of input (${u.shape[2]}) must match input depth for filter ${l.shape[1]}.`)),qt(Sc(n,a),(()=>`Error in conv1D: Either stride or dilation must be 1. Got stride ${n} and dilation '${a}'`)),qt(Ec(a),(()=>"Error in conv1D: Dilated rates should be larger than 0.")),qt(Ec(n),(()=>"Error in conv1D: Stride should be larger than 0.")),qt("NWC"===r,(()=>`Error in conv1d: got dataFormat of ${r} but only NWC is currently supported.`));const h=Tc(l,[1,l.shape[0],l.shape[1],l.shape[2]]),d=Tc(u,[u.shape[0],1,u.shape[1],u.shape[2]]),p=Jc(d,h,[1,n],s,"NHWC",[1,a],i);return Tc(p,c?[p.shape[2],p.shape[3]]:[p.shape[0],p.shape[2],p.shape[3]])}});const th=fo({conv2DBackpropInput_:function(e,t,n,s,r,a="NHWC",i){qt(e.length===t.rank,(()=>`Length of inShape (${e.length}) and rank of dy (${t.rank}) must match`));let o=e,l=t,u=!1;3===t.rank&&(u=!0,l=Tc(t,[1,t.shape[0],t.shape[1],t.shape[2]]),o=[1,e[0],e[1],e[2]]),qt(4===o.length,(()=>`Error in conv2dDerInput: inShape must be length 4, but got length ${o.length}.`)),qt(4===l.rank,(()=>`Error in conv2dDerInput: dy must be rank 4, but got rank ${l.rank}`)),qt(4===n.rank,(()=>`Error in conv2dDerInput: filter must be rank 4, but got rank ${n.rank}`));const c="NHWC"===a?o[3]:o[1],h="NHWC"===a?l.shape[3]:l.shape[1];qt(c===n.shape[2],(()=>`Error in conv2dDerInput: depth of input (${c}) must match input depth for filter ${n.shape[2]}.`)),qt(h===n.shape[3],(()=>`Error in conv2dDerInput: depth of output (${h}) must match output depth for filter ${n.shape[3]}.`)),Ic("conv2dDerInput",r,i);const d={dy:l,filter:n},p={strides:s,pad:r,dataFormat:a,dimRoundingMode:i,inputShape:o},f=to.runKernel(os,d,p);return u?Tc(f,[f.shape[1],f.shape[2],f.shape[3]]):f}});const nh=fo({conv2dTranspose_:function(e,t,n,s,r,a){const i=co(e,"x","conv2dTranspose"),o=co(t,"filter","conv2dTranspose");return th(n,i,o,s,r,"NHWC",a)}});const sh=fo({conv3d_:function(e,t,n,s,r="NDHWC",a=[1,1,1]){const i=co(e,"x","conv3d"),o=co(t,"filter","conv3d");let l=i,u=!1;4===i.rank&&(u=!0,l=Tc(i,[1,i.shape[0],i.shape[1],i.shape[2],i.shape[3]])),qt(5===l.rank,(()=>`Error in conv3d: input must be rank 5, but got rank ${l.rank}.`)),qt(5===o.rank,(()=>`Error in conv3d: filter must be rank 5, but got rank ${o.rank}.`)),qt(l.shape[4]===o.shape[3],(()=>`Error in conv3d: depth of input (${l.shape[4]}) must match input depth for filter ${o.shape[3]}.`)),qt(Sc(n,a),(()=>`Error in conv3D: Either strides or dilations must be 1. Got strides ${n} and dilations '${a}'`)),qt("NDHWC"===r,(()=>`Error in conv3d: got dataFormat of ${r} but only NDHWC is currently supported.`)),qt(Ec(a),(()=>"Error in conv3D: Dilated rates should be larger than 0.")),qt(Ec(n),(()=>"Error in conv3D: Strides should be larger than 0."));const c={x:l,filter:o},h={strides:n,pad:s,dataFormat:r,dilations:a},d=to.runKernel(ls,c,h);return u?Tc(d,[d.shape[1],d.shape[2],d.shape[3],d.shape[4]]):d}});const rh=fo({conv3DBackpropInput_:function(e,t,n,s,r){qt(e.length===t.rank,(()=>`Length of inShape (${e.length}) and rank of dy (${t.rank}) must match`));let a=e,i=t,o=!1;4===t.rank&&(o=!0,i=Tc(t,[1,t.shape[0],t.shape[1],t.shape[2],t.shape[3]]),a=[1,e[0],e[1],e[2],e[3]]);const l=a[4],u=i.shape[4];qt(5===a.length,(()=>`Error in conv3dDerInput: inShape must be length 5, but got length ${a.length}.`)),qt(5===i.rank,(()=>`Error in conv3dDerInput: dy must be rank 5, but got rank ${i.rank}`)),qt(5===n.rank,(()=>`Error in conv3dDerInput: filter must be rank 5, but got rank ${n.rank}`)),qt(l===n.shape[3],(()=>`Error in conv3dDerInput: depth of input (${l}) must match input depth for filter ${n.shape[3]}.`)),qt(u===n.shape[4],(()=>`Error in conv3dDerInput: depth of output (${u}) must match output depth for filter ${n.shape[4]}.`));const c={dy:i,filter:n},h={pad:r,strides:s,inputShape:a},d=to.runKernel(cs,c,h);return o?Tc(d,[d.shape[1],d.shape[2],d.shape[3],d.shape[4]]):d}});const ah=fo({conv3dTranspose_:function(e,t,n,s,r){const a=co(e,"x","conv3dTranspose"),i=co(t,"filter","conv3dTranspose");return rh(n,a,i,s,r)}});const ih=fo({cos_:function(e){const t={x:co(e,"x","cos","float32")};return to.runKernel(hs,t)}});const oh=fo({cosh_:function(e){const t={x:co(e,"x","cosh","float32")};return to.runKernel(ds,t)}});const lh=fo({cumprod_:function(e,t=0,n=!1,s=!1){const r={x:co(e,"x","cumprod")},a={axis:t,exclusive:n,reverse:s};return to.runKernel(ps,r,a)}});const uh=fo({cumsum_:function(e,t=0,n=!1,s=!1){const r={x:co(e,"x","cumsum")},a={axis:t,exclusive:n,reverse:s};return to.runKernel(fs,r,a)}});const ch=fo({denseBincount_:function(e,t,n,s=!1){const r=co(e,"x","denseBincount"),a=co(t,"weights","denseBincount");qt("int32"===r.dtype,(()=>`Error in denseBincount: input dtype must be int32, but got ${r.dtype}`)),qt(r.rank<=2,(()=>`Error in denseBincount: input must be at most rank 2, but got rank ${r.rank}.`)),qt(n>=0,(()=>`size must be non-negative, but got ${n}.`)),qt(a.size===r.size||0===a.size,(()=>`Error in denseBincount: weights must have the same shape as x or 0-length, but got x shape: ${r.shape}, weights shape: ${a.shape}.`));const i={x:r,weights:a},o={size:n,binaryOutput:s};return to.runKernel(gs,i,o)}});const hh=fo({depthToSpace_:function(e,t,n="NHWC"){const s=co(e,"x","depthToSpace","float32"),r="NHWC"===n?s.shape[1]:s.shape[2],a="NHWC"===n?s.shape[2]:s.shape[3],i="NHWC"===n?s.shape[3]:s.shape[1];qt(t>1,(()=>`blockSize should be > 1 for depthToSpace, but was: ${t}`)),qt(r*t>=0,(()=>`Negative dimension size caused by overflow when multiplying\n ${r} and ${t} for depthToSpace with input shape\n ${s.shape}`)),qt(a*t>=0,(()=>`Negative dimension size caused by overflow when multiplying\n ${a} and ${t} for depthToSpace with input shape\n ${s.shape}`)),qt(i%(t*t)==0,(()=>`Dimension size must be evenly divisible by ${t*t} but is ${i} for depthToSpace with input shape ${s.shape}`));const o={x:s},l={blockSize:t,dataFormat:n};return to.runKernel(ys,o,l)}});const dh=fo({depthwiseConv2d_:function(e,t,n,s,r="NHWC",a=[1,1],i){const o=co(e,"x","depthwiseConv2d","float32"),l=co(t,"filter","depthwiseConv2d","float32");let u=o,c=!1;3===o.rank&&(c=!0,u=Tc(o,[1,o.shape[0],o.shape[1],o.shape[2]])),qt(4===u.rank,(()=>`Error in depthwiseConv2d: input must be rank 4, but got rank ${u.rank}.`)),qt(4===l.rank,(()=>`Error in depthwiseConv2d: filter must be rank 4, but got rank ${l.rank}.`));const h="NHWC"===r?u.shape[3]:u.shape[1];qt(h===l.shape[2],(()=>`Error in depthwiseConv2d: number of input channels (${h}) must match the inChannels dimension in filter ${l.shape[2]}.`)),Ic("depthwiseConv2d",s,i);const d={x:u,filter:l},p={strides:n,pad:s,dataFormat:r,dilations:a,dimRoundingMode:i},f=to.runKernel(bs,d,p);return c?Tc(f,[f.shape[1],f.shape[2],f.shape[3]]):f}});const ph=fo({diag_:function(e){const t={x:co(e,"x","diag")};return to.runKernel(xs,t)}});const fh=fo({dilation2d_:function(e,t,n,s,r=[1,1],a="NHWC"){const i=co(e,"x","dilation2d"),o=co(t,"filter","dilation2d");qt(3===i.rank||4===i.rank,(()=>`Error in dilation2d: input must be rank 3 or 4, but got rank ${i.rank}.`)),qt(3===o.rank,(()=>`Error in dilation2d: filter must be rank 3, but got rank ${o.rank}.`)),qt("NHWC"===a,(()=>`Error in dilation2d: Only NHWC is currently supported, but got dataFormat of ${a}`));let l=i,u=!1;3===i.rank&&(l=Tc(i,[1,i.shape[0],i.shape[1],i.shape[2]]),u=!0),qt(l.shape[3]===o.shape[2],(()=>`Error in dilation2d: input and filter must have the same depth: ${l.shape[3]} vs ${o.shape[2]}`));const c={x:l,filter:o},h={strides:n,pad:s,dilations:r},d=to.runKernel(As,c,h);return u?Tc(d,[d.shape[1],d.shape[2],d.shape[3]]):d}});const mh=fo({equal_:function(e,t){let n=co(e,"a","equal","string_or_numeric"),s=co(t,"b","equal","string_or_numeric");[n,s]=$i(n,s),su(n.shape,s.shape);const r={a:n,b:s};return to.runKernel(Os,r)}});const gh=fo({where_:function(e,t,n){const s=co(t,"a","where"),r=co(n,"b","where"),a=co(e,"condition","where","bool"),i=su(su(a.shape,s.shape),r.shape),o={condition:Hc(a,i),t:Hc(s,i),e:Hc(r,i)};return to.runKernel(Jr,o)}});const yh=fo({divNoNan_:function(e,t){let n=co(e,"a","div"),s=co(t,"b","div");[n,s]=$i(n,s);const r=Fl(n,s),a=Pl(r),i=mh(s,a);return gh(i,a,r)}});const bh=fo({dot_:function(e,t){const n=co(e,"t1","dot"),s=co(t,"t2","dot");qt(!(1!==n.rank&&2!==n.rank||1!==s.rank&&2!==s.rank),(()=>`Error in dot: inputs must all be rank 1 or 2, but got ranks ${n.rank} and ${s.rank}.`));const r=1===n.rank?n.size:n.shape[1],a=1===s.rank?s.size:s.shape[0];if(qt(r===a,(()=>`Error in dot: inner dimensions of inputs must match, but got ${r} and ${a}.`)),1===n.rank&&1===s.rank){const e=Tc(n,[1,-1]),t=Tc(s,[-1,1]),r=Dc(e,t);return Tc(r,[])}if(1===n.rank&&2===s.rank){const e=Tc(n,[1,-1]),t=Tc(s,[s.shape[0],s.shape[1]]),r=Dc(e,t);return Tc(r,[r.size])}if(2===n.rank&&1===s.rank){const e=Tc(s,[-1,1]),t=Dc(n,e);return Tc(t,[t.size])}{const e=Tc(s,[s.shape[0],s.shape[1]]);return Dc(n,e)}}});const wh=fo({einsum_:function(e,...t){const n=t.map(((e,t)=>co(e,`tensors${t}`,"einsum"))),s={equation:e};return to.runKernel(_s,n,s)}});const vh=fo({elu_:function(e){const t={x:co(e,"x","elu","float32")};return to.runKernel(Is,t)}});const xh=fo({ensureShape_:function(e,t){const n=co(e,"x","ensureShape","string_or_numeric");if(!function(e,t){if(e===t)return!0;if(null==e||null==t)return!1;if(e.length!==t.length)return!1;for(let n=0;n"Input dtype must be `int32` or `float32`.")),"int32"===t.dtype&&(t=Nl(t,"float32"));const n={x:t};return to.runKernel(Ns,n)}});function kh(e,t){for(let n=0;ne[t]))]}function Eh(e,t){return Ch(e,t.map((e=>1)),t)}function _h(e,t,n){qt(kh(t,n),(()=>`${e} supports only inner-most axes for now. Got axes ${t} and rank-${n} input.`))}function Ih(e,t){if(kh(e,t))return null;const n=[];for(let s=0;sn.push(e))),n}function Th(e){return e.map(((e,t)=>[t,e])).sort(((e,t)=>e[1]-t[1])).map((e=>e[0]))}function Nh(e,t){const n=[];for(let s=t-e;s"Axis must be <= rank of the tensor"));const s={input:n},r={dim:t};return to.runKernel(Ds,s,r)}});const Ph=fo({expm1_:function(e){const t={x:co(e,"x","expm1")};return to.runKernel(Ms,t)}});const Vh=fo({tile_:function(e,t){const n=co(e,"x","tile","string_or_numeric");qt(n.rank===t.length,(()=>`Error in transpose: rank of input ${n.rank} must match length of reps ${t}.`));const s={x:n},r={reps:t};return to.runKernel(_a,s,r)}});const Wh=fo({eye_:function(e,t,n,s="float32"){null==t&&(t=e);const r=Tl([e,t],s),a=e<=t?e:t;for(let e=0;e`Error in localResponseNormalization: x must be rank 3 or 4 but got\n rank ${a.rank}.`)),qt(Xt(t),(()=>`Error in localResponseNormalization: depthRadius must be an integer but got depthRadius ${t}.`));let i=a,o=!1;3===a.rank&&(o=!0,i=Tc(a,[1,a.shape[0],a.shape[1],a.shape[2]]));const l={x:i},u={depthRadius:t,bias:n,alpha:s,beta:r},c=to.runKernel(ir,l,u);return o?Tc(c,[c.shape[1],c.shape[2],c.shape[3]]):c}});const td=fo({log_:function(e){const t={x:co(e,"x","log","float32")};return to.runKernel(tr,t)}});const nd=fo({log1p_:function(e){const t={x:co(e,"x","log1p")};return to.runKernel(nr,t)}});const sd=fo({neg_:function(e){const t={x:co(e,"x","neg")};return to.runKernel(Ar,t)}});const rd=fo({softplus_:function(e){const t={x:co(e,"x","softplus")};return to.runKernel(ia,t)}});const ad=fo({logSigmoid_:function(e){const t=co(e,"x","logSigmoid");return Vl((e=>({value:sd(rd(sd(e))),gradFunc:t=>Bl(t,Mc(sd(e)))})))(t)}});const id=fo({logSoftmax_:function(e,t=-1){const n=co(e,"logits","logSoftmax");if(-1===t&&(t=n.rank-1),t!==n.rank-1)throw Error(`Log Softmax along a non-last dimension is not yet supported. Logits was rank ${n.rank} and axis was ${t}`);const s=Vl(((e,n)=>{const s=Oh(e,t,!0),r=Ql(e,s),a=Ql(Nl(r,"float32"),td(Dh(zh(r),t,!0)));n([a]);return{value:a,gradFunc:(e,n)=>{const[s]=n,r=zh(s);return Ql(e,Bl(Dh(e,t,!0),r))}}}));return s(n)}});const od=fo({logSumExp_:function(e,t=null,n=!1){const s=co(e,"x","logSumExp"),r=en(t,s.shape),a=Oh(s,r,!0),i=Ql(s,a),o=zh(i),l=Dh(o,r),u=td(l),c=Dl(Tc(a,u.shape),u);if(n){const e=Eh(c.shape,r);return Tc(c,e)}return c}});const ld=fo({logicalAnd_:function(e,t){const n=co(e,"a","logicalAnd","bool"),s=co(t,"b","logicalAnd","bool");su(n.shape,s.shape);const r={a:n,b:s};return to.runKernel(sr,r)}});const ud=fo({logicalNot_:function(e){const t={x:co(e,"x","logicalNot","bool")};return to.runKernel(rr,t)}});const cd=fo({logicalOr_:function(e,t){const n=co(e,"a","logicalOr","bool"),s=co(t,"b","logicalOr","bool");su(n.shape,s.shape);const r={a:n,b:s};return to.runKernel(ar,r)}});const hd=fo({logicalXor_:function(e,t){const n=co(e,"a","logicalXor","bool"),s=co(t,"b","logicalXor","bool");return su(n.shape,s.shape),ld(cd(e,t),ud(ld(e,t)))}}),dd=2147483648;const pd=fo({searchSorted_:function(e,t,n="left"){const s=co(e,"sortedSequence","searchSorted"),r=co(t,"values","searchSorted"),a=s.shape[s.shape.length-1],i=r.shape[r.shape.length-1],o=Tc(s,[-1,a]),l=Tc(r,[-1,i]);if(o.rank<2)throw new Error("Sorted input argument must be at least 2-dimensional");if(o.shape[0]!==l.shape[0])throw new Error("Leading dimension of 'sortedSequence' and 'values' must match.");if($t(l.shape)>=dd)throw new Error("values tensor size must less than 2147483648");if(o.shape[1]>=dd)throw new Error(`trailing dim_size must less than 2147483648 for int32 output type, was ${o.shape[1]}`);const u={sortedSequence:o,values:l},c={side:n};return to.runKernel(Qr,u,c)}});function fd(e,t){return pd(e,t,"left")}const md=fo({maxPool_:function(e,t,n,s,r){const a=co(e,"x","maxPool");let i=a,o=!1;3===a.rank&&(o=!0,i=Tc(a,[1,a.shape[0],a.shape[1],a.shape[2]])),qt(4===i.rank,(()=>`Error in maxPool: input must be rank 4 but got rank ${i.rank}.`)),qt(Sc(n,1),(()=>`Error in maxPool: Either strides or dilations must be 1. Got strides ${n} and dilations '1'`)),Ic("maxPool",s,r);const l={x:i},u={filterSize:t,strides:n,pad:s,dimRoundingMode:r},c=to.runKernel(cr,l,u);return o?Tc(c,[c.shape[1],c.shape[2],c.shape[3]]):c}});const gd=fo({maxPool3d_:function(e,t=[1,1,1],n,s,r,a="NDHWC"){const i=co(e,"x","maxPool3d");let o=i,l=!1;4===i.rank&&(l=!0,o=Tc(i,[1,i.shape[0],i.shape[1],i.shape[2],i.shape[3]])),qt(5===o.rank,(()=>`Error in maxPool3d: x must be rank 5 but got rank ${o.rank}.`)),qt("NDHWC"===a,(()=>`Error in maxPool3d: Only NDHWC is currently supported, but got dataFormat of ${a}`)),Ic("maxPool3d",s,r);const u={x:o},c={filterSize:t,strides:n,pad:s,dimRoundingMode:r,dataFormat:a},h=to.runKernel(dr,u,c);return l?Tc(h,[h.shape[1],h.shape[2],h.shape[3],h.shape[4]]):h}});const yd=fo({maxPoolWithArgmax_:function(e,t,n,s,r=!1){const a={x:co(e,"x","maxPoolWithArgmax")},i={filterSize:t,strides:n,pad:s,includeBatchInIndex:r},o=to.runKernel(fr,a,i);return{result:o[0],indexes:o[1]}}});const bd=fo({mean_:function(e,t=null,n=!1){const s={x:co(e,"x","mean")},r={axis:t,keepDims:n};return to.runKernel(mr,s,r)}});function wd(e,t="float32"){if(bn(e),"complex64"===t){const t=wd(e,"float32"),n=wd(e,"float32");return mo(t,n)}const n=gn($t(e),t);return to.makeTensor(n,e,t)}function vd(e,t="float32"){if(bn(e),"complex64"===t){const t=vd(e,"float32"),n=wd(e,"float32");return mo(t,n)}const n=mn($t(e),t);return to.makeTensor(n,e,t)}function xd(e,t,{indexing:n="xy"}={}){if("xy"!==n&&"ij"!==n)throw new TypeError(`${n} is not a valid third argument to meshgrid`);if(void 0===e)return[];let s=co(e,"x","meshgrid",e instanceof Mi?e.dtype:"float32");if(void 0===t)return[s];let r=co(t,"y","meshgrid",t instanceof Mi?t.dtype:"float32");const a=$t(s.shape),i=$t(r.shape);return"xy"===n?(s=Tc(s,[1,-1]),r=Tc(r,[-1,1]),[Dc(vd([i,1],s.dtype),s),Dc(r,vd([1,a],r.dtype))]):(s=Tc(s,[-1,1]),r=Tc(r,[1,-1]),[Dc(s,vd([1,i],s.dtype)),Dc(vd([a,1],r.dtype),r)])}const Ad=fo({minimum_:function(e,t){let n=co(e,"a","minimum"),s=co(t,"b","minimum");[n,s]=$i(n,s),"bool"===n.dtype&&(n=Nl(n,"int32"),s=Nl(s,"int32")),su(n.shape,s.shape);const r={a:n,b:s};return to.runKernel(yr,r)}});const kd=fo({mirrorPad_:function(e,t,n){qt("reflect"===n||"symmetric"===n,(()=>`Invalid mode. Mode must be either reflect or symmetric. Got ${n}.`));const s=co(e,"x","mirrorPad");if(0===s.rank)throw new Error("mirrorPad(scalar) is not defined. Pass non-scalar to mirrorPad");qt(t.length===s.rank,(()=>`Padding doesn't match input. Must be ${s.rank}. Got ${t.length}.`));const r="reflect"===n?1:0;for(let e=0;e"Invalid number of paddings. Must be length of 2 each.")),qt(t[e][0]>=0&&t[e][0]<=s.shape[e]-r&&t[e][1]>=0&&t[e][1]<=s.shape[e]-r,(()=>`Padding in dimension ${e} cannot be greater than or equal to ${s.shape[e]-r} or less than 0 for input of shape ${s.shape}`));const a={paddings:t,mode:n},i={x:s};return to.runKernel(br,i,a)}});const Cd=fo({mod_:function(e,t){let n=co(e,"a","mod"),s=co(t,"b","mod");[n,s]=$i(n,s);const r={a:n,b:s};return to.runKernel(wr,r)}});const Sd=fo({moments_:function(e,t=null,n=!1){const s=en(t,(e=co(e,"x","moments")).shape),r=bd(e,s,n);let a=r.shape;n||(a=Eh(r.shape,s));const i=Ll(Ql(Nl(e,"float32"),Tc(r,a)));return{mean:r,variance:bd(i,s,n)}}});const Ed=fo({multiRNNCell_:function(e,t,n,s){const r=co(t,"data","multiRNNCell"),a=ho(n,"c","multiRNNCell"),i=ho(s,"h","multiRNNCell");let o=r;const l=[];for(let t=0;t2)throw new Error(`Rank of probabilities must be 1 or 2, but is ${i}`);n=n||Math.random();const o={logits:1===i?Tc(r,[1,-1]):r},l={numSamples:t,seed:n,normalized:s},u=to.runKernel(vr,o,l);return 1===i?Tc(u,[u.size]):u}});const Id=fo({notEqual_:function(e,t){let n=co(e,"a","notEqual","string_or_numeric"),s=co(t,"b","notEqual","string_or_numeric");[n,s]=$i(n,s),su(n.shape,s.shape);const r={a:n,b:s};return to.runKernel(kr,r)}});const Td=fo({oneHot_:function(e,t,n=1,s=0,r="int32"){if(t<2)throw new Error(`Error in oneHot: depth must be >=2, but it is ${t}`);const a={indices:co(e,"indices","oneHot","int32")},i={dtype:r,depth:t,onValue:n,offValue:s};return to.runKernel(Ir,a,i)}});const Nd=fo({onesLike_:function(e){const t={x:co(e,"x","onesLike")};return to.runKernel(_r,t)}});const Od=fo({outerProduct_:function(e,t){const n=co(e,"v1","outerProduct"),s=co(t,"v2","outerProduct");qt(1===n.rank&&1===s.rank,(()=>`Error in outerProduct: inputs must be rank 1, but got ranks ${n.rank} and ${s.rank}.`));const r=Tc(n,[-1,1]),a=Tc(s,[1,-1]);return Dc(r,a)}});const Rd=fo({pad_:function(e,t,n=0){const s=co(e,"x","pad");if(0===s.rank)throw new Error("pad(scalar) is not defined. Pass non-scalar to pad");const r={paddings:t,constantValue:n},a={x:s};return to.runKernel(Nr,a,r)}});const Dd=fo({pad1d_:function(e,t,n=0){return qt(2===t.length,(()=>"Invalid number of paddings. Must be length of 2.")),Rd(e,[t],n)}});const Md=fo({pad2d_:function(e,t,n=0){return qt(2===t.length&&2===t[0].length&&2===t[1].length,(()=>"Invalid number of paddings. Must be length of 2 each.")),Rd(e,t,n)}});const Fd=fo({pad3d_:function(e,t,n=0){return qt(3===t.length&&2===t[0].length&&2===t[1].length&&2===t[2].length,(()=>"Invalid number of paddings. Must be length of 2 each.")),Rd(e,t,n)}});const Bd=fo({pad4d_:function(e,t,n=0){return qt(4===t.length&&2===t[0].length&&2===t[1].length&&2===t[2].length&&2===t[3].length,(()=>"Invalid number of paddings. Must be length of 2 each.")),Rd(e,t,n)}});const zd=fo({spaceToBatchND_:function(e,t,n){const s=co(e,"x","spaceToBatchND");qt(s.rank>=1+t.length,(()=>`input rank ${s.rank} should be > than [blockShape] ${t.length}`)),qt(n.length===t.length,(()=>`paddings.shape[0] ${n.length} must be equal to [blockShape] ${t.length}`)),qt(s.shape.reduce(((e,s,r)=>r>0&&r<=t.length?e&&(s+n[r-1][0]+n[r-1][1])%t[r-1]==0:e),!0),(()=>`input spatial dimensions ${s.shape.slice(1)} with paddings ${n.toString()} must be divisible by blockShapes ${t.toString()}`));const r={x:s},a={blockShape:t,paddings:n};return to.runKernel(ua,r,a)}});const Ld=fo({pool_:function(e,t,n,s,r,a,i){null==r&&(r=[1,1]),null==a&&(a=1),0===s&&(s="valid");const o=co(e,"x","maxPool");let l=o,u=!1;3===o.rank&&(u=!0,l=Tc(o,[1,o.shape[0],o.shape[1],o.shape[2]])),qt(Sc(a,r),(()=>`Error in pool: Either strides or dilations must be 1. Got strides ${a} and dilations '${r}'`));const c=mc(l.shape,t,a,r,s),h=[c.dilationHeight,c.dilationWidth];let d;d="same"===s?function(e,t){const n=e.map(((e,n)=>e+(e-1)*(t[n]-1))),s=n.map((e=>e-1)),r=s.map((e=>Math.floor(e/2))),a=s.map(((e,t)=>e-r[t]));return s.map(((e,t)=>[r[t],a[t]]))}([c.filterHeight,c.filterWidth],h):[[0,0],[0,0]];const p=1===h[0]&&1===h[1],[f,m]=function(e,t,n){const s=n.map((e=>e[0])),r=n.map((e=>e[1])),a=e.concat(s,r),i=t.map(((e,t)=>(e-a[t]%e)%e)),o=r.map(((e,t)=>e+i[t])),l=t.map(((e,t)=>[s[t],o[t]])),u=t.map(((e,t)=>[0,i[t]]));return[l,u]}([c.inHeight,c.inWidth],h,d),g=p?s:"valid",y=p?l:zd(l,h,f),b=("avg"===n?()=>Nc(y,t,a,g,i):()=>md(y,t,a,g,i))(),w=p?b:Lc(b,h,m);return u?Tc(w,[w.shape[1],w.shape[2],w.shape[3]]):w}});const Pd=fo({prelu_:function(e,t){const n={x:co(e,"x","prelu"),alpha:co(t,"alpha","prelu")};return to.runKernel(Rr,n)}});const Vd=fo({prod_:function(e,t=null,n=!1){let s=co(e,"x","prod");"bool"===s.dtype&&(s=Nl(s,"int32"));const r={x:s},a={axis:t,keepDims:n};return to.runKernel(Dr,r,a)}});const Wd=fo({raggedGather_:function(e,t,n,s){const r={paramsNestedSplits:e.map(((e,t)=>co(e,`tensors${t}`,"raggedGather","int32"))),paramsDenseValues:co(t,"paramsDenseValues","raggedGather"),indices:co(n,"indices","raggedGather","int32")},a={outputRaggedRank:s},i=to.runKernel(Mr,r,a);return{outputNestedSplits:i.slice(0,i.length-1),outputDenseValues:i[i.length-1]}}});const Ud=fo({raggedRange_:function(e,t,n){const s=co(e,"starts","raggedRange"),r={starts:s,limits:co(t,"limits","raggedRange",s.dtype),deltas:co(n,"deltas","raggedRange",s.dtype)},a=to.runKernel(Fr,r);return{rtNestedSplits:a[0],rtDenseValues:a[1]}}});const Gd=fo({raggedTensorToTensor_:function(e,t,n,s,r){const a=co(e,"shape","raggedTensorToTensor","int32"),i=co(t,"values","raggedTensorToTensor"),o={shape:a,values:i,defaultValue:co(n,"defaultValue","raggedTensorToTensor",i.dtype),rowPartitionTensors:s.map(((e,t)=>co(e,`tensors${t}`,"raggedTensorToTensor","int32")))},l={rowPartitionTypes:r};return to.runKernel(Br,o,l)}});const qd=fo({rand_:function(e,t,n){bn(e);const s=$t(e);let r=null;if(null==n||"float32"===n)r=new Float32Array(s);else if("int32"===n)r=new Int32Array(s);else{if("bool"!==n)throw new Error(`Unknown data type ${n}`);r=new Uint8Array(s)}for(let e=0;e=1||0===a);const i=Math.sqrt(-2*Math.log(a)/a);e=this.mean+this.stdDev*s*i,t=this.mean+this.stdDev*r*i,this.truncated&&!this.isValidTruncated(e)||(n=!0)}return this.truncated&&!this.isValidTruncated(t)||(this.nextVal=this.convertValue(t)),this.convertValue(e)}convertValue(e){return null==this.dtype||"float32"===this.dtype?e:Math.round(e)}isValidTruncated(e){return e<=this.upper&&e>=this.lower}}class $d{constructor(e,t,n,s){this.alpha=e,this.beta=1/t,this.dtype=n;const r=s||Math.random();this.randu=jd.alea(r.toString()),this.randn=new Hd(0,1,n,!1,this.randu()),this.d=e<1?e+2/3:e-1/3,this.c=1/Math.sqrt(9*this.d)}nextValue(){let e,t,n,s,r,a;for(;;){do{s=this.randn.nextValue(),a=1+this.c*s}while(a<=0);if(a*=a*a,e=s*s,t=1-.331*e*e,n=.5*e+this.d*(1-a+Math.log(a)),r=this.randu(),rnull==this.dtype||"float32"===this.dtype,this.min=e,this.range=t-e,this.dtype=n,null==s&&(s=Math.random()),"number"==typeof s&&(s=s.toString()),!this.canReturnFloat()&&this.range<=1)throw new Error(`The difference between ${e} - ${t} <= 1 and dtype is not float`);this.random=jd.alea(s)}convertValue(e){return this.canReturnFloat()?e:Math.round(e)}nextValue(){return this.convertValue(this.min+this.range*this.random())}}const Xd=fo({randomGamma_:function(e,t,n=1,s="float32",r){if(bn(e),null==n&&(n=1),null==s&&(s="float32"),"float32"!==s&&"int32"!==s)throw new Error(`Unsupported data type ${s}`);const a=new $d(t,n,s,r),i=Tl(e,s);for(let e=0;e`Error in reverse1D: x must be rank 1 but got rank ${t.rank}.`)),ap(t,0)}});const op=fo({reverse2d_:function(e,t){const n=co(e,"x","reverse");return qt(2===n.rank,(()=>`Error in reverse2D: x must be rank 2 but got rank ${n.rank}.`)),ap(n,t)}});const lp=fo({reverse3d_:function(e,t){const n=co(e,"x","reverse");return qt(3===n.rank,(()=>`Error in reverse3D: x must be rank 3 but got rank ${n.rank}.`)),ap(n,t)}});const up=fo({reverse4d_:function(e,t){const n=co(e,"x","reverse");return qt(4===n.rank,(()=>`Error in reverse4D: x must be rank 4 but got rank ${n.rank}.`)),ap(n,t)}});const cp=fo({round_:function(e){const t={x:co(e,"x","round")};return to.runKernel(Kr,t)}});const hp=fo({rsqrt_:function(e){const t={x:co(e,"x","rsqrt","float32")};return to.runKernel(Xr,t)}});const dp=fo({selu_:function(e){const t={x:co(e,"x","selu")};return to.runKernel(ea,t)}});const pp=fo({separableConv2d_:function(e,t,n,s,r,a=[1,1],i="NHWC"){const o=co(e,"x","separableConv2d"),l=co(t,"depthwiseFilter","separableConv2d"),u=co(n,"pointwiseFilter","separableConv2d");let c=o,h=!1;if(3===o.rank&&(h=!0,c=Tc(o,[1,o.shape[0],o.shape[1],o.shape[2]])),"NCHW"===i)throw new Error("separableConv2d currently does not support dataFormat NCHW; only NHWC is supported");qt(4===c.rank,(()=>`Error in separableConv2d: input must be rank 4, but got rank ${c.rank}.`)),qt(4===l.rank,(()=>`Error in separableConv2d: depthwise filter must be rank 4, but got rank ${l.rank}.`)),qt(4===u.rank,(()=>`Error in separableConv2d: pointwise filter must be rank 4, but got rank ${l.rank}.`)),qt(1===u.shape[0],(()=>`Error in separableConv2d: the first dimension of pointwise filter must be 1, but got ${u.shape[0]}.`)),qt(1===u.shape[1],(()=>`Error in separableConv2d: the second dimension of pointwise filter must be 1, but got ${u.shape[1]}.`));const d=l.shape[2],p=l.shape[3];qt(u.shape[2]===d*p,(()=>`Error in separableConv2d: the third dimension of pointwise filter must be ${d*p}, but got ${u.shape[2]}.`));const f=dh(c,l,s,r,i,a),m=Jc(f,u,1,"valid",i);return h?Tc(m,[m.shape[1],m.shape[2],m.shape[3]]):m}});const fp=async function(e,t){const n=co(e,"x","setdiff1d"),s=co(t,"y","setdiff1d");qt(n.dtype===s.dtype,(()=>`x and y should have the same dtype, but got x (${n.dtype}) and y (${s.dtype}).`)),qt(1===n.rank,(()=>`x should be 1D tensor, but got x (${n.shape}).`)),qt(1===s.rank,(()=>`y should be 1D tensor, but got y (${s.shape}).`));const r=await n.data(),a=await s.data(),i=new Set(a);let o=0;for(let e=0;e`slice1d expects a rank-1 tensor, but got a rank-${s.rank} tensor`)),Fc(s,[t],[n])}});const wp=fo({slice2d_:function(e,t,n){const s=co(e,"x","slice2d");return qt(2===s.rank,(()=>`slice2d expects a rank-2 tensor, but got a rank-${s.rank} tensor`)),Fc(s,t,n)}});const vp=fo({slice3d_:function(e,t,n){const s=co(e,"x","slice3d");return qt(3===s.rank,(()=>`slice3d expects a rank-3 tensor, but got a rank-${s.rank} tensor`)),Fc(s,t,n)}});const xp=fo({slice4d_:function(e,t,n){const s=co(e,"x","slice4d");return qt(4===s.rank,(()=>`slice4d expects a rank-4 tensor, but got a rank-${s.rank} tensor`)),Fc(s,t,n)}});const Ap=fo({softmax_:function(e,t=-1){const n=co(e,"logits","softmax","float32");if(-1===t&&(t=n.rank-1),t!==n.rank-1)throw Error(`Softmax along a non-last dimension is not yet supported. Logits was rank ${n.rank} and dim was ${t}`);const s={logits:n},r={dim:t};return to.runKernel(ha,s,r)}});const kp=fo({fft_:function(e){qt("complex64"===e.dtype,(()=>`The dtype for tf.spectral.fft() must be complex64 but got ${e.dtype}.`));const t={input:e};return to.runKernel(Fs,t)}});const Cp=fo({ifft_:function(e){qt("complex64"===e.dtype,(()=>`The dtype for tf.spectral.ifft() must be complex64 but got ${e.dtype}.`));const t={input:e};return to.runKernel(Hs,t)}});const Sp=fo({irfft_:function(e){const t=e.shape[e.shape.length-1],n=e.size/t;let s;if(t<=2){const r=Tc(e,[n,t]);s=Cp(r)}else{const r=[n,2*(t-1)],a=Tc(tp(e),[n,t]),i=Tc(Hh(e),[n,t]),o=ap(Fc(a,[0,1],[n,t-2]),1),l=Bl(ap(Fc(i,[0,1],[n,t-2]),1),Wl(-1)),u=Rc([a,o],1),c=Rc([i,l],1),h=Tc(mo(u,c),[r[0],r[1]]);s=Cp(h)}if(s=tp(s),3===e.rank&&0!==e.shape[0]){const t=s,n=e.shape[0];s=Tc(s,[n,s.shape[0]/n,s.shape[1]]),t.dispose()}return s}});const Ep=fo({split_:function(e,t,n=0){const s={x:co(e,"x","split")},r={numOrSizeSplits:t,axis:n};return to.runKernel(ca,s,r)}});const _p=fo({rfft_:function(e,t){qt("float32"===e.dtype,(()=>`The dtype for rfft() must be real value but got ${e.dtype}`));let n=e.shape[e.shape.length-1];const s=e.size/n;let r;if(null!=t&&t0)),a=e.shape.map((e=>e));a[e.shape.length-1]=t,r=Fc(e,s,a),n=t}else if(null!=t&&t>n){const s=e.shape.map((e=>e));s[e.shape.length-1]=t-n,r=Rc([e,wd(s)],e.shape.length-1),n=t}else r=e;const a=Pl(r),i=Tc(mo(r,a),[s,n]),o=kp(i),l=Math.floor(n/2)+1,u=tp(o),c=Hh(o),h=Ep(u,[l,n-l],u.shape.length-1),d=Ep(c,[l,n-l],c.shape.length-1),p=r.shape.slice();return p[r.shape.length-1]=l,Tc(mo(h[0],d[0]),p)}});const Ip=fo({squaredDifference_:function(e,t){let n=co(e,"a","squaredDifference"),s=co(t,"b","squaredDifference");[n,s]=$i(n,s),su(n.shape,s.shape);const r={a:n,b:s};return to.runKernel(ya,r,{})}});const Tp=fo({squeeze_:function(e,t){const n=co(e,"x","squeeze","string_or_numeric");return Tc(n,tn(n.shape,t).newShape)}});const Np=fo({stack_:function(e,t=0){const n=ho(e,"tensors","stack","string_or_numeric");qt(n.length>=1,(()=>"Pass at least one tensor to tf.stack")),n.length>0&&qt(t<=n[0].rank,(()=>"Axis must be <= rank of the tensor"));const s=n,r={axis:t};return to.runKernel(Tr,s,r)}});const Op=fo({step_:function(e,t=0){const n={x:co(e,"x","step")},s={alpha:t};return to.runKernel(Fa,n,s)}});const Rp=fo({stridedSlice_:function(e,t,n,s,r=0,a=0,i=0,o=0,l=0){const u={x:co(e,"x","stridedSlice","string_or_numeric")},c={begin:t,end:n,strides:s,beginMask:r,endMask:a,ellipsisMask:i,newAxisMask:o,shrinkAxisMask:l};return to.runKernel(va,u,c)}});const Dp=fo({tan_:function(e){const t={x:co(e,"x","tan","float32")};return to.runKernel(Sa,t)}});function Mp(e,t){Ht(e);const n=oo(e,t);if(1!==n.length)throw new Error("tensor1d() requires values to be a flat/TypedArray");return go(e,null,n,t)}function Fp(e,t,n){if(Ht(e),null!=t&&2!==t.length)throw new Error("tensor2d() requires shape to have two numbers");const s=oo(e,n);if(2!==s.length&&1!==s.length)throw new Error("tensor2d() requires values to be number[][] or flat/TypedArray");if(1===s.length&&null==t)throw new Error("tensor2d() requires shape to be provided when `values` are a flat/TypedArray");return go(e,t,s,n)}function Bp(e,t,n){if(Ht(e),null!=t&&4!==t.length)throw new Error("tensor4d() requires shape to have four numbers");const s=oo(e,n);if(4!==s.length&&1!==s.length)throw new Error("tensor4d() requires values to be number[][][][] or flat/TypedArray");if(1===s.length&&null==t)throw new Error("tensor4d() requires shape to be provided when `values` are a flat array");return go(e,t,s,n)}function zp(e,t,n){if(Ht(e),null!=t&&5!==t.length)throw new Error("tensor5d() requires shape to have five numbers");const s=oo(e,n);if(5!==s.length&&1!==s.length)throw new Error("tensor5d() requires values to be number[][][][][] or flat/TypedArray");if(1===s.length&&null==t)throw new Error("tensor5d() requires shape to be provided when `values` are a flat array");return go(e,t,s,n)}function Lp(e,t,n){if(Ht(e),null!=t&&6!==t.length)throw new Error("tensor6d() requires shape to have six numbers");const s=oo(e,n);if(6!==s.length&&1!==s.length)throw new Error("tensor6d() requires values to be number[][][][][][] or flat/TypedArray");if(1===s.length&&null==t)throw new Error("tensor6d() requires shape to be provided when `values` are a flat array");return go(e,t=t||s,s,n)}function Pp(e,t,n){const s=t.rank>1?t.shape[t.rank-1]:1,r=t.rank>1?t.rank-1:1,a=`Must have updates.shape = indices.shape[:batchDim] + shape[sliceDim:], got updates.shape: ${n.shape}, indices.shape: ${t.shape}, shape: ${e}, sliceDim: ${s}, and batchDim: ${r}.`;if(n.rank1?t.shape[s-1]:1,a=n.length;let i=1;for(let e=r;e= 0 but got ${t}`);if(t>r)throw new Error(`'k' passed to topk() must be <= the last dimension (${r}) but got ${t}`);const a={x:s},i={k:t,sorted:n},[o,l]=to.runKernel(Ia,a,i);return{values:o,indices:l}}});const qp=fo({truncatedNormal_:function(e,t=0,n=1,s,r){if(bn(e),null!=s&&"bool"===s)throw new Error("Unsupported data type $ { dtype }");const a=new Hd(t,n,s,!0,r),i=Tl(e,s);for(let e=0;e0,(()=>"The input tensor must be at least 1D"));const s={x:n},r={axis:t},[a,i]=to.runKernel(Oa,s,r);return{values:a,indices:i}}});const Hp=fo({unsortedSegmentSum_:function(e,t,n){const s=co(e,"x","unsortedSegmentSum"),r=co(t,"segmentIds","unsortedSegmentSum","int32");qt(Xt(n),(()=>"numSegments must be of dtype int"));const a={x:s,segmentIds:r},i={numSegments:n};return to.runKernel(Da,a,i)}});const $p=fo({unstack_:function(e,t=0){const n=co(e,"x","unstack","string_or_numeric");qt(t>=-n.shape.length&&t`Axis = ${t} is not in [-${n.shape.length}, ${n.shape.length})`));const s={value:n},r={axis:t};return to.runKernel(Ra,s,r)}});function Kp(e,t){return pd(e,t,"right")}function Xp(e,t=!0,n,s){return to.makeVariable(e,t,n,s)}function Zp(e,t){const n=[];for(let e=0;e0,(()=>"mask cannot be scalar")),jt(o.slice(a,a+i),r.shape,"mask's shape must match the first K dimensions of tensor's shape,");let l=1;for(let e=a;et)).reverse()),qt(s.rank===t.length,(()=>`Error in transpose: rank of input ${s.rank} must match length of perm ${t}.`)),t.forEach((e=>{qt(e>=0&&e"All entries in 'perm' must be between 0 and "+(s.rank-1)+` but got ${t}`))})),s.rank<=1)return s.clone();const r={x:s},a={perm:t};return"complex64"===s.dtype?Ao((()=>{let e=tp(s),t=Hh(s);return e=to.runKernel(Na,{x:e},a),t=to.runKernel(Na,{x:t},a),n&&(t=sd(t)),mo(e,t)})):to.runKernel(Na,r,a)}});const ef=fo({movingAverage_:function(e,t,n,s,r=!0){const a=co(e,"v","movingAverage"),i=co(t,"x","movingAverage"),o=co(n,"decay","movingAverage");var l,u;u=i,qt((l=a).dtype===u.dtype,(()=>`The dtypes of the first(${l.dtype}) and second(${u.dtype}) input must match`)),qt(Kt(a.shape,i.shape),(()=>"Shape mismatch in v and x"));const c=Wl(1),h=Ql(c,o);let d=Bl(Ql(i,a),h);if(r){qt(null!=s,(()=>"When using zeroDebias: true, step is required."));const e=co(s,"step","movingAverage");d=Fl(d,Ql(c,Yl(o,e)))}return Dl(a,d)}});const tf=fo({scatterND_:function(e,t,n){bn(n);const s=co(e,"indices","scatterND","int32"),r=co(t,"updates","scatterND");Vp(r,s,n);const a={indices:s,updates:r},i={shape:n};return to.runKernel(Zr,a,i)}});const nf=fo({sparseToDense_:function(e,t,n,s=0){bn(n);const r=co(e,"sparseIndices","sparseToDense","int32"),a=co(t,"sparseValues","sparseToDense","string_or_numeric"),i=co(s,"defaultValue","sparseToDense",a.dtype);!function(e,t,n,s){if("int32"!==e.dtype)throw new Error(`tf.sparseToDense() expects the indices to be int32 type, but the dtype was ${e.dtype}.`);if(e.rank>2)throw new Error(`sparseIndices should be a scalar, vector, or matrix, but got shape ${e.shape}.`);const r=e.rank>0?e.shape[0]:1,a=e.rank>1?e.shape[1]:1;if(n.length!==a)throw new Error(`outputShape has incorrect number of elements:, ${n.length}, should be: ${a}.`);const i=t.size;if(0!==t.rank&&(1!==t.rank||i!==r))throw new Error(`sparseValues has incorrect shape ${t.shape}, should be [] or [${r}]`);if(t.dtype!==s.dtype)throw new Error("sparseValues.dtype must match defaultValues.dtype")}(r,a,n,i);const o={sparseIndices:r,sparseValues:a,defaultValue:i},l={outputShape:n};return to.runKernel(ga,o,l)}});const sf=fo({gatherND_:function(e,t){const n=co(t,"indices","gatherND","int32"),s={params:co(e,"x","gatherND","string_or_numeric"),indices:n};return to.runKernel(Us,s)}});const rf=fo({dropout_:function(e,t,n,s){const r=co(e,"x","dropout");if(qt("float32"===r.dtype,(()=>`x has to be a floating point tensor since it's going to be scaled, but got a ${r.dtype} tensor instead.`)),qt(t>=0&&t<1,(()=>`rate must be a float in the range [0, 1), but got ${t}.`)),0===t)return e instanceof Mi?r.clone():r;const a=function(e,t){if(null==t)return e.shape.slice();if(Kt(e.shape,t))return t;if(e.shape.length===t.length){const n=[];for(let s=0;s1,(()=>`inTopK() expects the predictions to be of rank 2 or higher, but got ${s.rank}`)),qt(s.rank-1===r.rank,(()=>`predictions rank should be 1 larger than targets rank, but got predictions rank ${s.rank} and targets rank ${r.rank}`)),jt(s.shape.slice(0,s.shape.length-1),r.shape,"predictions's shape should be align with the targets' shape, except the last dimension.");const a=s.shape[s.shape.length-1];qt(n>0&&n<=a,(()=>`'k' passed to inTopK() must be > 0 && <= the predictions last dimension (${a}), but got ${n}`));const i=await s.data(),o=await r.data(),[l,u]=[i.length/a,a],c=nn("bool",l);for(let e=0;et.value-e.value)),c[e]=0;for(let t=0;t`Error in conv2dDerFilter: input must be rank 4, but got shape ${o.shape}.`)),qt(4===l.rank,(()=>`Error in conv2dDerFilter: dy must be rank 4, but got shape ${l.shape}.`)),qt(4===n.length,(()=>`Error in conv2dDerFilter: filterShape must be length 4, but got ${n}.`));const u="NHWC"===a?o.shape[3]:o.shape[1],c="NHWC"===a?l.shape[3]:l.shape[1];qt(u===n[2],(()=>`Error in conv2dDerFilter: depth of input ${u}) must match input depth in filter (${n[2]}.`)),qt(c===n[3],(()=>`Error in conv2dDerFilter: depth of dy (${c}) must match output depth for filter (${n[3]}).`)),Ic("conv2dDerFilter",r,i);const h={x:o,dy:l},d={strides:s,pad:r,dataFormat:a,dimRoundingMode:i,filterShape:n};return to.runKernel(is,h,d)}});function cf(e,t,n){if(null==n||"linear"===n)return e;if("relu"===n)return Bl(e,Op(t));throw new Error(`Cannot compute gradient for fused activation ${n}.`)}function hf(e,t){let n=t;const s=nu(e.shape,t.shape);return s.length>0&&(n=Dh(n,s)),Tc(n,e.shape)}function df(e,t,n,s){if("linear"===t)return e;if("relu"===t)return sp(e);if("elu"===t)return vh(e);if("relu6"===t)return rp(e);if("prelu"===t)return Pd(e,n);if("leakyrelu"===t)return Zh(e,s);if("sigmoid"===t)return Mc(e);throw new Error(`Unknown fused activation ${t}.`)}const pf=(e,t)=>!(e>0)||"linear"===t;const ff=fo({fusedConv2d_:function({x:e,filter:t,strides:n,pad:s,dataFormat:r="NHWC",dilations:a=[1,1],dimRoundingMode:i,bias:o,activation:l="linear",preluActivationWeights:u,leakyreluAlpha:c}){if(l=l||"linear",!1===pf(to.state.gradientDepth,l)){qt("NHWC"===r,(()=>`Error in fused conv2d: got dataFormat of ${r} but only NHWC is currently supported for the case of gradient depth is 0 and the activation is not linear.`));let h=Jc(e,t,n,s,r,a,i);return null!=o&&(h=Dl(h,o)),df(h,l,u,c)}const h=co(e,"x","conv2d","float32"),d=co(t,"filter","conv2d","float32");let p=h,f=!1;3===h.rank&&(f=!0,p=Tc(h,[1,h.shape[0],h.shape[1],h.shape[2]])),qt(4===p.rank,(()=>`Error in fused conv2d: input must be rank 4, but got rank ${p.rank}.`)),qt(4===d.rank,(()=>`Error in fused conv2d: filter must be rank 4, but got rank ${d.rank}.`)),Ic("fused conv2d",s,i);const m="NHWC"===r?p.shape[3]:p.shape[1];qt(d.shape[2]===m,(()=>`Error in conv2d: depth of input (${m}) must match input depth for filter ${d.shape[2]}.`)),qt(Sc(n,a),(()=>`Error in conv2D: Either strides or dilations must be 1. Got strides ${n} and dilations '${a}'`));const g=yc(p.shape,d.shape,n,a,s,i);let y,b;if(null!=o&&(y=co(o,"bias","fused conv2d"),[y]=$i(y,h),"NHWC"===r?su(g.outShape,y.shape):(qt(y.shape.length<=1,(()=>`Error in fused conv2d: only supports scalar or 1-D Tensor bias for NCHW format but got the bias of rank-${y.shape.length}.`)),qt(0===y.shape.length||y.shape[0]===g.outChannels||1===y.shape[0],(()=>`Error in fused conv2d: bias shape (${y.shape}) is not compatible with the number of output channels (${g.outChannels})`)))),null!=u){const e=u.shape;if(qt(e.length<=1||3===e.length,(()=>`Error in fused conv2d: only supports scalar, 1-D Tensor or 3-D Tensor PReLU activation weights but got a tensor of rank-${e.length}.`)),1===e.length)qt(1===e[0]||e[0]===g.outChannels,(()=>`Error in fused conv2d: PReLU activation weights (${e}) is not compatible with the number of output channels (${g.outChannels}).`));else if(3===e.length)try{su(e,g.outShape)}catch(t){const n=`Error in fused conv2d: PReLU activation weights (${e}) is not compatible with the output shape of the conv2d (${g.outShape}).`;throw Error(n)}b=co(u,"prelu weights","fused conv2d")}const w=(e,t)=>{qt("NHWC"===r,(()=>`Error in gradient of fused conv2D: got dataFormat of ${r} but only NHWC is currently supported.`));const[i,o,u,c]=t,h=cf(e,u,l);qt(Cc(a),(()=>`Error in gradient of fused conv2D: dilation rates greater than 1 are not yet supported in gradients. Got dilations '${a}'`));const d=[th(o.shape,h,i,n,s),uf(o,h,i.shape,n,s)];if(null!=c){const e=hf(c,h);d.push(e)}return d},v={x:p,filter:d,bias:y,preluActivationWeights:b},x={strides:n,pad:s,dataFormat:r,dilations:a,dimRoundingMode:i,activation:l,leakyreluAlpha:c};if(null==o){const e=Vl(((e,t,n)=>{let s=to.runKernel(Pa,v,x);return n([t,e,s]),f&&(s=Tc(s,[s.shape[1],s.shape[2],s.shape[3]])),{value:s,gradFunc:w}}));return e(p,d)}{const e=Vl(((e,t,n,s)=>{let r=to.runKernel(Pa,v,x);return s([t,e,r,n]),f&&(r=Tc(r,[r.shape[1],r.shape[2],r.shape[3]])),{value:r,gradFunc:w}}));return e(p,d,y)}}});const mf=fo({depthwiseConv2dNativeBackpropFilter_:function(e,t,n,s,r,a=[1,1],i){let o=e;3===e.rank&&(o=Tc(e,[1,e.shape[0],e.shape[1],e.shape[2]]));let l=t;3===l.rank&&(l=Tc(t,[1,t.shape[0],t.shape[1],t.shape[2]]));const u={x:o,dy:l},c={strides:s,pad:r,dimRoundingMode:i,dilations:a,filterShape:n};return to.runKernel(ws,u,c)}});const gf=fo({depthwiseConv2dNativeBackpropInput_:function(e,t,n,s,r,a=[1,1],i){let o=t,l=!1;3===t.rank&&(l=!0,o=Tc(t,[1,t.shape[0],t.shape[1],t.shape[2]]));const u={dy:o,filter:n},c={strides:s,pad:r,dimRoundingMode:i,dilations:a,inputShape:e},h=to.runKernel(vs,u,c);return l?Tc(h,[h.shape[1],h.shape[2],h.shape[3]]):h}});const yf=fo({fusedDepthwiseConv2d_:function({x:e,filter:t,strides:n,pad:s,dataFormat:r="NHWC",dilations:a=[1,1],dimRoundingMode:i,bias:o,activation:l="linear",preluActivationWeights:u,leakyreluAlpha:c}){if(!1===pf(to.state.gradientDepth,l)){let h=dh(e,t,n,s,r,a,i);return null!=o&&(h=Dl(h,o)),df(h,l,u,c)}const h=co(e,"x","depthwiseConv2d","float32"),d=co(t,"filter","depthwiseConv2d","float32");let p=h,f=!1;3===h.rank&&(f=!0,p=Tc(h,[1,h.shape[0],h.shape[1],h.shape[2]])),qt(4===p.rank,(()=>`Error in fused depthwiseConv2d: input must be rank 4, but got rank ${p.rank}.`)),qt(4===d.rank,(()=>`Error in fused depthwiseConv2d: filter must be rank 4, but got rank ${d.rank}.`)),qt(p.shape[3]===d.shape[2],(()=>`Error in fused depthwiseConv2d: number of input channels (${p.shape[3]}) must match the inChannels dimension in filter ${d.shape[2]}.`)),null==a&&(a=[1,1]),qt(Sc(n,a),(()=>`Error in fused depthwiseConv2d: Either strides or dilations must be 1. Got strides ${n} and dilations '${a}'`)),Ic("fused depthwiseConv2d",s,i);const m=yc(p.shape,d.shape,n,a,s,i,!0);let g,y;null!=o&&(g=co(o,"bias","fused conv2d"),[g]=$i(g,h),su(m.outShape,g.shape)),null!=u&&(y=co(u,"prelu weights","fused depthwiseConv2d"));const b=(e,t)=>{qt(Cc(a),(()=>`Error in gradient of fused depthwiseConv2d: dilation rates greater than 1 are not yet supported. Got dilations '${a}'`));const[r,o,u,c]=t,h=cf(e,u,l),d=gf(o.shape,h,r,n,s,a,i),p=mf(o,h,r.shape,n,s,a,i);if(null!=c){return[d,p,hf(g,h)]}return[d,p]},w={x:p,filter:d,bias:g,preluActivationWeights:y},v={strides:n,pad:s,dataFormat:r,dilations:a,dimRoundingMode:i,activation:l,leakyreluAlpha:c};if(null==o){const e=Vl(((e,t,n)=>{let s=to.runKernel(Va,w,v);return n([t,e,s]),f&&(s=Tc(s,[s.shape[1],s.shape[2],s.shape[3]])),{value:s,gradFunc:b}}));return e(p,d)}{const e=Vl(((e,t,n,s)=>{let r=to.runKernel(Va,w,v);return s([t,e,r,n]),f&&(r=Tc(r,[r.shape[1],r.shape[2],r.shape[3]])),{value:r,gradFunc:b}}));return e(p,d,g)}}});const bf=fo({fusedMatMul_:function({a:e,b:t,transposeA:n=!1,transposeB:s=!1,bias:r,activation:a="linear",preluActivationWeights:i,leakyreluAlpha:o=.2}){if(!1===pf(to.state.gradientDepth,a)){let l=Dc(e,t,n,s);return null!=r&&(l=Dl(l,r)),df(l,a,i,o)}let l=co(e,"a","fused matMul"),u=co(t,"b","fused matMul");[l,u]=$i(l,u);const c=n?l.shape[l.rank-2]:l.shape[l.rank-1],h=s?u.shape[u.rank-1]:u.shape[u.rank-2],d=n?l.shape[l.rank-1]:l.shape[l.rank-2],p=s?u.shape[u.rank-2]:u.shape[u.rank-1],f=l.shape.slice(0,-2),m=u.shape.slice(0,-2),g=$t(f),y=$t(m);qt(c===h,(()=>`Error in fused matMul: inner shapes (${c}) and (${h}) of Tensors with shapes ${l.shape} and ${u.shape} and transposeA=${n} and transposeB=${s} must match.`));const b=su(l.shape.slice(0,-2),u.shape.slice(0,-2)).concat([d,p]),w=Tc(l,n?[g,c,d]:[g,d,c]),v=Tc(u,s?[y,p,h]:[y,h,p]);let x,A;null!=r&&(x=co(r,"bias","fused matMul"),[x]=$i(x,l),su(b,x.shape)),null!=i&&(A=co(i,"prelu weights","fused matMul"));const k=(e,t)=>{const[i,o,l,u]=t,c=cf(Tc(e,l.shape),l,a);let h,d;if(n||s?!n&&s?(h=Dc(c,o,!1,!1),d=Dc(c,i,!0,!1)):n&&!s?(h=Dc(o,c,!1,!0),d=Dc(i,c,!1,!1)):(h=Dc(o,c,!0,!0),d=Dc(c,i,!0,!0)):(h=Dc(c,o,!1,!0),d=Dc(i,c,!0,!1)),null!=r){return[h,d,hf(u,c)]}return[h,d]},C={a:w,b:v,bias:x,preluActivationWeights:A},S={transposeA:n,transposeB:s,activation:a,leakyreluAlpha:o};if(null==r){const e=Vl(((e,t,n)=>{const s=to.runKernel(La,C,S);return n([e,t,s]),{value:Tc(s,b),gradFunc:k}}));return e(w,v)}{const e=Vl(((e,t,n,s)=>{const r=to.runKernel(La,C,S);return s([e,t,r,n]),{value:Tc(r,b),gradFunc:k}}));return e(w,v,x)}}});const wf=fo({hammingWindow_:function(e){return of(e,.54,.46)}});const vf=fo({hannWindow_:function(e){return of(e,.5,.5)}});const xf=fo({frame_:function(e,t,n,s=!1,r=0){let a=0;const i=[];for(;a+t<=e.size;)i.push(Fc(e,a,t)),a+=n;if(s)for(;a`Error in cropAndResize: image must be rank 4,but got rank ${i.rank}.`)),qt(2===o.rank&&4===o.shape[1],(()=>`Error in cropAndResize: boxes must be have size [${u},4] but had shape ${o.shape}.`)),qt(1===l.rank&&l.shape[0]===u,(()=>`Error in cropAndResize: boxInd must be have size [${u}] but had shape ${o.shape}.`)),qt(2===s.length,(()=>`Error in cropAndResize: cropSize must be of length 2, but got length ${s.length}.`)),qt(s[0]>=1&&s[1]>=1,(()=>`cropSize must be atleast [1,1], but was ${s}`)),qt("bilinear"===r||"nearest"===r,(()=>`method must be bilinear or nearest, but was ${r}`));const c={image:i,boxes:o,boxInd:l},h={method:r,extrapolationValue:a,cropSize:s};return to.runKernel(ms,c,h)}});const Cf=fo({flipLeftRight_:function(e){const t=co(e,"image","flipLeftRight","float32");qt(4===t.rank,(()=>`Error in flipLeftRight: image must be rank 4,but got rank ${t.rank}.`));const n={image:t};return to.runKernel(zs,n,{})}});const Sf=fo({grayscaleToRGB_:function(e){const t=co(e,"image","grayscaleToRGB"),n=t.rank-1,s=t.shape[n];qt(t.rank>=2,(()=>`Error in grayscaleToRGB: images must be at least rank 2, but got rank ${t.rank}.`)),qt(1===s,(()=>`Error in grayscaleToRGB: last dimension of a grayscale image should be size 1, but got size ${s}.`));const r=new Array(t.rank);return r.fill(1,0,n),r[n]=3,Vh(t,r)}});const Ef=fo({rgbToGrayscale_:function(e){const t=co(e,"image","RGBToGrayscale"),n=t.rank-1,s=t.shape[n];qt(t.rank>=2,(()=>`Error in RGBToGrayscale: images must be at least rank 2, but got rank ${t.rank}.`)),qt(3===s,(()=>`Error in RGBToGrayscale: last dimension of an RGB image should be size 3, but got size ${s}.`));const r=t.dtype,a=Nl(t,"float32"),i=Mp([.2989,.587,.114]);let o;switch(t.rank){case 2:o=wh("ij,j->i",a,i);break;case 3:o=wh("ijk,k->ij",a,i);break;case 4:o=wh("ijkl,l->ijk",a,i);break;case 5:o=wh("ijklm,m->ijkl",a,i);break;case 6:o=wh("ijklmn,n->ijklm",a,i);break;default:throw new Error("Not a valid tensor rank.")}return o=Lh(o,-1),Nl(o,r)}});const _f=fo({rotateWithOffset_:function(e,t,n=0,s=.5){const r=co(e,"image","rotateWithOffset","float32");qt(4===r.rank,(()=>`Error in rotateWithOffset: image must be rank 4,but got rank ${r.rank}.`));const a={image:r},i={radians:t,fillValue:n,center:s};return to.runKernel(za,a,i)}});function If(e,t,n,s,r,a){null==s&&(s=.5),null==r&&(r=Number.NEGATIVE_INFINITY),null==a&&(a=0);const i=e.shape[0];return n=Math.min(n,i),qt(0<=s&&s<=1,(()=>`iouThreshold must be in [0, 1], but was '${s}'`)),qt(2===e.rank,(()=>`boxes must be a 2D tensor, but was of rank '${e.rank}'`)),qt(4===e.shape[1],(()=>`boxes must have 4 columns, but 2nd dimension was ${e.shape[1]}`)),qt(1===t.rank,(()=>"scores must be a 1D tensor")),qt(t.shape[0]===i,(()=>`scores has incompatible shape with boxes. Expected ${i}, but was ${t.shape[0]}`)),qt(0<=a&&a<=1,(()=>`softNmsSigma must be in [0, 1], but was '${a}'`)),{maxOutputSize:n,iouThreshold:s,scoreThreshold:r,softNmsSigma:a}}const Tf=fo({nonMaxSuppression_:function(e,t,n,s=.5,r=Number.NEGATIVE_INFINITY){const a=co(e,"boxes","nonMaxSuppression","float32"),i=co(t,"scores","nonMaxSuppression","float32"),o=If(a,i,n,s,r),l={maxOutputSize:n=o.maxOutputSize,iouThreshold:s=o.iouThreshold,scoreThreshold:r=o.scoreThreshold};return to.runKernel(Cr,{boxes:a,scores:i},l)}});function Nf(e,t,n){const s=function(e,t,n){return function(e,t,n){let s=0,r=e.length,a=0,i=!1;for(;s>>1);const o=n(t,e[a]);o>0?s=a+1:(r=a,i=!o)}return i?s:-s-1}(e,t,n||Of)}(e,t,n),r=s<0?-(s+1):s;e.splice(r,0,t)}function Of(e,t){return e>t?1:er&&u.push({score:t[e],boxIndex:e,suppressBeginIndex:0});u.sort(Lf);const c=a>0?-.5/a:0,h=[],d=[];for(;h.length0;){const t=u.pop(),{score:n,boxIndex:a,suppressBeginIndex:i}=t;if(n=i;--n){const i=Bf(e,a,h[n]);if(i>=s){o=!0;break}if(t.score=t.score*zf(s,c,i),t.score<=r)break}t.suppressBeginIndex=h.length,o||(t.score===n?(h.push(a),d.push(t.score)):t.score>r&&Nf(u,t,Lf))}const p=h.length,f=n-p;o&&f>0&&(h.push(...new Array(f).fill(0)),d.push(...new Array(f).fill(0)));const m={selectedIndices:h};return i&&(m.selectedScores=d),l&&(m.validOutputs=p),m}function Bf(e,t,n){const s=e.subarray(4*t,4*t+4),r=e.subarray(4*n,4*n+4),a=Math.min(s[0],s[2]),i=Math.min(s[1],s[3]),o=Math.max(s[0],s[2]),l=Math.max(s[1],s[3]),u=Math.min(r[0],r[2]),c=Math.min(r[1],r[3]),h=Math.max(r[0],r[2]),d=Math.max(r[1],r[3]),p=(o-a)*(l-i),f=(h-u)*(d-c);if(p<=0||f<=0)return 0;const m=Math.max(a,u),g=Math.max(i,c),y=Math.min(o,h),b=Math.min(l,d),w=Math.max(y-m,0)*Math.max(b-g,0);return w/(p+f-w)}function zf(e,t,n){const s=Math.exp(t*n*n);return n<=e?s:0}function Lf(e,t){return e.score-t.score||e.score===t.score&&t.boxIndex-e.boxIndex}const Pf=async function(e,t,n,s=.5,r=Number.NEGATIVE_INFINITY){const a=co(e,"boxes","nonMaxSuppressionAsync"),i=co(t,"scores","nonMaxSuppressionAsync"),o=If(a,i,n,s,r);n=o.maxOutputSize,s=o.iouThreshold,r=o.scoreThreshold;const l=await Promise.all([a.data(),i.data()]),u=l[0],c=l[1],{selectedIndices:h}=Rf(u,c,n,s,r);return a!==e&&a.dispose(),i!==t&&i.dispose(),Mp(h,"int32")};const Vf=fo({nonMaxSuppressionWithScore_:function(e,t,n,s=.5,r=Number.NEGATIVE_INFINITY,a=0){const i=co(e,"boxes","nonMaxSuppression"),o=co(t,"scores","nonMaxSuppression"),l=If(i,o,n,s,r,a),u={boxes:i,scores:o},c={maxOutputSize:n=l.maxOutputSize,iouThreshold:s=l.iouThreshold,scoreThreshold:r=l.scoreThreshold,softNmsSigma:a=l.softNmsSigma},h=to.runKernel(Er,u,c);return{selectedIndices:h[0],selectedScores:h[1]}}});const Wf=async function(e,t,n,s=.5,r=Number.NEGATIVE_INFINITY,a=0){const i=co(e,"boxes","nonMaxSuppressionAsync"),o=co(t,"scores","nonMaxSuppressionAsync"),l=If(i,o,n,s,r,a);n=l.maxOutputSize,s=l.iouThreshold,r=l.scoreThreshold,a=l.softNmsSigma;const u=await Promise.all([i.data(),o.data()]),c=u[0],h=u[1],{selectedIndices:d,selectedScores:p}=Mf(c,h,n,s,r,a);return i!==e&&i.dispose(),o!==t&&o.dispose(),{selectedIndices:Mp(d,"int32"),selectedScores:Mp(p)}};const Uf=fo({nonMaxSuppressionPadded_:function(e,t,n,s=.5,r=Number.NEGATIVE_INFINITY,a=!1){const i=co(e,"boxes","nonMaxSuppression"),o=co(t,"scores","nonMaxSuppression"),l=If(i,o,n,s,r,null),u={boxes:i,scores:o},c={maxOutputSize:l.maxOutputSize,iouThreshold:l.iouThreshold,scoreThreshold:l.scoreThreshold,padToMaxOutputSize:a},h=to.runKernel(Sr,u,c);return{selectedIndices:h[0],validOutputs:h[1]}}});const Gf=async function(e,t,n,s=.5,r=Number.NEGATIVE_INFINITY,a=!1){const i=co(e,"boxes","nonMaxSuppressionAsync"),o=co(t,"scores","nonMaxSuppressionAsync"),l=If(i,o,n,s,r,null),u=l.maxOutputSize,c=l.iouThreshold,h=l.scoreThreshold,[d,p]=await Promise.all([i.data(),o.data()]),{selectedIndices:f,validOutputs:m}=Df(d,p,u,c,h,a);return i!==e&&i.dispose(),o!==t&&o.dispose(),{selectedIndices:Mp(f,"int32"),validOutputs:Wl(m,"int32")}};const qf=fo({resizeBilinear_:function(e,t,n=!1,s=!1){const r=co(e,"images","resizeBilinear");qt(3===r.rank||4===r.rank,(()=>`Error in resizeBilinear: x must be rank 3 or 4, but got rank ${r.rank}.`)),qt(2===t.length,(()=>`Error in resizeBilinear: new shape must 2D, but got shape ${t}.`)),qt(!1===s||!1===n,(()=>"Error in resizeBilinear: If halfPixelCenters is true, alignCorners must be false."));let a=r,i=!1;3===r.rank&&(i=!0,a=Tc(r,[1,r.shape[0],r.shape[1],r.shape[2]]));const[]=t,o={images:a},l={alignCorners:n,halfPixelCenters:s,size:t},u=to.runKernel(qr,o,l);return i?Tc(u,[u.shape[1],u.shape[2],u.shape[3]]):u}});const jf=fo({resizeNearestNeighbor_:function(e,t,n=!1,s=!1){const r=co(e,"images","resizeNearestNeighbor");qt(3===r.rank||4===r.rank,(()=>`Error in resizeNearestNeighbor: x must be rank 3 or 4, but got rank ${r.rank}.`)),qt(2===t.length,(()=>`Error in resizeNearestNeighbor: new shape must 2D, but got shape ${t}.`)),qt("float32"===r.dtype||"int32"===r.dtype,(()=>"`images` must have `int32` or `float32` as dtype")),qt(!1===s||!1===n,(()=>"Error in resizeNearestNeighbor: If halfPixelCenters is true, alignCorners must be false."));let a=r,i=!1;3===r.rank&&(i=!0,a=Tc(r,[1,r.shape[0],r.shape[1],r.shape[2]]));const[]=t,o={images:a},l={alignCorners:n,halfPixelCenters:s,size:t},u=to.runKernel(Ur,o,l);return i?Tc(u,[u.shape[1],u.shape[2],u.shape[3]]):u}});const Hf=fo({threshold_:function(e,t="binary",n=!1,s=.5){const r=co(e,"image","threshold"),a=r.shape[0]*r.shape[1];let i,o,l,u,c=Bl(Mp([s]),255);if(qt(3===r.rank,(()=>`Error in threshold: image must be rank 3,but got rank ${r.rank}.`)),qt(3===r.shape[2]||1===r.shape[2],(()=>`Error in threshold: image color channel must be equal to 3 or 1but got ${r.shape[2]}.`)),qt("int32"===r.dtype||"float32"===r.dtype,(()=>`Error in dtype: image dtype must be int32 or float32,but got dtype ${r.dtype}.`)),qt("otsu"===t||"binary"===t,(()=>`Method must be binary or otsu, but was ${t}`)),3===r.shape[2]){[i,o,l]=Ep(r,[1,1,1],-1);const e=Bl(i,.2989),t=Bl(o,.587),n=Bl(l,.114);u=Dl(Dl(e,t),n)}else u=e;if("otsu"===t){c=function(e,t){let n,s,r,a,i,o,l=Mp([-1]),u=Mp([0]),c=Mp([0]);for(let h=0;h`Error in transform: image must be rank 4,but got rank ${i.rank}.`)),qt(2===o.rank&&(o.shape[0]===i.shape[0]||1===o.shape[0])&&8===o.shape[1],(()=>"Error in transform: Input transform should be batch x 8 or 1 x 8")),qt(null==a||2===a.length,(()=>`Error in transform: outputShape must be [height, width] or null, but got ${a}.`));const l={image:i,transforms:o},u={interpolation:n,fillMode:s,fillValue:r,outputShape:a};return to.runKernel(Ta,l,u)}});const Kf=fo({bandPart_:function(e,t,n){const s=co(e,"a","bandPart");qt(s.rank>=2,(()=>`bandPart(): Rank must be at least 2, got ${s.rank}.`));const r=s.shape,[a,i]=s.shape.slice(-2);let o,l;"number"==typeof t?(qt(t%1==0,(()=>`bandPart(): numLower must be an integer, got ${t}.`)),qt(t<=a,(()=>`bandPart(): numLower (${t}) must not be greater than the number of rows (${a}).`)),o=co(t<0?a:t,"numLower","bandPart")):(qt("int32"===t.dtype,(()=>"bandPart(): numLower's dtype must be an int32.")),o=gh(Yh(t,0),a,Ad(t,a))),"number"==typeof n?(qt(n%1==0,(()=>`bandPart(): numUpper must be an integer, got ${n}.`)),qt(n<=i,(()=>`bandPart(): numUpper (${n}) must not be greater than the number of columns (${i}).`)),l=co(n<0?i:n,"numUpper","bandPart")):(qt("int32"===n.dtype,(()=>"bandPart(): numUpper's dtype must be an int32.")),l=gh(Yh(n,0),i,Ad(n,i)));const u=Tc(ep(0,a,1,"int32"),[-1,1]),c=ep(0,i,1,"int32"),h=Ql(u,c),d=ld(Qh(h,o),jh(h,sd(l))),p=wd([a,i],s.dtype);return Tc(Np($p(Tc(s,[-1,a,i])).map((e=>gh(d,e,p)))),r)}});const Xf=fo({gramSchmidt_:function(e){let t;if(Array.isArray(e)){t=!1,qt(null!=e&&e.length>0,(()=>"Gram-Schmidt process: input must not be null, undefined, or empty"));const n=e[0].shape[0];for(let t=1;t`Gram-Schmidt: Non-unique lengths found in the input vectors: (${e[t].shape[0]} vs. ${n})`))}else t=!0,e=Ep(e,e.shape[0],0).map((e=>Tp(e,[0])));qt(e.length<=e[0].shape[0],(()=>`Gram-Schmidt: Number of vectors (${e.length}) exceeds number of dimensions (${e[0].shape[0]}).`));const n=[],s=e;for(let t=0;t{let e=s[t];if(t>0)for(let s=0;s{qt(2===e.shape.length,(()=>`qr2d() requires a 2D Tensor, but got a ${e.shape.length}D Tensor.`));const n=e.shape[0],s=e.shape[1];let r=Wh(n),a=Ol(e);const i=Fp([[1]],[1,1]);let o=Ol(i);const l=n>=s?s:n;for(let e=0;e{const t=Fc(a,[e,e],[n-e,1]),l=Fh(t),u=Fc(a,[e,e],[1,1]),c=gh(qh(u,0),Fp([[-1]]),Fp([[1]])),h=Ql(u,Bl(c,l)),d=Fl(t,h);o=1===d.shape[0]?Ol(i):Rc([i,Fc(d,[1,0],[d.shape[0]-1,d.shape[1]])],0);const p=sd(Fl(Dc(c,h),l)),f=Fc(a,[e,0],[n-e,s]),m=Bl(p,o),g=Jp(o);if(0===e)a=Ql(f,Dc(m,Dc(g,f)));else{const t=Ql(f,Dc(m,Dc(g,f)));a=Rc([Fc(a,[0,0],[e,s]),t],0)}const y=Jp(m),b=Fc(r,[0,e],[n,r.shape[1]-e]);if(0===e)r=Ql(b,Dc(Dc(b,o),y));else{const t=Ql(b,Dc(Dc(b,o),y));r=Rc([Fc(r,[0,0],[n,e]),t],1)}return[o,a,r]})),ko([t,l,u])}return!t&&n>s&&(r=Fc(r,[0,0],[n,s]),a=Fc(a,[0,0],[s,s])),[r,a]}))}const Yf=fo({qr_:function(e,t=!1){if(qt(e.rank>=2,(()=>`qr() requires input tensor to have a rank >= 2, but got rank ${e.rank}`)),2===e.rank)return Zf(e,t);{const n=e.shape.slice(0,e.shape.length-2).reduce(((e,t)=>e*t)),s=$p(Tc(e,[n,e.shape[e.shape.length-2],e.shape[e.shape.length-1]]),0),r=[],a=[];s.forEach((e=>{const[n,s]=Zf(e,t);r.push(n),a.push(s)}));return[Tc(Np(r,0),e.shape),Tc(Np(a,0),e.shape)]}}});var Qf;!function(e){e[e.NONE=0]="NONE",e[e.MEAN=1]="MEAN",e[e.SUM=2]="SUM",e[e.SUM_BY_NONZERO_WEIGHTS=3]="SUM_BY_NONZERO_WEIGHTS"}(Qf||(Qf={}));const Jf=fo({computeWeightedLoss_:function(e,t,n=Qf.SUM_BY_NONZERO_WEIGHTS){const s=co(e,"losses","computeWeightedLoss");let r=null;null!=t&&(r=co(t,"weights","computeWeightedLoss"));const a=null==r?s:Bl(s,r);if(n===Qf.NONE)return a;if(n===Qf.SUM)return Dh(a);if(n===Qf.MEAN){if(null==r)return bd(a);{const e=s.size/r.size,t=Fl(Dh(a),Dh(r));return e>1?Fl(t,Wl(e)):t}}if(n===Qf.SUM_BY_NONZERO_WEIGHTS){if(null==r)return Fl(Dh(a),Wl(s.size));{const e=Bl(r,vd(s.shape)),t=Nl(Dh(Id(e,Wl(0))),"float32");return Fl(Dh(a),t)}}throw Error(`Unknown reduction: ${n}`)}});const em=fo({absoluteDifference_:function(e,t,n,s=Qf.SUM_BY_NONZERO_WEIGHTS){const r=co(e,"labels","absoluteDifference"),a=co(t,"predictions","absoluteDifference");let i=null;null!=n&&(i=co(n,"weights","absoluteDifference")),jt(r.shape,a.shape,"Error in absoluteDifference: ");const o=eu(Ql(r,a));return Jf(o,i,s)}});const tm=fo({cosineDistance_:function(e,t,n,s,r=Qf.SUM_BY_NONZERO_WEIGHTS){const a=co(e,"labels","cosineDistance"),i=co(t,"predictions","cosineDistance");let o=null;null!=s&&(o=co(s,"weights","cosineDistance")),jt(a.shape,i.shape,"Error in cosineDistance: ");const l=Wl(1),u=Ql(l,Dh(Bl(a,i),n,!0));return Jf(u,o,r)}});const nm=fo({hingeLoss_:function(e,t,n,s=Qf.SUM_BY_NONZERO_WEIGHTS){let r=co(e,"labels","hingeLoss");const a=co(t,"predictions","hingeLoss");let i=null;null!=n&&(i=co(n,"weights","hingeLoss")),jt(r.shape,a.shape,"Error in hingeLoss: ");const o=Wl(1);r=Ql(Bl(Wl(2),r),o);const l=sp(Ql(o,Bl(r,a)));return Jf(l,i,s)}});const sm=fo({huberLoss_:function(e,t,n,s=1,r=Qf.SUM_BY_NONZERO_WEIGHTS){const a=co(e,"labels","huberLoss"),i=co(t,"predictions","huberLoss");let o=null;null!=n&&(o=co(n,"weights","huberLoss")),jt(a.shape,i.shape,"Error in huberLoss: ");const l=Wl(s),u=eu(Ql(i,a)),c=Ad(u,l),h=Ql(u,c),d=Dl(Bl(Wl(.5),Ll(c)),Bl(l,h));return Jf(d,o,r)}});const rm=fo({logLoss_:function(e,t,n,s=1e-7,r=Qf.SUM_BY_NONZERO_WEIGHTS){const a=co(e,"labels","logLoss"),i=co(t,"predictions","logLoss");let o=null;null!=n&&(o=co(n,"weights","logLoss")),jt(a.shape,i.shape,"Error in logLoss: ");const l=Wl(1),u=Wl(s),c=sd(Bl(a,td(Dl(i,u)))),h=Bl(Ql(l,a),td(Dl(Ql(l,i),u))),d=Ql(c,h);return Jf(d,o,r)}});const am=fo({meanSquaredError_:function(e,t,n,s=Qf.SUM_BY_NONZERO_WEIGHTS){const r=co(e,"labels","meanSquaredError"),a=co(t,"predictions","meanSquaredError");let i=null;null!=n&&(i=co(n,"weights","meanSquaredError")),jt(r.shape,a.shape,"Error in meanSquaredError: ");const o=Ip(r,a);return Jf(o,i,s)}});const im=fo({sigmoidCrossEntropy_:function(e,t,n,s=0,r=Qf.SUM_BY_NONZERO_WEIGHTS){let a=co(e,"multiClassLabels","sigmoidCrossEntropy");const i=co(t,"logits","sigmoidCrossEntropy");let o=null;if(null!=n&&(o=co(n,"weights","sigmoidCrossEntropy")),jt(a.shape,i.shape,"Error in sigmoidCrossEntropy: "),s>0){const e=Wl(s),t=Wl(1),n=Wl(.5);a=Dl(Bl(a,Ql(t,e)),Bl(n,e))}const l=function(e,t){const n=co(e,"labels","sigmoidCrossEntropyWithLogits"),s=co(t,"logits","sigmoidCrossEntropyWithLogits");jt(n.shape,s.shape,"Error in sigmoidCrossEntropyWithLogits: ");const r=sp(s),a=Bl(s,n),i=nd(zh(sd(eu(s))));return Dl(Ql(r,a),i)}(a,i);return Jf(l,o,r)}});const om=fo({softmaxCrossEntropy_:function(e,t,n,s=0,r=Qf.SUM_BY_NONZERO_WEIGHTS){let a=co(e,"onehotLabels","softmaxCrossEntropy");const i=co(t,"logits","softmaxCrossEntropy");let o=null;if(null!=n&&(o=co(n,"weights","softmaxCrossEntropy")),jt(a.shape,i.shape,"Error in softmaxCrossEntropy: "),s>0){const e=Wl(s),t=Wl(1),n=Wl(a.shape[1]);a=Dl(Bl(a,Ql(t,e)),Fl(e,n))}const l=function(e,t,n=-1){if(-1===n&&(n=t.rank-1),n!==t.rank-1)throw Error(`Softmax cross entropy along a non-last dimension is not yet supported. Labels / logits was rank ${t.rank} and dim was ${n}`);const s=Vl(((e,t,s)=>{const r=od(t,[n],!0),a=Ql(Nl(t,"float32"),r);s([e,a]);const i=sd(Bl(a,e));return{value:Dh(i,[n]),gradFunc:(e,t)=>{const[s,r]=t,a=Eh(e.shape,[n]);return[Bl(Tc(e,a),Ql(Nl(s,"float32"),zh(r))),Bl(Tc(e,a),Ql(zh(r),Nl(s,"float32")))]}}}));return s(e,t)}(a,i);return Jf(l,o,r)}});const lm=fo({sparseFillEmptyRows_:function(e,t,n,s){const r=co(e,"indices","sparseFillEmptyRows","int32"),a=co(t,"values","sparseFillEmptyRows"),i=co(n,"denseShape","sparseFillEmptyRows","int32"),o=co(s,"defaultValue","sparseFillEmptyRows",a.dtype);if(2!==r.rank)throw new Error(`Indices should be Tensor2D but received shape\n ${r.shape}`);if(1!==a.rank)throw new Error(`Values should be Tensor1D but received shape ${a.shape}`);if(1!==i.rank)throw new Error(`Dense shape should be Tensor1D but received shape ${i.shape}`);if(0!==o.rank)throw new Error(`Default value should be a scalar but received shape ${o.shape}`);const l={indices:r,values:a,denseShape:i,defaultValue:o},u=to.runKernel(da,l);return{outputIndices:u[0],outputValues:u[1],emptyRowIndicator:u[2],reverseIndexMap:u[3]}}});const um=fo({sparseReshape_:function(e,t,n){const s=co(e,"inputIndices","sparseReshape","int32"),r=co(t,"inputShape","sparseReshape","int32"),a=co(n,"newShape","sparseReshape","int32");if(2!==s.rank)throw new Error(`Input indices should be Tensor2D but received shape\n ${s.shape}`);if(1!==r.rank)throw new Error(`Input shape should be Tensor1D but received shape ${r.shape}`);if(1!==a.rank)throw new Error(`New shape should be Tensor1D but received shape ${a.shape}`);const i={inputIndices:s,inputShape:r,newShape:a},o=to.runKernel(pa,i);return{outputIndices:o[0],outputShape:o[1]}}});const cm=fo({sparseSegmentMean_:function(e,t,n){const s=co(e,"data","sparseSegmentMean"),r=co(t,"indices","sparseSegmentMean","int32"),a=co(n,"segmentIds","sparseSegmentMean","int32");if(s.rank<1)throw new Error("Data should be at least 1 dimensional but received scalar");if(1!==r.rank)throw new Error(`Indices should be Tensor1D but received shape\n ${r.shape}`);if(1!==a.rank)throw new Error(`Segment ids should be Tensor1D but received shape\n ${a.shape}`);const i={data:s,indices:r,segmentIds:a};return to.runKernel(fa,i)}});const hm=fo({sparseSegmentSum_:function(e,t,n){const s=co(e,"data","sparseSegmentSum"),r=co(t,"indices","sparseSegmentSum","int32"),a=co(n,"segmentIds","sparseSegmentSum","int32");if(s.rank<1)throw new Error("Data should be at least 1 dimensional but received scalar");if(1!==r.rank)throw new Error(`Indices should be Tensor1D but received shape\n ${r.shape}`);if(1!==a.rank)throw new Error(`Segment ids should be Tensor1D but received shape\n ${a.shape}`);const i={data:s,indices:r,segmentIds:a};return to.runKernel(ma,i)}});const dm=fo({stringNGrams_:function(e,t,n,s,r,a,i,o){const l=co(e,"data","stringNGrams","string");if("string"!==l.dtype)throw new Error("Data must be of datatype string");if(1!==l.shape.length)throw new Error(`Data must be a vector, saw: ${l.shape}`);const u=co(t,"dataSplits","stringNGrams");if("int32"!==u.dtype)throw new Error("Data splits must be of datatype int32");const c={separator:n,nGramWidths:s,leftPad:r,rightPad:a,padWidth:i,preserveShortSequences:o},h={data:l,dataSplits:u},d=to.runKernel(xa,h,c);return{nGrams:d[0],nGramsSplits:d[1]}}});const pm=fo({stringSplit_:function(e,t,n=!0){const s=co(e,"input","stringSplit","string"),r=co(t,"delimiter","stringSplit","string");if(1!==s.rank)throw new Error(`Input should be Tensor1D but received shape ${s.shape}`);if(0!==r.rank)throw new Error(`Delimiter should be a scalar but received shape ${r.shape}`);const a={skipEmpty:n},i={input:s,delimiter:r},o=to.runKernel(Aa,i,a);return{indices:o[0],values:o[1],shape:o[2]}}});const fm=fo({stringToHashBucketFast_:function(e,t){const n=co(e,"input","stringToHashBucketFast","string"),s={numBuckets:t};if(t<=0)throw new Error("Number of buckets must be at least 1");const r={input:n};return to.runKernel(ka,r,s)}});const mm=fo({staticRegexReplace_:function(e,t,n,s=!0){const r=co(e,"input","staticRegexReplace","string"),a={pattern:t,rewrite:n,replaceGlobal:s};return to.runKernel(wa,{x:r},a)}}),gm={fft:kp,ifft:Cp,rfft:_p,irfft:Sp},ym={hammingWindow:wf,hannWindow:vf,frame:xf,stft:Af},bm={flipLeftRight:Cf,grayscaleToRGB:Sf,resizeNearestNeighbor:jf,resizeBilinear:qf,rgbToGrayscale:Ef,rotateWithOffset:_f,cropAndResize:kf,nonMaxSuppression:Tf,nonMaxSuppressionAsync:Pf,nonMaxSuppressionWithScore:Vf,nonMaxSuppressionWithScoreAsync:Wf,nonMaxSuppressionPadded:Uf,nonMaxSuppressionPaddedAsync:Gf,threshold:Hf,transform:$f},wm={bandPart:Kf,gramSchmidt:Xf,qr:Yf},vm={absoluteDifference:em,computeWeightedLoss:Jf,cosineDistance:tm,hingeLoss:nm,huberLoss:sm,logLoss:rm,meanSquaredError:am,sigmoidCrossEntropy:im,softmaxCrossEntropy:om},xm={sparseFillEmptyRows:lm,sparseReshape:um,sparseSegmentMean:cm,sparseSegmentSum:hm},Am={stringNGrams:dm,stringSplit:pm,stringToHashBucketFast:fm,staticRegexReplace:mm};const km=class{static sgd(e){return new iu(e)}static momentum(e,t,n=!1){return new ou(e,t,n)}static rmsprop(e,t=.9,n=0,s=null,r=!1){return new lu(e,t,n,s,r)}static adam(e=.001,t=.9,n=.999,s=null){return new Jl(e,t,n,s)}static adadelta(e=.001,t=.95,n=null){return new Kl(e,t,n)}static adamax(e=.002,t=.9,n=.999,s=null,r=0){return new au(e,t,n,s,r)}static adagrad(e,t=.1){return new Zl(e,t)}},Cm="undefined"!=typeof requestAnimationFrame?requestAnimationFrame:"undefined"!=typeof setImmediate?setImmediate:e=>e();function Sm(){return new Promise((e=>Cm((()=>e()))))}function Em(e,t){const n=e[0].length;e.forEach(((e,t)=>{qt(e.length===n,(()=>`Error in concat${n}D: rank of tensors[${t}] must be the same as the rank of the rest (${n})`))})),qt(t>=0&&t`Error in concat${n}D: axis must be between 0 and ${n-1}.`));const s=e[0];e.forEach(((e,r)=>{for(let a=0;a`Error in concat${n}D: Shape of tensors[${r}] (${e}) does not match the shape of the rest (${s}) along the non-concatenated axis ${r}.`))}))}function _m(e,t){const n=e[0].slice();for(let s=1;s=0)if(o>=0){if(o!==a)throw new Error(`rt input.shape and shape=${t} are incompatible: rt input.shape[${r+e}] = ${a} but shape[${r+e}] = ${o}`)}else s[i]=a}return s}function Nm(e){const t={FIRST_DIM_SIZE:Im.FIRST_DIM_SIZE,VALUE_ROWIDS:Im.VALUE_ROWIDS,ROW_LENGTHS:Im.ROW_LENGTHS,ROW_SPLITS:Im.ROW_SPLITS,ROW_LIMITS:Im.ROW_LIMITS,ROW_STARTS:Im.ROW_STARTS},n=[];for(const s of e){if(!(s in t))break;n.push(t[s])}return n}function Om(e){return 0===e.length?0:e[0]===Im.FIRST_DIM_SIZE?e.length-1:e.length}function Rm(e,t){if(null==e||null==t)return;const n=e.length,s=t.length;if(n>=s)throw new Error(`defaultValue.shape=${e} and ragged tensor flatValues.shape=${t}, are incompatible: defaultValue.rank = ${n} must be less than ragged tensor input flatValues.rank = ${s})`);for(let r=0;r=0&&s>=0&&1!==n&&n!==s)throw new Error(`defaultValue.shape=${e}, and ragged tensor input flatValues.shape=${t} are incompatible: defaultValue.shape[${r-e.length}] = ${n} but ragged tensor input.flatValues.shape[${r-e.length}] = ${s}`)}}!function(e){e[e.FIRST_DIM_SIZE=0]="FIRST_DIM_SIZE",e[e.VALUE_ROWIDS=1]="VALUE_ROWIDS",e[e.ROW_LENGTHS=2]="ROW_LENGTHS",e[e.ROW_SPLITS=3]="ROW_SPLITS",e[e.ROW_LIMITS=4]="ROW_LIMITS",e[e.ROW_STARTS=5]="ROW_STARTS"}(Im||(Im={}));const Dm=30;function Mm(e){return e<=Dm?e:hn(e,Math.floor(Math.sqrt(e)))}function Fm(e,t,n){return[n*("number"==typeof e?e:e[0]),t*("number"==typeof e?e:e[1])]}function Bm(e,t,n,s=!0){let r=[];if(s)r=r.concat(t.slice(0)),r.push(e[0]/n),r=r.concat(e.slice(1));else{r=r.concat(e[0]);const n=t.length;for(let s=0;s=2*t+1||s%2==1?r.push(s):n.push(s);s.push(...n),s.push(0),s.push(...r)}return s}function Lm(e,t,n,s=!0){const r=[];s?r.push(e[0]/n):r.push(e[0]*n);for(let n=1;nn)throw new Error(`index innermost dimension length must be <= tensor rank; saw: ${t.shape[s-1]} vs. ${n}`);if(0===$t(e.shape))throw new Error(`Requested more than 0 entries, but input is empty. Input shape: ${e.shape}.`);const r=t.shape,a=r[r.length-1];let i=1;for(let e=0;ee/u)),1].slice(0,a);return[l,i,u,c]}const Um=1.7580993408473768,Gm=1.0507009873554805,qm=.3275911,jm=.254829592,Hm=-.284496736,$m=1.421413741,Km=-1.453152027,Xm=1.061405429;function Zm(e,t){if(e.length!==t.length)throw new Error(`Cannot merge real and imag arrays of different lengths. real:${e.length}, imag: ${t.length}.`);const n=new Float32Array(2*e.length);for(let s=0;s/g,ig=",",og="...";function lg(e,t){const n=((e=e.replace(/\s/g,"")).length-e.replace(ag,"").length)/rg.length;if(n<1)throw new Error("Equations without an arrow are not supported.");if(n>1)throw new Error(`Equation must contain exactly one arrow ("${rg}").`);const[s,r]=e.split(rg);qt(-1===s.indexOf(og),(()=>`The ellipsis notation ("${og}") is not supported yet.`));const a=s.split(ig),i=a.length;if(t!==i)throw new Error(`Expected ${i} input tensors, received ${t}`);if(i>2)throw new Error("Support for more than 2 input tensors is not implemented yet.");const o=[];for(let e=0;e-1!==e.indexOf(t))))throw new Error(`Output subscripts contain the label ${t} not present in the input subscripts.`);-1===o.indexOf(t)&&o.push(t)}for(let e=0;e-1!==e)),{permutationIndices:n,expandDims:s}}function cg(e,t,n){const s=new Array(e);for(let e=0;e`Expected dimension ${s[t[e][n]]} at axis ${n} of input shaped ${JSON.stringify(r)}, but got dimension ${r[n]}`))}}function hg(e,t){const n=e,s=[];let r=0;0===e.length&&n.push(-1),r=e.length+1;for(let e=0;ee===t))}function pg(e,t){const n=[];for(let s=0;s"Number of splits must evenly divide the axis.")),s=new Array(t).fill(e.shape[n]/t);else{const r=t.reduce(((e,t)=>(-1===t&&(e+=1),e)),0);qt(r<=1,(()=>"There should be only one negative value in split array."));const a=t.indexOf(-1);if(-1!==a){const s=t.reduce(((e,t)=>t>0?e+t:e));t[a]=e.shape[n]-s}qt(e.shape[n]===t.reduce(((e,t)=>e+t)),(()=>"The sum of sizes must match the size of the axis dimension.")),s=t}return s}function mg(e){return`Received SparseTensor with denseShape[0] = 0 but\n indices.shape[0] = ${e}`}function gg(e,t){return`indices(${e}, 0) is invalid: ${t} < 0`}function yg(e,t,n){return`indices(${e}, 0) is invalid: ${t} >= ${n}`}function bg(e,t){return`only one output dimension may be -1, not both ${e} and ${t}`}function wg(e,t){return`size ${e} must be non-negative, not ${t}`}function vg(){return"reshape cannot infer the missing input size for an empty tensor unless all specified input sizes are non-zero"}function xg(e,t){return`Input to reshape is a SparseTensor with ${$t(e)}\n dense values, but the requested shape requires a multiple of ${$t(t)}. inputShape=${e} outputShape= ${t}`}function Ag(e,t){return`Input to reshape is a tensor with ${$t(e)} dense values, but the requested shape has ${$t(t)}. inputShape=${e} outputShape=${t}`}function kg(){return"segment ids must be >= 0"}function Cg(){return"segment ids are not increasing"}function Sg(e,t){return`Segment id ${e} out of range [0, ${t}), possibly because segmentIds input is not sorted.`}function Eg(e,t,n){return`Bad: indices[${e}] == ${t} out of range [0, ${n})`}function _g(e,t){let n,s=!1;for(e<=Dm?(n=e,s=!0):n=hn(e,Math.floor(Math.sqrt(e)));!s;)n>t||n===e?s=!0:n=hn(e,n+1);return n}function Ig(e,t,n){const s=[],r=e.length;for(let a=0;ar))throw new Error(`Expect batchDims in the range of [-${r}, ${r}], but got ${s}`);if(s<0&&(s+=r),s>a)throw new Error(`batchDims (${s}) must be less than rank(x) (\n ${a}).`);if(ngi(e)))}catch(e){throw new Error(`Failed to decode encoded string bytes into utf-8, error: ${e}`)}}function Og(e){return e.map((e=>mi(e)))}!function(){for(const e of uu)Hl(e)}();const Rg={kernelName:Nn,inputsToSave:["x"],gradFunc:(e,t)=>{const[n]=t;return{x:()=>Bl(e,Op(Nl(n,"float32"),-1))}}},Dg={kernelName:On,inputsToSave:["x"],gradFunc:(e,t)=>{const[n]=t;return{x:()=>{const t=Ll(Nl(n,"float32")),s=zl(Ql(Wl(1),t));return sd(Fl(e,s))}}}},Mg={kernelName:Rn,inputsToSave:["x"],gradFunc:(e,t)=>{const[n]=t;return{x:()=>{const t=zl(Ql(Ll(Nl(n,"float32")),1));return Fl(e,t)}}}},Fg={kernelName:Dn,inputsToSave:["a","b"],gradFunc:(e,t)=>{const[n,s]=t,r=su(n.shape,s.shape);return{a:()=>{let t=e;const s=nu(n.shape,r);return s.length>0&&(t=Dh(t,s)),Tc(t,n.shape)},b:()=>{let t=e;const n=nu(s.shape,r);return n.length>0&&(t=Dh(t,n)),Tc(t,s.shape)}}}},Bg={kernelName:Mn,saveAllInputs:!0,gradFunc:(e,t)=>{const n={};return t.forEach(((t,s)=>{n[s]=()=>e.clone()})),n}},zg={kernelName:zn,inputsToSave:["x"],gradFunc:(e,t)=>{const[n]=t;return{x:()=>Pl(n)}}},Lg={kernelName:Ln,inputsToSave:["x"],gradFunc:(e,t)=>{const[n]=t;return{x:()=>Pl(n)}}},Pg={kernelName:Pn,inputsToSave:["x"],gradFunc:(e,t)=>{const[n]=t;return{x:()=>Fl(e,zl(Ql(Wl(1),Ll(Nl(n,"float32")))))}}},Vg={kernelName:Vn,inputsToSave:["x"],gradFunc:(e,t)=>{const[n]=t;return{x:()=>{const t=zl(Dl(Wl(1),Ll(Nl(n,"float32"))));return Fl(e,t)}}}},Wg={kernelName:Gn,inputsToSave:["a","b"],gradFunc:(e,t)=>{const[n,s]=t,r=su(n.shape,s.shape);return{a:()=>{const t=Dl(Ll(n),Ll(s));let a=Bl(e,Fl(s,t));const i=nu(n.shape,r);return i.length>0&&(a=Dh(a,i)),Tc(a,n.shape)},b:()=>{const t=Dl(Ll(n),Ll(s));let a=sd(Bl(e,Fl(n,t)));const i=nu(s.shape,r);return i.length>0&&(a=Dh(a,i)),Tc(a,s.shape)}}}},Ug={kernelName:Wn,inputsToSave:["x"],gradFunc:(e,t)=>{const[n]=t;return{x:()=>Fl(e,Dl(Ll(Nl(n,"float32")),1))}}},Gg={kernelName:Un,inputsToSave:["x"],gradFunc:(e,t)=>{const[n]=t;return{x:()=>Fl(e,Ql(Wl(1),Ll(Nl(n,"float32"))))}}};const qg=fo({avgPool3dGrad_:function(e,t,n,s,r,a){const i=co(e,"dy","avgPool3dGrad"),o=co(t,"input","avgPool3dGrad");let l=i,u=o,c=!1;4===o.rank&&(c=!0,l=Tc(i,[1,i.shape[0],i.shape[1],i.shape[2],i.shape[3]]),u=Tc(o,[1,o.shape[0],o.shape[1],o.shape[2],o.shape[3]])),qt(5===l.rank,(()=>`Error in avgPool3dGrad: dy must be rank 5 but got rank ${l.rank}.`)),qt(5===u.rank,(()=>`Error in avgPool3dGrad: input must be rank 5 but got rank ${u.rank}.`)),Ic("avgPool3dGrad",r,a);const h={dy:l,input:u},d={filterSize:n,strides:s,pad:r,dimRoundingMode:a},p=to.runKernel($n,h,d);return c?Tc(p,[p.shape[1],p.shape[2],p.shape[3],p.shape[4]]):p}}),jg={kernelName:Hn,inputsToSave:["x"],gradFunc:(e,t,n)=>{const[s]=t,{filterSize:r,strides:a,pad:i,dimRoundingMode:o}=n;return{x:()=>qg(e,s,r,a,i,o)}}};const Hg=fo({avgPoolGrad_:function(e,t,n,s,r){const a=co(e,"dy","avgPoolGrad"),i=co(t,"input","avgPoolGrad");qt(i.rank===a.rank,(()=>`Rank of input (${i.rank}) does not match rank of dy (${a.rank})`));let o=i,l=a,u=!1;3===i.rank&&(u=!0,o=Tc(i,[1,i.shape[0],i.shape[1],i.shape[2]]),l=Tc(a,[1,a.shape[0],a.shape[1],a.shape[2]])),qt(4===l.rank,(()=>`Error in avgPoolGrad: dy must be rank 4 but got rank ${l.rank}.`)),qt(4===o.rank,(()=>`Error in avgPoolGrad: input must be rank 4 but got rank ${o.rank}.`));const c={dy:l,input:o},h={filterSize:n,strides:s,pad:r},d=to.runKernel(jn,c,h);return u?Tc(d,[d.shape[1],d.shape[2],d.shape[3]]):d}}),$g={kernelName:qn,inputsToSave:["x"],gradFunc:(e,t,n)=>{const[s]=t,{filterSize:r,strides:a,pad:i}=n;return{x:()=>Hg(e,s,r,a,i)}}},Kg={kernelName:Kn,inputsToSave:["a","b"],gradFunc:(e,t,n)=>{const[s,r]=t,{transposeA:a,transposeB:i}=n;return a||i?!a&&i?{a:()=>Dc(e,r,!1,!1),b:()=>Dc(e,s,!0,!1)}:a&&!i?{a:()=>Dc(r,e,!1,!0),b:()=>Dc(s,e,!1,!1)}:{a:()=>Dc(r,e,!0,!0),b:()=>Dc(e,s,!0,!0)}:{a:()=>Dc(e,r,!1,!0),b:()=>Dc(s,e,!0,!1)}}},Xg={kernelName:Xn,gradFunc:(e,t,n)=>{const{blockShape:s,crops:r}=n;return{x:()=>zd(e,s,r)}}},Zg={kernelName:"BroadcastTo",gradFunc:(e,t,n)=>{const s=n,r=s.inputShape,a=s.shape,i=Array.from(a);for(let e=r.length-1;e>=0;e--)if(r[e]===a[e])i[e]=1;else if(1!==r[e])throw new Error(`broadcastTo(): [${r}] cannot be broadcast to [${a}].`);const o=[];for(let e=0;e1&&o.push(e);return{x:()=>Dh(e,o,!0)}}},Yg={kernelName:Jn,gradFunc:e=>({x:()=>e.clone()})},Qg={kernelName:es,gradFunc:e=>({x:()=>Pl(e)})},Jg={kernelName:ts,inputsToSave:["x"],gradFunc:(e,t,n)=>{const[s]=t,{clipValueMin:r,clipValueMax:a}=n;return{x:()=>gh(ld(jh(s,r),Qh(s,a)),e,Pl(e))}}},ey={kernelName:ss,inputsToSave:["x"],gradFunc:Rg.gradFunc},ty={kernelName:rs,saveAllInputs:!0,gradFunc:(e,t,n)=>{const s=t.map((e=>e.shape)),{axis:r}=n,a=en(r,t[0].shape)[0],i=s.map((e=>e[a]));return Ep(e,i,a).map((e=>()=>e))}},ny={kernelName:as,inputsToSave:["x","filter"],gradFunc:(e,t,n)=>{const[s,r]=t,{dilations:a,strides:i,pad:o,dataFormat:l}=n;return qt(Cc(a),(()=>`Error in gradient of conv2D: dilation rates greater than 1 are not yet supported in gradients. Got dilations '${a}'`)),{x:()=>th(s.shape,e,r,i,o,l),filter:()=>uf(s,e,r.shape,i,o,l)}}},sy={kernelName:os,inputsToSave:["dy","filter"],gradFunc:(e,t,n)=>{const[s,r]=t,{strides:a,pad:i,dataFormat:o,dimRoundingMode:l}=n;return{dy:()=>Jc(e,r,a,i,o,1,l),filter:()=>uf(e,s,r.shape,a,i,o,l)}}};const ry=fo({conv3DBackpropFilter_:function(e,t,n,s,r){let a=e;4===e.rank&&(a=Tc(e,[1,e.shape[0],e.shape[1],e.shape[2],e.shape[3]]));let i=t;4===i.rank&&(i=Tc(t,[1,t.shape[0],t.shape[1],t.shape[2],t.shape[3]])),qt(5===a.rank,(()=>`Error in conv3dDerFilter: input must be rank 5, but got shape ${a.shape}.`)),qt(5===i.rank,(()=>`Error in conv3dDerFilter: dy must be rank 5, but got shape ${i.shape}.`)),qt(5===n.length,(()=>`Error in conv3dDerFilter: filterShape must be length 5, but got ${n}.`)),qt(a.shape[4]===n[3],(()=>`Error in conv3dDerFilter: depth of input ${a.shape[4]}) must match input depth in filter (${n[3]}.`)),qt(i.shape[4]===n[4],(()=>`Error in conv3dDerFilter: depth of dy (${i.shape[4]}) must match output depth for filter (${n[4]}).`));const o={x:a,dy:i},l={strides:s,pad:r,filterShape:n};return to.runKernel(us,o,l)}}),ay={kernelName:ls,inputsToSave:["x","filter"],gradFunc:(e,t,n)=>{const{dilations:s,strides:r,pad:a}=n;qt(Cc(s),(()=>`Error in gradient of conv3D: dilation rates greater than 1 are not yet supported in gradients. Got dilations '${s}'`));const[i,o]=t;return{x:()=>rh(i.shape,e,o,r,a),filter:()=>ry(i,e,o.shape,r,a)}}},iy={kernelName:hs,inputsToSave:["x"],gradFunc:(e,t)=>{const[n]=t;return{x:()=>Bl(sd(gp(Nl(n,"float32"))),e)}}},oy={kernelName:ds,inputsToSave:["x"],gradFunc:(e,t)=>{const[n]=t;return{x:()=>Bl(yp(Nl(n,"float32")),e)}}},ly={kernelName:fs,inputsToSave:["x"],gradFunc:(e,t,n)=>{const[s]=t,{axis:r,exclusive:a,reverse:i}=n;return{x:()=>{const t=Ih([r],s.rank);let n=uh(e,r,a,!i);return null!=t&&(n=Jp(n,t)),n}}}},uy={kernelName:bs,inputsToSave:["x","filter"],gradFunc:(e,t,n)=>{const{dilations:s,strides:r,pad:a,dimRoundingMode:i}=n,o=null==s?[1,1]:s;qt(Cc(o),(()=>`Error in gradient of depthwiseConv2dNative: dilation rates greater than 1 are not yet supported. Got dilations '${o}'`));const[l,u]=t;return qt(4===l.rank,(()=>`Error in gradient of depthwiseConv2dNative: input must be rank 4, but got rank ${l.rank}.`)),qt(4===u.rank,(()=>`Error in gradient of depthwiseConv2dNative: filter must be rank 4, but got rank ${u.rank}.`)),qt(l.shape[3]===u.shape[2],(()=>`Error in gradient of depthwiseConv2d: number of input channels (${l.shape[3]}) must match the inChannels dimension in filter ${u.shape[2]}.`)),qt(Sc(r,o),(()=>`Error in gradient of depthwiseConv2d: Either strides or dilations must be 1. Got strides ${r} and dilations '${o}'.`)),Ic("depthwiseConv2d",a,i),{x:()=>gf(l.shape,e,u,r,a,o,i),filter:()=>mf(l,e,u.shape,r,a,o,i)}}},cy={kernelName:As,inputsToSave:["x","filter"],gradFunc:(e,t,n)=>{const[s,r]=t,a={x:s,filter:r,dy:e},i={x:s,filter:r,dy:e};return{x:()=>to.runKernel(ks,a,n),filter:()=>to.runKernel(Cs,i,n)}}},hy={kernelName:Is,outputsToSave:[!0],gradFunc:(e,t)=>{const[n]=t,s={dy:e,y:n};return{x:()=>to.runKernel(Ts,s)}}},dy={kernelName:Ns,inputsToSave:["x"],gradFunc:(e,t)=>{const[n]=t,s=Bl(zh(sd(Ll(n))),2/Math.sqrt(Math.PI));return{x:()=>Bl(e,s)}}},py={kernelName:Rs,outputsToSave:[!0],gradFunc:(e,t)=>{const[n]=t;return{x:()=>Bl(e,n)}}},fy={kernelName:Ds,inputsToSave:["input"],gradFunc:(e,t)=>{const[n]=t;return{input:()=>Tc(e,n.shape)}}},my={kernelName:Ms,inputsToSave:["x"],gradFunc:(e,t)=>{const[n]=t;return{x:()=>Bl(e,zh(n))}}},gy={kernelName:Ls,gradFunc:e=>({x:()=>Pl(e)})},yy={kernelName:Ps,inputsToSave:["a","b"],gradFunc:(e,t)=>{const[n,s]=t,r=su(n.shape,s.shape);return{a:()=>{const t=Fl(e,Nl(s,"float32")),a=nu(n.shape,r);return a.length>0?Tc(Dh(t,a),n.shape):t},b:()=>{let t=Bl(e,Nl(n,"float32"));const a=nu(s.shape,r);a.length>0&&(t=Tc(Dh(t,a),s.shape));const i=Ll(s);return sd(Fl(t,Nl(i,"float32")))}}}},by={kernelName:Vs,inputsToSave:["x","mean","variance","scale"],gradFunc:(e,t,n)=>{const{varianceEpsilon:s}=n,[r,a,i,o]=t,l=null==o?Wl(1):o,u=nu(a.shape,r.shape),c=[];if(1===a.rank){for(let e=0;e1===a.rank?Tc(Bl(Bl(e,Vh(Tc(p,[1,1,1,a.shape[0]]),c)),l),r.shape):Tc(Bl(Bl(e,p),l),r.shape),mean:()=>{let e=Bl(Bl(p,Wl(-1)),d);return 1===a.rank&&(e=Dh(e,u)),Tc(e,a.shape)},variance:()=>{let e=Bl(Bl(f,h),d);return 1===a.rank&&(e=Dh(e,u)),Tc(e,a.shape)},scale:()=>{const t=Bl(h,p);let n=Bl(e,t);return 1===a.rank&&(n=Dh(n,u)),Tc(n,a.shape)},offset:()=>{let t=e;return 1===a.rank&&(t=Dh(t,u)),Tc(t,a.shape)}}}},wy={kernelName:Ws,inputsToSave:["x","indices"],gradFunc:(e,t,n)=>{const[s,r]=t,{axis:a,batchDims:i}=n,o=en(a,s.shape)[0],l=(e,t,n)=>()=>{const s=e.shape,r=t.size,i=s.slice(0,o),l=i.length,u=s.slice(a,s.length).slice(1),c=u.length,h=vy(0,l),d=vy(l+1,l+1+c),p=xy([i,[r],u]),f=Tc(n,p),m=Tc(t,[r]),g=xy([[l],h,d]),y=Jp(f,g);let b=Hp(y,m,e.shape[o]);const w=Th(g);return b=Jp(b,w),b};if(1===i){const t=s.shape[0],n=s.split(t,0);return{x:()=>{const t=Np(n.map(((t,n)=>l(t,r.slice(n,1),e.slice(n,1))())));return t.reshape(s.shape)},indices:()=>r}}return{x:l(s,r,e),indices:()=>r}}};function vy(e,t){const n=[];for(let s=e;s{const[n,s]=t;return{a:()=>Pl(n),b:()=>Pl(s)}}},ky={kernelName:js,gradFunc:e=>({x:()=>Nl(e,"float32")})},Cy={kernelName:Ks,gradFunc:e=>({x:()=>Pl(e)})},Sy={kernelName:Xs,gradFunc:e=>({x:()=>Pl(e)})},Ey={kernelName:Zs,gradFunc:e=>({x:()=>Pl(e)})},_y={kernelName:Ys,inputsToSave:["x"],gradFunc:(e,t,n)=>{const[s]=t,{alpha:r}=n,a=qh(s,0);return{x:()=>gh(a,e,Bl(e,r))}}},Iy={kernelName:nr,inputsToSave:["x"],gradFunc:(e,t)=>{const[n]=t;return{x:()=>Fl(e,Dl(n,1))}}},Ty={kernelName:tr,inputsToSave:["x"],gradFunc:(e,t)=>{const[n]=t;return{x:()=>Fl(e,Nl(n,"float32"))}}},Ny={kernelName:"LogSoftmax",inputsToSave:[],outputsToSave:[!0],gradFunc:(e,t,n)=>{const[s]=t,{axis:r}=n;return{logits:()=>{const t=zh(s);return Ql(e,Bl(Dh(e,r,!0),t))}}}};const Oy=fo({localResponseNormalizationBackprop_:function(e,t,n,s=5,r=1,a=1,i=.5){const o={x:e,y:t,dy:n},l={depthRadius:s,bias:r,alpha:a,beta:i};return to.runKernel(or,o,l)}}),Ry={kernelName:ir,inputsToSave:["x"],outputsToSave:[!0],gradFunc:(e,t,n)=>{const[s,r]=t,{depthRadius:a,bias:i,alpha:o,beta:l}=n;return{x:()=>Oy(s,r,e,a,i,o,l)}}};function Dy(e,t,n,s){return t.rankBl(e,Nl(mh(n,t),e.dtype))}}const My={kernelName:lr,inputsToSave:["x"],outputsToSave:[!0],gradFunc:(e,t,n)=>{const s=n,{reductionIndices:r}=s,a=t[0],i=Dy(e,t[1],a,en(r,a.shape));return{x:()=>i.x()}}},Fy={kernelName:ur,inputsToSave:["a","b"],gradFunc:(e,t)=>{const[n,s]=t;return{a:()=>Bl(e,Nl(jh(n,s),"float32")),b:()=>Bl(e,Nl(Yh(n,s),"float32"))}}};const By=fo({maxPool3dGrad_:function(e,t,n,s,r,a,i){const o=co(e,"dy","maxPool3dGrad"),l=co(t,"input","maxPool3dGrad"),u=co(n,"output","maxPool3dGrad");let c=o,h=l,d=u,p=!1;4===l.rank&&(p=!0,c=Tc(o,[1,o.shape[0],o.shape[1],o.shape[2],o.shape[3]]),h=Tc(l,[1,l.shape[0],l.shape[1],l.shape[2],l.shape[3]]),d=Tc(u,[1,u.shape[0],u.shape[1],u.shape[2],u.shape[3]])),qt(5===c.rank,(()=>`Error in maxPool3dGrad: dy must be rank 5 but got rank ${c.rank}.`)),qt(5===h.rank,(()=>`Error in maxPool3dGrad: input must be rank 5 but got rank ${h.rank}.`)),qt(5===d.rank,(()=>`Error in maxPool3dGrad: output must be rank 5 but got rank ${d.rank}.`)),Ic("maxPool3dGrad",a,i);const f={dy:c,input:h,output:d},m={filterSize:s,strides:r,pad:a,dimRoundingMode:i},g=to.runKernel(pr,f,m);return p?Tc(g,[g.shape[1],g.shape[2],g.shape[3],g.shape[4]]):g}}),zy={kernelName:dr,inputsToSave:["x"],outputsToSave:[!0],gradFunc:(e,t,n)=>{const[s,r]=t,{filterSize:a,strides:i,pad:o,dimRoundingMode:l}=n;return{x:()=>By(e,s,r,a,i,o,l)}}};const Ly=fo({maxPoolGrad_:function(e,t,n,s,r,a,i){const o=co(e,"dy","maxPoolGrad"),l=co(t,"input","maxPoolGrad"),u=co(n,"output","maxPoolGrad");qt(l.rank===o.rank,(()=>`Rank of input (${l.rank}) does not match rank of dy (${o.rank})`)),qt(4===o.rank,(()=>`Error in maxPoolGrad: dy must be rank 4 but got rank ${o.rank}.`)),qt(4===l.rank,(()=>`Error in maxPoolGrad: input must be rank 4 but got rank ${l.rank}.`)),Ic("maxPoolGrad",a,i);const c={dy:o,input:l,output:u},h={filterSize:s,strides:r,pad:a,dimRoundingMode:i};return to.runKernel(hr,c,h)}}),Py={kernelName:cr,inputsToSave:["x"],outputsToSave:[!0],gradFunc:(e,t,n)=>{const[s,r]=t,{filterSize:a,strides:i,pad:o}=n;return{x:()=>Ly(e,s,r,a,i,o)}}},Vy={kernelName:br,inputsToSave:["x"],gradFunc:(e,t,n)=>{const s=t[0],{paddings:r}=n,a=r.map((e=>e[0]));return{x:()=>Fc(e,a,s.shape)}}},Wy={kernelName:Tr,saveAllInputs:!0,gradFunc:(e,t,n)=>{const{axis:s}=n;return $p(e,s).map((e=>()=>e))}},Uy={kernelName:Nr,inputsToSave:["x"],gradFunc:(e,t,n)=>{const s=t[0],{paddings:r}=n,a=r.map((e=>e[0]));return{x:()=>Fc(e,a,s.shape)}}},Gy={kernelName:Or,inputsToSave:["a","b"],outputsToSave:[!0],gradFunc:(e,t)=>{const[n,s,r]=t,a=n,i=s,o=su(a.shape,i.shape);return{a:()=>{const t=Nl(i,"float32");let n=Bl(e,Bl(t,Yl(a,Ql(t,Wl(1)))));const s=nu(a.shape,o);return s.length>0&&(n=Dh(n,s)),Tc(n,a.shape)},b:()=>{const t=qh(a,0),n=gh(t,td(a),Pl(a));let s=Bl(e,Bl(r,n));const l=nu(i.shape,o);return l.length>0&&(s=Dh(s,l)),Tc(s,i.shape)}}}};function qy(e,t,n){const s=e.shape.length,r=s-n.length,a=Ih(n,s);let i=e;null!=a&&(i=Jp(e,a));const o=i.shape.slice(),l=o.splice(s-n.length,n.length).reduce(((e,t)=>e*t),1);o.push(l);let u=function(e,t,n){const s=e.shape.slice();s[n]=1;const r=Tc(t,s),a=lh(e,n,!0,!1),i=lh(e,n,!0,!0),o=Bl(a,i);return Bl(r,o)}(i.reshape(o),t,r);if(u=u.reshape(i.shape),null!=a){const e=Th(a);u=Jp(u,e)}return u}const jy={kernelName:ea,inputsToSave:["x"],gradFunc:(e,t)=>{const[n]=t;return{x:()=>{const t=qh(n,Wl(0)),s=Wl(Um),r=Wl(Gm),a=Bl(e,r),i=Bl(Bl(e,s),zh(Nl(n,"float32")));return gh(t,a,i)}}}},Hy={kernelName:ua,gradFunc:(e,t,n)=>{const{blockShape:s,paddings:r}=n;return{x:()=>Lc(e,s,r)}}},$y={kernelName:ca,gradFunc:(e,t,n)=>{const{axis:s}=n;return{x:()=>Rc(e,s)}}},Ky={kernelName:_a,inputsToSave:["x"],gradFunc:(e,t,n)=>{const[s]=t,{reps:r}=n;return{x:()=>{let t=Pl(s);if(1===s.rank)for(let n=0;n{const[n,s]=t,r=su(n.shape,s.shape);return{a:()=>{const t=Fl(e,Nl(s,"float32")),a=nu(n.shape,r);return a.length>0?Tc(Dh(t,a),n.shape):t},b:()=>{let t=Bl(e,Nl(n,"float32"));const a=nu(s.shape,r);a.length>0&&(t=Tc(Dh(t,a),s.shape));const i=Ll(s);return sd(Fl(t,Nl(i,"float32")))}}}},hy,dy,py,fy,my,yy,gy,by,wy,Ay,ky,Cy,Sy,Ey,_y,Iy,Ty,Ny,Ry,My,My,Fy,zy,Py,{kernelName:mr,inputsToSave:["x"],gradFunc:(e,t,n)=>{const[s]=t,{axis:r}=n,a=en(r,s.shape),i=$t(Sh(s.shape,a)[1]);return{x:()=>{const t=s.shape.slice();a.forEach((e=>{t[e]=1}));const n=Tc(e,t);return Fl(Bl(n,vd(s.shape,"float32")),i)}}}},{kernelName:gr,inputsToSave:["x"],outputsToSave:[!0],gradFunc:(e,t,n)=>{const s=n,{axis:r}=s,[a,i]=t,o=Dy(e,i,a,en(r,a.shape));return{x:()=>o.x()}}},{kernelName:yr,inputsToSave:["a","b"],gradFunc:(e,t)=>{const[n,s]=t;return{a:()=>Bl(e,Nl(Qh(n,s),"float32")),b:()=>Bl(e,Nl(qh(n,s),"float32"))}}},Vy,{kernelName:wr,inputsToSave:["a","b"],gradFunc:(e,t)=>{const[n,s]=t,r=su(n.shape,s.shape);return{a:()=>{const t=nu(n.shape,r);return t.length>0?Tc(Dh(e,t),n.shape):e},b:()=>{const t=Bl(e,sd(Uh(Fl(n,s)))),a=nu(s.shape,r);return a.length>0?Tc(Dh(t,a),s.shape):t}}}},{kernelName:xr,inputsToSave:["a","b"],gradFunc:(e,t)=>{const[n,s]=t,r=su(n.shape,s.shape);return{a:()=>{const t=Bl(e,Nl(s,"float32")),a=nu(n.shape,r);return a.length>0?Tc(Dh(t,a),n.shape):t},b:()=>{const t=Bl(e,Nl(n,"float32")),a=nu(s.shape,r);return a.length>0?Tc(Dh(t,a),s.shape):t}}}},{kernelName:Ar,gradFunc:e=>({x:()=>sd(e)})},{kernelName:Ir,inputsToSave:["indices"],gradFunc:(e,t)=>{const n=t[0];return{indices:()=>wd(n.shape,"float32")}}},{kernelName:_r,gradFunc:e=>({x:()=>Pl(e)})},Wy,Uy,Uy,Gy,{kernelName:Rr,inputsToSave:["x","alpha"],gradFunc:(e,t)=>{const[n,s]=t,r=qh(n,0);return{x:()=>gh(r,e,Bl(e,s)),alpha:()=>{let t=gh(r,Pl(e),Bl(e,n));const a=nu(s.shape,e.shape);return a.length>0&&(t=Dh(t,a)),Tc(t,s.shape)}}}},{kernelName:Dr,inputsToSave:["x"],gradFunc:(e,t,n)=>{const[s]=t,{axis:r}=n;let a=[];return a=null==r?s.shape.map(((e,t)=>t)):"number"==typeof r?[r]:r,{x:()=>qy(s,e,a)}}},{kernelName:Pr,inputsToSave:["x"],gradFunc:(e,t)=>{const[n]=t;return{x:()=>Fl(e,sd(Ll(n)))}}},{kernelName:Hr,inputsToSave:["x"],gradFunc:(e,t)=>{const[n]=t,s=Bl(Qh(n,6),Op(n));return{x:()=>Bl(e,Nl(s,"float32"))}}},{kernelName:Vr,inputsToSave:["x"],gradFunc:(e,t)=>{const[n]=t;return{x:()=>Bl(e,Nl(Op(n),"float32"))}}},{kernelName:Wr,inputsToSave:["x"],gradFunc:(e,t)=>{const[n]=t;return{x:()=>Tc(e,n.shape)}}},{kernelName:qr,inputsToSave:["images"],gradFunc:(e,t,n)=>{const[s]=t,r={dy:e,images:s};return{images:()=>to.runKernel(jr,r,n)}}},{kernelName:Ur,inputsToSave:["images"],gradFunc:(e,t,n)=>{const[s]=t,r={dy:e,images:s};return{images:()=>to.runKernel(Gr,r,n)}}},{kernelName:$r,gradFunc:(e,t,n)=>{const{dims:s}=n,r=en(s,e.shape);return{x:()=>ap(e,r)}}},{kernelName:Kr,gradFunc:e=>({x:()=>Pl(e)})},{kernelName:Xr,inputsToSave:["x"],gradFunc:(e,t)=>{const[n]=t;return{x:()=>sd(Fl(e,Bl(Yl(n,1.5),2)))}}},{kernelName:Jr,inputsToSave:["condition"],gradFunc:(e,t)=>{const[n]=t;return{condition:()=>Nl(Pl(n),"float32"),t:()=>Bl(e,Nl(n,e.dtype)),e:()=>Bl(e,Nl(ud(n),e.dtype))}}},jy,{kernelName:aa,outputsToSave:[!0],gradFunc:(e,t)=>{const[n]=t;return{x:()=>Bl(e,Bl(n,Ql(Wl(1),n)))}}},{kernelName:ra,gradFunc:e=>({x:()=>Pl(e)})},{kernelName:na,inputsToSave:["x"],gradFunc:(e,t)=>{const[n]=t;return{x:()=>Bl(ih(Nl(n,"float32")),e)}}},{kernelName:sa,inputsToSave:["x"],gradFunc:(e,t)=>{const[n]=t;return{x:()=>Bl(oh(Nl(n,"float32")),e)}}},{kernelName:ta,inputsToSave:["x"],gradFunc:(e,t,n)=>{const[s]=t,{begin:r,size:a}=n,i=s.shape,[o,l]=Ju(s,r,a),u=[];for(let t=0;tRd(e,u)}}},{kernelName:ha,outputsToSave:[!0],gradFunc:(e,t,n)=>{const[s]=t,{dim:r}=n,a=Bl(e,s);return{logits:()=>Ql(a,Bl(Dh(a,[r],true),s))}}},{kernelName:ia,inputsToSave:["x"],gradFunc:(e,t)=>{const[n]=t;return{x:()=>Bl(e,Mc(n))}}},Hy,Hy,$y,$y,{kernelName:oa,inputsToSave:["x"],gradFunc:(e,t)=>{const[n]=t;return{x:()=>Fl(e,Bl(zl(Nl(n,"float32")),2))}}},{kernelName:ya,inputsToSave:["a","b"],gradFunc:(e,t)=>{const[n,s]=t,r=Wl(2);return{a:()=>Bl(e,Bl(r,Ql(n,s))),b:()=>Bl(e,Bl(r,Ql(s,n)))}}},{kernelName:ba,inputsToSave:["x"],gradFunc:(e,t)=>{const[n]=t;return{x:()=>Bl(e,Bl(Nl(n,"float32"),2))}}},{kernelName:Fa,gradFunc:e=>({x:()=>Pl(e)})},{kernelName:Ca,inputsToSave:["a","b"],gradFunc:(e,t)=>{const[n,s]=t,r=su(n.shape,s.shape);return{a:()=>{let t=e;const s=nu(n.shape,r);return s.length>0&&(t=Dh(t,s)),Tc(t,n.shape)},b:()=>{let t=e;const n=nu(s.shape,r);return n.length>0&&(t=Dh(t,n)),Tc(sd(t),s.shape)}}}},{kernelName:la,inputsToSave:["x"],gradFunc:(e,t,n)=>{const[s]=t,r=s.shape.slice(),{axis:a}=n;en(a,s.shape).forEach((e=>{r[e]=1}));const i=Tc(e,r),o=Bl(i,vd(s.shape,"float32"));return{x:()=>o}}},{kernelName:Sa,inputsToSave:["x"],gradFunc:(e,t)=>{const[n]=t;return{x:()=>Fl(e,Ll(ih(n)))}}},{kernelName:Ea,outputsToSave:[!0],gradFunc:(e,t)=>{const[n]=t;return{x:()=>Bl(Ql(Wl(1),Ll(n)),e)}}},Ky,{kernelName:Na,gradFunc:(e,t,n)=>{const s=n,{perm:r}=s,a=Th(r);return{x:()=>Jp(e,a)}}},{kernelName:Ra,gradFunc:(e,t,n)=>{const s=n,{axis:r}=s;return{value:()=>Np(e,r)}}},{kernelName:Da,inputsToSave:["segmentIds"],gradFunc:(e,t)=>{const[n]=t;return{x:()=>function(e,t){const n=ru(t,Pl(t)),s=Gh(e,n);let r=jh(t,Wl(0,"int32"));const a=s.rank-r.rank;for(let e=0;e({x:()=>Pl(e)})}];for(const e of Xy)Xa(e);Fi().prototype.abs=function(){return this.throwIfDisposed(),eu(this)},Fi().prototype.acos=function(){return this.throwIfDisposed(),nc(this)},Fi().prototype.acosh=function(){return this.throwIfDisposed(),sc(this)},Fi().prototype.add=function(e){return this.throwIfDisposed(),Dl(this,e)},Fi().prototype.all=function(e,t){return this.throwIfDisposed(),ac(this,e,t)},Fi().prototype.any=function(e,t){return this.throwIfDisposed(),ic(this,e,t)},Fi().prototype.argMax=function(e){return this.throwIfDisposed(),oc(this,e)},Fi().prototype.argMin=function(e){return this.throwIfDisposed(),lc(this,e)},Fi().prototype.asScalar=function(){return this.throwIfDisposed(),qt(1===this.size,(()=>"The array must have only 1 element.")),Tc(this,[])},Fi().prototype.asType=function(e){return this.throwIfDisposed(),Nl(this,e)},Fi().prototype.as1D=function(){return this.throwIfDisposed(),Tc(this,[this.size])},Fi().prototype.as2D=function(e,t){return this.throwIfDisposed(),Tc(this,[e,t])},Fi().prototype.as3D=function(e,t,n){return this.throwIfDisposed(),Tc(this,[e,t,n])},Fi().prototype.as4D=function(e,t,n,s){return this.throwIfDisposed(),Tc(this,[e,t,n,s])},Fi().prototype.as5D=function(e,t,n,s,r){return this.throwIfDisposed(),Tc(this,[e,t,n,s,r])},Fi().prototype.asin=function(){return this.throwIfDisposed(),uc(this)},Fi().prototype.asinh=function(){return this.throwIfDisposed(),cc(this)},Fi().prototype.atan=function(){return this.throwIfDisposed(),hc(this)},Fi().prototype.atan2=function(e){return this.throwIfDisposed(),dc(this,e)},Fi().prototype.atanh=function(){return this.throwIfDisposed(),pc(this)},Fi().prototype.avgPool=function(e,t,n,s){return this.throwIfDisposed(),Nc(this,e,t,n,s)},Fi().prototype.batchToSpaceND=function(e,t){return this.throwIfDisposed(),Lc(this,e,t)},Fi().prototype.batchNorm=function(e,t,n,s,r){return this.throwIfDisposed(),Pc(this,e,t,n,s,r)},Fi().prototype.broadcastTo=function(e){return this.throwIfDisposed(),Hc(this,e)},Fi().prototype.cast=function(e){return this.throwIfDisposed(),Nl(this,e)},Fi().prototype.ceil=function(){return this.throwIfDisposed(),$c(this)},Fi().prototype.clipByValue=function(e,t){return this.throwIfDisposed(),Kc(this,e,t)},Fi().prototype.concat=function(e,t){return this.throwIfDisposed(),e instanceof Mi&&(e=[e]),Rc([this,...e],t)},Fi().prototype.conv1d=function(e,t,n,s,r,a){return this.throwIfDisposed(),eh(this,e,t,n,s,r,a)},Fi().prototype.conv2dTranspose=function(e,t,n,s,r){return this.throwIfDisposed(),nh(this,e,t,n,s,r)},Fi().prototype.conv2d=function(e,t,n,s,r,a){return this.throwIfDisposed(),Jc(this,e,t,n,s,r,a)},Fi().prototype.cos=function(){return this.throwIfDisposed(),ih(this)},Fi().prototype.cosh=function(){return this.throwIfDisposed(),oh(this)},Fi().prototype.cumprod=function(e,t,n){return this.throwIfDisposed(),lh(this,e,t,n)},Fi().prototype.cumsum=function(e,t,n){return this.throwIfDisposed(),uh(this,e,t,n)},Fi().prototype.depthToSpace=function(e,t){return this.throwIfDisposed(),hh(this,e,t)},Fi().prototype.depthwiseConv2d=function(e,t,n,s,r,a){return this.throwIfDisposed(),dh(this,e,t,n,s,r,a)},Fi().prototype.dilation2d=function(e,t,n,s,r){return this.throwIfDisposed(),fh(this,e,t,n,s,r)},Fi().prototype.divNoNan=function(e){return this.throwIfDisposed(),yh(this,e)},Fi().prototype.div=function(e){return this.throwIfDisposed(),Fl(this,e)},Fi().prototype.dot=function(e){return this.throwIfDisposed(),bh(this,e)},Fi().prototype.elu=function(){return this.throwIfDisposed(),vh(this)},Fi().prototype.equal=function(e){return this.throwIfDisposed(),mh(this,e)},Fi().prototype.erf=function(){return this.throwIfDisposed(),Ah(this)},Fi().prototype.euclideanNorm=function(e,t){return this.throwIfDisposed(),Bh(this,e,t)},Fi().prototype.exp=function(){return this.throwIfDisposed(),zh(this)},Fi().prototype.expandDims=function(e){return this.throwIfDisposed(),Lh(this,e)},Fi().prototype.expm1=function(){return this.throwIfDisposed(),Ph(this)},Fi().prototype.fft=function(){return this.throwIfDisposed(),kp(this)},Fi().prototype.flatten=function(){return this.throwIfDisposed(),Tc(this,[this.size])},Fi().prototype.floor=function(){return this.throwIfDisposed(),Uh(this)},Fi().prototype.floorDiv=function(e){return this.throwIfDisposed(),Ml(this,e)},Fi().prototype.gather=function(e,t,n){return this.throwIfDisposed(),Gh(this,e,t,n)},Fi().prototype.greaterEqual=function(e){return this.throwIfDisposed(),jh(this,e)},Fi().prototype.greater=function(e){return this.throwIfDisposed(),qh(this,e)},Fi().prototype.ifft=function(){return this.throwIfDisposed(),Cp(this)},Fi().prototype.irfft=function(){return this.throwIfDisposed(),Sp(this)},Fi().prototype.isFinite=function(){return this.throwIfDisposed(),$h(this)},Fi().prototype.isInf=function(){return this.throwIfDisposed(),Kh(this)},Fi().prototype.isNaN=function(){return this.throwIfDisposed(),Xh(this)},Fi().prototype.leakyRelu=function(e){return this.throwIfDisposed(),Zh(this,e)},Fi().prototype.lessEqual=function(e){return this.throwIfDisposed(),Qh(this,e)},Fi().prototype.less=function(e){return this.throwIfDisposed(),Yh(this,e)},Fi().prototype.localResponseNormalization=function(e,t,n,s){return this.throwIfDisposed(),ed(this,e,t,n,s)},Fi().prototype.logSigmoid=function(){return this.throwIfDisposed(),ad(this)},Fi().prototype.logSoftmax=function(e){return this.throwIfDisposed(),id(this,e)},Fi().prototype.logSumExp=function(e,t){return this.throwIfDisposed(),od(this,e,t)},Fi().prototype.log=function(){return this.throwIfDisposed(),td(this)},Fi().prototype.log1p=function(){return this.throwIfDisposed(),nd(this)},Fi().prototype.logicalAnd=function(e){return this.throwIfDisposed(),ld(this,e)},Fi().prototype.logicalNot=function(){return this.throwIfDisposed(),ud(this)},Fi().prototype.logicalOr=function(e){return this.throwIfDisposed(),cd(this,e)},Fi().prototype.logicalXor=function(e){return this.throwIfDisposed(),hd(this,e)},Fi().prototype.matMul=function(e,t,n){return this.throwIfDisposed(),Dc(this,e,t,n)},Fi().prototype.maxPool=function(e,t,n,s){return this.throwIfDisposed(),md(this,e,t,n,s)},Fi().prototype.max=function(e,t){return this.throwIfDisposed(),Oh(this,e,t)},Fi().prototype.maximum=function(e){return this.throwIfDisposed(),ru(this,e)},Fi().prototype.mean=function(e,t){return this.throwIfDisposed(),bd(this,e,t)},Fi().prototype.min=function(e,t){return this.throwIfDisposed(),Rh(this,e,t)},Fi().prototype.minimum=function(e){return this.throwIfDisposed(),Ad(this,e)},Fi().prototype.mirrorPad=function(e,t){return this.throwIfDisposed(),kd(this,e,t)},Fi().prototype.mod=function(e){return this.throwIfDisposed(),Cd(this,e)},Fi().prototype.mul=function(e){return this.throwIfDisposed(),Bl(this,e)},Fi().prototype.neg=function(){return this.throwIfDisposed(),sd(this)},Fi().prototype.norm=function(e,t,n){return this.throwIfDisposed(),Fh(this,e,t,n)},Fi().prototype.notEqual=function(e){return this.throwIfDisposed(),Id(this,e)},Fi().prototype.oneHot=function(e,t=1,n=0){return this.throwIfDisposed(),Td(this,e,t,n)},Fi().prototype.onesLike=function(){return this.throwIfDisposed(),Nd(this)},Fi().prototype.pad=function(e,t){return this.throwIfDisposed(),Rd(this,e,t)},Fi().prototype.pool=function(e,t,n,s,r,a){return this.throwIfDisposed(),Ld(this,e,t,n,s,r,a)},Fi().prototype.pow=function(e){return this.throwIfDisposed(),Yl(this,e)},Fi().prototype.prelu=function(e){return this.throwIfDisposed(),Pd(this,e)},Fi().prototype.prod=function(e,t){return this.throwIfDisposed(),Vd(this,e,t)},Fi().prototype.reciprocal=function(){return this.throwIfDisposed(),np(this)},Fi().prototype.relu=function(){return this.throwIfDisposed(),sp(this)},Fi().prototype.relu6=function(){return this.throwIfDisposed(),rp(this)},Fi().prototype.reshapeAs=function(e){return this.throwIfDisposed(),Tc(this,e.shape)},Fi().prototype.reshape=function(e){return this.throwIfDisposed(),Tc(this,e)},Fi().prototype.resizeBilinear=function(e,t,n){return this.throwIfDisposed(),qf(this,e,t,n)},Fi().prototype.resizeNearestNeighbor=function(e,t,n){return this.throwIfDisposed(),jf(this,e,t,n)},Fi().prototype.reverse=function(e){return this.throwIfDisposed(),ap(this,e)},Fi().prototype.rfft=function(){return this.throwIfDisposed(),_p(this)},Fi().prototype.round=function(){return this.throwIfDisposed(),cp(this)},Fi().prototype.rsqrt=function(){return this.throwIfDisposed(),hp(this)},Fi().prototype.selu=function(){return this.throwIfDisposed(),dp(this)},Fi().prototype.separableConv2d=function(e,t,n,s,r,a){return this.throwIfDisposed(),pp(this,e,t,n,s,r,a)},Fi().prototype.sigmoid=function(){return this.throwIfDisposed(),Mc(this)},Fi().prototype.sign=function(){return this.throwIfDisposed(),mp(this)},Fi().prototype.sin=function(){return this.throwIfDisposed(),gp(this)},Fi().prototype.sinh=function(){return this.throwIfDisposed(),yp(this)},Fi().prototype.slice=function(e,t){return this.throwIfDisposed(),Fc(this,e,t)},Fi().prototype.softmax=function(e){return this.throwIfDisposed(),Ap(this,e)},Fi().prototype.softplus=function(){return this.throwIfDisposed(),rd(this)},Fi().prototype.spaceToBatchND=function(e,t){return this.throwIfDisposed(),zd(this,e,t)},Fi().prototype.split=function(e,t){return this.throwIfDisposed(),Ep(this,e,t)},Fi().prototype.sqrt=function(){return this.throwIfDisposed(),zl(this)},Fi().prototype.square=function(){return this.throwIfDisposed(),Ll(this)},Fi().prototype.squaredDifference=function(e){return this.throwIfDisposed(),Ip(this,e)},Fi().prototype.squeeze=function(e){return this.throwIfDisposed(),Tp(this,e)},Fi().prototype.stack=function(e,t){this.throwIfDisposed();const n=e instanceof Mi?[this,e]:[this,...e];return Np(n,t)},Fi().prototype.step=function(e){return this.throwIfDisposed(),Op(this,e)},Fi().prototype.stridedSlice=function(e,t,n,s,r,a,i,o){return this.throwIfDisposed(),Rp(this,e,t,n,s,r,a,i,o)},Fi().prototype.sub=function(e){return this.throwIfDisposed(),Ql(this,e)},Fi().prototype.sum=function(e,t){return this.throwIfDisposed(),Dh(this,e,t)},Fi().prototype.tan=function(){return this.throwIfDisposed(),Dp(this)},Fi().prototype.tanh=function(){return this.throwIfDisposed(),Bc(this)},Fi().prototype.tile=function(e){return this.throwIfDisposed(),Vh(this,e)},Fi().prototype.toBool=function(){return this.throwIfDisposed(),Nl(this,"bool")},Fi().prototype.toFloat=function(){return this.throwIfDisposed(),Nl(this,"float32")},Fi().prototype.toInt=function(){return this.throwIfDisposed(),Nl(this,"int32")},Fi().prototype.topk=function(e,t){return this.throwIfDisposed(),Gp(this,e,t)},Fi().prototype.transpose=function(e){return this.throwIfDisposed(),Jp(this,e)},Fi().prototype.unique=function(e){return this.throwIfDisposed(),jp(this,e)},Fi().prototype.unsortedSegmentSum=function(e,t){return this.throwIfDisposed(),Hp(this,e,t)},Fi().prototype.unstack=function(e){return this.throwIfDisposed(),$p(this,e)},Fi().prototype.where=function(e,t){return this.throwIfDisposed(),gh(e,this,t)},Fi().prototype.zerosLike=function(){return this.throwIfDisposed(),Pl(this)};class Zy extends Error{constructor(e){super(e),Object.setPrototypeOf(this,Zy.prototype)}}class Yy extends Error{constructor(e){super(e),Object.setPrototypeOf(this,Yy.prototype)}}class Qy extends Error{constructor(e){super(e),Object.setPrototypeOf(this,Qy.prototype)}}class Jy extends Error{constructor(e){super(e),Object.setPrototypeOf(this,Jy.prototype)}}class eb extends Error{constructor(e){super(e),Object.setPrototypeOf(this,eb.prototype)}}Error;class tb{constructor(e){this.maxEntries=e||100,this.cache=new Map}get(e){let t;return this.cache.has(e)&&(t=this.cache.get(e),this.cache.delete(e),this.cache.set(e,t)),t}put(e,t){if(this.cache.has(e))this.cache.delete(e);else if(this.cache.size>=this.maxEntries){const e=this.cache.keys().next().value;this.cache.delete(e)}this.cache.set(e,t)}getMaxEntries(){return this.maxEntries}setMaxEntries(e){if(e<0)throw new Error(`The maxEntries of LRU caches must be at least 0, but got ${e}.`);if(this.maxEntries>e)for(let t=0;tt.toUpperCase()))}let ub={};function cb(e){if(null==e)return null;const t={};return t.className=e.getClassName(),t.config=e.getConfig(),t}function hb(e){if(null!=e&&"object"==typeof e)if(Array.isArray(e))e.forEach((e=>hb(e)));else{const t=Object.keys(e);for(const n of t){const t=e[n];null!=t&&"object"==typeof t&&(Array.isArray(t)||"ndarray"!==t.type||"number"!=typeof t.value?hb(t):e[n]=t.value)}}}function db(e,t={},n={},s="object",r=!1){if("string"==typeof e){const r=e;let a;if(r in n)a=n[r];else if(r in ub)a=ub[r];else if(a=t[r],null==a)throw new Qy(`Unknown ${s}: ${e}. This may be due to one of the following reasons:\n1. The ${s} is defined in Python, in which case it needs to be ported to TensorFlow.js or your JavaScript code.\n2. The custom ${s} is defined in JavaScript, but is not registered properly with tf.serialization.registerClass().`);return a}{const a=e;if(null==a.className||null==a.config)throw new Qy(`${s}: Improper config format: ${JSON.stringify(a)}.\n'className' and 'config' must set.`);const i=a.className;let o,l;if(i in n?[o,l]=n[i]:i in ub?[o,l]=ub.className:i in t&&([o,l]=t[i]),null==o)throw new Qy(`Unknown ${s}: ${i}. This may be due to one of the following reasons:\n1. The ${s} is defined in Python, in which case it needs to be ported to TensorFlow.js or your JavaScript code.\n2. The custom ${s} is defined in JavaScript, but is not registered properly with tf.serialization.registerClass().`);if(null!=l){const e={};for(const t of Object.keys(ub))e[t]=ub[t];for(const t of Object.keys(n))e[t]=n[t];a.config.customObjects=e;const t=Object.assign({},ub);for(const e of Object.keys(n))ub[e]=n[e];hb(a.config);const s=l(o,a.config,n,r);return ub=Object.assign({},t),s}{const e=Object.assign({},ub);for(const e of Object.keys(n))ub[e]=n[e];const t=new o(a.config);return ub=Object.assign({},e),t}}}function pb(e,t){return-1*function(e,t){return et?1:0}(e,t)}function fb(e){if(null==e)return e;const t=[];for(const n of e)-1===t.indexOf(n)&&t.push(n);return t}function mb(e){if(null==e)throw new Qy(`Invalid value in obj: ${JSON.stringify(e)}`);for(const t in e)if(e.hasOwnProperty(t))return!1;return!0}function gb(e,t,n){if(null!=n&&e.indexOf(n)<0)throw new Qy(`${n} is not a valid ${t}. Valid values are ${e} or null/undefined.`)}function yb(e,t,n=0,s=1/0){return sb(n>=0),sb(s>=n),Array.isArray(e)&&e.length>=n&&e.length<=s&&e.every((e=>typeof e===t))}function bb(e,t){Array.isArray(e)?(qt(e.length>0,(()=>`${t} is unexpectedly an empty array.`)),e.forEach(((e,n)=>bb(e,`element ${n+1} of ${t}`)))):qt(Number.isInteger(e)&&e>0,(()=>`Expected ${t} to be a positive integer, but got ${wb(e)}.`))}function wb(e){return null===e?"null":Array.isArray(e)?"["+e.map((e=>wb(e))).join(",")+"]":"string"==typeof e?`"${e}"`:`${e}`}function vb(e){return"relu"===e?"relu":"linear"===e?"linear":"elu"===e?"elu":null}let xb=0;function Ab(){return xb++}const kb={};function Cb(e=""){return e in kb||(kb[e]=0),kb[e]+=1,e+kb[e].toString()}const Sb=["channelsFirst","channelsLast"],Eb=["nearest","bilinear"],_b=["valid","same","causal"],Ib=["max","avg"],Tb=["sum","mul","concat","ave"],Nb=new Map;function Ob(e){gb(Sb,"DataFormat",e)}function Rb(e){gb(_b,"PaddingMode",e)}function Db(e){gb(Ib,"PoolMode",e)}const Mb=[],Fb="/";function Bb(e,t){Mb.push(e);try{const e=t();return Mb.pop(),e}catch(e){throw Mb.pop(),e}}function zb(e){if(!Vb(e))throw new Error("Not a valid tensor name: '"+e+"'");return(0===Mb.length?"":Mb.join(Fb)+Fb)+e}function Lb(e){if(!Vb(e))throw new Error("Not a valid tensor name: '"+e+"'");Nb.has(e)||Nb.set(e,0);const t=Nb.get(e);if(Nb.set(e,Nb.get(e)+1),t>0){const n=`${e}_${t}`;return Nb.set(n,1),n}return e}const Pb=new RegExp(/^[A-Za-z0-9][-A-Za-z0-9\._\/]*$/);function Vb(e){return!!e.match(Pb)}function Wb(e,t,n){null==t&&(t=0),null==n&&(n=e.length);let s=1;for(let r=t;rt&&(t=s)}return t}function qb(e,t){if(t{switch(e.rank){case 1:return bp(e,t,n);case 2:return wp(e,[t,0],[n,e.shape[1]]);case 3:return vp(e,[t,0,0],[n,e.shape[1],e.shape[2]]);case 4:return xp(e,[t,0,0,0],[n,e.shape[1],e.shape[2],e.shape[3]]);case 5:return Fc(e,[t,0,0,0,0],[n,e.shape[1],e.shape[2],e.shape[3],e.shape[4]]);case 6:return Fc(e,[t,0,0,0,0,0],[n,e.shape[1],e.shape[2],e.shape[3],e.shape[4],e.shape[5]]);default:throw new Qy(`sliceAlongFirstAxis() received an unsupported tensor rank: ${e.rank}`)}}))}function Zb(e,t,n){return Ao((()=>{switch(e.rank){case 1:return bp(e,t,n);case 2:return wp(e,[0,t],[e.shape[0],n]);case 3:return vp(e,[0,0,t],[e.shape[0],e.shape[1],n]);case 4:return xp(e,[0,0,0,t],[e.shape[0],e.shape[1],e.shape[2],n]);default:throw new Qy(`sliceAlongLastAxis() received an unsupported tensor rank: ${e.rank}`)}}))}function Yb(e,t,n,s){return Ao((()=>{switch(e.rank){case 1:return bp(e,t,n);case 2:switch(s){case 1:return Xb(e,t,n);case 2:return Zb(e,t,n);default:throw new Qy(`The axis is not within the rank of the tensor ${s}`)}case 3:switch(s){case 1:return Xb(e,t,n);case 2:return vp(e,[0,t,0],[e.shape[0],n,e.shape[2]]);case 3:return Zb(e,t,n);default:throw new Qy(`The axis is not within the rank of the tensor ${s}`)}case 4:switch(s){case 1:return Xb(e,t,n);case 2:return xp(e,[0,t,0,0],[e.shape[0],n,e.shape[2],e.shape[3]]);case 3:return xp(e,[0,0,t,0],[e.shape[0],e.shape[1],n,e.shape[3]]);case 4:return Zb(e,t,n);default:throw new Qy(`The axis is not within the rank of the tensor ${s}`)}default:throw new Qy(`sliceAlongLastAxis() received an unsupported tensor rank: ${e.rank}`)}}))}function Qb(e,t=-1){let n;return t<0&&(n=e[0].rank,t=0!==n?n:0),t===e[0].rank&&(t=-1),Rc(e,t)}function Jb(e,t){switch(e.rank){case 1:return Xc([e,t]);case 2:return Zc([e,t],0);case 3:return Yc([e,t],0);case 4:return Qc([e,t],0);default:throw new Qy(`concatAlongFirstAxis() received an unsupported tensor rank: ${e.rank}`)}}function ew(e,t){if(Array.isArray(t)||(t=[t]),e.rank!==t.length)throw new Qy(`The length of input n (${t.length}) does not match the number of dimensions in input x (${e.rank})`);return Vh(e,t)}function tw(e,t=0,n=1,s,r){return Zd(e,t,n,s,r)}function nw(e,t,n,s){if(e.rank<2||t.rank<2)throw new Jy(`dot requires both inputs to be rank >= 2 but got x shape = ${e.shape} and y shape = ${t.shape}`);if(t.rank>=3){if(e.shape.slice(-1)[0]!==t.shape.slice(-2)[0])throw new Jy(`If rank y >= 3, then the second last dim of y must equal the last dim of x but got x shape = ${e.shape} and y shape = ${t.shape}`)}if(2===e.rank&&2===t.rank){return bf({a:e,b:t,transposeA:!1,transposeB:!1,bias:s?aw(e.rank,s,"channelsLast"):null,activation:n})}{const r=e.shape.slice(),a=r.pop();e=Tc(e,[-1,a]);const i=t.shape.slice(),o=i.pop(),l=i.pop(),u=[...i,o],c=Array.from({length:t.rank},((e,n)=>0===n?t.rank-2:n<=t.rank-2?n-1:n));t=Tc(Jp(t,c),[l,-1]);const h=[...r,...u];return Tc(bf({a:e,b:t,transposeA:!1,transposeB:!1,bias:s?aw(e.rank,s,"channelsLast"):null,activation:n}),h)}}function sw(e,t,n){return Ao((()=>(t=Array.isArray(t)?Mp(t,"int32"):Nl(t,"int32"),Gh(e,t,n))))}function rw(e){return Bl(e,e)}function aw(e,t,n){const s=t.shape;if(1!==t.rank&&t.rank!==e)throw new Qy(`Unexpected bias dimensions: ${t.rank}; expected it to be 1 or ${e}`);if(5===e){if("channelsFirst"===n)return 1===s.length?Tc(t,[1,s[0],1,1,1]):Tc(t,[1,s[3],s[0],s[1],s[2]]);if("channelsLast"===n)return 1===s.length?Tc(t,[1,1,1,1,s[0]]):Tc(t,[1].concat(s))}else if(4===e){if("channelsFirst"===n)return 1===s.length?Tc(t,[1,s[0],1,1]):Tc(t,[1,s[2],s[0],s[1]]);if("channelsLast"===n)return 1===s.length?Tc(t,[1,1,1,s[0]]):Tc(t,[1].concat(s))}else if(3===e){if("channelsFirst"===n)return 1===s.length?Tc(t,[1,s[0],1]):Tc(t,[1,s[1],s[0]]);if("channelsLast"===n)return 1===s.length?Tc(t,[1,1,s[0]]):Tc(t,[1].concat(s))}else if(e<3)return t;throw new Qy(`Unsupported input rank by biasAdd: ${t.rank}`)}function iw(e,t,n){return Ao((()=>(null==n&&(n="channelsLast"),Ob(n),Dl(e,aw(e.rank,t,n)))))}function ow(e,t,n,s){return Ao((()=>rf(e,t,n,s)))}function lw(e,t,n=!1){return n?e():t()}const uw=["fanIn","fanOut","fanAvg"],cw=["normal","uniform","truncatedNormal"];class hw extends ql{fromConfigUsesCustomObjects(){return!1}getConfig(){return{}}}class dw extends hw{apply(e,t){return wd(e,t)}}dw.className="Zeros",Hl(dw);class pw extends hw{apply(e,t){return vd(e,t)}}pw.className="Ones",Hl(pw);class fw extends hw{constructor(e){if(super(),"object"!=typeof e)throw new Qy(`Expected argument of type ConstantConfig but got ${e}`);if(void 0===e.value)throw new Qy(`config must have value set but got ${e}`);this.value=e.value}apply(e,t){return Ao((()=>Bl(Wl(this.value),vd(e,t))))}getConfig(){return{value:this.value}}}fw.className="Constant",Hl(fw);class mw extends hw{constructor(e){super(),this.DEFAULT_MINVAL=-.05,this.DEFAULT_MAXVAL=.05,this.minval=e.minval||this.DEFAULT_MINVAL,this.maxval=e.maxval||this.DEFAULT_MAXVAL,this.seed=e.seed}apply(e,t){return Qd(e,this.minval,this.maxval,t,this.seed)}getConfig(){return{minval:this.minval,maxval:this.maxval,seed:this.seed}}}mw.className="RandomUniform",Hl(mw);class gw extends hw{constructor(e){super(),this.DEFAULT_MEAN=0,this.DEFAULT_STDDEV=.05,this.mean=e.mean||this.DEFAULT_MEAN,this.stddev=e.stddev||this.DEFAULT_STDDEV,this.seed=e.seed}apply(e,t){if("float32"!==(t=t||"float32")&&"int32"!==t)throw new Jy(`randomNormal does not support dType ${t}.`);return tw(e,this.mean,this.stddev,t,this.seed)}getConfig(){return{mean:this.mean,stddev:this.stddev,seed:this.seed}}}gw.className="RandomNormal",Hl(gw);class yw extends hw{constructor(e){super(),this.DEFAULT_MEAN=0,this.DEFAULT_STDDEV=.05,this.mean=e.mean||this.DEFAULT_MEAN,this.stddev=e.stddev||this.DEFAULT_STDDEV,this.seed=e.seed}apply(e,t){if("float32"!==(t=t||"float32")&&"int32"!==t)throw new Jy(`truncatedNormal does not support dType ${t}.`);return qp(e,this.mean,this.stddev,t,this.seed)}getConfig(){return{mean:this.mean,stddev:this.stddev,seed:this.seed}}}yw.className="TruncatedNormal",Hl(yw);class bw extends hw{constructor(e){super(),this.gain=null!=e.gain?e.gain:1}apply(e,t){return Ao((()=>{if(2!==e.length||e[0]!==e[1])throw new Qy("Identity matrix initializer can only be used for 2D square matrices.");return Bl(this.gain,Wh(e[0]))}))}getConfig(){return{gain:this.gain}}}bw.className="Identity",Hl(bw);class ww extends hw{constructor(e){if(super(),e.scale<0)throw new Qy(`scale must be a positive float. Got: ${e.scale}`);var t;this.scale=null==e.scale?1:e.scale,this.mode=null==e.mode?"fanIn":e.mode,t=this.mode,gb(uw,"FanMode",t),this.distribution=null==e.distribution?"normal":e.distribution,function(e){gb(cw,"Distribution",e)}(this.distribution),this.seed=e.seed}apply(e,t){const n=function(e,t="channelsLast"){let n,s;if(Ob(t),2===e.length)n=e[0],s=e[1];else if(-1!==[3,4,5].indexOf(e.length)){if("channelsFirst"===t){const t=Wb(e,2);n=e[1]*t,s=e[0]*t}else if("channelsLast"===t){const t=Wb(e,0,e.length-2);n=e[e.length-2]*t,s=e[e.length-1]*t}}else{const t=Wb(e);n=Math.sqrt(t),s=Math.sqrt(t)}return[n,s]}(e),s=n[0],r=n[1];let a=this.scale;if("fanIn"===this.mode?a/=Math.max(1,s):"fanOut"===this.mode?a/=Math.max(1,r):a/=Math.max(1,(s+r)/2),"normal"===this.distribution){const n=Math.sqrt(a);if("float32"!==(t=t||"float32")&&"int32"!==t)throw new Jy(`${this.getClassName()} does not support dType ${t}.`);return qp(e,0,n,t,this.seed)}{const n=Math.sqrt(3*a);return Qd(e,-n,n,t,this.seed)}}getConfig(){return{scale:this.scale,mode:this.mode,distribution:this.distribution,seed:this.seed}}}ww.className="VarianceScaling",Hl(ww);class vw extends ww{constructor(e){super({scale:1,mode:"fanAvg",distribution:"uniform",seed:null==e?null:e.seed})}getClassName(){return ww.className}}vw.className="GlorotUniform",Hl(vw);class xw extends ww{constructor(e){super({scale:1,mode:"fanAvg",distribution:"normal",seed:null==e?null:e.seed})}getClassName(){return ww.className}}xw.className="GlorotNormal",Hl(xw);class Aw extends ww{constructor(e){super({scale:2,mode:"fanIn",distribution:"normal",seed:null==e?null:e.seed})}getClassName(){return ww.className}}Aw.className="HeNormal",Hl(Aw);class kw extends ww{constructor(e){super({scale:2,mode:"fanIn",distribution:"uniform",seed:null==e?null:e.seed})}getClassName(){return ww.className}}kw.className="HeUniform",Hl(kw);class Cw extends ww{constructor(e){super({scale:1,mode:"fanIn",distribution:"normal",seed:null==e?null:e.seed})}getClassName(){return ww.className}}Cw.className="LeCunNormal",Hl(Cw);class Sw extends ww{constructor(e){super({scale:1,mode:"fanIn",distribution:"uniform",seed:null==e?null:e.seed})}getClassName(){return ww.className}}Sw.className="LeCunUniform",Hl(Sw);class Ew extends hw{constructor(e){super(),this.DEFAULT_GAIN=1,this.ELEMENTS_WARN_SLOW=2e3,this.gain=null==e.gain?this.DEFAULT_GAIN:e.gain,this.seed=e.seed}apply(e,t){return Ao((()=>{if(e.length<2)throw new Jy("Shape must be at least 2D.");if("int32"!==t&&"float32"!==t&&void 0!==t)throw new TypeError(`Unsupported data type ${t}.`);const n=$t(e.slice(0,-1)),s=e[e.length-1];this.ELEMENTS_WARN_SLOW;const r=tw([Math.max(s,n),Math.min(s,n)],0,1,t,this.seed),a=wm.qr(r,!1);let i=a[0];const o=a[1].flatten().stridedSlice([0],[Math.min(s,n)*Math.min(s,n)],[Math.min(s,n)+1]);return i=Bl(i,o.sign()),ne*t));return t}const Bw="Variable";class zw{constructor(e,t="float32",n=Bw,s=!0,r=null){this.dtype=null==t?"float32":t,this.shape=e.shape,this.id=Ab(),n=null==n?Bw:n,this.originalName=zb(n),this.name=Lb(this.originalName),this.trainable_=s,this.constraint=r,this.val=Xp(e,this.trainable_,this.name,this.dtype)}read(){return this.assertNotDisposed(),this.val}write(e){return this.assertNotDisposed(),function(e,t){if(e.shape.toString()!==t.shape.toString())throw new Error("Shape mismatch: "+JSON.stringify(e.shape)+" vs. "+JSON.stringify(t.shape))}(this.val,e),this.val.id!==e.id&&(this.val.assign(e),null!=this.constraint&&this.val.assign(this.constraint.apply(this.val))),this}dispose(){this.assertNotDisposed(),this.val.dispose()}assertNotDisposed(){if(this.val.isDisposed)throw new Error(`LayersVariable ${this.name} is already disposed.`)}get trainable(){return this.trainable_}set trainable(e){this.trainable_=e,this.val.trainable=e}}function Lw(e){return e.map((e=>e.read()))}function Pw(e){e.forEach((e=>{e[0].write(e[1])}))}class Vw{constructor(e){this.dtype=e.dtype,this.shape=e.shape,null!=e.shape?this.ndim=e.shape.length:this.ndim=e.ndim,this.maxNDim=e.maxNDim,this.minNDim=e.minNDim,this.axes=e.axes||{}}}class Ww{constructor(e,t,n,s,r,a,i){this.dtype=e,this.shape=t,this.sourceLayer=n,this.inputs=s,this.callArgs=r,this.outputTensorIndex=i,this.id=Ab(),null!=a&&(this.originalName=zb(a),this.name=Lb(this.originalName)),this.rank=t.length}}let Uw=0;class Gw{constructor(e,t){this.callArgs=t,this.id=Uw++,this.outboundLayer=e.outboundLayer,this.inboundLayers=e.inboundLayers,this.nodeIndices=e.nodeIndices,this.tensorIndices=e.tensorIndices,this.inputTensors=e.inputTensors,this.outputTensors=e.outputTensors,this.inputMasks=e.inputMasks,this.outputMasks=e.outputMasks,this.inputShapes=e.inputShapes,this.outputShapes=e.outputShapes;for(const t of e.inboundLayers)null!=t&&t.outboundNodes.push(this);e.outboundLayer.inboundNodes.push(this)}getConfig(){const e=[];for(const t of this.inboundLayers)null!=t?e.push(t.name):e.push(null);return{outboundLayer:this.outboundLayer?this.outboundLayer.name:null,inboundLayers:e,nodeIndices:this.nodeIndices,tensorIndices:this.tensorIndices}}}let qw=0;class jw extends ql{constructor(e={}){super(),this._callHook=null,this._addedWeightNames=[],this._stateful=!1,this.id=qw++,this.activityRegularizer=null,this.inputSpec=null,this.supportsMasking=!1,this._trainableWeights=[],this._nonTrainableWeights=[],this._losses=[],this._updates=[],this._built=!1,this.inboundNodes=[],this.outboundNodes=[];let t=e.name;if(!t){const e=this.getClassName();t=ob(e)+"_"+Cb(e)}if(this.name=t,this.trainable_=null==e.trainable||e.trainable,null!=e.inputShape||null!=e.batchInputShape){let t;if(null!=e.batchInputShape)t=e.batchInputShape;else if(null!=e.inputShape){let n=null;null!=e.batchSize&&(n=e.batchSize),t=[n].concat(e.inputShape)}this.batchInputShape=t;let n=e.dtype;null==n&&(n=e.inputDType),null==n&&(n="float32"),this.dtype=n}null!=e.weights?this.initialWeights=e.weights:this.initialWeights=null,this._refCount=null,this.fastWeightInitDuringBuild=!1}static nodeKey(e,t){return e.name+"_ib-"+t.toString()}getNodeAtIndex(e,t){if(0===this.inboundNodes.length)throw new Yy(`The layer has never been called and thus has no defined ${t}.`);if(this.inboundNodes.length<=e)throw new Qy(`Asked to get ${t} at node ${e}, but the layer has only ${this.inboundNodes.length} inbound nodes.`);return this.inboundNodes[e]}getInputAt(e){return ab(this.getNodeAtIndex(e,"input").inputTensors)}getOutputAt(e){return ab(this.getNodeAtIndex(e,"output").outputTensors)}get input(){if(this.inboundNodes.length>1)throw new Zy(`Layer ${this.name} has multiple inbound nodes, hence the notion of "layer input" is ill-defined. Use \`getInputAt(nodeIndex)\` instead.`);if(0===this.inboundNodes.length)throw new Zy(`Layer ${this.name} is not connected, no input to return.`);return ab(this.getNodeAtIndex(0,"input").inputTensors)}get output(){if(0===this.inboundNodes.length)throw new Zy(`Layer ${this.name} has no inbound nodes.`);if(this.inboundNodes.length>1)throw new Zy(`Layer ${this.name} has multiple inbound nodes, hence the notion of "layer output" is ill-defined. Use \`getOutputAt(nodeIndex)\` instead.`);return ab(this.getNodeAtIndex(0,"output").outputTensors)}get losses(){return this._losses}calculateLosses(){return this.losses.map((e=>e()))}get updates(){return this._updates}get built(){return this._built}set built(e){this._built=e}get trainable(){return this.trainable_}set trainable(e){this._trainableWeights.forEach((t=>t.trainable=e)),this.trainable_=e}get trainableWeights(){return this.trainable_?this._trainableWeights.filter((e=>e.trainable)):[]}set trainableWeights(e){this._trainableWeights=e}get nonTrainableWeights(){return this.trainable?this._trainableWeights.filter((e=>!e.trainable)).concat(this._nonTrainableWeights):this._trainableWeights.concat(this._nonTrainableWeights)}set nonTrainableWeights(e){this._nonTrainableWeights=e}get weights(){return this.trainableWeights.concat(this.nonTrainableWeights)}get stateful(){return this._stateful}resetStates(){if(!this.stateful)throw new Error("Cannot call the resetStates() method of a non-stateful Layer object.")}assertInputCompatibility(e){const t=ib(e);if(null==this.inputSpec||0===this.inputSpec.length)return;const n=ib(this.inputSpec);if(t.length!==n.length)throw new Qy(`Layer ${this.name} expects ${n.length} inputs, but it received ${t.length} input tensors. Input received: ${e}`);for(let e=0;er.maxNDim)throw new Qy(`Input ${e} is incompatible with layer ${this.name}: expected max_ndim=${r.maxNDim}, found ndim=${a}`);if(null!=r.minNDim&&a=0?t[s]:t[t.length+s];if(null!=a&&-1===[a,null].indexOf(i))throw new Qy(`Input ${e} is incompatible with layer ${this.name}: expected axis ${s} of input shape to have value ${a} but got shape ${t}.`)}}if(null!=r.shape)for(let t=0;t{if(!this.built){this.assertInputCompatibility(e);const t=[];for(const n of ib(e))t.push(n.shape);this.build(ab(t)),this.built=!0,this.initialWeights&&this.setWeights(this.initialWeights),null===this._refCount&&r&&(this._refCount=1)}if(this.assertInputCompatibility(e),r){let s=this.call(e,t);this.supportsMasking&&this.setMaskMetadata(e,s);const r=ib(s),a=[];for(let e of r)-1!==n.indexOf(e)&&(e=e.clone()),a.push(e);if(s=ab(a),null!=this.activityRegularizer)throw new Jy("Layer invocation in the presence of activity regularizer(s) is not supported yet.");return s}{const n=function(e){e=ib(e);const t=[];for(const n of e)t.push(n.shape);return ab(t)}(e),s=this.computeOutputShape(n);let r;const a="float32";if(this.warnOnIncompatibleInputShape(Array.isArray(e)?n[0]:n),r=null!=s&&s.length>0&&Array.isArray(s[0])?s.map(((n,s)=>new Ww(a,n,this,ib(e),t,this.name,s))):new Ww(a,s,this,ib(e),t,this.name),this.addInboundNode(e,r,null,null,n,s,t),this._refCount++,null!=this.activityRegularizer)throw new Jy("Layer invocation in the presence of activity regularizer(s) is not supported yet.");return r}}))}warnOnIncompatibleInputShape(e){if(null!=this.batchInputShape)if(e.length!==this.batchInputShape.length);else{let t=!1;this.batchInputShape.forEach(((n,s)=>{null!=n&&null!=e[s]&&e[s]!==n&&(t=!0)}))}}get outputShape(){if(null==this.inboundNodes||0===this.inboundNodes.length)throw new Zy(`The layer ${this.name} has never been called and thus has no defined output shape.`);const e=[];for(const t of this.inboundNodes){const n=JSON.stringify(t.outputShapes);-1===e.indexOf(n)&&e.push(n)}if(1===e.length){const e=this.inboundNodes[0].outputShapes;return Array.isArray(e)&&Array.isArray(e[0])&&1===e.length?e[0]:e}throw new Zy(`The layer ${this.name} has multiple inbound nodes with different output shapes. Hence the notion of "output shape" is ill-defined for the layer.`)}countParams(){if(!this.built)throw new Yy(`You tried to call countParams() on ${this.name}, but the layer is not built yet. Build it first by calling build(batchInputShape).`);return Fw(this.weights)}build(e){this.built=!0}getWeights(e=!1){return Lw(e?this.trainableWeights:this.weights)}setWeights(e){Ao((()=>{const t=this.weights;if(t.length!==e.length)throw new Qy(`You called setWeights(weights) on layer "${this.name}" with a weight list of length ${e.length}, but the layer was expecting ${t.length} weights. Provided weights: ${e}...`);if(0===t.length)return;const n=[],s=Lw(t);for(let r=0;rr.apply(u.read()))),null==a&&(a=!0),a?this._trainableWeights.push(u):this._nonTrainableWeights.push(u),u}setFastWeightInitDuringBuild(e){this.fastWeightInitDuringBuild=e}addLoss(e){null==e||Array.isArray(e)&&0===e.length||(e=ib(e),void 0!==this._losses&&null!==this._losses&&this.losses.push(...e))}computeOutputShape(e){return e}computeMask(e,t){if(!this.supportsMasking){if(null!=t){if(!Array.isArray(t))throw new TypeError(`Layer ${this.name} does not support masking, but was passed an inputMask.`);t.forEach((e=>{if(null!=e)throw new TypeError(`Layer ${this.name} does not support masking, but was passed an inputMask.`)}))}return null}return t}setMaskMetadata(e,t,n){if(!this.supportsMasking)return;const s=this.computeMask(e,n),r=ib(t),a=ib(s);if(r.length!==a.length)throw new Error(`${this.name} outputs ${r.length} tensors but ${r.length} masks for those tensors`);for(let e=0;ee.dispose())),this.weights.length}assertNotDisposed(){if(0===this._refCount)throw new Error(`Layer '${this.name}' is already disposed.`)}dispose(){if(!this.built)throw new Error(`Cannot dispose Layer ${this.name} because it has not been built yet.`);if(null===this._refCount)throw new Error(`Cannot dispose Layer ${this.name} because it has not been used yet.`);this.assertNotDisposed();let e=0;return 0==--this._refCount&&(e=this.disposeWeights()),{refCountAfterDispose:this._refCount,numDisposedVariables:e}}}function Hw(e,t,n){if((null==t||null!=n&&n>0)&&(t=e.sourceLayer,n=e.nodeIndex),0===t.inboundNodes.length)return[e];{const e=t.inboundNodes[n];if(0===e.inboundLayers.length)return e.inputTensors;{const t=[];for(let n=0;ne.name)),l=[],u=t.names();for(const e of o)-1!==u.indexOf(e)?l.push(t.getValue(e)):l.push(null);null!=s&&(s.maxNumTensors=-1/0,s.minNumTensors=1/0);const c=o.join(",")+"|"+t.names().sort().join(",");let h,d=Xw.get(c);if(null==d){const e=function(e,t){qt(null!=e&&e.length>0,(()=>"Expected at least one fetch, got none"));let n=[],s={};if(1===e.length){const r=Jw(e[0],t);n=r.sorted,s=r.recipientMap}else{const r=new Set;for(const a of e){const{sorted:e,recipientMap:i}=Jw(a,t);for(const t of e)r.has(t.name)||(n.push(t),r.add(t.name));for(const e in i)null==s[e]&&(s[e]=new Set),i[e].forEach((t=>s[e].add(t)))}}return{sorted:n,recipientCounts:Qw(s)}}(i,t);d=e.sorted,h=e.recipientCounts,Xw.put(c,d),Zw.put(c,h)}h={},r||Object.assign(h,Zw.get(c));const p=new Kw(t);for(let e=0;es.maxNumTensors&&(s.maxNumTensors=e),e0;){const e=a[a.length-1];if(n.has(e.name)){a.pop();continue}const t=i[i.length-1]===a.length-1;if(0===e.inputs.length||t)a.pop(),s.push(e),n.add(e.name),t&&i.pop();else{i.push(a.length-1);for(const t of e.inputs)null==r[t.name]&&(r[t.name]=new Set),r[t.name].add(e.name),n.has(t.name)||a.push(t)}}return{sorted:s,recipientMap:r}}function ev(e){let t;if(1===e.sourceLayer.inboundNodes.length)t=e.sourceLayer.output;else{let n=null;for(let t=0;tzl(Dh(Bl(e,e),t,!0))))}Sn().registerFlag("TOPOLOGICAL_SORT_CACHE_MAX_ENTRIES",(()=>100),(function(e){null!=Xw&&Xw.setMaxEntries(e),null!=Zw&&Zw.setMaxEntries(e)}));class nv extends ql{getConfig(){return{}}}class sv extends nv{constructor(e){super(),this.defaultMaxValue=2,this.defaultAxis=0,this.maxValue=null!=e.maxValue?e.maxValue:this.defaultMaxValue,this.axis=null!=e.axis?e.axis:this.defaultAxis}apply(e){return Ao((()=>{const t=tv(e,this.axis),n=Kc(t,0,this.maxValue);return Bl(e,Fl(n,Dl(Hb(),t)))}))}getConfig(){return{maxValue:this.maxValue,axis:this.axis}}}sv.className="MaxNorm",Hl(sv);class rv extends nv{constructor(e){super(),this.defaultAxis=0,this.axis=null!=e.axis?e.axis:this.defaultAxis}apply(e){return Ao((()=>Fl(e,Dl(Hb(),tv(e,this.axis)))))}getConfig(){return{axis:this.axis}}}rv.className="UnitNorm",Hl(rv);class av extends nv{apply(e){return sp(e)}}av.className="NonNeg",Hl(av);class iv extends nv{constructor(e){super(),this.defaultMinValue=0,this.defaultMaxValue=1,this.defaultRate=1,this.defaultAxis=0,this.minValue=null!=e.minValue?e.minValue:this.defaultMinValue,this.maxValue=null!=e.maxValue?e.maxValue:this.defaultMaxValue,this.rate=null!=e.rate?e.rate:this.defaultRate,this.axis=null!=e.axis?e.axis:this.defaultAxis}apply(e){return Ao((()=>{const t=tv(e,this.axis),n=Dl(Bl(this.rate,Kc(t,this.minValue,this.maxValue)),Bl(1-this.rate,t));return Bl(e,Fl(n,Dl(Hb(),t)))}))}getConfig(){return{minValue:this.minValue,maxValue:this.maxValue,rate:this.rate,axis:this.axis}}}iv.className="MinMaxNorm",Hl(iv);const ov={maxNorm:"MaxNorm",minMaxNorm:"MinMaxNorm",nonNeg:"NonNeg",unitNorm:"UnitNorm"};function lv(e){return cb(e)}function uv(e,t={}){return db(e,jl.getMap().classNameMap,t,"constraint")}function cv(e){if(null==e)return null;if("string"==typeof e){return uv({className:e in ov?ov[e]:e,config:{}})}return e instanceof nv?e:uv(e)}async function hv(e){if(null==e)return;const t=[],n=[],s=[];for(const r in e){const a=e[r];if("number"!=typeof a){const e=a;t.push(e.data()),n.push(r),s.push(e)}}if(t.length>0){const r=await Promise.all(t);for(let t=0;tDl(this.totals[e],Bl(s,n))));this.totals[e]=r,null!=t&&t.dispose()}}}async onEpochEnd(e,t){if(null!=t)for(const e of this.params.metrics)null!=this.totals[e]&&("number"==typeof this.totals[e]?t[e]=this.totals[e]/this.seen:Ao((()=>{const n=Bl(Fl(1,this.seen),this.totals[e]);t[e]=n,this.totals[e].dispose(),Co(t[e])})))}}class yv extends fv{async onTrainBegin(e){this.epoch=[],this.history={}}async onEpochEnd(e,t){null==t&&(t={}),this.epoch.push(e);for(const e in t)null==this.history[e]&&(this.history[e]=[]),this.history[e].push(t[e])}async syncData(){const e=[],t=[],n=[];for(const s in this.history){const r=this.history[s];for(let a=0;a{const i=null!=n?n():fi();return i-rnew bv(e,t)))}class vv{constructor(){}static registerCallbackConstructor(e,t){qt(e>=0&&Number.isInteger(e),(()=>`Verbosity level is expected to be an integer >= 0, but got ${e}`)),vv.checkForDuplicate(t),null==vv.constructors[e]&&(vv.constructors[e]=[]),vv.constructors[e].push(t)}static checkForDuplicate(e){for(const t in vv.constructors){vv.constructors[+t].forEach((t=>{if(t===e)throw new Qy("Duplicate callback constructor.")}))}}static clear(){vv.constructors={}}static createCallbacks(e){const t=[];for(const n in vv.constructors){const s=+n;e>=s&&t.push(...vv.constructors[s])}return t.map((e=>new e))}}function xv(e,t,n,s,r,a,i,o,l){const u=new yv,c=[new gv,...vv.createCallbacks(t)];null!=e&&c.push(...e),c.push(u);const h=new mv(c);return h.setParams({epochs:n,initialEpoch:s,samples:r,steps:a,batchSize:i,verbose:t,doValidation:o,metrics:l}),{callbackList:h,history:u}}function Av(e,t={},n=!1){return db(e,jl.getMap().classNameMap,t,"layer",n)}function kv(e,t){return Ao((()=>{"float32"!==e.dtype&&(e=Nl(e,"float32"));const n=Dh(rw(e),t,!0),s=Xl(n.shape,Hb()),r=zl(ru(n,s));return Fl(e,r)}))}function Cv(e,t){return Ao((()=>bd(rw(Ql(t,e)),-1)))}function Sv(e,t){return Ao((()=>bd(eu(Ql(t,e)),-1)))}function Ev(e,t){return Ao((()=>{const n=Ql(e,t),s=Kc(eu(e),Hb(),Number.MAX_VALUE),r=eu(Fl(n,s));return Bl(100,bd(r,-1))}))}function _v(e,t){return Ao((()=>{const n=Kc(t,Hb(),Number.MAX_VALUE),s=td(Dl(1,n)),r=Kc(e,Hb(),Number.MAX_VALUE),a=td(Dl(1,r));return bd(rw(Ql(s,a)),-1)}))}function Iv(e,t,n=!1){return Ao((()=>{if(n)t=Ap(t);else{const e=Dh(t,t.shape.length-1,!0);t=Fl(t,e)}return t=Kc(t,Hb(),1-Hb()),sd(Dh(Bl(Nl(e,"float32"),td(t)),t.shape.length-1))}))}function Tv(e,t,n=!1){return Ao((()=>{const s=Nl(Uh(function(e){const t=[Wb(e.shape)];return Tc(e,t)}(e)),"int32"),r=(t=Kc(t,Hb(),1-Hb())).shape;return Iv(Tc(Td(s,r[r.length-1]),r),t,n)}))}function Nv(e,t){return Ao((()=>{let n;return n=Kc(t,Hb(),1-Hb()),n=td(Fl(n,Ql(1,n))),bd(function(e,t){if(!Kt(e.shape,t.shape))throw new Qy(`logits and labels must have the same shape, but got shapes ${JSON.stringify(e.shape)} and ${JSON.stringify(t.shape)}`);return Ao((()=>{const n=sp(t),s=sd(eu(t));return Dl(Ql(n,Bl(t,e)),nd(zh(s)))}))}(e,n),-1)}))}function Ov(e,t){return Ao((()=>{const n=Kc(e,Hb(),1),s=Kc(t,Hb(),1);return Dh(Bl(e,td(Fl(n,s))),-1)}))}function Rv(e,t){return Ao((()=>{const n=kv(e,-1),s=kv(t,-1),r=Bl(n,s);return sd(Dh(r,-1))}))}vv.constructors={};const Dv={meanSquaredError:Cv,meanAbsoluteError:Sv,meanAbsolutePercentageError:Ev,meanSquaredLogarithmicError:_v,squaredHinge:function(e,t){return Ao((()=>{const n=ru(0,Ql(1,Bl(e,t)));return bd(rw(n),-1)}))},hinge:function(e,t){return Ao((()=>{const n=ru(0,Ql(1,Bl(e,t)));return bd(n,-1)}))},categoricalHinge:function(e,t){return Ao((()=>{const n=Dh(Bl(e,t),-1),s=Oh(Bl(Ql(1,e),t),-1);return ru(0,Dl(1,Ql(s,n)))}))},logcosh:function(e,t){return Ao((()=>{const n=Math.log(2),s=Ql(t,e),r=Ql(Dl(s,rd(Bl(-2,s))),n);return bd(r,-1)}))},categoricalCrossentropy:Iv,sparseCategoricalCrossentropy:Tv,binaryCrossentropy:Nv,kullbackLeiblerDivergence:Ov,poisson:function(e,t){return Ao((()=>{const n=td(Dl(Hb(),t));return bd(Ql(t,Bl(e,n)),-1)}))},cosineProximity:Rv};function Mv(e){if("string"==typeof e){if(e in Dv)return Dv[e];let t=`Unknown loss ${e}`;throw e.toLowerCase().includes("softmaxcrossentropy")&&(t=`Unknown loss ${e}. Use "categoricalCrossentropy" as the string name for tf.losses.softmaxCrossEntropy`),new Qy(t)}return e}function Fv(e,t){return Ao((()=>{const n=Bl(.5,Nd(t)),s=$b(qh(t,n),e.dtype);return bd(mh(e,s),-1)}))}function Bv(e,t){return Ao((()=>$b(mh(oc(e,-1),oc(t,-1)),"float32")))}function zv(e,t){return Ao((()=>Nl(Dh(ld(mh(e,1),mh(t,1))),"float32")))}function Lv(e,t){return Nv(e,t)}function Pv(e,t){return e.rank===t.rank&&(e=Tp(e,[e.rank-1])),(t=oc(t,-1)).dtype!==e.dtype&&(t=Nl(t,e.dtype)),Nl(mh(e,t),"float32")}const Vv=Iv,Wv=Tv,Uv={binaryAccuracy:Fv,categoricalAccuracy:Bv,precision:function(e,t){return Ao((()=>{const n=zv(e,t),s=function(e,t){return Ao((()=>Nl(Dh(ld(mh(e,0),mh(t,1))),"float32")))}(e,t),r=Dl(n,s);return Nl(gh(qh(r,0),Fl(n,r),0),"float32")}))},categoricalCrossentropy:Vv,sparseCategoricalCrossentropy:Wv,mse:Cv,MSE:Cv,mae:Sv,MAE:Sv,mape:Ev,MAPE:Ev,cosine:Rv};function Gv(e){if("string"==typeof e&&e in Uv)return Uv[e];if("string"!=typeof e&&null!=e)return e;throw new Qy(`Unknown metric ${e}`)}function qv(e){if(sb(null!==e,`Unknown LossOrMetricFn ${e}`),"string"==typeof e)return e;{let t;for(const n of Object.keys(Dv))if(Dv[n]===e){t=n;break}if(void 0!==t)return t;for(const n of Object.keys(Uv))if(Uv[n]===e){t=n;break}return void 0!==t?t:e.name}}function jv(e,t,n=!1){if(null==e||"object"!=typeof e||Object.getPrototypeOf(e)!==Object.prototype||!Hv(e))throw new Error("User-defined metadata is expected to be a JSON object, but is not.");if(n){JSON.stringify(e).length}}function Hv(e){if(null===e)return!0;if("object"==typeof e){if(Object.getPrototypeOf(e)===Object.prototype){const t=Object.keys(e);for(const n of t){if("string"!=typeof n)return!1;if(!Hv(e[n]))return!1}return!0}if(Array.isArray(e)){for(const t of e)if(!Hv(t))return!1;return!0}return!1}{const t=typeof e;return"string"===t||"number"===t||"boolean"===t}}function $v(e,t,n,s=console.log){const r=function(e){let t=!0;const n=[],s=[];for(const t in e.nodesByDepth)n.push(e.nodesByDepth[t]);for(const e of n){if(e.length>1||1===e.length&&e[0].inboundLayers.length>1){t=!1;break}s.push(...e)}if(t)for(const n of e.layers){let e=!1;for(const r of n.inboundNodes)if(-1!==s.indexOf(r)){if(e){t=!1;break}e=!0}if(!t)break}return t}(e),a=["Layer (type)","Input Shape","Output shape","Param #"];let i;if(r?(t=t||90,n=n||[.32,.61,.89,1]):(t=t||115,n=n||[.24,.48,.7,.8,1]),n[n.length-1]<=1&&(n=n.map((e=>Math.floor(t*e)))),!r){a.push("Receives inputs"),i=[];for(const t in e.nodesByDepth)i.push(...e.nodesByDepth[t])}s("_".repeat(t)),Kv(a,n,s),s("=".repeat(t));const o=e.layers;for(let e=0;e0&&(s=s.slice(0,s.length-1)+" "),s+=e[n],s=s.slice(0,t[n]),s+=" ".repeat(t[n]-s.length);n(s)}function Xv(e,t,n){let s,r;try{r=e.inboundNodes.map((e=>JSON.stringify(e.inputShapes))).join(",")}catch(e){r="multiple"}try{s=JSON.stringify(e.outputShape)}catch(e){s="multiple"}Kv([`${e.name} (${e.getClassName()})`,r,s,e.countParams().toString()],t,n)}function Zv(e,t,n,s){let r,a;try{a=e.inboundNodes.map((e=>JSON.stringify(e.inputShapes))).join(",")}catch(e){a="multiple"}try{r=JSON.stringify(e.outputShape)}catch(e){r="multiple"}const i=[];for(const t of e.inboundNodes)if(!(null!=n&&n.length>0&&-1===n.indexOf(t)))for(let e=0;ee.name))}`);fb(this.outputs).length,this.outputs.length,this.inputLayers=[],this.inputLayersNodeIndices=[],this.inputLayersTensorIndices=[],this.outputLayers=[],this.outputLayersNodeIndices=[],this.outputLayersTensorIndices=[],this.layers=[],this.internalContainerRefs=[];for(const e of this.outputs){const t=e.sourceLayer,n=e.nodeIndex,s=e.tensorIndex;this.outputLayers.push(t),this.outputLayersNodeIndices.push(n),this.outputLayersTensorIndices.push(s)}for(const e of this.inputs){const t=e.sourceLayer,n=e.nodeIndex,s=e.tensorIndex;sb(0===n,"input layer has >1 nodes"),sb(0===s,"input layer has >1 tensors"),this.inputLayers.push(t),this.inputLayersNodeIndices.push(n),this.inputLayersTensorIndices.push(s)}this.inputNames=[],this.outputNames=[],this.feedInputShapes=[],this.feedInputNames=[],this.feedOutputNames=[];for(let t=0;te.shape)),this.internalOutputShapes=this.outputs.map((e=>e.shape));const t={},n={},s={},r={},a={},i=[],o=(e,t,n,s,r,l)=>{null!=s&&null!=r&&null!=l||(s=e.sourceLayer,r=e.nodeIndex,l=e.tensorIndex);const u=s.inboundNodes[r];if(-1!==n.indexOf(u))throw new Yy(`The tensor ${e.name} at layer "${s.name}" is part of a cycle.`);if(-1!==t.indexOf(u))return;this.containerNodes.add(tx.nodeKey(s,r)),s.id in a||(a[s.id]=Object.keys(a).length),-1===n.indexOf(u)&&n.push(u);const c=u.inboundLayers.length;for(let e=0;e=0;)n.splice(n.indexOf(u),1);i.push(u)},l=[],u=[];for(const e of this.outputs)o(e,l,u);const c=i.slice().reverse();for(const e of c){n[e.id]=e,e.id in t||(t[e.id]=0);let a=t[e.id];const i=null==s[e.outboundLayer.id]?0:s[e.outboundLayer.id];a=Math.max(a,i),s[e.outboundLayer.id]=a,r[e.outboundLayer.id]=e.outboundLayer,t[e.id]=a;for(let s=0;sparseInt(e,10))).sort(pb);this.layers=[];for(const e of p){const t=d[e];t.sort(((e,t)=>{const n=a[e.id],s=a[t.id];return ns?1:0}));for(const e of t)e instanceof tx&&this.internalContainerRefs.push(e),this.layers.push(e)}this.layersByDepth=d,p=Object.keys(h).map((e=>parseInt(e,10))).sort(pb);const f=this.inputs.slice(),m=[];for(const e of p)for(const t of h[e]){const e=t.outboundLayer;if(null!=e){for(const n of t.inputTensors)if(-1===f.indexOf(n))throw new Yy(`Graph disconnected: cannot obtain value for tensor ${n} at layer "${e.name}". The following previous layers were accessed without issue: ${m}`);for(const e of t.outputTensors)f.push(e);m.push(e.name)}}this.nodesByDepth=h;const g=this.layers.map((e=>e.name));for(const e of g){const t=g.filter((t=>t===e)).length;if(1!==t)throw new Yy(`The name "${e}" is used ${t} times in the model. All layer names should be unique. Layer names: `+JSON.stringify(g))}this.outboundNodes=[],this.inboundNodes=[],new Gw({outboundLayer:this,inboundLayers:[],nodeIndices:[],tensorIndices:[],inputTensors:this.inputs,outputTensors:this.outputs,inputMasks:this.inputs.map((e=>null)),outputMasks:this.outputs.map((e=>null)),inputShapes:this.inputs.map((e=>e.shape)),outputShapes:this.outputs.map((e=>e.shape))}),this.built=!0,this._refCount=1}assertNotDisposed(){if(0===this._refCount)throw new Error(`Container '${this.name}' is already disposed.`)}dispose(){this.assertNotDisposed();const e={refCountAfterDispose:null,numDisposedVariables:0};if(0==--this._refCount){for(const t of this.layers)e.numDisposedVariables+=t.dispose().numDisposedVariables;for(const t of this.internalContainerRefs)e.numDisposedVariables+=t.dispose().numDisposedVariables}return e.refCountAfterDispose=this._refCount,e}get trainable(){return this.trainable_}set trainable(e){this.layers.forEach((t=>{t._trainableWeights.forEach((t=>t.trainable=e))})),this.trainable_=e}get trainableWeights(){if(this._trainableWeights.length>0)throw new Qy("Container instance unexpectedly contains _trainableWeights.The trainable weights of a Container are a union of the trainable weights of its consituent Layers. Its own _trainableWeights must remain an empty Array.");if(!this.trainable)return[];let e=[];for(const t of this.layers)e=e.concat(t.trainableWeights);return e}get nonTrainableWeights(){const e=[];for(const t of this.layers)e.push(...t.nonTrainableWeights);if(!this.trainable){const t=[];for(const e of this.layers)t.push(...e.trainableWeights);return t.concat(e)}return e}get weights(){return this.trainableWeights.concat(this.nonTrainableWeights)}loadWeights(e,t=!0){const n={};let s=0;const r=(e=>{const t=Object.keys(e);if(0===t.length)return!1;const n=t[0].split("/");return!isNaN(parseInt(n[n.length-1],10))})(e);r&&this.parseWeights(e);for(const e of this.layers)for(const[t,a]of e.weights.entries()){const e=r?`${a.name.split("/").slice(0,-1).join("/")+"/"}${t}`:a.originalName;if(null!=n[e])throw new Qy(`Duplicate weight name: ${e}`);n[e]=a,s++}const a=[];for(const s in e){let r=s;if(null==n[s]){const e=s.split("/");r=e.slice(0,-2).concat([e[e.length-1]]).join("/")}if(null!=n[r])a.push([n[r],e[s]]);else if(t)throw new Qy(`Provided weight data has no target variable: ${s}`);delete n[r]}if(t){const e=[];for(const t in n)e.push(t);if(e.length>0)throw new Qy(`${e.length} of ${s} weights are not set: ${e}`)}Pw(a)}parseWeights(e){for(const t in Object.keys(e)){const n=t.split("/"),s=["vars","layer_checkpoint_dependencies"],r=n.map((e=>e.startsWith("_")?e.slice(1):e)).filter((e=>!s.includes(e))).join("/");r!==t&&(e[r]=e[t],delete e[t])}}updatedConfig(){const e=this.getConfig(),t={};return t.className=this.getClassName(),t.config=e,t.kerasVersion=`tfjs-layers ${ex}`,t.backend="TensorFlow.js",t}toJSON(e,t=!0){const n=Jv(this.updatedConfig());return t?JSON.stringify(n):n}call(e,t){return Ao((()=>{e=ib(e);const n=new Kw;for(let t=0;t{let n;return e=ib(e),n=null==t?nb(null,e.length):ib(t),this.runInternalGraph(e,n)[1]}))}computeOutputShape(e){const t=Rw(e);if(t.length!==this.inputLayers.length)throw new Qy(`Invalid inputShape argument ${e}: model has ${this.inputLayers.length} tensor inputs.`);const n={};for(let e=0;eparseInt(e,10))).sort(pb);if(s.length>1)for(const e of s){const t=this.nodesByDepth[e];for(const e of t){const t=e.outboundLayer;if(-1!==this.inputLayers.map((e=>e.id)).indexOf(t.id))continue;const s=[];for(let t=0;tparseInt(e,10))).sort(pb);for(const e of s){const t=this.nodesByDepth[e];for(const e of t){const t=e.outboundLayer,s=e.inputTensors,r=e.outputTensors,a=new Array;for(const e of s)e.id in n&&a.push(n[e.id]);if(a.length===s.length){let s,i,o,l,u={};if(null!=e.callArgs&&(u=e.callArgs),1===a.length){const[e,n]=a[0];null==u.mask&&(u.mask=n),o=ib(t.call(e,u)),l=ib(t.computeMask(e,n)),s=[e],i=[n]}else s=a.map((e=>e[0])),i=a.map((e=>e[1])),null==u.mask&&(u.mask=i),o=ib(t.call(s,u)),l=ib(t.computeMask(s,i));if(t.activityRegularizer)throw new Jy("LayersModel invocation with concrete Tensor value(s) in the presence of activity regularizer(s) is not supported yet.");for(let e=0;e{const e=[];for(const t of this.layers)for(let n=0;n0){const e=[];for(let n=0;n0&&e.apply(ab(n),s)}function l(e){const n=e.name,a=Av(e,null!=t.customObjects?t.customObjects:{});a.setFastWeightInitDuringBuild(s),r[n]=a;e.inboundNodes.forEach((e=>{if(!(e instanceof Array))throw new Qy(`Corrupted configuration, expected array for nodeData: ${e}`);i(a,e)}))}const u=t.name,c=t.layers;for(const e of c)l(e);for(;!mb(a);)for(const e of c){const t=r[e.name];if(t.name in a){const e=a[t.name];delete a[t.name];for(const n of e)o(t,n)}}const h=[],d=[],p=t.inputLayers;for(const e of p){const t=e[0],n=e[1],s=e[2];sb(t in r);const a=r[t].inboundNodes[n].outputTensors;h.push(a[s])}const f=t.outputLayers;for(const e of f){const t=e[0],n=e[1],s=e[2];sb(t in r);const a=r[t].inboundNodes[n].outputTensors;d.push(a[s])}return new e({inputs:h,outputs:d,name:u})}get stateful(){if(this._stateful)throw new Qy("Container instance unexpectedly has _stateful = true. The statefulness of a Container is determined by the Layers it contains. Its _stateful property must remain the default false.");for(const e of this.layers)if(e.stateful)return!0;return!1}resetStates(){Ao((()=>{this.layers.forEach((e=>{e.stateful&&e.resetStates()}))}))}}function nx(e,t,n){const s=t.length;if(null==e||Array.isArray(e)&&0===e.length)return t.map((e=>null));if(1===s)return Array.isArray(e)&&1===e.length?e:"object"==typeof e&&t[0]in e?[e[t[0]]]:[e];if(Array.isArray(e)){if(e.length!==s)throw new Error(`Provided ${n} is an array of ${e.length} element(s), but the model has ${s} outputs. Make sure a set of weights is provided for each model output.`);return e}if("object"==typeof e&&Object.keys(e).length>0&&"object"==typeof e[Object.keys(e)[0]]){const n=[];return t.forEach((t=>{t in e?n.push(e[t]):n.push(null)})),n}throw new Error(`The model has multiple (${s}) outputs, so ${n} must be either an array with ${s} elements or an object with ${t} keys. Provided ${n} not understood: ${JSON.stringify(e)}`)}function sx(e,t){return nx(e,t,"classWeight")}async function rx(e,t,n,s){if(null!=t||null!=s)throw new Error("Support sampleWeight is not implemented yet");if(null!=n){const t=Ao((()=>{if(1===e.shape.length)return Ol(e);if(2===e.shape.length){if(e.shape[1]>1){return oc(e,1)}if(1===e.shape[1])return Tc(e,[e.shape[0]]);throw new Error(`Encountered unexpected last-dimension size (${e.shape[1]}) during handling of class weights. The size is expected to be >= 1.`)}throw new Error(`Unexpected rank of target (y) tensor (${e.rank}) during handling of class weights. The rank is expected to be 1 or 2.`)})),s=Array.from(await t.data());ko(t);const r=[];return s.forEach((e=>{if(null==n[e])throw new Error(`classWeight must contain all classes in the training data. The class ${e} exists in the data but not in classWeight`);r.push(n[e])})),Mp(r,"float32")}return null}function ax(e,t){return Bl(e,t)}function ix(e,t){let n,s;const r=t;n=r.xs,s=r.ys,qt(null!=n&&null!=s,(()=>`A Dataset iterator for fitDataset() is expected to generate objects of the form \`{xs: xVal, ys: yVal}\`, where the two values may be \`tf.Tensor\`, an array of Tensors, or a map of string to Tensor. The provided Dataset instead generates ${t}`));const a=ox("input",e.inputNames,n),i=ox("output",e.outputNames,s),o=a[0].shape[0];qt(a.length===e.inputs.length,(()=>`LayersModel has ${e.inputs.length} inputs, but the dataset provides ${a.length} inputs. (Expected input keys: ${JSON.stringify(e.inputNames)})`)),qt(i.length===e.outputs.length,(()=>`LayersModel has ${e.outputs.length} outputs, but the dataset provides ${i.length} outputs. (Expected output keys: ${JSON.stringify(e.outputNames)})`));for(let t=0;t`Batch size mismatch: input ${e.inputNames[t]} has ${a[t].shape[0]}; expected ${o} based on input ${e.inputNames[0]}.`));for(let t=0;t`Batch size mismatch: output ${e.outputNames[t]} has ${i[t].shape[0]}; expected ${o} based on input ${e.inputNames[0]}.`));return{xs:a,ys:i}}function ox(e,t,n){if(n instanceof Mi)return[n];if(Array.isArray(n))return qt(n.length===t.length,(()=>`Received an array of ${n.length} Tensors, but expected ${t.length} to match the ${e} keys ${t}.`)),n;{const s=[];for(const r of t){if(null==n[r])throw new Qy(`The feature data generated by the dataset lacks the required ${e} key '${r}'.`);s.push(n[r])}return s}}async function lx(e,t,n){const s=null!=n.batchesPerEpoch;if(qt(null!=e.optimizer,(()=>"You must compile a model before training/testing. Use LayersModel.compile(modelCompileConfig).")),qt(null!=n,(()=>"For fitDataset(), the 2nd argument (config) is required, but it is not provided in this call.")),qt(null!=n.epochs&&n.epochs>0&&Number.isInteger(n.epochs),(()=>`For fitDataset(), config.epochs is expected to be a positive integer, but got ${n.epochs}`)),qt(!s||n.batchesPerEpoch>0&&Number.isInteger(n.batchesPerEpoch),(()=>`For fitDataset(), config.batchesPerEpoch is expected to be a positive integer if specified, but got ${n.batchesPerEpoch}`)),qt(null==n.validationSplit,(()=>"`validationSplit` is not supported by `fitDataset()`. Use validationData instead.")),e.isTraining)throw new Error("Cannot start training because another fit() call is ongoing.");e.isTraining=!0;try{const r=null!=n.validationData;let a,i;if(r)if(ux(n.validationData))qt(null==n.validationBatches||n.validationBatches>0&&Number.isInteger(n.validationBatches),(()=>`For fitDataset() with dataset-based validation, config.validationBatches is expected not to be provided, or to be a positive integer, but got ${n.validationBatches}`));else{const e=function(e){if(3===e.length)throw new Jy("Validation with sample weights is not implemented yet.");return{xs:e[0],ys:e[1]}}(n.validationData);a=e.xs,i=e.ys}const o=e.makeTrainFunction(),l=e.getDedupedMetricsNames();let u;u=r?l.slice().concat(l.map((e=>"val_"+e))):l.slice();const c=wv(n.callbacks,n.yieldEvery),h=null==n.verbose?1:n.verbose,{callbackList:d,history:p}=xv(c,h,n.epochs,null,null,function(e,t){let n=null;null!=t.batchesPerEpoch?n=t.batchesPerEpoch:Number.isFinite(e.size)&&(n=e.size);return n}(t,n),null,r,u);d.setModel(e),e.history=p,await d.onTrainBegin(),e.stopTraining_=!1;let f=null==n.initialEpoch?0:n.initialEpoch,m=await t.iterator();for(;f=n.batchesPerEpoch:t.done){if(r){let t;t=ux(n.validationData)?ib(await e.evaluateDataset(n.validationData,{batches:n.validationBatches})):ib(e.evaluate(a,i,{batchSize:null==n.validationBatchSize?32:n.validationBatchSize,verbose:0}));for(let n=0;n0&&Number.isInteger(e),(()=>`batchSize is required to be a positive integer, but got ${e}`))}function hx(e,t,n){return null==e?[null]:Array.isArray(e)?e.map((e=>Xb(e,t,n-t))):Xb(e,t,n-t)}function dx(e,t){return Ao((()=>null==e?null:Array.isArray(e)?e.map((e=>dx(e,t))):sw(e,"int32"===t.dtype?t:Nl(t,"int32"))))}function px(e,t){const n=[];let s=0,r=null;for(;s=e&&(r=e),n.push([s,r]),s=r;return n}function fx(e){const t=[];e instanceof Mi&&(e=[e]);for(let n=0;nn.push(e.id)));else if(null!=t)for(const e in t){const s=t[e];n.push(s.id)}const s=[];if(e instanceof Mi)-1===n.indexOf(e.id)&&s.push(e);else if(Array.isArray(e))e.forEach((e=>{-1===n.indexOf(e.id)&&s.push(e)}));else if(null!=e)for(const t in e){const r=e[t];-1===n.indexOf(r.id)&&s.push(r)}s.forEach((e=>{e.isDisposed||e.dispose()}))}function gx(e){return Array.isArray(e)}function yx(e){return!function(e){return e instanceof Mi}(e)&&!gx(e)}function bx(e,t,n,s=!0,r=""){if(null==t||0===t.length){if(null!=e){let t=!1;if(gx(e)&&e.length>0)t=!0;else if(yx(e)){for(const n in e)if(e.hasOwnProperty(n)){t=!0;break}}else t=!0;if(t)throw new Qy(`Error when checking model ${r} expected no data, but got ${e}`)}return[]}if(null==e)return t.map((e=>null));let a;if(yx(e)){a=[];for(const n of t){if(null==e[n])throw new Qy(`No data provided for "${n}". Need data for each key in: ${t}`);a.push(e[n])}}else if(gx(e)){if(e.length!==t.length)throw new Qy(`Error when checking model ${r}: the Array of Tensors that you are passing to your model is not the size the model expected. Expected to see ${t.length} Tensor(s), but instead got the following list of Tensor(s): ${e}`);a=e}else{if(t.length>1)throw new Qy(`The model ${r} expects ${t.length} Tensor(s), but only received one Tensor. Found: Tensor with shape ${e.shape}`);a=[e]}if(a=fx(a),null!=n)for(let e=0;e=0&&a!==o)throw new Qy(`${r} expected a batch of elements where each example has shape [${n[e].slice(1,n[e].length)}] (i.e.,tensor shape [*,${n[e].slice(1,n[e].length)}]) but the ${r} received an input with ${i.shape[0]} examples, each with shape [${i.shape.slice(1,i.shape.length)}] (tensor shape [${i.shape}])`)}}return a}function wx(e,t,n,s=!0,r=""){let a;if(Array.isArray(e)){if(e.length!==t.length)throw new Qy(`Error when checking model ${r}: the Array of Tensors that you are passing to your model is not the size the the model expected. Expected to see ${t.length} Tensor(s), but instead got ${e.length} Tensors(s).`);a=e}else{if(t.length>1)throw new Qy(`The model expects ${t.length} ${r} Tensors, but only received one Tensor. Found: array with shape ${JSON.stringify(e.shape)}.`);a=[e]}if(null!=n)for(let e=0;ekm.adagrad(.01),Adadelta:()=>km.adadelta(1,.95,Hb()),Adam:()=>km.adam(.001,.9,.999,Hb()),Adamax:()=>km.adamax(.002,.9,.999,Hb(),0),RMSProp:()=>km.rmsprop(.001,.9,0,Hb()),SGD:()=>km.sgd(.01)};if(t.adagrad=t.Adagrad,t.adadelta=t.Adadelta,t.adam=t.Adam,t.adamax=t.Adamax,t.rmsprop=t.RMSProp,t.sgd=t.SGD,e in t)return t[e]();throw new Qy(`Unknown Optimizer ${e}`)}(e.optimizer),this.isOptimizerOwned=!0;else{if(!(e.optimizer instanceof $l))throw new Qy("User-defined optimizer must be an instance of tf.Optimizer.");this.optimizer_=e.optimizer,this.isOptimizerOwned=!1}let t=[];if(Array.isArray(e.loss)||"string"==typeof e.loss||"function"==typeof e.loss)if(Array.isArray(e.loss)){if(e.loss.length!==this.outputs.length)throw new Qy(`When passing an Array as loss, it should have one entry per model output. The model has ${this.outputs.length} output(s), but you passed loss=${e.loss}.`);const n=e.loss;t=n.map((e=>Mv(e)))}else{const n=Mv(e.loss);this.outputs.forEach((e=>{t.push(n)}))}else{e.loss=e.loss;for(const t in e.loss)if(-1===this.outputNames.indexOf(t))throw new Qy(`Unknown entry in loss dictionary: "${t}". Only expected the following keys: ${this.outputNames}`);for(const n of this.outputNames)e.loss[n],t.push(Mv(e.loss[n]))}this.lossFunctions=t,this.feedOutputNames=[],this.feedOutputShapes=[],this.feedLossFns=[];for(let e=0;e{for(let e=0;e1&&(this.metricsTensors.push([t,e]),this.metricsNames.push(this.outputNames[e]+"_loss"))}}));const s=function(e,t){if(null==e||Array.isArray(e)&&0===e.length)return t.map((e=>[]));let n;if("string"==typeof e||"function"==typeof e)n=[e];else{if(!Array.isArray(e)&&"object"!=typeof e)throw new TypeError(`Type of metrics argument not understood. Expected an string,function, Array, or Object, found: ${e}`);n=e}if(Array.isArray(n))return t.map((e=>n));{const e=[];for(const s of t){let t=n.hasOwnProperty(s)?n[s]:[];Array.isArray(t)||(t=[t]),e.push(t)}return e}}(e.metrics,this.outputNames),r=(e,t,n)=>{this.outputNames.length>1&&(t=this.outputNames[e]+"_"+t),this.metricsNames.push(t),this.metricsTensors.push([n,e])};Bb("metric",(()=>{for(let e=0;e{let n,s,a;for(const i of t){if("string"==typeof i&&-1!==["accuracy","acc","crossentropy","ce"].indexOf(i)){const t=this.internalOutputShapes[e];let r;1===t[t.length-1]||this.lossFunctions[e]===Nv?-1!==["accuracy","acc"].indexOf(i)?s=Fv:-1!==["crossentropy","ce"].indexOf(i)&&(s=Lv):this.lossFunctions[e]===Tv?-1!==["accuracy","acc"].indexOf(i)?s=Pv:-1!==["crossentropy","ce"].indexOf(i)&&(s=Wv):-1!==["accuracy","acc"].indexOf(i)?s=Bv:-1!==["crossentropy","ce"].indexOf(i)&&(s=Vv),-1!==["accuracy","acc"].indexOf(i)?r="acc":-1!==["crossentropy","ce"].indexOf(i)&&(r="ce"),a=s,n=""+r}else{const e=Gv(i);a=e,n=""+qv(i)}let t;Bb(n,(()=>{t=a})),r(e,n,t)}})(s[e])}})),this.collectedTrainableWeights=this.trainableWeights}checkTrainableWeightsConsistency(){null!=this.collectedTrainableWeights&&(this.trainableWeights.length,this.collectedTrainableWeights.length)}evaluate(e,t,n={}){const s=null==n.batchSize?32:n.batchSize;cx(s);const r=this.standardizeUserDataXY(e,t,!0,s);try{const e=r[0].concat(r[1]);this.makeTestFunction();const t=this.testFunction;return ab(this.testLoop(t,e,s,n.verbose,n.steps))}finally{mx(r[0],e),mx(r[1],t)}}async evaluateDataset(e,t){return this.makeTestFunction(),async function(e,t,n){const s=null!=(n=n||{}).batches,r=e.testFunction;let a=[];if(n.verbose>0)throw new Jy("Verbose mode is not implemented yet.");qt(!s||n.batches>0&&Number.isInteger(n.batches),(()=>`Test loop expects \`batches\` to be a positive integer, but received ${JSON.stringify(n.batches)}`));const i="function"==typeof t.next?t:await t.iterator();let o=0,l=0;for(;!s||l{if(t.value){const{xs:n,ys:s}=ix(e,t.value),i=n.concat(s),u=Ao((()=>r(i)));if(ko(i),0===l)for(let e=0;eDl(a[e],Bl(c,t)))),l>0&&ko(n)}ko(u),o+=c,++l}return a})),t.done)break}for(let e=0;ee.name));for(let s=0;s0){const n=[];throw t.forEach(((t,s)=>{null==t&&n.push(e[s])})),new Qy(`Cannot find SymbolicTensors for output name(s): ${JSON.stringify(n)}`)}return t}predictLoop(e,t=32,n=!1){return Ao((()=>{const s=this.checkNumSamples(e);if(n)throw new Jy("Verbose predictLoop() is not implemented yet.");const r=px(s,t),a=this.outputs.map((e=>[]));for(let t=0;t{const n=r[t][0],s=r[t][1],a=hx(e,n,s),i=[];if(Array.isArray(a))for(let e=0;ea[t].push(e)))}return ab(a.map((e=>Rc(e,0))))}))}predict(e,t={}){const n=fx(e);wx(n,this.inputNames,this.feedInputShapes,!1);try{const e=null==t.batchSize?32:t.batchSize;return cx(e),this.predictLoop(n,e)}finally{mx(n,e)}}predictOnBatch(e){wx(e,this.inputNames,this.feedInputShapes,!0);const t=(Array.isArray(e)?e[0]:e).shape[0];return this.predictLoop(e,t)}standardizeUserDataXY(e,t,n=!0,s){if(null==this.optimizer_)throw new Yy("You must compile a model before training/testing. Use LayersModel.compile(modelCompileArgs).");const r=[];for(let e=0;ee.shape[0])));s.sort();const r=fb(t.map((e=>e.shape[0])));if(r.sort(),s.length>1)throw new Qy(`All input Tensors (x) should have the same number of samples. Got array shapes: ${JSON.stringify(e.map((e=>e.shape)))}`);if(r.length>1)throw new Qy(`All target Tensors (y) should have the same number of samples. Got array shapes: ${JSON.stringify(t.map((e=>e.shape)))}`);if(s.length>0&&r.length>0&&!Kt(s,r))throw new Qy(`Input Tensors should have the same number of samples as target Tensors. Found ${s[0]} input sample(s) and ${r[0]} target sample(s).`)}(e=bx(e,this.feedInputNames,this.feedInputShapes,!1,"input"),t=bx(t,this.feedOutputNames,r,!1,"target")),function(e,t,n){const s=[Cv,Nv,Iv];for(let r=0;r0&&e[0].shape[0]%s!=0)throw new Qy(`In a stateful network, you should only pass inputs with a number of samples that is divisible by the batch size ${s}. Found: ${e[0].shape[0]} sample(s).`);return[e,t]}async standardizeUserData(e,t,n,s,r=!0,a){const[i,o]=this.standardizeUserDataXY(e,t,r,a);if(null!=n)throw new Error("sample weight is not supported yet.");let l=null;if(null!=s){const e=sx(s,this.outputNames);l=[];for(let t=0;t{const a=this.checkNumSamples(t,n,r,"steps"),i=[];if(s>0)throw new Jy("Verbose mode is not implemented yet.");if(null!=r)throw new Jy("steps mode in testLoop() is not implemented yet");{const s=px(a,n),r=Mp(qb(0,a));for(let n=0;n1){r+=`_${rb(e.slice(0,n),s)}`}t.push(r)}return t}makeTrainFunction(){return e=>{const t=[],n=e.slice(0,this.inputs.length),s=e.slice(this.inputs.length,this.inputs.length+this.outputs.length),r=e.slice(this.inputs.length+this.outputs.length,this.inputs.length+2*this.outputs.length),a=[],i=this.collectedTrainableWeights.map((e=>e.read()));return[this.optimizer_.minimize((()=>{const e=[];for(let t=0;t1&&e{l=Dl(l,e)})),l}),!0,i)].concat(a)}}makeTestFunction(){this.testFunction=e=>Ao((()=>{const t=[];let n;const s=e.slice(0,this.inputs.length),r=e.slice(this.inputs.length,this.inputs.length+this.outputs.length),a=[];for(let e=0;e0){if(g=!0,2!==n.validationData.length)throw 3===n.validationData.length?new Jy("validationData including sample weights is not supported yet."):new Qy(`When passing validation data, it must contain 2 (valX, valY) or 3 (valX, valY, valSampleWeight) items; ${n.validationData} is invalid.`);o=n.validationData[0],l=n.validationData[1];const e=!0,t=await this.standardizeUserData(o,l,null,null,e,d);u=t[0],c=t[1],m=u.concat(c)}else if(null!=n.validationSplit&&n.validationSplit>0&&n.validationSplit<1){g=!0;const e=Math.floor(s[0].shape[0]*(1-n.validationSplit)),t=s[0].shape[0];u=hx(s,e,t),a=s,s=hx(s,0,e),c=hx(r,e,t),i=r,r=hx(r,0,e),m=u.concat(c)}else null!=n.validationSteps&&(g=!0);const y=s.concat(r).concat(h);this.checkTrainableWeightsConsistency();const b=this.makeTrainFunction(),w=this.getDedupedMetricsNames();let v,x;g?(this.makeTestFunction(),v=this.testFunction,x=w.slice().concat(w.map((e=>"val_"+e)))):(v=null,m=[],x=w.slice());const A=wv(n.callbacks,n.yieldEvery);return await this.fitLoop(b,y,w,d,n.epochs,n.verbose,A,v,m,n.shuffle,x,n.initialEpoch,null,null)}finally{this.isTraining=!1,mx(s,e),mx(r,t),mx(a,e),mx(i,t),mx(u,o),mx(c,l),null!=h&&ko(h)}}async fitLoop(e,t,n,s,r,a,i,o,l,u,c,h,d,p){null==s&&(s=32),null==r&&(r=1),null==u&&(u=!0),null==h&&(h=0);let f=!1;if(null!=o&&null!=l&&(f=!0),null!=p&&(f=!0,null==d))throw new Qy("Can only use `validationSteps` when doing step-wise training, i.e., `stepsPerEpoch` must be set.");const m=this.checkNumSamples(t,s,d,"steps_per_epoch");let g;null!=m&&(g=qb(0,m)),null==a&&(a=1);const{callbackList:y,history:b}=xv(i,a,r,h,m,d,s,f,c);y.setModel(this),this.history=b,await y.onTrainBegin(),this.stopTraining_=!1;for(let a=h;a{const h=i[u][0],d=i[u][1],p=Xb(a,h,d-h);c.batch=u,c.size=d-h;const m=dx(t,p),g=e(m);for(let e=0;eob(e)))}else{const t=Object.keys(this.loss);e={};const n=this.loss;for(const s of t){if("string"!=typeof n[s])throw new Error("Serialization of non-string loss is not supported.");e[s]=ob(n[s])}}return e}getMetricIdentifiers(){if("string"==typeof this.metrics||"function"==typeof this.metrics)return[ob(qv(this.metrics))];if(Array.isArray(this.metrics))return this.metrics.map((e=>ob(qv(e))));{const e={};for(const t in this.metrics)e[t]=ob(qv(this.metrics[t]));return e}}getTrainingConfig(){return{loss:this.getLossIdentifiers(),metrics:this.getMetricIdentifiers(),optimizer_config:{class_name:this.optimizer.getClassName(),config:this.optimizer.getConfig()}}}loadTrainingConfig(e){if(null!=e.weighted_metrics)throw new Error("Loading weight_metrics is not supported yet.");if(null!=e.loss_weights)throw new Error("Loading loss_weights is not supported yet.");if(null!=e.sample_weight_mode)throw new Error("Loading sample_weight_mode is not supported yet.");const t=Av(Qv(e.optimizer_config));let n,s;if("string"==typeof e.loss)n=lb(e.loss);else if(Array.isArray(e.loss))n=e.loss.map((e=>lb(e)));else if(null!=e.loss){n={};for(const t in e.loss)n[t]=lb(e.loss[t])}if(Array.isArray(e.metrics))s=e.metrics.map((e=>lb(e)));else if(null!=e.metrics){s={};for(const t in e.metrics)s[t]=lb(e.metrics[t])}this.compile({loss:n,metrics:s,optimizer:t})}async save(e,t){if("string"==typeof e){const t=Ko(e);if(0===t.length)throw new Qy(`Cannot find any save handlers for URL '${e}'`);if(t.length>1)throw new Qy(`Found more than one (${t.length}) save handlers for URL '${e}'`);e=t[0]}if(null==e.save)throw new Qy("LayersModel.save() cannot proceed because the IOHandler provided does not have the `save` attribute defined.");const n=await Io(this.getNamedWeights(t)),s={modelTopology:this.toJSON(null,!1),format:"layers-model",generatedBy:`TensorFlow.js tfjs-layers v${ex}`,convertedBy:null};if(null!=t&&t.includeOptimizer&&null!=this.optimizer){s.trainingConfig=this.getTrainingConfig();const e="optimizer",{data:t,specs:r}=await Io(await this.optimizer.getWeights(),e);n.specs.push(...r),n.data=Lo([n.data,t])}if(null!=this.userDefinedMetadata){const e=!0;jv(this.userDefinedMetadata,this.name,e),s.userDefinedMetadata=this.userDefinedMetadata}return s.weightData=n.data,s.weightSpecs=n.specs,e.save(s)}setUserDefinedMetadata(e){jv(e,this.name),this.userDefinedMetadata=e}getUserDefinedMetadata(){return this.userDefinedMetadata}}vx.className="Model",Hl(vx);class xx extends vx{}xx.className="Functional",Hl(xx);class Ax extends vx{constructor(e){if(super({inputs:[],outputs:[]}),e=e||{},this.trainable=!0,this.built=!1,this.name=null!=e.name?e.name:Cb("sequential_"),null!=e.layers)for(const t of e.layers)this.add(t)}checkShape(e){if(e.inboundNodes[0].outputTensors[0].shape.some((e=>e<0)))throw new Qy(`Negative dimension size caused by adding layer ${e.name} with input shape [${e.inboundNodes[0].inputTensors[0].shape}]`)}add(e){const t=e instanceof Ax||e instanceof vx;let n;if(t){if(n=e,1!==n.outputs.length)throw new Qy("All layers in a Sequential model should have a single output tensor. For multi-output layers, use the functional API.");if(1!==n.inputs.length)throw new Qy("All layers in a Sequential model should have a single input tensor. For multi-input layers, use the functional API.")}if(0===this.outputs.length){if(0===e.inboundNodes.length){if(null==e.batchInputShape)throw new Qy("The first layer in a Sequential model must get an `inputShape` or `batchInputShape` argument.");const t=function(e){if(null==e.batchShape&&null==e.shape)throw new Error("Please provide to Input either a `shape` or a `batchShape` argument. Note that `shape` does not include the batch dimension.");if(null!=e.batchShape&&null!=e.shape)throw new Qy("Please provide either a `shape` or `batchShape` argument to Input, but not both.");let t=e.batchShape;null!=e.shape&&null==t&&(t=[null].concat(e.shape));let n=e.dtype;return null==n&&(n="float32"),new $w({batchInputShape:t,name:e.name,dtype:n,sparse:e.sparse}).inboundNodes[0].outputTensors[0]}({batchShape:e.batchInputShape,dtype:e.dtype,name:e.name+"_input"});e.apply(t)}if(t)this.outputs=n.outputs,this.inputs=n.inputs;else{if(1!==e.inboundNodes.length)throw new Qy(`A layer added to a Sequential model must not already be connected somewhere else. LayersModel received layer ${e.name} which has ${e.inboundNodes.length} pre-existing inbound connections.`);if(1!==e.inboundNodes[0].outputTensors.length)throw new Qy("All layers in a Sequential model should have a single output tensor. For multi-output layers, use the functional API.");this.checkShape(e),this.outputs=[e.inboundNodes[0].outputTensors[0]],this.inputs=Hw(this.outputs[0])}this.inboundNodes=[],new Gw({outboundLayer:this,inboundLayers:[],nodeIndices:[],tensorIndices:[],inputTensors:this.inputs,outputTensors:this.outputs,inputMasks:nb(null,this.inputs.length),outputMasks:[null],inputShapes:this.inputs.map((e=>e.shape)),outputShapes:this.outputs[0].shape})}else{const t=e.apply(this.outputs[0]);if(Array.isArray(t))throw new TypeError("All layers in a Sequential model should have a single output tensor. For multi-output layers, use the functional API.");this.checkShape(e),this.outputs=[t],this.inboundNodes[0].outputTensors=this.outputs,this.inboundNodes[0].outputShapes=[this.outputs[0].shape]}this.layers.push(e),this.built=!1}pop(){if(0===this.layers.length)throw new TypeError("There are no layers in the model.");if(this.layers.pop(),0===this.layers.length)this.outputs=[],this.inboundNodes=[],this.outboundNodes=[];else{const e=this.layers.length-1;this.layers[e].outboundNodes=[],this.outputs=[this.layers[e].output],this.inboundNodes[0].outputTensors=this.outputs,this.inboundNodes[0].outputShapes=[this.outputs[0].shape]}}call(e,t){return null==this.model&&this.build(),this.model.call(e,t)}build(e){if(Mw(e),0===this.inputs.length||0===this.outputs.length)throw new TypeError("Sequential model cannot be built: model is empty. Add some layers first.");this.model=new vx({inputs:this.inputs,outputs:this.outputs[0],name:this.name+"_model"}),this.model.trainable=this.trainable,this.supportsMasking=this.model.supportsMasking,this.inputLayers=this.model.inputLayers,this.inputLayersNodeIndices=this.model.inputLayersNodeIndices,this.inputLayersTensorIndices=this.model.inputLayersTensorIndices,this.outputLayers=this.model.outputLayers,this.outputLayersNodeIndices=this.model.outputLayersNodeIndices,this.outputLayersTensorIndices=this.model.outputLayersTensorIndices,this.nodesByDepth=this.model.nodesByDepth,this.containerNodes=this.model.containerNodes,this.outputNames=this.model.outputNames,this.inputNames=this.model.inputNames,this.built=!0}countParams(){return this.built||this.build(),super.countParams()}summary(e,t,n=console.log){this.built||this.build(),super.summary(e,t,n)}setWeights(e){null==this.model&&this.build(),this.model.setWeights(e)}evaluate(e,t,n={}){if(!this.built)throw new Yy("The model needs to be compiled before being used.");return this.model.evaluate(e,t,n)}async evaluateDataset(e,t){if(!this.built)throw new Yy("The model needs to be compiled before being used.");return this.model.evaluateDataset(e,t)}predict(e,t={}){return null==this.model&&this.build(),this.model.predict(e,t)}predictOnBatch(e){return null==this.model&&this.build(),this.model.predictOnBatch(e)}compile(e){this.build(),this.model.compile(e),this.optimizer_=this.model.optimizer,this.isOptimizerOwned=this.model.isOptimizerOwned,this.loss=this.model.loss,this.metrics=this.model.metrics,this.metricsTensors=this.model.metricsTensors,this.metricsNames=this.model.metricsNames}get optimizer(){return null==this.model?void 0:this.model.optimizer}set optimizer(e){this.model.optimizer=e}async fit(e,t,n={}){if(!this.built)throw new Yy("The model needs to be compiled before being used.");return this.model.fit(e,t,n)}async fitDataset(e,t){if(!this.built)throw new Yy("The model needs to be compiled before being used.");return this.model.fitDataset(e,t)}async trainOnBatch(e,t){return this.model.trainOnBatch(e,t)}static fromConfig(e,t,n={},s=!1){let r,a={};if(t instanceof Array){if(null==t[0].className||"Merge"===t[0].className)throw new Qy("Legacy serialization format not supported yet.");r=t}else qt(null!=t.layers,(()=>"When the config data for a Sequential model is not an Array, it must be an Object that contains the 'layers' field.")),r=t.layers,delete t.layers,a=t;const i=new e(a);if(!(i instanceof Ax))throw new Jy(`Sequential.fromConfig called on non-Sequential input: ${i}`);for(const e of r){const t=Av(e,void 0,s);s&&t.setFastWeightInitDuringBuild(!0),i.add(t)}return i}set stopTraining(e){if(null==this.model)throw new Qy("Cannot set the stopTraining property of a sequential model before it is compiled.");this.model.stopTraining=e}get stopTraining(){if(null==this.model)throw new Qy("Cannot get the stopTraining property of a sequential model before it is compiled.");return this.model.stopTraining}getConfig(){const e=[];for(const t of this.layers){const n={};n.className=t.getClassName(),n.config=t.getConfig(),e.push(n)}return{name:this.name,layers:e}}}Ax.className="Sequential",Hl(Ax);class kx extends ql{getConfig(){return{}}}class Cx extends kx{apply(e,t=1){return function(e,t=1){if(1!==t)throw new Jy(`Support for alpha values other than 1 (${t}) is not implemented yet.`);return vh(e)}(e,t)}}Cx.className="elu",Hl(Cx);class Sx extends kx{apply(e){return dp(e)}}Sx.className="selu",Hl(Sx);class Ex extends kx{apply(e){return sp(e)}}Ex.className="relu",Hl(Ex);class _x extends kx{apply(e){return Ao((()=>Ad(6,sp(e))))}}_x.className="relu6",Hl(_x);class Ix extends kx{apply(e){return e}}Ix.className="linear",Hl(Ix);class Tx extends kx{apply(e){return Mc(e)}}Tx.className="sigmoid",Hl(Tx);class Nx extends kx{apply(e){return function(e){return Ao((()=>{const t=Dl(.5,Bl(.2,e));return Kc(t,0,1)}))}(e)}}Nx.className="hardSigmoid",Hl(Nx);class Ox extends kx{apply(e){return rd(e)}}Ox.className="softplus",Hl(Ox);class Rx extends kx{apply(e){return function(e){return Ao((()=>Fl(e,Dl(eu(e),1))))}(e)}}Rx.className="softsign",Hl(Rx);class Dx extends kx{apply(e){return Bc(e)}}Dx.className="tanh",Hl(Dx);class Mx extends kx{apply(e,t=-1){return Ap(e,t)}}Mx.className="softmax",Hl(Mx);class Fx extends kx{apply(e,t=-1){return id(e,t)}}Fx.className="logSoftmax",Hl(Fx);class Bx extends kx{apply(e){return Ao((()=>Ao((()=>{const t=Math.sqrt(2),n=Bl(.5,Dl(1,Ah(Fl(e,t))));return Bl(e,n)}))))}}Bx.className="gelu",Hl(Bx);class zx extends kx{apply(e){return Ao((()=>Bl(.5,Bl(e,Dl(1,Bc(Bl(zl(Fl(2,Math.PI)),Dl(e,Bl(.044715,Yl(e,3))))))))))}}zx.className="gelu_new",Hl(zx);class Lx extends kx{apply(e){return Ao((()=>Bl(e,Bc(rd(e)))))}}Lx.className="mish",Hl(Lx);class Px extends kx{apply(e,t=1){return Ao((()=>Bl(Mc(Bl(e,t)),e)))}}function Vx(e){return e.getClassName()}function Wx(e,t={}){return db(e,jl.getMap().classNameMap,t,"activation")}function Ux(e){if(null==e){const e={className:"linear",config:{}};return Wx(e)}if("string"==typeof e){const t={};return t.className=e,t.config={},Wx(t)}return e instanceof kx?e:Wx(e)}function Gx(e){if(null!=e&&"object"!=typeof e)throw new Error(`Argument to L1L2 regularizer's constructor is expected to be an object, but received: ${e}`)}Px.className="swish",Hl(Px);class qx extends ql{}class jx extends qx{constructor(e){super(),Gx(e),this.l1=null==e||null==e.l1?.01:e.l1,this.l2=null==e||null==e.l2?.01:e.l2,this.hasL1=0!==this.l1,this.hasL2=0!==this.l2}apply(e){return Ao((()=>{let t=wd([1]);return this.hasL1&&(t=Dl(t,Dh(Bl(this.l1,eu(e))))),this.hasL2&&(t=Dl(t,Dh(Bl(this.l2,rw(e))))),Tc(t,[])}))}getConfig(){return{l1:this.l1,l2:this.l2}}static fromConfig(e,t){return new e({l1:t.l1,l2:t.l2})}}jx.className="L1L2",Hl(jx);const Hx={l1l2:"L1L2"};function $x(e){return cb(e)}function Kx(e,t={}){return db(e,jl.getMap().classNameMap,t,"regularizer")}function Xx(e){if(null==e)return null;if("string"==typeof e){return Kx({className:e in Hx?Hx[e]:e,config:{}})}return e instanceof qx?e:Kx(e)}class Zx extends jw{constructor(e){super(null==e?{}:e),this.supportsMasking=!0,null!=e&&(this.maxValue=e.maxValue)}call(e,t){e=Dw(e);let n=sp(e);return null!=this.maxValue&&(n=Kc(n,0,this.maxValue)),n}computeOutputShape(e){return e}getConfig(){const e={maxValue:this.maxValue},t=super.getConfig();return Object.assign(e,t),e}}Zx.className="ReLU",Hl(Zx);class Yx extends jw{constructor(e){super(null==e?{}:e),this.DEFAULT_ALPHA=.3,null==e&&(e={}),this.alpha=null==e.alpha?this.DEFAULT_ALPHA:e.alpha}call(e,t){const n=Dw(e);return Zh(n,this.alpha)}computeOutputShape(e){return e}getConfig(){const e={alpha:this.alpha},t=super.getConfig();return Object.assign(e,t),e}}Yx.className="LeakyReLU",Hl(Yx);class Qx extends jw{constructor(e){if(super(null==e?{}:e),this.DEFAULT_ALPHA_INITIALIZER="zeros",null==e&&(e={}),this.supportsMasking=!0,this.alphaInitializer=Nw(e.alphaInitializer||this.DEFAULT_ALPHA_INITIALIZER),this.alphaRegularizer=Xx(e.alphaRegularizer),this.alphaConstraint=cv(e.alphaConstraint),null==e.sharedAxes)this.sharedAxes=null;else if(Array.isArray(e.sharedAxes))this.sharedAxes=e.sharedAxes;else{if("number"!=typeof e.sharedAxes)throw new Qy(`Expected sharedAxes to be a number or an array of numbers, but got ${e.sharedAxes}`);this.sharedAxes=[e.sharedAxes]}}build(e){const t=(e=Mw(e)).slice(1);if(null!=this.sharedAxes)for(const e of this.sharedAxes)t[e-1]=1;this.alpha=this.addWeight("alpha",t,"float32",this.alphaInitializer,this.alphaRegularizer,!0,this.alphaConstraint);const n={};if(null!=this.sharedAxes)for(let t=1;t{let n=Dw(e);const s=t.mask;if(null!=s){const e=Bl(Ql(vd(n.shape),Nl(s,n.dtype)),Wl(-1e9));n=Dl(n,e)}return this.axis instanceof Array?this.axis.length>1?zh(Ql(n,od(n,this.axis,!0))):this.softmax(n,this.axis[0]):this.softmax(n,this.axis)}))}computeOutputShape(e){return e}getConfig(){const e={axis:this.axis},t=super.getConfig();return Object.assign(e,t),e}}function nA(e,t,n){if("number"==typeof e)return nb(e,t);if(e.length!==t)throw new Qy(`The ${n} argument must be an integer or tuple of ${t} integers. Received: ${e.length} elements.`);for(let r=0;r(Ob(t),"channelsFirst"===t?Jp(e,[0,2,3,1]):e)))}function iA(e,t){return Ao((()=>(Ob(t),"channelsFirst"===t?Jp(e,[0,2,3,4,1]):e)))}function oA(e,t,n,s=1,r="valid",a,i=1){return Ao((()=>{if(null==a&&(a="channelsLast"),Ob(a),3!==e.shape.length)throw new Qy(`The input of a conv1dWithBias operation should be 3, but is ${e.shape.length} instead.`);if(3!==t.shape.length)throw new Qy(`The kernel for a conv1dWithBias operation should be 3, but is ${t.shape.length} instead`);if(null!=n&&1!==n.shape.length)throw new Qy(`The bias for a conv1dWithBias operation should be 1, but is ${n.shape.length} instead`);if("channelsFirst"===a&&(e=Jp(e,[0,2,1])),"causal"===r)throw new Jy("The support for CAUSAL padding mode in conv1dWithBias is not implemented yet.");let o=eh(e,t,s,"same"===r?"same":"valid","NWC",i);return null!=n&&(o=iw(o,n)),o}))}function lA(e,t,n,s=[1,1],r="valid",a,i,o=null){return Ao((()=>{if(null==a&&(a="channelsLast"),Ob(a),3!==e.rank&&4!==e.rank)throw new Qy(`conv2dWithBiasActivation expects input to be of rank 3 or 4, but received ${e.rank}.`);if(3!==t.rank&&4!==t.rank)throw new Qy(`conv2dWithBiasActivation expects kernel to be of rank 3 or 4, but received ${e.rank}.`);let l=aA(e,a);if("causal"===r)throw new Jy("The support for CAUSAL padding mode in conv1dWithBias is not implemented yet.");return l=ff({x:l,filter:t,strides:s,pad:"same"===r?"same":"valid",dilations:i,dataFormat:"NHWC",bias:n,activation:o}),"channelsFirst"===a&&(l=Jp(l,[0,3,1,2])),l}))}function uA(e,t,n,s=[1,1,1],r="valid",a,i){return Ao((()=>{if(null==a&&(a="channelsLast"),Ob(a),4!==e.rank&&5!==e.rank)throw new Qy(`conv3dWithBias expects input to be of rank 4 or 5, but received ${e.rank}.`);if(4!==t.rank&&5!==t.rank)throw new Qy(`conv3dWithBias expects kernel to be of rank 4 or 5, but received ${e.rank}.`);let o=iA(e,a);if("causal"===r)throw new Jy("The support for CAUSAL padding mode in conv3dWithBias is not implemented yet.");return o=sh(o,t,s,"same"===r?"same":"valid","NDHWC",i),null!=n&&(o=iw(o,n)),"channelsFirst"===a&&(o=Jp(o,[0,4,1,2,3])),o}))}tA.className="Softmax",Hl(tA);class cA extends jw{constructor(e,t){if(super(t),this.bias=null,this.DEFAULT_KERNEL_INITIALIZER="glorotNormal",this.DEFAULT_BIAS_INITIALIZER="zeros",cA.verifyArgs(t),this.rank=e,bb(this.rank,"rank"),1!==this.rank&&2!==this.rank&&3!==this.rank)throw new Jy(`Convolution layer for rank other than 1, 2, or 3 (${this.rank}) is not implemented yet.`);if(this.kernelSize=nA(t.kernelSize,e,"kernelSize"),this.strides=nA(null==t.strides?1:t.strides,e,"strides"),this.padding=null==t.padding?"valid":t.padding,Rb(this.padding),this.dataFormat=null==t.dataFormat?"channelsLast":t.dataFormat,Ob(this.dataFormat),this.activation=Ux(t.activation),this.useBias=null==t.useBias||t.useBias,this.biasInitializer=Nw(t.biasInitializer||this.DEFAULT_BIAS_INITIALIZER),this.biasConstraint=cv(t.biasConstraint),this.biasRegularizer=Xx(t.biasRegularizer),this.activityRegularizer=Xx(t.activityRegularizer),this.dilationRate=nA(null==t.dilationRate?1:t.dilationRate,e,"dilationRate"),1===this.rank&&Array.isArray(this.dilationRate)&&1!==this.dilationRate.length)throw new Qy(`dilationRate must be a number or an array of a single number for 1D convolution, but received ${JSON.stringify(this.dilationRate)}`);if(2===this.rank){if("number"==typeof this.dilationRate)this.dilationRate=[this.dilationRate,this.dilationRate];else if(2!==this.dilationRate.length)throw new Qy(`dilationRate must be a number or array of two numbers for 2D convolution, but received ${JSON.stringify(this.dilationRate)}`)}else if(3===this.rank)if("number"==typeof this.dilationRate)this.dilationRate=[this.dilationRate,this.dilationRate,this.dilationRate];else if(3!==this.dilationRate.length)throw new Qy(`dilationRate must be a number or array of three numbers for 3D convolution, but received ${JSON.stringify(this.dilationRate)}`)}static verifyArgs(e){if(sb("kernelSize"in e,"required key 'kernelSize' not in config"),"number"!=typeof e.kernelSize&&!yb(e.kernelSize,"number",1,3))throw new Qy(`BaseConv expects config.kernelSize to be number or number[] with length 1, 2, or 3, but received ${JSON.stringify(e.kernelSize)}.`)}getConfig(){const e={kernelSize:this.kernelSize,strides:this.strides,padding:this.padding,dataFormat:this.dataFormat,dilationRate:this.dilationRate,activation:Vx(this.activation),useBias:this.useBias,biasInitializer:Tw(this.biasInitializer),biasRegularizer:$x(this.biasRegularizer),activityRegularizer:$x(this.activityRegularizer),biasConstraint:lv(this.biasConstraint)},t=super.getConfig();return Object.assign(e,t),e}}class hA extends cA{constructor(e,t){super(e,t),this.kernel=null,hA.verifyArgs(t),this.filters=t.filters,bb(this.filters,"filters"),this.kernelInitializer=Nw(t.kernelInitializer||this.DEFAULT_KERNEL_INITIALIZER),this.kernelConstraint=cv(t.kernelConstraint),this.kernelRegularizer=Xx(t.kernelRegularizer)}build(e){e=Mw(e);const t="channelsFirst"===this.dataFormat?1:e.length-1;if(null==e[t])throw new Qy(`The channel dimension of the input should be defined. Found ${e[t]}`);const n=e[t],s=this.kernelSize.concat([n,this.filters]);this.kernel=this.addWeight("kernel",s,null,this.kernelInitializer,this.kernelRegularizer,!0,this.kernelConstraint),this.useBias&&(this.bias=this.addWeight("bias",[this.filters],null,this.biasInitializer,this.biasRegularizer,!0,this.biasConstraint)),this.inputSpec=[{ndim:this.rank+2,axes:{[t]:n}}],this.built=!0}call(e,t){return Ao((()=>{let t;e=Dw(e);const n=null==this.bias?null:this.bias.read(),s=vb(this.activation.getClassName());if(null!=s&&2===this.rank)t=lA(e,this.kernel.read(),n,this.strides,this.padding,this.dataFormat,this.dilationRate,s);else{if(1===this.rank)t=oA(e,this.kernel.read(),n,this.strides[0],this.padding,this.dataFormat,this.dilationRate[0]);else if(2===this.rank)t=lA(e,this.kernel.read(),n,this.strides,this.padding,this.dataFormat,this.dilationRate);else{if(3!==this.rank)throw new Jy("convolutions greater than 3D are not implemented yet.");t=uA(e,this.kernel.read(),n,this.strides,this.padding,this.dataFormat,this.dilationRate)}null!=this.activation&&(t=this.activation.apply(t))}return t}))}computeOutputShape(e){e=Mw(e);const t=[],n="channelsLast"===this.dataFormat?e.slice(1,e.length-1):e.slice(2);for(let e=0;e 0 but got ${JSON.stringify(e.filters)}`)}}class dA extends hA{constructor(e){super(2,e),dA.verifyArgs(e)}getConfig(){const e=super.getConfig();return delete e.rank,e}static verifyArgs(e){if("number"!=typeof e.kernelSize&&!yb(e.kernelSize,"number",1,2))throw new Qy(`Conv2D expects config.kernelSize to be number or number[] with length 1 or 2, but received ${JSON.stringify(e.kernelSize)}.`)}}dA.className="Conv2D",Hl(dA);class pA extends hA{constructor(e){super(3,e),pA.verifyArgs(e)}getConfig(){const e=super.getConfig();return delete e.rank,e}static verifyArgs(e){if("number"!=typeof e.kernelSize&&(!Array.isArray(e.kernelSize)||1!==e.kernelSize.length&&3!==e.kernelSize.length))throw new Qy(`Conv3D expects config.kernelSize to be number or [number, number, number], but received ${JSON.stringify(e.kernelSize)}.`)}}pA.className="Conv3D",Hl(pA);class fA extends dA{constructor(e){if(super(e),this.inputSpec=[new Vw({ndim:4})],"same"!==this.padding&&"valid"!==this.padding)throw new Qy(`Conv2DTranspose currently supports only padding modes 'same' and 'valid', but received padding mode ${this.padding}`)}build(e){if(4!==(e=Mw(e)).length)throw new Qy("Input should have rank 4; Received input shape: "+JSON.stringify(e));const t="channelsFirst"===this.dataFormat?1:e.length-1;if(null==e[t])throw new Qy("The channel dimension of the inputs should be defined. Found `None`.");const n=e[t],s=this.kernelSize.concat([this.filters,n]);this.kernel=this.addWeight("kernel",s,"float32",this.kernelInitializer,this.kernelRegularizer,!0,this.kernelConstraint),this.useBias&&(this.bias=this.addWeight("bias",[this.filters],"float32",this.biasInitializer,this.biasRegularizer,!0,this.biasConstraint)),this.inputSpec=[new Vw({ndim:4,axes:{[t]:n}})],this.built=!0}call(e,t){return Ao((()=>{let t=Dw(e);if(4!==t.shape.length)throw new Qy(`Conv2DTranspose.call() expects input tensor to be rank-4, but received a tensor of rank-${t.shape.length}`);const n=t.shape,s=n[0];let r,a;"channelsFirst"===this.dataFormat?(r=2,a=3):(r=1,a=2);const i=n[r],o=n[a],l=this.kernelSize[0],u=this.kernelSize[1],c=this.strides[0],h=this.strides[1],d=[s,rA(i,c,l,this.padding),rA(o,h,u,this.padding),this.filters];"channelsLast"!==this.dataFormat&&(t=Jp(t,[0,2,3,1]));let p=nh(t,this.kernel.read(),d,this.strides,this.padding);return"channelsLast"!==this.dataFormat&&(p=Jp(p,[0,3,1,2])),null!=this.bias&&(p=iw(p,this.bias.read(),this.dataFormat)),null!=this.activation&&(p=this.activation.apply(p)),p}))}computeOutputShape(e){const t=(e=Mw(e)).slice();let n,s,r;"channelsFirst"===this.dataFormat?(n=1,s=2,r=3):(n=3,s=1,r=2);const a=this.kernelSize[0],i=this.kernelSize[1],o=this.strides[0],l=this.strides[1];return t[n]=this.filters,t[s]=rA(t[s],o,a,this.padding),t[r]=rA(t[r],l,i,this.padding),t}getConfig(){const e=super.getConfig();return delete e.dilationRate,e}}fA.className="Conv2DTranspose",Hl(fA);class mA extends pA{constructor(e){if(super(e),this.inputSpec=[new Vw({ndim:5})],"same"!==this.padding&&"valid"!==this.padding)throw new Qy(`Conv3DTranspose currently supports only padding modes 'same' and 'valid', but received padding mode ${this.padding}`)}build(e){if(5!==(e=Mw(e)).length)throw new Qy("Input should have rank 5; Received input shape: "+JSON.stringify(e));const t="channelsFirst"===this.dataFormat?1:e.length-1;if(null==e[t])throw new Qy("The channel dimension of the inputs should be defined. Found `None`.");const n=e[t],s=this.kernelSize.concat([this.filters,n]);this.kernel=this.addWeight("kernel",s,"float32",this.kernelInitializer,this.kernelRegularizer,!0,this.kernelConstraint),this.useBias&&(this.bias=this.addWeight("bias",[this.filters],"float32",this.biasInitializer,this.biasRegularizer,!0,this.biasConstraint)),this.inputSpec=[new Vw({ndim:5,axes:{[t]:n}})],this.built=!0}call(e,t){return Ao((()=>{let t=Dw(e);if(5!==t.shape.length)throw new Qy(`Conv3DTranspose.call() expects input tensor to be rank-4, but received a tensor of rank-${t.shape.length}`);const n=t.shape,s=n[0];let r,a,i;"channelsFirst"===this.dataFormat?(i=2,r=3,a=4):(i=1,r=2,a=3);const o=n[i],l=n[r],u=n[a],c=this.kernelSize[0],h=this.kernelSize[1],d=this.kernelSize[2],p=this.strides[0],f=this.strides[1],m=this.strides[2],g=[s,rA(o,p,c,this.padding),rA(l,f,h,this.padding),rA(u,m,d,this.padding),this.filters];"channelsLast"!==this.dataFormat&&(t=Jp(t,[0,2,3,4,1]));let y=ah(t,this.kernel.read(),g,this.strides,this.padding);return"channelsLast"!==this.dataFormat&&(y=Jp(y,[0,4,1,2,3])),null!==this.bias&&(y=iw(y,this.bias.read(),this.dataFormat)),null!==this.activation&&(y=this.activation.apply(y)),y}))}computeOutputShape(e){const t=(e=Mw(e)).slice();let n,s,r,a;"channelsFirst"===this.dataFormat?(n=1,s=2,r=3,a=4):(n=4,s=1,r=2,a=3);const i=this.kernelSize[0],o=this.kernelSize[1],l=this.kernelSize[2],u=this.strides[0],c=this.strides[1],h=this.strides[2];return t[n]=this.filters,t[s]=rA(t[s],u,i,this.padding),t[r]=rA(t[r],c,o,this.padding),t[a]=rA(t[a],h,l,this.padding),t}getConfig(){const e=super.getConfig();return delete e.dilationRate,e}}mA.className="Conv3DTranspose",Hl(mA);class gA extends hA{constructor(e,t){if(super(e,t),this.DEFAULT_DEPTHWISE_INITIALIZER="glorotUniform",this.DEFAULT_POINTWISE_INITIALIZER="glorotUniform",this.depthwiseKernel=null,this.pointwiseKernel=null,null==t.filters)throw new Qy("The `filters` configuration field is required by SeparableConv, but is unspecified.");if(null!=t.kernelInitializer||null!=t.kernelRegularizer||null!=t.kernelConstraint)throw new Qy("Fields kernelInitializer, kernelRegularizer and kernelConstraint are invalid for SeparableConv2D. Use depthwiseInitializer, depthwiseRegularizer, depthwiseConstraint, pointwiseInitializer, pointwiseRegularizer and pointwiseConstraint instead.");if(null!=t.padding&&"same"!==t.padding&&"valid"!==t.padding)throw new Qy(`SeparableConv${this.rank}D supports only padding modes: 'same' and 'valid', but received ${JSON.stringify(t.padding)}`);this.depthMultiplier=null==t.depthMultiplier?1:t.depthMultiplier,this.depthwiseInitializer=Nw(t.depthwiseInitializer||this.DEFAULT_DEPTHWISE_INITIALIZER),this.depthwiseRegularizer=Xx(t.depthwiseRegularizer),this.depthwiseConstraint=cv(t.depthwiseConstraint),this.pointwiseInitializer=Nw(t.depthwiseInitializer||this.DEFAULT_POINTWISE_INITIALIZER),this.pointwiseRegularizer=Xx(t.pointwiseRegularizer),this.pointwiseConstraint=cv(t.pointwiseConstraint)}build(e){if((e=Mw(e)).length{let t;if(e=Dw(e),1===this.rank)throw new Jy("1D separable convolution is not implemented yet.");return 2===this.rank&&("channelsFirst"===this.dataFormat&&(e=Jp(e,[0,2,3,1])),t=pp(e,this.depthwiseKernel.read(),this.pointwiseKernel.read(),this.strides,this.padding,this.dilationRate,"NHWC")),this.useBias&&(t=iw(t,this.bias.read(),this.dataFormat)),null!=this.activation&&(t=this.activation.apply(t)),"channelsFirst"===this.dataFormat&&(t=Jp(t,[0,3,1,2])),t}))}getConfig(){const e=super.getConfig();return delete e.rank,delete e.kernelInitializer,delete e.kernelRegularizer,delete e.kernelConstraint,e.depthwiseInitializer=Tw(this.depthwiseInitializer),e.pointwiseInitializer=Tw(this.pointwiseInitializer),e.depthwiseRegularizer=$x(this.depthwiseRegularizer),e.pointwiseRegularizer=$x(this.pointwiseRegularizer),e.depthwiseConstraint=lv(this.depthwiseConstraint),e.pointwiseConstraint=lv(this.pointwiseConstraint),e}}gA.className="SeparableConv";class yA extends gA{constructor(e){super(2,e)}}yA.className="SeparableConv2D",Hl(yA);class bA extends hA{constructor(e){super(1,e),bA.verifyArgs(e),this.inputSpec=[{ndim:3}]}getConfig(){const e=super.getConfig();return delete e.rank,delete e.dataFormat,e}static verifyArgs(e){if("number"!=typeof e.kernelSize&&!yb(e.kernelSize,"number",1,1))throw new Qy(`Conv1D expects config.kernelSize to be number or number[] with length 1, but received ${JSON.stringify(e.kernelSize)}.`)}}bA.className="Conv1D",Hl(bA);class wA extends jw{constructor(e){super(e),"number"==typeof e.cropping?this.cropping=[[e.cropping,e.cropping],[e.cropping,e.cropping]]:"number"==typeof e.cropping[0]?this.cropping=[[e.cropping[0],e.cropping[0]],[e.cropping[1],e.cropping[1]]]:this.cropping=e.cropping,this.dataFormat=void 0===e.dataFormat?"channelsLast":e.dataFormat,this.inputSpec=[{ndim:4}]}computeOutputShape(e){return"channelsFirst"===this.dataFormat?[e[0],e[1],e[2]-this.cropping[0][0]-this.cropping[0][1],e[3]-this.cropping[1][0]-this.cropping[1][1]]:[e[0],e[1]-this.cropping[0][0]-this.cropping[0][1],e[2]-this.cropping[1][0]-this.cropping[1][1],e[3]]}call(e,t){return Ao((()=>{if(e=Dw(e),"channelsLast"===this.dataFormat){const t=Yb(e,this.cropping[0][0],e.shape[1]-this.cropping[0][0]-this.cropping[0][1],2);return Yb(t,this.cropping[1][0],e.shape[2]-this.cropping[1][1]-this.cropping[1][0],3)}{const t=Yb(e,this.cropping[0][0],e.shape[2]-this.cropping[0][0]-this.cropping[0][1],3);return Yb(t,this.cropping[1][0],e.shape[3]-this.cropping[1][1]-this.cropping[1][0],4)}}))}getConfig(){const e={cropping:this.cropping,dataFormat:this.dataFormat},t=super.getConfig();return Object.assign(e,t),e}}wA.className="Cropping2D",Hl(wA);class vA extends jw{constructor(e){var t;super(e),this.DEFAULT_SIZE=[2,2],this.inputSpec=[{ndim:4}],this.size=null==e.size?this.DEFAULT_SIZE:e.size,this.dataFormat=null==e.dataFormat?"channelsLast":e.dataFormat,Ob(this.dataFormat),this.interpolation=null==e.interpolation?"nearest":e.interpolation,t=this.interpolation,gb(Eb,"InterpolationFormat",t)}computeOutputShape(e){if("channelsFirst"===this.dataFormat){const t=null==e[2]?null:this.size[0]*e[2],n=null==e[3]?null:this.size[1]*e[3];return[e[0],e[1],t,n]}{const t=null==e[1]?null:this.size[0]*e[1],n=null==e[2]?null:this.size[1]*e[2];return[e[0],t,n,e[3]]}}call(e,t){return Ao((()=>{let t=Dw(e);const n=t.shape;if("channelsFirst"===this.dataFormat){t=Jp(t,[0,2,3,1]);const e=this.size[0]*n[2],s=this.size[1]*n[3],r="nearest"===this.interpolation?bm.resizeNearestNeighbor(t,[e,s]):bm.resizeBilinear(t,[e,s]);return Jp(r,[0,3,1,2])}{const e=this.size[0]*n[1],s=this.size[1]*n[2];return"nearest"===this.interpolation?bm.resizeNearestNeighbor(t,[e,s]):bm.resizeBilinear(t,[e,s])}}))}getConfig(){const e={size:this.size,dataFormat:this.dataFormat,interpolation:this.interpolation},t=super.getConfig();return Object.assign(e,t),e}}vA.className="UpSampling2D",Hl(vA);class xA extends cA{constructor(e){super(2,e),this.depthwiseKernel=null,this.depthMultiplier=null==e.depthMultiplier?1:e.depthMultiplier,this.depthwiseInitializer=Nw(e.depthwiseInitializer||this.DEFAULT_KERNEL_INITIALIZER),this.depthwiseConstraint=cv(e.depthwiseConstraint),this.depthwiseRegularizer=Xx(e.depthwiseRegularizer)}build(e){if((e=Mw(e)).length<4)throw new Qy(`Inputs to DepthwiseConv2D should have rank 4. Received input shape: ${JSON.stringify(e)}.`);const t="channelsFirst"===this.dataFormat?1:3;if(null==e[t]||e[t]<0)throw new Qy(`The channel dimension of the inputs to DepthwiseConv2D should be defined, but is not (${e[t]}).`);const n=e[t],s=[this.kernelSize[0],this.kernelSize[1],n,this.depthMultiplier];this.depthwiseKernel=this.addWeight("depthwise_kernel",s,null,this.depthwiseInitializer,this.depthwiseRegularizer,!0,this.depthwiseConstraint),this.useBias?this.bias=this.addWeight("bias",[n*this.depthMultiplier],null,this.biasInitializer,this.biasRegularizer,!0,this.biasConstraint):this.bias=null,this.built=!0}call(e,t){return Ao((()=>{let t=function(e,t,n=[1,1],s="valid",r,a){return Ao((()=>{null==r&&(r="channelsLast"),Ob(r);let i=aA(e,r);if(4!==e.rank)throw new Qy(`Input for depthwiseConv2d is required to be 4-D, but is instead ${e.rank}-D`);if(4!==t.rank)throw new Qy(`depthwiseKernel is required to be 4-D, but is instead ${t.rank}-D`);return i=dh(i,t,n,"same"===s?"same":"valid","NHWC",a),"channelsFirst"===r&&(i=Jp(i,[0,3,1,2])),i}))}(e=Dw(e),this.depthwiseKernel.read(),this.strides,this.padding,this.dataFormat,null);return this.useBias&&(t=iw(t,this.bias.read(),this.dataFormat)),null!=this.activation&&(t=this.activation.apply(t)),t}))}computeOutputShape(e){e=Mw(e);const t="channelsFirst"===this.dataFormat?e[2]:e[1],n="channelsFirst"===this.dataFormat?e[3]:e[2],s="channelsFirst"===this.dataFormat?e[1]*this.depthMultiplier:e[3]*this.depthMultiplier,r=sA(t,this.kernelSize[0],this.padding,this.strides[0]),a=sA(n,this.kernelSize[1],this.padding,this.strides[1]);return"channelsFirst"===this.dataFormat?[e[0],s,r,a]:[e[0],r,a,s]}getConfig(){const e=super.getConfig();return e.depthMultiplier=this.depthMultiplier,e.depthwiseInitializer=Tw(this.depthwiseInitializer),e.depthwiseRegularizer=$x(this.depthwiseRegularizer),e.depthwiseConstraint=lv(this.depthwiseRegularizer),e}}function AA(e,t,n,s){if(Array.isArray(e)){if(null!=t||null!=n)throw new Qy("When inputs is an array, neither initialState or constants should be provided");null!=s&&(n=e.slice(e.length-s,e.length),e=e.slice(0,e.length-s)),e.length>1&&(t=e.slice(1,e.length)),e=e[0]}function r(e){return null==e||Array.isArray(e)?e:[e]}return{inputs:e,initialState:t=r(t),constants:n=r(n)}}function kA(e,t,n,s=!1,r,a,i=!1,o=!1){return Ao((()=>{const i=t.shape.length;if(i<3)throw new Qy(`Input should be at least 3D, but is ${i}D.`);const l=[1,0].concat(qb(2,i));if(t=Jp(t,l),null!=a)throw new Jy("The rnn() functoin of the deeplearn.js backend does not support constants yet.");null!=r&&((r=Nl(Nl(r,"bool"),"float32")).rank===i-1&&(r=Lh(r,-1)),r=Jp(r,l)),s&&(t=ap(t,0),null!=r&&(r=ap(r,0)));const u=[];let c,h=n;const d=t.shape[0],p=$p(t);let f,m;null!=r&&(f=$p(r));for(let t=0;te(n,h)));if(null==r)c=s[0],h=s[1];else{const e=Ao((()=>{const e=f[t],n=Ql(Nd(e),e);return{output:Dl(Bl(s[0],e),Bl(h[0],n)),newStates:h.map(((t,r)=>Dl(Bl(s[1][r],e),Bl(t,n))))}}));c=e.output,h=e.newStates}o&&u.push(c)}if(o){m=Np(u,1)}return[c,m,h]}))}xA.className="DepthwiseConv2D",Hl(xA);class CA extends jw{constructor(e){let t;if(super(e),null==e.cell)throw new Qy("cell property is missing for the constructor of RNN.");if(t=Array.isArray(e.cell)?new RA({cells:e.cell}):e.cell,null==t.stateSize)throw new Qy("The RNN cell should have an attribute `stateSize` (tuple of integers, one integer per RNN state).");this.cell=t,this.returnSequences=null!=e.returnSequences&&e.returnSequences,this.returnState=null!=e.returnState&&e.returnState,this.goBackwards=null!=e.goBackwards&&e.goBackwards,this._stateful=null!=e.stateful&&e.stateful,this.unroll=null!=e.unroll&&e.unroll,this.supportsMasking=!0,this.inputSpec=[new Vw({ndim:3})],this.stateSpec=null,this.states_=null,this.numConstants=null,this.keptStates=[]}getStates(){if(null==this.states_){return qb(0,Array.isArray(this.cell.stateSize)?this.cell.stateSize.length:1).map((e=>null))}return this.states_}setStates(e){this.states_=e}computeOutputShape(e){Ow(e)&&(e=e[0]);let t=this.cell.stateSize;Array.isArray(t)||(t=[t]);const n=t[0];let s;if(s=this.returnSequences?[e[0],e[1],n]:[e[0],n],this.returnState){const n=[];for(const s of t)n.push([e[0],s]);return[s].concat(n)}return s}computeMask(e,t){return Ao((()=>{Array.isArray(t)&&(t=t[0]);const e=this.returnSequences?t:null;if(this.returnState){const t=this.states.map((e=>null));return[e].concat(t)}return e}))}get states(){if(null==this.states_){const e=Array.isArray(this.cell.stateSize)?this.cell.stateSize.length:1,t=[];for(let n=0;ne.shape[e.shape.length-1])),r))throw new Qy(`An initialState was passed that is not compatible with cell.stateSize. Received stateSpec=${this.stateSpec}; However cell.stateSize is ${this.cell.stateSize}`)}else this.stateSpec=r.map((e=>new Vw({shape:[null,e]})));this.stateful&&this.resetStates()}resetStates(e,t=!1){Ao((()=>{if(!this.stateful)throw new Zy("Cannot call resetStates() on an RNN Layer that is not stateful.");const n=this.inputSpec[0].shape[0];if(null==n)throw new Qy("If an RNN is stateful, it needs to know its batch size. Specify the batch size of your input tensors: \n- If using a Sequential model, specify the batch size by passing a `batchInputShape` option to your first layer.\n- If using the functional API, specify the batch size by passing a `batchShape` option to your Input layer.");if(null==this.states_)Array.isArray(this.cell.stateSize)?this.states_=this.cell.stateSize.map((e=>wd([n,e]))):this.states_=[wd([n,this.cell.stateSize])];else if(null==e)ko(this.states_),null!=this.keptStates&&(ko(this.keptStates),this.keptStates=[]),Array.isArray(this.cell.stateSize)?this.states_=this.cell.stateSize.map((e=>wd([n,e]))):this.states_[0]=wd([n,this.cell.stateSize]);else{if(Array.isArray(e)||(e=[e]),e.length!==this.states_.length)throw new Qy(`Layer ${this.name} expects ${this.states_.length} state(s), but it received ${e.length} state value(s). Input received: ${e}`);!0===t?this.keptStates.push(this.states_.slice()):ko(this.states_);for(let t=0;tCo(e.clone())))}))}apply(e,t){let n=null==t?null:t.initialState,s=null==t?null:t.constants;null==t&&(t={});const r=AA(e,n,s,this.numConstants);e=r.inputs,n=r.initialState,s=r.constants;let a=[],i=[];if(null!=n){t.initialState=n,a=a.concat(n),this.stateSpec=[];for(const e of n)this.stateSpec.push(new Vw({shape:e.shape}));i=i.concat(this.stateSpec)}null!=s&&(t.constants=s,a=a.concat(s),this.numConstants=s.length);if(a[0]instanceof Ww){const n=[e].concat(a),s=this.inputSpec.concat(i),r=this.inputSpec;this.inputSpec=s;const o=super.apply(n,t);return this.inputSpec=r,o}return super.apply(e,t)}call(e,t){return Ao((()=>{const n=null==t?null:t.mask,s=null==t?null:t.training;let r=null==t?null:t.initialState;e=Dw(e),null==r&&(r=this.stateful?this.states_:this.getInitialState(e));const a=Array.isArray(this.cell.stateSize)?this.cell.stateSize.length:1;if(r.length!==a)throw new Qy(`RNN Layer has ${a} state(s) but was passed ${r.length} initial state(s).`);this.unroll;const i={training:s},o=kA(((e,t)=>{const n=this.cell.call([e].concat(t),i);return[n[0],n.slice(1)]}),e,r,this.goBackwards,n,null,this.unroll,this.returnSequences),l=o[0],u=o[1],c=o[2];this.stateful&&this.resetStates(c,s);const h=this.returnSequences?u:l;return this.returnState?[h].concat(c):h}))}getInitialState(e){return Ao((()=>{let t=wd(e.shape);return t=Dh(t,[1,2]),t=Kb(t),Array.isArray(this.cell.stateSize)?this.cell.stateSize.map((e=>e>1?ew(t,[1,e]):t)):this.cell.stateSize>1?[ew(t,[1,this.cell.stateSize])]:[t]}))}get trainableWeights(){return this.trainable?this.cell.trainableWeights:[]}get nonTrainableWeights(){return this.trainable?this.cell.nonTrainableWeights:this.cell.weights}setFastWeightInitDuringBuild(e){super.setFastWeightInitDuringBuild(e),null!=this.cell&&this.cell.setFastWeightInitDuringBuild(e)}getConfig(){const e=super.getConfig(),t={returnSequences:this.returnSequences,returnState:this.returnState,goBackwards:this.goBackwards,stateful:this.stateful,unroll:this.unroll};null!=this.numConstants&&(t.numConstants=this.numConstants);const n=this.cell.getConfig();return this.getClassName()===CA.className&&(t.cell={className:this.cell.getClassName(),config:n}),Object.assign(Object.assign(Object.assign({},n),e),t)}static fromConfig(e,t,n={}){const s=Av(t.cell,n);return new e(Object.assign(t,{cell:s}))}}CA.className="RNN",Hl(CA);class SA extends jw{}class EA extends SA{constructor(e){super(e),this.DEFAULT_ACTIVATION="tanh",this.DEFAULT_KERNEL_INITIALIZER="glorotNormal",this.DEFAULT_RECURRENT_INITIALIZER="orthogonal",this.DEFAULT_BIAS_INITIALIZER="zeros",this.units=e.units,bb(this.units,"units"),this.activation=Ux(null==e.activation?this.DEFAULT_ACTIVATION:e.activation),this.useBias=null==e.useBias||e.useBias,this.kernelInitializer=Nw(e.kernelInitializer||this.DEFAULT_KERNEL_INITIALIZER),this.recurrentInitializer=Nw(e.recurrentInitializer||this.DEFAULT_RECURRENT_INITIALIZER),this.biasInitializer=Nw(e.biasInitializer||this.DEFAULT_BIAS_INITIALIZER),this.kernelRegularizer=Xx(e.kernelRegularizer),this.recurrentRegularizer=Xx(e.recurrentRegularizer),this.biasRegularizer=Xx(e.biasRegularizer),this.kernelConstraint=cv(e.kernelConstraint),this.recurrentConstraint=cv(e.recurrentConstraint),this.biasConstraint=cv(e.biasConstraint),this.dropout=Ub([1,Gb([0,null==e.dropout?0:e.dropout])]),this.recurrentDropout=Ub([1,Gb([0,null==e.recurrentDropout?0:e.recurrentDropout])]),this.dropoutFunc=e.dropoutFunc,this.stateSize=this.units,this.dropoutMask=null,this.recurrentDropoutMask=null}build(e){e=Mw(e),this.kernel=this.addWeight("kernel",[e[e.length-1],this.units],null,this.kernelInitializer,this.kernelRegularizer,!0,this.kernelConstraint),this.recurrentKernel=this.addWeight("recurrent_kernel",[this.units,this.units],null,this.recurrentInitializer,this.recurrentRegularizer,!0,this.recurrentConstraint),this.useBias?this.bias=this.addWeight("bias",[this.units],null,this.biasInitializer,this.biasRegularizer,!0,this.biasConstraint):this.bias=null,this.built=!0}call(e,t){return Ao((()=>{if(2!==e.length)throw new Qy(`SimpleRNNCell expects 2 input Tensors, got ${e.length}.`);let n=e[1];e=e[0];const s=null!=t.training&&t.training;let r;0Nd(e),rate:this.dropout,training:s,dropoutFunc:this.dropoutFunc})),0Nd(n),rate:this.recurrentDropout,training:s,dropoutFunc:this.dropoutFunc}));const a=this.dropoutMask,i=this.recurrentDropoutMask;r=nw(null!=a?Bl(e,a):e,this.kernel.read()),null!=this.bias&&(r=iw(r,this.bias.read())),null!=i&&(n=Bl(n,i));let o=Dl(r,nw(n,this.recurrentKernel.read()));return null!=this.activation&&(o=this.activation.apply(o)),[o,o]}))}getConfig(){const e=super.getConfig(),t={units:this.units,activation:Vx(this.activation),useBias:this.useBias,kernelInitializer:Tw(this.kernelInitializer),recurrentInitializer:Tw(this.recurrentInitializer),biasInitializer:Tw(this.biasInitializer),kernelRegularizer:$x(this.kernelRegularizer),recurrentRegularizer:$x(this.recurrentRegularizer),biasRegularizer:$x(this.biasRegularizer),activityRegularizer:$x(this.activityRegularizer),kernelConstraint:lv(this.kernelConstraint),recurrentConstraint:lv(this.recurrentConstraint),biasConstraint:lv(this.biasConstraint),dropout:this.dropout,recurrentDropout:this.recurrentDropout};return Object.assign(Object.assign({},e),t)}}EA.className="SimpleRNNCell",Hl(EA);class _A extends CA{constructor(e){e.cell=new EA(e),super(e)}call(e,t){return Ao((()=>{null!=this.cell.dropoutMask&&(ko(this.cell.dropoutMask),this.cell.dropoutMask=null),null!=this.cell.recurrentDropoutMask&&(ko(this.cell.recurrentDropoutMask),this.cell.recurrentDropoutMask=null);const n=null==t?null:t.mask,s=null==t?null:t.training,r=null==t?null:t.initialState;return super.call(e,{mask:n,training:s,initialState:r})}))}static fromConfig(e,t){return new e(t)}}_A.className="SimpleRNN",Hl(_A);class IA extends SA{constructor(e){if(super(e),this.DEFAULT_ACTIVATION="tanh",this.DEFAULT_RECURRENT_ACTIVATION="hardSigmoid",this.DEFAULT_KERNEL_INITIALIZER="glorotNormal",this.DEFAULT_RECURRENT_INITIALIZER="orthogonal",this.DEFAULT_BIAS_INITIALIZER="zeros",e.resetAfter)throw new Qy("GRUCell does not support reset_after parameter set to true.");this.units=e.units,bb(this.units,"units"),this.activation=Ux(void 0===e.activation?this.DEFAULT_ACTIVATION:e.activation),this.recurrentActivation=Ux(void 0===e.recurrentActivation?this.DEFAULT_RECURRENT_ACTIVATION:e.recurrentActivation),this.useBias=null==e.useBias||e.useBias,this.kernelInitializer=Nw(e.kernelInitializer||this.DEFAULT_KERNEL_INITIALIZER),this.recurrentInitializer=Nw(e.recurrentInitializer||this.DEFAULT_RECURRENT_INITIALIZER),this.biasInitializer=Nw(e.biasInitializer||this.DEFAULT_BIAS_INITIALIZER),this.kernelRegularizer=Xx(e.kernelRegularizer),this.recurrentRegularizer=Xx(e.recurrentRegularizer),this.biasRegularizer=Xx(e.biasRegularizer),this.kernelConstraint=cv(e.kernelConstraint),this.recurrentConstraint=cv(e.recurrentConstraint),this.biasConstraint=cv(e.biasConstraint),this.dropout=Ub([1,Gb([0,null==e.dropout?0:e.dropout])]),this.recurrentDropout=Ub([1,Gb([0,null==e.recurrentDropout?0:e.recurrentDropout])]),this.dropoutFunc=e.dropoutFunc,this.implementation=e.implementation,this.stateSize=this.units,this.dropoutMask=null,this.recurrentDropoutMask=null}build(e){const t=(e=Mw(e))[e.length-1];this.kernel=this.addWeight("kernel",[t,3*this.units],null,this.kernelInitializer,this.kernelRegularizer,!0,this.kernelConstraint),this.recurrentKernel=this.addWeight("recurrent_kernel",[this.units,3*this.units],null,this.recurrentInitializer,this.recurrentRegularizer,!0,this.recurrentConstraint),this.useBias?this.bias=this.addWeight("bias",[3*this.units],null,this.biasInitializer,this.biasRegularizer,!0,this.biasConstraint):this.bias=null,this.built=!0}call(e,t){return Ao((()=>{if(2!==e.length)throw new Qy(`GRUCell expects 2 input Tensors (inputs, h, c), got ${e.length}.`);const n=null!=t.training&&t.training;let s=e[1];e=e[0],0Nd(e),rate:this.dropout,training:n,count:3,dropoutFunc:this.dropoutFunc})),0Nd(s),rate:this.recurrentDropout,training:n,count:3,dropoutFunc:this.dropoutFunc}));const r=this.dropoutMask,a=this.recurrentDropoutMask;let i,o,l;0{null!=this.cell.dropoutMask&&(ko(this.cell.dropoutMask),this.cell.dropoutMask=null),null!=this.cell.recurrentDropoutMask&&(ko(this.cell.recurrentDropoutMask),this.cell.recurrentDropoutMask=null);const n=null==t?null:t.mask,s=null==t?null:t.training,r=null==t?null:t.initialState;return super.call(e,{mask:n,training:s,initialState:r})}))}static fromConfig(e,t){return 0===t.implmentation&&(t.implementation=1),new e(t)}}TA.className="GRU",Hl(TA);class NA extends SA{constructor(e){super(e),this.DEFAULT_ACTIVATION="tanh",this.DEFAULT_RECURRENT_ACTIVATION="hardSigmoid",this.DEFAULT_KERNEL_INITIALIZER="glorotNormal",this.DEFAULT_RECURRENT_INITIALIZER="orthogonal",this.DEFAULT_BIAS_INITIALIZER="zeros",this.units=e.units,bb(this.units,"units"),this.activation=Ux(void 0===e.activation?this.DEFAULT_ACTIVATION:e.activation),this.recurrentActivation=Ux(void 0===e.recurrentActivation?this.DEFAULT_RECURRENT_ACTIVATION:e.recurrentActivation),this.useBias=null==e.useBias||e.useBias,this.kernelInitializer=Nw(e.kernelInitializer||this.DEFAULT_KERNEL_INITIALIZER),this.recurrentInitializer=Nw(e.recurrentInitializer||this.DEFAULT_RECURRENT_INITIALIZER),this.biasInitializer=Nw(e.biasInitializer||this.DEFAULT_BIAS_INITIALIZER),this.unitForgetBias=e.unitForgetBias,this.kernelRegularizer=Xx(e.kernelRegularizer),this.recurrentRegularizer=Xx(e.recurrentRegularizer),this.biasRegularizer=Xx(e.biasRegularizer),this.kernelConstraint=cv(e.kernelConstraint),this.recurrentConstraint=cv(e.recurrentConstraint),this.biasConstraint=cv(e.biasConstraint),this.dropout=Ub([1,Gb([0,null==e.dropout?0:e.dropout])]),this.recurrentDropout=Ub([1,Gb([0,null==e.recurrentDropout?0:e.recurrentDropout])]),this.dropoutFunc=e.dropoutFunc,this.implementation=e.implementation,this.stateSize=[this.units,this.units],this.dropoutMask=null,this.recurrentDropoutMask=null}build(e){var t;const n=(e=Mw(e))[e.length-1];let s;if(this.kernel=this.addWeight("kernel",[n,4*this.units],null,this.kernelInitializer,this.kernelRegularizer,!0,this.kernelConstraint),this.recurrentKernel=this.addWeight("recurrent_kernel",[this.units,4*this.units],null,this.recurrentInitializer,this.recurrentRegularizer,!0,this.recurrentConstraint),this.useBias){if(this.unitForgetBias){const e=this.biasInitializer,n=this.units;s=new((t=class extends hw{apply(t,s){const r=e.apply([n]),a=(new pw).apply([n]),i=e.apply([2*n]);return Jb(Jb(r,a),i)}}).className="CustomInit",t)}else s=this.biasInitializer;this.bias=this.addWeight("bias",[4*this.units],null,s,this.biasRegularizer,!0,this.biasConstraint)}else this.bias=null;this.built=!0}call(e,t){return Ao((()=>{const n=null!=t.training&&t.training;if(3!==e.length)throw new Qy(`LSTMCell expects 3 input Tensors (inputs, h, c), got ${e.length}.`);let s=e[1];const r=e[2];e=e[0],0Nd(e),rate:this.dropout,training:n,count:4,dropoutFunc:this.dropoutFunc})),0Nd(s),rate:this.recurrentDropout,training:n,count:4,dropoutFunc:this.dropoutFunc}));const a=this.dropoutMask,i=this.recurrentDropoutMask;let o,l,u,c;0{null!=this.cell.dropoutMask&&(ko(this.cell.dropoutMask),this.cell.dropoutMask=null),null!=this.cell.recurrentDropoutMask&&(ko(this.cell.recurrentDropoutMask),this.cell.recurrentDropoutMask=null);const n=null==t?null:t.mask,s=null==t?null:t.training,r=null==t?null:t.initialState;return super.call(e,{mask:n,training:s,initialState:r})}))}static fromConfig(e,t){return 0===t.implmentation&&(t.implementation=1),new e(t)}}OA.className="LSTM",Hl(OA);class RA extends SA{constructor(e){super(e),this.cells=e.cells}get stateSize(){const e=[];for(const t of this.cells.slice().reverse())Array.isArray(t.stateSize)?e.push(...t.stateSize):e.push(t.stateSize);return e}call(e,t){return Ao((()=>{let n=e.slice(1);const s=[];for(const e of this.cells.slice().reverse())Array.isArray(e.stateSize)?s.push(n.splice(0,e.stateSize.length)):s.push(n.splice(0,1));s.reverse();const r=[];let a;for(let i=0;i{Bb(`RNNCell_${s}`,(()=>{n.build(e),t=Array.isArray(n.stateSize)?n.stateSize[0]:n.stateSize,e=[e[0],t]}))})),this.built=!0}getConfig(){const e=super.getConfig(),t={cells:this.cells.map((e=>({className:e.getClassName(),config:e.getConfig()})))};return Object.assign(Object.assign({},e),t)}static fromConfig(e,t,n={}){const s=[];for(const e of t.cells)s.push(Av(e,n));return new e({cells:s})}get trainableWeights(){if(!this.trainable)return[];const e=[];for(const t of this.cells)e.push(...t.trainableWeights);return e}get nonTrainableWeights(){const e=[];for(const t of this.cells)e.push(...t.nonTrainableWeights);if(!this.trainable){const t=[];for(const e of this.cells)t.push(...e.trainableWeights);return t.concat(e)}return e}getWeights(){const e=[];for(const t of this.cells)e.push(...t.weights);return Lw(e)}setWeights(e){const t=[];for(const n of this.cells){const s=n.weights.length,r=e.splice(s);for(let e=0;enull!=a?a(t(),n):ow(t(),n),o=()=>lw(i,t,s);if(!r||r<=1)return Co(o().clone());return Array(r).fill(void 0).map(o).map((e=>Co(e.clone())))}RA.className="StackedRNNCells",Hl(RA);var MA=function(e,t){var n={};for(var s in e)Object.prototype.hasOwnProperty.call(e,s)&&t.indexOf(s)<0&&(n[s]=e[s]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(s=Object.getOwnPropertySymbols(e);r{if(null!=this.cell.dropoutMask&&(ko(this.cell.dropoutMask),this.cell.dropoutMask=null),null!=this.cell.recurrentDropoutMask&&(ko(this.cell.recurrentDropoutMask),this.cell.recurrentDropoutMask=null),t&&t.constants)throw new Qy("ConvRNN2D cell does not support constants");const n=null==t?null:t.mask,s=null==t?null:t.training,r=null==t?null:t.initialState;return super.call(e,{mask:n,training:s,initialState:r})}))}computeOutputShape(e){let t=this.computeSingleOutputShape(e);return this.returnSequences||(t=[t[0],...t.slice(2)]),this.returnState&&(t=[t,...Array(2).fill([e[0],...t.slice(-3)])]),t}getInitialState(e){return Ao((()=>{const{stateSize:t}=this.cell,n=e.shape,s=this.computeSingleOutputShape(n),r=wd([s[0],...s.slice(2)]);return Array.isArray(t)?Array(t.length).fill(r):[r]}))}resetStates(e,t=!1){Ao((()=>{if(!this.stateful)throw new Zy("Cannot call resetStates() on an RNN Layer that is not stateful.");const n=this.inputSpec[0].shape,s=this.computeSingleOutputShape(n),r=[s[0],...s.slice(2)];if(null==n[0])throw new Qy("If an RNN is stateful, it needs to know its batch size. Specify the batch size of your input tensors: \n- If using a Sequential model, specify the batch size by passing a `batchInputShape` option to your first layer.\n- If using the functional API, specify the batch size by passing a `batchShape` option to your Input layer.");if(null==this.getStates())Array.isArray(this.cell.stateSize)?this.states_=this.cell.stateSize.map((()=>wd(r))):this.states_=[wd(r)];else if(null==e)ko(this.states_),null!=this.keptStates&&(ko(this.keptStates),this.keptStates=[]),Array.isArray(this.cell.stateSize)?this.states_=this.cell.stateSize.map((()=>wd(r))):this.states_[0]=wd(r);else{if(Array.isArray(e)||(e=[e]),e.length!==this.states_.length)throw new Qy(`Layer ${this.name} expects ${this.states_.length} state(s), but it received ${e.length} state value(s). Input received: ${e}`);t?this.keptStates.push(this.states_.slice()):ko(this.states_);for(let t=0;tCo(e.clone())))}))}computeSingleOutputShape(e){const{dataFormat:t,filters:n,kernelSize:s,padding:r,strides:a,dilationRate:i}=this.cell,o="channelsFirst"===t,l=e[o?3:2],u=e[o?4:3],c=sA(l,s[0],r,a[0],i[0]),h=sA(u,s[1],r,a[1],i[1]);return[...e.slice(0,2),...o?[n,c,h]:[c,h,n]]}}FA.className="ConvRNN2D";class BA extends NA{constructor(e){const{filters:t,kernelSize:n,strides:s,padding:r,dataFormat:a,dilationRate:i}=e;super(Object.assign(Object.assign({},e),{units:t})),this.filters=t,bb(this.filters,"filters"),this.kernelSize=nA(n,2,"kernelSize"),this.kernelSize.forEach((e=>bb(e,"kernelSize"))),this.strides=nA(s||1,2,"strides"),this.strides.forEach((e=>bb(e,"strides"))),this.padding=r||"valid",Rb(this.padding),this.dataFormat=a||"channelsLast",Ob(this.dataFormat),this.dilationRate=nA(i||1,2,"dilationRate"),this.dilationRate.forEach((e=>bb(e,"dilationRate")))}build(e){var t;e=Mw(e);const n="channelsFirst"===this.dataFormat?1:e.length-1;if(null==e[n])throw new Qy(`The channel dimension of the input should be defined. Found ${e[n]}`);const s=e[n],r=this.kernelSize.concat([s,4*this.filters]);this.kernel=this.addWeight("kernel",r,null,this.kernelInitializer,this.kernelRegularizer,!0,this.kernelConstraint);const a=this.kernelSize.concat([this.filters,4*this.filters]);if(this.recurrentKernel=this.addWeight("recurrent_kernel",a,null,this.recurrentInitializer,this.recurrentRegularizer,!0,this.recurrentConstraint),this.useBias){let e;if(this.unitForgetBias){const n=this.biasInitializer,s=this.filters;e=new((t=class extends hw{apply(e,t){return Qb([n.apply([s]),vd([s]),n.apply([2*s])])}}).className="CustomInit",t)}else e=this.biasInitializer;this.bias=this.addWeight("bias",[4*this.filters],null,e,this.biasRegularizer,!0,this.biasConstraint)}this.built=!0}call(e,t){return Ao((()=>{if(3!==e.length)throw new Qy(`ConvLSTM2DCell expects 3 input Tensors (inputs, h, c), got ${e.length}.`);const n=t.training||!1,s=e[0],r=e[1],a=e[2];0Nd(s),rate:this.dropout,training:n,count:4,dropoutFunc:this.dropoutFunc}));const i=this.dropoutMask,o=(e,t,n)=>t&&t[n]?Bl(t[n],e):e;let l=o(s,i,0),u=o(s,i,1),c=o(s,i,2),h=o(s,i,3);0Nd(r),rate:this.recurrentDropout,training:n,count:4,dropoutFunc:this.dropoutFunc}));const d=this.recurrentDropoutMask;let p=o(r,d,0),f=o(r,d,1),m=o(r,d,2),g=o(r,d,3);const[y,b,w,v]=Ep(this.kernel.read(),4,3),[x,A,k,C]=this.useBias?Ep(this.bias.read(),4):[null,null,null,null];l=this.inputConv(l,y,x,this.padding),u=this.inputConv(u,b,A,this.padding),c=this.inputConv(c,w,k,this.padding),h=this.inputConv(h,v,C,this.padding);const[S,E,_,I]=Ep(this.recurrentKernel.read(),4,3);p=this.recurrentConv(p,S),f=this.recurrentConv(f,E),m=this.recurrentConv(m,_),g=this.recurrentConv(g,I);const T=this.recurrentActivation.apply(Dl(l,p)),N=this.recurrentActivation.apply(Dl(u,f)),O=Dl(Bl(N,a),Bl(T,this.activation.apply(Dl(c,m)))),R=Bl(this.recurrentActivation.apply(Dl(h,g)),this.activation.apply(O));return[R,R,O]}))}getConfig(){const e=super.getConfig(),{units:t}=e,n=MA(e,["units"]),s={filters:this.filters,kernelSize:this.kernelSize,padding:this.padding,dataFormat:this.dataFormat,dilationRate:this.dilationRate,strides:this.strides};return Object.assign(Object.assign({},n),s)}inputConv(e,t,n,s){const r=Jc(e,t,this.strides,s||"valid","channelsFirst"===this.dataFormat?"NCHW":"NHWC",this.dilationRate);return n?iw(r,n,this.dataFormat):r}recurrentConv(e,t){return Jc(e,t,1,"same","channelsFirst"===this.dataFormat?"NCHW":"NHWC")}}BA.className="ConvLSTM2DCell",Hl(BA);class zA extends FA{constructor(e){const t=new BA(e);super(Object.assign(Object.assign({},e),{cell:t}))}static fromConfig(e,t){return new e(t)}}zA.className="ConvLSTM2D",Hl(zA);class LA extends jw{constructor(e){super(e),this.rate=Math.max(Math.min(e.rate,1),0),this.noiseShape=e.noiseShape,this.seed=e.seed,this.supportsMasking=!0}getNoiseShape(e){if(null==this.noiseShape)return this.noiseShape;const t=e.shape,n=[];for(let e=0;e{this.invokeCallHook(e,t);const n=Dw(e);if(0ow(n,this.rate,s,this.seed)),(()=>n),e)}return e}))}getConfig(){const e={rate:this.rate,noiseShape:this.noiseShape,seed:this.seed},t=super.getConfig();return Object.assign(e,t),e}dispose(){return super.dispose()}}LA.className="Dropout",Hl(LA);class PA extends LA{constructor(e){super(e),this.inputSpec=[{ndim:3}]}getNoiseShape(e){const t=e.shape;return[t[0],1,t[2]]}}PA.className="SpatialDropout1D",Hl(PA);class VA extends jw{constructor(e){if(super(e),this.activation=null,this.useBias=!0,this.kernel=null,this.bias=null,this.DEFAULT_KERNEL_INITIALIZER="glorotNormal",this.DEFAULT_BIAS_INITIALIZER="zeros",null==e.batchInputShape&&null==e.inputShape&&null!=e.inputDim){let t=null;null!=e.batchSize&&(t=e.batchSize),this.batchInputShape=[t,e.inputDim]}this.units=e.units,bb(this.units,"units"),this.activation=Ux(e.activation),null!=e.useBias&&(this.useBias=e.useBias),this.kernelInitializer=Nw(e.kernelInitializer||this.DEFAULT_KERNEL_INITIALIZER),this.biasInitializer=Nw(e.biasInitializer||this.DEFAULT_BIAS_INITIALIZER),this.kernelConstraint=cv(e.kernelConstraint),this.biasConstraint=cv(e.biasConstraint),this.kernelRegularizer=Xx(e.kernelRegularizer),this.biasRegularizer=Xx(e.biasRegularizer),this.activityRegularizer=Xx(e.activityRegularizer),this.supportsMasking=!0,this.inputSpec=[{minNDim:2}]}build(e){const t=(e=Mw(e))[e.length-1];null==this.kernel&&(this.kernel=this.addWeight("kernel",[t,this.units],null,this.kernelInitializer,this.kernelRegularizer,!0,this.kernelConstraint),this.useBias&&(this.bias=this.addWeight("bias",[this.units],null,this.biasInitializer,this.biasRegularizer,!0,this.biasConstraint))),this.inputSpec=[{minNDim:2,axes:{[-1]:t}}],this.built=!0}computeOutputShape(e){const t=(e=Mw(e)).slice();return t[t.length-1]=this.units,t}call(e,t){return Ao((()=>{this.invokeCallHook(e,t);const n=Dw(e),s=vb(this.activation.getClassName());let r;return null!=s?r=nw(n,this.kernel.read(),s,this.bias?this.bias.read():null):(r=nw(n,this.kernel.read()),null!=this.bias&&(r=iw(r,this.bias.read())),null!=this.activation&&(r=this.activation.apply(r))),r}))}getConfig(){const e={units:this.units,activation:Vx(this.activation),useBias:this.useBias,kernelInitializer:Tw(this.kernelInitializer),biasInitializer:Tw(this.biasInitializer),kernelRegularizer:$x(this.kernelRegularizer),biasRegularizer:$x(this.biasRegularizer),activityRegularizer:$x(this.activityRegularizer),kernelConstraint:lv(this.kernelConstraint),biasConstraint:lv(this.biasConstraint)},t=super.getConfig();return Object.assign(e,t),e}}VA.className="Dense",Hl(VA);class WA extends jw{constructor(e){super(e=e||{}),this.inputSpec=[{minNDim:3}],this.dataFormat=e.dataFormat}computeOutputShape(e){e=Mw(e);for(const t of e.slice(1))if(null==t)throw new Qy(`The shape of the input to "Flatten" is not fully defined (got ${e.slice(1)}). Make sure to pass a complete "input_shape" or "batch_input_shape" argument to the first layer in your model.`);return[e[0],Wb(e,1)]}call(e,t){return Ao((()=>{this.invokeCallHook(e,t);let n=Dw(e);if("channelsFirst"===this.dataFormat&&n.rank>1){const e=[0];for(let t=2;t{this.invokeCallHook(e,t);const n=Dw(e);return this.activation.apply(n)}))}getConfig(){const e={activation:Vx(this.activation)},t=super.getConfig();return Object.assign(e,t),e}}UA.className="Activation",Hl(UA);class GA extends jw{constructor(e){super(e),this.n=e.n,this.inputSpec=[{ndim:2}]}computeOutputShape(e){return[e[0],this.n,e[1]]}call(e,t){return Ao((()=>{return e=Dw(e),t=e,n=this.n,Ao((()=>{if(2!==t.shape.length)throw new Qy(`repeat() expects a rank-2 tensor, but received a rank-${t.shape.length} tensor.`);return ew(Kb(t,1),[1,n,1])}));var t,n}))}getConfig(){const e={n:this.n},t=super.getConfig();return Object.assign(e,t),e}}GA.className="RepeatVector",Hl(GA);class qA extends jw{constructor(e){super(e),this.targetShape=e.targetShape;for(let e=0;e{this.invokeCallHook(e,t);const n=Dw(e),s=n.shape,r=s.slice(0,1).concat(this.fixUnknownDimension(s.slice(1),this.targetShape));return Tc(n,r)}))}getConfig(){const e={targetShape:this.targetShape},t=super.getConfig();return Object.assign(e,t),e}}qA.className="Reshape",Hl(qA);class jA extends jw{constructor(e){if(super(e),null==e.dims)throw new Error("Required configuration field `dims` is missing during Permute constructor call.");if(!Array.isArray(e.dims))throw new Error(`Permute constructor requires \`dims\` to be an Array, but received ${e.dims} instead.`);const t=qb(1,e.dims.length+1);if(!Kt(e.dims.slice().sort(),t))throw new Error("Invalid permutation `dims`: "+JSON.stringify(e.dims)+" `dims` must contain consecutive integers starting from 1.");this.dims=e.dims,this.dimsIncludingBatch=[0].concat(this.dims),this.inputSpec=[new Vw({ndim:this.dims.length+1})]}computeOutputShape(e){const t=(e=Mw(e)).slice();return this.dims.forEach(((n,s)=>{t[s+1]=e[n]})),t}call(e,t){return Jp(Dw(e),this.dimsIncludingBatch)}getConfig(){const e={dims:this.dims},t=super.getConfig();return Object.assign(e,t),e}}jA.className="Permute",Hl(jA);class HA extends jw{constructor(e){super(null==e?{}:e),this.supportsMasking=!0,this.maskValue=null!=e?null==e.maskValue?0:e.maskValue:0}computeOutputShape(e){return e}getConfig(){const e=super.getConfig(),t={maskValue:this.maskValue};return Object.assign(t,e),t}computeMask(e,t){const n=Dw(e);return ic(Id(n,this.maskValue),-1)}call(e,t){return Ao((()=>{this.invokeCallHook(e,t);const n=Dw(e),s=ic(Id(n,this.maskValue),-1,!0);return Bl(n,Nl(s,n.dtype))}))}}HA.className="Masking",Hl(HA);class $A extends jw{constructor(e){if(super(e),this.embeddings=null,this.DEFAULT_EMBEDDINGS_INITIALIZER="randomUniform",null==e.batchInputShape&&null==e.inputShape){let t=null;null!=e.batchSize&&(t=e.batchSize),null==e.inputLength?this.batchInputShape=[t,null]:this.batchInputShape=[t].concat(ib(e.inputLength))}this.inputDim=e.inputDim,bb(this.inputDim,"inputDim"),this.outputDim=e.outputDim,bb(this.outputDim,"outputDim"),this.embeddingsInitializer=Nw(e.embeddingsInitializer||this.DEFAULT_EMBEDDINGS_INITIALIZER),this.embeddingsRegularizer=Xx(e.embeddingsRegularizer),this.activityRegularizer=Xx(e.activityRegularizer),this.embeddingsConstraint=cv(e.embeddingsConstraint),this.maskZero=e.maskZero,this.supportsMasking=e.maskZero,this.inputLength=e.inputLength}build(e){this.embeddings=this.addWeight("embeddings",[this.inputDim,this.outputDim],this.dtype,this.embeddingsInitializer,this.embeddingsRegularizer,!0,this.embeddingsConstraint),this.built=!0}warnOnIncompatibleInputShape(e){}computeMask(e,t){return Ao((()=>this.maskZero?(e=Dw(e),Id(e,Pl(e))):null))}computeOutputShape(e){if(e=Mw(e),null==this.inputLength)return[...e,this.outputDim];const t=ib(this.inputLength);if(t.length!==e.length-1)throw new Qy(`"inputLength" is ${this.inputLength}, but received input shape has shape ${e}`);{let n=0;for(let s=0;s{this.invokeCallHook(e,t);let n=Dw(e);"int32"!==n.dtype&&(n=$b(n,"int32"));const s=sw(this.embeddings.read(),Tc(n,[n.size]));return Tc(s,Mw(this.computeOutputShape(n.shape)))}))}getConfig(){const e={inputDim:this.inputDim,outputDim:this.outputDim,embeddingsInitializer:Tw(this.embeddingsInitializer),embeddingsRegularizer:$x(this.embeddingsRegularizer),activityRegularizer:$x(this.activityRegularizer),embeddingsConstraint:lv(this.embeddingsConstraint),maskZero:this.maskZero,inputLength:this.inputLength},t=super.getConfig();return Object.assign(e,t),e}}$A.className="Embedding",Hl($A);class KA extends jw{constructor(e){super(e||{}),this.supportsMasking=!0}mergeFunction(e){throw new Jy}computeElementwiseOpOutputShape(e,t){if(null==e||null==t)return null;if(e.length1)throw new Qy(`Can not merge tensors with different batch sizes. Got tensors with shapes: ${JSON.stringify(e)}.`);let n=null==e[0]?null:e[0].slice(1);for(let t=1;te.length));-1===e.indexOf(null)&&1===fb(s).length?this.reshapeRequired=!1:this.reshapeRequired=!0}call(e,t){return Ao((()=>{if(this.reshapeRequired){const t=[],n=e.map((e=>e.rank));if(-1===n.indexOf(null)){const s=Gb(n);for(let n of e){const e=n.rank;for(let t=0;t1){const r=qb(1,e).concat([0]);t.push(Jp(s,r)),n=!0}else t.push(s)}let s=this.mergeFunction(t);const r=s.rank;if(n)if(null==r){const e=s.shape,t=e[e.length-1],n=[t].concat(e.slice(0,e.length-1));s=Tc(Jp(Tc(s,[-1,t]),[1,0]),n)}else if(r>1){const e=[r-1].concat(qb(0,r-1));s=Jp(s,e)}return s}}return this.mergeFunction(e)}))}computeOutputShape(e){let t;t=null==e[0]?null:e[0].slice(1);for(let n=1;n{if(null==t)return null;if(!Array.isArray(t))throw new Qy("`mask` should be an Array");if(!Array.isArray(e))throw new Qy("`inputs` should be an Array");if(t.length!==e.length)throw new Qy(`The Array 'inputs' and 'mask' are expected to have the same length, but have different lengths (${e.length} vs ${t.length})`);if(t.every((e=>null==e)))return null;let n=(t=t.map((e=>null==e?e:Lh(e,0))))[0];for(let e=1;e{let t=e[0].clone();for(let n=1;n{let t=e[0].clone();for(let n=1;n{let t=e[0].clone();for(let n=1;n{let t=e[0];for(let n=1;n{let t=e[0];for(let n=1;n1)throw new Qy("A `Concatenate` layer requires inputs with matching shapes except for the concat axis. Got input shapes: "+JSON.stringify(e))}mergeFunction(e){return Ao((()=>Qb(e,this.axis)))}computeOutputShape(e){if(!Array.isArray(e)||!Array.isArray(e[0]))throw new Qy("A `Concatenate` layer should be called on a list of inputs.");const t=e,n=t[0].slice(),s=this.axis<0?n.length+this.axis:this.axis;for(const e of t.slice(1)){if(null==n[s]||null==e[s]){n[s]=null;break}n[s]+=e[s]}return n}computeMask(e,t){if(null==t)return null;if(!Array.isArray(t))throw new Qy("`mask` should be an array for Concatenate");if(!Array.isArray(e))throw new Qy("`inputs` should be an array for Concatenate");if(t.length!==e.length)throw new Qy(`Mismatch in the length of mask (${t.length}) and the legnth of inputs (${e.length})`);return Ao((()=>{let n=!0;if(t.forEach((e=>{null==e||(n=!1)})),n)return null;const s=[];for(let n=0;n"A `Dot` layer should be called on a list of exactly 2 inputs."));const t=e[0],n=e[1];if(t.length>3||n.length>3)throw new Jy("Dot layer does not support tensors of 4D or higher rank yet.");const s=this.interpretAxes(t,n);if(t[s[0]]!==n[s[1]])throw new Qy(`Dimension incompatibility: ${t[s[0]]} !== ${n[s[1]]}`)}mergeFunction(e){if(2!==e.length)throw new Qy(`A \`Dot\` layer must be called on exactly 2 inputs, but received ${e.length} input(s).`);let t,n=e[0],s=e[1];return t=Array.isArray(this.axes)?this.axes.map(((t,n)=>tk(t,e[n].shape.length))):[tk(this.axes,n.shape.length),tk(this.axes,s.shape.length)],this.normalize&&(n=kv(n,t[0]),s=kv(s,t[1])),function(e,t,n){if(e.shape.length>3||t.shape.length>3)throw new Jy("batchDot is not implemented for tensors of 4D or higher rank yet");if(qt(e.shape.length>=2,(()=>`batchDot requires the rank of x to be >= 2, but got ${e.shape.length}`)),qt(e.shape.length>=2,(()=>`batchDot requires the rank of y to be >= 2, but got ${t.shape.length}`)),"number"==typeof n&&(n=[n,n]),"complex64"===e.dtype||"complex64"===t.dtype)throw new Jy("batchDot is not implemented for complex64-type Tensors yet.");const s=e.shape.length,r=t.shape.length;null==n&&(n=[s-1,r-2]);const a=n;return Ao((()=>{let n,i;if(s>r){n=s-r;const e=[];for(let t=0;ts){n=r-s;const t=[];for(let e=0;e0){let e;e=s>r?s+r-3:s-1;const t=[];for(let s=e;s"A `Dot` layer should be called on a list of exactly 2 inputs."));const t=e[0].slice(),n=e[1].slice();if(t.length>3||n.length>3)throw new Jy("Dot layer does not support tensors of 4D or higher rank yet.");const s=this.interpretAxes(t,n);t.splice(s[0],1),n.splice(s[1],1),n.splice(0,1);const r=t.concat(n);return 1===r.length&&r.push(1),r}computeMask(e,t){return null}getConfig(){const e={axes:this.axes,normalize:this.normalize},t=super.getConfig();return Object.assign(e,t),e}}nk.className="Dot",Hl(nk);class sk extends jw{constructor(e){super(e),this.supportsMasking=!0,this.stddev=e.stddev}computeOutputShape(e){return e}getConfig(){const e=super.getConfig(),t={stddev:this.stddev};return Object.assign(t,e),t}call(e,t){return Ao((()=>{this.invokeCallHook(e,t);const n=Dw(e);return lw((()=>Dl(tw(n.shape,0,this.stddev),n)),(()=>n),t.training||!1)}))}}sk.className="GaussianNoise",Hl(sk);class rk extends jw{constructor(e){super(e),this.supportsMasking=!0,this.rate=e.rate}computeOutputShape(e){return e}getConfig(){const e=super.getConfig(),t={rate:this.rate};return Object.assign(t,e),t}call(e,t){return Ao((()=>{this.invokeCallHook(e,t);const n=Dw(e);if(this.rate>0&&this.rate<1){return lw((()=>{const e=Math.sqrt(this.rate/(1-this.rate));return Bl(n,tw(n.shape,1,e))}),(()=>n),t.training||!1)}return n}))}}rk.className="GaussianDropout",Hl(rk);class ak extends jw{constructor(e){super(e),this.supportsMasking=!0,this.rate=e.rate,this.noiseShape=e.noiseShape}_getNoiseShape(e){return this.noiseShape||Dw(e).shape}computeOutputShape(e){return e}getConfig(){const e=super.getConfig(),t={rate:this.rate};return Object.assign(t,e),t}call(e,t){return Ao((()=>{if(this.rate<1&&this.rate>0){const n=this._getNoiseShape(e),s=()=>{const t=Dw(e),s=-1.7580993408473766;let r=jh(Qd(n),this.rate);r=$b(r,"float32");const a=((1-this.rate)*(1+this.rate*s**2))**-.5,i=-a*s*this.rate,o=Dl(Bl(t,r),Bl(Dl(r,-1),s));return Dl(Bl(o,a),i)};return lw(s,(()=>Dw(e)),t.training||!1)}return e}))}}function ik(e,t,n,s,r,a=.001){let i;if(2===e.rank)i=Vc(e,t,n,s,r,a);else if(3===e.rank)i=Wc(e,t,n,s,r,a);else{if(4!==e.rank)throw new Jy(`batchNormalization is not implemented for array of rank ${e.rank} yet`);i=Uc(e,t,n,s,r,a)}return i}function ok(e,t,n,s,r=.001){return Kt(s.slice().sort(),qb(0,e.rank-1))?function(e,t,n,s,r=.001){return Ao((()=>{const a=Sd(e,s),i=a.mean,o=a.variance;return[ik(e,i,o,n,t,r),i,o]}))}(e,t,n,s,r):function(e,t,n,s,r=.001){return Ao((()=>{const a=Sd(e,s),i=a.mean,o=a.variance,l=[];for(const t of qb(0,e.rank))-1!==s.indexOf(t)?l.push(1):l.push(e.shape[t]);const u=Tc(i,l),c=Tc(o,l),h=null==t?null:Tc(t,l),d=null==n?null:Tc(n,l);return[ik(e,u,c,d,h,r),i,o]}))}(e,t,n,s,r)}ak.className="AlphaDropout",Hl(ak);class lk extends jw{constructor(e){null==e&&(e={}),super(e),this.supportsMasking=!0,this.axis=null==e.axis?-1:e.axis,this.momentum=null==e.momentum?.99:e.momentum,this.epsilon=null==e.epsilon?.001:e.epsilon,this.center=null==e.center||e.center,this.scale=null==e.scale||e.scale,this.betaInitializer=Nw(e.betaInitializer||"zeros"),this.gammaInitializer=Nw(e.gammaInitializer||"ones"),this.movingMeanInitializer=Nw(e.movingMeanInitializer||"zeros"),this.movingVarianceInitializer=Nw(e.movingVarianceInitializer||"ones"),this.betaConstraint=cv(e.betaConstraint),this.gammaConstraint=cv(e.gammaConstraint),this.betaRegularizer=Xx(e.betaRegularizer),this.gammaRegularizer=Xx(e.gammaRegularizer)}build(e){e=Mw(e);const t=this.axis>=0?this.axis:this.axis+e.length,n=e[t];if(null==n)throw new Qy(`Axis ${t} of input tensor should have a defined dimension but the layer received an input with shape ${JSON.stringify(e)}.`);this.inputSpec=[new Vw({ndim:e.length,axes:{[t]:n}})];const s=[n];this.scale&&(this.gamma=this.addWeight("gamma",s,null,this.gammaInitializer,this.gammaRegularizer,!0,this.gammaConstraint)),this.center&&(this.beta=this.addWeight("beta",s,null,this.betaInitializer,this.betaRegularizer,!0,this.betaConstraint)),this.movingMean=this.addWeight("moving_mean",s,null,this.movingMeanInitializer,null,!1),this.movingVariance=this.addWeight("moving_variance",s,null,this.movingVarianceInitializer,null,!1),this.built=!0}call(e,t){return Ao((()=>{const n=null!=t.training&&t.training,s=Dw(e),r=s.shape,a=r.length,i=qb(0,a),o=this.axis>=0?this.axis:this.axis+a;i.splice(o,1);const l=nb(1,a);l[o]=r[o];const u=i.slice();u.sort();const c=!Kt(u,qb(0,a).slice(0,a-1));if(!n)return(()=>{if(c){const e=Tc(this.movingMean.read(),l),t=Tc(this.movingVariance.read(),l),n=this.center?Tc(this.beta.read(),l):null,r=this.scale?Tc(this.gamma.read(),l):null;return ik(s,e,t,n,r,this.epsilon)}return ik(s,this.movingMean.read(),this.movingVariance.read(),null==this.beta?null:this.beta.read(),null==this.gamma?null:this.gamma.read(),this.epsilon)})();const[h,d,p]=ok(s,this.gamma.read(),this.beta.read(),i,this.epsilon),f=(e,t,n)=>{Ao((()=>{const s=1-n,r=e.read(),a=Bl(Ql(r,t),s);e.write(Ql(r,a))}))};return(()=>{f(this.movingMean,d,this.momentum),f(this.movingVariance,p,this.momentum)})(),h}))}getConfig(){const e={axis:this.axis,momentum:this.momentum,epsilon:this.epsilon,center:this.center,scale:this.scale,betaInitializer:Tw(this.betaInitializer),gammaInitializer:Tw(this.gammaInitializer),movingMeanInitializer:Tw(this.movingMeanInitializer),movingVarianceInitializer:Tw(this.movingVarianceInitializer),betaRegularizer:$x(this.betaRegularizer),gammaRegularizer:$x(this.gammaRegularizer),betaConstraint:lv(this.betaConstraint),gammaConstraint:lv(this.gammaConstraint)},t=super.getConfig();return Object.assign(e,t),e}}lk.className="BatchNormalization",Hl(lk);class uk extends jw{constructor(e){if(null==e&&(e={}),super(e),this.axis=null==e.axis?-1:e.axis,"number"==typeof this.axis){if(!Number.isInteger(this.axis))throw new Error(`Expected axis to be an integer, but received ${this.axis}`)}else{if(!Array.isArray(this.axis))throw new Error(`Expected axis to be an integer or an array of integers, but received ${JSON.stringify(this.axis)}`);for(const e of this.axis)if(!Number.isInteger(e))throw new Error(`Expected axis to be an array of integers, but received ${JSON.stringify(this.axis)}`)}this.epsilon=null==e.epsilon?.001:e.epsilon,this.center=null==e.center||e.center,this.scale=null==e.scale||e.scale,this.betaInitializer=Nw(e.betaInitializer||"zeros"),this.gammaInitializer=Nw(e.gammaInitializer||"ones"),this.betaRegularizer=Xx(e.betaRegularizer),this.gammaRegularizer=Xx(e.gammaRegularizer),this.supportsMasking=!0}build(e){const t=(e=Mw(e)).length;"number"==typeof this.axis&&(this.axis=[this.axis]);for(let e=0;e=t)throw new Error(`Invalid axis: ${e}`);if(this.axis.length!==fb(this.axis).length)throw new Error(`Found duplicate axes in: ${this.axis}`);const n=this.axis.map((t=>e[t])),s=!0;this.scale?this.gamma=this.addWeight("gamma",n,"float32",this.gammaInitializer,this.gammaRegularizer,s):this.gamma=null,this.center?this.beta=this.addWeight("beta",n,"float32",this.betaInitializer,this.betaRegularizer,s):this.beta=null,this.built=!0}call(e,t){const n=Dw(e),s=n.shape,r=s.length;return Ao((()=>{let{mean:e,variance:t}=Sd(n,this.axis,!0);const a=nb(1,r);for(const e of this.axis)a[e]=s[e];const i=e=>null!=e&&e.shape.length!==r?Tc(e,a):e;let o=this.scale?i(this.gamma.read()):null,l=this.center?i(this.beta.read()):null;const u=[],c=[];for(let e=0;e=0?e[2]+this.padding[0][0]+this.padding[0][1]:null,n=null!=e[3]&&e[3]>=0?e[3]+this.padding[1][0]+this.padding[1][1]:null,[e[0],e[1],t,n]):(t=null!=e[1]&&e[1]>=0?e[1]+this.padding[0][0]+this.padding[0][1]:null,n=null!=e[2]&&e[2]>=0?e[2]+this.padding[1][0]+this.padding[1][1]:null,[e[0],t,n,e[3]])}call(e,t){return Ao((()=>{return t=Dw(e),n=this.padding,s=this.dataFormat,Ao((()=>{if(4!==t.rank)throw new Qy(`temporalPadding expects input tensor to be 4-D, but received a ${t.rank}-D tensor.`);if(null==n&&(n=[[1,1],[1,1]]),2!==n.length||2!==n[0].length||2!==n[1].length)throw new Qy("spatial2dPadding expects `padding` to be an Array of two Arrays, each of which is an Array of two integers.");if(null==s&&(s="channelsLast"),"channelsLast"!==s&&"channelsFirst"!==s)throw new Qy(`Unknown data format: ${s}. Supported data formats are 'channelsLast' and 'channelsFirst.`);let e;return e="channelsFirst"===s?[[0,0],[0,0],n[0],n[1]]:[[0,0],n[0],n[1],[0,0]],Rd(t,e)}));var t,n,s}))}getConfig(){const e={padding:this.padding,dataFormat:this.dataFormat},t=super.getConfig();return Object.assign(e,t),e}}function hk(e,t,n,s,r,a){return Ao((()=>{let i;Ob(r),Db(a),Rb(s),null==n&&(n=[1,1]),null==s&&(s="valid"),null==r&&(r="channelsLast"),null==a&&(a="max"),e=aA(e,r);const o="same"===s?"same":"valid";return i="max"===a?md(e,t,n,o):Nc(e,t,n,o),"channelsFirst"===r&&(i=Jp(i,[0,3,1,2])),i}))}function dk(e,t,n,s,r,a){return Ao((()=>{let i;Ob(r),Db(a),Rb(s),null==n&&(n=[1,1,1]),null==s&&(s="valid"),null==r&&(r="channelsLast"),null==a&&(a="max"),e=iA(e,r);const o="same"===s?"same":"valid";return i="max"===a?gd(e,t,n,o):Oc(e,t,n,o),"channelsFirst"===r&&(i=Jp(i,[0,4,1,2,3])),i}))}ck.className="ZeroPadding2D",Hl(ck);class pk extends jw{constructor(e){if(null==e.poolSize&&(e.poolSize=2),super(e),"number"==typeof e.poolSize)this.poolSize=[e.poolSize];else{if(!Array.isArray(e.poolSize)||1!==e.poolSize.length||"number"!=typeof e.poolSize[0])throw new Qy(`poolSize for 1D convolutional layer must be a number or an Array of a single number, but received ${JSON.stringify(e.poolSize)}`);this.poolSize=e.poolSize}if(bb(this.poolSize,"poolSize"),null==e.strides)this.strides=this.poolSize;else if("number"==typeof e.strides)this.strides=[e.strides];else{if(!Array.isArray(e.strides)||1!==e.strides.length||"number"!=typeof e.strides[0])throw new Qy(`strides for 1D convolutional layer must be a number or an Array of a single number, but received ${JSON.stringify(e.strides)}`);this.strides=e.strides}bb(this.strides,"strides"),this.padding=null==e.padding?"valid":e.padding,Rb(this.padding),this.inputSpec=[new Vw({ndim:3})]}computeOutputShape(e){const t=sA((e=Mw(e))[1],this.poolSize[0],this.padding,this.strides[0]);return[e[0],t,e[2]]}call(e,t){return Ao((()=>{this.invokeCallHook(e,t),e=Kb(Dw(e),2);const n=this.poolingFunction(Dw(e),[this.poolSize[0],1],[this.strides[0],1],this.padding,"channelsLast");return Tp(n,[2])}))}getConfig(){const e={poolSize:this.poolSize,padding:this.padding,strides:this.strides},t=super.getConfig();return Object.assign(e,t),e}}class fk extends pk{constructor(e){super(e)}poolingFunction(e,t,n,s,r){return Ob(r),Rb(s),hk(e,t,n,s,r,"max")}}fk.className="MaxPooling1D",Hl(fk);class mk extends pk{constructor(e){super(e)}poolingFunction(e,t,n,s,r){return Ob(r),Rb(s),hk(e,t,n,s,r,"avg")}}mk.className="AveragePooling1D",Hl(mk);class gk extends jw{constructor(e){if(null==e.poolSize&&(e.poolSize=[2,2]),super(e),this.poolSize=Array.isArray(e.poolSize)?e.poolSize:[e.poolSize,e.poolSize],null==e.strides)this.strides=this.poolSize;else if(Array.isArray(e.strides)){if(2!==e.strides.length)throw new Qy(`If the strides property of a 2D pooling layer is an Array, it is expected to have a length of 2, but received length ${e.strides.length}.`);this.strides=e.strides}else this.strides=[e.strides,e.strides];bb(this.poolSize,"poolSize"),bb(this.strides,"strides"),this.padding=null==e.padding?"valid":e.padding,this.dataFormat=null==e.dataFormat?"channelsLast":e.dataFormat,Ob(this.dataFormat),Rb(this.padding),this.inputSpec=[new Vw({ndim:4})]}computeOutputShape(e){e=Mw(e);let t="channelsFirst"===this.dataFormat?e[2]:e[1],n="channelsFirst"===this.dataFormat?e[3]:e[2];return t=sA(t,this.poolSize[0],this.padding,this.strides[0]),n=sA(n,this.poolSize[1],this.padding,this.strides[1]),"channelsFirst"===this.dataFormat?[e[0],e[1],t,n]:[e[0],t,n,e[3]]}call(e,t){return Ao((()=>(this.invokeCallHook(e,t),this.poolingFunction(Dw(e),this.poolSize,this.strides,this.padding,this.dataFormat))))}getConfig(){const e={poolSize:this.poolSize,padding:this.padding,strides:this.strides,dataFormat:this.dataFormat},t=super.getConfig();return Object.assign(e,t),e}}class yk extends gk{constructor(e){super(e)}poolingFunction(e,t,n,s,r){return Ob(r),Rb(s),hk(e,t,n,s,r,"max")}}yk.className="MaxPooling2D",Hl(yk);class bk extends gk{constructor(e){super(e)}poolingFunction(e,t,n,s,r){return Ob(r),Rb(s),hk(e,t,n,s,r,"avg")}}bk.className="AveragePooling2D",Hl(bk);class wk extends jw{constructor(e){if(null==e.poolSize&&(e.poolSize=[2,2,2]),super(e),this.poolSize=Array.isArray(e.poolSize)?e.poolSize:[e.poolSize,e.poolSize,e.poolSize],null==e.strides)this.strides=this.poolSize;else if(Array.isArray(e.strides)){if(3!==e.strides.length)throw new Qy(`If the strides property of a 3D pooling layer is an Array, it is expected to have a length of 3, but received length ${e.strides.length}.`);this.strides=e.strides}else this.strides=[e.strides,e.strides,e.strides];bb(this.poolSize,"poolSize"),bb(this.strides,"strides"),this.padding=null==e.padding?"valid":e.padding,this.dataFormat=null==e.dataFormat?"channelsLast":e.dataFormat,Ob(this.dataFormat),Rb(this.padding),this.inputSpec=[new Vw({ndim:5})]}computeOutputShape(e){e=Mw(e);let t="channelsFirst"===this.dataFormat?e[2]:e[1],n="channelsFirst"===this.dataFormat?e[3]:e[2],s="channelsFirst"===this.dataFormat?e[4]:e[3];return t=sA(t,this.poolSize[0],this.padding,this.strides[0]),n=sA(n,this.poolSize[1],this.padding,this.strides[1]),s=sA(s,this.poolSize[2],this.padding,this.strides[2]),"channelsFirst"===this.dataFormat?[e[0],e[1],t,n,s]:[e[0],t,n,s,e[4]]}call(e,t){return Ao((()=>(this.invokeCallHook(e,t),this.poolingFunction(Dw(e),this.poolSize,this.strides,this.padding,this.dataFormat))))}getConfig(){const e={poolSize:this.poolSize,padding:this.padding,strides:this.strides,dataFormat:this.dataFormat},t=super.getConfig();return Object.assign(e,t),e}}class vk extends wk{constructor(e){super(e)}poolingFunction(e,t,n,s,r){return Ob(r),Rb(s),dk(e,t,n,s,r,"max")}}vk.className="MaxPooling3D",Hl(vk);class xk extends wk{constructor(e){super(e)}poolingFunction(e,t,n,s,r){return Ob(r),Rb(s),dk(e,t,n,s,r,"avg")}}xk.className="AveragePooling3D",Hl(xk);class Ak extends jw{constructor(e){super(e),this.inputSpec=[new Vw({ndim:3})]}computeOutputShape(e){return[e[0],e[2]]}call(e,t){throw new Jy}}class kk extends Ak{constructor(e){super(e||{})}call(e,t){return Ao((()=>{const t=Dw(e);return bd(t,1)}))}}kk.className="GlobalAveragePooling1D",Hl(kk);class Ck extends Ak{constructor(e){super(e||{})}call(e,t){return Ao((()=>{const t=Dw(e);return Oh(t,1)}))}}Ck.className="GlobalMaxPooling1D",Hl(Ck);class Sk extends jw{constructor(e){super(e),this.dataFormat=null==e.dataFormat?"channelsLast":e.dataFormat,Ob(this.dataFormat),this.inputSpec=[new Vw({ndim:4})]}computeOutputShape(e){return"channelsLast"===this.dataFormat?[e[0],e[3]]:[e[0],e[1]]}call(e,t){throw new Jy}getConfig(){const e={dataFormat:this.dataFormat},t=super.getConfig();return Object.assign(e,t),e}}class Ek extends Sk{call(e,t){return Ao((()=>{const t=Dw(e);return"channelsLast"===this.dataFormat?bd(t,[1,2]):bd(t,[2,3])}))}}Ek.className="GlobalAveragePooling2D",Hl(Ek);class _k extends Sk{call(e,t){return Ao((()=>{const t=Dw(e);return"channelsLast"===this.dataFormat?Oh(t,[1,2]):Oh(t,[2,3])}))}}_k.className="GlobalMaxPooling2D",Hl(_k);class Ik extends jw{constructor(e){super(e),this.layer=e.layer}build(e){this.built=!0}get trainable(){return null!=this.layer&&this.layer.trainable}set trainable(e){null!=this.layer&&(this.layer.trainable=e)}get trainableWeights(){return this.layer.trainableWeights}get nonTrainableWeights(){return this.layer.nonTrainableWeights}get updates(){return this.layer._updates}get losses(){return this.layer.losses}getWeights(){return this.layer.getWeights()}setWeights(e){this.layer.setWeights(e)}getConfig(){const e={layer:{className:this.layer.getClassName(),config:this.layer.getConfig()}},t=super.getConfig();return Object.assign(e,t),e}setFastWeightInitDuringBuild(e){super.setFastWeightInitDuringBuild(e),null!=this.layer&&this.layer.setFastWeightInitDuringBuild(e)}static fromConfig(e,t,n={}){const s=Av(t.layer,n);delete t.layer;const r={layer:s};return Object.assign(r,t),new e(r)}}class Tk extends Ik{constructor(e){super(e),this.supportsMasking=!0}build(e){if((e=Mw(e)).length<3)throw new Qy(`TimeDistributed layer expects an input shape >= 3D, but received input shape ${JSON.stringify(e)}`);this.inputSpec=[{shape:e}];const t=[e[0]].concat(e.slice(2));this.layer.built||(this.layer.build(t),this.layer.built=!0),super.build(e)}computeOutputShape(e){const t=[(e=Mw(e))[0]].concat(e.slice(2)),n=this.layer.computeOutputShape(t),s=e[1];return[n[0],s].concat(n.slice(1))}call(e,t){return Ao((()=>kA(((e,n)=>[Dw(this.layer.call(e,t)),[]]),e=Dw(e),[],!1,null,null,!1,!0)[1]))}}Tk.className="TimeDistributed",Hl(Tk);class Nk extends Ik{constructor(e){super(e);const t=e.layer.getConfig(),n={};n.className=e.layer.getClassName(),n.config=t,this.forwardLayer=Av(n),t.goBackwards=!0!==t.goBackwards;const s={};var r;if(s.className=e.layer.getClassName(),s.config=t,this.backwardLayer=Av(s),this.forwardLayer.name="forward_"+this.forwardLayer.name,this.backwardLayer.name="backward_"+this.backwardLayer.name,this.mergeMode=void 0===e.mergeMode?"concat":e.mergeMode,r=this.mergeMode,gb(Tb,"BidirectionalMergeMode",r),e.weights)throw new Jy("weights support is not implemented for Bidirectional layer yet.");this._stateful=e.layer.stateful,this.returnSequences=e.layer.returnSequences,this.returnState=e.layer.returnState,this.supportsMasking=!0,this._trainable=!0,this.inputSpec=e.layer.inputSpec,this.numConstants=null}get trainable(){return this._trainable}set trainable(e){this._trainable=e,null!=this.forwardLayer&&(this.forwardLayer.trainable=e),null!=this.backwardLayer&&(this.backwardLayer.trainable=e)}getWeights(){return this.forwardLayer.getWeights().concat(this.backwardLayer.getWeights())}setWeights(e){const t=e.length,n=Math.floor(t/2);this.forwardLayer.setWeights(e.slice(0,n)),this.backwardLayer.setWeights(e.slice(n))}computeOutputShape(e){let t,n,s,r=this.forwardLayer.computeOutputShape(e);return Array.isArray(r)&&Array.isArray(r[0])||(r=[r]),this.returnState?(s=r.slice(1),t=r[0]):t=r[0],"concat"===this.mergeMode?(t[t.length-1]*=2,n=[t]):n=null==this.mergeMode?[t,t.slice()]:[t],this.returnState?null==this.mergeMode?n.concat(s).concat(s.slice()):[t].concat(s).concat(s.slice()):ab(n)}apply(e,t){let n=null==t?null:t.initialState,s=null==t?null:t.constants;null==t&&(t={});const r=AA(e,n,s,this.numConstants);if(e=r.inputs,n=r.initialState,s=r.constants,Array.isArray(e)&&(n=e.slice(1),e=e[0]),(null==n||0===n.length)&&null==s)return super.apply(e,t);const a=[],i=[];if(null!=n){const e=n.length;if(e%2>0)throw new Qy("When passing `initialState` to a Bidrectional RNN, the state should be an Array containing the states of the underlying RNNs.");t.initialState=n,a.push(...n);const s=n.map((e=>new Vw({shape:e.shape})));this.forwardLayer.stateSpec=s.slice(0,e/2),this.backwardLayer.stateSpec=s.slice(e/2),i.push(...s)}if(null!=s)throw new Jy("Support for constants in Bidirectional layers is not implemented yet.");const o=a[0]instanceof Ww;for(const e of a)if(e instanceof Ww!==o)throw new Qy("The initial state of a Bidirectional layer cannot be specified as a mix of symbolic and non-symbolic tensors");if(o){const n=[e].concat(a),s=this.inputSpec.concat(i),r=this.inputSpec;this.inputSpec=s;const o=super.apply(n,t);return this.inputSpec=r,o}return super.apply(e,t)}call(e,t){return Ao((()=>{const n=t.initialState;let s,r,a,i;if(null==n)s=this.forwardLayer.call(e,t),r=this.backwardLayer.call(e,t);else{const a=n.slice(0,n.length/2),i=n.slice(n.length/2);s=this.forwardLayer.call(e,Object.assign(t,{initialState:a})),r=this.backwardLayer.call(e,Object.assign(t,{initialState:i}))}return this.returnState&&(Array.isArray(s)&&(a=s.slice(1).concat(r.slice(1))),s=s[0],r=r[0]),this.returnSequences&&(r=ap(r,1)),"concat"===this.mergeMode?i=Qb([s,r]):"sum"===this.mergeMode?i=Dl(s,r):"ave"===this.mergeMode?i=Bl(.5,Dl(s,r)):"mul"===this.mergeMode?i=Bl(s,r):null==this.mergeMode&&(i=[s,r]),this.returnState?null==this.mergeMode?i.concat(a):[i].concat(a):i}))}resetStates(e){this.forwardLayer.resetStates(),this.backwardLayer.resetStates()}build(e){Bb(this.forwardLayer.name,(()=>{this.forwardLayer.build(e)})),Bb(this.backwardLayer.name,(()=>{this.backwardLayer.build(e)})),this.built=!0}computeMask(e,t){let n;if(Array.isArray(t)&&(t=t[0]),n=this.returnSequences?null==this.mergeMode?[t,t]:t:null==this.mergeMode?[null,null]:null,this.returnState){const e=this.forwardLayer.states.map((e=>null));return Array.isArray(n)?n.concat(e).concat(e):[n].concat(e).concat(e)}return n}get trainableWeights(){return this.forwardLayer.trainableWeights.concat(this.backwardLayer.trainableWeights)}get nonTrainableWeights(){return this.forwardLayer.nonTrainableWeights.concat(this.backwardLayer.nonTrainableWeights)}setFastWeightInitDuringBuild(e){super.setFastWeightInitDuringBuild(e),null!=this.forwardLayer&&this.forwardLayer.setFastWeightInitDuringBuild(e),null!=this.backwardLayer&&this.backwardLayer.setFastWeightInitDuringBuild(e)}getConfig(){const e={mergeMode:this.mergeMode},t=super.getConfig();return Object.assign(e,t),e}static fromConfig(e,t){const n=Av(t.layer);if(delete t.layer,null!=t.numConstants)throw new Jy("Deserialization of a Bidirectional layer with numConstants present is not supported yet.");const s=t;return s.layer=n,new e(s)}}Nk.className="Bidirectional",Hl(Nk);class Ok extends jw{constructor(e){super(e),this.scale=e.scale,e.offset?this.offset=e.offset:this.offset=0}getConfig(){const e={scale:this.scale,offset:this.offset},t=super.getConfig();return Object.assign(e,t),e}call(e,t){return Ao((()=>("float32"!==(e=Dw(e)).dtype&&(e=$b(e,"float32")),Dl(Bl(e,this.scale),this.offset))))}}Ok.className="Rescaling",Hl(Ok);const{resizeBilinear:Rk,cropAndResize:Dk}=bm;class Mk extends jw{constructor(e){super(e),this.height=e.height,this.width=e.width}centerCrop(e,t,n,s,r,a,i,o){return Ao((()=>{let l,u=!1;const c=[t/a,n/i,(s+t)/a,(r+n)/i],h=[];3===e.rank?(u=!0,l=Np([e])):l=e;for(let e=0;e$b(Rk(e,[t,n]),s)))}call(e,t){return Ao((()=>{const t=Dw(e),n=t.dtype,s=t.shape,r=s[s.length-3],a=s[s.length-2];let i=0;r!==this.height&&(i=Math.floor((r-this.height)/2));let o=0;return a!==this.width&&(o=Math.floor((a-this.width)/2),0===o&&(o=1)),i>=0&&o>=0?this.centerCrop(t,i,o,this.height,this.width,r,a,n):this.upsize(e,this.height,this.width,n)}))}getConfig(){const e={height:this.height,width:this.width},t=super.getConfig();return Object.assign(e,t),e}computeOutputShape(e){const t=(e=Mw(e)).length-3,n=e.length-2;return e[t]=this.height,e[n]=this.width,e}}Mk.className="CenterCrop",Hl(Mk);class Fk extends jw{constructor(e){super(e),this.numTokens=e.numTokens,e.outputMode?this.outputMode=e.outputMode:this.outputMode="multiHot"}getConfig(){const e={numTokens:this.numTokens,outputMode:this.outputMode},t=super.getConfig();return Object.assign(e,t),e}computeOutputShape(e){return null==(e=Mw(e))?[this.numTokens]:"oneHot"===this.outputMode&&1!==e[e.length-1]?(e.push(this.numTokens),e):(e[e.length-1]=this.numTokens,e)}call(e,t){return Ao((()=>{let n;if("int32"!==(e=Dw(e)).dtype&&(e=$b(e,"int32")),void 0!==t.countWeights){if("count"!==this.outputMode)throw new Qy(`countWeights is not used when outputMode !== count.\n Received countWeights=${t.countWeights}`);n=Dw(t.countWeights)}const s=Oh(e),r=Rh(e),a=qh(this.numTokens,s).bufferSync().get(0),i=jh(r,0).bufferSync().get(0);if(!a||!i)throw new Qy(`Input values must be between 0 < values <= numTokens with numTokens=${this.numTokens}`);return function(e,t,n,s){let r=Dw(e);if("int32"!==r.dtype&&(r=$b(r,"int32")),"int"===t)return r;const a=r.shape;if(0===r.rank&&(r=Lh(r,-1)),"oneHot"===t&&1!==r.shape[r.shape.length-1]&&(r=Lh(r,-1)),r.rank>2)throw new Qy(`When outputMode is not int, maximum output rank is 2 Received outputMode ${t} and input shape ${a} which would result in output rank ${r.rank}.`);const i=["multiHot","oneHot"].includes(t),o=r;let l;if(l=ch(o,void 0!==s&&"count"===t?s:[],n,i),"tfIdf"!==t)return l;if(s)return Bl(l,s);throw new Qy("When outputMode is 'tfIdf', weights must be provided.")}(e,this.outputMode,this.numTokens,n)}))}}Fk.className="CategoryEncoding",Hl(Fk);const Bk=new Set(["bilinear","nearest"]);class zk extends jw{constructor(e){if(super(e),this.height=e.height,this.width=e.width,e.interpolation){if(!Bk.has(e.interpolation))throw new Qy(`Invalid interpolation parameter: ${e.interpolation} is not implemented`);this.interpolation=e.interpolation}else this.interpolation="bilinear";this.cropToAspectRatio=Boolean(e.cropToAspectRatio)}computeOutputShape(e){const t=(e=Mw(e))[2];return[this.height,this.width,t]}getConfig(){const e={height:this.height,width:this.width,interpolation:this.interpolation,cropToAspectRatio:this.cropToAspectRatio},t=super.getConfig();return Object.assign(e,t),e}call(e,t){return Ao((()=>{const t=[this.height,this.width];if("bilinear"===this.interpolation)return bm.resizeBilinear(e,t,!this.cropToAspectRatio);if("nearest"===this.interpolation)return bm.resizeNearestNeighbor(e,t,!this.cropToAspectRatio);throw new Error(`Interpolation is ${this.interpolation} but only ${[...Bk]} are supported`)}))}}zk.className="Resizing",Hl(zk);class Lk{constructor(e){this.seed=e}next(){if(void 0!==this.seed)return this.seed++}}Lk.className="RandomSeed";class Pk extends jw{constructor(e){super(e),this.randomGenerator=new Lk(e.seed)}getConfig(){const e={seed:this.randomGenerator.seed},t=super.getConfig();return Object.assign(e,t),e}}Pk.className="BaseRandomLayer";const Vk=new Set(["bilinear","nearest"]);class Wk extends Pk{constructor(e){super(e);const{factor:t,interpolation:n="bilinear"}=e;if(this.factor=t,Array.isArray(this.factor)&&2===this.factor.length)this.widthLower=this.factor[0],this.widthUpper=this.factor[1];else{if(Array.isArray(this.factor)||!(this.factor>0))throw new Qy(`Invalid factor: ${this.factor}. Must be positive number or tuple of 2 numbers`);this.widthLower=-this.factor,this.widthUpper=this.factor}if(this.widthLower<-1||this.widthUpper<-1)throw new Qy(`factor must have values larger than -1. Got: ${this.factor}`);if(this.widthUpper{const t=Dw(e);this.imgHeight=t.shape[t.shape.length-3];const n=t.shape[t.shape.length-2];this.widthFactor=Qd([1],1+this.widthLower,1+this.widthUpper,"float32",this.randomGenerator.next());let s=this.widthFactor.dataSync()[0]*n;s=Math.round(s);const r=[this.imgHeight,s];switch(this.interpolation){case"bilinear":return bm.resizeBilinear(e,r);case"nearest":return bm.resizeNearestNeighbor(e,r);default:throw new Error(`Interpolation is ${this.interpolation}\n but only ${[...Vk]} are supported`)}}))}}Wk.className="RandomWidth",Hl(Wk);var Uk,Gk;Sn().registerFlag("KEEP_INTERMEDIATE_TENSORS",(()=>!1),(e=>{})),function(e){e[e.DT_INVALID=0]="DT_INVALID",e[e.DT_FLOAT=1]="DT_FLOAT",e[e.DT_DOUBLE=2]="DT_DOUBLE",e[e.DT_INT32=3]="DT_INT32",e[e.DT_UINT8=4]="DT_UINT8",e[e.DT_INT16=5]="DT_INT16",e[e.DT_INT8=6]="DT_INT8",e[e.DT_STRING=7]="DT_STRING",e[e.DT_COMPLEX64=8]="DT_COMPLEX64",e[e.DT_INT64=9]="DT_INT64",e[e.DT_BOOL=10]="DT_BOOL",e[e.DT_QINT8=11]="DT_QINT8",e[e.DT_QUINT8=12]="DT_QUINT8",e[e.DT_QINT32=13]="DT_QINT32",e[e.DT_BFLOAT16=14]="DT_BFLOAT16",e[e.DT_QINT16=15]="DT_QINT16",e[e.DT_QUINT16=16]="DT_QUINT16",e[e.DT_UINT16=17]="DT_UINT16",e[e.DT_COMPLEX128=18]="DT_COMPLEX128",e[e.DT_HALF=19]="DT_HALF",e[e.DT_RESOURCE=20]="DT_RESOURCE",e[e.DT_VARIANT=21]="DT_VARIANT",e[e.DT_UINT32=22]="DT_UINT32",e[e.DT_UINT64=23]="DT_UINT64",e[e.DT_FLOAT_REF=101]="DT_FLOAT_REF",e[e.DT_DOUBLE_REF=102]="DT_DOUBLE_REF",e[e.DT_INT32_REF=103]="DT_INT32_REF",e[e.DT_UINT8_REF=104]="DT_UINT8_REF",e[e.DT_INT16_REF=105]="DT_INT16_REF",e[e.DT_INT8_REF=106]="DT_INT8_REF",e[e.DT_STRING_REF=107]="DT_STRING_REF",e[e.DT_COMPLEX64_REF=108]="DT_COMPLEX64_REF",e[e.DT_INT64_REF=109]="DT_INT64_REF",e[e.DT_BOOL_REF=110]="DT_BOOL_REF",e[e.DT_QINT8_REF=111]="DT_QINT8_REF",e[e.DT_QUINT8_REF=112]="DT_QUINT8_REF",e[e.DT_QINT32_REF=113]="DT_QINT32_REF",e[e.DT_BFLOAT16_REF=114]="DT_BFLOAT16_REF",e[e.DT_QINT16_REF=115]="DT_QINT16_REF",e[e.DT_QUINT16_REF=116]="DT_QUINT16_REF",e[e.DT_UINT16_REF=117]="DT_UINT16_REF",e[e.DT_COMPLEX128_REF=118]="DT_COMPLEX128_REF",e[e.DT_HALF_REF=119]="DT_HALF_REF",e[e.DT_RESOURCE_REF=120]="DT_RESOURCE_REF",e[e.DT_VARIANT_REF=121]="DT_VARIANT_REF",e[e.DT_UINT32_REF=122]="DT_UINT32_REF",e[e.DT_UINT64_REF=123]="DT_UINT64_REF"}(Uk||(Uk={})),function(e){let t;!function(e){e[e.LEGACY=0]="LEGACY",e[e.V1=1]="V1",e[e.V2=2]="V2"}(t=e.CheckpointFormatVersion||(e.CheckpointFormatVersion={}))}(Gk||(Gk={}));const qk={};function jk(e){return qk[e]}function Hk(e,t,n,s,r){const a=t.inputParams[e];if(a&&void 0!==a.inputIndexStart){const e=a.inputIndexStart,i=0===a.inputIndexEnd?void 0:void 0===a.inputIndexEnd?e+1:a.inputIndexEnd,o=e<0?t.inputNames.length+e:e;if("tensor"===a.type)return $k(t.inputNames[o],n,s,r);if("tensors"===a.type){const a=t.inputs.slice(e,i);return t.inputNames.slice(e,i).filter(((e,t)=>{var n;return"NoOp"!==(null===(n=a[t])||void 0===n?void 0:n.op)})).map((e=>$k(e,n,s,r)))}const l=$k(t.inputNames[o],n,s,r),u=l.dataSync();return"number"===a.type?u[0]:fn(l.shape,u)}const i=t.attrParams[e];return i&&i.value}function $k(e,t,n,s){const[r,a]=Yk(e,n);if(null!=s){const e=s.getHashTableHandleByName(r);if(null!=e)return e}const i=n.currentContextIds.find((e=>!!t[Zk(r,e)]));return void 0!==i?t[Zk(r,i)][a]:void 0}function Kk(e,t,n){return t[Zk(e,n.currentContextId)]}function Xk(e,t){const[n,s,r]=Yk(e,t);return[Zk(n,t&&t.currentContextId),s,r]}function Zk(e,t){return t?`${e}-${t}`:e}function Yk(e,t){if(""===e)return["",0,void 0];const n=null!=t&&null!=t.parseNodeNameCache;if(n){const n=t.parseNodeNameCache.get(e);if(null!=n)return n}const s=e.split(":");let r;if(1===s.length)r=[e,0,void 0];else{const e=s[0],t=3===s.length?s[1]:void 0;r=[e,Number(s[s.length-1]),t]}return n&&t.parseNodeNameCache.set(e,r),r}function Qk(e,t,n){let s=Hk("pad",e,t,n);if("explicit"===s){s=Hk("explicitPaddings",e,t,n);const r=[[0,0],[0,0],[0,0],[0,0]];for(let e=0;e<4;e++)r[e][0]=s[2*e],r[e][1]=s[2*e+1];return r}return s}function Jk(e){return e.kept?e:Ol(e)}const eC=[{tfOpName:"Add",category:"arithmetic",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"AddV2",category:"arithmetic",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"AddN",category:"arithmetic",inputs:[{start:0,end:0,name:"tensors",type:"tensors"}]},{tfOpName:"BiasAdd",category:"arithmetic",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0},{tfName:"data_format",name:"dataFormat",type:"string",notSupported:!0}]},{tfOpName:"Sub",category:"arithmetic",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"RealDiv",category:"arithmetic",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Div",category:"arithmetic",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"DivNoNan",category:"arithmetic",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"FloorDiv",category:"arithmetic",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Mul",category:"arithmetic",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Maximum",category:"arithmetic",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Minimum",category:"arithmetic",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Pow",category:"arithmetic",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"SquaredDifference",category:"arithmetic",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Mod",category:"arithmetic",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"FloorMod",category:"arithmetic",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]}],tC=[{tfOpName:"Abs",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Acos",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Asin",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Atan",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Atan2",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"y",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Ceil",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"ClipByValue",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"clipValueMin",type:"number"},{start:2,name:"clipValueMax",type:"number"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Complex",category:"basic_math",inputs:[{start:0,name:"real",type:"tensor"},{start:1,name:"imag",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"ComplexAbs",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Cos",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Cosh",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Elu",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Exp",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Floor",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Log",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Imag",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0},{tfName:"Tout",name:"outputType",type:"dtype",notSupported:!0}]},{tfOpName:"Neg",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Real",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0},{tfName:"Tout",name:"outputType",type:"dtype",notSupported:!0}]},{tfOpName:"Prelu",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"alpha",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Relu",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Relu6",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Selu",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Sigmoid",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Sin",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Sinh",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Sqrt",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Rsqrt",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Square",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Tan",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Tanh",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Sign",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Round",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Expm1",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Log1p",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Reciprocal",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Softplus",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Asinh",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Acosh",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Atanh",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Erf",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"LeakyRelu",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"alpha",name:"alpha",type:"number",defaultValue:.2},{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"IsNan",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"IsFinite",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"IsInf",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]}],nC=[{tfOpName:"EmptyTensorList",category:"control",inputs:[{start:0,name:"elementShape",type:"shape"},{start:1,name:"maxNumElements",type:"number"}],attrs:[{tfName:"element_dtype",name:"elementDType",type:"dtype"}]},{tfOpName:"LoopCond",category:"control",inputs:[{start:0,name:"pred",type:"tensor"}]},{tfOpName:"Switch",category:"control",inputs:[{start:0,name:"data",type:"tensor"},{start:1,name:"pred",type:"tensor"}]},{tfOpName:"Merge",category:"control",inputs:[{start:0,end:0,name:"tensors",type:"tensors"}]},{tfOpName:"Enter",category:"control",inputs:[{start:0,name:"tensor",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0},{tfName:"frame_name",name:"frameName",type:"string"},{tfName:"is_constant",name:"isConstant",type:"bool"}]},{tfOpName:"Exit",category:"control",inputs:[{start:0,name:"tensor",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"NextIteration",category:"control",inputs:[{start:0,name:"tensor",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"TensorArrayV3",category:"control",inputs:[{start:0,name:"size",type:"number"}],attrs:[{tfName:"dtype",name:"dtype",type:"dtype"},{tfName:"element_shape",name:"elementShape",type:"shape"},{tfName:"dynamic_size",name:"dynamicSize",type:"bool"},{tfName:"clear_after_read",name:"clearAfterRead",type:"bool"},{tfName:"identical_element_shapes",name:"identicalElementShapes",type:"bool"},{tfName:"tensor_array_name",name:"name",type:"string"}]},{tfOpName:"TensorArrayWriteV3",category:"control",inputs:[{start:0,name:"tensorArrayId",type:"tensor"},{start:1,name:"index",type:"number"},{start:2,name:"tensor",type:"tensor"},{start:3,name:"flowIn",type:"number"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"TensorArrayReadV3",category:"control",inputs:[{start:0,name:"tensorArrayId",type:"tensor"},{start:1,name:"index",type:"number"},{start:2,name:"flowIn",type:"number"}],attrs:[{tfName:"dtype",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"TensorArrayGatherV3",category:"control",inputs:[{start:0,name:"tensorArrayId",type:"tensor"},{start:1,name:"indices",type:"number[]"},{start:2,name:"flowIn",type:"number"}],attrs:[{tfName:"dtype",name:"dtype",type:"dtype"},{tfName:"element_shape",name:"elementShape",type:"shape"}]},{tfOpName:"TensorArrayScatterV3",category:"control",inputs:[{start:0,name:"tensorArrayId",type:"tensor"},{start:1,name:"indices",type:"number[]"},{start:2,name:"tensor",type:"tensor"},{start:3,name:"flowIn",type:"number"}],attrs:[{tfName:"T",name:"dtype",type:"dtype"}]},{tfOpName:"TensorArrayConcatV3",category:"control",inputs:[{start:0,name:"tensorArrayId",type:"tensor"},{start:1,name:"flowIn",type:"number"}],attrs:[{tfName:"dtype",name:"dtype",type:"dtype"},{tfName:"element_shape_except0",name:"elementShapeExcept0",type:"shape",notSupported:!0}]},{tfOpName:"TensorArraySplitV3",category:"control",inputs:[{start:0,name:"tensorArrayId",type:"tensor"},{start:1,name:"tensor",type:"tensor"},{start:2,name:"lengths",type:"number[]"},{start:3,name:"flowIn",type:"number"}],attrs:[{tfName:"T",name:"dtype",type:"dtype"}]},{tfOpName:"TensorArraySizeV3",category:"control",inputs:[{start:0,name:"tensorArrayId",type:"tensor"},{start:1,name:"flowIn",type:"number"}]},{tfOpName:"TensorArrayCloseV3",category:"control",inputs:[{start:0,name:"tensorArrayId",type:"tensor"}]},{tfOpName:"StatelessIf",category:"control",inputs:[{start:0,name:"cond",type:"tensor"},{start:1,end:0,name:"args",type:"tensors"}],attrs:[{tfName:"then_branch",name:"thenBranch",type:"func"},{tfName:"else_branch",name:"elseBranch",type:"func"}]},{tfOpName:"If",category:"control",inputs:[{start:0,name:"cond",type:"tensor"},{start:1,end:0,name:"args",type:"tensors"}],attrs:[{tfName:"then_branch",name:"thenBranch",type:"func"},{tfName:"else_branch",name:"elseBranch",type:"func"}]},{tfOpName:"StatelessWhile",category:"control",inputs:[{start:0,end:0,name:"args",type:"tensors"}],attrs:[{tfName:"cond",name:"cond",type:"func"},{tfName:"body",name:"body",type:"func"}]},{tfOpName:"While",category:"control",inputs:[{start:0,end:0,name:"args",type:"tensors"}],attrs:[{tfName:"cond",name:"cond",type:"func"},{tfName:"body",name:"body",type:"func"}]},{tfOpName:"TensorListScatter",category:"control",inputs:[{start:0,name:"tensor",type:"tensor"},{start:1,name:"indices",type:"number[]"},{start:2,name:"elementShape",type:"shape"}],attrs:[{tfName:"element_dtype",name:"elementDType",type:"dtype"}]},{tfOpName:"TensorListScatterV2",category:"control",inputs:[{start:0,name:"tensor",type:"tensor"},{start:1,name:"indices",type:"number[]"},{start:2,name:"elementShape",type:"shape"},{start:3,name:"numElements",type:"number"}],attrs:[{tfName:"element_dtype",name:"elementDType",type:"dtype"}]},{tfOpName:"TensorListGather",category:"control",inputs:[{start:0,name:"tensorListId",type:"tensor"},{start:1,name:"indices",type:"number[]"},{start:2,name:"elementShape",type:"shape"}],attrs:[{tfName:"element_dtype",name:"elementDType",type:"dtype"}]},{tfOpName:"TensorListGetItem",category:"control",inputs:[{start:0,name:"tensorListId",type:"tensor"},{start:1,name:"index",type:"number"},{start:2,name:"elementShape",type:"shape"}],attrs:[{tfName:"element_dtype",name:"elementDType",type:"dtype"}]},{tfOpName:"TensorListSetItem",category:"control",inputs:[{start:0,name:"tensorListId",type:"tensor"},{start:1,name:"index",type:"number"},{start:2,name:"tensor",type:"tensor"}],attrs:[{tfName:"element_dtype",name:"elementDType",type:"dtype"}]},{tfOpName:"TensorListReserve",category:"control",inputs:[{start:0,name:"elementShape",type:"shape"},{start:1,name:"numElements",type:"number"}],attrs:[{tfName:"element_dtype",name:"elementDType",type:"dtype"}]},{tfOpName:"TensorListFromTensor",category:"control",inputs:[{start:0,name:"tensor",type:"tensor"},{start:1,name:"elementShape",type:"shape"}],attrs:[{tfName:"element_dtype",name:"elementDType",type:"dtype"}]},{tfOpName:"TensorListStack",category:"control",inputs:[{start:0,name:"tensorListId",type:"tensor"},{start:1,name:"elementShape",type:"shape"}],attrs:[{tfName:"element_dtype",name:"elementDType",type:"dtype"},{tfName:"num_elements",name:"numElements",type:"dtype"}]},{tfOpName:"TensorListSplit",category:"control",inputs:[{start:0,name:"tensor",type:"tensor"},{start:1,name:"elementShape",type:"shape"},{start:2,name:"lengths",type:"number[]"}],attrs:[{tfName:"element_dtype",name:"elementDType",type:"dtype"}]},{tfOpName:"TensorListConcat",category:"control",inputs:[{start:0,name:"tensorListId",type:"tensor"}],attrs:[{tfName:"element_shape",name:"elementShape",type:"shape"},{tfName:"element_dtype",name:"elementDType",type:"dtype"}]},{tfOpName:"TensorListConcatV2",category:"control",inputs:[{start:0,name:"tensorListId",type:"tensor"}],attrs:[{tfName:"element_shape",name:"elementShape",type:"shape"},{tfName:"element_dtype",name:"elementDType",type:"dtype"}]},{tfOpName:"TensorListPopBack",category:"control",inputs:[{start:0,name:"tensorListId",type:"tensor"},{start:1,name:"elementShape",type:"shape"}],attrs:[{tfName:"element_dtype",name:"elementDType",type:"dtype"}]},{tfOpName:"TensorListPushBack",category:"control",inputs:[{start:0,name:"tensorListId",type:"tensor"},{start:1,name:"tensor",type:"tensor"}],attrs:[{tfName:"element_dtype",name:"elementDType",type:"dtype"}]},{tfOpName:"TensorListLength",category:"control",inputs:[{start:0,name:"tensorListId",type:"tensor"}]},{tfOpName:"TensorListResize",category:"control",inputs:[{start:0,name:"tensorListId",type:"tensor"},{start:1,name:"size",type:"number"}]}],sC=[{tfOpName:"AvgPool",category:"convolution",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"strides",name:"strides",type:"number[]"},{tfName:"padding",name:"pad",type:"string"},{tfName:"data_format",name:"dataFormat",type:"string",notSupported:!0},{tfName:"ksize",name:"kernelSize",type:"number[]"},{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"MaxPool",category:"convolution",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"strides",name:"strides",type:"number[]"},{tfName:"padding",name:"pad",type:"string"},{tfName:"data_format",name:"dataFormat",type:"string",notSupported:!0},{tfName:"ksize",name:"kernelSize",type:"number[]"},{tfName:"explicit_paddings",name:"explicitPaddings",type:"number[]",defaultValue:[],notSupported:!0},{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"MaxPoolWithArgmax",category:"convolution",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"strides",name:"strides",type:"number[]"},{tfName:"padding",name:"pad",type:"string"},{tfName:"ksize",name:"kernelSize",type:"number[]"},{tfName:"include_batch_in_index",name:"includeBatchInIndex",type:"bool"},{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"AvgPool3D",category:"convolution",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"strides",name:"strides",type:"number[]"},{tfName:"padding",name:"pad",type:"string"},{tfName:"data_format",name:"dataFormat",type:"string",notSupported:!0},{tfName:"ksize",name:"kernelSize",type:"number[]"},{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"MaxPool3D",category:"convolution",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"strides",name:"strides",type:"number[]"},{tfName:"padding",name:"pad",type:"string"},{tfName:"data_format",name:"dataFormat",type:"string",notSupported:!0},{tfName:"ksize",name:"kernelSize",type:"number[]"},{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Conv1D",category:"convolution",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"filter",type:"tensor"}],attrs:[{tfName:"stride",name:"stride",type:"number"},{tfName:"padding",name:"pad",type:"string"},{tfName:"data_format",name:"dataFormat",type:"string",defaultValue:"NWC"},{tfName:"T",name:"dtype",type:"dtype",notSupported:!0},{tfName:"dilation",name:"dilation",type:"number",defaultValue:1}]},{tfOpName:"Conv2D",category:"convolution",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"filter",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0},{tfName:"strides",name:"strides",type:"number[]"},{tfName:"padding",name:"pad",type:"string"},{tfName:"useCudnnOnGpu",name:"useCudnnOnGpu",type:"bool"},{tfName:"data_format",name:"dataFormat",type:"string",defaultValue:"NHWC"},{tfName:"explicit_paddings",name:"explicitPaddings",type:"number[]",defaultValue:[]},{tfName:"dilations",name:"dilations",type:"number[]"}]},{tfOpName:"_FusedConv2D",category:"convolution",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"filter",type:"tensor"},{start:2,end:0,name:"args",type:"tensors"}],attrs:[{tfName:"num_args",name:"numArgs",type:"number"},{tfName:"T",name:"dtype",type:"dtype",notSupported:!0},{tfName:"strides",name:"strides",type:"number[]"},{tfName:"padding",name:"pad",type:"string"},{tfName:"explicit_paddings",name:"explicitPaddings",type:"number[]",defaultValue:[]},{tfName:"use_cudnn_on_gpu",name:"useCudnnOnGpu",type:"bool",defaultValue:!0},{tfName:"data_format",name:"dataFormat",type:"string",defaultValue:"NHWC"},{tfName:"dilations",name:"dilations",type:"number[]",defaultValue:[1,1,1,1]},{tfName:"fused_ops",name:"fusedOps",type:"string[]",defaultValue:[]},{tfName:"epsilon",name:"epsilon",type:"number",defaultValue:1e-4},{tfName:"leakyrelu_alpha",name:"leakyreluAlpha",type:"number",defaultValue:.2}]},{tfOpName:"Conv2DBackpropInput",category:"convolution",inputs:[{start:2,name:"x",type:"tensor"},{start:1,name:"filter",type:"tensor"},{start:0,name:"outputShape",type:"number[]"}],attrs:[{tfName:"strides",name:"strides",type:"number[]"},{tfName:"padding",name:"pad",type:"string"},{tfName:"data_format",name:"dataFormat",type:"string",notSupported:!0},{tfName:"explicit_paddings",name:"explicitPaddings",type:"number[]",defaultValue:[]},{tfName:"dilations",name:"dilations",type:"number[]",notSupported:!0}]},{tfOpName:"DepthwiseConv2d",category:"convolution",inputs:[{start:0,name:"input",type:"tensor"},{start:1,name:"filter",type:"tensor"}],attrs:[{tfName:"strides",name:"strides",type:"number[]"},{tfName:"padding",name:"pad",type:"string"},{tfName:"data_format",name:"dataFormat",type:"string",defaultValue:"NHWC"},{tfName:"explicit_paddings",name:"explicitPaddings",type:"number[]",defaultValue:[]},{tfName:"dilations",name:"dilations",type:"number[]"}]},{tfOpName:"DepthwiseConv2dNative",category:"convolution",inputs:[{start:0,name:"input",type:"tensor"},{start:1,name:"filter",type:"tensor"}],attrs:[{tfName:"strides",name:"strides",type:"number[]"},{tfName:"padding",name:"pad",type:"string"},{tfName:"data_format",name:"dataFormat",type:"string",defaultValue:"NHWC"},{tfName:"explicit_paddings",name:"explicitPaddings",type:"number[]",defaultValue:[]},{tfName:"dilations",name:"dilations",type:"number[]"}]},{tfOpName:"FusedDepthwiseConv2dNative",category:"convolution",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"filter",type:"tensor"},{start:2,end:0,name:"args",type:"tensors"}],attrs:[{tfName:"num_args",name:"numArgs",type:"number"},{tfName:"T",name:"dtype",type:"dtype",notSupported:!0},{tfName:"strides",name:"strides",type:"number[]"},{tfName:"padding",name:"pad",type:"string"},{tfName:"data_format",name:"dataFormat",type:"string",defaultValue:"NHWC"},{tfName:"dilations",name:"dilations",type:"number[]",defaultValue:[1,1,1,1]},{tfName:"fused_ops",name:"fusedOps",type:"string[]",defaultValue:[]},{tfName:"explicit_paddings",name:"explicitPaddings",type:"number[]",defaultValue:[]}]},{tfOpName:"Conv3D",category:"convolution",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"filter",type:"tensor"}],attrs:[{tfName:"strides",name:"strides",type:"number[]"},{tfName:"padding",name:"pad",type:"string"},{tfName:"data_format",name:"dataFormat",type:"string",defaultValue:"NHWC"},{tfName:"dilations",name:"dilations",type:"number[]"}]},{tfOpName:"Dilation2D",category:"convolution",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"filter",type:"tensor"}],attrs:[{tfName:"strides",name:"strides",type:"number[]"},{tfName:"rates",name:"dilations",type:"number[]"},{tfName:"padding",name:"pad",type:"string"}]}],rC=[{tfOpName:"Fill",category:"creation",inputs:[{start:0,name:"shape",type:"number[]"},{start:1,name:"value",type:"number"}],attrs:[{tfName:"T",name:"dtype",type:"dtype"}]},{tfOpName:"LinSpace",category:"creation",inputs:[{start:0,name:"start",type:"number"},{start:1,name:"stop",type:"number"},{start:2,name:"num",type:"number"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"OneHot",category:"creation",inputs:[{start:0,name:"indices",type:"tensor"},{start:1,name:"depth",type:"number"},{start:2,name:"onValue",type:"number",defaultValue:1},{start:3,name:"offValue",type:"number",defaultValue:0}],attrs:[{tfName:"axis",name:"axis",type:"number",notSupported:!0},{tfName:"T",name:"dtype",type:"dtype"}]},{tfOpName:"Ones",category:"creation",inputs:[{start:0,name:"shape",type:"number[]"}],attrs:[{tfName:"T",name:"dtype",type:"dtype"}]},{tfOpName:"OnesLike",category:"creation",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"dtype",name:"dtype",type:"dtype"}]},{tfOpName:"RandomStandardNormal",category:"creation",inputs:[{start:0,name:"shape",type:"number[]"}],attrs:[{tfName:"seed",name:"seed",type:"number",defaultValue:0},{tfName:"seed2",name:"seed2",type:"number",defaultValue:0,notSupported:!0},{tfName:"dtype",name:"dtype",type:"dtype"},{tfName:"T",name:"T",type:"number",notSupported:!0}]},{tfOpName:"RandomUniform",category:"creation",inputs:[{start:0,name:"shape",type:"number[]"}],attrs:[{tfName:"minval",name:"minval",type:"number",defaultValue:0},{tfName:"maxval",name:"maxval",type:"number",defaultValue:1},{tfName:"dtype",name:"dtype",type:"dtype"},{tfName:"seed",name:"seed",type:"number",defaultValue:0},{tfName:"seed2",name:"seed2",type:"number",defaultValue:0,notSupported:!0},{tfName:"T",name:"T",type:"number",notSupported:!0}]},{tfOpName:"RandomUniformInt",category:"creation",inputs:[{start:0,name:"shape",type:"number[]"}],attrs:[{tfName:"minval",name:"minval",type:"number"},{tfName:"maxval",name:"maxval",type:"number"},{tfName:"seed",name:"seed",type:"number",defaultValue:0},{tfName:"seed2",name:"seed2",type:"number",defaultValue:0,notSupported:!0}]},{tfOpName:"Range",category:"creation",inputs:[{start:0,name:"start",type:"number"},{start:1,name:"stop",type:"number"},{start:2,name:"step",type:"number",defaultValue:0}],attrs:[{tfName:"Tidx",name:"dtype",type:"dtype"}]},{tfOpName:"TruncatedNormal",category:"creation",inputs:[{start:0,name:"shape",type:"number[]"}],attrs:[{tfName:"means",name:"mean",type:"number",defaultValue:0},{tfName:"stddev",name:"stdDev",type:"number",defaultValue:1},{tfName:"seed",name:"seed",type:"number"},{tfName:"seed2",name:"seed2",type:"number",defaultValue:0,notSupported:!0},{tfName:"dtype",name:"dtype",type:"dtype"},{tfName:"T",name:"T",type:"number",notSupported:!0}]},{tfOpName:"Zeros",category:"creation",inputs:[{start:0,name:"shape",type:"number[]"}],attrs:[{tfName:"T",name:"dtype",type:"dtype"}]},{tfOpName:"ZerosLike",category:"creation",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype"}]},{tfOpName:"Multinomial",category:"creation",inputs:[{start:0,name:"logits",type:"tensor"},{start:1,name:"numSamples",type:"number"}],attrs:[{tfName:"seed",name:"seed",type:"number"},{tfName:"seed2",name:"seed2",type:"number"},{tfName:"T",name:"dtype",type:"dtype"},{tfName:"output_dtype",name:"output_dtype",type:"dtype"}]}],aC=[{tfOpName:"NonMaxSuppressionV2",category:"dynamic",inputs:[{start:0,name:"boxes",type:"tensor"},{start:1,name:"scores",type:"tensor"},{start:2,name:"maxOutputSize",type:"number"},{start:3,name:"iouThreshold",type:"number"}]},{tfOpName:"NonMaxSuppressionV3",category:"dynamic",inputs:[{start:0,name:"boxes",type:"tensor"},{start:1,name:"scores",type:"tensor"},{start:2,name:"maxOutputSize",type:"number"},{start:3,name:"iouThreshold",type:"number"},{start:4,name:"scoreThreshold",type:"number"}]},{tfOpName:"NonMaxSuppressionV4",category:"dynamic",inputs:[{start:0,name:"boxes",type:"tensor"},{start:1,name:"scores",type:"tensor"},{start:2,name:"maxOutputSize",type:"number"},{start:3,name:"iouThreshold",type:"number"},{start:4,name:"scoreThreshold",type:"number"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0},{tfName:"T_threshold",name:"threshold",type:"dtype",notSupported:!0},{tfName:"pad_to_max_output_size",name:"padToMaxOutputSize",type:"bool"}]},{tfOpName:"NonMaxSuppressionV5",category:"dynamic",inputs:[{start:0,name:"boxes",type:"tensor"},{start:1,name:"scores",type:"tensor"},{start:2,name:"maxOutputSize",type:"number"},{start:3,name:"iouThreshold",type:"number"},{start:4,name:"scoreThreshold",type:"number"},{start:5,name:"softNmsSigma",type:"number"}]},{tfOpName:"Where",category:"dynamic",inputs:[{start:0,name:"condition",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"ListDiff",category:"dynamic",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"y",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]}],iC=[{tfOpName:"LowerBound",category:"evaluation",inputs:[{start:0,name:"sortedSequence",type:"tensor"},{start:1,name:"values",type:"tensor"}]},{tfOpName:"TopKV2",category:"evaluation",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"k",type:"number"}],attrs:[{tfName:"sorted",name:"sorted",type:"bool"}]},{tfOpName:"UpperBound",category:"evaluation",inputs:[{start:0,name:"sortedSequence",type:"tensor"},{start:1,name:"values",type:"tensor"}]},{tfOpName:"Unique",category:"evaluation",inputs:[{start:0,name:"x",type:"tensor"}]},{tfOpName:"UniqueV2",category:"evaluation",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"axis",type:"number"}]}],oC=[{tfOpName:"PlaceholderWithDefault",category:"graph",inputs:[{start:0,name:"default",type:"tensor"}],attrs:[{tfName:"shape",name:"shape",type:"shape"},{tfName:"dtype",name:"dtype",type:"dtype"}]},{tfOpName:"Placeholder",category:"graph",attrs:[{tfName:"shape",name:"shape",type:"shape"},{tfName:"dtype",name:"dtype",type:"dtype"}]},{tfOpName:"Const",category:"graph"},{tfOpName:"Identity",category:"graph",inputs:[{start:0,name:"x",type:"tensor"}]},{tfOpName:"IdentityN",category:"graph",inputs:[{start:0,end:0,name:"x",type:"tensors"}]},{tfOpName:"Snapshot",category:"graph",inputs:[{start:0,name:"x",type:"tensor"}]},{tfOpName:"Rank",category:"graph",inputs:[{start:0,name:"x",type:"tensor"}]},{tfOpName:"Size",category:"graph",inputs:[{start:0,name:"x",type:"tensor"}]},{tfOpName:"Shape",category:"graph",inputs:[{start:0,name:"x",type:"tensor"}]},{tfOpName:"ShapeN",category:"graph",inputs:[{start:0,end:0,name:"x",type:"tensors"}]},{tfOpName:"Print",category:"graph",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"data",type:"tensors"}],attrs:[{tfName:"message",name:"message",type:"string"},{tfName:"first_n",name:"firstN",type:"number",notSupported:!0},{tfName:"summarize",name:"summarize",type:"number",defaultValue:3}]},{tfOpName:"NoOp",category:"graph",inputs:[]},{tfOpName:"StopGradient",category:"graph",inputs:[{start:0,name:"x",type:"tensor"}]},{tfOpName:"FakeQuantWithMinMaxVars",category:"graph",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"min",name:"min",type:"number"},{tfName:"max",name:"max",type:"number"}]}],lC=[{tfOpName:"HashTable",category:"hash_table",inputs:[],attrs:[{tfName:"shared_name",name:"sharedName",type:"string"},{tfName:"use_node_name_sharing",name:"useNodeNameSharing",type:"bool"},{tfName:"key_dtype",name:"keyDType",type:"dtype"},{tfName:"value_dtype",name:"valueDType",type:"dtype"}]},{tfOpName:"HashTableV2",category:"hash_table",inputs:[],attrs:[{tfName:"shared_name",name:"sharedName",type:"string"},{tfName:"use_node_name_sharing",name:"useNodeNameSharing",type:"bool"},{tfName:"key_dtype",name:"keyDType",type:"dtype"},{tfName:"value_dtype",name:"valueDType",type:"dtype"}]},{tfOpName:"LookupTableImport",category:"hash_table",inputs:[{start:0,name:"tableHandle",type:"tensor"},{start:1,name:"keys",type:"tensor"},{start:2,name:"values",type:"tensor"}],attrs:[{tfName:"Tin",name:"tIn",type:"dtype",notSupported:!0},{tfName:"Tout",name:"tOut",type:"dtype",notSupported:!0}]},{tfOpName:"LookupTableImportV2",category:"hash_table",inputs:[{start:0,name:"tableHandle",type:"tensor"},{start:1,name:"keys",type:"tensor"},{start:2,name:"values",type:"tensor"}],attrs:[{tfName:"Tin",name:"tIn",type:"dtype",notSupported:!0},{tfName:"Tout",name:"tOut",type:"dtype",notSupported:!0}]},{tfOpName:"LookupTableFind",category:"hash_table",inputs:[{start:0,name:"tableHandle",type:"tensor"},{start:1,name:"keys",type:"tensor"},{start:2,name:"defaultValue",type:"tensor"}],attrs:[{tfName:"Tin",name:"tIn",type:"dtype",notSupported:!0},{tfName:"Tout",name:"tOut",type:"dtype",notSupported:!0}]},{tfOpName:"LookupTableFindV2",category:"hash_table",inputs:[{start:0,name:"tableHandle",type:"tensor"},{start:1,name:"keys",type:"tensor"},{start:2,name:"defaultValue",type:"tensor"}],attrs:[{tfName:"Tin",name:"tIn",type:"dtype",notSupported:!0},{tfName:"Tout",name:"tOut",type:"dtype",notSupported:!0}]},{tfOpName:"LookupTableSize",category:"hash_table",inputs:[{start:0,name:"tableHandle",type:"tensor"}]},{tfOpName:"LookupTableSizeV2",category:"hash_table",inputs:[{start:0,name:"tableHandle",type:"tensor"}]},{tfOpName:"InitializeTable",category:"hash_table",inputs:[{start:0,name:"tableHandle",type:"tensor"},{start:1,name:"keys",type:"tensor"},{start:2,name:"values",type:"tensor"}]},{tfOpName:"InitializeTableV2",category:"hash_table",inputs:[{start:0,name:"tableHandle",type:"tensor"},{start:1,name:"keys",type:"tensor"},{start:2,name:"values",type:"tensor"}]}],uC=[{tfOpName:"ResizeBilinear",category:"image",inputs:[{start:0,name:"images",type:"tensor"},{start:1,name:"size",type:"number[]"}],attrs:[{tfName:"align_corners",name:"alignCorners",type:"bool"},{tfName:"half_pixel_centers",name:"halfPixelCenters",type:"bool"},{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"ResizeNearestNeighbor",category:"image",inputs:[{start:0,name:"images",type:"tensor"},{start:1,name:"size",type:"number[]"}],attrs:[{tfName:"align_corners",name:"alignCorners",type:"bool"},{tfName:"half_pixel_centers",name:"halfPixelCenters",type:"bool"},{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"CropAndResize",category:"image",inputs:[{start:0,name:"image",type:"tensor"},{start:1,name:"boxes",type:"tensor"},{start:2,name:"boxInd",type:"tensor"},{start:3,name:"cropSize",type:"number[]"}],attrs:[{tfName:"method",name:"method",type:"string"},{tfName:"extrapolation_value",name:"extrapolationValue",type:"number"}]},{tfOpName:"ImageProjectiveTransformV3",category:"image",inputs:[{start:0,name:"images",type:"tensor"},{start:1,name:"transforms",type:"tensor"},{start:2,name:"outputShape",type:"number[]"},{start:3,name:"fillValue",type:"number"}],attrs:[{tfName:"interpolation",name:"interpolation",type:"string"},{tfName:"fill_mode",name:"fillMode",type:"string"}]}],cC=[{tfOpName:"Equal",category:"logical",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"NotEqual",category:"logical",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Greater",category:"logical",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"GreaterEqual",category:"logical",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Less",category:"logical",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"LessEqual",category:"logical",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"LogicalAnd",category:"logical",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"LogicalNot",category:"logical",inputs:[{start:0,name:"a",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"LogicalOr",category:"logical",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Select",category:"logical",inputs:[{start:0,name:"condition",type:"tensor"},{start:1,name:"a",type:"tensor"},{start:2,name:"b",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"SelectV2",category:"logical",inputs:[{start:0,name:"condition",type:"tensor"},{start:1,name:"a",type:"tensor"},{start:2,name:"b",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"BitwiseAnd",category:"logical",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"y",type:"tensor"}]}],hC=[{tfOpName:"_FusedMatMul",category:"matrices",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"},{start:2,end:0,name:"args",type:"tensors"}],attrs:[{tfName:"num_args",name:"numArgs",type:"number"},{tfName:"fused_ops",name:"fusedOps",type:"string[]",defaultValue:[]},{tfName:"epsilon",name:"epsilon",type:"number",defaultValue:1e-4},{tfName:"transpose_a",name:"transposeA",type:"bool",defaultValue:!1},{tfName:"transpose_b",name:"transposeB",type:"bool",defaultValue:!1},{tfName:"leakyrelu_alpha",name:"leakyreluAlpha",type:"number",defaultValue:.2},{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"MatMul",category:"matrices",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"}],attrs:[{tfName:"transpose_a",name:"transposeA",type:"bool",defaultValue:!1},{tfName:"transpose_b",name:"transposeB",type:"bool",defaultValue:!1},{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"BatchMatMul",category:"matrices",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"}],attrs:[{tfName:"adj_x",name:"transposeA",type:"bool",defaultValue:!1},{tfName:"adj_y",name:"transposeB",type:"bool",defaultValue:!1},{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"BatchMatMulV2",category:"matrices",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"}],attrs:[{tfName:"adj_x",name:"transposeA",type:"bool",defaultValue:!1},{tfName:"adj_y",name:"transposeB",type:"bool",defaultValue:!1},{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Transpose",category:"matrices",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"perm",type:"number[]"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Einsum",category:"matrices",inputs:[{start:0,end:0,name:"tensors",type:"tensors"}],attrs:[{tfName:"equation",name:"equation",type:"string"},{tfName:"N",name:"n",type:"number",defaultValue:2},{tfName:"T",name:"dtype",type:"dtype"}]},{tfOpName:"MatrixBandPart",category:"matrices",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"numLower",type:"tensor"},{start:1,name:"numUpper",type:"tensor"}]}],dC=[{tfOpName:"EuclideanNorm",category:"normalization",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"axis",type:"number[]"}],attrs:[{tfName:"keep_dims",name:"keepDims",type:"bool",defaultValue:!1}]},{tfOpName:"FusedBatchNorm",category:"normalization",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"scale",type:"tensor"},{start:2,name:"offset",type:"tensor"},{start:3,name:"mean",type:"tensor"},{start:4,name:"variance",type:"tensor"}],attrs:[{tfName:"epsilon",name:"epsilon",type:"number",defaultValue:.001},{tfName:"data_format",name:"dataFormat",type:"string",notSupported:!0}]},{tfOpName:"FusedBatchNormV2",category:"normalization",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"scale",type:"tensor"},{start:2,name:"offset",type:"tensor"},{start:3,name:"mean",type:"tensor"},{start:4,name:"variance",type:"tensor"}],attrs:[{tfName:"epsilon",name:"epsilon",type:"number",defaultValue:.001},{tfName:"data_format",name:"dataFormat",type:"string",notSupported:!0}]},{tfOpName:"FusedBatchNormV3",category:"normalization",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"scale",type:"tensor"},{start:2,name:"offset",type:"tensor"},{start:3,name:"mean",type:"tensor"},{start:4,name:"variance",type:"tensor"}],attrs:[{tfName:"epsilon",name:"epsilon",type:"number",defaultValue:.001},{tfName:"data_format",name:"dataFormat",type:"string",notSupported:!0}]},{tfOpName:"LRN",category:"normalization",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"depth_radius",name:"radius",type:"number",defaultValue:5},{tfName:"bias",name:"bias",type:"number",defaultValue:1},{tfName:"alpha",name:"alpha",type:"number",defaultValue:1},{tfName:"beta",name:"beta",type:"number",defaultValue:.5}]},{tfOpName:"Softmax",category:"normalization",inputs:[{start:0,name:"x",type:"tensor"}]},{tfOpName:"LogSoftmax",category:"normalization",inputs:[{start:0,name:"x",type:"tensor"}]}],pC=[{tfOpName:"Bincount",category:"reduction",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"size",type:"number"},{start:2,name:"weights",type:"tensor"}]},{tfOpName:"DenseBincount",category:"reduction",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"size",type:"number"},{start:2,name:"weights",type:"tensor"}],attrs:[{tfName:"binary_output",name:"binaryOutput",type:"bool"}]},{tfOpName:"Max",category:"reduction",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"axis",type:"number[]"}],attrs:[{tfName:"keep_dims",name:"keepDims",type:"bool"}]},{tfOpName:"Mean",category:"reduction",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"axis",type:"number[]"}],attrs:[{tfName:"keep_dims",name:"keepDims",type:"bool"}]},{tfOpName:"Min",category:"reduction",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"axis",type:"number[]"}],attrs:[{tfName:"keep_dims",name:"keepDims",type:"bool"}]},{tfOpName:"Sum",category:"reduction",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"axis",type:"number[]"}],attrs:[{tfName:"keep_dims",name:"keepDims",type:"bool"}]},{tfOpName:"All",category:"reduction",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"axis",type:"number[]"}],attrs:[{tfName:"keep_dims",name:"keepDims",type:"bool"}]},{tfOpName:"Any",category:"reduction",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"axis",type:"number[]"}],attrs:[{tfName:"keep_dims",name:"keepDims",type:"bool"}]},{tfOpName:"ArgMax",category:"reduction",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"axis",type:"number"}]},{tfOpName:"ArgMin",category:"reduction",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"axis",type:"number"}]},{tfOpName:"Prod",category:"reduction",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"axis",type:"number[]"}],attrs:[{tfName:"keep_dims",name:"keepDims",type:"bool"},{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Cumprod",category:"reduction",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"axis",type:"number"}],attrs:[{tfName:"exclusive",name:"exclusive",type:"bool"},{tfName:"reverse",name:"reverse",type:"bool"}]},{tfOpName:"Cumsum",category:"reduction",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"axis",type:"number"}],attrs:[{tfName:"exclusive",name:"exclusive",type:"bool"},{tfName:"reverse",name:"reverse",type:"bool"}]}],fC=[{tfOpName:"ConcatV2",category:"slice_join",inputs:[{start:0,end:-1,name:"tensors",type:"tensors"},{start:-1,name:"axis",type:"number"}],attrs:[{tfName:"N",name:"n",type:"number",defaultValue:2}]},{tfOpName:"Concat",category:"slice_join",inputs:[{start:1,end:0,name:"tensors",type:"tensors"},{start:0,name:"axis",type:"number"}],attrs:[{tfName:"N",name:"n",type:"number",defaultValue:2}]},{tfOpName:"GatherV2",category:"slice_join",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"indices",type:"tensor"},{start:2,name:"axis",type:"number",defaultValue:0}],attrs:[{tfName:"batch_dims",name:"batchDims",type:"number",defaultValue:0}]},{tfOpName:"Gather",category:"slice_join",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"indices",type:"tensor"}],attrs:[{tfName:"validate_indices",name:"validateIndices",type:"bool",notSupported:!0}]},{tfOpName:"Reverse",category:"slice_join",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"dims",type:"bool[]"}]},{tfOpName:"ReverseV2",category:"slice_join",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"axis",type:"number[]"}]},{tfOpName:"Slice",category:"slice_join",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"begin",type:"number[]"},{start:2,name:"size",type:"number[]"}]},{tfOpName:"StridedSlice",category:"slice_join",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"begin",type:"number[]"},{start:2,name:"end",type:"number[]"},{start:3,name:"strides",type:"number[]"}],attrs:[{tfName:"begin_mask",name:"beginMask",type:"number",defaultValue:0},{tfName:"end_mask",name:"endMask",type:"number",defaultValue:0},{tfName:"new_axis_mask",name:"newAxisMask",type:"number",defaultValue:0},{tfName:"ellipsis_mask",name:"ellipsisMask",type:"number",defaultValue:0},{tfName:"shrink_axis_mask",name:"shrinkAxisMask",type:"number",defaultValue:0}]},{tfOpName:"Pack",category:"slice_join",inputs:[{start:0,end:0,name:"tensors",type:"tensors"}],attrs:[{tfName:"axis",name:"axis",type:"number",defaultValue:0}]},{tfOpName:"Unpack",category:"slice_join",inputs:[{start:0,name:"tensor",type:"tensor"}],attrs:[{tfName:"axis",name:"axis",type:"number",defaultValue:0},{tfName:"num",name:"num",type:"number",defaultValue:0,notSupported:!0}]},{tfOpName:"Tile",category:"slice_join",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"reps",type:"number[]"}]},{tfOpName:"Split",category:"slice_join",inputs:[{start:0,name:"axis",type:"number",defaultValue:0},{start:1,name:"x",type:"tensor"}],attrs:[{tfName:"num_split",name:"numOrSizeSplits",type:"number",defaultValue:1}]},{tfOpName:"SplitV",category:"slice_join",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"numOrSizeSplits",type:"number[]"},{start:2,name:"axis",type:"number",defaultValue:0}]},{tfOpName:"ScatterNd",category:"slice_join",inputs:[{start:0,name:"indices",type:"tensor"},{start:1,name:"values",type:"tensor"},{start:2,name:"shape",type:"number[]"}]},{tfOpName:"GatherNd",category:"slice_join",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"indices",type:"tensor"}]},{tfOpName:"SparseToDense",category:"slice_join",inputs:[{start:0,name:"sparseIndices",type:"tensor"},{start:1,name:"outputShape",type:"number[]"},{start:2,name:"sparseValues",type:"tensor"},{start:3,name:"defaultValue",type:"tensor"}],attrs:[{tfName:"validate_indices",name:"validateIndices",type:"bool",defaultValue:!1,notSupported:!0}]},{tfOpName:"TensorScatterUpdate",category:"slice_join",inputs:[{start:0,name:"tensor",type:"tensor"},{start:1,name:"indices",type:"tensor"},{start:2,name:"values",type:"tensor"}]}],mC=[{tfOpName:"SparseFillEmptyRows",category:"sparse",inputs:[{start:0,name:"indices",type:"tensor"},{start:1,name:"values",type:"tensor"},{start:2,name:"denseShape",type:"tensor"},{start:3,name:"defaultValue",type:"tensor"}]},{tfOpName:"SparseReshape",category:"sparse",inputs:[{start:0,name:"inputIndices",type:"tensor"},{start:1,name:"inputShape",type:"tensor"},{start:2,name:"newShape",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"SparseSegmentMean",category:"sparse",inputs:[{start:0,name:"data",type:"tensor"},{start:1,name:"indices",type:"tensor"},{start:2,name:"segmentIds",type:"tensor"}]},{tfOpName:"SparseSegmentSum",category:"sparse",inputs:[{start:0,name:"data",type:"tensor"},{start:1,name:"indices",type:"tensor"},{start:2,name:"segmentIds",type:"tensor"}]}],gC=[{tfOpName:"FFT",category:"spectral",inputs:[{start:0,name:"x",type:"tensor"}]},{tfOpName:"IFFT",category:"spectral",inputs:[{start:0,name:"x",type:"tensor"}]},{tfOpName:"RFFT",category:"spectral",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"fft_length",type:"number",notSupported:!0}]},{tfOpName:"IRFFT",category:"spectral",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"fft_length",type:"number",notSupported:!0}]}],yC=[{tfOpName:"StaticRegexReplace",category:"string",inputs:[{start:0,name:"input",type:"tensor"}],attrs:[{tfName:"pattern",name:"pattern",type:"string"},{tfName:"rewrite",name:"rewrite",type:"string"},{tfName:"replace_global",name:"replaceGlobal",type:"bool"}]},{tfOpName:"StringNGrams",category:"string",inputs:[{start:0,name:"data",type:"tensor"},{start:1,name:"dataSplits",type:"tensor"}],attrs:[{tfName:"separator",name:"separator",type:"string"},{tfName:"ngram_widths",name:"nGramWidths",type:"number[]"},{tfName:"left_pad",name:"leftPad",type:"string"},{tfName:"right_pad",name:"rightPad",type:"string"},{tfName:"pad_width",name:"padWidth",type:"number"},{tfName:"preserve_short_sequences",name:"preserveShortSequences",type:"bool"}],outputs:["ngrams","ngrams_splits"]},{tfOpName:"StringSplit",category:"string",inputs:[{start:0,name:"input",type:"tensor"},{start:1,name:"delimiter",type:"tensor"}],attrs:[{tfName:"skip_empty",name:"skipEmpty",type:"bool"}],outputs:["indices","values","shape"]},{tfOpName:"StringToHashBucketFast",category:"string",inputs:[{start:0,name:"input",type:"tensor"}],attrs:[{tfName:"num_buckets",name:"numBuckets",type:"number"}]}],bC=[{tfOpName:"Cast",category:"transformation",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"SrcT",name:"sdtype",type:"dtype",notSupported:!0},{tfName:"DstT",name:"dtype",type:"dtype"}]},{tfOpName:"ExpandDims",category:"transformation",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"axis",type:"number"}]},{tfOpName:"MirrorPad",category:"transformation",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"padding",type:"number[]"}],attrs:[{tfName:"mode",name:"mode",type:"string"}]},{tfOpName:"Pad",category:"transformation",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"padding",type:"number[]"}],attrs:[{tfName:"constant_value",name:"constantValue",type:"number",defaultValue:0}]},{tfOpName:"PadV2",category:"transformation",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"padding",type:"number[]"},{start:2,name:"constantValue",type:"number",defaultValue:0}]},{tfOpName:"Reshape",category:"transformation",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"shape",type:"number[]"}]},{tfOpName:"EnsureShape",category:"transformation",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"shape",type:"number[]"}]},{tfOpName:"Squeeze",category:"transformation",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"axis",tfDeprecatedName:"squeeze_dims",name:"axis",type:"number[]"}]},{tfOpName:"SpaceToBatchND",category:"transformation",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"blockShape",type:"number[]"},{start:2,name:"paddings",type:"number[]"}]},{tfOpName:"BatchToSpaceND",category:"transformation",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"blockShape",type:"number[]"},{start:2,name:"crops",type:"number[]"}]},{tfOpName:"DepthToSpace",category:"transformation",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"block_size",name:"blockSize",type:"number"},{tfName:"data_format",name:"dataFormat",type:"string"}]},{tfOpName:"BroadcastTo",category:"transformation",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"shape",type:"number[]"}],attrs:[]},{tfOpName:"BroadcastArgs",category:"transformation",inputs:[{start:0,name:"s0",type:"tensor"},{start:1,name:"s1",type:"tensor"}],attrs:[]}];class wC{static get Instance(){return this._instance||(this._instance=new this)}constructor(){const e=[].concat(...[a,i,o,l,u,c,h,d,p,f,m,g,y,b,w,v,x,A,k].map((e=>e.json)));this.opMappers=e.reduce(((e,t)=>(e[t.tfOpName]=t,e)),{})}transformGraph(e,t={}){const n=e.node,s=[],r=[],a=[],i=n.reduce(((e,t)=>(e[t.name]=this.mapNode(t),t.op.startsWith("Placeholder")?s.push(e[t.name]):"Const"===t.op?r.push(e[t.name]):null!=t.input&&0!==t.input.length||a.push(e[t.name]),e)),{});let o=[];const l=[];let u={},c={};null!=t&&(u=this.mapSignatureEntries(t.inputs),c=this.mapSignatureEntries(t.outputs));const h=Object.keys(i);h.forEach((e=>{const t=i[e];t.inputNames.forEach(((e,n)=>{const[s,,r]=Xk(e),a=i[s];if(null!=a.outputs){const e=a.outputs.indexOf(r);if(-1!==e){const r=`${s}:${e}`;t.inputNames[n]=r}}t.inputs.push(a),a.children.push(t)}))})),0===Object.keys(c).length?h.forEach((e=>{const t=i[e];0===t.children.length&&l.push(t)})):Object.keys(c).forEach((e=>{const[t]=Xk(e),n=i[t];null!=n&&(n.signatureKey=c[e],l.push(n))})),Object.keys(u).length>0?Object.keys(u).forEach((e=>{const[t]=Xk(e),n=i[t];n&&(n.signatureKey=u[e],o.push(n))})):o=s;let d={};null!=e.library&&null!=e.library.function&&(d=e.library.function.reduce(((e,t)=>(e[t.signature.name]=this.mapFunction(t),e)),{}));const p={nodes:i,inputs:o,outputs:l,weights:r,placeholders:s,signature:t,functions:d};return a.length>0&&(p.initNodes=a),p}mapSignatureEntries(e){return Object.keys(e||{}).reduce(((t,n)=>(t[e[n].name]=n,t)),{})}mapNode(e){const t=jk(e.op)||this.opMappers[e.op]||{};null==e.attr&&(e.attr={});const n={name:e.name,op:e.op,category:t.category,inputNames:(e.input||[]).map((e=>e.startsWith("^")?e.slice(1):e)),inputs:[],children:[],inputParams:{},attrParams:{},rawAttrs:e.attr,outputs:t.outputs};return null!=t.inputs&&(n.inputParams=t.inputs.reduce(((e,t)=>(e[t.name]={type:t.type,inputIndexStart:t.start,inputIndexEnd:t.end},e)),{})),null!=t.attrs&&(n.attrParams=t.attrs.reduce(((t,n)=>{const s=n.type;let r;switch(n.type){case"string":r=xC(e.attr,n.tfName,n.defaultValue),void 0===r&&n.tfDeprecatedName&&(r=xC(e.attr,n.tfDeprecatedName,n.defaultValue));break;case"string[]":r=OC(e.attr,n.tfName,n.defaultValue),void 0===r&&n.tfDeprecatedName&&(r=OC(e.attr,n.tfDeprecatedName,n.defaultValue));break;case"number":r=kC(e.attr,n.tfName,n.defaultValue||0),void 0===r&&n.tfDeprecatedName&&(r=kC(e.attr,n.tfDeprecatedName,n.defaultValue));break;case"number[]":r=NC(e.attr,n.tfName,n.defaultValue),void 0===r&&n.tfDeprecatedName&&(r=NC(e.attr,n.tfDeprecatedName,n.defaultValue));break;case"bool":r=AC(e.attr,n.tfName,n.defaultValue),void 0===r&&n.tfDeprecatedName&&(r=AC(e.attr,n.tfDeprecatedName,n.defaultValue));break;case"bool[]":r=DC(e.attr,n.tfName,n.defaultValue),void 0===r&&n.tfDeprecatedName&&(r=DC(e.attr,n.tfDeprecatedName,n.defaultValue));break;case"shape":r=TC(e.attr,n.tfName,n.defaultValue),void 0===r&&n.tfDeprecatedName&&(r=TC(e.attr,n.tfDeprecatedName,n.defaultValue));break;case"shape[]":r=RC(e.attr,n.tfName,n.defaultValue),void 0===r&&n.tfDeprecatedName&&(r=RC(e.attr,n.tfDeprecatedName,n.defaultValue));break;case"dtype":r=EC(e.attr,n.tfName,n.defaultValue),void 0===r&&n.tfDeprecatedName&&(r=EC(e.attr,n.tfDeprecatedName,n.defaultValue));break;case"dtype[]":r=_C(e.attr,n.tfName,n.defaultValue),void 0===r&&n.tfDeprecatedName&&(r=_C(e.attr,n.tfDeprecatedName,n.defaultValue));break;case"func":r=SC(e.attr,n.tfName,n.defaultValue),void 0===r&&n.tfDeprecatedName&&(r=SC(e.attr,n.tfDeprecatedName,n.defaultValue));break;case"tensor":case"tensors":break;default:throw new Error(`Unsupported param type: ${n.type} for op: ${e.op}`)}return t[n.name]={value:r,type:s},t}),{})),n}mapFunction(e){const t=e.nodeDef,n=[];let s={};null!=t&&(s=t.reduce(((e,t)=>(e[t.name]=this.mapNode(t),"Const"===t.op&&n.push(e[t.name]),e)),{}));const r=[],a=[];e.signature.inputArg.forEach((e=>{const[t]=Xk(e.name),n={name:t,op:"Placeholder",inputs:[],inputNames:[],category:"graph",inputParams:{},attrParams:{dtype:{value:CC(e.type),type:"dtype"}},children:[]};n.signatureKey=e.name,r.push(n),s[t]=n}));Object.keys(s).forEach((e=>{const t=s[e];t.inputNames.forEach(((e,n)=>{const[r,,a]=Xk(e),i=s[r];if(null!=i.outputs){const e=i.outputs.indexOf(a);if(-1!==e){const s=`${r}:${e}`;t.inputNames[n]=s}}t.inputs.push(i),i.children.push(t)}))}));const i=e.ret;e.signature.outputArg.forEach((e=>{const[t,n]=Xk(i[e.name]),r=s[t];null!=r&&(r.defaultOutput=n,a.push(r))}));const o=this.mapArgsToSignature(e);return{nodes:s,inputs:r,outputs:a,weights:n,placeholders:[],signature:o}}mapArgsToSignature(e){return{methodName:e.signature.name,inputs:e.signature.inputArg.reduce(((e,t)=>(e[t.name]=this.mapArgToTensorInfo(t),e)),{}),outputs:e.signature.outputArg.reduce(((t,n)=>(t[n.name]=this.mapArgToTensorInfo(n,e.ret),t)),{})}}mapArgToTensorInfo(e,t){let n=e.name;return null!=t&&(n=t[n]),{name:n,dtype:e.type}}}function vC(e,t){const n=Array.isArray(e)?String.fromCharCode.apply(null,e):function(e){const t=Sn().global;if(void 0!==t.atob)return t.atob(e);if("undefined"!=typeof Buffer)return new Buffer(e,"base64").toString();throw new Error("Unable to decode base64 in this environment. Missing built-in atob() or Buffer()")}(e);return t?n:n.toLowerCase()}function xC(e,t,n,s=!1){const r=e[t];return null!=r?vC(r.s,s):n}function AC(e,t,n){const s=e[t];return s?s.b:n}function kC(e,t,n){const s=e[t]||{},r=null!=s.i?s.i:null!=s.f?s.f:n;return"number"==typeof r?r:parseInt(r,10)}function CC(e){switch("string"==typeof e&&(e=Uk[e]),e){case Uk.DT_FLOAT:case Uk.DT_HALF:return"float32";case Uk.DT_INT32:case Uk.DT_INT64:case Uk.DT_INT8:case Uk.DT_UINT8:return"int32";case Uk.DT_BOOL:return"bool";case Uk.DT_DOUBLE:return"float32";case Uk.DT_STRING:return"string";case Uk.DT_COMPLEX64:case Uk.DT_COMPLEX128:return"complex64";default:return null}}function SC(e,t,n){const s=e[t];return s&&s.func?s.func.name:n}function EC(e,t,n){const s=e[t];return s&&s.type?CC(s.type):n}function _C(e,t,n){const s=e[t];return s&&s.list&&s.list.type?s.list.type.map((e=>CC(e))):n}function IC(e){if(!e.unknownRank)return null!=e.dim?e.dim.map((e=>"number"==typeof e.size?e.size:parseInt(e.size,10))):[]}function TC(e,t,n){const s=e[t];return s&&s.shape?IC(s.shape):n}function NC(e,t,n){const s=e[t];return s?((s.list.f&&s.list.f.length?s.list.f:s.list.i)||[]).map((e=>"number"==typeof e?e:parseInt(e,10))):n}function OC(e,t,n,s=!1){const r=e[t];return r&&r.list&&r.list.s?r.list.s.map((e=>vC(e,s))):n}function RC(e,t,n){const s=e[t];return s&&s.list&&s.list.shape?s.list.shape.map((e=>IC(e))):n}function DC(e,t,n){const s=e[t];return s&&s.list&&s.list.b?s.list.b:n}class MC{constructor(e,t,n){this.node=e,this.tensorMap=t,this.context=n,this.inputs=[],this.attrs={},this.inputs=e.inputNames.map((e=>this.getInput(e))),null!=e.rawAttrs&&(this.attrs=Object.keys(e.rawAttrs).reduce(((e,t)=>(e[t]=this.getAttr(t),e)),{}))}getInput(e){return $k(e,this.tensorMap,this.context)}getAttr(e,t){const n=this.node.rawAttrs[e];if(null!=n.tensor)return $k(e,this.tensorMap,this.context);if(null!=n.i||null!=n.f)return kC(this.node.rawAttrs,e,t);if(null!=n.s)return xC(this.node.rawAttrs,e,t);if(null!=n.b)return AC(this.node.rawAttrs,e,t);if(null!=n.shape)return TC(this.node.rawAttrs,e,t);if(null!=n.type)return EC(this.node.rawAttrs,e,t);if(null!=n.list){if(null!=n.list.i||null!=n.list.f)return NC(this.node.rawAttrs,e,t);if(null!=n.list.s)return OC(this.node.rawAttrs,e,t);if(null!=n.list.shape)return RC(this.node.rawAttrs,e,t);if(null!=n.list.b)return DC(this.node.rawAttrs,e,t);if(null!=n.list.type)return _C(this.node.rawAttrs,e,t)}return t}}function FC(e,t,n=""){if("number"!=typeof e&&"number"!=typeof t){qt(e.length===t.length,(()=>n+` Shapes ${e} and ${t} must match`));for(let s=0;sn+` Shapes ${e} and ${t} must match`))}}}function BC(e){return"number"!=typeof e&&!e.some((e=>e<0))}function zC(e,t,n){let s=LC(e,n);const r=!BC(s);if(r&&0===t.length)throw new Error(`Tried to calculate elements of an empty list with non-fully-defined elementShape: ${s}`);if(r&&t.forEach((e=>{s=LC(e.shape,s)})),!BC(s))throw new Error(`Non-fully-defined elementShape: ${s}`);return s}function LC(e,t){if("number"==typeof e)return t;if("number"==typeof t)return e;if(e.length!==t.length)throw new Error(`Incompatible ranks during merge: ${e} vs. ${t}`);const n=[];for(let s=0;s=0&&a>=0&&r!==a)throw new Error(`Incompatible shape during merge: ${e} vs. ${t}`);n[s]=r>=0?r:a}return n}class PC{constructor(e,t,n,s,r,a,i){this.name=e,this.dtype=t,this.maxSize=n,this.elementShape=s,this.identicalElementShapes=r,this.dynamicSize=a,this.clearAfterRead=i,this.tensors=[],this.closed_=!1,this.idTensor=Wl(0),Co(this.idTensor)}get id(){return this.idTensor.id}get closed(){return this.closed_}clearAndClose(e){this.tensors.forEach((t=>{null!=e&&e.has(t.tensor.id)||t.tensor.dispose()})),this.tensors=[],this.closed_=!0,this.idTensor.dispose()}size(){return this.tensors.length}read(e){if(this.closed_)throw new Error(`TensorArray ${this.name} has already been closed.`);if(e<0||e>=this.size())throw new Error(`Tried to read from index ${e}, but array size is: ${this.size()}`);const t=this.tensors[e];if(t.cleared)throw new Error(`TensorArray ${this.name}: Could not read index ${e} twice because it was cleared after a previous read (perhaps try setting clear_after_read = false?).`);return this.clearAfterRead&&(t.cleared=!0),t.read=!0,t.tensor}readMany(e){return e.map((e=>this.read(e)))}write(e,t){if(this.closed_)throw new Error(`TensorArray ${this.name} has already been closed.`);if(e<0||!this.dynamicSize&&e>=this.maxSize)throw new Error(`Tried to write to index ${e}, but array is not resizeable and size is: ${this.maxSize}`);const n=this.tensors[e]||{};if(t.dtype!==this.dtype)throw new Error(`TensorArray ${this.name}: Could not write to TensorArray index ${e},\n because the value dtype is ${t.dtype}, but TensorArray dtype is ${this.dtype}.`);if(0!==this.size()||null!=this.elementShape&&0!==this.elementShape.length||(this.elementShape=t.shape),FC(this.elementShape,t.shape,`TensorArray ${this.name}: Could not write to TensorArray index ${e}.`),n.read)throw new Error(`TensorArray ${this.name}: Could not write to TensorArray index ${e}, because it has already been read.`);if(n.written)throw new Error(`TensorArray ${this.name}: Could not write to TensorArray index ${e}, because it has already been written.`);n.tensor=t,Co(t),n.written=!0,this.tensors[e]=n}writeMany(e,t){if(e.length!==t.length)throw new Error(`TensorArray ${this.name}: could not write multiple tensors,because the index size: ${e.length} is not the same as tensors size: ${t.length}.`);e.forEach(((e,n)=>this.write(e,t[n])))}gather(e,t){if(t&&t!==this.dtype)throw new Error(`TensorArray dtype is ${this.dtype} but gather requested dtype ${t}`);if(e)e=e.slice(0,this.size());else{e=[];for(let t=0;t=this.maxSize)throw new Error(`Max index must be < array size (${n} vs. ${this.maxSize})`);this.writeMany(e,$p(t,0))}split(e,t){if(t.dtype!==this.dtype)throw new Error(`TensorArray dtype is ${this.dtype} but tensor has dtype ${t.dtype}`);let n=0;const s=e.map((e=>(n+=e,n)));if(n!==t.shape[0])throw new Error(`Expected sum of lengths to be equal to\n tensor.shape[0], but sum of lengths is\n ${n}, and tensor's shape is: ${t.shape}`);if(!this.dynamicSize&&e.length!==this.maxSize)throw new Error(`TensorArray's size is not equal to the size of lengths (${this.maxSize} vs. ${e.length}), and the TensorArray is not marked as dynamically resizeable`);const r=0===n?0:t.size/n,a=[];Ao((()=>{t=Tc(t,[1,n,r]);for(let n=0;n{if(n!==e.dtype)throw new Error(`Invalid data types; op elements ${n}, but list elements ${e.dtype}`);FC(t,e.shape,"TensorList shape mismatch: "),Co(e)})),this.idTensor=Wl(0),this.maxNumElements=s,Co(this.idTensor)}copy(){return new VC([...this.tensors],this.elementShape,this.elementDtype)}clearAndClose(e){this.tensors.forEach((t=>{null!=e&&e.has(t.id)||t.dispose()})),this.tensors.length=0,this.idTensor.dispose()}size(){return this.tensors.length}stack(e,t,n=-1){if(t!==this.elementDtype)throw new Error(`Invalid data types; op elements ${t}, but list elements ${this.elementDtype}`);if(-1!==n&&this.tensors.length!==n)throw new Error(`Operation expected a list with ${n} elements but got a list with ${this.tensors.length} elements.`);FC(e,this.elementShape,"TensorList shape mismatch: ");const s=zC(this.elementShape,this.tensors,e);return Ao((()=>{const e=this.tensors.map((e=>Tc(e,s)));return Np(e,0)}))}popBack(e,t){if(t!==this.elementDtype)throw new Error(`Invalid data types; op elements ${t}, but list elements ${this.elementDtype}`);if(0===this.size())throw new Error("Trying to pop from an empty list.");const n=zC(this.elementShape,this.tensors,e),s=this.tensors.pop();return s.kept=!1,FC(s.shape,e,"TensorList shape mismatch: "),Tc(s,n)}pushBack(e){if(e.dtype!==this.elementDtype)throw new Error(`Invalid data types; op elements ${e.dtype}, but list elements ${this.elementDtype}`);if(FC(e.shape,this.elementShape,"TensorList shape mismatch: "),this.maxNumElements===this.size())throw new Error("Trying to push element into a full list.");Co(e),this.tensors.push(e)}resize(e){if(e<0)throw new Error(`TensorListResize expects size to be non-negative. Got: ${e}`);if(-1!==this.maxNumElements&&e>this.maxNumElements)throw new Error(`TensorListResize input size ${e} is greater maxNumElement ${this.maxNumElements}.`);const t=new VC([],this.elementShape,this.elementDtype,this.maxNumElements);t.tensors.length=e;for(let n=0;nthis.tensors.length)throw new Error(`Trying to access element ${e} in a list with ${this.tensors.length} elements.`);if(null==this.tensors[e])throw new Error(`element at index ${e} is null.`);FC(this.tensors[e].shape,t,"TensorList shape mismatch: ");const s=zC(this.elementShape,this.tensors,t);return Tc(this.tensors[e],s)}setItem(e,t){if(t.dtype!==this.elementDtype)throw new Error(`Invalid data types; op elements ${t.dtype}, but list elements ${this.elementDtype}`);if(e<0||-1!==this.maxNumElements&&e>=this.maxNumElements)throw new Error(`Trying to set element ${e} in a list with max ${this.maxNumElements} elements.`);FC(this.elementShape,t.shape,"TensorList shape mismatch: "),Co(t),null!=this.tensors[e]&&(this.tensors[e].kept=!1),this.tensors[e]=t}gather(e,t,n){if(t!==this.elementDtype)throw new Error(`Invalid data types; op elements ${t}, but list elements ${this.elementDtype}`);FC(this.elementShape,n,"TensorList shape mismatch: "),e=e.slice(0,this.size());const s=zC(this.elementShape,this.tensors,n);return 0===e.length?yo([],[0].concat(s)):Ao((()=>{const t=e.map((e=>Tc(this.tensors[e],s)));return Np(t,0)}))}concat(e,t){if(e&&e!==this.elementDtype)throw new Error(`TensorList dtype is ${this.elementDtype} but concat requested dtype ${e}`);FC(this.elementShape,t,"TensorList shape mismatch: ");const n=zC(this.elementShape,this.tensors,t);return 0===this.size()?yo([],[0].concat(n)):Ao((()=>{const e=this.tensors.map((e=>Tc(e,n)));return Rc(e,0)}))}}const WC=async(e,t,n)=>{switch(e.op){case"If":case"StatelessIf":{const s=Hk("thenBranch",e,t,n),r=Hk("elseBranch",e,t,n),a=Hk("cond",e,t,n),i=Hk("args",e,t,n);return(await a.data())[0]?n.functionMap[s].executeFunctionAsync(i,n.tensorArrayMap,n.tensorListMap):n.functionMap[r].executeFunctionAsync(i,n.tensorArrayMap,n.tensorListMap)}case"While":case"StatelessWhile":{const s=Hk("body",e,t,n),r=Hk("cond",e,t,n),a=Hk("args",e,t,n),i=await n.functionMap[r].executeFunctionAsync(a,n.tensorArrayMap,n.tensorListMap),o=a.map((e=>e.id));let l=await i[0].data();i.forEach((e=>{e.kept||-1!==o.indexOf(e.id)||e.dispose()}));let u=a;for(;l[0];){const e=u;u=await n.functionMap[s].executeFunctionAsync(u,n.tensorArrayMap,n.tensorListMap);const t=u.map((e=>e.id));e.forEach((e=>{e.kept||-1!==o.indexOf(e.id)||-1!==t.indexOf(e.id)||e.dispose()}));const a=await n.functionMap[r].executeFunctionAsync(u,n.tensorArrayMap,n.tensorListMap);l=await a[0].data(),a.forEach((e=>{e.kept||-1!==o.indexOf(e.id)||-1!==t.indexOf(e.id)||e.dispose()}))}return u}case"LoopCond":return[Jk(Hk("pred",e,t,n))];case"Switch":{const s=Hk("pred",e,t,n);let r=Hk("data",e,t,n);return r.kept||(r=Jk(r)),(await s.data())[0]?[void 0,r]:[r,void 0]}case"Merge":{const s=e.inputNames.find((e=>void 0!==$k(e,t,n)));if(s){return[Jk($k(s,t,n))]}return}case"Enter":{const s=Hk("frameName",e,t,n),r=Hk("tensor",e,t,n);return n.enterFrame(s),[Jk(r)]}case"Exit":{const s=Hk("tensor",e,t,n);return n.exitFrame(),[Jk(s)]}case"NextIteration":{const s=Hk("tensor",e,t,n);return n.nextIteration(),[Jk(s)]}case"TensorArrayV3":{const s=Hk("size",e,t,n),r=Hk("dtype",e,t,n),a=Hk("elementShape",e,t,n),i=Hk("dynamicSize",e,t,n),o=Hk("clearAfterRead",e,t,n),l=Hk("identicalElementShapes",e,t,n),u=Hk("name",e,t,n),c=new PC(u,r,s,a,l,i,o);return n.addTensorArray(c),[c.idTensor,Wl(1)]}case"TensorArrayWriteV3":{const s=Hk("tensorArrayId",e,t,n),r=Hk("index",e,t,n),a=Hk("tensor",e,t,n),i=n.getTensorArray(s.id);return i.write(r,a),[i.idTensor]}case"TensorArrayReadV3":{const s=Hk("tensorArrayId",e,t,n),r=Hk("index",e,t,n);return[n.getTensorArray(s.id).read(r)]}case"TensorArrayGatherV3":{const s=Hk("tensorArrayId",e,t,n),r=Hk("indices",e,t,n),a=Hk("dtype",e,t,n);return[n.getTensorArray(s.id).gather(r,a)]}case"TensorArrayScatterV3":{const s=Hk("tensorArrayId",e,t,n),r=Hk("indices",e,t,n),a=Hk("tensor",e,t,n),i=n.getTensorArray(s.id);return i.scatter(r,a),[i.idTensor]}case"TensorArrayConcatV3":{const s=Hk("tensorArrayId",e,t,n),r=n.getTensorArray(s.id),a=Hk("dtype",e,t,n);return[r.concat(a)]}case"TensorArraySplitV3":{const s=Hk("tensorArrayId",e,t,n),r=Hk("tensor",e,t,n),a=Hk("lengths",e,t,n),i=n.getTensorArray(s.id);return i.split(a,r),[i.idTensor]}case"TensorArraySizeV3":{const s=Hk("tensorArrayId",e,t,n);return[Wl(n.getTensorArray(s.id).size(),"int32")]}case"TensorArrayCloseV3":{const s=Hk("tensorArrayId",e,t,n),r=n.getTensorArray(s.id);return r.clearAndClose(),[r.idTensor]}case"TensorListSetItem":{const s=Hk("tensorListId",e,t,n),r=Hk("index",e,t,n),a=Hk("tensor",e,t,n),i=n.getTensorList(s.id);return i.setItem(r,a),[i.idTensor]}case"TensorListGetItem":{const s=Hk("tensorListId",e,t,n),r=Hk("index",e,t,n),a=Hk("elementShape",e,t,n),i=Hk("elementDType",e,t,n);return[n.getTensorList(s.id).getItem(r,a,i)]}case"TensorListScatterV2":case"TensorListScatter":{const s=Hk("indices",e,t,n),r=function(e,t,n,s){if(t.length!==e.shape[0])throw new Error(`Expected len(indices) == tensor.shape[0], but saw: ${t.length} vs. ${e.shape[0]}`);const r=Math.max(...t);if(null!=s&&-1!==s&&r>=s)throw new Error(`Max index must be < array size (${r} vs. ${s})`);const a=new VC([],n,e.dtype,s),i=$p(e,0);return t.forEach(((e,t)=>{a.setItem(e,i[t])})),a}(Hk("tensor",e,t,n),s,Hk("elementShape",e,t,n),Hk("numElements",e,t,n));return n.addTensorList(r),[r.idTensor]}case"TensorListReserve":case"EmptyTensorList":{const s=Hk("elementShape",e,t,n),r=Hk("elementDType",e,t,n);let a;a="TensorListReserve"===e.op?"numElements":"maxNumElements";const i=Hk(a,e,t,n),o=function(e,t,n,s){return new VC([],e,t,s)}(s,r,0,"TensorListReserve"===e.op?-1:i);return n.addTensorList(o),[o.idTensor]}case"TensorListGather":{const s=Hk("tensorListId",e,t,n),r=Hk("indices",e,t,n),a=Hk("elementShape",e,t,n),i=Hk("elementDType",e,t,n);return[n.getTensorList(s.id).gather(r,i,a)]}case"TensorListStack":{const s=Hk("tensorListId",e,t,n),r=Hk("elementShape",e,t,n),a=Hk("elementDType",e,t,n),i=Hk("numElements",e,t,n);return[n.getTensorList(s.id).stack(r,a,i)]}case"TensorListFromTensor":{const s=function(e,t,n){const s=e.dtype;if(e.shape.length<1)throw new Error(`Tensor must be at least a vector, but saw shape: ${e.shape}`);if(e.dtype!==n)throw new Error(`Invalid data types; op elements ${e.dtype}, but list elements ${n}`);FC(e.shape.slice(1),t,"TensorList shape mismatch: ");const r=$p(e);return new VC(r,t,s)}(Hk("tensor",e,t,n),Hk("elementShape",e,t,n),Hk("elementDType",e,t,n));return n.addTensorList(s),[s.idTensor]}case"TensorListConcat":case"TensorListConcatV2":{const s=Hk("tensorListId",e,t,n),r=n.getTensorList(s.id),a=Hk("dtype",e,t,n),i=Hk("elementShape",e,t,n);return[r.concat(a,i)]}case"TensorListPushBack":{const s=Hk("tensorListId",e,t,n),r=Hk("tensor",e,t,n),a=n.getTensorList(s.id);return a.pushBack(r),[a.idTensor]}case"TensorListPopBack":{const s=Hk("tensorListId",e,t,n),r=Hk("elementShape",e,t,n),a=Hk("elementDType",e,t,n);return[n.getTensorList(s.id).popBack(r,a)]}case"TensorListSplit":{const s=Hk("tensor",e,t,n),r=Hk("elementShape",e,t,n),a=function(e,t,n){let s=0;const r=t.map((e=>(s+=e,s)));if(s!==e.shape[0])throw new Error(`Expected sum of lengths to be equal to\n tensor.shape[0], but sum of lengths is\n ${s}, and tensor's shape is: ${e.shape}`);const a=LC(e.shape.slice(1),n),i=0===s?0:e.size/s,o=Ao((()=>{const n=[];e=Tc(e,[1,s,i]);for(let s=0;se.dispose())),this.tensorMap.clear(),this.handle.dispose()}size(){return this.tensorMap.size}tensorSize(){return Wl(this.size(),"int32")}async import(e,t){this.checkKeyAndValueTensor(e,t);const n=await e.data();return this.tensorMap.forEach((e=>e.dispose())),this.tensorMap.clear(),Ao((()=>{const e=$p(t),s=n.length,r=e.length;qt(s===r,(()=>`The number of elements doesn't match, keys has ${s} elements, the values has ${r} elements.`));for(let t=0;t{const e=[];for(let s=0;s{switch(e.category){case"arithmetic":return r((()=>((e,t,n,s=C)=>{switch(e.op){case"BiasAdd":case"AddV2":case"Add":return[s.add(Hk("a",e,t,n),Hk("b",e,t,n))];case"AddN":return[s.addN(Hk("tensors",e,t,n))];case"FloorMod":case"Mod":return[s.mod(Hk("a",e,t,n),Hk("b",e,t,n))];case"Mul":return[s.mul(Hk("a",e,t,n),Hk("b",e,t,n))];case"RealDiv":case"Div":return[s.div(Hk("a",e,t,n),Hk("b",e,t,n))];case"DivNoNan":return[s.divNoNan(Hk("a",e,t,n),Hk("b",e,t,n))];case"FloorDiv":return[s.floorDiv(Hk("a",e,t,n),Hk("b",e,t,n))];case"Sub":return[s.sub(Hk("a",e,t,n),Hk("b",e,t,n))];case"Minimum":return[s.minimum(Hk("a",e,t,n),Hk("b",e,t,n))];case"Maximum":return[s.maximum(Hk("a",e,t,n),Hk("b",e,t,n))];case"Pow":return[s.pow(Hk("a",e,t,n),Hk("b",e,t,n))];case"SquaredDifference":return[s.squaredDifference(Hk("a",e,t,n),Hk("b",e,t,n))];default:throw TypeError(`Node type ${e.op} is not implemented`)}})(e,t,n)));case"basic_math":return r((()=>((e,t,n,s=C)=>{switch(e.op){case"Abs":case"ComplexAbs":return[s.abs(Hk("x",e,t,n))];case"Acos":return[s.acos(Hk("x",e,t,n))];case"Acosh":return[s.acosh(Hk("x",e,t,n))];case"Asin":return[s.asin(Hk("x",e,t,n))];case"Asinh":return[s.asinh(Hk("x",e,t,n))];case"Atan":return[s.atan(Hk("x",e,t,n))];case"Atan2":return[s.atan2(Hk("x",e,t,n),Hk("y",e,t,n))];case"Atanh":return[s.atanh(Hk("x",e,t,n))];case"Ceil":return[s.ceil(Hk("x",e,t,n))];case"Complex":return[s.complex(Hk("real",e,t,n),Hk("imag",e,t,n))];case"Cos":return[s.cos(Hk("x",e,t,n))];case"Cosh":return[s.cosh(Hk("x",e,t,n))];case"Elu":return[s.elu(Hk("x",e,t,n))];case"Erf":return[s.erf(Hk("x",e,t,n))];case"Exp":return[s.exp(Hk("x",e,t,n))];case"Expm1":return[s.expm1(Hk("x",e,t,n))];case"Floor":return[s.floor(Hk("x",e,t,n))];case"Log":return[s.log(Hk("x",e,t,n))];case"Log1p":return[s.log1p(Hk("x",e,t,n))];case"Imag":return[s.imag(Hk("x",e,t,n))];case"Neg":return[s.neg(Hk("x",e,t,n))];case"Reciprocal":return[s.reciprocal(Hk("x",e,t,n))];case"Real":return[s.real(Hk("x",e,t,n))];case"Relu":return[s.relu(Hk("x",e,t,n))];case"Round":return[s.round(Hk("x",e,t,n))];case"Selu":return[s.selu(Hk("x",e,t,n))];case"Sigmoid":return[s.sigmoid(Hk("x",e,t,n))];case"Sin":return[s.sin(Hk("x",e,t,n))];case"Sign":return[s.sign(Hk("x",e,t,n))];case"Sinh":return[s.sinh(Hk("x",e,t,n))];case"Softplus":return[s.softplus(Hk("x",e,t,n))];case"Sqrt":return[s.sqrt(Hk("x",e,t,n))];case"Square":return[s.square(Hk("x",e,t,n))];case"Tanh":return[s.tanh(Hk("x",e,t,n))];case"Tan":return[s.tan(Hk("x",e,t,n))];case"ClipByValue":return[s.clipByValue(Hk("x",e,t,n),Hk("clipValueMin",e,t,n),Hk("clipValueMax",e,t,n))];case"Relu6":return[s.relu6(Hk("x",e,t,n))];case"Rsqrt":return[s.rsqrt($k(e.inputNames[0],t,n))];case"LeakyRelu":return[s.leakyRelu(Hk("x",e,t,n),Hk("alpha",e,t,n))];case"Prelu":return[s.prelu(Hk("x",e,t,n),Hk("alpha",e,t,n))];case"IsNan":return[s.isNaN($k(e.inputNames[0],t,n))];case"IsInf":return[s.isInf($k(e.inputNames[0],t,n))];case"IsFinite":return[s.isFinite($k(e.inputNames[0],t,n))];default:throw TypeError(`Node type ${e.op} is not implemented`)}})(e,t,n)));case"control":return WC(e,t,n);case"convolution":return r((()=>((e,t,n,s=C)=>{switch(e.op){case"Conv1D":{const r=Hk("stride",e,t,n),a=Hk("pad",e,t,n),i=Hk("dataFormat",e,t,n).toUpperCase(),o=Hk("dilation",e,t,n);return[s.conv1d(Hk("x",e,t,n),Hk("filter",e,t,n),r,a,i,o)]}case"Conv2D":{const r=Hk("strides",e,t,n),a=Qk(e,t,n),i=Hk("dataFormat",e,t,n).toUpperCase(),o=Hk("dilations",e,t,n);return[s.conv2d(Hk("x",e,t,n),Hk("filter",e,t,n),[r[1],r[2]],a,i,[o[1],o[2]])]}case"_FusedConv2D":{const{stride:r,pad:a,dataFormat:i,dilations:o,biasArg:l,preluArg:u,activationFunc:c,leakyreluAlpha:h}=UC(e,t,n);return[s.fused.conv2d({x:Hk("x",e,t,n),filter:Hk("filter",e,t,n),strides:[r[1],r[2]],pad:a,dataFormat:i,dilations:[o[1],o[2]],bias:l,activation:c,preluActivationWeights:u,leakyreluAlpha:h})]}case"FusedDepthwiseConv2dNative":{const{stride:r,pad:a,dataFormat:i,dilations:o,biasArg:l,preluArg:u,activationFunc:c,leakyreluAlpha:h}=UC(e,t,n);return[s.fused.depthwiseConv2d({x:Hk("x",e,t,n),filter:Hk("filter",e,t,n),strides:[r[1],r[2]],pad:a,dataFormat:i,dilations:[o[1],o[2]],bias:l,activation:c,preluActivationWeights:u,leakyreluAlpha:h})]}case"Conv2DBackpropInput":case"Conv2dTranspose":{const r=Hk("outputShape",e,t,n),a=Hk("strides",e,t,n),i=Qk(e,t,n);return[s.conv2dTranspose(Hk("x",e,t,n),Hk("filter",e,t,n),r,[a[1],a[2]],i)]}case"DepthwiseConv2dNative":case"DepthwiseConv2d":{const r=Hk("strides",e,t,n),a=Qk(e,t,n),i=Hk("dilations",e,t,n),o=Hk("dataFormat",e,t,n).toUpperCase();return[s.depthwiseConv2d(Hk("input",e,t,n),Hk("filter",e,t,n),[r[1],r[2]],a,o,[i[1],i[2]])]}case"Conv3D":{const r=Hk("strides",e,t,n),a=Hk("pad",e,t,n),i=Hk("dataFormat",e,t,n).toUpperCase(),o=Hk("dilations",e,t,n);return[s.conv3d(Hk("x",e,t,n),Hk("filter",e,t,n),[r[1],r[2],r[3]],a,i,[o[1],o[2],o[3]])]}case"AvgPool":{const r=Hk("strides",e,t,n),a=Hk("pad",e,t,n),i=Hk("kernelSize",e,t,n);return[s.avgPool(Hk("x",e,t,n),[i[1],i[2]],[r[1],r[2]],a)]}case"MaxPool":{const r=Hk("strides",e,t,n),a=Hk("pad",e,t,n),i=Hk("kernelSize",e,t,n);return[s.maxPool(Hk("x",e,t,n),[i[1],i[2]],[r[1],r[2]],a)]}case"MaxPoolWithArgmax":{const r=Hk("strides",e,t,n),a=Hk("pad",e,t,n),i=Hk("kernelSize",e,t,n),o=Hk("includeBatchInIndex",e,t,n),{result:l,indexes:u}=s.maxPoolWithArgmax(Hk("x",e,t,n),[i[1],i[2]],[r[1],r[2]],a,o);return[l,u]}case"AvgPool3D":{const r=Hk("strides",e,t,n),a=Hk("pad",e,t,n),i=Hk("kernelSize",e,t,n);return[s.avgPool3d(Hk("x",e,t,n),[i[1],i[2],i[3]],[r[1],r[2],r[3]],a)]}case"MaxPool3D":{const r=Hk("strides",e,t,n),a=Hk("pad",e,t,n),i=Hk("kernelSize",e,t,n);return[s.maxPool3d(Hk("x",e,t,n),[i[1],i[2],i[3]],[r[1],r[2],r[3]],a)]}case"Dilation2D":{const r=Hk("strides",e,t,n),a=Hk("pad",e,t,n),i=Hk("dilations",e,t,n),o=r[1],l=r[2],u=i[1],c=i[2];return[s.dilation2d(Hk("x",e,t,n),Hk("filter",e,t,n),[o,l],a,[u,c],"NHWC")]}default:throw TypeError(`Node type ${e.op} is not implemented`)}})(e,t,n)));case"creation":return r((()=>((e,t,n,s=C)=>{switch(e.op){case"Fill":{const r=Hk("shape",e,t,n),a=Hk("dtype",e,t,n),i=Hk("value",e,t,n);return[s.fill(r,i,a)]}case"LinSpace":{const r=Hk("start",e,t,n),a=Hk("stop",e,t,n),i=Hk("num",e,t,n);return[s.linspace(r,a,i)]}case"Multinomial":{const r=Hk("logits",e,t,n),a=Hk("numSamples",e,t,n),i=Hk("seed",e,t,n);return[s.multinomial(r,a,i)]}case"OneHot":{const r=Hk("indices",e,t,n),a=Hk("depth",e,t,n),i=Hk("onValue",e,t,n),o=Hk("offValue",e,t,n),l=Hk("dtype",e,t,n);return[s.oneHot(r,a,i,o,l)]}case"Ones":return[s.ones(Hk("shape",e,t,n),Hk("dtype",e,t,n))];case"OnesLike":return[s.onesLike(Hk("x",e,t,n))];case"RandomStandardNormal":return[s.randomStandardNormal(Hk("shape",e,t,n),Hk("dtype",e,t,n),Hk("seed",e,t,n))];case"RandomUniform":return[s.randomUniform(Hk("shape",e,t,n),Hk("minval",e,t,n),Hk("maxval",e,t,n),Hk("dtype",e,t,n))];case"RandomUniformInt":return[s.randomUniformInt(Hk("shape",e,t,n),Hk("minval",e,t,n),Hk("maxval",e,t,n),Hk("seed",e,t,n))];case"Range":{const r=Hk("start",e,t,n),a=Hk("stop",e,t,n),i=Hk("step",e,t,n);return[s.range(r,a,i,Hk("dtype",e,t,n))]}case"TruncatedNormal":{const r=Hk("shape",e,t,n),a=Hk("mean",e,t,n),i=Hk("stdDev",e,t,n),o=Hk("seed",e,t,n);return[s.truncatedNormal(r,a,i,Hk("dtype",e,t,n),o)]}case"Zeros":return[s.zeros(Hk("shape",e,t,n),Hk("dtype",e,t,n))];case"ZerosLike":return[s.zerosLike(Hk("x",e,t,n))];default:throw TypeError(`Node type ${e.op} is not implemented`)}})(e,t,n)));case"dynamic":return(async(e,t,n,s,r=C)=>{switch(e.op){case"NonMaxSuppressionV5":{const{boxes:s,scores:a,maxOutputSize:i,iouThreshold:o,scoreThreshold:l,softNmsSigma:u}=GC(e,t,n),c=await r.image.nonMaxSuppressionWithScoreAsync(s,a,i,o,l,u);return[c.selectedIndices,c.selectedScores]}case"NonMaxSuppressionV4":{const{boxes:s,scores:a,maxOutputSize:i,iouThreshold:o,scoreThreshold:l}=GC(e,t,n),u=Hk("padToMaxOutputSize",e,t,n),c=await r.image.nonMaxSuppressionPaddedAsync(s,a,i,o,l,u);return[c.selectedIndices,c.validOutputs]}case"NonMaxSuppressionV3":case"NonMaxSuppressionV2":{const{boxes:s,scores:a,maxOutputSize:i,iouThreshold:o,scoreThreshold:l}=GC(e,t,n);return[await r.image.nonMaxSuppressionAsync(s,a,i,o,l)]}case"Where":{const s=r.cast(Hk("condition",e,t,n),"bool"),a=[await r.whereAsync(s)];return s.dispose(),a}case"ListDiff":return r.setdiff1dAsync(Hk("x",e,t,n),Hk("y",e,t,n));default:throw TypeError(`Node type ${e.op} is not implemented`)}})(e,t,n);case"evaluation":return r((()=>((e,t,n,s=C)=>{switch(e.op){case"LowerBound":{const r=Hk("sortedSequence",e,t,n),a=Hk("values",e,t,n);return[s.lowerBound(r,a)]}case"TopKV2":{const r=Hk("x",e,t,n),a=Hk("k",e,t,n),i=Hk("sorted",e,t,n),o=s.topk(r,a,i);return[o.values,o.indices]}case"UpperBound":{const r=Hk("sortedSequence",e,t,n),a=Hk("values",e,t,n);return[s.upperBound(r,a)]}case"Unique":{const r=Hk("x",e,t,n),a=s.unique(r);return[a.values,a.indices]}case"UniqueV2":{const r=Hk("x",e,t,n),a=Hk("axis",e,t,n),i=s.unique(r,a);return[i.values,i.indices]}default:throw TypeError(`Node type ${e.op} is not implemented`)}})(e,t,n)));case"image":return r((()=>((e,t,n,s=C)=>{switch(e.op){case"ResizeBilinear":{const r=Hk("images",e,t,n),a=Hk("size",e,t,n),i=Hk("alignCorners",e,t,n),o=Hk("halfPixelCenters",e,t,n);return[s.image.resizeBilinear(r,[a[0],a[1]],i,o)]}case"ResizeNearestNeighbor":{const r=Hk("images",e,t,n),a=Hk("size",e,t,n),i=Hk("alignCorners",e,t,n),o=Hk("halfPixelCenters",e,t,n);return[s.image.resizeNearestNeighbor(r,[a[0],a[1]],i,o)]}case"CropAndResize":{const r=Hk("image",e,t,n),a=Hk("boxes",e,t,n),i=Hk("boxInd",e,t,n),o=Hk("cropSize",e,t,n),l=Hk("method",e,t,n),u=Hk("extrapolationValue",e,t,n);return[s.image.cropAndResize(r,a,i,o,l,u)]}case"ImageProjectiveTransformV3":{const r=Hk("images",e,t,n),a=Hk("transforms",e,t,n),i=Hk("outputShape",e,t,n),o=Hk("fillValue",e,t,n),l=Hk("interpolation",e,t,n),u=Hk("fillMode",e,t,n);return[s.image.transform(r,a,l.toLowerCase(),u.toLowerCase(),o,i)]}default:throw TypeError(`Node type ${e.op} is not implemented`)}})(e,t,n)));case"graph":return r((()=>((e,t,n,s=C)=>{switch(e.op){case"Const":return t[e.name];case"PlaceholderWithDefault":const r=Hk("default",e,t,n);return[$k(e.name,t,n)||r];case"Placeholder":return[$k(e.name,t,n)];case"Identity":case"StopGradient":case"FakeQuantWithMinMaxVars":case"Snapshot":return[Jk(Hk("x",e,t,n))];case"IdentityN":return Hk("x",e,t,n).map((e=>Jk(e)));case"Shape":return[s.tensor1d(Hk("x",e,t,n).shape,"int32")];case"ShapeN":return Hk("x",e,t,n).map((e=>s.tensor1d(e.shape)));case"Size":return[s.scalar(Hk("x",e,t,n).size,"int32")];case"Rank":return[s.scalar(Hk("x",e,t,n).rank,"int32")];case"NoOp":return[s.scalar(1)];case"Print":const a=Hk("x",e,t,n),i=Hk("data",e,t,n);Hk("message",e,t,n),Hk("summarize",e,t,n);for(let e=0;e((e,t,n,s=C)=>{switch(e.op){case"Equal":return[s.equal(Hk("a",e,t,n),Hk("b",e,t,n))];case"NotEqual":return[s.notEqual(Hk("a",e,t,n),Hk("b",e,t,n))];case"Greater":return[s.greater(Hk("a",e,t,n),Hk("b",e,t,n))];case"GreaterEqual":return[s.greaterEqual(Hk("a",e,t,n),Hk("b",e,t,n))];case"Less":return[s.less(Hk("a",e,t,n),Hk("b",e,t,n))];case"LessEqual":return[s.lessEqual(Hk("a",e,t,n),Hk("b",e,t,n))];case"LogicalAnd":return[s.logicalAnd(Hk("a",e,t,n),Hk("b",e,t,n))];case"LogicalNot":return[s.logicalNot(Hk("a",e,t,n))];case"LogicalOr":return[s.logicalOr(Hk("a",e,t,n),Hk("b",e,t,n))];case"Select":case"SelectV2":return[s.where(Hk("condition",e,t,n),Hk("a",e,t,n),Hk("b",e,t,n))];case"BitwiseAnd":return[s.bitwiseAnd(Hk("a",e,t,n),Hk("b",e,t,n))];default:throw TypeError(`Node type ${e.op} is not implemented`)}})(e,t,n)));case"matrices":return r((()=>((e,t,n,s=C)=>{switch(e.op){case"BatchMatMul":case"BatchMatMulV2":case"MatMul":return[s.matMul(Hk("a",e,t,n),Hk("b",e,t,n),Hk("transposeA",e,t,n),Hk("transposeB",e,t,n))];case"Einsum":return[s.einsum(Hk("equation",e,t,n),...Hk("tensors",e,t,n))];case"Transpose":return[s.transpose(Hk("x",e,t,n),Hk("perm",e,t,n))];case"_FusedMatMul":const[r,a]=Hk("fusedOps",e,t,n),i="biasadd"===r,o="prelu"===a,l=Hk("numArgs",e,t,n),u=Hk("leakyreluAlpha",e,t,n);if(i){if(o&&2!==l)throw new Error("Fused MatMul with BiasAdd and Prelu must have two extra arguments: bias and alpha.");if(!o&&1!==l)throw new Error("Fused MatMul with BiasAdd must have one extra argument: bias.")}const[c,h]=Hk("args",e,t,n);return[s.fused.matMul({a:Hk("a",e,t,n),b:Hk("b",e,t,n),transposeA:Hk("transposeA",e,t,n),transposeB:Hk("transposeB",e,t,n),bias:c,activation:a,preluActivationWeights:h,leakyreluAlpha:u})];case"MatrixBandPart":return[s.linalg.bandPart(Hk("a",e,t,n),Hk("numLower",e,t,n),Hk("numUpper",e,t,n))];default:throw TypeError(`Node type ${e.op} is not implemented`)}})(e,t,n)));case"normalization":return r((()=>((e,t,n,s=C)=>{switch(e.op){case"EuclideanNorm":return[s.euclideanNorm(Hk("x",e,t,n),Hk("axis",e,t,n),Hk("keepDims",e,t,n))];case"FusedBatchNorm":case"FusedBatchNormV2":case"FusedBatchNormV3":return[s.batchNorm(Hk("x",e,t,n),Hk("mean",e,t,n),Hk("variance",e,t,n),Hk("offset",e,t,n),Hk("scale",e,t,n),Hk("epsilon",e,t,n))];case"LRN":return[s.localResponseNormalization(Hk("x",e,t,n),Hk("radius",e,t,n),Hk("bias",e,t,n),Hk("alpha",e,t,n),Hk("beta",e,t,n))];case"Softmax":return[s.softmax(Hk("x",e,t,n))];case"LogSoftmax":return[s.logSoftmax(Hk("x",e,t,n))];default:throw TypeError(`Node type ${e.op} is not implemented`)}})(e,t,n)));case"ragged":return r((()=>((e,t,n,s=C)=>{switch(e.op){case"RaggedGather":{const{outputNestedSplits:r,outputDenseValues:a}=s.raggedGather(Hk("paramsNestedSplits",e,t,n),Hk("paramsDenseValues",e,t,n),Hk("indices",e,t,n),Hk("outputRaggedRank",e,t,n));return r.concat(a)}case"RaggedRange":{const{rtNestedSplits:r,rtDenseValues:a}=s.raggedRange(Hk("starts",e,t,n),Hk("limits",e,t,n),Hk("splits",e,t,n));return[r,a]}case"RaggedTensorToTensor":return[s.raggedTensorToTensor(Hk("shape",e,t,n),Hk("values",e,t,n),Hk("defaultValue",e,t,n),Hk("rowPartitionTensors",e,t,n),Hk("rowPartitionTypes",e,t,n))];default:throw TypeError(`Node type ${e.op} is not implemented`)}})(e,t,n)));case"reduction":return r((()=>((e,t,n,s=C)=>{switch(e.op){case"Max":{const r=Hk("axis",e,t,n),a=Hk("keepDims",e,t,n);return[s.max(Hk("x",e,t,n),r,a)]}case"Mean":{const r=Hk("axis",e,t,n),a=Hk("keepDims",e,t,n);return[s.mean(Hk("x",e,t,n),r,a)]}case"Min":{const r=Hk("axis",e,t,n),a=Hk("keepDims",e,t,n);return[s.min(Hk("x",e,t,n),r,a)]}case"Sum":{const r=Hk("axis",e,t,n),a=Hk("keepDims",e,t,n);return[s.sum(Hk("x",e,t,n),r,a)]}case"All":{const r=Hk("axis",e,t,n),a=Hk("keepDims",e,t,n);return[s.all(Hk("x",e,t,n),r,a)]}case"Any":{const r=Hk("axis",e,t,n),a=Hk("keepDims",e,t,n);return[s.any(Hk("x",e,t,n),r,a)]}case"ArgMax":{const r=Hk("axis",e,t,n);return[s.argMax(Hk("x",e,t,n),r)]}case"ArgMin":{const r=Hk("axis",e,t,n);return[s.argMin(Hk("x",e,t,n),r)]}case"Prod":{const r=Hk("axis",e,t,n),a=Hk("keepDims",e,t,n);return[s.prod(Hk("x",e,t,n),r,a)]}case"Cumprod":{const r=Hk("axis",e,t,n),a=Hk("exclusive",e,t,n),i=Hk("reverse",e,t,n);return[s.cumprod(Hk("x",e,t,n),r,a,i)]}case"Cumsum":{const r=Hk("axis",e,t,n),a=Hk("exclusive",e,t,n),i=Hk("reverse",e,t,n);return[s.cumsum(Hk("x",e,t,n),r,a,i)]}case"Bincount":const r=Hk("x",e,t,n),a=Hk("weights",e,t,n),i=Hk("size",e,t,n);return[s.bincount(r,a,i)];case"DenseBincount":{const r=Hk("x",e,t,n),a=Hk("weights",e,t,n),i=Hk("size",e,t,n),o=Hk("binaryOutput",e,t,n);return[s.denseBincount(r,a,i,o)]}default:throw TypeError(`Node type ${e.op} is not implemented`)}})(e,t,n)));case"slice_join":return r((()=>((e,t,n,s=C)=>{switch(e.op){case"ConcatV2":case"Concat":{const r=Hk("n",e,t,n),a=Hk("axis",e,t,n);let i=Hk("tensors",e,t,n);return i=i.slice(0,r),[s.concat(i,a)]}case"Gather":{const r=Hk("x",e,t,n),a=Hk("indices",e,t,n);return[s.gather(r,s.cast(a,"int32"),0)]}case"GatherV2":{const r=Hk("axis",e,t,n),a=Hk("batchDims",e,t,n),i=Hk("x",e,t,n),o=Hk("indices",e,t,n);return[s.gather(i,s.cast(o,"int32"),r,a)]}case"Reverse":{const r=Hk("dims",e,t,n),a=[];for(let e=0;e{const r=Hk("axis",e,t,n),a=Hk("tensors",e,t,n),i=a[0].shape,o=s.squeeze(a[0]).shape,l=a.map((e=>{const t=Kt(e.shape,i);if(!t&&!Kt(s.squeeze(e).shape,o))throw new Error("the input tensors shape does not match");return t?e:s.reshape(e,i)}));return[s.stack(l,r)]}));case"Unpack":{const r=Hk("axis",e,t,n),a=Hk("tensor",e,t,n);return s.unstack(a,r)}case"Tile":{const r=Hk("reps",e,t,n);return[s.tile(Hk("x",e,t,n),r)]}case"Split":case"SplitV":{const r=Hk("axis",e,t,n),a=Hk("numOrSizeSplits",e,t,n),i=Hk("x",e,t,n);return s.split(i,a,r)}case"ScatterNd":{const r=Hk("indices",e,t,n),a=Hk("values",e,t,n),i=Hk("shape",e,t,n);return[s.scatterND(r,a,i)]}case"GatherNd":{const r=Hk("x",e,t,n),a=Hk("indices",e,t,n);return[s.gatherND(r,a)]}case"SparseToDense":{const r=Hk("sparseIndices",e,t,n),a=Hk("outputShape",e,t,n),i=Hk("sparseValues",e,t,n),o=Hk("defaultValue",e,t,n);return[s.sparseToDense(r,i,a,i.dtype===o.dtype?o:s.cast(o,i.dtype))]}case"TensorScatterUpdate":{const r=Hk("indices",e,t,n),a=Hk("values",e,t,n),i=Hk("tensor",e,t,n);return[s.tensorScatterUpdate(i,r,a)]}default:throw TypeError(`Node type ${e.op} is not implemented`)}})(e,t,n)));case"sparse":return r((()=>((e,t,n,s=C)=>{switch(e.op){case"SparseFillEmptyRows":{const{outputIndices:r,outputValues:a,emptyRowIndicator:i,reverseIndexMap:o}=s.sparse.sparseFillEmptyRows(Hk("indices",e,t,n),Hk("values",e,t,n),Hk("denseShape",e,t,n),Hk("defaultValue",e,t,n));return[r,a,i,o]}case"SparseReshape":{const{outputIndices:r,outputShape:a}=s.sparse.sparseReshape(Hk("inputIndices",e,t,n),Hk("inputShape",e,t,n),Hk("newShape",e,t,n));return[r,a]}case"SparseSegmentMean":return[s.sparse.sparseSegmentMean(Hk("data",e,t,n),Hk("indices",e,t,n),Hk("segmentIds",e,t,n))];case"SparseSegmentSum":return[s.sparse.sparseSegmentSum(Hk("data",e,t,n),Hk("indices",e,t,n),Hk("segmentIds",e,t,n))];default:throw TypeError(`Node type ${e.op} is not implemented`)}})(e,t,n)));case"spectral":return r((()=>((e,t,n,s=C)=>{switch(e.op){case"FFT":return[s.fft(Hk("x",e,t,n))];case"IFFT":return[s.ifft(Hk("x",e,t,n))];case"RFFT":return[s.rfft(Hk("x",e,t,n))];case"IRFFT":return[s.irfft(Hk("x",e,t,n))];default:throw TypeError(`Node type ${e.op} is not implemented`)}})(e,t,n)));case"string":return r((()=>((e,t,n,s=C)=>{switch(e.op){case"StaticRegexReplace":return[s.string.staticRegexReplace(Hk("input",e,t,n),Hk("pattern",e,t,n),Hk("rewrite",e,t,n),Hk("replaceGlobal",e,t,n))];case"StringNGrams":{const{nGrams:r,nGramsSplits:a}=s.string.stringNGrams(Hk("data",e,t,n),Hk("dataSplits",e,t,n),Hk("separator",e,t,n),Hk("nGramWidths",e,t,n),Hk("leftPad",e,t,n),Hk("rightPad",e,t,n),Hk("padWidth",e,t,n),Hk("preserveShortSequences",e,t,n));return[r,a]}case"StringSplit":{const{indices:r,values:a,shape:i}=s.string.stringSplit(Hk("input",e,t,n),Hk("delimiter",e,t,n),Hk("skipEmpty",e,t,n));return[r,a,i]}case"StringToHashBucketFast":return[s.string.stringToHashBucketFast(Hk("input",e,t,n),Hk("numBuckets",e,t,n))];default:throw TypeError(`Node type ${e.op} is not implemented`)}})(e,t,n)));case"transformation":return r((()=>((e,t,n,s=C)=>{switch(e.op){case"Cast":return[s.cast(Hk("x",e,t,n),Hk("dtype",e,t,n))];case"ExpandDims":{const r=Hk("axis",e,t,n);return[s.expandDims(Hk("x",e,t,n),r)]}case"Squeeze":{const r=Hk("axis",e,t,n);return[s.squeeze(Hk("x",e,t,n),r)]}case"Reshape":return[s.reshape(Hk("x",e,t,n),Hk("shape",e,t,n))];case"EnsureShape":return[s.ensureShape(Hk("x",e,t,n),Hk("shape",e,t,n))];case"MirrorPad":return[s.mirrorPad(Hk("x",e,t,n),Hk("padding",e,t,n),Hk("mode",e,t,n))];case"PadV2":case"Pad":return[s.pad(Hk("x",e,t,n),Hk("padding",e,t,n),Hk("constantValue",e,t,n))];case"SpaceToBatchND":{const r=Hk("blockShape",e,t,n),a=Hk("paddings",e,t,n);return[s.spaceToBatchND(Hk("x",e,t,n),r,a)]}case"BatchToSpaceND":{const r=Hk("blockShape",e,t,n),a=Hk("crops",e,t,n);return[s.batchToSpaceND(Hk("x",e,t,n),r,a)]}case"DepthToSpace":{const r=Hk("blockSize",e,t,n),a=Hk("dataFormat",e,t,n).toUpperCase();return[s.depthToSpace(Hk("x",e,t,n),r,a)]}case"BroadcastTo":return[s.broadcastTo(Hk("x",e,t,n),Hk("shape",e,t,n))];case"BroadcastArgs":return[s.broadcastArgs(Hk("s0",e,t,n),Hk("s1",e,t,n))];default:throw TypeError(`Node type ${e.op} is not implemented`)}})(e,t,n)));case"hash_table":return(async(e,t,n,s)=>{switch(e.op){case"HashTable":case"HashTableV2":{const r=s.getHashTableHandleByName(e.name);if(null!=r)return[r];{const r=Hk("keyDType",e,t,n),a=Hk("valueDType",e,t,n),i=new qC(r,a);return s.addHashTable(e.name,i),[i.handle]}}case"InitializeTable":case"InitializeTableV2":case"LookupTableImport":case"LookupTableImportV2":{const r=Hk("tableHandle",e,t,n,s),a=Hk("keys",e,t,n),i=Hk("values",e,t,n),o=s.getHashTableById(r.id);return[await o.import(a,i)]}case"LookupTableFind":case"LookupTableFindV2":{const r=Hk("tableHandle",e,t,n,s),a=Hk("keys",e,t,n),i=Hk("defaultValue",e,t,n),o=s.getHashTableById(r.id);return[await o.find(a,i)]}case"LookupTableSize":case"LookupTableSizeV2":{const r=Hk("tableHandle",e,t,n,s);return[s.getHashTableById(r.id).tensorSize()]}default:throw TypeError(`Node type ${e.op} is not implemented`)}})(e,t,n,s);case"custom":const a=jk(e.op);if(a&&a.customExecutor)return a.customExecutor(new MC(e,t,n));throw TypeError(`Custom op ${e.op} is not registered.`);default:throw TypeError(`Unknown op '${e.op}'. File an issue at https://github.com/tensorflow/tfjs/issues so we can add it, or register a custom execution with tf.registerOp()`)}})(e,t,n);return xn(a)?a.then((e=>[].concat(e))):[].concat(a)}class HC{constructor(e={},t={},n={},s={},r){this.weightMap=e,this.tensorArrayMap=t,this.tensorListMap=n,this.functionMap=s,this.parseNodeNameCache=r,this.rootContext={id:0,frameName:"",iterationId:0},this.contexts=[this.rootContext],this.lastId=0,this.generateCurrentContextIds()}newFrame(e,t){return{id:e,frameName:t,iterationId:0}}set currentContext(e){this.contexts!==e&&(this.contexts=e,this.generateCurrentContextIds())}get currentContext(){return this.contexts}get currentContextId(){return this._currentContextIds[0]}get currentContextIds(){return this._currentContextIds}generateCurrentContextIds(){const e=[];for(let t=0;t0===e.id&&0===e.iterationId?"":`${e.frameName}-${e.iterationId}`)).join("/"):""}enterFrame(e){this.contexts&&(this.lastId++,this.contexts=this.contexts.slice(),this.contexts.push(this.newFrame(this.lastId,e)),this._currentContextIds.unshift(this.contextIdforContexts(this.contexts)))}exitFrame(){if(!(this.contexts&&this.contexts.length>1))throw new Error("Cannot exit frame, the context is empty");this.contexts=this.contexts.slice(),this.contexts.splice(-1),this.currentContextIds.shift()}nextIteration(){if(!(this.contexts&&this.contexts.length>0))throw new Error("Cannot increase frame iteration, the context is empty");{this.contexts=this.contexts.slice(),this.lastId++;const e=Object.assign({},this.contexts[this.contexts.length-1]);e.iterationId+=1,e.id=this.lastId,this.contexts.splice(-1,1,e),this._currentContextIds.splice(0,1,this.contextIdforContexts(this.contexts))}}getWeight(e){return this.weightMap[e]}addTensorArray(e){this.tensorArrayMap[e.id]=e}getTensorArray(e){return this.tensorArrayMap[e]}addTensorList(e){this.tensorListMap[e.id]=e}getTensorList(e){return this.tensorListMap[e]}dispose(e){for(const t in this.tensorArrayMap)this.tensorArrayMap[t].clearAndClose(e);for(const t in this.tensorListMap)this.tensorListMap[t].clearAndClose(e)}}function $C(e,t,n,s){const r=new Set,a=[];let i=null,o=null;const l=new Set,u=new Set(Object.keys(e).map((e=>Yk(e)[0])));s=s||[];const c=new Set(s.map((e=>Yk(e.name)[0]))),h=[...t];for(;h.length>0;){const e=h.pop();(JC(e)||eS(e)||tS(e))&&null==i&&(i=e,o=i.children.map((e=>e.name)).filter((e=>r.has(e)))),r.add(e.name),null==n[e.name]&&(u.has(e.name)||c.has(e.name)||(0!==e.inputs.length?e.inputs.forEach((e=>{l.has(e.name)||(l.add(e.name),h.push(e))})):a.push(e.name)))}return{inputs:e,outputs:t,usedNodes:r,missingInputs:a,dynamicNode:i,syncInputs:o}}function KC(e,t){const{usedNodes:n,inputs:s}=t,r=Object.keys(s).map((e=>Yk(e)[0])).map((t=>e.nodes[t])),a=e.initNodes||[],i=e=>n.has("string"==typeof e?e:e.name);function o(e){return[...new Map(e.map((e=>[e.name,e]))).values()]}const l=o([...r,...e.weights,...a]).filter(i),u=o([...l,...Object.values(e.nodes)]).filter(i),c=new Map(u.map((e=>[e.name,e]))),h={};for(const e of u){h[e.name]=h[e.name]||0;for(const t of e.children)i(t)||(h[t.name]=Number.POSITIVE_INFINITY),h[t.name]=(h[t.name]||0)+1}const d=Object.entries(h).filter((([,e])=>0===e)).map((([e])=>e)),p=[...d];for(;d.length>0;){const e=d.pop(),t=c.get(e);for(const e of t.children.filter(i))0==--h[e.name]&&(p.push(e.name),d.push(e.name))}const f=function(e,t){const n=new Map(e.map((e=>[e.name,e]))),s=t.map((e=>e.name)),r=new Set(s);for(;s.length>0;){const e=s.pop(),t=n.get(e);for(const e of t.children)n.has(e.name)&&!r.has(e.name)&&(r.add(e.name),s.push(e.name))}const a=e.filter((e=>r.has(e.name)));return a}(p.map((e=>c.get(e))),l);return function(e,t){const n=new Map(e.map(((e,t)=>[e.name,t]))),s=new Set(t.map((e=>e.name))),r=e=>s.has("string"==typeof e?e:e.name),a=new Set(e.map((e=>e.name))),i=e=>a.has("string"==typeof e?e:e.name);for(const t of e){for(const e of t.children.filter(i)){if(!n.has(e.name))throw new XC(`Child ${e.name} of node ${t.name} is unreachable.`);if(n.get(t.name)>n.get(e.name))throw new XC(`Node ${t.name} is scheduled to run after its child ${e.name}.`)}if(!r(t))for(const e of t.inputs){if(!n.has(e.name))throw new XC(`Input ${e.name} of node ${t.name} is unreachable.`);if(n.get(e.name)>n.get(t.name))throw new XC(`Node ${t.name} is scheduled to run before its input ${e.name}.`)}}}(f,l),f}class XC extends Error{constructor(e){super(`NodesExecutionOrderError: ${e}`)}}const ZC=new Set(["Switch","Merge","Enter","Exit","NextIteration","StatelessIf","StatelessWhile","if","While"]),YC=new Set(["NonMaxSuppressionV2","NonMaxSuppressionV3","NonMaxSuppressionV5","Where"]),QC=new Set(["HashTable","HashTableV2","LookupTableImport","LookupTableImportV2","LookupTableFind","LookupTableFindV2","LookupTableSize","LookupTableSizeV2"]);function JC(e){return ZC.has(e.op)}function eS(e){return YC.has(e.op)}function tS(e){return QC.has(e.op)}class nS{get weightIds(){return this.parent?this.parent.weightIds:this._weightIds}get functionExecutorMap(){return this.parent?this.parent.functionExecutorMap:this._functionExecutorMap}get weightMap(){return this.parent?this.parent.weightMap:this._weightMap}set weightMap(e){const t=Object.keys(e).map((t=>e[t].map((e=>e.id))));this._weightIds=[].concat(...t),this._weightMap=e}set resourceManager(e){this._resourceManager=e}get inputs(){return this._inputs.map((e=>({name:e.name,shape:e.attrParams.shape?e.attrParams.shape.value:void 0,dtype:e.attrParams.dtype?e.attrParams.dtype.value:void 0})))}get outputs(){return this._outputs.map((e=>({name:e.name,shape:e.attrParams.shape?e.attrParams.shape.value:void 0,dtype:e.attrParams.dtype?e.attrParams.dtype.value:void 0})))}get inputNodes(){return this._inputs.map((e=>e.signatureKey||e.name))}get outputNodes(){return this._outputs.map((e=>{const t=e.signatureKey||e.name;return e.defaultOutput?`${t}:${e.defaultOutput}`:t}))}get functions(){return Object.keys(this._functions).reduce(((e,t)=>(e[t]=this._functions[t].signature,e)),{})}constructor(e,t){this.graph=e,this.parent=t,this.compiledMap=new Map,this.parseNodeNameCache=new Map,this._weightMap={},this.SEPARATOR=",",this._functions={},this._functionExecutorMap={},this.keepIntermediateTensors=!1,this._outputs=e.outputs,this._inputs=e.inputs,this._initNodes=e.initNodes,this._signature=e.signature,this._functions=e.functions,null!=e.functions&&Object.keys(e.functions).forEach((t=>{this._functionExecutorMap[t]=new nS(e.functions[t],this)}))}getCompilationKey(e,t){const n=e.map((e=>e.name)).sort(),s=t.map((e=>e.name)).sort();return n.join(this.SEPARATOR)+"--"+s.join(this.SEPARATOR)}compile(e,t){const n=$C(e,t,this.weightMap,this._initNodes),{missingInputs:s,dynamicNode:r,syncInputs:a}=n;if(null!=r)throw new Error(`This execution contains the node '${r.name}', which has the dynamic op '${r.op}'. Please use model.executeAsync() instead. Alternatively, to avoid the dynamic ops, specify the inputs [${a}]`);if(s.length>0){const n=t.map((e=>e.name)),r=Object.keys(e);throw new Error(`Cannot compute the outputs [${n}] from the provided inputs [${r}]. Missing the following inputs: [${s}]`)}const i=KC(this.graph,n),o=function(e){const t=new Map(e.map(((e,t)=>[e.name,t]))),n=Number.MAX_SAFE_INTEGER,s=e.map(((e,t)=>JC(e)?n:t)),r=e=>{const n=s[t.get(e.name)];return null==n?-1:n},a=e.map(((e,t)=>e.children.map(r).reduce(((e,t)=>Math.max(e,t)),s[t]))),i=new Map;for(let t=0;tthis.cloneAndKeepTensor(e)));return t}cloneTensorMap(e){return Object.fromEntries(Object.entries(e).map((([e,t])=>[e,this.cloneTensorList(t)])))}execute(e,t){this.disposeIntermediateTensors(),e=this.mapInputs(e);const n=Object.keys(e).sort();this.checkInputs(e),this.checkInputShapeAndType(e),t=this.mapOutputs(t),this.checkOutputs(t);const s=n.map((e=>this.graph.nodes[Yk(e)[0]])),r=t.map((e=>Yk(e)[0])),a=new Set(r);let i=r.map((e=>this.graph.nodes[e]));0===i.length&&(i=this._outputs);const o=this.getCompilationKey(s,i);let l=this.compiledMap.get(o);null==l&&(l=this.compile(e,i),this.compiledMap.set(o,l));try{this.keepIntermediateTensors=Sn().getBool("KEEP_INTERMEDIATE_TENSORS")}catch(e){this.keepIntermediateTensors=!1}const u={},c={};return Ao((()=>{const n=new HC(this.weightMap,u,c,this.functionExecutorMap,this.parseNodeNameCache),s=Object.assign({},this.weightMap);this.keepIntermediateTensors&&(this.clonedTensorsMap=this.cloneTensorMap(this.weightMap)),Object.keys(e).forEach((t=>{const[r,a]=Yk(t,n),i=[];i[a]=e[t],s[r]=i,this.keepIntermediateTensors&&(this.clonedTensorsMap[r]=this.cloneTensorList(i))}));const r=this.getFrozenTensorIds(s),{orderedNodes:i,nodeLiveUntilMap:o}=l;for(const e of i){if(s[e.name])continue;const t=jC(e,s,n,this._resourceManager);if(xn(t))throw new Error(`The execution of the op '${e.op}' returned a promise. Please use model.executeAsync() instead.`);s[e.name]=t,this.keepIntermediateTensors&&(this.clonedTensorsMap[e.name]=this.cloneTensorList(t)),this.checkTensorForDisposalWithNodeLiveUntilInfo(e,s,n,r,a,o.get(e.name))}return null==this.parent&&n.dispose(r),t.map((e=>$k(e,s,n)))}))}getFrozenTensorIds(e){const t=[].concat.apply([],Object.keys(e).map((t=>e[t])).map((e=>e.map((e=>e.id)))));return new Set(t)}checkTensorForDisposal(e,t,n,s,r,a,i){if(!JC(t)&&!a.has(e)){for(const s of n[e])null!=s&&(i[s.id]=(i[s.id]||0)+t.children.length);for(const e of t.inputs){if(JC(e))continue;const t=Kk(e.name,n,s);if(null!=t)for(const e of t){if(!e||e.kept||r.has(e.id))continue;const t=i[e.id];1===t?(e.dispose(),delete i[e.id]):null!=t&&i[e.id]--}}}}checkTensorForDisposalWithNodeLiveUntilInfo(e,t,n,s,r,a){function i(e){return JC(e)||r.has(e.name)}if(!JC(e)&&null!=a)for(const e of a){if(i(e))continue;const r=Kk(e.name,t,n);for(const e of r)!e||e.kept||s.has(e.id)||e.dispose()}}async executeAsync(e,t){return this._executeAsync(e,t)}disposeIntermediateTensors(){this.clonedTensorsMap&&(Object.values(this.clonedTensorsMap).forEach((e=>{for(const t of e)t&&!t.isDisposed&&t.dispose()})),this.clonedTensorsMap=null)}getIntermediateTensors(){return this.clonedTensorsMap}async _executeAsync(e,t,n=!1,s={},r={}){this.disposeIntermediateTensors(),n||(e=this.mapInputs(e),this.checkInputs(e),this.checkInputShapeAndType(e),t=this.mapOutputs(t),this.checkOutputs(t));try{this.keepIntermediateTensors=Sn().getBool("KEEP_INTERMEDIATE_TENSORS")}catch(e){this.keepIntermediateTensors=!1}const a=new HC(this.weightMap,s,r,this.functionExecutorMap,this.parseNodeNameCache);this.keepIntermediateTensors&&(this.clonedTensorsMap=this.cloneTensorMap(this.weightMap));const i=await this.executeWithControlFlow(e,a,t,n),o=t.map((e=>$k(e,i,a))),l=o.map((e=>e.id)),u=Object.keys(e).map((t=>e[t].id)),c=new Set([...l,...u,...this.weightIds]);return Object.values(i).forEach((e=>{e.forEach((e=>{!e||e.isDisposed||c.has(e.id)||e.dispose()}))})),null==this.parent&&a.dispose(c),o}async executeFunctionAsync(e,t,n){const s=e.reduce(((e,t,n)=>(e[this.inputs[n].name]=t,e)),{});return this._executeAsync(s,this.outputNodes,!0,t,n)}async executeWithControlFlow(e,t,n,s){const r=Object.keys(e),a=r.map((e=>this.graph.nodes[Yk(e)[0]])),i=n.map((e=>Yk(e)[0])),o=new Set(i);let l=i.map((e=>this.graph.nodes[e]));0===l.length&&(l=this._outputs);const{usedNodes:u,missingInputs:c,dynamicNode:h,syncInputs:d}=$C(e,l,this.weightMap,this._initNodes),p=[...a,...this.graph.weights,...this._initNodes||[]].map((e=>({node:e,contexts:t.currentContext}))),f=Object.assign({},this.weightMap);Object.keys(e).forEach((t=>{const[n,s]=Yk(t),r=[];r[s]=e[t],f[n]=r}));const m={},g=this.getFrozenTensorIds(f),y={};for(;p.length>0;){const e=this.processStack(a,p,t,f,y,g,o,m,u);await Promise.all(e)}const b=l.filter((e=>!JC(e)&&!$k(e.name,f,t))).map((e=>e.name));if(b.length>0){let e="";throw null!=h&&(e=`Alternatively, to avoid the dynamic ops, use model.execute() and specify the inputs [${d}]`),new Error(`Cannot compute the outputs [${b}] from the provided inputs [${r}]. Consider providing the following inputs: [${c}]. ${e}`)}return f}processStack(e,t,n,s,r,a,i,o,l){const u=[];for(;t.length>0;){const e=t.pop();n.currentContext=e.contexts;let c="";if("Enter"===e.node.op&&Hk("isConstant",e.node,s,n)&&([c]=Xk(e.node.name,n)),null==s[e.node.name]){const h=jC(e.node,s,n,this._resourceManager);c||([c]=Xk(e.node.name,n));const d=n.currentContext;xn(h)?u.push(h.then((u=>(s[c]=u,this.keepIntermediateTensors&&(this.clonedTensorsMap[c]=this.cloneTensorList(u)),n.currentContext=d,this.checkTensorForDisposal(c,e.node,s,n,a,i,o),this.processChildNodes(e.node,t,n,s,r,l),u)))):(s[c]=h,this.keepIntermediateTensors&&(this.clonedTensorsMap[c]=this.cloneTensorList(h)),this.checkTensorForDisposal(c,e.node,s,n,a,i,o),this.processChildNodes(e.node,t,n,s,r,l))}else this.processChildNodes(e.node,t,n,s,r,l)}return u}processChildNodes(e,t,n,s,r,a){e.children.forEach((e=>{const[i]=Xk(e.name,n);!r[i]&&a.has(e.name)&&("Merge"===e.op?e.inputNames.some((e=>!!$k(e,s,n)))&&(r[i]=!0,t.push({contexts:n.currentContext,node:e})):e.inputNames.every((e=>!!$k(e,s,n)))&&(r[i]=!0,t.push({contexts:n.currentContext,node:e})))}))}dispose(){Object.keys(this.weightMap).forEach((e=>this.weightMap[e].forEach((e=>e.dispose()))))}checkInputShapeAndType(e){Object.keys(e).forEach((t=>{const n=e[t],[s]=Yk(t),r=this.graph.nodes[s];if(r.attrParams.shape&&r.attrParams.shape.value){const e=r.attrParams.shape.value;qt(e.length===n.shape.length&&n.shape.every(((t,n)=>-1===e[n]||e[n]===t)),(()=>`The shape of dict['${r.name}'] provided in model.execute(dict) must be [${e}], but was [${n.shape}]`))}r.attrParams.dtype&&r.attrParams.dtype.value&&qt(n.dtype===r.attrParams.dtype.value,(()=>`The dtype of dict['${r.name}'] provided in model.execute(dict) must be ${r.attrParams.dtype.value}, but was ${n.dtype}`))}))}mapInputs(e){var t,n;const s={};for(const r in e){const a=null===(n=null===(t=this._signature)||void 0===t?void 0:t.inputs)||void 0===n?void 0:n[r];null!=a?s[a.name]=e[r]:s[r]=e[r]}return s}checkInputs(e){const t=Object.keys(e).filter((e=>{const[t]=Yk(e);return null==this.graph.nodes[t]}));if(t.length>0)throw new Error(`The dict provided in model.execute(dict) has keys: [${t}] that are not part of graph`)}mapOutputs(e){return e.map((e=>{var t,n;const s=null===(n=null===(t=this._signature)||void 0===t?void 0:t.outputs)||void 0===n?void 0:n[e];return null!=s?s.name:e}),{})}checkOutputs(e){e.forEach((e=>{const[t]=Yk(e);if(!this.graph.nodes[t])throw new Error(`The output '${e}' is not found in the graph`)}))}}class sS{constructor(e={},t={}){this.hashTableNameToHandle=e,this.hashTableMap=t}addHashTable(e,t){this.hashTableNameToHandle[e]=t.handle,this.hashTableMap[t.id]=t}getHashTableHandleByName(e){return this.hashTableNameToHandle[e]}getHashTableById(e){return this.hashTableMap[e]}dispose(){for(const e in this.hashTableMap)this.hashTableMap[e].clearAndClose(),delete this.hashTableMap[e];for(const e in this.hashTableNameToHandle)this.hashTableNameToHandle[e].dispose(),delete this.hashTableNameToHandle[e]}}const rS="?tfjs-format=file",aS="model.json";class iS{get modelVersion(){return this.version}get inputNodes(){return this.executor.inputNodes}get outputNodes(){return this.executor.outputNodes}get inputs(){return this.executor.inputs}get outputs(){return this.executor.outputs}get weights(){return this.executor.weightMap}get metadata(){return this.artifacts.userDefinedMetadata}get modelSignature(){return this.signature}get modelStructuredOutputKeys(){return this.structuredOutputKeys}constructor(t,n={},s=e){this.modelUrl=t,this.loadOptions=n,this.version="n/a",this.io=s,null==n&&(this.loadOptions={}),this.resourceManager=new sS}findIOHandler(){const e=this.modelUrl;if(null!=e.load)this.handler=e;else if(null!=this.loadOptions.requestInit)this.handler=this.io.browserHTTPRequest(e,this.loadOptions);else{const t=this.io.getLoadHandlers(e,this.loadOptions);if(0===t.length)t.push(this.io.browserHTTPRequest(e,this.loadOptions));else if(t.length>1)throw new Error(`Found more than one (${t.length}) load handlers for URL '${[e]}'`);this.handler=t[0]}}load(){if(this.findIOHandler(),null==this.handler.load)throw new Error("Cannot proceed with model loading because the IOHandler provided does not have the `load` method implemented.");const e=this.handler.load();return xn(e)?e.then((e=>null==e.getWeightStream?this.loadSync(e):this.loadStreaming(e))):this.loadSync(e)}loadSync(e){const t=this.io.decodeWeights(e.weightData,e.weightSpecs);return this.loadWithWeightMap(e,t)}async loadStreaming(e){if(null==e.getWeightStream)throw new Error("Model artifacts missing streamWeights function");const t=await Mo(e.getWeightStream(),e.weightSpecs);return this.loadWithWeightMap(e,t)}loadWithWeightMap(e,t){this.artifacts=e;const n=this.artifacts.modelTopology;let s=this.artifacts.signature;if(null!=this.artifacts.userDefinedMetadata){const e=this.artifacts.userDefinedMetadata;null!=e.signature&&(s=e.signature),null!=e.structuredOutputKeys&&(this.structuredOutputKeys=e.structuredOutputKeys)}if(this.signature=s,this.version=`${n.versions.producer}.${n.versions.minConsumer}`,this.executor=new nS(wC.Instance.transformGraph(n,this.signature)),this.executor.weightMap=this.convertTensorMapToTensorsMap(t),this.executor.resourceManager=this.resourceManager,null!=e.modelInitializer&&null!=e.modelInitializer.node){const t=wC.Instance.transformGraph(e.modelInitializer);this.initializer=new nS(t),this.initializer.weightMap=this.executor.weightMap,this.initializer.resourceManager=this.resourceManager,this.initializerSignature=e.initializerSignature}return!0}async save(e,t){if("string"==typeof e){const t=this.io.getSaveHandlers(e);if(0===t.length)throw new Error(`Cannot find any save handlers for URL '${e}'`);if(t.length>1)throw new Error(`Found more than one (${t.length}) save handlers for URL '${e}'`);e=t[0]}if(null==e.save)throw new Error("GraphModel.save() cannot proceed because the IOHandler provided does not have the `save` attribute defined.");return e.save(this.artifacts)}addStructuredOutputNames(e){if(this.structuredOutputKeys){const t={};return(e instanceof Mi?[e]:e).forEach(((e,n)=>t[this.structuredOutputKeys[n]]=e)),t}return e}predict(e,t){const n=this.execute(e,this.outputNodes);return this.addStructuredOutputNames(n)}async predictAsync(e,t){const n=await this.executeAsync(e,this.outputNodes);return this.addStructuredOutputNames(n)}normalizeInputs(e){var t;if(!(e instanceof Mi||Array.isArray(e))){const n=null===(t=this.signature)||void 0===t?void 0:t.inputs;if(null!=n)for(const t in n){const s=n[t];null!=s.resourceId&&(e[t]=this.resourceIdToCapturedInput[s.resourceId])}return e}e=Array.isArray(e)?e:[e];const n=Object.keys(this.resourceIdToCapturedInput).length;if(e.length+n!==this.inputNodes.length)throw new Error(`Input tensor count mismatch, the graph model has ${this.inputNodes.length-n} non-resource placeholders, while there are ${e.length} input tensors provided.`);let s=0;return this.inputNodes.reduce(((t,n)=>{var r,a,i;const o=null===(i=null===(a=null===(r=this.signature)||void 0===r?void 0:r.inputs)||void 0===a?void 0:a[n])||void 0===i?void 0:i.resourceId;return t[n]=null!=o?this.resourceIdToCapturedInput[o]:e[s++],t}),{})}normalizeOutputs(e){return e=e||this.outputNodes,Array.isArray(e)?e:[e]}executeInitializerGraph(){return null==this.initializer?[]:null==this.initializerSignature?this.initializer.execute({},[]):this.initializer.execute({},Object.keys(this.initializerSignature.outputs))}async executeInitializerGraphAsync(){return null==this.initializer?[]:null==this.initializerSignature?this.initializer.executeAsync({},[]):this.initializer.executeAsync({},Object.keys(this.initializerSignature.outputs))}setResourceIdToCapturedInput(e){if(this.resourceIdToCapturedInput={},this.initializerSignature){const t=this.initializerSignature.outputs,n=Object.keys(t);for(let s=0;s1?n:n[0]}async executeAsync(e,t){null==this.resourceIdToCapturedInput&&this.setResourceIdToCapturedInput(await this.executeInitializerGraphAsync()),e=this.normalizeInputs(e),t=this.normalizeOutputs(t);const n=await this.executor.executeAsync(e,t);return n.length>1?n:n[0]}getIntermediateTensors(){return this.executor.getIntermediateTensors()}disposeIntermediateTensors(){this.executor.disposeIntermediateTensors()}convertTensorMapToTensorsMap(e){return Object.keys(e).reduce(((t,n)=>(t[n]=[e[n]],t)),{})}dispose(){this.executor.dispose(),this.initializer&&(this.initializer.dispose(),this.resourceIdToCapturedInput&&ko(this.resourceIdToCapturedInput)),this.resourceManager.dispose()}}async function oS(t,n={},s=e){if(null==t)throw new Error("modelUrl in loadGraphModel() cannot be null. Please provide a url or an IOHandler that loads the model");null==n&&(n={}),n.fromTFHub&&"string"==typeof t&&(t=function(e){e.endsWith("/")||(e+="/");return`${e}${aS}${rS}`}(t));const r=new iS(t,n,s);return await r.load(),r}function lS(e,t,n=new Map,s=new Set){if(null==e)return null;if("function"==typeof Blob&&e instanceof Blob)return e.slice();if(s.has(e))throw new Error("Circular references are not supported.");if(n.has(e))return n.get(e);const r=t(e);if(r.recurse&&null!==r.value)throw new Error("A deep map function may not return both a value and recurse=true.");if(r.recurse){if(dS(e)){const r=Array.isArray(e)?[]:{};s.add(e);for(const a in e){const i=lS(e[a],t,n,s);r[a]=i}return s.delete(e),e.__proto__&&(r.__proto__=e.__proto__),r}throw new Error(`Can't recurse into non-iterable type: ${e}`)}return n.set(e,r.value),r.value}function uS(e,t=hS){return cS(e,t)}function cS(e,t,n=new Set){const s=e[0];if(n.has(s))throw new Error("Circular references are not supported.");const r=t(e);if(r.recurse&&null!==r.value)throw new Error("A deep zip function may not return both a value and recurse=true.");if(r.recurse){if(dS(s)){const r=Array.isArray(s)?[]:{};n.add(s);for(const a in s){const s=cS(e.map((e=>e[a])),t,n);r[a]=s}return n.delete(s),r}throw new Error(`Can't recurse into non-iterable type: ${s}`)}return r.value}function hS(e){return null===e?null:dS(e[0])?{value:null,recurse:!0}:{value:e,recurse:!1}}function dS(e){let t=!1;if(Sn().get("IS_BROWSER"))t=e instanceof TextDecoder;else{const{StringDecoder:n}=__webpack_require__(7695);t=e instanceof n}return null!=e&&!ArrayBuffer.isView(e)&&(Array.isArray(e)||"object"==typeof e&&!(e instanceof Mi)&&!(e instanceof Promise)&&!t)}function pS(e){return function(e,t){return lS(e,t)}(e,fS)}function fS(e){return e instanceof Mi?{value:e.clone(),recurse:!1}:dS(e)?{value:null,recurse:!0}:{value:e,recurse:!1}}class mS{constructor(e){if(this.capacity=e,this.begin=0,this.end=0,null==e)throw new RangeError("Can't create a ring buffer of unknown capacity.");if(e<1)throw new RangeError("Can't create ring buffer of capacity < 1.");this.data=new Array(e),this.doubledCapacity=2*e}wrap(e){for(;e<0;)e+=this.doubledCapacity;return e%this.doubledCapacity}get(e){if(e<0)throw new RangeError("Can't get item at a negative index.");return this.data[e%this.capacity]}set(e,t){if(e<0)throw new RangeError("Can't set item at a negative index.");this.data[e%this.capacity]=t}length(){let e=this.end-this.begin;return e<0&&(e=this.doubledCapacity+e),e}isFull(){return this.length()===this.capacity}isEmpty(){return 0===this.length()}push(e){if(this.isFull())throw new RangeError("Ring buffer is full.");this.set(this.end,e),this.end=this.wrap(this.end+1)}pushAll(e){for(const t of e)this.push(t)}pop(){if(this.isEmpty())throw new RangeError("Ring buffer is empty.");this.end=this.wrap(this.end-1);const e=this.get(this.end);return this.set(this.end,void 0),e}unshift(e){if(this.isFull())throw new RangeError("Ring buffer is full.");this.begin=this.wrap(this.begin-1),this.set(this.begin,e)}shift(){if(this.isEmpty())throw new RangeError("Ring buffer is empty.");const e=this.get(this.begin);return this.set(this.begin,void 0),this.begin=this.wrap(this.begin+1),e}shuffleExcise(e){if(this.isEmpty())throw new RangeError("Ring buffer is empty.");const t=this.wrap(this.begin+e),n=this.get(t);return this.set(t,this.pop()),n}}class gS extends mS{constructor(){super(gS.INITIAL_CAPACITY)}isFull(){return!1}push(e){super.isFull()&&this.expand(),super.push(e)}unshift(e){super.isFull()&&this.expand(),super.unshift(e)}expand(){const e=2*this.capacity,t=new Array(e),n=this.length();for(let e=0;e!0===e))}rowMajorBatch(e,t=!0){return new SS(this,e,t)}columnMajorBatch(e,t=!0,n=hS){return this.rowMajorBatch(e,t).map((e=>uS(e,n)))}concatenate(e,t){return new RS(new vS([this,e]),t)}take(e){return e<0||null==e?this:new CS(this,e)}skip(e){return e<0||null==e?this:new kS(this,e)}prefetch(e){return new MS(this,e)}shuffle(e,t){return new FS(this,e,t)}serial(){return new AS(this)}}class vS extends wS{constructor(e){super(),this.items=e,this.trav=0}summary(){return`Array of ${this.items.length} items`}async next(){if(this.trav>=this.items.length)return{value:null,done:!0};const e=this.items[this.trav];return this.trav++,{value:pS(e),done:!1}}}class xS extends wS{constructor(e){super(),this.nextFn=e}summary(){return"Function call"}async next(){try{return this.nextFn()}catch(e){throw e.message=`Error thrown while iterating through a dataset: ${e.message}`,e}}}class AS extends wS{constructor(e){super(),this.upstream=e,this.lastRead=Promise.resolve({value:null,done:!1})}summary(){return`${this.upstream.summary()} -> Serial`}async next(){return this.lastRead=this.lastRead.then((()=>this.serialNext())),this.lastRead}async serialNext(){return this.upstream.next()}}class kS extends wS{constructor(e,t){super(),this.upstream=e,this.maxCount=t,this.count=0,this.lastRead=Promise.resolve({value:null,done:!1})}summary(){return`${this.upstream.summary()} -> Skip`}async next(){return this.lastRead=this.lastRead.then((()=>this.serialNext())),this.lastRead}async serialNext(){for(;this.count++ Take`}async next(){return this.count++>=this.maxCount?{value:null,done:!0}:this.upstream.next()}}class SS extends wS{constructor(e,t,n=!0){super(),this.upstream=e,this.batchSize=t,this.enableSmallLastBatch=n,this.lastRead=Promise.resolve({value:null,done:!1})}summary(){return`${this.upstream.summary()} -> RowMajorBatch`}async next(){return this.lastRead=this.lastRead.then((()=>this.serialNext())),this.lastRead}async serialNext(){const e=[];for(;e.length0?{value:e,done:!1}:{value:null,done:!0};e.push(t.value)}return{value:e,done:!1}}}class ES extends wS{constructor(e,t){super(),this.upstream=e,this.predicate=t,this.lastRead=Promise.resolve({value:null,done:!1})}summary(){return`${this.upstream.summary()} -> Filter`}async next(){return this.lastRead=this.lastRead.then((()=>this.serialNext())),this.lastRead}async serialNext(){for(;;){const e=await this.upstream.next();if(e.done||this.predicate(e.value))return e;ko(e.value)}}}class _S extends wS{constructor(e,t){super(),this.upstream=e,this.transform=t}summary(){return`${this.upstream.summary()} -> Map`}async next(){const e=await this.upstream.next();if(e.done)return{value:null,done:!0};const t=Xi(e.value),n=this.transform(e.value),s=Xi(n);for(const e of t)Ki(e,s)||e.dispose();return{value:n,done:!1}}}class IS extends wS{constructor(e,t){super(),this.upstream=e,this.handler=t,this.count=0,this.lastRead=Promise.resolve({value:null,done:!1})}summary(){return`${this.upstream.summary()} -> handleErrors`}async next(){return this.lastRead=this.lastRead.then((()=>this.serialNext())),this.lastRead}async serialNext(){for(;;)try{return await this.upstream.next()}catch(e){if(!this.handler(e))return{value:null,done:!0}}}}class TS extends wS{constructor(e,t){super(),this.upstream=e,this.transform=t}summary(){return`${this.upstream.summary()} -> AsyncMap`}async next(){const e=await this.upstream.next();if(e.done)return{value:null,done:!0};const t=Xi(e.value),n=await this.transform(e.value),s=Xi(n);for(const e of t)Ki(e,s)||e.dispose();return{value:n,done:!1}}}class NS extends wS{constructor(){super(),this.outputQueue=new gS,this.lastRead=Promise.resolve({value:null,done:!1})}async next(){return this.lastRead=this.lastRead.then((()=>this.serialNext())),this.lastRead}async serialNext(){for(;0===this.outputQueue.length();)if(!await this.pump())return{value:null,done:!0};return{value:this.outputQueue.shift(),done:!1}}}class OS extends NS{constructor(e,t){super(),this.upstream=e,this.transform=t}summary(){return`${this.upstream.summary()} -> Flatmap`}async pump(){const e=await this.upstream.next();if(e.done)return!1;const t=Xi(e.value),n=this.transform(e.value),s=Xi(n);this.outputQueue.pushAll(n);for(const e of t)Ki(e,s)||e.dispose();return!0}}class RS extends wS{constructor(e,t){super(),this.baseErrorHandler=t,this.lastRead=null,this.iterator=null,this.moreIterators=e}summary(){return"TODO: fill in upstream of chained summaries -> Chained"}async next(){return this.lastRead=this.readFromChain(this.lastRead),this.lastRead}async readFromChain(e){if(await e,null==this.iterator){const e=await this.moreIterators.next();if(e.done)return{value:null,done:!0};this.iterator=e.value,null!=this.baseErrorHandler&&(this.iterator=this.iterator.handleErrors(this.baseErrorHandler))}const t=await this.iterator.next();return t.done?(this.iterator=null,this.readFromChain(e)):t}}var DS;!function(e){e[e.FAIL=0]="FAIL",e[e.SHORTEST=1]="SHORTEST",e[e.LONGEST=2]="LONGEST"}(DS||(DS={}));class MS extends wS{constructor(e,t){super(),this.upstream=e,this.bufferSize=t,this.buffer=new mS(t)}summary(){return`${this.upstream.summary()} -> Prefetch`}refill(){for(;!this.buffer.isFull();){const e=this.upstream.next();this.buffer.push(e)}}next(){return this.refill(),this.buffer.shift()}}class FS extends MS{constructor(e,t,n){super(e,t),this.upstream=e,this.windowSize=t,this.upstreamExhausted=!1,this.random=jd.alea(n||fi().toString()),this.lastRead=Promise.resolve({value:null,done:!1})}async next(){return this.lastRead=this.lastRead.then((()=>this.serialNext())),this.lastRead}randomInt(e){return Math.floor(this.random()*e)}chooseIndex(){return this.randomInt(this.buffer.length())}async serialNext(){for(this.upstreamExhausted||this.refill();!this.buffer.isEmpty();){const e=this.chooseIndex(),t=await this.buffer.shuffleExcise(e);if(!t.done)return this.refill(),t;this.upstreamExhausted=!0}return{value:null,done:!0}}}class BS{constructor(){this.size=null}batch(e,t=!0){const n=this;let s;return qt(e>0,(()=>`batchSize needs to be positive, but it is\n ${e}`)),s=this.size===1/0||null==this.size?this.size:t?Math.ceil(this.size/e):Math.floor(this.size/e),zS((async()=>(await n.iterator()).columnMajorBatch(e,t,LS)),s)}concatenate(e){const t=this;let n;return n=this.size===1/0||e.size===1/0?1/0:null!=this.size&&null!=e.size?this.size+e.size:null,zS((async()=>(await t.iterator()).concatenate(await e.iterator())),n)}filter(e){const t=this;let n;return n=this.size===1/0?1/0:null,zS((async()=>(await t.iterator()).filter((t=>Ao((()=>e(t)))))),n)}async forEachAsync(e){return(await this.iterator()).forEachAsync(e)}map(e){const t=this;return zS((async()=>(await t.iterator()).map((t=>Ao((()=>e(t)))))),this.size)}mapAsync(e){const t=this;return zS((async()=>(await t.iterator()).mapAsync(e)),this.size)}prefetch(e){if(null==e)throw new RangeError("`Dataset.prefetch()` requires bufferSize to be specified.");const t=this;return zS((async()=>(await t.iterator()).prefetch(e)),this.size)}repeat(e){const t=this;let n;return n=null!=this.size&&e>0?this.size*e:0===e?0:null!=this.size&&(void 0===e||e<0)?1/0:null,zS((async()=>bS(yS((async()=>({value:await t.iterator(),done:!1}))).take(e))),n)}skip(e){const t=this;let n;return n=null!=this.size&&e>=0&&this.size>=e?this.size-e:null!=this.size&&(this.size(await t.iterator()).skip(e)),n)}shuffle(e,t,n=!0){if(null==e||e<0)throw null==this.size?new RangeError("`Dataset.shuffle()` requires bufferSize to be specified."):new RangeError(`\`Dataset.shuffle()\` requires bufferSize to be specified. If your data fits in main memory (for regular JS objects), and/or GPU memory (for \`tf.Tensor\`s), consider setting bufferSize to the dataset size (${this.size} elements)`);const s=this,r=jd.alea(t||fi().toString());return zS((async()=>{let t=r.int32();return n&&(t+=r.int32()),(await s.iterator()).shuffle(e,t.toString())}),this.size)}take(e){const t=this;let n;return n=null!=this.size&&this.size>e?e:null!=this.size&&this.size<=e?this.size:null,zS((async()=>(await t.iterator()).take(e)),n)}async toArray(){if(this.size===1/0)throw new Error("Can not convert infinite data stream to array.");return(await this.iterator()).toArray()}async toArrayForTest(){if(this.size===1/0)throw new Error("Can not convert infinite data stream to array.");return(await this.iterator()).toArrayForTest()}}function zS(e,t=null){return new class extends BS{constructor(){super(...arguments),this.size=t}async iterator(){return e()}}}function LS(e){if(null===e)return null;const t=e[0];if(null==(n=t)||null===(s=n)||"object"!=typeof s&&"function"!=typeof s||Array.isArray(n)||"object"==typeof n&&n instanceof Mi||yi(n)){return{value:function(e){if(0===e.length)throw new Error("Can't make a batch of zero elements.");return e[0]instanceof Mi?Np(e):yo(e)}(e),recurse:!1}}var n,s;return{value:null,recurse:!0}}BS.MAX_BUFFER_SIZE=1e4;Symbol("out"),Symbol("field"),Symbol("quote"),Symbol("quoteafterquote"),Symbol("quoteinquote");function PS(e,t){Array.isArray(e)||(e=[e]),e.forEach((e=>{null!=e&&qt("complex64"!==e.dtype,(()=>`${t} does not support complex64 tensors in the CPU backend.`))}))}const VS=Zp;class WS extends Lt{nextDataId(){return WS.nextDataId++}constructor(){super(),this.blockSize=48,this.firstUse=!0,this.data=new zt(this,vo())}write(e,t,n){this.firstUse&&(this.firstUse=!1,Sn().get("IS_NODE")&&Wa());const s={id:this.nextDataId()};return this.data.set(s,{values:e,dtype:n,refCount:1}),s}makeTensorInfo(e,t,n){let s;if("string"===t&&null!=n&&n.length>0&&on(n[0])){const r=n.map((e=>mi(e)));s=this.write(r,e,t)}else s=this.write(n,e,t);return{dataId:s,shape:e,dtype:t}}refCount(e){if(this.data.has(e)){return this.data.get(e).refCount}return 0}incRef(e){this.data.get(e).refCount++}decRef(e){if(this.data.has(e)){this.data.get(e).refCount--}}move(e,t,n,s,r){this.data.set(e,{values:t,dtype:s,refCount:r})}numDataIds(){return this.data.numDataIds()}async read(e){return this.readSync(e)}readSync(e){const{dtype:t,complexTensorInfos:n}=this.data.get(e);if("complex64"===t){return Zm(this.readSync(n.real.dataId),this.readSync(n.imag.dataId))}return function(e,t){if(Array.isArray(e))return e;if("float32"===t)return e instanceof Float32Array?e:new Float32Array(e);if("int32"===t)return e instanceof Int32Array?e:new Int32Array(e);if("bool"===t||"string"===t)return Uint8Array.from(new Int32Array(e));throw new Error(`Unknown dtype ${t}`)}(this.data.get(e).values,t)}bufferSync(e){const t=this.readSync(e.dataId);if("string"===e.dtype)try{const n=t.map((e=>gi(e)));return Tl(e.shape,e.dtype,n)}catch(e){throw new Error("Failed to decode encoded string bytes into utf-8")}return Tl(e.shape,e.dtype,t)}makeOutput(e,t,n){return vo().makeTensorFromTensorInfo(this.makeTensorInfo(t,n,e),this)}disposeData(e,t=!1){if(this.data.has(e)){if(this.data.get(e).refCount--,!t&&this.data.get(e).refCount>0)return!1;const{complexTensorInfos:n}=this.data.get(e);null!=n&&(this.disposeData(n.real.dataId,!0),this.disposeData(n.imag.dataId,!0)),this.data.delete(e)}return!0}disposeIntermediateTensorInfo(e){this.disposeData(e.dataId)}async time(e){const t=fi();e();return{kernelMs:fi()-t}}memory(){return{unreliable:!0,reasons:["The reported memory is an upper bound. Due to automatic garbage collection, the true allocated memory may be less."]}}where(e){PS([e],"where");const t=this.readSync(e.dataId);return VS(e.shape,t)}dispose(){}floatPrecision(){return 32}epsilon(){return super.epsilon()}}WS.nextDataId=0;function US(e){return(t,n,s)=>{const r=sn(n,t.length);for(let n=0;n{const{x:i}=s;PS(i,e);const o=a,l=o.data.get(i.dataId).values;let u;if("string"===i.dtype){if(!Array.isArray(l))throw new Error("String tensor's value was not an instance of Array");u=Ng(l)}else u=l;const c=n||i.dtype,h=t(u,c,r);return o.makeTensorInfo(i.shape,c,h)}}So("cpu",(()=>new WS),1);const jS=GS(Is,(e=>e>=0?e:Math.exp(e)-1)),HS={kernelName:Is,backendName:"cpu",kernelFunc:jS};function $S(e){const{inputs:t,backend:n}=e,{x:s}=t;return n.incRef(s.dataId),{dataId:s.dataId,shape:s.shape,dtype:s.dtype}}const KS={kernelName:js,backendName:"cpu",kernelFunc:$S};function XS(e){const{inputs:t,backend:n,attrs:s}=e,{x:r}=t,{alpha:a}=s;PS([r],"leakyRelu");const i=$t(r.shape),o=n.data.get(r.dataId).values,l=nn("float32",i);for(let e=0;e{const i=su(t,n),o=i.length,l=dn(i),u=nn(a,$t(i)),c=t.length,h=n.length,d=dn(t),p=dn(n),f=tu(t,i),m=tu(n,i);if(f.length+m.length===0)for(let t=0;ta[e]=0));const i=wn(a,c,d),g=n.slice(-h);m.forEach((e=>g[e]=0));const y=wn(g,h,p);u[t]=e(s[i],r[y])}return[u,i]}}const QS=YS(((e,t)=>e<0?t*e:e));function JS(e){const{inputs:t,backend:n}=e,{x:s,alpha:r}=t;PS([s,r],"prelu");const a=n.data.get(s.dataId).values,i=n.data.get(r.dataId).values,[o,l]=QS(s.shape,r.shape,a,i,"float32");return n.makeTensorInfo(l,"float32",o)}const eE={kernelName:Rr,backendName:"cpu",kernelFunc:JS},tE=GS(Vr,(e=>Math.max(0,e))),nE={kernelName:Vr,backendName:"cpu",kernelFunc:tE},sE=GS(Hr,(e=>Math.min(Math.max(0,e),6))),rE={kernelName:Hr,backendName:"cpu",kernelFunc:sE},aE=US((e=>1/(1+Math.exp(-e)))),iE=GS(aa,(e=>1/(1+Math.exp(-e)))),oE={kernelName:aa,backendName:"cpu",kernelFunc:iE};function lE(e,t,n,s,r){if("linear"===n)return $S({inputs:{x:t},backend:e});if("relu"===n)return tE({inputs:{x:t},backend:e});if("elu"===n)return jS({inputs:{x:t},backend:e});if("relu6"===n)return sE({inputs:{x:t},backend:e});if("prelu"===n)return JS({inputs:{x:t,alpha:s},backend:e});if("leakyrelu"===n)return XS({inputs:{x:t},backend:e,attrs:{alpha:r}});if("sigmoid"===n)return iE({inputs:{x:t},backend:e});throw new Error(`Activation ${n} has not been implemented for the CPU backend.`)}function uE(e){const{inputs:t,backend:n}=e,{real:s,imag:r}=t,a=n.data.get(s.dataId).values,i=n.data.get(r.dataId).values,o=n.makeTensorInfo(s.shape,"complex64");return n.data.get(o.dataId).complexTensorInfos={real:n.makeTensorInfo(s.shape,"float32",a),imag:n.makeTensorInfo(r.shape,"float32",i)},o}const cE={kernelName:ns,backendName:"cpu",kernelFunc:uE};function hE(e,t,n="float32"){if("complex64"===n){return uE({inputs:{real:hE(e,t,"float32"),imag:hE(e,t,"float32")},backend:e})}const s=gn($t(t),n);return e.makeTensorInfo(t,n,s)}function dE(e){const{inputs:t,backend:n}=e,{input:s}=t,r=n.data.get(s.dataId).complexTensorInfos.real,a=n.data.get(r.dataId).values;return n.makeTensorInfo(r.shape,r.dtype,a)}const pE={kernelName:Lr,backendName:"cpu",kernelFunc:dE};function fE(e,t,n,s){if("int32"===s){return[t,"int32",Int32Array.from(e)]}if("bool"===s){const s=pi([0],n),[r,a]=YS(((e,t)=>e!==t?1:0))(t,[],e,s,"bool");return[a,"bool",r]}throw new Error(`Error in Cast: failed to cast ${n} to ${s}`)}function mE(e){const{inputs:t,backend:n,attrs:s}=e,{x:r}=t,{dtype:a}=s;if("complex64"===a){if("complex64"===r.dtype)return $S({inputs:{x:r},backend:n});const e=hE(n,r.shape,r.dtype),t=mE({inputs:{x:r},backend:n,attrs:{dtype:"float32"}}),s=uE({inputs:{real:t,imag:e},backend:n});return n.disposeIntermediateTensorInfo(e),n.disposeIntermediateTensorInfo(t),s}if("complex64"===r.dtype){const e=dE({inputs:{input:r},backend:n}),t=mE({inputs:{x:e},backend:n,attrs:{dtype:a}});return n.disposeIntermediateTensorInfo(e),t}if(!rn(r.dtype,a)){const e=$S({inputs:{x:r},backend:n});return{dataId:e.dataId,shape:e.shape,dtype:a}}const i=n.data.get(r.dataId).values,[o,l,u]=fE(i,r.shape,r.dtype,a);return n.makeTensorInfo(o,l,u)}const gE={kernelName:Jn,backendName:"cpu",kernelFunc:mE};function yE(e,t,n,s){return null==n?({inputs:n,backend:r})=>{const{a,b:i}=n,o=r;PS([a,i],e);const l=o.data.get(a.dataId).values,u=o.data.get(i.dataId).values,c="string"===a.dtype?Ng(l):l,h="string"===a.dtype?Ng(u):u,d=s||a.dtype,[p,f]=t(a.shape,i.shape,c,h,d);return o.makeTensorInfo(f,d,p)}:({inputs:e,backend:r})=>{const{a,b:i}=e,o=r;if("complex64"===a.dtype||"complex64"===i.dtype){const e=mE({inputs:{x:a},backend:o,attrs:{dtype:"complex64"}}),t=o.data.get(e.dataId),s=t.complexTensorInfos.real,r=t.complexTensorInfos.imag,l=o.data.get(s.dataId).values,u=o.data.get(r.dataId).values,c=mE({inputs:{x:i},backend:o,attrs:{dtype:"complex64"}}),h=o.data.get(c.dataId),d=h.complexTensorInfos.real,p=h.complexTensorInfos.imag,f=o.data.get(d.dataId).values,m=o.data.get(p.dataId).values,[g,y,b]=n(a.shape,i.shape,l,u,f,m),w=o.makeTensorInfo(b,"float32",g),v=o.makeTensorInfo(b,"float32",y),x=uE({inputs:{real:w,imag:v},backend:o});return o.disposeIntermediateTensorInfo(e),o.disposeIntermediateTensorInfo(c),o.disposeIntermediateTensorInfo(w),o.disposeIntermediateTensorInfo(v),x}{const e=o.data.get(a.dataId).values,n=o.data.get(i.dataId).values,r=s||a.dtype,[l,u]=t(a.shape,i.shape,e,n,r);return o.makeTensorInfo(u,r,l)}}}function bE(e){return(t,n,s,r,a,i)=>{const o=su(t,n),l=$t(o),u=o.length,c=dn(o),h=nn("float32",l),d=nn("float32",l),p=tu(t,o),f=tu(n,o),m=Zm(s,r),g=Zm(a,i),y=t.length,b=dn(t),w=n.length,v=dn(n);if(p.length+f.length===0)for(let t=0;ts[e]=0));const r=wn(s,y,b),a=n.slice(-w);f.forEach((e=>a[e]=0));const i=wn(a,w,v),o=e(m[2*r],m[2*r+1],g[2*i],g[2*i+1]);h[t]=o.real,d[t]=o.imag}return[h,d,o]}}const wE=YS(((e,t)=>e+t)),vE=bE(((e,t,n,s)=>({real:e+n,imag:t+s}))),xE=yE(Dn,wE,vE),AE={kernelName:Dn,backendName:"cpu",kernelFunc:xE};function kE(e){const{inputs:t,backend:n,attrs:s}=e,{x:r}=t,{shape:a}=s,i=$t(r.shape),o=Jt(a,i),l=$t(o);qt(i===l,(()=>`The new shape (${o}) has ${l} elements and the old shape (${r.shape}) has ${i} elements. The new shape and old shape must have the same number of elements.`)),n.incRef(r.dataId);const u=n.data.get(r.dataId);if(null!=u.complexTensorInfos){const e=u.complexTensorInfos.real,t=u.complexTensorInfos.imag;e.shape=o,t.shape=o}return{dataId:r.dataId,shape:o,dtype:r.dtype}}const CE={kernelName:Wr,backendName:"cpu",kernelFunc:kE};function SE(e){const{inputs:t,backend:n,attrs:s}=e,{a:r,b:a}=t,{transposeA:i,transposeB:o}=s;PS([r,a],"matMul");const l=r.shape.length,u=a.shape.length,c=i?r.shape[l-2]:r.shape[l-1],h=o?a.shape[u-1]:a.shape[u-2],d=i?r.shape[l-1]:r.shape[l-2],p=o?a.shape[u-2]:a.shape[u-1],f=r.shape.slice(0,-2),m=a.shape.slice(0,-2),g=$t(f),y=$t(m),b=su(r.shape.slice(0,-2),a.shape.slice(0,-2)).concat([d,p]);qt(c===h,(()=>`Error in matMul: inner shapes (${c}) and (${h}) of Tensors with shapes ${r.shape} and ${a.shape} and transposeA=${i} and transposeB=${o} must match.`));const w=o?[y,p,h]:[y,h,p],v=kE({inputs:{x:r},backend:n,attrs:{shape:i?[g,c,d]:[g,d,c]}}),x=kE({inputs:{x:a},backend:n,attrs:{shape:w}}),A=i?v.shape[1]:v.shape[2],k=i?v.shape[2]:v.shape[1],C=o?x.shape[1]:x.shape[2],S=Math.max(g,y),E=n.data.get(v.dataId).values,_=n.data.get(x.dataId).values,I=dn(v.shape),T=dn(x.shape),[N,O,R]=i?[I[0],1,I[1]]:[I[0],I[1],1],[D,M,F]=o?[1,T[1],T[0]]:[T[1],1,T[0]],B=k*C,z=Tl([S,k,C],v.dtype),L=z.values,P=n.blockSize;for(let e=0;e{const{x:t}=e.inputs,n=e.backend;PS(t,"abs");let s=new Float32Array($t(t.shape));return s=IE(n.data.get(t.dataId).values),n.makeOutput(s,t.shape,t.dtype)}},NE=GS(On,(e=>Math.acos(e))),OE={kernelName:On,backendName:"cpu",kernelFunc:NE},RE=GS(Rn,(e=>Math.acosh(e))),DE={kernelName:Rn,backendName:"cpu",kernelFunc:RE};const ME={kernelName:Mn,backendName:"cpu",kernelFunc:function(e){const{inputs:t,backend:n}=e,s=t;PS(t,"addN");const r=s.map((e=>n.data.get(e.dataId).values)),a=Tl(s[0].shape,s[0].dtype),i=a.values;for(let e=0;en&&(n=r,s=e)}d[e]=s}return u.forEach((e=>n.disposeIntermediateTensorInfo(e))),n.makeTensorInfo(c,"int32",d)}};const WE={kernelName:Ln,backendName:"cpu",kernelFunc:function(e){const{inputs:t,backend:n,attrs:s}=e,{x:r}=t,{axis:a}=s;PS(r,"argMin");let i=en(a,r.shape);const o=Ih(i,r.shape.length);let l=r;const u=[];null!=o&&(l=BE({inputs:{x:r},backend:n,attrs:{perm:o}}),u.push(l),i=Nh(i.length,l.shape.length)),i=[i[0]],_h("argMin",i,l.shape.length);const[c,h]=Sh(l.shape,i),d=gn($t(c),"int32"),p=$t(h),f=n.data.get(l.dataId).values;for(let e=0;en.disposeIntermediateTensorInfo(e))),n.makeTensorInfo(c,"int32",d)}},UE=GS(Pn,(e=>Math.asin(e))),GE={kernelName:Pn,backendName:"cpu",kernelFunc:UE},qE=GS(Vn,(e=>Math.asinh(e))),jE={kernelName:Vn,backendName:"cpu",kernelFunc:qE},HE=GS(Wn,(e=>Math.atan(e))),$E={kernelName:Wn,backendName:"cpu",kernelFunc:HE},KE=YS(((e,t)=>Math.atan2(e,t))),XE=yE(Gn,KE),ZE={kernelName:Gn,backendName:"cpu",kernelFunc:XE},YE=GS(Un,(e=>Math.atanh(e))),QE={kernelName:Un,backendName:"cpu",kernelFunc:YE};function JE(e,t,n,s,r,a){const i=r.strideHeight,o=r.strideWidth,l=r.dilationHeight,u=r.dilationWidth,c=r.effectiveFilterHeight,h=r.effectiveFilterWidth,d=r.padInfo.top,p=r.padInfo.left,f="max"===a?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,m=Tl(r.outShape,n),g=m.values,y=r.outShape[1]*r.outShape[2]*r.outShape[3],b=r.outShape[2]*r.outShape[3],w=r.outShape[3];for(let t=0;ty?y=i:"avg"===a&&(b+=i,v++)}if(isNaN(y))break}g[k+n*w+t]="avg"===a?b/v:y}}}return m}function e_(e,t,n,s,r=!1,a=!1){const i=Tl(s.outShape,"int32"),o=s.strideHeight,l=s.strideWidth,u=s.dilationHeight,c=s.dilationWidth,h=s.effectiveFilterHeight,d=s.effectiveFilterWidth,p=s.padInfo.top,f=s.padInfo.left,m=Tl(t,n,e);for(let e=0;ev&&(v=u,x=r?a?((e*s.inHeight+n)*s.inWidth+o)*s.inChannels+t:(n*s.inWidth+o)*s.inChannels+t:i*d+l)}}i.set(x,e,n,o,t)}}return i}function t_(e,t,n,s,r,a){const i=r.strideDepth,o=r.strideHeight,l=r.strideWidth,u=r.dilationDepth,c=r.dilationHeight,h=r.dilationWidth,d=r.effectiveFilterDepth,p=r.effectiveFilterHeight,f=r.effectiveFilterWidth,m=r.padInfo.front,g=r.padInfo.top,y=r.padInfo.left,b="max"===a?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,w=Tl(r.outShape,n),v=w.values,x=r.outShape[1]*r.outShape[2]*r.outShape[3]*r.outShape[4],A=r.outShape[2]*r.outShape[3]*r.outShape[4],k=r.outShape[3]*r.outShape[4],C=r.outShape[4];for(let t=0;tA?A=r:"avg"===a&&(k+=r,S++),isNaN(A))break}if(isNaN(A))break}if(isNaN(A))break}v[g+t]="avg"===a?k/Math.max(S,1):A}}}}return w}const n_={kernelName:qn,backendName:"cpu",kernelFunc:function(e){const{inputs:t,backend:n,attrs:s}=e,{x:r}=t;PS(r,"avgPool");const{filterSize:a,strides:i,pad:o,dimRoundingMode:l}=s;qt(Sc(i,1),(()=>`Error in avgPool: Either strides or dilations must be 1. Got strides ${i} and dilations '1'`));const u=mc(r.shape,a,i,1,o,l);let c;if(1===u.filterWidth&&1===u.filterHeight&&Kt(u.inShape,u.outShape))c=$S({inputs:{x:r},backend:n});else{const e=n.data.get(r.dataId).values,t=dn(r.shape),s=JE(e,r.shape,r.dtype,t,u,"avg");c=n.makeTensorInfo(u.outShape,r.dtype,s.values)}return c}};const s_={kernelName:Hn,backendName:"cpu",kernelFunc:function(e){const{inputs:t,backend:n,attrs:s}=e,{x:r}=t,{filterSize:a,strides:i,pad:o,dimRoundingMode:l,dataFormat:u}=s;PS(r,"avgPool3d");const c=gc(r.shape,a,i,1,o,l,u),h=t_(n.data.get(r.dataId).values,r.shape,r.dtype,dn(r.shape),c,"avg");return n.makeTensorInfo(h.shape,"float32",h.values)}};const r_={kernelName:$n,backendName:"cpu",kernelFunc:function(e){const{inputs:t,backend:n,attrs:s}=e,{dy:r,input:a}=t,{filterSize:i,strides:o,pad:l,dimRoundingMode:u}=s;PS([r,a],"avgPool3DGrad");const c=gc(a.shape,i,o,1,l,u),h=c.strideDepth,d=c.strideHeight,p=c.strideWidth,f=c.filterDepth,m=c.filterHeight,g=c.filterWidth,y=c.dilationDepth,b=c.dilationHeight,w=c.dilationWidth,v=c.effectiveFilterDepth,x=c.effectiveFilterHeight,A=c.effectiveFilterWidth,k=v-1-c.padInfo.front,C=A-1-c.padInfo.left,S=x-1-c.padInfo.top,E=Tl(a.shape,"float32"),_=1/(f*m*g),I=n.bufferSync(r);for(let e=0;e=c.outDepth||Math.floor(s)!==s))for(let n=0;n=c.outHeight||Math.floor(r)!==r))for(let n=0;n=c.outWidth||Math.floor(a)!==a)continue;l+=I.get(e,s,r,a,t)}}}E.set(l*_,e,n,s,r,t)}return n.makeTensorInfo(E.shape,E.dtype,E.values)}};const a_={kernelName:jn,backendName:"cpu",kernelFunc:function(e){const{inputs:t,backend:n,attrs:s}=e,{dy:r,input:a}=t,i=a;PS([r,a],"avgPoolGrad");const{filterSize:o,strides:l,pad:u}=s,c=mc(i.shape,o,l,1,u),h=c.strideHeight,d=c.strideWidth,p=c.filterHeight,f=c.filterWidth,m=c.dilationHeight,g=c.dilationWidth,y=c.effectiveFilterHeight,b=c.effectiveFilterWidth,w=b-1-c.padInfo.left,v=y-1-c.padInfo.top,x=Tl(i.shape,"float32"),A=1/(p*f),k=n.data.get(r.dataId).values,C=Tl(r.shape,"float32",k);for(let e=0;e=c.outHeight||Math.floor(s)!==s))for(let n=0;n=c.outWidth||Math.floor(r)!==r)continue;i+=C.get(e,s,r,t)}}x.set(i*A,e,n,s,t)}return n.makeTensorInfo(x.shape,x.dtype,x.values)}};const i_={kernelName:Vs,backendName:"cpu",kernelFunc:function(e){const{inputs:t,backend:n,attrs:s}=e,{x:r,scale:a,offset:i,mean:o,variance:l}=t;qt(o.shape.length===l.shape.length,(()=>"Batch normalization gradient requires mean and variance to have equal ranks.")),qt(null==i||o.shape.length===i.shape.length,(()=>"Batch normalization gradient requires mean and offset to have equal ranks.")),qt(null==a||o.shape.length===a.shape.length,(()=>"Batch normalization gradient requires mean and scale to have equal ranks.")),PS([r,o,l,a,i],"batchNorm");let{varianceEpsilon:u}=s;null==u&&(u=.001);const c=n.data.get(r.dataId).values,h=n.data.get(o.dataId).values,d=n.data.get(l.dataId).values,p=a?n.data.get(a.dataId).values:new Float32Array([1]),f=i?n.data.get(i.dataId).values:new Float32Array([0]),m=new Float32Array(c.length),g=f.length,y=p.length,b=d.length,w=h.length;let v=0,x=0,A=0,k=0;for(let e=0;e=g&&(v=0),x>=w&&(x=0),A>=y&&(A=0),k>=b&&(k=0);return n.makeTensorInfo(r.shape,r.dtype,m)}};function o_(e,t,n,s,r){const a=Yu(s,t,n),i=$t(n),o=dn(s);if(a){const n=Qu(t,o);return"string"===r?e.slice(n,n+i):e.subarray(n,n+i)}const l=Tl(s,r,"string"===r?Ng(e):e),u=Tl(n,r);for(let e=0;ee+t[n]));u.set(l.get(...s),...n)}return"string"===r?Og(u.values):u.values}function l_(e){const{inputs:t,backend:n,attrs:s}=e,{x:r}=t,{begin:a,size:i}=s;PS(r,"slice");const[o,l]=Ju(r,a,i);Pu(r,o,l);const u=o_(n.data.get(r.dataId).values,o,l,r.shape,r.dtype);return n.makeTensorInfo(l,r.dtype,u)}const u_={kernelName:ta,backendName:"cpu",kernelFunc:l_};const c_={kernelName:Xn,backendName:"cpu",kernelFunc:function(e){const{inputs:t,backend:n,attrs:s}=e,{x:r}=t,{blockShape:a,crops:i}=s;PS([r],"batchToSpaceND");const o=a.reduce(((e,t)=>e*t)),l=Bm(r.shape,a,o),u=zm(l.length,a.length),c=Lm(r.shape,a,o),h=Pm(i,a.length),d=Vm(c,i,a.length),p=kE({inputs:{x:r},backend:n,attrs:{shape:l}}),f=BE({inputs:{x:p},backend:n,attrs:{perm:u}}),m=kE({inputs:{x:f},backend:n,attrs:{shape:c}}),g=l_({inputs:{x:m},backend:n,attrs:{begin:h,size:d}});return n.disposeIntermediateTensorInfo(p),n.disposeIntermediateTensorInfo(f),n.disposeIntermediateTensorInfo(m),g}};function h_(e,t,n,s,r){const a=$t(s),i=gn(r,n);for(let n=0;n=r||(i[s]+=a>0?t[n]:1)}return i}function d_(e,t,n,s=!1){const r=e.shape[0],a=e.shape[1],i=Tl([r,n],t.dtype);for(let o=0;o=n||(s?i.set(1,o,a):t.size>0?i.set(i.get(o,a)+t.get(o,r),o,a):i.set(i.get(o,a)+1,o,a))}return i}const p_={kernelName:Zn,backendName:"cpu",kernelFunc:function(e){const{inputs:t,backend:n,attrs:s}=e,{x:r,weights:a}=t,{size:i}=s,o=h_(n.data.get(r.dataId).values,n.data.get(a.dataId).values,a.dtype,a.shape,i);return n.makeTensorInfo([i],a.dtype,o)}},f_=YS(((e,t)=>e&t)),m_=yE(Yn,f_),g_={kernelName:Yn,backendName:"cpu",kernelFunc:m_};const y_={kernelName:Qn,backendName:"cpu",kernelFunc:function(e){const{inputs:t,backend:n}=e,{s0:s,s1:r}=t,a=n.data.get(s.dataId).values,i=n.data.get(r.dataId).values,o=su(Array.from(a),Array.from(i));return n.makeTensorInfo([o.length],"int32",Int32Array.from(o))}},b_=US((e=>Math.ceil(e))),w_=qS(es,b_),v_={kernelName:es,backendName:"cpu",kernelFunc:w_},x_=GS(ts,((e,t)=>{const n=t;return e>n.clipValueMax?n.clipValueMax:e{const{x:t}=e.inputs,n=e.backend,s=new Float32Array($t(t.shape)),r=n.data.get(t.dataId),a=r.complexTensorInfos.real,i=r.complexTensorInfos.imag,o=n.data.get(a.dataId).values,l=n.data.get(i.dataId).values;for(let e=0;e{const n=$t(e.shape);r.set(e.vals,t),t+=n}))}else{let s=0;e.forEach((e=>{const a="string"===n?Ng(e.vals):e.vals;let i=0;for(let n=0;ne.shape)),a);let i=_m(t.map((e=>e.shape)),a);if(0===$t(i))return n.makeTensorInfo(i,t[0].dtype,[]);const o=t.filter((e=>$t(e.shape)>0));if(1===o.length)return $S({inputs:{x:o[0]},backend:n});if("complex64"===o[0].dtype){const e=o.map((e=>dE({inputs:{input:e},backend:n}))),t=o.map((e=>S_({inputs:{input:e},backend:n}))),s=__({inputs:e,backend:n,attrs:{axis:a}}),r=__({inputs:t,backend:n,attrs:{axis:a}}),i=uE({inputs:{real:s,imag:r},backend:n});return e.forEach((e=>n.disposeIntermediateTensorInfo(e))),t.forEach((e=>n.disposeIntermediateTensorInfo(e))),n.disposeIntermediateTensorInfo(s),n.disposeIntermediateTensorInfo(r),i}const l=o.map((e=>{const t=$t(e.shape.slice(a));return kE({inputs:{x:e},backend:n,attrs:{shape:[-1,t]}})})),u=l.map((e=>({vals:n.data.get(e.dataId).values,shape:e.shape})));i=_m(l.map((e=>e.shape)),1);const c=1===l[0].shape[0],h=C_(u,i,t[0].dtype,c),d=_m(o.map((e=>e.shape)),a),p=n.makeTensorInfo(d,t[0].dtype,h);return l.forEach((e=>n.disposeIntermediateTensorInfo(e))),p}const I_={kernelName:rs,backendName:"cpu",kernelFunc:__};function T_(e){const{inputs:t,backend:n,attrs:s}=e,{x:r,filter:a}=t,{strides:i,pad:o,dataFormat:l,dilations:u,dimRoundingMode:c}=s;PS([r,a],"conv2d");const h=_c(l),d=yc(r.shape,a.shape,i,u,o,c,!1,h),p=d.filterHeight,f=d.filterWidth,m=d.dilationHeight,g=d.dilationWidth,y=d.padInfo.left,b=d.padInfo.top,w="channelsLast"===d.dataFormat,v=new Ni(d.outShape,r.dtype),x=dn(r.shape),A=dn(a.shape),k=x[0],C=w?x[1]:x[2],S=w?x[2]:1,E=w?1:x[1],_=v.strides[0],I=w?v.strides[1]:v.strides[2],T=w?v.strides[2]:1,N=w?1:v.strides[1],O=n.data.get(r.dataId).values,R=n.data.get(a.dataId).values,D=v.values;for(let e=0;e=d.inHeight)continue;const a=e*A[0],i=t+n*C;for(let e=0;e=d.inWidth)continue;const r=i+s*S;let o=a+e*A[1];for(let e=0;e=u.inDepth)continue;const a=e*S[0],i=t+n*C[1];for(let e=0;e=u.inHeight)continue;const r=a+e*S[1],o=i+s*C[2];for(let e=0;e=u.inWidth)continue;const a=r+e*S[2],i=o+t*u.inChannels;let l=a;for(let e=0;eMath.cos(e))),z_={kernelName:hs,backendName:"cpu",kernelFunc:B_},L_=GS(ds,(e=>Math.cosh(e))),P_={kernelName:ds,backendName:"cpu",kernelFunc:L_};const V_={kernelName:ms,backendName:"cpu",kernelFunc:function(e){const{inputs:t,backend:n,attrs:s}=e,{image:r,boxes:a,boxInd:i}=t,{cropSize:o,method:l,extrapolationValue:u}=s,[c,h,d,p]=r.shape,f=a.shape[0],[m,g]=o,y=Tl([f,m,g,p],"float32"),b=n.data.get(a.dataId).values,w=n.data.get(i.dataId).values,v=n.data.get(r.dataId).values,x=dn(r.shape),A=dn(y.shape);for(let e=0;e=c)continue;const o=m>1?(r-n)*(h-1)/(m-1):0,f=g>1?(a-s)*(d-1)/(g-1):0;for(let t=0;t1?n*(h-1)+t*o:.5*(n+r)*(h-1);if(c<0||c>h-1)for(let n=0;n1?s*(d-1)+l*f:.5*(s+a)*(d-1);if(c<0||c>d-1){for(let n=0;n1?s*(d-1)+n*f:.5*(s+a)*(d-1);if(r<0||r>d-1){for(let s=0;se+f-t-1:(e,t)=>e+t;for(let e=0;ee+f-t-1:(e,t)=>e+t;for(let e=0;e`Only NHWC dataFormat supported on CPU for depthToSpace. Got ${i}`));const o=r.shape[0],l=r.shape[1],u=r.shape[2],c=r.shape[3],h=l*a,d=u*a,p=c/(a*a),f=n.data.get(r.dataId).values,m=new Float32Array(o*h*d*p);let g=0;for(let e=0;e`Error in depthwiseConv2d: Either strides or dilations must be 1. Got strides ${i} and dilations '${d}'`));const p=yc(r.shape,a.shape,i,d,o,u,!0),{filterHeight:f,filterWidth:m,dilationHeight:g,dilationWidth:y,padInfo:b}=p,w=b.left,v=b.top,x=p.outChannels/p.inChannels,A=new Ni(p.outShape,r.dtype),k=n.data.get(r.dataId).values,C=n.data.get(a.dataId).values,S=A.values;for(let e=0;e=p.inHeight)continue;const a=e*h[0],i=t+n*c[1];for(let e=0;e=p.inWidth)continue;const r=a+e*h[1],o=i+s*p.inChannels;let l=t,u=r;for(let e=0;e{const{x:s,filter:r}=e,{strides:a,pad:i,dilations:o}=n,l=t,u=l.data.get(s.dataId).values,c=s.shape.length,h=l.data.get(r.dataId).values,d=r.shape.length,{batchSize:p,inHeight:f,inWidth:m,inChannels:g,outHeight:y,outWidth:b,padInfo:w,strideHeight:v,strideWidth:x,filterHeight:A,filterWidth:k,dilationHeight:C,dilationWidth:S,outShape:E}=fc(s.shape,r.shape,a,i,"NHWC",o),_=$t(E),I=E.length,T=sn(s.dtype,_);for(let e=0;e=0&&a=0&&pl&&(l=m)}}}T[wn([e,t,a,o],I,dn(E))]=l}}}return{dataId:l.write(pi(T,s.dtype),E,s.dtype),shape:E,dtype:s.dtype}}},Y_={kernelName:Cs,backendName:"cpu",kernelFunc:({inputs:e,backend:t,attrs:n})=>{const{x:s,filter:r,dy:a}=e,{strides:i,pad:o,dilations:l}=n,u=t,c=fn(s.shape,u.data.get(s.dataId).values),h=fn(r.shape,u.data.get(r.dataId).values),{batchSize:d,inHeight:p,inWidth:f,inChannels:m,outHeight:g,outWidth:y,padInfo:b,strideHeight:w,strideWidth:v,filterHeight:x,filterWidth:A,dilationHeight:k,dilationWidth:C,outShape:S}=fc(s.shape,r.shape,i,o,"NHWC",l);qt(a.rank===S.length,(()=>`Error in ${Cs}, dy must have the same rank as output ${S.length}, but got ${a.rank}`));const E=fn(S,u.data.get(a.dataId).values),_=yn(r.shape,r.dtype);for(let e=0;e=0&&s=0&&ui&&(i=r,o=t,l=n)}}}_[o][l][a]+=E[e][t][s][a]}}}return{dataId:u.write(pi(_,s.dtype),r.shape,r.dtype),shape:r.shape,dtype:r.dtype}}},Q_={kernelName:ks,backendName:"cpu",kernelFunc:({inputs:e,backend:t,attrs:n})=>{const{x:s,filter:r,dy:a}=e,{strides:i,pad:o,dilations:l}=n,u=t,c=fn(s.shape,u.data.get(s.dataId).values),h=fn(r.shape,u.data.get(r.dataId).values),{batchSize:d,inHeight:p,inWidth:f,inChannels:m,outHeight:g,outWidth:y,padInfo:b,strideHeight:w,strideWidth:v,filterHeight:x,filterWidth:A,dilationHeight:k,dilationWidth:C,outShape:S}=fc(s.shape,r.shape,i,o,"NHWC",l);qt(a.rank===S.length,(()=>`Error in ${ks}, dy must have the same rank as output ${S.length}, but got ${a.rank}`));const E=fn(S,u.data.get(a.dataId).values),_=yn(s.shape,s.dtype);for(let e=0;e=0&&s=0&&ui&&(i=r,o=s,l=u)}}}_[e][o][l][a]+=E[e][t][s][a]}}}return{dataId:u.write(pi(_,s.dtype),s.shape,s.dtype),shape:s.shape,dtype:s.dtype}}};const J_={kernelName:Ss,backendName:"cpu",kernelFunc:function(e){const{inputs:t,backend:n,attrs:s}=e,{image:r}=t,{canvas:a,options:i}=s,{contextOptions:o,imageOptions:l}=i||{},u=(null==l?void 0:l.alpha)||1,c=(null==o?void 0:o.contextType)||"2d";if("2d"!==c)throw new Error(`Context type ${o.contextType} is not supported by the CPU backend.`);const h=a.getContext(c,(null==o?void 0:o.contextAttributes)||{});if(null==h)throw new Error(`Could not get the context with ${c} type.`);const[d,p]=r.shape.slice(0,2),f=2===r.shape.length?1:r.shape[2],m=n.data.get(r.dataId).values,g="float32"===r.dtype?255:1,y=new Uint8ClampedArray(p*d*4);for(let e=0;e1)throw new Error(`Tensor values for a float32 Tensor must be in the range [0 - 1] but encountered ${s}.`)}else if("int32"===r.dtype&&(s<0||s>255))throw new Error(`Tensor values for a int32 Tensor must be in the range [0 - 255] but encountered ${s}.`);1===f?(t[0]=s*g,t[1]=s*g,t[2]=s*g):t[n]=s*g}const n=4*e;y[n+0]=Math.round(t[0]),y[n+1]=Math.round(t[1]),y[n+2]=Math.round(t[2]),y[n+3]=Math.round(t[3])}a.width=p,a.height=d;const b=new ImageData(y,p,d);return h.putImageData(b,0,0),r}},eI=YS(((e,t)=>e*t)),tI=bE(((e,t,n,s)=>({real:e*n-t*s,imag:e*s+t*n}))),nI=yE(xr,eI,tI),sI={kernelName:xr,backendName:"cpu",kernelFunc:nI};function rI(e){const{inputs:t,backend:n,attrs:s}=e,{x:r}=t,{axis:a,keepDims:i}=s;let o;PS(r,"sum"),o="bool"===r.dtype?mE({inputs:{x:r},backend:n,attrs:{dtype:"int32"}}):$S({inputs:{x:r},backend:n});const l=o.shape.length,u=en(a,o.shape),c=Ih(u,l);let h=u,d=o;null!=c&&(d=BE({inputs:{x:o},backend:n,attrs:{perm:c}}),h=Nh(h.length,l)),_h("sum",h,d.shape.length);const[p,f]=Sh(d.shape,h);let m=hE(n,p,Gi(d.dtype,"int32"));const g=$t(f),y=n.data.get(m.dataId).values,b=n.data.get(d.dataId).values;for(let e=0;e=0&&(d=rI({inputs:{x:d},backend:n,attrs:{axis:u[e]-(i.length-p),keepDims:!1}}),f.push(d)),p--)}for(const e of f)e!==d&&n.disposeIntermediateTensorInfo(e);return d}};const oI={kernelName:Ts,backendName:"cpu",kernelFunc:function(e){const{inputs:t,backend:n}=e,{dy:s,y:r}=t;PS([s,r],"eluGrad");const a=new Float32Array($t(r.shape)),i=n.data.get(r.dataId).values,o=n.data.get(s.dataId).values;for(let e=0;e=0?o[e]:o[e]*(t+1)}return n.makeTensorInfo(r.shape,"float32",a)}},lI=YS(((e,t)=>e===t?1:0)),uI=yE(Os,lI,null,"bool"),cI={kernelName:Os,backendName:"cpu",kernelFunc:uI},hI=qm,dI=jm,pI=Hm,fI=$m,mI=Km,gI=Xm,yI=GS(Ns,(e=>{const t=Math.sign(e),n=Math.abs(e),s=1/(1+hI*n);return t*(1-((((gI*s+mI)*s+fI)*s+pI)*s+dI)*s*Math.exp(-n*n))})),bI={kernelName:Ns,backendName:"cpu",kernelFunc:yI},wI=US((e=>Math.exp(e))),vI=qS(Rs,wI,"float32"),xI={kernelName:Rs,backendName:"cpu",kernelFunc:vI};function AI(e){const{inputs:t,backend:n,attrs:s}=e,{input:r}=t,{dim:a}=s,i=r.shape.length,o=r.shape.slice();let l=a;return a<0&&(qt(-(i+1)<=a,(()=>`Axis must be in the interval [${-(i+1)}, ${i}]`)),l=i+a+1),o.splice(l,0,1),kE({inputs:{x:r},backend:n,attrs:{shape:o}})}const kI={kernelName:Ds,backendName:"cpu",kernelFunc:AI},CI=US((e=>Math.expm1(e))),SI=qS(Ms,CI),EI={kernelName:Ms,backendName:"cpu",kernelFunc:SI},_I=YS(((e,t)=>e/t)),II=yE(Es,_I),TI={kernelName:Es,backendName:"cpu",kernelFunc:II},NI=YS(((e,t)=>e-t)),OI=bE(((e,t,n,s)=>({real:e-n,imag:t-s}))),RI=yE(Ca,NI,OI),DI={kernelName:Ca,backendName:"cpu",kernelFunc:RI};function MI(e,t,n){const s=e.shape,r=s[0],a=s[1],i=n.data.get(e.dataId),o=i.complexTensorInfos.real,l=i.complexTensorInfos.imag,u=[r,a],c=$t(u),h=nn("float32",c),d=nn("float32",c);for(let e=0;e{const{image:s}=e,r=n,a=nn(s.dtype,$t(s.shape)),[i,o,l,u]=s.shape,c=r.data.get(s.dataId).values;for(let e=0;e=0&&iMath.floor(e))),UI=qS(Ls,WI),GI={kernelName:Ls,backendName:"cpu",kernelFunc:UI},qI=YS(((e,t)=>Math.floor(e/t))),jI=yE(Ps,qI,null,"int32"),HI={kernelName:Ps,backendName:"cpu",kernelFunc:jI};const $I={kernelName:Pa,backendName:"cpu",kernelFunc:function(e){const{inputs:t,backend:n,attrs:s}=e,{x:r,filter:a,bias:i,preluActivationWeights:o}=t,{strides:l,pad:u,dataFormat:c,dilations:h,dimRoundingMode:d,activation:p,leakyreluAlpha:f}=s;let m=T_({inputs:{x:r,filter:a},backend:n,attrs:{strides:l,pad:u,dataFormat:c,dilations:h,dimRoundingMode:d}});if(i){const e=m;if("NCHW"===c&&1===i.shape.length&&1!==i.shape[0]){const e=kE({inputs:{x:i},backend:n,attrs:{shape:[i.shape[0],1,1]}});m=xE({inputs:{a:m,b:e},backend:n}),n.disposeIntermediateTensorInfo(e)}else m=xE({inputs:{a:m,b:i},backend:n});n.disposeIntermediateTensorInfo(e)}if(p){const e=m;if("NCHW"===c&&"prelu"===p&&1===o.shape.length&&1!==o.shape[0]){const e=kE({inputs:{x:o},backend:n,attrs:{shape:[o.shape[0],1,1]}});m=lE(n,m,p,e,f),n.disposeIntermediateTensorInfo(e)}else m=lE(n,m,p,o,f);n.disposeIntermediateTensorInfo(e)}return m}};const KI={kernelName:Va,backendName:"cpu",kernelFunc:function(e){const{inputs:t,backend:n,attrs:s}=e,{x:r,filter:a,bias:i,preluActivationWeights:o}=t,{strides:l,pad:u,dataFormat:c,dilations:h,dimRoundingMode:d,activation:p,leakyreluAlpha:f}=s;let m=j_({inputs:{x:r,filter:a},backend:n,attrs:{strides:l,pad:u,dataFormat:c,dilations:h,dimRoundingMode:d}});if(i){const e=m;m=xE({inputs:{a:m,b:i},backend:n}),n.disposeIntermediateTensorInfo(e)}if(p){const e=m;m=lE(n,m,p,o,f),n.disposeIntermediateTensorInfo(e)}return m}};function XI(e,t,n,s,r,a,i,o,l){const u=Tl([s,a],n);for(let n=0;n=l/a)throw new Error(`Invalid indices: ${s} does not index into ${o}`);for(let e=0;e=0,(()=>`GatherV2: the index value ${t} is not in [0, ${c-1}]`))}let h=o;null==o&&(h=0);const d=$t(a.shape),p=Tg(r,a,l,h),f=kE({inputs:{x:r},backend:n,attrs:{shape:[p.batchSize,p.outerSize,p.dimSize,p.sliceSize]}}),m=kE({inputs:{x:a},backend:n,attrs:{shape:[p.batchSize,d/p.batchSize]}}),g=[p.batchSize,p.outerSize,d/p.batchSize,p.sliceSize],y=n.bufferSync(m),b=YI(n.bufferSync(f),y,g);return n.disposeIntermediateTensorInfo(f),n.disposeIntermediateTensorInfo(m),n.makeTensorInfo(p.outputShape,b.dtype,b.values)}},JI=YS(((e,t)=>e>t?1:0)),eT=yE(Gs,JI,null,"bool"),tT={kernelName:Gs,backendName:"cpu",kernelFunc:eT},nT=YS(((e,t)=>e>=t?1:0)),sT=yE(qs,nT,null,"bool"),rT={kernelName:qs,backendName:"cpu",kernelFunc:sT};const aT={kernelName:Hs,backendName:"cpu",kernelFunc:function(e){const{inputs:t,backend:n}=e,{input:s}=t,r=$t(s.shape),a=s.shape[s.shape.length-1],i=kE({inputs:{x:s},backend:n,attrs:{shape:[r/a,a]}}),o=MI(i,!0,n),l=kE({inputs:{x:o},backend:n,attrs:{shape:s.shape}});return n.disposeIntermediateTensorInfo(i),n.disposeIntermediateTensorInfo(o),l}},iT=GS(Ks,(e=>Number.isFinite(e)?1:0),"bool"),oT={kernelName:Ks,backendName:"cpu",kernelFunc:iT},lT=GS(Xs,(e=>Math.abs(e)===1/0?1:0),"bool"),uT={kernelName:Xs,backendName:"cpu",kernelFunc:lT},cT=GS(Zs,(e=>Number.isNaN(e)?1:0),"bool"),hT={kernelName:Zs,backendName:"cpu",kernelFunc:cT},dT=YS(((e,t)=>ee<=t?1:0)),gT=yE(Js,mT,null,"bool"),yT={kernelName:Js,backendName:"cpu",kernelFunc:gT};function bT(e,t,n){const s=(t-e)/(n-1),r=gn(n,"float32");r[0]=e;for(let e=1;eMath.log(e))),xT=qS(tr,vT),AT={kernelName:tr,backendName:"cpu",kernelFunc:xT},kT=GS(nr,(e=>Math.log1p(e))),CT={kernelName:nr,backendName:"cpu",kernelFunc:kT},ST=YS(((e,t)=>e&&t)),ET=yE(sr,ST,null,"bool"),_T={kernelName:sr,backendName:"cpu",kernelFunc:ET},IT=GS(rr,(e=>e?0:1),"bool"),TT={kernelName:rr,backendName:"cpu",kernelFunc:IT},NT=YS(((e,t)=>e||t)),OT=yE(ar,NT,null,"bool"),RT={kernelName:ar,backendName:"cpu",kernelFunc:OT};const DT={kernelName:ir,backendName:"cpu",kernelFunc:function(e){const{inputs:t,backend:n,attrs:s}=e,{x:r}=t,{depthRadius:a,bias:i,alpha:o,beta:l}=s;PS(r,"LRN");const u=r.shape[3],c=u-1,h=n.data.get(r.dataId).values,d=$t(r.shape),p=new Float32Array(d);function f(e){const t=e%u;let n=e-t+Math.max(0,t-a);const s=e-t+Math.min(t+a,c);let r=0;for(;n<=s;n++){const e=h[n];r+=e*e}return r}for(let e=0;ea)&&(a=t)}r[n]=a}return r}function BT(e){const{inputs:t,backend:n,attrs:s}=e,{x:r}=t,{reductionIndices:a,keepDims:i}=s,o=n;let l=r.shape;const u=l.length,c=en(a,l);let h=c;const d=Ih(h,u);let p=o.data.get(r.dataId).values;if(null!=d){const e=new Array(u);for(let t=0;tMath.max(e,t))),PT=yE(ur,LT),VT={kernelName:ur,backendName:"cpu",kernelFunc:PT};const WT={kernelName:cr,backendName:"cpu",kernelFunc:function(e){const{inputs:t,backend:n,attrs:s}=e,{x:r}=t;PS(r,"maxPool");const{filterSize:a,strides:i,pad:o,dimRoundingMode:l}=s;qt(Sc(i,1),(()=>`Error in maxPool: Either strides or dilations must be 1. Got strides ${i} and dilations '1'`));const u=mc(r.shape,a,i,1,o,l);let c;if(1===u.filterWidth&&1===u.filterHeight&&Kt(u.inShape,u.outShape))c=$S({inputs:{x:r},backend:n});else{const e=n.data.get(r.dataId).values,t=dn(r.shape),s=JE(e,r.shape,r.dtype,t,u,"max");c=n.makeTensorInfo(u.outShape,r.dtype,s.values)}return c}};const UT={kernelName:dr,backendName:"cpu",kernelFunc:function(e){const{inputs:t,backend:n,attrs:s}=e,{x:r}=t,{filterSize:a,strides:i,pad:o,dimRoundingMode:l,dataFormat:u}=s;PS(r,"maxPool3d");const c=gc(r.shape,a,i,1,o,l,u),h=t_(n.data.get(r.dataId).values,r.shape,r.dtype,dn(r.shape),c,"max");return n.makeTensorInfo(h.shape,"float32",h.values)}};const GT={kernelName:pr,backendName:"cpu",kernelFunc:function(e){const{inputs:t,backend:n,attrs:s}=e,{dy:r,input:a}=t,{filterSize:i,strides:o,pad:l,dimRoundingMode:u}=s;PS([r,a],"maxPool3DGrad");const c=gc(a.shape,i,o,1,l,u),h=function(e,t){const n=Tl(t.outShape,"int32"),s=t.strideDepth,r=t.strideHeight,a=t.strideWidth,i=t.dilationDepth,o=t.dilationHeight,l=t.dilationWidth,u=t.effectiveFilterDepth,c=t.effectiveFilterHeight,h=t.effectiveFilterWidth,d=t.padInfo.front,p=t.padInfo.top,f=t.padInfo.left;for(let m=0;m=C&&(C=o,S=n*c*h+r*c+i)}}}n.set(S,m,y,s,r,g)}}}return n}(n.bufferSync(a),c),d=c.strideDepth,p=c.strideHeight,f=c.strideWidth,m=c.dilationDepth,g=c.dilationHeight,y=c.dilationWidth,b=c.effectiveFilterDepth,w=c.effectiveFilterHeight,v=c.effectiveFilterWidth,x=b-1-c.padInfo.front,A=v-1-c.padInfo.left,k=w-1-c.padInfo.top,C=Tl(a.shape,"float32"),S=n.bufferSync(r);for(let e=0;e=c.outDepth||Math.floor(s)!==s))for(let r=0;r=c.outHeight||Math.floor(a)!==a))for(let i=0;i=c.outWidth||Math.floor(u)!==u)continue;const d=b*w*v-1-h.get(e,s,a,u,t)===n*w*v+r*v+i?1:0;if(0===d)continue;l+=S.get(e,s,a,u,t)*d}}}C.set(l,e,n,s,r,t)}return n.makeTensorInfo(C.shape,C.dtype,C.values)}};const qT={kernelName:hr,backendName:"cpu",kernelFunc:function(e){const{inputs:t,backend:n,attrs:s}=e,{dy:r,input:a,output:i}=t,o=a;PS([a,i],"maxPoolGrad");const{filterSize:l,strides:u,pad:c,dimRoundingMode:h}=s,d=mc(o.shape,l,u,1,c,h),p=n.data.get(o.dataId).values,f=Tl(d.outShape,o.dtype,e_(p,o.shape,o.dtype,d).values),m=d.strideHeight,g=d.strideWidth,y=d.dilationHeight,b=d.dilationWidth,w=d.effectiveFilterHeight,v=d.effectiveFilterWidth,x=v-1-d.padInfo.left,A=w-1-d.padInfo.top,k=Tl(o.shape,"float32"),C=n.data.get(r.dataId).values,S=Tl(r.shape,"float32",C);for(let e=0;e=d.outHeight||Math.floor(s)!==s))for(let r=0;r=d.outWidth||Math.floor(o)!==o)continue;const l=w*v-1-f.get(e,s,o,t)===n*v+r?1:0;if(0===l)continue;i+=S.get(e,s,o,t)*l}}k.set(i,e,n,s,t)}return n.makeTensorInfo(k.shape,k.dtype,k.values)}};const jT={kernelName:fr,backendName:"cpu",kernelFunc:({inputs:e,attrs:t,backend:n})=>{const{x:s}=e,{filterSize:r,strides:a,pad:i,includeBatchInIndex:o}=t,l=n;PS(s,"MaxPoolWithArgmax");const u=l.data.get(s.dataId).values,c=mc(s.shape,r,a,[1,1],i),[h,d]=function(e,t,n,s,r){const a=JE(e,0,n,dn(t),r,"max"),i=e_(e,t,n,r,!0,s);return[a.values,i.values]}(u,s.shape,s.dtype,o,c),p=l.write(h,c.outShape,s.dtype),f=l.write(d,c.outShape,s.dtype);return[{dataId:p,shape:c.outShape,dtype:s.dtype},{dataId:f,shape:c.outShape,dtype:"int32"}]}};const HT={kernelName:mr,backendName:"cpu",kernelFunc:function(e){const{inputs:t,backend:n,attrs:s}=e,{x:r}=t,{axis:a,keepDims:i}=s,o=en(a,r.shape),l=$t(Sh(r.shape,o)[1]),u=[],c=n.makeTensorInfo([],"float32",new Float32Array([l]));u.push(c);const h=mE({inputs:{x:r},backend:n,attrs:{dtype:"float32"}});u.push(h);const d=II({inputs:{a:h,b:c},backend:n});u.push(d);const p=rI({inputs:{x:d},backend:n,attrs:{axis:a,keepDims:i}});return u.forEach((e=>n.disposeIntermediateTensorInfo(e))),p}};const $T={kernelName:gr,backendName:"cpu",kernelFunc:function(e){const{inputs:t,backend:n,attrs:s}=e,{x:r}=t,{axis:a,keepDims:i}=s;PS(r,"min");const o=en(a,r.shape);let l=o;const u=Ih(l,r.shape.length);let c=r;null!=u&&(c=BE({inputs:{x:r},backend:n,attrs:{perm:u}}),l=Nh(l.length,r.shape.length)),_h("min",l,c.shape.length);const[h,d]=Sh(c.shape,l),p=$t(d),f=gn($t(h),c.dtype),m=n.data.get(c.dataId).values;for(let e=0;eMath.min(e,t))),XT=yE(yr,KT),ZT={kernelName:yr,backendName:"cpu",kernelFunc:XT};const YT={kernelName:br,backendName:"cpu",kernelFunc:function(e){const{inputs:t,backend:n,attrs:s}=e,{x:r}=t,{paddings:a,mode:i}=s;PS(r,"mirrorPad");const o=a.map(((e,t)=>e[0]+r.shape[t]+e[1])),l=a.map((e=>e[0])),u=a.map(((e,t)=>e[0]+r.shape[t])),c="reflect"===i?0:1,h=n.data.get(r.dataId).values,d=r.shape.length,p=dn(r.shape),f=$t(o),m=o.length,g=dn(o),y=nn(r.dtype,f);for(let e=0;e=u[e]&&(t[e]=2*(u[e]-1)-t[e]+c);t=t.map(((e,t)=>e-l[t]));const n=wn(t,d,p);y[e]=h[n]}return{dataId:n.write(y,o,r.dtype),shape:o,dtype:r.dtype}}},QT=YS(((e,t)=>{const n=e%t;return e<0&&t<0||e>=0&&t>=0?n:(n+t)%t})),JT=yE(wr,QT),eN={kernelName:wr,backendName:"cpu",kernelFunc:JT};function tN(e){const{inputs:t,backend:n,attrs:s}=e,{logits:r}=t,{dim:a}=s,i=r.shape.length;let o=a;if(-1===o&&(o=i-1),o!==i-1)throw Error(`Softmax along a non-last dimension is not yet supported. Logits was rank ${i} and dim was ${o}`);const l=en([o],r.shape),u=BT({inputs:{x:r},backend:n,attrs:{reductionIndices:l,keepDims:!1}}),c=Eh(u.shape,l),h=kE({inputs:{x:u},backend:n,attrs:{shape:c}}),d=RI({inputs:{a:r,b:h},backend:n}),p=vI({inputs:{x:d},backend:n}),f=rI({inputs:{x:p},backend:n,attrs:{axis:l,keepDims:!1}}),m=kE({inputs:{x:f},backend:n,attrs:{shape:c}}),g=II({inputs:{a:p,b:m},backend:n});return n.disposeIntermediateTensorInfo(u),n.disposeIntermediateTensorInfo(h),n.disposeIntermediateTensorInfo(d),n.disposeIntermediateTensorInfo(p),n.disposeIntermediateTensorInfo(f),n.disposeIntermediateTensorInfo(m),g}const nN={kernelName:ha,backendName:"cpu",kernelFunc:tN};const sN={kernelName:vr,backendName:"cpu",kernelFunc:function(e){const{inputs:t,backend:n,attrs:s}=e,{logits:r}=t,{numSamples:a,seed:i,normalized:o}=s;PS(r,"multinomial");const l=o?r:tN({inputs:{logits:r},backend:n,attrs:{dim:-1}}),u=l.shape[0],c=l.shape[1],h=n.data.get(l.dataId).values,d=[u,a],p=gn($t(d),"int32");for(let e=0;ee!==t?1:0)),pN=yE(kr,dN,null,"bool"),fN={kernelName:kr,backendName:"cpu",kernelFunc:pN};const mN={kernelName:Ir,backendName:"cpu",kernelFunc:function(e){const{inputs:t,backend:n,attrs:s}=e,{indices:r}=t,{dtype:a,depth:i,onValue:o,offValue:l}=s;PS(r,"oneHot");const u=$t(r.shape),c=new Float32Array(u*i);c.fill(l);const h=n.data.get(r.dataId).values;for(let e=0;e=0&&h[e]{jt(a,e.shape,"All tensors passed to stack must have matching shapes"),qt(i===e.dtype,(()=>"All tensors passed to stack must have matching dtypes"))}));const o=[],l=__({inputs:t.map((e=>{const t=AI({inputs:{input:e},backend:n,attrs:{dim:r}});return o.push(t),t})),backend:n,attrs:{axis:r}});return o.forEach((e=>n.disposeIntermediateTensorInfo(e))),l}const vN={kernelName:Tr,backendName:"cpu",kernelFunc:wN};const xN={kernelName:Nr,backendName:"cpu",kernelFunc:function(e){const{inputs:t,backend:n,attrs:s}=e,{x:r}=t,{paddings:a,constantValue:i}=s;PS(r,"pad");const o=a.map(((e,t)=>e[0]+r.shape[t]+e[1])),l=a.map((e=>e[0])),u=n.data.get(r.dataId).values,c=$t(r.shape),h=r.shape.length,d=dn(r.shape),p=$t(o),f=o.length,m=dn(o),g=nn(r.dtype,p);0!==i&&g.fill(i);for(let e=0;ee+l[t])),f,m)]=u[e]}return{dataId:n.write(g,o,r.dtype),shape:o,dtype:r.dtype}}},AN=YS(((e,t)=>Math.pow(e,t))),kN=yE(Or,AN),CN={kernelName:Or,backendName:"cpu",kernelFunc:kN};function SN(e,t,n,s){const[r,a]=Sh(e,s),i=Gi(t,"int32"),o=gn($t(r),i),l=$t(a);for(let e=0;en.disposeIntermediateTensorInfo(e))),n.makeTensorInfo(y,g,f)}};function _N(e,t,n,s){const r=[];let a=0;const i=t.length-1+n.length,o=new Array(i).fill(null).map((()=>[0]));!function(e,t){for(let n=0;nr)throw new Error("Ragged splits must not point past values");for(let e=1;es[e])throw new Error("Ragged splits must be sorted in ascending order")}}(n,s);let l=1;for(let e=0;e=0){const e=o[r],t=e[e.length-1]-s[i];for(let e=i;e{if(e<0||e>=n){const r=vn(s,t.length,dn(t)).join(",");throw new Error(`indices[${r}] = ${e} is not in [0, ${n})`)}}))}(a,i,t[0][0]-1),0===s.length)throw new Error("params.rank must be nonzero");const l=s[0],{outSplits:u,valueSlices:c,numValues:h}=_N(a,i,e,l),d=function(e){const t=[];for(let n=0;ns[t]=e))}return t}(u),p=TN(n,s,r,c,h);return[d,p[0],p[1]]}const ON={kernelName:Mr,backendName:"cpu",kernelFunc:function(e){const{inputs:t,backend:n,attrs:s}=e,{paramsNestedSplits:r,paramsDenseValues:a,indices:i}=t,{outputRaggedRank:o}=s,l=r.map((e=>n.data.get(e.dataId).values)),u=r.map((e=>e.shape)),c=n.data.get(a.dataId).values,h=n.data.get(i.dataId).values,[d,p,f]=NN(l,u,c,a.shape,a.dtype,h,i.shape),m=d.map((e=>n.makeTensorInfo([e.length],"int32",e))),g=n.makeTensorInfo(f,a.dtype,p);return m.concat([g])}},RN=2147483647;function DN(e,t,n,s,r,a,i){if(t.length>1)throw new Error("starts must be a scalar or vector");if(r.length>1)throw new Error("limits must be a scalar or vector");if(i.length>1)throw new Error("deltas must be a scalar or vector");const o=0===t.length,l=0===r.length,u=0===i.length,c=[];o||c.push(t[0]),l||c.push(r[0]),u||c.push(i[0]);for(let e=1;e0&&rn)c=0;else if(c=Math.ceil(Math.abs((r-n)/i)),c>RN)throw new Error(`Requires ((limit - start) / delta) <= ${RN}`);d[t+1]=d[t]+c}const p=sn(n,d[h]);let f=0;for(let t=0;tn&&(n=t)}return n}static getMaxWidthValueRowID(e){const t=e.length;if(0===t)return 0;let n=0,s=e[0],r=0;for(let a=1;a"Final length of result must be equal to firstDimension.")),r}calculateOutputIndexRowSplit(e,t,n,s){const r=e.length,a=[];for(let i=0;i0&&a.length!==e[r-1])throw new Error("Invalid row split size.");return a}calculateOutputIndexValueRowID(e,t,n,s){const r=e.length,a=[];if(0===r)return[];let i=0,o=e[0];if(o>=t.length)throw new Error(`Got currentValueRowId=${o}, which is not less than ${t.length}`);let l=t[o];a.push(l);for(let u=1;u=0&&(++i,i=t.length)throw new Error(`Got nextValueRowId=${r} which is not less than ${t.length}`);l=t[r]}a.push(l)}if(a.length!==e.length)throw new Error("Invalid row ids.");return a}calculateOutputIndex(e,t,n,s){const r=this.getRowPartitionTensor(e),a=this.getRowPartitionTypeByDimension(e);switch(a){case FN.VALUE_ROWIDS:return this.calculateOutputIndexValueRowID(r,t,n,s);case FN.ROW_SPLITS:if(r.length-1>t.length)throw new Error(`Row partition size is greater than output size: ${r.length-1} > ${t.length}`);return this.calculateOutputIndexRowSplit(r,t,n,s);default:throw new Error(`Unsupported partition type: ${FN[a]}`)}}getFirstDimensionSize(){const e=this.rowPartitionValues[0];if(0===this.rowPartitionTypes.length)throw new Error("No row_partition_types given.");const t=this.rowPartitionTypes[0];switch(t){case FN.FIRST_DIM_SIZE:return e[0];case FN.VALUE_ROWIDS:throw new Error("Cannot handle VALUE_ROWIDS in first dimension.");case FN.ROW_SPLITS:return this.rowPartitionValuesShapes[0][0]-1;default:throw new Error(`Cannot handle type ${FN[t]}`)}}compute(){if(this.rowPartitionValues[0].length<=0)throw new Error("Invalid first partition input. Tensor requires at least one element.");const e=this.getFirstDimensionSize(),t=this.calculateOutputSize(e),n=new Array(this.raggedRank+1);n[n.length-1]=1;for(let e=n.length-2;e>=0;--e)n[e]=n[e+1]*t[e+1];const s=LN(t,!1),r=sn(this.valuesDType,$t(s));if(n[0]*t[0]>0){let a=this.calculateFirstParentOutputIndex(e,n[0],t[0]);for(let e=1;e<=this.raggedRank;++e){a=this.calculateOutputIndex(e-1,a,n[e],t[e])}this.setOutput(this.raggedRank,a,r,s)}return[s,r]}setOutput(e,t,n,s){if(0===n.length)return;const r=this.values,a=n;let i=s.slice();i=i.slice(e+1);const o=$t(i),l=t.length;let u=this.defaultValue;if(u.length!==o&&1!==u.length){const e=this.defaultValueShape;Ao((()=>{const t=Tc(u,e),n=Hc(t,i);u=n.dataSync()}))}let c=0,h=0,d=0;for(let e=0;e<=l;++e){let s=e=l){const e=n.length;s=Math.floor(e/o)}if(s>d)if(1===this.defaultValue.length)a.subarray(d*o,s*o).fill(this.defaultValue[0]),d=s;else for(;s>d;){zN(a.slice(d*o),u,o),++d}s<0?(c=e+1,h=d):(c=e,h=d,d=h+1)}else++d}}}function zN(e,t,n){for(let s=0;s= 0`);if(s<-1)throw new Error(`Dimension ${s} must be >= -1`);s=-1}n.push(s)}return n}function PN(e,t,n,s,r,a,i,o,l,u){return new BN(e,t,n,s,r,a,i,o,l,u).compute()}const VN={kernelName:Br,backendName:"cpu",kernelFunc:function(e){const{inputs:t,backend:n,attrs:s}=e,{shape:r,values:a,defaultValue:i,rowPartitionTensors:o}=t,{rowPartitionTypes:l}=s,u=n.data.get(r.dataId).values,c=n.data.get(a.dataId).values,h=n.data.get(i.dataId).values,d=o.map((e=>n.data.get(e.dataId).values)),p=o.map((e=>e.shape)),[f,m]=PN(u,r.shape,c,a.shape,a.dtype,h,i.shape,d,p,l);return n.makeTensorInfo(f,a.dtype,m)}};function WN(e,t,n,s){if(e===t||e1)return gn(0,s);const r=gn(Math.abs(Math.ceil((t-e)/n)),s);t1/e)),qN={kernelName:Pr,backendName:"cpu",kernelFunc:GN};const jN={kernelName:qr,backendName:"cpu",kernelFunc:function(e){const{inputs:t,backend:n,attrs:s}=e,{images:r}=t,{alignCorners:a,halfPixelCenters:i,size:o}=s;PS(r,"resizeBilinear");const l=dn(r.shape),[u,c]=o,[h,d,p,f]=r.shape,m=n.data.get(r.dataId).values,g=new Float32Array($t([h,u,c,f])),y=[a&&u>1?d-1:d,a&&c>1?p-1:p],b=[a&&u>1?u-1:u,a&&c>1?c-1:c];let w=0;const v=y[0]/b[0],x=y[1]/b[1];for(let e=0;e1?u-1:u,i&&p>1?c-1:c],g=[i&&d>1?d-1:d,i&&p>1?p-1:p],y=m[0]/g[0],b=m[1]/g[1],w=n.data.get(a.dataId).values;let v=0;for(let e=0;e1?d-1:d,a&&c>1?p-1:p],b=[a&&u>1?u-1:u,a&&c>1?c-1:c],w=y[0]/b[0],v=y[1]/b[1];let x=0;for(let e=0;e1?c-1:c,i&&f>1?h-1:h],b=[i&&p>1?p-1:p,i&&f>1?f-1:f],w=y[0]/b[0],v=y[1]/b[1],x=1/w,A=1/v,k=2*Math.ceil(x)+2,C=2*Math.ceil(A)+2;for(let e=0;e=p)continue;const d=t+u*l[1],m=u*w;if(e===Math.min(c-1,i?Math.round(m):Math.floor(m)))for(let e=0;e=f)continue;const r=d+t*l[2],a=t*v;s===Math.min(h-1,i?Math.round(a):Math.floor(a))&&(o+=g[r+n])}}m[a+n]=o}}}}return n.makeTensorInfo(r.shape,r.dtype,m)}};const XN={kernelName:$r,backendName:"cpu",kernelFunc:function(e){const{inputs:t,backend:n,attrs:s}=e,{x:r}=t,{dims:a}=s;PS(r,"reverse");const i=r.shape.length,o=en(a,r.shape);if(0===i)return $S({inputs:{x:r},backend:n});const l=new Ni(r.shape,r.dtype),u=n.bufferSync(r);for(let e=0;en[e]=r.shape[e]-1-n[e])),l.set(u.get(...n),...t)}return n.makeTensorInfo(l.shape,l.dtype,l.values)}},ZN={kernelName:za,backendName:"cpu",kernelFunc:({inputs:e,attrs:t,backend:n})=>{const{image:s}=e,{radians:r,fillValue:a,center:i}=t,o=n,l=nn(s.dtype,$t(s.shape)),[u,c,h,d]=s.shape,[p,f]=Fm(i,c,h),m=Math.sin(r),g=Math.cos(r),y=o.data.get(s.dataId).values;for(let e=0;e=0&&v=0&&x{const t=Math.floor(e);return e-t<.5?Math.floor(e):e-t>.5?Math.ceil(e):t%2==0?t:t+1})),QN={kernelName:Kr,backendName:"cpu",kernelFunc:YN},JN=US((e=>1/Math.sqrt(e))),eO=qS(Xr,JN),tO={kernelName:Xr,backendName:"cpu",kernelFunc:eO};function nO(e,t,n,s,r,a,i,o,l,u){const c=[s/r,r],h=e.values,d=t.values;if(0===s)return Tl(n,t.dtype);const p=l instanceof Ni?l:Tl(c,t.dtype);"string"==typeof l||"number"==typeof l?p.values.fill(l):"boolean"==typeof l&&p.values.fill(+l);for(let e=0;e=s/r)throw new Error(`Invalid indices: ${a} does not index into ${n}`);for(let n=0;n1||1===r.shape.length?1:$t(r.shape.slice(1));for(let e=0;ee>=0?uO*e:lO*(Math.exp(e)-1))),hO={kernelName:ea,backendName:"cpu",kernelFunc:cO},dO=GS(ra,(e=>e<0?-1:e>0?1:0)),pO={kernelName:ra,backendName:"cpu",kernelFunc:dO},fO=GS(na,(e=>Math.sin(e))),mO={kernelName:na,backendName:"cpu",kernelFunc:fO},gO=GS(sa,(e=>Math.sinh(e))),yO={kernelName:sa,backendName:"cpu",kernelFunc:gO},bO=Math.log(1.1920928955078125e-7)+2,wO=GS(ia,(e=>{const t=e>-bO,n=e=l)throw new Error(yg(t,n,l));++f[n],d=d&&n>=p,p=n}let m=!0;for(let e=0;e0&&(f[e]+=f[e-1])}if(m&&d){const t=e,n=s;for(let e=0;eNumber(e))))),n.makeTensorInfo([m.length],s.dtype,new Int32Array(m))]}};function CO(e,t,n,s,r){const a=$t(s),i=t[0],o=r.length,l=[];let u=1,c=-1;for(let e=0;e0){d[h-1]=1;for(let e=h-2;e>=0;--e)d[e]=d[e+1]*s[e+1]}const p=[];if(o>0){p[o-1]=1;for(let e=o-2;e>=0;--e)p[e]=p[e+1]*l[e+1]}const f=sn(n,i*o);for(let t=0;t0?r[o-1]+1:0;if(c<0)throw new Error("segment ids must be >= 0");const h=t.slice();h[0]=c;const d=sn(n,h.reduce(((e,t)=>e*t),1));if(0===o)return c>0&&d.fill(i),[d,h];if(c<=0)throw new Error("segment ids must be >= 0");let p=0,f=1,m=0,g=r[p];for(;;){let t=0;if(f=t)throw new Error("segment ids are not increasing")}if(g<0||g>=c)throw new Error(Sg(g,c));g>m&&d.fill(i,m*u,g*u);for(let t=p;t=l[0])throw new Error(Eg(t,s[t],l[0]));for(let t=0;to)break}return m{const t=[...c];t[o]=e;const s=l_({inputs:{x:r},backend:n,attrs:{begin:u,size:t}});return u[o]+=e,s}))}},OO=US((e=>Math.sqrt(e))),RO=GS(oa,(e=>Math.sqrt(e))),DO={kernelName:oa,backendName:"cpu",kernelFunc:RO},MO={kernelName:ba,backendName:"cpu",kernelFunc:({inputs:e,backend:t})=>{const{x:n}=e,s=t;PS(n,"square");const r=s.data.get(n.dataId).values,a=new Float32Array(r.length);for(let e=0;e{const n=e-t;return n*n})),BO=yE(ya,FO),zO={kernelName:ya,backendName:"cpu",kernelFunc:BO},LO=US(((e,t)=>{const{pattern:n,replaceGlobal:s,rewrite:r}=t;return e.replace(new RegExp(n,s?"g":""),r)})),PO=qS(wa,LO),VO={kernelName:wa,backendName:"cpu",kernelFunc:PO},WO=GS(Fa,((e,t)=>{const n=t;return isNaN(e)?NaN:e>0?1:n.alpha})),UO={kernelName:Fa,backendName:"cpu",kernelFunc:WO};function GO(e,t,n,s){const r=Tl(e,t.dtype);for(let e=0;e=1,(()=>`Input must have rank at least 1, got: ${r.shape.length}`));const e=Wu(b,w,v),t=l_({inputs:{x:r},backend:n,attrs:{begin:b,size:e}});x=kE({inputs:{x:t},backend:n,attrs:{shape:f}}),n.disposeIntermediateTensorInfo(t)}else{const e=GO(p,n.bufferSync(r),v,b);x=n.makeTensorInfo(f,e.dtype,e.values)}return x}};class jO{constructor(e,t,n,s,r,a){this.separator=mi(e),this.nGramWidths=t,this.leftPad=mi(n),this.rightPad=mi(s),this.padWidth=r,this.preserveShort=a}getPadWidth(e){return Math.min(this.padWidth<0?e-1:this.padWidth,e-1)}getNumNGrams(e,t){const n=this.getPadWidth(t);return Math.max(0,e+2*n-t+1)}createNGrams(e,t,n,s,r,a){for(let i=0;i0?0:i-o);let d=0;d+=l*this.leftPad.length;for(let t=0;te.forEach((e=>p[f++]=e));for(let e=0;e0){m(e[h+c-1]);for(let e=0;e0){let e=t[0];if(0!==e)throw new Error(`First split value must be 0, got ${e}`);for(let r=1;r=e;if(s=s&&t[r]<=n,!s)throw new Error(`Invalid split value ${t[r]}, must be in [${e}, ${n}]`);e=t[r]}if(e!==n)throw new Error(`Last split value must be data size. Expected ${n}, got ${e}`)}const r=s-1,a=sn("int32",s);if(0===n||0===s){const e=new Array(n);for(let e=0;e<=r;++e)a[e]=0;return[e,a]}a[0]=0;for(let e=1;e<=r;++e){const n=t[e]-t[e-1];let s=0;this.nGramWidths.forEach((e=>{s+=this.getNumNGrams(n,e)})),this.preserveShort&&n>0&&0===s&&(s=1),a[e]=a[e-1]+s}const i=new Array(a[r]);for(let n=0;n{const o=t[n+1]-t[n],l=this.getNumNGrams(o,a);this.createNGrams(e,s,i,r,l,a),r+=l})),this.preserveShort&&r===a[n]){const a=t[n+1]-t[n];if(0===a)continue;const o=a+2*this.padWidth,l=1;this.createNGrams(e,s,i,r,l,o)}}return[i,a]}}function HO(e,t,n,s,r,a,i,o){return new jO(n,s,r,a,i,o).compute(e,t)}const $O={kernelName:xa,backendName:"cpu",kernelFunc:function(e){const{inputs:t,backend:n,attrs:s}=e,{separator:r,nGramWidths:a,leftPad:i,rightPad:o,padWidth:l,preserveShortSequences:u}=s,{data:c,dataSplits:h}=t,d=n.data.get(c.dataId).values,p=n.data.get(h.dataId).values,[f,m]=HO(d,p,r,a,i,o,l,u);return[n.makeTensorInfo([f.length],"string",f),n.makeTensorInfo(h.shape,"int32",m)]}};function KO(e,t,n,s){if(!e.length)return;if(0===t.length){for(let t=0;tMath.tan(e))),eR={kernelName:Sa,backendName:"cpu",kernelFunc:JO},tR=GS(Ea,(e=>Math.tanh(e)));const nR={kernelName:Yr,backendName:"cpu",kernelFunc:function(e){const{inputs:t,backend:n}=e,{tensor:s,indices:r,updates:a}=t,{sliceRank:i,numUpdates:o,sliceSize:l,strides:u,outputSize:c}=Wp(0,r,s.shape),h=n.bufferSync(r),d=n.bufferSync(a),p=n.bufferSync(s),f=nO(h,d,s.shape,c,l,o,i,u,p,!1);return n.makeTensorInfo(s.shape,f.dtype,f.values)}};function sR(e,t){const n=new Array(e.rank);for(let s=0;s{const n=t.value-e.value;return 0===n?e.index-t.index:n};function iR(e,t,n=0,s=e.length-1){for(;s>n;){if(s-n>600){const r=s-n+1,a=t-n+1,i=Math.log(r),o=.5*Math.exp(2*i/3),l=.5*Math.sqrt(i*o*(r-o)/r)*Math.sign(a-r/2);iR(e,t,Math.max(n,Math.floor(t-a*o/r+l)),Math.min(s,Math.floor(t+(r-a)*o/r+l)))}const r=e[t];let a=n,i=s;for(Gt(e,n,t),aR(e[s],r)>0&&Gt(e,n,s);a0;)i-=1}0===aR(e[n],r)?Gt(e,n,i):(i+=1,Gt(e,i,s)),i<=t&&(n=i+1),t<=i&&(s=i-1)}}function oR(e,t,n,s,r){const a=t[t.length-1],[i,o]=[e.length/a,a],l=nn(n,i*s),u=nn("int32",i*s);for(let t=0;ti[t]={value:e,index:t})),st-1)if(t<=1)n=0;else{const e=2*t;n-=e*Math.trunc(n/e),n>=t&&(n=e-n-1)}return Wt(0,n,t-1)}(e,t);case"wrap":return function(e,t){let n=e;if(n<0)if(t<=1)n=0;else{const e=t-1;n+=t*(Math.trunc(-n/e)+1)}else if(n>t-1)if(t<=1)n=0;else{const e=t-1;n-=t*Math.trunc(n/e)}return Wt(0,n,t-1)}(e,t);case"nearest":return function(e,t){return Wt(0,e,t-1)}(e,t);default:return function(e,t){return e}(e)}}function hR(e,t,n,s,r,a,i,o,l,u,c){return 0<=o&&o{for(let n=0;nn.disposeIntermediateTensorInfo(e))),h}},bR=[_E,TE,OE,DE,AE,ME,LE,PE,VE,WE,GE,jE,$E,ZE,QE,n_,s_,r_,a_,EE,i_,c_,p_,g_,y_,gE,v_,A_,cE,k_,I_,N_,O_,R_,D_,M_,F_,z_,P_,V_,W_,U_,G_,q_,H_,$_,K_,X_,Z_,Y_,Q_,J_,iI,HS,oI,cI,bI,xI,kI,EI,zI,PI,VI,GI,HI,$I,KI,ZI,QI,tT,rT,KS,aT,E_,oT,uT,hT,ZS,fT,yT,wT,AT,CT,_T,TT,RT,DT,MT,zT,VT,WT,UT,GT,qT,jT,HT,$T,ZT,YT,eN,sN,sI,aN,oN,uN,hN,fN,mN,bN,vN,xN,CN,eE,EN,ON,MN,VN,UN,pE,TI,qN,nE,rE,CE,jN,HN,$N,KN,XN,ZN,QN,tO,sO,iO,oO,hO,oE,pO,mO,yO,u_,nN,vO,xO,kO,SO,_O,IO,TO,NO,DO,MO,zO,VO,UO,qO,$O,ZO,QO,DI,aI,eR,{kernelName:Ea,backendName:"cpu",kernelFunc:tR},nR,rR,lR,uR,zE,mR,gR,yR,yN];for(const e of bR)Ka(e);const wR={},vR={alpha:!1,antialias:!1,premultipliedAlpha:!1,preserveDrawingBuffer:!1,depth:!1,stencil:!1,failIfMajorPerformanceCaveat:!0};function xR(e,t){if(!(e in wR)||null!=t){const n=function(e,t){if(1!==e&&2!==e)throw new Error("Cannot get WebGL rendering context, WebGL is disabled.");const n=null==t?function(e){if(Sn().getBool("IS_SAFARI")||"undefined"==typeof OffscreenCanvas||2!==e){if("undefined"!=typeof document)return document.createElement("canvas");throw new Error("Cannot create a canvas in this context")}return new OffscreenCanvas(300,150)}(e):t;n.addEventListener("webglcontextlost",(t=>{t.preventDefault(),delete wR[e]}),!1),Sn().getBool("SOFTWARE_WEBGL_ENABLED")&&(vR.failIfMajorPerformanceCaveat=!1);if(1===e)return n.getContext("webgl",vR)||n.getContext("experimental-webgl",vR);return n.getContext("webgl2",vR)}(e,t);if(null===n)return null;wR[e]=n}const n=wR[e];return null==n||n.isContextLost()?(delete wR[e],xR(e)):(n.disable(n.DEPTH_TEST),n.disable(n.STENCIL_TEST),n.disable(n.BLEND),n.disable(n.DITHER),n.disable(n.POLYGON_OFFSET_FILL),n.disable(n.SAMPLE_COVERAGE),n.enable(n.SCISSOR_TEST),n.enable(n.CULL_FACE),n.cullFace(n.BACK),wR[e])}var AR,kR,CR;function SR(e,t){return[t,e]}function ER(e){const t=$t(e);return Zt(Math.ceil(t/4))}function _R(e,t){return[Math.max(1,Math.ceil(t/2)),Math.max(1,Math.ceil(e/2))]}function IR(e,t){const n=e;let s,r,a,i,o,l,u,c,h,d;return 2===Sn().getNumber("WEBGL_VERSION")?(s=n.R32F,r=n.R16F,a=n.RGBA16F,i=n.RGBA32F,o=n.RED,u=4,c=1,h=n.HALF_FLOAT,d=n.FLOAT,l=n.RGBA8):(s=e.RGBA,r=e.RGBA,a=e.RGBA,i=n.RGBA,o=e.RGBA,u=4,c=4,h=null!=t?t.HALF_FLOAT_OES:null,d=e.FLOAT,l=e.RGBA),{internalFormatFloat:s,internalFormatHalfFloat:r,internalFormatPackedHalfFloat:a,internalFormatPackedFloat:i,textureFormatFloat:o,downloadTextureFormat:l,downloadUnpackNumChannels:u,defaultNumChannels:c,textureTypeHalfFloat:h,textureTypeFloat:d}}function TR(e,t){const n=t();return Sn().getBool("DEBUG")&&function(e){const t=e.getError();if(t!==e.NO_ERROR)throw new Error("WebGL Error: "+function(e,t){switch(t){case e.NO_ERROR:return"NO_ERROR";case e.INVALID_ENUM:return"INVALID_ENUM";case e.INVALID_VALUE:return"INVALID_VALUE";case e.INVALID_OPERATION:return"INVALID_OPERATION";case e.INVALID_FRAMEBUFFER_OPERATION:return"INVALID_FRAMEBUFFER_OPERATION";case e.OUT_OF_MEMORY:return"OUT_OF_MEMORY";case e.CONTEXT_LOST_WEBGL:return"CONTEXT_LOST_WEBGL";default:return`Unknown error code ${t}`}}(e,t))}(e),n}!function(e){e[e.DENSE=0]="DENSE",e[e.SHARED_BATCH=1]="SHARED_BATCH"}(AR||(AR={})),function(e){e[e.RENDER=0]="RENDER",e[e.UPLOAD=1]="UPLOAD",e[e.PIXELS=2]="PIXELS",e[e.DOWNLOAD=3]="DOWNLOAD"}(kR||(kR={})),function(e){e[e.UNPACKED_FLOAT16=0]="UNPACKED_FLOAT16",e[e.UNPACKED_FLOAT32=1]="UNPACKED_FLOAT32",e[e.PACKED_4X1_UNSIGNED_BYTE=2]="PACKED_4X1_UNSIGNED_BYTE",e[e.PACKED_2X2_FLOAT32=3]="PACKED_2X2_FLOAT32",e[e.PACKED_2X2_FLOAT16=4]="PACKED_2X2_FLOAT16"}(CR||(CR={}));function NR(e){return!!(Sn().getBool("WEBGL_RENDER_FLOAT32_ENABLED")||0===e||5.96e-8e.getExtension(t)),'Extension "'+t+'" not supported on this browser.')}const RR=/ERROR: [0-9]+:([0-9]+):/g;function DR(e,t){const n=RR.exec(t);if(null==n)return;const s=+n[1],r=e.split("\n"),a=r.length.toString().length+2,i=r.map(((e,t)=>Yt((t+1).toString(),a)+e));let o=0;for(let e=0;ee.validateProgram(t))),!1===e.getProgramParameter(t,e.VALIDATE_STATUS))throw new Error("Shader program validation failed.")}function FR(e,t,n,s,r,a,i){const o=e.getAttribLocation(t,n);return-1!==o&&(TR(e,(()=>e.bindBuffer(e.ARRAY_BUFFER,s))),TR(e,(()=>e.vertexAttribPointer(o,r,e.FLOAT,!1,a,i))),TR(e,(()=>e.enableVertexAttribArray(o))),!0)}function BR(e,t,n,s){TR(e,(()=>function(e,t,n){WR(e,n),TR(e,(()=>e.activeTexture(e.TEXTURE0+n))),TR(e,(()=>e.bindTexture(e.TEXTURE_2D,t)))}(e,t,s))),TR(e,(()=>e.uniform1i(n,s)))}function zR(e,t,n){TR(e,(()=>e.bindFramebuffer(e.FRAMEBUFFER,n))),TR(e,(()=>e.framebufferTexture2D(e.FRAMEBUFFER,e.COLOR_ATTACHMENT0,e.TEXTURE_2D,t,0)))}function LR(e,t){TR(e,(()=>e.bindFramebuffer(e.FRAMEBUFFER,t))),TR(e,(()=>e.framebufferTexture2D(e.FRAMEBUFFER,e.COLOR_ATTACHMENT0,e.TEXTURE_2D,null,0)))}function PR(e){const t=e.checkFramebufferStatus(e.FRAMEBUFFER);if(t!==e.FRAMEBUFFER_COMPLETE)throw new Error("Error binding framebuffer: "+function(e,t){switch(t){case e.FRAMEBUFFER_INCOMPLETE_ATTACHMENT:return"FRAMEBUFFER_INCOMPLETE_ATTACHMENT";case e.FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT:return"FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT";case e.FRAMEBUFFER_INCOMPLETE_DIMENSIONS:return"FRAMEBUFFER_INCOMPLETE_DIMENSIONS";case e.FRAMEBUFFER_UNSUPPORTED:return"FRAMEBUFFER_UNSUPPORTED";default:return`unknown error ${t}`}}(e,t))}function VR(e,t,n){const s=TR(e,(()=>t()));if(null==s)throw new Error(n);return s}function WR(e,t){const n=e.MAX_COMBINED_TEXTURE_IMAGE_UNITS-1,s=t+e.TEXTURE0;if(sn){throw new Error(`textureUnit must be in ${`[gl.TEXTURE0, gl.TEXTURE${n}]`}.`)}}function UR(e,t=2){return $t(e.slice(0,e.length-t))}function GR(e){if(0===e.length)throw Error("Cannot get rows and columns of an empty shape array.");return[e.length>1?e[e.length-2]:1,e[e.length-1]]}function qR(e){let t=[1,1,1];return 0===e.length||1===e.length&&1===e[0]||(t=[UR(e),...GR(e)]),t}function jR(e){return e%2==0}function HR(e,t){if(Kt(e=e.slice(-2),t=t.slice(-2)))return!0;if(!e.length||!t.length)return!0;if(0===e[0]||0===e[1]||0===t[0]||0===t[1])return!0;if(e.length!==t.length){const n=e[e.length-1],s=t[t.length-1];if(n===s)return!0;if(jR(n)&&jR(s)&&(1===e[0]||1===t[0]))return!0}return e[1]===t[1]&&jR(e[0])&&jR(t[0])}let $R,KR;function XR(e,t){return null!=e.getExtension(t)}function ZR(e){try{if(null!=xR(e))return!0}catch(e){return!1}return!1}function YR(e){if(0===e)return!1;const t=xR(e);if(1!==e){if(XR(t,"EXT_color_buffer_float"))return QR(t);const e="EXT_color_buffer_half_float";if(XR(t,e)){const n=t.getExtension(e);return function(e,t){const n=IR(e,t),s=e.createTexture();e.bindTexture(e.TEXTURE_2D,s);const r=1,a=1;e.texImage2D(e.TEXTURE_2D,0,n.internalFormatHalfFloat,r,a,0,n.textureFormatFloat,n.textureTypeHalfFloat,null);const i=e.createFramebuffer();e.bindFramebuffer(e.FRAMEBUFFER,i),e.framebufferTexture2D(e.FRAMEBUFFER,e.COLOR_ATTACHMENT0,e.TEXTURE_2D,s,0);const o=e.checkFramebufferStatus(e.FRAMEBUFFER)===e.FRAMEBUFFER_COMPLETE;return e.bindTexture(e.TEXTURE_2D,null),e.bindFramebuffer(e.FRAMEBUFFER,null),e.deleteTexture(s),e.deleteFramebuffer(i),o}(t,n)}return!1}if(!XR(t,"OES_texture_float"))return!1;if(!XR(t,"WEBGL_color_buffer_float"))return!1;return QR(t)}function QR(e){const t=IR(e),n=e.createTexture();e.bindTexture(e.TEXTURE_2D,n);e.texImage2D(e.TEXTURE_2D,0,t.internalFormatFloat,1,1,0,t.textureFormatFloat,t.textureTypeFloat,null);const s=e.createFramebuffer();e.bindFramebuffer(e.FRAMEBUFFER,s),e.framebufferTexture2D(e.FRAMEBUFFER,e.COLOR_ATTACHMENT0,e.TEXTURE_2D,n,0);const r=e.checkFramebufferStatus(e.FRAMEBUFFER)===e.FRAMEBUFFER_COMPLETE;return e.bindTexture(e.TEXTURE_2D,null),e.bindFramebuffer(e.FRAMEBUFFER,null),e.deleteTexture(n),e.deleteFramebuffer(s),r}function JR(e,t){Array.isArray(e)||(e=[e]),e.forEach((e=>{null!=e&&qt("complex64"!==e.dtype,(()=>`${t} does not support complex64 tensors in the WebGL backend.`))}))}const eD=Sn();function tD(){let e,t,n,s,r,a,i,o,l,u;return 2===Sn().getNumber("WEBGL_VERSION")?(e="#version 300 es",t="in",n="out",s="in",r="texture",a="outputColor",i="out vec4 outputColor;",o=Sn().getBool("WEBGL2_ISNAN_CUSTOM")?"\n bool isnan_custom(float val) {\n uint floatToUint = floatBitsToUint(val);\n return (floatToUint & 0x7fffffffu) > 0x7f800000u;\n }\n\n bvec4 isnan_custom(vec4 val) {\n return bvec4(isnan_custom(val.x),\n isnan_custom(val.y), isnan_custom(val.z), isnan_custom(val.w));\n }\n\n #define isnan(value) isnan_custom(value)\n ":"",l="",u="\n #define round(value) newRound(value)\n int newRound(float value) {\n return int(floor(value + 0.5));\n }\n\n ivec4 newRound(vec4 value) {\n return ivec4(floor(value + vec4(0.5)));\n }\n "):(e="",t="attribute",n="varying",s="varying",r="texture2D",a="gl_FragColor",i="",o="\n #define isnan(value) isnan_custom(value)\n bool isnan_custom(float val) {\n return (val > 0. || val < 1. || val == 0.) ? false : true;\n }\n bvec4 isnan_custom(vec4 val) {\n return bvec4(isnan(val.x), isnan(val.y), isnan(val.z), isnan(val.w));\n }\n ",l="\n uniform float INFINITY;\n\n bool isinf(float val) {\n return abs(val) == INFINITY;\n }\n bvec4 isinf(vec4 val) {\n return equal(abs(val), vec4(INFINITY));\n }\n ",u="\n int round(float value) {\n return int(floor(value + 0.5));\n }\n\n ivec4 round(vec4 value) {\n return ivec4(floor(value + vec4(0.5)));\n }\n "),{version:e,attribute:t,varyingVs:n,varyingFs:s,texture2D:r,output:a,defineOutput:i,defineSpecialNaN:o,defineSpecialInf:l,defineRound:u}}function nD(e,t,n="index"){const s=dn(t);return s.map(((t,r)=>`${`int ${e[r]} = ${n} / ${t}`}; ${r===s.length-1?`int ${e[r+1]} = ${n} - ${e[r]} * ${t}`:`index -= ${e[r]} * ${t}`};`)).join("")}function sD(e,t,n="index"){const s=dn(t);return s.map(((t,r)=>`${`int ${e[r]} = ${n} / outShapeStrides[${r}]`}; ${r===s.length-1?`int ${e[r+1]} = ${n} - ${e[r]} * outShapeStrides[${r}]`:`index -= ${e[r]} * outShapeStrides[${r}]`};`)).join("")}function rD(e,t,n="index"){const s=function(e,t){const n=e.length,s=e.map((e=>`${t}[${e}]`)),r=new Array(n-1);r[n-2]=s[n-1];for(let e=n-3;e>=0;--e)r[e]=`(${r[e+1]} * ${s[e+1]})`;return r}(e.map(((e,t)=>t)),t);return s.map(((t,r)=>`${`int ${e[r]} = ${n} / ${s[r]}`}; ${r===s.length-1?`int ${e[r+1]} = ${n} - ${e[r]} * ${s[r]}`:`index -= ${e[r]} * ${s[r]}`};`)).join("")}function aD(e){const t=dn(e).map((e=>e.toString()));return`\n int getFlatIndex(ivec3 coords) {\n return coords.x * ${t[0]} + coords.y * ${t[1]} + coords.z;\n }\n`}eD.registerFlag("HAS_WEBGL",(()=>eD.getNumber("WEBGL_VERSION")>0)),eD.registerFlag("WEBGL_VERSION",(()=>ZR(2)?2:ZR(1)?1:0)),eD.registerFlag("WEBGL_CHECK_NUMERICAL_PROBLEMS",(()=>!1)),eD.registerFlag("WEBGL_BUFFER_SUPPORTED",(()=>2===eD.get("WEBGL_VERSION"))),eD.registerFlag("WEBGL_CPU_FORWARD",(()=>!0)),eD.registerFlag("WEBGL_FORCE_F16_TEXTURES",(()=>!1)),eD.registerFlag("WEBGL_PACK",(()=>eD.getBool("HAS_WEBGL"))),eD.registerFlag("WEBGL_PACK_NORMALIZATION",(()=>eD.getBool("WEBGL_PACK"))),eD.registerFlag("WEBGL_PACK_CLIP",(()=>eD.getBool("WEBGL_PACK"))),eD.registerFlag("WEBGL_PACK_DEPTHWISECONV",(()=>eD.getBool("WEBGL_PACK"))),eD.registerFlag("WEBGL_PACK_BINARY_OPERATIONS",(()=>eD.getBool("WEBGL_PACK"))),eD.registerFlag("WEBGL_PACK_UNARY_OPERATIONS",(()=>eD.getBool("WEBGL_PACK"))),eD.registerFlag("WEBGL_PACK_ARRAY_OPERATIONS",(()=>eD.getBool("WEBGL_PACK"))),eD.registerFlag("WEBGL_PACK_IMAGE_OPERATIONS",(()=>eD.getBool("WEBGL_PACK"))),eD.registerFlag("WEBGL_PACK_REDUCE",(()=>eD.getBool("WEBGL_PACK"))),eD.registerFlag("WEBGL_LAZILY_UNPACK",(()=>eD.getBool("WEBGL_PACK"))),eD.registerFlag("WEBGL_CONV_IM2COL",(()=>eD.getBool("WEBGL_PACK"))),eD.registerFlag("WEBGL_PACK_CONV2DTRANSPOSE",(()=>eD.getBool("WEBGL_PACK"))),eD.registerFlag("WEBGL_MAX_TEXTURE_SIZE",(()=>function(e){if(null==$R){const t=xR(e);$R=t.getParameter(t.MAX_TEXTURE_SIZE)}return $R}(eD.getNumber("WEBGL_VERSION")))),eD.registerFlag("WEBGL_MAX_TEXTURES_IN_SHADER",(()=>function(e){if(null==KR){const t=xR(e);KR=t.getParameter(t.MAX_TEXTURE_IMAGE_UNITS)}return Math.min(16,KR)}(eD.getNumber("WEBGL_VERSION")))),eD.registerFlag("WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_VERSION",(()=>{const e=eD.getNumber("WEBGL_VERSION");return 0===e?0:function(e){if(0===e)return 0;let t;const n=xR(e);return t=XR(n,"EXT_disjoint_timer_query_webgl2")&&2===e?2:XR(n,"EXT_disjoint_timer_query")?1:0,t}(e)})),eD.registerFlag("WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_RELIABLE",(()=>eD.getNumber("WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_VERSION")>0&&!ro())),eD.registerFlag("WEBGL_RENDER_FLOAT32_CAPABLE",(()=>function(e){if(0===e)return!1;const t=xR(e);if(1===e){if(!XR(t,"OES_texture_float"))return!1}else if(!XR(t,"EXT_color_buffer_float"))return!1;return QR(t)}(eD.getNumber("WEBGL_VERSION")))),eD.registerFlag("WEBGL_RENDER_FLOAT32_ENABLED",(()=>!eD.getBool("WEBGL_FORCE_F16_TEXTURES")&&eD.getBool("WEBGL_RENDER_FLOAT32_CAPABLE"))),eD.registerFlag("WEBGL_DOWNLOAD_FLOAT_ENABLED",(()=>YR(eD.getNumber("WEBGL_VERSION")))),eD.registerFlag("WEBGL_FENCE_API_ENABLED",(()=>{return 2===(e=eD.getNumber("WEBGL_VERSION"))&&null!=xR(e).fenceSync;var e})),eD.registerFlag("WEBGL_SIZE_UPLOAD_UNIFORM",(()=>eD.getBool("WEBGL_RENDER_FLOAT32_ENABLED")?4:0)),eD.registerFlag("WEBGL_DELETE_TEXTURE_THRESHOLD",(()=>-1),(e=>{if("number"!=typeof e)throw new Error(`WEBGL_DELETE_TEXTURE_THRESHOLD must be a number but got ${e}.`);if(e<0&&-1!==e)throw new Error(`WEBGL_DELETE_TEXTURE_THRESHOLD must be -1 (indicating never delete) or at least 0, but got ${e}.`)})),eD.registerFlag("WEBGL_FLUSH_THRESHOLD",(()=>ro()?1:-1),(e=>{if("number"!=typeof e)throw new Error(`WEBGL_FLUSH_THRESHOLD must be a number but got ${e}.`);if(e<0&&-1!==e)throw new Error(`WEBGL_FLUSH_THRESHOLD must be -1 (indicating never manual flush) or at least 0, but got ${e}.`)})),eD.registerFlag("CPU_HANDOFF_SIZE_THRESHOLD",(()=>128)),eD.registerFlag("WEBGL_USE_SHAPES_UNIFORMS",(()=>!1)),eD.registerFlag("TOPK_LAST_DIM_CPU_HANDOFF_SIZE_THRESHOLD",(()=>1e5)),eD.registerFlag("TOPK_K_CPU_HANDOFF_THRESHOLD",(()=>128)),eD.registerFlag("WEBGL_EXP_CONV",(()=>!1)),eD.registerFlag("SOFTWARE_WEBGL_ENABLED",(()=>eD.getBool("IS_TEST"))),eD.registerFlag("WEBGL_MAX_SIZE_FOR_NARROW_TEXTURE",(()=>1/0)),eD.registerFlag("WEBGL_AUTO_SQUARIFY_NARROW_TEXTURE_SHAPE",(()=>!1)),eD.registerFlag("WEBGL2_ISNAN_CUSTOM",(()=>!1)),eD.registerFlag("ENGINE_COMPILE_ONLY",(()=>!1));const iD="\n const float FLOAT_MAX = 1.70141184e38;\n const float FLOAT_MIN = 1.17549435e-38;\n\n lowp vec4 encode_float(highp float v) {\n if (isnan(v)) {\n return vec4(255, 255, 255, 255);\n }\n\n highp float av = abs(v);\n\n if(av < FLOAT_MIN) {\n return vec4(0.0, 0.0, 0.0, 0.0);\n } else if(v > FLOAT_MAX) {\n return vec4(0.0, 0.0, 128.0, 127.0) / 255.0;\n } else if(v < -FLOAT_MAX) {\n return vec4(0.0, 0.0, 128.0, 255.0) / 255.0;\n }\n\n highp vec4 c = vec4(0,0,0,0);\n\n highp float e = floor(log2(av));\n highp float m = exp2(fract(log2(av))) - 1.0;\n\n c[2] = floor(128.0 * m);\n m -= c[2] / 128.0;\n c[1] = floor(32768.0 * m);\n m -= c[1] / 32768.0;\n c[0] = floor(8388608.0 * m);\n\n highp float ebias = e + 127.0;\n c[3] = floor(ebias / 2.0);\n ebias -= c[3] * 2.0;\n c[2] += floor(ebias) * 128.0;\n\n c[3] += 128.0 * step(0.0, -v);\n\n return c / 255.0;\n }\n",{getBroadcastDims:oD}=r;function lD(e,t,n){const s=[];if(e.forEach((e=>{const t=$t(e.shapeInfo.logicalShape);if(e.shapeInfo.isUniform?s.push(`uniform float ${e.name}${t>1?`[${t}]`:""};`):(s.push(`uniform sampler2D ${e.name};`),s.push(`uniform int offset${e.name};`)),n.enableShapeUniforms){const{uniformShape:t}=wD(n.packedInputs,e.shapeInfo.logicalShape,e.shapeInfo.texShape);switch(t.length){case 1:s.push(`uniform int ${e.name}Shape;`);break;case 2:s.push(`uniform ivec2 ${e.name}Shape;`);break;case 3:s.push(`uniform ivec3 ${e.name}Shape;`);break;case 4:s.push(`uniform ivec4 ${e.name}Shape;`)}s.push(`uniform ivec2 ${e.name}TexShape;`)}})),n.enableShapeUniforms){switch(t.logicalShape.length){case 1:s.push("uniform int outShape;");break;case 2:s.push("uniform ivec2 outShape;"),s.push("uniform int outShapeStrides;");break;case 3:s.push("uniform ivec3 outShape;"),s.push("uniform ivec2 outShapeStrides;");break;case 4:s.push("uniform ivec4 outShape;"),s.push("uniform ivec3 outShapeStrides;")}s.push("uniform ivec2 outTexShape;")}n.customUniforms&&n.customUniforms.forEach((e=>{s.push(`uniform ${e.type} ${e.name}${e.arrayIndex?`[${e.arrayIndex}]`:""};`)}));const r=s.join("\n"),a=e.map((e=>function(e,t,n=!1,s){let r="";r+=n?cD(e,s):uD(e,s);const a=e.shapeInfo.logicalShape,i=t.logicalShape;a.length<=i.length&&(r+=n?function(e,t){const n=e.name,s=n.charAt(0).toUpperCase()+n.slice(1),r="get"+s+"AtOutCoords",a=e.shapeInfo.logicalShape.length,i=t.logicalShape.length,o=oD(e.shapeInfo.logicalShape,t.logicalShape),l=bD(i),u=i-a;let c;const h=["x","y","z","w","u","v"];c=0===a?"":i<2&&o.length>=1?"coords = 0;":o.map((e=>`coords.${h[e+u]} = 0;`)).join("\n");let d="";d=i<2&&a>0?"coords":e.shapeInfo.logicalShape.map(((e,t)=>`coords.${h[t+u]}`)).join(", ");let p="return outputValue;";const f=1===$t(e.shapeInfo.logicalShape),m=$t(t.logicalShape),g=1===m;if(1!==a||f||g){if(f&&!g)p=1===i?"\n return vec4(outputValue.x, outputValue.x, 0., 0.);\n ":"\n return vec4(outputValue.x);\n ";else if(o.length){const e=a-2,t=a-1;o.indexOf(e)>-1&&o.indexOf(t)>-1?p="return vec4(outputValue.x);":o.indexOf(e)>-1?p="return vec4(outputValue.x, outputValue.y, outputValue.x, outputValue.y);":o.indexOf(t)>-1&&(p="return vec4(outputValue.xx, outputValue.zz);")}}else p="\n return vec4(outputValue.xy, outputValue.xy);\n ";return`\n vec4 ${r}() {\n ${l} coords = getOutputCoords();\n ${c}\n vec4 outputValue = get${s}(${d});\n ${p}\n }\n `}(e,t):function(e,t){const n=e.name,s=n.charAt(0).toUpperCase()+n.slice(1),r="get"+s+"AtOutCoords",a=t.texShape,i=e.shapeInfo.texShape,o=e.shapeInfo.logicalShape.length,l=t.logicalShape.length;if(!e.shapeInfo.isUniform&&o===l&&null==e.shapeInfo.flatOffset&&Kt(i,a))return`\n float ${r}() {\n return sampleTexture(${n}, resultUV);\n }\n `;const u=bD(l),c=oD(e.shapeInfo.logicalShape,t.logicalShape),h=l-o;let d;const p=["x","y","z","w","u","v"];d=0===o?"":l<2&&c.length>=1?"coords = 0;":c.map((e=>`coords.${p[e+h]} = 0;`)).join("\n");let f="";f=l<2&&o>0?"coords":e.shapeInfo.logicalShape.map(((e,t)=>`coords.${p[t+h]}`)).join(", ");return`\n float ${r}() {\n ${u} coords = getOutputCoords();\n ${d}\n return get${s}(${f});\n }\n `}(e,t));return r}(e,t,n.packedInputs,n.enableShapeUniforms))).join("\n"),i=t.texShape,o=tD(),l=function(e){return`\n float sampleTexture(sampler2D textureSampler, vec2 uv) {\n return ${e.texture2D}(textureSampler, uv).r;\n }\n `}(o);let u,c,h=function(e){const t=`${e.version}\n precision highp float;\n precision highp int;\n precision highp sampler2D;\n ${e.varyingFs} vec2 resultUV;\n ${e.defineOutput}\n const vec2 halfCR = vec2(0.5, 0.5);\n\n struct ivec5\n {\n int x;\n int y;\n int z;\n int w;\n int u;\n };\n\n struct ivec6\n {\n int x;\n int y;\n int z;\n int w;\n int u;\n int v;\n };\n\n uniform float NAN;\n ${e.defineSpecialNaN}\n ${e.defineSpecialInf}\n ${e.defineRound}\n\n int imod(int x, int y) {\n return x - y * (x / y);\n }\n\n int idiv(int a, int b, float sign) {\n int res = a / b;\n int mod = imod(a, b);\n if (sign < 0. && mod != 0) {\n res -= 1;\n }\n return res;\n }\n\n //Based on the work of Dave Hoskins\n //https://www.shadertoy.com/view/4djSRW\n #define HASHSCALE1 443.8975\n float random(float seed){\n vec2 p = resultUV * seed;\n vec3 p3 = fract(vec3(p.xyx) * HASHSCALE1);\n p3 += dot(p3, p3.yzx + 19.19);\n return fract((p3.x + p3.y) * p3.z);\n }\n\n ${hD}\n ${dD}\n ${pD}\n `;return t}(o);t.isPacked?(u=function(e,t,n){switch(e.length){case 0:return mD();case 1:return function(e,t,n){const s=[Math.ceil(t[0]/2),Math.ceil(t[1]/2)];if(1===s[0])return n?"\n int getOutputCoords() {\n return 2 * int(resultUV.x * ceil(float(outTexShape[1]) / 2.0));\n }\n ":`\n int getOutputCoords() {\n return 2 * int(resultUV.x * ${s[1]}.0);\n }\n `;if(1===s[1])return n?"\n int getOutputCoords() {\n return 2 * int(resultUV.y * ceil(float(outTexShape[0]) / 2.0));\n }\n ":`\n int getOutputCoords() {\n return 2 * int(resultUV.y * ${s[0]}.0);\n }\n `;if(n)return"\n int getOutputCoords() {\n ivec2 packedTexShape = ivec2(ceil(float(outTexShape[0]) / 2.0), ceil(float(outTexShape[1]) / 2.0));\n ivec2 resTexRC = ivec2(resultUV.yx *\n vec2(packedTexShape[0], packedTexShape[1]));\n return 2 * (resTexRC.x * packedTexShape[1] + resTexRC.y);\n }\n ";return`\n int getOutputCoords() {\n ivec2 resTexRC = ivec2(resultUV.yx *\n vec2(${s[0]}, ${s[1]}));\n return 2 * (resTexRC.x * ${s[1]} + resTexRC.y);\n }\n `}(0,t,n);case 2:return function(e,t,n){const s=[Math.ceil(t[0]/2),Math.ceil(t[1]/2)];if(Kt(e,t))return n?"\n ivec2 getOutputCoords() {\n ivec2 packedTexShape = ivec2(ceil(float(outTexShape[0]) / 2.0), ceil(float(outTexShape[1]) / 2.0));\n return 2 * ivec2(resultUV.yx * vec2(packedTexShape[0], packedTexShape[1]));\n }\n ":`\n ivec2 getOutputCoords() {\n return 2 * ivec2(resultUV.yx * vec2(${s[0]}, ${s[1]}));\n }\n `;const r=Math.ceil(e[1]/2);if(n)return"\n ivec2 getOutputCoords() {\n ivec2 packedTexShape = ivec2(ceil(float(outTexShape[0]) / 2.0), ceil(float(outTexShape[1]) / 2.0));\n int texelsInLogicalRow = int(ceil(float(outShape[1]) / 2.0));\n ivec2 resTexRC = ivec2(resultUV.yx *\n vec2(packedTexShape[0], packedTexShape[1]));\n\n int index = resTexRC.x * packedTexShape[1] + resTexRC.y;\n int r = 2 * (index / texelsInLogicalRow);\n int c = imod(index, texelsInLogicalRow) * 2;\n\n return ivec2(r, c);\n }\n ";return`\n ivec2 getOutputCoords() {\n ivec2 resTexRC = ivec2(resultUV.yx *\n vec2(${s[0]}, ${s[1]}));\n\n int index = resTexRC.x * ${s[1]} + resTexRC.y;\n int r = 2 * (index / ${r});\n int c = imod(index, ${r}) * 2;\n\n return ivec2(r, c);\n }\n `}(e,t,n);case 3:return function(e,t,n){if(n)return"\n ivec3 getOutputCoords() {\n ivec2 packedTexShape = ivec2(ceil(float(outTexShape[0]) / 2.0), ceil(float(outTexShape[1]) / 2.0));\n int texelsInLogicalRow = int(ceil(float(outShape[2]) / 2.0));\n int texelsInBatch = texelsInLogicalRow * int(ceil(float(outShape[1]) / 2.0));\n ivec2 resTexRC = ivec2(resultUV.yx *\n vec2(packedTexShape[0], packedTexShape[1]));\n int index = resTexRC.x * packedTexShape[1] + resTexRC.y;\n\n int b = index / texelsInBatch;\n index -= b * texelsInBatch;\n\n int r = 2 * (index / texelsInLogicalRow);\n int c = imod(index, texelsInLogicalRow) * 2;\n\n return ivec3(b, r, c);\n }\n ";const s=[Math.ceil(t[0]/2),Math.ceil(t[1]/2)],r=Math.ceil(e[2]/2),a=r*Math.ceil(e[1]/2);return`\n ivec3 getOutputCoords() {\n ivec2 resTexRC = ivec2(resultUV.yx *\n vec2(${s[0]}, ${s[1]}));\n int index = resTexRC.x * ${s[1]} + resTexRC.y;\n\n int b = index / ${a};\n index -= b * ${a};\n\n int r = 2 * (index / ${r});\n int c = imod(index, ${r}) * 2;\n\n return ivec3(b, r, c);\n }\n `}(e,t,n);default:return function(e,t,n){if(n)return"\n ivec4 getOutputCoords() {\n ivec2 packedTexShape = ivec2(ceil(float(outTexShape[0]) / 2.0), ceil(float(outTexShape[1]) / 2.0));\n ivec2 resTexRC = ivec2(resultUV.yx *\n vec2(packedTexShape[0], packedTexShape[1]));\n int index = resTexRC.x * packedTexShape[1] + resTexRC.y;\n\n int texelsInLogicalRow = int(ceil(float(outShape[3]) / 2.0));\n int texelsInBatch = texelsInLogicalRow * int(ceil(float(outShape[2]) / 2.0));\n int texelsInBatchN = texelsInBatch * outShape[1];\n\n int b2 = index / texelsInBatchN;\n index -= b2 * texelsInBatchN;\n\n int b = index / texelsInBatch;\n index -= b * texelsInBatch;\n\n int r = 2 * (index / texelsInLogicalRow);\n int c = imod(index, texelsInLogicalRow) * 2;\n\n return ivec4(b2, b, r, c);\n }\n ";const s=[Math.ceil(t[0]/2),Math.ceil(t[1]/2)],r=Math.ceil(e[e.length-1]/2),a=r*Math.ceil(e[e.length-2]/2);let i=a,o="",l="b, r, c";for(let t=2;t1&&!Kt(t,n)&&s.lengthe[t])).join(", ")}function AD(e,t,n,s){const r=n.map(((e,n)=>{const s={logicalShape:e.shape,texShape:e.isUniform?null:e.texData.texShape,isUniform:e.isUniform,isPacked:!e.isUniform&&e.texData.isPacked,flatOffset:null};return null!=e.texData&&null!=e.texData.slice&&e.texData.slice.flatOffset>0&&(s.flatOffset=e.texData.slice.flatOffset),{name:t.variableNames[n],shapeInfo:s}})),a=r.map((e=>e.shapeInfo)),i={logicalShape:s.shape,texShape:s.texData.texShape,isUniform:!1,isPacked:s.texData.isPacked,flatOffset:null},o=lD(r,i,t),l=function(e,t){const n=VR(e,(()=>e.createShader(e.FRAGMENT_SHADER)),"Unable to create fragment WebGLShader.");if(TR(e,(()=>e.shaderSource(n,t))),TR(e,(()=>e.compileShader(n))),Sn().get("ENGINE_COMPILE_ONLY"))return n;if(!1===e.getShaderParameter(n,e.COMPILE_STATUS))throw DR(t,e.getShaderInfoLog(n)),new Error("Failed to compile fragment shader.");return n}(e.gl,o),u=e.createProgram(l);return Sn().get("ENGINE_COMPILE_ONLY")?{program:t,fragmentShader:l,source:o,webGLProgram:u,inShapeInfos:a,outShapeInfo:i,variablesLocations:null,customUniformLocations:null,infLoc:null,nanLoc:null,outShapeLocation:null,outShapeStridesLocation:null,outTexShapeLocation:null}:(e.buildVao(u),Object.assign({program:t,fragmentShader:l,source:o,webGLProgram:u,inShapeInfos:a,outShapeInfo:i},kD(e,t,u)))}function kD(e,t,n){const s=[],r=[];let a,i,o,l=null,u=null;u=e.getUniformLocation(n,"NAN",!1),1===Sn().getNumber("WEBGL_VERSION")&&(l=e.getUniformLocation(n,"INFINITY",!1));const c=!1;for(const r of t.variableNames){const a={name:r,uniform:e.getUniformLocation(n,r,c),offset:e.getUniformLocation(n,`offset${r}`,c)};t.enableShapeUniforms&&(a.shape=e.getUniformLocation(n,`${r}Shape`,c),a.texShape=e.getUniformLocation(n,`${r}TexShape`,c)),s.push(a)}if(t.enableShapeUniforms&&(a=e.getUniformLocation(n,"outShape",c),o=e.getUniformLocation(n,"outShapeStrides",c),i=e.getUniformLocation(n,"outTexShape",c)),t.customUniforms)for(const s of t.customUniforms)r.push(e.getUniformLocation(n,s.name,c));return{variablesLocations:s,customUniformLocations:r,infLoc:l,nanLoc:u,outShapeLocation:a,outShapeStridesLocation:o,outTexShapeLocation:i}}function CD(e,t){if(e.length!==t.length)throw Error(`Binary was compiled with ${e.length} inputs, but was executed with ${t.length} inputs`);e.forEach(((e,n)=>{const s=e.logicalShape,r=t[n],a=r.shape;if(!Kt(s,a))throw Error(`Binary was compiled with different shapes than the current args. Shapes ${s} and ${a} must match`);if(e.isUniform&&r.isUniform)return;const i=e.texShape,o=r.isUniform?null:r.texData.texShape;if(!Kt(i,o))throw Error(`Binary was compiled with different texture shapes than the current args. Shape ${i} and ${o} must match`)}))}function SD(e){return Sn().getBool("WEBGL_USE_SHAPES_UNIFORMS")&&e<=4}class ED{constructor(e){this.variableNames=["A"],this.packedInputs=!1,this.packedOutput=!0,this.outPackingScheme=AR.DENSE,this.customUniforms=[{name:"texShape",type:"ivec2"}];const t=tD();this.outputShape=e,this.enableShapeUniforms=SD(this.outputShape.length),this.userCode=`\n ivec3 outCoordsFromFlatIndex(int index) {\n ${this.enableShapeUniforms?sD(["r","c","d"],e):nD(["r","c","d"],e)}\n return ivec3(r, c, d);\n }\n\n void main() {\n ivec2 resTexRC = ivec2(resultUV.yx * vec2(texShape[0], texShape[1]));\n int index = 4 * (resTexRC.x * texShape[1] + resTexRC.y);\n\n vec4 result = vec4(0.);\n\n for (int i=0; i<4; i++) {\n int flatIndex = index + i;\n ivec3 rc = outCoordsFromFlatIndex(flatIndex);\n result[i] = getA(rc.x, rc.y, rc.z);\n }\n\n ${t.output} = result;\n }\n `}}class _D{constructor(e){this.variableNames=["A"],this.packedInputs=!0,this.packedOutput=!0,this.outPackingScheme=AR.DENSE,this.customUniforms=[{name:"texShape",type:"ivec2"}];const t=tD();this.outputShape=e,this.enableShapeUniforms=SD(this.outputShape.length),this.userCode=`\n ivec3 outCoordsFromFlatIndex(int index) {\n ${this.enableShapeUniforms?sD(["r","c","d"],e):nD(["r","c","d"],e)}\n return ivec3(r, c, d);\n }\n\n void main() {\n ivec2 resTexRC = ivec2(resultUV.yx * vec2(texShape[0], texShape[1]));\n int index = 4 * (resTexRC.x * texShape[1] + resTexRC.y);\n\n vec4 result = vec4(0.);\n\n for (int i=0; i<4; i++) {\n int flatIndex = index + i;\n ivec3 rc = outCoordsFromFlatIndex(flatIndex);\n result[i] = getChannel(getA(rc.x, rc.y, rc.z), vec2(rc.y, rc.z));\n }\n\n ${t.output} = result;\n }\n `}}class ID{constructor(e){this.variableNames=["A"],this.outTexUsage=kR.DOWNLOAD;const t=tD();this.outputShape=e,this.userCode=`\n ${iD}\n\n void main() {\n float x = getAAtOutCoords();\n ${t.output} = encode_float(x);\n }\n `}}class TD{constructor(e){this.variableNames=["A"],this.packedInputs=!0,this.packedOutput=!1,this.outTexUsage=kR.DOWNLOAD;const t=tD();this.outputShape=e,this.userCode=`\n ${iD}\n\n void main() {\n ivec3 coords = getOutputCoords();\n float x = getChannel(getAAtOutCoords(), vec2(coords.y, coords.z));\n ${t.output} = encode_float(x);\n }\n `}}const ND={R:0,G:1,B:2,A:3};class OD{constructor(e,t=!1,n="RGBA"){this.variableNames=["A"],this.customUniforms=[{name:"texShape",type:"ivec2"}];const s=tD();this.outputShape=e,this.enableShapeUniforms=SD(this.outputShape.length);let r="result";t&&(r="floor(result * 255. + 0.5)");let a="";for(let e=0;ee.createShader(e.VERTEX_SHADER)),"Unable to create vertex WebGLShader.");if(TR(e,(()=>e.shaderSource(n,t))),TR(e,(()=>e.compileShader(n))),!1===e.getShaderParameter(n,e.COMPILE_STATUS))throw new Error("Failed to compile vertex shader.");return n}(e,`${t.version}\n precision highp float;\n ${t.attribute} vec3 clipSpacePos;\n ${t.attribute} vec2 uv;\n ${t.varyingVs} vec2 resultUV;\n\n void main() {\n gl_Position = vec4(clipSpacePos, 1);\n resultUV = uv;\n }`)}function MD(e){return function(e,t){const n=VR(e,(()=>e.createBuffer()),"Unable to create WebGLBuffer");return TR(e,(()=>e.bindBuffer(e.ARRAY_BUFFER,n))),TR(e,(()=>e.bufferData(e.ARRAY_BUFFER,t,e.STATIC_DRAW))),n}(e,new Float32Array([-1,1,0,0,1,-1,-1,0,0,0,1,1,0,1,1,1,-1,0,1,0]))}function FD(e){return function(e,t){const n=VR(e,(()=>e.createBuffer()),"Unable to create WebGLBuffer");return TR(e,(()=>e.bindBuffer(e.ELEMENT_ARRAY_BUFFER,n))),TR(e,(()=>e.bufferData(e.ELEMENT_ARRAY_BUFFER,t,e.STATIC_DRAW))),n}(e,new Uint16Array([0,1,2,2,1,3]))}function BD(e,t,n,s,r,a){!function(e,t){const n=Sn().getNumber("WEBGL_MAX_TEXTURE_SIZE");if(e<=0||t<=0)throw new Error(`Requested texture size [${e}x${t}] is invalid.`);if(e>n||t>n)throw new Error(`Requested texture size [${e}x${t}] greater than WebGL maximum on this browser / GPU [${n}x${n}].`)}(t,n);const i=function(e){return VR(e,(()=>e.createTexture()),"Unable to create WebGLTexture.")}(e),o=e.TEXTURE_2D;return TR(e,(()=>e.bindTexture(o,i))),TR(e,(()=>e.texParameteri(o,e.TEXTURE_WRAP_S,e.CLAMP_TO_EDGE))),TR(e,(()=>e.texParameteri(o,e.TEXTURE_WRAP_T,e.CLAMP_TO_EDGE))),TR(e,(()=>e.texParameteri(o,e.TEXTURE_MIN_FILTER,e.NEAREST))),TR(e,(()=>e.texParameteri(o,e.TEXTURE_MAG_FILTER,e.NEAREST))),1===Sn().getNumber("WEBGL_VERSION")?TR(e,(()=>e.texImage2D(o,0,s,t,n,0,r,a,null))):TR(e,(()=>e.texStorage2D(o,1,s,t,n))),TR(e,(()=>e.bindTexture(e.TEXTURE_2D,null))),{texture:i,texShape:[n,t]}}function zD(e){return e.internalFormatFloat}function LD(e){return e.internalFormatHalfFloat}function PD(e){return e.downloadTextureFormat}function VD(e){return e.internalFormatPackedFloat}function WD(e){return e.internalFormatPackedHalfFloat}function UD(e,t,n,s,r,a,i,o){const l=e,u=new Float32Array(function(e,t){const[n,s]=_R(e,t);return n*s*4}(a,i));return l.bindBuffer(l.PIXEL_PACK_BUFFER,t),l.getBufferSubData(l.PIXEL_PACK_BUFFER,0,u),l.bindBuffer(l.PIXEL_PACK_BUFFER,null),u}class GD{constructor(e){this.outputTexture=null,this.program=null,this.disposed=!1,this.itemsToPoll=[];const t=Sn().getNumber("WEBGL_VERSION");if(null!=e?(this.gl=e,function(e,t){wR[e]=t}(t,e)):this.gl=xR(t),e=this.gl,2===Sn().getNumber("WEBGL_VERSION")){const t=e;this.createVertexArray=()=>TR(t,(()=>t.createVertexArray())),this.bindVertexArray=e=>TR(t,(()=>t.bindVertexArray(e))),this.deleteVertexArray=e=>TR(t,(()=>t.deleteVertexArray(e))),this.getVertexArray=()=>TR(t,(()=>t.getParameter(t.VERTEX_ARRAY_BINDING)))}else if(null!=e){const t=e.getExtension("OES_vertex_array_object");if(null==t)throw new Error("All WebGL1 implementations are expected to offer OES_vertex_array_object.");this.createVertexArray=()=>TR(e,(()=>t.createVertexArrayOES())),this.bindVertexArray=n=>TR(e,(()=>t.bindVertexArrayOES(n))),this.deleteVertexArray=n=>TR(e,(()=>t.deleteVertexArrayOES(n))),this.getVertexArray=()=>TR(e,(()=>e.getParameter(t.VERTEX_ARRAY_BINDING_OES)))}let n="WEBGL_color_buffer_float";const s="EXT_color_buffer_half_float";if(this.parallelCompilationExtension=this.gl.getExtension("KHR_parallel_shader_compile"),1===Sn().getNumber("WEBGL_VERSION")){const e="OES_texture_float",t="OES_texture_half_float";if(this.textureFloatExtension=OR(this.gl,e),XR(this.gl,t))this.textureHalfFloatExtension=OR(this.gl,t);else if(Sn().get("WEBGL_FORCE_F16_TEXTURES"))throw new Error("GL context does not support half float textures, yet the environment flag WEBGL_FORCE_F16_TEXTURES is set to true.");if(this.colorBufferFloatExtension=this.gl.getExtension(n),XR(this.gl,s))this.colorBufferHalfFloatExtension=OR(this.gl,s);else if(Sn().get("WEBGL_FORCE_F16_TEXTURES"))throw new Error("GL context does not support color renderable half floats, yet the environment flag WEBGL_FORCE_F16_TEXTURES is set to true.")}else if(n="EXT_color_buffer_float",XR(this.gl,n))this.colorBufferFloatExtension=this.gl.getExtension(n);else{if(!XR(this.gl,s))throw new Error("GL context does not support color renderable floats");this.colorBufferHalfFloatExtension=this.gl.getExtension(s)}this.vertexBuffer=MD(this.gl),this.indexBuffer=FD(this.gl),this.framebuffer=function(e){return VR(e,(()=>e.createFramebuffer()),"Unable to create WebGLFramebuffer.")}(this.gl),this.textureConfig=IR(this.gl,this.textureHalfFloatExtension)}get debug(){return Sn().getBool("DEBUG")}dispose(){if(this.disposed)return;this.program,this.outputTexture;const e=this.gl;TR(e,(()=>e.finish())),TR(e,(()=>e.bindFramebuffer(e.FRAMEBUFFER,null))),TR(e,(()=>e.deleteFramebuffer(this.framebuffer))),TR(e,(()=>e.bindBuffer(e.ARRAY_BUFFER,null))),TR(e,(()=>e.bindBuffer(e.ELEMENT_ARRAY_BUFFER,null))),TR(e,(()=>e.deleteBuffer(this.indexBuffer))),this.disposed=!0}createFloat32MatrixTexture(e,t){return this.throwIfDisposed(),function(e,t,n,s){const[r,a]=SR(t,n);return BD(e,r,a,zD(s),s.textureFormatFloat,e.FLOAT)}(this.gl,e,t,this.textureConfig)}createFloat16MatrixTexture(e,t){return this.throwIfDisposed(),function(e,t,n,s){const[r,a]=SR(t,n);return BD(e,r,a,LD(s),s.textureFormatFloat,s.textureTypeHalfFloat)}(this.gl,e,t,this.textureConfig)}createUnsignedBytesMatrixTexture(e,t){return this.throwIfDisposed(),function(e,t,n,s){const[r,a]=SR(t,n);return BD(e,r,a,PD(s),e.RGBA,e.UNSIGNED_BYTE)}(this.gl,e,t,this.textureConfig)}uploadPixelDataToTexture(e,t){this.throwIfDisposed(),function(e,t,n){TR(e,(()=>e.bindTexture(e.TEXTURE_2D,t))),n.data instanceof Uint8Array?2===Sn().getNumber("WEBGL_VERSION")?TR(e,(()=>e.texSubImage2D(e.TEXTURE_2D,0,0,0,n.width,n.height,e.RGBA,e.UNSIGNED_BYTE,n.data))):TR(e,(()=>e.texImage2D(e.TEXTURE_2D,0,e.RGBA,n.width,n.height,0,e.RGBA,e.UNSIGNED_BYTE,n.data))):2===Sn().getNumber("WEBGL_VERSION")?TR(e,(()=>e.texSubImage2D(e.TEXTURE_2D,0,0,0,e.RGBA,e.UNSIGNED_BYTE,n))):TR(e,(()=>e.texImage2D(e.TEXTURE_2D,0,e.RGBA,e.RGBA,e.UNSIGNED_BYTE,n))),TR(e,(()=>e.bindTexture(e.TEXTURE_2D,null)))}(this.gl,e,t)}uploadDenseMatrixToTexture(e,t,n,s){this.throwIfDisposed(),function(e,t,n,s,r,a){let i,o,l;TR(e,(()=>e.bindTexture(e.TEXTURE_2D,t))),r instanceof Uint8Array?(i=new Uint8Array(n*s*4),o=e.UNSIGNED_BYTE,l=e.RGBA):(i=new Float32Array(n*s*4),o=e.FLOAT,l=a.internalFormatPackedFloat),i.set(r),2===Sn().getNumber("WEBGL_VERSION")?TR(e,(()=>e.texSubImage2D(e.TEXTURE_2D,0,0,0,n,s,e.RGBA,o,i))):TR(e,(()=>e.texImage2D(e.TEXTURE_2D,0,l,n,s,0,e.RGBA,o,i))),TR(e,(()=>e.bindTexture(e.TEXTURE_2D,null)))}(this.gl,e,t,n,s,this.textureConfig)}createFloat16PackedMatrixTexture(e,t){return this.throwIfDisposed(),function(e,t,n,s){const[r,a]=_R(t,n);return BD(e,r,a,WD(s),e.RGBA,s.textureTypeHalfFloat)}(this.gl,e,t,this.textureConfig)}createPackedMatrixTexture(e,t){return this.throwIfDisposed(),function(e,t,n,s){const[r,a]=_R(t,n);return BD(e,r,a,VD(s),e.RGBA,e.FLOAT)}(this.gl,e,t,this.textureConfig)}deleteMatrixTexture(e){this.throwIfDisposed(),this.outputTexture===e&&(LR(this.gl,this.framebuffer),this.outputTexture=null),TR(this.gl,(()=>this.gl.deleteTexture(e)))}downloadByteEncodedFloatMatrixFromOutputTexture(e,t,n){return this.downloadMatrixDriver(e,(()=>function(e,t,n,s){const[r,a]=SR(t,n),i=new Uint8Array(t*n*4);return TR(e,(()=>e.readPixels(0,0,r,a,s.downloadTextureFormat,e.UNSIGNED_BYTE,i))),new Float32Array(i.buffer)}(this.gl,t,n,this.textureConfig)))}downloadPackedMatrixFromBuffer(e,t,n,s,r,a){return UD(this.gl,e,0,0,0,r,a,this.textureConfig)}downloadFloat32MatrixFromBuffer(e,t){return function(e,t,n){const s=e,r=new Float32Array(n);return s.bindBuffer(s.PIXEL_PACK_BUFFER,t),s.getBufferSubData(s.PIXEL_PACK_BUFFER,0,r),s.bindBuffer(s.PIXEL_PACK_BUFFER,null),r}(this.gl,e,t)}createBufferFromTexture(e,t,n){this.bindTextureToFrameBuffer(e);const s=function(e,t,n,s){const r=e.createBuffer();TR(e,(()=>e.bindBuffer(e.PIXEL_PACK_BUFFER,r)));const a=16*t*n;return TR(e,(()=>e.bufferData(e.PIXEL_PACK_BUFFER,a,e.STREAM_READ))),TR(e,(()=>e.readPixels(0,0,n,t,e.RGBA,e.FLOAT,0))),TR(e,(()=>e.bindBuffer(e.PIXEL_PACK_BUFFER,null))),r}(this.gl,t,n,this.textureConfig);return this.unbindTextureToFrameBuffer(),s}createAndWaitForFence(){const e=this.createFence(this.gl);return this.pollFence(e)}createFence(e){let t,n;if(Sn().getBool("WEBGL_FENCE_API_ENABLED")){const s=e,r=s.fenceSync(s.SYNC_GPU_COMMANDS_COMPLETE,0);e.flush(),n=()=>{const e=s.clientWaitSync(r,0,0);return e===s.ALREADY_SIGNALED||e===s.CONDITION_SATISFIED},t=r}else Sn().getNumber("WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_VERSION")>0?(t=this.beginQuery(),this.endQuery(),n=()=>this.isQueryAvailable(t,Sn().getNumber("WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_VERSION"))):n=()=>!0;return{query:t,isFencePassed:n}}downloadMatrixFromPackedTexture(e,t,n){return this.downloadMatrixDriver(e,(()=>function(e,t,n){const s=new Float32Array(t*n*4);return TR(e,(()=>e.readPixels(0,0,n,t,e.RGBA,e.FLOAT,s))),s}(this.gl,t,n)))}createProgram(e){this.throwIfDisposed();const t=this.gl;null==this.vertexShader&&(this.vertexShader=DD(t));const n=function(e){return VR(e,(()=>e.createProgram()),"Unable to create WebGLProgram.")}(t);TR(t,(()=>t.attachShader(n,this.vertexShader))),TR(t,(()=>t.attachShader(n,e))),function(e,t){if(TR(e,(()=>e.linkProgram(t))),!Sn().get("ENGINE_COMPILE_ONLY")&&!1===e.getProgramParameter(t,e.LINK_STATUS))throw new Error("Failed to link vertex and fragment shaders.")}(t,n);const s=Object.assign(n,{vao:this.createVertexArray()});return this.debug&&MR(t,s),s}buildVao(e){this.setProgram(e),this.bindVertexArray(e.vao);const t=this.gl;TR(t,(()=>t.bindBuffer(t.ELEMENT_ARRAY_BUFFER,this.indexBuffer))),function(e,t,n){TR(e,(()=>e.bindBuffer(e.ARRAY_BUFFER,n))),FR(e,t,"clipSpacePos",n,3,20,0)&&FR(e,t,"uv",n,2,20,12)}(t,e,this.vertexBuffer)}deleteProgram(e){this.throwIfDisposed(),e===this.program&&(this.program=null),null!=e&&(TR(this.gl,(()=>this.gl.deleteProgram(e))),this.deleteVertexArray(e.vao))}setProgram(e){this.throwIfDisposed(),this.program=e,null!=this.program&&this.debug&&MR(this.gl,this.program),TR(this.gl,(()=>this.gl.useProgram(e)))}getUniformLocation(e,t,n=!0){return this.throwIfDisposed(),n?function(e,t,n){return VR(e,(()=>e.getUniformLocation(t,n)),'uniform "'+n+'" not present in program.')}(this.gl,e,t):function(e,t,n){return e.getUniformLocation(t,n)}(this.gl,e,t)}getAttributeLocation(e,t){return this.throwIfDisposed(),TR(this.gl,(()=>this.gl.getAttribLocation(e,t)))}getUniformLocationNoThrow(e,t){return this.throwIfDisposed(),this.gl.getUniformLocation(e,t)}setInputMatrixTexture(e,t,n){this.throwIfDisposed(),this.throwIfNoProgram(),BR(this.gl,e,t,n)}setOutputMatrixTexture(e,t,n){this.setOutputMatrixTextureDriver(e,n,t)}setOutputPackedMatrixTexture(e,t,n){this.throwIfDisposed();const[s,r]=_R(t,n);this.setOutputMatrixTextureDriver(e,s,r)}setOutputMatrixWriteRegion(e,t,n,s){this.setOutputMatrixWriteRegionDriver(n,e,s,t)}setOutputPackedMatrixWriteRegion(e,t,n,s){throw new Error("setOutputPackedMatrixWriteRegion not implemented.")}debugValidate(){null!=this.program&&MR(this.gl,this.program),PR(this.gl)}executeProgram(){this.throwIfDisposed(),this.throwIfNoProgram();const e=this.gl;if(this.debug){this.getVertexArray();this.debugValidate()}TR(e,(()=>e.drawElements(e.TRIANGLES,6,e.UNSIGNED_SHORT,0)))}blockUntilAllProgramsCompleted(){this.throwIfDisposed(),TR(this.gl,(()=>this.gl.finish()))}getQueryTimerExtension(){return null==this.disjointQueryTimerExtension&&(this.disjointQueryTimerExtension=OR(this.gl,2===Sn().getNumber("WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_VERSION")?"EXT_disjoint_timer_query_webgl2":"EXT_disjoint_timer_query")),this.disjointQueryTimerExtension}getQueryTimerExtensionWebGL2(){return this.getQueryTimerExtension()}getQueryTimerExtensionWebGL1(){return this.getQueryTimerExtension()}beginQuery(){if(2===Sn().getNumber("WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_VERSION")){const e=this.gl,t=this.getQueryTimerExtensionWebGL2(),n=e.createQuery();return e.beginQuery(t.TIME_ELAPSED_EXT,n),n}const e=this.getQueryTimerExtensionWebGL1(),t=e.createQueryEXT();return e.beginQueryEXT(e.TIME_ELAPSED_EXT,t),t}endQuery(){if(2===Sn().getNumber("WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_VERSION")){const e=this.gl,t=this.getQueryTimerExtensionWebGL2();return void e.endQuery(t.TIME_ELAPSED_EXT)}const e=this.getQueryTimerExtensionWebGL1();e.endQueryEXT(e.TIME_ELAPSED_EXT)}async waitForQueryAndGetTime(e){return await Qt((()=>this.disposed||this.isQueryAvailable(e,Sn().getNumber("WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_VERSION")))),this.getQueryTime(e,Sn().getNumber("WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_VERSION"))}getQueryTime(e,t){if(0===t)return null;if(2===t){const t=this.gl;return t.getQueryParameter(e,t.QUERY_RESULT)/1e6}{const t=this.getQueryTimerExtensionWebGL1();return t.getQueryObjectEXT(e,t.QUERY_RESULT_EXT)/1e6}}isQueryAvailable(e,t){if(0===t)return!0;if(2===t){const t=this.gl,n=this.getQueryTimerExtensionWebGL2(),s=t.getQueryParameter(e,t.QUERY_RESULT_AVAILABLE);return null==this.disjoint&&(this.disjoint=this.gl.getParameter(n.GPU_DISJOINT_EXT)),s&&!this.disjoint}{const t=this.getQueryTimerExtensionWebGL1(),n=t.getQueryObjectEXT(e,t.QUERY_RESULT_AVAILABLE_EXT);return null==this.disjoint&&(this.disjoint=this.gl.getParameter(t.GPU_DISJOINT_EXT)),n&&!this.disjoint}}pollFence(e){return new Promise((t=>{this.addItemToPoll((()=>e.isFencePassed()),(()=>t()))}))}pollItems(){const e=function(e){let t=0;for(;te.isDoneFn)));for(let t=0;t<=e;++t){const{resolveFn:e}=this.itemsToPoll[t];e()}this.itemsToPoll=this.itemsToPoll.slice(e+1)}addItemToPoll(e,t){if(this.itemsToPoll.push({isDoneFn:e,resolveFn:t}),this.itemsToPoll.length>1)return;let n;"setTimeoutCustom"in Sn().platform&&(n=Sn().platform.setTimeoutCustom.bind(Sn().platform)),Qt((()=>(this.pollItems(),0===this.itemsToPoll.length)),(()=>0),null,n)}bindTextureToFrameBuffer(e){this.throwIfDisposed(),zR(this.gl,e,this.framebuffer),this.debug&&PR(this.gl)}unbindTextureToFrameBuffer(){null!=this.outputTexture?(zR(this.gl,this.outputTexture,this.framebuffer),this.debug&&PR(this.gl)):LR(this.gl,this.framebuffer)}downloadMatrixDriver(e,t){this.bindTextureToFrameBuffer(e);const n=t();return this.unbindTextureToFrameBuffer(),n}setOutputMatrixTextureDriver(e,t,n){this.throwIfDisposed();const s=this.gl;zR(s,e,this.framebuffer),this.debug&&PR(s),this.outputTexture=e,TR(s,(()=>s.viewport(0,0,t,n))),TR(s,(()=>s.scissor(0,0,t,n)))}setOutputMatrixWriteRegionDriver(e,t,n,s){this.throwIfDisposed(),TR(this.gl,(()=>this.gl.scissor(e,t,n,s)))}throwIfDisposed(){if(this.disposed)throw new Error("Attempted to use disposed GPGPUContext.")}throwIfNoProgram(){if(null==this.program)throw new Error("No GPU program is currently set.")}}const{addImpl:qD,bincountImpl:jD,bincountReduceImpl:HD,bitwiseAndImpl:$D,castImpl:KD,ceilImpl:XD,concatImpl:ZD,equalImpl:YD,expImpl:QD,expm1Impl:JD,floorImpl:eM,gatherNdImpl:tM,gatherV2Impl:nM,greaterImpl:sM,greaterEqualImpl:rM,lessImpl:aM,lessEqualImpl:iM,linSpaceImpl:oM,logImpl:lM,maxImpl:uM,maximumImpl:cM,minimumImpl:hM,multiplyImpl:dM,negImpl:pM,notEqualImpl:fM,prodImpl:mM,raggedGatherImpl:gM,raggedRangeImpl:yM,raggedTensorToTensorImpl:bM,rangeImpl:wM,rsqrtImpl:vM,scatterImpl:xM,sigmoidImpl:AM,simpleAbsImpl:kM,sliceImpl:CM,sparseFillEmptyRowsImpl:SM,sparseReshapeImpl:EM,sparseSegmentReductionImpl:_M,sqrtImpl:IM,staticRegexReplaceImpl:TM,stridedSliceImpl:NM,stringNGramsImpl:OM,stringSplitImpl:RM,stringToHashBucketFastImpl:DM,subImpl:MM,tileImpl:FM,topKImpl:BM,transposeImpl:zM,uniqueImpl:LM}=S;function PM(e,t){return["x","y","z","w","u","v"].slice(0,t).map((t=>`${e}.${t}`))}function VM(e,t){return 1===t?[e]:PM(e,t)}class WM{constructor(e){if(this.variableNames=["A"],this.packedInputs=!1,this.packedOutput=!0,this.outputShape=e,this.rank=e.length,this.enableShapeUniforms=SD(this.outputShape.length),0===this.rank)this.userCode="\n void main() {\n setOutput(vec4(getA(), 0., 0., 0.));\n }\n ";else{const e=VM("rc",this.rank),t=bD(this.rank),n=this.getOutOfBoundsCondition(e),s=this.getSetup(e),r=this.getOutput(e);this.userCode=`\n void main() {\n ${t} rc = getOutputCoords();\n\n if(${n}) {\n setOutput(vec4(0));\n } else {\n ${s}\n\n setOutput(vec4(${r}));\n }\n }\n `}}getSourceCoordsArr(e){const t=[];for(let n=0;n<=1;n++)for(let s=0;s<=1;s++){let r=`${0===n?"r":"rp1"}, ${0===s?"c":"cp1"}`;for(let t=2;t ${this.enableShapeUniforms?"outShape":this.outputShape[0]}`;let t="";for(let n=this.rank-2;n= ${this.enableShapeUniforms?`outShape[${n}]`:this.outputShape[n]}`,n= ${n};\n bool rEdge = rp1 >= ${s};\n `}getOutput(e){const t=this.getSourceCoordsArr(e);if(1===this.rank){return`getA(rc), (rc + 1 >= ${this.enableShapeUniforms?"outShape":this.outputShape[0]} ? 0. : getA(rc + 1)), 0, 0`}return`getA(${t[0]}),\n cEdge ? 0. : getA(${t[1]}),\n rEdge ? 0. : getA(${t[2]}),\n rEdge || cEdge ? 0. : getA(${t[3]})`}}class UM{constructor(e,t){this.variableNames=["A"],this.packedInputs=!0,this.packedOutput=!0,this.customUniforms=[{name:"inputShape",type:"ivec3"}],this.outputShape=e,this.enableShapeUniforms=SD(this.outputShape.length);let n="";for(let e=0;e<4;e++){let t="thisRC = rc;";e%2==1&&(t+="thisRC.z += 1;"),e>1&&(t+="thisRC.y += 1;"),n+=`\n ${t}\n ${e>0?"if(thisRC.y < rows && thisRC.z < cols){":""}\n int flatIndex = getFlatIndex(thisRC);\n\n ivec3 inputRC = inputCoordsFromReshapedOutCoords(flatIndex);\n vec2 inputRCInnerDims = vec2(float(inputRC.y),float(inputRC.z));\n\n result[${e}] =\n getChannel(getA(inputRC.x, inputRC.y, inputRC.z), inputRCInnerDims);\n ${e>0?"}":""}\n `}var s,r;this.userCode=`\n ${s=t,r=this.enableShapeUniforms,`\n ivec3 inputCoordsFromReshapedOutCoords(int index) {\n ${r?rD(["r","c","d"],"inputShape"):nD(["r","c","d"],s)}\n return ivec3(r, c, d);\n }\n `}\n ${this.enableShapeUniforms?"\n int getFlatIndex(ivec3 coords) {\n return coords.x * outShapeStrides[0] + coords.y * outShapeStrides[1] + coords.z;\n }\n":aD(e)}\n\n void main() {\n ivec3 rc = getOutputCoords();\n\n vec4 result = vec4(0.);\n\n ivec3 thisRC;\n int rows = ${this.enableShapeUniforms?"outShape[1]":e[1]};\n int cols = ${this.enableShapeUniforms?"outShape[2]":e[2]};\n\n ${n}\n\n setOutput(result);\n }\n `}}class GM{constructor(e){this.gpgpu=e,this.numUsedTextures=0,this.numFreeTextures=0,this._numBytesAllocated=0,this._numBytesFree=0,this.freeTextures={},this.usedTextures={},this.logEnabled=!1}acquireTexture(e,t,n){const s=jM(t,n),r=HM(e,s,n);r in this.freeTextures||(this.freeTextures[r]=[]),r in this.usedTextures||(this.usedTextures[r]=[]);const a=qM(e,s,this.gpgpu.gl,this.gpgpu.textureConfig,n);if(this.freeTextures[r].length>0){this.numFreeTextures--,this.numUsedTextures++,this._numBytesFree-=a,this.log();const e=this.freeTextures[r].pop();return this.usedTextures[r].push(e),e}let i;return s===CR.PACKED_2X2_FLOAT32?i=this.gpgpu.createPackedMatrixTexture(e[0],e[1]):s===CR.PACKED_2X2_FLOAT16?i=this.gpgpu.createFloat16PackedMatrixTexture(e[0],e[1]):s===CR.UNPACKED_FLOAT32?i=this.gpgpu.createFloat32MatrixTexture(e[0],e[1]):s===CR.UNPACKED_FLOAT16?i=this.gpgpu.createFloat16MatrixTexture(e[0],e[1]):s===CR.PACKED_4X1_UNSIGNED_BYTE&&(i=this.gpgpu.createUnsignedBytesMatrixTexture(e[0],e[1])),this.usedTextures[r].push(i),this.numUsedTextures++,this._numBytesAllocated+=a,this.log(),i}releaseTexture(e,t,n,s){if(null==this.freeTextures)return;const r=jM(n,s),a=HM(t,r,s);a in this.freeTextures||(this.freeTextures[a]=[]);const i=qM(t,r,this.gpgpu.gl,this.gpgpu.textureConfig,s),o=Sn().getNumber("WEBGL_DELETE_TEXTURE_THRESHOLD");-1!==o&&this._numBytesAllocated>o?(this.gpgpu.deleteMatrixTexture(e.texture),this._numBytesAllocated-=i):(this.freeTextures[a].push(e),this.numFreeTextures++,this._numBytesFree+=i),this.numUsedTextures--;const l=this.usedTextures[a],u=l&&l.indexOf(e);if(null==u||u<0)throw new Error("Cannot release a texture that was never provided by this texture manager");l[u]=l[l.length-1],l.pop(),this.log()}log(){if(!this.logEnabled)return;this.numFreeTextures,this.numUsedTextures,this._numBytesFree,this._numBytesAllocated}get numBytesAllocated(){return this._numBytesAllocated}get numBytesFree(){return this._numBytesFree}getNumUsedTextures(){return this.numUsedTextures}getNumFreeTextures(){return this.numFreeTextures}dispose(){if(null!=this.freeTextures){for(const e in this.freeTextures)this.freeTextures[e].forEach((e=>{this.gpgpu.deleteMatrixTexture(e.texture)}));for(const e in this.usedTextures)this.usedTextures[e].forEach((e=>{this.gpgpu.deleteMatrixTexture(e.texture)}));this.freeTextures=null,this.usedTextures=null,this.numUsedTextures=0,this.numFreeTextures=0,this._numBytesAllocated=0,this._numBytesFree=0}}}function qM(e,t,n,s,r){const a=function(e,t){switch(e){case CR.PACKED_2X2_FLOAT32:return VD(t);case CR.PACKED_2X2_FLOAT16:return WD(t);case CR.UNPACKED_FLOAT32:return zD(t);case CR.UNPACKED_FLOAT16:return LD(t);case CR.PACKED_4X1_UNSIGNED_BYTE:return PD(t);default:throw new Error(`Unknown physical texture type ${e}`)}}(t,s);let i;if(r){const[t,n]=_R(e[0],e[1]);i=t*n}else{const[t,n]=SR(e[0],e[1]);i=t*n}const o=function(e,t){const n=e;if(t===n.R32F)return 4;if(t===n.R16F)return 2;if(t===n.RGBA32F)return 16;if(t===e.RGBA)return 16;if(t===n.RGBA16F)return 8;if(t===n.RGBA8)return 4;throw new Error(`Unknown internal format ${t}`)}(n,a);return i*o}function jM(e,t){if(e===kR.UPLOAD)return CR.PACKED_2X2_FLOAT32;if(e===kR.RENDER||null==e)return function(e){return Sn().getBool("WEBGL_RENDER_FLOAT32_ENABLED")?e?CR.PACKED_2X2_FLOAT32:CR.UNPACKED_FLOAT32:e?CR.PACKED_2X2_FLOAT16:CR.UNPACKED_FLOAT16}(t);if(e===kR.DOWNLOAD||e===kR.PIXELS)return CR.PACKED_4X1_UNSIGNED_BYTE;throw new Error(`Unknown logical texture type ${e}`)}function HM(e,t,n){return`${e[0]}_${e[1]}_${t}_${n}`}class $M{constructor(e,t){this.variableNames=["A"],this.outputShape=e,this.enableShapeUniforms=SD(this.outputShape.length),this.userCode=`\n float unaryOperation(float x) {\n ${t}\n }\n\n void main() {\n float x = getAAtOutCoords();\n float y = unaryOperation(x);\n\n setOutput(y);\n }\n `}}const KM="if (isnan(x)) return x;",XM="return x;",ZM="return abs(x);";const YM="return (x >= 0.0) ? x : (exp(x) - 1.0);",QM=KM+"\n return (x < 0.0) ? 0.0 : x;\n",JM=KM+"\n return (x < 0.0) ? 0.0 : min(6.0, x);\n",eF="return x;",tF="return 1.0 / (1.0 + exp(-1.0 * x));",nF="return x;",sF="\n vec4 result;\n\n result.r = (x.r >= 0.0) ? x.r : (exp(x.r) - 1.0);\n result.g = (x.g >= 0.0) ? x.g : (exp(x.g) - 1.0);\n result.b = (x.b >= 0.0) ? x.b : (exp(x.b) - 1.0);\n result.a = (x.a >= 0.0) ? x.a : (exp(x.a) - 1.0);\n\n return result;\n",rF="\n vec4 result = x * vec4(greaterThanEqual(x, vec4(0.0)));\n bvec4 isNaN = isnan(x);\n\n result.r = isNaN.r ? x.r : result.r;\n result.g = isNaN.g ? x.g : result.g;\n result.b = isNaN.b ? x.b : result.b;\n result.a = isNaN.a ? x.a : result.a;\n\n return result;\n",aF="\n vec4 result = min(x, vec4(6.)) * vec4(greaterThanEqual(x, vec4(0.0)));\n bvec4 isNaN = isnan(x);\n\n result.r = isNaN.r ? x.r : result.r;\n result.g = isNaN.g ? x.g : result.g;\n result.b = isNaN.b ? x.b : result.b;\n result.a = isNaN.a ? x.a : result.a;\n\n return result;\n",iF="return 1.0 / (1.0 + exp(-1.0 * x));";class oF{constructor(e,t){this.variableNames=["A"],this.packedInputs=!0,this.packedOutput=!0,this.outputShape=e,this.enableShapeUniforms=SD(this.outputShape.length),this.userCode=`\n vec4 unaryOperation(vec4 x) {\n ${t}\n }\n\n void main() {\n vec4 x = getAAtOutCoords();\n vec4 y = unaryOperation(x);\n\n setOutput(y);\n }\n `}}class lF{constructor(e){this.variableNames=["A"],this.packedInputs=!0,this.packedOutput=!1,this.outputShape=e,this.enableShapeUniforms=SD(this.outputShape.length);const t=e.length,n=VM("rc",t),s=bD(t),r=function(e,t){if(1===e)return"rc";let n="";for(let s=0;st.push(e)))}const t=this.texData.get(e),{values:n,shape:s,slice:r,dtype:a,complexTensorInfos:i,isPacked:o}=t;if(null!=r){let t;t=o?new oF(s,eF):new $M(s,eF);const n=this.runWebGLProgram(t,[{dataId:e,shape:s,dtype:a}],a),r=this.read(n.dataId);return this.disposeIntermediateTensorInfo(n),r}if(null!=n)return this.convertAndCacheOnCPU(e);if(Sn().getBool("DEBUG")&&!Sn().getBool("WEBGL_DOWNLOAD_FLOAT_ENABLED")&&2===Sn().getNumber("WEBGL_VERSION"))throw new Error("tensor.data() with WEBGL_DOWNLOAD_FLOAT_ENABLED=false and WEBGL_VERSION=2 not yet supported.");let l,u,c=null;if("complex64"!==a&&Sn().get("WEBGL_BUFFER_SUPPORTED")){l=this.decode(e);const t=this.texData.get(l.dataId);c=this.gpgpu.createBufferFromTexture(t.texture.texture,...ER(s))}if(this.pendingRead.set(e,[]),"complex64"!==a&&await this.gpgpu.createAndWaitForFence(),"complex64"===a){const e=await Promise.all([this.read(i.real.dataId),this.read(i.imag.dataId)]);u=Zm(e[0],e[1])}else if(null==c)u=this.getValuesFromTexture(e);else{const e=$t(s);u=this.gpgpu.downloadFloat32MatrixFromBuffer(c,e)}if(null!=l&&this.disposeIntermediateTensorInfo(l),null!=c){const e=this.gpgpu.gl;TR(e,(()=>e.deleteBuffer(c)))}const h=this.convertAndCacheOnCPU(e,u),d=this.pendingRead.get(e);return this.pendingRead.delete(e),d.forEach((e=>e(h))),this.pendingDisposal.has(e)&&(this.pendingDisposal.delete(e),this.disposeData(e)&&vo().removeDataId(e,this),this.pendingDeletes--),h}readToGPU(e,t={}){const n=this.texData.get(e),{values:s,shape:r,slice:a,dtype:i,isPacked:o,texture:l}=n;if("complex64"===i)throw new Error("Does not support reading texture for complex64 dtype.");if(null!=a){let n;n=o?new oF(r,eF):new $M(r,eF);const s=this.runWebGLProgram(n,[{dataId:e,shape:r,dtype:i}],i),a=this.readToGPU(s,t);return this.disposeIntermediateTensorInfo(s),a}if(null==l)throw null!=s?new Error("Data is not on GPU but on CPU."):new Error("There is no data on GPU or CPU.");const u=this.decode(e,t.customTexShape),c=vo().makeTensorFromTensorInfo(u),h=this.texData.get(u.dataId);return Object.assign({tensorRef:c},h.texture)}bufferSync(e){const t=this.readSync(e.dataId);if("string"===e.dtype)try{const n=t.map((e=>gi(e)));return Tl(e.shape,e.dtype,n)}catch(e){throw new Error("Failed to decode encoded string bytes into utf-8")}return Tl(e.shape,e.dtype,t)}checkNumericalProblems(e){if(null!=e)for(let t=0;t0}time(e){const t=this.activeTimers,n=[];let s=!1;null==this.programTimersStack?(this.programTimersStack=n,s=!0):this.activeTimers.push(n),this.activeTimers=n,e();const r=bi(this.activeTimers.map((e=>e.query))).filter((e=>null!=e)),a=bi(this.activeTimers.map((e=>e.name))).filter((e=>null!=e));this.activeTimers=t,s&&(this.programTimersStack=null);const i={uploadWaitMs:this.uploadWaitMs,downloadWaitMs:this.downloadWaitMs,kernelMs:null,wallMs:null};return(async()=>{if(Sn().getNumber("WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_RELIABLE")>0){const e=await Promise.all(r);i.kernelMs=function(e){let t=0;for(let n=0;ne.map(((e,t)=>({name:a[t],ms:e}))).map((e=>`${e.name}: ${e.ms}`)).join(", ")}else i.kernelMs={error:"WebGL query timers are not supported in this environment."};return this.uploadWaitMs=0,this.downloadWaitMs=0,i})()}memory(){return{unreliable:!1,numBytesInGPU:this.numBytesInGPU,numBytesInGPUAllocated:this.textureManager.numBytesAllocated,numBytesInGPUFree:this.textureManager.numBytesFree}}startTimer(){return Sn().getNumber("WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_RELIABLE")>0?this.gpgpu.beginQuery():{startMs:fi(),endMs:null}}endTimer(e){return Sn().getNumber("WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_RELIABLE")>0?(this.gpgpu.endQuery(),e):(e.endMs=fi(),e)}async getQueryTime(e){if(Sn().getNumber("WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_RELIABLE")>0)return this.gpgpu.waitForQueryAndGetTime(e);const t=e;return t.endMs-t.startMs}disposeData(e,t=!1){if(this.pendingDisposal.has(e))return!1;if(!this.texData.has(e))return!0;if(t?this.texData.get(e).refCount=0:this.texData.get(e).refCount--,!t&&this.texData.get(e).refCount>0)return!1;if(this.pendingRead.has(e))return this.pendingDisposal.add(e),this.pendingDeletes++,!1;this.releaseGPUData(e);const{complexTensorInfos:n}=this.texData.get(e);return null!=n&&(this.disposeData(n.real.dataId,t),this.disposeData(n.imag.dataId,t)),this.texData.delete(e),!0}releaseGPUData(e){const{texture:t,dtype:n,texShape:s,usage:r,isPacked:a,slice:i}=this.texData.get(e),o=i&&i.origDataId||e,l=this.dataRefCount.get(o);l>1?this.dataRefCount.set(o,l-1):(this.dataRefCount.delete(o),null!=t&&(this.numBytesInGPU-=this.computeBytes(s,n),this.textureManager.releaseTexture(t,s,r,a)));const u=this.texData.get(e);u.texture=null,u.texShape=null,u.isPacked=!1,u.slice=null}getTexture(e){return this.uploadToGPU(e),this.texData.get(e).texture.texture}getDataInfo(e){return this.texData.get(e)}shouldExecuteOnCPU(e,t=hF){return Sn().getBool("WEBGL_CPU_FORWARD")&&e.every((e=>null==this.texData.get(e.dataId).texture&&$t(e.shape)0&&on(n[0])){const r=n.map((e=>mi(e)));s=this.write(r,e,t)}else s=this.write(n,e,t);return this.texData.get(s).usage=null,{dataId:s,shape:e,dtype:t}}makeOutput(e,t,n){return vo().makeTensorFromTensorInfo(this.makeTensorInfo(e,t,n),this)}unpackTensor(e){const t=new lF(e.shape);return this.runWebGLProgram(t,[e],e.dtype)}packTensor(e){const t=new WM(e.shape);return this.runWebGLProgram(t,[e],e.dtype,null,!0)}packedReshape(e,t){const n=[UR(e.shape),...GR(e.shape)],s={dtype:e.dtype,shape:n,dataId:e.dataId},r=[UR(t),...GR(t)],a=new UM(r,n),i=[n],o=this.runWebGLProgram(a,[s],e.dtype,i,!0);return{dataId:o.dataId,shape:t,dtype:o.dtype}}decode(e,t){const n=this.texData.get(e),{isPacked:s,shape:r,dtype:a}=n;if(null!=t){qt($t(r)<=t[0]*t[1]*4,(()=>"customTexShape is too small. Row * Column * 4 should be equal or larger than the size of the tensor data."))}const i=qR(r);let o;o=s?new _D(i):new ED(i);const l=[null!=t?t:ER(i)];return{dtype:a,shape:r,dataId:this.runWebGLProgram(o,[{shape:i,dtype:a,dataId:e}],a,l,!0,t).dataId}}runWebGLProgram(e,t,n,s,r=!1,a){const i=this.makeTensorInfo(e.outputShape,n),o=this.texData.get(i.dataId);if(e.packedOutput&&(o.isPacked=!0),e.outPackingScheme===AR.DENSE){const t=null!=a?a:ER(e.outputShape);o.texShape=t.map((e=>2*e))}if(null!=e.outTexUsage&&(o.usage=e.outTexUsage),0===$t(i.shape))return o.values=nn(i.dtype,0),i;const l=[],u=t.map((t=>{if("complex64"===t.dtype)throw new Error("GPGPUProgram does not support complex64 input. For complex64 dtypes, please separate the program into real and imaginary parts.");let n=this.texData.get(t.dataId);if(null==n.texture){if(!e.packedInputs&&$t(t.shape)<=Sn().getNumber("WEBGL_SIZE_UPLOAD_UNIFORM"))return{shape:t.shape,texData:null,isUniform:!0,uniformValues:n.values};e.packedInputs&&(n.isPacked=!0,n.shape=t.shape)}if(this.uploadToGPU(t.dataId),!!n.isPacked!=!!e.packedInputs)t=n.isPacked?this.unpackTensor(t):this.packTensor(t),l.push(t),n=this.texData.get(t.dataId);else if(n.isPacked&&!HR(n.shape,t.shape)){const e=t,s=t.shape;t.shape=n.shape,t=this.packedReshape(t,s),l.push(t),n=this.texData.get(t.dataId),e.shape=s}return{shape:t.shape,texData:n,isUniform:!1}}));this.uploadToGPU(i.dataId);const c={shape:i.shape,texData:o,isUniform:!1},h=function(e,t,n){let s="";t.concat(n).forEach((t=>{const r=null!=t.texData&&null!=t.texData.slice&&t.texData.slice.flatOffset>0;if(e.enableShapeUniforms&&!t.isUniform){const a=t.texData.texShape,{useSqueezeShape:i,uniformShape:o,keptDims:l}=wD(e.packedInputs,t.shape,a);let u="",c="",h="";if(1===o.length&&e.packedInputs){const e=[Math.ceil(a[0]/2),Math.ceil(a[1]/2)];u=`${e[0]>1}_${e[1]>1}`}else if(2!==o.length||e.packedInputs){if(o.length>2&&!e.packedInputs){const e=dn(o);h=`${e[0]===a[1]}_${e[e.length-1]===a[1]}`}}else c=`${o[0]>1}_${o[1]>1}`;const d=t.shape.length,p=2===o.length&&Kt(t.shape,a),f=1===$t(t.shape),m=tu(t.shape,n.shape),g=!e.packedInputs&&d===n.shape.length&&Kt(a,n.texData.texShape),y=e.packedInputs||o.length>2?"":`${a[0]>1}_${a[1]>1}`;s+=`${d}_${g}_${i?l:""}_${o.length}_${f}_${m}_${p}_${u}_${c}_${h}_${y}_${r}`}else{const e=t.isUniform?"uniform":t.texData.texShape;s+=`${t.shape}_${e}_${r}`}}));const r=e.userCode;let a=e.constructor.name;return a+="_"+s+"_"+r+`${Sn().getNumber("WEBGL_VERSION")}`,a}(e,u,c),d=this.getAndSaveBinary(h,(()=>AD(this.gpgpu,e,u,c))),p=null!=this.activeTimers;let f;p&&(f=this.startTimer()),Sn().get("ENGINE_COMPILE_ONLY")||function(e,t,n,s,r){t.program.enableShapeUniforms||(CD(t.inShapeInfos,n),CD([t.outShapeInfo],[s]));const a=s.texData.texture,i=s.texData.texShape;s.texData.isPacked?e.setOutputPackedMatrixTexture(a.texture,i[0],i[1]):e.setOutputMatrixTexture(a.texture,i[0],i[1]),e.setProgram(t.webGLProgram),e.bindVertexArray(t.webGLProgram.vao),1===Sn().getNumber("WEBGL_VERSION")&&null!==t.infLoc&&e.gl.uniform1f(t.infLoc,1/0),null!==t.nanLoc&&e.gl.uniform1f(t.nanLoc,NaN);for(let s=0;sthis.disposeIntermediateTensorInfo(e))),p&&(f=this.endTimer(f),this.activeTimers.push({name:e.constructor.name,query:this.getQueryTime(f)}));const m=Sn().getNumber("WEBGL_FLUSH_THRESHOLD");if(m>0){const e=fi();e-this.lastGlFlushTime>m&&(this.gpgpu.gl.flush(),this.lastGlFlushTime=e)}if(!Sn().getBool("WEBGL_LAZILY_UNPACK")&&o.isPacked&&!1===r){const e=this.unpackTensor(i);return this.disposeIntermediateTensorInfo(i),e}return i}compileAndRun(e,t,n,s,r=!1){n=n||t[0].dtype;return this.runWebGLProgram(e,t,n,s,r)}getAndSaveBinary(e,t){return e in this.binaryCache||(this.binaryCache[e]=t()),this.binaryCache[e]}getTextureManager(){return this.textureManager}dispose(){if(!this.disposed){if(!Sn().getBool("IS_TEST")){Object.keys(this.binaryCache).forEach((e=>{this.gpgpu.deleteProgram(this.binaryCache[e].webGLProgram),delete this.binaryCache[e]}))}this.textureManager.dispose(),null!=this.canvas&&"undefined"!=typeof HTMLCanvasElement&&this.canvas instanceof HTMLCanvasElement?this.canvas.remove():this.canvas=null,this.gpgpuCreatedLocally&&(this.gpgpu.program=null,this.gpgpu.dispose()),this.disposed=!0}}floatPrecision(){return null==this.floatPrecisionValue&&(this.floatPrecisionValue=Ao((()=>{if(!Sn().get("WEBGL_RENDER_FLOAT32_ENABLED")){const e=Sn().getBool("DEBUG");Sn().set("DEBUG",!1);const t=this.abs(Wl(1e-8)).dataSync()[0];if(Sn().set("DEBUG",e),t>0)return 32}return 16}))),this.floatPrecisionValue}epsilon(){return 32===this.floatPrecision()?1e-7:1e-4}uploadToGPU(e){const t=this.texData.get(e),{shape:n,dtype:s,values:r,texture:a,usage:i,isPacked:o}=t;if(null!=a)return;const l=null!=this.activeTimers;let u;l&&(u=fi());let c=t.texShape;if(null==c&&(c=function(e,t=!1){let n=Sn().getNumber("WEBGL_MAX_TEXTURE_SIZE"),s=Sn().getNumber("WEBGL_MAX_SIZE_FOR_NARROW_TEXTURE");if(s===1/0&&Sn().getBool("WEBGL_AUTO_SQUARIFY_NARROW_TEXTURE_SHAPE")&&(s=n/2),t&&(n*=2,s*=2,1===(e=e.map(((t,n)=>n>=e.length-2?Ut(e[n]):e[n]))).length&&(e=[2,e[0]])),2!==e.length){const t=tn(e);e=t.newShape}let r=$t(e),a=null;e.length<=1&&r<=n?a=[1,r]:2===e.length&&e[0]<=n&&e[1]<=n?a=e:3===e.length&&e[0]*e[1]<=n&&e[2]<=n?a=[e[0]*e[1],e[2]]:3===e.length&&e[0]<=n&&e[1]*e[2]<=n?a=[e[0],e[1]*e[2]]:4===e.length&&e[0]*e[1]*e[2]<=n&&e[3]<=n?a=[e[0]*e[1]*e[2],e[3]]:4===e.length&&e[0]<=n&&e[1]*e[2]*e[3]<=n&&(a=[e[0],e[1]*e[2]*e[3]]);const i=null!=a&&Math.max(...a)>s&&Math.min(...a)<=(t?2:1)&&Math.min(...a)>0;if(null==a||i)if(t){const t=UR(e);let n=2,s=2;e.length&&([n,s]=GR(e)),r=t*(n/2)*(s/2),a=Zt(r).map((e=>2*e))}else a=Zt(r);return a}(n,o),t.texShape=c),null!=r){const e=qR(n);let a,i=c[1],h=c[0];const d=r instanceof Uint8Array||r instanceof Uint8ClampedArray;!o&&d||([i,h]=_R(c[0],c[1])),a=o?new RD(e,d):new OD(e,d);const p=d?[h,i]:c,f=this.makeTensorInfo(p,s),m=this.texData.get(f.dataId);m.usage=d?kR.PIXELS:kR.UPLOAD,m.texShape=p,this.gpgpu.uploadDenseMatrixToTexture(this.getTexture(f.dataId),i,h,r);const g=[[h,i]],y=!0,b=this.runWebGLProgram(a,[f],s,g,y),w=this.texData.get(b.dataId);t.texShape=w.texShape,t.isPacked=w.isPacked,t.usage=w.usage,Sn().get("ENGINE_COMPILE_ONLY")?this.disposeData(b.dataId):(t.texture=w.texture,t.values=null,this.texData.delete(b.dataId)),this.disposeIntermediateTensorInfo(f),l&&(this.uploadWaitMs+=fi()-u)}else{const e=this.acquireTexture(c,i,s,o);t.texture=e}}convertAndCacheOnCPU(e,t){const n=this.texData.get(e),{dtype:s}=n;return null!=t&&(n.values=function(e,t){if("float32"===t||"complex64"===t)return e;if("int32"===t||"bool"===t){const n="int32"===t?new Int32Array(e.length):new Uint8Array(e.length);for(let t=0;t1024*this.numMBBeforeWarning*1024){(this.numBytesInGPU/1024/1024).toFixed(2);this.warnedAboutMemory=!0}return this.textureManager.acquireTexture(e,t,s)}computeBytes(e,t){return e[0]*e[1]*an(t)}checkCompileCompletion(){for(const[,e]of Object.entries(this.binaryCache))this.checkCompletion_(e)}async checkCompileCompletionAsync(){const e=[];if(this.gpgpu.parallelCompilationExtension){for(const[,t]of Object.entries(this.binaryCache))e.push(this.checkCompletionAsync_(t));return Promise.all(e)}for(const[,t]of Object.entries(this.binaryCache)){const n=new Promise((e=>{try{this.checkCompletion_(t),e(!0)}catch(e){throw e}}));e.push(n)}return Promise.all(e)}async checkCompletionAsync_(e){return this.gpgpu.gl.getProgramParameter(e.webGLProgram,this.gpgpu.parallelCompilationExtension.COMPLETION_STATUS_KHR)?this.checkCompletion_(e):(await Sm(),this.checkCompletionAsync_(e))}checkCompletion_(e){if(!1===this.gpgpu.gl.getProgramParameter(e.webGLProgram,this.gpgpu.gl.LINK_STATUS)){if(!1===this.gpgpu.gl.getShaderParameter(e.fragmentShader,this.gpgpu.gl.COMPILE_STATUS))throw DR(e.source,this.gpgpu.gl.getShaderInfoLog(e.fragmentShader)),new Error("Failed to compile fragment shader.");throw new Error("Failed to link vertex and fragment shaders.")}return!0}getUniformLocations(){for(const e of Object.values(this.binaryCache)){this.gpgpu.buildVao(e.webGLProgram);const{variablesLocations:t,customUniformLocations:n,infLoc:s,nanLoc:r,outShapeLocation:a,outShapeStridesLocation:i,outTexShapeLocation:o}=kD(this.gpgpu,e.program,e.webGLProgram);e.variablesLocations=t,e.customUniformLocations=n,e.infLoc=s,e.nanLoc=r,e.outShapeLocation=a,e.outShapeStridesLocation=i,e.outTexShapeLocation=o}}createTensorFromGPUData(e,t,n){e.channels=e.channels||"RGBA";const{texture:s,height:r,width:a,channels:i}=e,o=vo().backend;if(!o.gpgpu.gl.isTexture(s))throw new Error("The texture is invalid. Also, please make sure the texture and the TFJS WebGL backend are using the same canvas. If you want to use your own custom canvas, you have to create and use the custom TFJS WebGL backend created from the canvas through 'new tf.MathBackendWebGL(customCanvas)'.");const l=o.writeTexture(s,t,n,r,a,i);return vo().makeTensorFromDataId(l,t,n,o)}}dF.nextDataId=0;ao()&&So("webgl",(()=>new dF),2);const pF="\n if (isnan(a)) return a;\n if (isnan(b)) return b;\n";class fF{constructor(e,t,n){this.variableNames=["A","B"],this.outputShape=su(t,n),this.enableShapeUniforms=SD(this.outputShape.length),this.userCode=`\n float binaryOperation(float a, float b) {\n ${e}\n }\n\n void main() {\n float a = getAAtOutCoords();\n float b = getBAtOutCoords();\n setOutput(binaryOperation(a, b));\n }\n `}}const mF="\n result.r = isNaN.r ? NAN : result.r;\n result.g = isNaN.g ? NAN : result.g;\n result.b = isNaN.b ? NAN : result.b;\n result.a = isNaN.a ? NAN : result.a;\n";class gF{constructor(e,t,n,s=!1){this.variableNames=["A","B"],this.supportsBroadcasting=!0,this.packedInputs=!0,this.packedOutput=!0,this.outputShape=su(t,n);const r=this.outputShape.length;this.enableShapeUniforms=SD(r);let a="";if(s)if(0===r||1===$t(this.outputShape))a="\n result.y = 0.;\n result.z = 0.;\n result.w = 0.;\n ";else{if(a=`\n ${bD(r)} coords = getOutputCoords();\n `,1===r)this.enableShapeUniforms?a+="\n result.y = (coords + 1) >= outShape ? 0. : result.y;\n result.z = 0.;\n result.w = 0.;\n ":a+=`\n result.y = (coords + 1) >= ${this.outputShape[0]} ? 0. : result.y;\n result.z = 0.;\n result.w = 0.;\n `;else{const e=VM("coords",r);this.enableShapeUniforms?a+=`\n bool nextRowOutOfBounds =\n (${e[r-2]} + 1) >= outShape[${r} - 2];\n bool nextColOutOfBounds =\n (${e[r-1]} + 1) >= outShape[${r} - 1];\n result.y = nextColOutOfBounds ? 0. : result.y;\n result.z = nextRowOutOfBounds ? 0. : result.z;\n result.w = nextColOutOfBounds || nextRowOutOfBounds ? 0. : result.w;\n `:a+=`\n bool nextRowOutOfBounds =\n (${e[r-2]} + 1) >= ${this.outputShape[r-2]};\n bool nextColOutOfBounds =\n (${e[r-1]} + 1) >= ${this.outputShape[r-1]};\n result.y = nextColOutOfBounds ? 0. : result.y;\n result.z = nextRowOutOfBounds ? 0. : result.z;\n result.w = nextColOutOfBounds || nextRowOutOfBounds ? 0. : result.w;\n `}}this.userCode=`\n vec4 binaryOperation(vec4 a, vec4 b) {\n ${e}\n }\n\n void main() {\n vec4 a = getAAtOutCoords();\n vec4 b = getBAtOutCoords();\n\n vec4 result = binaryOperation(a, b);\n ${a}\n\n setOutput(result);\n }\n `}}function yF(e){const{inputs:t,backend:n}=e,{x:s}=t;return n.incRef(s.dataId),{dataId:s.dataId,shape:s.shape,dtype:s.dtype}}const bF={kernelName:js,backendName:"webgl",kernelFunc:yF};function wF(e){const{inputs:t,backend:n}=e,{real:s,imag:r}=t,a=n.makeTensorInfo(s.shape,"complex64"),i=n.texData.get(a.dataId),o=yF({inputs:{x:s},backend:n}),l=yF({inputs:{x:r},backend:n});return i.complexTensorInfos={real:o,imag:l},a}const vF={kernelName:ns,backendName:"webgl",kernelFunc:wF},xF="return (a < 0.) ? b * a : a;",AF="\n vec4 aLessThanZero = vec4(lessThan(a, vec4(0.)));\n return (aLessThanZero * (b * a)) + ((vec4(1.0) - aLessThanZero) * a);\n";const kF={kernelName:Ys,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:n,attrs:s}=e,{x:r}=t,{alpha:a}=s,i=n.makeTensorInfo([],"float32",di(a,"float32")),o=Sn().getBool("WEBGL_PACK_BINARY_OPERATIONS")?new gF(AF,r.shape,i.shape):new fF(xF,r.shape,i.shape),l=n.runWebGLProgram(o,[r,i],"float32");return n.disposeIntermediateTensorInfo(i),l}},CF="return (a < 0.) ? b * a : a;",SF="\n vec4 aLessThanZero = vec4(lessThan(a, vec4(0.)));\n return (aLessThanZero * (b * a)) + ((vec4(1.0) - aLessThanZero) * a);\n";const EF={kernelName:Rr,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:n}=e,{x:s,alpha:r}=t,a=Sn().getBool("WEBGL_PACK_BINARY_OPERATIONS")?new gF(SF,s.shape,r.shape):new fF(CF,s.shape,r.shape);return n.runWebGLProgram(a,[s,r],"float32")}},_F="if (isnan(x)) return x;";function IF({opSnippet:e,packedOpSnippet:t,cpuKernelImpl:n,dtype:s}){return({inputs:r,backend:a})=>{const{x:i}=r,o=a,l=s||i.dtype;if(o.shouldExecuteOnCPU([i])&&null!=n){const e=o.texData.get(i.dataId),t=n(e.values,l);return o.makeTensorInfo(i.shape,l,t)}let u;return u=Sn().getBool("WEBGL_PACK_UNARY_OPERATIONS")&&null!=t?new oF(i.shape,t):new $M(i.shape,e),o.runWebGLProgram(u,[i],l)}}function TF({opSnippet:e,packedOpSnippet:t,checkOutOfBounds:n=!1,supportsComplex:s=!1,cpuKernelImpl:r,dtype:a}){return({inputs:i,backend:o})=>{const{a:l,b:u}=i,c=o;if(s&&"complex64"===l.dtype){const t=c.texData.get(l.dataId),n=c.texData.get(u.dataId),[s,r]=[[t.complexTensorInfos.real,n.complexTensorInfos.real],[t.complexTensorInfos.imag,n.complexTensorInfos.imag]].map((t=>{const[n,s]=t,r={dataId:n.dataId,dtype:n.dtype,shape:l.shape},a={dataId:s.dataId,dtype:s.dtype,shape:u.shape},i=new fF(e,l.shape,u.shape);return c.runWebGLProgram(i,[r,a],Gi(n.dtype,s.dtype))})),a=wF({inputs:{real:s,imag:r},backend:c});return c.disposeIntermediateTensorInfo(s),c.disposeIntermediateTensorInfo(r),a}const h=a||Gi(l.dtype,u.dtype);if(("string"===l.dtype||"string"===u.dtype||c.shouldExecuteOnCPU([l,u]))&&null!=r){const e=c.texData.get(l.dataId).values,t=c.texData.get(u.dataId).values,n="string"===l.dtype?Ng(e):e,s="string"===l.dtype?Ng(t):t,[a,i]=r(l.shape,u.shape,n,s,h),o=c.makeTensorInfo(i,h);return c.texData.get(o.dataId).values=a,o}let d;return d=Sn().getBool("WEBGL_PACK_BINARY_OPERATIONS")&&null!=t?new gF(t,l.shape,u.shape,n):new fF(e,l.shape,u.shape),c.runWebGLProgram(d,[l,u],h)}}function NF(e,t=!1){if("linear"===e)return t?nF:XM;if("relu"===e)return t?rF:QM;if("elu"===e)return t?sF:YM;if("relu6"===e)return t?aF:JM;if("prelu"===e)return t?SF:CF;if("leakyrelu"===e)return t?AF:xF;if("sigmoid"===e)return t?iF:tF;throw new Error(`Activation ${e} has not been implemented for the WebGL backend.`)}class OF{constructor(e,t,n,s=!1,r=!1,a=!1,i=null,o=!1,l=!1){this.variableNames=["matrixA","matrixB"],this.packedInputs=!0,this.packedOutput=!0,this.outputShape=n,this.enableShapeUniforms=SD(this.outputShape.length);const u=s?e[1]:e[2],c=Math.ceil(u/2),h=s?"i * 2, rc.y":"rc.y, i * 2",d=r?"rc.z, i * 2":"i * 2, rc.z",p=s?["a.xxyy","a.zzww"]:["a.xxzz","a.yyww"],f=r?["b.xzxz","b.ywyw"]:["b.xyxy","b.zwzw"];let m="",g="";i&&(m=o?`vec4 activation(vec4 a) {\n vec4 b = getPreluActivationWeightsAtOutCoords();\n ${i}\n }`:l?`vec4 activation(vec4 a) {\n vec4 b = getLeakyreluAlphaAtOutCoords();\n ${i}\n }`:`vec4 activation(vec4 x) {\n ${i}\n }`,g="result = activation(result);");const y=a?"result += getBiasAtOutCoords();":"";a&&this.variableNames.push("bias"),o&&this.variableNames.push("preluActivationWeights"),l&&this.variableNames.push("leakyreluAlpha");let b="rc.x",w="rc.x";e[0]`The new shape (${l}) has ${u} elements and the old shape (${r.shape}) has ${o} elements. The new shape and old shape must have the same number of elements.`));const c=i.texData.get(r.dataId);return!c.isPacked||HR(r.shape,l)||null!==c.texture&&HR(c.shape,l)?(i.incRef(r.dataId),{dataId:r.dataId,shape:l,dtype:r.dtype}):function(e,t,n){const s=[UR(e.shape),...GR(e.shape)],r={dtype:e.dtype,shape:s,dataId:e.dataId},a=[UR(t),...GR(t)],i=new UM(a,s),o=[s],l=n.runWebGLProgram(i,[r],e.dtype,o,!0);return{dataId:l.dataId,shape:t,dtype:l.dtype}}(r,l,i)}const LF={kernelName:Wr,backendName:"webgl",kernelFunc:zF};class PF{constructor(e,t){this.variableNames=["x"];const{windowSize:n,batchSize:s,inSize:r,outSize:a}=e;this.outputShape=[s,a];const i=4*Math.floor(n/4),o=n%4;let l="sumValue += dot(values, ones);";if(null!=t){const e=1/t;l=`sumValue += dot(values * ${Xt(e)?e.toPrecision(2):e}, ones);`}let u="";r%n>0&&(u=`\n if (inIdx < 0 || inIdx >= ${r}) {\n return 0.0;\n }\n `),this.userCode=`\n const vec4 ones = vec4(1.0, 1.0, 1.0, 1.0);\n\n float getValue(int batch, int inIdx) {\n ${u}\n return getX(batch, inIdx);\n }\n\n void main() {\n ivec2 coords = getOutputCoords();\n int batch = coords[0];\n int outIdx = coords[1];\n int inOffset = outIdx * ${n};\n\n float sumValue = 0.0;\n\n for (int i = 0; i < ${i}; i += 4) {\n int inIdx = inOffset + i;\n vec4 values = vec4(\n getValue(batch, inIdx),\n getValue(batch, inIdx + 1),\n getValue(batch, inIdx + 2),\n getValue(batch, inIdx + 3)\n );\n\n ${l}\n }\n\n int inIdx = inOffset + ${i};\n if (${1===o}) {\n vec4 values = vec4(getValue(batch, inIdx), 0.0, 0.0, 0.0);\n\n ${l}\n } else if (${2===o}) {\n vec4 values = vec4(\n getValue(batch, inIdx),\n getValue(batch, inIdx + 1), 0.0, 0.0);\n\n ${l}\n } else if (${3===o}) {\n vec4 values = vec4(\n getValue(batch, inIdx),\n getValue(batch, inIdx + 1),\n getValue(batch, inIdx + 2), 0.0);\n\n ${l}\n }\n setOutput(sumValue);\n }\n `}}class VF{constructor(e,t){this.variableNames=["x"];const{windowSize:n,batchSize:s,inSize:r,outSize:a}=e;this.outputShape=[s,a];let i="0.0",o="";"prod"===t?i="1.0":"min"===t?(i="1.0 / 1e-20",o="min"):"max"===t&&(i="-1.0 / 1e-20",o="max");let l=`${t}(${t}(${t}(minMaxValue[0], minMaxValue[1]), minMaxValue[2]), minMaxValue[3])`;"sum"===t?l="sumValue":"prod"===t?l="prodValue":"all"===t?l="allValue":"any"===t&&(l="anyValue");const u=4*Math.floor(n/4),c=n%4;let h=`\n if (${"sum"===t}) {\n sumValue += dot(values, ones);\n } else if (${"prod"===t}) {\n vec2 tmp = vec2(values[0], values[1]) * vec2(values[2], values[3]);\n prodValue *= tmp[0] * tmp[1];\n } else {\n minMaxValue = ${o}(values, minMaxValue);\n if (${"min"===t} || ${"max"===t}) {\n minMaxValue = ${o}(values, minMaxValue);\n bvec4 isNaN = isnan(values);\n if (isNaN.r || isNaN.g || isNaN.b || isNaN.a) {\n minMaxValue = vec4(NAN);\n }\n }\n }\n `,d="vec4";"all"===t?(i="1.0",h="\n bool reducedAllValue = all(values);\n float floatedReducedAllValue = float(reducedAllValue);\n allValue = float(allValue >= 1.0 && floatedReducedAllValue >= 1.0);\n ",d="bvec4"):"any"===t&&(i="0.0",h="\n bool reducedAnyValue = any(values);\n float floatedReducedAnyValue = float(reducedAnyValue);\n anyValue = float(anyValue >= 1.0 || floatedReducedAnyValue >= 1.0);\n ",d="bvec4");let p="";r%n>0&&(p=`\n if (inIdx < 0 || inIdx >= ${r}) {\n return initializationValue;\n }\n `),this.userCode=`\n const float initializationValue = ${i};\n const vec4 ones = vec4(1.0, 1.0, 1.0, 1.0);\n\n float getValue(int batch, int inIdx) {\n ${p}\n return getX(batch, inIdx);\n }\n\n void main() {\n ivec2 coords = getOutputCoords();\n int batch = coords[0];\n int outIdx = coords[1];\n int inOffset = outIdx * ${n};\n\n vec4 minMaxValue = vec4(${i});\n float prodValue = 1.0;\n float sumValue = 0.0;\n float allValue = 1.0;\n float anyValue = 0.0;\n\n for (int i = 0; i < ${u}; i += 4) {\n int inIdx = inOffset + i;\n ${d} values = ${d}(\n getValue(batch, inIdx),\n getValue(batch, inIdx + 1),\n getValue(batch, inIdx + 2),\n getValue(batch, inIdx + 3)\n );\n\n ${h}\n }\n\n int inIdx = inOffset + ${u};\n if (${1===c}) {\n ${d} values = ${d}(\n getValue(batch, inIdx),\n initializationValue,\n initializationValue,\n initializationValue\n );\n\n ${h}\n } else if (${2===c}) {\n ${d} values = ${d}(\n getValue(batch, inIdx),\n getValue(batch, inIdx + 1),\n initializationValue,\n initializationValue\n );\n\n ${h}\n } else if (${3===c}) {\n ${d} values = ${d}(\n getValue(batch, inIdx),\n getValue(batch, inIdx + 1),\n getValue(batch, inIdx + 2),\n initializationValue\n );\n\n ${h}\n }\n setOutput(${l});\n }\n `}}function WF(e,t,n,s){const r=function(e){const t=[];for(;0===t.length||1!==t[t.length-1].outSize;){const n=t.length?t[t.length-1].outSize:e[1],s=Mm(n);t.push({inSize:n,windowSize:s,outSize:Math.ceil(n/s)})}return t}(e.shape);let a=e;for(let i=0;i6)throw Error(`Transpose for rank ${t} is not yet supported`);const n=["resRC.x","resRC.y","resRC.z","resRC.w","resRC.u","resRC.v"],s=new Array(t);for(let t=0;t6)throw Error(`Packed transpose for rank ${this.rank} is not yet supported.`);const s=bD(this.rank),r=PM("rc",this.rank),a=new Array(this.rank);for(let e=0;e`Error in matMul: inner shapes (${h}) and (${d}) of Tensors with shapes ${e.shape} and ${t.shape} and transposeA=${n} and transposeB=${s} must match.`));const v=n?[y,h,p]:[y,p,h],x=s?[b,f,d]:[b,d,f],A=zF({inputs:{x:e},backend:r,attrs:{shape:v}}),k=zF({inputs:{x:t},backend:r,attrs:{shape:x}}),C=[A,k],S=Math.max(y,b),E=n?A.shape[1]:A.shape[2],_=null!=a,I=null!=i,T="leakyrelu"===l,N=null!=l?NF(l,!0):null;let O;if((1===p||1===f)&&E>XF&&!1===(_||I||T||null!=N)){let e=A,t=k;n&&(e=$F({inputs:{x:A},backend:r,attrs:{perm:[0,2,1]}}),C.push(e)),s&&(t=$F({inputs:{x:k},backend:r,attrs:{perm:[0,2,1]}}),C.push(t));const a=1===f;let i=e;1!==f&&(i=zF({inputs:{x:e},backend:r,attrs:{shape:[S,E,1]}}),C.push(i));const o=1===f?2:1;let l=t;a&&(l=zF({inputs:{x:t},backend:r,attrs:{shape:[S,1,E]}}),C.push(l));const u=FF({inputs:{a:i,b:l},backend:r});O=jF({inputs:{x:u},backend:r,attrs:{axis:o,keepDims:!0}}),C.push(u)}else{const l=Gi(e.dtype,t.dtype),u=new OF(v,x,[S,p,f],n,s,_,N,I,T),c=[A,k];if(null!=a&&c.push(a),I&&c.push(i),T){const e=r.makeTensorInfo([],"float32",di(o,"float32"));c.push(e),C.push(e)}O=r.runWebGLProgram(u,c,l)}const R=zF({inputs:{x:O},backend:r,attrs:{shape:w}});C.push(O);for(const e of C)r.disposeIntermediateTensorInfo(e);return R}const YF={kernelName:La,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:n,attrs:s}=e,{a:r,b:a,bias:i,preluActivationWeights:o}=t,{transposeA:l,transposeB:u,activation:c,leakyreluAlpha:h}=s;return ZF({a:r,b:a,transposeA:l,transposeB:u,backend:n,bias:i,preluActivationWeights:o,leakyreluAlpha:h,activation:c})}},QF="return abs(x);";const JF={kernelName:Nn,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:n}=e,{x:s}=t;if(n.shouldExecuteOnCPU([s])&&"complex64"!==s.dtype){const e=n.texData.get(s.dataId),t=kM(e.values);return n.makeTensorInfo(s.shape,s.dtype,t)}let r;return r=Sn().getBool("WEBGL_PACK_UNARY_OPERATIONS")?new oF(s.shape,QF):new $M(s.shape,QF),n.runWebGLProgram(r,[s],s.dtype)}},eB=IF({opSnippet:KM+"\n if (abs(x) > 1.) {\n return NAN;\n }\n return acos(x);\n"}),tB={kernelName:On,backendName:"webgl",kernelFunc:eB},nB=IF({opSnippet:KM+"\n if (x < 1.0) return NAN;\nreturn log(x + sqrt(x * x - 1.0));"}),sB={kernelName:Rn,backendName:"webgl",kernelFunc:nB},rB="return a + b;",aB=TF({opSnippet:rB,packedOpSnippet:rB,supportsComplex:!0,cpuKernelImpl:qD}),iB={kernelName:Dn,backendName:"webgl",kernelFunc:aB};class oB{constructor(e,t){this.outputShape=[],this.outputShape=e,this.variableNames=t.map(((e,t)=>`T${t}`));const n=[];this.variableNames.forEach((e=>{n.push(`float v${e} = get${e}AtOutCoords();`)}));const s=this.variableNames.map((e=>`v${e}`)).join(" + ");this.userCode=`\n void main() {\n ${n.join("\n ")}\n\n float result = ${s};\n setOutput(result);\n }\n `}}class lB{constructor(e,t){this.outputShape=[],this.packedInputs=!0,this.packedOutput=!0,this.outputShape=e,this.variableNames=t.map(((e,t)=>`T${t}`));const n=[];this.variableNames.forEach((e=>{n.push(`vec4 v${e} = get${e}AtOutCoords();`)}));const s=this.variableNames.map((e=>`v${e}`)).join(" + ");this.userCode=`\n void main() {\n ${n.join("\n ")}\n\n vec4 result = ${s};\n setOutput(result);\n }\n `}}const uB={kernelName:Mn,backendName:"webgl",kernelFunc:function e(t){const{inputs:n,backend:s}=t,r=n;if(1===r.length)return yF({inputs:{x:r[0]},backend:s});if(r.length>Sn().getNumber("WEBGL_MAX_TEXTURES_IN_SHADER")){const t=Math.floor(r.length/2),n=e({inputs:r.slice(0,t),backend:s}),a=e({inputs:r.slice(t),backend:s});return e({inputs:[n,a],backend:s})}const a=r.map((e=>e.dtype)).reduce(((e,t)=>Gi(e,t))),i=r.map((e=>e.shape)),o=Sn().getBool("WEBGL_PACK")?new lB(r[0].shape,i):new oB(r[0].shape,i);return s.runWebGLProgram(o,r,a)}};const cB={kernelName:Fn,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:n,attrs:s}=e,{x:r}=t,{axis:a,keepDims:i}=s,o=r.shape.length,l=en(a,r.shape);let u=l;const c=Ih(u,o);let h=r;null!=c&&(h=$F({inputs:{x:r},backend:n,attrs:{perm:c}}),u=Nh(u.length,o)),_h("all",u,o);const[d,p]=Sh(h.shape,u),f=zF({inputs:{x:h},backend:n,attrs:{shape:[-1,$t(p)]}}),m=WF(f,f.dtype,"all",n);let g;if(i){g=zF({inputs:{x:m},backend:n,attrs:{shape:Eh(d,l)}})}else g=zF({inputs:{x:m},backend:n,attrs:{shape:d}});return n.disposeIntermediateTensorInfo(f),n.disposeIntermediateTensorInfo(m),null!=c&&n.disposeIntermediateTensorInfo(h),g}};const hB={kernelName:Bn,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:n,attrs:s}=e,{x:r}=t,{axis:a,keepDims:i}=s,o=r.shape.length,l=en(a,r.shape);let u=l;const c=Ih(u,o);let h=r;null!=c&&(h=$F({inputs:{x:r},backend:n,attrs:{perm:c}}),u=Nh(u.length,o)),_h("any",u,o);const[d,p]=Sh(h.shape,u),f=zF({inputs:{x:h},backend:n,attrs:{shape:[-1,$t(p)]}}),m=WF(f,f.dtype,"any",n);let g;if(i){g=zF({inputs:{x:m},backend:n,attrs:{shape:Eh(d,l)}})}else g=zF({inputs:{x:m},backend:n,attrs:{shape:d}});return n.disposeIntermediateTensorInfo(f),n.disposeIntermediateTensorInfo(m),null!=c&&n.disposeIntermediateTensorInfo(h),g}};class dB{constructor(e,t,n){this.variableNames=["A"];const{windowSize:s,batchSize:r,outSize:a}=e;n||this.variableNames.push("bestIndicesA"),this.outputShape=[r,a];const i="max"===t?">":"<",o=n?"inOffset + i;":"round(getBestIndicesA(batch, inOffset + i));";this.userCode=`\n void main() {\n ivec2 coords = getOutputCoords();\n int batch = coords[0];\n int outIdx = coords[1];\n int inOffset = outIdx * ${s};\n\n int bestIndex = inOffset;\n float bestValue = getA(batch, bestIndex);\n\n for (int i = 0; i < ${s}; i++) {\n int inIdx = ${o};\n float candidate = getA(batch, inIdx);\n if (candidate ${i} bestValue) {\n bestValue = candidate;\n bestIndex = inIdx;\n }\n }\n setOutput(float(bestIndex));\n }\n `}}class pB{constructor(e,t,n,s){this.variableNames=["A"],this.packedInputs=!0,this.packedOutput=!0,qt(e.length>2,(()=>`Packed arg${n.charAt(0).toUpperCase()+n.slice(1)} supports only inputs with rank above 2.`));const r=e[e.length-1],a=Math.ceil(r/t);this.outputShape=e.slice(0,-1),a>1&&this.outputShape.push(a),s||this.variableNames.push("bestIndicesA");const i=this.outputShape,o=i.length,l=bD(o),u=VM("coords",o);let c,h;if(1===a){h=o+1;const e=bD(h);c=`\n ${e} sourceLocR = ${e}(${u.join()}, 0);\n ++${u[o-1]};\n ${e} sourceLocG = ${e}(${u.join()}, 0);\n ++${u[o-2]};\n ${e} sourceLocA = ${e}(${u.join()}, 0);\n --${u[o-1]};\n ${e} sourceLocB = ${e}(${u.join()}, 0);\n --${u[o-2]};`}else h=o,c=`\n ${l} sourceLocR = coords;\n ++${u[o-1]};\n ${l} sourceLocG = coords;\n ++${u[o-2]};\n ${l} sourceLocA = coords;\n --${u[o-1]};\n ${l} sourceLocB = coords;\n --${u[o-2]};`;const d=["x","y","z","w","u","v"].slice(0,h),p="."+d[h-1],f=d.map((e=>"int "+e)),m=VM("sourceLocR",h-1).concat("inIdx.r"),g=VM("sourceLocG",h-1).concat("inIdx.g"),y=VM("sourceLocB",h-1).concat("inIdx.b"),b=VM("sourceLocA",h-1).concat("inIdx.a"),w="max"===n?"greaterThan":"lessThan",v=s?"":`\n inIdx = round(vec4(getBestIndicesAChannel(${m.join()}),\n getBestIndicesAChannel(${g.join()}),\n getBestIndicesAChannel(${y.join()}),\n getBestIndicesAChannel(${b.join()})));`,x=`vec4(\n getAChannel(${m.join()}),\n hasNextCol ? getAChannel(${g.join()}) : 0.,\n hasNextRow ? getAChannel(${y.join()}) : 0.,\n hasNextRow && hasNextCol ? getAChannel(${b.join()}) : 0.)`,A=s?"":`\n float getBestIndicesAChannel(${f.join()}) {\n return getChannel(getBestIndicesA(${d.join()}),\n vec2(${d.slice(-2).join()}));\n }`;this.userCode=`\n float getAChannel(${f.join()}) {\n return getChannel(getA(${d.join()}),\n vec2(${d.slice(-2).join()}));\n }\n ${A}\n void main() {\n ${l} coords = getOutputCoords();\n bool hasNextCol = ${u[o-1]} < ${i[o-1]-1};\n bool hasNextRow = ${u[o-2]} < ${i[o-2]-1};\n ${c}\n ivec4 srcIdx = ivec4(sourceLocR${p}, sourceLocG${p},\n sourceLocB${p}, sourceLocA${p}) * ${t};\n ivec4 inIdx = srcIdx;\n vec4 bestIndex = vec4(inIdx);\n vec4 bestValue = ${x};\n\n for (int i = 0; i < ${t}; i++) {\n inIdx = srcIdx;\n ${v}\n vec4 candidate = ${x};\n bvec4 nan = isnan(candidate);\n bvec4 replace = bvec4(\n vec4(${w}(candidate, bestValue)) * (vec4(1.0) - vec4(nan)));\n\n bestValue = vec4(replace.x ? candidate.x : bestValue.x,\n replace.y ? candidate.y : bestValue.y,\n replace.z ? candidate.z : bestValue.z,\n replace.w ? candidate.w : bestValue.w);\n bestIndex = mix(bestIndex, vec4(inIdx), vec4(replace));\n srcIdx++;\n }\n setOutput(bestIndex);\n }\n `}}function fB(e,t,n,s=null){let r=t.shape[0],a=t.shape[1];null!=s&&(r=s.shape[0],a=s.shape[1]);const i=Mm(a),o={windowSize:i,inSize:a,batchSize:r,outSize:Math.ceil(a/i)},l=new dB(o,n,null==s),u=[t];null!=s&&u.push(s);const c=e.runWebGLProgram(l,u,"int32");if(1===c.shape[1])return c;const h=fB(e,t,n,c);return e.disposeIntermediateTensorInfo(c),h}function mB(e,t,n,s=null){const r=null!=s?s.shape:t.shape,a=Mm(r[r.length-1]),i=new pB(r,a,n,null==s),o=null==s?[t]:[t,s],l=e.runWebGLProgram(i,o,"int32");if(l.shape.length===t.shape.length){const s=mB(e,t,n,l);return e.disposeIntermediateTensorInfo(l),s}return l}function gB(e,t,n,s){const r=[n];if(_h("arg"+s.charAt(0).toUpperCase()+s.slice(1),r,t.shape.length),!Sn().getBool("WEBGL_PACK_REDUCE")||t.shape.length<=2){const n=[],a=e.texData.get(t.dataId);let i=t;null!==a&&a.isPacked&&(i=e.unpackTensor(t),n.push(i));const[o,l]=Sh(i.shape,r),u=$t(l),c=zF({inputs:{x:i},backend:e,attrs:{shape:[-1,u]}});n.push(c);const h=fB(e,c,s);n.push(h);const d=zF({inputs:{x:h},backend:e,attrs:{shape:o}});return n.forEach((t=>e.disposeIntermediateTensorInfo(t))),d}return mB(e,t,s)}const yB={kernelName:zn,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:n,attrs:s}=e,{x:r}=t,{axis:a}=s;let i=en(a,r.shape);const o=Ih(i,r.shape.length);let l=r;const u=[];null!=o&&(l=$F({inputs:{x:r},backend:n,attrs:{perm:o}}),u.push(l),i=Nh(i.length,l.shape.length)),_h("argMax",[i[0]],l.shape.length);const c=gB(n,l,i[0],"max");return u.forEach((e=>n.disposeIntermediateTensorInfo(e))),c}};const bB={kernelName:Ln,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:n,attrs:s}=e,{x:r}=t,{axis:a}=s;let i=en(a,r.shape);const o=Ih(i,r.shape.length);let l=r;const u=[];null!=o&&(l=$F({inputs:{x:r},backend:n,attrs:{perm:o}}),u.push(l),i=Nh(i.length,l.shape.length)),_h("argMin",[i[0]],l.shape.length);const c=gB(n,l,i[0],"min");return u.forEach((e=>n.disposeIntermediateTensorInfo(e))),c}},wB=IF({opSnippet:KM+"\n if (abs(x) > 1.) {\n return NAN;\n }\n return asin(x);\n"}),vB={kernelName:Pn,backendName:"webgl",kernelFunc:wB},xB=IF({opSnippet:KM+"return log(x + sqrt(x * x + 1.0));"}),AB={kernelName:Vn,backendName:"webgl",kernelFunc:xB},kB=IF({opSnippet:KM+"\n return atan(x);\n"}),CB={kernelName:Wn,backendName:"webgl",kernelFunc:kB},SB=TF({opSnippet:pF+"\n return atan(a, b);\n",packedOpSnippet:"\n vec4 result = atan(a, b);\n bvec4 isNaNA = isnan(a);\n bvec4 isNaNB = isnan(b);\n bvec4 isNaN = bvec4(isNaNA.x || isNaNB.x, isNaNA.y || isNaNB.y, isNaNA.z || isNaNB.z, isNaNA.w || isNaNB.w);\n "+mF+"\n return result;\n"}),EB={kernelName:Gn,backendName:"webgl",kernelFunc:SB},_B=IF({opSnippet:KM+"\n if ((x < -1.0) || (x > 1.0)) return NAN;\nreturn (log(1.0 + x) - log(1.0 - x)) / 2.0;"}),IB={kernelName:Un,backendName:"webgl",kernelFunc:_B};class TB{constructor(e,t,n,s=!1,r=!1){if(this.variableNames=["x"],"avg"===t&&n)throw new Error("Cannot compute positions for average pool.");const a=e.filterWidth,i=e.strideHeight,o=e.strideWidth,l=e.dilationHeight,u=e.dilationWidth,c=e.effectiveFilterHeight,h=e.effectiveFilterWidth,d=e.padInfo.top,p=e.padInfo.left;this.outputShape=e.outShape;const f="avg"===t,m=`((batch * ${e.inHeight} + xR) * ${e.inWidth} + xC) * ${e.inChannels} + d`,g=`(xR * ${e.inWidth} + xC) * ${e.inChannels} + d`;let y="0.0";if(f||(y="-1.0 / 1e-20"),n){const t=">=";return void(this.userCode=`\n const ivec2 strides = ivec2(${i}, ${o});\n const ivec2 pads = ivec2(${d}, ${p});\n\n void main() {\n ivec4 coords = getOutputCoords();\n int batch = coords[0];\n int d = coords[3];\n\n ivec2 xRCCorner = coords.yz * strides - pads;\n int xRCorner = xRCCorner.x;\n int xCCorner = xRCCorner.y;\n\n // max/min x(?, ?, d) to get y(yR, yC, d).\n // ? = to be determined\n float minMaxValue = 0.0;\n float minMaxValueFound = 0.0;\n int minMaxPosition = 0;\n float avgValue = 0.0;\n\n for (int wR = 0; wR < ${c};\n wR += ${l}) {\n int xR = xRCorner + wR;\n\n if (xR < 0 || xR >= ${e.inHeight}) {\n continue;\n }\n\n for (int wC = 0; wC < ${h};\n wC += ${u}) {\n int xC = xCCorner + wC;\n\n if (xC < 0 || xC >= ${e.inWidth}) {\n continue;\n }\n\n float value = getX(batch, xR, xC, d);\n\n // If a min / max value has already been found, use it. If not,\n // use the current value.\n float currMinMaxValue = mix(\n value, minMaxValue, minMaxValueFound);\n if (value ${t} currMinMaxValue) {\n minMaxValue = value;\n minMaxValueFound = 1.0;\n minMaxPosition = ${s?r?m:g:`wR * ${h} + wC`};\n }\n }\n }\n setOutput(float(minMaxPosition));\n }\n `)}let b=`${t}(${t}(${t}(minMaxValue[0], minMaxValue[1]), minMaxValue[2]), minMaxValue[3])`;"avg"===t&&(b="avgValue / max(count, 1.0)");const w=4*Math.floor(a/4),v=a%4,x=`\n if (${f}) {\n avgValue += dot(values, ones);\n } else {\n minMaxValue = max(values, minMaxValue);\n }\n `;this.userCode=`\n const ivec2 strides = ivec2(${i}, ${o});\n const ivec2 pads = ivec2(${d}, ${p});\n const float initializationValue = ${y};\n const vec4 ones = vec4(1.0, 1.0, 1.0, 1.0);\n\n float count = 0.0;\n\n float getValue(int batch, int xR, int xC, int d) {\n if (xC < 0 || xC >= ${e.inWidth}) {\n return initializationValue;\n }\n count += 1.0;\n return getX(batch, xR, xC, d);\n }\n\n void main() {\n ivec4 coords = getOutputCoords();\n int batch = coords[0];\n int d = coords[3];\n\n ivec2 xRCCorner = coords.yz * strides - pads;\n int xRCorner = xRCCorner.x;\n int xCCorner = xRCCorner.y;\n\n // max/min x(?, ?, d) to get y(yR, yC, d).\n // ? = to be determined\n vec4 minMaxValue = vec4(${y});\n float avgValue = 0.0;\n count = 0.0;\n\n for (int wR = 0; wR < ${c};\n wR += ${l}) {\n int xR = xRCorner + wR;\n\n if (xR < 0 || xR >= ${e.inHeight}) {\n continue;\n }\n\n for (int wC = 0; wC < ${w}; wC += 4) {\n int xC = xCCorner + wC * ${u};\n\n vec4 values = vec4(\n getValue(batch, xR, xC, d),\n getValue(batch, xR, xC + ${u}, d),\n getValue(batch, xR, xC + 2 * ${u}, d),\n getValue(batch, xR, xC + 3 * ${u}, d)\n );\n\n ${x}\n }\n\n int xC = xCCorner + ${w};\n if (${1===v}) {\n vec4 values = vec4(\n getValue(batch, xR, xC, d),\n initializationValue,\n initializationValue,\n initializationValue\n );\n\n ${x}\n } else if (${2===v}) {\n vec4 values = vec4(\n getValue(batch, xR, xC, d),\n getValue(batch, xR, xC + ${u}, d),\n initializationValue,\n initializationValue\n );\n\n ${x}\n } else if (${3===v}) {\n vec4 values = vec4(\n getValue(batch, xR, xC, d),\n getValue(batch, xR, xC + ${u}, d),\n getValue(batch, xR, xC + 2 * ${u}, d),\n initializationValue\n );\n\n ${x}\n }\n }\n setOutput(${b});\n }\n `}}class NB{constructor(e,t,n,s=!1,r=!1){if(this.variableNames=["x"],"avg"===t&&n)throw new Error("Cannot compute positions for average pool.");const a=e.filterWidth,i=e.strideDepth,o=e.strideHeight,l=e.strideWidth,u=e.dilationDepth,c=e.dilationHeight,h=e.dilationWidth,d=e.effectiveFilterDepth,p=e.effectiveFilterHeight,f=e.effectiveFilterWidth,m=e.padInfo.front,g=e.padInfo.top,y=e.padInfo.left;this.outputShape=e.outShape;const b="avg"===t;let w="0.0";if(b||(w="-1.0 / 1e-20"),n){const t=">=";return void(this.userCode=`\n const ivec3 strides =\n ivec3(${i}, ${o}, ${l});\n const ivec3 pads = ivec3(${m}, ${g}, ${y});\n\n void main() {\n ivec5 coords = getOutputCoords();\n int batch = coords.x;\n int ch = coords.u;\n\n ivec3 xCorner = ivec3(coords.y, coords.z, coords.w) * strides - pads;\n int xDCorner = xCorner.x;\n int xRCorner = xCorner.y;\n int xCCorner = xCorner.z;\n\n // max/min x(?, ?, ?, ch) to get y(yD, yR, yC, ch).\n // ? = to be determined\n float minMaxValue = 0.0;\n float minMaxValueFound = 0.0;\n int minMaxPosition = 0;\n\n for (int wD = 0; wD < ${d};\n wD += ${u}) {\n int xD = xDCorner + wD;\n\n if (xD < 0 || xD >= ${e.inDepth}) {\n continue;\n }\n\n for (int wR = 0; wR < ${p};\n wR += ${c}) {\n int xR = xRCorner + wR;\n\n if (xR < 0 || xR >= ${e.inHeight}) {\n continue;\n }\n\n for (int wC = 0; wC < ${f};\n wC += ${h}) {\n int xC = xCCorner + wC;\n\n if (xC < 0 || xC >= ${e.inWidth}) {\n continue;\n }\n\n float value = getX(batch, xD, xR, xC, ch);\n\n // If a min / max value has already been found, use it. If not,\n // use the current value.\n float currMinMaxValue = mix(\n value, minMaxValue, minMaxValueFound);\n if (value ${t} currMinMaxValue) {\n minMaxValue = value;\n minMaxValueFound = 1.0;\n minMaxPosition = ${s?r?`(((batch * ${e.inDepth} + xD) * ${e.inHeight} + xR) * ${e.inWidth} + xC) * ${e.inChannels} + ch`:`((xD * ${e.inHeight} + xR) * ${e.inWidth} + xC) * ${e.inChannels} + ch`:`wD * ${p} * ${f} +\n wR * ${f} + wC`};\n }\n }\n }\n }\n setOutput(float(minMaxPosition));\n }\n `)}let v=`${t}(${t}(${t}(minMaxValue[0], minMaxValue[1]), minMaxValue[2]), minMaxValue[3])`;"avg"===t&&(v="avgValue / max(count, 1.0)");const x=4*Math.floor(a/4),A=a%4,k=`\n if (${b}) {\n avgValue += dot(values, ones);\n } else {\n minMaxValue = max(values, minMaxValue);\n }\n `;this.userCode=`\n const ivec3 strides =\n ivec3(${i}, ${o}, ${l});\n const ivec3 pads = ivec3(${m}, ${g}, ${y});\n const float initializationValue = ${w};\n const vec4 ones = vec4(1.0, 1.0, 1.0, 1.0);\n\n float count = 0.0;\n\n float getValue(int batch, int xD, int xR, int xC, int ch) {\n if (xC < 0 || xC >= ${e.inWidth}) {\n return initializationValue;\n }\n count += 1.0;\n return getX(batch, xD, xR, xC, ch);\n }\n\n void main() {\n ivec5 coords = getOutputCoords();\n int batch = coords.x;\n int ch = coords.u;\n\n ivec3 xCorner = ivec3(coords.y, coords.z, coords.w) * strides - pads;\n int xDCorner = xCorner.x;\n int xRCorner = xCorner.y;\n int xCCorner = xCorner.z;\n\n // max/min x(?, ?, ?, d) to get y(yD, yR, yC, ch).\n // ? = to be determined\n vec4 minMaxValue = vec4(${w});\n float avgValue = 0.0;\n count = 0.0;\n\n for (int wD = 0; wD < ${d};\n wD += ${u}) {\n int xD = xDCorner + wD;\n\n if (xD < 0 || xD >= ${e.inDepth}) {\n continue;\n }\n\n for (int wR = 0; wR < ${p};\n wR += ${c}) {\n int xR = xRCorner + wR;\n\n if (xR < 0 || xR >= ${e.inHeight}) {\n continue;\n }\n\n for (int wC = 0; wC < ${x}; wC += 4) {\n int xC = xCCorner + wC * ${h};\n\n vec4 values = vec4(\n getValue(batch, xD, xR, xC, ch),\n getValue(batch, xD, xR, xC + ${h}, ch),\n getValue(batch, xD, xR, xC + 2 * ${h}, ch),\n getValue(batch, xD, xR, xC + 3 * ${h}, ch)\n );\n\n ${k}\n }\n\n int xC = xCCorner + ${x};\n if (${1===A}) {\n vec4 values = vec4(\n getValue(batch, xD, xR, xC, ch),\n initializationValue,\n initializationValue,\n initializationValue\n );\n\n ${k}\n } else if (${2===A}) {\n vec4 values = vec4(\n getValue(batch, xD, xR, xC, ch),\n getValue(batch, xD, xR, xC + ${h}, ch),\n initializationValue,\n initializationValue\n );\n\n ${k}\n } else if (${3===A}) {\n vec4 values = vec4(\n getValue(batch, xD, xR, xC, ch),\n getValue(batch, xD, xR, xC + ${h}, ch),\n getValue(batch, xD, xR, xC + 2 * ${h}, ch),\n initializationValue\n );\n\n ${k}\n }\n }\n }\n setOutput(${v});\n }\n `}}const OB={kernelName:qn,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:n,attrs:s}=e,{x:r}=t;JR(r,"avgPool");const{filterSize:a,strides:i,pad:o,dimRoundingMode:l}=s;qt(Sc(i,1),(()=>`Error in avgPool: Either strides or dilations must be 1. Got strides ${i} and dilations '1'`));const u=mc(r.shape,a,i,1,o,l);if(1===u.filterWidth&&1===u.filterHeight&&Kt(u.inShape,u.outShape))return yF({inputs:{x:r},backend:n});const c=new TB(u,"avg",!1);return n.runWebGLProgram(c,[r],"float32")}};const RB={kernelName:Hn,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:n,attrs:s}=e,{x:r}=t,{filterSize:a,strides:i,pad:o,dimRoundingMode:l,dataFormat:u}=s,c=gc(r.shape,a,i,[1,1,1],o,l,u),h=new NB(c,"avg",!1);return n.runWebGLProgram(h,[r],"float32")}};class DB{constructor(e){this.variableNames=["dy"],this.outputShape=e.inShape;const t=e.filterHeight,n=e.filterWidth,s=e.strideHeight,r=e.strideWidth,a=e.dilationHeight,i=e.dilationWidth,o=e.effectiveFilterHeight,l=e.effectiveFilterWidth,u=o-1-e.padInfo.top,c=l-1-e.padInfo.left,h=1/(t*n);this.userCode=`\n const ivec2 pads = ivec2(${u}, ${c});\n const float avgMultiplier = float(${h});\n\n void main() {\n ivec4 coords = getOutputCoords();\n int b = coords[0];\n int d = coords[3];\n\n ivec2 dyRCCorner = coords.yz - pads;\n int dyRCorner = dyRCCorner.x;\n int dyCCorner = dyRCCorner.y;\n\n // Convolve dy(?, ?, d) with pos mask(:, :, d) to get dx(xR, xC, d).\n // ? = to be determined. : = across all values in that axis.\n float dotProd = 0.0;\n for (int wR = 0; wR < ${o};\n wR += ${a}) {\n float dyR = float(dyRCorner + wR) / ${s}.0;\n\n if (dyR < 0.0 || dyR >= ${e.outHeight}.0 || fract(dyR) > 0.0) {\n continue;\n }\n int idyR = int(dyR);\n\n for (int wC = 0; wC < ${l};\n wC+= ${i}) {\n float dyC = float(dyCCorner + wC) / ${r}.0;\n\n if (dyC < 0.0 || dyC >= ${e.outWidth}.0 ||\n fract(dyC) > 0.0) {\n continue;\n }\n int idyC = int(dyC);\n\n float dyValue = getDy(b, idyR, idyC, d);\n\n dotProd += dyValue * avgMultiplier;\n }\n }\n setOutput(dotProd);\n }\n `}}class MB{constructor(e){this.variableNames=["dy"],this.outputShape=e.inShape;const t=e.filterDepth,n=e.filterHeight,s=e.filterWidth,r=e.strideDepth,a=e.strideHeight,i=e.strideWidth,o=e.dilationDepth,l=e.dilationHeight,u=e.dilationWidth,c=e.effectiveFilterDepth,h=e.effectiveFilterHeight,d=e.effectiveFilterWidth,p=c-1-e.padInfo.front,f=h-1-e.padInfo.top,m=d-1-e.padInfo.left,g=1/(t*n*s);this.userCode=`\n const ivec3 pads = ivec3(${p}, ${f}, ${m});\n const float avgMultiplier = float(${g});\n\n void main() {\n ivec5 coords = getOutputCoords();\n int batch = coords.x;\n int ch = coords.u;\n\n ivec3 dyCorner = ivec3(coords.y, coords.z, coords.w) - pads;\n int dyDCorner = dyCorner.x;\n int dyRCorner = dyCorner.y;\n int dyCCorner = dyCorner.z;\n\n // Convolve dy(?, ?, ?, d) with pos mask(:, :, :, ch) to get\n // dx(xD, xR, xC, ch).\n // ? = to be determined. : = across all values in that axis.\n float dotProd = 0.0;\n\n for (int wD = 0; wD < ${c};\n wD += ${o}) {\n float dyD = float(dyDCorner + wD) / ${r}.0;\n\n if (dyD < 0.0 || dyD >= ${e.outDepth}.0 || fract(dyD) > 0.0) {\n continue;\n }\n int idyD = int(dyD);\n\n for (int wR = 0; wR < ${h};\n wR += ${l}) {\n float dyR = float(dyRCorner + wR) / ${a}.0;\n\n if (dyR < 0.0 || dyR >= ${e.outHeight}.0 ||\n fract(dyR) > 0.0) {\n continue;\n }\n int idyR = int(dyR);\n\n for (int wC = 0; wC < ${d};\n wC += ${u}) {\n float dyC = float(dyCCorner + wC) / ${i}.0;\n\n if (dyC < 0.0 || dyC >= ${e.outWidth}.0 ||\n fract(dyC) > 0.0) {\n continue;\n }\n int idyC = int(dyC);\n\n float dyValue = getDy(batch, idyD, idyR, idyC, ch);\n\n dotProd += dyValue * avgMultiplier;\n }\n }\n }\n setOutput(dotProd);\n }\n `}}const FB={kernelName:$n,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:n,attrs:s}=e,{dy:r,input:a}=t,i=a,{filterSize:o,strides:l,pad:u,dimRoundingMode:c}=s,h=gc(i.shape,o,l,[1,1,1],u,c),d=new MB(h);return n.runWebGLProgram(d,[r],i.dtype)}};const BB={kernelName:jn,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:n,attrs:s}=e,{dy:r,input:a}=t,i=a;JR([r,a],"avgPoolGrad");const{filterSize:o,strides:l,pad:u}=s,c=mc(i.shape,o,l,1,u),h=new DB(c);return n.runWebGLProgram(h,[r],i.dtype)}};const zB={kernelName:Kn,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:n,attrs:s}=e,{a:r,b:a}=t,{transposeA:i,transposeB:o}=s;return ZF({a:r,b:a,transposeA:i,transposeB:o,backend:n})}};class LB{constructor(e,t,n,s,r,a){this.outputShape=[],this.variableNames=["x","mean","variance"],su(e,t),su(e,n);let i="0.0";null!=s&&(su(e,s),this.variableNames.push("offset"),i="getOffsetAtOutCoords()");let o="1.0";null!=r&&(su(e,r),this.variableNames.push("scale"),o="getScaleAtOutCoords()"),this.outputShape=e,this.userCode=`\n void main() {\n float x = getXAtOutCoords();\n float mean = getMeanAtOutCoords();\n float variance = getVarianceAtOutCoords();\n float offset = ${i};\n float scale = ${o};\n float inv = scale * inversesqrt(variance + float(${a}));\n setOutput(dot(vec3(x, -mean, offset), vec3(inv, inv, 1)));\n }\n `}}class PB{constructor(e,t,n,s,r,a){this.packedInputs=!0,this.packedOutput=!0,this.variableNames=["x","mean","variance"],su(e,t),su(e,n);let i="vec4(0.0)";null!=s&&(su(e,s),this.variableNames.push("offset"),i="getOffsetAtOutCoords()");let o="vec4(1.0)";null!=r&&(su(e,r),this.variableNames.push("scale"),o="getScaleAtOutCoords()"),this.outputShape=e,this.userCode=`\n void main() {\n vec4 offset = ${i};\n vec4 scale = ${o};\n\n vec4 x = getXAtOutCoords();\n vec4 mean = getMeanAtOutCoords();\n vec4 variance = getVarianceAtOutCoords();\n\n vec4 inv = scale * inversesqrt(variance + vec4(${a}));\n\n setOutput((x - mean) * inv + offset);\n }\n `}}const VB={kernelName:Vs,backendName:"webgl",kernelFunc:({inputs:e,backend:t,attrs:n})=>{const{x:s,mean:r,variance:a,offset:i,scale:o}=e;qt(r.shape.length===a.shape.length,(()=>"Batch normalization gradient requires mean and variance to have equal ranks.")),qt(null==i||r.shape.length===i.shape.length,(()=>"Batch normalization gradient requires mean and offset to have equal ranks.")),qt(null==o||r.shape.length===o.shape.length,(()=>"Batch normalization gradient requires mean and scale to have equal ranks."));let{varianceEpsilon:l}=n;null==l&&(l=.001);const u=[s,r,a];let c=null;null!=i&&(c=i.shape,u.push(i));let h=null;null!=o&&(h=o.shape,u.push(o));const d=Sn().getBool("WEBGL_PACK_NORMALIZATION")?new PB(s.shape,r.shape,a.shape,c,h,l):new LB(s.shape,r.shape,a.shape,c,h,l);return t.runWebGLProgram(d,u,u[0].dtype)}};class WB{constructor(e){this.variableNames=["source"],this.outputShape=e,this.rank=e.length;const t=bD(this.rank);this.customUniforms=[{name:"start",arrayIndex:this.rank,type:"int"}];const n=function(e){if(1===e)return"sourceLoc";if(e<=6)return UB.slice(0,e).map((e=>"sourceLoc."+e)).join(",");throw Error(`Slicing for rank ${e} is not yet supported`)}(this.rank);let s;s=`\n ${t} sourceLoc;\n ${t} coords = getOutputCoords();\n ${e.map(((e,t)=>`sourceLoc.${UB[t]} = start[${t}] + coords.${UB[t]};`)).join("\n")}\n `,this.userCode=`\n void main() {\n ${s}\n setOutput(getSource(${n}));\n }\n `}}const UB=["x","y","z","w","u","v"];class GB{constructor(e){this.variableNames=["source"],this.packedInputs=!0,this.packedOutput=!0,this.outputShape=e,this.rank=e.length,this.customUniforms=[{name:"start",arrayIndex:this.rank,type:"int"}];const t=bD(this.rank),n=VM("coords",this.rank),s=VM("sourceLoc",this.rank),r=1===this.rank?"sourceLoc":`vec2(${s.slice(-2).join()})`,a=`getChannel(getSource(${s.join()}), ${r})`,i=`\n result.x = ${a};\n if (++${n[this.rank-1]} < ${e[this.rank-1]}) {\n ++${s[this.rank-1]};\n result.y = ${a};\n --${s[this.rank-1]};\n }\n `,o=1===this.rank?"":`\n --${n[this.rank-1]};\n if (++${n[this.rank-2]} < ${e[this.rank-2]}) {\n ++${s[this.rank-2]};\n result.z = ${a};\n if (++${n[this.rank-1]} < ${e[this.rank-1]}) {\n ++${s[this.rank-1]};\n result.w = ${a};\n }\n }\n `,l=this.rank<=4?`sourceLoc = coords +\n ${t}(${e.map(((e,t)=>`start[${t}]`)).join()});`:e.map(((e,t)=>`${s[t]} = ${n[t]} + start[${t}];`)).join("\n");this.userCode=`\n void main() {\n ${t} coords = getOutputCoords();\n ${t} sourceLoc;\n ${l}\n vec4 result = vec4(0.);\n ${i}\n ${o}\n setOutput(result);\n }\n `}}function qB(e){const{inputs:t,backend:n,attrs:s}=e,{x:r}=t,{begin:a,size:i}=s,[o,l]=Ju(r,a,i);if(Pu(r,o,l),0===$t(l))return n.makeTensorInfo(l,r.dtype,[]);if(n.shouldExecuteOnCPU([r])||"string"===r.dtype){const e=n.texData.get(r.dataId),t=CM(e.values,o,l,r.shape,r.dtype);return n.makeTensorInfo(l,r.dtype,t)}const{isPacked:u}=n.texData.get(r.dataId),c=Yu(r.shape,o,l);if(u||!c){const e=Sn().getBool("WEBGL_PACK_ARRAY_OPERATIONS")?new GB(l):new WB(l),t=[o];return n.runWebGLProgram(e,[r],r.dtype,t)}return n.uploadToGPU(r.dataId),function(e,t,n,s){const r=s.texData.get(e.dataId),a=s.makeTensorInfo(n,e.dtype),i=s.texData.get(a.dataId);Object.assign(i,r),i.refCount=1,i.shape=n,i.dtype=e.dtype;let o=Qu(t,dn(e.shape));r.slice&&(o+=r.slice.flatOffset),i.slice={flatOffset:o,origDataId:r.slice&&r.slice.origDataId||e.dataId};const l=s.dataRefCount.get(i.slice.origDataId)||1;return s.dataRefCount.set(i.slice.origDataId,l+1),a}(r,o,l,n)}const jB={kernelName:ta,backendName:"webgl",kernelFunc:qB},HB={kernelName:Xn,backendName:"webgl",kernelFunc:e=>{const{inputs:t,backend:n,attrs:s}=e,{x:r}=t,{blockShape:a,crops:i}=s;qt(r.shape.length<=4,(()=>"batchToSpaceND for rank > 4 with a WebGL backend not implemented yet"));const o=a.reduce(((e,t)=>e*t)),l=Bm(r.shape,a,o),u=zm(l.length,a.length),c=Lm(r.shape,a,o),h=Pm(i,a.length),d=Vm(c,i,a.length),p=[],f=zF({inputs:{x:r},backend:n,attrs:{shape:l}}),m=$F({inputs:{x:f},backend:n,attrs:{perm:u}}),g=zF({inputs:{x:m},backend:n,attrs:{shape:c}}),y=qB({inputs:{x:g},backend:n,attrs:{begin:h,size:d}});return p.push(f),p.push(m),p.push(g),p.forEach((e=>n.disposeIntermediateTensorInfo(e))),y}};const $B={kernelName:Zn,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:n,attrs:s}=e,{x:r,weights:a}=t,{size:i}=s,o=n.readSync(r.dataId),l=n.readSync(a.dataId),u=jD(o,l,a.dtype,a.shape,i);return n.makeTensorInfo([i],a.dtype,u)}};const KB={kernelName:Yn,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:n}=e,{a:s,b:r}=t,a=Sn().getBool("WEBGL_PACK_BINARY_OPERATIONS"),i=Sn().getNumber("WEBGL_VERSION");if(n.shouldExecuteOnCPU([s,r])||1===i){const e=n.texData.get(s.dataId).values,t=n.texData.get(r.dataId).values,[a,i]=$D(s.shape,r.shape,e,t,s.dtype),o=n.makeTensorInfo(i,s.dtype);return n.texData.get(o.dataId).values=a,o}let o;return o=a?new gF("\n int r = int(a.r) & int(b.r);\n int g = int(a.g) & int(b.g);\n int rb = int(a.b) & int(b.b);\n int ra = int(a.a) & int(b.a);\n return vec4(r, g, rb, ra);\n",s.shape,r.shape,!1):new fF("\n return float(int(a.r) & int(b.r));\n",s.shape,r.shape),n.runWebGLProgram(o,[s,r],s.dtype)}};const XB={kernelName:Qn,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:n}=e,{s0:s,s1:r}=t,a=n.readSync(s.dataId),i=n.readSync(r.dataId),o=su(Array.from(a),Array.from(i));return n.makeTensorInfo([o.length],"int32",Int32Array.from(o))}},ZB=TF({opSnippet:"return float(a != b);",cpuKernelImpl:fM,dtype:"bool"}),YB={kernelName:kr,backendName:"webgl",kernelFunc:ZB};function QB(e){const{inputs:t,backend:n}=e,{input:s}=t;return yF({inputs:{x:n.texData.get(s.dataId).complexTensorInfos.real},backend:n})}const JB={kernelName:Lr,backendName:"webgl",kernelFunc:QB},ez="return float(int(x));";const tz={kernelName:Jn,backendName:"webgl",kernelFunc:function e(t){const{inputs:n,backend:s,attrs:r}=t,{x:a}=n,{dtype:i}=r;if("complex64"===i){if("complex64"===a.dtype)return yF({inputs:{x:a},backend:s});const t=wd(a.shape),n=e({inputs:{x:a},backend:s,attrs:{dtype:"float32"}}),r=wF({inputs:{real:n,imag:t},backend:s});return t.dispose(),s.disposeIntermediateTensorInfo(n),r}if("complex64"===a.dtype){const t=QB({inputs:{input:a},backend:s}),n=e({inputs:{x:t},backend:s,attrs:{dtype:i}});return s.disposeIntermediateTensorInfo(t),n}if(!rn(a.dtype,i)){const e=yF({inputs:{x:a},backend:s});return{dataId:e.dataId,shape:e.shape,dtype:i}}if(s.shouldExecuteOnCPU([a])){const e=s.texData.get(a.dataId).values,[t,n,r]=KD(e,a.shape,a.dtype,i);return s.makeTensorInfo(t,n,r)}if("int32"===i)return function(e,t){const n=new $M(e.shape,ez),s=t.runWebGLProgram(n,[e],"int32");return{dataId:s.dataId,shape:s.shape,dtype:s.dtype}}(a,s);if("bool"===i){const e=s.makeTensorInfo([],"bool",nn("bool",1)),t=ZB({inputs:{a,b:e},backend:s});return s.disposeIntermediateTensorInfo(e),t}throw new Error(`Error in Cast: failed to cast ${a.dtype} to ${i}`)}},nz="return ceil(x);",sz=IF({opSnippet:nz,packedOpSnippet:nz,cpuKernelImpl:XD}),rz={kernelName:es,backendName:"webgl",kernelFunc:sz};class az{constructor(e){this.variableNames=["A"],this.customUniforms=[{name:"minVal",type:"float"},{name:"maxVal",type:"float"}],this.outputShape=e,this.userCode="\n\n void main() {\n float value = getAAtOutCoords();\n if (isnan(value)) {\n setOutput(value);\n return;\n }\n\n setOutput(clamp(value, minVal, maxVal));\n }\n "}}class iz{constructor(e){this.variableNames=["A"],this.packedInputs=!0,this.packedOutput=!0,this.customUniforms=[{name:"minVal",type:"float"},{name:"maxVal",type:"float"}],this.outputShape=e,this.userCode="\n void main() {\n vec4 value = getAAtOutCoords();\n\n if (any(isnan(value))) {\n setOutput(value);\n return;\n }\n\n setOutput(clamp(value, vec4(minVal), vec4(maxVal)));\n }\n "}}const oz={kernelName:ts,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:n,attrs:s}=e,{x:r}=t,{clipValueMin:a,clipValueMax:i}=s;let o;o=Sn().getBool("WEBGL_PACK_CLIP")?new iz(r.shape):new az(r.shape);const l=[[a],[i]];return n.runWebGLProgram(o,[r],r.dtype,l)}};class lz{constructor(e){this.variableNames=["real","imag"],this.outputShape=e,this.userCode="\n void main() {\n float re = abs(getRealAtOutCoords());\n float im = abs(getImagAtOutCoords());\n float mx = max(re, im);\n\n // sadly the length function in glsl is not underflow-safe\n // (at least not on Intel GPUs). So the safe solution is\n // to ensure underflow-safety in all cases.\n setOutput(\n mx == 0.0 ? 0.0 : mx * length(vec2(1, min(re, im)/mx))\n );\n }\n "}}function uz(e,t){return{dataId:t.dataId,dtype:t.dtype,shape:e.shape}}const cz={kernelName:ss,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:n}=e,{x:s}=t,r=n.texData.get(s.dataId),a=new lz(s.shape),i=[uz(s,r.complexTensorInfos.real),uz(s,r.complexTensorInfos.imag)];return n.runWebGLProgram(a,i,i[0].dtype)}};class hz{constructor(e){this.outputShape=[],this.outputShape=_m(e,1),this.variableNames=e.map(((e,t)=>`T${t}`));const t=new Array(e.length-1);t[0]=e[0][1];for(let n=1;n`T${t}`));const o=new Array(e.length-1);o[0]=e[0][t];for(let n=1;n= ${o[e-1]}) {\n return getChannel(\n getT${e}(${pz(i,l,t)}),\n vec2(${pz(u,l,t)}));\n }`}const d=o.length,p=o[o.length-1];h+=`\n return getChannel(\n getT${d}(${pz(i,l,p)}),\n vec2(${pz(u,l,p)}));`,this.userCode=`\n float getValue(${i.map((e=>"int "+e))}) {\n ${h}\n }\n\n void main() {\n ${r} coords = getOutputCoords();\n vec4 result = vec4(getValue(${a}), 0., 0., 0.);\n\n ${a[s-1]} = ${a[s-1]} + 1;\n if (${a[s-1]} < ${n[s-1]}) {\n result.g = getValue(${a});\n }\n\n ${a[s-2]} = ${a[s-2]} + 1;\n if (${a[s-2]} < ${n[s-2]}) {\n result.a = getValue(${a});\n }\n\n ${a[s-1]} = ${a[s-1]} - 1;\n if (${a[s-2]} < ${n[s-2]} &&\n ${a[s-1]} < ${n[s-1]}) {\n result.b = getValue(${a});\n }\n setOutput(result);\n }\n `}}function pz(e,t,n){const s=e.indexOf(t);return e.map(((e,t)=>t===s?`${e} - ${n}`:e)).join()}function fz(e){const{inputs:t,backend:n}=e,{input:s}=t;return yF({inputs:{x:n.texData.get(s.dataId).complexTensorInfos.imag},backend:n})}const mz={kernelName:$s,backendName:"webgl",kernelFunc:fz};function gz(e,t,n){const s=e[0].dtype;if("complex64"===s){const s=e.map((e=>QB({inputs:{input:e},backend:n}))),r=e.map((e=>fz({inputs:{input:e},backend:n}))),a=gz(s,t,n),i=gz(r,t,n),o=wF({inputs:{real:a,imag:i},backend:n});return s.forEach((e=>n.disposeIntermediateTensorInfo(e))),r.forEach((e=>n.disposeIntermediateTensorInfo(e))),n.disposeIntermediateTensorInfo(a),n.disposeIntermediateTensorInfo(i),o}let r=n.shouldExecuteOnCPU(e);if("string"===s&&(r=!0),r){const r=e.map((e=>{const s=$t(e.shape.slice(t));return zF({inputs:{x:e},backend:n,attrs:{shape:[-1,s]}})})),a=r.map((e=>({vals:n.readSync(e.dataId),shape:e.shape}))),i=_m(r.map((e=>e.shape)),1),o=1===r[0].shape[0],l=ZD(a,i,s,o),u=_m(e.map((e=>e.shape)),t),c=n.makeTensorInfo(u,s,l);return r.forEach((e=>n.disposeIntermediateTensorInfo(e))),c}const a=e.filter((e=>$t(e.shape)>0)),i=Sn().getBool("WEBGL_PACK_ARRAY_OPERATIONS")&&a[0].shape.length>1;if(1===a.length){const t=i?new $M(e[0].shape,eF):new oF(e[0].shape,eF);return n.runWebGLProgram(t,e,s)}const o=Sn().getNumber("WEBGL_MAX_TEXTURES_IN_SHADER");if(a.length>o){const e=[];for(let s=0;se.shape)),t);return n.runWebGLProgram(e,a,s)}const{tensors2D:l,outShape:u}=function(e,t,n){const s=_m(e.map((e=>e.shape)),t),r=e.map((e=>zF({inputs:{x:e},attrs:{shape:[-1,$t(e.shape.slice(t))]},backend:n})));return{tensors2D:r,outShape:s}}(a,t,n),c=new hz(l.map((e=>e.shape))),h=n.runWebGLProgram(c,l,s);l.forEach((e=>n.disposeIntermediateTensorInfo(e)));const d=zF({inputs:{x:h},attrs:{shape:u},backend:n});return n.disposeIntermediateTensorInfo(h),d}function yz(e){const{inputs:t,backend:n,attrs:s}=e,{axis:r}=s,a=en(r,t[0].shape)[0];Em(t.map((e=>e.shape)),a);const i=_m(t.map((e=>e.shape)),a);if(0===$t(i))return n.makeTensorInfo(i,t[0].dtype,[]);const o=t.filter((e=>$t(e.shape)>0));return 1===o.length?yF({inputs:{x:o[0]},backend:n}):gz(o,a,n)}const bz={kernelName:rs,backendName:"webgl",kernelFunc:yz};class wz{constructor(e,t=!1,n=null,s=!1,r=!1){this.variableNames=["x","W"],this.outputShape=e.outShape;const a=e.padInfo.top,i=e.padInfo.left,o=e.strideHeight,l=e.strideWidth,u=e.dilationHeight,c=e.dilationWidth,h=e.filterHeight,d=e.filterWidth,p=4*Math.floor(e.inChannels/4),f=e.inChannels%4,m="channelsLast"===e.dataFormat,g=m?1:2,y=m?2:3,b=m?3:1;let w="",v="";n&&(w=s?`float activation(float a) {\n float b = getPreluActivationWeightsAtOutCoords();\n ${n}\n }`:r?`float activation(float a) {\n float b = getLeakyreluAlphaAtOutCoords();\n ${n}\n }`:`\n float activation(float x) {\n ${n}\n }\n `,v="result = activation(result);");const x=t?"result += getBiasAtOutCoords();":"";t&&this.variableNames.push("bias"),s&&this.variableNames.push("preluActivationWeights"),r&&this.variableNames.push("leakyreluAlpha"),this.userCode=`\n ${w}\n\n const ivec2 strides = ivec2(${o}, ${l});\n const ivec2 pads = ivec2(${a}, ${i});\n\n void main() {\n ivec4 coords = getOutputCoords();\n int batch = coords[0];\n int d2 = coords[${b}];\n\n ivec2 xRCCorner =\n ivec2(coords[${g}], coords[${y}]) * strides - pads;\n int xRCorner = xRCCorner.x;\n int xCCorner = xRCCorner.y;\n\n // Convolve x(?, ?, d1) with w(:, :, d1, d2) to get y(yR, yC, d2).\n // ? = to be determined. : = across all values in that axis.\n float dotProd = 0.0;\n for (int wR = 0; wR < ${h}; wR++) {\n int xR = xRCorner + wR * ${u};\n\n if (xR < 0 || xR >= ${e.inHeight}) {\n continue;\n }\n\n for (int wC = 0; wC < ${d}; wC++) {\n int xC = xCCorner + wC * ${c};\n\n if (xC < 0 || xC >= ${e.inWidth}) {\n continue;\n }\n\n for (int d1 = 0; d1 < ${p}; d1 += 4) {\n vec4 wValues = vec4(\n getW(wR, wC, d1, d2),\n getW(wR, wC, d1 + 1, d2),\n getW(wR, wC, d1 + 2, d2),\n getW(wR, wC, d1 + 3, d2)\n );\n\n if (${m}) {\n vec4 xValues = vec4(\n getX(batch, xR, xC, d1),\n getX(batch, xR, xC, d1 + 1),\n getX(batch, xR, xC, d1 + 2),\n getX(batch, xR, xC, d1 + 3)\n );\n dotProd += dot(xValues, wValues);\n } else {\n vec4 xValues = vec4(\n getX(batch, d1, xR, xC),\n getX(batch, d1 + 1, xR, xC),\n getX(batch, d1 + 2, xR, xC),\n getX(batch, d1 + 3, xR, xC)\n );\n dotProd += dot(xValues, wValues);\n }\n }\n\n if (${1===f}) {\n\n if (${m}) {\n dotProd +=\n getX(batch, xR, xC, ${p}) *\n getW(wR, wC, ${p}, d2);\n } else {\n dotProd +=\n getX(batch, ${p}, xR, xC) *\n getW(wR, wC, ${p}, d2);\n }\n\n } else if (${2===f}) {\n vec2 wValues = vec2(\n getW(wR, wC, ${p}, d2),\n getW(wR, wC, ${p} + 1, d2)\n );\n\n if (${m}) {\n vec2 xValues = vec2(\n getX(batch, xR, xC, ${p}),\n getX(batch, xR, xC, ${p} + 1)\n );\n dotProd += dot(xValues, wValues);\n } else {\n vec2 xValues = vec2(\n getX(batch, ${p}, xR, xC),\n getX(batch, ${p} + 1, xR, xC)\n );\n dotProd += dot(xValues, wValues);\n }\n\n } else if (${3===f}) {\n vec3 wValues = vec3(\n getW(wR, wC, ${p}, d2),\n getW(wR, wC, ${p} + 1, d2),\n getW(wR, wC, ${p} + 2, d2)\n );\n\n if (${m}) {\n vec3 xValues = vec3(\n getX(batch, xR, xC, ${p}),\n getX(batch, xR, xC, ${p} + 1),\n getX(batch, xR, xC, ${p} + 2)\n );\n dotProd += dot(xValues, wValues);\n } else {\n vec3 xValues = vec3(\n getX(batch, ${p}, xR, xC),\n getX(batch, ${p} + 1, xR, xC),\n getX(batch, ${p} + 2, xR, xC)\n );\n dotProd += dot(xValues, wValues);\n }\n\n }\n }\n }\n\n float result = dotProd;\n ${x}\n ${v}\n setOutput(result);\n }\n `}}class vz{constructor(e){this.variableNames=["x","W"],this.outputShape=e.outShape;const t=e.padInfo.front,n=e.padInfo.top,s=e.padInfo.left,r=e.strideDepth,a=e.strideHeight,i=e.strideWidth,o=e.dilationDepth,l=e.dilationHeight,u=e.dilationWidth,c=e.filterDepth,h=e.filterHeight,d=e.filterWidth,p=4*Math.floor(e.inChannels/4),f=e.inChannels%4;this.userCode=`\n const ivec3 strides = ivec3(${r}, ${a}, ${i});\n const ivec3 pads = ivec3(${t}, ${n}, ${s});\n\n void main() {\n ivec5 coords = getOutputCoords();\n int batch = coords.x;\n int d2 = coords.u;\n\n ivec3 xFRCCorner = ivec3(coords.y, coords.z, coords.w) * strides - pads;\n int xFCorner = xFRCCorner.x;\n int xRCorner = xFRCCorner.y;\n int xCCorner = xFRCCorner.z;\n\n // Convolve x(?, ?, ?, d1) with w(:, :, :, d1, d2) to get\n // y(yF, yR, yC, d2). ? = to be determined. : = across all\n // values in that axis.\n float dotProd = 0.0;\n for (int wF = 0; wF < ${c}; wF++) {\n int xF = xFCorner + wF * ${o};\n\n if (xF < 0 || xF >= ${e.inDepth}) {\n continue;\n }\n\n for (int wR = 0; wR < ${h}; wR++) {\n int xR = xRCorner + wR * ${l};\n\n if (xR < 0 || xR >= ${e.inHeight}) {\n continue;\n }\n\n for (int wC = 0; wC < ${d}; wC++) {\n int xC = xCCorner + wC * ${u};\n\n if (xC < 0 || xC >= ${e.inWidth}) {\n continue;\n }\n\n for (int d1 = 0; d1 < ${p}; d1 += 4) {\n vec4 xValues = vec4(\n getX(batch, xF, xR, xC, d1),\n getX(batch, xF, xR, xC, d1 + 1),\n getX(batch, xF, xR, xC, d1 + 2),\n getX(batch, xF, xR, xC, d1 + 3)\n );\n vec4 wValues = vec4(\n getW(wF, wR, wC, d1, d2),\n getW(wF, wR, wC, d1 + 1, d2),\n getW(wF, wR, wC, d1 + 2, d2),\n getW(wF, wR, wC, d1 + 3, d2)\n );\n\n dotProd += dot(xValues, wValues);\n }\n\n if (${1===f}) {\n dotProd +=\n getX(batch, xF, xR, xC, ${p}) *\n getW(wF, wR, wC, ${p}, d2);\n } else if (${2===f}) {\n vec2 xValues = vec2(\n getX(batch, xF, xR, xC, ${p}),\n getX(batch, xF, xR, xC, ${p} + 1)\n );\n vec2 wValues = vec2(\n getW(wF, wR, wC, ${p}, d2),\n getW(wF, wR, wC, ${p} + 1, d2)\n );\n dotProd += dot(xValues, wValues);\n } else if (${3===f}) {\n vec3 xValues = vec3(\n getX(batch, xF, xR, xC, ${p}),\n getX(batch, xF, xR, xC, ${p} + 1),\n getX(batch, xF, xR, xC, ${p} + 2)\n );\n vec3 wValues = vec3(\n getW(wF, wR, wC, ${p}, d2),\n getW(wF, wR, wC, ${p} + 1, d2),\n getW(wF, wR, wC, ${p} + 2, d2)\n );\n dotProd += dot(xValues, wValues);\n }\n }\n }\n }\n setOutput(dotProd);\n }\n `}}class xz{constructor(e,t=!1,n=null,s=!1,r=!1){this.variableNames=["x","W"],this.packedInputs=!0,this.packedOutput=!0,this.customUniforms=[{name:"pads",type:"ivec2"},{name:"strides",type:"ivec2"},{name:"dilations",type:"ivec2"},{name:"inDims",type:"ivec2"}],this.outputShape=e.outShape,this.enableShapeUniforms=SD(this.outputShape.length);const a=e.padInfo.left,i=e.strideWidth,o=e.dilationWidth,l=e.filterHeight,u=e.filterWidth,c=u;let h="\n int xR; int xC; int xCOffset;\n vec4 wTexel; vec4 previous; vec4 final;";for(let e=0;e=0 && xR < inDims[0]) {\n ";for(let t=0;t<(c+1)/2;t++){const n=2*t;if(h+=`\n xC = xCCorner + ${n*o};\n `,1===i){if(n= 0 && xCOffset < inDims[1] && xTexelC${n}Ready == 0) {\n xTexelC${n} = getX(batch, xR, xCOffset, d1);\n\n // Need to manually clear unused channels in case\n // we're reading from recycled texture.\n if (xCOffset + 1 >= inDims[1]) {\n xTexelC${n}.zw = vec2(0.0);\n }\n xTexelC${n}Ready = 1;\n }\n `,h+=1===o&&n>0?`\n xC${n} = vec4(xTexelC${n-2}.zw, xTexelC${n}.xy);\n `:`\n xCOffset = xC + 1 - 2;\n\n if (xCOffset >= 0 && xCOffset < inDims[1]) {\n previous = getX(batch, xR, xCOffset, d1);\n\n // Need to manually clear unused channels in case\n // we're reading from recycled texture.\n if (xCOffset + 1 >= inDims[1]) {\n previous.zw = vec2(0.0);\n }\n\n xC${n} = vec4(previous.zw, xTexelC${n}.xy);\n } else {\n xC${n} = vec4(0.0, 0.0, xTexelC${n}.xy);\n }\n `):h+=`\n if (xC >= 0 && xC < inDims[1] && xTexelC${n}Ready == 0) {\n xTexelC${n} = getX(batch, xR, xC, d1);\n if (xC + 1 >= inDims[1]) {\n xTexelC${n}.zw = vec2(0.0);\n }\n xTexelC${n}Ready = 1;\n }\n\n xC${n} = xTexelC${n};\n `,n+1= 0 && xCOffset < inDims[1] && xTexelC${n+1}Ready == 0) {\n xTexelC${n+1} = getX(batch, xR, xCOffset, d1);\n\n // Need to manually clear unused channels in case\n // we're reading from recycled texture.\n if (xCOffset + 1 >= inDims[1]) {\n xTexelC${n+1}.zw = vec2(0.0);\n }\n xTexelC${n+1}Ready = 1;\n }\n `,h+=o>1?`\n xCOffset -= 2;\n if (xCOffset >= 0 && xCOffset < inDims[1]) {\n previous = getX(batch, xR, xCOffset, d1);\n xC${n+1} = vec4(previous.zw, xTexelC${n+1}.xy);\n } else {\n xC${n+1} = vec4(0.0, 0.0, xTexelC${n+1}.xy);\n }\n `:`\n xC${n+1} = vec4(xTexelC${n}.zw, xTexelC${n+1}.xy);\n `):h+=1===e?`\n xC${n+1} = xTexelC${n};\n `:`\n xCOffset = xC + ${e};\n\n if (xCOffset >= 0 && xCOffset < inDims[1] && xTexelC${n+1}Ready == 0) {\n xTexelC${n+1} = getX(batch, xR, xCOffset, d1);\n if (xCOffset + 1 >= inDims[1]) {\n xTexelC${n+1}.zw = vec2(0.0);\n }\n xTexelC${n+1}Ready = 1;\n }\n\n xC${n+1} = xTexelC${n+1};\n `}}else n= 0 && xCOffset < inDims[1] && xTexelC${n}Ready == 0) {\n xTexelC${n} = getX(batch, xR, xCOffset, d1);\n // Need to manually clear unused channels in case\n // we're reading from recycled texture.\n if (xCOffset + 1 >= inDims[1]) {\n xTexelC${n}.zw = vec2(0.0);\n }\n xTexelC${n}Ready = 1;\n }\n\n if(xC + 1 >= 0 && xC + 1 < inDims[1] && xTexelC${n+1}Ready == 0) {\n xTexelC${n+1} = getX(batch, xR, xC + 1, d1);\n // Need to manually clear unused channels in case\n // we're reading from recycled texture.\n if (xC + 2 >= inDims[1]) {\n xTexelC${n+1}.zw = vec2(0.0);\n }\n xTexelC${n+1}Ready = 1;\n }\n\n xC${n} = vec4(xTexelC${n}.zw, xTexelC${n+1}.zw);\n `,n+1= 0 && xCOffset < inDims[1]) {\n final = getX(batch, xR, xCOffset, d1);\n }\n xC${n+1} = vec4(xTexelC${n+1}.xy, final.xy);\n `)):(h+=`\n if(xC >= 0 && xC < inDims[1] && xTexelC${n}Ready == 0) {\n xTexelC${n} = getX(batch, xR, xC, d1);\n if (xC + 1 >= inDims[1]) {\n xTexelC${n}.zw = vec2(0.0);\n }\n xTexelC${n}Ready = 1;\n }\n\n xCOffset = xC + strides[1];\n if(xCOffset >= 0 && xCOffset < inDims[1] && xTexelC${n+1}Ready == 0) {\n xTexelC${n+1} = getX(batch, xR, xCOffset, d1);\n if (xCOffset + 1 >= inDims[1]) {\n xTexelC${n+1}.zw = vec2(0.);\n }\n xTexelC${n+1}Ready = 1;\n }\n\n xC${n} = vec4(\n xTexelC${n}.xy, xTexelC${n+1}.xy);\n `,n+1= 0) {\n // Use custom imod instead mod. On Intel GPU, mod may generate\n // unexpected value.\n // https://github.com/tensorflow/tfjs/issues/5447\n offsetX = imod(blockIndex, outWidth) * stride[1] - pad[1];\n d1 = offsetX + dilation[1] * (imod(pos, itemsPerBlockRow) /\n inChannels);\n\n if(d1 < inputShape[${i}] && d1 >= 0) {\n\n ch = imod(pos, inChannels);\n\n if (${r}) {\n innerDims = vec2(d1, ch);\n result[${2*e+t}] = getChannel(\n getA(rc.x, d0, int(innerDims.x),\n int(innerDims.y)), innerDims);\n } else {\n innerDims = vec2(d0, d1);\n result[${2*e+t}] = getChannel(\n getA(rc.x, ch, int(innerDims.x),\n int(innerDims.y)), innerDims);\n }\n }\n }\n }\n `;this.userCode=`\n void main() {\n ivec3 rc = getOutputCoords();\n\n vec4 result = vec4(0);\n\n int blockIndex, pos, offsetY, d0, offsetX, d1, ch;\n vec2 innerDims;\n\n ${l}\n\n ${s.output} = result;\n }\n `}}function kz(e,t){const n=e.length;return n>=3?t?[...e.slice(0,-3),e[n-3]*e[n-2],e[n-1]]:[...e.slice(0,-3),e[n-3],e[n-2]*e[n-1]]:!t&&1===n&&e[0]>1?[e[0],1]:null}function Cz({x:e,filter:t,convInfo:n,backend:s,bias:r=null,preluActivationWeights:a=null,leakyreluAlpha:i=0,activation:o=null}){const l=e.shape,u=s.texData.get(e.dataId),c=n.inChannels,h=l[0]*l[1]*l[2],d=n.outChannels,p="channelsLast"===n.dataFormat,f=!1;let m;const g=[];if(null!=a){const e=kz(a.shape,p);null!=e&&(a=zF({inputs:{x:a},backend:s,attrs:{shape:e}}),g.push(a))}if(null!=r){const e=kz(r.shape,p);null!=e&&(r=zF({inputs:{x:r},backend:s,attrs:{shape:e}}),g.push(r))}if(!((1===h||1===d)&&c>XF)&&u.isPacked&&p&&null!=u.texture&&l[2]%2!=0&&Kt(u.shape.slice(-3),l.slice(-3))){const c=l[0]*l[1]*(l[2]+1),h={dataId:e.dataId,shape:[1,c,n.inChannels],dtype:e.dtype},d=u.shape;u.shape=u.shape.slice(),u.shape[u.shape.length-2]++,qt(HR(u.shape,h.shape),(()=>`packed reshape ${u.shape} to ${h.shape} isn't free`));const p=zF({inputs:{x:t},backend:s,attrs:{shape:[1,n.inChannels,n.outChannels]}});g.push(p);const y=ZF({a:h,b:p,backend:s,transposeA:false,transposeB:f,bias:r,activation:o,preluActivationWeights:a,leakyreluAlpha:i}),b=s.texData.get(y.dataId);qt(b.isPacked,(()=>"batchMatMul result is expected to be packed")),u.shape=d,b.shape=n.outShape,m=yF({inputs:{x:y},backend:s}),m.shape=n.outShape,g.push(y)}else{const l=n.outHeight*n.outWidth,u=zF({inputs:{x:e},backend:s,attrs:{shape:p?[n.batchSize,l,n.inChannels]:[n.batchSize,n.inChannels,l]}}),c=zF({inputs:{x:t},backend:s,attrs:{shape:[1,n.inChannels,n.outChannels]}}),h=ZF({a:p?u:c,b:p?c:u,transposeA:!p,transposeB:f,backend:s,bias:r,activation:o,preluActivationWeights:a,leakyreluAlpha:i});m=zF({inputs:{x:h},backend:s,attrs:{shape:n.outShape}}),g.push(u),g.push(c),g.push(h)}for(const e of g)s.disposeIntermediateTensorInfo(e);return m}function Sz({x:e,filter:t,convInfo:n,backend:s,bias:r=null,preluActivationWeights:a=null,leakyreluAlpha:i=0,activation:o=null}){const{filterWidth:l,filterHeight:u,inChannels:c,outWidth:h,outHeight:d,dataFormat:p}=n,f="channelsLast"===p,m=l*u*c,g=d*h,y=[n.batchSize,m,g],b=[];if(null!=a){const e=kz(a.shape,f);null!=e&&(a=zF({inputs:{x:a},backend:s,attrs:{shape:e}}),b.push(a))}if(null!=r){const e=kz(r.shape,f);null!=e&&(r=zF({inputs:{x:r},backend:s,attrs:{shape:e}}),b.push(r))}const w=zF({inputs:{x:t},backend:s,attrs:{shape:[1,m,$t(t.shape)/m]}});b.push(w);const v=new Az(y,n),x=[e.shape,[n.padInfo.top,n.padInfo.left],[n.strideHeight,n.strideWidth],[n.dilationHeight,n.dilationWidth],[n.inChannels],[n.filterWidth*n.inChannels],[n.outWidth]],A=s.runWebGLProgram(v,[e],"float32",x),k=zF({inputs:{x:A},backend:s,attrs:{shape:y}});b.push(A),b.push(k);const C=null!=r,S=null!=a,E="leakyrelu"===o,_=o?NF(o,!0):null,I=new OF(f?k.shape:w.shape,f?w.shape:k.shape,f?[n.batchSize,g,n.outChannels]:[n.batchSize,n.outChannels,g],!0,!1,C,_,S,E),T=f?[k,w]:[w,k];if(r&&T.push(r),S&&T.push(a),E){const e=s.makeTensorInfo([],"float32",di(i,"float32"));T.push(e),b.push(e)}const N=s.runWebGLProgram(I,T,"float32"),O=zF({inputs:{x:N},backend:s,attrs:{shape:n.outShape}});b.push(N);for(const e of b)s.disposeIntermediateTensorInfo(e);return O}const Ez={kernelName:as,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:n,attrs:s}=e,{x:r,filter:a}=t,{strides:i,pad:o,dataFormat:l,dilations:u,dimRoundingMode:c}=s,h=_c(l),d=yc(r.shape,a.shape,i,u,o,c,!1,h);let p;if(1!==d.filterHeight||1!==d.filterWidth||1!==d.dilationHeight||1!==d.dilationWidth||1!==d.strideHeight||1!==d.strideWidth||"SAME"!==d.padInfo.type&&"VALID"!==d.padInfo.type)if(d.strideWidth<=2&&"channelsLast"===h&&Sn().getBool("WEBGL_EXP_CONV")){const e=new xz(d),t=[[d.padInfo.top,d.padInfo.left],[d.strideHeight,d.strideWidth],[d.dilationHeight,d.dilationWidth],[d.inHeight,d.inWidth]];p=n.runWebGLProgram(e,[r,a],"float32",t)}else if(Sn().getBool("WEBGL_CONV_IM2COL"))p=Sz({x:r,filter:a,convInfo:d,backend:n});else{const e=new wz(d);p=n.runWebGLProgram(e,[r,a],"float32")}else p=Cz({x:r,filter:a,convInfo:d,backend:n});const f=zF({inputs:{x:p},backend:n,attrs:{shape:d.outShape}});return n.disposeIntermediateTensorInfo(p),f}};class _z{constructor(e){this.variableNames=["x","dy"],this.outputShape=e.filterShape;const t=e.strideHeight,n=e.strideWidth,s=e.padInfo.top,r=e.padInfo.left,a="channelsLast"===e.dataFormat;this.userCode=`\n void main() {\n ivec4 coords = getOutputCoords();\n int wR = coords.x;\n int wC = coords.y;\n int d1 = coords.z;\n int d2 = coords.w;\n\n // Convolve x(?, ?, d1) with dy(:, :, d2) to get dw(wR, wC, d1, d2).\n // ? = to be determined. : = across all values in that axis.\n float dotProd = 0.0;\n\n for (int b = 0; b < ${e.batchSize}; b++) {\n for (int yR = 0; yR < ${e.outHeight}; yR++) {\n int xR = wR + yR * ${t} - ${s};\n\n if (xR < 0 || xR >= ${e.inHeight}) {\n continue;\n }\n\n for (int yC = 0; yC < ${e.outWidth}; yC++) {\n int xC = wC + yC * ${n} - ${r};\n\n if (xC < 0 || xC >= ${e.inWidth}) {\n continue;\n }\n\n ${a?"float dyValue = getDy(b, yR, yC, d2);\n float xValue = getX(b, xR, xC, d1);\n dotProd += (xValue * dyValue);":"float dyValue = getDy(b, d2, yR, yC);\n float xValue = getX(b, d1, xR, xC);\n dotProd += (xValue * dyValue);"}\n }\n }\n }\n setOutput(dotProd);\n }\n `}}class Iz{constructor(e){this.variableNames=["dy","W"],this.outputShape=e.inShape;const t=e.filterHeight,n=e.filterWidth,s=e.strideHeight,r=e.strideWidth,a="channelsLast"===e.dataFormat,i=t-1-e.padInfo.top,o=n-1-e.padInfo.left,l=a?1:2,u=a?2:3,c=a?3:1;this.userCode=`\n const ivec2 pads = ivec2(${i}, ${o});\n\n void main() {\n ivec4 coords = getOutputCoords();\n int batch = coords[0];\n int d1 = coords[${c}];\n\n ivec2 dyCorner = ivec2(coords[${l}], coords[${u}]) - pads;\n int dyRCorner = dyCorner.x;\n int dyCCorner = dyCorner.y;\n\n // Convolve dy(?, ?, d2) with w(:, :, d1, d2) to compute dx(xR, xC, d1).\n // ? = to be determined. : = across all values in that axis.\n float dotProd = 0.0;\n for (int wR = 0; wR < ${t}; wR++) {\n float dyR = float(dyRCorner + wR) / ${s}.0;\n\n if (dyR < 0.0 || dyR >= ${e.outHeight}.0 || fract(dyR) > 0.0) {\n continue;\n }\n int idyR = int(dyR);\n\n int wRPerm = ${t} - 1 - wR;\n\n for (int wC = 0; wC < ${n}; wC++) {\n float dyC = float(dyCCorner + wC) / ${r}.0;\n\n if (dyC < 0.0 || dyC >= ${e.outWidth}.0 ||\n fract(dyC) > 0.0) {\n continue;\n }\n int idyC = int(dyC);\n\n int wCPerm = ${n} - 1 - wC;\n\n for (int d2 = 0; d2 < ${e.outChannels}; d2++) {\n\n if (${a}) {\n float xValue = getDy(batch, idyR, idyC, d2);\n float wValue = getW(wRPerm, wCPerm, d1, d2);\n dotProd += xValue * wValue;\n } else {\n float xValue = getDy(batch, d2, idyR, idyC);\n float wValue = getW(wRPerm, wCPerm, d1, d2);\n dotProd += xValue * wValue;\n }\n\n }\n }\n }\n setOutput(dotProd);\n }\n `}}class Tz{constructor(e){this.variableNames=["x","dy"],this.outputShape=e.filterShape;const t=e.strideDepth,n=e.strideHeight,s=e.strideWidth,r=e.padInfo.front,a=e.padInfo.top,i=e.padInfo.left;this.userCode=`\n void main() {\n ivec5 coords = getOutputCoords();\n int wF = coords.x;\n int wR = coords.y;\n int wC = coords.z;\n int d1 = coords.w;\n int d2 = coords.u;\n\n float dotProd = 0.0;\n\n for (int b = 0; b < ${e.batchSize}; b++) {\n for (int yF = 0; yF < ${e.outDepth}; yF++) {\n int xF = wF + yF * ${t} - ${r};\n\n if (xF < 0 || xF >= ${e.inDepth}) {\n continue;\n }\n\n for (int yR = 0; yR < ${e.outHeight}; yR++) {\n int xR = wR + yR * ${n} - ${a};\n\n if (xR < 0 || xR >= ${e.inHeight}) {\n continue;\n }\n\n for (int yC = 0; yC < ${e.outWidth}; yC++) {\n int xC = wC + yC * ${s} - ${i};\n\n if (xC < 0 || xC >= ${e.inWidth}) {\n continue;\n }\n\n float dyValue = getDy(b, yF, yR, yC, d2);\n float xValue = getX(b, xF, xR, xC, d1);\n dotProd += (xValue * dyValue);\n }\n }\n }\n }\n setOutput(dotProd);\n }\n `}}class Nz{constructor(e){this.variableNames=["dy","W"],this.outputShape=e.inShape;const t=e.filterDepth,n=e.filterHeight,s=e.filterWidth,r=e.strideDepth,a=e.strideHeight,i=e.strideWidth,o=t-1-e.padInfo.front,l=n-1-e.padInfo.top,u=s-1-e.padInfo.left;this.userCode=`\n const ivec3 pads = ivec3(${o}, ${l}, ${u});\n\n void main() {\n ivec5 coords = getOutputCoords();\n int batch = coords.x;\n int d1 = coords.u;\n\n\n ivec3 dyCorner = ivec3(coords.y, coords.z, coords.w) - pads;\n int dyFCorner = dyCorner.x;\n int dyRCorner = dyCorner.y;\n int dyCCorner = dyCorner.z;\n\n float dotProd = 0.0;\n for (int wF = 0; wF < ${t}; wF++) {\n float dyF = float(dyFCorner + wF) / ${r}.0;\n\n if (dyF < 0.0 || dyF >= ${e.outDepth}.0 || fract(dyF) > 0.0) {\n continue;\n }\n int idyF = int(dyF);\n\n int wFPerm = ${t} - 1 - wF;\n\n for (int wR = 0; wR < ${n}; wR++) {\n float dyR = float(dyRCorner + wR) / ${a}.0;\n\n if (dyR < 0.0 || dyR >= ${e.outHeight}.0 ||\n fract(dyR) > 0.0) {\n continue;\n }\n int idyR = int(dyR);\n\n int wRPerm = ${n} - 1 - wR;\n\n for (int wC = 0; wC < ${s}; wC++) {\n float dyC = float(dyCCorner + wC) / ${i}.0;\n\n if (dyC < 0.0 || dyC >= ${e.outWidth}.0 ||\n fract(dyC) > 0.0) {\n continue;\n }\n int idyC = int(dyC);\n\n int wCPerm = ${s} - 1 - wC;\n\n for (int d2 = 0; d2 < ${e.outChannels}; d2++) {\n float xValue = getDy(batch, idyF, idyR, idyC, d2);\n float wValue = getW(wFPerm, wRPerm, wCPerm, d1, d2);\n dotProd += xValue * wValue;\n }\n }\n }\n }\n setOutput(dotProd);\n }\n `}}const Oz={kernelName:is,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:n,attrs:s}=e,{x:r,dy:a}=t,{strides:i,pad:o,dataFormat:l,dimRoundingMode:u,filterShape:c}=s,h=_c(l),d=yc(r.shape,c,i,1,o,u,!1,h),p=new _z(d);return n.runWebGLProgram(p,[r,a],"float32")}};class Rz{constructor(e){this.variableNames=["dy","W"],this.packedInputs=!0,this.packedOutput=!0,this.customUniforms=[{name:"strides",type:"vec2"}],this.outputShape=e.inShape,this.enableShapeUniforms=SD(this.outputShape.length);const t=e.filterHeight,n=e.filterWidth,s=t-1-e.padInfo.top,r=n-1-e.padInfo.left;this.userCode=`\n const ivec2 pads = ivec2(${s}, ${r});\n\n void main() {\n ivec4 coords = getOutputCoords();\n int batch = coords[0];\n int d1 = coords[3];\n\n ivec2 dyCorner = ivec2(coords[1], coords[2]) - pads;\n int dyRCorner = dyCorner.x;\n int dyCCorner = dyCorner.y;\n\n vec4 result = vec4(0.);\n for (int wR = 0; wR < ${t}; wR++) {\n float dyR = float(dyRCorner + wR) / strides[0];\n if (dyR < 0.0 || dyR >= ${e.outHeight}.0 || fract(dyR) > 0.0) {\n continue;\n }\n int idyR = int(dyR);\n int wRPerm = ${t} - 1 - wR;\n\n for (int wC = 0; wC < ${n}; wC++) {\n int wCPerm = ${n} - 1 - wC;\n\n float dyC = float(dyCCorner + wC) / strides[1];\n bool idyCVal = (dyC >= 0.0) && (dyC < ${e.outWidth}.0)\n && (fract(dyC) == 0.0);\n int idyC = int(dyC);\n\n float dyC2 = float(dyCCorner + wC + 1) / strides[1];\n bool idyCVal2 = (dyC2 >= 0.0) && (dyC2 < ${e.outWidth}.0)\n && (fract(dyC2) == 0.0);\n int idyC2 = int(dyC2);\n\n if (idyCVal && idyCVal2) {\n for (int d2 = 0; d2 < ${e.outChannels}; d2 += 2) {\n vec4 wValue = getW(wRPerm, wCPerm, d1, d2);\n vec4 dySample = getDy(batch, idyR, idyC, d2);\n vec4 dySample2 = (idyC / 2 == idyC2 / 2) ?\n dySample : getDy(batch, idyR, idyC2, d2);\n\n vec2 dyValue = mod(float(idyC), 2.) == 0. ?\n dySample.xy : dySample.zw;\n result.xy += vec2(dot(dyValue, wValue.xy),\n dot(dyValue, wValue.zw));\n\n dyValue = mod(float(idyC2), 2.) == 0. ?\n dySample2.xy : dySample2.zw;\n result.zw += vec2(dot(dyValue, wValue.xy),\n dot(dyValue, wValue.zw));\n }\n } else if (idyCVal) {\n for (int d2 = 0; d2 < ${e.outChannels}; d2 += 2) {\n vec4 wValue = getW(wRPerm, wCPerm, d1, d2);\n vec4 dySample = getDy(batch, idyR, idyC, d2);\n vec2 dyValue = mod(float(idyC), 2.) == 0. ?\n dySample.xy : dySample.zw;\n result.xy += vec2(dot(dyValue, wValue.xy),\n dot(dyValue, wValue.zw));\n }\n } else if (idyCVal2) {\n for (int d2 = 0; d2 < ${e.outChannels}; d2 += 2) {\n vec4 wValue = getW(wRPerm, wCPerm, d1, d2);\n vec4 dySample = getDy(batch, idyR, idyC2, d2);\n vec2 dyValue = mod(float(idyC2), 2.) == 0. ?\n dySample.xy : dySample.zw;\n result.zw += vec2(dot(dyValue, wValue.xy),\n dot(dyValue, wValue.zw));\n }\n }\n }\n }\n setOutput(result);\n }\n `}}const Dz={kernelName:os,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:n,attrs:s}=e,{dy:r,filter:a}=t,{inputShape:i,strides:o,pad:l,dataFormat:u,dimRoundingMode:c}=s,h=_c(u),d=yc(i,a.shape,o,1,l,c,!1,h);if(Sn().getBool("WEBGL_PACK_CONV2DTRANSPOSE")&&"channelsLast"===h){const e=[[d.strideHeight,d.strideWidth]],t=new Rz(d);return n.runWebGLProgram(t,[r,a],"float32",e)}{const e=new Iz(d);return n.runWebGLProgram(e,[r,a],"float32")}}};const Mz={kernelName:ls,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:n,attrs:s}=e,{x:r,filter:a}=t,{strides:i,pad:o,dilations:l}=s,u=bc(r.shape,a.shape,i,l,o),c=new vz(u);return n.runWebGLProgram(c,[r,a],"float32")}};const Fz={kernelName:us,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:n,attrs:s}=e,{x:r,dy:a}=t,{strides:i,pad:o,filterShape:l}=s,u=bc(r.shape,l,i,1,o),c=new Tz(u);return n.runWebGLProgram(c,[r,a],"float32")}};const Bz={kernelName:cs,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:n,attrs:s}=e,{dy:r,filter:a}=t,{pad:i,strides:o,inputShape:l}=s,u=bc(l,a.shape,o,1,i),c=new Nz(u);return n.runWebGLProgram(c,[r,a],"float32")}},zz=IF({opSnippet:_F+"\n return cos(x);\n",packedOpSnippet:`\n vec4 result = cos(x);\n bvec4 isNaN = isnan(x);\n ${mF}\n return result;\n`}),Lz={kernelName:hs,backendName:"webgl",kernelFunc:zz},Pz=IF({opSnippet:"\n float e2x = exp(-x);\n return (e2x + 1.0 / e2x) / 2.0;\n"}),Vz={kernelName:ds,backendName:"webgl",kernelFunc:Pz};class Wz{constructor(e,t,n,s,r){this.variableNames=["Image","Boxes","BoxInd"],this.outputShape=[];const[a,i,o,l]=e,[u]=t,[c,h]=n;this.outputShape=[u,c,h,l];const d="bilinear"===s?1:0,[p,f]=[i-1+".0",o-1+".0"],[m,g,y]=c>1?[""+(i-1)/(c-1),"(y2-y1) * height_ratio",`y1*${p} + float(y)*(height_scale)`]:["0.0","0.0",`0.5 * (y1+y2) * ${p}`],[b,w,v]=h>1?[""+(o-1)/(h-1),"(x2-x1) * width_ratio",`x1*${f} + float(x)*(width_scale)`]:["0.0","0.0",`0.5 * (x1+x2) * ${f}`];this.userCode=`\n const float height_ratio = float(${m});\n const float width_ratio = float(${b});\n void main() {\n ivec4 coords = getOutputCoords();\n int b = coords[0];\n int y = coords[1];\n int x = coords[2];\n int d = coords[3];\n\n // get box vals\n float y1 = getBoxes(b,0);\n float x1 = getBoxes(b,1);\n float y2 = getBoxes(b,2);\n float x2 = getBoxes(b,3);\n\n // get image in batch index\n int bInd = round(getBoxInd(b));\n if(bInd < 0 || bInd >= ${a}) {\n return;\n }\n\n float height_scale = ${g};\n float width_scale = ${w};\n\n float in_y = ${y};\n if( in_y < 0.0 || in_y > ${p} ) {\n setOutput(float(${r}));\n return;\n }\n float in_x = ${v};\n if( in_x < 0.0 || in_x > ${f} ) {\n setOutput(float(${r}));\n return;\n }\n\n vec2 sourceFracIndexCR = vec2(in_x,in_y);\n if(${d} == 1) {\n // Compute the four integer indices.\n ivec2 sourceFloorCR = ivec2(sourceFracIndexCR);\n ivec2 sourceCeilCR = ivec2(ceil(sourceFracIndexCR));\n\n float topLeft = getImage(b, sourceFloorCR.y, sourceFloorCR.x, d);\n float bottomLeft = getImage(b, sourceCeilCR.y, sourceFloorCR.x, d);\n float topRight = getImage(b, sourceFloorCR.y, sourceCeilCR.x, d);\n float bottomRight = getImage(b, sourceCeilCR.y, sourceCeilCR.x, d);\n\n vec2 fracCR = sourceFracIndexCR - vec2(sourceFloorCR);\n\n float top = topLeft + (topRight - topLeft) * fracCR.x;\n float bottom = bottomLeft + (bottomRight - bottomLeft) * fracCR.x;\n float newValue = top + (bottom - top) * fracCR.y;\n setOutput(newValue);\n } else {\n // Compute the coordinators of nearest neighbor point.\n ivec2 sourceNearestCR = ivec2(floor(\n sourceFracIndexCR + vec2(0.5,0.5)));\n float newValue = getImage(b, sourceNearestCR.y, sourceNearestCR.x, d);\n setOutput(newValue);\n }\n }\n `}}const Uz={kernelName:ms,backendName:"webgl",kernelFunc:e=>{const{inputs:t,backend:n,attrs:s}=e,{image:r,boxes:a,boxInd:i}=t,{cropSize:o,method:l,extrapolationValue:u}=s,c=new Wz(r.shape,a.shape,o,l,u);return n.runWebGLProgram(c,[r,a,i],"float32")}};var Gz;!function(e){e.Prod="*",e.Sum="+"}(Gz||(Gz={}));class qz{constructor(e,t,n,s){this.op=e,this.outputShape=t,this.variableNames=["x"],this.customUniforms=[{name:"index",type:"float"}];const r=this.outputShape.length,a=this.op===Gz.Prod?"1.0":"0.0",i=n?a:`getX(${jz(r,"coords",this.op)})`,o=this.outputShape[this.outputShape.length-1];let l="",u="";n?(l=s?"end != "+(o-1):"end != 0",u=s?"end + 1":"end - 1"):(l=s?`end + pow2 < ${o}`:"end >= pow2",u=s?"end + pow2":"end - pow2"),this.userCode=`\n void main() {\n ${bD(r)} coords = getOutputCoords();\n int end = ${Hz(r,"coords",this.op)};\n float val = ${i};\n int pow2 = int(pow(2.0, index));\n if (${l}) {\n int idx = ${u};\n ${Hz(r,"coords",this.op)} = idx;\n val ${this.op}= getX(${jz(r,"coords",this.op)});\n }\n setOutput(val);\n }\n `}}function jz(e,t,n){if(1===e)return`${t}`;if(2===e)return`${t}.x, ${t}.y`;if(3===e)return`${t}.x, ${t}.y, ${t}.z`;if(4===e)return`${t}.x, ${t}.y, ${t}.z, ${t}.w`;throw new Error(`Cumulative ${n} for rank ${e} is not yet supported`)}function Hz(e,t,n){if(1===e)return`${t}`;if(2===e)return`${t}.y`;if(3===e)return`${t}.z`;if(4===e)return`${t}.w`;throw new Error(`Cumulative ${n} for rank ${e} is not yet supported`)}function $z(e,t,n,s,r,a){const i=t.shape.length,o=Ih([s],i);let l=t;null!=o&&(l=$F({inputs:{x:t},backend:n,attrs:{perm:o}}));const u=Nh(1,i)[0];if(u!==i-1)throw new Error(`WebGL cumprod shader expects an inner-most axis=${t.shape.length-1} but got axis=${s}`);const c=l.shape[u];let h=yF({inputs:{x:l},backend:n});for(let t=0;t<=Math.ceil(Math.log2(c))-1;t++){const s=new qz(e,l.shape,!1,a),r=[[t]],i=h;h=n.runWebGLProgram(s,[h],h.dtype,r),n.disposeIntermediateTensorInfo(i)}if(r){const t=new qz(e,l.shape,r,a),s=h;h=n.runWebGLProgram(t,[h],h.dtype),n.disposeIntermediateTensorInfo(s)}if(null!=o){const e=$F({inputs:{x:h},backend:n,attrs:{perm:Th(o)}});return n.disposeIntermediateTensorInfo(h),n.disposeIntermediateTensorInfo(l),e}return h}const Kz={kernelName:ps,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:n,attrs:s}=e,{x:r}=t,{axis:a,exclusive:i,reverse:o}=s;return $z(Gz.Prod,r,n,a,i,o)}};const Xz={kernelName:fs,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:n,attrs:s}=e,{x:r}=t,{axis:a,exclusive:i,reverse:o}=s;return $z(Gz.Sum,r,n,a,i,o)}};const Zz={kernelName:gs,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:n,attrs:s}=e,{x:r,weights:a}=t,{size:i,binaryOutput:o}=s;if(1===r.shape.length){const e=n.readSync(r.dataId),t=n.readSync(a.dataId),s=jD(e,t,a.dtype,a.shape,i);return n.makeTensorInfo([i],a.dtype,s)}if(2===r.shape.length){const e=n.bufferSync(r),t=n.bufferSync(a),s=HD(e,t,i,o);return n.makeTensorInfo(s.shape,a.dtype,s.values)}throw new Error(`Error in denseBincount: input must be at most rank 2, but got rank${r.shape.length}.`)}};class Yz{constructor(e,t,n){this.variableNames=["x"],this.outputShape=[],this.outputShape=e,this.blockSize=t,this.dataFormat=n,this.userCode=`\n void main() {\n ivec4 coords = getOutputCoords();\n int b = coords[0];\n int h = ${this.getHeightCoordString()};\n int w = ${this.getWidthCoordString()};\n int d = ${this.getDepthCoordString()};\n\n int in_h = h / ${t};\n int offset_h = imod(h, ${t});\n int in_w = w / ${t};\n int offset_w = imod(w, ${t});\n int offset_d = (offset_h * ${t} + offset_w) *\n ${this.getOutputDepthSize()};\n int in_d = d + offset_d;\n\n float result = ${this.getInputSamplingString()};\n setOutput(result);\n }\n `}getHeightCoordString(){return"NHWC"===this.dataFormat?"coords[1]":"coords[2]"}getWidthCoordString(){return"NHWC"===this.dataFormat?"coords[2]":"coords[3]"}getDepthCoordString(){return"NHWC"===this.dataFormat?"coords[3]":"coords[1]"}getOutputDepthSize(){return"NHWC"===this.dataFormat?this.outputShape[3]:this.outputShape[1]}getInputSamplingString(){return"NHWC"===this.dataFormat?"getX(b, in_h, in_w, in_d)":"getX(b, in_d, in_h, in_w)"}}const Qz={kernelName:ys,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:n,attrs:s}=e,{x:r}=t,{blockSize:a,dataFormat:i}=s,o=r.shape[0],l=("NHWC"===i?r.shape[1]:r.shape[2])*a,u=("NHWC"===i?r.shape[2]:r.shape[3])*a,c=("NHWC"===i?r.shape[3]:r.shape[1])/(a*a),h=new Yz("NHWC"===i?[o,l,u,c]:[o,c,l,u],a,i);return n.runWebGLProgram(h,[r],r.dtype)}};class Jz{constructor(e,t=!1,n=null,s=!1,r=!1){this.variableNames=["x","W"],this.customUniforms=[{name:"pads",type:"ivec2"},{name:"strides",type:"ivec2"},{name:"dilations",type:"ivec2"},{name:"inDims",type:"ivec2"}],this.outputShape=e.outShape,this.enableShapeUniforms=SD(this.outputShape.length);const a=e.filterHeight,i=e.filterWidth,o=e.outChannels/e.inChannels;let l="",u="";n&&(l=s?`float activation(float a) {\n float b = getPreluActivationWeightsAtOutCoords();\n ${n}\n }`:r?`float activation(float a) {\n float b = getLeakyreluAlphaAtOutCoords();\n ${n}\n }`:`\n float activation(float x) {\n ${n}\n }\n `,u="result = activation(result);");const c=t?"result += getBiasAtOutCoords();":"";t&&this.variableNames.push("bias"),s&&this.variableNames.push("preluActivationWeights"),r&&this.variableNames.push("leakyreluAlpha"),this.userCode=`\n ${l}\n\n void main() {\n ivec4 coords = getOutputCoords();\n int batch = coords.x;\n ivec2 xRCCorner = coords.yz * strides - pads;\n int d2 = coords.w;\n int d1 = d2 / ${o};\n int q = d2 - d1 * ${o};\n\n int xRCorner = xRCCorner.x;\n int xCCorner = xRCCorner.y;\n\n // Convolve x(?, ?, d1) with w(:, :, d1, q) to get y(yR, yC, d2).\n // ? = to be determined. : = across all values in that axis.\n float dotProd = 0.0;\n // TO DO(dsmilkov): Flatten the two for loops and vec4 the operations.\n for (int wR = 0; wR < ${a}; wR++) {\n int xR = xRCorner + wR * dilations[0];\n\n if (xR < 0 || xR >= inDims[0]) {\n continue;\n }\n\n for (int wC = 0; wC < ${i}; wC++) {\n int xC = xCCorner + wC * dilations[1];\n\n if (xC < 0 || xC >= inDims[1]) {\n continue;\n }\n\n float xVal = getX(batch, xR, xC, d1);\n float wVal = getW(wR, wC, d1, q);\n dotProd += xVal * wVal;\n }\n }\n\n float result = dotProd;\n ${c}\n ${u}\n setOutput(result);\n }\n `}}class eL{constructor(e,t=!1,n=null,s=!1,r=!1){this.variableNames=["x","W"],this.packedInputs=!0,this.packedOutput=!0,this.customUniforms=[{name:"pads",type:"ivec2"},{name:"strides",type:"ivec2"},{name:"dilations",type:"ivec2"},{name:"inDims",type:"ivec2"}],this.outputShape=e.outShape,this.enableShapeUniforms=SD(this.outputShape.length);const a=e.outChannels/e.inChannels,i=e.padInfo.left,o=e.strideWidth,l=e.dilationWidth,u=e.filterHeight,c=e.filterWidth,h=c;let d="\n int xR; int xC; int xCOffset;\n vec4 wTexel; vec4 previous; vec4 final;";for(let e=0;e=0 && xR < inDims[0]) {\n ";for(let e=0;e<(h+1)/2;e++){const t=2*e;if(d+=`\n xC = xCCorner + ${t*l};\n `,1===o){if(t= 0 && xCOffset < inDims[1] && xTexelC${t}Ready == 0) {\n xTexelC${t} = getX(batch, xR, xCOffset, d1);\n\n // Need to manually clear unused channels in case\n // we're reading from recycled texture.\n if (xCOffset + 1 >= inDims[1]) {\n xTexelC${t}.zw = vec2(0.0);\n }\n xTexelC${t}Ready = 1;\n }\n `,d+=1===l&&t>0?`\n xC${t} = vec4(xTexelC${t-2}.zw, xTexelC${t}.xy);\n `:`\n xCOffset = xC + 1 - 2;\n\n if (xCOffset >= 0 && xCOffset < inDims[1]) {\n previous = getX(batch, xR, xCOffset, d1);\n\n // Need to manually clear unused channels in case\n // we're reading from recycled texture.\n if (xCOffset + 1 >= inDims[1]) {\n previous.zw = vec2(0.0);\n }\n\n xC${t} = vec4(previous.zw, xTexelC${t}.xy);\n } else {\n xC${t} = vec4(0.0, 0.0, xTexelC${t}.xy);\n }\n `):d+=`\n if (xC >= 0 && xC < inDims[1] && xTexelC${t}Ready == 0) {\n xTexelC${t} = getX(batch, xR, xC, d1);\n if (xC + 1 >= inDims[1]) {\n xTexelC${t}.zw = vec2(0.0);\n }\n xTexelC${t}Ready = 1;\n }\n\n xC${t} = xTexelC${t};\n `,t+1= 0 && xCOffset < inDims[1] && xTexelC${t+1}Ready == 0) {\n xTexelC${t+1} = getX(batch, xR, xCOffset, d1);\n\n // Need to manually clear unused channels in case\n // we're reading from recycled texture.\n if (xCOffset + 1 >= inDims[1]) {\n xTexelC${t+1}.zw = vec2(0.0);\n }\n xTexelC${t+1}Ready = 1;\n }\n `,d+=l>1?`\n xCOffset -= 2;\n if (xCOffset >= 0 && xCOffset < inDims[1]) {\n previous = getX(batch, xR, xCOffset, d1);\n xC${t+1} = vec4(previous.zw, xTexelC${t+1}.xy);\n } else {\n xC${t+1} = vec4(0.0, 0.0, xTexelC${t+1}.xy);\n }\n `:`\n xC${t+1} = vec4(xTexelC${t}.zw, xTexelC${t+1}.xy);\n `):d+=1===e?`\n xC${t+1} = xTexelC${t};\n `:`\n xCOffset = xC + ${e};\n\n if (xCOffset >= 0 && xCOffset < inDims[1] && xTexelC${t+1}Ready == 0) {\n xTexelC${t+1} = getX(batch, xR, xCOffset, d1);\n if (xCOffset + 1 >= inDims[1]) {\n xTexelC${t+1}.zw = vec2(0.0);\n }\n xTexelC${t+1}Ready = 1;\n }\n\n xC${t+1} = xTexelC${t+1};\n `}}else t= 0 && xCOffset < inDims[1] && xTexelC${t}Ready == 0) {\n xTexelC${t} = getX(batch, xR, xCOffset, d1);\n // Need to manually clear unused channels in case\n // we're reading from recycled texture.\n if (xCOffset + 1 >= inDims[1]) {\n xTexelC${t}.zw = vec2(0.0);\n }\n xTexelC${t}Ready = 1;\n }\n\n if(xC + 1 >= 0 && xC + 1 < inDims[1] && xTexelC${t+1}Ready == 0) {\n xTexelC${t+1} = getX(batch, xR, xC + 1, d1);\n // Need to manually clear unused channels in case\n // we're reading from recycled texture.\n if (xC + 2 >= inDims[1]) {\n xTexelC${t+1}.zw = vec2(0.0);\n }\n xTexelC${t+1}Ready = 1;\n }\n\n xC${t} = vec4(xTexelC${t}.zw, xTexelC${t+1}.zw);\n `,t+1= 0 && xCOffset < inDims[1]) {\n final = getX(batch, xR, xCOffset, d1);\n }\n xC${t+1} = vec4(xTexelC${t+1}.xy, final.xy);\n `)):(d+=`\n if(xC >= 0 && xC < inDims[1] && xTexelC${t}Ready == 0) {\n xTexelC${t} = getX(batch, xR, xC, d1);\n if (xC + 1 >= inDims[1]) {\n xTexelC${t}.zw = vec2(0.0);\n }\n xTexelC${t}Ready = 1;\n }\n\n xCOffset = xC + strides[1];\n if(xCOffset >= 0 && xCOffset < inDims[1] && xTexelC${t+1}Ready == 0) {\n xTexelC${t+1} = getX(batch, xR, xCOffset, d1);\n if (xCOffset + 1 >= inDims[1]) {\n xTexelC${t+1}.zw = vec2(0.);\n }\n xTexelC${t+1}Ready = 1;\n }\n\n xC${t} = vec4(\n xTexelC${t}.xy, xTexelC${t+1}.xy);\n `,t+1`Error in depthwiseConv2d: Either strides or dilations must be 1. Got strides ${i} and dilations '${c}'`));const h=yc(r.shape,a.shape,i,c,o,u,!0);let d;d=Sn().getBool("WEBGL_PACK_DEPTHWISECONV")&&h.strideWidth<=2&&h.outChannels/h.inChannels==1?new eL(h):new Jz(h);const p=[[h.padInfo.top,h.padInfo.left],[h.strideHeight,h.strideWidth],[h.dilationHeight,h.dilationWidth],[h.inHeight,h.inWidth]];return n.runWebGLProgram(d,[r,a],"float32",p)}};class nL{constructor(e){this.variableNames=["x","dy"],this.outputShape=e.filterShape;const t=e.strideHeight,n=e.strideWidth,s=e.padInfo.top,r=e.padInfo.left,a=e.outChannels/e.inChannels;this.userCode=`\n void main() {\n ivec4 coords = getOutputCoords();\n int wR = coords.x;\n int wC = coords.y;\n int d1 = coords.z;\n int dm = coords.w;\n int d2 = d1 * ${a} + dm;\n\n float dotProd = 0.0;\n\n // TO DO: Vec4 over the batch size\n for (int b = 0; b < ${e.batchSize}; b++) {\n for (int yR = 0; yR < ${e.outHeight}; yR++) {\n int xR = wR + yR * ${t} - ${s};\n\n if (xR < 0 || xR >= ${e.inHeight}) {\n continue;\n }\n\n for (int yC = 0; yC < ${e.outWidth}; yC++) {\n int xC = wC + yC * ${n} - ${r};\n\n if (xC < 0 || xC >= ${e.inWidth}) {\n continue;\n }\n\n float dyValue = getDy(b, yR, yC, d2);\n float xValue = getX(b, xR, xC, d1);\n dotProd += (xValue * dyValue);\n }\n }\n }\n setOutput(dotProd);\n }\n `}}class sL{constructor(e){this.variableNames=["dy","W"],this.outputShape=e.inShape;const t=e.filterHeight,n=e.filterWidth,s=e.strideHeight,r=e.strideWidth,a=t-1-e.padInfo.top,i=n-1-e.padInfo.left,o=e.outChannels/e.inChannels;this.userCode=`\n const ivec2 pads = ivec2(${a}, ${i});\n\n void main() {\n ivec4 coords = getOutputCoords();\n int batch = coords[0];\n int d1 = coords[3];\n ivec2 dyCorner = coords.yz - pads;\n int dyRCorner = dyCorner.x;\n int dyCCorner = dyCorner.y;\n\n float dotProd = 0.0;\n\n for (int wR = 0; wR < ${t}; wR++) {\n float dyR = float(dyRCorner + wR) / ${s}.0;\n\n if (dyR < 0.0 || dyR >= ${e.outHeight}.0 || fract(dyR) > 0.0) {\n continue;\n }\n int idyR = int(dyR);\n\n int wRPerm = ${t} - 1 - wR;\n\n for (int wC = 0; wC < ${n}; wC++) {\n float dyC = float(dyCCorner + wC) / ${r}.0;\n\n if (dyC < 0.0 || dyC >= ${e.outWidth}.0 ||\n fract(dyC) > 0.0) {\n continue;\n }\n int idyC = int(dyC);\n\n int wCPerm = ${n} - 1 - wC;\n\n // TO DO: Vec4 over the channelMul\n for (int dm = 0; dm < ${o}; dm++) {\n int d2 = d1 * ${o} + dm;\n float xValue = getDy(batch, idyR, idyC, d2);\n float wValue = getW(wRPerm, wCPerm, d1, dm);\n dotProd += xValue * wValue;\n }\n }\n }\n setOutput(dotProd);\n }\n `}}const rL={kernelName:ws,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:n,attrs:s}=e,{x:r,dy:a}=t,{strides:i,dilations:o,pad:l,dimRoundingMode:u,filterShape:c}=s,h=yc(r.shape,c,i,o,l,u,!0),d=new nL(h);return n.runWebGLProgram(d,[r,a],"float32")}};const aL={kernelName:vs,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:n,attrs:s}=e,{dy:r,filter:a}=t,{strides:i,dilations:o,pad:l,dimRoundingMode:u,inputShape:c}=s,h=yc(c,a.shape,i,o,l,u,!0),d=new sL(h);return n.runWebGLProgram(d,[r,a],"float32")}};class iL{constructor(e){this.variableNames=["X"],this.outputShape=[e,e],this.userCode="\n void main() {\n ivec2 coords = getOutputCoords();\n float val = coords[0] == coords[1] ? getX(coords[0]) : 0.0;\n setOutput(val);\n }\n "}}const oL={kernelName:xs,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:n}=e,{x:s}=t,r=[...s.shape,...s.shape],a=$t(s.shape),i=zF({inputs:{x:s},backend:n,attrs:{shape:[a]}}),o=new iL(a),l=n.runWebGLProgram(o,[i],i.dtype),u=zF({inputs:{x:l},backend:n,attrs:{shape:r}});return n.disposeIntermediateTensorInfo(i),n.disposeIntermediateTensorInfo(l),u}};class lL{constructor(e){this.variableNames=["x","W"],this.outputShape=e.outShape;const{inHeight:t,inWidth:n,padInfo:s,strideHeight:r,strideWidth:a,filterHeight:i,filterWidth:o,dilationHeight:l,dilationWidth:u}=e,{top:c,left:h}=s;this.userCode=`\n const ivec2 strides = ivec2(${r}, ${a});\n const ivec2 pads = ivec2(${c}, ${h});\n const float neg_infinity = -3.4e38;\n\n void main() {\n ivec4 coords = getOutputCoords();\n int batch = coords.x;\n int d1 = coords.w;\n ivec2 outTopLeftCorner =\n coords.yz * strides - pads;\n int hBeg = outTopLeftCorner.x;\n int wBeg = outTopLeftCorner.y;\n\n float curVal = neg_infinity;\n for (int h = 0; h < ${i}; h++) {\n int hIn = hBeg + h * ${l};\n\n if (hIn >= 0 && hIn < ${t}) {\n for (int w = 0; w < ${o}; w++) {\n int wIn = wBeg + w * ${u};\n\n if (wIn >= 0 && wIn < ${n}) {\n float xVal = getX(batch, hIn, wIn, d1);\n float wVal = getW(h, w, d1);\n\n float val = xVal + wVal;\n if (val > curVal) {\n curVal = val;\n }\n }\n }\n }\n }\n\n float result = curVal;\n setOutput(result);\n }\n `}}const uL={kernelName:As,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:n,attrs:s}=e,{x:r,filter:a}=t,{strides:i,pad:o,dilations:l}=s,u=fc(r.shape,a.shape,i,o,"NHWC",l);let c;const h=new lL(u);c=n.runWebGLProgram(h,[r,a],"float32");const d=zF({inputs:{x:c},backend:n,attrs:{shape:u.outShape}});return n.disposeIntermediateTensorInfo(c),d}};const cL={kernelName:_s,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:n,attrs:s}=e,{equation:r}=s,a=t,{allDims:i,summedDims:o,idDims:l}=lg(r,a.length);cg(i.length,l,a);const{path:u,steps:c}=hg(o,l),h=c.length;let d=null,p=i.length;const f=[];for(let e=0;e=0&&(d=jF({inputs:{x:d},backend:n,attrs:{axis:u[e]-(i.length-p),keepDims:!1}}),f.push(d)),p--)}for(const e of f)e!==d&&n.disposeIntermediateTensorInfo(e);return d}},hL=IF({opSnippet:"return (x >= 0.0) ? x : (exp(x) - 1.0);",packedOpSnippet:"\n vec4 result;\n\n result.r = (x.r >= 0.0) ? x.r : (exp(x.r) - 1.0);\n result.g = (x.g >= 0.0) ? x.g : (exp(x.g) - 1.0);\n result.b = (x.b >= 0.0) ? x.b : (exp(x.b) - 1.0);\n result.a = (x.a >= 0.0) ? x.a : (exp(x.a) - 1.0);\n\n return result;\n"}),dL={kernelName:Is,backendName:"webgl",kernelFunc:hL},pL={kernelName:Ts,backendName:"webgl",kernelFunc:e=>{const{inputs:t,backend:n}=e,{dy:s,y:r}=t,a=Sn().getBool("WEBGL_PACK_BINARY_OPERATIONS")?new gF("\n vec4 bGTEZero = vec4(greaterThanEqual(b, vec4(0.)));\n return (bGTEZero * a) + ((vec4(1.0) - bGTEZero) * (a * (b + vec4(1.0))));\n",s.shape,r.shape):new fF("return (b >= 0.0) ? a : a * (b + 1.0);",s.shape,r.shape);return n.runWebGLProgram(a,[s,r],s.dtype)}},fL=TF({opSnippet:"return float(a == b);",packedOpSnippet:"\n return vec4(equal(a, b));\n",dtype:"bool",cpuKernelImpl:YD}),mL={kernelName:Os,backendName:"webgl",kernelFunc:fL},gL=IF({opSnippet:`\n // Error function is calculated approximately with elementary function.\n // See "Handbook of Mathematical Functions with Formulas,\n // Graphs, and Mathematical Tables", Abramowitz and Stegun.\n float p = ${qm};\n float a1 = ${jm};\n float a2 = ${Hm};\n float a3 = ${$m};\n float a4 = ${Km};\n float a5 = ${Xm};\n\n float sign = sign(x);\n x = abs(x);\n float t = 1.0 / (1.0 + p * x);\n return sign * (1.0 - (((((a5*t + a4)*t) + a3)*t + a2)*t + a1)*t*exp(-x*x));\n`}),yL={kernelName:Ns,backendName:"webgl",kernelFunc:gL},bL=IF({opSnippet:_F+"\n return exp(x);\n",packedOpSnippet:"\n vec4 result = exp(x);\n bvec4 isNaN = isnan(x);\n result.r = isNaN.r ? x.r : result.r;\n result.g = isNaN.g ? x.g : result.g;\n result.b = isNaN.b ? x.b : result.b;\n result.a = isNaN.a ? x.a : result.a;\n\n return result;\n",cpuKernelImpl:QD,dtype:"float32"}),wL={kernelName:Rs,backendName:"webgl",kernelFunc:bL};function vL(e){const{inputs:t,attrs:n,backend:s}=e,{dim:r}=n,{input:a}=t,i=a.shape.length,o=a.shape.slice();let l=r;return r<0&&(qt(-(i+1)<=r,(()=>`Axis must be in the interval [${-(i+1)}, ${i}]`)),l=i+r+1),o.splice(l,0,1),zF({inputs:{x:a},backend:s,attrs:{shape:o}})}const xL={kernelName:Ds,backendName:"webgl",kernelFunc:vL},AL="return exp(x) - 1.0;",kL=IF({opSnippet:AL,packedOpSnippet:AL,cpuKernelImpl:JD}),CL={kernelName:Ms,backendName:"webgl",kernelFunc:kL};class SL{constructor(e,t,n){this.variableNames=["real","imag"];const s=t[1];this.outputShape=t;const r=n?`2.0 * ${Math.PI}`:`-2.0 * ${Math.PI}`,a=n?`${s}.0`:"1.0";let i;if("real"===e)i="return real * expR - imag * expI;";else{if("imag"!==e)throw new Error(`FFT component must be either "real" or "imag", got ${e}.`);i="return real * expI + imag * expR;"}this.userCode=`\n const float exponentMultiplier = ${r};\n\n float unaryOpComplex(float real, float expR, float imag, float expI) {\n ${i}\n }\n\n float mulMatDFT(int batch, int index) {\n float indexRatio = float(index) / float(${s});\n float exponentMultiplierTimesIndexRatio =\n exponentMultiplier * indexRatio;\n\n float result = 0.0;\n\n for (int i = 0; i < ${s}; i++) {\n // x = (-2|2 * PI / N) * index * i;\n float x = exponentMultiplierTimesIndexRatio * float(i);\n float expR = cos(x);\n float expI = sin(x);\n float real = getReal(batch, i);\n float imag = getImag(batch, i);\n\n result +=\n unaryOpComplex(real, expR, imag, expI) / ${a};\n }\n\n return result;\n }\n\n void main() {\n ivec2 coords = getOutputCoords();\n setOutput(mulMatDFT(coords[0], coords[1]));\n }\n `}}function EL(e,t,n){const s=n.texData.get(e.dataId),r=$t(e.shape),a=e.shape[e.shape.length-1],i=zF({inputs:{x:e},backend:n,attrs:{shape:[r/a,a]}}),o=i.shape,l=new SL("real",o,t),u=new SL("imag",o,t),c=[{dataId:s.complexTensorInfos.real.dataId,dtype:s.complexTensorInfos.real.dtype,shape:o},{dataId:s.complexTensorInfos.imag.dataId,dtype:s.complexTensorInfos.imag.dtype,shape:o}],h=n.runWebGLProgram(l,c,"float32"),d=n.runWebGLProgram(u,c,"float32"),p=wF({inputs:{real:h,imag:d},backend:n});n.disposeIntermediateTensorInfo(h),n.disposeIntermediateTensorInfo(d);const f=zF({inputs:{x:p},backend:n,attrs:{shape:e.shape}});return n.disposeIntermediateTensorInfo(i),n.disposeIntermediateTensorInfo(p),f}const _L={kernelName:Fs,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:n}=e,{input:s}=t;return EL(s,!1,n)}};class IL{constructor(e,t){this.outputShape=[],this.customUniforms=[{name:"value",type:"float"}],this.variableNames=["x"],this.outputShape=e,this.userCode="\n void main() {\n // Input can be obtained from uniform value.\n setOutput(value);\n }\n "}}function TL(e){const{backend:t,attrs:n}=e,{shape:s,value:r}=n;let{dtype:a}=n;if(a=a||un(r),"string"===a){const e=sn(a,$t(s));return e.fill(r),t.makeTensorInfo(s,a,e)}{const e=new IL(s,r),n=[[r]];return t.runWebGLProgram(e,[],a,n)}}const NL={kernelName:Bs,backendName:"webgl",kernelFunc:TL};class OL{constructor(e){this.variableNames=["Image"],this.outputShape=[];const t=e[2];this.outputShape=e,this.userCode=`\n void main() {\n ivec4 coords = getOutputCoords();\n int x = coords[2];\n\n int coordX = ${t} - x - 1;\n float outputValue;\n if(coordX >= 0 && coordX < ${t}) {\n outputValue = getImage(coords[0], coords[1], coordX, coords[3]);\n } else {\n outputValue = getImage(coords[0], coords[1], coords[2], coords[3]);\n }\n setOutput(outputValue);\n }\n `}}const RL={kernelName:zs,backendName:"webgl",kernelFunc:({inputs:e,backend:t})=>{const{image:n}=e,s=t,r=new OL(n.shape);return s.runWebGLProgram(r,[n],n.dtype)}},DL="return floor(x);",ML=IF({opSnippet:DL,packedOpSnippet:DL,cpuKernelImpl:eM}),FL={kernelName:Ls,backendName:"webgl",kernelFunc:ML},BL=TF({opSnippet:"\n float s = sign(a) * sign(b);\n int ia = round(a);\n int ib = round(b);\n if (ib != 0) {\n // Windows (D3D) wants guaranteed non-zero int division at compile-time.\n return float(idiv(ia, ib, s));\n } else {\n return NAN;\n }\n",packedOpSnippet:"\n ivec4 ia = round(a);\n ivec4 ib = round(b);\n bvec4 cond = notEqual(ib, ivec4(0));\n ivec4 result = ivec4(0);\n vec4 s = sign(a) * sign(b);\n\n // Windows (D3D) wants guaranteed non-zero int division at compile-time.\n if (cond[0]) {\n result[0] = idiv(ia[0], ib[0], s[0]);\n }\n if (cond[1]) {\n result[1] = idiv(ia[1], ib[1], s[1]);\n }\n if (cond[2]) {\n result[2] = idiv(ia[2], ib[2], s[2]);\n }\n if (cond[3]) {\n result[3] = idiv(ia[3], ib[3], s[3]);\n }\n return vec4(result);\n",dtype:"int32"}),zL={kernelName:Ps,backendName:"webgl",kernelFunc:BL};class LL{constructor(e){this.variableNames=["A"];const t=tD(),[n,s]=e;this.outputShape=e,this.userCode=`\n void main() {\n ivec3 coords = getOutputCoords();\n int texR = coords[0];\n int texC = coords[1];\n int depth = coords[2];\n vec2 uv = (vec2(texC, texR) + halfCR) / vec2(${s}.0, ${n}.0);\n\n vec4 values = ${t.texture2D}(A, uv);\n float value;\n if (depth == 0) {\n value = values.r;\n } else if (depth == 1) {\n value = values.g;\n } else if (depth == 2) {\n value = values.b;\n } else if (depth == 3) {\n value = values.a;\n }\n\n setOutput(floor(value * 255.0 + 0.5));\n }\n `}}class PL{constructor(e){this.variableNames=["A"],this.packedInputs=!1,this.packedOutput=!0;const t=tD(),[n,s]=e;this.outputShape=e,this.userCode=`\n void main() {\n ivec3 coords = getOutputCoords();\n int texR = coords[0];\n int texC = coords[1];\n int depth = coords[2];\n\n vec4 result = vec4(0.);\n\n for(int row=0; row<=1; row++) {\n for(int col=0; col<=1; col++) {\n texC = coords[1] + row;\n depth = coords[2] + col;\n\n vec2 uv = (vec2(texC, texR) + halfCR) /\n vec2(${s}.0, ${n}.0);\n vec4 values = ${t.texture2D}(A, uv);\n float value;\n if (depth == 0) {\n value = values.r;\n } else if (depth == 1) {\n value = values.g;\n } else if (depth == 2) {\n value = values.b;\n } else if (depth == 3) {\n value = values.a;\n }\n\n result[row * 2 + col] = floor(value * 255.0 + 0.5);\n }\n }\n\n ${t.output} = result;\n }\n `}}const VL={kernelName:Ba,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:n,attrs:s}=e;let{pixels:r}=t;const{numChannels:a}=s,i="undefined"!=typeof HTMLVideoElement&&r instanceof HTMLVideoElement,o="undefined"!=typeof HTMLImageElement&&r instanceof HTMLImageElement,[l,u]=i?[r.videoWidth,r.videoHeight]:[r.width,r.height],c=[u,l],h=[u,l,a];if(o||i){const e=Sn().getBool("CANVAS2D_WILL_READ_FREQUENTLY_FOR_GPU");null!=WL&&e===UL||(UL=e,WL=document.createElement("canvas").getContext("2d",{willReadFrequently:UL})),WL.canvas.width=l,WL.canvas.height=u,WL.drawImage(r,0,0,l,u),r=WL.canvas}const d=n.makeTensorInfo(c,"int32");n.texData.get(d.dataId).usage=kR.PIXELS,n.gpgpu.uploadPixelDataToTexture(n.getTexture(d.dataId),r);const p=Sn().getBool("WEBGL_PACK")?new PL(h):new LL(h),f=n.runWebGLProgram(p,[d],"int32");return n.disposeData(d.dataId),f}};let WL,UL=Sn().getBool("CANVAS2D_WILL_READ_FREQUENTLY_FOR_GPU");const GL={kernelName:Pa,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:n,attrs:s}=e,{x:r,filter:a,bias:i,preluActivationWeights:o}=t,{strides:l,pad:u,dataFormat:c,dilations:h,dimRoundingMode:d,activation:p,leakyreluAlpha:f}=s,m=_c(c),g=yc(r.shape,a.shape,l,h,u,d,!1,m);let y;const b=[],w=null!=i,v=null!=o,x="leakyrelu"===p,A=()=>{const e=[r,a],t=(e,t)=>{if("NCHW"===t&&1===e.shape.length&&1!==e.shape[0]){const t=zF({inputs:{x:e},backend:n,attrs:{shape:[e.shape[0],1,1]}});return b.push(t),t}return e};if(w&&e.push(t(i,c)),v&&e.push(t(o,c)),x){const t=n.makeTensorInfo([],"float32",di(f,"float32"));e.push(t),b.push(t)}return e};if(1!==g.filterHeight||1!==g.filterWidth||1!==g.dilationHeight||1!==g.dilationWidth||1!==g.strideHeight||1!==g.strideWidth||"SAME"!==g.padInfo.type&&"VALID"!==g.padInfo.type)if(g.strideWidth<=2&&"channelsLast"===m&&Sn().getBool("WEBGL_EXP_CONV")){const e=p?NF(p,!0):null,t=new xz(g,w,e,v,x),s=[[g.padInfo.top,g.padInfo.left],[g.strideHeight,g.strideWidth],[g.dilationHeight,g.dilationWidth],[g.inHeight,g.inWidth]],r=A();y=n.runWebGLProgram(t,r,"float32",s)}else if(Sn().getBool("WEBGL_CONV_IM2COL"))y=Sz({x:r,filter:a,convInfo:g,backend:n,bias:i,activation:p,preluActivationWeights:o,leakyreluAlpha:f});else{const e=p?NF(p,!1):null,t=new wz(g,w,e,v,x),s=A();y=n.runWebGLProgram(t,s,"float32")}else y=Cz({x:r,filter:a,convInfo:g,backend:n,bias:i,activation:p,preluActivationWeights:o,leakyreluAlpha:f});const k=zF({inputs:{x:y},backend:n,attrs:{shape:g.outShape}});return b.push(y),b.forEach((e=>n.disposeIntermediateTensorInfo(e))),k}};const qL={kernelName:Va,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:n,attrs:s}=e,{x:r,filter:a,bias:i,preluActivationWeights:o}=t,{strides:l,pad:u,dilations:c,dimRoundingMode:h,activation:d,leakyreluAlpha:p}=s,f=[];let m=c;null==m&&(m=[1,1]),qt(Sc(l,m),(()=>`Error in depthwiseConv2d: Either strides or dilations must be 1. Got strides ${l} and dilations '${m}'`));const g=yc(r.shape,a.shape,l,m,u,h,!0),y=Sn().getBool("WEBGL_PACK_DEPTHWISECONV")&&g.strideWidth<=2&&g.outChannels/g.inChannels==1,b=d?NF(d,y):null,w=[r,a],v=null!=i,x=null!=o,A="leakyrelu"===d;if(v&&w.push(i),x&&w.push(o),A){const e=n.makeTensorInfo([],"float32",di(p,"float32"));w.push(e),f.push(e)}let k;k=y?new eL(g,v,b,x,A):new Jz(g,v,b,x,A);const C=[[g.padInfo.top,g.padInfo.left],[g.strideHeight,g.strideWidth],[g.dilationHeight,g.dilationWidth],[g.inHeight,g.inWidth]],S=n.runWebGLProgram(k,w,"float32",C);return f.forEach((e=>n.disposeIntermediateTensorInfo(e))),S}};class jL{constructor(e,t,n,s){this.sliceDim=e,this.strides=t,this.paramsShape=s,this.variableNames=["x","indices"],this.outputShape=n;const r=bD(n.length);let a="\n int index;";for(let e=0;e= ${this.paramsShape[e]};\n flattenIndex += index * ${this.strides[e]};`;this.userCode=`\n void main() {\n ${r} coords = getOutputCoords();\n int flattenIndex = 0;\n bool out_of_bounds = false;\n\n ${a}\n\n setOutput(out_of_bounds ? 0.0 : getX(flattenIndex, coords[1]));\n }\n `}}const HL={kernelName:Us,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:n}=e,{params:s,indices:r}=t,a=r.shape,i=a[a.length-1],o=$t(s.shape),[l,u,c,h]=Wm(s,r),d=zF({inputs:{x:r},backend:n,attrs:{shape:[u,i]}}),p=zF({inputs:{x:s},backend:n,attrs:{shape:[$t(s.shape)/c,c]}});if(n.shouldExecuteOnCPU([s,r])||"string"===s.dtype){const e=n.readSync(r.dataId),t=n.bufferSync(s),a=tM(e,t,s.dtype,u,i,c,h,s.shape,o);return n.makeTensorInfo(l,s.dtype,a.values)}const f=new jL(i,h,[u,c],s.shape),m=n.runWebGLProgram(f,[p,d],p.dtype),g=zF({inputs:{x:m},backend:n,attrs:{shape:l}});return n.disposeIntermediateTensorInfo(d),n.disposeIntermediateTensorInfo(p),n.disposeIntermediateTensorInfo(m),g}};class $L{constructor(e,t){this.variableNames=["A","indices"],this.outputShape=t,this.rank=t.length;const n=bD(this.rank),s=function(e,t){const n=["resRC.x","resRC.y","resRC.z","resRC.w"],s=[];for(let t=0;t= 0) && (index < ${e[2]}) ? 1.0 : 0.0;\n setOutput(inBounds * getA(${s}));\n }\n `}}function KL(e){const{inputs:t,backend:n,attrs:s}=e,{x:r,indices:a}=t,{axis:i,batchDims:o}=s,l=en(i,r.shape)[0];if(Sn().get("DEBUG")){const e=n.readSync(a.dataId),t=r.shape[l];for(let n=0;n=0,(()=>`GatherV2: the index value ${s} is not in [0, ${t-1}]`))}}const u=Tg(r,a,l,o),c=$t(a.shape),h=[],d=zF({inputs:{x:r},backend:n,attrs:{shape:[u.batchSize,u.outerSize,u.dimSize,u.sliceSize]}}),p=zF({inputs:{x:a},backend:n,attrs:{shape:[u.batchSize,c/u.batchSize]}});h.push(d),h.push(p);const f=[u.batchSize,u.outerSize,c/u.batchSize,u.sliceSize];if(n.shouldExecuteOnCPU([r,a])||"string"===r.dtype){const e=n.bufferSync(p),t=n.bufferSync(d),s=nM(t,e,f);return h.forEach((e=>n.disposeIntermediateTensorInfo(e))),n.makeTensorInfo(u.outputShape,s.dtype,s.values)}const m=new $L(d.shape,f),g=n.runWebGLProgram(m,[d,p],d.dtype);h.push(g);const y=zF({inputs:{x:g},backend:n,attrs:{shape:u.outputShape}});return h.forEach((e=>n.disposeIntermediateTensorInfo(e))),y}const XL={kernelName:Ws,backendName:"webgl",kernelFunc:KL},ZL=TF({opSnippet:"return float(a > b);",packedOpSnippet:"\n return vec4(greaterThan(a, b));\n",cpuKernelImpl:sM,dtype:"bool"}),YL={kernelName:Gs,backendName:"webgl",kernelFunc:ZL},QL=TF({opSnippet:"return float(a >= b);",packedOpSnippet:"\n return vec4(greaterThanEqual(a, b));\n",dtype:"bool",cpuKernelImpl:rM}),JL={kernelName:qs,backendName:"webgl",kernelFunc:QL};const eP={kernelName:Hs,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:n}=e,{input:s}=t;return EL(s,!0,n)}},tP=IF({opSnippet:"return float(!isnan(x) && !isinf(x));",dtype:"bool"}),nP={kernelName:Ks,backendName:"webgl",kernelFunc:tP},sP=IF({opSnippet:"return float(isinf(x));",dtype:"bool"}),rP={kernelName:Xs,backendName:"webgl",kernelFunc:sP},aP=IF({opSnippet:"return float(isnan(x));",dtype:"bool"}),iP={kernelName:Zs,backendName:"webgl",kernelFunc:aP},oP=TF({opSnippet:"return float(a < b);",packedOpSnippet:"\n return vec4(lessThan(a, b));\n",cpuKernelImpl:aM,dtype:"bool"}),lP={kernelName:Qs,backendName:"webgl",kernelFunc:oP},uP=TF({opSnippet:"return float(a <= b);",packedOpSnippet:"\n return vec4(lessThanEqual(a, b));\n",cpuKernelImpl:iM,dtype:"bool"}),cP={kernelName:Js,backendName:"webgl",kernelFunc:uP};const hP={kernelName:er,backendName:"webgl",kernelFunc:function(e){const{backend:t,attrs:n}=e,{start:s,stop:r,num:a}=n,i=oM(s,r,a);return t.makeTensorInfo([i.length],"float32",i)}},dP=IF({opSnippet:_F+"\n return x < 0.0 ? 0./0. : log(x);\n",packedOpSnippet:"\n vec4 result = log(x);\n bvec4 isNaN = isnan(x);\n result.r = isNaN.r ? x.r : (x.r < 0.0 ? 0./0. : result.r);\n result.g = isNaN.g ? x.g : (x.g < 0.0 ? 0./0. : result.g);\n result.b = isNaN.b ? x.b : (x.b < 0.0 ? 0./0. : result.b);\n result.a = isNaN.a ? x.a : (x.a < 0.0 ? 0./0. : result.a);\n return result;\n",cpuKernelImpl:lM}),pP={kernelName:tr,backendName:"webgl",kernelFunc:dP},fP=IF({opSnippet:_F+"\n return log(1.0 + x);\n"}),mP={kernelName:nr,backendName:"webgl",kernelFunc:fP},gP=TF({opSnippet:"return float(a >= 1.0 && b >= 1.0);",packedOpSnippet:"\n return vec4(\n vec4(greaterThanEqual(a, vec4(1.0))) *\n vec4(greaterThanEqual(b, vec4(1.0))));\n",dtype:"bool"}),yP={kernelName:sr,backendName:"webgl",kernelFunc:gP},bP=IF({opSnippet:"return float(!(x >= 1.0));"}),wP={kernelName:rr,backendName:"webgl",kernelFunc:bP},vP=TF({opSnippet:"return float(a >= 1.0 || b >= 1.0);",packedOpSnippet:"\n return min(\n vec4(greaterThanEqual(a, vec4(1.0))) +\n vec4(greaterThanEqual(b, vec4(1.0))),\n vec4(1.0));\n",dtype:"bool"}),xP={kernelName:ar,backendName:"webgl",kernelFunc:vP};class AP{constructor(e,t,n,s,r){this.variableNames=["x"],this.outputShape=[];const a=t,i=e[3]-1;let o;this.outputShape=e;const l=`float(${n}) + float(${s}) * sum`;o=.5===r?`inversesqrt(${l})`:1===r?`1.0/(${l})`:`exp(log(${l}) * float(-${r}));`,this.userCode=`\n void main() {\n ivec4 coords = getOutputCoords();\n int b = coords[0];\n int r = coords[1];\n int c = coords[2];\n int d = coords[3];\n float x = getX(b, r, c, d);\n float sum = 0.0;\n for (int j = -${a}; j <= ${a}; j++) {\n int idx = d + j;\n if (idx >= 0 && idx <= ${i}) {\n float z = getX(b, r, c, idx);\n sum += z * z;\n }\n }\n float val = x * ${o};\n setOutput(val);\n }\n `}}class kP{constructor(e,t,n,s,r){this.variableNames=["x"],this.outputShape=[],this.packedInputs=!0,this.packedOutput=!0;const a=t,i=e[3]-1;let o;this.outputShape=e;const l=`float(${n}) + float(${s}) * sum`;o=.5===r?`inversesqrt(${l})`:1===r?`1.0/(${l})`:`exp(log(${l}) * float(-${r}));`,this.userCode=`\n void main() {\n ivec4 coords = getOutputCoords();\n int b = coords.x;\n int r = coords.y;\n int c = coords.z;\n int d = coords.w;\n\n bool hasNextCol = d < ${this.outputShape[3]};\n bool hasNextRow = c < ${this.outputShape[2]};\n\n vec4 sum = vec4(0.);\n vec4 xFragAtOutputCoords = getX(b, r, c, d);\n\n vec4 xAtOutputCoords = vec4(\n getChannel(xFragAtOutputCoords, vec2(c, d)),\n hasNextCol ?\n getChannel(xFragAtOutputCoords, vec2(c, d + 1)) : 0.0,\n hasNextRow ?\n getChannel(xFragAtOutputCoords , vec2(c + 1, d)) : 0.0,\n (hasNextRow && hasNextCol) ?\n getChannel(xFragAtOutputCoords, vec2(c + 1, d + 1)) : 0.0\n );\n\n int firstChannel = d - ${a};\n vec2 cache = vec2(0.);\n if(firstChannel >= 0){\n vec4 firstChannelFrag = getX(b, r, c, firstChannel);\n cache.x = getChannel(firstChannelFrag, vec2(c, firstChannel));\n if(hasNextRow){\n cache.y = getChannel(firstChannelFrag, vec2(c + 1, firstChannel));\n }\n }\n\n ivec2 depth = ivec2(d, d + 1);\n for (int j = - ${a}; j <= ${a}; j++) {\n ivec2 idx = depth + j;\n bvec2 aboveLowerBound = greaterThanEqual(idx, ivec2(0));\n bvec2 belowUpperBound = lessThanEqual(idx, ivec2(${i}));\n\n bool depthInRange = aboveLowerBound.x && belowUpperBound.x;\n bool depthPlusOneInRange = aboveLowerBound.y && belowUpperBound.y;\n\n if(depthInRange || depthPlusOneInRange){\n vec4 z = vec4(0.);\n vec4 xFragAtCurrentDepth;\n z.xz = cache.xy;\n if(depthPlusOneInRange && hasNextCol){\n xFragAtCurrentDepth = idx.y != d ?\n getX(b, r, c, idx.y) : xFragAtOutputCoords;\n z.y = getChannel(xFragAtCurrentDepth, vec2(c, idx.y));\n if(hasNextRow){\n z.w = getChannel(xFragAtCurrentDepth, vec2(c + 1, idx.y));\n }\n }\n cache.xy = z.yw;\n sum += z * z;\n }\n }\n vec4 result = xAtOutputCoords * ${o};\n setOutput(result);\n }\n `}}const CP={kernelName:ir,backendName:"webgl",kernelFunc:e=>{const{inputs:t,backend:n,attrs:s}=e,{x:r}=t,{depthRadius:a,bias:i,alpha:o,beta:l}=s,u=Sn().getBool("WEBGL_PACK_NORMALIZATION")?new kP(r.shape,a,i,o,l):new AP(r.shape,a,i,o,l);return n.runWebGLProgram(u,[r],r.dtype)}};class SP{constructor(e,t,n,s,r){this.variableNames=["inputImage","outputImage","dy"],this.outputShape=[],this.outputShape=e,this.depth=e[3],this.depthRadius=t,this.bias=n,this.alpha=s,this.beta=r,this.userCode=`\n void main() {\n ivec4 coords = getOutputCoords();\n int b = coords[0];\n int r = coords[1];\n int c = coords[2];\n\n float result = 0.0;\n for (int d = 0; d < ${this.depth}; ++d) {\n int depthBegin = int(max(0.0, float(d - ${t})));\n int depthEnd = int(min(float(${this.depth}),\n float(d + ${t} + 1)));\n\n const int MIN_DEPTH_BEGIN = 0;\n const int MAX_DEPTH_END = ${this.depth};\n\n float norm = 0.0;\n for (int k = MIN_DEPTH_BEGIN; k < MAX_DEPTH_END; ++k) {\n if (k < depthBegin){\n continue;\n }\n else if (k >= depthBegin && k < depthEnd) {\n norm += getInputImage(b, r, c, k) * getInputImage(b, r, c, k);\n }\n else {\n break;\n }\n }\n\n norm = float(${s}) * norm + float(${n});\n\n for(int k = MIN_DEPTH_BEGIN; k < MAX_DEPTH_END; ++k){\n if (k < depthBegin){\n continue;\n }\n else if (k >= depthBegin && k < depthEnd){\n float dyi = -2.0 * float(${s})\n * float(${r})\n * getInputImage(b, r, c, k) * getOutputImage(b, r, c, d)\n / norm;\n if (k == d) {\n dyi += pow(norm, -1.0 * ${r});\n }\n if (k == coords[3]) {\n dyi *= getDy(b, r, c, d);\n result += dyi;\n }\n }\n else {\n break;\n }\n }\n }\n setOutput(result);\n }\n `}}const EP={kernelName:or,backendName:"webgl",kernelFunc:e=>{const{inputs:t,backend:n,attrs:s}=e,{x:r,y:a,dy:i}=t,{depthRadius:o,bias:l,alpha:u,beta:c}=s,h=new SP(r.shape,o,l,u,c);return n.runWebGLProgram(h,[r,a,i],r.dtype)}};function _P(e){const{inputs:t,backend:n,attrs:s}=e,{x:r}=t,{reductionIndices:a,keepDims:i}=s,o=r.shape.length,l=en(a,r.shape);let u=l;const c=Ih(u,o),h=null!=c,d=n.shouldExecuteOnCPU([r]);let p=r;if(h){if(d){const e=n.texData.get(p.dataId).values,t=new Array(o);for(let e=0;e`Error in maxPool: Either strides or dilations must be 1. Got strides ${i} and dilations '1'`));const u=mc(r.shape,a,i,1,o,l);if(1===u.filterWidth&&1===u.filterHeight&&Kt(u.inShape,u.outShape))return yF({inputs:{x:r},backend:n});const c=new TB(u,"max",!1);return n.runWebGLProgram(c,[r],r.dtype)}};const RP={kernelName:dr,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:n,attrs:s}=e,{x:r}=t,{filterSize:a,strides:i,pad:o,dataFormat:l,dimRoundingMode:u}=s,c=gc(r.shape,a,i,[1,1,1],o,u,l),h=new NB(c,"max",!1);return n.runWebGLProgram(h,[r],r.dtype)}};class DP{constructor(e){this.variableNames=["dy","maxPos"],this.outputShape=e.inShape;const t=e.strideHeight,n=e.strideWidth,s=e.dilationHeight,r=e.effectiveFilterHeight,a=e.effectiveFilterWidth,i=r-1-e.padInfo.top,o=a-1-e.padInfo.left,l=r*a-1;this.userCode=`\n const ivec2 pads = ivec2(${i}, ${o});\n\n void main() {\n ivec4 coords = getOutputCoords();\n int b = coords[0];\n int d = coords[3];\n\n ivec2 dyRCCorner = coords.yz - pads;\n int dyRCorner = dyRCCorner.x;\n int dyCCorner = dyRCCorner.y;\n\n // Convolve dy(?, ?, d) with pos mask(:, :, d) to get dx(xR, xC, d).\n // ? = to be determined. : = across all values in that axis.\n float dotProd = 0.0;\n for (int wR = 0; wR < ${r};\n wR += ${s}) {\n float dyR = float(dyRCorner + wR) / ${t}.0;\n\n if (dyR < 0.0 || dyR >= ${e.outHeight}.0 || fract(dyR) > 0.0) {\n continue;\n }\n int idyR = int(dyR);\n\n for (int wC = 0; wC < ${a}; wC++) {\n float dyC = float(dyCCorner + wC) / ${n}.0;\n\n if (dyC < 0.0 || dyC >= ${e.outWidth}.0 ||\n fract(dyC) > 0.0) {\n continue;\n }\n int idyC = int(dyC);\n\n float dyValue = getDy(b, idyR, idyC, d);\n int maxPosValue = ${l} - int(getMaxPos(b, idyR, idyC, d));\n\n // Get the current value, check it against the value from the\n // position matrix.\n int curPosValue = wR * ${a} + wC;\n float mask = float(maxPosValue == curPosValue ? 1.0 : 0.0);\n\n dotProd += dyValue * mask;\n }\n }\n setOutput(dotProd);\n }\n `}}class MP{constructor(e){this.variableNames=["dy","maxPos"],this.outputShape=e.inShape;const t=e.strideDepth,n=e.strideHeight,s=e.strideWidth,r=e.dilationDepth,a=e.dilationHeight,i=e.dilationWidth,o=e.effectiveFilterDepth,l=e.effectiveFilterHeight,u=e.effectiveFilterWidth,c=o-1-e.padInfo.front,h=l-1-e.padInfo.top,d=u-1-e.padInfo.left,p=o*l*u-1;this.userCode=`\n const ivec3 pads = ivec3(${c}, ${h}, ${d});\n\n void main() {\n ivec5 coords = getOutputCoords();\n int batch = coords.x;\n int ch = coords.u;\n\n ivec3 dyCorner = ivec3(coords.y, coords.z, coords.w) - pads;\n int dyDCorner = dyCorner.x;\n int dyRCorner = dyCorner.y;\n int dyCCorner = dyCorner.z;\n\n // Convolve dy(?, ?, ?, ch) with pos mask(:, :, :, d) to get\n // dx(xD, xR, xC, ch).\n // ? = to be determined. : = across all values in that axis.\n float dotProd = 0.0;\n\n for (int wD = 0; wD < ${o};\n wD += ${r}) {\n float dyD = float(dyDCorner + wD) / ${t}.0;\n\n if (dyD < 0.0 || dyD >= ${e.outDepth}.0 || fract(dyD) > 0.0) {\n continue;\n }\n int idyD = int(dyD);\n\n for (int wR = 0; wR < ${l};\n wR += ${a}) {\n float dyR = float(dyRCorner + wR) / ${n}.0;\n\n if (dyR < 0.0 || dyR >= ${e.outHeight}.0 ||\n fract(dyR) > 0.0) {\n continue;\n }\n int idyR = int(dyR);\n\n for (int wC = 0; wC < ${u};\n wC += ${i}) {\n float dyC = float(dyCCorner + wC) / ${s}.0;\n\n if (dyC < 0.0 || dyC >= ${e.outWidth}.0 ||\n fract(dyC) > 0.0) {\n continue;\n }\n int idyC = int(dyC);\n\n float dyValue = getDy(batch, idyD, idyR, idyC, ch);\n int maxPosValue = ${p} -\n int(getMaxPos(batch, idyD, idyR, idyC, ch));\n\n // Get the current value, check it against the value from the\n // position matrix.\n int curPosValue =\n wD * ${l} * ${u} +\n wR * ${u} + wC;\n float mask = float(maxPosValue == curPosValue ? 1.0 : 0.0);\n\n dotProd += dyValue * mask;\n }\n }\n }\n setOutput(dotProd);\n }\n `}}const FP={kernelName:pr,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:n,attrs:s}=e,{dy:r,input:a}=t,i=a,{filterSize:o,strides:l,pad:u,dimRoundingMode:c}=s,h=gc(i.shape,o,l,[1,1,1],u,c),d=new NB(h,"max",!0),p=n.runWebGLProgram(d,[i],i.dtype),f=new MP(h),m=n.runWebGLProgram(f,[r,p],i.dtype);return n.disposeIntermediateTensorInfo(p),m}};const BP={kernelName:hr,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:n,attrs:s}=e,{dy:r,input:a,output:i}=t,o=a;JR([a,i],"maxPoolGrad");const{filterSize:l,strides:u,pad:c,dimRoundingMode:h}=s,d=mc(o.shape,l,u,1,c,h),p=new TB(d,"max",!0),f=n.runWebGLProgram(p,[o],o.dtype),m=new DP(d),g=n.runWebGLProgram(m,[r,f],o.dtype);return n.disposeIntermediateTensorInfo(f),g}};const zP={kernelName:fr,backendName:"webgl",kernelFunc:({inputs:e,attrs:t,backend:n})=>{const{x:s}=e,{filterSize:r,strides:a,pad:i,includeBatchInIndex:o}=t,l=n;qt(4===s.shape.length,(()=>`Error in maxPool: input must be rank 4 but got rank ${s.shape.length}.`));const u=[1,1];qt(Sc(a,u),(()=>`Error in maxPool: Either strides or dilations must be 1. Got strides ${a} and dilations '${u}'`));const c=mc(s.shape,r,a,u,i),[h,d]=function(e,t,n,s){let r=new TB(n,"max",!1);const a=s.runWebGLProgram(r,[e],"float32");return r=new TB(n,"max",!0,!0,t),[a,s.runWebGLProgram(r,[e],"float32")]}(s,o,c,l);return[h,d]}};const LP={kernelName:mr,backendName:"webgl",kernelFunc:({inputs:e,attrs:t,backend:n})=>{const{x:s}=e,{keepDims:r,axis:a}=t,i=n,o=s.shape.length,l=en(a,s.shape);let u=l;const c=Ih(u,o),h=null!=c,d=i.shouldExecuteOnCPU([s]),p=[];let f=s;if(h){if(d){const e=i.texData.get(f.dataId).values,t=new Array(o);for(let e=0;et[0]+e[n]+t[1]));const s=e.length,r=bD(s),a=t.map((e=>e[0])).join(","),i=t.map(((t,n)=>t[0]+e[n])).join(","),o=["coords[0]","coords[1]","coords[2]","coords[3]"].slice(0,s),l="reflect"===n?0:1;this.userCode=1!==s?`\n ${r} start = ${r}(${a});\n ${r} end = ${r}(${i});\n\n void main() {\n ${r} outC = getOutputCoords();\n for (int i = 0; i < ${s}; i++) {\n if (outC[i] < start[i]) {\n outC[i] = start[i] * 2 - outC[i] - ${l};\n } else if(outC[i] >= end[i]) {\n outC[i] = (end[i] - 1) * 2 - outC[i] + ${l};\n }\n }\n ${r} coords = outC - start;\n setOutput(getX(${o}));\n }\n `:`\n int start = ${a};\n int end = ${i};\n\n void main() {\n int outC = getOutputCoords();\n if (outC < start) {\n outC = start * 2 - outC - ${l};\n } else if(outC >= end) {\n outC = (end - 1) * 2 - outC + ${l};\n }\n setOutput(getX(outC - start));\n }\n `}}class GP{constructor(e,t,n){this.variableNames=["x"],this.packedInputs=!0,this.packedOutput=!0,this.outputShape=t.map(((t,n)=>t[0]+e[n]+t[1]));const s=e.length,r=bD(s),a=t.map((e=>e[0])).join(","),i=t.map(((t,n)=>t[0]+e[n])).join(","),o=VM("rc",s),l=VM("source",s),u=`${o[s-1]} < ${this.outputShape[s-1]}`,c=1===s?"source":`vec2(${l.slice(-2).join()})`,h="reflect"===n?0:1;let d="";if(1===s){const e=`\n ${r} source = rc;\n if (source < start) {\n source = start * 2 - source - ${h};\n } else if (source >= end) {\n source = (end - 1) * 2 - source + ${h};\n }\n source -= start;\n `;d=`\n ${r} rc = outputLoc;\n ${e}\n result[0] = getChannel(getX(${l.join()}), ${c});\n ${o[s-1]} += 1;\n if(${u}) {\n ${e}\n result[1] = getChannel(getX(${l.join()}), ${c});\n }\n `}else{const e=`\n ${r} source = rc;\n ${r} lt = ${r}(lessThan(source, start));\n ${r} gte = ${r}(greaterThanEqual(source, end));\n ${r} orig = 1 - (lt + gte);\n source = orig * source +\n lt * (start * 2 - source - ${h}) +\n gte * ((end - 1) * 2 - source + ${h});\n source -= start;\n `;d=`\n ${r} rc = outputLoc;\n ${e}\n result[0] = getChannel(getX(${l.join()}), ${c});\n ${o[s-1]} += 1;\n if(${u}) {\n ${e}\n result[1] = getChannel(getX(${l.join()}), ${c});\n }\n rc = outputLoc;\n ${o[s-2]} += 1;\n if(${o[s-2]} < ${this.outputShape[s-2]}) {\n ${e}\n result[2] = getChannel(getX(${l.join()}), ${c});\n ${o[s-1]} += 1;\n if(${u}) {\n ${e}\n result[3] = getChannel(getX(${l.join()}), ${c});\n }\n }\n `}this.userCode=`\n const ${r} start = ${r}(${a});\n const ${r} end = ${r}(${i});\n\n void main() {\n ${r} outputLoc = getOutputCoords();\n vec4 result = vec4(0.);\n ${d}\n setOutput(result);\n }\n `}}const qP={kernelName:br,backendName:"webgl",kernelFunc:({inputs:e,backend:t,attrs:n})=>{const{x:s}=e,{paddings:r,mode:a}=n,i=Sn().getBool("WEBGL_PACK_ARRAY_OPERATIONS")?new GP(s.shape,r,a):new UP(s.shape,r,a);return t.runWebGLProgram(i,[s],s.dtype)}},jP=TF({opSnippet:"if (b == 0.0) return NAN;\n return mod(a, b);",packedOpSnippet:"\n vec4 result = mod(a, b);\n bvec4 isNaN = equal(b, vec4(0.0));\n "+mF+"\n return result;\n"}),HP={kernelName:wr,backendName:"webgl",kernelFunc:jP};class $P{constructor(e,t,n){this.variableNames=["probs"],this.customUniforms=[{name:"seed",type:"float"}],this.outputShape=[e,n],this.userCode=`\n void main() {\n ivec2 coords = getOutputCoords();\n int batch = coords[0];\n\n float r = random(seed);\n float cdf = 0.0;\n\n for (int i = 0; i < ${t-1}; i++) {\n cdf += getProbs(batch, i);\n\n if (r < cdf) {\n setOutput(float(i));\n return;\n }\n }\n\n // If no other event happened, last event happened.\n setOutput(float(${t-1}));\n }\n `}}const KP=TF({opSnippet:"\nif (a == b) {\n return 1.0;\n};\nreturn a / b;",packedOpSnippet:"\n // vec4 one = vec4(equal(a, b));\n // return one + (vec4(1.0) - one) * a / b;\n vec4 result = a / b;\n if(a.x == b.x) {\n result.x = 1.;\n }\n if(a.y == b.y) {\n result.y = 1.;\n }\n if(a.z == b.z) {\n result.z = 1.;\n }\n if(a.w == b.w) {\n result.w = 1.;\n }\n\n return result;\n",checkOutOfBounds:!0}),XP={kernelName:Es,backendName:"webgl",kernelFunc:KP},ZP="return a - b;",YP=TF({opSnippet:ZP,packedOpSnippet:ZP,supportsComplex:!0,cpuKernelImpl:MM}),QP={kernelName:Ca,backendName:"webgl",kernelFunc:YP};function JP(e){const{inputs:t,backend:n,attrs:s}=e,{logits:r}=t,{dim:a}=s,i=en([a],r.shape),o=_P({inputs:{x:r},backend:n,attrs:{reductionIndices:i,keepDims:!1}}),l=Eh(o.shape,i),u=zF({inputs:{x:o},backend:n,attrs:{shape:l}}),c=YP({inputs:{a:r,b:u},backend:n}),h=bL({inputs:{x:c},backend:n}),d=jF({inputs:{x:h},backend:n,attrs:{axis:i,keepDims:!1}}),p=zF({inputs:{x:d},backend:n,attrs:{shape:l}}),f=KP({inputs:{a:h,b:p},backend:n});return n.disposeIntermediateTensorInfo(o),n.disposeIntermediateTensorInfo(u),n.disposeIntermediateTensorInfo(c),n.disposeIntermediateTensorInfo(h),n.disposeIntermediateTensorInfo(d),n.disposeIntermediateTensorInfo(p),f}const eV={kernelName:ha,backendName:"webgl",kernelFunc:JP};const tV={kernelName:vr,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:n,attrs:s}=e,{logits:r}=t,{numSamples:a,seed:i,normalized:o}=s,l=o?r:JP({inputs:{logits:r},backend:n,attrs:{dim:r.shape.length-1}}),u=l.shape[0],c=l.shape[1],h=new $P(u,c,a),d=[[i]],p=n.runWebGLProgram(h,[l],"int32",d);return o||n.disposeIntermediateTensorInfo(l),p}},nV=KM+"\n return -x;\n";const sV={kernelName:Ar,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:n}=e,{x:s}=t;if(n.shouldExecuteOnCPU([s])){const e=n.texData.get(s.dataId),[t,r]=pM(e.values,s.shape,s.dtype);return n.makeTensorInfo(r,s.dtype,t)}let r;return r=Sn().getBool("WEBGL_PACK_UNARY_OPERATIONS")?new oF(s.shape,"\n vec4 result = -x;\n bvec4 isNaN = isnan(x);\n\n result.r = isNaN.r ? x.r : result.r;\n result.g = isNaN.g ? x.g : result.g;\n result.b = isNaN.b ? x.b : result.b;\n result.a = isNaN.a ? x.a : result.a;\n\n return result;\n"):new $M(s.shape,nV),n.runWebGLProgram(r,[s],s.dtype)}},rV=Rf;const aV={kernelName:Cr,backendName:"webgl",kernelFunc:function(e){Wa();const{inputs:t,backend:n,attrs:s}=e,{boxes:r,scores:a}=t,{maxOutputSize:i,iouThreshold:o,scoreThreshold:l}=s,u=n.readSync(r.dataId),c=n.readSync(a.dataId),{selectedIndices:h}=rV(u,c,i,o,l);return n.makeTensorInfo([h.length],"int32",new Int32Array(h))}},iV=Df;const oV={kernelName:Sr,backendName:"webgl",kernelFunc:function(e){Wa();const{inputs:t,backend:n,attrs:s}=e,{boxes:r,scores:a}=t,{maxOutputSize:i,iouThreshold:o,scoreThreshold:l,padToMaxOutputSize:u}=s,c=n.readSync(r.dataId),h=n.readSync(a.dataId),{selectedIndices:d,validOutputs:p}=iV(c,h,i,o,l,u);return[n.makeTensorInfo([d.length],"int32",new Int32Array(d)),n.makeTensorInfo([],"int32",new Int32Array([p]))]}},lV=Mf;const uV={kernelName:Er,backendName:"webgl",kernelFunc:function(e){Wa();const{inputs:t,backend:n,attrs:s}=e,{boxes:r,scores:a}=t,{maxOutputSize:i,iouThreshold:o,scoreThreshold:l,softNmsSigma:u}=s,c=n.readSync(r.dataId),h=n.readSync(a.dataId),d=i,p=o,f=l,m=u,{selectedIndices:g,selectedScores:y}=lV(c,h,d,p,f,m);return[n.makeTensorInfo([g.length],"int32",new Int32Array(g)),n.makeTensorInfo([y.length],"float32",new Float32Array(y))]}};class cV{constructor(e,t,n,s){this.variableNames=["indices"],this.outputShape=[e,t],this.userCode=`\n void main() {\n ivec2 coords = getOutputCoords();\n int index = round(getIndices(coords.x));\n setOutput(mix(float(${s}), float(${n}),\n float(index == coords.y)));\n }\n `}}const hV={kernelName:Ir,backendName:"webgl",kernelFunc:e=>{const{inputs:t,backend:n,attrs:s}=e,{indices:r}=t,{dtype:a,depth:i,onValue:o,offValue:l}=s,u=$t(r.shape),c=new cV(u,i,o,l),h=zF({inputs:{x:r},backend:n,attrs:{shape:[u]}}),d=n.runWebGLProgram(c,[h],a);n.disposeIntermediateTensorInfo(h);const p=zF({inputs:{x:d},backend:n,attrs:{shape:[...r.shape,i]}});return n.disposeIntermediateTensorInfo(d),p}};function dV(e){const{inputs:t,backend:n}=e,{x:s}=t;if("complex64"===s.dtype){const e=QB({inputs:{input:s},backend:n}),t=dV({inputs:{x:e},backend:n}),r=fz({inputs:{input:s},backend:n}),a=dV({inputs:{x:r},backend:n}),i=wF({inputs:{real:t,imag:a},backend:n});return n.disposeIntermediateTensorInfo(e),n.disposeIntermediateTensorInfo(t),n.disposeIntermediateTensorInfo(r),n.disposeIntermediateTensorInfo(a),i}return TL({attrs:{shape:s.shape,dtype:s.dtype,value:"string"===s.dtype?"":0},backend:n})}const pV={kernelName:Ma,backendName:"webgl",kernelFunc:dV};const fV={kernelName:_r,backendName:"webgl",kernelFunc:function e(t){const{inputs:n,backend:s}=t,{x:r}=n;if("string"===r.dtype)throw new Error("onesLike is not supported under string dtype");if("complex64"===r.dtype){const t=QB({inputs:{input:r},backend:s}),n=e({inputs:{x:t},backend:s}),a=fz({inputs:{input:r},backend:s}),i=dV({inputs:{x:a},backend:s}),o=wF({inputs:{real:n,imag:i},backend:s});return s.disposeIntermediateTensorInfo(t),s.disposeIntermediateTensorInfo(n),s.disposeIntermediateTensorInfo(a),s.disposeIntermediateTensorInfo(i),o}return TL({attrs:{shape:r.shape,dtype:r.dtype,value:1},backend:s})}};const mV={kernelName:Tr,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:n,attrs:s}=e,{axis:r}=s;if(1===t.length)return vL({inputs:{input:t[0]},backend:n,attrs:{dim:r}});const a=t[0].shape,i=t[0].dtype;t.forEach((e=>{jt(a,e.shape,"All tensors passed to stack must have matching shapes"),qt(i===e.dtype,(()=>"All tensors passed to stack must have matching dtypes"))}));const o=[],l=yz({inputs:t.map((e=>{const t=vL({inputs:{input:e},backend:n,attrs:{dim:r}});return o.push(t),t})),backend:n,attrs:{axis:r}});return o.forEach((e=>n.disposeIntermediateTensorInfo(e))),l}};class gV{constructor(e,t,n){this.variableNames=["x"],this.customUniforms=[{name:"value",type:"float"}],this.outputShape=t.map(((t,n)=>t[0]+e[n]+t[1]));const s=e.length,r=bD(s),a=t.map((e=>e[0])).join(","),i=t.map(((t,n)=>t[0]+e[n])).join(","),o=["coords[0]","coords[1]","coords[2]","coords[3]"].slice(0,s);this.userCode=1!==s?`\n ${r} start = ${r}(${a});\n ${r} end = ${r}(${i});\n\n void main() {\n ${r} outC = getOutputCoords();\n if (any(lessThan(outC, start)) || any(greaterThanEqual(outC, end))) {\n setOutput(value);\n } else {\n ${r} coords = outC - start;\n setOutput(getX(${o}));\n }\n }\n `:`\n int start = ${a};\n int end = ${i};\n\n void main() {\n int outC = getOutputCoords();\n if (outC < start || outC >= end) {\n setOutput(value);\n } else {\n setOutput(getX(outC - start));\n }\n }\n `}}class yV{constructor(e,t,n){this.variableNames=["x"],this.packedInputs=!0,this.packedOutput=!0,this.customUniforms=[{name:"value",type:"float"}],this.outputShape=t.map(((t,n)=>t[0]+e[n]+t[1]));const s=e.length,r=bD(s),a=t.map((e=>e[0])).join(","),i=t.map(((t,n)=>t[0]+e[n])).join(","),o=VM("rc",s),l=VM("source",s),u=`${o[s-1]} < ${this.outputShape[s-1]}`,c=1===s?"source":`vec2(${l.slice(-2).join()})`,h=[`${r} rc = outputLoc;`,`${o[s-1]} += 1;\n if(${u}) {\n `,1===s?"":`}\n rc = outputLoc;\n ${o[s-2]} += 1;\n if(${o[s-2]} < ${this.outputShape[s-2]}) {`,1===s?"":` ${o[s-1]} += 1;\n if(${u}) {`],d=1===s?"rc < start || rc >= end":"any(lessThan(rc, start)) || any(greaterThanEqual(rc, end))";let p="";for(let e=0,t=1===s?2:4;e{const{inputs:t,backend:n,attrs:s}=e,{x:r}=t,{paddings:a,constantValue:i}=s;if(0===$t(r.shape)){const e=a.map(((e,t)=>e[0]+r.shape[t]+e[1]));return TL({backend:n,attrs:{shape:e,value:i,dtype:r.dtype}})}const o=Sn().getBool("WEBGL_PACK_ARRAY_OPERATIONS")?new yV(r.shape,a,i):new gV(r.shape,a,i),l=[[i]];return n.runWebGLProgram(o,[r],r.dtype,l)},wV={kernelName:Nr,backendName:"webgl",kernelFunc:bV},vV=TF({opSnippet:"\n if(a < 0.0 && floor(b) < b){\n return NAN;\n }\n if (b == 0.0) {\n return 1.0;\n }\n return (round(mod(b, 2.0)) != 1) ?\n pow(abs(a), b) : sign(a) * pow(abs(a), b);\n",packedOpSnippet:"\n // isModRound1 has 1 for components with round(mod(b, 2.0)) == 1, 0 otherwise.\n vec4 isModRound1 = vec4(equal(round(mod(b, 2.0)), ivec4(1)));\n vec4 multiplier = sign(a) * isModRound1 + (vec4(1.0) - isModRound1);\n vec4 result = multiplier * pow(abs(a), b);\n\n // Ensure that a^0 = 1, including 0^0 = 1 as this correspond to TF and JS\n bvec4 isExpZero = equal(b, vec4(0.0));\n result.r = isExpZero.r ? 1.0 : result.r;\n result.g = isExpZero.g ? 1.0 : result.g;\n result.b = isExpZero.b ? 1.0 : result.b;\n result.a = isExpZero.a ? 1.0 : result.a;\n\n bvec4 isNaN1 = lessThan(a, vec4(0.0));\n bvec4 isNaN2 = lessThan(floor(b), b);\n bvec4 isNaN = bvec4(isNaN1.x && isNaN2.x, isNaN1.y && isNaN2.y, isNaN1.z && isNaN2.z, isNaN1.w && isNaN2.w);\n "+mF+"\n return result;\n"}),xV={kernelName:Or,backendName:"webgl",kernelFunc:vV};const AV={kernelName:Dr,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:n,attrs:s}=e,{x:r}=t,{axis:a,keepDims:i}=s,o=r.shape.length,l=[],u=en(a,r.shape);let c=u;const h=Ih(c,o);let d,p=r;if(null!=h&&(p=$F({inputs:{x:r},backend:n,attrs:{perm:h}}),c=Nh(c.length,o),l.push(p)),_h("prod",c,o),n.shouldExecuteOnCPU([p])){const e=n.texData.get(p.dataId).values,{outVals:t,outShape:s,outDtype:r}=mM(p.shape,p.dtype,e,c);d=n.makeTensorInfo(s,r,t)}else{const[e,t]=Sh(p.shape,c),s=$t(t),a=zF({inputs:{x:p},backend:n,attrs:{shape:[-1,s]}}),i=WF(a,qi(r.dtype),"prod",n);d=zF({inputs:{x:i},backend:n,attrs:{shape:e}}),l.push(a),l.push(i)}if(i){l.push(d);const e=Eh(d.shape,u);d=zF({inputs:{x:d},backend:n,attrs:{shape:e}})}return l.forEach((e=>n.disposeIntermediateTensorInfo(e))),d}};const kV={kernelName:Mr,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:n,attrs:s}=e,{paramsNestedSplits:r,paramsDenseValues:a,indices:i}=t,{outputRaggedRank:o}=s,l=r.map((e=>n.readSync(e.dataId))),u=r.map((e=>e.shape)),c=n.readSync(a.dataId),h=n.readSync(i.dataId),[d,p,f]=gM(l,u,c,a.shape,a.dtype,h,i.shape,o),m=d.map((e=>n.makeTensorInfo([e.length],"int32",e))),g=n.makeTensorInfo(f,a.dtype,p);return m.concat([g])}};const CV={kernelName:Fr,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:n}=e,{starts:s,limits:r,deltas:a}=t,i=n.readSync(s.dataId),o=n.readSync(r.dataId),l=n.readSync(a.dataId),[u,c]=yM(i,s.shape,s.dtype,o,r.shape,l,a.shape);return[n.makeTensorInfo([u.length],"int32",u),n.makeTensorInfo([c.length],s.dtype,c)]}};const SV={kernelName:Br,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:n,attrs:s}=e,{shape:r,values:a,defaultValue:i,rowPartitionTensors:o}=t,{rowPartitionTypes:l}=s,u=n.readSync(r.dataId),c=n.readSync(a.dataId),h=n.readSync(i.dataId),d=o.map((e=>n.readSync(e.dataId))),p=o.map((e=>e.shape)),[f,m]=bM(u,r.shape,c,a.shape,a.dtype,h,i.shape,d,p,l);return n.makeTensorInfo(f,a.dtype,m)}},EV=e=>{const{backend:t,attrs:n}=e,{start:s,stop:r,step:a,dtype:i}=n,o=wM(s,r,a,i);return t.makeTensorInfo([o.length],i,o)},_V={kernelName:zr,backendName:"webgl",kernelFunc:EV},IV=IF({opSnippet:"return 1.0 / x;"}),TV={kernelName:Pr,backendName:"webgl",kernelFunc:IV},NV=IF({opSnippet:KM+"\n return (x < 0.0) ? 0.0 : x;\n",packedOpSnippet:"\n vec4 result = x * vec4(greaterThanEqual(x, vec4(0.0)));\n bvec4 isNaN = isnan(x);\n\n result.r = isNaN.r ? x.r : result.r;\n result.g = isNaN.g ? x.g : result.g;\n result.b = isNaN.b ? x.b : result.b;\n result.a = isNaN.a ? x.a : result.a;\n\n return result;\n"}),OV={kernelName:Vr,backendName:"webgl",kernelFunc:NV},RV=IF({opSnippet:KM+"\n return (x < 0.0) ? 0.0 : min(6.0, x);\n",packedOpSnippet:"\n vec4 result = min(x, vec4(6.)) * vec4(greaterThanEqual(x, vec4(0.0)));\n bvec4 isNaN = isnan(x);\n\n result.r = isNaN.r ? x.r : result.r;\n result.g = isNaN.g ? x.g : result.g;\n result.b = isNaN.b ? x.b : result.b;\n result.a = isNaN.a ? x.a : result.a;\n\n return result;\n"}),DV={kernelName:Hr,backendName:"webgl",kernelFunc:RV};class MV{constructor(e,t,n,s,r){this.variableNames=["A"],this.outputShape=[];const[a,i,o,l]=e;this.outputShape=[a,t,n,l];const u=[s&&t>1?i-1:i,s&&n>1?o-1:o],c=[s&&t>1?t-1:t,s&&n>1?n-1:n];let h;h=r?"(vec2(yRC) + vec2(0.5)) * effectiveInputOverOutputRatioRC - vec2(0.5)":"vec2(yRC) * effectiveInputOverOutputRatioRC",this.userCode=`\n const vec2 effectiveInputOverOutputRatioRC = vec2(\n ${u[0]/c[0]},\n ${u[1]/c[1]});\n const vec2 inputShapeRC = vec2(${i}.0, ${o}.0);\n\n void main() {\n ivec4 coords = getOutputCoords();\n int b = coords[0];\n int d = coords[3];\n ivec2 yRC = coords.yz;\n\n // Fractional source index.\n vec2 sourceFracIndexRC = ${h};\n\n // Compute the four integer indices.\n ivec2 sourceFloorRC = ivec2(max(sourceFracIndexRC, vec2(0.0)));\n ivec2 sourceCeilRC = ivec2(\n min(inputShapeRC - 1.0, ceil(sourceFracIndexRC)));\n\n float topLeft = getA(b, sourceFloorRC.x, sourceFloorRC.y, d);\n float bottomLeft = getA(b, sourceCeilRC.x, sourceFloorRC.y, d);\n float topRight = getA(b, sourceFloorRC.x, sourceCeilRC.y, d);\n float bottomRight = getA(b, sourceCeilRC.x, sourceCeilRC.y, d);\n\n vec2 fracRC = sourceFracIndexRC - vec2(sourceFloorRC);\n\n float top = topLeft + (topRight - topLeft) * fracRC.y;\n float bottom = bottomLeft + (bottomRight - bottomLeft) * fracRC.y;\n float newValue = top + (bottom - top) * fracRC.x;\n\n setOutput(newValue);\n }\n `}}class FV{constructor(e,t,n,s,r){this.variableNames=["A"],this.packedInputs=!0,this.packedOutput=!0,this.outputShape=[];const[a,i,o,l]=e;this.outputShape=[a,t,n,l];const u=[s&&t>1?i-1:i,s&&n>1?o-1:o],c=[s&&t>1?t-1:t,s&&n>1?n-1:n];let h;h=r?"(vec3(yRC) + vec3(0.5)) * effectiveInputOverOutputRatioRC - vec3(0.5)":"vec3(yRC) * effectiveInputOverOutputRatioRC",this.userCode=`\n const vec3 effectiveInputOverOutputRatioRC = vec3(\n ${u[0]/c[0]},\n ${u[1]/c[1]},\n ${u[1]/c[1]});\n const vec3 inputShapeRC = vec3(${i}.0, ${o}.0,\n ${o}.0);\n\n float getAValue(int b, int r, int c, int d) {\n return getChannel(getA(b, r, c, d), vec2(c, d));\n }\n\n void main() {\n ivec4 coords = getOutputCoords();\n int b = coords[0];\n int d = coords[3];\n // Calculate values for next column in yRC.z.\n ivec3 yRC = coords.yzz + ivec3(0, 0, 1);\n\n // Fractional source index.\n vec3 sourceFracIndexRC = ${h};\n\n // Compute the four integer indices.\n ivec3 sourceFloorRC = ivec3(max(sourceFracIndexRC, vec3(0.0)));\n ivec3 sourceCeilRC = ivec3(\n min(inputShapeRC - 1.0, ceil(sourceFracIndexRC)));\n\n // Should we calculate next column and row elements in 2x2 packed cell.\n bool hasNextCol = d < ${l-1};\n bool hasNextRow = coords.z < ${n-1};\n\n // In parallel, construct four corners for all four components in\n // packed 2x2 cell.\n vec4 topLeft = vec4(\n getAValue(b, sourceFloorRC.x, sourceFloorRC.y, d),\n hasNextCol ? getAValue(b, sourceFloorRC.x, sourceFloorRC.y, d + 1)\n : 0.0,\n hasNextRow ? getAValue(b, sourceFloorRC.x, sourceFloorRC.z, d)\n : 0.0,\n (hasNextRow && hasNextCol) ?\n getAValue(b, sourceFloorRC.x, sourceFloorRC.z, d + 1) : 0.0);\n\n vec4 bottomLeft = vec4(\n getAValue(b, sourceCeilRC.x, sourceFloorRC.y, d),\n hasNextCol ? getAValue(b, sourceCeilRC.x, sourceFloorRC.y, d + 1)\n : 0.0,\n hasNextRow ? getAValue(b, sourceCeilRC.x, sourceFloorRC.z, d)\n : 0.0,\n (hasNextRow && hasNextCol) ?\n getAValue(b, sourceCeilRC.x, sourceFloorRC.z, d + 1) : 0.0);\n\n vec4 topRight = vec4(\n getAValue(b, sourceFloorRC.x, sourceCeilRC.y, d),\n hasNextCol ? getAValue(b, sourceFloorRC.x, sourceCeilRC.y, d + 1)\n : 0.0,\n hasNextRow ? getAValue(b, sourceFloorRC.x, sourceCeilRC.z, d)\n : 0.0,\n (hasNextRow && hasNextCol) ?\n getAValue(b, sourceFloorRC.x, sourceCeilRC.z, d + 1) : 0.0);\n\n vec4 bottomRight = vec4(\n getAValue(b, sourceCeilRC.x, sourceCeilRC.y, d),\n hasNextCol ? getAValue(b, sourceCeilRC.x, sourceCeilRC.y, d + 1)\n : 0.0,\n hasNextRow ? getAValue(b, sourceCeilRC.x, sourceCeilRC.z, d)\n : 0.0,\n (hasNextRow && hasNextCol) ?\n getAValue(b, sourceCeilRC.x, sourceCeilRC.z, d + 1) : 0.0);\n\n vec3 fracRC = sourceFracIndexRC - vec3(sourceFloorRC);\n\n vec4 top = mix(topLeft, topRight, fracRC.yyzz);\n vec4 bottom = mix(bottomLeft, bottomRight, fracRC.yyzz);\n vec4 newValue = mix(top, bottom, fracRC.x);\n\n setOutput(newValue);\n }\n `}}const BV={kernelName:qr,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:n,attrs:s}=e,{images:r}=t,{alignCorners:a,halfPixelCenters:i,size:o}=s,[l,u]=o,c=Sn().getBool("WEBGL_PACK_IMAGE_OPERATIONS")?new FV(r.shape,l,u,a,i):new MV(r.shape,l,u,a,i);return n.runWebGLProgram(c,[r],"float32")}};class zV{constructor(e,t,n){this.variableNames=["dy"],this.outputShape=[],this.outputShape=t;const[,s,r]=t,[,a,i]=e,o=[n&&a>1?s-1:s,n&&i>1?r-1:r],l=[n&&a>1?a-1:a,n&&i>1?i-1:i],u=o[0]/l[0],c=o[1]/l[1],h=1/u,d=1/c,p=2*Math.ceil(h)+2,f=2*Math.ceil(d)+2;this.userCode=`\n void main() {\n ivec4 coords = getOutputCoords();\n int b = coords[0];\n int d = coords[3];\n int r = coords[1];\n int c = coords[2];\n\n float accumulator = 0.0;\n\n const float heightScale = float(${u});\n const float widthScale = float(${c});\n\n const float invHeightScale = float(${h});\n const float invWidthScale = float(${d});\n\n const int winHeight = int(${p});\n const int winWidth = int(${f});\n\n // Compute bounds for where in dy we will look\n float startRLerp = floor(float(r) * invHeightScale);\n int startDyR = int(startRLerp - float(winHeight / 2));\n\n float startCLerp = floor(float(c) * invWidthScale);\n int startDyC = int(startCLerp - float(winWidth / 2));\n\n // Loop over dy\n for (int dyROffset = 0; dyROffset < winHeight; dyROffset++) {\n int dyR = dyROffset + startDyR;\n\n // Guard against the window exceeding the bounds of dy\n if (dyR < 0 || dyR >= ${a}) {\n continue;\n }\n\n for (int dyCOffset = 0; dyCOffset < winWidth; dyCOffset++) {\n int dyC = dyCOffset + startDyC;\n\n // Guard against the window exceeding the bounds of dy\n if (dyC < 0 || dyC >= ${i}) {\n continue;\n }\n\n float dxR = float(dyR) * heightScale;\n int topDxRIndex = int(floor(dxR));\n int bottomDxRIndex = int(min(ceil(dxR), ${s-1}.0));\n float dxRLerp = dxR - float(topDxRIndex);\n float inverseDxRLerp = 1.0 - dxRLerp;\n\n float dxC = float(dyC) * widthScale;\n int leftDxCIndex = int(floor(dxC));\n int rightDxCIndex = int(min(ceil(dxC), ${r-1}.0));\n float dxCLerp = dxC - float(leftDxCIndex);\n float inverseDxCLerp = 1.0 - dxCLerp;\n\n if (r == topDxRIndex && c == leftDxCIndex) {\n // topLeft\n accumulator +=\n getDy(b, dyR, dyC, d) * inverseDxRLerp * inverseDxCLerp;\n }\n\n if (r == topDxRIndex && c == rightDxCIndex) {\n // topRight\n accumulator += getDy(b, dyR, dyC, d) * inverseDxRLerp * dxCLerp;\n }\n\n if (r == bottomDxRIndex && c == leftDxCIndex) {\n // bottomLeft\n accumulator += getDy(b, dyR, dyC, d) * dxRLerp * inverseDxCLerp;\n }\n\n if (r == bottomDxRIndex && c == rightDxCIndex) {\n // bottomRight\n accumulator += getDy(b, dyR, dyC, d) * dxRLerp * dxCLerp;\n }\n }\n }\n // End loop over dy\n\n setOutput(accumulator);\n }\n `}}const LV={kernelName:jr,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:n,attrs:s}=e,{images:r,dy:a}=t,{alignCorners:i}=s,o=new zV(a.shape,r.shape,i);return n.runWebGLProgram(o,[a],a.dtype)}};class PV{constructor(e,t,n,s,r){this.variableNames=["A"],this.outputShape=[];const[a,i,o,l]=e;this.outputShape=[a,t,n,l];const u=[s&&t>1?i-1:i,s&&n>1?o-1:o],c=[s&&t>1?t-1:t,s&&n>1?n-1:n],h=s?"0.5":"0.0";let d;d=r?"max((vec2(yRC) + vec2(0.5)) * effectiveInputOverOutputRatioRC, vec2(0.0))":"vec2(yRC) * effectiveInputOverOutputRatioRC",this.userCode=`\n const vec2 effectiveInputOverOutputRatioRC = vec2(\n ${u[0]/c[0]},\n ${u[1]/c[1]});\n const vec2 inputShapeRC = vec2(${i}.0, ${o}.0);\n\n void main() {\n ivec4 coords = getOutputCoords();\n int b = coords[0];\n int d = coords[3];\n ivec2 yRC = coords.yz;\n\n // Fractional source index.\n vec2 sourceFracIndexRC = ${d};\n\n // Compute the coordinators of nearest neighbor point.\n ivec2 sourceNearestRC = ivec2(\n min(inputShapeRC - 1.0, floor(sourceFracIndexRC + ${h})));\n float newValue = getA(b, sourceNearestRC.x, sourceNearestRC.y, d);\n\n setOutput(newValue);\n }\n `}}class VV{constructor(e,t,n,s,r){this.variableNames=["A"],this.packedInputs=!0,this.packedOutput=!0,this.outputShape=[];const[a,i,o,l]=e;this.outputShape=[a,t,n,l];const u=[s&&t>1?i-1:i,s&&n>1?o-1:o],c=[s&&t>1?t-1:t,s&&n>1?n-1:n],h=s?"0.5":"0.0";let d;d=r?"max((vec3(yRC) + vec3(0.5)) * effectiveInputOverOutputRatioRC, vec3(0.0))":"vec3(yRC) * effectiveInputOverOutputRatioRC",this.userCode=`\n const vec3 effectiveInputOverOutputRatioRC = vec3(\n ${u[0]/c[0]},\n ${u[1]/c[1]},\n ${u[1]/c[1]});\n const vec3 inputShapeRC = vec3(${i}.0, ${o}.0,\n ${o}.0);\n\n float getAValue(int b, int r, int c, int d) {\n return getChannel(getA(b, r, c, d), vec2(c, d));\n }\n\n void main() {\n ivec4 coords = getOutputCoords();\n int b = coords[0];\n int d = coords[3];\n // Calculate values for next column in yRC.z.\n ivec3 yRC = coords.yzz + ivec3(0, 0, 1);\n\n // Fractional source index.\n vec3 sourceFracIndexRC = ${d};\n\n // Compute the coordinators of nearest neighbor point.\n ivec3 sourceNearestRC = ivec3(\n min(inputShapeRC - 1.0, floor(sourceFracIndexRC + ${h})));\n\n // Should we calculate next column and row elements in 2x2 packed cell.\n bool hasNextCol = d < ${l-1};\n bool hasNextRow = coords.z < ${n-1};\n\n vec4 newValue = vec4(\n getAValue(b, sourceNearestRC.x, sourceNearestRC.y, d),\n hasNextCol ? getAValue(b, sourceNearestRC.x, sourceNearestRC.y, d + 1)\n : 0.0,\n hasNextRow ? getAValue(b, sourceNearestRC.x, sourceNearestRC.z, d)\n : 0.0,\n (hasNextRow && hasNextCol) ?\n getAValue(b, sourceNearestRC.x, sourceNearestRC.z, d + 1) : 0.0);\n\n setOutput(newValue);\n }\n `}}const WV={kernelName:Ur,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:n,attrs:s}=e,{images:r}=t,{alignCorners:a,halfPixelCenters:i,size:o}=s,[l,u]=o,c=Sn().getBool("WEBGL_PACK_IMAGE_OPERATIONS")?new VV(r.shape,l,u,a,i):new PV(r.shape,l,u,a,i);return n.runWebGLProgram(c,[r],r.dtype)}};class UV{constructor(e,t,n){this.variableNames=["dy"],this.outputShape=[],this.outputShape=t;const[,s,r]=t,[,a,i]=e,o=[n&&a>1?s-1:s,n&&i>1?r-1:r],l=[n&&a>1?a-1:a,n&&i>1?i-1:i],u=o[0]/l[0],c=o[1]/l[1],h=1/u,d=1/c,p=2*Math.ceil(h)+2,f=2*Math.ceil(d)+2;this.userCode=`\n void main() {\n ivec4 coords = getOutputCoords();\n int b = coords[0];\n int d = coords[3];\n int r = coords[1];\n int c = coords[2];\n\n float accumulator = 0.0;\n\n const float heightScale = float(${u});\n const float widthScale = float(${c});\n\n const float invHeightScale = float(${h});\n const float invWidthScale = float(${d});\n\n const int winHeight = int(${p});\n const int winWidth = int(${f});\n\n // Compute bounds for where in dy we will look\n float startRLerp = floor(float(r) * invHeightScale);\n int startDyR = int(floor(startRLerp - float(winHeight / 2)));\n\n float startCLerp = floor(float(c) * invWidthScale);\n int startDyC = int(floor(startCLerp - float(winWidth / 2)));\n\n // Loop over dy\n for (int dyROffset = 0; dyROffset < winHeight; dyROffset++) {\n int dyR = dyROffset + startDyR;\n\n // Guard against the window exceeding the bounds of dy\n if (dyR < 0 || dyR >= ${a}) {\n continue;\n }\n\n for (int dyCOffset = 0; dyCOffset < winWidth; dyCOffset++) {\n int dyC = dyCOffset + startDyC;\n\n // Guard against the window exceeding the bounds of dy\n if (dyC < 0 || dyC >= ${i}) {\n continue;\n }\n\n float sourceFracRow =\n float(${o[0]}) *\n (float(dyR) / float(${l[0]}));\n\n float sourceFracCol =\n float(${o[1]}) *\n (float(dyC) / float(${l[1]}));\n\n int sourceNearestRow = int(min(\n float(int(${s}) - 1),\n ${n} ? float(round(sourceFracRow)) :\n float(floor(sourceFracRow))));\n\n int sourceNearestCol = int(min(\n float(int(${r}) - 1),\n ${n} ? float(round(sourceFracCol)) :\n float(floor(sourceFracCol))));\n\n if (r == sourceNearestRow && c == sourceNearestCol) {\n accumulator += getDy(b, dyR, dyC, d);\n }\n }\n }\n // End loop over dy\n\n setOutput(accumulator);\n }\n `}}const GV={kernelName:Gr,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:n,attrs:s}=e,{images:r,dy:a}=t,{alignCorners:i}=s,o=new UV(a.shape,r.shape,i);return n.runWebGLProgram(o,[a],a.dtype)}};class qV{constructor(e,t){this.variableNames=["x"];const n=e.length;if(n>4)throw new Error(`WebGL backend: Reverse of rank-${n} tensor is not yet supported`);if(this.outputShape=e,1===n)return void(this.userCode=`\n void main() {\n int coord = getOutputCoords();\n setOutput(getX(${e[0]} - coord - 1));\n }\n `);const s=e.map(((n,s)=>(n=>-1!==t.indexOf(n)&&1!==e[n]?`${e[n]} - coords[${n}] - 1`:`coords[${n}]`)(s))).join(","),r=bD(n);this.userCode=`\n void main() {\n ${r} coords = getOutputCoords();\n setOutput(getX(${s}));\n }\n `}}class jV{constructor(e,t){this.variableNames=["x"],this.packedInputs=!0,this.packedOutput=!0;const n=e.length;if(n>4)throw new Error(`WebGL backend: Reverse of rank-${n} tensor is not yet supported`);this.outputShape=e;const s=VM("rc",n),r=`${s[n-1]} + 1 < ${this.outputShape[n-1]}`,a=`${s[n-2]} + 1 < ${this.outputShape[n-2]}`,i=bD(n);function o(n){const s=e.map(((s,r)=>function(n,s){return-1!==t.indexOf(n)&&1!==e[n]?`${e[n]} - ${s[n]} - 1`:`${s[n]}`}(r,n)));return`getChannel(getX(${s.join(",")}), vec2(${s.slice(-2).join(",")}))`}this.userCode=1===n?`\n void main(){\n int rc = getOutputCoords();\n vec4 result = vec4(0.);\n result.r = getChannel(getX(${e[0]} - rc - 1),\n ${e[0]} - rc - 1);\n if(${r}){\n result.g = getChannel(getX(${e[0]} - (rc + 1) - 1),\n ${e[0]} - (rc + 1) - 1);\n }\n setOutput(result);\n }\n `:`\n void main() {\n ${i} rc = getOutputCoords();\n vec4 result = vec4(0.);\n result.r = ${function(e){return o(e)}(s.slice())};\n if(${r}){\n result.g = ${function(e){return e[n-1]="("+e[n-1]+" + 1)",o(e)}(s.slice())};\n }\n if(${a}) {\n result.b = ${function(e){return e[n-2]="("+e[n-2]+" + 1)",o(e)}(s.slice())};\n if(${r}) {\n result.a = ${function(e){return e[n-1]="("+e[n-1]+" + 1)",e[n-2]="("+e[n-2]+" + 1)",o(e)}(s.slice())};\n }\n }\n setOutput(result);\n }\n `}}const HV={kernelName:$r,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:n,attrs:s}=e,{x:r}=t,{dims:a}=s,i=r.shape.length,o=en(a,r.shape);if(0===i)return yF({inputs:{x:r},backend:n});const l=Sn().getBool("WEBGL_PACK_ARRAY_OPERATIONS")?new jV(r.shape,o):new qV(r.shape,o);return n.runWebGLProgram(l,[r],r.dtype)}};class $V{constructor(e,t){this.variableNames=["Image"],this.outputShape=[],this.customUniforms=[{name:"params",type:"vec4"}];const n=e[1],s=e[2];this.outputShape=e;let r="";r="number"==typeof t?`float outputValue = ${t.toFixed(2)};`:`\n vec3 fill = vec3(${t.join(",")});\n float outputValue = fill[coords[3]];`,this.userCode=`\n void main() {\n ivec4 coords = getOutputCoords();\n int x = coords[2];\n int y = coords[1];\n float coordXFloat = (float(x) - params[0]) * params[3] -\n (float(y) - params[1]) * params[2];\n float coordYFloat = (float(x) - params[0]) * params[2] +\n (float(y) - params[1]) * params[3];\n int coordX = int(round(coordXFloat + params[0]));\n int coordY = int(round(coordYFloat + params[1]));\n ${r}\n if(coordX >= 0 && coordX < ${s} && coordY >= 0 && coordY < ${n}) {\n outputValue = getImage(coords[0], coordY, coordX, coords[3]);\n }\n setOutput(outputValue);\n }\n `}}const KV={kernelName:za,backendName:"webgl",kernelFunc:({inputs:e,attrs:t,backend:n})=>{const{image:s}=e,{radians:r,fillValue:a,center:i}=t,o=n,l=new $V(s.shape,a),[u,c]=Fm(i,s.shape[1],s.shape[2]),h=[[u,c,Math.sin(r),Math.cos(r)]];return o.runWebGLProgram(l,[s],s.dtype,h)}},XV=IF({opSnippet:"\n // OpenGL ES does not support round function.\n // The algorithm is based on banker's rounding.\n float base = floor(x);\n if ((x - base) < 0.5) {\n return floor(x);\n } else if ((x - base) > 0.5) {\n return ceil(x);\n } else {\n if (mod(base, 2.0) == 0.0) {\n return base;\n } else {\n return base + 1.0;\n }\n }\n"}),ZV={kernelName:Kr,backendName:"webgl",kernelFunc:XV},YV=IF({opSnippet:"return inversesqrt(x);",cpuKernelImpl:vM}),QV={kernelName:Xr,backendName:"webgl",kernelFunc:YV};class JV{constructor(e,t,n,s,r,a,i=!0,o=!1){this.variableNames=["updates","indices","defaultValue"],this.outputShape=a;const l=bD(r.length),u=bD(a.length);let c="";1===n?c="i":2===n&&(c="i, j");const h=`getIndices(${c})`;let d="";1===s?d="i":2===s&&(d="i, coords[1]");const p=`getUpdates(${d})`;let f="";o&&(f="coords[0], coords[1]");const m=`getDefaultValue(${f})`,g=t>1?"strides[j]":"strides";this.userCode=`\n ${l} strides = ${l}(${r});\n\n void main() {\n ${u} coords = getOutputCoords();\n float sum = 0.0;\n bool found = false;\n for (int i = 0; i < ${e}; i++) {\n int flattenedIndex = 0;\n for (int j = 0; j < ${t}; j++) {\n int index = round(${h});\n flattenedIndex += index * ${g};\n }\n if (flattenedIndex == coords[0]) {\n sum += ${p};\n found = true;\n }\n }\n setOutput(mix(${m}, sum, float(found)));\n }\n `}}class eW{constructor(e,t,n,s,r,a,i=!0,o=!1){this.variableNames=["updates","indices","defaultValue"],this.packedInputs=!0,this.packedOutput=!0,this.outputShape=a;const l=bD(r.length),u=bD(a.length);let c="";1===n?c="i":2===n&&(c="i, j");const h=`getIndices(${c})`;let d="";1===s?d="i":2===s&&(d="i, coords[1]");const p=`getUpdates(${d})`;let f="";o&&(f="coords[0], coords[1]");const m=`getDefaultValue(${f})`,g=t>1?"strides[j]":"strides",y=t>1?"strides[j + 1]":"strides";this.userCode=`\n ${l} strides = ${l}(${r});\n\n void main() {\n ${u} coords = getOutputCoords();\n vec4 sum = vec4(0.);\n vec4 found = vec4(0.);\n for (int i = 0; i < ${e}; i+=2) {\n ivec2 flattenedIndex = ivec2(0);\n for (int j = 0; j < ${t}; j+=2) {\n ivec4 index = round(${h});\n flattenedIndex += index.xz * ${g};\n if (j + 1 < ${t}) {\n flattenedIndex += index.yw * ${y};\n }\n }\n if (flattenedIndex[0] == coords[0] || flattenedIndex[1] == coords[0] ||\n flattenedIndex[0] == coords[0] + 1 || flattenedIndex[1] == coords[0] + 1) {\n vec4 updVals = ${p};\n if (flattenedIndex[0] == coords[0]) {\n sum.xy += updVals.xy;\n found.xy = vec2(1.);\n } else if (flattenedIndex[0] == coords[0] + 1) {\n sum.zw += updVals.xy;\n found.zw = vec2(1.);\n }\n if (flattenedIndex[1] == coords[0]) {\n sum.xy += updVals.zw;\n found.xy = vec2(1.);\n } else if (flattenedIndex[1] == coords[0] + 1) {\n sum.zw += updVals.zw;\n found.zw = vec2(1.);\n }\n }\n }\n setOutput(mix(${m}, sum, found));\n }\n `}}const tW={kernelName:Zr,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:n,attrs:s}=e,{indices:r,updates:a}=t,{shape:i}=s,{sliceRank:o,numUpdates:l,sliceSize:u,strides:c,outputSize:h}=Wp(0,r,i),d=[h/u,u];if(0===h)return n.makeTensorInfo(i,r.dtype);const p=zF({inputs:{x:r},backend:n,attrs:{shape:[l,o]}}),f=zF({inputs:{x:a},backend:n,attrs:{shape:[l,u]}}),m=n.makeTensorInfo([],"float32",new Float32Array([0]));let g;g=Sn().getBool("WEBGL_PACK")?new eW(l,o,p.shape.length,f.shape.length,c,d):new JV(l,o,p.shape.length,f.shape.length,c,d);const y=n.runWebGLProgram(g,[f,p,m],f.dtype),b=zF({inputs:{x:y},backend:n,attrs:{shape:i}});return n.disposeIntermediateTensorInfo(p),n.disposeIntermediateTensorInfo(f),n.disposeIntermediateTensorInfo(y),n.disposeIntermediateTensorInfo(m),b}};class nW{constructor(e,t,n,s){this.variableNames=["sortedSequence","values"],this.customUniforms=[{name:"numInputs",type:"int"}],this.outputShape=[e,n];const r=`for (int i = 0; i < ${Math.ceil(Math.log2(t+1))}; ++i) { if (left >= right) break;`,a=2===Sn().getNumber("WEBGL_VERSION")?"while (left < right) {":r,i="left"===s?"<":"<=";this.userCode=`\n int findBound(int batch, float value) {\n int left = 0;\n int right = numInputs;\n int mid;\n ${a}\n mid = (left + right) / 2;\n if (getSortedSequence(batch, mid) ${i} value) {\n left = mid + 1;\n } else {\n right = mid;\n }\n }\n return right;\n }\n\n void main() {\n ivec2 coords = getOutputCoords();\n int batch = coords[0];\n int valueIndex = coords[1];\n\n float value = getValues(batch, valueIndex);\n\n setOutput(float(findBound(batch, value)));\n }\n `}}const sW={kernelName:Qr,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:n,attrs:s}=e,{sortedSequence:r,values:a}=t,{side:i}=s,o=new nW(r.shape[0],r.shape[1],a.shape[1],i),l=[[r.shape[1]]];return n.runWebGLProgram(o,[r,a],"int32",l)}};class rW{constructor(e,t,n){let s,r;if(this.variableNames=["c","a","b"],this.outputShape=t,n>4)throw Error(`Where for rank ${n} is not yet supported`);if(1===n)r="resRC",s="resRC";else{const n=["resRC.x","resRC.y","resRC.z","resRC.w"],a=[],i=[];for(let s=0;s= 1.0) {\n setOutput(getA(${r}));\n } else {\n setOutput(getB(${r}));\n }\n }\n `}}const aW={kernelName:Jr,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:n}=e,{condition:s,t:r,e:a}=t,i=new rW(s.shape.length,r.shape,r.shape.length);return n.runWebGLProgram(i,[s,r,a],Gi(r.dtype,a.dtype))}},iW=IF({opSnippet:`\n // Stable and Attracting Fixed Point (0, 1) for Normalized Weights.\n // see: https://arxiv.org/abs/1706.02515\n float scaleAlpha = ${Um};\n float scale = ${Gm};\n return (x >= 0.0) ? scale * x : scaleAlpha * (exp(x) - 1.0);\n`}),oW={kernelName:ea,backendName:"webgl",kernelFunc:iW},lW=IF({opSnippet:_F+"\n return 1.0 / (1.0 + exp(-1.0 * x));\n",packedOpSnippet:"\n vec4 result = 1.0 / (1.0 + exp(-1.0 * x));\n bvec4 isNaN = isnan(x);\n\n result.r = isNaN.r ? x.r : result.r;\n result.g = isNaN.g ? x.g : result.g;\n result.b = isNaN.b ? x.b : result.b;\n result.a = isNaN.a ? x.a : result.a;\n\n return result;\n",cpuKernelImpl:AM}),uW={kernelName:aa,backendName:"webgl",kernelFunc:lW},cW=IF({opSnippet:"\n if (isnan(x)) { return 0.0; }\n return sign(x);\n"}),hW={kernelName:ra,backendName:"webgl",kernelFunc:cW},dW=IF({opSnippet:_F+"\n return sin(x);\n",packedOpSnippet:`\n vec4 result = sin(x);\n bvec4 isNaN = isnan(x);\n ${mF}\n return result;\n`}),pW={kernelName:na,backendName:"webgl",kernelFunc:dW},fW=IF({opSnippet:"\n float e2x = exp(x);\n return (e2x - 1.0 / e2x) / 2.0;\n"}),mW={kernelName:sa,backendName:"webgl",kernelFunc:fW},gW=IF({opSnippet:"\n float epsilon = 1.1920928955078125e-7;\n float threshold = log(epsilon) + 2.0;\n\n bool too_large = x > -threshold;\n bool too_small = x < threshold;\n\n float result;\n float exp_x = exp(x);\n\n if (too_large){\n result = x;\n }\n else if (too_small){\n result = exp_x;\n }\n else{\n result = log(exp_x + 1.0);\n }\n return result;\n"}),yW={kernelName:ia,backendName:"webgl",kernelFunc:gW},bW={kernelName:ua,backendName:"webgl",kernelFunc:e=>{const{inputs:t,backend:n,attrs:s}=e,{x:r}=t,{blockShape:a,paddings:i}=s;qt(r.shape.length<=4,(()=>"spaceToBatchND for rank > 4 with a WebGL backend not implemented yet"));const o=a.reduce(((e,t)=>e*t)),l=[[0,0]];l.push(...i);for(let e=1+a.length;en.disposeIntermediateTensorInfo(e))),g}};const wW={kernelName:da,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:n}=e,{indices:s,values:r,denseShape:a,defaultValue:i}=t;if(1!==a.shape.length)throw new Error(`Dense shape must be a vector, saw:\n ${a.shape}`);if(2!==s.shape.length)throw new Error(`Indices must be a matrix, saw:\n ${s.shape}`);if(1!==r.shape.length)throw new Error(`Values must be a vector, saw:\n ${r.shape}`);if(0!==i.shape.length)throw new Error(`Default value must be a scalar, saw:\n ${i.shape}`);const o=n.readSync(s.dataId),l=n.readSync(r.dataId),u=n.readSync(a.dataId),c=n.readSync(i.dataId)[0],[h,d,p,f,m]=SM(o,s.shape,s.dtype,l,r.dtype,u,c);return[n.makeTensorInfo(d,s.dtype,h),n.makeTensorInfo([d[0]],r.dtype,p),n.makeTensorInfo([f.length],"bool",new Uint8Array(f.map((e=>Number(e))))),n.makeTensorInfo([m.length],s.dtype,new Int32Array(m))]}};const vW={kernelName:pa,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:n}=e,{inputIndices:s,inputShape:r,newShape:a}=t;if(2!==s.shape.length)throw new Error(`Input indices should be a matrix but received shape ${s.shape}`);if(1!==r.shape.length)throw new Error(`Input shape should be a vector but received shape ${r.shape}`);if(1!==a.shape.length)throw new Error(`Target shape should be a vector but received shape ${a.shape}`);const i=Array.from(n.readSync(r.dataId)),o=n.readSync(s.dataId),l=Array.from(n.readSync(a.dataId)),[u,c,h]=EM(o,s.shape,s.dtype,i,l);return[n.makeTensorInfo(c,s.dtype,u),n.makeTensorInfo([h.length],a.dtype,new Int32Array(h))]}};const xW={kernelName:fa,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:n}=e,{data:s,indices:r,segmentIds:a}=t;if(s.shape.length<1)throw new Error("Data should be at least 1 dimensional but received scalar");if(1!==r.shape.length)throw new Error(`Indices should be a vector but received shape\n ${r.shape}`);if(1!==a.shape.length)throw new Error(`Segment ids should be a vector but received shape\n ${a.shape}`);const i=n.readSync(s.dataId),o=n.readSync(r.dataId),l=n.readSync(a.dataId),[u,c]=_M(i,s.shape,s.dtype,o,l,!0);return n.makeTensorInfo(c,s.dtype,u)}};const AW={kernelName:ma,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:n}=e,{data:s,indices:r,segmentIds:a}=t;if(s.shape.length<1)throw new Error("Data should be at least 1 dimensional but received scalar");if(1!==r.shape.length)throw new Error(`Indices should be a vector but received shape\n ${r.shape}`);if(1!==a.shape.length)throw new Error(`Segment ids should be a vector but received shape\n ${a.shape}`);const i=n.readSync(s.dataId),o=n.readSync(r.dataId),l=n.readSync(a.dataId),[u,c]=_M(i,s.shape,s.dtype,o,l);return n.makeTensorInfo(c,s.dtype,u)}};const kW={kernelName:ga,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:n,attrs:s}=e,{sparseIndices:r,sparseValues:a,defaultValue:i}=t,{outputShape:o}=s,{sliceRank:l,numUpdates:u,sliceSize:c,strides:h,outputSize:d}=Wp(0,r,o),p=!1;if("string"===a.dtype){const e=n.bufferSync(r),t=n.bufferSync(a),s=gi(n.readSync(i.dataId)[0]),f=xM(e,t,o,d,c,u,l,h,s,p);return n.makeTensorInfo(o,f.dtype,f.values)}const f=new JV(u,l,r.shape.length,a.shape.length,h,[d,1],p),m=n.runWebGLProgram(f,[a,r,i],a.dtype),g=zF({inputs:{x:m},backend:n,attrs:{shape:o}});return n.disposeIntermediateTensorInfo(m),g}};const CW={kernelName:ca,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:n,attrs:s}=e,{x:r}=t,{numOrSizeSplits:a,axis:i}=s,o=en(i,r.shape)[0],l=fg(r,a,o),u=r.shape.length,c=new Array(u).fill(0),h=r.shape.slice();return l.map((e=>{const t=[...h];t[o]=e;const s=qB({inputs:{x:r},backend:n,attrs:{begin:c,size:t}});return c[o]+=e,s}))}},SW="return sqrt(x);",EW=IF({opSnippet:SW,packedOpSnippet:SW,cpuKernelImpl:IM}),_W={kernelName:oa,backendName:"webgl",kernelFunc:EW},IW={kernelName:ba,backendName:"webgl",kernelFunc:IF({opSnippet:"return x * x;"})},TW="return (a - b) * (a - b);",NW=TF({opSnippet:TW,packedOpSnippet:TW}),OW={kernelName:ya,backendName:"webgl",kernelFunc:NW};const RW={kernelName:wa,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:n,attrs:s}=e,{x:r}=t;if("string"!==r.dtype)throw new Error("Input must be of datatype string");const a=Ng(n.readSync(r.dataId)),i=TM(a,"string",s);return n.makeTensorInfo(r.shape,"string",i)}};const DW={kernelName:Fa,backendName:"webgl",kernelFunc:function({inputs:e,attrs:t,backend:n}){const{x:s}=e,r=KM+`\n return x > 0.0 ? 1.0 : float(${t.alpha});\n `,a=new $M(s.shape,r);return n.runWebGLProgram(a,[s],s.dtype)}};class MW{constructor(e,t,n){this.variableNames=["x"],this.outputShape=n;const s=n.length,r=bD(n.length),a=bD(n.length);let i="";if(1===s)i="coords * strides + begin";else{let e=0;i=n.map(((t,s)=>(e++,1===n.length?`coords * strides[${s}] + begin[${s}]`:`coords[${e-1}] * strides[${s}] + begin[${s}]`))).join(",")}this.userCode=`\n ${r} begin = ${r}(${e});\n ${r} strides = ${r}(${t});\n\n void main() {\n ${a} coords = getOutputCoords();\n setOutput(getX(${i}));\n }\n `}}const FW={kernelName:va,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:n,attrs:s}=e,{x:r}=t,{begin:a,end:i,strides:o,beginMask:l,endMask:u,ellipsisMask:c,newAxisMask:h,shrinkAxisMask:d}=s,{finalShapeSparse:p,finalShape:f,isIdentity:m,sliceDim0:g,isSimpleSlice:y,begin:b,end:w,strides:v}=ec(r.shape,a,i,o,l,u,c,h,d);let x;if(m)x=zF({inputs:{x:r},backend:n,attrs:{shape:f}});else if(g||y){qt(r.shape.length>=1,(()=>`Input must have rank at least 1, got: ${r.shape.length}`));const e=Wu(b,w,v),t=qB({inputs:{x:r},backend:n,attrs:{begin:b,size:e}});x=zF({inputs:{x:t},backend:n,attrs:{shape:f}}),n.disposeIntermediateTensorInfo(t)}else{if(n.shouldExecuteOnCPU([r])){const e=n.readSync(r.dataId),t=Tl(r.shape,r.dtype,e),s=NM(p,t,v,b);x=n.makeTensorInfo(f,r.dtype,s.values)}else{const e=new MW(b,v,p);x=n.runWebGLProgram(e,[r],r.dtype)}}const A=zF({inputs:{x},backend:n,attrs:{shape:f}});return n.disposeIntermediateTensorInfo(x),A}};const BW={kernelName:xa,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:n,attrs:s}=e,{separator:r,nGramWidths:a,leftPad:i,rightPad:o,padWidth:l,preserveShortSequences:u}=s,{data:c,dataSplits:h}=t,d=n.readSync(c.dataId),p=n.readSync(h.dataId),[f,m]=OM(d,p,r,a,i,o,l,u);return[n.makeTensorInfo([f.length],"string",f),n.makeTensorInfo(h.shape,"int32",m)]}};const zW={kernelName:Aa,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:n,attrs:s}=e,{skipEmpty:r}=s,{input:a,delimiter:i}=t;if("string"!==a.dtype)throw new Error("Input must be of datatype string");if(1!==a.shape.length)throw new Error(`Input must be a vector, got shape: ${a.shape}`);if(0!==i.shape.length)throw new Error(`Delimiter must be a scalar, got shape: ${i.shape}`);const o=n.readSync(a.dataId),l=n.readSync(i.dataId)[0],[u,c,h]=RM(o,l,r),d=c.length;return[n.makeTensorInfo([d,2],"int32",u),n.makeTensorInfo([d],"string",c),n.makeTensorInfo([2],"int32",new Int32Array(h))]}};const LW={kernelName:ka,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:n,attrs:s}=e,{numBuckets:r}=s,{input:a}=t;if("string"!==a.dtype)throw new Error("Input must be of datatype string");if(r<=0)throw new Error("Number of buckets must be at least 1");const i=n.readSync(a.dataId),o=DM(i,r);return n.makeTensorInfo(a.shape,"int32",o)}},PW=IF({opSnippet:"return tan(x);"}),VW={kernelName:Sa,backendName:"webgl",kernelFunc:PW},WW=IF({opSnippet:"\n float e2x = exp(-2.0 * abs(x));\n return sign(x) * (1.0 - e2x) / (1.0 + e2x);\n"}),UW={kernelName:Ea,backendName:"webgl",kernelFunc:WW};const GW={kernelName:Yr,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:n,attrs:s}=e,{tensor:r,indices:a,updates:i}=t,{}=s,{sliceRank:o,numUpdates:l,sliceSize:u,strides:c,outputSize:h}=Wp(0,a,r.shape),d=[h/u,u];if(0===h)return n.makeTensorInfo(r.shape,a.dtype);const p=zF({inputs:{x:a},backend:n,attrs:{shape:[l,o]}}),f=zF({inputs:{x:i},backend:n,attrs:{shape:[l,u]}}),m=zF({inputs:{x:r},backend:n,attrs:{shape:d}}),g=new JV(l,o,p.shape.length,f.shape.length,c,d,!1,!0),y=n.runWebGLProgram(g,[f,p,m],m.dtype),b=zF({inputs:{x:y},backend:n,attrs:{shape:r.shape}});return n.disposeIntermediateTensorInfo(p),n.disposeIntermediateTensorInfo(f),n.disposeIntermediateTensorInfo(m),n.disposeIntermediateTensorInfo(y),b}};class qW{constructor(e,t){this.variableNames=["A"];const n=new Array(e.length);for(let s=0;s5)throw Error(`Tile for rank ${t} is not yet supported`);if(1===t)return`imod(resRC, ${e[0]})`;const n=["resRC.x","resRC.y","resRC.z","resRC.w","resRC.u"],s=[];for(let t=0;t5){const e=n.readSync(r.dataId),t="string"===r.dtype?e.map((e=>gi(e))):e,s=Tl(r.shape,r.dtype,t),i=FM(s,a);return n.makeTensorInfo(i.shape,i.dtype,i.values)}const i=new qW(r.shape,a);return n.runWebGLProgram(i,[r],r.dtype)}const HW={kernelName:_a,backendName:"webgl",kernelFunc:jW};class $W{constructor(e){this.variableNames=["x","indices"],this.customUniforms=[{name:"n",type:"int"},{name:"firstPass",type:"int"},{name:"negativeInf",type:"float"},{name:"dir",type:"int"},{name:"inc",type:"int"}],this.outputShape=e,this.userCode="\n void main() {\n ivec2 coords = getOutputCoords();\n int batch = coords[0];\n int elemIdx = coords[1];\n\n // We compare elements pair-wise within a group of size 2 * inc.\n // The comparing rule for each group alternates between ascending\n // and descending. Within each group, we compare each pair at\n // positions i and i+inc. To decide whether an element at position i\n // is x0 or x1, we mod it by 2 * inc, if the result is smaller than\n // inc, it is in the first half of the group, we denote it as x0,\n // otherwise we denote it as x1.\n // For example, as shown in the Bitonic top K paper referenced above,\n // Figure5(a) shows that element[1] is in the\n // second half of the group when group size is 2, but it is in the\n // first half of the group when group size is 4.\n\n bool isFirstInPair = imod(elemIdx, 2 * inc) < inc;\n int i = isFirstInPair ? elemIdx : elemIdx - inc;\n\n int i0 = firstPass == 1 ? i : int(getIndices(batch, i));\n int i1 = firstPass == 1 ? i + inc : int(getIndices(batch, i + inc));\n float x0 = i0 < n ? getX(batch, i0) : negativeInf;\n float x1 = i1 < n ? getX(batch, i1) : negativeInf;\n\n // Denotes which direction indices are in (ascending or descending).\n bool reverse = imod(elemIdx, 2 * dir) >= dir;\n bool isGreater = x0 > x1 || (x0 == x1 && i1 > i0);\n if (reverse == isGreater) { // Elements in opposite order of direction\n int iTemp = i0;\n i0 = i1;\n i1 = iTemp;\n }\n if (isFirstInPair) {\n setOutput(float(i0));\n } else {\n setOutput(float(i1));\n }\n }\n "}}class KW{constructor(e){this.variableNames=["x","indices"],this.customUniforms=[{name:"n",type:"int"},{name:"firstPass",type:"int"},{name:"k",type:"int"}],this.outputShape=e,this.userCode="\n void main() {\n // Takes max of indices (0, k), (1, k + 1), (2, k + 2) ...\n ivec2 coords = getOutputCoords();\n int batch = coords[0];\n int elemIdx = coords[1];\n\n // The output size is half of the previous size.\n // If the previous sequence is | | | | _ _ _ _ | | | | _ _ _ _ (k=4),\n // we only need to output the indices at positions |, the indices at\n // positions _ can be thrown away, see Figure5(b) After Phase 2\n // (Merge phase) in the Bitonic Top K paper referenced above.\n // For example, the paper shows we only need to output the orange bars.\n // The output sequence should look like this | | | | | | | |.\n // Because the sequence is halved, to map the output index back\n // to the previous sequence to find the corresponding value,\n // we need to double the index. When we double the index,\n // we basically interpolate a position, so 2i looks like\n // | _ | _ | _ | _ | _ | _ | _. We move the | to the first k position\n // of each 2k positions by - elemIdx % k. E.g. for output at\n // index 4,5,6,7, we want to get the corresponding element at\n // original index 8,9,10,11, for output at index 8,9,10,11,\n // we want to get the corresponding element at original index\n // 16,17,18,19, so on and so forth.\n\n int i = elemIdx < k ? elemIdx : (elemIdx * 2 - imod(elemIdx, k));\n int i0 = firstPass == 1 ? i : int(getIndices(batch, i));\n int i1 = firstPass == 1 ? i + k : int(getIndices(batch, i + k));\n\n float x0 = getX(batch, i0);\n float x1 = i1 < n ? getX(batch, i1) : x0;\n\n setOutput(x0 >= x1 ? float(i0) : float(i1));\n }\n "}}function XW(e,t){null!==t&&e.disposeIntermediateTensorInfo(t)}function ZW(e){let t=1;for(;tl){const e=n.readSync(r.dataId),[t,s]=BM(e,u,r.dtype,a,i);return[n.makeTensorInfo(t.shape,t.dtype,t.values),n.makeTensorInfo(s.shape,s.dtype,s.values)]}if(0===a)return u[u.length-1]=0,[n.makeTensorInfo(u,r.dtype,[]),n.makeTensorInfo(u,"int32",[])];if(1===c)return[r,TL({attrs:{shape:u,dtype:"int32",value:0},backend:n})];const h=n.texData.get(r.dataId),d=null!==h&&h.isPacked,p=d?n.unpackTensor(r):r,f=$t(u)/c,m=zF({inputs:{x:p},attrs:{shape:[f,c]},backend:n});d&&XW(n,p);const g=ZW(a),y=ZW(c);let b=null;const w=()=>null===b?[m,m]:[m,b],v=(e,t,s)=>{const r=w(),a=new $W(s),i=[[c],[null===b?1:0],[Number.NEGATIVE_INFINITY],[e],[t]],o=b;b=n.runWebGLProgram(a,r,"int32",i),XW(n,o)};for(let e=1;e=1;n/=2)v(t,n,[f,y])}for(let e=y;e>g;e/=2){const t=w(),s=new KW([f,e/2]),r=[[c],[null===b?1:0],[g]],a=b;b=n.runWebGLProgram(s,t,"int32",r),XW(n,a);const i=g/2,o=2*i;for(let e=i;e>=1;e/=2)v(o,e,b.shape)}let x=b;b=qB({inputs:{x:b},backend:n,attrs:{begin:0,size:[f,a]}}),XW(n,x);let A=KL({inputs:{x:m,indices:b},backend:n,attrs:{axis:1,batchDims:1}});XW(n,m);const k=u.slice(0,-1);k.push(a),x=b,b=zF({inputs:{x:b},attrs:{shape:k},backend:n}),XW(n,x);const C=A;return A=zF({inputs:{x:A},attrs:{shape:k},backend:n}),XW(n,C),[A,b]}};class QW{constructor(e,t,n,s,r,a){this.variableNames=["Image","Transforms"],this.outputShape=a;const i="nearest"===n?1:2;let o;switch(s){case"constant":default:o=1;break;case"reflect":o=2;break;case"wrap":o=3;break;case"nearest":o=4}this.userCode=`\n float mapCoord(float outCoord, float len) {\n float inCoord = outCoord;\n if(${o} == 2) {\n if (inCoord < 0.0) {\n if (len <= 1.0) {\n inCoord = 0.0;\n } else {\n float sz2 = 2.0 * len;\n if (inCoord < sz2) {\n inCoord = sz2 * float(int(float(-inCoord / sz2))) +\n inCoord;\n }\n inCoord = inCoord < -len ? inCoord + sz2 : -inCoord - 1.0;\n }\n } else if (inCoord > len - 1.0) {\n if (len <= 1.0) {\n inCoord = 0.0;\n } else {\n float sz2 = 2.0 * len;\n inCoord -= sz2 * float(int(float(inCoord / sz2)));\n if (inCoord >= len) {\n inCoord = sz2 - inCoord - 1.0;\n }\n }\n }\n return clamp(inCoord, 0.0, len - 1.0);\n } else if (${o} == 3) {\n if (inCoord < 0.0) {\n if (len <= 1.0) {\n inCoord = 0.0;\n } else {\n float sz = len - 1.0;\n inCoord += len * (float(int(float(-inCoord / sz))) + 1.0);\n }\n } else if (inCoord > len - 1.0) {\n if (len <= 1.0) {\n inCoord = 0.0;\n } else {\n float sz = len - 1.0;\n inCoord -= len * float(int(float(inCoord / sz)));\n }\n }\n return clamp(inCoord, 0.0, len - 1.0);\n } else if (${o} == 4) {\n return clamp(outCoord, 0.0, len - 1.0);\n } else {\n return outCoord;\n }\n }\n\n float readWithFillValue(int batch, int coordY, int coordX,\n int channel) {\n float outputValue;\n if (0 <= coordY && coordY < ${e} && 0 <= coordX && coordX < ${t}) {\n outputValue = getImage(batch, coordY, coordX, channel);\n } else {\n outputValue = float(${r});\n }\n return outputValue;\n }\n\n void main() {\n ivec4 coords = getOutputCoords();\n float outputValue;\n int batch = coords[0];\n int x = coords[2];\n int y = coords[1];\n int channel = coords[3];\n float xf = float(x);\n float yf = float(y);\n float a1 = getTransforms(batch, 0);\n float a2 = getTransforms(batch, 1);\n float a3 = getTransforms(batch, 2);\n float b1 = getTransforms(batch, 3);\n float b2 = getTransforms(batch, 4);\n float b3 = getTransforms(batch, 5);\n float c1 = getTransforms(batch, 6);\n float c2 = getTransforms(batch, 7);\n float projection = c1 * xf + c2 * yf + 1.0;\n if (projection == 0.0) {\n outputValue = float(${r});\n } else {\n float inX = (a1 * xf + a2 * yf + a3) / projection;\n float inY = (b1 * xf + b2 * yf + b3) / projection;\n float mapX = mapCoord(inX, float(${t}));\n float mapY = mapCoord(inY, float(${e}));\n\n if (${i} == 1) {\n int coordY = int(round(mapY));\n int coordX = int(round(mapX));\n outputValue = readWithFillValue(batch, coordY, coordX,\n channel);\n } else {\n float yFloor = floor(mapY);\n float xFloor = floor(mapX);\n float yCeil = yFloor + 1.0;\n float xCeil = xFloor + 1.0;\n float valueYFloor = (xCeil - mapX) *\n readWithFillValue(batch, int(yFloor), int(xFloor), channel) +\n (mapX - xFloor) *\n readWithFillValue(batch, int(yFloor), int(xCeil), channel);\n float valueYCeil = (xCeil - mapX) *\n readWithFillValue(batch, int(yCeil), int(xFloor), channel) +\n (mapX - xFloor) *\n readWithFillValue(batch, int(yCeil), int(xCeil), channel);\n outputValue = (yCeil - mapY) * valueYFloor +\n (mapY - yFloor) * valueYCeil;\n }\n }\n setOutput(outputValue);\n }\n `}}const JW={kernelName:Ta,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:n,attrs:s}=e,{image:r,transforms:a}=t,{interpolation:i,fillMode:o,fillValue:l,outputShape:u}=s,[c,h,d,p]=r.shape,[f,m]=null!=u?u:[h,d],g=new QW(h,d,i,o,l,[c,f,m,p]);return n.runWebGLProgram(g,[r,a],"float32")}};const eU={kernelName:Oa,backendName:"webgl",kernelFunc:function(e){const{inputs:t,attrs:n,backend:s}=e,{axis:r}=n,{x:a}=t;JR(a,"unique");const i=s.readSync(a.dataId),{outputValues:o,outputShape:l,indices:u}=LM(i,r,a.shape,a.dtype);return[s.makeTensorInfo(l,a.dtype,o),s.makeTensorInfo([u.length],"int32",u)]}};const tU={kernelName:Ra,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:n,attrs:s}=e,{value:r}=t;let{axis:a}=s;a<0&&(a+=r.shape.length);const i=r,o=i.shape.length,l=r.shape[a],u=new Array(o-1);let c=0;for(let e=0;en.disposeIntermediateTensorInfo(e))),f}};class nU{constructor(e,t){this.variableNames=["x","segmentIds"];const n=e.windowSize,s=e.batchSize,r=e.inSize,a=e.numSegments,i=a*Math.ceil(r/n);this.outputShape=[s,i];const o=4*Math.floor(n/4),l=n%4,u="\n sumValue += dot(values, segFilter);\n ";let c="";r%n>0&&(c=`\n if (inIdx < 0 || inIdx >= ${r}) {\n return initializationValue;\n }\n `);let h="";r%n>0&&(h=`\n if (inIdx < 0 || inIdx >= ${r}) {\n return -1.0;\n }\n `),this.userCode=`\n const float initializationValue = 0.0;\n\n float getValue(int batch, int inIdx) {\n ${c}\n return getX(batch, inIdx);\n }\n\n float getSegmentIdAtIndex(int inIdx) {\n ${h}\n return getSegmentIds(inIdx);\n }\n\n void main() {\n ivec2 coords = getOutputCoords();\n int batch = coords[0];\n int outIdx = coords[1];\n int inOffset = int(floor(float(outIdx) / float(\n ${a})) * float(${n}));\n int currentSeg = int(mod(float(outIdx), float(${a})));\n\n float sumValue = 0.0;\n\n for (int i = 0; i < ${o}; i += 4) {\n int inIdx = inOffset + i;\n vec4 values = vec4(\n getValue(batch, inIdx),\n getValue(batch, inIdx + 1),\n getValue(batch, inIdx + 2),\n getValue(batch, inIdx + 3)\n );\n\n vec4 segFilter = vec4(\n int(getSegmentIdAtIndex(inIdx)) == currentSeg ? 1 : 0,\n int(getSegmentIdAtIndex(inIdx + 1)) == currentSeg ? 1 : 0,\n int(getSegmentIdAtIndex(inIdx + 2)) == currentSeg ? 1 : 0,\n int(getSegmentIdAtIndex(inIdx + 3)) == currentSeg ? 1 : 0\n );\n\n ${u}\n }\n\n int inIdx = inOffset + ${o};\n if (${1===l}) {\n vec4 values = vec4(\n getValue(batch, inIdx),\n initializationValue,\n initializationValue,\n initializationValue\n );\n\n int inIdxSeg = int(getSegmentIdAtIndex(inIdx));\n\n vec4 segFilter = vec4(\n int(getSegmentIdAtIndex(inIdx)) == currentSeg ? 1 : 0,\n 0,\n 0,\n 0\n );\n\n ${u}\n } else if (${2===l}) {\n vec4 values = vec4(\n getValue(batch, inIdx),\n getValue(batch, inIdx + 1),\n initializationValue,\n initializationValue\n );\n\n vec4 segFilter = vec4(\n int(getSegmentIdAtIndex(inIdx)) == currentSeg ? 1 : 0,\n int(getSegmentIdAtIndex(inIdx + 1)) == currentSeg ? 1 : 0,\n 0,\n 0\n );\n\n ${u}\n } else if (${3===l}) {\n vec4 values = vec4(\n getValue(batch, inIdx),\n getValue(batch, inIdx + 1),\n getValue(batch, inIdx + 2),\n initializationValue\n );\n\n vec4 segFilter = vec4(\n int(getSegmentIdAtIndex(inIdx)) == currentSeg ? 1 : 0,\n int(getSegmentIdAtIndex(inIdx + 1)) == currentSeg ? 1 : 0,\n int(getSegmentIdAtIndex(inIdx + 2)) == currentSeg ? 1 : 0,\n 0\n );\n\n ${u}\n }\n setOutput(sumValue);\n }\n `}}const sU={kernelName:Da,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:n,attrs:s}=e,{x:r,segmentIds:a}=t,{numSegments:i}=s,o=r.shape.length,l=[];let u=0;const c=Ih([u],o);let h=r;null!=c&&(h=$F({inputs:{x:r},backend:n,attrs:{perm:c}}),l.push(h),u=Nh(1,o)[0]);const d=Ig(h.shape,u,i),p=$t([h.shape[u]]),f=zF({inputs:{x:h},backend:n,attrs:{shape:[-1,p]}});l.push(f);const m=qi(r.dtype),g=(e,t,s,r,a)=>{const i=e.shape[0],o=e.shape[1],u=_g(o,a),c=new nU({windowSize:u,inSize:o,batchSize:i,numSegments:a},t),h=n.compileAndRun(c,[e,s],r);if(l.push(h),h.shape[1]===a)return h;const d=EV({backend:n,attrs:{start:0,stop:a,step:1,dtype:"float32"}}),p=jW({inputs:{x:d},backend:n,attrs:{reps:[o/u]}});l.push(d),l.push(p);return g(h,t,p,r,a)},y=zF({inputs:{x:g(f,"unsortedSegmentSum",a,m,i)},backend:n,attrs:{shape:d}});let b=y;if(null!=c){l.push(y);const e=Th(c);b=$F({inputs:{x:b},backend:n,attrs:{perm:e}})}return l.forEach((e=>n.disposeIntermediateTensorInfo(e))),b}},rU=[YF,JF,tB,sB,iB,uB,cB,hB,yB,bB,vB,AB,CB,EB,IB,OB,RB,FB,BB,zB,VB,HB,$B,KB,XB,tz,rz,oz,vF,cz,bz,Ez,Oz,Dz,Mz,Fz,Bz,Lz,Vz,Uz,Kz,Xz,Zz,Qz,tL,rL,aL,oL,uL,cL,dL,pL,mL,yL,wL,xL,CL,_L,NL,RL,FL,zL,VL,GL,qL,HL,XL,YL,JL,bF,eP,mz,nP,rP,iP,kF,lP,cP,hP,pP,mP,yP,wP,xP,CP,EP,IP,NP,OP,RP,FP,BP,zP,LP,PP,WP,qP,HP,tV,BF,sV,aV,oV,uV,YB,hV,fV,mV,wV,xV,EF,AV,kV,CV,SV,_V,JB,XP,TV,OV,DV,LF,BV,LV,WV,GV,HV,KV,ZV,QV,tW,sW,aW,oW,uW,hW,pW,mW,jB,eV,yW,bW,wW,vW,xW,AW,kW,CW,_W,IW,OW,RW,DW,FW,BW,zW,LW,QP,HF,VW,UW,GW,HW,YW,JW,KF,eU,tU,sU,pV];for(const e of rU)Ka(e);__webpack_require__(9464);const aU={moveTickSize:50,videoContainerId:"webgazerVideoContainer",videoElementId:"webgazerVideoFeed",videoElementCanvasId:"webgazerVideoCanvas",faceOverlayId:"webgazerFaceOverlay",faceFeedbackBoxId:"webgazerFaceFeedbackBox",gazeDotId:"webgazerGazeDot",videoViewerWidth:320,videoViewerHeight:240,faceFeedbackBoxRatio:.66,showVideo:!0,mirrorVideo:!0,showFaceOverlay:!0,showFaceFeedbackBox:!0,showGazeDot:!0,camConstraints:{video:{width:{min:320,ideal:640,max:1920},height:{min:240,ideal:480,max:1080},facingMode:"user"}},dataTimestep:50,showVideoPreview:!0,applyKalmanFilter:!0,saveDataAcrossSessions:!0,storingPoints:!1,videoIsOn:!1,trackEye:"both"};__webpack_require__(6003);var iU=__webpack_require__(7350),oU=__webpack_require__.n(iU),lU=__webpack_require__(8990),uU=function(){return uU=Object.assign||function(e){for(var t,n=1,s=arguments.length;n0&&r[r.length-1])||6!==a[0]&&2!==a[0])){i=0;continue}if(3===a[0]&&(!r||a[1]>r[0]&&a[1]>>0)+"_",r=0;return function e(n){if(this instanceof e)throw new TypeError("Symbol is not a constructor");return new t(s+(n||"")+"_"+r++,n)}})),r("Symbol.iterator",(function(e){if(e)return e;e=Symbol("Symbol.iterator");for(var r="Array Int8Array Uint8Array Uint8ClampedArray Int16Array Uint16Array Int32Array Uint32Array Float32Array Float64Array".split(" "),i=0;i(t=t||0)&&(t=Math.max(t+s,0));t>2];i=t[(3&i)<<4|o>>4],o=t[(15&o)<<2|l>>6],l=t[63&l],n[a++]=u+i+o+l}switch(u=0,l=s,e.length-r){case 2:l=t[(15&(u=e[r+1]))<<2]||s;case 1:e=e[r],n[a]=t[e>>2]+t[(3&e)<<4|u>>4]+l+s}return n.join("")}function F(e){var t=e.length,n=3*t/4;n%3?n=Math.floor(n):-1!="=.".indexOf(e[t-1])&&(n=-1!="=.".indexOf(e[t-2])?n-2:n-1);var s=new Uint8Array(n),r=0;return function(e,t){function n(t){for(;s>4),64!=i&&(t(a<<4&240|i>>2),64!=o&&t(i<<6&192|o))}}(e,(function(e){s[r++]=e})),r!==n?s.subarray(0,r):s}function B(){if(!D){D={};for(var e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789".split(""),t=["+/=","+/","-_=","-_.","-_"],n=0;5>n;n++){var s=e.concat(t[n].split(""));R[n]=s;for(var r=0;re.i)throw Error("Tried to read past the end of the data "+e.g+" > "+e.i)}function K(e){var t=e.h,n=t[e.g],s=127&n;if(128>n)return e.g+=1,$(e),s;if(s|=(127&(n=t[e.g+1]))<<7,128>n)return e.g+=2,$(e),s;if(s|=(127&(n=t[e.g+2]))<<14,128>n)return e.g+=3,$(e),s;if(s|=(127&(n=t[e.g+3]))<<21,128>n)return e.g+=4,$(e),s;if(n=t[e.g+4],e.g+=5,s|=(15&n)<<28,128>n)return $(e),s;if(128<=t[e.g++]&&128<=t[e.g++]&&128<=t[e.g++]&&128<=t[e.g++]&&128<=t[e.g++])throw q();return $(e),s}j.prototype.reset=function(){this.g=this.j};var X=[];function Z(){this.g=[]}function Y(e,t){for(;127>>=7;e.g.push(t)}function Q(e){var t={},n=void 0!==t.W&&t.W;this.l={v:void 0!==t.v&&t.v},this.W=n,t=this.l,X.length?(n=X.pop(),t&&(n.v=t.v),e&&H(n,e),e=n):e=new j(e,t),this.g=e,this.j=this.g.g,this.h=this.i=-1}function J(e){var t=e.g;if(t.g==t.i)return!1;e.j=e.g.g;var n=K(e.g)>>>0;if(t=n>>>3,!(0<=(n&=7)&&5>=n))throw G(n,e.j);if(1>t)throw Error("Invalid field number: "+t+" (at position "+e.j+")");return e.i=t,e.h=n,!0}function ee(e){switch(e.h){case 0:if(0!=e.h)ee(e);else e:{for(var t=(e=e.g).g,n=t+10;t>>0,(e=e.g).g+=t,$(e));break;case 5:(e=e.g).g+=4,$(e);break;case 3:for(t=e.i;;){if(!J(e))throw Error("Unmatched start-group tag: stream EOF");if(4==e.h){if(e.i!=t)throw Error("Unmatched end-group tag");break}ee(e)}break;default:throw G(e.h,e.j)}}Z.prototype.length=function(){return this.g.length},Z.prototype.end=function(){var e=this.g;return this.g=[],e},Q.prototype.reset=function(){this.g.reset(),this.j=this.g.g,this.h=this.i=-1};var te=[];function ne(){this.i=[],this.h=0,this.g=new Z}function se(e,t){0!==t.length&&(e.i.push(t),e.h+=t.length)}var re="function"==typeof Symbol&&"symbol"==typeof Symbol()?Symbol(void 0):void 0;function ae(e,t){Object.isFrozen(e)||(re?e[re]|=t:void 0!==e.N?e.N|=t:Object.defineProperties(e,{N:{value:t,configurable:!0,writable:!0,enumerable:!1}}))}function ie(e){var t;return null==(t=re?e[re]:e.N)?0:t}function oe(e){return ae(e,1),e}function le(e){return!!Array.isArray(e)&&!!(2&ie(e))}function ue(e){if(!Array.isArray(e))throw Error("cannot mark non-array as immutable");ae(e,2)}function ce(e){return null!==e&&"object"==typeof e&&!Array.isArray(e)&&e.constructor===Object}var he=Object.freeze(oe([]));function de(e){if(le(e.m))throw Error("Cannot mutate an immutable Message")}var pe,fe="undefined"!=typeof Symbol&&void 0!==Symbol.hasInstance;function me(e){return{value:e,configurable:!1,writable:!1,enumerable:!1}}function ge(e,t,n){return-1===t?null:t>=e.i?e.g?e.g[t]:void 0:void 0!==n&&n&&e.g&&null!=(n=e.g[t])?n:e.m[t+e.h]}function ye(e,t,n,s){s=void 0!==s&&s,de(e),tte.length&&te.push(e)}}function tt(e,t,n){for(var s=n.length,r=1==s%2,a=r?1:0;a>>0)>>31)+1,s=r>>>23&255,r&=8388607,ye(t,n,255==s?r?NaN:1/0*e:0==s?e*Math.pow(2,-149)*r:e*Math.pow(2,s-150)*(r+Math.pow(2,23))),!0}),(function(e,t,n){if(null!=(t=ge(t,n))){Y(e.g,8*n+5),e=e.g;var s=t;0===(s=(n=0>s?1:0)?-s:s)?U=0<1/s?0:2147483648:isNaN(s)?U=2147483647:34028234663852886e22>>0:11754943508222875e-54>s?(s=Math.round(s/Math.pow(2,-149)),U=(n<<31|s)>>>0):(t=Math.floor(Math.log(s)/Math.LN2),s*=Math.pow(2,-t),16777216<=(s=Math.round(8388608*s))&&++t,U=(n<<31|t+127<<23|8388607&s)>>>0),n=U,e.g.push(n>>>0&255),e.g.push(n>>>8&255),e.g.push(n>>>16&255),e.g.push(n>>>24&255)}})),at=st((function(e,t,n){if(0!==e.h)return!1;for(var s=e.g,r=128,a=0,i=e=0;4>i&&128<=r;i++)r=s.h[s.g++],$(s),a|=(127&r)<<7*i;if(128<=r&&(r=s.h[s.g++],$(s),a|=(127&r)<<28,e|=(127&r)>>4),128<=r)for(i=0;5>i&&128<=r;i++)r=s.h[s.g++],$(s),e|=(127&r)<<7*i+3;if(!(128>r))throw q();return s=a>>>0,(e=2147483648&(r=e>>>0))&&(r=~r>>>0,0==(s=1+~s>>>0)&&(r=r+1>>>0)),s=4294967296*r+(s>>>0),ye(t,n,e?-s:s),!0}),(function(e,t,n){if(null!=(t=ge(t,n))&&null!=t){Y(e.g,8*n),e=e.g;var s=t;for(n=0>s,t=(s=Math.abs(s))>>>0,s=Math.floor((s-t)/4294967296),s>>>=0,n&&(s=~s>>>0,4294967295<(t=1+(~t>>>0))&&(t=0,4294967295<++s&&(s=0))),n=U=t,t=s;0>>7|t<<25)>>>0,t>>>=7;e.g.push(n)}})),it=st((function(e,t,n){return 0===e.h&&(ye(t,n,K(e.g)),!0)}),(function(e,t,n){if(null!=(t=ge(t,n))&&null!=t)if(Y(e.g,8*n),e=e.g,0<=(n=t))Y(e,n);else{for(t=0;9>t;t++)e.g.push(127&n|128),n>>=7;e.g.push(1)}})),ot=st((function(e,t,n){if(2!==e.h)return!1;var s,r=K(e.g)>>>0,a=(e=e.g).g;if(e.g+=r,$(e),e=e.h,N)(s=I)||(s=I=new TextDecoder("utf-8",{fatal:!0})),s=s.decode(e.subarray(a,a+r));else{r=a+r;for(var i,o,l,u=[],c=null;a(i=e[a++])?u.push(i):224>i?a>=r?E():(o=e[a++],194>i||128!=(192&o)?(a--,E()):u.push((31&i)<<6|63&o)):240>i?a>=r-1?E():128!=(192&(o=e[a++]))||224===i&&160>o||237===i&&160<=o||128!=(192&(s=e[a++]))?(a--,E()):u.push((15&i)<<12|(63&o)<<6|63&s):244>=i?a>=r-2?E():128!=(192&(o=e[a++]))||o-144+(i<<28)>>30||128!=(192&(s=e[a++]))||128!=(192&(l=e[a++]))?(a--,E()):(i=(7&i)<<18|(63&o)<<12|(63&s)<<6|63&l,i-=65536,u.push(55296+(i>>10&1023),56320+(1023&i))):E(),8192<=u.length&&(c=_(c,u),u.length=0);s=_(c,u)}return ye(t,n,s),!0}),(function(e,t,n){if(null!=(t=ge(t,n))){var s=!1;if(s=void 0!==s&&s,O){if(s&&/(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])/.test(t))throw Error("Found an unpaired surrogate");t=(T||(T=new TextEncoder)).encode(t)}else{for(var r=0,a=new Uint8Array(3*t.length),i=0;io)a[r++]=o;else{if(2048>o)a[r++]=o>>6|192;else{if(55296<=o&&57343>=o){if(56319>=o&&i=l){o=1024*(o-55296)+l-56320+65536,a[r++]=o>>18|240,a[r++]=o>>12&63|128,a[r++]=o>>6&63|128,a[r++]=63&o|128;continue}i--}if(s)throw Error("Found an unpaired surrogate");o=65533}a[r++]=o>>12|224,a[r++]=o>>6&63|128}a[r++]=63&o|128}}t=a.subarray(0,r)}Y(e.g,8*n+2),Y(e.g,t.length),se(e,e.g.end()),se(e,t)}})),lt=st((function(e,t,n,s,r){if(2!==e.h)return!1;t=xe(t,n,s),n=e.g.i,s=K(e.g)>>>0;var a=e.g.g+s,i=a-n;if(0>=i&&(e.g.i=a,r(t,e),i=a-e.g.g),i)throw Error("Message parsing ended unexpectedly. Expected to read "+s+" bytes, instead read "+(s-i)+" bytes, either the data ended unexpectedly or the message misreported its own length");return e.g.g=a,e.g.i=n,!0}),(function(e,t,n,s,r){if(null!=(t=ve(t,s,n)))for(s=0;s>>=7,i.h++;a.push(o),i.h++}}));function ut(){Ne.apply(this,arguments)}if(p(ut,Ne),fe){var ct={};Object.defineProperties(ut,(ct[Symbol.hasInstance]=me(Object[Symbol.hasInstance]),ct))}function ht(e){ut.call(this,e)}function dt(){return[1,it,2,rt,3,ot,4,ot]}function pt(e){ut.call(this,e,-1,mt)}function ft(){return[1,lt,ht,dt]}p(ht,ut),p(pt,ut),pt.prototype.addClassification=function(e,t){return xe(this,1,ht,e,t),this};var mt=[1];function gt(e){ut.call(this,e)}function yt(){return[1,rt,2,rt,3,rt,4,rt,5,rt]}function bt(e){ut.call(this,e,-1,vt)}function wt(){return[1,lt,gt,yt]}p(gt,ut),p(bt,ut);var vt=[1];function xt(e){ut.call(this,e)}function At(){return[1,rt,2,rt,3,rt,4,rt,5,rt,6,at]}p(xt,ut);var kt=[[61,146],[146,91],[91,181],[181,84],[84,17],[17,314],[314,405],[405,321],[321,375],[375,291],[61,185],[185,40],[40,39],[39,37],[37,0],[0,267],[267,269],[269,270],[270,409],[409,291],[78,95],[95,88],[88,178],[178,87],[87,14],[14,317],[317,402],[402,318],[318,324],[324,308],[78,191],[191,80],[80,81],[81,82],[82,13],[13,312],[312,311],[311,310],[310,415],[415,308]],Ct=[[263,249],[249,390],[390,373],[373,374],[374,380],[380,381],[381,382],[382,362],[263,466],[466,388],[388,387],[387,386],[386,385],[385,384],[384,398],[398,362]],St=[[276,283],[283,282],[282,295],[295,285],[300,293],[293,334],[334,296],[296,336]],Et=[[33,7],[7,163],[163,144],[144,145],[145,153],[153,154],[154,155],[155,133],[33,246],[246,161],[161,160],[160,159],[159,158],[158,157],[157,173],[173,133]],_t=[[46,53],[53,52],[52,65],[65,55],[70,63],[63,105],[105,66],[66,107]],It=[[10,338],[338,297],[297,332],[332,284],[284,251],[251,389],[389,356],[356,454],[454,323],[323,361],[361,288],[288,397],[397,365],[365,379],[379,378],[378,400],[400,377],[377,152],[152,148],[148,176],[176,149],[149,150],[150,136],[136,172],[172,58],[58,132],[132,93],[93,234],[234,127],[127,162],[162,21],[21,54],[54,103],[103,67],[67,109],[109,10]],Tt=[].concat(o(kt),o(Ct),o(St),o(Et),o(_t),o(It));function Nt(e,t,n){if(n=e.createShader(0===n?e.VERTEX_SHADER:e.FRAGMENT_SHADER),e.shaderSource(n,t),e.compileShader(n),!e.getShaderParameter(n,e.COMPILE_STATUS))throw Error("Could not compile WebGL shader.\n\n"+e.getShaderInfoLog(n));return n}function Ot(e){return ve(e,ht,1).map((function(e){return{index:Ae(e,1),ga:we(e,2),label:null!=ge(e,3)?ke(e,3):void 0,displayName:null!=ge(e,4)?ke(e,4):void 0}}))}function Rt(e){return{x:we(e,1),y:we(e,2),z:we(e,3),visibility:null!=ge(e,4)?we(e,4):void 0}}function Dt(e,t){this.h=e,this.g=t,this.l=0}function Mt(e,t,n){return function(e,t){var n=e.g;if(void 0===e.o){var s=Nt(n,"\n attribute vec2 aVertex;\n attribute vec2 aTex;\n varying vec2 vTex;\n void main(void) {\n gl_Position = vec4(aVertex, 0.0, 1.0);\n vTex = aTex;\n }",0),r=Nt(n,"\n precision mediump float;\n varying vec2 vTex;\n uniform sampler2D sampler0;\n void main(){\n gl_FragColor = texture2D(sampler0, vTex);\n }",1),a=n.createProgram();if(n.attachShader(a,s),n.attachShader(a,r),n.linkProgram(a),!n.getProgramParameter(a,n.LINK_STATUS))throw Error("Could not compile WebGL program.\n\n"+n.getProgramInfoLog(a));s=e.o=a,n.useProgram(s),r=n.getUniformLocation(s,"sampler0"),e.j={K:n.getAttribLocation(s,"aVertex"),J:n.getAttribLocation(s,"aTex"),ma:r},e.u=n.createBuffer(),n.bindBuffer(n.ARRAY_BUFFER,e.u),n.enableVertexAttribArray(e.j.K),n.vertexAttribPointer(e.j.K,2,n.FLOAT,!1,0,0),n.bufferData(n.ARRAY_BUFFER,new Float32Array([-1,-1,-1,1,1,1,1,-1]),n.STATIC_DRAW),n.bindBuffer(n.ARRAY_BUFFER,null),e.s=n.createBuffer(),n.bindBuffer(n.ARRAY_BUFFER,e.s),n.enableVertexAttribArray(e.j.J),n.vertexAttribPointer(e.j.J,2,n.FLOAT,!1,0,0),n.bufferData(n.ARRAY_BUFFER,new Float32Array([0,1,0,0,1,0,1,1]),n.STATIC_DRAW),n.bindBuffer(n.ARRAY_BUFFER,null),n.uniform1i(r,0)}s=e.j,n.useProgram(e.o),n.canvas.width=t.width,n.canvas.height=t.height,n.viewport(0,0,t.width,t.height),n.activeTexture(n.TEXTURE0),e.h.bindTexture2d(t.glName),n.enableVertexAttribArray(s.K),n.bindBuffer(n.ARRAY_BUFFER,e.u),n.vertexAttribPointer(s.K,2,n.FLOAT,!1,0,0),n.enableVertexAttribArray(s.J),n.bindBuffer(n.ARRAY_BUFFER,e.s),n.vertexAttribPointer(s.J,2,n.FLOAT,!1,0,0),n.bindFramebuffer(n.DRAW_FRAMEBUFFER?n.DRAW_FRAMEBUFFER:n.FRAMEBUFFER,null),n.clearColor(0,0,0,0),n.clear(n.COLOR_BUFFER_BIT),n.colorMask(!0,!0,!0,!0),n.drawArrays(n.TRIANGLE_FAN,0,4),n.disableVertexAttribArray(s.K),n.disableVertexAttribArray(s.J),n.bindBuffer(n.ARRAY_BUFFER,null),e.h.bindTexture2d(0)}(e,t),"function"==typeof e.g.canvas.transferToImageBitmap?Promise.resolve(e.g.canvas.transferToImageBitmap()):n?Promise.resolve(e.g.canvas):"function"==typeof createImageBitmap?createImageBitmap(e.g.canvas):(void 0===e.i&&(e.i=document.createElement("canvas")),new Promise((function(t){e.i.height=e.g.canvas.height,e.i.width=e.g.canvas.width,e.i.getContext("2d",{}).drawImage(e.g.canvas,0,0,e.g.canvas.width,e.g.canvas.height),t(e.i)})))}function Ft(e){this.g=e}var Bt=new Uint8Array([0,97,115,109,1,0,0,0,1,4,1,96,0,0,3,2,1,0,10,9,1,7,0,65,0,253,15,26,11]);function zt(e,t){return t+e}function Lt(e,t){window[e]=t}function Pt(e){if(this.g=e,this.listeners={},this.j={},this.H={},this.o={},this.u={},this.I=this.s=this.Z=!0,this.D=Promise.resolve(),this.Y="",this.C={},this.locateFile=e&&e.locateFile||zt,"object"==typeof window)var t=window.location.pathname.toString().substring(0,window.location.pathname.toString().lastIndexOf("/"))+"/";else{if("undefined"==typeof location)throw Error("solutions can only be loaded on a web page or in a web worker");t=location.pathname.toString().substring(0,location.pathname.toString().lastIndexOf("/"))+"/"}if(this.$=t,e.options)for(var n=(t=i(Object.keys(e.options))).next();!n.done;n=t.next()){n=n.value;var s=e.options[n].default;void 0!==s&&(this.j[n]="function"==typeof s?s():s)}}function Vt(e,t){var n,s;return A((function(r){return t in e.H?r.return(e.H[t]):(n=e.locateFile(t,""),s=fetch(n).then((function(e){return e.arrayBuffer()})),e.H[t]=s,r.return(s))}))}function Wt(e,t,n){var s,r,a,o,l,u,c,h,d,p,f,m,g,b;return A((function(w){switch(w.g){case 1:if(!n)return w.return(t);for(s={},r=0,a=i(Object.keys(n)),o=a.next();!o.done;o=a.next())l=o.value,"string"!=typeof(u=n[l])&&"texture"===u.type&&void 0!==t[u.stream]&&++r;10&&r[r.length-1])||6!==a[0]&&2!==a[0])){i=0;continue}if(3===a[0]&&(!r||a[1]>r[0]&&a[1]0){var c=o===e.strides.length-1?1:MU(e.minScale,e.maxScale,o+1,e.strides.length);i.push(Math.sqrt(l*c)),a.push(e.interpolatedScaleAspectRatio)}}o++}for(var h=0;h0)p=e.featureMapHeight[n],f=e.featureMapWidth[n];else{var m=e.strides[n];p=Math.ceil(e.inputSizeHeight/m),f=Math.ceil(e.inputSizeWidth/m)}for(var g=0;g-1})),ko([s,r,a]),[2,o]}}))}))}function zU(e,t,n){return CU(this,void 0,void 0,(function(){var s,r,a,i,o;return SU(this,(function(l){switch(l.label){case 0:return s=e[0],r=e[1],a=function(e,t,n){return Ao((function(){var s,r,a,i;n.reverseOutputOrder?(r=Tp(Fc(e,[0,n.boxCoordOffset+0],[-1,1])),s=Tp(Fc(e,[0,n.boxCoordOffset+1],[-1,1])),i=Tp(Fc(e,[0,n.boxCoordOffset+2],[-1,1])),a=Tp(Fc(e,[0,n.boxCoordOffset+3],[-1,1]))):(s=Tp(Fc(e,[0,n.boxCoordOffset+0],[-1,1])),r=Tp(Fc(e,[0,n.boxCoordOffset+1],[-1,1])),a=Tp(Fc(e,[0,n.boxCoordOffset+2],[-1,1])),i=Tp(Fc(e,[0,n.boxCoordOffset+3],[-1,1]))),r=Dl(Bl(Fl(r,n.xScale),t.w),t.x),s=Dl(Bl(Fl(s,n.yScale),t.h),t.y),n.applyExponentialOnBoxSize?(a=Bl(zh(Fl(a,n.hScale)),t.h),i=Bl(zh(Fl(i,n.wScale)),t.w)):(a=Bl(Fl(a,n.hScale),t.h),i=Bl(Fl(i,n.wScale),t.h));var o=Ql(s,Fl(a,2)),l=Ql(r,Fl(i,2)),u=Dl(s,Fl(a,2)),c=Dl(r,Fl(i,2)),h=Rc([Tc(o,[n.numBoxes,1]),Tc(l,[n.numBoxes,1]),Tc(u,[n.numBoxes,1]),Tc(c,[n.numBoxes,1])],1);if(n.numKeypoints)for(var d=0;d0)for((c=l.locationData).relativeKeypoints=[],h=n.numKeypoints*n.numValuesPerKeypoint,d=0;dl?(a=e.width,i=e.width*o,c=(1-l/o)/2):(a=e.height/o,i=e.height,u=(1-o/l)/2),e.width=a,e.height=i,{top:c,left:u,right:u,bottom:c}}(l,s,r),c=function(e,t,n,s){var r=e.width,a=e.height,i=Math.cos(e.rotation),o=Math.sin(e.rotation),l=e.xCenter,u=e.yCenter,c=1/t,h=1/n,d=new Array(16);return d[0]=r*i*1*c,d[1]=-a*o*c,d[2]=0,d[3]=(-.5*r*i*1+.5*a*o+l)*c,d[4]=r*o*1*h,d[5]=a*i*h,d[6]=0,d[7]=(-.5*a*i-.5*r*o*1+u)*h,d[8]=0,d[9]=0,d[10]=r*c,d[11]=0,d[12]=0,d[13]=0,d[14]=0,d[15]=1,function(e){if(16!==e.length)throw new Error("Array length must be 16 but got "+e.length);return[[e[0],e[1],e[2],e[3]],[e[4],e[5],e[6],e[7]],[e[8],e[9],e[10],e[11]],[e[12],e[13],e[14],e[15]]]}(d)}(l,o.width,o.height),h=Ao((function(){var t=OU(e),n=Fp(function(e,t,n){return RU(n,"inputResolution"),[1/n.width*e[0][0]*t.width,1/n.height*e[0][1]*t.width,e[0][3]*t.width,1/n.width*e[1][0]*t.height,1/n.height*e[1][1]*t.height,e[1][3]*t.height,0,0]}(c,o,s),[1,8]),r="zero"===a?"constant":"nearest",l=bm.transform(Lh(Nl(t,"float32")),n,"bilinear",r,0,[s.height,s.width]);return null!=i?function(e,t){var n=function(e,t,n,s){var r=(s-n)/255;return{scale:r,offset:n-0*r}}(0,0,t[0],t[1]);return Ao((function(){return Dl(Bl(e,n.scale),n.offset)}))}(l,i):l}));return{imageTensor:h,padding:u,transformationMatrix:c}}(n,this.imageToTensorConfig),r=s.imageTensor,a=s.transformationMatrix,i=this.detectorModel.execute(r,"Identity:0"),o=function(e){return Ao((function(){var t=function(e){return Ao((function(){return[Fc(e,[0,0,0],[1,-1,1]),Fc(e,[0,0,1],[1,-1,-1])]}))}(e),n=t[0],s=t[1];return{boxes:Tp(s),logits:Tp(n)}}))}(i),l=o.boxes,[4,zU([u=o.logits,l],this.anchorTensor,this.tensorsToDetectionConfig)]);case 1:return 0===(c=p.sent()).length?(ko([n,r,i,u,l]),[2,c]):[4,BU(c,this.maxFaces,.3)];case 2:return h=p.sent(),d=function(e,t){void 0===e&&(e=[]);var n,s=(n=t,[].concat.apply([],n));return e.forEach((function(e){var t=e.locationData;t.relativeKeypoints.forEach((function(e){var t=FU(s,[e.x,e.y]),n=t[0],r=t[1];e.x=n,e.y=r}));var n=t.relativeBoundingBox,r=Number.MAX_VALUE,a=Number.MAX_VALUE,i=Number.MIN_VALUE,o=Number.MIN_VALUE;[[n.xMin,n.yMin],[n.xMin+n.width,n.yMin],[n.xMin+n.width,n.yMin+n.height],[n.xMin,n.yMin+n.height]].forEach((function(e){var t=FU(s,e),n=t[0],l=t[1];r=Math.min(r,n),i=Math.max(i,n),a=Math.min(a,l),o=Math.max(o,l)})),t.relativeBoundingBox={xMin:r,xMax:i,yMin:a,yMax:o,width:i-r,height:o-a}})),e}(h,a),ko([n,r,i,u,l]),[2,d]}}))}))},e.prototype.estimateFaces=function(e,t){return CU(this,void 0,void 0,(function(){var n,s;return SU(this,(function(r){return n=NU(e),s=!!t&&t.flipHorizontal,[2,this.detectFaces(e,s).then((function(e){return e.map((function(e){for(var t=e.locationData.relativeKeypoints.map((function(e,t){return kU(kU({},e),{x:e.x*n.width,y:e.y*n.height,name:EU[t]})})),s=e.locationData.relativeBoundingBox,r=0,a=["width","xMax","xMin"];r-1,[4,oS(t.detectorModelUrl,{fromTFHub:n})];case 1:return s=r.sent(),[2,new KU(t.modelType,s,t.maxFaces)]}}))}))}function ZU(e,t){return CU(this,void 0,void 0,(function(){var n,s;return SU(this,(function(r){if(e===VU.MediaPipeFaceDetector){if(s=void 0,null!=(n=t)){if("tfjs"===n.runtime)return[2,XU(n)];if("mediapipe"===n.runtime)return[2,TU(n)];s=n.runtime}throw new Error("Expect modelConfig.runtime to be either 'tfjs' or 'mediapipe', but got "+s)}throw new Error(e+" is not a supported model name.")}))}))}function YU(e){return e.width*e.height}function QU(e){var t=e.xCenter-e.width/2,n=t+e.width,s=e.yCenter-e.height/2;return{xMin:t,xMax:n,yMin:s,yMax:s+e.height,width:e.width,height:e.height}}function JU(e){return e instanceof Mi?{height:e.shape[0],width:e.shape[1]}:{height:e.height,width:e.width}}function eG(e){return e-2*Math.PI*Math.floor((e+Math.PI)/(2*Math.PI))}function tG(e){return e instanceof Mi?e:Bu(e)}function nG(e,t){qt(0!==e.width,(function(){return t+" width cannot be 0."})),qt(0!==e.height,(function(){return t+" height cannot be 0."}))}function sG(e,t,n){var s=t.outputTensorSize,r=t.keepAspectRatio,a=t.borderMode,i=t.outputTensorFloatRange,o=JU(e),l=function(e,t){return t?{xCenter:t.xCenter*e.width,yCenter:t.yCenter*e.height,width:t.width*e.width,height:t.height*e.height,rotation:t.rotation}:{xCenter:.5*e.width,yCenter:.5*e.height,width:e.width,height:e.height,rotation:0}}(o,n),u=function(e,t,n){if(void 0===n&&(n=!1),!n)return{top:0,left:0,right:0,bottom:0};var s=t.height,r=t.width;nG(t,"targetSize"),nG(e,"roi");var a,i,o=s/r,l=e.height/e.width,u=0,c=0;return o>l?(a=e.width,i=e.width*o,c=(1-l/o)/2):(a=e.height/o,i=e.height,u=(1-o/l)/2),e.width=a,e.height=i,{top:c,left:u,right:u,bottom:c}}(l,s,r),c=function(e,t,n,s){var r=e.width,a=e.height,i=s?-1:1,o=Math.cos(e.rotation),l=Math.sin(e.rotation),u=e.xCenter,c=e.yCenter,h=1/t,d=1/n,p=new Array(16);return p[0]=r*o*i*h,p[1]=-a*l*h,p[2]=0,p[3]=(-.5*r*o*i+.5*a*l+u)*h,p[4]=r*l*i*d,p[5]=a*o*d,p[6]=0,p[7]=(-.5*a*o-.5*r*l*i+c)*d,p[8]=0,p[9]=0,p[10]=r*h,p[11]=0,p[12]=0,p[13]=0,p[14]=0,p[15]=1,function(e){if(16!==e.length)throw new Error("Array length must be 16 but got "+e.length);return[[e[0],e[1],e[2],e[3]],[e[4],e[5],e[6],e[7]],[e[8],e[9],e[10],e[11]],[e[12],e[13],e[14],e[15]]]}(p)}(l,o.width,o.height,!1),h=Ao((function(){var t=tG(e),n=Fp(function(e,t,n){return nG(n,"inputResolution"),[1/n.width*e[0][0]*t.width,1/n.height*e[0][1]*t.width,e[0][3]*t.width,1/n.width*e[1][0]*t.height,1/n.height*e[1][1]*t.height,e[1][3]*t.height,0,0]}(c,o,s),[1,8]),r="zero"===a?"constant":"nearest",l=bm.transform(Lh(Nl(t,"float32")),n,"bilinear",r,0,[s.height,s.width]);return null!=i?function(e,t){var n=function(e,t,n,s){var r=(s-n)/255;return{scale:r,offset:n-0*r}}(0,0,t[0],t[1]);return Ao((function(){return Dl(Bl(e,n.scale),n.offset)}))}(l,i):l}));return{imageTensor:h,padding:u,transformationMatrix:c}}function rG(e){return{xCenter:e.xMin+e.width/2,yCenter:e.yMin+e.height/2,width:e.width,height:e.height}}function aG(e){var t=e.relativeKeypoints;if(t.length<=1)throw new Error("2 or more keypoints required to calculate a rect.");var n=Number.MAX_VALUE,s=Number.MAX_VALUE,r=Number.MIN_VALUE,a=Number.MIN_VALUE;return t.forEach((function(e){n=Math.min(n,e.x),r=Math.max(r,e.x),s=Math.min(s,e.y),a=Math.max(a,e.y)})),{xCenter:(n+r)/2,yCenter:(s+a)/2,width:r-n,height:a-s}}function iG(e,t,n,s,r){var a="rect"===n?function(e,t,n){var s,r=e.locationData;if("boundingbox"===t)s=rG(r.boundingBox);else{s=aG(r);var a=n.width,i=n.height;s.xCenter=Math.round(s.xCenter*a),s.yCenter=Math.round(s.yCenter*i),s.width=Math.round(s.width*a),s.height=Math.round(s.height*i)}return s}(e,t,s):function(e,t){var n=e.locationData;return"boundingbox"===t?rG(n.relativeBoundingBox):aG(n)}(e,t);return r&&(a.rotation=function(e,t,n){var s,r=e.locationData,a=n.rotationVectorStartKeypointIndex,i=n.rotationVectorEndKeypointIndex;s=n.rotationVectorTargetAngle?n.rotationVectorTargetAngle:Math.PI*n.rotationVectorTargetAngleDegree/180;var o=r.relativeKeypoints[a].x*t.width,l=r.relativeKeypoints[a].y*t.height,u=r.relativeKeypoints[i].x*t.width,c=r.relativeKeypoints[i].y*t.height;return eG(s-Math.atan2(-(c-l),u-o))}(e,s,r)),a}function oG(e,t,n){for(var s=0;s1&&(h.y=s?t.inputImageHeight-i[u+1]:i[u+1]),a>2&&(h.z=i[u+2]),a>3&&(h.score=hG(t.visibilityActivation,i[u+3])),o.push(h);for(c=0;c0?r/a:0}(e,t)<=.5}))).push(e)}))})),l=y,[4,Promise.all(l.map((function(e){return m.faceLandmark(e,r)})))];case 4:for(u=g.sent(),c=[],this.prevFaceRectsFromLandmarks=[],h=0;h-1,[4,oS(t.landmarkModelUrl,{fromTFHub:n})];case 1:return s=a.sent(),[4,ZU(VU.MediaPipeFaceDetector,{modelType:"short",maxFaces:t.maxFaces,detectorModelUrl:t.detectorModelUrl,runtime:t.runtime})];case 2:return r=a.sent(),[2,new TG(r,s,t.maxFaces,t.refineLandmarks)]}}))}))}(fG||(fG={})).MediaPipeFaceMesh="MediaPipeFaceMesh";Object.freeze({__proto__:null,getKeypointIndexByContour:function(e){if(e===fG.MediaPipeFaceMesh)return pU;throw new Error("Model "+e+" is not supported.")},getAdjacentPairs:function(e){if(e===fG.MediaPipeFaceMesh)return fU;throw new Error("Model "+e+" is not supported.")}});const OG=(e,t,n,s)=>1===s?.5*(e+t):e+(t-e)*n/(s-1),RG={applyExponentialOnBoxSize:!1,flipVertically:!1,ignoreClasses:[],numClasses:1,numBoxes:2304,numCoords:16,boxCoordOffset:0,keypointCoordOffset:4,numKeypoints:6,numValuesPerKeypoint:2,sigmoidScore:!0,scoreClippingThresh:100,reverseOutputOrder:!0,xScale:192,yScale:192,hScale:192,wScale:192,minScoreThresh:.6},DG={reduceBoxesInLowestLayer:!1,interpolatedScaleAspectRatio:0,featureMapHeight:[],featureMapWidth:[],numLayers:1,minScale:.1484375,maxScale:.75,inputSizeHeight:192,inputSizeWidth:192,anchorOffsetX:.5,anchorOffsetY:.5,strides:[4],aspectRatios:[1],fixedAnchorSize:!0},MG={outputTensorSize:{width:192,height:192},keepAspectRatio:!0,outputTensorFloatRange:[-1,1],borderMode:"zero"},FG=e=>{e.detector.imageToTensorConfig=MG,e.detector.tensorsToDetectionConfig=RG,e.detector.anchors=(e=>{null===e.reduceBoxesInLowestLayer&&(e.reduceBoxesInLowestLayer=!1),null===e.interpolatedScaleAspectRatio&&(e.interpolatedScaleAspectRatio=1),null===e.fixedAnchorSize&&(e.fixedAnchorSize=!1);const t=[];let n=0;for(;n0){const n=o===e.strides.length-1?1:OG(e.minScale,e.maxScale,o+1,e.strides.length);i.push(Math.sqrt(t*n)),a.push(e.interpolatedScaleAspectRatio)}}o++}for(let e=0;e0)l=e.featureMapHeight[n],u=e.featureMapWidth[n];else{const t=e.strides[n];l=Math.ceil(e.inputSizeHeight/t),u=Math.ceil(e.inputSizeWidth/t)}for(let n=0;ne.width))),n=Mp(e.detector.anchors.map((e=>e.height))),s=Mp(e.detector.anchors.map((e=>e.xCenter))),r=Mp(e.detector.anchors.map((e=>e.yCenter)));e.detector.anchorTensor={x:s,y:r,w:t,h:n}},BG=function(){this.model=function(e,t){return cU(this,void 0,void 0,(function(){var n,s;return hU(this,(function(r){if(e===fG.MediaPipeFaceMesh){if(s=void 0,null!=(n=t)){if("tfjs"===n.runtime)return[2,NG(n)];if("mediapipe"===n.runtime)return[2,vU(n)];s=n.runtime}throw new Error("Expect modelConfig.runtime to be either 'tfjs' or 'mediapipe', but got "+s)}throw new Error(e+" is not a supported model name.")}))}))}(fG.MediaPipeFaceMesh,{runtime:"tfjs",detectorModelUrl:"https://tfhub.dev/mediapipe/tfjs-model/face_detection/full/1"}),this.predictionReady=!1};BG.prototype.positionsArray=null,BG.prototype.getEyePatches=async function(e,t,n,s){if(0===t.width)return null;const r=await this.model;FG(r);const a=await r.estimateFaces(t,{flipHorizontal:!1});if(0===a.length)return!1;this.positionsArray=a[0].keypoints;const i=a[0],[o,l]=[{eyeTopArc:[466,388,387,386,385,384,398].map((e=>i.keypoints[e])),eyeBottomArc:[263,249,390,373,374,380,381,382,362].map((e=>i.keypoints[e]))},{eyeTopArc:[246,161,160,159,158,157,173].map((e=>i.keypoints[e])),eyeBottomArc:[33,7,163,144,145,153,154,155,133].map((e=>i.keypoints[e]))}].map((({eyeTopArc:e,eyeBottomArc:t})=>{const n={x:Math.round(Math.min(...e.map((e=>e.x)))),y:Math.round(Math.min(...e.map((e=>e.y))))},s=Math.round(Math.max(...t.map((e=>e.x)))),r=Math.round(Math.max(...t.map((e=>e.y))));return{origin:n,width:s-n.x,height:r-n.y}}));var u=o.origin.x,c=o.origin.y,h=o.width,d=o.height,p=l.origin.x,f=l.origin.y,m=l.width,g=l.height;if(0===h||0===m)return null;if(0===d||0===g)return null;var y={},b=t.getContext("2d").getImageData(u,c,h,d);y.left={patch:b,imagex:u,imagey:c,width:h,height:d};var w=t.getContext("2d").getImageData(p,f,m,g);return y.right={patch:w,imagex:p,imagey:f,width:m,height:g},this.predictionReady=!0,y},BG.prototype.getPositions=function(){return this.positionsArray},BG.prototype.reset=function(){},BG.prototype.drawFaceOverlay=function(e,t){if(t){e.fillStyle="#32EEDB",e.strokeStyle="#32EEDB",e.lineWidth=.5;for(let n=0;nn?n:e}LG.Eye=function(e,t,n,s,r){this.patch=e,this.imagex=t,this.imagey=n,this.width=s,this.height=r},LG.getEyeFeats=function(e){var t=this.resizeEye(e.left,10,6),n=this.resizeEye(e.right,10,6),s=this.grayscale(t.data,t.width,t.height),r=this.grayscale(n.data,n.width,n.height),a=[];this.equalizeHistogram(s,5,a);var i=[];return this.equalizeHistogram(r,5,i),a.concat(i)},LG.DataWindow=function(e,t){this.data=[],this.windowSize=e,this.index=0,this.length=0,t&&(this.data=t.slice(t.length-e,t.length),this.length=this.data.length)},LG.DataWindow.prototype.push=function(e){return this.data.length>2),r=0,a=0,i=0;it?255:0;return e},LG.correlation=function(e,t){const n=Math.min(e.length,t.length);let s=0;for(let r=0;rWG(e,t,((e,t)=>e+t)),sub:(e,t)=>WG(e,t,((e,t)=>e-t)),inv:e=>UG.solve(e,UG.identity(e.length,e[0].length)),identity(e,t=e){const n=new Array(e);for(let s=0;se.length===e[0].length?UG.LUDecomposition(e,t):UG.QRDecomposition(e,t),LUDecomposition(e,t){for(var n=new Array(e.length),s=0;sMath.abs(c[f])&&(f=s);if(f!=r){for(p=0;p=0;p--){for(r=0;r=0;u--){for(r=0;r=0;n--){var s=this.screenXTrailArray.get(n),r=this.screenYTrailArray.get(n);if(Math.sqrt(Math.pow(s-e,2)+Math.pow(r-t,2))>72)return n+1}return n},qG.addData=function(e,t,n){e&&("click"===n?(this.screenXClicksArray.push([t[0]]),this.screenYClicksArray.push([t[1]]),this.eyeFeaturesClicks.push(VG.getEyeFeats(e)),this.dataClicks.push({eyes:e,screenPos:t,type:n})):"move"===n&&(this.screenXTrailArray.push([t[0]]),this.screenYTrailArray.push([t[1]]),this.eyeFeaturesTrail.push(VG.getEyeFeats(e)),this.trailTimes.push(performance.now()),this.dataTrail.push({eyes:e,screenPos:t,type:n})))};const jG=qG,HG={RidgeReg:function(){this.init()}};HG.RidgeReg.prototype.init=jG.InitRegression,HG.RidgeReg.prototype.addData=jG.addData,HG.RidgeReg.prototype.predict=function(e){if(!e||0===this.eyeFeaturesClicks.length)return null;for(var t=performance.now()-this.trailTime,n=[],s=[],r=[],a=0;at&&(n.push(this.screenXTrailArray.get(a)),s.push(this.screenYTrailArray.get(a)),r.push(this.eyeFeaturesTrail.get(a)));var i=this.screenXClicksArray.data.concat(n),o=this.screenYClicksArray.data.concat(s),l=this.eyeFeaturesClicks.data.concat(r),u=jG.ridge(i,l,this.ridgeParameter),c=jG.ridge(o,l,this.ridgeParameter),h=VG.getEyeFeats(e),d=0;for(a=0;at&&(n.push(this.screenXTrailArray.get(a)),s.push(this.screenYTrailArray.get(a)),r.push(this.eyeFeaturesTrail.get(a)));var i=this.eyeFeaturesClicks.data.length,o=Array(i),l=Array(i),u=Array(i);for(a=0;asetTimeout(t,e)))}function tq(e,t){let n=Math.pow(10,t);return Math.round(e*n)/n}const nq={tracker:{}};nq.tracker.TFFaceMesh=zG,nq.reg=$G,nq.reg.RidgeWeightedReg=XG.RidgeWeightedReg,nq.reg.RidgeRegThreaded=JG.RidgeRegThreaded,nq.util=VG,nq.params=aU;var sq=null,rq=null,aq=null,iq=null,oq=null,lq=null,uq=null,cq=!1,hq=new Array(50),dq=new Array(50),pq=(performance.now(),null),fq=null;nq.params.paused=!1,nq.params.greedyLearner=!1,nq.params.framerate=60,nq.params.showGazeDot=!1,nq.params.getLatestVideoFrameTimestamp=()=>{},nq.params.activeCamera={label:"",id:""};let mq=[];var gq=function(e){},yq=gq,bq=["click","move"],wq=performance.now(),vq=new nq.tracker.TFFaceMesh,xq=[new nq.reg.RidgeReg],Aq={TFFacemesh:function(){return new nq.tracker.TFFaceMesh}},kq={ridge:function(){return new nq.reg.RidgeReg},weightedRidge:function(){return new nq.reg.RidgeWeightedReg},threadedRidge:function(){return new nq.reg.RidgeRegThreaded}},Cq="webgazerGlobalData",Sq="webgazerGlobalSettings",Eq={},_q=[];let Iq,Tq,Nq,Oq,Rq,Dq,Mq,Fq,Bq,zq,Lq,Pq;nq.computeValidationBoxSize=function(){var e=aq.videoWidth,t=aq.videoHeight,n=parseInt(aq.style.width),s=parseInt(aq.style.height),r=Math.min(e,t),a=e==Math.max(e,t)?n/e:s/t,i=r*nq.params.faceFeedbackBoxRatio*a;return[(s-i)/2,(n-i)/2,i,i]};let Vq=!1,Wq=!1;function Uq(){null!==lq&&pq?(Vq||Wq||(Wq=!0,setTimeout((()=>{Iq=aq.videoWidth,Tq=aq.videoHeight,Nq=Math.min(Iq,Tq),Oq=Nq*nq.params.faceFeedbackBoxRatio,Rq=(Tq-Oq)/2,Dq=(Iq-Oq)/2,Mq=Dq+Oq,Fq=Rq+Oq,Vq=!0,Wq=!1}),500)),Bq=Iq-pq.left.imagex,Lq=Iq-pq.right.imagex,zq=pq.left.imagey,Pq=pq.right.imagey,lq.style.border=Vq&&Bq>Dq&&BqDq&&LqRq&&zqRq&&Pq=1e3/nq.params.framerate&&(Xq=Kq,fq=jq(),fq=await fq,yq(fq),Zq=!0,fq)){Hq.push(fq);var e=0,t=0,n=Hq.length;for(var s in Hq.data)e+=Hq.get(s).x,t+=Hq.get(s).y;var r=VG.bound({x:e/n,y:t/n});nq.params.storingPoints&&(nq.storePoints(r.x,r.y,$q),50==++$q&&($q=0)),uq.style.opacity="",uq.style.left=`${r.x}px`,uq.style.top=`${r.y}px`}requestAnimationFrame(Qq)}var Jq=function(e,t,n){if(!nq.params.paused){if(0===xq.length)return null;for(var s in xq)pq&&xq[s].addData(pq,[e,t],n)}},ej=async function(e){Jq(e.clientX,e.clientY,bq[0]),nq.params.saveDataAcrossSessions&&await async function(){var e=xq[0].getData()||_q;oU().setItem(Sq,Eq),oU().setItem(Cq,e)}()},tj=function(e){if(!nq.params.paused){var t=performance.now();tnq.params.activeCamera.id?{video:{...e.video,deviceId:nq.params.activeCamera.id}}:e;function ij(e){navigator.vendor&&navigator.vendor.indexOf("Apple")>-1?(e.style.opacity=nq.params.showVideo?"1":"0",e.style.display="block"):e.style.display=nq.params.showVideo?"block":"none"}nq._begin=function(e,t){if(!nq.params.videoIsOn)return void 0===navigator.mediaDevices&&(navigator.mediaDevices={}),void 0===navigator.mediaDevices.getUserMedia&&(navigator.mediaDevices.getUserMedia=function(e){var t=navigator.webkitGetUserMedia||navigator.mozGetUserMedia;return t?new Promise((function(n,s){t.call(navigator,e,n,s)})):Promise.reject(new Error("Unfortunately, your browser does not support access to the webcam through the getUserMedia API. Try to use the latest version of Google Chrome, Mozilla Firefox, Opera, or Microsoft Edge instead."))}),new Promise((async(n,s)=>{let r;try{if(void 0!==navigator.mediaDevices&&"function"==typeof navigator.mediaDevices.enumerateDevices){const s=await navigator.mediaDevices.enumerateDevices();if((e=>{let t,n;mq=[],e.forEach((e=>{"videoinput"===e.kind&&mq.push(e),e.label.includes("FaceTime")&&(t=e.label,n=e.deviceId)})),mq.length&&(nq.params.activeCamera.label=t||mq[0].label,nq.params.activeCamera.id=n||mq[0].deviceId)})(s),0===mq.length)throw t(mq),JSON.stringify({message:"We can't find any video input devices.",devices:s});try{r=await navigator.mediaDevices.getUserMedia(aj(nq.params.camConstraints))}catch(e){throw t(mq),e}rj(e?"video":"all",r).then((()=>{mq.length>1&&(e=>{const t=rq,n=document.createElement("select");n.className=n.id="webgazer-videoinput-select",n.name="videoinput",e.forEach(((e,t)=>{var s;n.innerHTML+=``})),n.onchange=e=>{const[t,s]=n.value.split("%");nq.params.activeCamera.label=s,nq.params.activeCamera.id=t,nq.setCameraConstraints(aj(nq.params.camConstraints))},t.appendChild(n)})(mq)})),nq.params.videoIsOn=!0,e||n(nq)}else t([])}catch(e){throw aq=null,r=null,t([]),s(e),JSON.stringify({error:e,devices:await navigator.mediaDevices.enumerateDevices()})}}));rj("gaze")},nq.isReady=function(){return null!==iq&&iq.width>0},nq.pause=function(){return nq.params.paused=!0,nq},nq.stopLearning=function(e){return sj(e),nq},nq.startLearning=function(e){return nj(e),nq},nq.resume=async function(){return nq.params.paused?(nq.params.paused=!1,Zq=!0,oj.current&&(clearInterval(oj.current),oj.current=void 0,cq=!1,uq.style.backgroundColor="",uq.style.opacity=""),await Qq(),nq):nq},nq.end=function(e=!1){return e&&(Hq=new VG.DataWindow(4),$q=0,Kq=null,Xq=-1,Vq=!1,nq.params.videoIsOn=!1,setTimeout((()=>{nq.stopVideo(),rq.remove()}),500)),nq},nq.stopVideo=function(){return sq.getTracks()[0].stop(),nq},nq.detectCompatibility=function(){return void 0!==(navigator.mediaDevices.getUserMedia||navigator.getUserMedia||navigator.webkitGetUserMedia||navigator.mozGetUserMedia)},nq.showVideoPreview=function(e){return nq.params.showVideoPreview=e,nq.showVideo(e&&nq.params.showVideo),nq.showFaceOverlay(e&&nq.params.showFaceOverlay),nq.showFaceFeedbackBox(e&&nq.params.showFaceFeedbackBox),nq},nq.showVideo=function(e,t=.8){return nq.params.showVideo=e,aq&&ij(aq),rq&&ij(rq),nq},nq.showFaceOverlay=function(e){return nq.params.showFaceOverlay=e,oq&&(oq.style.display=e?"block":"none"),nq},nq.showFaceFeedbackBox=function(e){return nq.params.showFaceFeedbackBox=e,lq&&(lq.style.display=e?"block":"none"),nq},nq.showPredictionPoints=function(e){return nq.params.showGazeDot=e,uq&&(uq.style.display=e?"block":"none"),nq};const oj={current:void 0};function lj(e,t){iq&&(iq.width=e,iq.height=t),oq&&(oq.width=e,oq.height=t)}nq.popPredictionPoints=function(){return oj.current&&(clearInterval(oj.current),oj.current=void 0,cq=!1),uq&&nq.params.showGazeDot&&(cq=!0,uq.style.backgroundColor="red",uq.style.opacity=1,oj.current=setInterval((()=>{uq.style.opacity-=.02,uq.style.opacity<=.02&&(clearInterval(oj.current),oj.current=void 0,cq=!1,uq.style.backgroundColor="",uq.style.opacity="")}),50)),nq},nq.saveDataAcrossSessions=function(e){return nq.params.saveDataAcrossSessions=e,nq},nq.applyKalmanFilter=function(e){return nq.params.applyKalmanFilter=e,nq},nq.setCameraConstraints=async function(e){if(nq.params.camConstraints=e,sq){nq.pause();try{sq.getVideoTracks().forEach((e=>{e.stop()}));const e=await navigator.mediaDevices.getUserMedia(nq.params.camConstraints);setTimeout((()=>{const t=e.getVideoTracks()[0].getSettings();sq=e,aq.srcObject=e,lj(t.width,t.height)}),1500)}catch(e){return}await nq.resume()}},nq.setStaticVideo=function(e){return e,nq},nq.setVideoViewerSize=function(e,t){nq.params.videoViewerWidth=e,nq.params.videoViewerHeight=t,aq.style.width=e+"px",aq.style.height=t+"px",rq.style.width=e+"px",rq.style.height=t+"px",oq.style.width=e+"px",oq.style.height=t+"px";var n=nq.computeValidationBoxSize();lq.style.top=n[0]+"px",lq.style.left=n[1]+"px",lq.style.width=n[2]+"px",lq.style.height=n[3]+"px"},nq.addMouseEventListeners=function(){return nj(),nq},nq.removeMouseEventListeners=function(){return sj(),nq},nq.recordScreenPosition=function(e,t,n){return Jq(e,t,n||bq[0]),nq},nq.storePoints=function(e,t,n){hq[n]=e,dq[n]=t},nq.setTracker=function(e){if(void 0===Aq[e]){for(var t in Aq);return nq}return vq=Aq[e](),nq},nq.setRegression=function(e){if(void 0===kq[e]){for(var t in kq);return nq}return _q=xq[0].getData(),(xq=[kq[e]()])[0].setData(_q),nq},nq.addTrackerModule=function(e,t){Aq[e]=function(){return new t}},nq.addRegressionModule=function(e,t){kq[e]=function(){return new t}},nq.addRegression=function(e){var t=kq[e]();return _q=xq[0].getData(),t.setData(_q),xq.push(t),nq},nq.setGazeListener=function(e){return yq=e,nq},nq.clearGazeListener=function(){return yq=gq,nq},nq.setVideoElementCanvas=function(e){return iq=e},nq.clearData=async function(){!function(){for(var e in oU().clear(),xq)xq[e].init()}()},nq.getTracker=function(){return vq},nq.getRegression=function(){return xq},nq.getCurrentPrediction=async function(e=0,t=150,n=5){let s=0;const r=[],a=[];for(let e=0;et.x>=0&&t.x<=window.innerWidth?e+t.x:e),0)/a.length),l=Math.round(a.reduce(((e,t)=>t.y>=0&&t.y<=window.innerHeight?e+t.y:e),0)/a.length);return uq&&(uq.style.left=`${o}px`,uq.style.top=`${l}px`),{x:o,y:l,raw:a.map((e=>({x:tq(e.x,0),y:tq(e.y,0)})))}},nq.params.getEventTypes=function(){return bq.slice()},nq.getVideoElementCanvas=function(){return iq},nq.getVideoPreviewToCameraResolutionRatio=function(){return[nq.params.videoViewerWidth/aq.videoWidth,nq.params.videoViewerHeight/aq.videoHeight]},nq.getStoredPoints=function(){return[hq,dq]};const uj=nq;class cj{constructor(e){this.calibrator=e,this.webgazer=uj,this.defaultGazeCallback=null,this.defaultDistanceTrackCallback=null,this._initialized={distance:!1,gaze:!1},this._learning=!0,this._running={distance:!1,gaze:!1},this._runningVideo=!1,this._toFixedN=1}begin({pipWidthPx:e},t){this.checkInitialized("gaze",!0)&&(this._running.gaze||(this.webgazer.begin(this.videoFailed.bind(this)),this._running.gaze=!0,this._runningVideo=!0),Re(this.calibrator,e,this.calibrator.params.videoOpacity,this.webgazer,t))}beginVideo({pipWidthPx:e},t){this.checkInitialized("distance",!0)&&(this._runningVideo||(this.webgazer.beginVideo(this.videoFailed.bind(this)),this._runningVideo=!0),Re(this.calibrator,e,this.calibrator.params.videoOpacity,this.webgazer,t))}videoFailed(e){const t=ae(this.calibrator,{showIcon:!0});Q().fire({...t,icon:"error",iconColor:this.calibrator._CONST.COLOR.DARK_RED,showConfirmButton:!1,html:e.length?U.H.RC_errorCameraUseDenied[this.calibrator.L]:U.H.RC_errorNoCamera[this.calibrator.L]})}attachNewCallback(e){this.checkInitialized("gaze",!0)&&this.webgazer.setGazeListener((t=>{if(t){const n=this.calibrator.newGazePositionData=this.getData(t);(0,_.nB)(e,n)}}))}async getGazeNow(e={},t){e=Object.assign({wait:0,frames:5},e);let n=this.calibrator.newGazePositionData=this.getData(await this.webgazer.getCurrentPrediction(0,e.wait,e.frames));return this.webgazer.popPredictionPoints(),(0,_.nB)(t,n),n}end(){this.webgazer.end()}}cj.prototype._init=function({greedyLearner:e,framerate:t,toFixedN:n,showVideo:s,showFaceOverlay:r,showGazer:a},i){this.checkInitialized(i)||("gaze"===i&&(this.webgazer.params.greedyLearner=e,this.webgazer.params.framerate=t,this.webgazer.params.getLatestVideoFrameTimestamp=this._getLatestVideoTimestamp.bind(this),this.showGazer(a)),this._toFixedN=n,this.showVideo(s),this.showFaceOverlay(r),this._initialized[i]=!0)},cj.prototype.checkInitialized=function(e,t=!1){return!!(""===e?this._initialized.gaze||this._initialized.distance:this._initialized[e])},cj.prototype.getData=function(e){let t=performance.now();return{value:{x:(0,_.Nh)(e.x,this._toFixedN),y:(0,_.Nh)(e.y,this._toFixedN),latencyMs:t-this.calibrator._trackingVideoFrameTimestamps.gaze},timestamp:t,raw:e.raw?e.raw:void 0}},cj.prototype.pause=function(){this.webgazer.pause()},cj.prototype.resume=function(){this.webgazer.resume()},cj.prototype.end=function(e,t=!1){if(!this.checkInitialized(e,!0))return;const n=t||!this._initialized.gaze||!this._initialized.distance;"gaze"===e?(this._endGaze(),n&&this.checkInitialized("distance")&&this.calibrator.endDistance(!1,!1),this.calibrator._trackingVideoFrameTimestamps.gaze=0):(this.defaultDistanceTrackCallback=null,n&&this.checkInitialized("gaze")&&this._endGaze()),n?(this._initialized={distance:!1,gaze:!1},this._running={distance:!1,gaze:!1},this.webgazer.end(!0),this._runningVideo=!1):(this._initialized[e]=!1,this._running[e]=!1)},cj.prototype._endGaze=function(){this.webgazer.params.paused=!0,this._learning=!0,this.defaultGazeCallback=null,this.webgazer.clearData(),this.webgazer.params.greedyLearner=!1,this.webgazer.params.framerate=60,this.webgazer.params.getLatestVideoFrameTimestamp=()=>{}},cj.prototype._getLatestVideoTimestamp=function(e){this.calibrator._trackingVideoFrameTimestamps.gaze=e},cj.prototype.startStoringPoints=function(){this.webgazer.params.storingPoints=!0},cj.prototype.stopStoringPoints=function(){this.webgazer.params.storingPoints=!1},cj.prototype.startLearning=function(e){this._learning||(this.webgazer.startLearning(e),this._learning=!0)},cj.prototype.stopLearning=function(e){this._learning&&(this.webgazer.stopLearning(e),this._learning=!1)},cj.prototype.showGazer=function(e){this.webgazer.showPredictionPoints(e)},cj.prototype.showVideo=function(e){this.webgazer.showVideo(e,this.calibrator._params.videoOpacity)},cj.prototype.showFaceOverlay=function(e){this.webgazer.showFaceOverlay(e)},E.A.prototype.performanceCompute=async function(e,t=!1){if(!this.checkInitialized())return;const n=performance.now();let s={_useless:void 0,time:0,randomTime:0};for(;performance.now()-n<500;)s._useless=Array(5e3).fill(Math.floor(10*Math.random())),s.time++;const r=performance.now();for(s._useless=0;performance.now()-r<500;)s._useless+=Math.random(),s.randomTime++;const a={value:{computeArrayFillMHz:(0,_.Nh)(2*s.time/1e6,3),computeRandomMHz:(0,_.Nh)(2*s.randomTime/1e6,3),idealFps:void 0,stressFps:void 0},timestamp:performance.now()};return t||(this.newPerformanceData=a),(0,_.nB)(e,a),a},E.A.prototype.performance=async function(e={},t){if(!this.checkInitialized())return;e=Object.assign({testComputation:!0,testFrameCount:180,testObjectCount:1e4,headline:"🚀 "+U.H.RC_performanceTitle[this.L],description:U.H.RC_performanceIntro[this.L]},e),this._addBackground(),this._addBackgroundText(e.headline,e.description),await(0,_.yy)(200);const n=e.testComputation?await this.performanceCompute(null,!0):{value:{computeArrayFillMHz:void 0,computeRandomMHz:void 0}},s=document.createElement("canvas"),r=s.getContext("2d");s.width=window.innerWidth,s.height=window.innerHeight,this.background.appendChild(s);const a=await hj(r),i=await dj(r,e.testFrameCount,e.testObjectCount),o=this.newPerformanceData={value:{computeArrayFillMHz:n.value.computeArrayFillMHz,computeRandomMHz:n.value.computeRandomMHz,idealFps:Math.round(6e4/(a.end-a.start)),stressFps:Math.round(1e3*e.testFrameCount/(i.end-i.start))},timestamp:performance.now()};return this._removeBackground(),(0,_.nB)(t,o),o};const hj=()=>{let e=60;const t=performance.now();return new Promise((n=>{const s=()=>{e--,e>0?requestAnimationFrame(s):n({start:t,end:performance.now()})};requestAnimationFrame(s)}))},dj=async(e,t,n)=>{let s=t;const r=[],a=["#000000","#333333","#999999"];for(let e=0;e{const n=()=>{e.clearRect(0,0,window.innerWidth,window.innerHeight),e.beginPath();for(let t of r)t.move(),t.draw(e);s--,s>0?requestAnimationFrame(n):t({start:i,end:performance.now()})};requestAnimationFrame(n)}))};class pj{constructor(e){this.w=(0,_.Av)(20,70),this.h=(0,_.Av)(30,70),this.x=-this.w+Math.random()*window.innerWidth,this.y=-this.h/2+Math.random()*(window.innerHeight+this.h/2),this.speed=(0,_.Av)(1,5),this.stroke=e[Math.floor(Math.random()*e.length)]}move(){this.x+=this.speed+.5*Math.random(),this.x>window.innerWidth&&(this.x=-this.w)}draw(e){e.strokeStyle=this.stroke,e.fillRect(this.x,this.y,this.w,this.h),e.strokeRect(this.x,this.y,this.w,this.h)}}E.A.prototype.getEquipment=async function(e,t=!1){if(this.equipment&&!t)return(0,_.nB)(e);this._replaceBackground();const n=this,{CM:s,IN_D:r,IN_F:a}=n._CONST.UNITS,i={};i[s]="centimeter",i[r]="inch (decimal, e.g. 11.5 in)",i[a]="inch (fractional, e.g. 12 3/8 in)";const{value:o}=await Q().fire({...ae(n,{showIcon:!1}),title:"Do you have a ruler or tape measure?",html:"Ideally, it should be long enough to measure your viewing distance, but even a 6 inch (15 cm) ruler can be useful. Please select the units you'll use, or indicate that no ruler or tape measure is available.",input:"select",inputOptions:{...i,none:"No ruler or tape measure is available"},inputPlaceholder:"Select an option",inputValidator:e=>new Promise((t=>{e.length||t("Please select an option.");const s="none"!==e;n.newEquipmentData={value:{has:s,unit:s?e:null,equipment:s?"":null},timestamp:performance.now()},t()}))});return o?(0,_.nB)(e):void 0};var fj=__webpack_require__(2016),mj=__webpack_require__(980),gj=__webpack_require__.n(mj),yj=__webpack_require__(3890),bj=__webpack_require__.n(yj);E.A.prototype._checkScreenSize=async function(e,t,n){await this.getEquipment((()=>{wj(this,e,t,n)}))};const wj=async(e,t,n,s)=>{if(e.equipment&&e.equipment.value.has){e._replaceBackground((0,_.$O)("📏 Measure the Length of the Arrow",'Use your ruler (or tape measure) to measure the length of the arrow. Type your numerical answer into the box. Just digits, period, decimal comma, and / (forward slash) for fractional inches. Then click OK or hit RETURN.'));const t=t=>[()=>{const n=document.createElement("div");e.background.appendChild(n),n.outerHTML=t},()=>{for(let t of e.background.getElementsByClassName("arrow-two-sided-svg"))t.remove()},{callback:()=>{},content:"Ruler is too short"}],n=await(0,fj.K)(e,...t(gj())),r=await(0,fj.K)(e,...t(bj())),a={};if(n){const t=n.value,s=e.windowWidthPx.value,r=(0,_.Nh)(2.54*s/e.screenPpi.value,1);a.horizontal={...t,calibratorArrowWidthCm:r,arrowWidthPx:s}}if(r){const t=r.value,n=e.windowHeightPx.value,s=(0,_.Nh)(2.54*n/e.screenPpi.value,1);a.vertical={...t,calibratorArrowHeightCm:s,arrowHeightPx:n}}if(a.vertical||a.horizontal){const t={value:a,timestamp:n?n.timestamp:r.timestamp,measure:"screenSize"};e.newCheckData=t,(0,_.nB)(s,t)}}e._removeBackground(),(0,_.nB)(t,n)};E.A.prototype._checkDistance=async function(e,t,n,s){await this.getEquipment((()=>vj(this,e,t,n,s)))};const vj=async(e,t,n,s,r)=>{const a="trackDistance"===s,i=()=>{e._removeBackground(),a||(0,_.nB)(t,n)};if(a&&(0,_.nB)(t,n),e.equipment&&e.equipment.value.has){e._replaceBackground((0,_.$O)("📏 Hold Still and Measure Viewing Distance with Ruler",'Hold still so that your viewing distance from the screen stays unchanged from the last measurement. Please measure the distance from the middle of your screen to one of your eyes using your ruler (or measuring tape). If your ruler is not long enough, then select "Ruler is too short" below. Type your numerical answer into the box, then click OK or hit RETURN.'));const t=await(0,fj.K)(e,null,null,{callback:()=>{},content:"Ruler is too short"});if(t){const n={value:{...t.value,calibratorCm:e.viewingDistanceCm.value,calibratorMethod:e.viewingDistanceCm.method},timestamp:t.timestamp,measure:s};return e.newCheckData=n,i(),void(0,_.nB)(r,n)}}i()};var xj=__webpack_require__(7790),Aj=__webpack_require__(627),kj=__webpack_require__.n(Aj),Cj=__webpack_require__(8110),Sj=__webpack_require__.n(Cj),Ej=__webpack_require__(5072),_j=__webpack_require__.n(Ej),Ij=__webpack_require__(7825),Tj=__webpack_require__.n(Ij),Nj=__webpack_require__(7659),Oj=__webpack_require__.n(Nj),Rj=__webpack_require__(5056),Dj=__webpack_require__.n(Rj),Mj=__webpack_require__(540),Fj=__webpack_require__.n(Mj),Bj=__webpack_require__(1113),zj=__webpack_require__.n(Bj),Lj=__webpack_require__(4636),Pj={};Pj.styleTagTransform=zj(),Pj.setAttributes=Dj(),Pj.insert=Oj().bind(null,"head"),Pj.domAPI=Tj(),Pj.insertStyleElement=Fj();_j()(Lj.A,Pj);Lj.A&&Lj.A.locals&&Lj.A.locals;E.A.prototype.removePanel=function(){return!!this._panelStatus.hasPanel&&(this._panel.panelObserver.unobserve(this._panel.panel),this._panel.panel.remove(),this._panel.panel=null,this._panel.panelObserver=null,this._panel.panelTasks=[],this._panel.panelParent=null,this._panel.panelOptions={},this._panel.panelCallback=null,this._panel.panelResolve=null,this._panelStatus.hasPanel=!1,this._panelStatus.panelFinished=!1,Zj(this),!0)},E.A.prototype.resetPanel=function(e=null,t=null,n=null,s=null,r=null){if(!this._panelStatus.hasPanel)return!1;const a=e||[...this._panel.panelTasks],i=n||{...this._panel.panelOptions},o=s&&"function"==typeof s?s:this._panel.panelCallback,l=r||this._panel.panelResolve;return null!==t&&t!==this._panel.panelParent?(this.removePanel(),this.panel(a,t,i,o,l)):(Zj(this),this.panel(a,this._panel.panelParent,i,o,l,!0))},E.A.prototype.panel=async function(e,t,n={},s=null,r=null,a=!1){if(this._panelStatus.hasPanel^a)return!1;if(!Uj(e))return!1;const i=document.querySelector(t);if(!i)return!1;const o=Ge((n=Object.assign({headline:U.H.RC_panelTitle[this.L],description:U.H.RC_panelIntro[this.L],showNextButton:!1,nextHeadline:U.H.RC_panelTitleNext[this.L],nextDescription:U.H.RC_panelIntroNext[this.L],nextButton:U.H.RC_panelButton[this.L],color:"#3490de",debug:!1,i18n:!0,_demoActivateAll:!1},n)).color).darken(20).toString();document.documentElement.style.setProperty("--rc-panel-theme-color",n.color),document.documentElement.style.setProperty("--rc-panel-darken-color",o),document.documentElement.style.setProperty("--rc-panel-theme-color-semi",n.color+"66"),document.documentElement.style.setProperty("--rc-panel-darken-color-semi",o+"88");const l=document.createElement("div");l.className=l.id="rc-panel",this.LD===this._CONST.RTL?l.className+=" rc-lang-rtl":l.className+=" rc-lang-ltr",n.i18n&&(l.innerHTML+='
          '),l.innerHTML+=`

          ${n.headline}

          `,l.innerHTML+=`

          ${n.description}

          `,l.innerHTML+='
          ',a?i.replaceChild(l,this._panel.panel):i.appendChild(l);const u=l.querySelector("#rc-panel-steps"),c=this,h=new ResizeObserver((()=>{jj(u,l.offsetWidth,c.LD)}));if(h.observe(l),jj(u,l.offsetWidth,this.LD),0===e.length)u.className+=" rc-panel-no-steps";else for(let t in e){const s=Gj(this,t,e[t],n);u.appendChild(s)}(n.showNextButton||n._demoActivateAll)&&u.appendChild(qj(e.length,n));Hj(this,{index:0,finished:[]},e,n,s),this._panel.panel=l,this._panel.panelObserver=h,this._panel.panelTasks=e,this._panel.panelParent=t;const d={...n};return n.headline===U.H.RC_panelTitle[this.L]&&delete d.headline,n.description===U.H.RC_panelIntro[this.L]&&delete d.description,n.nextHeadline===U.H.RC_panelTitleNext[this.L]&&delete d.nextHeadline,n.nextDescription===U.H.RC_panelIntroNext[this.L]&&delete d.nextDescription,n.nextButton===U.H.RC_panelButton[this.L]&&delete d.nextButton,this._panel.panelOptions=d,this._panel.panelCallback=s,this._panel.panelResolve=r,this._panelStatus.hasPanel=!0,this._panelStatus.panelFinished=!1,n.i18n&&Yj(this,document.querySelector("#rc-panel-language-parent"),o),n.debug&&(0,xj.K)(this,l,e,s),null===r&&(r=!0),new Promise((e=>{const t=setInterval((()=>{this._panelStatus.panelFinished&&(clearInterval(t),e(r))}),100);this._panelStatus.panelResolveIntervals.push(t)}))};const Vj={screenSize:{use:1,name:U.H.RC_screenSize["en-US"],phraseHandle:"RC_screenSize"},measureDistance:{use:1,name:U.H.RC_viewingDistance["en-US"],phraseHandle:"RC_viewingDistance"},trackDistance:{use:2,name:U.H.RC_distanceTracking["en-US"],phraseHandle:"RC_distanceTracking"},trackGaze:{use:2,name:U.H.RC_gazeTracking["en-US"],phraseHandle:"RC_gazeTracking"},performance:{use:1,name:U.H.RC_performance["en-US"],phraseHandle:"RC_performance"}},Wj=Object.keys(Vj),Uj=e=>{if(!Array.isArray(e))return!1;for(let t of e){if(!("object"!=typeof t||null!==t&&Wj.includes(t.name)))return!1;if("string"==typeof t&&!Wj.includes(t))return!1}return!0},Gj=(e,t,n,s)=>{let r,a;switch(Vj[Kj(n)].use){case 0:case 1:default:r="",a="";break;case 2:r=kj(),a=U.H.RC_panelUsesWebcam[e.L];break;case 3:r=kj()+Sj(),a=U.H.RC_panelUsesWebcamPhone[e.L]}const i=document.createElement("button");return i.className="rc-panel-step rc-panel-step-todo"+(s._demoActivateAll?" rc-panel-step-active":" rc-panel-step-inactive"),i.dataset.index=t,i.innerHTML=(r.length?`

          ${r}

          `:"")+`

          ${Number(t)+1}  ${U.H[Vj[Kj(n)].phraseHandle][e.L]}

          `+(r.length?`

          ${r} ${a}

          `:""),i},qj=(e,t)=>{const n=document.createElement("button");return n.className="rc-panel-step rc-panel-next-button rc-panel-step-inactive",n.dataset.index=e,n.innerHTML=`

          ${t.nextButton}

          `,n},jj=(e,t,n)=>{t<640?(e.classList.add("rc-panel-steps-s"),e.classList.remove("rc-panel-steps-l"),e.childNodes.forEach((e=>{e.classList.add(`rc-lang-${n.toLowerCase()}`)}))):(e.classList.add("rc-panel-steps-l"),e.classList.remove("rc-panel-steps-s"),e.childNodes.forEach((e=>{e.classList.remove("rc-lang-ltr"),e.classList.remove("rc-lang-rtl")})))},Hj=(e,t,n,s,r)=>{document.querySelectorAll(".rc-panel-step").forEach(((a,i)=>{const o=Number(a.dataset.index);if(s._demoActivateAll)a.onclick=()=>{e[Kj(n[i])](...Xj(n[i])),$j(i),t.finished.push(Kj(n[i]));for(let e of n)if(!t.finished.includes(Kj(e)))return;let s=document.querySelector(".rc-panel-next-button");s.classList.replace("rc-panel-step-inactive","rc-panel-step-active"),s.onclick=()=>{e._panelStatus.panelFinished=!0,(0,_.nB)(r,{timestamp:performance.now()})}};else if(o===t.index)if(a.classList.replace("rc-panel-step-inactive","rc-panel-step-active"),a.focus(),o!==n.length)o!==n.length-1||s.showNextButton?a.onclick=()=>{e[Kj(n[t.index])](...Xj(n[t.index],(()=>{$j(t.index),t.index++,Hj(e,t,n,s,r)})))}:a.onclick=()=>{e[Kj(n[t.index])](...Xj(n[t.index],(()=>{$j(t.index)}),r,(()=>{e._panelStatus.panelFinished=!0})))};else if(o===n.length&&s.showNextButton){const{headline:t,nextHeadline:n,description:i,nextDescription:o}=s;t!==n&&(document.querySelector("#rc-panel-title").innerHTML=n),i!==o&&(document.querySelector("#rc-panel-description").innerHTML=o),a.onclick=()=>{e._panelStatus.panelFinished=!0,(0,_.nB)(r,{timestamp:performance.now()})}}}))},$j=e=>{document.querySelectorAll(".rc-panel-step").forEach((t=>{Number(t.dataset.index)===e&&(t.classList.replace("rc-panel-step-todo","rc-panel-step-finished"),t.classList.replace("rc-panel-step-active","rc-panel-step-inactive"))}))},Kj=e=>"string"==typeof e?e:e.name,Xj=(e,t,n=null,s=null)=>{"string"==typeof e&&(e={name:e});const r=()=>{(0,_.nB)(t),(0,_.nB)(n,{timestamp:performance.now()}),(0,_.nB)(s)};return["screenSize","measureDistance","performance"].includes(e.name)?[e.options||{},t=>{(0,_.nB)(e.callback,t),r()}]:"trackGaze"===e.name?[e.options||{},t=>{(0,_.nB)(e.callbackOnCalibrationEnd,t),r()},e.callbackTrack||null]:"trackDistance"===e.name?[e.options||{},t=>{(0,_.nB)(e.callbackStatic,t),r()},e.callbackTrack||null]:void 0},Zj=e=>{e._panelStatus.panelResolveIntervals.forEach((e=>clearInterval(e))),e._panelStatus.panelResolveIntervals=[]},Yj=(e,t,n)=>{let s=`",t.innerHTML=s,document.querySelector("#rc-panel-lang-picker").onchange=()=>{e.newLanguage(document.querySelector("#rc-panel-lang-picker").value),e.resetPanel()}};E.A.prototype.backgroundColor=function(e=null){if(!this.checkInitialized())return null;null!==e&&/^#([0-9A-F]{3}){1,2}$/i.test(e)?this._params.backgroundColor=e:this._params.backgroundColor="#eee";let t=document.querySelector("#calibration-background");return t&&(t.style.background=this.params.backgroundColor),this.params.backgroundColor},E.A.prototype.videoOpacity=function(e=null){if(!this.checkInitialized())return null;null===e||Number(e)!==e||Number(e)>1||Number(e)<0?this._params.videoOpacity=.8:this._params.videoOpacity=e;let t=document.querySelector("#webgazerVideoContainer");return t&&(t.style.opacity=this.params.videoOpacity),this.params.videoOpacity},E.A.prototype.showCancelButton=function(e=!0){return this.checkInitialized()?(this._params.showCancelButton=!!e,this.params.showCancelButton):null};var Qj=__webpack_require__(9725),Jj={};Jj.styleTagTransform=zj(),Jj.setAttributes=Dj(),Jj.insert=Oj().bind(null,"head"),Jj.domAPI=Tj(),Jj.insertStyleElement=Fj();_j()(Qj.A,Jj);Qj.A&&Qj.A.locals&&Qj.A.locals;var eH=__webpack_require__(5151),tH={};tH.styleTagTransform=zj(),tH.setAttributes=Dj(),tH.insert=Oj().bind(null,"head"),tH.domAPI=Tj(),tH.insertStyleElement=Fj();_j()(eH.A,tH);eH.A&&eH.A.locals&&eH.A.locals;var nH=__webpack_require__(2945),sH={};sH.styleTagTransform=zj(),sH.setAttributes=Dj(),sH.insert=Oj().bind(null,"head"),sH.domAPI=Tj(),sH.insertStyleElement=Fj();_j()(nH.A,sH);nH.A&&nH.A.locals&&nH.A.locals;var rH=__webpack_require__(9057),aH={};aH.styleTagTransform=zj(),aH.setAttributes=Dj(),aH.insert=Oj().bind(null,"head"),aH.domAPI=Tj(),aH.insertStyleElement=Fj();_j()(rH.A,aH);rH.A&&rH.A.locals&&rH.A.locals;var iH=__webpack_require__(4889),oH={};oH.styleTagTransform=zj(),oH.setAttributes=Dj(),oH.insert=Oj().bind(null,"head"),oH.domAPI=Tj(),oH.insertStyleElement=Fj();_j()(iH.A,oH);iH.A&&iH.A.locals&&iH.A.locals;var lH=__webpack_require__(2636),uH={};uH.styleTagTransform=zj(),uH.setAttributes=Dj(),uH.insert=Oj().bind(null,"head"),uH.domAPI=Tj(),uH.insertStyleElement=Fj();_j()(lH.A,uH);lH.A&&lH.A.locals&&lH.A.locals;var cH=__webpack_require__(2921),hH={};hH.styleTagTransform=zj(),hH.setAttributes=Dj(),hH.insert=Oj().bind(null,"head"),hH.domAPI=Tj(),hH.insertStyleElement=Fj();_j()(cH.A,hH);cH.A&&cH.A.locals&&cH.A.locals;var dH=__webpack_require__(7271),pH={};pH.styleTagTransform=zj(),pH.setAttributes=Dj(),pH.insert=Oj().bind(null,"head"),pH.domAPI=Tj(),pH.insertStyleElement=Fj();_j()(dH.A,pH);dH.A&&dH.A.locals&&dH.A.locals;var fH=__webpack_require__(2551),mH={};mH.styleTagTransform=zj(),mH.setAttributes=Dj(),mH.insert=Oj().bind(null,"head"),mH.domAPI=Tj(),mH.insertStyleElement=Fj();_j()(fH.A,mH);fH.A&&fH.A.locals&&fH.A.locals;var gH=__webpack_require__(8470),yH={};yH.styleTagTransform=zj(),yH.setAttributes=Dj(),yH.insert=Oj().bind(null,"head"),yH.domAPI=Tj(),yH.insertStyleElement=Fj();_j()(gH.A,yH);gH.A&&gH.A.locals&&gH.A.locals;var bH=__webpack_require__(2535),wH={};wH.styleTagTransform=zj(),wH.setAttributes=Dj(),wH.insert=Oj().bind(null,"head"),wH.domAPI=Tj(),wH.insertStyleElement=Fj();_j()(bH.A,wH);bH.A&&bH.A.locals&&bH.A.locals;var vH=__webpack_require__(663),xH={};xH.styleTagTransform=zj(),xH.setAttributes=Dj(),xH.insert=Oj().bind(null,"head"),xH.domAPI=Tj(),xH.insertStyleElement=Fj();_j()(vH.A,xH);vH.A&&vH.A.locals&&vH.A.locals;var AH=__webpack_require__(5319),kH={};kH.styleTagTransform=zj(),kH.setAttributes=Dj(),kH.insert=Oj().bind(null,"head"),kH.domAPI=Tj(),kH.insertStyleElement=Fj();_j()(AH.A,kH);AH.A&&AH.A.locals&&AH.A.locals;var CH=__webpack_require__(290),SH={};SH.styleTagTransform=zj(),SH.setAttributes=Dj(),SH.insert=Oj().bind(null,"head"),SH.domAPI=Tj(),SH.insertStyleElement=Fj();_j()(CH.A,SH);CH.A&&CH.A.locals&&CH.A.locals;const EH=new E.A;EH.gazeTracker=new cj(EH);const _H=EH})(),__webpack_exports__=__webpack_exports__.default,__webpack_exports__})())); //# sourceMappingURL=RemoteCalibrator.min.js.map \ No newline at end of file diff --git a/lib/RemoteCalibrator.min.js.LICENSE.txt b/lib/RemoteCalibrator.min.js.LICENSE.txt index 1c342c4..b708c5f 100644 --- a/lib/RemoteCalibrator.min.js.LICENSE.txt +++ b/lib/RemoteCalibrator.min.js.LICENSE.txt @@ -8,7 +8,7 @@ /*! * * @license - * EasyEyes Remote Calibrator (remote-calibrator) Version 0.7.7 + * EasyEyes Remote Calibrator (remote-calibrator) Version 0.7.8 * https://github.com/EasyEyes/remote-calibrator * * Copyright 2024 New York University. All Rights Reserved diff --git a/package-lock.json b/package-lock.json index 215262a..07812f1 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "remote-calibrator", - "version": "0.7.7", + "version": "0.7.8", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "remote-calibrator", - "version": "0.7.7", + "version": "0.7.8", "license": "MIT", "devDependencies": { "@babel/core": "^7.24.6", diff --git a/package.json b/package.json index 69a8a8a..90ef134 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "remote-calibrator", - "version": "0.7.7", + "version": "0.7.8", "description": "Useful calibration tools for remote psychophysics experiments.", "main": "lib/RemoteCalibrator.min.js", "directories": { @@ -70,8 +70,12 @@ "xlsx": "^0.18.5" }, "lint-staged": { - ".": ["biome check --apply --no-errors-on-unmatched"], - "*.{css,scss,md,html}": ["prettier --write"] + ".": [ + "biome check --apply --no-errors-on-unmatched" + ], + "*.{css,scss,md,html}": [ + "prettier --write" + ] }, "files": [ "lib",